@suveren/gateway 0.39.0 → 0.40.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/mcp-server/http.mjs +1 -1
- package/dist/ui/assets/index-C-lA_7Lt.js +123 -0
- package/dist/ui/assets/index-DM9WXky8.css +1 -0
- package/dist/ui/index.html +2 -2
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/mcp.d.ts.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/mcp.js +10 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/mcp.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/transport.d.ts +8 -8
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/transport.d.ts.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.d.ts.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js +10 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/transport.d.ts +8 -8
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/transport.d.ts.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/package.json +1 -1
- package/node_modules/follow-redirects/README.md +27 -1
- package/node_modules/follow-redirects/index.js +1 -5
- package/node_modules/follow-redirects/package.json +1 -1
- package/node_modules/hono/README.md +2 -3
- package/node_modules/hono/dist/cjs/helper/css/common.js +8 -3
- package/node_modules/hono/dist/cjs/helper/css/index.js +1 -1
- package/node_modules/hono/dist/cjs/helper/route/index.js +3 -1
- package/node_modules/hono/dist/cjs/jsx/base.js +1 -1
- package/node_modules/hono/dist/cjs/middleware/bearer-auth/index.js +8 -0
- package/node_modules/hono/dist/cjs/middleware/serve-static/index.js +3 -1
- package/node_modules/hono/dist/cjs/router/trie-router/node.js +2 -2
- package/node_modules/hono/dist/cjs/utils/url.js +11 -6
- package/node_modules/hono/dist/helper/css/common.js +8 -3
- package/node_modules/hono/dist/helper/css/index.js +1 -1
- package/node_modules/hono/dist/helper/route/index.js +3 -1
- package/node_modules/hono/dist/jsx/base.js +1 -1
- package/node_modules/hono/dist/middleware/bearer-auth/index.js +8 -0
- package/node_modules/hono/dist/middleware/serve-static/index.js +3 -1
- package/node_modules/hono/dist/router/trie-router/node.js +2 -2
- package/node_modules/hono/dist/types/adapter/aws-lambda/conninfo.d.ts +1 -1
- package/node_modules/hono/dist/types/adapter/bun/conninfo.d.ts +1 -1
- package/node_modules/hono/dist/types/adapter/bun/ssg.d.ts +1 -1
- package/node_modules/hono/dist/types/adapter/cloudflare-pages/conninfo.d.ts +1 -1
- package/node_modules/hono/dist/types/adapter/cloudflare-workers/conninfo.d.ts +1 -1
- package/node_modules/hono/dist/types/adapter/deno/conninfo.d.ts +1 -1
- package/node_modules/hono/dist/types/adapter/deno/ssg.d.ts +1 -1
- package/node_modules/hono/dist/types/adapter/lambda-edge/conninfo.d.ts +1 -1
- package/node_modules/hono/dist/types/adapter/netlify/conninfo.d.ts +1 -1
- package/node_modules/hono/dist/types/adapter/vercel/conninfo.d.ts +1 -1
- package/node_modules/hono/dist/types/helper/testing/index.d.ts +2 -1
- package/node_modules/hono/dist/types/hono-base.d.ts +21 -9
- package/node_modules/hono/dist/types/index.d.ts +1 -1
- package/node_modules/hono/dist/types/jsx/components.d.ts +2 -2
- package/node_modules/hono/dist/types/jsx/context.d.ts +2 -2
- package/node_modules/hono/dist/types/jsx/dom/components.d.ts +2 -2
- package/node_modules/hono/dist/types/jsx/dom/css.d.ts +2 -2
- package/node_modules/hono/dist/types/jsx/streaming.d.ts +4 -3
- package/node_modules/hono/dist/types/middleware/bearer-auth/index.d.ts +2 -1
- package/node_modules/hono/dist/types/middleware/ip-restriction/index.d.ts +3 -3
- package/node_modules/hono/dist/types/middleware/jsx-renderer/index.d.ts +3 -3
- package/node_modules/hono/dist/types/utils/ipaddr.d.ts +1 -1
- package/node_modules/hono/dist/utils/url.js +11 -6
- package/node_modules/hono/package.json +1 -1
- package/node_modules/http-proxy-middleware/dist/handlers/fix-request-body.js +2 -2
- package/node_modules/http-proxy-middleware/package.json +1 -1
- package/node_modules/ip-address/dist/common.js +2 -2
- package/node_modules/ip-address/dist/common.js.map +1 -1
- package/node_modules/ip-address/package.json +2 -2
- package/node_modules/postcss/lib/input.js +1 -1
- package/node_modules/postcss/lib/lazy-result.js +1 -1
- package/node_modules/postcss/lib/no-work-result.js +1 -1
- package/node_modules/postcss/lib/node.js +2 -2
- package/node_modules/postcss/lib/processor.js +1 -1
- package/node_modules/postcss/lib/warning.js +1 -0
- package/node_modules/postcss/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 +3 -3
- package/dist/ui/assets/index-DNNXeRpZ.js +0 -123
- package/dist/ui/assets/index-Osk4E49r.css +0 -1
- 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
|
@@ -1,136 +1,336 @@
|
|
|
1
1
|
import * as core from "../core/index.js";
|
|
2
2
|
import { util } from "../core/index.js";
|
|
3
|
+
import * as processors from "../core/json-schema-processors.js";
|
|
4
|
+
import * as regexes from "../core/regexes.js";
|
|
5
|
+
import { createStandardJSONSchemaMethod, createToJSONSchemaMethod } from "../core/to-json-schema.js";
|
|
6
|
+
import en from "../locales/en.js";
|
|
3
7
|
import * as checks from "./checks.js";
|
|
4
|
-
import * as iso from "./iso.js";
|
|
5
8
|
import * as parse from "./parse.js";
|
|
9
|
+
// 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.
|
|
10
|
+
function _ensureDefaultLocale() {
|
|
11
|
+
if (!core.globalConfig.localeError)
|
|
12
|
+
core.config(en());
|
|
13
|
+
}
|
|
14
|
+
// the default memoizer is read by the core container init, which runs before `ZodType.init`, so each container calls this first
|
|
15
|
+
function _ensureDefaultMemoizer() {
|
|
16
|
+
if (!core.globalConfig.memoizer)
|
|
17
|
+
core.config({ memoizer: core.memoizer() });
|
|
18
|
+
}
|
|
6
19
|
export const ZodType = /*@__PURE__*/ core.$constructor("ZodType", (inst, def) => {
|
|
20
|
+
_ensureDefaultLocale();
|
|
7
21
|
core.$ZodType.init(inst, def);
|
|
8
22
|
inst.def = def;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
23
|
+
inst.type = def.type;
|
|
24
|
+
return inst;
|
|
25
|
+
}, {
|
|
26
|
+
check(...chks) {
|
|
27
|
+
const def = this.def;
|
|
28
|
+
return this.clone(util.mergeDefs(def, {
|
|
14
29
|
checks: [
|
|
15
30
|
...(def.checks ?? []),
|
|
16
|
-
...
|
|
31
|
+
...chks.map((ch) => typeof ch === "function" ? { _zod: { check: ch, def: { check: "custom" }, onattach: [] } } : ch),
|
|
17
32
|
],
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
33
|
+
}), { parent: true });
|
|
34
|
+
},
|
|
35
|
+
with(...chks) {
|
|
36
|
+
return this.check(...chks);
|
|
37
|
+
},
|
|
38
|
+
clone(def, params) {
|
|
39
|
+
return core.clone(this, def, params);
|
|
40
|
+
},
|
|
41
|
+
brand() {
|
|
42
|
+
return this;
|
|
43
|
+
},
|
|
44
|
+
register(reg, meta) {
|
|
45
|
+
reg.add(this, meta);
|
|
46
|
+
return this;
|
|
47
|
+
},
|
|
48
|
+
refine(check, params) {
|
|
49
|
+
return this.check(refine(check, params));
|
|
50
|
+
},
|
|
51
|
+
superRefine(refinement, params) {
|
|
52
|
+
return this.check(superRefine(refinement, params));
|
|
53
|
+
},
|
|
54
|
+
overwrite(fn) {
|
|
55
|
+
return this.check(checks.overwrite(fn));
|
|
56
|
+
},
|
|
57
|
+
optional() {
|
|
58
|
+
return optional(this);
|
|
59
|
+
},
|
|
60
|
+
exactOptional() {
|
|
61
|
+
return exactOptional(this);
|
|
62
|
+
},
|
|
63
|
+
nullable() {
|
|
64
|
+
return nullable(this);
|
|
65
|
+
},
|
|
66
|
+
nullish() {
|
|
67
|
+
return optional(nullable(this));
|
|
68
|
+
},
|
|
69
|
+
nonoptional(params) {
|
|
70
|
+
return nonoptional(this, params);
|
|
71
|
+
},
|
|
72
|
+
array() {
|
|
73
|
+
return array(this);
|
|
74
|
+
},
|
|
75
|
+
or(arg) {
|
|
76
|
+
return union([this, arg]);
|
|
77
|
+
},
|
|
78
|
+
and(arg) {
|
|
79
|
+
return intersection(this, arg);
|
|
80
|
+
},
|
|
81
|
+
transform(tx) {
|
|
82
|
+
return pipe(this, transform(tx));
|
|
83
|
+
},
|
|
84
|
+
default(d) {
|
|
85
|
+
return _default(this, d);
|
|
86
|
+
},
|
|
87
|
+
prefault(d) {
|
|
88
|
+
return prefault(this, d);
|
|
89
|
+
},
|
|
90
|
+
catch(params) {
|
|
91
|
+
return _catch(this, params);
|
|
92
|
+
},
|
|
93
|
+
pipe(target) {
|
|
94
|
+
return pipe(this, target);
|
|
95
|
+
},
|
|
96
|
+
readonly() {
|
|
97
|
+
return readonly(this);
|
|
98
|
+
},
|
|
99
|
+
describe(description) {
|
|
100
|
+
const cl = this.clone();
|
|
56
101
|
core.globalRegistry.add(cl, { description });
|
|
57
102
|
return cl;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
});
|
|
65
|
-
inst.meta = (...args) => {
|
|
66
|
-
if (args.length === 0) {
|
|
67
|
-
return core.globalRegistry.get(inst);
|
|
68
|
-
}
|
|
69
|
-
const cl = inst.clone();
|
|
103
|
+
},
|
|
104
|
+
meta(...args) {
|
|
105
|
+
// 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.
|
|
106
|
+
if (args.length === 0)
|
|
107
|
+
return core.globalRegistry.get(this);
|
|
108
|
+
const cl = this.clone();
|
|
70
109
|
core.globalRegistry.add(cl, args[0]);
|
|
71
110
|
return cl;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
111
|
+
},
|
|
112
|
+
isOptional() {
|
|
113
|
+
return this.safeParse(undefined).success;
|
|
114
|
+
},
|
|
115
|
+
isNullable() {
|
|
116
|
+
return this.safeParse(null).success;
|
|
117
|
+
},
|
|
118
|
+
apply(fn, ...args) {
|
|
119
|
+
return args.length === 0 ? fn(this) : fn(this, ...args);
|
|
120
|
+
},
|
|
121
|
+
// Overrides core's `~standard` to add `jsonSchema`. Must stay a prototype entry: redefining it per instance demotes instances to dictionary mode.
|
|
122
|
+
get "~standard"() {
|
|
123
|
+
return util.hide(this, "~standard", {
|
|
124
|
+
...core.standardProps(this),
|
|
125
|
+
jsonSchema: {
|
|
126
|
+
input: createStandardJSONSchemaMethod(this, "input"),
|
|
127
|
+
output: createStandardJSONSchemaMethod(this, "output"),
|
|
128
|
+
},
|
|
129
|
+
});
|
|
130
|
+
},
|
|
131
|
+
set "~standard"(value) {
|
|
132
|
+
util.own(this, "~standard", value);
|
|
133
|
+
},
|
|
134
|
+
parse: function _parse(data, params) {
|
|
135
|
+
return parse.parse(this, data, params, { callee: _parse });
|
|
136
|
+
},
|
|
137
|
+
parseAsync: async function _parseAsync(data, params) {
|
|
138
|
+
return await parse.parseAsync(this, data, params, { callee: _parseAsync });
|
|
139
|
+
},
|
|
140
|
+
safeParse(data, params) {
|
|
141
|
+
return parse.safeParse(this, data, params);
|
|
142
|
+
},
|
|
143
|
+
async safeParseAsync(data, params) {
|
|
144
|
+
return parse.safeParseAsync(this, data, params);
|
|
145
|
+
},
|
|
146
|
+
// `spa` is an alias: same function object as `safeParseAsync`, as before.
|
|
147
|
+
get spa() {
|
|
148
|
+
return this?.safeParseAsync;
|
|
149
|
+
},
|
|
150
|
+
set spa(value) {
|
|
151
|
+
util.own(this, "spa", value);
|
|
152
|
+
},
|
|
153
|
+
validate(data, params) {
|
|
154
|
+
return parse.validate(this, data, params);
|
|
155
|
+
},
|
|
156
|
+
validateAsync(data, params) {
|
|
157
|
+
return parse.validateAsync(this, data, params);
|
|
158
|
+
},
|
|
159
|
+
encode: function _encode(data, params) {
|
|
160
|
+
return parse.encode(this, data, params, { callee: _encode });
|
|
161
|
+
},
|
|
162
|
+
decode: function _decode(data, params) {
|
|
163
|
+
return parse.decode(this, data, params, { callee: _decode });
|
|
164
|
+
},
|
|
165
|
+
encodeAsync: async function _encodeAsync(data, params) {
|
|
166
|
+
return await parse.encodeAsync(this, data, params, { callee: _encodeAsync });
|
|
167
|
+
},
|
|
168
|
+
decodeAsync: async function _decodeAsync(data, params) {
|
|
169
|
+
return await parse.decodeAsync(this, data, params, { callee: _decodeAsync });
|
|
170
|
+
},
|
|
171
|
+
safeEncode(data, params) {
|
|
172
|
+
return parse.safeEncode(this, data, params);
|
|
173
|
+
},
|
|
174
|
+
safeDecode(data, params) {
|
|
175
|
+
return parse.safeDecode(this, data, params);
|
|
176
|
+
},
|
|
177
|
+
async safeEncodeAsync(data, params) {
|
|
178
|
+
return parse.safeEncodeAsync(this, data, params);
|
|
179
|
+
},
|
|
180
|
+
async safeDecodeAsync(data, params) {
|
|
181
|
+
return parse.safeDecodeAsync(this, data, params);
|
|
182
|
+
},
|
|
183
|
+
toJSONSchema(params) {
|
|
184
|
+
return createToJSONSchemaMethod(this, {})(params);
|
|
185
|
+
},
|
|
186
|
+
// Reads through to the registry on every access, so it must not cache.
|
|
187
|
+
get description() {
|
|
188
|
+
return core.globalRegistry.get(this)?.description;
|
|
189
|
+
},
|
|
190
|
+
// No setter: `schema._def = x` throws, as it did when `_def` was a non-writable own property.
|
|
191
|
+
get _def() {
|
|
192
|
+
return this._zod.def;
|
|
193
|
+
},
|
|
77
194
|
});
|
|
78
195
|
/** @internal */
|
|
79
196
|
export const _ZodString = /*@__PURE__*/ core.$constructor("_ZodString", (inst, def) => {
|
|
80
197
|
core.$ZodString.init(inst, def);
|
|
81
198
|
ZodType.init(inst, def);
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
inst
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
199
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.stringProcessor(inst, ctx, json, params);
|
|
200
|
+
},
|
|
201
|
+
/*@__PURE__*/ util.derived({
|
|
202
|
+
format: (inst) => processors.aggregateChecks(inst).format ?? null,
|
|
203
|
+
minLength: (inst) => processors.aggregateChecks(inst).minimum ?? null,
|
|
204
|
+
maxLength: (inst) => processors.aggregateChecks(inst).maximum ?? null,
|
|
205
|
+
}, {
|
|
206
|
+
regex(...args) {
|
|
207
|
+
return this.check(checks.regex(...args));
|
|
208
|
+
},
|
|
209
|
+
includes(...args) {
|
|
210
|
+
return this.check(checks.includes(...args));
|
|
211
|
+
},
|
|
212
|
+
startsWith(...args) {
|
|
213
|
+
return this.check(checks.startsWith(...args));
|
|
214
|
+
},
|
|
215
|
+
endsWith(...args) {
|
|
216
|
+
return this.check(checks.endsWith(...args));
|
|
217
|
+
},
|
|
218
|
+
min(...args) {
|
|
219
|
+
return this.check(checks.minLength(...args));
|
|
220
|
+
},
|
|
221
|
+
max(...args) {
|
|
222
|
+
return this.check(checks.maxLength(...args));
|
|
223
|
+
},
|
|
224
|
+
length(...args) {
|
|
225
|
+
return this.check(checks.length(...args));
|
|
226
|
+
},
|
|
227
|
+
nonempty(...args) {
|
|
228
|
+
return this.check(checks.minLength(1, ...args));
|
|
229
|
+
},
|
|
230
|
+
lowercase(params) {
|
|
231
|
+
return this.check(checks.lowercase(params));
|
|
232
|
+
},
|
|
233
|
+
uppercase(params) {
|
|
234
|
+
return this.check(checks.uppercase(params));
|
|
235
|
+
},
|
|
236
|
+
trim() {
|
|
237
|
+
return this.check(checks.trim());
|
|
238
|
+
},
|
|
239
|
+
normalize(...args) {
|
|
240
|
+
return this.check(checks.normalize(...args));
|
|
241
|
+
},
|
|
242
|
+
toLowerCase() {
|
|
243
|
+
return this.check(checks.toLowerCase());
|
|
244
|
+
},
|
|
245
|
+
toUpperCase() {
|
|
246
|
+
return this.check(checks.toUpperCase());
|
|
247
|
+
},
|
|
248
|
+
slugify() {
|
|
249
|
+
return this.check(checks.slugify());
|
|
250
|
+
},
|
|
251
|
+
}));
|
|
103
252
|
export const ZodString = /*@__PURE__*/ core.$constructor("ZodString", (inst, def) => {
|
|
104
253
|
core.$ZodString.init(inst, def);
|
|
105
254
|
_ZodString.init(inst, def);
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
255
|
+
}, {
|
|
256
|
+
email(params) {
|
|
257
|
+
return this.check(core._email(ZodEmail, params));
|
|
258
|
+
},
|
|
259
|
+
url(params) {
|
|
260
|
+
return this.check(core._url(ZodURL, params));
|
|
261
|
+
},
|
|
262
|
+
jwt(params) {
|
|
263
|
+
return this.check(core._jwt(ZodJWT, params));
|
|
264
|
+
},
|
|
265
|
+
emoji(params) {
|
|
266
|
+
return this.check(core._emoji(ZodEmoji, params));
|
|
267
|
+
},
|
|
268
|
+
guid(params) {
|
|
269
|
+
return this.check(core._guid(ZodGUID, params));
|
|
270
|
+
},
|
|
271
|
+
uuid(params) {
|
|
272
|
+
return this.check(core._uuid(ZodUUID, params));
|
|
273
|
+
},
|
|
274
|
+
uuidv4(params) {
|
|
275
|
+
return this.check(core._uuidv4(ZodUUID, params));
|
|
276
|
+
},
|
|
277
|
+
uuidv6(params) {
|
|
278
|
+
return this.check(core._uuidv6(ZodUUID, params));
|
|
279
|
+
},
|
|
280
|
+
uuidv7(params) {
|
|
281
|
+
return this.check(core._uuidv7(ZodUUID, params));
|
|
282
|
+
},
|
|
283
|
+
nanoid(params) {
|
|
284
|
+
return this.check(core._nanoid(ZodNanoID, params));
|
|
285
|
+
},
|
|
286
|
+
cuid(params) {
|
|
287
|
+
return this.check(core._cuid(ZodCUID, params));
|
|
288
|
+
},
|
|
289
|
+
cuid2(params) {
|
|
290
|
+
return this.check(core._cuid2(ZodCUID2, params));
|
|
291
|
+
},
|
|
292
|
+
ulid(params) {
|
|
293
|
+
return this.check(core._ulid(ZodULID, params));
|
|
294
|
+
},
|
|
295
|
+
base64(params) {
|
|
296
|
+
return this.check(core._base64(ZodBase64, params));
|
|
297
|
+
},
|
|
298
|
+
base64url(params) {
|
|
299
|
+
return this.check(core._base64url(ZodBase64URL, params));
|
|
300
|
+
},
|
|
301
|
+
xid(params) {
|
|
302
|
+
return this.check(core._xid(ZodXID, params));
|
|
303
|
+
},
|
|
304
|
+
ksuid(params) {
|
|
305
|
+
return this.check(core._ksuid(ZodKSUID, params));
|
|
306
|
+
},
|
|
307
|
+
ipv4(params) {
|
|
308
|
+
return this.check(core._ipv4(ZodIPv4, params));
|
|
309
|
+
},
|
|
310
|
+
ipv6(params) {
|
|
311
|
+
return this.check(core._ipv6(ZodIPv6, params));
|
|
312
|
+
},
|
|
313
|
+
cidrv4(params) {
|
|
314
|
+
return this.check(core._cidrv4(ZodCIDRv4, params));
|
|
315
|
+
},
|
|
316
|
+
cidrv6(params) {
|
|
317
|
+
return this.check(core._cidrv6(ZodCIDRv6, params));
|
|
318
|
+
},
|
|
319
|
+
e164(params) {
|
|
320
|
+
return this.check(core._e164(ZodE164, params));
|
|
321
|
+
},
|
|
322
|
+
datetime(params) {
|
|
323
|
+
return this.check(core._isoDateTime(ZodISODateTime, params));
|
|
324
|
+
},
|
|
325
|
+
date(params) {
|
|
326
|
+
return this.check(core._isoDate(ZodISODate, params));
|
|
327
|
+
},
|
|
328
|
+
time(params) {
|
|
329
|
+
return this.check(core._isoTime(ZodISOTime, params));
|
|
330
|
+
},
|
|
331
|
+
duration(params) {
|
|
332
|
+
return this.check(core._isoDuration(ZodISODuration, params));
|
|
333
|
+
},
|
|
134
334
|
});
|
|
135
335
|
export function string(params) {
|
|
136
336
|
return core._string(ZodString, params);
|
|
@@ -139,6 +339,22 @@ export const ZodStringFormat = /*@__PURE__*/ core.$constructor("ZodStringFormat"
|
|
|
139
339
|
core.$ZodStringFormat.init(inst, def);
|
|
140
340
|
_ZodString.init(inst, def);
|
|
141
341
|
});
|
|
342
|
+
export const ZodISODateTime = /*@__PURE__*/ core.$constructor("ZodISODateTime", (inst, def) => {
|
|
343
|
+
core.$ZodISODateTime.init(inst, def);
|
|
344
|
+
ZodStringFormat.init(inst, def);
|
|
345
|
+
});
|
|
346
|
+
export const ZodISODate = /*@__PURE__*/ core.$constructor("ZodISODate", (inst, def) => {
|
|
347
|
+
core.$ZodISODate.init(inst, def);
|
|
348
|
+
ZodStringFormat.init(inst, def);
|
|
349
|
+
});
|
|
350
|
+
export const ZodISOTime = /*@__PURE__*/ core.$constructor("ZodISOTime", (inst, def) => {
|
|
351
|
+
core.$ZodISOTime.init(inst, def);
|
|
352
|
+
ZodStringFormat.init(inst, def);
|
|
353
|
+
});
|
|
354
|
+
export const ZodISODuration = /*@__PURE__*/ core.$constructor("ZodISODuration", (inst, def) => {
|
|
355
|
+
core.$ZodISODuration.init(inst, def);
|
|
356
|
+
ZodStringFormat.init(inst, def);
|
|
357
|
+
});
|
|
142
358
|
export const ZodEmail = /*@__PURE__*/ core.$constructor("ZodEmail", (inst, def) => {
|
|
143
359
|
// ZodStringFormat.init(inst, def);
|
|
144
360
|
core.$ZodEmail.init(inst, def);
|
|
@@ -182,6 +398,13 @@ export const ZodURL = /*@__PURE__*/ core.$constructor("ZodURL", (inst, def) => {
|
|
|
182
398
|
export function url(params) {
|
|
183
399
|
return core._url(ZodURL, params);
|
|
184
400
|
}
|
|
401
|
+
export function httpUrl(params) {
|
|
402
|
+
return core._url(ZodURL, {
|
|
403
|
+
protocol: regexes.httpProtocol,
|
|
404
|
+
hostname: regexes.domain,
|
|
405
|
+
...util.normalizeParams(params),
|
|
406
|
+
});
|
|
407
|
+
}
|
|
185
408
|
export const ZodEmoji = /*@__PURE__*/ core.$constructor("ZodEmoji", (inst, def) => {
|
|
186
409
|
// ZodStringFormat.init(inst, def);
|
|
187
410
|
core.$ZodEmoji.init(inst, def);
|
|
@@ -198,11 +421,23 @@ export const ZodNanoID = /*@__PURE__*/ core.$constructor("ZodNanoID", (inst, def
|
|
|
198
421
|
export function nanoid(params) {
|
|
199
422
|
return core._nanoid(ZodNanoID, params);
|
|
200
423
|
}
|
|
424
|
+
/**
|
|
425
|
+
* @deprecated CUID v1 is deprecated by its authors due to information leakage
|
|
426
|
+
* (timestamps embedded in the id). Use {@link ZodCUID2} instead.
|
|
427
|
+
* See https://github.com/paralleldrive/cuid.
|
|
428
|
+
*/
|
|
201
429
|
export const ZodCUID = /*@__PURE__*/ core.$constructor("ZodCUID", (inst, def) => {
|
|
202
430
|
// ZodStringFormat.init(inst, def);
|
|
203
431
|
core.$ZodCUID.init(inst, def);
|
|
204
432
|
ZodStringFormat.init(inst, def);
|
|
205
433
|
});
|
|
434
|
+
/**
|
|
435
|
+
* Validates a CUID v1 string.
|
|
436
|
+
*
|
|
437
|
+
* @deprecated CUID v1 is deprecated by its authors due to information leakage
|
|
438
|
+
* (timestamps embedded in the id). Use {@link cuid2 | `z.cuid2()`} instead.
|
|
439
|
+
* See https://github.com/paralleldrive/cuid.
|
|
440
|
+
*/
|
|
206
441
|
export function cuid(params) {
|
|
207
442
|
return core._cuid(ZodCUID, params);
|
|
208
443
|
}
|
|
@@ -246,6 +481,14 @@ export const ZodIPv4 = /*@__PURE__*/ core.$constructor("ZodIPv4", (inst, def) =>
|
|
|
246
481
|
export function ipv4(params) {
|
|
247
482
|
return core._ipv4(ZodIPv4, params);
|
|
248
483
|
}
|
|
484
|
+
export const ZodMAC = /*@__PURE__*/ core.$constructor("ZodMAC", (inst, def) => {
|
|
485
|
+
// ZodStringFormat.init(inst, def);
|
|
486
|
+
core.$ZodMAC.init(inst, def);
|
|
487
|
+
ZodStringFormat.init(inst, def);
|
|
488
|
+
});
|
|
489
|
+
export function mac(params) {
|
|
490
|
+
return core._mac(ZodMAC, params);
|
|
491
|
+
}
|
|
249
492
|
export const ZodIPv6 = /*@__PURE__*/ core.$constructor("ZodIPv6", (inst, def) => {
|
|
250
493
|
// ZodStringFormat.init(inst, def);
|
|
251
494
|
core.$ZodIPv6.init(inst, def);
|
|
@@ -292,6 +535,20 @@ export const ZodE164 = /*@__PURE__*/ core.$constructor("ZodE164", (inst, def) =>
|
|
|
292
535
|
export function e164(params) {
|
|
293
536
|
return core._e164(ZodE164, params);
|
|
294
537
|
}
|
|
538
|
+
export const ZodCreditCard = /*@__PURE__*/ core.$constructor("ZodCreditCard", (inst, def) => {
|
|
539
|
+
core.$ZodCreditCard.init(inst, def);
|
|
540
|
+
ZodStringFormat.init(inst, def);
|
|
541
|
+
});
|
|
542
|
+
export function creditCard(params) {
|
|
543
|
+
return core._creditCard(ZodCreditCard, params);
|
|
544
|
+
}
|
|
545
|
+
export const ZodIBAN = /*@__PURE__*/ core.$constructor("ZodIBAN", (inst, def) => {
|
|
546
|
+
core.$ZodIBAN.init(inst, def);
|
|
547
|
+
ZodStringFormat.init(inst, def);
|
|
548
|
+
});
|
|
549
|
+
export function iban(params) {
|
|
550
|
+
return core._iban(ZodIBAN, params);
|
|
551
|
+
}
|
|
295
552
|
export const ZodJWT = /*@__PURE__*/ core.$constructor("ZodJWT", (inst, def) => {
|
|
296
553
|
// ZodStringFormat.init(inst, def);
|
|
297
554
|
core.$ZodJWT.init(inst, def);
|
|
@@ -308,34 +565,90 @@ export const ZodCustomStringFormat = /*@__PURE__*/ core.$constructor("ZodCustomS
|
|
|
308
565
|
export function stringFormat(format, fnOrRegex, _params = {}) {
|
|
309
566
|
return core._stringFormat(ZodCustomStringFormat, format, fnOrRegex, _params);
|
|
310
567
|
}
|
|
568
|
+
export function hostname(_params) {
|
|
569
|
+
return core._stringFormat(ZodCustomStringFormat, "hostname", regexes.hostname, _params);
|
|
570
|
+
}
|
|
571
|
+
export function hex(_params) {
|
|
572
|
+
return core._stringFormat(ZodCustomStringFormat, "hex", regexes.hex, _params);
|
|
573
|
+
}
|
|
574
|
+
export function currencyCode(_params) {
|
|
575
|
+
return core._stringFormat(ZodCustomStringFormat, "currency_code", regexes.currencyCode, _params);
|
|
576
|
+
}
|
|
577
|
+
export function hash(alg, params) {
|
|
578
|
+
const enc = params?.enc ?? "hex";
|
|
579
|
+
const format = `${alg}_${enc}`;
|
|
580
|
+
const regex = core.regexes[format];
|
|
581
|
+
if (!regex)
|
|
582
|
+
throw new Error(`Unrecognized hash format: ${format}`);
|
|
583
|
+
return core._stringFormat(ZodCustomStringFormat, format, regex, params);
|
|
584
|
+
}
|
|
311
585
|
export const ZodNumber = /*@__PURE__*/ core.$constructor("ZodNumber", (inst, def) => {
|
|
312
586
|
core.$ZodNumber.init(inst, def);
|
|
313
587
|
ZodType.init(inst, def);
|
|
314
|
-
inst.
|
|
315
|
-
inst.gte = (value, params) => inst.check(checks.gte(value, params));
|
|
316
|
-
inst.min = (value, params) => inst.check(checks.gte(value, params));
|
|
317
|
-
inst.lt = (value, params) => inst.check(checks.lt(value, params));
|
|
318
|
-
inst.lte = (value, params) => inst.check(checks.lte(value, params));
|
|
319
|
-
inst.max = (value, params) => inst.check(checks.lte(value, params));
|
|
320
|
-
inst.int = (params) => inst.check(int(params));
|
|
321
|
-
inst.safe = (params) => inst.check(int(params));
|
|
322
|
-
inst.positive = (params) => inst.check(checks.gt(0, params));
|
|
323
|
-
inst.nonnegative = (params) => inst.check(checks.gte(0, params));
|
|
324
|
-
inst.negative = (params) => inst.check(checks.lt(0, params));
|
|
325
|
-
inst.nonpositive = (params) => inst.check(checks.lte(0, params));
|
|
326
|
-
inst.multipleOf = (value, params) => inst.check(checks.multipleOf(value, params));
|
|
327
|
-
inst.step = (value, params) => inst.check(checks.multipleOf(value, params));
|
|
328
|
-
// inst.finite = (params) => inst.check(core.finite(params));
|
|
329
|
-
inst.finite = () => inst;
|
|
330
|
-
const bag = inst._zod.bag;
|
|
331
|
-
inst.minValue =
|
|
332
|
-
Math.max(bag.minimum ?? Number.NEGATIVE_INFINITY, bag.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null;
|
|
333
|
-
inst.maxValue =
|
|
334
|
-
Math.min(bag.maximum ?? Number.POSITIVE_INFINITY, bag.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null;
|
|
335
|
-
inst.isInt = (bag.format ?? "").includes("int") || Number.isSafeInteger(bag.multipleOf ?? 0.5);
|
|
588
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.numberProcessor(inst, ctx, json, params);
|
|
336
589
|
inst.isFinite = true;
|
|
337
|
-
|
|
338
|
-
|
|
590
|
+
},
|
|
591
|
+
/*@__PURE__*/ util.derived({
|
|
592
|
+
minValue: (inst) => {
|
|
593
|
+
const { minimum, exclusiveMinimum } = processors.aggregateChecks(inst);
|
|
594
|
+
return Math.max(minimum ?? Number.NEGATIVE_INFINITY, exclusiveMinimum ?? Number.NEGATIVE_INFINITY);
|
|
595
|
+
},
|
|
596
|
+
maxValue: (inst) => {
|
|
597
|
+
const { maximum, exclusiveMaximum } = processors.aggregateChecks(inst);
|
|
598
|
+
return Math.min(maximum ?? Number.POSITIVE_INFINITY, exclusiveMaximum ?? Number.POSITIVE_INFINITY);
|
|
599
|
+
},
|
|
600
|
+
isInt: (inst) => {
|
|
601
|
+
const { isInt, multipleOf } = processors.aggregateChecks(inst);
|
|
602
|
+
return !!isInt || !!multipleOf?.some(Number.isSafeInteger);
|
|
603
|
+
},
|
|
604
|
+
format: (inst) => processors.aggregateChecks(inst).format ?? null,
|
|
605
|
+
}, {
|
|
606
|
+
gt(value, params) {
|
|
607
|
+
return this.check(checks.gt(value, params));
|
|
608
|
+
},
|
|
609
|
+
gte(value, params) {
|
|
610
|
+
return this.check(checks.gte(value, params));
|
|
611
|
+
},
|
|
612
|
+
min(value, params) {
|
|
613
|
+
return this.check(checks.gte(value, params));
|
|
614
|
+
},
|
|
615
|
+
lt(value, params) {
|
|
616
|
+
return this.check(checks.lt(value, params));
|
|
617
|
+
},
|
|
618
|
+
lte(value, params) {
|
|
619
|
+
return this.check(checks.lte(value, params));
|
|
620
|
+
},
|
|
621
|
+
max(value, params) {
|
|
622
|
+
return this.check(checks.lte(value, params));
|
|
623
|
+
},
|
|
624
|
+
int(params) {
|
|
625
|
+
return this.check(int(params));
|
|
626
|
+
},
|
|
627
|
+
safe(params) {
|
|
628
|
+
return this.check(int(params));
|
|
629
|
+
},
|
|
630
|
+
positive(params) {
|
|
631
|
+
return this.check(checks.gt(0, params));
|
|
632
|
+
},
|
|
633
|
+
nonnegative(params) {
|
|
634
|
+
return this.check(checks.gte(0, params));
|
|
635
|
+
},
|
|
636
|
+
negative(params) {
|
|
637
|
+
return this.check(checks.lt(0, params));
|
|
638
|
+
},
|
|
639
|
+
nonpositive(params) {
|
|
640
|
+
return this.check(checks.lte(0, params));
|
|
641
|
+
},
|
|
642
|
+
multipleOf(value, params) {
|
|
643
|
+
return this.check(checks.multipleOf(value, params));
|
|
644
|
+
},
|
|
645
|
+
step(value, params) {
|
|
646
|
+
return this.check(checks.multipleOf(value, params));
|
|
647
|
+
},
|
|
648
|
+
finite() {
|
|
649
|
+
return this;
|
|
650
|
+
},
|
|
651
|
+
}));
|
|
339
652
|
export function number(params) {
|
|
340
653
|
return core._number(ZodNumber, params);
|
|
341
654
|
}
|
|
@@ -361,6 +674,7 @@ export function uint32(params) {
|
|
|
361
674
|
export const ZodBoolean = /*@__PURE__*/ core.$constructor("ZodBoolean", (inst, def) => {
|
|
362
675
|
core.$ZodBoolean.init(inst, def);
|
|
363
676
|
ZodType.init(inst, def);
|
|
677
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.booleanProcessor(inst, ctx, json, params);
|
|
364
678
|
});
|
|
365
679
|
export function boolean(params) {
|
|
366
680
|
return core._boolean(ZodBoolean, params);
|
|
@@ -368,24 +682,47 @@ export function boolean(params) {
|
|
|
368
682
|
export const ZodBigInt = /*@__PURE__*/ core.$constructor("ZodBigInt", (inst, def) => {
|
|
369
683
|
core.$ZodBigInt.init(inst, def);
|
|
370
684
|
ZodType.init(inst, def);
|
|
371
|
-
inst.
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
685
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.bigintProcessor(inst, ctx, json, params);
|
|
686
|
+
},
|
|
687
|
+
/*@__PURE__*/ util.derived({
|
|
688
|
+
minValue: (inst) => processors.aggregateChecks(inst).minimum ?? null,
|
|
689
|
+
maxValue: (inst) => processors.aggregateChecks(inst).maximum ?? null,
|
|
690
|
+
format: (inst) => processors.aggregateChecks(inst).format ?? null,
|
|
691
|
+
}, {
|
|
692
|
+
gte(value, params) {
|
|
693
|
+
return this.check(checks.gte(value, params));
|
|
694
|
+
},
|
|
695
|
+
min(value, params) {
|
|
696
|
+
return this.check(checks.gte(value, params));
|
|
697
|
+
},
|
|
698
|
+
gt(value, params) {
|
|
699
|
+
return this.check(checks.gt(value, params));
|
|
700
|
+
},
|
|
701
|
+
lt(value, params) {
|
|
702
|
+
return this.check(checks.lt(value, params));
|
|
703
|
+
},
|
|
704
|
+
lte(value, params) {
|
|
705
|
+
return this.check(checks.lte(value, params));
|
|
706
|
+
},
|
|
707
|
+
max(value, params) {
|
|
708
|
+
return this.check(checks.lte(value, params));
|
|
709
|
+
},
|
|
710
|
+
positive(params) {
|
|
711
|
+
return this.check(checks.gt(BigInt(0), params));
|
|
712
|
+
},
|
|
713
|
+
negative(params) {
|
|
714
|
+
return this.check(checks.lt(BigInt(0), params));
|
|
715
|
+
},
|
|
716
|
+
nonpositive(params) {
|
|
717
|
+
return this.check(checks.lte(BigInt(0), params));
|
|
718
|
+
},
|
|
719
|
+
nonnegative(params) {
|
|
720
|
+
return this.check(checks.gte(BigInt(0), params));
|
|
721
|
+
},
|
|
722
|
+
multipleOf(value, params) {
|
|
723
|
+
return this.check(checks.multipleOf(value, params));
|
|
724
|
+
},
|
|
725
|
+
}));
|
|
389
726
|
export function bigint(params) {
|
|
390
727
|
return core._bigint(ZodBigInt, params);
|
|
391
728
|
}
|
|
@@ -393,17 +730,16 @@ export const ZodBigIntFormat = /*@__PURE__*/ core.$constructor("ZodBigIntFormat"
|
|
|
393
730
|
core.$ZodBigIntFormat.init(inst, def);
|
|
394
731
|
ZodBigInt.init(inst, def);
|
|
395
732
|
});
|
|
396
|
-
// int64
|
|
397
733
|
export function int64(params) {
|
|
398
734
|
return core._int64(ZodBigIntFormat, params);
|
|
399
735
|
}
|
|
400
|
-
// uint64
|
|
401
736
|
export function uint64(params) {
|
|
402
737
|
return core._uint64(ZodBigIntFormat, params);
|
|
403
738
|
}
|
|
404
739
|
export const ZodSymbol = /*@__PURE__*/ core.$constructor("ZodSymbol", (inst, def) => {
|
|
405
740
|
core.$ZodSymbol.init(inst, def);
|
|
406
741
|
ZodType.init(inst, def);
|
|
742
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.symbolProcessor(inst, ctx, json, params);
|
|
407
743
|
});
|
|
408
744
|
export function symbol(params) {
|
|
409
745
|
return core._symbol(ZodSymbol, params);
|
|
@@ -411,6 +747,7 @@ export function symbol(params) {
|
|
|
411
747
|
export const ZodUndefined = /*@__PURE__*/ core.$constructor("ZodUndefined", (inst, def) => {
|
|
412
748
|
core.$ZodUndefined.init(inst, def);
|
|
413
749
|
ZodType.init(inst, def);
|
|
750
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.undefinedProcessor(inst, ctx, json, params);
|
|
414
751
|
});
|
|
415
752
|
function _undefined(params) {
|
|
416
753
|
return core._undefined(ZodUndefined, params);
|
|
@@ -419,6 +756,7 @@ export { _undefined as undefined };
|
|
|
419
756
|
export const ZodNull = /*@__PURE__*/ core.$constructor("ZodNull", (inst, def) => {
|
|
420
757
|
core.$ZodNull.init(inst, def);
|
|
421
758
|
ZodType.init(inst, def);
|
|
759
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.nullProcessor(inst, ctx, json, params);
|
|
422
760
|
});
|
|
423
761
|
function _null(params) {
|
|
424
762
|
return core._null(ZodNull, params);
|
|
@@ -427,6 +765,7 @@ export { _null as null };
|
|
|
427
765
|
export const ZodAny = /*@__PURE__*/ core.$constructor("ZodAny", (inst, def) => {
|
|
428
766
|
core.$ZodAny.init(inst, def);
|
|
429
767
|
ZodType.init(inst, def);
|
|
768
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.anyProcessor(inst, ctx, json, params);
|
|
430
769
|
});
|
|
431
770
|
export function any() {
|
|
432
771
|
return core._any(ZodAny);
|
|
@@ -434,6 +773,7 @@ export function any() {
|
|
|
434
773
|
export const ZodUnknown = /*@__PURE__*/ core.$constructor("ZodUnknown", (inst, def) => {
|
|
435
774
|
core.$ZodUnknown.init(inst, def);
|
|
436
775
|
ZodType.init(inst, def);
|
|
776
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.unknownProcessor(inst, ctx, json, params);
|
|
437
777
|
});
|
|
438
778
|
export function unknown() {
|
|
439
779
|
return core._unknown(ZodUnknown);
|
|
@@ -441,6 +781,7 @@ export function unknown() {
|
|
|
441
781
|
export const ZodNever = /*@__PURE__*/ core.$constructor("ZodNever", (inst, def) => {
|
|
442
782
|
core.$ZodNever.init(inst, def);
|
|
443
783
|
ZodType.init(inst, def);
|
|
784
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.neverProcessor(inst, ctx, json, params);
|
|
444
785
|
});
|
|
445
786
|
export function never(params) {
|
|
446
787
|
return core._never(ZodNever, params);
|
|
@@ -448,6 +789,7 @@ export function never(params) {
|
|
|
448
789
|
export const ZodVoid = /*@__PURE__*/ core.$constructor("ZodVoid", (inst, def) => {
|
|
449
790
|
core.$ZodVoid.init(inst, def);
|
|
450
791
|
ZodType.init(inst, def);
|
|
792
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.voidProcessor(inst, ctx, json, params);
|
|
451
793
|
});
|
|
452
794
|
function _void(params) {
|
|
453
795
|
return core._void(ZodVoid, params);
|
|
@@ -456,24 +798,45 @@ export { _void as void };
|
|
|
456
798
|
export const ZodDate = /*@__PURE__*/ core.$constructor("ZodDate", (inst, def) => {
|
|
457
799
|
core.$ZodDate.init(inst, def);
|
|
458
800
|
ZodType.init(inst, def);
|
|
801
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.dateProcessor(inst, ctx, json, params);
|
|
459
802
|
inst.min = (value, params) => inst.check(checks.gte(value, params));
|
|
460
803
|
inst.max = (value, params) => inst.check(checks.lte(value, params));
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
});
|
|
804
|
+
},
|
|
805
|
+
/*@__PURE__*/ util.derived({
|
|
806
|
+
minDate: (inst) => {
|
|
807
|
+
const { minimum } = processors.aggregateChecks(inst);
|
|
808
|
+
return minimum ? new Date(minimum) : null;
|
|
809
|
+
},
|
|
810
|
+
maxDate: (inst) => {
|
|
811
|
+
const { maximum } = processors.aggregateChecks(inst);
|
|
812
|
+
return maximum ? new Date(maximum) : null;
|
|
813
|
+
},
|
|
814
|
+
}, {}));
|
|
465
815
|
export function date(params) {
|
|
466
816
|
return core._date(ZodDate, params);
|
|
467
817
|
}
|
|
468
818
|
export const ZodArray = /*@__PURE__*/ core.$constructor("ZodArray", (inst, def) => {
|
|
819
|
+
_ensureDefaultMemoizer();
|
|
469
820
|
core.$ZodArray.init(inst, def);
|
|
470
821
|
ZodType.init(inst, def);
|
|
822
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.arrayProcessor(inst, ctx, json, params);
|
|
471
823
|
inst.element = def.element;
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
824
|
+
}, {
|
|
825
|
+
min(n, params) {
|
|
826
|
+
return this.check(checks.minLength(n, params));
|
|
827
|
+
},
|
|
828
|
+
nonempty(params) {
|
|
829
|
+
return this.check(checks.minLength(1, params));
|
|
830
|
+
},
|
|
831
|
+
max(n, params) {
|
|
832
|
+
return this.check(checks.maxLength(n, params));
|
|
833
|
+
},
|
|
834
|
+
length(n, params) {
|
|
835
|
+
return this.check(checks.length(n, params));
|
|
836
|
+
},
|
|
837
|
+
unwrap() {
|
|
838
|
+
return this.element;
|
|
839
|
+
},
|
|
477
840
|
});
|
|
478
841
|
export function array(element, params) {
|
|
479
842
|
return core._array(ZodArray, element, params);
|
|
@@ -481,35 +844,63 @@ export function array(element, params) {
|
|
|
481
844
|
// .keyof
|
|
482
845
|
export function keyof(schema) {
|
|
483
846
|
const shape = schema._zod.def.shape;
|
|
484
|
-
return
|
|
847
|
+
return _enum(Object.keys(shape));
|
|
485
848
|
}
|
|
486
849
|
export const ZodObject = /*@__PURE__*/ core.$constructor("ZodObject", (inst, def) => {
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
inst.
|
|
491
|
-
inst
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
return util.
|
|
499
|
-
}
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
850
|
+
_ensureDefaultMemoizer();
|
|
851
|
+
core.$ZodObjectJIT.init(inst, def);
|
|
852
|
+
ZodType.init(inst, def);
|
|
853
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.objectProcessor(inst, ctx, json, params);
|
|
854
|
+
util.installLazyProp(inst, "shape", (self) => self._zod.def.shape, false);
|
|
855
|
+
}, {
|
|
856
|
+
keyof() {
|
|
857
|
+
return _enum(Object.keys(this._zod.def.shape));
|
|
858
|
+
},
|
|
859
|
+
catchall(catchall) {
|
|
860
|
+
// `mergeDefs` rather than a spread: spreading reads `shape`, and resolving it can mint a whole fresh subtree
|
|
861
|
+
return this.clone(util.mergeDefs(this._zod.def, { catchall: catchall }));
|
|
862
|
+
},
|
|
863
|
+
passthrough() {
|
|
864
|
+
return this.clone(util.mergeDefs(this._zod.def, { catchall: unknown() }));
|
|
865
|
+
},
|
|
866
|
+
loose() {
|
|
867
|
+
return this.clone(util.mergeDefs(this._zod.def, { catchall: unknown() }));
|
|
868
|
+
},
|
|
869
|
+
strict() {
|
|
870
|
+
return this.clone(util.mergeDefs(this._zod.def, { catchall: never() }));
|
|
871
|
+
},
|
|
872
|
+
strip() {
|
|
873
|
+
return this.clone(util.mergeDefs(this._zod.def, { catchall: undefined }));
|
|
874
|
+
},
|
|
875
|
+
extend(incoming) {
|
|
876
|
+
return util.extend(this, incoming);
|
|
877
|
+
},
|
|
878
|
+
safeExtend(incoming) {
|
|
879
|
+
return util.safeExtend(this, incoming);
|
|
880
|
+
},
|
|
881
|
+
merge(other) {
|
|
882
|
+
return util.merge(this, other);
|
|
883
|
+
},
|
|
884
|
+
pick(mask) {
|
|
885
|
+
return util.pick(this, mask);
|
|
886
|
+
},
|
|
887
|
+
omit(mask) {
|
|
888
|
+
return util.omit(this, mask);
|
|
889
|
+
},
|
|
890
|
+
partial(...args) {
|
|
891
|
+
return util.partial(ZodOptional, this, args[0]);
|
|
892
|
+
},
|
|
893
|
+
exactPartial(...args) {
|
|
894
|
+
return util.partial(ZodExactOptional, this, args[0], "exactPartial");
|
|
895
|
+
},
|
|
896
|
+
required(...args) {
|
|
897
|
+
return util.required(ZodNonOptional, this, args[0]);
|
|
898
|
+
},
|
|
505
899
|
});
|
|
506
900
|
export function object(shape, params) {
|
|
507
901
|
const def = {
|
|
508
902
|
type: "object",
|
|
509
|
-
|
|
510
|
-
util.assignProp(this, "shape", { ...shape });
|
|
511
|
-
return this.shape;
|
|
512
|
-
},
|
|
903
|
+
shape: shape ?? {},
|
|
513
904
|
...util.normalizeParams(params),
|
|
514
905
|
};
|
|
515
906
|
return new ZodObject(def);
|
|
@@ -518,10 +909,7 @@ export function object(shape, params) {
|
|
|
518
909
|
export function strictObject(shape, params) {
|
|
519
910
|
return new ZodObject({
|
|
520
911
|
type: "object",
|
|
521
|
-
|
|
522
|
-
util.assignProp(this, "shape", { ...shape });
|
|
523
|
-
return this.shape;
|
|
524
|
-
},
|
|
912
|
+
shape,
|
|
525
913
|
catchall: never(),
|
|
526
914
|
...util.normalizeParams(params),
|
|
527
915
|
});
|
|
@@ -530,10 +918,7 @@ export function strictObject(shape, params) {
|
|
|
530
918
|
export function looseObject(shape, params) {
|
|
531
919
|
return new ZodObject({
|
|
532
920
|
type: "object",
|
|
533
|
-
|
|
534
|
-
util.assignProp(this, "shape", { ...shape });
|
|
535
|
-
return this.shape;
|
|
536
|
-
},
|
|
921
|
+
shape,
|
|
537
922
|
catchall: unknown(),
|
|
538
923
|
...util.normalizeParams(params),
|
|
539
924
|
});
|
|
@@ -541,6 +926,7 @@ export function looseObject(shape, params) {
|
|
|
541
926
|
export const ZodUnion = /*@__PURE__*/ core.$constructor("ZodUnion", (inst, def) => {
|
|
542
927
|
core.$ZodUnion.init(inst, def);
|
|
543
928
|
ZodType.init(inst, def);
|
|
929
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.unionProcessor(inst, ctx, json, params);
|
|
544
930
|
inst.options = def.options;
|
|
545
931
|
});
|
|
546
932
|
export function union(options, params) {
|
|
@@ -550,6 +936,23 @@ export function union(options, params) {
|
|
|
550
936
|
...util.normalizeParams(params),
|
|
551
937
|
});
|
|
552
938
|
}
|
|
939
|
+
export const ZodXor = /*@__PURE__*/ core.$constructor("ZodXor", (inst, def) => {
|
|
940
|
+
ZodUnion.init(inst, def);
|
|
941
|
+
core.$ZodXor.init(inst, def);
|
|
942
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.unionProcessor(inst, ctx, json, params);
|
|
943
|
+
inst.options = def.options;
|
|
944
|
+
});
|
|
945
|
+
/** Creates an exclusive union (XOR) where exactly one option must match.
|
|
946
|
+
* Unlike regular unions that succeed when any option matches, xor fails if
|
|
947
|
+
* zero or more than one option matches the input. */
|
|
948
|
+
export function xor(options, params) {
|
|
949
|
+
return new ZodXor({
|
|
950
|
+
type: "union",
|
|
951
|
+
options: options,
|
|
952
|
+
inclusive: false,
|
|
953
|
+
...util.normalizeParams(params),
|
|
954
|
+
});
|
|
955
|
+
}
|
|
553
956
|
export const ZodDiscriminatedUnion = /*@__PURE__*/ core.$constructor("ZodDiscriminatedUnion", (inst, def) => {
|
|
554
957
|
ZodUnion.init(inst, def);
|
|
555
958
|
core.$ZodDiscriminatedUnion.init(inst, def);
|
|
@@ -558,7 +961,7 @@ export function discriminatedUnion(discriminator, options, params) {
|
|
|
558
961
|
// const [options, params] = args;
|
|
559
962
|
return new ZodDiscriminatedUnion({
|
|
560
963
|
type: "union",
|
|
561
|
-
options,
|
|
964
|
+
options: options,
|
|
562
965
|
discriminator,
|
|
563
966
|
...util.normalizeParams(params),
|
|
564
967
|
});
|
|
@@ -566,6 +969,7 @@ export function discriminatedUnion(discriminator, options, params) {
|
|
|
566
969
|
export const ZodIntersection = /*@__PURE__*/ core.$constructor("ZodIntersection", (inst, def) => {
|
|
567
970
|
core.$ZodIntersection.init(inst, def);
|
|
568
971
|
ZodType.init(inst, def);
|
|
972
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.intersectionProcessor(inst, ctx, json, params);
|
|
569
973
|
});
|
|
570
974
|
export function intersection(left, right) {
|
|
571
975
|
return new ZodIntersection({
|
|
@@ -575,12 +979,27 @@ export function intersection(left, right) {
|
|
|
575
979
|
});
|
|
576
980
|
}
|
|
577
981
|
export const ZodTuple = /*@__PURE__*/ core.$constructor("ZodTuple", (inst, def) => {
|
|
982
|
+
_ensureDefaultMemoizer();
|
|
578
983
|
core.$ZodTuple.init(inst, def);
|
|
579
984
|
ZodType.init(inst, def);
|
|
580
|
-
inst.
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
985
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.tupleProcessor(inst, ctx, json, params);
|
|
986
|
+
}, {
|
|
987
|
+
rest(rest) {
|
|
988
|
+
return this.clone({
|
|
989
|
+
...this._zod.def,
|
|
990
|
+
rest: rest,
|
|
991
|
+
});
|
|
992
|
+
},
|
|
993
|
+
partial() {
|
|
994
|
+
const def = this._zod.def;
|
|
995
|
+
// a refinement was authored against the full arity; partialing would run it on a shorter array
|
|
996
|
+
if (def.checks?.length)
|
|
997
|
+
throw new Error(".partial() cannot be used on tuple schemas containing refinements");
|
|
998
|
+
return this.clone({
|
|
999
|
+
...def,
|
|
1000
|
+
items: def.items.map((item) => new ZodOptional({ type: "optional", innerType: item })),
|
|
1001
|
+
});
|
|
1002
|
+
},
|
|
584
1003
|
});
|
|
585
1004
|
export function tuple(items, _paramsOrRest, _params) {
|
|
586
1005
|
const hasRest = _paramsOrRest instanceof core.$ZodType;
|
|
@@ -594,12 +1013,23 @@ export function tuple(items, _paramsOrRest, _params) {
|
|
|
594
1013
|
});
|
|
595
1014
|
}
|
|
596
1015
|
export const ZodRecord = /*@__PURE__*/ core.$constructor("ZodRecord", (inst, def) => {
|
|
1016
|
+
_ensureDefaultMemoizer();
|
|
597
1017
|
core.$ZodRecord.init(inst, def);
|
|
598
1018
|
ZodType.init(inst, def);
|
|
1019
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.recordProcessor(inst, ctx, json, params);
|
|
599
1020
|
inst.keyType = def.keyType;
|
|
600
1021
|
inst.valueType = def.valueType;
|
|
601
1022
|
});
|
|
602
1023
|
export function record(keyType, valueType, params) {
|
|
1024
|
+
// v3-compat: z.record(valueType, params?) — defaults keyType to z.string()
|
|
1025
|
+
if (!valueType || !valueType._zod) {
|
|
1026
|
+
return new ZodRecord({
|
|
1027
|
+
type: "record",
|
|
1028
|
+
keyType: string(),
|
|
1029
|
+
valueType: keyType,
|
|
1030
|
+
...util.normalizeParams(valueType),
|
|
1031
|
+
});
|
|
1032
|
+
}
|
|
603
1033
|
return new ZodRecord({
|
|
604
1034
|
type: "record",
|
|
605
1035
|
keyType,
|
|
@@ -611,16 +1041,32 @@ export function record(keyType, valueType, params) {
|
|
|
611
1041
|
export function partialRecord(keyType, valueType, params) {
|
|
612
1042
|
return new ZodRecord({
|
|
613
1043
|
type: "record",
|
|
614
|
-
keyType
|
|
1044
|
+
keyType,
|
|
1045
|
+
valueType: valueType,
|
|
1046
|
+
...util.normalizeParams(params),
|
|
1047
|
+
partial: true,
|
|
1048
|
+
});
|
|
1049
|
+
}
|
|
1050
|
+
export function looseRecord(keyType, valueType, params) {
|
|
1051
|
+
return new ZodRecord({
|
|
1052
|
+
type: "record",
|
|
1053
|
+
keyType,
|
|
615
1054
|
valueType: valueType,
|
|
1055
|
+
mode: "loose",
|
|
616
1056
|
...util.normalizeParams(params),
|
|
617
1057
|
});
|
|
618
1058
|
}
|
|
619
1059
|
export const ZodMap = /*@__PURE__*/ core.$constructor("ZodMap", (inst, def) => {
|
|
1060
|
+
_ensureDefaultMemoizer();
|
|
620
1061
|
core.$ZodMap.init(inst, def);
|
|
621
1062
|
ZodType.init(inst, def);
|
|
1063
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.mapProcessor(inst, ctx, json, params);
|
|
622
1064
|
inst.keyType = def.keyType;
|
|
623
1065
|
inst.valueType = def.valueType;
|
|
1066
|
+
inst.min = (...args) => inst.check(core._minSize(...args));
|
|
1067
|
+
inst.nonempty = (params) => inst.check(core._minSize(1, params));
|
|
1068
|
+
inst.max = (...args) => inst.check(core._maxSize(...args));
|
|
1069
|
+
inst.size = (...args) => inst.check(core._size(...args));
|
|
624
1070
|
});
|
|
625
1071
|
export function map(keyType, valueType, params) {
|
|
626
1072
|
return new ZodMap({
|
|
@@ -631,8 +1077,10 @@ export function map(keyType, valueType, params) {
|
|
|
631
1077
|
});
|
|
632
1078
|
}
|
|
633
1079
|
export const ZodSet = /*@__PURE__*/ core.$constructor("ZodSet", (inst, def) => {
|
|
1080
|
+
_ensureDefaultMemoizer();
|
|
634
1081
|
core.$ZodSet.init(inst, def);
|
|
635
1082
|
ZodType.init(inst, def);
|
|
1083
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.setProcessor(inst, ctx, json, params);
|
|
636
1084
|
inst.min = (...args) => inst.check(core._minSize(...args));
|
|
637
1085
|
inst.nonempty = (params) => inst.check(core._minSize(1, params));
|
|
638
1086
|
inst.max = (...args) => inst.check(core._maxSize(...args));
|
|
@@ -648,8 +1096,10 @@ export function set(valueType, params) {
|
|
|
648
1096
|
export const ZodEnum = /*@__PURE__*/ core.$constructor("ZodEnum", (inst, def) => {
|
|
649
1097
|
core.$ZodEnum.init(inst, def);
|
|
650
1098
|
ZodType.init(inst, def);
|
|
1099
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.enumProcessor(inst, ctx, json, params);
|
|
651
1100
|
inst.enum = def.entries;
|
|
652
|
-
|
|
1101
|
+
// reuse the parsed value set so a numeric TS enum's reverse-mapping keys stay out
|
|
1102
|
+
inst.options = [...inst._zod.values];
|
|
653
1103
|
const keys = new Set(Object.keys(def.entries));
|
|
654
1104
|
inst.extract = (values, params) => {
|
|
655
1105
|
const newEntries = {};
|
|
@@ -710,6 +1160,7 @@ export function nativeEnum(entries, params) {
|
|
|
710
1160
|
export const ZodLiteral = /*@__PURE__*/ core.$constructor("ZodLiteral", (inst, def) => {
|
|
711
1161
|
core.$ZodLiteral.init(inst, def);
|
|
712
1162
|
ZodType.init(inst, def);
|
|
1163
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.literalProcessor(inst, ctx, json, params);
|
|
713
1164
|
inst.values = new Set(def.values);
|
|
714
1165
|
Object.defineProperty(inst, "value", {
|
|
715
1166
|
get() {
|
|
@@ -730,6 +1181,7 @@ export function literal(value, params) {
|
|
|
730
1181
|
export const ZodFile = /*@__PURE__*/ core.$constructor("ZodFile", (inst, def) => {
|
|
731
1182
|
core.$ZodFile.init(inst, def);
|
|
732
1183
|
ZodType.init(inst, def);
|
|
1184
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.fileProcessor(inst, ctx, json, params);
|
|
733
1185
|
inst.min = (size, params) => inst.check(core._minSize(size, params));
|
|
734
1186
|
inst.max = (size, params) => inst.check(core._maxSize(size, params));
|
|
735
1187
|
inst.mime = (types, params) => inst.check(core._mime(Array.isArray(types) ? types : [types], params));
|
|
@@ -738,9 +1190,14 @@ export function file(params) {
|
|
|
738
1190
|
return core._file(ZodFile, params);
|
|
739
1191
|
}
|
|
740
1192
|
export const ZodTransform = /*@__PURE__*/ core.$constructor("ZodTransform", (inst, def) => {
|
|
1193
|
+
_ensureDefaultMemoizer();
|
|
741
1194
|
core.$ZodTransform.init(inst, def);
|
|
742
1195
|
ZodType.init(inst, def);
|
|
1196
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.transformProcessor(inst, ctx, json, params);
|
|
743
1197
|
inst._zod.parse = (payload, _ctx) => {
|
|
1198
|
+
if (_ctx.direction === "backward") {
|
|
1199
|
+
throw new core.$ZodEncodeError(inst.constructor.name);
|
|
1200
|
+
}
|
|
744
1201
|
payload.addIssue = (issue) => {
|
|
745
1202
|
if (typeof issue === "string") {
|
|
746
1203
|
payload.issues.push(util.issue(issue, payload.value, def));
|
|
@@ -751,9 +1208,10 @@ export const ZodTransform = /*@__PURE__*/ core.$constructor("ZodTransform", (ins
|
|
|
751
1208
|
if (_issue.fatal)
|
|
752
1209
|
_issue.continue = false;
|
|
753
1210
|
_issue.code ?? (_issue.code = "custom");
|
|
754
|
-
|
|
1211
|
+
if (!("input" in _issue))
|
|
1212
|
+
_issue.input = payload.value;
|
|
755
1213
|
_issue.inst ?? (_issue.inst = inst);
|
|
756
|
-
|
|
1214
|
+
// _issue.continue ??= true;
|
|
757
1215
|
payload.issues.push(util.issue(_issue));
|
|
758
1216
|
}
|
|
759
1217
|
};
|
|
@@ -777,6 +1235,7 @@ export function transform(fn) {
|
|
|
777
1235
|
export const ZodOptional = /*@__PURE__*/ core.$constructor("ZodOptional", (inst, def) => {
|
|
778
1236
|
core.$ZodOptional.init(inst, def);
|
|
779
1237
|
ZodType.init(inst, def);
|
|
1238
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.optionalProcessor(inst, ctx, json, params);
|
|
780
1239
|
inst.unwrap = () => inst._zod.def.innerType;
|
|
781
1240
|
});
|
|
782
1241
|
export function optional(innerType) {
|
|
@@ -785,9 +1244,22 @@ export function optional(innerType) {
|
|
|
785
1244
|
innerType: innerType,
|
|
786
1245
|
});
|
|
787
1246
|
}
|
|
1247
|
+
export const ZodExactOptional = /*@__PURE__*/ core.$constructor("ZodExactOptional", (inst, def) => {
|
|
1248
|
+
core.$ZodExactOptional.init(inst, def);
|
|
1249
|
+
ZodType.init(inst, def);
|
|
1250
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.optionalProcessor(inst, ctx, json, params);
|
|
1251
|
+
inst.unwrap = () => inst._zod.def.innerType;
|
|
1252
|
+
});
|
|
1253
|
+
export function exactOptional(innerType) {
|
|
1254
|
+
return new ZodExactOptional({
|
|
1255
|
+
type: "optional",
|
|
1256
|
+
innerType: innerType,
|
|
1257
|
+
});
|
|
1258
|
+
}
|
|
788
1259
|
export const ZodNullable = /*@__PURE__*/ core.$constructor("ZodNullable", (inst, def) => {
|
|
789
1260
|
core.$ZodNullable.init(inst, def);
|
|
790
1261
|
ZodType.init(inst, def);
|
|
1262
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.nullableProcessor(inst, ctx, json, params);
|
|
791
1263
|
inst.unwrap = () => inst._zod.def.innerType;
|
|
792
1264
|
});
|
|
793
1265
|
export function nullable(innerType) {
|
|
@@ -803,6 +1275,7 @@ export function nullish(innerType) {
|
|
|
803
1275
|
export const ZodDefault = /*@__PURE__*/ core.$constructor("ZodDefault", (inst, def) => {
|
|
804
1276
|
core.$ZodDefault.init(inst, def);
|
|
805
1277
|
ZodType.init(inst, def);
|
|
1278
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.defaultProcessor(inst, ctx, json, params);
|
|
806
1279
|
inst.unwrap = () => inst._zod.def.innerType;
|
|
807
1280
|
inst.removeDefault = inst.unwrap;
|
|
808
1281
|
});
|
|
@@ -811,13 +1284,14 @@ export function _default(innerType, defaultValue) {
|
|
|
811
1284
|
type: "default",
|
|
812
1285
|
innerType: innerType,
|
|
813
1286
|
get defaultValue() {
|
|
814
|
-
return typeof defaultValue === "function" ? defaultValue() : defaultValue;
|
|
1287
|
+
return typeof defaultValue === "function" ? defaultValue() : util.shallowClone(defaultValue);
|
|
815
1288
|
},
|
|
816
1289
|
});
|
|
817
1290
|
}
|
|
818
1291
|
export const ZodPrefault = /*@__PURE__*/ core.$constructor("ZodPrefault", (inst, def) => {
|
|
819
1292
|
core.$ZodPrefault.init(inst, def);
|
|
820
1293
|
ZodType.init(inst, def);
|
|
1294
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.prefaultProcessor(inst, ctx, json, params);
|
|
821
1295
|
inst.unwrap = () => inst._zod.def.innerType;
|
|
822
1296
|
});
|
|
823
1297
|
export function prefault(innerType, defaultValue) {
|
|
@@ -825,13 +1299,14 @@ export function prefault(innerType, defaultValue) {
|
|
|
825
1299
|
type: "prefault",
|
|
826
1300
|
innerType: innerType,
|
|
827
1301
|
get defaultValue() {
|
|
828
|
-
return typeof defaultValue === "function" ? defaultValue() : defaultValue;
|
|
1302
|
+
return typeof defaultValue === "function" ? defaultValue() : util.shallowClone(defaultValue);
|
|
829
1303
|
},
|
|
830
1304
|
});
|
|
831
1305
|
}
|
|
832
1306
|
export const ZodNonOptional = /*@__PURE__*/ core.$constructor("ZodNonOptional", (inst, def) => {
|
|
833
1307
|
core.$ZodNonOptional.init(inst, def);
|
|
834
1308
|
ZodType.init(inst, def);
|
|
1309
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.nonoptionalProcessor(inst, ctx, json, params);
|
|
835
1310
|
inst.unwrap = () => inst._zod.def.innerType;
|
|
836
1311
|
});
|
|
837
1312
|
export function nonoptional(innerType, params) {
|
|
@@ -844,6 +1319,7 @@ export function nonoptional(innerType, params) {
|
|
|
844
1319
|
export const ZodSuccess = /*@__PURE__*/ core.$constructor("ZodSuccess", (inst, def) => {
|
|
845
1320
|
core.$ZodSuccess.init(inst, def);
|
|
846
1321
|
ZodType.init(inst, def);
|
|
1322
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.successProcessor(inst, ctx, json, params);
|
|
847
1323
|
inst.unwrap = () => inst._zod.def.innerType;
|
|
848
1324
|
});
|
|
849
1325
|
export function success(innerType) {
|
|
@@ -855,6 +1331,7 @@ export function success(innerType) {
|
|
|
855
1331
|
export const ZodCatch = /*@__PURE__*/ core.$constructor("ZodCatch", (inst, def) => {
|
|
856
1332
|
core.$ZodCatch.init(inst, def);
|
|
857
1333
|
ZodType.init(inst, def);
|
|
1334
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.catchProcessor(inst, ctx, json, params);
|
|
858
1335
|
inst.unwrap = () => inst._zod.def.innerType;
|
|
859
1336
|
inst.removeCatch = inst.unwrap;
|
|
860
1337
|
});
|
|
@@ -862,13 +1339,14 @@ function _catch(innerType, catchValue) {
|
|
|
862
1339
|
return new ZodCatch({
|
|
863
1340
|
type: "catch",
|
|
864
1341
|
innerType: innerType,
|
|
865
|
-
catchValue: (typeof catchValue === "function" ? catchValue : (
|
|
1342
|
+
catchValue: (typeof catchValue === "function" ? catchValue : core.util.constantCatch(catchValue)),
|
|
866
1343
|
});
|
|
867
1344
|
}
|
|
868
1345
|
export { _catch as catch };
|
|
869
1346
|
export const ZodNaN = /*@__PURE__*/ core.$constructor("ZodNaN", (inst, def) => {
|
|
870
1347
|
core.$ZodNaN.init(inst, def);
|
|
871
1348
|
ZodType.init(inst, def);
|
|
1349
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.nanProcessor(inst, ctx, json, params);
|
|
872
1350
|
});
|
|
873
1351
|
export function nan(params) {
|
|
874
1352
|
return core._nan(ZodNaN, params);
|
|
@@ -876,6 +1354,7 @@ export function nan(params) {
|
|
|
876
1354
|
export const ZodPipe = /*@__PURE__*/ core.$constructor("ZodPipe", (inst, def) => {
|
|
877
1355
|
core.$ZodPipe.init(inst, def);
|
|
878
1356
|
ZodType.init(inst, def);
|
|
1357
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.pipeProcessor(inst, ctx, json, params);
|
|
879
1358
|
inst.in = def.in;
|
|
880
1359
|
inst.out = def.out;
|
|
881
1360
|
});
|
|
@@ -887,9 +1366,38 @@ export function pipe(in_, out) {
|
|
|
887
1366
|
// ...util.normalizeParams(params),
|
|
888
1367
|
});
|
|
889
1368
|
}
|
|
1369
|
+
export const ZodCodec = /*@__PURE__*/ core.$constructor("ZodCodec", (inst, def) => {
|
|
1370
|
+
ZodPipe.init(inst, def);
|
|
1371
|
+
core.$ZodCodec.init(inst, def);
|
|
1372
|
+
});
|
|
1373
|
+
export function codec(in_, out, params) {
|
|
1374
|
+
return new ZodCodec({
|
|
1375
|
+
type: "pipe",
|
|
1376
|
+
in: in_,
|
|
1377
|
+
out: out,
|
|
1378
|
+
transform: params.decode,
|
|
1379
|
+
reverseTransform: params.encode,
|
|
1380
|
+
});
|
|
1381
|
+
}
|
|
1382
|
+
export function invertCodec(codec) {
|
|
1383
|
+
const def = codec._zod.def;
|
|
1384
|
+
return new ZodCodec({
|
|
1385
|
+
type: "pipe",
|
|
1386
|
+
in: def.out,
|
|
1387
|
+
out: def.in,
|
|
1388
|
+
transform: def.reverseTransform,
|
|
1389
|
+
reverseTransform: def.transform,
|
|
1390
|
+
});
|
|
1391
|
+
}
|
|
1392
|
+
export const ZodPreprocess = /*@__PURE__*/ core.$constructor("ZodPreprocess", (inst, def) => {
|
|
1393
|
+
ZodPipe.init(inst, def);
|
|
1394
|
+
core.$ZodPreprocess.init(inst, def);
|
|
1395
|
+
});
|
|
890
1396
|
export const ZodReadonly = /*@__PURE__*/ core.$constructor("ZodReadonly", (inst, def) => {
|
|
891
1397
|
core.$ZodReadonly.init(inst, def);
|
|
892
1398
|
ZodType.init(inst, def);
|
|
1399
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.readonlyProcessor(inst, ctx, json, params);
|
|
1400
|
+
inst.unwrap = () => inst._zod.def.innerType;
|
|
893
1401
|
});
|
|
894
1402
|
export function readonly(innerType) {
|
|
895
1403
|
return new ZodReadonly({
|
|
@@ -900,6 +1408,7 @@ export function readonly(innerType) {
|
|
|
900
1408
|
export const ZodTemplateLiteral = /*@__PURE__*/ core.$constructor("ZodTemplateLiteral", (inst, def) => {
|
|
901
1409
|
core.$ZodTemplateLiteral.init(inst, def);
|
|
902
1410
|
ZodType.init(inst, def);
|
|
1411
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.templateLiteralProcessor(inst, ctx, json, params);
|
|
903
1412
|
});
|
|
904
1413
|
export function templateLiteral(parts, params) {
|
|
905
1414
|
return new ZodTemplateLiteral({
|
|
@@ -911,6 +1420,7 @@ export function templateLiteral(parts, params) {
|
|
|
911
1420
|
export const ZodLazy = /*@__PURE__*/ core.$constructor("ZodLazy", (inst, def) => {
|
|
912
1421
|
core.$ZodLazy.init(inst, def);
|
|
913
1422
|
ZodType.init(inst, def);
|
|
1423
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.lazyProcessor(inst, ctx, json, params);
|
|
914
1424
|
inst.unwrap = () => inst._zod.def.getter();
|
|
915
1425
|
});
|
|
916
1426
|
export function lazy(getter) {
|
|
@@ -922,6 +1432,7 @@ export function lazy(getter) {
|
|
|
922
1432
|
export const ZodPromise = /*@__PURE__*/ core.$constructor("ZodPromise", (inst, def) => {
|
|
923
1433
|
core.$ZodPromise.init(inst, def);
|
|
924
1434
|
ZodType.init(inst, def);
|
|
1435
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.promiseProcessor(inst, ctx, json, params);
|
|
925
1436
|
inst.unwrap = () => inst._zod.def.innerType;
|
|
926
1437
|
});
|
|
927
1438
|
export function promise(innerType) {
|
|
@@ -930,9 +1441,23 @@ export function promise(innerType) {
|
|
|
930
1441
|
innerType: innerType,
|
|
931
1442
|
});
|
|
932
1443
|
}
|
|
1444
|
+
export const ZodFunction = /*@__PURE__*/ core.$constructor("ZodFunction", (inst, def) => {
|
|
1445
|
+
core.$ZodFunction.init(inst, def);
|
|
1446
|
+
ZodType.init(inst, def);
|
|
1447
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.functionProcessor(inst, ctx, json, params);
|
|
1448
|
+
});
|
|
1449
|
+
export function _function(params) {
|
|
1450
|
+
return new ZodFunction({
|
|
1451
|
+
type: "function",
|
|
1452
|
+
input: Array.isArray(params?.input) ? tuple(params?.input) : (params?.input ?? array(unknown())),
|
|
1453
|
+
output: params?.output ?? unknown(),
|
|
1454
|
+
});
|
|
1455
|
+
}
|
|
1456
|
+
export { _function as function };
|
|
933
1457
|
export const ZodCustom = /*@__PURE__*/ core.$constructor("ZodCustom", (inst, def) => {
|
|
934
1458
|
core.$ZodCustom.init(inst, def);
|
|
935
1459
|
ZodType.init(inst, def);
|
|
1460
|
+
inst._zod.processJSONSchema = (ctx, json, params) => processors.customProcessor(inst, ctx, json, params);
|
|
936
1461
|
});
|
|
937
1462
|
// custom checks
|
|
938
1463
|
export function check(fn) {
|
|
@@ -950,32 +1475,22 @@ export function refine(fn, _params = {}) {
|
|
|
950
1475
|
return core._refine(ZodCustom, fn, _params);
|
|
951
1476
|
}
|
|
952
1477
|
// superRefine
|
|
953
|
-
export function superRefine(fn) {
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
}
|
|
970
|
-
};
|
|
971
|
-
return fn(payload.value, payload);
|
|
972
|
-
});
|
|
973
|
-
return ch;
|
|
974
|
-
}
|
|
975
|
-
function _instanceof(cls, params = {
|
|
976
|
-
error: `Input not instance of ${cls.name}`,
|
|
977
|
-
}) {
|
|
978
|
-
const inst = new ZodCustom({
|
|
1478
|
+
export function superRefine(fn, params) {
|
|
1479
|
+
return core._superRefine(fn, params);
|
|
1480
|
+
}
|
|
1481
|
+
// Re-export describe and meta from core
|
|
1482
|
+
export const describe = core.describe;
|
|
1483
|
+
export const meta = core.meta;
|
|
1484
|
+
export const ZodInstanceOf = /*@__PURE__*/ core.$constructor("ZodInstanceOf", (inst, def) => {
|
|
1485
|
+
ZodCustom.init(inst, def);
|
|
1486
|
+
}, {
|
|
1487
|
+
properties(shape, params) {
|
|
1488
|
+
// asserts in place, so the narrowed output type is truthful without a wrapper
|
|
1489
|
+
return this.check(core._properties(shape, params));
|
|
1490
|
+
},
|
|
1491
|
+
});
|
|
1492
|
+
function _instanceof(cls, params = {}) {
|
|
1493
|
+
const inst = new ZodInstanceOf({
|
|
979
1494
|
type: "custom",
|
|
980
1495
|
check: "custom",
|
|
981
1496
|
fn: (data) => data instanceof cls,
|
|
@@ -983,15 +1498,26 @@ function _instanceof(cls, params = {
|
|
|
983
1498
|
...util.normalizeParams(params),
|
|
984
1499
|
});
|
|
985
1500
|
inst._zod.bag.Class = cls;
|
|
1501
|
+
// Override check to emit invalid_type instead of custom
|
|
1502
|
+
inst._zod.check = (payload) => {
|
|
1503
|
+
if (!(payload.value instanceof cls)) {
|
|
1504
|
+
payload.issues.push({
|
|
1505
|
+
code: "invalid_type",
|
|
1506
|
+
expected: cls.name,
|
|
1507
|
+
input: payload.value,
|
|
1508
|
+
inst,
|
|
1509
|
+
path: [...(inst._zod.def.path ?? [])],
|
|
1510
|
+
});
|
|
1511
|
+
}
|
|
1512
|
+
};
|
|
986
1513
|
return inst;
|
|
987
1514
|
}
|
|
988
1515
|
export { _instanceof as instanceof };
|
|
989
1516
|
// stringbool
|
|
990
1517
|
export const stringbool = (...args) => core._stringbool({
|
|
991
|
-
|
|
1518
|
+
Codec: ZodCodec,
|
|
992
1519
|
Boolean: ZodBoolean,
|
|
993
1520
|
String: ZodString,
|
|
994
|
-
Transform: ZodTransform,
|
|
995
1521
|
}, ...args);
|
|
996
1522
|
export function json(params) {
|
|
997
1523
|
const jsonSchema = lazy(() => {
|
|
@@ -1000,7 +1526,10 @@ export function json(params) {
|
|
|
1000
1526
|
return jsonSchema;
|
|
1001
1527
|
}
|
|
1002
1528
|
// preprocess
|
|
1003
|
-
// /** @deprecated Use `z.pipe()` and `z.transform()` instead. */
|
|
1004
1529
|
export function preprocess(fn, schema) {
|
|
1005
|
-
return
|
|
1530
|
+
return new ZodPreprocess({
|
|
1531
|
+
type: "pipe",
|
|
1532
|
+
in: transform(fn),
|
|
1533
|
+
out: schema,
|
|
1534
|
+
});
|
|
1006
1535
|
}
|