openai 6.43.0 → 6.45.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/CHANGELOG.md +56 -0
- package/README.md +85 -102
- package/_vendor/zod-to-json-schema/parseDef.d.mts.map +1 -1
- package/_vendor/zod-to-json-schema/parseDef.d.ts.map +1 -1
- package/_vendor/zod-to-json-schema/parseDef.js +41 -15
- package/_vendor/zod-to-json-schema/parseDef.js.map +1 -1
- package/_vendor/zod-to-json-schema/parseDef.mjs +41 -15
- package/_vendor/zod-to-json-schema/parseDef.mjs.map +1 -1
- package/_vendor/zod-to-json-schema/parsers/branded.d.mts +1 -1
- package/_vendor/zod-to-json-schema/parsers/branded.d.mts.map +1 -1
- package/_vendor/zod-to-json-schema/parsers/branded.d.ts +1 -1
- package/_vendor/zod-to-json-schema/parsers/branded.d.ts.map +1 -1
- package/_vendor/zod-to-json-schema/parsers/branded.js +2 -2
- package/_vendor/zod-to-json-schema/parsers/branded.js.map +1 -1
- package/_vendor/zod-to-json-schema/parsers/branded.mjs +2 -2
- package/_vendor/zod-to-json-schema/parsers/branded.mjs.map +1 -1
- package/_vendor/zod-to-json-schema/parsers/catch.d.mts +1 -1
- package/_vendor/zod-to-json-schema/parsers/catch.d.mts.map +1 -1
- package/_vendor/zod-to-json-schema/parsers/catch.d.ts +1 -1
- package/_vendor/zod-to-json-schema/parsers/catch.d.ts.map +1 -1
- package/_vendor/zod-to-json-schema/parsers/catch.js +2 -2
- package/_vendor/zod-to-json-schema/parsers/catch.js.map +1 -1
- package/_vendor/zod-to-json-schema/parsers/catch.mjs +2 -2
- package/_vendor/zod-to-json-schema/parsers/catch.mjs.map +1 -1
- package/_vendor/zod-to-json-schema/parsers/default.d.mts +1 -1
- package/_vendor/zod-to-json-schema/parsers/default.d.mts.map +1 -1
- package/_vendor/zod-to-json-schema/parsers/default.d.ts +1 -1
- package/_vendor/zod-to-json-schema/parsers/default.d.ts.map +1 -1
- package/_vendor/zod-to-json-schema/parsers/default.js +2 -2
- package/_vendor/zod-to-json-schema/parsers/default.js.map +1 -1
- package/_vendor/zod-to-json-schema/parsers/default.mjs +2 -2
- package/_vendor/zod-to-json-schema/parsers/default.mjs.map +1 -1
- package/_vendor/zod-to-json-schema/parsers/nullable.d.mts +1 -1
- package/_vendor/zod-to-json-schema/parsers/nullable.d.mts.map +1 -1
- package/_vendor/zod-to-json-schema/parsers/nullable.d.ts +1 -1
- package/_vendor/zod-to-json-schema/parsers/nullable.d.ts.map +1 -1
- package/_vendor/zod-to-json-schema/parsers/nullable.js +2 -2
- package/_vendor/zod-to-json-schema/parsers/nullable.js.map +1 -1
- package/_vendor/zod-to-json-schema/parsers/nullable.mjs +2 -2
- package/_vendor/zod-to-json-schema/parsers/nullable.mjs.map +1 -1
- package/_vendor/zod-to-json-schema/parsers/optional.d.mts +1 -1
- package/_vendor/zod-to-json-schema/parsers/optional.d.mts.map +1 -1
- package/_vendor/zod-to-json-schema/parsers/optional.d.ts +1 -1
- package/_vendor/zod-to-json-schema/parsers/optional.d.ts.map +1 -1
- package/_vendor/zod-to-json-schema/parsers/optional.js +3 -3
- package/_vendor/zod-to-json-schema/parsers/optional.js.map +1 -1
- package/_vendor/zod-to-json-schema/parsers/optional.mjs +3 -3
- package/_vendor/zod-to-json-schema/parsers/optional.mjs.map +1 -1
- package/_vendor/zod-to-json-schema/parsers/pipeline.d.mts +1 -1
- package/_vendor/zod-to-json-schema/parsers/pipeline.d.mts.map +1 -1
- package/_vendor/zod-to-json-schema/parsers/pipeline.d.ts +1 -1
- package/_vendor/zod-to-json-schema/parsers/pipeline.d.ts.map +1 -1
- package/_vendor/zod-to-json-schema/parsers/pipeline.js +3 -3
- package/_vendor/zod-to-json-schema/parsers/pipeline.js.map +1 -1
- package/_vendor/zod-to-json-schema/parsers/pipeline.mjs +3 -3
- package/_vendor/zod-to-json-schema/parsers/pipeline.mjs.map +1 -1
- package/_vendor/zod-to-json-schema/parsers/promise.d.mts +1 -1
- package/_vendor/zod-to-json-schema/parsers/promise.d.mts.map +1 -1
- package/_vendor/zod-to-json-schema/parsers/promise.d.ts +1 -1
- package/_vendor/zod-to-json-schema/parsers/promise.d.ts.map +1 -1
- package/_vendor/zod-to-json-schema/parsers/promise.js +2 -2
- package/_vendor/zod-to-json-schema/parsers/promise.js.map +1 -1
- package/_vendor/zod-to-json-schema/parsers/promise.mjs +2 -2
- package/_vendor/zod-to-json-schema/parsers/promise.mjs.map +1 -1
- package/_vendor/zod-to-json-schema/parsers/readonly.d.mts +1 -1
- package/_vendor/zod-to-json-schema/parsers/readonly.d.mts.map +1 -1
- package/_vendor/zod-to-json-schema/parsers/readonly.d.ts +1 -1
- package/_vendor/zod-to-json-schema/parsers/readonly.d.ts.map +1 -1
- package/_vendor/zod-to-json-schema/parsers/readonly.js +2 -2
- package/_vendor/zod-to-json-schema/parsers/readonly.js.map +1 -1
- package/_vendor/zod-to-json-schema/parsers/readonly.mjs +2 -2
- package/_vendor/zod-to-json-schema/parsers/readonly.mjs.map +1 -1
- package/auth/workload-identity-auth.d.mts.map +1 -1
- package/auth/workload-identity-auth.d.ts.map +1 -1
- package/auth/workload-identity-auth.js +12 -4
- package/auth/workload-identity-auth.js.map +1 -1
- package/auth/workload-identity-auth.mjs +13 -5
- package/auth/workload-identity-auth.mjs.map +1 -1
- package/azure.d.mts +3 -1
- package/azure.d.mts.map +1 -1
- package/azure.d.ts +3 -1
- package/azure.d.ts.map +1 -1
- package/azure.js.map +1 -1
- package/azure.mjs.map +1 -1
- package/beta/realtime/internal-base.d.mts +14 -1
- package/beta/realtime/internal-base.d.mts.map +1 -1
- package/beta/realtime/internal-base.d.ts +14 -1
- package/beta/realtime/internal-base.d.ts.map +1 -1
- package/beta/realtime/internal-base.js +21 -5
- package/beta/realtime/internal-base.js.map +1 -1
- package/beta/realtime/internal-base.mjs +21 -5
- package/beta/realtime/internal-base.mjs.map +1 -1
- package/beta/realtime/websocket.d.mts +3 -5
- package/beta/realtime/websocket.d.mts.map +1 -1
- package/beta/realtime/websocket.d.ts +3 -5
- package/beta/realtime/websocket.d.ts.map +1 -1
- package/beta/realtime/websocket.js +2 -3
- package/beta/realtime/websocket.js.map +1 -1
- package/beta/realtime/websocket.mjs +3 -4
- package/beta/realtime/websocket.mjs.map +1 -1
- package/beta/realtime/ws.d.mts +3 -5
- package/beta/realtime/ws.d.mts.map +1 -1
- package/beta/realtime/ws.d.ts +3 -5
- package/beta/realtime/ws.d.ts.map +1 -1
- package/beta/realtime/ws.js +2 -3
- package/beta/realtime/ws.js.map +1 -1
- package/beta/realtime/ws.mjs +3 -4
- package/beta/realtime/ws.mjs.map +1 -1
- package/client.d.mts +9 -1
- package/client.d.mts.map +1 -1
- package/client.d.ts +9 -1
- package/client.d.ts.map +1 -1
- package/client.js +56 -9
- package/client.js.map +1 -1
- package/client.mjs +56 -9
- package/client.mjs.map +1 -1
- package/helpers/zod.d.mts.map +1 -1
- package/helpers/zod.d.ts.map +1 -1
- package/helpers/zod.js +12 -0
- package/helpers/zod.js.map +1 -1
- package/helpers/zod.mjs +12 -0
- package/helpers/zod.mjs.map +1 -1
- package/internal/bedrock.d.mts +34 -0
- package/internal/bedrock.d.mts.map +1 -0
- package/internal/bedrock.d.ts +34 -0
- package/internal/bedrock.d.ts.map +1 -0
- package/internal/bedrock.js +107 -0
- package/internal/bedrock.js.map +1 -0
- package/internal/bedrock.mjs +99 -0
- package/internal/bedrock.mjs.map +1 -0
- package/internal/provider.d.mts +23 -0
- package/internal/provider.d.mts.map +1 -0
- package/internal/provider.d.ts +23 -0
- package/internal/provider.d.ts.map +1 -0
- package/internal/provider.js +36 -0
- package/internal/provider.js.map +1 -0
- package/internal/provider.mjs +32 -0
- package/internal/provider.mjs.map +1 -0
- package/internal/utils/log.d.mts.map +1 -1
- package/internal/utils/log.d.ts.map +1 -1
- package/internal/utils/log.js +1 -0
- package/internal/utils/log.js.map +1 -1
- package/internal/utils/log.mjs +1 -0
- package/internal/utils/log.mjs.map +1 -1
- package/lib/AbstractChatCompletionRunner.d.mts +15 -4
- package/lib/AbstractChatCompletionRunner.d.mts.map +1 -1
- package/lib/AbstractChatCompletionRunner.d.ts +15 -4
- package/lib/AbstractChatCompletionRunner.d.ts.map +1 -1
- package/lib/AbstractChatCompletionRunner.js +63 -40
- package/lib/AbstractChatCompletionRunner.js.map +1 -1
- package/lib/AbstractChatCompletionRunner.mjs +63 -40
- package/lib/AbstractChatCompletionRunner.mjs.map +1 -1
- package/lib/AssistantStream.d.mts.map +1 -1
- package/lib/AssistantStream.d.ts.map +1 -1
- package/lib/AssistantStream.js +4 -24
- package/lib/AssistantStream.js.map +1 -1
- package/lib/AssistantStream.mjs +4 -24
- package/lib/AssistantStream.mjs.map +1 -1
- package/lib/ChatCompletionRunner.js +1 -1
- package/lib/ChatCompletionRunner.js.map +1 -1
- package/lib/ChatCompletionRunner.mjs +1 -1
- package/lib/ChatCompletionRunner.mjs.map +1 -1
- package/lib/ChatCompletionStream.d.mts.map +1 -1
- package/lib/ChatCompletionStream.d.ts.map +1 -1
- package/lib/ChatCompletionStream.js +4 -13
- package/lib/ChatCompletionStream.js.map +1 -1
- package/lib/ChatCompletionStream.mjs +4 -13
- package/lib/ChatCompletionStream.mjs.map +1 -1
- package/lib/ChatCompletionStreamingRunner.js +1 -1
- package/lib/ChatCompletionStreamingRunner.js.map +1 -1
- package/lib/ChatCompletionStreamingRunner.mjs +1 -1
- package/lib/ChatCompletionStreamingRunner.mjs.map +1 -1
- package/lib/EventEmitter.d.mts.map +1 -1
- package/lib/EventEmitter.d.ts.map +1 -1
- package/lib/EventEmitter.js +12 -2
- package/lib/EventEmitter.js.map +1 -1
- package/lib/EventEmitter.mjs +12 -2
- package/lib/EventEmitter.mjs.map +1 -1
- package/lib/EventStream.d.mts +1 -0
- package/lib/EventStream.d.mts.map +1 -1
- package/lib/EventStream.d.ts +1 -0
- package/lib/EventStream.d.ts.map +1 -1
- package/lib/EventStream.js +19 -2
- package/lib/EventStream.js.map +1 -1
- package/lib/EventStream.mjs +19 -2
- package/lib/EventStream.mjs.map +1 -1
- package/lib/ResponsesParser.d.mts.map +1 -1
- package/lib/ResponsesParser.d.ts.map +1 -1
- package/lib/ResponsesParser.js +12 -4
- package/lib/ResponsesParser.js.map +1 -1
- package/lib/ResponsesParser.mjs +12 -4
- package/lib/ResponsesParser.mjs.map +1 -1
- package/lib/responses/ResponseAccumulator.d.mts +10 -0
- package/lib/responses/ResponseAccumulator.d.mts.map +1 -0
- package/lib/responses/ResponseAccumulator.d.ts +10 -0
- package/lib/responses/ResponseAccumulator.d.ts.map +1 -0
- package/lib/responses/ResponseAccumulator.js +402 -0
- package/lib/responses/ResponseAccumulator.js.map +1 -0
- package/lib/responses/ResponseAccumulator.mjs +399 -0
- package/lib/responses/ResponseAccumulator.mjs.map +1 -0
- package/lib/responses/ResponseInputItems.d.mts +19 -0
- package/lib/responses/ResponseInputItems.d.mts.map +1 -0
- package/lib/responses/ResponseInputItems.d.ts +19 -0
- package/lib/responses/ResponseInputItems.d.ts.map +1 -0
- package/lib/responses/ResponseInputItems.js +102 -0
- package/lib/responses/ResponseInputItems.js.map +1 -0
- package/lib/responses/ResponseInputItems.mjs +98 -0
- package/lib/responses/ResponseInputItems.mjs.map +1 -0
- package/lib/responses/ResponseStream.d.mts.map +1 -1
- package/lib/responses/ResponseStream.d.ts.map +1 -1
- package/lib/responses/ResponseStream.js +5 -90
- package/lib/responses/ResponseStream.js.map +1 -1
- package/lib/responses/ResponseStream.mjs +5 -90
- package/lib/responses/ResponseStream.mjs.map +1 -1
- package/package.json +24 -1
- package/providers/bedrock/aws.d.mts +24 -0
- package/providers/bedrock/aws.d.mts.map +1 -0
- package/providers/bedrock/aws.d.ts +24 -0
- package/providers/bedrock/aws.d.ts.map +1 -0
- package/providers/bedrock/aws.js +170 -0
- package/providers/bedrock/aws.js.map +1 -0
- package/providers/bedrock/aws.mjs +166 -0
- package/providers/bedrock/aws.mjs.map +1 -0
- package/providers/bedrock.d.mts +7 -0
- package/providers/bedrock.d.mts.map +1 -0
- package/providers/bedrock.d.ts +7 -0
- package/providers/bedrock.d.ts.map +1 -0
- package/providers/bedrock.js +26 -0
- package/providers/bedrock.js.map +1 -0
- package/providers/bedrock.mjs +22 -0
- package/providers/bedrock.mjs.map +1 -0
- package/realtime/internal-base.d.mts +28 -1
- package/realtime/internal-base.d.mts.map +1 -1
- package/realtime/internal-base.d.ts +28 -1
- package/realtime/internal-base.d.ts.map +1 -1
- package/realtime/internal-base.js +50 -7
- package/realtime/internal-base.js.map +1 -1
- package/realtime/internal-base.mjs +49 -7
- package/realtime/internal-base.mjs.map +1 -1
- package/realtime/websocket.d.mts +4 -7
- package/realtime/websocket.d.mts.map +1 -1
- package/realtime/websocket.d.ts +4 -7
- package/realtime/websocket.d.ts.map +1 -1
- package/realtime/websocket.js +4 -8
- package/realtime/websocket.js.map +1 -1
- package/realtime/websocket.mjs +5 -9
- package/realtime/websocket.mjs.map +1 -1
- package/realtime/ws.d.mts +4 -7
- package/realtime/ws.d.mts.map +1 -1
- package/realtime/ws.d.ts +4 -7
- package/realtime/ws.d.ts.map +1 -1
- package/realtime/ws.js +4 -8
- package/realtime/ws.js.map +1 -1
- package/realtime/ws.mjs +5 -9
- package/realtime/ws.mjs.map +1 -1
- package/resources/realtime/client-secrets.d.mts +9 -4
- package/resources/realtime/client-secrets.d.mts.map +1 -1
- package/resources/realtime/client-secrets.d.ts +9 -4
- package/resources/realtime/client-secrets.d.ts.map +1 -1
- package/resources/realtime/realtime.d.mts +18 -8
- package/resources/realtime/realtime.d.mts.map +1 -1
- package/resources/realtime/realtime.d.ts +18 -8
- package/resources/realtime/realtime.d.ts.map +1 -1
- package/resources/realtime/realtime.js.map +1 -1
- package/resources/realtime/realtime.mjs.map +1 -1
- package/resources/responses/responses.d.mts +9 -4
- package/resources/responses/responses.d.mts.map +1 -1
- package/resources/responses/responses.d.ts +9 -4
- package/resources/responses/responses.d.ts.map +1 -1
- package/resources/responses/responses.js.map +1 -1
- package/resources/responses/responses.mjs.map +1 -1
- package/resources/videos.d.mts +1 -1
- package/resources/videos.d.ts +1 -1
- package/src/_vendor/zod-to-json-schema/parseDef.ts +44 -16
- package/src/_vendor/zod-to-json-schema/parsers/branded.ts +2 -2
- package/src/_vendor/zod-to-json-schema/parsers/catch.ts +2 -2
- package/src/_vendor/zod-to-json-schema/parsers/default.ts +6 -2
- package/src/_vendor/zod-to-json-schema/parsers/nullable.ts +13 -5
- package/src/_vendor/zod-to-json-schema/parsers/optional.ts +14 -6
- package/src/_vendor/zod-to-json-schema/parsers/pipeline.ts +3 -2
- package/src/_vendor/zod-to-json-schema/parsers/promise.ts +6 -2
- package/src/_vendor/zod-to-json-schema/parsers/readonly.ts +2 -2
- package/src/auth/workload-identity-auth.ts +16 -5
- package/src/azure.ts +4 -1
- package/src/beta/realtime/internal-base.ts +43 -5
- package/src/beta/realtime/websocket.ts +10 -7
- package/src/beta/realtime/ws.ts +10 -7
- package/src/client.ts +80 -18
- package/src/helpers/zod.ts +16 -0
- package/src/internal/bedrock.ts +153 -0
- package/src/internal/provider.ts +60 -0
- package/src/internal/utils/log.ts +1 -0
- package/src/lib/AbstractChatCompletionRunner.ts +96 -45
- package/src/lib/AssistantStream.ts +4 -20
- package/src/lib/ChatCompletionRunner.ts +1 -1
- package/src/lib/ChatCompletionStream.ts +4 -11
- package/src/lib/ChatCompletionStreamingRunner.ts +1 -1
- package/src/lib/EventEmitter.ts +11 -2
- package/src/lib/EventStream.ts +20 -0
- package/src/lib/ResponsesParser.ts +18 -4
- package/src/lib/responses/ResponseAccumulator.ts +412 -0
- package/src/lib/responses/ResponseInputItems.ts +127 -0
- package/src/lib/responses/ResponseStream.ts +4 -93
- package/src/providers/bedrock/aws.ts +255 -0
- package/src/providers/bedrock.ts +33 -0
- package/src/realtime/internal-base.ts +90 -7
- package/src/realtime/websocket.ts +15 -13
- package/src/realtime/ws.ts +15 -13
- package/src/resources/realtime/client-secrets.ts +10 -4
- package/src/resources/realtime/realtime.ts +20 -8
- package/src/resources/responses/responses.ts +10 -4
- package/src/resources/videos.ts +1 -1
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,61 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 6.45.0 (2026-06-24)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v6.44.0...v6.45.0](https://github.com/openai/openai-node/compare/v6.44.0...v6.45.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* add afterCompletion hook to runTools ([#1064](https://github.com/openai/openai-node/issues/1064)) ([4976c22](https://github.com/openai/openai-node/commit/4976c22bf608e4d5f70d6386cfe9c428cf8ff2c7))
|
|
10
|
+
* **realtime:** support sideband call_id connections ([#1795](https://github.com/openai/openai-node/issues/1795)) ([4fd59e1](https://github.com/openai/openai-node/commit/4fd59e1be4ad478373cdcb4f185109af29067da8))
|
|
11
|
+
* reject emitted promise on error in EventEmitter ([#1596](https://github.com/openai/openai-node/issues/1596)) ([e0b09da](https://github.com/openai/openai-node/commit/e0b09da782f0d6ce69a383fd3f3d02a0c7608d6d))
|
|
12
|
+
* **responses:** add response input items helper ([#1794](https://github.com/openai/openai-node/issues/1794)) ([7e5a86a](https://github.com/openai/openai-node/commit/7e5a86a6162d76a7248fa983cb16a16c185a097a))
|
|
13
|
+
* **responses:** add response stream accumulator helper ([#1793](https://github.com/openai/openai-node/issues/1793)) ([32e3e39](https://github.com/openai/openai-node/commit/32e3e39e1736659196aadd7d0bb8d6ca90f69168))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Bug Fixes
|
|
17
|
+
|
|
18
|
+
* avoid serializing null optional bodies ([e4ddff6](https://github.com/openai/openai-node/commit/e4ddff6f2085b1c69eaa790e48d1a22d2dd9d7fb))
|
|
19
|
+
* clean up stream abort listeners ([#1884](https://github.com/openai/openai-node/issues/1884)) ([be55b8f](https://github.com/openai/openai-node/commit/be55b8fb352be80d9d30dd263451615f4342d69f))
|
|
20
|
+
* Leading whitespace chunks break partial parser (structured outputs) ([#1213](https://github.com/openai/openai-node/issues/1213)) ([88d806e](https://github.com/openai/openai-node/commit/88d806eb91f2b41ba4cac3ee69eb73656cab1849))
|
|
21
|
+
* **responses:** avoid parsing incomplete structured output ([#1852](https://github.com/openai/openai-node/issues/1852)) ([4c39681](https://github.com/openai/openai-node/commit/4c396817cbc9586654fa7a376d55a29d8793995d))
|
|
22
|
+
* **responses:** restore output_text on streamed final responses ([#1681](https://github.com/openai/openai-node/issues/1681)) ([bbde4d9](https://github.com/openai/openai-node/commit/bbde4d9e3bbceef5e14bcb71b3a7c36388dbab2b))
|
|
23
|
+
* validate workload identity access tokens ([#1885](https://github.com/openai/openai-node/issues/1885)) ([80febe4](https://github.com/openai/openai-node/commit/80febe441c2dc2d110b412be022fe044bbae2cd9))
|
|
24
|
+
* **zod:** fully resolve extracted wrapper definitions ([#1766](https://github.com/openai/openai-node/issues/1766)) ([5d46ed2](https://github.com/openai/openai-node/commit/5d46ed2012f73b18d6594c62b9fb6351bef76d3d))
|
|
25
|
+
* **zod:** sanitize extracted definition refs ([#1903](https://github.com/openai/openai-node/issues/1903)) ([6ef2111](https://github.com/openai/openai-node/commit/6ef21116801bdaa8e9f25686a8bd365a270401bf))
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### Chores
|
|
29
|
+
|
|
30
|
+
* **internal:** codegen related update ([81fcf96](https://github.com/openai/openai-node/commit/81fcf96fccca29dbcbf33bcb7578b98e06d7a6b0))
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
### Documentation
|
|
34
|
+
|
|
35
|
+
* add vision example using image URL ([#1571](https://github.com/openai/openai-node/issues/1571)) ([70966c9](https://github.com/openai/openai-node/commit/70966c922d0f65eb4711552cf5acb85c7842c2a9))
|
|
36
|
+
* **azure:** add Responses API example ([#1675](https://github.com/openai/openai-node/issues/1675)) ([46453b0](https://github.com/openai/openai-node/commit/46453b06aa8682e5d37be810296bd2f96fe11096))
|
|
37
|
+
* **azure:** use standard client for v1 chat ([#1692](https://github.com/openai/openai-node/issues/1692)) ([fba57e5](https://github.com/openai/openai-node/commit/fba57e577c484c579fbc12741aba6f7df2875eca))
|
|
38
|
+
* clarify abort-on-function-call example ([#1843](https://github.com/openai/openai-node/issues/1843)) ([f21f248](https://github.com/openai/openai-node/commit/f21f24842827f514262bf3c0b5ba4c634585ce31))
|
|
39
|
+
* clarify assistant stream event names ([#1860](https://github.com/openai/openai-node/issues/1860)) ([95fc6cd](https://github.com/openai/openai-node/commit/95fc6cd2d0790797eb62b62a0da45dd13de62c0e))
|
|
40
|
+
* clarify supported zod schema features ([#1880](https://github.com/openai/openai-node/issues/1880)) ([ea93760](https://github.com/openai/openai-node/commit/ea93760643871960ad28cbb8654432f091902241))
|
|
41
|
+
* fix helper example links ([#1890](https://github.com/openai/openai-node/issues/1890)) ([9c58f39](https://github.com/openai/openai-node/commit/9c58f399bd71201d4ff08d5192ca84608aba082b))
|
|
42
|
+
* fix typos in tool calls stream example ([#1817](https://github.com/openai/openai-node/issues/1817)) ([8915ef0](https://github.com/openai/openai-node/commit/8915ef0d46ab47b03c561d87e4271b79bc569793))
|
|
43
|
+
* **readme:** fix two typos and remove duplicate section ([#1733](https://github.com/openai/openai-node/issues/1733)) ([e2f8051](https://github.com/openai/openai-node/commit/e2f80517c01b25432371f7814c20221b3aed67d4))
|
|
44
|
+
* **runner:** remove "the the" duplicate-word typo in JSDoc ([#1892](https://github.com/openai/openai-node/issues/1892)) ([52f075f](https://github.com/openai/openai-node/commit/52f075ff39c14a6114c74b73e9dfbc230445f681))
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
### Build System
|
|
48
|
+
|
|
49
|
+
* vendor tsc-multi build tool ([#1948](https://github.com/openai/openai-node/issues/1948)) ([7c35bcd](https://github.com/openai/openai-node/commit/7c35bcd186140f47a13f9e60e19e40a1994cbf5e))
|
|
50
|
+
|
|
51
|
+
## 6.44.0 (2026-06-17)
|
|
52
|
+
|
|
53
|
+
Full Changelog: [v6.43.0...v6.44.0](https://github.com/openai/openai-node/compare/v6.43.0...v6.44.0)
|
|
54
|
+
|
|
55
|
+
### Features
|
|
56
|
+
|
|
57
|
+
* **api:** update OpenAPI spec or Stainless config ([d05bdbc](https://github.com/openai/openai-node/commit/d05bdbc70b24c2970cf6b583d54529601e5442d8))
|
|
58
|
+
|
|
3
59
|
## 6.43.0 (2026-06-16)
|
|
4
60
|
|
|
5
61
|
Full Changelog: [v6.42.0...v6.43.0](https://github.com/openai/openai-node/compare/v6.42.0...v6.43.0)
|
package/README.md
CHANGED
|
@@ -49,6 +49,18 @@ const response = await client.responses.create({
|
|
|
49
49
|
console.log(response.output_text);
|
|
50
50
|
```
|
|
51
51
|
|
|
52
|
+
### Multi-turn conversations
|
|
53
|
+
|
|
54
|
+
When you manage Responses API conversation history manually, preserve output items in order. Filtering
|
|
55
|
+
`response.output` to messages can drop required reasoning or tool-call items and cause the next request to
|
|
56
|
+
fail.
|
|
57
|
+
|
|
58
|
+
Use the SDK's `toResponseInputItems()` helper to normalize all replayable output items before adding them to
|
|
59
|
+
the next request. For simple continuation, you can pass `previous_response_id` instead.
|
|
60
|
+
|
|
61
|
+
See the [manual conversation state example](examples/responses/manual-conversation-state.ts) and
|
|
62
|
+
[conversation state guide](https://developers.openai.com/api/docs/guides/conversation-state).
|
|
63
|
+
|
|
52
64
|
The previous standard (supported indefinitely) for generating text is the [Chat Completions API](https://platform.openai.com/docs/api-reference/chat). You can use that API to generate text from the model with the code below.
|
|
53
65
|
|
|
54
66
|
```ts
|
|
@@ -69,6 +81,37 @@ const completion = await client.chat.completions.create({
|
|
|
69
81
|
console.log(completion.choices[0].message.content);
|
|
70
82
|
```
|
|
71
83
|
|
|
84
|
+
## Vision
|
|
85
|
+
|
|
86
|
+
Use the Responses API to analyze images and generate text about visual content.
|
|
87
|
+
|
|
88
|
+
```ts
|
|
89
|
+
import OpenAI from 'openai';
|
|
90
|
+
|
|
91
|
+
const client = new OpenAI({
|
|
92
|
+
apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
const response = await client.responses.create({
|
|
96
|
+
model: 'gpt-5.5',
|
|
97
|
+
input: [
|
|
98
|
+
{
|
|
99
|
+
role: 'user',
|
|
100
|
+
content: [
|
|
101
|
+
{ type: 'input_text', text: 'What is in this image?' },
|
|
102
|
+
{
|
|
103
|
+
type: 'input_image',
|
|
104
|
+
image_url:
|
|
105
|
+
'https://api.nga.gov/iiif/a2e6da57-3cd1-4235-b20e-95dcaefed6c8/full/!800,800/0/default.jpg',
|
|
106
|
+
},
|
|
107
|
+
],
|
|
108
|
+
},
|
|
109
|
+
],
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
console.log(response.output_text);
|
|
113
|
+
```
|
|
114
|
+
|
|
72
115
|
## Workload Identity Authentication
|
|
73
116
|
|
|
74
117
|
For secure, automated environments like cloud-managed Kubernetes, Azure, and GCP, you can use workload identity authentication with short-lived tokens from cloud identity providers instead of long-lived API keys.
|
|
@@ -164,7 +207,7 @@ const client = new OpenAI({
|
|
|
164
207
|
|
|
165
208
|
## Streaming responses
|
|
166
209
|
|
|
167
|
-
We provide support for streaming responses using Server
|
|
210
|
+
We provide support for streaming responses using Server-Sent Events (SSE).
|
|
168
211
|
|
|
169
212
|
```ts
|
|
170
213
|
import OpenAI from 'openai';
|
|
@@ -334,106 +377,6 @@ Error codes are as follows:
|
|
|
334
377
|
| >=500 | `InternalServerError` |
|
|
335
378
|
| N/A | `APIConnectionError` |
|
|
336
379
|
|
|
337
|
-
## Request IDs
|
|
338
|
-
|
|
339
|
-
> For more information on debugging requests, see [these docs](https://platform.openai.com/docs/api-reference/debugging-requests)
|
|
340
|
-
|
|
341
|
-
All object responses in the SDK provide a `_request_id` property which is added from the `x-request-id` response header so that you can quickly log failing requests and report them back to OpenAI.
|
|
342
|
-
|
|
343
|
-
```ts
|
|
344
|
-
const completion = await client.chat.completions.create({
|
|
345
|
-
messages: [{ role: 'user', content: 'Say this is a test' }],
|
|
346
|
-
model: 'gpt-5.5',
|
|
347
|
-
});
|
|
348
|
-
console.log(completion._request_id); // req_123
|
|
349
|
-
```
|
|
350
|
-
|
|
351
|
-
You can also access the Request ID using the `.withResponse()` method:
|
|
352
|
-
|
|
353
|
-
```ts
|
|
354
|
-
const { data: stream, request_id } = await openai.chat.completions
|
|
355
|
-
.create({
|
|
356
|
-
model: 'gpt-5.5',
|
|
357
|
-
messages: [{ role: 'user', content: 'Say this is a test' }],
|
|
358
|
-
stream: true,
|
|
359
|
-
})
|
|
360
|
-
.withResponse();
|
|
361
|
-
```
|
|
362
|
-
|
|
363
|
-
## Realtime API
|
|
364
|
-
|
|
365
|
-
The Realtime API enables you to build low-latency, multi-modal conversational experiences. It currently supports text and audio as both input and output, as well as [function calling](https://platform.openai.com/docs/guides/function-calling) through a `WebSocket` connection.
|
|
366
|
-
|
|
367
|
-
```ts
|
|
368
|
-
import { OpenAIRealtimeWebSocket } from 'openai/realtime/websocket';
|
|
369
|
-
|
|
370
|
-
const rt = new OpenAIRealtimeWebSocket({ model: 'gpt-realtime-2' });
|
|
371
|
-
|
|
372
|
-
rt.on('response.output_text.delta', (event) => process.stdout.write(event.delta));
|
|
373
|
-
```
|
|
374
|
-
|
|
375
|
-
For more information see [realtime.md](realtime.md).
|
|
376
|
-
|
|
377
|
-
## Microsoft Azure OpenAI
|
|
378
|
-
|
|
379
|
-
To use this library with [Azure OpenAI](https://learn.microsoft.com/azure/ai-services/openai/overview), use the `AzureOpenAI`
|
|
380
|
-
class instead of the `OpenAI` class.
|
|
381
|
-
|
|
382
|
-
> [!IMPORTANT]
|
|
383
|
-
> The Azure API shape slightly differs from the core API shape which means that the static types for responses / params
|
|
384
|
-
> won't always be correct.
|
|
385
|
-
|
|
386
|
-
```ts
|
|
387
|
-
import { AzureOpenAI } from 'openai';
|
|
388
|
-
import { getBearerTokenProvider, DefaultAzureCredential } from '@azure/identity';
|
|
389
|
-
|
|
390
|
-
const credential = new DefaultAzureCredential();
|
|
391
|
-
const scope = 'https://cognitiveservices.azure.com/.default';
|
|
392
|
-
const azureADTokenProvider = getBearerTokenProvider(credential, scope);
|
|
393
|
-
|
|
394
|
-
const openai = new AzureOpenAI({ azureADTokenProvider });
|
|
395
|
-
|
|
396
|
-
const result = await openai.chat.completions.create({
|
|
397
|
-
model: 'gpt-5.5',
|
|
398
|
-
messages: [{ role: 'user', content: 'Say hello!' }],
|
|
399
|
-
});
|
|
400
|
-
|
|
401
|
-
console.log(result.choices[0]!.message?.content);
|
|
402
|
-
```
|
|
403
|
-
|
|
404
|
-
## Amazon Bedrock
|
|
405
|
-
|
|
406
|
-
To use this library with [Amazon Bedrock's OpenAI-compatible API](https://docs.aws.amazon.com/bedrock/latest/userguide/models-api-compatibility.html), use the `BedrockOpenAI` class instead of the `OpenAI` class.
|
|
407
|
-
|
|
408
|
-
```ts
|
|
409
|
-
import { BedrockOpenAI } from 'openai';
|
|
410
|
-
|
|
411
|
-
// gets the bearer token from AWS_BEARER_TOKEN_BEDROCK and the region from AWS_REGION/AWS_DEFAULT_REGION
|
|
412
|
-
const client = new BedrockOpenAI();
|
|
413
|
-
|
|
414
|
-
const response = await client.responses.create({
|
|
415
|
-
model: 'openai.gpt-5.4',
|
|
416
|
-
input: 'Say hello!',
|
|
417
|
-
});
|
|
418
|
-
|
|
419
|
-
console.log(response.output_text);
|
|
420
|
-
```
|
|
421
|
-
|
|
422
|
-
`BedrockOpenAI` configures AWS bearer auth and the Bedrock Mantle endpoint, then uses the normal SDK resources. AWS controls which endpoints and features are supported; unsupported calls surface the provider's normal HTTP errors through the SDK.
|
|
423
|
-
|
|
424
|
-
Pass `baseURL` or set `AWS_BEDROCK_BASE_URL` to override the derived `https://bedrock-mantle.<region>.api.aws/openai/v1` endpoint. For long-running apps, pass `bedrockTokenProvider` to refresh the Bedrock bearer token before each request.
|
|
425
|
-
|
|
426
|
-
Set `AWS_BEARER_TOKEN_BEDROCK` to an [Amazon Bedrock API key](https://docs.aws.amazon.com/bedrock/latest/userguide/api-keys.html). To refresh tokens yourself, pass a provider instead of `apiKey`:
|
|
427
|
-
|
|
428
|
-
```ts
|
|
429
|
-
const client = new BedrockOpenAI({
|
|
430
|
-
awsRegion: 'us-west-2',
|
|
431
|
-
bedrockTokenProvider: async () => refreshBedrockToken(),
|
|
432
|
-
});
|
|
433
|
-
```
|
|
434
|
-
|
|
435
|
-
For more information on support for Amazon Bedrock, see [bedrock.md](bedrock.md).
|
|
436
|
-
|
|
437
380
|
### Retries
|
|
438
381
|
|
|
439
382
|
Certain errors will be automatically retried 2 times by default, with a short exponential backoff.
|
|
@@ -576,6 +519,46 @@ console.log(result.choices[0]!.message?.content);
|
|
|
576
519
|
|
|
577
520
|
For more information on support for the Azure API, see [azure.md](azure.md).
|
|
578
521
|
|
|
522
|
+
## Amazon Bedrock
|
|
523
|
+
|
|
524
|
+
To use this library with [Amazon Bedrock's OpenAI-compatible API](https://docs.aws.amazon.com/bedrock/latest/userguide/models-api-compatibility.html), configure the standard `OpenAI` client with the Bedrock provider:
|
|
525
|
+
|
|
526
|
+
```ts
|
|
527
|
+
import OpenAI from 'openai';
|
|
528
|
+
import { bedrock } from 'openai/providers/bedrock/aws';
|
|
529
|
+
|
|
530
|
+
const client = new OpenAI({
|
|
531
|
+
provider: bedrock({ region: 'us-west-2' }),
|
|
532
|
+
});
|
|
533
|
+
|
|
534
|
+
const response = await client.responses.create({
|
|
535
|
+
model: 'openai.gpt-5.4',
|
|
536
|
+
input: 'Say hello!',
|
|
537
|
+
});
|
|
538
|
+
|
|
539
|
+
console.log(response.output_text);
|
|
540
|
+
```
|
|
541
|
+
|
|
542
|
+
Use a model that [supports the Responses API](https://docs.aws.amazon.com/bedrock/latest/userguide/models-api-compatibility.html). A model returned by the Models API may support a different Bedrock inference API instead.
|
|
543
|
+
|
|
544
|
+
This uses the regional `https://bedrock-mantle.<region>.api.aws/openai/v1` endpoint. The region can also come from `AWS_REGION` or `AWS_DEFAULT_REGION`, and `AWS_BEDROCK_BASE_URL` can override the endpoint.
|
|
545
|
+
|
|
546
|
+
The AWS entrypoint uses the standard AWS credential chain by default. It also accepts a named profile, static credentials, or a custom credential provider. Install its peer dependencies before importing it:
|
|
547
|
+
|
|
548
|
+
```bash
|
|
549
|
+
npm install @aws-sdk/credential-provider-node @smithy/hash-node @smithy/signature-v4
|
|
550
|
+
```
|
|
551
|
+
|
|
552
|
+
The AWS entrypoint uses normal static imports so bundlers and serverless packagers can trace these dependencies. If one is missing, importing `openai/providers/bedrock/aws` fails immediately with the runtime's normal module-not-found error, for example:
|
|
553
|
+
|
|
554
|
+
```text
|
|
555
|
+
Cannot find module '@aws-sdk/credential-provider-node'
|
|
556
|
+
```
|
|
557
|
+
|
|
558
|
+
For Bedrock API key authentication, import `bedrock` from `openai/providers/bedrock` instead. That entrypoint has no AWS dependencies and works in browser-compatible runtimes when `dangerouslyAllowBrowser` is enabled. SigV4 authentication is supported in Node.js and compatible server runtimes and requires replayable request bodies. The legacy, bearer-only `BedrockOpenAI` class remains available for compatibility.
|
|
559
|
+
|
|
560
|
+
For more information on support for Amazon Bedrock, see [bedrock.md](bedrock.md).
|
|
561
|
+
|
|
579
562
|
## Advanced Usage
|
|
580
563
|
|
|
581
564
|
### Accessing raw Response data (e.g., headers)
|
|
@@ -808,7 +791,7 @@ The following runtimes are supported:
|
|
|
808
791
|
- Vercel Edge Runtime.
|
|
809
792
|
- Jest 28 or greater with the `"node"` environment (`"jsdom"` is not supported at this time).
|
|
810
793
|
- Nitro v2.6 or greater.
|
|
811
|
-
- Web browsers: disabled by default to avoid exposing your secret API credentials. Enable browser support by explicitly setting `dangerouslyAllowBrowser` to true
|
|
794
|
+
- Web browsers: disabled by default to avoid exposing your secret API credentials. Enable browser support by explicitly setting `dangerouslyAllowBrowser` to `true`.
|
|
812
795
|
<details>
|
|
813
796
|
<summary>More explanation</summary>
|
|
814
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B,GACrB,qBAAqB,GACrB,oBAAoB,GACpB,oBAAoB,GACpB,wBAAwB,GACxB,kBAAkB,GAClB,oBAAoB,GACpB,kBAAkB,GAClB,kBAAkB,GAClB,uBAAuB,GACvB,oBAAoB,GACpB,sBAAsB,GACtB,kBAAkB,CAAC;AAEvB,MAAM,MAAM,eAAe,GAAG,oBAAoB,GAAG,eAAe,CAAC;AAErE,wBAAgB,QAAQ,CACtB,GAAG,EAAE,UAAU,EACf,IAAI,EAAE,IAAI,EACV,eAAe,UAAQ,GACtB,eAAe,GAAG,SAAS,CA4C7B"}
|
|
@@ -52,12 +52,21 @@ function parseDef(def, refs, forceResolution = false) {
|
|
|
52
52
|
}
|
|
53
53
|
const newItem = { def, path: refs.currentPath, jsonSchema: undefined };
|
|
54
54
|
refs.seen.set(def, newItem);
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
try {
|
|
56
|
+
const jsonSchema = selectParser(def, def.typeName, refs, forceResolution);
|
|
57
|
+
if (jsonSchema) {
|
|
58
|
+
addMeta(def, refs, jsonSchema);
|
|
59
|
+
}
|
|
60
|
+
newItem.jsonSchema = jsonSchema;
|
|
61
|
+
return jsonSchema;
|
|
62
|
+
}
|
|
63
|
+
finally {
|
|
64
|
+
if (forceResolution && seenItem) {
|
|
65
|
+
// Materializing a definition temporarily moves it to the definition path. Restore the
|
|
66
|
+
// original path so later references to a shared inner type don't inherit wrapper metadata.
|
|
67
|
+
refs.seen.set(def, seenItem);
|
|
68
|
+
}
|
|
58
69
|
}
|
|
59
|
-
newItem.jsonSchema = jsonSchema;
|
|
60
|
-
return jsonSchema;
|
|
61
70
|
}
|
|
62
71
|
const get$ref = (item, refs) => {
|
|
63
72
|
switch (refs.$refStrategy) {
|
|
@@ -72,7 +81,13 @@ const get$ref = (item, refs) => {
|
|
|
72
81
|
// `["#","definitions","contactPerson","properties","person1","properties","name"]`
|
|
73
82
|
// then we'll extract it out to `contactPerson_properties_person1_properties_name`
|
|
74
83
|
case 'extract-to-root':
|
|
75
|
-
const name = item.path
|
|
84
|
+
const name = item.path
|
|
85
|
+
.slice(refs.basePath.length + 1)
|
|
86
|
+
// The first part is either the root schema name or an extracted definition
|
|
87
|
+
// name that is being materialized. Keep it stable so recursive definitions
|
|
88
|
+
// do not generate a new name each time they are resolved.
|
|
89
|
+
.map((part, index) => (index === 0 ? part : encodeDefinitionPathPart(part)))
|
|
90
|
+
.join('_');
|
|
76
91
|
// we don't need to extract the root schema in this case, as it's already
|
|
77
92
|
// been added to the definitions
|
|
78
93
|
if (name !== refs.name && refs.nameStrategy === 'duplicate-ref') {
|
|
@@ -92,6 +107,17 @@ const get$ref = (item, refs) => {
|
|
|
92
107
|
}
|
|
93
108
|
}
|
|
94
109
|
};
|
|
110
|
+
const encodedDefinitionPathPartPrefix = '_x_';
|
|
111
|
+
const encodeDefinitionPathPart = (part) => {
|
|
112
|
+
if (/^[A-Za-z0-9_-]*$/.test(part) && !part.startsWith(encodedDefinitionPathPartPrefix)) {
|
|
113
|
+
return part;
|
|
114
|
+
}
|
|
115
|
+
let encoded = encodedDefinitionPathPartPrefix;
|
|
116
|
+
for (let i = 0; i < part.length; i++) {
|
|
117
|
+
encoded += part.charCodeAt(i).toString(16).padStart(4, '0');
|
|
118
|
+
}
|
|
119
|
+
return encoded;
|
|
120
|
+
};
|
|
95
121
|
const getRelativePath = (pathA, pathB) => {
|
|
96
122
|
let i = 0;
|
|
97
123
|
for (; i < pathA.length && i < pathB.length; i++) {
|
|
@@ -136,17 +162,17 @@ const selectParser = (def, typeName, refs, forceResolution) => {
|
|
|
136
162
|
case v3_1.ZodFirstPartyTypeKind.ZodNativeEnum:
|
|
137
163
|
return (0, nativeEnum_1.parseNativeEnumDef)(def);
|
|
138
164
|
case v3_1.ZodFirstPartyTypeKind.ZodNullable:
|
|
139
|
-
return (0, nullable_1.parseNullableDef)(def, refs);
|
|
165
|
+
return (0, nullable_1.parseNullableDef)(def, refs, forceResolution);
|
|
140
166
|
case v3_1.ZodFirstPartyTypeKind.ZodOptional:
|
|
141
|
-
return (0, optional_1.parseOptionalDef)(def, refs);
|
|
167
|
+
return (0, optional_1.parseOptionalDef)(def, refs, forceResolution);
|
|
142
168
|
case v3_1.ZodFirstPartyTypeKind.ZodMap:
|
|
143
169
|
return (0, map_1.parseMapDef)(def, refs);
|
|
144
170
|
case v3_1.ZodFirstPartyTypeKind.ZodSet:
|
|
145
171
|
return (0, set_1.parseSetDef)(def, refs);
|
|
146
172
|
case v3_1.ZodFirstPartyTypeKind.ZodLazy:
|
|
147
|
-
return parseDef(def.getter()._def, refs);
|
|
173
|
+
return parseDef(def.getter()._def, refs, forceResolution);
|
|
148
174
|
case v3_1.ZodFirstPartyTypeKind.ZodPromise:
|
|
149
|
-
return (0, promise_1.parsePromiseDef)(def, refs);
|
|
175
|
+
return (0, promise_1.parsePromiseDef)(def, refs, forceResolution);
|
|
150
176
|
case v3_1.ZodFirstPartyTypeKind.ZodNaN:
|
|
151
177
|
case v3_1.ZodFirstPartyTypeKind.ZodNever:
|
|
152
178
|
return (0, never_1.parseNeverDef)();
|
|
@@ -157,15 +183,15 @@ const selectParser = (def, typeName, refs, forceResolution) => {
|
|
|
157
183
|
case v3_1.ZodFirstPartyTypeKind.ZodUnknown:
|
|
158
184
|
return (0, unknown_1.parseUnknownDef)();
|
|
159
185
|
case v3_1.ZodFirstPartyTypeKind.ZodDefault:
|
|
160
|
-
return (0, default_1.parseDefaultDef)(def, refs);
|
|
186
|
+
return (0, default_1.parseDefaultDef)(def, refs, forceResolution);
|
|
161
187
|
case v3_1.ZodFirstPartyTypeKind.ZodBranded:
|
|
162
|
-
return (0, branded_1.parseBrandedDef)(def, refs);
|
|
188
|
+
return (0, branded_1.parseBrandedDef)(def, refs, forceResolution);
|
|
163
189
|
case v3_1.ZodFirstPartyTypeKind.ZodReadonly:
|
|
164
|
-
return (0, readonly_1.parseReadonlyDef)(def, refs);
|
|
190
|
+
return (0, readonly_1.parseReadonlyDef)(def, refs, forceResolution);
|
|
165
191
|
case v3_1.ZodFirstPartyTypeKind.ZodCatch:
|
|
166
|
-
return (0, catch_1.parseCatchDef)(def, refs);
|
|
192
|
+
return (0, catch_1.parseCatchDef)(def, refs, forceResolution);
|
|
167
193
|
case v3_1.ZodFirstPartyTypeKind.ZodPipeline:
|
|
168
|
-
return (0, pipeline_1.parsePipelineDef)(def, refs);
|
|
194
|
+
return (0, pipeline_1.parsePipelineDef)(def, refs, forceResolution);
|
|
169
195
|
case v3_1.ZodFirstPartyTypeKind.ZodFunction:
|
|
170
196
|
case v3_1.ZodFirstPartyTypeKind.ZodVoid:
|
|
171
197
|
case v3_1.ZodFirstPartyTypeKind.ZodSymbol:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parseDef.js","sourceRoot":"","sources":["../../src/_vendor/zod-to-json-schema/parseDef.ts"],"names":[],"mappings":";;AAsEA,
|
|
1
|
+
{"version":3,"file":"parseDef.js","sourceRoot":"","sources":["../../src/_vendor/zod-to-json-schema/parseDef.ts"],"names":[],"mappings":";;AAsEA,4BAgDC;AAtHD,+BAA2D;AAC3D,0CAAgE;AAChE,8CAAsE;AACtE,gDAAyE;AACzE,kDAA4E;AAC5E,kDAAoD;AACpD,8CAAgD;AAChD,4CAAmE;AACnE,kDAAoD;AACpD,kDAAoD;AACpD,4CAAmE;AACnE,4DAAoF;AACpF,kDAA4E;AAC5E,0CAAgE;AAChE,wDAAqF;AACrF,8CAAsE;AACtE,4CAAmE;AACnE,oDAA+E;AAC/E,gDAAyE;AACzE,gDAAyE;AACzE,oDAAsD;AACtD,oDAAsD;AACtD,kDAAoD;AACpD,gDAAyE;AACzE,0CAAgE;AAChE,gDAAyE;AACzE,8CAAsE;AACtE,sDAAkF;AAClF,8CAAsE;AACtE,kDAA4E;AAE5E,oDAAsD;AACtD,0CAA2C;AAsC3C,SAAgB,QAAQ,CACtB,GAAe,EACf,IAAU,EACV,eAAe,GAAG,KAAK;IAEvB,MAAM,QAAQ,GAAG,IAAI,CAA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EAAE,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC;IAC/C,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,OAAO,GAAG,CAAC,GAAe,EAAE,IAAU,EAAE,UAA2B,EAAmB,EAAE;IAC5F,IAAI,GAAG,CAAC,WAAW,EAAE,CAAC;QACpB,UAAU,CAAC,WAAW,GAAG,GAAG,CAAC,WAAW,CAAC;QAEzC,IAAI,IAAI,CAAC,mBAAmB,EAAE,CAAC;YAC7B,UAAU,CAAC,mBAAmB,GAAG,GAAG,CAAC,WAAW,CAAC;QACnD,CAAC;IACH,CAAC;IACD,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC"}
|
|
@@ -49,12 +49,21 @@ export function parseDef(def, refs, forceResolution = false) {
|
|
|
49
49
|
}
|
|
50
50
|
const newItem = { def, path: refs.currentPath, jsonSchema: undefined };
|
|
51
51
|
refs.seen.set(def, newItem);
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
try {
|
|
53
|
+
const jsonSchema = selectParser(def, def.typeName, refs, forceResolution);
|
|
54
|
+
if (jsonSchema) {
|
|
55
|
+
addMeta(def, refs, jsonSchema);
|
|
56
|
+
}
|
|
57
|
+
newItem.jsonSchema = jsonSchema;
|
|
58
|
+
return jsonSchema;
|
|
59
|
+
}
|
|
60
|
+
finally {
|
|
61
|
+
if (forceResolution && seenItem) {
|
|
62
|
+
// Materializing a definition temporarily moves it to the definition path. Restore the
|
|
63
|
+
// original path so later references to a shared inner type don't inherit wrapper metadata.
|
|
64
|
+
refs.seen.set(def, seenItem);
|
|
65
|
+
}
|
|
55
66
|
}
|
|
56
|
-
newItem.jsonSchema = jsonSchema;
|
|
57
|
-
return jsonSchema;
|
|
58
67
|
}
|
|
59
68
|
const get$ref = (item, refs) => {
|
|
60
69
|
switch (refs.$refStrategy) {
|
|
@@ -69,7 +78,13 @@ const get$ref = (item, refs) => {
|
|
|
69
78
|
// `["#","definitions","contactPerson","properties","person1","properties","name"]`
|
|
70
79
|
// then we'll extract it out to `contactPerson_properties_person1_properties_name`
|
|
71
80
|
case 'extract-to-root':
|
|
72
|
-
const name = item.path
|
|
81
|
+
const name = item.path
|
|
82
|
+
.slice(refs.basePath.length + 1)
|
|
83
|
+
// The first part is either the root schema name or an extracted definition
|
|
84
|
+
// name that is being materialized. Keep it stable so recursive definitions
|
|
85
|
+
// do not generate a new name each time they are resolved.
|
|
86
|
+
.map((part, index) => (index === 0 ? part : encodeDefinitionPathPart(part)))
|
|
87
|
+
.join('_');
|
|
73
88
|
// we don't need to extract the root schema in this case, as it's already
|
|
74
89
|
// been added to the definitions
|
|
75
90
|
if (name !== refs.name && refs.nameStrategy === 'duplicate-ref') {
|
|
@@ -89,6 +104,17 @@ const get$ref = (item, refs) => {
|
|
|
89
104
|
}
|
|
90
105
|
}
|
|
91
106
|
};
|
|
107
|
+
const encodedDefinitionPathPartPrefix = '_x_';
|
|
108
|
+
const encodeDefinitionPathPart = (part) => {
|
|
109
|
+
if (/^[A-Za-z0-9_-]*$/.test(part) && !part.startsWith(encodedDefinitionPathPartPrefix)) {
|
|
110
|
+
return part;
|
|
111
|
+
}
|
|
112
|
+
let encoded = encodedDefinitionPathPartPrefix;
|
|
113
|
+
for (let i = 0; i < part.length; i++) {
|
|
114
|
+
encoded += part.charCodeAt(i).toString(16).padStart(4, '0');
|
|
115
|
+
}
|
|
116
|
+
return encoded;
|
|
117
|
+
};
|
|
92
118
|
const getRelativePath = (pathA, pathB) => {
|
|
93
119
|
let i = 0;
|
|
94
120
|
for (; i < pathA.length && i < pathB.length; i++) {
|
|
@@ -133,17 +159,17 @@ const selectParser = (def, typeName, refs, forceResolution) => {
|
|
|
133
159
|
case ZodFirstPartyTypeKind.ZodNativeEnum:
|
|
134
160
|
return parseNativeEnumDef(def);
|
|
135
161
|
case ZodFirstPartyTypeKind.ZodNullable:
|
|
136
|
-
return parseNullableDef(def, refs);
|
|
162
|
+
return parseNullableDef(def, refs, forceResolution);
|
|
137
163
|
case ZodFirstPartyTypeKind.ZodOptional:
|
|
138
|
-
return parseOptionalDef(def, refs);
|
|
164
|
+
return parseOptionalDef(def, refs, forceResolution);
|
|
139
165
|
case ZodFirstPartyTypeKind.ZodMap:
|
|
140
166
|
return parseMapDef(def, refs);
|
|
141
167
|
case ZodFirstPartyTypeKind.ZodSet:
|
|
142
168
|
return parseSetDef(def, refs);
|
|
143
169
|
case ZodFirstPartyTypeKind.ZodLazy:
|
|
144
|
-
return parseDef(def.getter()._def, refs);
|
|
170
|
+
return parseDef(def.getter()._def, refs, forceResolution);
|
|
145
171
|
case ZodFirstPartyTypeKind.ZodPromise:
|
|
146
|
-
return parsePromiseDef(def, refs);
|
|
172
|
+
return parsePromiseDef(def, refs, forceResolution);
|
|
147
173
|
case ZodFirstPartyTypeKind.ZodNaN:
|
|
148
174
|
case ZodFirstPartyTypeKind.ZodNever:
|
|
149
175
|
return parseNeverDef();
|
|
@@ -154,15 +180,15 @@ const selectParser = (def, typeName, refs, forceResolution) => {
|
|
|
154
180
|
case ZodFirstPartyTypeKind.ZodUnknown:
|
|
155
181
|
return parseUnknownDef();
|
|
156
182
|
case ZodFirstPartyTypeKind.ZodDefault:
|
|
157
|
-
return parseDefaultDef(def, refs);
|
|
183
|
+
return parseDefaultDef(def, refs, forceResolution);
|
|
158
184
|
case ZodFirstPartyTypeKind.ZodBranded:
|
|
159
|
-
return parseBrandedDef(def, refs);
|
|
185
|
+
return parseBrandedDef(def, refs, forceResolution);
|
|
160
186
|
case ZodFirstPartyTypeKind.ZodReadonly:
|
|
161
|
-
return parseReadonlyDef(def, refs);
|
|
187
|
+
return parseReadonlyDef(def, refs, forceResolution);
|
|
162
188
|
case ZodFirstPartyTypeKind.ZodCatch:
|
|
163
|
-
return parseCatchDef(def, refs);
|
|
189
|
+
return parseCatchDef(def, refs, forceResolution);
|
|
164
190
|
case ZodFirstPartyTypeKind.ZodPipeline:
|
|
165
|
-
return parsePipelineDef(def, refs);
|
|
191
|
+
return parsePipelineDef(def, refs, forceResolution);
|
|
166
192
|
case ZodFirstPartyTypeKind.ZodFunction:
|
|
167
193
|
case ZodFirstPartyTypeKind.ZodVoid:
|
|
168
194
|
case ZodFirstPartyTypeKind.ZodSymbol:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parseDef.mjs","sourceRoot":"","sources":["../../src/_vendor/zod-to-json-schema/parseDef.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAc,MAAM,QAAQ,CAAC;AAC3D,OAAO,EAAsB,WAAW,EAAE,0BAAsB;AAChE,OAAO,EAAwB,aAAa,EAAE,4BAAwB;AACtE,OAAO,EAAyB,cAAc,EAAE,6BAAyB;AACzE,OAAO,EAA0B,eAAe,EAAE,8BAA0B;AAC5E,OAAO,EAAE,eAAe,EAAE,8BAA0B;AACpD,OAAO,EAAE,aAAa,EAAE,4BAAwB;AAChD,OAAO,EAAuB,YAAY,EAAE,2BAAuB;AACnE,OAAO,EAAE,eAAe,EAAE,8BAA0B;AACpD,OAAO,EAAE,eAAe,EAAE,8BAA0B;AACpD,OAAO,EAAuB,YAAY,EAAE,2BAAuB;AACnE,OAAO,EAAwB,oBAAoB,EAAE,mCAA+B;AACpF,OAAO,EAA0B,eAAe,EAAE,8BAA0B;AAC5E,OAAO,EAAsB,WAAW,EAAE,0BAAsB;AAChE,OAAO,EAA6B,kBAAkB,EAAE,iCAA6B;AACrF,OAAO,EAAwB,aAAa,EAAE,4BAAwB;AACtE,OAAO,EAAuB,YAAY,EAAE,2BAAuB;AACnE,OAAO,EAA2B,gBAAgB,EAAE,+BAA2B;AAC/E,OAAO,EAAyB,cAAc,EAAE,6BAAyB;AACzE,OAAO,EAAyB,cAAc,EAAE,6BAAyB;AACzE,OAAO,EAAE,gBAAgB,EAAE,+BAA2B;AACtD,OAAO,EAAE,gBAAgB,EAAE,+BAA2B;AACtD,OAAO,EAAE,eAAe,EAAE,8BAA0B;AACpD,OAAO,EAAyB,cAAc,EAAE,6BAAyB;AACz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K,qBAAqB,CAAC,WAAW,CAAC;QACvC,KAAK,qBAAqB,CAAC,OAAO,CAAC;QACnC,KAAK,qBAAqB,CAAC,SAAS;YAClC,OAAO,SAAS,CAAC;QACnB;YACE,OAAO,CAAC,CAAC,CAAQ,EAAE,EAAE,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC;IAC/C,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,OAAO,GAAG,CAAC,GAAe,EAAE,IAAU,EAAE,UAA2B,EAAmB,EAAE;IAC5F,IAAI,GAAG,CAAC,WAAW,EAAE,CAAC;QACpB,UAAU,CAAC,WAAW,GAAG,GAAG,CAAC,WAAW,CAAC;QAEzC,IAAI,IAAI,CAAC,mBAAmB,EAAE,CAAC;YAC7B,UAAU,CAAC,mBAAmB,GAAG,GAAG,CAAC,WAAW,CAAC;QACnD,CAAC;IACH,CAAC;IACD,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ZodBrandedDef } from 'zod/v3';
|
|
2
2
|
import { Refs } from "../Refs.mjs";
|
|
3
|
-
export declare function parseBrandedDef(_def: ZodBrandedDef<any>, refs: Refs): import("../parseDef.mjs").JsonSchema7Type | undefined;
|
|
3
|
+
export declare function parseBrandedDef(_def: ZodBrandedDef<any>, refs: Refs, forceResolution: boolean): import("../parseDef.mjs").JsonSchema7Type | undefined;
|
|
4
4
|
//# sourceMappingURL=branded.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"branded.d.mts","sourceRoot":"","sources":["../../../src/_vendor/zod-to-json-schema/parsers/branded.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAEvC,OAAO,EAAE,IAAI,EAAE,oBAAgB;AAE/B,wBAAgB,eAAe,CAAC,IAAI,EAAE,aAAa,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,IAAI,
|
|
1
|
+
{"version":3,"file":"branded.d.mts","sourceRoot":"","sources":["../../../src/_vendor/zod-to-json-schema/parsers/branded.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAEvC,OAAO,EAAE,IAAI,EAAE,oBAAgB;AAE/B,wBAAgB,eAAe,CAAC,IAAI,EAAE,aAAa,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,eAAe,EAAE,OAAO,yDAE7F"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ZodBrandedDef } from 'zod/v3';
|
|
2
2
|
import { Refs } from "../Refs.js";
|
|
3
|
-
export declare function parseBrandedDef(_def: ZodBrandedDef<any>, refs: Refs): import("../parseDef.js").JsonSchema7Type | undefined;
|
|
3
|
+
export declare function parseBrandedDef(_def: ZodBrandedDef<any>, refs: Refs, forceResolution: boolean): import("../parseDef.js").JsonSchema7Type | undefined;
|
|
4
4
|
//# sourceMappingURL=branded.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"branded.d.ts","sourceRoot":"","sources":["../../../src/_vendor/zod-to-json-schema/parsers/branded.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAEvC,OAAO,EAAE,IAAI,EAAE,mBAAgB;AAE/B,wBAAgB,eAAe,CAAC,IAAI,EAAE,aAAa,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,IAAI,
|
|
1
|
+
{"version":3,"file":"branded.d.ts","sourceRoot":"","sources":["../../../src/_vendor/zod-to-json-schema/parsers/branded.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAEvC,OAAO,EAAE,IAAI,EAAE,mBAAgB;AAE/B,wBAAgB,eAAe,CAAC,IAAI,EAAE,aAAa,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,eAAe,EAAE,OAAO,wDAE7F"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.parseBrandedDef = parseBrandedDef;
|
|
4
4
|
const parseDef_1 = require("../parseDef.js");
|
|
5
|
-
function parseBrandedDef(_def, refs) {
|
|
6
|
-
return (0, parseDef_1.parseDef)(_def.type._def, refs);
|
|
5
|
+
function parseBrandedDef(_def, refs, forceResolution) {
|
|
6
|
+
return (0, parseDef_1.parseDef)(_def.type._def, refs, forceResolution);
|
|
7
7
|
}
|
|
8
8
|
//# sourceMappingURL=branded.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"branded.js","sourceRoot":"","sources":["../../../src/_vendor/zod-to-json-schema/parsers/branded.ts"],"names":[],"mappings":";;AAIA,0CAEC;AALD,6CAAuC;AAGvC,SAAgB,eAAe,CAAC,IAAwB,EAAE,IAAU;
|
|
1
|
+
{"version":3,"file":"branded.js","sourceRoot":"","sources":["../../../src/_vendor/zod-to-json-schema/parsers/branded.ts"],"names":[],"mappings":";;AAIA,0CAEC;AALD,6CAAuC;AAGvC,SAAgB,eAAe,CAAC,IAAwB,EAAE,IAAU,EAAE,eAAwB;IAC5F,OAAO,IAAA,mBAAQ,EAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,eAAe,CAAC,CAAC;AACzD,CAAC"}
|