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,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseRecordDef = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const parseDef_1 = require("../parseDef.js");
|
|
6
|
+
const string_1 = require("./string.js");
|
|
7
|
+
function parseRecordDef(def, refs) {
|
|
8
|
+
if (refs.target === 'openApi3' && def.keyType?._def.typeName === zod_1.ZodFirstPartyTypeKind.ZodEnum) {
|
|
9
|
+
return {
|
|
10
|
+
type: 'object',
|
|
11
|
+
required: def.keyType._def.values,
|
|
12
|
+
properties: def.keyType._def.values.reduce((acc, key) => ({
|
|
13
|
+
...acc,
|
|
14
|
+
[key]: (0, parseDef_1.parseDef)(def.valueType._def, {
|
|
15
|
+
...refs,
|
|
16
|
+
currentPath: [...refs.currentPath, 'properties', key],
|
|
17
|
+
}) ?? {},
|
|
18
|
+
}), {}),
|
|
19
|
+
additionalProperties: false,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
const schema = {
|
|
23
|
+
type: 'object',
|
|
24
|
+
additionalProperties: (0, parseDef_1.parseDef)(def.valueType._def, {
|
|
25
|
+
...refs,
|
|
26
|
+
currentPath: [...refs.currentPath, 'additionalProperties'],
|
|
27
|
+
}) ?? {},
|
|
28
|
+
};
|
|
29
|
+
if (refs.target === 'openApi3') {
|
|
30
|
+
return schema;
|
|
31
|
+
}
|
|
32
|
+
if (def.keyType?._def.typeName === zod_1.ZodFirstPartyTypeKind.ZodString && def.keyType._def.checks?.length) {
|
|
33
|
+
const keyType = Object.entries((0, string_1.parseStringDef)(def.keyType._def, refs)).reduce((acc, [key, value]) => (key === 'type' ? acc : { ...acc, [key]: value }), {});
|
|
34
|
+
return {
|
|
35
|
+
...schema,
|
|
36
|
+
propertyNames: keyType,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
else if (def.keyType?._def.typeName === zod_1.ZodFirstPartyTypeKind.ZodEnum) {
|
|
40
|
+
return {
|
|
41
|
+
...schema,
|
|
42
|
+
propertyNames: {
|
|
43
|
+
enum: def.keyType._def.values,
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
return schema;
|
|
48
|
+
}
|
|
49
|
+
exports.parseRecordDef = parseRecordDef;
|
|
50
|
+
//# sourceMappingURL=record.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"record.js","sourceRoot":"","sources":["../../../src/_vendor/zod-to-json-schema/parsers/record.ts"],"names":[],"mappings":";;;AAAA,6BAAiF;AACjF,6CAAwD;AAIxD,wCAAiE;AAYjE,SAAgB,cAAc,CAC5B,GAAqD,EACrD,IAAU;IAEV,IAAI,IAAI,CAAC,MAAM,KAAK,UAAU,IAAI,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,KAAK,2BAAqB,CAAC,OAAO,EAAE;QAC9F,OAAO;YACL,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM;YACjC,UAAU,EAAE,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CACxC,CAAC,GAAoC,EAAE,GAAW,EAAE,EAAE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AG,CAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,KAAK,2BAAqB,CAAC,OAAO,EAAE;QACvE,OAAO;YACL,GAAG,MAAM;YACT,aAAa,EAAE;gBACb,IAAI,EAAE,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM;aAC9B;SACF,CAAC;KACH;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAvDD,wCAuDC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { ZodFirstPartyTypeKind } from 'zod';
|
|
2
|
+
import { parseDef } from "../parseDef.mjs";
|
|
3
|
+
import { parseStringDef } from "./string.mjs";
|
|
4
|
+
export function parseRecordDef(def, refs) {
|
|
5
|
+
if (refs.target === 'openApi3' && def.keyType?._def.typeName === ZodFirstPartyTypeKind.ZodEnum) {
|
|
6
|
+
return {
|
|
7
|
+
type: 'object',
|
|
8
|
+
required: def.keyType._def.values,
|
|
9
|
+
properties: def.keyType._def.values.reduce((acc, key) => ({
|
|
10
|
+
...acc,
|
|
11
|
+
[key]: parseDef(def.valueType._def, {
|
|
12
|
+
...refs,
|
|
13
|
+
currentPath: [...refs.currentPath, 'properties', key],
|
|
14
|
+
}) ?? {},
|
|
15
|
+
}), {}),
|
|
16
|
+
additionalProperties: false,
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
const schema = {
|
|
20
|
+
type: 'object',
|
|
21
|
+
additionalProperties: parseDef(def.valueType._def, {
|
|
22
|
+
...refs,
|
|
23
|
+
currentPath: [...refs.currentPath, 'additionalProperties'],
|
|
24
|
+
}) ?? {},
|
|
25
|
+
};
|
|
26
|
+
if (refs.target === 'openApi3') {
|
|
27
|
+
return schema;
|
|
28
|
+
}
|
|
29
|
+
if (def.keyType?._def.typeName === ZodFirstPartyTypeKind.ZodString && def.keyType._def.checks?.length) {
|
|
30
|
+
const keyType = Object.entries(parseStringDef(def.keyType._def, refs)).reduce((acc, [key, value]) => (key === 'type' ? acc : { ...acc, [key]: value }), {});
|
|
31
|
+
return {
|
|
32
|
+
...schema,
|
|
33
|
+
propertyNames: keyType,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
else if (def.keyType?._def.typeName === ZodFirstPartyTypeKind.ZodEnum) {
|
|
37
|
+
return {
|
|
38
|
+
...schema,
|
|
39
|
+
propertyNames: {
|
|
40
|
+
enum: def.keyType._def.values,
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
return schema;
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=record.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"record.mjs","sourceRoot":"","sources":["../../../src/_vendor/zod-to-json-schema/parsers/record.ts"],"names":[],"mappings":"OAAO,EAAE,qBAAqB,EAAuC,MAAM,KAAK;OACzE,EAAmB,QAAQ,EAAE;OAI7B,EAAyB,cAAc,EAAE;AAYhD,MAAM,UAAU,cAAc,CAC5B,GAAqD,EACrD,IAAU;IAEV,IAAI,IAAI,CAAC,MAAM,KAAK,UAAU,IAAI,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,KAAK,qBAAqB,CAAC,OAAO,EAAE;QAC9F,OAAO;YACL,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM;YACjC,UAAU,EAAE,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CACxC,CAAC,GAAoC,EAAE,GAAW,EAAE,EAAE,CAAC,CAAC;gBACtD,GAAG,GAAG;gBACN,CAAC,GAAG,CAAC,EACH,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,EAAE;oBAC3B,GAAG,IAAI;oBACP,WAAW,EAAE,CAAC,GAAG,IAAI,CAAC,WAAW,EAAE,YAAY,EAAE,GAAG,CAAC;iBACtD,CAAC,IAAI,EAAE;aACX,CAAC,EACF,EAAE,CACH;YACD,oBAAoB,EAAE,KAAK;SACW,CAAC;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essages } from "../errorMessages.js";
|
|
3
|
+
import { JsonSchema7Type } from "../parseDef.js";
|
|
4
|
+
import { Refs } from "../Refs.js";
|
|
5
|
+
export type JsonSchema7SetType = {
|
|
6
|
+
type: 'array';
|
|
7
|
+
uniqueItems: true;
|
|
8
|
+
items?: JsonSchema7Type | undefined;
|
|
9
|
+
minItems?: number;
|
|
10
|
+
maxItems?: number;
|
|
11
|
+
errorMessage?: ErrorMessages<JsonSchema7SetType>;
|
|
12
|
+
};
|
|
13
|
+
export declare function parseSetDef(def: ZodSetDef, refs: Refs): JsonSchema7SetType;
|
|
14
|
+
//# sourceMappingURL=set.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"set.d.ts","sourceRoot":"","sources":["../../../src/_vendor/zod-to-json-schema/parsers/set.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,aAAa,EAA6B,MAAM,kBAAkB,CAAC;AAC5E,OAAO,EAAE,eAAe,EAAY,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,OAAO,CAAC;IACd,WAAW,EAAE,IAAI,CAAC;IAClB,KAAK,CAAC,EAAE,eAAe,GAAG,SAAS,CAAC;IACpC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,aAAa,CAAC,kBAAkB,CAAC,CAAC;CAClD,CAAC;AAEF,wBAAgB,WAAW,CAAC,GAAG,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,GAAG,kBAAkB,CAqB1E"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseSetDef = void 0;
|
|
4
|
+
const errorMessages_1 = require("../errorMessages.js");
|
|
5
|
+
const parseDef_1 = require("../parseDef.js");
|
|
6
|
+
function parseSetDef(def, refs) {
|
|
7
|
+
const items = (0, parseDef_1.parseDef)(def.valueType._def, {
|
|
8
|
+
...refs,
|
|
9
|
+
currentPath: [...refs.currentPath, 'items'],
|
|
10
|
+
});
|
|
11
|
+
const schema = {
|
|
12
|
+
type: 'array',
|
|
13
|
+
uniqueItems: true,
|
|
14
|
+
items,
|
|
15
|
+
};
|
|
16
|
+
if (def.minSize) {
|
|
17
|
+
(0, errorMessages_1.setResponseValueAndErrors)(schema, 'minItems', def.minSize.value, def.minSize.message, refs);
|
|
18
|
+
}
|
|
19
|
+
if (def.maxSize) {
|
|
20
|
+
(0, errorMessages_1.setResponseValueAndErrors)(schema, 'maxItems', def.maxSize.value, def.maxSize.message, refs);
|
|
21
|
+
}
|
|
22
|
+
return schema;
|
|
23
|
+
}
|
|
24
|
+
exports.parseSetDef = parseSetDef;
|
|
25
|
+
//# sourceMappingURL=set.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"set.js","sourceRoot":"","sources":["../../../src/_vendor/zod-to-json-schema/parsers/set.ts"],"names":[],"mappings":";;;AACA,uDAA4E;AAC5E,6CAAwD;AAYxD,SAAgB,WAAW,CAAC,GAAc,EAAE,IAAU;IACpD,MAAM,KAAK,GAAG,IAAA,mBAAQ,EAAC,GAAG,CAAC,SAAS,CAAC,IAAI,EAAE;QACzC,GAAG,IAAI;QACP,WAAW,EAAE,CAAC,GAAG,IAAI,CAAC,WAAW,EAAE,OAAO,CAAC;KAC5C,CAAC,CAAC;IAEH,MAAM,MAAM,GAAuB;QACjC,IAAI,EAAE,OAAO;QACb,WAAW,EAAE,IAAI;QACjB,KAAK;KACN,CAAC;IAEF,IAAI,GAAG,CAAC,OAAO,EAAE;QACf,IAAA,yCAAyB,EAAC,MAAM,EAAE,UAAU,EAAE,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;KAC7F;IAED,IAAI,GAAG,CAAC,OAAO,EAAE;QACf,IAAA,yCAAyB,EAAC,MAAM,EAAE,UAAU,EAAE,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;KAC7F;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AArBD,kCAqBC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { setResponseValueAndErrors } from "../errorMessages.mjs";
|
|
2
|
+
import { parseDef } from "../parseDef.mjs";
|
|
3
|
+
export function parseSetDef(def, refs) {
|
|
4
|
+
const items = parseDef(def.valueType._def, {
|
|
5
|
+
...refs,
|
|
6
|
+
currentPath: [...refs.currentPath, 'items'],
|
|
7
|
+
});
|
|
8
|
+
const schema = {
|
|
9
|
+
type: 'array',
|
|
10
|
+
uniqueItems: true,
|
|
11
|
+
items,
|
|
12
|
+
};
|
|
13
|
+
if (def.minSize) {
|
|
14
|
+
setResponseValueAndErrors(schema, 'minItems', def.minSize.value, def.minSize.message, refs);
|
|
15
|
+
}
|
|
16
|
+
if (def.maxSize) {
|
|
17
|
+
setResponseValueAndErrors(schema, 'maxItems', def.maxSize.value, def.maxSize.message, refs);
|
|
18
|
+
}
|
|
19
|
+
return schema;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=set.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"set.mjs","sourceRoot":"","sources":["../../../src/_vendor/zod-to-json-schema/parsers/set.ts"],"names":[],"mappings":"OACO,EAAiB,yBAAyB,EAAE;OAC5C,EAAmB,QAAQ,EAAE;AAYpC,MAAM,UAAU,WAAW,CAAC,GAAc,EAAE,IAAU;IACpD,MAAM,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,EAAE;QACzC,GAAG,IAAI;QACP,WAAW,EAAE,CAAC,GAAG,IAAI,CAAC,WAAW,EAAE,OAAO,CAAC;KAC5C,CAAC,CAAC;IAEH,MAAM,MAAM,GAAuB;QACjC,IAAI,EAAE,OAAO;QACb,WAAW,EAAE,IAAI;QACjB,KAAK;KACN,CAAC;IAEF,IAAI,GAAG,CAAC,OAAO,EAAE;QACf,yBAAyB,CAAC,MAAM,EAAE,UAAU,EAAE,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;KAC7F;IAED,IAAI,GAAG,CAAC,OAAO,EAAE;QACf,yBAAyB,CAAC,MAAM,EAAE,UAAU,EAAE,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;KAC7F;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { ZodStringDef } from 'zod';
|
|
2
|
+
import { ErrorMessages } from "../errorMessages.js";
|
|
3
|
+
import { Refs } from "../Refs.js";
|
|
4
|
+
/**
|
|
5
|
+
* Generated from the regular expressions found here as of 2024-05-22:
|
|
6
|
+
* https://github.com/colinhacks/zod/blob/master/src/types.ts.
|
|
7
|
+
*
|
|
8
|
+
* Expressions with /i flag have been changed accordingly.
|
|
9
|
+
*/
|
|
10
|
+
export declare const zodPatterns: {
|
|
11
|
+
/**
|
|
12
|
+
* `c` was changed to `[cC]` to replicate /i flag
|
|
13
|
+
*/
|
|
14
|
+
readonly cuid: RegExp;
|
|
15
|
+
readonly cuid2: RegExp;
|
|
16
|
+
readonly ulid: RegExp;
|
|
17
|
+
/**
|
|
18
|
+
* `a-z` was added to replicate /i flag
|
|
19
|
+
*/
|
|
20
|
+
readonly email: RegExp;
|
|
21
|
+
/**
|
|
22
|
+
* Constructed a valid Unicode RegExp
|
|
23
|
+
*
|
|
24
|
+
* Lazily instantiate since this type of regex isn't supported
|
|
25
|
+
* in all envs (e.g. React Native).
|
|
26
|
+
*
|
|
27
|
+
* See:
|
|
28
|
+
* https://github.com/colinhacks/zod/issues/2433
|
|
29
|
+
* Fix in Zod:
|
|
30
|
+
* https://github.com/colinhacks/zod/commit/9340fd51e48576a75adc919bff65dbc4a5d4c99b
|
|
31
|
+
*/
|
|
32
|
+
readonly emoji: () => RegExp;
|
|
33
|
+
/**
|
|
34
|
+
* Unused
|
|
35
|
+
*/
|
|
36
|
+
readonly uuid: RegExp;
|
|
37
|
+
/**
|
|
38
|
+
* Unused
|
|
39
|
+
*/
|
|
40
|
+
readonly ipv4: RegExp;
|
|
41
|
+
/**
|
|
42
|
+
* Unused
|
|
43
|
+
*/
|
|
44
|
+
readonly ipv6: RegExp;
|
|
45
|
+
readonly base64: RegExp;
|
|
46
|
+
readonly nanoid: RegExp;
|
|
47
|
+
};
|
|
48
|
+
export type JsonSchema7StringType = {
|
|
49
|
+
type: 'string';
|
|
50
|
+
minLength?: number;
|
|
51
|
+
maxLength?: number;
|
|
52
|
+
format?: 'email' | 'idn-email' | 'uri' | 'uuid' | 'date-time' | 'ipv4' | 'ipv6' | 'date' | 'time' | 'duration';
|
|
53
|
+
pattern?: string;
|
|
54
|
+
allOf?: {
|
|
55
|
+
pattern: string;
|
|
56
|
+
errorMessage?: ErrorMessages<{
|
|
57
|
+
pattern: string;
|
|
58
|
+
}>;
|
|
59
|
+
}[];
|
|
60
|
+
anyOf?: {
|
|
61
|
+
format: string;
|
|
62
|
+
errorMessage?: ErrorMessages<{
|
|
63
|
+
format: string;
|
|
64
|
+
}>;
|
|
65
|
+
}[];
|
|
66
|
+
errorMessage?: ErrorMessages<JsonSchema7StringType>;
|
|
67
|
+
contentEncoding?: string;
|
|
68
|
+
};
|
|
69
|
+
export declare function parseStringDef(def: ZodStringDef, refs: Refs): JsonSchema7StringType;
|
|
70
|
+
//# sourceMappingURL=string.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"string.d.ts","sourceRoot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defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseStringDef = exports.zodPatterns = void 0;
|
|
4
|
+
const errorMessages_1 = require("../errorMessages.js");
|
|
5
|
+
let emojiRegex;
|
|
6
|
+
/**
|
|
7
|
+
* Generated from the regular expressions found here as of 2024-05-22:
|
|
8
|
+
* https://github.com/colinhacks/zod/blob/master/src/types.ts.
|
|
9
|
+
*
|
|
10
|
+
* Expressions with /i flag have been changed accordingly.
|
|
11
|
+
*/
|
|
12
|
+
exports.zodPatterns = {
|
|
13
|
+
/**
|
|
14
|
+
* `c` was changed to `[cC]` to replicate /i flag
|
|
15
|
+
*/
|
|
16
|
+
cuid: /^[cC][^\s-]{8,}$/,
|
|
17
|
+
cuid2: /^[0-9a-z]+$/,
|
|
18
|
+
ulid: /^[0-9A-HJKMNP-TV-Z]{26}$/,
|
|
19
|
+
/**
|
|
20
|
+
* `a-z` was added to replicate /i flag
|
|
21
|
+
*/
|
|
22
|
+
email: /^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,
|
|
23
|
+
/**
|
|
24
|
+
* Constructed a valid Unicode RegExp
|
|
25
|
+
*
|
|
26
|
+
* Lazily instantiate since this type of regex isn't supported
|
|
27
|
+
* in all envs (e.g. React Native).
|
|
28
|
+
*
|
|
29
|
+
* See:
|
|
30
|
+
* https://github.com/colinhacks/zod/issues/2433
|
|
31
|
+
* Fix in Zod:
|
|
32
|
+
* https://github.com/colinhacks/zod/commit/9340fd51e48576a75adc919bff65dbc4a5d4c99b
|
|
33
|
+
*/
|
|
34
|
+
emoji: () => {
|
|
35
|
+
if (emojiRegex === undefined) {
|
|
36
|
+
emojiRegex = RegExp('^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$', 'u');
|
|
37
|
+
}
|
|
38
|
+
return emojiRegex;
|
|
39
|
+
},
|
|
40
|
+
/**
|
|
41
|
+
* Unused
|
|
42
|
+
*/
|
|
43
|
+
uuid: /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,
|
|
44
|
+
/**
|
|
45
|
+
* Unused
|
|
46
|
+
*/
|
|
47
|
+
ipv4: /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,
|
|
48
|
+
/**
|
|
49
|
+
* Unused
|
|
50
|
+
*/
|
|
51
|
+
ipv6: /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,
|
|
52
|
+
base64: /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,
|
|
53
|
+
nanoid: /^[a-zA-Z0-9_-]{21}$/,
|
|
54
|
+
};
|
|
55
|
+
function parseStringDef(def, refs) {
|
|
56
|
+
const res = {
|
|
57
|
+
type: 'string',
|
|
58
|
+
};
|
|
59
|
+
function processPattern(value) {
|
|
60
|
+
return refs.patternStrategy === 'escape' ? escapeNonAlphaNumeric(value) : value;
|
|
61
|
+
}
|
|
62
|
+
if (def.checks) {
|
|
63
|
+
for (const check of def.checks) {
|
|
64
|
+
switch (check.kind) {
|
|
65
|
+
case 'min':
|
|
66
|
+
(0, errorMessages_1.setResponseValueAndErrors)(res, 'minLength', typeof res.minLength === 'number' ? Math.max(res.minLength, check.value) : check.value, check.message, refs);
|
|
67
|
+
break;
|
|
68
|
+
case 'max':
|
|
69
|
+
(0, errorMessages_1.setResponseValueAndErrors)(res, 'maxLength', typeof res.maxLength === 'number' ? Math.min(res.maxLength, check.value) : check.value, check.message, refs);
|
|
70
|
+
break;
|
|
71
|
+
case 'email':
|
|
72
|
+
switch (refs.emailStrategy) {
|
|
73
|
+
case 'format:email':
|
|
74
|
+
addFormat(res, 'email', check.message, refs);
|
|
75
|
+
break;
|
|
76
|
+
case 'format:idn-email':
|
|
77
|
+
addFormat(res, 'idn-email', check.message, refs);
|
|
78
|
+
break;
|
|
79
|
+
case 'pattern:zod':
|
|
80
|
+
addPattern(res, exports.zodPatterns.email, check.message, refs);
|
|
81
|
+
break;
|
|
82
|
+
}
|
|
83
|
+
break;
|
|
84
|
+
case 'url':
|
|
85
|
+
addFormat(res, 'uri', check.message, refs);
|
|
86
|
+
break;
|
|
87
|
+
case 'uuid':
|
|
88
|
+
addFormat(res, 'uuid', check.message, refs);
|
|
89
|
+
break;
|
|
90
|
+
case 'regex':
|
|
91
|
+
addPattern(res, check.regex, check.message, refs);
|
|
92
|
+
break;
|
|
93
|
+
case 'cuid':
|
|
94
|
+
addPattern(res, exports.zodPatterns.cuid, check.message, refs);
|
|
95
|
+
break;
|
|
96
|
+
case 'cuid2':
|
|
97
|
+
addPattern(res, exports.zodPatterns.cuid2, check.message, refs);
|
|
98
|
+
break;
|
|
99
|
+
case 'startsWith':
|
|
100
|
+
addPattern(res, RegExp(`^${processPattern(check.value)}`), check.message, refs);
|
|
101
|
+
break;
|
|
102
|
+
case 'endsWith':
|
|
103
|
+
addPattern(res, RegExp(`${processPattern(check.value)}$`), check.message, refs);
|
|
104
|
+
break;
|
|
105
|
+
case 'datetime':
|
|
106
|
+
addFormat(res, 'date-time', check.message, refs);
|
|
107
|
+
break;
|
|
108
|
+
case 'date':
|
|
109
|
+
addFormat(res, 'date', check.message, refs);
|
|
110
|
+
break;
|
|
111
|
+
case 'time':
|
|
112
|
+
addFormat(res, 'time', check.message, refs);
|
|
113
|
+
break;
|
|
114
|
+
case 'duration':
|
|
115
|
+
addFormat(res, 'duration', check.message, refs);
|
|
116
|
+
break;
|
|
117
|
+
case 'length':
|
|
118
|
+
(0, errorMessages_1.setResponseValueAndErrors)(res, 'minLength', typeof res.minLength === 'number' ? Math.max(res.minLength, check.value) : check.value, check.message, refs);
|
|
119
|
+
(0, errorMessages_1.setResponseValueAndErrors)(res, 'maxLength', typeof res.maxLength === 'number' ? Math.min(res.maxLength, check.value) : check.value, check.message, refs);
|
|
120
|
+
break;
|
|
121
|
+
case 'includes': {
|
|
122
|
+
addPattern(res, RegExp(processPattern(check.value)), check.message, refs);
|
|
123
|
+
break;
|
|
124
|
+
}
|
|
125
|
+
case 'ip': {
|
|
126
|
+
if (check.version !== 'v6') {
|
|
127
|
+
addFormat(res, 'ipv4', check.message, refs);
|
|
128
|
+
}
|
|
129
|
+
if (check.version !== 'v4') {
|
|
130
|
+
addFormat(res, 'ipv6', check.message, refs);
|
|
131
|
+
}
|
|
132
|
+
break;
|
|
133
|
+
}
|
|
134
|
+
case 'emoji':
|
|
135
|
+
addPattern(res, exports.zodPatterns.emoji, check.message, refs);
|
|
136
|
+
break;
|
|
137
|
+
case 'ulid': {
|
|
138
|
+
addPattern(res, exports.zodPatterns.ulid, check.message, refs);
|
|
139
|
+
break;
|
|
140
|
+
}
|
|
141
|
+
case 'base64': {
|
|
142
|
+
switch (refs.base64Strategy) {
|
|
143
|
+
case 'format:binary': {
|
|
144
|
+
addFormat(res, 'binary', check.message, refs);
|
|
145
|
+
break;
|
|
146
|
+
}
|
|
147
|
+
case 'contentEncoding:base64': {
|
|
148
|
+
(0, errorMessages_1.setResponseValueAndErrors)(res, 'contentEncoding', 'base64', check.message, refs);
|
|
149
|
+
break;
|
|
150
|
+
}
|
|
151
|
+
case 'pattern:zod': {
|
|
152
|
+
addPattern(res, exports.zodPatterns.base64, check.message, refs);
|
|
153
|
+
break;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
break;
|
|
157
|
+
}
|
|
158
|
+
case 'nanoid': {
|
|
159
|
+
addPattern(res, exports.zodPatterns.nanoid, check.message, refs);
|
|
160
|
+
}
|
|
161
|
+
case 'toLowerCase':
|
|
162
|
+
case 'toUpperCase':
|
|
163
|
+
case 'trim':
|
|
164
|
+
break;
|
|
165
|
+
default:
|
|
166
|
+
((_) => { })(check);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
return res;
|
|
171
|
+
}
|
|
172
|
+
exports.parseStringDef = parseStringDef;
|
|
173
|
+
const escapeNonAlphaNumeric = (value) => Array.from(value)
|
|
174
|
+
.map((c) => (/[a-zA-Z0-9]/.test(c) ? c : `\\${c}`))
|
|
175
|
+
.join('');
|
|
176
|
+
const addFormat = (schema, value, message, refs) => {
|
|
177
|
+
if (schema.format || schema.anyOf?.some((x) => x.format)) {
|
|
178
|
+
if (!schema.anyOf) {
|
|
179
|
+
schema.anyOf = [];
|
|
180
|
+
}
|
|
181
|
+
if (schema.format) {
|
|
182
|
+
schema.anyOf.push({
|
|
183
|
+
format: schema.format,
|
|
184
|
+
...(schema.errorMessage &&
|
|
185
|
+
refs.errorMessages && {
|
|
186
|
+
errorMessage: { format: schema.errorMessage.format },
|
|
187
|
+
}),
|
|
188
|
+
});
|
|
189
|
+
delete schema.format;
|
|
190
|
+
if (schema.errorMessage) {
|
|
191
|
+
delete schema.errorMessage.format;
|
|
192
|
+
if (Object.keys(schema.errorMessage).length === 0) {
|
|
193
|
+
delete schema.errorMessage;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
schema.anyOf.push({
|
|
198
|
+
format: value,
|
|
199
|
+
...(message && refs.errorMessages && { errorMessage: { format: message } }),
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
else {
|
|
203
|
+
(0, errorMessages_1.setResponseValueAndErrors)(schema, 'format', value, message, refs);
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
const addPattern = (schema, regex, message, refs) => {
|
|
207
|
+
if (schema.pattern || schema.allOf?.some((x) => x.pattern)) {
|
|
208
|
+
if (!schema.allOf) {
|
|
209
|
+
schema.allOf = [];
|
|
210
|
+
}
|
|
211
|
+
if (schema.pattern) {
|
|
212
|
+
schema.allOf.push({
|
|
213
|
+
pattern: schema.pattern,
|
|
214
|
+
...(schema.errorMessage &&
|
|
215
|
+
refs.errorMessages && {
|
|
216
|
+
errorMessage: { pattern: schema.errorMessage.pattern },
|
|
217
|
+
}),
|
|
218
|
+
});
|
|
219
|
+
delete schema.pattern;
|
|
220
|
+
if (schema.errorMessage) {
|
|
221
|
+
delete schema.errorMessage.pattern;
|
|
222
|
+
if (Object.keys(schema.errorMessage).length === 0) {
|
|
223
|
+
delete schema.errorMessage;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
schema.allOf.push({
|
|
228
|
+
pattern: processRegExp(regex, refs),
|
|
229
|
+
...(message && refs.errorMessages && { errorMessage: { pattern: message } }),
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
else {
|
|
233
|
+
(0, errorMessages_1.setResponseValueAndErrors)(schema, 'pattern', processRegExp(regex, refs), message, refs);
|
|
234
|
+
}
|
|
235
|
+
};
|
|
236
|
+
// Mutate z.string.regex() in a best attempt to accommodate for regex flags when applyRegexFlags is true
|
|
237
|
+
const processRegExp = (regexOrFunction, refs) => {
|
|
238
|
+
const regex = typeof regexOrFunction === 'function' ? regexOrFunction() : regexOrFunction;
|
|
239
|
+
if (!refs.applyRegexFlags || !regex.flags)
|
|
240
|
+
return regex.source;
|
|
241
|
+
// Currently handled flags
|
|
242
|
+
const flags = {
|
|
243
|
+
i: regex.flags.includes('i'),
|
|
244
|
+
m: regex.flags.includes('m'),
|
|
245
|
+
s: regex.flags.includes('s'), // `.` matches newlines
|
|
246
|
+
};
|
|
247
|
+
// The general principle here is to step through each character, one at a time, applying mutations as flags require. We keep track when the current character is escaped, and when it's inside a group /like [this]/ or (also) a range like /[a-z]/. The following is fairly brittle imperative code; edit at your peril!
|
|
248
|
+
const source = flags.i ? regex.source.toLowerCase() : regex.source;
|
|
249
|
+
let pattern = '';
|
|
250
|
+
let isEscaped = false;
|
|
251
|
+
let inCharGroup = false;
|
|
252
|
+
let inCharRange = false;
|
|
253
|
+
for (let i = 0; i < source.length; i++) {
|
|
254
|
+
if (isEscaped) {
|
|
255
|
+
pattern += source[i];
|
|
256
|
+
isEscaped = false;
|
|
257
|
+
continue;
|
|
258
|
+
}
|
|
259
|
+
if (flags.i) {
|
|
260
|
+
if (inCharGroup) {
|
|
261
|
+
if (source[i].match(/[a-z]/)) {
|
|
262
|
+
if (inCharRange) {
|
|
263
|
+
pattern += source[i];
|
|
264
|
+
pattern += `${source[i - 2]}-${source[i]}`.toUpperCase();
|
|
265
|
+
inCharRange = false;
|
|
266
|
+
}
|
|
267
|
+
else if (source[i + 1] === '-' && source[i + 2]?.match(/[a-z]/)) {
|
|
268
|
+
pattern += source[i];
|
|
269
|
+
inCharRange = true;
|
|
270
|
+
}
|
|
271
|
+
else {
|
|
272
|
+
pattern += `${source[i]}${source[i].toUpperCase()}`;
|
|
273
|
+
}
|
|
274
|
+
continue;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
else if (source[i].match(/[a-z]/)) {
|
|
278
|
+
pattern += `[${source[i]}${source[i].toUpperCase()}]`;
|
|
279
|
+
continue;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
if (flags.m) {
|
|
283
|
+
if (source[i] === '^') {
|
|
284
|
+
pattern += `(^|(?<=[\r\n]))`;
|
|
285
|
+
continue;
|
|
286
|
+
}
|
|
287
|
+
else if (source[i] === '$') {
|
|
288
|
+
pattern += `($|(?=[\r\n]))`;
|
|
289
|
+
continue;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
if (flags.s && source[i] === '.') {
|
|
293
|
+
pattern += inCharGroup ? `${source[i]}\r\n` : `[${source[i]}\r\n]`;
|
|
294
|
+
continue;
|
|
295
|
+
}
|
|
296
|
+
pattern += source[i];
|
|
297
|
+
if (source[i] === '\\') {
|
|
298
|
+
isEscaped = true;
|
|
299
|
+
}
|
|
300
|
+
else if (inCharGroup && source[i] === ']') {
|
|
301
|
+
inCharGroup = false;
|
|
302
|
+
}
|
|
303
|
+
else if (!inCharGroup && source[i] === '[') {
|
|
304
|
+
inCharGroup = true;
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
try {
|
|
308
|
+
const regexTest = new RegExp(pattern);
|
|
309
|
+
}
|
|
310
|
+
catch {
|
|
311
|
+
console.warn(`Could not convert regex pattern at ${refs.currentPath.join('/')} to a flag-independent form! Falling back to the flag-ignorant source`);
|
|
312
|
+
return regex.source;
|
|
313
|
+
}
|
|
314
|
+
return pattern;
|
|
315
|
+
};
|
|
316
|
+
//# sourceMappingURL=string.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"string.js","sourceRoot":"","sources":["../../../src/_vendor/zod-to-json-schema/parsers/string.ts"],"names":[],"mappings":";;;AAEA,uDAA4E;AAG5E,IAAI,UAA8B,CAAC;AAEnC;;;;;GAKG;AACU,QAAA,WAAW,GAAG;IACzB;;OAEG;IACH,IAAI,EAAE,kBAAkB;IACxB,KAAK,EAAE,aAAa;IACpB,IAAI,EAAE,0BAA0B;IAChC;;OAEG;IACH,KAAK,EAAE,kGAAkG;IACzG;;;;;;;;;;OAUG;IACH,KAAK,EAAE,GAAG,EAAE;QACV,IAAI,UAAU,KAAK,SAAS,EAAE;YAC5B,UAAU,GAAG,MAAM,CAAC,sDAAsD,EAAE,GAAG,CAAC,CAAC;SAClF;QACD,OAAO,UAAU,CAAC;IACpB,CAAC;IACD;;OAEG;IACH,IAAI,EAAE,uFAAuF;IAC7F;;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