diff --git a/emanifest-js/.npmignore b/emanifest-js/.npmignore index 31d64385..ee42a53e 100644 --- a/emanifest-js/.npmignore +++ b/emanifest-js/.npmignore @@ -2,15 +2,14 @@ .vscode/ src/ **/*.tgz -**/tests/ docs/ .github/ tsconfig.json tslint.json -.prettierrc -.env -.eslintrc.json +.prettierrc.json +**/.env +eslint.config.js .gitignore -*.txt -*.bak -*.zip +**/*.txt +**/*.bak +**/*.zip diff --git a/emanifest-js/.prettierrc b/emanifest-js/.prettierrc deleted file mode 100644 index 4ddba9ab..00000000 --- a/emanifest-js/.prettierrc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "printWidth": 120, - "trailingComma": "all", - "singleQuote": true -} \ No newline at end of file diff --git a/emanifest-js/.prettierrc.json b/emanifest-js/.prettierrc.json new file mode 100644 index 00000000..280cb148 --- /dev/null +++ b/emanifest-js/.prettierrc.json @@ -0,0 +1,21 @@ +{ + "tabWidth": 2, + "useTabs": false, + "printWidth": 100, + "singleQuote": true, + "semi": true, + "bracketSpacing": true, + "bracketSameLine": false, + "trailingComma": "es5", + "overrides": [ + { + "files": [ + "*.yaml", + "*.yml" + ], + "options": { + "singleQuote": true + } + } + ] +} diff --git a/emanifest-js/eslint.config.js b/emanifest-js/eslint.config.js new file mode 100644 index 00000000..471f3b10 --- /dev/null +++ b/emanifest-js/eslint.config.js @@ -0,0 +1,40 @@ +import pluginJs from '@eslint/js'; +import tsEslint from 'typescript-eslint'; +import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended'; + +export default [ + pluginJs.configs.recommended, + ...tsEslint.configs.recommended, + ...tsEslint.configs.stylistic, + eslintPluginPrettierRecommended, + { + name: 'ignore-outputs', + ignores: ['**/build/', '**/dist/', '**/node_modules/', '**/.next/'], + }, + { + name: 'ts-migration-relax', + files: ['**/*.{ts,tsx}'], + rules: { + '@typescript-eslint/no-explicit-any': 'off', + '@typescript-eslint/no-empty-interface': 'off', + '@typescript-eslint/no-empty-function': 'off', + }, + }, + { + name: 'ts-unused-vars', + rules: { + '@typescript-eslint/no-unused-vars': [ + 'error', + { + args: 'all', + argsIgnorePattern: '^_', + caughtErrors: 'all', + caughtErrorsIgnorePattern: '^_', + destructuredArrayIgnorePattern: '^_', + varsIgnorePattern: '^_', + // ignoreRestSiblings: true, - if you want to ignore unused rest siblings + }, + ], + }, + }, +]; diff --git a/emanifest-js/package-lock.json b/emanifest-js/package-lock.json index 5a24abd5..d8b43549 100644 --- a/emanifest-js/package-lock.json +++ b/emanifest-js/package-lock.json @@ -1,23 +1,30 @@ { "name": "emanifest", - "version": "0.3.1", + "version": "0.3.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "emanifest", - "version": "0.3.1", + "version": "0.3.2", "license": "MIT", "dependencies": { "axios": "^1.7.5" }, "devDependencies": { + "@eslint/js": "^9.9.1", + "@types/eslint__js": "^8.42.3", "@types/jest": "^29.5.12", "@types/node": "^22.5.1", + "eslint": "^9.9.1", + "eslint-config-prettier": "^9.1.0", + "eslint-plugin-prettier": "^5.2.1", "jest": "^29.7.0", "msw": "^2.3.5", + "prettier": "3.3.3", "ts-jest": "^29.2.5", "typescript": "^5.5.4", + "typescript-eslint": "^8.3.0", "vite": "^5.4.2", "vite-plugin-dts": "^4.0.3", "vitest": "^2.0.5" @@ -1012,6 +1019,189 @@ "node": ">=12" } }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", + "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", + "dev": true, + "license": "MIT", + "dependencies": { + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.11.0", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.11.0.tgz", + "integrity": "sha512-G/M/tIiMrTAxEWRfLfQJMmGNX28IxBg4PBz8XqQhqUHLFI6TL2htpIB1iQCj144V5ee/JaKyT9/WZ0MGZWfA7A==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/config-array": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.18.0.tgz", + "integrity": "sha512-fTxvnS1sRMu3+JjXwJG0j/i4RT9u4qJ+lqS/yCGap4lH4zZGzQ7tu+xZqQmcMZq5OBZDL4QRxQzRjkWcGt8IVw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/object-schema": "^2.1.4", + "debug": "^4.3.1", + "minimatch": "^3.1.2" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.1.0.tgz", + "integrity": "sha512-4Bfj15dVJdoy3RfZmmo86RK1Fwzn6SstsvK9JS+BaVKqC6QQQQyXekNaC+g+LKNgkQ+2VhGAzm6hO40AhMR3zQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^10.0.1", + "globals": "^14.0.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/eslintrc/node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/@eslint/eslintrc/node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true, + "license": "Python-2.0" + }, + "node_modules/@eslint/eslintrc/node_modules/globals": { + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", + "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@eslint/eslintrc/node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/@eslint/eslintrc/node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@eslint/js": { + "version": "9.9.1", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.9.1.tgz", + "integrity": "sha512-xIDQRsfg5hNBqHz04H1R3scSVwmI+KUbqjsQKHKQ1DAUSaUjYPReZZmS/5PNiKu1fUvzDd6H7DEDKACSEhu+TQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/object-schema": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.4.tgz", + "integrity": "sha512-BsWiH1yFGjXXS2yvrf5LyuoSIIbPrGUWob917o+BTKuZ7qJdxX8aJLRxs1fS9n6r7vESrq1OUqb68dANcFXuQQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "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": "Apache-2.0", + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/retry": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.3.0.tgz", + "integrity": "sha512-d2CGZR2o7fS6sWB7DG/3a95bGKQyHMACZ5aW8qGkkqQpUoZV6C0X7Pc7l4ZNMZkfNBf4VWNe9E1jRsf0G146Ew==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, "node_modules/@inquirer/confirm": { "version": "3.1.22", "resolved": "https://registry.npmjs.org/@inquirer/confirm/-/confirm-3.1.22.tgz", @@ -1626,6 +1816,44 @@ "node": ">=18" } }, + "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==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "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==", + "dev": true, + "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==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/@open-draft/deferred-promise": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/@open-draft/deferred-promise/-/deferred-promise-2.2.0.tgz", @@ -1651,6 +1879,19 @@ "dev": true, "license": "MIT" }, + "node_modules/@pkgr/core": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.1.1.tgz", + "integrity": "sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.20.0 || ^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts" + } + }, "node_modules/@rollup/pluginutils": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.1.0.tgz", @@ -2121,6 +2362,27 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/eslint": { + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-9.6.1.tgz", + "integrity": "sha512-FXx2pKgId/WyYo2jXw63kk7/+TY7u7AziEJxJAnSFzHlqTAS3Ync6SvgYAN/k4/PQpnnVuzoMuVnByKK2qp0ag==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "*", + "@types/json-schema": "*" + } + }, + "node_modules/@types/eslint__js": { + "version": "8.42.3", + "resolved": "https://registry.npmjs.org/@types/eslint__js/-/eslint__js-8.42.3.tgz", + "integrity": "sha512-alfG737uhmPdnvkrLdZLcEKJ/B8s9Y4hrZ+YAdzUeoArBlSUERA2E87ROfOaS4jd/C45fzOoZzidLc1IPwLqOw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/eslint": "*" + } + }, "node_modules/@types/estree": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", @@ -2173,6 +2435,13 @@ "pretty-format": "^29.0.0" } }, + "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==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/mute-stream": { "version": "0.0.4", "resolved": "https://registry.npmjs.org/@types/mute-stream/-/mute-stream-0.0.4.tgz", @@ -2235,6 +2504,235 @@ "integrity": "sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==", "dev": true }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.3.0.tgz", + "integrity": "sha512-FLAIn63G5KH+adZosDYiutqkOkYEx0nvcwNNfJAf+c7Ae/H35qWwTYvPZUKFj5AS+WfHG/WJJfWnDnyNUlp8UA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/regexpp": "^4.10.0", + "@typescript-eslint/scope-manager": "8.3.0", + "@typescript-eslint/type-utils": "8.3.0", + "@typescript-eslint/utils": "8.3.0", + "@typescript-eslint/visitor-keys": "8.3.0", + "graphemer": "^1.4.0", + "ignore": "^5.3.1", + "natural-compare": "^1.4.0", + "ts-api-utils": "^1.3.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^8.0.0 || ^8.0.0-alpha.0", + "eslint": "^8.57.0 || ^9.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/parser": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.3.0.tgz", + "integrity": "sha512-h53RhVyLu6AtpUzVCYLPhZGL5jzTD9fZL+SYf/+hYOx2bDkyQXztXSc4tbvKYHzfMXExMLiL9CWqJmVz6+78IQ==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "@typescript-eslint/scope-manager": "8.3.0", + "@typescript-eslint/types": "8.3.0", + "@typescript-eslint/typescript-estree": "8.3.0", + "@typescript-eslint/visitor-keys": "8.3.0", + "debug": "^4.3.4" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.3.0.tgz", + "integrity": "sha512-mz2X8WcN2nVu5Hodku+IR8GgCOl4C0G/Z1ruaWN4dgec64kDBabuXyPAr+/RgJtumv8EEkqIzf3X2U5DUKB2eg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.3.0", + "@typescript-eslint/visitor-keys": "8.3.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/type-utils": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.3.0.tgz", + "integrity": "sha512-wrV6qh//nLbfXZQoj32EXKmwHf4b7L+xXLrP3FZ0GOUU72gSvLjeWUl5J5Ue5IwRxIV1TfF73j/eaBapxx99Lg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/typescript-estree": "8.3.0", + "@typescript-eslint/utils": "8.3.0", + "debug": "^4.3.4", + "ts-api-utils": "^1.3.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/types": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.3.0.tgz", + "integrity": "sha512-y6sSEeK+facMaAyixM36dQ5NVXTnKWunfD1Ft4xraYqxP0lC0POJmIaL/mw72CUMqjY9qfyVfXafMeaUj0noWw==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.3.0.tgz", + "integrity": "sha512-Mq7FTHl0R36EmWlCJWojIC1qn/ZWo2YiWYc1XVtasJ7FIgjo0MVv9rZWXEE7IK2CGrtwe1dVOxWwqXUdNgfRCA==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "@typescript-eslint/types": "8.3.0", + "@typescript-eslint/visitor-keys": "8.3.0", + "debug": "^4.3.4", + "fast-glob": "^3.3.2", + "is-glob": "^4.0.3", + "minimatch": "^9.0.4", + "semver": "^7.6.0", + "ts-api-utils": "^1.3.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@typescript-eslint/utils": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.3.0.tgz", + "integrity": "sha512-F77WwqxIi/qGkIGOGXNBLV7nykwfjLsdauRB/DOFPdv6LTF3BHHkBpq81/b5iMPSF055oO2BiivDJV4ChvNtXA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.4.0", + "@typescript-eslint/scope-manager": "8.3.0", + "@typescript-eslint/types": "8.3.0", + "@typescript-eslint/typescript-estree": "8.3.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0" + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.3.0.tgz", + "integrity": "sha512-RmZwrTbQ9QveF15m/Cl28n0LXD6ea2CjkhH5rQ55ewz3H24w+AMCJHPVYaZ8/0HoG8Z3cLLFFycRXxeO2tz9FA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.3.0", + "eslint-visitor-keys": "^3.4.3" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/visitor-keys/node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, "node_modules/@vitest/expect": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-2.0.5.tgz", @@ -2468,6 +2966,16 @@ "node": ">=0.4.0" } }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, "node_modules/ajv": { "version": "8.12.0", "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", @@ -3139,6 +3647,13 @@ "node": ">=6" } }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true, + "license": "MIT" + }, "node_modules/deepmerge": { "version": "4.3.1", "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", @@ -3300,6 +3815,244 @@ "node": ">=8" } }, + "node_modules/eslint": { + "version": "9.9.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.9.1.tgz", + "integrity": "sha512-dHvhrbfr4xFQ9/dq+jcVneZMyRYLjggWjk6RVsIiHsP8Rz6yZ8LvZ//iU4TrZF+SXWG+JkNF2OyiZRvzgRDqMg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.11.0", + "@eslint/config-array": "^0.18.0", + "@eslint/eslintrc": "^3.1.0", + "@eslint/js": "9.9.1", + "@humanwhocodes/module-importer": "^1.0.1", + "@humanwhocodes/retry": "^0.3.0", + "@nodelib/fs.walk": "^1.2.8", + "ajv": "^6.12.4", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^8.0.2", + "eslint-visitor-keys": "^4.0.0", + "espree": "^10.1.0", + "esquery": "^1.5.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^8.0.0", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "is-path-inside": "^3.0.3", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3", + "strip-ansi": "^6.0.1", + "text-table": "^0.2.0" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://eslint.org/donate" + }, + "peerDependencies": { + "jiti": "*" + }, + "peerDependenciesMeta": { + "jiti": { + "optional": true + } + } + }, + "node_modules/eslint-config-prettier": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.1.0.tgz", + "integrity": "sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==", + "dev": true, + "license": "MIT", + "bin": { + "eslint-config-prettier": "bin/cli.js" + }, + "peerDependencies": { + "eslint": ">=7.0.0" + } + }, + "node_modules/eslint-plugin-prettier": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.2.1.tgz", + "integrity": "sha512-gH3iR3g4JfF+yYPaJYkN7jEl9QbweL/YfkoRlNnuIEHEz1vHVlCmWOS+eGGiRuzHQXdJFCOTxRgvju9b8VUmrw==", + "dev": true, + "license": "MIT", + "dependencies": { + "prettier-linter-helpers": "^1.0.0", + "synckit": "^0.9.1" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint-plugin-prettier" + }, + "peerDependencies": { + "@types/eslint": ">=8.0.0", + "eslint": ">=8.0.0", + "eslint-config-prettier": "*", + "prettier": ">=3.0.0" + }, + "peerDependenciesMeta": { + "@types/eslint": { + "optional": true + }, + "eslint-config-prettier": { + "optional": true + } + } + }, + "node_modules/eslint-scope": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.0.2.tgz", + "integrity": "sha512-6E4xmrTw5wtxnLA5wYL3WDfhZ/1bUBGOXV0zQvVRDOtrR8D0p6W7fs3JweNYhwRYeGvd/1CKX2se0/2s7Q/nJA==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.0.0.tgz", + "integrity": "sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint/node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/eslint/node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true, + "license": "MIT" + }, + "node_modules/eslint/node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/espree": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.1.0.tgz", + "integrity": "sha512-M1M6CpiE6ffoigIOWYO9UDP8TMUw9kqb21tf+08IgDYjCsOvCuDt4jQcZmoYxx+w7zlKw9/N0KXfto+I8/FrXA==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "acorn": "^8.12.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^4.0.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, "node_modules/esprima": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", @@ -3313,6 +4066,42 @@ "node": ">=4" } }, + "node_modules/esquery": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", + "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, "node_modules/estree-walker": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", @@ -3320,6 +4109,16 @@ "dev": true, "license": "MIT" }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/execa": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", @@ -3375,7 +4174,44 @@ "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", "dev": true, - "license": "MIT" + "license": "MIT" + }, + "node_modules/fast-diff": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.3.0.tgz", + "integrity": "sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/fast-glob": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fast-glob/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } }, "node_modules/fast-json-stable-stringify": { "version": "2.1.0", @@ -3383,6 +4219,23 @@ "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", "dev": true }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true, + "license": "MIT" + }, + "node_modules/fastq": { + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", + "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", + "dev": true, + "license": "ISC", + "dependencies": { + "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", @@ -3393,6 +4246,19 @@ "bser": "2.1.1" } }, + "node_modules/file-entry-cache": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", + "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "flat-cache": "^4.0.0" + }, + "engines": { + "node": ">=16.0.0" + } + }, "node_modules/filelist": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.4.tgz", @@ -3452,6 +4318,27 @@ "node": ">=8" } }, + "node_modules/flat-cache": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", + "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", + "dev": true, + "license": "MIT", + "dependencies": { + "flatted": "^3.2.9", + "keyv": "^4.5.4" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/flatted": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz", + "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==", + "dev": true, + "license": "ISC" + }, "node_modules/follow-redirects": { "version": "1.15.6", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz", @@ -3601,6 +4488,19 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, "node_modules/globals": { "version": "11.12.0", "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", @@ -3617,6 +4517,13 @@ "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", "dev": true }, + "node_modules/graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", + "dev": true, + "license": "MIT" + }, "node_modules/graphql": { "version": "16.9.0", "resolved": "https://registry.npmjs.org/graphql/-/graphql-16.9.0.tgz", @@ -3683,6 +4590,43 @@ "node": ">=10.17.0" } }, + "node_modules/ignore": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "license": "MIT", + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/import-fresh/node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, "node_modules/import-lazy": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-4.0.0.tgz", @@ -3761,6 +4705,16 @@ "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==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "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", @@ -3780,6 +4734,19 @@ "node": ">=6" } }, + "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==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/is-node-process": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/is-node-process/-/is-node-process-1.2.0.tgz", @@ -3797,6 +4764,16 @@ "node": ">=0.12.0" } }, + "node_modules/is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/is-stream": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", @@ -4536,6 +5513,13 @@ "node": ">=4" } }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true, + "license": "MIT" + }, "node_modules/json-parse-even-better-errors": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", @@ -4550,6 +5534,13 @@ "dev": true, "license": "MIT" }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true, + "license": "MIT" + }, "node_modules/json5": { "version": "2.2.3", "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", @@ -4572,6 +5563,16 @@ "graceful-fs": "^4.1.6" } }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "license": "MIT", + "dependencies": { + "json-buffer": "3.0.1" + } + }, "node_modules/kleur": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", @@ -4598,6 +5599,20 @@ "node": ">=6" } }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/lines-and-columns": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", @@ -4646,6 +5661,13 @@ "integrity": "sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==", "dev": true }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true, + "license": "MIT" + }, "node_modules/loupe": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.1.1.tgz", @@ -4715,6 +5737,16 @@ "dev": true, "license": "MIT" }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, "node_modules/micromatch": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", @@ -4949,6 +5981,24 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/optionator": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", + "dev": true, + "license": "MIT", + "dependencies": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.5" + }, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/outvariant": { "version": "1.4.3", "resolved": "https://registry.npmjs.org/outvariant/-/outvariant-1.4.3.tgz", @@ -5008,6 +6058,19 @@ "node": ">=6" } }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "license": "MIT", + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/parse-json": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", @@ -5174,6 +6237,45 @@ "node": "^10 || ^12 || >=14" } }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/prettier": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz", + "integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==", + "dev": true, + "license": "MIT", + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/prettier-linter-helpers": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", + "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-diff": "^1.1.2" + }, + "engines": { + "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", @@ -5261,6 +6363,27 @@ "dev": true, "license": "MIT" }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "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" + }, "node_modules/react-is": { "version": "18.2.0", "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", @@ -5343,6 +6466,17 @@ "node": ">=10" } }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true, + "license": "MIT", + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, "node_modules/rollup": { "version": "4.21.1", "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.21.1.tgz", @@ -5379,6 +6513,30 @@ "fsevents": "~2.3.2" } }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "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": { + "queue-microtask": "^1.2.2" + } + }, "node_modules/semver": { "version": "7.6.3", "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", @@ -5632,6 +6790,23 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/synckit": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.9.1.tgz", + "integrity": "sha512-7gr8p9TQP6RAHusBOSLs46F4564ZrjV8xFmw5zCmgmhGUcw2hxsShhJ6CEiHQMgPDwAQ1fWHPM0ypc4RMAig4A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@pkgr/core": "^0.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts" + } + }, "node_modules/test-exclude": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", @@ -5646,6 +6821,13 @@ "node": ">=8" } }, + "node_modules/text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", + "dev": true, + "license": "MIT" + }, "node_modules/tinybench": { "version": "2.9.0", "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.9.0.tgz", @@ -5738,6 +6920,19 @@ "node": ">= 4.0.0" } }, + "node_modules/ts-api-utils": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.3.0.tgz", + "integrity": "sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=16" + }, + "peerDependencies": { + "typescript": ">=4.2.0" + } + }, "node_modules/ts-jest": { "version": "29.2.5", "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.2.5.tgz", @@ -5787,6 +6982,26 @@ } } }, + "node_modules/tslib": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", + "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==", + "dev": true, + "license": "0BSD" + }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "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", @@ -5823,6 +7038,30 @@ "node": ">=14.17" } }, + "node_modules/typescript-eslint": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.3.0.tgz", + "integrity": "sha512-EvWjwWLwwKDIJuBjk2I6UkV8KEQcwZ0VM10nR1rIunRDIP67QJTZAHBXTX0HW/oI1H10YESF8yWie8fRQxjvFA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/eslint-plugin": "8.3.0", + "@typescript-eslint/parser": "8.3.0", + "@typescript-eslint/utils": "8.3.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, "node_modules/ufo": { "version": "1.5.4", "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.5.4.tgz", @@ -6305,6 +7544,16 @@ "node": ">=8" } }, + "node_modules/word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", diff --git a/emanifest-js/package.json b/emanifest-js/package.json index 28e49f6a..201ddadf 100644 --- a/emanifest-js/package.json +++ b/emanifest-js/package.json @@ -1,6 +1,6 @@ { "name": "emanifest", - "version": "0.3.1", + "version": "0.3.2", "description": "API client library, written in TypeScript, for using the EPA e-Manifest/RCRAInfo web services.", "type": "module", "main": "./dist/emanifest-lib.umd.cjs", @@ -21,12 +21,19 @@ "axios": "^1.7.5" }, "devDependencies": { + "@eslint/js": "^9.9.1", + "@types/eslint__js": "^8.42.3", "@types/jest": "^29.5.12", "@types/node": "^22.5.1", + "eslint": "^9.9.1", + "eslint-config-prettier": "^9.1.0", + "eslint-plugin-prettier": "^5.2.1", "jest": "^29.7.0", "msw": "^2.3.5", + "prettier": "3.3.3", "ts-jest": "^29.2.5", "typescript": "^5.5.4", + "typescript-eslint": "^8.3.0", "vite": "^5.4.2", "vite-plugin-dts": "^4.0.3", "vitest": "^2.0.5" diff --git a/emanifest-js/src/client.ts b/emanifest-js/src/client.ts index 115a2065..185024c8 100644 --- a/emanifest-js/src/client.ts +++ b/emanifest-js/src/client.ts @@ -22,7 +22,7 @@ import { } from './types'; export const RCRAINFO_PREPROD = 'https://rcrainfopreprod.epa.gov/rcrainfo/rest/api'; -export const RCRAINFO_PROD = 'https://rcrainfo.epa.gov/rcrainfo/rest/api'; +export const RCRAINFO_PROD = 'https://rcrainfo.epa.gov/rcrainfoprod/rest/api'; export type RcrainfoEnv = typeof RCRAINFO_PREPROD | typeof RCRAINFO_PROD | string | undefined; @@ -30,8 +30,8 @@ interface RcraClientConfig { apiBaseURL?: RcrainfoEnv; apiID?: string; apiKey?: string; - authAuth?: Boolean; - validateInput?: Boolean; + autoAuth?: boolean; + validateInput?: boolean; } export type RcraClientClass = typeof RcraClient; @@ -41,16 +41,17 @@ export type RcraClientClass = typeof RcraClient; * @param apiBaseURL - The base URL for the RCRAInfo API. defaults to RCRAINFO_PREPROD. * @param apiID - The API ID for the RCRAInfo. * @param apiKey - The API key for the RCRAInfo. - * @param authAuth - Automatically authenticate if necessary. By default, this is disabled. + * @param autoAuth - Automatically authenticate if necessary. Disabled by default. + * @param validateInput - Apply input validation to requests. Disabled by default. */ export const newClient = ({ apiBaseURL, apiID, apiKey, - authAuth = false, + autoAuth = false, validateInput = false, }: RcraClientConfig = {}) => { - return new RcraClient(apiBaseURL, apiID, apiKey, authAuth, validateInput); + return new RcraClient(apiBaseURL, apiID, apiKey, autoAuth, validateInput); }; /** @@ -69,15 +70,15 @@ class RcraClient { private readonly apiKey?: string; token?: string; expiration?: string; - autoAuth?: Boolean; - validateInput?: Boolean; + autoAuth?: boolean; + validateInput?: boolean; constructor( apiBaseURL: RcrainfoEnv, apiID?: string, apiKey?: string, - autoAuth: Boolean = false, - validateInput: Boolean = false, + autoAuth = false, + validateInput = false ) { this.env = apiBaseURL || RCRAINFO_PREPROD; this.apiID = apiID; @@ -92,26 +93,20 @@ class RcraClient { }, }); - // Intercept all requests, make call to RCRAInfo auth service if necessary and add Authorization header + // Intercept requests, request Bearer token, if necessary, and add Authorization header this.apiClient.interceptors.request.use(async (config) => { - // if the request is for auth service, don't add the token if (config.url?.includes('auth')) { return config; } - // if autoAuth is enabled, check if we already have a token. - if (this.autoAuth) { - // If we do not have a token, check if we have an apiID and apiKey. - if (!this.token) { - // If we have an apiID and apiKey, try to authenticate. - if (!this.apiID || !this.apiKey) { - // If there's no token and no apiID or apiKey, throw an error. We can't authenticate. - throw new Error('Please add API ID and Key to authenticate.'); - } - // If there's no token, but there is an apiID and apiKey, try to authenticate. - await this.authenticate().catch((err) => { - throw new Error(`Received an error while attempting to authenticate: ${err}`); - }); + + // if autoAuth is enabled, and there is no token, attempt to authenticate + if (this.autoAuth && !this.token) { + if (!this.apiID || !this.apiKey) { + throw new Error('Please add API ID and Key to authenticate.'); } + await this.authenticate().catch(() => { + throw new Error(`Error while authenticating with ${this.env}`); + }); } config.headers.Authorization = `Bearer ${this.token}`; return config; @@ -132,12 +127,8 @@ class RcraClient { }); }; - /** - * Returns true if the client has a valid token. - */ - public isAuthenticated = (): boolean => { - return this.token !== undefined; - }; + /** Returns true if the client has a valid token.*/ + public isAuthenticated = (): boolean => this.token !== undefined; // RCRAInfo Lookup Services @@ -152,53 +143,33 @@ class RcraClient { return this.apiClient.get(`/v1/lookup/state-waste-codes/${stateCode}`); }; - /** - * Returns a list of all available federal waste codes. - */ - public getFederalWasteCodes = async (): Promise> => { - return this.apiClient.get('/v1/lookup/federal-waste-codes'); - }; + /** Returns a list of all available federal waste codes.*/ + public getFederalWasteCodes = async (): Promise> => + this.apiClient.get('/v1/lookup/federal-waste-codes'); - /** - * Returns a list of all available density units of measurement (UOM). - */ - public getDensityUOMs = async (): Promise> => { - return this.apiClient.get('/v1/lookup/density-uom'); - }; + /** Returns a list of all available density units of measurement (UOM).*/ + public getDensityUOMs = async (): Promise> => + this.apiClient.get('/v1/lookup/density-uom'); - /** - * Returns a list of all available source codes (type of activity or process that produced the waste). - */ - public getSourceCodes = async (): Promise> => { - return this.apiClient.get('/v1/lookup/source-codes'); - }; + /** Returns a list of all available source codes (type of activity or process that produced the waste).*/ + public getSourceCodes = async (): Promise> => + this.apiClient.get('/v1/lookup/source-codes'); - /** - * Returns a list of all available management method codes (how the waste is managed). - */ - public getManagementMethodCodes = async (): Promise> => { - return this.apiClient.get('/v1/lookup/management-method-codes'); - }; + /** Returns a list of all available management method codes (how the waste is managed).*/ + public getManagementMethodCodes = async (): Promise> => + this.apiClient.get('/v1/lookup/management-method-codes'); - /** - * Returns a list of all available waste minimization codes. - */ - public getWasteMinimizationCodes = async (): Promise> => { - return this.apiClient.get('/v1/lookup/waste-minimization-codes'); - }; + /** Returns a list of all available waste minimization codes.*/ + public getWasteMinimizationCodes = async (): Promise> => + this.apiClient.get('/v1/lookup/waste-minimization-codes'); - /** - * Returns a list of all available ports of entry where the waste can enter/exit the United States. - */ - public getPortsOfEntry = async (): Promise> => { - return this.apiClient.get('/v1/lookup/ports-of-entry'); - }; + /** Returns a list of all available ports of entry where the waste can enter/exit the United States.*/ + public getPortsOfEntry = async (): Promise> => + this.apiClient.get('/v1/lookup/ports-of-entry'); // e-Manifest Lookup Services - /** - * Returns a list of all available DOT Hazard classes. - */ + /** Returns a list of all available DOT Hazard classes.*/ public getHazardClasses = async ({ shippingName, idNumber, @@ -213,15 +184,13 @@ class RcraClient { throw new Error('Please provide both a shipping name and an ID number.'); } return this.apiClient.get( - `/v1/emanifest/lookup/hazard-classes-by-shipping-name-id-number/${shippingName}/${idNumber}`, + `/v1/emanifest/lookup/hazard-classes-by-shipping-name-id-number/${shippingName}/${idNumber}` ); } return this.apiClient.get('/v1/emanifest/lookup/hazard-classes'); }; - /** - * Returns a list of all available DOT packing groups. - */ + /** Returns a list of all available DOT packing groups.*/ public getPackingGroups = async ({ shippingName, idNumber, @@ -229,24 +198,20 @@ class RcraClient { shippingName?: string; idNumber?: string; } = {}): Promise> => { - if (shippingName || idNumber) { - // if either shippingName or idNumber is provided, attempt to get by shipping name and id number - if (!shippingName || !idNumber) { - // if only one is provided, throw an error - throw new Error('Please provide both a shipping name and an ID number.'); - } + // either both are required, or neither should be provided + if (shippingName && idNumber) { return this.apiClient.get( - `/v1/emanifest/lookup/packing-groups-by-shipping-name-id-number/${shippingName}/${idNumber}`, + `/v1/emanifest/lookup/packing-groups-by-shipping-name-id-number/${shippingName}/${idNumber}` ); + } else if (shippingName || idNumber) { + throw new Error('Please provide both a shipping name and an ID number.'); } return this.apiClient.get('/v1/emanifest/lookup/packing-groups'); }; // Site Services - /** - * Get a site by its EPA ID. - */ + /** Get a site by its EPA ID.*/ public getSite = async (siteID: string): Promise => { if (this.validateInput) { this.validateSiteID(siteID); @@ -254,29 +219,27 @@ class RcraClient { return this.apiClient.get(`/v1/site-details/${siteID}`); }; - /** - * Returns true if the site, by EPA ID, exists in RCRAInfo. - */ - public getSiteExists = async (siteID: string): Promise> => { + /** Returns true if the site, by EPA ID, exists in RCRAInfo.*/ + public getSiteExists = async ( + siteID: string + ): Promise> => { if (this.validateInput) { this.validateSiteID(siteID); } return this.apiClient.get(`/v1/site-exists/${siteID}`); }; - /** - * Search for sites by name, address (city, state, zip, etc.) EPA ID, or type. - */ - public searchSites = async (searchParameters: SiteSearchParameters): Promise> => { - return this.apiClient.post('/v1/site-search', searchParameters); - }; + /** Search for sites by name, address (city, state, zip, etc.) EPA ID, or type.*/ + public searchSites = async ( + searchParameters: SiteSearchParameters + ): Promise> => this.apiClient.post('/v1/site-search', searchParameters); // User Services - /** - * Search for RCRAInfo registered users - */ - public searchUsers = async (searchParameters: UserSearchParameters): Promise> => { + /** Search for RCRAInfo registered users*/ + public searchUsers = async ( + searchParameters: UserSearchParameters + ): Promise> => { return this.apiClient.post('/v1/user/user-search', searchParameters); }; @@ -286,14 +249,13 @@ class RcraClient { * Returns info on bill, required to be paid by TSDFs, for incurred fees for each manifest submitted. * @param searchParameters */ - public getBill = async (searchParameters: BillGetParameters): Promise> => { - return this.apiClient.post('/v1/emanifest/billing/bill', searchParameters); - }; + public getBill = async (searchParameters: BillGetParameters): Promise> => + this.apiClient.post('/v1/emanifest/billing/bill', searchParameters); - /** - * Search for bills by the given parameters. - */ - public searchBill = async (searchParameters: BillSearchParameters): Promise> => { + /** Search for bills by the given parameters.*/ + public searchBill = async ( + searchParameters: BillSearchParameters + ): Promise> => { return this.apiClient.post('/v1/emanifest/billing/bill-search', searchParameters); }; @@ -301,9 +263,10 @@ class RcraClient { * Search for a TSDF's bill history by the given parameters. * @param searchParameters */ - public getBillHistory = async (searchParameters: BillHistoryParameters): Promise> => { - return this.apiClient.post('/v1/emanifest/billing/bill-history', searchParameters); - }; + public getBillHistory = async ( + searchParameters: BillHistoryParameters + ): Promise> => + this.apiClient.post('/v1/emanifest/billing/bill-history', searchParameters); // ToDo // public updateManifest = async (): Promise> => { @@ -333,35 +296,35 @@ class RcraClient { manifestTrackingNumber: string; parseResponse?: boolean; }): Promise> => { - let response = await this.apiClient.get(`/v1/emanifest/manifest/${manifestTrackingNumber}/attachments`); + const response = await this.apiClient.get( + `/v1/emanifest/manifest/${manifestTrackingNumber}/attachments` + ); if (parseResponse) { response.data = await parseAttachments(response.data, response.headers['content-type']); } return response; }; - /** - * Retrieve information about all manifest correction versions by manifest tracking number - */ - public getManifestCorrections = async (manifestTrackingNumber: string): Promise> => { + /** Retrieve information about all manifest correction versions by manifest tracking number*/ + public getManifestCorrections = async ( + manifestTrackingNumber: string + ): Promise> => { if (this.validateInput) { this.validateMTN(manifestTrackingNumber); } - return this.apiClient.get(`/v1/emanifest/manifest/correction-details/${manifestTrackingNumber}`); + return this.apiClient.get( + `/v1/emanifest/manifest/correction-details/${manifestTrackingNumber}` + ); }; - /** - * Retrieve details of manifest correction version - */ + /** Retrieve details of manifest correction version*/ public getManifestCorrectionVersion = async ( - parameters: ManifestCorrectionParameters, + parameters: ManifestCorrectionParameters ): Promise> => { return this.apiClient.post('/v1/emanifest/manifest/correction-version', parameters); }; - /** - * Retrieve details of manifest correction version including attachments. - */ + /** Retrieve details of manifest correction version including attachments.*/ public getManifestCorrectionAttachments = async ({ parameters, parseResponse = false, @@ -369,16 +332,17 @@ class RcraClient { parameters: ManifestCorrectionParameters; parseResponse?: boolean; }): Promise> => { - let response = await this.apiClient.post('/v1/emanifest/manifest/correction-version/attachments', parameters); + const response = await this.apiClient.post( + '/v1/emanifest/manifest/correction-version/attachments', + parameters + ); if (parseResponse) { response.data = await parseAttachments(response.data, response.headers['content-type']); } return response; }; - /** - * Retrieve Manifest Tracking Numbers for provided site id. - */ + /** Retrieve Manifest Tracking Numbers for provided site id.*/ public getSiteMTN = async (siteID: string): Promise> => { if (this.validateInput) { this.validateSiteID(siteID); @@ -386,9 +350,7 @@ class RcraClient { return this.apiClient.get(`/v1/emanifest/manifest-tracking-numbers/${siteID}`); }; - /** - * Retrieve site ids for provided state (code) and site type (i.e. Generator, Tsdf, Transporter). - */ + /** Retrieve site ids for provided state (code) and site type (i.e. Generator, Tsdf, Transporter).*/ public getStateSites = async ({ stateCode, siteType, @@ -403,9 +365,7 @@ class RcraClient { return this.apiClient.get(`/v1/emanifest/site-ids/${stateCode}/${siteType}`); }; - /** - * Retrieve e-Manifest by provided manifest tracking number. - */ + /** Retrieve e-Manifest by provided manifest tracking number.*/ public getManifest = async (manifestTrackingNumber: string): Promise> => { if (this.validateInput) { this.validateMTN(manifestTrackingNumber); @@ -413,10 +373,10 @@ class RcraClient { return this.apiClient.get(`/v1/emanifest/manifest/${manifestTrackingNumber}`); }; - /** - * Retrieve manifest tracking numbers based on provided search criteria in JSON format. - */ - public searchManifest = async (parameters: ManifestSearchParameters): Promise> => { + /** Retrieve manifest tracking numbers based on provided search criteria in JSON format.*/ + public searchManifest = async ( + parameters: ManifestSearchParameters + ): Promise> => { if (this.validateInput) { // Many of the search parameters are optional, we only want to validate them if they are provided. if (parameters.dateType) { @@ -432,16 +392,14 @@ class RcraClient { return this.apiClient.post('/v1/emanifest/manifest/search', parameters); }; - /** - * Check if Manifest Tracking Number exists. Unless system error happens, this service always returns 200 HTTP code. - */ - public getMTNExists = async (manifestTrackingNumber: string): Promise> => { + /** Check if Manifest Tracking Number exists. Unless system error happens, this service always returns 200 HTTP code.*/ + public getMTNExists = async ( + manifestTrackingNumber: string + ): Promise> => { return this.apiClient.get(`/v1/emanifest/manifest/mtn-exists/${manifestTrackingNumber}`); }; - /** - * Revert manifest in 'UnderCorrection' status to previous 'Corrected' or 'Signed' version. - */ + /** Revert manifest in 'UnderCorrection' status to previous 'Corrected' or 'Signed' version.*/ public revertManifest = async (manifestTrackingNumber: string): Promise> => { if (this.validateInput) { this.validateMTN(manifestTrackingNumber); diff --git a/emanifest-js/src/parse.ts b/emanifest-js/src/parse.ts index 1e82cd5f..9e2e56c1 100644 --- a/emanifest-js/src/parse.ts +++ b/emanifest-js/src/parse.ts @@ -75,7 +75,10 @@ function checkBoundary(headerBoundary: string): string { * @param multipartBodyBuffer * @param headerBoundary */ -export async function parseAttachments(multipartBodyBuffer: Buffer, headerBoundary: string): Promise { +export async function parseAttachments( + multipartBodyBuffer: Buffer, + headerBoundary: string +): Promise { const boundary = checkBoundary(headerBoundary); // Set initial state before looping through the multipartBodyBuffer let lastLine = ''; // The current line buffer @@ -135,7 +138,9 @@ export async function parseAttachments(multipartBodyBuffer: Buffer, headerBounda if (lastLine == boundary) { const j = buffer.length - lastLine.length; const data = buffer.slice(0, j - 1); - allParts.push(process({ contentTypeHeader: header, contentDispositionHeader: info, data: data })); + allParts.push( + process({ contentTypeHeader: header, contentDispositionHeader: info, data: data }) + ); buffer = []; lastLine = ''; state = ParsingState.POST_READING_DATA; @@ -162,9 +167,12 @@ export async function parseAttachments(multipartBodyBuffer: Buffer, headerBounda */ function process(part: InputPart): OutputPart { const contentType = part.contentTypeHeader.split(':')[1].trim(); - let outputPart: OutputPart = { + const outputPart: OutputPart = { contentType: contentType as 'application/json' | 'application/octet-stream', - data: contentType === 'application/json' ? JSON.parse(Buffer.from(part.data).toString()) : Buffer.from(part.data), + data: + contentType === 'application/json' + ? JSON.parse(Buffer.from(part.data).toString()) + : Buffer.from(part.data), }; if (part.contentDispositionHeader) { outputPart.contentDisposition = part.contentDispositionHeader.split(':')[1].trim(); diff --git a/emanifest-js/src/tests/client.spec.ts b/emanifest-js/src/tests/client.spec.ts index fafbf11e..e4157cda 100644 --- a/emanifest-js/src/tests/client.spec.ts +++ b/emanifest-js/src/tests/client.spec.ts @@ -1,8 +1,14 @@ import { AxiosError, AxiosResponse } from 'axios'; -import { MOCK_API_ID, MOCK_API_KEY, MOCK_BAD_SITE_ID, MOCK_PACKING_GROUPS, MOCK_TOKEN } from './mockConstants'; +import { + MOCK_API_ID, + MOCK_API_KEY, + MOCK_BAD_SITE_ID, + MOCK_PACKING_GROUPS, + MOCK_TOKEN, +} from './mockConstants'; import { describe, it, expect, beforeAll, afterAll, afterEach } from 'vitest'; import { newClient, RCRAINFO_PREPROD, RCRAINFO_PROD } from '../index'; -// @ts-ignore +// @ts-expect-error - we're importing a mock server, ok for testing import { server } from './mocks/server'; beforeAll(() => server.listen()); @@ -16,12 +22,20 @@ describe('RcraClient', () => { expect(typeof rcrainfo.authenticate).toBe('function'); }); it('Retrieves a token when authenticating', async () => { - const rcrainfo = newClient({ apiBaseURL: RCRAINFO_PREPROD, apiID: MOCK_API_ID, apiKey: MOCK_API_KEY }); + const rcrainfo = newClient({ + apiBaseURL: RCRAINFO_PREPROD, + apiID: MOCK_API_ID, + apiKey: MOCK_API_KEY, + }); await rcrainfo.authenticate(); expect(rcrainfo.token).toBe(MOCK_TOKEN); }); it('does not enable auto-authentication by default', async () => { - const rcrainfo = newClient({ apiBaseURL: RCRAINFO_PREPROD, apiID: MOCK_API_ID, apiKey: MOCK_API_KEY }); + const rcrainfo = newClient({ + apiBaseURL: RCRAINFO_PREPROD, + apiID: MOCK_API_ID, + apiKey: MOCK_API_KEY, + }); // We expect a 401 because we didn't call authenticate() first await rcrainfo.getPackingGroups().catch((err: AxiosError) => { expect(err.response?.status).toBe(401); @@ -32,7 +46,7 @@ describe('RcraClient', () => { apiBaseURL: RCRAINFO_PREPROD, apiID: MOCK_API_ID, apiKey: MOCK_API_KEY, - authAuth: true, + autoAuth: true, }); const resp: AxiosResponse = await rcrainfo.getPackingGroups(); expect(rcrainfo.token).toEqual(MOCK_TOKEN); @@ -58,6 +72,29 @@ describe('RcraClient', () => { console.log('error', err); }); }); + it('throws an error if API ID or Key is missing during auto-authentication', async () => { + const rcrainfo = newClient({ apiBaseURL: RCRAINFO_PREPROD, autoAuth: true }); + await expect(rcrainfo.getPackingGroups()).rejects.toThrowError(); + }); + + it('throws an error if authentication fails', async () => { + const rcrainfo = newClient({ + apiBaseURL: RCRAINFO_PREPROD, + apiID: MOCK_API_ID, + apiKey: 'INVALID_KEY', + autoAuth: true, + }); + await expect(rcrainfo.getPackingGroups()).rejects.toThrowError(); + }); + it('does not add Authorization header if URL contains "auth"', async () => { + const rcrainfo = newClient({ + apiBaseURL: RCRAINFO_PREPROD, + apiID: MOCK_API_ID, + apiKey: MOCK_API_KEY, + }); + const resp: AxiosResponse = await rcrainfo.authenticate(); + expect(resp.config.headers.Authorization).toBeUndefined(); + }); }); describe('RcraClient validation', () => { @@ -66,7 +103,7 @@ describe('RcraClient validation', () => { apiBaseURL: RCRAINFO_PREPROD, apiID: MOCK_API_ID, apiKey: MOCK_API_KEY, - authAuth: true, + autoAuth: true, }); await expect(() => rcrainfo.getSite(MOCK_BAD_SITE_ID)).rejects.toThrowError(); }); @@ -77,19 +114,23 @@ describe('RcraClient validation', () => { it('throws an error if siteID is not 12 characters long', async () => { const rcrainfo = newClient({ apiBaseURL: RCRAINFO_PREPROD, validateInput: true }); await expect(() => rcrainfo.getSite('lengthy_site_id_yo_yo')).rejects.toThrowError( - 'siteID must be a string of length 12', + 'siteID must be a string of length 12' + ); + await expect(() => rcrainfo.getSite('12345')).rejects.toThrowError( + 'siteID must be a string of length 12' ); - await expect(() => rcrainfo.getSite('12345')).rejects.toThrowError('siteID must be a string of length 12'); }); it('throws an error if siteID is empty', async () => { const rcrainfo = newClient({ apiBaseURL: RCRAINFO_PREPROD, validateInput: true }); - // @ts-ignore + // @ts-expect-error - intentionally testing invalid input await expect(() => rcrainfo.getSite()).rejects.toThrowError('Site ID cannot be empty'); await expect(() => rcrainfo.getSite('')).rejects.toThrowError(); }); it('throws an error if siteType is not one of acceptable enums', async () => { const rcrainfo = newClient({ apiBaseURL: RCRAINFO_PREPROD, validateInput: true }); - await expect(() => rcrainfo.getStateSites({ stateCode: 'VA', siteType: 'bad_site_type' })).rejects.toThrowError(); + await expect(() => + rcrainfo.getStateSites({ stateCode: 'VA', siteType: 'bad_site_type' }) + ).rejects.toThrowError(); }); }); diff --git a/emanifest-js/src/tests/mocks/handlers.js b/emanifest-js/src/tests/mocks/handlers.js index 05dd2012..d0ae1804 100644 --- a/emanifest-js/src/tests/mocks/handlers.js +++ b/emanifest-js/src/tests/mocks/handlers.js @@ -1,34 +1,46 @@ -import {http, HttpResponse} from 'msw'; -import {MOCK_API_ID, MOCK_API_KEY, MOCK_BAD_SITE_ID, MOCK_PACKING_GROUPS, MOCK_TOKEN} from '../mockConstants'; -import {RCRAINFO_PREPROD} from '../../client'; +import { http, HttpResponse } from 'msw'; +import { + MOCK_API_ID, + MOCK_API_KEY, + MOCK_BAD_SITE_ID, + MOCK_PACKING_GROUPS, + MOCK_TOKEN, +} from '../mockConstants'; +import { RCRAINFO_PREPROD } from '../../client'; export const handlers = [ - http.get(`${RCRAINFO_PREPROD}/v1/auth/${MOCK_API_ID}/${MOCK_API_KEY}`, (info) => { - return HttpResponse.json( - { - token: `${MOCK_TOKEN}`, - expiration: '2021-01-01T00:00:00.000Z', - }, {status: 200} - ); - }), - http.get(`${RCRAINFO_PREPROD}/v1/emanifest/lookup/packing-groups`, (info) => { - if (info.request.headers.get('Authorization') === `Bearer ${MOCK_TOKEN}`) { - return HttpResponse.json(MOCK_PACKING_GROUPS, {status: 200}); - } - return HttpResponse.json({}, {status: 401}); - }), - // Request for a bad site ID (likely a better way to parameterize this) - http.get(`${RCRAINFO_PREPROD}/v1/site-details/${MOCK_BAD_SITE_ID}`, (info) => { - if (info.request.headers.get('Authorization') === `Bearer ${MOCK_TOKEN}`) { - return HttpResponse.json( - { - code: 'E_SiteIdNotFound', - message: 'Site with Provided Site id is Not Found', - errorId: '41cb95ed-f477-41aa-83af-fc4a28efbfa5', - errorDate: '2023-08-11T18:10:45.979+00:00', - }, {status: 400}, - ); - } - return HttpResponse.json("", {status: 401}); - }), + http.get(`${RCRAINFO_PREPROD}/v1/auth/:apiId/:apiKey`, (info) => { + const { apiId, apiKey } = info.params; + if (apiId !== MOCK_API_ID || apiKey !== MOCK_API_KEY) { + return HttpResponse.json('', { status: 400 }); + } + return HttpResponse.json( + { + token: `${MOCK_TOKEN}`, + expiration: '2021-01-01T00:00:00.000Z', + }, + { status: 200 } + ); + }), + http.get(`${RCRAINFO_PREPROD}/v1/emanifest/lookup/packing-groups`, (info) => { + if (info.request.headers.get('Authorization') === `Bearer ${MOCK_TOKEN}`) { + return HttpResponse.json(MOCK_PACKING_GROUPS, { status: 200 }); + } + return HttpResponse.json({}, { status: 401 }); + }), + // Request for a bad site ID (likely a better way to parameterize this) + http.get(`${RCRAINFO_PREPROD}/v1/site-details/${MOCK_BAD_SITE_ID}`, (info) => { + if (info.request.headers.get('Authorization') === `Bearer ${MOCK_TOKEN}`) { + return HttpResponse.json( + { + code: 'E_SiteIdNotFound', + message: 'Site with Provided Site id is Not Found', + errorId: '41cb95ed-f477-41aa-83af-fc4a28efbfa5', + errorDate: '2023-08-11T18:10:45.979+00:00', + }, + { status: 400 } + ); + } + return HttpResponse.json('', { status: 401 }); + }), ]; diff --git a/emanifest-js/src/tests/parse.spec.ts b/emanifest-js/src/tests/parse.spec.ts index 27d6d492..be22d64f 100644 --- a/emanifest-js/src/tests/parse.spec.ts +++ b/emanifest-js/src/tests/parse.spec.ts @@ -5,7 +5,6 @@ import { describe, it, expect } from 'vitest'; const fileBoundary = 'Boundary_10_712184523_1692837126159'; const mockContentType = `multipart/mixed;boundary=${fileBoundary}`; -// @ts-ignore async function readMultipartBodyForTesting() { try { const filename = `${__dirname}/100035569ELC-multipart-mixed.bin`; @@ -39,7 +38,9 @@ describe('Parse module', () => { if (body && boundary) { parseAttachments(body, boundary).then((parts) => { parts.forEach( - (part) => part.contentType === 'application/json' || part.contentType === 'application/octet-stream', + (part) => + part.contentType === 'application/json' || + part.contentType === 'application/octet-stream' ); }); } else {