@psnext/slingcli 3.1.20260904-1 → 3.3.20260911-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/util/index.js +5 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/util/hasOwn.js +3 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/util/index.js +1 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/util/hasOwn.d.ts +4 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/util/index.d.ts +1 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/util/hasOwn.d.ts +1 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/util/index.d.ts +1 -0
- package/node_modules/@aws-sdk/core/package.json +1 -1
- package/node_modules/@aws-sdk/credential-provider-env/package.json +2 -2
- package/node_modules/@aws-sdk/credential-provider-http/package.json +2 -2
- package/node_modules/@aws-sdk/credential-provider-ini/package.json +9 -9
- package/node_modules/@aws-sdk/credential-provider-login/package.json +3 -3
- package/node_modules/@aws-sdk/credential-provider-node/package.json +7 -7
- package/node_modules/@aws-sdk/credential-provider-process/package.json +2 -2
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/package.json +3 -3
- package/node_modules/@aws-sdk/credential-provider-sso/package.json +4 -4
- package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +3 -3
- package/node_modules/@aws-sdk/middleware-websocket/package.json +2 -2
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/package.json +2 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{chunk-PBNSMEG7.js → chunk-VDBOM5UG.js} +9 -9
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/cli.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/index.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/rpc-entry.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/Client.md +25 -8
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/EnvHttpProxyAgent.md +3 -2
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/EventSource.md +4 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/Interceptors.md +7 -3
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/Socks5ProxyAgent.md +7 -1
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/api/readable.js +33 -43
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/cache/memory-cache-store.js +2 -2
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/core/connect.js +16 -2
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/core/symbols.js +3 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/agent.js +7 -2
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/balanced-pool.js +7 -4
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/client-h1.js +9 -1
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/client-h2.js +221 -12
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/client.js +76 -30
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/dispatcher-base.js +13 -1
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/dispatcher.js +15 -1
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/dispatcher1-wrapper.js +3 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +37 -8
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/proxy-agent.js +18 -1
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/retry-agent.js +3 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/round-robin-pool.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/socks5-proxy-agent.js +106 -22
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/handler/cache-handler.js +29 -5
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/handler/decorator-handler.js +7 -1
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/handler/deduplication-handler.js +12 -6
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/handler/redirect-handler.js +21 -4
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/handler/retry-handler.js +155 -32
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/interceptor/cache.js +65 -9
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/interceptor/decompress.js +115 -13
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/interceptor/deduplicate.js +5 -4
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/interceptor/dns.js +7 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/interceptor/dump.js +10 -23
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/mock/mock-agent.js +13 -1
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/mock/mock-utils.js +217 -27
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/util/cache.js +43 -3
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/cookies/parse.js +150 -147
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/eventsource/eventsource-stream.js +28 -1
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/eventsource/eventsource.js +13 -3
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/fetch/index.js +6 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/fetch/request.js +2 -3
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/fetch/util.js +6 -1
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/webidl/index.js +3 -3
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/websocket/connection.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/websocket/permessage-deflate.js +5 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/websocket/stream/websocketstream.js +8 -10
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/websocket/websocket.js +22 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/package.json +3 -3
- package/node_modules/@earendil-works/pi-coding-agent/npm-shrinkwrap.json +4 -4
- package/node_modules/@earendil-works/pi-coding-agent/package.json +1 -1
- package/node_modules/@smithy/core/dist-cjs/submodules/errors/index.js +20 -0
- package/node_modules/@smithy/core/dist-cjs/submodules/retry/index.browser.js +11 -10
- package/node_modules/@smithy/core/dist-cjs/submodules/retry/index.js +11 -10
- package/node_modules/@smithy/core/dist-es/submodules/errors/errors.js +18 -0
- package/node_modules/@smithy/core/dist-es/submodules/errors/index.js +1 -0
- package/node_modules/@smithy/core/dist-es/submodules/retry/service-error-classification/service-error-classification.js +11 -10
- package/node_modules/@smithy/core/dist-types/submodules/errors/errors.d.ts +44 -0
- package/node_modules/@smithy/core/dist-types/submodules/errors/index.d.ts +1 -0
- package/node_modules/@smithy/core/dist-types/submodules/retry/service-error-classification/service-error-classification.d.ts +4 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/errors/errors.d.ts +44 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/errors/index.d.ts +1 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/retry/service-error-classification/service-error-classification.d.ts +4 -0
- package/node_modules/@smithy/core/errors.d.ts +5 -0
- package/node_modules/@smithy/core/errors.js +5 -0
- package/node_modules/@smithy/core/package.json +11 -2
- package/node_modules/@types/node/README.md +3 -3
- package/node_modules/@types/node/assert/strict.d.ts +56 -13
- package/node_modules/@types/node/assert.d.ts +190 -189
- package/node_modules/@types/node/async_hooks.d.ts +43 -151
- package/node_modules/@types/node/buffer.buffer.d.ts +13 -12
- package/node_modules/@types/node/buffer.d.ts +237 -102
- package/node_modules/@types/node/child_process.d.ts +154 -39
- package/node_modules/@types/node/cluster.d.ts +384 -238
- package/node_modules/@types/node/compatibility/disposable.d.ts +14 -0
- package/node_modules/@types/node/compatibility/index.d.ts +9 -0
- package/node_modules/@types/node/compatibility/indexable.d.ts +20 -0
- package/node_modules/@types/node/compatibility/iterators.d.ts +20 -0
- package/node_modules/@types/node/console.d.ts +404 -45
- package/node_modules/@types/node/constants.d.ts +10 -3
- package/node_modules/@types/node/crypto.d.ts +1600 -1007
- package/node_modules/@types/node/dgram.d.ts +81 -133
- package/node_modules/@types/node/diagnostics_channel.d.ts +59 -277
- package/node_modules/@types/node/dns/promises.d.ts +15 -9
- package/node_modules/@types/node/dns.d.ts +183 -136
- package/node_modules/@types/node/domain.d.ts +32 -12
- package/node_modules/@types/node/events.d.ts +696 -728
- package/node_modules/@types/node/fs/promises.d.ts +85 -256
- package/node_modules/@types/node/fs.d.ts +525 -865
- package/node_modules/@types/node/globals.d.ts +34 -12
- package/node_modules/@types/node/globals.typedarray.d.ts +0 -63
- package/node_modules/@types/node/http.d.ts +311 -432
- package/node_modules/@types/node/http2.d.ts +891 -545
- package/node_modules/@types/node/https.d.ts +243 -64
- package/node_modules/@types/node/index.d.ts +7 -25
- package/node_modules/@types/node/inspector.d.ts +58 -70
- package/node_modules/@types/node/inspector.generated.d.ts +411 -765
- package/node_modules/@types/node/module.d.ts +219 -54
- package/node_modules/@types/node/net.d.ts +222 -208
- package/node_modules/@types/node/os.d.ts +49 -41
- package/node_modules/@types/node/package.json +3 -13
- package/node_modules/@types/node/path.d.ts +141 -119
- package/node_modules/@types/node/perf_hooks.d.ts +673 -310
- package/node_modules/@types/node/process.d.ts +205 -389
- package/node_modules/@types/node/punycode.d.ts +31 -3
- package/node_modules/@types/node/querystring.d.ts +16 -3
- package/node_modules/@types/node/readline/promises.d.ts +6 -3
- package/node_modules/@types/node/readline.d.ts +152 -66
- package/node_modules/@types/node/repl.d.ts +109 -101
- package/node_modules/@types/node/sea.d.ts +116 -1
- package/node_modules/@types/node/sqlite.d.ts +68 -486
- package/node_modules/@types/node/stream/consumers.d.ts +15 -91
- package/node_modules/@types/node/stream/promises.d.ts +15 -136
- package/node_modules/@types/node/stream/web.d.ts +456 -179
- package/node_modules/@types/node/stream.d.ts +491 -603
- package/node_modules/@types/node/string_decoder.d.ts +43 -3
- package/node_modules/@types/node/test.d.ts +292 -513
- package/node_modules/@types/node/timers/promises.d.ts +18 -3
- package/node_modules/@types/node/timers.d.ts +141 -3
- package/node_modules/@types/node/tls.d.ts +242 -140
- package/node_modules/@types/node/trace_events.d.ts +97 -3
- package/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +8 -7
- package/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +0 -2
- package/node_modules/@types/node/ts5.6/index.d.ts +6 -26
- package/node_modules/@types/node/tty.d.ts +43 -61
- package/node_modules/@types/node/url.d.ts +584 -156
- package/node_modules/@types/node/util.d.ts +1110 -181
- package/node_modules/@types/node/v8.d.ts +36 -175
- package/node_modules/@types/node/vm.d.ts +209 -292
- package/node_modules/@types/node/wasi.d.ts +74 -24
- package/node_modules/@types/node/web-globals/abortcontroller.d.ts +2 -27
- package/node_modules/@types/node/web-globals/domexception.d.ts +0 -15
- package/node_modules/@types/node/web-globals/events.d.ts +0 -9
- package/node_modules/@types/node/web-globals/fetch.d.ts +0 -14
- package/node_modules/@types/node/web-globals/navigator.d.ts +0 -3
- package/node_modules/@types/node/web-globals/streams.d.ts +0 -93
- package/node_modules/@types/node/worker_threads.d.ts +407 -257
- package/node_modules/@types/node/zlib.d.ts +165 -7
- package/node_modules/hono/dist/cjs/client/client.js +4 -4
- package/node_modules/hono/dist/cjs/hono-base.js +7 -6
- package/node_modules/hono/dist/cjs/jsx/base.js +18 -1
- package/node_modules/hono/dist/cjs/jsx/components.js +25 -26
- package/node_modules/hono/dist/cjs/jsx/context.js +5 -5
- package/node_modules/hono/dist/cjs/jsx/dom/server.js +5 -1
- package/node_modules/hono/dist/cjs/jsx/intrinsic-element/components.js +2 -2
- package/node_modules/hono/dist/cjs/jsx/streaming.js +4 -5
- package/node_modules/hono/dist/client/client.js +4 -4
- package/node_modules/hono/dist/hono-base.js +7 -6
- package/node_modules/hono/dist/jsx/base.js +15 -1
- package/node_modules/hono/dist/jsx/components.js +26 -27
- package/node_modules/hono/dist/jsx/context.js +6 -6
- package/node_modules/hono/dist/jsx/dom/server.js +5 -1
- package/node_modules/hono/dist/jsx/intrinsic-element/components.js +3 -3
- package/node_modules/hono/dist/jsx/streaming.js +5 -6
- package/node_modules/hono/dist/types/context.d.ts +2 -2
- package/node_modules/hono/dist/types/jsx/base.d.ts +3 -0
- package/node_modules/hono/package.json +2 -2
- package/node_modules/jose/dist/types/index.d.ts +1 -2
- package/node_modules/jose/dist/types/jwe/compact/decrypt.d.ts +7 -11
- package/node_modules/jose/dist/types/jwe/compact/encrypt.d.ts +13 -16
- package/node_modules/jose/dist/types/jwe/flattened/decrypt.d.ts +7 -11
- package/node_modules/jose/dist/types/jwe/flattened/encrypt.d.ts +16 -19
- package/node_modules/jose/dist/types/jwe/general/decrypt.d.ts +10 -16
- package/node_modules/jose/dist/types/jwe/general/encrypt.d.ts +18 -21
- package/node_modules/jose/dist/types/jwk/embedded.d.ts +3 -1
- package/node_modules/jose/dist/types/jwk/thumbprint.d.ts +4 -6
- package/node_modules/jose/dist/types/jwks/local.d.ts +5 -4
- package/node_modules/jose/dist/types/jwks/remote.d.ts +20 -21
- package/node_modules/jose/dist/types/jws/compact/sign.d.ts +4 -4
- package/node_modules/jose/dist/types/jws/compact/verify.d.ts +8 -11
- package/node_modules/jose/dist/types/jws/flattened/sign.d.ts +5 -5
- package/node_modules/jose/dist/types/jws/flattened/verify.d.ts +8 -11
- package/node_modules/jose/dist/types/jws/general/sign.d.ts +10 -14
- package/node_modules/jose/dist/types/jws/general/verify.d.ts +11 -17
- package/node_modules/jose/dist/types/jwt/decrypt.d.ts +14 -11
- package/node_modules/jose/dist/types/jwt/encrypt.d.ts +24 -22
- package/node_modules/jose/dist/types/jwt/sign.d.ts +3 -7
- package/node_modules/jose/dist/types/jwt/unsecured.d.ts +2 -6
- package/node_modules/jose/dist/types/jwt/verify.d.ts +13 -6
- package/node_modules/jose/dist/types/key/export.d.ts +6 -6
- package/node_modules/jose/dist/types/key/generate_key_pair.d.ts +9 -14
- package/node_modules/jose/dist/types/key/generate_secret.d.ts +10 -10
- package/node_modules/jose/dist/types/key/import.d.ts +19 -18
- package/node_modules/jose/dist/types/types.d.ts +152 -247
- package/node_modules/jose/dist/types/util/base64url.d.ts +7 -7
- package/node_modules/jose/dist/types/util/decode_jwt.d.ts +6 -1
- package/node_modules/jose/dist/types/util/decode_protected_header.d.ts +4 -3
- package/node_modules/jose/dist/types/util/errors.d.ts +29 -40
- package/node_modules/jose/dist/webapi/jwe/compact/decrypt.js +1 -2
- package/node_modules/jose/dist/webapi/jwe/compact/encrypt.js +9 -26
- package/node_modules/jose/dist/webapi/jwe/flattened/decrypt.js +3 -3
- package/node_modules/jose/dist/webapi/jwe/flattened/encrypt.js +11 -30
- package/node_modules/jose/dist/webapi/jwe/general/decrypt.js +6 -6
- package/node_modules/jose/dist/webapi/jwe/general/encrypt.js +33 -57
- package/node_modules/jose/dist/webapi/jwk/embedded.js +3 -4
- package/node_modules/jose/dist/webapi/jwk/thumbprint.js +3 -6
- package/node_modules/jose/dist/webapi/jwks/local.js +16 -10
- package/node_modules/jose/dist/webapi/jwks/remote.js +2 -2
- package/node_modules/jose/dist/webapi/jws/compact/sign.js +2 -4
- package/node_modules/jose/dist/webapi/jws/compact/verify.js +2 -2
- package/node_modules/jose/dist/webapi/jws/flattened/sign.js +8 -15
- package/node_modules/jose/dist/webapi/jws/flattened/verify.js +4 -14
- package/node_modules/jose/dist/webapi/jws/general/sign.js +4 -11
- package/node_modules/jose/dist/webapi/jws/general/verify.js +5 -7
- package/node_modules/jose/dist/webapi/jwt/decrypt.js +2 -3
- package/node_modules/jose/dist/webapi/jwt/encrypt.js +11 -25
- package/node_modules/jose/dist/webapi/jwt/sign.js +1 -1
- package/node_modules/jose/dist/webapi/jwt/unsecured.js +1 -2
- package/node_modules/jose/dist/webapi/jwt/verify.js +4 -4
- package/node_modules/jose/dist/webapi/key/export.js +12 -16
- package/node_modules/jose/dist/webapi/key/generate_key_pair.js +4 -13
- package/node_modules/jose/dist/webapi/key/generate_secret.js +1 -1
- package/node_modules/jose/dist/webapi/key/import.js +5 -9
- package/node_modules/jose/dist/webapi/lib/asn1.js +2 -4
- package/node_modules/jose/dist/webapi/lib/buffer_utils.js +35 -0
- package/node_modules/jose/dist/webapi/lib/content_encryption.js +21 -29
- package/node_modules/jose/dist/webapi/lib/deflate.js +9 -19
- package/node_modules/jose/dist/webapi/lib/jwe_algorithms.js +0 -4
- package/node_modules/jose/dist/webapi/lib/jwe_decrypt.js +21 -54
- package/node_modules/jose/dist/webapi/lib/jwe_encrypt.js +26 -59
- package/node_modules/jose/dist/webapi/lib/jws_sign.js +29 -43
- package/node_modules/jose/dist/webapi/lib/jws_verify.js +37 -45
- package/node_modules/jose/dist/webapi/lib/jwt_claims_set.js +1 -1
- package/node_modules/jose/dist/webapi/lib/key.js +119 -59
- package/node_modules/jose/dist/webapi/lib/key_management.js +45 -80
- package/node_modules/jose/dist/webapi/lib/{options.js → validate.js} +64 -3
- package/node_modules/jose/dist/webapi/util/base64url.js +5 -19
- package/node_modules/jose/dist/webapi/util/decode_jwt.js +1 -1
- package/node_modules/jose/dist/webapi/util/decode_protected_header.js +1 -1
- package/node_modules/jose/package.json +1 -1
- package/node_modules/undici/lib/dispatcher/balanced-pool.js +4 -2
- package/node_modules/undici/lib/dispatcher/client-h1.js +12 -4
- package/node_modules/undici/lib/dispatcher/client-h2.js +70 -14
- package/node_modules/undici/lib/dispatcher/client.js +6 -2
- package/node_modules/undici/lib/handler/cache-handler.js +21 -5
- package/node_modules/undici/lib/handler/retry-handler.js +42 -7
- package/node_modules/undici/lib/interceptor/cache.js +20 -1
- package/node_modules/undici/lib/interceptor/decompress.js +146 -14
- package/node_modules/undici/lib/interceptor/dump.js +10 -23
- package/node_modules/undici/lib/web/eventsource/eventsource-stream.js +245 -150
- package/node_modules/undici/lib/web/websocket/connection.js +1 -1
- package/node_modules/undici/lib/web/websocket/permessage-deflate.js +5 -0
- package/node_modules/undici/lib/web/websocket/stream/websocketstream.js +8 -10
- package/node_modules/undici/package.json +1 -1
- package/node_modules/undici/types/interceptors.d.ts +2 -0
- package/node_modules/undici-types/agent.d.ts +13 -12
- package/node_modules/undici-types/api.d.ts +26 -26
- package/node_modules/undici-types/balanced-pool.d.ts +12 -13
- package/node_modules/undici-types/client.d.ts +34 -55
- package/node_modules/undici-types/connector.d.ts +2 -4
- package/node_modules/undici-types/cookies.d.ts +0 -2
- package/node_modules/undici-types/diagnostics-channel.d.ts +10 -18
- package/node_modules/undici-types/dispatcher.d.ts +137 -134
- package/node_modules/undici-types/env-http-proxy-agent.d.ts +3 -4
- package/node_modules/undici-types/errors.d.ts +54 -82
- package/node_modules/undici-types/eventsource.d.ts +4 -9
- package/node_modules/undici-types/fetch.d.ts +24 -46
- package/node_modules/undici-types/file.d.ts +39 -0
- package/node_modules/undici-types/filereader.d.ts +54 -0
- package/node_modules/undici-types/formdata.d.ts +7 -7
- package/node_modules/undici-types/global-dispatcher.d.ts +4 -4
- package/node_modules/undici-types/global-origin.d.ts +5 -5
- package/node_modules/undici-types/handlers.d.ts +9 -8
- package/node_modules/undici-types/header.d.ts +1 -162
- package/node_modules/undici-types/index.d.ts +47 -69
- package/node_modules/undici-types/interceptors.d.ts +9 -72
- package/node_modules/undici-types/mock-agent.d.ts +18 -36
- package/node_modules/undici-types/mock-client.d.ts +4 -6
- package/node_modules/undici-types/mock-errors.d.ts +3 -3
- package/node_modules/undici-types/mock-interceptor.d.ts +20 -21
- package/node_modules/undici-types/mock-pool.d.ts +4 -6
- package/node_modules/undici-types/package.json +1 -1
- package/node_modules/undici-types/patch.d.ts +4 -0
- package/node_modules/undici-types/pool-stats.d.ts +8 -8
- package/node_modules/undici-types/pool.d.ts +14 -14
- package/node_modules/undici-types/proxy-agent.d.ts +6 -7
- package/node_modules/undici-types/readable.d.ts +16 -19
- package/node_modules/undici-types/retry-agent.d.ts +1 -1
- package/node_modules/undici-types/retry-handler.d.ts +10 -19
- package/node_modules/undici-types/util.d.ts +3 -3
- package/node_modules/undici-types/webidl.d.ts +30 -148
- package/node_modules/undici-types/websocket.d.ts +10 -48
- package/node_modules/zod/compile.cjs +19 -0
- package/node_modules/zod/index.cjs +19 -0
- package/node_modules/zod/locales/index.cjs +19 -0
- package/node_modules/zod/mini/index.cjs +19 -0
- package/node_modules/zod/package.json +8 -7
- package/node_modules/zod/src/v3/helpers/errorUtil.ts +1 -1
- package/node_modules/zod/src/v4/classic/checks.ts +0 -1
- package/node_modules/zod/src/v4/classic/external.ts +2 -0
- package/node_modules/zod/src/v4/classic/from-json-schema.ts +248 -25
- package/node_modules/zod/src/v4/classic/schemas.ts +255 -164
- package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +59 -9
- package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +6 -0
- package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +2 -2
- package/node_modules/zod/src/v4/classic/tests/cyclic-data.test.ts +274 -0
- package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +112 -6
- package/node_modules/zod/src/v4/classic/tests/enum.test.ts +9 -0
- package/node_modules/zod/src/v4/classic/tests/error.test.ts +130 -1
- package/node_modules/zod/src/v4/classic/tests/firstparty.test.ts +4 -0
- package/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +157 -0
- package/node_modules/zod/src/v4/classic/tests/iban.test.ts +81 -0
- package/node_modules/zod/src/v4/classic/tests/instance-footprint.test.ts +18 -2
- package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +27 -7
- package/node_modules/zod/src/v4/classic/tests/issue-schema.test.ts +88 -56
- package/node_modules/zod/src/v4/classic/tests/object.test.ts +56 -0
- package/node_modules/zod/src/v4/classic/tests/optin-ladder.test.ts +3 -2
- package/node_modules/zod/src/v4/classic/tests/prefault.test.ts +70 -0
- package/node_modules/zod/src/v4/classic/tests/properties.test.ts +225 -0
- package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +46 -1
- package/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +19 -0
- package/node_modules/zod/src/v4/classic/tests/string.test.ts +25 -0
- package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +33 -1
- package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +147 -3
- package/node_modules/zod/src/v4/classic/tests/validate.test.ts +569 -0
- package/node_modules/zod/src/v4/core/api.ts +30 -6
- package/node_modules/zod/src/v4/core/checks.ts +1 -101
- package/node_modules/zod/src/v4/core/compile.ts +202 -88
- package/node_modules/zod/src/v4/core/doc.ts +6 -2
- package/node_modules/zod/src/v4/core/errors.ts +3 -6
- package/node_modules/zod/src/v4/core/json-schema-generator.ts +2 -2
- package/node_modules/zod/src/v4/core/json-schema-processors.ts +226 -68
- package/node_modules/zod/src/v4/core/memoizer.ts +78 -28
- package/node_modules/zod/src/v4/core/parse.ts +37 -16
- package/node_modules/zod/src/v4/core/regexes.ts +10 -4
- package/node_modules/zod/src/v4/core/schemas.ts +359 -122
- package/node_modules/zod/src/v4/core/tests/cached.test.ts +54 -0
- package/node_modules/zod/src/v4/core/tests/compile-generative.test.ts +445 -0
- package/node_modules/zod/src/v4/core/tests/compile.test.ts +222 -2
- package/node_modules/zod/src/v4/core/tests/email-regex.test.ts +140 -0
- package/node_modules/zod/src/v4/core/tests/locales/tg.test.ts +85 -0
- package/node_modules/zod/src/v4/core/tests/polyfill-collision.test.ts +46 -0
- package/node_modules/zod/src/v4/core/to-json-schema.ts +10 -8
- package/node_modules/zod/src/v4/core/util.ts +222 -147
- package/node_modules/zod/src/v4/core/versions.ts +2 -2
- package/node_modules/zod/src/v4/core/visit.ts +11 -0
- package/node_modules/zod/src/v4/locales/ar.ts +1 -0
- package/node_modules/zod/src/v4/locales/az.ts +1 -0
- package/node_modules/zod/src/v4/locales/be.ts +1 -0
- package/node_modules/zod/src/v4/locales/bg.ts +1 -0
- package/node_modules/zod/src/v4/locales/bn.ts +1 -0
- package/node_modules/zod/src/v4/locales/ca.ts +1 -0
- package/node_modules/zod/src/v4/locales/ckb.ts +1 -0
- package/node_modules/zod/src/v4/locales/cs.ts +1 -0
- package/node_modules/zod/src/v4/locales/da.ts +1 -0
- package/node_modules/zod/src/v4/locales/de.ts +1 -0
- package/node_modules/zod/src/v4/locales/el.ts +1 -0
- package/node_modules/zod/src/v4/locales/en.ts +1 -0
- package/node_modules/zod/src/v4/locales/eo.ts +1 -0
- package/node_modules/zod/src/v4/locales/es.ts +1 -0
- package/node_modules/zod/src/v4/locales/fa.ts +1 -0
- package/node_modules/zod/src/v4/locales/fi.ts +1 -0
- package/node_modules/zod/src/v4/locales/fr-CA.ts +1 -0
- package/node_modules/zod/src/v4/locales/fr.ts +1 -0
- package/node_modules/zod/src/v4/locales/gu.ts +1 -0
- package/node_modules/zod/src/v4/locales/he.ts +1 -0
- package/node_modules/zod/src/v4/locales/hi.ts +1 -0
- package/node_modules/zod/src/v4/locales/hr.ts +1 -0
- package/node_modules/zod/src/v4/locales/hu.ts +1 -0
- package/node_modules/zod/src/v4/locales/hy.ts +1 -0
- package/node_modules/zod/src/v4/locales/id.ts +1 -0
- package/node_modules/zod/src/v4/locales/index.ts +1 -0
- package/node_modules/zod/src/v4/locales/is.ts +1 -0
- package/node_modules/zod/src/v4/locales/it.ts +1 -0
- package/node_modules/zod/src/v4/locales/ja.ts +1 -0
- package/node_modules/zod/src/v4/locales/ka.ts +1 -0
- package/node_modules/zod/src/v4/locales/km.ts +1 -0
- package/node_modules/zod/src/v4/locales/kn.ts +1 -0
- package/node_modules/zod/src/v4/locales/ko.ts +1 -0
- package/node_modules/zod/src/v4/locales/lt.ts +1 -0
- package/node_modules/zod/src/v4/locales/mk.ts +1 -0
- package/node_modules/zod/src/v4/locales/ms.ts +1 -0
- package/node_modules/zod/src/v4/locales/ne.ts +1 -0
- package/node_modules/zod/src/v4/locales/nl.ts +1 -0
- package/node_modules/zod/src/v4/locales/nn.ts +1 -0
- package/node_modules/zod/src/v4/locales/no.ts +1 -0
- package/node_modules/zod/src/v4/locales/ota.ts +1 -0
- package/node_modules/zod/src/v4/locales/pl.ts +1 -0
- package/node_modules/zod/src/v4/locales/ps.ts +1 -0
- package/node_modules/zod/src/v4/locales/pt-BR.ts +1 -0
- package/node_modules/zod/src/v4/locales/pt.ts +1 -0
- package/node_modules/zod/src/v4/locales/ro.ts +1 -0
- package/node_modules/zod/src/v4/locales/ru.ts +1 -0
- package/node_modules/zod/src/v4/locales/sk.ts +1 -0
- package/node_modules/zod/src/v4/locales/sl.ts +1 -0
- package/node_modules/zod/src/v4/locales/sv.ts +1 -0
- package/node_modules/zod/src/v4/locales/ta.ts +1 -0
- package/node_modules/zod/src/v4/locales/tg.ts +134 -0
- package/node_modules/zod/src/v4/locales/th.ts +1 -0
- package/node_modules/zod/src/v4/locales/tk.ts +1 -0
- package/node_modules/zod/src/v4/locales/tr.ts +1 -0
- package/node_modules/zod/src/v4/locales/uk.ts +1 -0
- package/node_modules/zod/src/v4/locales/ur.ts +1 -0
- package/node_modules/zod/src/v4/locales/uz.ts +1 -0
- package/node_modules/zod/src/v4/locales/vi.ts +1 -0
- package/node_modules/zod/src/v4/locales/yo.ts +1 -0
- package/node_modules/zod/src/v4/locales/zh-CN.ts +1 -0
- package/node_modules/zod/src/v4/locales/zh-TW.ts +1 -0
- package/node_modules/zod/src/v4/mini/checks.ts +0 -1
- package/node_modules/zod/src/v4/mini/external.ts +2 -0
- package/node_modules/zod/src/v4/mini/schemas.ts +39 -3
- package/node_modules/zod/src/v4/mini/tests/checks.test.ts +1 -1
- package/node_modules/zod/src/v4/mini/tests/computed.test.ts +11 -17
- package/node_modules/zod/src/v4/mini/tests/index.test.ts +30 -0
- package/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +16 -0
- package/node_modules/zod/src/v4/mini/tests/string.test.ts +16 -0
- package/node_modules/zod/v3/ZodError.cjs +19 -0
- 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/standard-schema.cjs +19 -0
- package/node_modules/zod/v3/types.cjs +19 -0
- package/node_modules/zod/v4/classic/checks.cjs +20 -2
- 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 +19 -0
- package/node_modules/zod/v4/classic/deep-partial.cjs +19 -0
- package/node_modules/zod/v4/classic/errors.cjs +19 -0
- package/node_modules/zod/v4/classic/external.cjs +22 -1
- package/node_modules/zod/v4/classic/external.d.cts +1 -1
- package/node_modules/zod/v4/classic/external.d.ts +1 -1
- package/node_modules/zod/v4/classic/external.js +1 -1
- package/node_modules/zod/v4/classic/from-json-schema.cjs +264 -24
- package/node_modules/zod/v4/classic/from-json-schema.js +245 -24
- package/node_modules/zod/v4/classic/in-out.cjs +19 -0
- package/node_modules/zod/v4/classic/index.cjs +19 -0
- package/node_modules/zod/v4/classic/iso.cjs +19 -0
- package/node_modules/zod/v4/classic/parse.cjs +19 -0
- package/node_modules/zod/v4/classic/schemas.cjs +100 -31
- package/node_modules/zod/v4/classic/schemas.d.cts +17 -1
- package/node_modules/zod/v4/classic/schemas.d.ts +17 -1
- package/node_modules/zod/v4/classic/schemas.js +77 -29
- package/node_modules/zod/v4/core/api.cjs +37 -2
- package/node_modules/zod/v4/core/api.d.cts +6 -4
- package/node_modules/zod/v4/core/api.d.ts +6 -4
- package/node_modules/zod/v4/core/api.js +17 -2
- package/node_modules/zod/v4/core/checks.cjs +19 -96
- package/node_modules/zod/v4/core/checks.d.cts +1 -1
- package/node_modules/zod/v4/core/checks.d.ts +1 -1
- package/node_modules/zod/v4/core/checks.js +0 -96
- package/node_modules/zod/v4/core/compile.cjs +172 -72
- package/node_modules/zod/v4/core/compile.d.cts +18 -4
- package/node_modules/zod/v4/core/compile.d.ts +18 -4
- package/node_modules/zod/v4/core/compile.js +153 -73
- package/node_modules/zod/v4/core/core.cjs +19 -0
- package/node_modules/zod/v4/core/doc.cjs +26 -2
- package/node_modules/zod/v4/core/doc.js +7 -2
- package/node_modules/zod/v4/core/errors.cjs +21 -5
- package/node_modules/zod/v4/core/errors.js +2 -5
- package/node_modules/zod/v4/core/index.cjs +19 -0
- package/node_modules/zod/v4/core/json-schema-generator.cjs +20 -1
- package/node_modules/zod/v4/core/json-schema-generator.js +2 -2
- package/node_modules/zod/v4/core/json-schema-processors.cjs +215 -63
- package/node_modules/zod/v4/core/json-schema-processors.d.cts +17 -0
- package/node_modules/zod/v4/core/json-schema-processors.d.ts +17 -0
- package/node_modules/zod/v4/core/json-schema-processors.js +195 -64
- package/node_modules/zod/v4/core/json-schema.cjs +19 -0
- package/node_modules/zod/v4/core/memoizer.cjs +114 -23
- package/node_modules/zod/v4/core/memoizer.js +72 -23
- package/node_modules/zod/v4/core/parse.cjs +56 -16
- package/node_modules/zod/v4/core/parse.js +37 -16
- package/node_modules/zod/v4/core/regexes.cjs +29 -6
- package/node_modules/zod/v4/core/regexes.d.cts +2 -0
- package/node_modules/zod/v4/core/regexes.d.ts +2 -0
- package/node_modules/zod/v4/core/regexes.js +8 -4
- package/node_modules/zod/v4/core/registries.cjs +19 -0
- package/node_modules/zod/v4/core/schemas.cjs +331 -103
- package/node_modules/zod/v4/core/schemas.d.cts +43 -8
- package/node_modules/zod/v4/core/schemas.d.ts +43 -8
- package/node_modules/zod/v4/core/schemas.js +310 -102
- package/node_modules/zod/v4/core/standard-schema.cjs +19 -0
- package/node_modules/zod/v4/core/to-json-schema.cjs +29 -7
- package/node_modules/zod/v4/core/to-json-schema.d.cts +7 -3
- package/node_modules/zod/v4/core/to-json-schema.d.ts +7 -3
- package/node_modules/zod/v4/core/to-json-schema.js +8 -7
- package/node_modules/zod/v4/core/util.cjs +181 -143
- package/node_modules/zod/v4/core/util.d.cts +25 -4
- package/node_modules/zod/v4/core/util.d.ts +25 -4
- package/node_modules/zod/v4/core/util.js +160 -143
- 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 +31 -0
- package/node_modules/zod/v4/core/visit.js +12 -0
- package/node_modules/zod/v4/index.cjs +19 -0
- package/node_modules/zod/v4/locales/ar.cjs +1 -0
- package/node_modules/zod/v4/locales/ar.js +1 -0
- package/node_modules/zod/v4/locales/az.cjs +1 -0
- package/node_modules/zod/v4/locales/az.js +1 -0
- package/node_modules/zod/v4/locales/be.cjs +1 -0
- package/node_modules/zod/v4/locales/be.js +1 -0
- package/node_modules/zod/v4/locales/bg.cjs +1 -0
- package/node_modules/zod/v4/locales/bg.js +1 -0
- package/node_modules/zod/v4/locales/bn.cjs +1 -0
- package/node_modules/zod/v4/locales/bn.js +1 -0
- package/node_modules/zod/v4/locales/ca.cjs +1 -0
- package/node_modules/zod/v4/locales/ca.js +1 -0
- package/node_modules/zod/v4/locales/ckb.cjs +1 -0
- package/node_modules/zod/v4/locales/ckb.js +1 -0
- package/node_modules/zod/v4/locales/cs.cjs +1 -0
- package/node_modules/zod/v4/locales/cs.js +1 -0
- package/node_modules/zod/v4/locales/da.cjs +1 -0
- package/node_modules/zod/v4/locales/da.js +1 -0
- package/node_modules/zod/v4/locales/de.cjs +1 -0
- package/node_modules/zod/v4/locales/de.js +1 -0
- package/node_modules/zod/v4/locales/el.cjs +1 -0
- package/node_modules/zod/v4/locales/el.js +1 -0
- package/node_modules/zod/v4/locales/en.cjs +1 -0
- package/node_modules/zod/v4/locales/en.js +1 -0
- package/node_modules/zod/v4/locales/eo.cjs +1 -0
- package/node_modules/zod/v4/locales/eo.js +1 -0
- package/node_modules/zod/v4/locales/es.cjs +1 -0
- package/node_modules/zod/v4/locales/es.js +1 -0
- package/node_modules/zod/v4/locales/fa.cjs +1 -0
- package/node_modules/zod/v4/locales/fa.js +1 -0
- package/node_modules/zod/v4/locales/fi.cjs +1 -0
- package/node_modules/zod/v4/locales/fi.js +1 -0
- package/node_modules/zod/v4/locales/fr-CA.cjs +1 -0
- package/node_modules/zod/v4/locales/fr-CA.js +1 -0
- package/node_modules/zod/v4/locales/fr.cjs +1 -0
- package/node_modules/zod/v4/locales/fr.js +1 -0
- package/node_modules/zod/v4/locales/gu.cjs +1 -0
- package/node_modules/zod/v4/locales/gu.js +1 -0
- package/node_modules/zod/v4/locales/he.cjs +1 -0
- package/node_modules/zod/v4/locales/he.js +1 -0
- package/node_modules/zod/v4/locales/hi.cjs +1 -0
- package/node_modules/zod/v4/locales/hi.js +1 -0
- package/node_modules/zod/v4/locales/hr.cjs +1 -0
- package/node_modules/zod/v4/locales/hr.js +1 -0
- package/node_modules/zod/v4/locales/hu.cjs +1 -0
- package/node_modules/zod/v4/locales/hu.js +1 -0
- package/node_modules/zod/v4/locales/hy.cjs +1 -0
- package/node_modules/zod/v4/locales/hy.js +1 -0
- package/node_modules/zod/v4/locales/id.cjs +1 -0
- package/node_modules/zod/v4/locales/id.js +1 -0
- package/node_modules/zod/v4/locales/index.cjs +22 -1
- package/node_modules/zod/v4/locales/index.d.cts +1 -0
- package/node_modules/zod/v4/locales/index.d.ts +1 -0
- package/node_modules/zod/v4/locales/index.js +1 -0
- package/node_modules/zod/v4/locales/is.cjs +1 -0
- package/node_modules/zod/v4/locales/is.js +1 -0
- package/node_modules/zod/v4/locales/it.cjs +1 -0
- package/node_modules/zod/v4/locales/it.js +1 -0
- package/node_modules/zod/v4/locales/ja.cjs +1 -0
- package/node_modules/zod/v4/locales/ja.js +1 -0
- package/node_modules/zod/v4/locales/ka.cjs +1 -0
- package/node_modules/zod/v4/locales/ka.js +1 -0
- package/node_modules/zod/v4/locales/km.cjs +1 -0
- package/node_modules/zod/v4/locales/km.js +1 -0
- package/node_modules/zod/v4/locales/kn.cjs +1 -0
- package/node_modules/zod/v4/locales/kn.js +1 -0
- package/node_modules/zod/v4/locales/ko.cjs +1 -0
- package/node_modules/zod/v4/locales/ko.js +1 -0
- package/node_modules/zod/v4/locales/lt.cjs +1 -0
- package/node_modules/zod/v4/locales/lt.js +1 -0
- package/node_modules/zod/v4/locales/mk.cjs +1 -0
- package/node_modules/zod/v4/locales/mk.js +1 -0
- package/node_modules/zod/v4/locales/ms.cjs +1 -0
- package/node_modules/zod/v4/locales/ms.js +1 -0
- package/node_modules/zod/v4/locales/ne.cjs +1 -0
- package/node_modules/zod/v4/locales/ne.js +1 -0
- package/node_modules/zod/v4/locales/nl.cjs +1 -0
- package/node_modules/zod/v4/locales/nl.js +1 -0
- package/node_modules/zod/v4/locales/nn.cjs +1 -0
- package/node_modules/zod/v4/locales/nn.js +1 -0
- package/node_modules/zod/v4/locales/no.cjs +1 -0
- package/node_modules/zod/v4/locales/no.js +1 -0
- package/node_modules/zod/v4/locales/ota.cjs +1 -0
- package/node_modules/zod/v4/locales/ota.js +1 -0
- package/node_modules/zod/v4/locales/pl.cjs +1 -0
- package/node_modules/zod/v4/locales/pl.js +1 -0
- package/node_modules/zod/v4/locales/ps.cjs +1 -0
- package/node_modules/zod/v4/locales/ps.js +1 -0
- package/node_modules/zod/v4/locales/pt-BR.cjs +1 -0
- package/node_modules/zod/v4/locales/pt-BR.js +1 -0
- package/node_modules/zod/v4/locales/pt.cjs +1 -0
- package/node_modules/zod/v4/locales/pt.js +1 -0
- package/node_modules/zod/v4/locales/ro.cjs +1 -0
- package/node_modules/zod/v4/locales/ro.js +1 -0
- package/node_modules/zod/v4/locales/ru.cjs +1 -0
- package/node_modules/zod/v4/locales/ru.js +1 -0
- package/node_modules/zod/v4/locales/sk.cjs +1 -0
- package/node_modules/zod/v4/locales/sk.js +1 -0
- package/node_modules/zod/v4/locales/sl.cjs +1 -0
- package/node_modules/zod/v4/locales/sl.js +1 -0
- package/node_modules/zod/v4/locales/sv.cjs +1 -0
- package/node_modules/zod/v4/locales/sv.js +1 -0
- package/node_modules/zod/v4/locales/ta.cjs +1 -0
- package/node_modules/zod/v4/locales/ta.js +1 -0
- package/node_modules/zod/v4/locales/tg.cjs +143 -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 +116 -0
- package/node_modules/zod/v4/locales/th.cjs +1 -0
- package/node_modules/zod/v4/locales/th.js +1 -0
- package/node_modules/zod/v4/locales/tk.cjs +1 -0
- package/node_modules/zod/v4/locales/tk.js +1 -0
- package/node_modules/zod/v4/locales/tr.cjs +1 -0
- package/node_modules/zod/v4/locales/tr.js +1 -0
- package/node_modules/zod/v4/locales/uk.cjs +1 -0
- package/node_modules/zod/v4/locales/uk.js +1 -0
- package/node_modules/zod/v4/locales/ur.cjs +1 -0
- package/node_modules/zod/v4/locales/ur.js +1 -0
- package/node_modules/zod/v4/locales/uz.cjs +1 -0
- package/node_modules/zod/v4/locales/uz.js +1 -0
- package/node_modules/zod/v4/locales/vi.cjs +1 -0
- package/node_modules/zod/v4/locales/vi.js +1 -0
- package/node_modules/zod/v4/locales/yo.cjs +1 -0
- package/node_modules/zod/v4/locales/yo.js +1 -0
- package/node_modules/zod/v4/locales/zh-CN.cjs +1 -0
- package/node_modules/zod/v4/locales/zh-CN.js +1 -0
- package/node_modules/zod/v4/locales/zh-TW.cjs +1 -0
- package/node_modules/zod/v4/locales/zh-TW.js +1 -0
- package/node_modules/zod/v4/mini/checks.cjs +20 -2
- 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 +19 -0
- package/node_modules/zod/v4/mini/deep-partial.cjs +19 -0
- package/node_modules/zod/v4/mini/external.cjs +22 -1
- package/node_modules/zod/v4/mini/external.d.cts +1 -1
- package/node_modules/zod/v4/mini/external.d.ts +1 -1
- package/node_modules/zod/v4/mini/external.js +1 -1
- package/node_modules/zod/v4/mini/in-out.cjs +19 -0
- package/node_modules/zod/v4/mini/index.cjs +19 -0
- package/node_modules/zod/v4/mini/iso.cjs +19 -0
- package/node_modules/zod/v4/mini/parse.cjs +19 -0
- package/node_modules/zod/v4/mini/schemas.cjs +42 -4
- package/node_modules/zod/v4/mini/schemas.d.cts +9 -1
- package/node_modules/zod/v4/mini/schemas.d.ts +9 -1
- package/node_modules/zod/v4/mini/schemas.js +19 -2
- package/node_modules/zod/v4-mini/index.cjs +19 -0
- package/package.json +2 -2
- package/slingshot/index.js +151 -149
- package/node_modules/@types/node/ffi.d.ts +0 -486
- package/node_modules/@types/node/inspector/promises.d.ts +0 -35
- package/node_modules/@types/node/path/posix.d.ts +0 -8
- package/node_modules/@types/node/path/win32.d.ts +0 -8
- package/node_modules/@types/node/quic.d.ts +0 -2151
- package/node_modules/@types/node/stream/iter.d.ts +0 -452
- package/node_modules/@types/node/test/reporters.d.ts +0 -59
- package/node_modules/@types/node/ts5.6/compatibility/float16array.d.ts +0 -71
- package/node_modules/@types/node/ts5.7/compatibility/float16array.d.ts +0 -72
- package/node_modules/@types/node/ts5.7/index.d.ts +0 -118
- package/node_modules/@types/node/util/types.d.ts +0 -558
- package/node_modules/@types/node/vfs.d.ts +0 -210
- package/node_modules/@types/node/web-globals/blob.d.ts +0 -23
- package/node_modules/@types/node/web-globals/console.d.ts +0 -9
- package/node_modules/@types/node/web-globals/crypto.d.ts +0 -39
- package/node_modules/@types/node/web-globals/encoding.d.ts +0 -11
- package/node_modules/@types/node/web-globals/importmeta.d.ts +0 -13
- package/node_modules/@types/node/web-globals/messaging.d.ts +0 -23
- package/node_modules/@types/node/web-globals/performance.d.ts +0 -45
- package/node_modules/@types/node/web-globals/timers.d.ts +0 -44
- package/node_modules/@types/node/web-globals/url.d.ts +0 -24
- package/node_modules/@types/node/zlib/iter.d.ts +0 -131
- package/node_modules/jose/dist/webapi/lib/base64.js +0 -20
- package/node_modules/jose/dist/webapi/lib/crypto_key.js +0 -27
- package/node_modules/jose/dist/webapi/lib/helpers.js +0 -45
- package/node_modules/jose/dist/webapi/lib/invalid_key_input.js +0 -12
- package/node_modules/jose/dist/webapi/lib/is_key_like.js +0 -19
- package/node_modules/jose/dist/webapi/lib/jwk_metadata.js +0 -19
- package/node_modules/jose/dist/webapi/lib/jwk_to_key.js +0 -10
- package/node_modules/jose/dist/webapi/lib/key_options.js +0 -8
- package/node_modules/jose/dist/webapi/lib/signing.js +0 -22
- package/node_modules/jose/dist/webapi/lib/type_checks.js +0 -30
- package/node_modules/undici-types/cache-interceptor.d.ts +0 -179
- package/node_modules/undici-types/client-stats.d.ts +0 -15
- package/node_modules/undici-types/dispatcher1-wrapper.d.ts +0 -7
- package/node_modules/undici-types/h2c-client.d.ts +0 -73
- package/node_modules/undici-types/mock-call-history.d.ts +0 -111
- package/node_modules/undici-types/round-robin-pool.d.ts +0 -39
- package/node_modules/undici-types/snapshot-agent.d.ts +0 -113
- package/node_modules/undici-types/socks5-proxy-agent.d.ts +0 -25
- package/node_modules/undici-types/utility.d.ts +0 -7
|
@@ -5,7 +5,7 @@ import * as core from "./core.js";
|
|
|
5
5
|
import { Doc } from "./doc.js";
|
|
6
6
|
import type * as errors from "./errors.js";
|
|
7
7
|
import type * as JSONSchema from "./json-schema.js";
|
|
8
|
-
import { parse, parseAsync
|
|
8
|
+
import { parse, parseAsync } from "./parse.js";
|
|
9
9
|
import * as regexes from "./regexes.js";
|
|
10
10
|
import type { StandardSchemaV1 } from "./standard-schema.js";
|
|
11
11
|
import type { ProcessParams, ToJSONSchemaContext } from "./to-json-schema.js";
|
|
@@ -30,6 +30,8 @@ export interface ParseContextInternal<T extends errors.$ZodIssueBase = never> ex
|
|
|
30
30
|
readonly async?: boolean | undefined;
|
|
31
31
|
readonly direction?: "forward" | "backward";
|
|
32
32
|
readonly skipChecks?: boolean;
|
|
33
|
+
/** Set only by `validate`/`validateAsync`. A container may stop before its next child, never inside one, so a map entry and a tuple's fixed items parse whole. */
|
|
34
|
+
readonly abortEarly?: boolean;
|
|
33
35
|
}
|
|
34
36
|
|
|
35
37
|
/** Gives a container cycle support: `attach` wraps its parse, and `alloc` registers the object it builds into before any child is parsed so a reference back to the same input resolves to it. */
|
|
@@ -94,7 +96,8 @@ export interface $ZodTypeDef {
|
|
|
94
96
|
| "promise"
|
|
95
97
|
| "lazy"
|
|
96
98
|
| "function"
|
|
97
|
-
| "custom"
|
|
99
|
+
| "custom"
|
|
100
|
+
| "properties";
|
|
98
101
|
error?: errors.$ZodErrorMap<never> | undefined;
|
|
99
102
|
checks?: checks.$ZodCheck<never>[];
|
|
100
103
|
}
|
|
@@ -332,17 +335,25 @@ export const $ZodType: core.$constructor<$ZodType> = /*@__PURE__*/ core.$constru
|
|
|
332
335
|
);
|
|
333
336
|
|
|
334
337
|
/** The Standard Schema surface for `inst`. Shared so wrappers can extend it without forcing it. */
|
|
335
|
-
|
|
336
|
-
|
|
338
|
+
// a Standard Schema result only reports issues, so a failure finalizes them straight off the raw payload: no ZodError, and no lazy result to read through
|
|
339
|
+
const toStandardResult = (r: ParsePayload, ctx: ParseContextInternal) =>
|
|
340
|
+
r.issues.length ? { issues: r.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())) } : { value: r.value };
|
|
341
|
+
|
|
342
|
+
async function validateAsync(inst: $ZodType, value: unknown) {
|
|
343
|
+
const ctx: ParseContextInternal = { async: true };
|
|
344
|
+
return toStandardResult((await inst._zod.run({ value, issues: [] }, ctx)) as ParsePayload, ctx);
|
|
345
|
+
}
|
|
337
346
|
|
|
338
347
|
export function standardProps(inst: $ZodType): StandardSchemaV1.Props<any, any> {
|
|
339
348
|
return {
|
|
340
349
|
validate: (value: unknown) => {
|
|
350
|
+
const ctx: ParseContextInternal = { async: false };
|
|
341
351
|
try {
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
352
|
+
const r = inst._zod.run({ value, issues: [] }, ctx);
|
|
353
|
+
if (!(r instanceof Promise)) return toStandardResult(r, ctx);
|
|
354
|
+
} catch (_) {}
|
|
355
|
+
// async function so a synchronously throwing check rejects instead of escaping validate
|
|
356
|
+
return validateAsync(inst, value);
|
|
346
357
|
},
|
|
347
358
|
vendor: "zod",
|
|
348
359
|
version: 1 as const,
|
|
@@ -388,7 +399,8 @@ export interface $ZodString<Input = unknown> extends _$ZodType<$ZodStringInterna
|
|
|
388
399
|
|
|
389
400
|
export const $ZodString: core.$constructor<$ZodString> = /*@__PURE__*/ core.$constructor("$ZodString", (inst, def) => {
|
|
390
401
|
$ZodType.init(inst, def);
|
|
391
|
-
|
|
402
|
+
// a format's own pattern, else unbounded; a template literal derives the check-aware form itself
|
|
403
|
+
inst._zod.pattern = (def as $ZodStringFormatDef).pattern ?? regexes.anyString;
|
|
392
404
|
inst._zod.parse = (payload, _) => {
|
|
393
405
|
if (def.coerce)
|
|
394
406
|
try {
|
|
@@ -777,14 +789,6 @@ export const $ZodISODateTime: core.$constructor<$ZodISODateTime> = /*@__PURE__*/
|
|
|
777
789
|
(inst, def): void => {
|
|
778
790
|
def.pattern ??= regexes.datetime(def);
|
|
779
791
|
$ZodStringFormat.init(inst, def);
|
|
780
|
-
|
|
781
|
-
// these two drop the offset or seconds `date-time` requires — on the bag not the def, since `z.string().check(...)` lands the format on a different schema
|
|
782
|
-
if (def.local || def.precision === -1) {
|
|
783
|
-
inst._zod.bag.laxFormat = true;
|
|
784
|
-
inst._zod.onattach.push((s) => {
|
|
785
|
-
(s._zod.bag as $ZodStringInternals<unknown>["bag"]).laxFormat = true;
|
|
786
|
-
});
|
|
787
|
-
}
|
|
788
792
|
}
|
|
789
793
|
);
|
|
790
794
|
|
|
@@ -861,8 +865,6 @@ export interface $ZodIPv4 extends $ZodType {
|
|
|
861
865
|
export const $ZodIPv4: core.$constructor<$ZodIPv4> = /*@__PURE__*/ core.$constructor("$ZodIPv4", (inst, def): void => {
|
|
862
866
|
def.pattern ??= regexes.ipv4;
|
|
863
867
|
$ZodStringFormat.init(inst, def);
|
|
864
|
-
|
|
865
|
-
inst._zod.bag.format = `ipv4`;
|
|
866
868
|
});
|
|
867
869
|
|
|
868
870
|
////////////////////////////// ZodIPv6 //////////////////////////////
|
|
@@ -897,8 +899,6 @@ export const $ZodIPv6: core.$constructor<$ZodIPv6> = /*@__PURE__*/ core.$constru
|
|
|
897
899
|
def.pattern ??= regexes.ipv6;
|
|
898
900
|
$ZodStringFormat.init(inst, def);
|
|
899
901
|
|
|
900
|
-
inst._zod.bag.format = `ipv6`;
|
|
901
|
-
|
|
902
902
|
inst._zod.check = (payload) => {
|
|
903
903
|
if (!isValidIPv6(payload.value)) {
|
|
904
904
|
payload.issues.push({
|
|
@@ -928,8 +928,6 @@ export interface $ZodMAC extends $ZodType {
|
|
|
928
928
|
export const $ZodMAC: core.$constructor<$ZodMAC> = /*@__PURE__*/ core.$constructor("$ZodMAC", (inst, def): void => {
|
|
929
929
|
def.pattern ??= regexes.mac(def.delimiter);
|
|
930
930
|
$ZodStringFormat.init(inst, def);
|
|
931
|
-
|
|
932
|
-
inst._zod.bag.format = `mac`;
|
|
933
931
|
});
|
|
934
932
|
|
|
935
933
|
////////////////////////////// ZodCIDRv4 //////////////////////////////
|
|
@@ -1021,14 +1019,15 @@ export interface $ZodBase64 extends $ZodType {
|
|
|
1021
1019
|
_zod: $ZodBase64Internals;
|
|
1022
1020
|
}
|
|
1023
1021
|
|
|
1022
|
+
// lax on purpose: the quantified regexes.base64 overflows the regex stack on multi-MB input and its leading ^$| alternation leaks through template-literal composition; isValidBase64 enforces length and padding
|
|
1023
|
+
export const base64Charset: RegExp = /^[0-9a-zA-Z+/]*={0,2}$/;
|
|
1024
|
+
|
|
1024
1025
|
export const $ZodBase64: core.$constructor<$ZodBase64> = /*@__PURE__*/ core.$constructor(
|
|
1025
1026
|
"$ZodBase64",
|
|
1026
1027
|
(inst, def): void => {
|
|
1027
|
-
def.pattern ??=
|
|
1028
|
+
def.pattern ??= base64Charset;
|
|
1028
1029
|
$ZodStringFormat.init(inst, def);
|
|
1029
1030
|
|
|
1030
|
-
inst._zod.bag.contentEncoding = "base64";
|
|
1031
|
-
|
|
1032
1031
|
inst._zod.check = (payload) => {
|
|
1033
1032
|
if (isValidBase64(payload.value)) return;
|
|
1034
1033
|
|
|
@@ -1043,9 +1042,12 @@ export const $ZodBase64: core.$constructor<$ZodBase64> = /*@__PURE__*/ core.$con
|
|
|
1043
1042
|
}
|
|
1044
1043
|
);
|
|
1045
1044
|
|
|
1046
|
-
//////////////////////////////
|
|
1045
|
+
////////////////////////////// ZodBase64URL //////////////////////////////
|
|
1046
|
+
// lax on purpose: the quantified regexes.base64url overflows the regex stack on multi-MB input; isValidBase64 enforces length on the padded string
|
|
1047
|
+
export const base64urlCharset: RegExp = /^[A-Za-z0-9_-]*$/;
|
|
1048
|
+
|
|
1047
1049
|
export function isValidBase64URL(data: string): boolean {
|
|
1048
|
-
if (!
|
|
1050
|
+
if (!base64urlCharset.test(data)) return false;
|
|
1049
1051
|
const base64 = data.replace(/[-_]/g, (c) => (c === "-" ? "+" : "/"));
|
|
1050
1052
|
const padded = base64.padEnd(Math.ceil(base64.length / 4) * 4, "=");
|
|
1051
1053
|
return isValidBase64(padded);
|
|
@@ -1061,11 +1063,9 @@ export interface $ZodBase64URL extends $ZodType {
|
|
|
1061
1063
|
export const $ZodBase64URL: core.$constructor<$ZodBase64URL> = /*@__PURE__*/ core.$constructor(
|
|
1062
1064
|
"$ZodBase64URL",
|
|
1063
1065
|
(inst, def): void => {
|
|
1064
|
-
def.pattern ??=
|
|
1066
|
+
def.pattern ??= base64urlCharset;
|
|
1065
1067
|
$ZodStringFormat.init(inst, def);
|
|
1066
1068
|
|
|
1067
|
-
inst._zod.bag.contentEncoding = "base64url";
|
|
1068
|
-
|
|
1069
1069
|
inst._zod.check = (payload) => {
|
|
1070
1070
|
if (isValidBase64URL(payload.value)) return;
|
|
1071
1071
|
|
|
@@ -1104,7 +1104,7 @@ function isLuhnAlgo(digits: string): boolean {
|
|
|
1104
1104
|
let bit = 1;
|
|
1105
1105
|
let sum = 0;
|
|
1106
1106
|
while (length) {
|
|
1107
|
-
const value =
|
|
1107
|
+
const value = digits.charCodeAt(--length) - 48;
|
|
1108
1108
|
bit ^= 1;
|
|
1109
1109
|
sum += bit ? [0, 2, 4, 6, 8, 1, 3, 5, 7, 9][value]! : value;
|
|
1110
1110
|
}
|
|
@@ -1144,6 +1144,53 @@ export const $ZodCreditCard: core.$constructor<$ZodCreditCard> = /*@__PURE__*/ c
|
|
|
1144
1144
|
}
|
|
1145
1145
|
);
|
|
1146
1146
|
|
|
1147
|
+
////////////////////////////// ZodIBAN //////////////////////////////
|
|
1148
|
+
|
|
1149
|
+
// iso 7064 mod 97-10 checksum without BigInt
|
|
1150
|
+
function isIso7064Mod97(iban: string): boolean {
|
|
1151
|
+
let remainder = 0;
|
|
1152
|
+
const len = iban.length;
|
|
1153
|
+
for (let i = 4; i < len; i++) {
|
|
1154
|
+
const code = iban.charCodeAt(i);
|
|
1155
|
+
remainder = (code >= 65 ? remainder * 100 + (code - 55) : remainder * 10 + (code - 48)) % 97;
|
|
1156
|
+
}
|
|
1157
|
+
for (let i = 0; i < 4; i++) {
|
|
1158
|
+
const code = iban.charCodeAt(i);
|
|
1159
|
+
remainder = (code >= 65 ? remainder * 100 + (code - 55) : remainder * 10 + (code - 48)) % 97;
|
|
1160
|
+
}
|
|
1161
|
+
return remainder === 1;
|
|
1162
|
+
}
|
|
1163
|
+
|
|
1164
|
+
export function isValidIBAN(input: string): boolean {
|
|
1165
|
+
if (!regexes.iban.test(input)) return false;
|
|
1166
|
+
return isIso7064Mod97(input);
|
|
1167
|
+
}
|
|
1168
|
+
|
|
1169
|
+
export interface $ZodIBANDef extends $ZodStringFormatDef<"iban"> {}
|
|
1170
|
+
export interface $ZodIBANInternals extends $ZodStringFormatInternals<"iban"> {
|
|
1171
|
+
def: $ZodIBANDef;
|
|
1172
|
+
}
|
|
1173
|
+
|
|
1174
|
+
export interface $ZodIBAN extends $ZodType {
|
|
1175
|
+
_zod: $ZodIBANInternals;
|
|
1176
|
+
}
|
|
1177
|
+
|
|
1178
|
+
export const $ZodIBAN: core.$constructor<$ZodIBAN> = /*@__PURE__*/ core.$constructor("$ZodIBAN", (inst, def): void => {
|
|
1179
|
+
// shape only — checksum is not expressible as a pattern
|
|
1180
|
+
def.pattern ??= regexes.iban;
|
|
1181
|
+
$ZodStringFormat.init(inst, def);
|
|
1182
|
+
inst._zod.check = (payload) => {
|
|
1183
|
+
if (isValidIBAN(payload.value)) return;
|
|
1184
|
+
payload.issues.push({
|
|
1185
|
+
code: "invalid_format",
|
|
1186
|
+
format: "iban",
|
|
1187
|
+
input: payload.value,
|
|
1188
|
+
inst,
|
|
1189
|
+
continue: !def.abort,
|
|
1190
|
+
});
|
|
1191
|
+
};
|
|
1192
|
+
});
|
|
1193
|
+
|
|
1147
1194
|
////////////////////////////// ZodJWT //////////////////////////////
|
|
1148
1195
|
|
|
1149
1196
|
export function isValidJWT(token: string, algorithm: util.JWTAlgorithm | null = null): boolean {
|
|
@@ -1260,7 +1307,7 @@ export interface $ZodNumber<Input = unknown> extends $ZodType {
|
|
|
1260
1307
|
export const $ZodNumber: core.$constructor<$ZodNumber> = /*@__PURE__*/ core.$constructor("$ZodNumber", (inst, def) => {
|
|
1261
1308
|
$ZodType.init(inst, def);
|
|
1262
1309
|
|
|
1263
|
-
inst._zod.pattern =
|
|
1310
|
+
inst._zod.pattern = regexes.number;
|
|
1264
1311
|
inst._zod.parse = (payload, _ctx) => {
|
|
1265
1312
|
if (def.coerce)
|
|
1266
1313
|
try {
|
|
@@ -1804,6 +1851,7 @@ export const $ZodArray: core.$constructor<$ZodArray> = /*@__PURE__*/ core.$const
|
|
|
1804
1851
|
|
|
1805
1852
|
payload.value = memo ? memo.alloc(inst, payload, Array(input.length), ctx) : Array(input.length);
|
|
1806
1853
|
const proms: Promise<any>[] = [];
|
|
1854
|
+
const abortEarly = ctx?.abortEarly;
|
|
1807
1855
|
for (let i = 0; i < input.length; i++) {
|
|
1808
1856
|
const item = input[i];
|
|
1809
1857
|
const result = def.element._zod.run(
|
|
@@ -1818,6 +1866,8 @@ export const $ZodArray: core.$constructor<$ZodArray> = /*@__PURE__*/ core.$const
|
|
|
1818
1866
|
proms.push(result.then((result) => handleArrayResult(result, payload, i)));
|
|
1819
1867
|
} else {
|
|
1820
1868
|
handleArrayResult(result, payload, i);
|
|
1869
|
+
// the element's payload is authoritative here, since handleArrayResult forwards every issue; an object's is not, because it drops a failed absent optional
|
|
1870
|
+
if (abortEarly && result.issues.length !== 0 && util.aborted(result)) break;
|
|
1821
1871
|
}
|
|
1822
1872
|
}
|
|
1823
1873
|
|
|
@@ -1843,7 +1893,7 @@ type OptionalInSchema = { _zod: { optin: "optional" | "defaulted" } };
|
|
|
1843
1893
|
export type $InferObjectOutput<T extends $ZodLooseShape, Extra extends Record<string, unknown>> = string extends keyof T
|
|
1844
1894
|
? util.IsAny<T[keyof T]> extends true
|
|
1845
1895
|
? Record<string, unknown>
|
|
1846
|
-
:
|
|
1896
|
+
: { [k in string]: core.output<T[keyof T]> }
|
|
1847
1897
|
: keyof (T & Extra) extends never
|
|
1848
1898
|
? Record<string, never>
|
|
1849
1899
|
: util.Prettify<
|
|
@@ -1887,7 +1937,7 @@ export type $InferObjectOutput<T extends $ZodLooseShape, Extra extends Record<st
|
|
|
1887
1937
|
export type $InferObjectInput<T extends $ZodLooseShape, Extra extends Record<string, unknown>> = string extends keyof T
|
|
1888
1938
|
? util.IsAny<T[keyof T]> extends true
|
|
1889
1939
|
? Record<string, unknown>
|
|
1890
|
-
:
|
|
1940
|
+
: { [k in string]: core.input<T[keyof T]> }
|
|
1891
1941
|
: keyof (T & Extra) extends never
|
|
1892
1942
|
? Record<string, never>
|
|
1893
1943
|
: util.Prettify<
|
|
@@ -1933,7 +1983,7 @@ function handlePropertyResult(
|
|
|
1933
1983
|
}
|
|
1934
1984
|
|
|
1935
1985
|
if (result.value === undefined) {
|
|
1936
|
-
if (isPresent) {
|
|
1986
|
+
if (isPresent || (optin === "defaulted" && !isOptionalOut)) {
|
|
1937
1987
|
(final.value as any)[key] = undefined;
|
|
1938
1988
|
}
|
|
1939
1989
|
} else {
|
|
@@ -2022,9 +2072,10 @@ function handleCatchall(
|
|
|
2022
2072
|
proms: Promise<any>[],
|
|
2023
2073
|
input: any,
|
|
2024
2074
|
payload: ParsePayload,
|
|
2025
|
-
ctx:
|
|
2075
|
+
ctx: ParseContextInternal,
|
|
2026
2076
|
def: ReturnType<typeof normalizeDef>,
|
|
2027
|
-
inst: $ZodObject
|
|
2077
|
+
inst: $ZodObject,
|
|
2078
|
+
abortEarly: boolean
|
|
2028
2079
|
) {
|
|
2029
2080
|
const unrecognized: string[] = [];
|
|
2030
2081
|
const keySet = def.keySet;
|
|
@@ -2032,7 +2083,13 @@ function handleCatchall(
|
|
|
2032
2083
|
const t = _catchall.def.type;
|
|
2033
2084
|
const optin = _catchall.optin;
|
|
2034
2085
|
const optout = _catchall.optout;
|
|
2086
|
+
// starts at 0, not the current length: the shape phase already ran and may have aborted
|
|
2087
|
+
let seen = 0;
|
|
2035
2088
|
for (const key in input) {
|
|
2089
|
+
if (abortEarly && payload.issues.length !== seen) {
|
|
2090
|
+
if (util.aborted(payload, seen)) break;
|
|
2091
|
+
seen = payload.issues.length;
|
|
2092
|
+
}
|
|
2036
2093
|
// Must precede the __proto__ branch: a declared key is not unrecognized, even though the shape loop deliberately strips __proto__ from the parsed output.
|
|
2037
2094
|
if (keySet.has(key)) continue;
|
|
2038
2095
|
// Don't copy an undeclared __proto__ into the result; assignment to a plain {} would replace the result prototype. But in strict mode it is still an unknown key, so report it before skipping.
|
|
@@ -2070,28 +2127,22 @@ function handleCatchall(
|
|
|
2070
2127
|
});
|
|
2071
2128
|
}
|
|
2072
2129
|
|
|
2073
|
-
// Whichever object a def's `shape` currently answers from: the one the caller passed until the first read, the frozen copy after it. Keyed by def, so a def rebuilt by a builder is simply absent rather than inheriting the source's. Read its keys with `Object.keys`, which does not invoke them — that is what lets a discriminated union check its discriminator without resolving an option whose getters reference the union being constructed.
|
|
2074
|
-
const propShapes = new WeakMap<object, Record<string, unknown>>();
|
|
2075
|
-
|
|
2076
2130
|
export const $ZodObject: core.$constructor<$ZodObject> = /*@__PURE__*/ core.$constructor("$ZodObject", (inst, def) => {
|
|
2077
2131
|
// requires cast because technically $ZodObject doesn't extend
|
|
2078
2132
|
$ZodType.init(inst, def);
|
|
2079
|
-
// const sh = def.shape;
|
|
2080
2133
|
const desc = Object.getOwnPropertyDescriptor(def, "shape");
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
},
|
|
2094
|
-
});
|
|
2134
|
+
// a cloned def carries its source's accessor, which knows the shape it answers from; adopting that keeps the clone's keys readable without running it
|
|
2135
|
+
const sh = desc?.get ? (desc.get as util.ShapeGetter).raw : (def.shape ?? {});
|
|
2136
|
+
if (sh) {
|
|
2137
|
+
// Freezes the shape on first read, so its getters resolve once and every later read sees the same schemas.
|
|
2138
|
+
const get: util.ShapeGetter = () => {
|
|
2139
|
+
const newSh = { ...sh };
|
|
2140
|
+
Object.defineProperty(def, "shape", { value: newSh });
|
|
2141
|
+
get.raw = newSh;
|
|
2142
|
+
return newSh;
|
|
2143
|
+
};
|
|
2144
|
+
get.raw = sh;
|
|
2145
|
+
Object.defineProperty(def, "shape", { get });
|
|
2095
2146
|
}
|
|
2096
2147
|
|
|
2097
2148
|
const _normalized = util.cached(() => normalizeDef(def));
|
|
@@ -2137,8 +2188,14 @@ export const $ZodObject: core.$constructor<$ZodObject> = /*@__PURE__*/ core.$con
|
|
|
2137
2188
|
|
|
2138
2189
|
const proms: Promise<any>[] = [];
|
|
2139
2190
|
const shape = value.shape;
|
|
2191
|
+
const abortEarly = ctx?.abortEarly;
|
|
2192
|
+
let seen = payload.issues.length;
|
|
2140
2193
|
|
|
2141
2194
|
for (const key of value.allKeys) {
|
|
2195
|
+
if (abortEarly && payload.issues.length !== seen) {
|
|
2196
|
+
if (util.aborted(payload, seen)) break;
|
|
2197
|
+
seen = payload.issues.length;
|
|
2198
|
+
}
|
|
2142
2199
|
if (key === "__proto__") continue;
|
|
2143
2200
|
const el = (shape as any)[key]!;
|
|
2144
2201
|
const optin = el._zod.optin;
|
|
@@ -2156,7 +2213,7 @@ export const $ZodObject: core.$constructor<$ZodObject> = /*@__PURE__*/ core.$con
|
|
|
2156
2213
|
return proms.length ? Promise.all(proms).then(() => payload) : payload;
|
|
2157
2214
|
}
|
|
2158
2215
|
|
|
2159
|
-
return handleCatchall(proms, input, payload, ctx, _normalized.value, inst);
|
|
2216
|
+
return handleCatchall(proms, input, payload, ctx, _normalized.value, inst, abortEarly === true);
|
|
2160
2217
|
};
|
|
2161
2218
|
});
|
|
2162
2219
|
|
|
@@ -2179,12 +2236,18 @@ export const $ZodObjectJIT: core.$constructor<$ZodObject> = /*@__PURE__*/ core.$
|
|
|
2179
2236
|
|
|
2180
2237
|
const parseStr = (k: string) => `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
|
|
2181
2238
|
|
|
2182
|
-
//
|
|
2239
|
+
// prefixes in place, like util.prefixIssues. newResult must land before the early return: a catchall runs after this and would otherwise write onto the caller's input
|
|
2183
2240
|
const prefixStr = (id: string, k: string) => `
|
|
2241
|
+
let ${id}_ab = false;
|
|
2184
2242
|
for (let i = 0; i < ${id}.issues.length; i++) {
|
|
2185
2243
|
const iss = ${id}.issues[i];
|
|
2186
2244
|
iss.path = iss.path ? [${k}, ...iss.path] : [${k}];
|
|
2187
2245
|
payload.issues.push(iss);
|
|
2246
|
+
if (iss.continue !== true) ${id}_ab = true;
|
|
2247
|
+
}
|
|
2248
|
+
if (${id}_ab && ctx && ctx.abortEarly) {
|
|
2249
|
+
payload.value = newResult;
|
|
2250
|
+
return payload;
|
|
2188
2251
|
}`;
|
|
2189
2252
|
|
|
2190
2253
|
doc.write(`const input = payload.value;`);
|
|
@@ -2236,6 +2299,10 @@ export const $ZodObjectJIT: core.$constructor<$ZodObject> = /*@__PURE__*/ core.$
|
|
|
2236
2299
|
input: undefined,
|
|
2237
2300
|
path: [${k}]
|
|
2238
2301
|
});
|
|
2302
|
+
if (ctx && ctx.abortEarly) {
|
|
2303
|
+
payload.value = newResult;
|
|
2304
|
+
return payload;
|
|
2305
|
+
}
|
|
2239
2306
|
}
|
|
2240
2307
|
|
|
2241
2308
|
if (${id}_present) {
|
|
@@ -2247,16 +2314,16 @@ export const $ZodObjectJIT: core.$constructor<$ZodObject> = /*@__PURE__*/ core.$
|
|
|
2247
2314
|
doc.write(`
|
|
2248
2315
|
if (${id}.issues.length) {${prefixStr(id, k)}
|
|
2249
2316
|
}
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
}
|
|
2317
|
+
`);
|
|
2318
|
+
if (optin === "defaulted") {
|
|
2319
|
+
doc.write(`newResult[${k}] = ${id}.value;`);
|
|
2320
|
+
} else {
|
|
2321
|
+
doc.write(`
|
|
2322
|
+
if (${id}.value !== undefined || ${isPresent}) {
|
|
2256
2323
|
newResult[${k}] = ${id}.value;
|
|
2257
2324
|
}
|
|
2258
|
-
|
|
2259
2325
|
`);
|
|
2326
|
+
}
|
|
2260
2327
|
}
|
|
2261
2328
|
}
|
|
2262
2329
|
|
|
@@ -2296,7 +2363,7 @@ export const $ZodObjectJIT: core.$constructor<$ZodObject> = /*@__PURE__*/ core.$
|
|
|
2296
2363
|
payload = fastpass(payload, ctx);
|
|
2297
2364
|
|
|
2298
2365
|
if (!catchall) return payload;
|
|
2299
|
-
return handleCatchall([], input, payload, ctx, value, inst);
|
|
2366
|
+
return handleCatchall([], input, payload, ctx, value, inst, ctx?.abortEarly === true);
|
|
2300
2367
|
}
|
|
2301
2368
|
|
|
2302
2369
|
return superParse(payload, ctx);
|
|
@@ -2533,7 +2600,7 @@ export interface $ZodDiscriminatedUnionInternals<
|
|
|
2533
2600
|
def: $ZodDiscriminatedUnionDef<Options, Disc>;
|
|
2534
2601
|
propValues: util.PropValues;
|
|
2535
2602
|
bag: util.LoosePartial<{
|
|
2536
|
-
optionsMap: Map<util.Primitive, $ZodType>;
|
|
2603
|
+
optionsMap: Map<util.Primitive, $ZodType | null>;
|
|
2537
2604
|
}>;
|
|
2538
2605
|
}
|
|
2539
2606
|
|
|
@@ -2557,7 +2624,7 @@ export type $DiscriminatedOption<Options extends readonly SomeType[], Disc exten
|
|
|
2557
2624
|
: never;
|
|
2558
2625
|
}[number];
|
|
2559
2626
|
|
|
2560
|
-
/** Returns the option
|
|
2627
|
+
/** Returns the option whose discriminator claims `value`, or throws if ambiguous. */
|
|
2561
2628
|
export function getDiscriminatedOption<
|
|
2562
2629
|
Options extends readonly SomeType[],
|
|
2563
2630
|
Disc extends string,
|
|
@@ -2566,15 +2633,31 @@ export function getDiscriminatedOption<
|
|
|
2566
2633
|
const internals = union._zod;
|
|
2567
2634
|
let map = internals.bag.optionsMap;
|
|
2568
2635
|
if (!map) {
|
|
2569
|
-
map =
|
|
2570
|
-
const { options, discriminator } = internals.def;
|
|
2571
|
-
for (const option of options as unknown as readonly $ZodType[]) {
|
|
2572
|
-
// First declaration wins, matching the order the parse path resolves a duplicate in.
|
|
2573
|
-
for (const v of option._zod.propValues?.[discriminator] ?? []) if (!map.has(v)) map.set(v, option);
|
|
2574
|
-
}
|
|
2636
|
+
map = discriminatorMap(internals.def);
|
|
2575
2637
|
internals.bag.optionsMap = map;
|
|
2576
2638
|
}
|
|
2577
|
-
|
|
2639
|
+
const option = map.get(value as util.Primitive);
|
|
2640
|
+
if (option === null) throw new Error(`Ambiguous discriminator value "${String(value)}"`);
|
|
2641
|
+
return option as any;
|
|
2642
|
+
}
|
|
2643
|
+
|
|
2644
|
+
function discriminatorMap(def: $ZodDiscriminatedUnionDef<readonly SomeType[]>): Map<util.Primitive, $ZodType | null> {
|
|
2645
|
+
const map = new Map<util.Primitive, $ZodType | null>();
|
|
2646
|
+
for (const option of def.options as readonly $ZodType[]) {
|
|
2647
|
+
const values = option._zod.propValues?.[def.discriminator];
|
|
2648
|
+
if (!values || values.size === 0)
|
|
2649
|
+
throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(option)}"`);
|
|
2650
|
+
for (const value of values) {
|
|
2651
|
+
if (map.has(value)) {
|
|
2652
|
+
if (value !== undefined) throw new Error(`Duplicate discriminator value "${String(value)}"`);
|
|
2653
|
+
// keep the collision marked so a later member cannot reclaim it
|
|
2654
|
+
map.set(value, null);
|
|
2655
|
+
} else {
|
|
2656
|
+
map.set(value, option);
|
|
2657
|
+
}
|
|
2658
|
+
}
|
|
2659
|
+
}
|
|
2660
|
+
return map;
|
|
2578
2661
|
}
|
|
2579
2662
|
|
|
2580
2663
|
export interface $ZodDiscriminatedUnion<
|
|
@@ -2594,10 +2677,12 @@ export const $ZodDiscriminatedUnion: core.$constructor<$ZodDiscriminatedUnion> =
|
|
|
2594
2677
|
const _super = inst._zod.parse;
|
|
2595
2678
|
util.defineLazyInternal(inst, "propValues", (zod) => {
|
|
2596
2679
|
const propValues: util.PropValues = {};
|
|
2680
|
+
let undefinedCount = 0;
|
|
2597
2681
|
for (const option of zod.def.options) {
|
|
2598
2682
|
const pv = option._zod.propValues;
|
|
2599
2683
|
if (!pv || Object.keys(pv).length === 0)
|
|
2600
2684
|
throw new Error(`Invalid discriminated union option at index "${zod.def.options.indexOf(option)}"`);
|
|
2685
|
+
if (pv[zod.def.discriminator]?.has(undefined)) undefinedCount++;
|
|
2601
2686
|
for (const [k, v] of Object.entries(pv!)) {
|
|
2602
2687
|
if (!Object.prototype.hasOwnProperty.call(propValues, k)) {
|
|
2603
2688
|
util.assignProp(propValues, k, new Set());
|
|
@@ -2607,33 +2692,19 @@ export const $ZodDiscriminatedUnion: core.$constructor<$ZodDiscriminatedUnion> =
|
|
|
2607
2692
|
}
|
|
2608
2693
|
}
|
|
2609
2694
|
}
|
|
2695
|
+
if (!zod.def.unionFallback && undefinedCount > 1) propValues[zod.def.discriminator]?.delete(undefined);
|
|
2610
2696
|
return propValues;
|
|
2611
2697
|
});
|
|
2612
2698
|
|
|
2613
|
-
// Checked now rather than in the lookup map below, so an option that lacks the discriminator fails at the `discriminatedUnion` call instead of on the first object parsed. Options whose shape cannot be enumerated without resolving it — pipes
|
|
2699
|
+
// Checked now rather than in the lookup map below, so an option that lacks the discriminator fails at the `discriminatedUnion` call instead of on the first object parsed. Options whose shape cannot be enumerated without resolving it — pipes and lazies — are left to the map.
|
|
2614
2700
|
def.options.forEach((option, i) => {
|
|
2615
|
-
const propShape =
|
|
2701
|
+
const propShape = util.rawShape(option._zod.def);
|
|
2616
2702
|
if (propShape && !Object.prototype.hasOwnProperty.call(propShape, def.discriminator)) {
|
|
2617
2703
|
throw new Error(`Invalid discriminated union option at index "${i}"`);
|
|
2618
2704
|
}
|
|
2619
2705
|
});
|
|
2620
2706
|
|
|
2621
|
-
const disc = util.cached(() =>
|
|
2622
|
-
const opts = def.options;
|
|
2623
|
-
const map: Map<util.Primitive, $ZodType> = new Map();
|
|
2624
|
-
for (const o of opts) {
|
|
2625
|
-
const values = o._zod.propValues?.[def.discriminator];
|
|
2626
|
-
if (!values || values.size === 0)
|
|
2627
|
-
throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(o)}"`);
|
|
2628
|
-
for (const v of values) {
|
|
2629
|
-
if (map.has(v)) {
|
|
2630
|
-
throw new Error(`Duplicate discriminator value "${String(v)}"`);
|
|
2631
|
-
}
|
|
2632
|
-
map.set(v, o);
|
|
2633
|
-
}
|
|
2634
|
-
}
|
|
2635
|
-
return map;
|
|
2636
|
-
});
|
|
2707
|
+
const disc = util.cached(() => discriminatorMap(def));
|
|
2637
2708
|
|
|
2638
2709
|
inst._zod.parse = (payload, ctx) => {
|
|
2639
2710
|
const input = payload.value;
|
|
@@ -2648,8 +2719,10 @@ export const $ZodDiscriminatedUnion: core.$constructor<$ZodDiscriminatedUnion> =
|
|
|
2648
2719
|
return payload;
|
|
2649
2720
|
}
|
|
2650
2721
|
|
|
2651
|
-
const
|
|
2652
|
-
|
|
2722
|
+
const value = input?.[def.discriminator];
|
|
2723
|
+
const opt = disc.value.get(value as util.Primitive);
|
|
2724
|
+
// forward metadata cannot choose an encoder for an absent tag
|
|
2725
|
+
if (opt && (value !== undefined || ctx.direction !== "backward")) {
|
|
2653
2726
|
return opt._zod.run(payload, ctx) as any;
|
|
2654
2727
|
}
|
|
2655
2728
|
|
|
@@ -2666,7 +2739,7 @@ export const $ZodDiscriminatedUnion: core.$constructor<$ZodDiscriminatedUnion> =
|
|
|
2666
2739
|
errors: [],
|
|
2667
2740
|
note: "No matching discriminator",
|
|
2668
2741
|
discriminator: def.discriminator,
|
|
2669
|
-
options: Array.from(disc.value.keys()),
|
|
2742
|
+
options: Array.from(disc.value.keys()).filter((value) => disc.value.get(value) !== null),
|
|
2670
2743
|
input,
|
|
2671
2744
|
path: [def.discriminator],
|
|
2672
2745
|
inst,
|
|
@@ -2959,6 +3032,9 @@ export const $ZodTuple: core.$constructor<$ZodTuple> = /*@__PURE__*/ core.$const
|
|
|
2959
3032
|
|
|
2960
3033
|
// Run every item in parallel, collecting results into an indexed array. The post-processing in `handleTupleResults` walks them in order so it can decide whether an absent optional-output error can truncate the tail or must be reported to preserve required output.
|
|
2961
3034
|
const itemResults: ParsePayload[] = new Array(items.length);
|
|
3035
|
+
// only tracked when there is a rest loop to skip
|
|
3036
|
+
const abortEarly = def.rest ? ctx?.abortEarly : undefined;
|
|
3037
|
+
let itemAborted = false;
|
|
2962
3038
|
for (let i = 0; i < items.length; i++) {
|
|
2963
3039
|
const r = items[i]._zod.run({ value: input[i], issues: [] }, ctx);
|
|
2964
3040
|
if (r instanceof Promise) {
|
|
@@ -2969,13 +3045,20 @@ export const $ZodTuple: core.$constructor<$ZodTuple> = /*@__PURE__*/ core.$const
|
|
|
2969
3045
|
);
|
|
2970
3046
|
} else {
|
|
2971
3047
|
itemResults[i] = r;
|
|
3048
|
+
if (abortEarly && !itemAborted && r.issues.length) itemAborted = util.aborted(r);
|
|
2972
3049
|
}
|
|
2973
3050
|
}
|
|
2974
3051
|
|
|
2975
|
-
|
|
3052
|
+
// sound because rest is non-empty exactly when every fixed index is present, the one case handleTupleResults cannot discard an item's issues
|
|
3053
|
+
if (def.rest && !itemAborted) {
|
|
2976
3054
|
let i = items.length - 1;
|
|
2977
3055
|
const rest = input.slice(items.length);
|
|
3056
|
+
let seen = payload.issues.length;
|
|
2978
3057
|
for (const el of rest) {
|
|
3058
|
+
if (abortEarly && payload.issues.length !== seen) {
|
|
3059
|
+
if (util.aborted(payload, seen)) break;
|
|
3060
|
+
seen = payload.issues.length;
|
|
3061
|
+
}
|
|
2979
3062
|
i++;
|
|
2980
3063
|
const result = def.rest._zod.run({ value: el, issues: [] }, ctx);
|
|
2981
3064
|
if (result instanceof Promise) {
|
|
@@ -3145,6 +3228,7 @@ export const $ZodRecord: core.$constructor<$ZodRecord> = /*@__PURE__*/ core.$con
|
|
|
3145
3228
|
return payload;
|
|
3146
3229
|
}
|
|
3147
3230
|
|
|
3231
|
+
// no guard in either loop below: a record's invalid_key aborts but an enclosing intersection can reconcile it, so a stopped loop hides keys the sibling does not own and the intersection then rejects nothing
|
|
3148
3232
|
const proms: Promise<any>[] = [];
|
|
3149
3233
|
|
|
3150
3234
|
const values = def.keyType._zod.values;
|
|
@@ -3349,8 +3433,14 @@ export const $ZodMap: core.$constructor<$ZodMap> = /*@__PURE__*/ core.$construct
|
|
|
3349
3433
|
|
|
3350
3434
|
const proms: Promise<any>[] = [];
|
|
3351
3435
|
payload.value = memo ? memo.alloc(inst, payload, new Map(), ctx) : new Map();
|
|
3436
|
+
const abortEarly = ctx?.abortEarly;
|
|
3437
|
+
let seen = payload.issues.length;
|
|
3352
3438
|
|
|
3353
3439
|
for (const [key, value] of input) {
|
|
3440
|
+
if (abortEarly && payload.issues.length !== seen) {
|
|
3441
|
+
if (util.aborted(payload, seen)) break;
|
|
3442
|
+
seen = payload.issues.length;
|
|
3443
|
+
}
|
|
3354
3444
|
const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
|
|
3355
3445
|
const valueResult = def.valueType._zod.run({ value: value, issues: [] }, ctx);
|
|
3356
3446
|
|
|
@@ -3454,7 +3544,13 @@ export const $ZodSet: core.$constructor<$ZodSet> = /*@__PURE__*/ core.$construct
|
|
|
3454
3544
|
|
|
3455
3545
|
const proms: Promise<any>[] = [];
|
|
3456
3546
|
payload.value = memo ? memo.alloc(inst, payload, new Set(), ctx) : new Set();
|
|
3547
|
+
const abortEarly = ctx?.abortEarly;
|
|
3548
|
+
let seen = payload.issues.length;
|
|
3457
3549
|
for (const item of input) {
|
|
3550
|
+
if (abortEarly && payload.issues.length !== seen) {
|
|
3551
|
+
if (util.aborted(payload, seen)) break;
|
|
3552
|
+
seen = payload.issues.length;
|
|
3553
|
+
}
|
|
3458
3554
|
const result = def.valueType._zod.run({ value: item, issues: [] }, ctx);
|
|
3459
3555
|
if (result instanceof Promise) {
|
|
3460
3556
|
proms.push(result.then((result) => handleSetResult(result, payload)));
|
|
@@ -3513,12 +3609,13 @@ export const $ZodEnum: core.$constructor<$ZodEnum> = /*@__PURE__*/ core.$constru
|
|
|
3513
3609
|
const valuesSet = new Set<util.Primitive>(values);
|
|
3514
3610
|
inst._zod.values = valuesSet;
|
|
3515
3611
|
|
|
3516
|
-
|
|
3517
|
-
|
|
3518
|
-
|
|
3519
|
-
|
|
3520
|
-
|
|
3521
|
-
|
|
3612
|
+
util.defineLazyInternal(inst, "pattern", (zod) => {
|
|
3613
|
+
const patternValues = util.getEnumValues(zod.def.entries).filter((k) => util.propertyKeyTypes.has(typeof k));
|
|
3614
|
+
// unmatchable fallback, RE2-safe: an empty alternation would compile to /^()$/, which matches ""
|
|
3615
|
+
return new RegExp(
|
|
3616
|
+
patternValues.length ? `^(${patternValues.map((o) => util.escapeRegex(o.toString())).join("|")})$` : "^[^\\s\\S]$"
|
|
3617
|
+
);
|
|
3618
|
+
});
|
|
3522
3619
|
|
|
3523
3620
|
inst._zod.parse = (payload, _ctx) => {
|
|
3524
3621
|
const input = payload.value;
|
|
@@ -3568,14 +3665,19 @@ export const $ZodLiteral: core.$constructor<$ZodLiteral> = /*@__PURE__*/ core.$c
|
|
|
3568
3665
|
const values = new Set<util.Literal>(def.values);
|
|
3569
3666
|
inst._zod.values = values;
|
|
3570
3667
|
|
|
3571
|
-
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
|
|
3575
|
-
|
|
3576
|
-
|
|
3577
|
-
|
|
3578
|
-
|
|
3668
|
+
util.defineLazyInternal(inst, "pattern", (zod) => {
|
|
3669
|
+
const vals = zod.def.values;
|
|
3670
|
+
// unmatchable fallback, RE2-safe: an empty alternation would compile to /^()$/, which matches ""
|
|
3671
|
+
return new RegExp(
|
|
3672
|
+
vals.length
|
|
3673
|
+
? `^(${vals
|
|
3674
|
+
.map((o: util.Literal) =>
|
|
3675
|
+
typeof o === "string" ? util.escapeRegex(o) : o ? util.escapeRegex(o.toString()) : String(o)
|
|
3676
|
+
)
|
|
3677
|
+
.join("|")})$`
|
|
3678
|
+
: "^[^\\s\\S]$"
|
|
3679
|
+
);
|
|
3680
|
+
});
|
|
3579
3681
|
|
|
3580
3682
|
inst._zod.parse = (payload, _ctx) => {
|
|
3581
3683
|
const input = payload.value;
|
|
@@ -3975,7 +4077,7 @@ export interface $ZodPrefaultDef<T extends SomeType = $ZodType> extends $ZodType
|
|
|
3975
4077
|
}
|
|
3976
4078
|
|
|
3977
4079
|
export interface $ZodPrefaultInternals<T extends SomeType = $ZodType>
|
|
3978
|
-
extends $ZodTypeInternals<
|
|
4080
|
+
extends $ZodTypeInternals<core.output<T>, core.input<T> | undefined> {
|
|
3979
4081
|
def: $ZodPrefaultDef<T>;
|
|
3980
4082
|
optin: "defaulted";
|
|
3981
4083
|
optout?: "optional" | undefined;
|
|
@@ -4574,6 +4676,51 @@ export type $PartsToTemplateLiteral<Parts extends $ZodTemplateLiteralPart[]> = [
|
|
|
4574
4676
|
: never
|
|
4575
4677
|
: never;
|
|
4576
4678
|
|
|
4679
|
+
// a leaf's pattern source with its own checks folded in: the last pattern-carrying check wins, else length bounds narrow the catch-all, else an integer format narrows the number form. the fold lives here instead of on `_zod.pattern` so a bundle without template literals never pays for it
|
|
4680
|
+
function leafPattern(schema: $ZodType): string | undefined {
|
|
4681
|
+
const def = schema._zod.def as { pattern?: RegExp; format?: string; checks?: checks.$ZodCheck[] };
|
|
4682
|
+
let pattern = def.pattern;
|
|
4683
|
+
let isInt = !!def.format?.includes("int");
|
|
4684
|
+
let minimum: number | undefined;
|
|
4685
|
+
let maximum: number | undefined;
|
|
4686
|
+
for (const ch of def.checks ?? []) {
|
|
4687
|
+
const d = ch._zod.def as { pattern?: RegExp; format?: string; minimum?: number; maximum?: number; length?: number };
|
|
4688
|
+
if (d.pattern) pattern = d.pattern;
|
|
4689
|
+
isInt ||= !!d.format?.includes("int");
|
|
4690
|
+
const lo = d.minimum ?? d.length;
|
|
4691
|
+
const hi = d.maximum ?? d.length;
|
|
4692
|
+
if (lo !== undefined && (minimum === undefined || lo > minimum)) minimum = lo;
|
|
4693
|
+
if (hi !== undefined && (maximum === undefined || hi < maximum)) maximum = hi;
|
|
4694
|
+
}
|
|
4695
|
+
if (pattern) return pattern.source;
|
|
4696
|
+
// an empty range matches nothing at runtime, and `{8,5}` is not a legal quantifier
|
|
4697
|
+
if (minimum !== undefined && maximum !== undefined && minimum > maximum) return "(?!)";
|
|
4698
|
+
if (minimum !== undefined || maximum !== undefined) return regexes.string({ minimum, maximum }).source;
|
|
4699
|
+
const own = schema._zod.pattern;
|
|
4700
|
+
return (isInt && own === regexes.number ? regexes.integer : own)?.source;
|
|
4701
|
+
}
|
|
4702
|
+
|
|
4703
|
+
// a part's pattern source. a wrapper's pattern embeds its inner pattern's source verbatim, so the folded form is substituted in place without knowing the wrapper's own composition; a union's options are joined the way the union builds its own pattern
|
|
4704
|
+
function partPattern(schema: $ZodType): string | undefined {
|
|
4705
|
+
const def = schema._zod.def as { innerType?: $ZodType; options?: $ZodType[] };
|
|
4706
|
+
const own = schema._zod.pattern?.source;
|
|
4707
|
+
// lazy resolves its inner on the internals, not the def
|
|
4708
|
+
const inner = def.innerType ?? (schema._zod as { innerType?: $ZodType }).innerType;
|
|
4709
|
+
if (inner) {
|
|
4710
|
+
const before = inner._zod.pattern?.source;
|
|
4711
|
+
const after = partPattern(inner);
|
|
4712
|
+
if (own && before && after && after !== before) {
|
|
4713
|
+
return own.replace(util.cleanRegex(before), () => util.cleanRegex(after));
|
|
4714
|
+
}
|
|
4715
|
+
return own;
|
|
4716
|
+
}
|
|
4717
|
+
if (def.options) {
|
|
4718
|
+
const sources = def.options.map(partPattern);
|
|
4719
|
+
if (sources.every(Boolean)) return `^(${sources.map((s) => util.cleanRegex(s!)).join("|")})$`;
|
|
4720
|
+
}
|
|
4721
|
+
return leafPattern(schema);
|
|
4722
|
+
}
|
|
4723
|
+
|
|
4577
4724
|
export const $ZodTemplateLiteral: core.$constructor<$ZodTemplateLiteral> = /*@__PURE__*/ core.$constructor(
|
|
4578
4725
|
"$ZodTemplateLiteral",
|
|
4579
4726
|
(inst, def) => {
|
|
@@ -4582,18 +4729,11 @@ export const $ZodTemplateLiteral: core.$constructor<$ZodTemplateLiteral> = /*@__
|
|
|
4582
4729
|
for (const part of def.parts) {
|
|
4583
4730
|
if (typeof part === "object" && part !== null) {
|
|
4584
4731
|
// is Zod schema
|
|
4585
|
-
|
|
4586
|
-
|
|
4732
|
+
const source = partPattern(part);
|
|
4733
|
+
if (!source) {
|
|
4587
4734
|
throw new Error(`Invalid template literal part, no pattern found: ${[...(part as any)._zod.traits].shift()}`);
|
|
4588
4735
|
}
|
|
4589
|
-
|
|
4590
|
-
const source = part._zod.pattern instanceof RegExp ? part._zod.pattern.source : part._zod.pattern;
|
|
4591
|
-
|
|
4592
|
-
if (!source) throw new Error(`Invalid template literal part: ${part._zod.traits}`);
|
|
4593
|
-
|
|
4594
|
-
const start = source.startsWith("^") ? 1 : 0;
|
|
4595
|
-
const end = source.endsWith("$") ? source.length - 1 : source.length;
|
|
4596
|
-
regexParts.push(source.slice(start, end));
|
|
4736
|
+
regexParts.push(util.cleanRegex(source));
|
|
4597
4737
|
} else if (part === null || util.primitiveTypes.has(typeof part)) {
|
|
4598
4738
|
regexParts.push(util.escapeRegex(`${part}`));
|
|
4599
4739
|
} else {
|
|
@@ -4956,6 +5096,101 @@ function handleRefineResult(result: unknown, payload: ParsePayload, input: unkno
|
|
|
4956
5096
|
}
|
|
4957
5097
|
}
|
|
4958
5098
|
|
|
5099
|
+
////////////////////////////////////////
|
|
5100
|
+
////////////////////////////////////////
|
|
5101
|
+
////////// //////////
|
|
5102
|
+
////////// $ZodProperties //////////
|
|
5103
|
+
////////// //////////
|
|
5104
|
+
////////////////////////////////////////
|
|
5105
|
+
////////////////////////////////////////
|
|
5106
|
+
export interface $ZodPropertiesDef<Shape extends $ZodShape = $ZodShape> extends $ZodTypeDef, checks.$ZodCheckDef {
|
|
5107
|
+
type: "properties";
|
|
5108
|
+
check: "properties";
|
|
5109
|
+
shape: Shape;
|
|
5110
|
+
}
|
|
5111
|
+
|
|
5112
|
+
// both sides infer the INPUT type: the shape is asserted and its results discarded, so a default, catch or transform inside it would make an output-typed inference a lie. The check side widens a literal to its primitive, so spreading over a `string` property still type-checks (#6520).
|
|
5113
|
+
export interface $ZodPropertiesInternals<Shape extends $ZodShape = $ZodShape>
|
|
5114
|
+
extends $ZodTypeInternals<$InferObjectInput<Shape, {}>, $InferObjectInput<Shape, {}>>,
|
|
5115
|
+
checks.$ZodCheckInternals<{ -readonly [k in keyof Shape]: util.Widen<core.input<Shape[k]>> }> {
|
|
5116
|
+
def: $ZodPropertiesDef<Shape>;
|
|
5117
|
+
isst: errors.$ZodIssueInvalidType;
|
|
5118
|
+
issc: errors.$ZodIssue;
|
|
5119
|
+
}
|
|
5120
|
+
|
|
5121
|
+
export interface $ZodProperties<Shape extends $ZodShape = $ZodShape> extends $ZodType {
|
|
5122
|
+
_zod: $ZodPropertiesInternals<Shape>;
|
|
5123
|
+
// yields the schema itself, so pre-4.6 `.check(...z.properties(shape))` spread call sites keep working
|
|
5124
|
+
[Symbol.iterator](): Iterator<this>;
|
|
5125
|
+
}
|
|
5126
|
+
|
|
5127
|
+
// asserts in place: the child result's value is discarded, matching z.property(), because a nested object or array schema rebuilds its output even when nothing transformed
|
|
5128
|
+
function handlePropertiesResult(result: ParsePayload, payload: ParsePayload, key: string | symbol): void {
|
|
5129
|
+
if (result.issues.length) {
|
|
5130
|
+
payload.issues.push(...util.prefixIssues(key, result.issues));
|
|
5131
|
+
}
|
|
5132
|
+
}
|
|
5133
|
+
|
|
5134
|
+
export const $ZodProperties: core.$constructor<$ZodProperties> = /*@__PURE__*/ core.$constructor(
|
|
5135
|
+
"$ZodProperties",
|
|
5136
|
+
(inst, def) => {
|
|
5137
|
+
// $ZodType.init prepends an instance that already carries the $ZodCheck trait to its own `checks`, which would run the shape a second time and cost the parse context. Initializing the check trait after it keeps the schema role in `parse`, where the context arrives.
|
|
5138
|
+
$ZodType.init(inst, def);
|
|
5139
|
+
checks.$ZodCheck.init(inst, def);
|
|
5140
|
+
|
|
5141
|
+
const memo = core.globalConfig.memoizer;
|
|
5142
|
+
memo?.attach(inst);
|
|
5143
|
+
|
|
5144
|
+
// key and schema snapshotted together: reading one live and the other cached lets a later mutation of the caller's shape object pair a stale key with a missing schema
|
|
5145
|
+
let entries!: [string | symbol, $ZodType][];
|
|
5146
|
+
const runShape = (payload: ParsePayload, ctx: ParseContextInternal): util.MaybeAsync<void> => {
|
|
5147
|
+
entries ??= Reflect.ownKeys(def.shape).map((key) => [key, (def.shape as any)[key] as $ZodType]);
|
|
5148
|
+
const input = payload.value as any;
|
|
5149
|
+
let proms: Promise<any>[] | undefined;
|
|
5150
|
+
for (const [key, schema] of entries) {
|
|
5151
|
+
const result = schema._zod.run({ value: input[key], issues: [] }, ctx);
|
|
5152
|
+
if (result instanceof Promise) {
|
|
5153
|
+
proms ??= [];
|
|
5154
|
+
proms.push(result.then((result) => handlePropertiesResult(result, payload, key)));
|
|
5155
|
+
} else {
|
|
5156
|
+
handlePropertiesResult(result, payload, key);
|
|
5157
|
+
}
|
|
5158
|
+
}
|
|
5159
|
+
if (proms) return Promise.all(proms).then(() => undefined);
|
|
5160
|
+
return undefined;
|
|
5161
|
+
};
|
|
5162
|
+
|
|
5163
|
+
inst._zod.parse = (payload, ctx) => {
|
|
5164
|
+
const input = payload.value;
|
|
5165
|
+
// as a schema this is the type gate, and it infers an object shape, so a primitive is a type error. A function passes: its properties read like any other object's, and z.instanceof allows one.
|
|
5166
|
+
if (input === null || (typeof input !== "object" && typeof input !== "function")) {
|
|
5167
|
+
payload.issues.push({ expected: "object", code: "invalid_type", input, inst });
|
|
5168
|
+
return payload;
|
|
5169
|
+
}
|
|
5170
|
+
// both sides declare the shape's input type, so the assertion runs forward in either direction; encoding the children backward would reject the very type this schema claims to take
|
|
5171
|
+
if (ctx.direction === "backward") ctx = { ...ctx, direction: "forward" };
|
|
5172
|
+
// the input is its own output here, so it registers as its own memo entry: a cycle re-entering this node hits the bucket instead of recursing forever
|
|
5173
|
+
if (memo) memo.alloc(inst, payload, input, ctx);
|
|
5174
|
+
const result = runShape(payload, ctx);
|
|
5175
|
+
return result instanceof Promise ? result.then(() => payload) : payload;
|
|
5176
|
+
};
|
|
5177
|
+
|
|
5178
|
+
// as a check the base schema already typed the value, so this only asserts the properties — which read on a primitive too, matching z.property() on a string's length. It gets no context of its own, so a cycle through a spread schema is not tracked.
|
|
5179
|
+
inst._zod.check = (payload) => {
|
|
5180
|
+
if (payload.value == null) {
|
|
5181
|
+
payload.issues.push({ expected: "object", code: "invalid_type", input: payload.value, inst });
|
|
5182
|
+
return undefined;
|
|
5183
|
+
}
|
|
5184
|
+
return runShape(payload, {});
|
|
5185
|
+
};
|
|
5186
|
+
},
|
|
5187
|
+
{
|
|
5188
|
+
*[Symbol.iterator]() {
|
|
5189
|
+
yield this;
|
|
5190
|
+
},
|
|
5191
|
+
}
|
|
5192
|
+
);
|
|
5193
|
+
|
|
4959
5194
|
export type $ZodTypes =
|
|
4960
5195
|
| $ZodString
|
|
4961
5196
|
| $ZodNumber
|
|
@@ -4988,6 +5223,7 @@ export type $ZodTypes =
|
|
|
4988
5223
|
| $ZodPrefault
|
|
4989
5224
|
| $ZodTemplateLiteral
|
|
4990
5225
|
| $ZodCustom
|
|
5226
|
+
| $ZodProperties
|
|
4991
5227
|
| $ZodTransform
|
|
4992
5228
|
| $ZodNonOptional
|
|
4993
5229
|
| $ZodReadonly
|
|
@@ -5022,6 +5258,7 @@ export type $ZodStringFormatTypes =
|
|
|
5022
5258
|
| $ZodBase64URL
|
|
5023
5259
|
| $ZodE164
|
|
5024
5260
|
| $ZodCreditCard
|
|
5261
|
+
| $ZodIBAN
|
|
5025
5262
|
| $ZodJWT
|
|
5026
5263
|
| $ZodCustomStringFormat<"hex">
|
|
5027
5264
|
| $ZodCustomStringFormat<util.HashFormat>
|