@kubb/agent 4.29.0 → 4.31.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/.output/nitro.json +1 -1
- package/.output/server/chunks/nitro/nitro.mjs +509 -345
- package/.output/server/chunks/nitro/nitro.mjs.map +1 -1
- package/.output/server/chunks/routes/api/health.get.mjs +3 -1
- package/.output/server/chunks/routes/api/health.get.mjs.map +1 -1
- package/.output/server/index.mjs +3 -1
- package/.output/server/index.mjs.map +1 -1
- package/.output/server/node_modules/@kubb/fabric-core/dist/index.js +6 -3
- package/.output/server/node_modules/@kubb/fabric-core/dist/{onProcessExit-CF200hsz.js → onProcessExit-B0rJqX4s.js} +7 -1
- package/.output/server/node_modules/@kubb/fabric-core/dist/plugins.js +1 -1
- package/.output/server/node_modules/@kubb/fabric-core/package.json +1 -1
- package/.output/server/node_modules/@kubb/react-fabric/dist/index.js +1 -1
- package/.output/server/node_modules/@kubb/react-fabric/dist/plugins.js +1 -1
- package/.output/server/node_modules/@kubb/react-fabric/dist/{reactPlugin-BkDkx1cs.js → reactPlugin-tE73eBS_.js} +5 -1
- package/.output/server/node_modules/@kubb/react-fabric/package.json +2 -2
- package/.output/server/node_modules/@logtail/core/dist/cjs/base.js +339 -0
- package/.output/server/node_modules/@logtail/core/dist/cjs/index.js +9 -0
- package/.output/server/node_modules/@logtail/core/package.json +45 -0
- package/.output/server/node_modules/@logtail/node/dist/cjs/context.js +93 -0
- package/.output/server/node_modules/@logtail/node/dist/cjs/index.js +6 -0
- package/.output/server/node_modules/@logtail/node/dist/cjs/node.js +106 -0
- package/.output/server/node_modules/@logtail/node/package.json +53 -0
- package/.output/server/node_modules/@logtail/tools/dist/cjs/batch.js +122 -0
- package/.output/server/node_modules/@logtail/tools/dist/cjs/burstProtection.js +50 -0
- package/.output/server/node_modules/@logtail/tools/dist/cjs/encode.js +12 -0
- package/.output/server/node_modules/@logtail/tools/dist/cjs/index.js +41 -0
- package/.output/server/node_modules/@logtail/tools/dist/cjs/queue.js +41 -0
- package/.output/server/node_modules/@logtail/tools/dist/cjs/throttle.js +67 -0
- package/.output/server/node_modules/@logtail/tools/package.json +39 -0
- package/.output/server/node_modules/@logtail/types/dist/cjs/types.js +21 -0
- package/.output/server/node_modules/@logtail/types/package.json +45 -0
- package/.output/server/node_modules/@msgpack/msgpack/dist/CachedKeyDecoder.js +63 -0
- package/.output/server/node_modules/@msgpack/msgpack/dist/DecodeError.js +18 -0
- package/.output/server/node_modules/@msgpack/msgpack/dist/Decoder.js +583 -0
- package/.output/server/node_modules/@msgpack/msgpack/dist/Encoder.js +408 -0
- package/.output/server/node_modules/@msgpack/msgpack/dist/ExtData.js +14 -0
- package/.output/server/node_modules/@msgpack/msgpack/dist/ExtensionCodec.js +72 -0
- package/.output/server/node_modules/@msgpack/msgpack/dist/decode.js +32 -0
- package/.output/server/node_modules/@msgpack/msgpack/dist/decodeAsync.js +44 -0
- package/.output/server/node_modules/@msgpack/msgpack/dist/encode.js +17 -0
- package/.output/server/node_modules/@msgpack/msgpack/dist/index.js +34 -0
- package/.output/server/node_modules/@msgpack/msgpack/dist/timestamp.js +104 -0
- package/.output/server/node_modules/@msgpack/msgpack/dist/utils/int.js +34 -0
- package/.output/server/node_modules/@msgpack/msgpack/dist/utils/prettyByte.js +8 -0
- package/.output/server/node_modules/@msgpack/msgpack/dist/utils/stream.js +40 -0
- package/.output/server/node_modules/@msgpack/msgpack/dist/utils/typedArrays.js +28 -0
- package/.output/server/node_modules/@msgpack/msgpack/dist/utils/utf8.js +167 -0
- package/.output/server/node_modules/@msgpack/msgpack/package.json +100 -0
- package/.output/server/node_modules/consola/dist/chunks/prompt.mjs +280 -0
- package/.output/server/node_modules/consola/dist/core.mjs +512 -0
- package/.output/server/node_modules/consola/dist/index.mjs +651 -0
- package/.output/server/node_modules/consola/dist/shared/consola.DRwqZj3T.mjs +72 -0
- package/.output/server/node_modules/consola/dist/shared/consola.DXBYu-KD.mjs +288 -0
- package/.output/server/node_modules/consola/package.json +136 -0
- package/.output/server/node_modules/serialize-error/index.js +154 -0
- package/.output/server/node_modules/serialize-error/package.json +41 -0
- package/.output/server/node_modules/stack-trace/lib/stack-trace.js +136 -0
- package/.output/server/node_modules/stack-trace/package.json +21 -0
- package/.output/server/package.json +11 -3
- package/README.md +3 -3
- package/package.json +23 -18
|
@@ -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.4/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.5/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.4_db0@0.3.4_ioredis@5.9.3/node_modules/unstorage/dist/shared/unstorage.zVDD2mZo.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.4_db0@0.3.4_ioredis@5.9.3/node_modules/unstorage/dist/index.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.4_db0@0.3.4_ioredis@5.9.3/node_modules/unstorage/drivers/utils/index.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.4_db0@0.3.4_ioredis@5.9.3/node_modules/unstorage/drivers/utils/node-fs.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.4_db0@0.3.4_ioredis@5.9.3/node_modules/unstorage/drivers/fs.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.4_db0@0.3.4_ioredis@5.9.3/node_modules/unstorage/drivers/fs-lite.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.5/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.1_encoding@0.1.13_rolldown@1.0.0-rc.5/node_modules/nitropack/dist/runtime/internal/hash.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.5/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.1_encoding@0.1.13_rolldown@1.0.0-rc.5/node_modules/nitropack/dist/runtime/internal/utils.env.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.5/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.1_encoding@0.1.13_rolldown@1.0.0-rc.5/node_modules/nitropack/dist/runtime/internal/context.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.5/node_modules/nitropack/dist/runtime/internal/route-rules.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.5/node_modules/nitropack/dist/runtime/internal/utils.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.5/node_modules/nitropack/dist/runtime/internal/error/utils.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.5/node_modules/nitropack/dist/runtime/internal/error/prod.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.5/node_modules/nitropack/dist/runtime/internal/plugin.mjs","../../../../server/utils/logger.ts","../../../../server/plugins/fetch-logger.ts","../../../../../core/dist/write-DiGboRXI.js","../../../../../core/dist/toRegExp-DdJ1Kgbf.js","../../../../../core/dist/getBarrelFiles-BBDOJ2lV.js","../../../../../core/dist/utils.js","../../../../server/types/agent.ts","../../../../server/utils/getSessionKey.ts","../../../../server/utils/isSessionValid.ts","../../../../server/utils/token.ts","../../../../server/utils/api.ts","../../../../../core/dist/index.js","../../../../server/utils/executeHooks.ts","../../../../server/utils/generate.ts","../../../../server/utils/getCosmiConfig.ts","../../../../../plugin-client/dist/chunk-DKWOrOAv.js","../../../../../plugin-oas/dist/SchemaMapper-eQhTeFim.js","../../../../../core/dist/transformers.js","../../../../../oas/dist/chunk-Dxrv8gPv.js","../../../../../oas/dist/index.js","../../../../../plugin-oas/dist/requestBody-CdXEa4mn.js","../../../../../plugin-oas/dist/getFooter-_DD1dfMI.js","../../../../../plugin-oas/dist/utils.js","../../../../../plugin-client/dist/StaticClassClient-DGIMTS_f.js","../../../../../plugin-oas/dist/jsonGenerator-Df2dxdof.js","../../../../../plugin-oas/dist/index.js","../../../../../plugin-zod/dist/Zod-GzH2I46C.js","../../../../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/typescript.js","../../../../../plugin-ts/dist/Type-BoBgmIn8.js","../../../../../core/dist/hooks.js","../../../../../plugin-oas/dist/hooks.js","../../../../../plugin-ts/dist/plugin-C9N8VJcy.js","../../../../../plugin-zod/dist/zodGenerator-DomjELrZ.js","../../../../../plugin-zod/dist/templates/ToZod.source.js","../../../../../plugin-zod/dist/index.js","../../../../../plugin-client/dist/staticClassClientGenerator-BUGBMkNO.js","../../../../../plugin-client/dist/templates/clients/axios.source.js","../../../../../plugin-client/dist/templates/clients/fetch.source.js","../../../../../plugin-client/dist/templates/config.source.js","../../../../../plugin-client/dist/index.js","../../../../../plugin-cypress/dist/Request-DOzOQGgb.js","../../../../../plugin-cypress/dist/cypressGenerator-D7trA-II.js","../../../../../plugin-cypress/dist/index.js","../../../../../plugin-faker/dist/Faker-DNAO-21W.js","../../../../../plugin-faker/dist/fakerGenerator-1hLpeTbP.js","../../../../../plugin-faker/dist/index.js","../../../../../plugin-mcp/dist/Server-D3kNei96.js","../../../../../plugin-mcp/dist/serverGenerator-DfxZTxke.js","../../../../../plugin-mcp/dist/index.js","../../../../../plugin-msw/dist/Response-rq32ZXGn.js","../../../../../plugin-msw/dist/mswGenerator-Tg2NjhsD.js","../../../../../plugin-msw/dist/index.js","../../../../../plugin-react-query/dist/chunk-DKWOrOAv.js","../../../../../plugin-react-query/dist/SuspenseQuery-BFn3x1kP.js","../../../../../plugin-react-query/dist/suspenseQueryGenerator-BjEGcQcE.js","../../../../../plugin-react-query/dist/index.js","../../../../../plugin-redoc/dist/index.js","../../../../../plugin-solid-query/dist/chunk-DKWOrOAv.js","../../../../../plugin-solid-query/dist/Query-BhN2yEs9.js","../../../../../plugin-solid-query/dist/queryGenerator-DUGiYuBy.js","../../../../../plugin-solid-query/dist/index.js","../../../../../plugin-svelte-query/dist/chunk-DKWOrOAv.js","../../../../../plugin-svelte-query/dist/Query-DFUKLByK.js","../../../../../plugin-svelte-query/dist/queryGenerator-C775F9UI.js","../../../../../plugin-svelte-query/dist/index.js","../../../../../plugin-swr/dist/chunk-DKWOrOAv.js","../../../../../plugin-swr/dist/Query-DDIFmxNc.js","../../../../../plugin-swr/dist/queryGenerator-CEsWWhOe.js","../../../../../plugin-swr/dist/index.js","../../../../../plugin-vue-query/dist/chunk-DKWOrOAv.js","../../../../../plugin-vue-query/dist/Query-4nkhGb9c.js","../../../../../plugin-vue-query/dist/queryGenerator-gk8pNl_4.js","../../../../../plugin-vue-query/dist/index.js","../../../../server/utils/resolvePlugins.ts","../../../../server/utils/studioConfig.ts","../../../../server/utils/ws.ts","../../../../server/plugins/studio.ts","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.5/node_modules/nitropack/dist/runtime/internal/app.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.5/node_modules/nitropack/dist/runtime/internal/lib/http-graceful-shutdown.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.5/node_modules/nitropack/dist/runtime/internal/shutdown.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.5/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","stringify","normalizeKey","defineDriver","DRIVER_NAME","fsPromises","PATH_TRAVERSE_RE","fsp","snakeCase","_inlineAppConfig","createRadixRouter","readFile","writeFile","value","_head","_tail","_size","_a","_options","_b","Node","__publicField","Queue","__privateAdd","__privateGet","__privateSet","__privateWrapper","pLimit","validateConcurrency","path","__privateMethod","performance","_c","_d","_e","_f","item","trimExtName","os","version","build","error","process","__defProp","__name","v","d","b","__assign","o","exports","Kind","YAMLException","string","ScalarType","Comments","isPlainObject","parse","schema","schemas","transformers","normalizedSchema","name","min","max","getParams$1","Function","getParams","Operations","validate","oas","options","Type","siblings","require","global","modifiers","questionToken","propertyName","operationsGenerator","source","baseURL","source$2","Response","getTransformer$1","QueryKey","getParams$9","QueryOptions","getParams$8","InfiniteQuery","getParams$7","InfiniteQueryOptions","getParams$6","getTransformer","MutationKey","getParams$5","getParams$4","Mutation","getParams$3","Query","getParams$2","operations","fs","infiniteQueryGenerator","mutationGenerator","queryGenerator","__filename","__dirname","pkg","params","generics","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,58,108,109,110,111]}
|
|
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.4/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.5/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.4_db0@0.3.4_ioredis@5.9.3/node_modules/unstorage/dist/shared/unstorage.zVDD2mZo.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.4_db0@0.3.4_ioredis@5.9.3/node_modules/unstorage/dist/index.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.4_db0@0.3.4_ioredis@5.9.3/node_modules/unstorage/drivers/utils/index.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.4_db0@0.3.4_ioredis@5.9.3/node_modules/unstorage/drivers/utils/node-fs.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.4_db0@0.3.4_ioredis@5.9.3/node_modules/unstorage/drivers/fs.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.4_db0@0.3.4_ioredis@5.9.3/node_modules/unstorage/drivers/fs-lite.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.6/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.1_encoding@0.1.13_rolldown@1.0.0-rc.6/node_modules/nitropack/dist/runtime/internal/hash.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.6/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.1_encoding@0.1.13_rolldown@1.0.0-rc.6/node_modules/nitropack/dist/runtime/internal/utils.env.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.6/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.1_encoding@0.1.13_rolldown@1.0.0-rc.6/node_modules/nitropack/dist/runtime/internal/context.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.6/node_modules/nitropack/dist/runtime/internal/route-rules.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.6/node_modules/nitropack/dist/runtime/internal/utils.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.6/node_modules/nitropack/dist/runtime/internal/error/utils.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.6/node_modules/nitropack/dist/runtime/internal/error/prod.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.6/node_modules/nitropack/dist/runtime/internal/plugin.mjs","../../../../server/utils/logger.ts","../../../../server/plugins/fetch-logger.ts","../../../../server/utils/maskedString.ts","../../../../server/plugins/heartbeat.ts","../../../../server/utils/agentCache.ts","../../../../server/utils/token.ts","../../../../server/utils/api.ts","../../../../../core/dist/write-pEo2oQGI.js","../../../../../core/dist/toRegExp-DdJ1Kgbf.js","../../../../../core/dist/packageManager-B6NiaZeW.js","../../../../../core/dist/utils.js","../../../../server/types/agent.ts","../../../../../core/dist/index.js","../../../../server/utils/executeHooks.ts","../../../../server/utils/generate.ts","../../../../server/utils/getCosmiConfig.ts","../../../../server/utils/loadConfig.ts","../../../../../plugin-client/dist/chunk-DKWOrOAv.js","../../../../../plugin-oas/dist/SchemaMapper-eQhTeFim.js","../../../../../core/dist/transformers.js","../../../../../oas/dist/chunk-Dxrv8gPv.js","../../../../../oas/dist/index.js","../../../../../plugin-oas/dist/requestBody-CJhU4lwJ.js","../../../../../plugin-oas/dist/getFooter-_DD1dfMI.js","../../../../../plugin-oas/dist/utils.js","../../../../../plugin-client/dist/StaticClassClient-DGIMTS_f.js","../../../../../plugin-oas/dist/jsonGenerator-Df2dxdof.js","../../../../../plugin-oas/dist/index.js","../../../../../plugin-zod/dist/Zod-GzH2I46C.js","../../../../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/typescript.js","../../../../../plugin-ts/dist/Type-BoBgmIn8.js","../../../../../core/dist/hooks.js","../../../../../plugin-oas/dist/hooks.js","../../../../../plugin-ts/dist/plugin-DxNrETHn.js","../../../../../plugin-zod/dist/zodGenerator-DomjELrZ.js","../../../../../plugin-zod/dist/templates/ToZod.source.js","../../../../../plugin-zod/dist/index.js","../../../../../plugin-client/dist/staticClassClientGenerator-BUGBMkNO.js","../../../../../plugin-client/dist/templates/clients/axios.source.js","../../../../../plugin-client/dist/templates/clients/fetch.source.js","../../../../../plugin-client/dist/templates/config.source.js","../../../../../plugin-client/dist/index.js","../../../../../plugin-cypress/dist/Request-DOzOQGgb.js","../../../../../plugin-cypress/dist/cypressGenerator-D7trA-II.js","../../../../../plugin-cypress/dist/index.js","../../../../../plugin-faker/dist/Faker-DNAO-21W.js","../../../../../plugin-faker/dist/fakerGenerator-1hLpeTbP.js","../../../../../plugin-faker/dist/index.js","../../../../../plugin-mcp/dist/Server-D3kNei96.js","../../../../../plugin-mcp/dist/serverGenerator-DfxZTxke.js","../../../../../plugin-mcp/dist/index.js","../../../../../plugin-msw/dist/Response-rq32ZXGn.js","../../../../../plugin-msw/dist/mswGenerator-Tg2NjhsD.js","../../../../../plugin-msw/dist/index.js","../../../../../plugin-react-query/dist/chunk-DKWOrOAv.js","../../../../../plugin-react-query/dist/SuspenseQuery-BFn3x1kP.js","../../../../../plugin-react-query/dist/suspenseQueryGenerator-DJeXy1-j.js","../../../../../plugin-react-query/dist/index.js","../../../../../plugin-redoc/dist/index.js","../../../../../plugin-solid-query/dist/chunk-DKWOrOAv.js","../../../../../plugin-solid-query/dist/Query-BhN2yEs9.js","../../../../../plugin-solid-query/dist/queryGenerator-CHciiu3o.js","../../../../../plugin-solid-query/dist/index.js","../../../../../plugin-svelte-query/dist/chunk-DKWOrOAv.js","../../../../../plugin-svelte-query/dist/Query-DFUKLByK.js","../../../../../plugin-svelte-query/dist/queryGenerator-Cz7Up0dL.js","../../../../../plugin-svelte-query/dist/index.js","../../../../../plugin-swr/dist/chunk-DKWOrOAv.js","../../../../../plugin-swr/dist/Query-DDIFmxNc.js","../../../../../plugin-swr/dist/queryGenerator-96wr4Uxr.js","../../../../../plugin-swr/dist/index.js","../../../../../plugin-vue-query/dist/chunk-DKWOrOAv.js","../../../../../plugin-vue-query/dist/Query-4nkhGb9c.js","../../../../../plugin-vue-query/dist/queryGenerator-Da1vIMnD.js","../../../../../plugin-vue-query/dist/index.js","../../../../server/utils/resolvePlugins.ts","../../../../server/utils/mergePlugins.ts","../../../../server/utils/setupHookListener.ts","../../../../server/utils/ws.ts","../../../../server/utils/connectStudio.ts","../../../../server/plugins/studio.ts","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.6/node_modules/nitropack/dist/runtime/internal/app.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.6/node_modules/nitropack/dist/runtime/internal/lib/http-graceful-shutdown.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.6/node_modules/nitropack/dist/runtime/internal/shutdown.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.6/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","stringify","normalizeKey","defineDriver","DRIVER_NAME","fsPromises","PATH_TRAVERSE_RE","fsp","snakeCase","_inlineAppConfig","createRadixRouter","process","readFile","writeFile","value","_head","_tail","_size","_a","_options","_b","Node","__publicField","Queue","__privateAdd","__privateGet","__privateSet","__privateWrapper","pLimit","validateConcurrency","path","__privateMethod","performance","_c","_d","_e","_f","item","trimExtName","version","build","os","error","__defProp","__name","v","d","b","__assign","o","exports","Kind","YAMLException","string","ScalarType","Comments","isPlainObject","parse","schema","schemas","transformers","normalizedSchema","name","min","max","getParams$1","Function","getParams","Operations","validate","oas","options","Type","siblings","require","global","modifiers","questionToken","propertyName","operationsGenerator","source","baseURL","source$2","Response","getTransformer$1","QueryKey","getParams$9","QueryOptions","getParams$8","InfiniteQuery","getParams$7","InfiniteQueryOptions","getParams$6","getTransformer","MutationKey","getParams$5","getParams$4","Mutation","getParams$3","Query","getParams$2","operations","fs","infiniteQueryGenerator","mutationGenerator","queryGenerator","__filename","__dirname","pkg","params","generics","index","maskedSessionKey","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,60,112,113,114,115]}
|
|
@@ -12,9 +12,10 @@ import 'node:path';
|
|
|
12
12
|
import 'anymatch';
|
|
13
13
|
import 'node:crypto';
|
|
14
14
|
import 'node:process';
|
|
15
|
+
import '@logtail/node';
|
|
16
|
+
import 'consola';
|
|
15
17
|
import 'remeda';
|
|
16
18
|
import 'tinyexec';
|
|
17
|
-
import 'node:os';
|
|
18
19
|
import 'node:util';
|
|
19
20
|
import 'node:fs/promises';
|
|
20
21
|
import 'node:perf_hooks';
|
|
@@ -22,6 +23,7 @@ import 'node:module';
|
|
|
22
23
|
import '@kubb/react-fabric';
|
|
23
24
|
import '@kubb/react-fabric/parsers';
|
|
24
25
|
import '@kubb/react-fabric/plugins';
|
|
26
|
+
import 'node:os';
|
|
25
27
|
import 'node:url';
|
|
26
28
|
import 'empathic/package';
|
|
27
29
|
import 'semver';
|
|
@@ -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
|
@@ -12,9 +12,10 @@ import 'node:path';
|
|
|
12
12
|
import 'anymatch';
|
|
13
13
|
import 'node:crypto';
|
|
14
14
|
import 'node:process';
|
|
15
|
+
import '@logtail/node';
|
|
16
|
+
import 'consola';
|
|
15
17
|
import 'remeda';
|
|
16
18
|
import 'tinyexec';
|
|
17
|
-
import 'node:os';
|
|
18
19
|
import 'node:util';
|
|
19
20
|
import 'node:fs/promises';
|
|
20
21
|
import 'node:perf_hooks';
|
|
@@ -22,6 +23,7 @@ import 'node:module';
|
|
|
22
23
|
import '@kubb/react-fabric';
|
|
23
24
|
import '@kubb/react-fabric/parsers';
|
|
24
25
|
import '@kubb/react-fabric/plugins';
|
|
26
|
+
import 'node:os';
|
|
25
27
|
import 'node:url';
|
|
26
28
|
import 'empathic/package';
|
|
27
29
|
import 'semver';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as provide, a as renderIndent, c as RootContext, d as FileProcessor, f as AsyncEventEmitter, g as inject, h as createContext, i as createIntrinsic, l as TreeNode, m as NodeTreeContext, n as Root, o as renderIntrinsic, p as createFile, r as createComponent, s as RenderContext, t as onProcessExit, u as FileManager, v as unprovide } from "./onProcessExit-
|
|
1
|
+
import { _ as provide, a as renderIndent, c as RootContext, d as FileProcessor, f as AsyncEventEmitter, g as inject, h as createContext, i as createIntrinsic, l as TreeNode, m as NodeTreeContext, n as Root, o as renderIntrinsic, p as createFile, r as createComponent, s as RenderContext, t as onProcessExit, u as FileManager, v as unprovide } from "./onProcessExit-B0rJqX4s.js";
|
|
2
2
|
import { t as getRelativePath } from "./getRelativePath-BcieQL5M.js";
|
|
3
3
|
import { createExport, createImport, print } from "./parsers/typescript.js";
|
|
4
4
|
import { isFunction } from "remeda";
|
|
@@ -628,10 +628,13 @@ function createFabric(config = { mode: "sequential" }) {
|
|
|
628
628
|
return fileManager.files;
|
|
629
629
|
},
|
|
630
630
|
async addFile(...files) {
|
|
631
|
-
|
|
631
|
+
fileManager.add(...files);
|
|
632
632
|
},
|
|
633
633
|
async upsertFile(...files) {
|
|
634
|
-
|
|
634
|
+
fileManager.upsert(...files);
|
|
635
|
+
},
|
|
636
|
+
unmount(_error) {
|
|
637
|
+
events.removeAll();
|
|
635
638
|
},
|
|
636
639
|
async use(pluginOrParser, ...options) {
|
|
637
640
|
if (pluginOrParser.type === "plugin") {
|
|
@@ -720,10 +720,15 @@ const SIGNALS = [
|
|
|
720
720
|
/**
|
|
721
721
|
* Register a callback to run when the process exits (via exit event or common signals).
|
|
722
722
|
* Returns an unsubscribe function.
|
|
723
|
+
*
|
|
724
|
+
* Dynamically adjusts `process.maxListeners` to avoid MaxListenersExceededWarning
|
|
725
|
+
* when multiple instances are created (e.g. in tests).
|
|
723
726
|
*/
|
|
724
727
|
function onProcessExit(callback) {
|
|
725
728
|
const exitHandler = (code) => callback(code);
|
|
726
729
|
const signalHandlers = /* @__PURE__ */ new Map();
|
|
730
|
+
const count = SIGNALS.length + 1;
|
|
731
|
+
process.setMaxListeners(process.getMaxListeners() + count);
|
|
727
732
|
for (const signal of SIGNALS) {
|
|
728
733
|
const handler = () => {
|
|
729
734
|
unsubscribe();
|
|
@@ -740,10 +745,11 @@ function onProcessExit(callback) {
|
|
|
740
745
|
function unsubscribe() {
|
|
741
746
|
process.removeListener("exit", exitHandler);
|
|
742
747
|
for (const [signal, handler] of signalHandlers) process.removeListener(signal, handler);
|
|
748
|
+
process.setMaxListeners(Math.max(process.getMaxListeners() - count, 0));
|
|
743
749
|
}
|
|
744
750
|
return unsubscribe;
|
|
745
751
|
}
|
|
746
752
|
|
|
747
753
|
//#endregion
|
|
748
754
|
export { provide as _, renderIndent as a, RootContext as c, FileProcessor as d, AsyncEventEmitter as f, inject as g, createContext as h, createIntrinsic as i, TreeNode as l, NodeTreeContext as m, Root as n, renderIntrinsic as o, createFile as p, createComponent as r, RenderContext as s, onProcessExit as t, FileManager as u, unprovide as v };
|
|
749
|
-
//# sourceMappingURL=onProcessExit-
|
|
755
|
+
//# sourceMappingURL=onProcessExit-B0rJqX4s.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { l as TreeNode, n as Root, p as createFile, t as onProcessExit } from "./onProcessExit-
|
|
1
|
+
import { l as TreeNode, n as Root, p as createFile, t as onProcessExit } from "./onProcessExit-B0rJqX4s.js";
|
|
2
2
|
import { t as getRelativePath } from "./getRelativePath-BcieQL5M.js";
|
|
3
3
|
import path, { dirname, relative, resolve } from "node:path";
|
|
4
4
|
import { rmSync } from "node:fs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubb/fabric-core",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.2",
|
|
4
4
|
"description": "Core functionality for Kubb's fabric - A language-agnostic toolkit providing the foundation for plugin-based code generation with TypeScript support",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"codegen",
|
|
@@ -2,7 +2,7 @@ import { i as __toESM } from "./chunk-Cnw5r_-A.js";
|
|
|
2
2
|
import { t as require_react } from "./react-D652OKii.js";
|
|
3
3
|
import "./jsx-runtime-Dm7PKVbc.js";
|
|
4
4
|
import { Fragment, jsx, jsxs } from "./jsx-runtime.js";
|
|
5
|
-
import { i as Root, n as Runtime, r as Renderer, t as reactPlugin } from "./reactPlugin-
|
|
5
|
+
import { i as Root, n as Runtime, r as Renderer, t as reactPlugin } from "./reactPlugin-tE73eBS_.js";
|
|
6
6
|
import { AppContext, FileContext, FileManager, FileProcessor, NodeTreeContext, RootContext, TreeNode, createContext, createFabric, createFabric as createFabric$1, createFile, createJSDoc, onProcessExit, provide, useApp, useContext, useContext as useContext$1, useFile, useFile as useFile$1, useFileManager, useLifecycle, useNodeTree } from "@kubb/fabric-core";
|
|
7
7
|
import { spawn } from "node:child_process";
|
|
8
8
|
import ws from "ws";
|
|
@@ -16681,6 +16681,10 @@ const reactPlugin = definePlugin({
|
|
|
16681
16681
|
},
|
|
16682
16682
|
async waitUntilExit() {
|
|
16683
16683
|
await runtime.waitUntilExit();
|
|
16684
|
+
},
|
|
16685
|
+
unmount(error) {
|
|
16686
|
+
runtime.unmount(error);
|
|
16687
|
+
ctx.removeAll();
|
|
16684
16688
|
}
|
|
16685
16689
|
};
|
|
16686
16690
|
}
|
|
@@ -16688,4 +16692,4 @@ const reactPlugin = definePlugin({
|
|
|
16688
16692
|
|
|
16689
16693
|
//#endregion
|
|
16690
16694
|
export { Root as i, Runtime as n, Renderer as r, reactPlugin as t };
|
|
16691
|
-
//# sourceMappingURL=reactPlugin-
|
|
16695
|
+
//# sourceMappingURL=reactPlugin-tE73eBS_.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubb/react-fabric",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.2",
|
|
4
4
|
"description": "React integration for Kubb's fabric - JSX runtime and component-based code generation with React reconciler for building type-safe generators",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -105,7 +105,7 @@
|
|
|
105
105
|
"react-devtools-core": "6.1.5",
|
|
106
106
|
"remeda": "^2.33.6",
|
|
107
107
|
"ws": "8.18.0",
|
|
108
|
-
"@kubb/fabric-core": "0.13.
|
|
108
|
+
"@kubb/fabric-core": "0.13.2"
|
|
109
109
|
},
|
|
110
110
|
"devDependencies": {
|
|
111
111
|
"@types/react": "^19.2.14",
|
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const types_1 = require("@logtail/types");
|
|
4
|
+
const tools_1 = require("@logtail/tools");
|
|
5
|
+
const serialize_error_1 = require("serialize-error");
|
|
6
|
+
// Set default options for Logtail
|
|
7
|
+
const defaultOptions = {
|
|
8
|
+
// Default sync endpoint (protocol + domain)
|
|
9
|
+
endpoint: "https://in.logs.betterstack.com",
|
|
10
|
+
// Maximum number of logs to sync in a single request to Better Stack
|
|
11
|
+
batchSize: 1000,
|
|
12
|
+
// Size of logs (in KiB) to trigger sync to Better Stack (0 to disable)
|
|
13
|
+
batchSizeKiB: 0,
|
|
14
|
+
// Max interval (in milliseconds) before a batch of logs proceeds to syncing
|
|
15
|
+
batchInterval: 1000,
|
|
16
|
+
// Maximum number of times to retry a failed sync request
|
|
17
|
+
retryCount: 3,
|
|
18
|
+
// Minimum number of milliseconds to wait before retrying a failed sync request
|
|
19
|
+
retryBackoff: 100,
|
|
20
|
+
// Maximum number of sync requests to make concurrently
|
|
21
|
+
syncMax: 5,
|
|
22
|
+
// Maximum number of sync requests that can be queued (-1 for unlimited queue)
|
|
23
|
+
syncQueuedMax: 100,
|
|
24
|
+
// Length of the checked window for logs burst protection in milliseconds (0 to disable)
|
|
25
|
+
burstProtectionMilliseconds: 5000,
|
|
26
|
+
// Maximum number of accepted logs in the specified time window (0 to disable)
|
|
27
|
+
burstProtectionMax: 10000,
|
|
28
|
+
// If true, errors when sending logs will be ignored
|
|
29
|
+
// Has precedence over throwExceptions
|
|
30
|
+
ignoreExceptions: false,
|
|
31
|
+
// If true, errors when sending logs will result in a thrown exception
|
|
32
|
+
throwExceptions: false,
|
|
33
|
+
// Maximum depth (number of attribute levels) of a context object
|
|
34
|
+
contextObjectMaxDepth: 50,
|
|
35
|
+
// Produce a warn log when context object max depth is reached
|
|
36
|
+
contextObjectMaxDepthWarn: true,
|
|
37
|
+
// Produce a warning when circular reference is found in context object
|
|
38
|
+
contextObjectCircularRefWarn: true,
|
|
39
|
+
// If true, all logs will be sent to standard console output functions (console.info, console.warn, ...)
|
|
40
|
+
sendLogsToConsoleOutput: false,
|
|
41
|
+
// If true, all logs will be sent to Better Stack
|
|
42
|
+
sendLogsToBetterStack: true,
|
|
43
|
+
// Function to be used to calculate size of logs in bytes (to evaluate batchSizeLimitKiB)
|
|
44
|
+
calculateLogSizeBytes: tools_1.calculateJsonLogSizeBytes,
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Logtail core class for logging to the Better Stack service
|
|
48
|
+
*/
|
|
49
|
+
class Logtail {
|
|
50
|
+
/* CONSTRUCTOR */
|
|
51
|
+
/**
|
|
52
|
+
* Initializes a new Logtail instance
|
|
53
|
+
*
|
|
54
|
+
* @param sourceToken: string - Private source token for logging to Better Stack
|
|
55
|
+
* @param options?: ILogtailOptions - Optionally specify Logtail options
|
|
56
|
+
*/
|
|
57
|
+
constructor(sourceToken, options) {
|
|
58
|
+
// Middleware
|
|
59
|
+
this._middleware = [];
|
|
60
|
+
// Number of logs logged
|
|
61
|
+
this._countLogged = 0;
|
|
62
|
+
// Number of logs successfully synced with Logtail
|
|
63
|
+
this._countSynced = 0;
|
|
64
|
+
// Number of logs that failed to be synced to Logtail
|
|
65
|
+
this._countDropped = 0;
|
|
66
|
+
// First, check we have a valid source token
|
|
67
|
+
if (typeof sourceToken !== "string" || sourceToken === "") {
|
|
68
|
+
throw new Error("Logtail source token missing");
|
|
69
|
+
}
|
|
70
|
+
// Store the source token, to use for syncing with Better Stack
|
|
71
|
+
this._sourceToken = sourceToken;
|
|
72
|
+
// Merge default and user options
|
|
73
|
+
this._options = Object.assign(Object.assign({}, defaultOptions), options);
|
|
74
|
+
// Create a throttler, for sync operations
|
|
75
|
+
const throttle = (0, tools_1.makeThrottle)(this._options.syncMax, this._options.syncQueuedMax);
|
|
76
|
+
// Sync after throttling
|
|
77
|
+
const throttler = throttle((logs) => {
|
|
78
|
+
return this._sync(logs);
|
|
79
|
+
});
|
|
80
|
+
// Burst protection for logging
|
|
81
|
+
this._logBurstProtection = (0, tools_1.makeBurstProtection)(this._options.burstProtectionMilliseconds, this._options.burstProtectionMax, "Logging");
|
|
82
|
+
this.log = this._logBurstProtection(this.log.bind(this));
|
|
83
|
+
// Create a batcher, for aggregating logs by buffer size/interval
|
|
84
|
+
const batcher = (0, tools_1.makeBatch)(this._options.batchSize, this._options.batchInterval, this._options.retryCount, this._options.retryBackoff, this._options.batchSizeKiB * 1024, this._options.calculateLogSizeBytes);
|
|
85
|
+
this._batch = batcher.initPusher((logs) => {
|
|
86
|
+
return throttler(logs);
|
|
87
|
+
});
|
|
88
|
+
this._flush = batcher.flush;
|
|
89
|
+
}
|
|
90
|
+
/* PUBLIC METHODS */
|
|
91
|
+
/**
|
|
92
|
+
* Flush batched logs to Logtail
|
|
93
|
+
*/
|
|
94
|
+
async flush() {
|
|
95
|
+
return this._flush();
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Number of entries logged
|
|
99
|
+
*
|
|
100
|
+
* @returns number
|
|
101
|
+
*/
|
|
102
|
+
get logged() {
|
|
103
|
+
return this._countLogged;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Number of log entries synced with Better Stack
|
|
107
|
+
*
|
|
108
|
+
* @returns number
|
|
109
|
+
*/
|
|
110
|
+
get synced() {
|
|
111
|
+
return this._countSynced;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Number of entries dropped
|
|
115
|
+
*
|
|
116
|
+
* @returns number
|
|
117
|
+
*/
|
|
118
|
+
get dropped() {
|
|
119
|
+
return this._countDropped;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Log an entry, to be synced with Better Stack
|
|
123
|
+
*
|
|
124
|
+
* @param message: string - Log message
|
|
125
|
+
* @param level (LogLevel) - Level to log at (debug|info|warn|error)
|
|
126
|
+
* @param context: (Context) - Context (optional)
|
|
127
|
+
* @returns Promise<ILogtailLog> after syncing
|
|
128
|
+
*/
|
|
129
|
+
async log(message, level = types_1.LogLevel.Info, context = {}) {
|
|
130
|
+
// Wrap context in an object, if it's not already
|
|
131
|
+
if (typeof context !== "object") {
|
|
132
|
+
const wrappedContext = { extra: context };
|
|
133
|
+
context = wrappedContext;
|
|
134
|
+
}
|
|
135
|
+
if (context instanceof Error) {
|
|
136
|
+
const wrappedContext = { error: context };
|
|
137
|
+
context = wrappedContext;
|
|
138
|
+
}
|
|
139
|
+
if (this._options.sendLogsToConsoleOutput) {
|
|
140
|
+
switch (level) {
|
|
141
|
+
case "debug":
|
|
142
|
+
console.debug(message, context);
|
|
143
|
+
break;
|
|
144
|
+
case "info":
|
|
145
|
+
console.info(message, context);
|
|
146
|
+
break;
|
|
147
|
+
case "warn":
|
|
148
|
+
console.warn(message, context);
|
|
149
|
+
break;
|
|
150
|
+
case "error":
|
|
151
|
+
console.error(message, context);
|
|
152
|
+
break;
|
|
153
|
+
default:
|
|
154
|
+
console.log(`[${level.toUpperCase()}]`, message, context);
|
|
155
|
+
break;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
// Check that we have a sync function
|
|
159
|
+
if (typeof this._sync !== "function") {
|
|
160
|
+
throw new Error("No Logtail logger sync function provided");
|
|
161
|
+
}
|
|
162
|
+
// Increment log count
|
|
163
|
+
this._countLogged++;
|
|
164
|
+
// Start building the log message
|
|
165
|
+
let log = Object.assign(Object.assign({
|
|
166
|
+
// Implicit date timestamp
|
|
167
|
+
dt: new Date(),
|
|
168
|
+
// Explicit level
|
|
169
|
+
level }, context), (message instanceof Error ? (0, serialize_error_1.serializeError)(message) : { message }));
|
|
170
|
+
let transformedLog = log;
|
|
171
|
+
for (const middleware of this._middleware) {
|
|
172
|
+
let newTransformedLog = await middleware(transformedLog);
|
|
173
|
+
if (newTransformedLog == null) {
|
|
174
|
+
// Don't push the log if it was filtered out in a middleware
|
|
175
|
+
return transformedLog;
|
|
176
|
+
}
|
|
177
|
+
transformedLog = newTransformedLog;
|
|
178
|
+
}
|
|
179
|
+
// Manually serialize the log data
|
|
180
|
+
transformedLog = this.serialize(transformedLog, this._options.contextObjectMaxDepth);
|
|
181
|
+
if (!this._options.sendLogsToBetterStack) {
|
|
182
|
+
// Return the resulting log before sending it
|
|
183
|
+
return transformedLog;
|
|
184
|
+
}
|
|
185
|
+
try {
|
|
186
|
+
// Push the log through the batcher, and sync
|
|
187
|
+
await this._batch(transformedLog);
|
|
188
|
+
// Increment sync count
|
|
189
|
+
this._countSynced++;
|
|
190
|
+
}
|
|
191
|
+
catch (e) {
|
|
192
|
+
// Increment dropped count
|
|
193
|
+
this._countDropped++;
|
|
194
|
+
// Catch any errors - re-throw if `ignoreExceptions` == false
|
|
195
|
+
if (!this._options.ignoreExceptions) {
|
|
196
|
+
if (this._options.throwExceptions) {
|
|
197
|
+
throw e;
|
|
198
|
+
}
|
|
199
|
+
else {
|
|
200
|
+
// Output to console
|
|
201
|
+
console.error(e);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
// Return the resulting log
|
|
206
|
+
return transformedLog;
|
|
207
|
+
}
|
|
208
|
+
serialize(value, maxDepth, visitedObjects = new WeakSet()) {
|
|
209
|
+
if (value === null || typeof value === "boolean" || typeof value === "number" || typeof value === "string") {
|
|
210
|
+
return value;
|
|
211
|
+
}
|
|
212
|
+
else if (value instanceof Date) {
|
|
213
|
+
// Date instances can be invalid & toISOString() will fail
|
|
214
|
+
if (isNaN(value.getTime())) {
|
|
215
|
+
return value.toString();
|
|
216
|
+
}
|
|
217
|
+
return value.toISOString();
|
|
218
|
+
}
|
|
219
|
+
else if (value instanceof Error) {
|
|
220
|
+
return (0, serialize_error_1.serializeError)(value);
|
|
221
|
+
}
|
|
222
|
+
else if ((typeof value === "object" || Array.isArray(value)) && (maxDepth < 1 || visitedObjects.has(value))) {
|
|
223
|
+
if (visitedObjects.has(value)) {
|
|
224
|
+
if (this._options.contextObjectCircularRefWarn) {
|
|
225
|
+
console.warn(`[Logtail] Found a circular reference when serializing logs. Please do not use circular references in your logs.`);
|
|
226
|
+
}
|
|
227
|
+
return "<omitted circular reference>";
|
|
228
|
+
}
|
|
229
|
+
if (this._options.contextObjectMaxDepthWarn) {
|
|
230
|
+
console.warn(`[Logtail] Max depth of ${this._options.contextObjectMaxDepth} reached when serializing logs. Please do not use excessive object depth in your logs.`);
|
|
231
|
+
}
|
|
232
|
+
return `<omitted context beyond configured max depth: ${this._options.contextObjectMaxDepth}>`;
|
|
233
|
+
}
|
|
234
|
+
else if (Array.isArray(value)) {
|
|
235
|
+
visitedObjects.add(value);
|
|
236
|
+
const serializedArray = value.map((item) => this.serialize(item, maxDepth - 1, visitedObjects));
|
|
237
|
+
visitedObjects.delete(value);
|
|
238
|
+
return serializedArray;
|
|
239
|
+
}
|
|
240
|
+
else if (typeof value === "object") {
|
|
241
|
+
const serializedObject = {};
|
|
242
|
+
visitedObjects.add(value);
|
|
243
|
+
Object.entries(value).forEach((item) => {
|
|
244
|
+
const key = item[0];
|
|
245
|
+
const value = item[1];
|
|
246
|
+
const serializedValue = this.serialize(value, maxDepth - 1, visitedObjects);
|
|
247
|
+
if (serializedValue !== undefined) {
|
|
248
|
+
serializedObject[key] = serializedValue;
|
|
249
|
+
}
|
|
250
|
+
});
|
|
251
|
+
visitedObjects.delete(value);
|
|
252
|
+
return serializedObject;
|
|
253
|
+
}
|
|
254
|
+
else if (typeof value === "undefined") {
|
|
255
|
+
return undefined;
|
|
256
|
+
}
|
|
257
|
+
else {
|
|
258
|
+
return `<omitted unserializable ${typeof value}>`;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
*
|
|
263
|
+
* Debug level log, to be synced with Better Stack
|
|
264
|
+
*
|
|
265
|
+
* @param message: string - Log message
|
|
266
|
+
* @param context: (Pick<ILogtailLog, "context">) - Context (optional)
|
|
267
|
+
* @returns Promise<ILogtailLog> after syncing
|
|
268
|
+
*/
|
|
269
|
+
async debug(message, context = {}) {
|
|
270
|
+
return this.log(message, types_1.LogLevel.Debug, context);
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
*
|
|
274
|
+
* Info level log, to be synced with Better Stack
|
|
275
|
+
*
|
|
276
|
+
* @param message: string - Log message
|
|
277
|
+
* @param context: (Pick<ILogtailLog, "context">) - Context (optional)
|
|
278
|
+
* @returns Promise<ILogtailLog> after syncing
|
|
279
|
+
*/
|
|
280
|
+
async info(message, context = {}) {
|
|
281
|
+
return this.log(message, types_1.LogLevel.Info, context);
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
*
|
|
285
|
+
* Warning level log, to be synced with Better Stack
|
|
286
|
+
*
|
|
287
|
+
* @param message: string - Log message
|
|
288
|
+
* @param context: (Pick<ILogtailLog, "context">) - Context (optional)
|
|
289
|
+
* @returns Promise<ILogtailLog> after syncing
|
|
290
|
+
*/
|
|
291
|
+
async warn(message, context = {}) {
|
|
292
|
+
return this.log(message, types_1.LogLevel.Warn, context);
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
*
|
|
296
|
+
* Warning level log, to be synced with Better Stack
|
|
297
|
+
*
|
|
298
|
+
* @param message: string - Log message
|
|
299
|
+
* @param context: (Pick<ILogtailLog, "context">) - Context (optional)
|
|
300
|
+
* @returns Promise<ILogtailLog> after syncing
|
|
301
|
+
*/
|
|
302
|
+
async error(message, context = {}) {
|
|
303
|
+
return this.log(message, types_1.LogLevel.Error, context);
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* Sets the sync method - i.e. the final step in the pipeline to get logs
|
|
307
|
+
* over to Better Stack
|
|
308
|
+
*
|
|
309
|
+
* @param fn - Pipeline function to use as sync method
|
|
310
|
+
*/
|
|
311
|
+
setSync(fn) {
|
|
312
|
+
this._sync = fn;
|
|
313
|
+
}
|
|
314
|
+
/**
|
|
315
|
+
* Add a middleware function to the logging pipeline
|
|
316
|
+
*
|
|
317
|
+
* @param fn - Function to add to the log pipeline
|
|
318
|
+
* @returns void
|
|
319
|
+
*/
|
|
320
|
+
use(fn) {
|
|
321
|
+
this._middleware.push(fn);
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* Remove a function from the pipeline
|
|
325
|
+
*
|
|
326
|
+
* @param fn - Pipeline function
|
|
327
|
+
* @returns void
|
|
328
|
+
*/
|
|
329
|
+
remove(fn) {
|
|
330
|
+
this._middleware = this._middleware.filter((p) => p !== fn);
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
class default_1 extends Logtail {
|
|
334
|
+
async log(message, level = types_1.LogLevel.Info, context = {}) {
|
|
335
|
+
return super.log(message, level, context);
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
exports.default = default_1;
|
|
339
|
+
//# sourceMappingURL=base.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Base = void 0;
|
|
7
|
+
const base_1 = __importDefault(require("./base"));
|
|
8
|
+
exports.Base = base_1.default;
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@logtail/core",
|
|
3
|
+
"version": "0.5.6",
|
|
4
|
+
"description": "Better Stack logging core (formerly Logtail)",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"Better Stack",
|
|
7
|
+
"Logtail",
|
|
8
|
+
"logger",
|
|
9
|
+
"logging"
|
|
10
|
+
],
|
|
11
|
+
"author": "Better Stack <hello@betterstack.com>",
|
|
12
|
+
"homepage": "https://github.com/logtail/logtail-js/tree/master/packages/core#readme",
|
|
13
|
+
"license": "ISC",
|
|
14
|
+
"main": "dist/cjs/index.js",
|
|
15
|
+
"module": "dist/es6/index.js",
|
|
16
|
+
"types": "dist/es6/index.d.ts",
|
|
17
|
+
"files": [
|
|
18
|
+
"src",
|
|
19
|
+
"dist"
|
|
20
|
+
],
|
|
21
|
+
"sideEffects": false,
|
|
22
|
+
"repository": {
|
|
23
|
+
"type": "git",
|
|
24
|
+
"url": "git+https://github.com/logtail/logtail-js.git"
|
|
25
|
+
},
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"access": "public"
|
|
28
|
+
},
|
|
29
|
+
"scripts": {
|
|
30
|
+
"build:cjs": "tsc",
|
|
31
|
+
"build:es6": "tsc -p tsconfig.es6.json",
|
|
32
|
+
"build": "run-p build:*",
|
|
33
|
+
"prepublishOnly": "npm run build",
|
|
34
|
+
"test": "echo \"Error: run tests from root\" && exit 1"
|
|
35
|
+
},
|
|
36
|
+
"bugs": {
|
|
37
|
+
"url": "https://github.com/logtail/logtail-js/issues"
|
|
38
|
+
},
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"@logtail/tools": "^0.5.6",
|
|
41
|
+
"@logtail/types": "^0.5.6",
|
|
42
|
+
"serialize-error": "8.1.0"
|
|
43
|
+
},
|
|
44
|
+
"gitHead": "6901c2b90af7cf9dda3e7c8be7c145d4d83e72a8"
|
|
45
|
+
}
|