@shuttl-io/core 0.2.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 +96 -0
- package/README.md +3 -0
- package/dist/Server.d.ts +5 -0
- package/dist/Server.js +3 -0
- package/dist/Triggers.d.ts +0 -0
- package/dist/Triggers.js +2 -0
- package/dist/agent.d.ts +49 -0
- package/dist/agent.js +251 -0
- package/dist/app.d.ts +17 -0
- package/dist/app.js +46 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +29 -0
- package/dist/model.d.ts +6 -0
- package/dist/model.js +16 -0
- package/dist/models/openAi.d.ts +40 -0
- package/dist/models/openAi.js +346 -0
- package/dist/models/types.d.ts +102 -0
- package/dist/models/types.js +27 -0
- package/dist/outcomes/CombinationOutcome.d.ts +9 -0
- package/dist/outcomes/CombinationOutcome.js +41 -0
- package/dist/outcomes/IOutcomes.d.ts +9 -0
- package/dist/outcomes/IOutcomes.js +19 -0
- package/dist/outcomes/StreamingOutcome.d.ts +6 -0
- package/dist/outcomes/StreamingOutcome.js +30 -0
- package/dist/outcomes/index.d.ts +3 -0
- package/dist/outcomes/index.js +20 -0
- package/dist/secrets.d.ts +19 -0
- package/dist/secrets.js +34 -0
- package/dist/server/http.d.ts +68 -0
- package/dist/server/http.js +654 -0
- package/dist/server/index.d.ts +1 -0
- package/dist/server/index.js +18 -0
- package/dist/src/Server.d.ts +5 -0
- package/dist/src/Server.js +3 -0
- package/dist/src/Triggers.d.ts +0 -0
- package/dist/src/Triggers.js +2 -0
- package/dist/src/agent.d.ts +49 -0
- package/dist/src/agent.js +251 -0
- package/dist/src/app.d.ts +17 -0
- package/dist/src/app.js +46 -0
- package/dist/src/index.d.ts +12 -0
- package/dist/src/index.js +29 -0
- package/dist/src/model.d.ts +6 -0
- package/dist/src/model.js +16 -0
- package/dist/src/models/openAi.d.ts +38 -0
- package/dist/src/models/openAi.js +344 -0
- package/dist/src/models/types.d.ts +101 -0
- package/dist/src/models/types.js +27 -0
- package/dist/src/outcomes/CombinationOutcome.d.ts +9 -0
- package/dist/src/outcomes/CombinationOutcome.js +41 -0
- package/dist/src/outcomes/IOutcomes.d.ts +9 -0
- package/dist/src/outcomes/IOutcomes.js +19 -0
- package/dist/src/outcomes/StreamingOutcome.d.ts +6 -0
- package/dist/src/outcomes/StreamingOutcome.js +30 -0
- package/dist/src/outcomes/index.d.ts +3 -0
- package/dist/src/outcomes/index.js +20 -0
- package/dist/src/secrets.d.ts +19 -0
- package/dist/src/secrets.js +34 -0
- package/dist/src/server/http.d.ts +68 -0
- package/dist/src/server/http.js +654 -0
- package/dist/src/server/index.d.ts +1 -0
- package/dist/src/server/index.js +18 -0
- package/dist/src/tools/tool.d.ts +33 -0
- package/dist/src/tools/tool.js +49 -0
- package/dist/src/tools/toolkit.d.ts +13 -0
- package/dist/src/tools/toolkit.js +19 -0
- package/dist/src/trigger/ApiTrigger.d.ts +37 -0
- package/dist/src/trigger/ApiTrigger.js +106 -0
- package/dist/src/trigger/EmailTrigger.d.ts +15 -0
- package/dist/src/trigger/EmailTrigger.js +22 -0
- package/dist/src/trigger/FileTrigger.d.ts +14 -0
- package/dist/src/trigger/FileTrigger.js +37 -0
- package/dist/src/trigger/ITrigger.d.ts +89 -0
- package/dist/src/trigger/ITrigger.js +35 -0
- package/dist/src/trigger/RateTrigger.d.ts +23 -0
- package/dist/src/trigger/RateTrigger.js +58 -0
- package/dist/src/trigger/index.d.ts +5 -0
- package/dist/src/trigger/index.js +22 -0
- package/dist/tests/agent.test.d.ts +1 -0
- package/dist/tests/agent.test.js +388 -0
- package/dist/tests/agentStreamer.test.d.ts +1 -0
- package/dist/tests/agentStreamer.test.js +530 -0
- package/dist/tests/app.test.d.ts +1 -0
- package/dist/tests/app.test.js +423 -0
- package/dist/tests/model.test.d.ts +1 -0
- package/dist/tests/model.test.js +310 -0
- package/dist/tests/openAi.test.d.ts +1 -0
- package/dist/tests/openAi.test.js +701 -0
- package/dist/tests/outcomes.test.d.ts +1 -0
- package/dist/tests/outcomes.test.js +257 -0
- package/dist/tests/secrets.test.d.ts +1 -0
- package/dist/tests/secrets.test.js +263 -0
- package/dist/tests/server/http.test.d.ts +1 -0
- package/dist/tests/server/http.test.js +553 -0
- package/dist/tests/tool.test.d.ts +1 -0
- package/dist/tests/tool.test.js +315 -0
- package/dist/tests/toolkit.test.d.ts +1 -0
- package/dist/tests/toolkit.test.js +189 -0
- package/dist/tests/triggers.test.d.ts +1 -0
- package/dist/tests/triggers.test.js +203 -0
- package/dist/tests/types.test.d.ts +1 -0
- package/dist/tests/types.test.js +429 -0
- package/dist/tools/tool.d.ts +33 -0
- package/dist/tools/tool.js +49 -0
- package/dist/tools/toolkit.d.ts +13 -0
- package/dist/tools/toolkit.js +19 -0
- package/dist/trigger/ApiTrigger.d.ts +37 -0
- package/dist/trigger/ApiTrigger.js +106 -0
- package/dist/trigger/EmailTrigger.d.ts +15 -0
- package/dist/trigger/EmailTrigger.js +22 -0
- package/dist/trigger/FileTrigger.d.ts +14 -0
- package/dist/trigger/FileTrigger.js +37 -0
- package/dist/trigger/ITrigger.d.ts +90 -0
- package/dist/trigger/ITrigger.js +38 -0
- package/dist/trigger/RateTrigger.d.ts +23 -0
- package/dist/trigger/RateTrigger.js +58 -0
- package/dist/trigger/index.d.ts +5 -0
- package/dist/trigger/index.js +22 -0
- package/jest.config.js +20 -0
- package/node_modules/zod/LICENSE +21 -0
- package/node_modules/zod/README.md +208 -0
- package/node_modules/zod/index.cjs +33 -0
- package/node_modules/zod/index.d.cts +4 -0
- package/node_modules/zod/index.d.ts +4 -0
- package/node_modules/zod/index.js +4 -0
- package/node_modules/zod/locales/index.cjs +17 -0
- package/node_modules/zod/locales/index.d.cts +1 -0
- package/node_modules/zod/locales/index.d.ts +1 -0
- package/node_modules/zod/locales/index.js +1 -0
- package/node_modules/zod/locales/package.json +6 -0
- package/node_modules/zod/mini/index.cjs +17 -0
- package/node_modules/zod/mini/index.d.cts +1 -0
- package/node_modules/zod/mini/index.d.ts +1 -0
- package/node_modules/zod/mini/index.js +1 -0
- package/node_modules/zod/mini/package.json +6 -0
- package/node_modules/zod/package.json +135 -0
- package/node_modules/zod/src/index.ts +4 -0
- package/node_modules/zod/src/locales/index.ts +1 -0
- package/node_modules/zod/src/mini/index.ts +1 -0
- package/node_modules/zod/src/v3/ZodError.ts +330 -0
- package/node_modules/zod/src/v3/benchmarks/datetime.ts +58 -0
- package/node_modules/zod/src/v3/benchmarks/discriminatedUnion.ts +80 -0
- package/node_modules/zod/src/v3/benchmarks/index.ts +59 -0
- package/node_modules/zod/src/v3/benchmarks/ipv4.ts +57 -0
- package/node_modules/zod/src/v3/benchmarks/object.ts +69 -0
- package/node_modules/zod/src/v3/benchmarks/primitives.ts +162 -0
- package/node_modules/zod/src/v3/benchmarks/realworld.ts +63 -0
- package/node_modules/zod/src/v3/benchmarks/string.ts +55 -0
- package/node_modules/zod/src/v3/benchmarks/union.ts +80 -0
- package/node_modules/zod/src/v3/errors.ts +13 -0
- package/node_modules/zod/src/v3/external.ts +6 -0
- package/node_modules/zod/src/v3/helpers/enumUtil.ts +17 -0
- package/node_modules/zod/src/v3/helpers/errorUtil.ts +8 -0
- package/node_modules/zod/src/v3/helpers/parseUtil.ts +176 -0
- package/node_modules/zod/src/v3/helpers/partialUtil.ts +34 -0
- package/node_modules/zod/src/v3/helpers/typeAliases.ts +2 -0
- package/node_modules/zod/src/v3/helpers/util.ts +224 -0
- package/node_modules/zod/src/v3/index.ts +4 -0
- package/node_modules/zod/src/v3/locales/en.ts +124 -0
- package/node_modules/zod/src/v3/standard-schema.ts +113 -0
- package/node_modules/zod/src/v3/tests/Mocker.ts +54 -0
- package/node_modules/zod/src/v3/tests/all-errors.test.ts +157 -0
- package/node_modules/zod/src/v3/tests/anyunknown.test.ts +28 -0
- package/node_modules/zod/src/v3/tests/array.test.ts +71 -0
- package/node_modules/zod/src/v3/tests/async-parsing.test.ts +388 -0
- package/node_modules/zod/src/v3/tests/async-refinements.test.ts +46 -0
- package/node_modules/zod/src/v3/tests/base.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/bigint.test.ts +55 -0
- package/node_modules/zod/src/v3/tests/branded.test.ts +53 -0
- package/node_modules/zod/src/v3/tests/catch.test.ts +220 -0
- package/node_modules/zod/src/v3/tests/coerce.test.ts +133 -0
- package/node_modules/zod/src/v3/tests/complex.test.ts +70 -0
- package/node_modules/zod/src/v3/tests/custom.test.ts +31 -0
- package/node_modules/zod/src/v3/tests/date.test.ts +32 -0
- package/node_modules/zod/src/v3/tests/deepmasking.test.ts +186 -0
- package/node_modules/zod/src/v3/tests/default.test.ts +112 -0
- package/node_modules/zod/src/v3/tests/description.test.ts +33 -0
- package/node_modules/zod/src/v3/tests/discriminated-unions.test.ts +315 -0
- package/node_modules/zod/src/v3/tests/enum.test.ts +80 -0
- package/node_modules/zod/src/v3/tests/error.test.ts +551 -0
- package/node_modules/zod/src/v3/tests/firstparty.test.ts +87 -0
- package/node_modules/zod/src/v3/tests/firstpartyschematypes.test.ts +21 -0
- package/node_modules/zod/src/v3/tests/function.test.ts +261 -0
- package/node_modules/zod/src/v3/tests/generics.test.ts +48 -0
- package/node_modules/zod/src/v3/tests/instanceof.test.ts +37 -0
- package/node_modules/zod/src/v3/tests/intersection.test.ts +110 -0
- package/node_modules/zod/src/v3/tests/language-server.source.ts +76 -0
- package/node_modules/zod/src/v3/tests/language-server.test.ts +207 -0
- package/node_modules/zod/src/v3/tests/literal.test.ts +36 -0
- package/node_modules/zod/src/v3/tests/map.test.ts +110 -0
- package/node_modules/zod/src/v3/tests/masking.test.ts +4 -0
- package/node_modules/zod/src/v3/tests/mocker.test.ts +19 -0
- package/node_modules/zod/src/v3/tests/nan.test.ts +24 -0
- package/node_modules/zod/src/v3/tests/nativeEnum.test.ts +87 -0
- package/node_modules/zod/src/v3/tests/nullable.test.ts +42 -0
- package/node_modules/zod/src/v3/tests/number.test.ts +176 -0
- package/node_modules/zod/src/v3/tests/object-augmentation.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/object-in-es5-env.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/object.test.ts +434 -0
- package/node_modules/zod/src/v3/tests/optional.test.ts +42 -0
- package/node_modules/zod/src/v3/tests/parseUtil.test.ts +23 -0
- package/node_modules/zod/src/v3/tests/parser.test.ts +41 -0
- package/node_modules/zod/src/v3/tests/partials.test.ts +243 -0
- package/node_modules/zod/src/v3/tests/pickomit.test.ts +111 -0
- package/node_modules/zod/src/v3/tests/pipeline.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/preprocess.test.ts +186 -0
- package/node_modules/zod/src/v3/tests/primitive.test.ts +440 -0
- package/node_modules/zod/src/v3/tests/promise.test.ts +90 -0
- package/node_modules/zod/src/v3/tests/readonly.test.ts +194 -0
- package/node_modules/zod/src/v3/tests/record.test.ts +171 -0
- package/node_modules/zod/src/v3/tests/recursive.test.ts +197 -0
- package/node_modules/zod/src/v3/tests/refine.test.ts +313 -0
- package/node_modules/zod/src/v3/tests/safeparse.test.ts +27 -0
- package/node_modules/zod/src/v3/tests/set.test.ts +142 -0
- package/node_modules/zod/src/v3/tests/standard-schema.test.ts +83 -0
- package/node_modules/zod/src/v3/tests/string.test.ts +916 -0
- package/node_modules/zod/src/v3/tests/transformer.test.ts +233 -0
- package/node_modules/zod/src/v3/tests/tuple.test.ts +90 -0
- package/node_modules/zod/src/v3/tests/unions.test.ts +57 -0
- package/node_modules/zod/src/v3/tests/validations.test.ts +133 -0
- package/node_modules/zod/src/v3/tests/void.test.ts +15 -0
- package/node_modules/zod/src/v3/types.ts +5138 -0
- package/node_modules/zod/src/v4/classic/checks.ts +32 -0
- package/node_modules/zod/src/v4/classic/coerce.ts +27 -0
- package/node_modules/zod/src/v4/classic/compat.ts +70 -0
- package/node_modules/zod/src/v4/classic/errors.ts +82 -0
- package/node_modules/zod/src/v4/classic/external.ts +51 -0
- package/node_modules/zod/src/v4/classic/from-json-schema.ts +536 -0
- package/node_modules/zod/src/v4/classic/index.ts +5 -0
- package/node_modules/zod/src/v4/classic/iso.ts +90 -0
- package/node_modules/zod/src/v4/classic/parse.ts +82 -0
- package/node_modules/zod/src/v4/classic/schemas.ts +2352 -0
- package/node_modules/zod/src/v4/classic/tests/anyunknown.test.ts +26 -0
- package/node_modules/zod/src/v4/classic/tests/array.test.ts +264 -0
- package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +210 -0
- package/node_modules/zod/src/v4/classic/tests/async-parsing.test.ts +381 -0
- package/node_modules/zod/src/v4/classic/tests/async-refinements.test.ts +68 -0
- package/node_modules/zod/src/v4/classic/tests/base.test.ts +7 -0
- package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +54 -0
- package/node_modules/zod/src/v4/classic/tests/brand.test.ts +63 -0
- package/node_modules/zod/src/v4/classic/tests/catch.test.ts +276 -0
- package/node_modules/zod/src/v4/classic/tests/coalesce.test.ts +20 -0
- package/node_modules/zod/src/v4/classic/tests/codec-examples.test.ts +573 -0
- package/node_modules/zod/src/v4/classic/tests/codec.test.ts +562 -0
- package/node_modules/zod/src/v4/classic/tests/coerce.test.ts +160 -0
- package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +374 -0
- package/node_modules/zod/src/v4/classic/tests/custom.test.ts +40 -0
- package/node_modules/zod/src/v4/classic/tests/date.test.ts +31 -0
- package/node_modules/zod/src/v4/classic/tests/datetime.test.ts +302 -0
- package/node_modules/zod/src/v4/classic/tests/default.test.ts +365 -0
- package/node_modules/zod/src/v4/classic/tests/describe-meta-checks.test.ts +27 -0
- package/node_modules/zod/src/v4/classic/tests/description.test.ts +32 -0
- package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +661 -0
- package/node_modules/zod/src/v4/classic/tests/enum.test.ts +285 -0
- package/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +595 -0
- package/node_modules/zod/src/v4/classic/tests/error.test.ts +711 -0
- package/node_modules/zod/src/v4/classic/tests/file.test.ts +96 -0
- package/node_modules/zod/src/v4/classic/tests/firstparty.test.ts +179 -0
- package/node_modules/zod/src/v4/classic/tests/fix-json-issue.test.ts +26 -0
- package/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +537 -0
- package/node_modules/zod/src/v4/classic/tests/function.test.ts +308 -0
- package/node_modules/zod/src/v4/classic/tests/generics.test.ts +72 -0
- package/node_modules/zod/src/v4/classic/tests/hash.test.ts +68 -0
- package/node_modules/zod/src/v4/classic/tests/index.test.ts +898 -0
- package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +34 -0
- package/node_modules/zod/src/v4/classic/tests/intersection.test.ts +171 -0
- package/node_modules/zod/src/v4/classic/tests/json.test.ts +109 -0
- package/node_modules/zod/src/v4/classic/tests/lazy.test.ts +227 -0
- package/node_modules/zod/src/v4/classic/tests/literal.test.ts +117 -0
- package/node_modules/zod/src/v4/classic/tests/map.test.ts +196 -0
- package/node_modules/zod/src/v4/classic/tests/nan.test.ts +21 -0
- package/node_modules/zod/src/v4/classic/tests/nested-refine.test.ts +168 -0
- package/node_modules/zod/src/v4/classic/tests/nonoptional.test.ts +101 -0
- package/node_modules/zod/src/v4/classic/tests/nullable.test.ts +22 -0
- package/node_modules/zod/src/v4/classic/tests/number.test.ts +270 -0
- package/node_modules/zod/src/v4/classic/tests/object.test.ts +609 -0
- package/node_modules/zod/src/v4/classic/tests/optional.test.ts +136 -0
- package/node_modules/zod/src/v4/classic/tests/partial.test.ts +340 -0
- package/node_modules/zod/src/v4/classic/tests/pickomit.test.ts +127 -0
- package/node_modules/zod/src/v4/classic/tests/pipe.test.ts +101 -0
- package/node_modules/zod/src/v4/classic/tests/prefault.test.ts +74 -0
- package/node_modules/zod/src/v4/classic/tests/preprocess.test.ts +282 -0
- package/node_modules/zod/src/v4/classic/tests/primitive.test.ts +175 -0
- package/node_modules/zod/src/v4/classic/tests/promise.test.ts +81 -0
- package/node_modules/zod/src/v4/classic/tests/prototypes.test.ts +23 -0
- package/node_modules/zod/src/v4/classic/tests/readonly.test.ts +252 -0
- package/node_modules/zod/src/v4/classic/tests/record.test.ts +525 -0
- package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +582 -0
- package/node_modules/zod/src/v4/classic/tests/refine.test.ts +605 -0
- package/node_modules/zod/src/v4/classic/tests/registries.test.ts +208 -0
- package/node_modules/zod/src/v4/classic/tests/set.test.ts +181 -0
- package/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +134 -0
- package/node_modules/zod/src/v4/classic/tests/string-formats.test.ts +125 -0
- package/node_modules/zod/src/v4/classic/tests/string.test.ts +1152 -0
- package/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +106 -0
- package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +771 -0
- package/node_modules/zod/src/v4/classic/tests/to-json-schema-methods.test.ts +438 -0
- package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +2755 -0
- package/node_modules/zod/src/v4/classic/tests/transform.test.ts +361 -0
- package/node_modules/zod/src/v4/classic/tests/tuple.test.ts +181 -0
- package/node_modules/zod/src/v4/classic/tests/union.test.ts +219 -0
- package/node_modules/zod/src/v4/classic/tests/url.test.ts +13 -0
- package/node_modules/zod/src/v4/classic/tests/validations.test.ts +283 -0
- package/node_modules/zod/src/v4/classic/tests/void.test.ts +12 -0
- package/node_modules/zod/src/v4/core/api.ts +1681 -0
- package/node_modules/zod/src/v4/core/checks.ts +1287 -0
- package/node_modules/zod/src/v4/core/config.ts +15 -0
- package/node_modules/zod/src/v4/core/core.ts +128 -0
- package/node_modules/zod/src/v4/core/doc.ts +44 -0
- package/node_modules/zod/src/v4/core/errors.ts +424 -0
- package/node_modules/zod/src/v4/core/index.ts +16 -0
- package/node_modules/zod/src/v4/core/json-schema-generator.ts +124 -0
- package/node_modules/zod/src/v4/core/json-schema-processors.ts +630 -0
- package/node_modules/zod/src/v4/core/json-schema.ts +147 -0
- package/node_modules/zod/src/v4/core/parse.ts +195 -0
- package/node_modules/zod/src/v4/core/regexes.ts +182 -0
- package/node_modules/zod/src/v4/core/registries.ts +108 -0
- package/node_modules/zod/src/v4/core/schemas.ts +4418 -0
- package/node_modules/zod/src/v4/core/standard-schema.ts +159 -0
- package/node_modules/zod/src/v4/core/tests/extend.test.ts +59 -0
- package/node_modules/zod/src/v4/core/tests/index.test.ts +46 -0
- package/node_modules/zod/src/v4/core/tests/locales/be.test.ts +124 -0
- package/node_modules/zod/src/v4/core/tests/locales/en.test.ts +22 -0
- package/node_modules/zod/src/v4/core/tests/locales/es.test.ts +181 -0
- package/node_modules/zod/src/v4/core/tests/locales/he.test.ts +379 -0
- package/node_modules/zod/src/v4/core/tests/locales/nl.test.ts +46 -0
- package/node_modules/zod/src/v4/core/tests/locales/ru.test.ts +128 -0
- package/node_modules/zod/src/v4/core/tests/locales/tr.test.ts +69 -0
- package/node_modules/zod/src/v4/core/tests/record-constructor.test.ts +67 -0
- package/node_modules/zod/src/v4/core/tests/recursive-tuples.test.ts +45 -0
- package/node_modules/zod/src/v4/core/to-json-schema.ts +554 -0
- package/node_modules/zod/src/v4/core/util.ts +921 -0
- package/node_modules/zod/src/v4/core/versions.ts +5 -0
- package/node_modules/zod/src/v4/core/zsf.ts +323 -0
- package/node_modules/zod/src/v4/index.ts +4 -0
- package/node_modules/zod/src/v4/locales/ar.ts +125 -0
- package/node_modules/zod/src/v4/locales/az.ts +121 -0
- package/node_modules/zod/src/v4/locales/be.ts +184 -0
- package/node_modules/zod/src/v4/locales/bg.ts +136 -0
- package/node_modules/zod/src/v4/locales/ca.ts +127 -0
- package/node_modules/zod/src/v4/locales/cs.ts +142 -0
- package/node_modules/zod/src/v4/locales/da.ts +141 -0
- package/node_modules/zod/src/v4/locales/de.ts +124 -0
- package/node_modules/zod/src/v4/locales/en.ts +128 -0
- package/node_modules/zod/src/v4/locales/eo.ts +125 -0
- package/node_modules/zod/src/v4/locales/es.ts +159 -0
- package/node_modules/zod/src/v4/locales/fa.ts +134 -0
- package/node_modules/zod/src/v4/locales/fi.ts +131 -0
- package/node_modules/zod/src/v4/locales/fr-CA.ts +126 -0
- package/node_modules/zod/src/v4/locales/fr.ts +124 -0
- package/node_modules/zod/src/v4/locales/he.ts +256 -0
- package/node_modules/zod/src/v4/locales/hu.ts +126 -0
- package/node_modules/zod/src/v4/locales/id.ts +125 -0
- package/node_modules/zod/src/v4/locales/index.ts +47 -0
- package/node_modules/zod/src/v4/locales/is.ts +127 -0
- package/node_modules/zod/src/v4/locales/it.ts +125 -0
- package/node_modules/zod/src/v4/locales/ja.ts +122 -0
- package/node_modules/zod/src/v4/locales/ka.ts +138 -0
- package/node_modules/zod/src/v4/locales/kh.ts +7 -0
- package/node_modules/zod/src/v4/locales/km.ts +126 -0
- package/node_modules/zod/src/v4/locales/ko.ts +131 -0
- package/node_modules/zod/src/v4/locales/lt.ts +265 -0
- package/node_modules/zod/src/v4/locales/mk.ts +127 -0
- package/node_modules/zod/src/v4/locales/ms.ts +124 -0
- package/node_modules/zod/src/v4/locales/nl.ts +126 -0
- package/node_modules/zod/src/v4/locales/no.ts +124 -0
- package/node_modules/zod/src/v4/locales/ota.ts +125 -0
- package/node_modules/zod/src/v4/locales/pl.ts +126 -0
- package/node_modules/zod/src/v4/locales/ps.ts +133 -0
- package/node_modules/zod/src/v4/locales/pt.ts +123 -0
- package/node_modules/zod/src/v4/locales/ru.ts +184 -0
- package/node_modules/zod/src/v4/locales/sl.ts +126 -0
- package/node_modules/zod/src/v4/locales/sv.ts +127 -0
- package/node_modules/zod/src/v4/locales/ta.ts +125 -0
- package/node_modules/zod/src/v4/locales/th.ts +126 -0
- package/node_modules/zod/src/v4/locales/tr.ts +121 -0
- package/node_modules/zod/src/v4/locales/ua.ts +7 -0
- package/node_modules/zod/src/v4/locales/uk.ts +126 -0
- package/node_modules/zod/src/v4/locales/ur.ts +126 -0
- package/node_modules/zod/src/v4/locales/vi.ts +125 -0
- package/node_modules/zod/src/v4/locales/yo.ts +131 -0
- package/node_modules/zod/src/v4/locales/zh-CN.ts +123 -0
- package/node_modules/zod/src/v4/locales/zh-TW.ts +125 -0
- package/node_modules/zod/src/v4/mini/checks.ts +32 -0
- package/node_modules/zod/src/v4/mini/coerce.ts +22 -0
- package/node_modules/zod/src/v4/mini/external.ts +40 -0
- package/node_modules/zod/src/v4/mini/index.ts +3 -0
- package/node_modules/zod/src/v4/mini/iso.ts +62 -0
- package/node_modules/zod/src/v4/mini/parse.ts +14 -0
- package/node_modules/zod/src/v4/mini/schemas.ts +1781 -0
- package/node_modules/zod/src/v4/mini/tests/assignability.test.ts +129 -0
- package/node_modules/zod/src/v4/mini/tests/brand.test.ts +51 -0
- package/node_modules/zod/src/v4/mini/tests/checks.test.ts +144 -0
- package/node_modules/zod/src/v4/mini/tests/codec.test.ts +529 -0
- package/node_modules/zod/src/v4/mini/tests/computed.test.ts +36 -0
- package/node_modules/zod/src/v4/mini/tests/error.test.ts +22 -0
- package/node_modules/zod/src/v4/mini/tests/functions.test.ts +5 -0
- package/node_modules/zod/src/v4/mini/tests/index.test.ts +922 -0
- package/node_modules/zod/src/v4/mini/tests/number.test.ts +95 -0
- package/node_modules/zod/src/v4/mini/tests/object.test.ts +200 -0
- package/node_modules/zod/src/v4/mini/tests/prototypes.test.ts +43 -0
- package/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +275 -0
- package/node_modules/zod/src/v4/mini/tests/standard-schema.test.ts +17 -0
- package/node_modules/zod/src/v4/mini/tests/string.test.ts +347 -0
- package/node_modules/zod/src/v4-mini/index.ts +1 -0
- package/node_modules/zod/v3/ZodError.cjs +138 -0
- package/node_modules/zod/v3/ZodError.d.cts +164 -0
- package/node_modules/zod/v3/ZodError.d.ts +164 -0
- package/node_modules/zod/v3/ZodError.js +133 -0
- package/node_modules/zod/v3/errors.cjs +17 -0
- package/node_modules/zod/v3/errors.d.cts +5 -0
- package/node_modules/zod/v3/errors.d.ts +5 -0
- package/node_modules/zod/v3/errors.js +9 -0
- package/node_modules/zod/v3/external.cjs +22 -0
- package/node_modules/zod/v3/external.d.cts +6 -0
- package/node_modules/zod/v3/external.d.ts +6 -0
- package/node_modules/zod/v3/external.js +6 -0
- package/node_modules/zod/v3/helpers/enumUtil.cjs +2 -0
- package/node_modules/zod/v3/helpers/enumUtil.d.cts +8 -0
- package/node_modules/zod/v3/helpers/enumUtil.d.ts +8 -0
- package/node_modules/zod/v3/helpers/enumUtil.js +1 -0
- package/node_modules/zod/v3/helpers/errorUtil.cjs +9 -0
- package/node_modules/zod/v3/helpers/errorUtil.d.cts +9 -0
- package/node_modules/zod/v3/helpers/errorUtil.d.ts +9 -0
- package/node_modules/zod/v3/helpers/errorUtil.js +6 -0
- package/node_modules/zod/v3/helpers/parseUtil.cjs +124 -0
- package/node_modules/zod/v3/helpers/parseUtil.d.cts +78 -0
- package/node_modules/zod/v3/helpers/parseUtil.d.ts +78 -0
- package/node_modules/zod/v3/helpers/parseUtil.js +109 -0
- package/node_modules/zod/v3/helpers/partialUtil.cjs +2 -0
- package/node_modules/zod/v3/helpers/partialUtil.d.cts +8 -0
- package/node_modules/zod/v3/helpers/partialUtil.d.ts +8 -0
- package/node_modules/zod/v3/helpers/partialUtil.js +1 -0
- package/node_modules/zod/v3/helpers/typeAliases.cjs +2 -0
- package/node_modules/zod/v3/helpers/typeAliases.d.cts +2 -0
- package/node_modules/zod/v3/helpers/typeAliases.d.ts +2 -0
- package/node_modules/zod/v3/helpers/typeAliases.js +1 -0
- package/node_modules/zod/v3/helpers/util.cjs +137 -0
- package/node_modules/zod/v3/helpers/util.d.cts +85 -0
- package/node_modules/zod/v3/helpers/util.d.ts +85 -0
- package/node_modules/zod/v3/helpers/util.js +133 -0
- package/node_modules/zod/v3/index.cjs +33 -0
- package/node_modules/zod/v3/index.d.cts +4 -0
- package/node_modules/zod/v3/index.d.ts +4 -0
- package/node_modules/zod/v3/index.js +4 -0
- package/node_modules/zod/v3/locales/en.cjs +112 -0
- package/node_modules/zod/v3/locales/en.d.cts +3 -0
- package/node_modules/zod/v3/locales/en.d.ts +3 -0
- package/node_modules/zod/v3/locales/en.js +109 -0
- package/node_modules/zod/v3/package.json +6 -0
- package/node_modules/zod/v3/standard-schema.cjs +2 -0
- package/node_modules/zod/v3/standard-schema.d.cts +102 -0
- package/node_modules/zod/v3/standard-schema.d.ts +102 -0
- package/node_modules/zod/v3/standard-schema.js +1 -0
- package/node_modules/zod/v3/types.cjs +3777 -0
- package/node_modules/zod/v3/types.d.cts +1034 -0
- package/node_modules/zod/v3/types.d.ts +1034 -0
- package/node_modules/zod/v3/types.js +3695 -0
- package/node_modules/zod/v4/classic/checks.cjs +33 -0
- package/node_modules/zod/v4/classic/checks.d.cts +1 -0
- package/node_modules/zod/v4/classic/checks.d.ts +1 -0
- package/node_modules/zod/v4/classic/checks.js +1 -0
- package/node_modules/zod/v4/classic/coerce.cjs +47 -0
- package/node_modules/zod/v4/classic/coerce.d.cts +17 -0
- package/node_modules/zod/v4/classic/coerce.d.ts +17 -0
- package/node_modules/zod/v4/classic/coerce.js +17 -0
- package/node_modules/zod/v4/classic/compat.cjs +61 -0
- package/node_modules/zod/v4/classic/compat.d.cts +50 -0
- package/node_modules/zod/v4/classic/compat.d.ts +50 -0
- package/node_modules/zod/v4/classic/compat.js +31 -0
- package/node_modules/zod/v4/classic/errors.cjs +74 -0
- package/node_modules/zod/v4/classic/errors.d.cts +30 -0
- package/node_modules/zod/v4/classic/errors.d.ts +30 -0
- package/node_modules/zod/v4/classic/errors.js +48 -0
- package/node_modules/zod/v4/classic/external.cjs +73 -0
- package/node_modules/zod/v4/classic/external.d.cts +15 -0
- package/node_modules/zod/v4/classic/external.d.ts +15 -0
- package/node_modules/zod/v4/classic/external.js +20 -0
- package/node_modules/zod/v4/classic/from-json-schema.cjs +511 -0
- package/node_modules/zod/v4/classic/from-json-schema.d.cts +10 -0
- package/node_modules/zod/v4/classic/from-json-schema.d.ts +10 -0
- package/node_modules/zod/v4/classic/from-json-schema.js +485 -0
- package/node_modules/zod/v4/classic/index.cjs +33 -0
- package/node_modules/zod/v4/classic/index.d.cts +4 -0
- package/node_modules/zod/v4/classic/index.d.ts +4 -0
- package/node_modules/zod/v4/classic/index.js +4 -0
- package/node_modules/zod/v4/classic/iso.cjs +60 -0
- package/node_modules/zod/v4/classic/iso.d.cts +22 -0
- package/node_modules/zod/v4/classic/iso.d.ts +22 -0
- package/node_modules/zod/v4/classic/iso.js +30 -0
- package/node_modules/zod/v4/classic/package.json +6 -0
- package/node_modules/zod/v4/classic/parse.cjs +41 -0
- package/node_modules/zod/v4/classic/parse.d.cts +31 -0
- package/node_modules/zod/v4/classic/parse.d.ts +31 -0
- package/node_modules/zod/v4/classic/parse.js +15 -0
- package/node_modules/zod/v4/classic/schemas.cjs +1240 -0
- package/node_modules/zod/v4/classic/schemas.d.cts +726 -0
- package/node_modules/zod/v4/classic/schemas.d.ts +726 -0
- package/node_modules/zod/v4/classic/schemas.js +1126 -0
- package/node_modules/zod/v4/core/api.cjs +1109 -0
- package/node_modules/zod/v4/core/api.d.cts +304 -0
- package/node_modules/zod/v4/core/api.d.ts +304 -0
- package/node_modules/zod/v4/core/api.js +969 -0
- package/node_modules/zod/v4/core/checks.cjs +595 -0
- package/node_modules/zod/v4/core/checks.d.cts +278 -0
- package/node_modules/zod/v4/core/checks.d.ts +278 -0
- package/node_modules/zod/v4/core/checks.js +569 -0
- package/node_modules/zod/v4/core/core.cjs +83 -0
- package/node_modules/zod/v4/core/core.d.cts +52 -0
- package/node_modules/zod/v4/core/core.d.ts +52 -0
- package/node_modules/zod/v4/core/core.js +76 -0
- package/node_modules/zod/v4/core/doc.cjs +39 -0
- package/node_modules/zod/v4/core/doc.d.cts +14 -0
- package/node_modules/zod/v4/core/doc.d.ts +14 -0
- package/node_modules/zod/v4/core/doc.js +35 -0
- package/node_modules/zod/v4/core/errors.cjs +213 -0
- package/node_modules/zod/v4/core/errors.d.cts +219 -0
- package/node_modules/zod/v4/core/errors.d.ts +219 -0
- package/node_modules/zod/v4/core/errors.js +182 -0
- package/node_modules/zod/v4/core/index.cjs +47 -0
- package/node_modules/zod/v4/core/index.d.cts +16 -0
- package/node_modules/zod/v4/core/index.d.ts +16 -0
- package/node_modules/zod/v4/core/index.js +16 -0
- package/node_modules/zod/v4/core/json-schema-generator.cjs +99 -0
- package/node_modules/zod/v4/core/json-schema-generator.d.cts +64 -0
- package/node_modules/zod/v4/core/json-schema-generator.d.ts +64 -0
- package/node_modules/zod/v4/core/json-schema-generator.js +95 -0
- package/node_modules/zod/v4/core/json-schema-processors.cjs +617 -0
- package/node_modules/zod/v4/core/json-schema-processors.d.cts +49 -0
- package/node_modules/zod/v4/core/json-schema-processors.d.ts +49 -0
- package/node_modules/zod/v4/core/json-schema-processors.js +574 -0
- package/node_modules/zod/v4/core/json-schema.cjs +2 -0
- package/node_modules/zod/v4/core/json-schema.d.cts +88 -0
- package/node_modules/zod/v4/core/json-schema.d.ts +88 -0
- package/node_modules/zod/v4/core/json-schema.js +1 -0
- package/node_modules/zod/v4/core/package.json +6 -0
- package/node_modules/zod/v4/core/parse.cjs +131 -0
- package/node_modules/zod/v4/core/parse.d.cts +49 -0
- package/node_modules/zod/v4/core/parse.d.ts +49 -0
- package/node_modules/zod/v4/core/parse.js +93 -0
- package/node_modules/zod/v4/core/regexes.cjs +165 -0
- package/node_modules/zod/v4/core/regexes.d.cts +79 -0
- package/node_modules/zod/v4/core/regexes.d.ts +79 -0
- package/node_modules/zod/v4/core/regexes.js +132 -0
- package/node_modules/zod/v4/core/registries.cjs +59 -0
- package/node_modules/zod/v4/core/registries.d.cts +35 -0
- package/node_modules/zod/v4/core/registries.d.ts +35 -0
- package/node_modules/zod/v4/core/registries.js +54 -0
- package/node_modules/zod/v4/core/schemas.cjs +2040 -0
- package/node_modules/zod/v4/core/schemas.d.cts +1135 -0
- package/node_modules/zod/v4/core/schemas.d.ts +1135 -0
- package/node_modules/zod/v4/core/schemas.js +2009 -0
- package/node_modules/zod/v4/core/standard-schema.cjs +2 -0
- package/node_modules/zod/v4/core/standard-schema.d.cts +126 -0
- package/node_modules/zod/v4/core/standard-schema.d.ts +126 -0
- package/node_modules/zod/v4/core/standard-schema.js +1 -0
- package/node_modules/zod/v4/core/to-json-schema.cjs +392 -0
- package/node_modules/zod/v4/core/to-json-schema.d.cts +113 -0
- package/node_modules/zod/v4/core/to-json-schema.d.ts +113 -0
- package/node_modules/zod/v4/core/to-json-schema.js +383 -0
- package/node_modules/zod/v4/core/util.cjs +669 -0
- package/node_modules/zod/v4/core/util.d.cts +198 -0
- package/node_modules/zod/v4/core/util.d.ts +198 -0
- package/node_modules/zod/v4/core/util.js +611 -0
- package/node_modules/zod/v4/core/versions.cjs +8 -0
- package/node_modules/zod/v4/core/versions.d.cts +5 -0
- package/node_modules/zod/v4/core/versions.d.ts +5 -0
- package/node_modules/zod/v4/core/versions.js +5 -0
- package/node_modules/zod/v4/index.cjs +22 -0
- package/node_modules/zod/v4/index.d.cts +3 -0
- package/node_modules/zod/v4/index.d.ts +3 -0
- package/node_modules/zod/v4/index.js +3 -0
- package/node_modules/zod/v4/locales/ar.cjs +143 -0
- package/node_modules/zod/v4/locales/ar.d.cts +5 -0
- package/node_modules/zod/v4/locales/ar.d.ts +4 -0
- package/node_modules/zod/v4/locales/ar.js +116 -0
- package/node_modules/zod/v4/locales/az.cjs +142 -0
- package/node_modules/zod/v4/locales/az.d.cts +5 -0
- package/node_modules/zod/v4/locales/az.d.ts +4 -0
- package/node_modules/zod/v4/locales/az.js +115 -0
- package/node_modules/zod/v4/locales/be.cjs +191 -0
- package/node_modules/zod/v4/locales/be.d.cts +5 -0
- package/node_modules/zod/v4/locales/be.d.ts +4 -0
- package/node_modules/zod/v4/locales/be.js +164 -0
- package/node_modules/zod/v4/locales/bg.cjs +156 -0
- package/node_modules/zod/v4/locales/bg.d.cts +5 -0
- package/node_modules/zod/v4/locales/bg.d.ts +5 -0
- package/node_modules/zod/v4/locales/bg.js +128 -0
- package/node_modules/zod/v4/locales/ca.cjs +145 -0
- package/node_modules/zod/v4/locales/ca.d.cts +5 -0
- package/node_modules/zod/v4/locales/ca.d.ts +4 -0
- package/node_modules/zod/v4/locales/ca.js +118 -0
- package/node_modules/zod/v4/locales/cs.cjs +162 -0
- package/node_modules/zod/v4/locales/cs.d.cts +5 -0
- package/node_modules/zod/v4/locales/cs.d.ts +4 -0
- package/node_modules/zod/v4/locales/cs.js +135 -0
- package/node_modules/zod/v4/locales/da.cjs +158 -0
- package/node_modules/zod/v4/locales/da.d.cts +5 -0
- package/node_modules/zod/v4/locales/da.d.ts +4 -0
- package/node_modules/zod/v4/locales/da.js +131 -0
- package/node_modules/zod/v4/locales/de.cjs +143 -0
- package/node_modules/zod/v4/locales/de.d.cts +5 -0
- package/node_modules/zod/v4/locales/de.d.ts +4 -0
- package/node_modules/zod/v4/locales/de.js +116 -0
- package/node_modules/zod/v4/locales/en.cjs +146 -0
- package/node_modules/zod/v4/locales/en.d.cts +5 -0
- package/node_modules/zod/v4/locales/en.d.ts +5 -0
- package/node_modules/zod/v4/locales/en.js +118 -0
- package/node_modules/zod/v4/locales/eo.cjs +144 -0
- package/node_modules/zod/v4/locales/eo.d.cts +5 -0
- package/node_modules/zod/v4/locales/eo.d.ts +5 -0
- package/node_modules/zod/v4/locales/eo.js +116 -0
- package/node_modules/zod/v4/locales/es.cjs +176 -0
- package/node_modules/zod/v4/locales/es.d.cts +5 -0
- package/node_modules/zod/v4/locales/es.d.ts +4 -0
- package/node_modules/zod/v4/locales/es.js +149 -0
- package/node_modules/zod/v4/locales/fa.cjs +149 -0
- package/node_modules/zod/v4/locales/fa.d.cts +5 -0
- package/node_modules/zod/v4/locales/fa.d.ts +4 -0
- package/node_modules/zod/v4/locales/fa.js +122 -0
- package/node_modules/zod/v4/locales/fi.cjs +149 -0
- package/node_modules/zod/v4/locales/fi.d.cts +5 -0
- package/node_modules/zod/v4/locales/fi.d.ts +4 -0
- package/node_modules/zod/v4/locales/fi.js +122 -0
- package/node_modules/zod/v4/locales/fr-CA.cjs +144 -0
- package/node_modules/zod/v4/locales/fr-CA.d.cts +5 -0
- package/node_modules/zod/v4/locales/fr-CA.d.ts +4 -0
- package/node_modules/zod/v4/locales/fr-CA.js +117 -0
- package/node_modules/zod/v4/locales/fr.cjs +143 -0
- package/node_modules/zod/v4/locales/fr.d.cts +5 -0
- package/node_modules/zod/v4/locales/fr.d.ts +4 -0
- package/node_modules/zod/v4/locales/fr.js +116 -0
- package/node_modules/zod/v4/locales/he.cjs +255 -0
- package/node_modules/zod/v4/locales/he.d.cts +5 -0
- package/node_modules/zod/v4/locales/he.d.ts +4 -0
- package/node_modules/zod/v4/locales/he.js +228 -0
- package/node_modules/zod/v4/locales/hu.cjs +144 -0
- package/node_modules/zod/v4/locales/hu.d.cts +5 -0
- package/node_modules/zod/v4/locales/hu.d.ts +4 -0
- package/node_modules/zod/v4/locales/hu.js +117 -0
- package/node_modules/zod/v4/locales/id.cjs +143 -0
- package/node_modules/zod/v4/locales/id.d.cts +5 -0
- package/node_modules/zod/v4/locales/id.d.ts +4 -0
- package/node_modules/zod/v4/locales/id.js +116 -0
- package/node_modules/zod/v4/locales/index.cjs +100 -0
- package/node_modules/zod/v4/locales/index.d.cts +47 -0
- package/node_modules/zod/v4/locales/index.d.ts +47 -0
- package/node_modules/zod/v4/locales/index.js +47 -0
- package/node_modules/zod/v4/locales/is.cjs +145 -0
- package/node_modules/zod/v4/locales/is.d.cts +5 -0
- package/node_modules/zod/v4/locales/is.d.ts +5 -0
- package/node_modules/zod/v4/locales/is.js +117 -0
- package/node_modules/zod/v4/locales/it.cjs +144 -0
- package/node_modules/zod/v4/locales/it.d.cts +5 -0
- package/node_modules/zod/v4/locales/it.d.ts +4 -0
- package/node_modules/zod/v4/locales/it.js +117 -0
- package/node_modules/zod/v4/locales/ja.cjs +142 -0
- package/node_modules/zod/v4/locales/ja.d.cts +5 -0
- package/node_modules/zod/v4/locales/ja.d.ts +4 -0
- package/node_modules/zod/v4/locales/ja.js +115 -0
- package/node_modules/zod/v4/locales/ka.cjs +153 -0
- package/node_modules/zod/v4/locales/ka.d.cts +5 -0
- package/node_modules/zod/v4/locales/ka.d.ts +5 -0
- package/node_modules/zod/v4/locales/ka.js +125 -0
- package/node_modules/zod/v4/locales/kh.cjs +12 -0
- package/node_modules/zod/v4/locales/kh.d.cts +5 -0
- package/node_modules/zod/v4/locales/kh.d.ts +5 -0
- package/node_modules/zod/v4/locales/kh.js +5 -0
- package/node_modules/zod/v4/locales/km.cjs +144 -0
- package/node_modules/zod/v4/locales/km.d.cts +5 -0
- package/node_modules/zod/v4/locales/km.d.ts +4 -0
- package/node_modules/zod/v4/locales/km.js +117 -0
- package/node_modules/zod/v4/locales/ko.cjs +148 -0
- package/node_modules/zod/v4/locales/ko.d.cts +5 -0
- package/node_modules/zod/v4/locales/ko.d.ts +4 -0
- package/node_modules/zod/v4/locales/ko.js +121 -0
- package/node_modules/zod/v4/locales/lt.cjs +258 -0
- package/node_modules/zod/v4/locales/lt.d.cts +5 -0
- package/node_modules/zod/v4/locales/lt.d.ts +5 -0
- package/node_modules/zod/v4/locales/lt.js +230 -0
- package/node_modules/zod/v4/locales/mk.cjs +145 -0
- package/node_modules/zod/v4/locales/mk.d.cts +5 -0
- package/node_modules/zod/v4/locales/mk.d.ts +4 -0
- package/node_modules/zod/v4/locales/mk.js +118 -0
- package/node_modules/zod/v4/locales/ms.cjs +143 -0
- package/node_modules/zod/v4/locales/ms.d.cts +5 -0
- package/node_modules/zod/v4/locales/ms.d.ts +4 -0
- package/node_modules/zod/v4/locales/ms.js +116 -0
- package/node_modules/zod/v4/locales/nl.cjs +144 -0
- package/node_modules/zod/v4/locales/nl.d.cts +5 -0
- package/node_modules/zod/v4/locales/nl.d.ts +4 -0
- package/node_modules/zod/v4/locales/nl.js +117 -0
- package/node_modules/zod/v4/locales/no.cjs +143 -0
- package/node_modules/zod/v4/locales/no.d.cts +5 -0
- package/node_modules/zod/v4/locales/no.d.ts +4 -0
- package/node_modules/zod/v4/locales/no.js +116 -0
- package/node_modules/zod/v4/locales/ota.cjs +144 -0
- package/node_modules/zod/v4/locales/ota.d.cts +5 -0
- package/node_modules/zod/v4/locales/ota.d.ts +4 -0
- package/node_modules/zod/v4/locales/ota.js +117 -0
- package/node_modules/zod/v4/locales/package.json +6 -0
- package/node_modules/zod/v4/locales/pl.cjs +144 -0
- package/node_modules/zod/v4/locales/pl.d.cts +5 -0
- package/node_modules/zod/v4/locales/pl.d.ts +4 -0
- package/node_modules/zod/v4/locales/pl.js +117 -0
- package/node_modules/zod/v4/locales/ps.cjs +149 -0
- package/node_modules/zod/v4/locales/ps.d.cts +5 -0
- package/node_modules/zod/v4/locales/ps.d.ts +4 -0
- package/node_modules/zod/v4/locales/ps.js +122 -0
- package/node_modules/zod/v4/locales/pt.cjs +143 -0
- package/node_modules/zod/v4/locales/pt.d.cts +5 -0
- package/node_modules/zod/v4/locales/pt.d.ts +4 -0
- package/node_modules/zod/v4/locales/pt.js +116 -0
- package/node_modules/zod/v4/locales/ru.cjs +191 -0
- package/node_modules/zod/v4/locales/ru.d.cts +5 -0
- package/node_modules/zod/v4/locales/ru.d.ts +4 -0
- package/node_modules/zod/v4/locales/ru.js +164 -0
- package/node_modules/zod/v4/locales/sl.cjs +144 -0
- package/node_modules/zod/v4/locales/sl.d.cts +5 -0
- package/node_modules/zod/v4/locales/sl.d.ts +4 -0
- package/node_modules/zod/v4/locales/sl.js +117 -0
- package/node_modules/zod/v4/locales/sv.cjs +145 -0
- package/node_modules/zod/v4/locales/sv.d.cts +5 -0
- package/node_modules/zod/v4/locales/sv.d.ts +4 -0
- package/node_modules/zod/v4/locales/sv.js +118 -0
- package/node_modules/zod/v4/locales/ta.cjs +144 -0
- package/node_modules/zod/v4/locales/ta.d.cts +5 -0
- package/node_modules/zod/v4/locales/ta.d.ts +4 -0
- package/node_modules/zod/v4/locales/ta.js +117 -0
- package/node_modules/zod/v4/locales/th.cjs +144 -0
- package/node_modules/zod/v4/locales/th.d.cts +5 -0
- package/node_modules/zod/v4/locales/th.d.ts +4 -0
- package/node_modules/zod/v4/locales/th.js +117 -0
- package/node_modules/zod/v4/locales/tr.cjs +143 -0
- package/node_modules/zod/v4/locales/tr.d.cts +5 -0
- package/node_modules/zod/v4/locales/tr.d.ts +5 -0
- package/node_modules/zod/v4/locales/tr.js +115 -0
- package/node_modules/zod/v4/locales/ua.cjs +12 -0
- package/node_modules/zod/v4/locales/ua.d.cts +5 -0
- package/node_modules/zod/v4/locales/ua.d.ts +5 -0
- package/node_modules/zod/v4/locales/ua.js +5 -0
- package/node_modules/zod/v4/locales/uk.cjs +144 -0
- package/node_modules/zod/v4/locales/uk.d.cts +5 -0
- package/node_modules/zod/v4/locales/uk.d.ts +4 -0
- package/node_modules/zod/v4/locales/uk.js +117 -0
- package/node_modules/zod/v4/locales/ur.cjs +144 -0
- package/node_modules/zod/v4/locales/ur.d.cts +5 -0
- package/node_modules/zod/v4/locales/ur.d.ts +4 -0
- package/node_modules/zod/v4/locales/ur.js +117 -0
- package/node_modules/zod/v4/locales/vi.cjs +143 -0
- package/node_modules/zod/v4/locales/vi.d.cts +5 -0
- package/node_modules/zod/v4/locales/vi.d.ts +4 -0
- package/node_modules/zod/v4/locales/vi.js +116 -0
- package/node_modules/zod/v4/locales/yo.cjs +142 -0
- package/node_modules/zod/v4/locales/yo.d.cts +5 -0
- package/node_modules/zod/v4/locales/yo.d.ts +4 -0
- package/node_modules/zod/v4/locales/yo.js +115 -0
- package/node_modules/zod/v4/locales/zh-CN.cjs +143 -0
- package/node_modules/zod/v4/locales/zh-CN.d.cts +5 -0
- package/node_modules/zod/v4/locales/zh-CN.d.ts +4 -0
- package/node_modules/zod/v4/locales/zh-CN.js +116 -0
- package/node_modules/zod/v4/locales/zh-TW.cjs +144 -0
- package/node_modules/zod/v4/locales/zh-TW.d.cts +5 -0
- package/node_modules/zod/v4/locales/zh-TW.d.ts +4 -0
- package/node_modules/zod/v4/locales/zh-TW.js +117 -0
- package/node_modules/zod/v4/mini/checks.cjs +34 -0
- package/node_modules/zod/v4/mini/checks.d.cts +1 -0
- package/node_modules/zod/v4/mini/checks.d.ts +1 -0
- package/node_modules/zod/v4/mini/checks.js +1 -0
- package/node_modules/zod/v4/mini/coerce.cjs +47 -0
- package/node_modules/zod/v4/mini/coerce.d.cts +7 -0
- package/node_modules/zod/v4/mini/coerce.d.ts +7 -0
- package/node_modules/zod/v4/mini/coerce.js +17 -0
- package/node_modules/zod/v4/mini/external.cjs +63 -0
- package/node_modules/zod/v4/mini/external.d.cts +12 -0
- package/node_modules/zod/v4/mini/external.d.ts +12 -0
- package/node_modules/zod/v4/mini/external.js +14 -0
- package/node_modules/zod/v4/mini/index.cjs +32 -0
- package/node_modules/zod/v4/mini/index.d.cts +3 -0
- package/node_modules/zod/v4/mini/index.d.ts +3 -0
- package/node_modules/zod/v4/mini/index.js +3 -0
- package/node_modules/zod/v4/mini/iso.cjs +60 -0
- package/node_modules/zod/v4/mini/iso.d.cts +22 -0
- package/node_modules/zod/v4/mini/iso.d.ts +22 -0
- package/node_modules/zod/v4/mini/iso.js +30 -0
- package/node_modules/zod/v4/mini/package.json +6 -0
- package/node_modules/zod/v4/mini/parse.cjs +16 -0
- package/node_modules/zod/v4/mini/parse.d.cts +1 -0
- package/node_modules/zod/v4/mini/parse.d.ts +1 -0
- package/node_modules/zod/v4/mini/parse.js +1 -0
- package/node_modules/zod/v4/mini/schemas.cjs +929 -0
- package/node_modules/zod/v4/mini/schemas.d.cts +421 -0
- package/node_modules/zod/v4/mini/schemas.d.ts +421 -0
- package/node_modules/zod/v4/mini/schemas.js +809 -0
- package/node_modules/zod/v4/package.json +6 -0
- package/node_modules/zod/v4-mini/index.cjs +17 -0
- package/node_modules/zod/v4-mini/index.d.cts +1 -0
- package/node_modules/zod/v4-mini/index.d.ts +1 -0
- package/node_modules/zod/v4-mini/index.js +1 -0
- package/node_modules/zod/v4-mini/package.json +6 -0
- package/package.json +93 -0
- package/publish.sh +449 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export * as core from "../core/index.js";
|
|
2
|
+
export * from "./schemas.js";
|
|
3
|
+
export * from "./checks.js";
|
|
4
|
+
export * from "./errors.js";
|
|
5
|
+
export * from "./parse.js";
|
|
6
|
+
export * from "./compat.js";
|
|
7
|
+
// zod-specified
|
|
8
|
+
import { config } from "../core/index.js";
|
|
9
|
+
import en from "../locales/en.js";
|
|
10
|
+
config(en());
|
|
11
|
+
export { globalRegistry, registry, config, $output, $input, $brand, clone, regexes, treeifyError, prettifyError, formatError, flattenError, TimePrecision, util, NEVER, } from "../core/index.js";
|
|
12
|
+
export { toJSONSchema } from "../core/json-schema-processors.js";
|
|
13
|
+
export { fromJSONSchema } from "./from-json-schema.js";
|
|
14
|
+
export * as locales from "../locales/index.js";
|
|
15
|
+
// iso
|
|
16
|
+
// must be exported from top-level
|
|
17
|
+
// https://github.com/colinhacks/zod/issues/4491
|
|
18
|
+
export { ZodISODateTime, ZodISODate, ZodISOTime, ZodISODuration } from "./iso.js";
|
|
19
|
+
export * as iso from "./iso.js";
|
|
20
|
+
export * as coerce from "./coerce.js";
|
|
@@ -0,0 +1,511 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.fromJSONSchema = fromJSONSchema;
|
|
27
|
+
const _checks = __importStar(require("./checks.cjs"));
|
|
28
|
+
const _iso = __importStar(require("./iso.cjs"));
|
|
29
|
+
const _schemas = __importStar(require("./schemas.cjs"));
|
|
30
|
+
// Local z object to avoid circular dependency with ../index.js
|
|
31
|
+
const z = {
|
|
32
|
+
..._schemas,
|
|
33
|
+
..._checks,
|
|
34
|
+
iso: _iso,
|
|
35
|
+
};
|
|
36
|
+
function detectVersion(schema, defaultTarget) {
|
|
37
|
+
const $schema = schema.$schema;
|
|
38
|
+
if ($schema === "https://json-schema.org/draft/2020-12/schema") {
|
|
39
|
+
return "draft-2020-12";
|
|
40
|
+
}
|
|
41
|
+
if ($schema === "http://json-schema.org/draft-07/schema#") {
|
|
42
|
+
return "draft-7";
|
|
43
|
+
}
|
|
44
|
+
if ($schema === "http://json-schema.org/draft-04/schema#") {
|
|
45
|
+
return "draft-4";
|
|
46
|
+
}
|
|
47
|
+
// Use defaultTarget if provided, otherwise default to draft-2020-12
|
|
48
|
+
return defaultTarget ?? "draft-2020-12";
|
|
49
|
+
}
|
|
50
|
+
function resolveRef(ref, ctx) {
|
|
51
|
+
if (!ref.startsWith("#")) {
|
|
52
|
+
throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
|
|
53
|
+
}
|
|
54
|
+
const path = ref.slice(1).split("/").filter(Boolean);
|
|
55
|
+
// Handle root reference "#"
|
|
56
|
+
if (path.length === 0) {
|
|
57
|
+
return ctx.rootSchema;
|
|
58
|
+
}
|
|
59
|
+
const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
|
|
60
|
+
if (path[0] === defsKey) {
|
|
61
|
+
const key = path[1];
|
|
62
|
+
if (!key || !ctx.defs[key]) {
|
|
63
|
+
throw new Error(`Reference not found: ${ref}`);
|
|
64
|
+
}
|
|
65
|
+
return ctx.defs[key];
|
|
66
|
+
}
|
|
67
|
+
throw new Error(`Reference not found: ${ref}`);
|
|
68
|
+
}
|
|
69
|
+
function convertBaseSchema(schema, ctx) {
|
|
70
|
+
// Handle unsupported features
|
|
71
|
+
if (schema.not !== undefined) {
|
|
72
|
+
// Special case: { not: {} } represents never
|
|
73
|
+
if (typeof schema.not === "object" && Object.keys(schema.not).length === 0) {
|
|
74
|
+
return z.never();
|
|
75
|
+
}
|
|
76
|
+
throw new Error("not is not supported in Zod (except { not: {} } for never)");
|
|
77
|
+
}
|
|
78
|
+
if (schema.unevaluatedItems !== undefined) {
|
|
79
|
+
throw new Error("unevaluatedItems is not supported");
|
|
80
|
+
}
|
|
81
|
+
if (schema.unevaluatedProperties !== undefined) {
|
|
82
|
+
throw new Error("unevaluatedProperties is not supported");
|
|
83
|
+
}
|
|
84
|
+
if (schema.if !== undefined || schema.then !== undefined || schema.else !== undefined) {
|
|
85
|
+
throw new Error("Conditional schemas (if/then/else) are not supported");
|
|
86
|
+
}
|
|
87
|
+
if (schema.dependentSchemas !== undefined || schema.dependentRequired !== undefined) {
|
|
88
|
+
throw new Error("dependentSchemas and dependentRequired are not supported");
|
|
89
|
+
}
|
|
90
|
+
// Handle $ref
|
|
91
|
+
if (schema.$ref) {
|
|
92
|
+
const refPath = schema.$ref;
|
|
93
|
+
if (ctx.refs.has(refPath)) {
|
|
94
|
+
return ctx.refs.get(refPath);
|
|
95
|
+
}
|
|
96
|
+
if (ctx.processing.has(refPath)) {
|
|
97
|
+
// Circular reference - use lazy
|
|
98
|
+
return z.lazy(() => {
|
|
99
|
+
if (!ctx.refs.has(refPath)) {
|
|
100
|
+
throw new Error(`Circular reference not resolved: ${refPath}`);
|
|
101
|
+
}
|
|
102
|
+
return ctx.refs.get(refPath);
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
ctx.processing.add(refPath);
|
|
106
|
+
const resolved = resolveRef(refPath, ctx);
|
|
107
|
+
const zodSchema = convertSchema(resolved, ctx);
|
|
108
|
+
ctx.refs.set(refPath, zodSchema);
|
|
109
|
+
ctx.processing.delete(refPath);
|
|
110
|
+
return zodSchema;
|
|
111
|
+
}
|
|
112
|
+
// Handle enum
|
|
113
|
+
if (schema.enum !== undefined) {
|
|
114
|
+
const enumValues = schema.enum;
|
|
115
|
+
// Special case: OpenAPI 3.0 null representation { type: "string", nullable: true, enum: [null] }
|
|
116
|
+
if (ctx.version === "openapi-3.0" &&
|
|
117
|
+
schema.nullable === true &&
|
|
118
|
+
enumValues.length === 1 &&
|
|
119
|
+
enumValues[0] === null) {
|
|
120
|
+
return z.null();
|
|
121
|
+
}
|
|
122
|
+
if (enumValues.length === 0) {
|
|
123
|
+
return z.never();
|
|
124
|
+
}
|
|
125
|
+
if (enumValues.length === 1) {
|
|
126
|
+
return z.literal(enumValues[0]);
|
|
127
|
+
}
|
|
128
|
+
// Check if all values are strings
|
|
129
|
+
if (enumValues.every((v) => typeof v === "string")) {
|
|
130
|
+
return z.enum(enumValues);
|
|
131
|
+
}
|
|
132
|
+
// Mixed types - use union of literals
|
|
133
|
+
const literalSchemas = enumValues.map((v) => z.literal(v));
|
|
134
|
+
if (literalSchemas.length < 2) {
|
|
135
|
+
return literalSchemas[0];
|
|
136
|
+
}
|
|
137
|
+
return z.union([literalSchemas[0], literalSchemas[1], ...literalSchemas.slice(2)]);
|
|
138
|
+
}
|
|
139
|
+
// Handle const
|
|
140
|
+
if (schema.const !== undefined) {
|
|
141
|
+
return z.literal(schema.const);
|
|
142
|
+
}
|
|
143
|
+
// Handle type
|
|
144
|
+
const type = schema.type;
|
|
145
|
+
if (Array.isArray(type)) {
|
|
146
|
+
// Expand type array into anyOf union
|
|
147
|
+
const typeSchemas = type.map((t) => {
|
|
148
|
+
const typeSchema = { ...schema, type: t };
|
|
149
|
+
return convertBaseSchema(typeSchema, ctx);
|
|
150
|
+
});
|
|
151
|
+
if (typeSchemas.length === 0) {
|
|
152
|
+
return z.never();
|
|
153
|
+
}
|
|
154
|
+
if (typeSchemas.length === 1) {
|
|
155
|
+
return typeSchemas[0];
|
|
156
|
+
}
|
|
157
|
+
return z.union(typeSchemas);
|
|
158
|
+
}
|
|
159
|
+
if (!type) {
|
|
160
|
+
// No type specified - empty schema (any)
|
|
161
|
+
return z.any();
|
|
162
|
+
}
|
|
163
|
+
let zodSchema;
|
|
164
|
+
switch (type) {
|
|
165
|
+
case "string": {
|
|
166
|
+
let stringSchema = z.string();
|
|
167
|
+
// Apply format using .check() with Zod format functions
|
|
168
|
+
if (schema.format) {
|
|
169
|
+
const format = schema.format;
|
|
170
|
+
// Map common formats to Zod check functions
|
|
171
|
+
if (format === "email") {
|
|
172
|
+
stringSchema = stringSchema.check(z.email());
|
|
173
|
+
}
|
|
174
|
+
else if (format === "uri" || format === "uri-reference") {
|
|
175
|
+
stringSchema = stringSchema.check(z.url());
|
|
176
|
+
}
|
|
177
|
+
else if (format === "uuid" || format === "guid") {
|
|
178
|
+
stringSchema = stringSchema.check(z.uuid());
|
|
179
|
+
}
|
|
180
|
+
else if (format === "date-time") {
|
|
181
|
+
stringSchema = stringSchema.check(z.iso.datetime());
|
|
182
|
+
}
|
|
183
|
+
else if (format === "date") {
|
|
184
|
+
stringSchema = stringSchema.check(z.iso.date());
|
|
185
|
+
}
|
|
186
|
+
else if (format === "time") {
|
|
187
|
+
stringSchema = stringSchema.check(z.iso.time());
|
|
188
|
+
}
|
|
189
|
+
else if (format === "duration") {
|
|
190
|
+
stringSchema = stringSchema.check(z.iso.duration());
|
|
191
|
+
}
|
|
192
|
+
else if (format === "ipv4") {
|
|
193
|
+
stringSchema = stringSchema.check(z.ipv4());
|
|
194
|
+
}
|
|
195
|
+
else if (format === "ipv6") {
|
|
196
|
+
stringSchema = stringSchema.check(z.ipv6());
|
|
197
|
+
}
|
|
198
|
+
else if (format === "mac") {
|
|
199
|
+
stringSchema = stringSchema.check(z.mac());
|
|
200
|
+
}
|
|
201
|
+
else if (format === "cidr") {
|
|
202
|
+
stringSchema = stringSchema.check(z.cidrv4());
|
|
203
|
+
}
|
|
204
|
+
else if (format === "cidr-v6") {
|
|
205
|
+
stringSchema = stringSchema.check(z.cidrv6());
|
|
206
|
+
}
|
|
207
|
+
else if (format === "base64") {
|
|
208
|
+
stringSchema = stringSchema.check(z.base64());
|
|
209
|
+
}
|
|
210
|
+
else if (format === "base64url") {
|
|
211
|
+
stringSchema = stringSchema.check(z.base64url());
|
|
212
|
+
}
|
|
213
|
+
else if (format === "e164") {
|
|
214
|
+
stringSchema = stringSchema.check(z.e164());
|
|
215
|
+
}
|
|
216
|
+
else if (format === "jwt") {
|
|
217
|
+
stringSchema = stringSchema.check(z.jwt());
|
|
218
|
+
}
|
|
219
|
+
else if (format === "emoji") {
|
|
220
|
+
stringSchema = stringSchema.check(z.emoji());
|
|
221
|
+
}
|
|
222
|
+
else if (format === "nanoid") {
|
|
223
|
+
stringSchema = stringSchema.check(z.nanoid());
|
|
224
|
+
}
|
|
225
|
+
else if (format === "cuid") {
|
|
226
|
+
stringSchema = stringSchema.check(z.cuid());
|
|
227
|
+
}
|
|
228
|
+
else if (format === "cuid2") {
|
|
229
|
+
stringSchema = stringSchema.check(z.cuid2());
|
|
230
|
+
}
|
|
231
|
+
else if (format === "ulid") {
|
|
232
|
+
stringSchema = stringSchema.check(z.ulid());
|
|
233
|
+
}
|
|
234
|
+
else if (format === "xid") {
|
|
235
|
+
stringSchema = stringSchema.check(z.xid());
|
|
236
|
+
}
|
|
237
|
+
else if (format === "ksuid") {
|
|
238
|
+
stringSchema = stringSchema.check(z.ksuid());
|
|
239
|
+
}
|
|
240
|
+
// Note: json-string format is not currently supported by Zod
|
|
241
|
+
// Custom formats are ignored - keep as plain string
|
|
242
|
+
}
|
|
243
|
+
// Apply constraints
|
|
244
|
+
if (typeof schema.minLength === "number") {
|
|
245
|
+
stringSchema = stringSchema.min(schema.minLength);
|
|
246
|
+
}
|
|
247
|
+
if (typeof schema.maxLength === "number") {
|
|
248
|
+
stringSchema = stringSchema.max(schema.maxLength);
|
|
249
|
+
}
|
|
250
|
+
if (schema.pattern) {
|
|
251
|
+
// JSON Schema patterns are not implicitly anchored (match anywhere in string)
|
|
252
|
+
stringSchema = stringSchema.regex(new RegExp(schema.pattern));
|
|
253
|
+
}
|
|
254
|
+
zodSchema = stringSchema;
|
|
255
|
+
break;
|
|
256
|
+
}
|
|
257
|
+
case "number":
|
|
258
|
+
case "integer": {
|
|
259
|
+
let numberSchema = type === "integer" ? z.number().int() : z.number();
|
|
260
|
+
// Apply constraints
|
|
261
|
+
if (typeof schema.minimum === "number") {
|
|
262
|
+
numberSchema = numberSchema.min(schema.minimum);
|
|
263
|
+
}
|
|
264
|
+
if (typeof schema.maximum === "number") {
|
|
265
|
+
numberSchema = numberSchema.max(schema.maximum);
|
|
266
|
+
}
|
|
267
|
+
if (typeof schema.exclusiveMinimum === "number") {
|
|
268
|
+
numberSchema = numberSchema.gt(schema.exclusiveMinimum);
|
|
269
|
+
}
|
|
270
|
+
else if (schema.exclusiveMinimum === true && typeof schema.minimum === "number") {
|
|
271
|
+
numberSchema = numberSchema.gt(schema.minimum);
|
|
272
|
+
}
|
|
273
|
+
if (typeof schema.exclusiveMaximum === "number") {
|
|
274
|
+
numberSchema = numberSchema.lt(schema.exclusiveMaximum);
|
|
275
|
+
}
|
|
276
|
+
else if (schema.exclusiveMaximum === true && typeof schema.maximum === "number") {
|
|
277
|
+
numberSchema = numberSchema.lt(schema.maximum);
|
|
278
|
+
}
|
|
279
|
+
if (typeof schema.multipleOf === "number") {
|
|
280
|
+
numberSchema = numberSchema.multipleOf(schema.multipleOf);
|
|
281
|
+
}
|
|
282
|
+
zodSchema = numberSchema;
|
|
283
|
+
break;
|
|
284
|
+
}
|
|
285
|
+
case "boolean": {
|
|
286
|
+
zodSchema = z.boolean();
|
|
287
|
+
break;
|
|
288
|
+
}
|
|
289
|
+
case "null": {
|
|
290
|
+
zodSchema = z.null();
|
|
291
|
+
break;
|
|
292
|
+
}
|
|
293
|
+
case "object": {
|
|
294
|
+
const shape = {};
|
|
295
|
+
const properties = schema.properties || {};
|
|
296
|
+
const requiredSet = new Set(schema.required || []);
|
|
297
|
+
// Convert properties - mark optional ones
|
|
298
|
+
for (const [key, propSchema] of Object.entries(properties)) {
|
|
299
|
+
const propZodSchema = convertSchema(propSchema, ctx);
|
|
300
|
+
// If not in required array, make it optional
|
|
301
|
+
shape[key] = requiredSet.has(key) ? propZodSchema : propZodSchema.optional();
|
|
302
|
+
}
|
|
303
|
+
// Handle propertyNames
|
|
304
|
+
if (schema.propertyNames) {
|
|
305
|
+
const keySchema = convertSchema(schema.propertyNames, ctx);
|
|
306
|
+
const valueSchema = schema.additionalProperties && typeof schema.additionalProperties === "object"
|
|
307
|
+
? convertSchema(schema.additionalProperties, ctx)
|
|
308
|
+
: z.any();
|
|
309
|
+
// Case A: No properties (pure record)
|
|
310
|
+
if (Object.keys(shape).length === 0) {
|
|
311
|
+
zodSchema = z.record(keySchema, valueSchema);
|
|
312
|
+
break;
|
|
313
|
+
}
|
|
314
|
+
// Case B: With properties (intersection of object and looseRecord)
|
|
315
|
+
const objectSchema = z.object(shape).passthrough();
|
|
316
|
+
const recordSchema = z.looseRecord(keySchema, valueSchema);
|
|
317
|
+
zodSchema = z.intersection(objectSchema, recordSchema);
|
|
318
|
+
break;
|
|
319
|
+
}
|
|
320
|
+
// Handle patternProperties
|
|
321
|
+
if (schema.patternProperties) {
|
|
322
|
+
// patternProperties: keys matching pattern must satisfy corresponding schema
|
|
323
|
+
// Use loose records so non-matching keys pass through
|
|
324
|
+
const patternProps = schema.patternProperties;
|
|
325
|
+
const patternKeys = Object.keys(patternProps);
|
|
326
|
+
const looseRecords = [];
|
|
327
|
+
for (const pattern of patternKeys) {
|
|
328
|
+
const patternValue = convertSchema(patternProps[pattern], ctx);
|
|
329
|
+
const keySchema = z.string().regex(new RegExp(pattern));
|
|
330
|
+
looseRecords.push(z.looseRecord(keySchema, patternValue));
|
|
331
|
+
}
|
|
332
|
+
// Build intersection: object schema + all pattern property records
|
|
333
|
+
const schemasToIntersect = [];
|
|
334
|
+
if (Object.keys(shape).length > 0) {
|
|
335
|
+
// Use passthrough so patternProperties can validate additional keys
|
|
336
|
+
schemasToIntersect.push(z.object(shape).passthrough());
|
|
337
|
+
}
|
|
338
|
+
schemasToIntersect.push(...looseRecords);
|
|
339
|
+
if (schemasToIntersect.length === 0) {
|
|
340
|
+
zodSchema = z.object({}).passthrough();
|
|
341
|
+
}
|
|
342
|
+
else if (schemasToIntersect.length === 1) {
|
|
343
|
+
zodSchema = schemasToIntersect[0];
|
|
344
|
+
}
|
|
345
|
+
else {
|
|
346
|
+
// Chain intersections: (A & B) & C & D ...
|
|
347
|
+
let result = z.intersection(schemasToIntersect[0], schemasToIntersect[1]);
|
|
348
|
+
for (let i = 2; i < schemasToIntersect.length; i++) {
|
|
349
|
+
result = z.intersection(result, schemasToIntersect[i]);
|
|
350
|
+
}
|
|
351
|
+
zodSchema = result;
|
|
352
|
+
}
|
|
353
|
+
break;
|
|
354
|
+
}
|
|
355
|
+
// Handle additionalProperties
|
|
356
|
+
// In JSON Schema, additionalProperties defaults to true (allow any extra properties)
|
|
357
|
+
// In Zod, objects strip unknown keys by default, so we need to handle this explicitly
|
|
358
|
+
const objectSchema = z.object(shape);
|
|
359
|
+
if (schema.additionalProperties === false) {
|
|
360
|
+
// Strict mode - no extra properties allowed
|
|
361
|
+
zodSchema = objectSchema.strict();
|
|
362
|
+
}
|
|
363
|
+
else if (typeof schema.additionalProperties === "object") {
|
|
364
|
+
// Extra properties must match the specified schema
|
|
365
|
+
zodSchema = objectSchema.catchall(convertSchema(schema.additionalProperties, ctx));
|
|
366
|
+
}
|
|
367
|
+
else {
|
|
368
|
+
// additionalProperties is true or undefined - allow any extra properties (passthrough)
|
|
369
|
+
zodSchema = objectSchema.passthrough();
|
|
370
|
+
}
|
|
371
|
+
break;
|
|
372
|
+
}
|
|
373
|
+
case "array": {
|
|
374
|
+
// TODO: uniqueItems is not supported
|
|
375
|
+
// TODO: contains/minContains/maxContains are not supported
|
|
376
|
+
// Check if this is a tuple (prefixItems or items as array)
|
|
377
|
+
const prefixItems = schema.prefixItems;
|
|
378
|
+
const items = schema.items;
|
|
379
|
+
if (prefixItems && Array.isArray(prefixItems)) {
|
|
380
|
+
// Tuple with prefixItems (draft-2020-12)
|
|
381
|
+
const tupleItems = prefixItems.map((item) => convertSchema(item, ctx));
|
|
382
|
+
const rest = items && typeof items === "object" && !Array.isArray(items)
|
|
383
|
+
? convertSchema(items, ctx)
|
|
384
|
+
: undefined;
|
|
385
|
+
if (rest) {
|
|
386
|
+
zodSchema = z.tuple(tupleItems).rest(rest);
|
|
387
|
+
}
|
|
388
|
+
else {
|
|
389
|
+
zodSchema = z.tuple(tupleItems);
|
|
390
|
+
}
|
|
391
|
+
// Apply minItems/maxItems constraints to tuples
|
|
392
|
+
if (typeof schema.minItems === "number") {
|
|
393
|
+
zodSchema = zodSchema.check(z.minLength(schema.minItems));
|
|
394
|
+
}
|
|
395
|
+
if (typeof schema.maxItems === "number") {
|
|
396
|
+
zodSchema = zodSchema.check(z.maxLength(schema.maxItems));
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
else if (Array.isArray(items)) {
|
|
400
|
+
// Tuple with items array (draft-7)
|
|
401
|
+
const tupleItems = items.map((item) => convertSchema(item, ctx));
|
|
402
|
+
const rest = schema.additionalItems && typeof schema.additionalItems === "object"
|
|
403
|
+
? convertSchema(schema.additionalItems, ctx)
|
|
404
|
+
: undefined; // additionalItems: false means no rest, handled by default tuple behavior
|
|
405
|
+
if (rest) {
|
|
406
|
+
zodSchema = z.tuple(tupleItems).rest(rest);
|
|
407
|
+
}
|
|
408
|
+
else {
|
|
409
|
+
zodSchema = z.tuple(tupleItems);
|
|
410
|
+
}
|
|
411
|
+
// Apply minItems/maxItems constraints to tuples
|
|
412
|
+
if (typeof schema.minItems === "number") {
|
|
413
|
+
zodSchema = zodSchema.check(z.minLength(schema.minItems));
|
|
414
|
+
}
|
|
415
|
+
if (typeof schema.maxItems === "number") {
|
|
416
|
+
zodSchema = zodSchema.check(z.maxLength(schema.maxItems));
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
else if (items !== undefined) {
|
|
420
|
+
// Regular array
|
|
421
|
+
const element = convertSchema(items, ctx);
|
|
422
|
+
let arraySchema = z.array(element);
|
|
423
|
+
// Apply constraints
|
|
424
|
+
if (typeof schema.minItems === "number") {
|
|
425
|
+
arraySchema = arraySchema.min(schema.minItems);
|
|
426
|
+
}
|
|
427
|
+
if (typeof schema.maxItems === "number") {
|
|
428
|
+
arraySchema = arraySchema.max(schema.maxItems);
|
|
429
|
+
}
|
|
430
|
+
zodSchema = arraySchema;
|
|
431
|
+
}
|
|
432
|
+
else {
|
|
433
|
+
// No items specified - array of any
|
|
434
|
+
zodSchema = z.array(z.any());
|
|
435
|
+
}
|
|
436
|
+
break;
|
|
437
|
+
}
|
|
438
|
+
default:
|
|
439
|
+
throw new Error(`Unsupported type: ${type}`);
|
|
440
|
+
}
|
|
441
|
+
// Apply metadata
|
|
442
|
+
if (schema.description) {
|
|
443
|
+
zodSchema = zodSchema.describe(schema.description);
|
|
444
|
+
}
|
|
445
|
+
if (schema.default !== undefined) {
|
|
446
|
+
zodSchema = zodSchema.default(schema.default);
|
|
447
|
+
}
|
|
448
|
+
return zodSchema;
|
|
449
|
+
}
|
|
450
|
+
function convertSchema(schema, ctx) {
|
|
451
|
+
if (typeof schema === "boolean") {
|
|
452
|
+
return schema ? z.any() : z.never();
|
|
453
|
+
}
|
|
454
|
+
// Convert base schema first (ignoring composition keywords)
|
|
455
|
+
let baseSchema = convertBaseSchema(schema, ctx);
|
|
456
|
+
const hasExplicitType = schema.type || schema.enum !== undefined || schema.const !== undefined;
|
|
457
|
+
// Process composition keywords LAST (they can appear together)
|
|
458
|
+
// Handle anyOf - wrap base schema with union
|
|
459
|
+
if (schema.anyOf && Array.isArray(schema.anyOf)) {
|
|
460
|
+
const options = schema.anyOf.map((s) => convertSchema(s, ctx));
|
|
461
|
+
const anyOfUnion = z.union(options);
|
|
462
|
+
baseSchema = hasExplicitType ? z.intersection(baseSchema, anyOfUnion) : anyOfUnion;
|
|
463
|
+
}
|
|
464
|
+
// Handle oneOf - exclusive union (exactly one must match)
|
|
465
|
+
if (schema.oneOf && Array.isArray(schema.oneOf)) {
|
|
466
|
+
const options = schema.oneOf.map((s) => convertSchema(s, ctx));
|
|
467
|
+
const oneOfUnion = z.xor(options);
|
|
468
|
+
baseSchema = hasExplicitType ? z.intersection(baseSchema, oneOfUnion) : oneOfUnion;
|
|
469
|
+
}
|
|
470
|
+
// Handle allOf - wrap base schema with intersection
|
|
471
|
+
if (schema.allOf && Array.isArray(schema.allOf)) {
|
|
472
|
+
if (schema.allOf.length === 0) {
|
|
473
|
+
baseSchema = hasExplicitType ? baseSchema : z.any();
|
|
474
|
+
}
|
|
475
|
+
else {
|
|
476
|
+
let result = hasExplicitType ? baseSchema : convertSchema(schema.allOf[0], ctx);
|
|
477
|
+
const startIdx = hasExplicitType ? 0 : 1;
|
|
478
|
+
for (let i = startIdx; i < schema.allOf.length; i++) {
|
|
479
|
+
result = z.intersection(result, convertSchema(schema.allOf[i], ctx));
|
|
480
|
+
}
|
|
481
|
+
baseSchema = result;
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
// Handle nullable (OpenAPI 3.0)
|
|
485
|
+
if (schema.nullable === true && ctx.version === "openapi-3.0") {
|
|
486
|
+
baseSchema = z.nullable(baseSchema);
|
|
487
|
+
}
|
|
488
|
+
// Handle readOnly
|
|
489
|
+
if (schema.readOnly === true) {
|
|
490
|
+
baseSchema = z.readonly(baseSchema);
|
|
491
|
+
}
|
|
492
|
+
return baseSchema;
|
|
493
|
+
}
|
|
494
|
+
/**
|
|
495
|
+
* Converts a JSON Schema to a Zod schema. This function should be considered semi-experimental. It's behavior is liable to change. */
|
|
496
|
+
function fromJSONSchema(schema, params) {
|
|
497
|
+
// Handle boolean schemas
|
|
498
|
+
if (typeof schema === "boolean") {
|
|
499
|
+
return schema ? z.any() : z.never();
|
|
500
|
+
}
|
|
501
|
+
const version = detectVersion(schema, params?.defaultTarget);
|
|
502
|
+
const defs = (schema.$defs || schema.definitions || {});
|
|
503
|
+
const ctx = {
|
|
504
|
+
version,
|
|
505
|
+
defs,
|
|
506
|
+
refs: new Map(),
|
|
507
|
+
processing: new Set(),
|
|
508
|
+
rootSchema: schema,
|
|
509
|
+
};
|
|
510
|
+
return convertSchema(schema, ctx);
|
|
511
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type * as JSONSchema from "../core/json-schema.cjs";
|
|
2
|
+
import type { ZodType } from "./schemas.cjs";
|
|
3
|
+
type JSONSchemaVersion = "draft-2020-12" | "draft-7" | "draft-4" | "openapi-3.0";
|
|
4
|
+
interface FromJSONSchemaParams {
|
|
5
|
+
defaultTarget?: JSONSchemaVersion;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Converts a JSON Schema to a Zod schema. This function should be considered semi-experimental. It's behavior is liable to change. */
|
|
9
|
+
export declare function fromJSONSchema(schema: JSONSchema.JSONSchema | boolean, params?: FromJSONSchemaParams): ZodType;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type * as JSONSchema from "../core/json-schema.js";
|
|
2
|
+
import type { ZodType } from "./schemas.js";
|
|
3
|
+
type JSONSchemaVersion = "draft-2020-12" | "draft-7" | "draft-4" | "openapi-3.0";
|
|
4
|
+
interface FromJSONSchemaParams {
|
|
5
|
+
defaultTarget?: JSONSchemaVersion;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Converts a JSON Schema to a Zod schema. This function should be considered semi-experimental. It's behavior is liable to change. */
|
|
9
|
+
export declare function fromJSONSchema(schema: JSONSchema.JSONSchema | boolean, params?: FromJSONSchemaParams): ZodType;
|
|
10
|
+
export {};
|