keq 2.8.14 → 2.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/settings.local.json +26 -0
- package/CHANGELOG.md +7 -0
- package/dist/esm/src/create-request.js +2 -0
- package/dist/esm/src/middlewares/mutex-flow-control-middleware.d.ts +2 -0
- package/dist/esm/src/middlewares/mutex-flow-control-middleware.js +22 -0
- package/dist/esm/src/types/keq-flow-control.d.ts +1 -1
- package/dist/esm/src/types/keq-global.d.ts +1 -0
- package/dist/umd/src/create-request.js +3 -1
- package/dist/umd/src/middlewares/mutex-flow-control-middleware.d.ts +2 -0
- package/dist/umd/src/middlewares/mutex-flow-control-middleware.js +36 -0
- package/dist/umd/src/types/keq-flow-control.d.ts +1 -1
- package/dist/umd/src/types/keq-global.d.ts +1 -0
- package/package.json +1 -1
- package/packages/cache/.turbo/turbo-build.log +26 -11
- package/packages/cache/dist/index.d.mts +354 -0
- package/packages/cache/dist/index.d.mts.map +1 -0
- package/packages/cache/dist/index.d.ts +352 -5
- package/packages/cache/dist/index.d.ts.map +1 -1
- package/packages/cache/dist/index.js +1211 -1276
- package/packages/cache/dist/index.js.map +1 -1
- package/packages/cache/dist/index.mjs +1183 -1251
- package/packages/cache/dist/index.mjs.map +1 -1
- package/packages/cli/.turbo/turbo-build.log +89 -9
- package/packages/cli/dist/cli.cjs +1333 -2937
- package/packages/cli/dist/cli.cjs.map +1 -1
- package/packages/cli/dist/cli.d.cts +1 -0
- package/packages/cli/dist/cli.d.mts +1 -0
- package/packages/cli/dist/cli.mjs +1359 -0
- package/packages/cli/dist/cli.mjs.map +1 -0
- package/packages/cli/dist/compiler-0Kli6UCr.cjs +738 -0
- package/packages/cli/dist/compiler-0Kli6UCr.cjs.map +1 -0
- package/packages/cli/dist/compiler-C3AE8j54.mjs +715 -0
- package/packages/cli/dist/compiler-C3AE8j54.mjs.map +1 -0
- package/packages/cli/dist/index.cjs +17 -2896
- package/packages/cli/dist/index.cjs.map +1 -1
- package/packages/cli/dist/index.d.cts +17 -0
- package/packages/cli/dist/index.d.cts.map +1 -0
- package/packages/cli/dist/index.d.mts +17 -0
- package/packages/cli/dist/index.d.mts.map +1 -0
- package/packages/cli/dist/index.mjs +10 -0
- package/packages/cli/dist/index.mjs.map +1 -0
- package/packages/cli/dist/init-BNhD2oCI.mjs +168 -0
- package/packages/cli/dist/init-BNhD2oCI.mjs.map +1 -0
- package/packages/cli/dist/init-DqxLcRSQ.cjs +170 -0
- package/packages/cli/dist/init-DqxLcRSQ.cjs.map +1 -0
- package/packages/cli/dist/logger-D7PyVZo3.cjs +46 -0
- package/packages/cli/dist/logger-D7PyVZo3.cjs.map +1 -0
- package/packages/cli/dist/logger-QLBHySQ3.mjs +12 -0
- package/packages/cli/dist/logger-QLBHySQ3.mjs.map +1 -0
- package/packages/cli/dist/micro-function.translator-BmJZzkKh.cjs +16 -0
- package/packages/cli/dist/micro-function.translator-BmJZzkKh.cjs.map +1 -0
- package/packages/cli/dist/micro-function.translator-CDfkj4Tt.mjs +11 -0
- package/packages/cli/dist/micro-function.translator-CDfkj4Tt.mjs.map +1 -0
- package/packages/cli/dist/mock-command-Bp1LxSls.mjs +350 -0
- package/packages/cli/dist/mock-command-Bp1LxSls.mjs.map +1 -0
- package/packages/cli/dist/mock-command-WZcfy5Iq.cjs +353 -0
- package/packages/cli/dist/mock-command-WZcfy5Iq.cjs.map +1 -0
- package/packages/cli/dist/plugins-CgMhaNZq.cjs +3558 -0
- package/packages/cli/dist/plugins-CgMhaNZq.cjs.map +1 -0
- package/packages/cli/dist/plugins-DCvJ8iHR.mjs +3280 -0
- package/packages/cli/dist/plugins-DCvJ8iHR.mjs.map +1 -0
- package/packages/cli/dist/plugins.cjs +36 -2438
- package/packages/cli/dist/plugins.d.cts +2 -0
- package/packages/cli/dist/plugins.d.mts +2 -0
- package/packages/cli/dist/plugins.mjs +2 -0
- package/packages/cli/dist/runtime-config-BWQlPhiB.d.cts +780 -0
- package/packages/cli/dist/runtime-config-BWQlPhiB.d.cts.map +1 -0
- package/packages/cli/dist/runtime-config-CrzK-Ucf.d.mts +780 -0
- package/packages/cli/dist/runtime-config-CrzK-Ucf.d.mts.map +1 -0
- package/packages/cli/dist/translators.cjs +14 -0
- package/packages/cli/dist/translators.cjs.map +1 -0
- package/packages/cli/dist/translators.d.cts +14 -0
- package/packages/cli/dist/translators.d.cts.map +1 -0
- package/packages/cli/dist/translators.d.mts +14 -0
- package/packages/cli/dist/translators.d.mts.map +1 -0
- package/packages/cli/dist/translators.mjs +12 -0
- package/packages/cli/dist/translators.mjs.map +1 -0
- package/packages/cli/node_modules/.bin/eslint +2 -2
- package/packages/cli/node_modules/.bin/jiti +2 -2
- package/packages/cli/node_modules/.bin/js-yaml +2 -2
- package/packages/cli/node_modules/.bin/jsf +21 -0
- package/packages/cli/node_modules/.bin/jsonpath +2 -2
- package/packages/cli/node_modules/.bin/jsonpath-plus +2 -2
- package/packages/cli/node_modules/.bin/semver +2 -2
- package/packages/cli/node_modules/.bin/tsc +4 -4
- package/packages/cli/node_modules/.bin/tsserver +4 -4
- package/packages/exception/.turbo/turbo-build.log +26 -31
- package/packages/exception/dist/index.d.mts +21 -0
- package/packages/exception/dist/index.d.mts.map +1 -0
- package/packages/exception/dist/index.d.ts +20 -3
- package/packages/exception/dist/index.d.ts.map +1 -1
- package/packages/exception/dist/index.js +97 -105
- package/packages/exception/dist/index.js.map +1 -1
- package/packages/exception/dist/index.mjs +92 -104
- package/packages/exception/dist/index.mjs.map +1 -1
- package/packages/headers/.turbo/turbo-build.log +26 -18
- package/packages/headers/dist/index.d.mts +46 -0
- package/packages/headers/dist/index.d.mts.map +1 -0
- package/packages/headers/dist/index.d.ts +11 -7
- package/packages/headers/dist/index.d.ts.map +1 -1
- package/packages/headers/dist/index.js +68 -64
- package/packages/headers/dist/index.js.map +1 -1
- package/packages/headers/dist/index.mjs +62 -43
- package/packages/headers/dist/index.mjs.map +1 -1
- package/packages/keq/.turbo/turbo-build.log +26 -16
- package/packages/keq/dist/index.d.mts +962 -0
- package/packages/keq/dist/index.d.mts.map +1 -0
- package/packages/keq/dist/index.d.ts +961 -7
- package/packages/keq/dist/index.d.ts.map +1 -1
- package/packages/keq/dist/index.js +1727 -1842
- package/packages/keq/dist/index.js.map +1 -1
- package/packages/keq/dist/index.mjs +1671 -1817
- package/packages/keq/dist/index.mjs.map +1 -1
- package/packages/nestjs/.turbo/turbo-build.log +26 -11
- package/packages/nestjs/dist/index.d.mts +52 -0
- package/packages/nestjs/dist/index.d.mts.map +1 -0
- package/packages/nestjs/dist/index.d.ts +51 -2
- package/packages/nestjs/dist/index.d.ts.map +1 -1
- package/packages/nestjs/dist/index.js +156 -60
- package/packages/nestjs/dist/index.js.map +1 -1
- package/packages/nestjs/dist/index.mjs +133 -42
- package/packages/nestjs/dist/index.mjs.map +1 -1
- package/packages/test/.turbo/turbo-build.log +1 -1
- package/packages/url/.turbo/turbo-build.log +26 -18
- package/packages/url/dist/index.d.mts +9 -0
- package/packages/url/dist/index.d.mts.map +1 -0
- package/packages/url/dist/index.d.ts +8 -4
- package/packages/url/dist/index.d.ts.map +1 -1
- package/packages/url/dist/index.js +36 -60
- package/packages/url/dist/index.js.map +1 -1
- package/packages/url/dist/index.mjs +33 -39
- package/packages/url/dist/index.mjs.map +1 -1
- package/packages/cache/dist/cache-entry/cache-entry.d.ts +0 -17
- package/packages/cache/dist/cache-entry/cache-entry.d.ts.map +0 -1
- package/packages/cache/dist/cache-entry/index.d.ts +0 -4
- package/packages/cache/dist/cache-entry/index.d.ts.map +0 -1
- package/packages/cache/dist/cache-entry/types/cache-entry-build-options.d.ts +0 -8
- package/packages/cache/dist/cache-entry/types/cache-entry-build-options.d.ts.map +0 -1
- package/packages/cache/dist/cache-entry/types/cache-entry-options.d.ts +0 -7
- package/packages/cache/dist/cache-entry/types/cache-entry-options.d.ts.map +0 -1
- package/packages/cache/dist/cache.d.ts +0 -44
- package/packages/cache/dist/cache.d.ts.map +0 -1
- package/packages/cache/dist/constants/eviction.enum.d.ts +0 -7
- package/packages/cache/dist/constants/eviction.enum.d.ts.map +0 -1
- package/packages/cache/dist/constants/index.d.ts +0 -5
- package/packages/cache/dist/constants/index.d.ts.map +0 -1
- package/packages/cache/dist/constants/max-expired-at.d.ts +0 -2
- package/packages/cache/dist/constants/max-expired-at.d.ts.map +0 -1
- package/packages/cache/dist/constants/size.enum.d.ts +0 -7
- package/packages/cache/dist/constants/size.enum.d.ts.map +0 -1
- package/packages/cache/dist/constants/strategy.enum.d.ts +0 -7
- package/packages/cache/dist/constants/strategy.enum.d.ts.map +0 -1
- package/packages/cache/dist/exceptions/cache-exception.d.ts +0 -5
- package/packages/cache/dist/exceptions/cache-exception.d.ts.map +0 -1
- package/packages/cache/dist/exceptions/index.d.ts +0 -2
- package/packages/cache/dist/exceptions/index.d.ts.map +0 -1
- package/packages/cache/dist/request-cache-handler/index.d.ts +0 -2
- package/packages/cache/dist/request-cache-handler/index.d.ts.map +0 -1
- package/packages/cache/dist/request-cache-handler/request-cache-handler.d.ts +0 -23
- package/packages/cache/dist/request-cache-handler/request-cache-handler.d.ts.map +0 -1
- package/packages/cache/dist/storage/index.d.ts +0 -6
- package/packages/cache/dist/storage/index.d.ts.map +0 -1
- package/packages/cache/dist/storage/indexed-db-storage/base-indexed-db-storage.d.ts +0 -22
- package/packages/cache/dist/storage/indexed-db-storage/base-indexed-db-storage.d.ts.map +0 -1
- package/packages/cache/dist/storage/indexed-db-storage/constants/default-table-name.d.ts +0 -2
- package/packages/cache/dist/storage/indexed-db-storage/constants/default-table-name.d.ts.map +0 -1
- package/packages/cache/dist/storage/indexed-db-storage/index.d.ts +0 -3
- package/packages/cache/dist/storage/indexed-db-storage/index.d.ts.map +0 -1
- package/packages/cache/dist/storage/indexed-db-storage/indexed-db-storage.d.ts +0 -12
- package/packages/cache/dist/storage/indexed-db-storage/indexed-db-storage.d.ts.map +0 -1
- package/packages/cache/dist/storage/indexed-db-storage/lfu-indexed-db-storage.d.ts +0 -11
- package/packages/cache/dist/storage/indexed-db-storage/lfu-indexed-db-storage.d.ts.map +0 -1
- package/packages/cache/dist/storage/indexed-db-storage/lru-indexed-db-storage.d.ts +0 -11
- package/packages/cache/dist/storage/indexed-db-storage/lru-indexed-db-storage.d.ts.map +0 -1
- package/packages/cache/dist/storage/indexed-db-storage/random-indexed-db-storage.d.ts +0 -11
- package/packages/cache/dist/storage/indexed-db-storage/random-indexed-db-storage.d.ts.map +0 -1
- package/packages/cache/dist/storage/indexed-db-storage/ttl-indexed-db-storage.d.ts +0 -11
- package/packages/cache/dist/storage/indexed-db-storage/ttl-indexed-db-storage.d.ts.map +0 -1
- package/packages/cache/dist/storage/indexed-db-storage/types/index.d.ts +0 -7
- package/packages/cache/dist/storage/indexed-db-storage/types/index.d.ts.map +0 -1
- package/packages/cache/dist/storage/indexed-db-storage/types/indexed-db-entry-metadata.d.ts +0 -12
- package/packages/cache/dist/storage/indexed-db-storage/types/indexed-db-entry-metadata.d.ts.map +0 -1
- package/packages/cache/dist/storage/indexed-db-storage/types/indexed-db-entry-response.d.ts +0 -8
- package/packages/cache/dist/storage/indexed-db-storage/types/indexed-db-entry-response.d.ts.map +0 -1
- package/packages/cache/dist/storage/indexed-db-storage/types/indexed-db-entry-visits.d.ts +0 -14
- package/packages/cache/dist/storage/indexed-db-storage/types/indexed-db-entry-visits.d.ts.map +0 -1
- package/packages/cache/dist/storage/indexed-db-storage/types/indexed-db-schema.d.ts +0 -29
- package/packages/cache/dist/storage/indexed-db-storage/types/indexed-db-schema.d.ts.map +0 -1
- package/packages/cache/dist/storage/indexed-db-storage/types/indexed-db-storage-options.d.ts +0 -14
- package/packages/cache/dist/storage/indexed-db-storage/types/indexed-db-storage-options.d.ts.map +0 -1
- package/packages/cache/dist/storage/indexed-db-storage/types/indexed-db-storage-size.d.ts +0 -13
- package/packages/cache/dist/storage/indexed-db-storage/types/indexed-db-storage-size.d.ts.map +0 -1
- package/packages/cache/dist/storage/internal-storage/internal-storage.d.ts +0 -16
- package/packages/cache/dist/storage/internal-storage/internal-storage.d.ts.map +0 -1
- package/packages/cache/dist/storage/internal-storage/types/events.d.ts +0 -16
- package/packages/cache/dist/storage/internal-storage/types/events.d.ts.map +0 -1
- package/packages/cache/dist/storage/internal-storage/types/storage-options.d.ts +0 -20
- package/packages/cache/dist/storage/internal-storage/types/storage-options.d.ts.map +0 -1
- package/packages/cache/dist/storage/keq-cache-storage.d.ts +0 -20
- package/packages/cache/dist/storage/keq-cache-storage.d.ts.map +0 -1
- package/packages/cache/dist/storage/memory-storage/base-memory-storage.d.ts +0 -31
- package/packages/cache/dist/storage/memory-storage/base-memory-storage.d.ts.map +0 -1
- package/packages/cache/dist/storage/memory-storage/index.d.ts +0 -3
- package/packages/cache/dist/storage/memory-storage/index.d.ts.map +0 -1
- package/packages/cache/dist/storage/memory-storage/lfu-memory-storage.d.ts +0 -11
- package/packages/cache/dist/storage/memory-storage/lfu-memory-storage.d.ts.map +0 -1
- package/packages/cache/dist/storage/memory-storage/lru-memory-storage.d.ts +0 -11
- package/packages/cache/dist/storage/memory-storage/lru-memory-storage.d.ts.map +0 -1
- package/packages/cache/dist/storage/memory-storage/memory-storage.d.ts +0 -13
- package/packages/cache/dist/storage/memory-storage/memory-storage.d.ts.map +0 -1
- package/packages/cache/dist/storage/memory-storage/random-memory-storage.d.ts +0 -11
- package/packages/cache/dist/storage/memory-storage/random-memory-storage.d.ts.map +0 -1
- package/packages/cache/dist/storage/memory-storage/ttl-memory-storage.d.ts +0 -11
- package/packages/cache/dist/storage/memory-storage/ttl-memory-storage.d.ts.map +0 -1
- package/packages/cache/dist/storage/memory-storage/types/index.d.ts +0 -3
- package/packages/cache/dist/storage/memory-storage/types/index.d.ts.map +0 -1
- package/packages/cache/dist/storage/memory-storage/types/memory-storage-options.d.ts +0 -9
- package/packages/cache/dist/storage/memory-storage/types/memory-storage-options.d.ts.map +0 -1
- package/packages/cache/dist/storage/memory-storage/types/memory-storage-size.d.ts +0 -13
- package/packages/cache/dist/storage/memory-storage/types/memory-storage-size.d.ts.map +0 -1
- package/packages/cache/dist/storage/memory-storage/utils/humanize-size.d.ts +0 -6
- package/packages/cache/dist/storage/memory-storage/utils/humanize-size.d.ts.map +0 -1
- package/packages/cache/dist/storage/memory-storage/utils/index.d.ts +0 -3
- package/packages/cache/dist/storage/memory-storage/utils/index.d.ts.map +0 -1
- package/packages/cache/dist/storage/memory-storage/utils/serialize-response-body.d.ts +0 -6
- package/packages/cache/dist/storage/memory-storage/utils/serialize-response-body.d.ts.map +0 -1
- package/packages/cache/dist/storage/multi-tier-storage/index.d.ts +0 -3
- package/packages/cache/dist/storage/multi-tier-storage/index.d.ts.map +0 -1
- package/packages/cache/dist/storage/multi-tier-storage/multi-tier-storage.d.ts +0 -36
- package/packages/cache/dist/storage/multi-tier-storage/multi-tier-storage.d.ts.map +0 -1
- package/packages/cache/dist/storage/multi-tier-storage/types/index.d.ts +0 -2
- package/packages/cache/dist/storage/multi-tier-storage/types/index.d.ts.map +0 -1
- package/packages/cache/dist/storage/multi-tier-storage/types/multi-tier-storage-options.d.ts +0 -5
- package/packages/cache/dist/storage/multi-tier-storage/types/multi-tier-storage-options.d.ts.map +0 -1
- package/packages/cache/dist/storage/tier-storage/index.d.ts +0 -3
- package/packages/cache/dist/storage/tier-storage/index.d.ts.map +0 -1
- package/packages/cache/dist/storage/tier-storage/tier-storage.d.ts +0 -15
- package/packages/cache/dist/storage/tier-storage/tier-storage.d.ts.map +0 -1
- package/packages/cache/dist/storage/tier-storage/types/index.d.ts +0 -2
- package/packages/cache/dist/storage/tier-storage/types/index.d.ts.map +0 -1
- package/packages/cache/dist/storage/tier-storage/types/tier-storage-options.d.ts +0 -21
- package/packages/cache/dist/storage/tier-storage/types/tier-storage-options.d.ts.map +0 -1
- package/packages/cache/dist/strategies/cache-first.d.ts +0 -3
- package/packages/cache/dist/strategies/cache-first.d.ts.map +0 -1
- package/packages/cache/dist/strategies/index.d.ts +0 -5
- package/packages/cache/dist/strategies/index.d.ts.map +0 -1
- package/packages/cache/dist/strategies/network-first.d.ts +0 -3
- package/packages/cache/dist/strategies/network-first.d.ts.map +0 -1
- package/packages/cache/dist/strategies/network-only.d.ts +0 -3
- package/packages/cache/dist/strategies/network-only.d.ts.map +0 -1
- package/packages/cache/dist/strategies/stale-while-revalidate.d.ts +0 -3
- package/packages/cache/dist/strategies/stale-while-revalidate.d.ts.map +0 -1
- package/packages/cache/dist/types/index.d.ts +0 -6
- package/packages/cache/dist/types/index.d.ts.map +0 -1
- package/packages/cache/dist/types/keq-cache-key.d.ts +0 -4
- package/packages/cache/dist/types/keq-cache-key.d.ts.map +0 -1
- package/packages/cache/dist/types/keq-cache-pattern.d.ts +0 -3
- package/packages/cache/dist/types/keq-cache-pattern.d.ts.map +0 -1
- package/packages/cache/dist/types/keq-cache-rule.d.ts +0 -6
- package/packages/cache/dist/types/keq-cache-rule.d.ts.map +0 -1
- package/packages/cache/dist/types/keq-cache-strategy.d.ts +0 -6
- package/packages/cache/dist/types/keq-cache-strategy.d.ts.map +0 -1
- package/packages/cache/dist/types/request-cache-options.d.ts +0 -45
- package/packages/cache/dist/types/request-cache-options.d.ts.map +0 -1
- package/packages/cache/dist/utils/get-response-bytes.d.ts +0 -2
- package/packages/cache/dist/utils/get-response-bytes.d.ts.map +0 -1
- package/packages/cache/dist/utils/index.d.ts +0 -4
- package/packages/cache/dist/utils/index.d.ts.map +0 -1
- package/packages/cache/dist/utils/logger.d.ts +0 -5
- package/packages/cache/dist/utils/logger.d.ts.map +0 -1
- package/packages/cache/dist/utils/random.d.ts +0 -2
- package/packages/cache/dist/utils/random.d.ts.map +0 -1
- package/packages/cli/dist/cli.d.ts +0 -3
- package/packages/cli/dist/cli.d.ts.map +0 -1
- package/packages/cli/dist/cli.js +0 -2945
- package/packages/cli/dist/cli.js.map +0 -1
- package/packages/cli/dist/compiler/compiler.d.ts +0 -17
- package/packages/cli/dist/compiler/compiler.d.ts.map +0 -1
- package/packages/cli/dist/compiler/index.d.ts +0 -4
- package/packages/cli/dist/compiler/index.d.ts.map +0 -1
- package/packages/cli/dist/compiler/intercepter/index.d.ts +0 -3
- package/packages/cli/dist/compiler/intercepter/index.d.ts.map +0 -1
- package/packages/cli/dist/compiler/intercepter/perfect-error-message.d.ts +0 -3
- package/packages/cli/dist/compiler/intercepter/perfect-error-message.d.ts.map +0 -1
- package/packages/cli/dist/compiler/intercepter/print-information.d.ts +0 -5
- package/packages/cli/dist/compiler/intercepter/print-information.d.ts.map +0 -1
- package/packages/cli/dist/compiler/tasks/compile/index.d.ts +0 -6
- package/packages/cli/dist/compiler/tasks/compile/index.d.ts.map +0 -1
- package/packages/cli/dist/compiler/tasks/download/index.d.ts +0 -10
- package/packages/cli/dist/compiler/tasks/download/index.d.ts.map +0 -1
- package/packages/cli/dist/compiler/tasks/index.d.ts +0 -6
- package/packages/cli/dist/compiler/tasks/index.d.ts.map +0 -1
- package/packages/cli/dist/compiler/tasks/persist/index.d.ts +0 -5
- package/packages/cli/dist/compiler/tasks/persist/index.d.ts.map +0 -1
- package/packages/cli/dist/compiler/tasks/setup/index.d.ts +0 -15
- package/packages/cli/dist/compiler/tasks/setup/index.d.ts.map +0 -1
- package/packages/cli/dist/compiler/tasks/setup/utils/find-nearest-package-json.d.ts +0 -6
- package/packages/cli/dist/compiler/tasks/setup/utils/find-nearest-package-json.d.ts.map +0 -1
- package/packages/cli/dist/compiler/tasks/setup/utils/get-project-module-system.d.ts +0 -5
- package/packages/cli/dist/compiler/tasks/setup/utils/get-project-module-system.d.ts.map +0 -1
- package/packages/cli/dist/compiler/tasks/setup/utils/index.d.ts +0 -3
- package/packages/cli/dist/compiler/tasks/setup/utils/index.d.ts.map +0 -1
- package/packages/cli/dist/compiler/tasks/setup/utils/parse-runtime-config.d.ts +0 -3
- package/packages/cli/dist/compiler/tasks/setup/utils/parse-runtime-config.d.ts.map +0 -1
- package/packages/cli/dist/compiler/tasks/types/base-task-options.d.ts +0 -6
- package/packages/cli/dist/compiler/tasks/types/base-task-options.d.ts.map +0 -1
- package/packages/cli/dist/compiler/tasks/types/index.d.ts +0 -3
- package/packages/cli/dist/compiler/tasks/types/index.d.ts.map +0 -1
- package/packages/cli/dist/compiler/tasks/types/task-wrapper.d.ts +0 -4
- package/packages/cli/dist/compiler/tasks/types/task-wrapper.d.ts.map +0 -1
- package/packages/cli/dist/compiler/types/compiler-context.d.ts +0 -11
- package/packages/cli/dist/compiler/types/compiler-context.d.ts.map +0 -1
- package/packages/cli/dist/compiler/types/compiler-hooks.d.ts +0 -19
- package/packages/cli/dist/compiler/types/compiler-hooks.d.ts.map +0 -1
- package/packages/cli/dist/compiler/types/index.d.ts +0 -3
- package/packages/cli/dist/compiler/types/index.d.ts.map +0 -1
- package/packages/cli/dist/constants/file-naming-style.d.ts +0 -14
- package/packages/cli/dist/constants/file-naming-style.d.ts.map +0 -1
- package/packages/cli/dist/constants/index.d.ts +0 -4
- package/packages/cli/dist/constants/index.d.ts.map +0 -1
- package/packages/cli/dist/constants/qs-array-format.d.ts +0 -9
- package/packages/cli/dist/constants/qs-array-format.d.ts.map +0 -1
- package/packages/cli/dist/constants/supported-methods.d.ts +0 -2
- package/packages/cli/dist/constants/supported-methods.d.ts.map +0 -1
- package/packages/cli/dist/define-config.d.ts +0 -3
- package/packages/cli/dist/define-config.d.ts.map +0 -1
- package/packages/cli/dist/exception.d.ts +0 -6
- package/packages/cli/dist/exception.d.ts.map +0 -1
- package/packages/cli/dist/generators/index.d.ts +0 -2
- package/packages/cli/dist/generators/index.d.ts.map +0 -1
- package/packages/cli/dist/index.d.ts +0 -6
- package/packages/cli/dist/index.d.ts.map +0 -1
- package/packages/cli/dist/index.js +0 -2853
- package/packages/cli/dist/index.js.map +0 -1
- package/packages/cli/dist/models/anchor.d.ts +0 -20
- package/packages/cli/dist/models/anchor.d.ts.map +0 -1
- package/packages/cli/dist/models/api-document_v3_1.d.ts +0 -16
- package/packages/cli/dist/models/api-document_v3_1.d.ts.map +0 -1
- package/packages/cli/dist/models/artifact.d.ts +0 -17
- package/packages/cli/dist/models/artifact.d.ts.map +0 -1
- package/packages/cli/dist/models/asset.d.ts +0 -5
- package/packages/cli/dist/models/asset.d.ts.map +0 -1
- package/packages/cli/dist/models/index.d.ts +0 -8
- package/packages/cli/dist/models/index.d.ts.map +0 -1
- package/packages/cli/dist/models/module-definition.d.ts +0 -8
- package/packages/cli/dist/models/module-definition.d.ts.map +0 -1
- package/packages/cli/dist/models/operation-definition.d.ts +0 -23
- package/packages/cli/dist/models/operation-definition.d.ts.map +0 -1
- package/packages/cli/dist/models/schema-definition.d.ts +0 -20
- package/packages/cli/dist/models/schema-definition.d.ts.map +0 -1
- package/packages/cli/dist/models/utils/to-comment.d.ts +0 -2
- package/packages/cli/dist/models/utils/to-comment.d.ts.map +0 -1
- package/packages/cli/dist/plugins/body-fallback/index.d.ts +0 -6
- package/packages/cli/dist/plugins/body-fallback/index.d.ts.map +0 -1
- package/packages/cli/dist/plugins/chinese-to-pinyin/chinese-to-pinyin.plugin.d.ts +0 -5
- package/packages/cli/dist/plugins/chinese-to-pinyin/chinese-to-pinyin.plugin.d.ts.map +0 -1
- package/packages/cli/dist/plugins/chinese-to-pinyin/index.d.ts +0 -2
- package/packages/cli/dist/plugins/chinese-to-pinyin/index.d.ts.map +0 -1
- package/packages/cli/dist/plugins/download-http-file/download-http-file.plugin.d.ts +0 -8
- package/packages/cli/dist/plugins/download-http-file/download-http-file.plugin.d.ts.map +0 -1
- package/packages/cli/dist/plugins/download-http-file/index.d.ts +0 -2
- package/packages/cli/dist/plugins/download-http-file/index.d.ts.map +0 -1
- package/packages/cli/dist/plugins/download-local-file/download-local-file.plugin.d.ts +0 -6
- package/packages/cli/dist/plugins/download-local-file/download-local-file.plugin.d.ts.map +0 -1
- package/packages/cli/dist/plugins/download-local-file/index.d.ts +0 -2
- package/packages/cli/dist/plugins/download-local-file/index.d.ts.map +0 -1
- package/packages/cli/dist/plugins/eslint/index.d.ts +0 -15
- package/packages/cli/dist/plugins/eslint/index.d.ts.map +0 -1
- package/packages/cli/dist/plugins/generate-declaration/constants/index.d.ts +0 -2
- package/packages/cli/dist/plugins/generate-declaration/constants/index.d.ts.map +0 -1
- package/packages/cli/dist/plugins/generate-declaration/constants/metadata-storage.d.ts +0 -12
- package/packages/cli/dist/plugins/generate-declaration/constants/metadata-storage.d.ts.map +0 -1
- package/packages/cli/dist/plugins/generate-declaration/generate-declaration.plugin.d.ts +0 -15
- package/packages/cli/dist/plugins/generate-declaration/generate-declaration.plugin.d.ts.map +0 -1
- package/packages/cli/dist/plugins/generate-declaration/generators/index.d.ts +0 -3
- package/packages/cli/dist/plugins/generate-declaration/generators/index.d.ts.map +0 -1
- package/packages/cli/dist/plugins/generate-declaration/generators/operation-declaration/index.d.ts +0 -2
- package/packages/cli/dist/plugins/generate-declaration/generators/operation-declaration/index.d.ts.map +0 -1
- package/packages/cli/dist/plugins/generate-declaration/generators/operation-declaration/operation.generator.d.ts +0 -15
- package/packages/cli/dist/plugins/generate-declaration/generators/operation-declaration/operation.generator.d.ts.map +0 -1
- package/packages/cli/dist/plugins/generate-declaration/generators/schema-declaration/index.d.ts +0 -2
- package/packages/cli/dist/plugins/generate-declaration/generators/schema-declaration/index.d.ts.map +0 -1
- package/packages/cli/dist/plugins/generate-declaration/generators/schema-declaration/schema.generator.d.ts +0 -15
- package/packages/cli/dist/plugins/generate-declaration/generators/schema-declaration/schema.generator.d.ts.map +0 -1
- package/packages/cli/dist/plugins/generate-declaration/index.d.ts +0 -3
- package/packages/cli/dist/plugins/generate-declaration/index.d.ts.map +0 -1
- package/packages/cli/dist/plugins/generate-micro-function/constants/index.d.ts +0 -2
- package/packages/cli/dist/plugins/generate-micro-function/constants/index.d.ts.map +0 -1
- package/packages/cli/dist/plugins/generate-micro-function/constants/metadata-storage.d.ts +0 -11
- package/packages/cli/dist/plugins/generate-micro-function/constants/metadata-storage.d.ts.map +0 -1
- package/packages/cli/dist/plugins/generate-micro-function/generate-micro-function.plugin.d.ts +0 -11
- package/packages/cli/dist/plugins/generate-micro-function/generate-micro-function.plugin.d.ts.map +0 -1
- package/packages/cli/dist/plugins/generate-micro-function/generators/index.d.ts +0 -3
- package/packages/cli/dist/plugins/generate-micro-function/generators/index.d.ts.map +0 -1
- package/packages/cli/dist/plugins/generate-micro-function/generators/micro_function/index.d.ts +0 -2
- package/packages/cli/dist/plugins/generate-micro-function/generators/micro_function/index.d.ts.map +0 -1
- package/packages/cli/dist/plugins/generate-micro-function/generators/micro_function/micro-function.generator.d.ts +0 -15
- package/packages/cli/dist/plugins/generate-micro-function/generators/micro_function/micro-function.generator.d.ts.map +0 -1
- package/packages/cli/dist/plugins/generate-micro-function/generators/request/index.d.ts +0 -2
- package/packages/cli/dist/plugins/generate-micro-function/generators/request/index.d.ts.map +0 -1
- package/packages/cli/dist/plugins/generate-micro-function/generators/request/request.generator.d.ts +0 -11
- package/packages/cli/dist/plugins/generate-micro-function/generators/request/request.generator.d.ts.map +0 -1
- package/packages/cli/dist/plugins/generate-micro-function/index.d.ts +0 -3
- package/packages/cli/dist/plugins/generate-micro-function/index.d.ts.map +0 -1
- package/packages/cli/dist/plugins/generate-nestjs-module/constants/index.d.ts +0 -2
- package/packages/cli/dist/plugins/generate-nestjs-module/constants/index.d.ts.map +0 -1
- package/packages/cli/dist/plugins/generate-nestjs-module/constants/metadata-storage.d.ts +0 -10
- package/packages/cli/dist/plugins/generate-nestjs-module/constants/metadata-storage.d.ts.map +0 -1
- package/packages/cli/dist/plugins/generate-nestjs-module/generate-nestjs-module.d.ts +0 -10
- package/packages/cli/dist/plugins/generate-nestjs-module/generate-nestjs-module.d.ts.map +0 -1
- package/packages/cli/dist/plugins/generate-nestjs-module/generators/index.d.ts +0 -2
- package/packages/cli/dist/plugins/generate-nestjs-module/generators/index.d.ts.map +0 -1
- package/packages/cli/dist/plugins/generate-nestjs-module/generators/nestjs-module.generator.d.ts +0 -14
- package/packages/cli/dist/plugins/generate-nestjs-module/generators/nestjs-module.generator.d.ts.map +0 -1
- package/packages/cli/dist/plugins/generate-nestjs-module/index.d.ts +0 -3
- package/packages/cli/dist/plugins/generate-nestjs-module/index.d.ts.map +0 -1
- package/packages/cli/dist/plugins/index.d.ts +0 -15
- package/packages/cli/dist/plugins/index.d.ts.map +0 -1
- package/packages/cli/dist/plugins/initialize/index.d.ts +0 -2
- package/packages/cli/dist/plugins/initialize/index.d.ts.map +0 -1
- package/packages/cli/dist/plugins/initialize/initialize.plugin.d.ts +0 -15
- package/packages/cli/dist/plugins/initialize/initialize.plugin.d.ts.map +0 -1
- package/packages/cli/dist/plugins/overwrite-operation-id/index.d.ts +0 -2
- package/packages/cli/dist/plugins/overwrite-operation-id/index.d.ts.map +0 -1
- package/packages/cli/dist/plugins/overwrite-operation-id/overwrite-operation-id.plugin.d.ts +0 -20
- package/packages/cli/dist/plugins/overwrite-operation-id/overwrite-operation-id.plugin.d.ts.map +0 -1
- package/packages/cli/dist/plugins/overwrite-query-options/index.d.ts +0 -2
- package/packages/cli/dist/plugins/overwrite-query-options/index.d.ts.map +0 -1
- package/packages/cli/dist/plugins/overwrite-query-options/overwrite-query-options.plugin.d.ts +0 -18
- package/packages/cli/dist/plugins/overwrite-query-options/overwrite-query-options.plugin.d.ts.map +0 -1
- package/packages/cli/dist/plugins/prettier/index.d.ts +0 -2
- package/packages/cli/dist/plugins/prettier/index.d.ts.map +0 -1
- package/packages/cli/dist/plugins/prettier/prettier.plugin.d.ts +0 -6
- package/packages/cli/dist/plugins/prettier/prettier.plugin.d.ts.map +0 -1
- package/packages/cli/dist/plugins/shaking/index.d.ts +0 -2
- package/packages/cli/dist/plugins/shaking/index.d.ts.map +0 -1
- package/packages/cli/dist/plugins/shaking/shaking.plugin.d.ts +0 -8
- package/packages/cli/dist/plugins/shaking/shaking.plugin.d.ts.map +0 -1
- package/packages/cli/dist/plugins/terminal-select/index.d.ts +0 -2
- package/packages/cli/dist/plugins/terminal-select/index.d.ts.map +0 -1
- package/packages/cli/dist/plugins/terminal-select/terminal-select.plugin.d.ts +0 -18
- package/packages/cli/dist/plugins/terminal-select/terminal-select.plugin.d.ts.map +0 -1
- package/packages/cli/dist/plugins/terminal-select/types/ignore-mode.d.ts +0 -2
- package/packages/cli/dist/plugins/terminal-select/types/ignore-mode.d.ts.map +0 -1
- package/packages/cli/dist/plugins/terminal-select/types/index.d.ts +0 -2
- package/packages/cli/dist/plugins/terminal-select/types/index.d.ts.map +0 -1
- package/packages/cli/dist/plugins/terminal-select/utils/index.d.ts +0 -2
- package/packages/cli/dist/plugins/terminal-select/utils/index.d.ts.map +0 -1
- package/packages/cli/dist/plugins/terminal-select/utils/select-operation-definitions.d.ts +0 -5
- package/packages/cli/dist/plugins/terminal-select/utils/select-operation-definitions.d.ts.map +0 -1
- package/packages/cli/dist/plugins.cjs.map +0 -1
- package/packages/cli/dist/plugins.js +0 -2378
- package/packages/cli/dist/plugins.js.map +0 -1
- package/packages/cli/dist/transformers/api-document/api-document.transformer.d.ts +0 -8
- package/packages/cli/dist/transformers/api-document/api-document.transformer.d.ts.map +0 -1
- package/packages/cli/dist/transformers/api-document/index.d.ts +0 -2
- package/packages/cli/dist/transformers/api-document/index.d.ts.map +0 -1
- package/packages/cli/dist/transformers/api-document/nestjs-client.renderer.d.ts +0 -14
- package/packages/cli/dist/transformers/api-document/nestjs-client.renderer.d.ts.map +0 -1
- package/packages/cli/dist/transformers/api-document/nestjs-module.renderer.d.ts +0 -12
- package/packages/cli/dist/transformers/api-document/nestjs-module.renderer.d.ts.map +0 -1
- package/packages/cli/dist/transformers/entrypoint/entrypoint.transformer.d.ts +0 -10
- package/packages/cli/dist/transformers/entrypoint/entrypoint.transformer.d.ts.map +0 -1
- package/packages/cli/dist/transformers/entrypoint/index.d.ts +0 -2
- package/packages/cli/dist/transformers/entrypoint/index.d.ts.map +0 -1
- package/packages/cli/dist/transformers/index.d.ts +0 -6
- package/packages/cli/dist/transformers/index.d.ts.map +0 -1
- package/packages/cli/dist/transformers/json-schema/comment.renderer.d.ts +0 -8
- package/packages/cli/dist/transformers/json-schema/comment.renderer.d.ts.map +0 -1
- package/packages/cli/dist/transformers/json-schema/declaration.renderer.d.ts +0 -26
- package/packages/cli/dist/transformers/json-schema/declaration.renderer.d.ts.map +0 -1
- package/packages/cli/dist/transformers/json-schema/index.d.ts +0 -4
- package/packages/cli/dist/transformers/json-schema/index.d.ts.map +0 -1
- package/packages/cli/dist/transformers/json-schema/json-schema.transformer.d.ts +0 -7
- package/packages/cli/dist/transformers/json-schema/json-schema.transformer.d.ts.map +0 -1
- package/packages/cli/dist/transformers/json-schema/reference.transformer.d.ts +0 -5
- package/packages/cli/dist/transformers/json-schema/reference.transformer.d.ts.map +0 -1
- package/packages/cli/dist/transformers/json-schema/types/any-other-attribute.d.ts +0 -5
- package/packages/cli/dist/transformers/json-schema/types/any-other-attribute.d.ts.map +0 -1
- package/packages/cli/dist/transformers/json-schema/types/index.d.ts +0 -3
- package/packages/cli/dist/transformers/json-schema/types/index.d.ts.map +0 -1
- package/packages/cli/dist/transformers/json-schema/types/mixed-schema-object.d.ts +0 -7
- package/packages/cli/dist/transformers/json-schema/types/mixed-schema-object.d.ts.map +0 -1
- package/packages/cli/dist/transformers/operation-definition/comment.renderer.d.ts +0 -8
- package/packages/cli/dist/transformers/operation-definition/comment.renderer.d.ts.map +0 -1
- package/packages/cli/dist/transformers/operation-definition/declaration.renderer.d.ts +0 -20
- package/packages/cli/dist/transformers/operation-definition/declaration.renderer.d.ts.map +0 -1
- package/packages/cli/dist/transformers/operation-definition/index.d.ts +0 -3
- package/packages/cli/dist/transformers/operation-definition/index.d.ts.map +0 -1
- package/packages/cli/dist/transformers/operation-definition/micro-function.renderer.d.ts +0 -19
- package/packages/cli/dist/transformers/operation-definition/micro-function.renderer.d.ts.map +0 -1
- package/packages/cli/dist/transformers/operation-definition/nestjs-method.renderer.d.ts +0 -15
- package/packages/cli/dist/transformers/operation-definition/nestjs-method.renderer.d.ts.map +0 -1
- package/packages/cli/dist/transformers/operation-definition/operation-definition.transformer.d.ts +0 -11
- package/packages/cli/dist/transformers/operation-definition/operation-definition.transformer.d.ts.map +0 -1
- package/packages/cli/dist/transformers/operation-definition/typescript-snippet.d.ts +0 -22
- package/packages/cli/dist/transformers/operation-definition/typescript-snippet.d.ts.map +0 -1
- package/packages/cli/dist/transformers/operation-definition/utils/index.d.ts +0 -2
- package/packages/cli/dist/transformers/operation-definition/utils/index.d.ts.map +0 -1
- package/packages/cli/dist/transformers/operation-definition/utils/type-name-factory.d.ts +0 -4
- package/packages/cli/dist/transformers/operation-definition/utils/type-name-factory.d.ts.map +0 -1
- package/packages/cli/dist/transformers/schema-definition/index.d.ts +0 -2
- package/packages/cli/dist/transformers/schema-definition/index.d.ts.map +0 -1
- package/packages/cli/dist/transformers/schema-definition/schema-definition.transformer.d.ts +0 -10
- package/packages/cli/dist/transformers/schema-definition/schema-definition.transformer.d.ts.map +0 -1
- package/packages/cli/dist/transformers/types/renderer.d.ts +0 -4
- package/packages/cli/dist/transformers/types/renderer.d.ts.map +0 -1
- package/packages/cli/dist/types/address.d.ts +0 -8
- package/packages/cli/dist/types/address.d.ts.map +0 -1
- package/packages/cli/dist/types/build-cli-options.d.ts +0 -19
- package/packages/cli/dist/types/build-cli-options.d.ts.map +0 -1
- package/packages/cli/dist/types/generator.d.ts +0 -7
- package/packages/cli/dist/types/generator.d.ts.map +0 -1
- package/packages/cli/dist/types/index.d.ts +0 -7
- package/packages/cli/dist/types/index.d.ts.map +0 -1
- package/packages/cli/dist/types/plugin.d.ts +0 -5
- package/packages/cli/dist/types/plugin.d.ts.map +0 -1
- package/packages/cli/dist/types/runtime-config.d.ts +0 -41
- package/packages/cli/dist/types/runtime-config.d.ts.map +0 -1
- package/packages/cli/dist/types/to-code-options.d.ts +0 -4
- package/packages/cli/dist/types/to-code-options.d.ts.map +0 -1
- package/packages/cli/dist/utils/debugger.d.ts +0 -7
- package/packages/cli/dist/utils/debugger.d.ts.map +0 -1
- package/packages/cli/dist/utils/ignore-matcher.d.ts +0 -18
- package/packages/cli/dist/utils/ignore-matcher.d.ts.map +0 -1
- package/packages/cli/dist/utils/indent.d.ts +0 -2
- package/packages/cli/dist/utils/indent.d.ts.map +0 -1
- package/packages/cli/dist/utils/is-keywords.d.ts +0 -2
- package/packages/cli/dist/utils/is-keywords.d.ts.map +0 -1
- package/packages/cli/dist/utils/is-reserved-word.d.ts +0 -2
- package/packages/cli/dist/utils/is-reserved-word.d.ts.map +0 -1
- package/packages/cli/dist/utils/is-valid-url.d.ts +0 -16
- package/packages/cli/dist/utils/is-valid-url.d.ts.map +0 -1
- package/packages/cli/dist/utils/json-schema-utils/index.d.ts +0 -11
- package/packages/cli/dist/utils/json-schema-utils/index.d.ts.map +0 -1
- package/packages/cli/dist/utils/json-schema-utils/is-array.d.ts +0 -3
- package/packages/cli/dist/utils/json-schema-utils/is-array.d.ts.map +0 -1
- package/packages/cli/dist/utils/json-schema-utils/is-mixed.d.ts +0 -4
- package/packages/cli/dist/utils/json-schema-utils/is-mixed.d.ts.map +0 -1
- package/packages/cli/dist/utils/json-schema-utils/is-non-array.d.ts +0 -3
- package/packages/cli/dist/utils/json-schema-utils/is-non-array.d.ts.map +0 -1
- package/packages/cli/dist/utils/json-schema-utils/is-ref.d.ts +0 -3
- package/packages/cli/dist/utils/json-schema-utils/is-ref.d.ts.map +0 -1
- package/packages/cli/dist/utils/json-schema-utils/types/any-other-attribute.d.ts +0 -5
- package/packages/cli/dist/utils/json-schema-utils/types/any-other-attribute.d.ts.map +0 -1
- package/packages/cli/dist/utils/json-schema-utils/types/mixed-schema-object.d.ts +0 -7
- package/packages/cli/dist/utils/json-schema-utils/types/mixed-schema-object.d.ts.map +0 -1
- package/packages/cli/dist/utils/logger.d.ts +0 -6
- package/packages/cli/dist/utils/logger.d.ts.map +0 -1
- package/packages/cli/dist/utils/openapi-utils/dereference-deep.d.ts +0 -3
- package/packages/cli/dist/utils/openapi-utils/dereference-deep.d.ts.map +0 -1
- package/packages/cli/dist/utils/openapi-utils/dereference-operation.d.ts +0 -4
- package/packages/cli/dist/utils/openapi-utils/dereference-operation.d.ts.map +0 -1
- package/packages/cli/dist/utils/openapi-utils/dereference.d.ts +0 -3
- package/packages/cli/dist/utils/openapi-utils/dereference.d.ts.map +0 -1
- package/packages/cli/dist/utils/openapi-utils/index.d.ts +0 -19
- package/packages/cli/dist/utils/openapi-utils/index.d.ts.map +0 -1
- package/packages/cli/dist/utils/openapi-utils/is-ref-defined.d.ts +0 -3
- package/packages/cli/dist/utils/openapi-utils/is-ref-defined.d.ts.map +0 -1
- package/packages/cli/dist/utils/openapi-utils/map-operation.d.ts +0 -4
- package/packages/cli/dist/utils/openapi-utils/map-operation.d.ts.map +0 -1
- package/packages/cli/dist/utils/openapi-utils/map-parameter.d.ts +0 -4
- package/packages/cli/dist/utils/openapi-utils/map-parameter.d.ts.map +0 -1
- package/packages/cli/dist/utils/openapi-utils/remove-undefined-ref.d.ts +0 -3
- package/packages/cli/dist/utils/openapi-utils/remove-undefined-ref.d.ts.map +0 -1
- package/packages/cli/dist/utils/openapi-utils/to-3_1.d.ts +0 -3
- package/packages/cli/dist/utils/openapi-utils/to-3_1.d.ts.map +0 -1
- package/packages/exception/dist/catch-exception.d.ts +0 -4
- package/packages/exception/dist/catch-exception.d.ts.map +0 -1
- package/packages/exception/dist/plugins/index.d.mts +0 -12
- package/packages/exception/dist/plugins/index.d.ts +0 -12
- package/packages/exception/dist/plugins/index.js +0 -95
- package/packages/exception/dist/plugins/index.mjs +0 -68
- package/packages/exception/dist/throw-exception.d.ts +0 -5
- package/packages/exception/dist/throw-exception.d.ts.map +0 -1
- package/packages/exception/dist/validate-status-code.d.ts +0 -3
- package/packages/exception/dist/validate-status-code.d.ts.map +0 -1
- package/packages/exception/node_modules/.bin/keq +0 -21
- package/packages/keq/dist/context/execution-context.d.ts +0 -26
- package/packages/keq/dist/context/execution-context.d.ts.map +0 -1
- package/packages/keq/dist/context/index.d.ts +0 -5
- package/packages/keq/dist/context/index.d.ts.map +0 -1
- package/packages/keq/dist/context/middleware-context.d.ts +0 -11
- package/packages/keq/dist/context/middleware-context.d.ts.map +0 -1
- package/packages/keq/dist/context/orchestrator-context.d.ts +0 -18
- package/packages/keq/dist/context/orchestrator-context.d.ts.map +0 -1
- package/packages/keq/dist/context/shared-context.d.ts +0 -43
- package/packages/keq/dist/context/shared-context.d.ts.map +0 -1
- package/packages/keq/dist/context/types/index.d.ts +0 -6
- package/packages/keq/dist/context/types/index.d.ts.map +0 -1
- package/packages/keq/dist/context/types/keq-context-data.d.ts +0 -7
- package/packages/keq/dist/context/types/keq-context-data.d.ts.map +0 -1
- package/packages/keq/dist/context/types/keq-context-emitter.d.ts +0 -35
- package/packages/keq/dist/context/types/keq-context-emitter.d.ts.map +0 -1
- package/packages/keq/dist/context/types/keq-context-options/index.d.ts +0 -6
- package/packages/keq/dist/context/types/keq-context-options/index.d.ts.map +0 -1
- package/packages/keq/dist/context/types/keq-context-options/keq-context-options.d.ts +0 -5
- package/packages/keq/dist/context/types/keq-context-options/keq-context-options.d.ts.map +0 -1
- package/packages/keq/dist/context/types/keq-context-options/keq-middleware-options.d.ts +0 -33
- package/packages/keq/dist/context/types/keq-context-options/keq-middleware-options.d.ts.map +0 -1
- package/packages/keq/dist/context/types/keq-context-options/keq-module-options.d.ts +0 -5
- package/packages/keq/dist/context/types/keq-context-options/keq-module-options.d.ts.map +0 -1
- package/packages/keq/dist/context/types/keq-context-options/keq-resolve-with-mode.d.ts +0 -2
- package/packages/keq/dist/context/types/keq-context-options/keq-resolve-with-mode.d.ts.map +0 -1
- package/packages/keq/dist/context/types/keq-context-options/keq-retry-options.d.ts +0 -9
- package/packages/keq/dist/context/types/keq-context-options/keq-retry-options.d.ts.map +0 -1
- package/packages/keq/dist/context/types/keq-context.d.ts +0 -17
- package/packages/keq/dist/context/types/keq-context.d.ts.map +0 -1
- package/packages/keq/dist/context/types/keq-global.d.ts +0 -12
- package/packages/keq/dist/context/types/keq-global.d.ts.map +0 -1
- package/packages/keq/dist/context/utils/assign-shared-context.d.ts +0 -3
- package/packages/keq/dist/context/utils/assign-shared-context.d.ts.map +0 -1
- package/packages/keq/dist/context/utils/clone-shared-context.d.ts +0 -3
- package/packages/keq/dist/context/utils/clone-shared-context.d.ts.map +0 -1
- package/packages/keq/dist/context/utils/create-proxy-response.d.ts +0 -2
- package/packages/keq/dist/context/utils/create-proxy-response.d.ts.map +0 -1
- package/packages/keq/dist/context/utils/fork.d.ts +0 -6
- package/packages/keq/dist/context/utils/fork.d.ts.map +0 -1
- package/packages/keq/dist/context/utils/index.d.ts +0 -5
- package/packages/keq/dist/context/utils/index.d.ts.map +0 -1
- package/packages/keq/dist/context/utils/watch-object.d.ts +0 -5
- package/packages/keq/dist/context/utils/watch-object.d.ts.map +0 -1
- package/packages/keq/dist/exception/abort.exception.d.ts +0 -4
- package/packages/keq/dist/exception/abort.exception.d.ts.map +0 -1
- package/packages/keq/dist/exception/exception.d.ts +0 -5
- package/packages/keq/dist/exception/exception.d.ts.map +0 -1
- package/packages/keq/dist/exception/http-exceptions/bad-gateway.exception.d.ts +0 -5
- package/packages/keq/dist/exception/http-exceptions/bad-gateway.exception.d.ts.map +0 -1
- package/packages/keq/dist/exception/http-exceptions/bad-request.exception.d.ts +0 -5
- package/packages/keq/dist/exception/http-exceptions/bad-request.exception.d.ts.map +0 -1
- package/packages/keq/dist/exception/http-exceptions/conflict.exception.d.ts +0 -5
- package/packages/keq/dist/exception/http-exceptions/conflict.exception.d.ts.map +0 -1
- package/packages/keq/dist/exception/http-exceptions/content-too-large.exception.d.ts +0 -5
- package/packages/keq/dist/exception/http-exceptions/content-too-large.exception.d.ts.map +0 -1
- package/packages/keq/dist/exception/http-exceptions/forbidden.exception.d.ts +0 -5
- package/packages/keq/dist/exception/http-exceptions/forbidden.exception.d.ts.map +0 -1
- package/packages/keq/dist/exception/http-exceptions/gateway-timeout.exception.d.ts +0 -5
- package/packages/keq/dist/exception/http-exceptions/gateway-timeout.exception.d.ts.map +0 -1
- package/packages/keq/dist/exception/http-exceptions/http-version-not-supported.exception.d.ts +0 -5
- package/packages/keq/dist/exception/http-exceptions/http-version-not-supported.exception.d.ts.map +0 -1
- package/packages/keq/dist/exception/http-exceptions/im-a-teapot.exception.d.ts +0 -5
- package/packages/keq/dist/exception/http-exceptions/im-a-teapot.exception.d.ts.map +0 -1
- package/packages/keq/dist/exception/http-exceptions/index.d.ts +0 -22
- package/packages/keq/dist/exception/http-exceptions/index.d.ts.map +0 -1
- package/packages/keq/dist/exception/http-exceptions/internal-server-error.exception.d.ts +0 -5
- package/packages/keq/dist/exception/http-exceptions/internal-server-error.exception.d.ts.map +0 -1
- package/packages/keq/dist/exception/http-exceptions/method-not-allowed.exception.d.ts +0 -5
- package/packages/keq/dist/exception/http-exceptions/method-not-allowed.exception.d.ts.map +0 -1
- package/packages/keq/dist/exception/http-exceptions/not-acceptable.exception.d.ts +0 -5
- package/packages/keq/dist/exception/http-exceptions/not-acceptable.exception.d.ts.map +0 -1
- package/packages/keq/dist/exception/http-exceptions/not-founded.exception.d.ts +0 -5
- package/packages/keq/dist/exception/http-exceptions/not-founded.exception.d.ts.map +0 -1
- package/packages/keq/dist/exception/http-exceptions/not-implemented.exception.d.ts +0 -5
- package/packages/keq/dist/exception/http-exceptions/not-implemented.exception.d.ts.map +0 -1
- package/packages/keq/dist/exception/http-exceptions/precondition-failed.exception.d.ts +0 -5
- package/packages/keq/dist/exception/http-exceptions/precondition-failed.exception.d.ts.map +0 -1
- package/packages/keq/dist/exception/http-exceptions/proxy-authentication-required.exception.d.ts +0 -5
- package/packages/keq/dist/exception/http-exceptions/proxy-authentication-required.exception.d.ts.map +0 -1
- package/packages/keq/dist/exception/http-exceptions/request-timeout.exception.d.ts +0 -5
- package/packages/keq/dist/exception/http-exceptions/request-timeout.exception.d.ts.map +0 -1
- package/packages/keq/dist/exception/http-exceptions/request.exception.d.ts +0 -12
- package/packages/keq/dist/exception/http-exceptions/request.exception.d.ts.map +0 -1
- package/packages/keq/dist/exception/http-exceptions/service-unavailable.exception.d.ts +0 -5
- package/packages/keq/dist/exception/http-exceptions/service-unavailable.exception.d.ts.map +0 -1
- package/packages/keq/dist/exception/http-exceptions/too-many-requests.exception.d.ts +0 -5
- package/packages/keq/dist/exception/http-exceptions/too-many-requests.exception.d.ts.map +0 -1
- package/packages/keq/dist/exception/http-exceptions/unauthorized.exception.d.ts +0 -5
- package/packages/keq/dist/exception/http-exceptions/unauthorized.exception.d.ts.map +0 -1
- package/packages/keq/dist/exception/http-exceptions/unsupported-media-type.exception.d.ts +0 -5
- package/packages/keq/dist/exception/http-exceptions/unsupported-media-type.exception.d.ts.map +0 -1
- package/packages/keq/dist/exception/http-exceptions/uri-too-long.exception.d.ts +0 -5
- package/packages/keq/dist/exception/http-exceptions/uri-too-long.exception.d.ts.map +0 -1
- package/packages/keq/dist/exception/index.d.ts +0 -6
- package/packages/keq/dist/exception/index.d.ts.map +0 -1
- package/packages/keq/dist/exception/timeout.exception.d.ts +0 -5
- package/packages/keq/dist/exception/timeout.exception.d.ts.map +0 -1
- package/packages/keq/dist/exception/type.exception.d.ts +0 -5
- package/packages/keq/dist/exception/type.exception.d.ts.map +0 -1
- package/packages/keq/dist/middleware/index.d.ts +0 -3
- package/packages/keq/dist/middleware/index.d.ts.map +0 -1
- package/packages/keq/dist/middleware/types/index.d.ts +0 -3
- package/packages/keq/dist/middleware/types/index.d.ts.map +0 -1
- package/packages/keq/dist/middleware/types/keq-middleware.d.ts +0 -8
- package/packages/keq/dist/middleware/types/keq-middleware.d.ts.map +0 -1
- package/packages/keq/dist/middleware/types/keq-next.d.ts +0 -2
- package/packages/keq/dist/middleware/types/keq-next.d.ts.map +0 -1
- package/packages/keq/dist/middleware/utils/compose-middleware.d.ts +0 -7
- package/packages/keq/dist/middleware/utils/compose-middleware.d.ts.map +0 -1
- package/packages/keq/dist/middleware/utils/get-middleware-name.d.ts +0 -3
- package/packages/keq/dist/middleware/utils/get-middleware-name.d.ts.map +0 -1
- package/packages/keq/dist/middleware/utils/index.d.ts +0 -3
- package/packages/keq/dist/middleware/utils/index.d.ts.map +0 -1
- package/packages/keq/dist/middlewares/fetch-middleware/index.d.ts +0 -6
- package/packages/keq/dist/middlewares/fetch-middleware/index.d.ts.map +0 -1
- package/packages/keq/dist/middlewares/flow-control-middleware/abort-flow-control-middleware.d.ts +0 -3
- package/packages/keq/dist/middlewares/flow-control-middleware/abort-flow-control-middleware.d.ts.map +0 -1
- package/packages/keq/dist/middlewares/flow-control-middleware/index.d.ts +0 -4
- package/packages/keq/dist/middlewares/flow-control-middleware/index.d.ts.map +0 -1
- package/packages/keq/dist/middlewares/flow-control-middleware/serial-flow-control-middleware.d.ts +0 -3
- package/packages/keq/dist/middlewares/flow-control-middleware/serial-flow-control-middleware.d.ts.map +0 -1
- package/packages/keq/dist/middlewares/flow-control-middleware/types/keq-flow-control.d.ts +0 -9
- package/packages/keq/dist/middlewares/flow-control-middleware/types/keq-flow-control.d.ts.map +0 -1
- package/packages/keq/dist/middlewares/index.d.ts +0 -4
- package/packages/keq/dist/middlewares/index.d.ts.map +0 -1
- package/packages/keq/dist/middlewares/timeout-middleware/index.d.ts +0 -6
- package/packages/keq/dist/middlewares/timeout-middleware/index.d.ts.map +0 -1
- package/packages/keq/dist/orchestrator/executor.d.ts +0 -13
- package/packages/keq/dist/orchestrator/executor.d.ts.map +0 -1
- package/packages/keq/dist/orchestrator/index.d.ts +0 -3
- package/packages/keq/dist/orchestrator/index.d.ts.map +0 -1
- package/packages/keq/dist/orchestrator/orchestrator.d.ts +0 -25
- package/packages/keq/dist/orchestrator/orchestrator.d.ts.map +0 -1
- package/packages/keq/dist/request/core.d.ts +0 -48
- package/packages/keq/dist/request/core.d.ts.map +0 -1
- package/packages/keq/dist/request/create-request.d.ts +0 -7
- package/packages/keq/dist/request/create-request.d.ts.map +0 -1
- package/packages/keq/dist/request/index.d.ts +0 -6
- package/packages/keq/dist/request/index.d.ts.map +0 -1
- package/packages/keq/dist/request/keq.d.ts +0 -120
- package/packages/keq/dist/request/keq.d.ts.map +0 -1
- package/packages/keq/dist/request/request.d.ts +0 -79
- package/packages/keq/dist/request/request.d.ts.map +0 -1
- package/packages/keq/dist/request/types/api-schema/api-schema-select.d.ts +0 -42
- package/packages/keq/dist/request/types/api-schema/api-schema-select.d.ts.map +0 -1
- package/packages/keq/dist/request/types/api-schema/api-schema.d.ts +0 -8
- package/packages/keq/dist/request/types/api-schema/api-schema.d.ts.map +0 -1
- package/packages/keq/dist/request/types/api-schema/default-operation.d.ts +0 -18
- package/packages/keq/dist/request/types/api-schema/default-operation.d.ts.map +0 -1
- package/packages/keq/dist/request/types/api-schema/extract-method-operations.d.ts +0 -31
- package/packages/keq/dist/request/types/api-schema/extract-method-operations.d.ts.map +0 -1
- package/packages/keq/dist/request/types/api-schema/index.d.ts +0 -6
- package/packages/keq/dist/request/types/api-schema/index.d.ts.map +0 -1
- package/packages/keq/dist/request/types/api-schema/operation.d.ts +0 -17
- package/packages/keq/dist/request/types/api-schema/operation.d.ts.map +0 -1
- package/packages/keq/dist/request/types/content-type.d.ts +0 -3
- package/packages/keq/dist/request/types/content-type.d.ts.map +0 -1
- package/packages/keq/dist/request/types/index.d.ts +0 -8
- package/packages/keq/dist/request/types/index.d.ts.map +0 -1
- package/packages/keq/dist/request/types/keq-attachable-file.d.ts +0 -2
- package/packages/keq/dist/request/types/keq-attachable-file.d.ts.map +0 -1
- package/packages/keq/dist/request/types/keq-param-value.d.ts +0 -3
- package/packages/keq/dist/request/types/keq-param-value.d.ts.map +0 -1
- package/packages/keq/dist/request/types/keq-query-options.d.ts +0 -7
- package/packages/keq/dist/request/types/keq-query-options.d.ts.map +0 -1
- package/packages/keq/dist/request/types/keq-query-value.d.ts +0 -8
- package/packages/keq/dist/request/types/keq-query-value.d.ts.map +0 -1
- package/packages/keq/dist/request/types/server-sent-event.d.ts +0 -3
- package/packages/keq/dist/request/types/server-sent-event.d.ts.map +0 -1
- package/packages/keq/dist/request/utils/fix-content-type.d.ts +0 -4
- package/packages/keq/dist/request/utils/fix-content-type.d.ts.map +0 -1
- package/packages/keq/dist/request/utils/get-location-id.d.ts +0 -2
- package/packages/keq/dist/request/utils/get-location-id.d.ts.map +0 -1
- package/packages/keq/dist/request/utils/index.d.ts +0 -7
- package/packages/keq/dist/request/utils/index.d.ts.map +0 -1
- package/packages/keq/dist/request/utils/intelligent-parse-response.d.ts +0 -2
- package/packages/keq/dist/request/utils/intelligent-parse-response.d.ts.map +0 -1
- package/packages/keq/dist/request/utils/merge-keq-request-body.d.ts +0 -3
- package/packages/keq/dist/request/utils/merge-keq-request-body.d.ts.map +0 -1
- package/packages/keq/dist/request/utils/query-stringify.d.ts +0 -3
- package/packages/keq/dist/request/utils/query-stringify.d.ts.map +0 -1
- package/packages/keq/dist/request/utils/resolve-with.d.ts +0 -3
- package/packages/keq/dist/request/utils/resolve-with.d.ts.map +0 -1
- package/packages/keq/dist/request-init/index.d.ts +0 -4
- package/packages/keq/dist/request-init/index.d.ts.map +0 -1
- package/packages/keq/dist/request-init/request-init.d.ts +0 -42
- package/packages/keq/dist/request-init/request-init.d.ts.map +0 -1
- package/packages/keq/dist/request-init/types/index.d.ts +0 -3
- package/packages/keq/dist/request-init/types/index.d.ts.map +0 -1
- package/packages/keq/dist/request-init/types/keq-body-init.d.ts +0 -2
- package/packages/keq/dist/request-init/types/keq-body-init.d.ts.map +0 -1
- package/packages/keq/dist/request-init/types/keq-request-method.d.ts +0 -2
- package/packages/keq/dist/request-init/types/keq-request-method.d.ts.map +0 -1
- package/packages/keq/dist/request-init/utils/assign-request-init.d.ts +0 -3
- package/packages/keq/dist/request-init/utils/assign-request-init.d.ts.map +0 -1
- package/packages/keq/dist/request-init/utils/clone-body.d.ts +0 -2
- package/packages/keq/dist/request-init/utils/clone-body.d.ts.map +0 -1
- package/packages/keq/dist/request-init/utils/clone-headers.d.ts +0 -2
- package/packages/keq/dist/request-init/utils/clone-headers.d.ts.map +0 -1
- package/packages/keq/dist/request-init/utils/clone-request-init.d.ts +0 -3
- package/packages/keq/dist/request-init/utils/clone-request-init.d.ts.map +0 -1
- package/packages/keq/dist/request-init/utils/compile-url.d.ts +0 -3
- package/packages/keq/dist/request-init/utils/compile-url.d.ts.map +0 -1
- package/packages/keq/dist/request-init/utils/index.d.ts +0 -7
- package/packages/keq/dist/request-init/utils/index.d.ts.map +0 -1
- package/packages/keq/dist/request-init/utils/to-form-data.d.ts +0 -2
- package/packages/keq/dist/request-init/utils/to-form-data.d.ts.map +0 -1
- package/packages/keq/dist/request-init/utils/to-url-search-params.d.ts +0 -2
- package/packages/keq/dist/request-init/utils/to-url-search-params.d.ts.map +0 -1
- package/packages/keq/dist/router/index.d.ts +0 -4
- package/packages/keq/dist/router/index.d.ts.map +0 -1
- package/packages/keq/dist/router/keq-host-route.d.ts +0 -3
- package/packages/keq/dist/router/keq-host-route.d.ts.map +0 -1
- package/packages/keq/dist/router/keq-location-route.d.ts +0 -3
- package/packages/keq/dist/router/keq-location-route.d.ts.map +0 -1
- package/packages/keq/dist/router/keq-method-route.d.ts +0 -3
- package/packages/keq/dist/router/keq-method-route.d.ts.map +0 -1
- package/packages/keq/dist/router/keq-module-route.d.ts +0 -3
- package/packages/keq/dist/router/keq-module-route.d.ts.map +0 -1
- package/packages/keq/dist/router/keq-pathname-route.d.ts +0 -3
- package/packages/keq/dist/router/keq-pathname-route.d.ts.map +0 -1
- package/packages/keq/dist/router/keq-router.d.ts +0 -32
- package/packages/keq/dist/router/keq-router.d.ts.map +0 -1
- package/packages/keq/dist/router/types/index.d.ts +0 -2
- package/packages/keq/dist/router/types/index.d.ts.map +0 -1
- package/packages/keq/dist/router/types/keq-route.d.ts +0 -7
- package/packages/keq/dist/router/types/keq-route.d.ts.map +0 -1
- package/packages/keq/dist/router/utils/compose-route.d.ts +0 -3
- package/packages/keq/dist/router/utils/compose-route.d.ts.map +0 -1
- package/packages/keq/dist/router/utils/index.d.ts +0 -2
- package/packages/keq/dist/router/utils/index.d.ts.map +0 -1
- package/packages/keq/dist/types/enabled-if-string-index.d.ts +0 -24
- package/packages/keq/dist/types/enabled-if-string-index.d.ts.map +0 -1
- package/packages/keq/dist/types/exclude-unknown-properties.d.ts +0 -19
- package/packages/keq/dist/types/exclude-unknown-properties.d.ts.map +0 -1
- package/packages/keq/dist/types/index-keys.d.ts +0 -18
- package/packages/keq/dist/types/index-keys.d.ts.map +0 -1
- package/packages/keq/dist/types/index.d.ts +0 -7
- package/packages/keq/dist/types/index.d.ts.map +0 -1
- package/packages/keq/dist/types/literal-keys.d.ts +0 -18
- package/packages/keq/dist/types/literal-keys.d.ts.map +0 -1
- package/packages/keq/dist/types/loose-nested-like.d.ts +0 -11
- package/packages/keq/dist/types/loose-nested-like.d.ts.map +0 -1
- package/packages/keq/dist/types/string-index-value-of.d.ts +0 -18
- package/packages/keq/dist/types/string-index-value-of.d.ts.map +0 -1
- package/packages/keq/dist/utils/base64.d.ts +0 -3
- package/packages/keq/dist/utils/base64.d.ts.map +0 -1
- package/packages/keq/dist/utils/index.d.ts +0 -4
- package/packages/keq/dist/utils/index.d.ts.map +0 -1
- package/packages/keq/dist/utils/shallow-clone.d.ts +0 -5
- package/packages/keq/dist/utils/shallow-clone.d.ts.map +0 -1
- package/packages/keq/dist/utils/sleep.d.ts +0 -2
- package/packages/keq/dist/utils/sleep.d.ts.map +0 -1
- package/packages/keq/dist/validator/index.d.ts +0 -2
- package/packages/keq/dist/validator/index.d.ts.map +0 -1
- package/packages/keq/dist/validator/validator.d.ts +0 -65
- package/packages/keq/dist/validator/validator.d.ts.map +0 -1
- package/packages/nestjs/dist/keq.module-definition.d.ts +0 -3
- package/packages/nestjs/dist/keq.module-definition.d.ts.map +0 -1
- package/packages/nestjs/dist/keq.module.d.ts +0 -7
- package/packages/nestjs/dist/keq.module.d.ts.map +0 -1
- package/packages/nestjs/dist/types/index.d.ts +0 -2
- package/packages/nestjs/dist/types/index.d.ts.map +0 -1
- package/packages/nestjs/dist/types/keq-module-options.d.ts +0 -5
- package/packages/nestjs/dist/types/keq-module-options.d.ts.map +0 -1
|
@@ -1,2438 +1,36 @@
|
|
|
1
|
-
"
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
DownloadLocalFilePlugin: () => DownloadLocalFilePlugin,
|
|
38
|
-
EslintPlugin: () => EslintPlugin,
|
|
39
|
-
GenerateDeclarationPlugin: () => GenerateDeclarationPlugin,
|
|
40
|
-
GenerateMicroFunctionPlugin: () => GenerateMicroFunctionPlugin,
|
|
41
|
-
GenerateNestjsModulePlugin: () => GenerateNestjsModulePlugin,
|
|
42
|
-
InitializePlugin: () => InitializePlugin,
|
|
43
|
-
MICRO_FUNCTION_GENERATOR: () => MICRO_FUNCTION_GENERATOR,
|
|
44
|
-
MICRO_FUNCTION_REQUEST_GENERATOR: () => MICRO_FUNCTION_REQUEST_GENERATOR,
|
|
45
|
-
MicroFunctionGenerator: () => MicroFunctionGenerator,
|
|
46
|
-
NestjsModuleGenerator: () => NestjsModuleGenerator,
|
|
47
|
-
OPERATION_GENERATOR: () => OPERATION_GENERATOR,
|
|
48
|
-
OperationDeclarationGenerator: () => OperationDeclarationGenerator,
|
|
49
|
-
OverwriteOperationIdPlugin: () => OverwriteOperationIdPlugin,
|
|
50
|
-
OverwriteQueryOptionsPlugin: () => OverwriteQueryOptionsPlugin,
|
|
51
|
-
PrettierPlugin: () => PrettierPlugin,
|
|
52
|
-
RequestGenerator: () => RequestGenerator,
|
|
53
|
-
SCHEMA_GENERATOR: () => SCHEMA_GENERATOR,
|
|
54
|
-
SchemaDeclarationGenerator: () => SchemaDeclarationGenerator,
|
|
55
|
-
ShakingPlugin: () => ShakingPlugin,
|
|
56
|
-
TerminalSelectPlugin: () => TerminalSelectPlugin
|
|
57
|
-
});
|
|
58
|
-
module.exports = __toCommonJS(plugins_exports);
|
|
59
|
-
|
|
60
|
-
// src/plugins/eslint/index.ts
|
|
61
|
-
var import_eslint = require("eslint");
|
|
62
|
-
var EslintPlugin = class _EslintPlugin {
|
|
63
|
-
constructor(options = {}) {
|
|
64
|
-
this.options = options;
|
|
65
|
-
}
|
|
66
|
-
apply(compiler) {
|
|
67
|
-
if (!compiler.options.build) return;
|
|
68
|
-
if (this.options.disable && this.options.disable.length > 0) {
|
|
69
|
-
const $rules = [
|
|
70
|
-
...this.options.disable.map((rule) => `/* eslint-disable ${rule} */`)
|
|
71
|
-
].join("\n");
|
|
72
|
-
compiler.hooks.afterCompile.tap(_EslintPlugin.name, () => {
|
|
73
|
-
const artifacts = compiler.context.artifacts || [];
|
|
74
|
-
for (const artifact of artifacts) {
|
|
75
|
-
artifact.anchor.append("file:start", $rules);
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
compiler.hooks.afterPersist.tapPromise(_EslintPlugin.name, async (task) => {
|
|
80
|
-
const files = compiler.context.assets || [];
|
|
81
|
-
if (files.length === 0) return;
|
|
82
|
-
const eslint = new import_eslint.ESLint({ fix: true });
|
|
83
|
-
const results = await eslint.lintFiles(files.map((file) => file.path));
|
|
84
|
-
await import_eslint.ESLint.outputFixes(results);
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
// src/plugins/prettier/prettier.plugin.ts
|
|
90
|
-
var import_child_process = require("child_process");
|
|
91
|
-
var import_util = require("util");
|
|
92
|
-
var execAsync = (0, import_util.promisify)(import_child_process.exec);
|
|
93
|
-
var PrettierPlugin = class _PrettierPlugin {
|
|
94
|
-
apply(compiler) {
|
|
95
|
-
if (!compiler.options.build) return;
|
|
96
|
-
compiler.hooks.afterPersist.tapPromise(_PrettierPlugin.name, async () => {
|
|
97
|
-
const files = compiler.context.assets || [];
|
|
98
|
-
if (files.length === 0) return;
|
|
99
|
-
const filePaths = files.map((file) => file.path).join(" ");
|
|
100
|
-
await execAsync(`prettier --write ${filePaths}`);
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
// src/plugins/body-fallback/index.ts
|
|
106
|
-
var R19 = __toESM(require("ramda"), 1);
|
|
107
|
-
|
|
108
|
-
// src/utils/json-schema-utils/is-array.ts
|
|
109
|
-
function isArray(schema) {
|
|
110
|
-
return schema.type === "array";
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
// src/utils/json-schema-utils/is-mixed.ts
|
|
114
|
-
function isMixed(schema) {
|
|
115
|
-
return Array.isArray(schema.type);
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
// src/utils/json-schema-utils/is-non-array.ts
|
|
119
|
-
function isNonArray(schema) {
|
|
120
|
-
return typeof schema.type === "string" && schema.type !== "array";
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
// src/utils/json-schema-utils/is-ref.ts
|
|
124
|
-
function isRef(schema) {
|
|
125
|
-
return "$ref" in schema;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
// src/utils/json-schema-utils/index.ts
|
|
129
|
-
var JsonSchemaUtils = class {
|
|
130
|
-
static isRef = isRef;
|
|
131
|
-
static isArray = isArray;
|
|
132
|
-
static isNonArray = isNonArray;
|
|
133
|
-
static isMixed = isMixed;
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
// src/plugins/generate-micro-function/generate-micro-function.plugin.ts
|
|
137
|
-
var import_tapable2 = require("tapable");
|
|
138
|
-
|
|
139
|
-
// src/plugins/generate-micro-function/constants/metadata-storage.ts
|
|
140
|
-
var MetadataStorage = /* @__PURE__ */ new WeakMap();
|
|
141
|
-
|
|
142
|
-
// src/plugins/generate-micro-function/generators/micro_function/micro-function.generator.ts
|
|
143
|
-
var R18 = __toESM(require("ramda"), 1);
|
|
144
|
-
var path7 = __toESM(require("path"), 1);
|
|
145
|
-
var changeCase6 = __toESM(require("change-case"), 1);
|
|
146
|
-
|
|
147
|
-
// src/models/artifact.ts
|
|
148
|
-
var path = __toESM(require("path"), 1);
|
|
149
|
-
|
|
150
|
-
// src/models/anchor.ts
|
|
151
|
-
var AnchorBlock = class {
|
|
152
|
-
constructor(artifact) {
|
|
153
|
-
this.artifact = artifact;
|
|
154
|
-
}
|
|
155
|
-
/**
|
|
156
|
-
* Append content to the end of the anchor block.
|
|
157
|
-
*/
|
|
158
|
-
append(anchorName, content) {
|
|
159
|
-
const lines = this.artifact.content.split("\n");
|
|
160
|
-
const anchor = `@anchor:${anchorName}:end`;
|
|
161
|
-
const anchorIndex = lines.findIndex((line) => line.includes(`/* ${anchor} */`));
|
|
162
|
-
if (anchorIndex === -1) {
|
|
163
|
-
throw new Error(`"${anchor}" not found in artifact "${this.artifact.filepath}".`);
|
|
164
|
-
}
|
|
165
|
-
lines.splice(anchorIndex, 0, content);
|
|
166
|
-
this.artifact.content = lines.join("\n");
|
|
167
|
-
}
|
|
168
|
-
prepend(anchorName, content) {
|
|
169
|
-
const lines = this.artifact.content.split("\n");
|
|
170
|
-
const anchor = `@anchor:${anchorName}:start`;
|
|
171
|
-
const anchorIndex = lines.findIndex((line) => line.includes(`/* ${anchor} */`));
|
|
172
|
-
if (anchorIndex === -1) {
|
|
173
|
-
throw new Error(`"${anchor}" not found in artifact "${this.artifact.filepath}".`);
|
|
174
|
-
}
|
|
175
|
-
lines.splice(anchorIndex + 1, 0, content);
|
|
176
|
-
this.artifact.content = lines.join("\n");
|
|
177
|
-
}
|
|
178
|
-
replace(anchorName, content) {
|
|
179
|
-
const lines = this.artifact.content.split("\n");
|
|
180
|
-
const startIndex = lines.findIndex((line) => line.includes(`/* @anchor:${anchorName}:start */`));
|
|
181
|
-
const endIndex = lines.findIndex((line) => line.includes(`/* @anchor:${anchorName}:end */`));
|
|
182
|
-
if (startIndex === -1 || endIndex === -1 || endIndex <= startIndex) {
|
|
183
|
-
throw new Error(`"@anchor:${anchorName}:start" or "@anchor:${anchorName}:end" not found in artifact "${this.artifact.filepath}".`);
|
|
184
|
-
}
|
|
185
|
-
lines.splice(startIndex + 1, endIndex - startIndex - 1, content);
|
|
186
|
-
this.artifact.content = lines.join("\n");
|
|
187
|
-
}
|
|
188
|
-
};
|
|
189
|
-
var Anchor = class {
|
|
190
|
-
constructor(artifact) {
|
|
191
|
-
this.artifact = artifact;
|
|
192
|
-
this.block = new AnchorBlock(artifact);
|
|
193
|
-
}
|
|
194
|
-
block;
|
|
195
|
-
append(anchorName, content) {
|
|
196
|
-
const lines = this.artifact.content.split("\n");
|
|
197
|
-
const anchor = `@anchor:${anchorName}`;
|
|
198
|
-
const anchorIndex = lines.findIndex((line) => line.includes(`/* ${anchor} */`));
|
|
199
|
-
if (anchorIndex === -1) {
|
|
200
|
-
throw new Error(`"${anchor}" not found in artifact "${this.artifact.filepath}".`);
|
|
201
|
-
}
|
|
202
|
-
lines.splice(anchorIndex + 1, 0, content);
|
|
203
|
-
this.artifact.content = lines.join("\n");
|
|
204
|
-
}
|
|
205
|
-
prepend(anchorName, content) {
|
|
206
|
-
const lines = this.artifact.content.split("\n");
|
|
207
|
-
const anchor = `@anchor:${anchorName}`;
|
|
208
|
-
const anchorIndex = lines.findIndex((line) => line.includes(`/* ${anchor} */`));
|
|
209
|
-
if (anchorIndex === -1) {
|
|
210
|
-
throw new Error(`"${anchor}" not found in artifact "${this.artifact.filepath}".`);
|
|
211
|
-
}
|
|
212
|
-
lines.splice(anchorIndex, 0, content);
|
|
213
|
-
this.artifact.content = lines.join("\n");
|
|
214
|
-
}
|
|
215
|
-
};
|
|
216
|
-
|
|
217
|
-
// src/models/artifact.ts
|
|
218
|
-
var HeaderComment = [
|
|
219
|
-
"// Code generated by keq-cli. DO NOT EDIT.",
|
|
220
|
-
"// Code generated by keq-cli. DO NOT EDIT.",
|
|
221
|
-
"// Code generated by keq-cli. DO NOT EDIT.",
|
|
222
|
-
"",
|
|
223
|
-
""
|
|
224
|
-
].join("\n");
|
|
225
|
-
var Artifact = class {
|
|
226
|
-
id;
|
|
227
|
-
filepath;
|
|
228
|
-
content;
|
|
229
|
-
extensionName;
|
|
230
|
-
anchor = new Anchor(this);
|
|
231
|
-
constructor(options) {
|
|
232
|
-
this.id = options.id;
|
|
233
|
-
this.filepath = options.filepath;
|
|
234
|
-
this.extensionName = options.extensionName || path.extname(options.filepath);
|
|
235
|
-
this.content = options.content;
|
|
236
|
-
}
|
|
237
|
-
get dirname() {
|
|
238
|
-
return path.dirname(this.filepath);
|
|
239
|
-
}
|
|
240
|
-
renderer() {
|
|
241
|
-
return `${HeaderComment}${this.content}`;
|
|
242
|
-
}
|
|
243
|
-
};
|
|
244
|
-
|
|
245
|
-
// src/models/api-document_v3_1.ts
|
|
246
|
-
var R3 = __toESM(require("ramda"), 1);
|
|
247
|
-
|
|
248
|
-
// src/models/module-definition.ts
|
|
249
|
-
var ModuleDefinition = class _ModuleDefinition {
|
|
250
|
-
name;
|
|
251
|
-
address;
|
|
252
|
-
constructor(name, address) {
|
|
253
|
-
this.name = name;
|
|
254
|
-
if (typeof address === "string") {
|
|
255
|
-
this.address = { url: address, headers: {}, encoding: "utf8" };
|
|
256
|
-
} else {
|
|
257
|
-
this.address = address;
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
static unknown() {
|
|
261
|
-
return new _ModuleDefinition("", { url: "", headers: {}, encoding: "utf8" });
|
|
262
|
-
}
|
|
263
|
-
};
|
|
264
|
-
|
|
265
|
-
// src/constants/supported-methods.ts
|
|
266
|
-
var SupportedMethods = [
|
|
267
|
-
"get",
|
|
268
|
-
"post",
|
|
269
|
-
"put",
|
|
270
|
-
"delete",
|
|
271
|
-
"patch",
|
|
272
|
-
"head",
|
|
273
|
-
"options"
|
|
274
|
-
];
|
|
275
|
-
|
|
276
|
-
// src/models/operation-definition.ts
|
|
277
|
-
var R2 = __toESM(require("ramda"), 1);
|
|
278
|
-
|
|
279
|
-
// src/utils/is-keywords.ts
|
|
280
|
-
var keywords = [
|
|
281
|
-
"break",
|
|
282
|
-
"case",
|
|
283
|
-
"catch",
|
|
284
|
-
"continue",
|
|
285
|
-
"default",
|
|
286
|
-
"delete",
|
|
287
|
-
"do",
|
|
288
|
-
"else",
|
|
289
|
-
"finally",
|
|
290
|
-
"for",
|
|
291
|
-
"function",
|
|
292
|
-
"if",
|
|
293
|
-
"in",
|
|
294
|
-
"instanceof",
|
|
295
|
-
"new",
|
|
296
|
-
"return",
|
|
297
|
-
"switch",
|
|
298
|
-
"this",
|
|
299
|
-
"throw",
|
|
300
|
-
"try",
|
|
301
|
-
"typeof",
|
|
302
|
-
"var",
|
|
303
|
-
"void",
|
|
304
|
-
"while",
|
|
305
|
-
"with"
|
|
306
|
-
];
|
|
307
|
-
function isKeywords(str) {
|
|
308
|
-
return keywords.includes(str);
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
// src/utils/is-reserved-word.ts
|
|
312
|
-
var reservedWords = [
|
|
313
|
-
"abstract",
|
|
314
|
-
"boolean",
|
|
315
|
-
"byte",
|
|
316
|
-
"char",
|
|
317
|
-
"class",
|
|
318
|
-
"const",
|
|
319
|
-
"debugger",
|
|
320
|
-
"double",
|
|
321
|
-
"enum",
|
|
322
|
-
"export",
|
|
323
|
-
"extends",
|
|
324
|
-
"final",
|
|
325
|
-
"float",
|
|
326
|
-
"goto",
|
|
327
|
-
"implements",
|
|
328
|
-
"import",
|
|
329
|
-
"int",
|
|
330
|
-
"interface",
|
|
331
|
-
"long",
|
|
332
|
-
"native",
|
|
333
|
-
"package",
|
|
334
|
-
"private",
|
|
335
|
-
"protected",
|
|
336
|
-
"public",
|
|
337
|
-
"short",
|
|
338
|
-
"static",
|
|
339
|
-
"super",
|
|
340
|
-
"synchronized",
|
|
341
|
-
"throws",
|
|
342
|
-
"transient",
|
|
343
|
-
"volatile"
|
|
344
|
-
];
|
|
345
|
-
function isReservedWord(str) {
|
|
346
|
-
return reservedWords.includes(str);
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
// src/models/operation-definition.ts
|
|
350
|
-
var import_jsonpath_plus2 = require("jsonpath-plus");
|
|
351
|
-
|
|
352
|
-
// src/models/schema-definition.ts
|
|
353
|
-
var R = __toESM(require("ramda"), 1);
|
|
354
|
-
var import_jsonpath_plus = require("jsonpath-plus");
|
|
355
|
-
var SchemaDefinition = class _SchemaDefinition {
|
|
356
|
-
name;
|
|
357
|
-
schema;
|
|
358
|
-
module;
|
|
359
|
-
document;
|
|
360
|
-
get id() {
|
|
361
|
-
return `${this.module.address}#/components/schemas/${this.name}`;
|
|
362
|
-
}
|
|
363
|
-
constructor(args) {
|
|
364
|
-
this.module = args.module;
|
|
365
|
-
this.name = args.name;
|
|
366
|
-
this.schema = args.schema;
|
|
367
|
-
this.document = args.document;
|
|
368
|
-
}
|
|
369
|
-
getDependencies() {
|
|
370
|
-
const refs = R.uniq((0, import_jsonpath_plus.JSONPath)({
|
|
371
|
-
path: "$..*['$ref']",
|
|
372
|
-
json: this.schema
|
|
373
|
-
}));
|
|
374
|
-
return refs.filter((ref) => typeof ref === "string" && !!ref.trim()).map((ref) => {
|
|
375
|
-
const definition = this.document.dereference(ref);
|
|
376
|
-
if (definition) return definition;
|
|
377
|
-
return _SchemaDefinition.unknown();
|
|
378
|
-
});
|
|
379
|
-
}
|
|
380
|
-
static unknown() {
|
|
381
|
-
return new _SchemaDefinition({
|
|
382
|
-
name: "",
|
|
383
|
-
schema: {},
|
|
384
|
-
module: ModuleDefinition.unknown(),
|
|
385
|
-
document: ApiDocumentV3_1.unknown()
|
|
386
|
-
});
|
|
387
|
-
}
|
|
388
|
-
static isUnknown(definition) {
|
|
389
|
-
return definition.name === "";
|
|
390
|
-
}
|
|
391
|
-
};
|
|
392
|
-
|
|
393
|
-
// src/models/operation-definition.ts
|
|
394
|
-
var OperationDefinition = class {
|
|
395
|
-
module;
|
|
396
|
-
operationId;
|
|
397
|
-
method;
|
|
398
|
-
pathname;
|
|
399
|
-
operation;
|
|
400
|
-
document;
|
|
401
|
-
get id() {
|
|
402
|
-
return `${this.module.address}#/paths/${this.pathname}/${this.method}`;
|
|
403
|
-
}
|
|
404
|
-
constructor(args) {
|
|
405
|
-
this.module = args.module;
|
|
406
|
-
this.method = args.method.toLowerCase();
|
|
407
|
-
this.pathname = args.pathname;
|
|
408
|
-
this.document = args.document;
|
|
409
|
-
this.operationId = this.formatOperationId(args.method, args.pathname, args.operation);
|
|
410
|
-
this.operation = {
|
|
411
|
-
...args.operation,
|
|
412
|
-
operationId: this.operationId
|
|
413
|
-
};
|
|
414
|
-
}
|
|
415
|
-
formatOperationId(method, pathname, operation) {
|
|
416
|
-
const operationId = operation.operationId;
|
|
417
|
-
if (operationId && operationId !== "index" && !isKeywords(operationId) && !isReservedWord(operationId)) {
|
|
418
|
-
return operationId;
|
|
419
|
-
}
|
|
420
|
-
return `${method}_${pathname}`.replace(/\//g, "_").replace(/-/g, "_").replace(/:/g, "$$").replace(/{(.+)}/, "$$$1");
|
|
421
|
-
}
|
|
422
|
-
getDependencies() {
|
|
423
|
-
const refs = R2.uniq([
|
|
424
|
-
...(0, import_jsonpath_plus2.JSONPath)({
|
|
425
|
-
path: "$.requestBody.content..schema..$ref",
|
|
426
|
-
json: this.operation
|
|
427
|
-
}),
|
|
428
|
-
...(0, import_jsonpath_plus2.JSONPath)({
|
|
429
|
-
path: "$.responses..content..schema..$ref",
|
|
430
|
-
json: this.operation
|
|
431
|
-
}),
|
|
432
|
-
...(0, import_jsonpath_plus2.JSONPath)({
|
|
433
|
-
path: "$.parameters..schema..$ref",
|
|
434
|
-
json: this.operation
|
|
435
|
-
})
|
|
436
|
-
]);
|
|
437
|
-
const dependencies = refs.filter((ref) => typeof ref === "string" && ref).map((ref) => {
|
|
438
|
-
const schemaDefinition = this.document.dereference(ref);
|
|
439
|
-
if (schemaDefinition) return schemaDefinition;
|
|
440
|
-
return SchemaDefinition.unknown();
|
|
441
|
-
});
|
|
442
|
-
return dependencies;
|
|
443
|
-
}
|
|
444
|
-
};
|
|
445
|
-
|
|
446
|
-
// src/utils/logger.ts
|
|
447
|
-
var import_chalk = __toESM(require("chalk"), 1);
|
|
448
|
-
var logger = {
|
|
449
|
-
log: (str) => console.log(import_chalk.default.green(str)),
|
|
450
|
-
warn: (str) => console.warn(import_chalk.default.yellow(str)),
|
|
451
|
-
error: (str) => console.error(import_chalk.default.red(str))
|
|
452
|
-
};
|
|
453
|
-
|
|
454
|
-
// src/models/api-document_v3_1.ts
|
|
455
|
-
var ApiDocumentV3_1 = class _ApiDocumentV3_1 {
|
|
456
|
-
module;
|
|
457
|
-
specification;
|
|
458
|
-
constructor(specification, module2) {
|
|
459
|
-
this.module = module2;
|
|
460
|
-
this.specification = specification;
|
|
461
|
-
}
|
|
462
|
-
get schemas() {
|
|
463
|
-
const module2 = this.module;
|
|
464
|
-
return Object.entries(this.specification.components?.schemas || {}).map(([name, schema]) => new SchemaDefinition({
|
|
465
|
-
name,
|
|
466
|
-
schema,
|
|
467
|
-
module: module2,
|
|
468
|
-
document: this
|
|
469
|
-
}));
|
|
470
|
-
}
|
|
471
|
-
get operations() {
|
|
472
|
-
const module2 = this.module;
|
|
473
|
-
return Object.entries(this.specification.paths || {}).flatMap(([pathname, pathItem]) => Object.entries(pathItem || {}).filter(([method]) => SupportedMethods.includes(method.toLowerCase())).map(([method, operation]) => new OperationDefinition({
|
|
474
|
-
method,
|
|
475
|
-
pathname,
|
|
476
|
-
operation,
|
|
477
|
-
module: module2,
|
|
478
|
-
document: this
|
|
479
|
-
})));
|
|
480
|
-
}
|
|
481
|
-
isEmpty() {
|
|
482
|
-
return R3.isEmpty(this.specification.paths);
|
|
483
|
-
}
|
|
484
|
-
dereference($ref) {
|
|
485
|
-
if ($ref.startsWith("#/")) {
|
|
486
|
-
return this.schemas.find((schema) => schema.id.endsWith($ref));
|
|
487
|
-
}
|
|
488
|
-
logger.warn(`The $ref(${$ref}) is not defined in ${this.module.name} openapi/swagger.`);
|
|
489
|
-
}
|
|
490
|
-
isRefDefined($ref) {
|
|
491
|
-
if ($ref.startsWith("#/")) {
|
|
492
|
-
const path10 = $ref.replace("#/", "").split("/");
|
|
493
|
-
return R3.path(path10, this.specification) !== void 0;
|
|
494
|
-
}
|
|
495
|
-
return false;
|
|
496
|
-
}
|
|
497
|
-
static unknown() {
|
|
498
|
-
return new _ApiDocumentV3_1({}, ModuleDefinition.unknown());
|
|
499
|
-
}
|
|
500
|
-
};
|
|
501
|
-
|
|
502
|
-
// src/plugins/generate-declaration/generate-declaration.plugin.ts
|
|
503
|
-
var import_tapable = require("tapable");
|
|
504
|
-
|
|
505
|
-
// src/plugins/generate-declaration/generators/operation-declaration/operation.generator.ts
|
|
506
|
-
var path6 = __toESM(require("path"), 1);
|
|
507
|
-
var changeCase5 = __toESM(require("change-case"), 1);
|
|
508
|
-
|
|
509
|
-
// src/transformers/json-schema/comment.renderer.ts
|
|
510
|
-
var CommentRenderer = class {
|
|
511
|
-
constructor(schema) {
|
|
512
|
-
this.schema = schema;
|
|
513
|
-
}
|
|
514
|
-
render() {
|
|
515
|
-
const schema = this.schema;
|
|
516
|
-
const lines = ["/**"];
|
|
517
|
-
if (schema.description) {
|
|
518
|
-
const description = schema.description.replace("*/", "*\\/");
|
|
519
|
-
lines.push(...description.split("\n").map((line) => ` * ${line}`));
|
|
520
|
-
}
|
|
521
|
-
if (schema.deprecated) {
|
|
522
|
-
lines.push(" * @deprecated");
|
|
523
|
-
}
|
|
524
|
-
if (schema.readOnly) {
|
|
525
|
-
lines.push(" * @readonly");
|
|
526
|
-
}
|
|
527
|
-
if (schema.format) {
|
|
528
|
-
lines.push(` * @format ${schema.format}`);
|
|
529
|
-
}
|
|
530
|
-
lines.push(" */");
|
|
531
|
-
if (lines.length === 2) return "";
|
|
532
|
-
return lines.join("\n");
|
|
533
|
-
}
|
|
534
|
-
};
|
|
535
|
-
|
|
536
|
-
// src/transformers/json-schema/declaration.renderer.ts
|
|
537
|
-
var R5 = __toESM(require("ramda"), 1);
|
|
538
|
-
|
|
539
|
-
// src/utils/indent.ts
|
|
540
|
-
function indent(space, text) {
|
|
541
|
-
if (text === "") return "";
|
|
542
|
-
const indentation = " ".repeat(space);
|
|
543
|
-
return text.split("\n").map((line) => line ? `${indentation}${line}` : line).join("\n");
|
|
544
|
-
}
|
|
545
|
-
|
|
546
|
-
// src/transformers/json-schema/reference.transformer.ts
|
|
547
|
-
var R4 = __toESM(require("ramda"), 1);
|
|
548
|
-
var ReferenceTransformer = class {
|
|
549
|
-
static toDeclaration(schema, alias2 = R4.identity) {
|
|
550
|
-
if (!schema.$ref || !schema.$ref.startsWith("#")) return `unknown /* ${schema.$ref.replace("*/", "*\\/")} */`;
|
|
551
|
-
const parts = schema.$ref.split("/");
|
|
552
|
-
return alias2(parts[parts.length - 1]) || "unknown";
|
|
553
|
-
}
|
|
554
|
-
};
|
|
555
|
-
|
|
556
|
-
// src/transformers/json-schema/declaration.renderer.ts
|
|
557
|
-
var DeclarationRenderer = class {
|
|
558
|
-
constructor(schema, options = {}) {
|
|
559
|
-
this.schema = schema;
|
|
560
|
-
this.options = options;
|
|
561
|
-
}
|
|
562
|
-
render() {
|
|
563
|
-
return this.renderSchema(this.schema);
|
|
564
|
-
}
|
|
565
|
-
renderSchema(schema) {
|
|
566
|
-
if (typeof schema === "boolean") return "unknown";
|
|
567
|
-
if (JsonSchemaUtils.isRef(schema)) return this.renderReference(schema);
|
|
568
|
-
if (JsonSchemaUtils.isMixed(schema)) return this.renderMixed(schema);
|
|
569
|
-
if (JsonSchemaUtils.isArray(schema)) return this.renderArray(schema);
|
|
570
|
-
if (schema.type === "object") return this.renderObject(schema);
|
|
571
|
-
if (schema.enum) return this.renderEnum(schema);
|
|
572
|
-
if (schema.oneOf) return this.renderOneOf(schema);
|
|
573
|
-
if (schema.anyOf) return this.renderAnyOf(schema);
|
|
574
|
-
if (schema.allOf) return this.renderAllOf(schema);
|
|
575
|
-
if (schema.type === "string") return this.renderString(schema);
|
|
576
|
-
if (schema.type === "number") return this.renderNumber(schema);
|
|
577
|
-
if (schema.type === "boolean") return this.renderBoolean(schema);
|
|
578
|
-
if (schema.type === "null") return this.renderNull(schema);
|
|
579
|
-
if (schema.type === "integer") return this.renderInteger(schema);
|
|
580
|
-
return "unknown";
|
|
581
|
-
}
|
|
582
|
-
renderMixed(schema) {
|
|
583
|
-
if (Array.isArray(schema.type)) {
|
|
584
|
-
schema.type.map((type) => ({ ...schema, type })).map((schema2) => this.renderSchema(schema2)).join(" | ");
|
|
585
|
-
}
|
|
586
|
-
return "unknown";
|
|
587
|
-
}
|
|
588
|
-
renderReference(schema) {
|
|
589
|
-
if (!this.options.referenceTransformer) {
|
|
590
|
-
return ReferenceTransformer.toDeclaration(schema);
|
|
591
|
-
}
|
|
592
|
-
return this.options.referenceTransformer(schema);
|
|
593
|
-
}
|
|
594
|
-
renderArray(schema) {
|
|
595
|
-
if (schema.items && Array.isArray(schema.items)) {
|
|
596
|
-
const items = schema.items.map((s) => this.renderSchema(s)).join(", ");
|
|
597
|
-
return `[${items}]`;
|
|
598
|
-
}
|
|
599
|
-
if (schema.items && typeof schema.items === "object") {
|
|
600
|
-
return `${this.renderSchema(schema.items)}[]`;
|
|
601
|
-
}
|
|
602
|
-
return "any[]";
|
|
603
|
-
}
|
|
604
|
-
renderObject(schema) {
|
|
605
|
-
if ((!schema.properties || R5.isEmpty(schema.properties)) && (!schema.additionalProperties || R5.isEmpty(schema.additionalProperties))) {
|
|
606
|
-
return "object";
|
|
607
|
-
}
|
|
608
|
-
const $properties = Object.entries(schema.properties || {}).map(([propertyName, propertySchema]) => {
|
|
609
|
-
let $comment = new CommentRenderer(propertySchema).render();
|
|
610
|
-
if ($comment) $comment += "\n";
|
|
611
|
-
const $key = `"${propertyName}"${schema.required?.includes(propertyName) ? "" : "?"}`;
|
|
612
|
-
const $value = this.renderSchema(propertySchema);
|
|
613
|
-
return indent(2, `${$comment}${$key}: ${$value}`);
|
|
614
|
-
});
|
|
615
|
-
if (schema.additionalProperties) {
|
|
616
|
-
const $value = schema.additionalProperties === true ? "any" : this.renderSchema(schema.additionalProperties);
|
|
617
|
-
$properties.push(indent(2, `[key: string]: ${$value}`));
|
|
618
|
-
}
|
|
619
|
-
return [
|
|
620
|
-
"{",
|
|
621
|
-
...$properties,
|
|
622
|
-
"}"
|
|
623
|
-
].join("\n");
|
|
624
|
-
}
|
|
625
|
-
renderOneOf(schema) {
|
|
626
|
-
if (!schema.oneOf) return "unknown";
|
|
627
|
-
return schema.oneOf.map((s) => this.renderSchema(s)).join(" | ");
|
|
628
|
-
}
|
|
629
|
-
renderAnyOf(schema) {
|
|
630
|
-
if (!schema.anyOf) return "unknown";
|
|
631
|
-
return schema.anyOf.map((s) => this.renderSchema(s)).join(" | ");
|
|
632
|
-
}
|
|
633
|
-
renderAllOf(schema) {
|
|
634
|
-
if (!schema.allOf) return "unknown";
|
|
635
|
-
return schema.allOf.map((s) => this.renderSchema(s)).join(" & ");
|
|
636
|
-
}
|
|
637
|
-
renderEnum(schema) {
|
|
638
|
-
if (!schema.enum) return "unknown";
|
|
639
|
-
return schema.enum.map((v) => JSON.stringify(v)).join(" | ");
|
|
640
|
-
}
|
|
641
|
-
renderString(schema) {
|
|
642
|
-
if (schema.contentMediaType === "application/octet-stream") return "Blob | Buffer";
|
|
643
|
-
if (schema.format === "binary") return "Blob | Buffer";
|
|
644
|
-
return "string";
|
|
645
|
-
}
|
|
646
|
-
renderNumber(schema) {
|
|
647
|
-
return "number";
|
|
648
|
-
}
|
|
649
|
-
renderBoolean(schema) {
|
|
650
|
-
return "boolean";
|
|
651
|
-
}
|
|
652
|
-
renderNull(schema) {
|
|
653
|
-
return "null";
|
|
654
|
-
}
|
|
655
|
-
renderInteger(schema) {
|
|
656
|
-
return "number";
|
|
657
|
-
}
|
|
658
|
-
};
|
|
659
|
-
|
|
660
|
-
// src/transformers/json-schema/json-schema.transformer.ts
|
|
661
|
-
var JsonSchemaTransformer = class {
|
|
662
|
-
static toComment(schema) {
|
|
663
|
-
return new CommentRenderer(schema).render();
|
|
664
|
-
}
|
|
665
|
-
static toDeclaration(schema, options) {
|
|
666
|
-
return new DeclarationRenderer(schema, options).render();
|
|
667
|
-
}
|
|
668
|
-
};
|
|
669
|
-
|
|
670
|
-
// src/transformers/schema-definition/schema-definition.transformer.ts
|
|
671
|
-
var R6 = __toESM(require("ramda"), 1);
|
|
672
|
-
var SchemaDefinitionTransformer = class {
|
|
673
|
-
static toDeclaration(schemaDefinition, options) {
|
|
674
|
-
const dependencies = schemaDefinition.getDependencies();
|
|
675
|
-
let $dependencies = dependencies.filter((dep) => !SchemaDefinition.isUnknown(dep)).map((dep) => {
|
|
676
|
-
const filepath = options.getDependentSchemaDefinitionFilepath(dep);
|
|
677
|
-
return `import type { ${dep.name} } from "${filepath}"`;
|
|
678
|
-
}).map((str) => str.replace(/ from "(\.\.?\/.+?)(\.ts|\.mts|\.cts|\.js|\.cjs|\.mjs)?"/, options.esm ? ' from "$1.js"' : ' from "$1"')).join("\n");
|
|
679
|
-
if ($dependencies) $dependencies += "\n";
|
|
680
|
-
let $comment = JsonSchemaTransformer.toComment(schemaDefinition.schema);
|
|
681
|
-
if ($comment) $comment += "\n";
|
|
682
|
-
if (typeof schemaDefinition.schema === "boolean") {
|
|
683
|
-
return [
|
|
684
|
-
"/* @anchor:file:start */",
|
|
685
|
-
"",
|
|
686
|
-
$dependencies,
|
|
687
|
-
$comment || void 0,
|
|
688
|
-
`type ${schemaDefinition.name} = unknown`,
|
|
689
|
-
"",
|
|
690
|
-
"/* @anchor:file:end */"
|
|
691
|
-
].filter(R6.isNotNil).join("\n");
|
|
692
|
-
}
|
|
693
|
-
if (JsonSchemaUtils.isNonArray(schemaDefinition.schema) && schemaDefinition.schema.type === "object") {
|
|
694
|
-
const $schema = JsonSchemaTransformer.toDeclaration(schemaDefinition.schema);
|
|
695
|
-
const $declaration = $schema.startsWith("{") ? `export interface ${schemaDefinition.name} ${$schema}` : `export type ${schemaDefinition.name} = ${$schema}`;
|
|
696
|
-
return [
|
|
697
|
-
"/* @anchor:file:start */",
|
|
698
|
-
"",
|
|
699
|
-
$dependencies,
|
|
700
|
-
$comment || void 0,
|
|
701
|
-
$declaration,
|
|
702
|
-
"",
|
|
703
|
-
"/* @anchor:file:end */"
|
|
704
|
-
].filter(R6.isNotNil).join("\n");
|
|
705
|
-
}
|
|
706
|
-
return [
|
|
707
|
-
"/* @anchor:file:start */",
|
|
708
|
-
"",
|
|
709
|
-
$dependencies,
|
|
710
|
-
$comment || void 0,
|
|
711
|
-
`export type ${schemaDefinition.name} = ${JsonSchemaTransformer.toDeclaration(schemaDefinition.schema)}`,
|
|
712
|
-
"",
|
|
713
|
-
"/* @anchor:file:end */"
|
|
714
|
-
].filter(R6.isNotNil).join("\n");
|
|
715
|
-
}
|
|
716
|
-
};
|
|
717
|
-
|
|
718
|
-
// src/transformers/operation-definition/comment.renderer.ts
|
|
719
|
-
var R7 = __toESM(require("ramda"), 1);
|
|
720
|
-
var CommentRenderer2 = class {
|
|
721
|
-
constructor(operationDefinition) {
|
|
722
|
-
this.operationDefinition = operationDefinition;
|
|
723
|
-
}
|
|
724
|
-
render() {
|
|
725
|
-
const operation = this.operationDefinition.operation;
|
|
726
|
-
if (!operation.summary && !operation.description) return "";
|
|
727
|
-
const lines = ["/**"];
|
|
728
|
-
if (operation.summary && typeof operation.summary === "string") {
|
|
729
|
-
lines.push(` * ${R7.trim(operation.summary)}`);
|
|
730
|
-
lines.push(" *");
|
|
731
|
-
}
|
|
732
|
-
if (operation.description && typeof operation.description === "string") {
|
|
733
|
-
lines.push(` * @description ${R7.trim(operation.description)}`);
|
|
734
|
-
}
|
|
735
|
-
lines.push(" */");
|
|
736
|
-
return lines.join("\n");
|
|
737
|
-
}
|
|
738
|
-
};
|
|
739
|
-
|
|
740
|
-
// src/transformers/operation-definition/declaration.renderer.ts
|
|
741
|
-
var R12 = __toESM(require("ramda"), 1);
|
|
742
|
-
|
|
743
|
-
// src/transformers/operation-definition/utils/type-name-factory.ts
|
|
744
|
-
var changeCase = __toESM(require("change-case"), 1);
|
|
745
|
-
function typeNameFactory(operationDefinition) {
|
|
746
|
-
const pascalCaseOperationId = changeCase.pascalCase(operationDefinition.operationId);
|
|
747
|
-
return (name) => `${pascalCaseOperationId}${name}`;
|
|
748
|
-
}
|
|
749
|
-
|
|
750
|
-
// src/utils/openapi-utils/dereference.ts
|
|
751
|
-
function dereference($ref, swagger) {
|
|
752
|
-
let value;
|
|
753
|
-
for (const key of $ref.split("/")) {
|
|
754
|
-
if (key === "#") {
|
|
755
|
-
value = swagger;
|
|
756
|
-
} else {
|
|
757
|
-
value = value[key];
|
|
758
|
-
}
|
|
759
|
-
if (!value) break;
|
|
760
|
-
}
|
|
761
|
-
return value;
|
|
762
|
-
}
|
|
763
|
-
|
|
764
|
-
// src/utils/openapi-utils/dereference-operation.ts
|
|
765
|
-
var R10 = __toESM(require("ramda"), 1);
|
|
766
|
-
var import_jsonpointer2 = __toESM(require("jsonpointer"), 1);
|
|
767
|
-
var import_jsonpath_plus4 = require("jsonpath-plus");
|
|
768
|
-
|
|
769
|
-
// src/utils/openapi-utils/remove-undefined-ref.ts
|
|
770
|
-
var R9 = __toESM(require("ramda"), 1);
|
|
771
|
-
var import_jsonpointer = __toESM(require("jsonpointer"), 1);
|
|
772
|
-
var import_jsonpath_plus3 = require("jsonpath-plus");
|
|
773
|
-
|
|
774
|
-
// src/utils/openapi-utils/is-ref-defined.ts
|
|
775
|
-
var R8 = __toESM(require("ramda"), 1);
|
|
776
|
-
function isRefDefined($ref, swagger) {
|
|
777
|
-
if ($ref.startsWith("#/")) {
|
|
778
|
-
const path10 = $ref.replace("#/", "").split("/");
|
|
779
|
-
return R8.path(path10, swagger) !== void 0;
|
|
780
|
-
}
|
|
781
|
-
return false;
|
|
782
|
-
}
|
|
783
|
-
|
|
784
|
-
// src/utils/openapi-utils/remove-undefined-ref.ts
|
|
785
|
-
function removeUndefinedRef(swagger) {
|
|
786
|
-
const shadow = R9.clone(swagger);
|
|
787
|
-
const matches = (0, import_jsonpath_plus3.JSONPath)({
|
|
788
|
-
path: "$..*['$ref']^",
|
|
789
|
-
json: swagger,
|
|
790
|
-
resultType: "all"
|
|
791
|
-
});
|
|
792
|
-
for (const match of matches) {
|
|
793
|
-
if (match.value.$ref && !isRefDefined(match.value.$ref, swagger)) {
|
|
794
|
-
import_jsonpointer.default.set(shadow, match.pointer, R9.omit(["$ref"], match.value));
|
|
795
|
-
}
|
|
796
|
-
}
|
|
797
|
-
return shadow;
|
|
798
|
-
}
|
|
799
|
-
|
|
800
|
-
// src/utils/openapi-utils/dereference-operation.ts
|
|
801
|
-
function dereferencePathObject(swagger) {
|
|
802
|
-
const matches = (0, import_jsonpath_plus4.JSONPath)({
|
|
803
|
-
path: "$.paths.*.$ref^",
|
|
804
|
-
json: swagger,
|
|
805
|
-
resultType: "all"
|
|
806
|
-
});
|
|
807
|
-
for (const match of matches) {
|
|
808
|
-
const value = dereference(match.value.$ref, swagger);
|
|
809
|
-
import_jsonpointer2.default.set(swagger, match.pointer, value);
|
|
810
|
-
}
|
|
811
|
-
}
|
|
812
|
-
function dereferenceRequestBody(swagger) {
|
|
813
|
-
const matches = (0, import_jsonpath_plus4.JSONPath)({
|
|
814
|
-
path: "$.paths.*.*.requestBody.$ref^",
|
|
815
|
-
json: swagger,
|
|
816
|
-
resultType: "all"
|
|
817
|
-
});
|
|
818
|
-
for (const match of matches) {
|
|
819
|
-
const value = dereference(match.value.$ref, swagger);
|
|
820
|
-
import_jsonpointer2.default.set(swagger, match.pointer, value);
|
|
821
|
-
}
|
|
822
|
-
}
|
|
823
|
-
function dereferenceResponses(swagger) {
|
|
824
|
-
const matches = [
|
|
825
|
-
...(0, import_jsonpath_plus4.JSONPath)({
|
|
826
|
-
path: "$.paths.*.*.responses.*.$ref^",
|
|
827
|
-
json: swagger,
|
|
828
|
-
resultType: "all"
|
|
829
|
-
}),
|
|
830
|
-
...(0, import_jsonpath_plus4.JSONPath)({
|
|
831
|
-
path: "$.paths.*.*.responses.*.headers.*.$ref^",
|
|
832
|
-
json: swagger,
|
|
833
|
-
resultType: "all"
|
|
834
|
-
})
|
|
835
|
-
];
|
|
836
|
-
for (const match of matches) {
|
|
837
|
-
const value = dereference(match.value.$ref, swagger);
|
|
838
|
-
import_jsonpointer2.default.set(swagger, match.pointer, value);
|
|
839
|
-
}
|
|
840
|
-
}
|
|
841
|
-
function dereferenceParameters(swagger) {
|
|
842
|
-
const matches = (0, import_jsonpath_plus4.JSONPath)({
|
|
843
|
-
path: "$.paths.*.*.parameters.*.$ref^",
|
|
844
|
-
json: swagger,
|
|
845
|
-
resultType: "all"
|
|
846
|
-
});
|
|
847
|
-
for (const match of matches) {
|
|
848
|
-
const value = dereference(match.value.$ref, swagger);
|
|
849
|
-
import_jsonpointer2.default.set(swagger, match.pointer, value);
|
|
850
|
-
}
|
|
851
|
-
}
|
|
852
|
-
function dereferenceOperation(swagger) {
|
|
853
|
-
const shadow = R10.clone(swagger);
|
|
854
|
-
dereferencePathObject(shadow);
|
|
855
|
-
dereferenceRequestBody(shadow);
|
|
856
|
-
dereferenceResponses(shadow);
|
|
857
|
-
dereferenceParameters(shadow);
|
|
858
|
-
return removeUndefinedRef(shadow);
|
|
859
|
-
}
|
|
860
|
-
|
|
861
|
-
// src/utils/openapi-utils/dereference-deep.ts
|
|
862
|
-
function dereferenceDeep($ref, swagger) {
|
|
863
|
-
const stack = [$ref];
|
|
864
|
-
let value;
|
|
865
|
-
while (true) {
|
|
866
|
-
const last = stack[stack.length - 1];
|
|
867
|
-
value = dereference(last, swagger);
|
|
868
|
-
if (JsonSchemaUtils.isRef(value)) {
|
|
869
|
-
if (!stack.includes(value.$ref)) {
|
|
870
|
-
stack.push(value.$ref);
|
|
871
|
-
continue;
|
|
872
|
-
} else {
|
|
873
|
-
throw new Error(`Circular reference detected: ${stack.join(" -> ")} -> ${value.$ref}`);
|
|
874
|
-
}
|
|
875
|
-
}
|
|
876
|
-
break;
|
|
877
|
-
}
|
|
878
|
-
return value;
|
|
879
|
-
}
|
|
880
|
-
|
|
881
|
-
// src/utils/openapi-utils/to-3_1.ts
|
|
882
|
-
var import_openapi_parser = require("@scalar/openapi-parser");
|
|
883
|
-
function To3_1(openapi) {
|
|
884
|
-
const { specification } = (0, import_openapi_parser.upgrade)(openapi);
|
|
885
|
-
return specification;
|
|
886
|
-
}
|
|
887
|
-
|
|
888
|
-
// src/utils/openapi-utils/map-operation.ts
|
|
889
|
-
var R11 = __toESM(require("ramda"), 1);
|
|
890
|
-
function mapOperation(specification, mapper) {
|
|
891
|
-
const shadow = R11.clone(specification);
|
|
892
|
-
for (const [pathname, pathItem] of Object.entries(shadow.paths || {})) {
|
|
893
|
-
for (const m in pathItem) {
|
|
894
|
-
const method = m.toLowerCase();
|
|
895
|
-
if (!SupportedMethods.includes(method)) continue;
|
|
896
|
-
if (typeof pathItem[m] !== "object" || Array.isArray(pathItem[m]) || pathItem[m] === null) continue;
|
|
897
|
-
const operation = pathItem[m];
|
|
898
|
-
pathItem[m] = mapper(method, pathname, operation);
|
|
899
|
-
}
|
|
900
|
-
}
|
|
901
|
-
return shadow;
|
|
902
|
-
}
|
|
903
|
-
|
|
904
|
-
// src/utils/openapi-utils/map-parameter.ts
|
|
905
|
-
function mapParameter(specification, mapper) {
|
|
906
|
-
return mapOperation(specification, (method, pathname, operation) => {
|
|
907
|
-
if (!operation.parameters) return operation;
|
|
908
|
-
operation.parameters = operation.parameters.map((parameter) => mapper(method, pathname, operation, parameter));
|
|
909
|
-
return operation;
|
|
910
|
-
});
|
|
911
|
-
}
|
|
912
|
-
|
|
913
|
-
// src/utils/openapi-utils/index.ts
|
|
914
|
-
var OpenapiUtils = class {
|
|
915
|
-
static isRefDefined = isRefDefined;
|
|
916
|
-
static dereference = dereference;
|
|
917
|
-
static dereferenceDeep = dereferenceDeep;
|
|
918
|
-
static removeUndefinedRef = removeUndefinedRef;
|
|
919
|
-
static dereferenceOperation = dereferenceOperation;
|
|
920
|
-
static mapOperation = mapOperation;
|
|
921
|
-
static mapParameter = mapParameter;
|
|
922
|
-
// static updateOperationId = updateOperationId
|
|
923
|
-
static to3_1 = To3_1;
|
|
924
|
-
};
|
|
925
|
-
|
|
926
|
-
// src/transformers/operation-definition/declaration.renderer.ts
|
|
927
|
-
var alias = (name) => `${name}Schema`;
|
|
928
|
-
var DeclarationRenderer2 = class {
|
|
929
|
-
constructor(operationDefinition, options) {
|
|
930
|
-
this.operationDefinition = operationDefinition;
|
|
931
|
-
this.options = options;
|
|
932
|
-
this.typeName = typeNameFactory(operationDefinition);
|
|
933
|
-
}
|
|
934
|
-
typeName;
|
|
935
|
-
renderResponseBodies(operation, options) {
|
|
936
|
-
if (!operation.responses || R12.isEmpty(operation.responses)) {
|
|
937
|
-
return `export interface ${this.typeName("ResponseBodies")} {}`;
|
|
938
|
-
}
|
|
939
|
-
const $responses = Object.entries(operation.responses).map(([statusCode, response]) => {
|
|
940
|
-
if (!JsonSchemaUtils.isRef(response)) {
|
|
941
|
-
const $value = Object.entries(response.content || {}).map(([mediaType, mediaTypeObject]) => [mediaType, mediaTypeObject.schema]).map(([mediaType, schema]) => {
|
|
942
|
-
if (mediaType.includes("text/event-stream")) return "ReadableStream<ServerSentEvent>";
|
|
943
|
-
if (mediaType.includes("multipart/form-data")) return "FormData";
|
|
944
|
-
if (!schema) return "unknown";
|
|
945
|
-
return JsonSchemaTransformer.toDeclaration(schema, options);
|
|
946
|
-
}).join(" | ");
|
|
947
|
-
return indent(2, `${statusCode}: ${$value || "void"}`);
|
|
948
|
-
}
|
|
949
|
-
}).join("\n");
|
|
950
|
-
return [
|
|
951
|
-
`export interface ${this.typeName("ResponseBodies")} {`,
|
|
952
|
-
$responses,
|
|
953
|
-
"}"
|
|
954
|
-
].join("\n");
|
|
955
|
-
}
|
|
956
|
-
renderRequestBodies(operation, options) {
|
|
957
|
-
let $requestBodies = `export interface ${this.typeName("RequestBodies")} {}`;
|
|
958
|
-
if (operation.requestBody && !JsonSchemaUtils.isRef(operation.requestBody)) {
|
|
959
|
-
const $mediaTypes = Object.entries(operation.requestBody.content || {}).map(([mediaType, mediaTypeObject]) => [mediaType, mediaTypeObject.schema]).map(([mediaType, schema]) => {
|
|
960
|
-
if (!schema) return `${JSON.stringify(mediaType)}: unknown`;
|
|
961
|
-
return `${JSON.stringify(mediaType)}: ${JsonSchemaTransformer.toDeclaration(schema, options)}`;
|
|
962
|
-
}).map((pair) => indent(2, pair));
|
|
963
|
-
$requestBodies = [
|
|
964
|
-
`export interface ${this.typeName("RequestBodies")} {`,
|
|
965
|
-
...$mediaTypes,
|
|
966
|
-
"}"
|
|
967
|
-
].join("\n");
|
|
968
|
-
}
|
|
969
|
-
return $requestBodies;
|
|
970
|
-
}
|
|
971
|
-
renderParameterBodies(operationDefinition, options) {
|
|
972
|
-
const { operation } = operationDefinition;
|
|
973
|
-
let parameterBodies = "";
|
|
974
|
-
if (operation.requestBody && !JsonSchemaUtils.isRef(operation.requestBody)) {
|
|
975
|
-
const $mediaTypes = Object.entries(operation.requestBody.content || {}).map(([mediaType, mediaTypeObject]) => [mediaType, mediaTypeObject.schema]).map(([mediaType, schemaOrRef]) => {
|
|
976
|
-
if (!schemaOrRef) return `${JSON.stringify(mediaType)}: unknown`;
|
|
977
|
-
const schema = JsonSchemaUtils.isRef(schemaOrRef) ? OpenapiUtils.dereferenceDeep(schemaOrRef.$ref, operationDefinition.document.specification) : schemaOrRef;
|
|
978
|
-
if (schema.type === "object" || schema.properties) {
|
|
979
|
-
return `${JSON.stringify(mediaType)}: ${JsonSchemaTransformer.toDeclaration(schemaOrRef, options)} & { [key: string]: any }`;
|
|
980
|
-
}
|
|
981
|
-
return `${JSON.stringify(mediaType)}: { [key: string]: any }`;
|
|
982
|
-
}).map((pair) => indent(2, pair));
|
|
983
|
-
parameterBodies = [
|
|
984
|
-
`interface ${this.typeName("ParameterBodies")} {`,
|
|
985
|
-
...$mediaTypes,
|
|
986
|
-
"}",
|
|
987
|
-
""
|
|
988
|
-
].join("\n");
|
|
989
|
-
}
|
|
990
|
-
return parameterBodies;
|
|
991
|
-
}
|
|
992
|
-
renderRequestParameters(operation, options) {
|
|
993
|
-
const mediaTypes = operation.requestBody && !JsonSchemaUtils.isRef(operation.requestBody) ? Object.keys(operation.requestBody.content || {}) : [];
|
|
994
|
-
const base = `${this.typeName("RequestQuery")} & ${this.typeName("RouteParameters")} & ${this.typeName("RequestHeaders")}`;
|
|
995
|
-
if (mediaTypes.length === 1) {
|
|
996
|
-
return `export type ${this.typeName("RequestParameters")} = ${base} & ${this.typeName("RequestBodies")}[${JSON.stringify(mediaTypes[0])}]`;
|
|
997
|
-
}
|
|
998
|
-
if (mediaTypes.length > 1) {
|
|
999
|
-
const unions = mediaTypes.map((mediaType) => `(${base} & ${this.typeName("RequestBodies")}[${JSON.stringify(mediaType)}] & { "content-type": ${JSON.stringify(mediaType)} })`).join("\n| ");
|
|
1000
|
-
return `export type ${this.typeName("RequestParameters")} = ${unions}`;
|
|
1001
|
-
}
|
|
1002
|
-
return `export type ${this.typeName("RequestParameters")} = ${base}`;
|
|
1003
|
-
}
|
|
1004
|
-
rendererParameters(name, parameters, options) {
|
|
1005
|
-
if (parameters.length === 0) {
|
|
1006
|
-
return `export type ${name} = {}`;
|
|
1007
|
-
}
|
|
1008
|
-
const $parameters = parameters.map((parameter) => {
|
|
1009
|
-
const parameterName = `"${parameter.name}"`;
|
|
1010
|
-
const $key = parameter.required ? parameterName : `${parameterName}?`;
|
|
1011
|
-
const $value = JsonSchemaTransformer.toDeclaration(parameter.schema || { type: "any" }, options);
|
|
1012
|
-
return indent(2, `${$key}: ${$value}`);
|
|
1013
|
-
}).join("\n");
|
|
1014
|
-
return [
|
|
1015
|
-
`export type ${name} = {`,
|
|
1016
|
-
$parameters,
|
|
1017
|
-
"}"
|
|
1018
|
-
].filter(Boolean).join("\n");
|
|
1019
|
-
}
|
|
1020
|
-
renderDependencies() {
|
|
1021
|
-
const schemaDefinitions = this.operationDefinition.getDependencies().filter((schemaDefinition) => !SchemaDefinition.isUnknown(schemaDefinition));
|
|
1022
|
-
const $schemaDefinitions = schemaDefinitions.map((schemaDefinition) => {
|
|
1023
|
-
const filepath = this.options.getDependentSchemaDefinitionFilepath(schemaDefinition);
|
|
1024
|
-
const schemaName = schemaDefinition.name;
|
|
1025
|
-
return `import type { ${schemaName} as ${alias(schemaName)} } from "${filepath}"`;
|
|
1026
|
-
}).map((str) => str.replace(/ from "(\.\.?\/.+?)(\.ts|\.mts|\.cts|\.js|\.cjs|\.mjs)?"/, this.options.esm ? ' from "$1.js"' : ' from "$1"'));
|
|
1027
|
-
return [
|
|
1028
|
-
'import type { KeqOperation, KeqPathParameterInit, KeqQueryInit, ServerSentEvent } from "keq"',
|
|
1029
|
-
...$schemaDefinitions
|
|
1030
|
-
].join("\n");
|
|
1031
|
-
}
|
|
1032
|
-
render() {
|
|
1033
|
-
const { operation } = this.operationDefinition;
|
|
1034
|
-
if (!operation.responses) return "";
|
|
1035
|
-
const jsonSchemaDeclarationRendererOptions = {
|
|
1036
|
-
referenceTransformer: (schema) => {
|
|
1037
|
-
return ReferenceTransformer.toDeclaration(schema, alias);
|
|
1038
|
-
}
|
|
1039
|
-
};
|
|
1040
|
-
const $dependencies = this.renderDependencies();
|
|
1041
|
-
const $responseBodies = this.renderResponseBodies(operation, jsonSchemaDeclarationRendererOptions);
|
|
1042
|
-
const $requestBodies = this.renderRequestBodies(operation, jsonSchemaDeclarationRendererOptions);
|
|
1043
|
-
const $parameterBodies = this.renderParameterBodies(this.operationDefinition, jsonSchemaDeclarationRendererOptions);
|
|
1044
|
-
const $requestParameters = this.renderRequestParameters(operation, jsonSchemaDeclarationRendererOptions);
|
|
1045
|
-
const $requestQuery = this.rendererParameters(
|
|
1046
|
-
`${this.typeName("RequestQuery")}`,
|
|
1047
|
-
operation.parameters?.filter((p) => !JsonSchemaUtils.isRef(p) && p.in === "query") || [],
|
|
1048
|
-
jsonSchemaDeclarationRendererOptions
|
|
1049
|
-
);
|
|
1050
|
-
const $routeParameters = this.rendererParameters(
|
|
1051
|
-
`${this.typeName("RouteParameters")}`,
|
|
1052
|
-
operation.parameters?.filter((p) => !JsonSchemaUtils.isRef(p) && p.in === "path") || [],
|
|
1053
|
-
jsonSchemaDeclarationRendererOptions
|
|
1054
|
-
);
|
|
1055
|
-
const $requestHeaders = this.rendererParameters(
|
|
1056
|
-
`${this.typeName("RequestHeaders")}`,
|
|
1057
|
-
operation.parameters?.filter((p) => !JsonSchemaUtils.isRef(p) && p.in === "header") || [],
|
|
1058
|
-
jsonSchemaDeclarationRendererOptions
|
|
1059
|
-
);
|
|
1060
|
-
return [
|
|
1061
|
-
"/* @anchor:file:start */",
|
|
1062
|
-
"",
|
|
1063
|
-
$dependencies,
|
|
1064
|
-
"",
|
|
1065
|
-
$responseBodies,
|
|
1066
|
-
"",
|
|
1067
|
-
$requestBodies,
|
|
1068
|
-
"",
|
|
1069
|
-
$requestQuery,
|
|
1070
|
-
"",
|
|
1071
|
-
$routeParameters,
|
|
1072
|
-
"",
|
|
1073
|
-
$requestHeaders,
|
|
1074
|
-
"",
|
|
1075
|
-
$parameterBodies || void 0,
|
|
1076
|
-
$requestParameters,
|
|
1077
|
-
"",
|
|
1078
|
-
`export interface ${this.typeName("Operation")}<STATUS extends keyof ${this.typeName("ResponseBodies")}, CONTENT_TYPE extends ${$parameterBodies ? `keyof ${this.typeName("ParameterBodies")}` : "string"} > extends KeqOperation {`,
|
|
1079
|
-
` requestParams: ${this.typeName("RouteParameters")} & { [key: string]: KeqPathParameterInit }`,
|
|
1080
|
-
` requestQuery: ${this.typeName("RequestQuery")} & { [key: string]: KeqQueryInit }`,
|
|
1081
|
-
` requestHeaders: ${this.typeName("RequestHeaders")} & { [key: string]: string | number }`,
|
|
1082
|
-
` requestBody: ${$parameterBodies ? `${this.typeName("ParameterBodies")}[CONTENT_TYPE] | ` : "object | "}BodyInit`,
|
|
1083
|
-
` responseBody: ${this.typeName("ResponseBodies")}[STATUS]`,
|
|
1084
|
-
"}",
|
|
1085
|
-
"",
|
|
1086
|
-
"/* @anchor:file:end */"
|
|
1087
|
-
].filter(R12.isNotNil).join("\n");
|
|
1088
|
-
}
|
|
1089
|
-
};
|
|
1090
|
-
|
|
1091
|
-
// src/transformers/operation-definition/micro-function.renderer.ts
|
|
1092
|
-
var R14 = __toESM(require("ramda"), 1);
|
|
1093
|
-
|
|
1094
|
-
// src/exception.ts
|
|
1095
|
-
var import_ts_custom_error = require("ts-custom-error");
|
|
1096
|
-
var import_word_wrap = __toESM(require("word-wrap"), 1);
|
|
1097
|
-
var Exception = class extends import_ts_custom_error.CustomError {
|
|
1098
|
-
constructor(module2, message) {
|
|
1099
|
-
const moduleName = typeof module2 === "string" ? module2 : module2.name;
|
|
1100
|
-
const msg = (0, import_word_wrap.default)(message, { width: 60, indent: " " });
|
|
1101
|
-
super(`${moduleName} module failed to compile:
|
|
1102
|
-
${msg}`);
|
|
1103
|
-
Object.defineProperty(this, "name", { value: "KeqCLI_Exception" });
|
|
1104
|
-
}
|
|
1105
|
-
};
|
|
1106
|
-
|
|
1107
|
-
// src/transformers/operation-definition/typescript-snippet.ts
|
|
1108
|
-
var R13 = __toESM(require("ramda"), 1);
|
|
1109
|
-
|
|
1110
|
-
// src/constants/qs-array-format.ts
|
|
1111
|
-
var QsArrayFormat = /* @__PURE__ */ ((QsArrayFormat2) => {
|
|
1112
|
-
QsArrayFormat2["brackets"] = "brackets";
|
|
1113
|
-
QsArrayFormat2["indices"] = "indices";
|
|
1114
|
-
QsArrayFormat2["repeat"] = "repeat";
|
|
1115
|
-
QsArrayFormat2["comma"] = "comma";
|
|
1116
|
-
QsArrayFormat2["space"] = "space";
|
|
1117
|
-
QsArrayFormat2["pipe"] = "pipe";
|
|
1118
|
-
return QsArrayFormat2;
|
|
1119
|
-
})(QsArrayFormat || {});
|
|
1120
|
-
|
|
1121
|
-
// src/transformers/operation-definition/typescript-snippet.ts
|
|
1122
|
-
var OperationDefinitionSnippet = class {
|
|
1123
|
-
constructor(operationDefinition, options) {
|
|
1124
|
-
this.operationDefinition = operationDefinition;
|
|
1125
|
-
this.options = options;
|
|
1126
|
-
this.typeName = typeNameFactory(operationDefinition);
|
|
1127
|
-
}
|
|
1128
|
-
typeName;
|
|
1129
|
-
getQsParameters(parameter) {
|
|
1130
|
-
let arrayFormat;
|
|
1131
|
-
let allowDots;
|
|
1132
|
-
let indices;
|
|
1133
|
-
const style = parameter.style || "form";
|
|
1134
|
-
const explode = parameter.explode ?? true;
|
|
1135
|
-
if ("x-qs-array-format" in parameter) {
|
|
1136
|
-
arrayFormat = parameter["x-qs-array-format"];
|
|
1137
|
-
} else {
|
|
1138
|
-
if (style === "deepObject") {
|
|
1139
|
-
arrayFormat = "brackets" /* brackets */;
|
|
1140
|
-
} else if (explode) {
|
|
1141
|
-
arrayFormat = "repeat" /* repeat */;
|
|
1142
|
-
} else {
|
|
1143
|
-
if (style === "form") {
|
|
1144
|
-
arrayFormat = "comma" /* comma */;
|
|
1145
|
-
} else if (style === "spaceDelimited") {
|
|
1146
|
-
arrayFormat = "space" /* space */;
|
|
1147
|
-
} else if (style === "pipeDelimited") {
|
|
1148
|
-
arrayFormat = "pipe" /* pipe */;
|
|
1149
|
-
}
|
|
1150
|
-
}
|
|
1151
|
-
}
|
|
1152
|
-
if ("x-qs-allow-dots" in parameter) {
|
|
1153
|
-
allowDots = Boolean(parameter["x-qs-allow-dots"]);
|
|
1154
|
-
}
|
|
1155
|
-
if ("x-qs-indices" in parameter) {
|
|
1156
|
-
indices = Boolean(parameter["x-qs-indices"]);
|
|
1157
|
-
}
|
|
1158
|
-
if (arrayFormat || allowDots !== void 0 || indices !== void 0) {
|
|
1159
|
-
return {
|
|
1160
|
-
...arrayFormat ? { arrayFormat } : {},
|
|
1161
|
-
...allowDots !== void 0 ? { allowDots } : {},
|
|
1162
|
-
...indices !== void 0 ? { indices } : {}
|
|
1163
|
-
};
|
|
1164
|
-
}
|
|
1165
|
-
return void 0;
|
|
1166
|
-
}
|
|
1167
|
-
// render: "if (args && 'Authorization' in args) req.header('Authorization', args['Authorization'])"
|
|
1168
|
-
renderRequestHeaders() {
|
|
1169
|
-
const { operation } = this.operationDefinition;
|
|
1170
|
-
const $headers = (operation.parameters || []).filter((p) => !JsonSchemaUtils.isRef(p)).filter((p) => p.in === "header").map((p) => `if (args && ${JSON.stringify(p.name)} in args) req.header(${JSON.stringify(p.name)}, args[${JSON.stringify(p.name)}])`).join("\n");
|
|
1171
|
-
return $headers;
|
|
1172
|
-
}
|
|
1173
|
-
// render: "if (args && 'id' in args) req.query('id', args['id'], options)"
|
|
1174
|
-
renderRequestQuery() {
|
|
1175
|
-
const { operation } = this.operationDefinition;
|
|
1176
|
-
const $query = (operation.parameters || []).filter((p) => !JsonSchemaUtils.isRef(p)).filter((p) => p.in === "query").map((p) => {
|
|
1177
|
-
const option = this.getQsParameters(p);
|
|
1178
|
-
const $option = !option || R13.isEmpty(option) ? "" : `, ${JSON.stringify(option)}`;
|
|
1179
|
-
return `if (args && ${JSON.stringify(p.name)} in args) req.query(${JSON.stringify(p.name)}, args[${JSON.stringify(p.name)}]${$option})`;
|
|
1180
|
-
}).join("\n");
|
|
1181
|
-
return $query;
|
|
1182
|
-
}
|
|
1183
|
-
// render: "if (args && 'id' in args) req.params('id', args['id'])"
|
|
1184
|
-
renderRequestPathParameters() {
|
|
1185
|
-
const { operation } = this.operationDefinition;
|
|
1186
|
-
const $pathParameters = (operation.parameters || []).filter((p) => !JsonSchemaUtils.isRef(p)).filter((p) => p.in === "path").map((p) => `if (args && ${JSON.stringify(p.name)} in args) req.params(${JSON.stringify(p.name)}, args[${JSON.stringify(p.name)}])`).join("\n");
|
|
1187
|
-
return $pathParameters;
|
|
1188
|
-
}
|
|
1189
|
-
getRequestMediaTypes() {
|
|
1190
|
-
const { operation } = this.operationDefinition;
|
|
1191
|
-
const requestBodyContent = operation.requestBody?.content || {};
|
|
1192
|
-
return Object.keys(requestBodyContent);
|
|
1193
|
-
}
|
|
1194
|
-
// render "req.type("application/json")"
|
|
1195
|
-
renderMediaType() {
|
|
1196
|
-
const mediaTypes = this.getRequestMediaTypes();
|
|
1197
|
-
if (mediaTypes.length === 1 && !mediaTypes[0].endsWith("/*")) {
|
|
1198
|
-
return `req.type("${mediaTypes[0]}")
|
|
1199
|
-
`;
|
|
1200
|
-
} else if (mediaTypes.some((mediaType) => mediaType === "*/*")) {
|
|
1201
|
-
} else if (mediaTypes.some((mediaType) => mediaType.endsWith("/*"))) {
|
|
1202
|
-
return 'if(args?.["content-type"]) req.type(args["content-type"])\n';
|
|
1203
|
-
} else if (mediaTypes.length > 1) {
|
|
1204
|
-
return 'if(args?.["content-type"]) req.type(args["content-type"])\n';
|
|
1205
|
-
}
|
|
1206
|
-
return "";
|
|
1207
|
-
}
|
|
1208
|
-
// render body
|
|
1209
|
-
requestBodyFormDataPropertyRenderer(propertyName, propertySchema, mediaType) {
|
|
1210
|
-
try {
|
|
1211
|
-
const $propertyName = JSON.stringify(propertyName);
|
|
1212
|
-
const schema = JsonSchemaUtils.isRef(propertySchema) ? OpenapiUtils.dereferenceDeep(propertySchema.$ref, this.operationDefinition.document.specification) : propertySchema;
|
|
1213
|
-
if (schema.type === "string" && schema.format === "binary" || schema.contentMediaType === "application/octet-stream") {
|
|
1214
|
-
return `if (args && ${$propertyName} in args && args[${$propertyName}]) req.attach(${$propertyName}, args[${$propertyName}])`;
|
|
1215
|
-
} else if (schema.type === "string" || schema.type === "array" && schema.items && schema.items.type === "string") {
|
|
1216
|
-
return `if (args && ${$propertyName} in args && args[${$propertyName}] !== undefined) req.field(${$propertyName}, args[${$propertyName}])`;
|
|
1217
|
-
} else if (schema.type === "number" || schema.type === "integer") {
|
|
1218
|
-
return `if (args && ${$propertyName} in args && args[${$propertyName}] !== undefined) req.field(${$propertyName}, String(args[${$propertyName}]))`;
|
|
1219
|
-
}
|
|
1220
|
-
return `if (args && ${$propertyName} in args && args[${$propertyName}] !== undefined) req.field(${$propertyName}, String(args[${$propertyName}]) /* type is non-string in schema; triggers type coercion here */)`;
|
|
1221
|
-
} catch (err) {
|
|
1222
|
-
return this.renderErrorComment(err, mediaType);
|
|
1223
|
-
}
|
|
1224
|
-
}
|
|
1225
|
-
requestBodyPropertyRenderer(propertyName, propertySchema, mediaType) {
|
|
1226
|
-
if (mediaType === "application/json") {
|
|
1227
|
-
const $propertyName = JSON.stringify(propertyName);
|
|
1228
|
-
return `if (args && ${$propertyName} in args) req.send({ ${$propertyName}: args[${$propertyName}] })`;
|
|
1229
|
-
} else if (mediaType === "multipart/form-data") {
|
|
1230
|
-
return this.requestBodyFormDataPropertyRenderer(propertyName, propertySchema, mediaType);
|
|
1231
|
-
} else {
|
|
1232
|
-
throw new Error(`Unsupported media type: ${mediaType}`);
|
|
1233
|
-
}
|
|
1234
|
-
}
|
|
1235
|
-
renderRequestBody() {
|
|
1236
|
-
const { operation } = this.operationDefinition;
|
|
1237
|
-
const requestBodyContent = operation.requestBody?.content || {};
|
|
1238
|
-
const $requestBody = Object.entries(requestBodyContent).map(([mediaType, mediaTypeObject]) => {
|
|
1239
|
-
if (!mediaTypeObject.schema) return;
|
|
1240
|
-
try {
|
|
1241
|
-
const schema = JsonSchemaUtils.isRef(mediaTypeObject.schema) ? OpenapiUtils.dereferenceDeep(mediaTypeObject.schema.$ref, this.operationDefinition.document.specification) : mediaTypeObject.schema;
|
|
1242
|
-
if (schema.type !== "object") return;
|
|
1243
|
-
const properties = schema.properties || {};
|
|
1244
|
-
return Object.entries(properties).map(([propertyName, propertySchema]) => this.requestBodyPropertyRenderer(propertyName, propertySchema, mediaType)).join("\n");
|
|
1245
|
-
} catch (err) {
|
|
1246
|
-
return this.renderErrorComment(err, mediaType);
|
|
1247
|
-
}
|
|
1248
|
-
}).filter(R13.isNotNil).join("\n");
|
|
1249
|
-
return $requestBody;
|
|
1250
|
-
}
|
|
1251
|
-
renderErrorComment(err, mediaType) {
|
|
1252
|
-
const $err = String(err).split("\n").map(((line) => ` * ${line}`)).join("\n");
|
|
1253
|
-
return [
|
|
1254
|
-
"/**",
|
|
1255
|
-
` * Unable to dereference schema for media type ${mediaType}`,
|
|
1256
|
-
$err,
|
|
1257
|
-
" */"
|
|
1258
|
-
].join("\n");
|
|
1259
|
-
}
|
|
1260
|
-
};
|
|
1261
|
-
|
|
1262
|
-
// src/transformers/operation-definition/micro-function.renderer.ts
|
|
1263
|
-
var OperationDefinitionMicroFunctionRenderer = class {
|
|
1264
|
-
constructor(operationDefinition, options) {
|
|
1265
|
-
this.operationDefinition = operationDefinition;
|
|
1266
|
-
this.options = options;
|
|
1267
|
-
this.typeName = typeNameFactory(operationDefinition);
|
|
1268
|
-
this.helper = new OperationDefinitionSnippet(operationDefinition, options);
|
|
1269
|
-
}
|
|
1270
|
-
helper;
|
|
1271
|
-
typeName;
|
|
1272
|
-
render() {
|
|
1273
|
-
const { operation, operationId, method, pathname } = this.operationDefinition;
|
|
1274
|
-
if (!operation.responses) return "";
|
|
1275
|
-
const $dependencies = this.renderDependencies();
|
|
1276
|
-
const $comment = new CommentRenderer2(this.operationDefinition).render();
|
|
1277
|
-
const moduleName = this.operationDefinition.module.name;
|
|
1278
|
-
const $method = method.toLowerCase();
|
|
1279
|
-
const $queryParameters = this.helper.renderRequestQuery();
|
|
1280
|
-
const $headerParameters = this.helper.renderRequestHeaders();
|
|
1281
|
-
const $pathParameters = this.helper.renderRequestPathParameters();
|
|
1282
|
-
const $mediaType = this.helper.renderMediaType();
|
|
1283
|
-
const $requestBody = this.helper.renderRequestBody();
|
|
1284
|
-
const $operationDeclaration = this.renderOperationDeclaration();
|
|
1285
|
-
return [
|
|
1286
|
-
"/* @anchor:file:start */",
|
|
1287
|
-
"",
|
|
1288
|
-
$dependencies,
|
|
1289
|
-
"",
|
|
1290
|
-
`const moduleName = "${moduleName}"`,
|
|
1291
|
-
`const method = "${method}"`,
|
|
1292
|
-
`const pathname = "${pathname}"`,
|
|
1293
|
-
"",
|
|
1294
|
-
$comment || void 0,
|
|
1295
|
-
`export ${$operationDeclaration} {`,
|
|
1296
|
-
` const req = request.${$method}<${this.typeName("ResponseBodies")}[STATUS]>("${pathname}")`,
|
|
1297
|
-
" .option('module', { name: moduleName, pathname, method })",
|
|
1298
|
-
"",
|
|
1299
|
-
$mediaType ? indent(2, $mediaType) : void 0,
|
|
1300
|
-
" /* @anchor:query:start */",
|
|
1301
|
-
$queryParameters ? indent(2, $queryParameters) : void 0,
|
|
1302
|
-
" /* @anchor:query:end */",
|
|
1303
|
-
"",
|
|
1304
|
-
" /* @anchor:headers:start */",
|
|
1305
|
-
$headerParameters ? indent(2, $headerParameters) : void 0,
|
|
1306
|
-
" /* @anchor:headers:end */",
|
|
1307
|
-
"",
|
|
1308
|
-
" /* @anchor:path-parameters:start */",
|
|
1309
|
-
$pathParameters ? indent(2, $pathParameters) : void 0,
|
|
1310
|
-
" /* @anchor:path-parameters:end */",
|
|
1311
|
-
"",
|
|
1312
|
-
" /* @anchor:body:start */",
|
|
1313
|
-
$requestBody ? indent(2, $requestBody) : void 0,
|
|
1314
|
-
" /* @anchor:body:end */",
|
|
1315
|
-
"",
|
|
1316
|
-
" /* @anchor:operation-return */",
|
|
1317
|
-
` return req as ReturnType<typeof ${operationId}<STATUS${$operationDeclaration.includes("CONTENT_TYPE") ? ", CONTENT_TYPE" : ""}>>`,
|
|
1318
|
-
"}",
|
|
1319
|
-
"",
|
|
1320
|
-
`${operationId}.pathname = pathname`,
|
|
1321
|
-
`${operationId}.method = method`,
|
|
1322
|
-
"/* @anchor:file:end */"
|
|
1323
|
-
].filter(R14.isNotNil).join("\n");
|
|
1324
|
-
}
|
|
1325
|
-
renderDependencies() {
|
|
1326
|
-
const declarationFilepath = this.options.getOperationDefinitionDeclarationFilepath(this.operationDefinition);
|
|
1327
|
-
const requestFilepath = this.options.getRequestFilepath();
|
|
1328
|
-
return [
|
|
1329
|
-
'import { Keq } from "keq"',
|
|
1330
|
-
`import { request } from "${requestFilepath}"`,
|
|
1331
|
-
`import type { ${this.typeName("Operation")}, ${this.typeName("ResponseBodies")}, ${this.typeName("RequestParameters")} } from "${declarationFilepath}"`,
|
|
1332
|
-
`export type { ${this.typeName("RequestQuery")}, ${this.typeName("RequestHeaders")}, ${this.typeName("RequestBodies")} } from "${declarationFilepath}"`
|
|
1333
|
-
].map((str) => str.replace(/ from "(\.\.?\/.+?)(\.ts|\.mts|\.cts|\.js|\.cjs|\.mjs)?"/, this.options.esm ? ' from "$1.js"' : ' from "$1"')).join("\n");
|
|
1334
|
-
}
|
|
1335
|
-
renderOperationDeclaration() {
|
|
1336
|
-
const { operationId } = this.operationDefinition;
|
|
1337
|
-
const mediaTypes = this.helper.getRequestMediaTypes();
|
|
1338
|
-
if (mediaTypes.length === 0) {
|
|
1339
|
-
return `function ${operationId}<STATUS extends keyof ${this.typeName("ResponseBodies")}, CONTENT_TYPE extends never = never>(args?: ${this.typeName("RequestParameters")}): Keq<${this.typeName("Operation")}<STATUS, CONTENT_TYPE>>`;
|
|
1340
|
-
} else if (mediaTypes.length === 1) {
|
|
1341
|
-
return `function ${operationId}<STATUS extends keyof ${this.typeName("ResponseBodies")}, CONTENT_TYPE extends ${JSON.stringify(mediaTypes[0])} = ${JSON.stringify(mediaTypes[0])}>(args?: ${this.typeName("RequestParameters")}): Keq<${this.typeName("Operation")}<STATUS, CONTENT_TYPE>>`;
|
|
1342
|
-
} else if (mediaTypes.length > 1) {
|
|
1343
|
-
return `function ${operationId}<STATUS extends keyof ${this.typeName("ResponseBodies")}, CONTENT_TYPE extends ${this.typeName("RequestParameters")}["content-type"]>(args?: Extract<${this.typeName("RequestParameters")}, { "content-type": CONTENT_TYPE }>): Keq<${this.typeName("Operation")}<STATUS, CONTENT_TYPE>>`;
|
|
1344
|
-
}
|
|
1345
|
-
throw new Exception(this.operationDefinition.module, "[operationDeclarationRenderer] Unreachable");
|
|
1346
|
-
}
|
|
1347
|
-
};
|
|
1348
|
-
|
|
1349
|
-
// src/transformers/operation-definition/nestjs-method.renderer.ts
|
|
1350
|
-
var R15 = __toESM(require("ramda"), 1);
|
|
1351
|
-
var OperationDefinitionNestjsMethodRenderer = class {
|
|
1352
|
-
constructor(operationDefinition, options) {
|
|
1353
|
-
this.operationDefinition = operationDefinition;
|
|
1354
|
-
this.options = options;
|
|
1355
|
-
this.typeName = typeNameFactory(operationDefinition);
|
|
1356
|
-
this.helper = new OperationDefinitionSnippet(operationDefinition, options);
|
|
1357
|
-
}
|
|
1358
|
-
helper;
|
|
1359
|
-
typeName;
|
|
1360
|
-
render() {
|
|
1361
|
-
const pathname = this.operationDefinition.pathname;
|
|
1362
|
-
const $comment = new CommentRenderer2(this.operationDefinition).render();
|
|
1363
|
-
const $method = this.operationDefinition.method.toLowerCase();
|
|
1364
|
-
const $mediaType = this.helper.renderMediaType();
|
|
1365
|
-
const $operationDeclaration = this.renderOperationDeclaration(this.operationDefinition);
|
|
1366
|
-
const $queryParameters = this.helper.renderRequestQuery();
|
|
1367
|
-
const $headerParameters = this.helper.renderRequestHeaders();
|
|
1368
|
-
const $pathParameters = this.helper.renderRequestPathParameters();
|
|
1369
|
-
const $requestBody = this.helper.renderRequestBody();
|
|
1370
|
-
return [
|
|
1371
|
-
$comment,
|
|
1372
|
-
`${$operationDeclaration} {`,
|
|
1373
|
-
` const req = this.request.${$method}<${this.typeName("ResponseBodies")}[STATUS]>(${JSON.stringify(pathname)})`,
|
|
1374
|
-
" .option(",
|
|
1375
|
-
' "module",',
|
|
1376
|
-
" {",
|
|
1377
|
-
` name: ${JSON.stringify(this.operationDefinition.module.name)},`,
|
|
1378
|
-
` pathname: ${JSON.stringify(pathname)},`,
|
|
1379
|
-
` method: ${JSON.stringify($method)},`,
|
|
1380
|
-
" },",
|
|
1381
|
-
" )",
|
|
1382
|
-
"",
|
|
1383
|
-
$mediaType ? indent(2, $mediaType) : void 0,
|
|
1384
|
-
"",
|
|
1385
|
-
" /* @anchor:query:start */",
|
|
1386
|
-
$queryParameters ? indent(2, $queryParameters) : void 0,
|
|
1387
|
-
" /* @anchor:query:end */",
|
|
1388
|
-
"",
|
|
1389
|
-
" /* @anchor:headers:start */",
|
|
1390
|
-
$headerParameters ? indent(2, $headerParameters) : void 0,
|
|
1391
|
-
" /* @anchor:headers:end */",
|
|
1392
|
-
"",
|
|
1393
|
-
" /* @anchor:path-parameters:start */",
|
|
1394
|
-
$pathParameters ? indent(2, $pathParameters) : void 0,
|
|
1395
|
-
" /* @anchor:path-parameters:end */",
|
|
1396
|
-
"",
|
|
1397
|
-
" /* @anchor:body:start */",
|
|
1398
|
-
$requestBody ? indent(2, $requestBody) : void 0,
|
|
1399
|
-
" /* @anchor:body:end */",
|
|
1400
|
-
"",
|
|
1401
|
-
" return req",
|
|
1402
|
-
"}"
|
|
1403
|
-
].filter(R15.isNotNil).join("\n");
|
|
1404
|
-
}
|
|
1405
|
-
renderOperationDeclaration(operationDefinition) {
|
|
1406
|
-
const { operationId } = operationDefinition;
|
|
1407
|
-
const typeName = typeNameFactory(operationDefinition);
|
|
1408
|
-
const mediaTypes = this.helper.getRequestMediaTypes();
|
|
1409
|
-
if (mediaTypes.length === 0) {
|
|
1410
|
-
return `${operationId}<STATUS extends keyof ${typeName("ResponseBodies")}, CONTENT_TYPE extends never = never>(args?: ${typeName("RequestParameters")}): Keq<${typeName("Operation")}<STATUS, CONTENT_TYPE>>`;
|
|
1411
|
-
} else if (mediaTypes.length === 1) {
|
|
1412
|
-
return `${operationId}<STATUS extends keyof ${typeName("ResponseBodies")}, CONTENT_TYPE extends ${JSON.stringify(mediaTypes[0])} = ${JSON.stringify(mediaTypes[0])}>(args?: ${typeName("RequestParameters")}): Keq<${typeName("Operation")}<STATUS, CONTENT_TYPE>>`;
|
|
1413
|
-
} else if (mediaTypes.length > 1) {
|
|
1414
|
-
return `${operationId}<STATUS extends keyof ${typeName("ResponseBodies")}, CONTENT_TYPE extends ${typeName("RequestParameters")}["content-type"]>(args?: Extract<${typeName("RequestParameters")}, { "content-type": CONTENT_TYPE }>): Keq<${typeName("Operation")}<STATUS, CONTENT_TYPE>>`;
|
|
1415
|
-
}
|
|
1416
|
-
throw new Exception(operationDefinition.module, "[operationDeclarationRenderer] Unreachable");
|
|
1417
|
-
}
|
|
1418
|
-
};
|
|
1419
|
-
|
|
1420
|
-
// src/transformers/operation-definition/operation-definition.transformer.ts
|
|
1421
|
-
var OperationDefinitionTransformer = class {
|
|
1422
|
-
static toDeclaration(operationDefinition, options) {
|
|
1423
|
-
return new DeclarationRenderer2(operationDefinition, options).render();
|
|
1424
|
-
}
|
|
1425
|
-
static toMicroFunction(operationDefinition, options) {
|
|
1426
|
-
return new OperationDefinitionMicroFunctionRenderer(operationDefinition, options).render();
|
|
1427
|
-
}
|
|
1428
|
-
static toNestjsMethod(operationDefinition, options) {
|
|
1429
|
-
return new OperationDefinitionNestjsMethodRenderer(operationDefinition, options).render();
|
|
1430
|
-
}
|
|
1431
|
-
static toComment(operationDefinition) {
|
|
1432
|
-
return new CommentRenderer2(operationDefinition).render();
|
|
1433
|
-
}
|
|
1434
|
-
};
|
|
1435
|
-
|
|
1436
|
-
// src/transformers/entrypoint/entrypoint.transformer.ts
|
|
1437
|
-
var path4 = __toESM(require("path"), 1);
|
|
1438
|
-
var EntrypointTransformer = class {
|
|
1439
|
-
static toTypescript(exports2, options) {
|
|
1440
|
-
const $exports = exports2.map((exportArtifact) => {
|
|
1441
|
-
const relativePath = path4.relative(
|
|
1442
|
-
options.dirpath,
|
|
1443
|
-
exportArtifact.filepath
|
|
1444
|
-
).replace(/(\.ts|\.mts|\.cts|\.js|\.cjs|\.mjs)?$/, options.esm ? ".js" : "");
|
|
1445
|
-
return relativePath.startsWith(".") ? `export * from '${relativePath}'` : `export * from './${relativePath}'`;
|
|
1446
|
-
});
|
|
1447
|
-
return [
|
|
1448
|
-
"/* @anchor:file:start */",
|
|
1449
|
-
"",
|
|
1450
|
-
...$exports,
|
|
1451
|
-
"",
|
|
1452
|
-
"/* @anchor:file:end */"
|
|
1453
|
-
].join("\n");
|
|
1454
|
-
}
|
|
1455
|
-
};
|
|
1456
|
-
|
|
1457
|
-
// src/transformers/api-document/nestjs-client.renderer.ts
|
|
1458
|
-
var R16 = __toESM(require("ramda"), 1);
|
|
1459
|
-
var changeCase2 = __toESM(require("change-case"), 1);
|
|
1460
|
-
var NestjsClientRenderer = class {
|
|
1461
|
-
constructor(document, options) {
|
|
1462
|
-
this.document = document;
|
|
1463
|
-
this.options = options;
|
|
1464
|
-
}
|
|
1465
|
-
renderDependencies() {
|
|
1466
|
-
const $operations = this.document.operations.map((operationDefinition) => {
|
|
1467
|
-
const filepath = this.options.getOperationDefinitionDeclarationFilepath(operationDefinition);
|
|
1468
|
-
const typeName = typeNameFactory(operationDefinition);
|
|
1469
|
-
return `import type { ${typeName("Operation")}, ${typeName("ResponseBodies")}, ${typeName("RequestParameters")} } from "${filepath}"`;
|
|
1470
|
-
}).map((str) => str.replace(/ from "(\.\.?\/.+?)(\.ts|\.mts|\.cts|\.js|\.cjs|\.mjs)?"/, this.options.esm ? ' from "$1.js"' : ' from "$1"'));
|
|
1471
|
-
return [
|
|
1472
|
-
'import { Injectable, Logger } from "@nestjs/common"',
|
|
1473
|
-
'import { Keq, KeqRequest } from "keq"',
|
|
1474
|
-
...$operations
|
|
1475
|
-
].join("\n");
|
|
1476
|
-
}
|
|
1477
|
-
render() {
|
|
1478
|
-
const moduleName = changeCase2.pascalCase(this.document.module.name);
|
|
1479
|
-
const $dependencies = this.renderDependencies();
|
|
1480
|
-
const $operations = this.document.operations.map((operation) => OperationDefinitionTransformer.toNestjsMethod(operation, {
|
|
1481
|
-
esm: this.options.esm
|
|
1482
|
-
})).join("\n\n");
|
|
1483
|
-
return [
|
|
1484
|
-
"/* @anchor:file:start */",
|
|
1485
|
-
"",
|
|
1486
|
-
$dependencies,
|
|
1487
|
-
"",
|
|
1488
|
-
"@Injectable()",
|
|
1489
|
-
`export class ${moduleName}Client {`,
|
|
1490
|
-
` private readonly logger = new Logger(${moduleName}Client.name)`,
|
|
1491
|
-
"",
|
|
1492
|
-
" constructor(",
|
|
1493
|
-
" // @anchor:client-constructor-parameters:start",
|
|
1494
|
-
" private readonly request: KeqRequest,",
|
|
1495
|
-
" // @anchor:client-constructor-parameters:end",
|
|
1496
|
-
" ) {}",
|
|
1497
|
-
"",
|
|
1498
|
-
indent(2, $operations),
|
|
1499
|
-
"}",
|
|
1500
|
-
"",
|
|
1501
|
-
"/* @anchor:file:end */"
|
|
1502
|
-
].filter(R16.isNotNil).join("\n");
|
|
1503
|
-
}
|
|
1504
|
-
};
|
|
1505
|
-
|
|
1506
|
-
// src/transformers/api-document/nestjs-module.renderer.ts
|
|
1507
|
-
var changeCase3 = __toESM(require("change-case"), 1);
|
|
1508
|
-
var NestjsModuleRenderer = class {
|
|
1509
|
-
constructor(document, options) {
|
|
1510
|
-
this.document = document;
|
|
1511
|
-
this.options = options;
|
|
1512
|
-
}
|
|
1513
|
-
render() {
|
|
1514
|
-
const moduleName = changeCase3.pascalCase(this.document.module.name);
|
|
1515
|
-
const clientFilepath = this.options.getNestjsClientFilepath(this.document).replace(/(\.ts|\.mts|\.cts|\.js|\.cjs|\.mjs)?$/, this.options.esm ? ".js" : "");
|
|
1516
|
-
return [
|
|
1517
|
-
"/* @anchor:file:start */",
|
|
1518
|
-
'import { Module, Inject, ConfigurableModuleBuilder, Global } from "@nestjs/common"',
|
|
1519
|
-
'import { KeqRequest } from "keq"',
|
|
1520
|
-
'import { KeqModuleOptions } from "@keq-request/nestjs"',
|
|
1521
|
-
`import { ${moduleName}Client } from "${clientFilepath}"`,
|
|
1522
|
-
"",
|
|
1523
|
-
"",
|
|
1524
|
-
"const { ConfigurableModuleClass, MODULE_OPTIONS_TOKEN, OPTIONS_TYPE, ASYNC_OPTIONS_TYPE } = new ConfigurableModuleBuilder<KeqModuleOptions>().build()",
|
|
1525
|
-
"",
|
|
1526
|
-
"@Global()",
|
|
1527
|
-
"@Module({",
|
|
1528
|
-
" imports: [],",
|
|
1529
|
-
" controllers: [],",
|
|
1530
|
-
` providers: [${moduleName}Client],`,
|
|
1531
|
-
` exports: [${moduleName}Client],`,
|
|
1532
|
-
"})",
|
|
1533
|
-
`export class ${moduleName}Module extends ConfigurableModuleClass {`,
|
|
1534
|
-
"",
|
|
1535
|
-
" constructor(",
|
|
1536
|
-
" @Inject(MODULE_OPTIONS_TOKEN) private readonly options: KeqModuleOptions,",
|
|
1537
|
-
" private readonly request: KeqRequest,",
|
|
1538
|
-
" ) {",
|
|
1539
|
-
" super()",
|
|
1540
|
-
" }",
|
|
1541
|
-
"",
|
|
1542
|
-
" onModuleInit() {",
|
|
1543
|
-
" if (this.options.middlewares) {",
|
|
1544
|
-
" for (const middleware of this.options.middlewares) {",
|
|
1545
|
-
" this.request.use(middleware)",
|
|
1546
|
-
" }",
|
|
1547
|
-
" }",
|
|
1548
|
-
" }",
|
|
1549
|
-
"}",
|
|
1550
|
-
"",
|
|
1551
|
-
"/* @anchor:file:end */"
|
|
1552
|
-
].join("\n");
|
|
1553
|
-
}
|
|
1554
|
-
};
|
|
1555
|
-
|
|
1556
|
-
// src/transformers/api-document/api-document.transformer.ts
|
|
1557
|
-
var ApiDocumentTransformer = class {
|
|
1558
|
-
static toNestjsModule(document, options) {
|
|
1559
|
-
return new NestjsModuleRenderer(document, options).render();
|
|
1560
|
-
}
|
|
1561
|
-
static toNestjsClient(document, options) {
|
|
1562
|
-
return new NestjsClientRenderer(document, options).render();
|
|
1563
|
-
}
|
|
1564
|
-
};
|
|
1565
|
-
|
|
1566
|
-
// src/plugins/generate-declaration/generators/schema-declaration/schema.generator.ts
|
|
1567
|
-
var R17 = __toESM(require("ramda"), 1);
|
|
1568
|
-
var path5 = __toESM(require("path"), 1);
|
|
1569
|
-
var changeCase4 = __toESM(require("change-case"), 1);
|
|
1570
|
-
|
|
1571
|
-
// src/plugins/generate-declaration/constants/metadata-storage.ts
|
|
1572
|
-
var MetadataStorage2 = /* @__PURE__ */ new WeakMap();
|
|
1573
|
-
|
|
1574
|
-
// src/plugins/generate-declaration/generators/schema-declaration/schema.generator.ts
|
|
1575
|
-
var SCHEMA_GENERATOR = "schemaGenerator";
|
|
1576
|
-
var SchemaDeclarationGenerator = class _SchemaDeclarationGenerator {
|
|
1577
|
-
async compile(compiler, task) {
|
|
1578
|
-
const context = compiler.context;
|
|
1579
|
-
const metadata = MetadataStorage2.get(compiler);
|
|
1580
|
-
const rc = context.rc;
|
|
1581
|
-
const documents = context.documents;
|
|
1582
|
-
const schemaDefinitions = documents.flatMap((document) => document.schemas);
|
|
1583
|
-
const artifactMap = new Map(
|
|
1584
|
-
await Promise.all(
|
|
1585
|
-
schemaDefinitions.map(async (schemaDefinition) => [
|
|
1586
|
-
schemaDefinition,
|
|
1587
|
-
await metadata.hooks.afterSchemaDeclarationArtifactGenerated.promise(
|
|
1588
|
-
this.generateSchemaDefinitionsArtifact(schemaDefinition, rc),
|
|
1589
|
-
schemaDefinition,
|
|
1590
|
-
task
|
|
1591
|
-
)
|
|
1592
|
-
])
|
|
1593
|
-
)
|
|
1594
|
-
);
|
|
1595
|
-
const entrypoints = R17.collectBy(
|
|
1596
|
-
(schemaDefinition) => schemaDefinition.module.name,
|
|
1597
|
-
schemaDefinitions
|
|
1598
|
-
).map((schemaDefinitions2) => [
|
|
1599
|
-
schemaDefinitions2[0].module,
|
|
1600
|
-
schemaDefinitions2.map((schemaDefinition) => artifactMap.get(schemaDefinition)).filter((artifact) => Boolean(artifact))
|
|
1601
|
-
]).map(([moduleDefinition, artifacts]) => this.generateEntrypointArtifact(
|
|
1602
|
-
moduleDefinition,
|
|
1603
|
-
artifacts,
|
|
1604
|
-
rc
|
|
1605
|
-
));
|
|
1606
|
-
return [...artifactMap.values(), ...entrypoints];
|
|
1607
|
-
}
|
|
1608
|
-
generateSchemaDefinitionsArtifact(schemaDefinition, rc) {
|
|
1609
|
-
const filepath = _SchemaDeclarationGenerator.getSchemaDefinitionArtifactFilepath(schemaDefinition, rc.fileNamingStyle);
|
|
1610
|
-
const dirpath = path5.dirname(filepath);
|
|
1611
|
-
const artifact = new Artifact({
|
|
1612
|
-
id: _SchemaDeclarationGenerator.getSchemaDefinitionArtifactId(schemaDefinition),
|
|
1613
|
-
filepath,
|
|
1614
|
-
content: SchemaDefinitionTransformer.toDeclaration(
|
|
1615
|
-
schemaDefinition,
|
|
1616
|
-
{
|
|
1617
|
-
esm: rc.esm,
|
|
1618
|
-
getDependentSchemaDefinitionFilepath(dependentSchemaDefinition) {
|
|
1619
|
-
const relativePath = path5.relative(
|
|
1620
|
-
dirpath,
|
|
1621
|
-
_SchemaDeclarationGenerator.getSchemaDefinitionArtifactFilepath(dependentSchemaDefinition, rc.fileNamingStyle)
|
|
1622
|
-
);
|
|
1623
|
-
return relativePath.startsWith(".") ? relativePath : `./${relativePath}`;
|
|
1624
|
-
}
|
|
1625
|
-
}
|
|
1626
|
-
),
|
|
1627
|
-
extensionName: ".schema.ts"
|
|
1628
|
-
});
|
|
1629
|
-
return artifact;
|
|
1630
|
-
}
|
|
1631
|
-
generateEntrypointArtifact(moduleDefinition, exports2, rc) {
|
|
1632
|
-
const filepath = _SchemaDeclarationGenerator.getEntrypointArtifactFilepath(moduleDefinition, rc.fileNamingStyle);
|
|
1633
|
-
const dirpath = path5.dirname(filepath);
|
|
1634
|
-
const artifact = new Artifact({
|
|
1635
|
-
id: _SchemaDeclarationGenerator.getEntrypointArtifactId(moduleDefinition),
|
|
1636
|
-
filepath,
|
|
1637
|
-
content: EntrypointTransformer.toTypescript(exports2, { dirpath })
|
|
1638
|
-
});
|
|
1639
|
-
return artifact;
|
|
1640
|
-
}
|
|
1641
|
-
static getEntrypointArtifactFilepath(moduleDefinition, fileNamingStyle) {
|
|
1642
|
-
return [
|
|
1643
|
-
".",
|
|
1644
|
-
changeCase4[fileNamingStyle](moduleDefinition.name),
|
|
1645
|
-
"types",
|
|
1646
|
-
"components",
|
|
1647
|
-
"schemas",
|
|
1648
|
-
"index.ts"
|
|
1649
|
-
].join("/");
|
|
1650
|
-
}
|
|
1651
|
-
static getEntrypointArtifactId(moduleDefinition) {
|
|
1652
|
-
return `${moduleDefinition.address}/components/schemas/entrypoint?generator=${SCHEMA_GENERATOR}`;
|
|
1653
|
-
}
|
|
1654
|
-
static getSchemaDefinitionArtifactFilepath(schemaDefinition, fileNamingStyle) {
|
|
1655
|
-
const filename = `${changeCase4[fileNamingStyle](schemaDefinition.name)}.schema.ts`;
|
|
1656
|
-
return [
|
|
1657
|
-
".",
|
|
1658
|
-
changeCase4[fileNamingStyle](schemaDefinition.module.name),
|
|
1659
|
-
"types",
|
|
1660
|
-
"components",
|
|
1661
|
-
"schemas",
|
|
1662
|
-
filename
|
|
1663
|
-
].join("/");
|
|
1664
|
-
}
|
|
1665
|
-
static getSchemaDefinitionArtifactId(schemaDefinition) {
|
|
1666
|
-
return `${schemaDefinition.id}?generator=${SCHEMA_GENERATOR}`;
|
|
1667
|
-
}
|
|
1668
|
-
};
|
|
1669
|
-
|
|
1670
|
-
// src/plugins/generate-declaration/generators/operation-declaration/operation.generator.ts
|
|
1671
|
-
var OPERATION_GENERATOR = "operationDeclarationGenerator";
|
|
1672
|
-
var OperationDeclarationGenerator = class _OperationDeclarationGenerator {
|
|
1673
|
-
async compile(compiler, task) {
|
|
1674
|
-
const context = compiler.context;
|
|
1675
|
-
const metadata = MetadataStorage2.get(compiler);
|
|
1676
|
-
const rc = context.rc;
|
|
1677
|
-
const documents = context.documents;
|
|
1678
|
-
const operationDefinitions = documents.flatMap((document) => document.operations);
|
|
1679
|
-
const artifactMap = new Map(
|
|
1680
|
-
await Promise.all(
|
|
1681
|
-
operationDefinitions.map(async (operationDefinition) => [
|
|
1682
|
-
operationDefinition,
|
|
1683
|
-
await metadata.hooks.afterOperationDeclarationArtifactGenerated.promise(
|
|
1684
|
-
this.generateOperationDefinitionArtifact(operationDefinition, rc),
|
|
1685
|
-
operationDefinition,
|
|
1686
|
-
task
|
|
1687
|
-
)
|
|
1688
|
-
])
|
|
1689
|
-
)
|
|
1690
|
-
);
|
|
1691
|
-
return Array.from(artifactMap.values());
|
|
1692
|
-
}
|
|
1693
|
-
generateOperationDefinitionArtifact(operationDefinition, rc) {
|
|
1694
|
-
const filepath = _OperationDeclarationGenerator.getOperationDefinitionArtifactFilepath(operationDefinition, rc.fileNamingStyle);
|
|
1695
|
-
const dirpath = path6.dirname(filepath);
|
|
1696
|
-
const artifact = new Artifact({
|
|
1697
|
-
id: _OperationDeclarationGenerator.getOperationDefinitionArtifactId(operationDefinition),
|
|
1698
|
-
filepath,
|
|
1699
|
-
content: OperationDefinitionTransformer.toDeclaration(
|
|
1700
|
-
operationDefinition,
|
|
1701
|
-
{
|
|
1702
|
-
esm: rc.esm,
|
|
1703
|
-
getDependentSchemaDefinitionFilepath(dependentSchemaDefinition) {
|
|
1704
|
-
const relativePath = path6.relative(
|
|
1705
|
-
dirpath,
|
|
1706
|
-
SchemaDeclarationGenerator.getSchemaDefinitionArtifactFilepath(dependentSchemaDefinition, rc.fileNamingStyle)
|
|
1707
|
-
);
|
|
1708
|
-
return relativePath.startsWith(".") ? relativePath : `./${relativePath}`;
|
|
1709
|
-
}
|
|
1710
|
-
}
|
|
1711
|
-
),
|
|
1712
|
-
extensionName: ".type.ts"
|
|
1713
|
-
});
|
|
1714
|
-
return artifact;
|
|
1715
|
-
}
|
|
1716
|
-
generateEntrypointArtifact(moduleDefinition, exports2, rc) {
|
|
1717
|
-
const filepath = _OperationDeclarationGenerator.getEntrypointArtifactFilepath(moduleDefinition, rc.fileNamingStyle);
|
|
1718
|
-
const dirpath = path6.dirname(filepath);
|
|
1719
|
-
const artifact = new Artifact({
|
|
1720
|
-
id: _OperationDeclarationGenerator.getEntrypointArtifactId(moduleDefinition),
|
|
1721
|
-
filepath,
|
|
1722
|
-
content: EntrypointTransformer.toTypescript(exports2, { dirpath })
|
|
1723
|
-
});
|
|
1724
|
-
return artifact;
|
|
1725
|
-
}
|
|
1726
|
-
static getOperationDefinitionArtifactFilepath(operationDefinition, fileNamingStyle) {
|
|
1727
|
-
const filename = `${changeCase5[fileNamingStyle](operationDefinition.operationId)}.type.ts`;
|
|
1728
|
-
const filepath = [
|
|
1729
|
-
".",
|
|
1730
|
-
changeCase5[fileNamingStyle](operationDefinition.module.name),
|
|
1731
|
-
"types",
|
|
1732
|
-
"operations",
|
|
1733
|
-
filename
|
|
1734
|
-
].join("/");
|
|
1735
|
-
return filepath;
|
|
1736
|
-
}
|
|
1737
|
-
static getOperationDefinitionArtifactId(operationDefinition) {
|
|
1738
|
-
return `${operationDefinition.id}?generator=${OPERATION_GENERATOR}`;
|
|
1739
|
-
}
|
|
1740
|
-
static getEntrypointArtifactFilepath(moduleDefinition, fileNamingStyle) {
|
|
1741
|
-
return [
|
|
1742
|
-
".",
|
|
1743
|
-
changeCase5[fileNamingStyle](moduleDefinition.name),
|
|
1744
|
-
"types",
|
|
1745
|
-
"operations",
|
|
1746
|
-
"index.ts"
|
|
1747
|
-
].join("/");
|
|
1748
|
-
}
|
|
1749
|
-
static getEntrypointArtifactId(moduleDefinition) {
|
|
1750
|
-
return `${moduleDefinition.address}/paths/entrypoint?generator=${OPERATION_GENERATOR}`;
|
|
1751
|
-
}
|
|
1752
|
-
};
|
|
1753
|
-
|
|
1754
|
-
// src/plugins/generate-declaration/generate-declaration.plugin.ts
|
|
1755
|
-
var DECLARATION_GENERATOR = "declarationGenerator";
|
|
1756
|
-
var GenerateDeclarationPlugin = class _GenerateDeclarationPlugin {
|
|
1757
|
-
name = DECLARATION_GENERATOR;
|
|
1758
|
-
operationGenerator = new OperationDeclarationGenerator();
|
|
1759
|
-
schemaGenerator = new SchemaDeclarationGenerator();
|
|
1760
|
-
constructor() {
|
|
1761
|
-
}
|
|
1762
|
-
apply(compiler) {
|
|
1763
|
-
_GenerateDeclarationPlugin.register(compiler);
|
|
1764
|
-
compiler.hooks.compile.tapPromise(_GenerateDeclarationPlugin.name, async (task) => {
|
|
1765
|
-
compiler.context.artifacts?.push(
|
|
1766
|
-
...await this.schemaGenerator.compile(compiler, task),
|
|
1767
|
-
...await this.operationGenerator.compile(compiler, task)
|
|
1768
|
-
);
|
|
1769
|
-
});
|
|
1770
|
-
}
|
|
1771
|
-
static register(compiler) {
|
|
1772
|
-
if (!MetadataStorage2.has(compiler)) {
|
|
1773
|
-
MetadataStorage2.set(compiler, {
|
|
1774
|
-
hooks: {
|
|
1775
|
-
afterEntrypointArtifactGenerated: new import_tapable.AsyncSeriesWaterfallHook(["artifact", "task"]),
|
|
1776
|
-
afterSchemaDeclarationArtifactGenerated: new import_tapable.AsyncSeriesWaterfallHook(["artifact", "schemaDefinition", "task"]),
|
|
1777
|
-
afterOperationDeclarationArtifactGenerated: new import_tapable.AsyncSeriesWaterfallHook(["artifact", "operationDefinition", "task"])
|
|
1778
|
-
}
|
|
1779
|
-
});
|
|
1780
|
-
}
|
|
1781
|
-
return MetadataStorage2.get(compiler);
|
|
1782
|
-
}
|
|
1783
|
-
static of(compiler) {
|
|
1784
|
-
return this.register(compiler);
|
|
1785
|
-
}
|
|
1786
|
-
};
|
|
1787
|
-
|
|
1788
|
-
// src/plugins/generate-micro-function/generators/request/request.generator.ts
|
|
1789
|
-
var MICRO_FUNCTION_REQUEST_GENERATOR = "microFunctionRequestGenerator";
|
|
1790
|
-
var RequestGenerator = class _RequestGenerator {
|
|
1791
|
-
generateRequestArtifact() {
|
|
1792
|
-
const content = [
|
|
1793
|
-
"/* @anchor:file:start */",
|
|
1794
|
-
"",
|
|
1795
|
-
'import { KeqRequest } from "keq"',
|
|
1796
|
-
"",
|
|
1797
|
-
"/* @anchor:request-declaration */",
|
|
1798
|
-
"export const request = new KeqRequest()",
|
|
1799
|
-
"",
|
|
1800
|
-
"/* @anchor:file:end */"
|
|
1801
|
-
].join("\n");
|
|
1802
|
-
return new Artifact({
|
|
1803
|
-
id: _RequestGenerator.getRequestArtifactId(),
|
|
1804
|
-
filepath: _RequestGenerator.getRequestArtifactFilepath(),
|
|
1805
|
-
content
|
|
1806
|
-
});
|
|
1807
|
-
}
|
|
1808
|
-
// eslint-disable-next-line @typescript-eslint/require-await
|
|
1809
|
-
async compile(compiler, task) {
|
|
1810
|
-
return [
|
|
1811
|
-
this.generateRequestArtifact()
|
|
1812
|
-
];
|
|
1813
|
-
}
|
|
1814
|
-
static getRequestArtifactFilepath() {
|
|
1815
|
-
return "./request.ts";
|
|
1816
|
-
}
|
|
1817
|
-
static getRequestArtifactId() {
|
|
1818
|
-
return `request?generator=${MICRO_FUNCTION_REQUEST_GENERATOR}`;
|
|
1819
|
-
}
|
|
1820
|
-
};
|
|
1821
|
-
|
|
1822
|
-
// src/plugins/generate-micro-function/generators/micro_function/micro-function.generator.ts
|
|
1823
|
-
var MICRO_FUNCTION_GENERATOR = "microFunctionGenerator";
|
|
1824
|
-
var MicroFunctionGenerator = class _MicroFunctionGenerator {
|
|
1825
|
-
async compile(compiler, task) {
|
|
1826
|
-
const metadata = MetadataStorage.get(compiler);
|
|
1827
|
-
const context = compiler.context;
|
|
1828
|
-
const rc = context.rc;
|
|
1829
|
-
const documents = context.documents;
|
|
1830
|
-
const operationDefinitions = documents.flatMap((document) => document.operations);
|
|
1831
|
-
const artifactMap = new Map(
|
|
1832
|
-
await Promise.all(
|
|
1833
|
-
operationDefinitions.map(async (operationDefinition) => [
|
|
1834
|
-
operationDefinition,
|
|
1835
|
-
await metadata.hooks.afterMicroFunctionArtifactGenerated.promise(
|
|
1836
|
-
this.generateOperationDefinitionArtifact(operationDefinition, rc),
|
|
1837
|
-
operationDefinition,
|
|
1838
|
-
task
|
|
1839
|
-
)
|
|
1840
|
-
])
|
|
1841
|
-
)
|
|
1842
|
-
);
|
|
1843
|
-
const entrypoints = await Promise.all(
|
|
1844
|
-
R18.collectBy(
|
|
1845
|
-
(operationDefinition) => operationDefinition.module.name,
|
|
1846
|
-
operationDefinitions
|
|
1847
|
-
).map((operationDefinitions2) => [
|
|
1848
|
-
operationDefinitions2[0].module,
|
|
1849
|
-
operationDefinitions2.map((operationDefinition) => artifactMap.get(operationDefinition)).filter((artifact) => Boolean(artifact))
|
|
1850
|
-
]).map(async ([moduleDefinition, artifacts]) => await metadata.hooks.afterEntrypointArtifactGenerated.promise(
|
|
1851
|
-
this.generateEntrypointArtifact(
|
|
1852
|
-
moduleDefinition,
|
|
1853
|
-
artifacts,
|
|
1854
|
-
rc
|
|
1855
|
-
),
|
|
1856
|
-
task
|
|
1857
|
-
))
|
|
1858
|
-
);
|
|
1859
|
-
return [...entrypoints, ...artifactMap.values()];
|
|
1860
|
-
}
|
|
1861
|
-
generateOperationDefinitionArtifact(operationDefinition, rc) {
|
|
1862
|
-
const filepath = _MicroFunctionGenerator.getOperationDefinitionArtifactFilepath(operationDefinition, rc.fileNamingStyle);
|
|
1863
|
-
const dirpath = path7.dirname(filepath);
|
|
1864
|
-
const artifact = new Artifact({
|
|
1865
|
-
id: _MicroFunctionGenerator.getOperationDefinitionArtifactId(operationDefinition),
|
|
1866
|
-
filepath,
|
|
1867
|
-
content: OperationDefinitionTransformer.toMicroFunction(operationDefinition, {
|
|
1868
|
-
esm: rc.esm,
|
|
1869
|
-
getOperationDefinitionDeclarationFilepath(operationDefinition2) {
|
|
1870
|
-
const relativePath = path7.relative(
|
|
1871
|
-
dirpath,
|
|
1872
|
-
OperationDeclarationGenerator.getOperationDefinitionArtifactFilepath(operationDefinition2, rc.fileNamingStyle)
|
|
1873
|
-
);
|
|
1874
|
-
return relativePath.startsWith(".") ? relativePath : `./${relativePath}`;
|
|
1875
|
-
},
|
|
1876
|
-
getRequestFilepath() {
|
|
1877
|
-
const relativePath = path7.relative(
|
|
1878
|
-
dirpath,
|
|
1879
|
-
RequestGenerator.getRequestArtifactFilepath()
|
|
1880
|
-
);
|
|
1881
|
-
return relativePath.startsWith(".") ? relativePath : `./${relativePath}`;
|
|
1882
|
-
}
|
|
1883
|
-
}),
|
|
1884
|
-
extensionName: ".type.ts"
|
|
1885
|
-
});
|
|
1886
|
-
return artifact;
|
|
1887
|
-
}
|
|
1888
|
-
generateEntrypointArtifact(moduleDefinition, exports2, rc) {
|
|
1889
|
-
const filepath = _MicroFunctionGenerator.getEntrypointArtifactFilepath(moduleDefinition, rc.fileNamingStyle);
|
|
1890
|
-
const dirpath = filepath.substring(0, filepath.lastIndexOf("/"));
|
|
1891
|
-
const artifact = new Artifact({
|
|
1892
|
-
id: _MicroFunctionGenerator.getEntrypointArtifactId(moduleDefinition),
|
|
1893
|
-
filepath,
|
|
1894
|
-
content: EntrypointTransformer.toTypescript(exports2, { dirpath })
|
|
1895
|
-
});
|
|
1896
|
-
return artifact;
|
|
1897
|
-
}
|
|
1898
|
-
static getOperationDefinitionArtifactFilepath(operationDefinition, fileNamingStyle) {
|
|
1899
|
-
const filename = `${changeCase6[fileNamingStyle](operationDefinition.operationId)}.fn.ts`;
|
|
1900
|
-
const filepath = [
|
|
1901
|
-
".",
|
|
1902
|
-
changeCase6[fileNamingStyle](operationDefinition.module.name),
|
|
1903
|
-
"operations",
|
|
1904
|
-
filename
|
|
1905
|
-
].join("/");
|
|
1906
|
-
return filepath;
|
|
1907
|
-
}
|
|
1908
|
-
static getOperationDefinitionArtifactId(operationDefinition) {
|
|
1909
|
-
return `${operationDefinition.id}?generator=${MICRO_FUNCTION_GENERATOR}`;
|
|
1910
|
-
}
|
|
1911
|
-
static getEntrypointArtifactFilepath(moduleDefinition, fileNamingStyle) {
|
|
1912
|
-
return [
|
|
1913
|
-
".",
|
|
1914
|
-
changeCase6[fileNamingStyle](moduleDefinition.name),
|
|
1915
|
-
"operations",
|
|
1916
|
-
"index.ts"
|
|
1917
|
-
].join("/");
|
|
1918
|
-
}
|
|
1919
|
-
static getEntrypointArtifactId(moduleDefinition) {
|
|
1920
|
-
return `${moduleDefinition.address}/paths/entrypoint?generator=${MICRO_FUNCTION_GENERATOR}`;
|
|
1921
|
-
}
|
|
1922
|
-
};
|
|
1923
|
-
|
|
1924
|
-
// src/plugins/generate-micro-function/generate-micro-function.plugin.ts
|
|
1925
|
-
var GenerateMicroFunctionPlugin = class _GenerateMicroFunctionPlugin {
|
|
1926
|
-
microFunctionGenerator = new MicroFunctionGenerator();
|
|
1927
|
-
requestGenerator = new RequestGenerator();
|
|
1928
|
-
apply(compiler) {
|
|
1929
|
-
_GenerateMicroFunctionPlugin.register(compiler);
|
|
1930
|
-
compiler.hooks.compile.tapPromise(_GenerateMicroFunctionPlugin.name, async (task) => {
|
|
1931
|
-
const artifacts = [
|
|
1932
|
-
...await this.requestGenerator.compile(compiler, task),
|
|
1933
|
-
...await this.microFunctionGenerator.compile(compiler, task)
|
|
1934
|
-
];
|
|
1935
|
-
compiler.context.artifacts.push(...artifacts);
|
|
1936
|
-
});
|
|
1937
|
-
}
|
|
1938
|
-
static register(compiler) {
|
|
1939
|
-
if (!MetadataStorage.has(compiler)) {
|
|
1940
|
-
MetadataStorage.set(compiler, {
|
|
1941
|
-
hooks: {
|
|
1942
|
-
afterEntrypointArtifactGenerated: new import_tapable2.AsyncSeriesWaterfallHook(["artifact", "task"]),
|
|
1943
|
-
afterMicroFunctionArtifactGenerated: new import_tapable2.AsyncSeriesWaterfallHook(["artifact", "operationDefinition", "task"])
|
|
1944
|
-
}
|
|
1945
|
-
});
|
|
1946
|
-
}
|
|
1947
|
-
return MetadataStorage.get(compiler);
|
|
1948
|
-
}
|
|
1949
|
-
static of(compiler) {
|
|
1950
|
-
return this.register(compiler);
|
|
1951
|
-
}
|
|
1952
|
-
};
|
|
1953
|
-
|
|
1954
|
-
// src/plugins/body-fallback/index.ts
|
|
1955
|
-
var BodyFallbackPlugin = class _BodyFallbackPlugin {
|
|
1956
|
-
apply(compiler) {
|
|
1957
|
-
compiler.hooks.setup.tap(_BodyFallbackPlugin.name, () => {
|
|
1958
|
-
const generateMicroFunctionPluginMetadata = GenerateMicroFunctionPlugin.of(compiler);
|
|
1959
|
-
if (!generateMicroFunctionPluginMetadata) {
|
|
1960
|
-
throw new Error("BodyFallbackPlugin requires GenerateMicroFunctionPlugin to be applied first.");
|
|
1961
|
-
}
|
|
1962
|
-
generateMicroFunctionPluginMetadata.hooks.afterMicroFunctionArtifactGenerated.tap(_BodyFallbackPlugin.name, (artifact, operationDefinition) => {
|
|
1963
|
-
const operation = operationDefinition.operation;
|
|
1964
|
-
const parameters = operation.parameters?.filter((p) => !JsonSchemaUtils.isRef(p)) || [];
|
|
1965
|
-
const keys2 = parameters.map((p) => p.name).filter(R19.isNotNil);
|
|
1966
|
-
const $acc = !keys2.length ? " acc[key] = args[key]" : [
|
|
1967
|
-
` if (![${keys2.map((k) => JSON.stringify(k)).join(", ")}].includes(key)) {`,
|
|
1968
|
-
" acc[key] = args[key]",
|
|
1969
|
-
" }"
|
|
1970
|
-
].join("\n");
|
|
1971
|
-
artifact.anchor.block.replace("body", [
|
|
1972
|
-
// $mediaType ? `${$mediaType}\n` : undefined,
|
|
1973
|
-
' if (typeof args === "object" && args !== null && !Array.isArray(args)) {',
|
|
1974
|
-
" const requestBody = Object.keys(args)",
|
|
1975
|
-
" .reduce((acc, key) => {",
|
|
1976
|
-
$acc,
|
|
1977
|
-
" return acc",
|
|
1978
|
-
" }, {} as Record<string, unknown>)",
|
|
1979
|
-
"",
|
|
1980
|
-
" if (Object.keys(requestBody).length > 0) {",
|
|
1981
|
-
" req.send(requestBody)",
|
|
1982
|
-
" }",
|
|
1983
|
-
" }"
|
|
1984
|
-
].filter(R19.isNotNil).join("\n"));
|
|
1985
|
-
return artifact;
|
|
1986
|
-
});
|
|
1987
|
-
});
|
|
1988
|
-
}
|
|
1989
|
-
};
|
|
1990
|
-
|
|
1991
|
-
// src/plugins/generate-nestjs-module/generate-nestjs-module.ts
|
|
1992
|
-
var import_tapable3 = require("tapable");
|
|
1993
|
-
|
|
1994
|
-
// src/plugins/generate-nestjs-module/constants/metadata-storage.ts
|
|
1995
|
-
var MetadataStorage3 = /* @__PURE__ */ new WeakMap();
|
|
1996
|
-
|
|
1997
|
-
// src/plugins/generate-nestjs-module/generators/nestjs-module.generator.ts
|
|
1998
|
-
var path8 = __toESM(require("path"), 1);
|
|
1999
|
-
var changeCase7 = __toESM(require("change-case"), 1);
|
|
2000
|
-
var NESTJS_MODULE_GENERATOR = "nestjs-module-generator";
|
|
2001
|
-
var NestjsModuleGenerator = class _NestjsModuleGenerator {
|
|
2002
|
-
generateNestjsModuleArtifact(document, rc) {
|
|
2003
|
-
const filepath = _NestjsModuleGenerator.getNestjsModuleArtifactFilepath(document, rc.fileNamingStyle);
|
|
2004
|
-
const dirname6 = path8.dirname(filepath);
|
|
2005
|
-
const artifact = new Artifact({
|
|
2006
|
-
id: _NestjsModuleGenerator.getNestjsModuleArtifactId(document),
|
|
2007
|
-
filepath,
|
|
2008
|
-
content: ApiDocumentTransformer.toNestjsModule(document, {
|
|
2009
|
-
esm: rc.esm,
|
|
2010
|
-
getNestjsClientFilepath(document2) {
|
|
2011
|
-
const relativePath = path8.relative(
|
|
2012
|
-
dirname6,
|
|
2013
|
-
_NestjsModuleGenerator.getNestjsClientArtifactFilepath(document2, rc.fileNamingStyle)
|
|
2014
|
-
);
|
|
2015
|
-
return relativePath.startsWith(".") ? relativePath : `./${relativePath}`;
|
|
2016
|
-
}
|
|
2017
|
-
})
|
|
2018
|
-
});
|
|
2019
|
-
return artifact;
|
|
2020
|
-
}
|
|
2021
|
-
generateNestjsClientArtifact(document, rc) {
|
|
2022
|
-
const filepath = _NestjsModuleGenerator.getNestjsClientArtifactFilepath(document, rc.fileNamingStyle);
|
|
2023
|
-
const dirpath = path8.dirname(filepath);
|
|
2024
|
-
const artifact = new Artifact({
|
|
2025
|
-
id: _NestjsModuleGenerator.getNestjsClientArtifactId(document),
|
|
2026
|
-
filepath,
|
|
2027
|
-
content: ApiDocumentTransformer.toNestjsClient(document, {
|
|
2028
|
-
esm: rc.esm,
|
|
2029
|
-
getOperationDefinitionDeclarationFilepath(operationDefinition) {
|
|
2030
|
-
const relativePath = path8.relative(
|
|
2031
|
-
dirpath,
|
|
2032
|
-
OperationDeclarationGenerator.getOperationDefinitionArtifactFilepath(operationDefinition, rc.fileNamingStyle)
|
|
2033
|
-
);
|
|
2034
|
-
return relativePath.startsWith(".") ? relativePath : `./${relativePath}`;
|
|
2035
|
-
}
|
|
2036
|
-
})
|
|
2037
|
-
});
|
|
2038
|
-
return artifact;
|
|
2039
|
-
}
|
|
2040
|
-
async compile(compiler, task) {
|
|
2041
|
-
const metadata = MetadataStorage3.get(compiler);
|
|
2042
|
-
const rc = compiler.context.rc;
|
|
2043
|
-
const documents = compiler.context.documents;
|
|
2044
|
-
const nestjsModuleArtifacts = await Promise.all(
|
|
2045
|
-
documents.map((document) => metadata.hooks.afterNestjsModuleArtifactGenerated.promise(
|
|
2046
|
-
this.generateNestjsModuleArtifact(document, rc),
|
|
2047
|
-
document,
|
|
2048
|
-
task
|
|
2049
|
-
))
|
|
2050
|
-
);
|
|
2051
|
-
const nestjsClientArtifacts = await Promise.all(
|
|
2052
|
-
documents.map((document) => metadata.hooks.afterNestjsModuleArtifactGenerated.promise(
|
|
2053
|
-
this.generateNestjsClientArtifact(document, rc),
|
|
2054
|
-
document,
|
|
2055
|
-
task
|
|
2056
|
-
))
|
|
2057
|
-
);
|
|
2058
|
-
return [...nestjsModuleArtifacts, ...nestjsClientArtifacts];
|
|
2059
|
-
}
|
|
2060
|
-
static getNestjsModuleArtifactFilepath(document, fileNamingStyle) {
|
|
2061
|
-
const filename = `${changeCase7[fileNamingStyle](document.module.name)}.module.ts`;
|
|
2062
|
-
const filepath = [
|
|
2063
|
-
".",
|
|
2064
|
-
changeCase7[fileNamingStyle](document.module.name),
|
|
2065
|
-
filename
|
|
2066
|
-
];
|
|
2067
|
-
return filepath.join("/");
|
|
2068
|
-
}
|
|
2069
|
-
static getNestjsModuleArtifactId(document) {
|
|
2070
|
-
return `${document.module.address}?generate=${NESTJS_MODULE_GENERATOR}`;
|
|
2071
|
-
}
|
|
2072
|
-
static getNestjsClientArtifactFilepath(document, fileNamingStyle) {
|
|
2073
|
-
const filename = `${changeCase7[fileNamingStyle](document.module.name)}.client.ts`;
|
|
2074
|
-
const filepath = [
|
|
2075
|
-
".",
|
|
2076
|
-
changeCase7[fileNamingStyle](document.module.name),
|
|
2077
|
-
filename
|
|
2078
|
-
];
|
|
2079
|
-
return filepath.join("/");
|
|
2080
|
-
}
|
|
2081
|
-
static getNestjsClientArtifactId(document) {
|
|
2082
|
-
return `${document.module.address}?generate=${NESTJS_MODULE_GENERATOR}-client`;
|
|
2083
|
-
}
|
|
2084
|
-
};
|
|
2085
|
-
|
|
2086
|
-
// src/plugins/generate-nestjs-module/generate-nestjs-module.ts
|
|
2087
|
-
var GenerateNestjsModulePlugin = class _GenerateNestjsModulePlugin {
|
|
2088
|
-
nestjsModuleGenerator = new NestjsModuleGenerator();
|
|
2089
|
-
apply(compiler) {
|
|
2090
|
-
_GenerateNestjsModulePlugin.register(compiler);
|
|
2091
|
-
compiler.hooks.compile.tapPromise(_GenerateNestjsModulePlugin.name, async (task) => {
|
|
2092
|
-
const artifacts = await this.nestjsModuleGenerator.compile(compiler, task);
|
|
2093
|
-
compiler.context.artifacts.push(...artifacts);
|
|
2094
|
-
});
|
|
2095
|
-
}
|
|
2096
|
-
static register(compiler) {
|
|
2097
|
-
if (!MetadataStorage3.has(compiler)) {
|
|
2098
|
-
MetadataStorage3.set(compiler, {
|
|
2099
|
-
hooks: {
|
|
2100
|
-
afterNestjsModuleArtifactGenerated: new import_tapable3.AsyncSeriesWaterfallHook(["artifact", "document", "task"])
|
|
2101
|
-
}
|
|
2102
|
-
});
|
|
2103
|
-
}
|
|
2104
|
-
return MetadataStorage3.get(compiler);
|
|
2105
|
-
}
|
|
2106
|
-
static of(compiler) {
|
|
2107
|
-
return MetadataStorage3.get(compiler);
|
|
2108
|
-
}
|
|
2109
|
-
};
|
|
2110
|
-
|
|
2111
|
-
// src/plugins/chinese-to-pinyin/chinese-to-pinyin.plugin.ts
|
|
2112
|
-
var import_swagger_fix = require("swagger-fix");
|
|
2113
|
-
var ChineseToPinyinPlugin = class _ChineseToPinyinPlugin {
|
|
2114
|
-
apply(compiler) {
|
|
2115
|
-
compiler.hooks.afterDownload.tap(_ChineseToPinyinPlugin.name, (task) => {
|
|
2116
|
-
const documents = compiler.context.documents;
|
|
2117
|
-
compiler.context.documents = documents.map((doc) => {
|
|
2118
|
-
return new ApiDocumentV3_1(
|
|
2119
|
-
(0, import_swagger_fix.fixSwagger)(doc.specification),
|
|
2120
|
-
doc.module
|
|
2121
|
-
);
|
|
2122
|
-
});
|
|
2123
|
-
});
|
|
2124
|
-
}
|
|
2125
|
-
};
|
|
2126
|
-
|
|
2127
|
-
// src/plugins/download-http-file/download-http-file.plugin.ts
|
|
2128
|
-
var DownloadHttpFilePlugin = class _DownloadHttpFilePlugin {
|
|
2129
|
-
apply(compiler) {
|
|
2130
|
-
compiler.hooks.download.tapPromise(_DownloadHttpFilePlugin.name, async (address, task) => {
|
|
2131
|
-
const { url } = address;
|
|
2132
|
-
if (!url.startsWith("http://") && !url.startsWith("https://")) return void 0;
|
|
2133
|
-
const content = await this.download(address);
|
|
2134
|
-
const spec = this.deserialize(content);
|
|
2135
|
-
return JSON.stringify(spec);
|
|
2136
|
-
});
|
|
2137
|
-
}
|
|
2138
|
-
async download(address) {
|
|
2139
|
-
const { url, headers } = address;
|
|
2140
|
-
try {
|
|
2141
|
-
const res = await fetch(url, { headers });
|
|
2142
|
-
if (res.status >= 400) throw new Error(`failed with status code ${res.status}`);
|
|
2143
|
-
return await res.text();
|
|
2144
|
-
} catch (e) {
|
|
2145
|
-
if (e instanceof Error) {
|
|
2146
|
-
e.message = `Unable get the openapi/swagger file from ${url}: ${e.message}`;
|
|
2147
|
-
}
|
|
2148
|
-
throw e;
|
|
2149
|
-
}
|
|
2150
|
-
}
|
|
2151
|
-
deserialize(content) {
|
|
2152
|
-
const json = JSON.parse(content);
|
|
2153
|
-
const spec = OpenapiUtils.to3_1(json);
|
|
2154
|
-
return spec;
|
|
2155
|
-
}
|
|
2156
|
-
};
|
|
2157
|
-
|
|
2158
|
-
// src/plugins/download-local-file/download-local-file.plugin.ts
|
|
2159
|
-
var path9 = __toESM(require("path"), 1);
|
|
2160
|
-
var fs = __toESM(require("fs/promises"), 1);
|
|
2161
|
-
var yaml = __toESM(require("js-yaml"), 1);
|
|
2162
|
-
var import_url = require("url");
|
|
2163
|
-
var DownloadLocalFilePlugin = class _DownloadLocalFilePlugin {
|
|
2164
|
-
apply(compiler) {
|
|
2165
|
-
compiler.hooks.download.tapPromise(_DownloadLocalFilePlugin.name, async (address, task) => {
|
|
2166
|
-
const { url, encoding } = address;
|
|
2167
|
-
if (!url.startsWith("file://")) return void 0;
|
|
2168
|
-
const filepath = (0, import_url.fileURLToPath)(url);
|
|
2169
|
-
const fileExt = path9.extname(filepath);
|
|
2170
|
-
const content = await fs.readFile(filepath, encoding);
|
|
2171
|
-
const str = typeof content === "string" ? content : content.toString(encoding);
|
|
2172
|
-
if ([".yml", ".yaml"].includes(fileExt)) {
|
|
2173
|
-
const value = yaml.load(str);
|
|
2174
|
-
return JSON.stringify(OpenapiUtils.to3_1(value));
|
|
2175
|
-
} else if (fileExt === ".json") {
|
|
2176
|
-
return JSON.stringify(OpenapiUtils.to3_1(JSON.parse(str)));
|
|
2177
|
-
}
|
|
2178
|
-
});
|
|
2179
|
-
}
|
|
2180
|
-
};
|
|
2181
|
-
|
|
2182
|
-
// src/plugins/shaking/shaking.plugin.ts
|
|
2183
|
-
var import_openapi_shaking = require("@opendoc/openapi-shaking");
|
|
2184
|
-
var ShakingPlugin = class _ShakingPlugin {
|
|
2185
|
-
apply(compiler) {
|
|
2186
|
-
compiler.hooks.beforeCompile.tap(_ShakingPlugin.name, (task) => {
|
|
2187
|
-
const matcher = compiler.context.matcher;
|
|
2188
|
-
const documents = compiler.context.documents;
|
|
2189
|
-
compiler.context.documents = documents.map((document) => this.shaking(compiler, document)).filter((document) => !document.isEmpty()).filter((document) => !matcher.isModuleIgnored(document.module));
|
|
2190
|
-
});
|
|
2191
|
-
}
|
|
2192
|
-
shaking(compiler, document) {
|
|
2193
|
-
const rc = compiler.context.rc;
|
|
2194
|
-
const matcher = compiler.context.matcher;
|
|
2195
|
-
const isAccepted = (pathname, method, operation) => {
|
|
2196
|
-
if (!SupportedMethods.includes(method)) return false;
|
|
2197
|
-
return !matcher.isOperationIgnored(new OperationDefinition({
|
|
2198
|
-
method,
|
|
2199
|
-
pathname,
|
|
2200
|
-
operation,
|
|
2201
|
-
module: document.module,
|
|
2202
|
-
document
|
|
2203
|
-
}));
|
|
2204
|
-
};
|
|
2205
|
-
const sharkedSwagger = (0, import_openapi_shaking.openapiShakingSync)(
|
|
2206
|
-
document.specification,
|
|
2207
|
-
isAccepted,
|
|
2208
|
-
{ tolerant: rc.tolerant }
|
|
2209
|
-
);
|
|
2210
|
-
return new ApiDocumentV3_1(
|
|
2211
|
-
sharkedSwagger,
|
|
2212
|
-
new ModuleDefinition(
|
|
2213
|
-
document.module.name,
|
|
2214
|
-
{
|
|
2215
|
-
url: `memory://${document.module.name}.v3_1.sharked.json`,
|
|
2216
|
-
headers: {},
|
|
2217
|
-
encoding: "utf8"
|
|
2218
|
-
}
|
|
2219
|
-
)
|
|
2220
|
-
);
|
|
2221
|
-
}
|
|
2222
|
-
};
|
|
2223
|
-
|
|
2224
|
-
// src/plugins/terminal-select/utils/select-operation-definitions.ts
|
|
2225
|
-
var import_inquirer_select_pro = require("inquirer-select-pro");
|
|
2226
|
-
var import_prompt_adapter_inquirer = require("@listr2/prompt-adapter-inquirer");
|
|
2227
|
-
async function selectOperationDefinitions(task, operationDefinitions) {
|
|
2228
|
-
const selectedOperationDefinitions = await task.prompt(import_prompt_adapter_inquirer.ListrInquirerPromptAdapter).run(
|
|
2229
|
-
import_inquirer_select_pro.select,
|
|
2230
|
-
{
|
|
2231
|
-
message: "Select Pathname",
|
|
2232
|
-
defaultValue: [],
|
|
2233
|
-
options: (input) => {
|
|
2234
|
-
const items = operationDefinitions.map((op) => ({ name: `${op.module.name} ${op.method.toUpperCase()} ${op.pathname}`, value: op }));
|
|
2235
|
-
if (!input) return items;
|
|
2236
|
-
const keys2 = input.trim().toLowerCase().split(/\s+/);
|
|
2237
|
-
return items.filter((i) => {
|
|
2238
|
-
const name = i.name.toLowerCase();
|
|
2239
|
-
return keys2.every((q) => name.includes(q));
|
|
2240
|
-
});
|
|
2241
|
-
}
|
|
2242
|
-
}
|
|
2243
|
-
);
|
|
2244
|
-
return selectedOperationDefinitions;
|
|
2245
|
-
}
|
|
2246
|
-
|
|
2247
|
-
// src/plugins/terminal-select/terminal-select.plugin.ts
|
|
2248
|
-
var TerminalSelectPlugin = class _TerminalSelectPlugin {
|
|
2249
|
-
constructor(options) {
|
|
2250
|
-
this.options = options;
|
|
2251
|
-
}
|
|
2252
|
-
apply(compiler) {
|
|
2253
|
-
compiler.hooks.afterDownload.tapPromise(_TerminalSelectPlugin.name, async (task) => {
|
|
2254
|
-
const context = compiler.context;
|
|
2255
|
-
const matcher = context.matcher;
|
|
2256
|
-
const documents = context.documents;
|
|
2257
|
-
const operationDefinitions = documents.flatMap((document) => document.operations);
|
|
2258
|
-
const selectedOperationDefinitions = await selectOperationDefinitions(task, operationDefinitions);
|
|
2259
|
-
if (this.options.clear) {
|
|
2260
|
-
matcher.append({
|
|
2261
|
-
persist: false,
|
|
2262
|
-
ignore: true,
|
|
2263
|
-
moduleName: "*",
|
|
2264
|
-
operationMethod: "*",
|
|
2265
|
-
operationPathname: "*"
|
|
2266
|
-
});
|
|
2267
|
-
}
|
|
2268
|
-
for (const op of selectedOperationDefinitions) {
|
|
2269
|
-
matcher.append({
|
|
2270
|
-
persist: !!this.options.persist,
|
|
2271
|
-
ignore: this.options.mode === "add",
|
|
2272
|
-
moduleName: op.module.name,
|
|
2273
|
-
operationMethod: op.method,
|
|
2274
|
-
operationPathname: op.pathname
|
|
2275
|
-
});
|
|
2276
|
-
}
|
|
2277
|
-
});
|
|
2278
|
-
}
|
|
2279
|
-
};
|
|
2280
|
-
|
|
2281
|
-
// src/plugins/initialize/initialize.plugin.ts
|
|
2282
|
-
var R20 = __toESM(require("ramda"), 1);
|
|
2283
|
-
var InitializePlugin = class _InitializePlugin {
|
|
2284
|
-
constructor(options) {
|
|
2285
|
-
this.options = options;
|
|
2286
|
-
}
|
|
2287
|
-
apply(compiler) {
|
|
2288
|
-
compiler.hooks.setup.tap(_InitializePlugin.name, (task) => {
|
|
2289
|
-
new DownloadHttpFilePlugin().apply(compiler);
|
|
2290
|
-
new DownloadLocalFilePlugin().apply(compiler);
|
|
2291
|
-
new GenerateDeclarationPlugin().apply(compiler);
|
|
2292
|
-
if (this.options.build) {
|
|
2293
|
-
new ShakingPlugin().apply(compiler);
|
|
2294
|
-
}
|
|
2295
|
-
if (this.options.interactive) {
|
|
2296
|
-
new TerminalSelectPlugin(
|
|
2297
|
-
typeof this.options.interactive === "object" ? this.options.interactive : { mode: "except" }
|
|
2298
|
-
).apply(compiler);
|
|
2299
|
-
}
|
|
2300
|
-
const rc = compiler.context.rc;
|
|
2301
|
-
if (rc.mode === "micro-function") {
|
|
2302
|
-
new GenerateMicroFunctionPlugin().apply(compiler);
|
|
2303
|
-
} else if (rc.mode === "nestjs-module") {
|
|
2304
|
-
new GenerateNestjsModulePlugin().apply(compiler);
|
|
2305
|
-
}
|
|
2306
|
-
if (rc.plugins && rc.plugins.length) {
|
|
2307
|
-
for (const plugin of rc.plugins) {
|
|
2308
|
-
plugin.apply(compiler);
|
|
2309
|
-
}
|
|
2310
|
-
}
|
|
2311
|
-
});
|
|
2312
|
-
if (this.options.includes && this.options.includes.length) {
|
|
2313
|
-
const modulesIncludes = this.options.includes;
|
|
2314
|
-
compiler.hooks.afterSetup.tap(_InitializePlugin.name, (task) => {
|
|
2315
|
-
const rc = compiler.context.rc;
|
|
2316
|
-
const matcher = compiler.context.matcher;
|
|
2317
|
-
const notExistModules = modulesIncludes.filter((moduleName) => !(moduleName in rc.modules));
|
|
2318
|
-
if (notExistModules.length) {
|
|
2319
|
-
throw new Error(`Cannot find module(s) ${notExistModules.join(", ")} in config file.`);
|
|
2320
|
-
}
|
|
2321
|
-
const ignoredModules = R20.difference(R20.keys(rc.modules), modulesIncludes);
|
|
2322
|
-
for (const moduleName of ignoredModules) {
|
|
2323
|
-
matcher.append({
|
|
2324
|
-
persist: false,
|
|
2325
|
-
ignore: true,
|
|
2326
|
-
moduleName,
|
|
2327
|
-
operationMethod: "*",
|
|
2328
|
-
operationPathname: "*"
|
|
2329
|
-
});
|
|
2330
|
-
}
|
|
2331
|
-
});
|
|
2332
|
-
}
|
|
2333
|
-
}
|
|
2334
|
-
};
|
|
2335
|
-
|
|
2336
|
-
// src/plugins/overwrite-operation-id/overwrite-operation-id.plugin.ts
|
|
2337
|
-
var OverwriteOperationIdPlugin = class _OverwriteOperationIdPlugin {
|
|
2338
|
-
constructor(factory) {
|
|
2339
|
-
this.factory = factory;
|
|
2340
|
-
}
|
|
2341
|
-
apply(compiler) {
|
|
2342
|
-
compiler.hooks.afterDownload.tap(_OverwriteOperationIdPlugin.name, () => {
|
|
2343
|
-
const documents = compiler.context.documents;
|
|
2344
|
-
const factory = this.factory;
|
|
2345
|
-
compiler.context.documents = documents.map((document) => {
|
|
2346
|
-
const spec = OpenapiUtils.mapOperation(
|
|
2347
|
-
document.specification,
|
|
2348
|
-
(method, pathname, operation) => {
|
|
2349
|
-
const operationId = factory({ method, pathname, operation, module: document.module });
|
|
2350
|
-
if (typeof operationId === "string") {
|
|
2351
|
-
if (operationId.length === 0) {
|
|
2352
|
-
throw new Exception(document.module, `The generated operationId for [${method.toUpperCase()} ${pathname}] is an empty string.`);
|
|
2353
|
-
}
|
|
2354
|
-
operation.operationId = operationId;
|
|
2355
|
-
return operation;
|
|
2356
|
-
}
|
|
2357
|
-
return operation;
|
|
2358
|
-
}
|
|
2359
|
-
);
|
|
2360
|
-
return new ApiDocumentV3_1(spec, document.module);
|
|
2361
|
-
});
|
|
2362
|
-
});
|
|
2363
|
-
}
|
|
2364
|
-
};
|
|
2365
|
-
|
|
2366
|
-
// src/plugins/overwrite-query-options/overwrite-query-options.plugin.ts
|
|
2367
|
-
var QsArrayFormatUnion = Object.values(QsArrayFormat);
|
|
2368
|
-
var OverwriteQueryOptionsPlugin = class _OverwriteQueryOptionsPlugin {
|
|
2369
|
-
constructor(factory) {
|
|
2370
|
-
this.factory = factory;
|
|
2371
|
-
}
|
|
2372
|
-
apply(compiler) {
|
|
2373
|
-
compiler.hooks.afterDownload.tap(_OverwriteQueryOptionsPlugin.name, (task) => {
|
|
2374
|
-
const documents = compiler.context.documents;
|
|
2375
|
-
const factory = this.factory;
|
|
2376
|
-
compiler.context.documents = documents.map((document) => {
|
|
2377
|
-
const specification = OpenapiUtils.mapParameter(
|
|
2378
|
-
document.specification,
|
|
2379
|
-
(method, pathname, operation, parameter) => {
|
|
2380
|
-
const qsOptions = typeof factory === "function" ? factory({ parameter, operation, pathname, method, module: document.module }) : factory;
|
|
2381
|
-
if (!qsOptions) return parameter;
|
|
2382
|
-
if (qsOptions.arrayFormat) {
|
|
2383
|
-
if (!QsArrayFormatUnion.includes(qsOptions.arrayFormat)) {
|
|
2384
|
-
throw new Exception(document.module, `The 'arrayFormat' value '${qsOptions.arrayFormat}' for the query parameter '${parameter.name}' in [${method.toUpperCase()} ${pathname}] is invalid.`);
|
|
2385
|
-
}
|
|
2386
|
-
parameter["x-qs-array-format"] = qsOptions.arrayFormat;
|
|
2387
|
-
}
|
|
2388
|
-
if (qsOptions.allowDots !== void 0) {
|
|
2389
|
-
if (typeof qsOptions.allowDots !== "boolean") {
|
|
2390
|
-
throw new Exception(document.module, `The 'allowDots' value for the query parameter '${parameter.name}' in [${method.toUpperCase()} ${pathname}] must be a boolean.`);
|
|
2391
|
-
}
|
|
2392
|
-
parameter["x-qs-allow-dots"] = Boolean(qsOptions.allowDots);
|
|
2393
|
-
}
|
|
2394
|
-
if (qsOptions.indices !== void 0) {
|
|
2395
|
-
if (typeof qsOptions.indices !== "boolean") {
|
|
2396
|
-
throw new Exception(document.module, `The 'indices' value for the query parameter '${parameter.name}' in [${method.toUpperCase()} ${pathname}] must be a boolean.`);
|
|
2397
|
-
}
|
|
2398
|
-
parameter["x-qs-indices"] = Boolean(qsOptions.indices);
|
|
2399
|
-
}
|
|
2400
|
-
return parameter;
|
|
2401
|
-
}
|
|
2402
|
-
);
|
|
2403
|
-
return new ApiDocumentV3_1(
|
|
2404
|
-
specification,
|
|
2405
|
-
document.module
|
|
2406
|
-
);
|
|
2407
|
-
});
|
|
2408
|
-
});
|
|
2409
|
-
}
|
|
2410
|
-
};
|
|
2411
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
2412
|
-
0 && (module.exports = {
|
|
2413
|
-
BodyFallbackPlugin,
|
|
2414
|
-
ChineseToPinyinPlugin,
|
|
2415
|
-
DECLARATION_GENERATOR,
|
|
2416
|
-
DownloadHttpFilePlugin,
|
|
2417
|
-
DownloadLocalFilePlugin,
|
|
2418
|
-
EslintPlugin,
|
|
2419
|
-
GenerateDeclarationPlugin,
|
|
2420
|
-
GenerateMicroFunctionPlugin,
|
|
2421
|
-
GenerateNestjsModulePlugin,
|
|
2422
|
-
InitializePlugin,
|
|
2423
|
-
MICRO_FUNCTION_GENERATOR,
|
|
2424
|
-
MICRO_FUNCTION_REQUEST_GENERATOR,
|
|
2425
|
-
MicroFunctionGenerator,
|
|
2426
|
-
NestjsModuleGenerator,
|
|
2427
|
-
OPERATION_GENERATOR,
|
|
2428
|
-
OperationDeclarationGenerator,
|
|
2429
|
-
OverwriteOperationIdPlugin,
|
|
2430
|
-
OverwriteQueryOptionsPlugin,
|
|
2431
|
-
PrettierPlugin,
|
|
2432
|
-
RequestGenerator,
|
|
2433
|
-
SCHEMA_GENERATOR,
|
|
2434
|
-
SchemaDeclarationGenerator,
|
|
2435
|
-
ShakingPlugin,
|
|
2436
|
-
TerminalSelectPlugin
|
|
2437
|
-
});
|
|
2438
|
-
//# sourceMappingURL=plugins.cjs.map
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_plugins = require("./plugins-CgMhaNZq.cjs");
|
|
3
|
+
exports.BodyFallbackPlugin = require_plugins.BodyFallbackPlugin;
|
|
4
|
+
exports.ChineseToPinyinPlugin = require_plugins.ChineseToPinyinPlugin;
|
|
5
|
+
exports.CleanPlugin = require_plugins.CleanPlugin;
|
|
6
|
+
exports.DECLARATION_GENERATOR = require_plugins.DECLARATION_GENERATOR;
|
|
7
|
+
exports.DownloadHttpFilePlugin = require_plugins.DownloadHttpFilePlugin;
|
|
8
|
+
exports.DownloadLocalFilePlugin = require_plugins.DownloadLocalFilePlugin;
|
|
9
|
+
exports.EslintPlugin = require_plugins.EslintPlugin;
|
|
10
|
+
exports.GenerateDeclarationPlugin = require_plugins.GenerateDeclarationPlugin;
|
|
11
|
+
exports.GenerateMicroFunctionPlugin = require_plugins.GenerateMicroFunctionPlugin;
|
|
12
|
+
exports.GenerateNestjsModulePlugin = require_plugins.GenerateNestjsModulePlugin;
|
|
13
|
+
exports.InitializePlugin = require_plugins.InitializePlugin;
|
|
14
|
+
exports.LintSchemaPlugin = require_plugins.LintSchemaPlugin;
|
|
15
|
+
exports.MICRO_FUNCTION_GENERATOR = require_plugins.MICRO_FUNCTION_GENERATOR;
|
|
16
|
+
exports.MICRO_FUNCTION_REQUEST_GENERATOR = require_plugins.MICRO_FUNCTION_REQUEST_GENERATOR;
|
|
17
|
+
exports.MicroFunctionGenerator = require_plugins.MicroFunctionGenerator;
|
|
18
|
+
exports.MockPlugin = require_plugins.MockPlugin;
|
|
19
|
+
exports.NestjsModuleGenerator = require_plugins.NestjsModuleGenerator;
|
|
20
|
+
exports.OPERATION_GENERATOR = require_plugins.OPERATION_GENERATOR;
|
|
21
|
+
exports.OperationDeclarationGenerator = require_plugins.OperationDeclarationGenerator;
|
|
22
|
+
exports.OverwriteAdditionalPropertiesPlugin = require_plugins.OverwriteAdditionalPropertiesPlugin;
|
|
23
|
+
exports.OverwriteOperationIdPlugin = require_plugins.OverwriteOperationIdPlugin;
|
|
24
|
+
exports.OverwriteQueryOptionsPlugin = require_plugins.OverwriteQueryOptionsPlugin;
|
|
25
|
+
exports.OverwriteSchemaNamePlugin = require_plugins.OverwriteSchemaNamePlugin;
|
|
26
|
+
exports.PrettierPlugin = require_plugins.PrettierPlugin;
|
|
27
|
+
exports.RESPONSE_GENERATOR = require_plugins.RESPONSE_GENERATOR;
|
|
28
|
+
exports.RequestGenerator = require_plugins.RequestGenerator;
|
|
29
|
+
exports.ResponseDeclarationGenerator = require_plugins.ResponseDeclarationGenerator;
|
|
30
|
+
exports.SCHEMA_GENERATOR = require_plugins.SCHEMA_GENERATOR;
|
|
31
|
+
exports.SchemaDeclarationGenerator = require_plugins.SchemaDeclarationGenerator;
|
|
32
|
+
exports.ShakingPlugin = require_plugins.ShakingPlugin;
|
|
33
|
+
exports.SpringdocCompatPlugin = require_plugins.SpringdocCompatPlugin;
|
|
34
|
+
exports.TerminalSelectPlugin = require_plugins.TerminalSelectPlugin;
|
|
35
|
+
exports.USE_VALIBOT = require_plugins.USE_VALIBOT;
|
|
36
|
+
exports.UseValibotPlugin = require_plugins.UseValibotPlugin;
|