@kubb/agent 5.0.0-alpha.34 → 5.0.0-alpha.36
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/.output/nitro.json +1 -1
- package/.output/server/chunks/nitro/nitro.mjs +1790 -20812
- package/.output/server/chunks/nitro/nitro.mjs.map +1 -1
- package/.output/server/chunks/routes/api/health.get.mjs +16 -14
- package/.output/server/chunks/routes/api/health.get.mjs.map +1 -1
- package/.output/server/index.mjs +16 -14
- package/.output/server/index.mjs.map +1 -1
- package/.output/server/node_modules/.nitro/ws@8.18.0/lib/constants.js +18 -0
- package/.output/server/node_modules/.nitro/ws@8.18.0/lib/permessage-deflate.js +514 -0
- package/.output/server/node_modules/.nitro/ws@8.18.0/lib/sender.js +602 -0
- package/.output/server/node_modules/.nitro/ws@8.18.0/lib/stream.js +159 -0
- package/.output/server/node_modules/.nitro/ws@8.18.0/lib/websocket-server.js +540 -0
- package/.output/server/node_modules/.nitro/ws@8.18.0/lib/websocket.js +1388 -0
- package/.output/server/node_modules/.nitro/ws@8.18.0/package.json +69 -0
- package/.output/server/node_modules/.nitro/ws@8.18.0/wrapper.mjs +8 -0
- package/.output/server/node_modules/.nitro/ws@8.20.0/lib/buffer-util.js +131 -0
- package/.output/server/node_modules/.nitro/ws@8.20.0/lib/event-target.js +292 -0
- package/.output/server/node_modules/.nitro/ws@8.20.0/lib/extension.js +203 -0
- package/.output/server/node_modules/.nitro/ws@8.20.0/lib/limiter.js +55 -0
- package/.output/server/node_modules/.nitro/ws@8.20.0/lib/receiver.js +706 -0
- package/.output/server/node_modules/.nitro/ws@8.20.0/lib/subprotocol.js +62 -0
- package/.output/server/node_modules/.nitro/ws@8.20.0/lib/validation.js +152 -0
- package/.output/server/node_modules/@clack/core/dist/index.mjs +11 -0
- package/.output/server/node_modules/@clack/core/package.json +60 -0
- package/.output/server/node_modules/@clack/prompts/dist/index.mjs +137 -0
- package/.output/server/node_modules/@clack/prompts/package.json +65 -0
- package/.output/server/node_modules/@kubb/ast/dist/chunk--u3MIqq1.js +8 -0
- package/.output/server/node_modules/@kubb/ast/dist/index.js +423 -0
- package/.output/server/node_modules/@kubb/ast/package.json +70 -0
- package/.output/server/node_modules/@kubb/core/dist/chunk--u3MIqq1.js +8 -0
- package/.output/server/node_modules/@kubb/core/dist/hooks.js +23 -0
- package/.output/server/node_modules/@kubb/core/dist/index.js +2311 -0
- package/.output/server/node_modules/@kubb/core/package.json +109 -0
- package/.output/server/node_modules/@kubb/fabric-core/dist/chunk-O_arW02_.js +17 -0
- package/.output/server/node_modules/@kubb/fabric-core/dist/defaultParser-iCpMSYCp.js +15 -0
- package/.output/server/node_modules/@kubb/fabric-core/dist/getRelativePath-NAm_Y-vp.js +55 -0
- package/.output/server/node_modules/@kubb/fabric-core/dist/index.js +653 -0
- package/.output/server/node_modules/@kubb/fabric-core/dist/onProcessExit-Cput7j2c.js +742 -0
- package/.output/server/node_modules/@kubb/fabric-core/dist/parsers/typescript.js +101 -0
- package/.output/server/node_modules/@kubb/fabric-core/dist/parsers.js +17 -0
- package/.output/server/node_modules/@kubb/fabric-core/dist/plugins.js +375 -0
- package/.output/server/node_modules/@kubb/fabric-core/package.json +111 -0
- package/.output/server/node_modules/@kubb/oas/dist/chunk--u3MIqq1.js +8 -0
- package/.output/server/node_modules/@kubb/oas/dist/index.js +918 -0
- package/.output/server/node_modules/@kubb/oas/package.json +94 -0
- package/.output/server/node_modules/@kubb/plugin-client/dist/StaticClassClient-bCe7RG_w.js +636 -0
- package/.output/server/node_modules/@kubb/plugin-client/dist/chunk--u3MIqq1.js +8 -0
- package/.output/server/node_modules/@kubb/plugin-client/dist/components.js +2 -0
- package/.output/server/node_modules/@kubb/plugin-client/dist/generators-BffddRNu.js +723 -0
- package/.output/server/node_modules/@kubb/plugin-client/dist/index.js +124 -0
- package/.output/server/node_modules/@kubb/plugin-client/dist/templates/clients/axios.source.js +6 -0
- package/.output/server/node_modules/@kubb/plugin-client/dist/templates/clients/fetch.source.js +6 -0
- package/.output/server/node_modules/@kubb/plugin-client/dist/templates/config.source.js +6 -0
- package/.output/server/node_modules/@kubb/plugin-client/package.json +153 -0
- package/.output/server/node_modules/@kubb/plugin-cypress/dist/chunk--u3MIqq1.js +8 -0
- package/.output/server/node_modules/@kubb/plugin-cypress/dist/components-BK_6GU4v.js +257 -0
- package/.output/server/node_modules/@kubb/plugin-cypress/dist/generators-D5YFtyyC.js +71 -0
- package/.output/server/node_modules/@kubb/plugin-cypress/dist/index.js +79 -0
- package/.output/server/node_modules/@kubb/plugin-cypress/package.json +108 -0
- package/.output/server/node_modules/@kubb/plugin-faker/dist/chunk--u3MIqq1.js +8 -0
- package/.output/server/node_modules/@kubb/plugin-faker/dist/components-BkBIov4R.js +419 -0
- package/.output/server/node_modules/@kubb/plugin-faker/dist/fakerGenerator-BztogaeO.js +200 -0
- package/.output/server/node_modules/@kubb/plugin-faker/dist/index.js +141 -0
- package/.output/server/node_modules/@kubb/plugin-faker/package.json +103 -0
- package/.output/server/node_modules/@kubb/plugin-mcp/dist/Server-H3SwqhwF.js +178 -0
- package/.output/server/node_modules/@kubb/plugin-mcp/dist/chunk--u3MIqq1.js +8 -0
- package/.output/server/node_modules/@kubb/plugin-mcp/dist/generators-BqkMrcs9.js +274 -0
- package/.output/server/node_modules/@kubb/plugin-mcp/dist/index.js +122 -0
- package/.output/server/node_modules/@kubb/plugin-mcp/package.json +107 -0
- package/.output/server/node_modules/@kubb/plugin-msw/dist/chunk--u3MIqq1.js +8 -0
- package/.output/server/node_modules/@kubb/plugin-msw/dist/components-DgtTZkWX.js +277 -0
- package/.output/server/node_modules/@kubb/plugin-msw/dist/generators-C34kqa1L.js +161 -0
- package/.output/server/node_modules/@kubb/plugin-msw/dist/index.js +84 -0
- package/.output/server/node_modules/@kubb/plugin-msw/package.json +109 -0
- package/.output/server/node_modules/@kubb/plugin-oas/dist/SchemaMapper-CqMkO2T1.js +58 -0
- package/.output/server/node_modules/@kubb/plugin-oas/dist/chunk--u3MIqq1.js +8 -0
- package/.output/server/node_modules/@kubb/plugin-oas/dist/generators-D7C3CXsN.js +79 -0
- package/.output/server/node_modules/@kubb/plugin-oas/dist/generators.js +2 -0
- package/.output/server/node_modules/@kubb/plugin-oas/dist/getFooter-Pw3tLCiV.js +112 -0
- package/.output/server/node_modules/@kubb/plugin-oas/dist/hooks.js +200 -0
- package/.output/server/node_modules/@kubb/plugin-oas/dist/index.js +408 -0
- package/.output/server/node_modules/@kubb/plugin-oas/dist/requestBody-pRavthCw.js +1336 -0
- package/.output/server/node_modules/@kubb/plugin-oas/dist/utils.js +268 -0
- package/.output/server/node_modules/@kubb/plugin-oas/package.json +122 -0
- package/.output/server/node_modules/@kubb/plugin-react-query/dist/chunk--u3MIqq1.js +8 -0
- package/.output/server/node_modules/@kubb/plugin-react-query/dist/components-CpyHYGOw.js +1520 -0
- package/.output/server/node_modules/@kubb/plugin-react-query/dist/generators-CpiBv5eE.js +1427 -0
- package/.output/server/node_modules/@kubb/plugin-react-query/dist/index.js +166 -0
- package/.output/server/node_modules/@kubb/plugin-react-query/package.json +112 -0
- package/.output/server/node_modules/@kubb/plugin-redoc/dist/chunk--u3MIqq1.js +8 -0
- package/.output/server/node_modules/@kubb/plugin-redoc/dist/index.js +65 -0
- package/.output/server/node_modules/@kubb/plugin-redoc/package.json +85 -0
- package/.output/server/node_modules/@kubb/plugin-redoc/static/redoc.hbs +22 -0
- package/.output/server/node_modules/@kubb/plugin-solid-query/dist/chunk--u3MIqq1.js +8 -0
- package/.output/server/node_modules/@kubb/plugin-solid-query/dist/components-BhStIi1M.js +665 -0
- package/.output/server/node_modules/@kubb/plugin-solid-query/dist/generators-CQClzsST.js +415 -0
- package/.output/server/node_modules/@kubb/plugin-solid-query/dist/index.js +145 -0
- package/.output/server/node_modules/@kubb/plugin-solid-query/package.json +113 -0
- package/.output/server/node_modules/@kubb/plugin-svelte-query/dist/chunk--u3MIqq1.js +8 -0
- package/.output/server/node_modules/@kubb/plugin-svelte-query/dist/components-DntKBsnB.js +666 -0
- package/.output/server/node_modules/@kubb/plugin-svelte-query/dist/generators-BtTsGGrM.js +414 -0
- package/.output/server/node_modules/@kubb/plugin-svelte-query/dist/index.js +145 -0
- package/.output/server/node_modules/@kubb/plugin-svelte-query/package.json +113 -0
- package/.output/server/node_modules/@kubb/plugin-swr/dist/chunk--u3MIqq1.js +8 -0
- package/.output/server/node_modules/@kubb/plugin-swr/dist/components-DRDGvgXG.js +702 -0
- package/.output/server/node_modules/@kubb/plugin-swr/dist/generators-ClWZJ-YG.js +399 -0
- package/.output/server/node_modules/@kubb/plugin-swr/dist/index.js +144 -0
- package/.output/server/node_modules/@kubb/plugin-swr/package.json +115 -0
- package/.output/server/node_modules/@kubb/plugin-ts/dist/chunk--u3MIqq1.js +8 -0
- package/.output/server/node_modules/@kubb/plugin-ts/dist/components-C7fu-sK1.js +723 -0
- package/.output/server/node_modules/@kubb/plugin-ts/dist/index.js +2 -0
- package/.output/server/node_modules/@kubb/plugin-ts/dist/plugin-CYC-FGXe.js +479 -0
- package/.output/server/node_modules/@kubb/plugin-ts/package.json +105 -0
- package/.output/server/node_modules/@kubb/plugin-vue-query/dist/chunk--u3MIqq1.js +8 -0
- package/.output/server/node_modules/@kubb/plugin-vue-query/dist/components-_AMBl0g-.js +1029 -0
- package/.output/server/node_modules/@kubb/plugin-vue-query/dist/generators-Zb1s5Wmb.js +661 -0
- package/.output/server/node_modules/@kubb/plugin-vue-query/dist/index.js +157 -0
- package/.output/server/node_modules/@kubb/plugin-vue-query/package.json +114 -0
- package/.output/server/node_modules/@kubb/plugin-zod/dist/chunk--u3MIqq1.js +8 -0
- package/.output/server/node_modules/@kubb/plugin-zod/dist/components-eECfXVou.js +842 -0
- package/.output/server/node_modules/@kubb/plugin-zod/dist/generators-D1R6NNf2.js +290 -0
- package/.output/server/node_modules/@kubb/plugin-zod/dist/index.js +175 -0
- package/.output/server/node_modules/@kubb/plugin-zod/dist/templates/ToZod.source.js +6 -0
- package/.output/server/node_modules/@kubb/plugin-zod/package.json +112 -0
- package/.output/server/node_modules/@kubb/react-fabric/dist/chunk-BGCRLu6H.js +38 -0
- package/.output/server/node_modules/@kubb/react-fabric/dist/index.js +525 -0
- package/.output/server/node_modules/@kubb/react-fabric/dist/jsx-runtime-Bl0DfUmV.js +1448 -0
- package/.output/server/node_modules/@kubb/react-fabric/dist/jsx-runtime.js +12 -0
- package/.output/server/node_modules/@kubb/react-fabric/dist/parsers.js +2 -0
- package/.output/server/node_modules/@kubb/react-fabric/dist/plugins.js +4 -0
- package/.output/server/node_modules/@kubb/react-fabric/dist/reactPlugin-QQPrjNuQ.js +17813 -0
- package/.output/server/node_modules/@kubb/react-fabric/package.json +143 -0
- package/.output/server/node_modules/@redocly/config/lib/root-config-schema.js +11 -1
- package/.output/server/node_modules/@redocly/config/package.json +1 -1
- package/.output/server/node_modules/@redocly/openapi-core/lib/bundle/bundle-document.js +25 -10
- package/.output/server/node_modules/@redocly/openapi-core/lib/bundle/bundle-visitor.js +32 -29
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/config.js +5 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/oas2/index.js +1 -1
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/oas2/remove-unused-components.js +47 -38
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/oas3/index.js +1 -1
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/oas3/remove-unused-components.js +45 -41
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-http-verbs-in-paths.js +3 -1
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-required-schema-properties-undefined.js +41 -55
- package/.output/server/node_modules/@redocly/openapi-core/lib/walk.js +28 -16
- package/.output/server/node_modules/@redocly/openapi-core/package.json +2 -2
- package/.output/server/node_modules/buffer-from/index.js +72 -0
- package/.output/server/node_modules/buffer-from/package.json +19 -0
- package/.output/server/node_modules/fast-string-truncated-width/dist/index.js +171 -0
- package/.output/server/node_modules/fast-string-truncated-width/dist/utils.js +15 -0
- package/.output/server/node_modules/fast-string-truncated-width/package.json +35 -0
- package/.output/server/node_modules/fast-string-width/dist/index.js +14 -0
- package/.output/server/node_modules/fast-string-width/package.json +34 -0
- package/.output/server/node_modules/fast-wrap-ansi/lib/main.js +216 -0
- package/.output/server/node_modules/fast-wrap-ansi/package.json +51 -0
- package/.output/server/node_modules/p-limit/index.js +127 -0
- package/.output/server/node_modules/p-limit/package.json +58 -0
- package/.output/server/node_modules/react-devtools-core/dist/backend.js +18302 -0
- package/.output/server/node_modules/react-devtools-core/package.json +38 -0
- package/.output/server/node_modules/sisteransi/package.json +34 -0
- package/.output/server/node_modules/sisteransi/src/index.js +58 -0
- package/.output/server/node_modules/source-map-support/package.json +31 -0
- package/.output/server/node_modules/source-map-support/source-map-support.js +625 -0
- package/.output/server/node_modules/typescript/lib/typescript.js +200276 -0
- package/.output/server/node_modules/typescript/package.json +120 -0
- package/.output/server/node_modules/yocto-queue/index.js +90 -0
- package/.output/server/node_modules/yocto-queue/package.json +48 -0
- package/.output/server/package.json +35 -4
- package/package.json +20 -20
- /package/.output/server/node_modules/{ws → .nitro/ws@8.18.0}/lib/buffer-util.js +0 -0
- /package/.output/server/node_modules/{ws → .nitro/ws@8.18.0}/lib/event-target.js +0 -0
- /package/.output/server/node_modules/{ws → .nitro/ws@8.18.0}/lib/extension.js +0 -0
- /package/.output/server/node_modules/{ws → .nitro/ws@8.18.0}/lib/limiter.js +0 -0
- /package/.output/server/node_modules/{ws → .nitro/ws@8.18.0}/lib/receiver.js +0 -0
- /package/.output/server/node_modules/{ws → .nitro/ws@8.18.0}/lib/subprotocol.js +0 -0
- /package/.output/server/node_modules/{ws → .nitro/ws@8.18.0}/lib/validation.js +0 -0
- /package/.output/server/node_modules/{ws → .nitro/ws@8.20.0}/lib/constants.js +0 -0
- /package/.output/server/node_modules/{ws → .nitro/ws@8.20.0}/lib/permessage-deflate.js +0 -0
- /package/.output/server/node_modules/{ws → .nitro/ws@8.20.0}/lib/sender.js +0 -0
- /package/.output/server/node_modules/{ws → .nitro/ws@8.20.0}/lib/stream.js +0 -0
- /package/.output/server/node_modules/{ws → .nitro/ws@8.20.0}/lib/websocket-server.js +0 -0
- /package/.output/server/node_modules/{ws → .nitro/ws@8.20.0}/lib/websocket.js +0 -0
- /package/.output/server/node_modules/{ws → .nitro/ws@8.20.0}/package.json +0 -0
- /package/.output/server/node_modules/{ws → .nitro/ws@8.20.0}/wrapper.mjs +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nitro.mjs","sources":["../../../../../../node_modules/.pnpm/destr@2.0.5/node_modules/destr/dist/index.mjs","../../../../../../node_modules/.pnpm/ufo@1.6.3/node_modules/ufo/dist/index.mjs","../../../../../../node_modules/.pnpm/radix3@1.1.2/node_modules/radix3/dist/index.mjs","../../../../../../node_modules/.pnpm/defu@6.1.7/node_modules/defu/dist/defu.mjs","../../../../../../node_modules/.pnpm/node-mock-http@1.0.4/node_modules/node-mock-http/dist/index.mjs","../../../../../../node_modules/.pnpm/h3@1.15.11/node_modules/h3/dist/index.mjs","../../../../../../node_modules/.pnpm/hookable@5.5.3/node_modules/hookable/dist/index.mjs","../../../../../../node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/native.mjs","../../../../../../node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/shared/ofetch.CWycOUEr.mjs","../../../../../../node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/node.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.5_db0@0.3.4_ioredis@5.10.1/node_modules/unstorage/dist/shared/unstorage.zVDD2mZo.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.5_db0@0.3.4_ioredis@5.10.1/node_modules/unstorage/dist/index.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.5_db0@0.3.4_ioredis@5.10.1/node_modules/unstorage/drivers/utils/index.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.5_db0@0.3.4_ioredis@5.10.1/node_modules/unstorage/drivers/utils/node-fs.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.5_db0@0.3.4_ioredis@5.10.1/node_modules/unstorage/drivers/fs.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.5_db0@0.3.4_ioredis@5.10.1/node_modules/unstorage/drivers/fs-lite.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.
|
|
1
|
+
{"version":3,"file":"nitro.mjs","sources":["../../../../../../node_modules/.pnpm/destr@2.0.5/node_modules/destr/dist/index.mjs","../../../../../../node_modules/.pnpm/ufo@1.6.3/node_modules/ufo/dist/index.mjs","../../../../../../node_modules/.pnpm/radix3@1.1.2/node_modules/radix3/dist/index.mjs","../../../../../../node_modules/.pnpm/defu@6.1.7/node_modules/defu/dist/defu.mjs","../../../../../../node_modules/.pnpm/node-mock-http@1.0.4/node_modules/node-mock-http/dist/index.mjs","../../../../../../node_modules/.pnpm/h3@1.15.11/node_modules/h3/dist/index.mjs","../../../../../../node_modules/.pnpm/hookable@5.5.3/node_modules/hookable/dist/index.mjs","../../../../../../node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/native.mjs","../../../../../../node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/shared/ofetch.CWycOUEr.mjs","../../../../../../node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/node.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.5_db0@0.3.4_ioredis@5.10.1/node_modules/unstorage/dist/shared/unstorage.zVDD2mZo.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.5_db0@0.3.4_ioredis@5.10.1/node_modules/unstorage/dist/index.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.5_db0@0.3.4_ioredis@5.10.1/node_modules/unstorage/drivers/utils/index.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.5_db0@0.3.4_ioredis@5.10.1/node_modules/unstorage/drivers/utils/node-fs.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.5_db0@0.3.4_ioredis@5.10.1/node_modules/unstorage/drivers/fs.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.5_db0@0.3.4_ioredis@5.10.1/node_modules/unstorage/drivers/fs-lite.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.16/node_modules/nitropack/dist/runtime/internal/storage.mjs","../../../../../../node_modules/.pnpm/ohash@2.0.11/node_modules/ohash/dist/crypto/node/index.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.16/node_modules/nitropack/dist/runtime/internal/hash.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.16/node_modules/nitropack/dist/runtime/internal/cache.mjs","../../../../../../node_modules/.pnpm/klona@2.0.6/node_modules/klona/dist/index.mjs","../../../../../../node_modules/.pnpm/scule@1.3.0/node_modules/scule/dist/index.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.16/node_modules/nitropack/dist/runtime/internal/utils.env.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.16/node_modules/nitropack/dist/runtime/internal/config.mjs","../../../../../../node_modules/.pnpm/unctx@2.5.0/node_modules/unctx/dist/index.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.16/node_modules/nitropack/dist/runtime/internal/context.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.16/node_modules/nitropack/dist/runtime/internal/route-rules.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.16/node_modules/nitropack/dist/runtime/internal/utils.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.16/node_modules/nitropack/dist/runtime/internal/error/utils.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.16/node_modules/nitropack/dist/runtime/internal/error/prod.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.16/node_modules/nitropack/dist/runtime/internal/plugin.mjs","../../../../server/utils/logger.ts","../../../../server/plugins/fetch-logger.ts","../../../../../../internals/utils/dist/index.js","../../../../server/plugins/heartbeat.ts","../../../../server/utils/token.ts","../../../../server/utils/api.ts","../../../../../core/dist/chunk--u3MIqq1.js","../../../../../ast/dist/index.js","../../../../../core/dist/PluginDriver-B_65W4fv.js","../../../../../core/dist/index.js","../../../../server/types/agent.ts","../../../../server/utils/agentCache.ts","../../../../server/utils/executeHooks.ts","../../../../server/utils/generate.ts","../../../../server/utils/getCosmiConfig.ts","../../../../server/utils/loadConfig.ts","../../../../server/utils/resolvePlugins.ts","../../../../server/utils/mergePlugins.ts","../../../../server/utils/publish.ts","../../../../server/utils/setupHookListener.ts","../../../../server/utils/ws.ts","../../../../server/utils/connectStudio.ts","../../../../server/plugins/studio.ts","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.16/node_modules/nitropack/dist/runtime/internal/app.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.16/node_modules/nitropack/dist/runtime/internal/lib/http-graceful-shutdown.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.16/node_modules/nitropack/dist/runtime/internal/shutdown.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.16/node_modules/nitropack/dist/presets/node/runtime/node-server.mjs"],"names":["createRouter","f","h","i","l","createError","mergeHeaders","s","nodeFetch","Headers","Headers$1","AbortController$1","normalizeKey","defineDriver","DRIVER_NAME","createStorage","fsPromises","PATH_TRAVERSE_RE","fsp","_inlineAppConfig","createRadixRouter","formatMs","_a","process","__defProp","trimExtName","path","exports","_b","_c","_d","__publicField","__privateAdd","__privateGet","__privateSet","resolve","extname","__privateMethod","readFile","writeFile","match","build","walk","readdir","version","item","_e","error","nitroApp","callNodeRequestHandler","fetchNodeRequestHandler","gracefulShutdown","HttpsServer","HttpServer"],"mappings":"","x_google_ignoreList":[0,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,54,55,56,57]}
|
|
@@ -14,25 +14,27 @@ import 'node:crypto';
|
|
|
14
14
|
import 'node:process';
|
|
15
15
|
import '@logtail/node';
|
|
16
16
|
import 'consola';
|
|
17
|
-
import 'node:fs/promises';
|
|
18
17
|
import 'node:perf_hooks';
|
|
19
18
|
import 'fflate';
|
|
20
19
|
import 'tinyexec';
|
|
21
|
-
import '
|
|
22
|
-
import 'remeda';
|
|
20
|
+
import 'node:fs/promises';
|
|
23
21
|
import 'node:util';
|
|
24
22
|
import 'jiti';
|
|
25
|
-
import '
|
|
26
|
-
import '
|
|
27
|
-
import '
|
|
28
|
-
import '
|
|
29
|
-
import '@
|
|
30
|
-
import '@
|
|
31
|
-
import 'oas
|
|
32
|
-
import '
|
|
33
|
-
import '
|
|
34
|
-
import '
|
|
35
|
-
import '
|
|
23
|
+
import 'remeda';
|
|
24
|
+
import '@kubb/plugin-client';
|
|
25
|
+
import '@kubb/plugin-cypress';
|
|
26
|
+
import '@kubb/plugin-faker';
|
|
27
|
+
import '@kubb/plugin-mcp';
|
|
28
|
+
import '@kubb/plugin-msw';
|
|
29
|
+
import '@kubb/plugin-oas';
|
|
30
|
+
import '@kubb/plugin-react-query';
|
|
31
|
+
import '@kubb/plugin-redoc';
|
|
32
|
+
import '@kubb/plugin-solid-query';
|
|
33
|
+
import '@kubb/plugin-svelte-query';
|
|
34
|
+
import '@kubb/plugin-swr';
|
|
35
|
+
import '@kubb/plugin-ts';
|
|
36
|
+
import '@kubb/plugin-vue-query';
|
|
37
|
+
import '@kubb/plugin-zod';
|
|
36
38
|
import 'ws';
|
|
37
39
|
|
|
38
40
|
const health_get = defineEventHandler(() => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"health.get.mjs","sources":["../../../../../server/routes/api/health.get.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"health.get.mjs","sources":["../../../../../server/routes/api/health.get.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CAAA,CAAA,CACA;AACA,CAAA,CAAA;;"}
|
package/.output/server/index.mjs
CHANGED
|
@@ -14,24 +14,26 @@ import 'node:crypto';
|
|
|
14
14
|
import 'node:process';
|
|
15
15
|
import '@logtail/node';
|
|
16
16
|
import 'consola';
|
|
17
|
-
import 'node:fs/promises';
|
|
18
17
|
import 'node:perf_hooks';
|
|
19
18
|
import 'fflate';
|
|
20
19
|
import 'tinyexec';
|
|
21
|
-
import '
|
|
22
|
-
import 'remeda';
|
|
20
|
+
import 'node:fs/promises';
|
|
23
21
|
import 'node:util';
|
|
24
22
|
import 'jiti';
|
|
25
|
-
import '
|
|
26
|
-
import '
|
|
27
|
-
import '
|
|
28
|
-
import '
|
|
29
|
-
import '@
|
|
30
|
-
import '@
|
|
31
|
-
import 'oas
|
|
32
|
-
import '
|
|
33
|
-
import '
|
|
34
|
-
import '
|
|
35
|
-
import '
|
|
23
|
+
import 'remeda';
|
|
24
|
+
import '@kubb/plugin-client';
|
|
25
|
+
import '@kubb/plugin-cypress';
|
|
26
|
+
import '@kubb/plugin-faker';
|
|
27
|
+
import '@kubb/plugin-mcp';
|
|
28
|
+
import '@kubb/plugin-msw';
|
|
29
|
+
import '@kubb/plugin-oas';
|
|
30
|
+
import '@kubb/plugin-react-query';
|
|
31
|
+
import '@kubb/plugin-redoc';
|
|
32
|
+
import '@kubb/plugin-solid-query';
|
|
33
|
+
import '@kubb/plugin-svelte-query';
|
|
34
|
+
import '@kubb/plugin-swr';
|
|
35
|
+
import '@kubb/plugin-ts';
|
|
36
|
+
import '@kubb/plugin-vue-query';
|
|
37
|
+
import '@kubb/plugin-zod';
|
|
36
38
|
import 'ws';
|
|
37
39
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const BINARY_TYPES = ['nodebuffer', 'arraybuffer', 'fragments'];
|
|
4
|
+
const hasBlob = typeof Blob !== 'undefined';
|
|
5
|
+
|
|
6
|
+
if (hasBlob) BINARY_TYPES.push('blob');
|
|
7
|
+
|
|
8
|
+
module.exports = {
|
|
9
|
+
BINARY_TYPES,
|
|
10
|
+
EMPTY_BUFFER: Buffer.alloc(0),
|
|
11
|
+
GUID: '258EAFA5-E914-47DA-95CA-C5AB0DC85B11',
|
|
12
|
+
hasBlob,
|
|
13
|
+
kForOnEventAttribute: Symbol('kIsForOnEventAttribute'),
|
|
14
|
+
kListener: Symbol('kListener'),
|
|
15
|
+
kStatusCode: Symbol('status-code'),
|
|
16
|
+
kWebSocket: Symbol('websocket'),
|
|
17
|
+
NOOP: () => {}
|
|
18
|
+
};
|
|
@@ -0,0 +1,514 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const zlib = require('zlib');
|
|
4
|
+
|
|
5
|
+
const bufferUtil = require('./buffer-util');
|
|
6
|
+
const Limiter = require('./limiter');
|
|
7
|
+
const { kStatusCode } = require('./constants');
|
|
8
|
+
|
|
9
|
+
const FastBuffer = Buffer[Symbol.species];
|
|
10
|
+
const TRAILER = Buffer.from([0x00, 0x00, 0xff, 0xff]);
|
|
11
|
+
const kPerMessageDeflate = Symbol('permessage-deflate');
|
|
12
|
+
const kTotalLength = Symbol('total-length');
|
|
13
|
+
const kCallback = Symbol('callback');
|
|
14
|
+
const kBuffers = Symbol('buffers');
|
|
15
|
+
const kError = Symbol('error');
|
|
16
|
+
|
|
17
|
+
//
|
|
18
|
+
// We limit zlib concurrency, which prevents severe memory fragmentation
|
|
19
|
+
// as documented in https://github.com/nodejs/node/issues/8871#issuecomment-250915913
|
|
20
|
+
// and https://github.com/websockets/ws/issues/1202
|
|
21
|
+
//
|
|
22
|
+
// Intentionally global; it's the global thread pool that's an issue.
|
|
23
|
+
//
|
|
24
|
+
let zlibLimiter;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* permessage-deflate implementation.
|
|
28
|
+
*/
|
|
29
|
+
class PerMessageDeflate {
|
|
30
|
+
/**
|
|
31
|
+
* Creates a PerMessageDeflate instance.
|
|
32
|
+
*
|
|
33
|
+
* @param {Object} [options] Configuration options
|
|
34
|
+
* @param {(Boolean|Number)} [options.clientMaxWindowBits] Advertise support
|
|
35
|
+
* for, or request, a custom client window size
|
|
36
|
+
* @param {Boolean} [options.clientNoContextTakeover=false] Advertise/
|
|
37
|
+
* acknowledge disabling of client context takeover
|
|
38
|
+
* @param {Number} [options.concurrencyLimit=10] The number of concurrent
|
|
39
|
+
* calls to zlib
|
|
40
|
+
* @param {(Boolean|Number)} [options.serverMaxWindowBits] Request/confirm the
|
|
41
|
+
* use of a custom server window size
|
|
42
|
+
* @param {Boolean} [options.serverNoContextTakeover=false] Request/accept
|
|
43
|
+
* disabling of server context takeover
|
|
44
|
+
* @param {Number} [options.threshold=1024] Size (in bytes) below which
|
|
45
|
+
* messages should not be compressed if context takeover is disabled
|
|
46
|
+
* @param {Object} [options.zlibDeflateOptions] Options to pass to zlib on
|
|
47
|
+
* deflate
|
|
48
|
+
* @param {Object} [options.zlibInflateOptions] Options to pass to zlib on
|
|
49
|
+
* inflate
|
|
50
|
+
* @param {Boolean} [isServer=false] Create the instance in either server or
|
|
51
|
+
* client mode
|
|
52
|
+
* @param {Number} [maxPayload=0] The maximum allowed message length
|
|
53
|
+
*/
|
|
54
|
+
constructor(options, isServer, maxPayload) {
|
|
55
|
+
this._maxPayload = maxPayload | 0;
|
|
56
|
+
this._options = options || {};
|
|
57
|
+
this._threshold =
|
|
58
|
+
this._options.threshold !== undefined ? this._options.threshold : 1024;
|
|
59
|
+
this._isServer = !!isServer;
|
|
60
|
+
this._deflate = null;
|
|
61
|
+
this._inflate = null;
|
|
62
|
+
|
|
63
|
+
this.params = null;
|
|
64
|
+
|
|
65
|
+
if (!zlibLimiter) {
|
|
66
|
+
const concurrency =
|
|
67
|
+
this._options.concurrencyLimit !== undefined
|
|
68
|
+
? this._options.concurrencyLimit
|
|
69
|
+
: 10;
|
|
70
|
+
zlibLimiter = new Limiter(concurrency);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* @type {String}
|
|
76
|
+
*/
|
|
77
|
+
static get extensionName() {
|
|
78
|
+
return 'permessage-deflate';
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Create an extension negotiation offer.
|
|
83
|
+
*
|
|
84
|
+
* @return {Object} Extension parameters
|
|
85
|
+
* @public
|
|
86
|
+
*/
|
|
87
|
+
offer() {
|
|
88
|
+
const params = {};
|
|
89
|
+
|
|
90
|
+
if (this._options.serverNoContextTakeover) {
|
|
91
|
+
params.server_no_context_takeover = true;
|
|
92
|
+
}
|
|
93
|
+
if (this._options.clientNoContextTakeover) {
|
|
94
|
+
params.client_no_context_takeover = true;
|
|
95
|
+
}
|
|
96
|
+
if (this._options.serverMaxWindowBits) {
|
|
97
|
+
params.server_max_window_bits = this._options.serverMaxWindowBits;
|
|
98
|
+
}
|
|
99
|
+
if (this._options.clientMaxWindowBits) {
|
|
100
|
+
params.client_max_window_bits = this._options.clientMaxWindowBits;
|
|
101
|
+
} else if (this._options.clientMaxWindowBits == null) {
|
|
102
|
+
params.client_max_window_bits = true;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
return params;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Accept an extension negotiation offer/response.
|
|
110
|
+
*
|
|
111
|
+
* @param {Array} configurations The extension negotiation offers/reponse
|
|
112
|
+
* @return {Object} Accepted configuration
|
|
113
|
+
* @public
|
|
114
|
+
*/
|
|
115
|
+
accept(configurations) {
|
|
116
|
+
configurations = this.normalizeParams(configurations);
|
|
117
|
+
|
|
118
|
+
this.params = this._isServer
|
|
119
|
+
? this.acceptAsServer(configurations)
|
|
120
|
+
: this.acceptAsClient(configurations);
|
|
121
|
+
|
|
122
|
+
return this.params;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Releases all resources used by the extension.
|
|
127
|
+
*
|
|
128
|
+
* @public
|
|
129
|
+
*/
|
|
130
|
+
cleanup() {
|
|
131
|
+
if (this._inflate) {
|
|
132
|
+
this._inflate.close();
|
|
133
|
+
this._inflate = null;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
if (this._deflate) {
|
|
137
|
+
const callback = this._deflate[kCallback];
|
|
138
|
+
|
|
139
|
+
this._deflate.close();
|
|
140
|
+
this._deflate = null;
|
|
141
|
+
|
|
142
|
+
if (callback) {
|
|
143
|
+
callback(
|
|
144
|
+
new Error(
|
|
145
|
+
'The deflate stream was closed while data was being processed'
|
|
146
|
+
)
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Accept an extension negotiation offer.
|
|
154
|
+
*
|
|
155
|
+
* @param {Array} offers The extension negotiation offers
|
|
156
|
+
* @return {Object} Accepted configuration
|
|
157
|
+
* @private
|
|
158
|
+
*/
|
|
159
|
+
acceptAsServer(offers) {
|
|
160
|
+
const opts = this._options;
|
|
161
|
+
const accepted = offers.find((params) => {
|
|
162
|
+
if (
|
|
163
|
+
(opts.serverNoContextTakeover === false &&
|
|
164
|
+
params.server_no_context_takeover) ||
|
|
165
|
+
(params.server_max_window_bits &&
|
|
166
|
+
(opts.serverMaxWindowBits === false ||
|
|
167
|
+
(typeof opts.serverMaxWindowBits === 'number' &&
|
|
168
|
+
opts.serverMaxWindowBits > params.server_max_window_bits))) ||
|
|
169
|
+
(typeof opts.clientMaxWindowBits === 'number' &&
|
|
170
|
+
!params.client_max_window_bits)
|
|
171
|
+
) {
|
|
172
|
+
return false;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
return true;
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
if (!accepted) {
|
|
179
|
+
throw new Error('None of the extension offers can be accepted');
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
if (opts.serverNoContextTakeover) {
|
|
183
|
+
accepted.server_no_context_takeover = true;
|
|
184
|
+
}
|
|
185
|
+
if (opts.clientNoContextTakeover) {
|
|
186
|
+
accepted.client_no_context_takeover = true;
|
|
187
|
+
}
|
|
188
|
+
if (typeof opts.serverMaxWindowBits === 'number') {
|
|
189
|
+
accepted.server_max_window_bits = opts.serverMaxWindowBits;
|
|
190
|
+
}
|
|
191
|
+
if (typeof opts.clientMaxWindowBits === 'number') {
|
|
192
|
+
accepted.client_max_window_bits = opts.clientMaxWindowBits;
|
|
193
|
+
} else if (
|
|
194
|
+
accepted.client_max_window_bits === true ||
|
|
195
|
+
opts.clientMaxWindowBits === false
|
|
196
|
+
) {
|
|
197
|
+
delete accepted.client_max_window_bits;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
return accepted;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Accept the extension negotiation response.
|
|
205
|
+
*
|
|
206
|
+
* @param {Array} response The extension negotiation response
|
|
207
|
+
* @return {Object} Accepted configuration
|
|
208
|
+
* @private
|
|
209
|
+
*/
|
|
210
|
+
acceptAsClient(response) {
|
|
211
|
+
const params = response[0];
|
|
212
|
+
|
|
213
|
+
if (
|
|
214
|
+
this._options.clientNoContextTakeover === false &&
|
|
215
|
+
params.client_no_context_takeover
|
|
216
|
+
) {
|
|
217
|
+
throw new Error('Unexpected parameter "client_no_context_takeover"');
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
if (!params.client_max_window_bits) {
|
|
221
|
+
if (typeof this._options.clientMaxWindowBits === 'number') {
|
|
222
|
+
params.client_max_window_bits = this._options.clientMaxWindowBits;
|
|
223
|
+
}
|
|
224
|
+
} else if (
|
|
225
|
+
this._options.clientMaxWindowBits === false ||
|
|
226
|
+
(typeof this._options.clientMaxWindowBits === 'number' &&
|
|
227
|
+
params.client_max_window_bits > this._options.clientMaxWindowBits)
|
|
228
|
+
) {
|
|
229
|
+
throw new Error(
|
|
230
|
+
'Unexpected or invalid parameter "client_max_window_bits"'
|
|
231
|
+
);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
return params;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* Normalize parameters.
|
|
239
|
+
*
|
|
240
|
+
* @param {Array} configurations The extension negotiation offers/reponse
|
|
241
|
+
* @return {Array} The offers/response with normalized parameters
|
|
242
|
+
* @private
|
|
243
|
+
*/
|
|
244
|
+
normalizeParams(configurations) {
|
|
245
|
+
configurations.forEach((params) => {
|
|
246
|
+
Object.keys(params).forEach((key) => {
|
|
247
|
+
let value = params[key];
|
|
248
|
+
|
|
249
|
+
if (value.length > 1) {
|
|
250
|
+
throw new Error(`Parameter "${key}" must have only a single value`);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
value = value[0];
|
|
254
|
+
|
|
255
|
+
if (key === 'client_max_window_bits') {
|
|
256
|
+
if (value !== true) {
|
|
257
|
+
const num = +value;
|
|
258
|
+
if (!Number.isInteger(num) || num < 8 || num > 15) {
|
|
259
|
+
throw new TypeError(
|
|
260
|
+
`Invalid value for parameter "${key}": ${value}`
|
|
261
|
+
);
|
|
262
|
+
}
|
|
263
|
+
value = num;
|
|
264
|
+
} else if (!this._isServer) {
|
|
265
|
+
throw new TypeError(
|
|
266
|
+
`Invalid value for parameter "${key}": ${value}`
|
|
267
|
+
);
|
|
268
|
+
}
|
|
269
|
+
} else if (key === 'server_max_window_bits') {
|
|
270
|
+
const num = +value;
|
|
271
|
+
if (!Number.isInteger(num) || num < 8 || num > 15) {
|
|
272
|
+
throw new TypeError(
|
|
273
|
+
`Invalid value for parameter "${key}": ${value}`
|
|
274
|
+
);
|
|
275
|
+
}
|
|
276
|
+
value = num;
|
|
277
|
+
} else if (
|
|
278
|
+
key === 'client_no_context_takeover' ||
|
|
279
|
+
key === 'server_no_context_takeover'
|
|
280
|
+
) {
|
|
281
|
+
if (value !== true) {
|
|
282
|
+
throw new TypeError(
|
|
283
|
+
`Invalid value for parameter "${key}": ${value}`
|
|
284
|
+
);
|
|
285
|
+
}
|
|
286
|
+
} else {
|
|
287
|
+
throw new Error(`Unknown parameter "${key}"`);
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
params[key] = value;
|
|
291
|
+
});
|
|
292
|
+
});
|
|
293
|
+
|
|
294
|
+
return configurations;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* Decompress data. Concurrency limited.
|
|
299
|
+
*
|
|
300
|
+
* @param {Buffer} data Compressed data
|
|
301
|
+
* @param {Boolean} fin Specifies whether or not this is the last fragment
|
|
302
|
+
* @param {Function} callback Callback
|
|
303
|
+
* @public
|
|
304
|
+
*/
|
|
305
|
+
decompress(data, fin, callback) {
|
|
306
|
+
zlibLimiter.add((done) => {
|
|
307
|
+
this._decompress(data, fin, (err, result) => {
|
|
308
|
+
done();
|
|
309
|
+
callback(err, result);
|
|
310
|
+
});
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* Compress data. Concurrency limited.
|
|
316
|
+
*
|
|
317
|
+
* @param {(Buffer|String)} data Data to compress
|
|
318
|
+
* @param {Boolean} fin Specifies whether or not this is the last fragment
|
|
319
|
+
* @param {Function} callback Callback
|
|
320
|
+
* @public
|
|
321
|
+
*/
|
|
322
|
+
compress(data, fin, callback) {
|
|
323
|
+
zlibLimiter.add((done) => {
|
|
324
|
+
this._compress(data, fin, (err, result) => {
|
|
325
|
+
done();
|
|
326
|
+
callback(err, result);
|
|
327
|
+
});
|
|
328
|
+
});
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
/**
|
|
332
|
+
* Decompress data.
|
|
333
|
+
*
|
|
334
|
+
* @param {Buffer} data Compressed data
|
|
335
|
+
* @param {Boolean} fin Specifies whether or not this is the last fragment
|
|
336
|
+
* @param {Function} callback Callback
|
|
337
|
+
* @private
|
|
338
|
+
*/
|
|
339
|
+
_decompress(data, fin, callback) {
|
|
340
|
+
const endpoint = this._isServer ? 'client' : 'server';
|
|
341
|
+
|
|
342
|
+
if (!this._inflate) {
|
|
343
|
+
const key = `${endpoint}_max_window_bits`;
|
|
344
|
+
const windowBits =
|
|
345
|
+
typeof this.params[key] !== 'number'
|
|
346
|
+
? zlib.Z_DEFAULT_WINDOWBITS
|
|
347
|
+
: this.params[key];
|
|
348
|
+
|
|
349
|
+
this._inflate = zlib.createInflateRaw({
|
|
350
|
+
...this._options.zlibInflateOptions,
|
|
351
|
+
windowBits
|
|
352
|
+
});
|
|
353
|
+
this._inflate[kPerMessageDeflate] = this;
|
|
354
|
+
this._inflate[kTotalLength] = 0;
|
|
355
|
+
this._inflate[kBuffers] = [];
|
|
356
|
+
this._inflate.on('error', inflateOnError);
|
|
357
|
+
this._inflate.on('data', inflateOnData);
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
this._inflate[kCallback] = callback;
|
|
361
|
+
|
|
362
|
+
this._inflate.write(data);
|
|
363
|
+
if (fin) this._inflate.write(TRAILER);
|
|
364
|
+
|
|
365
|
+
this._inflate.flush(() => {
|
|
366
|
+
const err = this._inflate[kError];
|
|
367
|
+
|
|
368
|
+
if (err) {
|
|
369
|
+
this._inflate.close();
|
|
370
|
+
this._inflate = null;
|
|
371
|
+
callback(err);
|
|
372
|
+
return;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
const data = bufferUtil.concat(
|
|
376
|
+
this._inflate[kBuffers],
|
|
377
|
+
this._inflate[kTotalLength]
|
|
378
|
+
);
|
|
379
|
+
|
|
380
|
+
if (this._inflate._readableState.endEmitted) {
|
|
381
|
+
this._inflate.close();
|
|
382
|
+
this._inflate = null;
|
|
383
|
+
} else {
|
|
384
|
+
this._inflate[kTotalLength] = 0;
|
|
385
|
+
this._inflate[kBuffers] = [];
|
|
386
|
+
|
|
387
|
+
if (fin && this.params[`${endpoint}_no_context_takeover`]) {
|
|
388
|
+
this._inflate.reset();
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
callback(null, data);
|
|
393
|
+
});
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
/**
|
|
397
|
+
* Compress data.
|
|
398
|
+
*
|
|
399
|
+
* @param {(Buffer|String)} data Data to compress
|
|
400
|
+
* @param {Boolean} fin Specifies whether or not this is the last fragment
|
|
401
|
+
* @param {Function} callback Callback
|
|
402
|
+
* @private
|
|
403
|
+
*/
|
|
404
|
+
_compress(data, fin, callback) {
|
|
405
|
+
const endpoint = this._isServer ? 'server' : 'client';
|
|
406
|
+
|
|
407
|
+
if (!this._deflate) {
|
|
408
|
+
const key = `${endpoint}_max_window_bits`;
|
|
409
|
+
const windowBits =
|
|
410
|
+
typeof this.params[key] !== 'number'
|
|
411
|
+
? zlib.Z_DEFAULT_WINDOWBITS
|
|
412
|
+
: this.params[key];
|
|
413
|
+
|
|
414
|
+
this._deflate = zlib.createDeflateRaw({
|
|
415
|
+
...this._options.zlibDeflateOptions,
|
|
416
|
+
windowBits
|
|
417
|
+
});
|
|
418
|
+
|
|
419
|
+
this._deflate[kTotalLength] = 0;
|
|
420
|
+
this._deflate[kBuffers] = [];
|
|
421
|
+
|
|
422
|
+
this._deflate.on('data', deflateOnData);
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
this._deflate[kCallback] = callback;
|
|
426
|
+
|
|
427
|
+
this._deflate.write(data);
|
|
428
|
+
this._deflate.flush(zlib.Z_SYNC_FLUSH, () => {
|
|
429
|
+
if (!this._deflate) {
|
|
430
|
+
//
|
|
431
|
+
// The deflate stream was closed while data was being processed.
|
|
432
|
+
//
|
|
433
|
+
return;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
let data = bufferUtil.concat(
|
|
437
|
+
this._deflate[kBuffers],
|
|
438
|
+
this._deflate[kTotalLength]
|
|
439
|
+
);
|
|
440
|
+
|
|
441
|
+
if (fin) {
|
|
442
|
+
data = new FastBuffer(data.buffer, data.byteOffset, data.length - 4);
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
//
|
|
446
|
+
// Ensure that the callback will not be called again in
|
|
447
|
+
// `PerMessageDeflate#cleanup()`.
|
|
448
|
+
//
|
|
449
|
+
this._deflate[kCallback] = null;
|
|
450
|
+
|
|
451
|
+
this._deflate[kTotalLength] = 0;
|
|
452
|
+
this._deflate[kBuffers] = [];
|
|
453
|
+
|
|
454
|
+
if (fin && this.params[`${endpoint}_no_context_takeover`]) {
|
|
455
|
+
this._deflate.reset();
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
callback(null, data);
|
|
459
|
+
});
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
module.exports = PerMessageDeflate;
|
|
464
|
+
|
|
465
|
+
/**
|
|
466
|
+
* The listener of the `zlib.DeflateRaw` stream `'data'` event.
|
|
467
|
+
*
|
|
468
|
+
* @param {Buffer} chunk A chunk of data
|
|
469
|
+
* @private
|
|
470
|
+
*/
|
|
471
|
+
function deflateOnData(chunk) {
|
|
472
|
+
this[kBuffers].push(chunk);
|
|
473
|
+
this[kTotalLength] += chunk.length;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
/**
|
|
477
|
+
* The listener of the `zlib.InflateRaw` stream `'data'` event.
|
|
478
|
+
*
|
|
479
|
+
* @param {Buffer} chunk A chunk of data
|
|
480
|
+
* @private
|
|
481
|
+
*/
|
|
482
|
+
function inflateOnData(chunk) {
|
|
483
|
+
this[kTotalLength] += chunk.length;
|
|
484
|
+
|
|
485
|
+
if (
|
|
486
|
+
this[kPerMessageDeflate]._maxPayload < 1 ||
|
|
487
|
+
this[kTotalLength] <= this[kPerMessageDeflate]._maxPayload
|
|
488
|
+
) {
|
|
489
|
+
this[kBuffers].push(chunk);
|
|
490
|
+
return;
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
this[kError] = new RangeError('Max payload size exceeded');
|
|
494
|
+
this[kError].code = 'WS_ERR_UNSUPPORTED_MESSAGE_LENGTH';
|
|
495
|
+
this[kError][kStatusCode] = 1009;
|
|
496
|
+
this.removeListener('data', inflateOnData);
|
|
497
|
+
this.reset();
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
/**
|
|
501
|
+
* The listener of the `zlib.InflateRaw` stream `'error'` event.
|
|
502
|
+
*
|
|
503
|
+
* @param {Error} err The emitted error
|
|
504
|
+
* @private
|
|
505
|
+
*/
|
|
506
|
+
function inflateOnError(err) {
|
|
507
|
+
//
|
|
508
|
+
// There is no need to call `Zlib#close()` as the handle is automatically
|
|
509
|
+
// closed when an error is emitted.
|
|
510
|
+
//
|
|
511
|
+
this[kPerMessageDeflate]._inflate = null;
|
|
512
|
+
err[kStatusCode] = 1007;
|
|
513
|
+
this[kCallback](err);
|
|
514
|
+
}
|