@psnext/slingcli 3.3.20260911-1 → 3.3.20260914-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/@earendil-works/pi-coding-agent/dist/bundle/chunks/{chunk-VDBOM5UG.js → chunk-BRL3MDQL.js} +1 -1
- 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/dist/modes/interactive/components/model-selector.js +79 -32
- package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.browser.js +2 -0
- package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.js +25 -8
- package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.native.js +2 -0
- package/node_modules/@smithy/core/dist-es/submodules/serde/util-stream/getAwsChunkedEncodingStream.browser.js +2 -0
- package/node_modules/@smithy/core/dist-es/submodules/serde/util-stream/getAwsChunkedEncodingStream.js +23 -8
- package/node_modules/@smithy/core/package.json +1 -1
- package/node_modules/@types/node/README.md +2 -2
- package/node_modules/@types/node/assert/strict.d.ts +13 -56
- package/node_modules/@types/node/assert.d.ts +189 -190
- package/node_modules/@types/node/async_hooks.d.ts +151 -43
- package/node_modules/@types/node/buffer.buffer.d.ts +12 -13
- package/node_modules/@types/node/buffer.d.ts +103 -237
- package/node_modules/@types/node/child_process.d.ts +39 -154
- package/node_modules/@types/node/cluster.d.ts +238 -384
- package/node_modules/@types/node/console.d.ts +45 -404
- package/node_modules/@types/node/constants.d.ts +3 -10
- package/node_modules/@types/node/crypto.d.ts +1000 -1593
- package/node_modules/@types/node/dgram.d.ts +133 -81
- package/node_modules/@types/node/diagnostics_channel.d.ts +277 -59
- package/node_modules/@types/node/dns/promises.d.ts +9 -15
- package/node_modules/@types/node/dns.d.ts +136 -183
- package/node_modules/@types/node/domain.d.ts +12 -32
- package/node_modules/@types/node/events.d.ts +872 -840
- package/node_modules/@types/node/ffi.d.ts +486 -0
- package/node_modules/@types/node/fs/promises.d.ts +256 -85
- package/node_modules/@types/node/fs.d.ts +865 -525
- package/node_modules/@types/node/globals.d.ts +12 -34
- package/node_modules/@types/node/globals.typedarray.d.ts +63 -0
- package/node_modules/@types/node/http.d.ts +433 -312
- package/node_modules/@types/node/http2.d.ts +545 -891
- package/node_modules/@types/node/https.d.ts +64 -243
- package/node_modules/@types/node/index.d.ts +25 -7
- package/node_modules/@types/node/inspector/promises.d.ts +35 -0
- package/node_modules/@types/node/inspector.d.ts +70 -58
- package/node_modules/@types/node/inspector.generated.d.ts +764 -410
- package/node_modules/@types/node/module.d.ts +54 -219
- package/node_modules/@types/node/net.d.ts +208 -222
- package/node_modules/@types/node/os.d.ts +41 -49
- package/node_modules/@types/node/package.json +13 -3
- package/node_modules/@types/node/path/posix.d.ts +8 -0
- package/node_modules/@types/node/path/win32.d.ts +8 -0
- package/node_modules/@types/node/path.d.ts +119 -141
- package/node_modules/@types/node/perf_hooks.d.ts +339 -690
- package/node_modules/@types/node/process.d.ts +389 -205
- package/node_modules/@types/node/punycode.d.ts +3 -31
- package/node_modules/@types/node/querystring.d.ts +3 -16
- package/node_modules/@types/node/quic.d.ts +2153 -0
- package/node_modules/@types/node/readline/promises.d.ts +3 -6
- package/node_modules/@types/node/readline.d.ts +66 -152
- package/node_modules/@types/node/repl.d.ts +101 -109
- package/node_modules/@types/node/sea.d.ts +1 -116
- package/node_modules/@types/node/sqlite.d.ts +486 -68
- package/node_modules/@types/node/stream/consumers.d.ts +91 -15
- package/node_modules/@types/node/stream/iter.d.ts +452 -0
- package/node_modules/@types/node/stream/promises.d.ts +136 -15
- package/node_modules/@types/node/stream/web.d.ts +197 -454
- package/node_modules/@types/node/stream.d.ts +603 -491
- package/node_modules/@types/node/string_decoder.d.ts +3 -43
- package/node_modules/@types/node/test/reporters.d.ts +59 -0
- package/node_modules/@types/node/test.d.ts +513 -292
- package/node_modules/@types/node/timers/promises.d.ts +3 -18
- package/node_modules/@types/node/timers.d.ts +3 -141
- package/node_modules/@types/node/tls.d.ts +166 -257
- package/node_modules/@types/node/trace_events.d.ts +3 -97
- package/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +7 -8
- package/node_modules/@types/node/ts5.6/compatibility/float16array.d.ts +71 -0
- package/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +2 -0
- package/node_modules/@types/node/ts5.6/index.d.ts +26 -6
- package/node_modules/@types/node/ts5.7/compatibility/float16array.d.ts +72 -0
- package/node_modules/@types/node/ts5.7/index.d.ts +118 -0
- package/node_modules/@types/node/tty.d.ts +61 -43
- package/node_modules/@types/node/url.d.ts +156 -584
- package/node_modules/@types/node/util/types.d.ts +558 -0
- package/node_modules/@types/node/util.d.ts +170 -1099
- package/node_modules/@types/node/v8.d.ts +175 -36
- package/node_modules/@types/node/vfs.d.ts +211 -0
- package/node_modules/@types/node/vm.d.ts +292 -209
- package/node_modules/@types/node/wasi.d.ts +24 -74
- package/node_modules/@types/node/web-globals/abortcontroller.d.ts +27 -2
- package/node_modules/@types/node/web-globals/blob.d.ts +23 -0
- package/node_modules/@types/node/web-globals/console.d.ts +9 -0
- package/node_modules/@types/node/web-globals/crypto.d.ts +39 -0
- package/node_modules/@types/node/web-globals/domexception.d.ts +15 -0
- package/node_modules/@types/node/web-globals/encoding.d.ts +11 -0
- package/node_modules/@types/node/web-globals/events.d.ts +9 -0
- package/node_modules/@types/node/web-globals/fetch.d.ts +14 -0
- package/node_modules/@types/node/web-globals/importmeta.d.ts +13 -0
- package/node_modules/@types/node/web-globals/messaging.d.ts +23 -0
- package/node_modules/@types/node/web-globals/navigator.d.ts +3 -0
- package/node_modules/@types/node/web-globals/performance.d.ts +45 -0
- package/node_modules/@types/node/web-globals/streams.d.ts +97 -0
- package/node_modules/@types/node/web-globals/timers.d.ts +44 -0
- package/node_modules/@types/node/web-globals/url.d.ts +24 -0
- package/node_modules/@types/node/worker_threads.d.ts +257 -407
- package/node_modules/@types/node/zlib/iter.d.ts +131 -0
- package/node_modules/@types/node/zlib.d.ts +24 -165
- package/node_modules/undici-types/agent.d.ts +12 -13
- package/node_modules/undici-types/api.d.ts +26 -26
- package/node_modules/undici-types/balanced-pool.d.ts +13 -12
- package/node_modules/undici-types/cache-interceptor.d.ts +179 -0
- package/node_modules/undici-types/client-stats.d.ts +15 -0
- package/node_modules/undici-types/client.d.ts +63 -37
- package/node_modules/undici-types/connector.d.ts +5 -2
- package/node_modules/undici-types/cookies.d.ts +3 -1
- package/node_modules/undici-types/diagnostics-channel.d.ts +18 -10
- package/node_modules/undici-types/dispatcher.d.ts +136 -139
- package/node_modules/undici-types/dispatcher1-wrapper.d.ts +7 -0
- package/node_modules/undici-types/env-http-proxy-agent.d.ts +4 -3
- package/node_modules/undici-types/errors.d.ts +92 -54
- package/node_modules/undici-types/eventsource.d.ts +9 -4
- package/node_modules/undici-types/fetch.d.ts +51 -25
- 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/h2c-client.d.ts +73 -0
- package/node_modules/undici-types/handlers.d.ts +10 -9
- package/node_modules/undici-types/header.d.ts +162 -1
- package/node_modules/undici-types/index.d.ts +69 -47
- package/node_modules/undici-types/interceptors.d.ts +72 -9
- package/node_modules/undici-types/mock-agent.d.ts +36 -18
- package/node_modules/undici-types/mock-call-history.d.ts +111 -0
- package/node_modules/undici-types/mock-client.d.ts +6 -4
- package/node_modules/undici-types/mock-errors.d.ts +3 -3
- package/node_modules/undici-types/mock-interceptor.d.ts +26 -21
- package/node_modules/undici-types/mock-pool.d.ts +6 -4
- package/node_modules/undici-types/package.json +1 -1
- package/node_modules/undici-types/patch.d.ts +0 -4
- 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 +14 -6
- package/node_modules/undici-types/readable.d.ts +19 -16
- package/node_modules/undici-types/retry-agent.d.ts +1 -1
- package/node_modules/undici-types/retry-handler.d.ts +19 -10
- package/node_modules/undici-types/round-robin-pool.d.ts +39 -0
- package/node_modules/undici-types/snapshot-agent.d.ts +113 -0
- package/node_modules/undici-types/socks5-proxy-agent.d.ts +25 -0
- package/node_modules/undici-types/util.d.ts +3 -3
- package/node_modules/undici-types/utility.d.ts +7 -0
- package/node_modules/undici-types/webidl.d.ts +148 -30
- package/node_modules/undici-types/websocket.d.ts +48 -10
- package/node_modules/zod/README.md +2 -2
- package/node_modules/zod/package.json +1 -1
- package/node_modules/zod/src/v4/classic/checks.ts +1 -0
- package/node_modules/zod/src/v4/classic/schemas.ts +14 -30
- package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +1 -0
- package/node_modules/zod/src/v4/classic/tests/cyclic-data.test.ts +2 -11
- package/node_modules/zod/src/v4/classic/tests/firstparty.test.ts +0 -4
- package/node_modules/zod/src/v4/classic/tests/instance-footprint.test.ts +22 -0
- package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +1 -1
- package/node_modules/zod/src/v4/classic/tests/number.test.ts +39 -0
- package/node_modules/zod/src/v4/classic/tests/properties.test.ts +53 -137
- package/node_modules/zod/src/v4/classic/tests/string.test.ts +70 -1
- package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +87 -35
- package/node_modules/zod/src/v4/core/api.ts +21 -29
- package/node_modules/zod/src/v4/core/checks.ts +61 -1
- package/node_modules/zod/src/v4/core/compile.ts +35 -24
- package/node_modules/zod/src/v4/core/core.ts +1 -3
- package/node_modules/zod/src/v4/core/json-schema-processors.ts +9 -63
- package/node_modules/zod/src/v4/core/memoizer.ts +2 -5
- package/node_modules/zod/src/v4/core/regexes.ts +4 -0
- package/node_modules/zod/src/v4/core/schemas.ts +36 -109
- package/node_modules/zod/src/v4/core/tests/compile-differential.test.ts +35 -0
- package/node_modules/zod/src/v4/core/tests/compile.test.ts +177 -0
- package/node_modules/zod/src/v4/core/tests/url-no-canparse.test.ts +118 -16
- package/node_modules/zod/src/v4/core/to-json-schema.ts +1 -1
- package/node_modules/zod/src/v4/core/util.ts +0 -4
- package/node_modules/zod/src/v4/core/versions.ts +1 -1
- package/node_modules/zod/src/v4/core/visit.ts +0 -11
- 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/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 +1 -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 +1 -0
- package/node_modules/zod/src/v4/mini/schemas.ts +12 -23
- package/node_modules/zod/src/v4/mini/tests/index.test.ts +56 -0
- package/node_modules/zod/src/v4/mini/tests/string.test.ts +7 -0
- package/node_modules/zod/v4/classic/checks.cjs +2 -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/schemas.cjs +11 -15
- package/node_modules/zod/v4/classic/schemas.d.cts +4 -6
- package/node_modules/zod/v4/classic/schemas.d.ts +4 -6
- package/node_modules/zod/v4/classic/schemas.js +9 -13
- package/node_modules/zod/v4/core/api.cjs +11 -23
- package/node_modules/zod/v4/core/api.d.cts +8 -4
- package/node_modules/zod/v4/core/api.d.ts +8 -4
- package/node_modules/zod/v4/core/api.js +11 -23
- package/node_modules/zod/v4/core/checks.cjs +32 -1
- package/node_modules/zod/v4/core/checks.d.cts +16 -0
- package/node_modules/zod/v4/core/checks.d.ts +16 -0
- package/node_modules/zod/v4/core/checks.js +31 -0
- package/node_modules/zod/v4/core/compile.cjs +12 -17
- package/node_modules/zod/v4/core/compile.js +13 -18
- package/node_modules/zod/v4/core/core.cjs +1 -1
- package/node_modules/zod/v4/core/core.js +1 -1
- package/node_modules/zod/v4/core/json-schema-processors.cjs +8 -44
- package/node_modules/zod/v4/core/json-schema-processors.d.cts +0 -1
- package/node_modules/zod/v4/core/json-schema-processors.d.ts +0 -1
- package/node_modules/zod/v4/core/json-schema-processors.js +8 -43
- package/node_modules/zod/v4/core/memoizer.cjs +2 -5
- package/node_modules/zod/v4/core/memoizer.js +2 -5
- package/node_modules/zod/v4/core/regexes.cjs +4 -2
- package/node_modules/zod/v4/core/regexes.d.cts +1 -0
- package/node_modules/zod/v4/core/regexes.d.ts +1 -0
- package/node_modules/zod/v4/core/regexes.js +2 -0
- package/node_modules/zod/v4/core/schemas.cjs +33 -73
- package/node_modules/zod/v4/core/schemas.d.cts +7 -22
- package/node_modules/zod/v4/core/schemas.d.ts +7 -22
- package/node_modules/zod/v4/core/schemas.js +30 -72
- package/node_modules/zod/v4/core/to-json-schema.cjs +0 -1
- package/node_modules/zod/v4/core/to-json-schema.d.cts +0 -3
- package/node_modules/zod/v4/core/to-json-schema.d.ts +0 -3
- package/node_modules/zod/v4/core/to-json-schema.js +1 -1
- package/node_modules/zod/v4/core/util.cjs +0 -4
- package/node_modules/zod/v4/core/util.js +0 -4
- package/node_modules/zod/v4/core/versions.cjs +1 -1
- package/node_modules/zod/v4/core/versions.js +1 -1
- package/node_modules/zod/v4/core/visit.cjs +0 -12
- package/node_modules/zod/v4/core/visit.js +0 -12
- 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/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 +1 -0
- package/node_modules/zod/v4/locales/tg.js +1 -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 +2 -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/schemas.cjs +11 -13
- package/node_modules/zod/v4/mini/schemas.d.cts +1 -4
- package/node_modules/zod/v4/mini/schemas.d.ts +1 -4
- package/node_modules/zod/v4/mini/schemas.js +9 -11
- package/package.json +2 -2
- package/slingshot/index.js +183 -182
- package/node_modules/@types/node/compatibility/disposable.d.ts +0 -14
- package/node_modules/@types/node/compatibility/index.d.ts +0 -9
- package/node_modules/@types/node/compatibility/indexable.d.ts +0 -20
- package/node_modules/@types/node/compatibility/iterators.d.ts +0 -20
- package/node_modules/undici-types/file.d.ts +0 -39
- package/node_modules/undici-types/filereader.d.ts +0 -54
|
@@ -1000,7 +1000,7 @@ export const $ZodCheckEndsWith: core.$constructor<$ZodCheckEndsWith> = /*@__PURE
|
|
|
1000
1000
|
function handleCheckPropertyResult(
|
|
1001
1001
|
result: schemas.ParsePayload<unknown>,
|
|
1002
1002
|
payload: schemas.ParsePayload<unknown>,
|
|
1003
|
-
property: string
|
|
1003
|
+
property: string | symbol
|
|
1004
1004
|
) {
|
|
1005
1005
|
if (result.issues.length) {
|
|
1006
1006
|
payload.issues.push(...util.prefixIssues(property, result.issues));
|
|
@@ -1045,6 +1045,66 @@ export const $ZodCheckProperty: core.$constructor<$ZodCheckProperty> = /*@__PURE
|
|
|
1045
1045
|
}
|
|
1046
1046
|
);
|
|
1047
1047
|
|
|
1048
|
+
/////////////////////////////////////
|
|
1049
|
+
///// $ZodCheckProperties /////
|
|
1050
|
+
/////////////////////////////////////
|
|
1051
|
+
export interface $ZodCheckPropertiesDef<Shape extends schemas.$ZodShape = schemas.$ZodShape> extends $ZodCheckDef {
|
|
1052
|
+
check: "properties";
|
|
1053
|
+
shape: Shape;
|
|
1054
|
+
}
|
|
1055
|
+
|
|
1056
|
+
// typed over the input side, since each child's result is discarded; a literal widens to its primitive so spreading over a `string` property still type-checks (#6520)
|
|
1057
|
+
export type $ZodCheckPropertiesInput<Shape extends schemas.$ZodShape = schemas.$ZodShape> = {
|
|
1058
|
+
-readonly [k in keyof Shape]: util.Widen<core.input<Shape[k]>>;
|
|
1059
|
+
};
|
|
1060
|
+
|
|
1061
|
+
export interface $ZodCheckPropertiesInternals<Shape extends schemas.$ZodShape = schemas.$ZodShape>
|
|
1062
|
+
extends $ZodCheckInternals<$ZodCheckPropertiesInput<Shape>> {
|
|
1063
|
+
def: $ZodCheckPropertiesDef<Shape>;
|
|
1064
|
+
issc: errors.$ZodIssue;
|
|
1065
|
+
}
|
|
1066
|
+
|
|
1067
|
+
export interface $ZodCheckProperties<Shape extends schemas.$ZodShape = schemas.$ZodShape>
|
|
1068
|
+
extends $ZodCheck<$ZodCheckPropertiesInput<Shape>> {
|
|
1069
|
+
_zod: $ZodCheckPropertiesInternals<Shape>;
|
|
1070
|
+
// yields the check itself, so `.check(...z.properties(shape))` spread call sites keep working
|
|
1071
|
+
[Symbol.iterator](): Iterator<this>;
|
|
1072
|
+
}
|
|
1073
|
+
|
|
1074
|
+
export const $ZodCheckProperties: core.$constructor<$ZodCheckProperties> = /*@__PURE__*/ core.$constructor(
|
|
1075
|
+
"$ZodCheckProperties",
|
|
1076
|
+
(inst, def) => {
|
|
1077
|
+
$ZodCheck.init(inst, def);
|
|
1078
|
+
util.hide(inst, Symbol.iterator, function* () {
|
|
1079
|
+
yield inst;
|
|
1080
|
+
});
|
|
1081
|
+
|
|
1082
|
+
// 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
|
|
1083
|
+
let entries!: [string | symbol, schemas.$ZodType][];
|
|
1084
|
+
inst._zod.check = (payload) => {
|
|
1085
|
+
// the base schema already typed the value, so only a nullish one is rejected here: the properties read on a primitive too, matching z.property() on a string's length
|
|
1086
|
+
if (payload.value == null) {
|
|
1087
|
+
payload.issues.push({ expected: "object", code: "invalid_type", input: payload.value, inst });
|
|
1088
|
+
return undefined;
|
|
1089
|
+
}
|
|
1090
|
+
entries ??= Reflect.ownKeys(def.shape).map((key) => [key, (def.shape as any)[key] as schemas.$ZodType]);
|
|
1091
|
+
const input = payload.value as any;
|
|
1092
|
+
let proms: Promise<any>[] | undefined;
|
|
1093
|
+
for (const [key, schema] of entries) {
|
|
1094
|
+
const result = schema._zod.run({ value: input[key], issues: [] }, {});
|
|
1095
|
+
if (result instanceof Promise) {
|
|
1096
|
+
proms ??= [];
|
|
1097
|
+
proms.push(result.then((result) => handleCheckPropertyResult(result, payload, key)));
|
|
1098
|
+
} else {
|
|
1099
|
+
handleCheckPropertyResult(result, payload, key);
|
|
1100
|
+
}
|
|
1101
|
+
}
|
|
1102
|
+
if (proms) return Promise.all(proms).then(() => undefined);
|
|
1103
|
+
return undefined;
|
|
1104
|
+
};
|
|
1105
|
+
}
|
|
1106
|
+
);
|
|
1107
|
+
|
|
1048
1108
|
///////////////////////////////////
|
|
1049
1109
|
///// $ZodCheckMimeType /////
|
|
1050
1110
|
///////////////////////////////////
|
|
@@ -13,12 +13,12 @@ import {
|
|
|
13
13
|
isValidIPv6,
|
|
14
14
|
isValidJWT,
|
|
15
15
|
mergeValues,
|
|
16
|
-
parseURLObject,
|
|
17
16
|
stripTabAndNewline,
|
|
18
17
|
urlHostnameOk,
|
|
19
18
|
urlProtocolOk,
|
|
19
|
+
validateURL,
|
|
20
20
|
} from "./schemas.js";
|
|
21
|
-
import type {
|
|
21
|
+
import type { ParseContextInternal, ParsePayload, SomeType } from "./schemas.js";
|
|
22
22
|
import * as util from "./util.js";
|
|
23
23
|
|
|
24
24
|
/** @internal Sentinel the compiled fast path returns when validation fails. */
|
|
@@ -89,7 +89,7 @@ type SupportedCheck =
|
|
|
89
89
|
| checks.$ZodCheckLengthEquals
|
|
90
90
|
| checks.$ZodCheckStringFormat
|
|
91
91
|
| checks.$ZodCheckProperty
|
|
92
|
-
|
|
|
92
|
+
| checks.$ZodCheckProperties
|
|
93
93
|
| checks.$ZodCheckMimeType
|
|
94
94
|
| checks.$ZodCheckOverwrite
|
|
95
95
|
| { _zod: { def: { check: "custom"; fn?: (value: unknown) => boolean }; check?: (payload: unknown) => unknown } };
|
|
@@ -455,7 +455,7 @@ function generateChecks(doc: Doc, ctx: CompileContext, schema: SomeType, accesso
|
|
|
455
455
|
generatePropertyCheck(doc, ctx, def, currentAccessor);
|
|
456
456
|
break;
|
|
457
457
|
case "properties":
|
|
458
|
-
generatePropertiesChecks(doc, ctx, def, currentAccessor
|
|
458
|
+
generatePropertiesChecks(doc, ctx, def, currentAccessor);
|
|
459
459
|
break;
|
|
460
460
|
case "overwrite": {
|
|
461
461
|
// Overwrite transforms the value - create new variable for transformed result
|
|
@@ -616,20 +616,15 @@ function generateMimeTypeCheck(
|
|
|
616
616
|
function generatePropertiesChecks(
|
|
617
617
|
doc: Doc,
|
|
618
618
|
ctx: CompileContext,
|
|
619
|
-
def:
|
|
620
|
-
accessor: string
|
|
621
|
-
schemaRole: boolean
|
|
619
|
+
def: checks.$ZodCheckPropertiesDef,
|
|
620
|
+
accessor: string
|
|
622
621
|
): void {
|
|
623
|
-
// a custom `when` gates the assertion at runtime; inside a union a wrongly-run branch is absorbed as a branch failure rather than falling back, so refuse at codegen
|
|
622
|
+
// a custom `when` gates the assertion at runtime; inside a union a wrongly-run branch is absorbed as a branch failure rather than falling back, so refuse at codegen
|
|
624
623
|
if (def.when) {
|
|
625
624
|
throw new ZodCompileUnsupportedError(`check with a custom "when" condition`);
|
|
626
625
|
}
|
|
627
|
-
// matches the runtime gate
|
|
628
|
-
doc.write(
|
|
629
|
-
schemaRole
|
|
630
|
-
? `if (${accessor} === null || (typeof ${accessor} !== "object" && typeof ${accessor} !== "function")) return INVALID;`
|
|
631
|
-
: `if (${accessor} == null) return INVALID;`
|
|
632
|
-
);
|
|
626
|
+
// matches the runtime gate: the base schema already typed the value, so only a nullish one is rejected
|
|
627
|
+
doc.write(`if (${accessor} == null) return INVALID;`);
|
|
633
628
|
const shape = def.shape as Record<string | symbol, SomeType>;
|
|
634
629
|
for (const key of Reflect.ownKeys(shape)) {
|
|
635
630
|
// a symbol has no source literal, so it is hoisted as a constant
|
|
@@ -777,7 +772,21 @@ const PATTERN_IS_COMPLETE: Set<string> = new Set([
|
|
|
777
772
|
]);
|
|
778
773
|
|
|
779
774
|
// Returns the accessor holding the (possibly normalized) value after the check — url/normalize formats produce a new value like overwrite does. Never assigns to the incoming accessor: it may be a `const` or a property expression on user input.
|
|
780
|
-
function generateStringFormatCheck(doc: Doc, ctx: CompileContext, def: StringFormatDef, accessor: string): string
|
|
775
|
+
function generateStringFormatCheck(doc: Doc, ctx: CompileContext, def: StringFormatDef, accessor: string): string;
|
|
776
|
+
function generateStringFormatCheck(
|
|
777
|
+
doc: Doc,
|
|
778
|
+
ctx: CompileContext,
|
|
779
|
+
def: StringFormatDef,
|
|
780
|
+
accessor: string,
|
|
781
|
+
needsValue: boolean
|
|
782
|
+
): string | null;
|
|
783
|
+
function generateStringFormatCheck(
|
|
784
|
+
doc: Doc,
|
|
785
|
+
ctx: CompileContext,
|
|
786
|
+
def: StringFormatDef,
|
|
787
|
+
accessor: string,
|
|
788
|
+
needsValue = true
|
|
789
|
+
): string | null {
|
|
781
790
|
// Some string formats do runtime validation beyond their advertised pattern. For cheap pure utility checks, hoist the runtime function and call it so the fast path stays correct without cloning the utility logic into codegen.
|
|
782
791
|
const fmt = def.format;
|
|
783
792
|
if (fmt === "base64") {
|
|
@@ -825,7 +834,7 @@ function generateStringFormatCheck(doc: Doc, ctx: CompileContext, def: StringFor
|
|
|
825
834
|
formatDef.protocol !== undefined
|
|
826
835
|
) {
|
|
827
836
|
// Same three predicates the runtime calls, in the same order, so there is no second URL implementation to drift. Which options exist is known now, so the calls the runtime makes conditionally are emitted conditionally instead.
|
|
828
|
-
const parseConst = addConstant(ctx,
|
|
837
|
+
const parseConst = addConstant(ctx, validateURL);
|
|
829
838
|
const defConst = addConstant(ctx, def);
|
|
830
839
|
const trimVar = newVar(ctx);
|
|
831
840
|
const urlVar = newVar(ctx);
|
|
@@ -840,6 +849,7 @@ function generateStringFormatCheck(doc: Doc, ctx: CompileContext, def: StringFor
|
|
|
840
849
|
const protocolConst = addConstant(ctx, urlProtocolOk);
|
|
841
850
|
doc.write(`if (!${protocolConst}(${urlVar}, ${defConst}.protocol)) return INVALID;`);
|
|
842
851
|
}
|
|
852
|
+
if (!needsValue) return null;
|
|
843
853
|
const outputVar = newVar(ctx);
|
|
844
854
|
const outputExpr = formatDef.normalize ? `${urlVar}.href` : `${addConstant(ctx, stripTabAndNewline)}(${trimVar})`;
|
|
845
855
|
doc.write(`const ${outputVar} = ${outputExpr};`);
|
|
@@ -934,7 +944,6 @@ type SupportedSchemaType =
|
|
|
934
944
|
| "lazy"
|
|
935
945
|
| "pipe"
|
|
936
946
|
| "custom"
|
|
937
|
-
| "properties"
|
|
938
947
|
| "transform"
|
|
939
948
|
| "catch";
|
|
940
949
|
|
|
@@ -967,7 +976,7 @@ function generateCheck(
|
|
|
967
976
|
|
|
968
977
|
switch (type) {
|
|
969
978
|
case "string":
|
|
970
|
-
typeAccessor = generateStringCheck(doc, ctx, schema, accessor);
|
|
979
|
+
typeAccessor = generateStringCheck(doc, ctx, schema, accessor, buildsValue);
|
|
971
980
|
break;
|
|
972
981
|
case "number":
|
|
973
982
|
typeAccessor = generateNumberCheck(doc, schema, accessor);
|
|
@@ -1079,10 +1088,6 @@ function generateCheck(
|
|
|
1079
1088
|
case "custom":
|
|
1080
1089
|
typeAccessor = generateCustomCheck(doc, ctx, schema, accessor);
|
|
1081
1090
|
break;
|
|
1082
|
-
case "properties":
|
|
1083
|
-
generatePropertiesChecks(doc, ctx, (schema as $ZodProperties)._zod.def, accessor, true);
|
|
1084
|
-
typeAccessor = accessor;
|
|
1085
|
-
break;
|
|
1086
1091
|
case "transform":
|
|
1087
1092
|
typeAccessor = generateTransformCheck(doc, ctx, schema, accessor);
|
|
1088
1093
|
break;
|
|
@@ -1102,13 +1107,19 @@ function generateCheck(
|
|
|
1102
1107
|
return generateChecks(doc, ctx, schema, typeAccessor);
|
|
1103
1108
|
}
|
|
1104
1109
|
|
|
1105
|
-
function generateStringCheck(
|
|
1110
|
+
function generateStringCheck(
|
|
1111
|
+
doc: Doc,
|
|
1112
|
+
ctx: CompileContext,
|
|
1113
|
+
schema: SomeType,
|
|
1114
|
+
accessor: string,
|
|
1115
|
+
needsValue = true
|
|
1116
|
+
): string | null {
|
|
1106
1117
|
doc.write(`if (typeof ${accessor} !== "string") return INVALID;`);
|
|
1107
1118
|
|
|
1108
1119
|
// z.email() carries its format on the def, z.string().email() in def.checks; both route here so the format table has no second copy to drift from.
|
|
1109
1120
|
const def = schema._zod.def as unknown as StringFormatDef & { format?: string };
|
|
1110
1121
|
if (def.format === undefined) return accessor;
|
|
1111
|
-
return generateStringFormatCheck(doc, ctx, def, accessor);
|
|
1122
|
+
return generateStringFormatCheck(doc, ctx, def, accessor, needsValue);
|
|
1112
1123
|
}
|
|
1113
1124
|
|
|
1114
1125
|
function generateNumberCheck(doc: Doc, schema: SomeType, accessor: string): string {
|
|
@@ -79,9 +79,7 @@ export /*@__NO_SIDE_EFFECTS__*/ function $constructor<T extends ZodTrait, D = T[
|
|
|
79
79
|
// Cleared even on throw, so the shared descriptor never leaks one instance's internals into the next.
|
|
80
80
|
_zodDesc.value = undefined;
|
|
81
81
|
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
if (inst._zod.traits.has(name)) {
|
|
82
|
+
} else if (inst._zod.traits.has(name)) {
|
|
85
83
|
return;
|
|
86
84
|
}
|
|
87
85
|
|
|
@@ -16,7 +16,6 @@ import {
|
|
|
16
16
|
finalize,
|
|
17
17
|
handleUnrepresentable,
|
|
18
18
|
initializeContext,
|
|
19
|
-
isTransforming,
|
|
20
19
|
processSchema,
|
|
21
20
|
} from "./to-json-schema.js";
|
|
22
21
|
import { BIGINT_FORMAT_RANGES, NUMBER_FORMAT_RANGES, assignProp, getEnumValues } from "./util.js";
|
|
@@ -450,20 +449,16 @@ export const objectProcessor: Processor<schemas.$ZodObject> = (schema, ctx, _jso
|
|
|
450
449
|
}
|
|
451
450
|
|
|
452
451
|
// required keys
|
|
453
|
-
const
|
|
454
|
-
const
|
|
455
|
-
[
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
return field._zod.optout === undefined;
|
|
461
|
-
}
|
|
462
|
-
})
|
|
463
|
-
);
|
|
452
|
+
const requiredKeys: string[] = [];
|
|
453
|
+
for (const key of Object.keys(shape)) {
|
|
454
|
+
const field = def.shape[key]!;
|
|
455
|
+
if (ctx.io === "input" ? inputOptin(field) === undefined : field._zod.optout === undefined) {
|
|
456
|
+
requiredKeys.push(key);
|
|
457
|
+
}
|
|
458
|
+
}
|
|
464
459
|
|
|
465
|
-
if (requiredKeys.
|
|
466
|
-
json.required =
|
|
460
|
+
if (requiredKeys.length > 0) {
|
|
461
|
+
json.required = requiredKeys;
|
|
467
462
|
}
|
|
468
463
|
|
|
469
464
|
// catchall
|
|
@@ -481,54 +476,6 @@ export const objectProcessor: Processor<schemas.$ZodObject> = (schema, ctx, _jso
|
|
|
481
476
|
}
|
|
482
477
|
};
|
|
483
478
|
|
|
484
|
-
// asserts named properties in place and passes everything else through, so no additionalProperties constraint is emitted
|
|
485
|
-
export const propertiesProcessor: Processor<schemas.$ZodProperties> = (schema, ctx, _json, params) => {
|
|
486
|
-
const json = _json as JSONSchema.ObjectSchema;
|
|
487
|
-
const def = schema._zod.def;
|
|
488
|
-
|
|
489
|
-
// dropping a symbol key silently would emit a schema that asserts less than this one does
|
|
490
|
-
if (
|
|
491
|
-
Object.getOwnPropertySymbols(def.shape).length &&
|
|
492
|
-
handleUnrepresentable(schema, ctx, json, params, "Symbol keys cannot be represented in JSON Schema")
|
|
493
|
-
) {
|
|
494
|
-
return;
|
|
495
|
-
}
|
|
496
|
-
|
|
497
|
-
// the parsed value is the input, so an output-mode emission would describe a transformed value this schema never returns
|
|
498
|
-
if (ctx.io === "output") {
|
|
499
|
-
for (const key in def.shape) {
|
|
500
|
-
if (
|
|
501
|
-
isTransforming(def.shape[key]!) &&
|
|
502
|
-
handleUnrepresentable(
|
|
503
|
-
schema,
|
|
504
|
-
ctx,
|
|
505
|
-
json,
|
|
506
|
-
params,
|
|
507
|
-
`z.properties() returns its input, so the output of a transforming schema at key "${key}" cannot be represented in JSON Schema`
|
|
508
|
-
)
|
|
509
|
-
) {
|
|
510
|
-
return;
|
|
511
|
-
}
|
|
512
|
-
}
|
|
513
|
-
}
|
|
514
|
-
|
|
515
|
-
json.type = "object";
|
|
516
|
-
json.properties = {};
|
|
517
|
-
for (const key in def.shape) {
|
|
518
|
-
assignProp(
|
|
519
|
-
json.properties,
|
|
520
|
-
key,
|
|
521
|
-
processSchema(def.shape[key]!, ctx as any, {
|
|
522
|
-
...params,
|
|
523
|
-
path: [...params.path, "properties", key],
|
|
524
|
-
})
|
|
525
|
-
);
|
|
526
|
-
}
|
|
527
|
-
// input-side optionality in both modes: the parsed value is the input, so a defaulted key that stays absent must not be required of the output either
|
|
528
|
-
const required = Object.keys(def.shape).filter((key) => inputOptin(def.shape[key]!) === undefined);
|
|
529
|
-
if (required.length > 0) json.required = required;
|
|
530
|
-
};
|
|
531
|
-
|
|
532
479
|
export const unionProcessor: Processor<schemas.$ZodUnion> = (schema, ctx, json, params) => {
|
|
533
480
|
const def = schema._zod.def as schemas.$ZodUnionDef;
|
|
534
481
|
// Exclusive unions (inclusive === false) use oneOf (exactly one match) instead of anyOf (one or more matches). This includes both z.xor() and discriminated unions
|
|
@@ -904,7 +851,6 @@ export const allProcessors: Record<string, Processor<any>> = {
|
|
|
904
851
|
file: fileProcessor,
|
|
905
852
|
success: successProcessor,
|
|
906
853
|
custom: customProcessor,
|
|
907
|
-
properties: propertiesProcessor,
|
|
908
854
|
function: functionProcessor,
|
|
909
855
|
transform: transformProcessor,
|
|
910
856
|
map: mapProcessor,
|
|
@@ -28,9 +28,9 @@ type WithState = { [STATE]?: State };
|
|
|
28
28
|
|
|
29
29
|
const NO_ISSUES: errors.$ZodRawIssue[] = [];
|
|
30
30
|
|
|
31
|
-
// a value a cycle can close through
|
|
31
|
+
// a value a cycle can close through
|
|
32
32
|
function isRef(value: unknown): value is object {
|
|
33
|
-
return value !== null &&
|
|
33
|
+
return value !== null && typeof value === "object";
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
// Receivers prefix paths in place, so the cache and every hand-out need their own copies.
|
|
@@ -90,9 +90,6 @@ function isRecursive(inst: $ZodType, stack: Set<object>, resolve: boolean): Answ
|
|
|
90
90
|
check(def.catchall);
|
|
91
91
|
break;
|
|
92
92
|
}
|
|
93
|
-
case "properties":
|
|
94
|
-
merge(shape(def.shape, false));
|
|
95
|
-
break;
|
|
96
93
|
case "array":
|
|
97
94
|
check(def.element);
|
|
98
95
|
break;
|
|
@@ -98,6 +98,10 @@ export const e164: RegExp = /^\+[1-9]\d{6,14}$/;
|
|
|
98
98
|
// Credit card shape: 12–19 digits, optionally separated by single spaces or single hyphens. ISO/IEC 7812 caps the PAN at 19 digits; 12 is the shortest issued length (Maestro).
|
|
99
99
|
export const creditCard: RegExp = /^\d(?:[ -]?\d){11,18}$/;
|
|
100
100
|
|
|
101
|
+
// ISO 4217 alpha codes from the SIX list, regenerated by scripts/update-iso-4217.ts
|
|
102
|
+
export const currencyCode: RegExp =
|
|
103
|
+
/^(?:AED|AFN|ALL|AMD|AOA|ARS|AUD|AWG|AZN|BAM|BBD|BDT|BHD|BIF|BMD|BND|BOB|BOV|BRL|BSD|BTN|BWP|BYN|BZD|CAD|CDF|CHE|CHF|CHW|CLF|CLP|CNY|COP|COU|CRC|CUP|CVE|CZK|DJF|DKK|DOP|DZD|EGP|ERN|ETB|EUR|FJD|FKP|GBP|GEL|GHS|GIP|GMD|GNF|GTQ|GYD|HKD|HNL|HTG|HUF|IDR|ILS|INR|IQD|IRR|ISK|JMD|JOD|JPY|KES|KGS|KHR|KMF|KPW|KRW|KWD|KYD|KZT|LAK|LBP|LKR|LRD|LSL|LYD|MAD|MDL|MGA|MKD|MMK|MNT|MOP|MRU|MUR|MVR|MWK|MXN|MXV|MYR|MZN|NAD|NGN|NIO|NOK|NPR|NZD|OMR|PAB|PEN|PGK|PHP|PKR|PLN|PYG|QAR|RON|RSD|RUB|RWF|SAR|SBD|SCR|SDG|SEK|SGD|SHP|SLE|SOS|SRD|SSP|STN|SVC|SYP|SZL|THB|TJS|TMT|TND|TOP|TRY|TTD|TWD|TZS|UAH|UGX|USD|USN|UYI|UYU|UYW|UZS|VED|VES|VND|VUV|WST|XAD|XAF|XAG|XAU|XBA|XBB|XBC|XBD|XCD|XCG|XDR|XOF|XPD|XPF|XPT|XSU|XTS|XUA|XXX|YER|ZAR|ZMW|ZWG)$/;
|
|
104
|
+
|
|
101
105
|
// iban electronic format: 2-letter country, check digits 02-98 (the only values `98 - remainder` can produce), 11-30 bban characters
|
|
102
106
|
export const iban: RegExp = /^[A-Z]{2}(?!00|01|99)\d{2}[A-Z0-9]{11,30}$/;
|
|
103
107
|
|
|
@@ -96,8 +96,7 @@ export interface $ZodTypeDef {
|
|
|
96
96
|
| "promise"
|
|
97
97
|
| "lazy"
|
|
98
98
|
| "function"
|
|
99
|
-
| "custom"
|
|
100
|
-
| "properties";
|
|
99
|
+
| "custom";
|
|
101
100
|
error?: errors.$ZodErrorMap<never> | undefined;
|
|
102
101
|
checks?: checks.$ZodCheck<never>[];
|
|
103
102
|
}
|
|
@@ -523,10 +522,30 @@ export interface $ZodURL extends $ZodType {
|
|
|
523
522
|
|
|
524
523
|
/** The `://` guard rejected the input before the URL constructor saw it. */
|
|
525
524
|
export const URL_BAD_FORMAT = 1;
|
|
526
|
-
/** The URL
|
|
525
|
+
/** The URL parser rejected the input. */
|
|
527
526
|
export const URL_UNPARSEABLE = 2;
|
|
528
527
|
|
|
529
|
-
|
|
528
|
+
export function canParseURL(input: string): boolean {
|
|
529
|
+
try {
|
|
530
|
+
if (typeof URL !== "undefined" && typeof URL.canParse === "function") return URL.canParse(input);
|
|
531
|
+
new URL(input);
|
|
532
|
+
return true;
|
|
533
|
+
} catch {
|
|
534
|
+
return false;
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
export function validateURL(
|
|
539
|
+
trimmed: string,
|
|
540
|
+
def: Pick<$ZodURLDef, "protocol" | "hostname" | "normalize">
|
|
541
|
+
): URL | true | typeof URL_BAD_FORMAT | typeof URL_UNPARSEABLE {
|
|
542
|
+
if (!("normalize" in def) && !("hostname" in def) && !("protocol" in def)) {
|
|
543
|
+
return canParseURL(trimmed) || URL_UNPARSEABLE;
|
|
544
|
+
}
|
|
545
|
+
return parseURLObject(trimmed, def);
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
/** Parses a URL while preserving the non-normalizing HTTP guard. */
|
|
530
549
|
export function parseURLObject(
|
|
531
550
|
trimmed: string,
|
|
532
551
|
def: Pick<$ZodURLDef, "protocol" | "normalize">
|
|
@@ -537,6 +556,10 @@ export function parseURLObject(
|
|
|
537
556
|
}
|
|
538
557
|
|
|
539
558
|
try {
|
|
559
|
+
if (typeof URL !== "undefined") {
|
|
560
|
+
const URLStatic = URL as typeof URL & { parse?: (input: string) => URL | null };
|
|
561
|
+
if (typeof URLStatic.parse === "function") return URLStatic.parse(trimmed) ?? URL_UNPARSEABLE;
|
|
562
|
+
}
|
|
540
563
|
// @ts-ignore
|
|
541
564
|
return new URL(trimmed);
|
|
542
565
|
} catch {
|
|
@@ -567,7 +590,7 @@ export const $ZodURL: core.$constructor<$ZodURL> = /*@__PURE__*/ core.$construct
|
|
|
567
590
|
try {
|
|
568
591
|
// Trim whitespace from input
|
|
569
592
|
const trimmed = payload.value.trim();
|
|
570
|
-
const url =
|
|
593
|
+
const url = validateURL(trimmed, def);
|
|
571
594
|
|
|
572
595
|
if (url === URL_BAD_FORMAT) {
|
|
573
596
|
payload.issues.push({
|
|
@@ -592,6 +615,11 @@ export const $ZodURL: core.$constructor<$ZodURL> = /*@__PURE__*/ core.$construct
|
|
|
592
615
|
return;
|
|
593
616
|
}
|
|
594
617
|
|
|
618
|
+
if (url === true) {
|
|
619
|
+
payload.value = stripTabAndNewline(trimmed);
|
|
620
|
+
return;
|
|
621
|
+
}
|
|
622
|
+
|
|
595
623
|
if (def.hostname && !urlHostnameOk(url, def.hostname)) {
|
|
596
624
|
payload.issues.push({
|
|
597
625
|
code: "invalid_format",
|
|
@@ -886,13 +914,7 @@ const ipv6Alphabet = /^[0-9a-fA-F:.]+$/;
|
|
|
886
914
|
|
|
887
915
|
export function isValidIPv6(value: string): boolean {
|
|
888
916
|
if (!ipv6Alphabet.test(value)) return false;
|
|
889
|
-
|
|
890
|
-
// @ts-ignore
|
|
891
|
-
new URL(`http://[${value}]`);
|
|
892
|
-
return true;
|
|
893
|
-
} catch {
|
|
894
|
-
return false;
|
|
895
|
-
}
|
|
917
|
+
return canParseURL(`http://[${value}]`);
|
|
896
918
|
}
|
|
897
919
|
|
|
898
920
|
export const $ZodIPv6: core.$constructor<$ZodIPv6> = /*@__PURE__*/ core.$constructor("$ZodIPv6", (inst, def): void => {
|
|
@@ -5096,101 +5118,6 @@ function handleRefineResult(result: unknown, payload: ParsePayload, input: unkno
|
|
|
5096
5118
|
}
|
|
5097
5119
|
}
|
|
5098
5120
|
|
|
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
|
-
|
|
5194
5121
|
export type $ZodTypes =
|
|
5195
5122
|
| $ZodString
|
|
5196
5123
|
| $ZodNumber
|
|
@@ -5223,7 +5150,6 @@ export type $ZodTypes =
|
|
|
5223
5150
|
| $ZodPrefault
|
|
5224
5151
|
| $ZodTemplateLiteral
|
|
5225
5152
|
| $ZodCustom
|
|
5226
|
-
| $ZodProperties
|
|
5227
5153
|
| $ZodTransform
|
|
5228
5154
|
| $ZodNonOptional
|
|
5229
5155
|
| $ZodReadonly
|
|
@@ -5262,4 +5188,5 @@ export type $ZodStringFormatTypes =
|
|
|
5262
5188
|
| $ZodJWT
|
|
5263
5189
|
| $ZodCustomStringFormat<"hex">
|
|
5264
5190
|
| $ZodCustomStringFormat<util.HashFormat>
|
|
5265
|
-
| $ZodCustomStringFormat<"hostname"
|
|
5191
|
+
| $ZodCustomStringFormat<"hostname">
|
|
5192
|
+
| $ZodCustomStringFormat<"currency_code">;
|
|
@@ -677,6 +677,41 @@ test("url options match the runtime across the whole option matrix", () => {
|
|
|
677
677
|
for (const schema of schemas) differential(schema, inputs);
|
|
678
678
|
});
|
|
679
679
|
|
|
680
|
+
test("assert-only URL generation skips unused output without skipping chained transforms", () => {
|
|
681
|
+
const sanitized = "https://example.com";
|
|
682
|
+
const withNewline = "https://exa\nmple.com";
|
|
683
|
+
differential(z.url().length(sanitized.length), [sanitized, withNewline, "https://example.com/long"]);
|
|
684
|
+
differential(z.string().url().length(sanitized.length), [sanitized, withNewline, "https://example.com/long"]);
|
|
685
|
+
|
|
686
|
+
const URLStatic = URL as typeof URL & { parse: (input: string) => URL | null };
|
|
687
|
+
const descriptor = Object.getOwnPropertyDescriptor(URLStatic, "parse")!;
|
|
688
|
+
const marker = new Error("href read");
|
|
689
|
+
Object.defineProperty(URLStatic, "parse", {
|
|
690
|
+
configurable: true,
|
|
691
|
+
value: () =>
|
|
692
|
+
Object.create(URL.prototype, {
|
|
693
|
+
href: {
|
|
694
|
+
get() {
|
|
695
|
+
throw marker;
|
|
696
|
+
},
|
|
697
|
+
},
|
|
698
|
+
}) as URL,
|
|
699
|
+
});
|
|
700
|
+
try {
|
|
701
|
+
const schema = z.url({ normalize: true });
|
|
702
|
+
const parser = compileFn(schema);
|
|
703
|
+
const validator = compileFn(schema, { assertOnly: true });
|
|
704
|
+
expect(validator("https://example.com")).toBe(true);
|
|
705
|
+
expect(z.validate(compile(z.url({ normalize: true })), "https://example.com")).toBe(true);
|
|
706
|
+
expect(z.validate(compile(z.object({ url: z.url({ normalize: true }) })), { url: "https://example.com" })).toBe(
|
|
707
|
+
true
|
|
708
|
+
);
|
|
709
|
+
expect(() => parser("https://example.com")).toThrow(marker);
|
|
710
|
+
} finally {
|
|
711
|
+
Object.defineProperty(URLStatic, "parse", descriptor);
|
|
712
|
+
}
|
|
713
|
+
});
|
|
714
|
+
|
|
680
715
|
test("empty strict object compiles", () => {
|
|
681
716
|
// With no keys the unknown-key condition is empty, and `if () return INVALID;` is a syntax error the single top-level `new Function` rejects — too late for compileChild to island, so the whole tree lost its fast path.
|
|
682
717
|
differential(z.strictObject({}), [{}, { a: 1 }, Object.create({ inherited: 1 })]);
|