From 713ca7889da27030ffdde55ce1004e0578e64a17 Mon Sep 17 00:00:00 2001 From: Marshall Thompson Date: Tue, 16 Nov 2021 18:42:24 -0700 Subject: [PATCH] chore: rename legacy hooks to regular hooks --- package-lock.json | 519 ++++++++++-------- packages/feathers/src/application.ts | 18 +- packages/feathers/src/declarations.ts | 26 +- packages/feathers/src/hooks/index.ts | 18 +- .../src/hooks/{legacy.ts => regular.ts} | 64 +-- packages/feathers/test/application.test.ts | 6 +- packages/feathers/test/hooks/hooks.test.ts | 24 +- .../transport-commons/src/routing/index.ts | 2 +- 8 files changed, 355 insertions(+), 322 deletions(-) rename packages/feathers/src/hooks/{legacy.ts => regular.ts} (64%) diff --git a/package-lock.json b/package-lock.json index 7871699871..9f79d830e8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -95,9 +95,9 @@ } }, "node_modules/@babel/compat-data": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.16.0.tgz", - "integrity": "sha512-DGjt2QZse5SGd9nfOSqO4WLJ8NN/oHkijbXbPrxuoJO3oIPJL3TciZs9FX+cOHNiY9E9l0opL8g7BmLe3T+9ew==", + "version": "7.16.4", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.16.4.tgz", + "integrity": "sha512-1o/jo7D+kC9ZjHX5v+EHrdjl3PhxMrLSOTGsOdHJ+KL8HCaEK6ehrVL2RS6oHDZp+L7xLirLrPmQtEng769J/Q==", "engines": { "node": ">=6.9.0" } @@ -192,13 +192,13 @@ } }, "node_modules/@babel/helper-compilation-targets": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.16.0.tgz", - "integrity": "sha512-S7iaOT1SYlqK0sQaCi21RX4+13hmdmnxIEAnQUB/eh7GeAnRjOUgTYpLkUOiRXzD+yog1JxP0qyAQZ7ZxVxLVg==", + "version": "7.16.3", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.16.3.tgz", + "integrity": "sha512-vKsoSQAyBmxS35JUOOt+07cLc6Nk/2ljLIHwmq2/NM6hdioUaqEXq/S+nXvbvXbZkNDlWOymPanJGOc4CBjSJA==", "dependencies": { "@babel/compat-data": "^7.16.0", "@babel/helper-validator-option": "^7.14.5", - "browserslist": "^4.16.6", + "browserslist": "^4.17.5", "semver": "^6.3.0" }, "engines": { @@ -251,9 +251,9 @@ } }, "node_modules/@babel/helper-define-polyfill-provider": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.2.4.tgz", - "integrity": "sha512-OrpPZ97s+aPi6h2n1OXzdhVis1SGSsMU2aMHgLcOKfsp4/v1NWpx3CWT3lBj5eeBq9cDkPkh+YCfdF7O12uNDQ==", + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.3.0.tgz", + "integrity": "sha512-7hfT8lUljl/tM3h+izTX/pO3W3frz2ok6Pk+gzys8iJqDfZrZy2pXjRTZAvG2YmfHun1X4q8/UZRLatMfqc5Tg==", "dependencies": { "@babel/helper-compilation-targets": "^7.13.0", "@babel/helper-module-imports": "^7.12.13", @@ -382,9 +382,9 @@ } }, "node_modules/@babel/helper-remap-async-to-generator": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.16.0.tgz", - "integrity": "sha512-MLM1IOMe9aQBqMWxcRw8dcb9jlM86NIw7KA0Wri91Xkfied+dE0QuBFSBjMNvqzmS0OSIDsMNC24dBEkPUi7ew==", + "version": "7.16.4", + "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.16.4.tgz", + "integrity": "sha512-vGERmmhR+s7eH5Y/cp8PCVzj4XEjerq8jooMfxFdA5xVtAk9Sh4AQsrWgiErUEBjtGrBtOFKDUcWQFW4/dFwMA==", "dependencies": { "@babel/helper-annotate-as-pure": "^7.16.0", "@babel/helper-wrap-function": "^7.16.0", @@ -603,12 +603,12 @@ } }, "node_modules/@babel/plugin-proposal-async-generator-functions": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.16.0.tgz", - "integrity": "sha512-nyYmIo7ZqKsY6P4lnVmBlxp9B3a96CscbLotlsNuktMHahkDwoPYEjXrZHU0Tj844Z9f1IthVxQln57mhkcExw==", + "version": "7.16.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.16.4.tgz", + "integrity": "sha512-/CUekqaAaZCQHleSK/9HajvcD/zdnJiKRiuUFq8ITE+0HsPzquf53cpFiqAwl/UfmJbR6n5uGPQSPdrmKOvHHg==", "dependencies": { "@babel/helper-plugin-utils": "^7.14.5", - "@babel/helper-remap-async-to-generator": "^7.16.0", + "@babel/helper-remap-async-to-generator": "^7.16.4", "@babel/plugin-syntax-async-generators": "^7.8.4" }, "engines": { @@ -1323,9 +1323,9 @@ } }, "node_modules/@babel/plugin-transform-parameters": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.16.0.tgz", - "integrity": "sha512-XgnQEm1CevKROPx+udOi/8f8TiGhrUWiHiaUCIp47tE0tpFDjzXNTZc9E5CmCwxNjXTWEVqvRfWZYOTFvMa/ZQ==", + "version": "7.16.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.16.3.tgz", + "integrity": "sha512-3MaDpJrOXT1MZ/WCmkOFo7EtmVVC8H4EUZVrHvFOsmwkk4lOjQj8rzv8JKUZV4YoQKeoIgk07GO+acPU9IMu/w==", "dependencies": { "@babel/helper-plugin-utils": "^7.14.5" }, @@ -1479,17 +1479,17 @@ } }, "node_modules/@babel/preset-env": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.16.0.tgz", - "integrity": "sha512-cdTu/W0IrviamtnZiTfixPfIncr2M1VqRrkjzZWlr1B4TVYimCFK5jkyOdP4qw2MrlKHi+b3ORj6x8GoCew8Dg==", + "version": "7.16.4", + "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.16.4.tgz", + "integrity": "sha512-v0QtNd81v/xKj4gNKeuAerQ/azeNn/G1B1qMLeXOcV8+4TWlD2j3NV1u8q29SDFBXx/NBq5kyEAO+0mpRgacjA==", "dependencies": { - "@babel/compat-data": "^7.16.0", - "@babel/helper-compilation-targets": "^7.16.0", + "@babel/compat-data": "^7.16.4", + "@babel/helper-compilation-targets": "^7.16.3", "@babel/helper-plugin-utils": "^7.14.5", "@babel/helper-validator-option": "^7.14.5", - "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "^7.16.0", + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "^7.16.2", "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.16.0", - "@babel/plugin-proposal-async-generator-functions": "^7.16.0", + "@babel/plugin-proposal-async-generator-functions": "^7.16.4", "@babel/plugin-proposal-class-properties": "^7.16.0", "@babel/plugin-proposal-class-static-block": "^7.16.0", "@babel/plugin-proposal-dynamic-import": "^7.16.0", @@ -1539,7 +1539,7 @@ "@babel/plugin-transform-named-capturing-groups-regex": "^7.16.0", "@babel/plugin-transform-new-target": "^7.16.0", "@babel/plugin-transform-object-super": "^7.16.0", - "@babel/plugin-transform-parameters": "^7.16.0", + "@babel/plugin-transform-parameters": "^7.16.3", "@babel/plugin-transform-property-literals": "^7.16.0", "@babel/plugin-transform-regenerator": "^7.16.0", "@babel/plugin-transform-reserved-words": "^7.16.0", @@ -1552,10 +1552,10 @@ "@babel/plugin-transform-unicode-regex": "^7.16.0", "@babel/preset-modules": "^0.1.5", "@babel/types": "^7.16.0", - "babel-plugin-polyfill-corejs2": "^0.2.3", - "babel-plugin-polyfill-corejs3": "^0.3.0", - "babel-plugin-polyfill-regenerator": "^0.2.3", - "core-js-compat": "^3.19.0", + "babel-plugin-polyfill-corejs2": "^0.3.0", + "babel-plugin-polyfill-corejs3": "^0.4.0", + "babel-plugin-polyfill-regenerator": "^0.3.0", + "core-js-compat": "^3.19.1", "semver": "^6.3.0" }, "engines": { @@ -1589,9 +1589,9 @@ } }, "node_modules/@babel/runtime": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.16.0.tgz", - "integrity": "sha512-Nht8L0O8YCktmsDV6FqFue7vQLRx3Hb0B37lS5y0jDRqRxlBG4wIJHnf9/bgSE2UyipKFA01YtS+npRdTWBUyw==", + "version": "7.16.3", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.16.3.tgz", + "integrity": "sha512-WBwekcqacdY2e9AF/Q7WLFUWmdJGJTkbjqTjoMDgXkVZ3ZRUvOPsLb5KdwISoQVsbP+DQzVZW4Zhci0DvpbNTQ==", "dependencies": { "regenerator-runtime": "^0.13.4" }, @@ -3257,9 +3257,9 @@ "integrity": "sha512-LiMQ6EOPob/4yUL66SZzu6Yh77cbzJFYll+ZfaPiPPFswtIlA/Fs1MzdKYA7JApHU49zQTbJGX3PDmCpIdDBRQ==" }, "node_modules/@types/body-parser": { - "version": "1.19.1", - "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.1.tgz", - "integrity": "sha512-a6bTJ21vFOGIkwM0kzh9Yr89ziVxq4vYH2fQ6N8AeipEzai/cFK6aGMArIkUeIdRIgpwQa+2bXiLuUJCpSf2Cg==", + "version": "1.19.2", + "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.2.tgz", + "integrity": "sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==", "dependencies": { "@types/connect": "*", "@types/node": "*" @@ -3315,9 +3315,9 @@ "integrity": "sha512-vt+kDhq/M2ayberEtJcIN/hxXy1Pk+59g2FV/ZQceeaTyCtCucjL2Q7FXlFjtWn4n15KCr1NE2lNNFhp0lEThw==" }, "node_modules/@types/eslint": { - "version": "7.28.2", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-7.28.2.tgz", - "integrity": "sha512-KubbADPkfoU75KgKeKLsFHXnU4ipH7wYg0TRT33NK3N3yiu7jlFAAoygIWBV+KbuHx/G+AvuGX6DllnK35gfJA==", + "version": "7.29.0", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-7.29.0.tgz", + "integrity": "sha512-VNcvioYDH8/FxaeTKkM4/TiTwt6pBV9E3OfGmvaw8tPl0rrHCJ4Ll15HRT+pMiFAf/MLQvAzC+6RzUMEL9Ceng==", "dependencies": { "@types/estree": "*", "@types/json-schema": "*" @@ -3349,9 +3349,9 @@ } }, "node_modules/@types/express-serve-static-core": { - "version": "4.17.24", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.24.tgz", - "integrity": "sha512-3UJuW+Qxhzwjq3xhwXm2onQcFHn76frIYVbTu+kn24LFxI+dEhdfISDFovPB8VpEgW8oQCTpRuCe+0zJxB7NEA==", + "version": "4.17.25", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.25.tgz", + "integrity": "sha512-OUJIVfRMFijZukGGwTpKNFprqCCXk5WjNGvUgB/CxxBR40QWSjsNK86+yvGKlCOGc7sbwfHLaXhkG+NsytwBaQ==", "dependencies": { "@types/node": "*", "@types/qs": "*", @@ -3388,9 +3388,9 @@ "dev": true }, "node_modules/@types/jsonwebtoken": { - "version": "8.5.5", - "resolved": "https://registry.npmjs.org/@types/jsonwebtoken/-/jsonwebtoken-8.5.5.tgz", - "integrity": "sha512-OGqtHQ7N5/Ap/TUwO6IgHDuLiAoTmHhGpNvgkCm/F4N6pKzx/RBSfr2OXZSwC6vkfnsEdb6+7DNZVtiXiwdwFw==", + "version": "8.5.6", + "resolved": "https://registry.npmjs.org/@types/jsonwebtoken/-/jsonwebtoken-8.5.6.tgz", + "integrity": "sha512-+P3O/xC7nzVizIi5VbF34YtqSonFsdnbXBnWUCYRiKOi1f9gA4sEFvXkrGr/QVV23IbMYvcoerI7nnhDUiWXRQ==", "dependencies": { "@types/node": "*" } @@ -3440,9 +3440,9 @@ } }, "node_modules/@types/lodash": { - "version": "4.14.176", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.176.tgz", - "integrity": "sha512-xZmuPTa3rlZoIbtDUyJKZQimJV3bxCmzMIO2c9Pz9afyDro6kr7R79GwcB6mRhuoPmV2p1Vb66WOJH7F886WKQ==" + "version": "4.14.177", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.177.tgz", + "integrity": "sha512-0fDwydE2clKe9MNfvXHBHF9WEahRuj+msTuQqOmAApNORFvhMYZKNGGJdCzuhheVjMps/ti0Ak/iJPACMaevvw==" }, "node_modules/@types/mime": { "version": "1.3.2", @@ -3476,9 +3476,9 @@ } }, "node_modules/@types/node": { - "version": "16.11.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.6.tgz", - "integrity": "sha512-ua7PgUoeQFjmWPcoo9khiPum3Pd60k4/2ZGXt18sm2Slk0W0xZTqt5Y0Ny1NyBiN1EVQ/+FaF9NcY4Qe6rwk5w==" + "version": "16.11.7", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.7.tgz", + "integrity": "sha512-QB5D2sqfSjCmTuWcBWyJ+/44bcjO7VbjSbOE0ucoVbAsSNQc4Lt6QkgkVXkTDwkL4z/beecZNDvVX15D4P8Jbw==" }, "node_modules/@types/node-fetch": { "version": "3.0.3", @@ -3983,9 +3983,9 @@ } }, "node_modules/ajv": { - "version": "8.6.3", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.6.3.tgz", - "integrity": "sha512-SMJOdDP6LqTkD0Uq8qLi+gMwSt0imXLSV080qFVwJCpH9U6Mb+SUGHAXM0KNbcBPguytWyvFxcHgMLe2D2XSpw==", + "version": "8.8.1", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.8.1.tgz", + "integrity": "sha512-6CiMNDrzv0ZR916u2T+iRunnD60uWmNn8SkdB44/6stVORUg0aAkWO7PkOhpCmjmW8f2I/G/xnowD66fxGyQJg==", "dependencies": { "fast-deep-equal": "^3.1.1", "json-schema-traverse": "^1.0.0", @@ -4995,12 +4995,12 @@ } }, "node_modules/babel-plugin-polyfill-corejs2": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.2.3.tgz", - "integrity": "sha512-NDZ0auNRzmAfE1oDDPW2JhzIMXUk+FFe2ICejmt5T4ocKgiQx3e0VCRx9NCAidcMtL2RUZaWtXnmjTCkx0tcbA==", + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.3.0.tgz", + "integrity": "sha512-wMDoBJ6uG4u4PNFh72Ty6t3EgfA91puCuAwKIazbQlci+ENb/UU9A3xG5lutjUIiXCIn1CY5L15r9LimiJyrSA==", "dependencies": { "@babel/compat-data": "^7.13.11", - "@babel/helper-define-polyfill-provider": "^0.2.4", + "@babel/helper-define-polyfill-provider": "^0.3.0", "semver": "^6.1.1" }, "peerDependencies": { @@ -5016,11 +5016,11 @@ } }, "node_modules/babel-plugin-polyfill-corejs3": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.3.0.tgz", - "integrity": "sha512-JLwi9vloVdXLjzACL80j24bG6/T1gYxwowG44dg6HN/7aTPdyPbJJidf6ajoA3RPHHtW0j9KMrSOLpIZpAnPpg==", + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.4.0.tgz", + "integrity": "sha512-YxFreYwUfglYKdLUGvIF2nJEsGwj+RhWSX/ije3D2vQPOXuyMLMtg/cCGMDpOA7Nd+MwlNdnGODbd2EwUZPlsw==", "dependencies": { - "@babel/helper-define-polyfill-provider": "^0.2.4", + "@babel/helper-define-polyfill-provider": "^0.3.0", "core-js-compat": "^3.18.0" }, "peerDependencies": { @@ -5028,11 +5028,11 @@ } }, "node_modules/babel-plugin-polyfill-regenerator": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.2.3.tgz", - "integrity": "sha512-JVE78oRZPKFIeUqFGrSORNzQnrDwZR16oiWeGM8ZyjBn2XAT5OjP+wXx5ESuo33nUsFUEJYjtklnsKbxW5L+7g==", + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.3.0.tgz", + "integrity": "sha512-dhAPTDLGoMW5/84wkgwiLRwMnio2i1fUe53EuvtKMv0pn2p3S8OCoV1xAzfJPl0KOX7IB89s2ib85vbYiea3jg==", "dependencies": { - "@babel/helper-define-polyfill-provider": "^0.2.4" + "@babel/helper-define-polyfill-provider": "^0.3.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" @@ -7266,9 +7266,9 @@ } }, "node_modules/engine.io-client": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-6.0.2.tgz", - "integrity": "sha512-cAep9lhZV6Q8jMXx3TNSU5cydMzMed8/O7Tz5uzyqZvpNPtQ3WQXrLYGADxlsuaFmOLN7wZLmT7ImiFhUOku8g==", + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-6.0.3.tgz", + "integrity": "sha512-IH8ZhDIwiLv0d/wXVzmjfV9Y82hbJIDhCGSVUV8o1kcpDe2I6Y3bZA3ZbJy4Ls7k7IVmcy/qn4k9RKWFhUGf5w==", "dependencies": { "@socket.io/component-emitter": "~3.0.0", "debug": "~4.3.1", @@ -7302,9 +7302,9 @@ } }, "node_modules/engine.io-parser": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.0.1.tgz", - "integrity": "sha512-j4p3WwJrG2k92VISM0op7wiq60vO92MlF3CRGxhKHy9ywG1/Dkc72g0dXeDQ+//hrcDn8gqQzoEkdO9FN0d9AA==", + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.0.2.tgz", + "integrity": "sha512-wuiO7qO/OEkPJSFueuATIXtrxF7/6GTbAO9QLv7nnbjwZ5tYhLm9zxvLwxstRs0dcT0KUlWTjtIOs1T86jt12g==", "dependencies": { "base64-arraybuffer": "~1.0.1" }, @@ -9592,15 +9592,15 @@ } }, "node_modules/http-assert/node_modules/http-errors": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.0.tgz", - "integrity": "sha512-4I8r0C5JDhT5VkvI47QktDW75rNlGVsUf/8hzjCC/wkWI/jdTRmBb9aI7erSG82r1bjKY3F6k28WnsVxB1C73A==", + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.1.tgz", + "integrity": "sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==", "dependencies": { "depd": "~1.1.2", "inherits": "2.0.4", "setprototypeof": "1.2.0", "statuses": ">= 1.5.0 < 2", - "toidentifier": "1.0.0" + "toidentifier": "1.0.1" }, "engines": { "node": ">= 0.6" @@ -9611,6 +9611,14 @@ "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" }, + "node_modules/http-assert/node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "engines": { + "node": ">=0.6" + } + }, "node_modules/http-cache-semantics": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz", @@ -13058,21 +13066,40 @@ } }, "node_modules/mongodb-connection-string-url": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mongodb-connection-string-url/-/mongodb-connection-string-url-2.1.0.tgz", - "integrity": "sha512-Qf9Zw7KGiRljWvMrrUFDdVqo46KIEiDuCzvEN97rh/PcKzk2bd6n9KuzEwBwW9xo5glwx69y1mI6s+jFUD/aIQ==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/mongodb-connection-string-url/-/mongodb-connection-string-url-2.2.0.tgz", + "integrity": "sha512-U0cDxLUrQrl7DZA828CA+o69EuWPWEJTwdMPozyd7cy/dbtncUZczMw7wRHcwMD7oKOn0NM2tF9jdf5FFVW9CA==", "dependencies": { "@types/whatwg-url": "^8.2.1", - "whatwg-url": "^9.1.0" + "whatwg-url": "^11.0.0" + } + }, + "node_modules/mongodb-connection-string-url/node_modules/tr46": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-3.0.0.tgz", + "integrity": "sha512-l7FvfAHlcmulp8kr+flpQZmVwtu7nfRV7NZujtN0OqES8EL4O4e0qqzL0DC5gAvx/ZC/9lk6rhcUwYvkBnBnYA==", + "dependencies": { + "punycode": "^2.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/mongodb-connection-string-url/node_modules/webidl-conversions": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", + "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", + "engines": { + "node": ">=12" } }, "node_modules/mongodb-connection-string-url/node_modules/whatwg-url": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-9.1.0.tgz", - "integrity": "sha512-CQ0UcrPHyomtlOCot1TL77WyMIm/bCwrJ2D6AOKGwEczU9EpyoqAokfqrf/MioU9kHcMsmJZcg1egXix2KYEsA==", + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-11.0.0.tgz", + "integrity": "sha512-RKT8HExMpoYx4igMiVMY83lN6UeITKJlBQ+vR/8ZJ8OCdSiN3RwCq+9gH0+Xzj0+5IrM6i4j/6LuvzbZIQgEcQ==", "dependencies": { - "tr46": "^2.1.0", - "webidl-conversions": "^6.1.0" + "tr46": "^3.0.0", + "webidl-conversions": "^7.0.0" }, "engines": { "node": ">=12" @@ -16086,9 +16113,9 @@ } }, "node_modules/socket.io": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.3.1.tgz", - "integrity": "sha512-HC5w5Olv2XZ0XJ4gOLGzzHEuOCfj3G0SmoW3jLHYYh34EVsIr3EkW9h6kgfW+K3TFEcmYy8JcPWe//KUkBp5jA==", + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.3.2.tgz", + "integrity": "sha512-6S5tV4jcY6dbZ/lLzD6EkvNWI3s81JO6ABP/EpvOlK1NPOcIj3AS4khi6xXw6JlZCASq82HQV4SapfmVMMl2dg==", "dependencies": { "accepts": "~1.3.4", "base64id": "~2.0.0", @@ -16102,9 +16129,9 @@ } }, "node_modules/socket.io-adapter": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-2.3.2.tgz", - "integrity": "sha512-PBZpxUPYjmoogY0aoaTmo1643JelsaS1CiAwNjRVdrI0X9Seuc19Y2Wife8k88avW6haG8cznvwbubAZwH4Mtg==" + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-2.3.3.tgz", + "integrity": "sha512-Qd/iwn3VskrpNO60BeRyCyr8ZWw9CPZyitW4AQwmRZ8zCiyDiL+znRnWX6tDHXnWn1sJrM1+b6Mn6wEDJJ4aYQ==" }, "node_modules/socket.io-client": { "version": "4.3.2", @@ -16674,9 +16701,9 @@ } }, "node_modules/terser": { - "version": "5.9.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.9.0.tgz", - "integrity": "sha512-h5hxa23sCdpzcye/7b8YqbE5OwKca/ni0RQz1uRX3tGh8haaGHqcuSqbGRybuAKNdntZ0mDgFNXPJ48xQ2RXKQ==", + "version": "5.10.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.10.0.tgz", + "integrity": "sha512-AMmF99DMfEDiRJfxfY5jj5wNH/bYO09cniSqhfoyxc8sFoYIgkJy86G04UoZU5VjlpnplVu0K6Tx6E9b5+DlHA==", "dependencies": { "commander": "^2.20.0", "source-map": "~0.7.2", @@ -16687,15 +16714,22 @@ }, "engines": { "node": ">=10" + }, + "peerDependencies": { + "acorn": "^8.5.0" + }, + "peerDependenciesMeta": { + "acorn": { + "optional": true + } } }, "node_modules/terser-webpack-plugin": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.2.4.tgz", - "integrity": "sha512-E2CkNMN+1cho04YpdANyRrn8CyN4yMy+WdFKZIySFZrGXZxJwJP6PMNGGc/Mcr6qygQHUUqRxnAPmi0M9f00XA==", + "version": "5.2.5", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.2.5.tgz", + "integrity": "sha512-3luOVHku5l0QBeYS8r4CdHYWEGMmIj3H1U64jgkdZzECcSOJAyJ9TjuqcQZvw1Y+4AOBN9SeYJPJmFn2cM4/2g==", "dependencies": { "jest-worker": "^27.0.6", - "p-limit": "^3.1.0", "schema-utils": "^3.1.1", "serialize-javascript": "^6.0.0", "source-map": "^0.6.1", @@ -16751,20 +16785,6 @@ "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" }, - "node_modules/terser-webpack-plugin/node_modules/p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dependencies": { - "yocto-queue": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/terser-webpack-plugin/node_modules/schema-utils": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz", @@ -16920,6 +16940,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/tr46/-/tr46-2.1.0.tgz", "integrity": "sha512-15Ih7phfcdP5YxqiB+iDtLoaTz4Nd35+IiAv0kQ5FNKHzXgdWqPoTIqEDDJmXceQt4JZk6lVPT8lnDlPpGDppw==", + "dev": true, "dependencies": { "punycode": "^2.1.1" }, @@ -17518,14 +17539,15 @@ "version": "6.1.0", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-6.1.0.tgz", "integrity": "sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w==", + "dev": true, "engines": { "node": ">=10.4" } }, "node_modules/webpack": { - "version": "5.62.1", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.62.1.tgz", - "integrity": "sha512-jNLtnWChS2CMZ7vqWtztv0G6fYB5hz11Zsadp5tE7e4/66zVDj7/KUeQZOsOl8Hz5KrLJH1h2eIDl6AnlyE12Q==", + "version": "5.64.1", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.64.1.tgz", + "integrity": "sha512-b4FHmRgaaAjP+aVOVz41a9Qa5SmkUPQ+u8FntTQ1roPHahSComB6rXnLwc976VhUY4CqTaLu5mCswuHiNhOfVw==", "dependencies": { "@types/eslint-scope": "^3.7.0", "@types/estree": "^0.0.50", @@ -17550,7 +17572,7 @@ "tapable": "^2.1.1", "terser-webpack-plugin": "^5.1.3", "watchpack": "^2.2.0", - "webpack-sources": "^3.2.0" + "webpack-sources": "^3.2.2" }, "bin": { "webpack": "bin/webpack.js" @@ -17650,9 +17672,9 @@ } }, "node_modules/webpack-sources": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.1.tgz", - "integrity": "sha512-t6BMVLQ0AkjBOoRTZgqrWm7xbXMBzD+XDq2EZ96+vMfn3qKgsvdXZhbPZ4ElUOpdv4u+iiGe+w3+J75iy/bYGA==", + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.2.tgz", + "integrity": "sha512-cp5qdmHnu5T8wRg2G3vZZHoJPN14aqQ89SyQ11NpGH5zEMDCclt49rzo+MaRazk7/UeILhAI+/sEtcM+7Fr0nw==", "engines": { "node": ">=10.13.0" } @@ -18111,9 +18133,9 @@ } }, "node_modules/yargs-unparser/node_modules/camelcase": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.2.0.tgz", - "integrity": "sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.2.1.tgz", + "integrity": "sha512-tVI4q5jjFV5CavAU8DXfza/TJcZutVKo/5Foskmsqcm0MsL91moHvwiGNnqaa2o6PF/7yT5ikDRcVcl8Rj6LCA==", "engines": { "node": ">=10" }, @@ -18192,9 +18214,9 @@ } }, "@babel/compat-data": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.16.0.tgz", - "integrity": "sha512-DGjt2QZse5SGd9nfOSqO4WLJ8NN/oHkijbXbPrxuoJO3oIPJL3TciZs9FX+cOHNiY9E9l0opL8g7BmLe3T+9ew==" + "version": "7.16.4", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.16.4.tgz", + "integrity": "sha512-1o/jo7D+kC9ZjHX5v+EHrdjl3PhxMrLSOTGsOdHJ+KL8HCaEK6ehrVL2RS6oHDZp+L7xLirLrPmQtEng769J/Q==" }, "@babel/core": { "version": "7.16.0", @@ -18265,13 +18287,13 @@ } }, "@babel/helper-compilation-targets": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.16.0.tgz", - "integrity": "sha512-S7iaOT1SYlqK0sQaCi21RX4+13hmdmnxIEAnQUB/eh7GeAnRjOUgTYpLkUOiRXzD+yog1JxP0qyAQZ7ZxVxLVg==", + "version": "7.16.3", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.16.3.tgz", + "integrity": "sha512-vKsoSQAyBmxS35JUOOt+07cLc6Nk/2ljLIHwmq2/NM6hdioUaqEXq/S+nXvbvXbZkNDlWOymPanJGOc4CBjSJA==", "requires": { "@babel/compat-data": "^7.16.0", "@babel/helper-validator-option": "^7.14.5", - "browserslist": "^4.16.6", + "browserslist": "^4.17.5", "semver": "^6.3.0" }, "dependencies": { @@ -18305,9 +18327,9 @@ } }, "@babel/helper-define-polyfill-provider": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.2.4.tgz", - "integrity": "sha512-OrpPZ97s+aPi6h2n1OXzdhVis1SGSsMU2aMHgLcOKfsp4/v1NWpx3CWT3lBj5eeBq9cDkPkh+YCfdF7O12uNDQ==", + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.3.0.tgz", + "integrity": "sha512-7hfT8lUljl/tM3h+izTX/pO3W3frz2ok6Pk+gzys8iJqDfZrZy2pXjRTZAvG2YmfHun1X4q8/UZRLatMfqc5Tg==", "requires": { "@babel/helper-compilation-targets": "^7.13.0", "@babel/helper-module-imports": "^7.12.13", @@ -18405,9 +18427,9 @@ "integrity": "sha512-/37qQCE3K0vvZKwoK4XU/irIJQdIfCJuhU5eKnNxpFDsOkgFaUAwbv+RYw6eYgsC0E4hS7r5KqGULUogqui0fQ==" }, "@babel/helper-remap-async-to-generator": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.16.0.tgz", - "integrity": "sha512-MLM1IOMe9aQBqMWxcRw8dcb9jlM86NIw7KA0Wri91Xkfied+dE0QuBFSBjMNvqzmS0OSIDsMNC24dBEkPUi7ew==", + "version": "7.16.4", + "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.16.4.tgz", + "integrity": "sha512-vGERmmhR+s7eH5Y/cp8PCVzj4XEjerq8jooMfxFdA5xVtAk9Sh4AQsrWgiErUEBjtGrBtOFKDUcWQFW4/dFwMA==", "requires": { "@babel/helper-annotate-as-pure": "^7.16.0", "@babel/helper-wrap-function": "^7.16.0", @@ -18565,12 +18587,12 @@ } }, "@babel/plugin-proposal-async-generator-functions": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.16.0.tgz", - "integrity": "sha512-nyYmIo7ZqKsY6P4lnVmBlxp9B3a96CscbLotlsNuktMHahkDwoPYEjXrZHU0Tj844Z9f1IthVxQln57mhkcExw==", + "version": "7.16.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.16.4.tgz", + "integrity": "sha512-/CUekqaAaZCQHleSK/9HajvcD/zdnJiKRiuUFq8ITE+0HsPzquf53cpFiqAwl/UfmJbR6n5uGPQSPdrmKOvHHg==", "requires": { "@babel/helper-plugin-utils": "^7.14.5", - "@babel/helper-remap-async-to-generator": "^7.16.0", + "@babel/helper-remap-async-to-generator": "^7.16.4", "@babel/plugin-syntax-async-generators": "^7.8.4" } }, @@ -19017,9 +19039,9 @@ } }, "@babel/plugin-transform-parameters": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.16.0.tgz", - "integrity": "sha512-XgnQEm1CevKROPx+udOi/8f8TiGhrUWiHiaUCIp47tE0tpFDjzXNTZc9E5CmCwxNjXTWEVqvRfWZYOTFvMa/ZQ==", + "version": "7.16.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.16.3.tgz", + "integrity": "sha512-3MaDpJrOXT1MZ/WCmkOFo7EtmVVC8H4EUZVrHvFOsmwkk4lOjQj8rzv8JKUZV4YoQKeoIgk07GO+acPU9IMu/w==", "requires": { "@babel/helper-plugin-utils": "^7.14.5" } @@ -19107,17 +19129,17 @@ } }, "@babel/preset-env": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.16.0.tgz", - "integrity": "sha512-cdTu/W0IrviamtnZiTfixPfIncr2M1VqRrkjzZWlr1B4TVYimCFK5jkyOdP4qw2MrlKHi+b3ORj6x8GoCew8Dg==", + "version": "7.16.4", + "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.16.4.tgz", + "integrity": "sha512-v0QtNd81v/xKj4gNKeuAerQ/azeNn/G1B1qMLeXOcV8+4TWlD2j3NV1u8q29SDFBXx/NBq5kyEAO+0mpRgacjA==", "requires": { - "@babel/compat-data": "^7.16.0", - "@babel/helper-compilation-targets": "^7.16.0", + "@babel/compat-data": "^7.16.4", + "@babel/helper-compilation-targets": "^7.16.3", "@babel/helper-plugin-utils": "^7.14.5", "@babel/helper-validator-option": "^7.14.5", - "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "^7.16.0", + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "^7.16.2", "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.16.0", - "@babel/plugin-proposal-async-generator-functions": "^7.16.0", + "@babel/plugin-proposal-async-generator-functions": "^7.16.4", "@babel/plugin-proposal-class-properties": "^7.16.0", "@babel/plugin-proposal-class-static-block": "^7.16.0", "@babel/plugin-proposal-dynamic-import": "^7.16.0", @@ -19167,7 +19189,7 @@ "@babel/plugin-transform-named-capturing-groups-regex": "^7.16.0", "@babel/plugin-transform-new-target": "^7.16.0", "@babel/plugin-transform-object-super": "^7.16.0", - "@babel/plugin-transform-parameters": "^7.16.0", + "@babel/plugin-transform-parameters": "^7.16.3", "@babel/plugin-transform-property-literals": "^7.16.0", "@babel/plugin-transform-regenerator": "^7.16.0", "@babel/plugin-transform-reserved-words": "^7.16.0", @@ -19180,10 +19202,10 @@ "@babel/plugin-transform-unicode-regex": "^7.16.0", "@babel/preset-modules": "^0.1.5", "@babel/types": "^7.16.0", - "babel-plugin-polyfill-corejs2": "^0.2.3", - "babel-plugin-polyfill-corejs3": "^0.3.0", - "babel-plugin-polyfill-regenerator": "^0.2.3", - "core-js-compat": "^3.19.0", + "babel-plugin-polyfill-corejs2": "^0.3.0", + "babel-plugin-polyfill-corejs3": "^0.4.0", + "babel-plugin-polyfill-regenerator": "^0.3.0", + "core-js-compat": "^3.19.1", "semver": "^6.3.0" }, "dependencies": { @@ -19207,9 +19229,9 @@ } }, "@babel/runtime": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.16.0.tgz", - "integrity": "sha512-Nht8L0O8YCktmsDV6FqFue7vQLRx3Hb0B37lS5y0jDRqRxlBG4wIJHnf9/bgSE2UyipKFA01YtS+npRdTWBUyw==", + "version": "7.16.3", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.16.3.tgz", + "integrity": "sha512-WBwekcqacdY2e9AF/Q7WLFUWmdJGJTkbjqTjoMDgXkVZ3ZRUvOPsLb5KdwISoQVsbP+DQzVZW4Zhci0DvpbNTQ==", "requires": { "regenerator-runtime": "^0.13.4" }, @@ -20583,9 +20605,9 @@ "integrity": "sha512-LiMQ6EOPob/4yUL66SZzu6Yh77cbzJFYll+ZfaPiPPFswtIlA/Fs1MzdKYA7JApHU49zQTbJGX3PDmCpIdDBRQ==" }, "@types/body-parser": { - "version": "1.19.1", - "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.1.tgz", - "integrity": "sha512-a6bTJ21vFOGIkwM0kzh9Yr89ziVxq4vYH2fQ6N8AeipEzai/cFK6aGMArIkUeIdRIgpwQa+2bXiLuUJCpSf2Cg==", + "version": "1.19.2", + "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.2.tgz", + "integrity": "sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==", "requires": { "@types/connect": "*", "@types/node": "*" @@ -20641,9 +20663,9 @@ "integrity": "sha512-vt+kDhq/M2ayberEtJcIN/hxXy1Pk+59g2FV/ZQceeaTyCtCucjL2Q7FXlFjtWn4n15KCr1NE2lNNFhp0lEThw==" }, "@types/eslint": { - "version": "7.28.2", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-7.28.2.tgz", - "integrity": "sha512-KubbADPkfoU75KgKeKLsFHXnU4ipH7wYg0TRT33NK3N3yiu7jlFAAoygIWBV+KbuHx/G+AvuGX6DllnK35gfJA==", + "version": "7.29.0", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-7.29.0.tgz", + "integrity": "sha512-VNcvioYDH8/FxaeTKkM4/TiTwt6pBV9E3OfGmvaw8tPl0rrHCJ4Ll15HRT+pMiFAf/MLQvAzC+6RzUMEL9Ceng==", "requires": { "@types/estree": "*", "@types/json-schema": "*" @@ -20675,9 +20697,9 @@ } }, "@types/express-serve-static-core": { - "version": "4.17.24", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.24.tgz", - "integrity": "sha512-3UJuW+Qxhzwjq3xhwXm2onQcFHn76frIYVbTu+kn24LFxI+dEhdfISDFovPB8VpEgW8oQCTpRuCe+0zJxB7NEA==", + "version": "4.17.25", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.25.tgz", + "integrity": "sha512-OUJIVfRMFijZukGGwTpKNFprqCCXk5WjNGvUgB/CxxBR40QWSjsNK86+yvGKlCOGc7sbwfHLaXhkG+NsytwBaQ==", "requires": { "@types/node": "*", "@types/qs": "*", @@ -20714,9 +20736,9 @@ "dev": true }, "@types/jsonwebtoken": { - "version": "8.5.5", - "resolved": "https://registry.npmjs.org/@types/jsonwebtoken/-/jsonwebtoken-8.5.5.tgz", - "integrity": "sha512-OGqtHQ7N5/Ap/TUwO6IgHDuLiAoTmHhGpNvgkCm/F4N6pKzx/RBSfr2OXZSwC6vkfnsEdb6+7DNZVtiXiwdwFw==", + "version": "8.5.6", + "resolved": "https://registry.npmjs.org/@types/jsonwebtoken/-/jsonwebtoken-8.5.6.tgz", + "integrity": "sha512-+P3O/xC7nzVizIi5VbF34YtqSonFsdnbXBnWUCYRiKOi1f9gA4sEFvXkrGr/QVV23IbMYvcoerI7nnhDUiWXRQ==", "requires": { "@types/node": "*" } @@ -20766,9 +20788,9 @@ } }, "@types/lodash": { - "version": "4.14.176", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.176.tgz", - "integrity": "sha512-xZmuPTa3rlZoIbtDUyJKZQimJV3bxCmzMIO2c9Pz9afyDro6kr7R79GwcB6mRhuoPmV2p1Vb66WOJH7F886WKQ==" + "version": "4.14.177", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.177.tgz", + "integrity": "sha512-0fDwydE2clKe9MNfvXHBHF9WEahRuj+msTuQqOmAApNORFvhMYZKNGGJdCzuhheVjMps/ti0Ak/iJPACMaevvw==" }, "@types/mime": { "version": "1.3.2", @@ -20801,9 +20823,9 @@ } }, "@types/node": { - "version": "16.11.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.6.tgz", - "integrity": "sha512-ua7PgUoeQFjmWPcoo9khiPum3Pd60k4/2ZGXt18sm2Slk0W0xZTqt5Y0Ny1NyBiN1EVQ/+FaF9NcY4Qe6rwk5w==" + "version": "16.11.7", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.7.tgz", + "integrity": "sha512-QB5D2sqfSjCmTuWcBWyJ+/44bcjO7VbjSbOE0ucoVbAsSNQc4Lt6QkgkVXkTDwkL4z/beecZNDvVX15D4P8Jbw==" }, "@types/node-fetch": { "version": "3.0.3", @@ -21195,9 +21217,9 @@ } }, "ajv": { - "version": "8.6.3", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.6.3.tgz", - "integrity": "sha512-SMJOdDP6LqTkD0Uq8qLi+gMwSt0imXLSV080qFVwJCpH9U6Mb+SUGHAXM0KNbcBPguytWyvFxcHgMLe2D2XSpw==", + "version": "8.8.1", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.8.1.tgz", + "integrity": "sha512-6CiMNDrzv0ZR916u2T+iRunnD60uWmNn8SkdB44/6stVORUg0aAkWO7PkOhpCmjmW8f2I/G/xnowD66fxGyQJg==", "requires": { "fast-deep-equal": "^3.1.1", "json-schema-traverse": "^1.0.0", @@ -22052,12 +22074,12 @@ } }, "babel-plugin-polyfill-corejs2": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.2.3.tgz", - "integrity": "sha512-NDZ0auNRzmAfE1oDDPW2JhzIMXUk+FFe2ICejmt5T4ocKgiQx3e0VCRx9NCAidcMtL2RUZaWtXnmjTCkx0tcbA==", + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.3.0.tgz", + "integrity": "sha512-wMDoBJ6uG4u4PNFh72Ty6t3EgfA91puCuAwKIazbQlci+ENb/UU9A3xG5lutjUIiXCIn1CY5L15r9LimiJyrSA==", "requires": { "@babel/compat-data": "^7.13.11", - "@babel/helper-define-polyfill-provider": "^0.2.4", + "@babel/helper-define-polyfill-provider": "^0.3.0", "semver": "^6.1.1" }, "dependencies": { @@ -22069,20 +22091,20 @@ } }, "babel-plugin-polyfill-corejs3": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.3.0.tgz", - "integrity": "sha512-JLwi9vloVdXLjzACL80j24bG6/T1gYxwowG44dg6HN/7aTPdyPbJJidf6ajoA3RPHHtW0j9KMrSOLpIZpAnPpg==", + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.4.0.tgz", + "integrity": "sha512-YxFreYwUfglYKdLUGvIF2nJEsGwj+RhWSX/ije3D2vQPOXuyMLMtg/cCGMDpOA7Nd+MwlNdnGODbd2EwUZPlsw==", "requires": { - "@babel/helper-define-polyfill-provider": "^0.2.4", + "@babel/helper-define-polyfill-provider": "^0.3.0", "core-js-compat": "^3.18.0" } }, "babel-plugin-polyfill-regenerator": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.2.3.tgz", - "integrity": "sha512-JVE78oRZPKFIeUqFGrSORNzQnrDwZR16oiWeGM8ZyjBn2XAT5OjP+wXx5ESuo33nUsFUEJYjtklnsKbxW5L+7g==", + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.3.0.tgz", + "integrity": "sha512-dhAPTDLGoMW5/84wkgwiLRwMnio2i1fUe53EuvtKMv0pn2p3S8OCoV1xAzfJPl0KOX7IB89s2ib85vbYiea3jg==", "requires": { - "@babel/helper-define-polyfill-provider": "^0.2.4" + "@babel/helper-define-polyfill-provider": "^0.3.0" } }, "babel-plugin-syntax-async-functions": { @@ -23955,9 +23977,9 @@ } }, "engine.io-client": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-6.0.2.tgz", - "integrity": "sha512-cAep9lhZV6Q8jMXx3TNSU5cydMzMed8/O7Tz5uzyqZvpNPtQ3WQXrLYGADxlsuaFmOLN7wZLmT7ImiFhUOku8g==", + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-6.0.3.tgz", + "integrity": "sha512-IH8ZhDIwiLv0d/wXVzmjfV9Y82hbJIDhCGSVUV8o1kcpDe2I6Y3bZA3ZbJy4Ls7k7IVmcy/qn4k9RKWFhUGf5w==", "requires": { "@socket.io/component-emitter": "~3.0.0", "debug": "~4.3.1", @@ -23979,9 +24001,9 @@ } }, "engine.io-parser": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.0.1.tgz", - "integrity": "sha512-j4p3WwJrG2k92VISM0op7wiq60vO92MlF3CRGxhKHy9ywG1/Dkc72g0dXeDQ+//hrcDn8gqQzoEkdO9FN0d9AA==", + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.0.2.tgz", + "integrity": "sha512-wuiO7qO/OEkPJSFueuATIXtrxF7/6GTbAO9QLv7nnbjwZ5tYhLm9zxvLwxstRs0dcT0KUlWTjtIOs1T86jt12g==", "requires": { "base64-arraybuffer": "~1.0.1" } @@ -25730,21 +25752,26 @@ }, "dependencies": { "http-errors": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.0.tgz", - "integrity": "sha512-4I8r0C5JDhT5VkvI47QktDW75rNlGVsUf/8hzjCC/wkWI/jdTRmBb9aI7erSG82r1bjKY3F6k28WnsVxB1C73A==", + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.1.tgz", + "integrity": "sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==", "requires": { "depd": "~1.1.2", "inherits": "2.0.4", "setprototypeof": "1.2.0", "statuses": ">= 1.5.0 < 2", - "toidentifier": "1.0.0" + "toidentifier": "1.0.1" } }, "setprototypeof": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" + }, + "toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==" } } }, @@ -28471,21 +28498,34 @@ } }, "mongodb-connection-string-url": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mongodb-connection-string-url/-/mongodb-connection-string-url-2.1.0.tgz", - "integrity": "sha512-Qf9Zw7KGiRljWvMrrUFDdVqo46KIEiDuCzvEN97rh/PcKzk2bd6n9KuzEwBwW9xo5glwx69y1mI6s+jFUD/aIQ==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/mongodb-connection-string-url/-/mongodb-connection-string-url-2.2.0.tgz", + "integrity": "sha512-U0cDxLUrQrl7DZA828CA+o69EuWPWEJTwdMPozyd7cy/dbtncUZczMw7wRHcwMD7oKOn0NM2tF9jdf5FFVW9CA==", "requires": { "@types/whatwg-url": "^8.2.1", - "whatwg-url": "^9.1.0" + "whatwg-url": "^11.0.0" }, "dependencies": { + "tr46": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-3.0.0.tgz", + "integrity": "sha512-l7FvfAHlcmulp8kr+flpQZmVwtu7nfRV7NZujtN0OqES8EL4O4e0qqzL0DC5gAvx/ZC/9lk6rhcUwYvkBnBnYA==", + "requires": { + "punycode": "^2.1.1" + } + }, + "webidl-conversions": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", + "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==" + }, "whatwg-url": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-9.1.0.tgz", - "integrity": "sha512-CQ0UcrPHyomtlOCot1TL77WyMIm/bCwrJ2D6AOKGwEczU9EpyoqAokfqrf/MioU9kHcMsmJZcg1egXix2KYEsA==", + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-11.0.0.tgz", + "integrity": "sha512-RKT8HExMpoYx4igMiVMY83lN6UeITKJlBQ+vR/8ZJ8OCdSiN3RwCq+9gH0+Xzj0+5IrM6i4j/6LuvzbZIQgEcQ==", "requires": { - "tr46": "^2.1.0", - "webidl-conversions": "^6.1.0" + "tr46": "^3.0.0", + "webidl-conversions": "^7.0.0" } } } @@ -30850,9 +30890,9 @@ "dev": true }, "socket.io": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.3.1.tgz", - "integrity": "sha512-HC5w5Olv2XZ0XJ4gOLGzzHEuOCfj3G0SmoW3jLHYYh34EVsIr3EkW9h6kgfW+K3TFEcmYy8JcPWe//KUkBp5jA==", + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.3.2.tgz", + "integrity": "sha512-6S5tV4jcY6dbZ/lLzD6EkvNWI3s81JO6ABP/EpvOlK1NPOcIj3AS4khi6xXw6JlZCASq82HQV4SapfmVMMl2dg==", "requires": { "accepts": "~1.3.4", "base64id": "~2.0.0", @@ -30863,9 +30903,9 @@ } }, "socket.io-adapter": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-2.3.2.tgz", - "integrity": "sha512-PBZpxUPYjmoogY0aoaTmo1643JelsaS1CiAwNjRVdrI0X9Seuc19Y2Wife8k88avW6haG8cznvwbubAZwH4Mtg==" + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-2.3.3.tgz", + "integrity": "sha512-Qd/iwn3VskrpNO60BeRyCyr8ZWw9CPZyitW4AQwmRZ8zCiyDiL+znRnWX6tDHXnWn1sJrM1+b6Mn6wEDJJ4aYQ==" }, "socket.io-client": { "version": "4.3.2", @@ -31305,9 +31345,9 @@ } }, "terser": { - "version": "5.9.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.9.0.tgz", - "integrity": "sha512-h5hxa23sCdpzcye/7b8YqbE5OwKca/ni0RQz1uRX3tGh8haaGHqcuSqbGRybuAKNdntZ0mDgFNXPJ48xQ2RXKQ==", + "version": "5.10.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.10.0.tgz", + "integrity": "sha512-AMmF99DMfEDiRJfxfY5jj5wNH/bYO09cniSqhfoyxc8sFoYIgkJy86G04UoZU5VjlpnplVu0K6Tx6E9b5+DlHA==", "requires": { "commander": "^2.20.0", "source-map": "~0.7.2", @@ -31343,12 +31383,11 @@ } }, "terser-webpack-plugin": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.2.4.tgz", - "integrity": "sha512-E2CkNMN+1cho04YpdANyRrn8CyN4yMy+WdFKZIySFZrGXZxJwJP6PMNGGc/Mcr6qygQHUUqRxnAPmi0M9f00XA==", + "version": "5.2.5", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.2.5.tgz", + "integrity": "sha512-3luOVHku5l0QBeYS8r4CdHYWEGMmIj3H1U64jgkdZzECcSOJAyJ9TjuqcQZvw1Y+4AOBN9SeYJPJmFn2cM4/2g==", "requires": { "jest-worker": "^27.0.6", - "p-limit": "^3.1.0", "schema-utils": "^3.1.1", "serialize-javascript": "^6.0.0", "source-map": "^0.6.1", @@ -31377,14 +31416,6 @@ "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" }, - "p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "requires": { - "yocto-queue": "^0.1.0" - } - }, "schema-utils": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz", @@ -31481,6 +31512,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/tr46/-/tr46-2.1.0.tgz", "integrity": "sha512-15Ih7phfcdP5YxqiB+iDtLoaTz4Nd35+IiAv0kQ5FNKHzXgdWqPoTIqEDDJmXceQt4JZk6lVPT8lnDlPpGDppw==", + "dev": true, "requires": { "punycode": "^2.1.1" } @@ -31939,12 +31971,13 @@ "webidl-conversions": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-6.1.0.tgz", - "integrity": "sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w==" + "integrity": "sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w==", + "dev": true }, "webpack": { - "version": "5.62.1", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.62.1.tgz", - "integrity": "sha512-jNLtnWChS2CMZ7vqWtztv0G6fYB5hz11Zsadp5tE7e4/66zVDj7/KUeQZOsOl8Hz5KrLJH1h2eIDl6AnlyE12Q==", + "version": "5.64.1", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.64.1.tgz", + "integrity": "sha512-b4FHmRgaaAjP+aVOVz41a9Qa5SmkUPQ+u8FntTQ1roPHahSComB6rXnLwc976VhUY4CqTaLu5mCswuHiNhOfVw==", "requires": { "@types/eslint-scope": "^3.7.0", "@types/estree": "^0.0.50", @@ -31969,7 +32002,7 @@ "tapable": "^2.1.1", "terser-webpack-plugin": "^5.1.3", "watchpack": "^2.2.0", - "webpack-sources": "^3.2.0" + "webpack-sources": "^3.2.2" }, "dependencies": { "ajv": { @@ -32055,9 +32088,9 @@ } }, "webpack-sources": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.1.tgz", - "integrity": "sha512-t6BMVLQ0AkjBOoRTZgqrWm7xbXMBzD+XDq2EZ96+vMfn3qKgsvdXZhbPZ4ElUOpdv4u+iiGe+w3+J75iy/bYGA==" + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.2.tgz", + "integrity": "sha512-cp5qdmHnu5T8wRg2G3vZZHoJPN14aqQ89SyQ11NpGH5zEMDCclt49rzo+MaRazk7/UeILhAI+/sEtcM+7Fr0nw==" }, "whatwg-url": { "version": "8.7.0", @@ -32378,9 +32411,9 @@ }, "dependencies": { "camelcase": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.2.0.tgz", - "integrity": "sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg==" + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.2.1.tgz", + "integrity": "sha512-tVI4q5jjFV5CavAU8DXfza/TJcZutVKo/5Foskmsqcm0MsL91moHvwiGNnqaa2o6PF/7yT5ikDRcVcl8Rj6LCA==" }, "decamelize": { "version": "4.0.0", diff --git a/packages/feathers/src/application.ts b/packages/feathers/src/application.ts index 4b3c618e18..d0aba120ff 100644 --- a/packages/feathers/src/application.ts +++ b/packages/feathers/src/application.ts @@ -15,9 +15,9 @@ import { HookOptions, FeathersService, HookMap, - LegacyHookMap + RegularHookMap } from './declarations'; -import { enableLegacyHooks } from './hooks/legacy'; +import { enableRegularHooks } from './hooks/regular'; const debug = createDebug('@feathersjs/feathers'); @@ -31,11 +31,11 @@ export class Feathers extends EventEmitter implements Feathe [HOOKS]: [ (eventHook as any) ] }; - private legacyHooks: (this: any, allHooks: any) => any; + private regularHooks: (this: any, allHooks: any) => any; constructor () { super(); - this.legacyHooks = enableLegacyHooks(this); + this.regularHooks = enableRegularHooks(this); } get (name: L): Settings[L] { @@ -118,10 +118,10 @@ export class Feathers extends EventEmitter implements Feathe } hooks (hookMap: HookOptions) { - const legacyMap = hookMap as LegacyHookMap; + const regularMap = hookMap as RegularHookMap; - if (legacyMap.before || legacyMap.after || legacyMap.error) { - return this.legacyHooks(legacyMap); + if (regularMap.before || regularMap.after || regularMap.error) { + return this.regularHooks(regularMap); } if (Array.isArray(hookMap)) { @@ -146,10 +146,10 @@ export class Feathers extends EventEmitter implements Feathe for (const path of Object.keys(this.services)) { promise = promise.then(() => { const service: any = this.service(path as any); - + if (typeof service.setup === 'function') { debug(`Setting up service for \`${path}\``); - + return service.setup(this, path); } }); diff --git a/packages/feathers/src/declarations.ts b/packages/feathers/src/declarations.ts index fcd7d8f408..4afbd61a21 100644 --- a/packages/feathers/src/declarations.ts +++ b/packages/feathers/src/declarations.ts @@ -318,23 +318,23 @@ export interface HookContext extends BaseHookContext = +// Regular hook typings +export type RegularHookFunction = (this: S, context: HookContext) => (Promise | void> | HookContext | void); -export type Hook = LegacyHookFunction; +export type Hook = RegularHookFunction; -type LegacyHookMethodMap = - { [L in keyof S]?: SelfOrArray>; } & - { all?: SelfOrArray> }; +type RegularHookMethodMap = + { [L in keyof S]?: SelfOrArray>; } & + { all?: SelfOrArray> }; -type LegacyHookTypeMap = - SelfOrArray> | LegacyHookMethodMap; +type RegularHookTypeMap = + SelfOrArray> | RegularHookMethodMap; -export type LegacyHookMap = { - before?: LegacyHookTypeMap, - after?: LegacyHookTypeMap, - error?: LegacyHookTypeMap +export type RegularHookMap = { + before?: RegularHookTypeMap, + after?: RegularHookTypeMap, + error?: RegularHookTypeMap } // New @feathersjs/hook typings @@ -346,4 +346,4 @@ export type HookMap = { }; export type HookOptions = - HookMap | HookFunction[] | LegacyHookMap; + HookMap | HookFunction[] | RegularHookMap; diff --git a/packages/feathers/src/hooks/index.ts b/packages/feathers/src/hooks/index.ts index ac0ba588e5..dd7752bddf 100644 --- a/packages/feathers/src/hooks/index.ts +++ b/packages/feathers/src/hooks/index.ts @@ -6,9 +6,9 @@ import { } from '../declarations'; import { defaultServiceArguments, getHookMethods } from '../service'; import { - collectLegacyHooks, - enableLegacyHooks -} from './legacy'; + collectRegularHooks, + enableRegularHooks +} from './regular'; export { fromBeforeHook, @@ -17,7 +17,7 @@ export { fromAfterHooks, fromErrorHook, fromErrorHooks -} from './legacy'; +} from './regular'; export function createContext (service: Service, method: string, data: HookContextData = {}) { const createContext = (service as any)[method].createContext; @@ -38,11 +38,11 @@ export class FeathersHookManager extends HookManager { collectMiddleware (self: any, args: any[]): Middleware[] { const app = this.app as any as Application; const appHooks = app.appHooks[HOOKS].concat(app.appHooks[this.method] || []); - const legacyAppHooks = collectLegacyHooks(this.app, this.method); + const regularAppHooks = collectRegularHooks(this.app, this.method); const middleware = super.collectMiddleware(self, args); - const legacyHooks = collectLegacyHooks(self, this.method); + const regularHooks = collectRegularHooks(self, this.method); - return [...appHooks, ...legacyAppHooks, ...middleware, ...legacyHooks]; + return [...appHooks, ...regularAppHooks, ...middleware, ...regularHooks]; } initializeContext (self: any, args: any[], context: HookContext) { @@ -86,13 +86,13 @@ export function hookMixin ( return res; }, {} as HookMap); - const handleLegacyHooks = enableLegacyHooks(service, hookMethods); + const handleRegularHooks = enableRegularHooks(service, hookMethods); hooks(service, serviceMethodHooks); service.hooks = function (this: any, hookOptions: any) { if (hookOptions.before || hookOptions.after || hookOptions.error) { - return handleLegacyHooks.call(this, hookOptions); + return handleRegularHooks.call(this, hookOptions); } if (Array.isArray(hookOptions)) { diff --git a/packages/feathers/src/hooks/legacy.ts b/packages/feathers/src/hooks/regular.ts similarity index 64% rename from packages/feathers/src/hooks/legacy.ts rename to packages/feathers/src/hooks/regular.ts index f5fb75cc64..ff01715184 100644 --- a/packages/feathers/src/hooks/legacy.ts +++ b/packages/feathers/src/hooks/regular.ts @@ -1,7 +1,7 @@ -import { HookFunction, LegacyHookFunction, LegacyHookMap } from '../declarations'; +import { HookFunction, RegularHookFunction, RegularHookMap } from '../declarations'; import { defaultServiceMethods } from '../service'; -const runHook = (hook: LegacyHookFunction, context: any, type?: string) => { +const runHook = (hook: RegularHookFunction, context: any, type?: string) => { if (type) context.type = type; return Promise.resolve(hook.call(context.self, context)) .then((res: any) => { @@ -12,19 +12,19 @@ const runHook = (hook: LegacyHookFunction, context: any, type?: str }); }; -export function fromBeforeHook (hook: LegacyHookFunction): HookFunction { +export function fromBeforeHook (hook: RegularHookFunction): HookFunction { return (context, next) => { return runHook(hook, context, 'before').then(next); }; } -export function fromAfterHook (hook: LegacyHookFunction): HookFunction { +export function fromAfterHook (hook: RegularHookFunction): HookFunction { return (context, next) => { return next().then(() => runHook(hook, context, 'after')); } } -export function fromErrorHook (hook: LegacyHookFunction): HookFunction { +export function fromErrorHook (hook: RegularHookFunction): HookFunction { return (context, next) => { return next().catch((error: any) => { if (context.error !== error || context.result !== undefined) { @@ -42,32 +42,32 @@ export function fromErrorHook (hook: LegacyHookFunction): HookFuncti } } -const RunHooks = (hooks: LegacyHookFunction[]) => (context: any) => { +const RunHooks = (hooks: RegularHookFunction[]) => (context: any) => { return hooks.reduce((promise, hook) => { return promise.then(() => runHook(hook, context)) }, Promise.resolve(undefined)); }; -export function fromBeforeHooks (hooks: LegacyHookFunction[]) { +export function fromBeforeHooks (hooks: RegularHookFunction[]) { return fromBeforeHook(RunHooks(hooks)); } -export function fromAfterHooks (hooks: LegacyHookFunction[]) { +export function fromAfterHooks (hooks: RegularHookFunction[]) { return fromAfterHook(RunHooks(hooks)); } -export function fromErrorHooks (hooks: LegacyHookFunction[]) { +export function fromErrorHooks (hooks: RegularHookFunction[]) { return fromErrorHook(RunHooks(hooks)); } -export function collectLegacyHooks (target: any, method: string) { +export function collectRegularHooks (target: any, method: string) { return target.__hooks.hooks[method] || []; } // Converts different hook registration formats into the // same internal format export function convertHookData (input: any) { - const result: { [ method: string ]: LegacyHookFunction[] } = {}; + const result: { [ method: string ]: RegularHookFunction[] } = {}; if (Array.isArray(input)) { result.all = input; @@ -83,31 +83,31 @@ export function convertHookData (input: any) { return result; } -type LegacyType = 'before' | 'after' | 'error'; +type RegularType = 'before' | 'after' | 'error'; -type LegacyMap = { [ type in LegacyType ]: ReturnType< typeof convertHookData > }; +type RegularMap = { [ type in RegularType ]: ReturnType< typeof convertHookData > }; -type LegacyAdapter = HookFunction & { hooks: LegacyHookFunction[] }; +type RegularAdapter = HookFunction & { hooks: RegularHookFunction[] }; -type LegacyStore = { - before: { [ method: string ]: LegacyAdapter }, - after: { [ method: string ]: LegacyAdapter }, - error: { [ method: string ]: LegacyAdapter }, +type RegularStore = { + before: { [ method: string ]: RegularAdapter }, + after: { [ method: string ]: RegularAdapter }, + error: { [ method: string ]: RegularAdapter }, hooks: { [ method: string ]: HookFunction[] } }; -const types: LegacyType[] = ['before', 'after', 'error']; +const types: RegularType[] = ['before', 'after', 'error']; -const isType = (value: any): value is LegacyType => types.includes(value); +const isType = (value: any): value is RegularType => types.includes(value); const wrappers = { before: fromBeforeHooks, after: fromAfterHooks, - error: fromErrorHooks, + error: fromErrorHooks }; const createStore = (methods: string[]) => { - const store: LegacyStore = { + const store: RegularStore = { before: {}, after: {}, error: {}, @@ -121,7 +121,7 @@ const createStore = (methods: string[]) => { return store; }; -const setStore = (object: any, store: LegacyStore) => { +const setStore = (object: any, store: RegularStore) => { Object.defineProperty(object, '__hooks', { configurable: true, value: store, @@ -129,10 +129,10 @@ const setStore = (object: any, store: LegacyStore) => { }); }; -const getStore = (object: any): LegacyStore => object.__hooks; +const getStore = (object: any): RegularStore => object.__hooks; -const createMap = (input: LegacyHookMap, methods: string[]) => { - const map = {} as LegacyMap; +const createMap = (input: RegularHookMap, methods: string[]) => { + const map = {} as RegularMap; Object.keys(input).forEach((type) => { if (!isType(type)) { @@ -153,20 +153,20 @@ const createMap = (input: LegacyHookMap, methods: string[]) => { return map; }; -const createAdapter = (type: LegacyType) => { - const hooks: LegacyHookFunction[] = []; +const createAdapter = (type: RegularType) => { + const hooks: RegularHookFunction[] = []; const hook = wrappers[type](hooks); const adapter = Object.assign(hook, { hooks }); return adapter; }; -const updateStore = (store: LegacyStore, map: LegacyMap) => { +const updateStore = (store: RegularStore, map: RegularMap) => { Object.keys(store.hooks).forEach((method) => { let adapted = false; Object.keys(map).forEach((key) => { - const type = key as LegacyType; + const type = key as RegularType; const allHooks = map[type].all || []; const methodHooks = map[type][method] || []; @@ -188,7 +188,7 @@ const updateStore = (store: LegacyStore, map: LegacyMap) => { }; // Add `.hooks` functionality to an object -export function enableLegacyHooks ( +export function enableRegularHooks ( object: any, methods: string[] = defaultServiceMethods ) { @@ -196,7 +196,7 @@ export function enableLegacyHooks ( setStore(object, store); - return function legacyHooks (this: any, input: LegacyHookMap) { + return function regularHooks (this: any, input: RegularHookMap) { const store = getStore(this); const map = createMap(input, methods); diff --git a/packages/feathers/test/application.test.ts b/packages/feathers/test/application.test.ts index cdd7cee139..ee65d134f2 100644 --- a/packages/feathers/test/application.test.ts +++ b/packages/feathers/test/application.test.ts @@ -174,7 +174,7 @@ describe('Feathers application', () => { app1.service('testing').create({ message: 'Hi' }); }); - it('async hooks run before legacy hooks', async () => { + it('async hooks run before regular hooks', async () => { const app = feathers(); app.use('/dummy', { @@ -197,11 +197,11 @@ describe('Feathers application', () => { ctx.data.order = [ 'async' ]; await next(); }]); - + const result = await dummy.create({ message: 'hi' }); - + assert.deepStrictEqual(result, { message: 'hi', order: ['async', 'before'] diff --git a/packages/feathers/test/hooks/hooks.test.ts b/packages/feathers/test/hooks/hooks.test.ts index 8938a6b9be..f463c6feab 100644 --- a/packages/feathers/test/hooks/hooks.test.ts +++ b/packages/feathers/test/hooks/hooks.test.ts @@ -40,22 +40,22 @@ describe('hooks basics', () => { app.hooks({ before: [(ctx: HookContext) => { - ctx.params.chain.push('app.hooks legacy before'); + ctx.params.chain.push('app.hooks regular before'); }], after: [(ctx: HookContext) => { - ctx.params.chain.push('app.hooks legacy after'); + ctx.params.chain.push('app.hooks regular after'); }] }); service.hooks({ before: { get: (ctx: HookContext) => { - ctx.params.chain.push('service.hooks legacy before'); + ctx.params.chain.push('service.hooks regular before'); } }, after: { get: (ctx: HookContext) => { - ctx.params.chain.push('service.hooks legacy after'); + ctx.params.chain.push('service.hooks regular after'); } } }); @@ -71,12 +71,12 @@ describe('hooks basics', () => { service.hooks({ before: { get: (ctx: HookContext) => { - ctx.params.chain.push('service.hooks 2 legacy before'); + ctx.params.chain.push('service.hooks 2 regular before'); } }, after: { get: (ctx: HookContext) => { - ctx.params.chain.push('service.hooks 2 legacy after'); + ctx.params.chain.push('service.hooks 2 regular after'); } } }); @@ -85,18 +85,18 @@ describe('hooks basics', () => { assert.deepStrictEqual(chain, [ 'app.hooks before', - 'app.hooks legacy before', + 'app.hooks regular before', '@hooks all before', '@hooks get before', 'service.hooks get before', - 'service.hooks legacy before', - 'service.hooks 2 legacy before', - 'service.hooks legacy after', - 'service.hooks 2 legacy after', + 'service.hooks regular before', + 'service.hooks 2 regular before', + 'service.hooks regular after', + 'service.hooks 2 regular after', 'service.hooks get after', '@hooks get after', '@hooks all after', - 'app.hooks legacy after', + 'app.hooks regular after', 'app.hooks after' ]) }); diff --git a/packages/transport-commons/src/routing/index.ts b/packages/transport-commons/src/routing/index.ts index 9939fbe2f2..b8b504dbda 100644 --- a/packages/transport-commons/src/routing/index.ts +++ b/packages/transport-commons/src/routing/index.ts @@ -18,7 +18,7 @@ declare module '@feathersjs/feathers/lib/declarations' { export * from './router'; -const lookup = function(this: Application, path: string) { +const lookup = function (this: Application, path: string) { const result = this.routes.lookup(path); if (result === null) {