From 1a49a6cdf02e1afb4dff037286eecdd9b24257ad Mon Sep 17 00:00:00 2001 From: Alexander Ryzhikov Date: Sat, 16 Sep 2023 12:44:50 +0300 Subject: [PATCH] feat: add request.routeOptions support (#82) --- package.json | 26 +-- pnpm-lock.yaml | 441 ++++++++++++++++++----------------- src/typed-fastify.ts | 43 ++-- test/integration.test.ts | 3 +- test/test_schema.gen.json | 2 +- test/typed-fastify.test-d.ts | 43 +++- 6 files changed, 304 insertions(+), 254 deletions(-) diff --git a/package.json b/package.json index dbd9888..57532c8 100644 --- a/package.json +++ b/package.json @@ -7,38 +7,38 @@ "typed-fastify-schema": "bin/gen.bin.js" }, "dependencies": { - "@types/json-schema": "^7.0.12", + "@types/json-schema": "^7.0.13", "crypto-js": "^4.1.1", - "glob": "^10.3.3", + "glob": "^10.3.4", "json-schema-merge-allof": "^0.8.1", "json-schema-traverse": "^1.0.0", - "typescript-json-schema": "^0.59.0", + "typescript-json-schema": "^0.61.0", "yargs": "^17.7.2" }, "devDependencies": { - "@fastify/swagger": "^8.9.0", + "@fastify/swagger": "^8.10.0", "@fastify/swagger-ui": "^1.9.3", - "@types/crypto-js": "^4.1.1", + "@types/crypto-js": "^4.1.2", "@types/glob": "^8.1.0", - "@types/json-schema-merge-allof": "^0.6.1", + "@types/json-schema-merge-allof": "^0.6.2", "@types/lint-staged": "^13.2.0", - "@types/node": "^20.5.1", + "@types/node": "^20.6.2", "@types/split2": "^4.2.0", - "@types/tap": "^15.0.8", + "@types/tap": "^15.0.9", "@types/yargs": "^17.0.24", - "fastify": "^4.21.0", + "fastify": "^4.23.2", "husky": "^8.0.3", "lint-staged": "^14.0.1", "pino-pretty": "^10.2.0", "pinst": "^3.0.0", - "prettier": "^3.0.2", + "prettier": "^3.0.3", "split2": "^4.2.0", "syncpack": "^11.2.1", "tap": "^16.3.8", "ts-node-dev": "^2.0.0", - "tsd": "^0.28.1", - "type-fest": "^4.2.0", - "typescript": "^5.1.6" + "tsd": "^0.29.0", + "type-fest": "^4.3.1", + "typescript": "^5.2.2" }, "directories": { "test": "test/", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 37e81df..2c88522 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -2,14 +2,14 @@ lockfileVersion: '6.0' dependencies: '@types/json-schema': - specifier: ^7.0.12 - version: 7.0.12 + specifier: ^7.0.13 + version: 7.0.13 crypto-js: specifier: ^4.1.1 version: 4.1.1 glob: - specifier: ^10.3.3 - version: 10.3.3 + specifier: ^10.3.4 + version: 10.3.4 json-schema-merge-allof: specifier: ^0.8.1 version: 0.8.1 @@ -17,46 +17,46 @@ dependencies: specifier: ^1.0.0 version: 1.0.0 typescript-json-schema: - specifier: ^0.59.0 - version: 0.59.0 + specifier: ^0.61.0 + version: 0.61.0 yargs: specifier: ^17.7.2 version: 17.7.2 devDependencies: '@fastify/swagger': - specifier: ^8.9.0 - version: 8.9.0 + specifier: ^8.10.0 + version: 8.10.0 '@fastify/swagger-ui': specifier: ^1.9.3 version: 1.9.3 '@types/crypto-js': - specifier: ^4.1.1 - version: 4.1.1 + specifier: ^4.1.2 + version: 4.1.2 '@types/glob': specifier: ^8.1.0 version: 8.1.0 '@types/json-schema-merge-allof': - specifier: ^0.6.1 - version: 0.6.1 + specifier: ^0.6.2 + version: 0.6.2 '@types/lint-staged': specifier: ^13.2.0 version: 13.2.0 '@types/node': - specifier: ^20.5.1 - version: 20.5.1 + specifier: ^20.6.2 + version: 20.6.2 '@types/split2': specifier: ^4.2.0 version: 4.2.0 '@types/tap': - specifier: ^15.0.8 - version: 15.0.8 + specifier: ^15.0.9 + version: 15.0.9 '@types/yargs': specifier: ^17.0.24 version: 17.0.24 fastify: - specifier: ^4.21.0 - version: 4.21.0 + specifier: ^4.23.2 + version: 4.23.2 husky: specifier: ^8.0.3 version: 8.0.3 @@ -70,8 +70,8 @@ devDependencies: specifier: ^3.0.0 version: 3.0.0 prettier: - specifier: ^3.0.2 - version: 3.0.2 + specifier: ^3.0.3 + version: 3.0.3 split2: specifier: ^4.2.0 version: 4.2.0 @@ -80,19 +80,19 @@ devDependencies: version: 11.2.1 tap: specifier: ^16.3.8 - version: 16.3.8(typescript@5.1.6) + version: 16.3.8(typescript@5.2.2) ts-node-dev: specifier: ^2.0.0 - version: 2.0.0(@types/node@20.5.1)(typescript@5.1.6) + version: 2.0.0(@types/node@20.6.2)(typescript@5.2.2) tsd: - specifier: ^0.28.1 - version: 0.28.1 + specifier: ^0.29.0 + version: 0.29.0 type-fest: - specifier: ^4.2.0 - version: 4.2.0 + specifier: ^4.3.1 + version: 4.3.1 typescript: - specifier: ^5.1.6 - version: 5.1.6 + specifier: ^5.2.2 + version: 5.2.2 packages: @@ -111,117 +111,120 @@ packages: '@babel/highlight': 7.18.6 dev: true - /@babel/compat-data@7.21.7: - resolution: {integrity: sha512-KYMqFYTaenzMK4yUtf4EW9wc4N9ef80FsbMtkwool5zpwl4YrT1SdWYSTRcT94KO4hannogdS+LxY7L+arP3gA==} + /@babel/code-frame@7.22.13: + resolution: {integrity: sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/highlight': 7.22.13 + chalk: 2.4.2 + dev: true + + /@babel/compat-data@7.22.9: + resolution: {integrity: sha512-5UamI7xkUcJ3i9qVDS+KFDEK8/7oJ55/sJMB1Ge7IEapr7KfdfV/HErR+koZwOfd+SgtFKOKRhRakdg++DcJpQ==} engines: {node: '>=6.9.0'} dev: true - /@babel/core@7.21.8: - resolution: {integrity: sha512-YeM22Sondbo523Sz0+CirSPnbj9bG3P0CdHcBZdqUuaeOaYEFbOLoGU7lebvGP6P5J/WE9wOn7u7C4J9HvS1xQ==} + /@babel/core@7.22.19: + resolution: {integrity: sha512-Q8Yj5X4LHVYTbLCKVz0//2D2aDmHF4xzCdEttYvKOnWvErGsa6geHXD6w46x64n5tP69VfeH+IfSrdyH3MLhwA==} engines: {node: '>=6.9.0'} dependencies: '@ampproject/remapping': 2.2.1 - '@babel/code-frame': 7.21.4 - '@babel/generator': 7.21.5 - '@babel/helper-compilation-targets': 7.21.5(@babel/core@7.21.8) - '@babel/helper-module-transforms': 7.21.5 - '@babel/helpers': 7.21.5 - '@babel/parser': 7.21.8 - '@babel/template': 7.20.7 - '@babel/traverse': 7.21.5 - '@babel/types': 7.21.5 + '@babel/code-frame': 7.22.13 + '@babel/generator': 7.22.15 + '@babel/helper-compilation-targets': 7.22.15 + '@babel/helper-module-transforms': 7.22.19(@babel/core@7.22.19) + '@babel/helpers': 7.22.15 + '@babel/parser': 7.22.16 + '@babel/template': 7.22.15 + '@babel/traverse': 7.22.19 + '@babel/types': 7.22.19 convert-source-map: 1.9.0 debug: 4.3.4 gensync: 1.0.0-beta.2 json5: 2.2.3 - semver: 6.3.0 + semver: 6.3.1 transitivePeerDependencies: - supports-color dev: true - /@babel/generator@7.21.5: - resolution: {integrity: sha512-SrKK/sRv8GesIW1bDagf9cCG38IOMYZusoe1dfg0D8aiUe3Amvoj1QtjTPAWcfrZFvIwlleLb0gxzQidL9w14w==} + /@babel/generator@7.22.15: + resolution: {integrity: sha512-Zu9oWARBqeVOW0dZOjXc3JObrzuqothQ3y/n1kUtrjCoCPLkXUwMvOo/F/TCfoHMbWIFlWwpZtkZVb9ga4U2pA==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.21.5 + '@babel/types': 7.22.19 '@jridgewell/gen-mapping': 0.3.3 '@jridgewell/trace-mapping': 0.3.18 jsesc: 2.5.2 dev: true - /@babel/helper-compilation-targets@7.21.5(@babel/core@7.21.8): - resolution: {integrity: sha512-1RkbFGUKex4lvsB9yhIfWltJM5cZKUftB2eNajaDv3dCMEp49iBG0K14uH8NnX9IPux2+mK7JGEOB0jn48/J6w==} + /@babel/helper-compilation-targets@7.22.15: + resolution: {integrity: sha512-y6EEzULok0Qvz8yyLkCvVX+02ic+By2UdOhylwUOvOn9dvYc9mKICJuuU1n1XBI02YWsNsnrY1kc6DVbjcXbtw==} engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0 dependencies: - '@babel/compat-data': 7.21.7 - '@babel/core': 7.21.8 - '@babel/helper-validator-option': 7.21.0 - browserslist: 4.21.5 + '@babel/compat-data': 7.22.9 + '@babel/helper-validator-option': 7.22.15 + browserslist: 4.21.10 lru-cache: 5.1.1 - semver: 6.3.0 + semver: 6.3.1 dev: true - /@babel/helper-environment-visitor@7.21.5: - resolution: {integrity: sha512-IYl4gZ3ETsWocUWgsFZLM5i1BYx9SoemminVEXadgLBa9TdeorzgLKm8wWLA6J1N/kT3Kch8XIk1laNzYoHKvQ==} + /@babel/helper-environment-visitor@7.22.5: + resolution: {integrity: sha512-XGmhECfVA/5sAt+H+xpSg0mfrHq6FzNr9Oxh7PSEBBRUb/mL7Kz3NICXb194rCqAEdxkhPT1a88teizAFyvk8Q==} engines: {node: '>=6.9.0'} dev: true - /@babel/helper-function-name@7.21.0: - resolution: {integrity: sha512-HfK1aMRanKHpxemaY2gqBmL04iAPOPRj7DxtNbiDOrJK+gdwkiNRVpCpUJYbUT+aZyemKN8brqTOxzCaG6ExRg==} + /@babel/helper-function-name@7.22.5: + resolution: {integrity: sha512-wtHSq6jMRE3uF2otvfuD3DIvVhOsSNshQl0Qrd7qC9oQJzHvOL4qQXlQn2916+CXGywIjpGuIkoyZRRxHPiNQQ==} engines: {node: '>=6.9.0'} dependencies: - '@babel/template': 7.20.7 - '@babel/types': 7.21.5 + '@babel/template': 7.22.15 + '@babel/types': 7.22.19 dev: true - /@babel/helper-hoist-variables@7.18.6: - resolution: {integrity: sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q==} + /@babel/helper-hoist-variables@7.22.5: + resolution: {integrity: sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.21.5 + '@babel/types': 7.22.19 dev: true - /@babel/helper-module-imports@7.21.4: - resolution: {integrity: sha512-orajc5T2PsRYUN3ZryCEFeMDYwyw09c/pZeaQEZPH0MpKzSvn3e0uXsDBu3k03VI+9DBiRo+l22BfKTpKwa/Wg==} + /@babel/helper-module-imports@7.22.15: + resolution: {integrity: sha512-0pYVBnDKZO2fnSPCrgM/6WMc7eS20Fbok+0r88fp+YtWVLZrp4CkafFGIp+W0VKw4a22sgebPT99y+FDNMdP4w==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.21.5 + '@babel/types': 7.22.19 dev: true - /@babel/helper-module-transforms@7.21.5: - resolution: {integrity: sha512-bI2Z9zBGY2q5yMHoBvJ2a9iX3ZOAzJPm7Q8Yz6YeoUjU/Cvhmi2G4QyTNyPBqqXSgTjUxRg3L0xV45HvkNWWBw==} + /@babel/helper-module-transforms@7.22.19(@babel/core@7.22.19): + resolution: {integrity: sha512-m6h1cJvn+OJ+R3jOHp30faq5xKJ7VbjwDj5RGgHuRlU9hrMeKsGC+JpihkR5w1g7IfseCPPtZ0r7/hB4UKaYlA==} engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 dependencies: - '@babel/helper-environment-visitor': 7.21.5 - '@babel/helper-module-imports': 7.21.4 - '@babel/helper-simple-access': 7.21.5 - '@babel/helper-split-export-declaration': 7.18.6 - '@babel/helper-validator-identifier': 7.19.1 - '@babel/template': 7.20.7 - '@babel/traverse': 7.21.5 - '@babel/types': 7.21.5 - transitivePeerDependencies: - - supports-color + '@babel/core': 7.22.19 + '@babel/helper-environment-visitor': 7.22.5 + '@babel/helper-module-imports': 7.22.15 + '@babel/helper-simple-access': 7.22.5 + '@babel/helper-split-export-declaration': 7.22.6 + '@babel/helper-validator-identifier': 7.22.19 dev: true - /@babel/helper-simple-access@7.21.5: - resolution: {integrity: sha512-ENPDAMC1wAjR0uaCUwliBdiSl1KBJAVnMTzXqi64c2MG8MPR6ii4qf7bSXDqSFbr4W6W028/rf5ivoHop5/mkg==} + /@babel/helper-simple-access@7.22.5: + resolution: {integrity: sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.21.5 + '@babel/types': 7.22.19 dev: true - /@babel/helper-split-export-declaration@7.18.6: - resolution: {integrity: sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA==} + /@babel/helper-split-export-declaration@7.22.6: + resolution: {integrity: sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.21.5 + '@babel/types': 7.22.19 dev: true - /@babel/helper-string-parser@7.21.5: - resolution: {integrity: sha512-5pTUx3hAJaZIdW99sJ6ZUUgWq/Y+Hja7TowEnLNMm1VivRgZQL3vpBY3qUACVsvw+yQU6+YgfBVmcbLaZtrA1w==} + /@babel/helper-string-parser@7.22.5: + resolution: {integrity: sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==} engines: {node: '>=6.9.0'} dev: true @@ -230,18 +233,23 @@ packages: engines: {node: '>=6.9.0'} dev: true - /@babel/helper-validator-option@7.21.0: - resolution: {integrity: sha512-rmL/B8/f0mKS2baE9ZpyTcTavvEuWhTTW8amjzXNvYG4AwBsqTLikfXsEofsJEfKHf+HQVQbFOHy6o+4cnC/fQ==} + /@babel/helper-validator-identifier@7.22.19: + resolution: {integrity: sha512-Tinq7ybnEPFFXhlYOYFiSjespWQk0dq2dRNAiMdRTOYQzEGqnnNyrTxPYHP5r6wGjlF1rFgABdDV0g8EwD6Qbg==} + engines: {node: '>=6.9.0'} + dev: true + + /@babel/helper-validator-option@7.22.15: + resolution: {integrity: sha512-bMn7RmyFjY/mdECUbgn9eoSY4vqvacUnS9i9vGAGttgFWesO6B4CYWA7XlpbWgBt71iv/hfbPlynohStqnu5hA==} engines: {node: '>=6.9.0'} dev: true - /@babel/helpers@7.21.5: - resolution: {integrity: sha512-BSY+JSlHxOmGsPTydUkPf1MdMQ3M81x5xGCOVgWM3G8XH77sJ292Y2oqcp0CbbgxhqBuI46iUz1tT7hqP7EfgA==} + /@babel/helpers@7.22.15: + resolution: {integrity: sha512-7pAjK0aSdxOwR+CcYAqgWOGy5dcfvzsTIfFTb2odQqW47MDfv14UaJDY6eng8ylM2EaeKXdxaSWESbkmaQHTmw==} engines: {node: '>=6.9.0'} dependencies: - '@babel/template': 7.20.7 - '@babel/traverse': 7.21.5 - '@babel/types': 7.21.5 + '@babel/template': 7.22.15 + '@babel/traverse': 7.22.19 + '@babel/types': 7.22.19 transitivePeerDependencies: - supports-color dev: true @@ -255,47 +263,56 @@ packages: js-tokens: 4.0.0 dev: true - /@babel/parser@7.21.8: - resolution: {integrity: sha512-6zavDGdzG3gUqAdWvlLFfk+36RilI+Pwyuuh7HItyeScCWP3k6i8vKclAQ0bM/0y/Kz/xiwvxhMv9MgTJP5gmA==} + /@babel/highlight@7.22.13: + resolution: {integrity: sha512-C/BaXcnnvBCmHTpz/VGZ8jgtE2aYlW4hxDhseJAWZb7gqGM/qtCK6iZUb0TyKFf7BOUsBH7Q7fkRsDRhg1XklQ==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/helper-validator-identifier': 7.22.19 + chalk: 2.4.2 + js-tokens: 4.0.0 + dev: true + + /@babel/parser@7.22.16: + resolution: {integrity: sha512-+gPfKv8UWeKKeJTUxe59+OobVcrYHETCsORl61EmSkmgymguYk/X5bp7GuUIXaFsc6y++v8ZxPsLSSuujqDphA==} engines: {node: '>=6.0.0'} hasBin: true dependencies: - '@babel/types': 7.21.5 + '@babel/types': 7.22.19 dev: true - /@babel/template@7.20.7: - resolution: {integrity: sha512-8SegXApWe6VoNw0r9JHpSteLKTpTiLZ4rMlGIm9JQ18KiCtyQiAMEazujAHrUS5flrcqYZa75ukev3P6QmUwUw==} + /@babel/template@7.22.15: + resolution: {integrity: sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==} engines: {node: '>=6.9.0'} dependencies: - '@babel/code-frame': 7.21.4 - '@babel/parser': 7.21.8 - '@babel/types': 7.21.5 + '@babel/code-frame': 7.22.13 + '@babel/parser': 7.22.16 + '@babel/types': 7.22.19 dev: true - /@babel/traverse@7.21.5: - resolution: {integrity: sha512-AhQoI3YjWi6u/y/ntv7k48mcrCXmus0t79J9qPNlk/lAsFlCiJ047RmbfMOawySTHtywXhbXgpx/8nXMYd+oFw==} + /@babel/traverse@7.22.19: + resolution: {integrity: sha512-ZCcpVPK64krfdScRbpxF6xA5fz7IOsfMwx1tcACvCzt6JY+0aHkBk7eIU8FRDSZRU5Zei6Z4JfgAxN1bqXGECg==} engines: {node: '>=6.9.0'} dependencies: - '@babel/code-frame': 7.21.4 - '@babel/generator': 7.21.5 - '@babel/helper-environment-visitor': 7.21.5 - '@babel/helper-function-name': 7.21.0 - '@babel/helper-hoist-variables': 7.18.6 - '@babel/helper-split-export-declaration': 7.18.6 - '@babel/parser': 7.21.8 - '@babel/types': 7.21.5 + '@babel/code-frame': 7.22.13 + '@babel/generator': 7.22.15 + '@babel/helper-environment-visitor': 7.22.5 + '@babel/helper-function-name': 7.22.5 + '@babel/helper-hoist-variables': 7.22.5 + '@babel/helper-split-export-declaration': 7.22.6 + '@babel/parser': 7.22.16 + '@babel/types': 7.22.19 debug: 4.3.4 globals: 11.12.0 transitivePeerDependencies: - supports-color dev: true - /@babel/types@7.21.5: - resolution: {integrity: sha512-m4AfNvVF2mVC/F7fDEdH2El3HzUg9It/XsCxZiOTTA3m3qYfcSVSbTfM6Q9xG+hYDniZssYhlXKKUMD5m8tF4Q==} + /@babel/types@7.22.19: + resolution: {integrity: sha512-P7LAw/LbojPzkgp5oznjE6tQEIWbp4PkkfrZDINTro9zgBRtI324/EYsiSI7lhPbpIQ+DCeR2NNmMWANGGfZsg==} engines: {node: '>=6.9.0'} dependencies: - '@babel/helper-string-parser': 7.21.5 - '@babel/helper-validator-identifier': 7.19.1 + '@babel/helper-string-parser': 7.22.5 + '@babel/helper-validator-identifier': 7.22.19 to-fast-properties: 2.0.0 dev: true @@ -397,14 +414,14 @@ packages: yaml: 2.2.2 dev: true - /@fastify/swagger@8.9.0: - resolution: {integrity: sha512-Y0gqpqDZBxbnr/OWmiFI1Ub8I0jPlCSa1LvRsmnf/IDSsleqXdPnIMnxMRuXA1NpQ8TtbEWoFFMlnuOX43uv3g==} + /@fastify/swagger@8.10.0: + resolution: {integrity: sha512-0o6nd0qWpJbVSv/vbK4bzHSYe7l+PTGPqrQVwWIXVGd7CvXr585SBx+h8EgrMOY80bcOnGreqnjYFOV0osGP5A==} dependencies: fastify-plugin: 4.5.0 json-schema-resolver: 2.0.0 openapi-types: 12.1.0 rfdc: 1.3.0 - yaml: 2.2.2 + yaml: 2.3.1 transitivePeerDependencies: - supports-color dev: true @@ -536,19 +553,20 @@ packages: /@tsconfig/node16@1.0.4: resolution: {integrity: sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==} - /@tsd/typescript@5.0.4: - resolution: {integrity: sha512-YQi2lvZSI+xidKeUjlbv6b6Zw7qB3aXHw5oGJLs5OOGAEqKIOvz5UIAkWyg0bJbkSUWPBEtaOHpVxU4EYBO1Jg==} + /@tsd/typescript@5.2.2: + resolution: {integrity: sha512-VtjHPAKJqLJoHHKBDNofzvQB2+ZVxjXU/Gw6INAS9aINLQYVsxfzrQ2s84huCeYWZRTtrr7R0J7XgpZHjNwBCw==} + engines: {node: '>=14.17'} dev: true - /@types/crypto-js@4.1.1: - resolution: {integrity: sha512-BG7fQKZ689HIoc5h+6D2Dgq1fABRa0RbBWKBd9SP/MVRVXROflpm5fhwyATX5duFmbStzyzyycPB8qUYKDH3NA==} + /@types/crypto-js@4.1.2: + resolution: {integrity: sha512-t33RNmTu5ufG/sorROIafiCVJMx3jz95bXUMoPAZcUD14fxMXnuTzqzXZoxpR0tNx2xpw11Dlmem9vGCsrSOfA==} dev: true /@types/eslint@7.29.0: resolution: {integrity: sha512-VNcvioYDH8/FxaeTKkM4/TiTwt6pBV9E3OfGmvaw8tPl0rrHCJ4Ll15HRT+pMiFAf/MLQvAzC+6RzUMEL9Ceng==} dependencies: '@types/estree': 1.0.1 - '@types/json-schema': 7.0.12 + '@types/json-schema': 7.0.13 dev: true /@types/estree@1.0.1: @@ -559,17 +577,17 @@ packages: resolution: {integrity: sha512-IO+MJPVhoqz+28h1qLAcBEH2+xHMK6MTyHJc7MTnnYb6wsoLR29POVGJ7LycmVXIqyy/4/2ShP5sUwTXuOwb/w==} dependencies: '@types/minimatch': 5.1.2 - '@types/node': 20.5.1 + '@types/node': 20.6.2 dev: true - /@types/json-schema-merge-allof@0.6.1: - resolution: {integrity: sha512-tBVtkCCbA1oF8vQ2cp2yuGLp0T2f0AZ2dAic64ZftoWQnKqrTYY/+PuiqPKX1XaxoR43ll/EkYcHnJbdbHUS2g==} + /@types/json-schema-merge-allof@0.6.2: + resolution: {integrity: sha512-r0aK0QSJNfngf+zLv5pyxXaMyTGj+EuuSzvffkocOcY79W1Qu399qB0bFhcxE/3RbhXHwFfUY3mib7/FniszRQ==} dependencies: - '@types/json-schema': 7.0.12 + '@types/json-schema': 7.0.13 dev: true - /@types/json-schema@7.0.12: - resolution: {integrity: sha512-Hr5Jfhc9eYOQNPYO5WLDq/n4jqijdHNlDXjuAQkkt+mWdQR+XJToOHrsD4cPaMXpn6KO7y2+wM8AZEs8VpBLVA==} + /@types/json-schema@7.0.13: + resolution: {integrity: sha512-RbSSoHliUbnXj3ny0CNFOoxrIDV6SUGyStHsvDqosw6CkdPV8TtWGlfecuK4ToyMEAql6pzNxgCFKanovUzlgQ==} /@types/lint-staged@13.2.0: resolution: {integrity: sha512-rYHDtOV4BHb1hRH5dA7P+jarU/YFmQ9CGgwYPZNVRoxhrsrm2exEETeIEB+EmBk2AXIKAaK9JDzjpNCkceDGFQ==} @@ -587,8 +605,8 @@ packages: resolution: {integrity: sha512-KPXltf4z4g517OlVJO9XQ2357CYw7fvuJ3ZuBynjXC5Jos9i+K7LvFb7bUIwtJXSZj0vTp9Q6NJBSQpkwwO8Zw==} dev: false - /@types/node@20.5.1: - resolution: {integrity: sha512-4tT2UrL5LBqDwoed9wZ6N3umC4Yhz3W3FloMmiiG4JwmUJWpie0c7lcnUNd4gtMKuDEO4wRVS8B6Xa0uMRsMKg==} + /@types/node@20.6.2: + resolution: {integrity: sha512-Y+/1vGBHV/cYk6OI1Na/LHzwnlNCAfU3ZNGrc1LdRe/LAIbdDPTTv/HU3M7yXN448aTVDq3eKRm2cg7iKLb8gw==} dev: true /@types/normalize-package-data@2.4.1: @@ -598,7 +616,7 @@ packages: /@types/split2@4.2.0: resolution: {integrity: sha512-rwV0tC3XGQvQ8zdeYDZ+dLn4CJLKnYPBrSU8dRXvzMVLUPMsYTsy3/ZbE4OlejsT2D7MTGP8ePk05C98xl2seQ==} dependencies: - '@types/node': 20.5.1 + '@types/node': 20.6.2 dev: true /@types/strip-bom@3.0.0: @@ -609,10 +627,10 @@ packages: resolution: {integrity: sha512-7NQmHra/JILCd1QqpSzl8+mJRc8ZHz3uDm8YV1Ks9IhK0epEiTw8aIErbvH9PI+6XbqhyIQy3462nEsn7UVzjQ==} dev: true - /@types/tap@15.0.8: - resolution: {integrity: sha512-ZfeoiZlLIaFi4t6wccwbTEicrHREkP0bOq8dZVi/nWvG5F8O7LlS2cSUZBiOW/D4cgWS/p2uhM3lJoyzFAl80w==} + /@types/tap@15.0.9: + resolution: {integrity: sha512-ewkqbmoYTsKC333VmdpUvxRl8/tDK2RRzR/BBCAuuFPgEvNp1vxqL2Dh812acDpmaBsgWkYORxy8e/RODrzMPw==} dependencies: - '@types/node': 20.5.1 + '@types/node': 20.6.2 dev: true /@types/yargs-parser@21.0.0: @@ -827,15 +845,15 @@ packages: fill-range: 7.0.1 dev: true - /browserslist@4.21.5: - resolution: {integrity: sha512-tUkiguQGW7S3IhB7N+c2MV/HZPSCPAAiYBZXLsBhFB/PCy6ZKKsZrmBayHV9fdGV/ARIfJ14NkxKzRDjvp7L6w==} + /browserslist@4.21.10: + resolution: {integrity: sha512-bipEBdZfVH5/pwrvqc+Ub0kUPVfGUhlKxbvfD+z1BDnPEO/X98ruXGA1WP5ASpAFKan7Qr6j736IacbZQuAlKQ==} engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true dependencies: - caniuse-lite: 1.0.30001488 - electron-to-chromium: 1.4.401 - node-releases: 2.0.10 - update-browserslist-db: 1.0.11(browserslist@4.21.5) + caniuse-lite: 1.0.30001534 + electron-to-chromium: 1.4.523 + node-releases: 2.0.13 + update-browserslist-db: 1.0.11(browserslist@4.21.10) dev: true /buffer-from@1.1.2: @@ -891,8 +909,8 @@ packages: engines: {node: '>=6'} dev: true - /caniuse-lite@1.0.30001488: - resolution: {integrity: sha512-NORIQuuL4xGpIy6iCCQGN4iFjlBXtfKWIenlUuyZJumLRIindLb7wXM+GO8erEhb7vXfcnf4BAg2PrSDN5TNLQ==} + /caniuse-lite@1.0.30001534: + resolution: {integrity: sha512-vlPVrhsCS7XaSh2VvWluIQEzVhefrUQcEsQWSS5A5V+dM07uv1qHeQzAOTGIMy9i3e9bH15+muvI/UHojVgS/Q==} dev: true /chalk@2.4.2: @@ -1164,8 +1182,8 @@ packages: /eastasianwidth@0.2.0: resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} - /electron-to-chromium@1.4.401: - resolution: {integrity: sha512-AswqHsYyEbfSn0x87n31Na/xttUqEAg7NUjpiyxC20MaWKLyadOYHMzyLdF78N1iw+FK8/2KHLpZxRdyRILgtA==} + /electron-to-chromium@1.4.523: + resolution: {integrity: sha512-9AreocSUWnzNtvLcbpng6N+GkXnCcBR80IQkxRC9Dfdyg4gaWNUPBujAHUpKkiUkoSoR9UlhA4zD/IgBklmhzg==} dev: true /emoji-regex@8.0.0: @@ -1341,8 +1359,8 @@ packages: resolution: {integrity: sha512-79ak0JxddO0utAXAQ5ccKhvs6vX2MGyHHMMsmZkBANrq3hXc1CHzvNPHOcvTsVMEPl5I+NT+RO4YKMGehOfSIg==} dev: true - /fastify@4.21.0: - resolution: {integrity: sha512-tsu4bcwE4HetxqW8prA5fbC9bKHMYDp7jGEDWyzK1l90a3uOaLoIcQbdGcWeODNLVJviQnzh1wvIjTZE3MJFEg==} + /fastify@4.23.2: + resolution: {integrity: sha512-WFSxsHES115svC7NrerNqZwwM0UOxbC/P6toT9LRHgAAFvG7o2AN5W+H4ihCtOGuYXjZf4z+2jXC89rVEoPWOA==} dependencies: '@fastify/ajv-compiler': 3.5.0 '@fastify/error': 3.2.0 @@ -1358,8 +1376,8 @@ packages: proxy-addr: 2.0.7 rfdc: 1.3.0 secure-json-parse: 2.7.0 - semver: 7.5.1 - tiny-lru: 11.0.1 + semver: 7.5.4 + toad-cache: 3.2.0 transitivePeerDependencies: - supports-color dev: true @@ -1481,8 +1499,8 @@ packages: is-glob: 4.0.3 dev: true - /glob@10.3.3: - resolution: {integrity: sha512-92vPiMb/iqpmEgsOoIDvTjc50wf9CCCvMzsi6W0JLPeUKE8TWP1a73PgqSrqy7iAZxaSD1YdzU7QZR5LF51MJw==} + /glob@10.3.4: + resolution: {integrity: sha512-6LFElP3A+i/Q8XQKEvZjkEWEOTgAIALR9AO2rwT8bgPhDd1anmqDJDZ6lLddI4ehxxxR1S5RIqKe1uapMQfYaQ==} engines: {node: '>=16 || 14 >=14.17'} hasBin: true dependencies: @@ -1758,10 +1776,10 @@ packages: resolution: {integrity: sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ==} engines: {node: '>=8'} dependencies: - '@babel/core': 7.21.8 + '@babel/core': 7.22.19 '@istanbuljs/schema': 0.1.3 istanbul-lib-coverage: 3.2.0 - semver: 6.3.0 + semver: 6.3.1 transitivePeerDependencies: - supports-color dev: true @@ -1778,12 +1796,12 @@ packages: uuid: 8.3.2 dev: true - /istanbul-lib-report@3.0.0: - resolution: {integrity: sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==} - engines: {node: '>=8'} + /istanbul-lib-report@3.0.1: + resolution: {integrity: sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==} + engines: {node: '>=10'} dependencies: istanbul-lib-coverage: 3.2.0 - make-dir: 3.1.0 + make-dir: 4.0.0 supports-color: 7.2.0 dev: true @@ -1798,12 +1816,12 @@ packages: - supports-color dev: true - /istanbul-reports@3.1.5: - resolution: {integrity: sha512-nUsEMa9pBt/NOHqbcbeJEgqIlY/K7rVWUX6Lql2orY5e9roQOthbR3vtY4zzf2orPELg80fnxxk9zUyPlgwD1w==} + /istanbul-reports@3.1.6: + resolution: {integrity: sha512-TLgnMkKg3iTDsQ9PbPTdpfAK2DzjF9mqUG7RMgcQl8oFjad8ob4laGxv5XV5U9MAfx8D6tSJiUyuAwzLicaxlg==} engines: {node: '>=8'} dependencies: html-escaper: 2.0.2 - istanbul-lib-report: 3.0.0 + istanbul-lib-report: 3.0.1 dev: true /jackspeak@1.4.2: @@ -1916,8 +1934,8 @@ packages: engines: {node: '>=6'} dev: true - /libtap@1.4.0: - resolution: {integrity: sha512-STLFynswQ2A6W14JkabgGetBNk6INL1REgJ9UeNKw5llXroC2cGLgKTqavv0sl8OLVztLLipVKMcQ7yeUcqpmg==} + /libtap@1.4.1: + resolution: {integrity: sha512-S9v19shLTigoMn3c02V7LZ4t09zxmVP3r3RbEAwuHFYeKgF+ESFJxoQ0PMFKW4XdgQhcjVBEwDoopG6WROq/gw==} engines: {node: '>=10'} dependencies: async-hook-domain: 2.0.4 @@ -2050,7 +2068,14 @@ packages: resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==} engines: {node: '>=8'} dependencies: - semver: 6.3.0 + semver: 6.3.1 + dev: true + + /make-dir@4.0.0: + resolution: {integrity: sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==} + engines: {node: '>=10'} + dependencies: + semver: 7.5.4 dev: true /make-error@1.3.6: @@ -2182,8 +2207,8 @@ packages: process-on-spawn: 1.0.0 dev: true - /node-releases@2.0.10: - resolution: {integrity: sha512-5GFldHPXVG/YZmFzJvKK2zDSzPKhEp0+ZR5SVaoSag9fsL5YgHbUHDfnG5494ISANDcK4KwPXAx2xqVEydmd7w==} + /node-releases@2.0.13: + resolution: {integrity: sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==} dev: true /normalize-package-data@2.5.0: @@ -2246,9 +2271,9 @@ packages: istanbul-lib-hook: 3.0.0 istanbul-lib-instrument: 4.0.3 istanbul-lib-processinfo: 2.0.3 - istanbul-lib-report: 3.0.0 + istanbul-lib-report: 3.0.1 istanbul-lib-source-maps: 4.0.1 - istanbul-reports: 3.1.5 + istanbul-reports: 3.1.6 make-dir: 3.1.0 node-preload: 0.2.1 p-map: 3.0.0 @@ -2502,8 +2527,8 @@ packages: irregular-plurals: 3.5.0 dev: true - /prettier@3.0.2: - resolution: {integrity: sha512-o2YR9qtniXvwEZlOKbveKfDQVyqxbEIWn48Z8m3ZJjBjcCmUy3xZGIv+7AkaeuaTr6yPXJjwv07ZWlsWbEy1rQ==} + /prettier@3.0.3: + resolution: {integrity: sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==} engines: {node: '>=14'} hasBin: true dev: true @@ -2765,17 +2790,9 @@ packages: hasBin: true dev: true - /semver@6.3.0: - resolution: {integrity: sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==} - hasBin: true - dev: true - - /semver@7.5.1: - resolution: {integrity: sha512-Wvss5ivl8TMRZXXESstBA4uR5iXgEN/VC5/sOcuXdVLzcdkz4HWetIoRfG5gb5X+ij/G9rw9YoGn3QoQ8OCSpw==} - engines: {node: '>=10'} + /semver@6.3.1: + resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} hasBin: true - dependencies: - lru-cache: 6.0.0 dev: true /semver@7.5.4: @@ -3062,7 +3079,7 @@ packages: yaml: 1.10.2 dev: true - /tap@16.3.8(typescript@5.1.6): + /tap@16.3.8(typescript@5.2.2): resolution: {integrity: sha512-ARpCLtOFST37MholnZm7JMFikGq0x/T9uBdZH83iuddPNgwDTZQiD8+4x7VABUfVWS0ozKUkmHZ5OOzMI3fLPg==} engines: {node: '>=12'} hasBin: true @@ -3089,7 +3106,7 @@ packages: isexe: 2.0.0 istanbul-lib-processinfo: 2.0.3 jackspeak: 1.4.2 - libtap: 1.4.0 + libtap: 1.4.1 minipass: 3.3.6 mkdirp: 1.0.4 nyc: 15.1.0 @@ -3101,7 +3118,7 @@ packages: tap-parser: 11.0.2 tap-yaml: 1.0.2 tcompare: 5.0.7 - typescript: 5.1.6 + typescript: 5.2.2 which: 2.0.2 transitivePeerDependencies: - supports-color @@ -3140,11 +3157,6 @@ packages: engines: {node: '>=14'} dev: true - /tiny-lru@11.0.1: - resolution: {integrity: sha512-iNgFugVuQgBKrqeO/mpiTTgmBsTP0WL6yeuLfLs/Ctf0pI/ixGqIRm8sDCwMcXGe9WWvt2sGXI5mNqZbValmJg==} - engines: {node: '>=12'} - dev: true - /to-fast-properties@2.0.0: resolution: {integrity: sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==} engines: {node: '>=4'} @@ -3157,6 +3169,11 @@ packages: is-number: 7.0.0 dev: true + /toad-cache@3.2.0: + resolution: {integrity: sha512-Hj5zSqBS6OHbZoQk9IU8VqIr+0JUpwzunnwSlFJhG8aJSInYUMEuzItl3kJsGteTPd1qtflafdRHlRtUazYeqg==} + engines: {node: '>=12'} + dev: true + /toidentifier@1.0.1: resolution: {integrity: sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==} engines: {node: '>=0.6'} @@ -3177,7 +3194,7 @@ packages: engines: {node: '>= 8'} dev: true - /ts-node-dev@2.0.0(@types/node@20.5.1)(typescript@5.1.6): + /ts-node-dev@2.0.0(@types/node@20.6.2)(typescript@5.2.2): resolution: {integrity: sha512-ywMrhCfH6M75yftYvrvNarLEY+SUXtUvU8/0Z6llrHQVBx12GiFk5sStF8UdfE/yfzk9IAq7O5EEbTQsxlBI8w==} engines: {node: '>=0.8.0'} hasBin: true @@ -3196,16 +3213,16 @@ packages: rimraf: 2.7.1 source-map-support: 0.5.21 tree-kill: 1.2.2 - ts-node: 10.9.1(@types/node@20.5.1)(typescript@5.1.6) + ts-node: 10.9.1(@types/node@20.6.2)(typescript@5.2.2) tsconfig: 7.0.0 - typescript: 5.1.6 + typescript: 5.2.2 transitivePeerDependencies: - '@swc/core' - '@swc/wasm' - '@types/node' dev: true - /ts-node@10.9.1(@types/node@16.18.31)(typescript@4.9.5): + /ts-node@10.9.1(@types/node@16.18.31)(typescript@5.1.6): resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} hasBin: true peerDependencies: @@ -3231,12 +3248,12 @@ packages: create-require: 1.1.1 diff: 4.0.2 make-error: 1.3.6 - typescript: 4.9.5 + typescript: 5.1.6 v8-compile-cache-lib: 3.0.1 yn: 3.1.1 dev: false - /ts-node@10.9.1(@types/node@20.5.1)(typescript@5.1.6): + /ts-node@10.9.1(@types/node@20.6.2)(typescript@5.2.2): resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} hasBin: true peerDependencies: @@ -3255,14 +3272,14 @@ packages: '@tsconfig/node12': 1.0.11 '@tsconfig/node14': 1.0.3 '@tsconfig/node16': 1.0.4 - '@types/node': 20.5.1 + '@types/node': 20.6.2 acorn: 8.8.2 acorn-walk: 8.2.0 arg: 4.1.3 create-require: 1.1.1 diff: 4.0.2 make-error: 1.3.6 - typescript: 5.1.6 + typescript: 5.2.2 v8-compile-cache-lib: 3.0.1 yn: 3.1.1 dev: true @@ -3280,12 +3297,12 @@ packages: strip-json-comments: 2.0.1 dev: true - /tsd@0.28.1: - resolution: {integrity: sha512-FeYrfJ05QgEMW/qOukNCr4fAJHww4SaKnivAXRv4g5kj4FeLpNV7zH4dorzB9zAfVX4wmA7zWu/wQf7kkcvfbw==} + /tsd@0.29.0: + resolution: {integrity: sha512-5B7jbTj+XLMg6rb9sXRBGwzv7h8KJlGOkTHxY63eWpZJiQ5vJbXEjL0u7JkIxwi5EsrRE1kRVUWmy6buK/ii8A==} engines: {node: '>=14.16'} hasBin: true dependencies: - '@tsd/typescript': 5.0.4 + '@tsd/typescript': 5.2.2 eslint-formatter-pretty: 4.1.0 globby: 11.1.0 jest-diff: 29.5.0 @@ -3319,8 +3336,8 @@ packages: engines: {node: '>=10'} dev: true - /type-fest@4.2.0: - resolution: {integrity: sha512-5zknd7Dss75pMSED270A1RQS3KloqRJA9XbXLe0eCxyw7xXFb3rd+9B0UQ/0E+LQT6lnrLviEolYORlRWamn4w==} + /type-fest@4.3.1: + resolution: {integrity: sha512-pphNW/msgOUSkJbH58x8sqpq8uQj6b0ZKGxEsLKMUnGorRcDjrUaLS+39+/ub41JNTwrrMyJcUB8+YZs3mbwqw==} engines: {node: '>=16'} dev: true @@ -3330,31 +3347,31 @@ packages: is-typedarray: 1.0.0 dev: true - /typescript-json-schema@0.59.0: - resolution: {integrity: sha512-eYB9RO8p4PntznWUukdDQHckNfxzjEFCJUgsWeCE43mcFioE0wXGTSECGk1uhty9XQMxkpuI4pKAqqnb62ln3Q==} + /typescript-json-schema@0.61.0: + resolution: {integrity: sha512-sYKnLJjvh9ljdSQkh91LM9PEzgzrgnYfvU226IauISFd+379VCti/VtAFXd00Z9euLkVffh5LRTAO8eamsxUlw==} hasBin: true dependencies: - '@types/json-schema': 7.0.12 + '@types/json-schema': 7.0.13 '@types/node': 16.18.31 glob: 7.2.3 path-equal: 1.2.5 safe-stable-stringify: 2.4.3 - ts-node: 10.9.1(@types/node@16.18.31)(typescript@4.9.5) - typescript: 4.9.5 + ts-node: 10.9.1(@types/node@16.18.31)(typescript@5.1.6) + typescript: 5.1.6 yargs: 17.7.2 transitivePeerDependencies: - '@swc/core' - '@swc/wasm' dev: false - /typescript@4.9.5: - resolution: {integrity: sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==} - engines: {node: '>=4.2.0'} + /typescript@5.1.6: + resolution: {integrity: sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==} + engines: {node: '>=14.17'} hasBin: true dev: false - /typescript@5.1.6: - resolution: {integrity: sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==} + /typescript@5.2.2: + resolution: {integrity: sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==} engines: {node: '>=14.17'} hasBin: true dev: true @@ -3365,13 +3382,13 @@ packages: punycode: 2.3.0 dev: true - /update-browserslist-db@1.0.11(browserslist@4.21.5): + /update-browserslist-db@1.0.11(browserslist@4.21.10): resolution: {integrity: sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA==} hasBin: true peerDependencies: browserslist: '>= 4.21.0' dependencies: - browserslist: 4.21.5 + browserslist: 4.21.10 escalade: 3.1.1 picocolors: 1.0.0 dev: true diff --git a/src/typed-fastify.ts b/src/typed-fastify.ts index 204db43..ce9c222 100644 --- a/src/typed-fastify.ts +++ b/src/typed-fastify.ts @@ -1,5 +1,7 @@ import type * as F from 'fastify'; import { RouteGenericInterface } from 'fastify/types/route'; +import { RequestRouteOptions } from 'fastify/types/request'; + import { FastifyRequestType, FastifyTypeProvider, @@ -37,11 +39,11 @@ const addSchema = < } fastify.decorateReply('matches', function (this: F.FastifyReply, routeWithMethod: string) { - return `${this.request.method} ${this.request.routerPath}` === routeWithMethod; + return `${this.request.method} ${this.request.routeOptions.url}` === routeWithMethod; }); fastify.decorateRequest('operationPath', null); fastify.addHook('onRequest', function (req, reply, done) { - (req as {} as { operationPath: string }).operationPath = `${req.method} ${req.routerPath}`; + (req as {} as { operationPath: string }).operationPath = `${req.method} ${req.routeOptions.url}`; done(); }); fastify.decorateReply('asReply', function (this: F.FastifyReply) { @@ -62,6 +64,7 @@ const addSchema = < } config.schema = config.schema || {}; + if (maybeSchema) { config.schema = { ...(config.schema ?? {}), @@ -203,7 +206,6 @@ interface Reply< send< AllHeaders = Get2, - O = [Headers, AllHeaders], MissingHeaders = Missing, MissingStatus = [Status] extends [never] ? true : false, >( @@ -320,6 +322,13 @@ interface Request< ? Omit, 'Params'> & { Params: PathParams } : Omit, 'Params'> & { Params: Id['Params']> }, RequestType extends FastifyRequestType = ResolveFastifyRequestType, + ROptions extends Omit, 'method' | 'url'> & { + method: MP[0]; + url: MP[1]; + } = Omit, 'method' | 'url'> & { + method: MP[0]; + url: MP[1]; + }, > extends Omit< F.FastifyRequest< RouteGeneric, @@ -331,15 +340,16 @@ interface Request< Logger, RequestType >, - 'headers' | 'method' | 'routerMethod' | 'routerPath' + 'headers' | 'method' | 'routerMethod' | 'routerPath' | 'routeOptions' > { readonly operationPath: Path; - readonly method: MP[0]; + readonly method: ROptions['method']; // A payload within a GET request message has no defined semantics; sending a payload body on a GET request might cause some existing implementations to reject the request. - readonly body: MP[0] extends 'GET' ? never : Get; - readonly routerMethod: MP[0]; + readonly body: ROptions['method'] extends 'GET' ? never : Get; + readonly routeOptions: Id>; + readonly routerMethod: ROptions['method']; readonly headers: Get; - readonly routerPath: MP[1]; + readonly routerPath: ROptions['url']; } type IsEqual = (() => G extends T ? 1 : 2) extends () => G extends U ? 1 : 2 ? true : false; @@ -368,7 +378,6 @@ type Handler< ContextConfig extends F.ContextConfigDefault = F.ContextConfigDefault, SchemaCompiler extends F.FastifySchema = F.FastifySchema, TypeProvider extends F.FastifyTypeProvider = F.FastifyTypeProviderDefault, - RequestType extends FastifyRequestType = ResolveFastifyRequestType>, Logger extends F.FastifyBaseLogger = F.FastifyBaseLogger, InvalidParams = GetInvalidParamsValidation, ValidSchema = [Op['response'][keyof Op['response']]] extends [never] @@ -376,7 +385,6 @@ type Handler< : InvalidParams extends Invalid ? InvalidParams : true, - Status extends keyof Op['response'] = keyof Op['response'], > = ValidSchema extends true ? ( this: F.FastifyInstance, @@ -408,7 +416,6 @@ type HandlerObj< ContextConfig extends F.ContextConfigDefault = F.ContextConfigDefault, SchemaCompiler extends F.FastifySchema = F.FastifySchema, TypeProvider extends F.FastifyTypeProvider = F.FastifyTypeProviderDefault, - RequestType extends FastifyRequestType = ResolveFastifyRequestType>, Logger extends F.FastifyBaseLogger = F.FastifyBaseLogger, _Handler = Handler< Op, @@ -420,7 +427,6 @@ type HandlerObj< ContextConfig, SchemaCompiler, TypeProvider, - RequestType, Logger >, _Request extends Request = Parameters any>>[0], @@ -470,7 +476,6 @@ export type Service< ContextConfig, SchemaCompiler, TypeProvider, - ResolveFastifyRequestType>>, Logger > | HandlerObj< @@ -483,7 +488,6 @@ export type Service< ContextConfig, SchemaCompiler, TypeProvider, - ResolveFastifyRequestType>>, Logger >; }; @@ -498,7 +502,6 @@ export type RequestHandler< SchemaCompiler extends F.FastifySchema = F.FastifySchema, TypeProvider extends FastifyTypeProvider = FastifyTypeProviderDefault, Logger extends F.FastifyBaseLogger = F.FastifyBaseLogger, - S = Service, Paths = ServiceSchema['paths'], OpHandler = { [Path in HandlerPaths]: Handler< @@ -511,11 +514,6 @@ export type RequestHandler< ContextConfig, SchemaCompiler, TypeProvider, - ResolveFastifyRequestType< - TypeProvider, - SchemaCompiler, - Router : never> - >, Logger >; }[HandlerPaths], @@ -530,11 +528,6 @@ export type RequestHandler< ContextConfig, SchemaCompiler, TypeProvider, - ResolveFastifyRequestType< - TypeProvider, - SchemaCompiler, - Router : never> - >, Logger >; }[HandlerPaths], diff --git a/test/integration.test.ts b/test/integration.test.ts index f836ce6..13c794c 100644 --- a/test/integration.test.ts +++ b/test/integration.test.ts @@ -29,10 +29,11 @@ const buildApp = async (t: Test, service?: Service) => { Query: req.query, Headers: req.headers, Body: req.body, - schema: req.routeSchema, + schema: req.routeOptions.schema, }, `request path:${req.method} ${req.url} id:${req.id}`, ); + return {}; }, res: (res) => { diff --git a/test/test_schema.gen.json b/test/test_schema.gen.json index 04f4ccf..91af1ad 100644 --- a/test/test_schema.gen.json +++ b/test/test_schema.gen.json @@ -323,5 +323,5 @@ } } }, - "$hash": "c138d591328ddd9cc1b794e5e35447467e7c1f8d4129b8fc727c11d7e9b0ef02__v1.1.31692627847130" + "$hash": "c138d591328ddd9cc1b794e5e35447467e7c1f8d4129b8fc727c11d7e9b0ef02__v1.1.4" } \ No newline at end of file diff --git a/test/typed-fastify.test-d.ts b/test/typed-fastify.test-d.ts index 707c771..d88fa98 100644 --- a/test/typed-fastify.test-d.ts +++ b/test/typed-fastify.test-d.ts @@ -152,9 +152,13 @@ expectType>({ 'GET /': (req, reply) => { expectType<'GET'>(req.method); expectType<'GET'>(reply.request.method); + expectType<'GET'>(req.routeOptions.method); + expectType<'GET'>(reply.request.routeOptions.method); expectType(req.body); expectType<'/'>(req.routerPath); expectType<'/'>(reply.request.routerPath); + expectType<'/'>(req.routeOptions.url); + expectType<'/'>(reply.request.routeOptions.url); return { name: 'works', }; @@ -260,7 +264,7 @@ const complexHandlers = ( never(req); } - function testHeaders(headers: typeof req['headers'] | typeof reply['request']['headers']) { + function testHeaders(headers: (typeof req)['headers'] | (typeof reply)['request']['headers']) { if ('postHeader2' in headers) { headers.postHeader2; headers.postHeader; @@ -293,9 +297,11 @@ const complexHandlers = ( break; case 'PATCH': expectType<'/' | '/other' | '/other_empty'>(req.routerPath); + expectType<'/' | '/other' | '/other_empty'>(req.routeOptions.url); break; case 'PUT': expectType<'/' | '/other'>(req.routerPath); + expectType<'/' | '/other'>(req.routeOptions.url); break; default: never(req); @@ -305,17 +311,50 @@ const complexHandlers = ( case '/': expectType<'GET' | 'PATCH' | 'POST'>(req.method); expectType<'GET' | 'PATCH' | 'POST'>(req.routerMethod); + expectType<'GET' | 'PATCH' | 'POST'>(req.routeOptions.method); + expectType<'/'>(req.routeOptions.url); break; case '/other_empty': expectType<'PATCH'>(req.routerMethod); + expectType<'PATCH'>(req.routeOptions.method); + expectType<'/other_empty'>(req.routeOptions.url); break; case '/other': expectType<'PUT' | 'PATCH'>(req.method); expectType<'PUT' | 'PATCH'>(req.routerMethod); + expectType<'PUT' | 'PATCH'>(req.routeOptions.method); break; default: never(req); } + + switch (req.routeOptions.url) { + case '/': + // @ts-expect-error + expectType<'GET' | 'PATCH' | 'POST'>(req.method); + // @ts-expect-error + expectType<'GET' | 'PATCH' | 'POST'>(req.routerMethod); + expectType<'GET' | 'PATCH' | 'POST'>(req.routeOptions.method); + expectType<'/'>(req.routeOptions.url); + expectType<'/'>(req.routeOptions.url); + break; + case '/other_empty': + // @ts-expect-error + expectType<'PATCH'>(req.routerMethod); + expectType<'PATCH'>(req.routeOptions.method); + expectType<'/other_empty'>(req.routeOptions.url); + break; + case '/other': + // @ts-expect-error + expectType<'PUT' | 'PATCH'>(req.method); + // @ts-expect-error + expectType<'PUT' | 'PATCH'>(req.routerMethod); + expectType<'PUT' | 'PATCH'>(req.routeOptions.method); + break; + default: + never(req.routeOptions); + } + switch (reply.request.method) { case 'GET': reply.request.query.getQueryParam; @@ -334,7 +373,7 @@ const complexHandlers = ( never(reply.request); } - const routerPathWithMethod = `${reply.request.method} ${reply.request.routerPath}` as ComplexHandlers['Paths']; + const routerPathWithMethod = `${reply.request.method} ${reply.request.routeOptions.url}` as ComplexHandlers['Paths']; switch (routerPathWithMethod) { case 'GET /': case 'POST /':