diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..1011d54 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,3 @@ +.cache/ +public/ +node_modules/ diff --git a/package-lock.json b/package-lock.json index a5173e2..07e6fa0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,18 +18,30 @@ "@types/k6": "^0.45.0", "@types/uuid": "^3.4.0", "@types/webpack": "^5.28.0", + "@typescript-eslint/eslint-plugin": "^6.11.0", + "@typescript-eslint/parser": "^6.11.0", "babel-loader": "^8.0.6", "chai": "4.3.4", "clean-webpack-plugin": "^4.0.0", "copy-webpack-plugin": "^10.2.4", + "eslint": "^8.53.0", "terser-webpack-plugin": "^5.3.1", - "typescript": "^4.6.3", + "typescript": "^4.9.5", "uuid": "^3.4.0", "webpack": "^5.72.0", "webpack-cli": "^4.9.2", "webpack-glob-entries": "^1.0.1" } }, + "node_modules/@aashutoshrathi/word-wrap": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz", + "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/@ampproject/remapping": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz", @@ -1794,6 +1806,110 @@ "node": ">=10.0.0" } }, + "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, + "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/regexpp": { + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.10.0.tgz", + "integrity": "sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==", + "dev": true, + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.3.tgz", + "integrity": "sha512-yZzuIG+jnVu6hNSzFEN07e8BxF3uAzYtQb6uDkaYZLo6oYZDCq454c5kB8zxnzfCYyP4MIuyBn10L0DqwujTmA==", + "dev": true, + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.6.0", + "globals": "^13.19.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": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/eslintrc/node_modules/globals": { + "version": "13.23.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.23.0.tgz", + "integrity": "sha512-XAmF0RjlrjY23MA51q3HltdlGxUpXPvg0GioKiD9X6HD28iMjo2dKC8Vqwm7lne4GNr78+RHTfliktR6ZH09wA==", + "dev": true, + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@eslint/js": { + "version": "8.53.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.53.0.tgz", + "integrity": "sha512-Kn7K8dx/5U6+cT1yEhpX1w4PCSg0M+XyRILPgvwcEBjerFWCwQj5sbr3/VmxqV0JGHCBCzyd6LxypEuehypY1w==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/@humanwhocodes/config-array": { + "version": "0.11.13", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.13.tgz", + "integrity": "sha512-JSBDMiDKSzQVngfRjOdFXgFfklaXI4K9nLF49Auh21lmBWRLIK3+xTErTWD4KU54pb6coM6ESE7Awz/FNU3zgQ==", + "dev": true, + "dependencies": { + "@humanwhocodes/object-schema": "^2.0.1", + "debug": "^4.1.1", + "minimatch": "^3.0.5" + }, + "engines": { + "node": ">=10.10.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, + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/object-schema": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.1.tgz", + "integrity": "sha512-dvuCeX5fC9dXgJn9t+X5atfmgQAzUOWqS1254Gh0m6i8wKd10ebXkfNKiRK+1GWi/yTvvLDHpoxLr0xxxeslWw==", + "dev": true + }, "node_modules/@jridgewell/gen-mapping": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", @@ -1947,6 +2063,12 @@ "integrity": "sha512-jxiZQFpb+NlH5kjW49vXxvxTjeeqlbsnTAdBTKpzEdPs9itay7MscYXz3Fo9VYFEsfQ6LJFitHad3faerLAjCw==", "dev": true }, + "node_modules/@types/semver": { + "version": "7.5.5", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.5.tgz", + "integrity": "sha512-+d+WYC1BxJ6yVOgUgzK8gWvp5qF8ssV5r4nsDcZWKRWcDQLQ619tvWAxJQYGgBrO1MnLJC7a5GtiYsAoQ47dJg==", + "dev": true + }, "node_modules/@types/uuid": { "version": "3.4.11", "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-3.4.11.tgz", @@ -1964,6 +2086,338 @@ "webpack": "^5" } }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.11.0.tgz", + "integrity": "sha512-uXnpZDc4VRjY4iuypDBKzW1rz9T5YBBK0snMn8MaTSNd2kMlj50LnLBABELjJiOL5YHk7ZD8hbSpI9ubzqYI0w==", + "dev": true, + "dependencies": { + "@eslint-community/regexpp": "^4.5.1", + "@typescript-eslint/scope-manager": "6.11.0", + "@typescript-eslint/type-utils": "6.11.0", + "@typescript-eslint/utils": "6.11.0", + "@typescript-eslint/visitor-keys": "6.11.0", + "debug": "^4.3.4", + "graphemer": "^1.4.0", + "ignore": "^5.2.4", + "natural-compare": "^1.4.0", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^6.0.0 || ^6.0.0-alpha", + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, + "node_modules/@typescript-eslint/parser": { + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.11.0.tgz", + "integrity": "sha512-+whEdjk+d5do5nxfxx73oanLL9ghKO3EwM9kBCkUtWMRwWuPaFv9ScuqlYfQ6pAD6ZiJhky7TZ2ZYhrMsfMxVQ==", + "dev": true, + "dependencies": { + "@typescript-eslint/scope-manager": "6.11.0", + "@typescript-eslint/types": "6.11.0", + "@typescript-eslint/typescript-estree": "6.11.0", + "@typescript-eslint/visitor-keys": "6.11.0", + "debug": "^4.3.4" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.11.0.tgz", + "integrity": "sha512-0A8KoVvIURG4uhxAdjSaxy8RdRE//HztaZdG8KiHLP8WOXSk0vlF7Pvogv+vlJA5Rnjj/wDcFENvDaHb+gKd1A==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "6.11.0", + "@typescript-eslint/visitor-keys": "6.11.0" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/type-utils": { + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.11.0.tgz", + "integrity": "sha512-nA4IOXwZtqBjIoYrJcYxLRO+F9ri+leVGoJcMW1uqr4r1Hq7vW5cyWrA43lFbpRvQ9XgNrnfLpIkO3i1emDBIA==", + "dev": true, + "dependencies": { + "@typescript-eslint/typescript-estree": "6.11.0", + "@typescript-eslint/utils": "6.11.0", + "debug": "^4.3.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/types": { + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.11.0.tgz", + "integrity": "sha512-ZbEzuD4DwEJxwPqhv3QULlRj8KYTAnNsXxmfuUXFCxZmO6CF2gM/y+ugBSAQhrqaJL3M+oe4owdWunaHM6beqA==", + "dev": true, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.11.0.tgz", + "integrity": "sha512-Aezzv1o2tWJwvZhedzvD5Yv7+Lpu1by/U1LZ5gLc4tCx8jUmuSCMioPFRjliN/6SJIvY6HpTtJIWubKuYYYesQ==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "6.11.0", + "@typescript-eslint/visitor-keys": "6.11.0", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/globby": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, + "dependencies": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, + "node_modules/@typescript-eslint/utils": { + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.11.0.tgz", + "integrity": "sha512-p23ibf68fxoZy605dc0dQAEoUsoiNoP3MD9WQGiHLDuTSOuqoTsa4oAy+h3KDkTcxbbfOtUjb9h3Ta0gT4ug2g==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.4.0", + "@types/json-schema": "^7.0.12", + "@types/semver": "^7.5.0", + "@typescript-eslint/scope-manager": "6.11.0", + "@typescript-eslint/types": "6.11.0", + "@typescript-eslint/typescript-estree": "6.11.0", + "semver": "^7.5.4" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + } + }, + "node_modules/@typescript-eslint/utils/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@typescript-eslint/utils/node_modules/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@typescript-eslint/utils/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.11.0.tgz", + "integrity": "sha512-+SUN/W7WjBr05uRxPggJPSzyB8zUpaYo2hByKasWbqr3PM8AXfZt8UHdNpBS1v9SA62qnSSMF3380SwDqqprgQ==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "6.11.0", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@ungap/structured-clone": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", + "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", + "dev": true + }, "node_modules/@webassemblyjs/ast": { "version": "1.11.6", "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.6.tgz", @@ -2179,6 +2633,15 @@ "acorn": "^8" } }, + "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, + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, "node_modules/ajv": { "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", @@ -2243,6 +2706,15 @@ "ajv": "^6.9.1" } }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/ansi-styles": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", @@ -2255,6 +2727,12 @@ "node": ">=4" } }, + "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 + }, "node_modules/array-union": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/array-union/-/array-union-3.0.1.tgz", @@ -2418,6 +2896,15 @@ "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", "dev": true }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/caniuse-lite": { "version": "1.0.30001546", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001546.tgz", @@ -2697,6 +3184,12 @@ "node": ">=0.12" } }, + "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 + }, "node_modules/del": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/del/-/del-4.1.1.tgz", @@ -2764,6 +3257,18 @@ "node": ">=8" } }, + "node_modules/doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/electron-to-chromium": { "version": "1.4.544", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.544.tgz", @@ -2828,6 +3333,61 @@ "node": ">=0.8.0" } }, + "node_modules/eslint": { + "version": "8.53.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.53.0.tgz", + "integrity": "sha512-N4VuiPjXDUa4xVeV/GC/RV3hQW9Nw+Y463lkWaKKXKYMvmRiRDAtfpuPFLN+E1/6ZhyR8J2ig+eVREnYgUsiag==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.3", + "@eslint/js": "8.53.0", + "@humanwhocodes/config-array": "^0.11.13", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", + "@ungap/structured-clone": "^1.2.0", + "ajv": "^6.12.4", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", + "esquery": "^1.4.2", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "graphemer": "^1.4.0", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "is-path-inside": "^3.0.3", + "js-yaml": "^4.1.0", + "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": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, "node_modules/eslint-scope": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", @@ -2841,6 +3401,248 @@ "node": ">=8.0.0" } }, + "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, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/eslint/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/eslint/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/eslint/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "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, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/eslint-scope": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", + "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", + "dev": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint/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, + "engines": { + "node": ">=4.0" + } + }, + "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, + "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/globals": { + "version": "13.23.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.23.0.tgz", + "integrity": "sha512-XAmF0RjlrjY23MA51q3HltdlGxUpXPvg0GioKiD9X6HD28iMjo2dKC8Vqwm7lne4GNr78+RHTfliktR6ZH09wA==", + "dev": true, + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/eslint/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, + "engines": { + "node": ">=8" + } + }, + "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, + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^0.1.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, + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/espree": { + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", + "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", + "dev": true, + "dependencies": { + "acorn": "^8.9.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/esquery": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", + "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", + "dev": true, + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esquery/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, + "engines": { + "node": ">=4.0" + } + }, "node_modules/esrecurse": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", @@ -2929,6 +3731,12 @@ "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 + }, "node_modules/fastest-levenshtein": { "version": "1.0.16", "resolved": "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.16.tgz", @@ -2947,6 +3755,18 @@ "reusify": "^1.0.4" } }, + "node_modules/file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "dependencies": { + "flat-cache": "^3.0.4" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, "node_modules/fill-range": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", @@ -2989,6 +3809,41 @@ "node": ">=8" } }, + "node_modules/flat-cache": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", + "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", + "dev": true, + "dependencies": { + "flatted": "^3.2.9", + "keyv": "^4.5.3", + "rimraf": "^3.0.2" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/flat-cache/node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/flatted": { + "version": "3.2.9", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.9.tgz", + "integrity": "sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ==", + "dev": true + }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -3086,6 +3941,12 @@ "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 + }, "node_modules/has": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/has/-/has-1.0.4.tgz", @@ -3113,6 +3974,31 @@ "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, + "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, + "engines": { + "node": ">=4" + } + }, "node_modules/import-local": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.1.0.tgz", @@ -3132,6 +4018,15 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, + "engines": { + "node": ">=0.8.19" + } + }, "node_modules/inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", @@ -3303,6 +4198,18 @@ "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", "dev": true }, + "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, + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, "node_modules/jsesc": { "version": "2.5.2", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", @@ -3315,6 +4222,12 @@ "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 + }, "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", @@ -3327,6 +4240,12 @@ "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", "dev": true }, + "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 + }, "node_modules/json5": { "version": "2.2.3", "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", @@ -3339,6 +4258,15 @@ "node": ">=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, + "dependencies": { + "json-buffer": "3.0.1" + } + }, "node_modules/kind-of": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", @@ -3348,6 +4276,19 @@ "node": ">=0.10.0" } }, + "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, + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/loader-runner": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.0.tgz", @@ -3389,6 +4330,12 @@ "integrity": "sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==", "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 + }, "node_modules/lru-cache": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", @@ -3480,6 +4427,12 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true + }, "node_modules/neo-async": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", @@ -3519,6 +4472,23 @@ "wrappy": "1" } }, + "node_modules/optionator": { + "version": "0.9.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz", + "integrity": "sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==", + "dev": true, + "dependencies": { + "@aashutoshrathi/word-wrap": "^1.2.3", + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/p-limit": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", @@ -3564,6 +4534,18 @@ "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, + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -3681,6 +4663,15 @@ "node": ">=8" } }, + "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, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/punycode": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", @@ -4014,6 +5005,30 @@ "source-map": "^0.6.0" } }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/supports-color": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", @@ -4117,6 +5132,12 @@ "url": "https://opencollective.com/webpack" } }, + "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 + }, "node_modules/to-fast-properties": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", @@ -4138,6 +5159,30 @@ "node": ">=8.0" } }, + "node_modules/ts-api-utils": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.0.3.tgz", + "integrity": "sha512-wNMeqtMz5NtwpT/UZGY5alT+VoKdSsOOP/kqHFcUW1P/VRhH2wJ48+DN2WwUliNbQ976ETwDL0Ifd2VVvgonvg==", + "dev": true, + "engines": { + "node": ">=16.13.0" + }, + "peerDependencies": { + "typescript": ">=4.2.0" + } + }, + "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, + "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", @@ -4147,6 +5192,18 @@ "node": ">=4" } }, + "node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/typescript": { "version": "4.9.5", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", @@ -4462,6 +5519,18 @@ "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", "dev": true + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } } } } diff --git a/package.json b/package.json index 3e27c74..43dec62 100644 --- a/package.json +++ b/package.json @@ -14,12 +14,15 @@ "@types/k6": "^0.45.0", "@types/uuid": "^3.4.0", "@types/webpack": "^5.28.0", + "@typescript-eslint/eslint-plugin": "^6.11.0", + "@typescript-eslint/parser": "^6.11.0", "babel-loader": "^8.0.6", "chai": "4.3.4", "clean-webpack-plugin": "^4.0.0", "copy-webpack-plugin": "^10.2.4", + "eslint": "^8.53.0", "terser-webpack-plugin": "^5.3.1", - "typescript": "^4.6.3", + "typescript": "^4.9.5", "uuid": "^3.4.0", "webpack": "^5.72.0", "webpack-cli": "^4.9.2", diff --git a/src/.eslintrc b/src/.eslintrc new file mode 100644 index 0000000..cc7cf50 --- /dev/null +++ b/src/.eslintrc @@ -0,0 +1,12 @@ +/** + * As per typescript-eslint docs, this is the configuration recommended + * by the k6 frontend team. + * + * See: https://typescript-eslint.io/getting-started/ + */ +{ + "extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"], + "parser": "@typescript-eslint/parser", + "plugins": ["@typescript-eslint"], + "root": true +} diff --git a/src/internal/error.ts b/src/internal/error.ts index 3a1f168..1e7760a 100644 --- a/src/internal/error.ts +++ b/src/internal/error.ts @@ -1,3 +1,4 @@ +import { JSONObject } from './json' import { parseHTML } from 'k6/html' import { Response } from 'k6/http' @@ -39,12 +40,16 @@ export class AWSError extends Error { static parse(response: Response): AWSError { if (response.headers['Content-Type'] === 'application/json') { - const error = response.json() as any; - const message = error.Message || error.message || error.__type || 'An error occurred on the server side'; + const error = (response.json() as JSONObject) || {} + const message = + error.Message || + error.message || + error.__type || + 'An error occurred on the server side' const code = response.headers['X-Amzn-Errortype'] || error.__type - return new AWSError(message, code) + return new AWSError(message as string, code as string) } else { - return AWSError.parseXML(response.body as string); + return AWSError.parseXML(response.body as string) } } } diff --git a/src/internal/kinesis.ts b/src/internal/kinesis.ts index 2e27dbc..63cd941 100644 --- a/src/internal/kinesis.ts +++ b/src/internal/kinesis.ts @@ -1,4 +1,3 @@ -import { JSONObject } from 'k6' import http, { RefinedResponse, ResponseType } from 'k6/http' import { AWSClient } from './client' @@ -6,6 +5,7 @@ import { AWSClient } from './client' import { AWSConfig } from './config' import { AMZ_TARGET_HEADER } from './constants' import { AWSError } from './error' +import { JSONObject } from './json' import { HTTPHeaders } from './http' import { InvalidSignatureError, SignatureV4 } from './signature' @@ -82,7 +82,7 @@ export class KinesisClient extends AWSClient { streamName: string, options: { shardCount?: number; streamModeDetails?: { streamMode: StreamMode } } = {} ): Promise { - const body: any = { + const body = { StreamName: streamName, ...(options.shardCount && { ShardCount: options.shardCount }), ...(options.streamModeDetails && { StreamMode: options.streamModeDetails.streamMode }), @@ -109,7 +109,7 @@ export class KinesisClient extends AWSClient { streamName: string, parameters: { streamARN?: string; enforceConsumerDeletion?: boolean } = {} ): Promise { - const body: any = { + const body = { StreamName: streamName, ...(parameters.streamARN && { StreamARN: parameters.streamARN }), ...(parameters.enforceConsumerDeletion && { @@ -142,7 +142,7 @@ export class KinesisClient extends AWSClient { nextToken?: string } = {} ): Promise { - const body: any = { + const body = { ...(parameters.exclusiveStartStreamName && { ExclusiveStartStreamName: parameters.exclusiveStartStreamName, }), @@ -151,7 +151,7 @@ export class KinesisClient extends AWSClient { } const res = await this._send_request('ListStreams', body) - return ListStreamsResponse.fromJson(res?.json()) + return ListStreamsResponse.fromJson(res?.json() as JSONObject) } /** @@ -171,14 +171,14 @@ export class KinesisClient extends AWSClient { throw new Error('Either streamName or streamARN must be provided') } - const body: any = { + const body = { Records: records, ...(parameters.streamName && { StreamName: parameters.streamName }), ...(parameters.streamARN && { StreamARN: parameters.streamARN }), } const res = await this._send_request('PutRecords', body) - return PutRecordsResponse.fromJson(res?.json()) + return PutRecordsResponse.fromJson(res?.json() as JSONObject) } /** @@ -194,14 +194,14 @@ export class KinesisClient extends AWSClient { shardIterator: string, parameters: { limit?: number; streamARN?: string } = {} ): Promise { - const body: any = { + const body = { ShardIterator: shardIterator, ...(parameters.limit && { Limit: parameters.limit }), ...(parameters.streamARN && { StreamARN: parameters.streamARN }), } const res = await this._send_request('GetRecords', body) - return GetRecordsResponse.fromJson(res?.json()) + return GetRecordsResponse.fromJson(res?.json() as JSONObject) } /** @@ -222,7 +222,7 @@ export class KinesisClient extends AWSClient { streamName: string, parameters: { nextToken?: string; maxResults?: number } = {} ): Promise { - const body: any = { + const body = { StreamName: streamName, ...(parameters.nextToken && { NextToken: parameters.nextToken }), ...(parameters.maxResults && { @@ -231,7 +231,7 @@ export class KinesisClient extends AWSClient { } const res = await this._send_request('ListShards', body) - return ListShardsResponse.fromJson(res?.json()) + return ListShardsResponse.fromJson(res?.json() as JSONObject) } /** @@ -256,7 +256,7 @@ export class KinesisClient extends AWSClient { shardIteratorType: ShardIteratorKind, parameters: { startingSequenceNumber?: string; timestamp?: number } = {} ): Promise { - const body: any = { + const body = { StreamName: streamName, ShardId: shardId, ShardIteratorType: shardIteratorType, @@ -267,10 +267,13 @@ export class KinesisClient extends AWSClient { } const res = await this._send_request('GetShardIterator', body) - return GetShardIteratorResponse.fromJson(res?.json()) + return GetShardIteratorResponse.fromJson(res?.json() as JSONObject) } - private async _send_request(action: string, body: any): Promise { + private async _send_request( + action: string, + body: unknown + ): Promise> { const signedRequest = this.signature.sign( { method: 'POST', @@ -410,7 +413,7 @@ export class ListStreamsResponse { this.streamSummaries = StreamSummaries } - static fromJson(result: any): ListStreamsResponse { + static fromJson(result: JSONObject): ListStreamsResponse { const { HasMoreStreams = false, NextToken = '', @@ -419,10 +422,10 @@ export class ListStreamsResponse { } = result return new ListStreamsResponse( - HasMoreStreams, - NextToken, - StreamNames.map((s: any) => String(s)), - StreamSummaries.map(StreamSummary.fromJson) + HasMoreStreams as boolean, + NextToken as string, + StreamNames as string[], + (StreamSummaries as JSONObject[])?.map(StreamSummary.fromJson) as StreamSummary[] ) } } @@ -470,7 +473,7 @@ export class StreamSummary { this.streamStatus = StreamStatus } - static fromJson(summary: any): StreamSummary { + static fromJson(summary: JSONObject): StreamSummary { const { StreamARN = '', StreamCreationTimestamp = 0, @@ -480,11 +483,11 @@ export class StreamSummary { } = summary return new StreamSummary( - StreamARN, - StreamCreationTimestamp, - StreamModeDetails, - StreamName, - StreamStatus + StreamARN as string, + StreamCreationTimestamp as number, + StreamModeDetails as StreamModeDetails, + StreamName as string, + StreamStatus as StreamStatus ) } } @@ -511,7 +514,7 @@ export class PutRecordsResponse { * - NONE: Do not encrypt the records. * - KMS: Use server-side encryption on the records using a customer-managed AWS KMS key. */ - encryptionType: 'NONE' | 'KMS' + encryptionType: EncryptionType /** * The number of unsuccessfully processed records in a PutRecords request. @@ -533,14 +536,20 @@ export class PutRecordsResponse { this.records = records } - static fromJson(json: any): PutRecordsResponse { + static fromJson(json: JSONObject): PutRecordsResponse { const { EncryptionType = 'NONE', FailedRecordCount = 0, Records = [] } = json - const records = Records.map((record: any) => PutRecordsResultEntry.fromJson(record)) + const records = (Records as JSONObject[]).map(PutRecordsResultEntry.fromJson) - return new PutRecordsResponse(EncryptionType, FailedRecordCount, records) + return new PutRecordsResponse( + EncryptionType as EncryptionType, + FailedRecordCount as number, + records + ) } } +type EncryptionType = 'NONE' | 'KMS' + /** * Represents the result of an individual record from a PutRecords request. */ @@ -560,8 +569,8 @@ export class PutRecordsResultEntry { this.shardId = shardId } - static fromJson(json: any): PutRecordsResultEntry { - return new PutRecordsResultEntry(json.SequenceNumber, json.ShardId) + static fromJson(json: JSONObject): PutRecordsResultEntry { + return new PutRecordsResultEntry(json.SequenceNumber as string, json.ShardId as string) } } @@ -583,8 +592,8 @@ export class GetRecordsResponse { * The number of milliseconds the GetRecords response is from the * tip of the stream, indicating how far behind current time the * consumer is. - * - * A value of zero indicates that record processing is caught + * + * A value of zero indicates that record processing is caught * up, and there are no new records to process at this moment. */ millisBehindLatest: number @@ -595,11 +604,15 @@ export class GetRecordsResponse { this.millisBehindLatest = millisBehindLatest } - static fromJson(json: any): GetRecordsResponse { + static fromJson(json: JSONObject): GetRecordsResponse { const { NextShardIterator = '', Records = [], MillisBehindLatest = 0 } = json - const records = Records.map((record: Record) => Record.fromJson(record)) + const records = (Records as JSONObject[]).map(Record.fromJson) - return new GetRecordsResponse(NextShardIterator, records, MillisBehindLatest) + return new GetRecordsResponse( + NextShardIterator as string, + records as Record[], + MillisBehindLatest as number + ) } } @@ -629,8 +642,12 @@ class Record { this.sequenceNumber = sequenceNumber } - static fromJson(json: any): Record { - return new Record(json.Data, json.PartitionKey, json.SequenceNumber) + static fromJson(json: JSONObject): Record { + return new Record( + json.Data as string | ArrayBuffer, + json.PartitionKey as string, + json.SequenceNumber as string + ) } } @@ -657,11 +674,11 @@ export class ListShardsResponse { this.nextToken = nextToken } - static fromJson(json: any): ListShardsResponse { + static fromJson(json: JSONObject): ListShardsResponse { const { Shards = [], NextToken } = json - const shards = Shards.map((shard: Shard) => Shard.fromJson(shard)) + const shards = (Shards as JSONObject[]).map(Shard.fromJson) - return new ListShardsResponse(shards, NextToken) + return new ListShardsResponse(shards, NextToken as string | undefined) } } @@ -705,13 +722,13 @@ export class Shard { this.sequenceNumberRange = sequenceNumberRange } - static fromJson(json: any): Shard { + static fromJson(json: JSONObject): Shard { return new Shard( - json.ShardId, - json.HashKeyRange, - json.SequenceNumberRange, - json.ParentShardId, - json.AdjacentParentShardId + json.ShardId as string, + json.HashKeyRange as unknown as HashKeyRange, + json.SequenceNumberRange as unknown as SequenceNumberRange, + json.ParentShardId as string | undefined, + json.AdjacentParentShardId as string | undefined ) } } @@ -762,7 +779,7 @@ class GetShardIteratorResponse { this.shardIterator = shardIterator } - static fromJson(json: any): GetShardIteratorResponse { - return new GetShardIteratorResponse(json.ShardIterator) + static fromJson(json: JSONObject): GetShardIteratorResponse { + return new GetShardIteratorResponse(json.ShardIterator as string) } } diff --git a/src/internal/lambda.ts b/src/internal/lambda.ts index b12b7e9..be44356 100644 --- a/src/internal/lambda.ts +++ b/src/internal/lambda.ts @@ -1,5 +1,5 @@ import http, { RefinedResponse, ResponseType } from 'k6/http' -import encoding from 'k6/encoding'; +import encoding from 'k6/encoding' import { AWSClient } from './client' import { AWSConfig } from './config' @@ -8,7 +8,6 @@ import { InvalidSignatureError, SignatureV4 } from './signature' import { AMZ_TARGET_HEADER } from './constants' import { HTTPHeaders, HTTPMethod, QueryParameterBag } from './http' - /** * Class allowing to interact with Amazon AWS's Lambda service */ @@ -52,19 +51,19 @@ export class LambdaClient extends AWSClient { payload: string, options: InvocationOptions = {} ): Promise { - const query: QueryParameterBag = {}; + const query: QueryParameterBag = {} const invocationType = options.invocationType || 'RequestResponse' const headers = { ...this.commonHeaders, [AMZ_TARGET_HEADER]: `AWSLambda.${invocationType}`, 'X-Amz-Invocation-Type': invocationType, - 'X-Amz-Log-Type': options.logType || 'None' + 'X-Amz-Log-Type': options.logType || 'None', } if (options.clientContext) { headers['X-Amz-Client-Context'] = options.clientContext } if (options.qualifier) { - query['Qualifier'] = options.qualifier; + query['Qualifier'] = options.qualifier } const signedRequest = this.signature.sign( @@ -74,7 +73,7 @@ export class LambdaClient extends AWSClient { path: `/2015-03-31/functions/${name}/invocations`, query, headers, - body: payload || '' + body: payload || '', }, {} ) @@ -89,7 +88,7 @@ export class LambdaClient extends AWSClient { executedVersion: res.headers['X-Amz-Executed-Version'], logResult: logResult ? encoding.b64decode(logResult, 'std', 's') : undefined, statusCode: res.status, - payload: res.body as string + payload: res.body as string, } const functionError = res.headers['X-Amz-Function-Error'] @@ -100,9 +99,7 @@ export class LambdaClient extends AWSClient { } } - private _handle_error( - response: RefinedResponse - ) { + private _handle_error(response: RefinedResponse) { const errorCode: number = response.error_code const errorMessage: string = response.error @@ -137,24 +134,24 @@ interface InvocationOptions { * - `Event`: Invoke the function asynchronously. * - `DryRun`: Validate parameter values and verify that the user or role has permission to invoke the function. */ - invocationType?: 'RequestResponse' | 'Event' | 'DryRun'; + invocationType?: 'RequestResponse' | 'Event' | 'DryRun' /** * Set to `Tail` to include the execution log in the response. Applies to synchronously invoked functions only. */ - logType?: 'None' | 'Tail'; + logType?: 'None' | 'Tail' /** * Up to 3,583 bytes of base64-encoded data about the invoking client to pass to the function in the context object. */ - clientContext?: string; + clientContext?: string /** * Specify a version or alias to invoke a published version of the function. */ - qualifier?: string; + qualifier?: string } interface InvocationResponse { - statusCode: number; - executedVersion?: string; - logResult?: string; - payload?: string; -} \ No newline at end of file + statusCode: number + executedVersion?: string + logResult?: string + payload?: string +} diff --git a/src/internal/s3.ts b/src/internal/s3.ts index 309cfa1..2b18fe7 100644 --- a/src/internal/s3.ts +++ b/src/internal/s3.ts @@ -60,14 +60,14 @@ export class S3Client extends AWSClient { }) this._handle_error('ListBuckets', res) - let buckets: Array = [] + const buckets: Array = [] const doc = parseHTML(res.body as string) doc.find('Buckets') .children() .each((_, bucketDefinition) => { - let bucket = {} + const bucket = {} bucketDefinition.children().forEach((child) => { switch (child.nodeName()) { @@ -119,14 +119,14 @@ export class S3Client extends AWSClient { }) this._handle_error('ListObjectsV2', res) - let objects: Array = [] + const objects: Array = [] // Extract the objects definition from // the XML response parseHTML(res.body as string) .find('Contents') .each((_, objectDefinition) => { - let obj = {} + const obj = {} objectDefinition.children().forEach((child) => { switch (child.nodeName()) { @@ -222,7 +222,9 @@ export class S3Client extends AWSClient { path: `/${bucketName}/${objectKey}`, headers: { Host: this.endpoint.host, - ...(params?.contentDisposition && { 'Content-Disposition': params.contentDisposition }), + ...(params?.contentDisposition && { + 'Content-Disposition': params.contentDisposition, + }), ...(params?.contentEncoding && { 'Content-Encoding': params.contentEncoding }), ...(params?.contentLength && { 'Content-Length': params.contentLength }), ...(params?.contentMD5 && { 'Content-MD5': params.contentMD5 }), @@ -654,7 +656,7 @@ type StorageClass = export interface PutObjectParams { /** * Specifies presentational information for the object. - * + * * For more information, see https://www.rfc-editor.org/rfc/rfc6266#section-4. */ contentDisposition?: string @@ -663,7 +665,7 @@ export interface PutObjectParams { * Specifies what content encodings have been applied to the object and thus * what decoding mechanisms must be applied to obtain the media-type referenced * by the ContentType option. - * + * * For more information, see https://www.rfc-editor.org/rfc/rfc9110.html#field.content-encoding. */ contentEncoding?: string @@ -671,7 +673,7 @@ export interface PutObjectParams { /** * Size of the body in bytes. This parameter is useful when the size of the body cannot be * determined automatically. - * + * * For more information, see https://www.rfc-editor.org/rfc/rfc9110.html#name-content-length. */ contentLength?: string @@ -680,7 +682,7 @@ export interface PutObjectParams { * The base64-encoded 128-bit MD5 digest of the message (without the headers) according to RFC 1864. * This header can be used as a message integrity check to verify that the data is the same data that * was originally sent. - * + * * Although it is optional, we recommend using the Content-MD5 mechanism as an end-to-end integrity * check. */ @@ -688,7 +690,7 @@ export interface PutObjectParams { /** * A standard MIME type describing the format of the contents. - * + * * For more information, see https://www.rfc-editor.org/rfc/rfc9110.html#name-content-type. */ contentType?: string diff --git a/src/internal/secrets-manager.ts b/src/internal/secrets-manager.ts index a675c40..8d5f71f 100644 --- a/src/internal/secrets-manager.ts +++ b/src/internal/secrets-manager.ts @@ -139,7 +139,7 @@ export class SecretsManagerClient extends AWSClient { secret: string, description: string, versionID?: string, - tags?: Array + tags?: Array ): Promise { versionID = versionID || uuidv4() diff --git a/src/internal/signature.ts b/src/internal/signature.ts index e93e581..638b3b1 100644 --- a/src/internal/signature.ts +++ b/src/internal/signature.ts @@ -126,7 +126,7 @@ export class SignatureV4 { request.body = '' } - let payloadHash = this.computePayloadHash(request) + const payloadHash = this.computePayloadHash(request) if ( !hasHeader(constants.AMZ_CONTENT_SHA256_HEADER, request.headers) && this.applyChecksum @@ -380,10 +380,19 @@ export class SignatureV4 { shortDate: string ): Uint8Array { const kSecret: string = credentials.secretAccessKey + /** + * crypto.hmac returns a value of type `bytes`, which is an alias for + * number[]. However, the secret argument to hmac needs to either be + * a `string` or ArrayBuffer. The only way to get around this is to + * cast the return value of hmac to any, thus, we disable the no-explicit-any + * ESLint rule for this function. + */ + /* eslint-disable @typescript-eslint/no-explicit-any */ const kDate: any = crypto.hmac('sha256', 'AWS4' + kSecret, shortDate, 'binary') const kRegion: any = crypto.hmac('sha256', kDate, region, 'binary') const kService: any = crypto.hmac('sha256', kRegion, service, 'binary') const kSigning: any = crypto.hmac('sha256', kService, 'aws4_request', 'binary') + /* eslint-enable @typescript-eslint/no-explicit-any */ return kSigning } @@ -511,7 +520,9 @@ export class SignatureV4 { } if (typeof headers[headerName] === 'string') { - canonicalHeaders[canonicalHeaderName] = headers[headerName] = headers[headerName].trim().replace(/\s+/g, ' ') + canonicalHeaders[canonicalHeaderName] = headers[headerName] = headers[headerName] + .trim() + .replace(/\s+/g, ' ') } } @@ -805,7 +816,7 @@ function escapeURI(URI: string): string { * @returns {DateInfo} The formatted date. */ function formatDate(date: Date): DateInfo { - const longDate = iso8601(date).replace(/[\-:]/g, '') + const longDate = iso8601(date).replace(/[-:]/g, '') return { longDate, shortDate: longDate.slice(0, 8), diff --git a/src/internal/sqs.ts b/src/internal/sqs.ts index 2bc4c5e..0e4398c 100644 --- a/src/internal/sqs.ts +++ b/src/internal/sqs.ts @@ -49,7 +49,7 @@ export class SQSClient extends AWSClient { ): Promise { const method = 'POST' - let body: any = { + let body: object = { Action: 'SendMessage', Version: API_VERSION, QueueUrl: queueUrl, @@ -71,19 +71,24 @@ export class SQSClient extends AWSClient { * See https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_SendMessage.html#SQS-SendMessage-request-MessageAttributes * for more information. */ - const attributeParameters = Object.entries(options.messageAttributes).reduce((params, [name, attribute], i) => { - const valueParameterSuffix = attribute.type === 'Binary' ? 'BinaryValue' : 'StringValue' - return Object.assign(params, { - [`MessageAttribute.${i + 1}.Name`]: name, - [`MessageAttribute.${i + 1}.Value.${valueParameterSuffix}`]: attribute.value, - [`MessageAttribute.${i + 1}.Value.DataType`]: attribute.type - }) - }, {} as Record) - body = { ...body, ...attributeParameters }; + const attributeParameters = Object.entries(options.messageAttributes).reduce( + (params, [name, attribute], i) => { + const valueParameterSuffix = + attribute.type === 'Binary' ? 'BinaryValue' : 'StringValue' + return Object.assign(params, { + [`MessageAttribute.${i + 1}.Name`]: name, + [`MessageAttribute.${i + 1}.Value.${valueParameterSuffix}`]: + attribute.value, + [`MessageAttribute.${i + 1}.Value.DataType`]: attribute.type, + }) + }, + {} as Record + ) + body = { ...body, ...attributeParameters } } if (typeof options.delaySeconds !== 'undefined') { - body = { ...body, DelaySeconds: options.delaySeconds }; + body = { ...body, DelaySeconds: options.delaySeconds } } const signedRequest: SignedHTTPRequest = this.signature.sign( @@ -122,7 +127,7 @@ export class SQSClient extends AWSClient { async listQueues(parameters: ListQueuesRequestParameters = {}): Promise { const method = 'POST' - let body: any = { + let body: object = { Action: 'ListQueues', Version: API_VERSION, } @@ -158,7 +163,7 @@ export class SQSClient extends AWSClient { }) this._handleError('ListQueues', res) - let parsed = res.html() + const parsed = res.html() return { urls: parsed .find('QueueUrl') @@ -249,7 +254,7 @@ export interface SendMessageOptions { * The message attributes */ messageAttributes?: { - [name: string]: { type: 'String' | 'Number' | 'Binary', value: string } + [name: string]: { type: 'String' | 'Number' | 'Binary'; value: string } } /** diff --git a/src/internal/utils.ts b/src/internal/utils.ts index 8e67d87..6abf9b8 100644 --- a/src/internal/utils.ts +++ b/src/internal/utils.ts @@ -3,7 +3,7 @@ * @param value * @returns */ -export function isArrayBuffer(value: any): value is ArrayBuffer { +export function isArrayBuffer(value: unknown): value is ArrayBuffer { return ( typeof ArrayBuffer === 'function' && (value instanceof ArrayBuffer || @@ -11,12 +11,14 @@ export function isArrayBuffer(value: any): value is ArrayBuffer { ) } -export function toFormUrlEncoded(form: any): string { - return Object.keys(form).reduce((params, key) => { - let value = form[key] - if (value !== undefined && value !== null) { - params.push(`${encodeURIComponent(key)}=${encodeURIComponent(value)}`) - } - return params; - }, [] as string[]).join('&') -} \ No newline at end of file +export function toFormUrlEncoded(form: Record): string { + return Object.keys(form) + .reduce((params, key) => { + const value = form[key] + if (value !== undefined && value !== null) { + params.push(`${encodeURIComponent(key)}=${encodeURIComponent(value)}`) + } + return params + }, [] as string[]) + .join('&') +}