diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index 5a19e8a..0000000 --- a/.eslintignore +++ /dev/null @@ -1,3 +0,0 @@ -node_modules -dist -coverage \ No newline at end of file diff --git a/.eslintrc b/.eslintrc deleted file mode 100644 index e00862e..0000000 --- a/.eslintrc +++ /dev/null @@ -1,62 +0,0 @@ -{ - "root": true, - "env": { - "node": true - }, - "parser": "@typescript-eslint/parser", - "plugins": ["@typescript-eslint", "unicorn", "prettier"], - "extends": [ - "eslint:recommended", - "plugin:@typescript-eslint/recommended", - "plugin:import/recommended", - "plugin:prettier/recommended" - ], - "rules": { - "quotes": ["warn", "double", "avoid-escape"], - "indent": ["warn", 2, { "SwitchCase": 1 }], - "semi": ["warn", "always"], - "@typescript-eslint/no-unused-vars": "warn", - "no-console": "off", - "camelcase": "warn", - "require-atomic-updates": "off", - "prefer-destructuring": [ - "warn", - { - "AssignmentExpression": { "object": false, "array": false }, - "VariableDeclarator": { "object": true, "array": true } - }, - { - "enforceForRenamedProperties": false - } - ], - "object-curly-spacing": ["warn", "always"], - "prefer-const": ["warn"], - "@typescript-eslint/consistent-type-imports": [ - "warn", - { "prefer": "type-imports" } - ], - "unicorn/prefer-node-protocol": "warn" - }, - "overrides": [ - { - "files": ["test/**/*.ts"], - "rules": { - "@typescript-eslint/ban-ts-comment": "off", - "@typescript-eslint/no-explicit-any": "off", - "@typescript-eslint/no-unused-vars": "off", - "@typescript-eslint/no-empty-function": "off" - } - } - ], - "settings": { - "import/parsers": { - "@typescript-eslint/parser": [".ts", ".tsx"] - }, - "import/resolver": { - "typescript": { - "alwaysTryTypes": true, // always try to resolve types under `@types` directory even it doesn't contain any source code, like `@types/unist` - "project": "./tsconfig.json" - } - } - } -} diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index a076ac2..8e451ad 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -58,7 +58,8 @@ export default defineConfig({ ], footer: { message: "Released under the MIT License.", - copyright: "Copyright © 2020-present Frederik Schmatz
This site is powered by Netlify", + copyright: + 'Copyright © 2020-present Frederik Schmatz
This site is powered by Netlify', }, algolia: { appId: "XJKV0V1N7U", diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 0000000..c5f1f39 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,43 @@ +import eslint from "@eslint/js"; +import tseslint from "typescript-eslint"; +import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended"; +import eslintPluginImportX from "eslint-plugin-import-x"; +import tsParser from "@typescript-eslint/parser"; + +export default tseslint.config( + { + ignores: [ + "**/node_modules", + "**/dist", + "**/coverage", + "docs/.vitepress/cache", + "docs/.vitepress/dist", + ], + }, + eslint.configs.recommended, + // eslint-disable-next-line import-x/no-named-as-default-member + tseslint.configs.recommended, + { + rules: { + // unset js rules + "no-unused-vars": "off", + "@typescript-eslint/no-explicit-any": "off", + }, + }, + eslintPluginImportX.flatConfigs.recommended, + eslintPluginImportX.flatConfigs.typescript, + { + files: ["**/*.{js,mjs,cjs,jsx,mjsx,ts,tsx,mtsx}"], + ignores: ["eslint.config.js"], + languageOptions: { + parser: tsParser, + ecmaVersion: "latest", + sourceType: "module", + }, + rules: { + "import-x/no-dynamic-require": "warn", + "import-x/no-nodejs-modules": "off", + }, + }, + eslintPluginPrettierRecommended, +); diff --git a/package.json b/package.json index 67065c3..40fc028 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "vitest": "vitest", "test": "vitest run", "coverage": "vitest run --coverage", - "lint": "eslint . --ext .js,.jsx,.ts,.tsx", + "lint": "eslint .", "docs": "vitepress dev docs", "docs:build": "vitepress build docs" }, @@ -64,6 +64,7 @@ }, "devDependencies": { "@casl/ability": "^6.7.2", + "@eslint/js": "^9.16.0", "@feathersjs/adapter-commons": "^5.0.31", "@feathersjs/authentication": "^5.0.31", "@feathersjs/authentication-local": "^5.0.31", @@ -77,16 +78,14 @@ "@seald-io/nedb": "^4.0.4", "@types/lodash": "^4.17.13", "@types/node": "^22.10.1", - "@typescript-eslint/eslint-plugin": "^5.60.1", - "@typescript-eslint/parser": "^5.60.1", + "@typescript-eslint/eslint-plugin": "^8.18.0", + "@typescript-eslint/parser": "^8.18.0", "@vitest/coverage-v8": "^2.1.8", "cors": "^2.8.5", - "eslint": "^8.43.0", - "eslint-config-prettier": "^8.8.0", - "eslint-import-resolver-typescript": "^3.5.5", - "eslint-plugin-import": "^2.27.5", - "eslint-plugin-prettier": "^4.2.1", - "eslint-plugin-unicorn": "^47.0.0", + "eslint": "^9.16.0", + "eslint-import-resolver-typescript": "^3.7.0", + "eslint-plugin-import-x": "^4.5.0", + "eslint-plugin-prettier": "^5.2.1", "feathers-fletching": "^2.0.3", "feathers-knex": "^8.0.1", "feathers-mongoose": "^8.5.1", @@ -107,6 +106,7 @@ "sqlite3": "^5.1.7", "type-fest": "^4.30.0", "typescript": "^5.7.2", + "typescript-eslint": "^8.18.0", "unbuild": "^2.0.0", "vite": "^6.0.3", "vitepress": "^1.5.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a0a68f8..35c3376 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -30,6 +30,9 @@ importers: '@casl/ability': specifier: ^6.7.2 version: 6.7.2 + '@eslint/js': + specifier: ^9.16.0 + version: 9.16.0 '@feathersjs/adapter-commons': specifier: ^5.0.31 version: 5.0.31 @@ -70,11 +73,11 @@ importers: specifier: ^22.10.1 version: 22.10.1 '@typescript-eslint/eslint-plugin': - specifier: ^5.60.1 - version: 5.62.0(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.7.2))(eslint@8.57.0)(typescript@5.7.2) + specifier: ^8.18.0 + version: 8.18.0(@typescript-eslint/parser@8.18.0(eslint@9.16.0(jiti@1.21.0))(typescript@5.7.2))(eslint@9.16.0(jiti@1.21.0))(typescript@5.7.2) '@typescript-eslint/parser': - specifier: ^5.60.1 - version: 5.62.0(eslint@8.57.0)(typescript@5.7.2) + specifier: ^8.18.0 + version: 8.18.0(eslint@9.16.0(jiti@1.21.0))(typescript@5.7.2) '@vitest/coverage-v8': specifier: ^2.1.8 version: 2.1.8(vitest@2.1.8(@types/node@22.10.1)) @@ -82,23 +85,17 @@ importers: specifier: ^2.8.5 version: 2.8.5 eslint: - specifier: ^8.43.0 - version: 8.57.0 - eslint-config-prettier: - specifier: ^8.8.0 - version: 8.10.0(eslint@8.57.0) + specifier: ^9.16.0 + version: 9.16.0(jiti@1.21.0) eslint-import-resolver-typescript: - specifier: ^3.5.5 - version: 3.6.1(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.7.2))(eslint-plugin-import@2.29.1)(eslint@8.57.0) - eslint-plugin-import: - specifier: ^2.27.5 - version: 2.29.1(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.7.2))(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) + specifier: ^3.7.0 + version: 3.7.0(eslint-plugin-import-x@4.5.0(eslint@9.16.0(jiti@1.21.0))(typescript@5.7.2))(eslint-plugin-import@2.31.0)(eslint@9.16.0(jiti@1.21.0)) + eslint-plugin-import-x: + specifier: ^4.5.0 + version: 4.5.0(eslint@9.16.0(jiti@1.21.0))(typescript@5.7.2) eslint-plugin-prettier: - specifier: ^4.2.1 - version: 4.2.1(eslint-config-prettier@8.10.0(eslint@8.57.0))(eslint@8.57.0)(prettier@3.4.2) - eslint-plugin-unicorn: - specifier: ^47.0.0 - version: 47.0.0(eslint@8.57.0) + specifier: ^5.2.1 + version: 5.2.1(eslint-config-prettier@9.1.0(eslint@9.16.0(jiti@1.21.0)))(eslint@9.16.0(jiti@1.21.0))(prettier@3.4.2) feathers-fletching: specifier: ^2.0.3 version: 2.0.3(@feathersjs/feathers@5.0.31) @@ -159,6 +156,9 @@ importers: typescript: specifier: ^5.7.2 version: 5.7.2 + typescript-eslint: + specifier: ^8.18.0 + version: 8.18.0(eslint@9.16.0(jiti@1.21.0))(typescript@5.7.2) unbuild: specifier: ^2.0.0 version: 2.0.0(typescript@5.7.2) @@ -963,13 +963,33 @@ packages: resolution: {integrity: sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==} engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} - '@eslint/eslintrc@2.1.4': - resolution: {integrity: sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + '@eslint-community/regexpp@4.12.1': + resolution: {integrity: sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==} + engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} - '@eslint/js@8.57.0': - resolution: {integrity: sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + '@eslint/config-array@0.19.1': + resolution: {integrity: sha512-fo6Mtm5mWyKjA/Chy1BYTdn5mGJoDNjC7C64ug20ADsRDGrA85bN3uK3MaKbeRkRuuIEAR5N33Jr1pbm411/PA==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + '@eslint/core@0.9.1': + resolution: {integrity: sha512-GuUdqkyyzQI5RMIWkHhvTWLCyLo1jNK3vzkSyaExH5kHPDHcuL2VOpHjmMY+y3+NC69qAKToBqldTBgYeLSr9Q==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + '@eslint/eslintrc@3.2.0': + resolution: {integrity: sha512-grOjVNN8P3hjJn/eIETF1wwd12DdnwFDoyceUJLYYdkpbwq3nLi+4fqrTAONx7XDALqlL220wC/RHSC/QTI/0w==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + '@eslint/js@9.16.0': + resolution: {integrity: sha512-tw2HxzQkrbeuvyj1tG2Yqq+0H9wGoI2IMk4EOsQeX+vmd75FtJAzf+gTA69WF+baUKRYQ3x2kbLE08js5OsTVg==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + '@eslint/object-schema@2.1.5': + resolution: {integrity: sha512-o0bhxnL89h5Bae5T318nFoFzGy+YE5i/gGkoPAgkmTVdRKTiv3p8JHevPiPaMwoloKfEiiaHlawCqaZMqRm+XQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + '@eslint/plugin-kit@0.2.4': + resolution: {integrity: sha512-zSkKow6H5Kdm0ZUQUB2kV5JIXqoG0+uH5YADhaEHswm664N9Db8dXSi0nMJpacpMf+MyyglF1vnZohpEg5yUtg==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@feathersjs/adapter-commons@4.5.17': resolution: {integrity: sha512-Tq39nQApJCq4/q9DMaO+qKqyCNDZ4q2Dde3e3PPzDvpTJgnQLyVgc4lUCNnLGejYZHT34rpCka9/AXxkEfJrQQ==} @@ -1064,16 +1084,25 @@ packages: '@gar/promisify@1.1.3': resolution: {integrity: sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw==} - '@humanwhocodes/config-array@0.11.14': - resolution: {integrity: sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==} - engines: {node: '>=10.10.0'} + '@humanfs/core@0.19.1': + resolution: {integrity: sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==} + engines: {node: '>=18.18.0'} + + '@humanfs/node@0.16.6': + resolution: {integrity: sha512-YuI2ZHQL78Q5HbhDiBA1X4LmYdXCKCMQIfw0pw7piHJwyREFebJUvrQN4cMssyES6x+vfUbx1CIpaQUKYdQZOw==} + engines: {node: '>=18.18.0'} '@humanwhocodes/module-importer@1.0.1': resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} engines: {node: '>=12.22'} - '@humanwhocodes/object-schema@2.0.3': - resolution: {integrity: sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==} + '@humanwhocodes/retry@0.3.1': + resolution: {integrity: sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==} + engines: {node: '>=18.18'} + + '@humanwhocodes/retry@0.4.1': + resolution: {integrity: sha512-c7hNEllBlenFTHBky65mhq8WD2kbN9Q6gk0bTk8lSBvc554jpXSkST1iePudpt7+A/AQvuHs9EMqjHDXMY1lrA==} + engines: {node: '>=18.18'} '@iconify-json/simple-icons@1.2.15': resolution: {integrity: sha512-4vxMQwkjsbjVIVGsPjKBnLMqAXu4wSlHmeN35KaJLK0UJNUj/ef6ES5c4bT/U4bSZjD2oZqOjOWTPD+HCrSUkg==} @@ -1136,6 +1165,10 @@ packages: resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} engines: {node: '>= 8'} + '@nolyfill/is-core-module@1.0.39': + resolution: {integrity: sha512-nn5ozdjYQpUCZlWGuxcJY/KpxkWQs4DcbMCmKojjyrYDEAGy4Ce19NN4v5MduafTwJlbKc99UA8YhSVqq9yPZA==} + engines: {node: '>=12.4.0'} + '@npmcli/fs@1.1.1': resolution: {integrity: sha512-8KG5RD0GVP4ydEzRn/I4BNDuxDtqVbOdm8675T49OIG/NGhaK0pjPX7ZcDlvKYbA+ulvVK3ztfcF4uBdOxuJbQ==} @@ -1148,6 +1181,10 @@ packages: resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} engines: {node: '>=14'} + '@pkgr/core@0.1.1': + resolution: {integrity: sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA==} + engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0} + '@pnpm/config.env-replace@1.1.0': resolution: {integrity: sha512-htyl8TWnKL7K/ESFa1oW2UB5lVDxuF5DpM7tBi6Hu2LNL3mWkIzNLG6N4zoCUP1lCKNxWy/3iu8mS8MvToGd6w==} engines: {node: '>=12.22.0'} @@ -1384,6 +1421,9 @@ packages: cpu: [x64] os: [win32] + '@rtsao/scc@1.1.0': + resolution: {integrity: sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g==} + '@samverschueren/stream-to-observable@0.3.1': resolution: {integrity: sha512-c/qwwcHyafOQuVQJj0IlBjf5yYgBI7YPJ77k4fOJYesb41jio65eaJODRUmfYKhTOFBrIZ66kgvGPlNbjuoRdQ==} engines: {node: '>=6'} @@ -1519,9 +1559,6 @@ packages: '@types/resolve@1.20.2': resolution: {integrity: sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==} - '@types/semver@7.5.8': - resolution: {integrity: sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==} - '@types/send@0.17.4': resolution: {integrity: sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==} @@ -1543,63 +1580,52 @@ packages: '@types/whatwg-url@11.0.4': resolution: {integrity: sha512-lXCmTWSHJvf0TRSO58nm978b8HJ/EdsSsEKLd3ODHFjo+3VGAyyTp4v50nWvwtzBxSMQrVOK7tcuN0zGPLICMw==} - '@typescript-eslint/eslint-plugin@5.62.0': - resolution: {integrity: sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + '@typescript-eslint/eslint-plugin@8.18.0': + resolution: {integrity: sha512-NR2yS7qUqCL7AIxdJUQf2MKKNDVNaig/dEB0GBLU7D+ZdHgK1NoH/3wsgO3OnPVipn51tG3MAwaODEGil70WEw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - '@typescript-eslint/parser': ^5.0.0 - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true + '@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' - '@typescript-eslint/parser@5.62.0': - resolution: {integrity: sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + '@typescript-eslint/parser@8.18.0': + resolution: {integrity: sha512-hgUZ3kTEpVzKaK3uNibExUYm6SKKOmTU2BOxBSvOYwtJEPdVQ70kZJpPjstlnhCHcuc2WGfSbpKlb/69ttyN5Q==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true + eslint: ^8.57.0 || ^9.0.0 + typescript: '>=4.8.4 <5.8.0' - '@typescript-eslint/scope-manager@5.62.0': - resolution: {integrity: sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + '@typescript-eslint/scope-manager@8.18.0': + resolution: {integrity: sha512-PNGcHop0jkK2WVYGotk/hxj+UFLhXtGPiGtiaWgVBVP1jhMoMCHlTyJA+hEj4rszoSdLTK3fN4oOatrL0Cp+Xw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript-eslint/type-utils@5.62.0': - resolution: {integrity: sha512-xsSQreu+VnfbqQpW5vnCJdq1Z3Q0U31qiWmRhr98ONQmcp/yhiPJFPq8MXiJVLiksmOKSjIldZzkebzHuCGzew==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + '@typescript-eslint/type-utils@8.18.0': + resolution: {integrity: sha512-er224jRepVAVLnMF2Q7MZJCq5CsdH2oqjP4dT7K6ij09Kyd+R21r7UVJrF0buMVdZS5QRhDzpvzAxHxabQadow==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - eslint: '*' - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true + eslint: ^8.57.0 || ^9.0.0 + typescript: '>=4.8.4 <5.8.0' - '@typescript-eslint/types@5.62.0': - resolution: {integrity: sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + '@typescript-eslint/types@8.18.0': + resolution: {integrity: sha512-FNYxgyTCAnFwTrzpBGq+zrnoTO4x0c1CKYY5MuUTzpScqmY5fmsh2o3+57lqdI3NZucBDCzDgdEbIaNfAjAHQA==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript-eslint/typescript-estree@5.62.0': - resolution: {integrity: sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + '@typescript-eslint/typescript-estree@8.18.0': + resolution: {integrity: sha512-rqQgFRu6yPkauz+ms3nQpohwejS8bvgbPyIDq13cgEDbkXt4LH4OkDMT0/fN1RUtzG8e8AKJyDBoocuQh8qNeg==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true + typescript: '>=4.8.4 <5.8.0' - '@typescript-eslint/utils@5.62.0': - resolution: {integrity: sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + '@typescript-eslint/utils@8.18.0': + resolution: {integrity: sha512-p6GLdY383i7h5b0Qrfbix3Vc3+J2k6QWw6UMUeY5JGfm3C5LbZ4QIZzJNoNOfgyRe0uuYKjvVOsO/jD4SJO+xg==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 + eslint: ^8.57.0 || ^9.0.0 + typescript: '>=4.8.4 <5.8.0' - '@typescript-eslint/visitor-keys@5.62.0': - resolution: {integrity: sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + '@typescript-eslint/visitor-keys@8.18.0': + resolution: {integrity: sha512-pCh/qEA8Lb1wVIqNvBke8UaRjJ6wrAWkJO5yyIbs8Yx6TNGYyfNjOo61tLv+WwLvoLPp4BQ8B7AHKijl8NGUfw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@ucast/core@1.10.2': resolution: {integrity: sha512-ons5CwXZ/51wrUPfoduC+cO7AS1/wRb0ybpQJ9RrssossDxVy4t49QxWoWgfBDvVKsz9VXzBk9z0wqTdZ+Cq8g==} @@ -1766,6 +1792,11 @@ packages: engines: {node: '>=0.4.0'} hasBin: true + acorn@8.14.0: + resolution: {integrity: sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==} + engines: {node: '>=0.4.0'} + hasBin: true + agent-base@6.0.2: resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} engines: {node: '>= 6.0.0'} @@ -1892,10 +1923,6 @@ packages: resolution: {integrity: sha512-itaWrbYbqpGXkGhZPGUulwnhVf5Hpy1xiCFsGqyIGglbBxmG5vSjxQen3/WGOjPpNEv1RtBLKxbmVXm8HpJStQ==} engines: {node: '>= 0.4'} - array-union@2.1.0: - resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==} - engines: {node: '>=8'} - array.prototype.findlastindex@1.2.5: resolution: {integrity: sha512-zfETvRFA8o7EiNn++N5f/kaCw221hrpGsDmcpndVupkPzEc1Wuf3VgC0qby1BbHs7f5DVYjgtEU2LLh5bqeGfQ==} engines: {node: '>= 0.4'} @@ -2096,17 +2123,9 @@ packages: resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==} engines: {node: '>=10'} - ci-info@3.9.0: - resolution: {integrity: sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==} - engines: {node: '>=8'} - citty@0.1.6: resolution: {integrity: sha512-tskPPKEs8D2KPafUypv2gxwJP8h/OaJmC82QQGGDQcHvXX43xF2VDACcJVmZ0EuSxkpO9Kc4MlrA3q0+FG58AQ==} - clean-regexp@1.0.0: - resolution: {integrity: sha512-GfisEZEJvzKrmGWkvfhgzcz/BllN1USeqD2V6tg14OAOgaCD2Z/PUEuxnAZ/nPvmaHRG7a8y77p1T/IRQ4D1Hw==} - engines: {node: '>=4'} - clean-stack@2.2.0: resolution: {integrity: sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==} engines: {node: '>=6'} @@ -2259,6 +2278,10 @@ packages: resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} engines: {node: '>= 8'} + cross-spawn@7.0.6: + resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==} + engines: {node: '>= 8'} + css-declaration-sorter@7.2.0: resolution: {integrity: sha512-h70rUM+3PNFuaBDTLe8wF/cdWu+dOZmb7pJt8Z2sedYbAcQVQV/tEchueg3GWxwqS0cxtbxmaHEdkNACqcvsow==} engines: {node: ^14 || ^16 || >=18} @@ -2609,8 +2632,8 @@ packages: resolution: {integrity: sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==} engines: {node: '>=12'} - eslint-config-prettier@8.10.0: - resolution: {integrity: sha512-SM8AMJdeQqRYT9O9zguiruQZaN7+z+E4eAP9oiLNGKMtomwaB1E9dcgUD6ZAn/eQAb52USbvezbiljfZUhbJcg==} + eslint-config-prettier@9.1.0: + resolution: {integrity: sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==} hasBin: true peerDependencies: eslint: '>=7.0.0' @@ -2618,15 +2641,21 @@ packages: eslint-import-resolver-node@0.3.9: resolution: {integrity: sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==} - eslint-import-resolver-typescript@3.6.1: - resolution: {integrity: sha512-xgdptdoi5W3niYeuQxKmzVDTATvLYqhpwmykwsh7f6HIOStGWEIL9iqZgQDF9u9OEzrRwR8no5q2VT+bjAujTg==} + eslint-import-resolver-typescript@3.7.0: + resolution: {integrity: sha512-Vrwyi8HHxY97K5ebydMtffsWAn1SCR9eol49eCd5fJS4O1WV7PaAjbcjmbfJJSMz/t4Mal212Uz/fQZrOB8mow==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: eslint: '*' eslint-plugin-import: '*' + eslint-plugin-import-x: '*' + peerDependenciesMeta: + eslint-plugin-import: + optional: true + eslint-plugin-import-x: + optional: true - eslint-module-utils@2.8.1: - resolution: {integrity: sha512-rXDXR3h7cs7dy9RNpUlQf80nX31XWJEyGq1tRMo+6GsO5VmTe4UTwtmonAD4ZkAsrfMVDA2wlGJ3790Ys+D49Q==} + eslint-module-utils@2.12.0: + resolution: {integrity: sha512-wALZ0HFoytlyh/1+4wuZ9FJCD/leWHQzzrxJ8+rebyReSLk7LApMyd3WJaLVoN+D5+WIdJyDK1c6JnE65V4Zyg==} engines: {node: '>=4'} peerDependencies: '@typescript-eslint/parser': '*' @@ -2646,57 +2675,65 @@ packages: eslint-import-resolver-webpack: optional: true - eslint-plugin-import@2.29.1: - resolution: {integrity: sha512-BbPC0cuExzhiMo4Ff1BTVwHpjjv28C5R+btTOGaCRC7UEz801up0JadwkeSk5Ued6TG34uaczuVuH6qyy5YUxw==} + eslint-plugin-import-x@4.5.0: + resolution: {integrity: sha512-l0OTfnPF8RwmSXfjT75N8d6ZYLVrVYWpaGlgvVkVqFERCI5SyBfDP7QEMr3kt0zWi2sOa9EQ47clbdFsHkF83Q==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + eslint: ^8.57.0 || ^9.0.0 + + eslint-plugin-import@2.31.0: + resolution: {integrity: sha512-ixmkI62Rbc2/w8Vfxyh1jQRTdRTF52VxwRVHl/ykPAmqG+Nb7/kNn+byLP0LxPgI7zWA16Jt82SybJInmMia3A==} engines: {node: '>=4'} peerDependencies: '@typescript-eslint/parser': '*' - eslint: ^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 + eslint: ^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 || ^9 peerDependenciesMeta: '@typescript-eslint/parser': optional: true - eslint-plugin-prettier@4.2.1: - resolution: {integrity: sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ==} - engines: {node: '>=12.0.0'} + eslint-plugin-prettier@5.2.1: + resolution: {integrity: sha512-gH3iR3g4JfF+yYPaJYkN7jEl9QbweL/YfkoRlNnuIEHEz1vHVlCmWOS+eGGiRuzHQXdJFCOTxRgvju9b8VUmrw==} + engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: - eslint: '>=7.28.0' + '@types/eslint': '>=8.0.0' + eslint: '>=8.0.0' eslint-config-prettier: '*' - prettier: '>=2.0.0' + prettier: '>=3.0.0' peerDependenciesMeta: + '@types/eslint': + optional: true eslint-config-prettier: optional: true - eslint-plugin-unicorn@47.0.0: - resolution: {integrity: sha512-ivB3bKk7fDIeWOUmmMm9o3Ax9zbMz1Bsza/R2qm46ufw4T6VBFBaJIR1uN3pCKSmSXm8/9Nri8V+iUut1NhQGA==} - engines: {node: '>=16'} - peerDependencies: - eslint: '>=8.38.0' - - eslint-scope@5.1.1: - resolution: {integrity: sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==} - engines: {node: '>=8.0.0'} - - eslint-scope@7.2.2: - resolution: {integrity: sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + eslint-scope@8.2.0: + resolution: {integrity: sha512-PHlWUfG6lvPc3yvP5A4PNyBL1W8fkDUccmI21JUu/+GKZBoH/W5u6usENXUrWFRsyoW5ACUjFGgAFQp5gUlb/A==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} eslint-visitor-keys@3.4.3: resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - eslint@8.57.0: - resolution: {integrity: sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + eslint-visitor-keys@4.2.0: + resolution: {integrity: sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + eslint@9.16.0: + resolution: {integrity: sha512-whp8mSQI4C8VXd+fLgSM0lh3UlmcFtVwUQjyKCFfsp+2ItAIYhlq/hqGahGqHE6cv9unM41VlqKk2VtKYR2TaA==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} hasBin: true + peerDependencies: + jiti: '*' + peerDependenciesMeta: + jiti: + optional: true esm@3.2.25: resolution: {integrity: sha512-U1suiZ2oDVWv4zPO56S0NcR5QriEahGtdN2OR6FiOG4WJvcjBVFB0qI4+eKoWFH483PKGuLuu6V8Z4T5g63UVA==} engines: {node: '>=6'} - espree@9.6.1: - resolution: {integrity: sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + espree@10.3.0: + resolution: {integrity: sha512-0QYC8b24HWY8zjRnDTL6RiHfDbAWn63qb4LMj1Z4b076A4une81+z03Kg7l7mn/48PUTqoLptSXez8oknU8Clg==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} esquery@1.5.0: resolution: {integrity: sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==} @@ -2706,10 +2743,6 @@ packages: resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==} engines: {node: '>=4.0'} - estraverse@4.3.0: - resolution: {integrity: sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==} - engines: {node: '>=4.0'} - estraverse@5.3.0: resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} engines: {node: '>=4.0'} @@ -2840,9 +2873,9 @@ packages: resolution: {integrity: sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==} engines: {node: '>=8'} - file-entry-cache@6.0.1: - resolution: {integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==} - engines: {node: ^10.12.0 || >=12.0.0} + file-entry-cache@8.0.0: + resolution: {integrity: sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==} + engines: {node: '>=16.0.0'} file-uri-to-path@1.0.0: resolution: {integrity: sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==} @@ -2871,9 +2904,9 @@ packages: resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==} engines: {node: '>=10'} - flat-cache@3.2.0: - resolution: {integrity: sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==} - engines: {node: ^10.12.0 || >=12.0.0} + flat-cache@4.0.1: + resolution: {integrity: sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==} + engines: {node: '>=16'} flatted@3.3.1: resolution: {integrity: sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==} @@ -2969,8 +3002,8 @@ packages: resolution: {integrity: sha512-g0QYk1dZBxGwk+Ngc+ltRH2IBp2f7zBkBMBJZCDerh6EhlhSR6+9irMCuT/09zD6qkarHUSn529sK/yL4S27mg==} engines: {node: '>= 0.4'} - get-tsconfig@4.7.3: - resolution: {integrity: sha512-ZvkrzoUA0PQZM6fy6+/Hce561s+faD1rsNwhnO5FelNjyy7EMGJ3Rz1AQ8GYDWjhRs/7dBLOEJvhK8MiEJOAFg==} + get-tsconfig@4.8.1: + resolution: {integrity: sha512-k9PN+cFBmaLWtVz29SkUoqU5O0slLuHJXt/2P+tMVFT+phsSGXGkp9t3rQIqdz0e+06EHNGs3oM6ZX1s2zHxRg==} get-value@3.0.1: resolution: {integrity: sha512-mKZj9JLQrwMBtj5wxi6MH8Z5eSKaERpAwjg43dPtlGI1ZVEgH/qC7T8/6R2OBSUA+zzHBZgICsVJaEIV2tKTDA==} @@ -3013,18 +3046,14 @@ packages: resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==} engines: {node: '>=4'} - globals@13.24.0: - resolution: {integrity: sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==} - engines: {node: '>=8'} + globals@14.0.0: + resolution: {integrity: sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==} + engines: {node: '>=18'} globalthis@1.0.3: resolution: {integrity: sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==} engines: {node: '>= 0.4'} - globby@11.1.0: - resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==} - engines: {node: '>=10'} - globby@13.2.2: resolution: {integrity: sha512-Y1zNGV+pzQdh7H39l9zgB4PJqjRNqydvdYCDG4HFXM4XuvSaQQlEc91IU1yALL8gUTDomgBAfz3XJdmUS+oo0w==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} @@ -3107,9 +3136,6 @@ packages: hookable@5.5.3: resolution: {integrity: sha512-Yc+BQe8SvoXH1643Qez1zqLRmbA5rCL+sSmk6TVos0LWVfNIB7PGncdlId77WzLGSIB5KaWgTaNTs2lNVEI6VQ==} - hosted-git-info@2.8.9: - resolution: {integrity: sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==} - hosted-git-info@7.0.1: resolution: {integrity: sha512-+K84LB1DYwMHoHSgaOY/Jfhw3ucPmSET5v98Ke/HdNSw4a0UktWzyW1mjhjpuxxTqOOsfWT/7iVshHmVZ4IpOA==} engines: {node: ^16.14.0 || >=18.0.0} @@ -3270,12 +3296,16 @@ packages: resolution: {integrity: sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A==} engines: {node: '>=6'} + is-bun-module@1.3.0: + resolution: {integrity: sha512-DgXeu5UWI0IsMQundYb5UAOzm6G2eVnarJ0byP6Tm55iZNKceD59LNPA2L4VvsScTtHcw0yEkVwSf7PC+QoLSA==} + is-callable@1.2.7: resolution: {integrity: sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==} engines: {node: '>= 0.4'} - is-core-module@2.13.1: - resolution: {integrity: sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==} + is-core-module@2.15.1: + resolution: {integrity: sha512-z0vtXSwucUJtANQWldhbtbt7BnL0vxiFjIdDLAatwhDYty2bad6s+rijD6Ri4YuYJubLzIJLUidCh09e1djEVQ==} + engines: {node: '>= 0.4'} is-data-view@1.0.1: resolution: {integrity: sha512-AHkaJrsUVW6wq6JS8y3JnM/GJF/9cf+k20+iDzlSaJrinEo5+7vRiteOSwBhHRiAyQATN1AmY4hwzxJKPmYf+w==} @@ -3366,10 +3396,6 @@ packages: resolution: {integrity: sha512-kyiNFFLU0Ampr6SDZitD/DwUo4Zs1nSdnygUBqsu3LooL00Qvb5j+UnvApUn/TTj1J3OuE6BTdQ5rudKmU2ZaA==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - is-path-inside@3.0.3: - resolution: {integrity: sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==} - engines: {node: '>=8'} - is-path-inside@4.0.0: resolution: {integrity: sha512-lJJV/5dYS+RcL8uQdBDW9c9uWFLLBNRyFhnAKXw5tVqLlKZ4RMGZKv+YQ/IA3OhD+RpbJa1LLFM1FQPGyIXvOA==} engines: {node: '>=12'} @@ -3490,20 +3516,11 @@ packages: jsbn@1.1.0: resolution: {integrity: sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==} - jsesc@0.5.0: - resolution: {integrity: sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA==} - hasBin: true - jsesc@2.5.2: resolution: {integrity: sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==} engines: {node: '>=4'} hasBin: true - jsesc@3.0.2: - resolution: {integrity: sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g==} - engines: {node: '>=6'} - hasBin: true - json-buffer@3.0.1: resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==} @@ -3822,10 +3839,6 @@ packages: resolution: {integrity: sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==} engines: {node: '>=10'} - min-indent@1.0.1: - resolution: {integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==} - engines: {node: '>=4'} - minimatch@3.1.2: resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} @@ -4019,9 +4032,6 @@ packages: napi-build-utils@1.0.2: resolution: {integrity: sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==} - natural-compare-lite@1.4.0: - resolution: {integrity: sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==} - natural-compare@1.4.0: resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} @@ -4062,9 +4072,6 @@ packages: engines: {node: '>=6'} hasBin: true - normalize-package-data@2.5.0: - resolution: {integrity: sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==} - normalize-package-data@6.0.0: resolution: {integrity: sha512-UL7ELRVxYBHBgYEtZCXjxuD5vPxnmvMGq0jp/dGPKKrN7tfsBh2IY7TlJ15WWwdjRWD3RJbnsygUurTK3xkPkg==} engines: {node: ^16.14.0 || >=18.0.0} @@ -4321,10 +4328,6 @@ packages: pkg-types@1.0.3: resolution: {integrity: sha512-nN7pYi0AQqJnoLPC9eHFQ8AcyaixBUOwvqc5TDnIKCMEE6I0y8P7OKA7fPexsXGCGxQDl/cmrLAp26LhcwxZ4A==} - pluralize@8.0.0: - resolution: {integrity: sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==} - engines: {node: '>=4'} - possible-typed-array-names@1.0.0: resolution: {integrity: sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==} engines: {node: '>= 0.4'} @@ -4603,14 +4606,6 @@ packages: resolution: {integrity: sha512-MbgfoNPANMdb4oRBNg5eqLbB2t2r+o5Ua1pNt8BqGp4I0FJZhuVSOj3PaBPni4azWuSzEdNn2evevzVmEk1ohQ==} engines: {node: '>=18'} - read-pkg-up@7.0.1: - resolution: {integrity: sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==} - engines: {node: '>=8'} - - read-pkg@5.2.0: - resolution: {integrity: sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==} - engines: {node: '>=8'} - read-pkg@9.0.1: resolution: {integrity: sha512-9viLL4/n1BJUCT1NXVTdS1jtm80yDEgR5T4yCelII49Mbj0v1rZdKqj7zCiYdbB0CuCgdrvHcNogAKTFPBocFA==} engines: {node: '>=18'} @@ -4635,10 +4630,6 @@ packages: regex@5.0.2: resolution: {integrity: sha512-/pczGbKIQgfTMRV0XjABvc5RzLqQmwqxLHdQao2RTXPk+pmTXB2P0IaUHYdYyk412YLwUIkaeMd5T+RzVgTqnQ==} - regexp-tree@0.1.27: - resolution: {integrity: sha512-iETxpjK6YoRWJG5o6hXLwvjYAoW+FEZn9os0PD/b6AP6xQwsa/Y7lCVgIixBbUPMfhu+i2LtdeAqVTgGlQarfA==} - hasBin: true - regexp.prototype.flags@1.5.2: resolution: {integrity: sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw==} engines: {node: '>= 0.4'} @@ -4651,10 +4642,6 @@ packages: resolution: {integrity: sha512-+crtS5QjFRqFCoQmvGduwYWEBng99ZvmFvF+cUJkGYF1L1BfU8C6Zp9T7f5vPAwyLkUExpvK+ANVZmGU49qi4Q==} engines: {node: '>=12'} - regjsparser@0.10.0: - resolution: {integrity: sha512-qx+xQGZVsy55CH0a1hiVwHmqjLryfh7wQyF5HO07XJ9f7dQMY/gPQHhlyDkIzJKC+x2fUCpCcUODUUUFrm7SHA==} - hasBin: true - require-from-string@2.0.2: resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==} engines: {node: '>=0.10.0'} @@ -4762,9 +4749,6 @@ packages: resolution: {integrity: sha512-CdASjNJPvRa7roO6Ra/gLYBTzYzzPyyBXxIMdGW3USQLyjWEls2RgW5UBTXaQVp+OrpeCK3bLem8smtmheoRuw==} engines: {node: '>= 0.4'} - safe-regex@2.1.1: - resolution: {integrity: sha512-rx+x8AMzKb5Q5lQ95Zoi6ZbJqwCLkqi3XuJXp5P3rT8OEc6sZCJG5AE5dU3lsgRr/F4Bs31jSlVN+j5KrsGu9A==} - safer-buffer@2.1.2: resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} @@ -4778,10 +4762,6 @@ packages: search-insights@2.13.0: resolution: {integrity: sha512-Orrsjf9trHHxFRuo9/rzm0KIWmgzE8RMlZMzuhZOJ01Rnz3D0YBAe+V6473t6/H6c7irs6Lt48brULAiRWb3Vw==} - semver@5.7.2: - resolution: {integrity: sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==} - hasBin: true - semver@6.3.1: resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} hasBin: true @@ -4889,10 +4869,6 @@ packages: simple-get@4.0.1: resolution: {integrity: sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==} - slash@3.0.0: - resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} - engines: {node: '>=8'} - slash@4.0.0: resolution: {integrity: sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==} engines: {node: '>=12'} @@ -4972,6 +4948,9 @@ packages: resolution: {integrity: sha512-97qShzy1AiyxvPNIkLWoGua7xoQzzPjQ0HAH4B0rWKo7SZ6USuPcrUiAFrws0UH8RrbWmgq3LMTObhPIHbbBeQ==} engines: {node: '>= 8'} + stable-hash@0.0.4: + resolution: {integrity: sha512-LjdcbuBeLcdETCrPn9i8AYAZ1eCtu4ECAWtP7UleOiZ9LzVxRzzUZEoZ8zB24nhkQnDWyET0I+3sWokSDS3E7g==} + stackback@0.0.2: resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==} @@ -5050,10 +5029,6 @@ packages: resolution: {integrity: sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==} engines: {node: '>=12'} - strip-indent@3.0.0: - resolution: {integrity: sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==} - engines: {node: '>=8'} - strip-json-comments@2.0.1: resolution: {integrity: sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==} engines: {node: '>=0.10.0'} @@ -5108,6 +5083,10 @@ packages: resolution: {integrity: sha512-b19dMThMV4HVFynSAM1++gBHAbk2Tc/osgLIBZMKsyqh34jb2e8Os7T6ZW/Bt3pJFdBTd2JwAnAAEQV7rSNvcQ==} engines: {node: '>=0.10'} + synckit@0.9.2: + resolution: {integrity: sha512-vrozgXDQwYO72vHjUb/HnFbQx1exDjoKzqx23aXEg2a9VIg2TSFZ8FmeZpTjUCFMYw7mpX4BE2SFu8wI7asYsw==} + engines: {node: ^14.18.0 || >=16.0.0} + tabbable@6.2.0: resolution: {integrity: sha512-Cat63mxsVJlzYvN51JmVXIgNoUokrIaT2zLclCXjRd8boZ0004U4KCs/sToJ75C6sdlByWxpYnb5Boif1VSFew==} @@ -5141,9 +5120,6 @@ packages: resolution: {integrity: sha512-pFYqmTw68LXVjeWJMST4+borgQP2AyMNbg1BpZh9LbyhUeNkeaPF9gzfPGUAnSMV3qPYdWUwDIjjCLiSDOl7vg==} engines: {node: '>=18'} - text-table@0.2.0: - resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} - through@2.3.8: resolution: {integrity: sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==} @@ -5198,24 +5174,21 @@ packages: ts-algebra@2.0.0: resolution: {integrity: sha512-FPAhNPFMrkwz76P7cdjdmiShwMynZYN6SgOujD1urY4oNm80Ou9oMdmbR45LotcKOXoy7wSmHkRFE6Mxbrhefw==} + ts-api-utils@1.4.3: + resolution: {integrity: sha512-i3eMG77UTMD0hZhgRS562pv83RC6ukSAC2GMNWc+9dieh/+jDM5u5YG+NHX6VNDRHQcHwmsTHctP9LhbC3WxVw==} + engines: {node: '>=16'} + peerDependencies: + typescript: '>=4.2.0' + tsconfig-paths@3.15.0: resolution: {integrity: sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==} tslib@1.14.1: resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} - tslib@2.6.2: - resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} - tslib@2.8.1: resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==} - tsutils@3.21.0: - resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} - engines: {node: '>= 6'} - peerDependencies: - typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta' - tunnel-agent@0.6.0: resolution: {integrity: sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==} @@ -5223,22 +5196,10 @@ packages: resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} engines: {node: '>= 0.8.0'} - type-fest@0.20.2: - resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==} - engines: {node: '>=10'} - type-fest@0.21.3: resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} engines: {node: '>=10'} - type-fest@0.6.0: - resolution: {integrity: sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==} - engines: {node: '>=8'} - - type-fest@0.8.1: - resolution: {integrity: sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==} - engines: {node: '>=8'} - type-fest@1.4.0: resolution: {integrity: sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==} engines: {node: '>=10'} @@ -5275,6 +5236,13 @@ packages: resolution: {integrity: sha512-/OxDN6OtAk5KBpGb28T+HZc2M+ADtvRxXrKKbUwtsLgdoxgX13hyy7ek6bFRl5+aBs2yZzB0c4CnQfAtVypW/g==} engines: {node: '>= 0.4'} + typescript-eslint@8.18.0: + resolution: {integrity: sha512-Xq2rRjn6tzVpAyHr3+nmSg1/9k9aIHnJ2iZeOH7cfGOWqTkXTm3kwpQglEuLGdNrYvPF+2gtAs+/KF5rjVo+WQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + eslint: ^8.57.0 || ^9.0.0 + typescript: '>=4.8.4 <5.8.0' + typescript@5.7.2: resolution: {integrity: sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg==} engines: {node: '>=14.17'} @@ -5805,7 +5773,7 @@ snapshots: '@babel/traverse': 7.24.1 '@babel/types': 7.24.0 convert-source-map: 2.0.0 - debug: 4.3.4 + debug: 4.4.0 gensync: 1.0.0-beta.2 json5: 2.2.3 semver: 6.3.1 @@ -5914,7 +5882,7 @@ snapshots: '@babel/helper-split-export-declaration': 7.22.6 '@babel/parser': 7.24.4 '@babel/types': 7.24.0 - debug: 4.3.4 + debug: 4.4.0 globals: 11.12.0 transitivePeerDependencies: - supports-color @@ -6239,19 +6207,33 @@ snapshots: '@esbuild/win32-x64@0.24.0': optional: true - '@eslint-community/eslint-utils@4.4.0(eslint@8.57.0)': + '@eslint-community/eslint-utils@4.4.0(eslint@9.16.0(jiti@1.21.0))': dependencies: - eslint: 8.57.0 + eslint: 9.16.0(jiti@1.21.0) eslint-visitor-keys: 3.4.3 '@eslint-community/regexpp@4.10.0': {} - '@eslint/eslintrc@2.1.4': + '@eslint-community/regexpp@4.12.1': {} + + '@eslint/config-array@0.19.1': + dependencies: + '@eslint/object-schema': 2.1.5 + debug: 4.4.0 + minimatch: 3.1.2 + transitivePeerDependencies: + - supports-color + + '@eslint/core@0.9.1': + dependencies: + '@types/json-schema': 7.0.15 + + '@eslint/eslintrc@3.2.0': dependencies: ajv: 6.12.6 - debug: 4.3.4 - espree: 9.6.1 - globals: 13.24.0 + debug: 4.4.0 + espree: 10.3.0 + globals: 14.0.0 ignore: 5.3.1 import-fresh: 3.3.0 js-yaml: 4.1.0 @@ -6260,7 +6242,13 @@ snapshots: transitivePeerDependencies: - supports-color - '@eslint/js@8.57.0': {} + '@eslint/js@9.16.0': {} + + '@eslint/object-schema@2.1.5': {} + + '@eslint/plugin-kit@0.2.4': + dependencies: + levn: 0.4.1 '@feathersjs/adapter-commons@4.5.17': dependencies: @@ -6348,7 +6336,7 @@ snapshots: '@feathersjs/feathers@4.5.17': dependencies: '@feathersjs/commons': 4.5.16 - debug: 4.3.4 + debug: 4.4.0 events: 3.3.0 uberproto: 2.0.6 transitivePeerDependencies: @@ -6425,17 +6413,18 @@ snapshots: '@gar/promisify@1.1.3': optional: true - '@humanwhocodes/config-array@0.11.14': + '@humanfs/core@0.19.1': {} + + '@humanfs/node@0.16.6': dependencies: - '@humanwhocodes/object-schema': 2.0.3 - debug: 4.3.4 - minimatch: 3.1.2 - transitivePeerDependencies: - - supports-color + '@humanfs/core': 0.19.1 + '@humanwhocodes/retry': 0.3.1 '@humanwhocodes/module-importer@1.0.1': {} - '@humanwhocodes/object-schema@2.0.3': {} + '@humanwhocodes/retry@0.3.1': {} + + '@humanwhocodes/retry@0.4.1': {} '@iconify-json/simple-icons@1.2.15': dependencies: @@ -6499,10 +6488,12 @@ snapshots: '@nodelib/fs.scandir': 2.1.5 fastq: 1.17.1 + '@nolyfill/is-core-module@1.0.39': {} + '@npmcli/fs@1.1.1': dependencies: '@gar/promisify': 1.1.3 - semver: 7.6.0 + semver: 7.6.3 optional: true '@npmcli/move-file@1.1.2': @@ -6514,6 +6505,8 @@ snapshots: '@pkgjs/parseargs@0.11.0': optional: true + '@pkgr/core@0.1.1': {} + '@pnpm/config.env-replace@1.1.0': {} '@pnpm/network.ca-file@1.0.2': @@ -6677,6 +6670,9 @@ snapshots: '@rollup/rollup-win32-x64-msvc@4.28.1': optional: true + '@rtsao/scc@1.1.0': + optional: true + '@samverschueren/stream-to-observable@0.3.1(rxjs@6.6.7)': dependencies: any-observable: 0.3.0(rxjs@6.6.7) @@ -6784,7 +6780,8 @@ snapshots: '@types/json-schema@7.0.15': {} - '@types/json5@0.0.29': {} + '@types/json5@0.0.29': + optional: true '@types/jsonwebtoken@9.0.7': dependencies: @@ -6821,8 +6818,6 @@ snapshots: '@types/resolve@1.20.2': {} - '@types/semver@7.5.8': {} - '@types/send@0.17.4': dependencies: '@types/mime': 1.3.5 @@ -6846,89 +6841,82 @@ snapshots: dependencies: '@types/webidl-conversions': 7.0.3 - '@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.7.2))(eslint@8.57.0)(typescript@5.7.2)': + '@typescript-eslint/eslint-plugin@8.18.0(@typescript-eslint/parser@8.18.0(eslint@9.16.0(jiti@1.21.0))(typescript@5.7.2))(eslint@9.16.0(jiti@1.21.0))(typescript@5.7.2)': dependencies: '@eslint-community/regexpp': 4.10.0 - '@typescript-eslint/parser': 5.62.0(eslint@8.57.0)(typescript@5.7.2) - '@typescript-eslint/scope-manager': 5.62.0 - '@typescript-eslint/type-utils': 5.62.0(eslint@8.57.0)(typescript@5.7.2) - '@typescript-eslint/utils': 5.62.0(eslint@8.57.0)(typescript@5.7.2) - debug: 4.3.4 - eslint: 8.57.0 + '@typescript-eslint/parser': 8.18.0(eslint@9.16.0(jiti@1.21.0))(typescript@5.7.2) + '@typescript-eslint/scope-manager': 8.18.0 + '@typescript-eslint/type-utils': 8.18.0(eslint@9.16.0(jiti@1.21.0))(typescript@5.7.2) + '@typescript-eslint/utils': 8.18.0(eslint@9.16.0(jiti@1.21.0))(typescript@5.7.2) + '@typescript-eslint/visitor-keys': 8.18.0 + eslint: 9.16.0(jiti@1.21.0) graphemer: 1.4.0 ignore: 5.3.1 - natural-compare-lite: 1.4.0 - semver: 7.6.0 - tsutils: 3.21.0(typescript@5.7.2) - optionalDependencies: + natural-compare: 1.4.0 + ts-api-utils: 1.4.3(typescript@5.7.2) typescript: 5.7.2 transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.7.2)': + '@typescript-eslint/parser@8.18.0(eslint@9.16.0(jiti@1.21.0))(typescript@5.7.2)': dependencies: - '@typescript-eslint/scope-manager': 5.62.0 - '@typescript-eslint/types': 5.62.0 - '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.7.2) - debug: 4.3.4 - eslint: 8.57.0 - optionalDependencies: + '@typescript-eslint/scope-manager': 8.18.0 + '@typescript-eslint/types': 8.18.0 + '@typescript-eslint/typescript-estree': 8.18.0(typescript@5.7.2) + '@typescript-eslint/visitor-keys': 8.18.0 + debug: 4.4.0 + eslint: 9.16.0(jiti@1.21.0) typescript: 5.7.2 transitivePeerDependencies: - supports-color - '@typescript-eslint/scope-manager@5.62.0': + '@typescript-eslint/scope-manager@8.18.0': dependencies: - '@typescript-eslint/types': 5.62.0 - '@typescript-eslint/visitor-keys': 5.62.0 + '@typescript-eslint/types': 8.18.0 + '@typescript-eslint/visitor-keys': 8.18.0 - '@typescript-eslint/type-utils@5.62.0(eslint@8.57.0)(typescript@5.7.2)': + '@typescript-eslint/type-utils@8.18.0(eslint@9.16.0(jiti@1.21.0))(typescript@5.7.2)': dependencies: - '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.7.2) - '@typescript-eslint/utils': 5.62.0(eslint@8.57.0)(typescript@5.7.2) - debug: 4.3.4 - eslint: 8.57.0 - tsutils: 3.21.0(typescript@5.7.2) - optionalDependencies: + '@typescript-eslint/typescript-estree': 8.18.0(typescript@5.7.2) + '@typescript-eslint/utils': 8.18.0(eslint@9.16.0(jiti@1.21.0))(typescript@5.7.2) + debug: 4.4.0 + eslint: 9.16.0(jiti@1.21.0) + ts-api-utils: 1.4.3(typescript@5.7.2) typescript: 5.7.2 transitivePeerDependencies: - supports-color - '@typescript-eslint/types@5.62.0': {} + '@typescript-eslint/types@8.18.0': {} - '@typescript-eslint/typescript-estree@5.62.0(typescript@5.7.2)': + '@typescript-eslint/typescript-estree@8.18.0(typescript@5.7.2)': dependencies: - '@typescript-eslint/types': 5.62.0 - '@typescript-eslint/visitor-keys': 5.62.0 - debug: 4.3.4 - globby: 11.1.0 + '@typescript-eslint/types': 8.18.0 + '@typescript-eslint/visitor-keys': 8.18.0 + debug: 4.4.0 + fast-glob: 3.3.2 is-glob: 4.0.3 - semver: 7.6.0 - tsutils: 3.21.0(typescript@5.7.2) - optionalDependencies: + minimatch: 9.0.4 + semver: 7.6.3 + ts-api-utils: 1.4.3(typescript@5.7.2) typescript: 5.7.2 transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@5.62.0(eslint@8.57.0)(typescript@5.7.2)': + '@typescript-eslint/utils@8.18.0(eslint@9.16.0(jiti@1.21.0))(typescript@5.7.2)': dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) - '@types/json-schema': 7.0.15 - '@types/semver': 7.5.8 - '@typescript-eslint/scope-manager': 5.62.0 - '@typescript-eslint/types': 5.62.0 - '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.7.2) - eslint: 8.57.0 - eslint-scope: 5.1.1 - semver: 7.6.0 + '@eslint-community/eslint-utils': 4.4.0(eslint@9.16.0(jiti@1.21.0)) + '@typescript-eslint/scope-manager': 8.18.0 + '@typescript-eslint/types': 8.18.0 + '@typescript-eslint/typescript-estree': 8.18.0(typescript@5.7.2) + eslint: 9.16.0(jiti@1.21.0) + typescript: 5.7.2 transitivePeerDependencies: - supports-color - - typescript - '@typescript-eslint/visitor-keys@5.62.0': + '@typescript-eslint/visitor-keys@8.18.0': dependencies: - '@typescript-eslint/types': 5.62.0 - eslint-visitor-keys: 3.4.3 + '@typescript-eslint/types': 8.18.0 + eslint-visitor-keys: 4.2.0 '@ucast/core@1.10.2': {} @@ -7121,15 +7109,17 @@ snapshots: mime-types: 2.1.35 negotiator: 0.6.3 - acorn-jsx@5.3.2(acorn@8.11.3): + acorn-jsx@5.3.2(acorn@8.14.0): dependencies: - acorn: 8.11.3 + acorn: 8.14.0 acorn@8.11.3: {} + acorn@8.14.0: {} + agent-base@6.0.2: dependencies: - debug: 4.3.4 + debug: 4.4.0 transitivePeerDependencies: - supports-color optional: true @@ -7240,6 +7230,7 @@ snapshots: dependencies: call-bind: 1.0.7 is-array-buffer: 3.0.4 + optional: true array-flatten@1.1.1: {} @@ -7251,8 +7242,7 @@ snapshots: es-object-atoms: 1.0.0 get-intrinsic: 1.2.4 is-string: 1.0.7 - - array-union@2.1.0: {} + optional: true array.prototype.findlastindex@1.2.5: dependencies: @@ -7262,6 +7252,7 @@ snapshots: es-errors: 1.3.0 es-object-atoms: 1.0.0 es-shim-unscopables: 1.0.2 + optional: true array.prototype.flat@1.3.2: dependencies: @@ -7269,6 +7260,7 @@ snapshots: define-properties: 1.2.1 es-abstract: 1.23.3 es-shim-unscopables: 1.0.2 + optional: true array.prototype.flatmap@1.3.2: dependencies: @@ -7276,6 +7268,7 @@ snapshots: define-properties: 1.2.1 es-abstract: 1.23.3 es-shim-unscopables: 1.0.2 + optional: true arraybuffer.prototype.slice@1.0.3: dependencies: @@ -7287,6 +7280,7 @@ snapshots: get-intrinsic: 1.2.4 is-array-buffer: 3.0.4 is-shared-array-buffer: 1.0.3 + optional: true assertion-error@2.0.1: {} @@ -7403,7 +7397,7 @@ snapshots: builtins@5.1.0: dependencies: - semver: 7.6.0 + semver: 7.6.3 bundle-name@4.1.0: dependencies: @@ -7509,16 +7503,10 @@ snapshots: chownr@2.0.0: {} - ci-info@3.9.0: {} - citty@0.1.6: dependencies: consola: 3.2.3 - clean-regexp@1.0.0: - dependencies: - escape-string-regexp: 1.0.5 - clean-stack@2.2.0: optional: true @@ -7653,6 +7641,12 @@ snapshots: shebang-command: 2.0.0 which: 2.0.2 + cross-spawn@7.0.6: + dependencies: + path-key: 3.1.1 + shebang-command: 2.0.0 + which: 2.0.2 + css-declaration-sorter@7.2.0(postcss@8.4.38): dependencies: postcss: 8.4.38 @@ -7734,18 +7728,21 @@ snapshots: call-bind: 1.0.7 es-errors: 1.3.0 is-data-view: 1.0.1 + optional: true data-view-byte-length@1.0.1: dependencies: call-bind: 1.0.7 es-errors: 1.3.0 is-data-view: 1.0.1 + optional: true data-view-byte-offset@1.0.0: dependencies: call-bind: 1.0.7 es-errors: 1.3.0 is-data-view: 1.0.1 + optional: true date-fns@1.30.1: {} @@ -7803,6 +7800,7 @@ snapshots: define-data-property: 1.1.4 has-property-descriptors: 1.0.2 object-keys: 1.1.1 + optional: true defu@6.1.4: {} @@ -7837,6 +7835,7 @@ snapshots: doctrine@2.1.0: dependencies: esutils: 2.0.3 + optional: true doctrine@3.0.0: dependencies: @@ -7995,6 +7994,7 @@ snapshots: typed-array-length: 1.0.6 unbox-primitive: 1.0.2 which-typed-array: 1.1.15 + optional: true es-define-property@1.0.0: dependencies: @@ -8007,22 +8007,26 @@ snapshots: es-object-atoms@1.0.0: dependencies: es-errors: 1.3.0 + optional: true es-set-tostringtag@2.0.3: dependencies: get-intrinsic: 1.2.4 has-tostringtag: 1.0.2 hasown: 2.0.2 + optional: true es-shim-unscopables@1.0.2: dependencies: hasown: 2.0.2 + optional: true es-to-primitive@1.2.1: dependencies: is-callable: 1.2.7 is-date-object: 1.0.5 is-symbol: 1.0.4 + optional: true esbuild@0.19.12: optionalDependencies: @@ -8141,163 +8145,162 @@ snapshots: escape-string-regexp@5.0.0: {} - eslint-config-prettier@8.10.0(eslint@8.57.0): + eslint-config-prettier@9.1.0(eslint@9.16.0(jiti@1.21.0)): dependencies: - eslint: 8.57.0 + eslint: 9.16.0(jiti@1.21.0) + optional: true eslint-import-resolver-node@0.3.9: dependencies: debug: 3.2.7 - is-core-module: 2.13.1 + is-core-module: 2.15.1 resolve: 1.22.8 transitivePeerDependencies: - supports-color - eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.7.2))(eslint-plugin-import@2.29.1)(eslint@8.57.0): + eslint-import-resolver-typescript@3.7.0(eslint-plugin-import-x@4.5.0(eslint@9.16.0(jiti@1.21.0))(typescript@5.7.2))(eslint-plugin-import@2.31.0)(eslint@9.16.0(jiti@1.21.0)): dependencies: - debug: 4.3.4 + '@nolyfill/is-core-module': 1.0.39 + debug: 4.4.0 enhanced-resolve: 5.16.0 - eslint: 8.57.0 - eslint-module-utils: 2.8.1(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.7.2))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.7.2))(eslint-plugin-import@2.29.1)(eslint@8.57.0))(eslint@8.57.0) - eslint-plugin-import: 2.29.1(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.7.2))(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) + eslint: 9.16.0(jiti@1.21.0) fast-glob: 3.3.2 - get-tsconfig: 4.7.3 - is-core-module: 2.13.1 + get-tsconfig: 4.8.1 + is-bun-module: 1.3.0 is-glob: 4.0.3 + stable-hash: 0.0.4 + optionalDependencies: + eslint-plugin-import: 2.31.0(@typescript-eslint/parser@8.18.0(eslint@9.16.0(jiti@1.21.0))(typescript@5.7.2))(eslint-import-resolver-typescript@3.7.0)(eslint@9.16.0(jiti@1.21.0)) + eslint-plugin-import-x: 4.5.0(eslint@9.16.0(jiti@1.21.0))(typescript@5.7.2) transitivePeerDependencies: - - '@typescript-eslint/parser' - - eslint-import-resolver-node - - eslint-import-resolver-webpack - supports-color - eslint-module-utils@2.8.1(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.7.2))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.7.2))(eslint-plugin-import@2.29.1)(eslint@8.57.0))(eslint@8.57.0): + eslint-module-utils@2.12.0(@typescript-eslint/parser@8.18.0(eslint@9.16.0(jiti@1.21.0))(typescript@5.7.2))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.7.0(eslint-plugin-import-x@4.5.0(eslint@9.16.0(jiti@1.21.0))(typescript@5.7.2))(eslint-plugin-import@2.31.0)(eslint@9.16.0(jiti@1.21.0)))(eslint@9.16.0(jiti@1.21.0)): dependencies: debug: 3.2.7 optionalDependencies: - '@typescript-eslint/parser': 5.62.0(eslint@8.57.0)(typescript@5.7.2) - eslint: 8.57.0 + '@typescript-eslint/parser': 8.18.0(eslint@9.16.0(jiti@1.21.0))(typescript@5.7.2) + eslint: 9.16.0(jiti@1.21.0) eslint-import-resolver-node: 0.3.9 - eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.7.2))(eslint-plugin-import@2.29.1)(eslint@8.57.0) + eslint-import-resolver-typescript: 3.7.0(eslint-plugin-import-x@4.5.0(eslint@9.16.0(jiti@1.21.0))(typescript@5.7.2))(eslint-plugin-import@2.31.0)(eslint@9.16.0(jiti@1.21.0)) transitivePeerDependencies: - supports-color + optional: true - eslint-plugin-import@2.29.1(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.7.2))(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0): + eslint-plugin-import-x@4.5.0(eslint@9.16.0(jiti@1.21.0))(typescript@5.7.2): dependencies: + '@typescript-eslint/scope-manager': 8.18.0 + '@typescript-eslint/utils': 8.18.0(eslint@9.16.0(jiti@1.21.0))(typescript@5.7.2) + debug: 4.4.0 + doctrine: 3.0.0 + eslint: 9.16.0(jiti@1.21.0) + eslint-import-resolver-node: 0.3.9 + get-tsconfig: 4.8.1 + is-glob: 4.0.3 + minimatch: 9.0.4 + semver: 7.6.3 + stable-hash: 0.0.4 + tslib: 2.8.1 + transitivePeerDependencies: + - supports-color + - typescript + + eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.18.0(eslint@9.16.0(jiti@1.21.0))(typescript@5.7.2))(eslint-import-resolver-typescript@3.7.0)(eslint@9.16.0(jiti@1.21.0)): + dependencies: + '@rtsao/scc': 1.1.0 array-includes: 3.1.8 array.prototype.findlastindex: 1.2.5 array.prototype.flat: 1.3.2 array.prototype.flatmap: 1.3.2 debug: 3.2.7 doctrine: 2.1.0 - eslint: 8.57.0 + eslint: 9.16.0(jiti@1.21.0) eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.8.1(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.7.2))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.7.2))(eslint-plugin-import@2.29.1)(eslint@8.57.0))(eslint@8.57.0) + eslint-module-utils: 2.12.0(@typescript-eslint/parser@8.18.0(eslint@9.16.0(jiti@1.21.0))(typescript@5.7.2))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.7.0(eslint-plugin-import-x@4.5.0(eslint@9.16.0(jiti@1.21.0))(typescript@5.7.2))(eslint-plugin-import@2.31.0)(eslint@9.16.0(jiti@1.21.0)))(eslint@9.16.0(jiti@1.21.0)) hasown: 2.0.2 - is-core-module: 2.13.1 + is-core-module: 2.15.1 is-glob: 4.0.3 minimatch: 3.1.2 object.fromentries: 2.0.8 object.groupby: 1.0.3 object.values: 1.2.0 semver: 6.3.1 + string.prototype.trimend: 1.0.8 tsconfig-paths: 3.15.0 optionalDependencies: - '@typescript-eslint/parser': 5.62.0(eslint@8.57.0)(typescript@5.7.2) + '@typescript-eslint/parser': 8.18.0(eslint@9.16.0(jiti@1.21.0))(typescript@5.7.2) transitivePeerDependencies: - eslint-import-resolver-typescript - eslint-import-resolver-webpack - supports-color + optional: true - eslint-plugin-prettier@4.2.1(eslint-config-prettier@8.10.0(eslint@8.57.0))(eslint@8.57.0)(prettier@3.4.2): + eslint-plugin-prettier@5.2.1(eslint-config-prettier@9.1.0(eslint@9.16.0(jiti@1.21.0)))(eslint@9.16.0(jiti@1.21.0))(prettier@3.4.2): dependencies: - eslint: 8.57.0 + eslint: 9.16.0(jiti@1.21.0) prettier: 3.4.2 prettier-linter-helpers: 1.0.0 + synckit: 0.9.2 optionalDependencies: - eslint-config-prettier: 8.10.0(eslint@8.57.0) + eslint-config-prettier: 9.1.0(eslint@9.16.0(jiti@1.21.0)) - eslint-plugin-unicorn@47.0.0(eslint@8.57.0): - dependencies: - '@babel/helper-validator-identifier': 7.22.20 - '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) - ci-info: 3.9.0 - clean-regexp: 1.0.0 - eslint: 8.57.0 - esquery: 1.5.0 - indent-string: 4.0.0 - is-builtin-module: 3.2.1 - jsesc: 3.0.2 - lodash: 4.17.21 - pluralize: 8.0.0 - read-pkg-up: 7.0.1 - regexp-tree: 0.1.27 - regjsparser: 0.10.0 - safe-regex: 2.1.1 - semver: 7.6.0 - strip-indent: 3.0.0 - - eslint-scope@5.1.1: - dependencies: - esrecurse: 4.3.0 - estraverse: 4.3.0 - - eslint-scope@7.2.2: + eslint-scope@8.2.0: dependencies: esrecurse: 4.3.0 estraverse: 5.3.0 eslint-visitor-keys@3.4.3: {} - eslint@8.57.0: + eslint-visitor-keys@4.2.0: {} + + eslint@9.16.0(jiti@1.21.0): dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) - '@eslint-community/regexpp': 4.10.0 - '@eslint/eslintrc': 2.1.4 - '@eslint/js': 8.57.0 - '@humanwhocodes/config-array': 0.11.14 + '@eslint-community/eslint-utils': 4.4.0(eslint@9.16.0(jiti@1.21.0)) + '@eslint-community/regexpp': 4.12.1 + '@eslint/config-array': 0.19.1 + '@eslint/core': 0.9.1 + '@eslint/eslintrc': 3.2.0 + '@eslint/js': 9.16.0 + '@eslint/plugin-kit': 0.2.4 + '@humanfs/node': 0.16.6 '@humanwhocodes/module-importer': 1.0.1 - '@nodelib/fs.walk': 1.2.8 - '@ungap/structured-clone': 1.2.0 + '@humanwhocodes/retry': 0.4.1 + '@types/estree': 1.0.6 + '@types/json-schema': 7.0.15 ajv: 6.12.6 chalk: 4.1.2 - cross-spawn: 7.0.3 - debug: 4.3.4 - doctrine: 3.0.0 + cross-spawn: 7.0.6 + debug: 4.4.0 escape-string-regexp: 4.0.0 - eslint-scope: 7.2.2 - eslint-visitor-keys: 3.4.3 - espree: 9.6.1 + eslint-scope: 8.2.0 + eslint-visitor-keys: 4.2.0 + espree: 10.3.0 esquery: 1.5.0 esutils: 2.0.3 fast-deep-equal: 3.1.3 - file-entry-cache: 6.0.1 + file-entry-cache: 8.0.0 find-up: 5.0.0 glob-parent: 6.0.2 - globals: 13.24.0 - graphemer: 1.4.0 ignore: 5.3.1 imurmurhash: 0.1.4 is-glob: 4.0.3 - is-path-inside: 3.0.3 - js-yaml: 4.1.0 json-stable-stringify-without-jsonify: 1.0.1 - levn: 0.4.1 lodash.merge: 4.6.2 minimatch: 3.1.2 natural-compare: 1.4.0 optionator: 0.9.3 - strip-ansi: 6.0.1 - text-table: 0.2.0 + optionalDependencies: + jiti: 1.21.0 transitivePeerDependencies: - supports-color esm@3.2.25: {} - espree@9.6.1: + espree@10.3.0: dependencies: - acorn: 8.11.3 - acorn-jsx: 5.3.2(acorn@8.11.3) - eslint-visitor-keys: 3.4.3 + acorn: 8.14.0 + acorn-jsx: 5.3.2(acorn@8.14.0) + eslint-visitor-keys: 4.2.0 esquery@1.5.0: dependencies: @@ -8307,8 +8310,6 @@ snapshots: dependencies: estraverse: 5.3.0 - estraverse@4.3.0: {} - estraverse@5.3.0: {} estree-walker@2.0.2: {} @@ -8494,9 +8495,9 @@ snapshots: dependencies: escape-string-regexp: 1.0.5 - file-entry-cache@6.0.1: + file-entry-cache@8.0.0: dependencies: - flat-cache: 3.2.0 + flat-cache: 4.0.1 file-uri-to-path@1.0.0: {} @@ -8534,11 +8535,10 @@ snapshots: locate-path: 6.0.0 path-exists: 4.0.0 - flat-cache@3.2.0: + flat-cache@4.0.1: dependencies: flatted: 3.3.1 keyv: 4.5.4 - rimraf: 3.0.2 flatted@3.3.1: {} @@ -8590,8 +8590,10 @@ snapshots: define-properties: 1.2.1 es-abstract: 1.23.3 functions-have-names: 1.2.3 + optional: true - functions-have-names@1.2.3: {} + functions-have-names@1.2.3: + optional: true gauge@4.0.4: dependencies: @@ -8628,8 +8630,9 @@ snapshots: call-bind: 1.0.7 es-errors: 1.3.0 get-intrinsic: 1.2.4 + optional: true - get-tsconfig@4.7.3: + get-tsconfig@4.8.1: dependencies: resolve-pkg-maps: 1.0.0 @@ -8668,6 +8671,7 @@ snapshots: minimatch: 3.1.2 once: 1.4.0 path-is-absolute: 1.0.1 + optional: true glob@8.1.0: dependencies: @@ -8683,22 +8687,12 @@ snapshots: globals@11.12.0: {} - globals@13.24.0: - dependencies: - type-fest: 0.20.2 + globals@14.0.0: {} globalthis@1.0.3: dependencies: define-properties: 1.2.1 - - globby@11.1.0: - dependencies: - array-union: 2.1.0 - dir-glob: 3.0.1 - fast-glob: 3.3.2 - ignore: 5.3.1 - merge2: 1.4.1 - slash: 3.0.0 + optional: true globby@13.2.2: dependencies: @@ -8733,7 +8727,8 @@ snapshots: dependencies: ansi-regex: 2.1.1 - has-bigints@1.0.2: {} + has-bigints@1.0.2: + optional: true has-flag@3.0.0: {} @@ -8789,8 +8784,6 @@ snapshots: hookable@5.5.3: {} - hosted-git-info@2.8.9: {} - hosted-git-info@7.0.1: dependencies: lru-cache: 10.2.0 @@ -8818,7 +8811,7 @@ snapshots: dependencies: '@tootallnate/once': 1.1.2 agent-base: 6.0.2 - debug: 4.3.4 + debug: 4.4.0 transitivePeerDependencies: - supports-color optional: true @@ -8826,7 +8819,7 @@ snapshots: https-proxy-agent@5.0.1: dependencies: agent-base: 6.0.2 - debug: 4.3.4 + debug: 4.4.0 transitivePeerDependencies: - supports-color optional: true @@ -8878,7 +8871,8 @@ snapshots: indent-string@3.2.0: {} - indent-string@4.0.0: {} + indent-string@4.0.0: + optional: true index-to-position@0.1.2: {} @@ -8959,6 +8953,7 @@ snapshots: es-errors: 1.3.0 hasown: 2.0.2 side-channel: 1.0.6 + optional: true interpret@2.2.0: {} @@ -8979,35 +8974,44 @@ snapshots: dependencies: call-bind: 1.0.7 get-intrinsic: 1.2.4 + optional: true is-arrayish@0.2.1: {} is-bigint@1.0.4: dependencies: has-bigints: 1.0.2 + optional: true is-boolean-object@1.1.2: dependencies: call-bind: 1.0.7 has-tostringtag: 1.0.2 + optional: true is-builtin-module@3.2.1: dependencies: builtin-modules: 3.3.0 + is-bun-module@1.3.0: + dependencies: + semver: 7.6.3 + is-callable@1.2.7: {} - is-core-module@2.13.1: + is-core-module@2.15.1: dependencies: hasown: 2.0.2 is-data-view@1.0.1: dependencies: is-typed-array: 1.1.13 + optional: true is-date-object@1.0.5: dependencies: has-tostringtag: 1.0.2 + optional: true is-docker@3.0.0: {} @@ -9049,13 +9053,15 @@ snapshots: is-module@1.0.0: {} - is-negative-zero@2.0.3: {} + is-negative-zero@2.0.3: + optional: true is-npm@6.0.0: {} is-number-object@1.0.7: dependencies: has-tostringtag: 1.0.2 + optional: true is-number@7.0.0: {} @@ -9065,8 +9071,6 @@ snapshots: is-path-cwd@3.0.0: {} - is-path-inside@3.0.3: {} - is-path-inside@4.0.0: {} is-plain-object@5.0.0: {} @@ -9081,6 +9085,7 @@ snapshots: dependencies: call-bind: 1.0.7 has-tostringtag: 1.0.2 + optional: true is-scoped@3.0.0: dependencies: @@ -9089,6 +9094,7 @@ snapshots: is-shared-array-buffer@1.0.3: dependencies: call-bind: 1.0.7 + optional: true is-stream@1.1.0: {} @@ -9097,10 +9103,12 @@ snapshots: is-string@1.0.7: dependencies: has-tostringtag: 1.0.2 + optional: true is-symbol@1.0.4: dependencies: has-symbols: 1.0.3 + optional: true is-typed-array@1.1.13: dependencies: @@ -9115,6 +9123,7 @@ snapshots: is-weakref@1.0.2: dependencies: call-bind: 1.0.7 + optional: true is-what@4.1.16: {} @@ -9122,7 +9131,8 @@ snapshots: dependencies: is-inside-container: 1.0.0 - isarray@2.0.5: {} + isarray@2.0.5: + optional: true isexe@2.0.0: {} @@ -9170,12 +9180,8 @@ snapshots: jsbn@1.1.0: optional: true - jsesc@0.5.0: {} - jsesc@2.5.2: {} - jsesc@3.0.2: {} - json-buffer@3.0.1: {} json-parse-even-better-errors@2.3.1: {} @@ -9194,6 +9200,7 @@ snapshots: json5@1.0.2: dependencies: minimist: 1.2.8 + optional: true json5@2.2.3: {} @@ -9507,8 +9514,6 @@ snapshots: mimic-response@3.1.0: {} - min-indent@1.0.1: {} - minimatch@3.1.2: dependencies: brace-expansion: 1.1.11 @@ -9686,7 +9691,7 @@ snapshots: mquery@5.0.0: dependencies: - debug: 4.3.4 + debug: 4.4.0 transitivePeerDependencies: - supports-color @@ -9708,8 +9713,6 @@ snapshots: napi-build-utils@1.0.2: {} - natural-compare-lite@1.4.0: {} - natural-compare@1.4.0: {} negotiator@0.6.3: {} @@ -9728,7 +9731,7 @@ snapshots: node-abi@3.57.0: dependencies: - semver: 7.6.0 + semver: 7.6.3 node-addon-api@7.1.0: {} @@ -9756,18 +9759,11 @@ snapshots: abbrev: 1.1.1 optional: true - normalize-package-data@2.5.0: - dependencies: - hosted-git-info: 2.8.9 - resolve: 1.22.8 - semver: 5.7.2 - validate-npm-package-license: 3.0.4 - normalize-package-data@6.0.0: dependencies: hosted-git-info: 7.0.1 - is-core-module: 2.13.1 - semver: 7.6.0 + is-core-module: 2.15.1 + semver: 7.6.3 validate-npm-package-license: 3.0.4 normalize-range@0.1.2: {} @@ -9849,7 +9845,8 @@ snapshots: object-inspect@1.13.1: {} - object-keys@1.1.1: {} + object-keys@1.1.1: + optional: true object.assign@4.1.5: dependencies: @@ -9857,6 +9854,7 @@ snapshots: define-properties: 1.2.1 has-symbols: 1.0.3 object-keys: 1.1.1 + optional: true object.fromentries@2.0.8: dependencies: @@ -9864,18 +9862,21 @@ snapshots: define-properties: 1.2.1 es-abstract: 1.23.3 es-object-atoms: 1.0.0 + optional: true object.groupby@1.0.3: dependencies: call-bind: 1.0.7 define-properties: 1.2.1 es-abstract: 1.23.3 + optional: true object.values@1.2.0: dependencies: call-bind: 1.0.7 define-properties: 1.2.1 es-object-atoms: 1.0.0 + optional: true objection@3.1.5(knex@3.1.0(sqlite3@5.1.7)): dependencies: @@ -10014,7 +10015,8 @@ snapshots: path-exists@5.0.0: {} - path-is-absolute@1.0.1: {} + path-is-absolute@1.0.1: + optional: true path-key@3.1.1: {} @@ -10065,8 +10067,6 @@ snapshots: mlly: 1.6.1 pathe: 1.1.2 - pluralize@8.0.0: {} - possible-typed-array-names@1.0.0: {} postcss-calc@9.0.1(postcss@8.4.38): @@ -10332,19 +10332,6 @@ snapshots: read-pkg: 9.0.1 type-fest: 4.30.0 - read-pkg-up@7.0.1: - dependencies: - find-up: 4.1.0 - read-pkg: 5.2.0 - type-fest: 0.8.1 - - read-pkg@5.2.0: - dependencies: - '@types/normalize-package-data': 2.4.4 - normalize-package-data: 2.5.0 - parse-json: 5.2.0 - type-fest: 0.6.0 - read-pkg@9.0.1: dependencies: '@types/normalize-package-data': 2.4.4 @@ -10375,14 +10362,13 @@ snapshots: dependencies: regex-utilities: 2.3.0 - regexp-tree@0.1.27: {} - regexp.prototype.flags@1.5.2: dependencies: call-bind: 1.0.7 define-properties: 1.2.1 es-errors: 1.3.0 set-function-name: 2.0.2 + optional: true registry-auth-token@5.0.2: dependencies: @@ -10392,10 +10378,6 @@ snapshots: dependencies: rc: 1.2.8 - regjsparser@0.10.0: - dependencies: - jsesc: 0.5.0 - require-from-string@2.0.2: {} resolve-cwd@3.0.0: @@ -10410,7 +10392,7 @@ snapshots: resolve@1.22.8: dependencies: - is-core-module: 2.13.1 + is-core-module: 2.15.1 path-parse: 1.0.7 supports-preserve-symlinks-flag: 1.0.0 @@ -10436,6 +10418,7 @@ snapshots: rimraf@3.0.2: dependencies: glob: 7.2.3 + optional: true rollup-plugin-dts@6.1.1(rollup@3.29.4)(typescript@5.7.2): dependencies: @@ -10511,7 +10494,7 @@ snapshots: rxjs@7.8.1: dependencies: - tslib: 2.6.2 + tslib: 2.8.1 safe-array-concat@1.1.2: dependencies: @@ -10519,6 +10502,7 @@ snapshots: get-intrinsic: 1.2.4 has-symbols: 1.0.3 isarray: 2.0.5 + optional: true safe-buffer@5.1.2: {} @@ -10529,10 +10513,7 @@ snapshots: call-bind: 1.0.7 es-errors: 1.3.0 is-regex: 1.1.4 - - safe-regex@2.1.1: - dependencies: - regexp-tree: 0.1.27 + optional: true safer-buffer@2.1.2: {} @@ -10542,8 +10523,6 @@ snapshots: search-insights@2.13.0: {} - semver@5.7.2: {} - semver@6.3.1: {} semver@7.6.0: @@ -10622,6 +10601,7 @@ snapshots: es-errors: 1.3.0 functions-have-names: 1.2.3 has-property-descriptors: 1.0.2 + optional: true setprototypeof@1.2.0: {} @@ -10663,8 +10643,6 @@ snapshots: once: 1.4.0 simple-concat: 1.0.1 - slash@3.0.0: {} - slash@4.0.0: {} slash@5.1.0: {} @@ -10718,7 +10696,7 @@ snapshots: socks-proxy-agent@6.2.1: dependencies: agent-base: 6.0.2 - debug: 4.3.4 + debug: 4.4.0 socks: 2.8.3 transitivePeerDependencies: - supports-color @@ -10776,6 +10754,8 @@ snapshots: minipass: 3.3.6 optional: true + stable-hash@0.0.4: {} + stackback@0.0.2: {} statuses@2.0.1: {} @@ -10824,18 +10804,21 @@ snapshots: define-properties: 1.2.1 es-abstract: 1.23.3 es-object-atoms: 1.0.0 + optional: true string.prototype.trimend@1.0.8: dependencies: call-bind: 1.0.7 define-properties: 1.2.1 es-object-atoms: 1.0.0 + optional: true string.prototype.trimstart@1.0.8: dependencies: call-bind: 1.0.7 define-properties: 1.2.1 es-object-atoms: 1.0.0 + optional: true string_decoder@1.3.0: dependencies: @@ -10866,14 +10849,11 @@ snapshots: dependencies: ansi-regex: 6.0.1 - strip-bom@3.0.0: {} + strip-bom@3.0.0: + optional: true strip-final-newline@3.0.0: {} - strip-indent@3.0.0: - dependencies: - min-indent: 1.0.1 - strip-json-comments@2.0.1: {} strip-json-comments@3.1.1: {} @@ -10921,6 +10901,11 @@ snapshots: symbol-observable@4.0.0: {} + synckit@0.9.2: + dependencies: + '@pkgr/core': 0.1.1 + tslib: 2.8.1 + tabbable@6.2.0: {} tapable@2.2.1: {} @@ -10968,8 +10953,6 @@ snapshots: glob: 10.4.5 minimatch: 9.0.4 - text-table@0.2.0: {} - through@2.3.8: {} tildify@2.0.0: {} @@ -11006,24 +10989,22 @@ snapshots: ts-algebra@2.0.0: {} + ts-api-utils@1.4.3(typescript@5.7.2): + dependencies: + typescript: 5.7.2 + tsconfig-paths@3.15.0: dependencies: '@types/json5': 0.0.29 json5: 1.0.2 minimist: 1.2.8 strip-bom: 3.0.0 + optional: true tslib@1.14.1: {} - tslib@2.6.2: {} - tslib@2.8.1: {} - tsutils@3.21.0(typescript@5.7.2): - dependencies: - tslib: 1.14.1 - typescript: 5.7.2 - tunnel-agent@0.6.0: dependencies: safe-buffer: 5.2.1 @@ -11032,14 +11013,8 @@ snapshots: dependencies: prelude-ls: 1.2.1 - type-fest@0.20.2: {} - type-fest@0.21.3: {} - type-fest@0.6.0: {} - - type-fest@0.8.1: {} - type-fest@1.4.0: {} type-fest@2.19.0: {} @@ -11058,6 +11033,7 @@ snapshots: call-bind: 1.0.7 es-errors: 1.3.0 is-typed-array: 1.1.13 + optional: true typed-array-byte-length@1.0.1: dependencies: @@ -11066,6 +11042,7 @@ snapshots: gopd: 1.0.1 has-proto: 1.0.3 is-typed-array: 1.1.13 + optional: true typed-array-byte-offset@1.0.2: dependencies: @@ -11075,6 +11052,7 @@ snapshots: gopd: 1.0.1 has-proto: 1.0.3 is-typed-array: 1.1.13 + optional: true typed-array-length@1.0.6: dependencies: @@ -11084,6 +11062,17 @@ snapshots: has-proto: 1.0.3 is-typed-array: 1.1.13 possible-typed-array-names: 1.0.0 + optional: true + + typescript-eslint@8.18.0(eslint@9.16.0(jiti@1.21.0))(typescript@5.7.2): + dependencies: + '@typescript-eslint/eslint-plugin': 8.18.0(@typescript-eslint/parser@8.18.0(eslint@9.16.0(jiti@1.21.0))(typescript@5.7.2))(eslint@9.16.0(jiti@1.21.0))(typescript@5.7.2) + '@typescript-eslint/parser': 8.18.0(eslint@9.16.0(jiti@1.21.0))(typescript@5.7.2) + '@typescript-eslint/utils': 8.18.0(eslint@9.16.0(jiti@1.21.0))(typescript@5.7.2) + eslint: 9.16.0(jiti@1.21.0) + typescript: 5.7.2 + transitivePeerDependencies: + - supports-color typescript@5.7.2: {} @@ -11097,6 +11086,7 @@ snapshots: has-bigints: 1.0.2 has-symbols: 1.0.3 which-boxed-primitive: 1.0.2 + optional: true unbuild@2.0.0(typescript@5.7.2): dependencies: @@ -11413,6 +11403,7 @@ snapshots: is-number-object: 1.0.7 is-string: 1.0.7 is-symbol: 1.0.4 + optional: true which-typed-array@1.1.15: dependencies: diff --git a/src/channels/channels.utils.ts b/src/channels/channels.utils.ts index ad89843..c23f810 100644 --- a/src/channels/channels.utils.ts +++ b/src/channels/channels.utils.ts @@ -9,7 +9,7 @@ import type { ChannelOptions, EventName, InitOptions } from "../types"; export const makeChannelOptions = ( app: Application, - options?: Partial + options?: Partial, ): ChannelOptions => { options = options || {}; return Object.assign({}, defaultOptions, getAppOptions(app), options); @@ -18,13 +18,8 @@ export const makeChannelOptions = ( const defaultOptions: Omit = { activated: true, channelOnError: ["authenticated"], - // eslint-disable-next-line @typescript-eslint/no-unused-vars - ability: ( - app: Application, - connection: RealTimeConnection, - data: any, - context: HookContext - ): Ability => { + + ability: (app: Application, connection: RealTimeConnection): Ability => { return connection.ability; }, modelName: (context) => context.path, @@ -38,13 +33,13 @@ const defaultOptions: Omit = { }; export const makeDefaultOptions = ( - options?: Partial + options?: Partial, ): ChannelOptions => { return Object.assign({}, defaultOptions, options); }; const getAppOptions = ( - app: Application + app: Application, ): ChannelOptions | Record => { const caslOptions: InitOptions = app?.get("casl"); return caslOptions && caslOptions.channels ? caslOptions.channels : {}; @@ -55,7 +50,7 @@ export const getAbility = ( data: Record, connection: RealTimeConnection, context: HookContext, - options: Partial + options: Partial, ): undefined | AnyAbility => { if (options.ability) { return typeof options.ability === "function" @@ -66,15 +61,12 @@ export const getAbility = ( } }; -export const getEventName = (method: string): EventName | undefined => { - if (method === "create") { - return "created"; - } else if (method === "update") { - return "updated"; - } else if (method === "patch") { - return "patched"; - } else if (method === "remove") { - return "removed"; - } - return undefined; -}; +const eventNameMap = { + create: "created", + update: "updated", + patch: "patched", + remove: "removed", +} satisfies Record; + +export const getEventName = (method: string): EventName | undefined => + (eventNameMap as any)[method]; diff --git a/src/channels/getChannelsWithReadAbility.ts b/src/channels/getChannelsWithReadAbility.ts index b6863e3..97deaa7 100644 --- a/src/channels/getChannelsWithReadAbility.ts +++ b/src/channels/getChannelsWithReadAbility.ts @@ -23,7 +23,7 @@ export const getChannelsWithReadAbility = ( app: Application, data: AnyData, context: HookContext, - _options?: Partial + _options?: Partial, ): undefined | Channel | Channel[] => { if (!_options?.channels && !app.channels.length) { return undefined; @@ -93,7 +93,7 @@ export const getChannelsWithReadAbility = ( continue; } const connField = connectionsPerFields.find((x) => - _isEqual(x.fields, fields) + _isEqual(x.fields, fields), ); if (connField) { if (connField.connections.indexOf(connection) !== -1) { diff --git a/src/hooks/authorize/authorize.hook.after.ts b/src/hooks/authorize/authorize.hook.after.ts index 3bb3650..e36ab7a 100644 --- a/src/hooks/authorize/authorize.hook.after.ts +++ b/src/hooks/authorize/authorize.hook.after.ts @@ -31,7 +31,7 @@ import { getMethodName } from "../../utils/getMethodName"; export const authorizeAfter = async ( context: H, - options: AuthorizeHookOptions + options: AuthorizeHookOptions, ) => { if (shouldSkip(HOOKNAME, context, options) || !context.params) { return context; @@ -52,11 +52,11 @@ export const authorizeAfter = async ( const skipCheckConditions = getPersistedConfig( context, - "skipRestrictingRead.conditions" + "skipRestrictingRead.conditions", ); const skipCheckFields = getPersistedConfig( context, - "skipRestrictingRead.fields" + "skipRestrictingRead.fields", ); if (skipCheckConditions && skipCheckFields) { @@ -90,7 +90,7 @@ export const authorizeAfter = async ( $select, ability, getOrFind, - modelName + modelName, ); if ($newSelect) { const _items = await refetchItems(context); @@ -112,7 +112,7 @@ export const authorizeAfter = async ( ability, getOrFind, subject(modelName, item), - hasRestrictingFieldsOptions + hasRestrictingFieldsOptions, ); if (fields === true) { diff --git a/src/hooks/authorize/authorize.hook.before.ts b/src/hooks/authorize/authorize.hook.before.ts index 897607d..d046634 100644 --- a/src/hooks/authorize/authorize.hook.before.ts +++ b/src/hooks/authorize/authorize.hook.before.ts @@ -33,7 +33,7 @@ import { getMethodName } from "../../utils/getMethodName"; export const authorizeBefore = async ( context: H, - options: AuthorizeHookOptions + options: AuthorizeHookOptions, ) => { if (shouldSkip(HOOKNAME, context, options) || !context.params) { return context; @@ -124,7 +124,7 @@ const handleSingle = async ( ability: AnyAbility, modelName: string, availableFields: string[] | undefined, - options: AuthorizeHookOptions + options: AuthorizeHookOptions, ) => { // single: get | patch | update | remove @@ -148,7 +148,7 @@ const handleSingle = async ( modelName, context.params?.query, context.service, - options + options, ); _set(context, "params.query", query); @@ -171,7 +171,7 @@ const handleSingle = async ( ability, method, subject(modelName, item), - { availableFields } + { availableFields }, ); if ( restrictingFields && @@ -223,7 +223,7 @@ const checkData = ( options: Pick< AuthorizeHookOptions, "actionOnForbidden" | "usePatchData" | "useUpdateData" | "method" - > + >, ): void => { const method = getMethodName(context, options); @@ -238,7 +238,7 @@ const checkData = ( `${method}-data`, subject(modelName, data), modelName, - options + options, ); }; @@ -247,7 +247,7 @@ const handleMulti = async ( ability: AnyAbility, modelName: string, availableFields: string[] | undefined, - options: AuthorizeHookOptions + options: AuthorizeHookOptions, ): Promise => { const method = getMethodName(context, options); @@ -276,7 +276,7 @@ const handleMulti = async ( modelName, context.params?.query, context.service, - options + options, ); _set(context, "params.query", query); diff --git a/src/hooks/authorize/authorize.hook.ts b/src/hooks/authorize/authorize.hook.ts index 16a8c9d..af807d0 100644 --- a/src/hooks/authorize/authorize.hook.ts +++ b/src/hooks/authorize/authorize.hook.ts @@ -10,7 +10,7 @@ import type { AuthorizeHookOptions } from "../../types"; export const authorize = ( - _options?: Partial + _options?: Partial, ) => async (context: H, next?: NextFunction) => { if ( diff --git a/src/hooks/authorize/authorize.hook.utils.ts b/src/hooks/authorize/authorize.hook.utils.ts index fcb1079..5bd55b3 100644 --- a/src/hooks/authorize/authorize.hook.utils.ts +++ b/src/hooks/authorize/authorize.hook.utils.ts @@ -33,14 +33,14 @@ export const HOOKNAME = "authorize"; export const makeOptions = ( app: A, - options?: Partial + options?: Partial, ): AuthorizeHookOptions => { options = options || {}; return Object.assign( makeDefaultBaseOptions(), defaultOptions, getAppOptions(app), - options + options, ); }; @@ -56,13 +56,13 @@ const defaultOptions: AuthorizeHookOptionsExclusive = { }; export const makeDefaultOptions = ( - options?: Partial + options?: Partial, ): AuthorizeHookOptions => { return Object.assign(makeDefaultBaseOptions(), defaultOptions, options); }; const getAppOptions = ( - app: Application + app: Application, ): AuthorizeHookOptions | Record => { const caslOptions: InitOptions = app?.get("casl"); return caslOptions && caslOptions.authorizeHook @@ -72,7 +72,7 @@ const getAppOptions = ( export const getAdapter = ( app: Application, - options: Pick + options: Pick, ): Adapter => { if (options.adapter) { return options.adapter; @@ -89,7 +89,7 @@ export const getAbility = ( options?: Pick< HookBaseOptions, "ability" | "checkAbilityForInternal" | "method" - > + >, ): Promise => { const method = getMethodName(context, options); @@ -135,7 +135,7 @@ export const throwUnlessCan = >( method: string, resource: string | T, modelName: string, - options: Partial + options: Partial, ): boolean => { if (ability.cannot(method, resource)) { if (options.actionOnForbidden) options.actionOnForbidden(); @@ -149,7 +149,7 @@ export const throwUnlessCan = >( export const refetchItems = async ( context: HookContext, - params?: Params + params?: Params, ): Promise => { if (!context.result) { return; @@ -178,7 +178,7 @@ export const getConditionalSelect = ( $select: string[], ability: AnyAbility, method: string, - modelName: string + modelName: string, ): undefined | string[] => { if (!$select?.length) { return undefined; @@ -199,7 +199,7 @@ export const checkMulti = ( context: HookContext, ability: AnyAbility, modelName: string, - options?: Pick + options?: Pick, ): boolean => { const method = getMethodName(context, options); const currentIsMulti = isMulti(context); @@ -220,31 +220,31 @@ export const checkMulti = ( export const setPersistedConfig = ( context: HookContext, key: Path, - val: unknown + val: unknown, ): HookContext => { return _set(context, `params.casl.${key}`, val); }; export function getPersistedConfig( context: HookContext, - key: "ability" + key: "ability", ): | AnyAbility | ((context: HookContext) => Promisable) | undefined; export function getPersistedConfig( context: HookContext, - key: "skipRestrictingRead.conditions" + key: "skipRestrictingRead.conditions", ): boolean; export function getPersistedConfig( context: HookContext, - key: "skipRestrictingRead.fields" + key: "skipRestrictingRead.fields", ): boolean; export function getPersistedConfig( context: HookContext, - key: "madeBasicCheck" + key: "madeBasicCheck", ): boolean; -// eslint-disable-next-line @typescript-eslint/no-explicit-any + export function getPersistedConfig(context: HookContext, key: Path): any { return _get(context, `params.casl.${key}`); } diff --git a/src/hooks/checkBasicPermission.hook.ts b/src/hooks/checkBasicPermission.hook.ts index e6b2f70..fd1febe 100644 --- a/src/hooks/checkBasicPermission.hook.ts +++ b/src/hooks/checkBasicPermission.hook.ts @@ -7,7 +7,7 @@ import { checkBasicPermissionUtil } from "../utils"; const HOOKNAME = "checkBasicPermission"; export const checkBasicPermission = ( - _options?: Partial + _options?: Partial, ): ((context: H) => Promise) => { return async (context: H): Promise => { if ( diff --git a/src/hooks/common.ts b/src/hooks/common.ts index 14d7cb0..be21a1b 100644 --- a/src/hooks/common.ts +++ b/src/hooks/common.ts @@ -36,7 +36,7 @@ export const checkCreatePerItem = ( > & Partial< Pick - > + >, ): HookContext => { const method = getMethodName(context, options); if (method !== "create" || !options.checkCreateForData) { @@ -61,7 +61,7 @@ export const checkCreatePerItem = ( method, subject(modelName, items[i]), modelName, - options + options, ); } diff --git a/src/initialize.ts b/src/initialize.ts index 0d0b52b..6862a65 100644 --- a/src/initialize.ts +++ b/src/initialize.ts @@ -11,23 +11,23 @@ import type { } from "./types"; export const initialize = ( - options?: PartialDeep + options?: PartialDeep, ): ((app: Application) => void) => { // eslint-disable-next-line @typescript-eslint/ban-ts-comment //@ts-ignore if (options?.version) { // asserts that you call app.configure(casl({})) instead of app.configure(casl) throw new Error( - "You passed 'feathers-casl' to app.configure() without a function. You probably wanted to call app.configure(casl({}))!" + "You passed 'feathers-casl' to app.configure() without a function. You probably wanted to call app.configure(casl({}))!", ); } options = { defaultAdapter: options?.defaultAdapter || "@feathersjs/memory", authorizeHook: makeDefaultAuthorizeHookOptions( - options?.authorizeHook as undefined | Partial + options?.authorizeHook as undefined | Partial, ), channels: makeDefaultChannelsOptions( - options?.channels as undefined | Partial + options?.channels as undefined | Partial, ), }; return (app: Application): void => { diff --git a/src/types.ts b/src/types.ts index f9503e7..41bc5df 100644 --- a/src/types.ts +++ b/src/types.ts @@ -6,7 +6,6 @@ import type { RealTimeConnection, } from "@feathersjs/transport-commons"; -// eslint-disable-next-line @typescript-eslint/no-explicit-any export type AnyData = Record; export type Adapter = @@ -40,18 +39,18 @@ export interface HookBaseOptions { } export interface CheckBasicPermissionHookOptions< - H extends HookContext = HookContext + H extends HookContext = HookContext, > extends HookBaseOptions { checkCreateForData: boolean | ((context: H) => boolean); storeAbilityForAuthorize: boolean; } export type CheckBasicPermissionUtilsOptions< - H extends HookContext = HookContext + H extends HookContext = HookContext, > = Omit, "notSkippable">; export type CheckBasicPermissionHookOptionsExclusive< - H extends HookContext = HookContext + H extends HookContext = HookContext, > = Pick< CheckBasicPermissionHookOptions, Exclude @@ -63,7 +62,7 @@ export type AvailableFieldsOption = | undefined; export interface AuthorizeChannelCommonsOptions< - H extends HookContext = HookContext + H extends HookContext = HookContext, > { availableFields: AvailableFieldsOption; } @@ -95,7 +94,7 @@ export interface ChannelOptions extends AuthorizeChannelCommonsOptions { app: Application, connection: RealTimeConnection, data: unknown, - context: HookContext + context: HookContext, ) => AnyAbility); /** Easy way to disable filtering, default: `false` */ activated: boolean; diff --git a/src/utils/checkBasicPermission.ts b/src/utils/checkBasicPermission.ts index f4e0fec..7025ea6 100644 --- a/src/utils/checkBasicPermission.ts +++ b/src/utils/checkBasicPermission.ts @@ -21,7 +21,7 @@ const defaultOptions: CheckBasicPermissionHookOptionsExclusive = { }; const makeOptions = ( - options?: Partial + options?: Partial, ): CheckBasicPermissionUtilsOptions => { options = options || {}; return Object.assign(makeDefaultBaseOptions(), defaultOptions, options); @@ -29,7 +29,7 @@ const makeOptions = ( export const checkBasicPermissionUtil = async ( context: H, - _options?: Partial + _options?: Partial, ): Promise => { let options = makeOptions(_options); diff --git a/src/utils/checkCan.ts b/src/utils/checkCan.ts index 78e8ce8..e7705b3 100644 --- a/src/utils/checkCan.ts +++ b/src/utils/checkCan.ts @@ -8,10 +8,9 @@ import type { Id, Service } from "@feathersjs/feathers"; import type { UtilCheckCanOptions } from "../types"; const makeOptions = ( - providedOptions?: Partial + providedOptions?: Partial, ): UtilCheckCanOptions => { return { - // eslint-disable-next-line @typescript-eslint/no-empty-function actionOnForbidden: () => {}, checkGeneral: true, skipThrow: false, @@ -26,7 +25,7 @@ export const checkCan = async ( method: string, modelName: string, service: Service, - providedOptions?: Partial + providedOptions?: Partial, ): Promise => { const options = makeOptions(providedOptions); if (options.checkGeneral) { @@ -55,7 +54,7 @@ export const checkCan = async ( method, subject(modelName, item), modelName, - options + options, ); return can; diff --git a/src/utils/convertRuleToQuery.ts b/src/utils/convertRuleToQuery.ts index fa160c9..9c847b4 100644 --- a/src/utils/convertRuleToQuery.ts +++ b/src/utils/convertRuleToQuery.ts @@ -21,7 +21,7 @@ const supportedOperators = Object.keys(invertedMap); const invertedProp = ( prop: Record, - name: string + name: string, ): Record | string | undefined => { // @ts-expect-error `name` maybe is not in `invertedMap` const map = invertedMap[name]; @@ -33,9 +33,8 @@ const invertedProp = ( }; export const convertRuleToQuery = ( - // eslint-disable-next-line @typescript-eslint/no-explicit-any rule: SubjectRawRule> | ClaimRawRule, - options?: GetConditionalQueryOptions + options?: GetConditionalQueryOptions, ): Query | undefined => { const { conditions, inverted } = rule; if (!conditions) { @@ -48,7 +47,6 @@ export const convertRuleToQuery = ( const newConditions = {} as Query; for (const prop in conditions as Record) { if (_isPlainObject(conditions[prop])) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any const obj: any = conditions[prop]; for (const name in obj) { if (!supportedOperators.includes(name)) { diff --git a/src/utils/couldHaveRestrictingFields.ts b/src/utils/couldHaveRestrictingFields.ts index b7aff06..c5a0174 100644 --- a/src/utils/couldHaveRestrictingFields.ts +++ b/src/utils/couldHaveRestrictingFields.ts @@ -3,7 +3,7 @@ import type { AnyAbility } from "@casl/ability"; export function couldHaveRestrictingFields( ability: AnyAbility, action: string, - subjectType: string + subjectType: string, ): boolean { return ability.possibleRulesFor(action, subjectType).some((rule) => { return !!rule.fields; diff --git a/src/utils/getAvailableFields.ts b/src/utils/getAvailableFields.ts index 335cca9..bf327b7 100644 --- a/src/utils/getAvailableFields.ts +++ b/src/utils/getAvailableFields.ts @@ -3,11 +3,11 @@ import type { AuthorizeChannelCommonsOptions } from "../types"; export const getAvailableFields = ( context: HookContext, - options?: Partial> + options?: Partial>, ): undefined | string[] => { return !options?.availableFields ? undefined : typeof options.availableFields === "function" - ? options.availableFields(context) - : options.availableFields; + ? options.availableFields(context) + : options.availableFields; }; diff --git a/src/utils/getFieldsForConditions.ts b/src/utils/getFieldsForConditions.ts index 52e7c54..0e0f899 100644 --- a/src/utils/getFieldsForConditions.ts +++ b/src/utils/getFieldsForConditions.ts @@ -3,7 +3,7 @@ import type { AnyAbility } from "@casl/ability"; export const getFieldsForConditions = ( ability: AnyAbility, action: string, - modelName: string + modelName: string, ): string[] => { const rules = ability.possibleRulesFor(action, modelName); const allFields: string[] = []; diff --git a/src/utils/getMethodName.ts b/src/utils/getMethodName.ts index 7ae1dcc..6623c2f 100644 --- a/src/utils/getMethodName.ts +++ b/src/utils/getMethodName.ts @@ -2,7 +2,7 @@ import type { HookContext } from "@feathersjs/feathers"; export const getMethodName = ( context: HookContext, - options?: { method?: string | ((context: HookContext) => string) } + options?: { method?: string | ((context: HookContext) => string) }, ): string => { if (options?.method) { if (typeof options.method === "function") { diff --git a/src/utils/getMinimalFields.ts b/src/utils/getMinimalFields.ts index 3a9c1cf..cb8dfda 100644 --- a/src/utils/getMinimalFields.ts +++ b/src/utils/getMinimalFields.ts @@ -8,7 +8,7 @@ export const getMinimalFields = ( ability: AnyAbility, action: string, subject: Record, - options: GetMinimalFieldsOptions + options: GetMinimalFieldsOptions, ): string[] => { if (options.checkCan && !ability.can(action, subject)) { return []; diff --git a/src/utils/getModelName.ts b/src/utils/getModelName.ts index 5e00e02..2de76a5 100644 --- a/src/utils/getModelName.ts +++ b/src/utils/getModelName.ts @@ -2,7 +2,7 @@ import type { HookContext } from "@feathersjs/feathers"; export const getModelName = ( modelName: string | ((context: HookContext) => string), - context: HookContext + context: HookContext, ): string => { if (modelName === undefined) { return context.path; diff --git a/src/utils/hasRestrictingConditions.ts b/src/utils/hasRestrictingConditions.ts index 717d3ba..0132048 100644 --- a/src/utils/hasRestrictingConditions.ts +++ b/src/utils/hasRestrictingConditions.ts @@ -4,7 +4,7 @@ import type { Rule } from "@casl/ability/dist/types/Rule"; export const hasRestrictingConditions = ( ability: AnyAbility, action: string, - modelName: string + modelName: string, ): Rule[] | false => { const rules = ability.possibleRulesFor(action, modelName); const hasConditions = rules.length === 0 || rules.some((x) => !!x.conditions); diff --git a/src/utils/hasRestrictingFields.ts b/src/utils/hasRestrictingFields.ts index 3837a9a..7bf3237 100644 --- a/src/utils/hasRestrictingFields.ts +++ b/src/utils/hasRestrictingFields.ts @@ -19,7 +19,7 @@ export const hasRestrictingFields = ( ability: AnyAbility, action: string, subject: Subject, - options?: HasRestrictingFieldsOptions + options?: HasRestrictingFieldsOptions, ): boolean | string[] => { let fields: string[]; if (typeof subject !== "string") { @@ -30,7 +30,7 @@ export const hasRestrictingFields = ( { availableFields: options?.availableFields, checkCan: false, - } + }, ); } else { const permittedFieldsOfOptions: PermittedFieldsOptions = { @@ -43,7 +43,7 @@ export const hasRestrictingFields = ( ability, action, subject, - permittedFieldsOfOptions + permittedFieldsOfOptions, ); } diff --git a/src/utils/mergeQueryFromAbility.ts b/src/utils/mergeQueryFromAbility.ts index 4316840..41ac16e 100644 --- a/src/utils/mergeQueryFromAbility.ts +++ b/src/utils/mergeQueryFromAbility.ts @@ -32,7 +32,7 @@ export const mergeQueryFromAbility = ( modelName: string, originalQuery: Query, service: AdapterBase, - options: Pick + options: Pick, ): Query => { if (!hasRestrictingConditions(ability, method, modelName)) { return originalQuery; diff --git a/src/utils/simplifyQuery.ts b/src/utils/simplifyQuery.ts index ac7b242..dc69570 100644 --- a/src/utils/simplifyQuery.ts +++ b/src/utils/simplifyQuery.ts @@ -6,7 +6,7 @@ import type { Query } from "@feathersjs/feathers"; export const simplifyQuery = ( query: Q, replaceAnd = true, - replaceOr = true + replaceOr = true, ): Q => { if (!query) { return query; diff --git a/test/app/options.test.ts b/test/app/options.test.ts index 5173adc..88bd846 100644 --- a/test/app/options.test.ts +++ b/test/app/options.test.ts @@ -1,9 +1,7 @@ import assert from "node:assert"; -import type { Application, HookContext } from "@feathersjs/feathers"; import { feathers } from "@feathersjs/feathers"; import { MemoryService } from "@feathersjs/memory"; import { feathersCasl, authorize } from "../../src"; -import type { RealTimeConnection } from "@feathersjs/transport-commons"; import type { InitOptions } from "../../src"; import { defineAbility } from "@casl/ability"; @@ -17,7 +15,7 @@ const mockApp = () => { default: 10, max: 50, }, - }) + }), ); const service = app.service("users"); service.hooks({ @@ -56,8 +54,6 @@ describe("app-options / service-options", function () { let calledAbility = false; let calledModelName = false; - let calledChannelAbility = false; - let calledChannelModelName = false; app.configure( feathersCasl({ authorizeHook: { @@ -65,11 +61,11 @@ describe("app-options / service-options", function () { calledActionOnForbidden = true; }, checkMultiActions: true, - ability: (context: HookContext) => { + ability: () => { calledAbility = true; return defineAbility(() => {}); }, - modelName: (context: HookContext): string => { + modelName: (): string => { calledModelName = true; return "Test"; }, @@ -78,22 +74,17 @@ describe("app-options / service-options", function () { channels: { activated: false, channelOnError: ["Test"], - ability: ( - app: Application, - connection: RealTimeConnection, - data: unknown, - context: HookContext - ) => { + ability: () => { calledChannelAbility = true; return defineAbility(() => {}); }, - modelName: (context: HookContext): string => { + modelName: (): string => { calledChannelModelName = true; return "Test"; }, restrictFields: false, }, - }) + }), ); const caslOptions: InitOptions = app.get("casl"); @@ -106,7 +97,7 @@ describe("app-options / service-options", function () { query: {}, }), (err: Error) => err.name === "Forbidden", - "throws Forbidden for no ability" + "throws Forbidden for no ability", ); assert.ok(calledAbility, "called ability function"); @@ -127,7 +118,7 @@ describe("app-options / service-options", function () { default: 10, max: 50, }, - }) + }), ); const appCalled: CalledOptions = {}; const serviceCalled: CalledOptions = {}; @@ -141,11 +132,11 @@ describe("app-options / service-options", function () { serviceCalled.calledActionOnForbidden = true; }, checkMultiActions: true, - ability: (context: HookContext) => { + ability: () => { serviceCalled.calledAbility = true; return defineAbility(() => {}); }, - modelName: (context: HookContext): string => { + modelName: (): string => { serviceCalled.calledModelName = true; return "Test"; }, @@ -162,16 +153,16 @@ describe("app-options / service-options", function () { }, checkAbilityForInternal: true, checkMultiActions: true, - ability: (context: HookContext) => { + ability: () => { appCalled.calledAbility = true; return defineAbility(() => {}); }, - modelName: (context: HookContext): string => { + modelName: (): string => { appCalled.calledModelName = true; return "Test"; }, }, - }) + }), ); await assert.rejects( @@ -179,33 +170,33 @@ describe("app-options / service-options", function () { query: {}, }), (err: Error) => err.name === "Forbidden", - "throws Forbidden for no ability" + "throws Forbidden for no ability", ); assert.ok( serviceCalled.calledAbility, - "called ability function from service options" + "called ability function from service options", ); assert.ok( serviceCalled.calledActionOnForbidden, - "called actionOnForbidden function from service options" + "called actionOnForbidden function from service options", ); assert.ok( serviceCalled.calledModelName, - "called modelName function from service options" + "called modelName function from service options", ); assert.ok( !appCalled.calledAbility, - "not called ability function from app options" + "not called ability function from app options", ); assert.ok( !appCalled.calledActionOnForbidden, - "not called actionOnForbidden function from app options" + "not called actionOnForbidden function from app options", ); assert.ok( !appCalled.calledModelName, - "not called modelName function from app options" + "not called modelName function from app options", ); //assert.ok(calledChannelAbility, "called ability function on channels"); diff --git a/test/channels/.mockServer/index.ts b/test/channels/.mockServer/index.ts index 732c8bb..d6b1c0b 100644 --- a/test/channels/.mockServer/index.ts +++ b/test/channels/.mockServer/index.ts @@ -35,7 +35,7 @@ export const mockServer = (options: MockServerOptions) => { app.use( helmet({ contentSecurityPolicy: false, - }) + }), ); app.use(cors()); app.use(json()); diff --git a/test/channels/channels.utils.test.ts b/test/channels/channels.utils.test.ts index d7073c6..040597d 100644 --- a/test/channels/channels.utils.test.ts +++ b/test/channels/channels.utils.test.ts @@ -9,17 +9,17 @@ describe("channels.utils.test.ts", function () { assert.deepStrictEqual( options.channelOnError, ["authenticated"], - "returns 'authenticated' by default" + "returns 'authenticated' by default", ); assert.strictEqual( options.restrictFields, true, - "restrict Fields by default" + "restrict Fields by default", ); assert.strictEqual( options.useActionName, "get", - "use native eventName by default" + "use native eventName by default", ); }); diff --git a/test/channels/custom-actions/channels.custom-actions.test.ts b/test/channels/custom-actions/channels.custom-actions.test.ts index 1c352ed..ff7e178 100644 --- a/test/channels/custom-actions/channels.custom-actions.test.ts +++ b/test/channels/custom-actions/channels.custom-actions.test.ts @@ -29,7 +29,7 @@ describe("channels.custom-actions.test.ts", function () { channels: channels1, services: services1, }); - // eslint-disable-next-line prefer-destructuring + app = mock.app; const port = await getPort(); @@ -71,11 +71,11 @@ describe("channels.custom-actions.test.ts", function () { methodName: string, event: string, expectedPerClient: unknown, - i: number + i: number, ) => { assert.ok( Object.prototype.hasOwnProperty.call(expectedPerClient, i), - `client${i} has expected value` + `client${i} has expected value`, ); const expected = expectedPerClient[i]; const fulFill = new Promise((resolve) => { @@ -84,7 +84,7 @@ describe("channels.custom-actions.test.ts", function () { assert.deepStrictEqual( result, expected, - `'client${i}:${servicePath}:${methodName}': result is expected` + `'client${i}:${servicePath}:${methodName}': result is expected`, ); } resolve(result); @@ -96,23 +96,23 @@ describe("channels.custom-actions.test.ts", function () { promiseTimeout( 100, fulFill, - `'client${i}:${servicePath}:${methodName}': timeout` + `'client${i}:${servicePath}:${methodName}': timeout`, ).finally(() => { clients[i].service(servicePath).removeAllListeners(event); }), - `'client${i}:${servicePath}:${methodName}': receives message` + `'client${i}:${servicePath}:${methodName}': receives message`, ); } else { await assert.rejects( promiseTimeout( 80, fulFill, - `'client${i}:${servicePath}:${methodName}': timeout` + `'client${i}:${servicePath}:${methodName}': timeout`, ).finally(() => { clients[i].service(servicePath).removeAllListeners(event); }), () => true, - `'client${i}:${servicePath}:${methodName}': does not receive message` + `'client${i}:${servicePath}:${methodName}': does not receive message`, ); } }; @@ -191,7 +191,7 @@ describe("channels.custom-actions.test.ts", function () { const { event, params, expectedPerClient } = method; const promises = clients.map((client, i) => - checkClient(servicePath, methodName, event, expectedPerClient, i) + checkClient(servicePath, methodName, event, expectedPerClient, i), ); service[methodName](...params); diff --git a/test/channels/custom-actions/mockChannels.custom-actions.ts b/test/channels/custom-actions/mockChannels.custom-actions.ts index 3902fc4..3382d84 100644 --- a/test/channels/custom-actions/mockChannels.custom-actions.ts +++ b/test/channels/custom-actions/mockChannels.custom-actions.ts @@ -40,7 +40,6 @@ export default function (app: Application): void { }, }); - //@ts-ignore const fields = caslOptions.availableFields({ service: app.service("users"), }); @@ -48,16 +47,15 @@ export default function (app: Application): void { assert.deepStrictEqual( fields, ["id", "email", "password"], - "gets availableFields from service correctly" + "gets availableFields from service correctly", ); - // eslint-disable-next-line @typescript-eslint/no-unused-vars app.publish((data: unknown, context: HookContext) => { const result = getChannelsWithReadAbility( app, data as Record, context, - caslOptions + caslOptions, ); // e.g. to publish all service events to all authenticated users use diff --git a/test/channels/custom-actions/mockServices.custom-actions.ts b/test/channels/custom-actions/mockServices.custom-actions.ts index 4662785..10545b3 100644 --- a/test/channels/custom-actions/mockServices.custom-actions.ts +++ b/test/channels/custom-actions/mockServices.custom-actions.ts @@ -22,7 +22,7 @@ declare module "@feathersjs/memory" { const defineAbilitiesFor = (user) => { return defineAbility( - (can, cannot) => { + (can) => { if (user.id === 0) { can("manage", "all"); } else if (user.id === 1) { @@ -44,13 +44,13 @@ const defineAbilitiesFor = (user) => { "receive-patched", "receive-removed", ], - "all" + "all", ); } else if (user.id === 4) { can("receive-created", "comments", ["id"], { userId: user.id }); } }, - { resolveAction } + { resolveAction }, ); }; @@ -94,7 +94,7 @@ export default function (app: Application): void { availableFields: ["id", "test", "published", "test"], }, //paginate: - }) + }), ); //#endregion @@ -109,7 +109,7 @@ export default function (app: Application): void { availableFields: ["id", "title", "userId", "test"], }, //paginate: - }) + }), ); //#endregion @@ -123,7 +123,7 @@ export default function (app: Application): void { availableFields: ["id", "email", "password"], }, //paginate: - }) + }), ); const users = app.service("users"); diff --git a/test/channels/defaultSettings/channels.default.test.ts b/test/channels/defaultSettings/channels.default.test.ts index 226d2f2..7f147e5 100644 --- a/test/channels/defaultSettings/channels.default.test.ts +++ b/test/channels/defaultSettings/channels.default.test.ts @@ -21,7 +21,6 @@ describe("channels.default.test.ts", function () { let client4: Application; let user1: Record; let user2: Record; - let user3: Record; let users = [ { id: 0, email: "1", password: "1" }, { id: 1, email: "2", password: "2" }, @@ -33,7 +32,7 @@ describe("channels.default.test.ts", function () { channels: channels1, services: services1, }); - // eslint-disable-next-line prefer-destructuring + app = mock.app; const port = await getPort(); @@ -69,8 +68,7 @@ describe("channels.default.test.ts", function () { promises.push(promise); } else if (i === 2) { client3 = client; - // eslint-disable-next-line @typescript-eslint/no-unused-vars - user3 = user; + const promise = client3.service("authentication").create({ strategy: "local", email: "3", @@ -127,7 +125,7 @@ describe("channels.default.test.ts", function () { assert.deepStrictEqual(result, expected, "result is full"); resolve(result); }); - //@ts-ignore + service[methodName](...params); }); @@ -135,11 +133,11 @@ describe("channels.default.test.ts", function () { promiseTimeout( 100, fulFill, - `timeout - '${servicePath}:${methodName}'` + `timeout - '${servicePath}:${methodName}'`, ).finally(() => { client1.service(servicePath).removeAllListeners(event); }), - "client1 receives message" + "client1 receives message", ); } } @@ -188,7 +186,6 @@ describe("channels.default.test.ts", function () { client2.service(servicePath).on(event, resolve); }); - //@ts-ignore service[methodName](...params); await Promise.all([ @@ -196,22 +193,22 @@ describe("channels.default.test.ts", function () { promiseTimeout( 60, fulFill1, - `timeout '${servicePath}:${methodName}'` + `timeout '${servicePath}:${methodName}'`, ).finally(() => { client1.service(servicePath).removeAllListeners(event); }), - "client1 receives message" + "client1 receives message", ), assert.rejects( promiseTimeout( 60, fulFill2, - `timeout '${servicePath}:${methodName}'` + `timeout '${servicePath}:${methodName}'`, ).finally(() => { client2.service(servicePath).removeAllListeners(event); }), () => true, - "client2 does not receive message" + "client2 does not receive message", ), ]); } @@ -258,19 +255,18 @@ describe("channels.default.test.ts", function () { }); }); - //@ts-ignore service[methodName](...params); await assert.doesNotReject( promiseTimeout( 100, fulFill2, - `timeout '${servicePath}:${methodName}'` + `timeout '${servicePath}:${methodName}'`, ).finally(() => { client1.service(servicePath).removeAllListeners(event); }), () => true, - "client2 receives message" + "client2 receives message", ); } } @@ -318,7 +314,7 @@ describe("channels.default.test.ts", function () { assert.deepStrictEqual( result, user1Expected, - `user1 with id '${user1.id}' with receives full comment for '${servicePath}:${methodName}'` + `user1 with id '${user1.id}' with receives full comment for '${servicePath}:${methodName}'`, ); resolve(result); }); @@ -329,13 +325,12 @@ describe("channels.default.test.ts", function () { assert.deepStrictEqual( result, user2Expected, - `user2 with id '${user2.id}' receives subset for '${servicePath}:${methodName}'` + `user2 with id '${user2.id}' receives subset for '${servicePath}:${methodName}'`, ); resolve(result); }); }); - //@ts-ignore service[methodName](...params); await Promise.all([ @@ -343,21 +338,21 @@ describe("channels.default.test.ts", function () { promiseTimeout( 100, fulFill1, - `timeout '${servicePath}:${methodName}'` + `timeout '${servicePath}:${methodName}'`, ).finally(() => { client1.service(servicePath).removeAllListeners(event); }), - "client1 receives event" + "client1 receives event", ), assert.doesNotReject( promiseTimeout( 100, fulFill2, - `timeout '${servicePath}:${methodName}'` + `timeout '${servicePath}:${methodName}'`, ).finally(() => { client2.service(servicePath).removeAllListeners(event); }), - "client2 receives event" + "client2 receives event", ), ]); } diff --git a/test/channels/defaultSettings/mockChannels.default.ts b/test/channels/defaultSettings/mockChannels.default.ts index 625685a..7e574ed 100644 --- a/test/channels/defaultSettings/mockChannels.default.ts +++ b/test/channels/defaultSettings/mockChannels.default.ts @@ -32,7 +32,6 @@ export default function (app: Application): void { const caslOptions = makeChannelOptions(app); - //@ts-ignore const fields = caslOptions.availableFields({ service: app.service("users"), }); @@ -40,16 +39,15 @@ export default function (app: Application): void { assert.deepStrictEqual( fields, undefined, - "gets availableFields from service correctly" + "gets availableFields from service correctly", ); - // eslint-disable-next-line @typescript-eslint/no-unused-vars app.publish((data: unknown, context: HookContext) => { const result = getChannelsWithReadAbility( app, data as Record, context, - caslOptions + caslOptions, ); // e.g. to publish all service events to all authenticated users use diff --git a/test/channels/defaultSettings/mockServices.default.ts b/test/channels/defaultSettings/mockServices.default.ts index c8eb79a..92cc80d 100644 --- a/test/channels/defaultSettings/mockServices.default.ts +++ b/test/channels/defaultSettings/mockServices.default.ts @@ -15,7 +15,7 @@ const resolveAction = createAliasResolver({ const defineAbilitiesFor = (user) => { return defineAbility( - (can, cannot) => { + (can) => { if (user.id === 0) { can("manage", "all"); } else if (user.id === 1) { @@ -25,7 +25,7 @@ const defineAbilitiesFor = (user) => { can("read", "comments", { userId: user.id }); } }, - { resolveAction } + { resolveAction }, ); }; @@ -66,7 +66,7 @@ export default function (app: Application): void { new MemoryService({ multi: true, //paginate: - }) + }), ); //#endregion @@ -78,7 +78,7 @@ export default function (app: Application): void { new MemoryService({ multi: true, //paginate: - }) + }), ); //#endregion @@ -89,7 +89,7 @@ export default function (app: Application): void { new MemoryService({ multi: true, //paginate: - }) + }), ); const users = app.service("users"); diff --git a/test/channels/receive/channels.receive.test.ts b/test/channels/receive/channels.receive.test.ts index a156118..d3f68c5 100644 --- a/test/channels/receive/channels.receive.test.ts +++ b/test/channels/receive/channels.receive.test.ts @@ -29,7 +29,7 @@ describe("channels.receive.test.ts", function () { channels: channels1, services: services1, }); - // eslint-disable-next-line prefer-destructuring + app = mock.app; const port = await getPort(); @@ -69,11 +69,11 @@ describe("channels.receive.test.ts", function () { methodName: string, event: string, expectedPerClient: unknown, - i: number + i: number, ) => { assert.ok( Object.prototype.hasOwnProperty.call(expectedPerClient, i), - `client${i} has expected value` + `client${i} has expected value`, ); const expected = expectedPerClient[i]; const fulFill = new Promise((resolve) => { @@ -82,7 +82,7 @@ describe("channels.receive.test.ts", function () { assert.deepStrictEqual( result, expected, - `'client${i}:${servicePath}:${methodName}': result is expected` + `'client${i}:${servicePath}:${methodName}': result is expected`, ); } resolve(result); @@ -94,23 +94,23 @@ describe("channels.receive.test.ts", function () { promiseTimeout( 100, fulFill, - `'client${i}:${servicePath}:${methodName}': does not receive message` + `'client${i}:${servicePath}:${methodName}': does not receive message`, ).finally(() => { clients[i].service(servicePath).removeAllListeners(event); }), - `'client${i}:${servicePath}:${methodName}': receives message` + `'client${i}:${servicePath}:${methodName}': receives message`, ); } else { await assert.rejects( promiseTimeout( 100, fulFill, - `'client${i}:${servicePath}:${methodName}': does not receive message` + `'client${i}:${servicePath}:${methodName}': does not receive message`, ).finally(() => { clients[i].service(servicePath).removeAllListeners(event); }), () => true, - `'client${i}:${servicePath}:${methodName}': does not receive message` + `'client${i}:${servicePath}:${methodName}': does not receive message`, ); } }; @@ -180,7 +180,7 @@ describe("channels.receive.test.ts", function () { const { event, params, expectedPerClient } = method; const promises = clients.map((client, i) => - checkClient(servicePath, methodName, event, expectedPerClient, i) + checkClient(servicePath, methodName, event, expectedPerClient, i), ); service[methodName](...params); diff --git a/test/channels/receive/mockChannels.receive.ts b/test/channels/receive/mockChannels.receive.ts index bed1517..efb865c 100644 --- a/test/channels/receive/mockChannels.receive.ts +++ b/test/channels/receive/mockChannels.receive.ts @@ -34,7 +34,6 @@ export default function (app: Application): void { useActionName: "receive", }); - //@ts-ignore const fields = caslOptions.availableFields({ service: app.service("users"), }); @@ -42,16 +41,15 @@ export default function (app: Application): void { assert.deepStrictEqual( fields, ["id", "email", "password"], - "gets availableFields from service correctly" + "gets availableFields from service correctly", ); - // eslint-disable-next-line @typescript-eslint/no-unused-vars app.publish((data: unknown, context: HookContext) => { const result = getChannelsWithReadAbility( app, data as Record, context, - caslOptions + caslOptions, ); // e.g. to publish all service events to all authenticated users use diff --git a/test/channels/receive/mockServices.receive.ts b/test/channels/receive/mockServices.receive.ts index e2fb2aa..5111f91 100644 --- a/test/channels/receive/mockServices.receive.ts +++ b/test/channels/receive/mockServices.receive.ts @@ -15,7 +15,7 @@ const resolveAction = createAliasResolver({ const defineAbilitiesFor = (user) => { return defineAbility( - (can, cannot) => { + (can) => { if (user.id === 0) { can("manage", "all"); } else if (user.id === 1) { @@ -29,7 +29,7 @@ const defineAbilitiesFor = (user) => { can("receive", "comments", ["id"], { userId: user.id }); } }, - { resolveAction } + { resolveAction }, ); }; @@ -73,7 +73,7 @@ export default function (app: Application): void { availableFields: ["id", "test", "published", "test"], }, //paginate: - }) + }), ); //#endregion @@ -88,7 +88,7 @@ export default function (app: Application): void { availableFields: ["id", "title", "userId", "test"], }, //paginate: - }) + }), ); //#endregion @@ -102,7 +102,7 @@ export default function (app: Application): void { availableFields: ["id", "email", "password"], }, //paginate: - }) + }), ); const users = app.service("users"); diff --git a/test/channels/withAvailableFields/channels.availableFields.test.ts b/test/channels/withAvailableFields/channels.availableFields.test.ts index 8b49b73..e83e303 100644 --- a/test/channels/withAvailableFields/channels.availableFields.test.ts +++ b/test/channels/withAvailableFields/channels.availableFields.test.ts @@ -21,7 +21,7 @@ describe("channels.availableFields.test.ts", function () { let client4: Application; let user1: Record; let user2: Record; - let user3: Record; + let users = [ { id: 0, email: "1", password: "1" }, { id: 1, email: "2", password: "2" }, @@ -33,7 +33,7 @@ describe("channels.availableFields.test.ts", function () { channels: channels1, services: services1, }); - // eslint-disable-next-line prefer-destructuring + app = mock.app; const port = await getPort(); @@ -72,8 +72,7 @@ describe("channels.availableFields.test.ts", function () { promises.push(promise); } else if (i === 2) { client3 = client; - // eslint-disable-next-line @typescript-eslint/no-unused-vars - user3 = user; + const promise = client3.service("authentication").create({ strategy: "local", email: "3", @@ -130,7 +129,7 @@ describe("channels.availableFields.test.ts", function () { assert.deepStrictEqual(result, expected, "result is full"); resolve(result); }); - //@ts-ignore + service[methodName](...params); }); @@ -138,11 +137,11 @@ describe("channels.availableFields.test.ts", function () { promiseTimeout( 100, fulFill, - `timeout - '${servicePath}:${methodName}'` + `timeout - '${servicePath}:${methodName}'`, ).finally(() => { client1.service(servicePath).removeAllListeners(event); }), - "client1 receives message" + "client1 receives message", ); } } @@ -191,7 +190,6 @@ describe("channels.availableFields.test.ts", function () { client2.service(servicePath).on(event, resolve); }); - //@ts-ignore service[methodName](...params); await Promise.all([ @@ -199,22 +197,22 @@ describe("channels.availableFields.test.ts", function () { promiseTimeout( 60, fulFill1, - `timeout '${servicePath}:${methodName}'` + `timeout '${servicePath}:${methodName}'`, ).finally(() => { client1.service(servicePath).removeAllListeners(event); }), - "client1 receives message" + "client1 receives message", ), assert.rejects( promiseTimeout( 60, fulFill2, - `timeout '${servicePath}:${methodName}'` + `timeout '${servicePath}:${methodName}'`, ).finally(() => { client2.service(servicePath).removeAllListeners(event); }), () => true, - "client2 does not receive message" + "client2 does not receive message", ), ]); } @@ -261,19 +259,18 @@ describe("channels.availableFields.test.ts", function () { }); }); - //@ts-ignore service[methodName](...params); await assert.doesNotReject( promiseTimeout( 100, fulFill2, - `timeout '${servicePath}:${methodName}'` + `timeout '${servicePath}:${methodName}'`, ).finally(() => { client1.service(servicePath).removeAllListeners(event); }), () => true, - "client2 receives message" + "client2 receives message", ); } } @@ -321,7 +318,7 @@ describe("channels.availableFields.test.ts", function () { assert.deepStrictEqual( result, user1Expected, - `user1 with id '${user1.id}' with receives full comment for '${servicePath}:${methodName}'` + `user1 with id '${user1.id}' with receives full comment for '${servicePath}:${methodName}'`, ); resolve(result); }); @@ -332,13 +329,12 @@ describe("channels.availableFields.test.ts", function () { assert.deepStrictEqual( result, user2Expected, - `user2 with id '${user2.id}' receives subset for '${servicePath}:${methodName}'` + `user2 with id '${user2.id}' receives subset for '${servicePath}:${methodName}'`, ); resolve(result); }); }); - //@ts-ignore service[methodName](...params); await Promise.all([ @@ -346,21 +342,21 @@ describe("channels.availableFields.test.ts", function () { promiseTimeout( 100, fulFill1, - `timeout '${servicePath}:${methodName}'` + `timeout '${servicePath}:${methodName}'`, ).finally(() => { client1.service(servicePath).removeAllListeners(event); }), - "client1 receives event" + "client1 receives event", ), assert.doesNotReject( promiseTimeout( 100, fulFill2, - `timeout '${servicePath}:${methodName}'` + `timeout '${servicePath}:${methodName}'`, ).finally(() => { client2.service(servicePath).removeAllListeners(event); }), - "client2 receives event" + "client2 receives event", ), ]); } diff --git a/test/channels/withAvailableFields/mockChannels.availableFields.ts b/test/channels/withAvailableFields/mockChannels.availableFields.ts index cf42614..dbf0f0b 100644 --- a/test/channels/withAvailableFields/mockChannels.availableFields.ts +++ b/test/channels/withAvailableFields/mockChannels.availableFields.ts @@ -32,7 +32,6 @@ export default function (app: Application): void { const caslOptions = makeChannelOptions(app); - //@ts-ignore const fields = caslOptions.availableFields({ service: app.service("users"), }); @@ -40,16 +39,15 @@ export default function (app: Application): void { assert.deepStrictEqual( fields, ["id", "email", "password"], - "gets availableFields from service correctly" + "gets availableFields from service correctly", ); - // eslint-disable-next-line @typescript-eslint/no-unused-vars app.publish((data: unknown, context: HookContext) => { const result = getChannelsWithReadAbility( app, data as Record, context, - caslOptions + caslOptions, ); // e.g. to publish all service events to all authenticated users use diff --git a/test/channels/withAvailableFields/mockServices.availableFields.ts b/test/channels/withAvailableFields/mockServices.availableFields.ts index 75c20da..ef0234e 100644 --- a/test/channels/withAvailableFields/mockServices.availableFields.ts +++ b/test/channels/withAvailableFields/mockServices.availableFields.ts @@ -22,7 +22,7 @@ declare module "@feathersjs/Memory" { const defineAbilitiesFor = (user) => { return defineAbility( - (can, cannot) => { + (can) => { if (user.id === 0) { can("manage", "all"); } else if (user.id === 1) { @@ -32,7 +32,7 @@ const defineAbilitiesFor = (user) => { can("read", "comments", { userId: user.id }); } }, - { resolveAction } + { resolveAction }, ); }; @@ -76,7 +76,7 @@ export default function (app: Application): void { availableFields: ["id", "test", "published", "test"], }, //paginate: - }) + }), ); //#endregion @@ -91,7 +91,7 @@ export default function (app: Application): void { availableFields: ["id", "title", "userId", "test"], }, //paginate: - }) + }), ); //#endregion @@ -105,7 +105,7 @@ export default function (app: Application): void { availableFields: ["id", "email", "password"], }, //paginate: - }) + }), ); const users = app.service("users"); diff --git a/test/hooks/authorize.users.test.ts b/test/hooks/authorize.users.test.ts index 30449ec..cdce8a0 100644 --- a/test/hooks/authorize.users.test.ts +++ b/test/hooks/authorize.users.test.ts @@ -1,5 +1,5 @@ import assert from "node:assert"; -import { createAliasResolver, defineAbility } from "@casl/ability"; +import { defineAbility } from "@casl/ability"; import { Sequelize, Op, DataTypes } from "sequelize"; import { feathers } from "@feathersjs/feathers"; import { SequelizeService } from "feathers-sequelize"; @@ -20,7 +20,7 @@ describe("authorize.users.test.ts", function () { }, { resolveAction, - } + }, ); return ability; } @@ -57,7 +57,7 @@ describe("authorize.users.test.ts", function () { $not: Op.not, }, operators: ["$not"], - }) + }), ); const service = app.service("users"); @@ -118,7 +118,7 @@ describe("authorize.users.test.ts", function () { const user2Patched: Record = await service.patch( user2.id, { roleId: 3 }, - { ability } + { ability }, ); assert.deepStrictEqual(user2Patched.roleId, 3); assert.ok(hadAbility); diff --git a/test/hooks/authorize/adapters/@feathersjs/knex.test.ts b/test/hooks/authorize/adapters/@feathersjs/knex.test.ts index e8a5dab..610c4fa 100644 --- a/test/hooks/authorize/adapters/@feathersjs/knex.test.ts +++ b/test/hooks/authorize/adapters/@feathersjs/knex.test.ts @@ -94,5 +94,5 @@ makeTests( }); }, { adapter }, - { afterHooks } + { afterHooks }, ); diff --git a/test/hooks/authorize/adapters/@feathersjs/memory.around.test.ts b/test/hooks/authorize/adapters/@feathersjs/memory.around.test.ts index be09856..2ceeb96 100644 --- a/test/hooks/authorize/adapters/@feathersjs/memory.around.test.ts +++ b/test/hooks/authorize/adapters/@feathersjs/memory.around.test.ts @@ -45,5 +45,5 @@ makeTests( await service._remove(null); }, { adapter: adapter }, - { around: true } + { around: true }, ); diff --git a/test/hooks/authorize/adapters/@feathersjs/memory.test.ts b/test/hooks/authorize/adapters/@feathersjs/memory.test.ts index eae6cb4..a36b97a 100644 --- a/test/hooks/authorize/adapters/@feathersjs/memory.test.ts +++ b/test/hooks/authorize/adapters/@feathersjs/memory.test.ts @@ -44,5 +44,5 @@ makeTests( async (app, service) => { await service.remove(null); }, - { adapter: adapter } + { adapter: adapter }, ); diff --git a/test/hooks/authorize/adapters/@feathersjs/mongodb.test.ts b/test/hooks/authorize/adapters/@feathersjs/mongodb.test.ts index bce5fb9..11fc14a 100644 --- a/test/hooks/authorize/adapters/@feathersjs/mongodb.test.ts +++ b/test/hooks/authorize/adapters/@feathersjs/mongodb.test.ts @@ -56,5 +56,5 @@ makeTests( async (app, service) => { await service.remove(null); }, - { adapter } + { adapter }, ); diff --git a/test/hooks/authorize/adapters/feathers-mongoose.test_.ts b/test/hooks/authorize/adapters/feathers-mongoose.test_.ts index a59d84a..c9e6ea3 100644 --- a/test/hooks/authorize/adapters/feathers-mongoose.test_.ts +++ b/test/hooks/authorize/adapters/feathers-mongoose.test_.ts @@ -76,12 +76,12 @@ makeTests( }, { timestamps: false, - } + }, ); if (client.modelNames().includes("tests")) { client.deleteModel("tests"); } Model = client.model("tests", schema); - } + }, ); diff --git a/test/hooks/authorize/adapters/feathers-nedb.test_.ts b/test/hooks/authorize/adapters/feathers-nedb.test_.ts index abbc5b0..6aa03fa 100644 --- a/test/hooks/authorize/adapters/feathers-nedb.test_.ts +++ b/test/hooks/authorize/adapters/feathers-nedb.test_.ts @@ -45,5 +45,5 @@ makeTests( async (app, service) => { await service.remove(null); }, - { adapter: "feathers-nedb" } + { adapter: "feathers-nedb" }, ); diff --git a/test/hooks/authorize/adapters/feathers-objection.test_.ts b/test/hooks/authorize/adapters/feathers-objection.test_.ts index e8aef50..4860b3e 100644 --- a/test/hooks/authorize/adapters/feathers-objection.test_.ts +++ b/test/hooks/authorize/adapters/feathers-objection.test_.ts @@ -2,7 +2,7 @@ import { Model } from "objection"; import makeTests from "./makeTests"; import { Service } from "feathers-objection"; import { getItemsIsArray } from "feathers-utils"; -import { knex } from "knex"; +import knex from "knex"; import path from "node:path"; import type { ServiceCaslOptions } from "../../../../src"; import type { HookContext } from "@feathersjs/feathers"; @@ -111,5 +111,5 @@ makeTests( }); }, { adapter: "feathers-objection" }, - afterHooks + afterHooks, ); diff --git a/test/hooks/authorize/adapters/feathers-sequelize.test.ts b/test/hooks/authorize/adapters/feathers-sequelize.test.ts index 2d45a09..29bc882 100644 --- a/test/hooks/authorize/adapters/feathers-sequelize.test.ts +++ b/test/hooks/authorize/adapters/feathers-sequelize.test.ts @@ -33,7 +33,7 @@ const Model = sequelize.define( }, { timestamps: false, - } + }, ); declare module "feathers-sequelize" { @@ -85,7 +85,7 @@ const afterHooks = [ delete item[key]; return; } - // @ts-ignore + if (field.type instanceof DataTypes.BOOLEAN) { item[key] = !!item[key]; } @@ -101,5 +101,5 @@ makeTests( await Model.sync({ force: true }); }, { adapter: "feathers-sequelize" }, - { afterHooks } + { afterHooks }, ); diff --git a/test/hooks/authorize/adapters/makeTests/create-multi.ts b/test/hooks/authorize/adapters/makeTests/create-multi.ts index 4d24abd..2fb816c 100644 --- a/test/hooks/authorize/adapters/makeTests/create-multi.ts +++ b/test/hooks/authorize/adapters/makeTests/create-multi.ts @@ -1,6 +1,6 @@ import assert from "node:assert"; import { feathers } from "@feathersjs/feathers"; -import { createAliasResolver, defineAbility } from "@casl/ability"; +import { defineAbility } from "@casl/ability"; import _sortBy from "lodash/sortBy.js"; import type { Application } from "@feathersjs/feathers"; @@ -15,19 +15,19 @@ export default ( makeService: () => any, clean: (app, service) => Promise, authorizeHookOptions: Partial, - { around, afterHooks }: MakeTestsOptions = { around: false, afterHooks: [] } + { around, afterHooks }: MakeTestsOptions = { around: false, afterHooks: [] }, ): void => { let app: Application; let service; let id; - const itSkip = (adapterToTest: string | string[]) => { - const condition = - typeof adapterToTest === "string" - ? adapterName === adapterToTest - : adapterToTest.includes(adapterName); - return condition ? it.skip : it; - }; + // const itSkip = (adapterToTest: string | string[]) => { + // const condition = + // typeof adapterToTest === "string" + // ? adapterName === adapterToTest + // : adapterToTest.includes(adapterName); + // return condition ? it.skip : it; + // }; describe(`${adapterName}: beforeAndAfter - create:multi`, function () { beforeEach(async function () { @@ -35,7 +35,6 @@ export default ( app.use("tests", makeService()); service = app.service("tests"); - // eslint-disable-next-line prefer-destructuring id = service.options.id; const options = Object.assign( @@ -50,14 +49,14 @@ export default ( "hidden", ], }, - authorizeHookOptions + authorizeHookOptions, ); afterHooks = Array.isArray(afterHooks) ? afterHooks : afterHooks - ? [afterHooks] - : []; + ? [afterHooks] + : []; if (around) { service.hooks({ @@ -97,7 +96,7 @@ export default ( (can) => { can("create", "tests", { userId: 1 }); }, - { resolveAction } + { resolveAction }, ), }); @@ -112,7 +111,7 @@ export default ( assert.strictEqual( allItems.length, 0, - `has no items before for read: '${read}'` + `has no items before for read: '${read}'`, ); const itemsArr = [ { test: true, hi: "1", userId: 1 }, @@ -125,7 +124,7 @@ export default ( can("create", "tests", { userId: 1 }); can(read, "tests"); }, - { resolveAction } + { resolveAction }, ), }); @@ -136,7 +135,7 @@ export default ( assert.deepStrictEqual( _sortBy(items, id), _sortBy(expectedItems, id), - `created items for read: '${read}'` + `created items for read: '${read}'`, ); } }); @@ -152,14 +151,14 @@ export default ( (can) => { can("create", "tests", { userId: 1 }); }, - { resolveAction } + { resolveAction }, ), }); await assert.rejects( promise, (err: Error) => err.name === "Forbidden", - "rejects because different userId" + "rejects because different userId", ); }); @@ -172,12 +171,12 @@ export default ( const items = await service.create(itemsArr, { ability: defineAbility( (can) => { - can("create", "tests"), - can("read", "tests"), - can("read", "tests", [id], { userId: 2 }), - can("read", "tests", [id, "userId"], { hi: "3" }); + can("create", "tests"); + can("read", "tests"); + can("read", "tests", [id], { userId: 2 }); + can("read", "tests", [id, "userId"], { hi: "3" }); }, - { resolveAction } + { resolveAction }, ), }); diff --git a/test/hooks/authorize/adapters/makeTests/create.ts b/test/hooks/authorize/adapters/makeTests/create.ts index 4c28eb6..d9ba9d3 100644 --- a/test/hooks/authorize/adapters/makeTests/create.ts +++ b/test/hooks/authorize/adapters/makeTests/create.ts @@ -1,6 +1,6 @@ import assert from "node:assert"; import { feathers } from "@feathersjs/feathers"; -import { createAliasResolver, defineAbility } from "@casl/ability"; +import { defineAbility } from "@casl/ability"; import type { Application } from "@feathersjs/feathers"; @@ -14,19 +14,19 @@ export default ( makeService: () => any, clean: (app, service) => Promise, authorizeHookOptions: Partial, - { around, afterHooks }: MakeTestsOptions = { around: false, afterHooks: [] } + { around, afterHooks }: MakeTestsOptions = { around: false, afterHooks: [] }, ): void => { let app: Application; let service; let id; - const itSkip = (adapterToTest: string | string[]) => { - const condition = - typeof adapterToTest === "string" - ? adapterName === adapterToTest - : adapterToTest.includes(adapterName); - return condition ? it.skip : it; - }; + // const itSkip = (adapterToTest: string | string[]) => { + // const condition = + // typeof adapterToTest === "string" + // ? adapterName === adapterToTest + // : adapterToTest.includes(adapterName); + // return condition ? it.skip : it; + // }; describe(`${adapterName}: beforeAndAfter - create:single`, function () { beforeEach(async function () { @@ -34,7 +34,6 @@ export default ( app.use("tests", makeService()); service = app.service("tests"); - // eslint-disable-next-line prefer-destructuring id = service.options.id; const options = Object.assign( @@ -49,14 +48,14 @@ export default ( "hidden", ], }, - authorizeHookOptions + authorizeHookOptions, ); afterHooks = Array.isArray(afterHooks) ? afterHooks : afterHooks - ? [afterHooks] - : []; + ? [afterHooks] + : []; if (around) { service.hooks({ @@ -91,9 +90,9 @@ export default ( (can) => { can("create", "tests", { userId: 1 }); }, - { resolveAction } + { resolveAction }, ), - } + }, ); assert.deepStrictEqual(item, undefined, "created item is undefined"); @@ -102,7 +101,7 @@ export default ( assert.deepStrictEqual( realItem, { [id]: realItem[id], test: true, userId: 1 }, - "created item" + "created item", ); }); @@ -114,17 +113,18 @@ export default ( { ability: defineAbility( (can) => { - can("create", "tests", { userId: 1 }), can("read", "tests"); + can("create", "tests", { userId: 1 }); + can("read", "tests"); }, - { resolveAction } + { resolveAction }, ), - } + }, ); assert.deepStrictEqual( item, { [id]: item[id], test: true, userId: 1 }, - "created item with all properties" + "created item with all properties", ); }); @@ -136,15 +136,15 @@ export default ( (can) => { can("create", "tests", { userId: 2 }); }, - { resolveAction } + { resolveAction }, ), - } + }, ); await assert.rejects( promise, (err: Error) => err.name === "Forbidden", - "rejects" + "rejects", ); }); @@ -154,12 +154,12 @@ export default ( { ability: defineAbility( (can) => { - can("create", "tests", { userId: 1 }), - can("read", "tests", [id], { userId: 1 }); + can("create", "tests", { userId: 1 }); + can("read", "tests", [id], { userId: 1 }); }, - { resolveAction } + { resolveAction }, ), - } + }, ); assert.deepStrictEqual(item, { [id]: item[id] }, "just returns with id"); @@ -175,12 +175,12 @@ export default ( can("create", "tests"); cannot("create", "tests", { userId: 1 }); }, - { resolveAction } + { resolveAction }, ), - } + }, ), (err: Error) => err.name === "Forbidden", - "cannot create item" + "cannot create item", ); await assert.doesNotReject( @@ -192,11 +192,11 @@ export default ( can("create", "tests"); cannot("create", "tests", { userId: 1 }); }, - { resolveAction } + { resolveAction }, ), - } + }, ), - "can create 'userId:2'" + "can create 'userId:2'", ); }); @@ -209,16 +209,16 @@ export default ( can("read", "tests", ["test", "userId"]); can("create", "tests"); }, - { resolveAction } + { resolveAction }, ), }); [item] = await service.find({ paginate: false }); assert.deepStrictEqual( result, {}, - "returned item is empty because of $select and restricting fields" + "returned item is empty because of $select and restricting fields", ); - // @ts-ignore + const itemInDb = await service.get(item[id]); assert.deepStrictEqual(itemInDb, item, "item in db is complete"); }); diff --git a/test/hooks/authorize/adapters/makeTests/find.ts b/test/hooks/authorize/adapters/makeTests/find.ts index 51dad38..f951ed7 100644 --- a/test/hooks/authorize/adapters/makeTests/find.ts +++ b/test/hooks/authorize/adapters/makeTests/find.ts @@ -1,7 +1,7 @@ import assert from "node:assert"; import type { Paginated, Application } from "@feathersjs/feathers"; import { feathers } from "@feathersjs/feathers"; -import { createAliasResolver, defineAbility } from "@casl/ability"; +import { defineAbility } from "@casl/ability"; import _sortBy from "lodash/sortBy.js"; import { authorize } from "../../../../../src"; @@ -14,19 +14,19 @@ export default ( makeService: () => any, clean: (app, service) => Promise, authorizeHookOptions: Partial, - { around, afterHooks }: MakeTestsOptions = { around: false, afterHooks: [] } + { around, afterHooks }: MakeTestsOptions = { around: false, afterHooks: [] }, ): void => { let app: Application; let service; let id; - const itSkip = (adapterToTest: string | string[]) => { - const condition = - typeof adapterToTest === "string" - ? name === adapterToTest - : adapterToTest.includes(name); - return condition ? it.skip : it; - }; + // const itSkip = (adapterToTest: string | string[]) => { + // const condition = + // typeof adapterToTest === "string" + // ? name === adapterToTest + // : adapterToTest.includes(name); + // return condition ? it.skip : it; + // }; describe(`${name}: beforeAndAfter - find`, function () { beforeEach(async function () { @@ -34,7 +34,6 @@ export default ( app.use("tests", makeService()); service = app.service("tests"); - // eslint-disable-next-line prefer-destructuring id = service.options.id; const options = Object.assign( @@ -49,14 +48,14 @@ export default ( "hidden", ], }, - authorizeHookOptions + authorizeHookOptions, ); afterHooks = Array.isArray(afterHooks) ? afterHooks : afterHooks - ? [afterHooks] - : []; + ? [afterHooks] + : []; if (around) { service.hooks({ @@ -95,7 +94,7 @@ export default ( assert.strictEqual( items.length, 3, - `has three items for read: '${read}'` + `has three items for read: '${read}'`, ); const returnedItems = await service.find({ @@ -103,7 +102,7 @@ export default ( (can) => { can(read, "tests"); }, - { resolveAction } + { resolveAction }, ), paginate: false, }); @@ -111,7 +110,7 @@ export default ( assert.deepStrictEqual( returnedItems, items, - `items are the same for read: '${read}'` + `items are the same for read: '${read}'`, ); } }); @@ -128,7 +127,7 @@ export default ( (can) => { can("read", "tests", { userId: 1 }); }, - { resolveAction } + { resolveAction }, ), paginate: false, })) as Paginated; @@ -136,7 +135,7 @@ export default ( assert.deepStrictEqual( returnedItems, [{ [id]: item1[id], test: true, userId: 1 }], - "just returned one item" + "just returned one item", ); }); @@ -150,10 +149,10 @@ export default ( const returnedItems = await service.find({ ability: defineAbility( (can) => { - can("read", "tests", { userId: 1 }), - can("read", "tests", [id], { userId: 2 }); + can("read", "tests", { userId: 1 }); + can("read", "tests", [id], { userId: 2 }); }, - { resolveAction } + { resolveAction }, ), paginate: false, }); @@ -162,9 +161,9 @@ export default ( _sortBy(returnedItems, id), _sortBy( [{ [id]: item1[id], test: true, userId: 1 }, { [id]: item2[id] }], - id + id, ), - "just returned one item" + "just returned one item", ); }); @@ -181,7 +180,7 @@ export default ( can("read", "tests"); cannot("read", "tests", { userId: 3 }); }, - { resolveAction } + { resolveAction }, ), paginate: false, })) as Paginated; @@ -193,9 +192,9 @@ export default ( { [id]: item1[id], test: true, userId: 1 }, { [id]: item2[id], test: true, userId: 2 }, ], - id + id, ), - "just returned two items without userId: 3" + "just returned two items without userId: 3", ); }); @@ -207,7 +206,6 @@ export default ( assert.strictEqual(items.length, 3, "has three items"); const returnedItems = service.find({ - // eslint-disable-next-line @typescript-eslint/no-empty-function ability: defineAbility(() => {}, { resolveAction }), paginate: false, }); @@ -215,7 +213,7 @@ export default ( await assert.rejects( returnedItems, (err: Error) => err.name === "Forbidden", - "throws on find" + "throws on find", ); }); @@ -231,7 +229,7 @@ export default ( (can, cannot) => { cannot("read", "tests"); }, - { resolveAction } + { resolveAction }, ), paginate: false, }); @@ -239,7 +237,7 @@ export default ( await assert.rejects( returnedItems, (err: Error) => err.name === "Forbidden", - "throws on find" + "throws on find", ); }); @@ -256,7 +254,7 @@ export default ( can("read", "tests", { userId: 1 }); can("manage", "all"); }, - { resolveAction } + { resolveAction }, ), paginate: false, })) as Paginated; @@ -264,7 +262,7 @@ export default ( assert.deepStrictEqual( _sortBy(returnedItems, id), _sortBy(items, id), - "returns all items" + "returns all items", ); }); @@ -281,7 +279,7 @@ export default ( can("manage", "all"); can("read", "tests", { userId: 1 }); }, - { resolveAction } + { resolveAction }, ), paginate: false, })) as Paginated; @@ -289,7 +287,7 @@ export default ( assert.deepStrictEqual( _sortBy(returnedItems, id), _sortBy(items, id), - "returns all items" + "returns all items", ); }); @@ -307,7 +305,7 @@ export default ( cannot("read", "tests", { userId: 1 }); cannot("read", "tests", ["test", "userId"], { userId: 2 }); }, - { resolveAction } + { resolveAction }, ), paginate: false, })) as Paginated; @@ -315,7 +313,7 @@ export default ( assert.deepStrictEqual( _sortBy(returnedItems, id), _sortBy([{ [id]: item2[id] }, item3], id), - "returns subset of items" + "returns subset of items", ); }); @@ -341,7 +339,7 @@ export default ( can("read", "tests", { published: true }); can("read", "tests", { userId: { $in: [1] } }); }, - { resolveAction } + { resolveAction }, ), paginate: false, }); @@ -349,7 +347,7 @@ export default ( assert.deepStrictEqual( _sortBy(returnedItems, id), _sortBy([item1, item2], id), - "returns all items" + "returns all items", ); }); }); @@ -369,7 +367,7 @@ export default ( (can) => { can("read", "tests", { userId: 3 }); }, - { resolveAction } + { resolveAction }, ), query: { test: false, @@ -380,7 +378,7 @@ export default ( assert.deepStrictEqual( _sortBy(returnedItems, id), _sortBy([item4], id), - "just returned one item" + "just returned one item", ); }); @@ -394,10 +392,10 @@ export default ( const returnedItems = await service.find({ ability: defineAbility( (can) => { - can("read", "tests", { userId: 1 }), - can("read", "tests", [id], { userId: 2 }); + can("read", "tests", { userId: 1 }); + can("read", "tests", [id], { userId: 2 }); }, - { resolveAction } + { resolveAction }, ), query: { $select: [id, "test"], @@ -408,7 +406,7 @@ export default ( assert.deepStrictEqual( _sortBy(returnedItems, id), _sortBy([{ [id]: item1[id], test: true }, { [id]: item2[id] }], id), - "just returned one item" + "just returned one item", ); }); @@ -427,7 +425,7 @@ export default ( can("read", "tests", { userId: 2 }); cannot("read", "tests", { userId: 4 }); }, - { resolveAction } + { resolveAction }, ), query: { $or: [ @@ -448,7 +446,7 @@ export default ( assert.deepStrictEqual( returnedItems, [{ [id]: item1[id], test: true, userId: 1 }], - "just returned one item" + "just returned one item", ); }); @@ -467,7 +465,7 @@ export default ( can("read", "tests", { userId: 2 }); cannot("read", "tests", { userId: 4 }); }, - { resolveAction } + { resolveAction }, ), query: { $and: [ @@ -482,14 +480,16 @@ export default ( assert.deepStrictEqual( _sortBy(returnedItems, id), _sortBy([item1, item2], id), - "just returned two items" + "just returned two items", ); }); it("returns only allowed items with '$in' query", async function () { const item1 = await service.create({ test: true, userId: 1 }); + // eslint-disable-next-line @typescript-eslint/no-unused-vars const item2 = await service.create({ test: true, userId: 2 }); + // eslint-disable-next-line @typescript-eslint/no-unused-vars const item3 = await service.create({ test: true, userId: 3 }); const items = (await service.find({ paginate: false })) as unknown[]; @@ -500,7 +500,7 @@ export default ( (can) => { can("read", "tests", { userId: 1 }); }, - { resolveAction } + { resolveAction }, ), query: { userId: { @@ -513,7 +513,7 @@ export default ( assert.deepStrictEqual( returnedItems, [{ [id]: item1[id], test: true, userId: 1 }], - "just returned one item" + "just returned one item", ); }); @@ -529,7 +529,7 @@ export default ( (can) => { can("read", "tests", { userId: 1 }); }, - { resolveAction } + { resolveAction }, ), query: { userId: { @@ -542,7 +542,7 @@ export default ( assert.deepStrictEqual( returnedItems, [{ [id]: item1[id], test: true, userId: 1 }], - "just returned one item" + "just returned one item", ); }); @@ -587,7 +587,7 @@ export default ( can("read", "tests", { userId: 1 }); can("read", "tests", { userId: { $ne: 1 }, published: true }); }, - { resolveAction } + { resolveAction }, ), query: { $or: [{ userId: 1 }, { userId: { $ne: 1 }, published: true }], @@ -597,8 +597,6 @@ export default ( paginate: false, })) as any[]; - const hallo = ""; - assert.deepEqual(returnedItems.length, 2); }); }); diff --git a/test/hooks/authorize/adapters/makeTests/get.ts b/test/hooks/authorize/adapters/makeTests/get.ts index 9a1b697..d33d541 100644 --- a/test/hooks/authorize/adapters/makeTests/get.ts +++ b/test/hooks/authorize/adapters/makeTests/get.ts @@ -1,6 +1,6 @@ import assert from "node:assert"; import { feathers } from "@feathersjs/feathers"; -import { createAliasResolver, defineAbility } from "@casl/ability"; +import { defineAbility } from "@casl/ability"; import type { Application } from "@feathersjs/feathers"; @@ -14,20 +14,19 @@ export default ( makeService: () => any, clean: (app, service) => Promise, authorizeHookOptions: Partial, - { around, afterHooks }: MakeTestsOptions = { around: false, afterHooks: [] } + { around, afterHooks }: MakeTestsOptions = { around: false, afterHooks: [] }, ): void => { let app: Application; let service; let id; - // eslint-disable-next-line @typescript-eslint/no-unused-vars - const itSkip = (adapterToTest: string | string[]) => { - const condition = - typeof adapterToTest === "string" - ? adapterName === adapterToTest - : adapterToTest.includes(adapterName); - return condition ? it.skip : it; - }; + // const itSkip = (adapterToTest: string | string[]) => { + // const condition = + // typeof adapterToTest === "string" + // ? adapterName === adapterToTest + // : adapterToTest.includes(adapterName); + // return condition ? it.skip : it; + // }; describe(`${adapterName}: beforeAndAfter - get`, function () { beforeEach(async function () { @@ -35,7 +34,6 @@ export default ( app.use("tests", makeService()); service = app.service("tests"); - // eslint-disable-next-line prefer-destructuring id = service.options.id; const options = Object.assign( @@ -50,14 +48,14 @@ export default ( "hidden", ], }, - authorizeHookOptions + authorizeHookOptions, ); afterHooks = Array.isArray(afterHooks) ? afterHooks : afterHooks - ? [afterHooks] - : []; + ? [afterHooks] + : []; if (around) { service.hooks({ @@ -92,13 +90,13 @@ export default ( (can) => { can(read, "tests", { userId: 1 }); }, - { resolveAction } + { resolveAction }, ), }); assert.deepStrictEqual( returnedItem, item, - `'create' and 'get' item are the same for read: '${read}'` + `'create' and 'get' item are the same for read: '${read}'`, ); } }); @@ -111,13 +109,13 @@ export default ( (can) => { can("read", "tests", [id], { userId: 1 }); }, - { resolveAction } + { resolveAction }, ), }); assert.deepStrictEqual( returnedItem, { [id]: item[id] }, - "'get' returns only [id]" + "'get' returns only [id]", ); }); @@ -133,7 +131,7 @@ export default ( (can) => { can("read", "tests", [id], { userId: 1 }); }, - { resolveAction } + { resolveAction }, ), query: { $select: [id, "userId"], @@ -142,11 +140,10 @@ export default ( assert.deepStrictEqual( returnedItem, { [id]: item[id] }, - "'get' returns only [id]" + "'get' returns only [id]", ); }); - // eslint-disable-next-line @typescript-eslint/no-empty-function it.skip("returns subset of fields with inverted fields", async function () {}); it("throws 'NotFound' for not 'can'", async function () { @@ -157,7 +154,7 @@ export default ( (can) => { can("read", "tests", { userId: 2 }); }, - { resolveAction } + { resolveAction }, ), }); // rejects with 'NotFound' because it's handled by feathers itself @@ -166,7 +163,7 @@ export default ( await assert.rejects( returnedItem, (err: Error) => err.name === "NotFound", - "rejects for id not allowed" + "rejects for id not allowed", ); }); @@ -179,7 +176,7 @@ export default ( can("read", "tests"); cannot("read", "tests", { userId: 1 }); }, - { resolveAction } + { resolveAction }, ), }); // rejects with 'NotFound' because it's handled by feathers itself @@ -188,7 +185,7 @@ export default ( await assert.rejects( returnedItem, (err: Error) => err.name === "NotFound", - "rejects for id not allowed" + "rejects for id not allowed", ); }); @@ -207,7 +204,7 @@ export default ( (can) => { can("read", "tests", ["test", "userId"]); }, - { resolveAction } + { resolveAction }, ), }); // rejects with 'Forbidden' which is handled by the after-hook @@ -217,7 +214,7 @@ export default ( await assert.rejects( promise, (err: Error) => err.name === "Forbidden", - "rejects for id not allowed" + "rejects for id not allowed", ); }); }); diff --git a/test/hooks/authorize/adapters/makeTests/index.ts b/test/hooks/authorize/adapters/makeTests/index.ts index dfd236b..e2ba4d5 100644 --- a/test/hooks/authorize/adapters/makeTests/index.ts +++ b/test/hooks/authorize/adapters/makeTests/index.ts @@ -21,7 +21,7 @@ export default async function ( around: false, afterHooks: [], actionBefore: () => {}, - } + }, ): Promise { describe(`authorize-hook '${name}'`, function () { if (makeTestsOptions.actionBefore) { @@ -32,77 +32,77 @@ export default async function ( makeService, clean, authorizeHookOptions, - makeTestsOptions + makeTestsOptions, ); makeGetTests( name, makeService, clean, authorizeHookOptions, - makeTestsOptions + makeTestsOptions, ); makeCreateTests( name, makeService, clean, authorizeHookOptions, - makeTestsOptions + makeTestsOptions, ); makeCreateMultiTests( name, makeService, clean, authorizeHookOptions, - makeTestsOptions + makeTestsOptions, ); makeUpdateTests( name, makeService, clean, authorizeHookOptions, - makeTestsOptions + makeTestsOptions, ); makeUpdateDataTests( name, makeService, clean, Object.assign({ useUpdateData: true }, authorizeHookOptions), - makeTestsOptions + makeTestsOptions, ); makePatchTests( name, makeService, clean, authorizeHookOptions, - makeTestsOptions + makeTestsOptions, ); makePatchDataTests( name, makeService, clean, Object.assign({ usePatchData: true }, authorizeHookOptions), - makeTestsOptions + makeTestsOptions, ); makePatchMultiTests( name, makeService, clean, authorizeHookOptions, - makeTestsOptions + makeTestsOptions, ); makeRemoveTests( name, makeService, clean, authorizeHookOptions, - makeTestsOptions + makeTestsOptions, ); makeRemoveMultiTests( name, makeService, clean, authorizeHookOptions, - makeTestsOptions + makeTestsOptions, ); }); } diff --git a/test/hooks/authorize/adapters/makeTests/patch-data.ts b/test/hooks/authorize/adapters/makeTests/patch-data.ts index 837feb1..9d69be3 100644 --- a/test/hooks/authorize/adapters/makeTests/patch-data.ts +++ b/test/hooks/authorize/adapters/makeTests/patch-data.ts @@ -1,6 +1,6 @@ import assert from "node:assert"; import { feathers } from "@feathersjs/feathers"; -import { createAliasResolver, defineAbility } from "@casl/ability"; +import { defineAbility } from "@casl/ability"; import type { Application } from "@feathersjs/feathers"; @@ -14,7 +14,7 @@ export default ( makeService: () => any, clean: (app, service) => Promise, authorizeHookOptions: Partial, - { around, afterHooks }: MakeTestsOptions = { around: false, afterHooks: [] } + { around, afterHooks }: MakeTestsOptions = { around: false, afterHooks: [] }, ): void => { let app: Application; let service; @@ -26,7 +26,6 @@ export default ( app.use("tests", makeService()); service = app.service("tests"); - // eslint-disable-next-line prefer-destructuring id = service.options.id; const options = Object.assign( @@ -41,14 +40,14 @@ export default ( "hidden", ], }, - authorizeHookOptions + authorizeHookOptions, ); afterHooks = Array.isArray(afterHooks) ? afterHooks : afterHooks - ? [afterHooks] - : []; + ? [afterHooks] + : []; if (around) { service.hooks({ @@ -89,9 +88,9 @@ export default ( can("patch-data", "tests"); can(read, "tests"); }, - { resolveAction } + { resolveAction }, ), - } + }, ); assert.deepStrictEqual(result, { [id]: item[id], @@ -118,11 +117,11 @@ export default ( can("patch", "tests"); can(read, "tests"); }, - { resolveAction } + { resolveAction }, ), - } + }, ); - } catch (err) { + } catch { rejected = true; } assert.ok(rejected, "rejected"); @@ -148,11 +147,11 @@ export default ( cannot("patch-data", "tests", { test: false }); can(read, "tests"); }, - { resolveAction } + { resolveAction }, ), - } + }, ); - } catch (err) { + } catch { rejected = true; } assert.ok(rejected, "rejected"); @@ -177,9 +176,9 @@ export default ( can("patch-data", "tests", { test: true }); can(read, "tests"); }, - { resolveAction } + { resolveAction }, ), - } + }, ); assert.fail("should not get here"); } catch (err) { @@ -205,15 +204,15 @@ export default ( can("patch-data", "tests", { test: false }); can(read, "tests"); }, - { resolveAction } + { resolveAction }, ), - } + }, ); assert.deepStrictEqual( patchedItem, { [id]: item[id], test: false, userId: 1 }, - `patched item correctly for read: '${read}'` + `patched item correctly for read: '${read}'`, ); } }); diff --git a/test/hooks/authorize/adapters/makeTests/patch-multi.ts b/test/hooks/authorize/adapters/makeTests/patch-multi.ts index 1034032..608b848 100644 --- a/test/hooks/authorize/adapters/makeTests/patch-multi.ts +++ b/test/hooks/authorize/adapters/makeTests/patch-multi.ts @@ -1,6 +1,6 @@ import assert from "node:assert"; import { feathers } from "@feathersjs/feathers"; -import { createAliasResolver, defineAbility } from "@casl/ability"; +import { defineAbility } from "@casl/ability"; import _sortBy from "lodash/sortBy.js"; import _isEqual from "lodash/isEqual.js"; @@ -16,19 +16,19 @@ export default ( makeService: () => any, clean: (app, service) => Promise, authorizeHookOptions: Partial, - { around, afterHooks }: MakeTestsOptions = { around: false, afterHooks: [] } + { around, afterHooks }: MakeTestsOptions = { around: false, afterHooks: [] }, ): void => { let app: Application; let service; let id; - const itSkip = (adapterToTest: string | string[]) => { - const condition = - typeof adapterToTest === "string" - ? adapterName === adapterToTest - : adapterToTest.includes(adapterName); - return condition ? it.skip : it; - }; + // const itSkip = (adapterToTest: string | string[]) => { + // const condition = + // typeof adapterToTest === "string" + // ? adapterName === adapterToTest + // : adapterToTest.includes(adapterName); + // return condition ? it.skip : it; + // }; describe(`${adapterName}: beforeAndAfter - patch:multiple`, function () { beforeEach(async function () { @@ -36,7 +36,6 @@ export default ( app.use("tests", makeService()); service = app.service("tests"); - // eslint-disable-next-line prefer-destructuring id = service.options.id; const options = Object.assign( @@ -51,14 +50,14 @@ export default ( "hidden", ], }, - authorizeHookOptions + authorizeHookOptions, ); afterHooks = Array.isArray(afterHooks) ? afterHooks : afterHooks - ? [afterHooks] - : []; + ? [afterHooks] + : []; if (around) { service.hooks({ @@ -96,12 +95,12 @@ export default ( (can) => { can("patch", "tests"); }, - { resolveAction } + { resolveAction }, ), query: { userId: 1, }, - } + }, ); assert.deepStrictEqual(patchedItems, [], "result is empty array"); @@ -115,7 +114,7 @@ export default ( assert.deepStrictEqual( _sortBy(realItems, id), _sortBy(expected, id), - "patched items correctly" + "patched items correctly", ); }); @@ -137,12 +136,12 @@ export default ( can("patch", "tests"); can(read, "tests"); }, - { resolveAction } + { resolveAction }, ), query: { userId: 1, }, - } + }, ); const expectedResult = [ @@ -153,7 +152,7 @@ export default ( assert.deepStrictEqual( _sortBy(patchedItems, id), _sortBy(expectedResult, id), - `result is right array for read: '${read}'` + `result is right array for read: '${read}'`, ); const realItems = await service.find({ paginate: false }); @@ -165,7 +164,7 @@ export default ( assert.deepStrictEqual( _sortBy(realItems, id), _sortBy(expected, id), - "patched items correctly" + "patched items correctly", ); } }); @@ -184,9 +183,9 @@ export default ( can("patch", "tests", ["test"], { userId: 1 }); can("read", "tests"); }, - { resolveAction } + { resolveAction }, ), - } + }, ); const realItems = await service.find({ paginate: false }); @@ -195,13 +194,13 @@ export default ( assert.deepStrictEqual( _sortBy(realItems, id), _sortBy(expected, id), - "patched item correctly" + "patched item correctly", ); assert.deepStrictEqual( _sortBy(patchedItems, id), realItems.filter((x) => _isEqual(x[id], item1[id])), - "result of patch is real item" + "result of patch is real item", ); }); @@ -219,10 +218,10 @@ export default ( can("patch", "tests", { userId: 1 }); can("read", "tests"); }, - { resolveAction } + { resolveAction }, ), query: {}, - } + }, ); const expectedResult = [ @@ -233,7 +232,7 @@ export default ( assert.deepStrictEqual( _sortBy(patchedItems, id), _sortBy(expectedResult, id), - "result is right array" + "result is right array", ); const realItems = await service.find({ paginate: false }); @@ -245,7 +244,7 @@ export default ( assert.deepStrictEqual( _sortBy(realItems, id), _sortBy(expected, id), - "patched items correctly" + "patched items correctly", ); }); @@ -268,10 +267,10 @@ export default ( can("patch", "tests", { userId: 1 }); can("read", "tests", { published: true }); }, - { resolveAction } + { resolveAction }, ), query: {}, - } + }, ); const expectedResult = [ @@ -281,7 +280,7 @@ export default ( assert.deepStrictEqual( patchedItems, expectedResult, - "result is right array" + "result is right array", ); const realItems = await service.find({ paginate: false }); @@ -295,7 +294,7 @@ export default ( assert.deepStrictEqual( _sortBy(realItems, id), _sortBy(expected, id), - "patched items correctly" + "patched items correctly", ); }); @@ -319,10 +318,10 @@ export default ( can("read", "tests", [id], { published: false }); can("read", "tests", { published: true }); }, - { resolveAction } + { resolveAction }, ), query: {}, - } + }, ); const expectedResult = [ @@ -333,7 +332,7 @@ export default ( assert.deepStrictEqual( _sortBy(patchedItems, id), _sortBy(expectedResult, id), - "result is right array" + "result is right array", ); const realItems = await service.find({ paginate: false }); @@ -347,7 +346,7 @@ export default ( assert.deepStrictEqual( _sortBy(realItems, id), _sortBy(expected, id), - "patched items correctly" + "patched items correctly", ); }); }); diff --git a/test/hooks/authorize/adapters/makeTests/patch.ts b/test/hooks/authorize/adapters/makeTests/patch.ts index 06b6435..c686542 100644 --- a/test/hooks/authorize/adapters/makeTests/patch.ts +++ b/test/hooks/authorize/adapters/makeTests/patch.ts @@ -1,6 +1,6 @@ import assert from "node:assert"; import { feathers } from "@feathersjs/feathers"; -import { createAliasResolver, defineAbility } from "@casl/ability"; +import { defineAbility } from "@casl/ability"; import type { Application } from "@feathersjs/feathers"; @@ -14,19 +14,19 @@ export default ( makeService: () => any, clean: (app, service) => Promise, authorizeHookOptions: Partial, - { around, afterHooks }: MakeTestsOptions = { around: false, afterHooks: [] } + { around, afterHooks }: MakeTestsOptions = { around: false, afterHooks: [] }, ): void => { let app: Application; let service; let id; - const itSkip = (adapterToTest: string | string[]) => { - const condition = - typeof adapterToTest === "string" - ? adapterName === adapterToTest - : adapterToTest.includes(adapterName); - return condition ? it.skip : it; - }; + // const itSkip = (adapterToTest: string | string[]) => { + // const condition = + // typeof adapterToTest === "string" + // ? adapterName === adapterToTest + // : adapterToTest.includes(adapterName); + // return condition ? it.skip : it; + // }; describe(`${adapterName}: beforeAndAfter - patch:single`, function () { beforeEach(async function () { @@ -34,7 +34,6 @@ export default ( app.use("tests", makeService()); service = app.service("tests"); - // eslint-disable-next-line prefer-destructuring id = service.options.id; const options = Object.assign( @@ -49,14 +48,14 @@ export default ( "hidden", ], }, - authorizeHookOptions + authorizeHookOptions, ); afterHooks = Array.isArray(afterHooks) ? afterHooks : afterHooks - ? [afterHooks] - : []; + ? [afterHooks] + : []; if (around) { service.hooks({ @@ -92,22 +91,22 @@ export default ( (can) => { can("patch", "tests"); }, - { resolveAction } + { resolveAction }, ), - } + }, ); assert.deepStrictEqual( patchedItem, undefined, - "patched item is undefined" + "patched item is undefined", ); const realItem = await service.get(item[id]); assert.deepStrictEqual( realItem, { [id]: item[id], test: false, userId: 1 }, - "patched item correctly" + "patched item correctly", ); }); @@ -126,15 +125,15 @@ export default ( can("patch", "tests"); can(read, "tests"); }, - { resolveAction } + { resolveAction }, ), - } + }, ); assert.deepStrictEqual( patchedItem, { [id]: item[id], test: false, userId: 1 }, - `patched item correctly for read: '${read}'` + `patched item correctly for read: '${read}'`, ); } }); @@ -151,15 +150,15 @@ export default ( can("patch", "tests"); cannot("patch", "tests", ["test"]); }, - { resolveAction } + { resolveAction }, ), - } + }, ); await assert.rejects( promise, (err: Error) => err.name === "Forbidden", - "rejects request" + "rejects request", ); }); @@ -175,9 +174,9 @@ export default ( can("patch", "tests", ["test"], { userId: 1 }); can("read", "tests"); }, - { resolveAction } + { resolveAction }, ), - } + }, ); const realItem = await service.get(item[id]); @@ -187,7 +186,7 @@ export default ( assert.deepStrictEqual( patchedItem, realItem, - "result of patch is real item" + "result of patch is real item", ); }); @@ -205,15 +204,15 @@ export default ( can("patch", "tests"); cannot("patch", "tests", { userId: 1 }); }, - { resolveAction } + { resolveAction }, ), - } + }, ); await assert.rejects( promise, (err: Error) => err.name === "NotFound", - "cannot patch item" + "cannot patch item", ); const patchedItem2 = await service.patch( @@ -226,15 +225,15 @@ export default ( can("patch", "tests"); cannot("patch", "tests", { userId: 1 }); }, - { resolveAction } + { resolveAction }, ), - } + }, ); assert.deepStrictEqual( patchedItem2, { [id]: item2[id], test: false, userId: 2 }, - "patched item correctly" + "patched item correctly", ); }); @@ -253,14 +252,14 @@ export default ( can("read", "tests", ["test", "userId"]); can(["create", "update"], "tests"); }, - { resolveAction } + { resolveAction }, ), - } + }, ); assert.deepStrictEqual( result, {}, - "returned item is empty because of $select and restricting fields" + "returned item is empty because of $select and restricting fields", ); const itemInDb = await service.get(item[id]); diff --git a/test/hooks/authorize/adapters/makeTests/remove-multi.ts b/test/hooks/authorize/adapters/makeTests/remove-multi.ts index 714c0ea..af3d691 100644 --- a/test/hooks/authorize/adapters/makeTests/remove-multi.ts +++ b/test/hooks/authorize/adapters/makeTests/remove-multi.ts @@ -1,6 +1,6 @@ import assert from "node:assert"; import { feathers } from "@feathersjs/feathers"; -import { createAliasResolver, defineAbility } from "@casl/ability"; +import { defineAbility } from "@casl/ability"; import _sortBy from "lodash/sortBy.js"; import type { Application } from "@feathersjs/feathers"; @@ -15,19 +15,19 @@ export default ( makeService: () => any, clean: (app, service) => Promise, authorizeHookOptions: Partial, - { around, afterHooks }: MakeTestsOptions = { around: false, afterHooks: [] } + { around, afterHooks }: MakeTestsOptions = { around: false, afterHooks: [] }, ): void => { let app: Application; let service; let id; - const itSkip = (adapterToTest: string | string[]) => { - const condition = - typeof adapterToTest === "string" - ? adapterName === adapterToTest - : adapterToTest.includes(adapterName); - return condition ? it.skip : it; - }; + // const itSkip = (adapterToTest: string | string[]) => { + // const condition = + // typeof adapterToTest === "string" + // ? adapterName === adapterToTest + // : adapterToTest.includes(adapterName); + // return condition ? it.skip : it; + // }; describe(`${adapterName}: beforeAndAfter - remove:multiple`, function () { beforeEach(async function () { @@ -35,7 +35,6 @@ export default ( app.use("tests", makeService()); service = app.service("tests"); - // eslint-disable-next-line prefer-destructuring id = service.options.id; const options = Object.assign( @@ -50,14 +49,14 @@ export default ( "hidden", ], }, - authorizeHookOptions + authorizeHookOptions, ); afterHooks = Array.isArray(afterHooks) ? afterHooks : afterHooks - ? [afterHooks] - : []; + ? [afterHooks] + : []; if (around) { service.hooks({ @@ -86,6 +85,7 @@ export default ( it("can remove multiple items and returns [] for not allowed read", async function () { // eslint-disable-next-line @typescript-eslint/no-unused-vars const item1 = await service.create({ test: true, userId: 1 }); + // eslint-disable-next-line @typescript-eslint/no-unused-vars const item2 = await service.create({ test: true, userId: 1 }); const item3 = await service.create({ test: true, userId: 2 }); @@ -95,7 +95,7 @@ export default ( (can) => { can("remove", "tests"); }, - { resolveAction } + { resolveAction }, ), query: { userId: 1, @@ -124,7 +124,7 @@ export default ( can("remove", "tests"); can(read, "tests"); }, - { resolveAction } + { resolveAction }, ), query: { userId: 1, @@ -139,7 +139,7 @@ export default ( assert.deepStrictEqual( _sortBy(removedItems, id), _sortBy(expectedResult, id), - `result is right array for read: '${read}'` + `result is right array for read: '${read}'`, ); const realItems = await service.find({ paginate: false }); @@ -147,7 +147,7 @@ export default ( assert.deepStrictEqual( realItems, expected, - `removed items correctly for read: '${read}'` + `removed items correctly for read: '${read}'`, ); } }); @@ -163,7 +163,7 @@ export default ( can("remove", "tests", { userId: 1 }); can("read", "tests"); }, - { resolveAction } + { resolveAction }, ), query: {}, }); @@ -176,7 +176,7 @@ export default ( assert.deepStrictEqual( _sortBy(removedItems, id), _sortBy(expectedResult, id), - "result is right array" + "result is right array", ); const realItems = await service.find({ paginate: false }); @@ -184,7 +184,7 @@ export default ( assert.deepStrictEqual( _sortBy(realItems, id), _sortBy(expected, id), - "removed items correctly" + "removed items correctly", ); }); @@ -217,7 +217,7 @@ export default ( can("remove", "tests", { userId: 1 }); can("read", "tests", { published: true }); }, - { resolveAction } + { resolveAction }, ), query: {}, }); @@ -229,7 +229,7 @@ export default ( assert.deepStrictEqual( removedItems, expectedResult, - "result is right array" + "result is right array", ); const realItems = await service.find({ paginate: false }); @@ -241,7 +241,7 @@ export default ( assert.deepStrictEqual( _sortBy(realItems, id), _sortBy(expected, id), - "removed items correctly" + "removed items correctly", ); }); @@ -262,7 +262,7 @@ export default ( can("read", "tests", [id], { published: false }); can("read", "tests", { published: true }); }, - { resolveAction } + { resolveAction }, ), }); @@ -274,7 +274,7 @@ export default ( assert.deepStrictEqual( _sortBy(removedItems, id), _sortBy(expectedResult, id), - "result is right array" + "result is right array", ); const realItems = await service.find({ paginate: false }); @@ -286,7 +286,7 @@ export default ( assert.deepStrictEqual( _sortBy(realItems, id), _sortBy(expected, id), - "removed items correctly" + "removed items correctly", ); }); }); diff --git a/test/hooks/authorize/adapters/makeTests/remove.ts b/test/hooks/authorize/adapters/makeTests/remove.ts index 1541ef5..60e821b 100644 --- a/test/hooks/authorize/adapters/makeTests/remove.ts +++ b/test/hooks/authorize/adapters/makeTests/remove.ts @@ -1,6 +1,6 @@ import assert from "node:assert"; import { feathers } from "@feathersjs/feathers"; -import { createAliasResolver, defineAbility } from "@casl/ability"; +import { defineAbility } from "@casl/ability"; import type { Application } from "@feathersjs/feathers"; @@ -14,19 +14,19 @@ export default ( makeService: () => any, clean: (app, service) => Promise, authorizeHookOptions: Partial, - { around, afterHooks }: MakeTestsOptions = { around: false, afterHooks: [] } + { around, afterHooks }: MakeTestsOptions = { around: false, afterHooks: [] }, ): void => { let app: Application; let service; let id; - const itSkip = (adapterToTest: string | string[]) => { - const condition = - typeof adapterToTest === "string" - ? adapterName === adapterToTest - : adapterToTest.includes(adapterName); - return condition ? it.skip : it; - }; + // const itSkip = (adapterToTest: string | string[]) => { + // const condition = + // typeof adapterToTest === "string" + // ? adapterName === adapterToTest + // : adapterToTest.includes(adapterName); + // return condition ? it.skip : it; + // }; describe(`${adapterName}: beforeAndAfter - remove:single`, function () { beforeEach(async function () { @@ -34,7 +34,6 @@ export default ( app.use("tests", makeService()); service = app.service("tests"); - // eslint-disable-next-line prefer-destructuring id = service.options.id; const options = Object.assign( @@ -49,14 +48,14 @@ export default ( "hidden", ], }, - authorizeHookOptions + authorizeHookOptions, ); afterHooks = Array.isArray(afterHooks) ? afterHooks : afterHooks - ? [afterHooks] - : []; + ? [afterHooks] + : []; if (around) { service.hooks({ @@ -89,14 +88,14 @@ export default ( (can) => { can("remove", "tests"); }, - { resolveAction } + { resolveAction }, ), }); assert.deepStrictEqual( updatedItem, undefined, - "removed item is undefined" + "removed item is undefined", ); const realItems = (await service.find({ paginate: false })) as unknown[]; @@ -115,14 +114,14 @@ export default ( can("remove", "tests"); can(read, "tests"); }, - { resolveAction } + { resolveAction }, ), }); assert.deepStrictEqual( removedItem, { [id]: item[id], test: true, userId: 1 }, - `removed item correctly for read: '${read}'` + `removed item correctly for read: '${read}'`, ); const realItems = (await service.find({ @@ -141,14 +140,14 @@ export default ( can("remove", "tests"); cannot("remove", "tests", { userId: 1 }); }, - { resolveAction } + { resolveAction }, ), }); await assert.rejects( promise, (err: Error) => err.name === "NotFound", - "cannot remove item" + "cannot remove item", ); }); @@ -163,18 +162,18 @@ export default ( can("read", "tests", ["test", "userId"]); can(["create", "remove"], "tests"); }, - { resolveAction } + { resolveAction }, ), }); assert.deepStrictEqual( result, {}, - "returned item is empty because of $select and restricting fields" + "returned item is empty because of $select and restricting fields", ); await assert.rejects( service.get(item[id]), (err: Error) => err.name === "NotFound", - "item was deleted" + "item was deleted", ); }); }); diff --git a/test/hooks/authorize/adapters/makeTests/update-data.ts b/test/hooks/authorize/adapters/makeTests/update-data.ts index dff28aa..58e2471 100644 --- a/test/hooks/authorize/adapters/makeTests/update-data.ts +++ b/test/hooks/authorize/adapters/makeTests/update-data.ts @@ -1,6 +1,6 @@ import assert from "node:assert"; import { feathers } from "@feathersjs/feathers"; -import { createAliasResolver, defineAbility } from "@casl/ability"; +import { defineAbility } from "@casl/ability"; import type { Application } from "@feathersjs/feathers"; @@ -14,7 +14,7 @@ export default ( makeService: () => any, clean: (app, service) => Promise, authorizeHookOptions: Partial, - { around, afterHooks }: MakeTestsOptions = { around: false, afterHooks: [] } + { around, afterHooks }: MakeTestsOptions = { around: false, afterHooks: [] }, ): void => { let app: Application; let service; @@ -26,7 +26,6 @@ export default ( app.use("tests", makeService()); service = app.service("tests"); - // eslint-disable-next-line prefer-destructuring id = service.options.id; const options = Object.assign( @@ -41,14 +40,14 @@ export default ( "hidden", ], }, - authorizeHookOptions + authorizeHookOptions, ); afterHooks = Array.isArray(afterHooks) ? afterHooks : afterHooks - ? [afterHooks] - : []; + ? [afterHooks] + : []; if (around) { service.hooks({ @@ -89,9 +88,9 @@ export default ( can("update-data", "tests"); can(read, "tests"); }, - { resolveAction } + { resolveAction }, ), - } + }, ); assert.deepStrictEqual(result, { [id]: item[id], @@ -118,11 +117,11 @@ export default ( can("update", "tests"); can(read, "tests"); }, - { resolveAction } + { resolveAction }, ), - } + }, ); - } catch (err) { + } catch { rejected = true; } assert.ok(rejected, "rejected"); @@ -148,11 +147,11 @@ export default ( cannot("update-data", "tests", { test: false }); can(read, "tests"); }, - { resolveAction } + { resolveAction }, ), - } + }, ); - } catch (err) { + } catch { rejected = true; } assert.ok(rejected, "rejected"); @@ -177,9 +176,9 @@ export default ( can("update-data", "tests", { test: true }); can(read, "tests"); }, - { resolveAction } + { resolveAction }, ), - } + }, ); assert.fail("should not get here"); } catch (err) { @@ -205,15 +204,15 @@ export default ( can("update-data", "tests", { test: false }); can(read, "tests"); }, - { resolveAction } + { resolveAction }, ), - } + }, ); assert.deepStrictEqual( UpdatedItem, { [id]: item[id], test: false, userId: 1 }, - `updated item correctly for read: '${read}'` + `updated item correctly for read: '${read}'`, ); } }); diff --git a/test/hooks/authorize/adapters/makeTests/update.ts b/test/hooks/authorize/adapters/makeTests/update.ts index 0cea569..347587e 100644 --- a/test/hooks/authorize/adapters/makeTests/update.ts +++ b/test/hooks/authorize/adapters/makeTests/update.ts @@ -1,6 +1,6 @@ import assert from "node:assert"; import { feathers } from "@feathersjs/feathers"; -import { createAliasResolver, defineAbility } from "@casl/ability"; +import { defineAbility } from "@casl/ability"; import type { Application } from "@feathersjs/feathers"; @@ -14,7 +14,7 @@ export default ( makeService: () => any, clean: (app, service) => Promise, authorizeHookOptions: Partial, - { around, afterHooks }: MakeTestsOptions = { around: false, afterHooks: [] } + { around, afterHooks }: MakeTestsOptions = { around: false, afterHooks: [] }, ): void => { let app: Application; let service; @@ -34,7 +34,6 @@ export default ( app.use("tests", makeService()); service = app.service("tests"); - // eslint-disable-next-line prefer-destructuring id = service.options.id; const options = Object.assign( @@ -49,14 +48,14 @@ export default ( "hidden", ], }, - authorizeHookOptions + authorizeHookOptions, ); afterHooks = Array.isArray(afterHooks) ? afterHooks : afterHooks - ? [afterHooks] - : []; + ? [afterHooks] + : []; if (around) { service.hooks({ @@ -92,22 +91,22 @@ export default ( (can) => { can("update", "tests"); }, - { resolveAction } + { resolveAction }, ), - } + }, ); assert.deepStrictEqual( updatedItem, undefined, - "updated item is undefined" + "updated item is undefined", ); const realItem = await service.get(item[id]); assert.deepStrictEqual( realItem, { [id]: item[id], test: false, userId: 1 }, - "updated item correctly" + "updated item correctly", ); }); @@ -126,15 +125,15 @@ export default ( can("update", "tests"); can(read, "tests"); }, - { resolveAction } + { resolveAction }, ), - } + }, ); assert.deepStrictEqual( updatedItem, { [id]: item[id], test: false, userId: 1 }, - `updated item correctly for read: '${read}'` + `updated item correctly for read: '${read}'`, ); } }); @@ -151,15 +150,15 @@ export default ( can("update", "tests"); cannot("update", "tests", { userId: 1 }); }, - { resolveAction } + { resolveAction }, ), - } + }, ); await assert.rejects( promise, (err: Error) => err.name === "NotFound", - "cannot update item" + "cannot update item", ); }); @@ -176,9 +175,9 @@ export default ( can("update", "tests"); cannot("update", "tests", { userId: 1 }); }, - { resolveAction } + { resolveAction }, ), - } + }, ); await assert.doesNotReject(promise, "can update item"); @@ -197,15 +196,15 @@ export default ( can("update", "tests"); cannot("update", "tests", ["test"]); }, - { resolveAction } + { resolveAction }, ), - } + }, ); await assert.rejects( promise, (err: Error) => err.name === "Forbidden", - "rejects request" + "rejects request", ); }); @@ -221,9 +220,9 @@ export default ( can("update", "tests", ["test"], { userId: 1 }); can("read", "tests"); }, - { resolveAction } + { resolveAction }, ), - } + }, ); const realItem = await service.get(item[id]); @@ -233,7 +232,7 @@ export default ( assert.deepStrictEqual( updatedItem, realItem, - "result of update is real item" + "result of update is real item", ); }); @@ -251,15 +250,15 @@ export default ( can("update", "tests"); cannot("update", "tests", { userId: 1 }); }, - { resolveAction } + { resolveAction }, ), - } + }, ); await assert.rejects( promise, (err: Error) => err.name === "NotFound", - "cannot update item" + "cannot update item", ); // TODO: Does not work with `userId: 1` for knex, memory, mongodb and nedb ?! @@ -273,15 +272,15 @@ export default ( can("update", "tests"); cannot("update", "tests", { userId: 1 }); }, - { resolveAction } + { resolveAction }, ), - } + }, ); assert.deepStrictEqual( updatedItem2, { [id]: item2[id], test: false, userId: 3 }, - "updated item correctly" + "updated item correctly", ); }); @@ -308,19 +307,19 @@ export default ( can("read", "tests", ["test", "userId"]); can(["create", "update"], "tests"); }, - { resolveAction } + { resolveAction }, ), }); assert.deepStrictEqual( result, {}, - "returned item is empty because of $select and restricting fields" + "returned item is empty because of $select and restricting fields", ); const itemInDb = await service.get(item[id]); assert.deepStrictEqual(itemInDb, updatedItem, "item in db is complete"); - } + }, ); }); }; diff --git a/test/hooks/authorize/authorize.general.test.ts b/test/hooks/authorize/authorize.general.test.ts index e660294..f9d2f3e 100644 --- a/test/hooks/authorize/authorize.general.test.ts +++ b/test/hooks/authorize/authorize.general.test.ts @@ -1,6 +1,6 @@ import assert from "node:assert"; import { authorize } from "../../../src"; -import { createAliasResolver, defineAbility } from "@casl/ability"; +import { defineAbility } from "@casl/ability"; import _cloneDeep from "lodash/cloneDeep.js"; import { filterArray, filterObject, markHookForSkip } from "feathers-utils"; import type { HookContext } from "@feathersjs/feathers"; @@ -41,7 +41,7 @@ describe("authorize.general.test.ts", function () { assert.deepStrictEqual( result.params.query, query, - `'${type}:${method}': does not change query object` + `'${type}:${method}': does not change query object`, ); }); promises.push(promise); @@ -68,7 +68,6 @@ describe("authorize.general.test.ts", function () { test: true, }, params: { - // eslint-disable-next-line @typescript-eslint/no-empty-function ability: defineAbility(() => {}, { resolveAction }), query: {}, }, @@ -85,7 +84,7 @@ describe("authorize.general.test.ts", function () { const promise = assert.rejects( authorize()(context), (err: Error) => err.name === "Forbidden", - `'${type}:${method}': with no permissions returns 'Forbidden' error` + `'${type}:${method}': with no permissions returns 'Forbidden' error`, ); promises.push(promise); }); @@ -110,7 +109,7 @@ describe("authorize.general.test.ts", function () { (can) => { can("manage", "all"); }, - { resolveAction } + { resolveAction }, ), query: {}, }, @@ -133,7 +132,7 @@ describe("authorize.general.test.ts", function () { assert.deepStrictEqual( result.params.query, query, - "does not change query object" + "does not change query object", ); }); promises.push(promise); @@ -160,7 +159,7 @@ describe("authorize.general.test.ts", function () { (can) => { can(method, path); }, - { resolveAction } + { resolveAction }, ), query: {}, }, @@ -178,7 +177,7 @@ describe("authorize.general.test.ts", function () { assert.deepStrictEqual( result.params.query, query, - "does not change query object" + "does not change query object", ); }); promises.push(promise); @@ -204,7 +203,7 @@ describe("authorize.general.test.ts", function () { (can) => { can("manage", "all"); }, - { resolveAction } + { resolveAction }, ), query: {}, }, @@ -222,12 +221,12 @@ describe("authorize.general.test.ts", function () { const query = Object.assign({}, context.params.query); const promise = authorize({ availableFields: undefined })( - context + context, ).then((result) => { assert.deepStrictEqual( result.params.query, query, - "does not change query object" + "does not change query object", ); }); promises.push(promise); @@ -249,7 +248,6 @@ describe("authorize.general.test.ts", function () { test: true, }, params: { - // eslint-disable-next-line @typescript-eslint/no-empty-function ability: defineAbility(() => {}, { resolveAction }), skipHooks: ["authorize"], query: {}, @@ -271,7 +269,7 @@ describe("authorize.general.test.ts", function () { assert.deepStrictEqual( result.params.query, query, - `'${type}:${method}': does not change query object` + `'${type}:${method}': does not change query object`, ); }); promises.push(promise); @@ -293,7 +291,6 @@ describe("authorize.general.test.ts", function () { test: true, }, params: { - // eslint-disable-next-line @typescript-eslint/no-empty-function ability: defineAbility(() => {}, { resolveAction }), query: {}, }, @@ -315,9 +312,9 @@ describe("authorize.general.test.ts", function () { assert.deepStrictEqual( result.params.query, query, - `'${type}:${method}': does not change query object` + `'${type}:${method}': does not change query object`, ); - } + }, ); promises.push(promise); }); @@ -343,7 +340,7 @@ describe("authorize.general.test.ts", function () { can(["find"], "tests", { userId: 1 }); can(["find"], "tests", { userId: 1 }); }, - { resolveAction } + { resolveAction }, ), query: { test: true, @@ -377,7 +374,7 @@ describe("authorize.general.test.ts", function () { (can) => { can("create", "tests", { userId: 1 }); }, - { resolveAction } + { resolveAction }, ), query: {}, }, @@ -387,7 +384,7 @@ describe("authorize.general.test.ts", function () { await assert.doesNotReject( authorize()(context), - "passes authorize hook" + "passes authorize hook", ); }); @@ -420,7 +417,7 @@ describe("authorize.general.test.ts", function () { can("create", "tests", { userId: 1 }); can("read", "tests"); }, - { resolveAction } + { resolveAction }, ), query: {}, }, @@ -430,7 +427,7 @@ describe("authorize.general.test.ts", function () { await assert.doesNotReject( authorize({ availableFields: ["id", "userId", "test"] })(context), - "passes authorize hook" + "passes authorize hook", ); }); @@ -463,7 +460,7 @@ describe("authorize.general.test.ts", function () { can("create", "tests", { userId: 1 }); can("read", "tests"); }, - { resolveAction } + { resolveAction }, ), query: {}, }, @@ -473,7 +470,7 @@ describe("authorize.general.test.ts", function () { await assert.rejects( authorize({ checkMultiActions: true })(context), - "passes authorize hook" + "passes authorize hook", ); }); @@ -493,7 +490,7 @@ describe("authorize.general.test.ts", function () { (can) => { can("create", "tests", { userId: 1 }); }, - { resolveAction } + { resolveAction }, ), query: {}, }, @@ -504,7 +501,7 @@ describe("authorize.general.test.ts", function () { await assert.rejects( authorize()(context), (err: Error) => err.name === "Forbidden", - "rejects with 'Forbidden' error" + "rejects with 'Forbidden' error", ); }); @@ -536,7 +533,7 @@ describe("authorize.general.test.ts", function () { (can) => { can("create", "tests", { userId: 1 }); }, - { resolveAction } + { resolveAction }, ), query: {}, }, @@ -547,7 +544,7 @@ describe("authorize.general.test.ts", function () { await assert.rejects( authorize()(context), (err: Error) => err.name === "Forbidden", - "rejects with 'Forbidden' error" + "rejects with 'Forbidden' error", ); }); @@ -618,7 +615,7 @@ describe("authorize.general.test.ts", function () { cannot("update", "tests", condition); cannot("remove", "tests", condition); }, - { resolveAction } + { resolveAction }, ), query: {}, }, @@ -635,7 +632,7 @@ describe("authorize.general.test.ts", function () { assert.deepStrictEqual( query, {}, - `'${type}:${method}': query is empty` + `'${type}:${method}': query is empty`, ); const promise = authorize()(context).then((result) => { @@ -643,8 +640,8 @@ describe("authorize.general.test.ts", function () { result.params.query, inverted, `'${type}:${method}': for condition: '${JSON.stringify( - condition - )}' the inverted is: ${JSON.stringify(result.params.query)}` + condition, + )}' the inverted is: ${JSON.stringify(result.params.query)}`, ); }); promises.push(promise); @@ -669,7 +666,7 @@ describe("authorize.general.test.ts", function () { (can) => { can("patch-multi", "tests"); }, - { resolveAction } + { resolveAction }, ), query: {}, }, @@ -677,7 +674,7 @@ describe("authorize.general.test.ts", function () { await assert.rejects( authorize({ checkMultiActions: true })(context), - "authorize rejects" + "authorize rejects", ); }); @@ -694,7 +691,7 @@ describe("authorize.general.test.ts", function () { (can) => { can("patch", "tests"); }, - { resolveAction } + { resolveAction }, ), query: {}, }, @@ -702,7 +699,7 @@ describe("authorize.general.test.ts", function () { await assert.rejects( authorize({ checkMultiActions: true })(context), - "authorize rejects" + "authorize rejects", ); }); }); @@ -720,7 +717,7 @@ describe("authorize.general.test.ts", function () { (can) => { can("remove-multi", "tests"); }, - { resolveAction } + { resolveAction }, ), query: {}, }, @@ -728,7 +725,7 @@ describe("authorize.general.test.ts", function () { await assert.rejects( authorize({ checkMultiActions: true })(context), - "authorize rejects" + "authorize rejects", ); }); @@ -744,7 +741,7 @@ describe("authorize.general.test.ts", function () { (can) => { can("remove", "tests"); }, - { resolveAction } + { resolveAction }, ), query: {}, }, @@ -752,7 +749,7 @@ describe("authorize.general.test.ts", function () { await assert.rejects( authorize({ checkMultiActions: true })(context), - "authorize rejects" + "authorize rejects", ); }); }); @@ -774,7 +771,7 @@ describe("authorize.general.test.ts", function () { (can) => { can(["get", "create", "update", "patch", "remove"], "all"); }, - { resolveAction } + { resolveAction }, ), query: {}, }, @@ -788,12 +785,12 @@ describe("authorize.general.test.ts", function () { methods.forEach((method) => { const context = makeContext(method, type); const promise = authorize({ availableFields: undefined })( - context + context, ).then(({ result }) => { assert.deepStrictEqual( result, expectedResult, - `returns complete object for '${type}:${method}'` + `returns complete object for '${type}:${method}'`, ); }); promises.push(promise); @@ -826,7 +823,7 @@ describe("authorize.general.test.ts", function () { (can) => { can(["get", "create", "update", "patch", "remove"], "all"); }, - { resolveAction } + { resolveAction }, ), query: {}, }, @@ -838,12 +835,12 @@ describe("authorize.general.test.ts", function () { methods.forEach((method) => { const context = makeContext(method, type); const promise = authorize({ availableFields: undefined })( - context + context, ).then(({ result }) => { assert.deepStrictEqual( result, val, - `returns complete object for '${type}:${method}'` + `returns complete object for '${type}:${method}'`, ); }); promises.push(promise); @@ -869,7 +866,7 @@ describe("authorize.general.test.ts", function () { (can) => { can(["find", "create", "patch", "remove"], "all"); }, - { resolveAction } + { resolveAction }, ), query: {}, }, @@ -883,12 +880,12 @@ describe("authorize.general.test.ts", function () { methods.forEach((method) => { const context = makeContext(method, type); const promise = authorize({ availableFields: undefined })( - context + context, ).then(({ result }) => { assert.deepStrictEqual( result, expectedResult, - `returns complete object for '${type}:${method}'` + `returns complete object for '${type}:${method}'`, ); }); promises.push(promise); @@ -899,10 +896,10 @@ describe("authorize.general.test.ts", function () { it("after - passes multi with 'pagination' with 'find' rule", async function () { const expectedResult = { - "total": 1, - "limit": 10, - "skip": 0, - "data": [{ id: 1, userId: 1, test: true }] + total: 1, + limit: 10, + skip: 0, + data: [{ id: 1, userId: 1, test: true }], }; const makeContext = (method, type) => { return { @@ -917,13 +914,13 @@ describe("authorize.general.test.ts", function () { (can) => { can(["find", "create", "patch", "remove"], "all"); }, - { resolveAction } + { resolveAction }, ), query: {}, }, } as unknown as HookContext; }; - + const types = ["after"]; const methods = ["find"]; const promises: Promise[] = []; @@ -931,12 +928,12 @@ describe("authorize.general.test.ts", function () { methods.forEach((method) => { const context = makeContext(method, type); const promise = authorize({ availableFields: undefined })( - context + context, ).then(({ result }) => { assert.deepStrictEqual( result, expectedResult, - `returns complete object for '${type}:${method}'` + `returns complete object for '${type}:${method}'`, ); }); promises.push(promise); diff --git a/test/hooks/authorize/authorize.options.method.test.ts b/test/hooks/authorize/authorize.options.method.test.ts index de9b8cd..4c37202 100644 --- a/test/hooks/authorize/authorize.options.method.test.ts +++ b/test/hooks/authorize/authorize.options.method.test.ts @@ -1,6 +1,6 @@ import { MemoryService } from "@feathersjs/memory"; -import { filterObject, filterArray } from "feathers-utils"; -import { authorize, type Adapter, type ServiceCaslOptions } from "../../../src"; +import { filterArray } from "feathers-utils"; +import { authorize, type ServiceCaslOptions } from "../../../src"; import { feathers } from "@feathersjs/feathers"; import { defineAbility } from "@casl/ability"; import { resolveAction } from "../../test-utils"; @@ -53,7 +53,7 @@ describe("authorize.options.method", () => { }), { methods: ["find", "get", "create", "update", "patch", "remove", "sum"], - } + }, ); const hook = authorize({ @@ -83,7 +83,7 @@ describe("authorize.options.method", () => { (can) => { can("read", "tests", { userId: 1 }); }, - { resolveAction } + { resolveAction }, ), paginate: false, })) as any as any[]; @@ -91,7 +91,7 @@ describe("authorize.options.method", () => { assert.deepStrictEqual( returnedItems, [{ [id]: item1[id], test: true, userId: 1 }], - "just returned one item" + "just returned one item", ); }); }); diff --git a/test/hooks/authorize/authorize.options.test.ts b/test/hooks/authorize/authorize.options.test.ts index b613116..6d75f8c 100644 --- a/test/hooks/authorize/authorize.options.test.ts +++ b/test/hooks/authorize/authorize.options.test.ts @@ -2,7 +2,7 @@ import assert from "node:assert"; import { feathers } from "@feathersjs/feathers"; import { MemoryService } from "@feathersjs/memory"; import type { AnyMongoAbility } from "@casl/ability"; -import { createAliasResolver, defineAbility } from "@casl/ability"; +import { defineAbility } from "@casl/ability"; import type { Application, HookContext } from "@feathersjs/feathers"; @@ -34,11 +34,10 @@ describe("authorize.options.test.ts", function () { default: 10, max: 50, }, - }) + }), ); service = app.service("tests"); - //@ts-ignore service.hooks({ before: { all: [authorize({ checkMultiActions: true })], @@ -60,7 +59,7 @@ describe("authorize.options.test.ts", function () { (can) => { can(["create-multi", "create"], "tests"); }, - { resolveAction } + { resolveAction }, ), }, ], @@ -76,7 +75,7 @@ describe("authorize.options.test.ts", function () { (can) => { can(["patch-multi", "patch"], "tests"); }, - { resolveAction } + { resolveAction }, ), }, ], @@ -91,7 +90,7 @@ describe("authorize.options.test.ts", function () { (can) => { can(["remove-multi", "remove"], "tests"); }, - { resolveAction } + { resolveAction }, ), }, ], @@ -114,7 +113,7 @@ describe("authorize.options.test.ts", function () { (can) => { can(["create"], "tests"); }, - { resolveAction } + { resolveAction }, ), }, ], @@ -130,7 +129,7 @@ describe("authorize.options.test.ts", function () { (can) => { can(["patch"], "tests"); }, - { resolveAction } + { resolveAction }, ), }, ], @@ -145,7 +144,7 @@ describe("authorize.options.test.ts", function () { (can) => { can(["remove"], "tests"); }, - { resolveAction } + { resolveAction }, ), }, ], @@ -156,7 +155,7 @@ describe("authorize.options.test.ts", function () { await assert.rejects( promise, (err: Error) => err.name === "Forbidden", - "rejects because 'method-multi' not defined" + "rejects because 'method-multi' not defined", ); }); }); @@ -173,12 +172,12 @@ describe("authorize.options.test.ts", function () { default: 10, max: 50, }, - }) + }), ); service = app.service("tests"); - //@ts-ignore + service.modelName = "Test"; - //@ts-ignore + service.hooks({ before: { all: [ @@ -187,7 +186,7 @@ describe("authorize.options.test.ts", function () { (can) => { can("create", "Test"); }, - { resolveAction } + { resolveAction }, ), modelName: "Test", checkAbilityForInternal: true, @@ -203,7 +202,7 @@ describe("authorize.options.test.ts", function () { return service.update(0, { test: false }); }, (err: Error) => err.name === "Forbidden", - "update throws Forbidden" + "update throws Forbidden", ); }); @@ -217,12 +216,12 @@ describe("authorize.options.test.ts", function () { default: 10, max: 50, }, - }) + }), ); service = app.service("tests"); - //@ts-ignore + service.modelName = "Test"; - //@ts-ignore + service.hooks({ before: { all: [ @@ -231,7 +230,7 @@ describe("authorize.options.test.ts", function () { (can) => { can("create", "Test"); }, - { resolveAction } + { resolveAction }, ), modelName: (context) => context.service.modelName, checkAbilityForInternal: true, @@ -247,7 +246,7 @@ describe("authorize.options.test.ts", function () { return service.update(0, { test: false }); }, (err: Error) => err.name === "Forbidden", - "update throws Forbidden" + "update throws Forbidden", ); }); }); @@ -263,10 +262,10 @@ describe("authorize.options.test.ts", function () { default: 10, max: 50, }, - }) + }), ); service = app.service("tests"); - //@ts-ignore + service.hooks({ before: { all: [authorize()], @@ -287,15 +286,14 @@ describe("authorize.options.test.ts", function () { default: 10, max: 50, }, - }) + }), ); service = app.service("tests"); - //@ts-ignore + service.hooks({ before: { all: [ authorize({ - // eslint-disable-next-line @typescript-eslint/no-empty-function ability: defineAbility(() => {}, { resolveAction }), checkAbilityForInternal: true, }), @@ -306,7 +304,7 @@ describe("authorize.options.test.ts", function () { await assert.rejects( service.create({ test: true }), (err: Error) => err.name === "Forbidden", - "throws even if no ability is set in params" + "throws even if no ability is set in params", ); }); @@ -320,15 +318,14 @@ describe("authorize.options.test.ts", function () { default: 10, max: 50, }, - }) + }), ); service = app.service("tests"); - //@ts-ignore + service.hooks({ before: { all: [ authorize({ - // eslint-disable-next-line @typescript-eslint/no-empty-function ability: defineAbility(() => {}, { resolveAction }), }), ], @@ -340,7 +337,7 @@ describe("authorize.options.test.ts", function () { (can) => { can("manage", "all"); }, - { resolveAction } + { resolveAction }, ), }; @@ -358,22 +355,21 @@ describe("authorize.options.test.ts", function () { default: 10, max: 50, }, - }) + }), ); service = app.service("tests"); - //@ts-ignore + service.hooks({ before: { all: [ authorize({ - //@ts-ignore ability: Promise.resolve( defineAbility( (can) => { can("manage", "all"); }, - { resolveAction } - ) + { resolveAction }, + ), ), }), ], @@ -394,10 +390,10 @@ describe("authorize.options.test.ts", function () { default: 10, max: 50, }, - }) + }), ); service = app.service("tests"); - //@ts-ignore + service.hooks({ before: { all: [ @@ -407,7 +403,7 @@ describe("authorize.options.test.ts", function () { (can) => { can("manage", "all"); }, - { resolveAction } + { resolveAction }, ), }), ], @@ -428,10 +424,10 @@ describe("authorize.options.test.ts", function () { default: 10, max: 50, }, - }) + }), ); service = app.service("tests"); - //@ts-ignore + service.hooks({ before: { all: [ @@ -442,8 +438,8 @@ describe("authorize.options.test.ts", function () { (can) => { can("manage", "all"); }, - { resolveAction } - ) + { resolveAction }, + ), ); }, }), @@ -465,11 +461,11 @@ describe("authorize.options.test.ts", function () { default: 10, max: 50, }, - }) + }), ); - //@ts-ignore + service = app.service("tests"); - //@ts-ignore + service.hooks({ before: { all: [authorize()], @@ -483,13 +479,12 @@ describe("authorize.options.test.ts", function () { { test: true }, { casl: { - // eslint-disable-next-line @typescript-eslint/no-empty-function ability: defineAbility(() => {}), }, - } + }, ), (err: Error) => err.name === "Forbidden", - "throws Forbidden" + "throws Forbidden", ); }); @@ -503,11 +498,11 @@ describe("authorize.options.test.ts", function () { default: 10, max: 50, }, - }) + }), ); - //@ts-ignore + service = app.service("tests"); - //@ts-ignore + service.hooks({ before: { all: [authorize()], @@ -521,13 +516,12 @@ describe("authorize.options.test.ts", function () { { test: true }, { casl: { - // eslint-disable-next-line @typescript-eslint/no-empty-function ability: () => defineAbility(() => {}), }, - } + }, ), (err: Error) => err.name === "Forbidden", - "throws Forbidden" + "throws Forbidden", ); }); @@ -558,13 +552,12 @@ describe("authorize.options.test.ts", function () { const promise = assert.rejects( authorize({ availableFields: ["id", "userId", "test"], - // eslint-disable-next-line @typescript-eslint/no-empty-function + ability: () => defineAbility(() => {}, { resolveAction }), checkAbilityForInternal: true, - //@ts-ignore })(context), (err: Error) => err.name === "Forbidden", - `'${type}:${method}' throws Forbidden` + `'${type}:${method}' throws Forbidden`, ); promises.push(promise); }); @@ -575,7 +568,7 @@ describe("authorize.options.test.ts", function () { it("fails for not defined ability on external", async function () { const makeContext = ( method: "find" | "get" | "create" | "update" | "patch" | "remove", - type: "before" | "after" + type: "before" | "after", ): HookContext => { return { path: "tests", @@ -610,7 +603,7 @@ describe("authorize.options.test.ts", function () { const promise = assert.rejects( authorize()(context), (err: Error) => err.name === "Forbidden", - `'${type}:${method}' throws Forbidden` + `'${type}:${method}' throws Forbidden`, ); promises.push(promise); }); @@ -630,15 +623,14 @@ describe("authorize.options.test.ts", function () { default: 10, max: 50, }, - }) + }), ); service = app.service("tests"); - //@ts-ignore + service.hooks({ before: { all: [ authorize({ - // eslint-disable-next-line @typescript-eslint/no-empty-function ability: defineAbility(() => {}), }), ], @@ -647,7 +639,7 @@ describe("authorize.options.test.ts", function () { await assert.doesNotReject( service.create({ test: true }), - "does not throw Forbidden" + "does not throw Forbidden", ); }); @@ -661,15 +653,14 @@ describe("authorize.options.test.ts", function () { default: 10, max: 50, }, - }) + }), ); service = app.service("tests"); - //@ts-ignore + service.hooks({ before: { all: [ authorize({ - // eslint-disable-next-line @typescript-eslint/no-empty-function ability: defineAbility(() => {}), }), ], @@ -679,7 +670,7 @@ describe("authorize.options.test.ts", function () { await assert.rejects( service.create({ test: true }, { provider: "rest" }), (err: Error) => err.name === "Forbidden", - "request throws Forbidden" + "request throws Forbidden", ); }); @@ -693,15 +684,14 @@ describe("authorize.options.test.ts", function () { default: 10, max: 50, }, - }) + }), ); service = app.service("tests"); - //@ts-ignore + service.hooks({ before: { all: [ authorize({ - // eslint-disable-next-line @typescript-eslint/no-empty-function ability: defineAbility(() => {}), checkAbilityForInternal: true, }), @@ -712,7 +702,7 @@ describe("authorize.options.test.ts", function () { await assert.rejects( service.create({ test: true }), (err: Error) => err.name === "Forbidden", - "request throws Forbidden" + "request throws Forbidden", ); }); }); diff --git a/test/hooks/authorize/authorize.relations.test.ts b/test/hooks/authorize/authorize.relations.test.ts index bb41766..bd746d6 100644 --- a/test/hooks/authorize/authorize.relations.test.ts +++ b/test/hooks/authorize/authorize.relations.test.ts @@ -1,6 +1,5 @@ -/* eslint-disable @typescript-eslint/no-unused-vars */ import assert from "node:assert"; -import { createAliasResolver, defineAbility } from "@casl/ability"; +import { defineAbility } from "@casl/ability"; import { feathers } from "@feathersjs/feathers"; import { authorize } from "../../../src"; import { MemoryService } from "@feathersjs/memory"; @@ -20,7 +19,7 @@ describe("authorize.relations", function () { filters: { ...filterArray("$and"), }, - }) + }), ); app.use( "albums", @@ -31,7 +30,7 @@ describe("authorize.relations", function () { filters: { ...filterArray("$and"), }, - }) + }), ); const serviceArtists = app.service("artists"); @@ -126,22 +125,27 @@ describe("authorize.relations", function () { date: 2016, }); + // eslint-disable-next-line @typescript-eslint/no-unused-vars const killer = await serviceAlbums.create({ name: "All Killer No Filler", artistId: sum41.id, date: 2001, }); + + // eslint-disable-next-line @typescript-eslint/no-unused-vars const hero = await serviceAlbums.create({ name: "Underclass Hero", artistId: sum41.id, date: 2007, }); + // eslint-disable-next-line @typescript-eslint/no-unused-vars const believe = await serviceAlbums.create({ name: "Believe", artistId: justinBieber.id, date: 2012, }); + // eslint-disable-next-line @typescript-eslint/no-unused-vars const purpose = await serviceAlbums.create({ name: "Purpose", artistId: justinBieber.id, @@ -154,12 +158,12 @@ describe("authorize.relations", function () { assert.deepStrictEqual( albumsOfBlink.sort(), [enemaOfTheState, pantsAndJacket, california].sort(), - "found all albums of blink182" + "found all albums of blink182", ); }); it("basic example with ability", async function () { - const { app, serviceAlbums, serviceArtists } = mock(); + const { serviceAlbums, serviceArtists } = mock(); const blink182 = await serviceArtists.create({ name: "Blink182" }); const sum41 = await serviceArtists.create({ name: "Sum 41" }); const justinBieber = await serviceArtists.create({ @@ -182,22 +186,27 @@ describe("authorize.relations", function () { date: 2016, }); + // eslint-disable-next-line @typescript-eslint/no-unused-vars const killer = await serviceAlbums.create({ name: "All Killer No Filler", artistId: sum41.id, date: 2001, }); + // eslint-disable-next-line @typescript-eslint/no-unused-vars const hero = await serviceAlbums.create({ name: "Underclass Hero", artistId: sum41.id, date: 2007, }); + // eslint-disable-next-line @typescript-eslint/no-unused-vars const believe = await serviceAlbums.create({ name: "Believe", artistId: justinBieber.id, date: 2012, }); + + // eslint-disable-next-line @typescript-eslint/no-unused-vars const purpose = await serviceAlbums.create({ name: "Purpose", artistId: justinBieber.id, @@ -211,7 +220,7 @@ describe("authorize.relations", function () { can("read", "albums"); can("read", "artists", { name: "Justin Bieber" }); }, - { resolveAction } + { resolveAction }, ), }); @@ -224,19 +233,19 @@ describe("authorize.relations", function () { can("read", "albums"); can("read", "artists", { name: "Blink182" }); }, - { resolveAction } + { resolveAction }, ), }); assert.deepStrictEqual( albumsOfBlink.sort(), [enemaOfTheState, pantsAndJacket, california].sort(), - "found all albums of blink182" + "found all albums of blink182", ); }); it("basic example with ability with $select", async function () { - const { app, serviceAlbums, serviceArtists } = mock(); + const { serviceAlbums, serviceArtists } = mock(); const blink182 = await serviceArtists.create({ name: "Blink182" }); const sum41 = await serviceArtists.create({ name: "Sum 41" }); const justinBieber = await serviceArtists.create({ @@ -259,22 +268,28 @@ describe("authorize.relations", function () { date: 2016, }); + // eslint-disable-next-line @typescript-eslint/no-unused-vars const killer = await serviceAlbums.create({ name: "All Killer No Filler", artistId: sum41.id, date: 2001, }); + + // eslint-disable-next-line @typescript-eslint/no-unused-vars const hero = await serviceAlbums.create({ name: "Underclass Hero", artistId: sum41.id, date: 2007, }); + // eslint-disable-next-line @typescript-eslint/no-unused-vars const believe = await serviceAlbums.create({ name: "Believe", artistId: justinBieber.id, date: 2012, }); + + // eslint-disable-next-line @typescript-eslint/no-unused-vars const purpose = await serviceAlbums.create({ name: "Purpose", artistId: justinBieber.id, @@ -288,7 +303,7 @@ describe("authorize.relations", function () { can("read", "albums"); can("read", "artists", { name: "Justin Bieber" }); }, - { resolveAction } + { resolveAction }, ), }); @@ -301,7 +316,7 @@ describe("authorize.relations", function () { can("read", "albums"); can("read", "artists", { name: "Blink182" }); }, - { resolveAction } + { resolveAction }, ), }); @@ -312,12 +327,12 @@ describe("authorize.relations", function () { { id: pantsAndJacket.id }, { id: california.id }, ].sort(), - "found all albums of blink182" + "found all albums of blink182", ); }); it("dot.notation in ability", async function () { - const { app, serviceAlbums, serviceArtists } = mock(); + const { serviceAlbums, serviceArtists } = mock(); const blink182 = await serviceArtists.create({ name: "Blink182" }); const sum41 = await serviceArtists.create({ name: "Sum 41" }); const justinBieber = await serviceArtists.create({ @@ -340,22 +355,26 @@ describe("authorize.relations", function () { date: 2016, }); + // eslint-disable-next-line @typescript-eslint/no-unused-vars const killer = await serviceAlbums.create({ name: "All Killer No Filler", artistId: sum41.id, date: 2001, }); + // eslint-disable-next-line @typescript-eslint/no-unused-vars const hero = await serviceAlbums.create({ name: "Underclass Hero", artistId: sum41.id, date: 2007, }); + // eslint-disable-next-line @typescript-eslint/no-unused-vars const believe = await serviceAlbums.create({ name: "Believe", artistId: justinBieber.id, date: 2012, }); + // eslint-disable-next-line @typescript-eslint/no-unused-vars const purpose = await serviceAlbums.create({ name: "Purpose", artistId: justinBieber.id, @@ -369,21 +388,21 @@ describe("authorize.relations", function () { can("read", "albums", { "artist.name": "Blink182" }); can("read", "artists"); }, - { resolveAction } + { resolveAction }, ), }); assert.deepStrictEqual( albumsOfBlink.sort(), [enemaOfTheState, pantsAndJacket, california].sort(), - "only can read albums of blink182" + "only can read albums of blink182", ); }); }); describe("patch", function () { it("dot.notation in ability", async function () { - const { app, serviceAlbums, serviceArtists } = mock(); + const { serviceAlbums, serviceArtists } = mock(); const blink182 = await serviceArtists.create({ name: "Blink182" }); const sum41 = await serviceArtists.create({ name: "Sum 41" }); const justinBieber = await serviceArtists.create({ @@ -406,22 +425,26 @@ describe("authorize.relations", function () { date: 2016, }); + // eslint-disable-next-line @typescript-eslint/no-unused-vars const killer = await serviceAlbums.create({ name: "All Killer No Filler", artistId: sum41.id, date: 2001, }); + // eslint-disable-next-line @typescript-eslint/no-unused-vars const hero = await serviceAlbums.create({ name: "Underclass Hero", artistId: sum41.id, date: 2007, }); + // eslint-disable-next-line @typescript-eslint/no-unused-vars const believe = await serviceAlbums.create({ name: "Believe", artistId: justinBieber.id, date: 2012, }); + // eslint-disable-next-line @typescript-eslint/no-unused-vars const purpose = await serviceAlbums.create({ name: "Purpose", artistId: justinBieber.id, @@ -441,9 +464,9 @@ describe("authorize.relations", function () { can(["update"], "albums", { "artist.name": "Blink182" }); can("read", "artists"); }, - { resolveAction } + { resolveAction }, ), - } + }, ); assert.deepStrictEqual( @@ -453,33 +476,32 @@ describe("authorize.relations", function () { { ...pantsAndJacket, stars: 5 }, { ...california, stars: 5 }, ], - "only updated Albums of Blink182" + "only updated Albums of Blink182", ); const otherAlbums = await serviceAlbums.find({ query: { "artist.name": { $ne: "Blink182" }, }, - // @ts-ignore paginate: false, }); assert.strictEqual( otherAlbums.length, 4, - "albums not from Blink182 are four" + "albums not from Blink182 are four", ); assert.ok( otherAlbums.every((x) => !x.stars), - "none of other albums has stars" + "none of other albums has stars", ); }); }); describe.skip("remove", function () { it("dot.notation in ability", async function () { - const { app, serviceAlbums, serviceArtists } = mock(); + const { serviceAlbums, serviceArtists } = mock(); const blink182 = await serviceArtists.create({ name: "Blink182" }); const sum41 = await serviceArtists.create({ name: "Sum 41" }); const justinBieber = await serviceArtists.create({ @@ -502,22 +524,28 @@ describe("authorize.relations", function () { date: 2016, }); + // eslint-disable-next-line @typescript-eslint/no-unused-vars const killer = await serviceAlbums.create({ name: "All Killer No Filler", artistId: sum41.id, date: 2001, }); + + // eslint-disable-next-line @typescript-eslint/no-unused-vars const hero = await serviceAlbums.create({ name: "Underclass Hero", artistId: sum41.id, date: 2007, }); + // eslint-disable-next-line @typescript-eslint/no-unused-vars const believe = await serviceAlbums.create({ name: "Believe", artistId: justinBieber.id, date: 2012, }); + + // eslint-disable-next-line @typescript-eslint/no-unused-vars const purpose = await serviceAlbums.create({ name: "Purpose", artistId: justinBieber.id, @@ -537,9 +565,9 @@ describe("authorize.relations", function () { can(["update"], "albums", { "artist.name": "Blink182" }); can("read", "artists"); }, - { resolveAction } + { resolveAction }, ), - } + }, ); assert.deepStrictEqual( @@ -549,26 +577,25 @@ describe("authorize.relations", function () { { ...pantsAndJacket, stars: 5 }, { ...california, stars: 5 }, ], - "only updated Albums of Blink182" + "only updated Albums of Blink182", ); const otherAlbums = await serviceAlbums.find({ query: { "artist.name": { $ne: "Blink182" }, }, - // @ts-ignore paginate: false, }); assert.strictEqual( otherAlbums.length, 4, - "albums not from Blink182 are four" + "albums not from Blink182 are four", ); assert.ok( otherAlbums.every((x) => !x.stars), - "none of other albums has stars" + "none of other albums has stars", ); }); }); diff --git a/test/hooks/checkBasicPermission.test.ts b/test/hooks/checkBasicPermission.test.ts index 32ff91b..5941506 100644 --- a/test/hooks/checkBasicPermission.test.ts +++ b/test/hooks/checkBasicPermission.test.ts @@ -1,5 +1,5 @@ import assert from "node:assert"; -import { createAliasResolver, defineAbility } from "@casl/ability"; +import { defineAbility } from "@casl/ability"; import { checkBasicPermission } from "../../src"; import type { HookContext } from "@feathersjs/feathers"; import { markHookForSkip } from "feathers-utils"; @@ -38,7 +38,7 @@ describe("checkBasicPermission.test.ts", function () { assert.deepStrictEqual( result.params.query, query, - `'${type}:${method}': does not change query object` + `'${type}:${method}': does not change query object`, ); }); promises.push(promise); @@ -66,7 +66,6 @@ describe("checkBasicPermission.test.ts", function () { test: true, }, params: { - // eslint-disable-next-line @typescript-eslint/no-empty-function ability: defineAbility(() => {}, { resolveAction }), query: {}, }, @@ -82,7 +81,7 @@ describe("checkBasicPermission.test.ts", function () { const promise = assert.rejects( checkBasicPermission()(context), (err: Error) => err.name === "Forbidden", - `'${type}:${method}': with no permissions returns 'Forbidden' error` + `'${type}:${method}': with no permissions returns 'Forbidden' error`, ); promises.push(promise); }); @@ -109,7 +108,7 @@ describe("checkBasicPermission.test.ts", function () { (can) => { can("manage", "all"); }, - { resolveAction } + { resolveAction }, ), query: {}, }, @@ -127,7 +126,7 @@ describe("checkBasicPermission.test.ts", function () { assert.deepStrictEqual( result.params.query, query, - "does not change query object" + "does not change query object", ); }); promises.push(promise); @@ -156,7 +155,7 @@ describe("checkBasicPermission.test.ts", function () { (can) => { can(method, path); }, - { resolveAction } + { resolveAction }, ), query: {}, }, @@ -174,7 +173,7 @@ describe("checkBasicPermission.test.ts", function () { assert.deepStrictEqual( result.params.query, query, - "does not change query object" + "does not change query object", ); }); promises.push(promise); @@ -198,7 +197,6 @@ describe("checkBasicPermission.test.ts", function () { test: true, }, params: { - // eslint-disable-next-line @typescript-eslint/no-empty-function ability: defineAbility(() => {}, { resolveAction }), skipHooks: ["checkBasicPermission"], query: {}, @@ -219,7 +217,7 @@ describe("checkBasicPermission.test.ts", function () { assert.deepStrictEqual( result.params.query, query, - `'${type}:${method}': does not change query object` + `'${type}:${method}': does not change query object`, ); }); promises.push(promise); @@ -248,7 +246,7 @@ describe("checkBasicPermission.test.ts", function () { (can) => { can("create", "tests", { userId: 2 }); }, - { resolveAction } + { resolveAction }, ), query: {}, }, @@ -256,7 +254,7 @@ describe("checkBasicPermission.test.ts", function () { await assert.doesNotReject( checkBasicPermission()(context), - "passes checkBasicPermission hook" + "passes checkBasicPermission hook", ); }); @@ -290,7 +288,7 @@ describe("checkBasicPermission.test.ts", function () { (can) => { can("create", "tests", { userId: 1 }); }, - { resolveAction } + { resolveAction }, ), query: {}, }, @@ -298,7 +296,7 @@ describe("checkBasicPermission.test.ts", function () { await assert.doesNotReject( checkBasicPermission()(context), - "passes checkBasicPermission hook" + "passes checkBasicPermission hook", ); }); @@ -332,7 +330,7 @@ describe("checkBasicPermission.test.ts", function () { (can) => { can("create", "tests", { userId: 1 }); }, - { resolveAction } + { resolveAction }, ), query: {}, }, @@ -340,7 +338,7 @@ describe("checkBasicPermission.test.ts", function () { await assert.rejects( checkBasicPermission({ checkMultiActions: true })(context), - "checkBasicPermission hook rejects" + "checkBasicPermission hook rejects", ); }); @@ -362,7 +360,7 @@ describe("checkBasicPermission.test.ts", function () { (can) => { can("create", "tests", { userId: 1 }); }, - { resolveAction } + { resolveAction }, ), query: {}, }, @@ -371,7 +369,7 @@ describe("checkBasicPermission.test.ts", function () { await assert.rejects( checkBasicPermission({ checkCreateForData: true })(context), (err: Error) => err.name === "Forbidden", - "rejects with 'Forbidden' error" + "rejects with 'Forbidden' error", ); }); @@ -405,7 +403,7 @@ describe("checkBasicPermission.test.ts", function () { (can) => { can("create", "tests", { userId: 1 }); }, - { resolveAction } + { resolveAction }, ), query: {}, }, @@ -414,7 +412,7 @@ describe("checkBasicPermission.test.ts", function () { await assert.rejects( checkBasicPermission({ checkCreateForData: true })(context), (err: Error) => err.name === "Forbidden", - "rejects with 'Forbidden' error" + "rejects with 'Forbidden' error", ); }); @@ -436,7 +434,7 @@ describe("checkBasicPermission.test.ts", function () { (can) => { can("create", "tests", { userId: 1 }); }, - { resolveAction } + { resolveAction }, ), query: {}, }, @@ -445,7 +443,7 @@ describe("checkBasicPermission.test.ts", function () { await assert.doesNotReject( checkBasicPermission({ checkCreateForData: false })(context), (err: Error) => err.name === "Forbidden", - "does not reject" + "does not reject", ); }); @@ -479,7 +477,7 @@ describe("checkBasicPermission.test.ts", function () { (can) => { can("create", "tests", { userId: 1 }); }, - { resolveAction } + { resolveAction }, ), query: {}, }, @@ -488,7 +486,7 @@ describe("checkBasicPermission.test.ts", function () { await assert.doesNotReject( checkBasicPermission({ checkCreateForData: false })(context), (err: Error) => err.name === "Forbidden", - "does not reject" + "does not reject", ); }); }); @@ -509,7 +507,7 @@ describe("checkBasicPermission.test.ts", function () { (can) => { can("patch-multi", "tests"); }, - { resolveAction } + { resolveAction }, ), query: {}, }, @@ -517,7 +515,7 @@ describe("checkBasicPermission.test.ts", function () { await assert.rejects( checkBasicPermission({ checkMultiActions: true })(context), - "checkBasicPermission rejects" + "checkBasicPermission rejects", ); }); @@ -536,7 +534,7 @@ describe("checkBasicPermission.test.ts", function () { (can) => { can("patch", "tests"); }, - { resolveAction } + { resolveAction }, ), query: {}, }, @@ -544,7 +542,7 @@ describe("checkBasicPermission.test.ts", function () { await assert.rejects( checkBasicPermission({ checkMultiActions: true })(context), - "checkBasicPermission rejects" + "checkBasicPermission rejects", ); }); }); @@ -564,7 +562,7 @@ describe("checkBasicPermission.test.ts", function () { (can) => { can("remove-multi", "tests"); }, - { resolveAction } + { resolveAction }, ), query: {}, }, @@ -572,7 +570,7 @@ describe("checkBasicPermission.test.ts", function () { await assert.rejects( checkBasicPermission({ checkMultiActions: true })(context), - "checkBasicPermission rejects" + "checkBasicPermission rejects", ); }); @@ -590,7 +588,7 @@ describe("checkBasicPermission.test.ts", function () { (can) => { can("remove", "tests"); }, - { resolveAction } + { resolveAction }, ), query: {}, }, @@ -598,7 +596,7 @@ describe("checkBasicPermission.test.ts", function () { await assert.rejects( checkBasicPermission({ checkMultiActions: true })(context), - "checkBasicPermission rejects" + "checkBasicPermission rejects", ); }); }); diff --git a/test/test-utils.ts b/test/test-utils.ts index c63b909..23705a0 100644 --- a/test/test-utils.ts +++ b/test/test-utils.ts @@ -3,7 +3,7 @@ import { createAliasResolver } from "@casl/ability"; export const promiseTimeout = function ( ms: number, promise: Promise, - rejectMessage?: string + rejectMessage?: string, ): Promise { // Create a promise that rejects in milliseconds const timeout = new Promise((resolve, reject) => { diff --git a/test/utils/checkCan.test.ts b/test/utils/checkCan.test.ts index 5d859ef..e21f307 100644 --- a/test/utils/checkCan.test.ts +++ b/test/utils/checkCan.test.ts @@ -36,31 +36,31 @@ describe("utils - checkCan", function () { }); await assert.doesNotReject( () => checkCan(ability, 0, "get", "tests", service), - "'get:0' does not reject" + "'get:0' does not reject", ); await assert.doesNotReject( () => checkCan(ability, 0, "update", "tests", service), - "'update:0' does not reject" + "'update:0' does not reject", ); await assert.doesNotReject( () => checkCan(ability, 0, "remove", "tests", service), - "'update:0' does not reject" + "'update:0' does not reject", ); await assert.rejects( () => checkCan(ability, 1, "remove", "tests", service), - "'remove:1' rejects" + "'remove:1' rejects", ); await assert.rejects( () => checkCan(ability, 2, "update", "tests", service), - "'update:2' rejects" + "'update:2' rejects", ); await assert.rejects( () => checkCan(ability, 0, "patch", "tests", service), - "'patch:0' rejects" + "'patch:0' rejects", ); await assert.rejects( () => checkCan(ability, 0, "update", "another-tests", service), - "'patch:0' rejects" + "'patch:0' rejects", ); }); diff --git a/test/utils/convertRuleToQuery.test.ts b/test/utils/convertRuleToQuery.test.ts index a12b137..cd8b693 100644 --- a/test/utils/convertRuleToQuery.test.ts +++ b/test/utils/convertRuleToQuery.test.ts @@ -66,7 +66,7 @@ describe("utils - convertRuleToQuery", function () { assert.deepStrictEqual( convertRuleToQuery(rule), expected[i], - `${i}: expected result for rule is: '${JSON.stringify(expected[i])}'` + `${i}: expected result for rule is: '${JSON.stringify(expected[i])}'`, ); }); }); diff --git a/test/utils/getFieldsForConditions.test.ts b/test/utils/getFieldsForConditions.test.ts index 8059231..e7fe9b1 100644 --- a/test/utils/getFieldsForConditions.test.ts +++ b/test/utils/getFieldsForConditions.test.ts @@ -4,7 +4,6 @@ import { getFieldsForConditions } from "../../src"; describe("utils - getFieldsForConditions", function () { it("returns empty array for no conditions", function () { - // eslint-disable-next-line @typescript-eslint/no-empty-function const ability = defineAbility(() => {}); const fields = getFieldsForConditions(ability, "find", "tests"); assert.deepStrictEqual(fields, [], "empty fields"); @@ -23,13 +22,13 @@ describe("utils - getFieldsForConditions", function () { assert.deepStrictEqual( fieldsTests1.sort(), ["special", "userId", "test", "hi", "testsId"].sort(), - "found right fields for tests1" + "found right fields for tests1", ); const fieldsTests2 = getFieldsForConditions(ability, "find", "tests2"); assert.deepStrictEqual( fieldsTests2.sort(), ["commentId"].sort(), - "found right fields for tests2" + "found right fields for tests2", ); }); }); diff --git a/test/utils/getMinimalFields.test.ts b/test/utils/getMinimalFields.test.ts index 9395a6a..1f3423e 100644 --- a/test/utils/getMinimalFields.test.ts +++ b/test/utils/getMinimalFields.test.ts @@ -12,20 +12,20 @@ describe("utils - getMinimalFields", function () { can("manage", "all"); }); const availableFields = ["id", "test"]; - methods.forEach((method) => { + for (const method of methods) { const record: Record = { id: 1, test: true }; const fields = getMinimalFields( ability, method, subject("tests", record), - { availableFields } + { availableFields }, ); assert.deepStrictEqual( fields, ["id", "test"], - `full array for method '${method}'` + `full array for method '${method}'`, ); - }); + } }); it("returns subset of array", function () { @@ -33,20 +33,20 @@ describe("utils - getMinimalFields", function () { can("manage", "all", ["id"]); }); const availableFields = ["id", "test"]; - methods.forEach((method) => { + for (const method of methods) { const record: Record = { id: 1, test: true }; const fields = getMinimalFields( ability, method, subject("tests", record), - { availableFields } + { availableFields }, ); assert.deepStrictEqual( fields, ["id"], - `subset of array for method '${method}'` + `subset of array for method '${method}'`, ); - }); + } }); it("returns subset of array with availableFields: undefined", function () { @@ -54,20 +54,20 @@ describe("utils - getMinimalFields", function () { can("manage", "all", ["id"]); }); const availableFields = undefined; - methods.forEach((method) => { + for (const method of methods) { const record: Record = { id: 1, test: true }; const fields = getMinimalFields( ability, method, subject("tests", record), - { availableFields } + { availableFields }, ); assert.deepStrictEqual( fields, ["id"], - `subset of array for method '${method}'` + `subset of array for method '${method}'`, ); - }); + } }); it("returns empty array with availableFields: []", function () { @@ -75,16 +75,16 @@ describe("utils - getMinimalFields", function () { can("manage", "all", ["id"]); }); const availableFields = []; - methods.forEach((method) => { + for (const method of methods) { const record: Record = { id: 1, test: true }; const fields = getMinimalFields( ability, method, subject("tests", record), - { availableFields } + { availableFields }, ); assert.deepStrictEqual(fields, [], `empty array for method '${method}'`); - }); + } }); it("returns empty array when not allowed", function () { @@ -92,16 +92,16 @@ describe("utils - getMinimalFields", function () { cannot("manage", "all"); }); - methods.forEach((method) => { + for (const method of methods) { const record: Record = { id: 1, test: true }; const fields = getMinimalFields( ability, method, subject("tests", record), - { checkCan: true } + { checkCan: true }, ); assert.deepStrictEqual(fields, [], `empty array for method '${method}'`); - }); + } }); it("returns subset of array for more complex rules", function () { @@ -129,20 +129,20 @@ describe("utils - getMinimalFields", function () { expected: ["id", "name", "email"], }, ]; - pairs.forEach((pair, i) => { - methods.forEach((method) => { + for (const [index, pair] of pairs.entries()) { + for (const method of methods) { const fields = getMinimalFields( ability, method, subject("tests", pair.input), - { availableFields } + { availableFields }, ); assert.deepStrictEqual( fields, pair.expected, - `result for input '${i}' and method '${method}' is correct` + `result for input '${index}' and method '${method}' is correct`, ); - }); - }); + } + } }); }); diff --git a/test/utils/getModelName.test.ts b/test/utils/getModelName.test.ts index 94e0452..37ee869 100644 --- a/test/utils/getModelName.test.ts +++ b/test/utils/getModelName.test.ts @@ -10,7 +10,7 @@ describe("utils - getModelName", function () { assert.strictEqual( getModelName(modelName, context), context.path, - "returns context.path" + "returns context.path", ); }); @@ -20,7 +20,7 @@ describe("utils - getModelName", function () { assert.strictEqual( getModelName(modelName, context), modelName, - "just returns modelName" + "just returns modelName", ); }); @@ -32,7 +32,7 @@ describe("utils - getModelName", function () { assert.strictEqual( getModelName((c) => c.method, context), context.method, - "returns custom modelName" + "returns custom modelName", ); }); @@ -47,7 +47,7 @@ describe("utils - getModelName", function () { assert.throws( //@ts-expect-error val is not string, function or undefined () => getModelName(val, context), - `throws on val: '${val}''` + `throws on val: '${val}''`, ); }); }); diff --git a/test/utils/hasRestrictingFields.test.ts b/test/utils/hasRestrictingFields.test.ts index 898860d..bda9eb1 100644 --- a/test/utils/hasRestrictingFields.test.ts +++ b/test/utils/hasRestrictingFields.test.ts @@ -62,7 +62,7 @@ describe("utils - hasRestrictingFields", function () { assert.deepStrictEqual( result, ["id"], - `is subset for method '${method}'` + `is subset for method '${method}'`, ); }); }); @@ -86,7 +86,7 @@ describe("utils - hasRestrictingFields", function () { assert.deepStrictEqual( result, ["id"], - `is subset for method '${method}'` + `is subset for method '${method}'`, ); }); });