From 13a4298f875edefd69896a4ba2ef9d4c291809d7 Mon Sep 17 00:00:00 2001 From: throwaway96 <68320646+throwaway96@users.noreply.github.com> Date: Tue, 5 Mar 2024 07:36:11 -0500 Subject: [PATCH 1/2] switch to new ESLint flat config format And make everything pass the new, stricter checks. --- .eslintrc.json | 36 - eslint.config.mjs | 174 ++++ package-lock.json | 930 +++++++++++------- package.json | 9 +- services/adapter.ts | 11 +- services/buffer-shim.js | 2 +- services/protocol.ts | 2 +- services/service.ts | 226 +++-- services/webos-service-remote/message.js | 2 +- services/webos-service-remote/subscription.js | 11 +- 10 files changed, 902 insertions(+), 501 deletions(-) delete mode 100644 .eslintrc.json create mode 100644 eslint.config.mjs diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index 78c5a88..0000000 --- a/.eslintrc.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "root": true, - "extends": [ - "airbnb-typescript/base", - "prettier" - ], - "parser": "@typescript-eslint/parser", - "plugins": [ - "prettier", - "import" - ], - "rules": { - "prettier/prettier": [ - "error" - ], - "no-console": "off", - "no-restricted-syntax": "off", - "import/no-extraneous-dependencies": [ - "error", - { - "devDependencies": true, - "packageDir": "./" - } - ], - "@typescript-eslint/ban-ts-comment": "off" - }, - "ignorePatterns": [ - "frontend/**", - "lib/**", - "node_modules/**", - "dist/**" - ], - "parserOptions": { - "project": "./tsconfig.json" - } -} diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 0000000..cfb90b1 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,174 @@ +import js from '@eslint/js'; +import ts from 'typescript-eslint'; + +import jsoncParser from 'jsonc-eslint-parser'; + +import prettierPlugin from 'eslint-plugin-prettier'; +import importPlugin from 'eslint-plugin-import'; + +import prettierConfig from 'eslint-config-prettier'; + +import globals from 'globals'; + +/* __dirname is not available, so fake it */ +import path from 'node:path'; +import { fileURLToPath } from 'node:url'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); + +/* eslint-config-airbnb-typescript is not yet compatible with flat config */ +import airbnbBaseConfig from 'eslint-config-airbnb-typescript/base.js'; /* eslint-disable-line import/extensions */ +import { FlatCompat } from '@eslint/eslintrc'; + +const compat = new FlatCompat({ + baseDirectory: __dirname, +}); + +/* convert eslintrc style to flat config */ +const airbnbCompat = compat.config(airbnbBaseConfig); + +/* tries to include a conflicting plugin by default and is missing this one */ +airbnbCompat[0].plugins = { + import: importPlugin, +}; + +export default ts.config( + { + ignores: ['frontend/**', 'lib/**', 'node_modules/**', 'dist/**'], + }, + js.configs.recommended, + ...ts.configs.strictTypeChecked, + ...airbnbCompat, + prettierConfig, + { + /* all JS/TS files */ + files: ['**/*.{js,mjs,cjs,ts}'], + plugins: { + prettier: prettierPlugin, + import: importPlugin, + }, + rules: { + 'prettier/prettier': ['error'], + /* allow names that start with _ to be unused */ + '@typescript-eslint/no-unused-vars': [ + 'error', + { + args: 'all', + argsIgnorePattern: '^_', + caughtErrors: 'all', + caughtErrorsIgnorePattern: '^_', + destructuredArrayIgnorePattern: '^_', + varsIgnorePattern: '^_', + }, + ], + }, + }, + { + /* non-TypeScript JS files */ + files: ['**/*.{js,mjs,cjs,json}'], + /* disable the TypeScript-specific rules from strictTypeChecked */ + ...ts.configs.disableTypeChecked, + }, + { + /* TypeScript files */ + files: ['**/*.ts'], + languageOptions: { + parser: ts.parser, + parserOptions: { + /* use closest tsconfig.json */ + project: true, + tsconfigRootDir: __dirname, + }, + }, + plugins: { + '@typescript-eslint': ts.plugin, + }, + settings: { + 'import/resolver': { + /* import doesn't seem to check .ts files without this */ + typescript: {}, + }, + }, + rules: { + /* only enable these for TypeScript files */ + ...ts.configs.stylisticTypeChecked[0].rules, + '@typescript-eslint/ban-ts-comment': 'off', + /* avoid spurious errors */ + '@typescript-eslint/no-base-to-string': [ + 'error', + { + ignoredTypeNames: ['Error', 'ErrnoException'], + }, + ], + /* use @ts-expect-error instead of @ts-ignore */ + '@typescript-eslint/prefer-ts-expect-error': 'error', + /* too many errors with this one */ + '@typescript-eslint/no-explicit-any': 'off', + }, + }, + { + /* check syntax of JSON files */ + files: ['**/*.json'], + languageOptions: { + parser: jsoncParser, + }, + }, + { + files: ['services/**/*.{js,ts}', 'tools/*.js', 'eslint.config.{js,cjs,mjs}', 'webpack.config.js'], + /* all of these use node */ + languageOptions: { + globals: { + ...globals.node, + }, + }, + }, + { + files: ['services/**/*.{js,ts}'], + rules: { + /* logging to console is fine */ + 'no-console': 'off', + /* no dev dependencies in shipped code */ + 'import/no-extraneous-dependencies': [ + 'error', + { + devDependencies: false, + packageDir: __dirname, + }, + ], + }, + }, + { + files: ['tools/*.js'], + rules: { + /* not sure how to tell it these aren't modules */ + '@typescript-eslint/no-var-requires': 'off', + }, + }, + { + files: ['*.config.{js,cjs,mjs}'], + rules: { + /* obviously we need dev dependencies */ + 'import/no-extraneous-dependencies': [ + 'error', + { + devDependencies: true, + packageDir: __dirname, + }, + ], + }, + }, + { + files: ['eslint.config.{js,cjs,mjs}'], + rules: { + /* necessary for flat config */ + 'import/no-default-export': 'off', + }, + }, + { + files: ['webpack.config.js'], + rules: { + '@typescript-eslint/no-var-requires': 'off', + }, + }, +); diff --git a/package-lock.json b/package-lock.json index e83c5b9..d439b15 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,7 +15,7 @@ "bluebird": "^3.7.2", "core-js": "^3.36.0", "dompurify": "^2.2.8", - "node-fetch": "^2.6.1 <2.6.8", + "node-fetch": "=2.6.7", "progress-stream": "^2.0.0", "regenerator-runtime": "^0.13.7", "stream.pipeline-shim": "^1.1.0", @@ -26,6 +26,8 @@ "@babel/plugin-transform-object-assign": "^7.23.3", "@babel/preset-env": "^7.24.0", "@babel/preset-typescript": "^7.23.3", + "@eslint/eslintrc": "^3.0.2", + "@eslint/js": "^8.57.0", "@types/bluebird": "^3.5.42", "@types/node": "^20.11.24", "@types/node-fetch": "^2.6.11", @@ -39,13 +41,18 @@ "eslint": "^8.57.0", "eslint-config-airbnb-typescript": "^18.0.0", "eslint-config-prettier": "^9.1.0", + "eslint-import-resolver-typescript": "^3.6.1", "eslint-plugin-import": "^2.29.1", + "eslint-plugin-n": "^16.6.2", "eslint-plugin-prettier": "^5.1.3", "esm": "^3.2.25", "fork-ts-checker-webpack-plugin": "^9.0.2", + "globals": "^14.0.0", + "jsonc-eslint-parser": "^2.4.0", "npm-run-all": "^4.1.5", "prettier": "^3.2.5", "typescript": "^5.3.3", + "typescript-eslint": "^7.1.1", "webpack": "^5.90.3", "webpack-cli": "^5.1.4", "webpack-shebang-plugin": "^1.1.8" @@ -945,6 +952,15 @@ "@babel/core": "^7.0.0-0" } }, + "node_modules/@babel/plugin-transform-classes/node_modules/globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true, + "engines": { + "node": ">=4" + } + }, "node_modules/@babel/plugin-transform-computed-properties": { "version": "7.23.3", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.23.3.tgz", @@ -1801,6 +1817,15 @@ "node": ">=6.9.0" } }, + "node_modules/@babel/traverse/node_modules/globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true, + "engines": { + "node": ">=4" + } + }, "node_modules/@babel/types": { "version": "7.24.0", "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.0.tgz", @@ -1849,15 +1874,15 @@ } }, "node_modules/@eslint/eslintrc": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", - "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.0.2.tgz", + "integrity": "sha512-wV19ZEGEMAC1eHgrS7UQPqsdEiCIbTKTasEfcXAigzoXICcqZSjBZEHlZwNVvKg6UBCjSlos84XiLqsRJnIcIg==", "dev": true, "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", - "espree": "^9.6.0", - "globals": "^13.19.0", + "espree": "^10.0.1", + "globals": "^14.0.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", "js-yaml": "^4.1.0", @@ -1865,49 +1890,12 @@ "strip-json-comments": "^3.1.1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "url": "https://opencollective.com/eslint" } }, - "node_modules/@eslint/eslintrc/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/@eslint/eslintrc/node_modules/globals": { - "version": "13.24.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", - "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", - "dev": true, - "dependencies": { - "type-fest": "^0.20.2" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@eslint/eslintrc/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/@eslint/js": { "version": "8.57.0", "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz", @@ -1931,28 +1919,6 @@ "node": ">=10.10.0" } }, - "node_modules/@humanwhocodes/config-array/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/@humanwhocodes/config-array/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/@humanwhocodes/module-importer": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", @@ -2165,16 +2131,16 @@ } }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.1.0.tgz", - "integrity": "sha512-j6vT/kCulhG5wBmGtstKeiVr1rdXE4nk+DT1k6trYkwlrvW9eOF5ZbgKnd/YR6PcM4uTEXa0h6Fcvf6X7Dxl0w==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.1.1.tgz", + "integrity": "sha512-zioDz623d0RHNhvx0eesUmGfIjzrk18nSBC8xewepKXbBvN/7c1qImV7Hg8TI1URTxKax7/zxfxj3Uph8Chcuw==", "dev": true, "dependencies": { "@eslint-community/regexpp": "^4.5.1", - "@typescript-eslint/scope-manager": "7.1.0", - "@typescript-eslint/type-utils": "7.1.0", - "@typescript-eslint/utils": "7.1.0", - "@typescript-eslint/visitor-keys": "7.1.0", + "@typescript-eslint/scope-manager": "7.1.1", + "@typescript-eslint/type-utils": "7.1.1", + "@typescript-eslint/utils": "7.1.1", + "@typescript-eslint/visitor-keys": "7.1.1", "debug": "^4.3.4", "graphemer": "^1.4.0", "ignore": "^5.2.4", @@ -2233,15 +2199,15 @@ "dev": true }, "node_modules/@typescript-eslint/parser": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.1.0.tgz", - "integrity": "sha512-V1EknKUubZ1gWFjiOZhDSNToOjs63/9O0puCgGS8aDOgpZY326fzFu15QAUjwaXzRZjf/qdsdBrckYdv9YxB8w==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.1.1.tgz", + "integrity": "sha512-ZWUFyL0z04R1nAEgr9e79YtV5LbafdOtN7yapNbn1ansMyaegl2D4bL7vHoJ4HPSc4CaLwuCVas8CVuneKzplQ==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "7.1.0", - "@typescript-eslint/types": "7.1.0", - "@typescript-eslint/typescript-estree": "7.1.0", - "@typescript-eslint/visitor-keys": "7.1.0", + "@typescript-eslint/scope-manager": "7.1.1", + "@typescript-eslint/types": "7.1.1", + "@typescript-eslint/typescript-estree": "7.1.1", + "@typescript-eslint/visitor-keys": "7.1.1", "debug": "^4.3.4" }, "engines": { @@ -2261,13 +2227,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.1.0.tgz", - "integrity": "sha512-6TmN4OJiohHfoOdGZ3huuLhpiUgOGTpgXNUPJgeZOZR3DnIpdSgtt83RS35OYNNXxM4TScVlpVKC9jyQSETR1A==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.1.1.tgz", + "integrity": "sha512-cirZpA8bJMRb4WZ+rO6+mnOJrGFDd38WoXCEI57+CYBqta8Yc8aJym2i7vyqLL1vVYljgw0X27axkUXz32T8TA==", "dev": true, "dependencies": { - "@typescript-eslint/types": "7.1.0", - "@typescript-eslint/visitor-keys": "7.1.0" + "@typescript-eslint/types": "7.1.1", + "@typescript-eslint/visitor-keys": "7.1.1" }, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -2278,13 +2244,13 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.1.0.tgz", - "integrity": "sha512-UZIhv8G+5b5skkcuhgvxYWHjk7FW7/JP5lPASMEUoliAPwIH/rxoUSQPia2cuOj9AmDZmwUl1usKm85t5VUMew==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.1.1.tgz", + "integrity": "sha512-5r4RKze6XHEEhlZnJtR3GYeCh1IueUHdbrukV2KSlLXaTjuSfeVF8mZUVPLovidCuZfbVjfhi4c0DNSa/Rdg5g==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "7.1.0", - "@typescript-eslint/utils": "7.1.0", + "@typescript-eslint/typescript-estree": "7.1.1", + "@typescript-eslint/utils": "7.1.1", "debug": "^4.3.4", "ts-api-utils": "^1.0.1" }, @@ -2305,9 +2271,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.1.0.tgz", - "integrity": "sha512-qTWjWieJ1tRJkxgZYXx6WUYtWlBc48YRxgY2JN1aGeVpkhmnopq+SUC8UEVGNXIvWH7XyuTjwALfG6bFEgCkQA==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.1.1.tgz", + "integrity": "sha512-KhewzrlRMrgeKm1U9bh2z5aoL4s7K3tK5DwHDn8MHv0yQfWFz/0ZR6trrIHHa5CsF83j/GgHqzdbzCXJ3crx0Q==", "dev": true, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -2318,13 +2284,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.1.0.tgz", - "integrity": "sha512-k7MyrbD6E463CBbSpcOnwa8oXRdHzH1WiVzOipK3L5KSML92ZKgUBrTlehdi7PEIMT8k0bQixHUGXggPAlKnOQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.1.1.tgz", + "integrity": "sha512-9ZOncVSfr+sMXVxxca2OJOPagRwT0u/UHikM2Rd6L/aB+kL/QAuTnsv6MeXtjzCJYb8PzrXarypSGIPx3Jemxw==", "dev": true, "dependencies": { - "@typescript-eslint/types": "7.1.0", - "@typescript-eslint/visitor-keys": "7.1.0", + "@typescript-eslint/types": "7.1.1", + "@typescript-eslint/visitor-keys": "7.1.1", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -2345,6 +2311,15 @@ } } }, + "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, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, "node_modules/@typescript-eslint/typescript-estree/node_modules/lru-cache": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", @@ -2357,6 +2332,21 @@ "node": ">=10" } }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/@typescript-eslint/typescript-estree/node_modules/semver": { "version": "7.6.0", "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", @@ -2379,17 +2369,17 @@ "dev": true }, "node_modules/@typescript-eslint/utils": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.1.0.tgz", - "integrity": "sha512-WUFba6PZC5OCGEmbweGpnNJytJiLG7ZvDBJJoUcX4qZYf1mGZ97mO2Mps6O2efxJcJdRNpqweCistDbZMwIVHw==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.1.1.tgz", + "integrity": "sha512-thOXM89xA03xAE0lW7alstvnyoBUbBX38YtY+zAUcpRPcq9EIhXPuJ0YTv948MbzmKh6e1AUszn5cBFK49Umqg==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", "@types/json-schema": "^7.0.12", "@types/semver": "^7.5.0", - "@typescript-eslint/scope-manager": "7.1.0", - "@typescript-eslint/types": "7.1.0", - "@typescript-eslint/typescript-estree": "7.1.0", + "@typescript-eslint/scope-manager": "7.1.1", + "@typescript-eslint/types": "7.1.1", + "@typescript-eslint/typescript-estree": "7.1.1", "semver": "^7.5.4" }, "engines": { @@ -2437,12 +2427,12 @@ "dev": true }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.1.0.tgz", - "integrity": "sha512-FhUqNWluiGNzlvnDZiXad4mZRhtghdoKW6e98GoEOYSu5cND+E39rG5KwJMUzeENwm1ztYBRqof8wMLP+wNPIA==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.1.1.tgz", + "integrity": "sha512-yTdHDQxY7cSoCcAtiBzVzxleJhkGB9NncSIyMYe2+OGON1ZsP9zOPws/Pqgopa65jvknOjlk/w7ulPlZ78PiLQ==", "dev": true, "dependencies": { - "@typescript-eslint/types": "7.1.0", + "@typescript-eslint/types": "7.1.1", "eslint-visitor-keys": "^3.4.1" }, "engines": { @@ -7726,7 +7716,6 @@ "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz", "integrity": "sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==", "dev": true, - "optional": true, "dependencies": { "safer-buffer": "~2.1.0" } @@ -7736,7 +7725,6 @@ "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.2.0.tgz", "integrity": "sha512-u1L0ZLywRziOVjUhRxI0Qg9G+4RnFB9H/Rq40YWn0dieDgO7vAYeJz6jKAO6t/aruzlDFLAPkQTT87e+f8Imaw==", "dev": true, - "optional": true, "engines": { "node": ">=0.8" } @@ -7809,7 +7797,6 @@ "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz", "integrity": "sha512-JnJpAS0p9RmixkOvW2XwDxxzs1bd4/VAGIl6Q0EC5YOo+p+hqIhtDhn/nmFnB/xUNXbLkpE2mOjgVIBRKD4xYw==", "dev": true, - "optional": true, "engines": { "node": "*" } @@ -7818,8 +7805,7 @@ "version": "1.12.0", "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.12.0.tgz", "integrity": "sha512-NmWvPnx0F1SfrQbYwOi7OeaNGokp9XhzNioJ/CSBs8Qa4vxug81mhJEAVZwxXuBmYB5KDRfMq/F3RR0BIU7sWg==", - "dev": true, - "optional": true + "dev": true }, "node_modules/babel-code-frame": { "version": "6.26.0", @@ -7911,16 +7897,6 @@ "source-map": "^0.5.7" } }, - "node_modules/babel-core/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, "node_modules/babel-core/node_modules/convert-source-map": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", @@ -7945,18 +7921,6 @@ "json5": "lib/cli.js" } }, - "node_modules/babel-core/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/babel-core/node_modules/ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", @@ -8674,7 +8638,6 @@ "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", "integrity": "sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==", "dev": true, - "optional": true, "dependencies": { "tweetnacl": "^0.14.3" } @@ -8748,7 +8711,6 @@ "integrity": "sha512-KbiZEa9/vofNcVJXGwdWWn25reQ3V3dHBWbS07FTF3/TOehLnm9GEhJV4T6ZvGPkShRpmUqYwnaCrkj0mRnP6Q==", "deprecated": "This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).", "dev": true, - "optional": true, "dependencies": { "hoek": "2.x.x" }, @@ -8757,12 +8719,13 @@ } }, "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==", + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, "dependencies": { - "balanced-match": "^1.0.0" + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" } }, "node_modules/braces": { @@ -8817,6 +8780,60 @@ "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", "dev": true }, + "node_modules/builtin-modules": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.3.0.tgz", + "integrity": "sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==", + "dev": true, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/builtins": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/builtins/-/builtins-5.0.1.tgz", + "integrity": "sha512-qwVpFEHNfhYJIzNRBvd2C1kyo6jz3ZSMPyyuR47OPdiKWlbYnZNyDWuyR175qDnAJLiCo5fBBqPb3RiXgWlkOQ==", + "dev": true, + "dependencies": { + "semver": "^7.0.0" + } + }, + "node_modules/builtins/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/builtins/node_modules/semver": { + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/builtins/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, "node_modules/bunyan": { "version": "1.8.15", "resolved": "https://registry.npmjs.org/bunyan/-/bunyan-1.8.15.tgz", @@ -8922,9 +8939,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001593", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001593.tgz", - "integrity": "sha512-UWM1zlo3cZfkpBysd7AS+z+v007q9G1+fLTUU42rQnY6t2axoogPW/xol6T7juU5EUoOhML4WgBIdG+9yYqAjQ==", + "version": "1.0.30001594", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001594.tgz", + "integrity": "sha512-VblSX6nYqyJVs8DKFMldE2IVCJjZ225LW00ydtUWwh5hk9IfkTOffO6r8gJNsH0qqqeAF8KrbMYA2VEwTlGW5g==", "dev": true, "funding": [ { @@ -8945,8 +8962,7 @@ "version": "0.12.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", "integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==", - "dev": true, - "optional": true + "dev": true }, "node_modules/center-align": { "version": "0.1.3", @@ -9183,7 +9199,6 @@ "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", "integrity": "sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==", "dev": true, - "optional": true, "engines": { "iojs": ">= 1.0.0", "node": ">= 0.12.0" @@ -9466,7 +9481,6 @@ "integrity": "sha512-FFN5KwpvvQTTS5hWPxrU8/QE4kQUc6uwZcrnlMBN82t1MgAtq8mnoDwINBly9Tdr02seeIIhtdF+UH1feBYGog==", "deprecated": "This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).", "dev": true, - "optional": true, "dependencies": { "boom": "2.x.x" }, @@ -9516,7 +9530,6 @@ "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", "integrity": "sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g==", "dev": true, - "optional": true, "dependencies": { "assert-plus": "^1.0.0" }, @@ -9529,7 +9542,6 @@ "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", "integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==", "dev": true, - "optional": true, "engines": { "node": ">=0.8" } @@ -9757,7 +9769,6 @@ "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", "integrity": "sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw==", "dev": true, - "optional": true, "dependencies": { "jsbn": "~0.1.0", "safer-buffer": "^2.1.0" @@ -9770,9 +9781,9 @@ "dev": true }, "node_modules/electron-to-chromium": { - "version": "1.4.690", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.690.tgz", - "integrity": "sha512-+2OAGjUx68xElQhydpcbqH50hE8Vs2K6TkAeLhICYfndb67CVH0UsZaijmRUE3rHlIxU1u0jxwhgVe6fK3YANA==", + "version": "1.4.692", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.692.tgz", + "integrity": "sha512-d5rZRka9n2Y3MkWRN74IoAsxR0HK3yaAt7T50e3iT9VZmCCQDT3geXUO5ZRMhDToa1pkCeQXuNo+0g+NfDOVPA==", "dev": true }, "node_modules/encodeurl": { @@ -10164,6 +10175,18 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/eslint-compat-utils": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/eslint-compat-utils/-/eslint-compat-utils-0.1.2.tgz", + "integrity": "sha512-Jia4JDldWnFNIru1Ehx1H5s9/yxiRHY/TimCuUc0jNexew3cF1gI6CYZil1ociakfWO3rRqFjl1mskBblB3RYg==", + "dev": true, + "engines": { + "node": ">=12" + }, + "peerDependencies": { + "eslint": ">=6.0.0" + } + }, "node_modules/eslint-config-airbnb-base": { "version": "15.0.0", "resolved": "https://registry.npmjs.org/eslint-config-airbnb-base/-/eslint-config-airbnb-base-15.0.0.tgz", @@ -10229,6 +10252,31 @@ "ms": "^2.1.1" } }, + "node_modules/eslint-import-resolver-typescript": { + "version": "3.6.1", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-3.6.1.tgz", + "integrity": "sha512-xgdptdoi5W3niYeuQxKmzVDTATvLYqhpwmykwsh7f6HIOStGWEIL9iqZgQDF9u9OEzrRwR8no5q2VT+bjAujTg==", + "dev": true, + "dependencies": { + "debug": "^4.3.4", + "enhanced-resolve": "^5.12.0", + "eslint-module-utils": "^2.7.4", + "fast-glob": "^3.3.1", + "get-tsconfig": "^4.5.0", + "is-core-module": "^2.11.0", + "is-glob": "^4.0.3" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts/projects/eslint-import-resolver-ts" + }, + "peerDependencies": { + "eslint": "*", + "eslint-plugin-import": "*" + } + }, "node_modules/eslint-module-utils": { "version": "2.8.1", "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.8.1.tgz", @@ -10255,6 +10303,26 @@ "ms": "^2.1.1" } }, + "node_modules/eslint-plugin-es-x": { + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-es-x/-/eslint-plugin-es-x-7.5.0.tgz", + "integrity": "sha512-ODswlDSO0HJDzXU0XvgZ3lF3lS3XAZEossh15Q2UHjwrJggWeBoKqqEsLTZLXl+dh5eOAozG0zRcYtuE35oTuQ==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.1.2", + "@eslint-community/regexpp": "^4.6.0", + "eslint-compat-utils": "^0.1.2" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ota-meshi" + }, + "peerDependencies": { + "eslint": ">=8" + } + }, "node_modules/eslint-plugin-import": { "version": "2.29.1", "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.29.1.tgz", @@ -10286,16 +10354,6 @@ "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8" } }, - "node_modules/eslint-plugin-import/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, "node_modules/eslint-plugin-import/node_modules/debug": { "version": "3.2.7", "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", @@ -10317,32 +10375,96 @@ "node": ">=0.10.0" } }, - "node_modules/eslint-plugin-import/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "node_modules/eslint-plugin-n": { + "version": "16.6.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-16.6.2.tgz", + "integrity": "sha512-6TyDmZ1HXoFQXnhCTUjVFULReoBPOAjpuiKELMkeP40yffI/1ZRO+d9ug/VC6fqISo2WkuIBk3cvuRPALaWlOQ==", "dev": true, "dependencies": { - "brace-expansion": "^1.1.7" + "@eslint-community/eslint-utils": "^4.4.0", + "builtins": "^5.0.1", + "eslint-plugin-es-x": "^7.5.0", + "get-tsconfig": "^4.7.0", + "globals": "^13.24.0", + "ignore": "^5.2.4", + "is-builtin-module": "^3.2.1", + "is-core-module": "^2.12.1", + "minimatch": "^3.1.2", + "resolve": "^1.22.2", + "semver": "^7.5.3" }, "engines": { - "node": "*" + "node": ">=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + }, + "peerDependencies": { + "eslint": ">=7.0.0" } }, - "node_modules/eslint-plugin-prettier": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.1.3.tgz", - "integrity": "sha512-C9GCVAs4Eq7ZC/XFQHITLiHJxQngdtraXaM+LoUFoFp/lHNl2Zn8f3WQbe9HvTBBQ9YnKFB0/2Ajdqwo5D1EAw==", + "node_modules/eslint-plugin-n/node_modules/globals": { + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", "dev": true, "dependencies": { - "prettier-linter-helpers": "^1.0.0", - "synckit": "^0.8.6" + "type-fest": "^0.20.2" }, "engines": { - "node": "^14.18.0 || >=16.0.0" + "node": ">=8" }, "funding": { - "url": "https://opencollective.com/eslint-plugin-prettier" + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint-plugin-n/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/eslint-plugin-n/node_modules/semver": { + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/eslint-plugin-n/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, + "node_modules/eslint-plugin-prettier": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.1.3.tgz", + "integrity": "sha512-C9GCVAs4Eq7ZC/XFQHITLiHJxQngdtraXaM+LoUFoFp/lHNl2Zn8f3WQbe9HvTBBQ9YnKFB0/2Ajdqwo5D1EAw==", + "dev": true, + "dependencies": { + "prettier-linter-helpers": "^1.0.0", + "synckit": "^0.8.6" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint-plugin-prettier" }, "peerDependencies": { "@types/eslint": ">=8.0.0", @@ -10387,6 +10509,50 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/eslint/node_modules/@eslint/eslintrc": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", + "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", + "dev": true, + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.6.0", + "globals": "^13.19.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint/node_modules/acorn": { + "version": "8.11.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", + "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/eslint/node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, "node_modules/eslint/node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", @@ -10402,16 +10568,6 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/eslint/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, "node_modules/eslint/node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -10458,6 +10614,23 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/eslint/node_modules/espree": { + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", + "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", + "dev": true, + "dependencies": { + "acorn": "^8.9.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, "node_modules/eslint/node_modules/glob-parent": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", @@ -10494,18 +10667,6 @@ "node": ">=8" } }, - "node_modules/eslint/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/eslint/node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -10528,17 +10689,17 @@ } }, "node_modules/espree": { - "version": "9.6.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", - "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.0.1.tgz", + "integrity": "sha512-MWkrWZbJsL2UwnjxTX3gG8FneachS/Mwg7tdGXce011sJd5b0JG54vat5KHnfSBODZ3Wvzd2WnjxyzsRoVv+ww==", "dev": true, "dependencies": { - "acorn": "^8.9.0", + "acorn": "^8.11.3", "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^3.4.1" + "eslint-visitor-keys": "^4.0.0" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "url": "https://opencollective.com/eslint" @@ -10565,6 +10726,18 @@ "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, + "node_modules/espree/node_modules/eslint-visitor-keys": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.0.0.tgz", + "integrity": "sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw==", + "dev": true, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, "node_modules/esquery": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", @@ -10719,8 +10892,7 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", - "dev": true, - "optional": true + "dev": true }, "node_modules/extend-shallow": { "version": "3.0.2", @@ -10775,8 +10947,7 @@ "dev": true, "engines": [ "node >=0.6.0" - ], - "optional": true + ] }, "node_modules/eyes": { "version": "0.1.8", @@ -11086,7 +11257,6 @@ "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", "integrity": "sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw==", "dev": true, - "optional": true, "engines": { "node": "*" } @@ -11156,16 +11326,6 @@ "node": ">=8" } }, - "node_modules/fork-ts-checker-webpack-plugin/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, "node_modules/fork-ts-checker-webpack-plugin/node_modules/braces": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", @@ -11333,18 +11493,6 @@ "node": ">=10" } }, - "node_modules/fork-ts-checker-webpack-plugin/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/fork-ts-checker-webpack-plugin/node_modules/normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", @@ -11474,16 +11622,6 @@ "rimraf": "^2.2.8" } }, - "node_modules/fs-extra/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, "node_modules/fs-extra/node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -11504,18 +11642,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/fs-extra/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/fs-extra/node_modules/rimraf": { "version": "2.7.1", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", @@ -11638,6 +11764,18 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/get-tsconfig": { + "version": "4.7.2", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.2.tgz", + "integrity": "sha512-wuMsz4leaj5hbGgg4IvDU0bqJagpftG5l5cXIAvo8uZrqn0NJqwtfupTN00VnkQJPcIRrxYrm1Ue24btpCha2A==", + "dev": true, + "dependencies": { + "resolve-pkg-maps": "^1.0.0" + }, + "funding": { + "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" + } + }, "node_modules/get-value": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", @@ -11652,7 +11790,6 @@ "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", "integrity": "sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng==", "dev": true, - "optional": true, "dependencies": { "assert-plus": "^1.0.0" } @@ -11662,7 +11799,6 @@ "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", "integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==", "dev": true, - "optional": true, "engines": { "node": ">=0.8" } @@ -11765,35 +11901,16 @@ "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", "dev": true }, - "node_modules/glob/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/glob/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/globals": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", + "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", "dev": true, "engines": { - "node": ">=4" + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/globalthis": { @@ -11874,7 +11991,6 @@ "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-1.0.5.tgz", "integrity": "sha512-f8xf2GOR6Rgwc9FPTLNzgwB+JQ2/zMauYXSWmX5YV5acex6VomT0ocSuwR7BfXo5MpHi+jL+saaux2fwsGJDKQ==", "dev": true, - "optional": true, "engines": { "node": ">=4" } @@ -11885,7 +12001,6 @@ "integrity": "sha512-5Gbp6RAftMYYV3UEI4c4Vv3+a4dQ7taVyvHt+/L6kRt+f4HX1GweAk5UDWN0SvdVnRBzGQ6OG89pGaD9uSFnVw==", "deprecated": "this library is no longer supported", "dev": true, - "optional": true, "dependencies": { "ajv": "^4.9.1", "har-schema": "^1.0.5" @@ -11899,7 +12014,6 @@ "resolved": "https://registry.npmjs.org/ajv/-/ajv-4.11.8.tgz", "integrity": "sha512-I/bSHSNEcFFqXLf91nchoNB9D1Kie3QKcWdchYUaoIg1+1bdWDkdfdlvdIOJbi9U8xR0y+MWc5D+won9v95WlQ==", "dev": true, - "optional": true, "dependencies": { "co": "^4.6.0", "json-stable-stringify": "^1.0.1" @@ -12081,7 +12195,6 @@ "integrity": "sha512-X8xbmTc1cbPXcQV4WkLcRMALuyoxhfpFATmyuCxJPOAvrDS4DNnsTAOmKUxMTOWU6TzrTOkxPKwIx5ZOpJVSrg==", "deprecated": "This module moved to @hapi/hawk. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues.", "dev": true, - "optional": true, "dependencies": { "boom": "2.x.x", "cryptiles": "2.x.x", @@ -12098,7 +12211,6 @@ "integrity": "sha512-V6Yw1rIcYV/4JsnggjBU0l4Kr+EXhpwqXRusENU1Xx6ro00IHPHYNynCuBTOZAPlr3AAmLvchH9I7N/VUdvOwQ==", "deprecated": "This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).", "dev": true, - "optional": true, "engines": { "node": ">=0.10.40" } @@ -12143,7 +12255,6 @@ "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.1.1.tgz", "integrity": "sha512-iUn0NcRULlDGtqNLN1Jxmzayk8ogm7NToldASyZBpM2qggbphjXzNOiw3piN8tgz+e/DRs6X5gAzFwTI6BCRcg==", "dev": true, - "optional": true, "dependencies": { "assert-plus": "^0.2.0", "jsprim": "^1.2.2", @@ -12514,6 +12625,21 @@ "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", "dev": true }, + "node_modules/is-builtin-module": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-3.2.1.tgz", + "integrity": "sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A==", + "dev": true, + "dependencies": { + "builtin-modules": "^3.3.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/is-callable": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", @@ -12826,8 +12952,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==", - "dev": true, - "optional": true + "dev": true }, "node_modules/is-weakref": { "version": "1.0.2", @@ -12976,8 +13101,7 @@ "version": "0.1.1", "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", "integrity": "sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==", - "dev": true, - "optional": true + "dev": true }, "node_modules/jsesc": { "version": "2.5.2", @@ -13013,8 +13137,7 @@ "version": "0.4.0", "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==", - "dev": true, - "optional": true + "dev": true }, "node_modules/json-schema-traverse": { "version": "0.4.1", @@ -13027,7 +13150,6 @@ "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.1.1.tgz", "integrity": "sha512-SU/971Kt5qVQfJpyDveVhQ/vya+5hvrjClFOcr8c0Fq5aODJjMwutrOfCU+eCnVD5gpx1Q3fEqkyom77zH1iIg==", "dev": true, - "optional": true, "dependencies": { "call-bind": "^1.0.5", "isarray": "^2.0.5", @@ -13051,15 +13173,13 @@ "version": "2.0.5", "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", - "dev": true, - "optional": true + "dev": true }, "node_modules/json-stringify-safe": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", - "dev": true, - "optional": true + "dev": true }, "node_modules/json5": { "version": "2.2.3", @@ -13073,6 +13193,95 @@ "node": ">=6" } }, + "node_modules/jsonc-eslint-parser": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/jsonc-eslint-parser/-/jsonc-eslint-parser-2.4.0.tgz", + "integrity": "sha512-WYDyuc/uFcGp6YtM2H0uKmUwieOuzeE/5YocFJLnLfclZ4inf3mRn8ZVy1s7Hxji7Jxm6Ss8gqpexD/GlKoGgg==", + "dev": true, + "dependencies": { + "acorn": "^8.5.0", + "eslint-visitor-keys": "^3.0.0", + "espree": "^9.0.0", + "semver": "^7.3.5" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ota-meshi" + } + }, + "node_modules/jsonc-eslint-parser/node_modules/acorn": { + "version": "8.11.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", + "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/jsonc-eslint-parser/node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/jsonc-eslint-parser/node_modules/espree": { + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", + "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", + "dev": true, + "dependencies": { + "acorn": "^8.9.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/jsonc-eslint-parser/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/jsonc-eslint-parser/node_modules/semver": { + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/jsonc-eslint-parser/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, "node_modules/jsonfile": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", @@ -13087,7 +13296,6 @@ "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.1.tgz", "integrity": "sha512-2/Ki0GcmuqSrgFyelQq9M05y7PS0mEwuIzrf3f1fPqkVDVRvZrPZtVSMHxdgo8Aq0sxAOb/cr2aqqA3LeWHVPg==", "dev": true, - "optional": true, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -13097,7 +13305,6 @@ "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.2.tgz", "integrity": "sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==", "dev": true, - "optional": true, "dependencies": { "assert-plus": "1.0.0", "extsprintf": "1.3.0", @@ -13113,7 +13320,6 @@ "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", "integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==", "dev": true, - "optional": true, "engines": { "node": ">=0.8" } @@ -13514,18 +13720,15 @@ } }, "node_modules/minimatch": { - "version": "9.0.3", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", - "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, "dependencies": { - "brace-expansion": "^2.0.1" + "brace-expansion": "^1.1.7" }, "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "node": "*" } }, "node_modules/minimist": { @@ -13858,16 +14061,6 @@ "node": ">= 4" } }, - "node_modules/npm-run-all/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, "node_modules/npm-run-all/node_modules/cross-spawn": { "version": "6.0.5", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", @@ -13884,18 +14077,6 @@ "node": ">=4.8" } }, - "node_modules/npm-run-all/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/npm-run-all/node_modules/path-key": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", @@ -13961,7 +14142,6 @@ "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", "integrity": "sha512-VlF07iu3VV3+BTXj43Nmp6Irt/G7j/NgEctUS6IweH1RGhURjjCc2NWtzXFPXXWWfc7hgbXQdtiQu2LGp6MxUg==", "dev": true, - "optional": true, "engines": { "node": "*" } @@ -14424,8 +14604,7 @@ "version": "0.2.0", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-0.2.0.tgz", "integrity": "sha512-YHk5ez1hmMR5LOkb9iJkLKqoBlL7WD5M8ljC75ZfzXriuBIVNuecaXuU7e+hOwyqf24Wxhh7Vxgt7Hnw9288Tg==", - "dev": true, - "optional": true + "dev": true }, "node_modules/picocolors": { "version": "1.0.0", @@ -14688,8 +14867,7 @@ "version": "1.4.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", "integrity": "sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ==", - "dev": true, - "optional": true + "dev": true }, "node_modules/qs": { "version": "6.11.0", @@ -15304,7 +15482,6 @@ "integrity": "sha512-IZnsR7voF0miGSu29EXPRgPTuEsI/+aibNSBbN1pplrfartF5wDYGADz3iD9vmBVf2r00rckWZf8BtS5kk7Niw==", "deprecated": "request has been deprecated, see https://github.com/request/request/issues/3142", "dev": true, - "optional": true, "dependencies": { "aws-sign2": "~0.6.0", "aws4": "^1.2.1", @@ -15338,7 +15515,6 @@ "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.1.4.tgz", "integrity": "sha512-8HWGSLAPr+AG0hBpsqi5Ob8HrLStN/LWeqhpFl14d7FJgHK48TmgLoALPz69XSUR65YJzDfLUX/BM8+MLJLghQ==", "dev": true, - "optional": true, "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.5", @@ -15353,7 +15529,6 @@ "resolved": "https://registry.npmjs.org/qs/-/qs-6.4.1.tgz", "integrity": "sha512-LQy1Q1fcva/UsnP/6Iaa4lVeM49WiOitu2T4hZCyA/elLKu37L99qcBJk4VCCk+rdLvnMzfKyiN3SZTqdAZGSQ==", "dev": true, - "optional": true, "engines": { "node": ">=0.6" } @@ -15423,6 +15598,15 @@ "node": ">=4" } }, + "node_modules/resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true, + "funding": { + "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" + } + }, "node_modules/resolve-url": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", @@ -15489,16 +15673,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/rimraf/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, "node_modules/rimraf/node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -15519,18 +15693,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/rimraf/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/run-async": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/run-async/-/run-async-0.1.0.tgz", @@ -16050,7 +16212,6 @@ "integrity": "sha512-7bgVOAnPj3XjrKY577S+puCKGCRlUrcrEdsMeRXlg9Ghf5df/xNi6sONUa43WrHUd3TjJBF7O04jYoiY0FVa0A==", "deprecated": "This module moved to @hapi/sntp. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues.", "dev": true, - "optional": true, "dependencies": { "hoek": "2.x.x" }, @@ -16151,7 +16312,6 @@ "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.18.0.tgz", "integrity": "sha512-2p2KJZTSqQ/I3+HX42EpYOa2l3f8Erv8MWKsy2I9uf4wA7yFIkXRffYdsx86y6z4vHtV8u7g+pPlr8/4ouAxsQ==", "dev": true, - "optional": true, "dependencies": { "asn1": "~0.2.3", "assert-plus": "^1.0.0", @@ -16177,7 +16337,6 @@ "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", "integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==", "dev": true, - "optional": true, "engines": { "node": ">=0.8" } @@ -16362,8 +16521,7 @@ "version": "0.0.6", "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.6.tgz", "integrity": "sha512-87GEBAkegbBcweToUrdzf3eLhWNg06FJTebl4BVJz/JgWy8CvEr9dRtX5qWphiynMSQlxxi+QqN0z5T32SLlhA==", - "dev": true, - "optional": true + "dev": true }, "node_modules/strip-ansi": { "version": "6.0.1", @@ -16663,7 +16821,6 @@ "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.4.tgz", "integrity": "sha512-TZ6TTfI5NtZnuyy/Kecv+CnoROnyXn2DN97LontgQpCwsX2XyLYCC0ENhYkehSOwAp8rTQKc/NUIF7BkQ5rKLA==", "dev": true, - "optional": true, "dependencies": { "punycode": "^1.4.1" }, @@ -16787,7 +16944,6 @@ "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", "dev": true, - "optional": true, "dependencies": { "safe-buffer": "^5.0.1" }, @@ -16799,8 +16955,7 @@ "version": "0.14.5", "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", "integrity": "sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==", - "dev": true, - "optional": true + "dev": true }, "node_modules/type-check": { "version": "0.4.0", @@ -16925,6 +17080,31 @@ "node": ">=14.17" } }, + "node_modules/typescript-eslint": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-7.1.1.tgz", + "integrity": "sha512-vScnjSkm0pjZqySB5o8ZbfywfGWamVOqIGtJeOnUuDDGFaGKwMqdZWVa7EYKBnLCUSuwD8MN2a2ur9OgaKu6Tg==", + "dev": true, + "dependencies": { + "@typescript-eslint/eslint-plugin": "7.1.1", + "@typescript-eslint/parser": "7.1.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.56.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, "node_modules/uglify-js": { "version": "2.8.29", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.29.tgz", @@ -17192,7 +17372,6 @@ "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", "dev": true, - "optional": true, "bin": { "uuid": "bin/uuid" } @@ -17224,7 +17403,6 @@ "engines": [ "node >=0.6.0" ], - "optional": true, "dependencies": { "assert-plus": "^1.0.0", "core-util-is": "1.0.2", @@ -17236,7 +17414,6 @@ "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", "integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==", "dev": true, - "optional": true, "engines": { "node": ">=0.8" } @@ -17245,8 +17422,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", "integrity": "sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==", - "dev": true, - "optional": true + "dev": true }, "node_modules/void-elements": { "version": "2.0.1", diff --git a/package.json b/package.json index 91bb25e..7510385 100644 --- a/package.json +++ b/package.json @@ -51,6 +51,8 @@ "@babel/plugin-transform-object-assign": "^7.23.3", "@babel/preset-env": "^7.24.0", "@babel/preset-typescript": "^7.23.3", + "@eslint/eslintrc": "^3.0.2", + "@eslint/js": "^8.57.0", "@types/bluebird": "^3.5.42", "@types/node": "^20.11.24", "@types/node-fetch": "^2.6.11", @@ -64,13 +66,18 @@ "eslint": "^8.57.0", "eslint-config-airbnb-typescript": "^18.0.0", "eslint-config-prettier": "^9.1.0", + "eslint-import-resolver-typescript": "^3.6.1", "eslint-plugin-import": "^2.29.1", + "eslint-plugin-n": "^16.6.2", "eslint-plugin-prettier": "^5.1.3", "esm": "^3.2.25", "fork-ts-checker-webpack-plugin": "^9.0.2", + "globals": "^14.0.0", + "jsonc-eslint-parser": "^2.4.0", "npm-run-all": "^4.1.5", "prettier": "^3.2.5", "typescript": "^5.3.3", + "typescript-eslint": "^7.1.1", "webpack": "^5.90.3", "webpack-cli": "^5.1.4", "webpack-shebang-plugin": "^1.1.8" @@ -79,7 +86,7 @@ "bluebird": "^3.7.2", "core-js": "^3.36.0", "dompurify": "^2.2.8", - "node-fetch": "^2.6.1 <2.6.8", + "node-fetch": "=2.6.7", "progress-stream": "^2.0.0", "regenerator-runtime": "^0.13.7", "stream.pipeline-shim": "^1.1.0", diff --git a/services/adapter.ts b/services/adapter.ts index 5ce7687..0f1774e 100644 --- a/services/adapter.ts +++ b/services/adapter.ts @@ -8,7 +8,7 @@ import * as Bluebird from 'bluebird'; // String.normalize is very large polyfill not included by default in core-js // and most likely we're not gonna need it -if (!String.prototype.normalize) { +if (typeof String.prototype.normalize !== 'function') { // eslint-disable-next-line no-extend-native String.prototype.normalize = function normalize() { return String(this); @@ -16,13 +16,13 @@ if (!String.prototype.normalize) { } // Monkey-patch fetch Promise with Bluebird's. -// @ts-ignore +// @ts-expect-error fetch.Promise = Bluebird.Promise; // Sadly these need to be manually typed according to // https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node // since types infered from Bluebird.Promise.promisify are wrong. -// @ts-ignore +// @ts-expect-error export const asyncPipeline: ( ...args: ReadonlyArray ) => Promise = Bluebird.Promise.promisify(pipeline); @@ -38,5 +38,8 @@ export const asyncWriteFile: (path: string, contents: string, options?: fs.Write fs.writeFile, ); export const asyncChmod: (path: string, mode: fs.Mode) => Promise = Bluebird.Promise.promisify(fs.chmod); -export const asyncExists: (path: string) => Promise = (path) => new Promise((resolve) => fs.exists(path, resolve)); +export const asyncExists: (path: string) => Promise = (path) => + new Promise((resolve) => { + fs.exists(path, resolve); + }); export const asyncMkdir: (path: string, mode?: fs.Mode) => Promise = Bluebird.Promise.promisify(fs.mkdir); diff --git a/services/buffer-shim.js b/services/buffer-shim.js index 1c3dae4..c7d72ac 100644 --- a/services/buffer-shim.js +++ b/services/buffer-shim.js @@ -1,5 +1,5 @@ /* eslint-disable no-buffer-constructor */ -const { SlowBuffer } = require('buffer'); +import { SlowBuffer } from 'buffer'; function newBuffer(data, encoding, len) { return new Buffer(data, encoding, len); diff --git a/services/protocol.ts b/services/protocol.ts index 9fee60a..a8015db 100644 --- a/services/protocol.ts +++ b/services/protocol.ts @@ -7,7 +7,7 @@ interface ErrorResponse { errorText: string; } -export function makeSuccess(payload: Record): Response { +export function makeSuccess(payload?: Record): Response { return { returnValue: true, ...payload }; } diff --git a/services/service.ts b/services/service.ts index ce19562..ee471f1 100644 --- a/services/service.ts +++ b/services/service.ts @@ -6,7 +6,7 @@ import { createHash } from 'crypto'; import path from 'path'; import child_process from 'child_process'; -// @ts-ignore +// @ts-expect-error import { Promise } from 'bluebird'; // eslint-disable-line @typescript-eslint/no-redeclare import progress from 'progress-stream'; import Service, { Message } from 'webos-service'; @@ -68,7 +68,7 @@ const runningAsRoot: boolean = (() => { return process.getuid() === 0; })(); -function assertNodeError(error: Error | unknown): asserts error is NodeJS.ErrnoException { +function assertNodeError(error: unknown): asserts error is NodeJS.ErrnoException { if (!(error instanceof Error)) { throw error; } @@ -101,7 +101,7 @@ function createToast(message: string, service: Service, extras: Record { try { return (await asyncStat(targetPath)).isFile(); - } catch (err: unknown) { + } catch { return false; } } @@ -126,7 +126,13 @@ async function hashFile(filePath: string, algorithm: string): Promise { const hash = createHash(algorithm, { encoding: 'hex' }); await asyncPipeline(download, hash); hash.end(); - return hash.read(); + const ret: unknown = hash.read(); + + if (typeof ret !== 'string') { + throw new Error('reading result of hash failed'); + } + + return ret; } /** @@ -203,6 +209,10 @@ async function packageInfo(filePath: string): Promise> { return resp; } +function isRecord(obj: unknown): obj is Record { + return typeof obj === 'object' && !Array.isArray(obj); +} + /** * Performs appInstallService/dev/install request. */ @@ -213,29 +223,39 @@ async function installPackage(filePath: string, service: Service): Promise { + + req.on('response', (res: Message): void => { console.info('appInstallService response:', res.payload); - if (res.payload.returnValue === false) { - reject(new Error(`${res.payload.errorCode}: ${res.payload.errorText}`)); + if (res.payload['returnValue'] === false) { + reject(new Error(`${res.payload['errorCode']}: ${res.payload['errorText']}`)); req.cancel(); return; } - if (res.payload.details && res.payload.details.errorCode !== undefined) { - reject(new Error(`${res.payload.details.errorCode}: ${res.payload.details.reason}`)); + if (isRecord(res.payload['details']) && res.payload['details']['errorCode'] !== undefined) { + reject(new Error(`${res.payload['details']['errorCode']}: ${res.payload['details']['reason']}`)); req.cancel(); return; } - if (res.payload.statusValue === 30) { - resolve(res.payload.details.packageId); + if (res.payload['statusValue'] === 30) { + const details: unknown = res.payload['details']; + if (!isRecord(details)) { + reject(new Error('"details" in response is not an object')); + } else if (typeof details['packageId'] !== 'string') { + reject(new Error('"details.payloadId" in response is not a string')); + } else { + resolve(details['packageId']); + } req.cancel(); } }); - req.on('cancel', (msg) => { - if (msg.payload && msg.payload.errorText) { - reject(new Error(msg.payload.errorText)); + + req.on('cancel', (msg: Message): void => { + if (isRecord(msg.payload) && 'errorText' in msg.payload) { + const errorText: unknown = msg.payload['errorText']; + reject(new Error(typeof errorText === 'string' ? errorText : 'errorText is not a string')); } else { reject(new Error('cancelled')); } @@ -250,36 +270,44 @@ async function removePackage(packageId: string, service: Service): Promise subscribe: true, }); - req.on('response', (res) => { + req.on('response', (res: Message) => { console.info('appInstallService remove response:', res); - if (res.payload.returnValue === false) { - reject(new Error(`${res.payload.errorCode}: ${res.payload.errorText}`)); + if (res.payload['returnValue'] === false) { + reject(new Error(`${res.payload['errorCode']}: ${res.payload['errorText']}`)); req.cancel(); return; } - if (res.payload.details && res.payload.details.errorCode !== undefined) { - reject(new Error(`${res.payload.details.errorCode}: ${res.payload.details.reason}`)); + if (isRecord(res.payload['details']) && res.payload['details']['errorCode'] !== undefined) { + reject(new Error(`${res.payload['details']['errorCode']}: ${res.payload['details']['reason']}`)); req.cancel(); return; } - if (res.payload.statusValue === 25 && res.payload.details.reason !== undefined) { - reject(new Error(res.payload.details.reason)); + if (res.payload['statusValue'] === 25) { + const details: unknown = res.payload['details']; + if (!isRecord(details)) { + reject(new Error('"details" in response is not an object')); + } else if (typeof details['reason'] !== 'string') { + reject(new Error('"details.reason" in response is not a string')); + } else { + reject(new Error(details['reason'])); + } req.cancel(); return; } - if (res.payload.statusValue === 31) { + if (res.payload['statusValue'] === 31) { resolve(); req.cancel(); } }); - req.on('cancel', (msg) => { - if (msg.payload && msg.payload.errorText) { - reject(new Error(msg.payload.errorText)); + req.on('cancel', (msg: Message) => { + if (isRecord(msg.payload) && 'errorText' in msg.payload) { + const errorText: unknown = msg.payload['errorText']; + reject(new Error(typeof errorText === 'string' ? errorText : 'errorText is not a string')); } else { reject(new Error('cancelled')); } @@ -324,23 +352,45 @@ async function registerActivity(service: Service): Promise { replace: true, }; - return new Promise((resolve) => service.activityManager.create(spec, () => resolve())); + return new Promise((resolve) => { + service.activityManager.create(spec, () => { + resolve(); + }); + }); +} + +function simpleTryRespond(runner: (message: Message) => Promise) { + return (message: Message): void => { + runner(message) + .then((): void => { + message.respond(makeSuccess()); + }) + .catch((err: unknown): void => { + assertNodeError(err); + message.respond(makeError(err.message)); + }) + .finally(() => { + message.cancel({}); + }); + }; } /** * Thin wrapper that responds with a successful message or an error in case of a JS exception. */ -function tryRespond>(runner: (message: Message) => T) { - return async (message: Message): Promise => { - try { - const reply: T = await runner(message); - message.respond(makeSuccess(reply)); - } catch (err: unknown) { - assertNodeError(err); - message.respond(makeError(err.message)); - } finally { - message.cancel({}); - } +function tryRespond>(runner: (message: Message) => Promise) { + return (message: Message): void => { + runner(message) + .then((reply?: T): void => { + message.respond(makeSuccess(reply)); + }) + .catch((err: unknown): void => { + assertNodeError(err); + message.respond(makeError(err.message)); + }) + .finally(() => { + message.cancel({}); + }); }; } @@ -369,7 +419,11 @@ function runService(): void { /** * Installs the requested ipk from a URL. */ - type InstallPayload = { ipkUrl: string; ipkHash: string; id?: string }; + interface InstallPayload { + ipkUrl: string; + ipkHash: string; + id?: string; + } service.register( 'install', tryRespond(async (message: Message) => { @@ -421,7 +475,7 @@ function runService(): void { // If reelevation fails for some reason the service should still be // reelevated on reboot on devices with persistent autostart hooks (since // we launch elevate-service in startup.sh script) - if (runningAsRoot && pkginfo && pkginfo['Package'] === kHomebrewChannelPackageId) { + if (runningAsRoot && isRecord(pkginfo) && pkginfo['Package'] === kHomebrewChannelPackageId) { message.respond({ statusText: 'Self-update…' }); await createToast('Performing self-update...', service); @@ -452,10 +506,18 @@ function runService(): void { /** * Removes existing package. */ - type UninstallPayload = { id: string }; + interface UninstallPayload { + id: string; + } service.register( 'uninstall', tryRespond(async (message: Message) => { + if (!('id' in message.payload)) { + throw new Error('missing "id"'); + } else if (typeof message.payload['id'] !== 'string') { + throw new Error('"id" is not a string'); + } + const payload = message.payload as UninstallPayload; await removePackage(payload.id, getInstallerService()); return { statusText: 'Finished.' }; @@ -492,7 +554,7 @@ function runService(): void { // See https://github.com/microsoft/TypeScript/issues/41173 const futureFlagSets = Object.entries(payload) .filter((pair: [string, boolean]): pair is [FlagName, boolean] => pair[0] in availableFlags) - .map(async ([flagName, value]) => [flagName, await flagFileSet(availableFlags[flagName], value)]); + .map(async ([flagName, value]): Promise<[FlagName, boolean]> => [flagName, await flagFileSet(availableFlags[flagName], value)]); return Object.fromEntries(await Promise.all(futureFlagSets)); }), ); @@ -502,7 +564,7 @@ function runService(): void { */ service.register( 'reboot', - tryRespond(async () => { + simpleTryRespond(async (_message: Message) => { await asyncExecFile('reboot'); }), ); @@ -510,10 +572,7 @@ function runService(): void { /** * Returns whether the service is running as root. */ - service.register( - 'checkRoot', - tryRespond(async () => ({ returnValue: runningAsRoot })), - ); + service.register('checkRoot', (message: Message) => message.respond({ returnValue: runningAsRoot })); /** * Check for startup script updates @@ -551,7 +610,7 @@ function runService(): void { if (await isFile(webosbrewStartup)) { const localChecksum = await hashFile(webosbrewStartup, 'sha256'); if (localChecksum !== bundledStartupChecksum) { - if (updatableChecksums.indexOf(localChecksum) !== -1) { + if (updatableChecksums.includes(localChecksum)) { await copyScript(bundledStartup, webosbrewStartup); messages.push(`${webosbrewStartup} updated!`); } else { @@ -575,17 +634,17 @@ function runService(): void { // RootMyTV v1 if (await isFile(startDevmode)) { // Warn and return empty string on read error - const startDevmodeContents = (await asyncReadFile(startDevmode, { encoding: 'utf-8' }).catch((err) => { + const startDevmodeContents = (await asyncReadFile(startDevmode, { encoding: 'utf-8' }).catch((err: NodeJS.ErrnoException) => { console.warn(`reading ${startDevmode} failed: ${err.toString()}`); return ''; })) as string; const localChecksum = hashString(startDevmodeContents, 'sha256'); - if (localChecksum !== bundledStartupChecksum && updatableChecksums.indexOf(localChecksum) !== -1) { + if (localChecksum !== bundledStartupChecksum && updatableChecksums.includes(localChecksum)) { await copyScript(bundledStartup, startDevmode); messages.push(`${startDevmode} updated!`); - } else if (localChecksum !== bundledJumpstartChecksum && startDevmodeContents.indexOf('org.webosbrew') !== -1) { + } else if (localChecksum !== bundledJumpstartChecksum && startDevmodeContents.includes('org.webosbrew')) { // Show notification about mismatched startup script if contains // org.webosbrew string (which is not used on jumpstart.sh nor // official start-devmode.sh) @@ -613,7 +672,9 @@ function runService(): void { * Roughly replicates com.webos.applicationManager/getAppInfo request in an * environment-independent way (non-root vs root). */ - type GetAppInfoPayload = { id: string }; + interface GetAppInfoPayload { + id: string; + } service.register( 'getAppInfo', tryRespond(async (message: Message) => { @@ -628,7 +689,9 @@ function runService(): void { /** * Executes a shell command and responds with exit code, stdout and stderr. */ - type ExecPayload = { command: string }; + interface ExecPayload { + command: string; + } service.register('exec', (message: Message) => { if (!('command' in message.payload)) { message.respond(makeError('missing "command"')); @@ -662,23 +725,35 @@ function runService(): void { * Spawns a shell command and streams stdout & stderr bytes. */ service.register('spawn', (message) => { + if (!('command' in message.payload)) { + message.respond(makeError('missing "command"')); + return; + } else if (typeof message.payload['command'] !== 'string') { + message.respond(makeError('"command" is not a string')); + return; + } + const payload = message.payload as ExecPayload; const respond = (event: string, args: Record) => message.respond({ event, ...args }); const proc = child_process.spawn('/bin/sh', ['-c', '--', payload.command]); - proc.stdout.on('data', (data) => - respond('stdoutData', { - stdoutString: data.toString(), - stdoutBytes: data.toString('base64'), - }), + proc.stdout.on( + 'data', + (data: Buffer): void => + void respond('stdoutData', { + stdoutString: data.toString(), + stdoutBytes: data.toString('base64'), + }), ); - proc.stderr.on('data', (data) => - respond('stderrData', { - stderrString: data.toString(), - stderrBytes: data.toString('base64'), - }), + proc.stderr.on( + 'data', + (data: Buffer): void => + void respond('stderrData', { + stderrString: data.toString(), + stderrBytes: data.toString('base64'), + }), ); - proc.on('close', (closeCode) => respond('close', { closeCode })); - proc.on('exit', (exitCode) => respond('exit', { exitCode })); + proc.on('close', (closeCode): void => void respond('close', { closeCode })); + proc.on('exit', (exitCode): void => void respond('exit', { exitCode })); }); /** @@ -686,21 +761,22 @@ function runService(): void { * * This is intended to work with sampatcher.py, but it is not currently used. */ - type GetDrmStatusPayload = { appId: string }; - service.register( - 'getDrmStatus', - tryRespond(async (message: Message) => ({ + interface GetDrmStatusPayload { + appId: string; + } + service.register('getDrmStatus', (message: Message) => + message.respond({ appId: (message.payload as GetDrmStatusPayload).appId, drmType: 'NCG DRM', installBasePath: '/media/cryptofs', returnValue: true, isTimeLimited: false, - })), + }), ); service.register( 'registerActivity', - tryRespond(() => registerActivity(service)), + simpleTryRespond((_message: Message) => registerActivity(service)), ); service.register( @@ -716,7 +792,7 @@ function runService(): void { if (!(await asyncExists('/var/lib/webosbrew/startup.sh'))) { try { await asyncMkdir('/var/lib/webosbrew/', 0o755); - } catch (e) { + } catch { // Ignore } await copyScript(path.join(__dirname, 'startup.sh'), '/var/lib/webosbrew/startup.sh'); @@ -747,10 +823,12 @@ function runService(): void { /** * Elevates the service specified by "id". */ - type ElevateServicePayload = { id: string }; + interface ElevateServicePayload { + id: string; + } service.register( 'elevateService', - tryRespond(async (message: Message) => { + simpleTryRespond(async (message: Message) => { if (!('id' in message.payload)) { throw new Error('missing "id"'); } else if (typeof message.payload['id'] !== 'string') { @@ -779,7 +857,7 @@ if (process.argv[2] === 'self-update') { console.info('sigterm!'); }); - (async () => { + void (async (): Promise => { const service = new ServiceRemote() as Service; try { const packagePath = process.argv[3]; diff --git a/services/webos-service-remote/message.js b/services/webos-service-remote/message.js index 1d6f3e5..0b93f9e 100644 --- a/services/webos-service-remote/message.js +++ b/services/webos-service-remote/message.js @@ -14,7 +14,7 @@ export default class Message { this.token = body.token(); try { this.payload = JSON.parse(body.payload()); - } catch (e) { + } catch { console.error('Message: badly-formatted message payload'); console.trace(); this.payload = { badPayload: body.payload() }; diff --git a/services/webos-service-remote/subscription.js b/services/webos-service-remote/subscription.js index 68ae67c..2c51a87 100644 --- a/services/webos-service-remote/subscription.js +++ b/services/webos-service-remote/subscription.js @@ -9,12 +9,11 @@ export default class Subscription extends EventEmitter { this.args = args; this.handle = handle; this.request = handle.subscribe(uri, JSON.stringify(args)); - const self = this; this.request.addListener('response', (msg) => { let payload; try { payload = JSON.parse(msg.payload()); - } catch (e) { + } catch { payload = { subscribed: false, returnValue: false, @@ -24,14 +23,14 @@ export default class Subscription extends EventEmitter { } if (payload.subscribed === false) { - self.request.cancel(); - self.emit('cancel', new Message(msg, handle)); + this.request.cancel(); + this.emit('cancel', new Message(msg, handle)); } else { - self.emit('response', new Message(msg, handle)); + this.emit('response', new Message(msg, handle)); } }); this.request.addListener('cancel', (msg) => { - self.emit('cancel', new Message(msg, handle)); + this.emit('cancel', new Message(msg, handle)); }); } From b6ab18988dbd114356c5638f356819e54a546f33 Mon Sep 17 00:00:00 2001 From: throwaway96 <68320646+throwaway96@users.noreply.github.com> Date: Tue, 5 Mar 2024 07:39:42 -0500 Subject: [PATCH 2/2] package.json: update runtime packages Since I'm going to have to test everything anyway... Note that dompurify 3.0.2+ (up to current version 3.0.9) seems to break enyo pack --production. --- package-lock.json | 22 ++++++++-------------- package.json | 4 ++-- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/package-lock.json b/package-lock.json index d439b15..507d9af 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,10 +14,10 @@ "dependencies": { "bluebird": "^3.7.2", "core-js": "^3.36.0", - "dompurify": "^2.2.8", + "dompurify": "=3.0.1", "node-fetch": "=2.6.7", "progress-stream": "^2.0.0", - "regenerator-runtime": "^0.13.7", + "regenerator-runtime": "^0.14.1", "stream.pipeline-shim": "^1.1.0", "webos-service": "github:webosose/nodejs-module-webos-service#1dd2c9d6cd21eb5d84f7619432ed6d2784bb56f9" }, @@ -1776,12 +1776,6 @@ "node": ">=6.9.0" } }, - "node_modules/@babel/runtime/node_modules/regenerator-runtime": { - "version": "0.14.1", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", - "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==", - "dev": true - }, "node_modules/@babel/template": { "version": "7.24.0", "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.24.0.tgz", @@ -9746,9 +9740,9 @@ } }, "node_modules/dompurify": { - "version": "2.4.7", - "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-2.4.7.tgz", - "integrity": "sha512-kxxKlPEDa6Nc5WJi+qRgPbOAbgTpSULL+vI3NUXsZMlkJxTqYI9wg5ZTay2sFrdZRWHPWNi+EdAhcJf81WtoMQ==" + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.0.1.tgz", + "integrity": "sha512-60tsgvPKwItxZZdfLmamp0MTcecCta3avOhsLgPZ0qcWt96OasFfhkeIRbJ6br5i0fQawT1/RBGB5L58/Jpwuw==" }, "node_modules/dtrace-provider": { "version": "0.8.8", @@ -15340,9 +15334,9 @@ } }, "node_modules/regenerator-runtime": { - "version": "0.13.11", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz", - "integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==" + "version": "0.14.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", + "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==" }, "node_modules/regenerator-transform": { "version": "0.15.2", diff --git a/package.json b/package.json index 7510385..1022392 100644 --- a/package.json +++ b/package.json @@ -85,10 +85,10 @@ "dependencies": { "bluebird": "^3.7.2", "core-js": "^3.36.0", - "dompurify": "^2.2.8", + "dompurify": "=3.0.1", "node-fetch": "=2.6.7", "progress-stream": "^2.0.0", - "regenerator-runtime": "^0.13.7", + "regenerator-runtime": "^0.14.1", "stream.pipeline-shim": "^1.1.0", "webos-service": "github:webosose/nodejs-module-webos-service#1dd2c9d6cd21eb5d84f7619432ed6d2784bb56f9" },