openai 4.53.2 → 4.55.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 +29 -0
- package/README.md +2 -2
- package/_vendor/partial-json-parser/parser.d.ts +3 -0
- package/_vendor/partial-json-parser/parser.d.ts.map +1 -0
- package/_vendor/partial-json-parser/parser.js +226 -0
- package/_vendor/partial-json-parser/parser.js.map +1 -0
- package/_vendor/partial-json-parser/parser.mjs +223 -0
- package/_vendor/partial-json-parser/parser.mjs.map +1 -0
- package/_vendor/zod-to-json-schema/Options.d.ts +32 -0
- package/_vendor/zod-to-json-schema/Options.d.ts.map +1 -0
- package/_vendor/zod-to-json-schema/Options.js +36 -0
- package/_vendor/zod-to-json-schema/Options.js.map +1 -0
- package/_vendor/zod-to-json-schema/Options.mjs +32 -0
- package/_vendor/zod-to-json-schema/Options.mjs.map +1 -0
- package/_vendor/zod-to-json-schema/Refs.d.ts +15 -0
- package/_vendor/zod-to-json-schema/Refs.d.ts.map +1 -0
- package/_vendor/zod-to-json-schema/Refs.js +26 -0
- package/_vendor/zod-to-json-schema/Refs.js.map +1 -0
- package/_vendor/zod-to-json-schema/Refs.mjs +22 -0
- package/_vendor/zod-to-json-schema/Refs.mjs.map +1 -0
- package/_vendor/zod-to-json-schema/errorMessages.d.ts +12 -0
- package/_vendor/zod-to-json-schema/errorMessages.d.ts.map +1 -0
- package/_vendor/zod-to-json-schema/errorMessages.js +20 -0
- package/_vendor/zod-to-json-schema/errorMessages.js.map +1 -0
- package/_vendor/zod-to-json-schema/errorMessages.mjs +15 -0
- package/_vendor/zod-to-json-schema/errorMessages.mjs.map +1 -0
- package/_vendor/zod-to-json-schema/index.d.ts +38 -0
- package/_vendor/zod-to-json-schema/index.d.ts.map +1 -0
- package/_vendor/zod-to-json-schema/index.js +54 -0
- package/_vendor/zod-to-json-schema/index.js.map +1 -0
- package/_vendor/zod-to-json-schema/index.mjs +38 -0
- package/_vendor/zod-to-json-schema/index.mjs.map +1 -0
- package/_vendor/zod-to-json-schema/parseDef.d.ts +38 -0
- package/_vendor/zod-to-json-schema/parseDef.d.ts.map +1 -0
- package/_vendor/zod-to-json-schema/parseDef.js +168 -0
- package/_vendor/zod-to-json-schema/parseDef.js.map +1 -0
- package/_vendor/zod-to-json-schema/parseDef.mjs +164 -0
- package/_vendor/zod-to-json-schema/parseDef.mjs.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/any.d.ts +3 -0
- package/_vendor/zod-to-json-schema/parsers/any.d.ts.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/any.js +8 -0
- package/_vendor/zod-to-json-schema/parsers/any.js.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/any.mjs +4 -0
- package/_vendor/zod-to-json-schema/parsers/any.mjs.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/array.d.ts +13 -0
- package/_vendor/zod-to-json-schema/parsers/array.d.ts.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/array.js +30 -0
- package/_vendor/zod-to-json-schema/parsers/array.js.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/array.mjs +26 -0
- package/_vendor/zod-to-json-schema/parsers/array.mjs.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/bigint.d.ts +15 -0
- package/_vendor/zod-to-json-schema/parsers/bigint.d.ts.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/bigint.js +54 -0
- package/_vendor/zod-to-json-schema/parsers/bigint.js.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/bigint.mjs +50 -0
- package/_vendor/zod-to-json-schema/parsers/bigint.mjs.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/boolean.d.ts +5 -0
- package/_vendor/zod-to-json-schema/parsers/boolean.d.ts.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/boolean.js +10 -0
- package/_vendor/zod-to-json-schema/parsers/boolean.js.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/boolean.mjs +6 -0
- package/_vendor/zod-to-json-schema/parsers/boolean.mjs.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/branded.d.ts +4 -0
- package/_vendor/zod-to-json-schema/parsers/branded.d.ts.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/branded.js +9 -0
- package/_vendor/zod-to-json-schema/parsers/branded.js.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/branded.mjs +5 -0
- package/_vendor/zod-to-json-schema/parsers/branded.mjs.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/catch.d.ts +4 -0
- package/_vendor/zod-to-json-schema/parsers/catch.d.ts.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/catch.js +9 -0
- package/_vendor/zod-to-json-schema/parsers/catch.js.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/catch.mjs +5 -0
- package/_vendor/zod-to-json-schema/parsers/catch.mjs.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/date.d.ts +16 -0
- package/_vendor/zod-to-json-schema/parsers/date.d.ts.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/date.js +51 -0
- package/_vendor/zod-to-json-schema/parsers/date.js.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/date.mjs +47 -0
- package/_vendor/zod-to-json-schema/parsers/date.mjs.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/default.d.ts +7 -0
- package/_vendor/zod-to-json-schema/parsers/default.d.ts.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/default.js +12 -0
- package/_vendor/zod-to-json-schema/parsers/default.js.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/default.mjs +8 -0
- package/_vendor/zod-to-json-schema/parsers/default.mjs.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/effects.d.ts +5 -0
- package/_vendor/zod-to-json-schema/parsers/effects.d.ts.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/effects.js +9 -0
- package/_vendor/zod-to-json-schema/parsers/effects.js.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/effects.mjs +5 -0
- package/_vendor/zod-to-json-schema/parsers/effects.mjs.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/enum.d.ts +7 -0
- package/_vendor/zod-to-json-schema/parsers/enum.d.ts.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/enum.js +11 -0
- package/_vendor/zod-to-json-schema/parsers/enum.js.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/enum.mjs +7 -0
- package/_vendor/zod-to-json-schema/parsers/enum.mjs.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/intersection.d.ts +9 -0
- package/_vendor/zod-to-json-schema/parsers/intersection.d.ts.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/intersection.js +54 -0
- package/_vendor/zod-to-json-schema/parsers/intersection.js.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/intersection.mjs +50 -0
- package/_vendor/zod-to-json-schema/parsers/intersection.mjs.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/literal.d.ts +10 -0
- package/_vendor/zod-to-json-schema/parsers/literal.d.ts.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/literal.js +26 -0
- package/_vendor/zod-to-json-schema/parsers/literal.js.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/literal.mjs +22 -0
- package/_vendor/zod-to-json-schema/parsers/literal.mjs.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/map.d.ts +16 -0
- package/_vendor/zod-to-json-schema/parsers/map.d.ts.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/map.js +30 -0
- package/_vendor/zod-to-json-schema/parsers/map.js.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/map.mjs +26 -0
- package/_vendor/zod-to-json-schema/parsers/map.mjs.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/nativeEnum.d.ts +7 -0
- package/_vendor/zod-to-json-schema/parsers/nativeEnum.d.ts.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/nativeEnum.js +21 -0
- package/_vendor/zod-to-json-schema/parsers/nativeEnum.js.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/nativeEnum.mjs +17 -0
- package/_vendor/zod-to-json-schema/parsers/nativeEnum.mjs.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/never.d.ts +5 -0
- package/_vendor/zod-to-json-schema/parsers/never.d.ts.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/never.js +10 -0
- package/_vendor/zod-to-json-schema/parsers/never.js.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/never.mjs +6 -0
- package/_vendor/zod-to-json-schema/parsers/never.mjs.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/null.d.ts +6 -0
- package/_vendor/zod-to-json-schema/parsers/null.d.ts.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/null.js +15 -0
- package/_vendor/zod-to-json-schema/parsers/null.js.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/null.mjs +11 -0
- package/_vendor/zod-to-json-schema/parsers/null.mjs.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/nullable.d.ts +11 -0
- package/_vendor/zod-to-json-schema/parsers/nullable.d.ts.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/nullable.js +35 -0
- package/_vendor/zod-to-json-schema/parsers/nullable.js.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/nullable.mjs +31 -0
- package/_vendor/zod-to-json-schema/parsers/nullable.mjs.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/number.d.ts +14 -0
- package/_vendor/zod-to-json-schema/parsers/number.d.ts.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/number.js +57 -0
- package/_vendor/zod-to-json-schema/parsers/number.js.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/number.mjs +53 -0
- package/_vendor/zod-to-json-schema/parsers/number.mjs.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/object.d.ts +11 -0
- package/_vendor/zod-to-json-schema/parsers/object.d.ts.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/object.js +51 -0
- package/_vendor/zod-to-json-schema/parsers/object.js.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/object.mjs +47 -0
- package/_vendor/zod-to-json-schema/parsers/object.mjs.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/optional.d.ts +5 -0
- package/_vendor/zod-to-json-schema/parsers/optional.d.ts.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/optional.js +25 -0
- package/_vendor/zod-to-json-schema/parsers/optional.js.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/optional.mjs +21 -0
- package/_vendor/zod-to-json-schema/parsers/optional.mjs.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/pipeline.d.ts +6 -0
- package/_vendor/zod-to-json-schema/parsers/pipeline.d.ts.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/pipeline.js +25 -0
- package/_vendor/zod-to-json-schema/parsers/pipeline.js.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/pipeline.mjs +21 -0
- package/_vendor/zod-to-json-schema/parsers/pipeline.mjs.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/promise.d.ts +5 -0
- package/_vendor/zod-to-json-schema/parsers/promise.d.ts.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/promise.js +9 -0
- package/_vendor/zod-to-json-schema/parsers/promise.js.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/promise.mjs +5 -0
- package/_vendor/zod-to-json-schema/parsers/promise.mjs.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/readonly.d.ts +4 -0
- package/_vendor/zod-to-json-schema/parsers/readonly.d.ts.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/readonly.js +9 -0
- package/_vendor/zod-to-json-schema/parsers/readonly.js.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/readonly.mjs +5 -0
- package/_vendor/zod-to-json-schema/parsers/readonly.mjs.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/record.d.ts +14 -0
- package/_vendor/zod-to-json-schema/parsers/record.d.ts.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/record.js +50 -0
- package/_vendor/zod-to-json-schema/parsers/record.js.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/record.mjs +46 -0
- package/_vendor/zod-to-json-schema/parsers/record.mjs.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/set.d.ts +14 -0
- package/_vendor/zod-to-json-schema/parsers/set.d.ts.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/set.js +25 -0
- package/_vendor/zod-to-json-schema/parsers/set.js.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/set.mjs +21 -0
- package/_vendor/zod-to-json-schema/parsers/set.mjs.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/string.d.ts +70 -0
- package/_vendor/zod-to-json-schema/parsers/string.d.ts.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/string.js +316 -0
- package/_vendor/zod-to-json-schema/parsers/string.js.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/string.mjs +312 -0
- package/_vendor/zod-to-json-schema/parsers/string.mjs.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/tuple.d.ts +14 -0
- package/_vendor/zod-to-json-schema/parsers/tuple.d.ts.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/tuple.js +37 -0
- package/_vendor/zod-to-json-schema/parsers/tuple.js.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/tuple.mjs +33 -0
- package/_vendor/zod-to-json-schema/parsers/tuple.mjs.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/undefined.d.ts +5 -0
- package/_vendor/zod-to-json-schema/parsers/undefined.d.ts.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/undefined.js +10 -0
- package/_vendor/zod-to-json-schema/parsers/undefined.js.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/undefined.mjs +6 -0
- package/_vendor/zod-to-json-schema/parsers/undefined.mjs.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/union.d.ts +24 -0
- package/_vendor/zod-to-json-schema/parsers/union.d.ts.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/union.js +77 -0
- package/_vendor/zod-to-json-schema/parsers/union.js.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/union.mjs +73 -0
- package/_vendor/zod-to-json-schema/parsers/union.mjs.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/unknown.d.ts +3 -0
- package/_vendor/zod-to-json-schema/parsers/unknown.d.ts.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/unknown.js +8 -0
- package/_vendor/zod-to-json-schema/parsers/unknown.js.map +1 -0
- package/_vendor/zod-to-json-schema/parsers/unknown.mjs +4 -0
- package/_vendor/zod-to-json-schema/parsers/unknown.mjs.map +1 -0
- package/_vendor/zod-to-json-schema/zodToJsonSchema.d.ts +11 -0
- package/_vendor/zod-to-json-schema/zodToJsonSchema.d.ts.map +1 -0
- package/_vendor/zod-to-json-schema/zodToJsonSchema.js +53 -0
- package/_vendor/zod-to-json-schema/zodToJsonSchema.js.map +1 -0
- package/_vendor/zod-to-json-schema/zodToJsonSchema.mjs +50 -0
- package/_vendor/zod-to-json-schema/zodToJsonSchema.mjs.map +1 -0
- package/error.d.ts +6 -0
- package/error.d.ts.map +1 -1
- package/error.js +13 -1
- package/error.js.map +1 -1
- package/error.mjs +10 -0
- package/error.mjs.map +1 -1
- package/helpers/zod.d.ts +57 -0
- package/helpers/zod.d.ts.map +1 -0
- package/helpers/zod.js +79 -0
- package/helpers/zod.js.map +1 -0
- package/helpers/zod.mjs +74 -0
- package/helpers/zod.mjs.map +1 -0
- package/index.d.mts +8 -0
- package/index.d.ts +8 -0
- package/index.d.ts.map +1 -1
- package/index.js +1 -0
- package/index.js.map +1 -1
- package/index.mjs +1 -0
- package/index.mjs.map +1 -1
- package/lib/AbstractChatCompletionRunner.d.ts +15 -68
- package/lib/AbstractChatCompletionRunner.d.ts.map +1 -1
- package/lib/AbstractChatCompletionRunner.js +47 -200
- package/lib/AbstractChatCompletionRunner.js.map +1 -1
- package/lib/AbstractChatCompletionRunner.mjs +48 -201
- package/lib/AbstractChatCompletionRunner.mjs.map +1 -1
- package/lib/AssistantStream.d.ts +10 -6
- package/lib/AssistantStream.d.ts.map +1 -1
- package/lib/AssistantStream.js +18 -6
- package/lib/AssistantStream.js.map +1 -1
- package/lib/AssistantStream.mjs +18 -6
- package/lib/AssistantStream.mjs.map +1 -1
- package/lib/ChatCompletionRunner.d.ts +8 -6
- package/lib/ChatCompletionRunner.d.ts.map +1 -1
- package/lib/ChatCompletionRunner.js +4 -4
- package/lib/ChatCompletionRunner.js.map +1 -1
- package/lib/ChatCompletionRunner.mjs +4 -4
- package/lib/ChatCompletionRunner.mjs.map +1 -1
- package/lib/ChatCompletionStream.d.ts +71 -12
- package/lib/ChatCompletionStream.d.ts.map +1 -1
- package/lib/ChatCompletionStream.js +233 -42
- package/lib/ChatCompletionStream.js.map +1 -1
- package/lib/ChatCompletionStream.mjs +234 -43
- package/lib/ChatCompletionStream.mjs.map +1 -1
- package/lib/ChatCompletionStreamingRunner.d.ts +8 -6
- package/lib/ChatCompletionStreamingRunner.d.ts.map +1 -1
- package/lib/ChatCompletionStreamingRunner.js +9 -7
- package/lib/ChatCompletionStreamingRunner.js.map +1 -1
- package/lib/ChatCompletionStreamingRunner.mjs +9 -7
- package/lib/ChatCompletionStreamingRunner.mjs.map +1 -1
- package/lib/EventStream.d.ts +63 -0
- package/lib/EventStream.d.ts.map +1 -0
- package/lib/EventStream.js +200 -0
- package/lib/EventStream.js.map +1 -0
- package/lib/EventStream.mjs +196 -0
- package/lib/EventStream.mjs.map +1 -0
- package/lib/RunnableFunction.d.ts +4 -2
- package/lib/RunnableFunction.d.ts.map +1 -1
- package/lib/RunnableFunction.js.map +1 -1
- package/lib/RunnableFunction.mjs.map +1 -1
- package/lib/parser.d.ts +37 -0
- package/lib/parser.d.ts.map +1 -0
- package/lib/parser.js +133 -0
- package/lib/parser.js.map +1 -0
- package/lib/parser.mjs +121 -0
- package/lib/parser.mjs.map +1 -0
- package/package.json +10 -2
- package/resources/audio/audio.d.ts +4 -0
- package/resources/audio/audio.d.ts.map +1 -1
- package/resources/audio/audio.js.map +1 -1
- package/resources/audio/audio.mjs.map +1 -1
- package/resources/audio/index.d.ts +2 -2
- package/resources/audio/index.d.ts.map +1 -1
- package/resources/audio/index.js.map +1 -1
- package/resources/audio/index.mjs.map +1 -1
- package/resources/audio/speech.d.ts +3 -1
- package/resources/audio/speech.d.ts.map +1 -1
- package/resources/audio/speech.js.map +1 -1
- package/resources/audio/speech.mjs.map +1 -1
- package/resources/audio/transcriptions.d.ts +2 -1
- package/resources/audio/transcriptions.d.ts.map +1 -1
- package/resources/audio/transcriptions.js.map +1 -1
- package/resources/audio/transcriptions.mjs.map +1 -1
- package/resources/audio/translations.d.ts +2 -1
- package/resources/audio/translations.d.ts.map +1 -1
- package/resources/audio/translations.js.map +1 -1
- package/resources/audio/translations.mjs.map +1 -1
- package/resources/beta/assistants.d.ts +19 -3
- package/resources/beta/assistants.d.ts.map +1 -1
- package/resources/beta/assistants.js.map +1 -1
- package/resources/beta/assistants.mjs.map +1 -1
- package/resources/beta/beta.d.ts +0 -1
- package/resources/beta/beta.d.ts.map +1 -1
- package/resources/beta/beta.js.map +1 -1
- package/resources/beta/beta.mjs.map +1 -1
- package/resources/beta/chat/completions.d.ts +25 -5
- package/resources/beta/chat/completions.d.ts.map +1 -1
- package/resources/beta/chat/completions.js +17 -5
- package/resources/beta/chat/completions.js.map +1 -1
- package/resources/beta/chat/completions.mjs +17 -5
- package/resources/beta/chat/completions.mjs.map +1 -1
- package/resources/beta/index.d.ts +1 -1
- package/resources/beta/index.d.ts.map +1 -1
- package/resources/beta/index.js.map +1 -1
- package/resources/beta/index.mjs.map +1 -1
- package/resources/beta/threads/index.d.ts +2 -2
- package/resources/beta/threads/index.d.ts.map +1 -1
- package/resources/beta/threads/index.js.map +1 -1
- package/resources/beta/threads/index.mjs.map +1 -1
- package/resources/beta/threads/messages.d.ts +28 -2
- package/resources/beta/threads/messages.d.ts.map +1 -1
- package/resources/beta/threads/messages.js.map +1 -1
- package/resources/beta/threads/messages.mjs.map +1 -1
- package/resources/beta/threads/runs/runs.d.ts +12 -1
- package/resources/beta/threads/runs/runs.d.ts.map +1 -1
- package/resources/beta/threads/runs/runs.js.map +1 -1
- package/resources/beta/threads/runs/runs.mjs.map +1 -1
- package/resources/beta/threads/threads.d.ts +22 -8
- package/resources/beta/threads/threads.d.ts.map +1 -1
- package/resources/beta/threads/threads.js.map +1 -1
- package/resources/beta/threads/threads.mjs.map +1 -1
- package/resources/beta/vector-stores/files.d.ts +1 -1
- package/resources/beta/vector-stores/files.d.ts.map +1 -1
- package/resources/chat/chat.d.ts +2 -1
- package/resources/chat/chat.d.ts.map +1 -1
- package/resources/chat/chat.js.map +1 -1
- package/resources/chat/chat.mjs.map +1 -1
- package/resources/chat/completions.d.ts +37 -26
- package/resources/chat/completions.d.ts.map +1 -1
- package/resources/chat/completions.js.map +1 -1
- package/resources/chat/completions.mjs.map +1 -1
- package/resources/chat/index.d.ts +1 -1
- package/resources/chat/index.d.ts.map +1 -1
- package/resources/chat/index.js.map +1 -1
- package/resources/chat/index.mjs.map +1 -1
- package/resources/fine-tuning/jobs/jobs.d.ts +3 -3
- package/resources/fine-tuning/jobs/jobs.d.ts.map +1 -1
- package/resources/images.d.ts +5 -3
- package/resources/images.d.ts.map +1 -1
- package/resources/images.js.map +1 -1
- package/resources/images.mjs.map +1 -1
- package/resources/index.d.ts +3 -3
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/moderations.d.ts +3 -1
- package/resources/moderations.d.ts.map +1 -1
- package/resources/moderations.js.map +1 -1
- package/resources/moderations.mjs.map +1 -1
- package/resources/shared.d.ts +53 -0
- package/resources/shared.d.ts.map +1 -1
- package/src/_vendor/partial-json-parser/README.md +3 -0
- package/src/_vendor/partial-json-parser/parser.ts +264 -0
- package/src/_vendor/zod-to-json-schema/Options.ts +73 -0
- package/src/_vendor/zod-to-json-schema/Refs.ts +39 -0
- package/src/_vendor/zod-to-json-schema/errorMessages.ts +31 -0
- package/src/_vendor/zod-to-json-schema/index.ts +37 -0
- package/src/_vendor/zod-to-json-schema/parseDef.ts +231 -0
- package/src/_vendor/zod-to-json-schema/parsers/any.ts +5 -0
- package/src/_vendor/zod-to-json-schema/parsers/array.ts +36 -0
- package/src/_vendor/zod-to-json-schema/parsers/bigint.ts +60 -0
- package/src/_vendor/zod-to-json-schema/parsers/boolean.ts +9 -0
- package/src/_vendor/zod-to-json-schema/parsers/branded.ts +7 -0
- package/src/_vendor/zod-to-json-schema/parsers/catch.ts +7 -0
- package/src/_vendor/zod-to-json-schema/parsers/date.ts +83 -0
- package/src/_vendor/zod-to-json-schema/parsers/default.ts +10 -0
- package/src/_vendor/zod-to-json-schema/parsers/effects.ts +7 -0
- package/src/_vendor/zod-to-json-schema/parsers/enum.ts +13 -0
- package/src/_vendor/zod-to-json-schema/parsers/intersection.ts +64 -0
- package/src/_vendor/zod-to-json-schema/parsers/literal.ts +37 -0
- package/src/_vendor/zod-to-json-schema/parsers/map.ts +42 -0
- package/src/_vendor/zod-to-json-schema/parsers/nativeEnum.ts +27 -0
- package/src/_vendor/zod-to-json-schema/parsers/never.ts +9 -0
- package/src/_vendor/zod-to-json-schema/parsers/null.ts +16 -0
- package/src/_vendor/zod-to-json-schema/parsers/nullable.ts +49 -0
- package/src/_vendor/zod-to-json-schema/parsers/number.ts +62 -0
- package/src/_vendor/zod-to-json-schema/parsers/object.ts +63 -0
- package/src/_vendor/zod-to-json-schema/parsers/optional.ts +25 -0
- package/src/_vendor/zod-to-json-schema/parsers/pipeline.ts +28 -0
- package/src/_vendor/zod-to-json-schema/parsers/promise.ts +7 -0
- package/src/_vendor/zod-to-json-schema/parsers/readonly.ts +7 -0
- package/src/_vendor/zod-to-json-schema/parsers/record.ts +73 -0
- package/src/_vendor/zod-to-json-schema/parsers/set.ts +36 -0
- package/src/_vendor/zod-to-json-schema/parsers/string.ts +400 -0
- package/src/_vendor/zod-to-json-schema/parsers/tuple.ts +54 -0
- package/src/_vendor/zod-to-json-schema/parsers/undefined.ts +9 -0
- package/src/_vendor/zod-to-json-schema/parsers/union.ts +119 -0
- package/src/_vendor/zod-to-json-schema/parsers/unknown.ts +5 -0
- package/src/_vendor/zod-to-json-schema/zodToJsonSchema.ts +91 -0
- package/src/error.ts +12 -0
- package/src/helpers/zod.ts +102 -0
- package/src/index.ts +8 -0
- package/src/lib/AbstractChatCompletionRunner.ts +72 -258
- package/src/lib/AssistantStream.ts +47 -19
- package/src/lib/ChatCompletionRunner.ts +16 -12
- package/src/lib/ChatCompletionStream.ts +423 -47
- package/src/lib/ChatCompletionStreamingRunner.ts +19 -15
- package/src/lib/{AbstractAssistantStreamRunner.ts → EventStream.ts} +37 -138
- package/src/lib/RunnableFunction.ts +4 -2
- package/src/lib/parser.ts +235 -0
- package/src/resources/audio/audio.ts +5 -0
- package/src/resources/audio/index.ts +2 -2
- package/src/resources/audio/speech.ts +4 -1
- package/src/resources/audio/transcriptions.ts +2 -1
- package/src/resources/audio/translations.ts +2 -1
- package/src/resources/beta/assistants.ts +19 -26
- package/src/resources/beta/beta.ts +0 -1
- package/src/resources/beta/chat/completions.ts +77 -27
- package/src/resources/beta/index.ts +0 -1
- package/src/resources/beta/threads/index.ts +2 -1
- package/src/resources/beta/threads/messages.ts +41 -2
- package/src/resources/beta/threads/runs/runs.ts +12 -25
- package/src/resources/beta/threads/threads.ts +26 -32
- package/src/resources/beta/vector-stores/files.ts +1 -1
- package/src/resources/chat/chat.ts +2 -0
- package/src/resources/chat/completions.ts +47 -27
- package/src/resources/chat/index.ts +1 -0
- package/src/resources/fine-tuning/jobs/jobs.ts +3 -3
- package/src/resources/images.ts +6 -3
- package/src/resources/index.ts +9 -2
- package/src/resources/moderations.ts +4 -1
- package/src/resources/shared.ts +62 -0
- package/src/version.ts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
- package/lib/AbstractAssistantStreamRunner.d.ts +0 -74
- package/lib/AbstractAssistantStreamRunner.d.ts.map +0 -1
- package/lib/AbstractAssistantStreamRunner.js +0 -246
- package/lib/AbstractAssistantStreamRunner.js.map +0 -1
- package/lib/AbstractAssistantStreamRunner.mjs +0 -242
- package/lib/AbstractAssistantStreamRunner.mjs.map +0 -1
- package/lib/ChatCompletionRunFunctions.test.d.ts +0 -2
- package/lib/ChatCompletionRunFunctions.test.d.ts.map +0 -1
- package/lib/ChatCompletionRunFunctions.test.js +0 -2177
- package/lib/ChatCompletionRunFunctions.test.js.map +0 -1
- package/lib/ChatCompletionRunFunctions.test.mjs +0 -2172
- package/lib/ChatCompletionRunFunctions.test.mjs.map +0 -1
- package/src/lib/ChatCompletionRunFunctions.test.ts +0 -2328
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { setResponseValueAndErrors } from "../errorMessages.mjs";
|
|
2
|
+
export function parseDateDef(def, refs, overrideDateStrategy) {
|
|
3
|
+
const strategy = overrideDateStrategy ?? refs.dateStrategy;
|
|
4
|
+
if (Array.isArray(strategy)) {
|
|
5
|
+
return {
|
|
6
|
+
anyOf: strategy.map((item, i) => parseDateDef(def, refs, item)),
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
switch (strategy) {
|
|
10
|
+
case 'string':
|
|
11
|
+
case 'format:date-time':
|
|
12
|
+
return {
|
|
13
|
+
type: 'string',
|
|
14
|
+
format: 'date-time',
|
|
15
|
+
};
|
|
16
|
+
case 'format:date':
|
|
17
|
+
return {
|
|
18
|
+
type: 'string',
|
|
19
|
+
format: 'date',
|
|
20
|
+
};
|
|
21
|
+
case 'integer':
|
|
22
|
+
return integerDateParser(def, refs);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
const integerDateParser = (def, refs) => {
|
|
26
|
+
const res = {
|
|
27
|
+
type: 'integer',
|
|
28
|
+
format: 'unix-time',
|
|
29
|
+
};
|
|
30
|
+
if (refs.target === 'openApi3') {
|
|
31
|
+
return res;
|
|
32
|
+
}
|
|
33
|
+
for (const check of def.checks) {
|
|
34
|
+
switch (check.kind) {
|
|
35
|
+
case 'min':
|
|
36
|
+
setResponseValueAndErrors(res, 'minimum', check.value, // This is in milliseconds
|
|
37
|
+
check.message, refs);
|
|
38
|
+
break;
|
|
39
|
+
case 'max':
|
|
40
|
+
setResponseValueAndErrors(res, 'maximum', check.value, // This is in milliseconds
|
|
41
|
+
check.message, refs);
|
|
42
|
+
break;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return res;
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=date.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date.mjs","sourceRoot":"","sources":["../../../src/_vendor/zod-to-json-schema/parsers/date.ts"],"names":[],"mappings":"OAEO,EAAiB,yBAAyB,EAAE;AAgBnD,MAAM,UAAU,YAAY,CAC1B,GAAe,EACf,IAAU,EACV,oBAAmC;IAEnC,MAAM,QAAQ,GAAG,oBAAoB,IAAI,IAAI,CAAC,YAAY,CAAC;IAE3D,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;QAC3B,OAAO;YACL,KAAK,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,YAAY,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;SAChE,CAAC;KACH;IAED,QAAQ,QAAQ,EAAE;QAChB,KAAK,QAAQ,CAAC;QACd,KAAK,kBAAkB;YACrB,OAAO;gBACL,IAAI,EAAE,QAAQ;gBACd,MAAM,EAAE,WAAW;aACpB,CAAC;QACJ,KAAK,aAAa;YAChB,OAAO;gBACL,IAAI,EAAE,QAAQ;gBACd,MAAM,EAAE,MAAM;aACf,CAAC;QACJ,KAAK,SAAS;YACZ,OAAO,iBAAiB,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;KACvC;AACH,CAAC;AAED,MAAM,iBAAiB,GAAG,CAAC,GAAe,EAAE,IAAU,EAAE,EAAE;IACxD,MAAM,GAAG,GAAwB;QAC/B,IAAI,EAAE,SAAS;QACf,MAAM,EAAE,WAAW;KACpB,CAAC;IAEF,IAAI,IAAI,CAAC,MAAM,KAAK,UAAU,EAAE;QAC9B,OAAO,GAAG,CAAC;KACZ;IAED,KAAK,MAAM,KAAK,IAAI,GAAG,CAAC,MAAM,EAAE;QAC9B,QAAQ,KAAK,CAAC,IAAI,EAAE;YAClB,KAAK,KAAK;gBACR,yBAAyB,CACvB,GAAG,EACH,SAAS,EACT,KAAK,CAAC,KAAK,EAAE,0BAA0B;gBACvC,KAAK,CAAC,OAAO,EACb,IAAI,CACL,CAAC;gBACF,MAAM;YACR,KAAK,KAAK;gBACR,yBAAyB,CACvB,GAAG,EACH,SAAS,EACT,KAAK,CAAC,KAAK,EAAE,0BAA0B;gBACvC,KAAK,CAAC,OAAO,EACb,IAAI,CACL,CAAC;gBACF,MAAM;SACT;KACF;IAED,OAAO,GAAG,CAAC;AACb,CAAC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ZodDefaultDef } from 'zod';
|
|
2
|
+
import { JsonSchema7Type } from "../parseDef.js";
|
|
3
|
+
import { Refs } from "../Refs.js";
|
|
4
|
+
export declare function parseDefaultDef(_def: ZodDefaultDef, refs: Refs): JsonSchema7Type & {
|
|
5
|
+
default: any;
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=default.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../../src/_vendor/zod-to-json-schema/parsers/default.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,eAAe,EAAY,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B,wBAAgB,eAAe,CAAC,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,IAAI,GAAG,eAAe,GAAG;IAAE,OAAO,EAAE,GAAG,CAAA;CAAE,CAKnG"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseDefaultDef = void 0;
|
|
4
|
+
const parseDef_1 = require("../parseDef.js");
|
|
5
|
+
function parseDefaultDef(_def, refs) {
|
|
6
|
+
return {
|
|
7
|
+
...(0, parseDef_1.parseDef)(_def.innerType._def, refs),
|
|
8
|
+
default: _def.defaultValue(),
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
exports.parseDefaultDef = parseDefaultDef;
|
|
12
|
+
//# sourceMappingURL=default.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default.js","sourceRoot":"","sources":["../../../src/_vendor/zod-to-json-schema/parsers/default.ts"],"names":[],"mappings":";;;AACA,6CAAwD;AAGxD,SAAgB,eAAe,CAAC,IAAmB,EAAE,IAAU;IAC7D,OAAO;QACL,GAAG,IAAA,mBAAQ,EAAC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC;QACtC,OAAO,EAAE,IAAI,CAAC,YAAY,EAAE;KAC7B,CAAC;AACJ,CAAC;AALD,0CAKC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default.mjs","sourceRoot":"","sources":["../../../src/_vendor/zod-to-json-schema/parsers/default.ts"],"names":[],"mappings":"OACO,EAAmB,QAAQ,EAAE;AAGpC,MAAM,UAAU,eAAe,CAAC,IAAmB,EAAE,IAAU;IAC7D,OAAO;QACL,GAAG,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC;QACtC,OAAO,EAAE,IAAI,CAAC,YAAY,EAAE;KAC7B,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"effects.d.ts","sourceRoot":"","sources":["../../../src/_vendor/zod-to-json-schema/parsers/effects.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,eAAe,EAAY,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B,wBAAgB,eAAe,CAAC,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,IAAI,GAAG,eAAe,GAAG,SAAS,CAE5F"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseEffectsDef = void 0;
|
|
4
|
+
const parseDef_1 = require("../parseDef.js");
|
|
5
|
+
function parseEffectsDef(_def, refs) {
|
|
6
|
+
return refs.effectStrategy === 'input' ? (0, parseDef_1.parseDef)(_def.schema._def, refs) : {};
|
|
7
|
+
}
|
|
8
|
+
exports.parseEffectsDef = parseEffectsDef;
|
|
9
|
+
//# sourceMappingURL=effects.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"effects.js","sourceRoot":"","sources":["../../../src/_vendor/zod-to-json-schema/parsers/effects.ts"],"names":[],"mappings":";;;AACA,6CAAwD;AAGxD,SAAgB,eAAe,CAAC,IAAmB,EAAE,IAAU;IAC7D,OAAO,IAAI,CAAC,cAAc,KAAK,OAAO,CAAC,CAAC,CAAC,IAAA,mBAAQ,EAAC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACjF,CAAC;AAFD,0CAEC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"effects.mjs","sourceRoot":"","sources":["../../../src/_vendor/zod-to-json-schema/parsers/effects.ts"],"names":[],"mappings":"OACO,EAAmB,QAAQ,EAAE;AAGpC,MAAM,UAAU,eAAe,CAAC,IAAmB,EAAE,IAAU;IAC7D,OAAO,IAAI,CAAC,cAAc,KAAK,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACjF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enum.d.ts","sourceRoot":"","sources":["../../../src/_vendor/zod-to-json-schema/parsers/enum.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAEjC,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB,CAAC;AAEF,wBAAgB,YAAY,CAAC,GAAG,EAAE,UAAU,GAAG,mBAAmB,CAKjE"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseEnumDef = void 0;
|
|
4
|
+
function parseEnumDef(def) {
|
|
5
|
+
return {
|
|
6
|
+
type: 'string',
|
|
7
|
+
enum: [...def.values],
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
exports.parseEnumDef = parseEnumDef;
|
|
11
|
+
//# sourceMappingURL=enum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enum.js","sourceRoot":"","sources":["../../../src/_vendor/zod-to-json-schema/parsers/enum.ts"],"names":[],"mappings":";;;AAOA,SAAgB,YAAY,CAAC,GAAe;IAC1C,OAAO;QACL,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC;KACtB,CAAC;AACJ,CAAC;AALD,oCAKC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enum.mjs","sourceRoot":"","sources":["../../../src/_vendor/zod-to-json-schema/parsers/enum.ts"],"names":[],"mappings":"AAOA,MAAM,UAAU,YAAY,CAAC,GAAe;IAC1C,OAAO;QACL,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC;KACtB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ZodIntersectionDef } from 'zod';
|
|
2
|
+
import { JsonSchema7Type } from "../parseDef.js";
|
|
3
|
+
import { Refs } from "../Refs.js";
|
|
4
|
+
export type JsonSchema7AllOfType = {
|
|
5
|
+
allOf: JsonSchema7Type[];
|
|
6
|
+
unevaluatedProperties?: boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare function parseIntersectionDef(def: ZodIntersectionDef, refs: Refs): JsonSchema7AllOfType | JsonSchema7Type | undefined;
|
|
9
|
+
//# sourceMappingURL=intersection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"intersection.d.ts","sourceRoot":"","sources":["../../../src/_vendor/zod-to-json-schema/parsers/intersection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,KAAK,CAAC;AACzC,OAAO,EAAE,eAAe,EAAY,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAG/B,MAAM,MAAM,oBAAoB,GAAG;IACjC,KAAK,EAAE,eAAe,EAAE,CAAC;IACzB,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC,CAAC;AASF,wBAAgB,oBAAoB,CAClC,GAAG,EAAE,kBAAkB,EACvB,IAAI,EAAE,IAAI,GACT,oBAAoB,GAAG,eAAe,GAAG,SAAS,CA2CpD"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseIntersectionDef = void 0;
|
|
4
|
+
const parseDef_1 = require("../parseDef.js");
|
|
5
|
+
const isJsonSchema7AllOfType = (type) => {
|
|
6
|
+
if ('type' in type && type.type === 'string')
|
|
7
|
+
return false;
|
|
8
|
+
return 'allOf' in type;
|
|
9
|
+
};
|
|
10
|
+
function parseIntersectionDef(def, refs) {
|
|
11
|
+
const allOf = [
|
|
12
|
+
(0, parseDef_1.parseDef)(def.left._def, {
|
|
13
|
+
...refs,
|
|
14
|
+
currentPath: [...refs.currentPath, 'allOf', '0'],
|
|
15
|
+
}),
|
|
16
|
+
(0, parseDef_1.parseDef)(def.right._def, {
|
|
17
|
+
...refs,
|
|
18
|
+
currentPath: [...refs.currentPath, 'allOf', '1'],
|
|
19
|
+
}),
|
|
20
|
+
].filter((x) => !!x);
|
|
21
|
+
let unevaluatedProperties = refs.target === 'jsonSchema2019-09' ? { unevaluatedProperties: false } : undefined;
|
|
22
|
+
const mergedAllOf = [];
|
|
23
|
+
// If either of the schemas is an allOf, merge them into a single allOf
|
|
24
|
+
allOf.forEach((schema) => {
|
|
25
|
+
if (isJsonSchema7AllOfType(schema)) {
|
|
26
|
+
mergedAllOf.push(...schema.allOf);
|
|
27
|
+
if (schema.unevaluatedProperties === undefined) {
|
|
28
|
+
// If one of the schemas has no unevaluatedProperties set,
|
|
29
|
+
// the merged schema should also have no unevaluatedProperties set
|
|
30
|
+
unevaluatedProperties = undefined;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
let nestedSchema = schema;
|
|
35
|
+
if ('additionalProperties' in schema && schema.additionalProperties === false) {
|
|
36
|
+
const { additionalProperties, ...rest } = schema;
|
|
37
|
+
nestedSchema = rest;
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
// As soon as one of the schemas has additionalProperties set not to false, we allow unevaluatedProperties
|
|
41
|
+
unevaluatedProperties = undefined;
|
|
42
|
+
}
|
|
43
|
+
mergedAllOf.push(nestedSchema);
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
return mergedAllOf.length ?
|
|
47
|
+
{
|
|
48
|
+
allOf: mergedAllOf,
|
|
49
|
+
...unevaluatedProperties,
|
|
50
|
+
}
|
|
51
|
+
: undefined;
|
|
52
|
+
}
|
|
53
|
+
exports.parseIntersectionDef = parseIntersectionDef;
|
|
54
|
+
//# sourceMappingURL=intersection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"intersection.js","sourceRoot":"","sources":["../../../src/_vendor/zod-to-json-schema/parsers/intersection.ts"],"names":[],"mappings":";;;AACA,6CAAwD;AASxD,MAAM,sBAAsB,GAAG,CAC7B,IAA6C,EACf,EAAE;IAChC,IAAI,MAAM,IAAI,IAAI,IAAI,IAAI,CAAC,IAAI,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC3D,OAAO,OAAO,IAAI,IAAI,CAAC;AACzB,CAAC,CAAC;AAEF,SAAgB,oBAAoB,CAClC,GAAuB,EACvB,IAAU;IAEV,MAAM,KAAK,GAAG;QACZ,IAAA,mBAAQ,EAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE;YACtB,GAAG,IAAI;YACP,WAAW,EAAE,CAAC,GAAG,IAAI,CAAC,WAAW,EAAE,OAAO,EAAE,GAAG,CAAC;SACjD,CAAC;QACF,IAAA,mBAAQ,EAAC,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE;YACvB,GAAG,IAAI;YACP,WAAW,EAAE,CAAC,GAAG,IAAI,CAAC,WAAW,EAAE,OAAO,EAAE,GAAG,CAAC;SACjD,CAAC;KACH,CAAC,MAAM,CAAC,CAAC,CAAC,EAAwB,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAE3C,IAAI,qBAAqB,GACvB,IAAI,CAAC,MAAM,KAAK,mBAAmB,CAAC,CAAC,CAAC,EAAE,qBAAqB,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;IAErF,MAAM,WAAW,GAAsB,EAAE,CAAC;IAC1C,uEAAuE;IACvE,KAAK,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;QACvB,IAAI,sBAAsB,CAAC,MAAM,CAAC,EAAE;YAClC,WAAW,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;YAClC,IAAI,MAAM,CAAC,qBAAqB,KAAK,SAAS,EAAE;gBAC9C,0DAA0D;gBAC1D,kEAAkE;gBAClE,qBAAqB,GAAG,SAAS,CAAC;aACnC;SACF;aAAM;YACL,IAAI,YAAY,GAAoB,MAAM,CAAC;YAC3C,IAAI,sBAAsB,IAAI,MAAM,IAAI,MAAM,CAAC,oBAAoB,KAAK,KAAK,EAAE;gBAC7E,MAAM,EAAE,oBAAoB,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;gBACjD,YAAY,GAAG,IAAI,CAAC;aACrB;iBAAM;gBACL,0GAA0G;gBAC1G,qBAAqB,GAAG,SAAS,CAAC;aACnC;YACD,WAAW,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;SAChC;IACH,CAAC,CAAC,CAAC;IACH,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC;QACvB;YACE,KAAK,EAAE,WAAW;YAClB,GAAG,qBAAqB;SACzB;QACH,CAAC,CAAC,SAAS,CAAC;AAChB,CAAC;AA9CD,oDA8CC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { parseDef } from "../parseDef.mjs";
|
|
2
|
+
const isJsonSchema7AllOfType = (type) => {
|
|
3
|
+
if ('type' in type && type.type === 'string')
|
|
4
|
+
return false;
|
|
5
|
+
return 'allOf' in type;
|
|
6
|
+
};
|
|
7
|
+
export function parseIntersectionDef(def, refs) {
|
|
8
|
+
const allOf = [
|
|
9
|
+
parseDef(def.left._def, {
|
|
10
|
+
...refs,
|
|
11
|
+
currentPath: [...refs.currentPath, 'allOf', '0'],
|
|
12
|
+
}),
|
|
13
|
+
parseDef(def.right._def, {
|
|
14
|
+
...refs,
|
|
15
|
+
currentPath: [...refs.currentPath, 'allOf', '1'],
|
|
16
|
+
}),
|
|
17
|
+
].filter((x) => !!x);
|
|
18
|
+
let unevaluatedProperties = refs.target === 'jsonSchema2019-09' ? { unevaluatedProperties: false } : undefined;
|
|
19
|
+
const mergedAllOf = [];
|
|
20
|
+
// If either of the schemas is an allOf, merge them into a single allOf
|
|
21
|
+
allOf.forEach((schema) => {
|
|
22
|
+
if (isJsonSchema7AllOfType(schema)) {
|
|
23
|
+
mergedAllOf.push(...schema.allOf);
|
|
24
|
+
if (schema.unevaluatedProperties === undefined) {
|
|
25
|
+
// If one of the schemas has no unevaluatedProperties set,
|
|
26
|
+
// the merged schema should also have no unevaluatedProperties set
|
|
27
|
+
unevaluatedProperties = undefined;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
let nestedSchema = schema;
|
|
32
|
+
if ('additionalProperties' in schema && schema.additionalProperties === false) {
|
|
33
|
+
const { additionalProperties, ...rest } = schema;
|
|
34
|
+
nestedSchema = rest;
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
// As soon as one of the schemas has additionalProperties set not to false, we allow unevaluatedProperties
|
|
38
|
+
unevaluatedProperties = undefined;
|
|
39
|
+
}
|
|
40
|
+
mergedAllOf.push(nestedSchema);
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
return mergedAllOf.length ?
|
|
44
|
+
{
|
|
45
|
+
allOf: mergedAllOf,
|
|
46
|
+
...unevaluatedProperties,
|
|
47
|
+
}
|
|
48
|
+
: undefined;
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=intersection.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"intersection.mjs","sourceRoot":"","sources":["../../../src/_vendor/zod-to-json-schema/parsers/intersection.ts"],"names":[],"mappings":"OACO,EAAmB,QAAQ,EAAE;AASpC,MAAM,sBAAsB,GAAG,CAC7B,IAA6C,EACf,EAAE;IAChC,IAAI,MAAM,IAAI,IAAI,IAAI,IAAI,CAAC,IAAI,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC3D,OAAO,OAAO,IAAI,IAAI,CAAC;AACzB,CAAC,CAAC;AAEF,MAAM,UAAU,oBAAoB,CAClC,GAAuB,EACvB,IAAU;IAEV,MAAM,KAAK,GAAG;QACZ,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE;YACtB,GAAG,IAAI;YACP,WAAW,EAAE,CAAC,GAAG,IAAI,CAAC,WAAW,EAAE,OAAO,EAAE,GAAG,CAAC;SACjD,CAAC;QACF,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE;YACvB,GAAG,IAAI;YACP,WAAW,EAAE,CAAC,GAAG,IAAI,CAAC,WAAW,EAAE,OAAO,EAAE,GAAG,CAAC;SACjD,CAAC;KACH,CAAC,MAAM,CAAC,CAAC,CAAC,EAAwB,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAE3C,IAAI,qBAAqB,GACvB,IAAI,CAAC,MAAM,KAAK,mBAAmB,CAAC,CAAC,CAAC,EAAE,qBAAqB,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;IAErF,MAAM,WAAW,GAAsB,EAAE,CAAC;IAC1C,uEAAuE;IACvE,KAAK,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;QACvB,IAAI,sBAAsB,CAAC,MAAM,CAAC,EAAE;YAClC,WAAW,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;YAClC,IAAI,MAAM,CAAC,qBAAqB,KAAK,SAAS,EAAE;gBAC9C,0DAA0D;gBAC1D,kEAAkE;gBAClE,qBAAqB,GAAG,SAAS,CAAC;aACnC;SACF;aAAM;YACL,IAAI,YAAY,GAAoB,MAAM,CAAC;YAC3C,IAAI,sBAAsB,IAAI,MAAM,IAAI,MAAM,CAAC,oBAAoB,KAAK,KAAK,EAAE;gBAC7E,MAAM,EAAE,oBAAoB,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;gBACjD,YAAY,GAAG,IAAI,CAAC;aACrB;iBAAM;gBACL,0GAA0G;gBAC1G,qBAAqB,GAAG,SAAS,CAAC;aACnC;YACD,WAAW,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;SAChC;IACH,CAAC,CAAC,CAAC;IACH,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC;QACvB;YACE,KAAK,EAAE,WAAW;YAClB,GAAG,qBAAqB;SACzB;QACH,CAAC,CAAC,SAAS,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ZodLiteralDef } from 'zod';
|
|
2
|
+
import { Refs } from "../Refs.js";
|
|
3
|
+
export type JsonSchema7LiteralType = {
|
|
4
|
+
type: 'string' | 'number' | 'integer' | 'boolean';
|
|
5
|
+
const: string | number | boolean;
|
|
6
|
+
} | {
|
|
7
|
+
type: 'object' | 'array';
|
|
8
|
+
};
|
|
9
|
+
export declare function parseLiteralDef(def: ZodLiteralDef, refs: Refs): JsonSchema7LiteralType;
|
|
10
|
+
//# sourceMappingURL=literal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"literal.d.ts","sourceRoot":"","sources":["../../../src/_vendor/zod-to-json-schema/parsers/literal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B,MAAM,MAAM,sBAAsB,GAC9B;IACE,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAC;IAClD,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;CAClC,GACD;IACE,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC;CAC1B,CAAC;AAEN,wBAAgB,eAAe,CAAC,GAAG,EAAE,aAAa,EAAE,IAAI,EAAE,IAAI,GAAG,sBAAsB,CAwBtF"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseLiteralDef = void 0;
|
|
4
|
+
function parseLiteralDef(def, refs) {
|
|
5
|
+
const parsedType = typeof def.value;
|
|
6
|
+
if (parsedType !== 'bigint' &&
|
|
7
|
+
parsedType !== 'number' &&
|
|
8
|
+
parsedType !== 'boolean' &&
|
|
9
|
+
parsedType !== 'string') {
|
|
10
|
+
return {
|
|
11
|
+
type: Array.isArray(def.value) ? 'array' : 'object',
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
if (refs.target === 'openApi3') {
|
|
15
|
+
return {
|
|
16
|
+
type: parsedType === 'bigint' ? 'integer' : parsedType,
|
|
17
|
+
enum: [def.value],
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
return {
|
|
21
|
+
type: parsedType === 'bigint' ? 'integer' : parsedType,
|
|
22
|
+
const: def.value,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
exports.parseLiteralDef = parseLiteralDef;
|
|
26
|
+
//# sourceMappingURL=literal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"literal.js","sourceRoot":"","sources":["../../../src/_vendor/zod-to-json-schema/parsers/literal.ts"],"names":[],"mappings":";;;AAYA,SAAgB,eAAe,CAAC,GAAkB,EAAE,IAAU;IAC5D,MAAM,UAAU,GAAG,OAAO,GAAG,CAAC,KAAK,CAAC;IACpC,IACE,UAAU,KAAK,QAAQ;QACvB,UAAU,KAAK,QAAQ;QACvB,UAAU,KAAK,SAAS;QACxB,UAAU,KAAK,QAAQ,EACvB;QACA,OAAO;YACL,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ;SACpD,CAAC;KACH;IAED,IAAI,IAAI,CAAC,MAAM,KAAK,UAAU,EAAE;QAC9B,OAAO;YACL,IAAI,EAAE,UAAU,KAAK,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU;YACtD,IAAI,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC;SACX,CAAC;KACV;IAED,OAAO;QACL,IAAI,EAAE,UAAU,KAAK,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU;QACtD,KAAK,EAAE,GAAG,CAAC,KAAK;KACjB,CAAC;AACJ,CAAC;AAxBD,0CAwBC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export function parseLiteralDef(def, refs) {
|
|
2
|
+
const parsedType = typeof def.value;
|
|
3
|
+
if (parsedType !== 'bigint' &&
|
|
4
|
+
parsedType !== 'number' &&
|
|
5
|
+
parsedType !== 'boolean' &&
|
|
6
|
+
parsedType !== 'string') {
|
|
7
|
+
return {
|
|
8
|
+
type: Array.isArray(def.value) ? 'array' : 'object',
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
if (refs.target === 'openApi3') {
|
|
12
|
+
return {
|
|
13
|
+
type: parsedType === 'bigint' ? 'integer' : parsedType,
|
|
14
|
+
enum: [def.value],
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
return {
|
|
18
|
+
type: parsedType === 'bigint' ? 'integer' : parsedType,
|
|
19
|
+
const: def.value,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=literal.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"literal.mjs","sourceRoot":"","sources":["../../../src/_vendor/zod-to-json-schema/parsers/literal.ts"],"names":[],"mappings":"AAYA,MAAM,UAAU,eAAe,CAAC,GAAkB,EAAE,IAAU;IAC5D,MAAM,UAAU,GAAG,OAAO,GAAG,CAAC,KAAK,CAAC;IACpC,IACE,UAAU,KAAK,QAAQ;QACvB,UAAU,KAAK,QAAQ;QACvB,UAAU,KAAK,SAAS;QACxB,UAAU,KAAK,QAAQ,EACvB;QACA,OAAO;YACL,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ;SACpD,CAAC;KACH;IAED,IAAI,IAAI,CAAC,MAAM,KAAK,UAAU,EAAE;QAC9B,OAAO;YACL,IAAI,EAAE,UAAU,KAAK,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU;YACtD,IAAI,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC;SACX,CAAC;KACV;IAED,OAAO;QACL,IAAI,EAAE,UAAU,KAAK,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU;QACtD,KAAK,EAAE,GAAG,CAAC,KAAK;KACjB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ZodMapDef } from 'zod';
|
|
2
|
+
import { JsonSchema7Type } from "../parseDef.js";
|
|
3
|
+
import { Refs } from "../Refs.js";
|
|
4
|
+
import { JsonSchema7RecordType } from "./record.js";
|
|
5
|
+
export type JsonSchema7MapType = {
|
|
6
|
+
type: 'array';
|
|
7
|
+
maxItems: 125;
|
|
8
|
+
items: {
|
|
9
|
+
type: 'array';
|
|
10
|
+
items: [JsonSchema7Type, JsonSchema7Type];
|
|
11
|
+
minItems: 2;
|
|
12
|
+
maxItems: 2;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export declare function parseMapDef(def: ZodMapDef, refs: Refs): JsonSchema7MapType | JsonSchema7RecordType;
|
|
16
|
+
//# sourceMappingURL=map.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"map.d.ts","sourceRoot":"","sources":["../../../src/_vendor/zod-to-json-schema/parsers/map.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,eAAe,EAAY,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,qBAAqB,EAAkB,MAAM,UAAU,CAAC;AAEjE,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,GAAG,CAAC;IACd,KAAK,EAAE;QACL,IAAI,EAAE,OAAO,CAAC;QACd,KAAK,EAAE,CAAC,eAAe,EAAE,eAAe,CAAC,CAAC;QAC1C,QAAQ,EAAE,CAAC,CAAC;QACZ,QAAQ,EAAE,CAAC,CAAC;KACb,CAAC;CACH,CAAC;AAEF,wBAAgB,WAAW,CAAC,GAAG,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,GAAG,kBAAkB,GAAG,qBAAqB,CAyBlG"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseMapDef = void 0;
|
|
4
|
+
const parseDef_1 = require("../parseDef.js");
|
|
5
|
+
const record_1 = require("./record.js");
|
|
6
|
+
function parseMapDef(def, refs) {
|
|
7
|
+
if (refs.mapStrategy === 'record') {
|
|
8
|
+
return (0, record_1.parseRecordDef)(def, refs);
|
|
9
|
+
}
|
|
10
|
+
const keys = (0, parseDef_1.parseDef)(def.keyType._def, {
|
|
11
|
+
...refs,
|
|
12
|
+
currentPath: [...refs.currentPath, 'items', 'items', '0'],
|
|
13
|
+
}) || {};
|
|
14
|
+
const values = (0, parseDef_1.parseDef)(def.valueType._def, {
|
|
15
|
+
...refs,
|
|
16
|
+
currentPath: [...refs.currentPath, 'items', 'items', '1'],
|
|
17
|
+
}) || {};
|
|
18
|
+
return {
|
|
19
|
+
type: 'array',
|
|
20
|
+
maxItems: 125,
|
|
21
|
+
items: {
|
|
22
|
+
type: 'array',
|
|
23
|
+
items: [keys, values],
|
|
24
|
+
minItems: 2,
|
|
25
|
+
maxItems: 2,
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
exports.parseMapDef = parseMapDef;
|
|
30
|
+
//# sourceMappingURL=map.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"map.js","sourceRoot":"","sources":["../../../src/_vendor/zod-to-json-schema/parsers/map.ts"],"names":[],"mappings":";;;AACA,6CAAwD;AAExD,wCAAiE;AAajE,SAAgB,WAAW,CAAC,GAAc,EAAE,IAAU;IACpD,IAAI,IAAI,CAAC,WAAW,KAAK,QAAQ,EAAE;QACjC,OAAO,IAAA,uBAAc,EAAC,GAAG,EAAE,IAAI,CAAC,CAAC;KAClC;IAED,MAAM,IAAI,GACR,IAAA,mBAAQ,EAAC,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE;QACzB,GAAG,IAAI;QACP,WAAW,EAAE,CAAC,GAAG,IAAI,CAAC,WAAW,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,CAAC;KAC1D,CAAC,IAAI,EAAE,CAAC;IACX,MAAM,MAAM,GACV,IAAA,mBAAQ,EAAC,GAAG,CAAC,SAAS,CAAC,IAAI,EAAE;QAC3B,GAAG,IAAI;QACP,WAAW,EAAE,CAAC,GAAG,IAAI,CAAC,WAAW,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,CAAC;KAC1D,CAAC,IAAI,EAAE,CAAC;IACX,OAAO;QACL,IAAI,EAAE,OAAO;QACb,QAAQ,EAAE,GAAG;QACb,KAAK,EAAE;YACL,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC;YACrB,QAAQ,EAAE,CAAC;YACX,QAAQ,EAAE,CAAC;SACZ;KACF,CAAC;AACJ,CAAC;AAzBD,kCAyBC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { parseDef } from "../parseDef.mjs";
|
|
2
|
+
import { parseRecordDef } from "./record.mjs";
|
|
3
|
+
export function parseMapDef(def, refs) {
|
|
4
|
+
if (refs.mapStrategy === 'record') {
|
|
5
|
+
return parseRecordDef(def, refs);
|
|
6
|
+
}
|
|
7
|
+
const keys = parseDef(def.keyType._def, {
|
|
8
|
+
...refs,
|
|
9
|
+
currentPath: [...refs.currentPath, 'items', 'items', '0'],
|
|
10
|
+
}) || {};
|
|
11
|
+
const values = parseDef(def.valueType._def, {
|
|
12
|
+
...refs,
|
|
13
|
+
currentPath: [...refs.currentPath, 'items', 'items', '1'],
|
|
14
|
+
}) || {};
|
|
15
|
+
return {
|
|
16
|
+
type: 'array',
|
|
17
|
+
maxItems: 125,
|
|
18
|
+
items: {
|
|
19
|
+
type: 'array',
|
|
20
|
+
items: [keys, values],
|
|
21
|
+
minItems: 2,
|
|
22
|
+
maxItems: 2,
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=map.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"map.mjs","sourceRoot":"","sources":["../../../src/_vendor/zod-to-json-schema/parsers/map.ts"],"names":[],"mappings":"OACO,EAAmB,QAAQ,EAAE;OAE7B,EAAyB,cAAc,EAAE;AAahD,MAAM,UAAU,WAAW,CAAC,GAAc,EAAE,IAAU;IACpD,IAAI,IAAI,CAAC,WAAW,KAAK,QAAQ,EAAE;QACjC,OAAO,cAAc,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;KAClC;IAED,MAAM,IAAI,GACR,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE;QACzB,GAAG,IAAI;QACP,WAAW,EAAE,CAAC,GAAG,IAAI,CAAC,WAAW,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,CAAC;KAC1D,CAAC,IAAI,EAAE,CAAC;IACX,MAAM,MAAM,GACV,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,EAAE;QAC3B,GAAG,IAAI;QACP,WAAW,EAAE,CAAC,GAAG,IAAI,CAAC,WAAW,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,CAAC;KAC1D,CAAC,IAAI,EAAE,CAAC;IACX,OAAO;QACL,IAAI,EAAE,OAAO;QACb,QAAQ,EAAE,GAAG;QACb,KAAK,EAAE;YACL,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC;YACrB,QAAQ,EAAE,CAAC;YACX,QAAQ,EAAE,CAAC;SACZ;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ZodNativeEnumDef } from 'zod';
|
|
2
|
+
export type JsonSchema7NativeEnumType = {
|
|
3
|
+
type: 'string' | 'number' | ['string', 'number'];
|
|
4
|
+
enum: (string | number)[];
|
|
5
|
+
};
|
|
6
|
+
export declare function parseNativeEnumDef(def: ZodNativeEnumDef): JsonSchema7NativeEnumType;
|
|
7
|
+
//# sourceMappingURL=nativeEnum.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nativeEnum.d.ts","sourceRoot":"","sources":["../../../src/_vendor/zod-to-json-schema/parsers/nativeEnum.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,KAAK,CAAC;AAEvC,MAAM,MAAM,yBAAyB,GAAG;IACtC,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACjD,IAAI,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;CAC3B,CAAC;AAEF,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,gBAAgB,GAAG,yBAAyB,CAmBnF"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseNativeEnumDef = void 0;
|
|
4
|
+
function parseNativeEnumDef(def) {
|
|
5
|
+
const object = def.values;
|
|
6
|
+
const actualKeys = Object.keys(def.values).filter((key) => {
|
|
7
|
+
return typeof object[object[key]] !== 'number';
|
|
8
|
+
});
|
|
9
|
+
const actualValues = actualKeys.map((key) => object[key]);
|
|
10
|
+
const parsedTypes = Array.from(new Set(actualValues.map((values) => typeof values)));
|
|
11
|
+
return {
|
|
12
|
+
type: parsedTypes.length === 1 ?
|
|
13
|
+
parsedTypes[0] === 'string' ?
|
|
14
|
+
'string'
|
|
15
|
+
: 'number'
|
|
16
|
+
: ['string', 'number'],
|
|
17
|
+
enum: actualValues,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
exports.parseNativeEnumDef = parseNativeEnumDef;
|
|
21
|
+
//# sourceMappingURL=nativeEnum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nativeEnum.js","sourceRoot":"","sources":["../../../src/_vendor/zod-to-json-schema/parsers/nativeEnum.ts"],"names":[],"mappings":";;;AAOA,SAAgB,kBAAkB,CAAC,GAAqB;IACtD,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC;IAC1B,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,GAAW,EAAE,EAAE;QAChE,OAAO,OAAO,MAAM,CAAC,MAAM,CAAC,GAAG,CAAE,CAAC,KAAK,QAAQ,CAAC;IAClD,CAAC,CAAC,CAAC;IAEH,MAAM,YAAY,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,GAAW,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAE,CAAC,CAAC;IAEnE,MAAM,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,MAAuB,EAAE,EAAE,CAAC,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC;IAEtG,OAAO;QACL,IAAI,EACF,WAAW,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC;YACxB,WAAW,CAAC,CAAC,CAAC,KAAK,QAAQ,CAAC,CAAC;gBAC3B,QAAQ;gBACV,CAAC,CAAC,QAAQ;YACZ,CAAC,CAAC,CAAC,QAAQ,EAAE,QAAQ,CAAC;QACxB,IAAI,EAAE,YAAY;KACnB,CAAC;AACJ,CAAC;AAnBD,gDAmBC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export function parseNativeEnumDef(def) {
|
|
2
|
+
const object = def.values;
|
|
3
|
+
const actualKeys = Object.keys(def.values).filter((key) => {
|
|
4
|
+
return typeof object[object[key]] !== 'number';
|
|
5
|
+
});
|
|
6
|
+
const actualValues = actualKeys.map((key) => object[key]);
|
|
7
|
+
const parsedTypes = Array.from(new Set(actualValues.map((values) => typeof values)));
|
|
8
|
+
return {
|
|
9
|
+
type: parsedTypes.length === 1 ?
|
|
10
|
+
parsedTypes[0] === 'string' ?
|
|
11
|
+
'string'
|
|
12
|
+
: 'number'
|
|
13
|
+
: ['string', 'number'],
|
|
14
|
+
enum: actualValues,
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=nativeEnum.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nativeEnum.mjs","sourceRoot":"","sources":["../../../src/_vendor/zod-to-json-schema/parsers/nativeEnum.ts"],"names":[],"mappings":"AAOA,MAAM,UAAU,kBAAkB,CAAC,GAAqB;IACtD,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC;IAC1B,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,GAAW,EAAE,EAAE;QAChE,OAAO,OAAO,MAAM,CAAC,MAAM,CAAC,GAAG,CAAE,CAAC,KAAK,QAAQ,CAAC;IAClD,CAAC,CAAC,CAAC;IAEH,MAAM,YAAY,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,GAAW,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAE,CAAC,CAAC;IAEnE,MAAM,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,MAAuB,EAAE,EAAE,CAAC,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC;IAEtG,OAAO;QACL,IAAI,EACF,WAAW,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC;YACxB,WAAW,CAAC,CAAC,CAAC,KAAK,QAAQ,CAAC,CAAC;gBAC3B,QAAQ;gBACV,CAAC,CAAC,QAAQ;YACZ,CAAC,CAAC,CAAC,QAAQ,EAAE,QAAQ,CAAC;QACxB,IAAI,EAAE,YAAY;KACnB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"never.d.ts","sourceRoot":"","sources":["../../../src/_vendor/zod-to-json-schema/parsers/never.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,oBAAoB,GAAG;IACjC,GAAG,EAAE,EAAE,CAAC;CACT,CAAC;AAEF,wBAAgB,aAAa,IAAI,oBAAoB,CAIpD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"never.js","sourceRoot":"","sources":["../../../src/_vendor/zod-to-json-schema/parsers/never.ts"],"names":[],"mappings":";;;AAIA,SAAgB,aAAa;IAC3B,OAAO;QACL,GAAG,EAAE,EAAE;KACR,CAAC;AACJ,CAAC;AAJD,sCAIC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"never.mjs","sourceRoot":"","sources":["../../../src/_vendor/zod-to-json-schema/parsers/never.ts"],"names":[],"mappings":"AAIA,MAAM,UAAU,aAAa;IAC3B,OAAO;QACL,GAAG,EAAE,EAAE;KACR,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"null.d.ts","sourceRoot":"","sources":["../../../src/_vendor/zod-to-json-schema/parsers/null.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,wBAAgB,YAAY,CAAC,IAAI,EAAE,IAAI,GAAG,mBAAmB,CAS5D"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseNullDef = void 0;
|
|
4
|
+
function parseNullDef(refs) {
|
|
5
|
+
return refs.target === 'openApi3' ?
|
|
6
|
+
{
|
|
7
|
+
enum: ['null'],
|
|
8
|
+
nullable: true,
|
|
9
|
+
}
|
|
10
|
+
: {
|
|
11
|
+
type: 'null',
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
exports.parseNullDef = parseNullDef;
|
|
15
|
+
//# sourceMappingURL=null.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"null.js","sourceRoot":"","sources":["../../../src/_vendor/zod-to-json-schema/parsers/null.ts"],"names":[],"mappings":";;;AAMA,SAAgB,YAAY,CAAC,IAAU;IACrC,OAAO,IAAI,CAAC,MAAM,KAAK,UAAU,CAAC,CAAC;QAC9B;YACC,IAAI,EAAE,CAAC,MAAM,CAAC;YACd,QAAQ,EAAE,IAAI;SACP;QACX,CAAC,CAAC;YACE,IAAI,EAAE,MAAM;SACb,CAAC;AACR,CAAC;AATD,oCASC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"null.mjs","sourceRoot":"","sources":["../../../src/_vendor/zod-to-json-schema/parsers/null.ts"],"names":[],"mappings":"AAMA,MAAM,UAAU,YAAY,CAAC,IAAU;IACrC,OAAO,IAAI,CAAC,MAAM,KAAK,UAAU,CAAC,CAAC;QAC9B;YACC,IAAI,EAAE,CAAC,MAAM,CAAC;YACd,QAAQ,EAAE,IAAI;SACP;QACX,CAAC,CAAC;YACE,IAAI,EAAE,MAAM;SACb,CAAC;AACR,CAAC"}
|