@coro-ai/runner 0.1.31 → 0.1.33
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/dashboard-dist/assets/{index--JceWwKS.js → index-C7l2FOsX.js} +9 -3
- package/dashboard-dist/index.html +1 -1
- package/dist/src/config/local-config.d.ts +3 -0
- package/dist/src/config/local-config.js +2 -0
- package/dist/src/config/local-config.js.map +1 -1
- package/dist/src/intake/handler.js +27 -9
- package/dist/src/intake/handler.js.map +1 -1
- package/dist/src/intake/system-prompt.d.ts +1 -0
- package/dist/src/intake/system-prompt.js +8 -1
- package/dist/src/intake/system-prompt.js.map +1 -1
- package/dist/src/intake/tools.js +5 -0
- package/dist/src/intake/tools.js.map +1 -1
- package/dist/src/jobs/runner.d.ts +6 -0
- package/dist/src/jobs/runner.js +7 -0
- package/dist/src/jobs/runner.js.map +1 -1
- package/node_modules/@coro-ai/cloud-protocol/package.json +1 -1
- package/node_modules/@coro-ai/intelligence-base/package.json +1 -1
- package/node_modules/@coro-ai/llm-anthropic/dist/chat-via-sdk.d.ts +11 -0
- package/node_modules/@coro-ai/llm-anthropic/dist/chat-via-sdk.d.ts.map +1 -0
- package/node_modules/@coro-ai/llm-anthropic/dist/chat-via-sdk.js +159 -0
- package/node_modules/@coro-ai/llm-anthropic/dist/chat-via-sdk.js.map +1 -0
- package/node_modules/@coro-ai/llm-anthropic/dist/executor.d.ts +15 -8
- package/node_modules/@coro-ai/llm-anthropic/dist/executor.d.ts.map +1 -1
- package/node_modules/@coro-ai/llm-anthropic/dist/executor.js +71 -11
- package/node_modules/@coro-ai/llm-anthropic/dist/executor.js.map +1 -1
- package/node_modules/@coro-ai/llm-anthropic/dist/http-routes.d.ts.map +1 -1
- package/node_modules/@coro-ai/llm-anthropic/dist/http-routes.js +3 -2
- package/node_modules/@coro-ai/llm-anthropic/dist/http-routes.js.map +1 -1
- package/node_modules/@coro-ai/llm-anthropic/dist/index.d.ts +1 -1
- package/node_modules/@coro-ai/llm-anthropic/dist/index.d.ts.map +1 -1
- package/node_modules/@coro-ai/llm-anthropic/dist/index.js +2 -1
- package/node_modules/@coro-ai/llm-anthropic/dist/index.js.map +1 -1
- package/node_modules/@coro-ai/llm-anthropic/dist/login.d.ts +3 -1
- package/node_modules/@coro-ai/llm-anthropic/dist/login.d.ts.map +1 -1
- package/node_modules/@coro-ai/llm-anthropic/dist/login.js +5 -2
- package/node_modules/@coro-ai/llm-anthropic/dist/login.js.map +1 -1
- package/node_modules/@coro-ai/llm-anthropic/dist/test-connection.d.ts +2 -0
- package/node_modules/@coro-ai/llm-anthropic/dist/test-connection.d.ts.map +1 -1
- package/node_modules/@coro-ai/llm-anthropic/dist/test-connection.js +8 -0
- package/node_modules/@coro-ai/llm-anthropic/dist/test-connection.js.map +1 -1
- package/node_modules/@coro-ai/llm-anthropic/package.json +1 -1
- package/node_modules/@coro-ai/llm-openai/dist/executor.d.ts.map +1 -1
- package/node_modules/@coro-ai/llm-openai/dist/executor.js +125 -83
- package/node_modules/@coro-ai/llm-openai/dist/executor.js.map +1 -1
- package/node_modules/@coro-ai/llm-openai/package.json +1 -1
- package/node_modules/@coro-ai/plugin-sdk/dist/chat-mcp.d.ts +30 -0
- package/node_modules/@coro-ai/plugin-sdk/dist/chat-mcp.d.ts.map +1 -0
- package/node_modules/@coro-ai/plugin-sdk/dist/chat-mcp.js +85 -0
- package/node_modules/@coro-ai/plugin-sdk/dist/chat-mcp.js.map +1 -0
- package/node_modules/@coro-ai/plugin-sdk/dist/index.d.ts +1 -0
- package/node_modules/@coro-ai/plugin-sdk/dist/index.d.ts.map +1 -1
- package/node_modules/@coro-ai/plugin-sdk/dist/index.js +1 -0
- package/node_modules/@coro-ai/plugin-sdk/dist/index.js.map +1 -1
- package/node_modules/@coro-ai/plugin-sdk/dist/types.d.ts +6 -0
- package/node_modules/@coro-ai/plugin-sdk/dist/types.d.ts.map +1 -1
- package/node_modules/@coro-ai/plugin-sdk/package.json +1 -1
- package/node_modules/hono/dist/adapter/aws-lambda/handler.js +9 -17
- package/node_modules/hono/dist/cjs/adapter/aws-lambda/handler.js +9 -17
- package/node_modules/hono/dist/cjs/helper/css/common.js +3 -1
- package/node_modules/hono/dist/cjs/helper/css/index.js +9 -1
- package/node_modules/hono/dist/cjs/jsx/base.js +8 -14
- package/node_modules/hono/dist/cjs/jsx/components.js +41 -21
- package/node_modules/hono/dist/cjs/jsx/context.js +131 -5
- package/node_modules/hono/dist/cjs/jsx/streaming.js +9 -7
- package/node_modules/hono/dist/helper/css/common.js +3 -1
- package/node_modules/hono/dist/helper/css/index.js +9 -1
- package/node_modules/hono/dist/jsx/base.js +15 -15
- package/node_modules/hono/dist/jsx/components.js +42 -22
- package/node_modules/hono/dist/jsx/context.js +129 -5
- package/node_modules/hono/dist/jsx/streaming.js +10 -8
- package/node_modules/hono/dist/tsconfig.build.tsbuildinfo +1 -1
- package/node_modules/hono/dist/types/jsx/base.d.ts +1 -3
- package/node_modules/hono/dist/types/jsx/context.d.ts +39 -0
- package/node_modules/hono/package.json +1 -1
- package/node_modules/openai/CHANGELOG.md +48 -0
- package/node_modules/openai/README.md +85 -102
- package/node_modules/openai/_vendor/zod-to-json-schema/parseDef.d.mts.map +1 -1
- package/node_modules/openai/_vendor/zod-to-json-schema/parseDef.d.ts.map +1 -1
- package/node_modules/openai/_vendor/zod-to-json-schema/parseDef.js +41 -15
- package/node_modules/openai/_vendor/zod-to-json-schema/parseDef.js.map +1 -1
- package/node_modules/openai/_vendor/zod-to-json-schema/parseDef.mjs +41 -15
- package/node_modules/openai/_vendor/zod-to-json-schema/parseDef.mjs.map +1 -1
- package/node_modules/openai/_vendor/zod-to-json-schema/parsers/branded.d.mts +1 -1
- package/node_modules/openai/_vendor/zod-to-json-schema/parsers/branded.d.mts.map +1 -1
- package/node_modules/openai/_vendor/zod-to-json-schema/parsers/branded.d.ts +1 -1
- package/node_modules/openai/_vendor/zod-to-json-schema/parsers/branded.d.ts.map +1 -1
- package/node_modules/openai/_vendor/zod-to-json-schema/parsers/branded.js +2 -2
- package/node_modules/openai/_vendor/zod-to-json-schema/parsers/branded.js.map +1 -1
- package/node_modules/openai/_vendor/zod-to-json-schema/parsers/branded.mjs +2 -2
- package/node_modules/openai/_vendor/zod-to-json-schema/parsers/branded.mjs.map +1 -1
- package/node_modules/openai/_vendor/zod-to-json-schema/parsers/catch.d.mts +1 -1
- package/node_modules/openai/_vendor/zod-to-json-schema/parsers/catch.d.mts.map +1 -1
- package/node_modules/openai/_vendor/zod-to-json-schema/parsers/catch.d.ts +1 -1
- package/node_modules/openai/_vendor/zod-to-json-schema/parsers/catch.d.ts.map +1 -1
- package/node_modules/openai/_vendor/zod-to-json-schema/parsers/catch.js +2 -2
- package/node_modules/openai/_vendor/zod-to-json-schema/parsers/catch.js.map +1 -1
- package/node_modules/openai/_vendor/zod-to-json-schema/parsers/catch.mjs +2 -2
- package/node_modules/openai/_vendor/zod-to-json-schema/parsers/catch.mjs.map +1 -1
- package/node_modules/openai/_vendor/zod-to-json-schema/parsers/default.d.mts +1 -1
- package/node_modules/openai/_vendor/zod-to-json-schema/parsers/default.d.mts.map +1 -1
- package/node_modules/openai/_vendor/zod-to-json-schema/parsers/default.d.ts +1 -1
- package/node_modules/openai/_vendor/zod-to-json-schema/parsers/default.d.ts.map +1 -1
- package/node_modules/openai/_vendor/zod-to-json-schema/parsers/default.js +2 -2
- package/node_modules/openai/_vendor/zod-to-json-schema/parsers/default.js.map +1 -1
- package/node_modules/openai/_vendor/zod-to-json-schema/parsers/default.mjs +2 -2
- package/node_modules/openai/_vendor/zod-to-json-schema/parsers/default.mjs.map +1 -1
- package/node_modules/openai/_vendor/zod-to-json-schema/parsers/nullable.d.mts +1 -1
- package/node_modules/openai/_vendor/zod-to-json-schema/parsers/nullable.d.mts.map +1 -1
- package/node_modules/openai/_vendor/zod-to-json-schema/parsers/nullable.d.ts +1 -1
- package/node_modules/openai/_vendor/zod-to-json-schema/parsers/nullable.d.ts.map +1 -1
- package/node_modules/openai/_vendor/zod-to-json-schema/parsers/nullable.js +2 -2
- package/node_modules/openai/_vendor/zod-to-json-schema/parsers/nullable.js.map +1 -1
- package/node_modules/openai/_vendor/zod-to-json-schema/parsers/nullable.mjs +2 -2
- package/node_modules/openai/_vendor/zod-to-json-schema/parsers/nullable.mjs.map +1 -1
- package/node_modules/openai/_vendor/zod-to-json-schema/parsers/optional.d.mts +1 -1
- package/node_modules/openai/_vendor/zod-to-json-schema/parsers/optional.d.mts.map +1 -1
- package/node_modules/openai/_vendor/zod-to-json-schema/parsers/optional.d.ts +1 -1
- package/node_modules/openai/_vendor/zod-to-json-schema/parsers/optional.d.ts.map +1 -1
- package/node_modules/openai/_vendor/zod-to-json-schema/parsers/optional.js +3 -3
- package/node_modules/openai/_vendor/zod-to-json-schema/parsers/optional.js.map +1 -1
- package/node_modules/openai/_vendor/zod-to-json-schema/parsers/optional.mjs +3 -3
- package/node_modules/openai/_vendor/zod-to-json-schema/parsers/optional.mjs.map +1 -1
- package/node_modules/openai/_vendor/zod-to-json-schema/parsers/pipeline.d.mts +1 -1
- package/node_modules/openai/_vendor/zod-to-json-schema/parsers/pipeline.d.mts.map +1 -1
- package/node_modules/openai/_vendor/zod-to-json-schema/parsers/pipeline.d.ts +1 -1
- package/node_modules/openai/_vendor/zod-to-json-schema/parsers/pipeline.d.ts.map +1 -1
- package/node_modules/openai/_vendor/zod-to-json-schema/parsers/pipeline.js +3 -3
- package/node_modules/openai/_vendor/zod-to-json-schema/parsers/pipeline.js.map +1 -1
- package/node_modules/openai/_vendor/zod-to-json-schema/parsers/pipeline.mjs +3 -3
- package/node_modules/openai/_vendor/zod-to-json-schema/parsers/pipeline.mjs.map +1 -1
- package/node_modules/openai/_vendor/zod-to-json-schema/parsers/promise.d.mts +1 -1
- package/node_modules/openai/_vendor/zod-to-json-schema/parsers/promise.d.mts.map +1 -1
- package/node_modules/openai/_vendor/zod-to-json-schema/parsers/promise.d.ts +1 -1
- package/node_modules/openai/_vendor/zod-to-json-schema/parsers/promise.d.ts.map +1 -1
- package/node_modules/openai/_vendor/zod-to-json-schema/parsers/promise.js +2 -2
- package/node_modules/openai/_vendor/zod-to-json-schema/parsers/promise.js.map +1 -1
- package/node_modules/openai/_vendor/zod-to-json-schema/parsers/promise.mjs +2 -2
- package/node_modules/openai/_vendor/zod-to-json-schema/parsers/promise.mjs.map +1 -1
- package/node_modules/openai/_vendor/zod-to-json-schema/parsers/readonly.d.mts +1 -1
- package/node_modules/openai/_vendor/zod-to-json-schema/parsers/readonly.d.mts.map +1 -1
- package/node_modules/openai/_vendor/zod-to-json-schema/parsers/readonly.d.ts +1 -1
- package/node_modules/openai/_vendor/zod-to-json-schema/parsers/readonly.d.ts.map +1 -1
- package/node_modules/openai/_vendor/zod-to-json-schema/parsers/readonly.js +2 -2
- package/node_modules/openai/_vendor/zod-to-json-schema/parsers/readonly.js.map +1 -1
- package/node_modules/openai/_vendor/zod-to-json-schema/parsers/readonly.mjs +2 -2
- package/node_modules/openai/_vendor/zod-to-json-schema/parsers/readonly.mjs.map +1 -1
- package/node_modules/openai/auth/workload-identity-auth.d.mts.map +1 -1
- package/node_modules/openai/auth/workload-identity-auth.d.ts.map +1 -1
- package/node_modules/openai/auth/workload-identity-auth.js +12 -4
- package/node_modules/openai/auth/workload-identity-auth.js.map +1 -1
- package/node_modules/openai/auth/workload-identity-auth.mjs +13 -5
- package/node_modules/openai/auth/workload-identity-auth.mjs.map +1 -1
- package/node_modules/openai/azure.d.mts +3 -1
- package/node_modules/openai/azure.d.mts.map +1 -1
- package/node_modules/openai/azure.d.ts +3 -1
- package/node_modules/openai/azure.d.ts.map +1 -1
- package/node_modules/openai/azure.js.map +1 -1
- package/node_modules/openai/azure.mjs.map +1 -1
- package/node_modules/openai/beta/realtime/internal-base.d.mts +14 -1
- package/node_modules/openai/beta/realtime/internal-base.d.mts.map +1 -1
- package/node_modules/openai/beta/realtime/internal-base.d.ts +14 -1
- package/node_modules/openai/beta/realtime/internal-base.d.ts.map +1 -1
- package/node_modules/openai/beta/realtime/internal-base.js +21 -5
- package/node_modules/openai/beta/realtime/internal-base.js.map +1 -1
- package/node_modules/openai/beta/realtime/internal-base.mjs +21 -5
- package/node_modules/openai/beta/realtime/internal-base.mjs.map +1 -1
- package/node_modules/openai/beta/realtime/websocket.d.mts +3 -5
- package/node_modules/openai/beta/realtime/websocket.d.mts.map +1 -1
- package/node_modules/openai/beta/realtime/websocket.d.ts +3 -5
- package/node_modules/openai/beta/realtime/websocket.d.ts.map +1 -1
- package/node_modules/openai/beta/realtime/websocket.js +2 -3
- package/node_modules/openai/beta/realtime/websocket.js.map +1 -1
- package/node_modules/openai/beta/realtime/websocket.mjs +3 -4
- package/node_modules/openai/beta/realtime/websocket.mjs.map +1 -1
- package/node_modules/openai/beta/realtime/ws.d.mts +3 -5
- package/node_modules/openai/beta/realtime/ws.d.mts.map +1 -1
- package/node_modules/openai/beta/realtime/ws.d.ts +3 -5
- package/node_modules/openai/beta/realtime/ws.d.ts.map +1 -1
- package/node_modules/openai/beta/realtime/ws.js +2 -3
- package/node_modules/openai/beta/realtime/ws.js.map +1 -1
- package/node_modules/openai/beta/realtime/ws.mjs +3 -4
- package/node_modules/openai/beta/realtime/ws.mjs.map +1 -1
- package/node_modules/openai/client.d.mts +9 -1
- package/node_modules/openai/client.d.mts.map +1 -1
- package/node_modules/openai/client.d.ts +9 -1
- package/node_modules/openai/client.d.ts.map +1 -1
- package/node_modules/openai/client.js +56 -9
- package/node_modules/openai/client.js.map +1 -1
- package/node_modules/openai/client.mjs +56 -9
- package/node_modules/openai/client.mjs.map +1 -1
- package/node_modules/openai/helpers/zod.d.mts.map +1 -1
- package/node_modules/openai/helpers/zod.d.ts.map +1 -1
- package/node_modules/openai/helpers/zod.js +12 -0
- package/node_modules/openai/helpers/zod.js.map +1 -1
- package/node_modules/openai/helpers/zod.mjs +12 -0
- package/node_modules/openai/helpers/zod.mjs.map +1 -1
- package/node_modules/openai/internal/bedrock.d.mts +34 -0
- package/node_modules/openai/internal/bedrock.d.mts.map +1 -0
- package/node_modules/openai/internal/bedrock.d.ts +34 -0
- package/node_modules/openai/internal/bedrock.d.ts.map +1 -0
- package/node_modules/openai/internal/bedrock.js +107 -0
- package/node_modules/openai/internal/bedrock.js.map +1 -0
- package/node_modules/openai/internal/bedrock.mjs +99 -0
- package/node_modules/openai/internal/bedrock.mjs.map +1 -0
- package/node_modules/openai/internal/provider.d.mts +23 -0
- package/node_modules/openai/internal/provider.d.mts.map +1 -0
- package/node_modules/openai/internal/provider.d.ts +23 -0
- package/node_modules/openai/internal/provider.d.ts.map +1 -0
- package/node_modules/openai/internal/provider.js +36 -0
- package/node_modules/openai/internal/provider.js.map +1 -0
- package/node_modules/openai/internal/provider.mjs +32 -0
- package/node_modules/openai/internal/provider.mjs.map +1 -0
- package/node_modules/openai/internal/utils/log.d.mts.map +1 -1
- package/node_modules/openai/internal/utils/log.d.ts.map +1 -1
- package/node_modules/openai/internal/utils/log.js +1 -0
- package/node_modules/openai/internal/utils/log.js.map +1 -1
- package/node_modules/openai/internal/utils/log.mjs +1 -0
- package/node_modules/openai/internal/utils/log.mjs.map +1 -1
- package/node_modules/openai/lib/AbstractChatCompletionRunner.d.mts +15 -4
- package/node_modules/openai/lib/AbstractChatCompletionRunner.d.mts.map +1 -1
- package/node_modules/openai/lib/AbstractChatCompletionRunner.d.ts +15 -4
- package/node_modules/openai/lib/AbstractChatCompletionRunner.d.ts.map +1 -1
- package/node_modules/openai/lib/AbstractChatCompletionRunner.js +63 -40
- package/node_modules/openai/lib/AbstractChatCompletionRunner.js.map +1 -1
- package/node_modules/openai/lib/AbstractChatCompletionRunner.mjs +63 -40
- package/node_modules/openai/lib/AbstractChatCompletionRunner.mjs.map +1 -1
- package/node_modules/openai/lib/AssistantStream.d.mts.map +1 -1
- package/node_modules/openai/lib/AssistantStream.d.ts.map +1 -1
- package/node_modules/openai/lib/AssistantStream.js +4 -24
- package/node_modules/openai/lib/AssistantStream.js.map +1 -1
- package/node_modules/openai/lib/AssistantStream.mjs +4 -24
- package/node_modules/openai/lib/AssistantStream.mjs.map +1 -1
- package/node_modules/openai/lib/ChatCompletionRunner.js +1 -1
- package/node_modules/openai/lib/ChatCompletionRunner.js.map +1 -1
- package/node_modules/openai/lib/ChatCompletionRunner.mjs +1 -1
- package/node_modules/openai/lib/ChatCompletionRunner.mjs.map +1 -1
- package/node_modules/openai/lib/ChatCompletionStream.d.mts.map +1 -1
- package/node_modules/openai/lib/ChatCompletionStream.d.ts.map +1 -1
- package/node_modules/openai/lib/ChatCompletionStream.js +4 -13
- package/node_modules/openai/lib/ChatCompletionStream.js.map +1 -1
- package/node_modules/openai/lib/ChatCompletionStream.mjs +4 -13
- package/node_modules/openai/lib/ChatCompletionStream.mjs.map +1 -1
- package/node_modules/openai/lib/ChatCompletionStreamingRunner.js +1 -1
- package/node_modules/openai/lib/ChatCompletionStreamingRunner.js.map +1 -1
- package/node_modules/openai/lib/ChatCompletionStreamingRunner.mjs +1 -1
- package/node_modules/openai/lib/ChatCompletionStreamingRunner.mjs.map +1 -1
- package/node_modules/openai/lib/EventEmitter.d.mts.map +1 -1
- package/node_modules/openai/lib/EventEmitter.d.ts.map +1 -1
- package/node_modules/openai/lib/EventEmitter.js +12 -2
- package/node_modules/openai/lib/EventEmitter.js.map +1 -1
- package/node_modules/openai/lib/EventEmitter.mjs +12 -2
- package/node_modules/openai/lib/EventEmitter.mjs.map +1 -1
- package/node_modules/openai/lib/EventStream.d.mts +1 -0
- package/node_modules/openai/lib/EventStream.d.mts.map +1 -1
- package/node_modules/openai/lib/EventStream.d.ts +1 -0
- package/node_modules/openai/lib/EventStream.d.ts.map +1 -1
- package/node_modules/openai/lib/EventStream.js +19 -2
- package/node_modules/openai/lib/EventStream.js.map +1 -1
- package/node_modules/openai/lib/EventStream.mjs +19 -2
- package/node_modules/openai/lib/EventStream.mjs.map +1 -1
- package/node_modules/openai/lib/ResponsesParser.d.mts.map +1 -1
- package/node_modules/openai/lib/ResponsesParser.d.ts.map +1 -1
- package/node_modules/openai/lib/ResponsesParser.js +12 -4
- package/node_modules/openai/lib/ResponsesParser.js.map +1 -1
- package/node_modules/openai/lib/ResponsesParser.mjs +12 -4
- package/node_modules/openai/lib/ResponsesParser.mjs.map +1 -1
- package/node_modules/openai/lib/responses/ResponseAccumulator.d.mts +10 -0
- package/node_modules/openai/lib/responses/ResponseAccumulator.d.mts.map +1 -0
- package/node_modules/openai/lib/responses/ResponseAccumulator.d.ts +10 -0
- package/node_modules/openai/lib/responses/ResponseAccumulator.d.ts.map +1 -0
- package/node_modules/openai/lib/responses/ResponseAccumulator.js +402 -0
- package/node_modules/openai/lib/responses/ResponseAccumulator.js.map +1 -0
- package/node_modules/openai/lib/responses/ResponseAccumulator.mjs +399 -0
- package/node_modules/openai/lib/responses/ResponseAccumulator.mjs.map +1 -0
- package/node_modules/openai/lib/responses/ResponseInputItems.d.mts +19 -0
- package/node_modules/openai/lib/responses/ResponseInputItems.d.mts.map +1 -0
- package/node_modules/openai/lib/responses/ResponseInputItems.d.ts +19 -0
- package/node_modules/openai/lib/responses/ResponseInputItems.d.ts.map +1 -0
- package/node_modules/openai/lib/responses/ResponseInputItems.js +102 -0
- package/node_modules/openai/lib/responses/ResponseInputItems.js.map +1 -0
- package/node_modules/openai/lib/responses/ResponseInputItems.mjs +98 -0
- package/node_modules/openai/lib/responses/ResponseInputItems.mjs.map +1 -0
- package/node_modules/openai/lib/responses/ResponseStream.d.mts.map +1 -1
- package/node_modules/openai/lib/responses/ResponseStream.d.ts.map +1 -1
- package/node_modules/openai/lib/responses/ResponseStream.js +5 -90
- package/node_modules/openai/lib/responses/ResponseStream.js.map +1 -1
- package/node_modules/openai/lib/responses/ResponseStream.mjs +5 -90
- package/node_modules/openai/lib/responses/ResponseStream.mjs.map +1 -1
- package/node_modules/openai/package.json +24 -1
- package/node_modules/openai/providers/bedrock/aws.d.mts +24 -0
- package/node_modules/openai/providers/bedrock/aws.d.mts.map +1 -0
- package/node_modules/openai/providers/bedrock/aws.d.ts +24 -0
- package/node_modules/openai/providers/bedrock/aws.d.ts.map +1 -0
- package/node_modules/openai/providers/bedrock/aws.js +170 -0
- package/node_modules/openai/providers/bedrock/aws.js.map +1 -0
- package/node_modules/openai/providers/bedrock/aws.mjs +166 -0
- package/node_modules/openai/providers/bedrock/aws.mjs.map +1 -0
- package/node_modules/openai/providers/bedrock.d.mts +7 -0
- package/node_modules/openai/providers/bedrock.d.mts.map +1 -0
- package/node_modules/openai/providers/bedrock.d.ts +7 -0
- package/node_modules/openai/providers/bedrock.d.ts.map +1 -0
- package/node_modules/openai/providers/bedrock.js +26 -0
- package/node_modules/openai/providers/bedrock.js.map +1 -0
- package/node_modules/openai/providers/bedrock.mjs +22 -0
- package/node_modules/openai/providers/bedrock.mjs.map +1 -0
- package/node_modules/openai/realtime/internal-base.d.mts +28 -1
- package/node_modules/openai/realtime/internal-base.d.mts.map +1 -1
- package/node_modules/openai/realtime/internal-base.d.ts +28 -1
- package/node_modules/openai/realtime/internal-base.d.ts.map +1 -1
- package/node_modules/openai/realtime/internal-base.js +50 -7
- package/node_modules/openai/realtime/internal-base.js.map +1 -1
- package/node_modules/openai/realtime/internal-base.mjs +49 -7
- package/node_modules/openai/realtime/internal-base.mjs.map +1 -1
- package/node_modules/openai/realtime/websocket.d.mts +4 -7
- package/node_modules/openai/realtime/websocket.d.mts.map +1 -1
- package/node_modules/openai/realtime/websocket.d.ts +4 -7
- package/node_modules/openai/realtime/websocket.d.ts.map +1 -1
- package/node_modules/openai/realtime/websocket.js +4 -8
- package/node_modules/openai/realtime/websocket.js.map +1 -1
- package/node_modules/openai/realtime/websocket.mjs +5 -9
- package/node_modules/openai/realtime/websocket.mjs.map +1 -1
- package/node_modules/openai/realtime/ws.d.mts +4 -7
- package/node_modules/openai/realtime/ws.d.mts.map +1 -1
- package/node_modules/openai/realtime/ws.d.ts +4 -7
- package/node_modules/openai/realtime/ws.d.ts.map +1 -1
- package/node_modules/openai/realtime/ws.js +4 -8
- package/node_modules/openai/realtime/ws.js.map +1 -1
- package/node_modules/openai/realtime/ws.mjs +5 -9
- package/node_modules/openai/realtime/ws.mjs.map +1 -1
- package/node_modules/openai/src/_vendor/zod-to-json-schema/parseDef.ts +44 -16
- package/node_modules/openai/src/_vendor/zod-to-json-schema/parsers/branded.ts +2 -2
- package/node_modules/openai/src/_vendor/zod-to-json-schema/parsers/catch.ts +2 -2
- package/node_modules/openai/src/_vendor/zod-to-json-schema/parsers/default.ts +6 -2
- package/node_modules/openai/src/_vendor/zod-to-json-schema/parsers/nullable.ts +13 -5
- package/node_modules/openai/src/_vendor/zod-to-json-schema/parsers/optional.ts +14 -6
- package/node_modules/openai/src/_vendor/zod-to-json-schema/parsers/pipeline.ts +3 -2
- package/node_modules/openai/src/_vendor/zod-to-json-schema/parsers/promise.ts +6 -2
- package/node_modules/openai/src/_vendor/zod-to-json-schema/parsers/readonly.ts +2 -2
- package/node_modules/openai/src/auth/workload-identity-auth.ts +16 -5
- package/node_modules/openai/src/azure.ts +4 -1
- package/node_modules/openai/src/beta/realtime/internal-base.ts +43 -5
- package/node_modules/openai/src/beta/realtime/websocket.ts +10 -7
- package/node_modules/openai/src/beta/realtime/ws.ts +10 -7
- package/node_modules/openai/src/client.ts +80 -18
- package/node_modules/openai/src/helpers/zod.ts +16 -0
- package/node_modules/openai/src/internal/bedrock.ts +153 -0
- package/node_modules/openai/src/internal/provider.ts +60 -0
- package/node_modules/openai/src/internal/utils/log.ts +1 -0
- package/node_modules/openai/src/lib/AbstractChatCompletionRunner.ts +96 -45
- package/node_modules/openai/src/lib/AssistantStream.ts +4 -20
- package/node_modules/openai/src/lib/ChatCompletionRunner.ts +1 -1
- package/node_modules/openai/src/lib/ChatCompletionStream.ts +4 -11
- package/node_modules/openai/src/lib/ChatCompletionStreamingRunner.ts +1 -1
- package/node_modules/openai/src/lib/EventEmitter.ts +11 -2
- package/node_modules/openai/src/lib/EventStream.ts +20 -0
- package/node_modules/openai/src/lib/ResponsesParser.ts +18 -4
- package/node_modules/openai/src/lib/responses/ResponseAccumulator.ts +412 -0
- package/node_modules/openai/src/lib/responses/ResponseInputItems.ts +127 -0
- package/node_modules/openai/src/lib/responses/ResponseStream.ts +4 -93
- package/node_modules/openai/src/providers/bedrock/aws.ts +255 -0
- package/node_modules/openai/src/providers/bedrock.ts +33 -0
- package/node_modules/openai/src/realtime/internal-base.ts +90 -7
- package/node_modules/openai/src/realtime/websocket.ts +15 -13
- package/node_modules/openai/src/realtime/ws.ts +15 -13
- package/node_modules/openai/src/version.ts +1 -1
- package/node_modules/openai/version.d.mts +1 -1
- package/node_modules/openai/version.d.ts +1 -1
- package/node_modules/openai/version.js +1 -1
- package/node_modules/openai/version.mjs +1 -1
- package/node_modules/pg/README.md +1 -0
- package/node_modules/pg/lib/client.js +7 -1
- package/node_modules/pg/lib/connection-parameters.js +13 -0
- package/node_modules/pg/lib/connection.js +43 -22
- package/node_modules/pg/lib/defaults.js +3 -0
- package/node_modules/pg/lib/query.js +4 -0
- package/node_modules/pg/package.json +4 -4
- package/node_modules/pg-connection-string/README.md +1 -1
- package/node_modules/pg-connection-string/index.d.ts +1 -0
- package/node_modules/pg-connection-string/index.js +6 -0
- package/node_modules/pg-connection-string/package.json +3 -3
- package/node_modules/pg-protocol/dist/b.js.map +1 -1
- package/node_modules/pg-protocol/dist/buffer-reader.d.ts +0 -1
- package/node_modules/pg-protocol/dist/buffer-reader.js +1 -1
- package/node_modules/pg-protocol/dist/buffer-reader.js.map +1 -1
- package/node_modules/pg-protocol/dist/buffer-writer.d.ts +2 -1
- package/node_modules/pg-protocol/dist/buffer-writer.js +23 -0
- package/node_modules/pg-protocol/dist/buffer-writer.js.map +1 -1
- package/node_modules/pg-protocol/dist/inbound-parser.test.js +1 -1
- package/node_modules/pg-protocol/dist/inbound-parser.test.js.map +1 -1
- package/node_modules/pg-protocol/dist/index.d.ts +0 -1
- package/node_modules/pg-protocol/dist/index.js +2 -2
- package/node_modules/pg-protocol/dist/index.js.map +1 -1
- package/node_modules/pg-protocol/dist/messages.d.ts +2 -3
- package/node_modules/pg-protocol/dist/outbound-serializer.test.js +73 -0
- package/node_modules/pg-protocol/dist/outbound-serializer.test.js.map +1 -1
- package/node_modules/pg-protocol/dist/parser.d.ts +3 -5
- package/node_modules/pg-protocol/dist/parser.js +1 -1
- package/node_modules/pg-protocol/dist/parser.js.map +1 -1
- package/node_modules/pg-protocol/dist/serializer.d.ts +9 -10
- package/node_modules/pg-protocol/dist/serializer.js +11 -4
- package/node_modules/pg-protocol/dist/serializer.js.map +1 -1
- package/node_modules/pg-protocol/package.json +2 -2
- package/node_modules/pg-protocol/src/buffer-reader.ts +1 -1
- package/node_modules/pg-protocol/src/buffer-writer.ts +25 -0
- package/node_modules/pg-protocol/src/outbound-serializer.test.ts +80 -0
- package/node_modules/pg-protocol/src/parser.ts +1 -1
- package/node_modules/pg-protocol/src/serializer.ts +10 -4
- package/node_modules/qs/CHANGELOG.md +11 -0
- package/node_modules/qs/dist/qs.js +17 -17
- package/node_modules/qs/lib/parse.js +19 -8
- package/node_modules/qs/lib/utils.js +47 -8
- package/node_modules/qs/package.json +6 -5
- package/node_modules/qs/test/parse.js +230 -0
- package/node_modules/qs/test/utils.js +194 -0
- package/node_modules/semver/classes/range.js +6 -2
- package/node_modules/semver/package.json +1 -1
- package/package.json +6 -6
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var formats = require('./formats');
|
|
4
4
|
var getSideChannel = require('side-channel');
|
|
5
|
+
var defineProperty = require('es-define-property');
|
|
5
6
|
|
|
6
7
|
var has = Object.prototype.hasOwnProperty;
|
|
7
8
|
var isArray = Array.isArray;
|
|
@@ -66,6 +67,19 @@ var arrayToObject = function arrayToObject(source, options) {
|
|
|
66
67
|
return obj;
|
|
67
68
|
};
|
|
68
69
|
|
|
70
|
+
var setProperty = function setProperty(obj, key, value) {
|
|
71
|
+
if (key === '__proto__' && defineProperty) {
|
|
72
|
+
defineProperty(obj, key, {
|
|
73
|
+
configurable: true,
|
|
74
|
+
enumerable: true,
|
|
75
|
+
value: value,
|
|
76
|
+
writable: true
|
|
77
|
+
});
|
|
78
|
+
} else {
|
|
79
|
+
obj[key] = value;
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
|
|
69
83
|
var merge = function merge(target, source, options) {
|
|
70
84
|
/* eslint no-param-reassign: 0 */
|
|
71
85
|
if (!source) {
|
|
@@ -75,7 +89,10 @@ var merge = function merge(target, source, options) {
|
|
|
75
89
|
if (typeof source !== 'object' && typeof source !== 'function') {
|
|
76
90
|
if (isArray(target)) {
|
|
77
91
|
var nextIndex = target.length;
|
|
78
|
-
if (options && typeof options.arrayLimit === 'number' && nextIndex
|
|
92
|
+
if (options && typeof options.arrayLimit === 'number' && nextIndex >= options.arrayLimit) {
|
|
93
|
+
if (options.throwOnLimitExceeded) {
|
|
94
|
+
throw new RangeError('Array limit exceeded. Only ' + options.arrayLimit + ' element' + (options.arrayLimit === 1 ? '' : 's') + ' allowed in an array.');
|
|
95
|
+
}
|
|
79
96
|
return markOverflow(arrayToObject(target.concat(source), options), nextIndex);
|
|
80
97
|
}
|
|
81
98
|
target[nextIndex] = source;
|
|
@@ -115,6 +132,9 @@ var merge = function merge(target, source, options) {
|
|
|
115
132
|
}
|
|
116
133
|
var combined = [target].concat(source);
|
|
117
134
|
if (options && typeof options.arrayLimit === 'number' && combined.length > options.arrayLimit) {
|
|
135
|
+
if (options.throwOnLimitExceeded) {
|
|
136
|
+
throw new RangeError('Array limit exceeded. Only ' + options.arrayLimit + ' element' + (options.arrayLimit === 1 ? '' : 's') + ' allowed in an array.');
|
|
137
|
+
}
|
|
118
138
|
return markOverflow(arrayToObject(combined, options), combined.length - 1);
|
|
119
139
|
}
|
|
120
140
|
return combined;
|
|
@@ -138,6 +158,12 @@ var merge = function merge(target, source, options) {
|
|
|
138
158
|
target[i] = item;
|
|
139
159
|
}
|
|
140
160
|
});
|
|
161
|
+
if (options && typeof options.arrayLimit === 'number' && target.length > options.arrayLimit) {
|
|
162
|
+
if (options.throwOnLimitExceeded) {
|
|
163
|
+
throw new RangeError('Array limit exceeded. Only ' + options.arrayLimit + ' element' + (options.arrayLimit === 1 ? '' : 's') + ' allowed in an array.');
|
|
164
|
+
}
|
|
165
|
+
return markOverflow(arrayToObject(target, options), target.length - 1);
|
|
166
|
+
}
|
|
141
167
|
return target;
|
|
142
168
|
}
|
|
143
169
|
|
|
@@ -145,9 +171,9 @@ var merge = function merge(target, source, options) {
|
|
|
145
171
|
var value = source[key];
|
|
146
172
|
|
|
147
173
|
if (has.call(acc, key)) {
|
|
148
|
-
acc
|
|
174
|
+
setProperty(acc, key, merge(acc[key], value, options));
|
|
149
175
|
} else {
|
|
150
|
-
acc
|
|
176
|
+
setProperty(acc, key, value);
|
|
151
177
|
}
|
|
152
178
|
|
|
153
179
|
if (isOverflow(source) && !isOverflow(acc)) {
|
|
@@ -166,7 +192,7 @@ var merge = function merge(target, source, options) {
|
|
|
166
192
|
|
|
167
193
|
var assign = function assignSingleSource(target, source) {
|
|
168
194
|
return Object.keys(source).reduce(function (acc, key) {
|
|
169
|
-
acc
|
|
195
|
+
setProperty(acc, key, source[key]);
|
|
170
196
|
return acc;
|
|
171
197
|
}, target);
|
|
172
198
|
};
|
|
@@ -212,6 +238,13 @@ var encode = function encode(str, defaultEncoder, charset, kind, format) {
|
|
|
212
238
|
var out = '';
|
|
213
239
|
for (var j = 0; j < string.length; j += limit) {
|
|
214
240
|
var segment = string.length >= limit ? string.slice(j, j + limit) : string;
|
|
241
|
+
if (j + limit < string.length) {
|
|
242
|
+
var last = segment.charCodeAt(segment.length - 1);
|
|
243
|
+
if (last >= 0xD800 && last <= 0xDBFF) {
|
|
244
|
+
segment = segment.slice(0, -1);
|
|
245
|
+
j -= 1;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
215
248
|
var arr = [];
|
|
216
249
|
|
|
217
250
|
for (var i = 0; i < segment.length; ++i) {
|
|
@@ -265,7 +298,7 @@ var encode = function encode(str, defaultEncoder, charset, kind, format) {
|
|
|
265
298
|
|
|
266
299
|
var compact = function compact(value) {
|
|
267
300
|
var queue = [{ obj: { o: value }, prop: 'o' }];
|
|
268
|
-
var refs =
|
|
301
|
+
var refs = getSideChannel();
|
|
269
302
|
|
|
270
303
|
for (var i = 0; i < queue.length; ++i) {
|
|
271
304
|
var item = queue[i];
|
|
@@ -275,9 +308,9 @@ var compact = function compact(value) {
|
|
|
275
308
|
for (var j = 0; j < keys.length; ++j) {
|
|
276
309
|
var key = keys[j];
|
|
277
310
|
var val = obj[key];
|
|
278
|
-
if (typeof val === 'object' && val !== null && refs.
|
|
311
|
+
if (typeof val === 'object' && val !== null && !refs.has(val)) {
|
|
279
312
|
queue[queue.length] = { obj: obj, prop: key };
|
|
280
|
-
refs
|
|
313
|
+
refs.set(val, true);
|
|
281
314
|
}
|
|
282
315
|
}
|
|
283
316
|
}
|
|
@@ -299,9 +332,12 @@ var isBuffer = function isBuffer(obj) {
|
|
|
299
332
|
return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
|
|
300
333
|
};
|
|
301
334
|
|
|
302
|
-
var combine = function combine(a, b, arrayLimit, plainObjects) {
|
|
335
|
+
var combine = function combine(a, b, arrayLimit, plainObjects, throwOnLimitExceeded) {
|
|
303
336
|
// If 'a' is already an overflow object, add to it
|
|
304
337
|
if (isOverflow(a)) {
|
|
338
|
+
if (throwOnLimitExceeded) {
|
|
339
|
+
throw new RangeError('Array limit exceeded. Only ' + arrayLimit + ' element' + (arrayLimit === 1 ? '' : 's') + ' allowed in an array.');
|
|
340
|
+
}
|
|
305
341
|
var newIndex = getMaxIndex(a) + 1;
|
|
306
342
|
a[newIndex] = b;
|
|
307
343
|
setMaxIndex(a, newIndex);
|
|
@@ -310,6 +346,9 @@ var combine = function combine(a, b, arrayLimit, plainObjects) {
|
|
|
310
346
|
|
|
311
347
|
var result = [].concat(a, b);
|
|
312
348
|
if (result.length > arrayLimit) {
|
|
349
|
+
if (throwOnLimitExceeded) {
|
|
350
|
+
throw new RangeError('Array limit exceeded. Only ' + arrayLimit + ' element' + (arrayLimit === 1 ? '' : 's') + ' allowed in an array.');
|
|
351
|
+
}
|
|
313
352
|
return markOverflow(arrayToObject(result, { plainObjects: plainObjects }), result.length - 1);
|
|
314
353
|
}
|
|
315
354
|
return result;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "qs",
|
|
3
3
|
"description": "A querystring parser that supports nesting and arrays, with a depth limit",
|
|
4
4
|
"homepage": "https://github.com/ljharb/qs",
|
|
5
|
-
"version": "6.15.
|
|
5
|
+
"version": "6.15.3",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "https://github.com/ljharb/qs.git"
|
|
@@ -31,7 +31,8 @@
|
|
|
31
31
|
"node": ">=0.6"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"
|
|
34
|
+
"es-define-property": "^1.0.1",
|
|
35
|
+
"side-channel": "^1.1.1"
|
|
35
36
|
},
|
|
36
37
|
"devDependencies": {
|
|
37
38
|
"@browserify/envify": "^6.0.0",
|
|
@@ -42,7 +43,7 @@
|
|
|
42
43
|
"common-shakeify": "~1.0.0",
|
|
43
44
|
"eclint": "^2.8.1",
|
|
44
45
|
"es-value-fixtures": "^1.7.1",
|
|
45
|
-
"eslint": "^
|
|
46
|
+
"eslint": "^10.5.0",
|
|
46
47
|
"evalmd": "^0.0.19",
|
|
47
48
|
"for-each": "^0.3.5",
|
|
48
49
|
"glob": "=10.3.7",
|
|
@@ -56,7 +57,7 @@
|
|
|
56
57
|
"jackspeak": "=2.1.1",
|
|
57
58
|
"jiti": "^0.0.0",
|
|
58
59
|
"mkdirp": "^0.5.5",
|
|
59
|
-
"mock-property": "^1.1.
|
|
60
|
+
"mock-property": "^1.1.2",
|
|
60
61
|
"module-deps": "^6.2.3",
|
|
61
62
|
"npmignore": "^0.3.5",
|
|
62
63
|
"nyc": "^10.3.2",
|
|
@@ -64,7 +65,7 @@
|
|
|
64
65
|
"qs-iconv": "^1.0.4",
|
|
65
66
|
"safe-publish-latest": "^2.0.0",
|
|
66
67
|
"safer-buffer": "^2.1.2",
|
|
67
|
-
"tape": "^5.
|
|
68
|
+
"tape": "^5.10.2",
|
|
68
69
|
"unassertify": "^3.0.1"
|
|
69
70
|
},
|
|
70
71
|
"scripts": {
|
|
@@ -14,6 +14,12 @@ var hasProto = require('has-proto')();
|
|
|
14
14
|
var qs = require('../');
|
|
15
15
|
var utils = require('../lib/utils');
|
|
16
16
|
|
|
17
|
+
var characterizeParse = function characterizeParse(st, input, opts, expected, label) {
|
|
18
|
+
var result;
|
|
19
|
+
st.doesNotThrow(function () { result = qs.parse(input, opts); }, label + ': does not throw');
|
|
20
|
+
st.deepEqual(result, expected, label + ': parses to the current lenient output');
|
|
21
|
+
};
|
|
22
|
+
|
|
17
23
|
test('parse()', function (t) {
|
|
18
24
|
t.test('parses a simple string', function (st) {
|
|
19
25
|
st.deepEqual(qs.parse('0=foo'), { 0: 'foo' });
|
|
@@ -312,6 +318,48 @@ test('parse()', function (t) {
|
|
|
312
318
|
st.end();
|
|
313
319
|
});
|
|
314
320
|
|
|
321
|
+
t.test('currently parses unbalanced bracket keys after a parent leniently to literal segments (issue #558)', function (st) {
|
|
322
|
+
characterizeParse(st, 'a[bc=v', undefined, { a: { '[bc': 'v' } }, 'unclosed group after a parent');
|
|
323
|
+
characterizeParse(st, 'a[=v', undefined, { a: { '[': 'v' } }, 'bare unclosed bracket after a parent');
|
|
324
|
+
characterizeParse(st, 'a[b][c=v', undefined, { a: { b: { '[c': 'v' } } }, 'unclosed group after a valid one');
|
|
325
|
+
characterizeParse(st, 'a[b]c[d=v', undefined, { a: { b: { '[d': 'v' } } }, 'unclosed group after text following a valid one');
|
|
326
|
+
characterizeParse(st, 'filters[customtags:Env: Prod=v', undefined, { filters: { '[customtags:Env: Prod': 'v' } }, 'the issue #558 reproduction');
|
|
327
|
+
characterizeParse(st, '][a=v', undefined, { ']': { '[a': 'v' } }, 'stray close bracket before an unclosed group');
|
|
328
|
+
characterizeParse(st, 'a][b=v', undefined, { 'a]': { '[b': 'v' } }, 'stray close bracket inside the parent');
|
|
329
|
+
st.end();
|
|
330
|
+
});
|
|
331
|
+
|
|
332
|
+
t.test('currently parses unbalanced bracket keys containing inner brackets leniently (issue #558)', function (st) {
|
|
333
|
+
characterizeParse(st, 'a[b[c=v', undefined, { a: { '[b[c': 'v' } }, 'unclosed group containing an inner bracket');
|
|
334
|
+
characterizeParse(st, 'a[b[c]=v', undefined, { a: { '[b[c]': 'v' } }, 'unbalanced group with an inner bracket and one close');
|
|
335
|
+
characterizeParse(st, 'a[b][c[d=v', undefined, { a: { b: { '[c[d': 'v' } } }, 'unclosed inner-bracket group after a valid one');
|
|
336
|
+
st.end();
|
|
337
|
+
});
|
|
338
|
+
|
|
339
|
+
t.test('currently parses bracket-prefixed unbalanced keys leniently (issue #558)', function (st) {
|
|
340
|
+
characterizeParse(st, '[abc=v', undefined, { '[abc': 'v' }, 'key starting with an unclosed bracket');
|
|
341
|
+
characterizeParse(st, '[[]b=v', undefined, { '[[]b': 'v' }, 'key starting with an unbalanced bracket group');
|
|
342
|
+
st.end();
|
|
343
|
+
});
|
|
344
|
+
|
|
345
|
+
t.test('lenient unbalanced-bracket handling currently depends on the depth option (issue #558)', function (st) {
|
|
346
|
+
characterizeParse(st, 'a[b]c[d]e[f=v', { depth: 5 }, { a: { b: { d: { '[f': 'v' } } } }, 'consumes groups up to the depth budget then keeps the unclosed remainder literal');
|
|
347
|
+
characterizeParse(st, 'a[b]c[d]e[f=v', { depth: 1 }, { a: { b: { '[d]e[f': 'v' } } }, 'a lower depth keeps more of the unclosed remainder literal');
|
|
348
|
+
characterizeParse(st, 'a[bc=v', { depth: 0 }, { 'a[bc': 'v' }, 'depth 0 keeps the entire key literal');
|
|
349
|
+
st.end();
|
|
350
|
+
});
|
|
351
|
+
|
|
352
|
+
t.test('currently parses an allowDots key with a trailing unclosed bracket leniently (issue #558)', function (st) {
|
|
353
|
+
characterizeParse(st, 'a.b[c=v', { allowDots: true }, { a: { b: { '[c': 'v' } } }, 'allowDots expands the dot then keeps the unclosed bracket literal');
|
|
354
|
+
st.end();
|
|
355
|
+
});
|
|
356
|
+
|
|
357
|
+
t.test('valid and stray-close bracket keys are unaffected by unbalanced-bracket handling', function (st) {
|
|
358
|
+
characterizeParse(st, 'a]b=v', undefined, { 'a]b': 'v' }, 'stray close bracket with no open bracket stays a flat key');
|
|
359
|
+
characterizeParse(st, 'a[b]extra=v', undefined, { a: { b: 'v' } }, 'text after a balanced group is ignored');
|
|
360
|
+
st.end();
|
|
361
|
+
});
|
|
362
|
+
|
|
315
363
|
t.test('allows to specify array indices', function (st) {
|
|
316
364
|
st.deepEqual(qs.parse('a[1]=c&a[0]=b&a[2]=d'), { a: ['b', 'c', 'd'] });
|
|
317
365
|
st.deepEqual(qs.parse('a[1]=c&a[0]=b'), { a: ['b', 'c'] });
|
|
@@ -726,6 +774,21 @@ test('parse()', function (t) {
|
|
|
726
774
|
st.end();
|
|
727
775
|
});
|
|
728
776
|
|
|
777
|
+
t.test('does not crash on multi-step circular references', function (st) {
|
|
778
|
+
var a = {};
|
|
779
|
+
a.b = { c: { d: a } };
|
|
780
|
+
|
|
781
|
+
var parsed;
|
|
782
|
+
|
|
783
|
+
st.doesNotThrow(function () {
|
|
784
|
+
parsed = qs.parse({ foo: a });
|
|
785
|
+
});
|
|
786
|
+
|
|
787
|
+
st.equal('foo' in parsed, true, 'parsed has "foo" property');
|
|
788
|
+
st.equal(parsed.foo.b.c.d, parsed.foo, 'the multi-step cycle is preserved');
|
|
789
|
+
st.end();
|
|
790
|
+
});
|
|
791
|
+
|
|
729
792
|
t.test('does not crash when parsing deep objects', function (st) {
|
|
730
793
|
var parsed;
|
|
731
794
|
var str = 'foo';
|
|
@@ -959,6 +1022,22 @@ test('parse()', function (t) {
|
|
|
959
1022
|
st.end();
|
|
960
1023
|
});
|
|
961
1024
|
|
|
1025
|
+
t.test('object-valued input with own `__proto__` does not mutate sub-object [[Prototype]]', function (st) {
|
|
1026
|
+
// JSON.parse creates own data `__proto__` properties (via CreateDataProperty),
|
|
1027
|
+
// which would trigger the Object.prototype.__proto__ accessor if merged via `acc[key] = value`.
|
|
1028
|
+
var out = qs.parse({
|
|
1029
|
+
'user[name]': 'alice',
|
|
1030
|
+
user: JSON.parse('{"__proto__":{"isAdmin":true}}')
|
|
1031
|
+
}, { allowPrototypes: false });
|
|
1032
|
+
|
|
1033
|
+
st.equal(out.user.name, 'alice', 'name from bracket key is preserved');
|
|
1034
|
+
st.equal(out.user.isAdmin, undefined, 'attacker-controlled inherited property is not exposed');
|
|
1035
|
+
st.equal(Object.getPrototypeOf(out.user), Object.prototype, 'sub-object [[Prototype]] is unchanged');
|
|
1036
|
+
st.equal(Object.prototype.isAdmin, undefined, 'Object.prototype is not polluted');
|
|
1037
|
+
|
|
1038
|
+
st.end();
|
|
1039
|
+
});
|
|
1040
|
+
|
|
962
1041
|
t.test('can return null objects', { skip: !hasProto }, function (st) {
|
|
963
1042
|
var expected = {
|
|
964
1043
|
__proto__: null,
|
|
@@ -1309,6 +1388,157 @@ test('parse()', function (t) {
|
|
|
1309
1388
|
sst.end();
|
|
1310
1389
|
});
|
|
1311
1390
|
|
|
1391
|
+
st.test('throws when cumulative comma + duplicate-key combine exceeds arrayLimit', function (sst) {
|
|
1392
|
+
sst['throws'](
|
|
1393
|
+
function () {
|
|
1394
|
+
qs.parse('a=1,2,3&a=4,5,6', { comma: true, arrayLimit: 5, throwOnLimitExceeded: true });
|
|
1395
|
+
},
|
|
1396
|
+
new RangeError('Array limit exceeded. Only 5 elements allowed in an array.'),
|
|
1397
|
+
'throws when comma groups within the limit cumulatively exceed it across duplicate keys'
|
|
1398
|
+
);
|
|
1399
|
+
|
|
1400
|
+
sst['throws'](
|
|
1401
|
+
function () {
|
|
1402
|
+
qs.parse('a=v,v,v,v,v&a=v,v,v,v,v&a=v,v,v,v,v', { comma: true, arrayLimit: 5, throwOnLimitExceeded: true });
|
|
1403
|
+
},
|
|
1404
|
+
new RangeError('Array limit exceeded. Only 5 elements allowed in an array.'),
|
|
1405
|
+
'throws on a subsequent part once the cumulative array is already over the limit'
|
|
1406
|
+
);
|
|
1407
|
+
sst.end();
|
|
1408
|
+
});
|
|
1409
|
+
|
|
1410
|
+
st.test('throws when plain duplicate keys combine past arrayLimit at the boundary', function (sst) {
|
|
1411
|
+
sst['throws'](
|
|
1412
|
+
function () { qs.parse('a=x&a=y', { arrayLimit: 1, throwOnLimitExceeded: true }); },
|
|
1413
|
+
new RangeError('Array limit exceeded. Only 1 element allowed in an array.'),
|
|
1414
|
+
'duplicate scalar keys'
|
|
1415
|
+
);
|
|
1416
|
+
|
|
1417
|
+
sst['throws'](
|
|
1418
|
+
function () { qs.parse('a[]=x&a[]=y', { arrayLimit: 1, throwOnLimitExceeded: true }); },
|
|
1419
|
+
new RangeError('Array limit exceeded. Only 1 element allowed in an array.'),
|
|
1420
|
+
'duplicate bracket keys'
|
|
1421
|
+
);
|
|
1422
|
+
sst.end();
|
|
1423
|
+
});
|
|
1424
|
+
|
|
1425
|
+
st.test('throws when mixed index and key notation merge past arrayLimit', function (sst) {
|
|
1426
|
+
sst['throws'](
|
|
1427
|
+
function () { qs.parse('a=x&a[0]=y', { arrayLimit: 1, throwOnLimitExceeded: true }); },
|
|
1428
|
+
new RangeError('Array limit exceeded. Only 1 element allowed in an array.'),
|
|
1429
|
+
'scalar then index that overflows on merge'
|
|
1430
|
+
);
|
|
1431
|
+
|
|
1432
|
+
sst['throws'](
|
|
1433
|
+
function () { qs.parse('a[0]=1&a[1]=2&a=3', { arrayLimit: 1, throwOnLimitExceeded: true }); },
|
|
1434
|
+
new RangeError('Array limit exceeded. Only 1 element allowed in an array.'),
|
|
1435
|
+
'indexed array then scalar that overflows on merge'
|
|
1436
|
+
);
|
|
1437
|
+
sst.end();
|
|
1438
|
+
});
|
|
1439
|
+
|
|
1440
|
+
st.test('enforces arrayLimit on merge at the boundary, consistently with combine', function (sst) {
|
|
1441
|
+
sst['throws'](
|
|
1442
|
+
function () { qs.parse('a[0]=x&a=y', { arrayLimit: 1, throwOnLimitExceeded: true }); },
|
|
1443
|
+
new RangeError('Array limit exceeded. Only 1 element allowed in an array.'),
|
|
1444
|
+
'a trailing scalar merged into an at-limit array throws'
|
|
1445
|
+
);
|
|
1446
|
+
sst.deepEqual(
|
|
1447
|
+
qs.parse('a[0]=x&a=y', { arrayLimit: 1 }),
|
|
1448
|
+
{ a: { 0: 'x', 1: 'y' } },
|
|
1449
|
+
'and converts to an overflow object without throwOnLimitExceeded'
|
|
1450
|
+
);
|
|
1451
|
+
|
|
1452
|
+
sst['throws'](
|
|
1453
|
+
function () { qs.parse('a[0]=x&a[]=y', { arrayLimit: 1, throwOnLimitExceeded: true }); },
|
|
1454
|
+
new RangeError('Array limit exceeded. Only 1 element allowed in an array.'),
|
|
1455
|
+
'mixed index and bracket notation merged past the limit throws'
|
|
1456
|
+
);
|
|
1457
|
+
sst.deepEqual(
|
|
1458
|
+
qs.parse('a[0]=x&a[]=y', { arrayLimit: 1 }),
|
|
1459
|
+
{ a: { 0: 'x', 1: 'y' } },
|
|
1460
|
+
'mixed index and bracket notation converts like duplicate-bracket combine'
|
|
1461
|
+
);
|
|
1462
|
+
|
|
1463
|
+
sst.end();
|
|
1464
|
+
});
|
|
1465
|
+
|
|
1466
|
+
st.test('does not throw when cumulative comma combine stays within arrayLimit', function (sst) {
|
|
1467
|
+
var result = qs.parse('a=1,2,3&a=4', { comma: true, arrayLimit: 5, throwOnLimitExceeded: true });
|
|
1468
|
+
sst.deepEqual(result, { a: ['1', '2', '3', '4'] }, 'combined array within limit is preserved');
|
|
1469
|
+
sst.end();
|
|
1470
|
+
});
|
|
1471
|
+
|
|
1472
|
+
st.test('silently combines to an overflow object when throwOnLimitExceeded is not set', function (sst) {
|
|
1473
|
+
var result = qs.parse('a=1,2,3&a=4,5,6', { comma: true, arrayLimit: 5 });
|
|
1474
|
+
sst.deepEqual(result, { a: { 0: '1', 1: '2', 2: '3', 3: '4', 4: '5', 5: '6' } }, 'converts to object without throwing');
|
|
1475
|
+
sst.end();
|
|
1476
|
+
});
|
|
1477
|
+
|
|
1478
|
+
st.test('does not throw for comma groups nested under bracket notation, counting each group as one element', function (sst) {
|
|
1479
|
+
var result = qs.parse('a[]=1,2,3&a[]=4,5,6', { comma: true, arrayLimit: 5, throwOnLimitExceeded: true });
|
|
1480
|
+
sst.deepEqual(result, { a: [['1', '2', '3'], ['4', '5', '6']] }, 'nested comma groups count as one element each');
|
|
1481
|
+
sst.end();
|
|
1482
|
+
});
|
|
1483
|
+
|
|
1484
|
+
st.test('throws before splitting when a single comma value exceeds arrayLimit', function (sst) {
|
|
1485
|
+
sst['throws'](
|
|
1486
|
+
function () {
|
|
1487
|
+
qs.parse('a=1,2,3,4,5,6', { comma: true, arrayLimit: 5, throwOnLimitExceeded: true });
|
|
1488
|
+
},
|
|
1489
|
+
new RangeError('Array limit exceeded. Only 5 elements allowed in an array.'),
|
|
1490
|
+
'a flat comma value over the limit throws'
|
|
1491
|
+
);
|
|
1492
|
+
|
|
1493
|
+
sst['throws'](
|
|
1494
|
+
function () {
|
|
1495
|
+
qs.parse('a=1,2', { comma: true, arrayLimit: 1, throwOnLimitExceeded: true });
|
|
1496
|
+
},
|
|
1497
|
+
new RangeError('Array limit exceeded. Only 1 element allowed in an array.'),
|
|
1498
|
+
'singular message at arrayLimit 1'
|
|
1499
|
+
);
|
|
1500
|
+
|
|
1501
|
+
sst['throws'](
|
|
1502
|
+
function () {
|
|
1503
|
+
qs.parse('a[b]=1,2,3,4,5,6', { comma: true, arrayLimit: 5, throwOnLimitExceeded: true });
|
|
1504
|
+
},
|
|
1505
|
+
new RangeError('Array limit exceeded. Only 5 elements allowed in an array.'),
|
|
1506
|
+
'a non-bracket nested key comma value over the limit throws'
|
|
1507
|
+
);
|
|
1508
|
+
sst.end();
|
|
1509
|
+
});
|
|
1510
|
+
|
|
1511
|
+
st.test('does not throw for a single comma value within arrayLimit', function (sst) {
|
|
1512
|
+
sst.deepEqual(
|
|
1513
|
+
qs.parse('a=1,2,3', { comma: true, arrayLimit: 5, throwOnLimitExceeded: true }),
|
|
1514
|
+
{ a: ['1', '2', '3'] },
|
|
1515
|
+
'within the limit'
|
|
1516
|
+
);
|
|
1517
|
+
sst.deepEqual(
|
|
1518
|
+
qs.parse('a=1,2,3,4,5', { comma: true, arrayLimit: 5, throwOnLimitExceeded: true }),
|
|
1519
|
+
{ a: ['1', '2', '3', '4', '5'] },
|
|
1520
|
+
'exactly at the limit'
|
|
1521
|
+
);
|
|
1522
|
+
sst.end();
|
|
1523
|
+
});
|
|
1524
|
+
|
|
1525
|
+
st.test('does not throw for a bracketed comma group within arrayLimit', function (sst) {
|
|
1526
|
+
var result = qs.parse('a[]=1,2,3,4,5,6', { comma: true, arrayLimit: 5, throwOnLimitExceeded: true });
|
|
1527
|
+
sst.deepEqual(result, { a: [['1', '2', '3', '4', '5', '6']] }, 'a bracketed comma group is a single element');
|
|
1528
|
+
sst.end();
|
|
1529
|
+
});
|
|
1530
|
+
|
|
1531
|
+
st.test('throws for a bracketed comma group when arrayLimit is 0', function (sst) {
|
|
1532
|
+
sst['throws'](
|
|
1533
|
+
function () {
|
|
1534
|
+
qs.parse('a[]=1,2,3', { comma: true, arrayLimit: 0, throwOnLimitExceeded: true });
|
|
1535
|
+
},
|
|
1536
|
+
new RangeError('Array limit exceeded. Only 0 elements allowed in an array.'),
|
|
1537
|
+
'a single bracketed element still exceeds arrayLimit 0'
|
|
1538
|
+
);
|
|
1539
|
+
sst.end();
|
|
1540
|
+
});
|
|
1541
|
+
|
|
1312
1542
|
st.end();
|
|
1313
1543
|
});
|
|
1314
1544
|
|