From 9716bf9d73de8716b86660514990200700c63bc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=ADdia=20Tarcza?= <100163235+diatrcz@users.noreply.github.com> Date: Fri, 5 Jun 2026 13:59:51 +0200 Subject: [PATCH 01/16] build: swap jest with vitest MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Lídia Tarcza <100163235+diatrcz@users.noreply.github.com> --- eslint.config.mjs | 2 +- package-lock.json | 5874 +++++++---------- package.json | 5 +- packages/ruleset/package.json | 16 +- .../ruleset/test/rules/circular-refs.test.js | 3 +- .../rules/collection-array-property.test.js | 2 +- .../rules/no-operation-requestbody.test.js | 3 +- .../property-consistent-name-and-type.test.js | 3 +- .../ruleset/test/utils/logger-factory.test.js | 3 +- .../test/utils/pagination-utils.test.js | 3 +- .../test/utils/schema-finding-utils.test.js | 3 +- packages/utilities/package.json | 19 +- packages/validator/package.json | 24 +- .../tests/configuration-manager.test.js | 3 +- .../tests/error-handling.test.js | 3 +- .../tests/expected-output.test.js | 3 +- .../tests/option-handling.test.js | 3 +- .../cli-validator/tests/run-validator.test.js | 3 +- .../markdown-report/markdown-table.test.js | 3 +- .../test/scoring-tool/metrics.test.js | 15 +- .../test/scoring-tool/output.test.js | 3 +- .../validator/test/scoring-tool/score.test.js | 3 +- 22 files changed, 2336 insertions(+), 3663 deletions(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index eecbc4631..2a0121f65 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -13,7 +13,7 @@ export default [ languageOptions: { globals: { ...globals.node, - ...globals.jest, + ...globals.vitest, ...globals.mocha, }, }, diff --git a/package-lock.json b/package-lock.json index f7658cbc9..9a5f1ed92 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22,10 +22,10 @@ "eslint-config-prettier": "10.1.8", "eslint-plugin-prettier": "5.5.5", "globals": "17.6.0", - "jest": "29.7.0", "jsdoc": "4.0.4", "mustache": "4.2.0", - "semantic-release": "25.0.3" + "semantic-release": "25.0.3", + "vitest": "4.1.8" } }, "node_modules/@actions/core": { @@ -91,153 +91,6 @@ "node": ">=6.9.0" } }, - "node_modules/@babel/compat-data": { - "version": "7.29.3", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.29.3.tgz", - "integrity": "sha512-LIVqM46zQWZhj17qA8wb4nW/ixr2y1Nw+r1etiAWgRM6U1IqP+LNhL1yg440jYZR72jCWcWbLWzIosH+uP1fqg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/core": { - "version": "7.29.0", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.29.0.tgz", - "integrity": "sha512-CGOfOJqWjg2qW/Mb6zNsDm+u5vFQ8DxXfbM09z69p5Z6+mE1ikP2jUXw+j42Pf1XTYED2Rni5f95npYeuwMDQA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/code-frame": "^7.29.0", - "@babel/generator": "^7.29.0", - "@babel/helper-compilation-targets": "^7.28.6", - "@babel/helper-module-transforms": "^7.28.6", - "@babel/helpers": "^7.28.6", - "@babel/parser": "^7.29.0", - "@babel/template": "^7.28.6", - "@babel/traverse": "^7.29.0", - "@babel/types": "^7.29.0", - "@jridgewell/remapping": "^2.3.5", - "convert-source-map": "^2.0.0", - "debug": "^4.1.0", - "gensync": "^1.0.0-beta.2", - "json5": "^2.2.3", - "semver": "^6.3.1" - }, - "engines": { - "node": ">=6.9.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/babel" - } - }, - "node_modules/@babel/core/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true, - "license": "ISC", - "bin": { - "semver": "bin/semver.js" - } - }, - "node_modules/@babel/generator": { - "version": "7.29.1", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.29.1.tgz", - "integrity": "sha512-qsaF+9Qcm2Qv8SRIMMscAvG4O3lJ0F1GuMo5HR/Bp02LopNgnZBC/EkbevHFeGs4ls/oPz9v+Bsmzbkbe+0dUw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/parser": "^7.29.0", - "@babel/types": "^7.29.0", - "@jridgewell/gen-mapping": "^0.3.12", - "@jridgewell/trace-mapping": "^0.3.28", - "jsesc": "^3.0.2" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-compilation-targets": { - "version": "7.28.6", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.28.6.tgz", - "integrity": "sha512-JYtls3hqi15fcx5GaSNL7SCTJ2MNmjrkHXg4FSpOA/grxK8KwyZ5bubHsCq8FXCkua6xhuaaBit+3b7+VZRfcA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/compat-data": "^7.28.6", - "@babel/helper-validator-option": "^7.27.1", - "browserslist": "^4.24.0", - "lru-cache": "^5.1.1", - "semver": "^6.3.1" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-compilation-targets/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true, - "license": "ISC", - "bin": { - "semver": "bin/semver.js" - } - }, - "node_modules/@babel/helper-globals": { - "version": "7.28.0", - "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.28.0.tgz", - "integrity": "sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-module-imports": { - "version": "7.28.6", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.28.6.tgz", - "integrity": "sha512-l5XkZK7r7wa9LucGw9LwZyyCUscb4x37JWTPz7swwFE/0FMQAGpiWUZn8u9DzkSBWEcK25jmvubfpw2dnAMdbw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/traverse": "^7.28.6", - "@babel/types": "^7.28.6" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-module-transforms": { - "version": "7.28.6", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.28.6.tgz", - "integrity": "sha512-67oXFAYr2cDLDVGLXTEABjdBJZ6drElUSI7WKp70NrpyISso3plG9SAGEF6y7zbha/wOzUByWWTJvEDVNIUGcA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-module-imports": "^7.28.6", - "@babel/helper-validator-identifier": "^7.28.5", - "@babel/traverse": "^7.28.6" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" - } - }, - "node_modules/@babel/helper-plugin-utils": { - "version": "7.28.6", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.28.6.tgz", - "integrity": "sha512-S9gzZ/bz83GRysI7gAD4wPT/AI3uCnY+9xn+Mx/KPs2JwHJIz1W8PZkg2cqyt3RNOBM8ejcXhV6y8Og7ly/Dug==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, "node_modules/@babel/helper-string-parser": { "version": "7.27.1", "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz", @@ -258,30 +111,6 @@ "node": ">=6.9.0" } }, - "node_modules/@babel/helper-validator-option": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.27.1.tgz", - "integrity": "sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helpers": { - "version": "7.29.2", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.29.2.tgz", - "integrity": "sha512-HoGuUs4sCZNezVEKdVcwqmZN8GoHirLUcLaYVNBK2J0DadGtdcqgr3BCbvH8+XUo4NGjNl3VOtSjEKNzqfFgKw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/template": "^7.28.6", - "@babel/types": "^7.29.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, "node_modules/@babel/parser": { "version": "7.29.3", "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.3.tgz", @@ -298,1462 +127,1377 @@ "node": ">=6.0.0" } }, - "node_modules/@babel/plugin-syntax-async-generators": { - "version": "7.8.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", - "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==", + "node_modules/@babel/types": { + "version": "7.29.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.0.tgz", + "integrity": "sha512-LwdZHpScM4Qz8Xw2iKSzS+cfglZzJGvofQICy7W7v4caru4EaAmyUuO6BGrbyQ2mYV11W0U8j5mBhd14dd3B0A==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" + "@babel/helper-string-parser": "^7.27.1", + "@babel/helper-validator-identifier": "^7.28.5" }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@colors/colors": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", + "integrity": "sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==", + "dev": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">=0.1.90" } }, - "node_modules/@babel/plugin-syntax-bigint": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-bigint/-/plugin-syntax-bigint-7.8.3.tgz", - "integrity": "sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==", + "node_modules/@emnapi/core": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.10.0.tgz", + "integrity": "sha512-yq6OkJ4p82CAfPl0u9mQebQHKPJkY7WrIuk205cTYnYe+k2Z8YBh11FrbRG/H6ihirqcacOgl2BIO8oyMQLeXw==", "dev": true, "license": "MIT", + "optional": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "@emnapi/wasi-threads": "1.2.1", + "tslib": "^2.4.0" } }, - "node_modules/@babel/plugin-syntax-class-properties": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz", - "integrity": "sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==", + "node_modules/@emnapi/runtime": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.10.0.tgz", + "integrity": "sha512-ewvYlk86xUoGI0zQRNq/mC+16R1QeDlKQy21Ki3oSYXNgLb45GV1P6A0M+/s6nyCuNDqe5VpaY84BzXGwVbwFA==", "dev": true, "license": "MIT", + "optional": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.12.13" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "tslib": "^2.4.0" } }, - "node_modules/@babel/plugin-syntax-class-static-block": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz", - "integrity": "sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw==", + "node_modules/@emnapi/wasi-threads": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.2.1.tgz", + "integrity": "sha512-uTII7OYF+/Mes/MrcIOYp5yOtSMLBWSIoLPpcgwipoiKbli6k322tcoFsxoIIxPDqW01SQGAgko4EzZi2BNv2w==", "dev": true, "license": "MIT", + "optional": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "tslib": "^2.4.0" } }, - "node_modules/@babel/plugin-syntax-import-attributes": { - "version": "7.28.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.28.6.tgz", - "integrity": "sha512-jiLC0ma9XkQT3TKJ9uYvlakm66Pamywo+qwL+oL8HJOvc6TWdZXVfhqJr8CCzbSGUAbDOzlGHJC1U+vRfLQDvw==", + "node_modules/@eslint-community/eslint-utils": { + "version": "4.9.1", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.1.tgz", + "integrity": "sha512-phrYmNiYppR7znFEdqgfWHXR6NCkZEK7hwWDHZUjit/2/U0r6XvkDl0SYnoM51Hq7FhCGdLDT6zxCCOY1hexsQ==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.28.6" + "eslint-visitor-keys": "^3.4.3" }, "engines": { - "node": ">=6.9.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" }, "peerDependencies": { - "@babel/core": "^7.0.0-0" + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" } }, - "node_modules/@babel/plugin-syntax-import-meta": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz", - "integrity": "sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==", + "node_modules/@eslint-community/regexpp": { + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.2.tgz", + "integrity": "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==", "dev": true, "license": "MIT", - "dependencies": { - "@babel/helper-plugin-utils": "^7.10.4" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" } }, - "node_modules/@babel/plugin-syntax-json-strings": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz", - "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==", + "node_modules/@eslint/config-array": { + "version": "0.23.5", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.23.5.tgz", + "integrity": "sha512-Y3kKLvC1dvTOT+oGlqNQ1XLqK6D1HU2YXPc52NmAlJZbMMWDzGYXMiPRJ8TYD39muD/OTjlZmNJ4ib7dvSrMBA==", "dev": true, - "license": "MIT", + "license": "Apache-2.0", "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" + "@eslint/object-schema": "^3.0.5", + "debug": "^4.3.1", + "minimatch": "^10.2.4" }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" } }, - "node_modules/@babel/plugin-syntax-jsx": { - "version": "7.28.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.28.6.tgz", - "integrity": "sha512-wgEmr06G6sIpqr8YDwA2dSRTE3bJ+V0IfpzfSY3Lfgd7YWOaAdlykvJi13ZKBt8cZHfgH1IXN+CL656W3uUa4w==", + "node_modules/@eslint/config-array/node_modules/minimatch": { + "version": "10.2.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.5.tgz", + "integrity": "sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg==", "dev": true, - "license": "MIT", + "license": "BlueOak-1.0.0", "dependencies": { - "@babel/helper-plugin-utils": "^7.28.6" + "brace-expansion": "^5.0.5" }, "engines": { - "node": ">=6.9.0" + "node": "18 || 20 || >=22" }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/@babel/plugin-syntax-logical-assignment-operators": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz", - "integrity": "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==", + "node_modules/@eslint/config-helpers": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.6.0.tgz", + "integrity": "sha512-ii6Bw9jJ2zi2cWA2Z+9/QZ/+3DX6kwaV5Q986D/CdP3Lap3w/pgQZ373FV7byY/i7L4IRH/G43I5dz1ClsCbpA==", "dev": true, - "license": "MIT", + "license": "Apache-2.0", "dependencies": { - "@babel/helper-plugin-utils": "^7.10.4" + "@eslint/core": "^1.2.1" }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" } }, - "node_modules/@babel/plugin-syntax-nullish-coalescing-operator": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", - "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", + "node_modules/@eslint/core": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-1.2.1.tgz", + "integrity": "sha512-MwcE1P+AZ4C6DWlpin/OmOA54mmIZ/+xZuJiQd4SyB29oAJjN30UW9wkKNptW2ctp4cEsvhlLY/CsQ1uoHDloQ==", "dev": true, - "license": "MIT", + "license": "Apache-2.0", "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" + "@types/json-schema": "^7.0.15" }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" } }, - "node_modules/@babel/plugin-syntax-numeric-separator": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz", - "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==", + "node_modules/@eslint/js": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-10.0.1.tgz", + "integrity": "sha512-zeR9k5pd4gxjZ0abRoIaxdc7I3nDktoXZk2qOv9gCNWx3mVwEn32VRhyLaRsDiJjTs0xq/T8mfPtyuXu7GWBcA==", "dev": true, "license": "MIT", - "dependencies": { - "@babel/helper-plugin-utils": "^7.10.4" + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + }, + "funding": { + "url": "https://eslint.org/donate" }, "peerDependencies": { - "@babel/core": "^7.0.0-0" + "eslint": "^10.0.0" + }, + "peerDependenciesMeta": { + "eslint": { + "optional": true + } } }, - "node_modules/@babel/plugin-syntax-object-rest-spread": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", - "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", + "node_modules/@eslint/object-schema": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-3.0.5.tgz", + "integrity": "sha512-vqTaUEgxzm+YDSdElad6PiRoX4t8VGDjCtt05zn4nU810UIx/uNEV7/lZJ6KwFThKZOzOxzXy48da+No7HZaMw==", "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "license": "Apache-2.0", + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" } }, - "node_modules/@babel/plugin-syntax-optional-catch-binding": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz", - "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", + "node_modules/@eslint/plugin-kit": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.7.1.tgz", + "integrity": "sha512-rZAP3aVgB9ds9KOeUSL+zZ21hPmo8dh6fnIFwRQj5EAZl9gzR7wxYbYXYysAM8CTqGmUGyp2S4kUdV17MnGuWQ==", "dev": true, - "license": "MIT", + "license": "Apache-2.0", "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" + "@eslint/core": "^1.2.1", + "levn": "^0.4.1" }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" } }, - "node_modules/@babel/plugin-syntax-optional-chaining": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", - "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", + "node_modules/@humanfs/core": { + "version": "0.19.2", + "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.2.tgz", + "integrity": "sha512-UhXNm+CFMWcbChXywFwkmhqjs3PRCmcSa/hfBgLIb7oQ5HNb1wS0icWsGtSAUNgefHeI+eBrA8I1fxmbHsGdvA==", "dev": true, - "license": "MIT", + "license": "Apache-2.0", "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" + "@humanfs/types": "^0.15.0" }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "engines": { + "node": ">=18.18.0" } }, - "node_modules/@babel/plugin-syntax-private-property-in-object": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz", - "integrity": "sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg==", + "node_modules/@humanfs/node": { + "version": "0.16.8", + "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.8.tgz", + "integrity": "sha512-gE1eQNZ3R++kTzFUpdGlpmy8kDZD/MLyHqDwqjkVQI0JMdI1D51sy1H958PNXYkM2rAac7e5/CnIKZrHtPh3BQ==", "dev": true, - "license": "MIT", + "license": "Apache-2.0", "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5" + "@humanfs/core": "^0.19.2", + "@humanfs/types": "^0.15.0", + "@humanwhocodes/retry": "^0.4.0" }, "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "node": ">=18.18.0" } }, - "node_modules/@babel/plugin-syntax-top-level-await": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz", - "integrity": "sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5" - }, + "node_modules/@humanfs/types": { + "version": "0.15.0", + "resolved": "https://registry.npmjs.org/@humanfs/types/-/types-0.15.0.tgz", + "integrity": "sha512-ZZ1w0aoQkwuUuC7Yf+7sdeaNfqQiiLcSRbfI08oAxqLtpXQr9AIVX7Ay7HLDuiLYAaFPu8oBYNq/QIi9URHJ3Q==", + "dev": true, + "license": "Apache-2.0", "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "node": ">=18.18.0" } }, - "node_modules/@babel/plugin-syntax-typescript": { - "version": "7.28.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.28.6.tgz", - "integrity": "sha512-+nDNmQye7nlnuuHDboPbGm00Vqg3oO8niRRL27/4LYHUsHYh0zJ1xWOz0uRwNFmM1Avzk8wZbc6rdiYhomzv/A==", + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-plugin-utils": "^7.28.6" - }, + "license": "Apache-2.0", "engines": { - "node": ">=6.9.0" + "node": ">=12.22" }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" } }, - "node_modules/@babel/template": { - "version": "7.28.6", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.28.6.tgz", - "integrity": "sha512-YA6Ma2KsCdGb+WC6UpBVFJGXL58MDA6oyONbjyF/+5sBgxY/dwkhLogbMT2GXXyU84/IhRw/2D1Os1B/giz+BQ==", + "node_modules/@humanwhocodes/retry": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.3.tgz", + "integrity": "sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==", "dev": true, - "license": "MIT", - "dependencies": { - "@babel/code-frame": "^7.28.6", - "@babel/parser": "^7.28.6", - "@babel/types": "^7.28.6" - }, + "license": "Apache-2.0", "engines": { - "node": ">=6.9.0" + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" } }, - "node_modules/@babel/traverse": { - "version": "7.29.0", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.29.0.tgz", - "integrity": "sha512-4HPiQr0X7+waHfyXPZpWPfWL/J7dcN1mx9gL6WdQVMbPnF3+ZhSMs8tCxN7oHddJE9fhNE7+lxdnlyemKfJRuA==", + "node_modules/@ibm-cloud/openapi-ruleset": { + "resolved": "packages/ruleset", + "link": true + }, + "node_modules/@ibm-cloud/openapi-ruleset-utilities": { + "resolved": "packages/utilities", + "link": true + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", "dev": true, "license": "MIT", "dependencies": { - "@babel/code-frame": "^7.29.0", - "@babel/generator": "^7.29.0", - "@babel/helper-globals": "^7.28.0", - "@babel/parser": "^7.29.0", - "@babel/template": "^7.28.6", - "@babel/types": "^7.29.0", - "debug": "^4.3.1" - }, - "engines": { - "node": ">=6.9.0" + "@jridgewell/sourcemap-codec": "^1.5.0", + "@jridgewell/trace-mapping": "^0.3.24" } }, - "node_modules/@babel/types": { - "version": "7.29.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.0.tgz", - "integrity": "sha512-LwdZHpScM4Qz8Xw2iKSzS+cfglZzJGvofQICy7W7v4caru4EaAmyUuO6BGrbyQ2mYV11W0U8j5mBhd14dd3B0A==", + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", "dev": true, "license": "MIT", - "dependencies": { - "@babel/helper-string-parser": "^7.27.1", - "@babel/helper-validator-identifier": "^7.28.5" - }, "engines": { - "node": ">=6.9.0" + "node": ">=6.0.0" } }, - "node_modules/@bcoe/v8-coverage": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", - "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", "dev": true, "license": "MIT" }, - "node_modules/@colors/colors": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", - "integrity": "sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==", + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.31", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", "dev": true, "license": "MIT", - "optional": true, - "engines": { - "node": ">=0.1.90" + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" } }, - "node_modules/@eslint-community/eslint-utils": { - "version": "4.9.1", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.1.tgz", - "integrity": "sha512-phrYmNiYppR7znFEdqgfWHXR6NCkZEK7hwWDHZUjit/2/U0r6XvkDl0SYnoM51Hq7FhCGdLDT6zxCCOY1hexsQ==", + "node_modules/@jsdoc/salty": { + "version": "0.2.12", + "resolved": "https://registry.npmjs.org/@jsdoc/salty/-/salty-0.2.12.tgz", + "integrity": "sha512-TuB0x50EoAvEX/UEWITd8Mkn3WhiTjSvbTMCLj0BhsQEl5iUzjXdA0bETEVpTk+5TGTLR6QktI9H4hLviVeaAQ==", "dev": true, - "license": "MIT", + "license": "Apache-2.0", "dependencies": { - "eslint-visitor-keys": "^3.4.3" + "lodash": "^4.18.1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" + "node": ">=v12.0.0" + } + }, + "node_modules/@jsep-plugin/assignment": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@jsep-plugin/assignment/-/assignment-1.3.0.tgz", + "integrity": "sha512-VVgV+CXrhbMI3aSusQyclHkenWSAm95WaiKrMxRFam3JSUiIaQjoMIw2sEs/OX4XifnqeQUN4DYbJjlA8EfktQ==", + "license": "MIT", + "engines": { + "node": ">= 10.16.0" }, "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + "jsep": "^0.4.0||^1.0.0" } }, - "node_modules/@eslint-community/regexpp": { - "version": "4.12.2", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.2.tgz", - "integrity": "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==", - "dev": true, + "node_modules/@jsep-plugin/regex": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@jsep-plugin/regex/-/regex-1.0.4.tgz", + "integrity": "sha512-q7qL4Mgjs1vByCaTnDFcBnV9HS7GVPJX5vyVoCgZHNSC9rjwIlmbXG5sUuorR5ndfHAIlJ8pVStxvjXHbNvtUg==", "license": "MIT", "engines": { - "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + "node": ">= 10.16.0" + }, + "peerDependencies": { + "jsep": "^0.4.0||^1.0.0" } }, - "node_modules/@eslint/config-array": { - "version": "0.23.5", - "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.23.5.tgz", - "integrity": "sha512-Y3kKLvC1dvTOT+oGlqNQ1XLqK6D1HU2YXPc52NmAlJZbMMWDzGYXMiPRJ8TYD39muD/OTjlZmNJ4ib7dvSrMBA==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@eslint/object-schema": "^3.0.5", - "debug": "^4.3.1", - "minimatch": "^10.2.4" - }, + "node_modules/@jsep-plugin/ternary": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/@jsep-plugin/ternary/-/ternary-1.1.4.tgz", + "integrity": "sha512-ck5wiqIbqdMX6WRQztBL7ASDty9YLgJ3sSAK5ZpBzXeySvFGCzIvM6UiAI4hTZ22fEcYQVV/zhUbNscggW+Ukg==", + "license": "MIT", "engines": { - "node": "^20.19.0 || ^22.13.0 || >=24" + "node": ">= 10.16.0" + }, + "peerDependencies": { + "jsep": "^0.4.0||^1.0.0" } }, - "node_modules/@eslint/config-array/node_modules/minimatch": { - "version": "10.2.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.5.tgz", - "integrity": "sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg==", + "node_modules/@napi-rs/wasm-runtime": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.1.4.tgz", + "integrity": "sha512-3NQNNgA1YSlJb/kMH1ildASP9HW7/7kYnRI2szWJaofaS1hWmbGI4H+d3+22aGzXXN9IJ+n+GiFVcGipJP18ow==", "dev": true, - "license": "BlueOak-1.0.0", + "license": "MIT", + "optional": true, "dependencies": { - "brace-expansion": "^5.0.5" - }, - "engines": { - "node": "18 || 20 || >=22" + "@tybys/wasm-util": "^0.10.1" }, "funding": { - "url": "https://github.com/sponsors/isaacs" + "type": "github", + "url": "https://github.com/sponsors/Brooooooklyn" + }, + "peerDependencies": { + "@emnapi/core": "^1.7.1", + "@emnapi/runtime": "^1.7.1" } }, - "node_modules/@eslint/config-helpers": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.6.0.tgz", - "integrity": "sha512-ii6Bw9jJ2zi2cWA2Z+9/QZ/+3DX6kwaV5Q986D/CdP3Lap3w/pgQZ373FV7byY/i7L4IRH/G43I5dz1ClsCbpA==", - "dev": true, - "license": "Apache-2.0", + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "license": "MIT", "dependencies": { - "@eslint/core": "^1.2.1" + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" }, "engines": { - "node": "^20.19.0 || ^22.13.0 || >=24" + "node": ">= 8" } }, - "node_modules/@eslint/core": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@eslint/core/-/core-1.2.1.tgz", - "integrity": "sha512-MwcE1P+AZ4C6DWlpin/OmOA54mmIZ/+xZuJiQd4SyB29oAJjN30UW9wkKNptW2ctp4cEsvhlLY/CsQ1uoHDloQ==", - "dev": true, - "license": "Apache-2.0", + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "license": "MIT", "dependencies": { - "@types/json-schema": "^7.0.15" + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" }, "engines": { - "node": "^20.19.0 || ^22.13.0 || >=24" + "node": ">= 8" } }, - "node_modules/@eslint/js": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-10.0.1.tgz", - "integrity": "sha512-zeR9k5pd4gxjZ0abRoIaxdc7I3nDktoXZk2qOv9gCNWx3mVwEn32VRhyLaRsDiJjTs0xq/T8mfPtyuXu7GWBcA==", + "node_modules/@octokit/auth-token": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-6.0.0.tgz", + "integrity": "sha512-P4YJBPdPSpWTQ1NU4XYdvHvXJJDxM6YwpS0FZHRgP7YFkdVxsWcpWGy/NVqlAA7PcPCnMacXlRm1y2PFZRWL/w==", "dev": true, "license": "MIT", "engines": { - "node": "^20.19.0 || ^22.13.0 || >=24" - }, - "funding": { - "url": "https://eslint.org/donate" - }, - "peerDependencies": { - "eslint": "^10.0.0" - }, - "peerDependenciesMeta": { - "eslint": { - "optional": true - } + "node": ">= 20" } }, - "node_modules/@eslint/object-schema": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-3.0.5.tgz", - "integrity": "sha512-vqTaUEgxzm+YDSdElad6PiRoX4t8VGDjCtt05zn4nU810UIx/uNEV7/lZJ6KwFThKZOzOxzXy48da+No7HZaMw==", + "node_modules/@octokit/core": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/@octokit/core/-/core-7.0.6.tgz", + "integrity": "sha512-DhGl4xMVFGVIyMwswXeyzdL4uXD5OGILGX5N8Y+f6W7LhC1Ze2poSNrkF/fedpVDHEEZ+PHFW0vL14I+mm8K3Q==", "dev": true, - "license": "Apache-2.0", + "license": "MIT", + "dependencies": { + "@octokit/auth-token": "^6.0.0", + "@octokit/graphql": "^9.0.3", + "@octokit/request": "^10.0.6", + "@octokit/request-error": "^7.0.2", + "@octokit/types": "^16.0.0", + "before-after-hook": "^4.0.0", + "universal-user-agent": "^7.0.0" + }, "engines": { - "node": "^20.19.0 || ^22.13.0 || >=24" + "node": ">= 20" } }, - "node_modules/@eslint/plugin-kit": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.7.1.tgz", - "integrity": "sha512-rZAP3aVgB9ds9KOeUSL+zZ21hPmo8dh6fnIFwRQj5EAZl9gzR7wxYbYXYysAM8CTqGmUGyp2S4kUdV17MnGuWQ==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@eslint/core": "^1.2.1", - "levn": "^0.4.1" - }, - "engines": { - "node": "^20.19.0 || ^22.13.0 || >=24" - } - }, - "node_modules/@humanfs/core": { - "version": "0.19.2", - "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.2.tgz", - "integrity": "sha512-UhXNm+CFMWcbChXywFwkmhqjs3PRCmcSa/hfBgLIb7oQ5HNb1wS0icWsGtSAUNgefHeI+eBrA8I1fxmbHsGdvA==", + "node_modules/@octokit/endpoint": { + "version": "11.0.3", + "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-11.0.3.tgz", + "integrity": "sha512-FWFlNxghg4HrXkD3ifYbS/IdL/mDHjh9QcsNyhQjN8dplUoZbejsdpmuqdA76nxj2xoWPs7p8uX2SNr9rYu0Ag==", "dev": true, - "license": "Apache-2.0", + "license": "MIT", "dependencies": { - "@humanfs/types": "^0.15.0" + "@octokit/types": "^16.0.0", + "universal-user-agent": "^7.0.2" }, "engines": { - "node": ">=18.18.0" + "node": ">= 20" } }, - "node_modules/@humanfs/node": { - "version": "0.16.8", - "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.8.tgz", - "integrity": "sha512-gE1eQNZ3R++kTzFUpdGlpmy8kDZD/MLyHqDwqjkVQI0JMdI1D51sy1H958PNXYkM2rAac7e5/CnIKZrHtPh3BQ==", + "node_modules/@octokit/graphql": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-9.0.3.tgz", + "integrity": "sha512-grAEuupr/C1rALFnXTv6ZQhFuL1D8G5y8CN04RgrO4FIPMrtm+mcZzFG7dcBm+nq+1ppNixu+Jd78aeJOYxlGA==", "dev": true, - "license": "Apache-2.0", + "license": "MIT", "dependencies": { - "@humanfs/core": "^0.19.2", - "@humanfs/types": "^0.15.0", - "@humanwhocodes/retry": "^0.4.0" + "@octokit/request": "^10.0.6", + "@octokit/types": "^16.0.0", + "universal-user-agent": "^7.0.0" }, "engines": { - "node": ">=18.18.0" + "node": ">= 20" } }, - "node_modules/@humanfs/types": { - "version": "0.15.0", - "resolved": "https://registry.npmjs.org/@humanfs/types/-/types-0.15.0.tgz", - "integrity": "sha512-ZZ1w0aoQkwuUuC7Yf+7sdeaNfqQiiLcSRbfI08oAxqLtpXQr9AIVX7Ay7HLDuiLYAaFPu8oBYNq/QIi9URHJ3Q==", + "node_modules/@octokit/openapi-types": { + "version": "27.0.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-27.0.0.tgz", + "integrity": "sha512-whrdktVs1h6gtR+09+QsNk2+FO+49j6ga1c55YZudfEG+oKJVvJLQi3zkOm5JjiUXAagWK2tI2kTGKJ2Ys7MGA==", "dev": true, - "license": "Apache-2.0", - "engines": { - "node": ">=18.18.0" - } + "license": "MIT" }, - "node_modules/@humanwhocodes/module-importer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", - "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "node_modules/@octokit/plugin-paginate-rest": { + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-14.0.0.tgz", + "integrity": "sha512-fNVRE7ufJiAA3XUrha2omTA39M6IXIc6GIZLvlbsm8QOQCYvpq/LkMNGyFlB1d8hTDzsAXa3OKtybdMAYsV/fw==", "dev": true, - "license": "Apache-2.0", + "license": "MIT", + "dependencies": { + "@octokit/types": "^16.0.0" + }, "engines": { - "node": ">=12.22" + "node": ">= 20" }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/nzakas" + "peerDependencies": { + "@octokit/core": ">=6" } }, - "node_modules/@humanwhocodes/retry": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.3.tgz", - "integrity": "sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==", + "node_modules/@octokit/plugin-retry": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@octokit/plugin-retry/-/plugin-retry-8.1.0.tgz", + "integrity": "sha512-O1FZgXeiGb2sowEr/hYTr6YunGdSAFWnr2fyW39Ah85H8O33ELASQxcvOFF5LE6Tjekcyu2ms4qAzJVhSaJxTw==", "dev": true, - "license": "Apache-2.0", + "license": "MIT", + "dependencies": { + "@octokit/request-error": "^7.0.2", + "@octokit/types": "^16.0.0", + "bottleneck": "^2.15.3" + }, "engines": { - "node": ">=18.18" + "node": ">= 20" }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/nzakas" + "peerDependencies": { + "@octokit/core": ">=7" } }, - "node_modules/@ibm-cloud/openapi-ruleset": { - "resolved": "packages/ruleset", - "link": true - }, - "node_modules/@ibm-cloud/openapi-ruleset-utilities": { - "resolved": "packages/utilities", - "link": true - }, - "node_modules/@istanbuljs/load-nyc-config": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", - "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", + "node_modules/@octokit/plugin-throttling": { + "version": "11.0.3", + "resolved": "https://registry.npmjs.org/@octokit/plugin-throttling/-/plugin-throttling-11.0.3.tgz", + "integrity": "sha512-34eE0RkFCKycLl2D2kq7W+LovheM/ex3AwZCYN8udpi6bxsyjZidb2McXs69hZhLmJlDqTSP8cH+jSRpiaijBg==", "dev": true, - "license": "ISC", + "license": "MIT", "dependencies": { - "camelcase": "^5.3.1", - "find-up": "^4.1.0", - "get-package-type": "^0.1.0", - "js-yaml": "^3.13.1", - "resolve-from": "^5.0.0" + "@octokit/types": "^16.0.0", + "bottleneck": "^2.15.3" }, "engines": { - "node": ">=8" + "node": ">= 20" + }, + "peerDependencies": { + "@octokit/core": "^7.0.0" } }, - "node_modules/@istanbuljs/load-nyc-config/node_modules/argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "node_modules/@octokit/request": { + "version": "10.0.8", + "resolved": "https://registry.npmjs.org/@octokit/request/-/request-10.0.8.tgz", + "integrity": "sha512-SJZNwY9pur9Agf7l87ywFi14W+Hd9Jg6Ifivsd33+/bGUQIjNujdFiXII2/qSlN2ybqUHfp5xpekMEjIBTjlSw==", "dev": true, "license": "MIT", "dependencies": { - "sprintf-js": "~1.0.2" + "@octokit/endpoint": "^11.0.3", + "@octokit/request-error": "^7.0.2", + "@octokit/types": "^16.0.0", + "fast-content-type-parse": "^3.0.0", + "json-with-bigint": "^3.5.3", + "universal-user-agent": "^7.0.2" + }, + "engines": { + "node": ">= 20" } }, - "node_modules/@istanbuljs/load-nyc-config/node_modules/find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "node_modules/@octokit/request-error": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-7.1.0.tgz", + "integrity": "sha512-KMQIfq5sOPpkQYajXHwnhjCC0slzCNScLHs9JafXc4RAJI+9f+jNDlBNaIMTvazOPLgb4BnlhGJOTbnN0wIjPw==", "dev": true, "license": "MIT", "dependencies": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" + "@octokit/types": "^16.0.0" }, "engines": { - "node": ">=8" + "node": ">= 20" } }, - "node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml": { - "version": "3.14.2", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.2.tgz", - "integrity": "sha512-PMSmkqxr106Xa156c2M265Z+FTrPl+oxd/rgOQy2tijQeK5TxQ43psO1ZCwhVOSdnn+RzkzlRz/eY4BgJBYVpg==", + "node_modules/@octokit/types": { + "version": "16.0.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-16.0.0.tgz", + "integrity": "sha512-sKq+9r1Mm4efXW1FCk7hFSeJo4QKreL/tTbR0rz/qx/r1Oa2VV83LTA/H/MuCOX7uCIJmQVRKBcbmWoySjAnSg==", "dev": true, "license": "MIT", "dependencies": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" + "@octokit/openapi-types": "^27.0.0" } }, - "node_modules/@istanbuljs/load-nyc-config/node_modules/locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "node_modules/@oxc-project/types": { + "version": "0.133.0", + "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.133.0.tgz", + "integrity": "sha512-KzkdCd6Uxqnf6l3HOw1xfatAlUURA0g14cvBYFyJ5SaNOQbOUvBr9PKArcPcrNIeRsBdgcUzOGrhKveVpvOIGA==", "dev": true, "license": "MIT", - "dependencies": { - "p-locate": "^4.1.0" - }, - "engines": { - "node": ">=8" + "funding": { + "url": "https://github.com/sponsors/Boshen" } }, - "node_modules/@istanbuljs/load-nyc-config/node_modules/p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "node_modules/@pkgr/core": { + "version": "0.2.9", + "resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.2.9.tgz", + "integrity": "sha512-QNqXyfVS2wm9hweSYD2O7F0G06uurj9kZ96TRQE5Y9hU7+tgdZwIkbAKc5Ocy1HxEY2kuDQa6cQ1WRs/O5LFKA==", "dev": true, "license": "MIT", - "dependencies": { - "p-try": "^2.0.0" - }, "engines": { - "node": ">=6" + "node": "^12.20.0 || ^14.18.0 || >=16.0.0" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://opencollective.com/pkgr" } }, - "node_modules/@istanbuljs/load-nyc-config/node_modules/p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "node_modules/@pnpm/config.env-replace": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@pnpm/config.env-replace/-/config.env-replace-1.1.0.tgz", + "integrity": "sha512-htyl8TWnKL7K/ESFa1oW2UB5lVDxuF5DpM7tBi6Hu2LNL3mWkIzNLG6N4zoCUP1lCKNxWy/3iu8mS8MvToGd6w==", "dev": true, "license": "MIT", - "dependencies": { - "p-limit": "^2.2.0" - }, "engines": { - "node": ">=8" + "node": ">=12.22.0" } }, - "node_modules/@istanbuljs/load-nyc-config/node_modules/resolve-from": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "node_modules/@pnpm/network.ca-file": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@pnpm/network.ca-file/-/network.ca-file-1.0.2.tgz", + "integrity": "sha512-YcPQ8a0jwYU9bTdJDpXjMi7Brhkr1mXsXrUJvjqM2mQDgkRiz8jFaQGOdaLxgjtUfQgZhKy/O3cG/YwmgKaxLA==", "dev": true, "license": "MIT", + "dependencies": { + "graceful-fs": "4.2.10" + }, "engines": { - "node": ">=8" + "node": ">=12.22.0" } }, - "node_modules/@istanbuljs/schema": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.6.tgz", - "integrity": "sha512-+Sg6GCR/wy1oSmQDFq4LQDAhm3ETKnorxN+y5nbLULOR3P0c14f2Wurzj3/xqPXtasLFfHd5iRFQ7AJt4KH2cw==", + "node_modules/@pnpm/network.ca-file/node_modules/graceful-fs": { + "version": "4.2.10", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", + "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } + "license": "ISC" }, - "node_modules/@jest/console": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/console/-/console-29.7.0.tgz", - "integrity": "sha512-5Ni4CU7XHQi32IJ398EEP4RrB8eV09sXP2ROqD4bksHrnTree52PsxvX8tpL8LvTZ3pFzXyPbNQReSN41CAhOg==", + "node_modules/@pnpm/npm-conf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@pnpm/npm-conf/-/npm-conf-3.0.2.tgz", + "integrity": "sha512-h104Kh26rR8tm+a3Qkc5S4VLYint3FE48as7+/5oCEcKR2idC/pF1G6AhIXKI+eHPJa/3J9i5z0Al47IeGHPkA==", "dev": true, "license": "MIT", "dependencies": { - "@jest/types": "^29.6.3", - "@types/node": "*", - "chalk": "^4.0.0", - "jest-message-util": "^29.7.0", - "jest-util": "^29.7.0", - "slash": "^3.0.0" + "@pnpm/config.env-replace": "^1.1.0", + "@pnpm/network.ca-file": "^1.0.1", + "config-chain": "^1.1.11" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">=12" } }, - "node_modules/@jest/core": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/core/-/core-29.7.0.tgz", - "integrity": "sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg==", + "node_modules/@rolldown/binding-android-arm64": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.0.3.tgz", + "integrity": "sha512-454rs7jHngixp/NMxd5srYD57OnzSlZ/eFTETjORQHLwJG1lRtmNOJcBerZlfu4GjKqeq8aCCIQrMdHyhI51Hw==", + "cpu": [ + "arm64" + ], "dev": true, "license": "MIT", - "dependencies": { - "@jest/console": "^29.7.0", - "@jest/reporters": "^29.7.0", - "@jest/test-result": "^29.7.0", - "@jest/transform": "^29.7.0", - "@jest/types": "^29.6.3", - "@types/node": "*", - "ansi-escapes": "^4.2.1", - "chalk": "^4.0.0", - "ci-info": "^3.2.0", - "exit": "^0.1.2", - "graceful-fs": "^4.2.9", - "jest-changed-files": "^29.7.0", - "jest-config": "^29.7.0", - "jest-haste-map": "^29.7.0", - "jest-message-util": "^29.7.0", - "jest-regex-util": "^29.6.3", - "jest-resolve": "^29.7.0", - "jest-resolve-dependencies": "^29.7.0", - "jest-runner": "^29.7.0", - "jest-runtime": "^29.7.0", - "jest-snapshot": "^29.7.0", - "jest-util": "^29.7.0", - "jest-validate": "^29.7.0", - "jest-watcher": "^29.7.0", - "micromatch": "^4.0.4", - "pretty-format": "^29.7.0", - "slash": "^3.0.0", - "strip-ansi": "^6.0.0" - }, + "optional": true, + "os": [ + "android" + ], "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - }, - "peerDependencies": { - "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" - }, - "peerDependenciesMeta": { - "node-notifier": { - "optional": true - } + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@jest/environment": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-29.7.0.tgz", - "integrity": "sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw==", + "node_modules/@rolldown/binding-darwin-arm64": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.0.3.tgz", + "integrity": "sha512-PcAhP+ynjURNyy8SKGl5DQP94aGuB/7JrXJb/t7P+hanXvQVMWzUvRRhBAcg/lNRadBhoUPqSoP4xw5tR/KBEA==", + "cpu": [ + "arm64" + ], "dev": true, "license": "MIT", - "dependencies": { - "@jest/fake-timers": "^29.7.0", - "@jest/types": "^29.6.3", - "@types/node": "*", - "jest-mock": "^29.7.0" - }, + "optional": true, + "os": [ + "darwin" + ], "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@jest/expect": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-29.7.0.tgz", - "integrity": "sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ==", + "node_modules/@rolldown/binding-darwin-x64": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.0.3.tgz", + "integrity": "sha512-9YpfeUvSE2RS7wysJ81uOZkXJz7f7Q55H2Gvp3VEw/EsahqDtrphrZ0EwDLK5vvKOzaCrBsjF8JmnMLcUt78Gg==", + "cpu": [ + "x64" + ], "dev": true, "license": "MIT", - "dependencies": { - "expect": "^29.7.0", - "jest-snapshot": "^29.7.0" - }, + "optional": true, + "os": [ + "darwin" + ], "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@jest/expect-utils": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.7.0.tgz", - "integrity": "sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA==", + "node_modules/@rolldown/binding-freebsd-x64": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.0.3.tgz", + "integrity": "sha512-yB1IlAsSNHncV6SCTL27/MVGR5htvQsoGxIv5KMGXALp+Ll1wYsn+x98M9MW7qa+NdSbvrrY7ANI4wLJ0n1e6g==", + "cpu": [ + "x64" + ], "dev": true, "license": "MIT", - "dependencies": { - "jest-get-type": "^29.6.3" - }, + "optional": true, + "os": [ + "freebsd" + ], "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@jest/fake-timers": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.7.0.tgz", - "integrity": "sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ==", + "node_modules/@rolldown/binding-linux-arm-gnueabihf": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.0.3.tgz", + "integrity": "sha512-Yi30IVAAfLUCy2MseFjbB1jAMDl1VMCAas5StnYp8da9+CKvMd2H2cbEjWcw5NPaPqzvYkVIaF1nNUG+b7u/sw==", + "cpu": [ + "arm" + ], "dev": true, "license": "MIT", - "dependencies": { - "@jest/types": "^29.6.3", - "@sinonjs/fake-timers": "^10.0.2", - "@types/node": "*", - "jest-message-util": "^29.7.0", - "jest-mock": "^29.7.0", - "jest-util": "^29.7.0" - }, + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@jest/globals": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-29.7.0.tgz", - "integrity": "sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ==", + "node_modules/@rolldown/binding-linux-arm64-gnu": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.0.3.tgz", + "integrity": "sha512-jsO7R8To+AdlYgUmN5sHSCZbfhtMBkO0WUx8iORQnPcMMdgr7qM2DQmMwgabs3GhNztdmoKkMKQFHD6DTMCIQw==", + "cpu": [ + "arm64" + ], "dev": true, "license": "MIT", - "dependencies": { - "@jest/environment": "^29.7.0", - "@jest/expect": "^29.7.0", - "@jest/types": "^29.6.3", - "jest-mock": "^29.7.0" - }, + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@jest/reporters": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-29.7.0.tgz", - "integrity": "sha512-DApq0KJbJOEzAFYjHADNNxAE3KbhxQB1y5Kplb5Waqw6zVbuWatSnMjE5gs8FUgEPmNsnZA3NCWl9NG0ia04Pg==", + "node_modules/@rolldown/binding-linux-arm64-musl": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.0.3.tgz", + "integrity": "sha512-VWkUHwWriDciit80wleYwKILoR/KMvxh/IdwS/paX+ZgpuRpCrKLUdadJbc0NpBEiyhpYawsJ73j9aCvOH+f7Q==", + "cpu": [ + "arm64" + ], "dev": true, "license": "MIT", - "dependencies": { - "@bcoe/v8-coverage": "^0.2.3", - "@jest/console": "^29.7.0", - "@jest/test-result": "^29.7.0", - "@jest/transform": "^29.7.0", - "@jest/types": "^29.6.3", - "@jridgewell/trace-mapping": "^0.3.18", - "@types/node": "*", - "chalk": "^4.0.0", - "collect-v8-coverage": "^1.0.0", - "exit": "^0.1.2", - "glob": "^7.1.3", - "graceful-fs": "^4.2.9", - "istanbul-lib-coverage": "^3.0.0", - "istanbul-lib-instrument": "^6.0.0", - "istanbul-lib-report": "^3.0.0", - "istanbul-lib-source-maps": "^4.0.0", - "istanbul-reports": "^3.1.3", - "jest-message-util": "^29.7.0", - "jest-util": "^29.7.0", - "jest-worker": "^29.7.0", - "slash": "^3.0.0", - "string-length": "^4.0.1", - "strip-ansi": "^6.0.0", - "v8-to-istanbul": "^9.0.1" - }, + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - }, - "peerDependencies": { - "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" - }, - "peerDependenciesMeta": { - "node-notifier": { - "optional": true - } + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@jest/schemas": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", - "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", + "node_modules/@rolldown/binding-linux-ppc64-gnu": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.0.3.tgz", + "integrity": "sha512-5f1laC0SlIR0yDbFCd8acUhvJIag6N3zC5P7oUPN6wX0aOma+uKJ0wBDH5aq7I1PVI2ttTlhJwzwRIBnLiSGEg==", + "cpu": [ + "ppc64" + ], "dev": true, "license": "MIT", - "dependencies": { - "@sinclair/typebox": "^0.27.8" - }, + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@jest/source-map": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-29.6.3.tgz", - "integrity": "sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw==", + "node_modules/@rolldown/binding-linux-s390x-gnu": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.0.3.tgz", + "integrity": "sha512-Iq4ko0r4XsgbrF/LunNgHtAGLRRVE2kXonAXQ/MV0mC6jQpMOhW1SvtZja2EhC/kd05++bP78dsqBeIQyYJ6Yg==", + "cpu": [ + "s390x" + ], "dev": true, "license": "MIT", - "dependencies": { - "@jridgewell/trace-mapping": "^0.3.18", - "callsites": "^3.0.0", - "graceful-fs": "^4.2.9" - }, + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@jest/test-result": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-29.7.0.tgz", - "integrity": "sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA==", + "node_modules/@rolldown/binding-linux-x64-gnu": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.0.3.tgz", + "integrity": "sha512-B8m6tD5+/N5FeNQFbKlLA/2yVq9ycQP1SeedyEYYKWBNR3ZQbkvIUcNnDNM03lO1l5F2roiiFJGgvoLLyZXtSg==", + "cpu": [ + "x64" + ], "dev": true, "license": "MIT", - "dependencies": { - "@jest/console": "^29.7.0", - "@jest/types": "^29.6.3", - "@types/istanbul-lib-coverage": "^2.0.0", - "collect-v8-coverage": "^1.0.0" - }, + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@jest/test-sequencer": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-29.7.0.tgz", - "integrity": "sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw==", + "node_modules/@rolldown/binding-linux-x64-musl": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.0.3.tgz", + "integrity": "sha512-pSdpdUJHkuCxun9LE7jvgUB9qsRgaiyNNCX7m/AvHTcq67AiT/Yhoxvw5zPfhrM8k/BfP8ce/hMOpthKDpEUow==", + "cpu": [ + "x64" + ], "dev": true, "license": "MIT", - "dependencies": { - "@jest/test-result": "^29.7.0", - "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.7.0", - "slash": "^3.0.0" - }, + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@jest/transform": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.7.0.tgz", - "integrity": "sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==", + "node_modules/@rolldown/binding-openharmony-arm64": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.0.3.tgz", + "integrity": "sha512-OXXS3RKJgX2uLwM+gYyuH5omcH8fL1LJs96pZGgtetVCahON57+d4SJHzTgZiOjxgGkSnpXpOsWuPDGAKAigEg==", + "cpu": [ + "arm64" + ], "dev": true, "license": "MIT", - "dependencies": { - "@babel/core": "^7.11.6", - "@jest/types": "^29.6.3", - "@jridgewell/trace-mapping": "^0.3.18", - "babel-plugin-istanbul": "^6.1.1", - "chalk": "^4.0.0", - "convert-source-map": "^2.0.0", - "fast-json-stable-stringify": "^2.1.0", - "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.7.0", - "jest-regex-util": "^29.6.3", - "jest-util": "^29.7.0", - "micromatch": "^4.0.4", - "pirates": "^4.0.4", - "slash": "^3.0.0", - "write-file-atomic": "^4.0.2" - }, + "optional": true, + "os": [ + "openharmony" + ], "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@jest/types": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", - "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", + "node_modules/@rolldown/binding-wasm32-wasi": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@rolldown/binding-wasm32-wasi/-/binding-wasm32-wasi-1.0.3.tgz", + "integrity": "sha512-JTtb8BWFynicNSoPrehsCzBtOKjZ6jhMiPFEmOiuXg1Fl8dn2KHQob+GuPSGR0dryQa1PQJbzjF3dqO/whhjLg==", + "cpu": [ + "wasm32" + ], "dev": true, "license": "MIT", + "optional": true, "dependencies": { - "@jest/schemas": "^29.6.3", - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^3.0.0", - "@types/node": "*", - "@types/yargs": "^17.0.8", - "chalk": "^4.0.0" + "@emnapi/core": "1.10.0", + "@emnapi/runtime": "1.10.0", + "@napi-rs/wasm-runtime": "^1.1.4" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.13", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", - "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/sourcemap-codec": "^1.5.0", - "@jridgewell/trace-mapping": "^0.3.24" + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@jridgewell/remapping": { - "version": "2.3.5", - "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz", - "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", + "node_modules/@rolldown/binding-win32-arm64-msvc": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.0.3.tgz", + "integrity": "sha512-gEdFFEN70A/jxb2svrWsN3aDL7OUtmvlOy+6fa2jxG8K0wQ1ZbdeLGnidov6Yu5/733dI5ySfzFlQ/cb0bSz1g==", + "cpu": [ + "arm64" + ], "dev": true, "license": "MIT", - "dependencies": { - "@jridgewell/gen-mapping": "^0.3.5", - "@jridgewell/trace-mapping": "^0.3.24" + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", - "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "node_modules/@rolldown/binding-win32-x64-msvc": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.0.3.tgz", + "integrity": "sha512-eXB7CHuaQdqmJcc3koCNtNPmT/bj2gc999kUFgBxG8Ac0NdgXc4rkCHhqrgrhN3zddvvvrgzj1e90SuSfmyIXA==", + "cpu": [ + "x64" + ], "dev": true, "license": "MIT", + "optional": true, + "os": [ + "win32" + ], "engines": { - "node": ">=6.0.0" + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.5.5", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", - "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", + "node_modules/@rolldown/pluginutils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.1.tgz", + "integrity": "sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw==", "dev": true, "license": "MIT" }, - "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.31", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", - "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", - "dev": true, + "node_modules/@rollup/plugin-commonjs": { + "version": "22.0.2", + "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-22.0.2.tgz", + "integrity": "sha512-//NdP6iIwPbMTcazYsiBMbJW7gfmpHom33u1beiIoHDEM0Q9clvtQB1T0efvMqHeKsGohiHo97BCPCkBXdscwg==", "license": "MIT", "dependencies": { - "@jridgewell/resolve-uri": "^3.1.0", - "@jridgewell/sourcemap-codec": "^1.4.14" - } - }, - "node_modules/@jsdoc/salty": { - "version": "0.2.12", - "resolved": "https://registry.npmjs.org/@jsdoc/salty/-/salty-0.2.12.tgz", - "integrity": "sha512-TuB0x50EoAvEX/UEWITd8Mkn3WhiTjSvbTMCLj0BhsQEl5iUzjXdA0bETEVpTk+5TGTLR6QktI9H4hLviVeaAQ==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "lodash": "^4.18.1" + "@rollup/pluginutils": "^3.1.0", + "commondir": "^1.0.1", + "estree-walker": "^2.0.1", + "glob": "^7.1.6", + "is-reference": "^1.2.1", + "magic-string": "^0.25.7", + "resolve": "^1.17.0" }, "engines": { - "node": ">=v12.0.0" - } - }, - "node_modules/@jsep-plugin/assignment": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@jsep-plugin/assignment/-/assignment-1.3.0.tgz", - "integrity": "sha512-VVgV+CXrhbMI3aSusQyclHkenWSAm95WaiKrMxRFam3JSUiIaQjoMIw2sEs/OX4XifnqeQUN4DYbJjlA8EfktQ==", - "license": "MIT", - "engines": { - "node": ">= 10.16.0" + "node": ">= 12.0.0" }, "peerDependencies": { - "jsep": "^0.4.0||^1.0.0" + "rollup": "^2.68.0" } }, - "node_modules/@jsep-plugin/regex": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@jsep-plugin/regex/-/regex-1.0.4.tgz", - "integrity": "sha512-q7qL4Mgjs1vByCaTnDFcBnV9HS7GVPJX5vyVoCgZHNSC9rjwIlmbXG5sUuorR5ndfHAIlJ8pVStxvjXHbNvtUg==", + "node_modules/@rollup/pluginutils": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-3.1.0.tgz", + "integrity": "sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==", "license": "MIT", + "dependencies": { + "@types/estree": "0.0.39", + "estree-walker": "^1.0.1", + "picomatch": "^2.2.2" + }, "engines": { - "node": ">= 10.16.0" + "node": ">= 8.0.0" }, "peerDependencies": { - "jsep": "^0.4.0||^1.0.0" + "rollup": "^1.20.0||^2.0.0" } }, - "node_modules/@jsep-plugin/ternary": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/@jsep-plugin/ternary/-/ternary-1.1.4.tgz", - "integrity": "sha512-ck5wiqIbqdMX6WRQztBL7ASDty9YLgJ3sSAK5ZpBzXeySvFGCzIvM6UiAI4hTZ22fEcYQVV/zhUbNscggW+Ukg==", + "node_modules/@rollup/pluginutils/node_modules/estree-walker": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-1.0.1.tgz", + "integrity": "sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==", + "license": "MIT" + }, + "node_modules/@sec-ant/readable-stream": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@sec-ant/readable-stream/-/readable-stream-0.4.1.tgz", + "integrity": "sha512-831qok9r2t8AlxLko40y2ebgSDhenenCatLVeW/uBtnHPyhHOvG0C7TvfgecV+wHzIm5KUICgzmVpWS+IMEAeg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@semantic-release/changelog": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/@semantic-release/changelog/-/changelog-6.0.3.tgz", + "integrity": "sha512-dZuR5qByyfe3Y03TpmCvAxCyTnp7r5XwtHRf/8vD9EAn4ZWbavUX8adMtXYzE86EVh0gyLA7lm5yW4IV30XUag==", + "dev": true, "license": "MIT", + "dependencies": { + "@semantic-release/error": "^3.0.0", + "aggregate-error": "^3.0.0", + "fs-extra": "^11.0.0", + "lodash": "^4.17.4" + }, "engines": { - "node": ">= 10.16.0" + "node": ">=14.17" }, "peerDependencies": { - "jsep": "^0.4.0||^1.0.0" + "semantic-release": ">=18.0.0" } }, - "node_modules/@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "node_modules/@semantic-release/commit-analyzer": { + "version": "13.0.1", + "resolved": "https://registry.npmjs.org/@semantic-release/commit-analyzer/-/commit-analyzer-13.0.1.tgz", + "integrity": "sha512-wdnBPHKkr9HhNhXOhZD5a2LNl91+hs8CC2vsAVYxtZH3y0dV3wKn+uZSN61rdJQZ8EGxzWB3inWocBHV9+u/CQ==", + "dev": true, "license": "MIT", "dependencies": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" + "conventional-changelog-angular": "^8.0.0", + "conventional-changelog-writer": "^8.0.0", + "conventional-commits-filter": "^5.0.0", + "conventional-commits-parser": "^6.0.0", + "debug": "^4.0.0", + "import-from-esm": "^2.0.0", + "lodash-es": "^4.17.21", + "micromatch": "^4.0.2" }, "engines": { - "node": ">= 8" + "node": ">=20.8.1" + }, + "peerDependencies": { + "semantic-release": ">=20.1.0" } }, - "node_modules/@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "node_modules/@semantic-release/error": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@semantic-release/error/-/error-3.0.0.tgz", + "integrity": "sha512-5hiM4Un+tpl4cKw3lV4UgzJj+SmfNIDCLLw0TepzQxz9ZGV5ixnqkzIVF+3tp0ZHgcMKE+VNGHJjEeyFG2dcSw==", + "dev": true, "license": "MIT", "engines": { - "node": ">= 8" + "node": ">=14.17" } }, - "node_modules/@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "node_modules/@semantic-release/git": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/@semantic-release/git/-/git-10.0.1.tgz", + "integrity": "sha512-eWrx5KguUcU2wUPaO6sfvZI0wPafUKAMNC18aXY4EnNcrZL86dEmpNVnC9uMpGZkmZJ9EfCVJBQx4pV4EMGT1w==", + "dev": true, "license": "MIT", "dependencies": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" + "@semantic-release/error": "^3.0.0", + "aggregate-error": "^3.0.0", + "debug": "^4.0.0", + "dir-glob": "^3.0.0", + "execa": "^5.0.0", + "lodash": "^4.17.4", + "micromatch": "^4.0.0", + "p-reduce": "^2.0.0" }, "engines": { - "node": ">= 8" + "node": ">=14.17" + }, + "peerDependencies": { + "semantic-release": ">=18.0.0" } }, - "node_modules/@octokit/auth-token": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-6.0.0.tgz", - "integrity": "sha512-P4YJBPdPSpWTQ1NU4XYdvHvXJJDxM6YwpS0FZHRgP7YFkdVxsWcpWGy/NVqlAA7PcPCnMacXlRm1y2PFZRWL/w==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 20" - } - }, - "node_modules/@octokit/core": { - "version": "7.0.6", - "resolved": "https://registry.npmjs.org/@octokit/core/-/core-7.0.6.tgz", - "integrity": "sha512-DhGl4xMVFGVIyMwswXeyzdL4uXD5OGILGX5N8Y+f6W7LhC1Ze2poSNrkF/fedpVDHEEZ+PHFW0vL14I+mm8K3Q==", + "node_modules/@semantic-release/github": { + "version": "12.0.6", + "resolved": "https://registry.npmjs.org/@semantic-release/github/-/github-12.0.6.tgz", + "integrity": "sha512-aYYFkwHW3c6YtHwQF0t0+lAjlU+87NFOZuH2CvWFD0Ylivc7MwhZMiHOJ0FMpIgPpCVib/VUAcOwvrW0KnxQtA==", "dev": true, "license": "MIT", "dependencies": { - "@octokit/auth-token": "^6.0.0", - "@octokit/graphql": "^9.0.3", - "@octokit/request": "^10.0.6", - "@octokit/request-error": "^7.0.2", - "@octokit/types": "^16.0.0", - "before-after-hook": "^4.0.0", - "universal-user-agent": "^7.0.0" + "@octokit/core": "^7.0.0", + "@octokit/plugin-paginate-rest": "^14.0.0", + "@octokit/plugin-retry": "^8.0.0", + "@octokit/plugin-throttling": "^11.0.0", + "@semantic-release/error": "^4.0.0", + "aggregate-error": "^5.0.0", + "debug": "^4.3.4", + "dir-glob": "^3.0.1", + "http-proxy-agent": "^7.0.0", + "https-proxy-agent": "^7.0.0", + "issue-parser": "^7.0.0", + "lodash-es": "^4.17.21", + "mime": "^4.0.0", + "p-filter": "^4.0.0", + "tinyglobby": "^0.2.14", + "undici": "^7.0.0", + "url-join": "^5.0.0" }, "engines": { - "node": ">= 20" + "node": "^22.14.0 || >= 24.10.0" + }, + "peerDependencies": { + "semantic-release": ">=24.1.0" } }, - "node_modules/@octokit/endpoint": { - "version": "11.0.3", - "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-11.0.3.tgz", - "integrity": "sha512-FWFlNxghg4HrXkD3ifYbS/IdL/mDHjh9QcsNyhQjN8dplUoZbejsdpmuqdA76nxj2xoWPs7p8uX2SNr9rYu0Ag==", + "node_modules/@semantic-release/github/node_modules/@semantic-release/error": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@semantic-release/error/-/error-4.0.0.tgz", + "integrity": "sha512-mgdxrHTLOjOddRVYIYDo0fR3/v61GNN1YGkfbrjuIKg/uMgCd+Qzo3UAXJ+woLQQpos4pl5Esuw5A7AoNlzjUQ==", "dev": true, "license": "MIT", - "dependencies": { - "@octokit/types": "^16.0.0", - "universal-user-agent": "^7.0.2" - }, "engines": { - "node": ">= 20" + "node": ">=18" } }, - "node_modules/@octokit/graphql": { - "version": "9.0.3", - "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-9.0.3.tgz", - "integrity": "sha512-grAEuupr/C1rALFnXTv6ZQhFuL1D8G5y8CN04RgrO4FIPMrtm+mcZzFG7dcBm+nq+1ppNixu+Jd78aeJOYxlGA==", + "node_modules/@semantic-release/github/node_modules/agent-base": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz", + "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==", "dev": true, "license": "MIT", - "dependencies": { - "@octokit/request": "^10.0.6", - "@octokit/types": "^16.0.0", - "universal-user-agent": "^7.0.0" - }, "engines": { - "node": ">= 20" + "node": ">= 14" } }, - "node_modules/@octokit/openapi-types": { - "version": "27.0.0", - "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-27.0.0.tgz", - "integrity": "sha512-whrdktVs1h6gtR+09+QsNk2+FO+49j6ga1c55YZudfEG+oKJVvJLQi3zkOm5JjiUXAagWK2tI2kTGKJ2Ys7MGA==", - "dev": true, - "license": "MIT" - }, - "node_modules/@octokit/plugin-paginate-rest": { - "version": "14.0.0", - "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-14.0.0.tgz", - "integrity": "sha512-fNVRE7ufJiAA3XUrha2omTA39M6IXIc6GIZLvlbsm8QOQCYvpq/LkMNGyFlB1d8hTDzsAXa3OKtybdMAYsV/fw==", + "node_modules/@semantic-release/github/node_modules/aggregate-error": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-5.0.0.tgz", + "integrity": "sha512-gOsf2YwSlleG6IjRYG2A7k0HmBMEo6qVNk9Bp/EaLgAJT5ngH6PXbqa4ItvnEwCm/velL5jAnQgsHsWnjhGmvw==", "dev": true, "license": "MIT", "dependencies": { - "@octokit/types": "^16.0.0" + "clean-stack": "^5.2.0", + "indent-string": "^5.0.0" }, "engines": { - "node": ">= 20" + "node": ">=18" }, - "peerDependencies": { - "@octokit/core": ">=6" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@octokit/plugin-retry": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@octokit/plugin-retry/-/plugin-retry-8.1.0.tgz", - "integrity": "sha512-O1FZgXeiGb2sowEr/hYTr6YunGdSAFWnr2fyW39Ah85H8O33ELASQxcvOFF5LE6Tjekcyu2ms4qAzJVhSaJxTw==", + "node_modules/@semantic-release/github/node_modules/clean-stack": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-5.3.0.tgz", + "integrity": "sha512-9ngPTOhYGQqNVSfeJkYXHmF7AGWp4/nN5D/QqNQs3Dvxd1Kk/WpjHfNujKHYUQ/5CoGyOyFNoWSPk5afzP0QVg==", "dev": true, "license": "MIT", "dependencies": { - "@octokit/request-error": "^7.0.2", - "@octokit/types": "^16.0.0", - "bottleneck": "^2.15.3" + "escape-string-regexp": "5.0.0" }, "engines": { - "node": ">= 20" + "node": ">=14.16" }, - "peerDependencies": { - "@octokit/core": ">=7" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@octokit/plugin-throttling": { - "version": "11.0.3", - "resolved": "https://registry.npmjs.org/@octokit/plugin-throttling/-/plugin-throttling-11.0.3.tgz", - "integrity": "sha512-34eE0RkFCKycLl2D2kq7W+LovheM/ex3AwZCYN8udpi6bxsyjZidb2McXs69hZhLmJlDqTSP8cH+jSRpiaijBg==", + "node_modules/@semantic-release/github/node_modules/escape-string-regexp": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", "dev": true, "license": "MIT", - "dependencies": { - "@octokit/types": "^16.0.0", - "bottleneck": "^2.15.3" - }, "engines": { - "node": ">= 20" + "node": ">=12" }, - "peerDependencies": { - "@octokit/core": "^7.0.0" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@octokit/request": { - "version": "10.0.8", - "resolved": "https://registry.npmjs.org/@octokit/request/-/request-10.0.8.tgz", - "integrity": "sha512-SJZNwY9pur9Agf7l87ywFi14W+Hd9Jg6Ifivsd33+/bGUQIjNujdFiXII2/qSlN2ybqUHfp5xpekMEjIBTjlSw==", + "node_modules/@semantic-release/github/node_modules/https-proxy-agent": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", + "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", "dev": true, "license": "MIT", "dependencies": { - "@octokit/endpoint": "^11.0.3", - "@octokit/request-error": "^7.0.2", - "@octokit/types": "^16.0.0", - "fast-content-type-parse": "^3.0.0", - "json-with-bigint": "^3.5.3", - "universal-user-agent": "^7.0.2" + "agent-base": "^7.1.2", + "debug": "4" }, "engines": { - "node": ">= 20" + "node": ">= 14" } }, - "node_modules/@octokit/request-error": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-7.1.0.tgz", - "integrity": "sha512-KMQIfq5sOPpkQYajXHwnhjCC0slzCNScLHs9JafXc4RAJI+9f+jNDlBNaIMTvazOPLgb4BnlhGJOTbnN0wIjPw==", + "node_modules/@semantic-release/github/node_modules/indent-string": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz", + "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==", "dev": true, "license": "MIT", - "dependencies": { - "@octokit/types": "^16.0.0" - }, "engines": { - "node": ">= 20" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@octokit/types": { - "version": "16.0.0", - "resolved": "https://registry.npmjs.org/@octokit/types/-/types-16.0.0.tgz", - "integrity": "sha512-sKq+9r1Mm4efXW1FCk7hFSeJo4QKreL/tTbR0rz/qx/r1Oa2VV83LTA/H/MuCOX7uCIJmQVRKBcbmWoySjAnSg==", + "node_modules/@semantic-release/github/node_modules/undici": { + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-7.25.0.tgz", + "integrity": "sha512-xXnp4kTyor2Zq+J1FfPI6Eq3ew5h6Vl0F/8d9XU5zZQf1tX9s2Su1/3PiMmUANFULpmksxkClamIZcaUqryHsQ==", "dev": true, "license": "MIT", - "dependencies": { - "@octokit/openapi-types": "^27.0.0" + "engines": { + "node": ">=20.18.1" } }, - "node_modules/@pkgr/core": { - "version": "0.2.9", - "resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.2.9.tgz", - "integrity": "sha512-QNqXyfVS2wm9hweSYD2O7F0G06uurj9kZ96TRQE5Y9hU7+tgdZwIkbAKc5Ocy1HxEY2kuDQa6cQ1WRs/O5LFKA==", + "node_modules/@semantic-release/npm": { + "version": "13.1.5", + "resolved": "https://registry.npmjs.org/@semantic-release/npm/-/npm-13.1.5.tgz", + "integrity": "sha512-Hq5UxzoatN3LHiq2rTsWS54nCdqJHlsssGERCo8WlvdfFA9LoN0vO+OuKVSjtNapIc/S8C2LBj206wKLHg62mg==", "dev": true, "license": "MIT", + "dependencies": { + "@actions/core": "^3.0.0", + "@semantic-release/error": "^4.0.0", + "aggregate-error": "^5.0.0", + "env-ci": "^11.2.0", + "execa": "^9.0.0", + "fs-extra": "^11.0.0", + "lodash-es": "^4.17.21", + "nerf-dart": "^1.0.0", + "normalize-url": "^9.0.0", + "npm": "^11.6.2", + "rc": "^1.2.8", + "read-pkg": "^10.0.0", + "registry-auth-token": "^5.0.0", + "semver": "^7.1.2", + "tempy": "^3.0.0" + }, "engines": { - "node": "^12.20.0 || ^14.18.0 || >=16.0.0" + "node": "^22.14.0 || >= 24.10.0" }, - "funding": { - "url": "https://opencollective.com/pkgr" + "peerDependencies": { + "semantic-release": ">=20.1.0" } }, - "node_modules/@pnpm/config.env-replace": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@pnpm/config.env-replace/-/config.env-replace-1.1.0.tgz", - "integrity": "sha512-htyl8TWnKL7K/ESFa1oW2UB5lVDxuF5DpM7tBi6Hu2LNL3mWkIzNLG6N4zoCUP1lCKNxWy/3iu8mS8MvToGd6w==", + "node_modules/@semantic-release/npm/node_modules/@semantic-release/error": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@semantic-release/error/-/error-4.0.0.tgz", + "integrity": "sha512-mgdxrHTLOjOddRVYIYDo0fR3/v61GNN1YGkfbrjuIKg/uMgCd+Qzo3UAXJ+woLQQpos4pl5Esuw5A7AoNlzjUQ==", "dev": true, "license": "MIT", "engines": { - "node": ">=12.22.0" + "node": ">=18" } }, - "node_modules/@pnpm/network.ca-file": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@pnpm/network.ca-file/-/network.ca-file-1.0.2.tgz", - "integrity": "sha512-YcPQ8a0jwYU9bTdJDpXjMi7Brhkr1mXsXrUJvjqM2mQDgkRiz8jFaQGOdaLxgjtUfQgZhKy/O3cG/YwmgKaxLA==", + "node_modules/@semantic-release/npm/node_modules/aggregate-error": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-5.0.0.tgz", + "integrity": "sha512-gOsf2YwSlleG6IjRYG2A7k0HmBMEo6qVNk9Bp/EaLgAJT5ngH6PXbqa4ItvnEwCm/velL5jAnQgsHsWnjhGmvw==", "dev": true, "license": "MIT", "dependencies": { - "graceful-fs": "4.2.10" + "clean-stack": "^5.2.0", + "indent-string": "^5.0.0" }, "engines": { - "node": ">=12.22.0" + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@pnpm/network.ca-file/node_modules/graceful-fs": { - "version": "4.2.10", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", - "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", - "dev": true, - "license": "ISC" - }, - "node_modules/@pnpm/npm-conf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@pnpm/npm-conf/-/npm-conf-3.0.2.tgz", - "integrity": "sha512-h104Kh26rR8tm+a3Qkc5S4VLYint3FE48as7+/5oCEcKR2idC/pF1G6AhIXKI+eHPJa/3J9i5z0Al47IeGHPkA==", + "node_modules/@semantic-release/npm/node_modules/clean-stack": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-5.3.0.tgz", + "integrity": "sha512-9ngPTOhYGQqNVSfeJkYXHmF7AGWp4/nN5D/QqNQs3Dvxd1Kk/WpjHfNujKHYUQ/5CoGyOyFNoWSPk5afzP0QVg==", "dev": true, "license": "MIT", "dependencies": { - "@pnpm/config.env-replace": "^1.1.0", - "@pnpm/network.ca-file": "^1.0.1", - "config-chain": "^1.1.11" + "escape-string-regexp": "5.0.0" }, "engines": { - "node": ">=12" + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@rollup/plugin-commonjs": { - "version": "22.0.2", - "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-22.0.2.tgz", - "integrity": "sha512-//NdP6iIwPbMTcazYsiBMbJW7gfmpHom33u1beiIoHDEM0Q9clvtQB1T0efvMqHeKsGohiHo97BCPCkBXdscwg==", + "node_modules/@semantic-release/npm/node_modules/escape-string-regexp": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", + "dev": true, "license": "MIT", - "dependencies": { - "@rollup/pluginutils": "^3.1.0", - "commondir": "^1.0.1", - "estree-walker": "^2.0.1", - "glob": "^7.1.6", - "is-reference": "^1.2.1", - "magic-string": "^0.25.7", - "resolve": "^1.17.0" - }, "engines": { - "node": ">= 12.0.0" + "node": ">=12" }, - "peerDependencies": { - "rollup": "^2.68.0" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@rollup/pluginutils": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-3.1.0.tgz", - "integrity": "sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==", + "node_modules/@semantic-release/npm/node_modules/execa": { + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-9.6.1.tgz", + "integrity": "sha512-9Be3ZoN4LmYR90tUoVu2te2BsbzHfhJyfEiAVfz7N5/zv+jduIfLrV2xdQXOHbaD6KgpGdO9PRPM1Y4Q9QkPkA==", + "dev": true, "license": "MIT", "dependencies": { - "@types/estree": "0.0.39", - "estree-walker": "^1.0.1", - "picomatch": "^2.2.2" + "@sindresorhus/merge-streams": "^4.0.0", + "cross-spawn": "^7.0.6", + "figures": "^6.1.0", + "get-stream": "^9.0.0", + "human-signals": "^8.0.1", + "is-plain-obj": "^4.1.0", + "is-stream": "^4.0.1", + "npm-run-path": "^6.0.0", + "pretty-ms": "^9.2.0", + "signal-exit": "^4.1.0", + "strip-final-newline": "^4.0.0", + "yoctocolors": "^2.1.1" }, "engines": { - "node": ">= 8.0.0" + "node": "^18.19.0 || >=20.5.0" }, - "peerDependencies": { - "rollup": "^1.20.0||^2.0.0" + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" } }, - "node_modules/@rollup/pluginutils/node_modules/estree-walker": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-1.0.1.tgz", - "integrity": "sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==", - "license": "MIT" - }, - "node_modules/@sec-ant/readable-stream": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/@sec-ant/readable-stream/-/readable-stream-0.4.1.tgz", - "integrity": "sha512-831qok9r2t8AlxLko40y2ebgSDhenenCatLVeW/uBtnHPyhHOvG0C7TvfgecV+wHzIm5KUICgzmVpWS+IMEAeg==", - "dev": true, - "license": "MIT" - }, - "node_modules/@semantic-release/changelog": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/@semantic-release/changelog/-/changelog-6.0.3.tgz", - "integrity": "sha512-dZuR5qByyfe3Y03TpmCvAxCyTnp7r5XwtHRf/8vD9EAn4ZWbavUX8adMtXYzE86EVh0gyLA7lm5yW4IV30XUag==", + "node_modules/@semantic-release/npm/node_modules/get-stream": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-9.0.1.tgz", + "integrity": "sha512-kVCxPF3vQM/N0B1PmoqVUqgHP+EeVjmZSQn+1oCRPxd2P21P2F19lIgbR3HBosbB1PUhOAoctJnfEn2GbN2eZA==", "dev": true, "license": "MIT", "dependencies": { - "@semantic-release/error": "^3.0.0", - "aggregate-error": "^3.0.0", - "fs-extra": "^11.0.0", - "lodash": "^4.17.4" + "@sec-ant/readable-stream": "^0.4.1", + "is-stream": "^4.0.1" }, "engines": { - "node": ">=14.17" + "node": ">=18" }, - "peerDependencies": { - "semantic-release": ">=18.0.0" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@semantic-release/commit-analyzer": { - "version": "13.0.1", - "resolved": "https://registry.npmjs.org/@semantic-release/commit-analyzer/-/commit-analyzer-13.0.1.tgz", - "integrity": "sha512-wdnBPHKkr9HhNhXOhZD5a2LNl91+hs8CC2vsAVYxtZH3y0dV3wKn+uZSN61rdJQZ8EGxzWB3inWocBHV9+u/CQ==", + "node_modules/@semantic-release/npm/node_modules/human-signals": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-8.0.1.tgz", + "integrity": "sha512-eKCa6bwnJhvxj14kZk5NCPc6Hb6BdsU9DZcOnmQKSnO1VKrfV0zCvtttPZUsBvjmNDn8rpcJfpwSYnHBjc95MQ==", "dev": true, - "license": "MIT", - "dependencies": { - "conventional-changelog-angular": "^8.0.0", - "conventional-changelog-writer": "^8.0.0", - "conventional-commits-filter": "^5.0.0", - "conventional-commits-parser": "^6.0.0", - "debug": "^4.0.0", - "import-from-esm": "^2.0.0", - "lodash-es": "^4.17.21", - "micromatch": "^4.0.2" - }, + "license": "Apache-2.0", "engines": { - "node": ">=20.8.1" - }, - "peerDependencies": { - "semantic-release": ">=20.1.0" + "node": ">=18.18.0" } }, - "node_modules/@semantic-release/error": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@semantic-release/error/-/error-3.0.0.tgz", - "integrity": "sha512-5hiM4Un+tpl4cKw3lV4UgzJj+SmfNIDCLLw0TepzQxz9ZGV5ixnqkzIVF+3tp0ZHgcMKE+VNGHJjEeyFG2dcSw==", + "node_modules/@semantic-release/npm/node_modules/indent-string": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz", + "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==", "dev": true, "license": "MIT", "engines": { - "node": ">=14.17" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@semantic-release/git": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/@semantic-release/git/-/git-10.0.1.tgz", - "integrity": "sha512-eWrx5KguUcU2wUPaO6sfvZI0wPafUKAMNC18aXY4EnNcrZL86dEmpNVnC9uMpGZkmZJ9EfCVJBQx4pV4EMGT1w==", + "node_modules/@semantic-release/npm/node_modules/is-stream": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-4.0.1.tgz", + "integrity": "sha512-Dnz92NInDqYckGEUJv689RbRiTSEHCQ7wOVeALbkOz999YpqT46yMRIGtSNl2iCL1waAZSx40+h59NV/EwzV/A==", "dev": true, "license": "MIT", - "dependencies": { - "@semantic-release/error": "^3.0.0", - "aggregate-error": "^3.0.0", - "debug": "^4.0.0", - "dir-glob": "^3.0.0", - "execa": "^5.0.0", - "lodash": "^4.17.4", - "micromatch": "^4.0.0", - "p-reduce": "^2.0.0" - }, "engines": { - "node": ">=14.17" + "node": ">=18" }, - "peerDependencies": { - "semantic-release": ">=18.0.0" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@semantic-release/github": { - "version": "12.0.6", - "resolved": "https://registry.npmjs.org/@semantic-release/github/-/github-12.0.6.tgz", - "integrity": "sha512-aYYFkwHW3c6YtHwQF0t0+lAjlU+87NFOZuH2CvWFD0Ylivc7MwhZMiHOJ0FMpIgPpCVib/VUAcOwvrW0KnxQtA==", + "node_modules/@semantic-release/npm/node_modules/npm-run-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-6.0.0.tgz", + "integrity": "sha512-9qny7Z9DsQU8Ou39ERsPU4OZQlSTP47ShQzuKZ6PRXpYLtIFgl/DEBYEXKlvcEa+9tHVcK8CF81Y2V72qaZhWA==", "dev": true, "license": "MIT", "dependencies": { - "@octokit/core": "^7.0.0", - "@octokit/plugin-paginate-rest": "^14.0.0", - "@octokit/plugin-retry": "^8.0.0", - "@octokit/plugin-throttling": "^11.0.0", - "@semantic-release/error": "^4.0.0", - "aggregate-error": "^5.0.0", - "debug": "^4.3.4", - "dir-glob": "^3.0.1", - "http-proxy-agent": "^7.0.0", - "https-proxy-agent": "^7.0.0", - "issue-parser": "^7.0.0", - "lodash-es": "^4.17.21", - "mime": "^4.0.0", - "p-filter": "^4.0.0", - "tinyglobby": "^0.2.14", - "undici": "^7.0.0", - "url-join": "^5.0.0" + "path-key": "^4.0.0", + "unicorn-magic": "^0.3.0" }, "engines": { - "node": "^22.14.0 || >= 24.10.0" + "node": ">=18" }, - "peerDependencies": { - "semantic-release": ">=24.1.0" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@semantic-release/github/node_modules/@semantic-release/error": { + "node_modules/@semantic-release/npm/node_modules/path-key": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@semantic-release/error/-/error-4.0.0.tgz", - "integrity": "sha512-mgdxrHTLOjOddRVYIYDo0fR3/v61GNN1YGkfbrjuIKg/uMgCd+Qzo3UAXJ+woLQQpos4pl5Esuw5A7AoNlzjUQ==", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", + "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", "dev": true, "license": "MIT", "engines": { - "node": ">=18" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@semantic-release/github/node_modules/agent-base": { - "version": "7.1.4", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz", - "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==", + "node_modules/@semantic-release/npm/node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", "dev": true, - "license": "MIT", + "license": "ISC", "engines": { - "node": ">= 14" + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/@semantic-release/github/node_modules/aggregate-error": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-5.0.0.tgz", - "integrity": "sha512-gOsf2YwSlleG6IjRYG2A7k0HmBMEo6qVNk9Bp/EaLgAJT5ngH6PXbqa4ItvnEwCm/velL5jAnQgsHsWnjhGmvw==", + "node_modules/@semantic-release/npm/node_modules/strip-final-newline": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-4.0.0.tgz", + "integrity": "sha512-aulFJcD6YK8V1G7iRB5tigAP4TsHBZZrOV8pjV++zdUwmeV8uzbY7yn6h9MswN62adStNZFuCIx4haBnRuMDaw==", "dev": true, "license": "MIT", - "dependencies": { - "clean-stack": "^5.2.0", - "indent-string": "^5.0.0" - }, "engines": { "node": ">=18" }, @@ -1761,194 +1505,157 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@semantic-release/github/node_modules/clean-stack": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-5.3.0.tgz", - "integrity": "sha512-9ngPTOhYGQqNVSfeJkYXHmF7AGWp4/nN5D/QqNQs3Dvxd1Kk/WpjHfNujKHYUQ/5CoGyOyFNoWSPk5afzP0QVg==", + "node_modules/@semantic-release/npm/node_modules/unicorn-magic": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/unicorn-magic/-/unicorn-magic-0.3.0.tgz", + "integrity": "sha512-+QBBXBCvifc56fsbuxZQ6Sic3wqqc3WWaqxs58gvJrcOuN83HGTCwz3oS5phzU9LthRNE9VrJCFCLUgHeeFnfA==", "dev": true, "license": "MIT", - "dependencies": { - "escape-string-regexp": "5.0.0" - }, "engines": { - "node": ">=14.16" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@semantic-release/github/node_modules/escape-string-regexp": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", - "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@semantic-release/github/node_modules/https-proxy-agent": { - "version": "7.0.6", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", - "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", + "node_modules/@semantic-release/release-notes-generator": { + "version": "14.1.0", + "resolved": "https://registry.npmjs.org/@semantic-release/release-notes-generator/-/release-notes-generator-14.1.0.tgz", + "integrity": "sha512-CcyDRk7xq+ON/20YNR+1I/jP7BYKICr1uKd1HHpROSnnTdGqOTburi4jcRiTYz0cpfhxSloQO3cGhnoot7IEkA==", "dev": true, "license": "MIT", "dependencies": { - "agent-base": "^7.1.2", - "debug": "4" + "conventional-changelog-angular": "^8.0.0", + "conventional-changelog-writer": "^8.0.0", + "conventional-commits-filter": "^5.0.0", + "conventional-commits-parser": "^6.0.0", + "debug": "^4.0.0", + "get-stream": "^7.0.0", + "import-from-esm": "^2.0.0", + "into-stream": "^7.0.0", + "lodash-es": "^4.17.21", + "read-package-up": "^11.0.0" }, "engines": { - "node": ">= 14" + "node": ">=20.8.1" + }, + "peerDependencies": { + "semantic-release": ">=20.1.0" } }, - "node_modules/@semantic-release/github/node_modules/indent-string": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz", - "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==", + "node_modules/@semantic-release/release-notes-generator/node_modules/get-stream": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-7.0.1.tgz", + "integrity": "sha512-3M8C1EOFN6r8AMUhwUAACIoXZJEOufDU5+0gFFN5uNs6XYOralD2Pqkl7m046va6x77FwposWXbAhPPIOus7mQ==", "dev": true, "license": "MIT", "engines": { - "node": ">=12" + "node": ">=16" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@semantic-release/github/node_modules/undici": { - "version": "7.25.0", - "resolved": "https://registry.npmjs.org/undici/-/undici-7.25.0.tgz", - "integrity": "sha512-xXnp4kTyor2Zq+J1FfPI6Eq3ew5h6Vl0F/8d9XU5zZQf1tX9s2Su1/3PiMmUANFULpmksxkClamIZcaUqryHsQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=20.18.1" - } - }, - "node_modules/@semantic-release/npm": { - "version": "13.1.5", - "resolved": "https://registry.npmjs.org/@semantic-release/npm/-/npm-13.1.5.tgz", - "integrity": "sha512-Hq5UxzoatN3LHiq2rTsWS54nCdqJHlsssGERCo8WlvdfFA9LoN0vO+OuKVSjtNapIc/S8C2LBj206wKLHg62mg==", + "node_modules/@semantic-release/release-notes-generator/node_modules/hosted-git-info": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-7.0.2.tgz", + "integrity": "sha512-puUZAUKT5m8Zzvs72XWy3HtvVbTWljRE66cP60bxJzAqf2DgICo7lYTY2IHUmLnNpjYvw5bvmoHvPc0QO2a62w==", "dev": true, - "license": "MIT", + "license": "ISC", "dependencies": { - "@actions/core": "^3.0.0", - "@semantic-release/error": "^4.0.0", - "aggregate-error": "^5.0.0", - "env-ci": "^11.2.0", - "execa": "^9.0.0", - "fs-extra": "^11.0.0", - "lodash-es": "^4.17.21", - "nerf-dart": "^1.0.0", - "normalize-url": "^9.0.0", - "npm": "^11.6.2", - "rc": "^1.2.8", - "read-pkg": "^10.0.0", - "registry-auth-token": "^5.0.0", - "semver": "^7.1.2", - "tempy": "^3.0.0" - }, - "engines": { - "node": "^22.14.0 || >= 24.10.0" + "lru-cache": "^10.0.1" }, - "peerDependencies": { - "semantic-release": ">=20.1.0" - } - }, - "node_modules/@semantic-release/npm/node_modules/@semantic-release/error": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@semantic-release/error/-/error-4.0.0.tgz", - "integrity": "sha512-mgdxrHTLOjOddRVYIYDo0fR3/v61GNN1YGkfbrjuIKg/uMgCd+Qzo3UAXJ+woLQQpos4pl5Esuw5A7AoNlzjUQ==", - "dev": true, - "license": "MIT", "engines": { - "node": ">=18" + "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/@semantic-release/npm/node_modules/aggregate-error": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-5.0.0.tgz", - "integrity": "sha512-gOsf2YwSlleG6IjRYG2A7k0HmBMEo6qVNk9Bp/EaLgAJT5ngH6PXbqa4ItvnEwCm/velL5jAnQgsHsWnjhGmvw==", + "node_modules/@semantic-release/release-notes-generator/node_modules/into-stream": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/into-stream/-/into-stream-7.0.0.tgz", + "integrity": "sha512-2dYz766i9HprMBasCMvHMuazJ7u4WzhJwo5kb3iPSiW/iRYV6uPari3zHoqZlnuaR7V1bEiNMxikhp37rdBXbw==", "dev": true, "license": "MIT", "dependencies": { - "clean-stack": "^5.2.0", - "indent-string": "^5.0.0" + "from2": "^2.3.0", + "p-is-promise": "^3.0.0" }, "engines": { - "node": ">=18" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@semantic-release/npm/node_modules/clean-stack": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-5.3.0.tgz", - "integrity": "sha512-9ngPTOhYGQqNVSfeJkYXHmF7AGWp4/nN5D/QqNQs3Dvxd1Kk/WpjHfNujKHYUQ/5CoGyOyFNoWSPk5afzP0QVg==", + "node_modules/@semantic-release/release-notes-generator/node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", "dev": true, - "license": "MIT", + "license": "ISC" + }, + "node_modules/@semantic-release/release-notes-generator/node_modules/normalize-package-data": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-6.0.2.tgz", + "integrity": "sha512-V6gygoYb/5EmNI+MEGrWkC+e6+Rr7mTmfHrxDbLzxQogBkgzo76rkok0Am6thgSF7Mv2nLOajAJj5vDJZEFn7g==", + "dev": true, + "license": "BSD-2-Clause", "dependencies": { - "escape-string-regexp": "5.0.0" + "hosted-git-info": "^7.0.0", + "semver": "^7.3.5", + "validate-npm-package-license": "^3.0.4" }, "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/@semantic-release/npm/node_modules/escape-string-regexp": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", - "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", + "node_modules/@semantic-release/release-notes-generator/node_modules/parse-json": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-8.3.0.tgz", + "integrity": "sha512-ybiGyvspI+fAoRQbIPRddCcSTV9/LsJbf0e/S85VLowVGzRmokfneg2kwVW/KU5rOXrPSbF1qAKPMgNTqqROQQ==", "dev": true, "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.26.2", + "index-to-position": "^1.1.0", + "type-fest": "^4.39.1" + }, "engines": { - "node": ">=12" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@semantic-release/npm/node_modules/execa": { - "version": "9.6.1", - "resolved": "https://registry.npmjs.org/execa/-/execa-9.6.1.tgz", - "integrity": "sha512-9Be3ZoN4LmYR90tUoVu2te2BsbzHfhJyfEiAVfz7N5/zv+jduIfLrV2xdQXOHbaD6KgpGdO9PRPM1Y4Q9QkPkA==", + "node_modules/@semantic-release/release-notes-generator/node_modules/read-package-up": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/read-package-up/-/read-package-up-11.0.0.tgz", + "integrity": "sha512-MbgfoNPANMdb4oRBNg5eqLbB2t2r+o5Ua1pNt8BqGp4I0FJZhuVSOj3PaBPni4azWuSzEdNn2evevzVmEk1ohQ==", "dev": true, "license": "MIT", "dependencies": { - "@sindresorhus/merge-streams": "^4.0.0", - "cross-spawn": "^7.0.6", - "figures": "^6.1.0", - "get-stream": "^9.0.0", - "human-signals": "^8.0.1", - "is-plain-obj": "^4.1.0", - "is-stream": "^4.0.1", - "npm-run-path": "^6.0.0", - "pretty-ms": "^9.2.0", - "signal-exit": "^4.1.0", - "strip-final-newline": "^4.0.0", - "yoctocolors": "^2.1.1" + "find-up-simple": "^1.0.0", + "read-pkg": "^9.0.0", + "type-fest": "^4.6.0" }, "engines": { - "node": "^18.19.0 || >=20.5.0" + "node": ">=18" }, "funding": { - "url": "https://github.com/sindresorhus/execa?sponsor=1" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@semantic-release/npm/node_modules/get-stream": { + "node_modules/@semantic-release/release-notes-generator/node_modules/read-pkg": { "version": "9.0.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-9.0.1.tgz", - "integrity": "sha512-kVCxPF3vQM/N0B1PmoqVUqgHP+EeVjmZSQn+1oCRPxd2P21P2F19lIgbR3HBosbB1PUhOAoctJnfEn2GbN2eZA==", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-9.0.1.tgz", + "integrity": "sha512-9viLL4/n1BJUCT1NXVTdS1jtm80yDEgR5T4yCelII49Mbj0v1rZdKqj7zCiYdbB0CuCgdrvHcNogAKTFPBocFA==", "dev": true, "license": "MIT", "dependencies": { - "@sec-ant/readable-stream": "^0.4.1", - "is-stream": "^4.0.1" + "@types/normalize-package-data": "^2.4.3", + "normalize-package-data": "^6.0.0", + "parse-json": "^8.0.0", + "type-fest": "^4.6.0", + "unicorn-magic": "^0.1.0" }, "engines": { "node": ">=18" @@ -1957,33 +1664,23 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@semantic-release/npm/node_modules/human-signals": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-8.0.1.tgz", - "integrity": "sha512-eKCa6bwnJhvxj14kZk5NCPc6Hb6BdsU9DZcOnmQKSnO1VKrfV0zCvtttPZUsBvjmNDn8rpcJfpwSYnHBjc95MQ==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": ">=18.18.0" - } - }, - "node_modules/@semantic-release/npm/node_modules/indent-string": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz", - "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==", + "node_modules/@semantic-release/release-notes-generator/node_modules/type-fest": { + "version": "4.41.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.41.0.tgz", + "integrity": "sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==", "dev": true, - "license": "MIT", + "license": "(MIT OR CC0-1.0)", "engines": { - "node": ">=12" + "node": ">=16" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@semantic-release/npm/node_modules/is-stream": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-4.0.1.tgz", - "integrity": "sha512-Dnz92NInDqYckGEUJv689RbRiTSEHCQ7wOVeALbkOz999YpqT46yMRIGtSNl2iCL1waAZSx40+h59NV/EwzV/A==", + "node_modules/@semantic-release/release-notes-generator/node_modules/unicorn-magic": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/unicorn-magic/-/unicorn-magic-0.1.0.tgz", + "integrity": "sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==", "dev": true, "license": "MIT", "engines": { @@ -1993,53 +1690,36 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@semantic-release/npm/node_modules/npm-run-path": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-6.0.0.tgz", - "integrity": "sha512-9qny7Z9DsQU8Ou39ERsPU4OZQlSTP47ShQzuKZ6PRXpYLtIFgl/DEBYEXKlvcEa+9tHVcK8CF81Y2V72qaZhWA==", + "node_modules/@simple-libs/stream-utils": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@simple-libs/stream-utils/-/stream-utils-1.2.0.tgz", + "integrity": "sha512-KxXvfapcixpz6rVEB6HPjOUZT22yN6v0vI0urQSk1L8MlEWPDFCZkhw2xmkyoTGYeFw7tWTZd7e3lVzRZRN/EA==", "dev": true, "license": "MIT", - "dependencies": { - "path-key": "^4.0.0", - "unicorn-magic": "^0.3.0" - }, "engines": { "node": ">=18" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://ko-fi.com/dangreen" } }, - "node_modules/@semantic-release/npm/node_modules/path-key": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", - "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", + "node_modules/@sindresorhus/is": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.6.0.tgz", + "integrity": "sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==", "dev": true, "license": "MIT", "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@semantic-release/npm/node_modules/signal-exit": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", - "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=14" + "node": ">=10" }, "funding": { - "url": "https://github.com/sponsors/isaacs" + "url": "https://github.com/sindresorhus/is?sponsor=1" } }, - "node_modules/@semantic-release/npm/node_modules/strip-final-newline": { + "node_modules/@sindresorhus/merge-streams": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-4.0.0.tgz", - "integrity": "sha512-aulFJcD6YK8V1G7iRB5tigAP4TsHBZZrOV8pjV++zdUwmeV8uzbY7yn6h9MswN62adStNZFuCIx4haBnRuMDaw==", + "resolved": "https://registry.npmjs.org/@sindresorhus/merge-streams/-/merge-streams-4.0.0.tgz", + "integrity": "sha512-tlqY9xq5ukxTUZBmoOp+m61cqwQD5pHJtFY3Mn8CA8ps6yghLH/Hw8UPdqg4OLmFW3IFlcXnQNmo/dh8HzXYIQ==", "dev": true, "license": "MIT", "engines": { @@ -2049,257 +1729,13 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@semantic-release/npm/node_modules/unicorn-magic": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/unicorn-magic/-/unicorn-magic-0.3.0.tgz", - "integrity": "sha512-+QBBXBCvifc56fsbuxZQ6Sic3wqqc3WWaqxs58gvJrcOuN83HGTCwz3oS5phzU9LthRNE9VrJCFCLUgHeeFnfA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@semantic-release/release-notes-generator": { - "version": "14.1.0", - "resolved": "https://registry.npmjs.org/@semantic-release/release-notes-generator/-/release-notes-generator-14.1.0.tgz", - "integrity": "sha512-CcyDRk7xq+ON/20YNR+1I/jP7BYKICr1uKd1HHpROSnnTdGqOTburi4jcRiTYz0cpfhxSloQO3cGhnoot7IEkA==", - "dev": true, - "license": "MIT", - "dependencies": { - "conventional-changelog-angular": "^8.0.0", - "conventional-changelog-writer": "^8.0.0", - "conventional-commits-filter": "^5.0.0", - "conventional-commits-parser": "^6.0.0", - "debug": "^4.0.0", - "get-stream": "^7.0.0", - "import-from-esm": "^2.0.0", - "into-stream": "^7.0.0", - "lodash-es": "^4.17.21", - "read-package-up": "^11.0.0" - }, - "engines": { - "node": ">=20.8.1" - }, - "peerDependencies": { - "semantic-release": ">=20.1.0" - } - }, - "node_modules/@semantic-release/release-notes-generator/node_modules/get-stream": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-7.0.1.tgz", - "integrity": "sha512-3M8C1EOFN6r8AMUhwUAACIoXZJEOufDU5+0gFFN5uNs6XYOralD2Pqkl7m046va6x77FwposWXbAhPPIOus7mQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@semantic-release/release-notes-generator/node_modules/hosted-git-info": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-7.0.2.tgz", - "integrity": "sha512-puUZAUKT5m8Zzvs72XWy3HtvVbTWljRE66cP60bxJzAqf2DgICo7lYTY2IHUmLnNpjYvw5bvmoHvPc0QO2a62w==", - "dev": true, - "license": "ISC", - "dependencies": { - "lru-cache": "^10.0.1" - }, - "engines": { - "node": "^16.14.0 || >=18.0.0" - } - }, - "node_modules/@semantic-release/release-notes-generator/node_modules/into-stream": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/into-stream/-/into-stream-7.0.0.tgz", - "integrity": "sha512-2dYz766i9HprMBasCMvHMuazJ7u4WzhJwo5kb3iPSiW/iRYV6uPari3zHoqZlnuaR7V1bEiNMxikhp37rdBXbw==", - "dev": true, - "license": "MIT", - "dependencies": { - "from2": "^2.3.0", - "p-is-promise": "^3.0.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@semantic-release/release-notes-generator/node_modules/lru-cache": { - "version": "10.4.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", - "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", - "dev": true, - "license": "ISC" - }, - "node_modules/@semantic-release/release-notes-generator/node_modules/normalize-package-data": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-6.0.2.tgz", - "integrity": "sha512-V6gygoYb/5EmNI+MEGrWkC+e6+Rr7mTmfHrxDbLzxQogBkgzo76rkok0Am6thgSF7Mv2nLOajAJj5vDJZEFn7g==", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "hosted-git-info": "^7.0.0", - "semver": "^7.3.5", - "validate-npm-package-license": "^3.0.4" - }, - "engines": { - "node": "^16.14.0 || >=18.0.0" - } - }, - "node_modules/@semantic-release/release-notes-generator/node_modules/parse-json": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-8.3.0.tgz", - "integrity": "sha512-ybiGyvspI+fAoRQbIPRddCcSTV9/LsJbf0e/S85VLowVGzRmokfneg2kwVW/KU5rOXrPSbF1qAKPMgNTqqROQQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/code-frame": "^7.26.2", - "index-to-position": "^1.1.0", - "type-fest": "^4.39.1" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@semantic-release/release-notes-generator/node_modules/read-package-up": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/read-package-up/-/read-package-up-11.0.0.tgz", - "integrity": "sha512-MbgfoNPANMdb4oRBNg5eqLbB2t2r+o5Ua1pNt8BqGp4I0FJZhuVSOj3PaBPni4azWuSzEdNn2evevzVmEk1ohQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "find-up-simple": "^1.0.0", - "read-pkg": "^9.0.0", - "type-fest": "^4.6.0" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@semantic-release/release-notes-generator/node_modules/read-pkg": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-9.0.1.tgz", - "integrity": "sha512-9viLL4/n1BJUCT1NXVTdS1jtm80yDEgR5T4yCelII49Mbj0v1rZdKqj7zCiYdbB0CuCgdrvHcNogAKTFPBocFA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/normalize-package-data": "^2.4.3", - "normalize-package-data": "^6.0.0", - "parse-json": "^8.0.0", - "type-fest": "^4.6.0", - "unicorn-magic": "^0.1.0" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@semantic-release/release-notes-generator/node_modules/type-fest": { - "version": "4.41.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.41.0.tgz", - "integrity": "sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==", - "dev": true, - "license": "(MIT OR CC0-1.0)", - "engines": { - "node": ">=16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@semantic-release/release-notes-generator/node_modules/unicorn-magic": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/unicorn-magic/-/unicorn-magic-0.1.0.tgz", - "integrity": "sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@simple-libs/stream-utils": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@simple-libs/stream-utils/-/stream-utils-1.2.0.tgz", - "integrity": "sha512-KxXvfapcixpz6rVEB6HPjOUZT22yN6v0vI0urQSk1L8MlEWPDFCZkhw2xmkyoTGYeFw7tWTZd7e3lVzRZRN/EA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://ko-fi.com/dangreen" - } - }, - "node_modules/@sinclair/typebox": { - "version": "0.27.10", - "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.10.tgz", - "integrity": "sha512-MTBk/3jGLNB2tVxv6uLlFh1iu64iYOQ2PbdOSK3NW8JZsmlaOh2q6sdtKowBhfw8QFLmYNzTW4/oK4uATIi6ZA==", + "node_modules/@standard-schema/spec": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@standard-schema/spec/-/spec-1.1.0.tgz", + "integrity": "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==", "dev": true, "license": "MIT" }, - "node_modules/@sindresorhus/is": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.6.0.tgz", - "integrity": "sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sindresorhus/is?sponsor=1" - } - }, - "node_modules/@sindresorhus/merge-streams": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/merge-streams/-/merge-streams-4.0.0.tgz", - "integrity": "sha512-tlqY9xq5ukxTUZBmoOp+m61cqwQD5pHJtFY3Mn8CA8ps6yghLH/Hw8UPdqg4OLmFW3IFlcXnQNmo/dh8HzXYIQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@sinonjs/commons": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.1.tgz", - "integrity": "sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "type-detect": "4.0.8" - } - }, - "node_modules/@sinonjs/fake-timers": { - "version": "10.3.0", - "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz", - "integrity": "sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "@sinonjs/commons": "^3.0.0" - } - }, "node_modules/@stoplight/better-ajv-errors": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/@stoplight/better-ajv-errors/-/better-ajv-errors-1.0.3.tgz", @@ -2803,50 +2239,34 @@ "node": "^12.20 || >=14.13" } }, - "node_modules/@types/babel__core": { - "version": "7.20.5", - "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", - "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/parser": "^7.20.7", - "@babel/types": "^7.20.7", - "@types/babel__generator": "*", - "@types/babel__template": "*", - "@types/babel__traverse": "*" - } - }, - "node_modules/@types/babel__generator": { - "version": "7.27.0", - "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.27.0.tgz", - "integrity": "sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg==", + "node_modules/@tybys/wasm-util": { + "version": "0.10.2", + "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.2.tgz", + "integrity": "sha512-RoBvJ2X0wuKlWFIjrwffGw1IqZHKQqzIchKaadZZfnNpsAYp2mM0h36JtPCjNDAHGgYez/15uMBpfGwchhiMgg==", "dev": true, "license": "MIT", + "optional": true, "dependencies": { - "@babel/types": "^7.0.0" + "tslib": "^2.4.0" } }, - "node_modules/@types/babel__template": { - "version": "7.4.4", - "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz", - "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==", + "node_modules/@types/chai": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-5.2.3.tgz", + "integrity": "sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==", "dev": true, "license": "MIT", "dependencies": { - "@babel/parser": "^7.1.0", - "@babel/types": "^7.0.0" + "@types/deep-eql": "*", + "assertion-error": "^2.0.1" } }, - "node_modules/@types/babel__traverse": { - "version": "7.28.0", - "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.28.0.tgz", - "integrity": "sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q==", + "node_modules/@types/deep-eql": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/deep-eql/-/deep-eql-4.0.2.tgz", + "integrity": "sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==", "dev": true, - "license": "MIT", - "dependencies": { - "@babel/types": "^7.28.2" - } + "license": "MIT" }, "node_modules/@types/es-aggregate-error": { "version": "1.0.6", @@ -2870,47 +2290,10 @@ "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==", "license": "MIT" }, - "node_modules/@types/graceful-fs": { - "version": "4.1.9", - "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.9.tgz", - "integrity": "sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@types/istanbul-lib-coverage": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz", - "integrity": "sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==", - "dev": true, - "license": "MIT" - }, - "node_modules/@types/istanbul-lib-report": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.3.tgz", - "integrity": "sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/istanbul-lib-coverage": "*" - } - }, - "node_modules/@types/istanbul-reports": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.4.tgz", - "integrity": "sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/istanbul-lib-report": "*" - } - }, - "node_modules/@types/json-schema": { - "version": "7.0.15", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", - "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", "license": "MIT" }, "node_modules/@types/linkify-it": { @@ -2966,36 +2349,203 @@ "integrity": "sha512-kRz0VEkJqWLf1LLVN4pT1cg1Z9wAuvI6L97V3m2f5B76Tg8d413ddvLBPTEHAZJlnn4XSvu0FkZtViCQGVyrXQ==", "license": "MIT" }, - "node_modules/@types/stack-utils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.3.tgz", - "integrity": "sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==", - "dev": true, - "license": "MIT" - }, "node_modules/@types/urijs": { "version": "1.19.26", "resolved": "https://registry.npmjs.org/@types/urijs/-/urijs-1.19.26.tgz", "integrity": "sha512-wkXrVzX5yoqLnndOwFsieJA7oKM8cNkOKJtf/3vVGSUFkWDKZvFHpIl9Pvqb/T9UsawBBFMTTD8xu7sK5MWuvg==", "license": "MIT" }, - "node_modules/@types/yargs": { - "version": "17.0.35", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.35.tgz", - "integrity": "sha512-qUHkeCyQFxMXg79wQfTtfndEC+N9ZZg76HJftDJp+qH2tV7Gj4OJi7l+PiWwJ+pWtW8GwSmqsDj/oymhrTWXjg==", + "node_modules/@vitest/coverage-v8": { + "version": "4.1.8", + "resolved": "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-4.1.8.tgz", + "integrity": "sha512-lt3kovsyHwYe00wq4D1ti0Z974fWj4NLp6siqiyEufUpyFwK9Yhi7rBhac9JL5aA0zoMrJqc4vYPZRUnI7l7nw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@bcoe/v8-coverage": "^1.0.2", + "@vitest/utils": "4.1.8", + "ast-v8-to-istanbul": "^1.0.0", + "istanbul-lib-coverage": "^3.2.2", + "istanbul-lib-report": "^3.0.1", + "istanbul-reports": "^3.2.0", + "magicast": "^0.5.2", + "obug": "^2.1.1", + "std-env": "^4.0.0-rc.1", + "tinyrainbow": "^3.1.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "@vitest/browser": "4.1.8", + "vitest": "4.1.8" + }, + "peerDependenciesMeta": { + "@vitest/browser": { + "optional": true + } + } + }, + "node_modules/@vitest/coverage-v8/node_modules/@bcoe/v8-coverage": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-1.0.2.tgz", + "integrity": "sha512-6zABk/ECA/QYSCQ1NGiVwwbQerUCZ+TQbp64Q3AgmfNvurHH0j8TtXa1qbShXA6qqkpAj4V5W8pP6mLe1mcMqA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/@vitest/expect": { + "version": "4.1.8", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-4.1.8.tgz", + "integrity": "sha512-h3nDO677RDLEGlBxyQ5CW8RlMThSKSRLUePLOx09gNIWRL40edgA1GCZSZgf1W55MFAG6/Sw14KeaAnqv0NKdQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@standard-schema/spec": "^1.1.0", + "@types/chai": "^5.2.2", + "@vitest/spy": "4.1.8", + "@vitest/utils": "4.1.8", + "chai": "^6.2.2", + "tinyrainbow": "^3.1.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/mocker": { + "version": "4.1.8", + "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-4.1.8.tgz", + "integrity": "sha512-LEiN/xe4OSIbKe9HQIp5OC24agGD9J5CnmMgsLohVVoOPWL9a2sBoR6VBx43jQZb7Kr1l4RCuyCJzcAa0+dojw==", "dev": true, "license": "MIT", "dependencies": { - "@types/yargs-parser": "*" + "@vitest/spy": "4.1.8", + "estree-walker": "^3.0.3", + "magic-string": "^0.30.21" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "msw": "^2.4.9", + "vite": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "msw": { + "optional": true + }, + "vite": { + "optional": true + } } }, - "node_modules/@types/yargs-parser": { - "version": "21.0.3", - "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.3.tgz", - "integrity": "sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==", + "node_modules/@vitest/mocker/node_modules/@types/estree": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.9.tgz", + "integrity": "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==", "dev": true, "license": "MIT" }, + "node_modules/@vitest/mocker/node_modules/estree-walker": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0" + } + }, + "node_modules/@vitest/mocker/node_modules/magic-string": { + "version": "0.30.21", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", + "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.5" + } + }, + "node_modules/@vitest/pretty-format": { + "version": "4.1.8", + "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-4.1.8.tgz", + "integrity": "sha512-9GasEBxpZ1VYIpqHf/0+YGg121uSNwCKOJqIrTwWP/TB7DmFCiaBpNl3aPZzoLWfWkuqhbH8vJIVobZkvdo2cA==", + "dev": true, + "license": "MIT", + "dependencies": { + "tinyrainbow": "^3.1.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/runner": { + "version": "4.1.8", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-4.1.8.tgz", + "integrity": "sha512-EmVxeBAfMJvycdjd6Hm+RbFBbA9fKvo0Kx37hNpBYoYeavH3RNsBXWDooR1mgD52dCrxIIuP7UotpfiwOikvcg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/utils": "4.1.8", + "pathe": "^2.0.3" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/snapshot": { + "version": "4.1.8", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-4.1.8.tgz", + "integrity": "sha512-acfZboRmAIf05DEKcBQy33VXojFJjtUdLyo7oOmV9kebb2xdU01UknNiPuPZoJZQyO7DF0gZdTGTpeAzET9QPQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/pretty-format": "4.1.8", + "@vitest/utils": "4.1.8", + "magic-string": "^0.30.21", + "pathe": "^2.0.3" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/snapshot/node_modules/magic-string": { + "version": "0.30.21", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", + "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.5" + } + }, + "node_modules/@vitest/spy": { + "version": "4.1.8", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-4.1.8.tgz", + "integrity": "sha512-6EevtBp6OZOPF7bmz36HrGMeP3txgVSrgebWxHOafDXGkhIzfXK14f8KF6MuFfgXXUeHxmpD3BQxkV00/3s5mA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/utils": { + "version": "4.1.8", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-4.1.8.tgz", + "integrity": "sha512-uOJamYALNhfJ6iolExyQM40yIQwDqYnkKtQ5VCiSe17E33H0aQ/u+1GlRuz4LZBk6Mm3sg90G9hEbmEt37C1Zg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/pretty-format": "4.1.8", + "convert-source-map": "^2.0.0", + "tinyrainbow": "^3.1.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, "node_modules/abort-controller": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", @@ -3114,35 +2664,6 @@ } } }, - "node_modules/ansi-escapes": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", - "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "type-fest": "^0.21.3" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/ansi-escapes/node_modules/type-fest": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", - "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", - "dev": true, - "license": "(MIT OR CC0-1.0)", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", @@ -3174,20 +2695,6 @@ "dev": true, "license": "MIT" }, - "node_modules/anymatch": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", - "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", - "dev": true, - "license": "ISC", - "dependencies": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" - }, - "engines": { - "node": ">= 8" - } - }, "node_modules/argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", @@ -3263,6 +2770,16 @@ "printable-characters": "^1.0.42" } }, + "node_modules/assertion-error": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", + "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + } + }, "node_modules/ast-types": { "version": "0.14.2", "resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.14.2.tgz", @@ -3275,6 +2792,42 @@ "node": ">=4" } }, + "node_modules/ast-v8-to-istanbul": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/ast-v8-to-istanbul/-/ast-v8-to-istanbul-1.0.3.tgz", + "integrity": "sha512-jCMQ6ZylLPudp0CDfBmQBZUsrh1/8psbmu9ibeVWKuHWD0YrH9YABwlKu5kVEFoT0GCQQW9Z/SxfuEbbkGQCRg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.31", + "estree-walker": "^3.0.3", + "js-tokens": "^10.0.0" + } + }, + "node_modules/ast-v8-to-istanbul/node_modules/@types/estree": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.9.tgz", + "integrity": "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==", + "dev": true, + "license": "MIT" + }, + "node_modules/ast-v8-to-istanbul/node_modules/estree-walker": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0" + } + }, + "node_modules/ast-v8-to-istanbul/node_modules/js-tokens": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-10.0.0.tgz", + "integrity": "sha512-lM/UBzQmfJRo9ABXbPWemivdCW8V2G8FHaHdypQaIy523snUjog0W71ayWXTjiR+ixeMyVHN2XcpnTd/liPg/Q==", + "dev": true, + "license": "MIT" + }, "node_modules/astring": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/astring/-/astring-1.9.0.tgz", @@ -3318,132 +2871,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/babel-jest": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.7.0.tgz", - "integrity": "sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/transform": "^29.7.0", - "@types/babel__core": "^7.1.14", - "babel-plugin-istanbul": "^6.1.1", - "babel-preset-jest": "^29.6.3", - "chalk": "^4.0.0", - "graceful-fs": "^4.2.9", - "slash": "^3.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - }, - "peerDependencies": { - "@babel/core": "^7.8.0" - } - }, - "node_modules/babel-plugin-istanbul": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz", - "integrity": "sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0", - "@istanbuljs/load-nyc-config": "^1.0.0", - "@istanbuljs/schema": "^0.1.2", - "istanbul-lib-instrument": "^5.0.4", - "test-exclude": "^6.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/babel-plugin-istanbul/node_modules/istanbul-lib-instrument": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz", - "integrity": "sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "@babel/core": "^7.12.3", - "@babel/parser": "^7.14.7", - "@istanbuljs/schema": "^0.1.2", - "istanbul-lib-coverage": "^3.2.0", - "semver": "^6.3.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/babel-plugin-istanbul/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true, - "license": "ISC", - "bin": { - "semver": "bin/semver.js" - } - }, - "node_modules/babel-plugin-jest-hoist": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.6.3.tgz", - "integrity": "sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/template": "^7.3.3", - "@babel/types": "^7.3.3", - "@types/babel__core": "^7.1.14", - "@types/babel__traverse": "^7.0.6" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/babel-preset-current-node-syntax": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.2.0.tgz", - "integrity": "sha512-E/VlAEzRrsLEb2+dv8yp3bo4scof3l9nR4lrld+Iy5NyVqgVYUJnDAmunkhPMisRI32Qc4iRiz425d8vM++2fg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/plugin-syntax-async-generators": "^7.8.4", - "@babel/plugin-syntax-bigint": "^7.8.3", - "@babel/plugin-syntax-class-properties": "^7.12.13", - "@babel/plugin-syntax-class-static-block": "^7.14.5", - "@babel/plugin-syntax-import-attributes": "^7.24.7", - "@babel/plugin-syntax-import-meta": "^7.10.4", - "@babel/plugin-syntax-json-strings": "^7.8.3", - "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4", - "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", - "@babel/plugin-syntax-numeric-separator": "^7.10.4", - "@babel/plugin-syntax-object-rest-spread": "^7.8.3", - "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", - "@babel/plugin-syntax-optional-chaining": "^7.8.3", - "@babel/plugin-syntax-private-property-in-object": "^7.14.5", - "@babel/plugin-syntax-top-level-await": "^7.14.5" - }, - "peerDependencies": { - "@babel/core": "^7.0.0 || ^8.0.0-0" - } - }, - "node_modules/babel-preset-jest": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-29.6.3.tgz", - "integrity": "sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA==", - "dev": true, - "license": "MIT", - "dependencies": { - "babel-plugin-jest-hoist": "^29.6.3", - "babel-preset-current-node-syntax": "^1.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" - } - }, "node_modules/backslash": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/backslash/-/backslash-0.2.2.tgz", @@ -3479,19 +2906,6 @@ ], "license": "MIT" }, - "node_modules/baseline-browser-mapping": { - "version": "2.10.27", - "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.27.tgz", - "integrity": "sha512-zEs/ufmZoUd7WftKpKyXaT6RFxpQ5Qm9xytKRHvJfxFV9DFJkZph9RvJ1LcOUi0Z1ZVijMte65JbILeV+8QQEA==", - "dev": true, - "license": "Apache-2.0", - "bin": { - "baseline-browser-mapping": "dist/cli.cjs" - }, - "engines": { - "node": ">=6.0.0" - } - }, "node_modules/before-after-hook": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-4.0.0.tgz", @@ -3564,82 +2978,31 @@ "node": ">=8" } }, - "node_modules/browserslist": { - "version": "4.28.2", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.2.tgz", - "integrity": "sha512-48xSriZYYg+8qXna9kwqjIVzuQxi+KYWp2+5nCYnYKPTr0LvD89Jqk2Or5ogxz0NUMfIjhh2lIUX/LyX9B4oIg==", + "node_modules/buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", "dev": true, "funding": [ { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" + "type": "github", + "url": "https://github.com/sponsors/feross" }, { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/browserslist" + "type": "patreon", + "url": "https://www.patreon.com/feross" }, { - "type": "github", - "url": "https://github.com/sponsors/ai" + "type": "consulting", + "url": "https://feross.org/support" } ], "license": "MIT", "dependencies": { - "baseline-browser-mapping": "^2.10.12", - "caniuse-lite": "^1.0.30001782", - "electron-to-chromium": "^1.5.328", - "node-releases": "^2.0.36", - "update-browserslist-db": "^1.2.3" - }, - "bin": { - "browserslist": "cli.js" - }, - "engines": { - "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" } }, - "node_modules/bser": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz", - "integrity": "sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "node-int64": "^0.4.0" - } - }, - "node_modules/buffer": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", - "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT", - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.1.13" - } - }, - "node_modules/buffer-from": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", - "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", - "dev": true, - "license": "MIT" - }, "node_modules/builtins": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/builtins/-/builtins-1.0.3.tgz", @@ -3703,37 +3066,6 @@ "node": ">=6" } }, - "node_modules/camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/caniuse-lite": { - "version": "1.0.30001792", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001792.tgz", - "integrity": "sha512-hVLMUZFgR4JJ6ACt1uEESvQN1/dBVqPAKY0hgrV70eN3391K6juAfTjKZLKvOMsx8PxA7gsY1/tLMMTcfFLLpw==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/caniuse-lite" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "CC-BY-4.0" - }, "node_modules/catharsis": { "version": "0.9.0", "resolved": "https://registry.npmjs.org/catharsis/-/catharsis-0.9.0.tgz", @@ -3747,6 +3079,16 @@ "node": ">= 10" } }, + "node_modules/chai": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/chai/-/chai-6.2.2.tgz", + "integrity": "sha512-NUPRluOfOiTKBKvWPtSD4PhFvWCqOi0BGStNWs57X9js7XGTprSmFoz5F0tWhR4WPjNeR9jXqdC7/UpSJTnlRg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, "node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -3780,29 +3122,6 @@ "dev": true, "license": "ISC" }, - "node_modules/ci-info": { - "version": "3.9.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", - "integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/sibiraj-s" - } - ], - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/cjs-module-lexer": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.4.3.tgz", - "integrity": "sha512-9z8TZaGM1pfswYeXrUpzPrkx8UnWYdhJclsiYMm6x/w5+nN+8Tf/LnAgfLGQCm59qAOxU8WwHEq2vNwF6i4j+Q==", - "dev": true, - "license": "MIT" - }, "node_modules/clean-stack": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", @@ -3900,24 +3219,6 @@ "node": ">=0.8" } }, - "node_modules/co": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", - "integrity": "sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==", - "dev": true, - "license": "MIT", - "engines": { - "iojs": ">= 1.0.0", - "node": ">= 0.12.0" - } - }, - "node_modules/collect-v8-coverage": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.3.tgz", - "integrity": "sha512-1L5aqIkwPfiodaMgQunkF1zRhNqifHBmtbbbxcr6yVxxBnliw4TDOW6NxpO8DJLgJ16OT+Y4ztZqP6p/FtXnAw==", - "dev": true, - "license": "MIT" - }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -4102,28 +3403,6 @@ } } }, - "node_modules/create-jest": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/create-jest/-/create-jest-29.7.0.tgz", - "integrity": "sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/types": "^29.6.3", - "chalk": "^4.0.0", - "exit": "^0.1.2", - "graceful-fs": "^4.2.9", - "jest-config": "^29.7.0", - "jest-util": "^29.7.0", - "prompts": "^2.0.1" - }, - "bin": { - "create-jest": "bin/create-jest.js" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, "node_modules/cross-spawn": { "version": "7.0.6", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", @@ -4259,21 +3538,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/dedent": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.7.2.tgz", - "integrity": "sha512-WzMx3mW98SN+zn3hgemf4OzdmyNhhhKz5Ay0pUfQiMQ3e1g+xmTJWp/pKdwKVXhdSkAEGIIzqeuWrL3mV/AXbA==", - "dev": true, - "license": "MIT", - "peerDependencies": { - "babel-plugin-macros": "^3.1.0" - }, - "peerDependenciesMeta": { - "babel-plugin-macros": { - "optional": true - } - } - }, "node_modules/deep-extend": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", @@ -4291,16 +3555,6 @@ "dev": true, "license": "MIT" }, - "node_modules/deepmerge": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", - "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/defaults": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.4.tgz", @@ -4366,26 +3620,6 @@ "node": ">=8" } }, - "node_modules/detect-newline": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", - "integrity": "sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/diff-sequences": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", - "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, "node_modules/dir-glob": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", @@ -4435,26 +3669,6 @@ "readable-stream": "^2.0.2" } }, - "node_modules/electron-to-chromium": { - "version": "1.5.352", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.352.tgz", - "integrity": "sha512-9wHk8x6dyuimoe18EdiDPWKExNdxYqo4fn4FwOVVper6RxT3cmpBwBkWWfSOCYJjQdIco/nPhJhNLmn4Ufg1Yg==", - "dev": true, - "license": "ISC" - }, - "node_modules/emittery": { - "version": "0.13.1", - "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.13.1.tgz", - "integrity": "sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sindresorhus/emittery?sponsor=1" - } - }, "node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", @@ -4790,6 +4004,13 @@ "node": ">= 0.4" } }, + "node_modules/es-module-lexer": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-2.1.0.tgz", + "integrity": "sha512-n27zTYMjYu1aj4MjCWzSP7G9r75utsaoc8m61weK+W8JMBGGQybd43GstCXZ3WNmSFtGT9wi59qQTW6mhTR5LQ==", + "dev": true, + "license": "MIT" + }, "node_modules/es-object-atoms": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", @@ -5089,20 +4310,6 @@ "url": "https://opencollective.com/eslint" } }, - "node_modules/esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true, - "license": "BSD-2-Clause", - "bin": { - "esparse": "bin/esparse.js", - "esvalidate": "bin/esvalidate.js" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/esquery": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.7.0.tgz", @@ -5188,15 +4395,6 @@ "url": "https://github.com/sindresorhus/execa?sponsor=1" } }, - "node_modules/exit": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", - "integrity": "sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==", - "dev": true, - "engines": { - "node": ">= 0.8.0" - } - }, "node_modules/expand-template": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", @@ -5207,21 +4405,14 @@ "node": ">=6" } }, - "node_modules/expect": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/expect/-/expect-29.7.0.tgz", - "integrity": "sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==", + "node_modules/expect-type": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.3.0.tgz", + "integrity": "sha512-knvyeauYhqjOYvQ66MznSMs83wmHrCycNEN6Ao+2AeYEfxUIkuiVxdEa1qlGEPK+We3n0THiDciYSsCcgW/DoA==", "dev": true, - "license": "MIT", - "dependencies": { - "@jest/expect-utils": "^29.7.0", - "jest-get-type": "^29.6.3", - "jest-matcher-utils": "^29.7.0", - "jest-message-util": "^29.7.0", - "jest-util": "^29.7.0" - }, + "license": "Apache-2.0", "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">=12.0.0" } }, "node_modules/fast-content-type-parse": { @@ -5327,16 +4518,6 @@ "reusify": "^1.0.4" } }, - "node_modules/fb-watchman": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz", - "integrity": "sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "bser": "2.1.1" - } - }, "node_modules/figures": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/figures/-/figures-6.1.0.tgz", @@ -5573,16 +4754,6 @@ "node": ">= 0.4" } }, - "node_modules/gensync": { - "version": "1.0.0-beta.2", - "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", - "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, "node_modules/get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", @@ -5629,16 +4800,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/get-package-type": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", - "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8.0.0" - } - }, "node_modules/get-proto": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", @@ -6147,26 +5308,6 @@ "node": ">=18.20" } }, - "node_modules/import-local": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.2.0.tgz", - "integrity": "sha512-2SPlun1JUPWoM6t3F0dw0FkCF/jWY8kttcY4f599GLTSjh2OCuuhdTkJQsEcZzBqbXZGKMK2OqW1oZsjtf/gQA==", - "dev": true, - "license": "MIT", - "dependencies": { - "pkg-dir": "^4.2.0", - "resolve-cwd": "^3.0.0" - }, - "bin": { - "import-local-fixture": "fixtures/cli.js" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/import-meta-resolve": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-4.2.0.tgz", @@ -6222,380 +5363,65 @@ "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", - "license": "ISC", - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "license": "ISC" - }, - "node_modules/ini": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", - "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", - "dev": true, - "license": "ISC" - }, - "node_modules/internal-slot": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.1.0.tgz", - "integrity": "sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw==", - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "hasown": "^2.0.2", - "side-channel": "^1.1.0" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/into-stream": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/into-stream/-/into-stream-6.0.0.tgz", - "integrity": "sha512-XHbaOAvP+uFKUFsOgoNPRjLkwB+I22JFPFe5OjTkQ0nwgj6+pSjb4NmB6VMxaPshLiOf+zcpOCBQuLwC1KHhZA==", - "dev": true, - "license": "MIT", - "dependencies": { - "from2": "^2.3.0", - "p-is-promise": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/is-array-buffer": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.5.tgz", - "integrity": "sha512-DDfANUiiG2wC1qawP66qlTugJeL5HyzMpfr8lLK+jMQirGzNod0B12cFB/9q838Ru27sBwfw78/rdoU7RERz6A==", - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.8", - "call-bound": "^1.0.3", - "get-intrinsic": "^1.2.6" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", - "dev": true, - "license": "MIT" - }, - "node_modules/is-async-function": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-async-function/-/is-async-function-2.1.1.tgz", - "integrity": "sha512-9dgM/cZBnNvjzaMYHVoxxfPj2QXt22Ev7SuuPrs+xav0ukGB0S6d4ydZdEiM48kLx5kDV+QBPrpVnFyefL8kkQ==", - "license": "MIT", - "dependencies": { - "async-function": "^1.0.0", - "call-bound": "^1.0.3", - "get-proto": "^1.0.1", - "has-tostringtag": "^1.0.2", - "safe-regex-test": "^1.1.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-bigint": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.1.0.tgz", - "integrity": "sha512-n4ZT37wG78iz03xPRKJrHTdZbe3IicyucEtdRsV5yglwc3GyUfbAfpSeD0FJ41NbUNSt5wbhqfp1fS+BgnvDFQ==", - "license": "MIT", - "dependencies": { - "has-bigints": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-boolean-object": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.2.2.tgz", - "integrity": "sha512-wa56o2/ElJMYqjCjGkXri7it5FbebW5usLw/nPmCMs5DeZ7eziSYZhSmPRn0txqeW4LnAmQQU7FgqLpsEFKM4A==", - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.3", - "has-tostringtag": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-callable": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", - "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-core-module": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.9.0.tgz", - "integrity": "sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A==", - "dev": true, - "license": "MIT", - "dependencies": { - "has": "^1.0.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-data-view": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.2.tgz", - "integrity": "sha512-RKtWF8pGmS87i2D6gqQu/l7EYRlVdfzemCJN/P3UOs//x1QE7mfhvzHIApBTRf7axvT6DMGwSwBXYCT0nfB9xw==", - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.2", - "get-intrinsic": "^1.2.6", - "is-typed-array": "^1.1.13" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-date-object": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.1.0.tgz", - "integrity": "sha512-PwwhEakHVKTdRNVOw+/Gyh0+MzlCl4R6qKvkhuvLtPMggI1WAHt9sOwZxQLSGpUaDnrdyDsomoRgNnCfKNSXXg==", - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.2", - "has-tostringtag": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-finalizationregistry": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/is-finalizationregistry/-/is-finalizationregistry-1.1.1.tgz", - "integrity": "sha512-1pC6N8qWJbWoPtEjgcL2xyhQOP491EQjeUo3qTKcmV8YSDDJrOepfG8pcC7h/QgnQHYSv0mJ3Z/ZWxmatVrysg==", - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/is-generator-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz", - "integrity": "sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/is-generator-function": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.1.2.tgz", - "integrity": "sha512-upqt1SkGkODW9tsGNG5mtXTXtECizwtS2kA161M+gJPc1xdb/Ax629af6YrTwcOeQHbewrPNlE5Dx7kzvXTizA==", - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.4", - "generator-function": "^2.0.0", - "get-proto": "^1.0.1", - "has-tostringtag": "^1.0.2", - "safe-regex-test": "^1.1.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "license": "MIT", - "dependencies": { - "is-extglob": "^2.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-map": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.3.tgz", - "integrity": "sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-negative-zero": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz", - "integrity": "sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "license": "MIT", - "engines": { - "node": ">=0.12.0" - } - }, - "node_modules/is-number-object": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.1.1.tgz", - "integrity": "sha512-lZhclumE1G6VYD8VHe35wFaIif+CTy5SJIi5+3y4psDgWu4wPDoBhF8NxUOinEc7pHgiTsT6MaBb92rKhhD+Xw==", - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.3", - "has-tostringtag": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-obj": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", - "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/is-plain-obj": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.1.0.tgz", - "integrity": "sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/is-reference": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.2.1.tgz", - "integrity": "sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==", - "license": "MIT", + "license": "ISC", "dependencies": { - "@types/estree": "*" + "once": "^1.3.0", + "wrappy": "1" } }, - "node_modules/is-regex": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.2.1.tgz", - "integrity": "sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g==", + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "license": "ISC" + }, + "node_modules/ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "dev": true, + "license": "ISC" + }, + "node_modules/internal-slot": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.1.0.tgz", + "integrity": "sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw==", "license": "MIT", "dependencies": { - "call-bound": "^1.0.2", - "gopd": "^1.2.0", - "has-tostringtag": "^1.0.2", - "hasown": "^2.0.2" + "es-errors": "^1.3.0", + "hasown": "^2.0.2", + "side-channel": "^1.1.0" }, "engines": { "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-set": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.3.tgz", - "integrity": "sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg==", + "node_modules/into-stream": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/into-stream/-/into-stream-6.0.0.tgz", + "integrity": "sha512-XHbaOAvP+uFKUFsOgoNPRjLkwB+I22JFPFe5OjTkQ0nwgj6+pSjb4NmB6VMxaPshLiOf+zcpOCBQuLwC1KHhZA==", + "dev": true, "license": "MIT", + "dependencies": { + "from2": "^2.3.0", + "p-is-promise": "^3.0.0" + }, "engines": { - "node": ">= 0.4" + "node": ">=10" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/is-shared-array-buffer": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.4.tgz", - "integrity": "sha512-ISWac8drv4ZGfwKl5slpHG9OwPNty4jOWPRIhBpxOoD+hqITiwuipOQ2bNthAzwA3B4fIjO4Nln74N0S9byq8A==", + "node_modules/is-array-buffer": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.5.tgz", + "integrity": "sha512-DDfANUiiG2wC1qawP66qlTugJeL5HyzMpfr8lLK+jMQirGzNod0B12cFB/9q838Ru27sBwfw78/rdoU7RERz6A==", "license": "MIT", "dependencies": { - "call-bound": "^1.0.3" + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "get-intrinsic": "^1.2.6" }, "engines": { "node": ">= 0.4" @@ -6604,27 +5430,24 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-stream": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", - "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "node_modules/is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } + "license": "MIT" }, - "node_modules/is-string": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.1.1.tgz", - "integrity": "sha512-BtEeSsoaQjlSPBemMQIrY1MY0uM6vnS1g5fmufYOtnxLGUZM2178PKbhsk7Ffv58IX+ZtcvoGwccYsh0PglkAA==", + "node_modules/is-async-function": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-async-function/-/is-async-function-2.1.1.tgz", + "integrity": "sha512-9dgM/cZBnNvjzaMYHVoxxfPj2QXt22Ev7SuuPrs+xav0ukGB0S6d4ydZdEiM48kLx5kDV+QBPrpVnFyefL8kkQ==", "license": "MIT", "dependencies": { + "async-function": "^1.0.0", "call-bound": "^1.0.3", - "has-tostringtag": "^1.0.2" + "get-proto": "^1.0.1", + "has-tostringtag": "^1.0.2", + "safe-regex-test": "^1.1.0" }, "engines": { "node": ">= 0.4" @@ -6633,15 +5456,13 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-symbol": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.1.1.tgz", - "integrity": "sha512-9gGx6GTtCQM73BgmHQXfDmLtfjjTUDSyoxTCbp5WtoixAhfgsDirWIcVQ/IHpvI5Vgd5i/J5F7B9cN/WlVbC/w==", + "node_modules/is-bigint": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.1.0.tgz", + "integrity": "sha512-n4ZT37wG78iz03xPRKJrHTdZbe3IicyucEtdRsV5yglwc3GyUfbAfpSeD0FJ41NbUNSt5wbhqfp1fS+BgnvDFQ==", "license": "MIT", "dependencies": { - "call-bound": "^1.0.2", - "has-symbols": "^1.1.0", - "safe-regex-test": "^1.1.0" + "has-bigints": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -6650,13 +5471,14 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-typed-array": { - "version": "1.1.15", - "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.15.tgz", - "integrity": "sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ==", + "node_modules/is-boolean-object": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.2.2.tgz", + "integrity": "sha512-wa56o2/ElJMYqjCjGkXri7it5FbebW5usLw/nPmCMs5DeZ7eziSYZhSmPRn0txqeW4LnAmQQU7FgqLpsEFKM4A==", "license": "MIT", "dependencies": { - "which-typed-array": "^1.1.16" + "call-bound": "^1.0.3", + "has-tostringtag": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -6665,38 +5487,40 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-unicode-supported": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-2.1.0.tgz", - "integrity": "sha512-mE00Gnza5EEB3Ds0HfMyllZzbBrmLOX3vfWoj9A9PEnTfratQ/BcaJOuMhnkhjXvb2+FkY3VuHqtAGpTPmglFQ==", - "dev": true, + "node_modules/is-callable": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", "license": "MIT", "engines": { - "node": ">=18" + "node": ">= 0.4" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-weakmap": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.2.tgz", - "integrity": "sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w==", + "node_modules/is-core-module": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.9.0.tgz", + "integrity": "sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A==", + "dev": true, "license": "MIT", - "engines": { - "node": ">= 0.4" + "dependencies": { + "has": "^1.0.3" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-weakref": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.1.1.tgz", - "integrity": "sha512-6i9mGWSlqzNMEqpCp93KwRS1uUOodk2OJ6b+sq7ZPDSy2WuI5NFIxp/254TytR8ftefexkWn5xNiHUNpPOfSew==", + "node_modules/is-data-view": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.2.tgz", + "integrity": "sha512-RKtWF8pGmS87i2D6gqQu/l7EYRlVdfzemCJN/P3UOs//x1QE7mfhvzHIApBTRf7axvT6DMGwSwBXYCT0nfB9xw==", "license": "MIT", "dependencies": { - "call-bound": "^1.0.3" + "call-bound": "^1.0.2", + "get-intrinsic": "^1.2.6", + "is-typed-array": "^1.1.13" }, "engines": { "node": ">= 0.4" @@ -6705,14 +5529,14 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-weakset": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.4.tgz", - "integrity": "sha512-mfcwb6IzQyOKTs84CQMrOwW4gQcaTOAWJ0zzJCl2WSPDrWk/OzDaImWFH3djXhb24g4eudZfLRozAvPGw4d9hQ==", + "node_modules/is-date-object": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.1.0.tgz", + "integrity": "sha512-PwwhEakHVKTdRNVOw+/Gyh0+MzlCl4R6qKvkhuvLtPMggI1WAHt9sOwZxQLSGpUaDnrdyDsomoRgNnCfKNSXXg==", "license": "MIT", "dependencies": { - "call-bound": "^1.0.3", - "get-intrinsic": "^1.2.6" + "call-bound": "^1.0.2", + "has-tostringtag": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -6721,699 +5545,391 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true, - "license": "ISC" - }, - "node_modules/issue-parser": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/issue-parser/-/issue-parser-7.0.2.tgz", - "integrity": "sha512-7atWPjhGEIX3JEtMrOYd8TKzboYlq+5sNbdl9POiLYOI14G5HZiQbZP0Xj5EZdrufQVXfJlpTV0hys0CuxwxZw==", - "dev": true, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", "license": "MIT", - "dependencies": { - "lodash.capitalize": "^4.2.1", - "lodash.escaperegexp": "^4.1.2", - "lodash.isplainobject": "^4.0.6", - "lodash.isstring": "^4.0.1", - "lodash.uniqby": "^4.7.0" - }, - "engines": { - "node": "^18.17 || >=20.6.1" - } - }, - "node_modules/istanbul-lib-coverage": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz", - "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==", - "dev": true, - "license": "BSD-3-Clause", - "engines": { - "node": ">=8" - } - }, - "node_modules/istanbul-lib-instrument": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.3.tgz", - "integrity": "sha512-Vtgk7L/R2JHyyGW07spoFlB8/lpjiOLTjMdms6AFMraYt3BaJauod/NGrfnVG/y4Ix1JEuMRPDPEj2ua+zz1/Q==", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "@babel/core": "^7.23.9", - "@babel/parser": "^7.23.9", - "@istanbuljs/schema": "^0.1.3", - "istanbul-lib-coverage": "^3.2.0", - "semver": "^7.5.4" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/istanbul-lib-report": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", - "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "istanbul-lib-coverage": "^3.0.0", - "make-dir": "^4.0.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/istanbul-lib-source-maps": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz", - "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "debug": "^4.1.1", - "istanbul-lib-coverage": "^3.0.0", - "source-map": "^0.6.1" - }, "engines": { - "node": ">=10" + "node": ">=0.10.0" } }, - "node_modules/istanbul-reports": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.2.0.tgz", - "integrity": "sha512-HGYWWS/ehqTV3xN10i23tkPkpH46MLCIMFNCaaKNavAXTF1RkqxawEPtnjnGZ6XKSInBKkiOA5BKS+aZiY3AvA==", - "dev": true, - "license": "BSD-3-Clause", + "node_modules/is-finalizationregistry": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-finalizationregistry/-/is-finalizationregistry-1.1.1.tgz", + "integrity": "sha512-1pC6N8qWJbWoPtEjgcL2xyhQOP491EQjeUo3qTKcmV8YSDDJrOepfG8pcC7h/QgnQHYSv0mJ3Z/ZWxmatVrysg==", + "license": "MIT", "dependencies": { - "html-escaper": "^2.0.0", - "istanbul-lib-report": "^3.0.0" + "call-bound": "^1.0.3" }, "engines": { - "node": ">=8" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/java-properties": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/java-properties/-/java-properties-1.0.2.tgz", - "integrity": "sha512-qjdpeo2yKlYTH7nFdK0vbZWuTCesk4o63v5iVOlhMQPfuIZQfW/HI35SjfhA+4qpg36rnFSvUK5b1m+ckIblQQ==", - "dev": true, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "license": "MIT", "engines": { - "node": ">= 0.6.0" + "node": ">=8" } }, - "node_modules/jest": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest/-/jest-29.7.0.tgz", - "integrity": "sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==", - "dev": true, + "node_modules/is-generator-function": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.1.2.tgz", + "integrity": "sha512-upqt1SkGkODW9tsGNG5mtXTXtECizwtS2kA161M+gJPc1xdb/Ax629af6YrTwcOeQHbewrPNlE5Dx7kzvXTizA==", "license": "MIT", "dependencies": { - "@jest/core": "^29.7.0", - "@jest/types": "^29.6.3", - "import-local": "^3.0.2", - "jest-cli": "^29.7.0" - }, - "bin": { - "jest": "bin/jest.js" + "call-bound": "^1.0.4", + "generator-function": "^2.0.0", + "get-proto": "^1.0.1", + "has-tostringtag": "^1.0.2", + "safe-regex-test": "^1.1.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - }, - "peerDependencies": { - "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + "node": ">= 0.4" }, - "peerDependenciesMeta": { - "node-notifier": { - "optional": true - } + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/jest-changed-files": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-29.7.0.tgz", - "integrity": "sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w==", - "dev": true, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "license": "MIT", "dependencies": { - "execa": "^5.0.0", - "jest-util": "^29.7.0", - "p-limit": "^3.1.0" + "is-extglob": "^2.1.1" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">=0.10.0" } }, - "node_modules/jest-circus": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-29.7.0.tgz", - "integrity": "sha512-3E1nCMgipcTkCocFwM90XXQab9bS+GMsjdpmPrlelaxwD93Ad8iVEjX/vvHPdLPnFf+L40u+5+iutRdA1N9myw==", - "dev": true, + "node_modules/is-map": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.3.tgz", + "integrity": "sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw==", "license": "MIT", - "dependencies": { - "@jest/environment": "^29.7.0", - "@jest/expect": "^29.7.0", - "@jest/test-result": "^29.7.0", - "@jest/types": "^29.6.3", - "@types/node": "*", - "chalk": "^4.0.0", - "co": "^4.6.0", - "dedent": "^1.0.0", - "is-generator-fn": "^2.0.0", - "jest-each": "^29.7.0", - "jest-matcher-utils": "^29.7.0", - "jest-message-util": "^29.7.0", - "jest-runtime": "^29.7.0", - "jest-snapshot": "^29.7.0", - "jest-util": "^29.7.0", - "p-limit": "^3.1.0", - "pretty-format": "^29.7.0", - "pure-rand": "^6.0.0", - "slash": "^3.0.0", - "stack-utils": "^2.0.3" - }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/jest-cli": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-29.7.0.tgz", - "integrity": "sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg==", - "dev": true, + "node_modules/is-negative-zero": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz", + "integrity": "sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==", "license": "MIT", - "dependencies": { - "@jest/core": "^29.7.0", - "@jest/test-result": "^29.7.0", - "@jest/types": "^29.6.3", - "chalk": "^4.0.0", - "create-jest": "^29.7.0", - "exit": "^0.1.2", - "import-local": "^3.0.2", - "jest-config": "^29.7.0", - "jest-util": "^29.7.0", - "jest-validate": "^29.7.0", - "yargs": "^17.3.1" - }, - "bin": { - "jest": "bin/jest.js" - }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - }, - "peerDependencies": { - "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + "node": ">= 0.4" }, - "peerDependenciesMeta": { - "node-notifier": { - "optional": true - } + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/jest-config": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-29.7.0.tgz", - "integrity": "sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ==", - "dev": true, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-number-object": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.1.1.tgz", + "integrity": "sha512-lZhclumE1G6VYD8VHe35wFaIif+CTy5SJIi5+3y4psDgWu4wPDoBhF8NxUOinEc7pHgiTsT6MaBb92rKhhD+Xw==", "license": "MIT", "dependencies": { - "@babel/core": "^7.11.6", - "@jest/test-sequencer": "^29.7.0", - "@jest/types": "^29.6.3", - "babel-jest": "^29.7.0", - "chalk": "^4.0.0", - "ci-info": "^3.2.0", - "deepmerge": "^4.2.2", - "glob": "^7.1.3", - "graceful-fs": "^4.2.9", - "jest-circus": "^29.7.0", - "jest-environment-node": "^29.7.0", - "jest-get-type": "^29.6.3", - "jest-regex-util": "^29.6.3", - "jest-resolve": "^29.7.0", - "jest-runner": "^29.7.0", - "jest-util": "^29.7.0", - "jest-validate": "^29.7.0", - "micromatch": "^4.0.4", - "parse-json": "^5.2.0", - "pretty-format": "^29.7.0", - "slash": "^3.0.0", - "strip-json-comments": "^3.1.1" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "call-bound": "^1.0.3", + "has-tostringtag": "^1.0.2" }, - "peerDependencies": { - "@types/node": "*", - "ts-node": ">=9.0.0" + "engines": { + "node": ">= 0.4" }, - "peerDependenciesMeta": { - "@types/node": { - "optional": true - }, - "ts-node": { - "optional": true - } + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/jest-diff": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.7.0.tgz", - "integrity": "sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==", + "node_modules/is-obj": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", + "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==", "dev": true, "license": "MIT", - "dependencies": { - "chalk": "^4.0.0", - "diff-sequences": "^29.6.3", - "jest-get-type": "^29.6.3", - "pretty-format": "^29.7.0" - }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">=8" } }, - "node_modules/jest-docblock": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-29.7.0.tgz", - "integrity": "sha512-q617Auw3A612guyaFgsbFeYpNP5t2aoUNLwBUbc/0kD1R4t9ixDbyFTHd1nok4epoVFpr7PmeWHrhvuV3XaJ4g==", + "node_modules/is-plain-obj": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.1.0.tgz", + "integrity": "sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==", "dev": true, "license": "MIT", - "dependencies": { - "detect-newline": "^3.0.0" - }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/jest-each": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-29.7.0.tgz", - "integrity": "sha512-gns+Er14+ZrEoC5fhOfYCY1LOHHr0TI+rQUHZS8Ttw2l7gl+80eHc/gFf2Ktkw0+SIACDTeWvpFcv3B04VembQ==", - "dev": true, + "node_modules/is-reference": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.2.1.tgz", + "integrity": "sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==", "license": "MIT", "dependencies": { - "@jest/types": "^29.6.3", - "chalk": "^4.0.0", - "jest-get-type": "^29.6.3", - "jest-util": "^29.7.0", - "pretty-format": "^29.7.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "@types/estree": "*" } }, - "node_modules/jest-environment-node": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.7.0.tgz", - "integrity": "sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw==", - "dev": true, + "node_modules/is-regex": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.2.1.tgz", + "integrity": "sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g==", "license": "MIT", "dependencies": { - "@jest/environment": "^29.7.0", - "@jest/fake-timers": "^29.7.0", - "@jest/types": "^29.6.3", - "@types/node": "*", - "jest-mock": "^29.7.0", - "jest-util": "^29.7.0" + "call-bound": "^1.0.2", + "gopd": "^1.2.0", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/jest-get-type": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.6.3.tgz", - "integrity": "sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==", - "dev": true, + "node_modules/is-set": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.3.tgz", + "integrity": "sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg==", "license": "MIT", "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/jest-haste-map": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.7.0.tgz", - "integrity": "sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==", - "dev": true, + "node_modules/is-shared-array-buffer": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.4.tgz", + "integrity": "sha512-ISWac8drv4ZGfwKl5slpHG9OwPNty4jOWPRIhBpxOoD+hqITiwuipOQ2bNthAzwA3B4fIjO4Nln74N0S9byq8A==", "license": "MIT", "dependencies": { - "@jest/types": "^29.6.3", - "@types/graceful-fs": "^4.1.3", - "@types/node": "*", - "anymatch": "^3.0.3", - "fb-watchman": "^2.0.0", - "graceful-fs": "^4.2.9", - "jest-regex-util": "^29.6.3", - "jest-util": "^29.7.0", - "jest-worker": "^29.7.0", - "micromatch": "^4.0.4", - "walker": "^1.0.8" + "call-bound": "^1.0.3" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">= 0.4" }, - "optionalDependencies": { - "fsevents": "^2.3.2" + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/jest-leak-detector": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.7.0.tgz", - "integrity": "sha512-kYA8IJcSYtST2BY9I+SMC32nDpBT3J2NvWJx8+JCuCdl/CR1I4EKUJROiP8XtCcxqgTTBGJNdbB1A8XRKbTetw==", + "node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", "dev": true, "license": "MIT", - "dependencies": { - "jest-get-type": "^29.6.3", - "pretty-format": "^29.7.0" - }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/jest-matcher-utils": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.7.0.tgz", - "integrity": "sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g==", - "dev": true, + "node_modules/is-string": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.1.1.tgz", + "integrity": "sha512-BtEeSsoaQjlSPBemMQIrY1MY0uM6vnS1g5fmufYOtnxLGUZM2178PKbhsk7Ffv58IX+ZtcvoGwccYsh0PglkAA==", "license": "MIT", "dependencies": { - "chalk": "^4.0.0", - "jest-diff": "^29.7.0", - "jest-get-type": "^29.6.3", - "pretty-format": "^29.7.0" + "call-bound": "^1.0.3", + "has-tostringtag": "^1.0.2" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/jest-message-util": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.7.0.tgz", - "integrity": "sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w==", - "dev": true, + "node_modules/is-symbol": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.1.1.tgz", + "integrity": "sha512-9gGx6GTtCQM73BgmHQXfDmLtfjjTUDSyoxTCbp5WtoixAhfgsDirWIcVQ/IHpvI5Vgd5i/J5F7B9cN/WlVbC/w==", "license": "MIT", "dependencies": { - "@babel/code-frame": "^7.12.13", - "@jest/types": "^29.6.3", - "@types/stack-utils": "^2.0.0", - "chalk": "^4.0.0", - "graceful-fs": "^4.2.9", - "micromatch": "^4.0.4", - "pretty-format": "^29.7.0", - "slash": "^3.0.0", - "stack-utils": "^2.0.3" + "call-bound": "^1.0.2", + "has-symbols": "^1.1.0", + "safe-regex-test": "^1.1.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/jest-mock": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-29.7.0.tgz", - "integrity": "sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw==", - "dev": true, + "node_modules/is-typed-array": { + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.15.tgz", + "integrity": "sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ==", "license": "MIT", "dependencies": { - "@jest/types": "^29.6.3", - "@types/node": "*", - "jest-util": "^29.7.0" + "which-typed-array": "^1.1.16" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-pnp-resolver": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz", - "integrity": "sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - }, - "peerDependencies": { - "jest-resolve": "*" + "node": ">= 0.4" }, - "peerDependenciesMeta": { - "jest-resolve": { - "optional": true - } + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/jest-regex-util": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.6.3.tgz", - "integrity": "sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==", + "node_modules/is-unicode-supported": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-2.1.0.tgz", + "integrity": "sha512-mE00Gnza5EEB3Ds0HfMyllZzbBrmLOX3vfWoj9A9PEnTfratQ/BcaJOuMhnkhjXvb2+FkY3VuHqtAGpTPmglFQ==", "dev": true, "license": "MIT", "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-resolve": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.7.0.tgz", - "integrity": "sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA==", - "dev": true, - "license": "MIT", - "dependencies": { - "chalk": "^4.0.0", - "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.7.0", - "jest-pnp-resolver": "^1.2.2", - "jest-util": "^29.7.0", - "jest-validate": "^29.7.0", - "resolve": "^1.20.0", - "resolve.exports": "^2.0.0", - "slash": "^3.0.0" + "node": ">=18" }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/jest-resolve-dependencies": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-29.7.0.tgz", - "integrity": "sha512-un0zD/6qxJ+S0et7WxeI3H5XSe9lTBBR7bOHCHXkKR6luG5mwDDlIzVQ0V5cZCuoTgEdcdwzTghYkTWfubi+nA==", - "dev": true, + "node_modules/is-weakmap": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.2.tgz", + "integrity": "sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w==", "license": "MIT", - "dependencies": { - "jest-regex-util": "^29.6.3", - "jest-snapshot": "^29.7.0" - }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/jest-runner": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-29.7.0.tgz", - "integrity": "sha512-fsc4N6cPCAahybGBfTRcq5wFR6fpLznMg47sY5aDpsoejOcVYFb07AHuSnR0liMcPTgBsA3ZJL6kFOjPdoNipQ==", - "dev": true, + "node_modules/is-weakref": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.1.1.tgz", + "integrity": "sha512-6i9mGWSlqzNMEqpCp93KwRS1uUOodk2OJ6b+sq7ZPDSy2WuI5NFIxp/254TytR8ftefexkWn5xNiHUNpPOfSew==", "license": "MIT", "dependencies": { - "@jest/console": "^29.7.0", - "@jest/environment": "^29.7.0", - "@jest/test-result": "^29.7.0", - "@jest/transform": "^29.7.0", - "@jest/types": "^29.6.3", - "@types/node": "*", - "chalk": "^4.0.0", - "emittery": "^0.13.1", - "graceful-fs": "^4.2.9", - "jest-docblock": "^29.7.0", - "jest-environment-node": "^29.7.0", - "jest-haste-map": "^29.7.0", - "jest-leak-detector": "^29.7.0", - "jest-message-util": "^29.7.0", - "jest-resolve": "^29.7.0", - "jest-runtime": "^29.7.0", - "jest-util": "^29.7.0", - "jest-watcher": "^29.7.0", - "jest-worker": "^29.7.0", - "p-limit": "^3.1.0", - "source-map-support": "0.5.13" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-runtime": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.7.0.tgz", - "integrity": "sha512-gUnLjgwdGqW7B4LvOIkbKs9WGbn+QLqRQQ9juC6HndeDiezIwhDP+mhMwHWCEcfQ5RUXa6OPnFF8BJh5xegwwQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/environment": "^29.7.0", - "@jest/fake-timers": "^29.7.0", - "@jest/globals": "^29.7.0", - "@jest/source-map": "^29.6.3", - "@jest/test-result": "^29.7.0", - "@jest/transform": "^29.7.0", - "@jest/types": "^29.6.3", - "@types/node": "*", - "chalk": "^4.0.0", - "cjs-module-lexer": "^1.0.0", - "collect-v8-coverage": "^1.0.0", - "glob": "^7.1.3", - "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.7.0", - "jest-message-util": "^29.7.0", - "jest-mock": "^29.7.0", - "jest-regex-util": "^29.6.3", - "jest-resolve": "^29.7.0", - "jest-snapshot": "^29.7.0", - "jest-util": "^29.7.0", - "slash": "^3.0.0", - "strip-bom": "^4.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-snapshot": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.7.0.tgz", - "integrity": "sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/core": "^7.11.6", - "@babel/generator": "^7.7.2", - "@babel/plugin-syntax-jsx": "^7.7.2", - "@babel/plugin-syntax-typescript": "^7.7.2", - "@babel/types": "^7.3.3", - "@jest/expect-utils": "^29.7.0", - "@jest/transform": "^29.7.0", - "@jest/types": "^29.6.3", - "babel-preset-current-node-syntax": "^1.0.0", - "chalk": "^4.0.0", - "expect": "^29.7.0", - "graceful-fs": "^4.2.9", - "jest-diff": "^29.7.0", - "jest-get-type": "^29.6.3", - "jest-matcher-utils": "^29.7.0", - "jest-message-util": "^29.7.0", - "jest-util": "^29.7.0", - "natural-compare": "^1.4.0", - "pretty-format": "^29.7.0", - "semver": "^7.5.3" + "call-bound": "^1.0.3" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/jest-util": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.7.0.tgz", - "integrity": "sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==", - "dev": true, + "node_modules/is-weakset": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.4.tgz", + "integrity": "sha512-mfcwb6IzQyOKTs84CQMrOwW4gQcaTOAWJ0zzJCl2WSPDrWk/OzDaImWFH3djXhb24g4eudZfLRozAvPGw4d9hQ==", "license": "MIT", "dependencies": { - "@jest/types": "^29.6.3", - "@types/node": "*", - "chalk": "^4.0.0", - "ci-info": "^3.2.0", - "graceful-fs": "^4.2.9", - "picomatch": "^2.2.3" + "call-bound": "^1.0.3", + "get-intrinsic": "^1.2.6" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/jest-validate": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-29.7.0.tgz", - "integrity": "sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw==", + "node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true, + "license": "ISC" + }, + "node_modules/issue-parser": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/issue-parser/-/issue-parser-7.0.2.tgz", + "integrity": "sha512-7atWPjhGEIX3JEtMrOYd8TKzboYlq+5sNbdl9POiLYOI14G5HZiQbZP0Xj5EZdrufQVXfJlpTV0hys0CuxwxZw==", "dev": true, "license": "MIT", "dependencies": { - "@jest/types": "^29.6.3", - "camelcase": "^6.2.0", - "chalk": "^4.0.0", - "jest-get-type": "^29.6.3", - "leven": "^3.1.0", - "pretty-format": "^29.7.0" + "lodash.capitalize": "^4.2.1", + "lodash.escaperegexp": "^4.1.2", + "lodash.isplainobject": "^4.0.6", + "lodash.isstring": "^4.0.1", + "lodash.uniqby": "^4.7.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.17 || >=20.6.1" } }, - "node_modules/jest-validate/node_modules/camelcase": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", - "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "node_modules/istanbul-lib-coverage": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz", + "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==", "dev": true, - "license": "MIT", + "license": "BSD-3-Clause", "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=8" } }, - "node_modules/jest-watcher": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-29.7.0.tgz", - "integrity": "sha512-49Fg7WXkU3Vl2h6LbLtMQ/HyB6rXSIX7SqvBLQmssRBGN9I0PNvPmAmCWSOY6SOvrjhI/F7/bGAv9RtnsPA03g==", + "node_modules/istanbul-lib-report": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", + "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", "dev": true, - "license": "MIT", + "license": "BSD-3-Clause", "dependencies": { - "@jest/test-result": "^29.7.0", - "@jest/types": "^29.6.3", - "@types/node": "*", - "ansi-escapes": "^4.2.1", - "chalk": "^4.0.0", - "emittery": "^0.13.1", - "jest-util": "^29.7.0", - "string-length": "^4.0.1" + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^4.0.0", + "supports-color": "^7.1.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">=10" } }, - "node_modules/jest-worker": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz", - "integrity": "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==", + "node_modules/istanbul-reports": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.2.0.tgz", + "integrity": "sha512-HGYWWS/ehqTV3xN10i23tkPkpH46MLCIMFNCaaKNavAXTF1RkqxawEPtnjnGZ6XKSInBKkiOA5BKS+aZiY3AvA==", "dev": true, - "license": "MIT", + "license": "BSD-3-Clause", "dependencies": { - "@types/node": "*", - "jest-util": "^29.7.0", - "merge-stream": "^2.0.0", - "supports-color": "^8.0.0" + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">=8" } }, - "node_modules/jest-worker/node_modules/supports-color": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", - "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "node_modules/java-properties": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/java-properties/-/java-properties-1.0.2.tgz", + "integrity": "sha512-qjdpeo2yKlYTH7nFdK0vbZWuTCesk4o63v5iVOlhMQPfuIZQfW/HI35SjfhA+4qpg36rnFSvUK5b1m+ckIblQQ==", "dev": true, "license": "MIT", - "dependencies": { - "has-flag": "^4.0.0" - }, "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/supports-color?sponsor=1" + "node": ">= 0.6.0" } }, "node_modules/js-tokens": { @@ -7494,19 +6010,6 @@ "node": ">= 10.16.0" } }, - "node_modules/jsesc": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", - "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", - "dev": true, - "license": "MIT", - "bin": { - "jsesc": "bin/jsesc" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/json-buffer": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", @@ -7557,19 +6060,6 @@ "dev": true, "license": "MIT" }, - "node_modules/json5": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", - "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", - "dev": true, - "license": "MIT", - "bin": { - "json5": "lib/cli.js" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/jsonc-parser": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-2.2.1.tgz", @@ -7644,16 +6134,6 @@ "graceful-fs": "^4.1.9" } }, - "node_modules/kleur": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", - "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, "node_modules/leven": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", @@ -7674,7 +6154,268 @@ "type-check": "~0.4.0" }, "engines": { - "node": ">= 0.8.0" + "node": ">= 0.8.0" + } + }, + "node_modules/lightningcss": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.32.0.tgz", + "integrity": "sha512-NXYBzinNrblfraPGyrbPoD19C1h9lfI/1mzgWYvXUTe414Gz/X1FD2XBZSZM7rRTrMA8JL3OtAaGifrIKhQ5yQ==", + "dev": true, + "license": "MPL-2.0", + "dependencies": { + "detect-libc": "^2.0.3" + }, + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + }, + "optionalDependencies": { + "lightningcss-android-arm64": "1.32.0", + "lightningcss-darwin-arm64": "1.32.0", + "lightningcss-darwin-x64": "1.32.0", + "lightningcss-freebsd-x64": "1.32.0", + "lightningcss-linux-arm-gnueabihf": "1.32.0", + "lightningcss-linux-arm64-gnu": "1.32.0", + "lightningcss-linux-arm64-musl": "1.32.0", + "lightningcss-linux-x64-gnu": "1.32.0", + "lightningcss-linux-x64-musl": "1.32.0", + "lightningcss-win32-arm64-msvc": "1.32.0", + "lightningcss-win32-x64-msvc": "1.32.0" + } + }, + "node_modules/lightningcss-android-arm64": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-android-arm64/-/lightningcss-android-arm64-1.32.0.tgz", + "integrity": "sha512-YK7/ClTt4kAK0vo6w3X+Pnm0D2cf2vPHbhOXdoNti1Ga0al1P4TBZhwjATvjNwLEBCnKvjJc2jQgHXH0NEwlAg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-darwin-arm64": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.32.0.tgz", + "integrity": "sha512-RzeG9Ju5bag2Bv1/lwlVJvBE3q6TtXskdZLLCyfg5pt+HLz9BqlICO7LZM7VHNTTn/5PRhHFBSjk5lc4cmscPQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-darwin-x64": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.32.0.tgz", + "integrity": "sha512-U+QsBp2m/s2wqpUYT/6wnlagdZbtZdndSmut/NJqlCcMLTWp5muCrID+K5UJ6jqD2BFshejCYXniPDbNh73V8w==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-freebsd-x64": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.32.0.tgz", + "integrity": "sha512-JCTigedEksZk3tHTTthnMdVfGf61Fky8Ji2E4YjUTEQX14xiy/lTzXnu1vwiZe3bYe0q+SpsSH/CTeDXK6WHig==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm-gnueabihf": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.32.0.tgz", + "integrity": "sha512-x6rnnpRa2GL0zQOkt6rts3YDPzduLpWvwAF6EMhXFVZXD4tPrBkEFqzGowzCsIWsPjqSK+tyNEODUBXeeVHSkw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm64-gnu": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.32.0.tgz", + "integrity": "sha512-0nnMyoyOLRJXfbMOilaSRcLH3Jw5z9HDNGfT/gwCPgaDjnx0i8w7vBzFLFR1f6CMLKF8gVbebmkUN3fa/kQJpQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm64-musl": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.32.0.tgz", + "integrity": "sha512-UpQkoenr4UJEzgVIYpI80lDFvRmPVg6oqboNHfoH4CQIfNA+HOrZ7Mo7KZP02dC6LjghPQJeBsvXhJod/wnIBg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-x64-gnu": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.32.0.tgz", + "integrity": "sha512-V7Qr52IhZmdKPVr+Vtw8o+WLsQJYCTd8loIfpDaMRWGUZfBOYEJeyJIkqGIDMZPwPx24pUMfwSxxI8phr/MbOA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-x64-musl": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.32.0.tgz", + "integrity": "sha512-bYcLp+Vb0awsiXg/80uCRezCYHNg1/l3mt0gzHnWV9XP1W5sKa5/TCdGWaR/zBM2PeF/HbsQv/j2URNOiVuxWg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-win32-arm64-msvc": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.32.0.tgz", + "integrity": "sha512-8SbC8BR40pS6baCM8sbtYDSwEVQd4JlFTOlaD3gWGHfThTcABnNDBda6eTZeqbofalIJhFx0qKzgHJmcPTnGdw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-win32-x64-msvc": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.32.0.tgz", + "integrity": "sha512-Amq9B/SoZYdDi1kFrojnoqPLxYhQ4Wo5XiL8EVJrVsB8ARoC1PWW6VGtT0WKCemjy8aC+louJnjS7U18x3b06Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" } }, "node_modules/lines-and-columns": { @@ -7822,16 +6563,6 @@ "integrity": "sha512-WpG9CcFAOjz/FtNht+QJeGpvVl/cdR6P0z6OcXSkr8wFJOsV2GRj2j10JLfjuA4aYkcKCNIEqRGCyTife9R8/g==", "license": "MIT" }, - "node_modules/lru-cache": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", - "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", - "dev": true, - "license": "ISC", - "dependencies": { - "yallist": "^3.0.2" - } - }, "node_modules/magic-string": { "version": "0.25.9", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.9.tgz", @@ -7841,6 +6572,18 @@ "sourcemap-codec": "^1.4.8" } }, + "node_modules/magicast": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/magicast/-/magicast-0.5.3.tgz", + "integrity": "sha512-pVKE4UdSQ7DvHzivsCIFx2BJn1mHG6KsyrFcaxFx6tONdneEuThrDx0Cj3AMg58KyN4pzYT+LHOotxDQDjNvkw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.29.3", + "@babel/types": "^7.29.0", + "source-map-js": "^1.2.1" + } + }, "node_modules/make-asynchronous": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/make-asynchronous/-/make-asynchronous-1.1.0.tgz", @@ -7888,16 +6631,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/makeerror": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz", - "integrity": "sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "tmpl": "1.0.5" - } - }, "node_modules/markdown-escape": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/markdown-escape/-/markdown-escape-2.0.0.tgz", @@ -8221,6 +6954,25 @@ "thenify-all": "^1.0.0" } }, + "node_modules/nanoid": { + "version": "3.3.12", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.12.tgz", + "integrity": "sha512-ZB9RH/39qpq5Vu6Y+NmUaFhQR6pp+M2Xt76XBnEwDaGcVAqhlvxrl3B2bKS5D3NH3QR76v3aSrKaF/Kiy7lEtQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, "node_modules/napi-build-utils": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz", @@ -8310,20 +7062,6 @@ } } }, - "node_modules/node-int64": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", - "integrity": "sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==", - "dev": true, - "license": "MIT" - }, - "node_modules/node-releases": { - "version": "2.0.38", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.38.tgz", - "integrity": "sha512-3qT/88Y3FbH/Kx4szpQQ4HzUbVrHPKTLVpVocKiLfoYvw9XSGOX2FmD2d6DrXbVYyAQTF2HeF6My8jmzx7/CRw==", - "dev": true, - "license": "MIT" - }, "node_modules/node-sarif-builder": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/node-sarif-builder/-/node-sarif-builder-2.0.3.tgz", @@ -8366,16 +7104,6 @@ "node": "^20.17.0 || >=22.9.0" } }, - "node_modules/normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/normalize-url": { "version": "9.0.0", "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-9.0.0.tgz", @@ -10360,6 +9088,20 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/obug": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/obug/-/obug-2.1.2.tgz", + "integrity": "sha512-AWGB9WFcRXOQs48Z/udjI5ZcZMHXwX8XPByNpOydgcGsDLIzjGizhoMWJyKAWze7AVW/2W1i+/gPX4YtKe5cyg==", + "dev": true, + "funding": [ + "https://github.com/sponsors/sxzz", + "https://opencollective.com/debug" + ], + "license": "MIT", + "engines": { + "node": ">=12.20.0" + } + }, "node_modules/once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -10541,16 +9283,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, "node_modules/pad": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/pad/-/pad-2.3.0.tgz", @@ -10675,6 +9407,13 @@ "node": ">=8" } }, + "node_modules/pathe": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", + "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==", + "dev": true, + "license": "MIT" + }, "node_modules/picocolors": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", @@ -10704,16 +9443,6 @@ "node": ">=4" } }, - "node_modules/pirates": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.7.tgz", - "integrity": "sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 6" - } - }, "node_modules/pkg": { "version": "5.8.1", "resolved": "https://registry.npmjs.org/pkg/-/pkg-5.8.1.tgz", @@ -10835,75 +9564,6 @@ "node": ">=4" } }, - "node_modules/pkg-dir": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", - "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "find-up": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/pkg-dir/node_modules/find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, - "license": "MIT", - "dependencies": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/pkg-dir/node_modules/locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, - "license": "MIT", - "dependencies": { - "p-locate": "^4.1.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/pkg-dir/node_modules/p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dev": true, - "license": "MIT", - "dependencies": { - "p-try": "^2.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/pkg-dir/node_modules/p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, - "license": "MIT", - "dependencies": { - "p-limit": "^2.2.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/pkg-fetch": { "version": "3.4.2", "resolved": "https://registry.npmjs.org/pkg-fetch/-/pkg-fetch-3.4.2.tgz", @@ -11080,6 +9740,35 @@ "node": ">= 0.4" } }, + "node_modules/postcss": { + "version": "8.5.15", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.15.tgz", + "integrity": "sha512-FfR8sjd4em2T6fb3I2MwAJU7HWVMr9zba+enmQeeWFfCbm+UOC/0X4DS8XtpUTMwWMGbjKYP7xjfNekzyGmB3A==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.12", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, "node_modules/prebuild-install": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.1.tgz", @@ -11148,34 +9837,6 @@ "node": ">=6.0.0" } }, - "node_modules/pretty-format": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", - "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/schemas": "^29.6.3", - "ansi-styles": "^5.0.0", - "react-is": "^18.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/pretty-format/node_modules/ansi-styles": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", - "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, "node_modules/pretty-ms": { "version": "9.3.0", "resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-9.3.0.tgz", @@ -11215,20 +9876,6 @@ "node": ">=0.4.0" } }, - "node_modules/prompts": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", - "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "kleur": "^3.0.3", - "sisteransi": "^1.0.5" - }, - "engines": { - "node": ">= 6" - } - }, "node_modules/proto-list": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz", @@ -11267,23 +9914,6 @@ "node": ">=6" } }, - "node_modules/pure-rand": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.1.0.tgz", - "integrity": "sha512-bVWawvoZoBYpp6yIoQtQXHZjmz35RSVHnUOTefl8Vcjr8snTPY1wnpSPMWekcFwbxI6gtmT7rSYPFvz71ldiOA==", - "dev": true, - "funding": [ - { - "type": "individual", - "url": "https://github.com/sponsors/dubzzz" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/fast-check" - } - ], - "license": "MIT" - }, "node_modules/queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", @@ -11330,13 +9960,6 @@ "node": ">=0.10.0" } }, - "node_modules/react-is": { - "version": "18.3.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", - "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", - "dev": true, - "license": "MIT" - }, "node_modules/read-package-up": { "version": "12.0.0", "resolved": "https://registry.npmjs.org/read-package-up/-/read-package-up-12.0.0.tgz", @@ -11566,29 +10189,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/resolve-cwd": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", - "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", - "dev": true, - "license": "MIT", - "dependencies": { - "resolve-from": "^5.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/resolve-cwd/node_modules/resolve-from": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/resolve-from": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", @@ -11599,16 +10199,6 @@ "node": ">=4" } }, - "node_modules/resolve.exports": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.3.tgz", - "integrity": "sha512-OcXjMsGdhL4XnbShKpAcSqPMzQoYkYyhbEaeSko47MjRP9NfEQMhZkXL1DoFlt9LWQn4YttrdnV6X2OiyzBi+A==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - } - }, "node_modules/resolve/node_modules/is-core-module": { "version": "2.16.2", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.2.tgz", @@ -11634,6 +10224,40 @@ "node": ">=0.10.0" } }, + "node_modules/rolldown": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.0.3.tgz", + "integrity": "sha512-i00lAJ2ks1BYr7rjNjKC7BcqAS7nVfiT3QX1SI5aY+AFHblCmaUf9OE9dbdzDvW6dJxbi2ZCZiy9v3CcwOiX3g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@oxc-project/types": "=0.133.0", + "@rolldown/pluginutils": "^1.0.0" + }, + "bin": { + "rolldown": "bin/cli.mjs" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "optionalDependencies": { + "@rolldown/binding-android-arm64": "1.0.3", + "@rolldown/binding-darwin-arm64": "1.0.3", + "@rolldown/binding-darwin-x64": "1.0.3", + "@rolldown/binding-freebsd-x64": "1.0.3", + "@rolldown/binding-linux-arm-gnueabihf": "1.0.3", + "@rolldown/binding-linux-arm64-gnu": "1.0.3", + "@rolldown/binding-linux-arm64-musl": "1.0.3", + "@rolldown/binding-linux-ppc64-gnu": "1.0.3", + "@rolldown/binding-linux-s390x-gnu": "1.0.3", + "@rolldown/binding-linux-x64-gnu": "1.0.3", + "@rolldown/binding-linux-x64-musl": "1.0.3", + "@rolldown/binding-openharmony-arm64": "1.0.3", + "@rolldown/binding-wasm32-wasi": "1.0.3", + "@rolldown/binding-win32-arm64-msvc": "1.0.3", + "@rolldown/binding-win32-x64-msvc": "1.0.3" + } + }, "node_modules/rollup": { "version": "2.80.0", "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.80.0.tgz", @@ -12328,6 +10952,13 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/siginfo": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", + "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", + "dev": true, + "license": "ISC" + }, "node_modules/signal-exit": { "version": "3.0.7", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", @@ -12506,13 +11137,6 @@ "integrity": "sha512-j7piyCjAeTDSjzTSQ7DokZtMNwNlEAyxqSZeCS+CXH7fJ4jx3FuJ/mTW3mE+6JLs4VJBbcll0Kjn+KXI5t21Iw==", "license": "MIT" }, - "node_modules/sisteransi": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", - "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", - "dev": true, - "license": "MIT" - }, "node_modules/skin-tone": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/skin-tone/-/skin-tone-2.0.0.tgz", @@ -12544,15 +11168,14 @@ "node": ">=0.10.0" } }, - "node_modules/source-map-support": { - "version": "0.5.13", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz", - "integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==", + "node_modules/source-map-js": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", "dev": true, - "license": "MIT", - "dependencies": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" } }, "node_modules/sourcemap-codec": { @@ -12610,40 +11233,17 @@ "resolved": "https://registry.npmjs.org/split2/-/split2-1.0.0.tgz", "integrity": "sha512-NKywug4u4pX/AZBB1FCPzZ6/7O+Xhz1qMVbzTvvKvikjO99oPN87SkK08mEY9P63/5lWjK+wgOOgApnTg5r6qg==", "dev": true, - "license": "ISC", - "dependencies": { - "through2": "~2.0.0" - } - }, - "node_modules/sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", - "dev": true, - "license": "BSD-3-Clause" - }, - "node_modules/stack-utils": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.6.tgz", - "integrity": "sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "escape-string-regexp": "^2.0.0" - }, - "engines": { - "node": ">=10" + "license": "ISC", + "dependencies": { + "through2": "~2.0.0" } }, - "node_modules/stack-utils/node_modules/escape-string-regexp": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", - "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", + "node_modules/stackback": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", + "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } + "license": "MIT" }, "node_modules/stacktracey": { "version": "2.2.0", @@ -12655,6 +11255,13 @@ "get-source": "^2.0.12" } }, + "node_modules/std-env": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-4.1.0.tgz", + "integrity": "sha512-Rq7ybcX2RuC55r9oaPVEW7/xu3tj8u4GeBYHBWCychFtzMIr86A7e3PPEBPT37sHStKX3+TiX/Fr/ACmJLVlLQ==", + "dev": true, + "license": "MIT" + }, "node_modules/stop-iteration-iterator": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.1.0.tgz", @@ -12699,20 +11306,6 @@ "safe-buffer": "~5.1.0" } }, - "node_modules/string-length": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz", - "integrity": "sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "char-regex": "^1.0.2", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", @@ -12795,16 +11388,6 @@ "node": ">=8" } }, - "node_modules/strip-bom": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", - "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/strip-final-newline": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", @@ -13016,52 +11599,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/test-exclude": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", - "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", - "dev": true, - "license": "ISC", - "dependencies": { - "@istanbuljs/schema": "^0.1.2", - "glob": "^7.1.4", - "minimatch": "^3.0.4" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/test-exclude/node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true, - "license": "MIT" - }, - "node_modules/test-exclude/node_modules/brace-expansion": { - "version": "1.1.14", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.14.tgz", - "integrity": "sha512-MWPGfDxnyzKU7rNOW9SP/c50vi3xrmrua/+6hfPbCS2ABNWfx24vPidzvC7krjU/RTo235sV776ymlsMtGKj8g==", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/test-exclude/node_modules/minimatch": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", - "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", @@ -13118,10 +11655,27 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/tinybench": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.9.0.tgz", + "integrity": "sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==", + "dev": true, + "license": "MIT" + }, + "node_modules/tinyexec": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.2.4.tgz", + "integrity": "sha512-SHf/r48b7vOrjve9PxJo3MN5v5yuyjHvdUcrQffT3WXMUfnGmHDVbC4k3sHJaJTgZCwpUplIaAo5ANtMyp3YHg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, "node_modules/tinyglobby": { - "version": "0.2.16", - "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.16.tgz", - "integrity": "sha512-pn99VhoACYR8nFHhxqix+uvsbXineAasWm5ojXoN8xEwK5Kd3/TrhNn1wByuD52UxWRLy8pu+kRMniEi6Eq9Zg==", + "version": "0.2.17", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz", + "integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==", "dev": true, "license": "MIT", "dependencies": { @@ -13166,12 +11720,15 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, - "node_modules/tmpl": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", - "integrity": "sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==", + "node_modules/tinyrainbow": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-3.1.0.tgz", + "integrity": "sha512-Bf+ILmBgretUrdJxzXM0SgXLZ3XfiaUuOj/IKQHuTXip+05Xn+uyEYdVg0kYDipTBcLrCVyUzAPz7QmArb0mmw==", "dev": true, - "license": "BSD-3-Clause" + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } }, "node_modules/to-fast-properties": { "version": "2.0.0", @@ -13256,16 +11813,6 @@ "node": ">= 0.8.0" } }, - "node_modules/type-detect": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", - "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, "node_modules/typed-array-buffer": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.3.tgz", @@ -13471,37 +12018,6 @@ "node": ">= 10.0.0" } }, - "node_modules/update-browserslist-db": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.2.3.tgz", - "integrity": "sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/browserslist" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "dependencies": { - "escalade": "^3.2.0", - "picocolors": "^1.1.1" - }, - "bin": { - "update-browserslist-db": "cli.js" - }, - "peerDependencies": { - "browserslist": ">= 4.21.0" - } - }, "node_modules/uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", @@ -13544,21 +12060,6 @@ "node": ">= 4" } }, - "node_modules/v8-to-istanbul": { - "version": "9.3.0", - "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.3.0.tgz", - "integrity": "sha512-kiGUalWN+rgBJ/1OHZsBtU4rXZOfj/7rKQxULKlIzwzQSvMJUUNgPwJEEh7gU6xEVxC0ahoOBvN2YI8GH6FNgA==", - "dev": true, - "license": "ISC", - "dependencies": { - "@jridgewell/trace-mapping": "^0.3.12", - "@types/istanbul-lib-coverage": "^2.0.1", - "convert-source-map": "^2.0.0" - }, - "engines": { - "node": ">=10.12.0" - } - }, "node_modules/validate-npm-package-license": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", @@ -13588,14 +12089,208 @@ "node": ">= 0.10" } }, - "node_modules/walker": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz", - "integrity": "sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==", + "node_modules/vite": { + "version": "8.0.16", + "resolved": "https://registry.npmjs.org/vite/-/vite-8.0.16.tgz", + "integrity": "sha512-h9bXPmJichP5fLmVQo3PyaGSDE2n3aPuomeAlVRm0JLmt4rY6zmPKd59HYI4LNW8oTK7tlTsuC7l/m7awx9Jcw==", "dev": true, - "license": "Apache-2.0", + "license": "MIT", + "dependencies": { + "lightningcss": "^1.32.0", + "picomatch": "^4.0.4", + "postcss": "^8.5.15", + "rolldown": "1.0.3", + "tinyglobby": "^0.2.17" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^20.19.0 || >=22.12.0", + "@vitejs/devtools": "^0.1.18", + "esbuild": "^0.27.0 || ^0.28.0", + "jiti": ">=1.21.0", + "less": "^4.0.0", + "sass": "^1.70.0", + "sass-embedded": "^1.70.0", + "stylus": ">=0.54.8", + "sugarss": "^5.0.0", + "terser": "^5.16.0", + "tsx": "^4.8.1", + "yaml": "^2.4.2" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "@vitejs/devtools": { + "optional": true + }, + "esbuild": { + "optional": true + }, + "jiti": { + "optional": true + }, + "less": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true + } + } + }, + "node_modules/vite/node_modules/picomatch": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz", + "integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/vitest": { + "version": "4.1.8", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-4.1.8.tgz", + "integrity": "sha512-flY6ScbCIt9HThs+C5HS7jvGOB560DJtk/Z15IQROTA6zEy49Nh8T/dofWTQL+n3vswqn87sbJNiuqw1SDp5Ig==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/expect": "4.1.8", + "@vitest/mocker": "4.1.8", + "@vitest/pretty-format": "4.1.8", + "@vitest/runner": "4.1.8", + "@vitest/snapshot": "4.1.8", + "@vitest/spy": "4.1.8", + "@vitest/utils": "4.1.8", + "es-module-lexer": "^2.0.0", + "expect-type": "^1.3.0", + "magic-string": "^0.30.21", + "obug": "^2.1.1", + "pathe": "^2.0.3", + "picomatch": "^4.0.3", + "std-env": "^4.0.0-rc.1", + "tinybench": "^2.9.0", + "tinyexec": "^1.0.2", + "tinyglobby": "^0.2.15", + "tinyrainbow": "^3.1.0", + "vite": "^6.0.0 || ^7.0.0 || ^8.0.0", + "why-is-node-running": "^2.3.0" + }, + "bin": { + "vitest": "vitest.mjs" + }, + "engines": { + "node": "^20.0.0 || ^22.0.0 || >=24.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "@edge-runtime/vm": "*", + "@opentelemetry/api": "^1.9.0", + "@types/node": "^20.0.0 || ^22.0.0 || >=24.0.0", + "@vitest/browser-playwright": "4.1.8", + "@vitest/browser-preview": "4.1.8", + "@vitest/browser-webdriverio": "4.1.8", + "@vitest/coverage-istanbul": "4.1.8", + "@vitest/coverage-v8": "4.1.8", + "@vitest/ui": "4.1.8", + "happy-dom": "*", + "jsdom": "*", + "vite": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "@edge-runtime/vm": { + "optional": true + }, + "@opentelemetry/api": { + "optional": true + }, + "@types/node": { + "optional": true + }, + "@vitest/browser-playwright": { + "optional": true + }, + "@vitest/browser-preview": { + "optional": true + }, + "@vitest/browser-webdriverio": { + "optional": true + }, + "@vitest/coverage-istanbul": { + "optional": true + }, + "@vitest/coverage-v8": { + "optional": true + }, + "@vitest/ui": { + "optional": true + }, + "happy-dom": { + "optional": true + }, + "jsdom": { + "optional": true + }, + "vite": { + "optional": false + } + } + }, + "node_modules/vitest/node_modules/magic-string": { + "version": "0.30.21", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", + "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", + "dev": true, + "license": "MIT", "dependencies": { - "makeerror": "1.0.12" + "@jridgewell/sourcemap-codec": "^1.5.5" + } + }, + "node_modules/vitest/node_modules/picomatch": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz", + "integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" } }, "node_modules/wcwidth": { @@ -13737,6 +12432,23 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/why-is-node-running": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.3.0.tgz", + "integrity": "sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==", + "dev": true, + "license": "MIT", + "dependencies": { + "siginfo": "^2.0.0", + "stackback": "0.0.2" + }, + "bin": { + "why-is-node-running": "cli.js" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/word-wrap": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", @@ -13777,20 +12489,6 @@ "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", "license": "ISC" }, - "node_modules/write-file-atomic": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.2.tgz", - "integrity": "sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==", - "dev": true, - "license": "ISC", - "dependencies": { - "imurmurhash": "^0.1.4", - "signal-exit": "^3.0.7" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" - } - }, "node_modules/xmlcreate": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/xmlcreate/-/xmlcreate-2.0.4.tgz", @@ -13817,13 +12515,6 @@ "node": ">=10" } }, - "node_modules/yallist": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", - "dev": true, - "license": "ISC" - }, "node_modules/yargs": { "version": "17.7.2", "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", @@ -13910,7 +12601,7 @@ }, "devDependencies": { "@stoplight/spectral-core": "1.19.4", - "jest": "29.7.0" + "vitest": "4.1.8" }, "engines": { "node": ">=24.0.0" @@ -13954,8 +12645,9 @@ "license": "Apache-2.0", "devDependencies": { "@stoplight/spectral-core": "1.19.4", - "jest": "29.7.0", - "typescript": "5.8.3" + "@vitest/coverage-v8": "^4.1.8", + "typescript": "5.8.3", + "vitest": "4.1.8" }, "engines": { "node": ">=24.0.0" @@ -13990,8 +12682,8 @@ }, "devDependencies": { "ansi-regex": "5.0.1", - "jest": "29.7.0", - "pkg": "5.8.1" + "pkg": "5.8.1", + "vitest": "4.1.8" }, "engines": { "node": ">=24.0.0", diff --git a/package.json b/package.json index 16e2307d3..4e8b38d09 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,6 @@ "test-utilities": "npm run test --workspace packages/utilities", "test-validator": "npm run test --workspace packages/validator", "test-docker": "npm run build-docker && docker run --rm --volume \"$PWD\"/packages/validator/test/cli-validator/alternate-spectral-configs/extends-default.yaml:/data/ruleset.yaml --volume \"$PWD\"/packages/validator/test/cli-validator/mock-files/oas3/clean.yml:/data/openapi.yaml ibmdevxsdk/openapi-validator:latest --ruleset ruleset.yaml openapi.yaml", - "jest": "jest", "test-travis": "npm run test-travis --workspaces", "lint": "npm run lint --workspaces && eslint --cache --max-warnings 0 scripts eslint.config.mjs", "fix": "npm run fix --workspaces && eslint --fix scripts eslint.config.mjs", @@ -42,10 +41,10 @@ "eslint-config-prettier": "10.1.8", "eslint-plugin-prettier": "5.5.5", "globals": "17.6.0", - "jest": "29.7.0", "jsdoc": "4.0.4", "mustache": "4.2.0", - "semantic-release": "25.0.3" + "semantic-release": "25.0.3", + "vitest": "4.1.8" }, "overrides": { "proxy-agent": "6.3.0", diff --git a/packages/ruleset/package.json b/packages/ruleset/package.json index 1068cd896..103094cea 100644 --- a/packages/ruleset/package.json +++ b/packages/ruleset/package.json @@ -13,9 +13,8 @@ "scripts": { "clean": "rm -rf node_modules", "link": "npm install -g", - "jest": "jest", - "test": "jest test", - "test-travis": "jest --silent --runInBand --no-colors --testNamePattern='^((?!@skip-ci).)*$' test", + "test": "vitest run", + "test-travis": "vitest run --reporter=verbose --testNamePattern='^((?!@skip-ci).)*$'", "lint": "eslint --cache --quiet --ext '.js' src test", "fix": "eslint --fix --ext '.js' src test", "pkg": "echo no executables to build in this package" @@ -36,20 +35,11 @@ }, "devDependencies": { "@stoplight/spectral-core": "1.19.4", - "jest": "29.7.0" + "vitest": "4.1.8" }, "engines": { "node": ">=24.0.0" }, - "jest": { - "collectCoverage": true, - "coverageDirectory": "./coverage/", - "testEnvironment": "node", - "moduleNameMapper": { - "nimma/legacy": "/../../node_modules/@stoplight/spectral-core/node_modules/nimma/dist/legacy/cjs", - "nimma/fallbacks": "/../../node_modules/@stoplight/spectral-core/node_modules/nimma/dist/legacy/cjs/fallbacks/" - } - }, "prettier": { "quoteProps": "consistent", "overrides": [ diff --git a/packages/ruleset/test/rules/circular-refs.test.js b/packages/ruleset/test/rules/circular-refs.test.js index 1c595ce15..1060e53ed 100644 --- a/packages/ruleset/test/rules/circular-refs.test.js +++ b/packages/ruleset/test/rules/circular-refs.test.js @@ -3,6 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ +const { vi } = require('vitest'); const { makeCopy, rootDocument, @@ -21,7 +22,7 @@ describe(`Spectral rule: ${ruleId}`, () => { // Because the global variable's value is retained across testcases, we need to reset // everything before each testcase. beforeEach(() => { - jest.resetModules(); + vi.resetModules(); rule = require('../../src/rules').circularRefs; }); diff --git a/packages/ruleset/test/rules/collection-array-property.test.js b/packages/ruleset/test/rules/collection-array-property.test.js index aff906a6d..5ffa1b61a 100644 --- a/packages/ruleset/test/rules/collection-array-property.test.js +++ b/packages/ruleset/test/rules/collection-array-property.test.js @@ -37,7 +37,7 @@ describe(`Spectral rule: ${ruleId}`, () => { }; const logger = LoggerFactory.getInstance().getLogger(ruleId); - const debugSpy = jest.spyOn(logger, 'error').mockImplementation(() => {}); + const debugSpy = vi.spyOn(logger, 'error').mockImplementation(() => {}); const results = await testRule(ruleId, rule, testDocument); diff --git a/packages/ruleset/test/rules/no-operation-requestbody.test.js b/packages/ruleset/test/rules/no-operation-requestbody.test.js index bc8901cce..3694b22c8 100644 --- a/packages/ruleset/test/rules/no-operation-requestbody.test.js +++ b/packages/ruleset/test/rules/no-operation-requestbody.test.js @@ -3,6 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ +const { vi } = require('vitest'); const { makeCopy, rootDocument, @@ -18,7 +19,7 @@ const expectedMsg = 'operations should not define a requestBody'; describe(`Spectral rule: ${ruleId}`, () => { describe('Should not yield errors', () => { afterEach(() => { - jest.resetModules(); + vi.resetModules(); rule = require('../../src/rules').noOperationRequestBody; }); it('Clean spec', async () => { diff --git a/packages/ruleset/test/rules/property-consistent-name-and-type.test.js b/packages/ruleset/test/rules/property-consistent-name-and-type.test.js index 2db5047d7..65f9a7a0c 100644 --- a/packages/ruleset/test/rules/property-consistent-name-and-type.test.js +++ b/packages/ruleset/test/rules/property-consistent-name-and-type.test.js @@ -3,6 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ +const { vi } = require('vitest'); const { makeCopy, rootDocument, @@ -26,7 +27,7 @@ describe(`Spectral rule: ${ruleId}`, () => { // its list of "visited properties" between tests, which prevents proper // isolation between the tests. this will reset that variable after each test afterEach(() => { - jest.resetModules(); + vi.resetModules(); rule = require('../../src/rules').propertyConsistentNameAndType; rule.severity = 'warn'; }); diff --git a/packages/ruleset/test/utils/logger-factory.test.js b/packages/ruleset/test/utils/logger-factory.test.js index 97608da24..c4ddebde5 100644 --- a/packages/ruleset/test/utils/logger-factory.test.js +++ b/packages/ruleset/test/utils/logger-factory.test.js @@ -3,6 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ +const { vi } = require('vitest'); const { LoggerFactory } = require('../../src/utils'); describe('LoggerFactory tests', () => { @@ -14,7 +15,7 @@ describe('LoggerFactory tests', () => { const originalError = console.error; beforeEach(() => { - consoleSpy = jest.spyOn(console, 'log').mockImplementation(() => {}); + consoleSpy = vi.spyOn(console, 'log').mockImplementation(() => {}); console.debug = console.log; console.info = console.log; console.warn = console.log; diff --git a/packages/ruleset/test/utils/pagination-utils.test.js b/packages/ruleset/test/utils/pagination-utils.test.js index 2680e2688..594fa7a01 100644 --- a/packages/ruleset/test/utils/pagination-utils.test.js +++ b/packages/ruleset/test/utils/pagination-utils.test.js @@ -3,6 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ +const { vi } = require('vitest'); const { getOffsetParamIndex, getPageTokenParamIndex, @@ -164,7 +165,7 @@ describe('Pagination utility functions', () => { }); describe('getPaginatedOperationFromPath()', () => { - const mockLogger = jest.fn(); + const mockLogger = vi.fn(); const logInfo = { logger: { debug: mockLogger }, ruleId: 'test', diff --git a/packages/ruleset/test/utils/schema-finding-utils.test.js b/packages/ruleset/test/utils/schema-finding-utils.test.js index 3cfcecefa..33d3d7cc2 100644 --- a/packages/ruleset/test/utils/schema-finding-utils.test.js +++ b/packages/ruleset/test/utils/schema-finding-utils.test.js @@ -3,6 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ +const { vi } = require('vitest'); const { getSuccessResponseSchemaForOperation, getRequestBodySchemaForOperation, @@ -354,7 +355,7 @@ describe('Schema finding utility functions', () => { }); describe('getCanonicalSchemaForPath()', () => { - const mockLogger = jest.fn(); + const mockLogger = vi.fn(); const logInfo = { logger: { debug: mockLogger }, ruleId: 'test', diff --git a/packages/utilities/package.json b/packages/utilities/package.json index 00acd6557..b05371d12 100644 --- a/packages/utilities/package.json +++ b/packages/utilities/package.json @@ -13,9 +13,8 @@ }, "scripts": { "clean": "rm -rf node_modules", - "jest": "jest", - "test": "jest test", - "test-travis": "jest --silent --runInBand --no-colors --testNamePattern='^((?!@skip-ci).)*$' test", + "test": "vitest run", + "test-travis": "vitest run --reporter=verbose --testNamePattern='^((?!@skip-ci).)*$'", "lint": "eslint --cache --quiet --ext '.js' src test", "fix": "eslint --fix --ext '.js' src test", "generate-types": "tsc", @@ -23,19 +22,11 @@ }, "devDependencies": { "@stoplight/spectral-core": "1.19.4", - "jest": "29.7.0", - "typescript": "5.8.3" + "@vitest/coverage-v8": "^4.1.8", + "typescript": "5.8.3", + "vitest": "4.1.8" }, "engines": { "node": ">=24.0.0" - }, - "jest": { - "collectCoverage": true, - "coverageDirectory": "./coverage/", - "testEnvironment": "node", - "moduleNameMapper": { - "nimma/legacy": "/../../node_modules/@stoplight/spectral-core/node_modules/nimma/dist/legacy/cjs", - "nimma/fallbacks": "/../../node_modules/@stoplight/spectral-core/node_modules/nimma/dist/legacy/cjs/fallbacks/" - } } } diff --git a/packages/validator/package.json b/packages/validator/package.json index 4695566f6..0e56dbdd2 100644 --- a/packages/validator/package.json +++ b/packages/validator/package.json @@ -13,11 +13,10 @@ "clean": "rm -rf node_modules", "link": "npm install -g", "unlink": "npm uninstall -g", - "test": "jest test", - "jest": "jest", - "test-validators": "jest test/plugins", - "test-cli-tool": "jest test/cli-validator/tests", - "test-travis": "jest --silent --runInBand --no-colors --testNamePattern='^((?!@skip-ci).)*$' test/", + "test": "vitest run", + "test-validators": "vitest run test/plugins", + "test-cli-tool": "vitest run test/cli-validator/tests", + "test-travis": "vitest run --reporter=verbose --testNamePattern='^((?!@skip-ci).)*$'", "lint": "eslint --cache --quiet src test", "fix": "eslint --fix src test", "pkg": "../../scripts/create-binaries.sh" @@ -44,7 +43,7 @@ }, "devDependencies": { "ansi-regex": "5.0.1", - "jest": "29.7.0", + "vitest": "4.1.8", "pkg": "5.8.1" }, "bin": { @@ -53,18 +52,5 @@ "engines": { "node": ">=24.0.0", "npm": ">=11.0.0" - }, - "jest": { - "collectCoverage": true, - "coverageDirectory": "./coverage/", - "testEnvironment": "node", - "moduleNameMapper": { - "nimma/legacy": "/../../node_modules/@stoplight/spectral-core/node_modules/nimma/dist/legacy/cjs", - "nimma/fallbacks": "/../../node_modules/@stoplight/spectral-core/node_modules/nimma/dist/legacy/cjs/fallbacks/", - "@stoplight/spectral-ruleset-bundler/presets/node": "/../../node_modules/@stoplight/spectral-ruleset-bundler/dist/presets/node", - "@stoplight/spectral-ruleset-bundler/plugins/stdin": "/../../node_modules/@stoplight/spectral-ruleset-bundler/dist/plugins/stdin", - "@stoplight/spectral-ruleset-bundler/plugins/builtins": "/../../node_modules/@stoplight/spectral-ruleset-bundler/dist/plugins/builtins", - "@stoplight/spectral-ruleset-bundler/plugins/commonjs": "/../../node_modules/@stoplight/spectral-ruleset-bundler/dist/plugins/commonjs" - } } } diff --git a/packages/validator/test/cli-validator/tests/configuration-manager.test.js b/packages/validator/test/cli-validator/tests/configuration-manager.test.js index 37f332ab2..0a823ae07 100644 --- a/packages/validator/test/cli-validator/tests/configuration-manager.test.js +++ b/packages/validator/test/cli-validator/tests/configuration-manager.test.js @@ -9,6 +9,7 @@ const { loadConfig, processArgs, } = require('../../../src/cli-validator/utils'); +const { vi } = require('vitest'); // Use these parse options since we're not actually retrieving process args. const cliParseOptions = { from: 'user' }; @@ -20,7 +21,7 @@ describe('Configuration Manager tests', function () { const originalInfo = console.info; beforeEach(() => { - consoleSpy = jest.spyOn(console, 'log').mockImplementation(() => {}); + consoleSpy = vi.spyOn(console, 'log').mockImplementation(() => {}); console.warn = console.log; console.error = console.log; console.info = console.log; diff --git a/packages/validator/test/cli-validator/tests/error-handling.test.js b/packages/validator/test/cli-validator/tests/error-handling.test.js index b3f85eb3d..ffd49153c 100644 --- a/packages/validator/test/cli-validator/tests/error-handling.test.js +++ b/packages/validator/test/cli-validator/tests/error-handling.test.js @@ -3,6 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ +const { vi } = require('vitest'); const { getCapturedText, testValidator } = require('../../test-utils'); describe('cli tool - test error handling', function () { @@ -12,7 +13,7 @@ describe('cli tool - test error handling', function () { const originalInfo = console.info; beforeEach(() => { - consoleSpy = jest.spyOn(console, 'log').mockImplementation(() => {}); + consoleSpy = vi.spyOn(console, 'log').mockImplementation(() => {}); console.warn = console.log; console.error = console.log; console.info = console.log; diff --git a/packages/validator/test/cli-validator/tests/expected-output.test.js b/packages/validator/test/cli-validator/tests/expected-output.test.js index 9d27a4e65..c8fd516ec 100644 --- a/packages/validator/test/cli-validator/tests/expected-output.test.js +++ b/packages/validator/test/cli-validator/tests/expected-output.test.js @@ -3,6 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ +const { vi } = require('vitest'); const { getCapturedText, testValidator } = require('../../test-utils'); describe('Expected output tests', function () { @@ -12,7 +13,7 @@ describe('Expected output tests', function () { const originalInfo = console.info; beforeEach(() => { - consoleSpy = jest.spyOn(console, 'log').mockImplementation(() => {}); + consoleSpy = vi.spyOn(console, 'log').mockImplementation(() => {}); console.warn = console.log; console.error = console.log; console.info = console.log; diff --git a/packages/validator/test/cli-validator/tests/option-handling.test.js b/packages/validator/test/cli-validator/tests/option-handling.test.js index bb90f007f..4aebf787e 100644 --- a/packages/validator/test/cli-validator/tests/option-handling.test.js +++ b/packages/validator/test/cli-validator/tests/option-handling.test.js @@ -18,6 +18,7 @@ const { readYaml, validateSchema, } = require('../../../src/cli-validator/utils'); +const { vi } = require('vitest'); describe('cli tool - test option handling', function () { let consoleSpy; @@ -27,7 +28,7 @@ describe('cli tool - test option handling', function () { const copyrightString = getCopyrightString(); beforeEach(() => { - consoleSpy = jest.spyOn(console, 'log').mockImplementation(() => {}); + consoleSpy = vi.spyOn(console, 'log').mockImplementation(() => {}); console.warn = console.log; console.error = console.log; console.info = console.log; diff --git a/packages/validator/test/cli-validator/tests/run-validator.test.js b/packages/validator/test/cli-validator/tests/run-validator.test.js index 53a02f7e6..23378762d 100644 --- a/packages/validator/test/cli-validator/tests/run-validator.test.js +++ b/packages/validator/test/cli-validator/tests/run-validator.test.js @@ -3,6 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ +const { vi } = require('vitest'); const { getCapturedText, testValidator } = require('../../test-utils'); describe('run-validator tests', function () { @@ -12,7 +13,7 @@ describe('run-validator tests', function () { const originalInfo = console.info; beforeEach(() => { - consoleSpy = jest.spyOn(console, 'log').mockImplementation(() => {}); + consoleSpy = vi.spyOn(console, 'log').mockImplementation(() => {}); console.warn = console.log; console.error = console.log; console.info = console.log; diff --git a/packages/validator/test/markdown-report/markdown-table.test.js b/packages/validator/test/markdown-report/markdown-table.test.js index 5a938562f..2c31d40f8 100644 --- a/packages/validator/test/markdown-report/markdown-table.test.js +++ b/packages/validator/test/markdown-report/markdown-table.test.js @@ -3,6 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ +const { vi } = require('vitest'); const MarkdownTable = require('../../src/markdown-report/markdown-table'); describe('MarkdownTable tests', function () { @@ -22,7 +23,7 @@ describe('MarkdownTable tests', function () { }); it('addRow logs an error if it receives a bad number of arguments', function () { - const consoleErrorSpy = jest + const consoleErrorSpy = vi .spyOn(console, 'error') .mockImplementation(() => {}); const table = new MarkdownTable('exactly', 'two'); diff --git a/packages/validator/test/scoring-tool/metrics.test.js b/packages/validator/test/scoring-tool/metrics.test.js index f8b19f26c..b87b429ef 100644 --- a/packages/validator/test/scoring-tool/metrics.test.js +++ b/packages/validator/test/scoring-tool/metrics.test.js @@ -7,6 +7,7 @@ const { readFile } = require('node:fs/promises'); const readYaml = require('js-yaml'); const { collections } = require('@ibm-cloud/openapi-ruleset-utilities'); const { Metrics } = require('../../src/scoring-tool/metrics'); +const { vi } = require('vitest'); describe('scoring-tool metrics tests', function () { let apiDef; @@ -30,7 +31,7 @@ describe('scoring-tool metrics tests', function () { const metricName = 'paths'; const jsonPaths = collections.paths; const metrics = new Metrics(apiDef); - const countEveryInstance = jest.fn(() => true); + const countEveryInstance = vi.fn(() => true); const input = { value: '', path: '' }; metrics.register(metricName, jsonPaths, countEveryInstance); @@ -50,7 +51,7 @@ describe('scoring-tool metrics tests', function () { const metricName = 'paths'; const jsonPaths = collections.paths; const metrics = new Metrics(apiDef); - const countEveryInstance = jest.fn(() => true); + const countEveryInstance = vi.fn(() => true); const input = { value: { type: 'object', @@ -87,7 +88,7 @@ describe('scoring-tool metrics tests', function () { const metricName = 'paths'; const jsonPaths = collections.paths; const metrics = new Metrics(apiDef); - const countEveryInstance = jest.fn(() => true); + const countEveryInstance = vi.fn(() => true); expect(metrics.counts).toEqual({}); expect(metrics.collectedArtifacts).toEqual({}); @@ -125,7 +126,7 @@ describe('scoring-tool metrics tests', function () { const metrics = new Metrics(apiDef); const metricName = 'paths'; const jsonPaths = collections.paths; - const countEveryInstance = jest.fn(() => true); + const countEveryInstance = vi.fn(() => true); const input = { value: '', path: '' }; expect(metrics.counts[metricName]).toBeUndefined(); @@ -151,7 +152,7 @@ describe('scoring-tool metrics tests', function () { const metricName = 'paths'; const mockPath = '/v1/my-path'; const mockPathObject = { get: 'my-operation' }; - const mockCondition = jest.fn(() => true); + const mockCondition = vi.fn(() => true); // These would be initialized by a different method, fake it here. metrics.initializeMetric(metricName); @@ -177,7 +178,7 @@ describe('scoring-tool metrics tests', function () { const metricName = 'paths'; const mockPath = '/v1/my-path'; const mockPathObject = { get: 'my-operation' }; - const mockCondition = jest.fn(() => false); + const mockCondition = vi.fn(() => false); // These would be initialized by a different method, fake it here. metrics.initializeMetric(metricName); @@ -203,7 +204,7 @@ describe('scoring-tool metrics tests', function () { const metricName = 'paths'; const mockPath = '/v1/my-path'; const mockPathObject = { get: 'my-operation' }; - const mockCondition = jest.fn(() => true); + const mockCondition = vi.fn(() => true); // These would be initialized by a different method, fake it here. metrics.initializeMetric(metricName); diff --git a/packages/validator/test/scoring-tool/output.test.js b/packages/validator/test/scoring-tool/output.test.js index c2a4697fb..e23bd50b2 100644 --- a/packages/validator/test/scoring-tool/output.test.js +++ b/packages/validator/test/scoring-tool/output.test.js @@ -8,12 +8,13 @@ const { printCategorizedScoresTable, printScoringDataTable, } = require('../../src/scoring-tool/output'); +const { vi } = require('vitest'); describe('scoring-tool output tests', function () { let consoleSpy; beforeEach(() => { - consoleSpy = jest.spyOn(console, 'log').mockImplementation(() => {}); + consoleSpy = vi.spyOn(console, 'log').mockImplementation(() => {}); }); afterEach(() => { diff --git a/packages/validator/test/scoring-tool/score.test.js b/packages/validator/test/scoring-tool/score.test.js index 83942cdc5..f3f7862b4 100644 --- a/packages/validator/test/scoring-tool/score.test.js +++ b/packages/validator/test/scoring-tool/score.test.js @@ -13,9 +13,10 @@ const { } = require('../../src/scoring-tool/score'); const { Metrics } = require('../../src/scoring-tool/metrics'); +const { vi } = require('vitest'); describe('scoring-tool score tests', function () { - const debug = jest.fn(); + const debug = vi.fn(); const mockLogger = { debug }; const metrics = new Metrics(); // Fake the metrics by hardcoding the metadata. From f7f22cdeccb55e2687421f4a68af213e859acd76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=ADdia=20Tarcza?= <100163235+diatrcz@users.noreply.github.com> Date: Mon, 8 Jun 2026 16:52:05 +0200 Subject: [PATCH 02/16] build: swap jest with vitest MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Lídia Tarcza <100163235+diatrcz@users.noreply.github.com> --- .../ruleset/test/rules/circular-refs.test.js | 9 +--- .../rules/no-operation-requestbody.test.js | 26 ++++------- .../property-consistent-name-and-type.test.js | 46 +++++++------------ .../ruleset/test/utils/logger-factory.test.js | 4 +- .../test/utils/pagination-utils.test.js | 10 +--- .../test/utils/schema-finding-utils.test.js | 8 +--- packages/ruleset/vitest.config.js | 19 ++++++++ packages/utilities/vitest.config.ts | 19 ++++++++ .../tests/configuration-manager.test.js | 10 ++-- .../tests/error-handling.test.js | 4 +- .../tests/expected-output.test.js | 4 +- .../tests/option-handling.test.js | 22 +++------ .../cli-validator/tests/run-validator.test.js | 4 +- .../markdown-report/markdown-table.test.js | 4 +- .../test/scoring-tool/metrics.test.js | 12 ++--- .../test/scoring-tool/output.test.js | 9 ++-- .../validator/test/scoring-tool/score.test.js | 15 ++---- packages/validator/vitest.config.js | 23 ++++++++++ 18 files changed, 124 insertions(+), 124 deletions(-) create mode 100644 packages/ruleset/vitest.config.js create mode 100644 packages/utilities/vitest.config.ts create mode 100644 packages/validator/vitest.config.js diff --git a/packages/ruleset/test/rules/circular-refs.test.js b/packages/ruleset/test/rules/circular-refs.test.js index 1060e53ed..bf223d1b8 100644 --- a/packages/ruleset/test/rules/circular-refs.test.js +++ b/packages/ruleset/test/rules/circular-refs.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { vi } = require('vitest'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { vi } from 'vitest'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; let rule; const ruleId = 'ibm-no-circular-refs'; diff --git a/packages/ruleset/test/rules/no-operation-requestbody.test.js b/packages/ruleset/test/rules/no-operation-requestbody.test.js index 3694b22c8..c911ae24a 100644 --- a/packages/ruleset/test/rules/no-operation-requestbody.test.js +++ b/packages/ruleset/test/rules/no-operation-requestbody.test.js @@ -3,14 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { vi } = require('vitest'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); -let rule = require('../../src/rules').noOperationRequestBody; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; +import { noOperationRequestBody } from '../../src/rules'; const ruleId = 'ibm-no-operation-requestbody'; const expectedSeverity = severityCodes.warning; @@ -18,12 +12,8 @@ const expectedMsg = 'operations should not define a requestBody'; describe(`Spectral rule: ${ruleId}`, () => { describe('Should not yield errors', () => { - afterEach(() => { - vi.resetModules(); - rule = require('../../src/rules').noOperationRequestBody; - }); it('Clean spec', async () => { - const results = await testRule(ruleId, rule, rootDocument); + const results = await testRule(ruleId, noOperationRequestBody, rootDocument); expect(results).toHaveLength(0); }); @@ -31,6 +21,7 @@ describe(`Spectral rule: ${ruleId}`, () => { const testDocument = makeCopy(rootDocument); // omit 'delete' from the list of methods. + const rule = structuredClone(noOperationRequestBody); rule.then.functionOptions.httpMethods = ['get', 'head', 'options']; testDocument.paths['/v1/drinks/{drink_id}'].delete = { @@ -88,7 +79,7 @@ describe(`Spectral rule: ${ruleId}`, () => { }, }, }; - const results = await testRule(ruleId, rule, testDocument); + const results = await testRule(ruleId, noOperationRequestBody, testDocument); expect(results).toHaveLength(1); expect(results[0].code).toBe(ruleId); expect(results[0].message).toBe(`DELETE ${expectedMsg}`); @@ -123,7 +114,7 @@ describe(`Spectral rule: ${ruleId}`, () => { }, }, }; - const results = await testRule(ruleId, rule, testDocument); + const results = await testRule(ruleId, noOperationRequestBody, testDocument); expect(results).toHaveLength(1); expect(results[0].code).toBe(ruleId); expect(results[0].message).toBe(`GET ${expectedMsg}`); @@ -158,7 +149,7 @@ describe(`Spectral rule: ${ruleId}`, () => { }, }, }; - const results = await testRule(ruleId, rule, testDocument); + const results = await testRule(ruleId, noOperationRequestBody, testDocument); expect(results).toHaveLength(1); expect(results[0].code).toBe(ruleId); expect(results[0].message).toBe(`HEAD ${expectedMsg}`); @@ -193,7 +184,7 @@ describe(`Spectral rule: ${ruleId}`, () => { }, }, }; - const results = await testRule(ruleId, rule, testDocument); + const results = await testRule(ruleId, noOperationRequestBody, testDocument); expect(results).toHaveLength(1); expect(results[0].code).toBe(ruleId); expect(results[0].message).toBe(`OPTIONS ${expectedMsg}`); @@ -205,6 +196,7 @@ describe(`Spectral rule: ${ruleId}`, () => { it('POST operation w/requestBody - post in config', async () => { const testDocument = makeCopy(rootDocument); + const rule = structuredClone(noOperationRequestBody); rule.then.functionOptions.httpMethods = [ 'delete', 'get', diff --git a/packages/ruleset/test/rules/property-consistent-name-and-type.test.js b/packages/ruleset/test/rules/property-consistent-name-and-type.test.js index 65f9a7a0c..af368dce4 100644 --- a/packages/ruleset/test/rules/property-consistent-name-and-type.test.js +++ b/packages/ruleset/test/rules/property-consistent-name-and-type.test.js @@ -3,42 +3,28 @@ * SPDX-License-Identifier: Apache2.0 */ -const { vi } = require('vitest'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); -let rule = require('../../src/rules').propertyConsistentNameAndType; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; +import { propertyConsistentNameAndType } from '../../src/rules'; const ruleId = 'ibm-property-consistent-name-and-type'; -// this rule is turned off by default - enable it to run tests -// but still verify it is defined in the rule as "off" -const originalSeverity = makeCopy(rule.severity); -rule.severity = 'warn'; +function getRule() { + const rule = structuredClone(propertyConsistentNameAndType); + rule.severity = 'warn'; + return rule; +} +const originalSeverity = makeCopy(propertyConsistentNameAndType.severity); const expectedSeverity = severityCodes.warning; describe(`Spectral rule: ${ruleId}`, () => { - // this is required because of the "global" variable we are using in the file - // that holds the implementation for this rule. By default, it will maintain - // its list of "visited properties" between tests, which prevents proper - // isolation between the tests. this will reset that variable after each test - afterEach(() => { - vi.resetModules(); - rule = require('../../src/rules').propertyConsistentNameAndType; - rule.severity = 'warn'; - }); - it('Should originally be set to severity: "off"', () => { expect(originalSeverity).toBe('off'); }); describe('Should not yield errors', () => { it('should not error with clean spec', async () => { - const results = await testRule(ruleId, rule, rootDocument); + const results = await testRule(ruleId, getRule(), rootDocument); expect(results).toHaveLength(0); }); @@ -58,7 +44,7 @@ describe(`Spectral rule: ${ruleId}`, () => { }, }; - const results = await testRule(ruleId, rule, testDocument); + const results = await testRule(ruleId, getRule(), testDocument); expect(results).toHaveLength(0); }); @@ -106,7 +92,7 @@ describe(`Spectral rule: ${ruleId}`, () => { }, }; - const results = await testRule(ruleId, rule, testDocument); + const results = await testRule(ruleId, getRule(), testDocument); expect(results).toHaveLength(0); }); @@ -155,7 +141,7 @@ describe(`Spectral rule: ${ruleId}`, () => { }, }; - const results = await testRule(ruleId, rule, testDocument); + const results = await testRule(ruleId, getRule(), testDocument); expect(results).toHaveLength(0); }); @@ -204,7 +190,7 @@ describe(`Spectral rule: ${ruleId}`, () => { }, }; - const results = await testRule(ruleId, rule, testDocument); + const results = await testRule(ruleId, getRule(), testDocument); expect(results).toHaveLength(0); }); @@ -253,7 +239,7 @@ describe(`Spectral rule: ${ruleId}`, () => { }, }; - const results = await testRule(ruleId, rule, testDocument); + const results = await testRule(ruleId, getRule(), testDocument); expect(results).toHaveLength(0); }); @@ -283,7 +269,7 @@ describe(`Spectral rule: ${ruleId}`, () => { }, }; - const results = await testRule(ruleId, rule, testDocument); + const results = await testRule(ruleId, getRule(), testDocument); expect(results).toHaveLength(2); @@ -352,7 +338,7 @@ describe(`Spectral rule: ${ruleId}`, () => { }, }; - const results = await testRule(ruleId, rule, testDocument); + const results = await testRule(ruleId, getRule(), testDocument); expect(results).toHaveLength(3); diff --git a/packages/ruleset/test/utils/logger-factory.test.js b/packages/ruleset/test/utils/logger-factory.test.js index c4ddebde5..c0949bb0a 100644 --- a/packages/ruleset/test/utils/logger-factory.test.js +++ b/packages/ruleset/test/utils/logger-factory.test.js @@ -3,8 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { vi } = require('vitest'); -const { LoggerFactory } = require('../../src/utils'); +import { vi } from 'vitest'; +import { LoggerFactory } from '../../src/utils'; describe('LoggerFactory tests', () => { let consoleSpy; diff --git a/packages/ruleset/test/utils/pagination-utils.test.js b/packages/ruleset/test/utils/pagination-utils.test.js index 594fa7a01..16702beb1 100644 --- a/packages/ruleset/test/utils/pagination-utils.test.js +++ b/packages/ruleset/test/utils/pagination-utils.test.js @@ -3,14 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { vi } = require('vitest'); -const { - getOffsetParamIndex, - getPageTokenParamIndex, - getSuccessCode, - getResponseSchema, - getPaginatedOperationFromPath, -} = require('../../src/utils'); +import { vi } from 'vitest'; +import { getOffsetParamIndex, getPageTokenParamIndex, getSuccessCode, getResponseSchema, getPaginatedOperationFromPath } from '../../src/utils'; describe('Pagination utility functions', () => { describe('getOffsetParamIndex()', () => { diff --git a/packages/ruleset/test/utils/schema-finding-utils.test.js b/packages/ruleset/test/utils/schema-finding-utils.test.js index 33d3d7cc2..88c898a6d 100644 --- a/packages/ruleset/test/utils/schema-finding-utils.test.js +++ b/packages/ruleset/test/utils/schema-finding-utils.test.js @@ -3,12 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { vi } = require('vitest'); -const { - getSuccessResponseSchemaForOperation, - getRequestBodySchemaForOperation, - getCanonicalSchemaForPath, -} = require('../../src/utils'); +import { vi } from 'vitest'; +import { getSuccessResponseSchemaForOperation, getRequestBodySchemaForOperation, getCanonicalSchemaForPath } from '../../src/utils'; describe('Schema finding utility functions', () => { describe('getSuccessResponseSchemaForOperation()', () => { diff --git a/packages/ruleset/vitest.config.js b/packages/ruleset/vitest.config.js new file mode 100644 index 000000000..3cd42f48d --- /dev/null +++ b/packages/ruleset/vitest.config.js @@ -0,0 +1,19 @@ +import { defineConfig } from 'vitest/config'; + +export default defineConfig({ + test: { + globals: true, + environment: 'node', + coverage: { + enabled: true, + reporter: ['text', 'json', 'html'], + reportsDirectory: './coverage/', + }, + }, + resolve: { + alias: { + 'nimma/legacy': '../../node_modules/@stoplight/spectral-core/node_modules/nimma/dist/legacy/cjs', + 'nimma/fallbacks': '../../node_modules/@stoplight/spectral-core/node_modules/nimma/dist/legacy/cjs/fallbacks/', + }, + }, +}); \ No newline at end of file diff --git a/packages/utilities/vitest.config.ts b/packages/utilities/vitest.config.ts new file mode 100644 index 000000000..3cd42f48d --- /dev/null +++ b/packages/utilities/vitest.config.ts @@ -0,0 +1,19 @@ +import { defineConfig } from 'vitest/config'; + +export default defineConfig({ + test: { + globals: true, + environment: 'node', + coverage: { + enabled: true, + reporter: ['text', 'json', 'html'], + reportsDirectory: './coverage/', + }, + }, + resolve: { + alias: { + 'nimma/legacy': '../../node_modules/@stoplight/spectral-core/node_modules/nimma/dist/legacy/cjs', + 'nimma/fallbacks': '../../node_modules/@stoplight/spectral-core/node_modules/nimma/dist/legacy/cjs/fallbacks/', + }, + }, +}); \ No newline at end of file diff --git a/packages/validator/test/cli-validator/tests/configuration-manager.test.js b/packages/validator/test/cli-validator/tests/configuration-manager.test.js index 0a823ae07..039d3e3a2 100644 --- a/packages/validator/test/cli-validator/tests/configuration-manager.test.js +++ b/packages/validator/test/cli-validator/tests/configuration-manager.test.js @@ -3,13 +3,9 @@ * SPDX-License-Identifier: Apache2.0 */ -const { getCapturedText } = require('../../test-utils'); -const { - getDefaultConfig, - loadConfig, - processArgs, -} = require('../../../src/cli-validator/utils'); -const { vi } = require('vitest'); +import { getCapturedText } from '../../test-utils'; +import { getDefaultConfig, loadConfig, processArgs } from '../../../src/cli-validator/utils'; +import { vi } from 'vitest'; // Use these parse options since we're not actually retrieving process args. const cliParseOptions = { from: 'user' }; diff --git a/packages/validator/test/cli-validator/tests/error-handling.test.js b/packages/validator/test/cli-validator/tests/error-handling.test.js index ffd49153c..fc166290c 100644 --- a/packages/validator/test/cli-validator/tests/error-handling.test.js +++ b/packages/validator/test/cli-validator/tests/error-handling.test.js @@ -3,8 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { vi } = require('vitest'); -const { getCapturedText, testValidator } = require('../../test-utils'); +import { vi } from 'vitest'; +import { getCapturedText, testValidator } from '../../test-utils'; describe('cli tool - test error handling', function () { let consoleSpy; diff --git a/packages/validator/test/cli-validator/tests/expected-output.test.js b/packages/validator/test/cli-validator/tests/expected-output.test.js index c8fd516ec..92c2179a2 100644 --- a/packages/validator/test/cli-validator/tests/expected-output.test.js +++ b/packages/validator/test/cli-validator/tests/expected-output.test.js @@ -3,8 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { vi } = require('vitest'); -const { getCapturedText, testValidator } = require('../../test-utils'); +import { vi } from 'vitest'; +import { getCapturedText, testValidator } from '../../test-utils'; describe('Expected output tests', function () { let consoleSpy; diff --git a/packages/validator/test/cli-validator/tests/option-handling.test.js b/packages/validator/test/cli-validator/tests/option-handling.test.js index 4aebf787e..959b38872 100644 --- a/packages/validator/test/cli-validator/tests/option-handling.test.js +++ b/packages/validator/test/cli-validator/tests/option-handling.test.js @@ -3,22 +3,12 @@ * SPDX-License-Identifier: Apache2.0 */ -const { existsSync, unlinkSync } = require('fs'); - -const { - extractValuesFromTable, - getCapturedText, - getCapturedTextWithColor, - stripAnsi, - testValidator, -} = require('../../test-utils'); - -const { - getCopyrightString, - readYaml, - validateSchema, -} = require('../../../src/cli-validator/utils'); -const { vi } = require('vitest'); +import { existsSync, unlinkSync } from 'fs'; + +import { extractValuesFromTable, getCapturedText, getCapturedTextWithColor, stripAnsi, testValidator } from '../../test-utils'; + +import { getCopyrightString, readYaml, validateSchema } from '../../../src/cli-validator/utils'; +import { vi } from 'vitest'; describe('cli tool - test option handling', function () { let consoleSpy; diff --git a/packages/validator/test/cli-validator/tests/run-validator.test.js b/packages/validator/test/cli-validator/tests/run-validator.test.js index 23378762d..1de08fe32 100644 --- a/packages/validator/test/cli-validator/tests/run-validator.test.js +++ b/packages/validator/test/cli-validator/tests/run-validator.test.js @@ -3,8 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { vi } = require('vitest'); -const { getCapturedText, testValidator } = require('../../test-utils'); +import { vi } from 'vitest'; +import { getCapturedText, testValidator } from '../../test-utils'; describe('run-validator tests', function () { let consoleSpy; diff --git a/packages/validator/test/markdown-report/markdown-table.test.js b/packages/validator/test/markdown-report/markdown-table.test.js index 2c31d40f8..9b1c324f9 100644 --- a/packages/validator/test/markdown-report/markdown-table.test.js +++ b/packages/validator/test/markdown-report/markdown-table.test.js @@ -3,8 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { vi } = require('vitest'); -const MarkdownTable = require('../../src/markdown-report/markdown-table'); +import { vi } from 'vitest'; +import MarkdownTable from '../../src/markdown-report/markdown-table'; describe('MarkdownTable tests', function () { it('constructor creates new instance of MarkdownTable', function () { diff --git a/packages/validator/test/scoring-tool/metrics.test.js b/packages/validator/test/scoring-tool/metrics.test.js index b87b429ef..363a84522 100644 --- a/packages/validator/test/scoring-tool/metrics.test.js +++ b/packages/validator/test/scoring-tool/metrics.test.js @@ -3,11 +3,11 @@ * SPDX-License-Identifier: Apache2.0 */ -const { readFile } = require('node:fs/promises'); -const readYaml = require('js-yaml'); -const { collections } = require('@ibm-cloud/openapi-ruleset-utilities'); -const { Metrics } = require('../../src/scoring-tool/metrics'); -const { vi } = require('vitest'); +import { readFile } from 'node:fs/promises'; +import { load } from 'js-yaml'; +import { collections } from '@ibm-cloud/openapi-ruleset-utilities'; +import { Metrics } from '../../src/scoring-tool/metrics'; +import { vi } from 'vitest'; describe('scoring-tool metrics tests', function () { let apiDef; @@ -15,7 +15,7 @@ describe('scoring-tool metrics tests', function () { beforeAll(async function () { const fileToTest = `${__dirname}/../cli-validator/mock-files/oas3/clean.yml`; const contents = await readFile(fileToTest, { encoding: 'utf8' }); - apiDef = readYaml.load(contents); + apiDef = load(contents); }); it('should initialize members in constructor', function () { diff --git a/packages/validator/test/scoring-tool/output.test.js b/packages/validator/test/scoring-tool/output.test.js index e23bd50b2..c3fcaba15 100644 --- a/packages/validator/test/scoring-tool/output.test.js +++ b/packages/validator/test/scoring-tool/output.test.js @@ -3,12 +3,9 @@ * SPDX-License-Identifier: Apache2.0 */ -const { extractValuesFromTable } = require('../test-utils'); -const { - printCategorizedScoresTable, - printScoringDataTable, -} = require('../../src/scoring-tool/output'); -const { vi } = require('vitest'); +import { extractValuesFromTable } from '../test-utils'; +import { printCategorizedScoresTable, printScoringDataTable } from '../../src/scoring-tool/output'; +import { vi } from 'vitest'; describe('scoring-tool output tests', function () { let consoleSpy; diff --git a/packages/validator/test/scoring-tool/score.test.js b/packages/validator/test/scoring-tool/score.test.js index f3f7862b4..5d6e663ad 100644 --- a/packages/validator/test/scoring-tool/score.test.js +++ b/packages/validator/test/scoring-tool/score.test.js @@ -3,17 +3,10 @@ * SPDX-License-Identifier: Apache2.0 */ -const { - scoreResults, - compute, - computeCategorizedScores, - getFunc, - tally, - computeOverallScore, -} = require('../../src/scoring-tool/score'); - -const { Metrics } = require('../../src/scoring-tool/metrics'); -const { vi } = require('vitest'); +import { scoreResults, compute, computeCategorizedScores, getFunc, tally, computeOverallScore } from '../../src/scoring-tool/score'; + +import { Metrics } from '../../src/scoring-tool/metrics'; +import { vi } from 'vitest'; describe('scoring-tool score tests', function () { const debug = vi.fn(); diff --git a/packages/validator/vitest.config.js b/packages/validator/vitest.config.js new file mode 100644 index 000000000..5fd11ed42 --- /dev/null +++ b/packages/validator/vitest.config.js @@ -0,0 +1,23 @@ +import { defineConfig } from 'vitest/config'; + +export default defineConfig({ + test: { + globals: true, + environment: 'node', + coverage: { + enabled: true, + reporter: ['text', 'json', 'html'], + reportsDirectory: './coverage/', + }, + }, + resolve: { + alias: { + 'nimma/legacy': '../../node_modules/@stoplight/spectral-core/node_modules/nimma/dist/legacy/cjs', + 'nimma/fallbacks': '../../node_modules/@stoplight/spectral-core/node_modules/nimma/dist/legacy/cjs/fallbacks/', + '@stoplight/spectral-ruleset-bundler/presets/node': '../../node_modules/@stoplight/spectral-ruleset-bundler/dist/presets/node', + '@stoplight/spectral-ruleset-bundler/plugins/stdin': '../../node_modules/@stoplight/spectral-ruleset-bundler/dist/plugins/stdin', + '@stoplight/spectral-ruleset-bundler/plugins/builtins': '../../node_modules/@stoplight/spectral-ruleset-bundler/dist/plugins/builtins', + '@stoplight/spectral-ruleset-bundler/plugins/commonjs': '../../node_modules/@stoplight/spectral-ruleset-bundler/dist/plugins/commonjs', + }, + }, +}); \ No newline at end of file From 2c3ec6abc4f54f70ad5c6aa36b3f3949fd373ea1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=ADdia=20Tarcza?= <100163235+diatrcz@users.noreply.github.com> Date: Mon, 8 Jun 2026 17:19:25 +0200 Subject: [PATCH 03/16] chore: swap commonjs to esm ruleset functions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Lídia Tarcza <100163235+diatrcz@users.noreply.github.com> --- package.json | 1 + packages/ruleset/package.json | 3 +- .../src/functions/accept-and-return-models.js | 8 +- .../ruleset/src/functions/allowed-keywords.js | 6 +- .../src/functions/anchored-patterns.js | 8 +- .../ruleset/src/functions/api-symmetry.js | 10 +- .../ruleset/src/functions/array-attributes.js | 10 +- .../ruleset/src/functions/array-of-arrays.js | 8 +- .../ruleset/src/functions/array-responses.js | 6 +- .../src/functions/avoid-multiple-types.js | 8 +- .../ruleset/src/functions/binary-schemas.js | 8 +- .../ruleset/src/functions/circular-refs.js | 4 +- .../functions/collection-array-property.js | 8 +- .../functions/consecutive-path-segments.js | 4 +- packages/ruleset/src/functions/delete-body.js | 4 +- .../functions/disallowed-header-parameter.js | 4 +- .../discriminator-property-exists.js | 8 +- .../src/functions/duplicate-path-parameter.js | 6 +- .../src/functions/enum-casing-convention.js | 8 +- .../src/functions/error-response-schemas.js | 8 +- .../src/functions/etag-header-exists.js | 4 +- packages/ruleset/src/functions/index.js | 190 ++++++++++-------- .../ruleset/src/functions/inline-schemas.js | 10 +- .../src/functions/integer-attributes.js | 8 +- .../src/functions/major-version-in-path.js | 4 +- .../src/functions/merge-patch-properties.js | 6 +- .../src/functions/no-ambiguous-paths.js | 6 +- .../src/functions/no-nullable-properties.js | 10 +- .../src/functions/no-operation-requestbody.js | 4 +- .../src/functions/no-ref-in-example.js | 6 +- .../src/functions/no-superfluous-allof.js | 6 +- .../src/functions/no-unsupported-keywords.js | 4 +- .../src/functions/operation-summary-exists.js | 4 +- .../src/functions/operation-summary-length.js | 4 +- .../operationid-casing-convention.js | 6 +- .../operationid-naming-convention.js | 10 +- .../src/functions/optional-request-body.js | 6 +- .../ruleset/src/functions/pagination-style.js | 10 +- .../functions/parameter-casing-convention.js | 6 +- .../src/functions/parameter-default.js | 4 +- .../functions/parameter-description-exists.js | 4 +- .../ruleset/src/functions/parameter-order.js | 4 +- .../functions/patch-request-content-type.js | 6 +- .../src/functions/path-parameter-not-crn.js | 9 +- .../path-segment-casing-convention.js | 6 +- .../src/functions/pattern-properties.js | 8 +- .../src/functions/precondition-header.js | 4 +- .../src/functions/prefer-token-pagination.js | 6 +- .../src/functions/property-attributes.js | 8 +- .../functions/property-casing-convention.js | 8 +- .../property-consistent-name-and-type.js | 8 +- .../functions/property-description-exists.js | 8 +- .../src/functions/property-name-collision.js | 6 +- .../src/functions/redirect-response-body.js | 6 +- packages/ruleset/src/functions/ref-pattern.js | 4 +- .../ref-sibling-duplicate-description.js | 6 +- .../functions/request-and-response-content.js | 11 +- .../ruleset/src/functions/requestbody-name.js | 12 +- .../required-array-properties-in-response.js | 8 +- .../required-enum-properties-in-response.js | 8 +- .../src/functions/required-property.js | 8 +- .../resource-response-consistency.js | 12 +- .../src/functions/response-example-exists.js | 2 +- .../src/functions/response-status-codes.js | 8 +- .../src/functions/schema-casing-convention.js | 8 +- .../functions/schema-description-exists.js | 8 +- .../src/functions/schema-naming-convention.js | 10 +- .../functions/schema-or-content-provided.js | 2 +- .../src/functions/schema-type-exists.js | 6 +- .../src/functions/schema-type-format.js | 6 +- .../functions/securityscheme-attributes.js | 8 +- .../ruleset/src/functions/securityschemes.js | 4 +- .../src/functions/string-attributes.js | 8 +- .../src/functions/unevaluated-properties.js | 6 +- ...unique-parameter-request-property-names.js | 10 +- packages/ruleset/src/functions/unused-tags.js | 4 +- .../src/functions/use-date-based-format.js | 10 +- .../src/functions/valid-path-segments.js | 4 +- .../src/functions/valid-schema-example.js | 8 +- .../functions/well-defined-dictionaries.js | 8 +- packages/utilities/package.json | 3 +- packages/utilities/src/utils/schema-path.js | 3 - packages/utilities/test/schema-path.test.js | 3 - packages/validator/package.json | 1 + 84 files changed, 373 insertions(+), 355 deletions(-) diff --git a/package.json b/package.json index 4e8b38d09..c2e996344 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,6 @@ { "name": "ibm-openapi-validator", + "type": "module", "workspaces": [ "packages/utilities", "packages/ruleset", diff --git a/packages/ruleset/package.json b/packages/ruleset/package.json index 103094cea..05ffae64c 100644 --- a/packages/ruleset/package.json +++ b/packages/ruleset/package.json @@ -1,10 +1,11 @@ { "name": "@ibm-cloud/openapi-ruleset", + "type": "module", "description": "Spectral ruleset for validating IBM Cloud services", "version": "1.33.9", "license": "Apache-2.0", "private": false, - "main": "./src/ibm-oas.js", + "exports": "./src/ibm-oas.js", "repository": { "type": "git", "url": "https://github.com/IBM/openapi-validator.git", diff --git a/packages/ruleset/src/functions/accept-and-return-models.js b/packages/ruleset/src/functions/accept-and-return-models.js index 3b6ebfccd..ebdfa35f1 100644 --- a/packages/ruleset/src/functions/accept-and-return-models.js +++ b/packages/ruleset/src/functions/accept-and-return-models.js @@ -3,12 +3,12 @@ * SPDX-License-Identifier: Apache2.0 */ -const { +import { isObject, isObjectSchema, schemaHasConstraint, -} = require('@ibm-cloud/openapi-ruleset-utilities'); -const { supportsJsonContent, LoggerFactory } = require('../utils'); +} from "@ibm-cloud/openapi-ruleset-utilities"; +import { supportsJsonContent, LoggerFactory } from "../utils"; let ruleId; let logger; @@ -25,7 +25,7 @@ let logger; * */ -module.exports = function acceptAndReturnModels(operation, options, context) { +export default function acceptAndReturnModels(operation, options, context) { if (!logger) { ruleId = context.rule.name; logger = LoggerFactory.getInstance().getLogger(ruleId); diff --git a/packages/ruleset/src/functions/allowed-keywords.js b/packages/ruleset/src/functions/allowed-keywords.js index 237172d67..dc4b5dca8 100644 --- a/packages/ruleset/src/functions/allowed-keywords.js +++ b/packages/ruleset/src/functions/allowed-keywords.js @@ -3,13 +3,13 @@ * SPDX-License-Identifier: Apache2.0 */ -const { validateSubschemas } = require('@ibm-cloud/openapi-ruleset-utilities'); -const { LoggerFactory } = require('../utils'); +import { validateSubschemas } from '@ibm-cloud/openapi-ruleset-utilities'; +import { LoggerFactory } from '../utils'; let ruleId; let logger; -module.exports = function (obj, options, context) { +export default function (obj, options, context) { if (!logger) { ruleId = context.rule.name; logger = LoggerFactory.getInstance().getLogger(ruleId); diff --git a/packages/ruleset/src/functions/anchored-patterns.js b/packages/ruleset/src/functions/anchored-patterns.js index 4fccc7b79..0096e522b 100644 --- a/packages/ruleset/src/functions/anchored-patterns.js +++ b/packages/ruleset/src/functions/anchored-patterns.js @@ -3,16 +3,16 @@ * SPDX-License-Identifier: Apache2.0 */ -const { +import { isStringSchema, validateSubschemas, -} = require('@ibm-cloud/openapi-ruleset-utilities'); +} from "@ibm-cloud/openapi-ruleset-utilities"; -const { LoggerFactory } = require('../utils'); +import { LoggerFactory } from "../utils"; let ruleId; let logger; -module.exports = function (schema, _opts, context) { +export default function (schema, _opts, context) { if (!logger) { ruleId = context.rule.name; logger = LoggerFactory.getInstance().getLogger(ruleId); diff --git a/packages/ruleset/src/functions/api-symmetry.js b/packages/ruleset/src/functions/api-symmetry.js index 0b19a9b1e..71cd64d28 100644 --- a/packages/ruleset/src/functions/api-symmetry.js +++ b/packages/ruleset/src/functions/api-symmetry.js @@ -3,21 +3,21 @@ * SPDX-License-Identifier: Apache2.0 */ -const { +import { getNodes, getSchemaType, isObject, isArraySchema, validateSubschemas, -} = require('@ibm-cloud/openapi-ruleset-utilities'); +} from "@ibm-cloud/openapi-ruleset-utilities"; -const { +import { LoggerFactory, computeRefsAtPaths, getCanonicalSchemaForPath, getResourceOrientedPaths, getSchemaNameAtPath, -} = require('../utils'); +} from "../utils"; let ruleId; let logger; @@ -42,7 +42,7 @@ const infoLogStack = []; * - ibm-schema-naming-convention: schemas have appropriate, purpose-based names */ -module.exports = function apiSymmetry(apidef, options, context) { +export default function apiSymmetry(apidef, options, context) { if (!logger) { ruleId = context.rule.name; logger = LoggerFactory.getInstance().getLogger(ruleId); diff --git a/packages/ruleset/src/functions/array-attributes.js b/packages/ruleset/src/functions/array-attributes.js index 2048b4d3d..f7a890f8c 100644 --- a/packages/ruleset/src/functions/array-attributes.js +++ b/packages/ruleset/src/functions/array-attributes.js @@ -3,17 +3,17 @@ * SPDX-License-Identifier: Apache2.0 */ -const { isPlainObject } = require('lodash'); -const { +import { isPlainObject } from "lodash"; +import { validateNestedSchemas, isArraySchema, -} = require('@ibm-cloud/openapi-ruleset-utilities'); -const { getCompositeSchemaAttribute, LoggerFactory } = require('../utils'); +} from "@ibm-cloud/openapi-ruleset-utilities"; +import { getCompositeSchemaAttribute, LoggerFactory } from "../utils"; let ruleId; let logger; -module.exports = function (schema, _opts, context) { +export default function (schema, _opts, context) { if (!logger) { ruleId = context.rule.name; logger = LoggerFactory.getInstance().getLogger(ruleId); diff --git a/packages/ruleset/src/functions/array-of-arrays.js b/packages/ruleset/src/functions/array-of-arrays.js index 1f870e8d9..ca3b3fc73 100644 --- a/packages/ruleset/src/functions/array-of-arrays.js +++ b/packages/ruleset/src/functions/array-of-arrays.js @@ -3,15 +3,15 @@ * SPDX-License-Identifier: Apache2.0 */ -const { +import { isArraySchema, validateSubschemas, -} = require('@ibm-cloud/openapi-ruleset-utilities'); -const { LoggerFactory } = require('../utils'); +} from "@ibm-cloud/openapi-ruleset-utilities"; +import { LoggerFactory } from "../utils"; let ruleId; let logger; -module.exports = function (schema, _opts, context) { +export default function (schema, _opts, context) { if (!logger) { ruleId = context.rule.name; logger = LoggerFactory.getInstance().getLogger(ruleId); diff --git a/packages/ruleset/src/functions/array-responses.js b/packages/ruleset/src/functions/array-responses.js index fed64ef66..3b98ca634 100644 --- a/packages/ruleset/src/functions/array-responses.js +++ b/packages/ruleset/src/functions/array-responses.js @@ -3,12 +3,12 @@ * SPDX-License-Identifier: Apache2.0 */ -const { isArraySchema } = require('@ibm-cloud/openapi-ruleset-utilities'); -const { LoggerFactory } = require('../utils'); +import { isArraySchema } from '@ibm-cloud/openapi-ruleset-utilities'; +import { LoggerFactory } from '../utils'; let ruleId; let logger; -module.exports = function (operation, _opts, context) { +export default function (operation, _opts, context) { if (!logger) { ruleId = context.rule.name; logger = LoggerFactory.getInstance().getLogger(ruleId); diff --git a/packages/ruleset/src/functions/avoid-multiple-types.js b/packages/ruleset/src/functions/avoid-multiple-types.js index 6e0bb1ca4..33b7bf5e8 100644 --- a/packages/ruleset/src/functions/avoid-multiple-types.js +++ b/packages/ruleset/src/functions/avoid-multiple-types.js @@ -3,15 +3,13 @@ * SPDX-License-Identifier: Apache2.0 */ -const { - validateNestedSchemas, -} = require('@ibm-cloud/openapi-ruleset-utilities'); -const { LoggerFactory } = require('../utils'); +import { validateNestedSchemas } from '@ibm-cloud/openapi-ruleset-utilities'; +import { LoggerFactory } from '../utils'; let ruleId; let logger; -module.exports = function (schema, _opts, context) { +export default function (schema, _opts, context) { if (!logger) { ruleId = context.rule.name; logger = LoggerFactory.getInstance().getLogger(ruleId); diff --git a/packages/ruleset/src/functions/binary-schemas.js b/packages/ruleset/src/functions/binary-schemas.js index 7542eea2b..09dd32ecb 100644 --- a/packages/ruleset/src/functions/binary-schemas.js +++ b/packages/ruleset/src/functions/binary-schemas.js @@ -3,21 +3,21 @@ * SPDX-License-Identifier: Apache2.0 */ -const { isBinarySchema } = require('@ibm-cloud/openapi-ruleset-utilities'); +import { isBinarySchema } from "@ibm-cloud/openapi-ruleset-utilities"; -const { +import { isJsonMimeType, isParamSchema, isParamContentSchema, isRequestBodySchema, isResponseSchema, LoggerFactory, -} = require('../utils'); +} from "../utils"; let ruleId; let logger; -module.exports = function (schema, _opts, context) { +export default function (schema, _opts, context) { if (!logger) { ruleId = context.rule.name; logger = LoggerFactory.getInstance().getLogger(ruleId); diff --git a/packages/ruleset/src/functions/circular-refs.js b/packages/ruleset/src/functions/circular-refs.js index dbfcfa593..0db8c9288 100644 --- a/packages/ruleset/src/functions/circular-refs.js +++ b/packages/ruleset/src/functions/circular-refs.js @@ -3,12 +3,12 @@ * SPDX-License-Identifier: Apache2.0 */ -const { LoggerFactory } = require('../utils'); +import { LoggerFactory } from '../utils'; let ruleId; let logger; -module.exports = function ($ref, _opts, context) { +export default function ($ref, _opts, context) { if (!logger) { ruleId = context.rule.name; logger = LoggerFactory.getInstance().getLogger(ruleId); diff --git a/packages/ruleset/src/functions/collection-array-property.js b/packages/ruleset/src/functions/collection-array-property.js index fb1a44d22..e7f7721eb 100644 --- a/packages/ruleset/src/functions/collection-array-property.js +++ b/packages/ruleset/src/functions/collection-array-property.js @@ -3,18 +3,18 @@ * SPDX-License-Identifier: Apache2.0 */ -const { +import { schemaHasConstraint, isArraySchema, isObject, getUnresolvedSpec, -} = require('@ibm-cloud/openapi-ruleset-utilities'); -const { LoggerFactory } = require('../utils'); +} from "@ibm-cloud/openapi-ruleset-utilities"; +import { LoggerFactory } from "../utils"; let ruleId; let logger; -module.exports = function (schema, _opts, context) { +export default function (schema, _opts, context) { if (!logger) { ruleId = context.rule.name; logger = LoggerFactory.getInstance().getLogger(ruleId); diff --git a/packages/ruleset/src/functions/consecutive-path-segments.js b/packages/ruleset/src/functions/consecutive-path-segments.js index f32558f5a..69a776775 100644 --- a/packages/ruleset/src/functions/consecutive-path-segments.js +++ b/packages/ruleset/src/functions/consecutive-path-segments.js @@ -3,12 +3,12 @@ * SPDX-License-Identifier: Apache2.0 */ -const { LoggerFactory } = require('../utils'); +import { LoggerFactory } from '../utils'; let ruleId; let logger; -module.exports = function (pathItem, options, context) { +export default function (pathItem, options, context) { if (!logger) { ruleId = context.rule.name; logger = LoggerFactory.getInstance().getLogger(ruleId); diff --git a/packages/ruleset/src/functions/delete-body.js b/packages/ruleset/src/functions/delete-body.js index b9c043460..2759f1e41 100644 --- a/packages/ruleset/src/functions/delete-body.js +++ b/packages/ruleset/src/functions/delete-body.js @@ -3,12 +3,12 @@ * SPDX-License-Identifier: Apache2.0 */ -const { LoggerFactory } = require('../utils'); +import { LoggerFactory } from '../utils'; let ruleId; let logger; -module.exports = function (operation, _opts, context) { +export default function (operation, _opts, context) { if (!logger) { ruleId = context.rule.name; logger = LoggerFactory.getInstance().getLogger(ruleId); diff --git a/packages/ruleset/src/functions/disallowed-header-parameter.js b/packages/ruleset/src/functions/disallowed-header-parameter.js index 8ed3ee2b2..a64e1674b 100644 --- a/packages/ruleset/src/functions/disallowed-header-parameter.js +++ b/packages/ruleset/src/functions/disallowed-header-parameter.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -const { LoggerFactory } = require('../utils'); +import { LoggerFactory } from '../utils'; /** * This custom rule function is used to check for disallowed header parameters, @@ -19,7 +19,7 @@ const { LoggerFactory } = require('../utils'); * @param {*} headerName the name of the header parameter to check for * @returns an array of size one if 'param' is flagged, or an empty array otherwise */ -module.exports = function (param, options, context) { +export default function (param, options, context) { const ruleId = context.rule.name; const logger = LoggerFactory.getInstance().getLogger(ruleId); diff --git a/packages/ruleset/src/functions/discriminator-property-exists.js b/packages/ruleset/src/functions/discriminator-property-exists.js index 6e6ce0af6..8c76f9ee5 100644 --- a/packages/ruleset/src/functions/discriminator-property-exists.js +++ b/packages/ruleset/src/functions/discriminator-property-exists.js @@ -19,17 +19,17 @@ // The discriminator property (whose name is specified by the discriminator.propertyName field) // must be defined in the schema. -const { +import { schemaHasProperty, validateSubschemas, -} = require('@ibm-cloud/openapi-ruleset-utilities'); +} from "@ibm-cloud/openapi-ruleset-utilities"; -const { LoggerFactory } = require('../utils'); +import { LoggerFactory } from "../utils"; let ruleId; let logger; -module.exports = function (schema, _opts, context) { +export default function (schema, _opts, context) { if (!logger) { ruleId = context.rule.name; logger = LoggerFactory.getInstance().getLogger(ruleId); diff --git a/packages/ruleset/src/functions/duplicate-path-parameter.js b/packages/ruleset/src/functions/duplicate-path-parameter.js index 0b335c56d..52b34d4fa 100644 --- a/packages/ruleset/src/functions/duplicate-path-parameter.js +++ b/packages/ruleset/src/functions/duplicate-path-parameter.js @@ -3,13 +3,13 @@ * SPDX-License-Identifier: Apache2.0 */ -const { flatten, isEqual, uniqWith } = require('lodash'); -const { operationMethods, LoggerFactory } = require('../utils'); +import { flatten, isEqual, uniqWith } from "lodash"; +import { operationMethods, LoggerFactory } from "../utils"; let ruleId; let logger; -module.exports = function (pathItem, _opts, context) { +export default function (pathItem, _opts, context) { if (!logger) { ruleId = context.rule.name; logger = LoggerFactory.getInstance().getLogger(ruleId); diff --git a/packages/ruleset/src/functions/enum-casing-convention.js b/packages/ruleset/src/functions/enum-casing-convention.js index 610dd8a3c..7a1661340 100644 --- a/packages/ruleset/src/functions/enum-casing-convention.js +++ b/packages/ruleset/src/functions/enum-casing-convention.js @@ -3,15 +3,15 @@ * SPDX-License-Identifier: Apache2.0 */ -const { validateSubschemas } = require('@ibm-cloud/openapi-ruleset-utilities'); -const { casing } = require('@stoplight/spectral-functions'); -const { LoggerFactory } = require('../utils'); +import { validateSubschemas } from '@ibm-cloud/openapi-ruleset-utilities'; +import { casing } from '@stoplight/spectral-functions'; +import { LoggerFactory } from '../utils'; let casingConfig; let ruleId; let logger; -module.exports = function (schema, options, context) { +export default function (schema, options, context) { // Save this rule's "functionOptions" value since we need // to pass it on to Spectral's "casing" function. casingConfig = options; diff --git a/packages/ruleset/src/functions/error-response-schemas.js b/packages/ruleset/src/functions/error-response-schemas.js index d7cadae7b..3a2b753af 100644 --- a/packages/ruleset/src/functions/error-response-schemas.js +++ b/packages/ruleset/src/functions/error-response-schemas.js @@ -3,18 +3,18 @@ * SPDX-License-Identifier: Apache2.0 */ -const { +import { isArraySchema, isIntegerSchema, isObject, isStringSchema, -} = require('@ibm-cloud/openapi-ruleset-utilities'); -const { LoggerFactory } = require('../utils'); +} from "@ibm-cloud/openapi-ruleset-utilities"; +import { LoggerFactory } from "../utils"; let ruleId; let logger; -module.exports = function (schema, _opts, context) { +export default function (schema, _opts, context) { if (!logger) { ruleId = context.rule.name; logger = LoggerFactory.getInstance().getLogger(ruleId); diff --git a/packages/ruleset/src/functions/etag-header-exists.js b/packages/ruleset/src/functions/etag-header-exists.js index 8d6ab7855..e12ac25b8 100644 --- a/packages/ruleset/src/functions/etag-header-exists.js +++ b/packages/ruleset/src/functions/etag-header-exists.js @@ -3,12 +3,12 @@ * SPDX-License-Identifier: Apache2.0 */ -const { LoggerFactory } = require('../utils'); +import { LoggerFactory } from '../utils'; let ruleId; let logger; -module.exports = function etagHeaderExists(pathItem, options, context) { +export default function etagHeaderExists(pathItem, options, context) { if (!logger) { ruleId = context.rule.name; logger = LoggerFactory.getInstance().getLogger(ruleId); diff --git a/packages/ruleset/src/functions/index.js b/packages/ruleset/src/functions/index.js index 968bc427a..b301c08f2 100644 --- a/packages/ruleset/src/functions/index.js +++ b/packages/ruleset/src/functions/index.js @@ -3,84 +3,112 @@ * SPDX-License-Identifier: Apache2.0 */ -module.exports = { - acceptAndReturnModels: require('./accept-and-return-models'), - allowedKeywords: require('./allowed-keywords'), - anchoredPatterns: require('./anchored-patterns'), - apiSymmetry: require('./api-symmetry'), - arrayAttributes: require('./array-attributes'), - arrayOfArrays: require('./array-of-arrays'), - arrayResponses: require('./array-responses'), - avoidMultipleTypes: require('./avoid-multiple-types'), - binarySchemas: require('./binary-schemas'), - circularRefs: require('./circular-refs'), - collectionArrayProperty: require('./collection-array-property'), - consecutivePathSegments: require('./consecutive-path-segments'), - deleteBody: require('./delete-body'), - disallowedHeaderParameter: require('./disallowed-header-parameter'), - discriminatorPropertyExists: require('./discriminator-property-exists'), - duplicatePathParameter: require('./duplicate-path-parameter'), - enumCasingConvention: require('./enum-casing-convention'), - errorResponseSchemas: require('./error-response-schemas'), - etagHeaderExists: require('./etag-header-exists'), - inlineSchemas: require('./inline-schemas'), - integerAttributes: require('./integer-attributes'), - majorVersionInPath: require('./major-version-in-path'), - mergePatchProperties: require('./merge-patch-properties'), - noAmbiguousPaths: require('./no-ambiguous-paths'), - noNullableProperties: require('./no-nullable-properties'), - noOperationRequestBody: require('./no-operation-requestbody'), - noRefInExample: require('./no-ref-in-example'), - noSuperfluousAllOf: require('./no-superfluous-allof'), - noUnsupportedKeywords: require('./no-unsupported-keywords'), - operationIdCasingConvention: require('./operationid-casing-convention'), - operationIdNamingConvention: require('./operationid-naming-convention'), - operationSummaryExists: require('./operation-summary-exists'), - operationSummaryLength: require('./operation-summary-length'), - optionalRequestBody: require('./optional-request-body').optionalRequestBody, - optionalRequestBodyDeprecated: require('./optional-request-body') - .optionalRequestBodyDeprecated, - paginationStyle: require('./pagination-style'), - parameterCasingConvention: require('./parameter-casing-convention'), - parameterDefault: require('./parameter-default'), - parameterDescriptionExists: require('./parameter-description-exists'), - parameterOrder: require('./parameter-order'), - patchRequestContentType: require('./patch-request-content-type'), - pathParameterNotCRN: require('./path-parameter-not-crn'), - pathSegmentCasingConvention: require('./path-segment-casing-convention'), - patternPropertiesCheck: require('./pattern-properties'), - preconditionHeader: require('./precondition-header'), - preferTokenPagination: require('./prefer-token-pagination'), - propertyAttributes: require('./property-attributes'), - propertyCasingConvention: require('./property-casing-convention'), - propertyConsistentNameAndType: require('./property-consistent-name-and-type'), - propertyDescriptionExists: require('./property-description-exists'), - propertyNameCollision: require('./property-name-collision'), - redirectResponseBody: require('./redirect-response-body'), - refPattern: require('./ref-pattern'), - refSiblingDuplicateDescription: require('./ref-sibling-duplicate-description'), - requestAndResponseContent: require('./request-and-response-content'), - requestBodyName: require('./requestbody-name'), - requiredArrayPropertiesInResponse: require('./required-array-properties-in-response'), - requiredEnumPropertiesInResponse: require('./required-enum-properties-in-response'), - requiredProperty: require('./required-property'), - resourceResponseConsistency: require('./resource-response-consistency'), - responseExampleExists: require('./response-example-exists'), - responseStatusCodes: require('./response-status-codes'), - schemaCasingConvention: require('./schema-casing-convention'), - schemaDescriptionExists: require('./schema-description-exists'), - schemaNamingConvention: require('./schema-naming-convention'), - schemaOrContentProvided: require('./schema-or-content-provided'), - schemaTypeExists: require('./schema-type-exists'), - schemaTypeFormat: require('./schema-type-format'), - securitySchemeAttributes: require('./securityscheme-attributes'), - securitySchemes: require('./securityschemes'), - stringAttributes: require('./string-attributes'), - unevaluatedProperties: require('./unevaluated-properties'), - uniqueParameterRequestPropertyNames: require('./unique-parameter-request-property-names'), - unusedTags: require('./unused-tags'), - useDateBasedFormat: require('./use-date-based-format'), - validatePathSegments: require('./valid-path-segments'), - validSchemaExample: require('./valid-schema-example'), - wellDefinedDictionaries: require('./well-defined-dictionaries'), -}; +export const acceptAndReturnModels = require("./accept-and-return-models"); +export const allowedKeywords = require("./allowed-keywords"); +export const anchoredPatterns = require("./anchored-patterns"); +export const apiSymmetry = require("./api-symmetry"); +export const arrayAttributes = require("./array-attributes"); +export const arrayOfArrays = require("./array-of-arrays"); +export const arrayResponses = require("./array-responses"); +export const avoidMultipleTypes = require("./avoid-multiple-types"); +export const binarySchemas = require("./binary-schemas"); +export const circularRefs = require("./circular-refs"); +export const collectionArrayProperty = require("./collection-array-property"); +export const consecutivePathSegments = require("./consecutive-path-segments"); +export const deleteBody = require("./delete-body"); +export const disallowedHeaderParameter = require("./disallowed-header-parameter"); +export const discriminatorPropertyExists = require("./discriminator-property-exists"); +export const duplicatePathParameter = require("./duplicate-path-parameter"); +export const enumCasingConvention = require("./enum-casing-convention"); +export const errorResponseSchemas = require("./error-response-schemas"); +export const etagHeaderExists = require("./etag-header-exists"); +export const inlineSchemas = require("./inline-schemas").default; +export const integerAttributes = require("./integer-attributes").default; +export const majorVersionInPath = require("./major-version-in-path").default; +export const mergePatchProperties = require("./merge-patch-properties").default; +export const noAmbiguousPaths = require("./no-ambiguous-paths").default; +export const noNullableProperties = require("./no-nullable-properties").default; +export const noOperationRequestBody = + require("./no-operation-requestbody").default; +export const noRefInExample = require("./no-ref-in-example").default; +export const noSuperfluousAllOf = require("./no-superfluous-allof").default; +export const noUnsupportedKeywords = + require("./no-unsupported-keywords").default; +export const operationIdCasingConvention = + require("./operationid-casing-convention").default; +export const operationIdNamingConvention = + require("./operationid-naming-convention").default; +export const operationSummaryExists = + require("./operation-summary-exists").default; +export const operationSummaryLength = + require("./operation-summary-length").default; +export const optionalRequestBody = require("./optional-request-body").default + .optionalRequestBody; +export const optionalRequestBodyDeprecated = require("./optional-request-body") + .default.optionalRequestBodyDeprecated; +export const paginationStyle = require("./pagination-style").default; +export const parameterCasingConvention = + require("./parameter-casing-convention").default; +export const parameterDefault = require("./parameter-default").default; +export const parameterDescriptionExists = + require("./parameter-description-exists").default; +export const parameterOrder = require("./parameter-order").default; +export const patchRequestContentType = + require("./patch-request-content-type").default; +export const pathParameterNotCRN = require("./path-parameter-not-crn").default; +export const pathSegmentCasingConvention = + require("./path-segment-casing-convention").default; +export const patternPropertiesCheck = require("./pattern-properties").default; +export const preconditionHeader = require("./precondition-header").default; +export const preferTokenPagination = + require("./prefer-token-pagination").default; +export const propertyAttributes = require("./property-attributes").default; +export const propertyCasingConvention = + require("./property-casing-convention").default; +export const propertyConsistentNameAndType = + require("./property-consistent-name-and-type").default; +export const propertyDescriptionExists = + require("./property-description-exists").default; +export const propertyNameCollision = + require("./property-name-collision").default; +export const redirectResponseBody = require("./redirect-response-body").default; +export const refPattern = require("./ref-pattern").default; +export const refSiblingDuplicateDescription = + require("./ref-sibling-duplicate-description").default; +export const requestAndResponseContent = + require("./request-and-response-content").default; +export const requestBodyName = require("./requestbody-name").default; +export const requiredArrayPropertiesInResponse = + require("./required-array-properties-in-response").default; +export const requiredEnumPropertiesInResponse = + require("./required-enum-properties-in-response").default; +export const requiredProperty = require("./required-property").default; +export const resourceResponseConsistency = + require("./resource-response-consistency").default; +export const responseExampleExists = + require("./response-example-exists").default; +export const responseStatusCodes = require("./response-status-codes").default; +export const schemaCasingConvention = + require("./schema-casing-convention").default; +export const schemaDescriptionExists = + require("./schema-description-exists").default; +export const schemaNamingConvention = + require("./schema-naming-convention").default; +export const schemaOrContentProvided = + require("./schema-or-content-provided").default; +export const schemaTypeExists = require("./schema-type-exists").default; +export const schemaTypeFormat = require("./schema-type-format").default; +export const securitySchemeAttributes = + require("./securityscheme-attributes").default; +export const securitySchemes = require("./securityschemes").default; +export const stringAttributes = require("./string-attributes").default; +export const unevaluatedProperties = + require("./unevaluated-properties").default; +export const uniqueParameterRequestPropertyNames = + require("./unique-parameter-request-property-names").default; +export const unusedTags = require("./unused-tags").default; +export const useDateBasedFormat = require("./use-date-based-format").default; +export const validatePathSegments = require("./valid-path-segments").default; +export const validSchemaExample = require("./valid-schema-example").default; +export const wellDefinedDictionaries = + require("./well-defined-dictionaries").default; diff --git a/packages/ruleset/src/functions/inline-schemas.js b/packages/ruleset/src/functions/inline-schemas.js index 6a55ff257..1ebbbc6f7 100644 --- a/packages/ruleset/src/functions/inline-schemas.js +++ b/packages/ruleset/src/functions/inline-schemas.js @@ -3,17 +3,17 @@ * SPDX-License-Identifier: Apache2.0 */ -const { +import { isArraySchema, isPrimitiveSchema, validateSubschemas, -} = require('@ibm-cloud/openapi-ruleset-utilities'); +} from "@ibm-cloud/openapi-ruleset-utilities"; -const { +import { isJsonMimeType, isEmptyObjectSchema, isRefSiblingSchema, -} = require('../utils'); +} from "../utils"; /** * Checks to make sure that nested object schemas are defined using a $ref rather than @@ -33,7 +33,7 @@ const { * @param {*} path the array of path segments indicating the location of "schema" within the API definition * @returns an array containing the violations found or [] if no violations */ -module.exports = function (schema, options, { path }) { +export default function (schema, options, { path }) { return validateSubschemas(schema, path, checkForInlineObjectSchemas); }; diff --git a/packages/ruleset/src/functions/integer-attributes.js b/packages/ruleset/src/functions/integer-attributes.js index 2f53e0a10..881eedae4 100644 --- a/packages/ruleset/src/functions/integer-attributes.js +++ b/packages/ruleset/src/functions/integer-attributes.js @@ -3,16 +3,16 @@ * SPDX-License-Identifier: Apache2.0 */ -const { +import { isIntegerSchema, validateNestedSchemas, -} = require('@ibm-cloud/openapi-ruleset-utilities'); +} from "@ibm-cloud/openapi-ruleset-utilities"; -const { getCompositeSchemaAttribute, LoggerFactory } = require('../utils'); +import { getCompositeSchemaAttribute, LoggerFactory } from "../utils"; let ruleId; let logger; -module.exports = function (schema, _opts, context) { +export default function (schema, _opts, context) { if (!logger) { ruleId = context.rule.name; logger = LoggerFactory.getInstance().getLogger(ruleId); diff --git a/packages/ruleset/src/functions/major-version-in-path.js b/packages/ruleset/src/functions/major-version-in-path.js index 8c365d6e1..8b36c5740 100644 --- a/packages/ruleset/src/functions/major-version-in-path.js +++ b/packages/ruleset/src/functions/major-version-in-path.js @@ -3,12 +3,12 @@ * SPDX-License-Identifier: Apache2.0 */ -const { LoggerFactory } = require('../utils'); +import { LoggerFactory } from '../utils'; let ruleId; let logger; -module.exports = function (apiDef, _opts, context) { +export default function (apiDef, _opts, context) { if (!logger) { ruleId = context.rule.name; logger = LoggerFactory.getInstance().getLogger(ruleId); diff --git a/packages/ruleset/src/functions/merge-patch-properties.js b/packages/ruleset/src/functions/merge-patch-properties.js index 500308c7b..fbf0d5c54 100644 --- a/packages/ruleset/src/functions/merge-patch-properties.js +++ b/packages/ruleset/src/functions/merge-patch-properties.js @@ -3,13 +3,13 @@ * SPDX-License-Identifier: Apache2.0 */ -const { schemaHasConstraint } = require('@ibm-cloud/openapi-ruleset-utilities'); -const { LoggerFactory } = require('../utils'); +import { schemaHasConstraint } from '@ibm-cloud/openapi-ruleset-utilities'; +import { LoggerFactory } from '../utils'; let ruleId; let logger; -module.exports = function (schema, _opts, context) { +export default function (schema, _opts, context) { if (!logger) { ruleId = context.rule.name; logger = LoggerFactory.getInstance().getLogger(ruleId); diff --git a/packages/ruleset/src/functions/no-ambiguous-paths.js b/packages/ruleset/src/functions/no-ambiguous-paths.js index 1380c1d22..ef59c37b4 100644 --- a/packages/ruleset/src/functions/no-ambiguous-paths.js +++ b/packages/ruleset/src/functions/no-ambiguous-paths.js @@ -3,13 +3,13 @@ * SPDX-License-Identifier: Apache2.0 */ -const { isObject } = require('@ibm-cloud/openapi-ruleset-utilities'); -const { LoggerFactory } = require('../utils'); +import { isObject } from '@ibm-cloud/openapi-ruleset-utilities'; +import { LoggerFactory } from '../utils'; let ruleId; let logger; -module.exports = function (paths, _options, context) { +export default function (paths, _options, context) { if (!logger) { ruleId = context.rule.name; logger = LoggerFactory.getInstance().getLogger(ruleId); diff --git a/packages/ruleset/src/functions/no-nullable-properties.js b/packages/ruleset/src/functions/no-nullable-properties.js index ed5955240..b9f4eabbc 100644 --- a/packages/ruleset/src/functions/no-nullable-properties.js +++ b/packages/ruleset/src/functions/no-nullable-properties.js @@ -3,20 +3,20 @@ * SPDX-License-Identifier: Apache2.0 */ -const { +import { schemaHasConstraint, validateSubschemas, -} = require('@ibm-cloud/openapi-ruleset-utilities'); -const { +} from "@ibm-cloud/openapi-ruleset-utilities"; +import { isMergePatchMimeType, LoggerFactory, operationMethods, -} = require('../utils'); +} from "../utils"; let ruleId; let logger; -module.exports = function (schema, _options, context) { +export default function (schema, _options, context) { if (!logger) { ruleId = context.rule.name; logger = LoggerFactory.getInstance().getLogger(ruleId); diff --git a/packages/ruleset/src/functions/no-operation-requestbody.js b/packages/ruleset/src/functions/no-operation-requestbody.js index be2a9ec85..b6fba2cc8 100644 --- a/packages/ruleset/src/functions/no-operation-requestbody.js +++ b/packages/ruleset/src/functions/no-operation-requestbody.js @@ -3,12 +3,12 @@ * SPDX-License-Identifier: Apache2.0 */ -const { LoggerFactory } = require('../utils'); +import { LoggerFactory } from '../utils'; let ruleId; let logger; -module.exports = function (operation, options, context) { +export default function (operation, options, context) { if (!logger) { ruleId = context.rule.name; logger = LoggerFactory.getInstance().getLogger(ruleId); diff --git a/packages/ruleset/src/functions/no-ref-in-example.js b/packages/ruleset/src/functions/no-ref-in-example.js index ef85a94cc..8856e3ebf 100644 --- a/packages/ruleset/src/functions/no-ref-in-example.js +++ b/packages/ruleset/src/functions/no-ref-in-example.js @@ -3,13 +3,13 @@ * SPDX-License-Identifier: Apache2.0 */ -const { isObject } = require('@ibm-cloud/openapi-ruleset-utilities'); -const { LoggerFactory } = require('../utils'); +import { isObject } from '@ibm-cloud/openapi-ruleset-utilities'; +import { LoggerFactory } from '../utils'; let ruleId; let logger; -module.exports = function (exampleObj, options, context) { +export default function (exampleObj, options, context) { if (!logger) { ruleId = context.rule.name; logger = LoggerFactory.getInstance().getLogger(ruleId); diff --git a/packages/ruleset/src/functions/no-superfluous-allof.js b/packages/ruleset/src/functions/no-superfluous-allof.js index 1960b7b8e..87d4018c2 100644 --- a/packages/ruleset/src/functions/no-superfluous-allof.js +++ b/packages/ruleset/src/functions/no-superfluous-allof.js @@ -3,13 +3,13 @@ * SPDX-License-Identifier: Apache2.0 */ -const { validateSubschemas } = require('@ibm-cloud/openapi-ruleset-utilities'); -const { LoggerFactory } = require('../utils'); +import { validateSubschemas } from '@ibm-cloud/openapi-ruleset-utilities'; +import { LoggerFactory } from '../utils'; let ruleId; let logger; -module.exports = function (schema, _opts, context) { +export default function (schema, _opts, context) { if (!logger) { ruleId = context.rule.name; logger = LoggerFactory.getInstance().getLogger(ruleId); diff --git a/packages/ruleset/src/functions/no-unsupported-keywords.js b/packages/ruleset/src/functions/no-unsupported-keywords.js index f357be307..869566ede 100644 --- a/packages/ruleset/src/functions/no-unsupported-keywords.js +++ b/packages/ruleset/src/functions/no-unsupported-keywords.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -const { LoggerFactory } = require('../utils'); +import { LoggerFactory } from '../utils'; let ruleId; let logger; @@ -11,7 +11,7 @@ let logger; const ErrorMsg = 'An unsupported OpenAPI 3.1 keyword was found in the OpenAPI document:'; -module.exports = function (apidef, _opts, context) { +export default function (apidef, _opts, context) { if (!logger) { ruleId = context.rule.name; logger = LoggerFactory.getInstance().getLogger(ruleId); diff --git a/packages/ruleset/src/functions/operation-summary-exists.js b/packages/ruleset/src/functions/operation-summary-exists.js index 744691986..4006f4403 100644 --- a/packages/ruleset/src/functions/operation-summary-exists.js +++ b/packages/ruleset/src/functions/operation-summary-exists.js @@ -3,12 +3,12 @@ * SPDX-License-Identifier: Apache2.0 */ -const { LoggerFactory } = require('../utils'); +import { LoggerFactory } from '../utils'; let ruleId; let logger; -module.exports = function (operation, _opts, context) { +export default function (operation, _opts, context) { if (!logger) { ruleId = context.rule.name; logger = LoggerFactory.getInstance().getLogger(ruleId); diff --git a/packages/ruleset/src/functions/operation-summary-length.js b/packages/ruleset/src/functions/operation-summary-length.js index a499c3dd3..9d500dec5 100644 --- a/packages/ruleset/src/functions/operation-summary-length.js +++ b/packages/ruleset/src/functions/operation-summary-length.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -const { LoggerFactory } = require('../utils'); +import { LoggerFactory } from '../utils'; let ruleId; let logger; @@ -15,7 +15,7 @@ let logger; * - operation-summary: all operations define a non-empty summary */ -module.exports = function (summary, _opts, context) { +export default function (summary, _opts, context) { if (!logger) { ruleId = context.rule.name; logger = LoggerFactory.getInstance().getLogger(ruleId); diff --git a/packages/ruleset/src/functions/operationid-casing-convention.js b/packages/ruleset/src/functions/operationid-casing-convention.js index 074fde8da..8d775ad38 100644 --- a/packages/ruleset/src/functions/operationid-casing-convention.js +++ b/packages/ruleset/src/functions/operationid-casing-convention.js @@ -3,14 +3,14 @@ * SPDX-License-Identifier: Apache2.0 */ -const { casing } = require('@stoplight/spectral-functions'); -const { LoggerFactory } = require('../utils'); +import { casing } from '@stoplight/spectral-functions'; +import { LoggerFactory } from '../utils'; let casingConfig; let ruleId; let logger; -module.exports = function (operation, options, context) { +export default function (operation, options, context) { // Save this rule's "functionOptions" value since we need // to pass it on to Spectral's "casing" function. casingConfig = options; diff --git a/packages/ruleset/src/functions/operationid-naming-convention.js b/packages/ruleset/src/functions/operationid-naming-convention.js index faa4ad59a..4dff2f035 100644 --- a/packages/ruleset/src/functions/operationid-naming-convention.js +++ b/packages/ruleset/src/functions/operationid-naming-convention.js @@ -3,11 +3,11 @@ * SPDX-License-Identifier: Apache2.0 */ -const { each, merge, pickBy, reduce } = require('lodash'); -const { operationMethods } = require('../utils'); -const inflected = require('inflected'); +import { each, merge, pickBy, reduce } from "lodash"; +import { operationMethods } from "../utils"; +import { singularize } from "inflected"; -module.exports = function (rootDocument, options) { +export default function (rootDocument, options) { return operationIdNamingConvention(rootDocument, options.strict); }; @@ -227,7 +227,7 @@ function operationIdPassedConventionCheck( // Singularize the words in the path according to the naming conventions. for (let i = 0; i < convertedPath.length; i++) { if (i !== convertedPath.length - 1 || !isPlural || pathEndsWithParam) - convertedPath[i] = inflected.singularize(convertedPath[i]); + convertedPath[i] = singularize(convertedPath[i]); } const correctIds = []; diff --git a/packages/ruleset/src/functions/optional-request-body.js b/packages/ruleset/src/functions/optional-request-body.js index e0993aff2..7e4a32f24 100644 --- a/packages/ruleset/src/functions/optional-request-body.js +++ b/packages/ruleset/src/functions/optional-request-body.js @@ -3,8 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { getCompositeSchemaAttribute } = require('../utils'); -const { LoggerFactory } = require('../utils'); +import { getCompositeSchemaAttribute } from '../utils'; +import { LoggerFactory } from '../utils'; const oldRuleId = 'ibm-no-optional-properties-in-required-body'; const newRuleId = 'ibm-no-required-properties-in-optional-body'; @@ -69,7 +69,7 @@ function optionalRequestBodyDeprecated(schema, _unused_options, context) { return optionalRequestBody(schema, _unused_options, context); } -module.exports = { +export default { optionalRequestBody, optionalRequestBodyDeprecated, }; diff --git a/packages/ruleset/src/functions/pagination-style.js b/packages/ruleset/src/functions/pagination-style.js index 461f72d60..1d1be6d60 100644 --- a/packages/ruleset/src/functions/pagination-style.js +++ b/packages/ruleset/src/functions/pagination-style.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -const { +import { mergeAllOfSchemaProperties, LoggerFactory, getOffsetParamIndex, @@ -11,16 +11,16 @@ const { getSuccessCode, getResponseSchema, getPaginatedOperationFromPath, -} = require('../utils'); -const { +} from "../utils"; +import { isIntegerSchema, isStringSchema, -} = require('@ibm-cloud/openapi-ruleset-utilities'); +} from "@ibm-cloud/openapi-ruleset-utilities"; let ruleId; let logger; -module.exports = function (pathObj, _opts, context) { +export default function (pathObj, _opts, context) { if (!logger) { ruleId = context.rule.name; logger = LoggerFactory.getInstance().getLogger(ruleId); diff --git a/packages/ruleset/src/functions/parameter-casing-convention.js b/packages/ruleset/src/functions/parameter-casing-convention.js index abb4390f9..de5f4c117 100644 --- a/packages/ruleset/src/functions/parameter-casing-convention.js +++ b/packages/ruleset/src/functions/parameter-casing-convention.js @@ -3,8 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { casing, pattern } = require('@stoplight/spectral-functions'); -const { isDeprecated, LoggerFactory } = require('../utils'); +import { casing, pattern } from "@stoplight/spectral-functions"; +import { isDeprecated, LoggerFactory } from "../utils"; // Error message prefix for each parameter type. const errorMsgPrefix = { @@ -19,7 +19,7 @@ const errorMsgNoIn = "Parameters must have a valid 'in' value"; let ruleId; let logger; -module.exports = function (param, options, context) { +export default function (param, options, context) { if (!logger) { ruleId = context.rule.name; logger = LoggerFactory.getInstance().getLogger(ruleId); diff --git a/packages/ruleset/src/functions/parameter-default.js b/packages/ruleset/src/functions/parameter-default.js index 151bf5985..6d49011d5 100644 --- a/packages/ruleset/src/functions/parameter-default.js +++ b/packages/ruleset/src/functions/parameter-default.js @@ -3,12 +3,12 @@ * SPDX-License-Identifier: Apache2.0 */ -const { LoggerFactory } = require('../utils'); +import { LoggerFactory } from '../utils'; let ruleId; let logger; -module.exports = function (param, _opts, context) { +export default function (param, _opts, context) { if (!logger) { ruleId = context.rule.name; logger = LoggerFactory.getInstance().getLogger(ruleId); diff --git a/packages/ruleset/src/functions/parameter-description-exists.js b/packages/ruleset/src/functions/parameter-description-exists.js index 9b7b35626..2dd672091 100644 --- a/packages/ruleset/src/functions/parameter-description-exists.js +++ b/packages/ruleset/src/functions/parameter-description-exists.js @@ -3,12 +3,12 @@ * SPDX-License-Identifier: Apache2.0 */ -const { LoggerFactory } = require('../utils'); +import { LoggerFactory } from '../utils'; let ruleId; let logger; -module.exports = function (param, _opts, context) { +export default function (param, _opts, context) { if (!logger) { ruleId = context.rule.name; logger = LoggerFactory.getInstance().getLogger(ruleId); diff --git a/packages/ruleset/src/functions/parameter-order.js b/packages/ruleset/src/functions/parameter-order.js index c246c9747..f403f39e4 100644 --- a/packages/ruleset/src/functions/parameter-order.js +++ b/packages/ruleset/src/functions/parameter-order.js @@ -3,12 +3,12 @@ * SPDX-License-Identifier: Apache2.0 */ -const { LoggerFactory } = require('../utils'); +import { LoggerFactory } from '../utils'; let ruleId; let logger; -module.exports = function (operation, _opts, context) { +export default function (operation, _opts, context) { if (!logger) { ruleId = context.rule.name; logger = LoggerFactory.getInstance().getLogger(ruleId); diff --git a/packages/ruleset/src/functions/patch-request-content-type.js b/packages/ruleset/src/functions/patch-request-content-type.js index 1b3c8bafd..2c70bfacb 100644 --- a/packages/ruleset/src/functions/patch-request-content-type.js +++ b/packages/ruleset/src/functions/patch-request-content-type.js @@ -3,16 +3,16 @@ * SPDX-License-Identifier: Apache2.0 */ -const { +import { isJsonPatchMimeType, isMergePatchMimeType, LoggerFactory, -} = require('../utils'); +} from "../utils"; let ruleId; let logger; -module.exports = function (operation, _opts, context) { +export default function (operation, _opts, context) { if (!logger) { ruleId = context.rule.name; logger = LoggerFactory.getInstance().getLogger(ruleId); diff --git a/packages/ruleset/src/functions/path-parameter-not-crn.js b/packages/ruleset/src/functions/path-parameter-not-crn.js index 43e7e44a2..54aa06305 100644 --- a/packages/ruleset/src/functions/path-parameter-not-crn.js +++ b/packages/ruleset/src/functions/path-parameter-not-crn.js @@ -3,16 +3,13 @@ * SPDX-License-Identifier: Apache2.0 */ -const { - isStringSchema, - schemaHasConstraint, -} = require('@ibm-cloud/openapi-ruleset-utilities'); -const { LoggerFactory } = require('../utils'); +import { isStringSchema, schemaHasConstraint } from '@ibm-cloud/openapi-ruleset-utilities'; +import { LoggerFactory } from '../utils'; let ruleId; let logger; -module.exports = function (pathParam, _opts, context) { +export default function (pathParam, _opts, context) { if (!logger) { ruleId = context.rule.name; logger = LoggerFactory.getInstance().getLogger(ruleId); diff --git a/packages/ruleset/src/functions/path-segment-casing-convention.js b/packages/ruleset/src/functions/path-segment-casing-convention.js index 29f6e1065..f12d29192 100644 --- a/packages/ruleset/src/functions/path-segment-casing-convention.js +++ b/packages/ruleset/src/functions/path-segment-casing-convention.js @@ -3,14 +3,14 @@ * SPDX-License-Identifier: Apache2.0 */ -const { casing } = require('@stoplight/spectral-functions'); -const { LoggerFactory } = require('../utils'); +import { casing } from '@stoplight/spectral-functions'; +import { LoggerFactory } from '../utils'; let casingConfig; let ruleId; let logger; -module.exports = function (pathItem, options, context) { +export default function (pathItem, options, context) { // Save this rule's "functionOptions" value since we need // to pass it on to Spectral's "casing" function. casingConfig = options; diff --git a/packages/ruleset/src/functions/pattern-properties.js b/packages/ruleset/src/functions/pattern-properties.js index efb3c6bde..0c8a2a27b 100644 --- a/packages/ruleset/src/functions/pattern-properties.js +++ b/packages/ruleset/src/functions/pattern-properties.js @@ -3,16 +3,16 @@ * SPDX-License-Identifier: Apache2.0 */ -const { +import { isObject, validateSubschemas, -} = require('@ibm-cloud/openapi-ruleset-utilities'); -const { LoggerFactory } = require('../utils'); +} from "@ibm-cloud/openapi-ruleset-utilities"; +import { LoggerFactory } from "../utils"; let ruleId; let logger; -module.exports = function (schema, _opts, context) { +export default function (schema, _opts, context) { if (!logger) { ruleId = context.rule.name; logger = LoggerFactory.getInstance().getLogger(ruleId); diff --git a/packages/ruleset/src/functions/precondition-header.js b/packages/ruleset/src/functions/precondition-header.js index 960d1d0ef..8a156acd3 100644 --- a/packages/ruleset/src/functions/precondition-header.js +++ b/packages/ruleset/src/functions/precondition-header.js @@ -3,12 +3,12 @@ * SPDX-License-Identifier: Apache2.0 */ -const { LoggerFactory } = require('../utils'); +import { LoggerFactory } from '../utils'; let ruleId; let logger; -module.exports = function (operation, _opts, context) { +export default function (operation, _opts, context) { if (!logger) { ruleId = context.rule.name; logger = LoggerFactory.getInstance().getLogger(ruleId); diff --git a/packages/ruleset/src/functions/prefer-token-pagination.js b/packages/ruleset/src/functions/prefer-token-pagination.js index 8f1fb1323..224a8c0d3 100644 --- a/packages/ruleset/src/functions/prefer-token-pagination.js +++ b/packages/ruleset/src/functions/prefer-token-pagination.js @@ -3,16 +3,16 @@ * SPDX-License-Identifier: Apache2.0 */ -const { +import { getPaginatedOperationFromPath, getOffsetParamIndex, LoggerFactory, -} = require('../utils'); +} from "../utils"; let ruleId; let logger; -module.exports = function (pathObj, _opts, context) { +export default function (pathObj, _opts, context) { if (!logger) { ruleId = context.rule.name; logger = LoggerFactory.getInstance().getLogger(ruleId); diff --git a/packages/ruleset/src/functions/property-attributes.js b/packages/ruleset/src/functions/property-attributes.js index 21a4e4fbc..ea75e3bda 100644 --- a/packages/ruleset/src/functions/property-attributes.js +++ b/packages/ruleset/src/functions/property-attributes.js @@ -3,18 +3,18 @@ * SPDX-License-Identifier: Apache2.0 */ -const { +import { validateSubschemas, isBooleanSchema, isNumberSchema, isIntegerSchema, isObjectSchema, -} = require('@ibm-cloud/openapi-ruleset-utilities'); -const { LoggerFactory } = require('../utils'); +} from "@ibm-cloud/openapi-ruleset-utilities"; +import { LoggerFactory } from "../utils"; let ruleId; let logger; -module.exports = function (schema, _opts, context) { +export default function (schema, _opts, context) { if (!logger) { ruleId = context.rule.name; logger = LoggerFactory.getInstance().getLogger(ruleId); diff --git a/packages/ruleset/src/functions/property-casing-convention.js b/packages/ruleset/src/functions/property-casing-convention.js index 6d1cb89f9..fce3d7314 100644 --- a/packages/ruleset/src/functions/property-casing-convention.js +++ b/packages/ruleset/src/functions/property-casing-convention.js @@ -3,15 +3,15 @@ * SPDX-License-Identifier: Apache2.0 */ -const { casing } = require('@stoplight/spectral-functions'); -const { validateSubschemas } = require('@ibm-cloud/openapi-ruleset-utilities'); -const { LoggerFactory } = require('../utils'); +import { casing } from '@stoplight/spectral-functions'; +import { validateSubschemas } from '@ibm-cloud/openapi-ruleset-utilities'; +import { LoggerFactory } from '../utils'; let casingConfig; let ruleId; let logger; -module.exports = function (schema, options, context) { +export default function (schema, options, context) { // Save this rule's "functionOptions" value since we need // to pass it on to Spectral's "casing" function. casingConfig = options; diff --git a/packages/ruleset/src/functions/property-consistent-name-and-type.js b/packages/ruleset/src/functions/property-consistent-name-and-type.js index 6f6c8f0e4..5055c714a 100644 --- a/packages/ruleset/src/functions/property-consistent-name-and-type.js +++ b/packages/ruleset/src/functions/property-consistent-name-and-type.js @@ -3,12 +3,12 @@ * SPDX-License-Identifier: Apache2.0 */ -const { +import { getSchemaType, validateSubschemas, SchemaType, -} = require('@ibm-cloud/openapi-ruleset-utilities'); -const { LoggerFactory } = require('../utils'); +} from "@ibm-cloud/openapi-ruleset-utilities"; +import { LoggerFactory } from "../utils"; // We need to look at properties across the entire API definition. // This will act as a global variable to hold all of the properties @@ -19,7 +19,7 @@ let excludedProperties; let ruleId; let logger; -module.exports = function (schema, options, context) { +export default function (schema, options, context) { excludedProperties = options.excludedProperties; if (!logger) { diff --git a/packages/ruleset/src/functions/property-description-exists.js b/packages/ruleset/src/functions/property-description-exists.js index 8cf1ae3d7..d4042446d 100644 --- a/packages/ruleset/src/functions/property-description-exists.js +++ b/packages/ruleset/src/functions/property-description-exists.js @@ -3,16 +3,16 @@ * SPDX-License-Identifier: Apache2.0 */ -const { +import { schemaHasConstraint, validateSubschemas, -} = require('@ibm-cloud/openapi-ruleset-utilities'); -const { LoggerFactory, isSchemaProperty } = require('../utils'); +} from "@ibm-cloud/openapi-ruleset-utilities"; +import { LoggerFactory, isSchemaProperty } from "../utils"; let ruleId; let logger; -module.exports = function (schema, _opts, context) { +export default function (schema, _opts, context) { if (!logger) { ruleId = context.rule.name; logger = LoggerFactory.getInstance().getLogger(ruleId); diff --git a/packages/ruleset/src/functions/property-name-collision.js b/packages/ruleset/src/functions/property-name-collision.js index b93484240..8544f0f21 100644 --- a/packages/ruleset/src/functions/property-name-collision.js +++ b/packages/ruleset/src/functions/property-name-collision.js @@ -3,13 +3,13 @@ * SPDX-License-Identifier: Apache2.0 */ -const { validateSubschemas } = require('@ibm-cloud/openapi-ruleset-utilities'); -const { LoggerFactory } = require('../utils'); +import { validateSubschemas } from '@ibm-cloud/openapi-ruleset-utilities'; +import { LoggerFactory } from '../utils'; let ruleId; let logger; -module.exports = function (schema, _opts, context) { +export default function (schema, _opts, context) { if (!logger) { ruleId = context.rule.name; logger = LoggerFactory.getInstance().getLogger(ruleId); diff --git a/packages/ruleset/src/functions/redirect-response-body.js b/packages/ruleset/src/functions/redirect-response-body.js index 4ba4eeabf..5651218cc 100644 --- a/packages/ruleset/src/functions/redirect-response-body.js +++ b/packages/ruleset/src/functions/redirect-response-body.js @@ -3,13 +3,13 @@ * SPDX-License-Identifier: Apache2.0 */ -const { getResolvedSpec } = require('@ibm-cloud/openapi-ruleset-utilities'); -const { LoggerFactory, getResponseCodes } = require('../utils'); +import { getResolvedSpec } from "@ibm-cloud/openapi-ruleset-utilities"; +import { LoggerFactory, getResponseCodes } from "../utils"; let ruleId; let logger; -module.exports = function (operation, _opts, context) { +export default function (operation, _opts, context) { if (!logger) { ruleId = context.rule.name; logger = LoggerFactory.getInstance().getLogger(ruleId); diff --git a/packages/ruleset/src/functions/ref-pattern.js b/packages/ruleset/src/functions/ref-pattern.js index d25a162cb..34238cfab 100644 --- a/packages/ruleset/src/functions/ref-pattern.js +++ b/packages/ruleset/src/functions/ref-pattern.js @@ -3,12 +3,12 @@ * SPDX-License-Identifier: Apache2.0 */ -const { LoggerFactory } = require('../utils'); +import { LoggerFactory } from '../utils'; let ruleId; let logger; -module.exports = function ($ref, _opts, context) { +export default function ($ref, _opts, context) { if (!logger) { ruleId = context.rule.name; logger = LoggerFactory.getInstance().getLogger(ruleId); diff --git a/packages/ruleset/src/functions/ref-sibling-duplicate-description.js b/packages/ruleset/src/functions/ref-sibling-duplicate-description.js index 73a7b3ba1..124e41026 100644 --- a/packages/ruleset/src/functions/ref-sibling-duplicate-description.js +++ b/packages/ruleset/src/functions/ref-sibling-duplicate-description.js @@ -3,13 +3,13 @@ * SPDX-License-Identifier: Apache2.0 */ -const { validateSubschemas } = require('@ibm-cloud/openapi-ruleset-utilities'); -const { LoggerFactory } = require('../utils'); +import { validateSubschemas } from '@ibm-cloud/openapi-ruleset-utilities'; +import { LoggerFactory } from '../utils'; let ruleId; let logger; -module.exports = function (schema, _opts, context) { +export default function (schema, _opts, context) { if (!logger) { ruleId = context.rule.name; logger = LoggerFactory.getInstance().getLogger(ruleId); diff --git a/packages/ruleset/src/functions/request-and-response-content.js b/packages/ruleset/src/functions/request-and-response-content.js index f061bd8b1..413f26e8e 100644 --- a/packages/ruleset/src/functions/request-and-response-content.js +++ b/packages/ruleset/src/functions/request-and-response-content.js @@ -3,14 +3,11 @@ * SPDX-License-Identifier: Apache2.0 */ -const { +import { isObject, getResolvedSpec, -} = require('@ibm-cloud/openapi-ruleset-utilities'); -const { - LoggerFactory, - pathHasMinimallyRepresentedResource, -} = require('../utils'); +} from "@ibm-cloud/openapi-ruleset-utilities"; +import { LoggerFactory, pathHasMinimallyRepresentedResource } from "../utils"; let ruleId; let logger; @@ -23,7 +20,7 @@ let logger; * */ -module.exports = function requestAndResponseContent( +export default function requestAndResponseContent( operation, options, context diff --git a/packages/ruleset/src/functions/requestbody-name.js b/packages/ruleset/src/functions/requestbody-name.js index 55af48465..80b9f9f12 100644 --- a/packages/ruleset/src/functions/requestbody-name.js +++ b/packages/ruleset/src/functions/requestbody-name.js @@ -3,16 +3,16 @@ * SPDX-License-Identifier: Apache2.0 */ -const { - isFormMimeType, - isRequestBodyExploded, - LoggerFactory, -} = require('../utils'); +import { + isFormMimeType, + isRequestBodyExploded, + LoggerFactory +} from "../utils"; let ruleId; let logger; -module.exports = function (operation, _opts, context) { +export default function (operation, _opts, context) { if (!logger) { ruleId = context.rule.name; logger = LoggerFactory.getInstance().getLogger(ruleId); diff --git a/packages/ruleset/src/functions/required-array-properties-in-response.js b/packages/ruleset/src/functions/required-array-properties-in-response.js index 01faa6bb3..f0f5c225b 100644 --- a/packages/ruleset/src/functions/required-array-properties-in-response.js +++ b/packages/ruleset/src/functions/required-array-properties-in-response.js @@ -3,17 +3,17 @@ * SPDX-License-Identifier: Apache2.0 */ -const { +import { isArraySchema, isObject, validateNestedSchemas, -} = require('@ibm-cloud/openapi-ruleset-utilities'); -const { LoggerFactory } = require('../utils'); +} from "@ibm-cloud/openapi-ruleset-utilities"; +import { LoggerFactory } from "../utils"; let ruleId; let logger; -module.exports = function (schema, _opts, context) { +export default function (schema, _opts, context) { if (!logger) { ruleId = context.rule.name; logger = LoggerFactory.getInstance().getLogger(ruleId); diff --git a/packages/ruleset/src/functions/required-enum-properties-in-response.js b/packages/ruleset/src/functions/required-enum-properties-in-response.js index aecf7131b..480e5b9b3 100644 --- a/packages/ruleset/src/functions/required-enum-properties-in-response.js +++ b/packages/ruleset/src/functions/required-enum-properties-in-response.js @@ -3,17 +3,17 @@ * SPDX-License-Identifier: Apache2.0 */ -const { +import { isEnumerationSchema, isObject, validateNestedSchemas, -} = require('@ibm-cloud/openapi-ruleset-utilities'); -const { LoggerFactory } = require('../utils'); +} from "@ibm-cloud/openapi-ruleset-utilities"; +import { LoggerFactory } from "../utils"; let ruleId; let logger; -module.exports = function (schema, _opts, context) { +export default function (schema, _opts, context) { if (!logger) { ruleId = context.rule.name; logger = LoggerFactory.getInstance().getLogger(ruleId); diff --git a/packages/ruleset/src/functions/required-property.js b/packages/ruleset/src/functions/required-property.js index 0a184357a..be31bec80 100644 --- a/packages/ruleset/src/functions/required-property.js +++ b/packages/ruleset/src/functions/required-property.js @@ -3,16 +3,16 @@ * SPDX-License-Identifier: Apache2.0 */ -const { +import { schemaHasProperty, validateSubschemas, -} = require('@ibm-cloud/openapi-ruleset-utilities'); -const { LoggerFactory } = require('../utils'); +} from "@ibm-cloud/openapi-ruleset-utilities"; +import { LoggerFactory } from "../utils"; let ruleId; let logger; -module.exports = function (schema, _opts, context) { +export default function (schema, _opts, context) { if (!logger) { ruleId = context.rule.name; logger = LoggerFactory.getInstance().getLogger(ruleId); diff --git a/packages/ruleset/src/functions/resource-response-consistency.js b/packages/ruleset/src/functions/resource-response-consistency.js index 2305fb8fb..213a65bf6 100644 --- a/packages/ruleset/src/functions/resource-response-consistency.js +++ b/packages/ruleset/src/functions/resource-response-consistency.js @@ -3,13 +3,13 @@ * SPDX-License-Identifier: Apache2.0 */ -const { isEqual } = require('lodash'); -const { +import { isEqual } from "lodash"; +import { isObject, getResolvedSpec, getNodes, -} = require('@ibm-cloud/openapi-ruleset-utilities'); -const { +} from "@ibm-cloud/openapi-ruleset-utilities"; +import { computeRefsAtPaths, getResourceSpecificSiblingPath, getResponseCodes, @@ -19,12 +19,12 @@ const { isJsonMimeType, isOperationOfType, LoggerFactory, -} = require('../utils'); +} from "../utils"; let ruleId; let logger; -module.exports = function (operation, _opts, context) { +export default function (operation, _opts, context) { if (!logger) { ruleId = context.rule.name; logger = LoggerFactory.getInstance().getLogger(ruleId); diff --git a/packages/ruleset/src/functions/response-example-exists.js b/packages/ruleset/src/functions/response-example-exists.js index 203fbfa49..56921d930 100644 --- a/packages/ruleset/src/functions/response-example-exists.js +++ b/packages/ruleset/src/functions/response-example-exists.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -module.exports = function (response) { +export default function (response) { if (!responseLevelExamples(response) && !schemaLevelExample(response)) { return [ { diff --git a/packages/ruleset/src/functions/response-status-codes.js b/packages/ruleset/src/functions/response-status-codes.js index 2be84577e..51181f8c1 100644 --- a/packages/ruleset/src/functions/response-status-codes.js +++ b/packages/ruleset/src/functions/response-status-codes.js @@ -3,20 +3,20 @@ * SPDX-License-Identifier: Apache2.0 */ -const { getResolvedSpec } = require('@ibm-cloud/openapi-ruleset-utilities'); -const { +import { getResolvedSpec } from "@ibm-cloud/openapi-ruleset-utilities"; +import { LoggerFactory, isCreateOperation, isOperationOfType, getResourceSpecificSiblingPath, getResponseCodes, pathHasMinimallyRepresentedResource, -} = require('../utils'); +} from "../utils"; let ruleId; let logger; -module.exports = function (operation, _opts, context) { +export default function (operation, _opts, context) { if (!logger) { ruleId = context.rule.name; logger = LoggerFactory.getInstance().getLogger(ruleId); diff --git a/packages/ruleset/src/functions/schema-casing-convention.js b/packages/ruleset/src/functions/schema-casing-convention.js index f971b4a70..5d0799060 100644 --- a/packages/ruleset/src/functions/schema-casing-convention.js +++ b/packages/ruleset/src/functions/schema-casing-convention.js @@ -3,9 +3,9 @@ * SPDX-License-Identifier: Apache2.0 */ -const { isObject } = require('@ibm-cloud/openapi-ruleset-utilities'); -const { pattern } = require('@stoplight/spectral-functions'); -const { LoggerFactory } = require('../utils'); +import { isObject } from '@ibm-cloud/openapi-ruleset-utilities'; +import { pattern } from '@stoplight/spectral-functions'; +import { LoggerFactory } from '../utils'; let patternConfig; let ruleId; @@ -18,7 +18,7 @@ let logger; * - ibm-avoid-inline-schemas: all relevant schemas are named (defined with references) */ -module.exports = function (components, options, context) { +export default function (components, options, context) { // Save this rule's "functionOptions" value since we need // to pass it on to Spectral's "pattern" function. patternConfig = options; diff --git a/packages/ruleset/src/functions/schema-description-exists.js b/packages/ruleset/src/functions/schema-description-exists.js index 011629628..0c22139d2 100644 --- a/packages/ruleset/src/functions/schema-description-exists.js +++ b/packages/ruleset/src/functions/schema-description-exists.js @@ -3,16 +3,16 @@ * SPDX-License-Identifier: Apache2.0 */ -const { +import { validateSubschemas, schemaHasConstraint, -} = require('@ibm-cloud/openapi-ruleset-utilities'); -const { LoggerFactory, isPrimarySchema } = require('../utils'); +} from "@ibm-cloud/openapi-ruleset-utilities"; +import { LoggerFactory, isPrimarySchema } from "../utils"; let ruleId; let logger; -module.exports = function (schema, _opts, context) { +export default function (schema, _opts, context) { if (!logger) { ruleId = context.rule.name; logger = LoggerFactory.getInstance().getLogger(ruleId); diff --git a/packages/ruleset/src/functions/schema-naming-convention.js b/packages/ruleset/src/functions/schema-naming-convention.js index 125ff32b3..4264d07d0 100644 --- a/packages/ruleset/src/functions/schema-naming-convention.js +++ b/packages/ruleset/src/functions/schema-naming-convention.js @@ -3,12 +3,12 @@ * SPDX-License-Identifier: Apache2.0 */ -const { +import { schemaHasProperty, getNodes, -} = require('@ibm-cloud/openapi-ruleset-utilities'); +} from "@ibm-cloud/openapi-ruleset-utilities"; -const { +import { LoggerFactory, computeRefsAtPaths, getCanonicalSchemaForPath, @@ -16,7 +16,7 @@ const { getResourceOrientedPaths, getSchemaNameAtPath, getSuccessResponseSchemaForOperation, -} = require('../utils'); +} from "../utils"; let ruleId; let logger; @@ -38,7 +38,7 @@ let logger; * - ibm-schema-casing-convention: schema names use upper camel case */ -module.exports = function schemaNames(apidef, options, context) { +export default function schemaNames(apidef, options, context) { if (!logger) { ruleId = context.rule.name; logger = LoggerFactory.getInstance().getLogger(ruleId); diff --git a/packages/ruleset/src/functions/schema-or-content-provided.js b/packages/ruleset/src/functions/schema-or-content-provided.js index 5c661b4b5..ba2646f5a 100644 --- a/packages/ruleset/src/functions/schema-or-content-provided.js +++ b/packages/ruleset/src/functions/schema-or-content-provided.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -module.exports = function (obj) { +export default function (obj) { if (!obj.schema && !obj.content) { return [ { diff --git a/packages/ruleset/src/functions/schema-type-exists.js b/packages/ruleset/src/functions/schema-type-exists.js index 38793896d..ff9467dcf 100644 --- a/packages/ruleset/src/functions/schema-type-exists.js +++ b/packages/ruleset/src/functions/schema-type-exists.js @@ -3,13 +3,13 @@ * SPDX-License-Identifier: Apache2.0 */ -const { validateSubschemas } = require('@ibm-cloud/openapi-ruleset-utilities'); -const { LoggerFactory, mergeAllOfSchemaProperties } = require('../utils'); +import { validateSubschemas } from "@ibm-cloud/openapi-ruleset-utilities"; +import { LoggerFactory, mergeAllOfSchemaProperties } from "../utils"; let ruleId; let logger; -module.exports = function (schema, _opts, context) { +export default function (schema, _opts, context) { if (!logger) { ruleId = context.rule.name; logger = LoggerFactory.getInstance().getLogger(ruleId); diff --git a/packages/ruleset/src/functions/schema-type-format.js b/packages/ruleset/src/functions/schema-type-format.js index 9c18cc8e9..597a7b091 100644 --- a/packages/ruleset/src/functions/schema-type-format.js +++ b/packages/ruleset/src/functions/schema-type-format.js @@ -3,8 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { validateSubschemas } = require('@ibm-cloud/openapi-ruleset-utilities'); -const { LoggerFactory } = require('../utils'); +import { validateSubschemas } from '@ibm-cloud/openapi-ruleset-utilities'; +import { LoggerFactory } from '../utils'; // Valid schema types. const validTypes = [ @@ -52,7 +52,7 @@ const stringFormatErrorMsg = `Schema of type string should use one of the follow let ruleId; let logger; -module.exports = function (schema, _opts, context) { +export default function (schema, _opts, context) { if (!logger) { ruleId = context.rule.name; logger = LoggerFactory.getInstance().getLogger(ruleId); diff --git a/packages/ruleset/src/functions/securityscheme-attributes.js b/packages/ruleset/src/functions/securityscheme-attributes.js index e529c3717..32b18f5f3 100644 --- a/packages/ruleset/src/functions/securityscheme-attributes.js +++ b/packages/ruleset/src/functions/securityscheme-attributes.js @@ -3,13 +3,13 @@ * SPDX-License-Identifier: Apache2.0 */ -const stringValidator = require('validator'); -const { LoggerFactory } = require('../utils'); +import { isURL } from 'validator'; +import { LoggerFactory } from '../utils'; let ruleId; let logger; -module.exports = function (securityScheme, _opts, context) { +export default function (securityScheme, _opts, context) { if (!logger) { ruleId = context.rule.name; logger = LoggerFactory.getInstance().getLogger(ruleId); @@ -276,5 +276,5 @@ function isValidUrl(url, serviceUrl) { } } - return stringValidator.isURL(url); + return isURL(url); } diff --git a/packages/ruleset/src/functions/securityschemes.js b/packages/ruleset/src/functions/securityschemes.js index 09df67ed0..7cf305403 100644 --- a/packages/ruleset/src/functions/securityschemes.js +++ b/packages/ruleset/src/functions/securityschemes.js @@ -3,12 +3,12 @@ * SPDX-License-Identifier: Apache2.0 */ -const { LoggerFactory, operationMethods } = require('../utils'); +import { LoggerFactory, operationMethods } from '../utils'; let ruleId; let logger; -module.exports = function (rootDocument, _opts, context) { +export default function (rootDocument, _opts, context) { if (!logger) { ruleId = context.rule.name; logger = LoggerFactory.getInstance().getLogger(ruleId); diff --git a/packages/ruleset/src/functions/string-attributes.js b/packages/ruleset/src/functions/string-attributes.js index ce380d260..a09f8cdd2 100644 --- a/packages/ruleset/src/functions/string-attributes.js +++ b/packages/ruleset/src/functions/string-attributes.js @@ -3,17 +3,17 @@ * SPDX-License-Identifier: Apache2.0 */ -const { +import { schemaHasConstraint, isStringSchema, validateNestedSchemas, -} = require('@ibm-cloud/openapi-ruleset-utilities'); +} from "@ibm-cloud/openapi-ruleset-utilities"; -const { getCompositeSchemaAttribute, LoggerFactory } = require('../utils'); +import { getCompositeSchemaAttribute, LoggerFactory } from "../utils"; let ruleId; let logger; -module.exports = function (schema, _opts, context) { +export default function (schema, _opts, context) { if (!logger) { ruleId = context.rule.name; logger = LoggerFactory.getInstance().getLogger(ruleId); diff --git a/packages/ruleset/src/functions/unevaluated-properties.js b/packages/ruleset/src/functions/unevaluated-properties.js index 04513675b..7f992cdcd 100644 --- a/packages/ruleset/src/functions/unevaluated-properties.js +++ b/packages/ruleset/src/functions/unevaluated-properties.js @@ -3,13 +3,13 @@ * SPDX-License-Identifier: Apache2.0 */ -const { validateSubschemas } = require('@ibm-cloud/openapi-ruleset-utilities'); -const { LoggerFactory } = require('../utils'); +import { validateSubschemas } from '@ibm-cloud/openapi-ruleset-utilities'; +import { LoggerFactory } from '../utils'; let ruleId; let logger; -module.exports = function (schema, _opts, context) { +export default function (schema, _opts, context) { if (!logger) { ruleId = context.rule.name; logger = LoggerFactory.getInstance().getLogger(ruleId); diff --git a/packages/ruleset/src/functions/unique-parameter-request-property-names.js b/packages/ruleset/src/functions/unique-parameter-request-property-names.js index c5f6c4c47..972b19b94 100644 --- a/packages/ruleset/src/functions/unique-parameter-request-property-names.js +++ b/packages/ruleset/src/functions/unique-parameter-request-property-names.js @@ -3,23 +3,23 @@ * SPDX-License-Identifier: Apache2.0 */ -const { +import { isObject, schemaHasConstraint, -} = require('@ibm-cloud/openapi-ruleset-utilities'); +} from "@ibm-cloud/openapi-ruleset-utilities"; -const { +import { isJsonMimeType, isJsonPatchMimeType, isMergePatchMimeType, LoggerFactory, operationMethods, -} = require('../utils'); +} from "../utils"; let ruleId; let logger; -module.exports = function (pathItem, _opts, context) { +export default function (pathItem, _opts, context) { if (!logger) { ruleId = context.rule.name; logger = LoggerFactory.getInstance().getLogger(ruleId); diff --git a/packages/ruleset/src/functions/unused-tags.js b/packages/ruleset/src/functions/unused-tags.js index 4ee883087..7ae6d37db 100644 --- a/packages/ruleset/src/functions/unused-tags.js +++ b/packages/ruleset/src/functions/unused-tags.js @@ -3,12 +3,12 @@ * SPDX-License-Identifier: Apache2.0 */ -const { LoggerFactory, operationMethods } = require('../utils'); +import { LoggerFactory, operationMethods } from '../utils'; let ruleId; let logger; -module.exports = function (rootDocument, _opts, context) { +export default function (rootDocument, _opts, context) { if (!logger) { ruleId = context.rule.name; logger = LoggerFactory.getInstance().getLogger(ruleId); diff --git a/packages/ruleset/src/functions/use-date-based-format.js b/packages/ruleset/src/functions/use-date-based-format.js index 47ca1f53b..a09a8f1cc 100644 --- a/packages/ruleset/src/functions/use-date-based-format.js +++ b/packages/ruleset/src/functions/use-date-based-format.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -const { +import { getExamplesForSchema, isDateSchema, isDateTimeSchema, @@ -12,9 +12,9 @@ const { isStringSchema, validateNestedSchemas, getResolvedSpec, -} = require('@ibm-cloud/openapi-ruleset-utilities'); +} from "@ibm-cloud/openapi-ruleset-utilities"; -const { +import { LoggerFactory, isDateBasedName, isDateBasedValue, @@ -23,7 +23,7 @@ const { isRequestBodySchema, isResponseSchema, isSchemaProperty, -} = require('../utils'); +} from "../utils"; let ruleId; let logger; @@ -40,7 +40,7 @@ let logger; * with that check in this rule - we recommend either "date" or "date-time". */ -module.exports = function (schema, _opts, context) { +export default function (schema, _opts, context) { if (!logger) { ruleId = context.rule.name; logger = LoggerFactory.getInstance().getLogger(ruleId); diff --git a/packages/ruleset/src/functions/valid-path-segments.js b/packages/ruleset/src/functions/valid-path-segments.js index a1d49a01c..1fc90b834 100644 --- a/packages/ruleset/src/functions/valid-path-segments.js +++ b/packages/ruleset/src/functions/valid-path-segments.js @@ -3,12 +3,12 @@ * SPDX-License-Identifier: Apache2.0 */ -const { LoggerFactory } = require('../utils'); +import { LoggerFactory } from '../utils'; let ruleId; let logger; -module.exports = function (pathItem, options, context) { +export default function (pathItem, options, context) { if (!logger) { ruleId = context.rule.name; logger = LoggerFactory.getInstance().getLogger(ruleId); diff --git a/packages/ruleset/src/functions/valid-schema-example.js b/packages/ruleset/src/functions/valid-schema-example.js index eb53d3e67..06f9d0431 100644 --- a/packages/ruleset/src/functions/valid-schema-example.js +++ b/packages/ruleset/src/functions/valid-schema-example.js @@ -3,14 +3,14 @@ * SPDX-License-Identifier: Apache2.0 */ -const { validate } = require('jsonschema'); -const { validateSubschemas } = require('@ibm-cloud/openapi-ruleset-utilities'); -const { nestedSchemaKeys, LoggerFactory } = require('../utils'); +import { validate } from 'jsonschema'; +import { validateSubschemas } from '@ibm-cloud/openapi-ruleset-utilities'; +import { nestedSchemaKeys, LoggerFactory } from '../utils'; let ruleId; let logger; -module.exports = function (schema, _opts, context) { +export default function (schema, _opts, context) { if (!logger) { ruleId = context.rule.name; logger = LoggerFactory.getInstance().getLogger(ruleId); diff --git a/packages/ruleset/src/functions/well-defined-dictionaries.js b/packages/ruleset/src/functions/well-defined-dictionaries.js index cde853c50..c5169aa6a 100644 --- a/packages/ruleset/src/functions/well-defined-dictionaries.js +++ b/packages/ruleset/src/functions/well-defined-dictionaries.js @@ -3,13 +3,13 @@ * SPDX-License-Identifier: Apache2.0 */ -const { +import { isObject, isObjectSchema, schemaHasConstraint, validateNestedSchemas, -} = require('@ibm-cloud/openapi-ruleset-utilities'); -const { LoggerFactory } = require('../utils'); +} from "@ibm-cloud/openapi-ruleset-utilities"; +import { LoggerFactory } from "../utils"; let ruleId; let logger; @@ -21,7 +21,7 @@ let logger; * - ibm-pattern-properties: patternProperties isn't empty or the wrong type */ -module.exports = function (schema, _opts, context) { +export default function (schema, _opts, context) { if (!logger) { ruleId = context.rule.name; logger = LoggerFactory.getInstance().getLogger(ruleId); diff --git a/packages/utilities/package.json b/packages/utilities/package.json index b05371d12..693867b7b 100644 --- a/packages/utilities/package.json +++ b/packages/utilities/package.json @@ -1,10 +1,11 @@ { "name": "@ibm-cloud/openapi-ruleset-utilities", + "type": "module", "description": "Programmatic utility functions for creating Spectral-formatted OpenAPI Rulesets", "version": "1.9.1", "license": "Apache-2.0", "private": false, - "main": "./src/index.js", + "exports": "./src/index.js", "types": "./types/index.d.ts", "repository": { "type": "git", diff --git a/packages/utilities/src/utils/schema-path.js b/packages/utilities/src/utils/schema-path.js index 9756576a4..509be4e13 100644 --- a/packages/utilities/src/utils/schema-path.js +++ b/packages/utilities/src/utils/schema-path.js @@ -3,9 +3,6 @@ * SPDX-License-Identifier: Apache2.0 */ -// Necessary to get exceptions thrown for attempts to modify frozen objects -'use strict'; - /** * @private */ diff --git a/packages/utilities/test/schema-path.test.js b/packages/utilities/test/schema-path.test.js index ec6ee0714..90fd9cf32 100644 --- a/packages/utilities/test/schema-path.test.js +++ b/packages/utilities/test/schema-path.test.js @@ -3,9 +3,6 @@ * SPDX-License-Identifier: Apache2.0 */ -// Necessary to get exceptions thrown for attempts to modify frozen objects -'use strict'; - const SchemaPath = require('../src/utils/schema-path'); describe('Utility class: SchemaPath', () => { diff --git a/packages/validator/package.json b/packages/validator/package.json index 0e56dbdd2..7425d61f3 100644 --- a/packages/validator/package.json +++ b/packages/validator/package.json @@ -1,5 +1,6 @@ { "name": "ibm-openapi-validator", + "type": "module", "description": "Configurable and extensible validator/linter for OpenAPI documents", "version": "1.37.13", "private": false, From eae27be147f6891e9035864169b7dff1eade87d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=ADdia=20Tarcza?= <100163235+diatrcz@users.noreply.github.com> Date: Thu, 11 Jun 2026 10:37:24 +0200 Subject: [PATCH 04/16] build: esm config ruleset rules MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Lídia Tarcza <100163235+diatrcz@users.noreply.github.com> --- .../src/rules/accept-and-return-models.js | 27 ++- packages/ruleset/src/rules/accept-header.js | 29 ++- .../ruleset/src/rules/anchored-patterns.js | 26 ++- packages/ruleset/src/rules/api-symmetry.js | 24 ++- .../ruleset/src/rules/array-attributes.js | 27 ++- packages/ruleset/src/rules/array-of-arrays.js | 27 ++- packages/ruleset/src/rules/array-responses.js | 28 ++- .../ruleset/src/rules/authorization-header.js | 30 ++- .../ruleset/src/rules/avoid-multiple-types.js | 28 ++- packages/ruleset/src/rules/binary-schemas.js | 28 ++- packages/ruleset/src/rules/circular-refs.js | 23 ++- .../src/rules/collection-array-property.js | 26 ++- .../src/rules/consecutive-path-segments.js | 28 ++- .../src/rules/content-contains-schema.js | 28 ++- .../ruleset/src/rules/content-type-header.js | 30 ++- .../src/rules/content-type-is-specific.js | 29 ++- packages/ruleset/src/rules/delete-body.js | 27 ++- .../rules/discriminator-property-exists.js | 27 ++- .../src/rules/duplicate-path-parameter.js | 25 ++- .../src/rules/enum-casing-convention.js | 29 ++- .../src/rules/error-content-type-is-json.js | 26 ++- .../src/rules/error-response-schemas.js | 26 ++- .../ruleset/src/rules/etag-header-exists.js | 28 ++- .../src/rules/examples-name-contains-space.js | 26 ++- .../ruleset/src/rules/ibm-sdk-operations.js | 29 ++- .../src/rules/if-modified-since-header.js | 32 ++- .../src/rules/if-unmodified-since-header.js | 32 ++- packages/ruleset/src/rules/index.js | 186 +++++++++--------- packages/ruleset/src/rules/inline-schemas.js | 27 ++- .../ruleset/src/rules/integer-attributes.js | 27 ++- .../src/rules/major-version-in-path.js | 22 +-- .../src/rules/merge-patch-properties.js | 30 ++- .../ruleset/src/rules/no-ambiguous-paths.js | 23 ++- .../src/rules/no-nullable-properties.js | 28 ++- .../src/rules/no-operation-requestbody.js | 33 ++-- .../ruleset/src/rules/no-ref-in-example.js | 23 ++- .../ruleset/src/rules/no-superfluous-allof.js | 25 ++- .../src/rules/no-unsupported-keywords.js | 24 ++- .../ruleset/src/rules/operation-responses.js | 29 ++- .../src/rules/operation-summary-exists.js | 24 +-- .../src/rules/operation-summary-length.js | 25 ++- .../rules/operationid-casing-convention.js | 29 ++- .../rules/operationid-naming-convention.js | 26 ++- .../rules/optional-request-body-deprecated.js | 26 ++- .../src/rules/optional-request-body.js | 26 ++- .../ruleset/src/rules/pagination-style.js | 27 ++- .../src/rules/parameter-casing-convention.js | 83 ++++---- .../ruleset/src/rules/parameter-default.js | 27 ++- .../src/rules/parameter-description-exists.js | 26 ++- packages/ruleset/src/rules/parameter-order.js | 28 ++- .../parameter-schema-or-content-exists.js | 22 +-- .../src/rules/patch-request-content-type.js | 28 ++- .../src/rules/path-parameter-not-crn.js | 30 ++- .../rules/path-segment-casing-convention.js | 29 ++- .../ruleset/src/rules/pattern-properties.js | 28 ++- .../ruleset/src/rules/precondition-header.js | 28 ++- .../src/rules/prefer-token-pagination.js | 28 ++- .../ruleset/src/rules/property-attributes.js | 28 ++- .../src/rules/property-casing-convention.js | 29 ++- .../property-consistent-name-and-type.js | 32 ++- .../src/rules/property-description-exists.js | 27 ++- .../src/rules/property-name-collision.js | 28 ++- .../src/rules/redirect-response-body.js | 28 ++- packages/ruleset/src/rules/ref-pattern.js | 22 +-- .../ref-sibling-duplicate-description.js | 28 ++- .../src/rules/request-and-response-content.js | 26 ++- .../src/rules/requestbody-is-object.js | 22 +-- .../ruleset/src/rules/requestbody-name.js | 28 ++- .../required-array-properties-in-response.js | 23 +-- .../required-enum-properties-in-response.js | 23 +-- .../src/rules/required-property-missing.js | 24 +-- .../rules/resource-response-consistency.js | 24 ++- .../src/rules/response-example-exists.js | 20 +- .../src/rules/response-status-codes.js | 28 ++- .../src/rules/schema-casing-convention.js | 25 ++- .../src/rules/schema-description-exists.js | 26 ++- packages/ruleset/src/rules/schema-keywords.js | 104 +++++----- .../src/rules/schema-naming-convention.js | 23 ++- .../ruleset/src/rules/schema-type-exists.js | 28 ++- .../ruleset/src/rules/schema-type-format.js | 28 ++- .../src/rules/securityscheme-attributes.js | 28 ++- packages/ruleset/src/rules/securityschemes.js | 23 ++- .../rules/server-variable-default-value.js | 20 +- .../ruleset/src/rules/string-attributes.js | 27 ++- .../src/rules/summary-sentence-style.js | 25 ++- packages/ruleset/src/rules/typed-enum.js | 18 +- .../src/rules/unevaluated-properties.js | 28 ++- ...unique-parameter-request-property-names.js | 28 ++- packages/ruleset/src/rules/unused-tags.js | 22 +-- .../src/rules/use-date-based-format.js | 28 ++- .../ruleset/src/rules/valid-path-segments.js | 27 ++- .../ruleset/src/rules/valid-schema-example.js | 28 ++- .../src/rules/well-defined-dictionaries.js | 28 ++- 93 files changed, 1244 insertions(+), 1522 deletions(-) diff --git a/packages/ruleset/src/rules/accept-and-return-models.js b/packages/ruleset/src/rules/accept-and-return-models.js index 731409674..3d8d99e85 100644 --- a/packages/ruleset/src/rules/accept-and-return-models.js +++ b/packages/ruleset/src/rules/accept-and-return-models.js @@ -3,21 +3,20 @@ * SPDX-License-Identifier: Apache2.0 */ -const { +import { responseSchemas, requestBodySchemas, -} = require('@ibm-cloud/openapi-ruleset-utilities/src/collections'); -const { oas3 } = require('@stoplight/spectral-formats'); -const { acceptAndReturnModels } = require('../functions'); +} from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; +import { oas3 } from "@stoplight/spectral-formats"; +import { acceptAndReturnModels } from "../functions"; -module.exports = { - description: 'Request and response bodies must be defined as model instances', - given: [...responseSchemas, ...requestBodySchemas], - message: '{{error}}', - severity: 'error', - formats: [oas3], - resolved: true, - then: { - function: acceptAndReturnModels, - }, +export const description = + "Request and response bodies must be defined as model instances"; +export const given = [...responseSchemas, ...requestBodySchemas]; +export const message = "{{error}}"; +export const severity = "error"; +export const formats = [oas3]; +export const resolved = true; +export const then = { + function: acceptAndReturnModels, }; diff --git a/packages/ruleset/src/rules/accept-header.js b/packages/ruleset/src/rules/accept-header.js index f382b2753..5418e6a0e 100644 --- a/packages/ruleset/src/rules/accept-header.js +++ b/packages/ruleset/src/rules/accept-header.js @@ -3,23 +3,18 @@ * SPDX-License-Identifier: Apache2.0 */ -const { - parameters, -} = require('@ibm-cloud/openapi-ruleset-utilities/src/collections'); -const { oas3 } = require('@stoplight/spectral-formats'); -const { disallowedHeaderParameter } = require('../functions'); +import { parameters } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; +import { oas3 } from '@stoplight/spectral-formats'; +import { disallowedHeaderParameter } from '../functions'; -module.exports = { - description: - 'Operations should not explicitly define the Accept header parameter', - message: '{{description}}', - formats: [oas3], - given: parameters, - severity: 'warn', - then: { - function: disallowedHeaderParameter, - functionOptions: { - headerName: 'Accept', - }, +export const description = 'Operations should not explicitly define the Accept header parameter'; +export const message = '{{description}}'; +export const formats = [oas3]; +export const given = parameters; +export const severity = 'warn'; +export const then = { + function: disallowedHeaderParameter, + functionOptions: { + headerName: 'Accept', }, }; diff --git a/packages/ruleset/src/rules/anchored-patterns.js b/packages/ruleset/src/rules/anchored-patterns.js index f88c8082e..13eacd8aa 100644 --- a/packages/ruleset/src/rules/anchored-patterns.js +++ b/packages/ruleset/src/rules/anchored-patterns.js @@ -3,20 +3,16 @@ * SPDX-License-Identifier: Apache2.0 */ -const { - schemas, -} = require('@ibm-cloud/openapi-ruleset-utilities/src/collections'); -const { oas3 } = require('@stoplight/spectral-formats'); -const { anchoredPatterns } = require('../functions'); +import { schemas } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; +import { oas3 } from "@stoplight/spectral-formats"; +import { anchoredPatterns } from "../functions"; -module.exports = { - description: 'Pattern attributes should be anchored with ^ and $', - message: '{{error}}', - severity: 'warn', - formats: [oas3], - resolved: true, - given: schemas, - then: { - function: anchoredPatterns, - }, +export const description = "Pattern attributes should be anchored with ^ and $"; +export const message = "{{error}}"; +export const severity = "warn"; +export const formats = [oas3]; +export const resolved = true; +export const given = schemas; +export const then = { + function: anchoredPatterns, }; diff --git a/packages/ruleset/src/rules/api-symmetry.js b/packages/ruleset/src/rules/api-symmetry.js index bfb554bae..c332d9097 100644 --- a/packages/ruleset/src/rules/api-symmetry.js +++ b/packages/ruleset/src/rules/api-symmetry.js @@ -3,18 +3,16 @@ * SPDX-License-Identifier: Apache2.0 */ -const { oas3 } = require('@stoplight/spectral-formats'); -const { apiSymmetry } = require('../functions'); +import { oas3 } from "@stoplight/spectral-formats"; +import { apiSymmetry } from "../functions"; -module.exports = { - description: - 'Variations of a resource schema should be graph fragments of the canonical schema', - message: '{{error}}', - given: ['$'], - severity: 'warn', - formats: [oas3], - resolved: true, - then: { - function: apiSymmetry, - }, +export const description = + "Variations of a resource schema should be graph fragments of the canonical schema"; +export const message = "{{error}}"; +export const given = ["$"]; +export const severity = "warn"; +export const formats = [oas3]; +export const resolved = true; +export const then = { + function: apiSymmetry, }; diff --git a/packages/ruleset/src/rules/array-attributes.js b/packages/ruleset/src/rules/array-attributes.js index 654449785..0adaad0e9 100644 --- a/packages/ruleset/src/rules/array-attributes.js +++ b/packages/ruleset/src/rules/array-attributes.js @@ -3,20 +3,17 @@ * SPDX-License-Identifier: Apache2.0 */ -const { - schemas, -} = require('@ibm-cloud/openapi-ruleset-utilities/src/collections'); -const { oas3 } = require('@stoplight/spectral-formats'); -const { arrayAttributes } = require('../functions'); +import { schemas } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; +import { oas3 } from "@stoplight/spectral-formats"; +import { arrayAttributes } from "../functions"; -module.exports = { - description: 'Array schemas should have certain attributes defined', - message: '{{error}}', - severity: 'warn', - formats: [oas3], - resolved: true, - given: schemas, - then: { - function: arrayAttributes, - }, +export const description = + "Array schemas should have certain attributes defined"; +export const message = "{{error}}"; +export const severity = "warn"; +export const formats = [oas3]; +export const resolved = true; +export const given = schemas; +export const then = { + function: arrayAttributes, }; diff --git a/packages/ruleset/src/rules/array-of-arrays.js b/packages/ruleset/src/rules/array-of-arrays.js index 8cbc49995..300f63708 100644 --- a/packages/ruleset/src/rules/array-of-arrays.js +++ b/packages/ruleset/src/rules/array-of-arrays.js @@ -3,20 +3,17 @@ * SPDX-License-Identifier: Apache2.0 */ -const { - schemas, -} = require('@ibm-cloud/openapi-ruleset-utilities/src/collections'); -const { oas3 } = require('@stoplight/spectral-formats'); -const { arrayOfArrays } = require('../functions'); +import { schemas } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; +import { oas3 } from "@stoplight/spectral-formats"; +import { arrayOfArrays } from "../functions"; -module.exports = { - description: 'Array schema with items of type array should be avoided', - message: '{{error}}', - given: schemas, - severity: 'warn', - formats: [oas3], - resolved: true, - then: { - function: arrayOfArrays, - }, +export const description = + "Array schema with items of type array should be avoided"; +export const message = "{{error}}"; +export const given = schemas; +export const severity = "warn"; +export const formats = [oas3]; +export const resolved = true; +export const then = { + function: arrayOfArrays, }; diff --git a/packages/ruleset/src/rules/array-responses.js b/packages/ruleset/src/rules/array-responses.js index 69fb7cf10..4d0e7a9b7 100644 --- a/packages/ruleset/src/rules/array-responses.js +++ b/packages/ruleset/src/rules/array-responses.js @@ -3,21 +3,17 @@ * SPDX-License-Identifier: Apache2.0 */ -const { - operations, -} = require('@ibm-cloud/openapi-ruleset-utilities/src/collections'); -const { oas3 } = require('@stoplight/spectral-formats'); -const { arrayResponses } = require('../functions'); +import { operations } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; +import { oas3 } from "@stoplight/spectral-formats"; +import { arrayResponses } from "../functions"; -module.exports = { - description: - 'Operations should not return an array as the top-level structure of a response.', - message: '{{error}}', - given: operations, - severity: 'error', - formats: [oas3], - resolved: true, - then: { - function: arrayResponses, - }, +export const description = + "Operations should not return an array as the top-level structure of a response."; +export const message = "{{error}}"; +export const given = operations; +export const severity = "error"; +export const formats = [oas3]; +export const resolved = true; +export const then = { + function: arrayResponses, }; diff --git a/packages/ruleset/src/rules/authorization-header.js b/packages/ruleset/src/rules/authorization-header.js index 4046dd852..ea3214510 100644 --- a/packages/ruleset/src/rules/authorization-header.js +++ b/packages/ruleset/src/rules/authorization-header.js @@ -3,23 +3,19 @@ * SPDX-License-Identifier: Apache2.0 */ -const { - parameters, -} = require('@ibm-cloud/openapi-ruleset-utilities/src/collections'); -const { oas3 } = require('@stoplight/spectral-formats'); -const { disallowedHeaderParameter } = require('../functions'); +import { parameters } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; +import { oas3 } from "@stoplight/spectral-formats"; +import { disallowedHeaderParameter } from "../functions"; -module.exports = { - description: - 'Operations should not explicitly define the Authorization header parameter', - message: '{{description}}', - formats: [oas3], - given: parameters, - severity: 'warn', - then: { - function: disallowedHeaderParameter, - functionOptions: { - headerName: 'Authorization', - }, +export const description = + "Operations should not explicitly define the Authorization header parameter"; +export const message = "{{description}}"; +export const formats = [oas3]; +export const given = parameters; +export const severity = "warn"; +export const then = { + function: disallowedHeaderParameter, + functionOptions: { + headerName: "Authorization", }, }; diff --git a/packages/ruleset/src/rules/avoid-multiple-types.js b/packages/ruleset/src/rules/avoid-multiple-types.js index 1ef5b29ef..d9dea6117 100644 --- a/packages/ruleset/src/rules/avoid-multiple-types.js +++ b/packages/ruleset/src/rules/avoid-multiple-types.js @@ -3,21 +3,17 @@ * SPDX-License-Identifier: Apache2.0 */ -const { oas3_1 } = require('@stoplight/spectral-formats'); -const { avoidMultipleTypes } = require('../functions'); -const { - schemas, -} = require('@ibm-cloud/openapi-ruleset-utilities/src/collections'); +import { oas3_1 } from "@stoplight/spectral-formats"; +import { avoidMultipleTypes } from "../functions"; +import { schemas } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; -module.exports = { - description: - 'OpenAPI 3.1 documents should avoid multiple types in the schema "type" field.', - message: '{{error}}', - given: schemas, - severity: 'error', - formats: [oas3_1], - resolved: true, - then: { - function: avoidMultipleTypes, - }, +export const description = + 'OpenAPI 3.1 documents should avoid multiple types in the schema "type" field.'; +export const message = "{{error}}"; +export const given = schemas; +export const severity = "error"; +export const formats = [oas3_1]; +export const resolved = true; +export const then = { + function: avoidMultipleTypes, }; diff --git a/packages/ruleset/src/rules/binary-schemas.js b/packages/ruleset/src/rules/binary-schemas.js index 09a01f24f..9c8db1efe 100644 --- a/packages/ruleset/src/rules/binary-schemas.js +++ b/packages/ruleset/src/rules/binary-schemas.js @@ -3,24 +3,20 @@ * SPDX-License-Identifier: Apache2.0 */ -const { - schemas, -} = require('@ibm-cloud/openapi-ruleset-utilities/src/collections'); -const { oas3 } = require('@stoplight/spectral-formats'); -const { binarySchemas } = require('../functions'); +import { schemas } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; +import { oas3 } from "@stoplight/spectral-formats"; +import { binarySchemas } from "../functions"; // 1. Parameters should not contain binary (type: string, format: binary) values. // 2. JSON request bodies should not contain binary (type: string, format: binary) values. // 3. JSON response bodies should not contain binary (type: string, format: binary) values. -module.exports = { - description: - 'Checks that binary schemas are used only in the proper places within an API definition.', - message: '{{error}}', - formats: [oas3], - given: schemas, - severity: 'warn', - resolved: true, - then: { - function: binarySchemas, - }, +export const description = + "Checks that binary schemas are used only in the proper places within an API definition."; +export const message = "{{error}}"; +export const formats = [oas3]; +export const given = schemas; +export const severity = "warn"; +export const resolved = true; +export const then = { + function: binarySchemas, }; diff --git a/packages/ruleset/src/rules/circular-refs.js b/packages/ruleset/src/rules/circular-refs.js index e742a1cfd..398a2b076 100644 --- a/packages/ruleset/src/rules/circular-refs.js +++ b/packages/ruleset/src/rules/circular-refs.js @@ -3,17 +3,16 @@ * SPDX-License-Identifier: Apache2.0 */ -const { oas3 } = require('@stoplight/spectral-formats'); -const { circularRefs } = require('../functions'); +import { oas3 } from "@stoplight/spectral-formats"; +import { circularRefs } from "../functions"; -module.exports = { - description: 'API definition should not contain circular references.', - message: '{{error}}', - given: '$..$ref', - severity: 'warn', - formats: [oas3], - resolved: true, - then: { - function: circularRefs, - }, +export const description = + "API definition should not contain circular references."; +export const message = "{{error}}"; +export const given = "$..$ref"; +export const severity = "warn"; +export const formats = [oas3]; +export const resolved = true; +export const then = { + function: circularRefs, }; diff --git a/packages/ruleset/src/rules/collection-array-property.js b/packages/ruleset/src/rules/collection-array-property.js index 92b6acd16..5f5134363 100644 --- a/packages/ruleset/src/rules/collection-array-property.js +++ b/packages/ruleset/src/rules/collection-array-property.js @@ -3,19 +3,17 @@ * SPDX-License-Identifier: Apache2.0 */ -const { oas3 } = require('@stoplight/spectral-formats'); -const { collectionArrayProperty } = require('../functions'); +import { oas3 } from "@stoplight/spectral-formats"; +import { collectionArrayProperty } from "../functions"; -module.exports = { - description: - 'Collection list operation response schema should define array property whose name matches the final path segment of the operation path', - message: '{{error}}', - given: - '$.paths[*].get.responses[?(@property.match(/2\\d\\d/))].content[*].schema', - severity: 'warn', - formats: [oas3], - resolved: true, - then: { - function: collectionArrayProperty, - }, +export const description = + "Collection list operation response schema should define array property whose name matches the final path segment of the operation path"; +export const message = "{{error}}"; +export const given = + "$.paths[*].get.responses[?(@property.match(/2\\d\\d/))].content[*].schema"; +export const severity = "warn"; +export const formats = [oas3]; +export const resolved = true; +export const then = { + function: collectionArrayProperty, }; diff --git a/packages/ruleset/src/rules/consecutive-path-segments.js b/packages/ruleset/src/rules/consecutive-path-segments.js index dc27dc66f..9bee6cf68 100644 --- a/packages/ruleset/src/rules/consecutive-path-segments.js +++ b/packages/ruleset/src/rules/consecutive-path-segments.js @@ -3,21 +3,17 @@ * SPDX-License-Identifier: Apache2.0 */ -const { - paths, -} = require('@ibm-cloud/openapi-ruleset-utilities/src/collections'); -const { oas3 } = require('@stoplight/spectral-formats'); -const { consecutivePathSegments } = require('../functions'); +import { paths } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; +import { oas3 } from "@stoplight/spectral-formats"; +import { consecutivePathSegments } from "../functions"; -module.exports = { - description: - 'Path strings should not contain two or more consecutive path parameter references', - message: '{{error}}', - formats: [oas3], - given: paths, - severity: 'error', - resolved: true, - then: { - function: consecutivePathSegments, - }, +export const description = + "Path strings should not contain two or more consecutive path parameter references"; +export const message = "{{error}}"; +export const formats = [oas3]; +export const given = paths; +export const severity = "error"; +export const resolved = true; +export const then = { + function: consecutivePathSegments, }; diff --git a/packages/ruleset/src/rules/content-contains-schema.js b/packages/ruleset/src/rules/content-contains-schema.js index f126eb384..459f4876a 100644 --- a/packages/ruleset/src/rules/content-contains-schema.js +++ b/packages/ruleset/src/rules/content-contains-schema.js @@ -3,20 +3,18 @@ * SPDX-License-Identifier: Apache2.0 */ -const { oas3 } = require('@stoplight/spectral-formats'); -const { truthy } = require('@stoplight/spectral-functions'); +import { oas3 } from "@stoplight/spectral-formats"; +import { truthy } from "@stoplight/spectral-functions"; -module.exports = { - description: 'Content entries must specify a schema', - formats: [oas3], - given: [ - '$.paths[*][post,put,patch].requestBody.content[*]', - '$.paths[*][get,post,put,patch,delete][parameters,responses][*].content[*]', - ], - severity: 'warn', - resolved: true, - then: { - field: 'schema', - function: truthy, - }, +export const description = "Content entries must specify a schema"; +export const formats = [oas3]; +export const given = [ + "$.paths[*][post,put,patch].requestBody.content[*]", + "$.paths[*][get,post,put,patch,delete][parameters,responses][*].content[*]", +]; +export const severity = "warn"; +export const resolved = true; +export const then = { + field: "schema", + function: truthy, }; diff --git a/packages/ruleset/src/rules/content-type-header.js b/packages/ruleset/src/rules/content-type-header.js index 61a168a3f..7383329a2 100644 --- a/packages/ruleset/src/rules/content-type-header.js +++ b/packages/ruleset/src/rules/content-type-header.js @@ -3,23 +3,19 @@ * SPDX-License-Identifier: Apache2.0 */ -const { - parameters, -} = require('@ibm-cloud/openapi-ruleset-utilities/src/collections'); -const { oas3 } = require('@stoplight/spectral-formats'); -const { disallowedHeaderParameter } = require('../functions'); +import { parameters } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; +import { oas3 } from "@stoplight/spectral-formats"; +import { disallowedHeaderParameter } from "../functions"; -module.exports = { - description: - 'Operations should not explicitly define the Content-Type header parameter', - message: '{{description}}', - formats: [oas3], - given: parameters, - severity: 'warn', - then: { - function: disallowedHeaderParameter, - functionOptions: { - headerName: 'Content-Type', - }, +export const description = + "Operations should not explicitly define the Content-Type header parameter"; +export const message = "{{description}}"; +export const formats = [oas3]; +export const given = parameters; +export const severity = "warn"; +export const then = { + function: disallowedHeaderParameter, + functionOptions: { + headerName: "Content-Type", }, }; diff --git a/packages/ruleset/src/rules/content-type-is-specific.js b/packages/ruleset/src/rules/content-type-is-specific.js index 878097db0..fbc0f4639 100644 --- a/packages/ruleset/src/rules/content-type-is-specific.js +++ b/packages/ruleset/src/rules/content-type-is-specific.js @@ -3,20 +3,19 @@ * SPDX-License-Identifier: Apache2.0 */ -const { oas3 } = require('@stoplight/spectral-formats'); -const { falsy } = require('@stoplight/spectral-functions'); +import { oas3 } from "@stoplight/spectral-formats"; +import { falsy } from "@stoplight/spectral-functions"; -module.exports = { - description: '*/* should only be used when all content types are supported', - formats: [oas3], - severity: 'warn', - resolved: true, - given: [ - '$.paths[*][*][parameters,responses][*].content', - '$.paths[*][*][requestBody].content', - ], - then: { - field: '*/*', - function: falsy, - }, +export const description = + "*/* should only be used when all content types are supported"; +export const formats = [oas3]; +export const severity = "warn"; +export const resolved = true; +export const given = [ + "$.paths[*][*][parameters,responses][*].content", + "$.paths[*][*][requestBody].content", +]; +export const then = { + field: "*/*", + function: falsy, }; diff --git a/packages/ruleset/src/rules/delete-body.js b/packages/ruleset/src/rules/delete-body.js index e4d847994..cf49a7819 100644 --- a/packages/ruleset/src/rules/delete-body.js +++ b/packages/ruleset/src/rules/delete-body.js @@ -3,20 +3,17 @@ * SPDX-License-Identifier: Apache2.0 */ -const { - operations, -} = require('@ibm-cloud/openapi-ruleset-utilities/src/collections'); -const { oas3 } = require('@stoplight/spectral-formats'); -const { deleteBody } = require('../functions'); +import { operations } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; +import { oas3 } from "@stoplight/spectral-formats"; +import { deleteBody } from "../functions"; -module.exports = { - description: 'Delete operations should not contain a requestBody.', - message: '{{error}}', - severity: 'off', - formats: [oas3], - resolved: true, - given: operations, - then: { - function: deleteBody, - }, +export const description = + "Delete operations should not contain a requestBody."; +export const message = "{{error}}"; +export const severity = "off"; +export const formats = [oas3]; +export const resolved = true; +export const given = operations; +export const then = { + function: deleteBody, }; diff --git a/packages/ruleset/src/rules/discriminator-property-exists.js b/packages/ruleset/src/rules/discriminator-property-exists.js index e1f392e49..d6e3b126c 100644 --- a/packages/ruleset/src/rules/discriminator-property-exists.js +++ b/packages/ruleset/src/rules/discriminator-property-exists.js @@ -3,20 +3,17 @@ * SPDX-License-Identifier: Apache2.0 */ -const { - schemas, -} = require('@ibm-cloud/openapi-ruleset-utilities/src/collections'); -const { oas3 } = require('@stoplight/spectral-formats'); -const { discriminatorPropertyExists } = require('../functions'); +import { schemas } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; +import { oas3 } from "@stoplight/spectral-formats"; +import { discriminatorPropertyExists } from "../functions"; -module.exports = { - description: 'The discriminator property name must be defined in this schema', - message: '{{error}}', - given: schemas, - severity: 'error', - formats: [oas3], - resolved: true, - then: { - function: discriminatorPropertyExists, - }, +export const description = + "The discriminator property name must be defined in this schema"; +export const message = "{{error}}"; +export const given = schemas; +export const severity = "error"; +export const formats = [oas3]; +export const resolved = true; +export const then = { + function: discriminatorPropertyExists, }; diff --git a/packages/ruleset/src/rules/duplicate-path-parameter.js b/packages/ruleset/src/rules/duplicate-path-parameter.js index 024cf87e5..836528981 100644 --- a/packages/ruleset/src/rules/duplicate-path-parameter.js +++ b/packages/ruleset/src/rules/duplicate-path-parameter.js @@ -3,19 +3,16 @@ * SPDX-License-Identifier: Apache2.0 */ -const { - paths, -} = require('@ibm-cloud/openapi-ruleset-utilities/src/collections'); -const { oas3 } = require('@stoplight/spectral-formats'); -const { duplicatePathParameter } = require('../functions'); +import { paths } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; +import { oas3 } from "@stoplight/spectral-formats"; +import { duplicatePathParameter } from "../functions"; -module.exports = { - description: 'Common path parameters should be defined on the path object.', - given: paths, - severity: 'warn', - formats: [oas3], - resolved: true, - then: { - function: duplicatePathParameter, - }, +export const description = + "Common path parameters should be defined on the path object."; +export const given = paths; +export const severity = "warn"; +export const formats = [oas3]; +export const resolved = true; +export const then = { + function: duplicatePathParameter, }; diff --git a/packages/ruleset/src/rules/enum-casing-convention.js b/packages/ruleset/src/rules/enum-casing-convention.js index ca7cdc9ff..95992f8a1 100644 --- a/packages/ruleset/src/rules/enum-casing-convention.js +++ b/packages/ruleset/src/rules/enum-casing-convention.js @@ -3,22 +3,19 @@ * SPDX-License-Identifier: Apache2.0 */ -const { - schemas, -} = require('@ibm-cloud/openapi-ruleset-utilities/src/collections'); -const { oas3 } = require('@stoplight/spectral-formats'); -const { enumCasingConvention } = require('../functions'); +import { schemas } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; +import { oas3 } from "@stoplight/spectral-formats"; +import { enumCasingConvention } from "../functions"; -module.exports = { - description: 'Enum values must follow a specified case convention', - message: '{{error}}', - formats: [oas3], - given: schemas, - severity: 'error', - then: { - function: enumCasingConvention, - functionOptions: { - type: 'snake', - }, +export const description = + "Enum values must follow a specified case convention"; +export const message = "{{error}}"; +export const formats = [oas3]; +export const given = schemas; +export const severity = "error"; +export const then = { + function: enumCasingConvention, + functionOptions: { + type: "snake", }, }; diff --git a/packages/ruleset/src/rules/error-content-type-is-json.js b/packages/ruleset/src/rules/error-content-type-is-json.js index 3a0d430dc..1ae759372 100644 --- a/packages/ruleset/src/rules/error-content-type-is-json.js +++ b/packages/ruleset/src/rules/error-content-type-is-json.js @@ -3,19 +3,17 @@ * SPDX-License-Identifier: Apache2.0 */ -const { oas3 } = require('@stoplight/spectral-formats'); -const { truthy } = require('@stoplight/spectral-functions'); +import { oas3 } from "@stoplight/spectral-formats"; +import { truthy } from "@stoplight/spectral-functions"; -module.exports = { - description: 'error response should support application/json', - formats: [oas3], - severity: 'warn', - resolved: true, - given: [ - '$.paths[*][*].responses[?(@property >= 400 && @property < 600)].content', - ], - then: { - field: 'application/json', - function: truthy, - }, +export const description = "error response should support application/json"; +export const formats = [oas3]; +export const severity = "warn"; +export const resolved = true; +export const given = [ + "$.paths[*][*].responses[?(@property >= 400 && @property < 600)].content", +]; +export const then = { + field: "application/json", + function: truthy, }; diff --git a/packages/ruleset/src/rules/error-response-schemas.js b/packages/ruleset/src/rules/error-response-schemas.js index b3dbb665d..1b62e1655 100644 --- a/packages/ruleset/src/rules/error-response-schemas.js +++ b/packages/ruleset/src/rules/error-response-schemas.js @@ -3,19 +3,17 @@ * SPDX-License-Identifier: Apache2.0 */ -const { oas3 } = require('@stoplight/spectral-formats'); -const { errorResponseSchemas } = require('../functions'); +import { oas3 } from "@stoplight/spectral-formats"; +import { errorResponseSchemas } from "../functions"; -module.exports = { - description: - 'Error response schemas should comply with API Handbook guidance', - message: '{{error}}', - given: - '$.paths[*][*].responses[?(@property >= 400 && @property < 600)].content[*].schema', - severity: 'warn', - formats: [oas3], - resolved: true, - then: { - function: errorResponseSchemas, - }, +export const description = + "Error response schemas should comply with API Handbook guidance"; +export const message = "{{error}}"; +export const given = + "$.paths[*][*].responses[?(@property >= 400 && @property < 600)].content[*].schema"; +export const severity = "warn"; +export const formats = [oas3]; +export const resolved = true; +export const then = { + function: errorResponseSchemas, }; diff --git a/packages/ruleset/src/rules/etag-header-exists.js b/packages/ruleset/src/rules/etag-header-exists.js index 654fdef8a..943abd585 100644 --- a/packages/ruleset/src/rules/etag-header-exists.js +++ b/packages/ruleset/src/rules/etag-header-exists.js @@ -3,21 +3,17 @@ * SPDX-License-Identifier: Apache2.0 */ -const { - paths, -} = require('@ibm-cloud/openapi-ruleset-utilities/src/collections'); -const { oas3 } = require('@stoplight/spectral-formats'); -const { etagHeaderExists } = require('../functions'); +import { paths } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; +import { oas3 } from "@stoplight/spectral-formats"; +import { etagHeaderExists } from "../functions"; -module.exports = { - description: - 'ETag response header should be defined in GET operation for resources that support If-Match or If-None-Match header parameters', - message: '{{error}}', - given: paths, - severity: 'error', - formats: [oas3], - resolved: true, - then: { - function: etagHeaderExists, - }, +export const description = + "ETag response header should be defined in GET operation for resources that support If-Match or If-None-Match header parameters"; +export const message = "{{error}}"; +export const given = paths; +export const severity = "error"; +export const formats = [oas3]; +export const resolved = true; +export const then = { + function: etagHeaderExists, }; diff --git a/packages/ruleset/src/rules/examples-name-contains-space.js b/packages/ruleset/src/rules/examples-name-contains-space.js index 7a58397ab..d57ad992f 100644 --- a/packages/ruleset/src/rules/examples-name-contains-space.js +++ b/packages/ruleset/src/rules/examples-name-contains-space.js @@ -3,20 +3,18 @@ * SPDX-License-Identifier: Apache2.0 */ -const { pattern } = require('@stoplight/spectral-functions'); -const { oas3 } = require('@stoplight/spectral-formats'); +import { pattern } from "@stoplight/spectral-functions"; +import { oas3 } from "@stoplight/spectral-formats"; -module.exports = { - description: 'Examples name should not contain space', - message: '{{description}}', - severity: 'warn', - resolved: false, - formats: [oas3], - given: '$.paths[*][*].responses[*][*][*].examples[*]~', - then: { - function: pattern, - functionOptions: { - notMatch: '^(.*\\s+.*)+$', - }, +export const description = "Examples name should not contain space"; +export const message = "{{description}}"; +export const severity = "warn"; +export const resolved = false; +export const formats = [oas3]; +export const given = "$.paths[*][*].responses[*][*][*].examples[*]~"; +export const then = { + function: pattern, + functionOptions: { + notMatch: "^(.*\\s+.*)+$", }, }; diff --git a/packages/ruleset/src/rules/ibm-sdk-operations.js b/packages/ruleset/src/rules/ibm-sdk-operations.js index 175a39716..0b163c146 100644 --- a/packages/ruleset/src/rules/ibm-sdk-operations.js +++ b/packages/ruleset/src/rules/ibm-sdk-operations.js @@ -3,22 +3,21 @@ * SPDX-License-Identifier: Apache2.0 */ -const { oas3 } = require('@stoplight/spectral-formats'); -const { schema } = require('@stoplight/spectral-functions'); +import { oas3 } from "@stoplight/spectral-formats"; +import { schema } from "@stoplight/spectral-functions"; -module.exports = { - description: 'Ensures that x-sdk-operations fields are properly structured', - message: '{{error}}', - given: '$.', - severity: 'warn', - formats: [oas3], - resolved: true, - then: { - function: schema, - functionOptions: { - schema: { - $ref: '../schemas/x-sdk-operations.json', - }, +export const description = + "Ensures that x-sdk-operations fields are properly structured"; +export const message = "{{error}}"; +export const given = "$."; +export const severity = "warn"; +export const formats = [oas3]; +export const resolved = true; +export const then = { + function: schema, + functionOptions: { + schema: { + $ref: "../schemas/x-sdk-operations.json", }, }, }; diff --git a/packages/ruleset/src/rules/if-modified-since-header.js b/packages/ruleset/src/rules/if-modified-since-header.js index cf655b3e3..ea3f26a2f 100644 --- a/packages/ruleset/src/rules/if-modified-since-header.js +++ b/packages/ruleset/src/rules/if-modified-since-header.js @@ -3,24 +3,20 @@ * SPDX-License-Identifier: Apache2.0 */ -const { - parameters, -} = require('@ibm-cloud/openapi-ruleset-utilities/src/collections'); -const { oas3 } = require('@stoplight/spectral-formats'); -const { disallowedHeaderParameter } = require('../functions'); +import { parameters } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; +import { oas3 } from "@stoplight/spectral-formats"; +import { disallowedHeaderParameter } from "../functions"; -module.exports = { - description: - 'Operations should support the If-None-Match header parameter instead of If-Modified-Since', - message: '{{description}}', - formats: [oas3], - given: parameters, - severity: 'warn', - resolved: true, - then: { - function: disallowedHeaderParameter, - functionOptions: { - headerName: 'If-Modified-Since', - }, +export const description = + "Operations should support the If-None-Match header parameter instead of If-Modified-Since"; +export const message = "{{description}}"; +export const formats = [oas3]; +export const given = parameters; +export const severity = "warn"; +export const resolved = true; +export const then = { + function: disallowedHeaderParameter, + functionOptions: { + headerName: "If-Modified-Since", }, }; diff --git a/packages/ruleset/src/rules/if-unmodified-since-header.js b/packages/ruleset/src/rules/if-unmodified-since-header.js index f4e0e98c3..82869f006 100644 --- a/packages/ruleset/src/rules/if-unmodified-since-header.js +++ b/packages/ruleset/src/rules/if-unmodified-since-header.js @@ -3,24 +3,20 @@ * SPDX-License-Identifier: Apache2.0 */ -const { - parameters, -} = require('@ibm-cloud/openapi-ruleset-utilities/src/collections'); -const { oas3 } = require('@stoplight/spectral-formats'); -const { disallowedHeaderParameter } = require('../functions'); +import { parameters } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; +import { oas3 } from "@stoplight/spectral-formats"; +import { disallowedHeaderParameter } from "../functions"; -module.exports = { - description: - 'Operations should support the If-Match header parameter instead of If-Unmodified-Since', - message: '{{description}}', - formats: [oas3], - given: parameters, - severity: 'warn', - resolved: true, - then: { - function: disallowedHeaderParameter, - functionOptions: { - headerName: 'If-Unmodified-Since', - }, +export const description = + "Operations should support the If-Match header parameter instead of If-Unmodified-Since"; +export const message = "{{description}}"; +export const formats = [oas3]; +export const given = parameters; +export const severity = "warn"; +export const resolved = true; +export const then = { + function: disallowedHeaderParameter, + functionOptions: { + headerName: "If-Unmodified-Since", }, }; diff --git a/packages/ruleset/src/rules/index.js b/packages/ruleset/src/rules/index.js index abbca580f..a508ede1c 100644 --- a/packages/ruleset/src/rules/index.js +++ b/packages/ruleset/src/rules/index.js @@ -3,97 +3,95 @@ * SPDX-License-Identifier: Apache2.0 */ -module.exports = { - acceptAndReturnModels: require('./accept-and-return-models'), - acceptHeader: require('./accept-header'), - anchoredPatterns: require('./anchored-patterns'), - apiSymmetry: require('./api-symmetry'), - arrayAttributes: require('./array-attributes'), - arrayOfArrays: require('./array-of-arrays'), - arrayResponses: require('./array-responses'), - authorizationHeader: require('./authorization-header'), - avoidMultipleTypes: require('./avoid-multiple-types'), - binarySchemas: require('./binary-schemas'), - circularRefs: require('./circular-refs'), - collectionArrayProperty: require('./collection-array-property'), - consecutivePathSegments: require('./consecutive-path-segments'), - contentContainsSchema: require('./content-contains-schema'), - contentTypeHeader: require('./content-type-header'), - contentTypeIsSpecific: require('./content-type-is-specific'), - deleteBody: require('./delete-body'), - discriminatorPropertyExists: require('./discriminator-property-exists'), - duplicatePathParameter: require('./duplicate-path-parameter'), - etagHeaderExists: require('./etag-header-exists'), - enumCasingConvention: require('./enum-casing-convention'), - errorContentTypeIsJson: require('./error-content-type-is-json'), - errorResponseSchemas: require('./error-response-schemas'), - examplesNameContainsSpace: require('./examples-name-contains-space'), - ibmSdkOperations: require('./ibm-sdk-operations'), - ifModifiedSinceHeader: require('./if-modified-since-header'), - ifUnmodifiedSinceHeader: require('./if-unmodified-since-header'), - inlineSchemas: require('./inline-schemas'), - integerAttributes: require('./integer-attributes'), - majorVersionInPath: require('./major-version-in-path'), - mergePatchProperties: require('./merge-patch-properties'), - noAmbiguousPaths: require('./no-ambiguous-paths'), - noNullableProperties: require('./no-nullable-properties'), - noOperationRequestBody: require('./no-operation-requestbody'), - noRefInExample: require('./no-ref-in-example'), - noSuperfluousAllOf: require('./no-superfluous-allof'), - noUnsupportedKeywords: require('./no-unsupported-keywords'), - operationIdCasingConvention: require('./operationid-casing-convention'), - operationIdNamingConvention: require('./operationid-naming-convention'), - operationResponses: require('./operation-responses'), - operationSummaryExists: require('./operation-summary-exists'), - operationSummaryLength: require('./operation-summary-length'), - optionalRequestBody: require('./optional-request-body'), - optionalRequestBodyDeprecated: require('./optional-request-body-deprecated'), - paginationStyle: require('./pagination-style'), - parameterCasingConvention: require('./parameter-casing-convention'), - parameterDefault: require('./parameter-default'), - parameterDescriptionExists: require('./parameter-description-exists'), - parameterOrder: require('./parameter-order'), - parameterSchemaOrContentExists: require('./parameter-schema-or-content-exists'), - patchRequestContentType: require('./patch-request-content-type'), - pathParameterNotCRN: require('./path-parameter-not-crn'), - pathSegmentCasingConvention: require('./path-segment-casing-convention'), - patternProperties: require('./pattern-properties'), - preconditionHeader: require('./precondition-header'), - preferTokenPagination: require('./prefer-token-pagination'), - propertyAttributes: require('./property-attributes'), - propertyCasingConvention: require('./property-casing-convention'), - propertyConsistentNameAndType: require('./property-consistent-name-and-type'), - propertyDescriptionExists: require('./property-description-exists'), - propertyNameCollision: require('./property-name-collision'), - redirectResponseBody: require('./redirect-response-body'), - refPattern: require('./ref-pattern'), - refSiblingDuplicateDescription: require('./ref-sibling-duplicate-description'), - requestAndResponseContent: require('./request-and-response-content'), - requestBodyIsObject: require('./requestbody-is-object'), - requestBodyName: require('./requestbody-name'), - requiredArrayPropertiesInResponse: require('./required-array-properties-in-response'), - requiredEnumPropertiesInResponse: require('./required-enum-properties-in-response'), - requiredPropertyMissing: require('./required-property-missing'), - resourceResponseConsistency: require('./resource-response-consistency'), - responseExampleExists: require('./response-example-exists'), - responseStatusCodes: require('./response-status-codes'), - schemaCasingConvention: require('./schema-casing-convention'), - schemaDescriptionExists: require('./schema-description-exists'), - schemaKeywords: require('./schema-keywords'), - schemaNamingConvention: require('./schema-naming-convention'), - schemaTypeExists: require('./schema-type-exists'), - schemaTypeFormat: require('./schema-type-format'), - securitySchemes: require('./securityschemes'), - securitySchemeAttributes: require('./securityscheme-attributes'), - serverVariableDefaultValue: require('./server-variable-default-value'), - stringAttributes: require('./string-attributes'), - summarySentenceStyle: require('./summary-sentence-style'), - typedEnum: require('./typed-enum'), - unevaluatedProperties: require('./unevaluated-properties'), - unusedTags: require('./unused-tags'), - uniqueParameterRequestPropertyNames: require('./unique-parameter-request-property-names'), - useDateBasedFormat: require('./use-date-based-format'), - validPathSegments: require('./valid-path-segments'), - validSchemaExample: require('./valid-schema-example'), - wellDefinedDictionaries: require('./well-defined-dictionaries'), -}; +export const acceptAndReturnModels = require("./accept-and-return-models"); +export const acceptHeader = require("./accept-header"); +export const anchoredPatterns = require("./anchored-patterns"); +export const apiSymmetry = require("./api-symmetry"); +export const arrayAttributes = require("./array-attributes"); +export const arrayOfArrays = require("./array-of-arrays"); +export const arrayResponses = require("./array-responses"); +export const authorizationHeader = require("./authorization-header"); +export const avoidMultipleTypes = require("./avoid-multiple-types"); +export const binarySchemas = require("./binary-schemas"); +export const circularRefs = require("./circular-refs"); +export const collectionArrayProperty = require("./collection-array-property"); +export const consecutivePathSegments = require("./consecutive-path-segments"); +export const contentContainsSchema = require("./content-contains-schema"); +export const contentTypeHeader = require("./content-type-header"); +export const contentTypeIsSpecific = require("./content-type-is-specific"); +export const deleteBody = require("./delete-body"); +export const discriminatorPropertyExists = require("./discriminator-property-exists"); +export const duplicatePathParameter = require("./duplicate-path-parameter"); +export const etagHeaderExists = require("./etag-header-exists"); +export const enumCasingConvention = require("./enum-casing-convention"); +export const errorContentTypeIsJson = require("./error-content-type-is-json"); +export const errorResponseSchemas = require("./error-response-schemas"); +export const examplesNameContainsSpace = require("./examples-name-contains-space"); +export const ibmSdkOperations = require("./ibm-sdk-operations"); +export const ifModifiedSinceHeader = require("./if-modified-since-header"); +export const ifUnmodifiedSinceHeader = require("./if-unmodified-since-header"); +export const inlineSchemas = require("./inline-schemas"); +export const integerAttributes = require("./integer-attributes"); +export const majorVersionInPath = require("./major-version-in-path"); +export const mergePatchProperties = require("./merge-patch-properties"); +export const noAmbiguousPaths = require("./no-ambiguous-paths"); +export const noNullableProperties = require("./no-nullable-properties"); +export const noOperationRequestBody = require("./no-operation-requestbody"); +export const noRefInExample = require("./no-ref-in-example"); +export const noSuperfluousAllOf = require("./no-superfluous-allof"); +export const noUnsupportedKeywords = require("./no-unsupported-keywords"); +export const operationIdCasingConvention = require("./operationid-casing-convention"); +export const operationIdNamingConvention = require("./operationid-naming-convention"); +export const operationResponses = require("./operation-responses"); +export const operationSummaryExists = require("./operation-summary-exists"); +export const operationSummaryLength = require("./operation-summary-length"); +export const optionalRequestBody = require("./optional-request-body"); +export const optionalRequestBodyDeprecated = require("./optional-request-body-deprecated"); +export const paginationStyle = require("./pagination-style"); +export const parameterCasingConvention = require("./parameter-casing-convention"); +export const parameterDefault = require("./parameter-default"); +export const parameterDescriptionExists = require("./parameter-description-exists"); +export const parameterOrder = require("./parameter-order"); +export const parameterSchemaOrContentExists = require("./parameter-schema-or-content-exists"); +export const patchRequestContentType = require("./patch-request-content-type"); +export const pathParameterNotCRN = require("./path-parameter-not-crn"); +export const pathSegmentCasingConvention = require("./path-segment-casing-convention"); +export const patternProperties = require("./pattern-properties"); +export const preconditionHeader = require("./precondition-header"); +export const preferTokenPagination = require("./prefer-token-pagination"); +export const propertyAttributes = require("./property-attributes"); +export const propertyCasingConvention = require("./property-casing-convention"); +export const propertyConsistentNameAndType = require("./property-consistent-name-and-type"); +export const propertyDescriptionExists = require("./property-description-exists"); +export const propertyNameCollision = require("./property-name-collision"); +export const redirectResponseBody = require("./redirect-response-body"); +export const refPattern = require("./ref-pattern"); +export const refSiblingDuplicateDescription = require("./ref-sibling-duplicate-description"); +export const requestAndResponseContent = require("./request-and-response-content"); +export const requestBodyIsObject = require("./requestbody-is-object"); +export const requestBodyName = require("./requestbody-name"); +export const requiredArrayPropertiesInResponse = require("./required-array-properties-in-response"); +export const requiredEnumPropertiesInResponse = require("./required-enum-properties-in-response"); +export const requiredPropertyMissing = require("./required-property-missing"); +export const resourceResponseConsistency = require("./resource-response-consistency"); +export const responseExampleExists = require("./response-example-exists"); +export const responseStatusCodes = require("./response-status-codes"); +export const schemaCasingConvention = require("./schema-casing-convention"); +export const schemaDescriptionExists = require("./schema-description-exists"); +export const schemaKeywords = require("./schema-keywords"); +export const schemaNamingConvention = require("./schema-naming-convention"); +export const schemaTypeExists = require("./schema-type-exists"); +export const schemaTypeFormat = require("./schema-type-format"); +export const securitySchemes = require("./securityschemes"); +export const securitySchemeAttributes = require("./securityscheme-attributes"); +export const serverVariableDefaultValue = require("./server-variable-default-value"); +export const stringAttributes = require("./string-attributes"); +export const summarySentenceStyle = require("./summary-sentence-style"); +export const typedEnum = require("./typed-enum").default; +export const unevaluatedProperties = require("./unevaluated-properties"); +export const unusedTags = require("./unused-tags"); +export const uniqueParameterRequestPropertyNames = require("./unique-parameter-request-property-names"); +export const useDateBasedFormat = require("./use-date-based-format"); +export const validPathSegments = require("./valid-path-segments"); +export const validSchemaExample = require("./valid-schema-example"); +export const wellDefinedDictionaries = require("./well-defined-dictionaries"); diff --git a/packages/ruleset/src/rules/inline-schemas.js b/packages/ruleset/src/rules/inline-schemas.js index 392da88a7..021557eaf 100644 --- a/packages/ruleset/src/rules/inline-schemas.js +++ b/packages/ruleset/src/rules/inline-schemas.js @@ -3,20 +3,17 @@ * SPDX-License-Identifier: Apache2.0 */ -const { - unresolvedSchemas, -} = require('@ibm-cloud/openapi-ruleset-utilities/src/collections'); -const { oas3 } = require('@stoplight/spectral-formats'); -const { inlineSchemas } = require('../functions'); +import { unresolvedSchemas } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; +import { oas3 } from "@stoplight/spectral-formats"; +import { inlineSchemas } from "../functions"; -module.exports = { - description: 'Nested objects should be defined as a $ref to a named schema', - message: '{{error}}', - formats: [oas3], - given: unresolvedSchemas, - severity: 'warn', - resolved: false, - then: { - function: inlineSchemas, - }, +export const description = + "Nested objects should be defined as a $ref to a named schema"; +export const message = "{{error}}"; +export const formats = [oas3]; +export const given = unresolvedSchemas; +export const severity = "warn"; +export const resolved = false; +export const then = { + function: inlineSchemas, }; diff --git a/packages/ruleset/src/rules/integer-attributes.js b/packages/ruleset/src/rules/integer-attributes.js index 2dde421e2..4e0ad5c20 100644 --- a/packages/ruleset/src/rules/integer-attributes.js +++ b/packages/ruleset/src/rules/integer-attributes.js @@ -3,20 +3,17 @@ * SPDX-License-Identifier: Apache2.0 */ -const { - schemas, -} = require('@ibm-cloud/openapi-ruleset-utilities/src/collections'); -const { oas3 } = require('@stoplight/spectral-formats'); -const { integerAttributes } = require('../functions'); +import { schemas } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; +import { oas3 } from "@stoplight/spectral-formats"; +import { integerAttributes } from "../functions"; -module.exports = { - description: 'Integer schemas should have certain attributes defined', - message: '{{error}}', - severity: 'error', - formats: [oas3], - resolved: true, - given: schemas, - then: { - function: integerAttributes, - }, +export const description = + "Integer schemas should have certain attributes defined"; +export const message = "{{error}}"; +export const severity = "error"; +export const formats = [oas3]; +export const resolved = true; +export const given = schemas; +export const then = { + function: integerAttributes, }; diff --git a/packages/ruleset/src/rules/major-version-in-path.js b/packages/ruleset/src/rules/major-version-in-path.js index c43c81323..46bd89dde 100644 --- a/packages/ruleset/src/rules/major-version-in-path.js +++ b/packages/ruleset/src/rules/major-version-in-path.js @@ -3,17 +3,15 @@ * SPDX-License-Identifier: Apache2.0 */ -const { oas3 } = require('@stoplight/spectral-formats'); -const { majorVersionInPath } = require('../functions'); +import { oas3 } from "@stoplight/spectral-formats"; +import { majorVersionInPath } from "../functions"; -module.exports = { - description: - 'All paths must contain the API major version as a distinct path segment', - message: '{{error}}', - formats: [oas3], - given: '$', - severity: 'warn', - then: { - function: majorVersionInPath, - }, +export const description = + "All paths must contain the API major version as a distinct path segment"; +export const message = "{{error}}"; +export const formats = [oas3]; +export const given = "$"; +export const severity = "warn"; +export const then = { + function: majorVersionInPath, }; diff --git a/packages/ruleset/src/rules/merge-patch-properties.js b/packages/ruleset/src/rules/merge-patch-properties.js index 019caab87..2ee9edfe7 100644 --- a/packages/ruleset/src/rules/merge-patch-properties.js +++ b/packages/ruleset/src/rules/merge-patch-properties.js @@ -3,21 +3,19 @@ * SPDX-License-Identifier: Apache2.0 */ -const { oas3 } = require('@stoplight/spectral-formats'); -const { mergePatchProperties } = require('../functions'); +import { oas3 } from "@stoplight/spectral-formats"; +import { mergePatchProperties } from "../functions"; -module.exports = { - description: - 'A JSON merge-patch requestBody should have no required properties', - message: '{{description}}', - given: [ - // This expression should visit the request body schema for each "merge-patch" type operation. - '$.paths[*][patch].requestBody.content[?(@property.match(/^application\\/merge-patch\\+json(;.*)*/))].schema', - ], - severity: 'warn', - formats: [oas3], - resolved: true, - then: { - function: mergePatchProperties, - }, +export const description = + "A JSON merge-patch requestBody should have no required properties"; +export const message = "{{description}}"; +export const given = [ + // This expression should visit the request body schema for each "merge-patch" type operation. + "$.paths[*][patch].requestBody.content[?(@property.match(/^application\\/merge-patch\\+json(;.*)*/))].schema", +]; +export const severity = "warn"; +export const formats = [oas3]; +export const resolved = true; +export const then = { + function: mergePatchProperties, }; diff --git a/packages/ruleset/src/rules/no-ambiguous-paths.js b/packages/ruleset/src/rules/no-ambiguous-paths.js index 1ba26c9e2..536ecfe34 100644 --- a/packages/ruleset/src/rules/no-ambiguous-paths.js +++ b/packages/ruleset/src/rules/no-ambiguous-paths.js @@ -3,17 +3,16 @@ * SPDX-License-Identifier: Apache2.0 */ -const { oas3 } = require('@stoplight/spectral-formats'); -const { noAmbiguousPaths } = require('../functions'); +import { oas3 } from "@stoplight/spectral-formats"; +import { noAmbiguousPaths } from "../functions"; -module.exports = { - description: 'Avoid ambiguous path strings within an OpenAPI document', - message: '{{error}}', - severity: 'warn', - formats: [oas3], - resolved: true, - given: ['$.paths'], - then: { - function: noAmbiguousPaths, - }, +export const description = + "Avoid ambiguous path strings within an OpenAPI document"; +export const message = "{{error}}"; +export const severity = "warn"; +export const formats = [oas3]; +export const resolved = true; +export const given = ["$.paths"]; +export const then = { + function: noAmbiguousPaths, }; diff --git a/packages/ruleset/src/rules/no-nullable-properties.js b/packages/ruleset/src/rules/no-nullable-properties.js index e16b12d33..791fffbc2 100644 --- a/packages/ruleset/src/rules/no-nullable-properties.js +++ b/packages/ruleset/src/rules/no-nullable-properties.js @@ -3,21 +3,17 @@ * SPDX-License-Identifier: Apache2.0 */ -const { oas3 } = require('@stoplight/spectral-formats'); -const { - schemas, -} = require('@ibm-cloud/openapi-ruleset-utilities/src/collections'); -const { noNullableProperties } = require('../functions'); +import { oas3 } from "@stoplight/spectral-formats"; +import { schemas } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; +import { noNullableProperties } from "../functions"; -module.exports = { - description: - 'Nullable properties should exist only in JSON merge-patch request bodies', - message: '{{error}}', - severity: 'warn', - formats: [oas3], - resolved: true, - given: schemas, - then: { - function: noNullableProperties, - }, +export const description = + "Nullable properties should exist only in JSON merge-patch request bodies"; +export const message = "{{error}}"; +export const severity = "warn"; +export const formats = [oas3]; +export const resolved = true; +export const given = schemas; +export const then = { + function: noNullableProperties, }; diff --git a/packages/ruleset/src/rules/no-operation-requestbody.js b/packages/ruleset/src/rules/no-operation-requestbody.js index b1bad6e74..b6af23f18 100644 --- a/packages/ruleset/src/rules/no-operation-requestbody.js +++ b/packages/ruleset/src/rules/no-operation-requestbody.js @@ -3,24 +3,21 @@ * SPDX-License-Identifier: Apache2.0 */ -const { - operations, -} = require('@ibm-cloud/openapi-ruleset-utilities/src/collections'); -const { oas3 } = require('@stoplight/spectral-formats'); -const { noOperationRequestBody } = require('../functions'); +import { operations } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; +import { oas3 } from "@stoplight/spectral-formats"; +import { noOperationRequestBody } from "../functions"; -module.exports = { - description: 'Certain operations should not contain a requestBody', - message: '{{error}}', - severity: 'warn', - formats: [oas3], - resolved: true, - given: operations, - then: { - function: noOperationRequestBody, - functionOptions: { - // HTTP methods that should NOT have a requestBody: - httpMethods: ['delete', 'get', 'head', 'options'], - }, +export const description = + "Certain operations should not contain a requestBody"; +export const message = "{{error}}"; +export const severity = "warn"; +export const formats = [oas3]; +export const resolved = true; +export const given = operations; +export const then = { + function: noOperationRequestBody, + functionOptions: { + // HTTP methods that should NOT have a requestBody: + httpMethods: ["delete", "get", "head", "options"], }, }; diff --git a/packages/ruleset/src/rules/no-ref-in-example.js b/packages/ruleset/src/rules/no-ref-in-example.js index a4eab27dc..9df4fc8d4 100644 --- a/packages/ruleset/src/rules/no-ref-in-example.js +++ b/packages/ruleset/src/rules/no-ref-in-example.js @@ -3,16 +3,15 @@ * SPDX-License-Identifier: Apache2.0 */ -const { oas3 } = require('@stoplight/spectral-formats'); -const { noRefInExample } = require('../functions'); -module.exports = { - description: 'The use of $ref is not valid within an example field', - message: '{{description}}', - given: ['$..example'], - severity: 'error', - formats: [oas3], - resolved: false, - then: { - function: noRefInExample, - }, +import { oas3 } from "@stoplight/spectral-formats"; +import { noRefInExample } from "../functions"; +export const description = + "The use of $ref is not valid within an example field"; +export const message = "{{description}}"; +export const given = ["$..example"]; +export const severity = "error"; +export const formats = [oas3]; +export const resolved = false; +export const then = { + function: noRefInExample, }; diff --git a/packages/ruleset/src/rules/no-superfluous-allof.js b/packages/ruleset/src/rules/no-superfluous-allof.js index 9e8f4ded5..f26cfada8 100644 --- a/packages/ruleset/src/rules/no-superfluous-allof.js +++ b/packages/ruleset/src/rules/no-superfluous-allof.js @@ -3,19 +3,16 @@ * SPDX-License-Identifier: Apache2.0 */ -const { - schemas, -} = require('@ibm-cloud/openapi-ruleset-utilities/src/collections'); -const { oas3 } = require('@stoplight/spectral-formats'); -const { noSuperfluousAllOf } = require('../functions'); +import { schemas } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; +import { oas3 } from "@stoplight/spectral-formats"; +import { noSuperfluousAllOf } from "../functions"; -module.exports = { - description: 'Avoid schemas containing only a single-element allOf', - given: schemas, - severity: 'warn', - formats: [oas3], - resolved: true, - then: { - function: noSuperfluousAllOf, - }, +export const description = + "Avoid schemas containing only a single-element allOf"; +export const given = schemas; +export const severity = "warn"; +export const formats = [oas3]; +export const resolved = true; +export const then = { + function: noSuperfluousAllOf, }; diff --git a/packages/ruleset/src/rules/no-unsupported-keywords.js b/packages/ruleset/src/rules/no-unsupported-keywords.js index 6ecb0e78b..917f7c5f7 100644 --- a/packages/ruleset/src/rules/no-unsupported-keywords.js +++ b/packages/ruleset/src/rules/no-unsupported-keywords.js @@ -3,18 +3,16 @@ * SPDX-License-Identifier: Apache2.0 */ -const { oas3_1 } = require('@stoplight/spectral-formats'); -const { noUnsupportedKeywords } = require('../functions'); +import { oas3_1 } from "@stoplight/spectral-formats"; +import { noUnsupportedKeywords } from "../functions"; -module.exports = { - description: - 'Verifies that unsupported OpenAPI 3.1 keywords are not used in the API document.', - message: '{{error}}', - given: ['$'], - severity: 'error', - formats: [oas3_1], - resolved: false, - then: { - function: noUnsupportedKeywords, - }, +export const description = + "Verifies that unsupported OpenAPI 3.1 keywords are not used in the API document."; +export const message = "{{error}}"; +export const given = ["$"]; +export const severity = "error"; +export const formats = [oas3_1]; +export const resolved = false; +export const then = { + function: noUnsupportedKeywords, }; diff --git a/packages/ruleset/src/rules/operation-responses.js b/packages/ruleset/src/rules/operation-responses.js index ac91d7d70..711b94100 100644 --- a/packages/ruleset/src/rules/operation-responses.js +++ b/packages/ruleset/src/rules/operation-responses.js @@ -3,21 +3,18 @@ * SPDX-License-Identifier: Apache2.0 */ -const { - operations, -} = require('@ibm-cloud/openapi-ruleset-utilities/src/collections'); -const { oas3_1 } = require('@stoplight/spectral-formats'); -const { truthy } = require('@stoplight/spectral-functions'); +import { operations } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; +import { oas3_1 } from "@stoplight/spectral-formats"; +import { truthy } from "@stoplight/spectral-functions"; -module.exports = { - description: 'Verifies that each operation has a "responses" field', - message: 'Operations MUST have a "responses" field', - severity: 'error', - formats: [oas3_1], - resolved: true, - given: operations, - then: { - field: 'responses', - function: truthy, - }, +export const description = + 'Verifies that each operation has a "responses" field'; +export const message = 'Operations MUST have a "responses" field'; +export const severity = "error"; +export const formats = [oas3_1]; +export const resolved = true; +export const given = operations; +export const then = { + field: "responses", + function: truthy, }; diff --git a/packages/ruleset/src/rules/operation-summary-exists.js b/packages/ruleset/src/rules/operation-summary-exists.js index d8917230b..9f9a0bc19 100644 --- a/packages/ruleset/src/rules/operation-summary-exists.js +++ b/packages/ruleset/src/rules/operation-summary-exists.js @@ -3,19 +3,15 @@ * SPDX-License-Identifier: Apache2.0 */ -const { - operations, -} = require('@ibm-cloud/openapi-ruleset-utilities/src/collections'); -const { oas3 } = require('@stoplight/spectral-formats'); -const { operationSummaryExists } = require('../functions'); +import { operations } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; +import { oas3 } from "@stoplight/spectral-formats"; +import { operationSummaryExists } from "../functions"; -module.exports = { - description: 'Operations must have a non-empty summary', - given: operations, - severity: 'warn', - formats: [oas3], - resolved: true, - then: { - function: operationSummaryExists, - }, +export const description = "Operations must have a non-empty summary"; +export const given = operations; +export const severity = "warn"; +export const formats = [oas3]; +export const resolved = true; +export const then = { + function: operationSummaryExists, }; diff --git a/packages/ruleset/src/rules/operation-summary-length.js b/packages/ruleset/src/rules/operation-summary-length.js index 2c534016a..2cbcacd95 100644 --- a/packages/ruleset/src/rules/operation-summary-length.js +++ b/packages/ruleset/src/rules/operation-summary-length.js @@ -3,19 +3,16 @@ * SPDX-License-Identifier: Apache2.0 */ -const { - operations, -} = require('@ibm-cloud/openapi-ruleset-utilities/src/collections'); -const { oas3 } = require('@stoplight/spectral-formats'); -const { operationSummaryLength } = require('../functions'); +import { operations } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; +import { oas3 } from "@stoplight/spectral-formats"; +import { operationSummaryLength } from "../functions"; -module.exports = { - description: 'Operation summaries must be 80 characters or less in length', - given: operations.map(op => `${op}.summary`), - severity: 'error', - formats: [oas3], - resolved: true, - then: { - function: operationSummaryLength, - }, +export const description = + "Operation summaries must be 80 characters or less in length"; +export const given = operations.map((op) => `${op}.summary`); +export const severity = "error"; +export const formats = [oas3]; +export const resolved = true; +export const then = { + function: operationSummaryLength, }; diff --git a/packages/ruleset/src/rules/operationid-casing-convention.js b/packages/ruleset/src/rules/operationid-casing-convention.js index 3593a605a..f3a23725a 100644 --- a/packages/ruleset/src/rules/operationid-casing-convention.js +++ b/packages/ruleset/src/rules/operationid-casing-convention.js @@ -3,22 +3,19 @@ * SPDX-License-Identifier: Apache2.0 */ -const { - operations, -} = require('@ibm-cloud/openapi-ruleset-utilities/src/collections'); -const { oas3 } = require('@stoplight/spectral-formats'); -const { operationIdCasingConvention } = require('../functions'); +import { operations } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; +import { oas3 } from "@stoplight/spectral-formats"; +import { operationIdCasingConvention } from "../functions"; -module.exports = { - description: 'Operation ids must follow a specified case convention', - message: '{{error}}', - formats: [oas3], - given: operations, - severity: 'warn', - then: { - function: operationIdCasingConvention, - functionOptions: { - type: 'snake', - }, +export const description = + "Operation ids must follow a specified case convention"; +export const message = "{{error}}"; +export const formats = [oas3]; +export const given = operations; +export const severity = "warn"; +export const then = { + function: operationIdCasingConvention, + functionOptions: { + type: "snake", }, }; diff --git a/packages/ruleset/src/rules/operationid-naming-convention.js b/packages/ruleset/src/rules/operationid-naming-convention.js index dc33e431c..bedf6dd2f 100644 --- a/packages/ruleset/src/rules/operationid-naming-convention.js +++ b/packages/ruleset/src/rules/operationid-naming-convention.js @@ -3,20 +3,18 @@ * SPDX-License-Identifier: Apache2.0 */ -const { oas2, oas3 } = require('@stoplight/spectral-formats'); -const { operationIdNamingConvention } = require('../functions'); +import { oas2, oas3 } from "@stoplight/spectral-formats"; +import { operationIdNamingConvention } from "../functions"; -module.exports = { - description: 'Operation ids should follow naming convention', - message: '{{error}}', - given: ['$'], - severity: 'warn', - formats: [oas2, oas3], - resolved: true, - then: { - function: operationIdNamingConvention, - functionOptions: { - strict: true, - }, +export const description = "Operation ids should follow naming convention"; +export const message = "{{error}}"; +export const given = ["$"]; +export const severity = "warn"; +export const formats = [oas2, oas3]; +export const resolved = true; +export const then = { + function: operationIdNamingConvention, + functionOptions: { + strict: true, }, }; diff --git a/packages/ruleset/src/rules/optional-request-body-deprecated.js b/packages/ruleset/src/rules/optional-request-body-deprecated.js index 2d962a28b..95bef70d5 100644 --- a/packages/ruleset/src/rules/optional-request-body-deprecated.js +++ b/packages/ruleset/src/rules/optional-request-body-deprecated.js @@ -3,19 +3,17 @@ * SPDX-License-Identifier: Apache2.0 */ -const { oas3 } = require('@stoplight/spectral-formats'); -const { optionalRequestBodyDeprecated } = require('../functions'); +import { oas3 } from "@stoplight/spectral-formats"; +import { optionalRequestBodyDeprecated } from "../functions"; -module.exports = { - description: - 'An optional requestBody with required properties should probably be required', - message: '{{description}}', - given: - "$.paths[*][*][?(@property === 'requestBody' && @.required !== true)].content[*].schema", - severity: 'off', - formats: [oas3], - resolved: true, - then: { - function: optionalRequestBodyDeprecated, - }, +export const description = + "An optional requestBody with required properties should probably be required"; +export const message = "{{description}}"; +export const given = + "$.paths[*][*][?(@property === 'requestBody' && @.required !== true)].content[*].schema"; +export const severity = "off"; +export const formats = [oas3]; +export const resolved = true; +export const then = { + function: optionalRequestBodyDeprecated, }; diff --git a/packages/ruleset/src/rules/optional-request-body.js b/packages/ruleset/src/rules/optional-request-body.js index a27da45e8..a1867587b 100644 --- a/packages/ruleset/src/rules/optional-request-body.js +++ b/packages/ruleset/src/rules/optional-request-body.js @@ -3,19 +3,17 @@ * SPDX-License-Identifier: Apache2.0 */ -const { oas3 } = require('@stoplight/spectral-formats'); -const { optionalRequestBody } = require('../functions'); +import { oas3 } from "@stoplight/spectral-formats"; +import { optionalRequestBody } from "../functions"; -module.exports = { - description: - 'An optional requestBody with required properties should probably be required', - message: '{{description}}', - given: - "$.paths[*][*][?(@property === 'requestBody' && @.required !== true)].content[*].schema", - severity: 'info', - formats: [oas3], - resolved: true, - then: { - function: optionalRequestBody, - }, +export const description = + "An optional requestBody with required properties should probably be required"; +export const message = "{{description}}"; +export const given = + "$.paths[*][*][?(@property === 'requestBody' && @.required !== true)].content[*].schema"; +export const severity = "info"; +export const formats = [oas3]; +export const resolved = true; +export const then = { + function: optionalRequestBody, }; diff --git a/packages/ruleset/src/rules/pagination-style.js b/packages/ruleset/src/rules/pagination-style.js index ccec49110..1f25b7441 100644 --- a/packages/ruleset/src/rules/pagination-style.js +++ b/packages/ruleset/src/rules/pagination-style.js @@ -3,20 +3,17 @@ * SPDX-License-Identifier: Apache2.0 */ -const { - paths, -} = require('@ibm-cloud/openapi-ruleset-utilities/src/collections'); -const { oas3 } = require('@stoplight/spectral-formats'); -const { paginationStyle } = require('../functions'); +import { paths } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; +import { oas3 } from "@stoplight/spectral-formats"; +import { paginationStyle } from "../functions"; -module.exports = { - description: 'List operations should have correct pagination style', - message: '{{error}}', - given: paths, - severity: 'warn', - formats: [oas3], - resolved: true, - then: { - function: paginationStyle, - }, +export const description = + "List operations should have correct pagination style"; +export const message = "{{error}}"; +export const given = paths; +export const severity = "warn"; +export const formats = [oas3]; +export const resolved = true; +export const then = { + function: paginationStyle, }; diff --git a/packages/ruleset/src/rules/parameter-casing-convention.js b/packages/ruleset/src/rules/parameter-casing-convention.js index f234b1c11..95e023fae 100644 --- a/packages/ruleset/src/rules/parameter-casing-convention.js +++ b/packages/ruleset/src/rules/parameter-casing-convention.js @@ -3,55 +3,50 @@ * SPDX-License-Identifier: Apache2.0 */ -const { - parameters, -} = require('@ibm-cloud/openapi-ruleset-utilities/src/collections'); -const { oas3 } = require('@stoplight/spectral-formats'); -const { parameterCasingConvention } = require('../functions'); +import { parameters } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; +import { oas3 } from "@stoplight/spectral-formats"; +import { parameterCasingConvention } from "../functions"; -module.exports = { - description: 'Parameter names must follow case conventions', - message: '{{error}}', - formats: [oas3], - given: parameters, - severity: 'error', - resolved: true, - then: { - function: parameterCasingConvention, +export const description = "Parameter names must follow case conventions"; +export const message = "{{error}}"; +export const formats = [oas3]; +export const given = parameters; +export const severity = "error"; +export const resolved = true; +export const then = { + function: parameterCasingConvention, - // The configuration of this rule should be an object - // with keys that represent the different parameter types - // to be checked for property casing conventions: 'query', 'path', and 'header'. - // The value of each key should be an object that is either the appropriate - // configuration needed by Spectral's casing() function OR pattern() function - // to enforce the desired case convention for parameters of that type. - // To disable case convention checks for a particular parameter type, - // simply remove that entry from the config object. - functionOptions: { - // Allow snake case for query parameter names, - // but also allow '.' within the name. - query: { - type: 'snake', - separator: { - char: '.', - }, - }, - - // Allow snake case for path parameter names. - path: { - type: 'snake', + // The configuration of this rule should be an object + // with keys that represent the different parameter types + // to be checked for property casing conventions: 'query', 'path', and 'header'. + // The value of each key should be an object that is either the appropriate + // configuration needed by Spectral's casing() function OR pattern() function + // to enforce the desired case convention for parameters of that type. + // To disable case convention checks for a particular parameter type, + // simply remove that entry from the config object. + functionOptions: { + // Allow snake case for query parameter names, + // but also allow '.' within the name. + query: { + type: "snake", + separator: { + char: ".", }, + }, - // Spectral casing convention types aren't robust enough to handle - // the complexity of headers, so we define our own kebab/pascal case regex. - header: { - match: '/^[A-Z]+[a-z0-9]*-*([A-Z]+[a-z0-9]*-*)*$/', - }, + // Allow snake case for path parameter names. + path: { + type: "snake", + }, - // Define an alternate message for the header pattern validation - // to avoid using the default Spectral message. - headerMessage: - 'Header parameter names must be kebab-separated pascal case', + // Spectral casing convention types aren't robust enough to handle + // the complexity of headers, so we define our own kebab/pascal case regex. + header: { + match: "/^[A-Z]+[a-z0-9]*-*([A-Z]+[a-z0-9]*-*)*$/", }, + + // Define an alternate message for the header pattern validation + // to avoid using the default Spectral message. + headerMessage: "Header parameter names must be kebab-separated pascal case", }, }; diff --git a/packages/ruleset/src/rules/parameter-default.js b/packages/ruleset/src/rules/parameter-default.js index 3ad6b5bf3..2cff153cb 100644 --- a/packages/ruleset/src/rules/parameter-default.js +++ b/packages/ruleset/src/rules/parameter-default.js @@ -3,20 +3,17 @@ * SPDX-License-Identifier: Apache2.0 */ -const { - parameters, -} = require('@ibm-cloud/openapi-ruleset-utilities/src/collections'); -const { oas2, oas3 } = require('@stoplight/spectral-formats'); -const { parameterDefault } = require('../functions'); +import { parameters } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; +import { oas2, oas3 } from "@stoplight/spectral-formats"; +import { parameterDefault } from "../functions"; -module.exports = { - description: 'Required parameters should not define a default value', - message: '{{error}}', - given: parameters, - severity: 'warn', - formats: [oas2, oas3], - resolved: true, - then: { - function: parameterDefault, - }, +export const description = + "Required parameters should not define a default value"; +export const message = "{{error}}"; +export const given = parameters; +export const severity = "warn"; +export const formats = [oas2, oas3]; +export const resolved = true; +export const then = { + function: parameterDefault, }; diff --git a/packages/ruleset/src/rules/parameter-description-exists.js b/packages/ruleset/src/rules/parameter-description-exists.js index 9a4f77804..6c8ff9ee4 100644 --- a/packages/ruleset/src/rules/parameter-description-exists.js +++ b/packages/ruleset/src/rules/parameter-description-exists.js @@ -3,20 +3,16 @@ * SPDX-License-Identifier: Apache2.0 */ -const { - parameters, -} = require('@ibm-cloud/openapi-ruleset-utilities/src/collections'); -const { oas3 } = require('@stoplight/spectral-formats'); -const { parameterDescriptionExists } = require('../functions'); +import { parameters } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; +import { oas3 } from "@stoplight/spectral-formats"; +import { parameterDescriptionExists } from "../functions"; -module.exports = { - description: 'Parameters should have a non-empty description', - message: '{{error}}', - given: parameters, - severity: 'warn', - formats: [oas3], - resolved: true, - then: { - function: parameterDescriptionExists, - }, +export const description = "Parameters should have a non-empty description"; +export const message = "{{error}}"; +export const given = parameters; +export const severity = "warn"; +export const formats = [oas3]; +export const resolved = true; +export const then = { + function: parameterDescriptionExists, }; diff --git a/packages/ruleset/src/rules/parameter-order.js b/packages/ruleset/src/rules/parameter-order.js index 054b0aec2..6583053e4 100644 --- a/packages/ruleset/src/rules/parameter-order.js +++ b/packages/ruleset/src/rules/parameter-order.js @@ -3,21 +3,17 @@ * SPDX-License-Identifier: Apache2.0 */ -const { - operations, -} = require('@ibm-cloud/openapi-ruleset-utilities/src/collections'); -const { oas3 } = require('@stoplight/spectral-formats'); -const { parameterOrder } = require('../functions'); +import { operations } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; +import { oas3 } from "@stoplight/spectral-formats"; +import { parameterOrder } from "../functions"; -module.exports = { - description: - 'All required operation parameters should be listed before any optional parameters.', - message: '{{error}}', - given: operations, - severity: 'warn', - formats: [oas3], - resolved: true, - then: { - function: parameterOrder, - }, +export const description = + "All required operation parameters should be listed before any optional parameters."; +export const message = "{{error}}"; +export const given = operations; +export const severity = "warn"; +export const formats = [oas3]; +export const resolved = true; +export const then = { + function: parameterOrder, }; diff --git a/packages/ruleset/src/rules/parameter-schema-or-content-exists.js b/packages/ruleset/src/rules/parameter-schema-or-content-exists.js index 190d23aa8..12e7e3aa6 100644 --- a/packages/ruleset/src/rules/parameter-schema-or-content-exists.js +++ b/packages/ruleset/src/rules/parameter-schema-or-content-exists.js @@ -3,17 +3,15 @@ * SPDX-License-Identifier: Apache2.0 */ -const { oas3 } = require('@stoplight/spectral-formats'); -const { schemaOrContentProvided } = require('../functions'); +import { oas3 } from "@stoplight/spectral-formats"; +import { schemaOrContentProvided } from "../functions"; -module.exports = { - description: 'Parameter must provide either a schema or content', - message: '{{error}}', - severity: 'error', - formats: [oas3], - resolved: true, - given: '$.paths[*][*].parameters[*]', - then: { - function: schemaOrContentProvided, - }, +export const description = "Parameter must provide either a schema or content"; +export const message = "{{error}}"; +export const severity = "error"; +export const formats = [oas3]; +export const resolved = true; +export const given = "$.paths[*][*].parameters[*]"; +export const then = { + function: schemaOrContentProvided, }; diff --git a/packages/ruleset/src/rules/patch-request-content-type.js b/packages/ruleset/src/rules/patch-request-content-type.js index a90ca2d6e..44f6a56b0 100644 --- a/packages/ruleset/src/rules/patch-request-content-type.js +++ b/packages/ruleset/src/rules/patch-request-content-type.js @@ -3,21 +3,17 @@ * SPDX-License-Identifier: Apache2.0 */ -const { - patchOperations, -} = require('@ibm-cloud/openapi-ruleset-utilities/src/collections'); -const { oas3 } = require('@stoplight/spectral-formats'); -const { patchRequestContentType } = require('../functions'); +import { patchOperations } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; +import { oas3 } from "@stoplight/spectral-formats"; +import { patchRequestContentType } from "../functions"; -module.exports = { - description: - 'PATCH operations should support content types application/json-patch+json or application/merge-patch+json', - message: '{{description}}', - given: patchOperations, - severity: 'warn', - formats: [oas3], - resolved: true, - then: { - function: patchRequestContentType, - }, +export const description = + "PATCH operations should support content types application/json-patch+json or application/merge-patch+json"; +export const message = "{{description}}"; +export const given = patchOperations; +export const severity = "warn"; +export const formats = [oas3]; +export const resolved = true; +export const then = { + function: patchRequestContentType, }; diff --git a/packages/ruleset/src/rules/path-parameter-not-crn.js b/packages/ruleset/src/rules/path-parameter-not-crn.js index 40eff1972..22b59137c 100644 --- a/packages/ruleset/src/rules/path-parameter-not-crn.js +++ b/packages/ruleset/src/rules/path-parameter-not-crn.js @@ -3,21 +3,19 @@ * SPDX-License-Identifier: Apache2.0 */ -const { oas3 } = require('@stoplight/spectral-formats'); -const { pathParameterNotCRN } = require('../functions'); +import { oas3 } from "@stoplight/spectral-formats"; +import { pathParameterNotCRN } from "../functions"; -module.exports = { - description: - 'Path parameters should not be defined as a CRN (Cloud Resource Name) value', - message: '{{error}}', - formats: [oas3], - given: [ - '$.paths[*].parameters[?(@.in === "path")]', - '$.paths[*][get,put,post,delete,options,head,patch,trace].parameters[?(@.in === "path")]', - ], - severity: 'warn', - resolved: true, - then: { - function: pathParameterNotCRN, - }, +export const description = + "Path parameters should not be defined as a CRN (Cloud Resource Name) value"; +export const message = "{{error}}"; +export const formats = [oas3]; +export const given = [ + '$.paths[*].parameters[?(@.in === "path")]', + '$.paths[*][get,put,post,delete,options,head,patch,trace].parameters[?(@.in === "path")]', +]; +export const severity = "warn"; +export const resolved = true; +export const then = { + function: pathParameterNotCRN, }; diff --git a/packages/ruleset/src/rules/path-segment-casing-convention.js b/packages/ruleset/src/rules/path-segment-casing-convention.js index 64b3d9a45..438ec6a0d 100644 --- a/packages/ruleset/src/rules/path-segment-casing-convention.js +++ b/packages/ruleset/src/rules/path-segment-casing-convention.js @@ -3,22 +3,19 @@ * SPDX-License-Identifier: Apache2.0 */ -const { - paths, -} = require('@ibm-cloud/openapi-ruleset-utilities/src/collections'); -const { oas3 } = require('@stoplight/spectral-formats'); -const { pathSegmentCasingConvention } = require('../functions'); +import { paths } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; +import { oas3 } from "@stoplight/spectral-formats"; +import { pathSegmentCasingConvention } from "../functions"; -module.exports = { - description: 'Path segments must follow a specified case convention', - message: '{{error}}', - formats: [oas3], - given: paths, - severity: 'error', - then: { - function: pathSegmentCasingConvention, - functionOptions: { - type: 'snake', - }, +export const description = + "Path segments must follow a specified case convention"; +export const message = "{{error}}"; +export const formats = [oas3]; +export const given = paths; +export const severity = "error"; +export const then = { + function: pathSegmentCasingConvention, + functionOptions: { + type: "snake", }, }; diff --git a/packages/ruleset/src/rules/pattern-properties.js b/packages/ruleset/src/rules/pattern-properties.js index 8d0a13064..ba56bb1ad 100644 --- a/packages/ruleset/src/rules/pattern-properties.js +++ b/packages/ruleset/src/rules/pattern-properties.js @@ -3,21 +3,17 @@ * SPDX-License-Identifier: Apache2.0 */ -const { oas3_1 } = require('@stoplight/spectral-formats'); -const { patternPropertiesCheck } = require('../functions'); -const { - schemas, -} = require('@ibm-cloud/openapi-ruleset-utilities/src/collections'); +import { oas3_1 } from "@stoplight/spectral-formats"; +import { patternPropertiesCheck } from "../functions"; +import { schemas } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; -module.exports = { - description: - 'Enforces certain restrictions on the use of "patternProperties" within a schema.', - message: '{{error}}', - given: schemas, - severity: 'error', - formats: [oas3_1], - resolved: true, - then: { - function: patternPropertiesCheck, - }, +export const description = + 'Enforces certain restrictions on the use of "patternProperties" within a schema.'; +export const message = "{{error}}"; +export const given = schemas; +export const severity = "error"; +export const formats = [oas3_1]; +export const resolved = true; +export const then = { + function: patternPropertiesCheck, }; diff --git a/packages/ruleset/src/rules/precondition-header.js b/packages/ruleset/src/rules/precondition-header.js index 73e000830..43fd5d18e 100644 --- a/packages/ruleset/src/rules/precondition-header.js +++ b/packages/ruleset/src/rules/precondition-header.js @@ -3,21 +3,17 @@ * SPDX-License-Identifier: Apache2.0 */ -const { - operations, -} = require('@ibm-cloud/openapi-ruleset-utilities/src/collections'); -const { oas3 } = require('@stoplight/spectral-formats'); -const { preconditionHeader } = require('../functions'); +import { operations } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; +import { oas3 } from "@stoplight/spectral-formats"; +import { preconditionHeader } from "../functions"; -module.exports = { - description: - 'Operations with `412` response must support at least one conditional header.', - message: '{{error}}', - formats: [oas3], - given: operations, - severity: 'error', - resolved: true, - then: { - function: preconditionHeader, - }, +export const description = + "Operations with `412` response must support at least one conditional header."; +export const message = "{{error}}"; +export const formats = [oas3]; +export const given = operations; +export const severity = "error"; +export const resolved = true; +export const then = { + function: preconditionHeader, }; diff --git a/packages/ruleset/src/rules/prefer-token-pagination.js b/packages/ruleset/src/rules/prefer-token-pagination.js index 3ddafe334..674dd9e6c 100644 --- a/packages/ruleset/src/rules/prefer-token-pagination.js +++ b/packages/ruleset/src/rules/prefer-token-pagination.js @@ -3,21 +3,17 @@ * SPDX-License-Identifier: Apache2.0 */ -const { - paths, -} = require('@ibm-cloud/openapi-ruleset-utilities/src/collections'); -const { oas3 } = require('@stoplight/spectral-formats'); -const { preferTokenPagination } = require('../functions'); +import { paths } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; +import { oas3 } from "@stoplight/spectral-formats"; +import { preferTokenPagination } from "../functions"; -module.exports = { - description: - 'Paginated list operations should use token-based pagination, rather than offset/limit pagination.', - message: '{{error}}', - given: paths, - severity: 'warn', - formats: [oas3], - resolved: true, - then: { - function: preferTokenPagination, - }, +export const description = + "Paginated list operations should use token-based pagination, rather than offset/limit pagination."; +export const message = "{{error}}"; +export const given = paths; +export const severity = "warn"; +export const formats = [oas3]; +export const resolved = true; +export const then = { + function: preferTokenPagination, }; diff --git a/packages/ruleset/src/rules/property-attributes.js b/packages/ruleset/src/rules/property-attributes.js index 8bfe54e01..c17905032 100644 --- a/packages/ruleset/src/rules/property-attributes.js +++ b/packages/ruleset/src/rules/property-attributes.js @@ -3,21 +3,17 @@ * SPDX-License-Identifier: Apache2.0 */ -const { - schemas, -} = require('@ibm-cloud/openapi-ruleset-utilities/src/collections'); -const { oas3 } = require('@stoplight/spectral-formats'); -const { propertyAttributes } = require('../functions'); +import { schemas } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; +import { oas3 } from "@stoplight/spectral-formats"; +import { propertyAttributes } from "../functions"; -module.exports = { - description: - 'Performs checks on specific attributes of a schema or schema property', - message: '{{error}}', - given: schemas, - severity: 'error', - formats: [oas3], - resolved: true, - then: { - function: propertyAttributes, - }, +export const description = + "Performs checks on specific attributes of a schema or schema property"; +export const message = "{{error}}"; +export const given = schemas; +export const severity = "error"; +export const formats = [oas3]; +export const resolved = true; +export const then = { + function: propertyAttributes, }; diff --git a/packages/ruleset/src/rules/property-casing-convention.js b/packages/ruleset/src/rules/property-casing-convention.js index b12a26e10..4d7fd90a8 100644 --- a/packages/ruleset/src/rules/property-casing-convention.js +++ b/packages/ruleset/src/rules/property-casing-convention.js @@ -3,22 +3,19 @@ * SPDX-License-Identifier: Apache2.0 */ -const { - schemas, -} = require('@ibm-cloud/openapi-ruleset-utilities/src/collections'); -const { oas3 } = require('@stoplight/spectral-formats'); -const { propertyCasingConvention } = require('../functions'); +import { schemas } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; +import { oas3 } from "@stoplight/spectral-formats"; +import { propertyCasingConvention } from "../functions"; -module.exports = { - description: 'Property names must follow a specified case convention', - message: '{{error}}', - formats: [oas3], - given: schemas, - severity: 'error', - then: { - function: propertyCasingConvention, - functionOptions: { - type: 'snake', - }, +export const description = + "Property names must follow a specified case convention"; +export const message = "{{error}}"; +export const formats = [oas3]; +export const given = schemas; +export const severity = "error"; +export const then = { + function: propertyCasingConvention, + functionOptions: { + type: "snake", }, }; diff --git a/packages/ruleset/src/rules/property-consistent-name-and-type.js b/packages/ruleset/src/rules/property-consistent-name-and-type.js index c4b2267c6..a404a5bd8 100644 --- a/packages/ruleset/src/rules/property-consistent-name-and-type.js +++ b/packages/ruleset/src/rules/property-consistent-name-and-type.js @@ -3,24 +3,20 @@ * SPDX-License-Identifier: Apache2.0 */ -const { - schemas, -} = require('@ibm-cloud/openapi-ruleset-utilities/src/collections'); -const { oas3 } = require('@stoplight/spectral-formats'); -const { propertyConsistentNameAndType } = require('../functions'); +import { schemas } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; +import { oas3 } from "@stoplight/spectral-formats"; +import { propertyConsistentNameAndType } from "../functions"; -module.exports = { - description: - 'Schema properties that have the same name should also have the same types.', - message: '{{error}}', - formats: [oas3], - given: schemas, - severity: 'off', - resolved: true, - then: { - function: propertyConsistentNameAndType, - functionOptions: { - excludedProperties: ['code', 'default', 'type', 'value'], - }, +export const description = + "Schema properties that have the same name should also have the same types."; +export const message = "{{error}}"; +export const formats = [oas3]; +export const given = schemas; +export const severity = "off"; +export const resolved = true; +export const then = { + function: propertyConsistentNameAndType, + functionOptions: { + excludedProperties: ["code", "default", "type", "value"], }, }; diff --git a/packages/ruleset/src/rules/property-description-exists.js b/packages/ruleset/src/rules/property-description-exists.js index 5245ac5ce..6d0396416 100644 --- a/packages/ruleset/src/rules/property-description-exists.js +++ b/packages/ruleset/src/rules/property-description-exists.js @@ -3,20 +3,17 @@ * SPDX-License-Identifier: Apache2.0 */ -const { - schemas, -} = require('@ibm-cloud/openapi-ruleset-utilities/src/collections'); -const { oas3 } = require('@stoplight/spectral-formats'); -const { propertyDescriptionExists } = require('../functions'); +import { schemas } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; +import { oas3 } from "@stoplight/spectral-formats"; +import { propertyDescriptionExists } from "../functions"; -module.exports = { - description: 'Schema properties should have a non-empty description', - message: '{{error}}', - given: schemas, - severity: 'warn', - formats: [oas3], - resolved: true, - then: { - function: propertyDescriptionExists, - }, +export const description = + "Schema properties should have a non-empty description"; +export const message = "{{error}}"; +export const given = schemas; +export const severity = "warn"; +export const formats = [oas3]; +export const resolved = true; +export const then = { + function: propertyDescriptionExists, }; diff --git a/packages/ruleset/src/rules/property-name-collision.js b/packages/ruleset/src/rules/property-name-collision.js index b62488073..8e60867b1 100644 --- a/packages/ruleset/src/rules/property-name-collision.js +++ b/packages/ruleset/src/rules/property-name-collision.js @@ -3,21 +3,17 @@ * SPDX-License-Identifier: Apache2.0 */ -const { - schemas, -} = require('@ibm-cloud/openapi-ruleset-utilities/src/collections'); -const { oas3 } = require('@stoplight/spectral-formats'); -const { propertyNameCollision } = require('../functions'); +import { schemas } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; +import { oas3 } from "@stoplight/spectral-formats"; +import { propertyNameCollision } from "../functions"; -module.exports = { - description: - 'Avoid duplicate property names within a schema, even if they differ by case convention', - message: '{{error}}', - formats: [oas3], - given: schemas, - severity: 'error', - resolved: true, - then: { - function: propertyNameCollision, - }, +export const description = + "Avoid duplicate property names within a schema, even if they differ by case convention"; +export const message = "{{error}}"; +export const formats = [oas3]; +export const given = schemas; +export const severity = "error"; +export const resolved = true; +export const then = { + function: propertyNameCollision, }; diff --git a/packages/ruleset/src/rules/redirect-response-body.js b/packages/ruleset/src/rules/redirect-response-body.js index bd14d8b15..c9fb2e321 100644 --- a/packages/ruleset/src/rules/redirect-response-body.js +++ b/packages/ruleset/src/rules/redirect-response-body.js @@ -3,21 +3,17 @@ * SPDX-License-Identifier: Apache2.0 */ -const { - operations, -} = require('@ibm-cloud/openapi-ruleset-utilities/src/collections'); -const { oas3 } = require('@stoplight/spectral-formats'); -const { redirectResponseBody } = require('../functions'); +import { operations } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; +import { oas3 } from "@stoplight/spectral-formats"; +import { redirectResponseBody } from "../functions"; -module.exports = { - description: - 'Performs multiple checks on the response body based on status codes', - message: '{{error}}', - formats: [oas3], - given: operations, - severity: 'error', - resolved: true, - then: { - function: redirectResponseBody, - }, +export const description = + "Performs multiple checks on the response body based on status codes"; +export const message = "{{error}}"; +export const formats = [oas3]; +export const given = operations; +export const severity = "error"; +export const resolved = true; +export const then = { + function: redirectResponseBody, }; diff --git a/packages/ruleset/src/rules/ref-pattern.js b/packages/ruleset/src/rules/ref-pattern.js index e6e0704f1..a23aa00a7 100644 --- a/packages/ruleset/src/rules/ref-pattern.js +++ b/packages/ruleset/src/rules/ref-pattern.js @@ -3,17 +3,15 @@ * SPDX-License-Identifier: Apache2.0 */ -const { oas3 } = require('@stoplight/spectral-formats'); -const { refPattern } = require('../functions'); +import { oas3 } from "@stoplight/spectral-formats"; +import { refPattern } from "../functions"; -module.exports = { - description: '$refs must follow the correct pattern.', - message: '{{error}}', - given: '$..$ref', - severity: 'warn', - formats: [oas3], - resolved: false, - then: { - function: refPattern, - }, +export const description = "$refs must follow the correct pattern."; +export const message = "{{error}}"; +export const given = "$..$ref"; +export const severity = "warn"; +export const formats = [oas3]; +export const resolved = false; +export const then = { + function: refPattern, }; diff --git a/packages/ruleset/src/rules/ref-sibling-duplicate-description.js b/packages/ruleset/src/rules/ref-sibling-duplicate-description.js index adb01e385..c380d3dbc 100644 --- a/packages/ruleset/src/rules/ref-sibling-duplicate-description.js +++ b/packages/ruleset/src/rules/ref-sibling-duplicate-description.js @@ -3,21 +3,17 @@ * SPDX-License-Identifier: Apache2.0 */ -const { - schemas, -} = require('@ibm-cloud/openapi-ruleset-utilities/src/collections'); -const { oas3 } = require('@stoplight/spectral-formats'); -const { refSiblingDuplicateDescription } = require('../functions'); +import { schemas } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; +import { oas3 } from "@stoplight/spectral-formats"; +import { refSiblingDuplicateDescription } from "../functions"; -module.exports = { - description: - 'Schemas and schema properties should avoid duplicate descriptions within allOf $ref siblings', - message: '{{error}}', - given: schemas, - severity: 'warn', - formats: [oas3], - resolved: true, - then: { - function: refSiblingDuplicateDescription, - }, +export const description = + "Schemas and schema properties should avoid duplicate descriptions within allOf $ref siblings"; +export const message = "{{error}}"; +export const given = schemas; +export const severity = "warn"; +export const formats = [oas3]; +export const resolved = true; +export const then = { + function: refSiblingDuplicateDescription, }; diff --git a/packages/ruleset/src/rules/request-and-response-content.js b/packages/ruleset/src/rules/request-and-response-content.js index d82c848b5..cb266e659 100644 --- a/packages/ruleset/src/rules/request-and-response-content.js +++ b/packages/ruleset/src/rules/request-and-response-content.js @@ -3,20 +3,16 @@ * SPDX-License-Identifier: Apache2.0 */ -const { - operations, -} = require('@ibm-cloud/openapi-ruleset-utilities/src/collections'); -const { oas3 } = require('@stoplight/spectral-formats'); -const { requestAndResponseContent } = require('../functions'); +import { operations } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; +import { oas3 } from "@stoplight/spectral-formats"; +import { requestAndResponseContent } from "../functions"; -module.exports = { - description: - 'Request bodies and non-204 responses should define a content object', - given: operations, - severity: 'warn', - formats: [oas3], - resolved: true, - then: { - function: requestAndResponseContent, - }, +export const description = + "Request bodies and non-204 responses should define a content object"; +export const given = operations; +export const severity = "warn"; +export const formats = [oas3]; +export const resolved = true; +export const then = { + function: requestAndResponseContent, }; diff --git a/packages/ruleset/src/rules/requestbody-is-object.js b/packages/ruleset/src/rules/requestbody-is-object.js index a7e537192..515169dc7 100644 --- a/packages/ruleset/src/rules/requestbody-is-object.js +++ b/packages/ruleset/src/rules/requestbody-is-object.js @@ -3,18 +3,16 @@ * SPDX-License-Identifier: Apache2.0 */ -const { enumeration } = require('@stoplight/spectral-functions'); +import { enumeration } from "@stoplight/spectral-functions"; -module.exports = { - description: 'All request bodies MUST be structured as an object', - given: - '$.paths[*][*].requestBody.content[?(@property ~= "^application\\\\/json(;.*)*$")].schema', - severity: 'error', - then: { - field: 'type', - function: enumeration, - functionOptions: { - values: ['object'], - }, +export const description = "All request bodies MUST be structured as an object"; +export const given = + '$.paths[*][*].requestBody.content[?(@property ~= "^application\\\\/json(;.*)*$")].schema'; +export const severity = "error"; +export const then = { + field: "type", + function: enumeration, + functionOptions: { + values: ["object"], }, }; diff --git a/packages/ruleset/src/rules/requestbody-name.js b/packages/ruleset/src/rules/requestbody-name.js index 2f204f56f..8b59bcf63 100644 --- a/packages/ruleset/src/rules/requestbody-name.js +++ b/packages/ruleset/src/rules/requestbody-name.js @@ -3,21 +3,17 @@ * SPDX-License-Identifier: Apache2.0 */ -const { - operations, -} = require('@ibm-cloud/openapi-ruleset-utilities/src/collections'); -const { oas3 } = require('@stoplight/spectral-formats'); -const { requestBodyName } = require('../functions'); +import { operations } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; +import { oas3 } from "@stoplight/spectral-formats"; +import { requestBodyName } from "../functions"; -module.exports = { - description: - 'Verifies that operations have the x-codegen-request-body-name extension set when needed', - message: '{{error}}', - given: operations, - severity: 'off', - formats: [oas3], - resolved: true, - then: { - function: requestBodyName, - }, +export const description = + "Verifies that operations have the x-codegen-request-body-name extension set when needed"; +export const message = "{{error}}"; +export const given = operations; +export const severity = "off"; +export const formats = [oas3]; +export const resolved = true; +export const then = { + function: requestBodyName, }; diff --git a/packages/ruleset/src/rules/required-array-properties-in-response.js b/packages/ruleset/src/rules/required-array-properties-in-response.js index 1d79e8d35..6061d27fb 100644 --- a/packages/ruleset/src/rules/required-array-properties-in-response.js +++ b/packages/ruleset/src/rules/required-array-properties-in-response.js @@ -3,19 +3,16 @@ * SPDX-License-Identifier: Apache2.0 */ -const { - responseSchemas, -} = require('@ibm-cloud/openapi-ruleset-utilities/src/collections'); +import { responseSchemas } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; -const { requiredArrayPropertiesInResponse } = require('../functions'); +import { requiredArrayPropertiesInResponse } from "../functions"; -module.exports = { - description: 'Array properties defined in a response should be required.', - message: '{{error}}', - given: responseSchemas, - severity: 'error', - resolved: true, - then: { - function: requiredArrayPropertiesInResponse, - }, +export const description = + "Array properties defined in a response should be required."; +export const message = "{{error}}"; +export const given = responseSchemas; +export const severity = "error"; +export const resolved = true; +export const then = { + function: requiredArrayPropertiesInResponse, }; diff --git a/packages/ruleset/src/rules/required-enum-properties-in-response.js b/packages/ruleset/src/rules/required-enum-properties-in-response.js index c7ef5c44e..02a3cdd6c 100644 --- a/packages/ruleset/src/rules/required-enum-properties-in-response.js +++ b/packages/ruleset/src/rules/required-enum-properties-in-response.js @@ -3,19 +3,16 @@ * SPDX-License-Identifier: Apache2.0 */ -const { - responseSchemas, -} = require('@ibm-cloud/openapi-ruleset-utilities/src/collections'); +import { responseSchemas } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; -const { requiredEnumPropertiesInResponse } = require('../functions'); +import { requiredEnumPropertiesInResponse } from "../functions"; -module.exports = { - description: 'Enumeration properties defined in a response must be required.', - message: '{{error}}', - given: responseSchemas, - severity: 'error', - resolved: true, - then: { - function: requiredEnumPropertiesInResponse, - }, +export const description = + "Enumeration properties defined in a response must be required."; +export const message = "{{error}}"; +export const given = responseSchemas; +export const severity = "error"; +export const resolved = true; +export const then = { + function: requiredEnumPropertiesInResponse, }; diff --git a/packages/ruleset/src/rules/required-property-missing.js b/packages/ruleset/src/rules/required-property-missing.js index f7f9483be..aa5dcf78b 100644 --- a/packages/ruleset/src/rules/required-property-missing.js +++ b/packages/ruleset/src/rules/required-property-missing.js @@ -3,19 +3,15 @@ * SPDX-License-Identifier: Apache2.0 */ -const { - schemas, -} = require('@ibm-cloud/openapi-ruleset-utilities/src/collections'); -const { oas3 } = require('@stoplight/spectral-formats'); -const { requiredProperty } = require('../functions'); +import { schemas } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; +import { oas3 } from "@stoplight/spectral-formats"; +import { requiredProperty } from "../functions"; -module.exports = { - description: 'A required property is not in the schema', - message: '{{error}}', - formats: [oas3], - given: schemas, - severity: 'error', - then: { - function: requiredProperty, - }, +export const description = "A required property is not in the schema"; +export const message = "{{error}}"; +export const formats = [oas3]; +export const given = schemas; +export const severity = "error"; +export const then = { + function: requiredProperty, }; diff --git a/packages/ruleset/src/rules/resource-response-consistency.js b/packages/ruleset/src/rules/resource-response-consistency.js index b2485c087..8de284485 100644 --- a/packages/ruleset/src/rules/resource-response-consistency.js +++ b/packages/ruleset/src/rules/resource-response-consistency.js @@ -3,18 +3,16 @@ * SPDX-License-Identifier: Apache2.0 */ -const { oas3 } = require('@stoplight/spectral-formats'); -const { resourceResponseConsistency } = require('../functions'); +import { oas3 } from "@stoplight/spectral-formats"; +import { resourceResponseConsistency } from "../functions"; -module.exports = { - description: - 'Operations that create or update a resource should return the same schema as the "GET" request for the resource.', - message: '{{error}}', - formats: [oas3], - given: [`$.paths[*][put,post,patch]`], - severity: 'warn', - resolved: true, - then: { - function: resourceResponseConsistency, - }, +export const description = + 'Operations that create or update a resource should return the same schema as the "GET" request for the resource.'; +export const message = "{{error}}"; +export const formats = [oas3]; +export const given = [`$.paths[*][put,post,patch]`]; +export const severity = "warn"; +export const resolved = true; +export const then = { + function: resourceResponseConsistency, }; diff --git a/packages/ruleset/src/rules/response-example-exists.js b/packages/ruleset/src/rules/response-example-exists.js index d4c5e8b73..831aef2c2 100644 --- a/packages/ruleset/src/rules/response-example-exists.js +++ b/packages/ruleset/src/rules/response-example-exists.js @@ -3,16 +3,14 @@ * SPDX-License-Identifier: Apache2.0 */ -const { responseExampleExists } = require('../functions'); +import { responseExampleExists } from "../functions"; -module.exports = { - description: 'Each response should include an example', - message: '{{error}}', - given: - '$.paths[*][*].responses[?(@property >= 200 && @property < 300)].content.application/json', - severity: 'warn', - resolved: true, - then: { - function: responseExampleExists, - }, +export const description = "Each response should include an example"; +export const message = "{{error}}"; +export const given = + "$.paths[*][*].responses[?(@property >= 200 && @property < 300)].content.application/json"; +export const severity = "warn"; +export const resolved = true; +export const then = { + function: responseExampleExists, }; diff --git a/packages/ruleset/src/rules/response-status-codes.js b/packages/ruleset/src/rules/response-status-codes.js index fc73d50d6..795170506 100644 --- a/packages/ruleset/src/rules/response-status-codes.js +++ b/packages/ruleset/src/rules/response-status-codes.js @@ -3,21 +3,17 @@ * SPDX-License-Identifier: Apache2.0 */ -const { - operations, -} = require('@ibm-cloud/openapi-ruleset-utilities/src/collections'); -const { oas3 } = require('@stoplight/spectral-formats'); -const { responseStatusCodes } = require('../functions'); +import { operations } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; +import { oas3 } from "@stoplight/spectral-formats"; +import { responseStatusCodes } from "../functions"; -module.exports = { - description: - 'Performs multiple checks on the status codes used in operation responses', - message: '{{error}}', - formats: [oas3], - given: operations, - severity: 'warn', - resolved: true, - then: { - function: responseStatusCodes, - }, +export const description = + "Performs multiple checks on the status codes used in operation responses"; +export const message = "{{error}}"; +export const formats = [oas3]; +export const given = operations; +export const severity = "warn"; +export const resolved = true; +export const then = { + function: responseStatusCodes, }; diff --git a/packages/ruleset/src/rules/schema-casing-convention.js b/packages/ruleset/src/rules/schema-casing-convention.js index 76579a13a..ae524381d 100644 --- a/packages/ruleset/src/rules/schema-casing-convention.js +++ b/packages/ruleset/src/rules/schema-casing-convention.js @@ -3,19 +3,18 @@ * SPDX-License-Identifier: Apache2.0 */ -const { oas3 } = require('@stoplight/spectral-formats'); -const { schemaCasingConvention } = require('../functions'); +import { oas3 } from "@stoplight/spectral-formats"; +import { schemaCasingConvention } from "../functions"; -module.exports = { - description: 'Schema names must follow a specified case convention', - message: '{{error}}', - formats: [oas3], - given: ['$.components'], - severity: 'warn', - then: { - function: schemaCasingConvention, - functionOptions: { - match: '/^[A-Z]+[a-z0-9]+([A-Z]+[a-z0-9]*)*$/', - }, +export const description = + "Schema names must follow a specified case convention"; +export const message = "{{error}}"; +export const formats = [oas3]; +export const given = ["$.components"]; +export const severity = "warn"; +export const then = { + function: schemaCasingConvention, + functionOptions: { + match: "/^[A-Z]+[a-z0-9]+([A-Z]+[a-z0-9]*)*$/", }, }; diff --git a/packages/ruleset/src/rules/schema-description-exists.js b/packages/ruleset/src/rules/schema-description-exists.js index 18014a573..e55f5722a 100644 --- a/packages/ruleset/src/rules/schema-description-exists.js +++ b/packages/ruleset/src/rules/schema-description-exists.js @@ -3,20 +3,16 @@ * SPDX-License-Identifier: Apache2.0 */ -const { - schemas, -} = require('@ibm-cloud/openapi-ruleset-utilities/src/collections'); -const { oas3 } = require('@stoplight/spectral-formats'); -const { schemaDescriptionExists } = require('../functions'); +import { schemas } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; +import { oas3 } from "@stoplight/spectral-formats"; +import { schemaDescriptionExists } from "../functions"; -module.exports = { - description: 'Schemas should have a non-empty description', - message: '{{error}}', - given: schemas, - severity: 'warn', - formats: [oas3], - resolved: true, - then: { - function: schemaDescriptionExists, - }, +export const description = "Schemas should have a non-empty description"; +export const message = "{{error}}"; +export const given = schemas; +export const severity = "warn"; +export const formats = [oas3]; +export const resolved = true; +export const then = { + function: schemaDescriptionExists, }; diff --git a/packages/ruleset/src/rules/schema-keywords.js b/packages/ruleset/src/rules/schema-keywords.js index a49ea3791..77798b31d 100644 --- a/packages/ruleset/src/rules/schema-keywords.js +++ b/packages/ruleset/src/rules/schema-keywords.js @@ -3,60 +3,56 @@ * SPDX-License-Identifier: Apache2.0 */ -const { - schemas, -} = require('@ibm-cloud/openapi-ruleset-utilities/src/collections'); -const { oas3_1 } = require('@stoplight/spectral-formats'); -const { allowedKeywords } = require('../functions'); +import { schemas } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; +import { oas3_1 } from "@stoplight/spectral-formats"; +import { allowedKeywords } from "../functions"; -module.exports = { - description: - 'Verifies that schema objects include only allowed-listed keywords', - message: '{{error}}', - severity: 'error', - formats: [oas3_1], - resolved: true, - given: schemas, - then: { - function: allowedKeywords, - functionOptions: { - keywordAllowList: [ - '$ref', - 'additionalProperties', - 'allOf', - 'anyOf', - 'default', - 'description', - 'discriminator', - 'enum', - 'example', - 'examples', - 'exclusiveMaximum', - 'exclusiveMinimum', - 'format', - 'items', - 'maximum', - 'maxItems', - 'maxLength', - 'maxProperties', - 'minimum', - 'minItems', - 'minLength', - 'minProperties', - 'multipleOf', - 'not', - 'oneOf', - 'pattern', - 'patternProperties', - 'properties', - 'readOnly', - 'required', - 'title', - 'type', - 'uniqueItems', - 'unevaluatedProperties', - 'writeOnly', - ], - }, +export const description = + "Verifies that schema objects include only allowed-listed keywords"; +export const message = "{{error}}"; +export const severity = "error"; +export const formats = [oas3_1]; +export const resolved = true; +export const given = schemas; +export const then = { + function: allowedKeywords, + functionOptions: { + keywordAllowList: [ + "$ref", + "additionalProperties", + "allOf", + "anyOf", + "default", + "description", + "discriminator", + "enum", + "example", + "examples", + "exclusiveMaximum", + "exclusiveMinimum", + "format", + "items", + "maximum", + "maxItems", + "maxLength", + "maxProperties", + "minimum", + "minItems", + "minLength", + "minProperties", + "multipleOf", + "not", + "oneOf", + "pattern", + "patternProperties", + "properties", + "readOnly", + "required", + "title", + "type", + "uniqueItems", + "unevaluatedProperties", + "writeOnly", + ], }, }; diff --git a/packages/ruleset/src/rules/schema-naming-convention.js b/packages/ruleset/src/rules/schema-naming-convention.js index 42ced061b..f2888ae86 100644 --- a/packages/ruleset/src/rules/schema-naming-convention.js +++ b/packages/ruleset/src/rules/schema-naming-convention.js @@ -3,17 +3,16 @@ * SPDX-License-Identifier: Apache2.0 */ -const { oas3 } = require('@stoplight/spectral-formats'); -const { schemaNamingConvention } = require('../functions'); +import { oas3 } from "@stoplight/spectral-formats"; +import { schemaNamingConvention } from "../functions"; -module.exports = { - description: 'Schemas should follow naming conventions in the API Handbook', - message: '{{error}}', - given: ['$'], - severity: 'warn', - formats: [oas3], - resolved: true, - then: { - function: schemaNamingConvention, - }, +export const description = + "Schemas should follow naming conventions in the API Handbook"; +export const message = "{{error}}"; +export const given = ["$"]; +export const severity = "warn"; +export const formats = [oas3]; +export const resolved = true; +export const then = { + function: schemaNamingConvention, }; diff --git a/packages/ruleset/src/rules/schema-type-exists.js b/packages/ruleset/src/rules/schema-type-exists.js index e9beaaae3..4c74c583b 100644 --- a/packages/ruleset/src/rules/schema-type-exists.js +++ b/packages/ruleset/src/rules/schema-type-exists.js @@ -3,21 +3,17 @@ * SPDX-License-Identifier: Apache2.0 */ -const { - schemas, -} = require('@ibm-cloud/openapi-ruleset-utilities/src/collections'); -const { oas3 } = require('@stoplight/spectral-formats'); -const { schemaTypeExists } = require('../functions'); +import { schemas } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; +import { oas3 } from "@stoplight/spectral-formats"; +import { schemaTypeExists } from "../functions"; -module.exports = { - description: - 'Schemas and schema properties should have a non-empty `type` field. **This rule is disabled by default.**', - message: '{{error}}', - given: schemas, - severity: 'off', - formats: [oas3], - resolved: true, - then: { - function: schemaTypeExists, - }, +export const description = + "Schemas and schema properties should have a non-empty `type` field. **This rule is disabled by default.**"; +export const message = "{{error}}"; +export const given = schemas; +export const severity = "off"; +export const formats = [oas3]; +export const resolved = true; +export const then = { + function: schemaTypeExists, }; diff --git a/packages/ruleset/src/rules/schema-type-format.js b/packages/ruleset/src/rules/schema-type-format.js index ef7522c65..0f3160362 100644 --- a/packages/ruleset/src/rules/schema-type-format.js +++ b/packages/ruleset/src/rules/schema-type-format.js @@ -3,21 +3,17 @@ * SPDX-License-Identifier: Apache2.0 */ -const { - schemas, -} = require('@ibm-cloud/openapi-ruleset-utilities/src/collections'); -const { oas3 } = require('@stoplight/spectral-formats'); -const { schemaTypeFormat } = require('../functions'); +import { schemas } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; +import { oas3 } from "@stoplight/spectral-formats"; +import { schemaTypeFormat } from "../functions"; -module.exports = { - description: - 'Schemas and schema properties must use a valid combination of type and format', - message: '{{error}}', - given: schemas, - severity: 'error', - formats: [oas3], - resolved: true, - then: { - function: schemaTypeFormat, - }, +export const description = + "Schemas and schema properties must use a valid combination of type and format"; +export const message = "{{error}}"; +export const given = schemas; +export const severity = "error"; +export const formats = [oas3]; +export const resolved = true; +export const then = { + function: schemaTypeFormat, }; diff --git a/packages/ruleset/src/rules/securityscheme-attributes.js b/packages/ruleset/src/rules/securityscheme-attributes.js index ed504ba23..a2f1ccfdc 100644 --- a/packages/ruleset/src/rules/securityscheme-attributes.js +++ b/packages/ruleset/src/rules/securityscheme-attributes.js @@ -3,21 +3,17 @@ * SPDX-License-Identifier: Apache2.0 */ -const { - securitySchemes, -} = require('@ibm-cloud/openapi-ruleset-utilities/src/collections'); -const { oas3 } = require('@stoplight/spectral-formats'); -const { securitySchemeAttributes } = require('../functions'); +import { securitySchemes } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; +import { oas3 } from "@stoplight/spectral-formats"; +import { securitySchemeAttributes } from "../functions"; -module.exports = { - description: - 'Validates the attributes of security schemes within an OpenAPI 3 document', - message: '{{error}}', - given: securitySchemes, - severity: 'error', - formats: [oas3], - resolved: true, - then: { - function: securitySchemeAttributes, - }, +export const description = + "Validates the attributes of security schemes within an OpenAPI 3 document"; +export const message = "{{error}}"; +export const given = securitySchemes; +export const severity = "error"; +export const formats = [oas3]; +export const resolved = true; +export const then = { + function: securitySchemeAttributes, }; diff --git a/packages/ruleset/src/rules/securityschemes.js b/packages/ruleset/src/rules/securityschemes.js index 7bedf430f..275937a5f 100644 --- a/packages/ruleset/src/rules/securityschemes.js +++ b/packages/ruleset/src/rules/securityschemes.js @@ -3,17 +3,16 @@ * SPDX-License-Identifier: Apache2.0 */ -const { oas3 } = require('@stoplight/spectral-formats'); -const { securitySchemes } = require('../functions'); +import { oas3 } from "@stoplight/spectral-formats"; +import { securitySchemes } from "../functions"; -module.exports = { - description: 'Validates the security schemes within an OpenAPI 3 document', - message: '{{error}}', - given: ['$'], - severity: 'warn', - formats: [oas3], - resolved: true, - then: { - function: securitySchemes, - }, +export const description = + "Validates the security schemes within an OpenAPI 3 document"; +export const message = "{{error}}"; +export const given = ["$"]; +export const severity = "warn"; +export const formats = [oas3]; +export const resolved = true; +export const then = { + function: securitySchemes, }; diff --git a/packages/ruleset/src/rules/server-variable-default-value.js b/packages/ruleset/src/rules/server-variable-default-value.js index 203e9e3b3..7d655129c 100644 --- a/packages/ruleset/src/rules/server-variable-default-value.js +++ b/packages/ruleset/src/rules/server-variable-default-value.js @@ -3,16 +3,14 @@ * SPDX-License-Identifier: Apache2.0 */ -const { oas3 } = require('@stoplight/spectral-formats'); -const { truthy } = require('@stoplight/spectral-functions'); +import { oas3 } from "@stoplight/spectral-formats"; +import { truthy } from "@stoplight/spectral-functions"; -module.exports = { - description: 'Server variable should have default value', - severity: 'warn', - resolved: false, - formats: [oas3], - given: '$.servers[*][variables][*][default]', - then: { - function: truthy, - }, +export const description = "Server variable should have default value"; +export const severity = "warn"; +export const resolved = false; +export const formats = [oas3]; +export const given = "$.servers[*][variables][*][default]"; +export const then = { + function: truthy, }; diff --git a/packages/ruleset/src/rules/string-attributes.js b/packages/ruleset/src/rules/string-attributes.js index be19067ec..a6522c5fd 100644 --- a/packages/ruleset/src/rules/string-attributes.js +++ b/packages/ruleset/src/rules/string-attributes.js @@ -3,20 +3,17 @@ * SPDX-License-Identifier: Apache2.0 */ -const { - schemas, -} = require('@ibm-cloud/openapi-ruleset-utilities/src/collections'); -const { oas3 } = require('@stoplight/spectral-formats'); -const { stringAttributes } = require('../functions'); +import { schemas } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; +import { oas3 } from "@stoplight/spectral-formats"; +import { stringAttributes } from "../functions"; -module.exports = { - description: 'String schemas should have certain attributes defined', - message: '{{error}}', - severity: 'warn', - formats: [oas3], - resolved: true, - given: schemas, - then: { - function: stringAttributes, - }, +export const description = + "String schemas should have certain attributes defined"; +export const message = "{{error}}"; +export const severity = "warn"; +export const formats = [oas3]; +export const resolved = true; +export const given = schemas; +export const then = { + function: stringAttributes, }; diff --git a/packages/ruleset/src/rules/summary-sentence-style.js b/packages/ruleset/src/rules/summary-sentence-style.js index 29feb4ffb..346160b03 100644 --- a/packages/ruleset/src/rules/summary-sentence-style.js +++ b/packages/ruleset/src/rules/summary-sentence-style.js @@ -3,19 +3,18 @@ * SPDX-License-Identifier: Apache2.0 */ -const { oas3 } = require('@stoplight/spectral-formats'); -const { pattern } = require('@stoplight/spectral-functions'); +import { oas3 } from "@stoplight/spectral-formats"; +import { pattern } from "@stoplight/spectral-functions"; -module.exports = { - description: 'Operation summaries should not have a trailing period', - severity: 'warn', - formats: [oas3], - resolved: false, - given: '$.paths[*][*].summary', - then: { - function: pattern, - functionOptions: { - notMatch: '\\.$', - }, +export const description = + "Operation summaries should not have a trailing period"; +export const severity = "warn"; +export const formats = [oas3]; +export const resolved = false; +export const given = "$.paths[*][*].summary"; +export const then = { + function: pattern, + functionOptions: { + notMatch: "\\.$", }, }; diff --git a/packages/ruleset/src/rules/typed-enum.js b/packages/ruleset/src/rules/typed-enum.js index f66616f86..20018c5c5 100644 --- a/packages/ruleset/src/rules/typed-enum.js +++ b/packages/ruleset/src/rules/typed-enum.js @@ -3,10 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { - schemas, -} = require('@ibm-cloud/openapi-ruleset-utilities/src/collections'); -const { oas } = require('@stoplight/spectral-rulesets'); +import { schemas } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; +import { oas } from "@stoplight/spectral-rulesets"; // Spectral's "typed-enum" rule matches any object that happens to have a // "type" and "enum" field on it. This results in false positives when @@ -15,12 +13,12 @@ const { oas } = require('@stoplight/spectral-rulesets'); // This solves the issue by replacing the "given" field with our "schemas" // collection, modified to only give schemas with a "type" and "enum" field, // while otherwise maintaining Spectral's implementation of the rule. -const typedEnum = oas.rules['typed-enum']; -typedEnum.given = schemas.map(s => +const typedEnum = oas.rules["typed-enum"]; +typedEnum.given = schemas.map((s) => s.replace( - '[*].schema', - '[?(@.schema && @.schema.type && @.schema.enum)].schema' - ) + "[*].schema", + "[?(@.schema && @.schema.type && @.schema.enum)].schema", + ), ); -module.exports = typedEnum; +export default typedEnum; diff --git a/packages/ruleset/src/rules/unevaluated-properties.js b/packages/ruleset/src/rules/unevaluated-properties.js index c100ac0d6..9e7114212 100644 --- a/packages/ruleset/src/rules/unevaluated-properties.js +++ b/packages/ruleset/src/rules/unevaluated-properties.js @@ -3,21 +3,17 @@ * SPDX-License-Identifier: Apache2.0 */ -const { oas3_1 } = require('@stoplight/spectral-formats'); -const { unevaluatedProperties } = require('../functions'); -const { - schemas, -} = require('@ibm-cloud/openapi-ruleset-utilities/src/collections'); +import { oas3_1 } from "@stoplight/spectral-formats"; +import { unevaluatedProperties } from "../functions"; +import { schemas } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; -module.exports = { - description: - 'Enforces certain restrictions on the use of "unevaluatedProperties" within a schema.', - message: '{{error}}', - given: schemas, - severity: 'error', - formats: [oas3_1], - resolved: true, - then: { - function: unevaluatedProperties, - }, +export const description = + 'Enforces certain restrictions on the use of "unevaluatedProperties" within a schema.'; +export const message = "{{error}}"; +export const given = schemas; +export const severity = "error"; +export const formats = [oas3_1]; +export const resolved = true; +export const then = { + function: unevaluatedProperties, }; diff --git a/packages/ruleset/src/rules/unique-parameter-request-property-names.js b/packages/ruleset/src/rules/unique-parameter-request-property-names.js index 8d5c911a7..72d4ce88e 100644 --- a/packages/ruleset/src/rules/unique-parameter-request-property-names.js +++ b/packages/ruleset/src/rules/unique-parameter-request-property-names.js @@ -3,21 +3,17 @@ * SPDX-License-Identifier: Apache2.0 */ -const { - paths, -} = require('@ibm-cloud/openapi-ruleset-utilities/src/collections'); -const { oas3 } = require('@stoplight/spectral-formats'); -const { uniqueParameterRequestPropertyNames } = require('../functions'); +import { paths } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; +import { oas3 } from "@stoplight/spectral-formats"; +import { uniqueParameterRequestPropertyNames } from "../functions"; -module.exports = { - description: - 'Names of requestBody properties should not be the same as operation parameter names', - message: '{{error}}', - given: paths, - severity: 'error', - formats: [oas3], - resolved: true, - then: { - function: uniqueParameterRequestPropertyNames, - }, +export const description = + "Names of requestBody properties should not be the same as operation parameter names"; +export const message = "{{error}}"; +export const given = paths; +export const severity = "error"; +export const formats = [oas3]; +export const resolved = true; +export const then = { + function: uniqueParameterRequestPropertyNames, }; diff --git a/packages/ruleset/src/rules/unused-tags.js b/packages/ruleset/src/rules/unused-tags.js index f0a77ba95..9564eb1ea 100644 --- a/packages/ruleset/src/rules/unused-tags.js +++ b/packages/ruleset/src/rules/unused-tags.js @@ -3,17 +3,15 @@ * SPDX-License-Identifier: Apache2.0 */ -const { oas3 } = require('@stoplight/spectral-formats'); -const { unusedTags } = require('../functions'); +import { oas3 } from "@stoplight/spectral-formats"; +import { unusedTags } from "../functions"; -module.exports = { - description: 'Checks that each defined tag is actually used', - message: '{{error}}', - given: ['$'], - severity: 'warn', - formats: [oas3], - resolved: true, - then: { - function: unusedTags, - }, +export const description = "Checks that each defined tag is actually used"; +export const message = "{{error}}"; +export const given = ["$"]; +export const severity = "warn"; +export const formats = [oas3]; +export const resolved = true; +export const then = { + function: unusedTags, }; diff --git a/packages/ruleset/src/rules/use-date-based-format.js b/packages/ruleset/src/rules/use-date-based-format.js index cf4276e27..d9c0375f1 100644 --- a/packages/ruleset/src/rules/use-date-based-format.js +++ b/packages/ruleset/src/rules/use-date-based-format.js @@ -3,21 +3,17 @@ * SPDX-License-Identifier: Apache2.0 */ -const { - schemas, -} = require('@ibm-cloud/openapi-ruleset-utilities/src/collections'); -const { oas3 } = require('@stoplight/spectral-formats'); -const { useDateBasedFormat } = require('../functions'); +import { schemas } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; +import { oas3 } from "@stoplight/spectral-formats"; +import { useDateBasedFormat } from "../functions"; -module.exports = { - description: - 'Heuristically determine when a schema should have a format of "date" or "date-time"', - message: '{{error}}', - severity: 'warn', - formats: [oas3], - resolved: true, - given: schemas, - then: { - function: useDateBasedFormat, - }, +export const description = + 'Heuristically determine when a schema should have a format of "date" or "date-time"'; +export const message = "{{error}}"; +export const severity = "warn"; +export const formats = [oas3]; +export const resolved = true; +export const given = schemas; +export const then = { + function: useDateBasedFormat, }; diff --git a/packages/ruleset/src/rules/valid-path-segments.js b/packages/ruleset/src/rules/valid-path-segments.js index 0e0914638..1c08d541c 100644 --- a/packages/ruleset/src/rules/valid-path-segments.js +++ b/packages/ruleset/src/rules/valid-path-segments.js @@ -3,20 +3,17 @@ * SPDX-License-Identifier: Apache2.0 */ -const { - paths, -} = require('@ibm-cloud/openapi-ruleset-utilities/src/collections'); -const { oas3 } = require('@stoplight/spectral-formats'); -const { validatePathSegments } = require('../functions'); +import { paths } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; +import { oas3 } from "@stoplight/spectral-formats"; +import { validatePathSegments } from "../functions"; -module.exports = { - description: 'Validates individual path segments within a path string', - message: '{{error}}', - formats: [oas3], - given: paths, - severity: 'error', - resolved: true, - then: { - function: validatePathSegments, - }, +export const description = + "Validates individual path segments within a path string"; +export const message = "{{error}}"; +export const formats = [oas3]; +export const given = paths; +export const severity = "error"; +export const resolved = true; +export const then = { + function: validatePathSegments, }; diff --git a/packages/ruleset/src/rules/valid-schema-example.js b/packages/ruleset/src/rules/valid-schema-example.js index 12c5fde21..53fcc3044 100644 --- a/packages/ruleset/src/rules/valid-schema-example.js +++ b/packages/ruleset/src/rules/valid-schema-example.js @@ -3,21 +3,17 @@ * SPDX-License-Identifier: Apache2.0 */ -const { - schemas, -} = require('@ibm-cloud/openapi-ruleset-utilities/src/collections'); -const { oas3 } = require('@stoplight/spectral-formats'); -const { validSchemaExample } = require('../functions'); +import { schemas } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; +import { oas3 } from "@stoplight/spectral-formats"; +import { validSchemaExample } from "../functions"; -module.exports = { - description: - 'Schema examples should validate against the schema they are defined for', - message: '{{error}}', - given: schemas, - severity: 'warn', - formats: [oas3], - resolved: true, - then: { - function: validSchemaExample, - }, +export const description = + "Schema examples should validate against the schema they are defined for"; +export const message = "{{error}}"; +export const given = schemas; +export const severity = "warn"; +export const formats = [oas3]; +export const resolved = true; +export const then = { + function: validSchemaExample, }; diff --git a/packages/ruleset/src/rules/well-defined-dictionaries.js b/packages/ruleset/src/rules/well-defined-dictionaries.js index 48d773bad..fda4abc60 100644 --- a/packages/ruleset/src/rules/well-defined-dictionaries.js +++ b/packages/ruleset/src/rules/well-defined-dictionaries.js @@ -3,21 +3,17 @@ * SPDX-License-Identifier: Apache2.0 */ -const { - schemas, -} = require('@ibm-cloud/openapi-ruleset-utilities/src/collections'); -const { oas3 } = require('@stoplight/spectral-formats'); -const { wellDefinedDictionaries } = require('../functions'); +import { schemas } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; +import { oas3 } from "@stoplight/spectral-formats"; +import { wellDefinedDictionaries } from "../functions"; -module.exports = { - description: - 'Dictionaries must be well defined and all values must share a single type.', - message: '{{error}}', - given: schemas, - severity: 'warn', - formats: [oas3], - resolved: true, - then: { - function: wellDefinedDictionaries, - }, +export const description = + "Dictionaries must be well defined and all values must share a single type."; +export const message = "{{error}}"; +export const given = schemas; +export const severity = "warn"; +export const formats = [oas3]; +export const resolved = true; +export const then = { + function: wellDefinedDictionaries, }; From 55b6b0b15e28486d1b68e9baf4ac346373c6c9de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=ADdia=20Tarcza?= <100163235+diatrcz@users.noreply.github.com> Date: Thu, 11 Jun 2026 10:59:27 +0200 Subject: [PATCH 05/16] build: esm config ruleset utils MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Lídia Tarcza <100163235+diatrcz@users.noreply.github.com> --- eslint.config.mjs | 2 +- .../src/functions/accept-and-return-models.js | 6 +- .../ruleset/src/functions/allowed-keywords.js | 2 +- .../src/functions/anchored-patterns.js | 6 +- .../ruleset/src/functions/api-symmetry.js | 6 +- .../ruleset/src/functions/array-attributes.js | 8 +- .../ruleset/src/functions/array-of-arrays.js | 6 +- .../ruleset/src/functions/array-responses.js | 2 +- .../src/functions/avoid-multiple-types.js | 2 +- .../ruleset/src/functions/binary-schemas.js | 6 +- .../ruleset/src/functions/circular-refs.js | 2 +- .../functions/collection-array-property.js | 6 +- .../functions/consecutive-path-segments.js | 2 +- packages/ruleset/src/functions/delete-body.js | 2 +- .../functions/disallowed-header-parameter.js | 2 +- .../discriminator-property-exists.js | 6 +- .../src/functions/duplicate-path-parameter.js | 6 +- .../src/functions/enum-casing-convention.js | 2 +- .../src/functions/error-response-schemas.js | 6 +- .../src/functions/etag-header-exists.js | 2 +- packages/ruleset/src/functions/index.js | 156 +++--- .../ruleset/src/functions/inline-schemas.js | 6 +- .../src/functions/integer-attributes.js | 6 +- .../src/functions/major-version-in-path.js | 2 +- .../src/functions/merge-patch-properties.js | 2 +- .../src/functions/no-ambiguous-paths.js | 2 +- .../src/functions/no-nullable-properties.js | 6 +- .../src/functions/no-operation-requestbody.js | 2 +- .../src/functions/no-ref-in-example.js | 2 +- .../src/functions/no-superfluous-allof.js | 2 +- .../src/functions/no-unsupported-keywords.js | 2 +- .../src/functions/operation-summary-exists.js | 2 +- .../src/functions/operation-summary-length.js | 2 +- .../operationid-casing-convention.js | 2 +- .../operationid-naming-convention.js | 8 +- .../ruleset/src/functions/pagination-style.js | 6 +- .../functions/parameter-casing-convention.js | 6 +- .../src/functions/parameter-default.js | 2 +- .../functions/parameter-description-exists.js | 2 +- .../ruleset/src/functions/parameter-order.js | 2 +- .../functions/patch-request-content-type.js | 4 +- .../src/functions/path-parameter-not-crn.js | 7 +- .../path-segment-casing-convention.js | 2 +- .../src/functions/pattern-properties.js | 6 +- .../src/functions/precondition-header.js | 2 +- .../src/functions/prefer-token-pagination.js | 4 +- .../src/functions/property-attributes.js | 6 +- .../functions/property-casing-convention.js | 2 +- .../property-consistent-name-and-type.js | 6 +- .../functions/property-description-exists.js | 6 +- .../src/functions/property-name-collision.js | 2 +- .../src/functions/redirect-response-body.js | 6 +- packages/ruleset/src/functions/ref-pattern.js | 2 +- .../ref-sibling-duplicate-description.js | 2 +- .../functions/request-and-response-content.js | 12 +- .../ruleset/src/functions/requestbody-name.js | 8 +- .../required-array-properties-in-response.js | 6 +- .../required-enum-properties-in-response.js | 6 +- .../src/functions/required-property.js | 6 +- .../resource-response-consistency.js | 8 +- .../src/functions/response-example-exists.js | 2 +- .../src/functions/response-status-codes.js | 6 +- .../src/functions/schema-casing-convention.js | 2 +- .../functions/schema-description-exists.js | 6 +- .../src/functions/schema-naming-convention.js | 6 +- .../functions/schema-or-content-provided.js | 2 +- .../src/functions/schema-type-exists.js | 6 +- .../src/functions/schema-type-format.js | 2 +- .../functions/securityscheme-attributes.js | 2 +- .../ruleset/src/functions/securityschemes.js | 2 +- .../src/functions/string-attributes.js | 6 +- .../src/functions/unevaluated-properties.js | 2 +- ...unique-parameter-request-property-names.js | 6 +- packages/ruleset/src/functions/unused-tags.js | 2 +- .../src/functions/use-date-based-format.js | 6 +- .../src/functions/valid-path-segments.js | 2 +- .../src/functions/valid-schema-example.js | 2 +- .../functions/well-defined-dictionaries.js | 6 +- packages/ruleset/src/ibm-oas.js | 471 +++++++++++------- .../src/rules/accept-and-return-models.js | 12 +- packages/ruleset/src/rules/accept-header.js | 3 +- .../ruleset/src/rules/anchored-patterns.js | 12 +- packages/ruleset/src/rules/api-symmetry.js | 12 +- .../ruleset/src/rules/array-attributes.js | 12 +- packages/ruleset/src/rules/array-of-arrays.js | 12 +- packages/ruleset/src/rules/array-responses.js | 12 +- .../ruleset/src/rules/authorization-header.js | 14 +- .../ruleset/src/rules/avoid-multiple-types.js | 10 +- packages/ruleset/src/rules/binary-schemas.js | 12 +- packages/ruleset/src/rules/circular-refs.js | 12 +- .../src/rules/collection-array-property.js | 12 +- .../src/rules/consecutive-path-segments.js | 12 +- .../src/rules/content-contains-schema.js | 14 +- .../ruleset/src/rules/content-type-header.js | 14 +- .../src/rules/content-type-is-specific.js | 14 +- packages/ruleset/src/rules/delete-body.js | 12 +- .../rules/discriminator-property-exists.js | 12 +- .../src/rules/duplicate-path-parameter.js | 10 +- .../src/rules/enum-casing-convention.js | 14 +- .../src/rules/error-content-type-is-json.js | 12 +- .../src/rules/error-response-schemas.js | 12 +- .../ruleset/src/rules/etag-header-exists.js | 12 +- .../src/rules/examples-name-contains-space.js | 14 +- .../ruleset/src/rules/ibm-sdk-operations.js | 14 +- .../src/rules/if-modified-since-header.js | 14 +- .../src/rules/if-unmodified-since-header.js | 14 +- packages/ruleset/src/rules/index.js | 184 +++---- packages/ruleset/src/rules/inline-schemas.js | 12 +- .../ruleset/src/rules/integer-attributes.js | 12 +- .../src/rules/major-version-in-path.js | 12 +- .../src/rules/merge-patch-properties.js | 12 +- .../ruleset/src/rules/no-ambiguous-paths.js | 12 +- .../src/rules/no-nullable-properties.js | 12 +- .../src/rules/no-operation-requestbody.js | 14 +- .../ruleset/src/rules/no-ref-in-example.js | 12 +- .../ruleset/src/rules/no-superfluous-allof.js | 10 +- .../src/rules/no-unsupported-keywords.js | 12 +- .../ruleset/src/rules/operation-responses.js | 10 +- .../src/rules/operation-summary-exists.js | 10 +- .../src/rules/operation-summary-length.js | 12 +- .../rules/operationid-casing-convention.js | 14 +- .../rules/operationid-naming-convention.js | 12 +- .../rules/optional-request-body-deprecated.js | 10 +- .../src/rules/optional-request-body.js | 10 +- .../ruleset/src/rules/pagination-style.js | 12 +- .../src/rules/parameter-casing-convention.js | 22 +- .../ruleset/src/rules/parameter-default.js | 12 +- .../src/rules/parameter-description-exists.js | 12 +- packages/ruleset/src/rules/parameter-order.js | 12 +- .../parameter-schema-or-content-exists.js | 12 +- .../src/rules/patch-request-content-type.js | 12 +- .../src/rules/path-parameter-not-crn.js | 10 +- .../rules/path-segment-casing-convention.js | 14 +- .../ruleset/src/rules/pattern-properties.js | 10 +- .../ruleset/src/rules/precondition-header.js | 12 +- .../src/rules/prefer-token-pagination.js | 12 +- .../ruleset/src/rules/property-attributes.js | 12 +- .../src/rules/property-casing-convention.js | 14 +- .../property-consistent-name-and-type.js | 14 +- .../src/rules/property-description-exists.js | 12 +- .../src/rules/property-name-collision.js | 12 +- .../src/rules/redirect-response-body.js | 12 +- packages/ruleset/src/rules/ref-pattern.js | 12 +- .../ref-sibling-duplicate-description.js | 12 +- .../src/rules/request-and-response-content.js | 10 +- .../src/rules/requestbody-is-object.js | 10 +- .../ruleset/src/rules/requestbody-name.js | 12 +- .../required-array-properties-in-response.js | 10 +- .../required-enum-properties-in-response.js | 10 +- .../src/rules/required-property-missing.js | 12 +- .../rules/resource-response-consistency.js | 8 +- .../src/rules/response-example-exists.js | 10 +- .../src/rules/response-status-codes.js | 12 +- .../src/rules/schema-casing-convention.js | 14 +- .../src/rules/schema-description-exists.js | 12 +- packages/ruleset/src/rules/schema-keywords.js | 82 +-- .../src/rules/schema-naming-convention.js | 12 +- .../ruleset/src/rules/schema-type-exists.js | 12 +- .../ruleset/src/rules/schema-type-format.js | 12 +- .../src/rules/securityscheme-attributes.js | 12 +- packages/ruleset/src/rules/securityschemes.js | 12 +- .../rules/server-variable-default-value.js | 10 +- .../ruleset/src/rules/string-attributes.js | 12 +- .../src/rules/summary-sentence-style.js | 12 +- packages/ruleset/src/rules/typed-enum.js | 14 +- .../src/rules/unevaluated-properties.js | 10 +- ...unique-parameter-request-property-names.js | 12 +- packages/ruleset/src/rules/unused-tags.js | 12 +- .../src/rules/use-date-based-format.js | 10 +- .../ruleset/src/rules/valid-path-segments.js | 12 +- .../ruleset/src/rules/valid-schema-example.js | 12 +- .../src/rules/well-defined-dictionaries.js | 12 +- .../src/utils/compute-refs-at-paths.js | 2 +- packages/ruleset/src/utils/constants.js | 2 +- .../ruleset/src/utils/date-based-utils.js | 2 +- .../utils/get-composite-schema-attribute.js | 4 +- .../src/utils/get-resource-oriented-paths.js | 6 +- .../get-resource-specific-sibling-path.js | 4 +- .../ruleset/src/utils/get-response-codes.js | 4 +- .../src/utils/get-schema-name-at-path.js | 2 +- packages/ruleset/src/utils/index.js | 46 +- .../ruleset/src/utils/is-create-operation.js | 5 +- packages/ruleset/src/utils/is-deprecated.js | 4 +- .../src/utils/is-empty-object-schema.js | 2 +- .../ruleset/src/utils/is-operation-of-type.js | 2 +- .../src/utils/is-ref-sibling-schema.js | 2 +- .../src/utils/is-requestbody-exploded.js | 6 +- packages/ruleset/src/utils/logger-factory.js | 28 +- .../utils/merge-allof-schema-properties.js | 4 +- packages/ruleset/src/utils/mimetype-utils.js | 2 +- .../ruleset/src/utils/nested-schema-keys.js | 2 +- .../ruleset/src/utils/pagination-utils.js | 9 +- ...path-has-minimally-represented-resource.js | 4 +- .../ruleset/src/utils/path-location-utils.js | 4 +- .../ruleset/src/utils/path-matches-regexp.js | 2 +- .../ruleset/src/utils/schema-finding-utils.js | 11 +- .../rules/no-operation-requestbody.test.js | 30 +- .../test/utils/pagination-utils.test.js | 8 +- .../test/utils/schema-finding-utils.test.js | 6 +- .../tests/configuration-manager.test.js | 6 +- .../tests/option-handling.test.js | 16 +- .../test/scoring-tool/output.test.js | 5 +- .../validator/test/scoring-tool/score.test.js | 9 +- scripts/generate-utilities-docs.js | 8 +- 204 files changed, 1343 insertions(+), 1201 deletions(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index 2a0121f65..d13806d38 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -23,7 +23,7 @@ export default [ files: ['**/*.js'], languageOptions: { ecmaVersion: 13, - sourceType: 'commonjs', + sourceType: 'module', globals: { ...globals.node, ...globals.es2021, diff --git a/packages/ruleset/src/functions/accept-and-return-models.js b/packages/ruleset/src/functions/accept-and-return-models.js index ebdfa35f1..dfe2a16d4 100644 --- a/packages/ruleset/src/functions/accept-and-return-models.js +++ b/packages/ruleset/src/functions/accept-and-return-models.js @@ -7,8 +7,8 @@ import { isObject, isObjectSchema, schemaHasConstraint, -} from "@ibm-cloud/openapi-ruleset-utilities"; -import { supportsJsonContent, LoggerFactory } from "../utils"; +} from '@ibm-cloud/openapi-ruleset-utilities'; +import { supportsJsonContent, LoggerFactory } from '../utils'; let ruleId; let logger; @@ -31,7 +31,7 @@ export default function acceptAndReturnModels(operation, options, context) { logger = LoggerFactory.getInstance().getLogger(ruleId); } return checkForProperties(operation, context.path); -}; +} /** * This function checks to ensure a request or response body schema diff --git a/packages/ruleset/src/functions/allowed-keywords.js b/packages/ruleset/src/functions/allowed-keywords.js index dc4b5dca8..de2cde049 100644 --- a/packages/ruleset/src/functions/allowed-keywords.js +++ b/packages/ruleset/src/functions/allowed-keywords.js @@ -21,7 +21,7 @@ export default function (obj, options, context) { true, true ); -}; +} /** * This function will check to make sure that 'obj' is an object that contains only fields (keys) diff --git a/packages/ruleset/src/functions/anchored-patterns.js b/packages/ruleset/src/functions/anchored-patterns.js index 0096e522b..838159434 100644 --- a/packages/ruleset/src/functions/anchored-patterns.js +++ b/packages/ruleset/src/functions/anchored-patterns.js @@ -6,9 +6,9 @@ import { isStringSchema, validateSubschemas, -} from "@ibm-cloud/openapi-ruleset-utilities"; +} from '@ibm-cloud/openapi-ruleset-utilities'; -import { LoggerFactory } from "../utils"; +import { LoggerFactory } from '../utils'; let ruleId; let logger; @@ -24,7 +24,7 @@ export default function (schema, _opts, context) { true, false ); -}; +} /** * This function will check the "pattern" attribute found on each string schema diff --git a/packages/ruleset/src/functions/api-symmetry.js b/packages/ruleset/src/functions/api-symmetry.js index 71cd64d28..3213a8324 100644 --- a/packages/ruleset/src/functions/api-symmetry.js +++ b/packages/ruleset/src/functions/api-symmetry.js @@ -9,7 +9,7 @@ import { isObject, isArraySchema, validateSubschemas, -} from "@ibm-cloud/openapi-ruleset-utilities"; +} from '@ibm-cloud/openapi-ruleset-utilities'; import { LoggerFactory, @@ -17,7 +17,7 @@ import { getCanonicalSchemaForPath, getResourceOrientedPaths, getSchemaNameAtPath, -} from "../utils"; +} from '../utils'; let ruleId; let logger; @@ -48,7 +48,7 @@ export default function apiSymmetry(apidef, options, context) { logger = LoggerFactory.getInstance().getLogger(ruleId); } return checkApiForSymmetry(apidef, getNodes(context)); -}; +} /** * This function checks for most of the API Handbook's rules about schema diff --git a/packages/ruleset/src/functions/array-attributes.js b/packages/ruleset/src/functions/array-attributes.js index f7a890f8c..76dca46ee 100644 --- a/packages/ruleset/src/functions/array-attributes.js +++ b/packages/ruleset/src/functions/array-attributes.js @@ -3,12 +3,12 @@ * SPDX-License-Identifier: Apache2.0 */ -import { isPlainObject } from "lodash"; +import { isPlainObject } from 'lodash'; import { validateNestedSchemas, isArraySchema, -} from "@ibm-cloud/openapi-ruleset-utilities"; -import { getCompositeSchemaAttribute, LoggerFactory } from "../utils"; +} from '@ibm-cloud/openapi-ruleset-utilities'; +import { getCompositeSchemaAttribute, LoggerFactory } from '../utils'; let ruleId; let logger; @@ -25,7 +25,7 @@ export default function (schema, _opts, context) { true, false ); -}; +} function arrayAttributeErrors(schema, path) { logger.debug( diff --git a/packages/ruleset/src/functions/array-of-arrays.js b/packages/ruleset/src/functions/array-of-arrays.js index ca3b3fc73..6426245d4 100644 --- a/packages/ruleset/src/functions/array-of-arrays.js +++ b/packages/ruleset/src/functions/array-of-arrays.js @@ -6,8 +6,8 @@ import { isArraySchema, validateSubschemas, -} from "@ibm-cloud/openapi-ruleset-utilities"; -import { LoggerFactory } from "../utils"; +} from '@ibm-cloud/openapi-ruleset-utilities'; +import { LoggerFactory } from '../utils'; let ruleId; let logger; @@ -17,7 +17,7 @@ export default function (schema, _opts, context) { logger = LoggerFactory.getInstance().getLogger(ruleId); } return validateSubschemas(schema, context.path, arrayOfArrays, true, false); -}; +} function arrayOfArrays(schema, path) { if (isArraySchema(schema) && schema.items) { diff --git a/packages/ruleset/src/functions/array-responses.js b/packages/ruleset/src/functions/array-responses.js index 3b98ca634..2e8bdd044 100644 --- a/packages/ruleset/src/functions/array-responses.js +++ b/packages/ruleset/src/functions/array-responses.js @@ -14,7 +14,7 @@ export default function (operation, _opts, context) { logger = LoggerFactory.getInstance().getLogger(ruleId); } return checkForArrayResponses(operation, context.path); -}; +} /** * Checks for operations that are defined as returning a top-level array in diff --git a/packages/ruleset/src/functions/avoid-multiple-types.js b/packages/ruleset/src/functions/avoid-multiple-types.js index 33b7bf5e8..eb4c7655f 100644 --- a/packages/ruleset/src/functions/avoid-multiple-types.js +++ b/packages/ruleset/src/functions/avoid-multiple-types.js @@ -21,7 +21,7 @@ export default function (schema, _opts, context) { true, false ); -}; +} /** * Warns about the presence of multiple types within a schema's "type" field. diff --git a/packages/ruleset/src/functions/binary-schemas.js b/packages/ruleset/src/functions/binary-schemas.js index 09dd32ecb..d6c96d596 100644 --- a/packages/ruleset/src/functions/binary-schemas.js +++ b/packages/ruleset/src/functions/binary-schemas.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -import { isBinarySchema } from "@ibm-cloud/openapi-ruleset-utilities"; +import { isBinarySchema } from '@ibm-cloud/openapi-ruleset-utilities'; import { isJsonMimeType, @@ -12,7 +12,7 @@ import { isRequestBodySchema, isResponseSchema, LoggerFactory, -} from "../utils"; +} from '../utils'; let ruleId; let logger; @@ -23,7 +23,7 @@ export default function (schema, _opts, context) { logger = LoggerFactory.getInstance().getLogger(ruleId); } return binarySchemaCheck(schema, context.path); -}; +} /** * This function implements the 'binary-schemas' rule which makes sure that diff --git a/packages/ruleset/src/functions/circular-refs.js b/packages/ruleset/src/functions/circular-refs.js index 0db8c9288..8bfe9fba6 100644 --- a/packages/ruleset/src/functions/circular-refs.js +++ b/packages/ruleset/src/functions/circular-refs.js @@ -14,7 +14,7 @@ export default function ($ref, _opts, context) { logger = LoggerFactory.getInstance().getLogger(ruleId); } return checkForCircularRef($ref, context.path); -}; +} // This set is used to make sure that we warn about each distinct $ref value only once. const reportedRefValues = new Set(); diff --git a/packages/ruleset/src/functions/collection-array-property.js b/packages/ruleset/src/functions/collection-array-property.js index e7f7721eb..9b77ca76c 100644 --- a/packages/ruleset/src/functions/collection-array-property.js +++ b/packages/ruleset/src/functions/collection-array-property.js @@ -8,8 +8,8 @@ import { isArraySchema, isObject, getUnresolvedSpec, -} from "@ibm-cloud/openapi-ruleset-utilities"; -import { LoggerFactory } from "../utils"; +} from '@ibm-cloud/openapi-ruleset-utilities'; +import { LoggerFactory } from '../utils'; let ruleId; let logger; @@ -24,7 +24,7 @@ export default function (schema, _opts, context) { context.path, getUnresolvedSpec(context) ); -}; +} /** * This function checks to make sure that for a collection "list" type operation, diff --git a/packages/ruleset/src/functions/consecutive-path-segments.js b/packages/ruleset/src/functions/consecutive-path-segments.js index 69a776775..cbe02d46c 100644 --- a/packages/ruleset/src/functions/consecutive-path-segments.js +++ b/packages/ruleset/src/functions/consecutive-path-segments.js @@ -14,7 +14,7 @@ export default function (pathItem, options, context) { logger = LoggerFactory.getInstance().getLogger(ruleId); } return consecutivePathSegments(context.path); -}; +} /** * This function detects the presence of two or more consecutive path segments diff --git a/packages/ruleset/src/functions/delete-body.js b/packages/ruleset/src/functions/delete-body.js index 2759f1e41..a524f0264 100644 --- a/packages/ruleset/src/functions/delete-body.js +++ b/packages/ruleset/src/functions/delete-body.js @@ -30,7 +30,7 @@ export default function (operation, _opts, context) { } } return deleteBody(operation, context.path); -}; +} // This rule warns about a delete operation if it has a requestBody. function deleteBody(operation, path) { diff --git a/packages/ruleset/src/functions/disallowed-header-parameter.js b/packages/ruleset/src/functions/disallowed-header-parameter.js index a64e1674b..dffd31daa 100644 --- a/packages/ruleset/src/functions/disallowed-header-parameter.js +++ b/packages/ruleset/src/functions/disallowed-header-parameter.js @@ -35,7 +35,7 @@ export default function (param, options, context) { context.path, options.headerName.trim().toLowerCase() ); -}; +} // Return an error if 'param' is a header parameter named ''. diff --git a/packages/ruleset/src/functions/discriminator-property-exists.js b/packages/ruleset/src/functions/discriminator-property-exists.js index 8c76f9ee5..eabe159fb 100644 --- a/packages/ruleset/src/functions/discriminator-property-exists.js +++ b/packages/ruleset/src/functions/discriminator-property-exists.js @@ -22,9 +22,9 @@ import { schemaHasProperty, validateSubschemas, -} from "@ibm-cloud/openapi-ruleset-utilities"; +} from '@ibm-cloud/openapi-ruleset-utilities'; -import { LoggerFactory } from "../utils"; +import { LoggerFactory } from '../utils'; let ruleId; let logger; @@ -35,7 +35,7 @@ export default function (schema, _opts, context) { logger = LoggerFactory.getInstance().getLogger(ruleId); } return validateSubschemas(schema, context.path, validateDiscriminators); -}; +} function validateDiscriminators(schema, path) { const { discriminator } = schema; diff --git a/packages/ruleset/src/functions/duplicate-path-parameter.js b/packages/ruleset/src/functions/duplicate-path-parameter.js index 52b34d4fa..df4e11fdf 100644 --- a/packages/ruleset/src/functions/duplicate-path-parameter.js +++ b/packages/ruleset/src/functions/duplicate-path-parameter.js @@ -3,8 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -import { flatten, isEqual, uniqWith } from "lodash"; -import { operationMethods, LoggerFactory } from "../utils"; +import { flatten, isEqual, uniqWith } from 'lodash'; +import { operationMethods, LoggerFactory } from '../utils'; let ruleId; let logger; @@ -15,7 +15,7 @@ export default function (pathItem, _opts, context) { logger = LoggerFactory.getInstance().getLogger(ruleId); } return duplicatePathParameter(pathItem, context.path); -}; +} // Regex used to identify references to path params within a path string. const pathParamReferenceRegex = /\{(.*?)\}/g; diff --git a/packages/ruleset/src/functions/enum-casing-convention.js b/packages/ruleset/src/functions/enum-casing-convention.js index 7a1661340..8a3e10b34 100644 --- a/packages/ruleset/src/functions/enum-casing-convention.js +++ b/packages/ruleset/src/functions/enum-casing-convention.js @@ -22,7 +22,7 @@ export default function (schema, options, context) { } return validateSubschemas(schema, context.path, checkEnumCaseConvention); -}; +} function checkEnumCaseConvention(schema, path) { // If 'schema' has an enum field with string values, diff --git a/packages/ruleset/src/functions/error-response-schemas.js b/packages/ruleset/src/functions/error-response-schemas.js index 3a2b753af..a4055dbb0 100644 --- a/packages/ruleset/src/functions/error-response-schemas.js +++ b/packages/ruleset/src/functions/error-response-schemas.js @@ -8,8 +8,8 @@ import { isIntegerSchema, isObject, isStringSchema, -} from "@ibm-cloud/openapi-ruleset-utilities"; -import { LoggerFactory } from "../utils"; +} from '@ibm-cloud/openapi-ruleset-utilities'; +import { LoggerFactory } from '../utils'; let ruleId; let logger; @@ -21,7 +21,7 @@ export default function (schema, _opts, context) { } return checkErrorContainerModelSchema(schema, context.path); -}; +} /** * This function will verify that "schema" complies with the API Handbook's diff --git a/packages/ruleset/src/functions/etag-header-exists.js b/packages/ruleset/src/functions/etag-header-exists.js index e12ac25b8..839affd90 100644 --- a/packages/ruleset/src/functions/etag-header-exists.js +++ b/packages/ruleset/src/functions/etag-header-exists.js @@ -14,7 +14,7 @@ export default function etagHeaderExists(pathItem, options, context) { logger = LoggerFactory.getInstance().getLogger(ruleId); } return etagHeaderCheck(pathItem, context.path); -}; +} /** * This function checks a path item (object containing operations) to make sure that diff --git a/packages/ruleset/src/functions/index.js b/packages/ruleset/src/functions/index.js index b301c08f2..d703518f5 100644 --- a/packages/ruleset/src/functions/index.js +++ b/packages/ruleset/src/functions/index.js @@ -3,112 +3,112 @@ * SPDX-License-Identifier: Apache2.0 */ -export const acceptAndReturnModels = require("./accept-and-return-models"); -export const allowedKeywords = require("./allowed-keywords"); -export const anchoredPatterns = require("./anchored-patterns"); -export const apiSymmetry = require("./api-symmetry"); -export const arrayAttributes = require("./array-attributes"); -export const arrayOfArrays = require("./array-of-arrays"); -export const arrayResponses = require("./array-responses"); -export const avoidMultipleTypes = require("./avoid-multiple-types"); -export const binarySchemas = require("./binary-schemas"); -export const circularRefs = require("./circular-refs"); -export const collectionArrayProperty = require("./collection-array-property"); -export const consecutivePathSegments = require("./consecutive-path-segments"); -export const deleteBody = require("./delete-body"); -export const disallowedHeaderParameter = require("./disallowed-header-parameter"); -export const discriminatorPropertyExists = require("./discriminator-property-exists"); -export const duplicatePathParameter = require("./duplicate-path-parameter"); -export const enumCasingConvention = require("./enum-casing-convention"); -export const errorResponseSchemas = require("./error-response-schemas"); -export const etagHeaderExists = require("./etag-header-exists"); -export const inlineSchemas = require("./inline-schemas").default; -export const integerAttributes = require("./integer-attributes").default; -export const majorVersionInPath = require("./major-version-in-path").default; -export const mergePatchProperties = require("./merge-patch-properties").default; -export const noAmbiguousPaths = require("./no-ambiguous-paths").default; -export const noNullableProperties = require("./no-nullable-properties").default; +export const acceptAndReturnModels = require('./accept-and-return-models'); +export const allowedKeywords = require('./allowed-keywords'); +export const anchoredPatterns = require('./anchored-patterns'); +export const apiSymmetry = require('./api-symmetry'); +export const arrayAttributes = require('./array-attributes'); +export const arrayOfArrays = require('./array-of-arrays'); +export const arrayResponses = require('./array-responses'); +export const avoidMultipleTypes = require('./avoid-multiple-types'); +export const binarySchemas = require('./binary-schemas'); +export const circularRefs = require('./circular-refs'); +export const collectionArrayProperty = require('./collection-array-property'); +export const consecutivePathSegments = require('./consecutive-path-segments'); +export const deleteBody = require('./delete-body'); +export const disallowedHeaderParameter = require('./disallowed-header-parameter'); +export const discriminatorPropertyExists = require('./discriminator-property-exists'); +export const duplicatePathParameter = require('./duplicate-path-parameter'); +export const enumCasingConvention = require('./enum-casing-convention'); +export const errorResponseSchemas = require('./error-response-schemas'); +export const etagHeaderExists = require('./etag-header-exists'); +export const inlineSchemas = require('./inline-schemas').default; +export const integerAttributes = require('./integer-attributes').default; +export const majorVersionInPath = require('./major-version-in-path').default; +export const mergePatchProperties = require('./merge-patch-properties').default; +export const noAmbiguousPaths = require('./no-ambiguous-paths').default; +export const noNullableProperties = require('./no-nullable-properties').default; export const noOperationRequestBody = - require("./no-operation-requestbody").default; -export const noRefInExample = require("./no-ref-in-example").default; -export const noSuperfluousAllOf = require("./no-superfluous-allof").default; + require('./no-operation-requestbody').default; +export const noRefInExample = require('./no-ref-in-example').default; +export const noSuperfluousAllOf = require('./no-superfluous-allof').default; export const noUnsupportedKeywords = - require("./no-unsupported-keywords").default; + require('./no-unsupported-keywords').default; export const operationIdCasingConvention = - require("./operationid-casing-convention").default; + require('./operationid-casing-convention').default; export const operationIdNamingConvention = - require("./operationid-naming-convention").default; + require('./operationid-naming-convention').default; export const operationSummaryExists = - require("./operation-summary-exists").default; + require('./operation-summary-exists').default; export const operationSummaryLength = - require("./operation-summary-length").default; -export const optionalRequestBody = require("./optional-request-body").default + require('./operation-summary-length').default; +export const optionalRequestBody = require('./optional-request-body').default .optionalRequestBody; -export const optionalRequestBodyDeprecated = require("./optional-request-body") +export const optionalRequestBodyDeprecated = require('./optional-request-body') .default.optionalRequestBodyDeprecated; -export const paginationStyle = require("./pagination-style").default; +export const paginationStyle = require('./pagination-style').default; export const parameterCasingConvention = - require("./parameter-casing-convention").default; -export const parameterDefault = require("./parameter-default").default; + require('./parameter-casing-convention').default; +export const parameterDefault = require('./parameter-default').default; export const parameterDescriptionExists = - require("./parameter-description-exists").default; -export const parameterOrder = require("./parameter-order").default; + require('./parameter-description-exists').default; +export const parameterOrder = require('./parameter-order').default; export const patchRequestContentType = - require("./patch-request-content-type").default; -export const pathParameterNotCRN = require("./path-parameter-not-crn").default; + require('./patch-request-content-type').default; +export const pathParameterNotCRN = require('./path-parameter-not-crn').default; export const pathSegmentCasingConvention = - require("./path-segment-casing-convention").default; -export const patternPropertiesCheck = require("./pattern-properties").default; -export const preconditionHeader = require("./precondition-header").default; + require('./path-segment-casing-convention').default; +export const patternPropertiesCheck = require('./pattern-properties').default; +export const preconditionHeader = require('./precondition-header').default; export const preferTokenPagination = - require("./prefer-token-pagination").default; -export const propertyAttributes = require("./property-attributes").default; + require('./prefer-token-pagination').default; +export const propertyAttributes = require('./property-attributes').default; export const propertyCasingConvention = - require("./property-casing-convention").default; + require('./property-casing-convention').default; export const propertyConsistentNameAndType = - require("./property-consistent-name-and-type").default; + require('./property-consistent-name-and-type').default; export const propertyDescriptionExists = - require("./property-description-exists").default; + require('./property-description-exists').default; export const propertyNameCollision = - require("./property-name-collision").default; -export const redirectResponseBody = require("./redirect-response-body").default; -export const refPattern = require("./ref-pattern").default; + require('./property-name-collision').default; +export const redirectResponseBody = require('./redirect-response-body').default; +export const refPattern = require('./ref-pattern').default; export const refSiblingDuplicateDescription = - require("./ref-sibling-duplicate-description").default; + require('./ref-sibling-duplicate-description').default; export const requestAndResponseContent = - require("./request-and-response-content").default; -export const requestBodyName = require("./requestbody-name").default; + require('./request-and-response-content').default; +export const requestBodyName = require('./requestbody-name').default; export const requiredArrayPropertiesInResponse = - require("./required-array-properties-in-response").default; + require('./required-array-properties-in-response').default; export const requiredEnumPropertiesInResponse = - require("./required-enum-properties-in-response").default; -export const requiredProperty = require("./required-property").default; + require('./required-enum-properties-in-response').default; +export const requiredProperty = require('./required-property').default; export const resourceResponseConsistency = - require("./resource-response-consistency").default; + require('./resource-response-consistency').default; export const responseExampleExists = - require("./response-example-exists").default; -export const responseStatusCodes = require("./response-status-codes").default; + require('./response-example-exists').default; +export const responseStatusCodes = require('./response-status-codes').default; export const schemaCasingConvention = - require("./schema-casing-convention").default; + require('./schema-casing-convention').default; export const schemaDescriptionExists = - require("./schema-description-exists").default; + require('./schema-description-exists').default; export const schemaNamingConvention = - require("./schema-naming-convention").default; + require('./schema-naming-convention').default; export const schemaOrContentProvided = - require("./schema-or-content-provided").default; -export const schemaTypeExists = require("./schema-type-exists").default; -export const schemaTypeFormat = require("./schema-type-format").default; + require('./schema-or-content-provided').default; +export const schemaTypeExists = require('./schema-type-exists').default; +export const schemaTypeFormat = require('./schema-type-format').default; export const securitySchemeAttributes = - require("./securityscheme-attributes").default; -export const securitySchemes = require("./securityschemes").default; -export const stringAttributes = require("./string-attributes").default; + require('./securityscheme-attributes').default; +export const securitySchemes = require('./securityschemes').default; +export const stringAttributes = require('./string-attributes').default; export const unevaluatedProperties = - require("./unevaluated-properties").default; + require('./unevaluated-properties').default; export const uniqueParameterRequestPropertyNames = - require("./unique-parameter-request-property-names").default; -export const unusedTags = require("./unused-tags").default; -export const useDateBasedFormat = require("./use-date-based-format").default; -export const validatePathSegments = require("./valid-path-segments").default; -export const validSchemaExample = require("./valid-schema-example").default; + require('./unique-parameter-request-property-names').default; +export const unusedTags = require('./unused-tags').default; +export const useDateBasedFormat = require('./use-date-based-format').default; +export const validatePathSegments = require('./valid-path-segments').default; +export const validSchemaExample = require('./valid-schema-example').default; export const wellDefinedDictionaries = - require("./well-defined-dictionaries").default; + require('./well-defined-dictionaries').default; diff --git a/packages/ruleset/src/functions/inline-schemas.js b/packages/ruleset/src/functions/inline-schemas.js index 1ebbbc6f7..ee4316a16 100644 --- a/packages/ruleset/src/functions/inline-schemas.js +++ b/packages/ruleset/src/functions/inline-schemas.js @@ -7,13 +7,13 @@ import { isArraySchema, isPrimitiveSchema, validateSubschemas, -} from "@ibm-cloud/openapi-ruleset-utilities"; +} from '@ibm-cloud/openapi-ruleset-utilities'; import { isJsonMimeType, isEmptyObjectSchema, isRefSiblingSchema, -} from "../utils"; +} from '../utils'; /** * Checks to make sure that nested object schemas are defined using a $ref rather than @@ -35,7 +35,7 @@ import { */ export default function (schema, options, { path }) { return validateSubschemas(schema, path, checkForInlineObjectSchemas); -}; +} /** * Checks the specified schema to determine if it's an inline object schema. diff --git a/packages/ruleset/src/functions/integer-attributes.js b/packages/ruleset/src/functions/integer-attributes.js index 881eedae4..0c878c10f 100644 --- a/packages/ruleset/src/functions/integer-attributes.js +++ b/packages/ruleset/src/functions/integer-attributes.js @@ -6,9 +6,9 @@ import { isIntegerSchema, validateNestedSchemas, -} from "@ibm-cloud/openapi-ruleset-utilities"; +} from '@ibm-cloud/openapi-ruleset-utilities'; -import { getCompositeSchemaAttribute, LoggerFactory } from "../utils"; +import { getCompositeSchemaAttribute, LoggerFactory } from '../utils'; let ruleId; let logger; @@ -24,7 +24,7 @@ export default function (schema, _opts, context) { true, false ); -}; +} // These are the valid format values that can be used with integer schemas. const intFormats = ['int32', 'int64']; diff --git a/packages/ruleset/src/functions/major-version-in-path.js b/packages/ruleset/src/functions/major-version-in-path.js index 8b36c5740..1fd344cfc 100644 --- a/packages/ruleset/src/functions/major-version-in-path.js +++ b/packages/ruleset/src/functions/major-version-in-path.js @@ -14,7 +14,7 @@ export default function (apiDef, _opts, context) { logger = LoggerFactory.getInstance().getLogger(ruleId); } return checkMajorVersion(apiDef); -}; +} // Check: // - Each url in the servers object has a path segment of the form v followed by a number, diff --git a/packages/ruleset/src/functions/merge-patch-properties.js b/packages/ruleset/src/functions/merge-patch-properties.js index fbf0d5c54..674597185 100644 --- a/packages/ruleset/src/functions/merge-patch-properties.js +++ b/packages/ruleset/src/functions/merge-patch-properties.js @@ -15,7 +15,7 @@ export default function (schema, _opts, context) { logger = LoggerFactory.getInstance().getLogger(ruleId); } return mergePatchOptionalProperties(schema, context.path); -}; +} /** * This function is invoked for each merge-patch operation's requestBody schema and diff --git a/packages/ruleset/src/functions/no-ambiguous-paths.js b/packages/ruleset/src/functions/no-ambiguous-paths.js index ef59c37b4..0ed0d6212 100644 --- a/packages/ruleset/src/functions/no-ambiguous-paths.js +++ b/packages/ruleset/src/functions/no-ambiguous-paths.js @@ -15,7 +15,7 @@ export default function (paths, _options, context) { logger = LoggerFactory.getInstance().getLogger(ruleId); } return checkAmbiguousPaths(paths); -}; +} /** * This function will check for "ambiguous" paths within the API definition. diff --git a/packages/ruleset/src/functions/no-nullable-properties.js b/packages/ruleset/src/functions/no-nullable-properties.js index b9f4eabbc..0f21741db 100644 --- a/packages/ruleset/src/functions/no-nullable-properties.js +++ b/packages/ruleset/src/functions/no-nullable-properties.js @@ -6,12 +6,12 @@ import { schemaHasConstraint, validateSubschemas, -} from "@ibm-cloud/openapi-ruleset-utilities"; +} from '@ibm-cloud/openapi-ruleset-utilities'; import { isMergePatchMimeType, LoggerFactory, operationMethods, -} from "../utils"; +} from '../utils'; let ruleId; let logger; @@ -22,7 +22,7 @@ export default function (schema, _options, context) { logger = LoggerFactory.getInstance().getLogger(ruleId); } return validateSubschemas(schema, context.path, noNullableProperties); -}; +} /** * This function will check to make sure that nullable properties exist only diff --git a/packages/ruleset/src/functions/no-operation-requestbody.js b/packages/ruleset/src/functions/no-operation-requestbody.js index b6fba2cc8..45f534fd9 100644 --- a/packages/ruleset/src/functions/no-operation-requestbody.js +++ b/packages/ruleset/src/functions/no-operation-requestbody.js @@ -14,7 +14,7 @@ export default function (operation, options, context) { logger = LoggerFactory.getInstance().getLogger(ruleId); } return noOperationRequestBody(operation, context.path, options); -}; +} /** * This function will check to make sure that certain operations do not have a requestBody. diff --git a/packages/ruleset/src/functions/no-ref-in-example.js b/packages/ruleset/src/functions/no-ref-in-example.js index 8856e3ebf..a28c74d2d 100644 --- a/packages/ruleset/src/functions/no-ref-in-example.js +++ b/packages/ruleset/src/functions/no-ref-in-example.js @@ -15,7 +15,7 @@ export default function (exampleObj, options, context) { logger = LoggerFactory.getInstance().getLogger(ruleId); } return noRefInExample(exampleObj, context.path); -}; +} /** * This function will perform a recursive check to make sure that the specified diff --git a/packages/ruleset/src/functions/no-superfluous-allof.js b/packages/ruleset/src/functions/no-superfluous-allof.js index 87d4018c2..5145d0e82 100644 --- a/packages/ruleset/src/functions/no-superfluous-allof.js +++ b/packages/ruleset/src/functions/no-superfluous-allof.js @@ -16,7 +16,7 @@ export default function (schema, _opts, context) { } return validateSubschemas(schema, context.path, checkForSuperfluousAllOf); -}; +} function checkForSuperfluousAllOf(schema, path) { // We're interested only in schemas that contain ONLY a single-element allOf list. diff --git a/packages/ruleset/src/functions/no-unsupported-keywords.js b/packages/ruleset/src/functions/no-unsupported-keywords.js index 869566ede..902327f51 100644 --- a/packages/ruleset/src/functions/no-unsupported-keywords.js +++ b/packages/ruleset/src/functions/no-unsupported-keywords.js @@ -17,7 +17,7 @@ export default function (apidef, _opts, context) { logger = LoggerFactory.getInstance().getLogger(ruleId); } return noUnsupportedKeywords(apidef); -}; +} /** * If 'unevaluatedProperties' is specified within "schema" then it must be set to false. diff --git a/packages/ruleset/src/functions/operation-summary-exists.js b/packages/ruleset/src/functions/operation-summary-exists.js index 4006f4403..baacb123a 100644 --- a/packages/ruleset/src/functions/operation-summary-exists.js +++ b/packages/ruleset/src/functions/operation-summary-exists.js @@ -14,7 +14,7 @@ export default function (operation, _opts, context) { logger = LoggerFactory.getInstance().getLogger(ruleId); } return operationSummary(operation, context.path); -}; +} function operationSummary(operation, path) { logger.debug( diff --git a/packages/ruleset/src/functions/operation-summary-length.js b/packages/ruleset/src/functions/operation-summary-length.js index 9d500dec5..5464cf952 100644 --- a/packages/ruleset/src/functions/operation-summary-length.js +++ b/packages/ruleset/src/functions/operation-summary-length.js @@ -21,7 +21,7 @@ export default function (summary, _opts, context) { logger = LoggerFactory.getInstance().getLogger(ruleId); } return checkSummaryLength(summary, context.path); -}; +} function checkSummaryLength(summary, path) { logger.debug( diff --git a/packages/ruleset/src/functions/operationid-casing-convention.js b/packages/ruleset/src/functions/operationid-casing-convention.js index 8d775ad38..dffc5eddd 100644 --- a/packages/ruleset/src/functions/operationid-casing-convention.js +++ b/packages/ruleset/src/functions/operationid-casing-convention.js @@ -21,7 +21,7 @@ export default function (operation, options, context) { } return operationIdCaseConvention(operation, context.path); -}; +} function operationIdCaseConvention(operation, path) { // Bypass the check if the operationId value is missing (the existence diff --git a/packages/ruleset/src/functions/operationid-naming-convention.js b/packages/ruleset/src/functions/operationid-naming-convention.js index 4dff2f035..b589985e3 100644 --- a/packages/ruleset/src/functions/operationid-naming-convention.js +++ b/packages/ruleset/src/functions/operationid-naming-convention.js @@ -3,13 +3,13 @@ * SPDX-License-Identifier: Apache2.0 */ -import { each, merge, pickBy, reduce } from "lodash"; -import { operationMethods } from "../utils"; -import { singularize } from "inflected"; +import { each, merge, pickBy, reduce } from 'lodash'; +import { operationMethods } from '../utils'; +import { singularize } from 'inflected'; export default function (rootDocument, options) { return operationIdNamingConvention(rootDocument, options.strict); -}; +} function operationIdNamingConvention(resolvedSpec, fullNamingCheck) { const operations = reduce( diff --git a/packages/ruleset/src/functions/pagination-style.js b/packages/ruleset/src/functions/pagination-style.js index 1d1be6d60..5586af2d1 100644 --- a/packages/ruleset/src/functions/pagination-style.js +++ b/packages/ruleset/src/functions/pagination-style.js @@ -11,11 +11,11 @@ import { getSuccessCode, getResponseSchema, getPaginatedOperationFromPath, -} from "../utils"; +} from '../utils'; import { isIntegerSchema, isStringSchema, -} from "@ibm-cloud/openapi-ruleset-utilities"; +} from '@ibm-cloud/openapi-ruleset-utilities'; let ruleId; let logger; @@ -26,7 +26,7 @@ export default function (pathObj, _opts, context) { logger = LoggerFactory.getInstance().getLogger(ruleId); } return paginationStyle(pathObj, context.path); -}; +} /** * This function implements the pagination-style rule which performs numerous checks diff --git a/packages/ruleset/src/functions/parameter-casing-convention.js b/packages/ruleset/src/functions/parameter-casing-convention.js index de5f4c117..b2b662b6d 100644 --- a/packages/ruleset/src/functions/parameter-casing-convention.js +++ b/packages/ruleset/src/functions/parameter-casing-convention.js @@ -3,8 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -import { casing, pattern } from "@stoplight/spectral-functions"; -import { isDeprecated, LoggerFactory } from "../utils"; +import { casing, pattern } from '@stoplight/spectral-functions'; +import { isDeprecated, LoggerFactory } from '../utils'; // Error message prefix for each parameter type. const errorMsgPrefix = { @@ -25,7 +25,7 @@ export default function (param, options, context) { logger = LoggerFactory.getInstance().getLogger(ruleId); } return parameterCasingConvention(param, context.path, options); -}; +} /** * This function will check 'param' to make sure that its name diff --git a/packages/ruleset/src/functions/parameter-default.js b/packages/ruleset/src/functions/parameter-default.js index 6d49011d5..d1ea21d3b 100644 --- a/packages/ruleset/src/functions/parameter-default.js +++ b/packages/ruleset/src/functions/parameter-default.js @@ -14,7 +14,7 @@ export default function (param, _opts, context) { logger = LoggerFactory.getInstance().getLogger(ruleId); } return parameterDefault(param, context.path); -}; +} const errorMsg = 'Required parameters should not define a default value'; diff --git a/packages/ruleset/src/functions/parameter-description-exists.js b/packages/ruleset/src/functions/parameter-description-exists.js index 2dd672091..a3a419684 100644 --- a/packages/ruleset/src/functions/parameter-description-exists.js +++ b/packages/ruleset/src/functions/parameter-description-exists.js @@ -14,7 +14,7 @@ export default function (param, _opts, context) { logger = LoggerFactory.getInstance().getLogger(ruleId); } return parameterDescription(param, context.path); -}; +} function parameterDescription(param, path) { logger.debug( diff --git a/packages/ruleset/src/functions/parameter-order.js b/packages/ruleset/src/functions/parameter-order.js index f403f39e4..760cb8920 100644 --- a/packages/ruleset/src/functions/parameter-order.js +++ b/packages/ruleset/src/functions/parameter-order.js @@ -14,7 +14,7 @@ export default function (operation, _opts, context) { logger = LoggerFactory.getInstance().getLogger(ruleId); } return parameterOrder(operation, context.path); -}; +} function parameterOrder(op, path) { if (op.parameters && op.parameters.length > 0) { diff --git a/packages/ruleset/src/functions/patch-request-content-type.js b/packages/ruleset/src/functions/patch-request-content-type.js index 2c70bfacb..d4be99b55 100644 --- a/packages/ruleset/src/functions/patch-request-content-type.js +++ b/packages/ruleset/src/functions/patch-request-content-type.js @@ -7,7 +7,7 @@ import { isJsonPatchMimeType, isMergePatchMimeType, LoggerFactory, -} from "../utils"; +} from '../utils'; let ruleId; let logger; @@ -18,7 +18,7 @@ export default function (operation, _opts, context) { logger = LoggerFactory.getInstance().getLogger(ruleId); } return patchRequestContentType(operation, context.path); -}; +} /** * This function checks to make sure that each PATCH operation supports only the request diff --git a/packages/ruleset/src/functions/path-parameter-not-crn.js b/packages/ruleset/src/functions/path-parameter-not-crn.js index 54aa06305..451abba28 100644 --- a/packages/ruleset/src/functions/path-parameter-not-crn.js +++ b/packages/ruleset/src/functions/path-parameter-not-crn.js @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache2.0 */ -import { isStringSchema, schemaHasConstraint } from '@ibm-cloud/openapi-ruleset-utilities'; +import { + isStringSchema, + schemaHasConstraint, +} from '@ibm-cloud/openapi-ruleset-utilities'; import { LoggerFactory } from '../utils'; let ruleId; @@ -15,7 +18,7 @@ export default function (pathParam, _opts, context) { logger = LoggerFactory.getInstance().getLogger(ruleId); } return pathParameterNotCRN(pathParam, context.path); -}; +} /** * This function will check "pathParam" (assumed to be a path parameter object) diff --git a/packages/ruleset/src/functions/path-segment-casing-convention.js b/packages/ruleset/src/functions/path-segment-casing-convention.js index f12d29192..165bb2778 100644 --- a/packages/ruleset/src/functions/path-segment-casing-convention.js +++ b/packages/ruleset/src/functions/path-segment-casing-convention.js @@ -21,7 +21,7 @@ export default function (pathItem, options, context) { } return pathSegmentCasingConvention(context.path); -}; +} function pathSegmentCasingConvention(path) { logger.debug( diff --git a/packages/ruleset/src/functions/pattern-properties.js b/packages/ruleset/src/functions/pattern-properties.js index 0c8a2a27b..9f957bfaa 100644 --- a/packages/ruleset/src/functions/pattern-properties.js +++ b/packages/ruleset/src/functions/pattern-properties.js @@ -6,8 +6,8 @@ import { isObject, validateSubschemas, -} from "@ibm-cloud/openapi-ruleset-utilities"; -import { LoggerFactory } from "../utils"; +} from '@ibm-cloud/openapi-ruleset-utilities'; +import { LoggerFactory } from '../utils'; let ruleId; let logger; @@ -24,7 +24,7 @@ export default function (schema, _opts, context) { true, false ); -}; +} /** * Enforces certain restrictions on the use of "patternProperties" within a schema: diff --git a/packages/ruleset/src/functions/precondition-header.js b/packages/ruleset/src/functions/precondition-header.js index 8a156acd3..df64a0286 100644 --- a/packages/ruleset/src/functions/precondition-header.js +++ b/packages/ruleset/src/functions/precondition-header.js @@ -14,7 +14,7 @@ export default function (operation, _opts, context) { logger = LoggerFactory.getInstance().getLogger(ruleId); } return preconditionHeader(operation, context.path); -}; +} /** * This function checks if an operation contains a 412 response it must support at least one conditional header. diff --git a/packages/ruleset/src/functions/prefer-token-pagination.js b/packages/ruleset/src/functions/prefer-token-pagination.js index 224a8c0d3..3e8edcb1e 100644 --- a/packages/ruleset/src/functions/prefer-token-pagination.js +++ b/packages/ruleset/src/functions/prefer-token-pagination.js @@ -7,7 +7,7 @@ import { getPaginatedOperationFromPath, getOffsetParamIndex, LoggerFactory, -} from "../utils"; +} from '../utils'; let ruleId; let logger; @@ -18,7 +18,7 @@ export default function (pathObj, _opts, context) { logger = LoggerFactory.getInstance().getLogger(ruleId); } return checkTypeOfPagination(pathObj, context.path); -}; +} /** * This function implements the prefer-token-pagination rule which checks diff --git a/packages/ruleset/src/functions/property-attributes.js b/packages/ruleset/src/functions/property-attributes.js index ea75e3bda..90bc51996 100644 --- a/packages/ruleset/src/functions/property-attributes.js +++ b/packages/ruleset/src/functions/property-attributes.js @@ -9,8 +9,8 @@ import { isNumberSchema, isIntegerSchema, isObjectSchema, -} from "@ibm-cloud/openapi-ruleset-utilities"; -import { LoggerFactory } from "../utils"; +} from '@ibm-cloud/openapi-ruleset-utilities'; +import { LoggerFactory } from '../utils'; let ruleId; let logger; @@ -20,7 +20,7 @@ export default function (schema, _opts, context) { logger = LoggerFactory.getInstance().getLogger(ruleId); } return validateSubschemas(schema, context.path, checkPropertyAttributes); -}; +} /** * This rule performs the following checks on each schema (and schema property) diff --git a/packages/ruleset/src/functions/property-casing-convention.js b/packages/ruleset/src/functions/property-casing-convention.js index fce3d7314..58418f40f 100644 --- a/packages/ruleset/src/functions/property-casing-convention.js +++ b/packages/ruleset/src/functions/property-casing-convention.js @@ -26,7 +26,7 @@ export default function (schema, options, context) { context.path, checkPropertyCasingConvention ); -}; +} function checkPropertyCasingConvention(schema, path) { if (schema.properties) { diff --git a/packages/ruleset/src/functions/property-consistent-name-and-type.js b/packages/ruleset/src/functions/property-consistent-name-and-type.js index 5055c714a..e925a55dc 100644 --- a/packages/ruleset/src/functions/property-consistent-name-and-type.js +++ b/packages/ruleset/src/functions/property-consistent-name-and-type.js @@ -7,8 +7,8 @@ import { getSchemaType, validateSubschemas, SchemaType, -} from "@ibm-cloud/openapi-ruleset-utilities"; -import { LoggerFactory } from "../utils"; +} from '@ibm-cloud/openapi-ruleset-utilities'; +import { LoggerFactory } from '../utils'; // We need to look at properties across the entire API definition. // This will act as a global variable to hold all of the properties @@ -31,7 +31,7 @@ export default function (schema, options, context) { context.path, propertyConsistentNameAndType ); -}; +} function propertyConsistentNameAndType(schema, path) { if (schema.properties) { diff --git a/packages/ruleset/src/functions/property-description-exists.js b/packages/ruleset/src/functions/property-description-exists.js index d4042446d..d15d2f1aa 100644 --- a/packages/ruleset/src/functions/property-description-exists.js +++ b/packages/ruleset/src/functions/property-description-exists.js @@ -6,8 +6,8 @@ import { schemaHasConstraint, validateSubschemas, -} from "@ibm-cloud/openapi-ruleset-utilities"; -import { LoggerFactory, isSchemaProperty } from "../utils"; +} from '@ibm-cloud/openapi-ruleset-utilities'; +import { LoggerFactory, isSchemaProperty } from '../utils'; let ruleId; let logger; @@ -19,7 +19,7 @@ export default function (schema, _opts, context) { } return validateSubschemas(schema, context.path, propertyDescriptionExists); -}; +} function propertyDescriptionExists(schema, path) { // If "schema" is a schema property, then check for a description. diff --git a/packages/ruleset/src/functions/property-name-collision.js b/packages/ruleset/src/functions/property-name-collision.js index 8544f0f21..d25398423 100644 --- a/packages/ruleset/src/functions/property-name-collision.js +++ b/packages/ruleset/src/functions/property-name-collision.js @@ -15,7 +15,7 @@ export default function (schema, _opts, context) { logger = LoggerFactory.getInstance().getLogger(ruleId); } return validateSubschemas(schema, context.path, propertyNameCollision); -}; +} const errorMsg = 'Avoid duplicate property names within a schema, even if different case conventions are used'; diff --git a/packages/ruleset/src/functions/redirect-response-body.js b/packages/ruleset/src/functions/redirect-response-body.js index 5651218cc..6531129f7 100644 --- a/packages/ruleset/src/functions/redirect-response-body.js +++ b/packages/ruleset/src/functions/redirect-response-body.js @@ -3,8 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -import { getResolvedSpec } from "@ibm-cloud/openapi-ruleset-utilities"; -import { LoggerFactory, getResponseCodes } from "../utils"; +import { getResolvedSpec } from '@ibm-cloud/openapi-ruleset-utilities'; +import { LoggerFactory, getResponseCodes } from '../utils'; let ruleId; let logger; @@ -20,7 +20,7 @@ export default function (operation, _opts, context) { context.path, getResolvedSpec(context) ); -}; +} /** * This function performs a few checks on each operation's response field: diff --git a/packages/ruleset/src/functions/ref-pattern.js b/packages/ruleset/src/functions/ref-pattern.js index 34238cfab..3f41b7fac 100644 --- a/packages/ruleset/src/functions/ref-pattern.js +++ b/packages/ruleset/src/functions/ref-pattern.js @@ -15,7 +15,7 @@ export default function ($ref, _opts, context) { } return checkRefPattern($ref, context.path); -}; +} // This object is used to categorize a $ref value, based on its path (location within the API document). // Each entry corresponds to a particular type of object to which we support references, diff --git a/packages/ruleset/src/functions/ref-sibling-duplicate-description.js b/packages/ruleset/src/functions/ref-sibling-duplicate-description.js index 124e41026..986ae79e0 100644 --- a/packages/ruleset/src/functions/ref-sibling-duplicate-description.js +++ b/packages/ruleset/src/functions/ref-sibling-duplicate-description.js @@ -16,7 +16,7 @@ export default function (schema, _opts, context) { } return validateSubschemas(schema, context.path, checkDuplicateDescription); -}; +} function checkDuplicateDescription(schema, path) { // We're only interested in a schema or schema property that has an allOf list. diff --git a/packages/ruleset/src/functions/request-and-response-content.js b/packages/ruleset/src/functions/request-and-response-content.js index 413f26e8e..a1fa96896 100644 --- a/packages/ruleset/src/functions/request-and-response-content.js +++ b/packages/ruleset/src/functions/request-and-response-content.js @@ -6,8 +6,8 @@ import { isObject, getResolvedSpec, -} from "@ibm-cloud/openapi-ruleset-utilities"; -import { LoggerFactory, pathHasMinimallyRepresentedResource } from "../utils"; +} from '@ibm-cloud/openapi-ruleset-utilities'; +import { LoggerFactory, pathHasMinimallyRepresentedResource } from '../utils'; let ruleId; let logger; @@ -20,17 +20,13 @@ let logger; * */ -export default function requestAndResponseContent( - operation, - options, - context -) { +export default function requestAndResponseContent(operation, options, context) { if (!logger) { ruleId = context.rule.name; logger = LoggerFactory.getInstance().getLogger(ruleId); } return checkForContent(operation, context.path, getResolvedSpec(context)); -}; +} /** * This function checks to ensure an operation defines "content" on its diff --git a/packages/ruleset/src/functions/requestbody-name.js b/packages/ruleset/src/functions/requestbody-name.js index 80b9f9f12..32ec5e67d 100644 --- a/packages/ruleset/src/functions/requestbody-name.js +++ b/packages/ruleset/src/functions/requestbody-name.js @@ -3,11 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -import { - isFormMimeType, - isRequestBodyExploded, - LoggerFactory -} from "../utils"; +import { isFormMimeType, isRequestBodyExploded, LoggerFactory } from '../utils'; let ruleId; let logger; @@ -19,7 +15,7 @@ export default function (operation, _opts, context) { } return requestBodyName(operation, context.path); -}; +} // Name of the extension that we're looking for. const EXTENSION_NAME = 'x-codegen-request-body-name'; diff --git a/packages/ruleset/src/functions/required-array-properties-in-response.js b/packages/ruleset/src/functions/required-array-properties-in-response.js index f0f5c225b..9886c3d6a 100644 --- a/packages/ruleset/src/functions/required-array-properties-in-response.js +++ b/packages/ruleset/src/functions/required-array-properties-in-response.js @@ -7,8 +7,8 @@ import { isArraySchema, isObject, validateNestedSchemas, -} from "@ibm-cloud/openapi-ruleset-utilities"; -import { LoggerFactory } from "../utils"; +} from '@ibm-cloud/openapi-ruleset-utilities'; +import { LoggerFactory } from '../utils'; let ruleId; let logger; @@ -22,7 +22,7 @@ export default function (schema, _opts, context) { return validateNestedSchemas(schema, context.path, (s, p) => { return checkForOptionalArrays(s, p, []); }); -}; +} /** * Checks "schema" for any optional array properties, including diff --git a/packages/ruleset/src/functions/required-enum-properties-in-response.js b/packages/ruleset/src/functions/required-enum-properties-in-response.js index 480e5b9b3..029c33599 100644 --- a/packages/ruleset/src/functions/required-enum-properties-in-response.js +++ b/packages/ruleset/src/functions/required-enum-properties-in-response.js @@ -7,8 +7,8 @@ import { isEnumerationSchema, isObject, validateNestedSchemas, -} from "@ibm-cloud/openapi-ruleset-utilities"; -import { LoggerFactory } from "../utils"; +} from '@ibm-cloud/openapi-ruleset-utilities'; +import { LoggerFactory } from '../utils'; let ruleId; let logger; @@ -22,7 +22,7 @@ export default function (schema, _opts, context) { return validateNestedSchemas(schema, context.path, (s, p) => { return checkForOptionalEnumerations(s, p, []); }); -}; +} /** * Checks "schema" for any optional enumeration properties (i.e. type string w/"enum" field present). diff --git a/packages/ruleset/src/functions/required-property.js b/packages/ruleset/src/functions/required-property.js index be31bec80..530fc2197 100644 --- a/packages/ruleset/src/functions/required-property.js +++ b/packages/ruleset/src/functions/required-property.js @@ -6,8 +6,8 @@ import { schemaHasProperty, validateSubschemas, -} from "@ibm-cloud/openapi-ruleset-utilities"; -import { LoggerFactory } from "../utils"; +} from '@ibm-cloud/openapi-ruleset-utilities'; +import { LoggerFactory } from '../utils'; let ruleId; let logger; @@ -24,7 +24,7 @@ export default function (schema, _opts, context) { true, false ); -}; +} /** * Checks "schema" to make sure that any property names contained in "required" fields diff --git a/packages/ruleset/src/functions/resource-response-consistency.js b/packages/ruleset/src/functions/resource-response-consistency.js index 213a65bf6..3c09b2f6b 100644 --- a/packages/ruleset/src/functions/resource-response-consistency.js +++ b/packages/ruleset/src/functions/resource-response-consistency.js @@ -3,12 +3,12 @@ * SPDX-License-Identifier: Apache2.0 */ -import { isEqual } from "lodash"; +import { isEqual } from 'lodash'; import { isObject, getResolvedSpec, getNodes, -} from "@ibm-cloud/openapi-ruleset-utilities"; +} from '@ibm-cloud/openapi-ruleset-utilities'; import { computeRefsAtPaths, getResourceSpecificSiblingPath, @@ -19,7 +19,7 @@ import { isJsonMimeType, isOperationOfType, LoggerFactory, -} from "../utils"; +} from '../utils'; let ruleId; let logger; @@ -36,7 +36,7 @@ export default function (operation, _opts, context) { getResolvedSpec(context), getNodes(context) ); -}; +} /** * Checks that operations that create or update a resource should diff --git a/packages/ruleset/src/functions/response-example-exists.js b/packages/ruleset/src/functions/response-example-exists.js index 56921d930..a0d699d60 100644 --- a/packages/ruleset/src/functions/response-example-exists.js +++ b/packages/ruleset/src/functions/response-example-exists.js @@ -11,7 +11,7 @@ export default function (response) { }, ]; } -}; +} function responseLevelExamples(response) { return response.example || response.examples; diff --git a/packages/ruleset/src/functions/response-status-codes.js b/packages/ruleset/src/functions/response-status-codes.js index 51181f8c1..05529be44 100644 --- a/packages/ruleset/src/functions/response-status-codes.js +++ b/packages/ruleset/src/functions/response-status-codes.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -import { getResolvedSpec } from "@ibm-cloud/openapi-ruleset-utilities"; +import { getResolvedSpec } from '@ibm-cloud/openapi-ruleset-utilities'; import { LoggerFactory, isCreateOperation, @@ -11,7 +11,7 @@ import { getResourceSpecificSiblingPath, getResponseCodes, pathHasMinimallyRepresentedResource, -} from "../utils"; +} from '../utils'; let ruleId; let logger; @@ -23,7 +23,7 @@ export default function (operation, _opts, context) { } return responseStatusCodes(operation, context.path, getResolvedSpec(context)); -}; +} /** * This function performs a few checks on each operation's responses field: diff --git a/packages/ruleset/src/functions/schema-casing-convention.js b/packages/ruleset/src/functions/schema-casing-convention.js index 5d0799060..b4f7b564b 100644 --- a/packages/ruleset/src/functions/schema-casing-convention.js +++ b/packages/ruleset/src/functions/schema-casing-convention.js @@ -29,7 +29,7 @@ export default function (components, options, context) { } return schemaCaseConvention(components, context.path); -}; +} function schemaCaseConvention(components, path) { if (!components.schemas || !isObject(components.schemas)) { diff --git a/packages/ruleset/src/functions/schema-description-exists.js b/packages/ruleset/src/functions/schema-description-exists.js index 0c22139d2..e202d665c 100644 --- a/packages/ruleset/src/functions/schema-description-exists.js +++ b/packages/ruleset/src/functions/schema-description-exists.js @@ -6,8 +6,8 @@ import { validateSubschemas, schemaHasConstraint, -} from "@ibm-cloud/openapi-ruleset-utilities"; -import { LoggerFactory, isPrimarySchema } from "../utils"; +} from '@ibm-cloud/openapi-ruleset-utilities'; +import { LoggerFactory, isPrimarySchema } from '../utils'; let ruleId; let logger; @@ -19,7 +19,7 @@ export default function (schema, _opts, context) { } return validateSubschemas(schema, context.path, schemaDescriptionExists); -}; +} function schemaDescriptionExists(schema, path) { // Check to see if "path" represents a primary schema (i.e. not a schema property). diff --git a/packages/ruleset/src/functions/schema-naming-convention.js b/packages/ruleset/src/functions/schema-naming-convention.js index 4264d07d0..32b77157f 100644 --- a/packages/ruleset/src/functions/schema-naming-convention.js +++ b/packages/ruleset/src/functions/schema-naming-convention.js @@ -6,7 +6,7 @@ import { schemaHasProperty, getNodes, -} from "@ibm-cloud/openapi-ruleset-utilities"; +} from '@ibm-cloud/openapi-ruleset-utilities'; import { LoggerFactory, @@ -16,7 +16,7 @@ import { getResourceOrientedPaths, getSchemaNameAtPath, getSuccessResponseSchemaForOperation, -} from "../utils"; +} from '../utils'; let ruleId; let logger; @@ -44,7 +44,7 @@ export default function schemaNames(apidef, options, context) { logger = LoggerFactory.getInstance().getLogger(ruleId); } return checkSchemaNames(apidef, getNodes(context)); -}; +} /** * This function checks for most of the API Handbook's schema naming conventions. diff --git a/packages/ruleset/src/functions/schema-or-content-provided.js b/packages/ruleset/src/functions/schema-or-content-provided.js index ba2646f5a..21b0958ff 100644 --- a/packages/ruleset/src/functions/schema-or-content-provided.js +++ b/packages/ruleset/src/functions/schema-or-content-provided.js @@ -11,4 +11,4 @@ export default function (obj) { }, ]; } -}; +} diff --git a/packages/ruleset/src/functions/schema-type-exists.js b/packages/ruleset/src/functions/schema-type-exists.js index ff9467dcf..837f7a980 100644 --- a/packages/ruleset/src/functions/schema-type-exists.js +++ b/packages/ruleset/src/functions/schema-type-exists.js @@ -3,8 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -import { validateSubschemas } from "@ibm-cloud/openapi-ruleset-utilities"; -import { LoggerFactory, mergeAllOfSchemaProperties } from "../utils"; +import { validateSubschemas } from '@ibm-cloud/openapi-ruleset-utilities'; +import { LoggerFactory, mergeAllOfSchemaProperties } from '../utils'; let ruleId; let logger; @@ -16,7 +16,7 @@ export default function (schema, _opts, context) { } return validateSubschemas(schema, context.path, schemaTypeExists); -}; +} function schemaTypeExists(schema, path) { // If we're looking at an allOf list element schema, then diff --git a/packages/ruleset/src/functions/schema-type-format.js b/packages/ruleset/src/functions/schema-type-format.js index 597a7b091..fb91d1266 100644 --- a/packages/ruleset/src/functions/schema-type-format.js +++ b/packages/ruleset/src/functions/schema-type-format.js @@ -59,7 +59,7 @@ export default function (schema, _opts, context) { } return validateSubschemas(schema, context.path, typeFormatErrors); -}; +} function typeFormatErrors(schema, path) { logger.debug( diff --git a/packages/ruleset/src/functions/securityscheme-attributes.js b/packages/ruleset/src/functions/securityscheme-attributes.js index 32b18f5f3..e146a57dc 100644 --- a/packages/ruleset/src/functions/securityscheme-attributes.js +++ b/packages/ruleset/src/functions/securityscheme-attributes.js @@ -20,7 +20,7 @@ export default function (securityScheme, _opts, context) { context.path, context.document ); -}; +} const API_KEY = 'apiKey'; const OAUTH2 = 'oauth2'; diff --git a/packages/ruleset/src/functions/securityschemes.js b/packages/ruleset/src/functions/securityschemes.js index 7cf305403..89347ff5c 100644 --- a/packages/ruleset/src/functions/securityschemes.js +++ b/packages/ruleset/src/functions/securityschemes.js @@ -15,7 +15,7 @@ export default function (rootDocument, _opts, context) { } return checkSecuritySchemes(rootDocument); -}; +} // Security scheme types that support scopes. const schemeTypesSupportScopes = ['oauth2', 'openIdConnect']; diff --git a/packages/ruleset/src/functions/string-attributes.js b/packages/ruleset/src/functions/string-attributes.js index a09f8cdd2..f09ecc95c 100644 --- a/packages/ruleset/src/functions/string-attributes.js +++ b/packages/ruleset/src/functions/string-attributes.js @@ -7,9 +7,9 @@ import { schemaHasConstraint, isStringSchema, validateNestedSchemas, -} from "@ibm-cloud/openapi-ruleset-utilities"; +} from '@ibm-cloud/openapi-ruleset-utilities'; -import { getCompositeSchemaAttribute, LoggerFactory } from "../utils"; +import { getCompositeSchemaAttribute, LoggerFactory } from '../utils'; let ruleId; let logger; @@ -25,7 +25,7 @@ export default function (schema, _opts, context) { true, false ); -}; +} // An object holding a list of "format" values to be bypassed when checking // for the "pattern", "minLength" and "maxLength" fields of a string property, respectively. diff --git a/packages/ruleset/src/functions/unevaluated-properties.js b/packages/ruleset/src/functions/unevaluated-properties.js index 7f992cdcd..3adc33aba 100644 --- a/packages/ruleset/src/functions/unevaluated-properties.js +++ b/packages/ruleset/src/functions/unevaluated-properties.js @@ -21,7 +21,7 @@ export default function (schema, _opts, context) { true, false ); -}; +} /** * If 'unevaluatedProperties' is specified within "schema" then it must be set to false. diff --git a/packages/ruleset/src/functions/unique-parameter-request-property-names.js b/packages/ruleset/src/functions/unique-parameter-request-property-names.js index 972b19b94..172b107cb 100644 --- a/packages/ruleset/src/functions/unique-parameter-request-property-names.js +++ b/packages/ruleset/src/functions/unique-parameter-request-property-names.js @@ -6,7 +6,7 @@ import { isObject, schemaHasConstraint, -} from "@ibm-cloud/openapi-ruleset-utilities"; +} from '@ibm-cloud/openapi-ruleset-utilities'; import { isJsonMimeType, @@ -14,7 +14,7 @@ import { isMergePatchMimeType, LoggerFactory, operationMethods, -} from "../utils"; +} from '../utils'; let ruleId; let logger; @@ -25,7 +25,7 @@ export default function (pathItem, _opts, context) { logger = LoggerFactory.getInstance().getLogger(ruleId); } return checkForNameCollisions(pathItem, context.path); -}; +} /** * This function checks each operation to see check for collisions between diff --git a/packages/ruleset/src/functions/unused-tags.js b/packages/ruleset/src/functions/unused-tags.js index 7ae6d37db..9165ad5e6 100644 --- a/packages/ruleset/src/functions/unused-tags.js +++ b/packages/ruleset/src/functions/unused-tags.js @@ -15,7 +15,7 @@ export default function (rootDocument, _opts, context) { } return checkUnusedTags(rootDocument); -}; +} /** * This function implements the 'unused-tag' validation rule. diff --git a/packages/ruleset/src/functions/use-date-based-format.js b/packages/ruleset/src/functions/use-date-based-format.js index a09a8f1cc..d24c851da 100644 --- a/packages/ruleset/src/functions/use-date-based-format.js +++ b/packages/ruleset/src/functions/use-date-based-format.js @@ -12,7 +12,7 @@ import { isStringSchema, validateNestedSchemas, getResolvedSpec, -} from "@ibm-cloud/openapi-ruleset-utilities"; +} from '@ibm-cloud/openapi-ruleset-utilities'; import { LoggerFactory, @@ -23,7 +23,7 @@ import { isRequestBodySchema, isResponseSchema, isSchemaProperty, -} from "../utils"; +} from '../utils'; let ruleId; let logger; @@ -51,7 +51,7 @@ export default function (schema, _opts, context) { context.path, getResolvedSpec(context) ); -}; +} /** * This function implements a rule that enforces date-based schemas use either diff --git a/packages/ruleset/src/functions/valid-path-segments.js b/packages/ruleset/src/functions/valid-path-segments.js index 1fc90b834..430d87fa7 100644 --- a/packages/ruleset/src/functions/valid-path-segments.js +++ b/packages/ruleset/src/functions/valid-path-segments.js @@ -15,7 +15,7 @@ export default function (pathItem, options, context) { } return validatePathSegments(context.path); -}; +} /** * This function validates individual path segments within a path string. diff --git a/packages/ruleset/src/functions/valid-schema-example.js b/packages/ruleset/src/functions/valid-schema-example.js index 06f9d0431..fd2d7c57b 100644 --- a/packages/ruleset/src/functions/valid-schema-example.js +++ b/packages/ruleset/src/functions/valid-schema-example.js @@ -17,7 +17,7 @@ export default function (schema, _opts, context) { } return validateSubschemas(schema, context.path, checkSchemaExamples); -}; +} function checkSchemaExamples(schema, path) { if (!isDefined(schema.example) && !definesElements(schema.examples)) { diff --git a/packages/ruleset/src/functions/well-defined-dictionaries.js b/packages/ruleset/src/functions/well-defined-dictionaries.js index c5169aa6a..56b0c505d 100644 --- a/packages/ruleset/src/functions/well-defined-dictionaries.js +++ b/packages/ruleset/src/functions/well-defined-dictionaries.js @@ -8,8 +8,8 @@ import { isObjectSchema, schemaHasConstraint, validateNestedSchemas, -} from "@ibm-cloud/openapi-ruleset-utilities"; -import { LoggerFactory } from "../utils"; +} from '@ibm-cloud/openapi-ruleset-utilities'; +import { LoggerFactory } from '../utils'; let ruleId; let logger; @@ -28,7 +28,7 @@ export default function (schema, _opts, context) { } return validateNestedSchemas(schema, context.path, wellDefinedDictionaries); -}; +} function wellDefinedDictionaries(schema, path) { // We only care about object schemas. diff --git a/packages/ruleset/src/ibm-oas.js b/packages/ruleset/src/ibm-oas.js index 6a8895343..6e4c3d5cb 100644 --- a/packages/ruleset/src/ibm-oas.js +++ b/packages/ruleset/src/ibm-oas.js @@ -3,9 +3,102 @@ * SPDX-License-Identifier: Apache2.0 */ -const { oas3 } = require('@stoplight/spectral-formats'); -const { oas } = require('@stoplight/spectral-rulesets'); -const ibmRules = require('./rules'); +import { oas3 } from '@stoplight/spectral-formats'; +import { oas } from '@stoplight/spectral-rulesets'; +import { + typedEnum, + acceptAndReturnModels, + anchoredPatterns, + apiSymmetry, + arrayAttributes, + inlineSchemas, + avoidMultipleTypes, + propertyNameCollision, + duplicatePathParameter, + binarySchemas, + collectionArrayProperty, + contentContainsSchema, + contentTypeIsSpecific, + requiredPropertyMissing, + discriminatorPropertyExists, + mergePatchProperties, + enumCasingConvention, + errorContentTypeIsJson, + errorResponseSchemas, + etagHeaderExists, + integerAttributes, + majorVersionInPath, + acceptHeader, + noAmbiguousPaths, + arrayOfArrays, + arrayResponses, + authorizationHeader, + deleteBody, + circularRefs, + consecutivePathSegments, + contentTypeHeader, + pathParameterNotCRN, + parameterDefault, + refSiblingDuplicateDescription, + ifModifiedSinceHeader, + ifUnmodifiedSinceHeader, + noNullableProperties, + noOperationRequestBody, + optionalRequestBodyDeprecated, + noRefInExample, + optionalRequestBody, + examplesNameContainsSpace, + noSuperfluousAllOf, + noUnsupportedKeywords, + unusedTags, + operationResponses, + operationSummaryExists, + operationSummaryLength, + operationIdCasingConvention, + operationIdNamingConvention, + paginationStyle, + parameterCasingConvention, + parameterDescriptionExists, + parameterOrder, + parameterSchemaOrContentExists, + patchRequestContentType, + pathSegmentCasingConvention, + patternProperties, + preconditionHeader, + preferTokenPagination, + propertyAttributes, + propertyCasingConvention, + propertyConsistentNameAndType, + propertyDescriptionExists, + redirectResponseBody, + refPattern, + requestAndResponseContent, + requestBodyIsObject, + requestBodyName, + requiredArrayPropertiesInResponse, + requiredEnumPropertiesInResponse, + resourceResponseConsistency, + responseStatusCodes, + schemaCasingConvention, + schemaDescriptionExists, + schemaKeywords, + schemaNamingConvention, + schemaTypeExists, + schemaTypeFormat, + ibmSdkOperations, + securitySchemeAttributes, + securitySchemes, + serverVariableDefaultValue, + stringAttributes, + responseExampleExists, + summarySentenceStyle, + unevaluatedProperties, + uniqueParameterRequestPropertyNames, + useDateBasedFormat, + validPathSegments, + validSchemaExample, + wellDefinedDictionaries, +} from './rules'; // Spectral's "no-$ref-siblings" rule is configured to run on // OpenAPI 3.0.x documents (ref sibling attributes are allowed in OpenAPI 3.1.x). @@ -13,195 +106,187 @@ const ibmRules = require('./rules'); // so we'll just tweak Spectral's rule definition here. oas.rules['no-$ref-siblings'].formats = [oas3]; -module.exports = { - extends: oas, - documentationUrl: - 'https://github.com/IBM/openapi-validator/blob/main/docs/ibm-cloud-rules.md', - formats: [oas3], - rules: { - // Original list created from Spectral with: - // jq -r '.rules | to_entries | .[] | select(.value.recommended != false) | " \(.key): off"' src/rulesets/oas/index.json +export { oas as extends }; +export const documentationUrl = + 'https://github.com/IBM/openapi-validator/blob/main/docs/ibm-cloud-rules.md'; +export const formats = [oas3]; +export const rules = { + // Original list created from Spectral with: + // jq -r '.rules | to_entries | .[] | select(.value.recommended != false) | " \(.key): off"' src/rulesets/oas/index.json + // Spectral OAS rules - IBM Custom Settings + // Turn off -- duplicates no_success_response_codes + 'operation-success-response': 'off', + // Enable with same severity as Spectral + 'oas2-operation-formData-consume-check': true, + // Enable with same severity as Spectral + 'operation-operationId-unique': true, + // Enable with same severity as Spectral + 'operation-parameters': true, + // Enable with same severity as Spectral + 'operation-tag-defined': true, + // Turn off - exclude from ibm:oas + 'info-contact': 'off', + // Turn off - exclude from ibm:oas + 'info-description': 'off', + // Enable with same severity as Spectral + 'no-eval-in-markdown': true, + // Enable with same severity as Spectral + 'no-script-tags-in-markdown': true, + // Enable with same severity as Spectral + 'openapi-tags': true, + // Enable with same severity as Spectral + 'operation-description': true, + // Enable with same severity as Spectral + 'operation-operationId': true, + // Turn off - duplicates operation_id_case_convention + 'operation-operationId-valid-in-url': 'off', + // Enable with same severity as Spectral + 'operation-tags': true, + // Enable with same severity as Spectral + 'path-params': true, + // Enable with same severity as Spectral + 'path-declarations-must-exist': true, + // Enable with same severity as Spectral + 'path-keys-no-trailing-slash': true, + // Enable with same severity as Spectral + 'path-not-include-query': true, + // Enable with same severity as Spectral + 'no-$ref-siblings': true, + // Enable with same settings as Spectral, but override the rule to modify + // the 'given' field to only check schemas - Spectral checks everything. + 'typed-enum': typedEnum, + // Enable with same severity as Spectral + 'oas2-api-host': true, + // Enable with same severity as Spectral + 'oas2-api-schemes': true, + // Enable with same severity as Spectral + 'oas2-host-trailing-slash': true, + // Turn off - duplicates non-configurable validation - security-ibm.js + 'oas2-operation-security-defined': 'off', + // Enable with warn severity + 'oas2-valid-schema-example': 'warn', + // Turn off + 'oas2-valid-media-example': 'off', + // Enable with same severity as Spectral + 'oas2-anyOf': true, + // Enable with same severity as Spectral + 'oas2-oneOf': true, + // Turn off + 'oas2-schema': 'off', + // Turn off - duplicates non-configurable validation in base validator + 'oas2-unused-definition': true, + // Enable with same severity as Spectral + 'oas3-api-servers': true, + // Enable with same severity as Spectral + 'oas3-examples-value-or-externalValue': true, + // Turn off - duplicates non-configurable validation - security-ibm.js + 'oas3-operation-security-defined': 'off', + // Enable with same severity as Spectral + 'oas3-server-trailing-slash': true, + // Enable with warn severity + 'oas3-valid-media-example': 'warn', + // Disable - replaced with ibm-valid-schema-example. + 'oas3-valid-schema-example': 'off', + // Enable with same severity as Spectral + 'oas3-schema': true, + // Turn off - duplicates non-configurable validation in base validator + 'oas3-unused-component': true, + // Turn off 'array-items' rule in favor of our 'ibm-array-attributes' rule + 'array-items': 'off', - // Spectral OAS rules - IBM Custom Settings - - // Turn off -- duplicates no_success_response_codes - 'operation-success-response': 'off', - // Enable with same severity as Spectral - 'oas2-operation-formData-consume-check': true, - // Enable with same severity as Spectral - 'operation-operationId-unique': true, - // Enable with same severity as Spectral - 'operation-parameters': true, - // Enable with same severity as Spectral - 'operation-tag-defined': true, - // Turn off - exclude from ibm:oas - 'info-contact': 'off', - // Turn off - exclude from ibm:oas - 'info-description': 'off', - // Enable with same severity as Spectral - 'no-eval-in-markdown': true, - // Enable with same severity as Spectral - 'no-script-tags-in-markdown': true, - // Enable with same severity as Spectral - 'openapi-tags': true, - // Enable with same severity as Spectral - 'operation-description': true, - // Enable with same severity as Spectral - 'operation-operationId': true, - // Turn off - duplicates operation_id_case_convention - 'operation-operationId-valid-in-url': 'off', - // Enable with same severity as Spectral - 'operation-tags': true, - // Enable with same severity as Spectral - 'path-params': true, - // Enable with same severity as Spectral - 'path-declarations-must-exist': true, - // Enable with same severity as Spectral - 'path-keys-no-trailing-slash': true, - // Enable with same severity as Spectral - 'path-not-include-query': true, - // Enable with same severity as Spectral - 'no-$ref-siblings': true, - // Enable with same settings as Spectral, but override the rule to modify - // the 'given' field to only check schemas - Spectral checks everything. - 'typed-enum': ibmRules.typedEnum, - // Enable with same severity as Spectral - 'oas2-api-host': true, - // Enable with same severity as Spectral - 'oas2-api-schemes': true, - // Enable with same severity as Spectral - 'oas2-host-trailing-slash': true, - // Turn off - duplicates non-configurable validation - security-ibm.js - 'oas2-operation-security-defined': 'off', - // Enable with warn severity - 'oas2-valid-schema-example': 'warn', - // Turn off - 'oas2-valid-media-example': 'off', - // Enable with same severity as Spectral - 'oas2-anyOf': true, - // Enable with same severity as Spectral - 'oas2-oneOf': true, - // Turn off - 'oas2-schema': 'off', - // Turn off - duplicates non-configurable validation in base validator - 'oas2-unused-definition': true, - // Enable with same severity as Spectral - 'oas3-api-servers': true, - // Enable with same severity as Spectral - 'oas3-examples-value-or-externalValue': true, - // Turn off - duplicates non-configurable validation - security-ibm.js - 'oas3-operation-security-defined': 'off', - // Enable with same severity as Spectral - 'oas3-server-trailing-slash': true, - // Enable with warn severity - 'oas3-valid-media-example': 'warn', - // Disable - replaced with ibm-valid-schema-example. - 'oas3-valid-schema-example': 'off', - // Enable with same severity as Spectral - 'oas3-schema': true, - // Turn off - duplicates non-configurable validation in base validator - 'oas3-unused-component': true, - // Turn off 'array-items' rule in favor of our 'ibm-array-attributes' rule - 'array-items': 'off', - - // IBM Custom Rules - 'ibm-accept-and-return-models': ibmRules.acceptAndReturnModels, - 'ibm-anchored-patterns': ibmRules.anchoredPatterns, - 'ibm-api-symmetry': ibmRules.apiSymmetry, - 'ibm-array-attributes': ibmRules.arrayAttributes, - 'ibm-avoid-inline-schemas': ibmRules.inlineSchemas, - 'ibm-avoid-multiple-types': ibmRules.avoidMultipleTypes, - 'ibm-avoid-property-name-collision': ibmRules.propertyNameCollision, - 'ibm-avoid-repeating-path-parameters': ibmRules.duplicatePathParameter, - 'ibm-binary-schemas': ibmRules.binarySchemas, - 'ibm-collection-array-property': ibmRules.collectionArrayProperty, - 'ibm-content-contains-schema': ibmRules.contentContainsSchema, - 'ibm-content-type-is-specific': ibmRules.contentTypeIsSpecific, - 'ibm-define-required-properties': ibmRules.requiredPropertyMissing, - 'ibm-discriminator-property': ibmRules.discriminatorPropertyExists, - 'ibm-dont-require-merge-patch-properties': ibmRules.mergePatchProperties, - 'ibm-enum-casing-convention': ibmRules.enumCasingConvention, - 'ibm-error-content-type-is-json': ibmRules.errorContentTypeIsJson, - 'ibm-error-response-schemas': ibmRules.errorResponseSchemas, - 'ibm-etag-header': ibmRules.etagHeaderExists, - 'ibm-integer-attributes': ibmRules.integerAttributes, - 'ibm-major-version-in-path': ibmRules.majorVersionInPath, - 'ibm-no-accept-header': ibmRules.acceptHeader, - 'ibm-no-ambiguous-paths': ibmRules.noAmbiguousPaths, - 'ibm-no-array-of-arrays': ibmRules.arrayOfArrays, - 'ibm-no-array-responses': ibmRules.arrayResponses, - 'ibm-no-authorization-header': ibmRules.authorizationHeader, - 'ibm-no-body-for-delete': ibmRules.deleteBody, - 'ibm-no-circular-refs': ibmRules.circularRefs, - 'ibm-no-consecutive-path-parameter-segments': - ibmRules.consecutivePathSegments, - 'ibm-no-content-type-header': ibmRules.contentTypeHeader, - 'ibm-no-crn-path-parameters': ibmRules.pathParameterNotCRN, - 'ibm-no-default-for-required-parameter': ibmRules.parameterDefault, - 'ibm-no-duplicate-description-with-ref-sibling': - ibmRules.refSiblingDuplicateDescription, - 'ibm-no-if-modified-since-header': ibmRules.ifModifiedSinceHeader, - 'ibm-no-if-unmodified-since-header': ibmRules.ifUnmodifiedSinceHeader, - 'ibm-no-nullable-properties': ibmRules.noNullableProperties, - 'ibm-no-operation-requestbody': ibmRules.noOperationRequestBody, - 'ibm-no-optional-properties-in-required-body': - ibmRules.optionalRequestBodyDeprecated, - 'ibm-no-ref-in-example': ibmRules.noRefInExample, - 'ibm-no-required-properties-in-optional-body': ibmRules.optionalRequestBody, - 'ibm-no-space-in-example-name': ibmRules.examplesNameContainsSpace, - 'ibm-no-superfluous-allof': ibmRules.noSuperfluousAllOf, - 'ibm-no-unsupported-keywords': ibmRules.noUnsupportedKeywords, - 'ibm-openapi-tags-used': ibmRules.unusedTags, - 'ibm-operation-responses': ibmRules.operationResponses, - 'ibm-operation-summary': ibmRules.operationSummaryExists, - 'ibm-operation-summary-length': ibmRules.operationSummaryLength, - 'ibm-operationid-casing-convention': ibmRules.operationIdCasingConvention, - 'ibm-operationid-naming-convention': ibmRules.operationIdNamingConvention, - 'ibm-pagination-style': ibmRules.paginationStyle, - 'ibm-parameter-casing-convention': ibmRules.parameterCasingConvention, - 'ibm-parameter-description': ibmRules.parameterDescriptionExists, - 'ibm-parameter-order': ibmRules.parameterOrder, - 'ibm-parameter-schema-or-content': ibmRules.parameterSchemaOrContentExists, - 'ibm-patch-request-content-type': ibmRules.patchRequestContentType, - 'ibm-path-segment-casing-convention': ibmRules.pathSegmentCasingConvention, - 'ibm-pattern-properties': ibmRules.patternProperties, - 'ibm-precondition-headers': ibmRules.preconditionHeader, - 'ibm-prefer-token-pagination': ibmRules.preferTokenPagination, - 'ibm-property-attributes': ibmRules.propertyAttributes, - 'ibm-property-casing-convention': ibmRules.propertyCasingConvention, - 'ibm-property-consistent-name-and-type': - ibmRules.propertyConsistentNameAndType, - 'ibm-property-description': ibmRules.propertyDescriptionExists, - 'ibm-redirect-response-body': ibmRules.redirectResponseBody, - 'ibm-ref-pattern': ibmRules.refPattern, - 'ibm-request-and-response-content': ibmRules.requestAndResponseContent, - 'ibm-requestbody-is-object': ibmRules.requestBodyIsObject, - 'ibm-requestbody-name': ibmRules.requestBodyName, - 'ibm-required-array-properties-in-response': - ibmRules.requiredArrayPropertiesInResponse, - 'ibm-required-enum-properties-in-response': - ibmRules.requiredEnumPropertiesInResponse, - 'ibm-resource-response-consistency': ibmRules.resourceResponseConsistency, - 'ibm-response-status-codes': ibmRules.responseStatusCodes, - 'ibm-schema-casing-convention': ibmRules.schemaCasingConvention, - 'ibm-schema-description': ibmRules.schemaDescriptionExists, - 'ibm-schema-keywords': ibmRules.schemaKeywords, - 'ibm-schema-naming-convention': ibmRules.schemaNamingConvention, - 'ibm-schema-type': ibmRules.schemaTypeExists, - 'ibm-schema-type-format': ibmRules.schemaTypeFormat, - 'ibm-sdk-operations': ibmRules.ibmSdkOperations, - 'ibm-securityscheme-attributes': ibmRules.securitySchemeAttributes, - 'ibm-securityschemes': ibmRules.securitySchemes, - 'ibm-server-variable-default-value': ibmRules.serverVariableDefaultValue, - 'ibm-string-attributes': ibmRules.stringAttributes, - 'ibm-success-response-example': ibmRules.responseExampleExists, - 'ibm-summary-sentence-style': ibmRules.summarySentenceStyle, - 'ibm-unevaluated-properties': ibmRules.unevaluatedProperties, - 'ibm-unique-parameter-request-property-names': - ibmRules.uniqueParameterRequestPropertyNames, - 'ibm-use-date-based-format': ibmRules.useDateBasedFormat, - 'ibm-valid-path-segments': ibmRules.validPathSegments, - 'ibm-valid-schema-example': ibmRules.validSchemaExample, - 'ibm-well-defined-dictionaries': ibmRules.wellDefinedDictionaries, - }, + // IBM Custom Rules + 'ibm-accept-and-return-models': acceptAndReturnModels, + 'ibm-anchored-patterns': anchoredPatterns, + 'ibm-api-symmetry': apiSymmetry, + 'ibm-array-attributes': arrayAttributes, + 'ibm-avoid-inline-schemas': inlineSchemas, + 'ibm-avoid-multiple-types': avoidMultipleTypes, + 'ibm-avoid-property-name-collision': propertyNameCollision, + 'ibm-avoid-repeating-path-parameters': duplicatePathParameter, + 'ibm-binary-schemas': binarySchemas, + 'ibm-collection-array-property': collectionArrayProperty, + 'ibm-content-contains-schema': contentContainsSchema, + 'ibm-content-type-is-specific': contentTypeIsSpecific, + 'ibm-define-required-properties': requiredPropertyMissing, + 'ibm-discriminator-property': discriminatorPropertyExists, + 'ibm-dont-require-merge-patch-properties': mergePatchProperties, + 'ibm-enum-casing-convention': enumCasingConvention, + 'ibm-error-content-type-is-json': errorContentTypeIsJson, + 'ibm-error-response-schemas': errorResponseSchemas, + 'ibm-etag-header': etagHeaderExists, + 'ibm-integer-attributes': integerAttributes, + 'ibm-major-version-in-path': majorVersionInPath, + 'ibm-no-accept-header': acceptHeader, + 'ibm-no-ambiguous-paths': noAmbiguousPaths, + 'ibm-no-array-of-arrays': arrayOfArrays, + 'ibm-no-array-responses': arrayResponses, + 'ibm-no-authorization-header': authorizationHeader, + 'ibm-no-body-for-delete': deleteBody, + 'ibm-no-circular-refs': circularRefs, + 'ibm-no-consecutive-path-parameter-segments': consecutivePathSegments, + 'ibm-no-content-type-header': contentTypeHeader, + 'ibm-no-crn-path-parameters': pathParameterNotCRN, + 'ibm-no-default-for-required-parameter': parameterDefault, + 'ibm-no-duplicate-description-with-ref-sibling': + refSiblingDuplicateDescription, + 'ibm-no-if-modified-since-header': ifModifiedSinceHeader, + 'ibm-no-if-unmodified-since-header': ifUnmodifiedSinceHeader, + 'ibm-no-nullable-properties': noNullableProperties, + 'ibm-no-operation-requestbody': noOperationRequestBody, + 'ibm-no-optional-properties-in-required-body': optionalRequestBodyDeprecated, + 'ibm-no-ref-in-example': noRefInExample, + 'ibm-no-required-properties-in-optional-body': optionalRequestBody, + 'ibm-no-space-in-example-name': examplesNameContainsSpace, + 'ibm-no-superfluous-allof': noSuperfluousAllOf, + 'ibm-no-unsupported-keywords': noUnsupportedKeywords, + 'ibm-openapi-tags-used': unusedTags, + 'ibm-operation-responses': operationResponses, + 'ibm-operation-summary': operationSummaryExists, + 'ibm-operation-summary-length': operationSummaryLength, + 'ibm-operationid-casing-convention': operationIdCasingConvention, + 'ibm-operationid-naming-convention': operationIdNamingConvention, + 'ibm-pagination-style': paginationStyle, + 'ibm-parameter-casing-convention': parameterCasingConvention, + 'ibm-parameter-description': parameterDescriptionExists, + 'ibm-parameter-order': parameterOrder, + 'ibm-parameter-schema-or-content': parameterSchemaOrContentExists, + 'ibm-patch-request-content-type': patchRequestContentType, + 'ibm-path-segment-casing-convention': pathSegmentCasingConvention, + 'ibm-pattern-properties': patternProperties, + 'ibm-precondition-headers': preconditionHeader, + 'ibm-prefer-token-pagination': preferTokenPagination, + 'ibm-property-attributes': propertyAttributes, + 'ibm-property-casing-convention': propertyCasingConvention, + 'ibm-property-consistent-name-and-type': propertyConsistentNameAndType, + 'ibm-property-description': propertyDescriptionExists, + 'ibm-redirect-response-body': redirectResponseBody, + 'ibm-ref-pattern': refPattern, + 'ibm-request-and-response-content': requestAndResponseContent, + 'ibm-requestbody-is-object': requestBodyIsObject, + 'ibm-requestbody-name': requestBodyName, + 'ibm-required-array-properties-in-response': + requiredArrayPropertiesInResponse, + 'ibm-required-enum-properties-in-response': requiredEnumPropertiesInResponse, + 'ibm-resource-response-consistency': resourceResponseConsistency, + 'ibm-response-status-codes': responseStatusCodes, + 'ibm-schema-casing-convention': schemaCasingConvention, + 'ibm-schema-description': schemaDescriptionExists, + 'ibm-schema-keywords': schemaKeywords, + 'ibm-schema-naming-convention': schemaNamingConvention, + 'ibm-schema-type': schemaTypeExists, + 'ibm-schema-type-format': schemaTypeFormat, + 'ibm-sdk-operations': ibmSdkOperations, + 'ibm-securityscheme-attributes': securitySchemeAttributes, + 'ibm-securityschemes': securitySchemes, + 'ibm-server-variable-default-value': serverVariableDefaultValue, + 'ibm-string-attributes': stringAttributes, + 'ibm-success-response-example': responseExampleExists, + 'ibm-summary-sentence-style': summarySentenceStyle, + 'ibm-unevaluated-properties': unevaluatedProperties, + 'ibm-unique-parameter-request-property-names': + uniqueParameterRequestPropertyNames, + 'ibm-use-date-based-format': useDateBasedFormat, + 'ibm-valid-path-segments': validPathSegments, + 'ibm-valid-schema-example': validSchemaExample, + 'ibm-well-defined-dictionaries': wellDefinedDictionaries, }; diff --git a/packages/ruleset/src/rules/accept-and-return-models.js b/packages/ruleset/src/rules/accept-and-return-models.js index 3d8d99e85..48cbd3004 100644 --- a/packages/ruleset/src/rules/accept-and-return-models.js +++ b/packages/ruleset/src/rules/accept-and-return-models.js @@ -6,15 +6,15 @@ import { responseSchemas, requestBodySchemas, -} from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; -import { oas3 } from "@stoplight/spectral-formats"; -import { acceptAndReturnModels } from "../functions"; +} from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; +import { oas3 } from '@stoplight/spectral-formats'; +import { acceptAndReturnModels } from '../functions'; export const description = - "Request and response bodies must be defined as model instances"; + 'Request and response bodies must be defined as model instances'; export const given = [...responseSchemas, ...requestBodySchemas]; -export const message = "{{error}}"; -export const severity = "error"; +export const message = '{{error}}'; +export const severity = 'error'; export const formats = [oas3]; export const resolved = true; export const then = { diff --git a/packages/ruleset/src/rules/accept-header.js b/packages/ruleset/src/rules/accept-header.js index 5418e6a0e..09e6b6cce 100644 --- a/packages/ruleset/src/rules/accept-header.js +++ b/packages/ruleset/src/rules/accept-header.js @@ -7,7 +7,8 @@ import { parameters } from '@ibm-cloud/openapi-ruleset-utilities/src/collections import { oas3 } from '@stoplight/spectral-formats'; import { disallowedHeaderParameter } from '../functions'; -export const description = 'Operations should not explicitly define the Accept header parameter'; +export const description = + 'Operations should not explicitly define the Accept header parameter'; export const message = '{{description}}'; export const formats = [oas3]; export const given = parameters; diff --git a/packages/ruleset/src/rules/anchored-patterns.js b/packages/ruleset/src/rules/anchored-patterns.js index 13eacd8aa..c7178a1b4 100644 --- a/packages/ruleset/src/rules/anchored-patterns.js +++ b/packages/ruleset/src/rules/anchored-patterns.js @@ -3,13 +3,13 @@ * SPDX-License-Identifier: Apache2.0 */ -import { schemas } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; -import { oas3 } from "@stoplight/spectral-formats"; -import { anchoredPatterns } from "../functions"; +import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; +import { oas3 } from '@stoplight/spectral-formats'; +import { anchoredPatterns } from '../functions'; -export const description = "Pattern attributes should be anchored with ^ and $"; -export const message = "{{error}}"; -export const severity = "warn"; +export const description = 'Pattern attributes should be anchored with ^ and $'; +export const message = '{{error}}'; +export const severity = 'warn'; export const formats = [oas3]; export const resolved = true; export const given = schemas; diff --git a/packages/ruleset/src/rules/api-symmetry.js b/packages/ruleset/src/rules/api-symmetry.js index c332d9097..840049a67 100644 --- a/packages/ruleset/src/rules/api-symmetry.js +++ b/packages/ruleset/src/rules/api-symmetry.js @@ -3,14 +3,14 @@ * SPDX-License-Identifier: Apache2.0 */ -import { oas3 } from "@stoplight/spectral-formats"; -import { apiSymmetry } from "../functions"; +import { oas3 } from '@stoplight/spectral-formats'; +import { apiSymmetry } from '../functions'; export const description = - "Variations of a resource schema should be graph fragments of the canonical schema"; -export const message = "{{error}}"; -export const given = ["$"]; -export const severity = "warn"; + 'Variations of a resource schema should be graph fragments of the canonical schema'; +export const message = '{{error}}'; +export const given = ['$']; +export const severity = 'warn'; export const formats = [oas3]; export const resolved = true; export const then = { diff --git a/packages/ruleset/src/rules/array-attributes.js b/packages/ruleset/src/rules/array-attributes.js index 0adaad0e9..07f8ff641 100644 --- a/packages/ruleset/src/rules/array-attributes.js +++ b/packages/ruleset/src/rules/array-attributes.js @@ -3,14 +3,14 @@ * SPDX-License-Identifier: Apache2.0 */ -import { schemas } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; -import { oas3 } from "@stoplight/spectral-formats"; -import { arrayAttributes } from "../functions"; +import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; +import { oas3 } from '@stoplight/spectral-formats'; +import { arrayAttributes } from '../functions'; export const description = - "Array schemas should have certain attributes defined"; -export const message = "{{error}}"; -export const severity = "warn"; + 'Array schemas should have certain attributes defined'; +export const message = '{{error}}'; +export const severity = 'warn'; export const formats = [oas3]; export const resolved = true; export const given = schemas; diff --git a/packages/ruleset/src/rules/array-of-arrays.js b/packages/ruleset/src/rules/array-of-arrays.js index 300f63708..f6696b5d1 100644 --- a/packages/ruleset/src/rules/array-of-arrays.js +++ b/packages/ruleset/src/rules/array-of-arrays.js @@ -3,15 +3,15 @@ * SPDX-License-Identifier: Apache2.0 */ -import { schemas } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; -import { oas3 } from "@stoplight/spectral-formats"; -import { arrayOfArrays } from "../functions"; +import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; +import { oas3 } from '@stoplight/spectral-formats'; +import { arrayOfArrays } from '../functions'; export const description = - "Array schema with items of type array should be avoided"; -export const message = "{{error}}"; + 'Array schema with items of type array should be avoided'; +export const message = '{{error}}'; export const given = schemas; -export const severity = "warn"; +export const severity = 'warn'; export const formats = [oas3]; export const resolved = true; export const then = { diff --git a/packages/ruleset/src/rules/array-responses.js b/packages/ruleset/src/rules/array-responses.js index 4d0e7a9b7..daaede88c 100644 --- a/packages/ruleset/src/rules/array-responses.js +++ b/packages/ruleset/src/rules/array-responses.js @@ -3,15 +3,15 @@ * SPDX-License-Identifier: Apache2.0 */ -import { operations } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; -import { oas3 } from "@stoplight/spectral-formats"; -import { arrayResponses } from "../functions"; +import { operations } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; +import { oas3 } from '@stoplight/spectral-formats'; +import { arrayResponses } from '../functions'; export const description = - "Operations should not return an array as the top-level structure of a response."; -export const message = "{{error}}"; + 'Operations should not return an array as the top-level structure of a response.'; +export const message = '{{error}}'; export const given = operations; -export const severity = "error"; +export const severity = 'error'; export const formats = [oas3]; export const resolved = true; export const then = { diff --git a/packages/ruleset/src/rules/authorization-header.js b/packages/ruleset/src/rules/authorization-header.js index ea3214510..e71c54955 100644 --- a/packages/ruleset/src/rules/authorization-header.js +++ b/packages/ruleset/src/rules/authorization-header.js @@ -3,19 +3,19 @@ * SPDX-License-Identifier: Apache2.0 */ -import { parameters } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; -import { oas3 } from "@stoplight/spectral-formats"; -import { disallowedHeaderParameter } from "../functions"; +import { parameters } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; +import { oas3 } from '@stoplight/spectral-formats'; +import { disallowedHeaderParameter } from '../functions'; export const description = - "Operations should not explicitly define the Authorization header parameter"; -export const message = "{{description}}"; + 'Operations should not explicitly define the Authorization header parameter'; +export const message = '{{description}}'; export const formats = [oas3]; export const given = parameters; -export const severity = "warn"; +export const severity = 'warn'; export const then = { function: disallowedHeaderParameter, functionOptions: { - headerName: "Authorization", + headerName: 'Authorization', }, }; diff --git a/packages/ruleset/src/rules/avoid-multiple-types.js b/packages/ruleset/src/rules/avoid-multiple-types.js index d9dea6117..e8a6bba97 100644 --- a/packages/ruleset/src/rules/avoid-multiple-types.js +++ b/packages/ruleset/src/rules/avoid-multiple-types.js @@ -3,15 +3,15 @@ * SPDX-License-Identifier: Apache2.0 */ -import { oas3_1 } from "@stoplight/spectral-formats"; -import { avoidMultipleTypes } from "../functions"; -import { schemas } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; +import { oas3_1 } from '@stoplight/spectral-formats'; +import { avoidMultipleTypes } from '../functions'; +import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; export const description = 'OpenAPI 3.1 documents should avoid multiple types in the schema "type" field.'; -export const message = "{{error}}"; +export const message = '{{error}}'; export const given = schemas; -export const severity = "error"; +export const severity = 'error'; export const formats = [oas3_1]; export const resolved = true; export const then = { diff --git a/packages/ruleset/src/rules/binary-schemas.js b/packages/ruleset/src/rules/binary-schemas.js index 9c8db1efe..7d2d5be32 100644 --- a/packages/ruleset/src/rules/binary-schemas.js +++ b/packages/ruleset/src/rules/binary-schemas.js @@ -3,19 +3,19 @@ * SPDX-License-Identifier: Apache2.0 */ -import { schemas } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; -import { oas3 } from "@stoplight/spectral-formats"; -import { binarySchemas } from "../functions"; +import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; +import { oas3 } from '@stoplight/spectral-formats'; +import { binarySchemas } from '../functions'; // 1. Parameters should not contain binary (type: string, format: binary) values. // 2. JSON request bodies should not contain binary (type: string, format: binary) values. // 3. JSON response bodies should not contain binary (type: string, format: binary) values. export const description = - "Checks that binary schemas are used only in the proper places within an API definition."; -export const message = "{{error}}"; + 'Checks that binary schemas are used only in the proper places within an API definition.'; +export const message = '{{error}}'; export const formats = [oas3]; export const given = schemas; -export const severity = "warn"; +export const severity = 'warn'; export const resolved = true; export const then = { function: binarySchemas, diff --git a/packages/ruleset/src/rules/circular-refs.js b/packages/ruleset/src/rules/circular-refs.js index 398a2b076..44186c34a 100644 --- a/packages/ruleset/src/rules/circular-refs.js +++ b/packages/ruleset/src/rules/circular-refs.js @@ -3,14 +3,14 @@ * SPDX-License-Identifier: Apache2.0 */ -import { oas3 } from "@stoplight/spectral-formats"; -import { circularRefs } from "../functions"; +import { oas3 } from '@stoplight/spectral-formats'; +import { circularRefs } from '../functions'; export const description = - "API definition should not contain circular references."; -export const message = "{{error}}"; -export const given = "$..$ref"; -export const severity = "warn"; + 'API definition should not contain circular references.'; +export const message = '{{error}}'; +export const given = '$..$ref'; +export const severity = 'warn'; export const formats = [oas3]; export const resolved = true; export const then = { diff --git a/packages/ruleset/src/rules/collection-array-property.js b/packages/ruleset/src/rules/collection-array-property.js index 5f5134363..e69f8bdb6 100644 --- a/packages/ruleset/src/rules/collection-array-property.js +++ b/packages/ruleset/src/rules/collection-array-property.js @@ -3,15 +3,15 @@ * SPDX-License-Identifier: Apache2.0 */ -import { oas3 } from "@stoplight/spectral-formats"; -import { collectionArrayProperty } from "../functions"; +import { oas3 } from '@stoplight/spectral-formats'; +import { collectionArrayProperty } from '../functions'; export const description = - "Collection list operation response schema should define array property whose name matches the final path segment of the operation path"; -export const message = "{{error}}"; + 'Collection list operation response schema should define array property whose name matches the final path segment of the operation path'; +export const message = '{{error}}'; export const given = - "$.paths[*].get.responses[?(@property.match(/2\\d\\d/))].content[*].schema"; -export const severity = "warn"; + '$.paths[*].get.responses[?(@property.match(/2\\d\\d/))].content[*].schema'; +export const severity = 'warn'; export const formats = [oas3]; export const resolved = true; export const then = { diff --git a/packages/ruleset/src/rules/consecutive-path-segments.js b/packages/ruleset/src/rules/consecutive-path-segments.js index 9bee6cf68..687f163b3 100644 --- a/packages/ruleset/src/rules/consecutive-path-segments.js +++ b/packages/ruleset/src/rules/consecutive-path-segments.js @@ -3,16 +3,16 @@ * SPDX-License-Identifier: Apache2.0 */ -import { paths } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; -import { oas3 } from "@stoplight/spectral-formats"; -import { consecutivePathSegments } from "../functions"; +import { paths } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; +import { oas3 } from '@stoplight/spectral-formats'; +import { consecutivePathSegments } from '../functions'; export const description = - "Path strings should not contain two or more consecutive path parameter references"; -export const message = "{{error}}"; + 'Path strings should not contain two or more consecutive path parameter references'; +export const message = '{{error}}'; export const formats = [oas3]; export const given = paths; -export const severity = "error"; +export const severity = 'error'; export const resolved = true; export const then = { function: consecutivePathSegments, diff --git a/packages/ruleset/src/rules/content-contains-schema.js b/packages/ruleset/src/rules/content-contains-schema.js index 459f4876a..e8d3cee6b 100644 --- a/packages/ruleset/src/rules/content-contains-schema.js +++ b/packages/ruleset/src/rules/content-contains-schema.js @@ -3,18 +3,18 @@ * SPDX-License-Identifier: Apache2.0 */ -import { oas3 } from "@stoplight/spectral-formats"; -import { truthy } from "@stoplight/spectral-functions"; +import { oas3 } from '@stoplight/spectral-formats'; +import { truthy } from '@stoplight/spectral-functions'; -export const description = "Content entries must specify a schema"; +export const description = 'Content entries must specify a schema'; export const formats = [oas3]; export const given = [ - "$.paths[*][post,put,patch].requestBody.content[*]", - "$.paths[*][get,post,put,patch,delete][parameters,responses][*].content[*]", + '$.paths[*][post,put,patch].requestBody.content[*]', + '$.paths[*][get,post,put,patch,delete][parameters,responses][*].content[*]', ]; -export const severity = "warn"; +export const severity = 'warn'; export const resolved = true; export const then = { - field: "schema", + field: 'schema', function: truthy, }; diff --git a/packages/ruleset/src/rules/content-type-header.js b/packages/ruleset/src/rules/content-type-header.js index 7383329a2..f8d6d8814 100644 --- a/packages/ruleset/src/rules/content-type-header.js +++ b/packages/ruleset/src/rules/content-type-header.js @@ -3,19 +3,19 @@ * SPDX-License-Identifier: Apache2.0 */ -import { parameters } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; -import { oas3 } from "@stoplight/spectral-formats"; -import { disallowedHeaderParameter } from "../functions"; +import { parameters } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; +import { oas3 } from '@stoplight/spectral-formats'; +import { disallowedHeaderParameter } from '../functions'; export const description = - "Operations should not explicitly define the Content-Type header parameter"; -export const message = "{{description}}"; + 'Operations should not explicitly define the Content-Type header parameter'; +export const message = '{{description}}'; export const formats = [oas3]; export const given = parameters; -export const severity = "warn"; +export const severity = 'warn'; export const then = { function: disallowedHeaderParameter, functionOptions: { - headerName: "Content-Type", + headerName: 'Content-Type', }, }; diff --git a/packages/ruleset/src/rules/content-type-is-specific.js b/packages/ruleset/src/rules/content-type-is-specific.js index fbc0f4639..af91607e1 100644 --- a/packages/ruleset/src/rules/content-type-is-specific.js +++ b/packages/ruleset/src/rules/content-type-is-specific.js @@ -3,19 +3,19 @@ * SPDX-License-Identifier: Apache2.0 */ -import { oas3 } from "@stoplight/spectral-formats"; -import { falsy } from "@stoplight/spectral-functions"; +import { oas3 } from '@stoplight/spectral-formats'; +import { falsy } from '@stoplight/spectral-functions'; export const description = - "*/* should only be used when all content types are supported"; + '*/* should only be used when all content types are supported'; export const formats = [oas3]; -export const severity = "warn"; +export const severity = 'warn'; export const resolved = true; export const given = [ - "$.paths[*][*][parameters,responses][*].content", - "$.paths[*][*][requestBody].content", + '$.paths[*][*][parameters,responses][*].content', + '$.paths[*][*][requestBody].content', ]; export const then = { - field: "*/*", + field: '*/*', function: falsy, }; diff --git a/packages/ruleset/src/rules/delete-body.js b/packages/ruleset/src/rules/delete-body.js index cf49a7819..54ea33197 100644 --- a/packages/ruleset/src/rules/delete-body.js +++ b/packages/ruleset/src/rules/delete-body.js @@ -3,14 +3,14 @@ * SPDX-License-Identifier: Apache2.0 */ -import { operations } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; -import { oas3 } from "@stoplight/spectral-formats"; -import { deleteBody } from "../functions"; +import { operations } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; +import { oas3 } from '@stoplight/spectral-formats'; +import { deleteBody } from '../functions'; export const description = - "Delete operations should not contain a requestBody."; -export const message = "{{error}}"; -export const severity = "off"; + 'Delete operations should not contain a requestBody.'; +export const message = '{{error}}'; +export const severity = 'off'; export const formats = [oas3]; export const resolved = true; export const given = operations; diff --git a/packages/ruleset/src/rules/discriminator-property-exists.js b/packages/ruleset/src/rules/discriminator-property-exists.js index d6e3b126c..8ad3eb5a4 100644 --- a/packages/ruleset/src/rules/discriminator-property-exists.js +++ b/packages/ruleset/src/rules/discriminator-property-exists.js @@ -3,15 +3,15 @@ * SPDX-License-Identifier: Apache2.0 */ -import { schemas } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; -import { oas3 } from "@stoplight/spectral-formats"; -import { discriminatorPropertyExists } from "../functions"; +import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; +import { oas3 } from '@stoplight/spectral-formats'; +import { discriminatorPropertyExists } from '../functions'; export const description = - "The discriminator property name must be defined in this schema"; -export const message = "{{error}}"; + 'The discriminator property name must be defined in this schema'; +export const message = '{{error}}'; export const given = schemas; -export const severity = "error"; +export const severity = 'error'; export const formats = [oas3]; export const resolved = true; export const then = { diff --git a/packages/ruleset/src/rules/duplicate-path-parameter.js b/packages/ruleset/src/rules/duplicate-path-parameter.js index 836528981..e0ac41164 100644 --- a/packages/ruleset/src/rules/duplicate-path-parameter.js +++ b/packages/ruleset/src/rules/duplicate-path-parameter.js @@ -3,14 +3,14 @@ * SPDX-License-Identifier: Apache2.0 */ -import { paths } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; -import { oas3 } from "@stoplight/spectral-formats"; -import { duplicatePathParameter } from "../functions"; +import { paths } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; +import { oas3 } from '@stoplight/spectral-formats'; +import { duplicatePathParameter } from '../functions'; export const description = - "Common path parameters should be defined on the path object."; + 'Common path parameters should be defined on the path object.'; export const given = paths; -export const severity = "warn"; +export const severity = 'warn'; export const formats = [oas3]; export const resolved = true; export const then = { diff --git a/packages/ruleset/src/rules/enum-casing-convention.js b/packages/ruleset/src/rules/enum-casing-convention.js index 95992f8a1..48e957c5e 100644 --- a/packages/ruleset/src/rules/enum-casing-convention.js +++ b/packages/ruleset/src/rules/enum-casing-convention.js @@ -3,19 +3,19 @@ * SPDX-License-Identifier: Apache2.0 */ -import { schemas } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; -import { oas3 } from "@stoplight/spectral-formats"; -import { enumCasingConvention } from "../functions"; +import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; +import { oas3 } from '@stoplight/spectral-formats'; +import { enumCasingConvention } from '../functions'; export const description = - "Enum values must follow a specified case convention"; -export const message = "{{error}}"; + 'Enum values must follow a specified case convention'; +export const message = '{{error}}'; export const formats = [oas3]; export const given = schemas; -export const severity = "error"; +export const severity = 'error'; export const then = { function: enumCasingConvention, functionOptions: { - type: "snake", + type: 'snake', }, }; diff --git a/packages/ruleset/src/rules/error-content-type-is-json.js b/packages/ruleset/src/rules/error-content-type-is-json.js index 1ae759372..4a29a4ff4 100644 --- a/packages/ruleset/src/rules/error-content-type-is-json.js +++ b/packages/ruleset/src/rules/error-content-type-is-json.js @@ -3,17 +3,17 @@ * SPDX-License-Identifier: Apache2.0 */ -import { oas3 } from "@stoplight/spectral-formats"; -import { truthy } from "@stoplight/spectral-functions"; +import { oas3 } from '@stoplight/spectral-formats'; +import { truthy } from '@stoplight/spectral-functions'; -export const description = "error response should support application/json"; +export const description = 'error response should support application/json'; export const formats = [oas3]; -export const severity = "warn"; +export const severity = 'warn'; export const resolved = true; export const given = [ - "$.paths[*][*].responses[?(@property >= 400 && @property < 600)].content", + '$.paths[*][*].responses[?(@property >= 400 && @property < 600)].content', ]; export const then = { - field: "application/json", + field: 'application/json', function: truthy, }; diff --git a/packages/ruleset/src/rules/error-response-schemas.js b/packages/ruleset/src/rules/error-response-schemas.js index 1b62e1655..3670d61cb 100644 --- a/packages/ruleset/src/rules/error-response-schemas.js +++ b/packages/ruleset/src/rules/error-response-schemas.js @@ -3,15 +3,15 @@ * SPDX-License-Identifier: Apache2.0 */ -import { oas3 } from "@stoplight/spectral-formats"; -import { errorResponseSchemas } from "../functions"; +import { oas3 } from '@stoplight/spectral-formats'; +import { errorResponseSchemas } from '../functions'; export const description = - "Error response schemas should comply with API Handbook guidance"; -export const message = "{{error}}"; + 'Error response schemas should comply with API Handbook guidance'; +export const message = '{{error}}'; export const given = - "$.paths[*][*].responses[?(@property >= 400 && @property < 600)].content[*].schema"; -export const severity = "warn"; + '$.paths[*][*].responses[?(@property >= 400 && @property < 600)].content[*].schema'; +export const severity = 'warn'; export const formats = [oas3]; export const resolved = true; export const then = { diff --git a/packages/ruleset/src/rules/etag-header-exists.js b/packages/ruleset/src/rules/etag-header-exists.js index 943abd585..445e3e3ed 100644 --- a/packages/ruleset/src/rules/etag-header-exists.js +++ b/packages/ruleset/src/rules/etag-header-exists.js @@ -3,15 +3,15 @@ * SPDX-License-Identifier: Apache2.0 */ -import { paths } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; -import { oas3 } from "@stoplight/spectral-formats"; -import { etagHeaderExists } from "../functions"; +import { paths } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; +import { oas3 } from '@stoplight/spectral-formats'; +import { etagHeaderExists } from '../functions'; export const description = - "ETag response header should be defined in GET operation for resources that support If-Match or If-None-Match header parameters"; -export const message = "{{error}}"; + 'ETag response header should be defined in GET operation for resources that support If-Match or If-None-Match header parameters'; +export const message = '{{error}}'; export const given = paths; -export const severity = "error"; +export const severity = 'error'; export const formats = [oas3]; export const resolved = true; export const then = { diff --git a/packages/ruleset/src/rules/examples-name-contains-space.js b/packages/ruleset/src/rules/examples-name-contains-space.js index d57ad992f..16d156278 100644 --- a/packages/ruleset/src/rules/examples-name-contains-space.js +++ b/packages/ruleset/src/rules/examples-name-contains-space.js @@ -3,18 +3,18 @@ * SPDX-License-Identifier: Apache2.0 */ -import { pattern } from "@stoplight/spectral-functions"; -import { oas3 } from "@stoplight/spectral-formats"; +import { pattern } from '@stoplight/spectral-functions'; +import { oas3 } from '@stoplight/spectral-formats'; -export const description = "Examples name should not contain space"; -export const message = "{{description}}"; -export const severity = "warn"; +export const description = 'Examples name should not contain space'; +export const message = '{{description}}'; +export const severity = 'warn'; export const resolved = false; export const formats = [oas3]; -export const given = "$.paths[*][*].responses[*][*][*].examples[*]~"; +export const given = '$.paths[*][*].responses[*][*][*].examples[*]~'; export const then = { function: pattern, functionOptions: { - notMatch: "^(.*\\s+.*)+$", + notMatch: '^(.*\\s+.*)+$', }, }; diff --git a/packages/ruleset/src/rules/ibm-sdk-operations.js b/packages/ruleset/src/rules/ibm-sdk-operations.js index 0b163c146..a53be4cb4 100644 --- a/packages/ruleset/src/rules/ibm-sdk-operations.js +++ b/packages/ruleset/src/rules/ibm-sdk-operations.js @@ -3,21 +3,21 @@ * SPDX-License-Identifier: Apache2.0 */ -import { oas3 } from "@stoplight/spectral-formats"; -import { schema } from "@stoplight/spectral-functions"; +import { oas3 } from '@stoplight/spectral-formats'; +import { schema } from '@stoplight/spectral-functions'; export const description = - "Ensures that x-sdk-operations fields are properly structured"; -export const message = "{{error}}"; -export const given = "$."; -export const severity = "warn"; + 'Ensures that x-sdk-operations fields are properly structured'; +export const message = '{{error}}'; +export const given = '$.'; +export const severity = 'warn'; export const formats = [oas3]; export const resolved = true; export const then = { function: schema, functionOptions: { schema: { - $ref: "../schemas/x-sdk-operations.json", + $ref: '../schemas/x-sdk-operations.json', }, }, }; diff --git a/packages/ruleset/src/rules/if-modified-since-header.js b/packages/ruleset/src/rules/if-modified-since-header.js index ea3f26a2f..47eb6e3a8 100644 --- a/packages/ruleset/src/rules/if-modified-since-header.js +++ b/packages/ruleset/src/rules/if-modified-since-header.js @@ -3,20 +3,20 @@ * SPDX-License-Identifier: Apache2.0 */ -import { parameters } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; -import { oas3 } from "@stoplight/spectral-formats"; -import { disallowedHeaderParameter } from "../functions"; +import { parameters } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; +import { oas3 } from '@stoplight/spectral-formats'; +import { disallowedHeaderParameter } from '../functions'; export const description = - "Operations should support the If-None-Match header parameter instead of If-Modified-Since"; -export const message = "{{description}}"; + 'Operations should support the If-None-Match header parameter instead of If-Modified-Since'; +export const message = '{{description}}'; export const formats = [oas3]; export const given = parameters; -export const severity = "warn"; +export const severity = 'warn'; export const resolved = true; export const then = { function: disallowedHeaderParameter, functionOptions: { - headerName: "If-Modified-Since", + headerName: 'If-Modified-Since', }, }; diff --git a/packages/ruleset/src/rules/if-unmodified-since-header.js b/packages/ruleset/src/rules/if-unmodified-since-header.js index 82869f006..7c774a41f 100644 --- a/packages/ruleset/src/rules/if-unmodified-since-header.js +++ b/packages/ruleset/src/rules/if-unmodified-since-header.js @@ -3,20 +3,20 @@ * SPDX-License-Identifier: Apache2.0 */ -import { parameters } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; -import { oas3 } from "@stoplight/spectral-formats"; -import { disallowedHeaderParameter } from "../functions"; +import { parameters } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; +import { oas3 } from '@stoplight/spectral-formats'; +import { disallowedHeaderParameter } from '../functions'; export const description = - "Operations should support the If-Match header parameter instead of If-Unmodified-Since"; -export const message = "{{description}}"; + 'Operations should support the If-Match header parameter instead of If-Unmodified-Since'; +export const message = '{{description}}'; export const formats = [oas3]; export const given = parameters; -export const severity = "warn"; +export const severity = 'warn'; export const resolved = true; export const then = { function: disallowedHeaderParameter, functionOptions: { - headerName: "If-Unmodified-Since", + headerName: 'If-Unmodified-Since', }, }; diff --git a/packages/ruleset/src/rules/index.js b/packages/ruleset/src/rules/index.js index a508ede1c..8d8f4f5ae 100644 --- a/packages/ruleset/src/rules/index.js +++ b/packages/ruleset/src/rules/index.js @@ -3,95 +3,95 @@ * SPDX-License-Identifier: Apache2.0 */ -export const acceptAndReturnModels = require("./accept-and-return-models"); -export const acceptHeader = require("./accept-header"); -export const anchoredPatterns = require("./anchored-patterns"); -export const apiSymmetry = require("./api-symmetry"); -export const arrayAttributes = require("./array-attributes"); -export const arrayOfArrays = require("./array-of-arrays"); -export const arrayResponses = require("./array-responses"); -export const authorizationHeader = require("./authorization-header"); -export const avoidMultipleTypes = require("./avoid-multiple-types"); -export const binarySchemas = require("./binary-schemas"); -export const circularRefs = require("./circular-refs"); -export const collectionArrayProperty = require("./collection-array-property"); -export const consecutivePathSegments = require("./consecutive-path-segments"); -export const contentContainsSchema = require("./content-contains-schema"); -export const contentTypeHeader = require("./content-type-header"); -export const contentTypeIsSpecific = require("./content-type-is-specific"); -export const deleteBody = require("./delete-body"); -export const discriminatorPropertyExists = require("./discriminator-property-exists"); -export const duplicatePathParameter = require("./duplicate-path-parameter"); -export const etagHeaderExists = require("./etag-header-exists"); -export const enumCasingConvention = require("./enum-casing-convention"); -export const errorContentTypeIsJson = require("./error-content-type-is-json"); -export const errorResponseSchemas = require("./error-response-schemas"); -export const examplesNameContainsSpace = require("./examples-name-contains-space"); -export const ibmSdkOperations = require("./ibm-sdk-operations"); -export const ifModifiedSinceHeader = require("./if-modified-since-header"); -export const ifUnmodifiedSinceHeader = require("./if-unmodified-since-header"); -export const inlineSchemas = require("./inline-schemas"); -export const integerAttributes = require("./integer-attributes"); -export const majorVersionInPath = require("./major-version-in-path"); -export const mergePatchProperties = require("./merge-patch-properties"); -export const noAmbiguousPaths = require("./no-ambiguous-paths"); -export const noNullableProperties = require("./no-nullable-properties"); -export const noOperationRequestBody = require("./no-operation-requestbody"); -export const noRefInExample = require("./no-ref-in-example"); -export const noSuperfluousAllOf = require("./no-superfluous-allof"); -export const noUnsupportedKeywords = require("./no-unsupported-keywords"); -export const operationIdCasingConvention = require("./operationid-casing-convention"); -export const operationIdNamingConvention = require("./operationid-naming-convention"); -export const operationResponses = require("./operation-responses"); -export const operationSummaryExists = require("./operation-summary-exists"); -export const operationSummaryLength = require("./operation-summary-length"); -export const optionalRequestBody = require("./optional-request-body"); -export const optionalRequestBodyDeprecated = require("./optional-request-body-deprecated"); -export const paginationStyle = require("./pagination-style"); -export const parameterCasingConvention = require("./parameter-casing-convention"); -export const parameterDefault = require("./parameter-default"); -export const parameterDescriptionExists = require("./parameter-description-exists"); -export const parameterOrder = require("./parameter-order"); -export const parameterSchemaOrContentExists = require("./parameter-schema-or-content-exists"); -export const patchRequestContentType = require("./patch-request-content-type"); -export const pathParameterNotCRN = require("./path-parameter-not-crn"); -export const pathSegmentCasingConvention = require("./path-segment-casing-convention"); -export const patternProperties = require("./pattern-properties"); -export const preconditionHeader = require("./precondition-header"); -export const preferTokenPagination = require("./prefer-token-pagination"); -export const propertyAttributes = require("./property-attributes"); -export const propertyCasingConvention = require("./property-casing-convention"); -export const propertyConsistentNameAndType = require("./property-consistent-name-and-type"); -export const propertyDescriptionExists = require("./property-description-exists"); -export const propertyNameCollision = require("./property-name-collision"); -export const redirectResponseBody = require("./redirect-response-body"); -export const refPattern = require("./ref-pattern"); -export const refSiblingDuplicateDescription = require("./ref-sibling-duplicate-description"); -export const requestAndResponseContent = require("./request-and-response-content"); -export const requestBodyIsObject = require("./requestbody-is-object"); -export const requestBodyName = require("./requestbody-name"); -export const requiredArrayPropertiesInResponse = require("./required-array-properties-in-response"); -export const requiredEnumPropertiesInResponse = require("./required-enum-properties-in-response"); -export const requiredPropertyMissing = require("./required-property-missing"); -export const resourceResponseConsistency = require("./resource-response-consistency"); -export const responseExampleExists = require("./response-example-exists"); -export const responseStatusCodes = require("./response-status-codes"); -export const schemaCasingConvention = require("./schema-casing-convention"); -export const schemaDescriptionExists = require("./schema-description-exists"); -export const schemaKeywords = require("./schema-keywords"); -export const schemaNamingConvention = require("./schema-naming-convention"); -export const schemaTypeExists = require("./schema-type-exists"); -export const schemaTypeFormat = require("./schema-type-format"); -export const securitySchemes = require("./securityschemes"); -export const securitySchemeAttributes = require("./securityscheme-attributes"); -export const serverVariableDefaultValue = require("./server-variable-default-value"); -export const stringAttributes = require("./string-attributes"); -export const summarySentenceStyle = require("./summary-sentence-style"); -export const typedEnum = require("./typed-enum").default; -export const unevaluatedProperties = require("./unevaluated-properties"); -export const unusedTags = require("./unused-tags"); -export const uniqueParameterRequestPropertyNames = require("./unique-parameter-request-property-names"); -export const useDateBasedFormat = require("./use-date-based-format"); -export const validPathSegments = require("./valid-path-segments"); -export const validSchemaExample = require("./valid-schema-example"); -export const wellDefinedDictionaries = require("./well-defined-dictionaries"); +export const acceptAndReturnModels = require('./accept-and-return-models'); +export const acceptHeader = require('./accept-header'); +export const anchoredPatterns = require('./anchored-patterns'); +export const apiSymmetry = require('./api-symmetry'); +export const arrayAttributes = require('./array-attributes'); +export const arrayOfArrays = require('./array-of-arrays'); +export const arrayResponses = require('./array-responses'); +export const authorizationHeader = require('./authorization-header'); +export const avoidMultipleTypes = require('./avoid-multiple-types'); +export const binarySchemas = require('./binary-schemas'); +export const circularRefs = require('./circular-refs'); +export const collectionArrayProperty = require('./collection-array-property'); +export const consecutivePathSegments = require('./consecutive-path-segments'); +export const contentContainsSchema = require('./content-contains-schema'); +export const contentTypeHeader = require('./content-type-header'); +export const contentTypeIsSpecific = require('./content-type-is-specific'); +export const deleteBody = require('./delete-body'); +export const discriminatorPropertyExists = require('./discriminator-property-exists'); +export const duplicatePathParameter = require('./duplicate-path-parameter'); +export const etagHeaderExists = require('./etag-header-exists'); +export const enumCasingConvention = require('./enum-casing-convention'); +export const errorContentTypeIsJson = require('./error-content-type-is-json'); +export const errorResponseSchemas = require('./error-response-schemas'); +export const examplesNameContainsSpace = require('./examples-name-contains-space'); +export const ibmSdkOperations = require('./ibm-sdk-operations'); +export const ifModifiedSinceHeader = require('./if-modified-since-header'); +export const ifUnmodifiedSinceHeader = require('./if-unmodified-since-header'); +export const inlineSchemas = require('./inline-schemas'); +export const integerAttributes = require('./integer-attributes'); +export const majorVersionInPath = require('./major-version-in-path'); +export const mergePatchProperties = require('./merge-patch-properties'); +export const noAmbiguousPaths = require('./no-ambiguous-paths'); +export const noNullableProperties = require('./no-nullable-properties'); +export const noOperationRequestBody = require('./no-operation-requestbody'); +export const noRefInExample = require('./no-ref-in-example'); +export const noSuperfluousAllOf = require('./no-superfluous-allof'); +export const noUnsupportedKeywords = require('./no-unsupported-keywords'); +export const operationIdCasingConvention = require('./operationid-casing-convention'); +export const operationIdNamingConvention = require('./operationid-naming-convention'); +export const operationResponses = require('./operation-responses'); +export const operationSummaryExists = require('./operation-summary-exists'); +export const operationSummaryLength = require('./operation-summary-length'); +export const optionalRequestBody = require('./optional-request-body'); +export const optionalRequestBodyDeprecated = require('./optional-request-body-deprecated'); +export const paginationStyle = require('./pagination-style'); +export const parameterCasingConvention = require('./parameter-casing-convention'); +export const parameterDefault = require('./parameter-default'); +export const parameterDescriptionExists = require('./parameter-description-exists'); +export const parameterOrder = require('./parameter-order'); +export const parameterSchemaOrContentExists = require('./parameter-schema-or-content-exists'); +export const patchRequestContentType = require('./patch-request-content-type'); +export const pathParameterNotCRN = require('./path-parameter-not-crn'); +export const pathSegmentCasingConvention = require('./path-segment-casing-convention'); +export const patternProperties = require('./pattern-properties'); +export const preconditionHeader = require('./precondition-header'); +export const preferTokenPagination = require('./prefer-token-pagination'); +export const propertyAttributes = require('./property-attributes'); +export const propertyCasingConvention = require('./property-casing-convention'); +export const propertyConsistentNameAndType = require('./property-consistent-name-and-type'); +export const propertyDescriptionExists = require('./property-description-exists'); +export const propertyNameCollision = require('./property-name-collision'); +export const redirectResponseBody = require('./redirect-response-body'); +export const refPattern = require('./ref-pattern'); +export const refSiblingDuplicateDescription = require('./ref-sibling-duplicate-description'); +export const requestAndResponseContent = require('./request-and-response-content'); +export const requestBodyIsObject = require('./requestbody-is-object'); +export const requestBodyName = require('./requestbody-name'); +export const requiredArrayPropertiesInResponse = require('./required-array-properties-in-response'); +export const requiredEnumPropertiesInResponse = require('./required-enum-properties-in-response'); +export const requiredPropertyMissing = require('./required-property-missing'); +export const resourceResponseConsistency = require('./resource-response-consistency'); +export const responseExampleExists = require('./response-example-exists'); +export const responseStatusCodes = require('./response-status-codes'); +export const schemaCasingConvention = require('./schema-casing-convention'); +export const schemaDescriptionExists = require('./schema-description-exists'); +export const schemaKeywords = require('./schema-keywords'); +export const schemaNamingConvention = require('./schema-naming-convention'); +export const schemaTypeExists = require('./schema-type-exists'); +export const schemaTypeFormat = require('./schema-type-format'); +export const securitySchemes = require('./securityschemes'); +export const securitySchemeAttributes = require('./securityscheme-attributes'); +export const serverVariableDefaultValue = require('./server-variable-default-value'); +export const stringAttributes = require('./string-attributes'); +export const summarySentenceStyle = require('./summary-sentence-style'); +export const typedEnum = require('./typed-enum').default; +export const unevaluatedProperties = require('./unevaluated-properties'); +export const unusedTags = require('./unused-tags'); +export const uniqueParameterRequestPropertyNames = require('./unique-parameter-request-property-names'); +export const useDateBasedFormat = require('./use-date-based-format'); +export const validPathSegments = require('./valid-path-segments'); +export const validSchemaExample = require('./valid-schema-example'); +export const wellDefinedDictionaries = require('./well-defined-dictionaries'); diff --git a/packages/ruleset/src/rules/inline-schemas.js b/packages/ruleset/src/rules/inline-schemas.js index 021557eaf..3db036409 100644 --- a/packages/ruleset/src/rules/inline-schemas.js +++ b/packages/ruleset/src/rules/inline-schemas.js @@ -3,16 +3,16 @@ * SPDX-License-Identifier: Apache2.0 */ -import { unresolvedSchemas } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; -import { oas3 } from "@stoplight/spectral-formats"; -import { inlineSchemas } from "../functions"; +import { unresolvedSchemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; +import { oas3 } from '@stoplight/spectral-formats'; +import { inlineSchemas } from '../functions'; export const description = - "Nested objects should be defined as a $ref to a named schema"; -export const message = "{{error}}"; + 'Nested objects should be defined as a $ref to a named schema'; +export const message = '{{error}}'; export const formats = [oas3]; export const given = unresolvedSchemas; -export const severity = "warn"; +export const severity = 'warn'; export const resolved = false; export const then = { function: inlineSchemas, diff --git a/packages/ruleset/src/rules/integer-attributes.js b/packages/ruleset/src/rules/integer-attributes.js index 4e0ad5c20..039044707 100644 --- a/packages/ruleset/src/rules/integer-attributes.js +++ b/packages/ruleset/src/rules/integer-attributes.js @@ -3,14 +3,14 @@ * SPDX-License-Identifier: Apache2.0 */ -import { schemas } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; -import { oas3 } from "@stoplight/spectral-formats"; -import { integerAttributes } from "../functions"; +import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; +import { oas3 } from '@stoplight/spectral-formats'; +import { integerAttributes } from '../functions'; export const description = - "Integer schemas should have certain attributes defined"; -export const message = "{{error}}"; -export const severity = "error"; + 'Integer schemas should have certain attributes defined'; +export const message = '{{error}}'; +export const severity = 'error'; export const formats = [oas3]; export const resolved = true; export const given = schemas; diff --git a/packages/ruleset/src/rules/major-version-in-path.js b/packages/ruleset/src/rules/major-version-in-path.js index 46bd89dde..4ee9984cf 100644 --- a/packages/ruleset/src/rules/major-version-in-path.js +++ b/packages/ruleset/src/rules/major-version-in-path.js @@ -3,15 +3,15 @@ * SPDX-License-Identifier: Apache2.0 */ -import { oas3 } from "@stoplight/spectral-formats"; -import { majorVersionInPath } from "../functions"; +import { oas3 } from '@stoplight/spectral-formats'; +import { majorVersionInPath } from '../functions'; export const description = - "All paths must contain the API major version as a distinct path segment"; -export const message = "{{error}}"; + 'All paths must contain the API major version as a distinct path segment'; +export const message = '{{error}}'; export const formats = [oas3]; -export const given = "$"; -export const severity = "warn"; +export const given = '$'; +export const severity = 'warn'; export const then = { function: majorVersionInPath, }; diff --git a/packages/ruleset/src/rules/merge-patch-properties.js b/packages/ruleset/src/rules/merge-patch-properties.js index 2ee9edfe7..dd46d8034 100644 --- a/packages/ruleset/src/rules/merge-patch-properties.js +++ b/packages/ruleset/src/rules/merge-patch-properties.js @@ -3,17 +3,17 @@ * SPDX-License-Identifier: Apache2.0 */ -import { oas3 } from "@stoplight/spectral-formats"; -import { mergePatchProperties } from "../functions"; +import { oas3 } from '@stoplight/spectral-formats'; +import { mergePatchProperties } from '../functions'; export const description = - "A JSON merge-patch requestBody should have no required properties"; -export const message = "{{description}}"; + 'A JSON merge-patch requestBody should have no required properties'; +export const message = '{{description}}'; export const given = [ // This expression should visit the request body schema for each "merge-patch" type operation. - "$.paths[*][patch].requestBody.content[?(@property.match(/^application\\/merge-patch\\+json(;.*)*/))].schema", + '$.paths[*][patch].requestBody.content[?(@property.match(/^application\\/merge-patch\\+json(;.*)*/))].schema', ]; -export const severity = "warn"; +export const severity = 'warn'; export const formats = [oas3]; export const resolved = true; export const then = { diff --git a/packages/ruleset/src/rules/no-ambiguous-paths.js b/packages/ruleset/src/rules/no-ambiguous-paths.js index 536ecfe34..52091905c 100644 --- a/packages/ruleset/src/rules/no-ambiguous-paths.js +++ b/packages/ruleset/src/rules/no-ambiguous-paths.js @@ -3,16 +3,16 @@ * SPDX-License-Identifier: Apache2.0 */ -import { oas3 } from "@stoplight/spectral-formats"; -import { noAmbiguousPaths } from "../functions"; +import { oas3 } from '@stoplight/spectral-formats'; +import { noAmbiguousPaths } from '../functions'; export const description = - "Avoid ambiguous path strings within an OpenAPI document"; -export const message = "{{error}}"; -export const severity = "warn"; + 'Avoid ambiguous path strings within an OpenAPI document'; +export const message = '{{error}}'; +export const severity = 'warn'; export const formats = [oas3]; export const resolved = true; -export const given = ["$.paths"]; +export const given = ['$.paths']; export const then = { function: noAmbiguousPaths, }; diff --git a/packages/ruleset/src/rules/no-nullable-properties.js b/packages/ruleset/src/rules/no-nullable-properties.js index 791fffbc2..8062a4fa3 100644 --- a/packages/ruleset/src/rules/no-nullable-properties.js +++ b/packages/ruleset/src/rules/no-nullable-properties.js @@ -3,14 +3,14 @@ * SPDX-License-Identifier: Apache2.0 */ -import { oas3 } from "@stoplight/spectral-formats"; -import { schemas } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; -import { noNullableProperties } from "../functions"; +import { oas3 } from '@stoplight/spectral-formats'; +import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; +import { noNullableProperties } from '../functions'; export const description = - "Nullable properties should exist only in JSON merge-patch request bodies"; -export const message = "{{error}}"; -export const severity = "warn"; + 'Nullable properties should exist only in JSON merge-patch request bodies'; +export const message = '{{error}}'; +export const severity = 'warn'; export const formats = [oas3]; export const resolved = true; export const given = schemas; diff --git a/packages/ruleset/src/rules/no-operation-requestbody.js b/packages/ruleset/src/rules/no-operation-requestbody.js index b6af23f18..bfacbc5a0 100644 --- a/packages/ruleset/src/rules/no-operation-requestbody.js +++ b/packages/ruleset/src/rules/no-operation-requestbody.js @@ -3,14 +3,14 @@ * SPDX-License-Identifier: Apache2.0 */ -import { operations } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; -import { oas3 } from "@stoplight/spectral-formats"; -import { noOperationRequestBody } from "../functions"; +import { operations } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; +import { oas3 } from '@stoplight/spectral-formats'; +import { noOperationRequestBody } from '../functions'; export const description = - "Certain operations should not contain a requestBody"; -export const message = "{{error}}"; -export const severity = "warn"; + 'Certain operations should not contain a requestBody'; +export const message = '{{error}}'; +export const severity = 'warn'; export const formats = [oas3]; export const resolved = true; export const given = operations; @@ -18,6 +18,6 @@ export const then = { function: noOperationRequestBody, functionOptions: { // HTTP methods that should NOT have a requestBody: - httpMethods: ["delete", "get", "head", "options"], + httpMethods: ['delete', 'get', 'head', 'options'], }, }; diff --git a/packages/ruleset/src/rules/no-ref-in-example.js b/packages/ruleset/src/rules/no-ref-in-example.js index 9df4fc8d4..329745c30 100644 --- a/packages/ruleset/src/rules/no-ref-in-example.js +++ b/packages/ruleset/src/rules/no-ref-in-example.js @@ -3,13 +3,13 @@ * SPDX-License-Identifier: Apache2.0 */ -import { oas3 } from "@stoplight/spectral-formats"; -import { noRefInExample } from "../functions"; +import { oas3 } from '@stoplight/spectral-formats'; +import { noRefInExample } from '../functions'; export const description = - "The use of $ref is not valid within an example field"; -export const message = "{{description}}"; -export const given = ["$..example"]; -export const severity = "error"; + 'The use of $ref is not valid within an example field'; +export const message = '{{description}}'; +export const given = ['$..example']; +export const severity = 'error'; export const formats = [oas3]; export const resolved = false; export const then = { diff --git a/packages/ruleset/src/rules/no-superfluous-allof.js b/packages/ruleset/src/rules/no-superfluous-allof.js index f26cfada8..7ee9d32bb 100644 --- a/packages/ruleset/src/rules/no-superfluous-allof.js +++ b/packages/ruleset/src/rules/no-superfluous-allof.js @@ -3,14 +3,14 @@ * SPDX-License-Identifier: Apache2.0 */ -import { schemas } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; -import { oas3 } from "@stoplight/spectral-formats"; -import { noSuperfluousAllOf } from "../functions"; +import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; +import { oas3 } from '@stoplight/spectral-formats'; +import { noSuperfluousAllOf } from '../functions'; export const description = - "Avoid schemas containing only a single-element allOf"; + 'Avoid schemas containing only a single-element allOf'; export const given = schemas; -export const severity = "warn"; +export const severity = 'warn'; export const formats = [oas3]; export const resolved = true; export const then = { diff --git a/packages/ruleset/src/rules/no-unsupported-keywords.js b/packages/ruleset/src/rules/no-unsupported-keywords.js index 917f7c5f7..56f9ac312 100644 --- a/packages/ruleset/src/rules/no-unsupported-keywords.js +++ b/packages/ruleset/src/rules/no-unsupported-keywords.js @@ -3,14 +3,14 @@ * SPDX-License-Identifier: Apache2.0 */ -import { oas3_1 } from "@stoplight/spectral-formats"; -import { noUnsupportedKeywords } from "../functions"; +import { oas3_1 } from '@stoplight/spectral-formats'; +import { noUnsupportedKeywords } from '../functions'; export const description = - "Verifies that unsupported OpenAPI 3.1 keywords are not used in the API document."; -export const message = "{{error}}"; -export const given = ["$"]; -export const severity = "error"; + 'Verifies that unsupported OpenAPI 3.1 keywords are not used in the API document.'; +export const message = '{{error}}'; +export const given = ['$']; +export const severity = 'error'; export const formats = [oas3_1]; export const resolved = false; export const then = { diff --git a/packages/ruleset/src/rules/operation-responses.js b/packages/ruleset/src/rules/operation-responses.js index 711b94100..b10b39855 100644 --- a/packages/ruleset/src/rules/operation-responses.js +++ b/packages/ruleset/src/rules/operation-responses.js @@ -3,18 +3,18 @@ * SPDX-License-Identifier: Apache2.0 */ -import { operations } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; -import { oas3_1 } from "@stoplight/spectral-formats"; -import { truthy } from "@stoplight/spectral-functions"; +import { operations } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; +import { oas3_1 } from '@stoplight/spectral-formats'; +import { truthy } from '@stoplight/spectral-functions'; export const description = 'Verifies that each operation has a "responses" field'; export const message = 'Operations MUST have a "responses" field'; -export const severity = "error"; +export const severity = 'error'; export const formats = [oas3_1]; export const resolved = true; export const given = operations; export const then = { - field: "responses", + field: 'responses', function: truthy, }; diff --git a/packages/ruleset/src/rules/operation-summary-exists.js b/packages/ruleset/src/rules/operation-summary-exists.js index 9f9a0bc19..63758d6f0 100644 --- a/packages/ruleset/src/rules/operation-summary-exists.js +++ b/packages/ruleset/src/rules/operation-summary-exists.js @@ -3,13 +3,13 @@ * SPDX-License-Identifier: Apache2.0 */ -import { operations } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; -import { oas3 } from "@stoplight/spectral-formats"; -import { operationSummaryExists } from "../functions"; +import { operations } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; +import { oas3 } from '@stoplight/spectral-formats'; +import { operationSummaryExists } from '../functions'; -export const description = "Operations must have a non-empty summary"; +export const description = 'Operations must have a non-empty summary'; export const given = operations; -export const severity = "warn"; +export const severity = 'warn'; export const formats = [oas3]; export const resolved = true; export const then = { diff --git a/packages/ruleset/src/rules/operation-summary-length.js b/packages/ruleset/src/rules/operation-summary-length.js index 2cbcacd95..fc6812beb 100644 --- a/packages/ruleset/src/rules/operation-summary-length.js +++ b/packages/ruleset/src/rules/operation-summary-length.js @@ -3,14 +3,14 @@ * SPDX-License-Identifier: Apache2.0 */ -import { operations } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; -import { oas3 } from "@stoplight/spectral-formats"; -import { operationSummaryLength } from "../functions"; +import { operations } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; +import { oas3 } from '@stoplight/spectral-formats'; +import { operationSummaryLength } from '../functions'; export const description = - "Operation summaries must be 80 characters or less in length"; -export const given = operations.map((op) => `${op}.summary`); -export const severity = "error"; + 'Operation summaries must be 80 characters or less in length'; +export const given = operations.map(op => `${op}.summary`); +export const severity = 'error'; export const formats = [oas3]; export const resolved = true; export const then = { diff --git a/packages/ruleset/src/rules/operationid-casing-convention.js b/packages/ruleset/src/rules/operationid-casing-convention.js index f3a23725a..e00da8588 100644 --- a/packages/ruleset/src/rules/operationid-casing-convention.js +++ b/packages/ruleset/src/rules/operationid-casing-convention.js @@ -3,19 +3,19 @@ * SPDX-License-Identifier: Apache2.0 */ -import { operations } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; -import { oas3 } from "@stoplight/spectral-formats"; -import { operationIdCasingConvention } from "../functions"; +import { operations } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; +import { oas3 } from '@stoplight/spectral-formats'; +import { operationIdCasingConvention } from '../functions'; export const description = - "Operation ids must follow a specified case convention"; -export const message = "{{error}}"; + 'Operation ids must follow a specified case convention'; +export const message = '{{error}}'; export const formats = [oas3]; export const given = operations; -export const severity = "warn"; +export const severity = 'warn'; export const then = { function: operationIdCasingConvention, functionOptions: { - type: "snake", + type: 'snake', }, }; diff --git a/packages/ruleset/src/rules/operationid-naming-convention.js b/packages/ruleset/src/rules/operationid-naming-convention.js index bedf6dd2f..c215e6163 100644 --- a/packages/ruleset/src/rules/operationid-naming-convention.js +++ b/packages/ruleset/src/rules/operationid-naming-convention.js @@ -3,13 +3,13 @@ * SPDX-License-Identifier: Apache2.0 */ -import { oas2, oas3 } from "@stoplight/spectral-formats"; -import { operationIdNamingConvention } from "../functions"; +import { oas2, oas3 } from '@stoplight/spectral-formats'; +import { operationIdNamingConvention } from '../functions'; -export const description = "Operation ids should follow naming convention"; -export const message = "{{error}}"; -export const given = ["$"]; -export const severity = "warn"; +export const description = 'Operation ids should follow naming convention'; +export const message = '{{error}}'; +export const given = ['$']; +export const severity = 'warn'; export const formats = [oas2, oas3]; export const resolved = true; export const then = { diff --git a/packages/ruleset/src/rules/optional-request-body-deprecated.js b/packages/ruleset/src/rules/optional-request-body-deprecated.js index 95bef70d5..01a8e93d8 100644 --- a/packages/ruleset/src/rules/optional-request-body-deprecated.js +++ b/packages/ruleset/src/rules/optional-request-body-deprecated.js @@ -3,15 +3,15 @@ * SPDX-License-Identifier: Apache2.0 */ -import { oas3 } from "@stoplight/spectral-formats"; -import { optionalRequestBodyDeprecated } from "../functions"; +import { oas3 } from '@stoplight/spectral-formats'; +import { optionalRequestBodyDeprecated } from '../functions'; export const description = - "An optional requestBody with required properties should probably be required"; -export const message = "{{description}}"; + 'An optional requestBody with required properties should probably be required'; +export const message = '{{description}}'; export const given = "$.paths[*][*][?(@property === 'requestBody' && @.required !== true)].content[*].schema"; -export const severity = "off"; +export const severity = 'off'; export const formats = [oas3]; export const resolved = true; export const then = { diff --git a/packages/ruleset/src/rules/optional-request-body.js b/packages/ruleset/src/rules/optional-request-body.js index a1867587b..bdd6713d8 100644 --- a/packages/ruleset/src/rules/optional-request-body.js +++ b/packages/ruleset/src/rules/optional-request-body.js @@ -3,15 +3,15 @@ * SPDX-License-Identifier: Apache2.0 */ -import { oas3 } from "@stoplight/spectral-formats"; -import { optionalRequestBody } from "../functions"; +import { oas3 } from '@stoplight/spectral-formats'; +import { optionalRequestBody } from '../functions'; export const description = - "An optional requestBody with required properties should probably be required"; -export const message = "{{description}}"; + 'An optional requestBody with required properties should probably be required'; +export const message = '{{description}}'; export const given = "$.paths[*][*][?(@property === 'requestBody' && @.required !== true)].content[*].schema"; -export const severity = "info"; +export const severity = 'info'; export const formats = [oas3]; export const resolved = true; export const then = { diff --git a/packages/ruleset/src/rules/pagination-style.js b/packages/ruleset/src/rules/pagination-style.js index 1f25b7441..f117df45c 100644 --- a/packages/ruleset/src/rules/pagination-style.js +++ b/packages/ruleset/src/rules/pagination-style.js @@ -3,15 +3,15 @@ * SPDX-License-Identifier: Apache2.0 */ -import { paths } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; -import { oas3 } from "@stoplight/spectral-formats"; -import { paginationStyle } from "../functions"; +import { paths } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; +import { oas3 } from '@stoplight/spectral-formats'; +import { paginationStyle } from '../functions'; export const description = - "List operations should have correct pagination style"; -export const message = "{{error}}"; + 'List operations should have correct pagination style'; +export const message = '{{error}}'; export const given = paths; -export const severity = "warn"; +export const severity = 'warn'; export const formats = [oas3]; export const resolved = true; export const then = { diff --git a/packages/ruleset/src/rules/parameter-casing-convention.js b/packages/ruleset/src/rules/parameter-casing-convention.js index 95e023fae..1dbad5583 100644 --- a/packages/ruleset/src/rules/parameter-casing-convention.js +++ b/packages/ruleset/src/rules/parameter-casing-convention.js @@ -3,15 +3,15 @@ * SPDX-License-Identifier: Apache2.0 */ -import { parameters } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; -import { oas3 } from "@stoplight/spectral-formats"; -import { parameterCasingConvention } from "../functions"; +import { parameters } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; +import { oas3 } from '@stoplight/spectral-formats'; +import { parameterCasingConvention } from '../functions'; -export const description = "Parameter names must follow case conventions"; -export const message = "{{error}}"; +export const description = 'Parameter names must follow case conventions'; +export const message = '{{error}}'; export const formats = [oas3]; export const given = parameters; -export const severity = "error"; +export const severity = 'error'; export const resolved = true; export const then = { function: parameterCasingConvention, @@ -28,25 +28,25 @@ export const then = { // Allow snake case for query parameter names, // but also allow '.' within the name. query: { - type: "snake", + type: 'snake', separator: { - char: ".", + char: '.', }, }, // Allow snake case for path parameter names. path: { - type: "snake", + type: 'snake', }, // Spectral casing convention types aren't robust enough to handle // the complexity of headers, so we define our own kebab/pascal case regex. header: { - match: "/^[A-Z]+[a-z0-9]*-*([A-Z]+[a-z0-9]*-*)*$/", + match: '/^[A-Z]+[a-z0-9]*-*([A-Z]+[a-z0-9]*-*)*$/', }, // Define an alternate message for the header pattern validation // to avoid using the default Spectral message. - headerMessage: "Header parameter names must be kebab-separated pascal case", + headerMessage: 'Header parameter names must be kebab-separated pascal case', }, }; diff --git a/packages/ruleset/src/rules/parameter-default.js b/packages/ruleset/src/rules/parameter-default.js index 2cff153cb..b42b80e34 100644 --- a/packages/ruleset/src/rules/parameter-default.js +++ b/packages/ruleset/src/rules/parameter-default.js @@ -3,15 +3,15 @@ * SPDX-License-Identifier: Apache2.0 */ -import { parameters } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; -import { oas2, oas3 } from "@stoplight/spectral-formats"; -import { parameterDefault } from "../functions"; +import { parameters } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; +import { oas2, oas3 } from '@stoplight/spectral-formats'; +import { parameterDefault } from '../functions'; export const description = - "Required parameters should not define a default value"; -export const message = "{{error}}"; + 'Required parameters should not define a default value'; +export const message = '{{error}}'; export const given = parameters; -export const severity = "warn"; +export const severity = 'warn'; export const formats = [oas2, oas3]; export const resolved = true; export const then = { diff --git a/packages/ruleset/src/rules/parameter-description-exists.js b/packages/ruleset/src/rules/parameter-description-exists.js index 6c8ff9ee4..b036d4b59 100644 --- a/packages/ruleset/src/rules/parameter-description-exists.js +++ b/packages/ruleset/src/rules/parameter-description-exists.js @@ -3,14 +3,14 @@ * SPDX-License-Identifier: Apache2.0 */ -import { parameters } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; -import { oas3 } from "@stoplight/spectral-formats"; -import { parameterDescriptionExists } from "../functions"; +import { parameters } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; +import { oas3 } from '@stoplight/spectral-formats'; +import { parameterDescriptionExists } from '../functions'; -export const description = "Parameters should have a non-empty description"; -export const message = "{{error}}"; +export const description = 'Parameters should have a non-empty description'; +export const message = '{{error}}'; export const given = parameters; -export const severity = "warn"; +export const severity = 'warn'; export const formats = [oas3]; export const resolved = true; export const then = { diff --git a/packages/ruleset/src/rules/parameter-order.js b/packages/ruleset/src/rules/parameter-order.js index 6583053e4..b84d6b2b4 100644 --- a/packages/ruleset/src/rules/parameter-order.js +++ b/packages/ruleset/src/rules/parameter-order.js @@ -3,15 +3,15 @@ * SPDX-License-Identifier: Apache2.0 */ -import { operations } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; -import { oas3 } from "@stoplight/spectral-formats"; -import { parameterOrder } from "../functions"; +import { operations } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; +import { oas3 } from '@stoplight/spectral-formats'; +import { parameterOrder } from '../functions'; export const description = - "All required operation parameters should be listed before any optional parameters."; -export const message = "{{error}}"; + 'All required operation parameters should be listed before any optional parameters.'; +export const message = '{{error}}'; export const given = operations; -export const severity = "warn"; +export const severity = 'warn'; export const formats = [oas3]; export const resolved = true; export const then = { diff --git a/packages/ruleset/src/rules/parameter-schema-or-content-exists.js b/packages/ruleset/src/rules/parameter-schema-or-content-exists.js index 12e7e3aa6..f47945396 100644 --- a/packages/ruleset/src/rules/parameter-schema-or-content-exists.js +++ b/packages/ruleset/src/rules/parameter-schema-or-content-exists.js @@ -3,15 +3,15 @@ * SPDX-License-Identifier: Apache2.0 */ -import { oas3 } from "@stoplight/spectral-formats"; -import { schemaOrContentProvided } from "../functions"; +import { oas3 } from '@stoplight/spectral-formats'; +import { schemaOrContentProvided } from '../functions'; -export const description = "Parameter must provide either a schema or content"; -export const message = "{{error}}"; -export const severity = "error"; +export const description = 'Parameter must provide either a schema or content'; +export const message = '{{error}}'; +export const severity = 'error'; export const formats = [oas3]; export const resolved = true; -export const given = "$.paths[*][*].parameters[*]"; +export const given = '$.paths[*][*].parameters[*]'; export const then = { function: schemaOrContentProvided, }; diff --git a/packages/ruleset/src/rules/patch-request-content-type.js b/packages/ruleset/src/rules/patch-request-content-type.js index 44f6a56b0..b9880c5b0 100644 --- a/packages/ruleset/src/rules/patch-request-content-type.js +++ b/packages/ruleset/src/rules/patch-request-content-type.js @@ -3,15 +3,15 @@ * SPDX-License-Identifier: Apache2.0 */ -import { patchOperations } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; -import { oas3 } from "@stoplight/spectral-formats"; -import { patchRequestContentType } from "../functions"; +import { patchOperations } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; +import { oas3 } from '@stoplight/spectral-formats'; +import { patchRequestContentType } from '../functions'; export const description = - "PATCH operations should support content types application/json-patch+json or application/merge-patch+json"; -export const message = "{{description}}"; + 'PATCH operations should support content types application/json-patch+json or application/merge-patch+json'; +export const message = '{{description}}'; export const given = patchOperations; -export const severity = "warn"; +export const severity = 'warn'; export const formats = [oas3]; export const resolved = true; export const then = { diff --git a/packages/ruleset/src/rules/path-parameter-not-crn.js b/packages/ruleset/src/rules/path-parameter-not-crn.js index 22b59137c..d65cd9e61 100644 --- a/packages/ruleset/src/rules/path-parameter-not-crn.js +++ b/packages/ruleset/src/rules/path-parameter-not-crn.js @@ -3,18 +3,18 @@ * SPDX-License-Identifier: Apache2.0 */ -import { oas3 } from "@stoplight/spectral-formats"; -import { pathParameterNotCRN } from "../functions"; +import { oas3 } from '@stoplight/spectral-formats'; +import { pathParameterNotCRN } from '../functions'; export const description = - "Path parameters should not be defined as a CRN (Cloud Resource Name) value"; -export const message = "{{error}}"; + 'Path parameters should not be defined as a CRN (Cloud Resource Name) value'; +export const message = '{{error}}'; export const formats = [oas3]; export const given = [ '$.paths[*].parameters[?(@.in === "path")]', '$.paths[*][get,put,post,delete,options,head,patch,trace].parameters[?(@.in === "path")]', ]; -export const severity = "warn"; +export const severity = 'warn'; export const resolved = true; export const then = { function: pathParameterNotCRN, diff --git a/packages/ruleset/src/rules/path-segment-casing-convention.js b/packages/ruleset/src/rules/path-segment-casing-convention.js index 438ec6a0d..ea140b952 100644 --- a/packages/ruleset/src/rules/path-segment-casing-convention.js +++ b/packages/ruleset/src/rules/path-segment-casing-convention.js @@ -3,19 +3,19 @@ * SPDX-License-Identifier: Apache2.0 */ -import { paths } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; -import { oas3 } from "@stoplight/spectral-formats"; -import { pathSegmentCasingConvention } from "../functions"; +import { paths } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; +import { oas3 } from '@stoplight/spectral-formats'; +import { pathSegmentCasingConvention } from '../functions'; export const description = - "Path segments must follow a specified case convention"; -export const message = "{{error}}"; + 'Path segments must follow a specified case convention'; +export const message = '{{error}}'; export const formats = [oas3]; export const given = paths; -export const severity = "error"; +export const severity = 'error'; export const then = { function: pathSegmentCasingConvention, functionOptions: { - type: "snake", + type: 'snake', }, }; diff --git a/packages/ruleset/src/rules/pattern-properties.js b/packages/ruleset/src/rules/pattern-properties.js index ba56bb1ad..51feb599e 100644 --- a/packages/ruleset/src/rules/pattern-properties.js +++ b/packages/ruleset/src/rules/pattern-properties.js @@ -3,15 +3,15 @@ * SPDX-License-Identifier: Apache2.0 */ -import { oas3_1 } from "@stoplight/spectral-formats"; -import { patternPropertiesCheck } from "../functions"; -import { schemas } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; +import { oas3_1 } from '@stoplight/spectral-formats'; +import { patternPropertiesCheck } from '../functions'; +import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; export const description = 'Enforces certain restrictions on the use of "patternProperties" within a schema.'; -export const message = "{{error}}"; +export const message = '{{error}}'; export const given = schemas; -export const severity = "error"; +export const severity = 'error'; export const formats = [oas3_1]; export const resolved = true; export const then = { diff --git a/packages/ruleset/src/rules/precondition-header.js b/packages/ruleset/src/rules/precondition-header.js index 43fd5d18e..fcc79ee13 100644 --- a/packages/ruleset/src/rules/precondition-header.js +++ b/packages/ruleset/src/rules/precondition-header.js @@ -3,16 +3,16 @@ * SPDX-License-Identifier: Apache2.0 */ -import { operations } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; -import { oas3 } from "@stoplight/spectral-formats"; -import { preconditionHeader } from "../functions"; +import { operations } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; +import { oas3 } from '@stoplight/spectral-formats'; +import { preconditionHeader } from '../functions'; export const description = - "Operations with `412` response must support at least one conditional header."; -export const message = "{{error}}"; + 'Operations with `412` response must support at least one conditional header.'; +export const message = '{{error}}'; export const formats = [oas3]; export const given = operations; -export const severity = "error"; +export const severity = 'error'; export const resolved = true; export const then = { function: preconditionHeader, diff --git a/packages/ruleset/src/rules/prefer-token-pagination.js b/packages/ruleset/src/rules/prefer-token-pagination.js index 674dd9e6c..2276b399d 100644 --- a/packages/ruleset/src/rules/prefer-token-pagination.js +++ b/packages/ruleset/src/rules/prefer-token-pagination.js @@ -3,15 +3,15 @@ * SPDX-License-Identifier: Apache2.0 */ -import { paths } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; -import { oas3 } from "@stoplight/spectral-formats"; -import { preferTokenPagination } from "../functions"; +import { paths } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; +import { oas3 } from '@stoplight/spectral-formats'; +import { preferTokenPagination } from '../functions'; export const description = - "Paginated list operations should use token-based pagination, rather than offset/limit pagination."; -export const message = "{{error}}"; + 'Paginated list operations should use token-based pagination, rather than offset/limit pagination.'; +export const message = '{{error}}'; export const given = paths; -export const severity = "warn"; +export const severity = 'warn'; export const formats = [oas3]; export const resolved = true; export const then = { diff --git a/packages/ruleset/src/rules/property-attributes.js b/packages/ruleset/src/rules/property-attributes.js index c17905032..6c60e04fc 100644 --- a/packages/ruleset/src/rules/property-attributes.js +++ b/packages/ruleset/src/rules/property-attributes.js @@ -3,15 +3,15 @@ * SPDX-License-Identifier: Apache2.0 */ -import { schemas } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; -import { oas3 } from "@stoplight/spectral-formats"; -import { propertyAttributes } from "../functions"; +import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; +import { oas3 } from '@stoplight/spectral-formats'; +import { propertyAttributes } from '../functions'; export const description = - "Performs checks on specific attributes of a schema or schema property"; -export const message = "{{error}}"; + 'Performs checks on specific attributes of a schema or schema property'; +export const message = '{{error}}'; export const given = schemas; -export const severity = "error"; +export const severity = 'error'; export const formats = [oas3]; export const resolved = true; export const then = { diff --git a/packages/ruleset/src/rules/property-casing-convention.js b/packages/ruleset/src/rules/property-casing-convention.js index 4d7fd90a8..968530431 100644 --- a/packages/ruleset/src/rules/property-casing-convention.js +++ b/packages/ruleset/src/rules/property-casing-convention.js @@ -3,19 +3,19 @@ * SPDX-License-Identifier: Apache2.0 */ -import { schemas } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; -import { oas3 } from "@stoplight/spectral-formats"; -import { propertyCasingConvention } from "../functions"; +import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; +import { oas3 } from '@stoplight/spectral-formats'; +import { propertyCasingConvention } from '../functions'; export const description = - "Property names must follow a specified case convention"; -export const message = "{{error}}"; + 'Property names must follow a specified case convention'; +export const message = '{{error}}'; export const formats = [oas3]; export const given = schemas; -export const severity = "error"; +export const severity = 'error'; export const then = { function: propertyCasingConvention, functionOptions: { - type: "snake", + type: 'snake', }, }; diff --git a/packages/ruleset/src/rules/property-consistent-name-and-type.js b/packages/ruleset/src/rules/property-consistent-name-and-type.js index a404a5bd8..9436574ac 100644 --- a/packages/ruleset/src/rules/property-consistent-name-and-type.js +++ b/packages/ruleset/src/rules/property-consistent-name-and-type.js @@ -3,20 +3,20 @@ * SPDX-License-Identifier: Apache2.0 */ -import { schemas } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; -import { oas3 } from "@stoplight/spectral-formats"; -import { propertyConsistentNameAndType } from "../functions"; +import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; +import { oas3 } from '@stoplight/spectral-formats'; +import { propertyConsistentNameAndType } from '../functions'; export const description = - "Schema properties that have the same name should also have the same types."; -export const message = "{{error}}"; + 'Schema properties that have the same name should also have the same types.'; +export const message = '{{error}}'; export const formats = [oas3]; export const given = schemas; -export const severity = "off"; +export const severity = 'off'; export const resolved = true; export const then = { function: propertyConsistentNameAndType, functionOptions: { - excludedProperties: ["code", "default", "type", "value"], + excludedProperties: ['code', 'default', 'type', 'value'], }, }; diff --git a/packages/ruleset/src/rules/property-description-exists.js b/packages/ruleset/src/rules/property-description-exists.js index 6d0396416..985d56103 100644 --- a/packages/ruleset/src/rules/property-description-exists.js +++ b/packages/ruleset/src/rules/property-description-exists.js @@ -3,15 +3,15 @@ * SPDX-License-Identifier: Apache2.0 */ -import { schemas } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; -import { oas3 } from "@stoplight/spectral-formats"; -import { propertyDescriptionExists } from "../functions"; +import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; +import { oas3 } from '@stoplight/spectral-formats'; +import { propertyDescriptionExists } from '../functions'; export const description = - "Schema properties should have a non-empty description"; -export const message = "{{error}}"; + 'Schema properties should have a non-empty description'; +export const message = '{{error}}'; export const given = schemas; -export const severity = "warn"; +export const severity = 'warn'; export const formats = [oas3]; export const resolved = true; export const then = { diff --git a/packages/ruleset/src/rules/property-name-collision.js b/packages/ruleset/src/rules/property-name-collision.js index 8e60867b1..1f56d5f7a 100644 --- a/packages/ruleset/src/rules/property-name-collision.js +++ b/packages/ruleset/src/rules/property-name-collision.js @@ -3,16 +3,16 @@ * SPDX-License-Identifier: Apache2.0 */ -import { schemas } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; -import { oas3 } from "@stoplight/spectral-formats"; -import { propertyNameCollision } from "../functions"; +import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; +import { oas3 } from '@stoplight/spectral-formats'; +import { propertyNameCollision } from '../functions'; export const description = - "Avoid duplicate property names within a schema, even if they differ by case convention"; -export const message = "{{error}}"; + 'Avoid duplicate property names within a schema, even if they differ by case convention'; +export const message = '{{error}}'; export const formats = [oas3]; export const given = schemas; -export const severity = "error"; +export const severity = 'error'; export const resolved = true; export const then = { function: propertyNameCollision, diff --git a/packages/ruleset/src/rules/redirect-response-body.js b/packages/ruleset/src/rules/redirect-response-body.js index c9fb2e321..786591756 100644 --- a/packages/ruleset/src/rules/redirect-response-body.js +++ b/packages/ruleset/src/rules/redirect-response-body.js @@ -3,16 +3,16 @@ * SPDX-License-Identifier: Apache2.0 */ -import { operations } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; -import { oas3 } from "@stoplight/spectral-formats"; -import { redirectResponseBody } from "../functions"; +import { operations } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; +import { oas3 } from '@stoplight/spectral-formats'; +import { redirectResponseBody } from '../functions'; export const description = - "Performs multiple checks on the response body based on status codes"; -export const message = "{{error}}"; + 'Performs multiple checks on the response body based on status codes'; +export const message = '{{error}}'; export const formats = [oas3]; export const given = operations; -export const severity = "error"; +export const severity = 'error'; export const resolved = true; export const then = { function: redirectResponseBody, diff --git a/packages/ruleset/src/rules/ref-pattern.js b/packages/ruleset/src/rules/ref-pattern.js index a23aa00a7..e01c21d16 100644 --- a/packages/ruleset/src/rules/ref-pattern.js +++ b/packages/ruleset/src/rules/ref-pattern.js @@ -3,13 +3,13 @@ * SPDX-License-Identifier: Apache2.0 */ -import { oas3 } from "@stoplight/spectral-formats"; -import { refPattern } from "../functions"; +import { oas3 } from '@stoplight/spectral-formats'; +import { refPattern } from '../functions'; -export const description = "$refs must follow the correct pattern."; -export const message = "{{error}}"; -export const given = "$..$ref"; -export const severity = "warn"; +export const description = '$refs must follow the correct pattern.'; +export const message = '{{error}}'; +export const given = '$..$ref'; +export const severity = 'warn'; export const formats = [oas3]; export const resolved = false; export const then = { diff --git a/packages/ruleset/src/rules/ref-sibling-duplicate-description.js b/packages/ruleset/src/rules/ref-sibling-duplicate-description.js index c380d3dbc..5dd501271 100644 --- a/packages/ruleset/src/rules/ref-sibling-duplicate-description.js +++ b/packages/ruleset/src/rules/ref-sibling-duplicate-description.js @@ -3,15 +3,15 @@ * SPDX-License-Identifier: Apache2.0 */ -import { schemas } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; -import { oas3 } from "@stoplight/spectral-formats"; -import { refSiblingDuplicateDescription } from "../functions"; +import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; +import { oas3 } from '@stoplight/spectral-formats'; +import { refSiblingDuplicateDescription } from '../functions'; export const description = - "Schemas and schema properties should avoid duplicate descriptions within allOf $ref siblings"; -export const message = "{{error}}"; + 'Schemas and schema properties should avoid duplicate descriptions within allOf $ref siblings'; +export const message = '{{error}}'; export const given = schemas; -export const severity = "warn"; +export const severity = 'warn'; export const formats = [oas3]; export const resolved = true; export const then = { diff --git a/packages/ruleset/src/rules/request-and-response-content.js b/packages/ruleset/src/rules/request-and-response-content.js index cb266e659..3c5e448a2 100644 --- a/packages/ruleset/src/rules/request-and-response-content.js +++ b/packages/ruleset/src/rules/request-and-response-content.js @@ -3,14 +3,14 @@ * SPDX-License-Identifier: Apache2.0 */ -import { operations } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; -import { oas3 } from "@stoplight/spectral-formats"; -import { requestAndResponseContent } from "../functions"; +import { operations } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; +import { oas3 } from '@stoplight/spectral-formats'; +import { requestAndResponseContent } from '../functions'; export const description = - "Request bodies and non-204 responses should define a content object"; + 'Request bodies and non-204 responses should define a content object'; export const given = operations; -export const severity = "warn"; +export const severity = 'warn'; export const formats = [oas3]; export const resolved = true; export const then = { diff --git a/packages/ruleset/src/rules/requestbody-is-object.js b/packages/ruleset/src/rules/requestbody-is-object.js index 515169dc7..b3296560b 100644 --- a/packages/ruleset/src/rules/requestbody-is-object.js +++ b/packages/ruleset/src/rules/requestbody-is-object.js @@ -3,16 +3,16 @@ * SPDX-License-Identifier: Apache2.0 */ -import { enumeration } from "@stoplight/spectral-functions"; +import { enumeration } from '@stoplight/spectral-functions'; -export const description = "All request bodies MUST be structured as an object"; +export const description = 'All request bodies MUST be structured as an object'; export const given = '$.paths[*][*].requestBody.content[?(@property ~= "^application\\\\/json(;.*)*$")].schema'; -export const severity = "error"; +export const severity = 'error'; export const then = { - field: "type", + field: 'type', function: enumeration, functionOptions: { - values: ["object"], + values: ['object'], }, }; diff --git a/packages/ruleset/src/rules/requestbody-name.js b/packages/ruleset/src/rules/requestbody-name.js index 8b59bcf63..b3b0e3a30 100644 --- a/packages/ruleset/src/rules/requestbody-name.js +++ b/packages/ruleset/src/rules/requestbody-name.js @@ -3,15 +3,15 @@ * SPDX-License-Identifier: Apache2.0 */ -import { operations } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; -import { oas3 } from "@stoplight/spectral-formats"; -import { requestBodyName } from "../functions"; +import { operations } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; +import { oas3 } from '@stoplight/spectral-formats'; +import { requestBodyName } from '../functions'; export const description = - "Verifies that operations have the x-codegen-request-body-name extension set when needed"; -export const message = "{{error}}"; + 'Verifies that operations have the x-codegen-request-body-name extension set when needed'; +export const message = '{{error}}'; export const given = operations; -export const severity = "off"; +export const severity = 'off'; export const formats = [oas3]; export const resolved = true; export const then = { diff --git a/packages/ruleset/src/rules/required-array-properties-in-response.js b/packages/ruleset/src/rules/required-array-properties-in-response.js index 6061d27fb..36b514908 100644 --- a/packages/ruleset/src/rules/required-array-properties-in-response.js +++ b/packages/ruleset/src/rules/required-array-properties-in-response.js @@ -3,15 +3,15 @@ * SPDX-License-Identifier: Apache2.0 */ -import { responseSchemas } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; +import { responseSchemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; -import { requiredArrayPropertiesInResponse } from "../functions"; +import { requiredArrayPropertiesInResponse } from '../functions'; export const description = - "Array properties defined in a response should be required."; -export const message = "{{error}}"; + 'Array properties defined in a response should be required.'; +export const message = '{{error}}'; export const given = responseSchemas; -export const severity = "error"; +export const severity = 'error'; export const resolved = true; export const then = { function: requiredArrayPropertiesInResponse, diff --git a/packages/ruleset/src/rules/required-enum-properties-in-response.js b/packages/ruleset/src/rules/required-enum-properties-in-response.js index 02a3cdd6c..d10bf2625 100644 --- a/packages/ruleset/src/rules/required-enum-properties-in-response.js +++ b/packages/ruleset/src/rules/required-enum-properties-in-response.js @@ -3,15 +3,15 @@ * SPDX-License-Identifier: Apache2.0 */ -import { responseSchemas } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; +import { responseSchemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; -import { requiredEnumPropertiesInResponse } from "../functions"; +import { requiredEnumPropertiesInResponse } from '../functions'; export const description = - "Enumeration properties defined in a response must be required."; -export const message = "{{error}}"; + 'Enumeration properties defined in a response must be required.'; +export const message = '{{error}}'; export const given = responseSchemas; -export const severity = "error"; +export const severity = 'error'; export const resolved = true; export const then = { function: requiredEnumPropertiesInResponse, diff --git a/packages/ruleset/src/rules/required-property-missing.js b/packages/ruleset/src/rules/required-property-missing.js index aa5dcf78b..1b433ec99 100644 --- a/packages/ruleset/src/rules/required-property-missing.js +++ b/packages/ruleset/src/rules/required-property-missing.js @@ -3,15 +3,15 @@ * SPDX-License-Identifier: Apache2.0 */ -import { schemas } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; -import { oas3 } from "@stoplight/spectral-formats"; -import { requiredProperty } from "../functions"; +import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; +import { oas3 } from '@stoplight/spectral-formats'; +import { requiredProperty } from '../functions'; -export const description = "A required property is not in the schema"; -export const message = "{{error}}"; +export const description = 'A required property is not in the schema'; +export const message = '{{error}}'; export const formats = [oas3]; export const given = schemas; -export const severity = "error"; +export const severity = 'error'; export const then = { function: requiredProperty, }; diff --git a/packages/ruleset/src/rules/resource-response-consistency.js b/packages/ruleset/src/rules/resource-response-consistency.js index 8de284485..def0db723 100644 --- a/packages/ruleset/src/rules/resource-response-consistency.js +++ b/packages/ruleset/src/rules/resource-response-consistency.js @@ -3,15 +3,15 @@ * SPDX-License-Identifier: Apache2.0 */ -import { oas3 } from "@stoplight/spectral-formats"; -import { resourceResponseConsistency } from "../functions"; +import { oas3 } from '@stoplight/spectral-formats'; +import { resourceResponseConsistency } from '../functions'; export const description = 'Operations that create or update a resource should return the same schema as the "GET" request for the resource.'; -export const message = "{{error}}"; +export const message = '{{error}}'; export const formats = [oas3]; export const given = [`$.paths[*][put,post,patch]`]; -export const severity = "warn"; +export const severity = 'warn'; export const resolved = true; export const then = { function: resourceResponseConsistency, diff --git a/packages/ruleset/src/rules/response-example-exists.js b/packages/ruleset/src/rules/response-example-exists.js index 831aef2c2..b63ae5537 100644 --- a/packages/ruleset/src/rules/response-example-exists.js +++ b/packages/ruleset/src/rules/response-example-exists.js @@ -3,13 +3,13 @@ * SPDX-License-Identifier: Apache2.0 */ -import { responseExampleExists } from "../functions"; +import { responseExampleExists } from '../functions'; -export const description = "Each response should include an example"; -export const message = "{{error}}"; +export const description = 'Each response should include an example'; +export const message = '{{error}}'; export const given = - "$.paths[*][*].responses[?(@property >= 200 && @property < 300)].content.application/json"; -export const severity = "warn"; + '$.paths[*][*].responses[?(@property >= 200 && @property < 300)].content.application/json'; +export const severity = 'warn'; export const resolved = true; export const then = { function: responseExampleExists, diff --git a/packages/ruleset/src/rules/response-status-codes.js b/packages/ruleset/src/rules/response-status-codes.js index 795170506..6df551545 100644 --- a/packages/ruleset/src/rules/response-status-codes.js +++ b/packages/ruleset/src/rules/response-status-codes.js @@ -3,16 +3,16 @@ * SPDX-License-Identifier: Apache2.0 */ -import { operations } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; -import { oas3 } from "@stoplight/spectral-formats"; -import { responseStatusCodes } from "../functions"; +import { operations } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; +import { oas3 } from '@stoplight/spectral-formats'; +import { responseStatusCodes } from '../functions'; export const description = - "Performs multiple checks on the status codes used in operation responses"; -export const message = "{{error}}"; + 'Performs multiple checks on the status codes used in operation responses'; +export const message = '{{error}}'; export const formats = [oas3]; export const given = operations; -export const severity = "warn"; +export const severity = 'warn'; export const resolved = true; export const then = { function: responseStatusCodes, diff --git a/packages/ruleset/src/rules/schema-casing-convention.js b/packages/ruleset/src/rules/schema-casing-convention.js index ae524381d..5045a5f93 100644 --- a/packages/ruleset/src/rules/schema-casing-convention.js +++ b/packages/ruleset/src/rules/schema-casing-convention.js @@ -3,18 +3,18 @@ * SPDX-License-Identifier: Apache2.0 */ -import { oas3 } from "@stoplight/spectral-formats"; -import { schemaCasingConvention } from "../functions"; +import { oas3 } from '@stoplight/spectral-formats'; +import { schemaCasingConvention } from '../functions'; export const description = - "Schema names must follow a specified case convention"; -export const message = "{{error}}"; + 'Schema names must follow a specified case convention'; +export const message = '{{error}}'; export const formats = [oas3]; -export const given = ["$.components"]; -export const severity = "warn"; +export const given = ['$.components']; +export const severity = 'warn'; export const then = { function: schemaCasingConvention, functionOptions: { - match: "/^[A-Z]+[a-z0-9]+([A-Z]+[a-z0-9]*)*$/", + match: '/^[A-Z]+[a-z0-9]+([A-Z]+[a-z0-9]*)*$/', }, }; diff --git a/packages/ruleset/src/rules/schema-description-exists.js b/packages/ruleset/src/rules/schema-description-exists.js index e55f5722a..77d179591 100644 --- a/packages/ruleset/src/rules/schema-description-exists.js +++ b/packages/ruleset/src/rules/schema-description-exists.js @@ -3,14 +3,14 @@ * SPDX-License-Identifier: Apache2.0 */ -import { schemas } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; -import { oas3 } from "@stoplight/spectral-formats"; -import { schemaDescriptionExists } from "../functions"; +import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; +import { oas3 } from '@stoplight/spectral-formats'; +import { schemaDescriptionExists } from '../functions'; -export const description = "Schemas should have a non-empty description"; -export const message = "{{error}}"; +export const description = 'Schemas should have a non-empty description'; +export const message = '{{error}}'; export const given = schemas; -export const severity = "warn"; +export const severity = 'warn'; export const formats = [oas3]; export const resolved = true; export const then = { diff --git a/packages/ruleset/src/rules/schema-keywords.js b/packages/ruleset/src/rules/schema-keywords.js index 77798b31d..478f31d72 100644 --- a/packages/ruleset/src/rules/schema-keywords.js +++ b/packages/ruleset/src/rules/schema-keywords.js @@ -3,14 +3,14 @@ * SPDX-License-Identifier: Apache2.0 */ -import { schemas } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; -import { oas3_1 } from "@stoplight/spectral-formats"; -import { allowedKeywords } from "../functions"; +import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; +import { oas3_1 } from '@stoplight/spectral-formats'; +import { allowedKeywords } from '../functions'; export const description = - "Verifies that schema objects include only allowed-listed keywords"; -export const message = "{{error}}"; -export const severity = "error"; + 'Verifies that schema objects include only allowed-listed keywords'; +export const message = '{{error}}'; +export const severity = 'error'; export const formats = [oas3_1]; export const resolved = true; export const given = schemas; @@ -18,41 +18,41 @@ export const then = { function: allowedKeywords, functionOptions: { keywordAllowList: [ - "$ref", - "additionalProperties", - "allOf", - "anyOf", - "default", - "description", - "discriminator", - "enum", - "example", - "examples", - "exclusiveMaximum", - "exclusiveMinimum", - "format", - "items", - "maximum", - "maxItems", - "maxLength", - "maxProperties", - "minimum", - "minItems", - "minLength", - "minProperties", - "multipleOf", - "not", - "oneOf", - "pattern", - "patternProperties", - "properties", - "readOnly", - "required", - "title", - "type", - "uniqueItems", - "unevaluatedProperties", - "writeOnly", + '$ref', + 'additionalProperties', + 'allOf', + 'anyOf', + 'default', + 'description', + 'discriminator', + 'enum', + 'example', + 'examples', + 'exclusiveMaximum', + 'exclusiveMinimum', + 'format', + 'items', + 'maximum', + 'maxItems', + 'maxLength', + 'maxProperties', + 'minimum', + 'minItems', + 'minLength', + 'minProperties', + 'multipleOf', + 'not', + 'oneOf', + 'pattern', + 'patternProperties', + 'properties', + 'readOnly', + 'required', + 'title', + 'type', + 'uniqueItems', + 'unevaluatedProperties', + 'writeOnly', ], }, }; diff --git a/packages/ruleset/src/rules/schema-naming-convention.js b/packages/ruleset/src/rules/schema-naming-convention.js index f2888ae86..26179d485 100644 --- a/packages/ruleset/src/rules/schema-naming-convention.js +++ b/packages/ruleset/src/rules/schema-naming-convention.js @@ -3,14 +3,14 @@ * SPDX-License-Identifier: Apache2.0 */ -import { oas3 } from "@stoplight/spectral-formats"; -import { schemaNamingConvention } from "../functions"; +import { oas3 } from '@stoplight/spectral-formats'; +import { schemaNamingConvention } from '../functions'; export const description = - "Schemas should follow naming conventions in the API Handbook"; -export const message = "{{error}}"; -export const given = ["$"]; -export const severity = "warn"; + 'Schemas should follow naming conventions in the API Handbook'; +export const message = '{{error}}'; +export const given = ['$']; +export const severity = 'warn'; export const formats = [oas3]; export const resolved = true; export const then = { diff --git a/packages/ruleset/src/rules/schema-type-exists.js b/packages/ruleset/src/rules/schema-type-exists.js index 4c74c583b..016bc531d 100644 --- a/packages/ruleset/src/rules/schema-type-exists.js +++ b/packages/ruleset/src/rules/schema-type-exists.js @@ -3,15 +3,15 @@ * SPDX-License-Identifier: Apache2.0 */ -import { schemas } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; -import { oas3 } from "@stoplight/spectral-formats"; -import { schemaTypeExists } from "../functions"; +import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; +import { oas3 } from '@stoplight/spectral-formats'; +import { schemaTypeExists } from '../functions'; export const description = - "Schemas and schema properties should have a non-empty `type` field. **This rule is disabled by default.**"; -export const message = "{{error}}"; + 'Schemas and schema properties should have a non-empty `type` field. **This rule is disabled by default.**'; +export const message = '{{error}}'; export const given = schemas; -export const severity = "off"; +export const severity = 'off'; export const formats = [oas3]; export const resolved = true; export const then = { diff --git a/packages/ruleset/src/rules/schema-type-format.js b/packages/ruleset/src/rules/schema-type-format.js index 0f3160362..ed3059667 100644 --- a/packages/ruleset/src/rules/schema-type-format.js +++ b/packages/ruleset/src/rules/schema-type-format.js @@ -3,15 +3,15 @@ * SPDX-License-Identifier: Apache2.0 */ -import { schemas } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; -import { oas3 } from "@stoplight/spectral-formats"; -import { schemaTypeFormat } from "../functions"; +import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; +import { oas3 } from '@stoplight/spectral-formats'; +import { schemaTypeFormat } from '../functions'; export const description = - "Schemas and schema properties must use a valid combination of type and format"; -export const message = "{{error}}"; + 'Schemas and schema properties must use a valid combination of type and format'; +export const message = '{{error}}'; export const given = schemas; -export const severity = "error"; +export const severity = 'error'; export const formats = [oas3]; export const resolved = true; export const then = { diff --git a/packages/ruleset/src/rules/securityscheme-attributes.js b/packages/ruleset/src/rules/securityscheme-attributes.js index a2f1ccfdc..cffe07b93 100644 --- a/packages/ruleset/src/rules/securityscheme-attributes.js +++ b/packages/ruleset/src/rules/securityscheme-attributes.js @@ -3,15 +3,15 @@ * SPDX-License-Identifier: Apache2.0 */ -import { securitySchemes } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; -import { oas3 } from "@stoplight/spectral-formats"; -import { securitySchemeAttributes } from "../functions"; +import { securitySchemes } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; +import { oas3 } from '@stoplight/spectral-formats'; +import { securitySchemeAttributes } from '../functions'; export const description = - "Validates the attributes of security schemes within an OpenAPI 3 document"; -export const message = "{{error}}"; + 'Validates the attributes of security schemes within an OpenAPI 3 document'; +export const message = '{{error}}'; export const given = securitySchemes; -export const severity = "error"; +export const severity = 'error'; export const formats = [oas3]; export const resolved = true; export const then = { diff --git a/packages/ruleset/src/rules/securityschemes.js b/packages/ruleset/src/rules/securityschemes.js index 275937a5f..9114bc5da 100644 --- a/packages/ruleset/src/rules/securityschemes.js +++ b/packages/ruleset/src/rules/securityschemes.js @@ -3,14 +3,14 @@ * SPDX-License-Identifier: Apache2.0 */ -import { oas3 } from "@stoplight/spectral-formats"; -import { securitySchemes } from "../functions"; +import { oas3 } from '@stoplight/spectral-formats'; +import { securitySchemes } from '../functions'; export const description = - "Validates the security schemes within an OpenAPI 3 document"; -export const message = "{{error}}"; -export const given = ["$"]; -export const severity = "warn"; + 'Validates the security schemes within an OpenAPI 3 document'; +export const message = '{{error}}'; +export const given = ['$']; +export const severity = 'warn'; export const formats = [oas3]; export const resolved = true; export const then = { diff --git a/packages/ruleset/src/rules/server-variable-default-value.js b/packages/ruleset/src/rules/server-variable-default-value.js index 7d655129c..c91d8e63a 100644 --- a/packages/ruleset/src/rules/server-variable-default-value.js +++ b/packages/ruleset/src/rules/server-variable-default-value.js @@ -3,14 +3,14 @@ * SPDX-License-Identifier: Apache2.0 */ -import { oas3 } from "@stoplight/spectral-formats"; -import { truthy } from "@stoplight/spectral-functions"; +import { oas3 } from '@stoplight/spectral-formats'; +import { truthy } from '@stoplight/spectral-functions'; -export const description = "Server variable should have default value"; -export const severity = "warn"; +export const description = 'Server variable should have default value'; +export const severity = 'warn'; export const resolved = false; export const formats = [oas3]; -export const given = "$.servers[*][variables][*][default]"; +export const given = '$.servers[*][variables][*][default]'; export const then = { function: truthy, }; diff --git a/packages/ruleset/src/rules/string-attributes.js b/packages/ruleset/src/rules/string-attributes.js index a6522c5fd..305545591 100644 --- a/packages/ruleset/src/rules/string-attributes.js +++ b/packages/ruleset/src/rules/string-attributes.js @@ -3,14 +3,14 @@ * SPDX-License-Identifier: Apache2.0 */ -import { schemas } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; -import { oas3 } from "@stoplight/spectral-formats"; -import { stringAttributes } from "../functions"; +import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; +import { oas3 } from '@stoplight/spectral-formats'; +import { stringAttributes } from '../functions'; export const description = - "String schemas should have certain attributes defined"; -export const message = "{{error}}"; -export const severity = "warn"; + 'String schemas should have certain attributes defined'; +export const message = '{{error}}'; +export const severity = 'warn'; export const formats = [oas3]; export const resolved = true; export const given = schemas; diff --git a/packages/ruleset/src/rules/summary-sentence-style.js b/packages/ruleset/src/rules/summary-sentence-style.js index 346160b03..36877b7b0 100644 --- a/packages/ruleset/src/rules/summary-sentence-style.js +++ b/packages/ruleset/src/rules/summary-sentence-style.js @@ -3,18 +3,18 @@ * SPDX-License-Identifier: Apache2.0 */ -import { oas3 } from "@stoplight/spectral-formats"; -import { pattern } from "@stoplight/spectral-functions"; +import { oas3 } from '@stoplight/spectral-formats'; +import { pattern } from '@stoplight/spectral-functions'; export const description = - "Operation summaries should not have a trailing period"; -export const severity = "warn"; + 'Operation summaries should not have a trailing period'; +export const severity = 'warn'; export const formats = [oas3]; export const resolved = false; -export const given = "$.paths[*][*].summary"; +export const given = '$.paths[*][*].summary'; export const then = { function: pattern, functionOptions: { - notMatch: "\\.$", + notMatch: '\\.$', }, }; diff --git a/packages/ruleset/src/rules/typed-enum.js b/packages/ruleset/src/rules/typed-enum.js index 20018c5c5..f684e9549 100644 --- a/packages/ruleset/src/rules/typed-enum.js +++ b/packages/ruleset/src/rules/typed-enum.js @@ -3,8 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -import { schemas } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; -import { oas } from "@stoplight/spectral-rulesets"; +import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; +import { oas } from '@stoplight/spectral-rulesets'; // Spectral's "typed-enum" rule matches any object that happens to have a // "type" and "enum" field on it. This results in false positives when @@ -13,12 +13,12 @@ import { oas } from "@stoplight/spectral-rulesets"; // This solves the issue by replacing the "given" field with our "schemas" // collection, modified to only give schemas with a "type" and "enum" field, // while otherwise maintaining Spectral's implementation of the rule. -const typedEnum = oas.rules["typed-enum"]; -typedEnum.given = schemas.map((s) => +const typedEnum = oas.rules['typed-enum']; +typedEnum.given = schemas.map(s => s.replace( - "[*].schema", - "[?(@.schema && @.schema.type && @.schema.enum)].schema", - ), + '[*].schema', + '[?(@.schema && @.schema.type && @.schema.enum)].schema' + ) ); export default typedEnum; diff --git a/packages/ruleset/src/rules/unevaluated-properties.js b/packages/ruleset/src/rules/unevaluated-properties.js index 9e7114212..8a47062a3 100644 --- a/packages/ruleset/src/rules/unevaluated-properties.js +++ b/packages/ruleset/src/rules/unevaluated-properties.js @@ -3,15 +3,15 @@ * SPDX-License-Identifier: Apache2.0 */ -import { oas3_1 } from "@stoplight/spectral-formats"; -import { unevaluatedProperties } from "../functions"; -import { schemas } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; +import { oas3_1 } from '@stoplight/spectral-formats'; +import { unevaluatedProperties } from '../functions'; +import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; export const description = 'Enforces certain restrictions on the use of "unevaluatedProperties" within a schema.'; -export const message = "{{error}}"; +export const message = '{{error}}'; export const given = schemas; -export const severity = "error"; +export const severity = 'error'; export const formats = [oas3_1]; export const resolved = true; export const then = { diff --git a/packages/ruleset/src/rules/unique-parameter-request-property-names.js b/packages/ruleset/src/rules/unique-parameter-request-property-names.js index 72d4ce88e..055c60fd0 100644 --- a/packages/ruleset/src/rules/unique-parameter-request-property-names.js +++ b/packages/ruleset/src/rules/unique-parameter-request-property-names.js @@ -3,15 +3,15 @@ * SPDX-License-Identifier: Apache2.0 */ -import { paths } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; -import { oas3 } from "@stoplight/spectral-formats"; -import { uniqueParameterRequestPropertyNames } from "../functions"; +import { paths } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; +import { oas3 } from '@stoplight/spectral-formats'; +import { uniqueParameterRequestPropertyNames } from '../functions'; export const description = - "Names of requestBody properties should not be the same as operation parameter names"; -export const message = "{{error}}"; + 'Names of requestBody properties should not be the same as operation parameter names'; +export const message = '{{error}}'; export const given = paths; -export const severity = "error"; +export const severity = 'error'; export const formats = [oas3]; export const resolved = true; export const then = { diff --git a/packages/ruleset/src/rules/unused-tags.js b/packages/ruleset/src/rules/unused-tags.js index 9564eb1ea..6492d899f 100644 --- a/packages/ruleset/src/rules/unused-tags.js +++ b/packages/ruleset/src/rules/unused-tags.js @@ -3,13 +3,13 @@ * SPDX-License-Identifier: Apache2.0 */ -import { oas3 } from "@stoplight/spectral-formats"; -import { unusedTags } from "../functions"; +import { oas3 } from '@stoplight/spectral-formats'; +import { unusedTags } from '../functions'; -export const description = "Checks that each defined tag is actually used"; -export const message = "{{error}}"; -export const given = ["$"]; -export const severity = "warn"; +export const description = 'Checks that each defined tag is actually used'; +export const message = '{{error}}'; +export const given = ['$']; +export const severity = 'warn'; export const formats = [oas3]; export const resolved = true; export const then = { diff --git a/packages/ruleset/src/rules/use-date-based-format.js b/packages/ruleset/src/rules/use-date-based-format.js index d9c0375f1..559dfbc86 100644 --- a/packages/ruleset/src/rules/use-date-based-format.js +++ b/packages/ruleset/src/rules/use-date-based-format.js @@ -3,14 +3,14 @@ * SPDX-License-Identifier: Apache2.0 */ -import { schemas } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; -import { oas3 } from "@stoplight/spectral-formats"; -import { useDateBasedFormat } from "../functions"; +import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; +import { oas3 } from '@stoplight/spectral-formats'; +import { useDateBasedFormat } from '../functions'; export const description = 'Heuristically determine when a schema should have a format of "date" or "date-time"'; -export const message = "{{error}}"; -export const severity = "warn"; +export const message = '{{error}}'; +export const severity = 'warn'; export const formats = [oas3]; export const resolved = true; export const given = schemas; diff --git a/packages/ruleset/src/rules/valid-path-segments.js b/packages/ruleset/src/rules/valid-path-segments.js index 1c08d541c..e57a7fabf 100644 --- a/packages/ruleset/src/rules/valid-path-segments.js +++ b/packages/ruleset/src/rules/valid-path-segments.js @@ -3,16 +3,16 @@ * SPDX-License-Identifier: Apache2.0 */ -import { paths } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; -import { oas3 } from "@stoplight/spectral-formats"; -import { validatePathSegments } from "../functions"; +import { paths } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; +import { oas3 } from '@stoplight/spectral-formats'; +import { validatePathSegments } from '../functions'; export const description = - "Validates individual path segments within a path string"; -export const message = "{{error}}"; + 'Validates individual path segments within a path string'; +export const message = '{{error}}'; export const formats = [oas3]; export const given = paths; -export const severity = "error"; +export const severity = 'error'; export const resolved = true; export const then = { function: validatePathSegments, diff --git a/packages/ruleset/src/rules/valid-schema-example.js b/packages/ruleset/src/rules/valid-schema-example.js index 53fcc3044..871f723a2 100644 --- a/packages/ruleset/src/rules/valid-schema-example.js +++ b/packages/ruleset/src/rules/valid-schema-example.js @@ -3,15 +3,15 @@ * SPDX-License-Identifier: Apache2.0 */ -import { schemas } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; -import { oas3 } from "@stoplight/spectral-formats"; -import { validSchemaExample } from "../functions"; +import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; +import { oas3 } from '@stoplight/spectral-formats'; +import { validSchemaExample } from '../functions'; export const description = - "Schema examples should validate against the schema they are defined for"; -export const message = "{{error}}"; + 'Schema examples should validate against the schema they are defined for'; +export const message = '{{error}}'; export const given = schemas; -export const severity = "warn"; +export const severity = 'warn'; export const formats = [oas3]; export const resolved = true; export const then = { diff --git a/packages/ruleset/src/rules/well-defined-dictionaries.js b/packages/ruleset/src/rules/well-defined-dictionaries.js index fda4abc60..61fd8812e 100644 --- a/packages/ruleset/src/rules/well-defined-dictionaries.js +++ b/packages/ruleset/src/rules/well-defined-dictionaries.js @@ -3,15 +3,15 @@ * SPDX-License-Identifier: Apache2.0 */ -import { schemas } from "@ibm-cloud/openapi-ruleset-utilities/src/collections"; -import { oas3 } from "@stoplight/spectral-formats"; -import { wellDefinedDictionaries } from "../functions"; +import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; +import { oas3 } from '@stoplight/spectral-formats'; +import { wellDefinedDictionaries } from '../functions'; export const description = - "Dictionaries must be well defined and all values must share a single type."; -export const message = "{{error}}"; + 'Dictionaries must be well defined and all values must share a single type.'; +export const message = '{{error}}'; export const given = schemas; -export const severity = "warn"; +export const severity = 'warn'; export const formats = [oas3]; export const resolved = true; export const then = { diff --git a/packages/ruleset/src/utils/compute-refs-at-paths.js b/packages/ruleset/src/utils/compute-refs-at-paths.js index 21ec7f086..4ed529565 100644 --- a/packages/ruleset/src/utils/compute-refs-at-paths.js +++ b/packages/ruleset/src/utils/compute-refs-at-paths.js @@ -45,4 +45,4 @@ function computeRefsAtPaths(nodes) { return resultMap; } -module.exports = computeRefsAtPaths; +export default computeRefsAtPaths; diff --git a/packages/ruleset/src/utils/constants.js b/packages/ruleset/src/utils/constants.js index 992f92b2e..463dd8dd1 100644 --- a/packages/ruleset/src/utils/constants.js +++ b/packages/ruleset/src/utils/constants.js @@ -15,4 +15,4 @@ const operationMethods = [ 'trace', ]; -module.exports = operationMethods; +export default operationMethods; diff --git a/packages/ruleset/src/utils/date-based-utils.js b/packages/ruleset/src/utils/date-based-utils.js index 2d891bbb7..345f03e03 100644 --- a/packages/ruleset/src/utils/date-based-utils.js +++ b/packages/ruleset/src/utils/date-based-utils.js @@ -135,7 +135,7 @@ function isDateBasedValue(value) { return regularExpressions.some(r => r.test(value)); } -module.exports = { +export default { isDateBasedName, isDateBasedValue, }; diff --git a/packages/ruleset/src/utils/get-composite-schema-attribute.js b/packages/ruleset/src/utils/get-composite-schema-attribute.js index 38ecfdd24..6bf1c95b4 100644 --- a/packages/ruleset/src/utils/get-composite-schema-attribute.js +++ b/packages/ruleset/src/utils/get-composite-schema-attribute.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -const { schemaHasConstraint } = require('@ibm-cloud/openapi-ruleset-utilities'); +import { schemaHasConstraint } from '@ibm-cloud/openapi-ruleset-utilities'; /** * Retrieves the value of "schema"'s attribute named "attrName" either directly from "schema" @@ -27,4 +27,4 @@ function getCompositeSchemaAttribute(schema, attrName) { return foundConstraint ? value : undefined; } -module.exports = getCompositeSchemaAttribute; +export default getCompositeSchemaAttribute; diff --git a/packages/ruleset/src/utils/get-resource-oriented-paths.js b/packages/ruleset/src/utils/get-resource-oriented-paths.js index 3b06fa67e..0ab91fbe9 100644 --- a/packages/ruleset/src/utils/get-resource-oriented-paths.js +++ b/packages/ruleset/src/utils/get-resource-oriented-paths.js @@ -3,8 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { isObject } = require('@ibm-cloud/openapi-ruleset-utilities'); -const getResourceSpecificSiblingPath = require('./get-resource-specific-sibling-path'); +import { isObject } from '@ibm-cloud/openapi-ruleset-utilities'; +import getResourceSpecificSiblingPath from './get-resource-specific-sibling-path'; /** * Cycles through the path strings within an API definition to collect the paths @@ -44,4 +44,4 @@ function getResourceOrientedPaths(apidef) { return pathStore; } -module.exports = getResourceOrientedPaths; +export default getResourceOrientedPaths; diff --git a/packages/ruleset/src/utils/get-resource-specific-sibling-path.js b/packages/ruleset/src/utils/get-resource-specific-sibling-path.js index 388d3e978..e8483e216 100644 --- a/packages/ruleset/src/utils/get-resource-specific-sibling-path.js +++ b/packages/ruleset/src/utils/get-resource-specific-sibling-path.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -const { isObject } = require('@ibm-cloud/openapi-ruleset-utilities'); +import { isObject } from '@ibm-cloud/openapi-ruleset-utilities'; /** * Given a "generic" resource path string (e.g. '/foo'), look for a @@ -30,4 +30,4 @@ function getResourceSpecificSiblingPath(path, apidef) { return Object.keys(apidef.paths).find(p => siblingPathRE.test(p)); } -module.exports = getResourceSpecificSiblingPath; +export default getResourceSpecificSiblingPath; diff --git a/packages/ruleset/src/utils/get-response-codes.js b/packages/ruleset/src/utils/get-response-codes.js index 6ad101600..03a7788cb 100644 --- a/packages/ruleset/src/utils/get-response-codes.js +++ b/packages/ruleset/src/utils/get-response-codes.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -const { isObject } = require('@ibm-cloud/openapi-ruleset-utilities'); +import { isObject } from '@ibm-cloud/openapi-ruleset-utilities'; /** * For an OpenAPI 'responses' object, gather all of the defined @@ -21,4 +21,4 @@ function getResponseCodes(responses) { return [statusCodes, successCodes]; } -module.exports = getResponseCodes; +export default getResponseCodes; diff --git a/packages/ruleset/src/utils/get-schema-name-at-path.js b/packages/ruleset/src/utils/get-schema-name-at-path.js index d793846fb..34ca465c2 100644 --- a/packages/ruleset/src/utils/get-schema-name-at-path.js +++ b/packages/ruleset/src/utils/get-schema-name-at-path.js @@ -82,4 +82,4 @@ function getSchemaNameFromReference(reference) { return reference.split('.').at(-1); } -module.exports = getSchemaNameAtPath; +export default getSchemaNameAtPath; diff --git a/packages/ruleset/src/utils/index.js b/packages/ruleset/src/utils/index.js index fd8b04475..00389afd4 100644 --- a/packages/ruleset/src/utils/index.js +++ b/packages/ruleset/src/utils/index.js @@ -4,27 +4,31 @@ */ module.exports = { - computeRefsAtPaths: require('./compute-refs-at-paths'), - getCompositeSchemaAttribute: require('./get-composite-schema-attribute'), - getResourceSpecificSiblingPath: require('./get-resource-specific-sibling-path'), - getResourceOrientedPaths: require('./get-resource-oriented-paths'), - getResponseCodes: require('./get-response-codes'), - getSchemaNameAtPath: require('./get-schema-name-at-path'), + computeRefsAtPaths: require('./compute-refs-at-paths').default, + getCompositeSchemaAttribute: require('./get-composite-schema-attribute') + .default, + getResourceSpecificSiblingPath: + require('./get-resource-specific-sibling-path').default, + getResourceOrientedPaths: require('./get-resource-oriented-paths').default, + getResponseCodes: require('./get-response-codes').default, + getSchemaNameAtPath: require('./get-schema-name-at-path').default, isCreateOperation: require('./is-create-operation'), - isDeprecated: require('./is-deprecated'), - isEmptyObjectSchema: require('./is-empty-object-schema'), - isOperationOfType: require('./is-operation-of-type'), - isRefSiblingSchema: require('./is-ref-sibling-schema'), - isRequestBodyExploded: require('./is-requestbody-exploded'), - LoggerFactory: require('./logger-factory'), - mergeAllOfSchemaProperties: require('./merge-allof-schema-properties'), - nestedSchemaKeys: require('./nested-schema-keys'), - operationMethods: require('./constants'), - pathHasMinimallyRepresentedResource: require('./path-has-minimally-represented-resource'), - pathMatchesRegexp: require('./path-matches-regexp'), - ...require('./date-based-utils'), - ...require('./mimetype-utils'), - ...require('./pagination-utils'), - ...require('./path-location-utils'), + isDeprecated: require('./is-deprecated').default, + isEmptyObjectSchema: require('./is-empty-object-schema').default, + isOperationOfType: require('./is-operation-of-type').default, + isRefSiblingSchema: require('./is-ref-sibling-schema').default, + isRequestBodyExploded: require('./is-requestbody-exploded').default, + LoggerFactory: require('./logger-factory').default, + mergeAllOfSchemaProperties: require('./merge-allof-schema-properties') + .default, + nestedSchemaKeys: require('./nested-schema-keys').default, + operationMethods: require('./constants').default, + pathHasMinimallyRepresentedResource: + require('./path-has-minimally-represented-resource').default, + pathMatchesRegexp: require('./path-matches-regexp').default, + ...require('./date-based-utils').default, + ...require('./mimetype-utils').default, + ...require('./pagination-utils').default, + ...require('./path-location-utils').default, ...require('./schema-finding-utils'), }; diff --git a/packages/ruleset/src/utils/is-create-operation.js b/packages/ruleset/src/utils/is-create-operation.js index 84134d770..394197fe4 100644 --- a/packages/ruleset/src/utils/is-create-operation.js +++ b/packages/ruleset/src/utils/is-create-operation.js @@ -4,8 +4,9 @@ */ const { isObject } = require('@ibm-cloud/openapi-ruleset-utilities'); -const isOperationOfType = require('./is-operation-of-type'); -const getResourceSpecificSiblingPath = require('./get-resource-specific-sibling-path'); +const isOperationOfType = require('./is-operation-of-type').default; +const getResourceSpecificSiblingPath = + require('./get-resource-specific-sibling-path').default; /** * Returns `true` if the operation represents a "create" operation. diff --git a/packages/ruleset/src/utils/is-deprecated.js b/packages/ruleset/src/utils/is-deprecated.js index 33feb8b52..9a0c761f8 100644 --- a/packages/ruleset/src/utils/is-deprecated.js +++ b/packages/ruleset/src/utils/is-deprecated.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -const { isObject } = require('@ibm-cloud/openapi-ruleset-utilities'); +import { isObject } from '@ibm-cloud/openapi-ruleset-utilities'; /** * Returns `true` if the input is an object with deprecated=true. @@ -12,4 +12,4 @@ const isDeprecated = obj => { return isObject(obj) && obj.deprecated === true; }; -module.exports = isDeprecated; +export default isDeprecated; diff --git a/packages/ruleset/src/utils/is-empty-object-schema.js b/packages/ruleset/src/utils/is-empty-object-schema.js index ddc2ebea9..ffaadccc5 100644 --- a/packages/ruleset/src/utils/is-empty-object-schema.js +++ b/packages/ruleset/src/utils/is-empty-object-schema.js @@ -47,4 +47,4 @@ function isEmptyObjectSchema(schema) { return true; } -module.exports = isEmptyObjectSchema; +export default isEmptyObjectSchema; diff --git a/packages/ruleset/src/utils/is-operation-of-type.js b/packages/ruleset/src/utils/is-operation-of-type.js index 9d3419f2b..5b819f656 100644 --- a/packages/ruleset/src/utils/is-operation-of-type.js +++ b/packages/ruleset/src/utils/is-operation-of-type.js @@ -21,4 +21,4 @@ function isOperationOfType(type, path) { return type === path[path.length - 1].toString().trim().toLowerCase(); } -module.exports = isOperationOfType; +export default isOperationOfType; diff --git a/packages/ruleset/src/utils/is-ref-sibling-schema.js b/packages/ruleset/src/utils/is-ref-sibling-schema.js index ecf3aae76..41271542c 100644 --- a/packages/ruleset/src/utils/is-ref-sibling-schema.js +++ b/packages/ruleset/src/utils/is-ref-sibling-schema.js @@ -98,4 +98,4 @@ function containsOnlySupportedAttributes(schema) { return true; } -module.exports = isRefSiblingSchema; +export default isRefSiblingSchema; diff --git a/packages/ruleset/src/utils/is-requestbody-exploded.js b/packages/ruleset/src/utils/is-requestbody-exploded.js index 8378a6f85..3ab49c21a 100644 --- a/packages/ruleset/src/utils/is-requestbody-exploded.js +++ b/packages/ruleset/src/utils/is-requestbody-exploded.js @@ -1,5 +1,5 @@ -const { isArraySchema } = require('@ibm-cloud/openapi-ruleset-utilities'); -const { supportsJsonContent } = require('./mimetype-utils'); +import { isArraySchema } from '@ibm-cloud/openapi-ruleset-utilities'; +import { supportsJsonContent } from './mimetype-utils'; /** * Returns true iff the specified requestBody defines JSON content that will be exploded by @@ -89,4 +89,4 @@ function isSchemaAbstract(schema) { return false; } -module.exports = isRequestBodyExploded; +export default isRequestBodyExploded; diff --git a/packages/ruleset/src/utils/logger-factory.js b/packages/ruleset/src/utils/logger-factory.js index 0ea4c35d3..aec132dee 100644 --- a/packages/ruleset/src/utils/logger-factory.js +++ b/packages/ruleset/src/utils/logger-factory.js @@ -3,17 +3,17 @@ * SPDX-License-Identifier: Apache2.0 */ -const log = require('loglevel'); -const minimatch = require('minimatch'); -const prefix = require('loglevel-plugin-prefix'); -const chalk = require('chalk'); +import log from 'loglevel'; +import { minimatch as _minimatch } from 'minimatch'; +import { reg, apply } from 'loglevel-plugin-prefix'; +import { magenta, cyan, green, yellow, red } from 'chalk'; const colors = { - TRACE: chalk.magenta, - DEBUG: chalk.cyan, - INFO: chalk.green, - WARN: chalk.yellow, - ERROR: chalk.red, + TRACE: magenta, + DEBUG: cyan, + INFO: green, + WARN: yellow, + ERROR: red, }; /** @@ -21,15 +21,15 @@ const colors = { * The primary benefit provided by this factory class is the ability to honor logging-level-related * command-line options for loggers that haven't yet been created. */ -module.exports = class LoggerFactory { +export default class LoggerFactory { constructor() { this.rootLogger = log; this.loggerSettings = []; // Register the prefix handler with the loglevel. // This will control the [] message prefixes. - prefix.reg(log); - prefix.apply(log, { + reg(log); + apply(log, { levelFormatter(level) { return level.toUpperCase(); }, @@ -110,7 +110,7 @@ module.exports = class LoggerFactory { // If the name of the logger matches the (potential) glob-pattern // previously-specified via the command-line, then apply the // specified log level to that logger. - if (minimatch.minimatch(name, setting.loggerName)) { + if (_minimatch(name, setting.loggerName)) { logger.setLevel(setting.logLevel); } } @@ -127,7 +127,7 @@ module.exports = class LoggerFactory { this.applyLoggerSettings(key, this.rootLogger.getLogger(key)); } } -}; +} const validLevels = ['error', 'warn', 'info', 'debug', 'trace']; function checkLevel(logLevel) { diff --git a/packages/ruleset/src/utils/merge-allof-schema-properties.js b/packages/ruleset/src/utils/merge-allof-schema-properties.js index 063b1d883..06b2e09a0 100644 --- a/packages/ruleset/src/utils/merge-allof-schema-properties.js +++ b/packages/ruleset/src/utils/merge-allof-schema-properties.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -const { isObject, mergeWith } = require('lodash'); +import { isObject, mergeWith } from 'lodash'; // Takes a schema, and if an allOf field is provided, // merges all allOf schema properties to create one schema @@ -69,4 +69,4 @@ function customizer(targetValue, sourceValue) { : undefined; } -module.exports = mergeAllOfSchemaProperties; +export default mergeAllOfSchemaProperties; diff --git a/packages/ruleset/src/utils/mimetype-utils.js b/packages/ruleset/src/utils/mimetype-utils.js index c98acf726..ccd707f8b 100644 --- a/packages/ruleset/src/utils/mimetype-utils.js +++ b/packages/ruleset/src/utils/mimetype-utils.js @@ -82,7 +82,7 @@ function supportsJsonContent(m) { return isJsonMimeType(m) || isJsonPatchMimeType(m) || isMergePatchMimeType(m); } -module.exports = { +export default { isFormMimeType, isJsonMimeType, isJsonPatchMimeType, diff --git a/packages/ruleset/src/utils/nested-schema-keys.js b/packages/ruleset/src/utils/nested-schema-keys.js index 3ef61583f..72acc7a8f 100644 --- a/packages/ruleset/src/utils/nested-schema-keys.js +++ b/packages/ruleset/src/utils/nested-schema-keys.js @@ -13,4 +13,4 @@ const nestedSchemaKeys = [ 'not', ]; -module.exports = nestedSchemaKeys; +export default nestedSchemaKeys; diff --git a/packages/ruleset/src/utils/pagination-utils.js b/packages/ruleset/src/utils/pagination-utils.js index b6f747fc2..91eaf1305 100644 --- a/packages/ruleset/src/utils/pagination-utils.js +++ b/packages/ruleset/src/utils/pagination-utils.js @@ -2,9 +2,10 @@ * Copyright 2023 - 2024 IBM Corporation. * SPDX-License-Identifier: Apache2.0 */ -const { isArraySchema } = require('@ibm-cloud/openapi-ruleset-utilities'); -const mergeAllOfSchemaProperties = require('./merge-allof-schema-properties'); -const { isJsonMimeType } = require('./mimetype-utils'); +import { isArraySchema } from '@ibm-cloud/openapi-ruleset-utilities'; +import mergeAllOfSchemaProperties from './merge-allof-schema-properties'; +import mimetypeUtils from './mimetype-utils'; +const { isJsonMimeType } = mimetypeUtils; /** * Looks for a query parameter called "offset" and returns the @@ -192,7 +193,7 @@ function getPaginatedOperationFromPath(pathItem, path, logInfo) { return operation; } -module.exports = { +export default { getOffsetParamIndex, getPageTokenParamIndex, getSuccessCode, diff --git a/packages/ruleset/src/utils/path-has-minimally-represented-resource.js b/packages/ruleset/src/utils/path-has-minimally-represented-resource.js index 909d0077e..f7905799f 100644 --- a/packages/ruleset/src/utils/path-has-minimally-represented-resource.js +++ b/packages/ruleset/src/utils/path-has-minimally-represented-resource.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -const { isObject } = require('@ibm-cloud/openapi-ruleset-utilities'); +import { isObject } from '@ibm-cloud/openapi-ruleset-utilities'; /** * This function checks for a "minimally represented resource" (i.e. a resource @@ -38,4 +38,4 @@ function pathHasMinimallyRepresentedResource(path, apidef) { return false; } -module.exports = pathHasMinimallyRepresentedResource; +export default pathHasMinimallyRepresentedResource; diff --git a/packages/ruleset/src/utils/path-location-utils.js b/packages/ruleset/src/utils/path-location-utils.js index 95f5c9307..ea2bdb990 100644 --- a/packages/ruleset/src/utils/path-location-utils.js +++ b/packages/ruleset/src/utils/path-location-utils.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -const pathMatchesRegexp = require('./path-matches-regexp'); +import pathMatchesRegexp from './path-matches-regexp'; /** * Returns true if the path points to a schema object within @@ -109,7 +109,7 @@ function isSchemaProperty(path) { return matches; } -module.exports = { +export default { isParamContentSchema, isParamSchema, isPrimarySchema, diff --git a/packages/ruleset/src/utils/path-matches-regexp.js b/packages/ruleset/src/utils/path-matches-regexp.js index 2185e0774..75a966e3f 100644 --- a/packages/ruleset/src/utils/path-matches-regexp.js +++ b/packages/ruleset/src/utils/path-matches-regexp.js @@ -28,4 +28,4 @@ const pathMatchesRegexp = (path, regexp) => { return pathString.match(regexp) ? true : false; }; -module.exports = pathMatchesRegexp; +export default pathMatchesRegexp; diff --git a/packages/ruleset/src/utils/schema-finding-utils.js b/packages/ruleset/src/utils/schema-finding-utils.js index 5d4e99124..a0a47247c 100644 --- a/packages/ruleset/src/utils/schema-finding-utils.js +++ b/packages/ruleset/src/utils/schema-finding-utils.js @@ -4,15 +4,12 @@ */ const { isObject } = require('@ibm-cloud/openapi-ruleset-utilities'); -const getResponseCodes = require('./get-response-codes'); +const getResponseCodes = require('./get-response-codes').default; -const { - isJsonMimeType, - isJsonPatchMimeType, - isMergePatchMimeType, -} = require('./mimetype-utils'); +const { isJsonMimeType, isJsonPatchMimeType, isMergePatchMimeType } = + require('./mimetype-utils').default; -const getSchemaNameAtPath = require('./get-schema-name-at-path'); +const getSchemaNameAtPath = require('./get-schema-name-at-path').default; /** * Takes an operation object/path combo and finds the JSON success diff --git a/packages/ruleset/test/rules/no-operation-requestbody.test.js b/packages/ruleset/test/rules/no-operation-requestbody.test.js index c911ae24a..78a9b0ca5 100644 --- a/packages/ruleset/test/rules/no-operation-requestbody.test.js +++ b/packages/ruleset/test/rules/no-operation-requestbody.test.js @@ -13,7 +13,11 @@ const expectedMsg = 'operations should not define a requestBody'; describe(`Spectral rule: ${ruleId}`, () => { describe('Should not yield errors', () => { it('Clean spec', async () => { - const results = await testRule(ruleId, noOperationRequestBody, rootDocument); + const results = await testRule( + ruleId, + noOperationRequestBody, + rootDocument + ); expect(results).toHaveLength(0); }); @@ -79,7 +83,11 @@ describe(`Spectral rule: ${ruleId}`, () => { }, }, }; - const results = await testRule(ruleId, noOperationRequestBody, testDocument); + const results = await testRule( + ruleId, + noOperationRequestBody, + testDocument + ); expect(results).toHaveLength(1); expect(results[0].code).toBe(ruleId); expect(results[0].message).toBe(`DELETE ${expectedMsg}`); @@ -114,7 +122,11 @@ describe(`Spectral rule: ${ruleId}`, () => { }, }, }; - const results = await testRule(ruleId, noOperationRequestBody, testDocument); + const results = await testRule( + ruleId, + noOperationRequestBody, + testDocument + ); expect(results).toHaveLength(1); expect(results[0].code).toBe(ruleId); expect(results[0].message).toBe(`GET ${expectedMsg}`); @@ -149,7 +161,11 @@ describe(`Spectral rule: ${ruleId}`, () => { }, }, }; - const results = await testRule(ruleId, noOperationRequestBody, testDocument); + const results = await testRule( + ruleId, + noOperationRequestBody, + testDocument + ); expect(results).toHaveLength(1); expect(results[0].code).toBe(ruleId); expect(results[0].message).toBe(`HEAD ${expectedMsg}`); @@ -184,7 +200,11 @@ describe(`Spectral rule: ${ruleId}`, () => { }, }, }; - const results = await testRule(ruleId, noOperationRequestBody, testDocument); + const results = await testRule( + ruleId, + noOperationRequestBody, + testDocument + ); expect(results).toHaveLength(1); expect(results[0].code).toBe(ruleId); expect(results[0].message).toBe(`OPTIONS ${expectedMsg}`); diff --git a/packages/ruleset/test/utils/pagination-utils.test.js b/packages/ruleset/test/utils/pagination-utils.test.js index 16702beb1..416db365b 100644 --- a/packages/ruleset/test/utils/pagination-utils.test.js +++ b/packages/ruleset/test/utils/pagination-utils.test.js @@ -4,7 +4,13 @@ */ import { vi } from 'vitest'; -import { getOffsetParamIndex, getPageTokenParamIndex, getSuccessCode, getResponseSchema, getPaginatedOperationFromPath } from '../../src/utils'; +import { + getOffsetParamIndex, + getPageTokenParamIndex, + getSuccessCode, + getResponseSchema, + getPaginatedOperationFromPath, +} from '../../src/utils'; describe('Pagination utility functions', () => { describe('getOffsetParamIndex()', () => { diff --git a/packages/ruleset/test/utils/schema-finding-utils.test.js b/packages/ruleset/test/utils/schema-finding-utils.test.js index 88c898a6d..4e10bccad 100644 --- a/packages/ruleset/test/utils/schema-finding-utils.test.js +++ b/packages/ruleset/test/utils/schema-finding-utils.test.js @@ -4,7 +4,11 @@ */ import { vi } from 'vitest'; -import { getSuccessResponseSchemaForOperation, getRequestBodySchemaForOperation, getCanonicalSchemaForPath } from '../../src/utils'; +import { + getSuccessResponseSchemaForOperation, + getRequestBodySchemaForOperation, + getCanonicalSchemaForPath, +} from '../../src/utils'; describe('Schema finding utility functions', () => { describe('getSuccessResponseSchemaForOperation()', () => { diff --git a/packages/validator/test/cli-validator/tests/configuration-manager.test.js b/packages/validator/test/cli-validator/tests/configuration-manager.test.js index 039d3e3a2..f1ba079cb 100644 --- a/packages/validator/test/cli-validator/tests/configuration-manager.test.js +++ b/packages/validator/test/cli-validator/tests/configuration-manager.test.js @@ -4,7 +4,11 @@ */ import { getCapturedText } from '../../test-utils'; -import { getDefaultConfig, loadConfig, processArgs } from '../../../src/cli-validator/utils'; +import { + getDefaultConfig, + loadConfig, + processArgs, +} from '../../../src/cli-validator/utils'; import { vi } from 'vitest'; // Use these parse options since we're not actually retrieving process args. diff --git a/packages/validator/test/cli-validator/tests/option-handling.test.js b/packages/validator/test/cli-validator/tests/option-handling.test.js index 959b38872..97c184812 100644 --- a/packages/validator/test/cli-validator/tests/option-handling.test.js +++ b/packages/validator/test/cli-validator/tests/option-handling.test.js @@ -5,9 +5,19 @@ import { existsSync, unlinkSync } from 'fs'; -import { extractValuesFromTable, getCapturedText, getCapturedTextWithColor, stripAnsi, testValidator } from '../../test-utils'; - -import { getCopyrightString, readYaml, validateSchema } from '../../../src/cli-validator/utils'; +import { + extractValuesFromTable, + getCapturedText, + getCapturedTextWithColor, + stripAnsi, + testValidator, +} from '../../test-utils'; + +import { + getCopyrightString, + readYaml, + validateSchema, +} from '../../../src/cli-validator/utils'; import { vi } from 'vitest'; describe('cli tool - test option handling', function () { diff --git a/packages/validator/test/scoring-tool/output.test.js b/packages/validator/test/scoring-tool/output.test.js index c3fcaba15..173f1c2e8 100644 --- a/packages/validator/test/scoring-tool/output.test.js +++ b/packages/validator/test/scoring-tool/output.test.js @@ -4,7 +4,10 @@ */ import { extractValuesFromTable } from '../test-utils'; -import { printCategorizedScoresTable, printScoringDataTable } from '../../src/scoring-tool/output'; +import { + printCategorizedScoresTable, + printScoringDataTable, +} from '../../src/scoring-tool/output'; import { vi } from 'vitest'; describe('scoring-tool output tests', function () { diff --git a/packages/validator/test/scoring-tool/score.test.js b/packages/validator/test/scoring-tool/score.test.js index 5d6e663ad..ae72015fc 100644 --- a/packages/validator/test/scoring-tool/score.test.js +++ b/packages/validator/test/scoring-tool/score.test.js @@ -3,7 +3,14 @@ * SPDX-License-Identifier: Apache2.0 */ -import { scoreResults, compute, computeCategorizedScores, getFunc, tally, computeOverallScore } from '../../src/scoring-tool/score'; +import { + scoreResults, + compute, + computeCategorizedScores, + getFunc, + tally, + computeOverallScore, +} from '../../src/scoring-tool/score'; import { Metrics } from '../../src/scoring-tool/metrics'; import { vi } from 'vitest'; diff --git a/scripts/generate-utilities-docs.js b/scripts/generate-utilities-docs.js index b6efab259..508573b8f 100755 --- a/scripts/generate-utilities-docs.js +++ b/scripts/generate-utilities-docs.js @@ -17,7 +17,7 @@ const raw = JSON.parse( const docs = raw.filter(d => d.comment !== '' && d.access !== 'private'); -const package = docs.find(d => d.kind === 'module'); +const packageDoc = docs.find(d => d.kind === 'module'); const constants = docs .filter(d => d.kind === 'constant') @@ -50,6 +50,10 @@ const functions = docs })), })); -const rendered = mustache.render(template, { package, constants, functions }); +const rendered = mustache.render(template, { + package: packageDoc, + constants, + functions, +}); writeFileSync('docs/openapi-ruleset-utilities.md', rendered); From 64d718e0629018778a862453ec2c866709562f59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=ADdia=20Tarcza?= <100163235+diatrcz@users.noreply.github.com> Date: Thu, 11 Jun 2026 12:33:28 +0200 Subject: [PATCH 06/16] build: esm config utilities MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Lídia Tarcza <100163235+diatrcz@users.noreply.github.com> --- packages/utilities/src/collections/index.js | 2 +- packages/utilities/src/index.js | 6 ++--- .../utils/collect-from-composed-schemas.js | 2 +- .../src/utils/get-examples-for-schema.js | 3 ++- .../utils/get-property-names-for-schema.js | 5 ++-- .../utilities/src/utils/get-schema-type.js | 6 ++--- packages/utilities/src/utils/index.js | 26 ++++++++++--------- packages/utilities/src/utils/is-object.js | 2 +- .../src/utils/schema-has-constraint.js | 4 +-- .../src/utils/schema-has-property.js | 6 ++--- .../utils/schema-loosely-has-constraint.js | 4 +-- packages/utilities/src/utils/schema-path.js | 2 +- .../src/utils/schema-requires-property.js | 6 ++--- .../src/utils/spectral-context-utils.js | 2 +- .../src/utils/validate-composed-schemas.js | 4 +-- .../src/utils/validate-nested-schemas.js | 6 ++--- .../src/utils/validate-subschemas.js | 8 +++--- 17 files changed, 49 insertions(+), 45 deletions(-) diff --git a/packages/utilities/src/collections/index.js b/packages/utilities/src/collections/index.js index d43b7f7d0..dcd5ae5d5 100644 --- a/packages/utilities/src/collections/index.js +++ b/packages/utilities/src/collections/index.js @@ -108,4 +108,4 @@ const collections = { ], }; -module.exports = collections; +export default collections; diff --git a/packages/utilities/src/index.js b/packages/utilities/src/index.js index 5456386b6..b89e8c709 100644 --- a/packages/utilities/src/index.js +++ b/packages/utilities/src/index.js @@ -8,10 +8,10 @@ * in the context of a Spectral ruleset. * @module @ibm-cloud/openapi-ruleset-utilities */ -module.exports = { - ...require('./utils'), +export default { + ...require('./utils').default, collections: { - ...require('./collections'), + ...require('./collections').default, }, }; diff --git a/packages/utilities/src/utils/collect-from-composed-schemas.js b/packages/utilities/src/utils/collect-from-composed-schemas.js index e9196ba69..9ba8b8f7c 100644 --- a/packages/utilities/src/utils/collect-from-composed-schemas.js +++ b/packages/utilities/src/utils/collect-from-composed-schemas.js @@ -53,4 +53,4 @@ function collectFromComposedSchemas( return [...new Set(items)]; // de-duplicate } -module.exports = collectFromComposedSchemas; +export default collectFromComposedSchemas; diff --git a/packages/utilities/src/utils/get-examples-for-schema.js b/packages/utilities/src/utils/get-examples-for-schema.js index bff150005..e48cfb43b 100644 --- a/packages/utilities/src/utils/get-examples-for-schema.js +++ b/packages/utilities/src/utils/get-examples-for-schema.js @@ -6,7 +6,8 @@ /** * @private */ -const collectFromComposedSchemas = require('./collect-from-composed-schemas'); +const collectFromComposedSchemas = + require('./collect-from-composed-schemas').default; /** * Returns an array of examples for a simple or composite schema. For each composed schema, if diff --git a/packages/utilities/src/utils/get-property-names-for-schema.js b/packages/utilities/src/utils/get-property-names-for-schema.js index 9d3d2cc2e..92c958b5c 100644 --- a/packages/utilities/src/utils/get-property-names-for-schema.js +++ b/packages/utilities/src/utils/get-property-names-for-schema.js @@ -6,11 +6,12 @@ /** * @private */ -const isObject = require('./is-object'); +const isObject = require('./is-object').default; /** * @private */ -const collectFromComposedSchemas = require('./collect-from-composed-schemas'); +const collectFromComposedSchemas = + require('./collect-from-composed-schemas').default; /** * Returns an array of property names for a simple or composite schema, diff --git a/packages/utilities/src/utils/get-schema-type.js b/packages/utilities/src/utils/get-schema-type.js index 33bd8b092..a19a08f08 100644 --- a/packages/utilities/src/utils/get-schema-type.js +++ b/packages/utilities/src/utils/get-schema-type.js @@ -6,11 +6,11 @@ /** * @private */ -const isObject = require('./is-object'); +import isObject from './is-object'; /** * @private */ -const schemaHasConstraint = require('./schema-has-constraint'); +import schemaHasConstraint from './schema-has-constraint'; /** * An enumeration of non-mutually-exclusive schema types. @@ -367,7 +367,7 @@ function isPrimitiveSchema(schema) { ); } -module.exports = { +export default { SchemaType, getSchemaType, isArraySchema, diff --git a/packages/utilities/src/utils/index.js b/packages/utilities/src/utils/index.js index df39fd41e..49c4c17f0 100644 --- a/packages/utilities/src/utils/index.js +++ b/packages/utilities/src/utils/index.js @@ -3,18 +3,20 @@ * SPDX-License-Identifier: Apache2.0 */ -module.exports = { - collectFromComposedSchemas: require('./collect-from-composed-schemas'), +export default { + collectFromComposedSchemas: require('./collect-from-composed-schemas') + .default, getExamplesForSchema: require('./get-examples-for-schema'), getPropertyNamesForSchema: require('./get-property-names-for-schema'), - ...require('./get-schema-type'), - isObject: require('./is-object'), - schemaHasConstraint: require('./schema-has-constraint'), - schemaHasProperty: require('./schema-has-property'), - schemaLooselyHasConstraint: require('./schema-loosely-has-constraint'), - schemaRequiresProperty: require('./schema-requires-property'), - ...require('./spectral-context-utils'), - validateComposedSchemas: require('./validate-composed-schemas'), - validateNestedSchemas: require('./validate-nested-schemas'), - validateSubschemas: require('./validate-subschemas'), + ...require('./get-schema-type').default, + isObject: require('./is-object').default, + schemaHasConstraint: require('./schema-has-constraint').default, + schemaHasProperty: require('./schema-has-property').default, + schemaLooselyHasConstraint: require('./schema-loosely-has-constraint') + .default, + schemaRequiresProperty: require('./schema-requires-property').default, + ...require('./spectral-context-utils').default, + validateComposedSchemas: require('./validate-composed-schemas').default, + validateNestedSchemas: require('./validate-nested-schemas').default, + validateSubschemas: require('./validate-subschemas').default, }; diff --git a/packages/utilities/src/utils/is-object.js b/packages/utilities/src/utils/is-object.js index ad30b784f..48d32dfc0 100644 --- a/packages/utilities/src/utils/is-object.js +++ b/packages/utilities/src/utils/is-object.js @@ -12,4 +12,4 @@ function isObject(thing) { return typeof thing === 'object' && thing !== null && !Array.isArray(thing); } -module.exports = isObject; +export default isObject; diff --git a/packages/utilities/src/utils/schema-has-constraint.js b/packages/utilities/src/utils/schema-has-constraint.js index 0e2f423e9..b148167ec 100644 --- a/packages/utilities/src/utils/schema-has-constraint.js +++ b/packages/utilities/src/utils/schema-has-constraint.js @@ -6,7 +6,7 @@ /** * @private */ -const isObject = require('./is-object'); +import isObject from './is-object'; /** * This function will return `true` if all possible variations of a (possibly composite) schema @@ -67,4 +67,4 @@ function schemaHasConstraint(schema, hasConstraint) { return false; } -module.exports = schemaHasConstraint; +export default schemaHasConstraint; diff --git a/packages/utilities/src/utils/schema-has-property.js b/packages/utilities/src/utils/schema-has-property.js index 7ca957aa8..894b8c163 100644 --- a/packages/utilities/src/utils/schema-has-property.js +++ b/packages/utilities/src/utils/schema-has-property.js @@ -6,11 +6,11 @@ /** * @private */ -const schemaHasConstraint = require('./schema-has-constraint'); +import schemaHasConstraint from './schema-has-constraint'; /** * @private */ -const isObject = require('./is-object'); +import isObject from './is-object'; /** * This function will return `true` if all possible variations of a (possibly composite) schema @@ -26,4 +26,4 @@ function schemaHasProperty(schema, propertyName) { ); } -module.exports = schemaHasProperty; +export default schemaHasProperty; diff --git a/packages/utilities/src/utils/schema-loosely-has-constraint.js b/packages/utilities/src/utils/schema-loosely-has-constraint.js index 2bea99cac..87326296e 100644 --- a/packages/utilities/src/utils/schema-loosely-has-constraint.js +++ b/packages/utilities/src/utils/schema-loosely-has-constraint.js @@ -6,7 +6,7 @@ /** * @private */ -const isObject = require('./is-object'); +import isObject from './is-object'; /** * This function is a looser adaptation of the `schemaHasConstraint()` function. @@ -48,4 +48,4 @@ function schemaLooselyHasConstraint(schema, hasConstraint) { return false; } -module.exports = schemaLooselyHasConstraint; +export default schemaLooselyHasConstraint; diff --git a/packages/utilities/src/utils/schema-path.js b/packages/utilities/src/utils/schema-path.js index 509be4e13..23875d8ad 100644 --- a/packages/utilities/src/utils/schema-path.js +++ b/packages/utilities/src/utils/schema-path.js @@ -47,4 +47,4 @@ class SchemaPath extends Array { } } -module.exports = SchemaPath; +export default SchemaPath; diff --git a/packages/utilities/src/utils/schema-requires-property.js b/packages/utilities/src/utils/schema-requires-property.js index 22bd4f3b1..53af88f1d 100644 --- a/packages/utilities/src/utils/schema-requires-property.js +++ b/packages/utilities/src/utils/schema-requires-property.js @@ -6,11 +6,11 @@ /** * @private */ -const schemaHasConstraint = require('./schema-has-constraint'); +import schemaHasConstraint from './schema-has-constraint'; /** * @private */ -const schemaHasProperty = require('./schema-has-property'); +import schemaHasProperty from './schema-has-property'; /** * This function will return `true` if all possible variations of a (possibly composite) schema @@ -29,4 +29,4 @@ function schemaRequiresProperty(schema, propertyName) { ); } -module.exports = schemaRequiresProperty; +export default schemaRequiresProperty; diff --git a/packages/utilities/src/utils/spectral-context-utils.js b/packages/utilities/src/utils/spectral-context-utils.js index 89be8297a..0e455526d 100644 --- a/packages/utilities/src/utils/spectral-context-utils.js +++ b/packages/utilities/src/utils/spectral-context-utils.js @@ -33,7 +33,7 @@ function getNodes(context) { return context.documentInventory.graph.nodes; } -module.exports = { +export default { getNodes, getResolvedSpec, getUnresolvedSpec, diff --git a/packages/utilities/src/utils/validate-composed-schemas.js b/packages/utilities/src/utils/validate-composed-schemas.js index 10aaa3cbe..b12824f0e 100644 --- a/packages/utilities/src/utils/validate-composed-schemas.js +++ b/packages/utilities/src/utils/validate-composed-schemas.js @@ -6,7 +6,7 @@ /** * @private */ -const SchemaPath = require('./schema-path'); +import SchemaPath from './schema-path'; /** * Performs validation on a schema and all of its composed schemas. @@ -92,4 +92,4 @@ function validateComposedSchemas( return errors; } -module.exports = validateComposedSchemas; +export default validateComposedSchemas; diff --git a/packages/utilities/src/utils/validate-nested-schemas.js b/packages/utilities/src/utils/validate-nested-schemas.js index 1d738a73d..f66614b80 100644 --- a/packages/utilities/src/utils/validate-nested-schemas.js +++ b/packages/utilities/src/utils/validate-nested-schemas.js @@ -6,11 +6,11 @@ /** * @private */ -const isObject = require('./is-object'); +import isObject from './is-object'; /** * @private */ -const SchemaPath = require('./schema-path'); +import SchemaPath from './schema-path'; /** * Performs validation on a schema and all of its nested schemas. @@ -172,4 +172,4 @@ function validateNestedSchemas( return errors; } -module.exports = validateNestedSchemas; +export default validateNestedSchemas; diff --git a/packages/utilities/src/utils/validate-subschemas.js b/packages/utilities/src/utils/validate-subschemas.js index 4cfd172e4..1c31ee2b2 100644 --- a/packages/utilities/src/utils/validate-subschemas.js +++ b/packages/utilities/src/utils/validate-subschemas.js @@ -6,15 +6,15 @@ /** * @private */ -const SchemaPath = require('./schema-path'); +import SchemaPath from './schema-path'; /** * @private */ -const validateComposedSchemas = require('./validate-composed-schemas'); +import validateComposedSchemas from './validate-composed-schemas'; /** * @private */ -const validateNestedSchemas = require('./validate-nested-schemas'); +import validateNestedSchemas from './validate-nested-schemas'; /** * Performs validation on a schema and all of its subschemas. @@ -84,4 +84,4 @@ function validateSubschemas( ); } -module.exports = validateSubschemas; +export default validateSubschemas; From 3a3241a0f7eca73fc934410b38fbe7964c0f6117 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=ADdia=20Tarcza?= <100163235+diatrcz@users.noreply.github.com> Date: Thu, 11 Jun 2026 12:36:09 +0200 Subject: [PATCH 07/16] build: update utilities MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Lídia Tarcza <100163235+diatrcz@users.noreply.github.com> --- .../utilities/types/collections/index.d.ts | 30 +++++---- .../types/collections/index.d.ts.map | 2 +- packages/utilities/types/index.d.ts | 64 +++++++++---------- .../utils/collect-from-composed-schemas.d.ts | 2 +- .../utils/get-examples-for-schema.d.ts.map | 2 +- .../get-property-names-for-schema.d.ts.map | 2 +- .../types/utils/get-schema-type.d.ts | 60 +++++++++++------ .../types/utils/get-schema-type.d.ts.map | 2 +- packages/utilities/types/utils/index.d.ts | 64 +++++++++---------- packages/utilities/types/utils/is-object.d.ts | 2 +- .../types/utils/schema-has-constraint.d.ts | 2 +- .../types/utils/schema-has-property.d.ts | 2 +- .../utils/schema-loosely-has-constraint.d.ts | 2 +- .../utilities/types/utils/schema-path.d.ts | 6 +- .../types/utils/schema-path.d.ts.map | 2 +- .../types/utils/schema-requires-property.d.ts | 2 +- .../types/utils/spectral-context-utils.d.ts | 12 +++- .../utils/spectral-context-utils.d.ts.map | 2 +- .../utils/validate-composed-schemas.d.ts | 2 +- .../types/utils/validate-nested-schemas.d.ts | 2 +- .../types/utils/validate-subschemas.d.ts | 2 +- scripts/generate-utilities-docs.js | 6 +- 22 files changed, 156 insertions(+), 116 deletions(-) diff --git a/packages/utilities/types/collections/index.d.ts b/packages/utilities/types/collections/index.d.ts index ae6041556..0f779bd6f 100644 --- a/packages/utilities/types/collections/index.d.ts +++ b/packages/utilities/types/collections/index.d.ts @@ -1,16 +1,24 @@ +export default collections; +declare namespace collections { + export { operations }; + export let parameters: string[]; + export let patchOperations: string[]; + export let paths: string[]; + export { requestBodySchemas }; + export { responseSchemas }; + export let schemas: string[]; + export let securitySchemes: string[]; + export { unresolvedRequestBodySchemas }; + export { unresolvedResponseSchemas }; + export let unresolvedSchemas: string[]; +} /** * Copyright 2017 - 2024 IBM Corporation. * SPDX-License-Identifier: Apache2.0 */ -export const operations: string[]; -export const requestBodySchemas: string[]; -export const responseSchemas: string[]; -export const unresolvedRequestBodySchemas: string[]; -export const unresolvedResponseSchemas: string[]; -export declare let parameters: string[]; -export declare let patchOperations: string[]; -export declare let paths: string[]; -export declare let schemas: string[]; -export declare let securitySchemes: string[]; -export declare let unresolvedSchemas: string[]; +declare const operations: string[]; +declare const requestBodySchemas: string[]; +declare const responseSchemas: string[]; +declare const unresolvedRequestBodySchemas: string[]; +declare const unresolvedResponseSchemas: string[]; //# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/packages/utilities/types/collections/index.d.ts.map b/packages/utilities/types/collections/index.d.ts.map index d164dcbef..0d741a39e 100644 --- a/packages/utilities/types/collections/index.d.ts.map +++ b/packages/utilities/types/collections/index.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/collections/index.js"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,kCAAgF;AAEhF,0CAA+E;AAE/E,uCAA6E;AAE7E,oDAGE;AAEF,iDAGE"} \ No newline at end of file +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/collections/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA;;;GAGG;AAGH,mCAAgF;AAEhF,2CAA+E;AAE/E,wCAA6E;AAE7E,qDAGE;AAEF,kDAGE"} \ No newline at end of file diff --git a/packages/utilities/types/index.d.ts b/packages/utilities/types/index.d.ts index 8de50e261..93d4acc02 100644 --- a/packages/utilities/types/index.d.ts +++ b/packages/utilities/types/index.d.ts @@ -1,4 +1,4 @@ -declare const _exports: { +declare const _default: { collections: { operations: string[]; parameters: string[]; @@ -12,17 +12,17 @@ declare const _exports: { unresolvedResponseSchemas: string[]; unresolvedSchemas: string[]; }; - validateComposedSchemas: typeof import("./utils/validate-composed-schemas"); - validateNestedSchemas: typeof import("./utils/validate-nested-schemas"); - validateSubschemas: typeof import("./utils/validate-subschemas"); - getNodes: typeof import("./utils/spectral-context-utils").getNodes; - getResolvedSpec: typeof import("./utils/spectral-context-utils").getResolvedSpec; - getUnresolvedSpec: typeof import("./utils/spectral-context-utils").getUnresolvedSpec; - isObject: typeof import("./utils/is-object"); - schemaHasConstraint: typeof import("./utils/schema-has-constraint"); - schemaHasProperty: typeof import("./utils/schema-has-property"); - schemaLooselyHasConstraint: typeof import("./utils/schema-loosely-has-constraint"); - schemaRequiresProperty: typeof import("./utils/schema-requires-property"); + validateComposedSchemas: typeof import("./utils/validate-composed-schemas").default; + validateNestedSchemas: typeof import("./utils/validate-nested-schemas").default; + validateSubschemas: typeof import("./utils/validate-subschemas").default; + getNodes: (context: object) => object; + getResolvedSpec: (context: object) => object; + getUnresolvedSpec: (context: object) => object; + isObject: typeof import("./utils/is-object").default; + schemaHasConstraint: typeof import("./utils/schema-has-constraint").default; + schemaHasProperty: typeof import("./utils/schema-has-property").default; + schemaLooselyHasConstraint: typeof import("./utils/schema-loosely-has-constraint").default; + schemaRequiresProperty: typeof import("./utils/schema-requires-property").default; SchemaType: { ARRAY: symbol; BINARY: symbol; @@ -41,27 +41,27 @@ declare const _exports: { STRING: symbol; UNKNOWN: symbol; }; - getSchemaType: typeof import("./utils/get-schema-type").getSchemaType; - isArraySchema: typeof import("./utils/get-schema-type").isArraySchema; - isBinarySchema: typeof import("./utils/get-schema-type").isBinarySchema; - isBooleanSchema: typeof import("./utils/get-schema-type").isBooleanSchema; - isByteSchema: typeof import("./utils/get-schema-type").isByteSchema; - isDateSchema: typeof import("./utils/get-schema-type").isDateSchema; - isDateTimeSchema: typeof import("./utils/get-schema-type").isDateTimeSchema; - isDoubleSchema: typeof import("./utils/get-schema-type").isDoubleSchema; - isEnumerationSchema: typeof import("./utils/get-schema-type").isEnumerationSchema; - isFloatSchema: typeof import("./utils/get-schema-type").isFloatSchema; - isInt32Schema: typeof import("./utils/get-schema-type").isInt32Schema; - isInt64Schema: typeof import("./utils/get-schema-type").isInt64Schema; - isIntegerSchema: typeof import("./utils/get-schema-type").isIntegerSchema; - isNumberSchema: typeof import("./utils/get-schema-type").isNumberSchema; - isObjectSchema: typeof import("./utils/get-schema-type").isObjectSchema; - isPrimitiveSchema: typeof import("./utils/get-schema-type").isPrimitiveSchema; - isStringSchema: typeof import("./utils/get-schema-type").isStringSchema; - schemaIsOfType: typeof import("./utils/get-schema-type").schemaIsOfType; - collectFromComposedSchemas: typeof import("./utils/collect-from-composed-schemas"); + getSchemaType: (schema: object) => symbol; + isArraySchema: (schema: object) => boolean; + isBinarySchema: (schema: object) => boolean; + isBooleanSchema: (schema: object) => boolean; + isByteSchema: (schema: object) => boolean; + isDateSchema: (schema: object) => boolean; + isDateTimeSchema: (schema: object) => boolean; + isDoubleSchema: (schema: object) => boolean; + isEnumerationSchema: (schema: object) => boolean; + isFloatSchema: (schema: object) => boolean; + isInt32Schema: (schema: object) => boolean; + isInt64Schema: (schema: object) => boolean; + isIntegerSchema: (schema: object) => boolean; + isNumberSchema: (schema: object) => boolean; + isObjectSchema: (schema: object) => boolean; + isPrimitiveSchema: (schema: object) => boolean; + isStringSchema: (schema: object) => boolean; + schemaIsOfType: (schema: object, type: string) => boolean; + collectFromComposedSchemas: typeof import("./utils/collect-from-composed-schemas").default; getExamplesForSchema: typeof import("./utils/get-examples-for-schema"); getPropertyNamesForSchema: typeof import("./utils/get-property-names-for-schema"); }; -export = _exports; +export default _default; //# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/packages/utilities/types/utils/collect-from-composed-schemas.d.ts b/packages/utilities/types/utils/collect-from-composed-schemas.d.ts index a24d340d3..515029af6 100644 --- a/packages/utilities/types/utils/collect-from-composed-schemas.d.ts +++ b/packages/utilities/types/utils/collect-from-composed-schemas.d.ts @@ -1,4 +1,4 @@ -export = collectFromComposedSchemas; +export default collectFromComposedSchemas; /** * Copyright 2024 IBM Corporation. * SPDX-License-Identifier: Apache2.0 diff --git a/packages/utilities/types/utils/get-examples-for-schema.d.ts.map b/packages/utilities/types/utils/get-examples-for-schema.d.ts.map index 5cc55ef1b..ff16e1c13 100644 --- a/packages/utilities/types/utils/get-examples-for-schema.d.ts.map +++ b/packages/utilities/types/utils/get-examples-for-schema.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"get-examples-for-schema.d.ts","sourceRoot":"","sources":["../../src/utils/get-examples-for-schema.js"],"names":[],"mappings":";AAUA;;;;;GAKG;AACH,8CAHW,MAAM,SAahB"} \ No newline at end of file +{"version":3,"file":"get-examples-for-schema.d.ts","sourceRoot":"","sources":["../../src/utils/get-examples-for-schema.js"],"names":[],"mappings":";AAWA;;;;;GAKG;AACH,8CAHW,MAAM,SAahB"} \ No newline at end of file diff --git a/packages/utilities/types/utils/get-property-names-for-schema.d.ts.map b/packages/utilities/types/utils/get-property-names-for-schema.d.ts.map index 71d6b26d2..d26c57aeb 100644 --- a/packages/utilities/types/utils/get-property-names-for-schema.d.ts.map +++ b/packages/utilities/types/utils/get-property-names-for-schema.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"get-property-names-for-schema.d.ts","sourceRoot":"","sources":["../../src/utils/get-property-names-for-schema.js"],"names":[],"mappings":";AAcA;;;;;;GAMG;AACH,mDAJW,MAAM,oCAkBhB"} \ No newline at end of file +{"version":3,"file":"get-property-names-for-schema.d.ts","sourceRoot":"","sources":["../../src/utils/get-property-names-for-schema.js"],"names":[],"mappings":";AAeA;;;;;;GAMG;AACH,mDAJW,MAAM,oCAkBhB"} \ No newline at end of file diff --git a/packages/utilities/types/utils/get-schema-type.d.ts b/packages/utilities/types/utils/get-schema-type.d.ts index 48b4286ac..0fb5d9723 100644 --- a/packages/utilities/types/utils/get-schema-type.d.ts +++ b/packages/utilities/types/utils/get-schema-type.d.ts @@ -1,4 +1,26 @@ -export namespace SchemaType { +declare namespace _default { + export { SchemaType }; + export { getSchemaType }; + export { isArraySchema }; + export { isBinarySchema }; + export { isBooleanSchema }; + export { isByteSchema }; + export { isDateSchema }; + export { isDateTimeSchema }; + export { isDoubleSchema }; + export { isEnumerationSchema }; + export { isFloatSchema }; + export { isInt32Schema }; + export { isInt64Schema }; + export { isIntegerSchema }; + export { isNumberSchema }; + export { isObjectSchema }; + export { isPrimitiveSchema }; + export { isStringSchema }; + export { schemaIsOfType }; +} +export default _default; +declare namespace SchemaType { let ARRAY: symbol; let BINARY: symbol; let BOOLEAN: symbol; @@ -28,103 +50,103 @@ export namespace SchemaType { * @param {object} schema simple or composite OpenAPI 3.x schema object * @returns {symbol} a symbol from `SchemaType` */ -export function getSchemaType(schema: object): symbol; +declare function getSchemaType(schema: object): symbol; /** * Returns `true` for an array schema. * @param {object} schema simple or composite OpenAPI 3.x schema object * @returns {boolean} */ -export function isArraySchema(schema: object): boolean; +declare function isArraySchema(schema: object): boolean; /** * Returns `true` for an arbitrary octet sequence binary schema. * @param {object} schema simple or composite OpenAPI 3.x schema object * @returns {boolean} */ -export function isBinarySchema(schema: object): boolean; +declare function isBinarySchema(schema: object): boolean; /** * Returns `true` for a boolean schema. * @param {object} schema simple or composite OpenAPI 3.x schema object * @returns {boolean} */ -export function isBooleanSchema(schema: object): boolean; +declare function isBooleanSchema(schema: object): boolean; /** * Returns `true` for a base64-encoded byte string schema. * @param {object} schema simple or composite OpenAPI 3.x schema object * @returns {boolean} */ -export function isByteSchema(schema: object): boolean; +declare function isByteSchema(schema: object): boolean; /** * Returns `true` for a date schema. * @param {object} schema simple or composite OpenAPI 3.x schema object * @returns {boolean} */ -export function isDateSchema(schema: object): boolean; +declare function isDateSchema(schema: object): boolean; /** * Returns `true` for a date-time schema. * @param {object} schema simple or composite OpenAPI 3.x schema object * @returns {boolean} */ -export function isDateTimeSchema(schema: object): boolean; +declare function isDateTimeSchema(schema: object): boolean; /** * Returns `true` for a double (IEEE 754 64-bit floating point value) schema. * @param {object} schema simple or composite OpenAPI 3.x schema object * @returns {boolean} */ -export function isDoubleSchema(schema: object): boolean; +declare function isDoubleSchema(schema: object): boolean; /** * Returns `true` for a string enumeration schema. * @param {object} schema simple or composite OpenAPI 3.x schema object * @returns {boolean} */ -export function isEnumerationSchema(schema: object): boolean; +declare function isEnumerationSchema(schema: object): boolean; /** * Returns `true` for a double (IEEE 754 32-bit floating point value) schema. * @param {object} schema simple or composite OpenAPI 3.x schema object * @returns {boolean} */ -export function isFloatSchema(schema: object): boolean; +declare function isFloatSchema(schema: object): boolean; /** * Returns `true` for an int32 (32-bit signed "short") schema. * @param {object} schema simple or composite OpenAPI 3.x schema object * @returns {boolean} */ -export function isInt32Schema(schema: object): boolean; +declare function isInt32Schema(schema: object): boolean; /** * Returns `true` for an int64 (64-bit signed "long") schema. * @param {object} schema simple or composite OpenAPI 3.x schema object * @returns {boolean} */ -export function isInt64Schema(schema: object): boolean; +declare function isInt64Schema(schema: object): boolean; /** * Returns `true` for an integer (32-bit, 64-bit, or ambiguous format) schema. * @param {object} schema simple or composite OpenAPI 3.x schema object * @returns {boolean} */ -export function isIntegerSchema(schema: object): boolean; +declare function isIntegerSchema(schema: object): boolean; /** * Returns `true` for a number (32-bit, 64-bit, or ambiguous format floating point) schema. * @param {object} schema simple or composite OpenAPI 3.x schema object * @returns {boolean} */ -export function isNumberSchema(schema: object): boolean; +declare function isNumberSchema(schema: object): boolean; /** * Returns `true` for an object schema. * @param {object} schema simple or composite OpenAPI 3.x schema object * @returns {boolean} */ -export function isObjectSchema(schema: object): boolean; +declare function isObjectSchema(schema: object): boolean; /** * Returns `true` for a primitive schema (anything encoded as a JSON string, number, or boolean). * @param {object} schema simple or composite OpenAPI 3.x schema object * @returns {boolean} */ -export function isPrimitiveSchema(schema: object): boolean; +declare function isPrimitiveSchema(schema: object): boolean; /** * Returns `true` for a string schema of any format. * @param {object} schema simple or composite OpenAPI 3.x schema object * @returns {boolean} */ -export function isStringSchema(schema: object): boolean; +declare function isStringSchema(schema: object): boolean; /** * Check whether a schema is of a specific type. This means that one of the following must be true: * 1. `schema`'s type field is a string and is equal to `type`. @@ -133,5 +155,5 @@ export function isStringSchema(schema: object): boolean; * @param {string} type the type value to check * @returns {boolean} */ -export function schemaIsOfType(schema: object, type: string): boolean; +declare function schemaIsOfType(schema: object, type: string): boolean; //# sourceMappingURL=get-schema-type.d.ts.map \ No newline at end of file diff --git a/packages/utilities/types/utils/get-schema-type.d.ts.map b/packages/utilities/types/utils/get-schema-type.d.ts.map index d85266963..e51a37110 100644 --- a/packages/utilities/types/utils/get-schema-type.d.ts.map +++ b/packages/utilities/types/utils/get-schema-type.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"get-schema-type.d.ts","sourceRoot":"","sources":["../../src/utils/get-schema-type.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AA0FA;;;;;;;;;;;GAWG;AACH,sCAHW,MAAM,GACJ,MAAM,CA2ClB;AAoCD;;;;GAIG;AACH,sCAHW,MAAM,GACJ,OAAO,CAMnB;AAED;;;;GAIG;AACH,uCAHW,MAAM,GACJ,OAAO,CAOnB;AAED;;;;GAIG;AACH,wCAHW,MAAM,GACJ,OAAO,CAInB;AAED;;;;GAIG;AACH,qCAHW,MAAM,GACJ,OAAO,CAOnB;AAED;;;;GAIG;AACH,qCAHW,MAAM,GACJ,OAAO,CAOnB;AAED;;;;GAIG;AACH,yCAHW,MAAM,GACJ,OAAO,CAOnB;AAED;;;;GAIG;AACH,uCAHW,MAAM,GACJ,OAAO,CAQnB;AAED;;;;GAIG;AACH,4CAHW,MAAM,GACJ,OAAO,CAOnB;AAED;;;;GAIG;AACH,sCAHW,MAAM,GACJ,OAAO,CAQnB;AAED;;;;GAIG;AACH,sCAHW,MAAM,GACJ,OAAO,CAOnB;AAED;;;;GAIG;AACH,sCAHW,MAAM,GACJ,OAAO,CAOnB;AAED;;;;GAIG;AACH,wCAHW,MAAM,GACJ,OAAO,CAInB;AAED;;;;GAIG;AACH,uCAHW,MAAM,GACJ,OAAO,CAInB;AAED;;;;GAIG;AACH,uCAHW,MAAM,GACJ,OAAO,CAanB;AAWD;;;;GAIG;AACH,0CAHW,MAAM,GACJ,OAAO,CAUnB;AAtBD;;;;GAIG;AACH,uCAHW,MAAM,GACJ,OAAO,CAInB;AA/MD;;;;;;;GAOG;AACH,uCAJW,MAAM,QACN,MAAM,GACJ,OAAO,CAQnB"} \ No newline at end of file +{"version":3,"file":"get-schema-type.d.ts","sourceRoot":"","sources":["../../src/utils/get-schema-type.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0FA;;;;;;;;;;;GAWG;AACH,uCAHW,MAAM,GACJ,MAAM,CA2ClB;AAoCD;;;;GAIG;AACH,uCAHW,MAAM,GACJ,OAAO,CAMnB;AAED;;;;GAIG;AACH,wCAHW,MAAM,GACJ,OAAO,CAOnB;AAED;;;;GAIG;AACH,yCAHW,MAAM,GACJ,OAAO,CAInB;AAED;;;;GAIG;AACH,sCAHW,MAAM,GACJ,OAAO,CAOnB;AAED;;;;GAIG;AACH,sCAHW,MAAM,GACJ,OAAO,CAOnB;AAED;;;;GAIG;AACH,0CAHW,MAAM,GACJ,OAAO,CAOnB;AAED;;;;GAIG;AACH,wCAHW,MAAM,GACJ,OAAO,CAQnB;AAED;;;;GAIG;AACH,6CAHW,MAAM,GACJ,OAAO,CAOnB;AAED;;;;GAIG;AACH,uCAHW,MAAM,GACJ,OAAO,CAQnB;AAED;;;;GAIG;AACH,uCAHW,MAAM,GACJ,OAAO,CAOnB;AAED;;;;GAIG;AACH,uCAHW,MAAM,GACJ,OAAO,CAOnB;AAED;;;;GAIG;AACH,yCAHW,MAAM,GACJ,OAAO,CAInB;AAED;;;;GAIG;AACH,wCAHW,MAAM,GACJ,OAAO,CAInB;AAED;;;;GAIG;AACH,wCAHW,MAAM,GACJ,OAAO,CAanB;AAWD;;;;GAIG;AACH,2CAHW,MAAM,GACJ,OAAO,CAUnB;AAtBD;;;;GAIG;AACH,wCAHW,MAAM,GACJ,OAAO,CAInB;AA/MD;;;;;;;GAOG;AACH,wCAJW,MAAM,QACN,MAAM,GACJ,OAAO,CAQnB"} \ No newline at end of file diff --git a/packages/utilities/types/utils/index.d.ts b/packages/utilities/types/utils/index.d.ts index c643b5777..b6f79afa4 100644 --- a/packages/utilities/types/utils/index.d.ts +++ b/packages/utilities/types/utils/index.d.ts @@ -1,15 +1,15 @@ -declare const _exports: { - validateComposedSchemas: typeof import("./validate-composed-schemas"); - validateNestedSchemas: typeof import("./validate-nested-schemas"); - validateSubschemas: typeof import("./validate-subschemas"); - getNodes: typeof import("./spectral-context-utils").getNodes; - getResolvedSpec: typeof import("./spectral-context-utils").getResolvedSpec; - getUnresolvedSpec: typeof import("./spectral-context-utils").getUnresolvedSpec; - isObject: typeof import("./is-object"); - schemaHasConstraint: typeof import("./schema-has-constraint"); - schemaHasProperty: typeof import("./schema-has-property"); - schemaLooselyHasConstraint: typeof import("./schema-loosely-has-constraint"); - schemaRequiresProperty: typeof import("./schema-requires-property"); +declare const _default: { + validateComposedSchemas: typeof import("./validate-composed-schemas").default; + validateNestedSchemas: typeof import("./validate-nested-schemas").default; + validateSubschemas: typeof import("./validate-subschemas").default; + getNodes: (context: object) => object; + getResolvedSpec: (context: object) => object; + getUnresolvedSpec: (context: object) => object; + isObject: typeof import("./is-object").default; + schemaHasConstraint: typeof import("./schema-has-constraint").default; + schemaHasProperty: typeof import("./schema-has-property").default; + schemaLooselyHasConstraint: typeof import("./schema-loosely-has-constraint").default; + schemaRequiresProperty: typeof import("./schema-requires-property").default; SchemaType: { ARRAY: symbol; BINARY: symbol; @@ -28,27 +28,27 @@ declare const _exports: { STRING: symbol; UNKNOWN: symbol; }; - getSchemaType: typeof import("./get-schema-type").getSchemaType; - isArraySchema: typeof import("./get-schema-type").isArraySchema; - isBinarySchema: typeof import("./get-schema-type").isBinarySchema; - isBooleanSchema: typeof import("./get-schema-type").isBooleanSchema; - isByteSchema: typeof import("./get-schema-type").isByteSchema; - isDateSchema: typeof import("./get-schema-type").isDateSchema; - isDateTimeSchema: typeof import("./get-schema-type").isDateTimeSchema; - isDoubleSchema: typeof import("./get-schema-type").isDoubleSchema; - isEnumerationSchema: typeof import("./get-schema-type").isEnumerationSchema; - isFloatSchema: typeof import("./get-schema-type").isFloatSchema; - isInt32Schema: typeof import("./get-schema-type").isInt32Schema; - isInt64Schema: typeof import("./get-schema-type").isInt64Schema; - isIntegerSchema: typeof import("./get-schema-type").isIntegerSchema; - isNumberSchema: typeof import("./get-schema-type").isNumberSchema; - isObjectSchema: typeof import("./get-schema-type").isObjectSchema; - isPrimitiveSchema: typeof import("./get-schema-type").isPrimitiveSchema; - isStringSchema: typeof import("./get-schema-type").isStringSchema; - schemaIsOfType: typeof import("./get-schema-type").schemaIsOfType; - collectFromComposedSchemas: typeof import("./collect-from-composed-schemas"); + getSchemaType: (schema: object) => symbol; + isArraySchema: (schema: object) => boolean; + isBinarySchema: (schema: object) => boolean; + isBooleanSchema: (schema: object) => boolean; + isByteSchema: (schema: object) => boolean; + isDateSchema: (schema: object) => boolean; + isDateTimeSchema: (schema: object) => boolean; + isDoubleSchema: (schema: object) => boolean; + isEnumerationSchema: (schema: object) => boolean; + isFloatSchema: (schema: object) => boolean; + isInt32Schema: (schema: object) => boolean; + isInt64Schema: (schema: object) => boolean; + isIntegerSchema: (schema: object) => boolean; + isNumberSchema: (schema: object) => boolean; + isObjectSchema: (schema: object) => boolean; + isPrimitiveSchema: (schema: object) => boolean; + isStringSchema: (schema: object) => boolean; + schemaIsOfType: (schema: object, type: string) => boolean; + collectFromComposedSchemas: typeof import("./collect-from-composed-schemas").default; getExamplesForSchema: typeof import("./get-examples-for-schema"); getPropertyNamesForSchema: typeof import("./get-property-names-for-schema"); }; -export = _exports; +export default _default; //# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/packages/utilities/types/utils/is-object.d.ts b/packages/utilities/types/utils/is-object.d.ts index 4b41bbdc6..ab44d28ba 100644 --- a/packages/utilities/types/utils/is-object.d.ts +++ b/packages/utilities/types/utils/is-object.d.ts @@ -1,4 +1,4 @@ -export = isObject; +export default isObject; /** * Copyright 2017 - 2023 IBM Corporation. * SPDX-License-Identifier: Apache2.0 diff --git a/packages/utilities/types/utils/schema-has-constraint.d.ts b/packages/utilities/types/utils/schema-has-constraint.d.ts index 03f3e257f..818acf816 100644 --- a/packages/utilities/types/utils/schema-has-constraint.d.ts +++ b/packages/utilities/types/utils/schema-has-constraint.d.ts @@ -1,4 +1,4 @@ -export = schemaHasConstraint; +export default schemaHasConstraint; /** * This function will return `true` if all possible variations of a (possibly composite) schema * enforce a constraint, as checked by a `(schema) => boolean` function which checks for the diff --git a/packages/utilities/types/utils/schema-has-property.d.ts b/packages/utilities/types/utils/schema-has-property.d.ts index 6a3e47444..dd1948854 100644 --- a/packages/utilities/types/utils/schema-has-property.d.ts +++ b/packages/utilities/types/utils/schema-has-property.d.ts @@ -1,4 +1,4 @@ -export = schemaHasProperty; +export default schemaHasProperty; /** * This function will return `true` if all possible variations of a (possibly composite) schema * define a property with the specified name. diff --git a/packages/utilities/types/utils/schema-loosely-has-constraint.d.ts b/packages/utilities/types/utils/schema-loosely-has-constraint.d.ts index ec528679b..f21fc0a68 100644 --- a/packages/utilities/types/utils/schema-loosely-has-constraint.d.ts +++ b/packages/utilities/types/utils/schema-loosely-has-constraint.d.ts @@ -1,4 +1,4 @@ -export = schemaLooselyHasConstraint; +export default schemaLooselyHasConstraint; /** * This function is a looser adaptation of the `schemaHasConstraint()` function. * Here, we process `oneOf` and `anyOf` lists the same as `allOf`, returning `true` if: diff --git a/packages/utilities/types/utils/schema-path.d.ts b/packages/utilities/types/utils/schema-path.d.ts index f86b73d3d..7c2e8ab8f 100644 --- a/packages/utilities/types/utils/schema-path.d.ts +++ b/packages/utilities/types/utils/schema-path.d.ts @@ -1,4 +1,8 @@ -export = SchemaPath; +export default SchemaPath; +/** + * Copyright 2024 IBM Corporation. + * SPDX-License-Identifier: Apache2.0 + */ /** * @private */ diff --git a/packages/utilities/types/utils/schema-path.d.ts.map b/packages/utilities/types/utils/schema-path.d.ts.map index e57362baa..6ee322c95 100644 --- a/packages/utilities/types/utils/schema-path.d.ts.map +++ b/packages/utilities/types/utils/schema-path.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"schema-path.d.ts","sourceRoot":"","sources":["../../src/utils/schema-path.js"],"names":[],"mappings":";AAQA;;GAEG;AACH;IACE,4CAIC;IAFC,wBAA0C;IAI5C,oCAKC;IAED,qCAKC;IAED,8CAKC;IAED,4BAEC;IAED,wDAEC;IAED,sBAEC;CACF"} \ No newline at end of file +{"version":3,"file":"schema-path.d.ts","sourceRoot":"","sources":["../../src/utils/schema-path.js"],"names":[],"mappings":";AAAA;;;GAGG;AAEH;;GAEG;AACH;IACE,4CAIC;IAFC,wBAA0C;IAI5C,oCAKC;IAED,qCAKC;IAED,8CAKC;IAED,4BAEC;IAED,wDAEC;IAED,sBAEC;CACF"} \ No newline at end of file diff --git a/packages/utilities/types/utils/schema-requires-property.d.ts b/packages/utilities/types/utils/schema-requires-property.d.ts index 83be41739..4fa0b86b9 100644 --- a/packages/utilities/types/utils/schema-requires-property.d.ts +++ b/packages/utilities/types/utils/schema-requires-property.d.ts @@ -1,4 +1,4 @@ -export = schemaRequiresProperty; +export default schemaRequiresProperty; /** * This function will return `true` if all possible variations of a (possibly composite) schema * require a property with the specified name. Note that this method may not behave as expected diff --git a/packages/utilities/types/utils/spectral-context-utils.d.ts b/packages/utilities/types/utils/spectral-context-utils.d.ts index 20dd69fd0..3cce27e31 100644 --- a/packages/utilities/types/utils/spectral-context-utils.d.ts +++ b/packages/utilities/types/utils/spectral-context-utils.d.ts @@ -1,10 +1,16 @@ +declare namespace _default { + export { getNodes }; + export { getResolvedSpec }; + export { getUnresolvedSpec }; +} +export default _default; /** * Returns the graph nodes, with information about references and the locations * they resolve to, that are computed by the Spectral resolver. * @param {object} context passed as an argument to Spectral-based rule functions * @returns {object} the graph nodes */ -export function getNodes(context: object): object; +declare function getNodes(context: object): object; /** * Copyright 2025 IBM Corporation. * SPDX-License-Identifier: Apache2.0 @@ -15,12 +21,12 @@ export function getNodes(context: object): object; * @param {object} context passed as an argument to Spectral-based rule functions * @returns {object} the resolved version of an OpenAPI document */ -export function getResolvedSpec(context: object): object; +declare function getResolvedSpec(context: object): object; /** * Returns the programmatic representation of an OpenAPI document, stored in * the Spectral-created "context" object, with all references still intact. * @param {object} context passed as an argument to Spectral-based rule functions * @returns {object} the unresolved version of an OpenAPI document */ -export function getUnresolvedSpec(context: object): object; +declare function getUnresolvedSpec(context: object): object; //# sourceMappingURL=spectral-context-utils.d.ts.map \ No newline at end of file diff --git a/packages/utilities/types/utils/spectral-context-utils.d.ts.map b/packages/utilities/types/utils/spectral-context-utils.d.ts.map index b7ed654b3..32369c147 100644 --- a/packages/utilities/types/utils/spectral-context-utils.d.ts.map +++ b/packages/utilities/types/utils/spectral-context-utils.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"spectral-context-utils.d.ts","sourceRoot":"","sources":["../../src/utils/spectral-context-utils.js"],"names":[],"mappings":"AAyBA;;;;;GAKG;AACH,kCAHW,MAAM,GACJ,MAAM,CAIlB;AAjCD;;;GAGG;AAEH;;;;;GAKG;AACH,yCAHW,MAAM,GACJ,MAAM,CAIlB;AAED;;;;;GAKG;AACH,2CAHW,MAAM,GACJ,MAAM,CAIlB"} \ No newline at end of file +{"version":3,"file":"spectral-context-utils.d.ts","sourceRoot":"","sources":["../../src/utils/spectral-context-utils.js"],"names":[],"mappings":";;;;;;AAyBA;;;;;GAKG;AACH,mCAHW,MAAM,GACJ,MAAM,CAIlB;AAjCD;;;GAGG;AAEH;;;;;GAKG;AACH,0CAHW,MAAM,GACJ,MAAM,CAIlB;AAED;;;;;GAKG;AACH,4CAHW,MAAM,GACJ,MAAM,CAIlB"} \ No newline at end of file diff --git a/packages/utilities/types/utils/validate-composed-schemas.d.ts b/packages/utilities/types/utils/validate-composed-schemas.d.ts index b33e37c7a..2606b9abf 100644 --- a/packages/utilities/types/utils/validate-composed-schemas.d.ts +++ b/packages/utilities/types/utils/validate-composed-schemas.d.ts @@ -1,4 +1,4 @@ -export = validateComposedSchemas; +export default validateComposedSchemas; /** * Performs validation on a schema and all of its composed schemas. * diff --git a/packages/utilities/types/utils/validate-nested-schemas.d.ts b/packages/utilities/types/utils/validate-nested-schemas.d.ts index 266c24aac..10314471d 100644 --- a/packages/utilities/types/utils/validate-nested-schemas.d.ts +++ b/packages/utilities/types/utils/validate-nested-schemas.d.ts @@ -1,4 +1,4 @@ -export = validateNestedSchemas; +export default validateNestedSchemas; /** * Performs validation on a schema and all of its nested schemas. * diff --git a/packages/utilities/types/utils/validate-subschemas.d.ts b/packages/utilities/types/utils/validate-subschemas.d.ts index 1616a74e7..0c71a8404 100644 --- a/packages/utilities/types/utils/validate-subschemas.d.ts +++ b/packages/utilities/types/utils/validate-subschemas.d.ts @@ -1,4 +1,4 @@ -export = validateSubschemas; +export default validateSubschemas; /** * Performs validation on a schema and all of its subschemas. * diff --git a/scripts/generate-utilities-docs.js b/scripts/generate-utilities-docs.js index 508573b8f..f27789e9b 100755 --- a/scripts/generate-utilities-docs.js +++ b/scripts/generate-utilities-docs.js @@ -1,8 +1,8 @@ #!/usr/bin/env node -const mustache = require('mustache'); -const { readFileSync, writeFileSync } = require('fs'); -const { execSync } = require('child_process'); +import mustache from 'mustache'; +import { readFileSync, writeFileSync } from 'fs'; +import { execSync } from 'child_process'; const template = readFileSync('scripts/templates/package.mustache', { encoding: 'utf8', From 6dc0972a283a509f73bc4692b21d3a69d26a68f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=ADdia=20Tarcza?= <100163235+diatrcz@users.noreply.github.com> Date: Thu, 11 Jun 2026 13:27:30 +0200 Subject: [PATCH 08/16] convert to esm validator MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Lídia Tarcza <100163235+diatrcz@users.noreply.github.com> --- packages/validator/src/cli-validator/index.js | 2 +- .../src/cli-validator/run-validator.js | 42 +++++++++---------- .../utils/check-ruleset-version.js | 8 ++-- .../src/cli-validator/utils/check-version.js | 16 +++---- .../src/cli-validator/utils/cli-options.js | 6 +-- .../utils/configuration-manager.js | 28 ++++++------- .../utils/file-extension-validator.js | 8 ++-- .../utils/get-copyright-string.js | 6 +-- .../utils/get-default-ruleset-version.js | 6 +-- .../utils/get-local-ruleset-version.js | 9 ++-- .../cli-validator/utils/get-version-string.js | 8 ++-- .../src/cli-validator/utils/index.js | 14 +++---- .../cli-validator/utils/preprocess-file.js | 4 +- .../src/cli-validator/utils/print-json.js | 2 +- .../src/cli-validator/utils/print-results.js | 8 ++-- .../src/cli-validator/utils/print-versions.js | 12 +++--- .../src/cli-validator/utils/read-yaml.js | 12 +++--- .../cli-validator/utils/validate-schema.js | 4 +- .../validator/src/markdown-report/index.js | 6 +-- .../src/markdown-report/markdown-table.js | 2 +- .../validator/src/markdown-report/report.js | 5 ++- .../tables/categorized-scores.js | 4 +- .../src/markdown-report/tables/index.js | 12 +++--- .../src/markdown-report/tables/primary.js | 4 +- .../tables/rule-violation-details.js | 4 +- .../tables/rule-violation-summary.js | 4 +- .../markdown-report/tables/scoring-data.js | 4 +- .../src/markdown-report/write-file.js | 10 ++--- .../validator/src/scoring-tool/categories.js | 2 +- .../src/scoring-tool/compute-metrics.js | 8 ++-- .../validator/src/scoring-tool/get-title.js | 4 +- packages/validator/src/scoring-tool/index.js | 12 +++--- .../validator/src/scoring-tool/metrics.js | 10 ++--- packages/validator/src/scoring-tool/output.js | 7 ++-- packages/validator/src/scoring-tool/rubric.js | 2 +- packages/validator/src/scoring-tool/score.js | 7 ++-- packages/validator/src/spectral/index.js | 24 +++++------ packages/validator/src/spectral/utils.js | 4 +- 38 files changed, 164 insertions(+), 166 deletions(-) diff --git a/packages/validator/src/cli-validator/index.js b/packages/validator/src/cli-validator/index.js index a05124874..a6e4fcf43 100755 --- a/packages/validator/src/cli-validator/index.js +++ b/packages/validator/src/cli-validator/index.js @@ -9,7 +9,7 @@ // the passed in argument (currently 16.0.0) require('./utils/check-version')('16.0.0'); -const runValidator = require('./run-validator'); +import runValidator from './run-validator'; runValidator(process.argv) .then(exitCode => { process.exitCode = exitCode; diff --git a/packages/validator/src/cli-validator/run-validator.js b/packages/validator/src/cli-validator/run-validator.js index 52dd657a0..23c283efc 100644 --- a/packages/validator/src/cli-validator/run-validator.js +++ b/packages/validator/src/cli-validator/run-validator.js @@ -4,16 +4,16 @@ * SPDX-License-Identifier: Apache2.0 */ -const chalk = require('chalk'); -const fs = require('fs'); -const globby = require('globby'); -const isPlainObject = require('lodash/isPlainObject'); -const jsonValidator = require('json-dup-key-validator'); -const path = require('path'); -const readYaml = require('js-yaml'); -const util = require('util'); - -const { +import chalk, { underline } from 'chalk'; +import { readFile as _readFile } from 'fs'; +import globby from 'globby'; +import isPlainObject from 'lodash/isPlainObject'; +import { validate } from 'json-dup-key-validator'; +import { resolve, relative } from 'path'; +import { load } from 'js-yaml'; +import { promisify } from 'util'; + +import { getCopyrightString, getFileExtension, preprocessFile, @@ -22,11 +22,11 @@ const { printVersions, processArgs, supportedFileExtension, -} = require('./utils'); +} from './utils'; -const { runSpectral } = require('../spectral'); -const { produceQualityScore, printScoreTables } = require('../scoring-tool'); -const { printMarkdownReport } = require('../markdown-report'); +import { runSpectral } from '../spectral'; +import { produceQualityScore, printScoreTables } from '../scoring-tool'; +import { printMarkdownReport } from '../markdown-report'; let logger; @@ -103,13 +103,13 @@ async function runValidator(cliArgs, parseOptions = {}) { // by comparing absolute paths. // "filteredArgs" will be "args" minus any ignored files. const filteredArgs = args.filter( - file => !context.config.ignoreFiles.includes(path.resolve(file)) + file => !context.config.ignoreFiles.includes(resolve(file)) ); // Next, display a message for each user-specified file that is being ignored. const ignoredFiles = args.filter(file => !filteredArgs.includes(file)); ignoredFiles.forEach(file => { - logger.warn('Ignored ' + path.relative(process.cwd(), file)); + logger.warn('Ignored ' + relative(process.cwd(), file)); }); args = filteredArgs; @@ -180,7 +180,7 @@ async function runValidator(cliArgs, parseOptions = {}) { // The "fs" module does not return promises by default. // Create a version of the 'readFile' function that does. - const readFile = util.promisify(fs.readFile); + const readFile = promisify(_readFile); // Validate, then process the results for each file being validated. for (const validFile of filesToValidate) { @@ -192,7 +192,7 @@ async function runValidator(cliArgs, parseOptions = {}) { if (!outputIsJSON(context)) { console.log(''); - console.log(chalk.underline(`Validation Results for ${validFile}:\n`)); + console.log(underline(`Validation Results for ${validFile}:\n`)); } try { originalFile = await readFile(validFile, 'utf8'); @@ -202,7 +202,7 @@ async function runValidator(cliArgs, parseOptions = {}) { if (fileExtension === 'json') { input = JSON.parse(originalFile); } else if (fileExtension === 'yaml' || fileExtension === 'yml') { - input = readYaml.load(originalFile); + input = load(originalFile); } if (!isPlainObject(input)) { @@ -211,7 +211,7 @@ async function runValidator(cliArgs, parseOptions = {}) { // jsonValidator looks through the originalFile for duplicate JSON keys // this is checked for by default in readYaml - const duplicateKeysError = jsonValidator.validate(originalFile); + const duplicateKeysError = validate(originalFile); if (fileExtension === 'json' && duplicateKeysError) { throw duplicateKeysError; } @@ -392,4 +392,4 @@ function outputIsJSON(context) { return context.config.outputFormat === 'json'; } -module.exports = runValidator; +export default runValidator; diff --git a/packages/validator/src/cli-validator/utils/check-ruleset-version.js b/packages/validator/src/cli-validator/utils/check-ruleset-version.js index 6d0606cdd..f2ad1b5ef 100644 --- a/packages/validator/src/cli-validator/utils/check-ruleset-version.js +++ b/packages/validator/src/cli-validator/utils/check-ruleset-version.js @@ -3,10 +3,10 @@ * SPDX-License-Identifier: Apache2.0 */ -const semver = require('semver'); -const getDefaultRulesetVersion = require('./get-default-ruleset-version'); +import { lt } from 'semver'; +import getDefaultRulesetVersion from './get-default-ruleset-version'; -module.exports = checkRulesetVersion; +export default checkRulesetVersion; /** * Checks the locally installed version of the IBM Cloud OpenAPI @@ -30,7 +30,7 @@ function checkRulesetVersion(local) { } const defaultVersion = getDefaultRulesetVersion(); - if (semver.lt(local, defaultVersion)) { + if (lt(local, defaultVersion)) { return `Note: local version of the IBM OpenAPI Ruleset is behind the default version, which is ${defaultVersion}.`; } diff --git a/packages/validator/src/cli-validator/utils/check-version.js b/packages/validator/src/cli-validator/utils/check-version.js index 0c746a97d..1c342fb3f 100644 --- a/packages/validator/src/cli-validator/utils/check-version.js +++ b/packages/validator/src/cli-validator/utils/check-version.js @@ -3,19 +3,19 @@ * SPDX-License-Identifier: Apache2.0 */ -const semver = require('semver'); -const chalk = require('chalk'); +import { gte, satisfies } from 'semver'; +import { red, yellow } from 'chalk'; // this module can be used to handle any version-specific functionality // it will be called immediately when the program is run -module.exports = function (requiredVersion) { +export default function (requiredVersion) { // this is called since the code uses features that require `requiredVersion` - const isSupportedVersion = semver.gte(process.version, requiredVersion); + const isSupportedVersion = gte(process.version, requiredVersion); if (!isSupportedVersion) { console.log( '\n' + - chalk.red('[Error]') + + red('[Error]') + ` Node version must be ${requiredVersion} or above.` + ` Your current version is ${process.version}\n` ); @@ -23,13 +23,13 @@ module.exports = function (requiredVersion) { } // print deprecation warnings for specific node versions that will no longer be supported - const isNodeTen = semver.satisfies(process.version, '10.x'); + const isNodeTen = satisfies(process.version, '10.x'); if (isNodeTen) { console.log( '\n' + - chalk.yellow('[Warning]') + + yellow('[Warning]') + ` Support for Node 10.x is deprecated. Support will be officially dropped when it reaches end of life` + ` (30 April 2021).\n` ); } -}; +} diff --git a/packages/validator/src/cli-validator/utils/cli-options.js b/packages/validator/src/cli-validator/utils/cli-options.js index fc17f805b..c2096d5d9 100644 --- a/packages/validator/src/cli-validator/utils/cli-options.js +++ b/packages/validator/src/cli-validator/utils/cli-options.js @@ -3,8 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { Command } = require('commander'); -const getCopyrightString = require('./get-copyright-string'); +import { Command } from 'commander'; +import getCopyrightString from './get-copyright-string'; /** * This function is used to gather multi-valued arguments into an array. @@ -111,4 +111,4 @@ function createCLIOptions() { return command; } -module.exports = createCLIOptions; +export default createCLIOptions; diff --git a/packages/validator/src/cli-validator/utils/configuration-manager.js b/packages/validator/src/cli-validator/utils/configuration-manager.js index c8529910b..15104ab1d 100644 --- a/packages/validator/src/cli-validator/utils/configuration-manager.js +++ b/packages/validator/src/cli-validator/utils/configuration-manager.js @@ -3,15 +3,19 @@ * SPDX-License-Identifier: Apache2.0 */ -const path = require('path'); -const { +import path from 'path'; +import { fileURLToPath } from 'url'; +import { getFileExtension, supportedFileExtension, -} = require('./file-extension-validator'); -const { LoggerFactory } = require('@ibm-cloud/openapi-ruleset/src/utils'); -const validateSchema = require('./validate-schema'); -const createCLIOptions = require('./cli-options'); -const readYaml = require('./read-yaml'); +} from './file-extension-validator.js'; +import { LoggerFactory } from '@ibm-cloud/openapi-ruleset/src/utils'; +import validateSchema from './validate-schema.js'; +import createCLIOptions from './cli-options.js'; +import readYaml from './read-yaml.js'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); // Lazy initializer for the logger. let logger; @@ -75,7 +79,8 @@ async function loadConfig(filename) { switch (extension) { case 'json': case 'js': { - userConfig = require(configFile); + userConfig = + (await import(configFile)).default || (await import(configFile)); break; } @@ -266,9 +271,4 @@ async function getConfigFileSchema() { return configFileSchema; } -module.exports = { - getConfigFileSchema, - getDefaultConfig, - loadConfig, - processArgs, -}; +export { getConfigFileSchema, getDefaultConfig, loadConfig, processArgs }; diff --git a/packages/validator/src/cli-validator/utils/file-extension-validator.js b/packages/validator/src/cli-validator/utils/file-extension-validator.js index e2e27b59a..caa6521a8 100644 --- a/packages/validator/src/cli-validator/utils/file-extension-validator.js +++ b/packages/validator/src/cli-validator/utils/file-extension-validator.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -const last = require('lodash/last'); +import last from 'lodash/last'; const getExtension = filename => { return last(filename.split('.')).toLowerCase(); @@ -18,7 +18,5 @@ const validateExtension = (filename, supportedFileTypes) => { return goodExtension; }; -module.exports = { - supportedFileExtension: validateExtension, - getFileExtension: getExtension, -}; +export const supportedFileExtension = validateExtension; +export const getFileExtension = getExtension; diff --git a/packages/validator/src/cli-validator/utils/get-copyright-string.js b/packages/validator/src/cli-validator/utils/get-copyright-string.js index 14b632e9c..1019c1d11 100644 --- a/packages/validator/src/cli-validator/utils/get-copyright-string.js +++ b/packages/validator/src/cli-validator/utils/get-copyright-string.js @@ -3,8 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const getVersionString = require('./get-version-string'); +import getVersionString from './get-version-string'; -module.exports = function () { +export default function () { return `IBM OpenAPI Validator (${getVersionString()}), @Copyright IBM Corporation 2017, ${new Date().getFullYear()}.`; -}; +} diff --git a/packages/validator/src/cli-validator/utils/get-default-ruleset-version.js b/packages/validator/src/cli-validator/utils/get-default-ruleset-version.js index 8bb1ae318..5d2c1ab4f 100644 --- a/packages/validator/src/cli-validator/utils/get-default-ruleset-version.js +++ b/packages/validator/src/cli-validator/utils/get-default-ruleset-version.js @@ -3,9 +3,9 @@ * SPDX-License-Identifier: Apache2.0 */ -const packageConfig = require('../../../package.json'); +import { dependencies } from '../../../package.json'; -module.exports = getDefaultRulesetVersion; +export default getDefaultRulesetVersion; /** * Looks at the validator tool's declared dependencies and @@ -16,5 +16,5 @@ module.exports = getDefaultRulesetVersion; * @returns string - the default ruleset version */ function getDefaultRulesetVersion() { - return packageConfig.dependencies['@ibm-cloud/openapi-ruleset']; + return dependencies['@ibm-cloud/openapi-ruleset']; } diff --git a/packages/validator/src/cli-validator/utils/get-local-ruleset-version.js b/packages/validator/src/cli-validator/utils/get-local-ruleset-version.js index 6e824d28f..864ab9a7e 100644 --- a/packages/validator/src/cli-validator/utils/get-local-ruleset-version.js +++ b/packages/validator/src/cli-validator/utils/get-local-ruleset-version.js @@ -3,10 +3,11 @@ * SPDX-License-Identifier: Apache2.0 */ -const findUp = require('find-up'); -const { dirname, join } = require('path'); +import findUp from 'find-up'; +import { dirname, join } from 'path'; +import { createRequire } from 'module'; -module.exports = getLocalRulesetVersion; +const require = createRequire(import.meta.url); /** * Looks for a locally installed version of the IBM Cloud OpenAPI @@ -110,3 +111,5 @@ async function lookForRulesetPackage(rulesetDir) { await findUp(matchIBMRulesetPackage, opts); return pathToPackage; } + +export default getLocalRulesetVersion; diff --git a/packages/validator/src/cli-validator/utils/get-version-string.js b/packages/validator/src/cli-validator/utils/get-version-string.js index f95dcbf9e..47772ca93 100644 --- a/packages/validator/src/cli-validator/utils/get-version-string.js +++ b/packages/validator/src/cli-validator/utils/get-version-string.js @@ -3,8 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const packageConfig = require('../../../package.json'); +import { version } from '../../../package.json'; -module.exports = function () { - return `validator: ${packageConfig.version}`; -}; +export default function () { + return `validator: ${version}`; +} diff --git a/packages/validator/src/cli-validator/utils/index.js b/packages/validator/src/cli-validator/utils/index.js index 075b26353..c9b8af859 100644 --- a/packages/validator/src/cli-validator/utils/index.js +++ b/packages/validator/src/cli-validator/utils/index.js @@ -3,19 +3,19 @@ * SPDX-License-Identifier: Apache2.0 */ -module.exports = { +export default { checkRulesetVersion: require('./check-ruleset-version'), createCLIOptions: require('./cli-options'), getCopyrightString: require('./get-copyright-string'), getDefaultRulesetVersion: require('./get-default-ruleset-version'), getLocalRulesetVersion: require('./get-local-ruleset-version'), getVersionString: require('./get-version-string'), - preprocessFile: require('./preprocess-file'), - printJson: require('./print-json'), - printResults: require('./print-results'), - printVersions: require('./print-versions'), - readYaml: require('./read-yaml'), - validateSchema: require('./validate-schema'), + preprocessFile: require('./preprocess-file').default, + printJson: require('./print-json').default, + printResults: require('./print-results').default, + printVersions: require('./print-versions').default, + readYaml: require('./read-yaml').default, + validateSchema: require('./validate-schema').default, ...require('./configuration-manager'), ...require('./file-extension-validator'), }; diff --git a/packages/validator/src/cli-validator/utils/preprocess-file.js b/packages/validator/src/cli-validator/utils/preprocess-file.js index 50917e700..414106549 100644 --- a/packages/validator/src/cli-validator/utils/preprocess-file.js +++ b/packages/validator/src/cli-validator/utils/preprocess-file.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -module.exports = function (originalFile) { +export default function (originalFile) { let processedFile; // replace all tabs characters (\t) in the original file with 2 spaces @@ -23,4 +23,4 @@ module.exports = function (originalFile) { processedFile = processedFile.replace(/\x9d/g, ' '); return processedFile; -}; +} diff --git a/packages/validator/src/cli-validator/utils/print-json.js b/packages/validator/src/cli-validator/utils/print-json.js index 9b0e25bb4..7de5fa02f 100644 --- a/packages/validator/src/cli-validator/utils/print-json.js +++ b/packages/validator/src/cli-validator/utils/print-json.js @@ -7,4 +7,4 @@ function printJson(context, results) { console.log(JSON.stringify(results, null, 2)); } -module.exports = printJson; +export default printJson; diff --git a/packages/validator/src/cli-validator/utils/print-results.js b/packages/validator/src/cli-validator/utils/print-results.js index daf5ec3e9..14fbef629 100644 --- a/packages/validator/src/cli-validator/utils/print-results.js +++ b/packages/validator/src/cli-validator/utils/print-results.js @@ -3,11 +3,11 @@ * SPDX-License-Identifier: Apache2.0 */ -const each = require('lodash/each'); -const pad = require('pad'); +import each from 'lodash/each'; +import pad from 'pad'; // this function prints all of the output -module.exports = function print(context, results) { +export default function print(context, results) { const { chalk, config } = context; const types = ['error', 'warning', 'info', 'hint']; @@ -45,7 +45,7 @@ module.exports = function print(context, results) { // Print the summary here printSummary(results, types, context); -}; +} function printSummary(results, types, { chalk, config }) { console.log(chalk.cyan('Summary:')); diff --git a/packages/validator/src/cli-validator/utils/print-versions.js b/packages/validator/src/cli-validator/utils/print-versions.js index 128a68fd8..cf404943b 100644 --- a/packages/validator/src/cli-validator/utils/print-versions.js +++ b/packages/validator/src/cli-validator/utils/print-versions.js @@ -3,13 +3,13 @@ * SPDX-License-Identifier: Apache2.0 */ -const getDefaultRulesetVersion = require('./get-default-ruleset-version.js'); -const getLocalRulesetVersion = require('./get-local-ruleset-version'); -const getVersionString = require('./get-version-string'); -const checkRulesetVersion = require('./check-ruleset-version'); -const { findSpectralRuleset } = require('../../spectral/utils'); +import getDefaultRulesetVersion from './get-default-ruleset-version.js'; +import getLocalRulesetVersion from './get-local-ruleset-version'; +import getVersionString from './get-version-string'; +import checkRulesetVersion from './check-ruleset-version'; +import { findSpectralRuleset } from '../../spectral/utils'; -module.exports = printVersions; +export default printVersions; /** * Prints the "version" strings upon request. It always diff --git a/packages/validator/src/cli-validator/utils/read-yaml.js b/packages/validator/src/cli-validator/utils/read-yaml.js index c3aa7f308..e3e9796d5 100644 --- a/packages/validator/src/cli-validator/utils/read-yaml.js +++ b/packages/validator/src/cli-validator/utils/read-yaml.js @@ -3,15 +3,15 @@ * SPDX-License-Identifier: Apache2.0 */ -const fs = require('fs'); -const util = require('util'); -const jsYaml = require('js-yaml'); +import { readFile as _readFile } from 'fs'; +import { promisify } from 'util'; +import { load } from 'js-yaml'; async function readYaml(path) { // Use a "promisified" version of fs.readFile(). - const readFile = util.promisify(fs.readFile); + const readFile = promisify(_readFile); const fileContents = await readFile(path, 'utf8'); - return jsYaml.load(fileContents); + return load(fileContents); } -module.exports = readYaml; +export default readYaml; diff --git a/packages/validator/src/cli-validator/utils/validate-schema.js b/packages/validator/src/cli-validator/utils/validate-schema.js index 3feab4b93..0ffacb4af 100644 --- a/packages/validator/src/cli-validator/utils/validate-schema.js +++ b/packages/validator/src/cli-validator/utils/validate-schema.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -const Ajv = require('ajv'); +import Ajv from 'ajv'; /** * This function verifies that "data" complies with "schema". @@ -30,4 +30,4 @@ function validateSchema(data, schema) { return messages; } -module.exports = validateSchema; +export default validateSchema; diff --git a/packages/validator/src/markdown-report/index.js b/packages/validator/src/markdown-report/index.js index 47a432eea..6254332ad 100644 --- a/packages/validator/src/markdown-report/index.js +++ b/packages/validator/src/markdown-report/index.js @@ -3,12 +3,12 @@ * SPDX-License-Identifier: Apache2.0 */ -const getReport = require('./report'); -const writeReportToFile = require('./write-file'); +import getReport from './report'; +import writeReportToFile from './write-file'; function printMarkdownReport(context, results) { const report = getReport(context, results); return writeReportToFile(context, report); } -module.exports = { printMarkdownReport }; +export default { printMarkdownReport }; diff --git a/packages/validator/src/markdown-report/markdown-table.js b/packages/validator/src/markdown-report/markdown-table.js index eac224100..ef12f15f1 100644 --- a/packages/validator/src/markdown-report/markdown-table.js +++ b/packages/validator/src/markdown-report/markdown-table.js @@ -50,4 +50,4 @@ class MarkdownTable { } } -module.exports = MarkdownTable; +export default MarkdownTable; diff --git a/packages/validator/src/markdown-report/report.js b/packages/validator/src/markdown-report/report.js index 4a02cf7d8..dcbfad0cb 100644 --- a/packages/validator/src/markdown-report/report.js +++ b/packages/validator/src/markdown-report/report.js @@ -3,6 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ +import tables from './tables/index.js'; const { categorizedScores, primary, @@ -10,7 +11,7 @@ const { errorSummary, scoringData, warningSummary, -} = require('./tables'); +} = tables; function getReport({ apiDefinition }, results) { return `# ${apiDefinition.info.title} @@ -47,4 +48,4 @@ ${ruleViolationDetails(results)} `; } -module.exports = getReport; +export default getReport; diff --git a/packages/validator/src/markdown-report/tables/categorized-scores.js b/packages/validator/src/markdown-report/tables/categorized-scores.js index 5f67d3ee1..f08df28cd 100644 --- a/packages/validator/src/markdown-report/tables/categorized-scores.js +++ b/packages/validator/src/markdown-report/tables/categorized-scores.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -const MarkdownTable = require('../markdown-table'); +import MarkdownTable from '../markdown-table'; function getTable({ qualityScore }) { const { categorizedSummary } = qualityScore; @@ -21,4 +21,4 @@ function getTable({ qualityScore }) { return table.render(); } -module.exports = getTable; +export default getTable; diff --git a/packages/validator/src/markdown-report/tables/index.js b/packages/validator/src/markdown-report/tables/index.js index 0246e53e9..b910be370 100644 --- a/packages/validator/src/markdown-report/tables/index.js +++ b/packages/validator/src/markdown-report/tables/index.js @@ -3,10 +3,10 @@ * SPDX-License-Identifier: Apache2.0 */ -module.exports = { - categorizedScores: require('./categorized-scores'), - primary: require('./primary'), - ruleViolationDetails: require('./rule-violation-details'), - ...require('./rule-violation-summary'), - scoringData: require('./scoring-data'), +export default { + categorizedScores: require('./categorized-scores').default, + primary: require('./primary').default, + ruleViolationDetails: require('./rule-violation-details').default, + ...require('./rule-violation-summary').default, + scoringData: require('./scoring-data').default, }; diff --git a/packages/validator/src/markdown-report/tables/primary.js b/packages/validator/src/markdown-report/tables/primary.js index 3fb8c89ae..aa4d18aac 100644 --- a/packages/validator/src/markdown-report/tables/primary.js +++ b/packages/validator/src/markdown-report/tables/primary.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -const MarkdownTable = require('../markdown-table'); +import MarkdownTable from '../markdown-table'; function getTable({ qualityScore, error, warning }) { const table = new MarkdownTable( @@ -21,4 +21,4 @@ function getTable({ qualityScore, error, warning }) { return table.render(); } -module.exports = getTable; +export default getTable; diff --git a/packages/validator/src/markdown-report/tables/rule-violation-details.js b/packages/validator/src/markdown-report/tables/rule-violation-details.js index f73051dfa..8bb0ea3c9 100644 --- a/packages/validator/src/markdown-report/tables/rule-violation-details.js +++ b/packages/validator/src/markdown-report/tables/rule-violation-details.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -const MarkdownTable = require('../markdown-table'); +import MarkdownTable from '../markdown-table'; function getTable({ error, warning }) { const table = new MarkdownTable( @@ -25,4 +25,4 @@ function getTable({ error, warning }) { return table.render(); } -module.exports = getTable; +export default getTable; diff --git a/packages/validator/src/markdown-report/tables/rule-violation-summary.js b/packages/validator/src/markdown-report/tables/rule-violation-summary.js index ff148c8d0..39e56712f 100644 --- a/packages/validator/src/markdown-report/tables/rule-violation-summary.js +++ b/packages/validator/src/markdown-report/tables/rule-violation-summary.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -const MarkdownTable = require('../markdown-table'); +import MarkdownTable from '../markdown-table'; function errorSummary({ error }) { return getTable(error); @@ -23,7 +23,7 @@ function getTable({ summary }) { return table.render(); } -module.exports = { +export default { errorSummary, warningSummary, }; diff --git a/packages/validator/src/markdown-report/tables/scoring-data.js b/packages/validator/src/markdown-report/tables/scoring-data.js index bf1daf311..53d1a351e 100644 --- a/packages/validator/src/markdown-report/tables/scoring-data.js +++ b/packages/validator/src/markdown-report/tables/scoring-data.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -const MarkdownTable = require('../markdown-table'); +import MarkdownTable from '../markdown-table'; function getTable({ qualityScore }) { const { scoringData } = qualityScore; @@ -35,4 +35,4 @@ function getTable({ qualityScore }) { return table.render(); } -module.exports = getTable; +export default getTable; diff --git a/packages/validator/src/markdown-report/write-file.js b/packages/validator/src/markdown-report/write-file.js index 8cd718602..2e5afb6a3 100644 --- a/packages/validator/src/markdown-report/write-file.js +++ b/packages/validator/src/markdown-report/write-file.js @@ -3,13 +3,13 @@ * SPDX-License-Identifier: Apache2.0 */ -const { writeFileSync } = require('fs'); -const path = require('path'); +import { writeFileSync } from 'fs'; +import { parse, resolve } from 'path'; function writeReportToFile({ currentFilename }, report) { // For now, only a default filename is supported, which // is based on the name of the API definition file. - const { name } = path.parse(currentFilename); + const { name } = parse(currentFilename); const reportFilename = `${name}-validator-report.md`; // Write the output to a file. It will overwrite an existing file. @@ -17,7 +17,7 @@ function writeReportToFile({ currentFilename }, report) { // Return the filename as a confirmation of the success and for // later use in the logs shown to the user. - return path.resolve(process.cwd(), reportFilename); + return resolve(process.cwd(), reportFilename); } -module.exports = writeReportToFile; +export default writeReportToFile; diff --git a/packages/validator/src/scoring-tool/categories.js b/packages/validator/src/scoring-tool/categories.js index d944aa8e6..b5f74a9ef 100644 --- a/packages/validator/src/scoring-tool/categories.js +++ b/packages/validator/src/scoring-tool/categories.js @@ -27,7 +27,7 @@ function getCategoryCoefficient(category) { return categories[category].coefficient; } -module.exports = { +export default { getCategories, getCategoryCoefficient, }; diff --git a/packages/validator/src/scoring-tool/compute-metrics.js b/packages/validator/src/scoring-tool/compute-metrics.js index 8823757ee..a3bae658b 100644 --- a/packages/validator/src/scoring-tool/compute-metrics.js +++ b/packages/validator/src/scoring-tool/compute-metrics.js @@ -3,15 +3,15 @@ * SPDX-License-Identifier: Apache2.0 */ -const { +import { collections, isArraySchema, isBinarySchema, isIntegerSchema, isObjectSchema, isStringSchema, -} = require('@ibm-cloud/openapi-ruleset-utilities'); -const { Metrics } = require('./metrics'); +} from '@ibm-cloud/openapi-ruleset-utilities'; +import { Metrics } from './metrics'; async function computeMetrics(unresolvedApiDef) { // For some metrics, we just want to identify every unique instance @@ -51,6 +51,6 @@ async function computeMetrics(unresolvedApiDef) { return metrics; } -module.exports = { +export default { computeMetrics, }; diff --git a/packages/validator/src/scoring-tool/get-title.js b/packages/validator/src/scoring-tool/get-title.js index e220153cc..1c89a0598 100644 --- a/packages/validator/src/scoring-tool/get-title.js +++ b/packages/validator/src/scoring-tool/get-title.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -const { basename } = require('node:path'); +import { basename } from 'node:path'; // Get the title for an API. function getTitle(apiDef, filename) { @@ -27,6 +27,6 @@ function getTitle(apiDef, filename) { return title; } -module.exports = { +export default { getTitle, }; diff --git a/packages/validator/src/scoring-tool/index.js b/packages/validator/src/scoring-tool/index.js index 3c2898a1d..cd2b80a1f 100644 --- a/packages/validator/src/scoring-tool/index.js +++ b/packages/validator/src/scoring-tool/index.js @@ -3,12 +3,10 @@ * SPDX-License-Identifier: Apache2.0 */ -const { - printCategorizedScoresTable, - printScoringDataTable, -} = require('./output'); -const { scoreResults } = require('./score'); -const { computeMetrics } = require('./compute-metrics'); +import { printCategorizedScoresTable, printScoringDataTable } from './output'; +import { scoreResults } from './score'; +import computeMetricsModule from './compute-metrics.js'; +const { computeMetrics } = computeMetricsModule; async function produceQualityScore( validatorResults, @@ -32,7 +30,7 @@ function printScoreTables({ config }, { qualityScore }) { console.log(); } -module.exports = { +export default { produceQualityScore, printScoreTables, }; diff --git a/packages/validator/src/scoring-tool/metrics.js b/packages/validator/src/scoring-tool/metrics.js index 1d8d5db9c..76a6c2078 100644 --- a/packages/validator/src/scoring-tool/metrics.js +++ b/packages/validator/src/scoring-tool/metrics.js @@ -3,11 +3,9 @@ * SPDX-License-Identifier: Apache2.0 */ -const { - validateNestedSchemas, -} = require('@ibm-cloud/openapi-ruleset-utilities'); -const { Resolver } = require('@stoplight/spectral-ref-resolver'); -const Nimma = require('nimma').default; +import { validateNestedSchemas } from '@ibm-cloud/openapi-ruleset-utilities'; +import { Resolver } from '@stoplight/spectral-ref-resolver'; +import Nimma from 'nimma'; class Metrics { // Holds the callback functions to be paired with each JSONPath. @@ -194,6 +192,6 @@ class Metrics { } } -module.exports = { +export default { Metrics, }; diff --git a/packages/validator/src/scoring-tool/output.js b/packages/validator/src/scoring-tool/output.js index 4e22b610e..0e49fac0a 100644 --- a/packages/validator/src/scoring-tool/output.js +++ b/packages/validator/src/scoring-tool/output.js @@ -3,8 +3,9 @@ * SPDX-License-Identifier: Apache2.0 */ -const { Table } = require('console-table-printer'); -const { getCategories } = require('./categories'); +import { Table } from 'console-table-printer'; +import categoriesModule from './categories.js'; +const { getCategories } = categoriesModule; // Print out a table summarizing the max score for each category. // category | max score @@ -56,7 +57,7 @@ function printScoringDataTable({ scoringData }) { table.printTable(); } -module.exports = { +export default { printCategorizedScoresTable, printScoringDataTable, }; diff --git a/packages/validator/src/scoring-tool/rubric.js b/packages/validator/src/scoring-tool/rubric.js index 24c238540..53bf852a8 100644 --- a/packages/validator/src/scoring-tool/rubric.js +++ b/packages/validator/src/scoring-tool/rubric.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -module.exports = { +export default { 'ibm-accept-and-return-models': { coefficient: 3, denominator: 'operations', diff --git a/packages/validator/src/scoring-tool/score.js b/packages/validator/src/scoring-tool/score.js index a0143e412..0e330ac1b 100644 --- a/packages/validator/src/scoring-tool/score.js +++ b/packages/validator/src/scoring-tool/score.js @@ -3,8 +3,9 @@ * SPDX-License-Identifier: Apache2.0 */ -const { getCategories, getCategoryCoefficient } = require('./categories'); -const rubric = require('./rubric'); +import categoriesModule from './categories.js'; +const { getCategories, getCategoryCoefficient } = categoriesModule; +import rubric from './rubric.js'; /** * Uses the validator results to calculate categorized demerits for each rule @@ -164,7 +165,7 @@ function includeDecimals(value, number) { return parseFloat(value.toFixed(number)); } -module.exports = { +export default { scoreResults, // The following functions are only exported for testing purposes. compute, diff --git a/packages/validator/src/spectral/index.js b/packages/validator/src/spectral/index.js index e10bae1a4..7955c0130 100644 --- a/packages/validator/src/spectral/index.js +++ b/packages/validator/src/spectral/index.js @@ -3,20 +3,18 @@ * SPDX-License-Identifier: Apache2.0 */ -const { Document, Spectral } = require('@stoplight/spectral-core'); -const Parsers = require('@stoplight/spectral-parsers'); -const { - getRuleset, -} = require('@stoplight/spectral-cli/dist/services/linter/utils/getRuleset'); -const ibmRuleset = require('@ibm-cloud/openapi-ruleset'); - -const { +import { Document, Spectral } from '@stoplight/spectral-core'; +import { Json, Yaml } from '@stoplight/spectral-parsers'; +import { getRuleset } from '@stoplight/spectral-cli/dist/services/linter/utils/getRuleset'; +import ibmRuleset from '@ibm-cloud/openapi-ruleset'; + +import { checkRulesetVersion, getFileExtension, getLocalRulesetVersion, -} = require('../cli-validator/utils'); +} from '../cli-validator/utils'; -const { findSpectralRuleset } = require('./utils'); +import { findSpectralRuleset } from './utils'; /** * Creates a Spectral document from the input, runs spectral, converts the results @@ -34,9 +32,9 @@ const runSpectral = async function ({ originalFile, validFile }, context) { const spectral = await setup(context); const fileExtension = getFileExtension(validFile); - let parser = Parsers.Json; + let parser = Json; if (['yaml', 'yml'].includes(fileExtension)) { - parser = Parsers.Yaml; + parser = Yaml; } const doc = new Document(originalFile, parser, validFile); @@ -162,7 +160,7 @@ async function setup({ config, logger }) { return spectral; } -module.exports = { +export default { runSpectral, }; diff --git a/packages/validator/src/spectral/utils.js b/packages/validator/src/spectral/utils.js index 2b26f1581..1d32fbfd2 100644 --- a/packages/validator/src/spectral/utils.js +++ b/packages/validator/src/spectral/utils.js @@ -3,9 +3,9 @@ * SPDX-License-Identifier: Apache2.0 */ -const findUp = require('find-up'); +import findUp from 'find-up'; -module.exports = { +export default { findSpectralRuleset, }; From b277168e9c6a6474baf4168521018e86706ab1ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=ADdia=20Tarcza?= <100163235+diatrcz@users.noreply.github.com> Date: Thu, 11 Jun 2026 16:33:05 +0200 Subject: [PATCH 09/16] build: config esm ruleset test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Lídia Tarcza <100163235+diatrcz@users.noreply.github.com> --- packages/ruleset/test/meta/rule-style.test.js | 2 +- .../test/meta/spectral-depedencies.test.js | 2 +- .../rules/accept-and-return-models.test.js | 9 +- .../ruleset/test/rules/accept-header.test.js | 9 +- .../test/rules/anchored-patterns.test.js | 9 +- .../ruleset/test/rules/api-symmetry.test.js | 9 +- .../test/rules/array-attributes.test.js | 4 +- .../test/rules/array-of-arrays.test.js | 9 +- .../test/rules/array-responses.test.js | 9 +- .../test/rules/authorization-header.test.js | 9 +- .../test/rules/avoid-multiple-types.test.js | 9 +- .../ruleset/test/rules/binary-schemas.test.js | 9 +- .../rules/collection-array-property.test.js | 11 +- .../rules/consecutive-path-segments.test.js | 9 +- .../rules/content-contains-schema.test.js | 9 +- .../test/rules/content-type-header.test.js | 9 +- .../rules/content-type-is-specific.test.js | 9 +- .../ruleset/test/rules/delete-body.test.js | 9 +- .../test/rules/discriminator-property.test.js | 9 +- .../rules/duplicate-path-parameter.test.js | 9 +- .../test/rules/enum-casing-convention.test.js | 9 +- .../test/rules/error-response-schemas.test.js | 9 +- .../test/rules/etag-header-exists.test.js | 9 +- .../examples-name-contains-space.test.js | 9 +- .../rules/if-modified-since-header.test.js | 9 +- .../rules/if-unmodified-since-header.test.js | 9 +- .../ruleset/test/rules/inline-schemas.test.js | 9 +- .../test/rules/integer-attributes.test.js | 9 +- .../test/rules/major-version-in-path.test.js | 9 +- .../test/rules/merge-patch-properties.test.js | 9 +- .../test/rules/no-ambiguous-paths.test.js | 9 +- .../test/rules/no-nullable-properties.test.js | 9 +- .../test/rules/no-ref-in-example.test.js | 9 +- .../test/rules/no-superfluous-allof.test.js | 9 +- .../rules/no-unsupported-keywords.test.js | 9 +- .../rules/operation-summary-exists.test.js | 9 +- .../rules/operation-summary-length.test.js | 9 +- .../operationid-casing-convention.test.js | 9 +- .../operationid-naming-convention.test.js | 9 +- .../test/rules/optional-request-body.test.js | 9 +- .../test/rules/pagination-style.test.js | 10 +- .../rules/parameter-casing-convention.test.js | 9 +- .../test/rules/parameter-default.test.js | 9 +- .../test/rules/parameter-description.test.js | 9 +- .../test/rules/parameter-order.test.js | 9 +- .../rules/parameter-schema-or-content.test.js | 9 +- .../rules/patch-request-content-type.test.js | 9 +- .../test/rules/path-parameter-not-crn.test.js | 9 +- .../path-segment-casing-convention.test.js | 9 +- .../test/rules/pattern-properties.test.js | 9 +- .../test/rules/precondition-headers.test.js | 9 +- .../rules/prefer-token-pagination.test.js | 10 +- .../test/rules/property-attributes.test.js | 9 +- .../rules/property-casing-convention.test.js | 9 +- .../test/rules/property-description.test.js | 9 +- .../rules/property-name-collision.test.js | 9 +- .../test/rules/redirect-response-body.test.js | 9 +- .../ruleset/test/rules/ref-pattern.test.js | 9 +- .../ref-sibling-duplicate-description.test.js | 9 +- .../request-and-response-content.test.js | 9 +- .../test/rules/requestbody-is-object.test.js | 9 +- .../test/rules/requestbody-name.test.js | 9 +- ...uired-array-properties-in-response.test.js | 9 +- ...quired-enum-properties-in-response.test.js | 9 +- .../rules/required-property-missing.test.js | 9 +- .../resource-response-consistency.test.js | 9 +- .../test/rules/response-example.test.js | 9 +- .../test/rules/response-status-codes.test.js | 9 +- .../rules/schema-casing-convention.test.js | 9 +- .../test/rules/schema-description.test.js | 9 +- .../test/rules/schema-keywords.test.js | 9 +- .../rules/schema-naming-convention.test.js | 9 +- .../test/rules/schema-type-format.test.js | 9 +- .../ruleset/test/rules/schema-type.test.js | 9 +- .../rules/securityscheme-attributes.test.js | 9 +- .../test/rules/securityschemes.test.js | 9 +- .../server-variable-default-value.test.js | 9 +- .../test/rules/string-attributes.test.js | 9 +- .../test/rules/summary-sentence-style.test.js | 9 +- .../ruleset/test/rules/typed-enum.test.js | 9 +- .../test/rules/unevaluated-properties.test.js | 9 +- ...e-parameter-request-property-names.test.js | 9 +- .../ruleset/test/rules/unused-tags.test.js | 9 +- .../test/rules/use-date-based-format.test.js | 9 +- .../test/rules/valid-path-segments.test.js | 9 +- .../test/rules/valid-schema-example.test.js | 9 +- .../rules/well-defined-dictionaries.test.js | 9 +- .../test/test-utils/all-schemas-document.js | 340 ++- .../test/test-utils/helper-artifacts.js | 7 +- packages/ruleset/test/test-utils/index.js | 16 +- packages/ruleset/test/test-utils/make-copy.js | 2 +- .../ruleset/test/test-utils/root-document.js | 2154 ++++++++--------- .../ruleset/test/test-utils/severity-codes.js | 10 +- packages/ruleset/test/test-utils/test-rule.js | 4 +- .../ruleset/test/test-utils/unit-test-rule.js | 4 +- .../test/utils/compute-refs-at-paths.test.js | 2 +- packages/ruleset/test/utils/constants.test.js | 2 +- .../test/utils/date-based-utils.test.js | 2 +- .../get-composite-schema-attribute.test.js | 2 +- .../utils/get-resource-oriented-paths.test.js | 2 +- ...get-resource-specific-sibling-path.test.js | 2 +- .../test/utils/get-response-codes.test.js | 2 +- .../utils/get-schema-name-at-path.test.js | 2 +- .../test/utils/is-create-operation.test.js | 2 +- .../ruleset/test/utils/is-deprecated.test.js | 2 +- .../test/utils/is-empty-object-schema.test.js | 2 +- .../test/utils/is-operation-of-type.test.js | 2 +- .../test/utils/is-ref-sibling-schema.test.js | 2 +- .../utils/is-requestbody-exploded.test.js | 2 +- .../merge-allof-schema-properties.test.js | 2 +- .../ruleset/test/utils/mimetype-utils.test.js | 7 +- ...has-minimally-represented-resource.test.js | 2 +- .../test/utils/path-location-utils.test.js | 9 +- .../test/utils/path-matches-regexp.test.js | 2 +- 114 files changed, 1446 insertions(+), 1909 deletions(-) diff --git a/packages/ruleset/test/meta/rule-style.test.js b/packages/ruleset/test/meta/rule-style.test.js index 535fabf17..fe192b9c4 100644 --- a/packages/ruleset/test/meta/rule-style.test.js +++ b/packages/ruleset/test/meta/rule-style.test.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -const rules = require('../../src/rules'); +import rules from '../../src/rules'; // Test cases to enforce rule style describe.each(Object.entries(rules))( diff --git a/packages/ruleset/test/meta/spectral-depedencies.test.js b/packages/ruleset/test/meta/spectral-depedencies.test.js index 624ee18b3..09cd178b5 100644 --- a/packages/ruleset/test/meta/spectral-depedencies.test.js +++ b/packages/ruleset/test/meta/spectral-depedencies.test.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -const { testRule } = require('../test-utils'); +import { testRule } from '../test-utils'; // Test cases for dependencies on subtle and possibly fragile Spectral behavior describe('Spectral behavior dependencies', () => { diff --git a/packages/ruleset/test/rules/accept-and-return-models.test.js b/packages/ruleset/test/rules/accept-and-return-models.test.js index ada383235..a9299395e 100644 --- a/packages/ruleset/test/rules/accept-and-return-models.test.js +++ b/packages/ruleset/test/rules/accept-and-return-models.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { acceptAndReturnModels } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { acceptAndReturnModels } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const rule = acceptAndReturnModels; const ruleId = 'ibm-accept-and-return-models'; diff --git a/packages/ruleset/test/rules/accept-header.test.js b/packages/ruleset/test/rules/accept-header.test.js index 6d1c63d7e..e553f8f2d 100644 --- a/packages/ruleset/test/rules/accept-header.test.js +++ b/packages/ruleset/test/rules/accept-header.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { acceptHeader } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { acceptHeader } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const rule = acceptHeader; const ruleId = 'ibm-no-accept-header'; diff --git a/packages/ruleset/test/rules/anchored-patterns.test.js b/packages/ruleset/test/rules/anchored-patterns.test.js index 4dfaa3e62..a95009140 100644 --- a/packages/ruleset/test/rules/anchored-patterns.test.js +++ b/packages/ruleset/test/rules/anchored-patterns.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { anchoredPatterns } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { anchoredPatterns } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const rule = anchoredPatterns; const ruleId = 'ibm-anchored-patterns'; diff --git a/packages/ruleset/test/rules/api-symmetry.test.js b/packages/ruleset/test/rules/api-symmetry.test.js index bb4d8a24f..7de4e0a76 100644 --- a/packages/ruleset/test/rules/api-symmetry.test.js +++ b/packages/ruleset/test/rules/api-symmetry.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { apiSymmetry } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { apiSymmetry } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const rule = apiSymmetry; const ruleId = 'ibm-api-symmetry'; diff --git a/packages/ruleset/test/rules/array-attributes.test.js b/packages/ruleset/test/rules/array-attributes.test.js index 37cf1cd77..2a2e36b79 100644 --- a/packages/ruleset/test/rules/array-attributes.test.js +++ b/packages/ruleset/test/rules/array-attributes.test.js @@ -3,8 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { arrayAttributes } = require('../../src/rules'); -const { unitTestRule, severityCodes } = require('../test-utils'); +import { arrayAttributes } from '../../src/rules'; +import { unitTestRule, severityCodes } from '../test-utils'; const rule = arrayAttributes; const ruleId = 'ibm-array-attributes'; diff --git a/packages/ruleset/test/rules/array-of-arrays.test.js b/packages/ruleset/test/rules/array-of-arrays.test.js index b6d28c2f3..bf3d8a6bc 100644 --- a/packages/ruleset/test/rules/array-of-arrays.test.js +++ b/packages/ruleset/test/rules/array-of-arrays.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { arrayOfArrays } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { arrayOfArrays } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const rule = arrayOfArrays; const ruleId = 'ibm-no-array-of-arrays'; diff --git a/packages/ruleset/test/rules/array-responses.test.js b/packages/ruleset/test/rules/array-responses.test.js index 2a837e699..9daddb101 100644 --- a/packages/ruleset/test/rules/array-responses.test.js +++ b/packages/ruleset/test/rules/array-responses.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { arrayResponses } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { arrayResponses } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const rule = arrayResponses; const ruleId = 'ibm-no-array-responses'; diff --git a/packages/ruleset/test/rules/authorization-header.test.js b/packages/ruleset/test/rules/authorization-header.test.js index ccd88b851..78b4de70b 100644 --- a/packages/ruleset/test/rules/authorization-header.test.js +++ b/packages/ruleset/test/rules/authorization-header.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { authorizationHeader } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { authorizationHeader } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const rule = authorizationHeader; const ruleId = 'ibm-no-authorization-header'; diff --git a/packages/ruleset/test/rules/avoid-multiple-types.test.js b/packages/ruleset/test/rules/avoid-multiple-types.test.js index 2c0ba529e..6233e2974 100644 --- a/packages/ruleset/test/rules/avoid-multiple-types.test.js +++ b/packages/ruleset/test/rules/avoid-multiple-types.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { avoidMultipleTypes } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { avoidMultipleTypes } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const rule = avoidMultipleTypes; const ruleId = 'ibm-avoid-multiple-types'; diff --git a/packages/ruleset/test/rules/binary-schemas.test.js b/packages/ruleset/test/rules/binary-schemas.test.js index dc6345794..a7857080e 100644 --- a/packages/ruleset/test/rules/binary-schemas.test.js +++ b/packages/ruleset/test/rules/binary-schemas.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { binarySchemas } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { binarySchemas } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const rule = binarySchemas; const ruleId = 'ibm-binary-schemas'; diff --git a/packages/ruleset/test/rules/collection-array-property.test.js b/packages/ruleset/test/rules/collection-array-property.test.js index 5ffa1b61a..b0e3c1bee 100644 --- a/packages/ruleset/test/rules/collection-array-property.test.js +++ b/packages/ruleset/test/rules/collection-array-property.test.js @@ -3,14 +3,9 @@ * SPDX-License-Identifier: Apache2.0 */ -const { collectionArrayProperty } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); -const { LoggerFactory } = require('../../src/utils'); +import { collectionArrayProperty } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; +import { LoggerFactory } from '../../src/utils'; const rule = collectionArrayProperty; const ruleId = 'ibm-collection-array-property'; diff --git a/packages/ruleset/test/rules/consecutive-path-segments.test.js b/packages/ruleset/test/rules/consecutive-path-segments.test.js index b05db1560..c0e46544e 100644 --- a/packages/ruleset/test/rules/consecutive-path-segments.test.js +++ b/packages/ruleset/test/rules/consecutive-path-segments.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { consecutivePathSegments } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { consecutivePathSegments } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const rule = consecutivePathSegments; const ruleId = 'ibm-no-consecutive-path-parameter-segments'; diff --git a/packages/ruleset/test/rules/content-contains-schema.test.js b/packages/ruleset/test/rules/content-contains-schema.test.js index 5c1a386a1..bfe239b1d 100644 --- a/packages/ruleset/test/rules/content-contains-schema.test.js +++ b/packages/ruleset/test/rules/content-contains-schema.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { contentContainsSchema } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { contentContainsSchema } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const ruleId = 'ibm-content-contains-schema'; const rule = contentContainsSchema; diff --git a/packages/ruleset/test/rules/content-type-header.test.js b/packages/ruleset/test/rules/content-type-header.test.js index 82970e5d0..10554611d 100644 --- a/packages/ruleset/test/rules/content-type-header.test.js +++ b/packages/ruleset/test/rules/content-type-header.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { contentTypeHeader } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { contentTypeHeader } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const rule = contentTypeHeader; const ruleId = 'ibm-no-content-type-header'; diff --git a/packages/ruleset/test/rules/content-type-is-specific.test.js b/packages/ruleset/test/rules/content-type-is-specific.test.js index c99a6035c..ee3d39d8b 100644 --- a/packages/ruleset/test/rules/content-type-is-specific.test.js +++ b/packages/ruleset/test/rules/content-type-is-specific.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { contentTypeIsSpecific } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { contentTypeIsSpecific } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const ruleId = 'ibm-content-type-is-specific'; const rule = contentTypeIsSpecific; diff --git a/packages/ruleset/test/rules/delete-body.test.js b/packages/ruleset/test/rules/delete-body.test.js index b5db85d10..0a5f35ac6 100644 --- a/packages/ruleset/test/rules/delete-body.test.js +++ b/packages/ruleset/test/rules/delete-body.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { deleteBody } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { deleteBody } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const rule = deleteBody; const ruleId = 'ibm-no-body-for-delete'; diff --git a/packages/ruleset/test/rules/discriminator-property.test.js b/packages/ruleset/test/rules/discriminator-property.test.js index 71534078c..8715177c8 100644 --- a/packages/ruleset/test/rules/discriminator-property.test.js +++ b/packages/ruleset/test/rules/discriminator-property.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { discriminatorPropertyExists } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { discriminatorPropertyExists } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const ruleId = 'ibm-discriminator-property'; const rule = discriminatorPropertyExists; diff --git a/packages/ruleset/test/rules/duplicate-path-parameter.test.js b/packages/ruleset/test/rules/duplicate-path-parameter.test.js index f34e80b6c..ee63ddf5a 100644 --- a/packages/ruleset/test/rules/duplicate-path-parameter.test.js +++ b/packages/ruleset/test/rules/duplicate-path-parameter.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { duplicatePathParameter } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { duplicatePathParameter } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const rule = duplicatePathParameter; const ruleId = 'ibm-avoid-repeating-path-parameters'; diff --git a/packages/ruleset/test/rules/enum-casing-convention.test.js b/packages/ruleset/test/rules/enum-casing-convention.test.js index 9a4876b9c..1ba99ef8e 100644 --- a/packages/ruleset/test/rules/enum-casing-convention.test.js +++ b/packages/ruleset/test/rules/enum-casing-convention.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { enumCasingConvention } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { enumCasingConvention } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const rule = enumCasingConvention; const ruleId = 'ibm-enum-casing-convention'; diff --git a/packages/ruleset/test/rules/error-response-schemas.test.js b/packages/ruleset/test/rules/error-response-schemas.test.js index 0bb187012..3b49bbc68 100644 --- a/packages/ruleset/test/rules/error-response-schemas.test.js +++ b/packages/ruleset/test/rules/error-response-schemas.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { errorResponseSchemas } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { errorResponseSchemas } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const rule = errorResponseSchemas; const ruleId = 'ibm-error-response-schemas'; diff --git a/packages/ruleset/test/rules/etag-header-exists.test.js b/packages/ruleset/test/rules/etag-header-exists.test.js index 2b707caca..5340529aa 100644 --- a/packages/ruleset/test/rules/etag-header-exists.test.js +++ b/packages/ruleset/test/rules/etag-header-exists.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { etagHeaderExists } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { etagHeaderExists } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const rule = etagHeaderExists; const ruleId = 'ibm-etag-header'; diff --git a/packages/ruleset/test/rules/examples-name-contains-space.test.js b/packages/ruleset/test/rules/examples-name-contains-space.test.js index bfc953a0b..c753c3a64 100644 --- a/packages/ruleset/test/rules/examples-name-contains-space.test.js +++ b/packages/ruleset/test/rules/examples-name-contains-space.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { examplesNameContainsSpace } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { examplesNameContainsSpace } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const ruleId = 'ibm-no-space-in-example-name'; const rule = examplesNameContainsSpace; diff --git a/packages/ruleset/test/rules/if-modified-since-header.test.js b/packages/ruleset/test/rules/if-modified-since-header.test.js index c1ddbea9e..ae94be1fe 100644 --- a/packages/ruleset/test/rules/if-modified-since-header.test.js +++ b/packages/ruleset/test/rules/if-modified-since-header.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { ifModifiedSinceHeader } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { ifModifiedSinceHeader } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const rule = ifModifiedSinceHeader; const ruleId = 'ibm-no-if-modified-since-header'; diff --git a/packages/ruleset/test/rules/if-unmodified-since-header.test.js b/packages/ruleset/test/rules/if-unmodified-since-header.test.js index 33ca2b5d1..f14e51f55 100644 --- a/packages/ruleset/test/rules/if-unmodified-since-header.test.js +++ b/packages/ruleset/test/rules/if-unmodified-since-header.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { ifUnmodifiedSinceHeader } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { ifUnmodifiedSinceHeader } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const rule = ifUnmodifiedSinceHeader; const ruleId = 'ibm-no-if-unmodified-since-header'; diff --git a/packages/ruleset/test/rules/inline-schemas.test.js b/packages/ruleset/test/rules/inline-schemas.test.js index da8ea7777..be8ab9741 100644 --- a/packages/ruleset/test/rules/inline-schemas.test.js +++ b/packages/ruleset/test/rules/inline-schemas.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { inlineSchemas } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { inlineSchemas } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const rule = inlineSchemas; const ruleId = 'ibm-avoid-inline-schemas'; diff --git a/packages/ruleset/test/rules/integer-attributes.test.js b/packages/ruleset/test/rules/integer-attributes.test.js index 5687de888..44c0e1326 100644 --- a/packages/ruleset/test/rules/integer-attributes.test.js +++ b/packages/ruleset/test/rules/integer-attributes.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { integerAttributes } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { integerAttributes } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const rule = integerAttributes; const ruleId = 'ibm-integer-attributes'; diff --git a/packages/ruleset/test/rules/major-version-in-path.test.js b/packages/ruleset/test/rules/major-version-in-path.test.js index 89deeab38..b09962096 100644 --- a/packages/ruleset/test/rules/major-version-in-path.test.js +++ b/packages/ruleset/test/rules/major-version-in-path.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { majorVersionInPath } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { majorVersionInPath } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const ruleId = 'ibm-major-version-in-path'; const rule = majorVersionInPath; diff --git a/packages/ruleset/test/rules/merge-patch-properties.test.js b/packages/ruleset/test/rules/merge-patch-properties.test.js index a061d324e..d80a80008 100644 --- a/packages/ruleset/test/rules/merge-patch-properties.test.js +++ b/packages/ruleset/test/rules/merge-patch-properties.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { mergePatchProperties } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { mergePatchProperties } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const rule = mergePatchProperties; const ruleId = 'ibm-dont-require-merge-patch-properties'; diff --git a/packages/ruleset/test/rules/no-ambiguous-paths.test.js b/packages/ruleset/test/rules/no-ambiguous-paths.test.js index dffb321ac..74f6cea78 100644 --- a/packages/ruleset/test/rules/no-ambiguous-paths.test.js +++ b/packages/ruleset/test/rules/no-ambiguous-paths.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); -const { noAmbiguousPaths } = require('../../src/rules'); +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; +import { noAmbiguousPaths } from '../../src/rules'; const rule = noAmbiguousPaths; const ruleId = 'ibm-no-ambiguous-paths'; diff --git a/packages/ruleset/test/rules/no-nullable-properties.test.js b/packages/ruleset/test/rules/no-nullable-properties.test.js index 210da346e..04bff1636 100644 --- a/packages/ruleset/test/rules/no-nullable-properties.test.js +++ b/packages/ruleset/test/rules/no-nullable-properties.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); -const { noNullableProperties } = require('../../src/rules'); +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; +import { noNullableProperties } from '../../src/rules'; const rule = noNullableProperties; const ruleId = 'ibm-no-nullable-properties'; diff --git a/packages/ruleset/test/rules/no-ref-in-example.test.js b/packages/ruleset/test/rules/no-ref-in-example.test.js index 256eff4c6..d8e70db86 100644 --- a/packages/ruleset/test/rules/no-ref-in-example.test.js +++ b/packages/ruleset/test/rules/no-ref-in-example.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { noRefInExample } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { noRefInExample } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const rule = noRefInExample; const ruleId = 'ibm-no-ref-in-example'; diff --git a/packages/ruleset/test/rules/no-superfluous-allof.test.js b/packages/ruleset/test/rules/no-superfluous-allof.test.js index 1e282575f..1fd8c5594 100644 --- a/packages/ruleset/test/rules/no-superfluous-allof.test.js +++ b/packages/ruleset/test/rules/no-superfluous-allof.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { noSuperfluousAllOf } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { noSuperfluousAllOf } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const rule = noSuperfluousAllOf; const ruleId = 'ibm-no-superfluous-allof'; diff --git a/packages/ruleset/test/rules/no-unsupported-keywords.test.js b/packages/ruleset/test/rules/no-unsupported-keywords.test.js index 786b04fc5..7b31e4ccc 100644 --- a/packages/ruleset/test/rules/no-unsupported-keywords.test.js +++ b/packages/ruleset/test/rules/no-unsupported-keywords.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { noUnsupportedKeywords } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { noUnsupportedKeywords } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const rule = noUnsupportedKeywords; const ruleId = 'ibm-no-unsupported-keywords'; diff --git a/packages/ruleset/test/rules/operation-summary-exists.test.js b/packages/ruleset/test/rules/operation-summary-exists.test.js index bfd47d0df..74ff3bff0 100644 --- a/packages/ruleset/test/rules/operation-summary-exists.test.js +++ b/packages/ruleset/test/rules/operation-summary-exists.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { operationSummaryExists } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { operationSummaryExists } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const rule = operationSummaryExists; const ruleId = 'ibm-operation-summary'; diff --git a/packages/ruleset/test/rules/operation-summary-length.test.js b/packages/ruleset/test/rules/operation-summary-length.test.js index a7fb73cc2..6d7221126 100644 --- a/packages/ruleset/test/rules/operation-summary-length.test.js +++ b/packages/ruleset/test/rules/operation-summary-length.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { operationSummaryLength } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { operationSummaryLength } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const rule = operationSummaryLength; const ruleId = 'ibm-operation-summary'; diff --git a/packages/ruleset/test/rules/operationid-casing-convention.test.js b/packages/ruleset/test/rules/operationid-casing-convention.test.js index ab27fa76f..4268541c5 100644 --- a/packages/ruleset/test/rules/operationid-casing-convention.test.js +++ b/packages/ruleset/test/rules/operationid-casing-convention.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { operationIdCasingConvention } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { operationIdCasingConvention } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const rule = operationIdCasingConvention; const ruleId = 'ibm-operationid-casing-convention'; diff --git a/packages/ruleset/test/rules/operationid-naming-convention.test.js b/packages/ruleset/test/rules/operationid-naming-convention.test.js index e7808680b..130430fb1 100644 --- a/packages/ruleset/test/rules/operationid-naming-convention.test.js +++ b/packages/ruleset/test/rules/operationid-naming-convention.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { operationIdNamingConvention } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { operationIdNamingConvention } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const rule = operationIdNamingConvention; const ruleId = 'ibm-operation-id-naming-convention'; diff --git a/packages/ruleset/test/rules/optional-request-body.test.js b/packages/ruleset/test/rules/optional-request-body.test.js index 6aacbcb1f..fa1785f98 100644 --- a/packages/ruleset/test/rules/optional-request-body.test.js +++ b/packages/ruleset/test/rules/optional-request-body.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { optionalRequestBody } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { optionalRequestBody } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const rule = optionalRequestBody; const ruleId = 'ibm-optional-requestbody'; diff --git a/packages/ruleset/test/rules/pagination-style.test.js b/packages/ruleset/test/rules/pagination-style.test.js index bd28873dc..4f94671e0 100644 --- a/packages/ruleset/test/rules/pagination-style.test.js +++ b/packages/ruleset/test/rules/pagination-style.test.js @@ -3,14 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { paginationStyle } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, - helperArtifacts, -} = require('../test-utils'); +import { paginationStyle } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes, helperArtifacts } from '../test-utils'; // These are pre-defined objects with correct style for offset/limit pagination // to use as a baseline. They aren't used in the root document because overall, diff --git a/packages/ruleset/test/rules/parameter-casing-convention.test.js b/packages/ruleset/test/rules/parameter-casing-convention.test.js index b6f828b57..ff12357a3 100644 --- a/packages/ruleset/test/rules/parameter-casing-convention.test.js +++ b/packages/ruleset/test/rules/parameter-casing-convention.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { parameterCasingConvention } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { parameterCasingConvention } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const rule = parameterCasingConvention; const ruleId = 'ibm-parameter-casing-convention'; diff --git a/packages/ruleset/test/rules/parameter-default.test.js b/packages/ruleset/test/rules/parameter-default.test.js index 0386023f2..cca868160 100644 --- a/packages/ruleset/test/rules/parameter-default.test.js +++ b/packages/ruleset/test/rules/parameter-default.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { parameterDefault } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { parameterDefault } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const rule = parameterDefault; const ruleId = 'ibm-no-default-for-required-parameter'; diff --git a/packages/ruleset/test/rules/parameter-description.test.js b/packages/ruleset/test/rules/parameter-description.test.js index fe354c57e..28cbf6121 100644 --- a/packages/ruleset/test/rules/parameter-description.test.js +++ b/packages/ruleset/test/rules/parameter-description.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { parameterDescriptionExists } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { parameterDescriptionExists } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const rule = parameterDescriptionExists; const ruleId = 'ibm-parameter-description'; diff --git a/packages/ruleset/test/rules/parameter-order.test.js b/packages/ruleset/test/rules/parameter-order.test.js index 93fa4e158..ac5d19073 100644 --- a/packages/ruleset/test/rules/parameter-order.test.js +++ b/packages/ruleset/test/rules/parameter-order.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { parameterOrder } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { parameterOrder } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const rule = parameterOrder; const ruleId = 'ibm-parameter-order'; diff --git a/packages/ruleset/test/rules/parameter-schema-or-content.test.js b/packages/ruleset/test/rules/parameter-schema-or-content.test.js index c4142784b..79e1ddfa8 100644 --- a/packages/ruleset/test/rules/parameter-schema-or-content.test.js +++ b/packages/ruleset/test/rules/parameter-schema-or-content.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { parameterSchemaOrContentExists } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { parameterSchemaOrContentExists } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const ruleId = 'ibm-parameter-schema-or-content'; const rule = parameterSchemaOrContentExists; diff --git a/packages/ruleset/test/rules/patch-request-content-type.test.js b/packages/ruleset/test/rules/patch-request-content-type.test.js index dd36db241..548a597e4 100644 --- a/packages/ruleset/test/rules/patch-request-content-type.test.js +++ b/packages/ruleset/test/rules/patch-request-content-type.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { patchRequestContentType } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { patchRequestContentType } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const rule = patchRequestContentType; const ruleId = 'ibm-patch-request-content-type'; diff --git a/packages/ruleset/test/rules/path-parameter-not-crn.test.js b/packages/ruleset/test/rules/path-parameter-not-crn.test.js index ca12e4920..bc381fa02 100644 --- a/packages/ruleset/test/rules/path-parameter-not-crn.test.js +++ b/packages/ruleset/test/rules/path-parameter-not-crn.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { pathParameterNotCRN } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { pathParameterNotCRN } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const rule = pathParameterNotCRN; const ruleId = 'ibm-no-crn-path-parameters'; diff --git a/packages/ruleset/test/rules/path-segment-casing-convention.test.js b/packages/ruleset/test/rules/path-segment-casing-convention.test.js index e1ba416dd..a90aa211d 100644 --- a/packages/ruleset/test/rules/path-segment-casing-convention.test.js +++ b/packages/ruleset/test/rules/path-segment-casing-convention.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { pathSegmentCasingConvention } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { pathSegmentCasingConvention } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const rule = pathSegmentCasingConvention; const ruleId = 'ibm-path-segment-casing-convention'; diff --git a/packages/ruleset/test/rules/pattern-properties.test.js b/packages/ruleset/test/rules/pattern-properties.test.js index 68cbd0f88..6e450c3e8 100644 --- a/packages/ruleset/test/rules/pattern-properties.test.js +++ b/packages/ruleset/test/rules/pattern-properties.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { patternProperties } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { patternProperties } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const rule = patternProperties; const ruleId = 'ibm-pattern-properties'; diff --git a/packages/ruleset/test/rules/precondition-headers.test.js b/packages/ruleset/test/rules/precondition-headers.test.js index 097ab4f98..f179551e0 100644 --- a/packages/ruleset/test/rules/precondition-headers.test.js +++ b/packages/ruleset/test/rules/precondition-headers.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { preconditionHeader } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { preconditionHeader } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const rule = preconditionHeader; const ruleId = 'ibm-precondition-headers'; diff --git a/packages/ruleset/test/rules/prefer-token-pagination.test.js b/packages/ruleset/test/rules/prefer-token-pagination.test.js index 784e6d7fc..b7f180d6f 100644 --- a/packages/ruleset/test/rules/prefer-token-pagination.test.js +++ b/packages/ruleset/test/rules/prefer-token-pagination.test.js @@ -3,14 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { preferTokenPagination } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, - helperArtifacts, -} = require('../test-utils'); +import { preferTokenPagination } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes, helperArtifacts } from '../test-utils'; const { offsetPaginationBase, offsetParameter } = helperArtifacts; const rule = preferTokenPagination; diff --git a/packages/ruleset/test/rules/property-attributes.test.js b/packages/ruleset/test/rules/property-attributes.test.js index 50f8d293e..a06229d40 100644 --- a/packages/ruleset/test/rules/property-attributes.test.js +++ b/packages/ruleset/test/rules/property-attributes.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { propertyAttributes } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { propertyAttributes } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const rule = propertyAttributes; const ruleId = 'ibm-property-attributes'; diff --git a/packages/ruleset/test/rules/property-casing-convention.test.js b/packages/ruleset/test/rules/property-casing-convention.test.js index e2e09fda5..874aaef71 100644 --- a/packages/ruleset/test/rules/property-casing-convention.test.js +++ b/packages/ruleset/test/rules/property-casing-convention.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { propertyCasingConvention } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { propertyCasingConvention } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const ruleId = 'ibm-property-casing-convention'; const rule = propertyCasingConvention; diff --git a/packages/ruleset/test/rules/property-description.test.js b/packages/ruleset/test/rules/property-description.test.js index 4370469b4..3e70ef60d 100644 --- a/packages/ruleset/test/rules/property-description.test.js +++ b/packages/ruleset/test/rules/property-description.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { propertyDescriptionExists } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { propertyDescriptionExists } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const rule = propertyDescriptionExists; const ruleId = 'ibm-property-description'; diff --git a/packages/ruleset/test/rules/property-name-collision.test.js b/packages/ruleset/test/rules/property-name-collision.test.js index bd2435afc..e2c16ad10 100644 --- a/packages/ruleset/test/rules/property-name-collision.test.js +++ b/packages/ruleset/test/rules/property-name-collision.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { propertyNameCollision } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { propertyNameCollision } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const ruleId = 'ibm-avoid-property-name-collision'; const rule = propertyNameCollision; diff --git a/packages/ruleset/test/rules/redirect-response-body.test.js b/packages/ruleset/test/rules/redirect-response-body.test.js index 1e38058ae..0438e324d 100644 --- a/packages/ruleset/test/rules/redirect-response-body.test.js +++ b/packages/ruleset/test/rules/redirect-response-body.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { redirectResponseBody } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { redirectResponseBody } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const rule = redirectResponseBody; const ruleId = 'ibm-redirect-response-body'; diff --git a/packages/ruleset/test/rules/ref-pattern.test.js b/packages/ruleset/test/rules/ref-pattern.test.js index f58f300ff..58655c28b 100644 --- a/packages/ruleset/test/rules/ref-pattern.test.js +++ b/packages/ruleset/test/rules/ref-pattern.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { refPattern } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { refPattern } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const rule = refPattern; const ruleId = 'ibm-ref-pattern'; diff --git a/packages/ruleset/test/rules/ref-sibling-duplicate-description.test.js b/packages/ruleset/test/rules/ref-sibling-duplicate-description.test.js index 814935335..7b938f792 100644 --- a/packages/ruleset/test/rules/ref-sibling-duplicate-description.test.js +++ b/packages/ruleset/test/rules/ref-sibling-duplicate-description.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { refSiblingDuplicateDescription } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { refSiblingDuplicateDescription } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const rule = refSiblingDuplicateDescription; const ruleId = 'ibm-no-duplication-description-with-ref-sibling'; diff --git a/packages/ruleset/test/rules/request-and-response-content.test.js b/packages/ruleset/test/rules/request-and-response-content.test.js index 199a8475a..d4115de9c 100644 --- a/packages/ruleset/test/rules/request-and-response-content.test.js +++ b/packages/ruleset/test/rules/request-and-response-content.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { requestAndResponseContent } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { requestAndResponseContent } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const ruleId = 'ibm-request-and-response-content'; const rule = requestAndResponseContent; diff --git a/packages/ruleset/test/rules/requestbody-is-object.test.js b/packages/ruleset/test/rules/requestbody-is-object.test.js index 73a0a646e..f5eb935f0 100644 --- a/packages/ruleset/test/rules/requestbody-is-object.test.js +++ b/packages/ruleset/test/rules/requestbody-is-object.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { requestBodyIsObject } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { requestBodyIsObject } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const ruleId = 'ibm-requestbody-is-object'; const rule = requestBodyIsObject; diff --git a/packages/ruleset/test/rules/requestbody-name.test.js b/packages/ruleset/test/rules/requestbody-name.test.js index b5d24e3ee..c96b6befc 100644 --- a/packages/ruleset/test/rules/requestbody-name.test.js +++ b/packages/ruleset/test/rules/requestbody-name.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { requestBodyName } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { requestBodyName } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const ruleId = 'ibm-requestbody-name'; const rule = requestBodyName; diff --git a/packages/ruleset/test/rules/required-array-properties-in-response.test.js b/packages/ruleset/test/rules/required-array-properties-in-response.test.js index c80273e75..179a8948e 100644 --- a/packages/ruleset/test/rules/required-array-properties-in-response.test.js +++ b/packages/ruleset/test/rules/required-array-properties-in-response.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { requiredArrayPropertiesInResponse } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { requiredArrayPropertiesInResponse } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const rule = requiredArrayPropertiesInResponse; const ruleId = 'ibm-required-array-properties-in-response'; diff --git a/packages/ruleset/test/rules/required-enum-properties-in-response.test.js b/packages/ruleset/test/rules/required-enum-properties-in-response.test.js index 034d092d9..e86133335 100644 --- a/packages/ruleset/test/rules/required-enum-properties-in-response.test.js +++ b/packages/ruleset/test/rules/required-enum-properties-in-response.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { requiredEnumPropertiesInResponse } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { requiredEnumPropertiesInResponse } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const rule = requiredEnumPropertiesInResponse; const ruleId = 'ibm-required-enum-properties-in-response'; diff --git a/packages/ruleset/test/rules/required-property-missing.test.js b/packages/ruleset/test/rules/required-property-missing.test.js index eaeb57600..3024785c2 100644 --- a/packages/ruleset/test/rules/required-property-missing.test.js +++ b/packages/ruleset/test/rules/required-property-missing.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { requiredPropertyMissing } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { requiredPropertyMissing } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const ruleId = 'ibm-define-required-properties'; const rule = requiredPropertyMissing; diff --git a/packages/ruleset/test/rules/resource-response-consistency.test.js b/packages/ruleset/test/rules/resource-response-consistency.test.js index f54dc6573..fb129b0f1 100644 --- a/packages/ruleset/test/rules/resource-response-consistency.test.js +++ b/packages/ruleset/test/rules/resource-response-consistency.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { resourceResponseConsistency } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { resourceResponseConsistency } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const rule = resourceResponseConsistency; const ruleId = 'ibm-resource-response-consistency'; diff --git a/packages/ruleset/test/rules/response-example.test.js b/packages/ruleset/test/rules/response-example.test.js index 3060f21e5..7fb6ae81f 100644 --- a/packages/ruleset/test/rules/response-example.test.js +++ b/packages/ruleset/test/rules/response-example.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { responseExampleExists } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { responseExampleExists } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const ruleId = 'ibm-success-response-example'; const rule = responseExampleExists; diff --git a/packages/ruleset/test/rules/response-status-codes.test.js b/packages/ruleset/test/rules/response-status-codes.test.js index 7cdeb2b51..195eb2384 100644 --- a/packages/ruleset/test/rules/response-status-codes.test.js +++ b/packages/ruleset/test/rules/response-status-codes.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { responseStatusCodes } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { responseStatusCodes } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const rule = responseStatusCodes; const ruleId = 'ibm-response-status-codes'; diff --git a/packages/ruleset/test/rules/schema-casing-convention.test.js b/packages/ruleset/test/rules/schema-casing-convention.test.js index 67a890878..deda3cb85 100644 --- a/packages/ruleset/test/rules/schema-casing-convention.test.js +++ b/packages/ruleset/test/rules/schema-casing-convention.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { schemaCasingConvention } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { schemaCasingConvention } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const rule = schemaCasingConvention; const ruleId = 'ibm-schema-casing-convention'; diff --git a/packages/ruleset/test/rules/schema-description.test.js b/packages/ruleset/test/rules/schema-description.test.js index c0d8dad96..45b0785dd 100644 --- a/packages/ruleset/test/rules/schema-description.test.js +++ b/packages/ruleset/test/rules/schema-description.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { schemaDescriptionExists } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { schemaDescriptionExists } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const rule = schemaDescriptionExists; const ruleId = 'ibm-schema-description'; diff --git a/packages/ruleset/test/rules/schema-keywords.test.js b/packages/ruleset/test/rules/schema-keywords.test.js index adc070e06..086821486 100644 --- a/packages/ruleset/test/rules/schema-keywords.test.js +++ b/packages/ruleset/test/rules/schema-keywords.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { schemaKeywords } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { schemaKeywords } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const rule = schemaKeywords; const ruleId = 'ibm-schema-keywords'; diff --git a/packages/ruleset/test/rules/schema-naming-convention.test.js b/packages/ruleset/test/rules/schema-naming-convention.test.js index 3d2c4b198..e3326791e 100644 --- a/packages/ruleset/test/rules/schema-naming-convention.test.js +++ b/packages/ruleset/test/rules/schema-naming-convention.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { schemaNamingConvention } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { schemaNamingConvention } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const rule = schemaNamingConvention; const ruleId = 'ibm-schema-naming-convention'; diff --git a/packages/ruleset/test/rules/schema-type-format.test.js b/packages/ruleset/test/rules/schema-type-format.test.js index 1e3bf4635..0a1fc0a08 100644 --- a/packages/ruleset/test/rules/schema-type-format.test.js +++ b/packages/ruleset/test/rules/schema-type-format.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { schemaTypeFormat } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { schemaTypeFormat } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const rule = schemaTypeFormat; const ruleId = 'ibm-schema-type-format'; diff --git a/packages/ruleset/test/rules/schema-type.test.js b/packages/ruleset/test/rules/schema-type.test.js index 8e3b146f5..f624702a7 100644 --- a/packages/ruleset/test/rules/schema-type.test.js +++ b/packages/ruleset/test/rules/schema-type.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { schemaTypeExists } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { schemaTypeExists } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const rule = schemaTypeExists; // this rule is turned off by default - enable it to run tests diff --git a/packages/ruleset/test/rules/securityscheme-attributes.test.js b/packages/ruleset/test/rules/securityscheme-attributes.test.js index 29b0d8ccc..e42c8d6e8 100644 --- a/packages/ruleset/test/rules/securityscheme-attributes.test.js +++ b/packages/ruleset/test/rules/securityscheme-attributes.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { securitySchemeAttributes } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { securitySchemeAttributes } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const rule = securitySchemeAttributes; const ruleId = 'ibm-security-scheme-attributes'; diff --git a/packages/ruleset/test/rules/securityschemes.test.js b/packages/ruleset/test/rules/securityschemes.test.js index b6b49d15e..288a11d68 100644 --- a/packages/ruleset/test/rules/securityschemes.test.js +++ b/packages/ruleset/test/rules/securityschemes.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { securitySchemes } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { securitySchemes } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const rule = securitySchemes; const ruleId = 'ibm-securityschemes'; diff --git a/packages/ruleset/test/rules/server-variable-default-value.test.js b/packages/ruleset/test/rules/server-variable-default-value.test.js index 6de469850..9b421c2e8 100644 --- a/packages/ruleset/test/rules/server-variable-default-value.test.js +++ b/packages/ruleset/test/rules/server-variable-default-value.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { serverVariableDefaultValue } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { serverVariableDefaultValue } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const ruleId = 'ibm-server-variable-default-value'; const rule = serverVariableDefaultValue; diff --git a/packages/ruleset/test/rules/string-attributes.test.js b/packages/ruleset/test/rules/string-attributes.test.js index 8baca3bab..24b3f9d38 100644 --- a/packages/ruleset/test/rules/string-attributes.test.js +++ b/packages/ruleset/test/rules/string-attributes.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { stringAttributes } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { stringAttributes } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const rule = stringAttributes; const ruleId = 'ibm-string-attributes'; diff --git a/packages/ruleset/test/rules/summary-sentence-style.test.js b/packages/ruleset/test/rules/summary-sentence-style.test.js index fbb7ec527..73df91280 100644 --- a/packages/ruleset/test/rules/summary-sentence-style.test.js +++ b/packages/ruleset/test/rules/summary-sentence-style.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { summarySentenceStyle } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { summarySentenceStyle } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const ruleId = 'ibm-summary-sentence-style'; const rule = summarySentenceStyle; diff --git a/packages/ruleset/test/rules/typed-enum.test.js b/packages/ruleset/test/rules/typed-enum.test.js index 509f444bf..a1c7edfc2 100644 --- a/packages/ruleset/test/rules/typed-enum.test.js +++ b/packages/ruleset/test/rules/typed-enum.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { typedEnum } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { typedEnum } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const rule = typedEnum; const ruleId = 'typed-enum'; diff --git a/packages/ruleset/test/rules/unevaluated-properties.test.js b/packages/ruleset/test/rules/unevaluated-properties.test.js index e6889fdec..d3eb3ffaa 100644 --- a/packages/ruleset/test/rules/unevaluated-properties.test.js +++ b/packages/ruleset/test/rules/unevaluated-properties.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { unevaluatedProperties } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { unevaluatedProperties } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const rule = unevaluatedProperties; const ruleId = 'ibm-unevaluated-properties'; diff --git a/packages/ruleset/test/rules/unique-parameter-request-property-names.test.js b/packages/ruleset/test/rules/unique-parameter-request-property-names.test.js index bde9fc1c1..013ebe728 100644 --- a/packages/ruleset/test/rules/unique-parameter-request-property-names.test.js +++ b/packages/ruleset/test/rules/unique-parameter-request-property-names.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { uniqueParameterRequestPropertyNames } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { uniqueParameterRequestPropertyNames } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const rule = uniqueParameterRequestPropertyNames; const ruleId = 'ibm-unique-parameter-request-property-names'; diff --git a/packages/ruleset/test/rules/unused-tags.test.js b/packages/ruleset/test/rules/unused-tags.test.js index 4423cdb31..3102d2b86 100644 --- a/packages/ruleset/test/rules/unused-tags.test.js +++ b/packages/ruleset/test/rules/unused-tags.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { unusedTags } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { unusedTags } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const rule = unusedTags; const ruleId = 'ibm-openapi-tags-used'; diff --git a/packages/ruleset/test/rules/use-date-based-format.test.js b/packages/ruleset/test/rules/use-date-based-format.test.js index 86d9dda5e..3a32673df 100644 --- a/packages/ruleset/test/rules/use-date-based-format.test.js +++ b/packages/ruleset/test/rules/use-date-based-format.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { useDateBasedFormat } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { useDateBasedFormat } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const rule = useDateBasedFormat; const ruleId = 'ibm-use-date-based-format'; diff --git a/packages/ruleset/test/rules/valid-path-segments.test.js b/packages/ruleset/test/rules/valid-path-segments.test.js index 0cf2cf59a..7197959ee 100644 --- a/packages/ruleset/test/rules/valid-path-segments.test.js +++ b/packages/ruleset/test/rules/valid-path-segments.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { validPathSegments } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { validPathSegments } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const rule = validPathSegments; const ruleId = 'ibm-valid-path-segments'; diff --git a/packages/ruleset/test/rules/valid-schema-example.test.js b/packages/ruleset/test/rules/valid-schema-example.test.js index 4c1ca4ff7..39cc7cc8a 100644 --- a/packages/ruleset/test/rules/valid-schema-example.test.js +++ b/packages/ruleset/test/rules/valid-schema-example.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { validSchemaExample } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { validSchemaExample } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const rule = validSchemaExample; const ruleId = 'ibm-valid-schema-example'; diff --git a/packages/ruleset/test/rules/well-defined-dictionaries.test.js b/packages/ruleset/test/rules/well-defined-dictionaries.test.js index 9da5c17d4..b2d28eb09 100644 --- a/packages/ruleset/test/rules/well-defined-dictionaries.test.js +++ b/packages/ruleset/test/rules/well-defined-dictionaries.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { wellDefinedDictionaries } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { wellDefinedDictionaries } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const rule = wellDefinedDictionaries; const ruleId = 'ibm-well-defined-dictionaries'; diff --git a/packages/ruleset/test/test-utils/all-schemas-document.js b/packages/ruleset/test/test-utils/all-schemas-document.js index 882aa1c04..40261dc9e 100644 --- a/packages/ruleset/test/test-utils/all-schemas-document.js +++ b/packages/ruleset/test/test-utils/all-schemas-document.js @@ -3,62 +3,59 @@ * SPDX-License-Identifier: Apache2.0 */ -module.exports = { - openapi: '3.0.2', - info: { - title: 'Subschema examples', - description: - 'A collection of schemas with various kinds of subschemas for testing.', - version: '0.0.1', - contact: { - email: 'example@example.com', - }, +export const openapi = '3.0.2'; +export const info = { + title: 'Subschema examples', + description: 'A collection of schemas with various kinds of subschemas for testing.', + version: '0.0.1', + contact: { + email: 'example@example.com', + }, +}; +export const tags = [ + { + name: 'Index', + }, +]; +export const servers = [ + { + url: '/api/v3', }, - tags: [ - { - name: 'Index', - }, - ], - servers: [ - { - url: '/api/v3', - }, - ], - paths: { - '/schema': { - get: { - tags: ['Index'], - summary: 'Get the index', - description: 'Get the index.', - operationId: 'get_index', - responses: { - 200: { - description: "Here's the index.", - content: { - 'application/json': { - schema: { - $ref: '#/components/schemas/Index', - }, +]; +export const paths = { + '/schema': { + get: { + tags: ['Index'], + summary: 'Get the index', + description: 'Get the index.', + operationId: 'get_index', + responses: { + 200: { + description: "Here's the index.", + content: { + 'application/json': { + schema: { + $ref: '#/components/schemas/Index', }, }, }, }, }, }, - '/every_flavor': { - get: { - tags: ['Index'], - summary: 'Get every flavor', - description: 'Get every flavor.', - operationId: 'get_every_flavor', - responses: { - 200: { - description: "Here's every flavor.", - content: { - 'application/json': { - schema: { - $ref: '#/components/schemas/EveryFlavor', - }, + }, + '/every_flavor': { + get: { + tags: ['Index'], + summary: 'Get every flavor', + description: 'Get every flavor.', + operationId: 'get_every_flavor', + responses: { + 200: { + description: "Here's every flavor.", + content: { + 'application/json': { + schema: { + $ref: '#/components/schemas/EveryFlavor', }, }, }, @@ -66,150 +63,143 @@ module.exports = { }, }, }, - components: { - schemas: { - Index: { - type: 'object', - properties: { - schema_with_property_schema: { - $ref: '#/components/schemas/SchemaWithPropertySchema', - }, - schema_with_additional_properties_schema: { - $ref: '#/components/schemas/SchemaWithAdditionalPropertiesSchema', - }, - schema_with_items_schema: { - $ref: '#/components/schemas/SchemaWithItemsSchema', - }, - schema_with_all_of_schema: { - $ref: '#/components/schemas/SchemaWithAllOfSchema', - }, - schema_with_one_of_schema: { - $ref: '#/components/schemas/SchemaWithOneOfSchema', - }, - schema_with_any_of_schema: { - $ref: '#/components/schemas/SchemaWithAnyOfSchema', - }, - schema_with_not_schema: { - $ref: '#/components/schemas/SchemaWithNotSchema', - }, +}; +export const components = { + schemas: { + Index: { + type: 'object', + properties: { + schema_with_property_schema: { + $ref: '#/components/schemas/SchemaWithPropertySchema', }, - }, - EveryFlavor: { - properties: { - property_schema: { - $ref: '#/components/schemas/SchemaWithPropertySchema', - }, + schema_with_additional_properties_schema: { + $ref: '#/components/schemas/SchemaWithAdditionalPropertiesSchema', }, - additionalProperties: { - $ref: '#/components/schemas/AdditionalPropertiesSchema', + schema_with_items_schema: { + $ref: '#/components/schemas/SchemaWithItemsSchema', }, - items: { - $ref: '#/components/schemas/ItemsSchema', + schema_with_all_of_schema: { + $ref: '#/components/schemas/SchemaWithAllOfSchema', }, - allOf: [ - { - $ref: '#/components/schemas/AllOfSchema', - }, - ], - oneOf: [ - { - $ref: '#/components/schemas/OneOfSchema', - }, - ], - anyOf: [ - { - $ref: '#/components/schemas/AnyOfSchema', - }, - ], - not: { - $ref: '#/components/schemas/NotSchema', + schema_with_one_of_schema: { + $ref: '#/components/schemas/SchemaWithOneOfSchema', }, - }, - SchemaWithPropertySchema: { - type: 'object', - properties: { - property_schema: { - $ref: '#/components/schemas/PropertySchema', - }, + schema_with_any_of_schema: { + $ref: '#/components/schemas/SchemaWithAnyOfSchema', }, - }, - PropertySchema: { - type: 'string', - description: - 'This schema is reachable from `EveryFlavor` and `SchemaWithPropertySchema`.', - }, - SchemaWithAdditionalPropertiesSchema: { - type: 'object', - additionalProperties: { - $ref: '#/components/schemas/AdditionalPropertiesSchema', + schema_with_not_schema: { + $ref: '#/components/schemas/SchemaWithNotSchema', }, }, - AdditionalPropertiesSchema: { - type: 'string', - description: - 'This schema is reachable from `EveryFlavor` and `SchemaWithAdditionalPropertiesSchema`.', - }, - SchemaWithItemsSchema: { - type: 'array', - items: { - $ref: '#/components/schemas/ItemsSchema', + }, + EveryFlavor: { + properties: { + property_schema: { + $ref: '#/components/schemas/SchemaWithPropertySchema', }, }, - ItemsSchema: { - type: 'string', - description: - 'This schema is reachable from `EveryFlavor` and `SchemaWithItemsSchema`.', + additionalProperties: { + $ref: '#/components/schemas/AdditionalPropertiesSchema', }, - SchemaWithAllOfSchema: { - type: 'string', - allOf: [ - { - $ref: '#/components/schemas/AllOfSchema', - }, - ], + items: { + $ref: '#/components/schemas/ItemsSchema', }, - AllOfSchema: { - type: 'string', - description: - 'This schema is reachable from `EveryFlavor` and `SchemaWithAllOfSchema`.', - }, - SchemaWithOneOfSchema: { - type: 'string', - oneOf: [ - { - $ref: '#/components/schemas/OneOfSchema', - }, - ], + allOf: [ + { + $ref: '#/components/schemas/AllOfSchema', + }, + ], + oneOf: [ + { + $ref: '#/components/schemas/OneOfSchema', + }, + ], + anyOf: [ + { + $ref: '#/components/schemas/AnyOfSchema', + }, + ], + not: { + $ref: '#/components/schemas/NotSchema', }, - OneOfSchema: { - type: 'string', - description: - 'This schema is reachable from `EveryFlavor` and `SchemaWithOneOfSchema`.', + }, + SchemaWithPropertySchema: { + type: 'object', + properties: { + property_schema: { + $ref: '#/components/schemas/PropertySchema', + }, }, - SchemaWithAnyOfSchema: { - type: 'string', - anyOf: [ - { - $ref: '#/components/schemas/AnyOfSchema', - }, - ], + }, + PropertySchema: { + type: 'string', + description: 'This schema is reachable from `EveryFlavor` and `SchemaWithPropertySchema`.', + }, + SchemaWithAdditionalPropertiesSchema: { + type: 'object', + additionalProperties: { + $ref: '#/components/schemas/AdditionalPropertiesSchema', }, - AnyOfSchema: { - type: 'string', - description: - 'This schema is reachable from `EveryFlavor` and `SchemaWithAnyOfSchema`.', + }, + AdditionalPropertiesSchema: { + type: 'string', + description: 'This schema is reachable from `EveryFlavor` and `SchemaWithAdditionalPropertiesSchema`.', + }, + SchemaWithItemsSchema: { + type: 'array', + items: { + $ref: '#/components/schemas/ItemsSchema', }, - SchemaWithNotSchema: { - type: 'string', - not: { - $ref: '#/components/schemas/NotSchema', + }, + ItemsSchema: { + type: 'string', + description: 'This schema is reachable from `EveryFlavor` and `SchemaWithItemsSchema`.', + }, + SchemaWithAllOfSchema: { + type: 'string', + allOf: [ + { + $ref: '#/components/schemas/AllOfSchema', }, + ], + }, + AllOfSchema: { + type: 'string', + description: 'This schema is reachable from `EveryFlavor` and `SchemaWithAllOfSchema`.', + }, + SchemaWithOneOfSchema: { + type: 'string', + oneOf: [ + { + $ref: '#/components/schemas/OneOfSchema', + }, + ], + }, + OneOfSchema: { + type: 'string', + description: 'This schema is reachable from `EveryFlavor` and `SchemaWithOneOfSchema`.', + }, + SchemaWithAnyOfSchema: { + type: 'string', + anyOf: [ + { + $ref: '#/components/schemas/AnyOfSchema', + }, + ], + }, + AnyOfSchema: { + type: 'string', + description: 'This schema is reachable from `EveryFlavor` and `SchemaWithAnyOfSchema`.', + }, + SchemaWithNotSchema: { + type: 'string', + not: { + $ref: '#/components/schemas/NotSchema', }, - NotSchema: { - type: 'string', - description: - 'This schema is reachable from `EveryFlavor` and `SchemaWithNotSchema`.', - }, + }, + NotSchema: { + type: 'string', + description: 'This schema is reachable from `EveryFlavor` and `SchemaWithNotSchema`.', }, }, }; diff --git a/packages/ruleset/test/test-utils/helper-artifacts.js b/packages/ruleset/test/test-utils/helper-artifacts.js index fff4597ff..31d74b686 100644 --- a/packages/ruleset/test/test-utils/helper-artifacts.js +++ b/packages/ruleset/test/test-utils/helper-artifacts.js @@ -18,10 +18,7 @@ const pageLink = { }, }; -// These "Offset*" objects exist to provide artifacts that act as a correct -// baseline for offset/limit style pagination. They are not in the root -// document because we encourage the use of token-based pagination. -module.exports.offsetParameter = { +export const offsetParameter = { name: 'offset', in: 'query', description: 'The offset (origin 0) of the first item to return.', @@ -33,7 +30,7 @@ module.exports.offsetParameter = { }, }; -module.exports.offsetPaginationBase = { +export const offsetPaginationBase = { description: 'A base schema containing properties that support offset-limit pagination.', type: 'object', diff --git a/packages/ruleset/test/test-utils/index.js b/packages/ruleset/test/test-utils/index.js index b80ce86ff..f974186ee 100644 --- a/packages/ruleset/test/test-utils/index.js +++ b/packages/ruleset/test/test-utils/index.js @@ -3,15 +3,15 @@ * SPDX-License-Identifier: Apache2.0 */ -const allSchemasDocument = require('./all-schemas-document'); -const makeCopy = require('./make-copy'); -const testRule = require('./test-rule'); -const unitTestRule = require('./unit-test-rule'); -const rootDocument = require('./root-document'); -const severityCodes = require('./severity-codes'); -const helperArtifacts = require('./helper-artifacts'); +import allSchemasDocument from './all-schemas-document'; +import makeCopy from './make-copy'; +import testRule from './test-rule'; +import unitTestRule from './unit-test-rule'; +import rootDocument from './root-document'; +import severityCodes from './severity-codes'; +import helperArtifacts from './helper-artifacts'; -module.exports = { +export default { allSchemasDocument, makeCopy, rootDocument, diff --git a/packages/ruleset/test/test-utils/make-copy.js b/packages/ruleset/test/test-utils/make-copy.js index 4dabf3519..79e2a5c24 100644 --- a/packages/ruleset/test/test-utils/make-copy.js +++ b/packages/ruleset/test/test-utils/make-copy.js @@ -3,6 +3,6 @@ * SPDX-License-Identifier: Apache2.0 */ -module.exports = obj => { +export default obj => { return JSON.parse(JSON.stringify(obj)); }; diff --git a/packages/ruleset/test/test-utils/root-document.js b/packages/ruleset/test/test-utils/root-document.js index 08fb08408..29ac93a36 100644 --- a/packages/ruleset/test/test-utils/root-document.js +++ b/packages/ruleset/test/test-utils/root-document.js @@ -3,233 +3,182 @@ * SPDX-License-Identifier: Apache2.0 */ -module.exports = { - openapi: '3.0.0', - info: { - title: 'Root Test Definition', - description: 'API definition for testing custom Spectral rules.', - version: '1.0.0', +export const openapi = '3.0.0'; +export const info = { + title: 'Root Test Definition', + description: 'API definition for testing custom Spectral rules.', + version: '1.0.0', +}; +export const servers = [ + { + url: 'https://some-madeup-url.com/api', }, - servers: [ - { - url: 'https://some-madeup-url.com/api', - }, - ], - security: [ - { - IAM: [], - }, - { - OpenIdScheme: ['openid:admin'], - }, - ], - tags: [ - { - name: 'TestTag', - description: 'A tag used for testing.', - }, - ], - paths: { - '/v1/drinks': { - post: { - operationId: 'create_drink', - summary: 'Create a drink', - description: 'Create a new Drink instance.', - tags: ['TestTag'], - security: [ - { - DrinkScheme: ['mixologist'], +]; +export const security = [ + { + IAM: [], + }, + { + OpenIdScheme: ['openid:admin'], + }, +]; +export const tags = [ + { + name: 'TestTag', + description: 'A tag used for testing.', + }, +]; +export const paths = { + '/v1/drinks': { + post: { + operationId: 'create_drink', + summary: 'Create a drink', + description: 'Create a new Drink instance.', + tags: ['TestTag'], + security: [ + { + DrinkScheme: ['mixologist'], + }, + ], + 'x-codegen-request-body-name': 'drink', + requestBody: { + required: true, + content: { + 'application/json': { + schema: { + $ref: '#/components/schemas/DrinkPrototype', + }, }, - ], - 'x-codegen-request-body-name': 'drink', - requestBody: { - required: true, + }, + }, + responses: { + 201: { + description: 'Success!', content: { 'application/json': { schema: { - $ref: '#/components/schemas/DrinkPrototype', + $ref: '#/components/schemas/Drink', }, }, }, }, - responses: { - 201: { - description: 'Success!', - content: { - 'application/json': { - schema: { - $ref: '#/components/schemas/Drink', - }, - }, - }, - }, - 400: { - description: 'Error!', - content: { - 'application/json': { - schema: { - $ref: '#/components/schemas/ErrorContainer', - }, + 400: { + description: 'Error!', + content: { + 'application/json': { + schema: { + $ref: '#/components/schemas/ErrorContainer', }, }, }, }, }, - get: { - operationId: 'list_drinks', - summary: 'List drinks', - description: 'Retrieve all the drinks.', - tags: ['TestTag'], - security: [ - { - Basic: [], - DrinkScheme: ['drinker'], - }, - ], - parameters: [ - { - name: 'start', - in: 'query', - description: 'A token which indicates the first item to return.', - required: false, - schema: { - type: 'string', - pattern: '^[a-zA-Z0-9 ]+$', - minLength: 1, - maxLength: 128, - }, + }, + get: { + operationId: 'list_drinks', + summary: 'List drinks', + description: 'Retrieve all the drinks.', + tags: ['TestTag'], + security: [ + { + Basic: [], + DrinkScheme: ['drinker'], + }, + ], + parameters: [ + { + name: 'start', + in: 'query', + description: 'A token which indicates the first item to return.', + required: false, + schema: { + type: 'string', + pattern: '^[a-zA-Z0-9 ]+$', + minLength: 1, + maxLength: 128, }, - { - name: 'limit', - in: 'query', - description: 'The number of items to return per page.', - required: false, - schema: { - type: 'integer', - format: 'int32', - minimum: 1, - maximum: 100, - default: 10, - }, + }, + { + name: 'limit', + in: 'query', + description: 'The number of items to return per page.', + required: false, + schema: { + type: 'integer', + format: 'int32', + minimum: 1, + maximum: 100, + default: 10, }, - ], - responses: { - 200: { - description: 'Success!', - content: { - 'application/json': { - schema: { - $ref: '#/components/schemas/DrinkCollection', - }, + }, + ], + responses: { + 200: { + description: 'Success!', + content: { + 'application/json': { + schema: { + $ref: '#/components/schemas/DrinkCollection', }, }, }, - 400: { - description: 'Error!', - content: { - 'application/json': { - schema: { - $ref: '#/components/schemas/ErrorContainer', - }, + }, + 400: { + description: 'Error!', + content: { + 'application/json': { + schema: { + $ref: '#/components/schemas/ErrorContainer', }, }, }, }, }, }, - '/v1/drinks/{drink_id}': { + }, + '/v1/drinks/{drink_id}': { + parameters: [ + { + $ref: '#/components/parameters/DrinkIdParam', + }, + ], + get: { + operationId: 'get_drink', + summary: 'Have a drink', + description: 'Retrieve and consume a refreshing beverage.', + tags: ['TestTag'], + security: [ + { + DrinkScheme: [], + }, + ], parameters: [ { - $ref: '#/components/parameters/DrinkIdParam', + $ref: '#/components/parameters/VerboseParam', }, ], - get: { - operationId: 'get_drink', - summary: 'Have a drink', - description: 'Retrieve and consume a refreshing beverage.', - tags: ['TestTag'], - security: [ - { - DrinkScheme: [], - }, - ], - parameters: [ - { - $ref: '#/components/parameters/VerboseParam', - }, - ], - responses: { - 200: { - $ref: '#/components/responses/ConsumedDrink', - }, - 400: { - $ref: '#/components/responses/BarIsClosed', - }, + responses: { + 200: { + $ref: '#/components/responses/ConsumedDrink', }, - }, - }, - '/v1/drink_menu': { - get: { - operationId: 'download_drink_menu', - summary: 'Download Drinks Menu', - description: 'Retrieve a document containing the drinks menu.', - tags: ['TestTag'], - responses: { - 200: { - content: { - 'application/octet-stream': { - schema: { - description: 'Document file contents', - type: 'string', - format: 'binary', - minLength: 0, - maxLength: 1024000, - }, - }, - }, - }, + 400: { + $ref: '#/components/responses/BarIsClosed', }, }, - put: { - operationId: 'replace_drink_menu', - summary: 'Upload Drinks Menu', - description: 'Publish a new Drinks Menu for public viewing.', - tags: ['TestTag'], - 'x-codegen-request-body-name': 'document', - parameters: [ - { - in: 'query', - name: 'document_name', - description: 'The document name as a string.', - schema: { - description: 'Name of the file as a string', - type: 'string', - pattern: '^[a-z0-9]*.pdf$', - minLength: 0, - maxLength: 1024000, - }, - }, - { - in: 'query', - name: 'document_type', - description: 'The document type as a string.', - content: { - 'application/json': { - schema: { - description: 'valid document types', - type: 'string', - enum: ['pdf', 'odt', 'doc'], - }, - }, - }, - }, - ], - requestBody: { - required: true, + }, + }, + '/v1/drink_menu': { + get: { + operationId: 'download_drink_menu', + summary: 'Download Drinks Menu', + description: 'Retrieve a document containing the drinks menu.', + tags: ['TestTag'], + responses: { + 200: { content: { 'application/octet-stream': { schema: { - description: 'The document contents.', + description: 'Document file contents', type: 'string', format: 'binary', minLength: 0, @@ -238,1068 +187,1105 @@ module.exports = { }, }, }, - responses: { - 200: { - description: 'Upload confirmed!', - content: { - 'text/plain': { - schema: { - description: 'String response for upload request.', - type: 'string', - minLength: 0, - maxLength: 512, - pattern: '^[a-zA-Z0-9 ]+$', - }, - }, - }, - }, - }, }, }, - '/v1/movies': { - post: { - operationId: 'create_movie', - summary: 'Create a movie', - description: 'Create a new Movie instance.', - tags: ['TestTag'], - security: [ - { - MovieScheme: ['director'], + put: { + operationId: 'replace_drink_menu', + summary: 'Upload Drinks Menu', + description: 'Publish a new Drinks Menu for public viewing.', + tags: ['TestTag'], + 'x-codegen-request-body-name': 'document', + parameters: [ + { + in: 'query', + name: 'document_name', + description: 'The document name as a string.', + schema: { + description: 'Name of the file as a string', + type: 'string', + pattern: '^[a-z0-9]*.pdf$', + minLength: 0, + maxLength: 1024000, }, - ], - requestBody: { - required: true, + }, + { + in: 'query', + name: 'document_type', + description: 'The document type as a string.', content: { 'application/json': { schema: { - $ref: '#/components/schemas/MoviePrototype', + description: 'valid document types', + type: 'string', + enum: ['pdf', 'odt', 'doc'], }, }, }, }, - responses: { - 201: { - description: 'Success!', - content: { - 'application/json': { - schema: { - $ref: '#/components/schemas/Movie', - }, - }, + ], + requestBody: { + required: true, + content: { + 'application/octet-stream': { + schema: { + description: 'The document contents.', + type: 'string', + format: 'binary', + minLength: 0, + maxLength: 1024000, }, }, - 400: { - description: 'Error!', - content: { - 'application/json': { - schema: { - $ref: '#/components/schemas/ErrorContainer', - }, + }, + }, + responses: { + 200: { + description: 'Upload confirmed!', + content: { + 'text/plain': { + schema: { + description: 'String response for upload request.', + type: 'string', + minLength: 0, + maxLength: 512, + pattern: '^[a-zA-Z0-9 ]+$', }, }, }, }, }, - get: { - operationId: 'list_movies', - summary: 'List movies', - description: - 'Retrieve a list of movies using an optional genre qualifier.', - tags: ['TestTag'], - security: [ - { - MovieScheme: ['moviegoer'], - }, - ], - parameters: [ - { - description: 'An optional genre to filter on.', - name: 'genre', - required: false, - in: 'query', - schema: { - type: 'string', - enum: ['comedy', 'drama', 'action', 'musical', 'documentary'], - }, - }, - { - name: 'start', - in: 'query', - description: 'A token which indicates the first item to return.', - required: false, + }, + }, + '/v1/movies': { + post: { + operationId: 'create_movie', + summary: 'Create a movie', + description: 'Create a new Movie instance.', + tags: ['TestTag'], + security: [ + { + MovieScheme: ['director'], + }, + ], + requestBody: { + required: true, + content: { + 'application/json': { schema: { - type: 'string', - pattern: '^[a-zA-Z0-9 ]+$', - minLength: 1, - maxLength: 128, + $ref: '#/components/schemas/MoviePrototype', }, }, - { - name: 'limit', - in: 'query', - description: 'The number of items to return per page.', - required: false, - schema: { - type: 'integer', - format: 'int32', - minimum: 1, - maximum: 100, - default: 10, + }, + }, + responses: { + 201: { + description: 'Success!', + content: { + 'application/json': { + schema: { + $ref: '#/components/schemas/Movie', + }, }, }, - ], - responses: { - 200: { - description: 'Success!', - content: { - 'application/json': { - schema: { - $ref: '#/components/schemas/MovieCollection', - }, - example: { - limit: 2, - total_count: 2, - first: { - href: 'first page', - }, - last: { - href: 'last page', - }, - movies: [ - { id: '1234', name: 'The Fellowship of the Ring' }, - { id: '5678', name: 'The Two Towers' }, - ], - }, + }, + 400: { + description: 'Error!', + content: { + 'application/json': { + schema: { + $ref: '#/components/schemas/ErrorContainer', }, }, }, }, }, }, - '/v1/movies/{movie_id}': { - parameters: [ + get: { + operationId: 'list_movies', + summary: 'List movies', + description: 'Retrieve a list of movies using an optional genre qualifier.', + tags: ['TestTag'], + security: [ { - $ref: '#/components/parameters/MovieIdParam', + MovieScheme: ['moviegoer'], }, ], - get: { - operationId: 'get_movie', - summary: 'Get a movie', - description: 'Retrieve the movie and return it in the response.', - tags: ['TestTag'], - security: [ - { - MovieScheme: ['moviegoer'], - }, - ], - responses: { - 200: { - $ref: '#/components/responses/MovieWithETag', - }, - 400: { - description: 'Didnt work!', - content: { - 'application/json': { - schema: { - $ref: '#/components/schemas/ErrorContainer', - }, - }, - }, + parameters: [ + { + description: 'An optional genre to filter on.', + name: 'genre', + required: false, + in: 'query', + schema: { + type: 'string', + enum: ['comedy', 'drama', 'action', 'musical', 'documentary'], }, }, - }, - put: { - operationId: 'replace_movie', - summary: 'Replace movie', - description: 'Replace a movie with updated state information.', - tags: ['TestTag'], - parameters: [ - { - $ref: '#/components/parameters/IfMatchParam', + { + name: 'start', + in: 'query', + description: 'A token which indicates the first item to return.', + required: false, + schema: { + type: 'string', + pattern: '^[a-zA-Z0-9 ]+$', + minLength: 1, + maxLength: 128, }, - ], - security: [ - { - MovieScheme: ['director'], + }, + { + name: 'limit', + in: 'query', + description: 'The number of items to return per page.', + required: false, + schema: { + type: 'integer', + format: 'int32', + minimum: 1, + maximum: 100, + default: 10, }, - ], - 'x-codegen-request-body-name': 'movie', - requestBody: { - required: true, + }, + ], + responses: { + 200: { + description: 'Success!', content: { 'application/json': { schema: { - $ref: '#/components/schemas/MoviePrototype', + $ref: '#/components/schemas/MovieCollection', }, - }, - }, - }, - responses: { - 200: { - $ref: '#/components/responses/MovieWithETag', - }, - 400: { - description: 'Didnt work!', - content: { - 'application/json': { - schema: { - $ref: '#/components/schemas/ErrorContainer', + example: { + limit: 2, + total_count: 2, + first: { + href: 'first page', }, - }, - }, - }, - 409: { - description: 'Resource conflict!', - content: { - 'application/json': { - schema: { - $ref: '#/components/schemas/ErrorContainer', + last: { + href: 'last page', }, + movies: [ + { id: '1234', name: 'The Fellowship of the Ring' }, + { id: '5678', name: 'The Two Towers' }, + ], }, }, }, }, }, }, - '/v1/cars': { - post: { - operationId: 'create_car', - summary: 'Create a car', - description: 'Create a new Car instance.', - tags: ['TestTag'], - parameters: [ - { - $ref: '#/components/parameters/ExpediteParam', - }, - ], - security: [ - { - IAM: [], - }, - ], - 'x-codegen-request-body-name': 'car', - requestBody: { - $ref: '#/components/requestBodies/CarRequest', - }, - responses: { - 201: { - description: 'The car instance was returned in the response.', - content: { - 'application/json': { - schema: { - $ref: '#/components/schemas/Car', - }, - examples: { - ResponseExample: { - $ref: '#/components/examples/CarExample', - }, - }, - }, - }, - links: { - CarId: { - $ref: '#/components/links/CarIdLink', + }, + '/v1/movies/{movie_id}': { + parameters: [ + { + $ref: '#/components/parameters/MovieIdParam', + }, + ], + get: { + operationId: 'get_movie', + summary: 'Get a movie', + description: 'Retrieve the movie and return it in the response.', + tags: ['TestTag'], + security: [ + { + MovieScheme: ['moviegoer'], + }, + ], + responses: { + 200: { + $ref: '#/components/responses/MovieWithETag', + }, + 400: { + description: 'Didnt work!', + content: { + 'application/json': { + schema: { + $ref: '#/components/schemas/ErrorContainer', }, }, }, - 400: { - $ref: '#/components/responses/ErrorResponse', - }, }, }, }, - '/v1/cars/{car_id}': { + put: { + operationId: 'replace_movie', + summary: 'Replace movie', + description: 'Replace a movie with updated state information.', + tags: ['TestTag'], parameters: [ { - $ref: '#/components/parameters/CarIdParam', + $ref: '#/components/parameters/IfMatchParam', }, ], - get: { - operationId: 'get_car', - summary: 'Get Car', - description: 'Retrieve a Car instance by its id.', - tags: ['TestTag'], - security: [ - { - IAM: [], - }, - ], - responses: { - 200: { - $ref: '#/components/responses/CarResponse', - }, - 400: { - $ref: '#/components/responses/ErrorResponse', + security: [ + { + MovieScheme: ['director'], + }, + ], + 'x-codegen-request-body-name': 'movie', + requestBody: { + required: true, + content: { + 'application/json': { + schema: { + $ref: '#/components/schemas/MoviePrototype', + }, }, }, }, - patch: { - operationId: 'update_car', - summary: 'Update a car', - description: 'Update a new Car instance with new state information.', - tags: ['TestTag'], - security: [ - { - IAM: [], - }, - ], - requestBody: { - $ref: '#/components/requestBodies/UpdateCarRequest', - }, - responses: { - 200: { - description: 'The car instance was updated successfully.', - content: { - 'application/json': { - schema: { - $ref: '#/components/schemas/Car', - }, - examples: { - ResponseExample: { - $ref: '#/components/examples/CarExample', - }, - }, + responses: { + 200: { + $ref: '#/components/responses/MovieWithETag', + }, + 400: { + description: 'Didnt work!', + content: { + 'application/json': { + schema: { + $ref: '#/components/schemas/ErrorContainer', }, }, }, - 400: { - $ref: '#/components/responses/ErrorResponse', + }, + 409: { + description: 'Resource conflict!', + content: { + 'application/json': { + schema: { + $ref: '#/components/schemas/ErrorContainer', + }, + }, }, }, }, }, }, - components: { - parameters: { - DrinkIdParam: { - name: 'drink_id', - description: 'The id of the drink resource.', - in: 'path', - required: true, - schema: { - type: 'string', - pattern: '^[a-zA-Z0-9 ]+$', - minLength: 1, - maxLength: 30, + '/v1/cars': { + post: { + operationId: 'create_car', + summary: 'Create a car', + description: 'Create a new Car instance.', + tags: ['TestTag'], + parameters: [ + { + $ref: '#/components/parameters/ExpediteParam', }, - }, - MovieIdParam: { - name: 'movie_id', - description: 'The id of the movie resource.', - in: 'path', - required: true, - schema: { - type: 'string', - pattern: '^[a-zA-Z0-9 ]+$', - minLength: 1, - maxLength: 30, + ], + security: [ + { + IAM: [], }, + ], + 'x-codegen-request-body-name': 'car', + requestBody: { + $ref: '#/components/requestBodies/CarRequest', }, - VerboseParam: { - description: 'An optional verbose parameter.', - name: 'verbose', - required: false, - in: 'query', - schema: { - type: 'boolean', + responses: { + 201: { + description: 'The car instance was returned in the response.', + content: { + 'application/json': { + schema: { + $ref: '#/components/schemas/Car', + }, + examples: { + ResponseExample: { + $ref: '#/components/examples/CarExample', + }, + }, + }, + }, + links: { + CarId: { + $ref: '#/components/links/CarIdLink', + }, + }, }, - }, - ExpediteParam: { - description: - 'An optional parameter to speed up the car manufacturing process.', - name: 'hurry_up', - required: false, - in: 'query', - schema: { - type: 'boolean', + 400: { + $ref: '#/components/responses/ErrorResponse', }, }, - CarIdParam: { - description: 'A car id.', - name: 'car_id', - required: true, - in: 'path', - schema: { - type: 'string', - pattern: '^[a-zA-Z0-9 ]+$', - minLength: 1, - maxLength: 30, - }, + }, + }, + '/v1/cars/{car_id}': { + parameters: [ + { + $ref: '#/components/parameters/CarIdParam', }, - IfMatchParam: { - description: 'The If-Match header param.', - name: 'If-Match', - required: true, - in: 'header', - schema: { - type: 'string', - pattern: '^[a-zA-Z0-9 ]+$', - minLength: 1, - maxLength: 64, + ], + get: { + operationId: 'get_car', + summary: 'Get Car', + description: 'Retrieve a Car instance by its id.', + tags: ['TestTag'], + security: [ + { + IAM: [], + }, + ], + responses: { + 200: { + $ref: '#/components/responses/CarResponse', + }, + 400: { + $ref: '#/components/responses/ErrorResponse', }, }, }, - schemas: { - Movie: { - description: 'This is the Movie schema.', - type: 'object', - required: ['id', 'name'], - properties: { - id: { - $ref: '#/components/schemas/IdString', - }, - name: { - $ref: '#/components/schemas/NormalString', - }, - director: { - $ref: '#/components/schemas/NormalString', - }, - running_time: { - type: 'integer', - format: 'int32', - minimum: 0, - maximum: 360, - description: 'The length of the movie, in minutes.', - }, - imdb_url: { - $ref: '#/components/schemas/UrlString', - }, - trailer: { - type: 'string', - format: 'byte', - description: 'A short trailer for the movie.', - minLength: 0, - maxLength: 1024, - }, - }, - example: { - id: 'acb123', - name: 'The Two Towers', - director: 'Peter Jackson', - running_time: 179, + patch: { + operationId: 'update_car', + summary: 'Update a car', + description: 'Update a new Car instance with new state information.', + tags: ['TestTag'], + security: [ + { + IAM: [], }, + ], + requestBody: { + $ref: '#/components/requestBodies/UpdateCarRequest', }, - MoviePrototype: { - description: 'This is the Movie creation schema.', - type: 'object', - required: ['name'], - properties: { - name: { - $ref: '#/components/schemas/NormalString', - }, - director: { - $ref: '#/components/schemas/NormalString', - }, - running_time: { - type: 'integer', - format: 'int32', - minimum: 0, - maximum: 360, - description: 'The length of the movie, in minutes.', - }, - imdb_url: { - $ref: '#/components/schemas/UrlString', - }, - trailer: { - type: 'string', - format: 'byte', - description: 'A short trailer for the movie.', - minLength: 0, - maxLength: 1024, + responses: { + 200: { + description: 'The car instance was updated successfully.', + content: { + 'application/json': { + schema: { + $ref: '#/components/schemas/Car', + }, + examples: { + ResponseExample: { + $ref: '#/components/examples/CarExample', + }, + }, + }, }, }, - example: { - name: 'The Two Towers', - director: 'Peter Jackson', - running_time: 179, + 400: { + $ref: '#/components/responses/ErrorResponse', }, }, - Drink: { - type: 'object', - description: - 'A Drink can be either a Juice or Soda instance. Sorry, no Beer or Whisky allowed.', - properties: { - id: { - $ref: '#/components/schemas/IdString', - }, + }, + }, +}; +export const components = { + parameters: { + DrinkIdParam: { + name: 'drink_id', + description: 'The id of the drink resource.', + in: 'path', + required: true, + schema: { + type: 'string', + pattern: '^[a-zA-Z0-9 ]+$', + minLength: 1, + maxLength: 30, + }, + }, + MovieIdParam: { + name: 'movie_id', + description: 'The id of the movie resource.', + in: 'path', + required: true, + schema: { + type: 'string', + pattern: '^[a-zA-Z0-9 ]+$', + minLength: 1, + maxLength: 30, + }, + }, + VerboseParam: { + description: 'An optional verbose parameter.', + name: 'verbose', + required: false, + in: 'query', + schema: { + type: 'boolean', + }, + }, + ExpediteParam: { + description: 'An optional parameter to speed up the car manufacturing process.', + name: 'hurry_up', + required: false, + in: 'query', + schema: { + type: 'boolean', + }, + }, + CarIdParam: { + description: 'A car id.', + name: 'car_id', + required: true, + in: 'path', + schema: { + type: 'string', + pattern: '^[a-zA-Z0-9 ]+$', + minLength: 1, + maxLength: 30, + }, + }, + IfMatchParam: { + description: 'The If-Match header param.', + name: 'If-Match', + required: true, + in: 'header', + schema: { + type: 'string', + pattern: '^[a-zA-Z0-9 ]+$', + minLength: 1, + maxLength: 64, + }, + }, + }, + schemas: { + Movie: { + description: 'This is the Movie schema.', + type: 'object', + required: ['id', 'name'], + properties: { + id: { + $ref: '#/components/schemas/IdString', }, - oneOf: [ - { - $ref: '#/components/schemas/Juice', - }, - { - $ref: '#/components/schemas/Soda', - }, - ], - discriminator: { - propertyName: 'type', + name: { + $ref: '#/components/schemas/NormalString', + }, + director: { + $ref: '#/components/schemas/NormalString', }, - example: { - id: 'acb123', - type: 'soda', - name: 'Root Beer', + running_time: { + type: 'integer', + format: 'int32', + minimum: 0, + maximum: 360, + description: 'The length of the movie, in minutes.', + }, + imdb_url: { + $ref: '#/components/schemas/UrlString', + }, + trailer: { + type: 'string', + format: 'byte', + description: 'A short trailer for the movie.', + minLength: 0, + maxLength: 1024, }, }, - DrinkPrototype: { - type: 'object', - description: - 'A Drink can be either a Juice or Soda instance. Sorry, no Beer or Whisky allowed.', - oneOf: [ - { - $ref: '#/components/schemas/Juice', - }, - { - $ref: '#/components/schemas/Soda', - }, - ], - discriminator: { - propertyName: 'type', + example: { + id: 'acb123', + name: 'The Two Towers', + director: 'Peter Jackson', + running_time: 179, + }, + }, + MoviePrototype: { + description: 'This is the Movie creation schema.', + type: 'object', + required: ['name'], + properties: { + name: { + $ref: '#/components/schemas/NormalString', + }, + director: { + $ref: '#/components/schemas/NormalString', + }, + running_time: { + type: 'integer', + format: 'int32', + minimum: 0, + maximum: 360, + description: 'The length of the movie, in minutes.', }, - example: { - type: 'soda', - name: 'Root Beer', + imdb_url: { + $ref: '#/components/schemas/UrlString', + }, + trailer: { + type: 'string', + format: 'byte', + description: 'A short trailer for the movie.', + minLength: 0, + maxLength: 1024, }, }, - Soda: { - description: 'Do you really not know what a Soda is?', - type: 'object', - required: ['type', 'name'], - properties: { - type: { - description: 'The drink type - should be "soda".', - type: 'string', - enum: ['soda'], - }, - name: { - $ref: '#/components/schemas/NormalString', - }, + example: { + name: 'The Two Towers', + director: 'Peter Jackson', + running_time: 179, + }, + }, + Drink: { + type: 'object', + description: 'A Drink can be either a Juice or Soda instance. Sorry, no Beer or Whisky allowed.', + properties: { + id: { + $ref: '#/components/schemas/IdString', }, }, - Juice: { - description: 'Juice box!', - type: 'object', - required: ['type', 'fruit'], - properties: { - type: { - description: 'The drink type - should be "juice".', - type: 'string', - enum: ['juice'], - }, - fruit: { - $ref: '#/components/schemas/NormalString', - }, + oneOf: [ + { + $ref: '#/components/schemas/Juice', + }, + { + $ref: '#/components/schemas/Soda', }, + ], + discriminator: { + propertyName: 'type', }, - NormalString: { - description: 'This is a normal string.', - type: 'string', - pattern: '^[a-zA-Z0-9 ]+$', - minLength: 1, - maxLength: 30, + example: { + id: 'acb123', + type: 'soda', + name: 'Root Beer', }, - IdString: { - description: 'An identifier of some sort.', - type: 'string', - readOnly: true, - pattern: '^[a-zA-Z0-9]+$', - minLength: 1, - maxLength: 10, + }, + DrinkPrototype: { + type: 'object', + description: 'A Drink can be either a Juice or Soda instance. Sorry, no Beer or Whisky allowed.', + oneOf: [ + { + $ref: '#/components/schemas/Juice', + }, + { + $ref: '#/components/schemas/Soda', + }, + ], + discriminator: { + propertyName: 'type', }, - UrlString: { - description: 'A URL of some sort.', - type: 'string', - format: 'url', - pattern: '^https://.*$', - maxLength: 1024, + example: { + type: 'soda', + name: 'Root Beer', }, - DrinkCollection: { - type: 'object', - description: 'A single page of results containing Drink instances.', - allOf: [ - { - $ref: '#/components/schemas/TokenPaginationBase', - }, - { - type: 'object', - required: ['drinks'], - properties: { - drinks: { - description: - 'The set of Drink instances in this page of results.', - type: 'array', - minItems: 0, - maxItems: 50, - items: { - $ref: '#/components/schemas/Drink', - }, + }, + Soda: { + description: 'Do you really not know what a Soda is?', + type: 'object', + required: ['type', 'name'], + properties: { + type: { + description: 'The drink type - should be "soda".', + type: 'string', + enum: ['soda'], + }, + name: { + $ref: '#/components/schemas/NormalString', + }, + }, + }, + Juice: { + description: 'Juice box!', + type: 'object', + required: ['type', 'fruit'], + properties: { + type: { + description: 'The drink type - should be "juice".', + type: 'string', + enum: ['juice'], + }, + fruit: { + $ref: '#/components/schemas/NormalString', + }, + }, + }, + NormalString: { + description: 'This is a normal string.', + type: 'string', + pattern: '^[a-zA-Z0-9 ]+$', + minLength: 1, + maxLength: 30, + }, + IdString: { + description: 'An identifier of some sort.', + type: 'string', + readOnly: true, + pattern: '^[a-zA-Z0-9]+$', + minLength: 1, + maxLength: 10, + }, + UrlString: { + description: 'A URL of some sort.', + type: 'string', + format: 'url', + pattern: '^https://.*$', + maxLength: 1024, + }, + DrinkCollection: { + type: 'object', + description: 'A single page of results containing Drink instances.', + allOf: [ + { + $ref: '#/components/schemas/TokenPaginationBase', + }, + { + type: 'object', + required: ['drinks'], + properties: { + drinks: { + description: 'The set of Drink instances in this page of results.', + type: 'array', + minItems: 0, + maxItems: 50, + items: { + $ref: '#/components/schemas/Drink', }, }, }, - ], - example: { - limit: 1, - total_count: 1, - first: { - href: 'first page', - }, - next: { - href: 'next page', - }, - previous: { - href: 'previous page', - }, - last: { - href: 'last page', - }, - drinks: [ - { - type: 'soda', - name: 'Root Beer', - }, - ], }, - }, - MovieCollection: { - type: 'object', - description: 'A single page of results containing Movie instances.', - allOf: [ + ], + example: { + limit: 1, + total_count: 1, + first: { + href: 'first page', + }, + next: { + href: 'next page', + }, + previous: { + href: 'previous page', + }, + last: { + href: 'last page', + }, + drinks: [ { - $ref: '#/components/schemas/TokenPaginationBase', + type: 'soda', + name: 'Root Beer', }, - { - type: 'object', - required: ['movies'], - properties: { - movies: { - description: - 'The set of Movie instances in this page of results.', - type: 'array', - minItems: 0, - maxItems: 50, - items: { - $ref: '#/components/schemas/Movie', - }, + ], + }, + }, + MovieCollection: { + type: 'object', + description: 'A single page of results containing Movie instances.', + allOf: [ + { + $ref: '#/components/schemas/TokenPaginationBase', + }, + { + type: 'object', + required: ['movies'], + properties: { + movies: { + description: 'The set of Movie instances in this page of results.', + type: 'array', + minItems: 0, + maxItems: 50, + items: { + $ref: '#/components/schemas/Movie', }, }, }, - ], - example: { - limit: 1, - total_count: 1, - first: { - href: 'first page', - }, - next: { - href: 'next page', - }, - previous: { - href: 'previous page', - }, - last: { - href: 'last page', - }, - movies: [ - { - id: 'acb123', - name: 'The Two Towers', - director: 'Peter Jackson', - running_time: 179, - }, - ], }, - }, - Car: { - description: 'Information about a car.', - type: 'object', - required: ['id', 'make', 'model'], - properties: { - id: { - description: 'The car id.', - type: 'string', - minLength: 1, - maxLength: 64, - pattern: '^[0-9]+$', - }, - make: { - description: 'The car make.', - type: 'string', - minLength: 1, - maxLength: 32, - pattern: '^.*$', - }, - model: { - $ref: '#/components/schemas/CarModelType', - }, + ], + example: { + limit: 1, + total_count: 1, + first: { + href: 'first page', }, - }, - CarPrototype: { - description: 'Information about a car.', - type: 'object', - required: ['make', 'model'], - properties: { - make: { - description: 'The car make.', - type: 'string', - minLength: 1, - maxLength: 32, - pattern: '^.*$', - }, - model: { - $ref: '#/components/schemas/CarModelType', - }, + next: { + href: 'next page', }, - }, - CarPatch: { - description: 'Information about a car.', - type: 'object', - properties: { - make: { - description: 'The car make.', - type: 'string', - minLength: 1, - maxLength: 32, - pattern: '^.*$', - }, - model: { - $ref: '#/components/schemas/CarModelType', - }, + previous: { + href: 'previous page', + }, + last: { + href: 'last page', }, + movies: [ + { + id: 'acb123', + name: 'The Two Towers', + director: 'Peter Jackson', + running_time: 179, + }, + ], }, - CarModelType: { - description: 'The car model.', - type: 'string', - minLength: 1, - maxLength: 32, - pattern: '^.*$', + }, + Car: { + description: 'Information about a car.', + type: 'object', + required: ['id', 'make', 'model'], + properties: { + id: { + description: 'The car id.', + type: 'string', + minLength: 1, + maxLength: 64, + pattern: '^[0-9]+$', + }, + make: { + description: 'The car make.', + type: 'string', + minLength: 1, + maxLength: 32, + pattern: '^.*$', + }, + model: { + $ref: '#/components/schemas/CarModelType', + }, }, - TokenPaginationBase: { - description: - 'A base schema containing properties that support token-based pagination.', - type: 'object', - required: ['limit', 'total_count'], - properties: { - limit: { - description: - 'The number of items returned in this page of results.', - type: 'integer', - format: 'int32', - minimum: 1, - maximum: 100, - }, - total_count: { - description: 'The total number of items across all result pages.', - type: 'integer', - format: 'int32', - minimum: 0, - maximum: 1024, - }, - first: { - $ref: '#/components/schemas/PageLink', - }, - next: { - $ref: '#/components/schemas/PageLink', - }, - previous: { - $ref: '#/components/schemas/PageLink', - }, - last: { - allOf: [ - { - $ref: '#/components/schemas/PageLink', - }, - { - description: 'Link to the last page of results.', - }, - ], - }, + }, + CarPrototype: { + description: 'Information about a car.', + type: 'object', + required: ['make', 'model'], + properties: { + make: { + description: 'The car make.', + type: 'string', + minLength: 1, + maxLength: 32, + pattern: '^.*$', + }, + model: { + $ref: '#/components/schemas/CarModelType', }, }, - PageLink: { - description: 'Contains a link to a page of paginated results', - type: 'object', - properties: { - href: { - description: 'The link value', - type: 'string', - pattern: '^[a-zA-Z0-9 ]+$', - minLength: 1, - maxLength: 30, - }, + }, + CarPatch: { + description: 'Information about a car.', + type: 'object', + properties: { + make: { + description: 'The car make.', + type: 'string', + minLength: 1, + maxLength: 32, + pattern: '^.*$', + }, + model: { + $ref: '#/components/schemas/CarModelType', }, }, - ErrorContainer: { - description: 'An error response for an operation.', - type: 'object', - required: ['errors'], - properties: { - errors: { - type: 'array', - minItems: 0, - maxItems: 100, - description: - 'The array of error entries associated with the error response', - items: { - $ref: '#/components/schemas/Error', + }, + CarModelType: { + description: 'The car model.', + type: 'string', + minLength: 1, + maxLength: 32, + pattern: '^.*$', + }, + TokenPaginationBase: { + description: 'A base schema containing properties that support token-based pagination.', + type: 'object', + required: ['limit', 'total_count'], + properties: { + limit: { + description: 'The number of items returned in this page of results.', + type: 'integer', + format: 'int32', + minimum: 1, + maximum: 100, + }, + total_count: { + description: 'The total number of items across all result pages.', + type: 'integer', + format: 'int32', + minimum: 0, + maximum: 1024, + }, + first: { + $ref: '#/components/schemas/PageLink', + }, + next: { + $ref: '#/components/schemas/PageLink', + }, + previous: { + $ref: '#/components/schemas/PageLink', + }, + last: { + allOf: [ + { + $ref: '#/components/schemas/PageLink', }, - }, - status_code: { - type: 'integer', - format: 'int32', - minimum: 0, - maximum: 599, - description: 'The HTTP status code.', - }, - trace: { - description: 'The error trace information.', - type: 'string', - format: 'identifier', - pattern: '^[a-zA-Z0-9 ]+$', - maxLength: 30, - }, + { + description: 'Link to the last page of results.', + }, + ], }, }, - Error: { - description: 'An error response entry.', - type: 'object', - required: ['code'], - properties: { - code: { - description: 'The error code.', - type: 'string', - enum: ['bad_request', 'not_authorized', 'no_need_to_know'], - }, - message: { - description: 'The error message.', - type: 'string', - pattern: '^[a-zA-Z0-9 ]+$', - minLength: 1, - maxLength: 128, - }, - more_info: { - description: 'Additional info about the error.', - type: 'string', - pattern: '^[a-zA-Z0-9 ]+$', - minLength: 1, - maxLength: 128, - }, - target: { - $ref: '#/components/schemas/ErrorTarget', - }, + }, + PageLink: { + description: 'Contains a link to a page of paginated results', + type: 'object', + properties: { + href: { + description: 'The link value', + type: 'string', + pattern: '^[a-zA-Z0-9 ]+$', + minLength: 1, + maxLength: 30, }, }, - ErrorTarget: { - description: 'An error target (a field, header or query parameter).', - type: 'object', - required: ['type'], - properties: { - type: { - description: 'The error target type.', - type: 'string', - enum: ['field', 'header', 'parameter'], - }, - name: { - description: - 'The name of the field/header/query parameter associated with the error.', - type: 'string', - pattern: '^[a-zA-Z0-9 ]+$', - minLength: 1, - maxLength: 30, + }, + ErrorContainer: { + description: 'An error response for an operation.', + type: 'object', + required: ['errors'], + properties: { + errors: { + type: 'array', + minItems: 0, + maxItems: 100, + description: 'The array of error entries associated with the error response', + items: { + $ref: '#/components/schemas/Error', }, }, + status_code: { + type: 'integer', + format: 'int32', + minimum: 0, + maximum: 599, + description: 'The HTTP status code.', + }, + trace: { + description: 'The error trace information.', + type: 'string', + format: 'identifier', + pattern: '^[a-zA-Z0-9 ]+$', + maxLength: 30, + }, }, }, - securitySchemes: { - IAM: { - type: 'apiKey', - description: - 'An IAM access token provided via the Authorization header', - in: 'header', - name: 'Authorization', + Error: { + description: 'An error response entry.', + type: 'object', + required: ['code'], + properties: { + code: { + description: 'The error code.', + type: 'string', + enum: ['bad_request', 'not_authorized', 'no_need_to_know'], + }, + message: { + description: 'The error message.', + type: 'string', + pattern: '^[a-zA-Z0-9 ]+$', + minLength: 1, + maxLength: 128, + }, + more_info: { + description: 'Additional info about the error.', + type: 'string', + pattern: '^[a-zA-Z0-9 ]+$', + minLength: 1, + maxLength: 128, + }, + target: { + $ref: '#/components/schemas/ErrorTarget', + }, }, - Basic: { - type: 'http', - description: 'A basic-auth type Authorization header', - scheme: 'Basic', - bearerFormat: 'bearer', + }, + ErrorTarget: { + description: 'An error target (a field, header or query parameter).', + type: 'object', + required: ['type'], + properties: { + type: { + description: 'The error target type.', + type: 'string', + enum: ['field', 'header', 'parameter'], + }, + name: { + description: 'The name of the field/header/query parameter associated with the error.', + type: 'string', + pattern: '^[a-zA-Z0-9 ]+$', + minLength: 1, + maxLength: 30, + }, }, - DrinkScheme: { - type: 'oauth2', - description: 'An oauth2 authorizaton flow', - flows: { - implicit: { - authorizationUrl: 'https://myoauthserver.com/auth', - tokenUrl: 'https://myoauthserver.com/token', - scopes: { - mixologist: 'Can create Drinks', - drinker: 'Can consume beverages', - }, + }, + }, + securitySchemes: { + IAM: { + type: 'apiKey', + description: 'An IAM access token provided via the Authorization header', + in: 'header', + name: 'Authorization', + }, + Basic: { + type: 'http', + description: 'A basic-auth type Authorization header', + scheme: 'Basic', + bearerFormat: 'bearer', + }, + DrinkScheme: { + type: 'oauth2', + description: 'An oauth2 authorizaton flow', + flows: { + implicit: { + authorizationUrl: 'https://myoauthserver.com/auth', + tokenUrl: 'https://myoauthserver.com/token', + scopes: { + mixologist: 'Can create Drinks', + drinker: 'Can consume beverages', }, - authorizationCode: { - authorizationUrl: 'https://myoauthserver.com/auth', - tokenUrl: 'https://myoauthserver.com/token', - scopes: { - mixologist: 'Can create Drinks', - }, + }, + authorizationCode: { + authorizationUrl: 'https://myoauthserver.com/auth', + tokenUrl: 'https://myoauthserver.com/token', + scopes: { + mixologist: 'Can create Drinks', }, }, }, - MovieScheme: { - type: 'oauth2', - description: 'An oauth2 authorizaton flow', - flows: { - implicit: { - authorizationUrl: 'https://myoauthserver.com/auth', - tokenUrl: 'https://myoauthserver.com/token', - scopes: { - director: 'Can create Movies', - moviegoer: 'Can view Movies', - }, + }, + MovieScheme: { + type: 'oauth2', + description: 'An oauth2 authorizaton flow', + flows: { + implicit: { + authorizationUrl: 'https://myoauthserver.com/auth', + tokenUrl: 'https://myoauthserver.com/token', + scopes: { + director: 'Can create Movies', + moviegoer: 'Can view Movies', }, - authorizationCode: { - authorizationUrl: 'https://myoauthserver.com/auth', - tokenUrl: 'https://myoauthserver.com/token', - scopes: { - director: 'Can create Movies', - }, + }, + authorizationCode: { + authorizationUrl: 'https://myoauthserver.com/auth', + tokenUrl: 'https://myoauthserver.com/token', + scopes: { + director: 'Can create Movies', }, - clientCredentials: { - tokenUrl: 'https://myoauthserver.com/token', - scopes: { - moviegoer: 'Can view Movies', - }, + }, + clientCredentials: { + tokenUrl: 'https://myoauthserver.com/token', + scopes: { + moviegoer: 'Can view Movies', }, - password: { - tokenUrl: 'https://myoauthserver.com/token', - scopes: { - moviegoer: 'Can view Movies', - }, + }, + password: { + tokenUrl: 'https://myoauthserver.com/token', + scopes: { + moviegoer: 'Can view Movies', }, }, }, - OpenIdScheme: { - type: 'openIdConnect', - description: 'An openid-connect authorization scheme', - openIdConnectUrl: 'https://myopenidserver.com/auth', - }, }, - responses: { - ConsumedDrink: { - description: 'Success, we consumed a drink!', - content: { - 'application/json': { - schema: { - $ref: '#/components/schemas/Drink', - }, + OpenIdScheme: { + type: 'openIdConnect', + description: 'An openid-connect authorization scheme', + openIdConnectUrl: 'https://myopenidserver.com/auth', + }, + }, + responses: { + ConsumedDrink: { + description: 'Success, we consumed a drink!', + content: { + 'application/json': { + schema: { + $ref: '#/components/schemas/Drink', }, }, }, - MovieWithETag: { - description: 'Success, we retrieved a movie!', - content: { - 'application/json': { - schema: { - $ref: '#/components/schemas/Movie', - }, + }, + MovieWithETag: { + description: 'Success, we retrieved a movie!', + content: { + 'application/json': { + schema: { + $ref: '#/components/schemas/Movie', }, }, - headers: { - ETag: { - description: 'The unique version identifier of the movie.', - schema: { - $ref: '#/components/schemas/IdString', - }, + }, + headers: { + ETag: { + description: 'The unique version identifier of the movie.', + schema: { + $ref: '#/components/schemas/IdString', }, }, }, - BarIsClosed: { - description: 'Error, no drinks to be had!', - content: { - 'application/json': { - schema: { - $ref: '#/components/schemas/ErrorContainer', - }, + }, + BarIsClosed: { + description: 'Error, no drinks to be had!', + content: { + 'application/json': { + schema: { + $ref: '#/components/schemas/ErrorContainer', }, }, }, - CarResponse: { - description: 'The car instance was returned in the response.', - content: { - 'application/json': { - schema: { - $ref: '#/components/schemas/Car', - }, - examples: { - ResponseExample: { - $ref: '#/components/examples/CarExample', - }, + }, + CarResponse: { + description: 'The car instance was returned in the response.', + content: { + 'application/json': { + schema: { + $ref: '#/components/schemas/Car', + }, + examples: { + ResponseExample: { + $ref: '#/components/examples/CarExample', }, }, }, }, - ErrorResponse: { - description: 'An error occurred.', - content: { - 'application/json': { - schema: { - $ref: '#/components/schemas/ErrorContainer', - }, + }, + ErrorResponse: { + description: 'An error occurred.', + content: { + 'application/json': { + schema: { + $ref: '#/components/schemas/ErrorContainer', }, }, }, }, - requestBodies: { - CarRequest: { - required: true, - content: { - 'application/json': { - schema: { - $ref: '#/components/schemas/CarPrototype', - }, - examples: { - RequestExample: { - $ref: '#/components/examples/CarExample', - }, + }, + requestBodies: { + CarRequest: { + required: true, + content: { + 'application/json': { + schema: { + $ref: '#/components/schemas/CarPrototype', + }, + examples: { + RequestExample: { + $ref: '#/components/examples/CarExample', }, }, }, }, - UpdateCarRequest: { - required: true, - content: { - 'application/merge-patch+json; charset=utf-8': { - schema: { - $ref: '#/components/schemas/CarPatch', - }, - examples: { - RequestExample: { - $ref: '#/components/examples/CarExample', - }, + }, + UpdateCarRequest: { + required: true, + content: { + 'application/merge-patch+json; charset=utf-8': { + schema: { + $ref: '#/components/schemas/CarPatch', + }, + examples: { + RequestExample: { + $ref: '#/components/examples/CarExample', }, }, }, }, }, - examples: { - CarExample: { - description: 'An example of a Car instance.', - value: { - id: '1', - make: 'Ford', - model: 'F150 Lariat', - }, + }, + examples: { + CarExample: { + description: 'An example of a Car instance.', + value: { + id: '1', + make: 'Ford', + model: 'F150 Lariat', }, }, - links: { - CarIdLink: { - description: - 'Link the `create_car` response `id` property to the `get_car` path parameter named `car_id`.', - operationId: 'get_car', - parameters: { - car_id: '$response.body#/id', - }, + }, + links: { + CarIdLink: { + description: 'Link the `create_car` response `id` property to the `get_car` path parameter named `car_id`.', + operationId: 'get_car', + parameters: { + car_id: '$response.body#/id', }, }, - callbacks: {}, - headers: {}, }, + callbacks: {}, + headers: {}, }; diff --git a/packages/ruleset/test/test-utils/severity-codes.js b/packages/ruleset/test/test-utils/severity-codes.js index fd6b7811a..e620fd762 100644 --- a/packages/ruleset/test/test-utils/severity-codes.js +++ b/packages/ruleset/test/test-utils/severity-codes.js @@ -3,9 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -module.exports = { - error: 0, - warning: 1, - info: 2, - hint: 3, -}; +export const error = 0; +export const warning = 1; +export const info = 2; +export const hint = 3; diff --git a/packages/ruleset/test/test-utils/test-rule.js b/packages/ruleset/test/test-utils/test-rule.js index 2b95385ba..f62b33d59 100644 --- a/packages/ruleset/test/test-utils/test-rule.js +++ b/packages/ruleset/test/test-utils/test-rule.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -const { Spectral } = require('@stoplight/spectral-core'); +import { Spectral } from '@stoplight/spectral-core'; /** * This is a test utility function that uses spectral to invoke the specified rule @@ -32,4 +32,4 @@ async function testRule(ruleName, rule, apidef, exceptionIsExpected = false) { } } -module.exports = testRule; +export default testRule; diff --git a/packages/ruleset/test/test-utils/unit-test-rule.js b/packages/ruleset/test/test-utils/unit-test-rule.js index b2d135ed8..0ee706e50 100644 --- a/packages/ruleset/test/test-utils/unit-test-rule.js +++ b/packages/ruleset/test/test-utils/unit-test-rule.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -const { Spectral } = require('@stoplight/spectral-core'); +import { Spectral } from '@stoplight/spectral-core'; /** * This is a test utility function that uses spectral to invoke the specified rule @@ -44,4 +44,4 @@ async function unitTestRule( } } -module.exports = unitTestRule; +export default unitTestRule; diff --git a/packages/ruleset/test/utils/compute-refs-at-paths.test.js b/packages/ruleset/test/utils/compute-refs-at-paths.test.js index 9528d5996..901c355ae 100644 --- a/packages/ruleset/test/utils/compute-refs-at-paths.test.js +++ b/packages/ruleset/test/utils/compute-refs-at-paths.test.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -const { computeRefsAtPaths } = require('../../src/utils'); +import { computeRefsAtPaths } from '../../src/utils'; describe('Utility function: computeRefsAtPaths()', () => { it('should return empty when there are no refs in the nodes', () => { diff --git a/packages/ruleset/test/utils/constants.test.js b/packages/ruleset/test/utils/constants.test.js index 11e6d3b59..cc99dcf9c 100644 --- a/packages/ruleset/test/utils/constants.test.js +++ b/packages/ruleset/test/utils/constants.test.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -const { operationMethods } = require('../../src/utils'); +import { operationMethods } from '../../src/utils'; describe('Utility function: operationMethods()', () => { it('should include relevant operation method names', async () => { diff --git a/packages/ruleset/test/utils/date-based-utils.test.js b/packages/ruleset/test/utils/date-based-utils.test.js index c648019ab..97cc6ec01 100644 --- a/packages/ruleset/test/utils/date-based-utils.test.js +++ b/packages/ruleset/test/utils/date-based-utils.test.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -const { isDateBasedName, isDateBasedValue } = require('../../src/utils'); +import { isDateBasedName, isDateBasedValue } from '../../src/utils'; describe('Date-based utility functions', () => { describe('isDateBasedValue()', () => { diff --git a/packages/ruleset/test/utils/get-composite-schema-attribute.test.js b/packages/ruleset/test/utils/get-composite-schema-attribute.test.js index 62e30b7d5..3e6f81b6b 100644 --- a/packages/ruleset/test/utils/get-composite-schema-attribute.test.js +++ b/packages/ruleset/test/utils/get-composite-schema-attribute.test.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -const { getCompositeSchemaAttribute } = require('../../src/utils'); +import { getCompositeSchemaAttribute } from '../../src/utils'; describe('Utility function: getCompositeSchemaAttribute()', () => { it('Boundary conditions', async () => { diff --git a/packages/ruleset/test/utils/get-resource-oriented-paths.test.js b/packages/ruleset/test/utils/get-resource-oriented-paths.test.js index ec665c5d3..398510fe3 100644 --- a/packages/ruleset/test/utils/get-resource-oriented-paths.test.js +++ b/packages/ruleset/test/utils/get-resource-oriented-paths.test.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -const { getResourceOrientedPaths } = require('../../src/utils'); +import { getResourceOrientedPaths } from '../../src/utils'; describe('Utility function: getResourceOrientedPaths()', () => { it('should return an empty object if given a non-object', () => { diff --git a/packages/ruleset/test/utils/get-resource-specific-sibling-path.test.js b/packages/ruleset/test/utils/get-resource-specific-sibling-path.test.js index 52fe2c19f..cb30a0b49 100644 --- a/packages/ruleset/test/utils/get-resource-specific-sibling-path.test.js +++ b/packages/ruleset/test/utils/get-resource-specific-sibling-path.test.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -const { getResourceSpecificSiblingPath } = require('../../src/utils'); +import { getResourceSpecificSiblingPath } from '../../src/utils'; describe('Utility function: getResourceSpecificSiblingPath', () => { it('should find sibling path when present', () => { diff --git a/packages/ruleset/test/utils/get-response-codes.test.js b/packages/ruleset/test/utils/get-response-codes.test.js index fc75c28ad..0c8a4a19d 100644 --- a/packages/ruleset/test/utils/get-response-codes.test.js +++ b/packages/ruleset/test/utils/get-response-codes.test.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -const { getResponseCodes } = require('../../src/utils'); +import { getResponseCodes } from '../../src/utils'; describe('Utility function: getResponseCodes', () => { it('should return a tuple of empty arrays if responses is undefined', () => { diff --git a/packages/ruleset/test/utils/get-schema-name-at-path.test.js b/packages/ruleset/test/utils/get-schema-name-at-path.test.js index b4bb6a195..e21beeb5c 100644 --- a/packages/ruleset/test/utils/get-schema-name-at-path.test.js +++ b/packages/ruleset/test/utils/get-schema-name-at-path.test.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -const { getSchemaNameAtPath } = require('../../src/utils'); +import { getSchemaNameAtPath } from '../../src/utils'; describe('Utility function: getSchemaNameAtPath()', () => { it('should return undefined if path is undefined', () => { diff --git a/packages/ruleset/test/utils/is-create-operation.test.js b/packages/ruleset/test/utils/is-create-operation.test.js index 9787cd392..0e4f0eea4 100644 --- a/packages/ruleset/test/utils/is-create-operation.test.js +++ b/packages/ruleset/test/utils/is-create-operation.test.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -const { isCreateOperation } = require('../../src/utils'); +import { isCreateOperation } from '../../src/utils'; describe('Utility function: isCreateOperation', () => { it(`should return true if given operation's id starts with 'create'`, () => { diff --git a/packages/ruleset/test/utils/is-deprecated.test.js b/packages/ruleset/test/utils/is-deprecated.test.js index a1da52767..9396caaa6 100644 --- a/packages/ruleset/test/utils/is-deprecated.test.js +++ b/packages/ruleset/test/utils/is-deprecated.test.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -const { isDeprecated } = require('../../src/utils'); +import { isDeprecated } from '../../src/utils'; describe('Utility function: isDeprecated()', () => { it('should return false if given a non-object', () => { diff --git a/packages/ruleset/test/utils/is-empty-object-schema.test.js b/packages/ruleset/test/utils/is-empty-object-schema.test.js index 7c678e191..2b2334dfc 100644 --- a/packages/ruleset/test/utils/is-empty-object-schema.test.js +++ b/packages/ruleset/test/utils/is-empty-object-schema.test.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -const { isEmptyObjectSchema } = require('../../src/utils'); +import { isEmptyObjectSchema } from '../../src/utils'; describe('Utility function: isEmptyObjectSchema()', () => { describe('Should return false', () => { diff --git a/packages/ruleset/test/utils/is-operation-of-type.test.js b/packages/ruleset/test/utils/is-operation-of-type.test.js index 83909232b..70dff2d35 100644 --- a/packages/ruleset/test/utils/is-operation-of-type.test.js +++ b/packages/ruleset/test/utils/is-operation-of-type.test.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -const { isOperationOfType } = require('../../src/utils'); +import { isOperationOfType } from '../../src/utils'; describe('Utility function: isOperationOfType', () => { it('should return `true` when path matches the given type', () => { diff --git a/packages/ruleset/test/utils/is-ref-sibling-schema.test.js b/packages/ruleset/test/utils/is-ref-sibling-schema.test.js index 29d6bf887..3e6aac742 100644 --- a/packages/ruleset/test/utils/is-ref-sibling-schema.test.js +++ b/packages/ruleset/test/utils/is-ref-sibling-schema.test.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -const { isRefSiblingSchema } = require('../../src/utils'); +import { isRefSiblingSchema } from '../../src/utils'; describe('Utility function: isRefSiblingSchema()', () => { describe('Should return false', () => { diff --git a/packages/ruleset/test/utils/is-requestbody-exploded.test.js b/packages/ruleset/test/utils/is-requestbody-exploded.test.js index ce9dfddaf..330173169 100644 --- a/packages/ruleset/test/utils/is-requestbody-exploded.test.js +++ b/packages/ruleset/test/utils/is-requestbody-exploded.test.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -const { isRequestBodyExploded } = require('../../src/utils'); +import { isRequestBodyExploded } from '../../src/utils'; describe('Utility function: isRequestBodyExploded()', () => { describe('Should return false', () => { diff --git a/packages/ruleset/test/utils/merge-allof-schema-properties.test.js b/packages/ruleset/test/utils/merge-allof-schema-properties.test.js index 1e0545b6a..dec00fa99 100644 --- a/packages/ruleset/test/utils/merge-allof-schema-properties.test.js +++ b/packages/ruleset/test/utils/merge-allof-schema-properties.test.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -const { mergeAllOfSchemaProperties } = require('../../src/utils'); +import { mergeAllOfSchemaProperties } from '../../src/utils'; describe('Utility function: mergeAllOfSchemaProperties()', () => { it('should return original schema if no allOf', async () => { diff --git a/packages/ruleset/test/utils/mimetype-utils.test.js b/packages/ruleset/test/utils/mimetype-utils.test.js index 56f6aee08..da02b505d 100644 --- a/packages/ruleset/test/utils/mimetype-utils.test.js +++ b/packages/ruleset/test/utils/mimetype-utils.test.js @@ -3,12 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -const { - isJsonMimeType, - isJsonPatchMimeType, - isMergePatchMimeType, - isFormMimeType, -} = require('../../src/utils'); +import { isJsonMimeType, isJsonPatchMimeType, isMergePatchMimeType, isFormMimeType } from '../../src/utils'; describe('MimeType utility functions', () => { describe('isJsonMimeType()', () => { diff --git a/packages/ruleset/test/utils/path-has-minimally-represented-resource.test.js b/packages/ruleset/test/utils/path-has-minimally-represented-resource.test.js index 221a861a2..d6eceb252 100644 --- a/packages/ruleset/test/utils/path-has-minimally-represented-resource.test.js +++ b/packages/ruleset/test/utils/path-has-minimally-represented-resource.test.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -const { pathHasMinimallyRepresentedResource } = require('../../src/utils'); +import { pathHasMinimallyRepresentedResource } from '../../src/utils'; describe('Utility function: pathHasMinimallyRepresentedResource()', () => { const path = '/v1/resources'; diff --git a/packages/ruleset/test/utils/path-location-utils.test.js b/packages/ruleset/test/utils/path-location-utils.test.js index bb7998f8a..a290bae64 100644 --- a/packages/ruleset/test/utils/path-location-utils.test.js +++ b/packages/ruleset/test/utils/path-location-utils.test.js @@ -3,14 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -const { - isParamContentSchema, - isParamSchema, - isPrimarySchema, - isRequestBodySchema, - isResponseSchema, - isSchemaProperty, -} = require('../../src/utils'); +import { isParamContentSchema, isParamSchema, isPrimarySchema, isRequestBodySchema, isResponseSchema, isSchemaProperty } from '../../src/utils'; describe('Path Location utility functions', () => { describe('isParamContentSchema()', () => { diff --git a/packages/ruleset/test/utils/path-matches-regexp.test.js b/packages/ruleset/test/utils/path-matches-regexp.test.js index 0f3928541..a84f22b5d 100644 --- a/packages/ruleset/test/utils/path-matches-regexp.test.js +++ b/packages/ruleset/test/utils/path-matches-regexp.test.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -const { pathMatchesRegexp } = require('../../src/utils'); +import { pathMatchesRegexp } from '../../src/utils'; describe('Test pathMatchesRegexp() function', () => { it('Positive tests', () => { From 8097d1ee69aed44fac9c7c88cd75d7b8004d71a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=ADdia=20Tarcza?= <100163235+diatrcz@users.noreply.github.com> Date: Tue, 16 Jun 2026 15:14:53 +0200 Subject: [PATCH 10/16] test: fix test cases MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Lídia Tarcza <100163235+diatrcz@users.noreply.github.com> --- .../src/functions/accept-and-return-models.js | 2 +- .../src/rules/accept-and-return-models.js | 2 +- .../src/utils/get-resource-oriented-paths.js | 2 +- packages/ruleset/src/utils/index.js | 107 +++++++++++++----- .../ruleset/src/utils/is-create-operation.js | 9 +- .../src/utils/is-requestbody-exploded.js | 4 +- .../ruleset/src/utils/schema-finding-utils.js | 13 +-- packages/utilities/package.json | 6 +- packages/utilities/src/index.js | 7 +- .../src/utils/get-examples-for-schema.js | 5 +- .../utils/get-property-names-for-schema.js | 7 +- packages/utilities/src/utils/index.js | 42 ++++--- 12 files changed, 137 insertions(+), 69 deletions(-) diff --git a/packages/ruleset/src/functions/accept-and-return-models.js b/packages/ruleset/src/functions/accept-and-return-models.js index dfe2a16d4..1de18fa7d 100644 --- a/packages/ruleset/src/functions/accept-and-return-models.js +++ b/packages/ruleset/src/functions/accept-and-return-models.js @@ -8,7 +8,7 @@ import { isObjectSchema, schemaHasConstraint, } from '@ibm-cloud/openapi-ruleset-utilities'; -import { supportsJsonContent, LoggerFactory } from '../utils'; +import { supportsJsonContent, LoggerFactory } from '../utils/index.js'; let ruleId; let logger; diff --git a/packages/ruleset/src/rules/accept-and-return-models.js b/packages/ruleset/src/rules/accept-and-return-models.js index 48cbd3004..df280c695 100644 --- a/packages/ruleset/src/rules/accept-and-return-models.js +++ b/packages/ruleset/src/rules/accept-and-return-models.js @@ -8,7 +8,7 @@ import { requestBodySchemas, } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; import { oas3 } from '@stoplight/spectral-formats'; -import { acceptAndReturnModels } from '../functions'; +import acceptAndReturnModels from '../functions/accept-and-return-models.js'; export const description = 'Request and response bodies must be defined as model instances'; diff --git a/packages/ruleset/src/utils/get-resource-oriented-paths.js b/packages/ruleset/src/utils/get-resource-oriented-paths.js index 0ab91fbe9..3ed1a17c7 100644 --- a/packages/ruleset/src/utils/get-resource-oriented-paths.js +++ b/packages/ruleset/src/utils/get-resource-oriented-paths.js @@ -4,7 +4,7 @@ */ import { isObject } from '@ibm-cloud/openapi-ruleset-utilities'; -import getResourceSpecificSiblingPath from './get-resource-specific-sibling-path'; +import getResourceSpecificSiblingPath from './get-resource-specific-sibling-path.js'; /** * Cycles through the path strings within an API definition to collect the paths diff --git a/packages/ruleset/src/utils/index.js b/packages/ruleset/src/utils/index.js index 00389afd4..4fd0ef6a2 100644 --- a/packages/ruleset/src/utils/index.js +++ b/packages/ruleset/src/utils/index.js @@ -3,32 +3,83 @@ * SPDX-License-Identifier: Apache2.0 */ -module.exports = { - computeRefsAtPaths: require('./compute-refs-at-paths').default, - getCompositeSchemaAttribute: require('./get-composite-schema-attribute') - .default, - getResourceSpecificSiblingPath: - require('./get-resource-specific-sibling-path').default, - getResourceOrientedPaths: require('./get-resource-oriented-paths').default, - getResponseCodes: require('./get-response-codes').default, - getSchemaNameAtPath: require('./get-schema-name-at-path').default, - isCreateOperation: require('./is-create-operation'), - isDeprecated: require('./is-deprecated').default, - isEmptyObjectSchema: require('./is-empty-object-schema').default, - isOperationOfType: require('./is-operation-of-type').default, - isRefSiblingSchema: require('./is-ref-sibling-schema').default, - isRequestBodyExploded: require('./is-requestbody-exploded').default, - LoggerFactory: require('./logger-factory').default, - mergeAllOfSchemaProperties: require('./merge-allof-schema-properties') - .default, - nestedSchemaKeys: require('./nested-schema-keys').default, - operationMethods: require('./constants').default, - pathHasMinimallyRepresentedResource: - require('./path-has-minimally-represented-resource').default, - pathMatchesRegexp: require('./path-matches-regexp').default, - ...require('./date-based-utils').default, - ...require('./mimetype-utils').default, - ...require('./pagination-utils').default, - ...require('./path-location-utils').default, - ...require('./schema-finding-utils'), +import computeRefsAtPaths from './compute-refs-at-paths.js'; +import getCompositeSchemaAttribute from './get-composite-schema-attribute.js'; +import getResourceSpecificSiblingPath from './get-resource-specific-sibling-path.js'; +import getResourceOrientedPaths from './get-resource-oriented-paths.js'; +import getResponseCodes from './get-response-codes.js'; +import getSchemaNameAtPath from './get-schema-name-at-path.js'; +import isCreateOperation from './is-create-operation.js'; +import isDeprecated from './is-deprecated.js'; +import isEmptyObjectSchema from './is-empty-object-schema.js'; +import isOperationOfType from './is-operation-of-type.js'; +import isRefSiblingSchema from './is-ref-sibling-schema.js'; +import isRequestBodyExploded from './is-requestbody-exploded.js'; +import LoggerFactory from './logger-factory.js'; +import mergeAllOfSchemaProperties from './merge-allof-schema-properties.js'; +import nestedSchemaKeys from './nested-schema-keys.js'; +import operationMethods from './constants.js'; +import pathHasMinimallyRepresentedResource from './path-has-minimally-represented-resource.js'; +import pathMatchesRegexp from './path-matches-regexp.js'; +import dateBasedUtils from './date-based-utils.js'; +import mimetypeUtils from './mimetype-utils.js'; +import paginationUtils from './pagination-utils.js'; +import pathLocationUtils from './path-location-utils.js'; +import * as schemaFindingUtils from './schema-finding-utils.js'; + +export { + computeRefsAtPaths, + getCompositeSchemaAttribute, + getResourceSpecificSiblingPath, + getResourceOrientedPaths, + getResponseCodes, + getSchemaNameAtPath, + isCreateOperation, + isDeprecated, + isEmptyObjectSchema, + isOperationOfType, + isRefSiblingSchema, + isRequestBodyExploded, + LoggerFactory, + mergeAllOfSchemaProperties, + nestedSchemaKeys, + operationMethods, + pathHasMinimallyRepresentedResource, + pathMatchesRegexp, }; + +// Re-export all named exports from utility modules +export const { + isDateBasedName, + isDateBasedValue, +} = dateBasedUtils; + +export const { + isFormMimeType, + isJsonMimeType, + isJsonPatchMimeType, + isMergePatchMimeType, + supportsJsonContent, +} = mimetypeUtils; + +export const { + getOffsetParamIndex, + getLimitParamIndex, + getPageTokenParamIndex, + getResponseSchema, + getPaginatedOperationFromPath, +} = paginationUtils; + +export const { + isPathParam, + pathHasTemplates, + pathMatchesTemplate, +} = pathLocationUtils; + +export const { + getSuccessResponseSchemaForOperation, + getRequestBodySchemaForOperation, + getCanonicalSchemaForPath, +} = schemaFindingUtils; + +// Made with Bob diff --git a/packages/ruleset/src/utils/is-create-operation.js b/packages/ruleset/src/utils/is-create-operation.js index 394197fe4..63023aa3a 100644 --- a/packages/ruleset/src/utils/is-create-operation.js +++ b/packages/ruleset/src/utils/is-create-operation.js @@ -3,10 +3,9 @@ * SPDX-License-Identifier: Apache2.0 */ -const { isObject } = require('@ibm-cloud/openapi-ruleset-utilities'); -const isOperationOfType = require('./is-operation-of-type').default; -const getResourceSpecificSiblingPath = - require('./get-resource-specific-sibling-path').default; +import { isObject } from '@ibm-cloud/openapi-ruleset-utilities'; +import isOperationOfType from './is-operation-of-type.js'; +import getResourceSpecificSiblingPath from './get-resource-specific-sibling-path.js'; /** * Returns `true` if the operation represents a "create" operation. @@ -40,4 +39,4 @@ function isCreateOperation(operation, path, apidef) { return !!siblingPath; } -module.exports = isCreateOperation; +export default isCreateOperation; diff --git a/packages/ruleset/src/utils/is-requestbody-exploded.js b/packages/ruleset/src/utils/is-requestbody-exploded.js index 3ab49c21a..cf8c8f3e1 100644 --- a/packages/ruleset/src/utils/is-requestbody-exploded.js +++ b/packages/ruleset/src/utils/is-requestbody-exploded.js @@ -1,5 +1,7 @@ import { isArraySchema } from '@ibm-cloud/openapi-ruleset-utilities'; -import { supportsJsonContent } from './mimetype-utils'; +import mimetypeUtils from './mimetype-utils.js'; + +const { supportsJsonContent } = mimetypeUtils; /** * Returns true iff the specified requestBody defines JSON content that will be exploded by diff --git a/packages/ruleset/src/utils/schema-finding-utils.js b/packages/ruleset/src/utils/schema-finding-utils.js index a0a47247c..7c139391e 100644 --- a/packages/ruleset/src/utils/schema-finding-utils.js +++ b/packages/ruleset/src/utils/schema-finding-utils.js @@ -3,13 +3,12 @@ * SPDX-License-Identifier: Apache2.0 */ -const { isObject } = require('@ibm-cloud/openapi-ruleset-utilities'); -const getResponseCodes = require('./get-response-codes').default; +import { isObject } from '@ibm-cloud/openapi-ruleset-utilities'; +import getResponseCodes from './get-response-codes.js'; +import mimetypeUtils from './mimetype-utils.js'; +import getSchemaNameAtPath from './get-schema-name-at-path.js'; -const { isJsonMimeType, isJsonPatchMimeType, isMergePatchMimeType } = - require('./mimetype-utils').default; - -const getSchemaNameAtPath = require('./get-schema-name-at-path').default; +const { isJsonMimeType, isJsonPatchMimeType, isMergePatchMimeType } = mimetypeUtils; /** * Takes an operation object/path combo and finds the JSON success @@ -210,7 +209,7 @@ function getCanonicalSchemaForPath( }; } -module.exports = { +export { getSuccessResponseSchemaForOperation, getRequestBodySchemaForOperation, getCanonicalSchemaForPath, diff --git a/packages/utilities/package.json b/packages/utilities/package.json index 693867b7b..0c625c241 100644 --- a/packages/utilities/package.json +++ b/packages/utilities/package.json @@ -5,7 +5,11 @@ "version": "1.9.1", "license": "Apache-2.0", "private": false, - "exports": "./src/index.js", + "exports": { + ".": "./src/index.js", + "./src/collections": "./src/collections/index.js", + "./src/utils": "./src/utils/index.js" + }, "types": "./types/index.d.ts", "repository": { "type": "git", diff --git a/packages/utilities/src/index.js b/packages/utilities/src/index.js index b89e8c709..dccf40354 100644 --- a/packages/utilities/src/index.js +++ b/packages/utilities/src/index.js @@ -8,10 +8,13 @@ * in the context of a Spectral ruleset. * @module @ibm-cloud/openapi-ruleset-utilities */ +import utils from './utils/index.js'; +import collections from './collections/index.js'; + export default { - ...require('./utils').default, + ...utils, collections: { - ...require('./collections').default, + ...collections, }, }; diff --git a/packages/utilities/src/utils/get-examples-for-schema.js b/packages/utilities/src/utils/get-examples-for-schema.js index e48cfb43b..5133fe4a3 100644 --- a/packages/utilities/src/utils/get-examples-for-schema.js +++ b/packages/utilities/src/utils/get-examples-for-schema.js @@ -6,8 +6,7 @@ /** * @private */ -const collectFromComposedSchemas = - require('./collect-from-composed-schemas').default; +import collectFromComposedSchemas from './collect-from-composed-schemas.js'; /** * Returns an array of examples for a simple or composite schema. For each composed schema, if @@ -27,4 +26,4 @@ function getExamplesForSchema(schema) { }); } -module.exports = getExamplesForSchema; +export default getExamplesForSchema; diff --git a/packages/utilities/src/utils/get-property-names-for-schema.js b/packages/utilities/src/utils/get-property-names-for-schema.js index 92c958b5c..073fc7d4a 100644 --- a/packages/utilities/src/utils/get-property-names-for-schema.js +++ b/packages/utilities/src/utils/get-property-names-for-schema.js @@ -6,12 +6,11 @@ /** * @private */ -const isObject = require('./is-object').default; +import isObject from './is-object.js'; /** * @private */ -const collectFromComposedSchemas = - require('./collect-from-composed-schemas').default; +import collectFromComposedSchemas from './collect-from-composed-schemas.js'; /** * Returns an array of property names for a simple or composite schema, @@ -36,4 +35,4 @@ function getPropertyNamesForSchema(schema, propertyFilter = () => true) { }); } -module.exports = getPropertyNamesForSchema; +export default getPropertyNamesForSchema; diff --git a/packages/utilities/src/utils/index.js b/packages/utilities/src/utils/index.js index 49c4c17f0..c9f7c5bec 100644 --- a/packages/utilities/src/utils/index.js +++ b/packages/utilities/src/utils/index.js @@ -3,20 +3,32 @@ * SPDX-License-Identifier: Apache2.0 */ +import collectFromComposedSchemas from './collect-from-composed-schemas.js'; +import getExamplesForSchema from './get-examples-for-schema.js'; +import getPropertyNamesForSchema from './get-property-names-for-schema.js'; +import getSchemaType from './get-schema-type.js'; +import isObject from './is-object.js'; +import schemaHasConstraint from './schema-has-constraint.js'; +import schemaHasProperty from './schema-has-property.js'; +import schemaLooselyHasConstraint from './schema-loosely-has-constraint.js'; +import schemaRequiresProperty from './schema-requires-property.js'; +import spectralContextUtils from './spectral-context-utils.js'; +import validateComposedSchemas from './validate-composed-schemas.js'; +import validateNestedSchemas from './validate-nested-schemas.js'; +import validateSubschemas from './validate-subschemas.js'; + export default { - collectFromComposedSchemas: require('./collect-from-composed-schemas') - .default, - getExamplesForSchema: require('./get-examples-for-schema'), - getPropertyNamesForSchema: require('./get-property-names-for-schema'), - ...require('./get-schema-type').default, - isObject: require('./is-object').default, - schemaHasConstraint: require('./schema-has-constraint').default, - schemaHasProperty: require('./schema-has-property').default, - schemaLooselyHasConstraint: require('./schema-loosely-has-constraint') - .default, - schemaRequiresProperty: require('./schema-requires-property').default, - ...require('./spectral-context-utils').default, - validateComposedSchemas: require('./validate-composed-schemas').default, - validateNestedSchemas: require('./validate-nested-schemas').default, - validateSubschemas: require('./validate-subschemas').default, + collectFromComposedSchemas, + getExamplesForSchema, + getPropertyNamesForSchema, + ...getSchemaType, + isObject, + schemaHasConstraint, + schemaHasProperty, + schemaLooselyHasConstraint, + schemaRequiresProperty, + ...spectralContextUtils, + validateComposedSchemas, + validateNestedSchemas, + validateSubschemas, }; From 268c6d6b891425886340755cb98eaff9776e87f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=ADdia=20Tarcza?= <100163235+diatrcz@users.noreply.github.com> Date: Thu, 18 Jun 2026 11:29:46 +0200 Subject: [PATCH 11/16] tmp MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Lídia Tarcza <100163235+diatrcz@users.noreply.github.com> --- package-lock.json | 143 ++++++------------ packages/ruleset/package.json | 8 +- .../ruleset/src/functions/array-attributes.js | 2 +- .../src/functions/duplicate-path-parameter.js | 4 +- .../operationid-naming-convention.js | 5 +- .../resource-response-consistency.js | 2 +- packages/ruleset/src/ibm-oas.js | 2 +- packages/ruleset/src/utils/index.js | 7 + .../src/utils/is-requestbody-exploded.js | 4 +- packages/ruleset/src/utils/logger-factory.js | 6 +- .../utils/merge-allof-schema-properties.js | 3 +- .../ruleset/src/utils/pagination-utils.js | 7 +- .../ruleset/src/utils/path-location-utils.js | 2 +- .../rules/error-content-type-is-json.test.js | 9 +- .../test/rules/operation-responses.test.js | 9 +- packages/ruleset/test/test-utils/index.js | 16 +- packages/ruleset/vitest.config.js | 2 +- packages/utilities/package.json | 2 +- packages/utilities/src/index.js | 40 +++++ .../utilities/src/utils/get-schema-type.js | 4 +- .../src/utils/schema-has-constraint.js | 2 +- .../src/utils/schema-has-property.js | 4 +- .../utils/schema-loosely-has-constraint.js | 2 +- .../src/utils/schema-requires-property.js | 4 +- .../src/utils/validate-composed-schemas.js | 2 +- .../src/utils/validate-nested-schemas.js | 4 +- .../src/utils/validate-subschemas.js | 6 +- packages/validator/package.json | 4 +- packages/validator/src/cli-validator/index.js | 2 +- .../src/cli-validator/run-validator.js | 2 +- .../utils/check-ruleset-version.js | 2 +- .../src/cli-validator/utils/cli-options.js | 2 +- .../utils/get-copyright-string.js | 2 +- .../src/cli-validator/utils/print-versions.js | 8 +- .../validator/src/markdown-report/index.js | 4 +- .../src/scoring-tool/compute-metrics.js | 2 +- packages/validator/src/scoring-tool/index.js | 4 +- packages/validator/src/spectral/index.js | 2 +- 38 files changed, 166 insertions(+), 169 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9a5f1ed92..c264b4c70 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1828,14 +1828,14 @@ } }, "node_modules/@stoplight/spectral-cli": { - "version": "6.14.2", - "resolved": "https://registry.npmjs.org/@stoplight/spectral-cli/-/spectral-cli-6.14.2.tgz", - "integrity": "sha512-yn49Tkin/Zzjwt39CbQvj3NZVolvXrjO3OLNn+Yd+LhQE5C96QNsULuE4q98e7+WRcLu4gK+Z0l5CxYNtsoPtw==", + "version": "6.16.0", + "resolved": "https://registry.npmjs.org/@stoplight/spectral-cli/-/spectral-cli-6.16.0.tgz", + "integrity": "sha512-P1acHIV/hDiO3w0YNUc3pD7/0q68SMAMyWVxAPUGzsAeq50lLpl0obN5j3QITMgJPhPByvBIjBV4ftkBd8nwMg==", "license": "Apache-2.0", "dependencies": { "@stoplight/json": "~3.21.0", "@stoplight/path": "1.3.2", - "@stoplight/spectral-core": "^1.19.4", + "@stoplight/spectral-core": "^1.19.5", "@stoplight/spectral-formatters": "^1.4.1", "@stoplight/spectral-parsers": "^1.0.4", "@stoplight/spectral-ref-resolver": "^1.0.4", @@ -1847,7 +1847,7 @@ "chalk": "4.1.2", "fast-glob": "~3.2.12", "hpagent": "~1.2.0", - "lodash": "~4.17.21", + "lodash": "^4.18.1", "pony-cause": "^1.1.1", "stacktracey": "^2.1.8", "tslib": "^2.8.1", @@ -1860,16 +1860,10 @@ "node": "^16.20 || ^18.18 || >= 20.17" } }, - "node_modules/@stoplight/spectral-cli/node_modules/lodash": { - "version": "4.17.23", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.23.tgz", - "integrity": "sha512-LgVTMpQtIopCi79SJeDiP0TfWi5CNEc/L/aRdTh3yIvmZXTnheWpKjSZhnvMl8iXbC1tFg9gdHHDMLoV7CnG+w==", - "license": "MIT" - }, "node_modules/@stoplight/spectral-core": { - "version": "1.19.4", - "resolved": "https://registry.npmjs.org/@stoplight/spectral-core/-/spectral-core-1.19.4.tgz", - "integrity": "sha512-8hnZXfssTlV99SKo8J8BwMt5LsiBFHkCh0V3P7j8IPcCNl//bpG92U4TpYy7AwmUms/zCLX7sxNQC6AZ+bkfzg==", + "version": "1.23.0", + "resolved": "https://registry.npmjs.org/@stoplight/spectral-core/-/spectral-core-1.23.0.tgz", + "integrity": "sha512-WvdgmiiJrjiMrcw7ByxfcYtUvAXNp2MhAfcEIXP3Mn8ZOVwyAWIsFjLlsE5zRqj0LuN8+7OQM/L+BMcHj6x/BQ==", "license": "Apache-2.0", "dependencies": { "@stoplight/better-ajv-errors": "1.0.3", @@ -1881,17 +1875,17 @@ "@stoplight/types": "~13.6.0", "@types/es-aggregate-error": "^1.0.2", "@types/json-schema": "^7.0.11", - "ajv": "^8.17.1", + "ajv": "^8.18.0", "ajv-errors": "~3.0.0", - "ajv-formats": "~2.1.0", + "ajv-formats": "~2.1.1", "es-aggregate-error": "^1.0.7", - "jsonpath-plus": "10.2.0", - "lodash": "~4.17.21", + "expr-eval-fork": "^3.0.1", + "jsonpath-plus": "^10.3.0", + "lodash": "^4.18.1", "lodash.topath": "^4.5.2", - "minimatch": "3.1.2", + "minimatch": "^3.1.4", "nimma": "0.2.3", "pony-cause": "^1.1.1", - "simple-eval": "1.0.1", "tslib": "^2.8.1" }, "engines": { @@ -1927,12 +1921,6 @@ "concat-map": "0.0.1" } }, - "node_modules/@stoplight/spectral-core/node_modules/lodash": { - "version": "4.17.23", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.23.tgz", - "integrity": "sha512-LgVTMpQtIopCi79SJeDiP0TfWi5CNEc/L/aRdTh3yIvmZXTnheWpKjSZhnvMl8iXbC1tFg9gdHHDMLoV7CnG+w==", - "license": "MIT" - }, "node_modules/@stoplight/spectral-core/node_modules/minimatch": { "version": "3.1.5", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", @@ -1965,13 +1953,13 @@ } }, "node_modules/@stoplight/spectral-formats": { - "version": "1.8.2", - "resolved": "https://registry.npmjs.org/@stoplight/spectral-formats/-/spectral-formats-1.8.2.tgz", - "integrity": "sha512-c06HB+rOKfe7tuxg0IdKDEA5XnjL2vrn/m/OVIIxtINtBzphZrOgtRn7epQ5bQF5SWp84Ue7UJWaGgDwVngMFw==", + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/@stoplight/spectral-formats/-/spectral-formats-1.8.3.tgz", + "integrity": "sha512-lfYzkHYS2mZQdm3k+TQ0lvXZ66vdBzJuy6awA4kXgQ0jWBbOC/FHzhBk5BaIVo2QRLUAGjMqWSd72WFryi+EvA==", "license": "Apache-2.0", "dependencies": { "@stoplight/json": "^3.17.0", - "@stoplight/spectral-core": "^1.19.2", + "@stoplight/spectral-core": "1.23.0", "@types/json-schema": "^7.0.7", "tslib": "^2.8.1" }, @@ -2004,33 +1992,27 @@ } }, "node_modules/@stoplight/spectral-functions": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/@stoplight/spectral-functions/-/spectral-functions-1.9.3.tgz", - "integrity": "sha512-jy4mguk0Ddz0Vr76PHervOZeyXTUW650zVfNT2Vt9Ji3SqtTVziHjq913CBVEGFS+IQw1McUXuHVLM6YKVZ6fQ==", + "version": "1.10.3", + "resolved": "https://registry.npmjs.org/@stoplight/spectral-functions/-/spectral-functions-1.10.3.tgz", + "integrity": "sha512-AM7Gbh7pv1Mpc6fdVuR7N6C5t5KT3QKDHeBPA27Cw/GAch1VJnHkCV9R/SxDrvOgZ3tL1xrtAGFuNFwRvVdz3g==", "license": "Apache-2.0", "dependencies": { "@stoplight/better-ajv-errors": "1.0.3", "@stoplight/json": "^3.17.1", - "@stoplight/spectral-core": "^1.19.4", + "@stoplight/spectral-core": "1.23.0", "@stoplight/spectral-formats": "^1.8.1", "@stoplight/spectral-runtime": "^1.1.2", - "ajv": "^8.17.1", + "ajv": "^8.18.0", "ajv-draft-04": "~1.0.0", "ajv-errors": "~3.0.0", - "ajv-formats": "~2.1.0", - "lodash": "~4.17.21", + "ajv-formats": "~2.1.1", + "lodash": "^4.18.1", "tslib": "^2.8.1" }, "engines": { "node": "^16.20 || ^18.18 || >= 20.17" } }, - "node_modules/@stoplight/spectral-functions/node_modules/lodash": { - "version": "4.17.23", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.23.tgz", - "integrity": "sha512-LgVTMpQtIopCi79SJeDiP0TfWi5CNEc/L/aRdTh3yIvmZXTnheWpKjSZhnvMl8iXbC1tFg9gdHHDMLoV7CnG+w==", - "license": "MIT" - }, "node_modules/@stoplight/spectral-parsers": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/@stoplight/spectral-parsers/-/spectral-parsers-1.0.5.tgz", @@ -2149,15 +2131,15 @@ "license": "Apache-2.0" }, "node_modules/@stoplight/spectral-rulesets": { - "version": "1.22.1", - "resolved": "https://registry.npmjs.org/@stoplight/spectral-rulesets/-/spectral-rulesets-1.22.1.tgz", - "integrity": "sha512-DaaQJioKuYkRsOuKIJfX2ek7G7f6OCU3CI3K7ABaOcTFMiHj29SJLDdb04mCjXZFXMlXHjmCl2ZpKW6heieXpw==", + "version": "1.22.4", + "resolved": "https://registry.npmjs.org/@stoplight/spectral-rulesets/-/spectral-rulesets-1.22.4.tgz", + "integrity": "sha512-Lwr4DVg8aEqiBcm2CMQAP1FIBmLP9Y8Z2st7jvbxzv3fXmThdafVMy6CrydWH46T4Wotm+UuBJFnqJd9H4RQZQ==", "license": "Apache-2.0", "dependencies": { "@asyncapi/specs": "^6.8.0", "@stoplight/better-ajv-errors": "1.0.3", "@stoplight/json": "^3.17.0", - "@stoplight/spectral-core": "^1.19.4", + "@stoplight/spectral-core": "1.23.0", "@stoplight/spectral-formats": "^1.8.1", "@stoplight/spectral-functions": "^1.9.1", "@stoplight/spectral-runtime": "^1.1.2", @@ -4415,6 +4397,15 @@ "node": ">=12.0.0" } }, + "node_modules/expr-eval-fork": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/expr-eval-fork/-/expr-eval-fork-3.0.3.tgz", + "integrity": "sha512-BhC+hbc5lIVjygr840n5DEkW3MQq7H9o+mc1/N7Z5uIiCFVyESLL5DIE7LNq4CYUNxy+XjA+3jRrL/h0Kt2xcg==", + "license": "MIT", + "engines": { + "node": ">=16.9.0" + } + }, "node_modules/fast-content-type-parse": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/fast-content-type-parse/-/fast-content-type-parse-3.0.0.tgz", @@ -11093,18 +11084,6 @@ ], "license": "MIT" }, - "node_modules/simple-eval": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/simple-eval/-/simple-eval-1.0.1.tgz", - "integrity": "sha512-LH7FpTAkeD+y5xQC4fzS+tFtaNlvt3Ib1zKzvhjv/Y+cioV4zIuw4IZr2yhRLu67CWL7FR9/6KXKnjRoZTvGGQ==", - "license": "MIT", - "dependencies": { - "jsep": "^1.3.6" - }, - "engines": { - "node": ">=12" - } - }, "node_modules/simple-get": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-4.0.1.tgz", @@ -12587,9 +12566,9 @@ "license": "Apache-2.0", "dependencies": { "@ibm-cloud/openapi-ruleset-utilities": "1.9.1", - "@stoplight/spectral-formats": "1.8.2", - "@stoplight/spectral-functions": "1.9.3", - "@stoplight/spectral-rulesets": "1.21.3", + "@stoplight/spectral-formats": "1.8.3", + "@stoplight/spectral-functions": "1.10.3", + "@stoplight/spectral-rulesets": "1.22.4", "chalk": "4.1.2", "inflected": "2.1.0", "jsonschema": "1.5.0", @@ -12600,51 +12579,19 @@ "validator": "13.15.23" }, "devDependencies": { - "@stoplight/spectral-core": "1.19.4", + "@stoplight/spectral-core": "1.23.0", "vitest": "4.1.8" }, "engines": { "node": ">=24.0.0" } }, - "packages/ruleset/node_modules/@stoplight/spectral-rulesets": { - "version": "1.21.3", - "resolved": "https://registry.npmjs.org/@stoplight/spectral-rulesets/-/spectral-rulesets-1.21.3.tgz", - "integrity": "sha512-SQp/NNDykfCvgmo9DW1pBAbmyKRHhEHmsc28kuRHC6nJblGFsLyNVGkEDjSIJuviR7ooC2Y00vmf0R3OGcyhyw==", - "license": "Apache-2.0", - "dependencies": { - "@asyncapi/specs": "^6.8.0", - "@stoplight/better-ajv-errors": "1.0.3", - "@stoplight/json": "^3.17.0", - "@stoplight/spectral-core": "^1.19.4", - "@stoplight/spectral-formats": "^1.8.1", - "@stoplight/spectral-functions": "^1.9.1", - "@stoplight/spectral-runtime": "^1.1.2", - "@stoplight/types": "^13.6.0", - "@types/json-schema": "^7.0.7", - "ajv": "^8.17.1", - "ajv-formats": "~2.1.0", - "json-schema-traverse": "^1.0.0", - "leven": "3.1.0", - "lodash": "~4.17.21", - "tslib": "^2.8.1" - }, - "engines": { - "node": "^16.20 || ^18.18 || >= 20.17" - } - }, - "packages/ruleset/node_modules/@stoplight/spectral-rulesets/node_modules/lodash": { - "version": "4.17.23", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.23.tgz", - "integrity": "sha512-LgVTMpQtIopCi79SJeDiP0TfWi5CNEc/L/aRdTh3yIvmZXTnheWpKjSZhnvMl8iXbC1tFg9gdHHDMLoV7CnG+w==", - "license": "MIT" - }, "packages/utilities": { "name": "@ibm-cloud/openapi-ruleset-utilities", "version": "1.9.1", "license": "Apache-2.0", "devDependencies": { - "@stoplight/spectral-core": "1.19.4", + "@stoplight/spectral-core": "1.23.0", "@vitest/coverage-v8": "^4.1.8", "typescript": "5.8.3", "vitest": "4.1.8" @@ -12660,8 +12607,8 @@ "dependencies": { "@ibm-cloud/openapi-ruleset": "1.33.9", "@ibm-cloud/openapi-ruleset-utilities": "1.9.1", - "@stoplight/spectral-cli": "6.14.2", - "@stoplight/spectral-core": "1.19.4", + "@stoplight/spectral-cli": "6.16.0", + "@stoplight/spectral-core": "1.23.0", "@stoplight/spectral-parsers": "1.0.5", "@stoplight/spectral-ref-resolver": "1.0.5", "ajv": "8.18.0", diff --git a/packages/ruleset/package.json b/packages/ruleset/package.json index 05ffae64c..88931f9b3 100644 --- a/packages/ruleset/package.json +++ b/packages/ruleset/package.json @@ -22,9 +22,9 @@ }, "dependencies": { "@ibm-cloud/openapi-ruleset-utilities": "1.9.1", - "@stoplight/spectral-formats": "1.8.2", - "@stoplight/spectral-functions": "1.9.3", - "@stoplight/spectral-rulesets": "1.21.3", + "@stoplight/spectral-formats": "1.8.3", + "@stoplight/spectral-functions": "1.10.3", + "@stoplight/spectral-rulesets": "1.22.4", "chalk": "4.1.2", "inflected": "2.1.0", "jsonschema": "1.5.0", @@ -35,7 +35,7 @@ "validator": "13.15.23" }, "devDependencies": { - "@stoplight/spectral-core": "1.19.4", + "@stoplight/spectral-core": "1.23.0", "vitest": "4.1.8" }, "engines": { diff --git a/packages/ruleset/src/functions/array-attributes.js b/packages/ruleset/src/functions/array-attributes.js index 76dca46ee..3672c6cf0 100644 --- a/packages/ruleset/src/functions/array-attributes.js +++ b/packages/ruleset/src/functions/array-attributes.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -import { isPlainObject } from 'lodash'; +import isPlainObject from 'lodash/isPlainObject'; import { validateNestedSchemas, isArraySchema, diff --git a/packages/ruleset/src/functions/duplicate-path-parameter.js b/packages/ruleset/src/functions/duplicate-path-parameter.js index df4e11fdf..dc3ebc112 100644 --- a/packages/ruleset/src/functions/duplicate-path-parameter.js +++ b/packages/ruleset/src/functions/duplicate-path-parameter.js @@ -3,7 +3,9 @@ * SPDX-License-Identifier: Apache2.0 */ -import { flatten, isEqual, uniqWith } from 'lodash'; +import flatten from 'lodash/flatten'; +import isEqual from 'lodash/isEqual'; +import uniqWith from 'lodash/uniqWith' import { operationMethods, LoggerFactory } from '../utils'; let ruleId; diff --git a/packages/ruleset/src/functions/operationid-naming-convention.js b/packages/ruleset/src/functions/operationid-naming-convention.js index b589985e3..94fd7952e 100644 --- a/packages/ruleset/src/functions/operationid-naming-convention.js +++ b/packages/ruleset/src/functions/operationid-naming-convention.js @@ -3,7 +3,10 @@ * SPDX-License-Identifier: Apache2.0 */ -import { each, merge, pickBy, reduce } from 'lodash'; +import each from 'lodash/each'; +import merge from 'lodash/merge'; +import pickBy from 'lodash/pickBy'; +import reduce from 'lodash/reduce'; import { operationMethods } from '../utils'; import { singularize } from 'inflected'; diff --git a/packages/ruleset/src/functions/resource-response-consistency.js b/packages/ruleset/src/functions/resource-response-consistency.js index 3c09b2f6b..f9712844c 100644 --- a/packages/ruleset/src/functions/resource-response-consistency.js +++ b/packages/ruleset/src/functions/resource-response-consistency.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -import { isEqual } from 'lodash'; +import isEqual from 'lodash/isEqual'; import { isObject, getResolvedSpec, diff --git a/packages/ruleset/src/ibm-oas.js b/packages/ruleset/src/ibm-oas.js index 6e4c3d5cb..82fe67ed2 100644 --- a/packages/ruleset/src/ibm-oas.js +++ b/packages/ruleset/src/ibm-oas.js @@ -98,7 +98,7 @@ import { validPathSegments, validSchemaExample, wellDefinedDictionaries, -} from './rules'; +} from './rules/index.js'; // Spectral's "no-$ref-siblings" rule is configured to run on // OpenAPI 3.0.x documents (ref sibling attributes are allowed in OpenAPI 3.1.x). diff --git a/packages/ruleset/src/utils/index.js b/packages/ruleset/src/utils/index.js index 4fd0ef6a2..2b491a92e 100644 --- a/packages/ruleset/src/utils/index.js +++ b/packages/ruleset/src/utils/index.js @@ -66,11 +66,18 @@ export const { getOffsetParamIndex, getLimitParamIndex, getPageTokenParamIndex, + getSuccessCode, getResponseSchema, getPaginatedOperationFromPath, } = paginationUtils; export const { + isParamContentSchema, + isParamSchema, + isPrimarySchema, + isRequestBodySchema, + isResponseSchema, + isSchemaProperty, isPathParam, pathHasTemplates, pathMatchesTemplate, diff --git a/packages/ruleset/src/utils/is-requestbody-exploded.js b/packages/ruleset/src/utils/is-requestbody-exploded.js index cf8c8f3e1..8c3d8dd13 100644 --- a/packages/ruleset/src/utils/is-requestbody-exploded.js +++ b/packages/ruleset/src/utils/is-requestbody-exploded.js @@ -1,6 +1,8 @@ -import { isArraySchema } from '@ibm-cloud/openapi-ruleset-utilities'; +import utils from '@ibm-cloud/openapi-ruleset-utilities'; import mimetypeUtils from './mimetype-utils.js'; +const { isArraySchema } = utils; + const { supportsJsonContent } = mimetypeUtils; /** diff --git a/packages/ruleset/src/utils/logger-factory.js b/packages/ruleset/src/utils/logger-factory.js index aec132dee..ae9d2ad8f 100644 --- a/packages/ruleset/src/utils/logger-factory.js +++ b/packages/ruleset/src/utils/logger-factory.js @@ -5,8 +5,10 @@ import log from 'loglevel'; import { minimatch as _minimatch } from 'minimatch'; -import { reg, apply } from 'loglevel-plugin-prefix'; -import { magenta, cyan, green, yellow, red } from 'chalk'; +import prefix from 'loglevel-plugin-prefix'; +const { reg, apply } = prefix; +import chalk from 'chalk'; +const { magenta, cyan, green, yellow, red } = chalk; const colors = { TRACE: magenta, diff --git a/packages/ruleset/src/utils/merge-allof-schema-properties.js b/packages/ruleset/src/utils/merge-allof-schema-properties.js index 06b2e09a0..35de22b13 100644 --- a/packages/ruleset/src/utils/merge-allof-schema-properties.js +++ b/packages/ruleset/src/utils/merge-allof-schema-properties.js @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -import { isObject, mergeWith } from 'lodash'; +import isObject from 'lodash/isObject.js'; +import mergeWith from 'lodash/mergeWith.js'; // Takes a schema, and if an allOf field is provided, // merges all allOf schema properties to create one schema diff --git a/packages/ruleset/src/utils/pagination-utils.js b/packages/ruleset/src/utils/pagination-utils.js index 91eaf1305..0b21a388e 100644 --- a/packages/ruleset/src/utils/pagination-utils.js +++ b/packages/ruleset/src/utils/pagination-utils.js @@ -2,10 +2,11 @@ * Copyright 2023 - 2024 IBM Corporation. * SPDX-License-Identifier: Apache2.0 */ -import { isArraySchema } from '@ibm-cloud/openapi-ruleset-utilities'; -import mergeAllOfSchemaProperties from './merge-allof-schema-properties'; -import mimetypeUtils from './mimetype-utils'; +import utils from '@ibm-cloud/openapi-ruleset-utilities'; +import mergeAllOfSchemaProperties from './merge-allof-schema-properties.js'; +import mimetypeUtils from './mimetype-utils.js'; const { isJsonMimeType } = mimetypeUtils; +const { isArraySchema } = utils; /** * Looks for a query parameter called "offset" and returns the diff --git a/packages/ruleset/src/utils/path-location-utils.js b/packages/ruleset/src/utils/path-location-utils.js index ea2bdb990..a63eb6f31 100644 --- a/packages/ruleset/src/utils/path-location-utils.js +++ b/packages/ruleset/src/utils/path-location-utils.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -import pathMatchesRegexp from './path-matches-regexp'; +import pathMatchesRegexp from './path-matches-regexp.js'; /** * Returns true if the path points to a schema object within diff --git a/packages/ruleset/test/rules/error-content-type-is-json.test.js b/packages/ruleset/test/rules/error-content-type-is-json.test.js index 3fde544c9..5093f85e3 100644 --- a/packages/ruleset/test/rules/error-content-type-is-json.test.js +++ b/packages/ruleset/test/rules/error-content-type-is-json.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { errorContentTypeIsJson } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { errorContentTypeIsJson } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const ruleId = 'ibm-error-content-type-is-json'; const rule = errorContentTypeIsJson; diff --git a/packages/ruleset/test/rules/operation-responses.test.js b/packages/ruleset/test/rules/operation-responses.test.js index 940929974..4caf519db 100644 --- a/packages/ruleset/test/rules/operation-responses.test.js +++ b/packages/ruleset/test/rules/operation-responses.test.js @@ -3,13 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { operationResponses } = require('../../src/rules'); -const { - makeCopy, - rootDocument, - testRule, - severityCodes, -} = require('../test-utils'); +import { operationResponses } from '../../src/rules'; +import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const rule = operationResponses; const ruleId = 'ibm-operation-responses'; diff --git a/packages/ruleset/test/test-utils/index.js b/packages/ruleset/test/test-utils/index.js index f974186ee..7545ccf0b 100644 --- a/packages/ruleset/test/test-utils/index.js +++ b/packages/ruleset/test/test-utils/index.js @@ -3,13 +3,13 @@ * SPDX-License-Identifier: Apache2.0 */ -import allSchemasDocument from './all-schemas-document'; -import makeCopy from './make-copy'; -import testRule from './test-rule'; -import unitTestRule from './unit-test-rule'; -import rootDocument from './root-document'; -import severityCodes from './severity-codes'; -import helperArtifacts from './helper-artifacts'; +import allSchemasDocument from './all-schemas-document.js'; +import makeCopy from './make-copy.js'; +import testRule from './test-rule.js'; +import unitTestRule from './unit-test-rule.js'; +import rootDocument from './root-document.js'; +import * as severityCodes from './severity-codes.js'; +import helperArtifacts from './helper-artifacts.js'; export default { allSchemasDocument, @@ -20,3 +20,5 @@ export default { severityCodes, helperArtifacts, }; + +export { allSchemasDocument, makeCopy, rootDocument, testRule, unitTestRule, severityCodes, helperArtifacts }; diff --git a/packages/ruleset/vitest.config.js b/packages/ruleset/vitest.config.js index 3cd42f48d..0ee51979f 100644 --- a/packages/ruleset/vitest.config.js +++ b/packages/ruleset/vitest.config.js @@ -15,5 +15,5 @@ export default defineConfig({ 'nimma/legacy': '../../node_modules/@stoplight/spectral-core/node_modules/nimma/dist/legacy/cjs', 'nimma/fallbacks': '../../node_modules/@stoplight/spectral-core/node_modules/nimma/dist/legacy/cjs/fallbacks/', }, - }, + } }); \ No newline at end of file diff --git a/packages/utilities/package.json b/packages/utilities/package.json index 0c625c241..4828caabf 100644 --- a/packages/utilities/package.json +++ b/packages/utilities/package.json @@ -26,7 +26,7 @@ "pkg": "echo no executables to build in this package" }, "devDependencies": { - "@stoplight/spectral-core": "1.19.4", + "@stoplight/spectral-core": "1.23.0", "@vitest/coverage-v8": "^4.1.8", "typescript": "5.8.3", "vitest": "4.1.8" diff --git a/packages/utilities/src/index.js b/packages/utilities/src/index.js index dccf40354..1bfffeef8 100644 --- a/packages/utilities/src/index.js +++ b/packages/utilities/src/index.js @@ -11,6 +11,7 @@ import utils from './utils/index.js'; import collections from './collections/index.js'; +// Export everything as default export default { ...utils, @@ -18,3 +19,42 @@ export default { ...collections, }, }; + +// Also export everything as named exports for backward compatibility +export const { + collectFromComposedSchemas, + getExamplesForSchema, + getPropertyNamesForSchema, + getSchemaType, + SchemaType, + isArraySchema, + isBinarySchema, + isBooleanSchema, + isByteSchema, + isDateSchema, + isDateTimeSchema, + isDoubleSchema, + isEnumerationSchema, + isFloatSchema, + isInt32Schema, + isInt64Schema, + isIntegerSchema, + isNumberSchema, + isObjectSchema, + isPrimitiveSchema, + isStringSchema, + schemaIsOfType, + isObject, + schemaHasConstraint, + schemaHasProperty, + schemaLooselyHasConstraint, + schemaRequiresProperty, + getNodes, + getResolvedSpec, + getUnresolvedSpec, + validateComposedSchemas, + validateNestedSchemas, + validateSubschemas, +} = utils; + +export { collections }; diff --git a/packages/utilities/src/utils/get-schema-type.js b/packages/utilities/src/utils/get-schema-type.js index a19a08f08..f5df348bb 100644 --- a/packages/utilities/src/utils/get-schema-type.js +++ b/packages/utilities/src/utils/get-schema-type.js @@ -6,11 +6,11 @@ /** * @private */ -import isObject from './is-object'; +import isObject from './is-object.js'; /** * @private */ -import schemaHasConstraint from './schema-has-constraint'; +import schemaHasConstraint from './schema-has-constraint.js'; /** * An enumeration of non-mutually-exclusive schema types. diff --git a/packages/utilities/src/utils/schema-has-constraint.js b/packages/utilities/src/utils/schema-has-constraint.js index b148167ec..a91846ec4 100644 --- a/packages/utilities/src/utils/schema-has-constraint.js +++ b/packages/utilities/src/utils/schema-has-constraint.js @@ -6,7 +6,7 @@ /** * @private */ -import isObject from './is-object'; +import isObject from './is-object.js'; /** * This function will return `true` if all possible variations of a (possibly composite) schema diff --git a/packages/utilities/src/utils/schema-has-property.js b/packages/utilities/src/utils/schema-has-property.js index 894b8c163..96c51a789 100644 --- a/packages/utilities/src/utils/schema-has-property.js +++ b/packages/utilities/src/utils/schema-has-property.js @@ -6,11 +6,11 @@ /** * @private */ -import schemaHasConstraint from './schema-has-constraint'; +import schemaHasConstraint from './schema-has-constraint.js'; /** * @private */ -import isObject from './is-object'; +import isObject from './is-object.js'; /** * This function will return `true` if all possible variations of a (possibly composite) schema diff --git a/packages/utilities/src/utils/schema-loosely-has-constraint.js b/packages/utilities/src/utils/schema-loosely-has-constraint.js index 87326296e..39e9af67d 100644 --- a/packages/utilities/src/utils/schema-loosely-has-constraint.js +++ b/packages/utilities/src/utils/schema-loosely-has-constraint.js @@ -6,7 +6,7 @@ /** * @private */ -import isObject from './is-object'; +import isObject from './is-object.js'; /** * This function is a looser adaptation of the `schemaHasConstraint()` function. diff --git a/packages/utilities/src/utils/schema-requires-property.js b/packages/utilities/src/utils/schema-requires-property.js index 53af88f1d..47b36a649 100644 --- a/packages/utilities/src/utils/schema-requires-property.js +++ b/packages/utilities/src/utils/schema-requires-property.js @@ -6,11 +6,11 @@ /** * @private */ -import schemaHasConstraint from './schema-has-constraint'; +import schemaHasConstraint from './schema-has-constraint.js'; /** * @private */ -import schemaHasProperty from './schema-has-property'; +import schemaHasProperty from './schema-has-property.js'; /** * This function will return `true` if all possible variations of a (possibly composite) schema diff --git a/packages/utilities/src/utils/validate-composed-schemas.js b/packages/utilities/src/utils/validate-composed-schemas.js index b12824f0e..2f72d183d 100644 --- a/packages/utilities/src/utils/validate-composed-schemas.js +++ b/packages/utilities/src/utils/validate-composed-schemas.js @@ -6,7 +6,7 @@ /** * @private */ -import SchemaPath from './schema-path'; +import SchemaPath from './schema-path.js'; /** * Performs validation on a schema and all of its composed schemas. diff --git a/packages/utilities/src/utils/validate-nested-schemas.js b/packages/utilities/src/utils/validate-nested-schemas.js index f66614b80..4f7fba9c5 100644 --- a/packages/utilities/src/utils/validate-nested-schemas.js +++ b/packages/utilities/src/utils/validate-nested-schemas.js @@ -6,11 +6,11 @@ /** * @private */ -import isObject from './is-object'; +import isObject from './is-object.js'; /** * @private */ -import SchemaPath from './schema-path'; +import SchemaPath from './schema-path.js'; /** * Performs validation on a schema and all of its nested schemas. diff --git a/packages/utilities/src/utils/validate-subschemas.js b/packages/utilities/src/utils/validate-subschemas.js index 1c31ee2b2..4e895600e 100644 --- a/packages/utilities/src/utils/validate-subschemas.js +++ b/packages/utilities/src/utils/validate-subschemas.js @@ -6,15 +6,15 @@ /** * @private */ -import SchemaPath from './schema-path'; +import SchemaPath from './schema-path.js'; /** * @private */ -import validateComposedSchemas from './validate-composed-schemas'; +import validateComposedSchemas from './validate-composed-schemas.js'; /** * @private */ -import validateNestedSchemas from './validate-nested-schemas'; +import validateNestedSchemas from './validate-nested-schemas.js'; /** * Performs validation on a schema and all of its subschemas. diff --git a/packages/validator/package.json b/packages/validator/package.json index 7425d61f3..84313aa20 100644 --- a/packages/validator/package.json +++ b/packages/validator/package.json @@ -25,8 +25,8 @@ "dependencies": { "@ibm-cloud/openapi-ruleset": "1.33.9", "@ibm-cloud/openapi-ruleset-utilities": "1.9.1", - "@stoplight/spectral-cli": "6.14.2", - "@stoplight/spectral-core": "1.19.4", + "@stoplight/spectral-cli": "6.16.0", + "@stoplight/spectral-core": "1.23.0", "@stoplight/spectral-parsers": "1.0.5", "@stoplight/spectral-ref-resolver": "1.0.5", "ajv": "8.18.0", diff --git a/packages/validator/src/cli-validator/index.js b/packages/validator/src/cli-validator/index.js index a6e4fcf43..d1a077639 100755 --- a/packages/validator/src/cli-validator/index.js +++ b/packages/validator/src/cli-validator/index.js @@ -9,7 +9,7 @@ // the passed in argument (currently 16.0.0) require('./utils/check-version')('16.0.0'); -import runValidator from './run-validator'; +import runValidator from './run-validator.js'; runValidator(process.argv) .then(exitCode => { process.exitCode = exitCode; diff --git a/packages/validator/src/cli-validator/run-validator.js b/packages/validator/src/cli-validator/run-validator.js index 23c283efc..2f2b7ffba 100644 --- a/packages/validator/src/cli-validator/run-validator.js +++ b/packages/validator/src/cli-validator/run-validator.js @@ -22,7 +22,7 @@ import { printVersions, processArgs, supportedFileExtension, -} from './utils'; +} from './utils/index.js'; import { runSpectral } from '../spectral'; import { produceQualityScore, printScoreTables } from '../scoring-tool'; diff --git a/packages/validator/src/cli-validator/utils/check-ruleset-version.js b/packages/validator/src/cli-validator/utils/check-ruleset-version.js index f2ad1b5ef..0091bc9ed 100644 --- a/packages/validator/src/cli-validator/utils/check-ruleset-version.js +++ b/packages/validator/src/cli-validator/utils/check-ruleset-version.js @@ -4,7 +4,7 @@ */ import { lt } from 'semver'; -import getDefaultRulesetVersion from './get-default-ruleset-version'; +import getDefaultRulesetVersion from './get-default-ruleset-version.js'; export default checkRulesetVersion; diff --git a/packages/validator/src/cli-validator/utils/cli-options.js b/packages/validator/src/cli-validator/utils/cli-options.js index c2096d5d9..e5f7cc620 100644 --- a/packages/validator/src/cli-validator/utils/cli-options.js +++ b/packages/validator/src/cli-validator/utils/cli-options.js @@ -4,7 +4,7 @@ */ import { Command } from 'commander'; -import getCopyrightString from './get-copyright-string'; +import getCopyrightString from './get-copyright-string.js'; /** * This function is used to gather multi-valued arguments into an array. diff --git a/packages/validator/src/cli-validator/utils/get-copyright-string.js b/packages/validator/src/cli-validator/utils/get-copyright-string.js index 1019c1d11..22bf1f363 100644 --- a/packages/validator/src/cli-validator/utils/get-copyright-string.js +++ b/packages/validator/src/cli-validator/utils/get-copyright-string.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -import getVersionString from './get-version-string'; +import getVersionString from './get-version-string.js'; export default function () { return `IBM OpenAPI Validator (${getVersionString()}), @Copyright IBM Corporation 2017, ${new Date().getFullYear()}.`; diff --git a/packages/validator/src/cli-validator/utils/print-versions.js b/packages/validator/src/cli-validator/utils/print-versions.js index cf404943b..4ca385edb 100644 --- a/packages/validator/src/cli-validator/utils/print-versions.js +++ b/packages/validator/src/cli-validator/utils/print-versions.js @@ -4,10 +4,10 @@ */ import getDefaultRulesetVersion from './get-default-ruleset-version.js'; -import getLocalRulesetVersion from './get-local-ruleset-version'; -import getVersionString from './get-version-string'; -import checkRulesetVersion from './check-ruleset-version'; -import { findSpectralRuleset } from '../../spectral/utils'; +import getLocalRulesetVersion from './get-local-ruleset-version.js'; +import getVersionString from './get-version-string.js'; +import checkRulesetVersion from './check-ruleset-version.js'; +import { findSpectralRuleset } from '../../spectral/utils.js'; export default printVersions; diff --git a/packages/validator/src/markdown-report/index.js b/packages/validator/src/markdown-report/index.js index 6254332ad..4e6a0eae0 100644 --- a/packages/validator/src/markdown-report/index.js +++ b/packages/validator/src/markdown-report/index.js @@ -3,8 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -import getReport from './report'; -import writeReportToFile from './write-file'; +import getReport from './report.js'; +import writeReportToFile from './write-file.js'; function printMarkdownReport(context, results) { const report = getReport(context, results); diff --git a/packages/validator/src/scoring-tool/compute-metrics.js b/packages/validator/src/scoring-tool/compute-metrics.js index a3bae658b..6b5512a81 100644 --- a/packages/validator/src/scoring-tool/compute-metrics.js +++ b/packages/validator/src/scoring-tool/compute-metrics.js @@ -11,7 +11,7 @@ import { isObjectSchema, isStringSchema, } from '@ibm-cloud/openapi-ruleset-utilities'; -import { Metrics } from './metrics'; +import { Metrics } from './metrics.js'; async function computeMetrics(unresolvedApiDef) { // For some metrics, we just want to identify every unique instance diff --git a/packages/validator/src/scoring-tool/index.js b/packages/validator/src/scoring-tool/index.js index cd2b80a1f..8ab72ba5b 100644 --- a/packages/validator/src/scoring-tool/index.js +++ b/packages/validator/src/scoring-tool/index.js @@ -3,8 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -import { printCategorizedScoresTable, printScoringDataTable } from './output'; -import { scoreResults } from './score'; +import { printCategorizedScoresTable, printScoringDataTable } from './output.js'; +import { scoreResults } from './score.js'; import computeMetricsModule from './compute-metrics.js'; const { computeMetrics } = computeMetricsModule; diff --git a/packages/validator/src/spectral/index.js b/packages/validator/src/spectral/index.js index 7955c0130..b322acfcd 100644 --- a/packages/validator/src/spectral/index.js +++ b/packages/validator/src/spectral/index.js @@ -14,7 +14,7 @@ import { getLocalRulesetVersion, } from '../cli-validator/utils'; -import { findSpectralRuleset } from './utils'; +import { findSpectralRuleset } from './utils.js'; /** * Creates a Spectral document from the input, runs spectral, converts the results From 0613709d3c768fe6dd7ae57ea122e9d70f5c0158 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=ADdia=20Tarcza?= <100163235+diatrcz@users.noreply.github.com> Date: Thu, 18 Jun 2026 11:56:42 +0200 Subject: [PATCH 12/16] build: replace oas3 for esm MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Lídia Tarcza <100163235+diatrcz@users.noreply.github.com> --- packages/ruleset/src/ibm-oas.js | 3 ++- packages/ruleset/src/rules/accept-and-return-models.js | 3 ++- packages/ruleset/src/rules/accept-header.js | 3 ++- packages/ruleset/src/rules/anchored-patterns.js | 3 ++- packages/ruleset/src/rules/api-symmetry.js | 3 ++- packages/ruleset/src/rules/array-attributes.js | 3 ++- packages/ruleset/src/rules/array-of-arrays.js | 3 ++- packages/ruleset/src/rules/array-responses.js | 3 ++- packages/ruleset/src/rules/authorization-header.js | 3 ++- packages/ruleset/src/rules/binary-schemas.js | 3 ++- packages/ruleset/src/rules/circular-refs.js | 3 ++- packages/ruleset/src/rules/collection-array-property.js | 3 ++- packages/ruleset/src/rules/consecutive-path-segments.js | 3 ++- packages/ruleset/src/rules/content-contains-schema.js | 3 ++- packages/ruleset/src/rules/content-type-header.js | 3 ++- packages/ruleset/src/rules/content-type-is-specific.js | 3 ++- packages/ruleset/src/rules/delete-body.js | 3 ++- packages/ruleset/src/rules/discriminator-property-exists.js | 3 ++- packages/ruleset/src/rules/duplicate-path-parameter.js | 3 ++- packages/ruleset/src/rules/enum-casing-convention.js | 3 ++- packages/ruleset/src/rules/error-content-type-is-json.js | 3 ++- packages/ruleset/src/rules/error-response-schemas.js | 3 ++- packages/ruleset/src/rules/etag-header-exists.js | 3 ++- packages/ruleset/src/rules/examples-name-contains-space.js | 3 ++- packages/ruleset/src/rules/ibm-sdk-operations.js | 3 ++- packages/ruleset/src/rules/if-modified-since-header.js | 3 ++- packages/ruleset/src/rules/if-unmodified-since-header.js | 3 ++- packages/ruleset/src/rules/inline-schemas.js | 3 ++- packages/ruleset/src/rules/integer-attributes.js | 3 ++- packages/ruleset/src/rules/major-version-in-path.js | 3 ++- packages/ruleset/src/rules/merge-patch-properties.js | 3 ++- packages/ruleset/src/rules/no-ambiguous-paths.js | 3 ++- packages/ruleset/src/rules/no-nullable-properties.js | 3 ++- packages/ruleset/src/rules/no-operation-requestbody.js | 3 ++- packages/ruleset/src/rules/no-ref-in-example.js | 3 ++- packages/ruleset/src/rules/no-superfluous-allof.js | 3 ++- packages/ruleset/src/rules/operation-summary-exists.js | 3 ++- packages/ruleset/src/rules/operation-summary-length.js | 3 ++- packages/ruleset/src/rules/operationid-casing-convention.js | 3 ++- packages/ruleset/src/rules/optional-request-body-deprecated.js | 3 ++- packages/ruleset/src/rules/optional-request-body.js | 3 ++- packages/ruleset/src/rules/pagination-style.js | 3 ++- packages/ruleset/src/rules/parameter-casing-convention.js | 3 ++- packages/ruleset/src/rules/parameter-description-exists.js | 3 ++- packages/ruleset/src/rules/parameter-order.js | 3 ++- .../ruleset/src/rules/parameter-schema-or-content-exists.js | 3 ++- packages/ruleset/src/rules/patch-request-content-type.js | 3 ++- packages/ruleset/src/rules/path-parameter-not-crn.js | 3 ++- packages/ruleset/src/rules/path-segment-casing-convention.js | 3 ++- packages/ruleset/src/rules/precondition-header.js | 3 ++- packages/ruleset/src/rules/prefer-token-pagination.js | 3 ++- packages/ruleset/src/rules/property-attributes.js | 3 ++- packages/ruleset/src/rules/property-casing-convention.js | 3 ++- .../ruleset/src/rules/property-consistent-name-and-type.js | 3 ++- packages/ruleset/src/rules/property-description-exists.js | 3 ++- packages/ruleset/src/rules/property-name-collision.js | 3 ++- packages/ruleset/src/rules/redirect-response-body.js | 3 ++- packages/ruleset/src/rules/ref-pattern.js | 3 ++- .../ruleset/src/rules/ref-sibling-duplicate-description.js | 3 ++- packages/ruleset/src/rules/request-and-response-content.js | 3 ++- packages/ruleset/src/rules/requestbody-name.js | 3 ++- packages/ruleset/src/rules/required-property-missing.js | 3 ++- packages/ruleset/src/rules/resource-response-consistency.js | 3 ++- packages/ruleset/src/rules/response-status-codes.js | 3 ++- packages/ruleset/src/rules/schema-casing-convention.js | 3 ++- packages/ruleset/src/rules/schema-description-exists.js | 3 ++- packages/ruleset/src/rules/schema-naming-convention.js | 3 ++- packages/ruleset/src/rules/schema-type-exists.js | 3 ++- packages/ruleset/src/rules/schema-type-format.js | 3 ++- packages/ruleset/src/rules/securityscheme-attributes.js | 3 ++- packages/ruleset/src/rules/securityschemes.js | 3 ++- packages/ruleset/src/rules/server-variable-default-value.js | 3 ++- packages/ruleset/src/rules/string-attributes.js | 3 ++- packages/ruleset/src/rules/summary-sentence-style.js | 3 ++- .../src/rules/unique-parameter-request-property-names.js | 3 ++- packages/ruleset/src/rules/unused-tags.js | 3 ++- packages/ruleset/src/rules/use-date-based-format.js | 3 ++- packages/ruleset/src/rules/valid-path-segments.js | 3 ++- packages/ruleset/src/rules/valid-schema-example.js | 3 ++- packages/ruleset/src/rules/well-defined-dictionaries.js | 3 ++- 80 files changed, 160 insertions(+), 80 deletions(-) diff --git a/packages/ruleset/src/ibm-oas.js b/packages/ruleset/src/ibm-oas.js index 82fe67ed2..7063228fd 100644 --- a/packages/ruleset/src/ibm-oas.js +++ b/packages/ruleset/src/ibm-oas.js @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { oas } from '@stoplight/spectral-rulesets'; import { typedEnum, diff --git a/packages/ruleset/src/rules/accept-and-return-models.js b/packages/ruleset/src/rules/accept-and-return-models.js index df280c695..c2d432685 100644 --- a/packages/ruleset/src/rules/accept-and-return-models.js +++ b/packages/ruleset/src/rules/accept-and-return-models.js @@ -7,7 +7,8 @@ import { responseSchemas, requestBodySchemas, } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import acceptAndReturnModels from '../functions/accept-and-return-models.js'; export const description = diff --git a/packages/ruleset/src/rules/accept-header.js b/packages/ruleset/src/rules/accept-header.js index 09e6b6cce..871612e47 100644 --- a/packages/ruleset/src/rules/accept-header.js +++ b/packages/ruleset/src/rules/accept-header.js @@ -4,7 +4,8 @@ */ import { parameters } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { disallowedHeaderParameter } from '../functions'; export const description = diff --git a/packages/ruleset/src/rules/anchored-patterns.js b/packages/ruleset/src/rules/anchored-patterns.js index c7178a1b4..c8365f831 100644 --- a/packages/ruleset/src/rules/anchored-patterns.js +++ b/packages/ruleset/src/rules/anchored-patterns.js @@ -4,7 +4,8 @@ */ import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { anchoredPatterns } from '../functions'; export const description = 'Pattern attributes should be anchored with ^ and $'; diff --git a/packages/ruleset/src/rules/api-symmetry.js b/packages/ruleset/src/rules/api-symmetry.js index 840049a67..7c78c6724 100644 --- a/packages/ruleset/src/rules/api-symmetry.js +++ b/packages/ruleset/src/rules/api-symmetry.js @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { apiSymmetry } from '../functions'; export const description = diff --git a/packages/ruleset/src/rules/array-attributes.js b/packages/ruleset/src/rules/array-attributes.js index 07f8ff641..4f9a8b549 100644 --- a/packages/ruleset/src/rules/array-attributes.js +++ b/packages/ruleset/src/rules/array-attributes.js @@ -4,7 +4,8 @@ */ import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { arrayAttributes } from '../functions'; export const description = diff --git a/packages/ruleset/src/rules/array-of-arrays.js b/packages/ruleset/src/rules/array-of-arrays.js index f6696b5d1..12234494f 100644 --- a/packages/ruleset/src/rules/array-of-arrays.js +++ b/packages/ruleset/src/rules/array-of-arrays.js @@ -4,7 +4,8 @@ */ import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { arrayOfArrays } from '../functions'; export const description = diff --git a/packages/ruleset/src/rules/array-responses.js b/packages/ruleset/src/rules/array-responses.js index daaede88c..7882128f2 100644 --- a/packages/ruleset/src/rules/array-responses.js +++ b/packages/ruleset/src/rules/array-responses.js @@ -4,7 +4,8 @@ */ import { operations } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { arrayResponses } from '../functions'; export const description = diff --git a/packages/ruleset/src/rules/authorization-header.js b/packages/ruleset/src/rules/authorization-header.js index e71c54955..291034532 100644 --- a/packages/ruleset/src/rules/authorization-header.js +++ b/packages/ruleset/src/rules/authorization-header.js @@ -4,7 +4,8 @@ */ import { parameters } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { disallowedHeaderParameter } from '../functions'; export const description = diff --git a/packages/ruleset/src/rules/binary-schemas.js b/packages/ruleset/src/rules/binary-schemas.js index 7d2d5be32..a31f23025 100644 --- a/packages/ruleset/src/rules/binary-schemas.js +++ b/packages/ruleset/src/rules/binary-schemas.js @@ -4,7 +4,8 @@ */ import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { binarySchemas } from '../functions'; // 1. Parameters should not contain binary (type: string, format: binary) values. diff --git a/packages/ruleset/src/rules/circular-refs.js b/packages/ruleset/src/rules/circular-refs.js index 44186c34a..38eb99efe 100644 --- a/packages/ruleset/src/rules/circular-refs.js +++ b/packages/ruleset/src/rules/circular-refs.js @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { circularRefs } from '../functions'; export const description = diff --git a/packages/ruleset/src/rules/collection-array-property.js b/packages/ruleset/src/rules/collection-array-property.js index e69f8bdb6..32737ea95 100644 --- a/packages/ruleset/src/rules/collection-array-property.js +++ b/packages/ruleset/src/rules/collection-array-property.js @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { collectionArrayProperty } from '../functions'; export const description = diff --git a/packages/ruleset/src/rules/consecutive-path-segments.js b/packages/ruleset/src/rules/consecutive-path-segments.js index 687f163b3..d92b65a2e 100644 --- a/packages/ruleset/src/rules/consecutive-path-segments.js +++ b/packages/ruleset/src/rules/consecutive-path-segments.js @@ -4,7 +4,8 @@ */ import { paths } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { consecutivePathSegments } from '../functions'; export const description = diff --git a/packages/ruleset/src/rules/content-contains-schema.js b/packages/ruleset/src/rules/content-contains-schema.js index e8d3cee6b..ba88a8edb 100644 --- a/packages/ruleset/src/rules/content-contains-schema.js +++ b/packages/ruleset/src/rules/content-contains-schema.js @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { truthy } from '@stoplight/spectral-functions'; export const description = 'Content entries must specify a schema'; diff --git a/packages/ruleset/src/rules/content-type-header.js b/packages/ruleset/src/rules/content-type-header.js index f8d6d8814..9580bd01a 100644 --- a/packages/ruleset/src/rules/content-type-header.js +++ b/packages/ruleset/src/rules/content-type-header.js @@ -4,7 +4,8 @@ */ import { parameters } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { disallowedHeaderParameter } from '../functions'; export const description = diff --git a/packages/ruleset/src/rules/content-type-is-specific.js b/packages/ruleset/src/rules/content-type-is-specific.js index af91607e1..cb5f7fa08 100644 --- a/packages/ruleset/src/rules/content-type-is-specific.js +++ b/packages/ruleset/src/rules/content-type-is-specific.js @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { falsy } from '@stoplight/spectral-functions'; export const description = diff --git a/packages/ruleset/src/rules/delete-body.js b/packages/ruleset/src/rules/delete-body.js index 54ea33197..b4e02328e 100644 --- a/packages/ruleset/src/rules/delete-body.js +++ b/packages/ruleset/src/rules/delete-body.js @@ -4,7 +4,8 @@ */ import { operations } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { deleteBody } from '../functions'; export const description = diff --git a/packages/ruleset/src/rules/discriminator-property-exists.js b/packages/ruleset/src/rules/discriminator-property-exists.js index 8ad3eb5a4..e01a2e726 100644 --- a/packages/ruleset/src/rules/discriminator-property-exists.js +++ b/packages/ruleset/src/rules/discriminator-property-exists.js @@ -4,7 +4,8 @@ */ import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { discriminatorPropertyExists } from '../functions'; export const description = diff --git a/packages/ruleset/src/rules/duplicate-path-parameter.js b/packages/ruleset/src/rules/duplicate-path-parameter.js index e0ac41164..807dffae5 100644 --- a/packages/ruleset/src/rules/duplicate-path-parameter.js +++ b/packages/ruleset/src/rules/duplicate-path-parameter.js @@ -4,7 +4,8 @@ */ import { paths } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { duplicatePathParameter } from '../functions'; export const description = diff --git a/packages/ruleset/src/rules/enum-casing-convention.js b/packages/ruleset/src/rules/enum-casing-convention.js index 48e957c5e..e1bfaa365 100644 --- a/packages/ruleset/src/rules/enum-casing-convention.js +++ b/packages/ruleset/src/rules/enum-casing-convention.js @@ -4,7 +4,8 @@ */ import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { enumCasingConvention } from '../functions'; export const description = diff --git a/packages/ruleset/src/rules/error-content-type-is-json.js b/packages/ruleset/src/rules/error-content-type-is-json.js index 4a29a4ff4..91952ec5e 100644 --- a/packages/ruleset/src/rules/error-content-type-is-json.js +++ b/packages/ruleset/src/rules/error-content-type-is-json.js @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { truthy } from '@stoplight/spectral-functions'; export const description = 'error response should support application/json'; diff --git a/packages/ruleset/src/rules/error-response-schemas.js b/packages/ruleset/src/rules/error-response-schemas.js index 3670d61cb..4af9cdc6e 100644 --- a/packages/ruleset/src/rules/error-response-schemas.js +++ b/packages/ruleset/src/rules/error-response-schemas.js @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { errorResponseSchemas } from '../functions'; export const description = diff --git a/packages/ruleset/src/rules/etag-header-exists.js b/packages/ruleset/src/rules/etag-header-exists.js index 445e3e3ed..d70e4b3e9 100644 --- a/packages/ruleset/src/rules/etag-header-exists.js +++ b/packages/ruleset/src/rules/etag-header-exists.js @@ -4,7 +4,8 @@ */ import { paths } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { etagHeaderExists } from '../functions'; export const description = diff --git a/packages/ruleset/src/rules/examples-name-contains-space.js b/packages/ruleset/src/rules/examples-name-contains-space.js index 16d156278..d826cefe1 100644 --- a/packages/ruleset/src/rules/examples-name-contains-space.js +++ b/packages/ruleset/src/rules/examples-name-contains-space.js @@ -4,7 +4,8 @@ */ import { pattern } from '@stoplight/spectral-functions'; -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; export const description = 'Examples name should not contain space'; export const message = '{{description}}'; diff --git a/packages/ruleset/src/rules/ibm-sdk-operations.js b/packages/ruleset/src/rules/ibm-sdk-operations.js index a53be4cb4..40480acbe 100644 --- a/packages/ruleset/src/rules/ibm-sdk-operations.js +++ b/packages/ruleset/src/rules/ibm-sdk-operations.js @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { schema } from '@stoplight/spectral-functions'; export const description = diff --git a/packages/ruleset/src/rules/if-modified-since-header.js b/packages/ruleset/src/rules/if-modified-since-header.js index 47eb6e3a8..c0d42e414 100644 --- a/packages/ruleset/src/rules/if-modified-since-header.js +++ b/packages/ruleset/src/rules/if-modified-since-header.js @@ -4,7 +4,8 @@ */ import { parameters } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { disallowedHeaderParameter } from '../functions'; export const description = diff --git a/packages/ruleset/src/rules/if-unmodified-since-header.js b/packages/ruleset/src/rules/if-unmodified-since-header.js index 7c774a41f..8bd5c7349 100644 --- a/packages/ruleset/src/rules/if-unmodified-since-header.js +++ b/packages/ruleset/src/rules/if-unmodified-since-header.js @@ -4,7 +4,8 @@ */ import { parameters } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { disallowedHeaderParameter } from '../functions'; export const description = diff --git a/packages/ruleset/src/rules/inline-schemas.js b/packages/ruleset/src/rules/inline-schemas.js index 3db036409..218729a54 100644 --- a/packages/ruleset/src/rules/inline-schemas.js +++ b/packages/ruleset/src/rules/inline-schemas.js @@ -4,7 +4,8 @@ */ import { unresolvedSchemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { inlineSchemas } from '../functions'; export const description = diff --git a/packages/ruleset/src/rules/integer-attributes.js b/packages/ruleset/src/rules/integer-attributes.js index 039044707..63e41c939 100644 --- a/packages/ruleset/src/rules/integer-attributes.js +++ b/packages/ruleset/src/rules/integer-attributes.js @@ -4,7 +4,8 @@ */ import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { integerAttributes } from '../functions'; export const description = diff --git a/packages/ruleset/src/rules/major-version-in-path.js b/packages/ruleset/src/rules/major-version-in-path.js index 4ee9984cf..5ec887671 100644 --- a/packages/ruleset/src/rules/major-version-in-path.js +++ b/packages/ruleset/src/rules/major-version-in-path.js @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { majorVersionInPath } from '../functions'; export const description = diff --git a/packages/ruleset/src/rules/merge-patch-properties.js b/packages/ruleset/src/rules/merge-patch-properties.js index dd46d8034..b8f9e1021 100644 --- a/packages/ruleset/src/rules/merge-patch-properties.js +++ b/packages/ruleset/src/rules/merge-patch-properties.js @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { mergePatchProperties } from '../functions'; export const description = diff --git a/packages/ruleset/src/rules/no-ambiguous-paths.js b/packages/ruleset/src/rules/no-ambiguous-paths.js index 52091905c..72982faca 100644 --- a/packages/ruleset/src/rules/no-ambiguous-paths.js +++ b/packages/ruleset/src/rules/no-ambiguous-paths.js @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { noAmbiguousPaths } from '../functions'; export const description = diff --git a/packages/ruleset/src/rules/no-nullable-properties.js b/packages/ruleset/src/rules/no-nullable-properties.js index 8062a4fa3..61bd8176a 100644 --- a/packages/ruleset/src/rules/no-nullable-properties.js +++ b/packages/ruleset/src/rules/no-nullable-properties.js @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; import { noNullableProperties } from '../functions'; diff --git a/packages/ruleset/src/rules/no-operation-requestbody.js b/packages/ruleset/src/rules/no-operation-requestbody.js index bfacbc5a0..1d72d0517 100644 --- a/packages/ruleset/src/rules/no-operation-requestbody.js +++ b/packages/ruleset/src/rules/no-operation-requestbody.js @@ -4,7 +4,8 @@ */ import { operations } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { noOperationRequestBody } from '../functions'; export const description = diff --git a/packages/ruleset/src/rules/no-ref-in-example.js b/packages/ruleset/src/rules/no-ref-in-example.js index 329745c30..af5bfb4e1 100644 --- a/packages/ruleset/src/rules/no-ref-in-example.js +++ b/packages/ruleset/src/rules/no-ref-in-example.js @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { noRefInExample } from '../functions'; export const description = 'The use of $ref is not valid within an example field'; diff --git a/packages/ruleset/src/rules/no-superfluous-allof.js b/packages/ruleset/src/rules/no-superfluous-allof.js index 7ee9d32bb..774d18f80 100644 --- a/packages/ruleset/src/rules/no-superfluous-allof.js +++ b/packages/ruleset/src/rules/no-superfluous-allof.js @@ -4,7 +4,8 @@ */ import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { noSuperfluousAllOf } from '../functions'; export const description = diff --git a/packages/ruleset/src/rules/operation-summary-exists.js b/packages/ruleset/src/rules/operation-summary-exists.js index 63758d6f0..a48ac7653 100644 --- a/packages/ruleset/src/rules/operation-summary-exists.js +++ b/packages/ruleset/src/rules/operation-summary-exists.js @@ -4,7 +4,8 @@ */ import { operations } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { operationSummaryExists } from '../functions'; export const description = 'Operations must have a non-empty summary'; diff --git a/packages/ruleset/src/rules/operation-summary-length.js b/packages/ruleset/src/rules/operation-summary-length.js index fc6812beb..96145229f 100644 --- a/packages/ruleset/src/rules/operation-summary-length.js +++ b/packages/ruleset/src/rules/operation-summary-length.js @@ -4,7 +4,8 @@ */ import { operations } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { operationSummaryLength } from '../functions'; export const description = diff --git a/packages/ruleset/src/rules/operationid-casing-convention.js b/packages/ruleset/src/rules/operationid-casing-convention.js index e00da8588..bb4899620 100644 --- a/packages/ruleset/src/rules/operationid-casing-convention.js +++ b/packages/ruleset/src/rules/operationid-casing-convention.js @@ -4,7 +4,8 @@ */ import { operations } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { operationIdCasingConvention } from '../functions'; export const description = diff --git a/packages/ruleset/src/rules/optional-request-body-deprecated.js b/packages/ruleset/src/rules/optional-request-body-deprecated.js index 01a8e93d8..324edb059 100644 --- a/packages/ruleset/src/rules/optional-request-body-deprecated.js +++ b/packages/ruleset/src/rules/optional-request-body-deprecated.js @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { optionalRequestBodyDeprecated } from '../functions'; export const description = diff --git a/packages/ruleset/src/rules/optional-request-body.js b/packages/ruleset/src/rules/optional-request-body.js index bdd6713d8..5ddab4d01 100644 --- a/packages/ruleset/src/rules/optional-request-body.js +++ b/packages/ruleset/src/rules/optional-request-body.js @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { optionalRequestBody } from '../functions'; export const description = diff --git a/packages/ruleset/src/rules/pagination-style.js b/packages/ruleset/src/rules/pagination-style.js index f117df45c..a522cda4a 100644 --- a/packages/ruleset/src/rules/pagination-style.js +++ b/packages/ruleset/src/rules/pagination-style.js @@ -4,7 +4,8 @@ */ import { paths } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { paginationStyle } from '../functions'; export const description = diff --git a/packages/ruleset/src/rules/parameter-casing-convention.js b/packages/ruleset/src/rules/parameter-casing-convention.js index 1dbad5583..66c28406b 100644 --- a/packages/ruleset/src/rules/parameter-casing-convention.js +++ b/packages/ruleset/src/rules/parameter-casing-convention.js @@ -4,7 +4,8 @@ */ import { parameters } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { parameterCasingConvention } from '../functions'; export const description = 'Parameter names must follow case conventions'; diff --git a/packages/ruleset/src/rules/parameter-description-exists.js b/packages/ruleset/src/rules/parameter-description-exists.js index b036d4b59..bcc4c6046 100644 --- a/packages/ruleset/src/rules/parameter-description-exists.js +++ b/packages/ruleset/src/rules/parameter-description-exists.js @@ -4,7 +4,8 @@ */ import { parameters } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { parameterDescriptionExists } from '../functions'; export const description = 'Parameters should have a non-empty description'; diff --git a/packages/ruleset/src/rules/parameter-order.js b/packages/ruleset/src/rules/parameter-order.js index b84d6b2b4..ef89cf505 100644 --- a/packages/ruleset/src/rules/parameter-order.js +++ b/packages/ruleset/src/rules/parameter-order.js @@ -4,7 +4,8 @@ */ import { operations } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { parameterOrder } from '../functions'; export const description = diff --git a/packages/ruleset/src/rules/parameter-schema-or-content-exists.js b/packages/ruleset/src/rules/parameter-schema-or-content-exists.js index f47945396..34e450a24 100644 --- a/packages/ruleset/src/rules/parameter-schema-or-content-exists.js +++ b/packages/ruleset/src/rules/parameter-schema-or-content-exists.js @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { schemaOrContentProvided } from '../functions'; export const description = 'Parameter must provide either a schema or content'; diff --git a/packages/ruleset/src/rules/patch-request-content-type.js b/packages/ruleset/src/rules/patch-request-content-type.js index b9880c5b0..44ebd053d 100644 --- a/packages/ruleset/src/rules/patch-request-content-type.js +++ b/packages/ruleset/src/rules/patch-request-content-type.js @@ -4,7 +4,8 @@ */ import { patchOperations } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { patchRequestContentType } from '../functions'; export const description = diff --git a/packages/ruleset/src/rules/path-parameter-not-crn.js b/packages/ruleset/src/rules/path-parameter-not-crn.js index d65cd9e61..aee085bce 100644 --- a/packages/ruleset/src/rules/path-parameter-not-crn.js +++ b/packages/ruleset/src/rules/path-parameter-not-crn.js @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { pathParameterNotCRN } from '../functions'; export const description = diff --git a/packages/ruleset/src/rules/path-segment-casing-convention.js b/packages/ruleset/src/rules/path-segment-casing-convention.js index ea140b952..c0f2a30a9 100644 --- a/packages/ruleset/src/rules/path-segment-casing-convention.js +++ b/packages/ruleset/src/rules/path-segment-casing-convention.js @@ -4,7 +4,8 @@ */ import { paths } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { pathSegmentCasingConvention } from '../functions'; export const description = diff --git a/packages/ruleset/src/rules/precondition-header.js b/packages/ruleset/src/rules/precondition-header.js index fcc79ee13..78f58339d 100644 --- a/packages/ruleset/src/rules/precondition-header.js +++ b/packages/ruleset/src/rules/precondition-header.js @@ -4,7 +4,8 @@ */ import { operations } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { preconditionHeader } from '../functions'; export const description = diff --git a/packages/ruleset/src/rules/prefer-token-pagination.js b/packages/ruleset/src/rules/prefer-token-pagination.js index 2276b399d..6cac9b6ce 100644 --- a/packages/ruleset/src/rules/prefer-token-pagination.js +++ b/packages/ruleset/src/rules/prefer-token-pagination.js @@ -4,7 +4,8 @@ */ import { paths } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { preferTokenPagination } from '../functions'; export const description = diff --git a/packages/ruleset/src/rules/property-attributes.js b/packages/ruleset/src/rules/property-attributes.js index 6c60e04fc..20d5a0c61 100644 --- a/packages/ruleset/src/rules/property-attributes.js +++ b/packages/ruleset/src/rules/property-attributes.js @@ -4,7 +4,8 @@ */ import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { propertyAttributes } from '../functions'; export const description = diff --git a/packages/ruleset/src/rules/property-casing-convention.js b/packages/ruleset/src/rules/property-casing-convention.js index 968530431..db34f1b6a 100644 --- a/packages/ruleset/src/rules/property-casing-convention.js +++ b/packages/ruleset/src/rules/property-casing-convention.js @@ -4,7 +4,8 @@ */ import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { propertyCasingConvention } from '../functions'; export const description = diff --git a/packages/ruleset/src/rules/property-consistent-name-and-type.js b/packages/ruleset/src/rules/property-consistent-name-and-type.js index 9436574ac..3a21a74bd 100644 --- a/packages/ruleset/src/rules/property-consistent-name-and-type.js +++ b/packages/ruleset/src/rules/property-consistent-name-and-type.js @@ -4,7 +4,8 @@ */ import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { propertyConsistentNameAndType } from '../functions'; export const description = diff --git a/packages/ruleset/src/rules/property-description-exists.js b/packages/ruleset/src/rules/property-description-exists.js index 985d56103..555eee006 100644 --- a/packages/ruleset/src/rules/property-description-exists.js +++ b/packages/ruleset/src/rules/property-description-exists.js @@ -4,7 +4,8 @@ */ import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { propertyDescriptionExists } from '../functions'; export const description = diff --git a/packages/ruleset/src/rules/property-name-collision.js b/packages/ruleset/src/rules/property-name-collision.js index 1f56d5f7a..9af016ee1 100644 --- a/packages/ruleset/src/rules/property-name-collision.js +++ b/packages/ruleset/src/rules/property-name-collision.js @@ -4,7 +4,8 @@ */ import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { propertyNameCollision } from '../functions'; export const description = diff --git a/packages/ruleset/src/rules/redirect-response-body.js b/packages/ruleset/src/rules/redirect-response-body.js index 786591756..12ffee699 100644 --- a/packages/ruleset/src/rules/redirect-response-body.js +++ b/packages/ruleset/src/rules/redirect-response-body.js @@ -4,7 +4,8 @@ */ import { operations } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { redirectResponseBody } from '../functions'; export const description = diff --git a/packages/ruleset/src/rules/ref-pattern.js b/packages/ruleset/src/rules/ref-pattern.js index e01c21d16..be570a15d 100644 --- a/packages/ruleset/src/rules/ref-pattern.js +++ b/packages/ruleset/src/rules/ref-pattern.js @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { refPattern } from '../functions'; export const description = '$refs must follow the correct pattern.'; diff --git a/packages/ruleset/src/rules/ref-sibling-duplicate-description.js b/packages/ruleset/src/rules/ref-sibling-duplicate-description.js index 5dd501271..2bed5f215 100644 --- a/packages/ruleset/src/rules/ref-sibling-duplicate-description.js +++ b/packages/ruleset/src/rules/ref-sibling-duplicate-description.js @@ -4,7 +4,8 @@ */ import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { refSiblingDuplicateDescription } from '../functions'; export const description = diff --git a/packages/ruleset/src/rules/request-and-response-content.js b/packages/ruleset/src/rules/request-and-response-content.js index 3c5e448a2..09728a6fb 100644 --- a/packages/ruleset/src/rules/request-and-response-content.js +++ b/packages/ruleset/src/rules/request-and-response-content.js @@ -4,7 +4,8 @@ */ import { operations } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { requestAndResponseContent } from '../functions'; export const description = diff --git a/packages/ruleset/src/rules/requestbody-name.js b/packages/ruleset/src/rules/requestbody-name.js index b3b0e3a30..1907a17eb 100644 --- a/packages/ruleset/src/rules/requestbody-name.js +++ b/packages/ruleset/src/rules/requestbody-name.js @@ -4,7 +4,8 @@ */ import { operations } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { requestBodyName } from '../functions'; export const description = diff --git a/packages/ruleset/src/rules/required-property-missing.js b/packages/ruleset/src/rules/required-property-missing.js index 1b433ec99..36041ae09 100644 --- a/packages/ruleset/src/rules/required-property-missing.js +++ b/packages/ruleset/src/rules/required-property-missing.js @@ -4,7 +4,8 @@ */ import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { requiredProperty } from '../functions'; export const description = 'A required property is not in the schema'; diff --git a/packages/ruleset/src/rules/resource-response-consistency.js b/packages/ruleset/src/rules/resource-response-consistency.js index def0db723..3e29d6ada 100644 --- a/packages/ruleset/src/rules/resource-response-consistency.js +++ b/packages/ruleset/src/rules/resource-response-consistency.js @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { resourceResponseConsistency } from '../functions'; export const description = diff --git a/packages/ruleset/src/rules/response-status-codes.js b/packages/ruleset/src/rules/response-status-codes.js index 6df551545..40e2409fc 100644 --- a/packages/ruleset/src/rules/response-status-codes.js +++ b/packages/ruleset/src/rules/response-status-codes.js @@ -4,7 +4,8 @@ */ import { operations } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { responseStatusCodes } from '../functions'; export const description = diff --git a/packages/ruleset/src/rules/schema-casing-convention.js b/packages/ruleset/src/rules/schema-casing-convention.js index 5045a5f93..92cd07918 100644 --- a/packages/ruleset/src/rules/schema-casing-convention.js +++ b/packages/ruleset/src/rules/schema-casing-convention.js @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { schemaCasingConvention } from '../functions'; export const description = diff --git a/packages/ruleset/src/rules/schema-description-exists.js b/packages/ruleset/src/rules/schema-description-exists.js index 77d179591..5d918aa2d 100644 --- a/packages/ruleset/src/rules/schema-description-exists.js +++ b/packages/ruleset/src/rules/schema-description-exists.js @@ -4,7 +4,8 @@ */ import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { schemaDescriptionExists } from '../functions'; export const description = 'Schemas should have a non-empty description'; diff --git a/packages/ruleset/src/rules/schema-naming-convention.js b/packages/ruleset/src/rules/schema-naming-convention.js index 26179d485..86f255816 100644 --- a/packages/ruleset/src/rules/schema-naming-convention.js +++ b/packages/ruleset/src/rules/schema-naming-convention.js @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { schemaNamingConvention } from '../functions'; export const description = diff --git a/packages/ruleset/src/rules/schema-type-exists.js b/packages/ruleset/src/rules/schema-type-exists.js index 016bc531d..27eaa4b07 100644 --- a/packages/ruleset/src/rules/schema-type-exists.js +++ b/packages/ruleset/src/rules/schema-type-exists.js @@ -4,7 +4,8 @@ */ import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { schemaTypeExists } from '../functions'; export const description = diff --git a/packages/ruleset/src/rules/schema-type-format.js b/packages/ruleset/src/rules/schema-type-format.js index ed3059667..cbf749a94 100644 --- a/packages/ruleset/src/rules/schema-type-format.js +++ b/packages/ruleset/src/rules/schema-type-format.js @@ -4,7 +4,8 @@ */ import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { schemaTypeFormat } from '../functions'; export const description = diff --git a/packages/ruleset/src/rules/securityscheme-attributes.js b/packages/ruleset/src/rules/securityscheme-attributes.js index cffe07b93..399c464fd 100644 --- a/packages/ruleset/src/rules/securityscheme-attributes.js +++ b/packages/ruleset/src/rules/securityscheme-attributes.js @@ -4,7 +4,8 @@ */ import { securitySchemes } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { securitySchemeAttributes } from '../functions'; export const description = diff --git a/packages/ruleset/src/rules/securityschemes.js b/packages/ruleset/src/rules/securityschemes.js index 9114bc5da..cf541517a 100644 --- a/packages/ruleset/src/rules/securityschemes.js +++ b/packages/ruleset/src/rules/securityschemes.js @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { securitySchemes } from '../functions'; export const description = diff --git a/packages/ruleset/src/rules/server-variable-default-value.js b/packages/ruleset/src/rules/server-variable-default-value.js index c91d8e63a..d3fc206ff 100644 --- a/packages/ruleset/src/rules/server-variable-default-value.js +++ b/packages/ruleset/src/rules/server-variable-default-value.js @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { truthy } from '@stoplight/spectral-functions'; export const description = 'Server variable should have default value'; diff --git a/packages/ruleset/src/rules/string-attributes.js b/packages/ruleset/src/rules/string-attributes.js index 305545591..084709ade 100644 --- a/packages/ruleset/src/rules/string-attributes.js +++ b/packages/ruleset/src/rules/string-attributes.js @@ -4,7 +4,8 @@ */ import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { stringAttributes } from '../functions'; export const description = diff --git a/packages/ruleset/src/rules/summary-sentence-style.js b/packages/ruleset/src/rules/summary-sentence-style.js index 36877b7b0..dc37094c6 100644 --- a/packages/ruleset/src/rules/summary-sentence-style.js +++ b/packages/ruleset/src/rules/summary-sentence-style.js @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { pattern } from '@stoplight/spectral-functions'; export const description = diff --git a/packages/ruleset/src/rules/unique-parameter-request-property-names.js b/packages/ruleset/src/rules/unique-parameter-request-property-names.js index 055c60fd0..6cc09dadf 100644 --- a/packages/ruleset/src/rules/unique-parameter-request-property-names.js +++ b/packages/ruleset/src/rules/unique-parameter-request-property-names.js @@ -4,7 +4,8 @@ */ import { paths } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { uniqueParameterRequestPropertyNames } from '../functions'; export const description = diff --git a/packages/ruleset/src/rules/unused-tags.js b/packages/ruleset/src/rules/unused-tags.js index 6492d899f..c9ff42c40 100644 --- a/packages/ruleset/src/rules/unused-tags.js +++ b/packages/ruleset/src/rules/unused-tags.js @@ -3,7 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { unusedTags } from '../functions'; export const description = 'Checks that each defined tag is actually used'; diff --git a/packages/ruleset/src/rules/use-date-based-format.js b/packages/ruleset/src/rules/use-date-based-format.js index 559dfbc86..604cfe4d0 100644 --- a/packages/ruleset/src/rules/use-date-based-format.js +++ b/packages/ruleset/src/rules/use-date-based-format.js @@ -4,7 +4,8 @@ */ import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { useDateBasedFormat } from '../functions'; export const description = diff --git a/packages/ruleset/src/rules/valid-path-segments.js b/packages/ruleset/src/rules/valid-path-segments.js index e57a7fabf..497d5b0f3 100644 --- a/packages/ruleset/src/rules/valid-path-segments.js +++ b/packages/ruleset/src/rules/valid-path-segments.js @@ -4,7 +4,8 @@ */ import { paths } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { validatePathSegments } from '../functions'; export const description = diff --git a/packages/ruleset/src/rules/valid-schema-example.js b/packages/ruleset/src/rules/valid-schema-example.js index 871f723a2..b7fa90e1c 100644 --- a/packages/ruleset/src/rules/valid-schema-example.js +++ b/packages/ruleset/src/rules/valid-schema-example.js @@ -4,7 +4,8 @@ */ import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { validSchemaExample } from '../functions'; export const description = diff --git a/packages/ruleset/src/rules/well-defined-dictionaries.js b/packages/ruleset/src/rules/well-defined-dictionaries.js index 61fd8812e..8b21a029e 100644 --- a/packages/ruleset/src/rules/well-defined-dictionaries.js +++ b/packages/ruleset/src/rules/well-defined-dictionaries.js @@ -4,7 +4,8 @@ */ import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; -import { oas3 } from '@stoplight/spectral-formats'; +import spectralFormats from '@stoplight/spectral-formats'; +const { oas3 } = spectralFormats;; import { wellDefinedDictionaries } from '../functions'; export const description = From 2a8ad826563f4103ad46bfa532832bcff72dccf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=ADdia=20Tarcza?= <100163235+diatrcz@users.noreply.github.com> Date: Thu, 18 Jun 2026 14:18:13 +0200 Subject: [PATCH 13/16] build: modify imports for esm MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Lídia Tarcza <100163235+diatrcz@users.noreply.github.com> --- .../ruleset/src/functions/allowed-keywords.js | 2 +- .../src/functions/anchored-patterns.js | 2 +- .../ruleset/src/functions/api-symmetry.js | 2 +- .../ruleset/src/functions/array-attributes.js | 4 +- .../ruleset/src/functions/array-of-arrays.js | 2 +- .../ruleset/src/functions/array-responses.js | 2 +- .../src/functions/avoid-multiple-types.js | 2 +- .../ruleset/src/functions/binary-schemas.js | 2 +- .../ruleset/src/functions/circular-refs.js | 2 +- .../functions/collection-array-property.js | 2 +- .../functions/consecutive-path-segments.js | 2 +- packages/ruleset/src/functions/delete-body.js | 2 +- .../functions/disallowed-header-parameter.js | 2 +- .../discriminator-property-exists.js | 2 +- .../src/functions/duplicate-path-parameter.js | 8 +- .../src/functions/enum-casing-convention.js | 2 +- .../src/functions/error-response-schemas.js | 2 +- .../src/functions/etag-header-exists.js | 2 +- packages/ruleset/src/functions/index.js | 189 ++++++++---------- .../ruleset/src/functions/inline-schemas.js | 2 +- .../src/functions/integer-attributes.js | 2 +- .../src/functions/major-version-in-path.js | 2 +- .../src/functions/merge-patch-properties.js | 2 +- .../src/functions/no-ambiguous-paths.js | 2 +- .../src/functions/no-nullable-properties.js | 2 +- .../src/functions/no-operation-requestbody.js | 2 +- .../src/functions/no-ref-in-example.js | 2 +- .../src/functions/no-superfluous-allof.js | 2 +- .../src/functions/no-unsupported-keywords.js | 2 +- .../src/functions/operation-summary-exists.js | 2 +- .../src/functions/operation-summary-length.js | 2 +- .../operationid-casing-convention.js | 2 +- .../operationid-naming-convention.js | 10 +- .../src/functions/optional-request-body.js | 9 +- .../ruleset/src/functions/pagination-style.js | 2 +- .../functions/parameter-casing-convention.js | 2 +- .../src/functions/parameter-default.js | 2 +- .../functions/parameter-description-exists.js | 2 +- .../ruleset/src/functions/parameter-order.js | 2 +- .../functions/patch-request-content-type.js | 2 +- .../src/functions/path-parameter-not-crn.js | 2 +- .../path-segment-casing-convention.js | 2 +- .../src/functions/pattern-properties.js | 2 +- .../src/functions/precondition-header.js | 2 +- .../src/functions/prefer-token-pagination.js | 2 +- .../src/functions/property-attributes.js | 2 +- .../functions/property-casing-convention.js | 2 +- .../property-consistent-name-and-type.js | 2 +- .../functions/property-description-exists.js | 2 +- .../src/functions/property-name-collision.js | 2 +- .../src/functions/redirect-response-body.js | 2 +- packages/ruleset/src/functions/ref-pattern.js | 2 +- .../ref-sibling-duplicate-description.js | 2 +- .../functions/request-and-response-content.js | 5 +- .../ruleset/src/functions/requestbody-name.js | 6 +- .../required-array-properties-in-response.js | 2 +- .../required-enum-properties-in-response.js | 2 +- .../src/functions/required-property.js | 2 +- .../resource-response-consistency.js | 4 +- .../src/functions/response-status-codes.js | 2 +- .../src/functions/schema-casing-convention.js | 2 +- .../functions/schema-description-exists.js | 2 +- .../src/functions/schema-naming-convention.js | 2 +- .../src/functions/schema-type-exists.js | 2 +- .../src/functions/schema-type-format.js | 2 +- .../functions/securityscheme-attributes.js | 6 +- .../ruleset/src/functions/securityschemes.js | 2 +- .../src/functions/string-attributes.js | 2 +- .../src/functions/unevaluated-properties.js | 2 +- ...unique-parameter-request-property-names.js | 2 +- packages/ruleset/src/functions/unused-tags.js | 2 +- .../src/functions/use-date-based-format.js | 2 +- .../src/functions/valid-path-segments.js | 2 +- .../src/functions/valid-schema-example.js | 2 +- .../functions/well-defined-dictionaries.js | 2 +- packages/ruleset/src/ibm-oas.js | 2 +- .../src/rules/accept-and-return-models.js | 2 +- packages/ruleset/src/rules/accept-header.js | 4 +- .../ruleset/src/rules/anchored-patterns.js | 4 +- packages/ruleset/src/rules/api-symmetry.js | 4 +- .../ruleset/src/rules/array-attributes.js | 4 +- packages/ruleset/src/rules/array-of-arrays.js | 4 +- packages/ruleset/src/rules/array-responses.js | 4 +- .../ruleset/src/rules/authorization-header.js | 4 +- .../ruleset/src/rules/avoid-multiple-types.js | 5 +- packages/ruleset/src/rules/binary-schemas.js | 4 +- packages/ruleset/src/rules/circular-refs.js | 4 +- .../src/rules/collection-array-property.js | 4 +- .../src/rules/consecutive-path-segments.js | 4 +- .../src/rules/content-contains-schema.js | 2 +- .../ruleset/src/rules/content-type-header.js | 4 +- .../src/rules/content-type-is-specific.js | 2 +- packages/ruleset/src/rules/delete-body.js | 4 +- .../rules/discriminator-property-exists.js | 4 +- .../src/rules/duplicate-path-parameter.js | 4 +- .../src/rules/enum-casing-convention.js | 4 +- .../src/rules/error-content-type-is-json.js | 2 +- .../src/rules/error-response-schemas.js | 4 +- .../ruleset/src/rules/etag-header-exists.js | 4 +- .../src/rules/examples-name-contains-space.js | 2 +- .../ruleset/src/rules/ibm-sdk-operations.js | 2 +- .../src/rules/if-modified-since-header.js | 4 +- .../src/rules/if-unmodified-since-header.js | 4 +- packages/ruleset/src/rules/inline-schemas.js | 4 +- .../ruleset/src/rules/integer-attributes.js | 4 +- .../src/rules/major-version-in-path.js | 4 +- .../src/rules/merge-patch-properties.js | 4 +- .../ruleset/src/rules/no-ambiguous-paths.js | 4 +- .../src/rules/no-nullable-properties.js | 4 +- .../src/rules/no-operation-requestbody.js | 4 +- .../ruleset/src/rules/no-ref-in-example.js | 4 +- .../ruleset/src/rules/no-superfluous-allof.js | 4 +- .../src/rules/no-unsupported-keywords.js | 5 +- .../ruleset/src/rules/operation-responses.js | 3 +- .../src/rules/operation-summary-exists.js | 4 +- .../src/rules/operation-summary-length.js | 4 +- .../rules/operationid-casing-convention.js | 4 +- .../rules/operationid-naming-convention.js | 5 +- .../rules/optional-request-body-deprecated.js | 4 +- .../src/rules/optional-request-body.js | 4 +- .../ruleset/src/rules/pagination-style.js | 4 +- .../src/rules/parameter-casing-convention.js | 4 +- .../ruleset/src/rules/parameter-default.js | 5 +- .../src/rules/parameter-description-exists.js | 4 +- packages/ruleset/src/rules/parameter-order.js | 4 +- .../parameter-schema-or-content-exists.js | 4 +- .../src/rules/patch-request-content-type.js | 4 +- .../src/rules/path-parameter-not-crn.js | 4 +- .../rules/path-segment-casing-convention.js | 4 +- .../ruleset/src/rules/pattern-properties.js | 5 +- .../ruleset/src/rules/precondition-header.js | 4 +- .../src/rules/prefer-token-pagination.js | 4 +- .../ruleset/src/rules/property-attributes.js | 4 +- .../src/rules/property-casing-convention.js | 4 +- .../property-consistent-name-and-type.js | 4 +- .../src/rules/property-description-exists.js | 4 +- .../src/rules/property-name-collision.js | 4 +- .../src/rules/redirect-response-body.js | 4 +- packages/ruleset/src/rules/ref-pattern.js | 4 +- .../ref-sibling-duplicate-description.js | 4 +- .../src/rules/request-and-response-content.js | 4 +- .../ruleset/src/rules/requestbody-name.js | 4 +- .../required-array-properties-in-response.js | 2 +- .../required-enum-properties-in-response.js | 2 +- .../src/rules/required-property-missing.js | 4 +- .../rules/resource-response-consistency.js | 4 +- .../src/rules/response-example-exists.js | 2 +- .../src/rules/response-status-codes.js | 4 +- .../src/rules/schema-casing-convention.js | 4 +- .../src/rules/schema-description-exists.js | 4 +- packages/ruleset/src/rules/schema-keywords.js | 5 +- .../src/rules/schema-naming-convention.js | 4 +- .../ruleset/src/rules/schema-type-exists.js | 4 +- .../ruleset/src/rules/schema-type-format.js | 4 +- .../src/rules/securityscheme-attributes.js | 4 +- packages/ruleset/src/rules/securityschemes.js | 4 +- .../rules/server-variable-default-value.js | 2 +- .../ruleset/src/rules/string-attributes.js | 4 +- .../src/rules/summary-sentence-style.js | 2 +- .../src/rules/unevaluated-properties.js | 5 +- ...unique-parameter-request-property-names.js | 4 +- packages/ruleset/src/rules/unused-tags.js | 4 +- .../src/rules/use-date-based-format.js | 4 +- .../ruleset/src/rules/valid-path-segments.js | 4 +- .../ruleset/src/rules/valid-schema-example.js | 4 +- .../src/rules/well-defined-dictionaries.js | 4 +- packages/ruleset/src/utils/index.js | 5 +- .../ruleset/src/utils/schema-finding-utils.js | 3 +- .../rules/no-operation-requestbody.test.js | 28 ++- .../test/rules/pagination-style.test.js | 8 +- .../rules/prefer-token-pagination.test.js | 8 +- .../test/test-utils/all-schemas-document.js | 24 ++- packages/ruleset/test/test-utils/index.js | 10 +- .../ruleset/test/test-utils/root-document.js | 41 +++- .../ruleset/test/utils/mimetype-utils.test.js | 7 +- .../test/utils/path-location-utils.test.js | 9 +- packages/utilities/src/collections/index.js | 17 ++ .../src/cli-validator/run-validator.js | 2 +- .../utils/file-extension-validator.js | 2 +- .../src/cli-validator/utils/print-results.js | 2 +- 180 files changed, 477 insertions(+), 408 deletions(-) diff --git a/packages/ruleset/src/functions/allowed-keywords.js b/packages/ruleset/src/functions/allowed-keywords.js index de2cde049..a8556b024 100644 --- a/packages/ruleset/src/functions/allowed-keywords.js +++ b/packages/ruleset/src/functions/allowed-keywords.js @@ -4,7 +4,7 @@ */ import { validateSubschemas } from '@ibm-cloud/openapi-ruleset-utilities'; -import { LoggerFactory } from '../utils'; +import { LoggerFactory } from '../utils/index.js'; let ruleId; let logger; diff --git a/packages/ruleset/src/functions/anchored-patterns.js b/packages/ruleset/src/functions/anchored-patterns.js index 838159434..581df8a98 100644 --- a/packages/ruleset/src/functions/anchored-patterns.js +++ b/packages/ruleset/src/functions/anchored-patterns.js @@ -8,7 +8,7 @@ import { validateSubschemas, } from '@ibm-cloud/openapi-ruleset-utilities'; -import { LoggerFactory } from '../utils'; +import { LoggerFactory } from '../utils/index.js'; let ruleId; let logger; diff --git a/packages/ruleset/src/functions/api-symmetry.js b/packages/ruleset/src/functions/api-symmetry.js index 3213a8324..cd2573a11 100644 --- a/packages/ruleset/src/functions/api-symmetry.js +++ b/packages/ruleset/src/functions/api-symmetry.js @@ -17,7 +17,7 @@ import { getCanonicalSchemaForPath, getResourceOrientedPaths, getSchemaNameAtPath, -} from '../utils'; +} from '../utils/index.js'; let ruleId; let logger; diff --git a/packages/ruleset/src/functions/array-attributes.js b/packages/ruleset/src/functions/array-attributes.js index 3672c6cf0..648a2239d 100644 --- a/packages/ruleset/src/functions/array-attributes.js +++ b/packages/ruleset/src/functions/array-attributes.js @@ -3,12 +3,12 @@ * SPDX-License-Identifier: Apache2.0 */ -import isPlainObject from 'lodash/isPlainObject'; +import isPlainObject from 'lodash/isPlainObject.js'; import { validateNestedSchemas, isArraySchema, } from '@ibm-cloud/openapi-ruleset-utilities'; -import { getCompositeSchemaAttribute, LoggerFactory } from '../utils'; +import { getCompositeSchemaAttribute, LoggerFactory } from '../utils/index.js'; let ruleId; let logger; diff --git a/packages/ruleset/src/functions/array-of-arrays.js b/packages/ruleset/src/functions/array-of-arrays.js index 6426245d4..4aaac9b66 100644 --- a/packages/ruleset/src/functions/array-of-arrays.js +++ b/packages/ruleset/src/functions/array-of-arrays.js @@ -7,7 +7,7 @@ import { isArraySchema, validateSubschemas, } from '@ibm-cloud/openapi-ruleset-utilities'; -import { LoggerFactory } from '../utils'; +import { LoggerFactory } from '../utils/index.js'; let ruleId; let logger; diff --git a/packages/ruleset/src/functions/array-responses.js b/packages/ruleset/src/functions/array-responses.js index 2e8bdd044..708371551 100644 --- a/packages/ruleset/src/functions/array-responses.js +++ b/packages/ruleset/src/functions/array-responses.js @@ -4,7 +4,7 @@ */ import { isArraySchema } from '@ibm-cloud/openapi-ruleset-utilities'; -import { LoggerFactory } from '../utils'; +import { LoggerFactory } from '../utils/index.js'; let ruleId; let logger; diff --git a/packages/ruleset/src/functions/avoid-multiple-types.js b/packages/ruleset/src/functions/avoid-multiple-types.js index eb4c7655f..cb59e3af2 100644 --- a/packages/ruleset/src/functions/avoid-multiple-types.js +++ b/packages/ruleset/src/functions/avoid-multiple-types.js @@ -4,7 +4,7 @@ */ import { validateNestedSchemas } from '@ibm-cloud/openapi-ruleset-utilities'; -import { LoggerFactory } from '../utils'; +import { LoggerFactory } from '../utils/index.js'; let ruleId; let logger; diff --git a/packages/ruleset/src/functions/binary-schemas.js b/packages/ruleset/src/functions/binary-schemas.js index d6c96d596..572fe2cfc 100644 --- a/packages/ruleset/src/functions/binary-schemas.js +++ b/packages/ruleset/src/functions/binary-schemas.js @@ -12,7 +12,7 @@ import { isRequestBodySchema, isResponseSchema, LoggerFactory, -} from '../utils'; +} from '../utils/index.js'; let ruleId; let logger; diff --git a/packages/ruleset/src/functions/circular-refs.js b/packages/ruleset/src/functions/circular-refs.js index 8bfe9fba6..ff27ee461 100644 --- a/packages/ruleset/src/functions/circular-refs.js +++ b/packages/ruleset/src/functions/circular-refs.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -import { LoggerFactory } from '../utils'; +import { LoggerFactory } from '../utils/index.js'; let ruleId; let logger; diff --git a/packages/ruleset/src/functions/collection-array-property.js b/packages/ruleset/src/functions/collection-array-property.js index 9b77ca76c..ef1a20dcd 100644 --- a/packages/ruleset/src/functions/collection-array-property.js +++ b/packages/ruleset/src/functions/collection-array-property.js @@ -9,7 +9,7 @@ import { isObject, getUnresolvedSpec, } from '@ibm-cloud/openapi-ruleset-utilities'; -import { LoggerFactory } from '../utils'; +import { LoggerFactory } from '../utils/index.js'; let ruleId; let logger; diff --git a/packages/ruleset/src/functions/consecutive-path-segments.js b/packages/ruleset/src/functions/consecutive-path-segments.js index cbe02d46c..63010892d 100644 --- a/packages/ruleset/src/functions/consecutive-path-segments.js +++ b/packages/ruleset/src/functions/consecutive-path-segments.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -import { LoggerFactory } from '../utils'; +import { LoggerFactory } from '../utils/index.js'; let ruleId; let logger; diff --git a/packages/ruleset/src/functions/delete-body.js b/packages/ruleset/src/functions/delete-body.js index a524f0264..a26bf18c0 100644 --- a/packages/ruleset/src/functions/delete-body.js +++ b/packages/ruleset/src/functions/delete-body.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -import { LoggerFactory } from '../utils'; +import { LoggerFactory } from '../utils/index.js'; let ruleId; let logger; diff --git a/packages/ruleset/src/functions/disallowed-header-parameter.js b/packages/ruleset/src/functions/disallowed-header-parameter.js index dffd31daa..c59da61ca 100644 --- a/packages/ruleset/src/functions/disallowed-header-parameter.js +++ b/packages/ruleset/src/functions/disallowed-header-parameter.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -import { LoggerFactory } from '../utils'; +import { LoggerFactory } from '../utils/index.js'; /** * This custom rule function is used to check for disallowed header parameters, diff --git a/packages/ruleset/src/functions/discriminator-property-exists.js b/packages/ruleset/src/functions/discriminator-property-exists.js index eabe159fb..b1c57f9ae 100644 --- a/packages/ruleset/src/functions/discriminator-property-exists.js +++ b/packages/ruleset/src/functions/discriminator-property-exists.js @@ -24,7 +24,7 @@ import { validateSubschemas, } from '@ibm-cloud/openapi-ruleset-utilities'; -import { LoggerFactory } from '../utils'; +import { LoggerFactory } from '../utils/index.js'; let ruleId; let logger; diff --git a/packages/ruleset/src/functions/duplicate-path-parameter.js b/packages/ruleset/src/functions/duplicate-path-parameter.js index dc3ebc112..9c5b88038 100644 --- a/packages/ruleset/src/functions/duplicate-path-parameter.js +++ b/packages/ruleset/src/functions/duplicate-path-parameter.js @@ -3,10 +3,10 @@ * SPDX-License-Identifier: Apache2.0 */ -import flatten from 'lodash/flatten'; -import isEqual from 'lodash/isEqual'; -import uniqWith from 'lodash/uniqWith' -import { operationMethods, LoggerFactory } from '../utils'; +import flatten from 'lodash/flatten.js'; +import isEqual from 'lodash/isEqual.js'; +import uniqWith from 'lodash/uniqWith.js'; +import { operationMethods, LoggerFactory } from '../utils/index.js'; let ruleId; let logger; diff --git a/packages/ruleset/src/functions/enum-casing-convention.js b/packages/ruleset/src/functions/enum-casing-convention.js index 8a3e10b34..4eed228de 100644 --- a/packages/ruleset/src/functions/enum-casing-convention.js +++ b/packages/ruleset/src/functions/enum-casing-convention.js @@ -5,7 +5,7 @@ import { validateSubschemas } from '@ibm-cloud/openapi-ruleset-utilities'; import { casing } from '@stoplight/spectral-functions'; -import { LoggerFactory } from '../utils'; +import { LoggerFactory } from '../utils/index.js'; let casingConfig; let ruleId; diff --git a/packages/ruleset/src/functions/error-response-schemas.js b/packages/ruleset/src/functions/error-response-schemas.js index a4055dbb0..9872488ea 100644 --- a/packages/ruleset/src/functions/error-response-schemas.js +++ b/packages/ruleset/src/functions/error-response-schemas.js @@ -9,7 +9,7 @@ import { isObject, isStringSchema, } from '@ibm-cloud/openapi-ruleset-utilities'; -import { LoggerFactory } from '../utils'; +import { LoggerFactory } from '../utils/index.js'; let ruleId; let logger; diff --git a/packages/ruleset/src/functions/etag-header-exists.js b/packages/ruleset/src/functions/etag-header-exists.js index 839affd90..8053179a1 100644 --- a/packages/ruleset/src/functions/etag-header-exists.js +++ b/packages/ruleset/src/functions/etag-header-exists.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -import { LoggerFactory } from '../utils'; +import { LoggerFactory } from '../utils/index.js'; let ruleId; let logger; diff --git a/packages/ruleset/src/functions/index.js b/packages/ruleset/src/functions/index.js index d703518f5..0e013c304 100644 --- a/packages/ruleset/src/functions/index.js +++ b/packages/ruleset/src/functions/index.js @@ -3,112 +3,83 @@ * SPDX-License-Identifier: Apache2.0 */ -export const acceptAndReturnModels = require('./accept-and-return-models'); -export const allowedKeywords = require('./allowed-keywords'); -export const anchoredPatterns = require('./anchored-patterns'); -export const apiSymmetry = require('./api-symmetry'); -export const arrayAttributes = require('./array-attributes'); -export const arrayOfArrays = require('./array-of-arrays'); -export const arrayResponses = require('./array-responses'); -export const avoidMultipleTypes = require('./avoid-multiple-types'); -export const binarySchemas = require('./binary-schemas'); -export const circularRefs = require('./circular-refs'); -export const collectionArrayProperty = require('./collection-array-property'); -export const consecutivePathSegments = require('./consecutive-path-segments'); -export const deleteBody = require('./delete-body'); -export const disallowedHeaderParameter = require('./disallowed-header-parameter'); -export const discriminatorPropertyExists = require('./discriminator-property-exists'); -export const duplicatePathParameter = require('./duplicate-path-parameter'); -export const enumCasingConvention = require('./enum-casing-convention'); -export const errorResponseSchemas = require('./error-response-schemas'); -export const etagHeaderExists = require('./etag-header-exists'); -export const inlineSchemas = require('./inline-schemas').default; -export const integerAttributes = require('./integer-attributes').default; -export const majorVersionInPath = require('./major-version-in-path').default; -export const mergePatchProperties = require('./merge-patch-properties').default; -export const noAmbiguousPaths = require('./no-ambiguous-paths').default; -export const noNullableProperties = require('./no-nullable-properties').default; -export const noOperationRequestBody = - require('./no-operation-requestbody').default; -export const noRefInExample = require('./no-ref-in-example').default; -export const noSuperfluousAllOf = require('./no-superfluous-allof').default; -export const noUnsupportedKeywords = - require('./no-unsupported-keywords').default; -export const operationIdCasingConvention = - require('./operationid-casing-convention').default; -export const operationIdNamingConvention = - require('./operationid-naming-convention').default; -export const operationSummaryExists = - require('./operation-summary-exists').default; -export const operationSummaryLength = - require('./operation-summary-length').default; -export const optionalRequestBody = require('./optional-request-body').default - .optionalRequestBody; -export const optionalRequestBodyDeprecated = require('./optional-request-body') - .default.optionalRequestBodyDeprecated; -export const paginationStyle = require('./pagination-style').default; -export const parameterCasingConvention = - require('./parameter-casing-convention').default; -export const parameterDefault = require('./parameter-default').default; -export const parameterDescriptionExists = - require('./parameter-description-exists').default; -export const parameterOrder = require('./parameter-order').default; -export const patchRequestContentType = - require('./patch-request-content-type').default; -export const pathParameterNotCRN = require('./path-parameter-not-crn').default; -export const pathSegmentCasingConvention = - require('./path-segment-casing-convention').default; -export const patternPropertiesCheck = require('./pattern-properties').default; -export const preconditionHeader = require('./precondition-header').default; -export const preferTokenPagination = - require('./prefer-token-pagination').default; -export const propertyAttributes = require('./property-attributes').default; -export const propertyCasingConvention = - require('./property-casing-convention').default; -export const propertyConsistentNameAndType = - require('./property-consistent-name-and-type').default; -export const propertyDescriptionExists = - require('./property-description-exists').default; -export const propertyNameCollision = - require('./property-name-collision').default; -export const redirectResponseBody = require('./redirect-response-body').default; -export const refPattern = require('./ref-pattern').default; -export const refSiblingDuplicateDescription = - require('./ref-sibling-duplicate-description').default; -export const requestAndResponseContent = - require('./request-and-response-content').default; -export const requestBodyName = require('./requestbody-name').default; -export const requiredArrayPropertiesInResponse = - require('./required-array-properties-in-response').default; -export const requiredEnumPropertiesInResponse = - require('./required-enum-properties-in-response').default; -export const requiredProperty = require('./required-property').default; -export const resourceResponseConsistency = - require('./resource-response-consistency').default; -export const responseExampleExists = - require('./response-example-exists').default; -export const responseStatusCodes = require('./response-status-codes').default; -export const schemaCasingConvention = - require('./schema-casing-convention').default; -export const schemaDescriptionExists = - require('./schema-description-exists').default; -export const schemaNamingConvention = - require('./schema-naming-convention').default; -export const schemaOrContentProvided = - require('./schema-or-content-provided').default; -export const schemaTypeExists = require('./schema-type-exists').default; -export const schemaTypeFormat = require('./schema-type-format').default; -export const securitySchemeAttributes = - require('./securityscheme-attributes').default; -export const securitySchemes = require('./securityschemes').default; -export const stringAttributes = require('./string-attributes').default; -export const unevaluatedProperties = - require('./unevaluated-properties').default; -export const uniqueParameterRequestPropertyNames = - require('./unique-parameter-request-property-names').default; -export const unusedTags = require('./unused-tags').default; -export const useDateBasedFormat = require('./use-date-based-format').default; -export const validatePathSegments = require('./valid-path-segments').default; -export const validSchemaExample = require('./valid-schema-example').default; -export const wellDefinedDictionaries = - require('./well-defined-dictionaries').default; +export { default as acceptAndReturnModels } from './accept-and-return-models.js'; +export { default as allowedKeywords } from './allowed-keywords.js'; +export { default as anchoredPatterns } from './anchored-patterns.js'; +export { default as apiSymmetry } from './api-symmetry.js'; +export { default as arrayAttributes } from './array-attributes.js'; +export { default as arrayOfArrays } from './array-of-arrays.js'; +export { default as arrayResponses } from './array-responses.js'; +export { default as avoidMultipleTypes } from './avoid-multiple-types.js'; +export { default as binarySchemas } from './binary-schemas.js'; +export { default as circularRefs } from './circular-refs.js'; +export { default as collectionArrayProperty } from './collection-array-property.js'; +export { default as consecutivePathSegments } from './consecutive-path-segments.js'; +export { default as deleteBody } from './delete-body.js'; +export { default as disallowedHeaderParameter } from './disallowed-header-parameter.js'; +export { default as discriminatorPropertyExists } from './discriminator-property-exists.js'; +export { default as duplicatePathParameter } from './duplicate-path-parameter.js'; +export { default as enumCasingConvention } from './enum-casing-convention.js'; +export { default as errorResponseSchemas } from './error-response-schemas.js'; +export { default as etagHeaderExists } from './etag-header-exists.js'; +export { default as inlineSchemas } from './inline-schemas.js'; +export { default as integerAttributes } from './integer-attributes.js'; +export { default as majorVersionInPath } from './major-version-in-path.js'; +export { default as mergePatchProperties } from './merge-patch-properties.js'; +export { default as noAmbiguousPaths } from './no-ambiguous-paths.js'; +export { default as noNullableProperties } from './no-nullable-properties.js'; +export { default as noOperationRequestBody } from './no-operation-requestbody.js'; +export { default as noRefInExample } from './no-ref-in-example.js'; +export { default as noSuperfluousAllOf } from './no-superfluous-allof.js'; +export { default as noUnsupportedKeywords } from './no-unsupported-keywords.js'; +export { default as operationIdCasingConvention } from './operationid-casing-convention.js'; +export { default as operationIdNamingConvention } from './operationid-naming-convention.js'; +export { default as operationSummaryExists } from './operation-summary-exists.js'; +export { default as operationSummaryLength } from './operation-summary-length.js'; +export { + optionalRequestBody, + optionalRequestBodyDeprecated, +} from './optional-request-body.js'; +export { default as paginationStyle } from './pagination-style.js'; +export { default as parameterCasingConvention } from './parameter-casing-convention.js'; +export { default as parameterDefault } from './parameter-default.js'; +export { default as parameterDescriptionExists } from './parameter-description-exists.js'; +export { default as parameterOrder } from './parameter-order.js'; +export { default as patchRequestContentType } from './patch-request-content-type.js'; +export { default as pathParameterNotCRN } from './path-parameter-not-crn.js'; +export { default as pathSegmentCasingConvention } from './path-segment-casing-convention.js'; +export { default as patternPropertiesCheck } from './pattern-properties.js'; +export { default as preconditionHeader } from './precondition-header.js'; +export { default as preferTokenPagination } from './prefer-token-pagination.js'; +export { default as propertyAttributes } from './property-attributes.js'; +export { default as propertyCasingConvention } from './property-casing-convention.js'; +export { default as propertyConsistentNameAndType } from './property-consistent-name-and-type.js'; +export { default as propertyDescriptionExists } from './property-description-exists.js'; +export { default as propertyNameCollision } from './property-name-collision.js'; +export { default as redirectResponseBody } from './redirect-response-body.js'; +export { default as refPattern } from './ref-pattern.js'; +export { default as refSiblingDuplicateDescription } from './ref-sibling-duplicate-description.js'; +export { default as requestAndResponseContent } from './request-and-response-content.js'; +export { default as requestBodyName } from './requestbody-name.js'; +export { default as requiredArrayPropertiesInResponse } from './required-array-properties-in-response.js'; +export { default as requiredEnumPropertiesInResponse } from './required-enum-properties-in-response.js'; +export { default as requiredProperty } from './required-property.js'; +export { default as resourceResponseConsistency } from './resource-response-consistency.js'; +export { default as responseExampleExists } from './response-example-exists.js'; +export { default as responseStatusCodes } from './response-status-codes.js'; +export { default as schemaCasingConvention } from './schema-casing-convention.js'; +export { default as schemaDescriptionExists } from './schema-description-exists.js'; +export { default as schemaNamingConvention } from './schema-naming-convention.js'; +export { default as schemaOrContentProvided } from './schema-or-content-provided.js'; +export { default as schemaTypeExists } from './schema-type-exists.js'; +export { default as schemaTypeFormat } from './schema-type-format.js'; +export { default as securitySchemeAttributes } from './securityscheme-attributes.js'; +export { default as securitySchemes } from './securityschemes.js'; +export { default as stringAttributes } from './string-attributes.js'; +export { default as unevaluatedProperties } from './unevaluated-properties.js'; +export { default as uniqueParameterRequestPropertyNames } from './unique-parameter-request-property-names.js'; +export { default as unusedTags } from './unused-tags.js'; +export { default as useDateBasedFormat } from './use-date-based-format.js'; +export { default as validatePathSegments } from './valid-path-segments.js'; +export { default as validSchemaExample } from './valid-schema-example.js'; +export { default as wellDefinedDictionaries } from './well-defined-dictionaries.js'; diff --git a/packages/ruleset/src/functions/inline-schemas.js b/packages/ruleset/src/functions/inline-schemas.js index ee4316a16..1f61bace7 100644 --- a/packages/ruleset/src/functions/inline-schemas.js +++ b/packages/ruleset/src/functions/inline-schemas.js @@ -13,7 +13,7 @@ import { isJsonMimeType, isEmptyObjectSchema, isRefSiblingSchema, -} from '../utils'; +} from '../utils/index.js'; /** * Checks to make sure that nested object schemas are defined using a $ref rather than diff --git a/packages/ruleset/src/functions/integer-attributes.js b/packages/ruleset/src/functions/integer-attributes.js index 0c878c10f..de20e2801 100644 --- a/packages/ruleset/src/functions/integer-attributes.js +++ b/packages/ruleset/src/functions/integer-attributes.js @@ -8,7 +8,7 @@ import { validateNestedSchemas, } from '@ibm-cloud/openapi-ruleset-utilities'; -import { getCompositeSchemaAttribute, LoggerFactory } from '../utils'; +import { getCompositeSchemaAttribute, LoggerFactory } from '../utils/index.js'; let ruleId; let logger; diff --git a/packages/ruleset/src/functions/major-version-in-path.js b/packages/ruleset/src/functions/major-version-in-path.js index 1fd344cfc..3d742394d 100644 --- a/packages/ruleset/src/functions/major-version-in-path.js +++ b/packages/ruleset/src/functions/major-version-in-path.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -import { LoggerFactory } from '../utils'; +import { LoggerFactory } from '../utils/index.js'; let ruleId; let logger; diff --git a/packages/ruleset/src/functions/merge-patch-properties.js b/packages/ruleset/src/functions/merge-patch-properties.js index 674597185..dcb29322b 100644 --- a/packages/ruleset/src/functions/merge-patch-properties.js +++ b/packages/ruleset/src/functions/merge-patch-properties.js @@ -4,7 +4,7 @@ */ import { schemaHasConstraint } from '@ibm-cloud/openapi-ruleset-utilities'; -import { LoggerFactory } from '../utils'; +import { LoggerFactory } from '../utils/index.js'; let ruleId; let logger; diff --git a/packages/ruleset/src/functions/no-ambiguous-paths.js b/packages/ruleset/src/functions/no-ambiguous-paths.js index 0ed0d6212..9cc368217 100644 --- a/packages/ruleset/src/functions/no-ambiguous-paths.js +++ b/packages/ruleset/src/functions/no-ambiguous-paths.js @@ -4,7 +4,7 @@ */ import { isObject } from '@ibm-cloud/openapi-ruleset-utilities'; -import { LoggerFactory } from '../utils'; +import { LoggerFactory } from '../utils/index.js'; let ruleId; let logger; diff --git a/packages/ruleset/src/functions/no-nullable-properties.js b/packages/ruleset/src/functions/no-nullable-properties.js index 0f21741db..6fdba7d9b 100644 --- a/packages/ruleset/src/functions/no-nullable-properties.js +++ b/packages/ruleset/src/functions/no-nullable-properties.js @@ -11,7 +11,7 @@ import { isMergePatchMimeType, LoggerFactory, operationMethods, -} from '../utils'; +} from '../utils/index.js'; let ruleId; let logger; diff --git a/packages/ruleset/src/functions/no-operation-requestbody.js b/packages/ruleset/src/functions/no-operation-requestbody.js index 45f534fd9..af436c2d5 100644 --- a/packages/ruleset/src/functions/no-operation-requestbody.js +++ b/packages/ruleset/src/functions/no-operation-requestbody.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -import { LoggerFactory } from '../utils'; +import { LoggerFactory } from '../utils/index.js'; let ruleId; let logger; diff --git a/packages/ruleset/src/functions/no-ref-in-example.js b/packages/ruleset/src/functions/no-ref-in-example.js index a28c74d2d..06e6dc725 100644 --- a/packages/ruleset/src/functions/no-ref-in-example.js +++ b/packages/ruleset/src/functions/no-ref-in-example.js @@ -4,7 +4,7 @@ */ import { isObject } from '@ibm-cloud/openapi-ruleset-utilities'; -import { LoggerFactory } from '../utils'; +import { LoggerFactory } from '../utils/index.js'; let ruleId; let logger; diff --git a/packages/ruleset/src/functions/no-superfluous-allof.js b/packages/ruleset/src/functions/no-superfluous-allof.js index 5145d0e82..f5728f24d 100644 --- a/packages/ruleset/src/functions/no-superfluous-allof.js +++ b/packages/ruleset/src/functions/no-superfluous-allof.js @@ -4,7 +4,7 @@ */ import { validateSubschemas } from '@ibm-cloud/openapi-ruleset-utilities'; -import { LoggerFactory } from '../utils'; +import { LoggerFactory } from '../utils/index.js'; let ruleId; let logger; diff --git a/packages/ruleset/src/functions/no-unsupported-keywords.js b/packages/ruleset/src/functions/no-unsupported-keywords.js index 902327f51..c6f55b6b7 100644 --- a/packages/ruleset/src/functions/no-unsupported-keywords.js +++ b/packages/ruleset/src/functions/no-unsupported-keywords.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -import { LoggerFactory } from '../utils'; +import { LoggerFactory } from '../utils/index.js'; let ruleId; let logger; diff --git a/packages/ruleset/src/functions/operation-summary-exists.js b/packages/ruleset/src/functions/operation-summary-exists.js index baacb123a..c8cea6702 100644 --- a/packages/ruleset/src/functions/operation-summary-exists.js +++ b/packages/ruleset/src/functions/operation-summary-exists.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -import { LoggerFactory } from '../utils'; +import { LoggerFactory } from '../utils/index.js'; let ruleId; let logger; diff --git a/packages/ruleset/src/functions/operation-summary-length.js b/packages/ruleset/src/functions/operation-summary-length.js index 5464cf952..0af6dfaa0 100644 --- a/packages/ruleset/src/functions/operation-summary-length.js +++ b/packages/ruleset/src/functions/operation-summary-length.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -import { LoggerFactory } from '../utils'; +import { LoggerFactory } from '../utils/index.js'; let ruleId; let logger; diff --git a/packages/ruleset/src/functions/operationid-casing-convention.js b/packages/ruleset/src/functions/operationid-casing-convention.js index dffc5eddd..589c9aedb 100644 --- a/packages/ruleset/src/functions/operationid-casing-convention.js +++ b/packages/ruleset/src/functions/operationid-casing-convention.js @@ -4,7 +4,7 @@ */ import { casing } from '@stoplight/spectral-functions'; -import { LoggerFactory } from '../utils'; +import { LoggerFactory } from '../utils/index.js'; let casingConfig; let ruleId; diff --git a/packages/ruleset/src/functions/operationid-naming-convention.js b/packages/ruleset/src/functions/operationid-naming-convention.js index 94fd7952e..b69252e82 100644 --- a/packages/ruleset/src/functions/operationid-naming-convention.js +++ b/packages/ruleset/src/functions/operationid-naming-convention.js @@ -3,11 +3,11 @@ * SPDX-License-Identifier: Apache2.0 */ -import each from 'lodash/each'; -import merge from 'lodash/merge'; -import pickBy from 'lodash/pickBy'; -import reduce from 'lodash/reduce'; -import { operationMethods } from '../utils'; +import each from 'lodash/each.js'; +import merge from 'lodash/merge.js'; +import pickBy from 'lodash/pickBy.js'; +import reduce from 'lodash/reduce.js'; +import { operationMethods } from '../utils/index.js'; import { singularize } from 'inflected'; export default function (rootDocument, options) { diff --git a/packages/ruleset/src/functions/optional-request-body.js b/packages/ruleset/src/functions/optional-request-body.js index 7e4a32f24..1c97f18ca 100644 --- a/packages/ruleset/src/functions/optional-request-body.js +++ b/packages/ruleset/src/functions/optional-request-body.js @@ -3,8 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -import { getCompositeSchemaAttribute } from '../utils'; -import { LoggerFactory } from '../utils'; +import { getCompositeSchemaAttribute } from '../utils/index.js'; +import { LoggerFactory } from '../utils/index.js'; const oldRuleId = 'ibm-no-optional-properties-in-required-body'; const newRuleId = 'ibm-no-required-properties-in-optional-body'; @@ -69,7 +69,4 @@ function optionalRequestBodyDeprecated(schema, _unused_options, context) { return optionalRequestBody(schema, _unused_options, context); } -export default { - optionalRequestBody, - optionalRequestBodyDeprecated, -}; +export { optionalRequestBody, optionalRequestBodyDeprecated }; diff --git a/packages/ruleset/src/functions/pagination-style.js b/packages/ruleset/src/functions/pagination-style.js index 5586af2d1..afaeeb435 100644 --- a/packages/ruleset/src/functions/pagination-style.js +++ b/packages/ruleset/src/functions/pagination-style.js @@ -11,7 +11,7 @@ import { getSuccessCode, getResponseSchema, getPaginatedOperationFromPath, -} from '../utils'; +} from '../utils/index.js'; import { isIntegerSchema, isStringSchema, diff --git a/packages/ruleset/src/functions/parameter-casing-convention.js b/packages/ruleset/src/functions/parameter-casing-convention.js index b2b662b6d..2609f568c 100644 --- a/packages/ruleset/src/functions/parameter-casing-convention.js +++ b/packages/ruleset/src/functions/parameter-casing-convention.js @@ -4,7 +4,7 @@ */ import { casing, pattern } from '@stoplight/spectral-functions'; -import { isDeprecated, LoggerFactory } from '../utils'; +import { isDeprecated, LoggerFactory } from '../utils/index.js'; // Error message prefix for each parameter type. const errorMsgPrefix = { diff --git a/packages/ruleset/src/functions/parameter-default.js b/packages/ruleset/src/functions/parameter-default.js index d1ea21d3b..647124a5e 100644 --- a/packages/ruleset/src/functions/parameter-default.js +++ b/packages/ruleset/src/functions/parameter-default.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -import { LoggerFactory } from '../utils'; +import { LoggerFactory } from '../utils/index.js'; let ruleId; let logger; diff --git a/packages/ruleset/src/functions/parameter-description-exists.js b/packages/ruleset/src/functions/parameter-description-exists.js index a3a419684..cc22f961f 100644 --- a/packages/ruleset/src/functions/parameter-description-exists.js +++ b/packages/ruleset/src/functions/parameter-description-exists.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -import { LoggerFactory } from '../utils'; +import { LoggerFactory } from '../utils/index.js'; let ruleId; let logger; diff --git a/packages/ruleset/src/functions/parameter-order.js b/packages/ruleset/src/functions/parameter-order.js index 760cb8920..adb0c4066 100644 --- a/packages/ruleset/src/functions/parameter-order.js +++ b/packages/ruleset/src/functions/parameter-order.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -import { LoggerFactory } from '../utils'; +import { LoggerFactory } from '../utils/index.js'; let ruleId; let logger; diff --git a/packages/ruleset/src/functions/patch-request-content-type.js b/packages/ruleset/src/functions/patch-request-content-type.js index d4be99b55..b67156e77 100644 --- a/packages/ruleset/src/functions/patch-request-content-type.js +++ b/packages/ruleset/src/functions/patch-request-content-type.js @@ -7,7 +7,7 @@ import { isJsonPatchMimeType, isMergePatchMimeType, LoggerFactory, -} from '../utils'; +} from '../utils/index.js'; let ruleId; let logger; diff --git a/packages/ruleset/src/functions/path-parameter-not-crn.js b/packages/ruleset/src/functions/path-parameter-not-crn.js index 451abba28..5a0bf336d 100644 --- a/packages/ruleset/src/functions/path-parameter-not-crn.js +++ b/packages/ruleset/src/functions/path-parameter-not-crn.js @@ -7,7 +7,7 @@ import { isStringSchema, schemaHasConstraint, } from '@ibm-cloud/openapi-ruleset-utilities'; -import { LoggerFactory } from '../utils'; +import { LoggerFactory } from '../utils/index.js'; let ruleId; let logger; diff --git a/packages/ruleset/src/functions/path-segment-casing-convention.js b/packages/ruleset/src/functions/path-segment-casing-convention.js index 165bb2778..86bfa8eeb 100644 --- a/packages/ruleset/src/functions/path-segment-casing-convention.js +++ b/packages/ruleset/src/functions/path-segment-casing-convention.js @@ -4,7 +4,7 @@ */ import { casing } from '@stoplight/spectral-functions'; -import { LoggerFactory } from '../utils'; +import { LoggerFactory } from '../utils/index.js'; let casingConfig; let ruleId; diff --git a/packages/ruleset/src/functions/pattern-properties.js b/packages/ruleset/src/functions/pattern-properties.js index 9f957bfaa..d9c9630c5 100644 --- a/packages/ruleset/src/functions/pattern-properties.js +++ b/packages/ruleset/src/functions/pattern-properties.js @@ -7,7 +7,7 @@ import { isObject, validateSubschemas, } from '@ibm-cloud/openapi-ruleset-utilities'; -import { LoggerFactory } from '../utils'; +import { LoggerFactory } from '../utils/index.js'; let ruleId; let logger; diff --git a/packages/ruleset/src/functions/precondition-header.js b/packages/ruleset/src/functions/precondition-header.js index df64a0286..32c0f320f 100644 --- a/packages/ruleset/src/functions/precondition-header.js +++ b/packages/ruleset/src/functions/precondition-header.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -import { LoggerFactory } from '../utils'; +import { LoggerFactory } from '../utils/index.js'; let ruleId; let logger; diff --git a/packages/ruleset/src/functions/prefer-token-pagination.js b/packages/ruleset/src/functions/prefer-token-pagination.js index 3e8edcb1e..d9d3025ba 100644 --- a/packages/ruleset/src/functions/prefer-token-pagination.js +++ b/packages/ruleset/src/functions/prefer-token-pagination.js @@ -7,7 +7,7 @@ import { getPaginatedOperationFromPath, getOffsetParamIndex, LoggerFactory, -} from '../utils'; +} from '../utils/index.js'; let ruleId; let logger; diff --git a/packages/ruleset/src/functions/property-attributes.js b/packages/ruleset/src/functions/property-attributes.js index 90bc51996..0808ff114 100644 --- a/packages/ruleset/src/functions/property-attributes.js +++ b/packages/ruleset/src/functions/property-attributes.js @@ -10,7 +10,7 @@ import { isIntegerSchema, isObjectSchema, } from '@ibm-cloud/openapi-ruleset-utilities'; -import { LoggerFactory } from '../utils'; +import { LoggerFactory } from '../utils/index.js'; let ruleId; let logger; diff --git a/packages/ruleset/src/functions/property-casing-convention.js b/packages/ruleset/src/functions/property-casing-convention.js index 58418f40f..8a02095b0 100644 --- a/packages/ruleset/src/functions/property-casing-convention.js +++ b/packages/ruleset/src/functions/property-casing-convention.js @@ -5,7 +5,7 @@ import { casing } from '@stoplight/spectral-functions'; import { validateSubschemas } from '@ibm-cloud/openapi-ruleset-utilities'; -import { LoggerFactory } from '../utils'; +import { LoggerFactory } from '../utils/index.js'; let casingConfig; let ruleId; diff --git a/packages/ruleset/src/functions/property-consistent-name-and-type.js b/packages/ruleset/src/functions/property-consistent-name-and-type.js index e925a55dc..358512822 100644 --- a/packages/ruleset/src/functions/property-consistent-name-and-type.js +++ b/packages/ruleset/src/functions/property-consistent-name-and-type.js @@ -8,7 +8,7 @@ import { validateSubschemas, SchemaType, } from '@ibm-cloud/openapi-ruleset-utilities'; -import { LoggerFactory } from '../utils'; +import { LoggerFactory } from '../utils/index.js'; // We need to look at properties across the entire API definition. // This will act as a global variable to hold all of the properties diff --git a/packages/ruleset/src/functions/property-description-exists.js b/packages/ruleset/src/functions/property-description-exists.js index d15d2f1aa..146575e56 100644 --- a/packages/ruleset/src/functions/property-description-exists.js +++ b/packages/ruleset/src/functions/property-description-exists.js @@ -7,7 +7,7 @@ import { schemaHasConstraint, validateSubschemas, } from '@ibm-cloud/openapi-ruleset-utilities'; -import { LoggerFactory, isSchemaProperty } from '../utils'; +import { LoggerFactory, isSchemaProperty } from '../utils/index.js'; let ruleId; let logger; diff --git a/packages/ruleset/src/functions/property-name-collision.js b/packages/ruleset/src/functions/property-name-collision.js index d25398423..86a668b60 100644 --- a/packages/ruleset/src/functions/property-name-collision.js +++ b/packages/ruleset/src/functions/property-name-collision.js @@ -4,7 +4,7 @@ */ import { validateSubschemas } from '@ibm-cloud/openapi-ruleset-utilities'; -import { LoggerFactory } from '../utils'; +import { LoggerFactory } from '../utils/index.js'; let ruleId; let logger; diff --git a/packages/ruleset/src/functions/redirect-response-body.js b/packages/ruleset/src/functions/redirect-response-body.js index 6531129f7..f14e060a9 100644 --- a/packages/ruleset/src/functions/redirect-response-body.js +++ b/packages/ruleset/src/functions/redirect-response-body.js @@ -4,7 +4,7 @@ */ import { getResolvedSpec } from '@ibm-cloud/openapi-ruleset-utilities'; -import { LoggerFactory, getResponseCodes } from '../utils'; +import { LoggerFactory, getResponseCodes } from '../utils/index.js'; let ruleId; let logger; diff --git a/packages/ruleset/src/functions/ref-pattern.js b/packages/ruleset/src/functions/ref-pattern.js index 3f41b7fac..a5e76d1cd 100644 --- a/packages/ruleset/src/functions/ref-pattern.js +++ b/packages/ruleset/src/functions/ref-pattern.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -import { LoggerFactory } from '../utils'; +import { LoggerFactory } from '../utils/index.js'; let ruleId; let logger; diff --git a/packages/ruleset/src/functions/ref-sibling-duplicate-description.js b/packages/ruleset/src/functions/ref-sibling-duplicate-description.js index 986ae79e0..341629b10 100644 --- a/packages/ruleset/src/functions/ref-sibling-duplicate-description.js +++ b/packages/ruleset/src/functions/ref-sibling-duplicate-description.js @@ -4,7 +4,7 @@ */ import { validateSubschemas } from '@ibm-cloud/openapi-ruleset-utilities'; -import { LoggerFactory } from '../utils'; +import { LoggerFactory } from '../utils/index.js'; let ruleId; let logger; diff --git a/packages/ruleset/src/functions/request-and-response-content.js b/packages/ruleset/src/functions/request-and-response-content.js index a1fa96896..77deb78e3 100644 --- a/packages/ruleset/src/functions/request-and-response-content.js +++ b/packages/ruleset/src/functions/request-and-response-content.js @@ -7,7 +7,10 @@ import { isObject, getResolvedSpec, } from '@ibm-cloud/openapi-ruleset-utilities'; -import { LoggerFactory, pathHasMinimallyRepresentedResource } from '../utils'; +import { + LoggerFactory, + pathHasMinimallyRepresentedResource, +} from '../utils/index.js'; let ruleId; let logger; diff --git a/packages/ruleset/src/functions/requestbody-name.js b/packages/ruleset/src/functions/requestbody-name.js index 32ec5e67d..c1f345a7a 100644 --- a/packages/ruleset/src/functions/requestbody-name.js +++ b/packages/ruleset/src/functions/requestbody-name.js @@ -3,7 +3,11 @@ * SPDX-License-Identifier: Apache2.0 */ -import { isFormMimeType, isRequestBodyExploded, LoggerFactory } from '../utils'; +import { + isFormMimeType, + isRequestBodyExploded, + LoggerFactory, +} from '../utils/index.js'; let ruleId; let logger; diff --git a/packages/ruleset/src/functions/required-array-properties-in-response.js b/packages/ruleset/src/functions/required-array-properties-in-response.js index 9886c3d6a..b173f09a4 100644 --- a/packages/ruleset/src/functions/required-array-properties-in-response.js +++ b/packages/ruleset/src/functions/required-array-properties-in-response.js @@ -8,7 +8,7 @@ import { isObject, validateNestedSchemas, } from '@ibm-cloud/openapi-ruleset-utilities'; -import { LoggerFactory } from '../utils'; +import { LoggerFactory } from '../utils/index.js'; let ruleId; let logger; diff --git a/packages/ruleset/src/functions/required-enum-properties-in-response.js b/packages/ruleset/src/functions/required-enum-properties-in-response.js index 029c33599..21701fce6 100644 --- a/packages/ruleset/src/functions/required-enum-properties-in-response.js +++ b/packages/ruleset/src/functions/required-enum-properties-in-response.js @@ -8,7 +8,7 @@ import { isObject, validateNestedSchemas, } from '@ibm-cloud/openapi-ruleset-utilities'; -import { LoggerFactory } from '../utils'; +import { LoggerFactory } from '../utils/index.js'; let ruleId; let logger; diff --git a/packages/ruleset/src/functions/required-property.js b/packages/ruleset/src/functions/required-property.js index 530fc2197..c13fca55f 100644 --- a/packages/ruleset/src/functions/required-property.js +++ b/packages/ruleset/src/functions/required-property.js @@ -7,7 +7,7 @@ import { schemaHasProperty, validateSubschemas, } from '@ibm-cloud/openapi-ruleset-utilities'; -import { LoggerFactory } from '../utils'; +import { LoggerFactory } from '../utils/index.js'; let ruleId; let logger; diff --git a/packages/ruleset/src/functions/resource-response-consistency.js b/packages/ruleset/src/functions/resource-response-consistency.js index f9712844c..46a48666b 100644 --- a/packages/ruleset/src/functions/resource-response-consistency.js +++ b/packages/ruleset/src/functions/resource-response-consistency.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -import isEqual from 'lodash/isEqual'; +import isEqual from 'lodash/isEqual.js'; import { isObject, getResolvedSpec, @@ -19,7 +19,7 @@ import { isJsonMimeType, isOperationOfType, LoggerFactory, -} from '../utils'; +} from '../utils/index.js'; let ruleId; let logger; diff --git a/packages/ruleset/src/functions/response-status-codes.js b/packages/ruleset/src/functions/response-status-codes.js index 05529be44..a62eb3cac 100644 --- a/packages/ruleset/src/functions/response-status-codes.js +++ b/packages/ruleset/src/functions/response-status-codes.js @@ -11,7 +11,7 @@ import { getResourceSpecificSiblingPath, getResponseCodes, pathHasMinimallyRepresentedResource, -} from '../utils'; +} from '../utils/index.js'; let ruleId; let logger; diff --git a/packages/ruleset/src/functions/schema-casing-convention.js b/packages/ruleset/src/functions/schema-casing-convention.js index b4f7b564b..dd649cc45 100644 --- a/packages/ruleset/src/functions/schema-casing-convention.js +++ b/packages/ruleset/src/functions/schema-casing-convention.js @@ -5,7 +5,7 @@ import { isObject } from '@ibm-cloud/openapi-ruleset-utilities'; import { pattern } from '@stoplight/spectral-functions'; -import { LoggerFactory } from '../utils'; +import { LoggerFactory } from '../utils/index.js'; let patternConfig; let ruleId; diff --git a/packages/ruleset/src/functions/schema-description-exists.js b/packages/ruleset/src/functions/schema-description-exists.js index e202d665c..e68250a0a 100644 --- a/packages/ruleset/src/functions/schema-description-exists.js +++ b/packages/ruleset/src/functions/schema-description-exists.js @@ -7,7 +7,7 @@ import { validateSubschemas, schemaHasConstraint, } from '@ibm-cloud/openapi-ruleset-utilities'; -import { LoggerFactory, isPrimarySchema } from '../utils'; +import { LoggerFactory, isPrimarySchema } from '../utils/index.js'; let ruleId; let logger; diff --git a/packages/ruleset/src/functions/schema-naming-convention.js b/packages/ruleset/src/functions/schema-naming-convention.js index 32b77157f..b013cd971 100644 --- a/packages/ruleset/src/functions/schema-naming-convention.js +++ b/packages/ruleset/src/functions/schema-naming-convention.js @@ -16,7 +16,7 @@ import { getResourceOrientedPaths, getSchemaNameAtPath, getSuccessResponseSchemaForOperation, -} from '../utils'; +} from '../utils/index.js'; let ruleId; let logger; diff --git a/packages/ruleset/src/functions/schema-type-exists.js b/packages/ruleset/src/functions/schema-type-exists.js index 837f7a980..7567328f2 100644 --- a/packages/ruleset/src/functions/schema-type-exists.js +++ b/packages/ruleset/src/functions/schema-type-exists.js @@ -4,7 +4,7 @@ */ import { validateSubschemas } from '@ibm-cloud/openapi-ruleset-utilities'; -import { LoggerFactory, mergeAllOfSchemaProperties } from '../utils'; +import { LoggerFactory, mergeAllOfSchemaProperties } from '../utils/index.js'; let ruleId; let logger; diff --git a/packages/ruleset/src/functions/schema-type-format.js b/packages/ruleset/src/functions/schema-type-format.js index fb91d1266..a94d928a2 100644 --- a/packages/ruleset/src/functions/schema-type-format.js +++ b/packages/ruleset/src/functions/schema-type-format.js @@ -4,7 +4,7 @@ */ import { validateSubschemas } from '@ibm-cloud/openapi-ruleset-utilities'; -import { LoggerFactory } from '../utils'; +import { LoggerFactory } from '../utils/index.js'; // Valid schema types. const validTypes = [ diff --git a/packages/ruleset/src/functions/securityscheme-attributes.js b/packages/ruleset/src/functions/securityscheme-attributes.js index e146a57dc..39da89568 100644 --- a/packages/ruleset/src/functions/securityscheme-attributes.js +++ b/packages/ruleset/src/functions/securityscheme-attributes.js @@ -3,8 +3,10 @@ * SPDX-License-Identifier: Apache2.0 */ -import { isURL } from 'validator'; -import { LoggerFactory } from '../utils'; +import validator from 'validator'; +import { LoggerFactory } from '../utils/index.js'; + +const { isURL } = validator; let ruleId; let logger; diff --git a/packages/ruleset/src/functions/securityschemes.js b/packages/ruleset/src/functions/securityschemes.js index 89347ff5c..10cd90adf 100644 --- a/packages/ruleset/src/functions/securityschemes.js +++ b/packages/ruleset/src/functions/securityschemes.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -import { LoggerFactory, operationMethods } from '../utils'; +import { LoggerFactory, operationMethods } from '../utils/index.js'; let ruleId; let logger; diff --git a/packages/ruleset/src/functions/string-attributes.js b/packages/ruleset/src/functions/string-attributes.js index f09ecc95c..978cb76d6 100644 --- a/packages/ruleset/src/functions/string-attributes.js +++ b/packages/ruleset/src/functions/string-attributes.js @@ -9,7 +9,7 @@ import { validateNestedSchemas, } from '@ibm-cloud/openapi-ruleset-utilities'; -import { getCompositeSchemaAttribute, LoggerFactory } from '../utils'; +import { getCompositeSchemaAttribute, LoggerFactory } from '../utils/index.js'; let ruleId; let logger; diff --git a/packages/ruleset/src/functions/unevaluated-properties.js b/packages/ruleset/src/functions/unevaluated-properties.js index 3adc33aba..13cae7f6c 100644 --- a/packages/ruleset/src/functions/unevaluated-properties.js +++ b/packages/ruleset/src/functions/unevaluated-properties.js @@ -4,7 +4,7 @@ */ import { validateSubschemas } from '@ibm-cloud/openapi-ruleset-utilities'; -import { LoggerFactory } from '../utils'; +import { LoggerFactory } from '../utils/index.js'; let ruleId; let logger; diff --git a/packages/ruleset/src/functions/unique-parameter-request-property-names.js b/packages/ruleset/src/functions/unique-parameter-request-property-names.js index 172b107cb..0c1b371a0 100644 --- a/packages/ruleset/src/functions/unique-parameter-request-property-names.js +++ b/packages/ruleset/src/functions/unique-parameter-request-property-names.js @@ -14,7 +14,7 @@ import { isMergePatchMimeType, LoggerFactory, operationMethods, -} from '../utils'; +} from '../utils/index.js'; let ruleId; let logger; diff --git a/packages/ruleset/src/functions/unused-tags.js b/packages/ruleset/src/functions/unused-tags.js index 9165ad5e6..99323a61d 100644 --- a/packages/ruleset/src/functions/unused-tags.js +++ b/packages/ruleset/src/functions/unused-tags.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -import { LoggerFactory, operationMethods } from '../utils'; +import { LoggerFactory, operationMethods } from '../utils/index.js'; let ruleId; let logger; diff --git a/packages/ruleset/src/functions/use-date-based-format.js b/packages/ruleset/src/functions/use-date-based-format.js index d24c851da..4909597cc 100644 --- a/packages/ruleset/src/functions/use-date-based-format.js +++ b/packages/ruleset/src/functions/use-date-based-format.js @@ -23,7 +23,7 @@ import { isRequestBodySchema, isResponseSchema, isSchemaProperty, -} from '../utils'; +} from '../utils/index.js'; let ruleId; let logger; diff --git a/packages/ruleset/src/functions/valid-path-segments.js b/packages/ruleset/src/functions/valid-path-segments.js index 430d87fa7..0673f1f5f 100644 --- a/packages/ruleset/src/functions/valid-path-segments.js +++ b/packages/ruleset/src/functions/valid-path-segments.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -import { LoggerFactory } from '../utils'; +import { LoggerFactory } from '../utils/index.js'; let ruleId; let logger; diff --git a/packages/ruleset/src/functions/valid-schema-example.js b/packages/ruleset/src/functions/valid-schema-example.js index fd2d7c57b..f2aa0c65a 100644 --- a/packages/ruleset/src/functions/valid-schema-example.js +++ b/packages/ruleset/src/functions/valid-schema-example.js @@ -5,7 +5,7 @@ import { validate } from 'jsonschema'; import { validateSubschemas } from '@ibm-cloud/openapi-ruleset-utilities'; -import { nestedSchemaKeys, LoggerFactory } from '../utils'; +import { nestedSchemaKeys, LoggerFactory } from '../utils/index.js'; let ruleId; let logger; diff --git a/packages/ruleset/src/functions/well-defined-dictionaries.js b/packages/ruleset/src/functions/well-defined-dictionaries.js index 56b0c505d..64a9b0a98 100644 --- a/packages/ruleset/src/functions/well-defined-dictionaries.js +++ b/packages/ruleset/src/functions/well-defined-dictionaries.js @@ -9,7 +9,7 @@ import { schemaHasConstraint, validateNestedSchemas, } from '@ibm-cloud/openapi-ruleset-utilities'; -import { LoggerFactory } from '../utils'; +import { LoggerFactory } from '../utils/index.js'; let ruleId; let logger; diff --git a/packages/ruleset/src/ibm-oas.js b/packages/ruleset/src/ibm-oas.js index 7063228fd..cb5cc22ae 100644 --- a/packages/ruleset/src/ibm-oas.js +++ b/packages/ruleset/src/ibm-oas.js @@ -4,7 +4,7 @@ */ import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; +const { oas3 } = spectralFormats; import { oas } from '@stoplight/spectral-rulesets'; import { typedEnum, diff --git a/packages/ruleset/src/rules/accept-and-return-models.js b/packages/ruleset/src/rules/accept-and-return-models.js index c2d432685..a08814e76 100644 --- a/packages/ruleset/src/rules/accept-and-return-models.js +++ b/packages/ruleset/src/rules/accept-and-return-models.js @@ -8,7 +8,7 @@ import { requestBodySchemas, } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; +const { oas3 } = spectralFormats; import acceptAndReturnModels from '../functions/accept-and-return-models.js'; export const description = diff --git a/packages/ruleset/src/rules/accept-header.js b/packages/ruleset/src/rules/accept-header.js index 871612e47..538be16dc 100644 --- a/packages/ruleset/src/rules/accept-header.js +++ b/packages/ruleset/src/rules/accept-header.js @@ -5,8 +5,8 @@ import { parameters } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; -import { disallowedHeaderParameter } from '../functions'; +const { oas3 } = spectralFormats; +import { disallowedHeaderParameter } from '../functions/index.js'; export const description = 'Operations should not explicitly define the Accept header parameter'; diff --git a/packages/ruleset/src/rules/anchored-patterns.js b/packages/ruleset/src/rules/anchored-patterns.js index c8365f831..7670e7531 100644 --- a/packages/ruleset/src/rules/anchored-patterns.js +++ b/packages/ruleset/src/rules/anchored-patterns.js @@ -5,8 +5,8 @@ import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; -import { anchoredPatterns } from '../functions'; +const { oas3 } = spectralFormats; +import { anchoredPatterns } from '../functions/index.js'; export const description = 'Pattern attributes should be anchored with ^ and $'; export const message = '{{error}}'; diff --git a/packages/ruleset/src/rules/api-symmetry.js b/packages/ruleset/src/rules/api-symmetry.js index 7c78c6724..146ab4864 100644 --- a/packages/ruleset/src/rules/api-symmetry.js +++ b/packages/ruleset/src/rules/api-symmetry.js @@ -4,8 +4,8 @@ */ import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; -import { apiSymmetry } from '../functions'; +const { oas3 } = spectralFormats; +import { apiSymmetry } from '../functions/index.js'; export const description = 'Variations of a resource schema should be graph fragments of the canonical schema'; diff --git a/packages/ruleset/src/rules/array-attributes.js b/packages/ruleset/src/rules/array-attributes.js index 4f9a8b549..986b8f04b 100644 --- a/packages/ruleset/src/rules/array-attributes.js +++ b/packages/ruleset/src/rules/array-attributes.js @@ -5,8 +5,8 @@ import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; -import { arrayAttributes } from '../functions'; +const { oas3 } = spectralFormats; +import { arrayAttributes } from '../functions/index.js'; export const description = 'Array schemas should have certain attributes defined'; diff --git a/packages/ruleset/src/rules/array-of-arrays.js b/packages/ruleset/src/rules/array-of-arrays.js index 12234494f..172b3dd51 100644 --- a/packages/ruleset/src/rules/array-of-arrays.js +++ b/packages/ruleset/src/rules/array-of-arrays.js @@ -5,8 +5,8 @@ import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; -import { arrayOfArrays } from '../functions'; +const { oas3 } = spectralFormats; +import { arrayOfArrays } from '../functions/index.js'; export const description = 'Array schema with items of type array should be avoided'; diff --git a/packages/ruleset/src/rules/array-responses.js b/packages/ruleset/src/rules/array-responses.js index 7882128f2..5173cb02a 100644 --- a/packages/ruleset/src/rules/array-responses.js +++ b/packages/ruleset/src/rules/array-responses.js @@ -5,8 +5,8 @@ import { operations } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; -import { arrayResponses } from '../functions'; +const { oas3 } = spectralFormats; +import { arrayResponses } from '../functions/index.js'; export const description = 'Operations should not return an array as the top-level structure of a response.'; diff --git a/packages/ruleset/src/rules/authorization-header.js b/packages/ruleset/src/rules/authorization-header.js index 291034532..c0ae52742 100644 --- a/packages/ruleset/src/rules/authorization-header.js +++ b/packages/ruleset/src/rules/authorization-header.js @@ -5,8 +5,8 @@ import { parameters } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; -import { disallowedHeaderParameter } from '../functions'; +const { oas3 } = spectralFormats; +import { disallowedHeaderParameter } from '../functions/index.js'; export const description = 'Operations should not explicitly define the Authorization header parameter'; diff --git a/packages/ruleset/src/rules/avoid-multiple-types.js b/packages/ruleset/src/rules/avoid-multiple-types.js index e8a6bba97..0aff1bcac 100644 --- a/packages/ruleset/src/rules/avoid-multiple-types.js +++ b/packages/ruleset/src/rules/avoid-multiple-types.js @@ -3,9 +3,10 @@ * SPDX-License-Identifier: Apache2.0 */ -import { oas3_1 } from '@stoplight/spectral-formats'; -import { avoidMultipleTypes } from '../functions'; +import { avoidMultipleTypes } from '../functions/index.js'; import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; +import spectralFormats from '@stoplight/spectral-formats' +const { oas3_1 } = spectralFormats; export const description = 'OpenAPI 3.1 documents should avoid multiple types in the schema "type" field.'; diff --git a/packages/ruleset/src/rules/binary-schemas.js b/packages/ruleset/src/rules/binary-schemas.js index a31f23025..5faccbb0a 100644 --- a/packages/ruleset/src/rules/binary-schemas.js +++ b/packages/ruleset/src/rules/binary-schemas.js @@ -5,8 +5,8 @@ import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; -import { binarySchemas } from '../functions'; +const { oas3 } = spectralFormats; +import { binarySchemas } from '../functions/index.js'; // 1. Parameters should not contain binary (type: string, format: binary) values. // 2. JSON request bodies should not contain binary (type: string, format: binary) values. diff --git a/packages/ruleset/src/rules/circular-refs.js b/packages/ruleset/src/rules/circular-refs.js index 38eb99efe..26a54031d 100644 --- a/packages/ruleset/src/rules/circular-refs.js +++ b/packages/ruleset/src/rules/circular-refs.js @@ -4,8 +4,8 @@ */ import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; -import { circularRefs } from '../functions'; +const { oas3 } = spectralFormats; +import { circularRefs } from '../functions/index.js'; export const description = 'API definition should not contain circular references.'; diff --git a/packages/ruleset/src/rules/collection-array-property.js b/packages/ruleset/src/rules/collection-array-property.js index 32737ea95..0f6b57cca 100644 --- a/packages/ruleset/src/rules/collection-array-property.js +++ b/packages/ruleset/src/rules/collection-array-property.js @@ -4,8 +4,8 @@ */ import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; -import { collectionArrayProperty } from '../functions'; +const { oas3 } = spectralFormats; +import { collectionArrayProperty } from '../functions/index.js'; export const description = 'Collection list operation response schema should define array property whose name matches the final path segment of the operation path'; diff --git a/packages/ruleset/src/rules/consecutive-path-segments.js b/packages/ruleset/src/rules/consecutive-path-segments.js index d92b65a2e..88f22f0b0 100644 --- a/packages/ruleset/src/rules/consecutive-path-segments.js +++ b/packages/ruleset/src/rules/consecutive-path-segments.js @@ -5,8 +5,8 @@ import { paths } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; -import { consecutivePathSegments } from '../functions'; +const { oas3 } = spectralFormats; +import { consecutivePathSegments } from '../functions/index.js'; export const description = 'Path strings should not contain two or more consecutive path parameter references'; diff --git a/packages/ruleset/src/rules/content-contains-schema.js b/packages/ruleset/src/rules/content-contains-schema.js index ba88a8edb..96af59237 100644 --- a/packages/ruleset/src/rules/content-contains-schema.js +++ b/packages/ruleset/src/rules/content-contains-schema.js @@ -4,7 +4,7 @@ */ import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; +const { oas3 } = spectralFormats; import { truthy } from '@stoplight/spectral-functions'; export const description = 'Content entries must specify a schema'; diff --git a/packages/ruleset/src/rules/content-type-header.js b/packages/ruleset/src/rules/content-type-header.js index 9580bd01a..a4f21732b 100644 --- a/packages/ruleset/src/rules/content-type-header.js +++ b/packages/ruleset/src/rules/content-type-header.js @@ -5,8 +5,8 @@ import { parameters } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; -import { disallowedHeaderParameter } from '../functions'; +const { oas3 } = spectralFormats; +import { disallowedHeaderParameter } from '../functions/index.js'; export const description = 'Operations should not explicitly define the Content-Type header parameter'; diff --git a/packages/ruleset/src/rules/content-type-is-specific.js b/packages/ruleset/src/rules/content-type-is-specific.js index cb5f7fa08..80e646a8d 100644 --- a/packages/ruleset/src/rules/content-type-is-specific.js +++ b/packages/ruleset/src/rules/content-type-is-specific.js @@ -4,7 +4,7 @@ */ import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; +const { oas3 } = spectralFormats; import { falsy } from '@stoplight/spectral-functions'; export const description = diff --git a/packages/ruleset/src/rules/delete-body.js b/packages/ruleset/src/rules/delete-body.js index b4e02328e..909aa72c4 100644 --- a/packages/ruleset/src/rules/delete-body.js +++ b/packages/ruleset/src/rules/delete-body.js @@ -5,8 +5,8 @@ import { operations } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; -import { deleteBody } from '../functions'; +const { oas3 } = spectralFormats; +import { deleteBody } from '../functions/index.js'; export const description = 'Delete operations should not contain a requestBody.'; diff --git a/packages/ruleset/src/rules/discriminator-property-exists.js b/packages/ruleset/src/rules/discriminator-property-exists.js index e01a2e726..3550d2def 100644 --- a/packages/ruleset/src/rules/discriminator-property-exists.js +++ b/packages/ruleset/src/rules/discriminator-property-exists.js @@ -5,8 +5,8 @@ import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; -import { discriminatorPropertyExists } from '../functions'; +const { oas3 } = spectralFormats; +import { discriminatorPropertyExists } from '../functions/index.js'; export const description = 'The discriminator property name must be defined in this schema'; diff --git a/packages/ruleset/src/rules/duplicate-path-parameter.js b/packages/ruleset/src/rules/duplicate-path-parameter.js index 807dffae5..dcd51fd40 100644 --- a/packages/ruleset/src/rules/duplicate-path-parameter.js +++ b/packages/ruleset/src/rules/duplicate-path-parameter.js @@ -5,8 +5,8 @@ import { paths } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; -import { duplicatePathParameter } from '../functions'; +const { oas3 } = spectralFormats; +import { duplicatePathParameter } from '../functions/index.js'; export const description = 'Common path parameters should be defined on the path object.'; diff --git a/packages/ruleset/src/rules/enum-casing-convention.js b/packages/ruleset/src/rules/enum-casing-convention.js index e1bfaa365..ed603117f 100644 --- a/packages/ruleset/src/rules/enum-casing-convention.js +++ b/packages/ruleset/src/rules/enum-casing-convention.js @@ -5,8 +5,8 @@ import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; -import { enumCasingConvention } from '../functions'; +const { oas3 } = spectralFormats; +import { enumCasingConvention } from '../functions/index.js'; export const description = 'Enum values must follow a specified case convention'; diff --git a/packages/ruleset/src/rules/error-content-type-is-json.js b/packages/ruleset/src/rules/error-content-type-is-json.js index 91952ec5e..2329b8953 100644 --- a/packages/ruleset/src/rules/error-content-type-is-json.js +++ b/packages/ruleset/src/rules/error-content-type-is-json.js @@ -4,7 +4,7 @@ */ import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; +const { oas3 } = spectralFormats; import { truthy } from '@stoplight/spectral-functions'; export const description = 'error response should support application/json'; diff --git a/packages/ruleset/src/rules/error-response-schemas.js b/packages/ruleset/src/rules/error-response-schemas.js index 4af9cdc6e..e287fc93a 100644 --- a/packages/ruleset/src/rules/error-response-schemas.js +++ b/packages/ruleset/src/rules/error-response-schemas.js @@ -4,8 +4,8 @@ */ import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; -import { errorResponseSchemas } from '../functions'; +const { oas3 } = spectralFormats; +import { errorResponseSchemas } from '../functions/index.js'; export const description = 'Error response schemas should comply with API Handbook guidance'; diff --git a/packages/ruleset/src/rules/etag-header-exists.js b/packages/ruleset/src/rules/etag-header-exists.js index d70e4b3e9..9993b1a63 100644 --- a/packages/ruleset/src/rules/etag-header-exists.js +++ b/packages/ruleset/src/rules/etag-header-exists.js @@ -5,8 +5,8 @@ import { paths } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; -import { etagHeaderExists } from '../functions'; +const { oas3 } = spectralFormats; +import { etagHeaderExists } from '../functions/index.js'; export const description = 'ETag response header should be defined in GET operation for resources that support If-Match or If-None-Match header parameters'; diff --git a/packages/ruleset/src/rules/examples-name-contains-space.js b/packages/ruleset/src/rules/examples-name-contains-space.js index d826cefe1..330d60ac0 100644 --- a/packages/ruleset/src/rules/examples-name-contains-space.js +++ b/packages/ruleset/src/rules/examples-name-contains-space.js @@ -5,7 +5,7 @@ import { pattern } from '@stoplight/spectral-functions'; import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; +const { oas3 } = spectralFormats; export const description = 'Examples name should not contain space'; export const message = '{{description}}'; diff --git a/packages/ruleset/src/rules/ibm-sdk-operations.js b/packages/ruleset/src/rules/ibm-sdk-operations.js index 40480acbe..d4b90a97a 100644 --- a/packages/ruleset/src/rules/ibm-sdk-operations.js +++ b/packages/ruleset/src/rules/ibm-sdk-operations.js @@ -4,7 +4,7 @@ */ import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; +const { oas3 } = spectralFormats; import { schema } from '@stoplight/spectral-functions'; export const description = diff --git a/packages/ruleset/src/rules/if-modified-since-header.js b/packages/ruleset/src/rules/if-modified-since-header.js index c0d42e414..ae9bd5f5e 100644 --- a/packages/ruleset/src/rules/if-modified-since-header.js +++ b/packages/ruleset/src/rules/if-modified-since-header.js @@ -5,8 +5,8 @@ import { parameters } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; -import { disallowedHeaderParameter } from '../functions'; +const { oas3 } = spectralFormats; +import { disallowedHeaderParameter } from '../functions/index.js'; export const description = 'Operations should support the If-None-Match header parameter instead of If-Modified-Since'; diff --git a/packages/ruleset/src/rules/if-unmodified-since-header.js b/packages/ruleset/src/rules/if-unmodified-since-header.js index 8bd5c7349..6997c8c55 100644 --- a/packages/ruleset/src/rules/if-unmodified-since-header.js +++ b/packages/ruleset/src/rules/if-unmodified-since-header.js @@ -5,8 +5,8 @@ import { parameters } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; -import { disallowedHeaderParameter } from '../functions'; +const { oas3 } = spectralFormats; +import { disallowedHeaderParameter } from '../functions/index.js'; export const description = 'Operations should support the If-Match header parameter instead of If-Unmodified-Since'; diff --git a/packages/ruleset/src/rules/inline-schemas.js b/packages/ruleset/src/rules/inline-schemas.js index 218729a54..f53cd699f 100644 --- a/packages/ruleset/src/rules/inline-schemas.js +++ b/packages/ruleset/src/rules/inline-schemas.js @@ -5,8 +5,8 @@ import { unresolvedSchemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; -import { inlineSchemas } from '../functions'; +const { oas3 } = spectralFormats; +import { inlineSchemas } from '../functions/index.js'; export const description = 'Nested objects should be defined as a $ref to a named schema'; diff --git a/packages/ruleset/src/rules/integer-attributes.js b/packages/ruleset/src/rules/integer-attributes.js index 63e41c939..960e294b3 100644 --- a/packages/ruleset/src/rules/integer-attributes.js +++ b/packages/ruleset/src/rules/integer-attributes.js @@ -5,8 +5,8 @@ import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; -import { integerAttributes } from '../functions'; +const { oas3 } = spectralFormats; +import { integerAttributes } from '../functions/index.js'; export const description = 'Integer schemas should have certain attributes defined'; diff --git a/packages/ruleset/src/rules/major-version-in-path.js b/packages/ruleset/src/rules/major-version-in-path.js index 5ec887671..708a1714f 100644 --- a/packages/ruleset/src/rules/major-version-in-path.js +++ b/packages/ruleset/src/rules/major-version-in-path.js @@ -4,8 +4,8 @@ */ import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; -import { majorVersionInPath } from '../functions'; +const { oas3 } = spectralFormats; +import { majorVersionInPath } from '../functions/index.js'; export const description = 'All paths must contain the API major version as a distinct path segment'; diff --git a/packages/ruleset/src/rules/merge-patch-properties.js b/packages/ruleset/src/rules/merge-patch-properties.js index b8f9e1021..1cc413fe3 100644 --- a/packages/ruleset/src/rules/merge-patch-properties.js +++ b/packages/ruleset/src/rules/merge-patch-properties.js @@ -4,8 +4,8 @@ */ import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; -import { mergePatchProperties } from '../functions'; +const { oas3 } = spectralFormats; +import { mergePatchProperties } from '../functions/index.js'; export const description = 'A JSON merge-patch requestBody should have no required properties'; diff --git a/packages/ruleset/src/rules/no-ambiguous-paths.js b/packages/ruleset/src/rules/no-ambiguous-paths.js index 72982faca..b64160b79 100644 --- a/packages/ruleset/src/rules/no-ambiguous-paths.js +++ b/packages/ruleset/src/rules/no-ambiguous-paths.js @@ -4,8 +4,8 @@ */ import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; -import { noAmbiguousPaths } from '../functions'; +const { oas3 } = spectralFormats; +import { noAmbiguousPaths } from '../functions/index.js'; export const description = 'Avoid ambiguous path strings within an OpenAPI document'; diff --git a/packages/ruleset/src/rules/no-nullable-properties.js b/packages/ruleset/src/rules/no-nullable-properties.js index 61bd8176a..d2bdbfbbc 100644 --- a/packages/ruleset/src/rules/no-nullable-properties.js +++ b/packages/ruleset/src/rules/no-nullable-properties.js @@ -4,9 +4,9 @@ */ import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; +const { oas3 } = spectralFormats; import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; -import { noNullableProperties } from '../functions'; +import { noNullableProperties } from '../functions/index.js'; export const description = 'Nullable properties should exist only in JSON merge-patch request bodies'; diff --git a/packages/ruleset/src/rules/no-operation-requestbody.js b/packages/ruleset/src/rules/no-operation-requestbody.js index 1d72d0517..ae4d5cf8d 100644 --- a/packages/ruleset/src/rules/no-operation-requestbody.js +++ b/packages/ruleset/src/rules/no-operation-requestbody.js @@ -5,8 +5,8 @@ import { operations } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; -import { noOperationRequestBody } from '../functions'; +const { oas3 } = spectralFormats; +import { noOperationRequestBody } from '../functions/index.js'; export const description = 'Certain operations should not contain a requestBody'; diff --git a/packages/ruleset/src/rules/no-ref-in-example.js b/packages/ruleset/src/rules/no-ref-in-example.js index af5bfb4e1..0346ce844 100644 --- a/packages/ruleset/src/rules/no-ref-in-example.js +++ b/packages/ruleset/src/rules/no-ref-in-example.js @@ -4,8 +4,8 @@ */ import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; -import { noRefInExample } from '../functions'; +const { oas3 } = spectralFormats; +import { noRefInExample } from '../functions/index.js'; export const description = 'The use of $ref is not valid within an example field'; export const message = '{{description}}'; diff --git a/packages/ruleset/src/rules/no-superfluous-allof.js b/packages/ruleset/src/rules/no-superfluous-allof.js index 774d18f80..0d37d0e8e 100644 --- a/packages/ruleset/src/rules/no-superfluous-allof.js +++ b/packages/ruleset/src/rules/no-superfluous-allof.js @@ -5,8 +5,8 @@ import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; -import { noSuperfluousAllOf } from '../functions'; +const { oas3 } = spectralFormats; +import { noSuperfluousAllOf } from '../functions/index.js'; export const description = 'Avoid schemas containing only a single-element allOf'; diff --git a/packages/ruleset/src/rules/no-unsupported-keywords.js b/packages/ruleset/src/rules/no-unsupported-keywords.js index 56f9ac312..436ea77ae 100644 --- a/packages/ruleset/src/rules/no-unsupported-keywords.js +++ b/packages/ruleset/src/rules/no-unsupported-keywords.js @@ -3,8 +3,9 @@ * SPDX-License-Identifier: Apache2.0 */ -import { oas3_1 } from '@stoplight/spectral-formats'; -import { noUnsupportedKeywords } from '../functions'; +import { noUnsupportedKeywords } from '../functions/index.js'; +import spectralFormats from '@stoplight/spectral-formats' +const { oas3_1 } = spectralFormats; export const description = 'Verifies that unsupported OpenAPI 3.1 keywords are not used in the API document.'; diff --git a/packages/ruleset/src/rules/operation-responses.js b/packages/ruleset/src/rules/operation-responses.js index b10b39855..9c52f72f8 100644 --- a/packages/ruleset/src/rules/operation-responses.js +++ b/packages/ruleset/src/rules/operation-responses.js @@ -4,8 +4,9 @@ */ import { operations } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; -import { oas3_1 } from '@stoplight/spectral-formats'; import { truthy } from '@stoplight/spectral-functions'; +import spectralFormats from '@stoplight/spectral-formats' +const { oas3_1 } = spectralFormats; export const description = 'Verifies that each operation has a "responses" field'; diff --git a/packages/ruleset/src/rules/operation-summary-exists.js b/packages/ruleset/src/rules/operation-summary-exists.js index a48ac7653..58bed63ae 100644 --- a/packages/ruleset/src/rules/operation-summary-exists.js +++ b/packages/ruleset/src/rules/operation-summary-exists.js @@ -5,8 +5,8 @@ import { operations } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; -import { operationSummaryExists } from '../functions'; +const { oas3 } = spectralFormats; +import { operationSummaryExists } from '../functions/index.js'; export const description = 'Operations must have a non-empty summary'; export const given = operations; diff --git a/packages/ruleset/src/rules/operation-summary-length.js b/packages/ruleset/src/rules/operation-summary-length.js index 96145229f..0bc78bc22 100644 --- a/packages/ruleset/src/rules/operation-summary-length.js +++ b/packages/ruleset/src/rules/operation-summary-length.js @@ -5,8 +5,8 @@ import { operations } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; -import { operationSummaryLength } from '../functions'; +const { oas3 } = spectralFormats; +import { operationSummaryLength } from '../functions/index.js'; export const description = 'Operation summaries must be 80 characters or less in length'; diff --git a/packages/ruleset/src/rules/operationid-casing-convention.js b/packages/ruleset/src/rules/operationid-casing-convention.js index bb4899620..3a899daa3 100644 --- a/packages/ruleset/src/rules/operationid-casing-convention.js +++ b/packages/ruleset/src/rules/operationid-casing-convention.js @@ -5,8 +5,8 @@ import { operations } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; -import { operationIdCasingConvention } from '../functions'; +const { oas3 } = spectralFormats; +import { operationIdCasingConvention } from '../functions/index.js'; export const description = 'Operation ids must follow a specified case convention'; diff --git a/packages/ruleset/src/rules/operationid-naming-convention.js b/packages/ruleset/src/rules/operationid-naming-convention.js index c215e6163..f5f071602 100644 --- a/packages/ruleset/src/rules/operationid-naming-convention.js +++ b/packages/ruleset/src/rules/operationid-naming-convention.js @@ -3,8 +3,9 @@ * SPDX-License-Identifier: Apache2.0 */ -import { oas2, oas3 } from '@stoplight/spectral-formats'; -import { operationIdNamingConvention } from '../functions'; +import { operationIdNamingConvention } from '../functions/index.js'; +import spectralFormats from '@stoplight/spectral-formats' +const { oas2, oas3 } = spectralFormats; export const description = 'Operation ids should follow naming convention'; export const message = '{{error}}'; diff --git a/packages/ruleset/src/rules/optional-request-body-deprecated.js b/packages/ruleset/src/rules/optional-request-body-deprecated.js index 324edb059..1732c3285 100644 --- a/packages/ruleset/src/rules/optional-request-body-deprecated.js +++ b/packages/ruleset/src/rules/optional-request-body-deprecated.js @@ -4,8 +4,8 @@ */ import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; -import { optionalRequestBodyDeprecated } from '../functions'; +const { oas3 } = spectralFormats; +import { optionalRequestBodyDeprecated } from '../functions/index.js'; export const description = 'An optional requestBody with required properties should probably be required'; diff --git a/packages/ruleset/src/rules/optional-request-body.js b/packages/ruleset/src/rules/optional-request-body.js index 5ddab4d01..3361439aa 100644 --- a/packages/ruleset/src/rules/optional-request-body.js +++ b/packages/ruleset/src/rules/optional-request-body.js @@ -4,8 +4,8 @@ */ import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; -import { optionalRequestBody } from '../functions'; +const { oas3 } = spectralFormats; +import { optionalRequestBody } from '../functions/index.js'; export const description = 'An optional requestBody with required properties should probably be required'; diff --git a/packages/ruleset/src/rules/pagination-style.js b/packages/ruleset/src/rules/pagination-style.js index a522cda4a..802eff9a5 100644 --- a/packages/ruleset/src/rules/pagination-style.js +++ b/packages/ruleset/src/rules/pagination-style.js @@ -5,8 +5,8 @@ import { paths } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; -import { paginationStyle } from '../functions'; +const { oas3 } = spectralFormats; +import { paginationStyle } from '../functions/index.js'; export const description = 'List operations should have correct pagination style'; diff --git a/packages/ruleset/src/rules/parameter-casing-convention.js b/packages/ruleset/src/rules/parameter-casing-convention.js index 66c28406b..05a2dfca6 100644 --- a/packages/ruleset/src/rules/parameter-casing-convention.js +++ b/packages/ruleset/src/rules/parameter-casing-convention.js @@ -5,8 +5,8 @@ import { parameters } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; -import { parameterCasingConvention } from '../functions'; +const { oas3 } = spectralFormats; +import { parameterCasingConvention } from '../functions/index.js'; export const description = 'Parameter names must follow case conventions'; export const message = '{{error}}'; diff --git a/packages/ruleset/src/rules/parameter-default.js b/packages/ruleset/src/rules/parameter-default.js index b42b80e34..743fbf72f 100644 --- a/packages/ruleset/src/rules/parameter-default.js +++ b/packages/ruleset/src/rules/parameter-default.js @@ -4,8 +4,9 @@ */ import { parameters } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; -import { oas2, oas3 } from '@stoplight/spectral-formats'; -import { parameterDefault } from '../functions'; +import { parameterDefault } from '../functions/index.js'; +import spectralFormats from '@stoplight/spectral-formats' +const { oas2, oas3 } = spectralFormats; export const description = 'Required parameters should not define a default value'; diff --git a/packages/ruleset/src/rules/parameter-description-exists.js b/packages/ruleset/src/rules/parameter-description-exists.js index bcc4c6046..9c6f22e4f 100644 --- a/packages/ruleset/src/rules/parameter-description-exists.js +++ b/packages/ruleset/src/rules/parameter-description-exists.js @@ -5,8 +5,8 @@ import { parameters } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; -import { parameterDescriptionExists } from '../functions'; +const { oas3 } = spectralFormats; +import { parameterDescriptionExists } from '../functions/index.js'; export const description = 'Parameters should have a non-empty description'; export const message = '{{error}}'; diff --git a/packages/ruleset/src/rules/parameter-order.js b/packages/ruleset/src/rules/parameter-order.js index ef89cf505..4031bc69d 100644 --- a/packages/ruleset/src/rules/parameter-order.js +++ b/packages/ruleset/src/rules/parameter-order.js @@ -5,8 +5,8 @@ import { operations } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; -import { parameterOrder } from '../functions'; +const { oas3 } = spectralFormats; +import { parameterOrder } from '../functions/index.js'; export const description = 'All required operation parameters should be listed before any optional parameters.'; diff --git a/packages/ruleset/src/rules/parameter-schema-or-content-exists.js b/packages/ruleset/src/rules/parameter-schema-or-content-exists.js index 34e450a24..7d6b6b442 100644 --- a/packages/ruleset/src/rules/parameter-schema-or-content-exists.js +++ b/packages/ruleset/src/rules/parameter-schema-or-content-exists.js @@ -4,8 +4,8 @@ */ import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; -import { schemaOrContentProvided } from '../functions'; +const { oas3 } = spectralFormats; +import { schemaOrContentProvided } from '../functions/index.js'; export const description = 'Parameter must provide either a schema or content'; export const message = '{{error}}'; diff --git a/packages/ruleset/src/rules/patch-request-content-type.js b/packages/ruleset/src/rules/patch-request-content-type.js index 44ebd053d..fc38ee351 100644 --- a/packages/ruleset/src/rules/patch-request-content-type.js +++ b/packages/ruleset/src/rules/patch-request-content-type.js @@ -5,8 +5,8 @@ import { patchOperations } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; -import { patchRequestContentType } from '../functions'; +const { oas3 } = spectralFormats; +import { patchRequestContentType } from '../functions/index.js'; export const description = 'PATCH operations should support content types application/json-patch+json or application/merge-patch+json'; diff --git a/packages/ruleset/src/rules/path-parameter-not-crn.js b/packages/ruleset/src/rules/path-parameter-not-crn.js index aee085bce..46142aa1f 100644 --- a/packages/ruleset/src/rules/path-parameter-not-crn.js +++ b/packages/ruleset/src/rules/path-parameter-not-crn.js @@ -4,8 +4,8 @@ */ import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; -import { pathParameterNotCRN } from '../functions'; +const { oas3 } = spectralFormats; +import { pathParameterNotCRN } from '../functions/index.js'; export const description = 'Path parameters should not be defined as a CRN (Cloud Resource Name) value'; diff --git a/packages/ruleset/src/rules/path-segment-casing-convention.js b/packages/ruleset/src/rules/path-segment-casing-convention.js index c0f2a30a9..3ccf8448b 100644 --- a/packages/ruleset/src/rules/path-segment-casing-convention.js +++ b/packages/ruleset/src/rules/path-segment-casing-convention.js @@ -5,8 +5,8 @@ import { paths } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; -import { pathSegmentCasingConvention } from '../functions'; +const { oas3 } = spectralFormats; +import { pathSegmentCasingConvention } from '../functions/index.js'; export const description = 'Path segments must follow a specified case convention'; diff --git a/packages/ruleset/src/rules/pattern-properties.js b/packages/ruleset/src/rules/pattern-properties.js index 51feb599e..2ea05c119 100644 --- a/packages/ruleset/src/rules/pattern-properties.js +++ b/packages/ruleset/src/rules/pattern-properties.js @@ -3,9 +3,10 @@ * SPDX-License-Identifier: Apache2.0 */ -import { oas3_1 } from '@stoplight/spectral-formats'; -import { patternPropertiesCheck } from '../functions'; +import { patternPropertiesCheck } from '../functions/index.js'; import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; +import spectralFormats from '@stoplight/spectral-formats' +const { oas3_1 } = spectralFormats; export const description = 'Enforces certain restrictions on the use of "patternProperties" within a schema.'; diff --git a/packages/ruleset/src/rules/precondition-header.js b/packages/ruleset/src/rules/precondition-header.js index 78f58339d..96d0535d5 100644 --- a/packages/ruleset/src/rules/precondition-header.js +++ b/packages/ruleset/src/rules/precondition-header.js @@ -5,8 +5,8 @@ import { operations } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; -import { preconditionHeader } from '../functions'; +const { oas3 } = spectralFormats; +import { preconditionHeader } from '../functions/index.js'; export const description = 'Operations with `412` response must support at least one conditional header.'; diff --git a/packages/ruleset/src/rules/prefer-token-pagination.js b/packages/ruleset/src/rules/prefer-token-pagination.js index 6cac9b6ce..98c81218a 100644 --- a/packages/ruleset/src/rules/prefer-token-pagination.js +++ b/packages/ruleset/src/rules/prefer-token-pagination.js @@ -5,8 +5,8 @@ import { paths } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; -import { preferTokenPagination } from '../functions'; +const { oas3 } = spectralFormats; +import { preferTokenPagination } from '../functions/index.js'; export const description = 'Paginated list operations should use token-based pagination, rather than offset/limit pagination.'; diff --git a/packages/ruleset/src/rules/property-attributes.js b/packages/ruleset/src/rules/property-attributes.js index 20d5a0c61..72772a673 100644 --- a/packages/ruleset/src/rules/property-attributes.js +++ b/packages/ruleset/src/rules/property-attributes.js @@ -5,8 +5,8 @@ import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; -import { propertyAttributes } from '../functions'; +const { oas3 } = spectralFormats; +import { propertyAttributes } from '../functions/index.js'; export const description = 'Performs checks on specific attributes of a schema or schema property'; diff --git a/packages/ruleset/src/rules/property-casing-convention.js b/packages/ruleset/src/rules/property-casing-convention.js index db34f1b6a..e27741928 100644 --- a/packages/ruleset/src/rules/property-casing-convention.js +++ b/packages/ruleset/src/rules/property-casing-convention.js @@ -5,8 +5,8 @@ import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; -import { propertyCasingConvention } from '../functions'; +const { oas3 } = spectralFormats; +import { propertyCasingConvention } from '../functions/index.js'; export const description = 'Property names must follow a specified case convention'; diff --git a/packages/ruleset/src/rules/property-consistent-name-and-type.js b/packages/ruleset/src/rules/property-consistent-name-and-type.js index 3a21a74bd..55a636742 100644 --- a/packages/ruleset/src/rules/property-consistent-name-and-type.js +++ b/packages/ruleset/src/rules/property-consistent-name-and-type.js @@ -5,8 +5,8 @@ import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; -import { propertyConsistentNameAndType } from '../functions'; +const { oas3 } = spectralFormats; +import { propertyConsistentNameAndType } from '../functions/index.js'; export const description = 'Schema properties that have the same name should also have the same types.'; diff --git a/packages/ruleset/src/rules/property-description-exists.js b/packages/ruleset/src/rules/property-description-exists.js index 555eee006..561fb4f1b 100644 --- a/packages/ruleset/src/rules/property-description-exists.js +++ b/packages/ruleset/src/rules/property-description-exists.js @@ -5,8 +5,8 @@ import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; -import { propertyDescriptionExists } from '../functions'; +const { oas3 } = spectralFormats; +import { propertyDescriptionExists } from '../functions/index.js'; export const description = 'Schema properties should have a non-empty description'; diff --git a/packages/ruleset/src/rules/property-name-collision.js b/packages/ruleset/src/rules/property-name-collision.js index 9af016ee1..959fda0f8 100644 --- a/packages/ruleset/src/rules/property-name-collision.js +++ b/packages/ruleset/src/rules/property-name-collision.js @@ -5,8 +5,8 @@ import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; -import { propertyNameCollision } from '../functions'; +const { oas3 } = spectralFormats; +import { propertyNameCollision } from '../functions/index.js'; export const description = 'Avoid duplicate property names within a schema, even if they differ by case convention'; diff --git a/packages/ruleset/src/rules/redirect-response-body.js b/packages/ruleset/src/rules/redirect-response-body.js index 12ffee699..7eaf5470a 100644 --- a/packages/ruleset/src/rules/redirect-response-body.js +++ b/packages/ruleset/src/rules/redirect-response-body.js @@ -5,8 +5,8 @@ import { operations } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; -import { redirectResponseBody } from '../functions'; +const { oas3 } = spectralFormats; +import { redirectResponseBody } from '../functions/index.js'; export const description = 'Performs multiple checks on the response body based on status codes'; diff --git a/packages/ruleset/src/rules/ref-pattern.js b/packages/ruleset/src/rules/ref-pattern.js index be570a15d..8778205f8 100644 --- a/packages/ruleset/src/rules/ref-pattern.js +++ b/packages/ruleset/src/rules/ref-pattern.js @@ -4,8 +4,8 @@ */ import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; -import { refPattern } from '../functions'; +const { oas3 } = spectralFormats; +import { refPattern } from '../functions/index.js'; export const description = '$refs must follow the correct pattern.'; export const message = '{{error}}'; diff --git a/packages/ruleset/src/rules/ref-sibling-duplicate-description.js b/packages/ruleset/src/rules/ref-sibling-duplicate-description.js index 2bed5f215..ea39d8f2f 100644 --- a/packages/ruleset/src/rules/ref-sibling-duplicate-description.js +++ b/packages/ruleset/src/rules/ref-sibling-duplicate-description.js @@ -5,8 +5,8 @@ import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; -import { refSiblingDuplicateDescription } from '../functions'; +const { oas3 } = spectralFormats; +import { refSiblingDuplicateDescription } from '../functions/index.js'; export const description = 'Schemas and schema properties should avoid duplicate descriptions within allOf $ref siblings'; diff --git a/packages/ruleset/src/rules/request-and-response-content.js b/packages/ruleset/src/rules/request-and-response-content.js index 09728a6fb..334b35e45 100644 --- a/packages/ruleset/src/rules/request-and-response-content.js +++ b/packages/ruleset/src/rules/request-and-response-content.js @@ -5,8 +5,8 @@ import { operations } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; -import { requestAndResponseContent } from '../functions'; +const { oas3 } = spectralFormats; +import { requestAndResponseContent } from '../functions/index.js'; export const description = 'Request bodies and non-204 responses should define a content object'; diff --git a/packages/ruleset/src/rules/requestbody-name.js b/packages/ruleset/src/rules/requestbody-name.js index 1907a17eb..2c11ce5a5 100644 --- a/packages/ruleset/src/rules/requestbody-name.js +++ b/packages/ruleset/src/rules/requestbody-name.js @@ -5,8 +5,8 @@ import { operations } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; -import { requestBodyName } from '../functions'; +const { oas3 } = spectralFormats; +import { requestBodyName } from '../functions/index.js'; export const description = 'Verifies that operations have the x-codegen-request-body-name extension set when needed'; diff --git a/packages/ruleset/src/rules/required-array-properties-in-response.js b/packages/ruleset/src/rules/required-array-properties-in-response.js index 36b514908..225aa9d34 100644 --- a/packages/ruleset/src/rules/required-array-properties-in-response.js +++ b/packages/ruleset/src/rules/required-array-properties-in-response.js @@ -5,7 +5,7 @@ import { responseSchemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; -import { requiredArrayPropertiesInResponse } from '../functions'; +import { requiredArrayPropertiesInResponse } from '../functions/index.js'; export const description = 'Array properties defined in a response should be required.'; diff --git a/packages/ruleset/src/rules/required-enum-properties-in-response.js b/packages/ruleset/src/rules/required-enum-properties-in-response.js index d10bf2625..38e38c220 100644 --- a/packages/ruleset/src/rules/required-enum-properties-in-response.js +++ b/packages/ruleset/src/rules/required-enum-properties-in-response.js @@ -5,7 +5,7 @@ import { responseSchemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; -import { requiredEnumPropertiesInResponse } from '../functions'; +import { requiredEnumPropertiesInResponse } from '../functions/index.js'; export const description = 'Enumeration properties defined in a response must be required.'; diff --git a/packages/ruleset/src/rules/required-property-missing.js b/packages/ruleset/src/rules/required-property-missing.js index 36041ae09..e7208a7e4 100644 --- a/packages/ruleset/src/rules/required-property-missing.js +++ b/packages/ruleset/src/rules/required-property-missing.js @@ -5,8 +5,8 @@ import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; -import { requiredProperty } from '../functions'; +const { oas3 } = spectralFormats; +import { requiredProperty } from '../functions/index.js'; export const description = 'A required property is not in the schema'; export const message = '{{error}}'; diff --git a/packages/ruleset/src/rules/resource-response-consistency.js b/packages/ruleset/src/rules/resource-response-consistency.js index 3e29d6ada..ea146b1da 100644 --- a/packages/ruleset/src/rules/resource-response-consistency.js +++ b/packages/ruleset/src/rules/resource-response-consistency.js @@ -4,8 +4,8 @@ */ import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; -import { resourceResponseConsistency } from '../functions'; +const { oas3 } = spectralFormats; +import { resourceResponseConsistency } from '../functions/index.js'; export const description = 'Operations that create or update a resource should return the same schema as the "GET" request for the resource.'; diff --git a/packages/ruleset/src/rules/response-example-exists.js b/packages/ruleset/src/rules/response-example-exists.js index b63ae5537..226e0f7ce 100644 --- a/packages/ruleset/src/rules/response-example-exists.js +++ b/packages/ruleset/src/rules/response-example-exists.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -import { responseExampleExists } from '../functions'; +import { responseExampleExists } from '../functions/index.js'; export const description = 'Each response should include an example'; export const message = '{{error}}'; diff --git a/packages/ruleset/src/rules/response-status-codes.js b/packages/ruleset/src/rules/response-status-codes.js index 40e2409fc..abd945c87 100644 --- a/packages/ruleset/src/rules/response-status-codes.js +++ b/packages/ruleset/src/rules/response-status-codes.js @@ -5,8 +5,8 @@ import { operations } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; -import { responseStatusCodes } from '../functions'; +const { oas3 } = spectralFormats; +import { responseStatusCodes } from '../functions/index.js'; export const description = 'Performs multiple checks on the status codes used in operation responses'; diff --git a/packages/ruleset/src/rules/schema-casing-convention.js b/packages/ruleset/src/rules/schema-casing-convention.js index 92cd07918..e87c35369 100644 --- a/packages/ruleset/src/rules/schema-casing-convention.js +++ b/packages/ruleset/src/rules/schema-casing-convention.js @@ -4,8 +4,8 @@ */ import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; -import { schemaCasingConvention } from '../functions'; +const { oas3 } = spectralFormats; +import { schemaCasingConvention } from '../functions/index.js'; export const description = 'Schema names must follow a specified case convention'; diff --git a/packages/ruleset/src/rules/schema-description-exists.js b/packages/ruleset/src/rules/schema-description-exists.js index 5d918aa2d..af849d824 100644 --- a/packages/ruleset/src/rules/schema-description-exists.js +++ b/packages/ruleset/src/rules/schema-description-exists.js @@ -5,8 +5,8 @@ import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; -import { schemaDescriptionExists } from '../functions'; +const { oas3 } = spectralFormats; +import { schemaDescriptionExists } from '../functions/index.js'; export const description = 'Schemas should have a non-empty description'; export const message = '{{error}}'; diff --git a/packages/ruleset/src/rules/schema-keywords.js b/packages/ruleset/src/rules/schema-keywords.js index 478f31d72..1cc630ac4 100644 --- a/packages/ruleset/src/rules/schema-keywords.js +++ b/packages/ruleset/src/rules/schema-keywords.js @@ -4,8 +4,9 @@ */ import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; -import { oas3_1 } from '@stoplight/spectral-formats'; -import { allowedKeywords } from '../functions'; +import { allowedKeywords } from '../functions/index.js'; +import spectralFormats from '@stoplight/spectral-formats' +const { oas3_1 } = spectralFormats; export const description = 'Verifies that schema objects include only allowed-listed keywords'; diff --git a/packages/ruleset/src/rules/schema-naming-convention.js b/packages/ruleset/src/rules/schema-naming-convention.js index 86f255816..539663e09 100644 --- a/packages/ruleset/src/rules/schema-naming-convention.js +++ b/packages/ruleset/src/rules/schema-naming-convention.js @@ -4,8 +4,8 @@ */ import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; -import { schemaNamingConvention } from '../functions'; +const { oas3 } = spectralFormats; +import { schemaNamingConvention } from '../functions/index.js'; export const description = 'Schemas should follow naming conventions in the API Handbook'; diff --git a/packages/ruleset/src/rules/schema-type-exists.js b/packages/ruleset/src/rules/schema-type-exists.js index 27eaa4b07..356cf83df 100644 --- a/packages/ruleset/src/rules/schema-type-exists.js +++ b/packages/ruleset/src/rules/schema-type-exists.js @@ -5,8 +5,8 @@ import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; -import { schemaTypeExists } from '../functions'; +const { oas3 } = spectralFormats; +import { schemaTypeExists } from '../functions/index.js'; export const description = 'Schemas and schema properties should have a non-empty `type` field. **This rule is disabled by default.**'; diff --git a/packages/ruleset/src/rules/schema-type-format.js b/packages/ruleset/src/rules/schema-type-format.js index cbf749a94..d27df080d 100644 --- a/packages/ruleset/src/rules/schema-type-format.js +++ b/packages/ruleset/src/rules/schema-type-format.js @@ -5,8 +5,8 @@ import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; -import { schemaTypeFormat } from '../functions'; +const { oas3 } = spectralFormats; +import { schemaTypeFormat } from '../functions/index.js'; export const description = 'Schemas and schema properties must use a valid combination of type and format'; diff --git a/packages/ruleset/src/rules/securityscheme-attributes.js b/packages/ruleset/src/rules/securityscheme-attributes.js index 399c464fd..c5344d12d 100644 --- a/packages/ruleset/src/rules/securityscheme-attributes.js +++ b/packages/ruleset/src/rules/securityscheme-attributes.js @@ -5,8 +5,8 @@ import { securitySchemes } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; -import { securitySchemeAttributes } from '../functions'; +const { oas3 } = spectralFormats; +import { securitySchemeAttributes } from '../functions/index.js'; export const description = 'Validates the attributes of security schemes within an OpenAPI 3 document'; diff --git a/packages/ruleset/src/rules/securityschemes.js b/packages/ruleset/src/rules/securityschemes.js index cf541517a..c50b57987 100644 --- a/packages/ruleset/src/rules/securityschemes.js +++ b/packages/ruleset/src/rules/securityschemes.js @@ -4,8 +4,8 @@ */ import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; -import { securitySchemes } from '../functions'; +const { oas3 } = spectralFormats; +import { securitySchemes } from '../functions/index.js'; export const description = 'Validates the security schemes within an OpenAPI 3 document'; diff --git a/packages/ruleset/src/rules/server-variable-default-value.js b/packages/ruleset/src/rules/server-variable-default-value.js index d3fc206ff..94de7feed 100644 --- a/packages/ruleset/src/rules/server-variable-default-value.js +++ b/packages/ruleset/src/rules/server-variable-default-value.js @@ -4,7 +4,7 @@ */ import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; +const { oas3 } = spectralFormats; import { truthy } from '@stoplight/spectral-functions'; export const description = 'Server variable should have default value'; diff --git a/packages/ruleset/src/rules/string-attributes.js b/packages/ruleset/src/rules/string-attributes.js index 084709ade..29a669d95 100644 --- a/packages/ruleset/src/rules/string-attributes.js +++ b/packages/ruleset/src/rules/string-attributes.js @@ -5,8 +5,8 @@ import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; -import { stringAttributes } from '../functions'; +const { oas3 } = spectralFormats; +import { stringAttributes } from '../functions/index.js'; export const description = 'String schemas should have certain attributes defined'; diff --git a/packages/ruleset/src/rules/summary-sentence-style.js b/packages/ruleset/src/rules/summary-sentence-style.js index dc37094c6..7d746d1dc 100644 --- a/packages/ruleset/src/rules/summary-sentence-style.js +++ b/packages/ruleset/src/rules/summary-sentence-style.js @@ -4,7 +4,7 @@ */ import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; +const { oas3 } = spectralFormats; import { pattern } from '@stoplight/spectral-functions'; export const description = diff --git a/packages/ruleset/src/rules/unevaluated-properties.js b/packages/ruleset/src/rules/unevaluated-properties.js index 8a47062a3..d96132f99 100644 --- a/packages/ruleset/src/rules/unevaluated-properties.js +++ b/packages/ruleset/src/rules/unevaluated-properties.js @@ -3,9 +3,10 @@ * SPDX-License-Identifier: Apache2.0 */ -import { oas3_1 } from '@stoplight/spectral-formats'; -import { unevaluatedProperties } from '../functions'; +import { unevaluatedProperties } from '../functions/index.js'; import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; +import spectralFormats from '@stoplight/spectral-formats' +const { oas3_1 } = spectralFormats; export const description = 'Enforces certain restrictions on the use of "unevaluatedProperties" within a schema.'; diff --git a/packages/ruleset/src/rules/unique-parameter-request-property-names.js b/packages/ruleset/src/rules/unique-parameter-request-property-names.js index 6cc09dadf..16ccf2bf4 100644 --- a/packages/ruleset/src/rules/unique-parameter-request-property-names.js +++ b/packages/ruleset/src/rules/unique-parameter-request-property-names.js @@ -5,8 +5,8 @@ import { paths } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; -import { uniqueParameterRequestPropertyNames } from '../functions'; +const { oas3 } = spectralFormats; +import { uniqueParameterRequestPropertyNames } from '../functions/index.js'; export const description = 'Names of requestBody properties should not be the same as operation parameter names'; diff --git a/packages/ruleset/src/rules/unused-tags.js b/packages/ruleset/src/rules/unused-tags.js index c9ff42c40..e339d8748 100644 --- a/packages/ruleset/src/rules/unused-tags.js +++ b/packages/ruleset/src/rules/unused-tags.js @@ -4,8 +4,8 @@ */ import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; -import { unusedTags } from '../functions'; +const { oas3 } = spectralFormats; +import { unusedTags } from '../functions/index.js'; export const description = 'Checks that each defined tag is actually used'; export const message = '{{error}}'; diff --git a/packages/ruleset/src/rules/use-date-based-format.js b/packages/ruleset/src/rules/use-date-based-format.js index 604cfe4d0..7655700da 100644 --- a/packages/ruleset/src/rules/use-date-based-format.js +++ b/packages/ruleset/src/rules/use-date-based-format.js @@ -5,8 +5,8 @@ import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; -import { useDateBasedFormat } from '../functions'; +const { oas3 } = spectralFormats; +import { useDateBasedFormat } from '../functions/index.js'; export const description = 'Heuristically determine when a schema should have a format of "date" or "date-time"'; diff --git a/packages/ruleset/src/rules/valid-path-segments.js b/packages/ruleset/src/rules/valid-path-segments.js index 497d5b0f3..b1e2f3d07 100644 --- a/packages/ruleset/src/rules/valid-path-segments.js +++ b/packages/ruleset/src/rules/valid-path-segments.js @@ -5,8 +5,8 @@ import { paths } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; -import { validatePathSegments } from '../functions'; +const { oas3 } = spectralFormats; +import { validatePathSegments } from '../functions/index.js'; export const description = 'Validates individual path segments within a path string'; diff --git a/packages/ruleset/src/rules/valid-schema-example.js b/packages/ruleset/src/rules/valid-schema-example.js index b7fa90e1c..d90b915b3 100644 --- a/packages/ruleset/src/rules/valid-schema-example.js +++ b/packages/ruleset/src/rules/valid-schema-example.js @@ -5,8 +5,8 @@ import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; -import { validSchemaExample } from '../functions'; +const { oas3 } = spectralFormats; +import { validSchemaExample } from '../functions/index.js'; export const description = 'Schema examples should validate against the schema they are defined for'; diff --git a/packages/ruleset/src/rules/well-defined-dictionaries.js b/packages/ruleset/src/rules/well-defined-dictionaries.js index 8b21a029e..e7943e711 100644 --- a/packages/ruleset/src/rules/well-defined-dictionaries.js +++ b/packages/ruleset/src/rules/well-defined-dictionaries.js @@ -5,8 +5,8 @@ import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; import spectralFormats from '@stoplight/spectral-formats'; -const { oas3 } = spectralFormats;; -import { wellDefinedDictionaries } from '../functions'; +const { oas3 } = spectralFormats; +import { wellDefinedDictionaries } from '../functions/index.js'; export const description = 'Dictionaries must be well defined and all values must share a single type.'; diff --git a/packages/ruleset/src/utils/index.js b/packages/ruleset/src/utils/index.js index 2b491a92e..443faf525 100644 --- a/packages/ruleset/src/utils/index.js +++ b/packages/ruleset/src/utils/index.js @@ -49,10 +49,7 @@ export { }; // Re-export all named exports from utility modules -export const { - isDateBasedName, - isDateBasedValue, -} = dateBasedUtils; +export const { isDateBasedName, isDateBasedValue } = dateBasedUtils; export const { isFormMimeType, diff --git a/packages/ruleset/src/utils/schema-finding-utils.js b/packages/ruleset/src/utils/schema-finding-utils.js index 7c139391e..d2bdc969f 100644 --- a/packages/ruleset/src/utils/schema-finding-utils.js +++ b/packages/ruleset/src/utils/schema-finding-utils.js @@ -8,7 +8,8 @@ import getResponseCodes from './get-response-codes.js'; import mimetypeUtils from './mimetype-utils.js'; import getSchemaNameAtPath from './get-schema-name-at-path.js'; -const { isJsonMimeType, isJsonPatchMimeType, isMergePatchMimeType } = mimetypeUtils; +const { isJsonMimeType, isJsonPatchMimeType, isMergePatchMimeType } = + mimetypeUtils; /** * Takes an operation object/path combo and finds the JSON success diff --git a/packages/ruleset/test/rules/no-operation-requestbody.test.js b/packages/ruleset/test/rules/no-operation-requestbody.test.js index 78a9b0ca5..1b64d5901 100644 --- a/packages/ruleset/test/rules/no-operation-requestbody.test.js +++ b/packages/ruleset/test/rules/no-operation-requestbody.test.js @@ -25,8 +25,15 @@ describe(`Spectral rule: ${ruleId}`, () => { const testDocument = makeCopy(rootDocument); // omit 'delete' from the list of methods. - const rule = structuredClone(noOperationRequestBody); - rule.then.functionOptions.httpMethods = ['get', 'head', 'options']; + const rule = { + ...noOperationRequestBody, + then: { + ...noOperationRequestBody.then, + functionOptions: { + httpMethods: ['get', 'head', 'options'], + }, + }, + }; testDocument.paths['/v1/drinks/{drink_id}'].delete = { operationId: 'delete_drink', @@ -216,14 +223,15 @@ describe(`Spectral rule: ${ruleId}`, () => { it('POST operation w/requestBody - post in config', async () => { const testDocument = makeCopy(rootDocument); - const rule = structuredClone(noOperationRequestBody); - rule.then.functionOptions.httpMethods = [ - 'delete', - 'get', - 'head', - 'options', - 'POST', - ]; + const rule = { + ...noOperationRequestBody, + then: { + ...noOperationRequestBody.then, + functionOptions: { + httpMethods: ['delete', 'get', 'head', 'options', 'POST'], + }, + }, + }; // No need to change testDocument because there are plenty of post // operations with a requestBody :) diff --git a/packages/ruleset/test/rules/pagination-style.test.js b/packages/ruleset/test/rules/pagination-style.test.js index 4f94671e0..312a9151e 100644 --- a/packages/ruleset/test/rules/pagination-style.test.js +++ b/packages/ruleset/test/rules/pagination-style.test.js @@ -4,7 +4,13 @@ */ import { paginationStyle } from '../../src/rules'; -import { makeCopy, rootDocument, testRule, severityCodes, helperArtifacts } from '../test-utils'; +import { + makeCopy, + rootDocument, + testRule, + severityCodes, + helperArtifacts, +} from '../test-utils'; // These are pre-defined objects with correct style for offset/limit pagination // to use as a baseline. They aren't used in the root document because overall, diff --git a/packages/ruleset/test/rules/prefer-token-pagination.test.js b/packages/ruleset/test/rules/prefer-token-pagination.test.js index b7f180d6f..e59d28b3b 100644 --- a/packages/ruleset/test/rules/prefer-token-pagination.test.js +++ b/packages/ruleset/test/rules/prefer-token-pagination.test.js @@ -4,7 +4,13 @@ */ import { preferTokenPagination } from '../../src/rules'; -import { makeCopy, rootDocument, testRule, severityCodes, helperArtifacts } from '../test-utils'; +import { + makeCopy, + rootDocument, + testRule, + severityCodes, + helperArtifacts, +} from '../test-utils'; const { offsetPaginationBase, offsetParameter } = helperArtifacts; const rule = preferTokenPagination; diff --git a/packages/ruleset/test/test-utils/all-schemas-document.js b/packages/ruleset/test/test-utils/all-schemas-document.js index 40261dc9e..a8a11669d 100644 --- a/packages/ruleset/test/test-utils/all-schemas-document.js +++ b/packages/ruleset/test/test-utils/all-schemas-document.js @@ -6,7 +6,8 @@ export const openapi = '3.0.2'; export const info = { title: 'Subschema examples', - description: 'A collection of schemas with various kinds of subschemas for testing.', + description: + 'A collection of schemas with various kinds of subschemas for testing.', version: '0.0.1', contact: { email: 'example@example.com', @@ -133,7 +134,8 @@ export const components = { }, PropertySchema: { type: 'string', - description: 'This schema is reachable from `EveryFlavor` and `SchemaWithPropertySchema`.', + description: + 'This schema is reachable from `EveryFlavor` and `SchemaWithPropertySchema`.', }, SchemaWithAdditionalPropertiesSchema: { type: 'object', @@ -143,7 +145,8 @@ export const components = { }, AdditionalPropertiesSchema: { type: 'string', - description: 'This schema is reachable from `EveryFlavor` and `SchemaWithAdditionalPropertiesSchema`.', + description: + 'This schema is reachable from `EveryFlavor` and `SchemaWithAdditionalPropertiesSchema`.', }, SchemaWithItemsSchema: { type: 'array', @@ -153,7 +156,8 @@ export const components = { }, ItemsSchema: { type: 'string', - description: 'This schema is reachable from `EveryFlavor` and `SchemaWithItemsSchema`.', + description: + 'This schema is reachable from `EveryFlavor` and `SchemaWithItemsSchema`.', }, SchemaWithAllOfSchema: { type: 'string', @@ -165,7 +169,8 @@ export const components = { }, AllOfSchema: { type: 'string', - description: 'This schema is reachable from `EveryFlavor` and `SchemaWithAllOfSchema`.', + description: + 'This schema is reachable from `EveryFlavor` and `SchemaWithAllOfSchema`.', }, SchemaWithOneOfSchema: { type: 'string', @@ -177,7 +182,8 @@ export const components = { }, OneOfSchema: { type: 'string', - description: 'This schema is reachable from `EveryFlavor` and `SchemaWithOneOfSchema`.', + description: + 'This schema is reachable from `EveryFlavor` and `SchemaWithOneOfSchema`.', }, SchemaWithAnyOfSchema: { type: 'string', @@ -189,7 +195,8 @@ export const components = { }, AnyOfSchema: { type: 'string', - description: 'This schema is reachable from `EveryFlavor` and `SchemaWithAnyOfSchema`.', + description: + 'This schema is reachable from `EveryFlavor` and `SchemaWithAnyOfSchema`.', }, SchemaWithNotSchema: { type: 'string', @@ -199,7 +206,8 @@ export const components = { }, NotSchema: { type: 'string', - description: 'This schema is reachable from `EveryFlavor` and `SchemaWithNotSchema`.', + description: + 'This schema is reachable from `EveryFlavor` and `SchemaWithNotSchema`.', }, }, }; diff --git a/packages/ruleset/test/test-utils/index.js b/packages/ruleset/test/test-utils/index.js index 7545ccf0b..238b3578a 100644 --- a/packages/ruleset/test/test-utils/index.js +++ b/packages/ruleset/test/test-utils/index.js @@ -21,4 +21,12 @@ export default { helperArtifacts, }; -export { allSchemasDocument, makeCopy, rootDocument, testRule, unitTestRule, severityCodes, helperArtifacts }; +export { + allSchemasDocument, + makeCopy, + rootDocument, + testRule, + unitTestRule, + severityCodes, + helperArtifacts, +}; diff --git a/packages/ruleset/test/test-utils/root-document.js b/packages/ruleset/test/test-utils/root-document.js index 29ac93a36..37c6c051c 100644 --- a/packages/ruleset/test/test-utils/root-document.js +++ b/packages/ruleset/test/test-utils/root-document.js @@ -302,7 +302,8 @@ export const paths = { get: { operationId: 'list_movies', summary: 'List movies', - description: 'Retrieve a list of movies using an optional genre qualifier.', + description: + 'Retrieve a list of movies using an optional genre qualifier.', tags: ['TestTag'], security: [ { @@ -603,7 +604,8 @@ export const components = { }, }, ExpediteParam: { - description: 'An optional parameter to speed up the car manufacturing process.', + description: + 'An optional parameter to speed up the car manufacturing process.', name: 'hurry_up', required: false, in: 'query', @@ -713,7 +715,8 @@ export const components = { }, Drink: { type: 'object', - description: 'A Drink can be either a Juice or Soda instance. Sorry, no Beer or Whisky allowed.', + description: + 'A Drink can be either a Juice or Soda instance. Sorry, no Beer or Whisky allowed.', properties: { id: { $ref: '#/components/schemas/IdString', @@ -738,7 +741,8 @@ export const components = { }, DrinkPrototype: { type: 'object', - description: 'A Drink can be either a Juice or Soda instance. Sorry, no Beer or Whisky allowed.', + description: + 'A Drink can be either a Juice or Soda instance. Sorry, no Beer or Whisky allowed.', oneOf: [ { $ref: '#/components/schemas/Juice', @@ -819,7 +823,8 @@ export const components = { required: ['drinks'], properties: { drinks: { - description: 'The set of Drink instances in this page of results.', + description: + 'The set of Drink instances in this page of results.', type: 'array', minItems: 0, maxItems: 50, @@ -865,7 +870,8 @@ export const components = { required: ['movies'], properties: { movies: { - description: 'The set of Movie instances in this page of results.', + description: + 'The set of Movie instances in this page of results.', type: 'array', minItems: 0, maxItems: 50, @@ -966,7 +972,8 @@ export const components = { pattern: '^.*$', }, TokenPaginationBase: { - description: 'A base schema containing properties that support token-based pagination.', + description: + 'A base schema containing properties that support token-based pagination.', type: 'object', required: ['limit', 'total_count'], properties: { @@ -1027,7 +1034,8 @@ export const components = { type: 'array', minItems: 0, maxItems: 100, - description: 'The array of error entries associated with the error response', + description: + 'The array of error entries associated with the error response', items: { $ref: '#/components/schemas/Error', }, @@ -1088,7 +1096,8 @@ export const components = { enum: ['field', 'header', 'parameter'], }, name: { - description: 'The name of the field/header/query parameter associated with the error.', + description: + 'The name of the field/header/query parameter associated with the error.', type: 'string', pattern: '^[a-zA-Z0-9 ]+$', minLength: 1, @@ -1279,7 +1288,8 @@ export const components = { }, links: { CarIdLink: { - description: 'Link the `create_car` response `id` property to the `get_car` path parameter named `car_id`.', + description: + 'Link the `create_car` response `id` property to the `get_car` path parameter named `car_id`.', operationId: 'get_car', parameters: { car_id: '$response.body#/id', @@ -1289,3 +1299,14 @@ export const components = { callbacks: {}, headers: {}, }; + + +export default { + openapi, + info, + servers, + security, + tags, + paths, + components, +}; diff --git a/packages/ruleset/test/utils/mimetype-utils.test.js b/packages/ruleset/test/utils/mimetype-utils.test.js index da02b505d..b3d4f47d9 100644 --- a/packages/ruleset/test/utils/mimetype-utils.test.js +++ b/packages/ruleset/test/utils/mimetype-utils.test.js @@ -3,7 +3,12 @@ * SPDX-License-Identifier: Apache2.0 */ -import { isJsonMimeType, isJsonPatchMimeType, isMergePatchMimeType, isFormMimeType } from '../../src/utils'; +import { + isJsonMimeType, + isJsonPatchMimeType, + isMergePatchMimeType, + isFormMimeType, +} from '../../src/utils'; describe('MimeType utility functions', () => { describe('isJsonMimeType()', () => { diff --git a/packages/ruleset/test/utils/path-location-utils.test.js b/packages/ruleset/test/utils/path-location-utils.test.js index a290bae64..37a0a46a7 100644 --- a/packages/ruleset/test/utils/path-location-utils.test.js +++ b/packages/ruleset/test/utils/path-location-utils.test.js @@ -3,7 +3,14 @@ * SPDX-License-Identifier: Apache2.0 */ -import { isParamContentSchema, isParamSchema, isPrimarySchema, isRequestBodySchema, isResponseSchema, isSchemaProperty } from '../../src/utils'; +import { + isParamContentSchema, + isParamSchema, + isPrimarySchema, + isRequestBodySchema, + isResponseSchema, + isSchemaProperty, +} from '../../src/utils'; describe('Path Location utility functions', () => { describe('isParamContentSchema()', () => { diff --git a/packages/utilities/src/collections/index.js b/packages/utilities/src/collections/index.js index dcd5ae5d5..52f58970f 100644 --- a/packages/utilities/src/collections/index.js +++ b/packages/utilities/src/collections/index.js @@ -109,3 +109,20 @@ const collections = { }; export default collections; + +// Export individual collections as named exports for convenience +export { + operations, + requestBodySchemas, + responseSchemas, + unresolvedRequestBodySchemas, + unresolvedResponseSchemas, +}; + +// Re-export all collections from the collections object for backward compatibility +export const parameters = collections.parameters; +export const patchOperations = collections.patchOperations; +export const paths = collections.paths; +export const schemas = collections.schemas; +export const securitySchemes = collections.securitySchemes; +export const unresolvedSchemas = collections.unresolvedSchemas; diff --git a/packages/validator/src/cli-validator/run-validator.js b/packages/validator/src/cli-validator/run-validator.js index 2f2b7ffba..9bb8a99f3 100644 --- a/packages/validator/src/cli-validator/run-validator.js +++ b/packages/validator/src/cli-validator/run-validator.js @@ -7,7 +7,7 @@ import chalk, { underline } from 'chalk'; import { readFile as _readFile } from 'fs'; import globby from 'globby'; -import isPlainObject from 'lodash/isPlainObject'; +import isPlainObject from 'lodash/isPlainObject.js'; import { validate } from 'json-dup-key-validator'; import { resolve, relative } from 'path'; import { load } from 'js-yaml'; diff --git a/packages/validator/src/cli-validator/utils/file-extension-validator.js b/packages/validator/src/cli-validator/utils/file-extension-validator.js index caa6521a8..1e6e30925 100644 --- a/packages/validator/src/cli-validator/utils/file-extension-validator.js +++ b/packages/validator/src/cli-validator/utils/file-extension-validator.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -import last from 'lodash/last'; +import last from 'lodash/last.js'; const getExtension = filename => { return last(filename.split('.')).toLowerCase(); diff --git a/packages/validator/src/cli-validator/utils/print-results.js b/packages/validator/src/cli-validator/utils/print-results.js index 14fbef629..dfadd9109 100644 --- a/packages/validator/src/cli-validator/utils/print-results.js +++ b/packages/validator/src/cli-validator/utils/print-results.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -import each from 'lodash/each'; +import each from 'lodash/each.js'; import pad from 'pad'; // this function prints all of the output From 758b889003a2729bfd34301a58d88c195348f98a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=ADdia=20Tarcza?= <100163235+diatrcz@users.noreply.github.com> Date: Tue, 23 Jun 2026 16:08:45 +0200 Subject: [PATCH 14/16] test: modify tests to pass as esm MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Lídia Tarcza <100163235+diatrcz@users.noreply.github.com> --- packages/ruleset/src/rules/index.js | 372 +++++++++++++----- .../ruleset/test/rules/circular-refs.test.js | 7 +- .../ruleset/test/rules/delete-body.test.js | 6 +- .../property-consistent-name-and-type.test.js | 21 +- .../test/rules/requestbody-name.test.js | 6 +- .../ruleset/test/rules/schema-type.test.js | 6 +- .../test/test-utils/helper-artifacts.js | 5 + 7 files changed, 314 insertions(+), 109 deletions(-) diff --git a/packages/ruleset/src/rules/index.js b/packages/ruleset/src/rules/index.js index 8d8f4f5ae..6247c041a 100644 --- a/packages/ruleset/src/rules/index.js +++ b/packages/ruleset/src/rules/index.js @@ -3,95 +3,283 @@ * SPDX-License-Identifier: Apache2.0 */ -export const acceptAndReturnModels = require('./accept-and-return-models'); -export const acceptHeader = require('./accept-header'); -export const anchoredPatterns = require('./anchored-patterns'); -export const apiSymmetry = require('./api-symmetry'); -export const arrayAttributes = require('./array-attributes'); -export const arrayOfArrays = require('./array-of-arrays'); -export const arrayResponses = require('./array-responses'); -export const authorizationHeader = require('./authorization-header'); -export const avoidMultipleTypes = require('./avoid-multiple-types'); -export const binarySchemas = require('./binary-schemas'); -export const circularRefs = require('./circular-refs'); -export const collectionArrayProperty = require('./collection-array-property'); -export const consecutivePathSegments = require('./consecutive-path-segments'); -export const contentContainsSchema = require('./content-contains-schema'); -export const contentTypeHeader = require('./content-type-header'); -export const contentTypeIsSpecific = require('./content-type-is-specific'); -export const deleteBody = require('./delete-body'); -export const discriminatorPropertyExists = require('./discriminator-property-exists'); -export const duplicatePathParameter = require('./duplicate-path-parameter'); -export const etagHeaderExists = require('./etag-header-exists'); -export const enumCasingConvention = require('./enum-casing-convention'); -export const errorContentTypeIsJson = require('./error-content-type-is-json'); -export const errorResponseSchemas = require('./error-response-schemas'); -export const examplesNameContainsSpace = require('./examples-name-contains-space'); -export const ibmSdkOperations = require('./ibm-sdk-operations'); -export const ifModifiedSinceHeader = require('./if-modified-since-header'); -export const ifUnmodifiedSinceHeader = require('./if-unmodified-since-header'); -export const inlineSchemas = require('./inline-schemas'); -export const integerAttributes = require('./integer-attributes'); -export const majorVersionInPath = require('./major-version-in-path'); -export const mergePatchProperties = require('./merge-patch-properties'); -export const noAmbiguousPaths = require('./no-ambiguous-paths'); -export const noNullableProperties = require('./no-nullable-properties'); -export const noOperationRequestBody = require('./no-operation-requestbody'); -export const noRefInExample = require('./no-ref-in-example'); -export const noSuperfluousAllOf = require('./no-superfluous-allof'); -export const noUnsupportedKeywords = require('./no-unsupported-keywords'); -export const operationIdCasingConvention = require('./operationid-casing-convention'); -export const operationIdNamingConvention = require('./operationid-naming-convention'); -export const operationResponses = require('./operation-responses'); -export const operationSummaryExists = require('./operation-summary-exists'); -export const operationSummaryLength = require('./operation-summary-length'); -export const optionalRequestBody = require('./optional-request-body'); -export const optionalRequestBodyDeprecated = require('./optional-request-body-deprecated'); -export const paginationStyle = require('./pagination-style'); -export const parameterCasingConvention = require('./parameter-casing-convention'); -export const parameterDefault = require('./parameter-default'); -export const parameterDescriptionExists = require('./parameter-description-exists'); -export const parameterOrder = require('./parameter-order'); -export const parameterSchemaOrContentExists = require('./parameter-schema-or-content-exists'); -export const patchRequestContentType = require('./patch-request-content-type'); -export const pathParameterNotCRN = require('./path-parameter-not-crn'); -export const pathSegmentCasingConvention = require('./path-segment-casing-convention'); -export const patternProperties = require('./pattern-properties'); -export const preconditionHeader = require('./precondition-header'); -export const preferTokenPagination = require('./prefer-token-pagination'); -export const propertyAttributes = require('./property-attributes'); -export const propertyCasingConvention = require('./property-casing-convention'); -export const propertyConsistentNameAndType = require('./property-consistent-name-and-type'); -export const propertyDescriptionExists = require('./property-description-exists'); -export const propertyNameCollision = require('./property-name-collision'); -export const redirectResponseBody = require('./redirect-response-body'); -export const refPattern = require('./ref-pattern'); -export const refSiblingDuplicateDescription = require('./ref-sibling-duplicate-description'); -export const requestAndResponseContent = require('./request-and-response-content'); -export const requestBodyIsObject = require('./requestbody-is-object'); -export const requestBodyName = require('./requestbody-name'); -export const requiredArrayPropertiesInResponse = require('./required-array-properties-in-response'); -export const requiredEnumPropertiesInResponse = require('./required-enum-properties-in-response'); -export const requiredPropertyMissing = require('./required-property-missing'); -export const resourceResponseConsistency = require('./resource-response-consistency'); -export const responseExampleExists = require('./response-example-exists'); -export const responseStatusCodes = require('./response-status-codes'); -export const schemaCasingConvention = require('./schema-casing-convention'); -export const schemaDescriptionExists = require('./schema-description-exists'); -export const schemaKeywords = require('./schema-keywords'); -export const schemaNamingConvention = require('./schema-naming-convention'); -export const schemaTypeExists = require('./schema-type-exists'); -export const schemaTypeFormat = require('./schema-type-format'); -export const securitySchemes = require('./securityschemes'); -export const securitySchemeAttributes = require('./securityscheme-attributes'); -export const serverVariableDefaultValue = require('./server-variable-default-value'); -export const stringAttributes = require('./string-attributes'); -export const summarySentenceStyle = require('./summary-sentence-style'); -export const typedEnum = require('./typed-enum').default; -export const unevaluatedProperties = require('./unevaluated-properties'); -export const unusedTags = require('./unused-tags'); -export const uniqueParameterRequestPropertyNames = require('./unique-parameter-request-property-names'); -export const useDateBasedFormat = require('./use-date-based-format'); -export const validPathSegments = require('./valid-path-segments'); -export const validSchemaExample = require('./valid-schema-example'); -export const wellDefinedDictionaries = require('./well-defined-dictionaries'); +import * as acceptAndReturnModelsModule from './accept-and-return-models.js'; +import * as acceptHeaderModule from './accept-header.js'; +import * as anchoredPatternsModule from './anchored-patterns.js'; +import * as apiSymmetryModule from './api-symmetry.js'; +import * as arrayAttributesModule from './array-attributes.js'; +import * as arrayOfArraysModule from './array-of-arrays.js'; +import * as arrayResponsesModule from './array-responses.js'; +import * as authorizationHeaderModule from './authorization-header.js'; +import * as avoidMultipleTypesModule from './avoid-multiple-types.js'; +import * as binarySchemasModule from './binary-schemas.js'; +import * as circularRefsModule from './circular-refs.js'; +import * as collectionArrayPropertyModule from './collection-array-property.js'; +import * as consecutivePathSegmentsModule from './consecutive-path-segments.js'; +import * as contentContainsSchemaModule from './content-contains-schema.js'; +import * as contentTypeHeaderModule from './content-type-header.js'; +import * as contentTypeIsSpecificModule from './content-type-is-specific.js'; +import * as deleteBodyModule from './delete-body.js'; +import * as discriminatorPropertyExistsModule from './discriminator-property-exists.js'; +import * as duplicatePathParameterModule from './duplicate-path-parameter.js'; +import * as etagHeaderExistsModule from './etag-header-exists.js'; +import * as enumCasingConventionModule from './enum-casing-convention.js'; +import * as errorContentTypeIsJsonModule from './error-content-type-is-json.js'; +import * as errorResponseSchemasModule from './error-response-schemas.js'; +import * as examplesNameContainsSpaceModule from './examples-name-contains-space.js'; +import * as ibmSdkOperationsModule from './ibm-sdk-operations.js'; +import * as ifModifiedSinceHeaderModule from './if-modified-since-header.js'; +import * as ifUnmodifiedSinceHeaderModule from './if-unmodified-since-header.js'; +import * as inlineSchemasModule from './inline-schemas.js'; +import * as integerAttributesModule from './integer-attributes.js'; +import * as majorVersionInPathModule from './major-version-in-path.js'; +import * as mergePatchPropertiesModule from './merge-patch-properties.js'; +import * as noAmbiguousPathsModule from './no-ambiguous-paths.js'; +import * as noNullablePropertiesModule from './no-nullable-properties.js'; +import * as noOperationRequestBodyModule from './no-operation-requestbody.js'; +import * as noRefInExampleModule from './no-ref-in-example.js'; +import * as noSuperfluousAllOfModule from './no-superfluous-allof.js'; +import * as noUnsupportedKeywordsModule from './no-unsupported-keywords.js'; +import * as operationIdCasingConventionModule from './operationid-casing-convention.js'; +import * as operationIdNamingConventionModule from './operationid-naming-convention.js'; +import * as operationResponsesModule from './operation-responses.js'; +import * as operationSummaryExistsModule from './operation-summary-exists.js'; +import * as operationSummaryLengthModule from './operation-summary-length.js'; +import * as optionalRequestBodyModule from './optional-request-body.js'; +import * as optionalRequestBodyDeprecatedModule from './optional-request-body-deprecated.js'; +import * as paginationStyleModule from './pagination-style.js'; +import * as parameterCasingConventionModule from './parameter-casing-convention.js'; +import * as parameterDefaultModule from './parameter-default.js'; +import * as parameterDescriptionExistsModule from './parameter-description-exists.js'; +import * as parameterOrderModule from './parameter-order.js'; +import * as parameterSchemaOrContentExistsModule from './parameter-schema-or-content-exists.js'; +import * as patchRequestContentTypeModule from './patch-request-content-type.js'; +import * as pathParameterNotCRNModule from './path-parameter-not-crn.js'; +import * as pathSegmentCasingConventionModule from './path-segment-casing-convention.js'; +import * as patternPropertiesModule from './pattern-properties.js'; +import * as preconditionHeaderModule from './precondition-header.js'; +import * as preferTokenPaginationModule from './prefer-token-pagination.js'; +import * as propertyAttributesModule from './property-attributes.js'; +import * as propertyCasingConventionModule from './property-casing-convention.js'; +import * as propertyConsistentNameAndTypeModule from './property-consistent-name-and-type.js'; +import * as propertyDescriptionExistsModule from './property-description-exists.js'; +import * as propertyNameCollisionModule from './property-name-collision.js'; +import * as redirectResponseBodyModule from './redirect-response-body.js'; +import * as refPatternModule from './ref-pattern.js'; +import * as refSiblingDuplicateDescriptionModule from './ref-sibling-duplicate-description.js'; +import * as requestAndResponseContentModule from './request-and-response-content.js'; +import * as requestBodyIsObjectModule from './requestbody-is-object.js'; +import * as requestBodyNameModule from './requestbody-name.js'; +import * as requiredArrayPropertiesInResponseModule from './required-array-properties-in-response.js'; +import * as requiredEnumPropertiesInResponseModule from './required-enum-properties-in-response.js'; +import * as requiredPropertyMissingModule from './required-property-missing.js'; +import * as resourceResponseConsistencyModule from './resource-response-consistency.js'; +import * as responseExampleExistsModule from './response-example-exists.js'; +import * as responseStatusCodesModule from './response-status-codes.js'; +import * as schemaCasingConventionModule from './schema-casing-convention.js'; +import * as schemaDescriptionExistsModule from './schema-description-exists.js'; +import * as schemaKeywordsModule from './schema-keywords.js'; +import * as schemaNamingConventionModule from './schema-naming-convention.js'; +import * as schemaTypeExistsModule from './schema-type-exists.js'; +import * as schemaTypeFormatModule from './schema-type-format.js'; +import * as securitySchemesModule from './securityschemes.js'; +import * as securitySchemeAttributesModule from './securityscheme-attributes.js'; +import * as serverVariableDefaultValueModule from './server-variable-default-value.js'; +import * as stringAttributesModule from './string-attributes.js'; +import * as summarySentenceStyleModule from './summary-sentence-style.js'; +import typedEnumDefault from './typed-enum.js'; +import * as unevaluatedPropertiesModule from './unevaluated-properties.js'; +import * as unusedTagsModule from './unused-tags.js'; +import * as uniqueParameterRequestPropertyNamesModule from './unique-parameter-request-property-names.js'; +import * as useDateBasedFormatModule from './use-date-based-format.js'; +import * as validPathSegmentsModule from './valid-path-segments.js'; +import * as validSchemaExampleModule from './valid-schema-example.js'; +import * as wellDefinedDictionariesModule from './well-defined-dictionaries.js'; + +export const acceptAndReturnModels = acceptAndReturnModelsModule; +export const acceptHeader = acceptHeaderModule; +export const anchoredPatterns = anchoredPatternsModule; +export const apiSymmetry = apiSymmetryModule; +export const arrayAttributes = arrayAttributesModule; +export const arrayOfArrays = arrayOfArraysModule; +export const arrayResponses = arrayResponsesModule; +export const authorizationHeader = authorizationHeaderModule; +export const avoidMultipleTypes = avoidMultipleTypesModule; +export const binarySchemas = binarySchemasModule; +export const circularRefs = circularRefsModule; +export const collectionArrayProperty = collectionArrayPropertyModule; +export const consecutivePathSegments = consecutivePathSegmentsModule; +export const contentContainsSchema = contentContainsSchemaModule; +export const contentTypeHeader = contentTypeHeaderModule; +export const contentTypeIsSpecific = contentTypeIsSpecificModule; +export const deleteBody = deleteBodyModule; +export const discriminatorPropertyExists = discriminatorPropertyExistsModule; +export const duplicatePathParameter = duplicatePathParameterModule; +export const etagHeaderExists = etagHeaderExistsModule; +export const enumCasingConvention = enumCasingConventionModule; +export const errorContentTypeIsJson = errorContentTypeIsJsonModule; +export const errorResponseSchemas = errorResponseSchemasModule; +export const examplesNameContainsSpace = examplesNameContainsSpaceModule; +export const ibmSdkOperations = ibmSdkOperationsModule; +export const ifModifiedSinceHeader = ifModifiedSinceHeaderModule; +export const ifUnmodifiedSinceHeader = ifUnmodifiedSinceHeaderModule; +export const inlineSchemas = inlineSchemasModule; +export const integerAttributes = integerAttributesModule; +export const majorVersionInPath = majorVersionInPathModule; +export const mergePatchProperties = mergePatchPropertiesModule; +export const noAmbiguousPaths = noAmbiguousPathsModule; +export const noNullableProperties = noNullablePropertiesModule; +export const noOperationRequestBody = noOperationRequestBodyModule; +export const noRefInExample = noRefInExampleModule; +export const noSuperfluousAllOf = noSuperfluousAllOfModule; +export const noUnsupportedKeywords = noUnsupportedKeywordsModule; +export const operationIdCasingConvention = operationIdCasingConventionModule; +export const operationIdNamingConvention = operationIdNamingConventionModule; +export const operationResponses = operationResponsesModule; +export const operationSummaryExists = operationSummaryExistsModule; +export const operationSummaryLength = operationSummaryLengthModule; +export const optionalRequestBody = optionalRequestBodyModule; +export const optionalRequestBodyDeprecated = optionalRequestBodyDeprecatedModule; +export const paginationStyle = paginationStyleModule; +export const parameterCasingConvention = parameterCasingConventionModule; +export const parameterDefault = parameterDefaultModule; +export const parameterDescriptionExists = parameterDescriptionExistsModule; +export const parameterOrder = parameterOrderModule; +export const parameterSchemaOrContentExists = parameterSchemaOrContentExistsModule; +export const patchRequestContentType = patchRequestContentTypeModule; +export const pathParameterNotCRN = pathParameterNotCRNModule; +export const pathSegmentCasingConvention = pathSegmentCasingConventionModule; +export const patternProperties = patternPropertiesModule; +export const preconditionHeader = preconditionHeaderModule; +export const preferTokenPagination = preferTokenPaginationModule; +export const propertyAttributes = propertyAttributesModule; +export const propertyCasingConvention = propertyCasingConventionModule; +export const propertyConsistentNameAndType = propertyConsistentNameAndTypeModule; +export const propertyDescriptionExists = propertyDescriptionExistsModule; +export const propertyNameCollision = propertyNameCollisionModule; +export const redirectResponseBody = redirectResponseBodyModule; +export const refPattern = refPatternModule; +export const refSiblingDuplicateDescription = refSiblingDuplicateDescriptionModule; +export const requestAndResponseContent = requestAndResponseContentModule; +export const requestBodyIsObject = requestBodyIsObjectModule; +export const requestBodyName = requestBodyNameModule; +export const requiredArrayPropertiesInResponse = requiredArrayPropertiesInResponseModule; +export const requiredEnumPropertiesInResponse = requiredEnumPropertiesInResponseModule; +export const requiredPropertyMissing = requiredPropertyMissingModule; +export const resourceResponseConsistency = resourceResponseConsistencyModule; +export const responseExampleExists = responseExampleExistsModule; +export const responseStatusCodes = responseStatusCodesModule; +export const schemaCasingConvention = schemaCasingConventionModule; +export const schemaDescriptionExists = schemaDescriptionExistsModule; +export const schemaKeywords = schemaKeywordsModule; +export const schemaNamingConvention = schemaNamingConventionModule; +export const schemaTypeExists = schemaTypeExistsModule; +export const schemaTypeFormat = schemaTypeFormatModule; +export const securitySchemes = securitySchemesModule; +export const securitySchemeAttributes = securitySchemeAttributesModule; +export const serverVariableDefaultValue = serverVariableDefaultValueModule; +export const stringAttributes = stringAttributesModule; +export const summarySentenceStyle = summarySentenceStyleModule; +export const typedEnum = typedEnumDefault; +export const unevaluatedProperties = unevaluatedPropertiesModule; +export const unusedTags = unusedTagsModule; +export const uniqueParameterRequestPropertyNames = uniqueParameterRequestPropertyNamesModule; +export const useDateBasedFormat = useDateBasedFormatModule; +export const validPathSegments = validPathSegmentsModule; +export const validSchemaExample = validSchemaExampleModule; +export const wellDefinedDictionaries = wellDefinedDictionariesModule; + +export default { + acceptAndReturnModels, + acceptHeader, + anchoredPatterns, + apiSymmetry, + arrayAttributes, + arrayOfArrays, + arrayResponses, + authorizationHeader, + avoidMultipleTypes, + binarySchemas, + circularRefs, + collectionArrayProperty, + consecutivePathSegments, + contentContainsSchema, + contentTypeHeader, + contentTypeIsSpecific, + deleteBody, + discriminatorPropertyExists, + duplicatePathParameter, + etagHeaderExists, + enumCasingConvention, + errorContentTypeIsJson, + errorResponseSchemas, + examplesNameContainsSpace, + ibmSdkOperations, + ifModifiedSinceHeader, + ifUnmodifiedSinceHeader, + inlineSchemas, + integerAttributes, + majorVersionInPath, + mergePatchProperties, + noAmbiguousPaths, + noNullableProperties, + noOperationRequestBody, + noRefInExample, + noSuperfluousAllOf, + noUnsupportedKeywords, + operationIdCasingConvention, + operationIdNamingConvention, + operationResponses, + operationSummaryExists, + operationSummaryLength, + optionalRequestBody, + optionalRequestBodyDeprecated, + paginationStyle, + parameterCasingConvention, + parameterDefault, + parameterDescriptionExists, + parameterOrder, + parameterSchemaOrContentExists, + patchRequestContentType, + pathParameterNotCRN, + pathSegmentCasingConvention, + patternProperties, + preconditionHeader, + preferTokenPagination, + propertyAttributes, + propertyCasingConvention, + propertyConsistentNameAndType, + propertyDescriptionExists, + propertyNameCollision, + redirectResponseBody, + refPattern, + refSiblingDuplicateDescription, + requestAndResponseContent, + requestBodyIsObject, + requestBodyName, + requiredArrayPropertiesInResponse, + requiredEnumPropertiesInResponse, + requiredPropertyMissing, + resourceResponseConsistency, + responseExampleExists, + responseStatusCodes, + schemaCasingConvention, + schemaDescriptionExists, + schemaKeywords, + schemaNamingConvention, + schemaTypeExists, + schemaTypeFormat, + securitySchemes, + securitySchemeAttributes, + serverVariableDefaultValue, + stringAttributes, + summarySentenceStyle, + typedEnum, + unevaluatedProperties, + unusedTags, + uniqueParameterRequestPropertyNames, + useDateBasedFormat, + validPathSegments, + validSchemaExample, + wellDefinedDictionaries, +}; diff --git a/packages/ruleset/test/rules/circular-refs.test.js b/packages/ruleset/test/rules/circular-refs.test.js index bf223d1b8..4e330579f 100644 --- a/packages/ruleset/test/rules/circular-refs.test.js +++ b/packages/ruleset/test/rules/circular-refs.test.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -import { vi } from 'vitest'; +import { vi, beforeEach } from 'vitest'; import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; let rule; @@ -16,9 +16,10 @@ describe(`Spectral rule: ${ruleId}`, () => { // to store the set of unique flagged $ref values. // Because the global variable's value is retained across testcases, we need to reset // everything before each testcase. - beforeEach(() => { + beforeEach(async () => { vi.resetModules(); - rule = require('../../src/rules').circularRefs; + const rulesModule = await import('../../src/rules/index.js'); + rule = rulesModule.circularRefs; }); describe('Should not yield errors', () => { diff --git a/packages/ruleset/test/rules/delete-body.test.js b/packages/ruleset/test/rules/delete-body.test.js index 0a5f35ac6..e967852b8 100644 --- a/packages/ruleset/test/rules/delete-body.test.js +++ b/packages/ruleset/test/rules/delete-body.test.js @@ -6,14 +6,12 @@ import { deleteBody } from '../../src/rules'; import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; -const rule = deleteBody; +// Create a mutable copy of the rule since the imported module is read-only +const rule = { ...deleteBody, severity: 'warn' }; const ruleId = 'ibm-no-body-for-delete'; const expectedSeverity = severityCodes.warning; const expectedMsg = 'DELETE operations should not contain a requestBody'; -// We need to set this because the rule is now deprecated and disabled. -rule.severity = 'warn'; - describe(`Spectral rule: ${ruleId}`, () => { describe('Should not yield errors', () => { it('Clean spec', async () => { diff --git a/packages/ruleset/test/rules/property-consistent-name-and-type.test.js b/packages/ruleset/test/rules/property-consistent-name-and-type.test.js index af368dce4..d5f61ca6d 100644 --- a/packages/ruleset/test/rules/property-consistent-name-and-type.test.js +++ b/packages/ruleset/test/rules/property-consistent-name-and-type.test.js @@ -3,22 +3,35 @@ * SPDX-License-Identifier: Apache2.0 */ +import { vi, beforeEach } from 'vitest'; import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; -import { propertyConsistentNameAndType } from '../../src/rules'; +let propertyConsistentNameAndType; const ruleId = 'ibm-property-consistent-name-and-type'; function getRule() { - const rule = structuredClone(propertyConsistentNameAndType); - rule.severity = 'warn'; + const rule = { + ...propertyConsistentNameAndType, + severity: 'warn', + }; return rule; } -const originalSeverity = makeCopy(propertyConsistentNameAndType.severity); const expectedSeverity = severityCodes.warning; describe(`Spectral rule: ${ruleId}`, () => { + // The implementation of the property-consistent-name-and-type rule uses a global variable + // to store visited properties across the entire API definition. + // Because the global variable's value is retained across testcases, we need to reset + // everything before each testcase. + beforeEach(async () => { + vi.resetModules(); + const rulesModule = await import('../../src/rules/index.js'); + propertyConsistentNameAndType = rulesModule.propertyConsistentNameAndType; + }); + it('Should originally be set to severity: "off"', () => { + const originalSeverity = makeCopy(propertyConsistentNameAndType.severity); expect(originalSeverity).toBe('off'); }); diff --git a/packages/ruleset/test/rules/requestbody-name.test.js b/packages/ruleset/test/rules/requestbody-name.test.js index c96b6befc..71e533e06 100644 --- a/packages/ruleset/test/rules/requestbody-name.test.js +++ b/packages/ruleset/test/rules/requestbody-name.test.js @@ -7,14 +7,14 @@ import { requestBodyName } from '../../src/rules'; import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; const ruleId = 'ibm-requestbody-name'; -const rule = requestBodyName; const expectedSeverity = severityCodes.warning; const expectedMsg = `Operations with non-form request bodies should set a name with the 'x-codegen-request-body-name' extension`; // This rule is turned off by default - enable it to run tests // but still verify it is defined in the rule as "off". -const originalSeverity = makeCopy(rule.severity); -rule.severity = 'warn'; +const originalSeverity = makeCopy(requestBodyName.severity); +// Create a mutable copy of the rule with severity set to 'warn' +const rule = { ...requestBodyName, severity: 'warn' }; // `Operation with non-form requestBody should set a name with the ${EXTENSION_NAME} extension.` describe(`Spectral rule: ${ruleId}`, () => { diff --git a/packages/ruleset/test/rules/schema-type.test.js b/packages/ruleset/test/rules/schema-type.test.js index f624702a7..c6ab1cd06 100644 --- a/packages/ruleset/test/rules/schema-type.test.js +++ b/packages/ruleset/test/rules/schema-type.test.js @@ -6,11 +6,11 @@ import { schemaTypeExists } from '../../src/rules'; import { makeCopy, rootDocument, testRule, severityCodes } from '../test-utils'; -const rule = schemaTypeExists; // this rule is turned off by default - enable it to run tests // but still verify it is defined in the rule as "off" -const originalSeverity = makeCopy(rule.severity); -rule.severity = 'warn'; +const originalSeverity = makeCopy(schemaTypeExists.severity); +// Create a mutable copy of the rule with severity set to 'warn' +const rule = { ...schemaTypeExists, severity: 'warn' }; const ruleId = 'ibm-schema-type'; const expectedSeverity = severityCodes.warning; diff --git a/packages/ruleset/test/test-utils/helper-artifacts.js b/packages/ruleset/test/test-utils/helper-artifacts.js index 31d74b686..075027d66 100644 --- a/packages/ruleset/test/test-utils/helper-artifacts.js +++ b/packages/ruleset/test/test-utils/helper-artifacts.js @@ -58,3 +58,8 @@ export const offsetPaginationBase = { last: pageLink, }, }; + +export default { + offsetParameter, + offsetPaginationBase, +}; From e2266c4cfcf03302f29da675a893bb726e995ca3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=ADdia=20Tarcza?= <100163235+diatrcz@users.noreply.github.com> Date: Tue, 23 Jun 2026 16:11:21 +0200 Subject: [PATCH 15/16] fix: add linter fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Lídia Tarcza <100163235+diatrcz@users.noreply.github.com> --- .../ruleset/src/rules/avoid-multiple-types.js | 2 +- packages/ruleset/src/rules/index.js | 21 ++++++++++++------- .../src/rules/no-unsupported-keywords.js | 2 +- .../ruleset/src/rules/operation-responses.js | 2 +- .../rules/operationid-naming-convention.js | 2 +- .../ruleset/src/rules/parameter-default.js | 2 +- .../ruleset/src/rules/pattern-properties.js | 2 +- packages/ruleset/src/rules/schema-keywords.js | 2 +- .../src/rules/unevaluated-properties.js | 2 +- .../ruleset/test/test-utils/root-document.js | 1 - 10 files changed, 22 insertions(+), 16 deletions(-) diff --git a/packages/ruleset/src/rules/avoid-multiple-types.js b/packages/ruleset/src/rules/avoid-multiple-types.js index 0aff1bcac..8e47c4b4c 100644 --- a/packages/ruleset/src/rules/avoid-multiple-types.js +++ b/packages/ruleset/src/rules/avoid-multiple-types.js @@ -5,7 +5,7 @@ import { avoidMultipleTypes } from '../functions/index.js'; import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; -import spectralFormats from '@stoplight/spectral-formats' +import spectralFormats from '@stoplight/spectral-formats'; const { oas3_1 } = spectralFormats; export const description = diff --git a/packages/ruleset/src/rules/index.js b/packages/ruleset/src/rules/index.js index 6247c041a..22f332c17 100644 --- a/packages/ruleset/src/rules/index.js +++ b/packages/ruleset/src/rules/index.js @@ -139,13 +139,15 @@ export const operationResponses = operationResponsesModule; export const operationSummaryExists = operationSummaryExistsModule; export const operationSummaryLength = operationSummaryLengthModule; export const optionalRequestBody = optionalRequestBodyModule; -export const optionalRequestBodyDeprecated = optionalRequestBodyDeprecatedModule; +export const optionalRequestBodyDeprecated = + optionalRequestBodyDeprecatedModule; export const paginationStyle = paginationStyleModule; export const parameterCasingConvention = parameterCasingConventionModule; export const parameterDefault = parameterDefaultModule; export const parameterDescriptionExists = parameterDescriptionExistsModule; export const parameterOrder = parameterOrderModule; -export const parameterSchemaOrContentExists = parameterSchemaOrContentExistsModule; +export const parameterSchemaOrContentExists = + parameterSchemaOrContentExistsModule; export const patchRequestContentType = patchRequestContentTypeModule; export const pathParameterNotCRN = pathParameterNotCRNModule; export const pathSegmentCasingConvention = pathSegmentCasingConventionModule; @@ -154,17 +156,21 @@ export const preconditionHeader = preconditionHeaderModule; export const preferTokenPagination = preferTokenPaginationModule; export const propertyAttributes = propertyAttributesModule; export const propertyCasingConvention = propertyCasingConventionModule; -export const propertyConsistentNameAndType = propertyConsistentNameAndTypeModule; +export const propertyConsistentNameAndType = + propertyConsistentNameAndTypeModule; export const propertyDescriptionExists = propertyDescriptionExistsModule; export const propertyNameCollision = propertyNameCollisionModule; export const redirectResponseBody = redirectResponseBodyModule; export const refPattern = refPatternModule; -export const refSiblingDuplicateDescription = refSiblingDuplicateDescriptionModule; +export const refSiblingDuplicateDescription = + refSiblingDuplicateDescriptionModule; export const requestAndResponseContent = requestAndResponseContentModule; export const requestBodyIsObject = requestBodyIsObjectModule; export const requestBodyName = requestBodyNameModule; -export const requiredArrayPropertiesInResponse = requiredArrayPropertiesInResponseModule; -export const requiredEnumPropertiesInResponse = requiredEnumPropertiesInResponseModule; +export const requiredArrayPropertiesInResponse = + requiredArrayPropertiesInResponseModule; +export const requiredEnumPropertiesInResponse = + requiredEnumPropertiesInResponseModule; export const requiredPropertyMissing = requiredPropertyMissingModule; export const resourceResponseConsistency = resourceResponseConsistencyModule; export const responseExampleExists = responseExampleExistsModule; @@ -183,7 +189,8 @@ export const summarySentenceStyle = summarySentenceStyleModule; export const typedEnum = typedEnumDefault; export const unevaluatedProperties = unevaluatedPropertiesModule; export const unusedTags = unusedTagsModule; -export const uniqueParameterRequestPropertyNames = uniqueParameterRequestPropertyNamesModule; +export const uniqueParameterRequestPropertyNames = + uniqueParameterRequestPropertyNamesModule; export const useDateBasedFormat = useDateBasedFormatModule; export const validPathSegments = validPathSegmentsModule; export const validSchemaExample = validSchemaExampleModule; diff --git a/packages/ruleset/src/rules/no-unsupported-keywords.js b/packages/ruleset/src/rules/no-unsupported-keywords.js index 436ea77ae..e4f022988 100644 --- a/packages/ruleset/src/rules/no-unsupported-keywords.js +++ b/packages/ruleset/src/rules/no-unsupported-keywords.js @@ -4,7 +4,7 @@ */ import { noUnsupportedKeywords } from '../functions/index.js'; -import spectralFormats from '@stoplight/spectral-formats' +import spectralFormats from '@stoplight/spectral-formats'; const { oas3_1 } = spectralFormats; export const description = diff --git a/packages/ruleset/src/rules/operation-responses.js b/packages/ruleset/src/rules/operation-responses.js index 9c52f72f8..24ce58c38 100644 --- a/packages/ruleset/src/rules/operation-responses.js +++ b/packages/ruleset/src/rules/operation-responses.js @@ -5,7 +5,7 @@ import { operations } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; import { truthy } from '@stoplight/spectral-functions'; -import spectralFormats from '@stoplight/spectral-formats' +import spectralFormats from '@stoplight/spectral-formats'; const { oas3_1 } = spectralFormats; export const description = diff --git a/packages/ruleset/src/rules/operationid-naming-convention.js b/packages/ruleset/src/rules/operationid-naming-convention.js index f5f071602..cb8546e43 100644 --- a/packages/ruleset/src/rules/operationid-naming-convention.js +++ b/packages/ruleset/src/rules/operationid-naming-convention.js @@ -4,7 +4,7 @@ */ import { operationIdNamingConvention } from '../functions/index.js'; -import spectralFormats from '@stoplight/spectral-formats' +import spectralFormats from '@stoplight/spectral-formats'; const { oas2, oas3 } = spectralFormats; export const description = 'Operation ids should follow naming convention'; diff --git a/packages/ruleset/src/rules/parameter-default.js b/packages/ruleset/src/rules/parameter-default.js index 743fbf72f..e655d450b 100644 --- a/packages/ruleset/src/rules/parameter-default.js +++ b/packages/ruleset/src/rules/parameter-default.js @@ -5,7 +5,7 @@ import { parameters } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; import { parameterDefault } from '../functions/index.js'; -import spectralFormats from '@stoplight/spectral-formats' +import spectralFormats from '@stoplight/spectral-formats'; const { oas2, oas3 } = spectralFormats; export const description = diff --git a/packages/ruleset/src/rules/pattern-properties.js b/packages/ruleset/src/rules/pattern-properties.js index 2ea05c119..4a80591f7 100644 --- a/packages/ruleset/src/rules/pattern-properties.js +++ b/packages/ruleset/src/rules/pattern-properties.js @@ -5,7 +5,7 @@ import { patternPropertiesCheck } from '../functions/index.js'; import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; -import spectralFormats from '@stoplight/spectral-formats' +import spectralFormats from '@stoplight/spectral-formats'; const { oas3_1 } = spectralFormats; export const description = diff --git a/packages/ruleset/src/rules/schema-keywords.js b/packages/ruleset/src/rules/schema-keywords.js index 1cc630ac4..b2e86978a 100644 --- a/packages/ruleset/src/rules/schema-keywords.js +++ b/packages/ruleset/src/rules/schema-keywords.js @@ -5,7 +5,7 @@ import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; import { allowedKeywords } from '../functions/index.js'; -import spectralFormats from '@stoplight/spectral-formats' +import spectralFormats from '@stoplight/spectral-formats'; const { oas3_1 } = spectralFormats; export const description = diff --git a/packages/ruleset/src/rules/unevaluated-properties.js b/packages/ruleset/src/rules/unevaluated-properties.js index d96132f99..0566fb5f6 100644 --- a/packages/ruleset/src/rules/unevaluated-properties.js +++ b/packages/ruleset/src/rules/unevaluated-properties.js @@ -5,7 +5,7 @@ import { unevaluatedProperties } from '../functions/index.js'; import { schemas } from '@ibm-cloud/openapi-ruleset-utilities/src/collections'; -import spectralFormats from '@stoplight/spectral-formats' +import spectralFormats from '@stoplight/spectral-formats'; const { oas3_1 } = spectralFormats; export const description = diff --git a/packages/ruleset/test/test-utils/root-document.js b/packages/ruleset/test/test-utils/root-document.js index 37c6c051c..c83594bf3 100644 --- a/packages/ruleset/test/test-utils/root-document.js +++ b/packages/ruleset/test/test-utils/root-document.js @@ -1300,7 +1300,6 @@ export const components = { headers: {}, }; - export default { openapi, info, From 81a2e994a96c6a21381071a39dd72acd6050fabd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=ADdia=20Tarcza?= <100163235+diatrcz@users.noreply.github.com> Date: Tue, 23 Jun 2026 16:25:11 +0200 Subject: [PATCH 16/16] test: modify tests from commonjs to esm - utilities MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Lídia Tarcza <100163235+diatrcz@users.noreply.github.com> --- .../collect-from-composed-schemas.test.js | 2 +- packages/utilities/test/collections.test.js | 4 +- .../test/get-examples-for-schema.test.js | 2 +- .../get-property-names-for-schema.test.js | 2 +- .../utilities/test/get-schema-type.test.js | 2 +- .../utilities/test/is-array-schema.test.js | 2 +- .../utilities/test/is-binary-schema.test.js | 2 +- .../utilities/test/is-boolean-schema.test.js | 2 +- .../utilities/test/is-byte-schema.test.js | 2 +- .../utilities/test/is-date-schema.test.js | 2 +- .../test/is-date-time-schema.test.js | 2 +- .../utilities/test/is-double-schema.test.js | 2 +- .../test/is-enumeration-schema.test.js | 2 +- .../utilities/test/is-float-schema.test.js | 2 +- .../utilities/test/is-int32-schema.test.js | 2 +- .../utilities/test/is-int64-schema.test.js | 2 +- .../utilities/test/is-integer-schema.test.js | 2 +- .../utilities/test/is-number-schema.test.js | 2 +- .../utilities/test/is-object-schema.test.js | 2 +- packages/utilities/test/is-object.test.js | 2 +- .../test/is-primitive-schema.test.js | 2 +- .../utilities/test/is-string-schema.test.js | 2 +- .../test/schema-has-constraint.test.js | 2 +- .../test/schema-has-property.test.js | 2 +- .../utilities/test/schema-is-of-type.test.js | 2 +- .../schema-loosely-has-constraint.test.js | 2 +- packages/utilities/test/schema-path.test.js | 2 +- .../test/schema-requires-property.test.js | 2 +- .../test/spectral-context-utils.test.js | 2 +- .../test/utils/all-schemas-document.js | 349 +++++++++--------- packages/utilities/test/utils/index.js | 9 +- .../utilities/test/utils/test-rule-paths.js | 4 +- packages/utilities/test/utils/test-rule.js | 4 +- .../test/validate-composed-schemas.test.js | 4 +- .../test/validate-nested-schemas.test.js | 2 +- .../test/validate-subschemas.test.js | 6 +- 36 files changed, 217 insertions(+), 221 deletions(-) diff --git a/packages/utilities/test/collect-from-composed-schemas.test.js b/packages/utilities/test/collect-from-composed-schemas.test.js index 41ca24a25..437f9cad6 100644 --- a/packages/utilities/test/collect-from-composed-schemas.test.js +++ b/packages/utilities/test/collect-from-composed-schemas.test.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -const { collectFromComposedSchemas } = require('../src'); +import { collectFromComposedSchemas } from '../src'; describe('Utility function: collectFromComposedSchemas()', () => { it('should return `[]` for `undefined` or `null`', async () => { diff --git a/packages/utilities/test/collections.test.js b/packages/utilities/test/collections.test.js index 9aab742d0..ebf0bff2f 100644 --- a/packages/utilities/test/collections.test.js +++ b/packages/utilities/test/collections.test.js @@ -3,8 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { collections } = require('../src'); -const testRulePaths = require('./utils/test-rule-paths'); +import { collections } from '../src'; +import testRulePaths from './utils/test-rule-paths'; describe('Collections', () => { describe('operations', () => { diff --git a/packages/utilities/test/get-examples-for-schema.test.js b/packages/utilities/test/get-examples-for-schema.test.js index 6b60988f9..4ce877732 100644 --- a/packages/utilities/test/get-examples-for-schema.test.js +++ b/packages/utilities/test/get-examples-for-schema.test.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -const { getExamplesForSchema } = require('../src'); +import { getExamplesForSchema } from '../src'; describe('Utility function: getExamplesForSchema()', () => { it('should return `[]` for `undefined`', async () => { diff --git a/packages/utilities/test/get-property-names-for-schema.test.js b/packages/utilities/test/get-property-names-for-schema.test.js index 105deb1dc..4c5186a2f 100644 --- a/packages/utilities/test/get-property-names-for-schema.test.js +++ b/packages/utilities/test/get-property-names-for-schema.test.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -const { getPropertyNamesForSchema } = require('../src'); +import { getPropertyNamesForSchema } from '../src'; describe('Utility function: getPropertyNamesForSchema()', () => { it('should return `[]` for `undefined`', async () => { diff --git a/packages/utilities/test/get-schema-type.test.js b/packages/utilities/test/get-schema-type.test.js index be8936144..d27f581ce 100644 --- a/packages/utilities/test/get-schema-type.test.js +++ b/packages/utilities/test/get-schema-type.test.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -const { getSchemaType, SchemaType } = require('../src'); +import { getSchemaType, SchemaType } from '../src'; /* * Most of the behavior for this utility is better tested in its more specific dependencies, diff --git a/packages/utilities/test/is-array-schema.test.js b/packages/utilities/test/is-array-schema.test.js index 7d417f63e..919a43548 100644 --- a/packages/utilities/test/is-array-schema.test.js +++ b/packages/utilities/test/is-array-schema.test.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -const { isArraySchema } = require('../src'); +import { isArraySchema } from '../src'; describe('Utility function: isArraySchema()', () => { it('should return `false` for `undefined`', async () => { diff --git a/packages/utilities/test/is-binary-schema.test.js b/packages/utilities/test/is-binary-schema.test.js index b45594bec..045319005 100644 --- a/packages/utilities/test/is-binary-schema.test.js +++ b/packages/utilities/test/is-binary-schema.test.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -const { isBinarySchema } = require('../src'); +import { isBinarySchema } from '../src'; describe('Utility function: isBinarySchema()', () => { it('should return `false` for `undefined`', async () => { diff --git a/packages/utilities/test/is-boolean-schema.test.js b/packages/utilities/test/is-boolean-schema.test.js index 6b4248f40..ef854fe1a 100644 --- a/packages/utilities/test/is-boolean-schema.test.js +++ b/packages/utilities/test/is-boolean-schema.test.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -const { isBooleanSchema } = require('../src'); +import { isBooleanSchema } from '../src'; describe('Utility function: isBooleanSchema()', () => { it('should return `false` for `undefined`', async () => { diff --git a/packages/utilities/test/is-byte-schema.test.js b/packages/utilities/test/is-byte-schema.test.js index fe0200dd7..882e12b5e 100644 --- a/packages/utilities/test/is-byte-schema.test.js +++ b/packages/utilities/test/is-byte-schema.test.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -const { isByteSchema } = require('../src'); +import { isByteSchema } from '../src'; describe('Utility function: isByteSchema()', () => { it('should return `false` for `undefined`', async () => { diff --git a/packages/utilities/test/is-date-schema.test.js b/packages/utilities/test/is-date-schema.test.js index 7ed880eba..9208c0f48 100644 --- a/packages/utilities/test/is-date-schema.test.js +++ b/packages/utilities/test/is-date-schema.test.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -const { isDateSchema } = require('../src'); +import { isDateSchema } from '../src'; describe('Utility function: isDateSchema()', () => { it('should return `false` for `undefined`', async () => { diff --git a/packages/utilities/test/is-date-time-schema.test.js b/packages/utilities/test/is-date-time-schema.test.js index 1f4c4ffda..1afc7dee1 100644 --- a/packages/utilities/test/is-date-time-schema.test.js +++ b/packages/utilities/test/is-date-time-schema.test.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -const { isDateTimeSchema } = require('../src'); +import { isDateTimeSchema } from '../src'; describe('Utility function: isDateTimeSchema()', () => { it('should return `false` for `undefined`', async () => { diff --git a/packages/utilities/test/is-double-schema.test.js b/packages/utilities/test/is-double-schema.test.js index 3ba5e2171..2ab249b7b 100644 --- a/packages/utilities/test/is-double-schema.test.js +++ b/packages/utilities/test/is-double-schema.test.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -const { isDoubleSchema } = require('../src'); +import { isDoubleSchema } from '../src'; describe('Utility function: isDoubleSchema()', () => { it('should return `false` for `undefined`', async () => { diff --git a/packages/utilities/test/is-enumeration-schema.test.js b/packages/utilities/test/is-enumeration-schema.test.js index 05ba1e86f..91252443d 100644 --- a/packages/utilities/test/is-enumeration-schema.test.js +++ b/packages/utilities/test/is-enumeration-schema.test.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -const { isEnumerationSchema } = require('../src'); +import { isEnumerationSchema } from '../src'; describe('Utility function: isEnumerationSchema()', () => { it('should return `false` for `undefined`', async () => { diff --git a/packages/utilities/test/is-float-schema.test.js b/packages/utilities/test/is-float-schema.test.js index e7af7ba53..cf0438942 100644 --- a/packages/utilities/test/is-float-schema.test.js +++ b/packages/utilities/test/is-float-schema.test.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -const { isFloatSchema } = require('../src'); +import { isFloatSchema } from '../src'; describe('Utility function: isFloatSchema()', () => { it('should return `false` for `undefined`', async () => { diff --git a/packages/utilities/test/is-int32-schema.test.js b/packages/utilities/test/is-int32-schema.test.js index c8efe2760..71b43d60c 100644 --- a/packages/utilities/test/is-int32-schema.test.js +++ b/packages/utilities/test/is-int32-schema.test.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -const { isInt32Schema } = require('../src'); +import { isInt32Schema } from '../src'; describe('Utility function: isInt32Schema()', () => { it('should return `false` for `undefined`', async () => { diff --git a/packages/utilities/test/is-int64-schema.test.js b/packages/utilities/test/is-int64-schema.test.js index 8ccffe57e..75853b16c 100644 --- a/packages/utilities/test/is-int64-schema.test.js +++ b/packages/utilities/test/is-int64-schema.test.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -const { isInt64Schema } = require('../src'); +import { isInt64Schema } from '../src'; describe('Utility function: isInt64Schema()', () => { it('should return `false` for `undefined`', async () => { diff --git a/packages/utilities/test/is-integer-schema.test.js b/packages/utilities/test/is-integer-schema.test.js index c683af81a..7c7362f89 100644 --- a/packages/utilities/test/is-integer-schema.test.js +++ b/packages/utilities/test/is-integer-schema.test.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -const { isIntegerSchema } = require('../src'); +import { isIntegerSchema } from '../src'; describe('Utility function: isIntegerSchema()', () => { it('should return `false` for `undefined`', async () => { diff --git a/packages/utilities/test/is-number-schema.test.js b/packages/utilities/test/is-number-schema.test.js index 659d510b6..f0f9071e0 100644 --- a/packages/utilities/test/is-number-schema.test.js +++ b/packages/utilities/test/is-number-schema.test.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -const { isNumberSchema } = require('../src'); +import { isNumberSchema } from '../src'; describe('Utility function: isNumberSchema()', () => { it('should return `false` for `undefined`', async () => { diff --git a/packages/utilities/test/is-object-schema.test.js b/packages/utilities/test/is-object-schema.test.js index a7524fcf7..ff889ca6a 100644 --- a/packages/utilities/test/is-object-schema.test.js +++ b/packages/utilities/test/is-object-schema.test.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -const { isObjectSchema } = require('../src'); +import { isObjectSchema } from '../src'; describe('Utility function: isObjectSchema()', () => { it('should return `false` for `undefined`', async () => { diff --git a/packages/utilities/test/is-object.test.js b/packages/utilities/test/is-object.test.js index cf65080ec..a49f32a19 100644 --- a/packages/utilities/test/is-object.test.js +++ b/packages/utilities/test/is-object.test.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -const { isObject } = require('../src'); +import { isObject } from '../src'; describe('Utility function: isObject()', () => { it('should return `false` for `undefined`', async () => { diff --git a/packages/utilities/test/is-primitive-schema.test.js b/packages/utilities/test/is-primitive-schema.test.js index 0a8067125..7db719117 100644 --- a/packages/utilities/test/is-primitive-schema.test.js +++ b/packages/utilities/test/is-primitive-schema.test.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -const { isPrimitiveSchema } = require('../src'); +import { isPrimitiveSchema } from '../src'; describe('Utility function: isPrimitiveSchema()', () => { it('should return `false` for `undefined`', async () => { diff --git a/packages/utilities/test/is-string-schema.test.js b/packages/utilities/test/is-string-schema.test.js index 27064e342..30637c1ef 100644 --- a/packages/utilities/test/is-string-schema.test.js +++ b/packages/utilities/test/is-string-schema.test.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -const { isStringSchema } = require('../src'); +import { isStringSchema } from '../src'; describe('Utility function: isStringSchema()', () => { it('should return `false` for `undefined`', async () => { diff --git a/packages/utilities/test/schema-has-constraint.test.js b/packages/utilities/test/schema-has-constraint.test.js index 4d924278a..c740e25fb 100644 --- a/packages/utilities/test/schema-has-constraint.test.js +++ b/packages/utilities/test/schema-has-constraint.test.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -const { schemaHasConstraint } = require('../src'); +import { schemaHasConstraint } from '../src'; const fredIsNull = s => s.fred === null; diff --git a/packages/utilities/test/schema-has-property.test.js b/packages/utilities/test/schema-has-property.test.js index 911374194..8fd09cd34 100644 --- a/packages/utilities/test/schema-has-property.test.js +++ b/packages/utilities/test/schema-has-property.test.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -const { schemaHasProperty } = require('../src'); +import { schemaHasProperty } from '../src'; describe('Utility function: schemaHasProperty()', () => { it('should return `false` for `undefined`', async () => { diff --git a/packages/utilities/test/schema-is-of-type.test.js b/packages/utilities/test/schema-is-of-type.test.js index e0037f3c5..d8f748780 100644 --- a/packages/utilities/test/schema-is-of-type.test.js +++ b/packages/utilities/test/schema-is-of-type.test.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -const { schemaIsOfType } = require('../src'); +import { schemaIsOfType } from '../src'; describe('Utility function: schemaIsOfType()', () => { describe('Should return true', () => { diff --git a/packages/utilities/test/schema-loosely-has-constraint.test.js b/packages/utilities/test/schema-loosely-has-constraint.test.js index 103242c90..49a4b2c20 100644 --- a/packages/utilities/test/schema-loosely-has-constraint.test.js +++ b/packages/utilities/test/schema-loosely-has-constraint.test.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -const { schemaLooselyHasConstraint } = require('../src'); +import { schemaLooselyHasConstraint } from '../src'; const fredIsNull = s => s.fred === null; diff --git a/packages/utilities/test/schema-path.test.js b/packages/utilities/test/schema-path.test.js index 90fd9cf32..19485f18a 100644 --- a/packages/utilities/test/schema-path.test.js +++ b/packages/utilities/test/schema-path.test.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -const SchemaPath = require('../src/utils/schema-path'); +import SchemaPath from '../src/utils/schema-path'; describe('Utility class: SchemaPath', () => { describe('physical path is preserved', () => { diff --git a/packages/utilities/test/schema-requires-property.test.js b/packages/utilities/test/schema-requires-property.test.js index 0b8f36b32..3e1e5dd83 100644 --- a/packages/utilities/test/schema-requires-property.test.js +++ b/packages/utilities/test/schema-requires-property.test.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -const { schemaRequiresProperty } = require('../src'); +import { schemaRequiresProperty } from '../src'; describe('Utility function: schemaRequiresProperty()', () => { it('should return `false` for `undefined`', async () => { diff --git a/packages/utilities/test/spectral-context-utils.test.js b/packages/utilities/test/spectral-context-utils.test.js index d4b89c80d..6c74675e7 100644 --- a/packages/utilities/test/spectral-context-utils.test.js +++ b/packages/utilities/test/spectral-context-utils.test.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -const { getNodes, getResolvedSpec, getUnresolvedSpec } = require('../src'); +import { getNodes, getResolvedSpec, getUnresolvedSpec } from '../src'; describe('Utility functions: Spectral Context Utils', () => { const mockSpectralContextObject = { diff --git a/packages/utilities/test/utils/all-schemas-document.js b/packages/utilities/test/utils/all-schemas-document.js index bf1b353e3..21a7c35a1 100644 --- a/packages/utilities/test/utils/all-schemas-document.js +++ b/packages/utilities/test/utils/all-schemas-document.js @@ -4,62 +4,59 @@ */ // NOTE: Duplicated from ruleset package. Need to revisit -module.exports = { - openapi: '3.0.2', - info: { - title: 'Subschema examples', - description: - 'A collection of schemas with various kinds of subschemas for testing.', - version: '0.0.1', - contact: { - email: 'example@example.com', - }, +const openapi = '3.0.2'; +const info = { + title: 'Subschema examples', + description: 'A collection of schemas with various kinds of subschemas for testing.', + version: '0.0.1', + contact: { + email: 'example@example.com', + }, +}; +const tags = [ + { + name: 'Index', + }, +]; +const servers = [ + { + url: '/api/v3', }, - tags: [ - { - name: 'Index', - }, - ], - servers: [ - { - url: '/api/v3', - }, - ], - paths: { - '/schema': { - get: { - tags: ['Index'], - summary: 'Get the index', - description: 'Get the index.', - operationId: 'get_index', - responses: { - 200: { - description: "Here's the index.", - content: { - 'application/json': { - schema: { - $ref: '#/components/schemas/Index', - }, +]; +const paths = { + '/schema': { + get: { + tags: ['Index'], + summary: 'Get the index', + description: 'Get the index.', + operationId: 'get_index', + responses: { + 200: { + description: "Here's the index.", + content: { + 'application/json': { + schema: { + $ref: '#/components/schemas/Index', }, }, }, }, }, }, - '/every_flavor': { - get: { - tags: ['Index'], - summary: 'Get every flavor', - description: 'Get every flavor.', - operationId: 'get_every_flavor', - responses: { - 200: { - description: "Here's every flavor.", - content: { - 'application/json': { - schema: { - $ref: '#/components/schemas/EveryFlavor', - }, + }, + '/every_flavor': { + get: { + tags: ['Index'], + summary: 'Get every flavor', + description: 'Get every flavor.', + operationId: 'get_every_flavor', + responses: { + 200: { + description: "Here's every flavor.", + content: { + 'application/json': { + schema: { + $ref: '#/components/schemas/EveryFlavor', }, }, }, @@ -67,150 +64,152 @@ module.exports = { }, }, }, - components: { - schemas: { - Index: { - type: 'object', - properties: { - schema_with_property_schema: { - $ref: '#/components/schemas/SchemaWithPropertySchema', - }, - schema_with_additional_properties_schema: { - $ref: '#/components/schemas/SchemaWithAdditionalPropertiesSchema', - }, - schema_with_items_schema: { - $ref: '#/components/schemas/SchemaWithItemsSchema', - }, - schema_with_all_of_schema: { - $ref: '#/components/schemas/SchemaWithAllOfSchema', - }, - schema_with_one_of_schema: { - $ref: '#/components/schemas/SchemaWithOneOfSchema', - }, - schema_with_any_of_schema: { - $ref: '#/components/schemas/SchemaWithAnyOfSchema', - }, - schema_with_not_schema: { - $ref: '#/components/schemas/SchemaWithNotSchema', - }, +}; +const components = { + schemas: { + Index: { + type: 'object', + properties: { + schema_with_property_schema: { + $ref: '#/components/schemas/SchemaWithPropertySchema', }, - }, - EveryFlavor: { - properties: { - property_schema: { - $ref: '#/components/schemas/SchemaWithPropertySchema', - }, + schema_with_additional_properties_schema: { + $ref: '#/components/schemas/SchemaWithAdditionalPropertiesSchema', }, - additionalProperties: { - $ref: '#/components/schemas/AdditionalPropertiesSchema', + schema_with_items_schema: { + $ref: '#/components/schemas/SchemaWithItemsSchema', }, - items: { - $ref: '#/components/schemas/ItemsSchema', + schema_with_all_of_schema: { + $ref: '#/components/schemas/SchemaWithAllOfSchema', }, - allOf: [ - { - $ref: '#/components/schemas/AllOfSchema', - }, - ], - oneOf: [ - { - $ref: '#/components/schemas/OneOfSchema', - }, - ], - anyOf: [ - { - $ref: '#/components/schemas/AnyOfSchema', - }, - ], - not: { - $ref: '#/components/schemas/NotSchema', + schema_with_one_of_schema: { + $ref: '#/components/schemas/SchemaWithOneOfSchema', }, - }, - SchemaWithPropertySchema: { - type: 'object', - properties: { - property_schema: { - $ref: '#/components/schemas/PropertySchema', - }, + schema_with_any_of_schema: { + $ref: '#/components/schemas/SchemaWithAnyOfSchema', }, - }, - PropertySchema: { - type: 'string', - description: - 'This schema is reachable from `EveryFlavor` and `SchemaWithPropertySchema`.', - }, - SchemaWithAdditionalPropertiesSchema: { - type: 'object', - additionalProperties: { - $ref: '#/components/schemas/AdditionalPropertiesSchema', + schema_with_not_schema: { + $ref: '#/components/schemas/SchemaWithNotSchema', }, }, - AdditionalPropertiesSchema: { - type: 'string', - description: - 'This schema is reachable from `EveryFlavor` and `SchemaWithAdditionalPropertiesSchema`.', - }, - SchemaWithItemsSchema: { - type: 'array', - items: { - $ref: '#/components/schemas/ItemsSchema', + }, + EveryFlavor: { + properties: { + property_schema: { + $ref: '#/components/schemas/SchemaWithPropertySchema', }, }, - ItemsSchema: { - type: 'string', - description: - 'This schema is reachable from `EveryFlavor` and `SchemaWithItemsSchema`.', - }, - SchemaWithAllOfSchema: { - type: 'string', - allOf: [ - { - $ref: '#/components/schemas/AllOfSchema', - }, - ], + additionalProperties: { + $ref: '#/components/schemas/AdditionalPropertiesSchema', }, - AllOfSchema: { - type: 'string', - description: - 'This schema is reachable from `EveryFlavor` and `SchemaWithAllOfSchema`.', + items: { + $ref: '#/components/schemas/ItemsSchema', }, - SchemaWithOneOfSchema: { - type: 'string', - oneOf: [ - { - $ref: '#/components/schemas/OneOfSchema', - }, - ], + allOf: [ + { + $ref: '#/components/schemas/AllOfSchema', + }, + ], + oneOf: [ + { + $ref: '#/components/schemas/OneOfSchema', + }, + ], + anyOf: [ + { + $ref: '#/components/schemas/AnyOfSchema', + }, + ], + not: { + $ref: '#/components/schemas/NotSchema', }, - OneOfSchema: { - type: 'string', - description: - 'This schema is reachable from `EveryFlavor` and `SchemaWithOneOfSchema`.', + }, + SchemaWithPropertySchema: { + type: 'object', + properties: { + property_schema: { + $ref: '#/components/schemas/PropertySchema', + }, }, - SchemaWithAnyOfSchema: { - type: 'string', - anyOf: [ - { - $ref: '#/components/schemas/AnyOfSchema', - }, - ], + }, + PropertySchema: { + type: 'string', + description: 'This schema is reachable from `EveryFlavor` and `SchemaWithPropertySchema`.', + }, + SchemaWithAdditionalPropertiesSchema: { + type: 'object', + additionalProperties: { + $ref: '#/components/schemas/AdditionalPropertiesSchema', }, - AnyOfSchema: { - type: 'string', - description: - 'This schema is reachable from `EveryFlavor` and `SchemaWithAnyOfSchema`.', + }, + AdditionalPropertiesSchema: { + type: 'string', + description: 'This schema is reachable from `EveryFlavor` and `SchemaWithAdditionalPropertiesSchema`.', + }, + SchemaWithItemsSchema: { + type: 'array', + items: { + $ref: '#/components/schemas/ItemsSchema', }, - SchemaWithNotSchema: { - type: 'string', - not: { - $ref: '#/components/schemas/NotSchema', + }, + ItemsSchema: { + type: 'string', + description: 'This schema is reachable from `EveryFlavor` and `SchemaWithItemsSchema`.', + }, + SchemaWithAllOfSchema: { + type: 'string', + allOf: [ + { + $ref: '#/components/schemas/AllOfSchema', }, - }, - NotSchema: { - type: 'string', - description: - 'This schema is reachable from `EveryFlavor` and `SchemaWithNotSchema`.', + ], + }, + AllOfSchema: { + type: 'string', + description: 'This schema is reachable from `EveryFlavor` and `SchemaWithAllOfSchema`.', + }, + SchemaWithOneOfSchema: { + type: 'string', + oneOf: [ + { + $ref: '#/components/schemas/OneOfSchema', + }, + ], + }, + OneOfSchema: { + type: 'string', + description: 'This schema is reachable from `EveryFlavor` and `SchemaWithOneOfSchema`.', + }, + SchemaWithAnyOfSchema: { + type: 'string', + anyOf: [ + { + $ref: '#/components/schemas/AnyOfSchema', + }, + ], + }, + AnyOfSchema: { + type: 'string', + description: 'This schema is reachable from `EveryFlavor` and `SchemaWithAnyOfSchema`.', + }, + SchemaWithNotSchema: { + type: 'string', + not: { + $ref: '#/components/schemas/NotSchema', }, }, + NotSchema: { + type: 'string', + description: 'This schema is reachable from `EveryFlavor` and `SchemaWithNotSchema`.', + }, }, }; + +export default { + openapi, + info, + tags, + servers, + paths, + components, +}; diff --git a/packages/utilities/test/utils/index.js b/packages/utilities/test/utils/index.js index 979d1e422..6c88ebcaa 100644 --- a/packages/utilities/test/utils/index.js +++ b/packages/utilities/test/utils/index.js @@ -4,10 +4,7 @@ */ // NOTE: Duplicated from ruleset package. Need to revisit -const allSchemasDocument = require('./all-schemas-document'); -const testRule = require('./test-rule'); +import allSchemasDocument from './all-schemas-document'; +import testRule from './test-rule'; -module.exports = { - allSchemasDocument, - testRule, -}; +export { allSchemasDocument, testRule }; diff --git a/packages/utilities/test/utils/test-rule-paths.js b/packages/utilities/test/utils/test-rule-paths.js index 8e07383c8..5f79a0271 100644 --- a/packages/utilities/test/utils/test-rule-paths.js +++ b/packages/utilities/test/utils/test-rule-paths.js @@ -3,9 +3,9 @@ * SPDX-License-Identifier: Apache2.0 */ -const testRule = require('./test-rule'); +import testRule from './test-rule'; -module.exports = async (given, doc) => { +export default async (given, doc) => { const visitedPaths = []; const rule = { given, diff --git a/packages/utilities/test/utils/test-rule.js b/packages/utilities/test/utils/test-rule.js index 8b32867bb..70b31c29d 100644 --- a/packages/utilities/test/utils/test-rule.js +++ b/packages/utilities/test/utils/test-rule.js @@ -4,9 +4,9 @@ */ // NOTE: Duplicated from ruleset package. Need to revisit -const { Spectral } = require('@stoplight/spectral-core'); +import { Spectral } from '@stoplight/spectral-core'; -module.exports = async (rule, doc) => { +export default async (rule, doc) => { const spectral = new Spectral(); spectral.setRuleset({ diff --git a/packages/utilities/test/validate-composed-schemas.test.js b/packages/utilities/test/validate-composed-schemas.test.js index 6c71917bb..64b5ea692 100644 --- a/packages/utilities/test/validate-composed-schemas.test.js +++ b/packages/utilities/test/validate-composed-schemas.test.js @@ -3,8 +3,8 @@ * SPDX-License-Identifier: Apache2.0 */ -const { validateComposedSchemas } = require('../src'); -const SchemaPath = require('../src/utils/schema-path'); +import { validateComposedSchemas } from '../src'; +import SchemaPath from '../src/utils/schema-path'; describe('Utility function: validateComposedSchemas()', () => { it('should validate a simple schema by default', async () => { diff --git a/packages/utilities/test/validate-nested-schemas.test.js b/packages/utilities/test/validate-nested-schemas.test.js index 61c423040..b227eda89 100644 --- a/packages/utilities/test/validate-nested-schemas.test.js +++ b/packages/utilities/test/validate-nested-schemas.test.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache2.0 */ -const { validateNestedSchemas } = require('../src'); +import { validateNestedSchemas } from '../src'; describe('Utility function: validateNestedSchemas()', () => { it('should validate a simple schema by default', async () => { diff --git a/packages/utilities/test/validate-subschemas.test.js b/packages/utilities/test/validate-subschemas.test.js index 42d9845c7..1f65c3b1b 100644 --- a/packages/utilities/test/validate-subschemas.test.js +++ b/packages/utilities/test/validate-subschemas.test.js @@ -3,9 +3,9 @@ * SPDX-License-Identifier: Apache2.0 */ -const { allSchemasDocument, testRule } = require('./utils'); -const { validateSubschemas } = require('../src'); -const { schemas } = require('../src/collections'); +import { allSchemasDocument, testRule } from './utils'; +import { validateSubschemas } from '../src'; +import { schemas } from '../src/collections'; describe('Utility: validateSubschemas', () => { const visitedPaths = [];