diff --git a/.eslintrc.cjs b/.eslintrc.cjs new file mode 100644 index 0000000..f14285a --- /dev/null +++ b/.eslintrc.cjs @@ -0,0 +1,53 @@ +module.exports = { + parser: '@typescript-eslint/parser', + parserOptions: { + project: 'tsconfig.linting.json', + tsconfigRootDir: __dirname, + sourceType: 'module', + }, + plugins: [ + '@typescript-eslint/eslint-plugin', + 'simple-import-sort', + // 'require-extensions', // only once moved to ESM + ], + extends: [ + 'plugin:@typescript-eslint/recommended', + 'plugin:prettier/recommended', + // 'plugin:require-extensions/recommended', // only once moved to ESM + ], + root: true, + env: { + node: true, + jest: true, + }, + ignorePatterns: ['.eslintrc.js', 'webpack.config.js'], + rules: { + '@typescript-eslint/interface-name-prefix': 'off', + '@typescript-eslint/explicit-function-return-type': 'off', + '@typescript-eslint/explicit-module-boundary-types': 'off', + '@typescript-eslint/no-explicit-any': 'off', + '@typescript-eslint/no-non-null-assertion': 'off', + '@typescript-eslint/ban-types': 'off', + 'simple-import-sort/imports': 'error', + 'simple-import-sort/exports': 'error', + 'array-bracket-spacing': ['error', 'never'], + 'linebreak-style': ['error', 'unix'], + 'lines-between-class-members': ['warn', 'always'], + semi: ['error', 'always'], + 'new-cap': 'off', + 'no-console': 'off', + 'no-debugger': 'off', + 'no-mixed-spaces-and-tabs': 2, + 'no-use-before-define': [2, 'nofunc'], + 'no-unreachable': ['warn'], + // 'no-unused-vars': ['warn'], + 'no-extra-parens': ['off'], + 'no-mixed-operators': ['off'], + quotes: [2, 'single', 'avoid-escape'], + 'block-scoped-var': 2, + 'brace-style': [2, '1tbs', { allowSingleLine: true }], + 'computed-property-spacing': [2, 'never'], + 'keyword-spacing': 2, + 'space-unary-ops': 2, + }, +}; diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index e8c5c55..0000000 --- a/.eslintrc.js +++ /dev/null @@ -1,36 +0,0 @@ -module.exports = { - env: { - es6: true, - node: true, - }, - extends: ['eslint:recommended'], - parserOptions: { - sourceType: 'module', - ecmaVersion: 9 - }, - - plugins: [], - rules: { - 'array-bracket-spacing': ['error', 'never'], - indent: ['warn', 2], - 'linebreak-style': ['error', 'unix'], - 'lines-between-class-members': ['warn', 'always'], - semi: ['error', 'always'], - 'new-cap': 'off', - 'no-console': 'off', - 'no-debugger': 'off', - 'no-mixed-spaces-and-tabs': 2, - 'no-use-before-define': [2, 'nofunc'], - 'no-unreachable': ['warn'], - 'no-unused-vars': ['warn'], - 'no-extra-parens': ['off'], - 'no-mixed-operators': ['off'], - quotes: [2, 'single', 'avoid-escape'], - 'block-scoped-var': 2, - 'brace-style': [2, '1tbs', { allowSingleLine: true }], - 'computed-property-spacing': [2, 'never'], - 'keyword-spacing': 2, - 'space-unary-ops': 2, - 'max-len': ['warn', { 'code': 140 }] - } -}; diff --git a/.github/workflows/e2etest.yml b/.github/workflows/e2etest.yml index 057358b..76d836a 100644 --- a/.github/workflows/e2etest.yml +++ b/.github/workflows/e2etest.yml @@ -30,9 +30,12 @@ jobs: - name: Install run: npm ci --ignore-scripts - - name: Build + - name: Check Build run: npm run build + - name: Check Lint + run: npm run lint + - name: Test run: npm run test env: diff --git a/.nvmrc b/.nvmrc index 7ea6a59..bb8c76c 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -v20.11.0 +v22.11.0 diff --git a/package-lock.json b/package-lock.json index d6ac8df..3aba2d5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "okx-api", - "version": "1.4.14", + "version": "1.5.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "okx-api", - "version": "1.4.14", + "version": "1.5.0", "license": "MIT", "dependencies": { "axios": "^1.6.7", @@ -15,8 +15,13 @@ }, "devDependencies": { "@types/jest": "^29.5.11", - "@types/node": "^20.11.6", - "eslint": "^8.19.0", + "@types/node": "^22.10.2", + "@typescript-eslint/eslint-plugin": "^8.18.0", + "eslint": "^8.24.0", + "eslint-config-prettier": "^9.1.0", + "eslint-plugin-prettier": "^5.2.1", + "eslint-plugin-require-extensions": "^0.1.3", + "eslint-plugin-simple-import-sort": "^12.1.1", "jest": "^29.7.0", "ts-jest": "^29.1.2", "typescript": "^5.3.3" @@ -28,9 +33,9 @@ "optionalDependencies": { "source-map-loader": "^4.0.0", "ts-loader": "^9.3.1", - "webpack": "^5.4.0", - "webpack-bundle-analyzer": "^4.1.0", - "webpack-cli": "^4.2.0" + "webpack": "^5.74.0", + "webpack-bundle-analyzer": "^4.6.1", + "webpack-cli": "^4.10.0" } }, "node_modules/@ampproject/remapping": { @@ -719,16 +724,46 @@ "node": ">=10.0.0" } }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.1.tgz", + "integrity": "sha512-s3O3waFUrMV8P/XaF/+ZTp1X9XBZW1a4B97ZnjQF2KYWaFD2A8KyFBsrsfSjEmjn3RGWAIuvlneuZm3CUK3jbA==", + "dev": true, + "license": "MIT", + "dependencies": { + "eslint-visitor-keys": "^3.4.3" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.12.1", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.1.tgz", + "integrity": "sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, "node_modules/@eslint/eslintrc": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.0.tgz", - "integrity": "sha512-UWW0TMTmk2d7hLcWD1/e2g5HDM/HQ3csaLSqXCfqwh4uNDuNqlaKWXmEsL4Cs41Z0KnILNvwbHAah3C2yt06kw==", + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", + "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", "dev": true, + "license": "MIT", "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", - "espree": "^9.3.2", - "globals": "^13.15.0", + "espree": "^9.6.0", + "globals": "^13.19.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", "js-yaml": "^4.1.0", @@ -737,19 +772,24 @@ }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, "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 + "dev": true, + "license": "Python-2.0" }, "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" }, @@ -757,25 +797,53 @@ "js-yaml": "bin/js-yaml.js" } }, + "node_modules/@eslint/js": { + "version": "8.57.1", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.1.tgz", + "integrity": "sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, "node_modules/@humanwhocodes/config-array": { - "version": "0.9.5", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.9.5.tgz", - "integrity": "sha512-ObyMyWxZiCu/yTisA7uzx81s40xR2fD5Cg/2Kq7G02ajkNubJf6BopgDTmDyc3U7sXpNKM8cYOw7s7Tyr+DnCw==", + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.13.0.tgz", + "integrity": "sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw==", + "deprecated": "Use @eslint/config-array instead", "dev": true, + "license": "Apache-2.0", "dependencies": { - "@humanwhocodes/object-schema": "^1.2.1", - "debug": "^4.1.1", - "minimatch": "^3.0.4" + "@humanwhocodes/object-schema": "^2.0.3", + "debug": "^4.3.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, + "license": "Apache-2.0", + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, "node_modules/@humanwhocodes/object-schema": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", - "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", - "dev": true + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz", + "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==", + "deprecated": "Use @eslint/object-schema instead", + "dev": true, + "license": "BSD-3-Clause" }, "node_modules/@istanbuljs/load-nyc-config": { "version": "1.1.0", @@ -1147,10 +1215,62 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, + "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/@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/@polka/url": { - "version": "1.0.0-next.21", - "resolved": "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.21.tgz", - "integrity": "sha512-a5Sab1C4/icpTZVzZc5Ghpz88yQtGOyNqYXcZgOssB2uuAr+wF/MvN6bgtW32q7HHrvBki+BsZ0OuNv6EV3K9g==", + "version": "1.0.0-next.28", + "resolved": "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.28.tgz", + "integrity": "sha512-8LduaNlMZGwdZ6qWrKlfa+2M4gahzFkprZiAt2TF8uS0qQgBizKXpXURqvTJ4WtmupWxaLqjRb2UCTe72mu+Aw==", + "license": "MIT", "optional": true }, "node_modules/@sinclair/typebox": { @@ -1274,12 +1394,13 @@ "optional": true }, "node_modules/@types/node": { - "version": "20.11.19", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.19.tgz", - "integrity": "sha512-7xMnVEcZFu0DikYjWOlRq7NTPETrm7teqUT2WkQjrTIkEgUyyGdWsj/Zg8bEJt5TNklzbPD1X3fqfsHw3SpapQ==", + "version": "22.10.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.2.tgz", + "integrity": "sha512-Xxr6BBRCAOQixvonOye19wnzyDiUtTeqldOOmj3CkeblonbccA12PFwlufvRdrpjXxqnmUaeiU5EOA+7s5diUQ==", "devOptional": true, + "license": "MIT", "dependencies": { - "undici-types": "~5.26.4" + "undici-types": "~6.20.0" } }, "node_modules/@types/stack-utils": { @@ -1303,6 +1424,233 @@ "integrity": "sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==", "dev": true }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.18.0.tgz", + "integrity": "sha512-NR2yS7qUqCL7AIxdJUQf2MKKNDVNaig/dEB0GBLU7D+ZdHgK1NoH/3wsgO3OnPVipn51tG3MAwaODEGil70WEw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/regexpp": "^4.10.0", + "@typescript-eslint/scope-manager": "8.18.0", + "@typescript-eslint/type-utils": "8.18.0", + "@typescript-eslint/utils": "8.18.0", + "@typescript-eslint/visitor-keys": "8.18.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", + "typescript": ">=4.8.4 <5.8.0" + } + }, + "node_modules/@typescript-eslint/parser": { + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.18.0.tgz", + "integrity": "sha512-hgUZ3kTEpVzKaK3uNibExUYm6SKKOmTU2BOxBSvOYwtJEPdVQ70kZJpPjstlnhCHcuc2WGfSbpKlb/69ttyN5Q==", + "dev": true, + "license": "MITClause", + "peer": true, + "dependencies": { + "@typescript-eslint/scope-manager": "8.18.0", + "@typescript-eslint/types": "8.18.0", + "@typescript-eslint/typescript-estree": "8.18.0", + "@typescript-eslint/visitor-keys": "8.18.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", + "typescript": ">=4.8.4 <5.8.0" + } + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.18.0.tgz", + "integrity": "sha512-PNGcHop0jkK2WVYGotk/hxj+UFLhXtGPiGtiaWgVBVP1jhMoMCHlTyJA+hEj4rszoSdLTK3fN4oOatrL0Cp+Xw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.18.0", + "@typescript-eslint/visitor-keys": "8.18.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.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.18.0.tgz", + "integrity": "sha512-er224jRepVAVLnMF2Q7MZJCq5CsdH2oqjP4dT7K6ij09Kyd+R21r7UVJrF0buMVdZS5QRhDzpvzAxHxabQadow==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/typescript-estree": "8.18.0", + "@typescript-eslint/utils": "8.18.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" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.8.0" + } + }, + "node_modules/@typescript-eslint/types": { + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.18.0.tgz", + "integrity": "sha512-FNYxgyTCAnFwTrzpBGq+zrnoTO4x0c1CKYY5MuUTzpScqmY5fmsh2o3+57lqdI3NZucBDCzDgdEbIaNfAjAHQA==", + "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.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.18.0.tgz", + "integrity": "sha512-rqQgFRu6yPkauz+ms3nQpohwejS8bvgbPyIDq13cgEDbkXt4LH4OkDMT0/fN1RUtzG8e8AKJyDBoocuQh8qNeg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.18.0", + "@typescript-eslint/visitor-keys": "8.18.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" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <5.8.0" + } + }, + "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.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.18.0.tgz", + "integrity": "sha512-p6GLdY383i7h5b0Qrfbix3Vc3+J2k6QWw6UMUeY5JGfm3C5LbZ4QIZzJNoNOfgyRe0uuYKjvVOsO/jD4SJO+xg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.4.0", + "@typescript-eslint/scope-manager": "8.18.0", + "@typescript-eslint/types": "8.18.0", + "@typescript-eslint/typescript-estree": "8.18.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", + "typescript": ">=4.8.4 <5.8.0" + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.18.0.tgz", + "integrity": "sha512-pCh/qEA8Lb1wVIqNvBke8UaRjJ6wrAWkJO5yyIbs8Yx6TNGYyfNjOo61tLv+WwLvoLPp4BQ8B7AHKijl8NGUfw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.18.0", + "eslint-visitor-keys": "^4.2.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/visitor-keys/node_modules/eslint-visitor-keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", + "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/@ungap/structured-clone": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.1.tgz", + "integrity": "sha512-fEzPV3hSkSMltkw152tJKNARhOupqbH96MZWyRjNaYZOMIzbrTeQDG+MTc6Mr2pgzFQzFxAfmhGDNP5QK++2ZA==", + "dev": true, + "license": "ISC" + }, "node_modules/@webassemblyjs/ast": { "version": "1.12.1", "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.12.1.tgz", @@ -1529,6 +1877,7 @@ "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" } @@ -2083,6 +2432,13 @@ "node": ">= 8" } }, + "node_modules/debounce": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/debounce/-/debounce-1.2.1.tgz", + "integrity": "sha512-XRRe6Glud4rd/ZGQfiV1ruXSfbvfJedlV9Y6zOlP+2K04vBYiJEte6stfFkCP03aMnY5tsipamumUjL14fofug==", + "license": "MIT", + "optional": true + }, "node_modules/debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", @@ -2118,7 +2474,8 @@ "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 + "dev": true, + "license": "MIT" }, "node_modules/deepmerge": { "version": "4.3.1", @@ -2250,7 +2607,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true, + "devOptional": true, "engines": { "node": ">=10" }, @@ -2259,46 +2616,51 @@ } }, "node_modules/eslint": { - "version": "8.19.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.19.0.tgz", - "integrity": "sha512-SXOPj3x9VKvPe81TjjUJCYlV4oJjQw68Uek+AM0X4p+33dj2HY5bpTZOgnQHcG2eAm1mtCU9uNMnJi7exU/kYw==", + "version": "8.57.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.1.tgz", + "integrity": "sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==", + "deprecated": "This version is no longer supported. Please see https://eslint.org/version-support for other options.", "dev": true, + "license": "MIT", "dependencies": { - "@eslint/eslintrc": "^1.3.0", - "@humanwhocodes/config-array": "^0.9.2", - "ajv": "^6.10.0", + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.4", + "@eslint/js": "8.57.1", + "@humanwhocodes/config-array": "^0.13.0", + "@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.1.1", - "eslint-utils": "^3.0.0", - "eslint-visitor-keys": "^3.3.0", - "espree": "^9.3.2", - "esquery": "^1.4.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", - "functional-red-black-tree": "^1.0.1", - "glob-parent": "^6.0.1", - "globals": "^13.15.0", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "graphemer": "^1.4.0", "ignore": "^5.2.0", - "import-fresh": "^3.0.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.1", - "regexpp": "^3.2.0", + "optionator": "^0.9.3", "strip-ansi": "^6.0.1", - "strip-json-comments": "^3.1.0", - "text-table": "^0.2.0", - "v8-compile-cache": "^2.0.3" + "text-table": "^0.2.0" }, "bin": { "eslint": "bin/eslint.js" @@ -2310,53 +2672,97 @@ "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", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", - "optional": true, - "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" + "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" }, - "engines": { - "node": ">=8.0.0" + "peerDependencies": { + "eslint": ">=7.0.0" } }, - "node_modules/eslint-utils": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", - "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", + "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": { - "eslint-visitor-keys": "^2.0.0" + "prettier-linter-helpers": "^1.0.0", + "synckit": "^0.9.1" }, "engines": { - "node": "^10.0.0 || ^12.0.0 || >= 14.0.0" + "node": "^14.18.0 || >=16.0.0" }, "funding": { - "url": "https://github.com/sponsors/mysticatea" + "url": "https://opencollective.com/eslint-plugin-prettier" }, "peerDependencies": { - "eslint": ">=5" + "@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-utils/node_modules/eslint-visitor-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", - "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "node_modules/eslint-plugin-require-extensions": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/eslint-plugin-require-extensions/-/eslint-plugin-require-extensions-0.1.3.tgz", + "integrity": "sha512-T3c1PZ9PIdI3hjV8LdunfYI8gj017UQjzAnCrxuo3wAjneDbTPHdE3oNWInOjMA+z/aBkUtlW5vC0YepYMZIug==", "dev": true, + "license": "Apache-2.0", "engines": { - "node": ">=10" + "node": ">=16" + }, + "peerDependencies": { + "eslint": "*" + } + }, + "node_modules/eslint-plugin-simple-import-sort": { + "version": "12.1.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-simple-import-sort/-/eslint-plugin-simple-import-sort-12.1.1.tgz", + "integrity": "sha512-6nuzu4xwQtE3332Uz0to+TxDQYRLTKRESSc2hefVT48Zc8JthmN23Gx9lnYhu0FtkRSL1oxny3kJ2aveVhmOVA==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "eslint": ">=5.0.0" + } + }, + "node_modules/eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "optional": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + }, + "engines": { + "node": ">=8.0.0" } }, "node_modules/eslint-visitor-keys": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz", - "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==", + "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/node_modules/argparse": { @@ -2366,16 +2772,20 @@ "dev": true }, "node_modules/eslint/node_modules/eslint-scope": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.1.tgz", - "integrity": "sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==", + "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, + "license": "BSD-2-Clause", "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": { @@ -2383,10 +2793,28 @@ "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/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/js-yaml": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", @@ -2399,18 +2827,70 @@ "js-yaml": "bin/js-yaml.js" } }, + "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-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, + "license": "MIT", + "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, + "license": "MIT", + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/espree": { - "version": "9.3.2", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.3.2.tgz", - "integrity": "sha512-D211tC7ZwouTIuY5x9XnS0E9sWNChB7IYKX/Xp5eQj3nFXhqmiUDB9q27y76oFl8jTg3pXcQx/bpxMfs3CIZbA==", + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", + "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { - "acorn": "^8.7.1", + "acorn": "^8.9.0", "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^3.3.0" + "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/esprima": { @@ -2427,10 +2907,11 @@ } }, "node_modules/esquery": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", - "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", + "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" }, @@ -2443,6 +2924,7 @@ "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" } @@ -2549,6 +3031,43 @@ "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", "devOptional": true }, + "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", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", @@ -2559,7 +3078,8 @@ "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/fastest-levenshtein": { "version": "1.0.12", @@ -2567,6 +3087,16 @@ "integrity": "sha512-On2N+BpYJ15xIC974QNVuYGMOlEVt4s0EOI3wwMqOmK1fdDY+FN/zltPV8vosq4ad4c/gJ1KHScUn/6AWIgiow==", "optional": true }, + "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", @@ -2690,12 +3220,6 @@ "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", "devOptional": true }, - "node_modules/functional-red-black-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==", - "dev": true - }, "node_modules/gensync": { "version": "1.0.0-beta.2", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", @@ -2774,10 +3298,11 @@ "optional": true }, "node_modules/globals": { - "version": "13.16.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.16.0.tgz", - "integrity": "sha512-A1lrQfpNF+McdPOnnFqY3kSN0AFTy485bTi1bkLk4mVPODIUEcSfhHgRqA+QdXPksrSTTztYXx37NFV+GpGk3Q==", + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", "dev": true, + "license": "MIT", "dependencies": { "type-fest": "^0.20.2" }, @@ -2794,6 +3319,13 @@ "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", "devOptional": 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/gzip-size": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/gzip-size/-/gzip-size-6.0.0.tgz", @@ -2834,7 +3366,7 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", - "dev": true + "devOptional": true }, "node_modules/human-signals": { "version": "2.1.0", @@ -2858,10 +3390,11 @@ } }, "node_modules/ignore": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", - "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", + "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" } @@ -2871,6 +3404,7 @@ "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" @@ -3001,6 +3535,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-plain-object": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", @@ -3807,6 +4351,7 @@ "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" @@ -3842,12 +4387,6 @@ "node": ">=8" } }, - "node_modules/lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "optional": true - }, "node_modules/lodash.memoize": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", @@ -3860,18 +4399,6 @@ "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", "dev": true }, - "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==", - "devOptional": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/make-dir": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", @@ -3908,6 +4435,16 @@ "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", "devOptional": true }, + "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", @@ -3962,9 +4499,10 @@ } }, "node_modules/mrmime": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/mrmime/-/mrmime-1.0.1.tgz", - "integrity": "sha512-hzzEagAgDyoU1Q6yg5uI+AorQgdvMCur3FcKf7NhMKWsaYg+RnbTyHRa/9IlLF9rf455MOCtcqqrQQ83pPP7Uw==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mrmime/-/mrmime-2.0.0.tgz", + "integrity": "sha512-eu38+hdgojoyq63s+yTpN4XMBdt5l8HhMhc4VKLO9KM5caLIBvUm4thi7fFaxyTmCKeNnXZ5pAlBwCUnhA09uw==", + "license": "MIT", "optional": true, "engines": { "node": ">=10" @@ -4055,17 +4593,18 @@ } }, "node_modules/optionator": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", - "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "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.3" + "word-wrap": "^1.2.5" }, "engines": { "node": ">= 0.8.0" @@ -4112,6 +4651,7 @@ "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" }, @@ -4214,10 +4754,41 @@ "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.4.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.4.2.tgz", + "integrity": "sha512-e9MewbtFo+Fevyuxn/4rrcDAaq0IYxPGLvObpQjiZBMAzB9IGmzlnG9RZy3FFas+eBMu2vA0CszMeduow5dIuQ==", + "dev": true, + "license": "MIT", + "peer": true, + "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", @@ -4287,6 +4858,27 @@ } ] }, + "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/randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", @@ -4314,18 +4906,6 @@ "node": ">= 0.10" } }, - "node_modules/regexpp": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", - "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" - } - }, "node_modules/require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -4378,6 +4958,7 @@ "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" } @@ -4391,6 +4972,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/rimraf": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", @@ -4406,6 +4998,30 @@ "url": "https://github.com/sponsors/isaacs" } }, + "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/safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -4451,13 +5067,11 @@ } }, "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==", + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", "devOptional": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, + "license": "ISC", "bin": { "semver": "bin/semver.js" }, @@ -4514,14 +5128,15 @@ "dev": true }, "node_modules/sirv": { - "version": "1.0.19", - "resolved": "https://registry.npmjs.org/sirv/-/sirv-1.0.19.tgz", - "integrity": "sha512-JuLThK3TnZG1TAKDwNIqNq6QA2afLOCcm+iE8D1Kj3GA40pSPsxQjjJl0J8X3tsR7T+CP1GavpzLwYkgVLWrZQ==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/sirv/-/sirv-2.0.4.tgz", + "integrity": "sha512-94Bdh3cC2PKrbgSOUqTiGPWVZeSiXfKOVZNJniWoqrWrRkB1CJzBU3NEbiTsPcYy1lDsANA/THzS+9WBiy5nfQ==", + "license": "MIT", "optional": true, "dependencies": { - "@polka/url": "^1.0.0-next.20", - "mrmime": "^1.0.0", - "totalist": "^1.0.0" + "@polka/url": "^1.0.0-next.24", + "mrmime": "^2.0.0", + "totalist": "^3.0.0" }, "engines": { "node": ">= 10" @@ -4705,10 +5320,27 @@ "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", "devOptional": true, "engines": { - "node": ">= 0.4" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/synckit": { + "version": "0.9.2", + "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.9.2.tgz", + "integrity": "sha512-vrozgXDQwYO72vHjUb/HnFbQx1exDjoKzqx23aXEg2a9VIg2TSFZ8FmeZpTjUCFMYw7mpX4BE2SFu8wI7asYsw==", + "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://github.com/sponsors/ljharb" + "url": "https://opencollective.com/unts" } }, "node_modules/tapable": { @@ -4859,14 +5491,28 @@ } }, "node_modules/totalist": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/totalist/-/totalist-1.1.0.tgz", - "integrity": "sha512-gduQwd1rOdDMGxFG1gEvhV88Oirdo2p+KjoYFU7k2g+i7n6AFFbDQ5kMPUsW0pNbfQsB/cwXvT1i4Bue0s9g5g==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/totalist/-/totalist-3.0.1.tgz", + "integrity": "sha512-sf4i37nQ2LBx4m3wB74y+ubopq6W/dIzXg0FDGjsYnZHVa1Da8FH853wlL2gtUhg+xJXjfk3kUZS3BRoQeoQBQ==", + "license": "MIT", "optional": true, "engines": { "node": ">=6" } }, + "node_modules/ts-api-utils": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.4.3.tgz", + "integrity": "sha512-i3eMG77UTMD0hZhgRS562pv83RC6ukSAC2GMNWc+9dieh/+jDM5u5YG+NHX6VNDRHQcHwmsTHctP9LhbC3WxVw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=16" + }, + "peerDependencies": { + "typescript": ">=4.2.0" + } + }, "node_modules/ts-jest": { "version": "29.1.2", "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.1.2.tgz", @@ -4929,11 +5575,19 @@ "webpack": "^5.0.0" } }, + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "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" }, @@ -4955,6 +5609,7 @@ "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, + "license": "(MIT OR CC0-1.0)", "engines": { "node": ">=10" }, @@ -4976,10 +5631,11 @@ } }, "node_modules/undici-types": { - "version": "5.26.5", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", - "devOptional": true + "version": "6.20.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz", + "integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==", + "devOptional": true, + "license": "MIT" }, "node_modules/update-browserslist-db": { "version": "1.0.13", @@ -5020,12 +5676,6 @@ "punycode": "^2.1.0" } }, - "node_modules/v8-compile-cache": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", - "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", - "dev": true - }, "node_modules/v8-to-istanbul": { "version": "9.2.0", "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.2.0.tgz", @@ -5109,19 +5759,23 @@ } }, "node_modules/webpack-bundle-analyzer": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/webpack-bundle-analyzer/-/webpack-bundle-analyzer-4.5.0.tgz", - "integrity": "sha512-GUMZlM3SKwS8Z+CKeIFx7CVoHn3dXFcUAjT/dcZQQmfSZGvitPfMob2ipjai7ovFFqPvTqkEZ/leL4O0YOdAYQ==", + "version": "4.10.2", + "resolved": "https://registry.npmjs.org/webpack-bundle-analyzer/-/webpack-bundle-analyzer-4.10.2.tgz", + "integrity": "sha512-vJptkMm9pk5si4Bv922ZbKLV8UTT4zib4FPgXMhgzUny0bfDDkLXAVQs3ly3fS4/TN9ROFtb0NFrm04UXFE/Vw==", + "license": "MIT", "optional": true, "dependencies": { + "@discoveryjs/json-ext": "0.5.7", "acorn": "^8.0.4", "acorn-walk": "^8.0.0", - "chalk": "^4.1.0", "commander": "^7.2.0", + "debounce": "^1.2.1", + "escape-string-regexp": "^4.0.0", "gzip-size": "^6.0.0", - "lodash": "^4.17.20", + "html-escaper": "^2.0.2", "opener": "^1.5.2", - "sirv": "^1.0.7", + "picocolors": "^1.0.0", + "sirv": "^2.0.3", "ws": "^7.3.1" }, "bin": { @@ -5240,10 +5894,11 @@ "optional": true }, "node_modules/word-wrap": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.4.tgz", - "integrity": "sha512-2V81OA4ugVo5pRo46hAoD2ivUJx8jXmWXfUkY4KFNw0hEptvN0QfH3K4nHiwzGeKl5rFKedV48QVoqYavy4YpA==", + "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" } @@ -5313,12 +5968,6 @@ "node": ">=10" } }, - "node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "devOptional": true - }, "node_modules/yargs": { "version": "17.7.2", "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", @@ -5884,16 +6533,31 @@ "integrity": "sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw==", "optional": true }, + "@eslint-community/eslint-utils": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.1.tgz", + "integrity": "sha512-s3O3waFUrMV8P/XaF/+ZTp1X9XBZW1a4B97ZnjQF2KYWaFD2A8KyFBsrsfSjEmjn3RGWAIuvlneuZm3CUK3jbA==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^3.4.3" + } + }, + "@eslint-community/regexpp": { + "version": "4.12.1", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.1.tgz", + "integrity": "sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==", + "dev": true + }, "@eslint/eslintrc": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.0.tgz", - "integrity": "sha512-UWW0TMTmk2d7hLcWD1/e2g5HDM/HQ3csaLSqXCfqwh4uNDuNqlaKWXmEsL4Cs41Z0KnILNvwbHAah3C2yt06kw==", + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", + "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", "dev": true, "requires": { "ajv": "^6.12.4", "debug": "^4.3.2", - "espree": "^9.3.2", - "globals": "^13.15.0", + "espree": "^9.6.0", + "globals": "^13.19.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", "js-yaml": "^4.1.0", @@ -5918,21 +6582,33 @@ } } }, + "@eslint/js": { + "version": "8.57.1", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.1.tgz", + "integrity": "sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q==", + "dev": true + }, "@humanwhocodes/config-array": { - "version": "0.9.5", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.9.5.tgz", - "integrity": "sha512-ObyMyWxZiCu/yTisA7uzx81s40xR2fD5Cg/2Kq7G02ajkNubJf6BopgDTmDyc3U7sXpNKM8cYOw7s7Tyr+DnCw==", + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.13.0.tgz", + "integrity": "sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw==", "dev": true, "requires": { - "@humanwhocodes/object-schema": "^1.2.1", - "debug": "^4.1.1", - "minimatch": "^3.0.4" + "@humanwhocodes/object-schema": "^2.0.3", + "debug": "^4.3.1", + "minimatch": "^3.0.5" } }, + "@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 + }, "@humanwhocodes/object-schema": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", - "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz", + "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==", "dev": true }, "@istanbuljs/load-nyc-config": { @@ -6231,10 +6907,42 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, + "@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, + "requires": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + } + }, + "@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 + }, + "@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, + "requires": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + } + }, + "@pkgr/core": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.1.1.tgz", + "integrity": "sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA==", + "dev": true + }, "@polka/url": { - "version": "1.0.0-next.21", - "resolved": "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.21.tgz", - "integrity": "sha512-a5Sab1C4/icpTZVzZc5Ghpz88yQtGOyNqYXcZgOssB2uuAr+wF/MvN6bgtW32q7HHrvBki+BsZ0OuNv6EV3K9g==", + "version": "1.0.0-next.28", + "resolved": "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.28.tgz", + "integrity": "sha512-8LduaNlMZGwdZ6qWrKlfa+2M4gahzFkprZiAt2TF8uS0qQgBizKXpXURqvTJ4WtmupWxaLqjRb2UCTe72mu+Aw==", "optional": true }, "@sinclair/typebox": { @@ -6358,12 +7066,12 @@ "optional": true }, "@types/node": { - "version": "20.11.19", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.19.tgz", - "integrity": "sha512-7xMnVEcZFu0DikYjWOlRq7NTPETrm7teqUT2WkQjrTIkEgUyyGdWsj/Zg8bEJt5TNklzbPD1X3fqfsHw3SpapQ==", + "version": "22.10.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.2.tgz", + "integrity": "sha512-Xxr6BBRCAOQixvonOye19wnzyDiUtTeqldOOmj3CkeblonbccA12PFwlufvRdrpjXxqnmUaeiU5EOA+7s5diUQ==", "devOptional": true, "requires": { - "undici-types": "~5.26.4" + "undici-types": "~6.20.0" } }, "@types/stack-utils": { @@ -6387,6 +7095,137 @@ "integrity": "sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==", "dev": true }, + "@typescript-eslint/eslint-plugin": { + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.18.0.tgz", + "integrity": "sha512-NR2yS7qUqCL7AIxdJUQf2MKKNDVNaig/dEB0GBLU7D+ZdHgK1NoH/3wsgO3OnPVipn51tG3MAwaODEGil70WEw==", + "dev": true, + "requires": { + "@eslint-community/regexpp": "^4.10.0", + "@typescript-eslint/scope-manager": "8.18.0", + "@typescript-eslint/type-utils": "8.18.0", + "@typescript-eslint/utils": "8.18.0", + "@typescript-eslint/visitor-keys": "8.18.0", + "graphemer": "^1.4.0", + "ignore": "^5.3.1", + "natural-compare": "^1.4.0", + "ts-api-utils": "^1.3.0" + } + }, + "@typescript-eslint/parser": { + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.18.0.tgz", + "integrity": "sha512-hgUZ3kTEpVzKaK3uNibExUYm6SKKOmTU2BOxBSvOYwtJEPdVQ70kZJpPjstlnhCHcuc2WGfSbpKlb/69ttyN5Q==", + "dev": true, + "peer": true, + "requires": { + "@typescript-eslint/scope-manager": "8.18.0", + "@typescript-eslint/types": "8.18.0", + "@typescript-eslint/typescript-estree": "8.18.0", + "@typescript-eslint/visitor-keys": "8.18.0", + "debug": "^4.3.4" + } + }, + "@typescript-eslint/scope-manager": { + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.18.0.tgz", + "integrity": "sha512-PNGcHop0jkK2WVYGotk/hxj+UFLhXtGPiGtiaWgVBVP1jhMoMCHlTyJA+hEj4rszoSdLTK3fN4oOatrL0Cp+Xw==", + "dev": true, + "requires": { + "@typescript-eslint/types": "8.18.0", + "@typescript-eslint/visitor-keys": "8.18.0" + } + }, + "@typescript-eslint/type-utils": { + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.18.0.tgz", + "integrity": "sha512-er224jRepVAVLnMF2Q7MZJCq5CsdH2oqjP4dT7K6ij09Kyd+R21r7UVJrF0buMVdZS5QRhDzpvzAxHxabQadow==", + "dev": true, + "requires": { + "@typescript-eslint/typescript-estree": "8.18.0", + "@typescript-eslint/utils": "8.18.0", + "debug": "^4.3.4", + "ts-api-utils": "^1.3.0" + } + }, + "@typescript-eslint/types": { + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.18.0.tgz", + "integrity": "sha512-FNYxgyTCAnFwTrzpBGq+zrnoTO4x0c1CKYY5MuUTzpScqmY5fmsh2o3+57lqdI3NZucBDCzDgdEbIaNfAjAHQA==", + "dev": true + }, + "@typescript-eslint/typescript-estree": { + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.18.0.tgz", + "integrity": "sha512-rqQgFRu6yPkauz+ms3nQpohwejS8bvgbPyIDq13cgEDbkXt4LH4OkDMT0/fN1RUtzG8e8AKJyDBoocuQh8qNeg==", + "dev": true, + "requires": { + "@typescript-eslint/types": "8.18.0", + "@typescript-eslint/visitor-keys": "8.18.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" + }, + "dependencies": { + "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, + "requires": { + "balanced-match": "^1.0.0" + } + }, + "minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "requires": { + "brace-expansion": "^2.0.1" + } + } + } + }, + "@typescript-eslint/utils": { + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.18.0.tgz", + "integrity": "sha512-p6GLdY383i7h5b0Qrfbix3Vc3+J2k6QWw6UMUeY5JGfm3C5LbZ4QIZzJNoNOfgyRe0uuYKjvVOsO/jD4SJO+xg==", + "dev": true, + "requires": { + "@eslint-community/eslint-utils": "^4.4.0", + "@typescript-eslint/scope-manager": "8.18.0", + "@typescript-eslint/types": "8.18.0", + "@typescript-eslint/typescript-estree": "8.18.0" + } + }, + "@typescript-eslint/visitor-keys": { + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.18.0.tgz", + "integrity": "sha512-pCh/qEA8Lb1wVIqNvBke8UaRjJ6wrAWkJO5yyIbs8Yx6TNGYyfNjOo61tLv+WwLvoLPp4BQ8B7AHKijl8NGUfw==", + "dev": true, + "requires": { + "@typescript-eslint/types": "8.18.0", + "eslint-visitor-keys": "^4.2.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", + "dev": true + } + } + }, + "@ungap/structured-clone": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.1.tgz", + "integrity": "sha512-fEzPV3hSkSMltkw152tJKNARhOupqbH96MZWyRjNaYZOMIzbrTeQDG+MTc6Mr2pgzFQzFxAfmhGDNP5QK++2ZA==", + "dev": true + }, "@webassemblyjs/ast": { "version": "1.12.1", "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.12.1.tgz", @@ -6996,6 +7835,12 @@ "which": "^2.0.1" } }, + "debounce": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/debounce/-/debounce-1.2.1.tgz", + "integrity": "sha512-XRRe6Glud4rd/ZGQfiV1ruXSfbvfJedlV9Y6zOlP+2K04vBYiJEte6stfFkCP03aMnY5tsipamumUjL14fofug==", + "optional": true + }, "debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", @@ -7115,49 +7960,52 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true + "devOptional": true }, "eslint": { - "version": "8.19.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.19.0.tgz", - "integrity": "sha512-SXOPj3x9VKvPe81TjjUJCYlV4oJjQw68Uek+AM0X4p+33dj2HY5bpTZOgnQHcG2eAm1mtCU9uNMnJi7exU/kYw==", - "dev": true, - "requires": { - "@eslint/eslintrc": "^1.3.0", - "@humanwhocodes/config-array": "^0.9.2", - "ajv": "^6.10.0", + "version": "8.57.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.1.tgz", + "integrity": "sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==", + "dev": true, + "requires": { + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.4", + "@eslint/js": "8.57.1", + "@humanwhocodes/config-array": "^0.13.0", + "@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.1.1", - "eslint-utils": "^3.0.0", - "eslint-visitor-keys": "^3.3.0", - "espree": "^9.3.2", - "esquery": "^1.4.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", - "functional-red-black-tree": "^1.0.1", - "glob-parent": "^6.0.1", - "globals": "^13.15.0", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "graphemer": "^1.4.0", "ignore": "^5.2.0", - "import-fresh": "^3.0.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.1", - "regexpp": "^3.2.0", + "optionator": "^0.9.3", "strip-ansi": "^6.0.1", - "strip-json-comments": "^3.1.0", - "text-table": "^0.2.0", - "v8-compile-cache": "^2.0.3" + "text-table": "^0.2.0" }, "dependencies": { "argparse": { @@ -7167,9 +8015,9 @@ "dev": true }, "eslint-scope": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.1.tgz", - "integrity": "sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==", + "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, "requires": { "esrecurse": "^4.3.0", @@ -7182,6 +8030,16 @@ "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true }, + "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, + "requires": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + } + }, "js-yaml": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", @@ -7190,9 +8048,67 @@ "requires": { "argparse": "^2.0.1" } + }, + "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, + "requires": { + "p-locate": "^5.0.0" + } + }, + "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, + "requires": { + "yocto-queue": "^0.1.0" + } + }, + "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, + "requires": { + "p-limit": "^3.0.2" + } } } }, + "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, + "requires": {} + }, + "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, + "requires": { + "prettier-linter-helpers": "^1.0.0", + "synckit": "^0.9.1" + } + }, + "eslint-plugin-require-extensions": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/eslint-plugin-require-extensions/-/eslint-plugin-require-extensions-0.1.3.tgz", + "integrity": "sha512-T3c1PZ9PIdI3hjV8LdunfYI8gj017UQjzAnCrxuo3wAjneDbTPHdE3oNWInOjMA+z/aBkUtlW5vC0YepYMZIug==", + "dev": true, + "requires": {} + }, + "eslint-plugin-simple-import-sort": { + "version": "12.1.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-simple-import-sort/-/eslint-plugin-simple-import-sort-12.1.1.tgz", + "integrity": "sha512-6nuzu4xwQtE3332Uz0to+TxDQYRLTKRESSc2hefVT48Zc8JthmN23Gx9lnYhu0FtkRSL1oxny3kJ2aveVhmOVA==", + "dev": true, + "requires": {} + }, "eslint-scope": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", @@ -7203,38 +8119,21 @@ "estraverse": "^4.1.1" } }, - "eslint-utils": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", - "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", - "dev": true, - "requires": { - "eslint-visitor-keys": "^2.0.0" - }, - "dependencies": { - "eslint-visitor-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", - "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", - "dev": true - } - } - }, "eslint-visitor-keys": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz", - "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==", + "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 }, "espree": { - "version": "9.3.2", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.3.2.tgz", - "integrity": "sha512-D211tC7ZwouTIuY5x9XnS0E9sWNChB7IYKX/Xp5eQj3nFXhqmiUDB9q27y76oFl8jTg3pXcQx/bpxMfs3CIZbA==", + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", + "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", "dev": true, "requires": { - "acorn": "^8.7.1", + "acorn": "^8.9.0", "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^3.3.0" + "eslint-visitor-keys": "^3.4.1" } }, "esprima": { @@ -7244,9 +8143,9 @@ "dev": true }, "esquery": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", - "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", + "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", "dev": true, "requires": { "estraverse": "^5.1.0" @@ -7337,6 +8236,36 @@ "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", "devOptional": true }, + "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 + }, + "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, + "requires": { + "@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" + }, + "dependencies": { + "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, + "requires": { + "is-glob": "^4.0.1" + } + } + } + }, "fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", @@ -7355,6 +8284,15 @@ "integrity": "sha512-On2N+BpYJ15xIC974QNVuYGMOlEVt4s0EOI3wwMqOmK1fdDY+FN/zltPV8vosq4ad4c/gJ1KHScUn/6AWIgiow==", "optional": true }, + "fastq": { + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", + "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", + "dev": true, + "requires": { + "reusify": "^1.0.4" + } + }, "fb-watchman": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz", @@ -7442,12 +8380,6 @@ "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", "devOptional": true }, - "functional-red-black-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==", - "dev": true - }, "gensync": { "version": "1.0.0-beta.2", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", @@ -7502,9 +8434,9 @@ "optional": true }, "globals": { - "version": "13.16.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.16.0.tgz", - "integrity": "sha512-A1lrQfpNF+McdPOnnFqY3kSN0AFTy485bTi1bkLk4mVPODIUEcSfhHgRqA+QdXPksrSTTztYXx37NFV+GpGk3Q==", + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", "dev": true, "requires": { "type-fest": "^0.20.2" @@ -7516,6 +8448,12 @@ "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", "devOptional": true }, + "graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", + "dev": true + }, "gzip-size": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/gzip-size/-/gzip-size-6.0.0.tgz", @@ -7544,7 +8482,7 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", - "dev": true + "devOptional": true }, "human-signals": { "version": "2.1.0", @@ -7562,9 +8500,9 @@ } }, "ignore": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", - "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", "dev": true }, "import-fresh": { @@ -7663,6 +8601,12 @@ "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "devOptional": true }, + "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 + }, "is-plain-object": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", @@ -8301,12 +9245,6 @@ "p-locate": "^4.1.0" } }, - "lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "optional": true - }, "lodash.memoize": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", @@ -8319,15 +9257,6 @@ "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", "dev": true }, - "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==", - "devOptional": true, - "requires": { - "yallist": "^4.0.0" - } - }, "make-dir": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", @@ -8358,6 +9287,12 @@ "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", "devOptional": true }, + "merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true + }, "micromatch": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", @@ -8397,9 +9332,9 @@ } }, "mrmime": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/mrmime/-/mrmime-1.0.1.tgz", - "integrity": "sha512-hzzEagAgDyoU1Q6yg5uI+AorQgdvMCur3FcKf7NhMKWsaYg+RnbTyHRa/9IlLF9rf455MOCtcqqrQQ83pPP7Uw==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mrmime/-/mrmime-2.0.0.tgz", + "integrity": "sha512-eu38+hdgojoyq63s+yTpN4XMBdt5l8HhMhc4VKLO9KM5caLIBvUm4thi7fFaxyTmCKeNnXZ5pAlBwCUnhA09uw==", "optional": true }, "ms": { @@ -8472,9 +9407,9 @@ "optional": true }, "optionator": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", - "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", "dev": true, "requires": { "deep-is": "^0.1.3", @@ -8482,7 +9417,7 @@ "levn": "^0.4.1", "prelude-ls": "^1.2.1", "type-check": "^0.4.0", - "word-wrap": "^1.2.3" + "word-wrap": "^1.2.5" } }, "p-limit": { @@ -8587,6 +9522,22 @@ "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", "dev": true }, + "prettier": { + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.4.2.tgz", + "integrity": "sha512-e9MewbtFo+Fevyuxn/4rrcDAaq0IYxPGLvObpQjiZBMAzB9IGmzlnG9RZy3FFas+eBMu2vA0CszMeduow5dIuQ==", + "dev": true, + "peer": true + }, + "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, + "requires": { + "fast-diff": "^1.1.2" + } + }, "pretty-format": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", @@ -8633,6 +9584,12 @@ "integrity": "sha512-LA0Y9kxMYv47GIPJy6MI84fqTd2HmYZI83W/kM/SkKfDlajnZYfmXFTxkbY+xSBPkLJxltMa9hIkmdc29eguMA==", "dev": true }, + "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 + }, "randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", @@ -8657,12 +9614,6 @@ "resolve": "^1.9.0" } }, - "regexpp": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", - "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", - "dev": true - }, "require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -8709,6 +9660,12 @@ "integrity": "sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg==", "dev": true }, + "reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true + }, "rimraf": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", @@ -8718,6 +9675,15 @@ "glob": "^7.1.3" } }, + "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, + "requires": { + "queue-microtask": "^1.2.2" + } + }, "safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -8742,13 +9708,10 @@ } }, "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==", - "devOptional": true, - "requires": { - "lru-cache": "^6.0.0" - } + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "devOptional": true }, "serialize-javascript": { "version": "6.0.2", @@ -8790,14 +9753,14 @@ "dev": true }, "sirv": { - "version": "1.0.19", - "resolved": "https://registry.npmjs.org/sirv/-/sirv-1.0.19.tgz", - "integrity": "sha512-JuLThK3TnZG1TAKDwNIqNq6QA2afLOCcm+iE8D1Kj3GA40pSPsxQjjJl0J8X3tsR7T+CP1GavpzLwYkgVLWrZQ==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/sirv/-/sirv-2.0.4.tgz", + "integrity": "sha512-94Bdh3cC2PKrbgSOUqTiGPWVZeSiXfKOVZNJniWoqrWrRkB1CJzBU3NEbiTsPcYy1lDsANA/THzS+9WBiy5nfQ==", "optional": true, "requires": { - "@polka/url": "^1.0.0-next.20", - "mrmime": "^1.0.0", - "totalist": "^1.0.0" + "@polka/url": "^1.0.0-next.24", + "mrmime": "^2.0.0", + "totalist": "^3.0.0" } }, "sisteransi": { @@ -8931,6 +9894,16 @@ "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", "devOptional": true }, + "synckit": { + "version": "0.9.2", + "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.9.2.tgz", + "integrity": "sha512-vrozgXDQwYO72vHjUb/HnFbQx1exDjoKzqx23aXEg2a9VIg2TSFZ8FmeZpTjUCFMYw7mpX4BE2SFu8wI7asYsw==", + "dev": true, + "requires": { + "@pkgr/core": "^0.1.0", + "tslib": "^2.6.2" + } + }, "tapable": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", @@ -9035,11 +10008,18 @@ } }, "totalist": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/totalist/-/totalist-1.1.0.tgz", - "integrity": "sha512-gduQwd1rOdDMGxFG1gEvhV88Oirdo2p+KjoYFU7k2g+i7n6AFFbDQ5kMPUsW0pNbfQsB/cwXvT1i4Bue0s9g5g==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/totalist/-/totalist-3.0.1.tgz", + "integrity": "sha512-sf4i37nQ2LBx4m3wB74y+ubopq6W/dIzXg0FDGjsYnZHVa1Da8FH853wlL2gtUhg+xJXjfk3kUZS3BRoQeoQBQ==", "optional": true }, + "ts-api-utils": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.4.3.tgz", + "integrity": "sha512-i3eMG77UTMD0hZhgRS562pv83RC6ukSAC2GMNWc+9dieh/+jDM5u5YG+NHX6VNDRHQcHwmsTHctP9LhbC3WxVw==", + "dev": true, + "requires": {} + }, "ts-jest": { "version": "29.1.2", "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.1.2.tgz", @@ -9068,6 +10048,12 @@ "semver": "^7.3.4" } }, + "tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "dev": true + }, "type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", @@ -9096,9 +10082,9 @@ "devOptional": true }, "undici-types": { - "version": "5.26.5", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "version": "6.20.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz", + "integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==", "devOptional": true }, "update-browserslist-db": { @@ -9120,12 +10106,6 @@ "punycode": "^2.1.0" } }, - "v8-compile-cache": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", - "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", - "dev": true - }, "v8-to-istanbul": { "version": "9.2.0", "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.2.0.tgz", @@ -9188,19 +10168,22 @@ } }, "webpack-bundle-analyzer": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/webpack-bundle-analyzer/-/webpack-bundle-analyzer-4.5.0.tgz", - "integrity": "sha512-GUMZlM3SKwS8Z+CKeIFx7CVoHn3dXFcUAjT/dcZQQmfSZGvitPfMob2ipjai7ovFFqPvTqkEZ/leL4O0YOdAYQ==", + "version": "4.10.2", + "resolved": "https://registry.npmjs.org/webpack-bundle-analyzer/-/webpack-bundle-analyzer-4.10.2.tgz", + "integrity": "sha512-vJptkMm9pk5si4Bv922ZbKLV8UTT4zib4FPgXMhgzUny0bfDDkLXAVQs3ly3fS4/TN9ROFtb0NFrm04UXFE/Vw==", "optional": true, "requires": { + "@discoveryjs/json-ext": "0.5.7", "acorn": "^8.0.4", "acorn-walk": "^8.0.0", - "chalk": "^4.1.0", "commander": "^7.2.0", + "debounce": "^1.2.1", + "escape-string-regexp": "^4.0.0", "gzip-size": "^6.0.0", - "lodash": "^4.17.20", + "html-escaper": "^2.0.2", "opener": "^1.5.2", - "sirv": "^1.0.7", + "picocolors": "^1.0.0", + "sirv": "^2.0.3", "ws": "^7.3.1" }, "dependencies": { @@ -9272,9 +10255,9 @@ "optional": true }, "word-wrap": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.4.tgz", - "integrity": "sha512-2V81OA4ugVo5pRo46hAoD2ivUJx8jXmWXfUkY4KFNw0hEptvN0QfH3K4nHiwzGeKl5rFKedV48QVoqYavy4YpA==", + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", "dev": true }, "wrap-ansi": { @@ -9316,12 +10299,6 @@ "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", "dev": true }, - "yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "devOptional": true - }, "yargs": { "version": "17.7.2", "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", diff --git a/package.json b/package.json index 8f1bab0..0e0920c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "okx-api", - "version": "1.4.14", + "version": "1.5.0", "description": "Complete & robust Node.js SDK for OKX's REST APIs and WebSockets, with TypeScript & end-to-end tests", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -16,6 +16,7 @@ "build:clean": "npm run clean && npm run build", "build:watch": "npm run clean && tsc --watch", "pack": "webpack --config webpack/webpack.config.js", + "lint": "eslint src", "prepublish": "npm run build:clean", "betapublish": "npm publish --tag beta" }, @@ -28,8 +29,13 @@ }, "devDependencies": { "@types/jest": "^29.5.11", - "@types/node": "^20.11.6", - "eslint": "^8.19.0", + "@types/node": "^22.10.2", + "@typescript-eslint/eslint-plugin": "^8.18.0", + "eslint": "^8.24.0", + "eslint-config-prettier": "^9.1.0", + "eslint-plugin-prettier": "^5.2.1", + "eslint-plugin-require-extensions": "^0.1.3", + "eslint-plugin-simple-import-sort": "^12.1.1", "jest": "^29.7.0", "ts-jest": "^29.1.2", "typescript": "^5.3.3" @@ -37,9 +43,9 @@ "optionalDependencies": { "source-map-loader": "^4.0.0", "ts-loader": "^9.3.1", - "webpack": "^5.4.0", - "webpack-bundle-analyzer": "^4.1.0", - "webpack-cli": "^4.2.0" + "webpack": "^5.74.0", + "webpack-bundle-analyzer": "^4.6.1", + "webpack-cli": "^4.10.0" }, "keywords": [ "okx", diff --git a/src/index.ts b/src/index.ts index 6772019..c4e1dfe 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,5 +1,5 @@ -export * from './rest-client'; -export * from './websocket-client'; -export * from './util'; export * from './constants'; +export * from './rest-client'; export * from './types'; +export * from './util'; +export * from './websocket-client'; diff --git a/src/rest-client.ts b/src/rest-client.ts index 245ccc5..18d5dd6 100644 --- a/src/rest-client.ts +++ b/src/rest-client.ts @@ -1,257 +1,256 @@ import { AxiosRequestConfig } from 'axios'; -import { getRestBaseUrl } from './util/requestUtils'; -import BaseRestClient from './util/BaseRestClient'; + +import { ASSET_BILL_TYPE } from './constants'; import { - ContractGridDirection, - GridAlgoOrderType, - GridAlgoSubOrderType, - InstrumentType, - MarginMode, - numberInString, - Ticker, - AmendOrderRequest, - CancelAlgoOrderRequest, - OrderIdRequest, - ClosePositionRequest, - OrderRequest, - OrderHistoryRequest, - FillsHistoryRequest, - AlgoRecentHistoryRequest, - AlgoLongHistoryRequest, - PaginatedSymbolRequest, - OrderResult, - CancelledOrderResult, - AmendedOrder, - ClosedPositions, - OrderDetails, - OrderListItem, - HistoricOrder, - OrderFill, - AlgoOrderResult, - AlgoOrderListItem, - HistoricAlgoOrder, - BlockCounterParty, - CreateBlockRFQRequest, - CreateRFQResult, - CancelBlockRFQRequest, - CancelBlockQuoteResult, - CancelMultipleBlockRFQRequest, - TimestampObject, - ExecuteBlockQuoteResult, - ExecuteBlockQuoteRequest, - CreateBlockQuoteRequest, - CreateBlockQuoteResult, - CancelBlockRFQResult, - CancelBlockQuoteRequest, - CancelMultipleBlockQuoteRequest, - BlockRFQResult, - GetBlockRFQSParams, - GetBlockQuoteParams, - GetBlockQuoteResult, - FundingCurrency, - FundingBalance, AccountAssetValuation, - FundTransferResult, - FundTransferState, - AssetBillDetails, AccountBalance, - GetPositionsParams, - AccountPosition, - GetHistoricPositionParams, - HistoricAccountPosition, - AccountPositionRisk, AccountBill, - AccountConfiguration, - AccountPositionModeResult, - AccountLeverageResult, - AccountMaxOrderAmount, - AccountMaxTradableAmount, AccountChangeMarginResult, + AccountConfiguration, + AccountFeeRate, + AccountHistoryBill, + AccountInstrument, + AccountIsolatedMode, AccountLevel, AccountLeverage, + AccountLeverageResult, AccountMaxLoan, + AccountMaxOrderAmount, + AccountMaxTradableAmount, AccountModeResult, - AccountFeeRate, - AccountIsolatedMode, - AutoLoanResult, - SubAccount, - SubAccountAPIReset, - SubAccountBalances, - SubAccountTransferResult, - IndexTicker, - OrderBook, - Candle, - CandleNoVolume, - Trade, - Pagination, - APIResponse, - GetGridAlgoOrdersRequest, - FundsTransferRequest, - WithdrawRequest, - WithdrawResponse, - ConvertTradeRequest, - ConvertQuoteEstimateRequest, - SetLeverageRequest, - ChangePositionMarginRequest, - SubAccountTransferRequest, - GridAlgoOrderRequest, - StopGridAlgoOrderRequest, - APICredentials, - RestClientOptions, - APIMarket, - Instrument, - PosMode, + AccountPosition, + AccountPositionModeResult, + AccountPositionRisk, + AccountRiskState, + AdjustLeverageInfo, + AdjustMarginBalanceRequest, + AlgoLongHistoryRequest, AlgoOrderDetailsRequest, AlgoOrderDetailsResult, + AlgoOrderListItem, + AlgoOrderRequest, + AlgoOrderResult, + AlgoRecentHistoryRequest, AmendAlgoOrderRequest, AmendAlgoOrderResult, - AlgoOrderRequest, + AmendedOrder, + AmendOrderRequest, + AmendRecurringBuyOrderRequest, + AmendTPSLRequest, + Announcement, + APICredentials, + APIMarket, + APIResponse, + AssetBillDetails, + AutoLoanResult, + BlockCounterParty, + BlockMakerInstrumentSettings, + BlockMMPConfig, + BlockRFQResult, + BorrowRepayHistoryItem, + CancelAlgoOrderRequest, + CancelAllAfterResponse, + CancelBlockQuoteRequest, + CancelBlockQuoteResult, + CancelBlockRFQRequest, + CancelBlockRFQResult, + CancelledOrderResult, + CancelMultipleBlockQuoteRequest, + CancelMultipleBlockRFQRequest, + CancelSignalBotsResult, + CancelSpreadOrderResponse, + CancelSubOrderRequest, + Candle, + CandleNoVolume, + CandleRequest, + ChangePositionMarginRequest, + CloseContractGridPositionRequest, + ClosedPositions, + ClosePositionRequest, + CloseSubpositionRequest, + ContractGridDirection, + ConvertQuoteEstimateRequest, + ConvertTradeRequest, + CopySettingsRequest, + CreateBlockQuoteRequest, + CreateBlockQuoteResult, + CreateBlockRFQRequest, + CreateRFQResult, + CreateSignalBotRequest, + CreateSignalBotResult, + CreateSignalRequest, + CreateSignalResult, + CurrentSubposition, EconomicCalendarData, - UnitConvertData, EconomicCalendarRequest, - UnitConvertRequest, - PositionSide, - AdjustLeverageInfo, - InterestAccrued, - InterestRate, - Greeks, - AccountRiskState, - SystemTime, - MaxWithdrawal, - WithdrawalHistoryRequest, - FundingRateRequest, - GetInstrumentsRequest, - QuickMarginBorrowRepayRequest, - GetQuickMarginBorrowRepayHistoryRequest, - GetVIPInterestRequest, - VIPInterest, - GetVIPLoanOrderListRequest, - VIPLoanOrder, - GetVIPLoanOrderDetailRequest, - VIPLoanOrderDetail, + ExecuteBlockQuoteRequest, + ExecuteBlockQuoteResult, + FillsHistoryRequest, FixedLoanBorrowingLimit, - GetFixedLoanBorrowQuoteRequest, FixedLoanBorrowQuote, - SubmitFixedLoanBorrowingOrderRequest, - UpdateFixedLoanBorrowingOrderRequest, - GetFixedLoanBorrowingOrdersListRequest, - PositionBuilderRequest, - SetMMPConfigRequest, - MMPConfig, - CancelAllAfterResponse, - CloseContractGridPositionRequest, - GetRSIBackTestingRequest, - SubAccountMaxWithdrawal, - GetSubAccountMaxWithdrawalsRequest, - GetManagedSubAccountTransferHistoryRequest, - ManagedSubAccountTransfer, - SetSubAccountLoanAllocationRequest, - NonTradableAsset, - GetDepositWithdrawStatusRequest, - GetPremiumHistoryRequest, + FundingBalance, + FundingCurrency, + FundingRateRequest, + FundsTransferRequest, + FundTransferResult, + FundTransferState, + GetAccountConfigurationResult, + GetActiveSpreadOrdersRequest, + GetBlockQuoteParams, + GetBlockQuoteResult, + GetBlockRFQSParams, + GetBorrowRepayHistoryRequest, GetContractOpenInterestHistoryRequest, GetContractTakerVolumeRequest, - GetTopTradersContractLongShortRatioRequest, + GetCopySettingsResult, + GetCopyTradersRequest, + GetCopyTradersResult, + GetCopyTradingConfigResult, + GetCTBatchLeverageInfoRequest, + GetCTBatchLeverageInfoResult, + GetCTHistoryLeadTradersRequest, + GetCTHistoryLeadTradersResult, + GetCTMyLeadTradersResult, + GetCTProfitDetailsRequest, + GetCTProfitDetailsResult, + GetCTTotalProfitResult, + GetCTUnrealizedProfitResult, + GetCurrentSubpositionsRequest, + GetDepositWithdrawStatusRequest, + GetFixedLoanBorrowingOrdersListRequest, + GetFixedLoanBorrowQuoteRequest, + GetGridAlgoOrdersRequest, + GetHistoricPositionParams, + GetInstrumentsRequest, + GetLeadTraderPositionsRequest, + GetLeadTraderRanksRequest, + GetLeadTraderRanksResult, + GetLeadTraderStatsRequest, GetLendingOrderListRequest, GetLendingSubOrderListRequest, - LendingOrder, - CreateSignalRequest, - GetSignalsRequest, - CreateSignalBotRequest, - AdjustMarginBalanceRequest, - AmendTPSLRequest, - SetSignalInstrumentsRequest, - GetSignalBotRequest, + GetManagedSubAccountTransferHistoryRequest, + GetOptionTradesRequest, + GetPositionsParams, + GetPremiumHistoryRequest, + GetPrivateLeadTraderRanksRequest, + GetPrivateLeadTraderRanksResult, + GetQuickMarginBorrowRepayHistoryRequest, + GetRecurringBuyOrderListRequest, + GetRSIBackTestingRequest, + GetSignalBotEventHistoryRequest, GetSignalBotPositionHistoryRequest, - PlaceSubOrderRequest, - CancelSubOrderRequest, + GetSignalBotRequest, GetSignalBotSubOrdersRequest, - GetSignalBotEventHistoryRequest, - GetCurrentSubpositionsRequest, + GetSignalsRequest, + GetSignalsResult, + GetSpreadCandlesRequest, + GetSpreadOrderHistoryArchiveRequest, + GetSpreadOrderHistoryRequest, + GetSpreadsRequest, + GetSpreadTradesRequest, + GetSubAccountMaxWithdrawalsRequest, GetSubpositionsHistoryRequest, - PlaceCTAlgoOrderRequest, - CloseSubpositionRequest, - GetCTProfitDetailsRequest, - CopySettingsRequest, - AmendRecurringBuyOrderRequest, - GetRecurringBuyOrderListRequest, - PlaceRecurringBuyOrderRequest, - SetCTBatchLeverageRequest, - GetCTBatchLeverageInfoRequest, - GetCTHistoryLeadTradersRequest, - GetLeadTraderRanksRequest, - LeadTraderPnl, - LeadTraderStats, - GetLeadTraderStatsRequest, - LeadTraderPreference, + GetTopTradersContractLongShortRatioRequest, + GetVIPInterestRequest, + GetVIPLoanOrderDetailRequest, + GetVIPLoanOrderListRequest, + Greeks, + GridAlgoOrderRequest, + GridAlgoOrderType, + GridAlgoSubOrderType, + HistoricAccountPosition, + HistoricAlgoOrder, + HistoricOrder, + IndexTicker, + Instrument, + InstrumentType, + InterestAccrued, + InterestRate, LeadTraderCurrentPosition, - GetLeadTraderPositionsRequest, + LeadTraderPnl, LeadTraderPositionHistory, - GetCopyTradersRequest, - GetPrivateLeadTraderRanksRequest, + LeadTraderPreference, + LeadTraderStats, + LendingOrder, + ManagedSubAccountTransfer, + MarginMode, + MaxGridQuantityRequest, + MaxWithdrawal, + MMPConfig, + NonTradableAsset, + numberInString, OptionTrade, - GetOptionTradesRequest, OptionTrades, - BlockMakerInstrumentSettings, - SetQuoteProductsRequest, - SetMmpConfigRequest, + OrderBook, + OrderDetails, + OrderFill, + OrderHistoryRequest, + OrderIdRequest, + OrderListItem, + OrderPrecheckRequest, + OrderRequest, + OrderResult, + PaginatedSymbolRequest, + Pagination, + PlaceCTAlgoOrderRequest, + PlaceCTAlgoOrderResult, + PlaceRecurringBuyOrderRequest, PlaceSpreadOrderRequest, PlaceSpreadOrderResponse, - CancelSpreadOrderResponse, - UpdateSpreadOrderRequest, - UpdateSpreadOrderResponse, - SpreadOrder, - GetActiveSpreadOrdersRequest, - GetSpreadOrderHistoryRequest, - GetSpreadOrderHistoryArchiveRequest, - GetSpreadTradesRequest, - SpreadTrade, - SpreadDetails, - GetSpreadsRequest, - SpreadOrderBook, - SpreadTicker, + PlaceSubOrderRequest, + PositionBuilderRequest, + PositionSide, + PosMode, + PublicBlockTrade, PublicSpreadTrade, - GetSpreadCandlesRequest, - SpreadCandle, - CandleRequest, - AccountInstrument, - SetMMPConfigResult, - CreateSignalResult, - GetSignalsResult, - CreateSignalBotResult, - CancelSignalBotsResult, - RecurringBuyOrderResult, + QuickMarginBorrowRepayRecord, + QuickMarginBorrowRepayRequest, + QuickMarginBorrowRepayResult, RecurringBuyOrder, + RecurringBuyOrderResult, RecurringBuySubOrder, - SubpositionsHistory, - CurrentSubposition, - GetAccountConfigurationResult, - GetCTBatchLeverageInfoResult, - GetCTHistoryLeadTradersResult, - GetCTMyLeadTradersResult, - GetCTProfitDetailsResult, - GetCTTotalProfitResult, - GetCTUnrealizedProfitResult, - GetCopySettingsResult, - GetCopyTradersResult, - GetCopyTradingConfigResult, - GetLeadTraderRanksResult, - GetPrivateLeadTraderRanksResult, - PlaceCTAlgoOrderResult, + RestClientOptions, + SetCTBatchLeverageRequest, SetCTBatchLeverageResult, - QuickMarginBorrowRepayRecord, - BlockMMPConfig, - PublicBlockTrade, - QuickMarginBorrowRepayResult, + SetLeverageRequest, + SetMMPConfigRequest, + SetMmpConfigRequest, + SetMMPConfigResult, SetMmpConfigResult, - OrderPrecheckRequest, - AccountHistoryBill, - MaxGridQuantityRequest, - GetBorrowRepayHistoryRequest, - BorrowRepayHistoryItem, - Announcement, + SetQuoteProductsRequest, + SetSignalInstrumentsRequest, + SetSubAccountLoanAllocationRequest, + SpreadCandle, + SpreadDetails, + SpreadOrder, + SpreadOrderBook, + SpreadTicker, + SpreadTrade, + StopGridAlgoOrderRequest, + SubAccount, + SubAccountAPIReset, + SubAccountBalances, + SubAccountMaxWithdrawal, + SubAccountTransferRequest, + SubAccountTransferResult, + SubmitFixedLoanBorrowingOrderRequest, + SubpositionsHistory, + SystemTime, + Ticker, + TimestampObject, + Trade, + UnitConvertData, + UnitConvertRequest, + UpdateFixedLoanBorrowingOrderRequest, + UpdateSpreadOrderRequest, + UpdateSpreadOrderResponse, + VIPInterest, + VIPLoanOrder, + VIPLoanOrderDetail, + WithdrawalHistoryRequest, + WithdrawRequest, + WithdrawResponse, } from './types'; -import { ASSET_BILL_TYPE } from './constants'; import { AccruedInterestItem, AccruedInterestRequest, @@ -263,6 +262,8 @@ import { MaxLoanRequest, MaxLoanResponse, } from './types/rest/response/private-flexible-loan'; +import BaseRestClient from './util/BaseRestClient'; +import { getRestBaseUrl } from './util/requestUtils'; export class RestClient extends BaseRestClient { /** @@ -272,14 +273,14 @@ export class RestClient extends BaseRestClient { credentials?: APICredentials | null, environment: APIMarket = 'prod', restClientOptions: RestClientOptions = {}, - requestOptions: AxiosRequestConfig = {} + requestOptions: AxiosRequestConfig = {}, ) { super( credentials, getRestBaseUrl(environment, restClientOptions), restClientOptions, requestOptions, - environment + environment, ); return this; } @@ -329,18 +330,18 @@ export class RestClient extends BaseRestClient { `Your approximate latency to exchange server: One way: ${estimatedOneWayLatency}ms. Round trip: ${roundTripTime}ms. - ` + `, ); if (timeDifference > 500) { console.warn( `WARNING! Time difference between server and client clock is greater than 500ms. It is currently ${timeDifference}ms. Consider adjusting your system clock to avoid unwanted clock sync errors! - Visit https://github.com/tiagosiebler/awesome-crypto-examples/wiki/Timestamp-for-this-request-is-outside-of-the-recvWindow for more information` + Visit https://github.com/tiagosiebler/awesome-crypto-examples/wiki/Timestamp-for-this-request-is-outside-of-the-recvWindow for more information`, ); } else { console.log( - `Time difference between server and client clock is within acceptable range of 500ms. It is currently ${timeDifference}ms.` + `Time difference between server and client clock is within acceptable range of 500ms. It is currently ${timeDifference}ms.`, ); } @@ -374,7 +375,7 @@ export class RestClient extends BaseRestClient { */ getAccountInstruments( - params: GetInstrumentsRequest + params: GetInstrumentsRequest, ): Promise { return this.getPrivate('/api/v5/account/instruments', params); } @@ -388,13 +389,13 @@ export class RestClient extends BaseRestClient { } getPositionsHistory( - params?: GetHistoricPositionParams + params?: GetHistoricPositionParams, ): Promise { return this.getPrivate('/api/v5/account/positions-history', params); } getAccountPositionRisk( - instType?: Omit<'SPOT', InstrumentType> + instType?: Omit<'SPOT', InstrumentType>, ): Promise { return this.getPrivate('/api/v5/account/account-position-risk', { instType, @@ -472,7 +473,7 @@ export class RestClient extends BaseRestClient { } changePositionMargin( - params: ChangePositionMarginRequest + params: ChangePositionMarginRequest, ): Promise { return this.postPrivate('/api/v5/account/position/margin-balance', params); } @@ -514,7 +515,7 @@ export class RestClient extends BaseRestClient { instId: string, mgnMode: MarginMode, mgnCcy?: string | undefined, - ccy?: string + ccy?: string, ): Promise { return this.getPrivate('/api/v5/account/max-loan', { instId, @@ -542,7 +543,7 @@ export class RestClient extends BaseRestClient { instId?: string, uly?: string, instFamily?: string, - ruleType?: string + ruleType?: string, ): Promise { return this.getPrivate('/api/v5/account/trade-fee', { instType, @@ -585,7 +586,7 @@ export class RestClient extends BaseRestClient { setIsolatedMode( isoMode: 'automatic' | 'autonomy', - type: 'MARGIN' | 'CONTRACTS' + type: 'MARGIN' | 'CONTRACTS', ): Promise { return this.postPrivate('/api/v5/account/set-isolated-mode', { isoMode, @@ -602,20 +603,20 @@ export class RestClient extends BaseRestClient { } submitQuickMarginBorrowRepay( - params: QuickMarginBorrowRepayRequest + params: QuickMarginBorrowRepayRequest, ): Promise { return this.postPrivate( '/api/v5/account/quick-margin-borrow-repay', - params + params, ); } getQuickMarginBorrowRepayHistory( - params: GetQuickMarginBorrowRepayHistoryRequest + params: GetQuickMarginBorrowRepayHistoryRequest, ): Promise { return this.getPrivate( '/api/v5/account/quick-margin-borrow-repay-history', - params + params, ); } @@ -623,7 +624,7 @@ export class RestClient extends BaseRestClient { ccy: string, side: 'borrow' | 'repay', amt: numberInString, - ordId?: string + ordId?: string, ): Promise { return this.postPrivate('/api/v5/account/borrow-repay', { ccy, @@ -642,19 +643,19 @@ export class RestClient extends BaseRestClient { } getVIPInterestDeducted( - params: GetVIPInterestRequest + params: GetVIPInterestRequest, ): Promise { return this.getPrivate('/api/v5/account/vip-interest-deducted', params); } getVIPLoanOrders( - params: GetVIPLoanOrderListRequest + params: GetVIPLoanOrderListRequest, ): Promise { return this.getPrivate('/api/v5/account/vip-loan-order-list', params); } getVIPLoanOrder( - params: GetVIPLoanOrderDetailRequest + params: GetVIPLoanOrderDetailRequest, ): Promise { return this.getPrivate('/api/v5/account/vip-loan-order-detail', params); } @@ -671,16 +672,16 @@ export class RestClient extends BaseRestClient { } getFixedLoanBorrowQuote( - params: GetFixedLoanBorrowQuoteRequest + params: GetFixedLoanBorrowQuoteRequest, ): Promise { return this.getPrivate( '/api/v5/account/fixed-loan/borrowing-quote', - params + params, ); } submitFixedLoanBorrowOrder( - params: SubmitFixedLoanBorrowingOrderRequest + params: SubmitFixedLoanBorrowingOrderRequest, ): Promise< { ordId: string; @@ -688,12 +689,12 @@ export class RestClient extends BaseRestClient { > { return this.postPrivate( '/api/v5/account/fixed-loan/borrowing-order', - params + params, ); } updateFixedLoanBorrowOrder( - params: UpdateFixedLoanBorrowingOrderRequest + params: UpdateFixedLoanBorrowingOrderRequest, ): Promise< { ordId: string; @@ -701,7 +702,7 @@ export class RestClient extends BaseRestClient { > { return this.postPrivate( '/api/v5/account/fixed-loan/amend-borrowing-order', - params + params, ); } @@ -715,7 +716,7 @@ export class RestClient extends BaseRestClient { > { return this.postPrivate( '/api/v5/account/fixed-loan/manual-reborrow', - params + params, ); } @@ -726,7 +727,7 @@ export class RestClient extends BaseRestClient { > { return this.postPrivate( '/api/v5/account/fixed-loan/repay-borrowing-order', - params + params, ); } @@ -737,7 +738,7 @@ export class RestClient extends BaseRestClient { > { return this.postPrivate( '/api/v5/account/fixed-loan/convert-to-market-loan', - params + params, ); } @@ -752,16 +753,16 @@ export class RestClient extends BaseRestClient { > { return this.postPrivate( '/api/v5/account/fixed-loan/reduce-liabilities', - params + params, ); } getFixedLoanBorrowOrders( - params: GetFixedLoanBorrowingOrdersListRequest + params: GetFixedLoanBorrowingOrdersListRequest, ): Promise { return this.getPrivate( '/api/v5/account/fixed-loan/borrowing-orders-list', - params + params, ); } @@ -788,10 +789,11 @@ export class RestClient extends BaseRestClient { } getBorrowRepayHistory( - params?: GetBorrowRepayHistoryRequest + params?: GetBorrowRepayHistoryRequest, ): Promise { return this.getPrivate('/api/v5/account/spot-borrow-repay-history', params); } + positionBuilder(params: PositionBuilderRequest): Promise { return this.postPrivate('/api/v5/account/position-builder', params); } @@ -847,7 +849,7 @@ export class RestClient extends BaseRestClient { }): Promise { return this.postPrivate( '/api/v5/account/account-level-switch-preset', - params + params, ); } @@ -856,7 +858,7 @@ export class RestClient extends BaseRestClient { }): Promise { return this.getPrivate( '/api/v5/account/set-account-switch-precheck', - params + params, ); } @@ -901,7 +903,7 @@ export class RestClient extends BaseRestClient { } cancelMultipleOrders( - params: OrderIdRequest[] + params: OrderIdRequest[], ): Promise { return this.postPrivate('/api/v5/trade/cancel-batch-orders', params); } @@ -937,7 +939,7 @@ export class RestClient extends BaseRestClient { * Get history for last 3 months */ getOrderHistoryArchive( - params: OrderHistoryRequest + params: OrderHistoryRequest, ): Promise { return this.getPrivate('/api/v5/trade/orders-history-archive', params); } @@ -971,7 +973,7 @@ export class RestClient extends BaseRestClient { submitEasyConvert( fromCcys: string[], toCcy: string, - source?: string + source?: string, ): Promise> { return this.postPrivate('/api/v5/trade/easy-convert', { fromCcy: fromCcys, @@ -990,7 +992,7 @@ export class RestClient extends BaseRestClient { * Debt currencies include both cross and isolated debts. */ getOneClickRepayCurrencyList( - debtType?: 'cross' | 'isolated' + debtType?: 'cross' | 'isolated', ): Promise> { return this.getPrivate('/api/v5/trade/one-click-repay-currency-list', { debtType, @@ -1004,7 +1006,7 @@ export class RestClient extends BaseRestClient { */ submitOneClickRepay( debtCcys: string[], - repayCcy: string + repayCcy: string, ): Promise> { return this.postPrivate('/api/v5/trade/one-click-repay', { debtCcy: debtCcys.join(','), @@ -1055,37 +1057,37 @@ export class RestClient extends BaseRestClient { } cancelAlgoOrder( - params: CancelAlgoOrderRequest[] + params: CancelAlgoOrderRequest[], ): Promise { return this.postPrivate('/api/v5/trade/cancel-algos', params); } amendAlgoOrder( - params: AmendAlgoOrderRequest + params: AmendAlgoOrderRequest, ): Promise { return this.postPrivate('/api/v5/trade/amend-algos', params); } cancelAdvanceAlgoOrder( - params: CancelAlgoOrderRequest[] + params: CancelAlgoOrderRequest[], ): Promise { return this.postPrivate('/api/v5/trade/cancel-advance-algos', params); } getAlgoOrderDetails( - params: AlgoOrderDetailsRequest + params: AlgoOrderDetailsRequest, ): Promise { return this.getPrivate('/api/v5/trade/order-algo', params); } getAlgoOrderList( - params: AlgoRecentHistoryRequest + params: AlgoRecentHistoryRequest, ): Promise { return this.getPrivate('/api/v5/trade/orders-algo-pending', params); } getAlgoOrderHistory( - params: AlgoLongHistoryRequest + params: AlgoLongHistoryRequest, ): Promise { return this.getPrivate('/api/v5/trade/orders-algo-history', params); } @@ -1103,7 +1105,7 @@ export class RestClient extends BaseRestClient { amendGridAlgoOrder( algoId: string, instId: string, - triggerPx: { slTriggerPx?: numberInString; tpTriggerPx?: numberInString } + triggerPx: { slTriggerPx?: numberInString; tpTriggerPx?: numberInString }, ): Promise { return this.postPrivate('/api/v5/tradingBot/grid/amend-order-algo', { algoId, @@ -1117,7 +1119,7 @@ export class RestClient extends BaseRestClient { } closeGridContractPosition( - params: CloseContractGridPositionRequest + params: CloseContractGridPositionRequest, ): Promise { return this.postPrivate('/api/v5/tradingBot/grid/close-position', params); } @@ -1128,7 +1130,7 @@ export class RestClient extends BaseRestClient { }): Promise { return this.postPrivate( '/api/v5/tradingBot/grid/cancel-close-order', - params + params, ); } @@ -1140,27 +1142,27 @@ export class RestClient extends BaseRestClient { > { return this.postPrivate( '/api/v5/tradingBot/grid/order-instant-trigger', - params + params, ); } getGridAlgoOrderList(params: GetGridAlgoOrdersRequest): Promise { return this.getPrivate( '/api/v5/tradingBot/grid/orders-algo-pending', - params + params, ); } getGridAlgoOrderHistory(params: GetGridAlgoOrdersRequest): Promise { return this.getPrivate( '/api/v5/tradingBot/grid/orders-algo-history', - params + params, ); } getGridAlgoOrderDetails( algoOrdType: GridAlgoOrderType, - algoId: string + algoId: string, ): Promise { return this.getPrivate('/api/v5/tradingBot/grid/orders-algo-details', { algoOrdType, @@ -1177,7 +1179,7 @@ export class RestClient extends BaseRestClient { after?: numberInString; before?: numberInString; limit?: number; - } + }, ): Promise { return this.getPrivate('/api/v5/tradingBot/grid/sub-orders', { algoOrdType, @@ -1191,7 +1193,7 @@ export class RestClient extends BaseRestClient { /** Only contract grid supports this method */ getGridAlgoOrderPositions( algoOrdType: 'contract_grid', - algoId: string + algoId: string, ): Promise { return this.getPrivate('/api/v5/tradingBot/grid/positions', { algoOrdType, @@ -1208,7 +1210,7 @@ export class RestClient extends BaseRestClient { computeGridMarginBalance( algoId: string, type: 'add' | 'reduce', - amt?: numberInString + amt?: numberInString, ): Promise { return this.postPrivate('/api/v5/tradingBot/grid/compute-margin-balance', { algoId, @@ -1220,7 +1222,7 @@ export class RestClient extends BaseRestClient { adjustGridMarginBalance( algoId: string, type: 'add' | 'reduce', - change: { amt?: numberInString; percent?: numberInString } + change: { amt?: numberInString; percent?: numberInString }, ): Promise { return this.postPrivate('/api/v5/tradingBot/grid/margin-balance', { algoId, @@ -1236,7 +1238,7 @@ export class RestClient extends BaseRestClient { > { return this.postPrivate( '/api/v5/tradingBot/grid/adjust-investment', - params + params, ); } @@ -1244,7 +1246,7 @@ export class RestClient extends BaseRestClient { algoOrdType: GridAlgoOrderType, instId: string, direction: ContractGridDirection, - duration?: '7D' | '30D' | '180D' + duration?: '7D' | '30D' | '180D', ): Promise { return this.get('/api/v5/tradingBot/grid/ai-param', { algoOrdType, @@ -1292,7 +1294,7 @@ export class RestClient extends BaseRestClient { } createSignalBot( - params: CreateSignalBotRequest + params: CreateSignalBotRequest, ): Promise { return this.postPrivate('/api/v5/tradingBot/signal/order-algo', params); } @@ -1302,7 +1304,7 @@ export class RestClient extends BaseRestClient { }): Promise { return this.postPrivate( '/api/v5/tradingBot/signal/stop-order-algo', - params + params, ); } @@ -1329,7 +1331,7 @@ export class RestClient extends BaseRestClient { > { return this.postPrivate( '/api/v5/tradingBot/signal/set-instruments', - params + params, ); } @@ -1339,21 +1341,21 @@ export class RestClient extends BaseRestClient { }): Promise { return this.getPrivate( '/api/v5/tradingBot/signal/orders-algo-details', - params + params, ); } getActiveSignalBot(params: GetSignalBotRequest): Promise { return this.getPrivate( '/api/v5/tradingBot/signal/orders-algo-details', - params + params, ); } getSignalBotHistory(params: GetSignalBotRequest): Promise { return this.getPrivate( '/api/v5/tradingBot/signal/orders-algo-history', - params + params, ); } @@ -1365,11 +1367,11 @@ export class RestClient extends BaseRestClient { } getSignalBotPositionHistory( - params: GetSignalBotPositionHistoryRequest + params: GetSignalBotPositionHistoryRequest, ): Promise { return this.getPrivate( '/api/v5/tradingBot/signal/positions-history', - params + params, ); } @@ -1388,7 +1390,7 @@ export class RestClient extends BaseRestClient { cancelSubOrder(params: CancelSubOrderRequest): Promise { return this.postPrivate( '/api/v5/tradingBot/signal/cancel-sub-order', - params + params, ); } @@ -1397,7 +1399,7 @@ export class RestClient extends BaseRestClient { } getSignalBotEventHistory( - params: GetSignalBotEventHistoryRequest + params: GetSignalBotEventHistoryRequest, ): Promise { return this.getPrivate('/api/v5/tradingBot/signal/event-history', params); } @@ -1409,17 +1411,17 @@ export class RestClient extends BaseRestClient { */ submitRecurringBuyOrder( - params: PlaceRecurringBuyOrderRequest + params: PlaceRecurringBuyOrderRequest, ): Promise { return this.postPrivate('/api/v5/tradingBot/recurring/order-algo', params); } amendRecurringBuyOrder( - params: AmendRecurringBuyOrderRequest + params: AmendRecurringBuyOrderRequest, ): Promise { return this.postPrivate( '/api/v5/tradingBot/recurring/amend-order-algo', - params + params, ); } @@ -1428,25 +1430,25 @@ export class RestClient extends BaseRestClient { }): Promise { return this.postPrivate( '/api/v5/tradingBot/recurring/stop-order-algo', - params + params, ); } getRecurringBuyOrders( - params: GetRecurringBuyOrderListRequest + params: GetRecurringBuyOrderListRequest, ): Promise { return this.getPrivate( '/api/v5/tradingBot/recurring/orders-algo-pending', - params + params, ); } getRecurringBuyOrderHistory( - params: GetRecurringBuyOrderListRequest + params: GetRecurringBuyOrderListRequest, ): Promise { return this.getPrivate( '/api/v5/tradingBot/recurring/orders-algo-history', - params + params, ); } @@ -1455,12 +1457,12 @@ export class RestClient extends BaseRestClient { }): Promise { return this.getPrivate( '/api/v5/tradingBot/recurring/orders-algo-details', - params + params, ); } getRecurringBuySubOrders( - params: GetRecurringBuyOrderListRequest + params: GetRecurringBuyOrderListRequest, ): Promise { return this.getPrivate('/api/v5/tradingBot/recurring/sub-orders', params); } @@ -1472,19 +1474,19 @@ export class RestClient extends BaseRestClient { */ getCopytradingSubpositions( - params?: GetCurrentSubpositionsRequest + params?: GetCurrentSubpositionsRequest, ): Promise { return this.getPrivate('/api/v5/copytrading/current-subpositions', params); } getCopytradingSubpositionsHistory( - params?: GetSubpositionsHistoryRequest + params?: GetSubpositionsHistoryRequest, ): Promise { return this.getPrivate('/api/v5/copytrading/subpositions-history', params); } submitCopytradingAlgoOrder( - params: PlaceCTAlgoOrderRequest + params: PlaceCTAlgoOrderRequest, ): Promise { return this.postPrivate('/api/v5/copytrading/algo-order', params); } @@ -1520,11 +1522,11 @@ export class RestClient extends BaseRestClient { } getCopytradingProfitDetails( - params?: GetCTProfitDetailsRequest + params?: GetCTProfitDetailsRequest, ): Promise { return this.getPrivate( '/api/v5/copytrading/profit-sharing-details', - params + params, ); } @@ -1539,7 +1541,7 @@ export class RestClient extends BaseRestClient { }): Promise { return this.getPrivate( '/api/v5/copytrading/unrealized-profit-sharing-details', - params + params, ); } @@ -1551,7 +1553,7 @@ export class RestClient extends BaseRestClient { > { return this.getPrivate( '/api/v5/copytrading/total-unrealized-profit-sharing', - params + params, ); } @@ -1584,7 +1586,7 @@ export class RestClient extends BaseRestClient { > { return this.postPrivate( '/api/v5/copytrading/amend-profit-sharing-ratio', - params + params, ); } @@ -1628,13 +1630,13 @@ export class RestClient extends BaseRestClient { } getCopytradingBatchLeverageInfo( - params: GetCTBatchLeverageInfoRequest + params: GetCTBatchLeverageInfoRequest, ): Promise { return this.getPrivate('/api/v5/copytrading/batch-leverage-info', params); } setCopytradingBatchLeverage( - params: SetCTBatchLeverageRequest + params: SetCTBatchLeverageRequest, ): Promise { return this.postPrivate('/api/v5/copytrading/batch-set-leverage', params); } @@ -1646,7 +1648,7 @@ export class RestClient extends BaseRestClient { } getCopytradingLeadTradersHistory( - params?: GetCTHistoryLeadTradersRequest + params?: GetCTHistoryLeadTradersRequest, ): Promise { return this.getPrivate('/api/v5/copytrading/lead-traders-history', params); } @@ -1658,7 +1660,7 @@ export class RestClient extends BaseRestClient { } getCopytradingLeadRanks( - params?: GetLeadTraderRanksRequest + params?: GetLeadTraderRanksRequest, ): Promise { return this.get('/api/v5/copytrading/public-lead-traders', params); } @@ -1671,13 +1673,13 @@ export class RestClient extends BaseRestClient { } getCopytradingLeadDailyPnl( - params: GetLeadTraderStatsRequest + params: GetLeadTraderStatsRequest, ): Promise { return this.get('/api/v5/copytrading/public-pnl', params); } getCopytradingLeadStats( - params: GetLeadTraderStatsRequest + params: GetLeadTraderStatsRequest, ): Promise { return this.get('/api/v5/copytrading/public-stats', params); } @@ -1690,25 +1692,25 @@ export class RestClient extends BaseRestClient { } getCopytradingLeadOpenPositions( - params: GetLeadTraderPositionsRequest + params: GetLeadTraderPositionsRequest, ): Promise { return this.get('/api/v5/copytrading/public-current-subpositions', params); } getCopytradingLeadPositionHistory( - params: GetLeadTraderPositionsRequest + params: GetLeadTraderPositionsRequest, ): Promise { return this.get('/api/v5/copytrading/public-subpositions-history', params); } getCopyTraders( - params: GetCopyTradersRequest + params: GetCopyTradersRequest, ): Promise { return this.get('/api/v5/copytrading/public-copy-traders', params); } getCopytradingLeadPrivateRanks( - params?: GetPrivateLeadTraderRanksRequest + params?: GetPrivateLeadTraderRanksRequest, ): Promise { return this.getPrivate('/api/v5/copytrading/lead-traders', params); } @@ -1721,13 +1723,13 @@ export class RestClient extends BaseRestClient { } getCopytradingPLeadPrivateDailyPnl( - params: GetLeadTraderStatsRequest + params: GetLeadTraderStatsRequest, ): Promise { return this.getPrivate('/api/v5/copytrading/pnl', params); } geCopytradingLeadPrivateStats( - params: GetLeadTraderStatsRequest + params: GetLeadTraderStatsRequest, ): Promise { return this.getPrivate('/api/v5/copytrading/stats', params); } @@ -1740,25 +1742,25 @@ export class RestClient extends BaseRestClient { } getCopytradingLeadPrivateOpenPositions( - params: GetLeadTraderPositionsRequest + params: GetLeadTraderPositionsRequest, ): Promise { return this.getPrivate( '/api/v5/copytrading/performance-current-subpositions', - params + params, ); } getCopytradingLeadPrivatePositionHistory( - params: GetLeadTraderPositionsRequest + params: GetLeadTraderPositionsRequest, ): Promise { return this.getPrivate( '/api/v5/copytrading/performance-subpositions-history', - params + params, ); } getCopyTradersPrivate( - params: GetCopyTradersRequest + params: GetCopyTradersRequest, ): Promise { return this.getPrivate('/api/v5/copytrading/copy-traders', params); } @@ -1804,7 +1806,7 @@ export class RestClient extends BaseRestClient { getCandles( instId: string, bar: string = '1m', - pagination?: Pagination + pagination?: Pagination, ): Promise { return this.get('/api/v5/market/candles', { instId, @@ -1828,7 +1830,7 @@ export class RestClient extends BaseRestClient { getHistoricCandles( instId: string, bar: string = '1m', - pagination?: Pagination + pagination?: Pagination, ): Promise { return this.get('/api/v5/market/history-candles', { instId, @@ -1852,7 +1854,7 @@ export class RestClient extends BaseRestClient { before?: numberInString; limit?: numberInString; type?: '1' | '2'; - } + }, ): Promise { return this.get('/api/v5/market/history-trades', { instId, ...pagination }); } @@ -1886,13 +1888,13 @@ export class RestClient extends BaseRestClient { } cancelBlockRFQ( - params: CancelBlockRFQRequest + params: CancelBlockRFQRequest, ): Promise { return this.postPrivate('/api/v5/rfq/cancel-rfq', params); } cancelMultipleBlockRFQs( - params: CancelMultipleBlockRFQRequest + params: CancelMultipleBlockRFQRequest, ): Promise { return this.postPrivate('/api/v5/rfq/cancel-batch-rfqs', params); } @@ -1902,7 +1904,7 @@ export class RestClient extends BaseRestClient { } executeBlockQuote( - params: ExecuteBlockQuoteRequest + params: ExecuteBlockQuoteRequest, ): Promise { return this.postPrivate('/api/v5/rfq/execute-quote', params); } @@ -1928,7 +1930,7 @@ export class RestClient extends BaseRestClient { } updateBlockMmpConfig( - params: SetMmpConfigRequest + params: SetMmpConfigRequest, ): Promise { return this.postPrivate('/api/v5/rfq/mmp-config', params); } @@ -1936,20 +1938,21 @@ export class RestClient extends BaseRestClient { getBlockMmpConfig(): Promise { return this.getPrivate('/api/v5/rfq/mmp-config'); } + createBlockQuote( - params: CreateBlockQuoteRequest + params: CreateBlockQuoteRequest, ): Promise { return this.postPrivate('/api/v5/rfq/create-quote', params); } cancelBlockQuote( - params: CancelBlockQuoteRequest + params: CancelBlockQuoteRequest, ): Promise { return this.postPrivate('/api/v5/rfq/cancel-quote', params); } cancelMultipleBlockQuotes( - params: CancelMultipleBlockQuoteRequest + params: CancelMultipleBlockQuoteRequest, ): Promise { return this.postPrivate('/api/v5/rfq/cancel-batch-quotes', params); } @@ -2004,7 +2007,7 @@ export class RestClient extends BaseRestClient { */ submitSpreadOrder( - params: PlaceSpreadOrderRequest + params: PlaceSpreadOrderRequest, ): Promise { return this.postPrivate('/api/v5/sprd/order', params); } @@ -2025,7 +2028,7 @@ export class RestClient extends BaseRestClient { } updateSpreadOrder( - params: UpdateSpreadOrderRequest + params: UpdateSpreadOrderRequest, ): Promise { return this.postPrivate('/api/v5/sprd/amend-order', params); } @@ -2038,19 +2041,19 @@ export class RestClient extends BaseRestClient { } getSpreadActiveOrders( - params?: GetActiveSpreadOrdersRequest + params?: GetActiveSpreadOrdersRequest, ): Promise { return this.getPrivate('/api/v5/sprd/orders-pending', params); } getSpreadOrdersRecent( - params?: GetSpreadOrderHistoryRequest + params?: GetSpreadOrderHistoryRequest, ): Promise { return this.getPrivate('/api/v5/sprd/orders-history', params); } getSpreadOrdersArchive( - params?: GetSpreadOrderHistoryArchiveRequest + params?: GetSpreadOrderHistoryArchiveRequest, ): Promise { return this.getPrivate('/api/v5/sprd/orders-history-archive', params); } @@ -2085,7 +2088,7 @@ export class RestClient extends BaseRestClient { } getSpreadHistoryCandles( - params: GetSpreadCandlesRequest + params: GetSpreadCandlesRequest, ): Promise { return this.get('/api/v5/market/sprd-history-candles', params); } @@ -2109,7 +2112,7 @@ export class RestClient extends BaseRestClient { instType: InstrumentType, uly?: string, instFamily?: string, - instId?: string + instId?: string, ): Promise { return this.get('/api/v5/public/instruments', { instType, @@ -2212,7 +2215,7 @@ export class RestClient extends BaseRestClient { getIndexCandles( instId: string, bar: string = '1m', - pagination?: Pagination + pagination?: Pagination, ): Promise { return this.get('/api/v5/market/index-candles', { instId, @@ -2236,7 +2239,7 @@ export class RestClient extends BaseRestClient { getHistoricIndexCandles( instId: string, bar: string = '1m', - pagination?: Pagination + pagination?: Pagination, ): Promise { return this.get('/api/v5/market/history-index-candles', { instId, @@ -2260,7 +2263,7 @@ export class RestClient extends BaseRestClient { getMarkPriceCandles( instId: string, bar: string = '1m', - pagination?: Pagination + pagination?: Pagination, ): Promise { return this.get('/api/v5/market/mark-price-candles', { instId, @@ -2284,7 +2287,7 @@ export class RestClient extends BaseRestClient { getHistoricMarkPriceCandles( instId: string, bar: string = '1m', - pagination?: Pagination + pagination?: Pagination, ): Promise { return this.get('/api/v5/market/historic-mark-price-candles', { instId, @@ -2294,7 +2297,7 @@ export class RestClient extends BaseRestClient { } getHistoricMarkPriceCandlesV2( - params: CandleRequest + params: CandleRequest, ): Promise { return this.get('/api/v5/market/history-mark-price-candles', params); } @@ -2312,7 +2315,7 @@ export class RestClient extends BaseRestClient { } getEconomicCalendar( - params: EconomicCalendarRequest + params: EconomicCalendarRequest, ): Promise { return this.getPrivate('/api/v5/public/economic-calendar', params); } @@ -2342,11 +2345,11 @@ export class RestClient extends BaseRestClient { } getOpenInterestHistory( - params: GetContractOpenInterestHistoryRequest + params: GetContractOpenInterestHistoryRequest, ): Promise { return this.get( '/api/v5/rubik/stat/contracts/open-interest-history', - params + params, ); } @@ -2361,7 +2364,7 @@ export class RestClient extends BaseRestClient { } getContractTakerVolume( - params: GetContractTakerVolumeRequest + params: GetContractTakerVolumeRequest, ): Promise { return this.get('/api/v5/rubik/stat/taker-volume-contract', params); } @@ -2376,29 +2379,29 @@ export class RestClient extends BaseRestClient { } getTopTradersAccountRatio( - params: GetTopTradersContractLongShortRatioRequest + params: GetTopTradersContractLongShortRatioRequest, ): Promise { return this.get( '/api/v5/rubik/stat/contracts/long-short-account-ratio-contract-top-trader', - params + params, ); } getTopTradersContractPositionRatio( - params: GetTopTradersContractLongShortRatioRequest + params: GetTopTradersContractLongShortRatioRequest, ): Promise { return this.get( '/api/v5/rubik/stat/contracts/long-short-position-ratio-contract-top-trader', - params + params, ); } getLongShortContractRatio( - params: GetTopTradersContractLongShortRatioRequest + params: GetTopTradersContractLongShortRatioRequest, ): Promise { return this.get( '/api/v5/rubik/stat/contracts/long-short-account-ratio-contract', - params + params, ); } @@ -2410,7 +2413,7 @@ export class RestClient extends BaseRestClient { }): Promise { return this.get( '/api/v5/rubik/stat/contracts/long-short-account-ratio', - params + params, ); } @@ -2422,7 +2425,7 @@ export class RestClient extends BaseRestClient { }): Promise { return this.get( '/api/v5/rubik/stat/contracts/open-interest-volume', - params + params, ); } @@ -2439,7 +2442,7 @@ export class RestClient extends BaseRestClient { }): Promise { return this.get( '/api/v5/rubik/stat/option/open-interest-volume-ratio', - params + params, ); } @@ -2449,7 +2452,7 @@ export class RestClient extends BaseRestClient { }): Promise { return this.get( '/api/v5/rubik/stat/option/open-interest-volume-expiry', - params + params, ); } @@ -2460,7 +2463,7 @@ export class RestClient extends BaseRestClient { }): Promise { return this.get( '/api/v5/rubik/stat/option/open-interest-volume-strike', - params + params, ); } @@ -2517,7 +2520,7 @@ export class RestClient extends BaseRestClient { getLightningDeposits( ccy: string, amt: numberInString, - to?: '6' | '18' + to?: '6' | '18', ): Promise { return this.getPrivate('/api/v5/asset/deposit-lightning', { ccy, amt, to }); } @@ -2537,7 +2540,7 @@ export class RestClient extends BaseRestClient { submitWithdrawLightning( ccy: string, invoice: string, - memo?: string + memo?: string, ): Promise { return this.postPrivate('/api/v5/asset/withdrawal-lightning', { ccy, @@ -2555,7 +2558,7 @@ export class RestClient extends BaseRestClient { } getDepositWithdrawStatus( - params: GetDepositWithdrawStatusRequest + params: GetDepositWithdrawStatusRequest, ): Promise { return this.getPrivate('/api/v5/asset/deposit-withdraw-status', params); } @@ -2621,7 +2624,7 @@ export class RestClient extends BaseRestClient { label?: string; perm?: string; ip?: string; - } + }, ): Promise { return this.postPrivate('/api/v5/users/subaccount/modify-apikey', { subAcct, @@ -2638,7 +2641,7 @@ export class RestClient extends BaseRestClient { /** Get sub-account funding balance */ getSubAccountFundingBalances( subAcct: string, - ccy?: string + ccy?: string, ): Promise { return this.getPrivate('/api/v5/asset/subaccount/balances', { subAcct, @@ -2647,7 +2650,7 @@ export class RestClient extends BaseRestClient { } getSubAccountMaxWithdrawal( - params: GetSubAccountMaxWithdrawalsRequest + params: GetSubAccountMaxWithdrawalsRequest, ): Promise { return this.getPrivate('/api/v5/account/subaccount/max-withdrawal', params); } @@ -2665,17 +2668,17 @@ export class RestClient extends BaseRestClient { } getManagedSubAccountTransferHistory( - params: GetManagedSubAccountTransferHistoryRequest + params: GetManagedSubAccountTransferHistoryRequest, ): Promise { return this.getPrivate( '/api/v5/asset/subaccount/managed-subaccount-bills', - params + params, ); } /** Master accounts manage the transfers between sub-accounts */ transferSubAccountBalance( - params: SubAccountTransferRequest + params: SubAccountTransferRequest, ): Promise { return this.postPrivate('/api/v5/asset/subaccount/transfer', params); } @@ -2683,7 +2686,7 @@ export class RestClient extends BaseRestClient { /** Set Permission Of Transfer Out */ setSubAccountTransferOutPermission( subAcct: string, - canTransOut: boolean = true + canTransOut: boolean = true, ): Promise { return this.postPrivate('/api/v5/users/subaccount/set-transfer-out', { subAcct, @@ -2699,7 +2702,7 @@ export class RestClient extends BaseRestClient { } setSubAccountLoanAllocation( - params: SetSubAccountLoanAllocationRequest + params: SetSubAccountLoanAllocationRequest, ): Promise< { result: boolean; @@ -2707,7 +2710,7 @@ export class RestClient extends BaseRestClient { > { return this.postPrivate( '/api/v5/account/subaccount/set-loan-allocation', - params + params, ); } @@ -2717,7 +2720,7 @@ export class RestClient extends BaseRestClient { }): Promise { return this.getPrivate( '/api/v5/account/subaccount/interest-limits', - params + params, ); } @@ -2743,7 +2746,7 @@ export class RestClient extends BaseRestClient { ccy: string; amt: string; }[], - term?: string + term?: string, ): Promise { return this.postPrivate('/api/v5/finance/staking-defi/purchase', { productId, @@ -2756,7 +2759,7 @@ export class RestClient extends BaseRestClient { redeemStake( ordId: string, protocolType: 'staking' | 'defi', - allowEarlyRedeem?: boolean + allowEarlyRedeem?: boolean, ): Promise { return this.postPrivate('/api/v5/finance/staking-defi/redeem', { ordId, @@ -2768,7 +2771,7 @@ export class RestClient extends BaseRestClient { /** Earn/staking cancel purchases/redemptions */ cancelStakingRequest( ordId: string, - protocolType: 'staking' | 'defi' + protocolType: 'staking' | 'defi', ): Promise { return this.postPrivate('/api/v5/finance/staking-defi/cancel', { ordId, @@ -2785,7 +2788,7 @@ export class RestClient extends BaseRestClient { }): Promise { return this.getPrivate( '/api/v5/finance/staking-defi/orders-active', - params + params, ); } @@ -2800,7 +2803,7 @@ export class RestClient extends BaseRestClient { }): Promise { return this.getPrivate( '/api/v5/finance/staking-defi/orders-history', - params + params, ); } @@ -2817,7 +2820,7 @@ export class RestClient extends BaseRestClient { purchaseETHStaking(params: { amt: string }): Promise { return this.postPrivate( '/api/v5/finance/staking-defi/eth/purchase', - params + params, ); } @@ -2838,7 +2841,7 @@ export class RestClient extends BaseRestClient { }): Promise { return this.getPrivate( '/api/v5/finance/staking-defi/eth/purchase-redeem-history', - params + params, ); } @@ -2860,7 +2863,7 @@ export class RestClient extends BaseRestClient { ccy: string, amt: numberInString, side: 'purchase' | 'redempt', - rate: numberInString + rate: numberInString, ): Promise { return this.postPrivate('/api/v5/finance/savings/purchase-redempt', { ccy, @@ -2906,7 +2909,7 @@ export class RestClient extends BaseRestClient { getLendingVolume(params: { ccy: string; term: string }): Promise { return this.get( '/api/v5/finance/fixed-loan/pending-lending-volume', - params + params, ); } @@ -2917,21 +2920,21 @@ export class RestClient extends BaseRestClient { amendLendingOrder(params: LendingOrder): Promise { return this.postPrivate( '/api/v5/finance/fixed-loan/amend-lending-order', - params + params, ); } getLendingOrders(params: GetLendingOrderListRequest): Promise { return this.getPrivate( '/api/v5/finance/fixed-loan/lending-orders-list', - params + params, ); } getLendingSubOrders(params: GetLendingSubOrderListRequest): Promise { return this.getPrivate( '/api/v5/finance/fixed-loan/lending-sub-orders', - params + params, ); } @@ -2962,26 +2965,27 @@ export class RestClient extends BaseRestClient { adjustCollateral(params: AdjustCollateralRequest): Promise<[]> { return this.postPrivate( '/api/v5/finance/flexible-loan/adjust-collateral', - params + params, ); } getLoanInfo(): Promise { return this.getPrivate('/api/v5/finance/flexible-loan/loan-info'); } + getLoanHistory(params?: LoanHistoryRequest): Promise { return this.getPrivate( '/api/v5/finance/flexible-loan/loan-history', - params + params, ); } getAccruedInterest( - params?: AccruedInterestRequest + params?: AccruedInterestRequest, ): Promise { return this.getPrivate( '/api/v5/finance/flexible-loan/interest-accrued', - params + params, ); } @@ -3006,7 +3010,7 @@ export class RestClient extends BaseRestClient { */ getSystemStatus( - state?: 'scheduled' | 'ongoing' | 'pre_open' | 'completed' | 'canceled' + state?: 'scheduled' | 'ongoing' | 'pre_open' | 'completed' | 'canceled', ): Promise { return this.get('/api/v5/system/status', { state }); } diff --git a/src/types/index.ts b/src/types/index.ts index 1ee7339..888e244 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -1,3 +1,3 @@ export * from './rest'; -export * from './websockets'; export * from './shared'; +export * from './websockets'; diff --git a/src/types/rest/request/block-trading.ts b/src/types/rest/request/block-trading.ts index f5bd7ee..78b582d 100644 --- a/src/types/rest/request/block-trading.ts +++ b/src/types/rest/request/block-trading.ts @@ -22,6 +22,14 @@ export interface ExecuteBlockQuoteRequest { quoteId: string; } +export interface CreateBlockQuoteLeg { + px: string; + sz: string; + instId: string; + side: OrderSide; + tgtCcy?: 'base_ccy' | 'quote_ccy'; +} + export interface CreateBlockQuoteRequest { rfqId: string; clQuoteId?: string; @@ -31,14 +39,6 @@ export interface CreateBlockQuoteRequest { legs: CreateBlockQuoteLeg[]; } -export interface CreateBlockQuoteLeg { - px: string; - sz: string; - instId: string; - side: OrderSide; - tgtCcy?: 'base_ccy' | 'quote_ccy'; -} - export interface CancelBlockQuoteRequest { quoteId?: string; clQuoteId?: string; @@ -87,5 +87,3 @@ export interface SetMmpConfigRequest { frozenInterval: string; countLimit: string; } - - diff --git a/src/types/rest/request/grid-trading.ts b/src/types/rest/request/grid-trading.ts index cd0dec4..3c5f5e9 100644 --- a/src/types/rest/request/grid-trading.ts +++ b/src/types/rest/request/grid-trading.ts @@ -1,5 +1,3 @@ -import { InstrumentType } from '../shared'; - export type GridAlgoOrderType = 'grid' | 'contract_grid' | 'moon_grid'; export interface GetGridAlgoOrdersRequest { diff --git a/src/types/rest/request/index.ts b/src/types/rest/request/index.ts index 03c5fb5..dea6615 100644 --- a/src/types/rest/request/index.ts +++ b/src/types/rest/request/index.ts @@ -1,14 +1,14 @@ export * from './account'; +export * from './block-trading'; export * from './convert'; +export * from './copy-trading'; export * from './funding'; -export * from './shared'; -export * from './subaccount'; -export * from './trade'; -export * from './block-trading'; export * from './grid-trading'; export * from './public'; -export * from './simple-earn'; -export * from './signal-bot'; -export * from './copy-trading'; export * from './recurring-buy'; +export * from './shared'; +export * from './signal-bot'; +export * from './simple-earn'; export * from './spread-trading'; +export * from './subaccount'; +export * from './trade'; diff --git a/src/types/rest/request/recurring-buy.ts b/src/types/rest/request/recurring-buy.ts index 00e22bc..9dc4649 100644 --- a/src/types/rest/request/recurring-buy.ts +++ b/src/types/rest/request/recurring-buy.ts @@ -29,5 +29,3 @@ export interface GetRecurringBuyOrderListRequest { before?: string; limit?: string; } - - diff --git a/src/types/rest/request/trade.ts b/src/types/rest/request/trade.ts index 0dcf516..d80604f 100644 --- a/src/types/rest/request/trade.ts +++ b/src/types/rest/request/trade.ts @@ -1,15 +1,15 @@ import { - TradeMode, - OrderSide, - PositionSide, + AlgoOrderState, AlgoOrderType, + AlgoPositionSide, + InstrumentType, + MarginMode, numberInString, - PriceTriggerType, + OrderSide, OrderType, - MarginMode, - InstrumentType, - AlgoOrderState, - AlgoPositionSide, + PositionSide, + PriceTriggerType, + TradeMode, } from '../shared'; export interface AlgoRecentHistoryRequest { @@ -33,6 +33,15 @@ export interface AlgoLongHistoryRequest { limit?: string; } +interface AlgoTriggerOrder { + newTpTriggerPx?: string; + newTpTriggerPxType?: 'last' | 'index' | 'mark'; + newTpOrdPx?: string; + newSlTriggerPx?: string; + newSlTriggerPxType?: 'last' | 'index' | 'mark'; + newSlOrdPx?: string; +} + export interface AlgoOrderRequest { instId: string; tdMode: TradeMode; @@ -91,15 +100,6 @@ export type AlgoOrderDetailsRequest = algoClOrdId: string; }; -interface AlgoTriggerOrder { - newTpTriggerPx?: string; - newTpTriggerPxType?: 'last' | 'index' | 'mark'; - newTpOrdPx?: string; - newSlTriggerPx?: string; - newSlTriggerPxType?: 'last' | 'index' | 'mark'; - newSlOrdPx?: string; -} - export interface AmendAlgoOrderRequest { instId: string; algoId?: string; diff --git a/src/types/rest/response/index.ts b/src/types/rest/response/index.ts index 58cb217..4933e39 100644 --- a/src/types/rest/response/index.ts +++ b/src/types/rest/response/index.ts @@ -1,11 +1,11 @@ export * from './private-account'; export * from './private-block-trading'; +export * from './private-copy-trading'; +export * from './private-flexible-loan'; export * from './private-funding'; +export * from './private-recurring-buy'; +export * from './private-signal-bot'; +export * from './private-spread-trading'; export * from './private-subaccount'; export * from './private-trade'; export * from './public-data'; -export * from './private-signal-bot'; -export * from './private-recurring-buy'; -export * from './private-copy-trading'; -export * from './private-spread-trading'; -export * from './private-flexible-loan'; diff --git a/src/types/rest/response/private-account.ts b/src/types/rest/response/private-account.ts index a4d3e27..dd9e833 100644 --- a/src/types/rest/response/private-account.ts +++ b/src/types/rest/response/private-account.ts @@ -5,20 +5,6 @@ import { WithdrawState, } from '../shared'; -export interface AccountBalance { - adjEq: string; - details: AccountBalanceDetail[]; - imr: string; - isoEq: string; - mgnRatio: string; - mmr: string; - notionalUsd: string; - ordFroz: string; - totalEq: string; - uTime: string; - spotCopyTradingEq: string; -} - export interface AccountBalanceDetail { availBal: string; availEq: string; @@ -52,6 +38,20 @@ export interface AccountBalanceDetail { totalPnlRatio: string; // Spot accumulated profit and loss ratio. } +export interface AccountBalance { + adjEq: string; + details: AccountBalanceDetail[]; + imr: string; + isoEq: string; + mgnRatio: string; + mmr: string; + notionalUsd: string; + ordFroz: string; + totalEq: string; + uTime: string; + spotCopyTradingEq: string; +} + export interface AccountPosition { adl: string; availPos: string; diff --git a/src/types/rest/response/private-block-trading.ts b/src/types/rest/response/private-block-trading.ts index 82e3706..b86ced0 100644 --- a/src/types/rest/response/private-block-trading.ts +++ b/src/types/rest/response/private-block-trading.ts @@ -37,6 +37,14 @@ export interface ExecuteBlockQuoteResult { legs: RFQQuoteLegExtended[]; } +export interface CreatedBlockQuoteLeg { + px: string; + sz: string; + instId: string; + side: string; + tgtCcy: string; +} + export interface CreateBlockQuoteResult { cTime: string; uTime: string; @@ -49,14 +57,6 @@ export interface CreateBlockQuoteResult { legs: CreatedBlockQuoteLeg[]; } -export interface CreatedBlockQuoteLeg { - px: string; - sz: string; - instId: string; - side: string; - tgtCcy: string; -} - export interface CancelBlockQuoteResult { rfqId: string; clQuoteId: string; @@ -136,4 +136,4 @@ export interface PublicBlockTrade { idxPx?: string; markPx?: string; ts: string; -} \ No newline at end of file +} diff --git a/src/types/rest/response/private-copy-trading.ts b/src/types/rest/response/private-copy-trading.ts index ad5162c..88a962e 100644 --- a/src/types/rest/response/private-copy-trading.ts +++ b/src/types/rest/response/private-copy-trading.ts @@ -1,4 +1,4 @@ -export interface CurrentSubposition{ +export interface CurrentSubposition { algoId: string; ccy: string; instId: string; @@ -23,7 +23,7 @@ export interface CurrentSubposition{ availSubPos: string; } -export interface SubpositionsHistory{ +export interface SubpositionsHistory { ccy: string; closeAvgPx: string; closeTime: string; @@ -277,8 +277,6 @@ export interface GetCopyTradersResult { copyTraders: CopyTraderInfo[]; } - - export interface GetPrivateLeadTraderRanksResult { dataVer: string; chanType: 'OKX' | 'ND'; diff --git a/src/types/rest/response/private-trade.ts b/src/types/rest/response/private-trade.ts index aeeacff..f923be0 100644 --- a/src/types/rest/response/private-trade.ts +++ b/src/types/rest/response/private-trade.ts @@ -2,10 +2,10 @@ import { AlgoOrderState, AlgoOrderType, AlgoPositionSide, + numberInString, OrderState, OrderType, PositionSide, - numberInString, } from '../shared'; export interface OrderResult { diff --git a/src/types/rest/response/public-data.ts b/src/types/rest/response/public-data.ts index 8795c77..4421d4b 100644 --- a/src/types/rest/response/public-data.ts +++ b/src/types/rest/response/public-data.ts @@ -60,7 +60,7 @@ export type Candle = [ vol, volCcy, volCcyQuote, - confirm + confirm, ]; export type CandleNoVolume = [ @@ -68,7 +68,7 @@ export type CandleNoVolume = [ openPrice, highPrice, lowPrice, - closePrice + closePrice, ]; export interface Trade { diff --git a/src/types/websockets/event.ts b/src/types/websockets/event.ts index 00ef665..1823b7e 100644 --- a/src/types/websockets/event.ts +++ b/src/types/websockets/event.ts @@ -1,4 +1,3 @@ -import { WS_EVENT_CODE_ENUM } from '../../util'; import { WsChannel } from './request'; export interface WsEvent { @@ -30,5 +29,4 @@ export interface WsChannelConnInfoEvent extends WsEvent { connCount: string; } - export type WsResponse = WsEvent; diff --git a/src/util/BaseRestClient.ts b/src/util/BaseRestClient.ts index 95984ff..9e84353 100644 --- a/src/util/BaseRestClient.ts +++ b/src/util/BaseRestClient.ts @@ -1,4 +1,5 @@ import axios, { AxiosRequestConfig, AxiosResponse, Method } from 'axios'; + import { APICredentials, APIMarket, @@ -6,7 +7,7 @@ import { RestClientOptions, } from '../types'; import { signMessage } from './node-support'; -import { serializeParams, programKey, programId } from './requestUtils'; +import { programId, programKey, serializeParams } from './requestUtils'; import { isRawAPIResponse } from './typeGuards'; // axios.interceptors.request.use((request) => { @@ -43,10 +44,15 @@ interface SignedRequest { export default abstract class BaseRestClient { private options: RestClientOptions; + private baseUrl: string; + private globalRequestOptions: AxiosRequestConfig; + private apiKey: string | undefined; + private apiSecret: string | undefined; + private apiPassphrase: string | undefined; constructor( @@ -54,7 +60,7 @@ export default abstract class BaseRestClient { baseUrl: string, options: RestClientOptions = {}, requestOptions: AxiosRequestConfig = {}, - market: APIMarket + market: APIMarket, ) { // this.environment = environment; @@ -72,7 +78,7 @@ export default abstract class BaseRestClient { (!credentials.apiKey || !credentials.apiSecret || !credentials.apiPass) ) { throw new Error( - 'API Key, Secret AND Passphrase are ALL required for private enpoints' + 'API Key, Secret AND Passphrase are ALL required for private enpoints', ); } @@ -119,7 +125,7 @@ export default abstract class BaseRestClient { Array.isArray(params) ? params.map((p) => ({ ...p, [programKey]: programId })) : { ...params, [programKey]: programId }, - false + false, ); } @@ -133,8 +139,8 @@ export default abstract class BaseRestClient { private async _call( method: Method, endpoint: string, - params: {} | undefined, - isPublicApi: boolean + params: object | undefined, + isPublicApi: boolean, ): Promise { const options = { ...this.globalRequestOptions, @@ -156,7 +162,7 @@ export default abstract class BaseRestClient { tsISO, method, endpoint, - params + params, ); if (!options.headers) { @@ -219,12 +225,12 @@ export default abstract class BaseRestClient { /** * Sign request */ - private async signRequest( + private async signRequest( isPublicApi: boolean, tsISO: string, method: Method, endpoint: string, - params: T | undefined + params: T | undefined, ): Promise> { const res: SignedRequest = { requestBody: params, @@ -244,7 +250,7 @@ export default abstract class BaseRestClient { const serializedParams = serializeParams( params, method, - this.options.strict_param_validation + this.options.strict_param_validation, ); const message = tsISO + method + endpoint + serializedParams; diff --git a/src/util/WsStore.ts b/src/util/WsStore.ts index 5df064a..4fdad6a 100644 --- a/src/util/WsStore.ts +++ b/src/util/WsStore.ts @@ -1,4 +1,5 @@ import WebSocket from 'isomorphic-ws'; + import { DefaultLogger } from './logger'; import { WsKey } from './websocket-util'; @@ -83,6 +84,7 @@ export class WsStore { WsKey | string, WsStoredState > = {}; + private logger: typeof DefaultLogger; constructor(logger: typeof DefaultLogger) { @@ -93,15 +95,17 @@ export class WsStore { /** Get WS stored state for key, optionally create if missing */ get( wsKey: WsKey, - createIfMissing?: true + createIfMissing?: true, ): WsStoredState; + get( wsKey: WsKey, - createIfMissing?: false + createIfMissing?: false, ): WsStoredState | undefined; + get( wsKey: WsKey, - createIfMissing?: boolean + createIfMissing?: boolean, ): WsStoredState | undefined { if (this.wsState[wsKey]) { return this.wsState[wsKey]; @@ -117,12 +121,12 @@ export class WsStore { } create( - wsKey: WsKey + wsKey: WsKey, ): WsStoredState | undefined { if (this.hasExistingActiveConnection(wsKey)) { this.logger.warning( 'WsStore setConnection() overwriting existing open connection: ', - this.getWs(wsKey) + this.getWs(wsKey), ); } this.wsState[wsKey] = { @@ -137,7 +141,7 @@ export class WsStore { const ws = this.getWs(wsKey); this.logger.warning( 'WsStore deleting state for connection still open: ', - ws + ws, ); ws?.close(); } @@ -158,7 +162,7 @@ export class WsStore { if (this.isWsOpen(wsKey)) { this.logger.warning( 'WsStore setConnection() overwriting existing open connection: ', - this.getWs(wsKey) + this.getWs(wsKey), ); } this.get(wsKey, true)!.ws = wsConnection; @@ -231,7 +235,7 @@ export class WsStore { // Since topics are objects we can't rely on the set to detect duplicates getMatchingTopic( key: WsKey, - topic: WsTopic | WSComplexTopic + topic: WsTopic | WSComplexTopic, ): WSComplexTopic | WSSimpleTopic | undefined { if (typeof topic === 'string') { if (this.getTopics(key).has(topic)) { diff --git a/src/util/browser-support.ts b/src/util/browser-support.ts index b470940..288daf8 100644 --- a/src/util/browser-support.ts +++ b/src/util/browser-support.ts @@ -1,6 +1,6 @@ export async function signMessage( message: string, - secret: string + secret: string, ): Promise { const encoder = new TextEncoder(); const key = await window.crypto.subtle.importKey( @@ -8,18 +8,18 @@ export async function signMessage( encoder.encode(secret), { name: 'HMAC', hash: { name: 'SHA-256' } }, false, - ['sign'] + ['sign'], ); const signature = await window.crypto.subtle.sign( 'HMAC', key, - encoder.encode(message) + encoder.encode(message), ); return Array.prototype.map .call(new Uint8Array(signature), (x: any) => - ('00' + x.toString(16)).slice(-2) + ('00' + x.toString(16)).slice(-2), ) .join(''); } diff --git a/src/util/index.ts b/src/util/index.ts index 2d25a75..90aedca 100644 --- a/src/util/index.ts +++ b/src/util/index.ts @@ -1,4 +1,4 @@ -export * from './typeGuards'; -export * from './WsStore'; export * from './logger'; +export * from './typeGuards'; export * from './websocket-util'; +export * from './WsStore'; diff --git a/src/util/logger.ts b/src/util/logger.ts index a0b2379..d5a585c 100644 --- a/src/util/logger.ts +++ b/src/util/logger.ts @@ -1,6 +1,7 @@ export type LogParams = null | any; export const DefaultLogger = { + // eslint-disable-next-line @typescript-eslint/no-unused-vars silly: (...params: LogParams): void => { // console.log(params); }, diff --git a/src/util/requestUtils.ts b/src/util/requestUtils.ts index 0919c84..d37753c 100644 --- a/src/util/requestUtils.ts +++ b/src/util/requestUtils.ts @@ -1,10 +1,11 @@ import { Method } from 'axios'; + import { APIMarket, RestClientOptions } from '../types'; export function serializeParams( params: object | undefined, method: Method, - strict_validation = false + strict_validation = false, ): string { if (!params) { return ''; @@ -19,7 +20,7 @@ export function serializeParams( const value = params[key]; if (strict_validation === true && typeof value === 'undefined') { throw new Error( - 'Failed to sign API request due to undefined parameter' + 'Failed to sign API request due to undefined parameter', ); } return `${key}=${value}`; @@ -34,7 +35,7 @@ export const programId = '159881cb7207BCDE'; export function getRestBaseUrl( market: APIMarket, - restClientOptions: RestClientOptions + restClientOptions: RestClientOptions, ) { if (restClientOptions.baseUrl) { return restClientOptions.baseUrl; diff --git a/src/util/typeGuards.ts b/src/util/typeGuards.ts index 50252e9..66768bd 100644 --- a/src/util/typeGuards.ts +++ b/src/util/typeGuards.ts @@ -2,7 +2,7 @@ import { WsDataEvent, WsEvent, WsLoginEvent } from '../types'; import { APIResponse } from '../types/rest'; export function isRawAPIResponse( - response: unknown + response: unknown, ): response is APIResponse { if (typeof response !== 'object' || !response) { return false; @@ -67,4 +67,3 @@ export function isConnCountEvent(evtData: unknown): boolean { export function neverGuard(x: never, msg: string): Error { return new Error(`Unhandled value exception "${x}", ${msg}`); } - diff --git a/src/util/websocket-util.ts b/src/util/websocket-util.ts index 2ad1318..008a761 100644 --- a/src/util/websocket-util.ts +++ b/src/util/websocket-util.ts @@ -191,7 +191,7 @@ const BUSINESS_CHANNELS = [ export function getWsKeyForTopicChannel( market: APIMarket, channel: WsChannel, - isPrivate?: boolean + isPrivate?: boolean, ): WsKey { const isPrivateTopic = isPrivate === true || PRIVATE_CHANNELS.includes(channel); @@ -203,7 +203,7 @@ export function getWsKeyForTopicChannel( export function getWsKeyForMarket( market: APIMarket, isPrivate: boolean, - isBusinessChannel: boolean + isBusinessChannel: boolean, ): WsKey { switch (market) { case 'prod': { @@ -244,7 +244,7 @@ export function getWsKeyForMarket( : WS_KEY_MAP.businessDemoPublic; } default: { - throw neverGuard(market, `getWsKeyForTopic(): Unhandled market`); + throw neverGuard(market, 'getWsKeyForTopic(): Unhandled market'); } } } @@ -252,7 +252,7 @@ export function getWsKeyForMarket( /** Maps a WS key back to a WS URL */ export function getWsUrlForWsKey( wsKey: WsKey, - wsClientOptions: WebsocketClientOptions + wsClientOptions: WebsocketClientOptions, ): string { if (wsClientOptions.wsUrl) { return wsClientOptions.wsUrl; @@ -295,7 +295,7 @@ export function getWsUrlForWsKey( } export function getMaxTopicsPerSubscribeEvent( - market: APIMarket + market: APIMarket, ): number | null { switch (market) { case 'prod': @@ -307,7 +307,7 @@ export function getMaxTopicsPerSubscribeEvent( return null; } default: { - throw neverGuard(market, `getWsKeyForTopic(): Unhandled market`); + throw neverGuard(market, 'getWsKeyForTopic(): Unhandled market'); } } } diff --git a/src/websocket-client.ts b/src/websocket-client.ts index 6b7a79d..135c2df 100644 --- a/src/websocket-client.ts +++ b/src/websocket-client.ts @@ -1,14 +1,12 @@ +/* eslint-disable @typescript-eslint/no-unsafe-declaration-merging */ import { EventEmitter } from 'events'; import WebSocket from 'isomorphic-ws'; -import { signMessage } from './util/node-support'; - import { APICredentials, WebsocketClientOptions, WsAuthRequest, WsAuthRequestArg, - WsChannelConnInfoEvent, WsChannelSubUnSubRequestArg, WSClientConfigurableOptions, WsDataEvent, @@ -16,29 +14,29 @@ import { WsSubRequest, WsUnsubRequest, } from './types'; - import { - isWsPong, - WsConnectionStateEnum, - PUBLIC_WS_KEYS, - PRIVATE_WS_KEYS, - WS_KEY_MAP, DefaultLogger, - getWsKeyForTopicChannel, getMaxTopicsPerSubscribeEvent, - isWsLoginEvent, - WsStore, - isWsErrorEvent, + getWsKeyForTopicChannel, + isConnCountEvent, isWsDataEvent, + isWsErrorEvent, + isWsLoginEvent, + isWsPong, isWsSubscribeEvent, isWsUnsubscribeEvent, - isConnCountEvent, + PRIVATE_WS_KEYS, + PUBLIC_WS_KEYS, + WS_KEY_MAP, + WsConnectionStateEnum, + WsStore, } from './util'; +import { signMessage } from './util/node-support'; import { getWsKeyForMarket, getWsUrlForWsKey, - WsKey, WS_EVENT_CODE_ENUM, + WsKey, } from './util/websocket-util'; const loggerCategory = { category: 'okx-ws' }; @@ -75,7 +73,7 @@ interface WebsocketClientEvents { export declare interface WebsocketClient { on( event: U, - listener: WebsocketClientEvents[U] + listener: WebsocketClientEvents[U], ): this; emit( @@ -86,12 +84,14 @@ export declare interface WebsocketClient { export class WebsocketClient extends EventEmitter { private logger: typeof DefaultLogger; + private options: WebsocketClientOptions; + private wsStore: WsStore; constructor( options: WSClientConfigurableOptions, - logger?: typeof DefaultLogger + logger?: typeof DefaultLogger, ) { super(); @@ -117,7 +117,7 @@ export class WebsocketClient extends EventEmitter { */ public subscribe( wsEvents: WsChannelSubUnSubRequestArg[] | WsChannelSubUnSubRequestArg, - isPrivateTopic?: boolean + isPrivateTopic?: boolean, ) { const wsEventArgs = Array.isArray(wsEvents) ? wsEvents : [wsEvents]; @@ -125,7 +125,7 @@ export class WebsocketClient extends EventEmitter { const wsKey = getWsKeyForTopicChannel( this.options.market, wsEventArg.channel, - isPrivateTopic + isPrivateTopic, ); // Persist topic for reconnects @@ -142,11 +142,11 @@ export class WebsocketClient extends EventEmitter { if ( !this.wsStore.isConnectionState( wsKey, - WsConnectionStateEnum.CONNECTING + WsConnectionStateEnum.CONNECTING, ) && !this.wsStore.isConnectionState( wsKey, - WsConnectionStateEnum.RECONNECTING + WsConnectionStateEnum.RECONNECTING, ) ) { return this.connect(wsKey); @@ -161,14 +161,14 @@ export class WebsocketClient extends EventEmitter { */ public unsubscribe( wsTopics: WsChannelSubUnSubRequestArg[] | WsChannelSubUnSubRequestArg, - isPrivateTopic?: boolean + isPrivateTopic?: boolean, ) { const wsEventArgs = Array.isArray(wsTopics) ? wsTopics : [wsTopics]; wsEventArgs.forEach((wsEventArg) => { const wsKey = getWsKeyForTopicChannel( this.options.market, wsEventArg.channel, - isPrivateTopic + isPrivateTopic, ); // Remove topic from persistence for reconnects @@ -216,25 +216,25 @@ export class WebsocketClient extends EventEmitter { } public connectPublic( - businessEndpoint?: boolean + businessEndpoint?: boolean, ): Promise { const isPrivate = false; const wsKey = getWsKeyForMarket( this.options.market, isPrivate, - !!businessEndpoint + !!businessEndpoint, ); return this.connect(WS_KEY_MAP[wsKey]); } public connectPrivate( - businessEndpoint?: boolean + businessEndpoint?: boolean, ): Promise { const isPrivate = true; const wsKey = getWsKeyForMarket( this.options.market, isPrivate, - !!businessEndpoint + !!businessEndpoint, ); return this.connect(WS_KEY_MAP[wsKey]); } @@ -244,7 +244,7 @@ export class WebsocketClient extends EventEmitter { if (this.wsStore.isWsOpen(wsKey)) { this.logger.error( 'Refused to connect to ws with existing active connection', - { ...loggerCategory, wsKey } + { ...loggerCategory, wsKey }, ); return this.wsStore.getWs(wsKey); } @@ -254,7 +254,7 @@ export class WebsocketClient extends EventEmitter { ) { this.logger.error( 'Refused to connect to ws, connection attempt already active', - { ...loggerCategory, wsKey } + { ...loggerCategory, wsKey }, ); return; } @@ -265,7 +265,7 @@ export class WebsocketClient extends EventEmitter { ) { this.wsStore.setConnectionState( wsKey, - WsConnectionStateEnum.CONNECTING + WsConnectionStateEnum.CONNECTING, ); } @@ -296,12 +296,12 @@ export class WebsocketClient extends EventEmitter { `${context} due to unexpected response error: "${ error?.msg || error?.message || error }"`, - { ...loggerCategory, wsKey, error } + { ...loggerCategory, wsKey, error }, ); this.executeReconnectableClose(wsKey, 'unhandled onWsError'); } else { this.logger.info( - `${wsKey} socket forcefully closed. Will not reconnect.` + `${wsKey} socket forcefully closed. Will not reconnect.`, ); } break; @@ -313,7 +313,7 @@ export class WebsocketClient extends EventEmitter { * Return params required to make authorized request */ private async getWsAuthRequest( - wsKey: WsKey + wsKey: WsKey, ): Promise { const isPublicWsKey = PUBLIC_WS_KEYS.includes(wsKey); const accounts = this.options.accounts; @@ -333,7 +333,7 @@ export class WebsocketClient extends EventEmitter { try { const { signature, timestamp } = await this.getWsAuthSignature( wsKey, - credentials + credentials, ); return { @@ -344,7 +344,7 @@ export class WebsocketClient extends EventEmitter { }; } catch (e) { this.logger.error( - `Account with key ${credentials.apiKey} could not be authenticateD: ${e}` + `Account with key ${credentials.apiKey} could not be authenticateD: ${e}`, ); } return; @@ -354,7 +354,7 @@ export class WebsocketClient extends EventEmitter { // Filter out failed accounts const authRequests: WsAuthRequestArg[] = signedAuthAccountRequests.filter( - (request): request is WsAuthRequestArg => !!request + (request): request is WsAuthRequestArg => !!request, ); const authParams: WsAuthRequest = { @@ -371,17 +371,17 @@ export class WebsocketClient extends EventEmitter { private async getWsAuthSignature( wsKey: WsKey, - credentials: APICredentials + credentials: APICredentials, ): Promise<{ signature: string; timestamp: string }> { const { apiKey, apiSecret } = credentials; if (!apiKey || !apiSecret) { this.logger.warning( 'Cannot authenticate websocket, either api or secret missing.', - { ...loggerCategory, wsKey } + { ...loggerCategory, wsKey }, ); throw new Error( - `Cannot auth - missing api or secret in config (key: ${apiKey})` + `Cannot auth - missing api or secret in config (key: ${apiKey})`, ); } @@ -405,7 +405,7 @@ export class WebsocketClient extends EventEmitter { private async sendAuthRequest(wsKey: WsKey): Promise { const logContext = { ...loggerCategory, wsKey, method: 'sendAuthRequest' }; - this.logger.info(`Sending auth request...`, logContext); + this.logger.info('Sending auth request...', logContext); try { const authRequest = await this.getWsAuthRequest(wsKey); if (!authRequest) { @@ -413,15 +413,15 @@ export class WebsocketClient extends EventEmitter { } this.logger.info( `Sending authentication request on wsKey(${wsKey})`, - logContext + logContext, ); this.logger.silly( `Authenticating with event: ${JSON.stringify( authRequest, null, - 2 + 2, )} on wsKey(${wsKey})`, - logContext + logContext, ); return this.tryWsSend(wsKey, JSON.stringify(authRequest)); } catch (e) { @@ -438,7 +438,7 @@ export class WebsocketClient extends EventEmitter { ) { this.wsStore.setConnectionState( wsKey, - WsConnectionStateEnum.RECONNECTING + WsConnectionStateEnum.RECONNECTING, ); } @@ -468,7 +468,7 @@ export class WebsocketClient extends EventEmitter { this.wsStore.get(wsKey, true).activePongTimer = setTimeout( () => this.executeReconnectableClose(wsKey, 'Pong timeout'), - this.options.pongTimeout + this.options.pongTimeout, ); } @@ -497,7 +497,7 @@ export class WebsocketClient extends EventEmitter { ...loggerCategory, wsKey, reason, - } + }, ); this.reconnectWithDelay(wsKey, this.options.reconnectTimeout); } @@ -540,26 +540,26 @@ export class WebsocketClient extends EventEmitter { */ private requestSubscribeTopics( wsKey: WsKey, - topics: WsChannelSubUnSubRequestArg[] + topics: WsChannelSubUnSubRequestArg[], ) { if (!topics.length) { return; } const maxTopicsPerEvent = getMaxTopicsPerSubscribeEvent( - this.options.market + this.options.market, ); if (maxTopicsPerEvent && topics.length > maxTopicsPerEvent) { this.logger.silly( - `Subscribing to topics in batches of ${maxTopicsPerEvent}` + `Subscribing to topics in batches of ${maxTopicsPerEvent}`, ); - for (var i = 0; i < topics.length; i += maxTopicsPerEvent) { + for (let i = 0; i < topics.length; i += maxTopicsPerEvent) { const batch = topics.slice(i, i + maxTopicsPerEvent); this.logger.silly(`Subscribing to batch of ${batch.length}`); this.requestSubscribeTopics(wsKey, batch); } this.logger.silly( - `Finished batch subscribing to ${topics.length} topics` + `Finished batch subscribing to ${topics.length} topics`, ); return; } @@ -579,26 +579,26 @@ export class WebsocketClient extends EventEmitter { */ private requestUnsubscribeTopics( wsKey: WsKey, - topics: WsChannelSubUnSubRequestArg[] + topics: WsChannelSubUnSubRequestArg[], ) { if (!topics.length) { return; } const maxTopicsPerEvent = getMaxTopicsPerSubscribeEvent( - this.options.market + this.options.market, ); if (maxTopicsPerEvent && topics.length > maxTopicsPerEvent) { this.logger.silly( - `Unsubscribing to topics in batches of ${maxTopicsPerEvent}` + `Unsubscribing to topics in batches of ${maxTopicsPerEvent}`, ); - for (var i = 0; i < topics.length; i += maxTopicsPerEvent) { + for (let i = 0; i < topics.length; i += maxTopicsPerEvent) { const batch = topics.slice(i, i + maxTopicsPerEvent); this.logger.silly(`Unsubscribing to batch of ${batch.length}`); this.requestUnsubscribeTopics(wsKey, batch); } this.logger.silly( - `Finished batch unsubscribing to ${topics.length} topics` + `Finished batch unsubscribing to ${topics.length} topics`, ); return; } @@ -615,26 +615,26 @@ export class WebsocketClient extends EventEmitter { public tryWsSend(wsKey: WsKey, wsMessage: string): void { try { - this.logger.silly(`Sending upstream ws message: `, { + this.logger.silly('Sending upstream ws message: ', { ...loggerCategory, wsMessage, wsKey, }); if (!wsKey) { throw new Error( - `Cannot send message (wsKey not provided: wsKey(${wsKey}))` + `Cannot send message (wsKey not provided: wsKey(${wsKey}))`, ); } const ws = this.wsStore.getWs(wsKey); if (!ws) { throw new Error( - `${wsKey} socket not connected yet, call "connect(${wsKey}) first then try again when the "open" event arrives` + `${wsKey} socket not connected yet, call "connect(${wsKey}) first then try again when the "open" event arrives`, ); } ws.send(wsMessage); } catch (e) { - this.logger.error(`Failed to send WS message`, { + this.logger.error('Failed to send WS message', { ...loggerCategory, wsMessage, wsKey, @@ -680,7 +680,7 @@ export class WebsocketClient extends EventEmitter { this.wsStore.setConnectionState(wsKey, WsConnectionStateEnum.CONNECTED); this.wsStore.get(wsKey, true)!.activePingTimer = setInterval( () => this.ping(wsKey), - this.options.pingInterval + this.options.pingInterval, ); // Private websockets require an auth packet to be sent after opening the connection @@ -716,7 +716,7 @@ export class WebsocketClient extends EventEmitter { const msg = JSON.parse(event?.data || event); if (isWsErrorEvent(msg)) { - this.logger.error(`WS error event: `, { ...msg, wsKey }); + this.logger.error('WS error event: ', { ...msg, wsKey }); return this.emit('error', { ...msg, wsKey }); } @@ -729,7 +729,7 @@ export class WebsocketClient extends EventEmitter { if (msg.code === WS_EVENT_CODE_ENUM.OK) { this.logger.info( `Authenticated successfully on wsKey(${wsKey})`, - logContext + logContext, ); this.emit('response', { ...msg, wsKey }); @@ -743,7 +743,7 @@ export class WebsocketClient extends EventEmitter { return; } - this.logger.error(`Authentication failed: `, { + this.logger.error('Authentication failed: ', { ...logContext, ...msg, wsKey, diff --git a/tsconfig.linting.json b/tsconfig.linting.json new file mode 100644 index 0000000..ee6bda0 --- /dev/null +++ b/tsconfig.linting.json @@ -0,0 +1,18 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "module": "commonjs", + "outDir": "dist/cjs", + "target": "esnext", + "rootDir": "../", + "allowJs": true + }, + "include": [ + "src/**/*.*", + "test/**/*.*", + "examples/**/*.*", + ".eslintrc.cjs", + "jest.config.ts", + "webpack/webpack.config.ts" + ] +} diff --git a/webpack/webpack.config.js b/webpack/webpack.config.js index 8e98cc2..73a2484 100644 --- a/webpack/webpack.config.js +++ b/webpack/webpack.config.js @@ -1,6 +1,6 @@ -const webpack = require('webpack'); const path = require('path'); -const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin; +const BundleAnalyzerPlugin = + require('webpack-bundle-analyzer').BundleAnalyzerPlugin; function generateConfig(name) { var config = { @@ -9,28 +9,30 @@ function generateConfig(name) { path: path.resolve(__dirname, '../dist'), filename: name + '.js', sourceMapFilename: name + '.map', - library: 'okxapi', - libraryTarget: 'umd' + library: name, + libraryTarget: 'umd', }, - devtool: "source-map", + devtool: 'source-map', mode: 'production', resolve: { // Add '.ts' and '.tsx' as resolvable extensions. - extensions: [".webpack.js", ".web.js", ".ts", ".tsx", ".js"], + extensions: ['.webpack.js', '.web.js', '.ts', '.tsx', '.js'], alias: { - [path.resolve(__dirname, "../lib/util/node-support.js")]: - path.resolve(__dirname, "../lib/util/browser-support.js"), - } + [path.resolve(__dirname, '../lib/util/node-support.js')]: path.resolve( + __dirname, + '../lib/util/browser-support.js', + ), + }, }, module: { rules: [ // All files with a '.ts' or '.tsx' extension will be handled by 'ts-loader'. - { test: /\.tsx?$/, loader: "ts-loader" }, + { test: /\.tsx?$/, loader: 'ts-loader' }, // All output '.js' files will have any sourcemaps re-processed by 'source-map-loader'. - { test: /\.js$/, loader: "source-map-loader" }, + { test: /\.js$/, loader: 'source-map-loader' }, { test: /\.m?js$/, @@ -38,28 +40,30 @@ function generateConfig(name) { use: { loader: 'babel-loader', options: { - presets: [['@babel/preset-env', { - 'targets': { - 'node': 'current' - } - }]] - } - } - } - ] - } + presets: [ + [ + '@babel/preset-env', + { + targets: { + node: 'current', + }, + }, + ], + ], + }, + }, + }, + ], + }, }; config.plugins = [ - new webpack.DefinePlugin({ - 'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV) - }), new BundleAnalyzerPlugin({ defaultSizes: 'stat', analyzerMode: 'static', reportFilename: '../doc/bundleReport.html', openAnalyzer: false, - }) + }), ]; return config;