@wopee-io/wopee.wdio 6.0.0 → 6.0.1
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/build/domain/model/config.interface.d.ts +15 -60
- package/build/domain/model/config.interface.d.ts.map +1 -1
- package/build/domain/service/wopeeService.d.ts.map +1 -1
- package/build/domain/service/wopeeService.js +2 -0
- package/build/domain/service/wopeeService.js.map +1 -1
- package/build/utils/versionMetadata.js +2 -2
- package/node_modules/@autonomous-testing/sdk/build/core/domain/entities/createIntegrationScenarioPayload.interface.d.ts +1 -7
- package/node_modules/@autonomous-testing/sdk/build/core/domain/entities/createIntegrationStepPayload.interface.d.ts +1 -23
- package/node_modules/@autonomous-testing/sdk/build/core/domain/entities/createIntegrationSuitePayload.interface.d.ts +1 -5
- package/node_modules/@autonomous-testing/sdk/build/core/domain/entities/integrationScenario.interface.d.ts +1 -7
- package/node_modules/@autonomous-testing/sdk/build/core/domain/entities/integrationStep.interface.d.ts +3 -11
- package/node_modules/@autonomous-testing/sdk/build/core/domain/entities/integrationStep.interface.js +1 -1
- package/node_modules/@autonomous-testing/sdk/build/core/domain/entities/integrationSuite.interface.d.ts +1 -7
- package/node_modules/@autonomous-testing/sdk/build/core/domain/entities/visualAssert.interface.d.ts +3 -11
- package/node_modules/@autonomous-testing/sdk/build/core/domain/entities/visualAssert.interface.js +1 -1
- package/node_modules/@autonomous-testing/sdk/build/core/domain/entities/visualAssertPayload.interface.d.ts +1 -9
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloAdapter/adapter.d.ts +9 -2
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloAdapter/adapter.js +30 -3
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloAdapter/axios-config.d.ts +15 -1
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloAdapter/axios-config.js +17 -1
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloAdapter/deadline.d.ts +36 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloAdapter/deadline.js +63 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloAdapter/errors.js +10 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloAdapter/factories.js +1 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloAdapter/index.d.ts +2 -2
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloAdapter/interface.d.ts +41 -224
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloAdapter/interface.js +16 -8
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloAdapter/retry.d.ts +52 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloAdapter/retry.js +122 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/services/apolloAdapterService/apolloAdapterService.js +3 -7
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/services/apolloAdapterService/apolloService.interface.d.ts +2 -2
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/services/loggerService/loggerOptions.interface.d.ts +5 -10
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/services/loggerService/loggerOptions.interface.js +2 -1
- package/node_modules/@autonomous-testing/sdk/build/shared/metadata/versionMetadata.js +2 -2
- package/node_modules/@autonomous-testing/sdk/build/shared/utils/zodHelper/zodHelper.d.ts +10 -0
- package/node_modules/@autonomous-testing/sdk/build/shared/utils/zodHelper/zodHelper.js +8 -0
- package/node_modules/@autonomous-testing/sdk/package.json +2 -2
- package/node_modules/follow-redirects/README.md +27 -1
- package/node_modules/follow-redirects/index.js +11 -6
- package/node_modules/follow-redirects/package.json +1 -1
- package/node_modules/zod/README.md +34 -24
- package/node_modules/zod/compile.cjs +96 -0
- package/node_modules/zod/compile.d.cts +1 -0
- package/node_modules/zod/compile.d.ts +1 -0
- package/node_modules/zod/compile.js +52 -0
- package/node_modules/zod/index.cjs +22 -3
- package/node_modules/zod/index.d.cts +3 -4
- package/node_modules/zod/index.d.ts +3 -4
- package/node_modules/zod/index.js +7 -4
- package/node_modules/zod/locales/index.cjs +36 -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 +7 -0
- package/node_modules/zod/mini/index.cjs +51 -0
- package/node_modules/zod/mini/index.d.cts +3 -0
- package/node_modules/zod/mini/index.d.ts +3 -0
- package/node_modules/zod/mini/index.js +3 -0
- package/node_modules/zod/mini/package.json +7 -0
- package/node_modules/zod/package.json +44 -15
- package/node_modules/zod/src/compile.ts +56 -0
- package/node_modules/zod/src/index.ts +7 -4
- package/node_modules/zod/src/locales/index.ts +1 -0
- package/node_modules/zod/src/mini/index.ts +3 -0
- package/node_modules/zod/src/v3/ZodError.ts +23 -13
- package/node_modules/zod/src/v3/helpers/errorUtil.ts +1 -1
- package/node_modules/zod/src/v3/tests/all-errors.test.ts +3 -3
- package/node_modules/zod/src/v3/tests/complex.test.ts +17 -3
- package/node_modules/zod/src/v3/tests/error.test.ts +35 -0
- package/node_modules/zod/src/v3/tests/function.test.ts +7 -3
- package/node_modules/zod/src/v3/tests/intersection.test.ts +18 -0
- package/node_modules/zod/src/v3/tests/language-server.test.ts +1 -2
- package/node_modules/zod/src/v3/tests/nan.test.ts +5 -2
- package/node_modules/zod/src/v3/tests/object.test.ts +10 -13
- package/node_modules/zod/src/v3/tests/partials.test.ts +3 -3
- package/node_modules/zod/src/v3/tests/readonly.test.ts +0 -80
- package/node_modules/zod/src/v3/tests/string.test.ts +8 -2
- package/node_modules/zod/src/v3/types.ts +8 -6
- package/node_modules/zod/src/v4/classic/checks.ts +3 -0
- package/node_modules/zod/src/v4/classic/compat.ts +30 -18
- package/node_modules/zod/src/v4/classic/deep-partial.ts +76 -0
- package/node_modules/zod/src/v4/classic/errors.ts +61 -39
- package/node_modules/zod/src/v4/classic/external.ts +18 -11
- package/node_modules/zod/src/v4/classic/from-json-schema.ts +944 -0
- package/node_modules/zod/src/v4/classic/in-out.ts +45 -0
- package/node_modules/zod/src/v4/classic/index.ts +2 -2
- package/node_modules/zod/src/v4/classic/iso.ts +2 -72
- package/node_modules/zod/src/v4/classic/parse.ts +57 -2
- package/node_modules/zod/src/v4/classic/schemas.ts +1258 -375
- package/node_modules/zod/src/v4/classic/tests/apply.test.ts +86 -0
- package/node_modules/zod/src/v4/classic/tests/array.test.ts +35 -8
- package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +192 -0
- package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +36 -1
- package/node_modules/zod/src/v4/classic/tests/brand.test.ts +43 -0
- package/node_modules/zod/src/v4/classic/tests/catch.test.ts +357 -5
- package/node_modules/zod/src/v4/classic/tests/codec-examples.test.ts +572 -0
- package/node_modules/zod/src/v4/classic/tests/codec.test.ts +704 -0
- package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +27 -5
- package/node_modules/zod/src/v4/classic/tests/credit-card.test.ts +76 -0
- package/node_modules/zod/src/v4/classic/tests/cyclic-data.test.ts +985 -0
- package/node_modules/zod/src/v4/classic/tests/date.test.ts +67 -6
- package/node_modules/zod/src/v4/classic/tests/datetime.test.ts +37 -17
- package/node_modules/zod/src/v4/classic/tests/deep-partial.test.ts +380 -0
- package/node_modules/zod/src/v4/classic/tests/default-locale.test.ts +32 -0
- package/node_modules/zod/src/v4/classic/tests/default.test.ts +142 -0
- package/node_modules/zod/src/v4/classic/tests/describe-meta-checks.test.ts +27 -0
- package/node_modules/zod/src/v4/classic/tests/detached-methods.test.ts +221 -0
- package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +333 -10
- package/node_modules/zod/src/v4/classic/tests/enum.test.ts +20 -0
- package/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +394 -4
- package/node_modules/zod/src/v4/classic/tests/error.test.ts +403 -6
- package/node_modules/zod/src/v4/classic/tests/file.test.ts +9 -4
- package/node_modules/zod/src/v4/classic/tests/firstparty.test.ts +4 -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 +1467 -0
- package/node_modules/zod/src/v4/classic/tests/function.test.ts +160 -37
- package/node_modules/zod/src/v4/classic/tests/global-config.test.ts +32 -0
- package/node_modules/zod/src/v4/classic/tests/hash.test.ts +67 -0
- package/node_modules/zod/src/v4/classic/tests/iban.test.ts +81 -0
- package/node_modules/zod/src/v4/classic/tests/in-out.test.ts +159 -0
- package/node_modules/zod/src/v4/classic/tests/index.test.ts +134 -5
- package/node_modules/zod/src/v4/classic/tests/instance-footprint.test.ts +319 -0
- package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +93 -0
- package/node_modules/zod/src/v4/classic/tests/intersection.test.ts +168 -5
- package/node_modules/zod/src/v4/classic/tests/issue-schema.test.ts +215 -0
- package/node_modules/zod/src/v4/classic/tests/jitless-allows-eval.test.ts +39 -0
- package/node_modules/zod/src/v4/classic/tests/json.test.ts +4 -3
- package/node_modules/zod/src/v4/classic/tests/lazy.test.ts +36 -1
- package/node_modules/zod/src/v4/classic/tests/literal.test.ts +37 -1
- package/node_modules/zod/src/v4/classic/tests/locales_ka.test.ts +29 -0
- package/node_modules/zod/src/v4/classic/tests/locales_ro.test.ts +24 -0
- package/node_modules/zod/src/v4/classic/tests/map.test.ts +153 -0
- package/node_modules/zod/src/v4/classic/tests/nonoptional.test.ts +15 -0
- package/node_modules/zod/src/v4/classic/tests/number.test.ts +161 -7
- package/node_modules/zod/src/v4/classic/tests/object.test.ts +457 -14
- package/node_modules/zod/src/v4/classic/tests/optin-ladder.test.ts +235 -0
- package/node_modules/zod/src/v4/classic/tests/optional.test.ts +255 -12
- package/node_modules/zod/src/v4/classic/tests/partial.test.ts +350 -0
- package/node_modules/zod/src/v4/classic/tests/pickomit.test.ts +89 -5
- package/node_modules/zod/src/v4/classic/tests/pipe.test.ts +25 -5
- package/node_modules/zod/src/v4/classic/tests/prefault.test.ts +107 -0
- package/node_modules/zod/src/v4/classic/tests/preprocess-types.test.ts +44 -0
- package/node_modules/zod/src/v4/classic/tests/preprocess.test.ts +74 -21
- package/node_modules/zod/src/v4/classic/tests/promise.test.ts +1 -1
- package/node_modules/zod/src/v4/classic/tests/properties.test.ts +141 -0
- package/node_modules/zod/src/v4/classic/tests/readonly.test.ts +1 -69
- package/node_modules/zod/src/v4/classic/tests/record.test.ts +553 -10
- package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +352 -1
- package/node_modules/zod/src/v4/classic/tests/redos.test.ts +68 -0
- package/node_modules/zod/src/v4/classic/tests/refine.test.ts +229 -68
- package/node_modules/zod/src/v4/classic/tests/registries.test.ts +40 -1
- package/node_modules/zod/src/v4/classic/tests/set.test.ts +20 -3
- package/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +96 -0
- package/node_modules/zod/src/v4/classic/tests/string-formats.test.ts +16 -0
- package/node_modules/zod/src/v4/classic/tests/string.test.ts +568 -9
- package/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +58 -0
- package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +70 -16
- 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 +3409 -990
- package/node_modules/zod/src/v4/classic/tests/transform.test.ts +128 -0
- package/node_modules/zod/src/v4/classic/tests/tuple.test.ts +353 -5
- package/node_modules/zod/src/v4/classic/tests/union.test.ts +219 -3
- package/node_modules/zod/src/v4/classic/tests/url.test.ts +13 -0
- package/node_modules/zod/src/v4/classic/tests/validate.test.ts +645 -0
- package/node_modules/zod/src/v4/classic/tests/validations.test.ts +2 -2
- package/node_modules/zod/src/v4/core/api.ts +442 -161
- package/node_modules/zod/src/v4/core/checks.ts +134 -151
- package/node_modules/zod/src/v4/core/compile.ts +2322 -0
- package/node_modules/zod/src/v4/core/core.ts +146 -50
- package/node_modules/zod/src/v4/core/doc.ts +18 -10
- package/node_modules/zod/src/v4/core/errors.ts +221 -102
- package/node_modules/zod/src/v4/core/index.ts +5 -1
- package/node_modules/zod/src/v4/core/json-schema-generator.ts +131 -0
- package/node_modules/zod/src/v4/core/json-schema-processors.ts +934 -0
- package/node_modules/zod/src/v4/core/json-schema.ts +9 -4
- package/node_modules/zod/src/v4/core/memoizer.ts +331 -0
- package/node_modules/zod/src/v4/core/parse.ts +252 -37
- package/node_modules/zod/src/v4/core/regexes.ts +112 -30
- package/node_modules/zod/src/v4/core/registries.ts +19 -10
- package/node_modules/zod/src/v4/core/schemas.ts +1972 -588
- package/node_modules/zod/src/v4/core/standard-schema.ts +114 -19
- package/node_modules/zod/src/v4/core/tests/cached.test.ts +54 -0
- package/node_modules/zod/src/v4/core/tests/compile-differential.test.ts +1004 -0
- package/node_modules/zod/src/v4/core/tests/compile-generative.test.ts +445 -0
- package/node_modules/zod/src/v4/core/tests/compile-global.test.ts +89 -0
- package/node_modules/zod/src/v4/core/tests/compile-off-by-default.test.ts +26 -0
- package/node_modules/zod/src/v4/core/tests/compile-stats.test.ts +34 -0
- package/node_modules/zod/src/v4/core/tests/compile.test.ts +2036 -0
- package/node_modules/zod/src/v4/core/tests/email-regex.test.ts +140 -0
- package/node_modules/zod/src/v4/core/tests/extend.test.ts +59 -0
- package/node_modules/zod/src/v4/core/tests/locales/el.test.ts +214 -0
- package/node_modules/zod/src/v4/core/tests/locales/en.test.ts +1 -1
- package/node_modules/zod/src/v4/core/tests/locales/es.test.ts +180 -0
- package/node_modules/zod/src/v4/core/tests/locales/fr.test.ts +72 -0
- package/node_modules/zod/src/v4/core/tests/locales/he.test.ts +379 -0
- package/node_modules/zod/src/v4/core/tests/locales/hr.test.ts +163 -0
- package/node_modules/zod/src/v4/core/tests/locales/nl.test.ts +46 -0
- package/node_modules/zod/src/v4/core/tests/locales/parity.test.ts +42 -0
- package/node_modules/zod/src/v4/core/tests/locales/tg.test.ts +85 -0
- package/node_modules/zod/src/v4/core/tests/locales/tk.test.ts +69 -0
- package/node_modules/zod/src/v4/core/tests/locales/tr.test.ts +2 -2
- package/node_modules/zod/src/v4/core/tests/locales/uz.test.ts +105 -0
- package/node_modules/zod/src/v4/core/tests/polyfill-collision.test.ts +46 -0
- package/node_modules/zod/src/v4/core/tests/record-constructor.test.ts +125 -0
- package/node_modules/zod/src/v4/core/tests/recursive-tuples.test.ts +45 -0
- package/node_modules/zod/src/v4/core/tests/treeshake.test.ts +51 -0
- package/node_modules/zod/src/v4/core/tests/url-no-canparse.test.ts +133 -0
- package/node_modules/zod/src/v4/core/to-json-schema.ts +706 -826
- package/node_modules/zod/src/v4/core/util.ts +675 -157
- package/node_modules/zod/src/v4/core/versions.ts +2 -2
- package/node_modules/zod/src/v4/core/visit.ts +193 -0
- package/node_modules/zod/src/v4/index.ts +3 -3
- package/node_modules/zod/src/v4/locales/ar.ts +22 -27
- package/node_modules/zod/src/v4/locales/az.ts +22 -27
- package/node_modules/zod/src/v4/locales/be.ts +31 -27
- package/node_modules/zod/src/v4/locales/bg.ts +133 -0
- package/node_modules/zod/src/v4/locales/bn.ts +123 -0
- package/node_modules/zod/src/v4/locales/ca.ts +22 -28
- package/node_modules/zod/src/v4/locales/ckb.ts +140 -0
- package/node_modules/zod/src/v4/locales/cs.ts +26 -45
- package/node_modules/zod/src/v4/locales/da.ts +128 -0
- package/node_modules/zod/src/v4/locales/de.ts +24 -27
- package/node_modules/zod/src/v4/locales/el.ts +124 -0
- package/node_modules/zod/src/v4/locales/en.ts +38 -29
- package/node_modules/zod/src/v4/locales/eo.ts +25 -27
- package/node_modules/zod/src/v4/locales/es.ts +53 -33
- package/node_modules/zod/src/v4/locales/fa.ts +24 -27
- package/node_modules/zod/src/v4/locales/fi.ts +22 -27
- package/node_modules/zod/src/v4/locales/fr-CA.ts +22 -27
- package/node_modules/zod/src/v4/locales/fr.ts +58 -43
- package/node_modules/zod/src/v4/locales/gu.ts +123 -0
- package/node_modules/zod/src/v4/locales/he.ts +208 -80
- package/node_modules/zod/src/v4/locales/hi.ts +126 -0
- package/node_modules/zod/src/v4/locales/hr.ts +135 -0
- package/node_modules/zod/src/v4/locales/hu.ts +24 -28
- package/node_modules/zod/src/v4/locales/hy.ts +175 -0
- package/node_modules/zod/src/v4/locales/id.ts +22 -27
- package/node_modules/zod/src/v4/locales/index.ts +24 -0
- package/node_modules/zod/src/v4/locales/is.ts +124 -0
- package/node_modules/zod/src/v4/locales/it.ts +24 -28
- package/node_modules/zod/src/v4/locales/ja.ts +24 -27
- package/node_modules/zod/src/v4/locales/ka.ts +128 -0
- package/node_modules/zod/src/v4/locales/kh.ts +3 -122
- package/node_modules/zod/src/v4/locales/km.ts +124 -0
- package/node_modules/zod/src/v4/locales/kn.ts +126 -0
- package/node_modules/zod/src/v4/locales/ko.ts +22 -27
- package/node_modules/zod/src/v4/locales/lt.ts +243 -0
- package/node_modules/zod/src/v4/locales/mk.ts +24 -28
- package/node_modules/zod/src/v4/locales/ms.ts +23 -27
- package/node_modules/zod/src/v4/locales/ne.ts +128 -0
- package/node_modules/zod/src/v4/locales/nl.ts +37 -37
- package/node_modules/zod/src/v4/locales/nn.ts +121 -0
- package/node_modules/zod/src/v4/locales/no.ts +26 -29
- package/node_modules/zod/src/v4/locales/ota.ts +25 -28
- package/node_modules/zod/src/v4/locales/pl.ts +24 -27
- package/node_modules/zod/src/v4/locales/ps.ts +24 -26
- package/node_modules/zod/src/v4/locales/pt-BR.ts +161 -0
- package/node_modules/zod/src/v4/locales/pt.ts +107 -71
- package/node_modules/zod/src/v4/locales/ro.ts +132 -0
- package/node_modules/zod/src/v4/locales/ru.ts +31 -27
- package/node_modules/zod/src/v4/locales/sk.ts +123 -0
- package/node_modules/zod/src/v4/locales/sl.ts +24 -27
- package/node_modules/zod/src/v4/locales/sv.ts +26 -29
- package/node_modules/zod/src/v4/locales/ta.ts +25 -27
- package/node_modules/zod/src/v4/locales/tg.ts +135 -0
- package/node_modules/zod/src/v4/locales/th.ts +25 -27
- package/node_modules/zod/src/v4/locales/tk.ts +113 -0
- package/node_modules/zod/src/v4/locales/tr.ts +22 -27
- package/node_modules/zod/src/v4/locales/ua.ts +3 -122
- package/node_modules/zod/src/v4/locales/uk.ts +122 -0
- package/node_modules/zod/src/v4/locales/ur.ts +25 -27
- package/node_modules/zod/src/v4/locales/uz.ts +120 -0
- package/node_modules/zod/src/v4/locales/vi.ts +24 -27
- package/node_modules/zod/src/v4/locales/yo.ts +129 -0
- package/node_modules/zod/src/v4/locales/zh-CN.ts +25 -27
- package/node_modules/zod/src/v4/locales/zh-TW.ts +22 -27
- package/node_modules/zod/src/v4/mini/checks.ts +1 -0
- package/node_modules/zod/src/v4/mini/coerce.ts +5 -0
- package/node_modules/zod/src/v4/mini/deep-partial.ts +73 -0
- package/node_modules/zod/src/v4/mini/external.ts +15 -3
- package/node_modules/zod/src/v4/mini/in-out.ts +45 -0
- package/node_modules/zod/src/v4/mini/iso.ts +8 -4
- package/node_modules/zod/src/v4/mini/parse.ts +16 -1
- package/node_modules/zod/src/v4/mini/schemas.ts +586 -114
- package/node_modules/zod/src/v4/mini/tests/apply.test.ts +57 -0
- package/node_modules/zod/src/v4/mini/tests/assignability.test.ts +63 -2
- package/node_modules/zod/src/v4/mini/tests/brand.test.ts +43 -0
- package/node_modules/zod/src/v4/mini/tests/checks.test.ts +14 -0
- package/node_modules/zod/src/v4/mini/tests/codec.test.ts +582 -0
- package/node_modules/zod/src/v4/mini/tests/computed.test.ts +12 -18
- package/node_modules/zod/src/v4/mini/tests/cyclic-data.test.ts +84 -0
- package/node_modules/zod/src/v4/mini/tests/deep-partial.test.ts +54 -0
- package/node_modules/zod/src/v4/mini/tests/error.test.ts +24 -5
- package/node_modules/zod/src/v4/mini/tests/functions.test.ts +7 -36
- package/node_modules/zod/src/v4/mini/tests/index.test.ts +281 -6
- package/node_modules/zod/src/v4/mini/tests/number.test.ts +15 -1
- package/node_modules/zod/src/v4/mini/tests/object.test.ts +116 -9
- package/node_modules/zod/src/v4/mini/tests/prototypes.test.ts +1 -1
- package/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +68 -2
- package/node_modules/zod/src/v4/mini/tests/standard-schema.test.ts +50 -0
- package/node_modules/zod/src/v4/mini/tests/string.test.ts +98 -1
- package/node_modules/zod/src/v4-mini/index.ts +3 -1
- package/node_modules/zod/v3/ZodError.cjs +42 -13
- package/node_modules/zod/v3/ZodError.d.cts +6 -6
- package/node_modules/zod/v3/ZodError.d.ts +6 -6
- package/node_modules/zod/v3/ZodError.js +23 -13
- package/node_modules/zod/v3/errors.cjs +19 -0
- package/node_modules/zod/v3/external.cjs +19 -0
- package/node_modules/zod/v3/helpers/enumUtil.cjs +19 -0
- package/node_modules/zod/v3/helpers/errorUtil.cjs +20 -1
- package/node_modules/zod/v3/helpers/errorUtil.js +1 -1
- package/node_modules/zod/v3/helpers/parseUtil.cjs +19 -0
- package/node_modules/zod/v3/helpers/partialUtil.cjs +19 -0
- package/node_modules/zod/v3/helpers/typeAliases.cjs +19 -0
- package/node_modules/zod/v3/helpers/util.cjs +19 -0
- package/node_modules/zod/v3/index.cjs +19 -0
- package/node_modules/zod/v3/locales/en.cjs +1 -0
- package/node_modules/zod/v3/locales/en.d.cts +1 -1
- package/node_modules/zod/v3/package.json +7 -0
- package/node_modules/zod/v3/standard-schema.cjs +19 -0
- package/node_modules/zod/v3/types.cjs +28 -5
- package/node_modules/zod/v3/types.d.cts +4 -1
- package/node_modules/zod/v3/types.d.ts +4 -1
- package/node_modules/zod/v3/types.js +9 -5
- package/node_modules/zod/v4/classic/checks.cjs +22 -1
- package/node_modules/zod/v4/classic/checks.d.cts +1 -1
- package/node_modules/zod/v4/classic/checks.d.ts +1 -1
- package/node_modules/zod/v4/classic/checks.js +1 -1
- package/node_modules/zod/v4/classic/coerce.cjs +19 -0
- package/node_modules/zod/v4/classic/compat.cjs +24 -1
- package/node_modules/zod/v4/classic/compat.d.cts +13 -11
- package/node_modules/zod/v4/classic/compat.d.ts +13 -11
- package/node_modules/zod/v4/classic/compat.js +4 -0
- package/node_modules/zod/v4/classic/deep-partial.cjs +58 -0
- package/node_modules/zod/v4/classic/deep-partial.d.cts +14 -0
- package/node_modules/zod/v4/classic/deep-partial.d.ts +14 -0
- package/node_modules/zod/v4/classic/deep-partial.js +13 -0
- package/node_modules/zod/v4/classic/errors.cjs +63 -28
- package/node_modules/zod/v4/classic/errors.d.cts +3 -4
- package/node_modules/zod/v4/classic/errors.d.ts +3 -4
- package/node_modules/zod/v4/classic/errors.js +45 -29
- package/node_modules/zod/v4/classic/external.cjs +55 -28
- package/node_modules/zod/v4/classic/external.d.cts +8 -2
- package/node_modules/zod/v4/classic/external.d.ts +8 -2
- package/node_modules/zod/v4/classic/external.js +7 -8
- package/node_modules/zod/v4/classic/from-json-schema.cjs +926 -0
- package/node_modules/zod/v4/classic/from-json-schema.d.cts +12 -0
- package/node_modules/zod/v4/classic/from-json-schema.d.ts +12 -0
- package/node_modules/zod/v4/classic/from-json-schema.js +881 -0
- package/node_modules/zod/v4/classic/in-out.cjs +82 -0
- package/node_modules/zod/v4/classic/in-out.d.cts +8 -0
- package/node_modules/zod/v4/classic/in-out.d.ts +8 -0
- package/node_modules/zod/v4/classic/in-out.js +36 -0
- package/node_modules/zod/v4/classic/index.cjs +21 -2
- package/node_modules/zod/v4/classic/index.d.cts +1 -2
- package/node_modules/zod/v4/classic/index.d.ts +1 -2
- package/node_modules/zod/v4/classic/index.js +2 -2
- package/node_modules/zod/v4/classic/iso.cjs +30 -22
- package/node_modules/zod/v4/classic/iso.d.cts +2 -17
- package/node_modules/zod/v4/classic/iso.d.ts +2 -17
- package/node_modules/zod/v4/classic/iso.js +2 -17
- package/node_modules/zod/v4/classic/package.json +7 -0
- package/node_modules/zod/v4/classic/parse.cjs +32 -1
- package/node_modules/zod/v4/classic/parse.d.cts +21 -0
- package/node_modules/zod/v4/classic/parse.d.ts +21 -0
- package/node_modules/zod/v4/classic/parse.js +10 -0
- package/node_modules/zod/v4/classic/schemas.cjs +805 -238
- package/node_modules/zod/v4/classic/schemas.d.cts +241 -55
- package/node_modules/zod/v4/classic/schemas.d.ts +241 -55
- package/node_modules/zod/v4/classic/schemas.js +766 -237
- package/node_modules/zod/v4/core/api.cjs +284 -54
- package/node_modules/zod/v4/core/api.d.cts +133 -82
- package/node_modules/zod/v4/core/api.d.ts +133 -82
- package/node_modules/zod/v4/core/api.js +255 -54
- package/node_modules/zod/v4/core/checks.cjs +100 -130
- package/node_modules/zod/v4/core/checks.d.cts +32 -16
- package/node_modules/zod/v4/core/checks.d.ts +32 -16
- package/node_modules/zod/v4/core/checks.js +80 -129
- package/node_modules/zod/v4/core/compile.cjs +1916 -0
- package/node_modules/zod/v4/core/compile.d.cts +65 -0
- package/node_modules/zod/v4/core/compile.d.ts +65 -0
- package/node_modules/zod/v4/core/compile.js +1866 -0
- package/node_modules/zod/v4/core/core.cjs +120 -20
- package/node_modules/zod/v4/core/core.d.cts +40 -7
- package/node_modules/zod/v4/core/core.d.ts +40 -7
- package/node_modules/zod/v4/core/core.js +101 -21
- package/node_modules/zod/v4/core/doc.cjs +31 -9
- package/node_modules/zod/v4/core/doc.d.cts +4 -2
- package/node_modules/zod/v4/core/doc.d.ts +4 -2
- package/node_modules/zod/v4/core/doc.js +12 -9
- package/node_modules/zod/v4/core/errors.cjs +151 -60
- package/node_modules/zod/v4/core/errors.d.cts +41 -24
- package/node_modules/zod/v4/core/errors.d.ts +41 -24
- package/node_modules/zod/v4/core/errors.js +132 -60
- package/node_modules/zod/v4/core/index.cjs +28 -2
- package/node_modules/zod/v4/core/index.d.cts +5 -1
- package/node_modules/zod/v4/core/index.d.ts +5 -1
- package/node_modules/zod/v4/core/index.js +5 -1
- package/node_modules/zod/v4/core/json-schema-generator.cjs +122 -0
- package/node_modules/zod/v4/core/json-schema-generator.d.cts +65 -0
- package/node_modules/zod/v4/core/json-schema-generator.d.ts +65 -0
- package/node_modules/zod/v4/core/json-schema-generator.js +99 -0
- package/node_modules/zod/v4/core/json-schema-processors.cjs +929 -0
- package/node_modules/zod/v4/core/json-schema-processors.d.cts +65 -0
- package/node_modules/zod/v4/core/json-schema-processors.d.ts +65 -0
- package/node_modules/zod/v4/core/json-schema-processors.js +843 -0
- package/node_modules/zod/v4/core/json-schema.cjs +19 -0
- package/node_modules/zod/v4/core/json-schema.d.cts +6 -4
- package/node_modules/zod/v4/core/json-schema.d.ts +6 -4
- package/node_modules/zod/v4/core/memoizer.cjs +360 -0
- package/node_modules/zod/v4/core/memoizer.d.cts +15 -0
- package/node_modules/zod/v4/core/memoizer.d.ts +15 -0
- package/node_modules/zod/v4/core/memoizer.js +311 -0
- package/node_modules/zod/v4/core/package.json +7 -0
- package/node_modules/zod/v4/core/parse.cjs +183 -37
- package/node_modules/zod/v4/core/parse.d.cts +34 -7
- package/node_modules/zod/v4/core/parse.d.ts +34 -7
- package/node_modules/zod/v4/core/parse.js +154 -36
- package/node_modules/zod/v4/core/regexes.cjs +137 -31
- package/node_modules/zod/v4/core/regexes.d.cts +30 -2
- package/node_modules/zod/v4/core/regexes.d.ts +30 -2
- package/node_modules/zod/v4/core/regexes.js +90 -29
- package/node_modules/zod/v4/core/registries.cjs +26 -7
- package/node_modules/zod/v4/core/registries.d.cts +2 -2
- package/node_modules/zod/v4/core/registries.d.ts +2 -2
- package/node_modules/zod/v4/core/registries.js +9 -9
- package/node_modules/zod/v4/core/schemas.cjs +1373 -422
- package/node_modules/zod/v4/core/schemas.d.cts +276 -42
- package/node_modules/zod/v4/core/schemas.d.ts +276 -42
- package/node_modules/zod/v4/core/schemas.js +1341 -422
- package/node_modules/zod/v4/core/standard-schema.cjs +19 -0
- package/node_modules/zod/v4/core/standard-schema.d.cts +90 -19
- package/node_modules/zod/v4/core/standard-schema.d.ts +90 -19
- package/node_modules/zod/v4/core/to-json-schema.cjs +628 -801
- package/node_modules/zod/v4/core/to-json-schema.d.cts +103 -37
- package/node_modules/zod/v4/core/to-json-schema.d.ts +103 -37
- package/node_modules/zod/v4/core/to-json-schema.js +602 -800
- package/node_modules/zod/v4/core/util.cjs +580 -155
- package/node_modules/zod/v4/core/util.d.cts +98 -1
- package/node_modules/zod/v4/core/util.d.ts +98 -1
- package/node_modules/zod/v4/core/util.js +536 -156
- package/node_modules/zod/v4/core/versions.cjs +21 -2
- package/node_modules/zod/v4/core/versions.d.cts +1 -1
- package/node_modules/zod/v4/core/versions.d.ts +1 -1
- package/node_modules/zod/v4/core/versions.js +2 -2
- package/node_modules/zod/v4/core/visit.cjs +214 -0
- package/node_modules/zod/v4/core/visit.d.cts +30 -0
- package/node_modules/zod/v4/core/visit.d.ts +30 -0
- package/node_modules/zod/v4/core/visit.js +169 -0
- package/node_modules/zod/v4/index.cjs +34 -5
- package/node_modules/zod/v4/index.d.cts +2 -2
- package/node_modules/zod/v4/index.d.ts +2 -2
- package/node_modules/zod/v4/index.js +3 -2
- package/node_modules/zod/v4/locales/ar.cjs +20 -24
- package/node_modules/zod/v4/locales/ar.d.cts +2 -1
- package/node_modules/zod/v4/locales/ar.js +19 -24
- package/node_modules/zod/v4/locales/az.cjs +20 -24
- package/node_modules/zod/v4/locales/az.d.cts +2 -1
- package/node_modules/zod/v4/locales/az.js +19 -24
- package/node_modules/zod/v4/locales/be.cjs +29 -24
- package/node_modules/zod/v4/locales/be.d.cts +2 -1
- package/node_modules/zod/v4/locales/be.js +28 -24
- package/node_modules/zod/v4/locales/bg.cjs +152 -0
- package/node_modules/zod/v4/locales/bg.d.cts +5 -0
- package/node_modules/zod/v4/locales/bg.d.ts +4 -0
- package/node_modules/zod/v4/locales/bg.js +125 -0
- package/node_modules/zod/v4/locales/bn.cjs +140 -0
- package/node_modules/zod/v4/locales/bn.d.cts +5 -0
- package/node_modules/zod/v4/locales/bn.d.ts +4 -0
- package/node_modules/zod/v4/locales/bn.js +113 -0
- package/node_modules/zod/v4/locales/ca.cjs +20 -25
- package/node_modules/zod/v4/locales/ca.d.cts +2 -1
- package/node_modules/zod/v4/locales/ca.js +19 -25
- package/node_modules/zod/v4/locales/ckb.cjs +160 -0
- package/node_modules/zod/v4/locales/ckb.d.cts +5 -0
- package/node_modules/zod/v4/locales/ckb.d.ts +4 -0
- package/node_modules/zod/v4/locales/ckb.js +133 -0
- package/node_modules/zod/v4/locales/cs.cjs +24 -42
- package/node_modules/zod/v4/locales/cs.d.cts +2 -1
- package/node_modules/zod/v4/locales/cs.js +23 -42
- package/node_modules/zod/v4/locales/da.cjs +147 -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 +120 -0
- package/node_modules/zod/v4/locales/de.cjs +22 -24
- package/node_modules/zod/v4/locales/de.d.cts +2 -1
- package/node_modules/zod/v4/locales/de.js +21 -24
- package/node_modules/zod/v4/locales/el.cjs +139 -0
- package/node_modules/zod/v4/locales/el.d.cts +5 -0
- package/node_modules/zod/v4/locales/el.d.ts +4 -0
- package/node_modules/zod/v4/locales/el.js +112 -0
- package/node_modules/zod/v4/locales/en.cjs +35 -28
- package/node_modules/zod/v4/locales/en.d.cts +2 -2
- package/node_modules/zod/v4/locales/en.d.ts +0 -1
- package/node_modules/zod/v4/locales/en.js +34 -26
- package/node_modules/zod/v4/locales/eo.cjs +23 -26
- package/node_modules/zod/v4/locales/eo.d.cts +2 -2
- package/node_modules/zod/v4/locales/eo.d.ts +0 -1
- package/node_modules/zod/v4/locales/eo.js +22 -24
- package/node_modules/zod/v4/locales/es.cjs +51 -31
- package/node_modules/zod/v4/locales/es.d.cts +2 -1
- package/node_modules/zod/v4/locales/es.js +50 -31
- package/node_modules/zod/v4/locales/fa.cjs +22 -24
- package/node_modules/zod/v4/locales/fa.d.cts +2 -1
- package/node_modules/zod/v4/locales/fa.js +21 -24
- package/node_modules/zod/v4/locales/fi.cjs +20 -24
- package/node_modules/zod/v4/locales/fi.d.cts +2 -1
- package/node_modules/zod/v4/locales/fi.js +19 -24
- package/node_modules/zod/v4/locales/fr-CA.cjs +20 -24
- package/node_modules/zod/v4/locales/fr-CA.d.cts +2 -1
- package/node_modules/zod/v4/locales/fr-CA.js +19 -24
- package/node_modules/zod/v4/locales/fr.cjs +53 -39
- package/node_modules/zod/v4/locales/fr.d.cts +2 -1
- package/node_modules/zod/v4/locales/fr.js +52 -39
- package/node_modules/zod/v4/locales/gu.cjs +140 -0
- package/node_modules/zod/v4/locales/gu.d.cts +5 -0
- package/node_modules/zod/v4/locales/gu.d.ts +4 -0
- package/node_modules/zod/v4/locales/gu.js +113 -0
- package/node_modules/zod/v4/locales/he.cjs +183 -78
- package/node_modules/zod/v4/locales/he.d.cts +2 -1
- package/node_modules/zod/v4/locales/he.js +182 -78
- package/node_modules/zod/v4/locales/hi.cjs +138 -0
- package/node_modules/zod/v4/locales/hi.d.cts +5 -0
- package/node_modules/zod/v4/locales/hi.d.ts +4 -0
- package/node_modules/zod/v4/locales/hi.js +111 -0
- package/node_modules/zod/v4/locales/hr.cjs +153 -0
- package/node_modules/zod/v4/locales/hr.d.cts +5 -0
- package/node_modules/zod/v4/locales/hr.d.ts +4 -0
- package/node_modules/zod/v4/locales/hr.js +126 -0
- package/node_modules/zod/v4/locales/hu.cjs +22 -25
- package/node_modules/zod/v4/locales/hu.d.cts +2 -1
- package/node_modules/zod/v4/locales/hu.js +21 -25
- package/node_modules/zod/v4/locales/hy.cjs +185 -0
- package/node_modules/zod/v4/locales/hy.d.cts +5 -0
- package/node_modules/zod/v4/locales/hy.d.ts +4 -0
- package/node_modules/zod/v4/locales/hy.js +158 -0
- package/node_modules/zod/v4/locales/id.cjs +20 -24
- package/node_modules/zod/v4/locales/id.d.cts +2 -1
- package/node_modules/zod/v4/locales/id.js +19 -24
- package/node_modules/zod/v4/locales/index.cjs +69 -1
- package/node_modules/zod/v4/locales/index.d.cts +24 -0
- package/node_modules/zod/v4/locales/index.d.ts +24 -0
- package/node_modules/zod/v4/locales/index.js +24 -0
- package/node_modules/zod/v4/locales/is.cjs +141 -0
- package/node_modules/zod/v4/locales/is.d.cts +5 -0
- package/node_modules/zod/v4/locales/is.d.ts +4 -0
- package/node_modules/zod/v4/locales/is.js +114 -0
- package/node_modules/zod/v4/locales/it.cjs +22 -25
- package/node_modules/zod/v4/locales/it.d.cts +2 -1
- package/node_modules/zod/v4/locales/it.js +21 -25
- package/node_modules/zod/v4/locales/ja.cjs +22 -24
- package/node_modules/zod/v4/locales/ja.d.cts +2 -1
- package/node_modules/zod/v4/locales/ja.js +21 -24
- package/node_modules/zod/v4/locales/ka.cjs +144 -0
- package/node_modules/zod/v4/locales/ka.d.cts +5 -0
- package/node_modules/zod/v4/locales/ka.d.ts +4 -0
- package/node_modules/zod/v4/locales/ka.js +117 -0
- package/node_modules/zod/v4/locales/kh.cjs +6 -137
- package/node_modules/zod/v4/locales/kh.d.cts +2 -1
- package/node_modules/zod/v4/locales/kh.d.ts +1 -0
- package/node_modules/zod/v4/locales/kh.js +3 -115
- package/node_modules/zod/v4/locales/km.cjs +142 -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 +115 -0
- package/node_modules/zod/v4/locales/kn.cjs +143 -0
- package/node_modules/zod/v4/locales/kn.d.cts +5 -0
- package/node_modules/zod/v4/locales/kn.d.ts +4 -0
- package/node_modules/zod/v4/locales/kn.js +116 -0
- package/node_modules/zod/v4/locales/ko.cjs +20 -24
- package/node_modules/zod/v4/locales/ko.d.cts +2 -1
- package/node_modules/zod/v4/locales/ko.js +19 -24
- package/node_modules/zod/v4/locales/lt.cjs +234 -0
- package/node_modules/zod/v4/locales/lt.d.cts +5 -0
- package/node_modules/zod/v4/locales/lt.d.ts +4 -0
- package/node_modules/zod/v4/locales/lt.js +207 -0
- package/node_modules/zod/v4/locales/mk.cjs +22 -25
- package/node_modules/zod/v4/locales/mk.d.cts +2 -1
- package/node_modules/zod/v4/locales/mk.js +21 -25
- package/node_modules/zod/v4/locales/ms.cjs +21 -24
- package/node_modules/zod/v4/locales/ms.d.cts +2 -1
- package/node_modules/zod/v4/locales/ms.js +20 -24
- package/node_modules/zod/v4/locales/ne.cjs +138 -0
- package/node_modules/zod/v4/locales/ne.d.cts +5 -0
- package/node_modules/zod/v4/locales/ne.d.ts +4 -0
- package/node_modules/zod/v4/locales/ne.js +111 -0
- package/node_modules/zod/v4/locales/nl.cjs +31 -32
- package/node_modules/zod/v4/locales/nl.d.cts +2 -1
- package/node_modules/zod/v4/locales/nl.js +30 -32
- package/node_modules/zod/v4/locales/nn.cjs +140 -0
- package/node_modules/zod/v4/locales/nn.d.cts +5 -0
- package/node_modules/zod/v4/locales/nn.d.ts +4 -0
- package/node_modules/zod/v4/locales/nn.js +113 -0
- package/node_modules/zod/v4/locales/no.cjs +24 -26
- package/node_modules/zod/v4/locales/no.d.cts +2 -1
- package/node_modules/zod/v4/locales/no.js +23 -26
- package/node_modules/zod/v4/locales/ota.cjs +23 -25
- package/node_modules/zod/v4/locales/ota.d.cts +2 -1
- package/node_modules/zod/v4/locales/ota.js +22 -25
- package/node_modules/zod/v4/locales/package.json +7 -0
- package/node_modules/zod/v4/locales/pl.cjs +22 -24
- package/node_modules/zod/v4/locales/pl.d.cts +2 -1
- package/node_modules/zod/v4/locales/pl.js +21 -24
- package/node_modules/zod/v4/locales/ps.cjs +22 -24
- package/node_modules/zod/v4/locales/ps.d.cts +2 -1
- package/node_modules/zod/v4/locales/ps.js +21 -24
- package/node_modules/zod/v4/locales/pt-BR.cjs +170 -0
- package/node_modules/zod/v4/locales/pt-BR.d.cts +5 -0
- package/node_modules/zod/v4/locales/pt-BR.d.ts +4 -0
- package/node_modules/zod/v4/locales/pt-BR.js +143 -0
- package/node_modules/zod/v4/locales/pt.cjs +95 -68
- package/node_modules/zod/v4/locales/pt.d.cts +2 -1
- package/node_modules/zod/v4/locales/pt.js +94 -68
- package/node_modules/zod/v4/locales/ro.cjs +149 -0
- package/node_modules/zod/v4/locales/ro.d.cts +5 -0
- package/node_modules/zod/v4/locales/ro.d.ts +4 -0
- package/node_modules/zod/v4/locales/ro.js +122 -0
- package/node_modules/zod/v4/locales/ru.cjs +29 -24
- package/node_modules/zod/v4/locales/ru.d.cts +2 -1
- package/node_modules/zod/v4/locales/ru.js +28 -24
- package/node_modules/zod/v4/locales/sk.cjs +143 -0
- package/node_modules/zod/v4/locales/sk.d.cts +5 -0
- package/node_modules/zod/v4/locales/sk.d.ts +4 -0
- package/node_modules/zod/v4/locales/sk.js +116 -0
- package/node_modules/zod/v4/locales/sl.cjs +22 -24
- package/node_modules/zod/v4/locales/sl.d.cts +2 -1
- package/node_modules/zod/v4/locales/sl.js +21 -24
- package/node_modules/zod/v4/locales/sv.cjs +24 -26
- package/node_modules/zod/v4/locales/sv.d.cts +2 -1
- package/node_modules/zod/v4/locales/sv.js +23 -26
- package/node_modules/zod/v4/locales/ta.cjs +23 -24
- package/node_modules/zod/v4/locales/ta.d.cts +2 -1
- package/node_modules/zod/v4/locales/ta.js +22 -24
- package/node_modules/zod/v4/locales/tg.cjs +144 -0
- package/node_modules/zod/v4/locales/tg.d.cts +5 -0
- package/node_modules/zod/v4/locales/tg.d.ts +4 -0
- package/node_modules/zod/v4/locales/tg.js +117 -0
- package/node_modules/zod/v4/locales/th.cjs +23 -24
- package/node_modules/zod/v4/locales/th.d.cts +2 -1
- package/node_modules/zod/v4/locales/th.js +22 -24
- package/node_modules/zod/v4/locales/tk.cjs +134 -0
- package/node_modules/zod/v4/locales/tk.d.cts +5 -0
- package/node_modules/zod/v4/locales/tk.d.ts +4 -0
- package/node_modules/zod/v4/locales/tk.js +107 -0
- package/node_modules/zod/v4/locales/tr.cjs +20 -26
- package/node_modules/zod/v4/locales/tr.d.cts +2 -2
- package/node_modules/zod/v4/locales/tr.d.ts +0 -1
- package/node_modules/zod/v4/locales/tr.js +19 -24
- package/node_modules/zod/v4/locales/ua.cjs +6 -137
- package/node_modules/zod/v4/locales/ua.d.cts +2 -1
- package/node_modules/zod/v4/locales/ua.d.ts +1 -0
- package/node_modules/zod/v4/locales/ua.js +3 -115
- package/node_modules/zod/v4/locales/uk.cjs +140 -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 +113 -0
- package/node_modules/zod/v4/locales/ur.cjs +23 -24
- package/node_modules/zod/v4/locales/ur.d.cts +2 -1
- package/node_modules/zod/v4/locales/ur.js +22 -24
- package/node_modules/zod/v4/locales/uz.cjs +140 -0
- package/node_modules/zod/v4/locales/uz.d.cts +5 -0
- package/node_modules/zod/v4/locales/uz.d.ts +4 -0
- package/node_modules/zod/v4/locales/uz.js +113 -0
- package/node_modules/zod/v4/locales/vi.cjs +22 -24
- package/node_modules/zod/v4/locales/vi.d.cts +2 -1
- package/node_modules/zod/v4/locales/vi.js +21 -24
- package/node_modules/zod/v4/locales/yo.cjs +139 -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 +112 -0
- package/node_modules/zod/v4/locales/zh-CN.cjs +23 -24
- package/node_modules/zod/v4/locales/zh-CN.d.cts +2 -1
- package/node_modules/zod/v4/locales/zh-CN.js +22 -24
- package/node_modules/zod/v4/locales/zh-TW.cjs +20 -24
- package/node_modules/zod/v4/locales/zh-TW.d.cts +2 -1
- package/node_modules/zod/v4/locales/zh-TW.js +19 -24
- package/node_modules/zod/v4/mini/checks.cjs +21 -1
- package/node_modules/zod/v4/mini/checks.d.cts +1 -1
- package/node_modules/zod/v4/mini/checks.d.ts +1 -1
- package/node_modules/zod/v4/mini/checks.js +1 -1
- package/node_modules/zod/v4/mini/coerce.cjs +24 -0
- package/node_modules/zod/v4/mini/coerce.js +5 -0
- package/node_modules/zod/v4/mini/deep-partial.cjs +58 -0
- package/node_modules/zod/v4/mini/deep-partial.d.cts +14 -0
- package/node_modules/zod/v4/mini/deep-partial.d.ts +14 -0
- package/node_modules/zod/v4/mini/deep-partial.js +13 -0
- package/node_modules/zod/v4/mini/external.cjs +36 -3
- package/node_modules/zod/v4/mini/external.d.cts +7 -2
- package/node_modules/zod/v4/mini/external.d.ts +7 -2
- package/node_modules/zod/v4/mini/external.js +4 -1
- package/node_modules/zod/v4/mini/in-out.cjs +82 -0
- package/node_modules/zod/v4/mini/in-out.d.cts +8 -0
- package/node_modules/zod/v4/mini/in-out.d.ts +8 -0
- package/node_modules/zod/v4/mini/in-out.js +36 -0
- package/node_modules/zod/v4/mini/index.cjs +19 -0
- package/node_modules/zod/v4/mini/iso.cjs +27 -4
- package/node_modules/zod/v4/mini/iso.js +8 -4
- package/node_modules/zod/v4/mini/package.json +7 -0
- package/node_modules/zod/v4/mini/parse.cjs +30 -1
- package/node_modules/zod/v4/mini/parse.d.cts +1 -1
- package/node_modules/zod/v4/mini/parse.d.ts +1 -1
- package/node_modules/zod/v4/mini/parse.js +1 -1
- package/node_modules/zod/v4/mini/schemas.cjs +390 -82
- package/node_modules/zod/v4/mini/schemas.d.cts +156 -32
- package/node_modules/zod/v4/mini/schemas.d.ts +156 -32
- package/node_modules/zod/v4/mini/schemas.js +329 -59
- package/node_modules/zod/v4/package.json +7 -0
- package/node_modules/zod/v4-mini/index.cjs +35 -1
- package/node_modules/zod/v4-mini/index.d.cts +3 -1
- package/node_modules/zod/v4-mini/index.d.ts +3 -1
- package/node_modules/zod/v4-mini/index.js +3 -1
- package/node_modules/zod/v4-mini/package.json +7 -0
- package/package.json +6 -3
- package/node_modules/zod/src/v4/core/config.ts +0 -15
- package/node_modules/zod/src/v4/core/function.ts +0 -176
- package/node_modules/zod/v4/core/function.cjs +0 -102
- package/node_modules/zod/v4/core/function.d.cts +0 -52
- package/node_modules/zod/v4/core/function.d.ts +0 -52
- package/node_modules/zod/v4/core/function.js +0 -75
|
@@ -22,9 +22,12 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
22
22
|
__setModuleDefault(result, mod);
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
25
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.
|
|
27
|
-
exports.stringbool = exports.ZodCustom = exports.ZodPromise = exports.ZodLazy = exports.ZodTemplateLiteral = exports.ZodReadonly = exports.ZodPipe = exports.ZodNaN = exports.ZodCatch = exports.ZodSuccess = exports.ZodNonOptional = exports.ZodPrefault = exports.ZodDefault = exports.ZodNullable = exports.ZodOptional = void 0;
|
|
29
|
+
exports.ZodIntersection = exports.ZodDiscriminatedUnion = exports.ZodXor = exports.ZodUnion = exports.ZodObject = exports.ZodArray = exports.ZodDate = exports.ZodVoid = exports.ZodNever = exports.ZodUnknown = exports.ZodAny = exports.ZodNull = exports.ZodUndefined = exports.ZodSymbol = exports.ZodBigIntFormat = exports.ZodBigInt = exports.ZodBoolean = exports.ZodNumberFormat = exports.ZodNumber = exports.ZodCustomStringFormat = exports.ZodJWT = exports.ZodIBAN = exports.ZodCreditCard = exports.ZodE164 = exports.ZodBase64URL = exports.ZodBase64 = exports.ZodCIDRv6 = exports.ZodCIDRv4 = exports.ZodIPv6 = exports.ZodMAC = exports.ZodIPv4 = exports.ZodKSUID = exports.ZodXID = exports.ZodULID = exports.ZodCUID2 = exports.ZodCUID = exports.ZodNanoID = exports.ZodEmoji = exports.ZodURL = exports.ZodUUID = exports.ZodGUID = exports.ZodEmail = exports.ZodISODuration = exports.ZodISOTime = exports.ZodISODate = exports.ZodISODateTime = exports.ZodStringFormat = exports.ZodString = exports._ZodString = exports.ZodType = void 0;
|
|
30
|
+
exports.stringbool = exports.ZodInstanceOf = exports.meta = exports.describe = exports.ZodCustom = exports.ZodFunction = exports.ZodPromise = exports.ZodLazy = exports.ZodTemplateLiteral = exports.ZodReadonly = exports.ZodPreprocess = exports.ZodCodec = exports.ZodPipe = exports.ZodNaN = exports.ZodCatch = exports.ZodSuccess = exports.ZodNonOptional = exports.ZodPrefault = exports.ZodDefault = exports.ZodNullable = exports.ZodExactOptional = exports.ZodOptional = exports.ZodTransform = exports.ZodFile = exports.ZodLiteral = exports.ZodEnum = exports.ZodSet = exports.ZodMap = exports.ZodRecord = exports.ZodTuple = void 0;
|
|
28
31
|
exports.string = string;
|
|
29
32
|
exports.email = email;
|
|
30
33
|
exports.guid = guid;
|
|
@@ -33,6 +36,7 @@ exports.uuidv4 = uuidv4;
|
|
|
33
36
|
exports.uuidv6 = uuidv6;
|
|
34
37
|
exports.uuidv7 = uuidv7;
|
|
35
38
|
exports.url = url;
|
|
39
|
+
exports.httpUrl = httpUrl;
|
|
36
40
|
exports.emoji = emoji;
|
|
37
41
|
exports.nanoid = nanoid;
|
|
38
42
|
exports.cuid = cuid;
|
|
@@ -41,14 +45,21 @@ exports.ulid = ulid;
|
|
|
41
45
|
exports.xid = xid;
|
|
42
46
|
exports.ksuid = ksuid;
|
|
43
47
|
exports.ipv4 = ipv4;
|
|
48
|
+
exports.mac = mac;
|
|
44
49
|
exports.ipv6 = ipv6;
|
|
45
50
|
exports.cidrv4 = cidrv4;
|
|
46
51
|
exports.cidrv6 = cidrv6;
|
|
47
52
|
exports.base64 = base64;
|
|
48
53
|
exports.base64url = base64url;
|
|
49
54
|
exports.e164 = e164;
|
|
55
|
+
exports.creditCard = creditCard;
|
|
56
|
+
exports.iban = iban;
|
|
50
57
|
exports.jwt = jwt;
|
|
51
58
|
exports.stringFormat = stringFormat;
|
|
59
|
+
exports.hostname = hostname;
|
|
60
|
+
exports.hex = hex;
|
|
61
|
+
exports.currencyCode = currencyCode;
|
|
62
|
+
exports.hash = hash;
|
|
52
63
|
exports.number = number;
|
|
53
64
|
exports.int = int;
|
|
54
65
|
exports.float32 = float32;
|
|
@@ -73,11 +84,13 @@ exports.object = object;
|
|
|
73
84
|
exports.strictObject = strictObject;
|
|
74
85
|
exports.looseObject = looseObject;
|
|
75
86
|
exports.union = union;
|
|
87
|
+
exports.xor = xor;
|
|
76
88
|
exports.discriminatedUnion = discriminatedUnion;
|
|
77
89
|
exports.intersection = intersection;
|
|
78
90
|
exports.tuple = tuple;
|
|
79
91
|
exports.record = record;
|
|
80
92
|
exports.partialRecord = partialRecord;
|
|
93
|
+
exports.looseRecord = looseRecord;
|
|
81
94
|
exports.map = map;
|
|
82
95
|
exports.set = set;
|
|
83
96
|
exports.enum = _enum;
|
|
@@ -86,6 +99,7 @@ exports.literal = literal;
|
|
|
86
99
|
exports.file = file;
|
|
87
100
|
exports.transform = transform;
|
|
88
101
|
exports.optional = optional;
|
|
102
|
+
exports.exactOptional = exactOptional;
|
|
89
103
|
exports.nullable = nullable;
|
|
90
104
|
exports.nullish = nullish;
|
|
91
105
|
exports._default = _default;
|
|
@@ -95,10 +109,16 @@ exports.success = success;
|
|
|
95
109
|
exports.catch = _catch;
|
|
96
110
|
exports.nan = nan;
|
|
97
111
|
exports.pipe = pipe;
|
|
112
|
+
exports.codec = codec;
|
|
113
|
+
exports.invertCodec = invertCodec;
|
|
98
114
|
exports.readonly = readonly;
|
|
99
115
|
exports.templateLiteral = templateLiteral;
|
|
100
116
|
exports.lazy = lazy;
|
|
101
117
|
exports.promise = promise;
|
|
118
|
+
exports._function = _function;
|
|
119
|
+
exports.function = _function;
|
|
120
|
+
exports._function = _function;
|
|
121
|
+
exports.function = _function;
|
|
102
122
|
exports.check = check;
|
|
103
123
|
exports.custom = custom;
|
|
104
124
|
exports.refine = refine;
|
|
@@ -108,137 +128,337 @@ exports.json = json;
|
|
|
108
128
|
exports.preprocess = preprocess;
|
|
109
129
|
const core = __importStar(require("../core/index.cjs"));
|
|
110
130
|
const index_js_1 = require("../core/index.cjs");
|
|
131
|
+
const processors = __importStar(require("../core/json-schema-processors.cjs"));
|
|
132
|
+
const regexes = __importStar(require("../core/regexes.cjs"));
|
|
133
|
+
const to_json_schema_js_1 = require("../core/to-json-schema.cjs");
|
|
134
|
+
const en_js_1 = __importDefault(require("../locales/en.cjs"));
|
|
111
135
|
const checks = __importStar(require("./checks.cjs"));
|
|
112
|
-
const iso = __importStar(require("./iso.cjs"));
|
|
113
136
|
const parse = __importStar(require("./parse.cjs"));
|
|
137
|
+
// Register English as the default locale on first ZodType construction. Hooked into the `ZodType` `$constructor` (rather than a top-level `config(en())` in `external.ts`) so bundlers honoring `sideEffects: false` can't tree-shake it out — see #5953, #5725. An explicit `z.config(z.locales.xx())` call wins regardless of order, since this only sets the default when none is present.
|
|
138
|
+
function _ensureDefaultLocale() {
|
|
139
|
+
if (!core.globalConfig.localeError)
|
|
140
|
+
core.config((0, en_js_1.default)());
|
|
141
|
+
}
|
|
142
|
+
// the default memoizer is read by the core container init, which runs before `ZodType.init`, so each container calls this first
|
|
143
|
+
function _ensureDefaultMemoizer() {
|
|
144
|
+
if (!core.globalConfig.memoizer)
|
|
145
|
+
core.config({ memoizer: core.memoizer() });
|
|
146
|
+
}
|
|
114
147
|
exports.ZodType = core.$constructor("ZodType", (inst, def) => {
|
|
148
|
+
_ensureDefaultLocale();
|
|
115
149
|
core.$ZodType.init(inst, def);
|
|
116
150
|
inst.def = def;
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
151
|
+
inst.type = def.type;
|
|
152
|
+
return inst;
|
|
153
|
+
}, {
|
|
154
|
+
check(...chks) {
|
|
155
|
+
const def = this.def;
|
|
156
|
+
return this.clone(index_js_1.util.mergeDefs(def, {
|
|
122
157
|
checks: [
|
|
123
158
|
...(def.checks ?? []),
|
|
124
|
-
...
|
|
159
|
+
...chks.map((ch) => typeof ch === "function" ? { _zod: { check: ch, def: { check: "custom" }, onattach: [] } } : ch),
|
|
125
160
|
],
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
161
|
+
}), { parent: true });
|
|
162
|
+
},
|
|
163
|
+
with(...chks) {
|
|
164
|
+
return this.check(...chks);
|
|
165
|
+
},
|
|
166
|
+
clone(def, params) {
|
|
167
|
+
return core.clone(this, def, params);
|
|
168
|
+
},
|
|
169
|
+
brand() {
|
|
170
|
+
return this;
|
|
171
|
+
},
|
|
172
|
+
register(reg, meta) {
|
|
173
|
+
reg.add(this, meta);
|
|
174
|
+
return this;
|
|
175
|
+
},
|
|
176
|
+
refine(check, params) {
|
|
177
|
+
return this.check(refine(check, params));
|
|
178
|
+
},
|
|
179
|
+
superRefine(refinement, params) {
|
|
180
|
+
return this.check(superRefine(refinement, params));
|
|
181
|
+
},
|
|
182
|
+
overwrite(fn) {
|
|
183
|
+
return this.check(checks.overwrite(fn));
|
|
184
|
+
},
|
|
185
|
+
optional() {
|
|
186
|
+
return optional(this);
|
|
187
|
+
},
|
|
188
|
+
exactOptional() {
|
|
189
|
+
return exactOptional(this);
|
|
190
|
+
},
|
|
191
|
+
nullable() {
|
|
192
|
+
return nullable(this);
|
|
193
|
+
},
|
|
194
|
+
nullish() {
|
|
195
|
+
return optional(nullable(this));
|
|
196
|
+
},
|
|
197
|
+
nonoptional(params) {
|
|
198
|
+
return nonoptional(this, params);
|
|
199
|
+
},
|
|
200
|
+
array() {
|
|
201
|
+
return array(this);
|
|
202
|
+
},
|
|
203
|
+
or(arg) {
|
|
204
|
+
return union([this, arg]);
|
|
205
|
+
},
|
|
206
|
+
and(arg) {
|
|
207
|
+
return intersection(this, arg);
|
|
208
|
+
},
|
|
209
|
+
transform(tx) {
|
|
210
|
+
return pipe(this, transform(tx));
|
|
211
|
+
},
|
|
212
|
+
default(d) {
|
|
213
|
+
return _default(this, d);
|
|
214
|
+
},
|
|
215
|
+
prefault(d) {
|
|
216
|
+
return prefault(this, d);
|
|
217
|
+
},
|
|
218
|
+
catch(params) {
|
|
219
|
+
return _catch(this, params);
|
|
220
|
+
},
|
|
221
|
+
pipe(target) {
|
|
222
|
+
return pipe(this, target);
|
|
223
|
+
},
|
|
224
|
+
readonly() {
|
|
225
|
+
return readonly(this);
|
|
226
|
+
},
|
|
227
|
+
describe(description) {
|
|
228
|
+
const cl = this.clone();
|
|
164
229
|
core.globalRegistry.add(cl, { description });
|
|
165
230
|
return cl;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
});
|
|
173
|
-
inst.meta = (...args) => {
|
|
174
|
-
if (args.length === 0) {
|
|
175
|
-
return core.globalRegistry.get(inst);
|
|
176
|
-
}
|
|
177
|
-
const cl = inst.clone();
|
|
231
|
+
},
|
|
232
|
+
meta(...args) {
|
|
233
|
+
// overloaded: meta() returns the registered metadata, meta(data) returns a clone with `data` registered. The mapped type picks up the second overload, so we accept variadic any-args and return `any` to satisfy both at runtime.
|
|
234
|
+
if (args.length === 0)
|
|
235
|
+
return core.globalRegistry.get(this);
|
|
236
|
+
const cl = this.clone();
|
|
178
237
|
core.globalRegistry.add(cl, args[0]);
|
|
179
238
|
return cl;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
239
|
+
},
|
|
240
|
+
isOptional() {
|
|
241
|
+
return this.safeParse(undefined).success;
|
|
242
|
+
},
|
|
243
|
+
isNullable() {
|
|
244
|
+
return this.safeParse(null).success;
|
|
245
|
+
},
|
|
246
|
+
apply(fn, ...args) {
|
|
247
|
+
return args.length === 0 ? fn(this) : fn(this, ...args);
|
|
248
|
+
},
|
|
249
|
+
// Overrides core's `~standard` to add `jsonSchema`. Must stay a prototype entry: redefining it per instance demotes instances to dictionary mode.
|
|
250
|
+
get "~standard"() {
|
|
251
|
+
return index_js_1.util.hide(this, "~standard", {
|
|
252
|
+
...core.standardProps(this),
|
|
253
|
+
jsonSchema: {
|
|
254
|
+
input: (0, to_json_schema_js_1.createStandardJSONSchemaMethod)(this, "input"),
|
|
255
|
+
output: (0, to_json_schema_js_1.createStandardJSONSchemaMethod)(this, "output"),
|
|
256
|
+
},
|
|
257
|
+
});
|
|
258
|
+
},
|
|
259
|
+
set "~standard"(value) {
|
|
260
|
+
index_js_1.util.own(this, "~standard", value);
|
|
261
|
+
},
|
|
262
|
+
parse: function _parse(data, params) {
|
|
263
|
+
return parse.parse(this, data, params, { callee: _parse });
|
|
264
|
+
},
|
|
265
|
+
parseAsync: async function _parseAsync(data, params) {
|
|
266
|
+
return await parse.parseAsync(this, data, params, { callee: _parseAsync });
|
|
267
|
+
},
|
|
268
|
+
safeParse(data, params) {
|
|
269
|
+
return parse.safeParse(this, data, params);
|
|
270
|
+
},
|
|
271
|
+
async safeParseAsync(data, params) {
|
|
272
|
+
return parse.safeParseAsync(this, data, params);
|
|
273
|
+
},
|
|
274
|
+
// `spa` is an alias: same function object as `safeParseAsync`, as before.
|
|
275
|
+
get spa() {
|
|
276
|
+
return this?.safeParseAsync;
|
|
277
|
+
},
|
|
278
|
+
set spa(value) {
|
|
279
|
+
index_js_1.util.own(this, "spa", value);
|
|
280
|
+
},
|
|
281
|
+
validate(data, params) {
|
|
282
|
+
return parse.validate(this, data, params);
|
|
283
|
+
},
|
|
284
|
+
validateAsync(data, params) {
|
|
285
|
+
return parse.validateAsync(this, data, params);
|
|
286
|
+
},
|
|
287
|
+
encode: function _encode(data, params) {
|
|
288
|
+
return parse.encode(this, data, params, { callee: _encode });
|
|
289
|
+
},
|
|
290
|
+
decode: function _decode(data, params) {
|
|
291
|
+
return parse.decode(this, data, params, { callee: _decode });
|
|
292
|
+
},
|
|
293
|
+
encodeAsync: async function _encodeAsync(data, params) {
|
|
294
|
+
return await parse.encodeAsync(this, data, params, { callee: _encodeAsync });
|
|
295
|
+
},
|
|
296
|
+
decodeAsync: async function _decodeAsync(data, params) {
|
|
297
|
+
return await parse.decodeAsync(this, data, params, { callee: _decodeAsync });
|
|
298
|
+
},
|
|
299
|
+
safeEncode(data, params) {
|
|
300
|
+
return parse.safeEncode(this, data, params);
|
|
301
|
+
},
|
|
302
|
+
safeDecode(data, params) {
|
|
303
|
+
return parse.safeDecode(this, data, params);
|
|
304
|
+
},
|
|
305
|
+
async safeEncodeAsync(data, params) {
|
|
306
|
+
return parse.safeEncodeAsync(this, data, params);
|
|
307
|
+
},
|
|
308
|
+
async safeDecodeAsync(data, params) {
|
|
309
|
+
return parse.safeDecodeAsync(this, data, params);
|
|
310
|
+
},
|
|
311
|
+
toJSONSchema(params) {
|
|
312
|
+
return (0, to_json_schema_js_1.createToJSONSchemaMethod)(this, {})(params);
|
|
313
|
+
},
|
|
314
|
+
// Reads through to the registry on every access, so it must not cache.
|
|
315
|
+
get description() {
|
|
316
|
+
return core.globalRegistry.get(this)?.description;
|
|
317
|
+
},
|
|
318
|
+
// No setter: `schema._def = x` throws, as it did when `_def` was a non-writable own property.
|
|
319
|
+
get _def() {
|
|
320
|
+
return this._zod.def;
|
|
321
|
+
},
|
|
185
322
|
});
|
|
186
323
|
/** @internal */
|
|
187
324
|
exports._ZodString = core.$constructor("_ZodString", (inst, def) => {
|
|
188
325
|
core.$ZodString.init(inst, def);
|
|
189
326
|
exports.ZodType.init(inst, def);
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
inst
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
327
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.stringProcessor(inst, ctx, json, params);
|
|
328
|
+
},
|
|
329
|
+
/*@__PURE__*/ index_js_1.util.derived({
|
|
330
|
+
format: (inst) => processors.aggregateChecks(inst).format ?? null,
|
|
331
|
+
minLength: (inst) => processors.aggregateChecks(inst).minimum ?? null,
|
|
332
|
+
maxLength: (inst) => processors.aggregateChecks(inst).maximum ?? null,
|
|
333
|
+
}, {
|
|
334
|
+
regex(...args) {
|
|
335
|
+
return this.check(checks.regex(...args));
|
|
336
|
+
},
|
|
337
|
+
includes(...args) {
|
|
338
|
+
return this.check(checks.includes(...args));
|
|
339
|
+
},
|
|
340
|
+
startsWith(...args) {
|
|
341
|
+
return this.check(checks.startsWith(...args));
|
|
342
|
+
},
|
|
343
|
+
endsWith(...args) {
|
|
344
|
+
return this.check(checks.endsWith(...args));
|
|
345
|
+
},
|
|
346
|
+
min(...args) {
|
|
347
|
+
return this.check(checks.minLength(...args));
|
|
348
|
+
},
|
|
349
|
+
max(...args) {
|
|
350
|
+
return this.check(checks.maxLength(...args));
|
|
351
|
+
},
|
|
352
|
+
length(...args) {
|
|
353
|
+
return this.check(checks.length(...args));
|
|
354
|
+
},
|
|
355
|
+
nonempty(...args) {
|
|
356
|
+
return this.check(checks.minLength(1, ...args));
|
|
357
|
+
},
|
|
358
|
+
lowercase(params) {
|
|
359
|
+
return this.check(checks.lowercase(params));
|
|
360
|
+
},
|
|
361
|
+
uppercase(params) {
|
|
362
|
+
return this.check(checks.uppercase(params));
|
|
363
|
+
},
|
|
364
|
+
trim() {
|
|
365
|
+
return this.check(checks.trim());
|
|
366
|
+
},
|
|
367
|
+
normalize(...args) {
|
|
368
|
+
return this.check(checks.normalize(...args));
|
|
369
|
+
},
|
|
370
|
+
toLowerCase() {
|
|
371
|
+
return this.check(checks.toLowerCase());
|
|
372
|
+
},
|
|
373
|
+
toUpperCase() {
|
|
374
|
+
return this.check(checks.toUpperCase());
|
|
375
|
+
},
|
|
376
|
+
slugify() {
|
|
377
|
+
return this.check(checks.slugify());
|
|
378
|
+
},
|
|
379
|
+
}));
|
|
211
380
|
exports.ZodString = core.$constructor("ZodString", (inst, def) => {
|
|
212
381
|
core.$ZodString.init(inst, def);
|
|
213
382
|
exports._ZodString.init(inst, def);
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
383
|
+
}, {
|
|
384
|
+
email(params) {
|
|
385
|
+
return this.check(core._email(exports.ZodEmail, params));
|
|
386
|
+
},
|
|
387
|
+
url(params) {
|
|
388
|
+
return this.check(core._url(exports.ZodURL, params));
|
|
389
|
+
},
|
|
390
|
+
jwt(params) {
|
|
391
|
+
return this.check(core._jwt(exports.ZodJWT, params));
|
|
392
|
+
},
|
|
393
|
+
emoji(params) {
|
|
394
|
+
return this.check(core._emoji(exports.ZodEmoji, params));
|
|
395
|
+
},
|
|
396
|
+
guid(params) {
|
|
397
|
+
return this.check(core._guid(exports.ZodGUID, params));
|
|
398
|
+
},
|
|
399
|
+
uuid(params) {
|
|
400
|
+
return this.check(core._uuid(exports.ZodUUID, params));
|
|
401
|
+
},
|
|
402
|
+
uuidv4(params) {
|
|
403
|
+
return this.check(core._uuidv4(exports.ZodUUID, params));
|
|
404
|
+
},
|
|
405
|
+
uuidv6(params) {
|
|
406
|
+
return this.check(core._uuidv6(exports.ZodUUID, params));
|
|
407
|
+
},
|
|
408
|
+
uuidv7(params) {
|
|
409
|
+
return this.check(core._uuidv7(exports.ZodUUID, params));
|
|
410
|
+
},
|
|
411
|
+
nanoid(params) {
|
|
412
|
+
return this.check(core._nanoid(exports.ZodNanoID, params));
|
|
413
|
+
},
|
|
414
|
+
cuid(params) {
|
|
415
|
+
return this.check(core._cuid(exports.ZodCUID, params));
|
|
416
|
+
},
|
|
417
|
+
cuid2(params) {
|
|
418
|
+
return this.check(core._cuid2(exports.ZodCUID2, params));
|
|
419
|
+
},
|
|
420
|
+
ulid(params) {
|
|
421
|
+
return this.check(core._ulid(exports.ZodULID, params));
|
|
422
|
+
},
|
|
423
|
+
base64(params) {
|
|
424
|
+
return this.check(core._base64(exports.ZodBase64, params));
|
|
425
|
+
},
|
|
426
|
+
base64url(params) {
|
|
427
|
+
return this.check(core._base64url(exports.ZodBase64URL, params));
|
|
428
|
+
},
|
|
429
|
+
xid(params) {
|
|
430
|
+
return this.check(core._xid(exports.ZodXID, params));
|
|
431
|
+
},
|
|
432
|
+
ksuid(params) {
|
|
433
|
+
return this.check(core._ksuid(exports.ZodKSUID, params));
|
|
434
|
+
},
|
|
435
|
+
ipv4(params) {
|
|
436
|
+
return this.check(core._ipv4(exports.ZodIPv4, params));
|
|
437
|
+
},
|
|
438
|
+
ipv6(params) {
|
|
439
|
+
return this.check(core._ipv6(exports.ZodIPv6, params));
|
|
440
|
+
},
|
|
441
|
+
cidrv4(params) {
|
|
442
|
+
return this.check(core._cidrv4(exports.ZodCIDRv4, params));
|
|
443
|
+
},
|
|
444
|
+
cidrv6(params) {
|
|
445
|
+
return this.check(core._cidrv6(exports.ZodCIDRv6, params));
|
|
446
|
+
},
|
|
447
|
+
e164(params) {
|
|
448
|
+
return this.check(core._e164(exports.ZodE164, params));
|
|
449
|
+
},
|
|
450
|
+
datetime(params) {
|
|
451
|
+
return this.check(core._isoDateTime(exports.ZodISODateTime, params));
|
|
452
|
+
},
|
|
453
|
+
date(params) {
|
|
454
|
+
return this.check(core._isoDate(exports.ZodISODate, params));
|
|
455
|
+
},
|
|
456
|
+
time(params) {
|
|
457
|
+
return this.check(core._isoTime(exports.ZodISOTime, params));
|
|
458
|
+
},
|
|
459
|
+
duration(params) {
|
|
460
|
+
return this.check(core._isoDuration(exports.ZodISODuration, params));
|
|
461
|
+
},
|
|
242
462
|
});
|
|
243
463
|
function string(params) {
|
|
244
464
|
return core._string(exports.ZodString, params);
|
|
@@ -247,6 +467,22 @@ exports.ZodStringFormat = core.$constructor("ZodStringFormat", (inst, def) => {
|
|
|
247
467
|
core.$ZodStringFormat.init(inst, def);
|
|
248
468
|
exports._ZodString.init(inst, def);
|
|
249
469
|
});
|
|
470
|
+
exports.ZodISODateTime = core.$constructor("ZodISODateTime", (inst, def) => {
|
|
471
|
+
core.$ZodISODateTime.init(inst, def);
|
|
472
|
+
exports.ZodStringFormat.init(inst, def);
|
|
473
|
+
});
|
|
474
|
+
exports.ZodISODate = core.$constructor("ZodISODate", (inst, def) => {
|
|
475
|
+
core.$ZodISODate.init(inst, def);
|
|
476
|
+
exports.ZodStringFormat.init(inst, def);
|
|
477
|
+
});
|
|
478
|
+
exports.ZodISOTime = core.$constructor("ZodISOTime", (inst, def) => {
|
|
479
|
+
core.$ZodISOTime.init(inst, def);
|
|
480
|
+
exports.ZodStringFormat.init(inst, def);
|
|
481
|
+
});
|
|
482
|
+
exports.ZodISODuration = core.$constructor("ZodISODuration", (inst, def) => {
|
|
483
|
+
core.$ZodISODuration.init(inst, def);
|
|
484
|
+
exports.ZodStringFormat.init(inst, def);
|
|
485
|
+
});
|
|
250
486
|
exports.ZodEmail = core.$constructor("ZodEmail", (inst, def) => {
|
|
251
487
|
// ZodStringFormat.init(inst, def);
|
|
252
488
|
core.$ZodEmail.init(inst, def);
|
|
@@ -290,6 +526,13 @@ exports.ZodURL = core.$constructor("ZodURL", (inst, def) => {
|
|
|
290
526
|
function url(params) {
|
|
291
527
|
return core._url(exports.ZodURL, params);
|
|
292
528
|
}
|
|
529
|
+
function httpUrl(params) {
|
|
530
|
+
return core._url(exports.ZodURL, {
|
|
531
|
+
protocol: regexes.httpProtocol,
|
|
532
|
+
hostname: regexes.domain,
|
|
533
|
+
...index_js_1.util.normalizeParams(params),
|
|
534
|
+
});
|
|
535
|
+
}
|
|
293
536
|
exports.ZodEmoji = core.$constructor("ZodEmoji", (inst, def) => {
|
|
294
537
|
// ZodStringFormat.init(inst, def);
|
|
295
538
|
core.$ZodEmoji.init(inst, def);
|
|
@@ -306,11 +549,23 @@ exports.ZodNanoID = core.$constructor("ZodNanoID", (inst, def) => {
|
|
|
306
549
|
function nanoid(params) {
|
|
307
550
|
return core._nanoid(exports.ZodNanoID, params);
|
|
308
551
|
}
|
|
552
|
+
/**
|
|
553
|
+
* @deprecated CUID v1 is deprecated by its authors due to information leakage
|
|
554
|
+
* (timestamps embedded in the id). Use {@link ZodCUID2} instead.
|
|
555
|
+
* See https://github.com/paralleldrive/cuid.
|
|
556
|
+
*/
|
|
309
557
|
exports.ZodCUID = core.$constructor("ZodCUID", (inst, def) => {
|
|
310
558
|
// ZodStringFormat.init(inst, def);
|
|
311
559
|
core.$ZodCUID.init(inst, def);
|
|
312
560
|
exports.ZodStringFormat.init(inst, def);
|
|
313
561
|
});
|
|
562
|
+
/**
|
|
563
|
+
* Validates a CUID v1 string.
|
|
564
|
+
*
|
|
565
|
+
* @deprecated CUID v1 is deprecated by its authors due to information leakage
|
|
566
|
+
* (timestamps embedded in the id). Use {@link cuid2 | `z.cuid2()`} instead.
|
|
567
|
+
* See https://github.com/paralleldrive/cuid.
|
|
568
|
+
*/
|
|
314
569
|
function cuid(params) {
|
|
315
570
|
return core._cuid(exports.ZodCUID, params);
|
|
316
571
|
}
|
|
@@ -354,6 +609,14 @@ exports.ZodIPv4 = core.$constructor("ZodIPv4", (inst, def) => {
|
|
|
354
609
|
function ipv4(params) {
|
|
355
610
|
return core._ipv4(exports.ZodIPv4, params);
|
|
356
611
|
}
|
|
612
|
+
exports.ZodMAC = core.$constructor("ZodMAC", (inst, def) => {
|
|
613
|
+
// ZodStringFormat.init(inst, def);
|
|
614
|
+
core.$ZodMAC.init(inst, def);
|
|
615
|
+
exports.ZodStringFormat.init(inst, def);
|
|
616
|
+
});
|
|
617
|
+
function mac(params) {
|
|
618
|
+
return core._mac(exports.ZodMAC, params);
|
|
619
|
+
}
|
|
357
620
|
exports.ZodIPv6 = core.$constructor("ZodIPv6", (inst, def) => {
|
|
358
621
|
// ZodStringFormat.init(inst, def);
|
|
359
622
|
core.$ZodIPv6.init(inst, def);
|
|
@@ -400,6 +663,20 @@ exports.ZodE164 = core.$constructor("ZodE164", (inst, def) => {
|
|
|
400
663
|
function e164(params) {
|
|
401
664
|
return core._e164(exports.ZodE164, params);
|
|
402
665
|
}
|
|
666
|
+
exports.ZodCreditCard = core.$constructor("ZodCreditCard", (inst, def) => {
|
|
667
|
+
core.$ZodCreditCard.init(inst, def);
|
|
668
|
+
exports.ZodStringFormat.init(inst, def);
|
|
669
|
+
});
|
|
670
|
+
function creditCard(params) {
|
|
671
|
+
return core._creditCard(exports.ZodCreditCard, params);
|
|
672
|
+
}
|
|
673
|
+
exports.ZodIBAN = core.$constructor("ZodIBAN", (inst, def) => {
|
|
674
|
+
core.$ZodIBAN.init(inst, def);
|
|
675
|
+
exports.ZodStringFormat.init(inst, def);
|
|
676
|
+
});
|
|
677
|
+
function iban(params) {
|
|
678
|
+
return core._iban(exports.ZodIBAN, params);
|
|
679
|
+
}
|
|
403
680
|
exports.ZodJWT = core.$constructor("ZodJWT", (inst, def) => {
|
|
404
681
|
// ZodStringFormat.init(inst, def);
|
|
405
682
|
core.$ZodJWT.init(inst, def);
|
|
@@ -416,34 +693,90 @@ exports.ZodCustomStringFormat = core.$constructor("ZodCustomStringFormat", (inst
|
|
|
416
693
|
function stringFormat(format, fnOrRegex, _params = {}) {
|
|
417
694
|
return core._stringFormat(exports.ZodCustomStringFormat, format, fnOrRegex, _params);
|
|
418
695
|
}
|
|
696
|
+
function hostname(_params) {
|
|
697
|
+
return core._stringFormat(exports.ZodCustomStringFormat, "hostname", regexes.hostname, _params);
|
|
698
|
+
}
|
|
699
|
+
function hex(_params) {
|
|
700
|
+
return core._stringFormat(exports.ZodCustomStringFormat, "hex", regexes.hex, _params);
|
|
701
|
+
}
|
|
702
|
+
function currencyCode(_params) {
|
|
703
|
+
return core._stringFormat(exports.ZodCustomStringFormat, "currency_code", regexes.currencyCode, _params);
|
|
704
|
+
}
|
|
705
|
+
function hash(alg, params) {
|
|
706
|
+
const enc = params?.enc ?? "hex";
|
|
707
|
+
const format = `${alg}_${enc}`;
|
|
708
|
+
const regex = core.regexes[format];
|
|
709
|
+
if (!regex)
|
|
710
|
+
throw new Error(`Unrecognized hash format: ${format}`);
|
|
711
|
+
return core._stringFormat(exports.ZodCustomStringFormat, format, regex, params);
|
|
712
|
+
}
|
|
419
713
|
exports.ZodNumber = core.$constructor("ZodNumber", (inst, def) => {
|
|
420
714
|
core.$ZodNumber.init(inst, def);
|
|
421
715
|
exports.ZodType.init(inst, def);
|
|
422
|
-
inst.
|
|
423
|
-
inst.gte = (value, params) => inst.check(checks.gte(value, params));
|
|
424
|
-
inst.min = (value, params) => inst.check(checks.gte(value, params));
|
|
425
|
-
inst.lt = (value, params) => inst.check(checks.lt(value, params));
|
|
426
|
-
inst.lte = (value, params) => inst.check(checks.lte(value, params));
|
|
427
|
-
inst.max = (value, params) => inst.check(checks.lte(value, params));
|
|
428
|
-
inst.int = (params) => inst.check(int(params));
|
|
429
|
-
inst.safe = (params) => inst.check(int(params));
|
|
430
|
-
inst.positive = (params) => inst.check(checks.gt(0, params));
|
|
431
|
-
inst.nonnegative = (params) => inst.check(checks.gte(0, params));
|
|
432
|
-
inst.negative = (params) => inst.check(checks.lt(0, params));
|
|
433
|
-
inst.nonpositive = (params) => inst.check(checks.lte(0, params));
|
|
434
|
-
inst.multipleOf = (value, params) => inst.check(checks.multipleOf(value, params));
|
|
435
|
-
inst.step = (value, params) => inst.check(checks.multipleOf(value, params));
|
|
436
|
-
// inst.finite = (params) => inst.check(core.finite(params));
|
|
437
|
-
inst.finite = () => inst;
|
|
438
|
-
const bag = inst._zod.bag;
|
|
439
|
-
inst.minValue =
|
|
440
|
-
Math.max(bag.minimum ?? Number.NEGATIVE_INFINITY, bag.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null;
|
|
441
|
-
inst.maxValue =
|
|
442
|
-
Math.min(bag.maximum ?? Number.POSITIVE_INFINITY, bag.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null;
|
|
443
|
-
inst.isInt = (bag.format ?? "").includes("int") || Number.isSafeInteger(bag.multipleOf ?? 0.5);
|
|
716
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.numberProcessor(inst, ctx, json, params);
|
|
444
717
|
inst.isFinite = true;
|
|
445
|
-
|
|
446
|
-
|
|
718
|
+
},
|
|
719
|
+
/*@__PURE__*/ index_js_1.util.derived({
|
|
720
|
+
minValue: (inst) => {
|
|
721
|
+
const { minimum, exclusiveMinimum } = processors.aggregateChecks(inst);
|
|
722
|
+
return Math.max(minimum ?? Number.NEGATIVE_INFINITY, exclusiveMinimum ?? Number.NEGATIVE_INFINITY);
|
|
723
|
+
},
|
|
724
|
+
maxValue: (inst) => {
|
|
725
|
+
const { maximum, exclusiveMaximum } = processors.aggregateChecks(inst);
|
|
726
|
+
return Math.min(maximum ?? Number.POSITIVE_INFINITY, exclusiveMaximum ?? Number.POSITIVE_INFINITY);
|
|
727
|
+
},
|
|
728
|
+
isInt: (inst) => {
|
|
729
|
+
const { isInt, multipleOf } = processors.aggregateChecks(inst);
|
|
730
|
+
return !!isInt || !!multipleOf?.some(Number.isSafeInteger);
|
|
731
|
+
},
|
|
732
|
+
format: (inst) => processors.aggregateChecks(inst).format ?? null,
|
|
733
|
+
}, {
|
|
734
|
+
gt(value, params) {
|
|
735
|
+
return this.check(checks.gt(value, params));
|
|
736
|
+
},
|
|
737
|
+
gte(value, params) {
|
|
738
|
+
return this.check(checks.gte(value, params));
|
|
739
|
+
},
|
|
740
|
+
min(value, params) {
|
|
741
|
+
return this.check(checks.gte(value, params));
|
|
742
|
+
},
|
|
743
|
+
lt(value, params) {
|
|
744
|
+
return this.check(checks.lt(value, params));
|
|
745
|
+
},
|
|
746
|
+
lte(value, params) {
|
|
747
|
+
return this.check(checks.lte(value, params));
|
|
748
|
+
},
|
|
749
|
+
max(value, params) {
|
|
750
|
+
return this.check(checks.lte(value, params));
|
|
751
|
+
},
|
|
752
|
+
int(params) {
|
|
753
|
+
return this.check(int(params));
|
|
754
|
+
},
|
|
755
|
+
safe(params) {
|
|
756
|
+
return this.check(int(params));
|
|
757
|
+
},
|
|
758
|
+
positive(params) {
|
|
759
|
+
return this.check(checks.gt(0, params));
|
|
760
|
+
},
|
|
761
|
+
nonnegative(params) {
|
|
762
|
+
return this.check(checks.gte(0, params));
|
|
763
|
+
},
|
|
764
|
+
negative(params) {
|
|
765
|
+
return this.check(checks.lt(0, params));
|
|
766
|
+
},
|
|
767
|
+
nonpositive(params) {
|
|
768
|
+
return this.check(checks.lte(0, params));
|
|
769
|
+
},
|
|
770
|
+
multipleOf(value, params) {
|
|
771
|
+
return this.check(checks.multipleOf(value, params));
|
|
772
|
+
},
|
|
773
|
+
step(value, params) {
|
|
774
|
+
return this.check(checks.multipleOf(value, params));
|
|
775
|
+
},
|
|
776
|
+
finite() {
|
|
777
|
+
return this;
|
|
778
|
+
},
|
|
779
|
+
}));
|
|
447
780
|
function number(params) {
|
|
448
781
|
return core._number(exports.ZodNumber, params);
|
|
449
782
|
}
|
|
@@ -469,6 +802,7 @@ function uint32(params) {
|
|
|
469
802
|
exports.ZodBoolean = core.$constructor("ZodBoolean", (inst, def) => {
|
|
470
803
|
core.$ZodBoolean.init(inst, def);
|
|
471
804
|
exports.ZodType.init(inst, def);
|
|
805
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.booleanProcessor(inst, ctx, json, params);
|
|
472
806
|
});
|
|
473
807
|
function boolean(params) {
|
|
474
808
|
return core._boolean(exports.ZodBoolean, params);
|
|
@@ -476,24 +810,47 @@ function boolean(params) {
|
|
|
476
810
|
exports.ZodBigInt = core.$constructor("ZodBigInt", (inst, def) => {
|
|
477
811
|
core.$ZodBigInt.init(inst, def);
|
|
478
812
|
exports.ZodType.init(inst, def);
|
|
479
|
-
inst.
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
813
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.bigintProcessor(inst, ctx, json, params);
|
|
814
|
+
},
|
|
815
|
+
/*@__PURE__*/ index_js_1.util.derived({
|
|
816
|
+
minValue: (inst) => processors.aggregateChecks(inst).minimum ?? null,
|
|
817
|
+
maxValue: (inst) => processors.aggregateChecks(inst).maximum ?? null,
|
|
818
|
+
format: (inst) => processors.aggregateChecks(inst).format ?? null,
|
|
819
|
+
}, {
|
|
820
|
+
gte(value, params) {
|
|
821
|
+
return this.check(checks.gte(value, params));
|
|
822
|
+
},
|
|
823
|
+
min(value, params) {
|
|
824
|
+
return this.check(checks.gte(value, params));
|
|
825
|
+
},
|
|
826
|
+
gt(value, params) {
|
|
827
|
+
return this.check(checks.gt(value, params));
|
|
828
|
+
},
|
|
829
|
+
lt(value, params) {
|
|
830
|
+
return this.check(checks.lt(value, params));
|
|
831
|
+
},
|
|
832
|
+
lte(value, params) {
|
|
833
|
+
return this.check(checks.lte(value, params));
|
|
834
|
+
},
|
|
835
|
+
max(value, params) {
|
|
836
|
+
return this.check(checks.lte(value, params));
|
|
837
|
+
},
|
|
838
|
+
positive(params) {
|
|
839
|
+
return this.check(checks.gt(BigInt(0), params));
|
|
840
|
+
},
|
|
841
|
+
negative(params) {
|
|
842
|
+
return this.check(checks.lt(BigInt(0), params));
|
|
843
|
+
},
|
|
844
|
+
nonpositive(params) {
|
|
845
|
+
return this.check(checks.lte(BigInt(0), params));
|
|
846
|
+
},
|
|
847
|
+
nonnegative(params) {
|
|
848
|
+
return this.check(checks.gte(BigInt(0), params));
|
|
849
|
+
},
|
|
850
|
+
multipleOf(value, params) {
|
|
851
|
+
return this.check(checks.multipleOf(value, params));
|
|
852
|
+
},
|
|
853
|
+
}));
|
|
497
854
|
function bigint(params) {
|
|
498
855
|
return core._bigint(exports.ZodBigInt, params);
|
|
499
856
|
}
|
|
@@ -501,17 +858,16 @@ exports.ZodBigIntFormat = core.$constructor("ZodBigIntFormat", (inst, def) => {
|
|
|
501
858
|
core.$ZodBigIntFormat.init(inst, def);
|
|
502
859
|
exports.ZodBigInt.init(inst, def);
|
|
503
860
|
});
|
|
504
|
-
// int64
|
|
505
861
|
function int64(params) {
|
|
506
862
|
return core._int64(exports.ZodBigIntFormat, params);
|
|
507
863
|
}
|
|
508
|
-
// uint64
|
|
509
864
|
function uint64(params) {
|
|
510
865
|
return core._uint64(exports.ZodBigIntFormat, params);
|
|
511
866
|
}
|
|
512
867
|
exports.ZodSymbol = core.$constructor("ZodSymbol", (inst, def) => {
|
|
513
868
|
core.$ZodSymbol.init(inst, def);
|
|
514
869
|
exports.ZodType.init(inst, def);
|
|
870
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.symbolProcessor(inst, ctx, json, params);
|
|
515
871
|
});
|
|
516
872
|
function symbol(params) {
|
|
517
873
|
return core._symbol(exports.ZodSymbol, params);
|
|
@@ -519,6 +875,7 @@ function symbol(params) {
|
|
|
519
875
|
exports.ZodUndefined = core.$constructor("ZodUndefined", (inst, def) => {
|
|
520
876
|
core.$ZodUndefined.init(inst, def);
|
|
521
877
|
exports.ZodType.init(inst, def);
|
|
878
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.undefinedProcessor(inst, ctx, json, params);
|
|
522
879
|
});
|
|
523
880
|
function _undefined(params) {
|
|
524
881
|
return core._undefined(exports.ZodUndefined, params);
|
|
@@ -526,6 +883,7 @@ function _undefined(params) {
|
|
|
526
883
|
exports.ZodNull = core.$constructor("ZodNull", (inst, def) => {
|
|
527
884
|
core.$ZodNull.init(inst, def);
|
|
528
885
|
exports.ZodType.init(inst, def);
|
|
886
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.nullProcessor(inst, ctx, json, params);
|
|
529
887
|
});
|
|
530
888
|
function _null(params) {
|
|
531
889
|
return core._null(exports.ZodNull, params);
|
|
@@ -533,6 +891,7 @@ function _null(params) {
|
|
|
533
891
|
exports.ZodAny = core.$constructor("ZodAny", (inst, def) => {
|
|
534
892
|
core.$ZodAny.init(inst, def);
|
|
535
893
|
exports.ZodType.init(inst, def);
|
|
894
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.anyProcessor(inst, ctx, json, params);
|
|
536
895
|
});
|
|
537
896
|
function any() {
|
|
538
897
|
return core._any(exports.ZodAny);
|
|
@@ -540,6 +899,7 @@ function any() {
|
|
|
540
899
|
exports.ZodUnknown = core.$constructor("ZodUnknown", (inst, def) => {
|
|
541
900
|
core.$ZodUnknown.init(inst, def);
|
|
542
901
|
exports.ZodType.init(inst, def);
|
|
902
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.unknownProcessor(inst, ctx, json, params);
|
|
543
903
|
});
|
|
544
904
|
function unknown() {
|
|
545
905
|
return core._unknown(exports.ZodUnknown);
|
|
@@ -547,6 +907,7 @@ function unknown() {
|
|
|
547
907
|
exports.ZodNever = core.$constructor("ZodNever", (inst, def) => {
|
|
548
908
|
core.$ZodNever.init(inst, def);
|
|
549
909
|
exports.ZodType.init(inst, def);
|
|
910
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.neverProcessor(inst, ctx, json, params);
|
|
550
911
|
});
|
|
551
912
|
function never(params) {
|
|
552
913
|
return core._never(exports.ZodNever, params);
|
|
@@ -554,6 +915,7 @@ function never(params) {
|
|
|
554
915
|
exports.ZodVoid = core.$constructor("ZodVoid", (inst, def) => {
|
|
555
916
|
core.$ZodVoid.init(inst, def);
|
|
556
917
|
exports.ZodType.init(inst, def);
|
|
918
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.voidProcessor(inst, ctx, json, params);
|
|
557
919
|
});
|
|
558
920
|
function _void(params) {
|
|
559
921
|
return core._void(exports.ZodVoid, params);
|
|
@@ -561,24 +923,45 @@ function _void(params) {
|
|
|
561
923
|
exports.ZodDate = core.$constructor("ZodDate", (inst, def) => {
|
|
562
924
|
core.$ZodDate.init(inst, def);
|
|
563
925
|
exports.ZodType.init(inst, def);
|
|
926
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.dateProcessor(inst, ctx, json, params);
|
|
564
927
|
inst.min = (value, params) => inst.check(checks.gte(value, params));
|
|
565
928
|
inst.max = (value, params) => inst.check(checks.lte(value, params));
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
});
|
|
929
|
+
},
|
|
930
|
+
/*@__PURE__*/ index_js_1.util.derived({
|
|
931
|
+
minDate: (inst) => {
|
|
932
|
+
const { minimum } = processors.aggregateChecks(inst);
|
|
933
|
+
return minimum ? new Date(minimum) : null;
|
|
934
|
+
},
|
|
935
|
+
maxDate: (inst) => {
|
|
936
|
+
const { maximum } = processors.aggregateChecks(inst);
|
|
937
|
+
return maximum ? new Date(maximum) : null;
|
|
938
|
+
},
|
|
939
|
+
}, {}));
|
|
570
940
|
function date(params) {
|
|
571
941
|
return core._date(exports.ZodDate, params);
|
|
572
942
|
}
|
|
573
943
|
exports.ZodArray = core.$constructor("ZodArray", (inst, def) => {
|
|
944
|
+
_ensureDefaultMemoizer();
|
|
574
945
|
core.$ZodArray.init(inst, def);
|
|
575
946
|
exports.ZodType.init(inst, def);
|
|
947
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.arrayProcessor(inst, ctx, json, params);
|
|
576
948
|
inst.element = def.element;
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
949
|
+
}, {
|
|
950
|
+
min(n, params) {
|
|
951
|
+
return this.check(checks.minLength(n, params));
|
|
952
|
+
},
|
|
953
|
+
nonempty(params) {
|
|
954
|
+
return this.check(checks.minLength(1, params));
|
|
955
|
+
},
|
|
956
|
+
max(n, params) {
|
|
957
|
+
return this.check(checks.maxLength(n, params));
|
|
958
|
+
},
|
|
959
|
+
length(n, params) {
|
|
960
|
+
return this.check(checks.length(n, params));
|
|
961
|
+
},
|
|
962
|
+
unwrap() {
|
|
963
|
+
return this.element;
|
|
964
|
+
},
|
|
582
965
|
});
|
|
583
966
|
function array(element, params) {
|
|
584
967
|
return core._array(exports.ZodArray, element, params);
|
|
@@ -586,35 +969,63 @@ function array(element, params) {
|
|
|
586
969
|
// .keyof
|
|
587
970
|
function keyof(schema) {
|
|
588
971
|
const shape = schema._zod.def.shape;
|
|
589
|
-
return
|
|
972
|
+
return _enum(Object.keys(shape));
|
|
590
973
|
}
|
|
591
974
|
exports.ZodObject = core.$constructor("ZodObject", (inst, def) => {
|
|
592
|
-
|
|
975
|
+
_ensureDefaultMemoizer();
|
|
976
|
+
core.$ZodObjectJIT.init(inst, def);
|
|
593
977
|
exports.ZodType.init(inst, def);
|
|
594
|
-
|
|
595
|
-
inst
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
978
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.objectProcessor(inst, ctx, json, params);
|
|
979
|
+
index_js_1.util.installLazyProp(inst, "shape", (self) => self._zod.def.shape, false);
|
|
980
|
+
}, {
|
|
981
|
+
keyof() {
|
|
982
|
+
return _enum(Object.keys(this._zod.def.shape));
|
|
983
|
+
},
|
|
984
|
+
catchall(catchall) {
|
|
985
|
+
// `mergeDefs` rather than a spread: spreading reads `shape`, and resolving it can mint a whole fresh subtree
|
|
986
|
+
return this.clone(index_js_1.util.mergeDefs(this._zod.def, { catchall: catchall }));
|
|
987
|
+
},
|
|
988
|
+
passthrough() {
|
|
989
|
+
return this.clone(index_js_1.util.mergeDefs(this._zod.def, { catchall: unknown() }));
|
|
990
|
+
},
|
|
991
|
+
loose() {
|
|
992
|
+
return this.clone(index_js_1.util.mergeDefs(this._zod.def, { catchall: unknown() }));
|
|
993
|
+
},
|
|
994
|
+
strict() {
|
|
995
|
+
return this.clone(index_js_1.util.mergeDefs(this._zod.def, { catchall: never() }));
|
|
996
|
+
},
|
|
997
|
+
strip() {
|
|
998
|
+
return this.clone(index_js_1.util.mergeDefs(this._zod.def, { catchall: undefined }));
|
|
999
|
+
},
|
|
1000
|
+
extend(incoming) {
|
|
1001
|
+
return index_js_1.util.extend(this, incoming);
|
|
1002
|
+
},
|
|
1003
|
+
safeExtend(incoming) {
|
|
1004
|
+
return index_js_1.util.safeExtend(this, incoming);
|
|
1005
|
+
},
|
|
1006
|
+
merge(other) {
|
|
1007
|
+
return index_js_1.util.merge(this, other);
|
|
1008
|
+
},
|
|
1009
|
+
pick(mask) {
|
|
1010
|
+
return index_js_1.util.pick(this, mask);
|
|
1011
|
+
},
|
|
1012
|
+
omit(mask) {
|
|
1013
|
+
return index_js_1.util.omit(this, mask);
|
|
1014
|
+
},
|
|
1015
|
+
partial(...args) {
|
|
1016
|
+
return index_js_1.util.partial(exports.ZodOptional, this, args[0]);
|
|
1017
|
+
},
|
|
1018
|
+
exactPartial(...args) {
|
|
1019
|
+
return index_js_1.util.partial(exports.ZodExactOptional, this, args[0], "exactPartial");
|
|
1020
|
+
},
|
|
1021
|
+
required(...args) {
|
|
1022
|
+
return index_js_1.util.required(exports.ZodNonOptional, this, args[0]);
|
|
1023
|
+
},
|
|
610
1024
|
});
|
|
611
1025
|
function object(shape, params) {
|
|
612
1026
|
const def = {
|
|
613
1027
|
type: "object",
|
|
614
|
-
|
|
615
|
-
index_js_1.util.assignProp(this, "shape", { ...shape });
|
|
616
|
-
return this.shape;
|
|
617
|
-
},
|
|
1028
|
+
shape: shape ?? {},
|
|
618
1029
|
...index_js_1.util.normalizeParams(params),
|
|
619
1030
|
};
|
|
620
1031
|
return new exports.ZodObject(def);
|
|
@@ -623,10 +1034,7 @@ function object(shape, params) {
|
|
|
623
1034
|
function strictObject(shape, params) {
|
|
624
1035
|
return new exports.ZodObject({
|
|
625
1036
|
type: "object",
|
|
626
|
-
|
|
627
|
-
index_js_1.util.assignProp(this, "shape", { ...shape });
|
|
628
|
-
return this.shape;
|
|
629
|
-
},
|
|
1037
|
+
shape,
|
|
630
1038
|
catchall: never(),
|
|
631
1039
|
...index_js_1.util.normalizeParams(params),
|
|
632
1040
|
});
|
|
@@ -635,10 +1043,7 @@ function strictObject(shape, params) {
|
|
|
635
1043
|
function looseObject(shape, params) {
|
|
636
1044
|
return new exports.ZodObject({
|
|
637
1045
|
type: "object",
|
|
638
|
-
|
|
639
|
-
index_js_1.util.assignProp(this, "shape", { ...shape });
|
|
640
|
-
return this.shape;
|
|
641
|
-
},
|
|
1046
|
+
shape,
|
|
642
1047
|
catchall: unknown(),
|
|
643
1048
|
...index_js_1.util.normalizeParams(params),
|
|
644
1049
|
});
|
|
@@ -646,6 +1051,7 @@ function looseObject(shape, params) {
|
|
|
646
1051
|
exports.ZodUnion = core.$constructor("ZodUnion", (inst, def) => {
|
|
647
1052
|
core.$ZodUnion.init(inst, def);
|
|
648
1053
|
exports.ZodType.init(inst, def);
|
|
1054
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.unionProcessor(inst, ctx, json, params);
|
|
649
1055
|
inst.options = def.options;
|
|
650
1056
|
});
|
|
651
1057
|
function union(options, params) {
|
|
@@ -655,6 +1061,23 @@ function union(options, params) {
|
|
|
655
1061
|
...index_js_1.util.normalizeParams(params),
|
|
656
1062
|
});
|
|
657
1063
|
}
|
|
1064
|
+
exports.ZodXor = core.$constructor("ZodXor", (inst, def) => {
|
|
1065
|
+
exports.ZodUnion.init(inst, def);
|
|
1066
|
+
core.$ZodXor.init(inst, def);
|
|
1067
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.unionProcessor(inst, ctx, json, params);
|
|
1068
|
+
inst.options = def.options;
|
|
1069
|
+
});
|
|
1070
|
+
/** Creates an exclusive union (XOR) where exactly one option must match.
|
|
1071
|
+
* Unlike regular unions that succeed when any option matches, xor fails if
|
|
1072
|
+
* zero or more than one option matches the input. */
|
|
1073
|
+
function xor(options, params) {
|
|
1074
|
+
return new exports.ZodXor({
|
|
1075
|
+
type: "union",
|
|
1076
|
+
options: options,
|
|
1077
|
+
inclusive: false,
|
|
1078
|
+
...index_js_1.util.normalizeParams(params),
|
|
1079
|
+
});
|
|
1080
|
+
}
|
|
658
1081
|
exports.ZodDiscriminatedUnion = core.$constructor("ZodDiscriminatedUnion", (inst, def) => {
|
|
659
1082
|
exports.ZodUnion.init(inst, def);
|
|
660
1083
|
core.$ZodDiscriminatedUnion.init(inst, def);
|
|
@@ -663,7 +1086,7 @@ function discriminatedUnion(discriminator, options, params) {
|
|
|
663
1086
|
// const [options, params] = args;
|
|
664
1087
|
return new exports.ZodDiscriminatedUnion({
|
|
665
1088
|
type: "union",
|
|
666
|
-
options,
|
|
1089
|
+
options: options,
|
|
667
1090
|
discriminator,
|
|
668
1091
|
...index_js_1.util.normalizeParams(params),
|
|
669
1092
|
});
|
|
@@ -671,6 +1094,7 @@ function discriminatedUnion(discriminator, options, params) {
|
|
|
671
1094
|
exports.ZodIntersection = core.$constructor("ZodIntersection", (inst, def) => {
|
|
672
1095
|
core.$ZodIntersection.init(inst, def);
|
|
673
1096
|
exports.ZodType.init(inst, def);
|
|
1097
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.intersectionProcessor(inst, ctx, json, params);
|
|
674
1098
|
});
|
|
675
1099
|
function intersection(left, right) {
|
|
676
1100
|
return new exports.ZodIntersection({
|
|
@@ -680,12 +1104,27 @@ function intersection(left, right) {
|
|
|
680
1104
|
});
|
|
681
1105
|
}
|
|
682
1106
|
exports.ZodTuple = core.$constructor("ZodTuple", (inst, def) => {
|
|
1107
|
+
_ensureDefaultMemoizer();
|
|
683
1108
|
core.$ZodTuple.init(inst, def);
|
|
684
1109
|
exports.ZodType.init(inst, def);
|
|
685
|
-
inst.
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
1110
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.tupleProcessor(inst, ctx, json, params);
|
|
1111
|
+
}, {
|
|
1112
|
+
rest(rest) {
|
|
1113
|
+
return this.clone({
|
|
1114
|
+
...this._zod.def,
|
|
1115
|
+
rest: rest,
|
|
1116
|
+
});
|
|
1117
|
+
},
|
|
1118
|
+
partial() {
|
|
1119
|
+
const def = this._zod.def;
|
|
1120
|
+
// a refinement was authored against the full arity; partialing would run it on a shorter array
|
|
1121
|
+
if (def.checks?.length)
|
|
1122
|
+
throw new Error(".partial() cannot be used on tuple schemas containing refinements");
|
|
1123
|
+
return this.clone({
|
|
1124
|
+
...def,
|
|
1125
|
+
items: def.items.map((item) => new exports.ZodOptional({ type: "optional", innerType: item })),
|
|
1126
|
+
});
|
|
1127
|
+
},
|
|
689
1128
|
});
|
|
690
1129
|
function tuple(items, _paramsOrRest, _params) {
|
|
691
1130
|
const hasRest = _paramsOrRest instanceof core.$ZodType;
|
|
@@ -699,12 +1138,23 @@ function tuple(items, _paramsOrRest, _params) {
|
|
|
699
1138
|
});
|
|
700
1139
|
}
|
|
701
1140
|
exports.ZodRecord = core.$constructor("ZodRecord", (inst, def) => {
|
|
1141
|
+
_ensureDefaultMemoizer();
|
|
702
1142
|
core.$ZodRecord.init(inst, def);
|
|
703
1143
|
exports.ZodType.init(inst, def);
|
|
1144
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.recordProcessor(inst, ctx, json, params);
|
|
704
1145
|
inst.keyType = def.keyType;
|
|
705
1146
|
inst.valueType = def.valueType;
|
|
706
1147
|
});
|
|
707
1148
|
function record(keyType, valueType, params) {
|
|
1149
|
+
// v3-compat: z.record(valueType, params?) — defaults keyType to z.string()
|
|
1150
|
+
if (!valueType || !valueType._zod) {
|
|
1151
|
+
return new exports.ZodRecord({
|
|
1152
|
+
type: "record",
|
|
1153
|
+
keyType: string(),
|
|
1154
|
+
valueType: keyType,
|
|
1155
|
+
...index_js_1.util.normalizeParams(valueType),
|
|
1156
|
+
});
|
|
1157
|
+
}
|
|
708
1158
|
return new exports.ZodRecord({
|
|
709
1159
|
type: "record",
|
|
710
1160
|
keyType,
|
|
@@ -716,16 +1166,32 @@ function record(keyType, valueType, params) {
|
|
|
716
1166
|
function partialRecord(keyType, valueType, params) {
|
|
717
1167
|
return new exports.ZodRecord({
|
|
718
1168
|
type: "record",
|
|
719
|
-
keyType
|
|
1169
|
+
keyType,
|
|
1170
|
+
valueType: valueType,
|
|
1171
|
+
...index_js_1.util.normalizeParams(params),
|
|
1172
|
+
partial: true,
|
|
1173
|
+
});
|
|
1174
|
+
}
|
|
1175
|
+
function looseRecord(keyType, valueType, params) {
|
|
1176
|
+
return new exports.ZodRecord({
|
|
1177
|
+
type: "record",
|
|
1178
|
+
keyType,
|
|
720
1179
|
valueType: valueType,
|
|
1180
|
+
mode: "loose",
|
|
721
1181
|
...index_js_1.util.normalizeParams(params),
|
|
722
1182
|
});
|
|
723
1183
|
}
|
|
724
1184
|
exports.ZodMap = core.$constructor("ZodMap", (inst, def) => {
|
|
1185
|
+
_ensureDefaultMemoizer();
|
|
725
1186
|
core.$ZodMap.init(inst, def);
|
|
726
1187
|
exports.ZodType.init(inst, def);
|
|
1188
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.mapProcessor(inst, ctx, json, params);
|
|
727
1189
|
inst.keyType = def.keyType;
|
|
728
1190
|
inst.valueType = def.valueType;
|
|
1191
|
+
inst.min = (...args) => inst.check(core._minSize(...args));
|
|
1192
|
+
inst.nonempty = (params) => inst.check(core._minSize(1, params));
|
|
1193
|
+
inst.max = (...args) => inst.check(core._maxSize(...args));
|
|
1194
|
+
inst.size = (...args) => inst.check(core._size(...args));
|
|
729
1195
|
});
|
|
730
1196
|
function map(keyType, valueType, params) {
|
|
731
1197
|
return new exports.ZodMap({
|
|
@@ -736,8 +1202,10 @@ function map(keyType, valueType, params) {
|
|
|
736
1202
|
});
|
|
737
1203
|
}
|
|
738
1204
|
exports.ZodSet = core.$constructor("ZodSet", (inst, def) => {
|
|
1205
|
+
_ensureDefaultMemoizer();
|
|
739
1206
|
core.$ZodSet.init(inst, def);
|
|
740
1207
|
exports.ZodType.init(inst, def);
|
|
1208
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.setProcessor(inst, ctx, json, params);
|
|
741
1209
|
inst.min = (...args) => inst.check(core._minSize(...args));
|
|
742
1210
|
inst.nonempty = (params) => inst.check(core._minSize(1, params));
|
|
743
1211
|
inst.max = (...args) => inst.check(core._maxSize(...args));
|
|
@@ -753,8 +1221,10 @@ function set(valueType, params) {
|
|
|
753
1221
|
exports.ZodEnum = core.$constructor("ZodEnum", (inst, def) => {
|
|
754
1222
|
core.$ZodEnum.init(inst, def);
|
|
755
1223
|
exports.ZodType.init(inst, def);
|
|
1224
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.enumProcessor(inst, ctx, json, params);
|
|
756
1225
|
inst.enum = def.entries;
|
|
757
|
-
|
|
1226
|
+
// reuse the parsed value set so a numeric TS enum's reverse-mapping keys stay out
|
|
1227
|
+
inst.options = [...inst._zod.values];
|
|
758
1228
|
const keys = new Set(Object.keys(def.entries));
|
|
759
1229
|
inst.extract = (values, params) => {
|
|
760
1230
|
const newEntries = {};
|
|
@@ -814,6 +1284,7 @@ function nativeEnum(entries, params) {
|
|
|
814
1284
|
exports.ZodLiteral = core.$constructor("ZodLiteral", (inst, def) => {
|
|
815
1285
|
core.$ZodLiteral.init(inst, def);
|
|
816
1286
|
exports.ZodType.init(inst, def);
|
|
1287
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.literalProcessor(inst, ctx, json, params);
|
|
817
1288
|
inst.values = new Set(def.values);
|
|
818
1289
|
Object.defineProperty(inst, "value", {
|
|
819
1290
|
get() {
|
|
@@ -834,6 +1305,7 @@ function literal(value, params) {
|
|
|
834
1305
|
exports.ZodFile = core.$constructor("ZodFile", (inst, def) => {
|
|
835
1306
|
core.$ZodFile.init(inst, def);
|
|
836
1307
|
exports.ZodType.init(inst, def);
|
|
1308
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.fileProcessor(inst, ctx, json, params);
|
|
837
1309
|
inst.min = (size, params) => inst.check(core._minSize(size, params));
|
|
838
1310
|
inst.max = (size, params) => inst.check(core._maxSize(size, params));
|
|
839
1311
|
inst.mime = (types, params) => inst.check(core._mime(Array.isArray(types) ? types : [types], params));
|
|
@@ -842,9 +1314,14 @@ function file(params) {
|
|
|
842
1314
|
return core._file(exports.ZodFile, params);
|
|
843
1315
|
}
|
|
844
1316
|
exports.ZodTransform = core.$constructor("ZodTransform", (inst, def) => {
|
|
1317
|
+
_ensureDefaultMemoizer();
|
|
845
1318
|
core.$ZodTransform.init(inst, def);
|
|
846
1319
|
exports.ZodType.init(inst, def);
|
|
1320
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.transformProcessor(inst, ctx, json, params);
|
|
847
1321
|
inst._zod.parse = (payload, _ctx) => {
|
|
1322
|
+
if (_ctx.direction === "backward") {
|
|
1323
|
+
throw new core.$ZodEncodeError(inst.constructor.name);
|
|
1324
|
+
}
|
|
848
1325
|
payload.addIssue = (issue) => {
|
|
849
1326
|
if (typeof issue === "string") {
|
|
850
1327
|
payload.issues.push(index_js_1.util.issue(issue, payload.value, def));
|
|
@@ -855,9 +1332,10 @@ exports.ZodTransform = core.$constructor("ZodTransform", (inst, def) => {
|
|
|
855
1332
|
if (_issue.fatal)
|
|
856
1333
|
_issue.continue = false;
|
|
857
1334
|
_issue.code ?? (_issue.code = "custom");
|
|
858
|
-
|
|
1335
|
+
if (!("input" in _issue))
|
|
1336
|
+
_issue.input = payload.value;
|
|
859
1337
|
_issue.inst ?? (_issue.inst = inst);
|
|
860
|
-
|
|
1338
|
+
// _issue.continue ??= true;
|
|
861
1339
|
payload.issues.push(index_js_1.util.issue(_issue));
|
|
862
1340
|
}
|
|
863
1341
|
};
|
|
@@ -881,6 +1359,7 @@ function transform(fn) {
|
|
|
881
1359
|
exports.ZodOptional = core.$constructor("ZodOptional", (inst, def) => {
|
|
882
1360
|
core.$ZodOptional.init(inst, def);
|
|
883
1361
|
exports.ZodType.init(inst, def);
|
|
1362
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.optionalProcessor(inst, ctx, json, params);
|
|
884
1363
|
inst.unwrap = () => inst._zod.def.innerType;
|
|
885
1364
|
});
|
|
886
1365
|
function optional(innerType) {
|
|
@@ -889,9 +1368,22 @@ function optional(innerType) {
|
|
|
889
1368
|
innerType: innerType,
|
|
890
1369
|
});
|
|
891
1370
|
}
|
|
1371
|
+
exports.ZodExactOptional = core.$constructor("ZodExactOptional", (inst, def) => {
|
|
1372
|
+
core.$ZodExactOptional.init(inst, def);
|
|
1373
|
+
exports.ZodType.init(inst, def);
|
|
1374
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.optionalProcessor(inst, ctx, json, params);
|
|
1375
|
+
inst.unwrap = () => inst._zod.def.innerType;
|
|
1376
|
+
});
|
|
1377
|
+
function exactOptional(innerType) {
|
|
1378
|
+
return new exports.ZodExactOptional({
|
|
1379
|
+
type: "optional",
|
|
1380
|
+
innerType: innerType,
|
|
1381
|
+
});
|
|
1382
|
+
}
|
|
892
1383
|
exports.ZodNullable = core.$constructor("ZodNullable", (inst, def) => {
|
|
893
1384
|
core.$ZodNullable.init(inst, def);
|
|
894
1385
|
exports.ZodType.init(inst, def);
|
|
1386
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.nullableProcessor(inst, ctx, json, params);
|
|
895
1387
|
inst.unwrap = () => inst._zod.def.innerType;
|
|
896
1388
|
});
|
|
897
1389
|
function nullable(innerType) {
|
|
@@ -907,6 +1399,7 @@ function nullish(innerType) {
|
|
|
907
1399
|
exports.ZodDefault = core.$constructor("ZodDefault", (inst, def) => {
|
|
908
1400
|
core.$ZodDefault.init(inst, def);
|
|
909
1401
|
exports.ZodType.init(inst, def);
|
|
1402
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.defaultProcessor(inst, ctx, json, params);
|
|
910
1403
|
inst.unwrap = () => inst._zod.def.innerType;
|
|
911
1404
|
inst.removeDefault = inst.unwrap;
|
|
912
1405
|
});
|
|
@@ -915,13 +1408,14 @@ function _default(innerType, defaultValue) {
|
|
|
915
1408
|
type: "default",
|
|
916
1409
|
innerType: innerType,
|
|
917
1410
|
get defaultValue() {
|
|
918
|
-
return typeof defaultValue === "function" ? defaultValue() : defaultValue;
|
|
1411
|
+
return typeof defaultValue === "function" ? defaultValue() : index_js_1.util.shallowClone(defaultValue);
|
|
919
1412
|
},
|
|
920
1413
|
});
|
|
921
1414
|
}
|
|
922
1415
|
exports.ZodPrefault = core.$constructor("ZodPrefault", (inst, def) => {
|
|
923
1416
|
core.$ZodPrefault.init(inst, def);
|
|
924
1417
|
exports.ZodType.init(inst, def);
|
|
1418
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.prefaultProcessor(inst, ctx, json, params);
|
|
925
1419
|
inst.unwrap = () => inst._zod.def.innerType;
|
|
926
1420
|
});
|
|
927
1421
|
function prefault(innerType, defaultValue) {
|
|
@@ -929,13 +1423,14 @@ function prefault(innerType, defaultValue) {
|
|
|
929
1423
|
type: "prefault",
|
|
930
1424
|
innerType: innerType,
|
|
931
1425
|
get defaultValue() {
|
|
932
|
-
return typeof defaultValue === "function" ? defaultValue() : defaultValue;
|
|
1426
|
+
return typeof defaultValue === "function" ? defaultValue() : index_js_1.util.shallowClone(defaultValue);
|
|
933
1427
|
},
|
|
934
1428
|
});
|
|
935
1429
|
}
|
|
936
1430
|
exports.ZodNonOptional = core.$constructor("ZodNonOptional", (inst, def) => {
|
|
937
1431
|
core.$ZodNonOptional.init(inst, def);
|
|
938
1432
|
exports.ZodType.init(inst, def);
|
|
1433
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.nonoptionalProcessor(inst, ctx, json, params);
|
|
939
1434
|
inst.unwrap = () => inst._zod.def.innerType;
|
|
940
1435
|
});
|
|
941
1436
|
function nonoptional(innerType, params) {
|
|
@@ -948,6 +1443,7 @@ function nonoptional(innerType, params) {
|
|
|
948
1443
|
exports.ZodSuccess = core.$constructor("ZodSuccess", (inst, def) => {
|
|
949
1444
|
core.$ZodSuccess.init(inst, def);
|
|
950
1445
|
exports.ZodType.init(inst, def);
|
|
1446
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.successProcessor(inst, ctx, json, params);
|
|
951
1447
|
inst.unwrap = () => inst._zod.def.innerType;
|
|
952
1448
|
});
|
|
953
1449
|
function success(innerType) {
|
|
@@ -959,6 +1455,7 @@ function success(innerType) {
|
|
|
959
1455
|
exports.ZodCatch = core.$constructor("ZodCatch", (inst, def) => {
|
|
960
1456
|
core.$ZodCatch.init(inst, def);
|
|
961
1457
|
exports.ZodType.init(inst, def);
|
|
1458
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.catchProcessor(inst, ctx, json, params);
|
|
962
1459
|
inst.unwrap = () => inst._zod.def.innerType;
|
|
963
1460
|
inst.removeCatch = inst.unwrap;
|
|
964
1461
|
});
|
|
@@ -966,12 +1463,13 @@ function _catch(innerType, catchValue) {
|
|
|
966
1463
|
return new exports.ZodCatch({
|
|
967
1464
|
type: "catch",
|
|
968
1465
|
innerType: innerType,
|
|
969
|
-
catchValue: (typeof catchValue === "function" ? catchValue : (
|
|
1466
|
+
catchValue: (typeof catchValue === "function" ? catchValue : core.util.constantCatch(catchValue)),
|
|
970
1467
|
});
|
|
971
1468
|
}
|
|
972
1469
|
exports.ZodNaN = core.$constructor("ZodNaN", (inst, def) => {
|
|
973
1470
|
core.$ZodNaN.init(inst, def);
|
|
974
1471
|
exports.ZodType.init(inst, def);
|
|
1472
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.nanProcessor(inst, ctx, json, params);
|
|
975
1473
|
});
|
|
976
1474
|
function nan(params) {
|
|
977
1475
|
return core._nan(exports.ZodNaN, params);
|
|
@@ -979,6 +1477,7 @@ function nan(params) {
|
|
|
979
1477
|
exports.ZodPipe = core.$constructor("ZodPipe", (inst, def) => {
|
|
980
1478
|
core.$ZodPipe.init(inst, def);
|
|
981
1479
|
exports.ZodType.init(inst, def);
|
|
1480
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.pipeProcessor(inst, ctx, json, params);
|
|
982
1481
|
inst.in = def.in;
|
|
983
1482
|
inst.out = def.out;
|
|
984
1483
|
});
|
|
@@ -990,9 +1489,38 @@ function pipe(in_, out) {
|
|
|
990
1489
|
// ...util.normalizeParams(params),
|
|
991
1490
|
});
|
|
992
1491
|
}
|
|
1492
|
+
exports.ZodCodec = core.$constructor("ZodCodec", (inst, def) => {
|
|
1493
|
+
exports.ZodPipe.init(inst, def);
|
|
1494
|
+
core.$ZodCodec.init(inst, def);
|
|
1495
|
+
});
|
|
1496
|
+
function codec(in_, out, params) {
|
|
1497
|
+
return new exports.ZodCodec({
|
|
1498
|
+
type: "pipe",
|
|
1499
|
+
in: in_,
|
|
1500
|
+
out: out,
|
|
1501
|
+
transform: params.decode,
|
|
1502
|
+
reverseTransform: params.encode,
|
|
1503
|
+
});
|
|
1504
|
+
}
|
|
1505
|
+
function invertCodec(codec) {
|
|
1506
|
+
const def = codec._zod.def;
|
|
1507
|
+
return new exports.ZodCodec({
|
|
1508
|
+
type: "pipe",
|
|
1509
|
+
in: def.out,
|
|
1510
|
+
out: def.in,
|
|
1511
|
+
transform: def.reverseTransform,
|
|
1512
|
+
reverseTransform: def.transform,
|
|
1513
|
+
});
|
|
1514
|
+
}
|
|
1515
|
+
exports.ZodPreprocess = core.$constructor("ZodPreprocess", (inst, def) => {
|
|
1516
|
+
exports.ZodPipe.init(inst, def);
|
|
1517
|
+
core.$ZodPreprocess.init(inst, def);
|
|
1518
|
+
});
|
|
993
1519
|
exports.ZodReadonly = core.$constructor("ZodReadonly", (inst, def) => {
|
|
994
1520
|
core.$ZodReadonly.init(inst, def);
|
|
995
1521
|
exports.ZodType.init(inst, def);
|
|
1522
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.readonlyProcessor(inst, ctx, json, params);
|
|
1523
|
+
inst.unwrap = () => inst._zod.def.innerType;
|
|
996
1524
|
});
|
|
997
1525
|
function readonly(innerType) {
|
|
998
1526
|
return new exports.ZodReadonly({
|
|
@@ -1003,6 +1531,7 @@ function readonly(innerType) {
|
|
|
1003
1531
|
exports.ZodTemplateLiteral = core.$constructor("ZodTemplateLiteral", (inst, def) => {
|
|
1004
1532
|
core.$ZodTemplateLiteral.init(inst, def);
|
|
1005
1533
|
exports.ZodType.init(inst, def);
|
|
1534
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.templateLiteralProcessor(inst, ctx, json, params);
|
|
1006
1535
|
});
|
|
1007
1536
|
function templateLiteral(parts, params) {
|
|
1008
1537
|
return new exports.ZodTemplateLiteral({
|
|
@@ -1014,6 +1543,7 @@ function templateLiteral(parts, params) {
|
|
|
1014
1543
|
exports.ZodLazy = core.$constructor("ZodLazy", (inst, def) => {
|
|
1015
1544
|
core.$ZodLazy.init(inst, def);
|
|
1016
1545
|
exports.ZodType.init(inst, def);
|
|
1546
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.lazyProcessor(inst, ctx, json, params);
|
|
1017
1547
|
inst.unwrap = () => inst._zod.def.getter();
|
|
1018
1548
|
});
|
|
1019
1549
|
function lazy(getter) {
|
|
@@ -1025,6 +1555,7 @@ function lazy(getter) {
|
|
|
1025
1555
|
exports.ZodPromise = core.$constructor("ZodPromise", (inst, def) => {
|
|
1026
1556
|
core.$ZodPromise.init(inst, def);
|
|
1027
1557
|
exports.ZodType.init(inst, def);
|
|
1558
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.promiseProcessor(inst, ctx, json, params);
|
|
1028
1559
|
inst.unwrap = () => inst._zod.def.innerType;
|
|
1029
1560
|
});
|
|
1030
1561
|
function promise(innerType) {
|
|
@@ -1033,9 +1564,22 @@ function promise(innerType) {
|
|
|
1033
1564
|
innerType: innerType,
|
|
1034
1565
|
});
|
|
1035
1566
|
}
|
|
1567
|
+
exports.ZodFunction = core.$constructor("ZodFunction", (inst, def) => {
|
|
1568
|
+
core.$ZodFunction.init(inst, def);
|
|
1569
|
+
exports.ZodType.init(inst, def);
|
|
1570
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.functionProcessor(inst, ctx, json, params);
|
|
1571
|
+
});
|
|
1572
|
+
function _function(params) {
|
|
1573
|
+
return new exports.ZodFunction({
|
|
1574
|
+
type: "function",
|
|
1575
|
+
input: Array.isArray(params?.input) ? tuple(params?.input) : (params?.input ?? array(unknown())),
|
|
1576
|
+
output: params?.output ?? unknown(),
|
|
1577
|
+
});
|
|
1578
|
+
}
|
|
1036
1579
|
exports.ZodCustom = core.$constructor("ZodCustom", (inst, def) => {
|
|
1037
1580
|
core.$ZodCustom.init(inst, def);
|
|
1038
1581
|
exports.ZodType.init(inst, def);
|
|
1582
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.customProcessor(inst, ctx, json, params);
|
|
1039
1583
|
});
|
|
1040
1584
|
// custom checks
|
|
1041
1585
|
function check(fn) {
|
|
@@ -1053,32 +1597,22 @@ function refine(fn, _params = {}) {
|
|
|
1053
1597
|
return core._refine(exports.ZodCustom, fn, _params);
|
|
1054
1598
|
}
|
|
1055
1599
|
// superRefine
|
|
1056
|
-
function superRefine(fn) {
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
}
|
|
1073
|
-
};
|
|
1074
|
-
return fn(payload.value, payload);
|
|
1075
|
-
});
|
|
1076
|
-
return ch;
|
|
1077
|
-
}
|
|
1078
|
-
function _instanceof(cls, params = {
|
|
1079
|
-
error: `Input not instance of ${cls.name}`,
|
|
1080
|
-
}) {
|
|
1081
|
-
const inst = new exports.ZodCustom({
|
|
1600
|
+
function superRefine(fn, params) {
|
|
1601
|
+
return core._superRefine(fn, params);
|
|
1602
|
+
}
|
|
1603
|
+
// Re-export describe and meta from core
|
|
1604
|
+
exports.describe = core.describe;
|
|
1605
|
+
exports.meta = core.meta;
|
|
1606
|
+
exports.ZodInstanceOf = core.$constructor("ZodInstanceOf", (inst, def) => {
|
|
1607
|
+
exports.ZodCustom.init(inst, def);
|
|
1608
|
+
}, {
|
|
1609
|
+
properties(shape, params) {
|
|
1610
|
+
// asserts in place, so the narrowed output type is truthful without a wrapper
|
|
1611
|
+
return this.check(core._properties(shape, params));
|
|
1612
|
+
},
|
|
1613
|
+
});
|
|
1614
|
+
function _instanceof(cls, params = {}) {
|
|
1615
|
+
const inst = new exports.ZodInstanceOf({
|
|
1082
1616
|
type: "custom",
|
|
1083
1617
|
check: "custom",
|
|
1084
1618
|
fn: (data) => data instanceof cls,
|
|
@@ -1086,14 +1620,25 @@ function _instanceof(cls, params = {
|
|
|
1086
1620
|
...index_js_1.util.normalizeParams(params),
|
|
1087
1621
|
});
|
|
1088
1622
|
inst._zod.bag.Class = cls;
|
|
1623
|
+
// Override check to emit invalid_type instead of custom
|
|
1624
|
+
inst._zod.check = (payload) => {
|
|
1625
|
+
if (!(payload.value instanceof cls)) {
|
|
1626
|
+
payload.issues.push({
|
|
1627
|
+
code: "invalid_type",
|
|
1628
|
+
expected: cls.name,
|
|
1629
|
+
input: payload.value,
|
|
1630
|
+
inst,
|
|
1631
|
+
path: [...(inst._zod.def.path ?? [])],
|
|
1632
|
+
});
|
|
1633
|
+
}
|
|
1634
|
+
};
|
|
1089
1635
|
return inst;
|
|
1090
1636
|
}
|
|
1091
1637
|
// stringbool
|
|
1092
1638
|
const stringbool = (...args) => core._stringbool({
|
|
1093
|
-
|
|
1639
|
+
Codec: exports.ZodCodec,
|
|
1094
1640
|
Boolean: exports.ZodBoolean,
|
|
1095
1641
|
String: exports.ZodString,
|
|
1096
|
-
Transform: exports.ZodTransform,
|
|
1097
1642
|
}, ...args);
|
|
1098
1643
|
exports.stringbool = stringbool;
|
|
1099
1644
|
function json(params) {
|
|
@@ -1103,7 +1648,29 @@ function json(params) {
|
|
|
1103
1648
|
return jsonSchema;
|
|
1104
1649
|
}
|
|
1105
1650
|
// preprocess
|
|
1106
|
-
// /** @deprecated Use `z.pipe()` and `z.transform()` instead. */
|
|
1107
1651
|
function preprocess(fn, schema) {
|
|
1108
|
-
return
|
|
1652
|
+
return new exports.ZodPreprocess({
|
|
1653
|
+
type: "pipe",
|
|
1654
|
+
in: transform(fn),
|
|
1655
|
+
out: schema,
|
|
1656
|
+
});
|
|
1109
1657
|
}
|
|
1658
|
+
|
|
1659
|
+
// seal-cjs-exports
|
|
1660
|
+
(function () {
|
|
1661
|
+
var keys = Object.getOwnPropertyNames(exports);
|
|
1662
|
+
for (var i = 0; i < keys.length; i++) {
|
|
1663
|
+
var desc = Object.getOwnPropertyDescriptor(exports, keys[i]);
|
|
1664
|
+
if (!desc || !desc.get || !desc.configurable) continue;
|
|
1665
|
+
var value;
|
|
1666
|
+
try {
|
|
1667
|
+
value = desc.get();
|
|
1668
|
+
} catch (e) {
|
|
1669
|
+
continue;
|
|
1670
|
+
}
|
|
1671
|
+
// a circular require may not have settled this one yet, so leave it live
|
|
1672
|
+
if (value === undefined) continue;
|
|
1673
|
+
Object.defineProperty(exports, keys[i], { value: value, writable: false, enumerable: desc.enumerable, configurable: false });
|
|
1674
|
+
}
|
|
1675
|
+
Object.freeze(exports);
|
|
1676
|
+
})();
|