@chrona-city/ugc-kit 1.5.12 → 1.6.9
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/.agents/skills/chrona-3d-assets/SKILL.md +15 -0
- package/.agents/skills/chrona-ecs-creator/SKILL.md +17 -0
- package/.agents/skills/chrona-gameplay-js/SKILL.md +19 -0
- package/.agents/skills/chrona-realtime/SKILL.md +23 -0
- package/.agents/skills/chrona-repair/SKILL.md +13 -0
- package/README.md +89 -8
- package/bin/chrona.mjs +6 -2
- package/chrona.contract.lock.json +74 -6
- package/chrona.controlled-presentation.lock.json +8 -8
- package/chrona.core.lock.json +16 -12
- package/chrona.document-presentation.lock.json +52 -0
- package/chrona.ecs.lock.json +3 -3
- package/chrona.gameplay-tests.lock.json +9 -9
- package/chrona.ground-endpoint.lock.json +28 -0
- package/chrona.ground-spaces.lock.json +40 -0
- package/chrona.personal-state.lock.json +28 -0
- package/chrona.pipeline.lock.json +10 -10
- package/chrona.private-state-view.lock.json +2 -2
- package/chrona.private-state.lock.json +2 -2
- package/chrona.registry.lock.json +2 -2
- package/chrona.sandbox.lock.json +11 -7
- package/chrona.scene-interaction-v2.lock.json +28 -0
- package/chrona.world-scene-runtime.lock.json +49 -9
- package/chrona.world-scene.lock.json +9 -5
- package/compiler/local-builder.lock.json +1 -1
- package/compiler/source/contracts/creator/rules/v1/rules.mjs +99 -0
- package/compiler/source/contracts/creator/rules/v1/ugc-rules.json +807 -0
- package/compiler/source/contracts/ugc/authored-motion/v1/declaration.mjs +124 -0
- package/compiler/source/contracts/ugc/core-ecs/v1/core-view.mjs +146 -0
- package/compiler/source/contracts/ugc/core-ecs/v1/limits.json +4 -0
- package/compiler/source/contracts/ugc/document-presentation/v1/document.mjs +148 -27
- package/compiler/source/contracts/ugc/document-presentation/v1/profile-1.1.0.json +25 -0
- package/compiler/source/contracts/ugc/document-presentation/v1/profile-1.2.0.json +25 -0
- package/compiler/source/contracts/ugc/document-presentation/v1/profile-1.3.0.json +26 -0
- package/compiler/source/contracts/ugc/document-presentation/v1/profile-1.5.0.json +25 -0
- package/compiler/source/contracts/ugc/document-presentation/v1/profile-1.6.0.json +26 -0
- package/compiler/source/contracts/ugc/ecs-runtime/v1/private-world.mjs +313 -0
- package/compiler/source/contracts/ugc/live-rule-slot/v1/slot.json +58 -0
- package/compiler/source/contracts/ugc/local-content/v1/document-snapshot.mjs +13 -29
- package/compiler/source/contracts/ugc/local-content/v1/ground-snapshot.mjs +89 -0
- package/compiler/source/contracts/ugc/local-content/v1/snapshot.mjs +49 -6
- package/compiler/source/contracts/ugc/open-creation/v1/custom-actions.mjs +92 -0
- package/compiler/source/contracts/ugc/open-creation/v1/data-authority.mjs +37 -0
- package/compiler/source/contracts/ugc/open-creation/v1/declaration.mjs +28 -0
- package/compiler/source/contracts/ugc/open-creation/v1/dynamic-entities.mjs +186 -0
- package/compiler/source/contracts/ugc/open-creation/v1/open-world.mjs +269 -0
- package/compiler/source/contracts/ugc/pipeline/v1/conformance/js/pipeline-validator.mjs +35 -7
- package/compiler/source/contracts/ugc/private-state/v1/projection.mjs +178 -0
- package/compiler/source/contracts/ugc/registry/v1/resolution-policy.json +3 -3
- package/compiler/source/contracts/ugc/runtime-content/v1/asset-budget.mjs +21 -0
- package/compiler/source/contracts/ugc/runtime-content/v1/limits.json +5 -0
- package/compiler/source/contracts/ugc/runtime-content/v1/validate.mjs +420 -0
- package/compiler/source/contracts/ugc/sandbox/v1/sha256.mjs +47 -0
- package/compiler/source/contracts/ugc/server-entities/v1/entities.mjs +221 -0
- package/compiler/source/contracts/ugc/server-entities/v1/events.mjs +336 -0
- package/compiler/source/contracts/ugc/server-entities/v1/limits.json +112 -0
- package/compiler/source/contracts/ugc/server-entities/v1/roads.mjs +164 -0
- package/compiler/source/contracts/ugc/v1/conformance/js/package-validator.mjs +51 -5
- package/compiler/source/contracts/ugc/v1/host-runnable.mjs +23 -0
- package/compiler/source/contracts/ugc/world-scene/v2/asset-graph.mjs +8 -12
- package/compiler/source/contracts/ugc/world-scene/v2/contract-set.json +1 -0
- package/compiler/source/contracts/ugc/world-scene-runtime/v1/runtime-plan.schema.json +41 -13
- package/compiler/source/contracts/ugc/world-scene-runtime/v1/runtime-policy.mjs +2 -2
- package/compiler/source/contracts/ugc/world-scene-runtime/v2/contract-set.json +10 -0
- package/compiler/source/contracts/ugc/world-scene-runtime/v2/report.mjs +21 -14
- package/compiler/source/contracts/ugc/world-scene-runtime/v2/runtime-policy.mjs +17 -3
- package/compiler/source/services/game-worker/src/runtime/content/flight-runtime.js +2 -1
- package/compiler/source/services/game-worker/src/runtime/rooms/flight-collision.js +55 -30
- package/compiler/source/services/game-worker/src/runtime/rooms/flight-motion.js +99 -0
- package/compiler/source/services/game-worker/src/runtime/rooms/flight-preparation.js +3 -2
- package/compiler/source/services/game-worker/src/runtime/rooms/flight-room-controller.js +130 -24
- package/compiler/source/services/ugc-pipeline/src/asset-inspection.mjs +78 -28
- package/compiler/source/services/ugc-pipeline/src/document-presentation-model.mjs +2 -2
- package/compiler/source/services/ugc-pipeline/src/ground-rules-model.mjs +4 -5
- package/compiler/source/services/ugc-pipeline/src/local-content.mjs +29 -16
- package/compiler/source/services/ugc-pipeline/src/registry-release.mjs +4 -1
- package/compiler/source/services/ugc-pipeline/src/resource-bindings-model.mjs +3 -3
- package/compiler/source/services/ugc-pipeline/src/rules-locks.mjs +18 -0
- package/compiler/source/services/ugc-pipeline/src/scene-interaction-model.mjs +4 -5
- package/compiler/source/services/ugc-pipeline/src/visual-closure-v2.mjs +2 -2
- package/compiler/source/services/ugc-pipeline/src/world-scene-model.mjs +3 -3
- package/compiler/source/services/ugc-pipeline/src/world-scene-policies.json +138 -0
- package/compiler/source/services/ugc-pipeline/src/world-scene-runtime.mjs +4 -3
- package/consistency-vectors.snapshot.lock.json +14 -0
- package/contracts/creator/check/v1/rule-table.json +433 -0
- package/contracts/creator/check/v1/rules/client.json +924 -0
- package/contracts/creator/check/v1/rules/kit.json +1702 -0
- package/contracts/creator/check/v1/rules/platform.json +608 -0
- package/contracts/creator/check/v1/rules/publish.json +2484 -0
- package/contracts/creator/check/v1/rules/room.json +279 -0
- package/contracts/creator/rules/v1/rules.mjs +69 -0
- package/contracts/creator/rules/v1/vectors.json +39 -0
- package/contracts/ecs/realtime/consistency/v1/vectors.json +2437 -0
- package/contracts/errors/registry/v1/codes.json +13255 -0
- package/contracts/gameplay/step-input/step-input.mjs +16 -0
- package/contracts/network/realtime/authored-entity.mjs +67 -0
- package/contracts/network/realtime/revision-selection.mjs +65 -0
- package/contracts/testdata/gameplay-consistency/vectors.json +149 -0
- package/contracts/ugc/authored-motion/v1/declaration.mjs +124 -0
- package/contracts/ugc/core-ecs/v1/core-view.mjs +13 -5
- package/contracts/ugc/core-ecs/v1/limits.json +4 -0
- package/contracts/ugc/creator-source/v1/SOURCE-PACKAGE.md +1 -1
- package/contracts/ugc/creator-source/v1/source-package.mjs +24 -7
- package/contracts/ugc/creator-source/v1/source-package.schema.json +3 -3
- package/contracts/ugc/creator-source/v1/source-package.test.mjs +20 -2
- package/contracts/ugc/document-presentation/v1/document.mjs +148 -27
- package/contracts/ugc/document-presentation/v1/profile-1.1.0.json +25 -0
- package/contracts/ugc/document-presentation/v1/profile-1.2.0.json +25 -0
- package/contracts/ugc/document-presentation/v1/profile-1.3.0.json +26 -0
- package/contracts/ugc/document-presentation/v1/profile-1.5.0.json +25 -0
- package/contracts/ugc/document-presentation/v1/profile-1.6.0.json +26 -0
- package/contracts/ugc/ecs-runtime/v1/private-world.mjs +21 -7
- package/contracts/ugc/live-rule-slot/v1/slot.json +58 -0
- package/contracts/ugc/live-rule-slot/v1/slot.mjs +80 -0
- package/contracts/ugc/local-content/v1/README.md +10 -0
- package/contracts/ugc/local-content/v1/document-snapshot.mjs +13 -29
- package/contracts/ugc/local-content/v1/ground-snapshot.mjs +89 -0
- package/contracts/ugc/local-content/v1/snapshot.mjs +49 -6
- package/contracts/ugc/local-content/v1/spatial-plan.mjs +24 -0
- package/contracts/ugc/open-creation/v1/custom-actions.mjs +92 -0
- package/contracts/ugc/open-creation/v1/data-authority.mjs +37 -0
- package/contracts/ugc/open-creation/v1/declaration.mjs +28 -0
- package/contracts/ugc/open-creation/v1/dynamic-entities.mjs +186 -0
- package/contracts/ugc/open-creation/v1/open-world.mjs +269 -0
- package/contracts/ugc/public-runtime/v1/README.md +13 -1
- package/contracts/ugc/public-runtime/v1/compatibility-rows.test.mjs +79 -0
- package/contracts/ugc/public-runtime/v1/document-runtime.test.mjs +20 -5
- package/contracts/ugc/public-runtime/v1/manifest.mjs +24 -12
- package/contracts/ugc/public-runtime/v1/revision-vectors.test.mjs +49 -0
- package/contracts/ugc/public-runtime/v1/runtime-manifest.schema.json +119 -6
- package/contracts/ugc/runtime-content/v1/asset-budget.mjs +21 -0
- package/contracts/ugc/runtime-content/v1/limits.json +5 -0
- package/contracts/ugc/runtime-content/v1/validate.mjs +420 -0
- package/contracts/ugc/sandbox/v1/conformance/js/sandbox-validator.mjs +85 -6
- package/contracts/ugc/server-entities/v1/entities.mjs +221 -0
- package/contracts/ugc/server-entities/v1/events.mjs +336 -0
- package/contracts/ugc/server-entities/v1/limits.json +112 -0
- package/contracts/ugc/server-entities/v1/roads.mjs +164 -0
- package/contracts/ugc/v1/conformance/js/package-validator.mjs +51 -5
- package/contracts/ugc/v1/host-runnable.mjs +23 -0
- package/contracts/ugc/world-scene-runtime/v1/runtime-policy.mjs +2 -2
- package/contracts/ugc/world-scene-runtime/v2/runtime-policy.mjs +17 -3
- package/creator-check.source-lock.json +40 -0
- package/creator-release.json +1 -1
- package/docs/ai-index.md +193 -0
- package/docs/assets-3d-spec.md +114 -3
- package/docs/audio.md +110 -0
- package/docs/authored-avatars.md +67 -0
- package/docs/authored-entities.md +165 -0
- package/docs/capability-map.json +57 -0
- package/docs/controlled-presentation.md +53 -0
- package/docs/core-ecs.md +46 -0
- package/docs/declaration-generator.md +292 -0
- package/docs/document-presentation.md +14 -0
- package/docs/gameplay-inputs.md +77 -0
- package/docs/gameplay-lifecycle-tests.md +89 -0
- package/docs/ground-rules.md +63 -0
- package/docs/harness-onboarding.md +83 -22
- package/docs/live-rule-slots.md +57 -0
- package/docs/mcp-tools.md +39 -0
- package/docs/meshy.md +17 -4
- package/docs/migrate-1.6.md +63 -0
- package/docs/npm-creator.md +419 -254
- package/docs/open-creation.md +259 -0
- package/docs/player-private-components.md +51 -0
- package/docs/player-saves.md +175 -0
- package/docs/player-visible-state.md +65 -0
- package/docs/playtest.md +223 -0
- package/docs/private-ecs.md +48 -0
- package/docs/private-events.md +82 -0
- package/docs/private-state.md +30 -0
- package/docs/realtime-patterns.md +624 -0
- package/docs/recipes.md +397 -0
- package/docs/reference.md +365 -0
- package/docs/runtime-download.md +22 -5
- package/docs/scene-import.md +132 -0
- package/docs/scene-interactions.md +28 -0
- package/docs/server-entities.md +83 -0
- package/docs/weather.md +77 -0
- package/docs/work-brief.md +71 -0
- package/document-action-result.source-lock.json +8 -4
- package/error-codes.snapshot.lock.json +14 -0
- package/gameplay-consistency.source-lock.json +20 -0
- package/lib/authority-notice.mjs +76 -0
- package/lib/behavior-radius-check.mjs +71 -0
- package/lib/builtin-write.mjs +70 -0
- package/lib/capability-harness.mjs +4 -3
- package/lib/compress-model.mjs +266 -0
- package/lib/creator-agent-live.mjs +3 -0
- package/lib/creator-api.mjs +367 -144
- package/lib/creator-assets-restore.mjs +102 -0
- package/lib/creator-capability-map.mjs +28 -0
- package/lib/creator-check.mjs +338 -0
- package/lib/creator-cli.mjs +940 -119
- package/lib/creator-contribution.mjs +46 -37
- package/lib/creator-docs.mjs +56 -0
- package/lib/creator-entry.mjs +134 -0
- package/lib/creator-fix.mjs +208 -0
- package/lib/creator-init-paths.mjs +22 -13
- package/lib/creator-init.mjs +22 -9
- package/lib/creator-install.mjs +379 -66
- package/lib/creator-installed-platform.mjs +13 -0
- package/lib/creator-intent-rules.mjs +15 -0
- package/lib/creator-intent.mjs +147 -0
- package/lib/creator-issue.mjs +241 -0
- package/lib/creator-mcp.mjs +337 -140
- package/lib/creator-migrate.mjs +194 -0
- package/lib/creator-onboarding.mjs +3 -1
- package/lib/creator-platform.mjs +223 -29
- package/lib/creator-playtest.mjs +398 -0
- package/lib/creator-preview.mjs +80 -0
- package/lib/creator-project-snapshot.mjs +182 -108
- package/lib/creator-project-update.mjs +132 -102
- package/lib/creator-project.mjs +213 -62
- package/lib/creator-provenance.mjs +12 -10
- package/lib/creator-rebundle.mjs +68 -0
- package/lib/creator-rules.mjs +76 -0
- package/lib/creator-session.mjs +128 -25
- package/lib/creator-source-package.mjs +2 -2
- package/lib/creator-submit.mjs +252 -101
- package/lib/creator-toolchain-compat.mjs +476 -3
- package/lib/creator-upgrade.mjs +58 -33
- package/lib/creator-upload-state.mjs +61 -6
- package/lib/creator-workspace-guide.mjs +79 -0
- package/lib/declaration-generator.mjs +609 -0
- package/lib/declaration-problems.mjs +108 -0
- package/lib/document-action-result.mjs +7 -4
- package/lib/document-prechecks.mjs +633 -0
- package/lib/document-presentation.mjs +47 -15
- package/lib/document-refresh.mjs +46 -0
- package/lib/ecs-access.mjs +179 -0
- package/lib/failure-messages.mjs +42 -0
- package/lib/gameplay-imports.mjs +34 -0
- package/lib/host-consistency.mjs +74 -0
- package/lib/host-ipc/distribution-static-room-semantic-contract/contracts/ugc/public-runtime/v1/manifest.mjs +24 -12
- package/lib/host-ipc/distribution-static-room-semantic-contract/contracts/ugc/public-runtime/v1/runtime-manifest.schema.json +119 -6
- package/lib/host-ipc/host-ipc.schema.json +80 -0
- package/lib/host-ipc/runtime-contract.mjs +2 -0
- package/lib/host-ipc/source-lock.json +5 -5
- package/lib/host-runnable-scope.mjs +19 -0
- package/lib/legacy-patterns.mjs +705 -0
- package/lib/live-baseline-shape.mjs +30 -0
- package/lib/live-baseline.mjs +108 -0
- package/lib/live-rule-check.mjs +96 -0
- package/lib/local-builder.mjs +20 -5
- package/lib/local-content.mjs +6 -4
- package/lib/local-development.mjs +96 -24
- package/lib/local-room.mjs +12 -0
- package/lib/meshy-api.mjs +57 -1
- package/lib/meshy-cli.mjs +23 -0
- package/lib/meshy-store.mjs +34 -11
- package/lib/movement-authority.mjs +24 -0
- package/lib/platform-discovery.mjs +61 -0
- package/lib/platform-limits.mjs +6 -0
- package/lib/playtest-browser.mjs +121 -0
- package/lib/playtest-compare.mjs +42 -0
- package/lib/playtest-page.mjs +372 -0
- package/lib/playtest-vehicle.mjs +234 -0
- package/lib/presentation-project-update.mjs +126 -4
- package/lib/private-ecs-harness.mjs +39 -17
- package/lib/private-event-harness.mjs +3 -5
- package/lib/project-validation.mjs +852 -167
- package/lib/publish-prechecks.mjs +28 -0
- package/lib/relay-notice.mjs +13 -0
- package/lib/rule-fuzz.mjs +45 -0
- package/lib/rule-pack.mjs +150 -0
- package/lib/rule-selection.mjs +130 -0
- package/lib/rule-tests-child.mjs +40 -0
- package/lib/rule-tests-sandbox.mjs +75 -0
- package/lib/runtime-content.mjs +49 -0
- package/lib/runtime-download.mjs +94 -31
- package/lib/runtime-host-client.mjs +30 -12
- package/lib/runtime-host.mjs +7 -10
- package/lib/runtime-install.mjs +46 -6
- package/lib/runtime-prechecks.mjs +133 -0
- package/lib/runtime-proxy-fetch.mjs +117 -0
- package/lib/runtime-snapshot.mjs +20 -20
- package/lib/runtime-source.mjs +30 -14
- package/lib/sandbox-projection/v1/room-state-projection.mjs +116 -0
- package/lib/scene-assets.mjs +5 -5
- package/lib/scene-import-profiles.mjs +8 -0
- package/lib/scene-import.mjs +737 -0
- package/lib/server-entities-check.mjs +160 -0
- package/lib/toolchain-history.json +602 -0
- package/lib/vendor/mcp.mjs +33787 -0
- package/lib/vendor/smol-toml.mjs +744 -0
- package/lib/writable-by-others.mjs +8 -0
- package/live-rule-slot.source-lock.json +20 -0
- package/llms.txt +43 -0
- package/local-builder.snapshot.lock.json +3 -3
- package/local-content.snapshot.lock.json +112 -8
- package/node_modules/pngjs/CHANGELOG.md +128 -0
- package/package.json +251 -23
- package/public-runtime.snapshot.lock.json +13 -9
- package/realtime-revision.source-lock.json +20 -0
- package/runtime-catalog.json +16 -16
- package/sandbox-projection.source-lock.json +15 -0
- package/sdk/client/index.js +3 -2
- package/source-package.snapshot.lock.json +5 -5
- package/templates/document-presentation/README.md +5 -0
- package/templates/document-presentation/assets.js +36 -10
- package/templates/document-presentation/authority.js +25 -7
- package/templates/document-presentation/live-view.js +100 -0
- package/templates/document-presentation/local-first.js +45 -0
- package/templates/document-presentation/motion.js +2 -0
- package/templates/document-presentation/ready-gate.js +37 -0
- package/templates/document-presentation/state-view.js +26 -0
- package/templates/document-presentation/weather-blend.js +57 -0
- package/templates/document-presentation/weather-particles.js +192 -0
- package/templates/document-presentation/wet-ripples.js +61 -0
- package/templates/examples/coin-rush/README.md +5 -0
- package/templates/examples/coin-rush/chrona.generate.json +63 -0
- package/templates/examples/coin-rush/content/assets/runtime/arena.gltf +399 -0
- package/templates/examples/coin-rush/content/assets/runtime/runner.gltf +197 -0
- package/templates/examples/coin-rush/content/bindings/resources.json +19 -0
- package/templates/examples/coin-rush/content/gameplay/client/presentation.js +44 -0
- package/templates/examples/coin-rush/content/gameplay/shared/rules.js +49 -0
- package/templates/examples/coin-rush/content/manifest.json +100 -0
- package/templates/examples/coin-rush/content/provenance.json +20 -0
- package/templates/examples/coin-rush/content/rules/ground.json +45 -0
- package/templates/examples/coin-rush/content/tests/budgets.json +5 -0
- package/templates/examples/coin-rush/content/tests/rules.json +16 -0
- package/templates/examples/open-creation/README.md +5 -0
- package/templates/examples/open-creation/chrona.generate.json +55 -0
- package/templates/examples/open-creation/content/assets/runtime/arena.gltf +399 -0
- package/templates/examples/open-creation/content/assets/runtime/runner.gltf +197 -0
- package/templates/examples/open-creation/content/bindings/resources.json +19 -0
- package/templates/examples/open-creation/content/gameplay/client/presentation.js +33 -0
- package/templates/examples/open-creation/content/gameplay/shared/rules.js +29 -0
- package/templates/examples/open-creation/content/manifest.json +100 -0
- package/templates/examples/open-creation/content/provenance.json +20 -0
- package/templates/examples/open-creation/content/rules/ground.json +45 -0
- package/templates/examples/open-creation/content/tests/budgets.json +5 -0
- package/templates/examples/open-creation/content/tests/rules.json +16 -0
- package/templates/live-rule-slot/score-slot.js +16 -0
- package/templates/npm-project/AGENTS.md +101 -4
- package/templates/npm-project/preview.command +7 -0
- package/templates/npm-project/preview.ps1 +6 -0
- package/templates/npm-project/scripts/install-kit.mjs +70 -0
- package/templates/npm-project/setup.command +3 -0
- package/templates/npm-project/setup.ps1 +14 -0
- package/templates/npm-project/setup.sh +11 -0
- package/templates/public-untrusted/content/gameplay/client/local-first.js +45 -0
- package/templates/public-untrusted/content/gameplay/client/smoothing.js +83 -0
- package/templates/public-untrusted/content/manifest.json +2 -1
- package/templates/public-untrusted/content/tests/scenarios.json +20 -2
- package/contracts/ugc/capability-wiring/v1/capability-proposal.schema.json +0 -82
- package/contracts/ugc/capability-wiring/v1/conformance/js/wiring-validator.mjs +0 -95
- package/contracts/ugc/capability-wiring/v1/conformance/web/index.html +0 -5
- package/contracts/ugc/capability-wiring/v1/conformance/web/runner.mjs +0 -32
- package/contracts/ugc/capability-wiring/v1/contract-set.json +0 -8
- package/contracts/ugc/capability-wiring/v1/error-codes.json +0 -15
- package/contracts/ugc/capability-wiring/v1/needs-capability.schema.json +0 -18
- package/contracts/ugc/capability-wiring/v1/testdata/vectors.json +0 -128
- package/contracts/ugc/capability-wiring/v1/wiring-release.schema.json +0 -66
- package/contracts/ugc/controlled-presentation/v1/README.md +0 -175
- package/contracts/ugc/controlled-presentation/v1/approval.schema.json +0 -53
- package/contracts/ugc/controlled-presentation/v1/command.schema.json +0 -243
- package/contracts/ugc/controlled-presentation/v1/conformance/run-vectors.mjs +0 -39
- package/contracts/ugc/controlled-presentation/v1/conformance/run-view-vectors.mjs +0 -54
- package/contracts/ugc/controlled-presentation/v1/conformance/web/index.html +0 -1
- package/contracts/ugc/controlled-presentation/v1/conformance/web/runner.mjs +0 -4
- package/contracts/ugc/controlled-presentation/v1/conformance/web/view-runner.mjs +0 -5
- package/contracts/ugc/controlled-presentation/v1/conformance/web/view.html +0 -1
- package/contracts/ugc/controlled-presentation/v1/context.schema.json +0 -19
- package/contracts/ugc/controlled-presentation/v1/contract-set.json +0 -33
- package/contracts/ugc/controlled-presentation/v1/export-view.mjs +0 -44
- package/contracts/ugc/controlled-presentation/v1/grant.schema.json +0 -120
- package/contracts/ugc/controlled-presentation/v1/presentation.mjs +0 -180
- package/contracts/ugc/controlled-presentation/v1/testdata/vectors.json +0 -565
- package/contracts/ugc/controlled-presentation/v1/view.mjs +0 -46
- package/contracts/ugc/controlled-presentation/v1/view.schema.json +0 -90
- package/contracts/ugc/core-ecs/v1/README.md +0 -13
- package/contracts/ugc/core-ecs/v1/api.json +0 -28
- package/contracts/ugc/core-ecs/v1/conformance/run-vectors.mjs +0 -33
- package/contracts/ugc/core-ecs/v1/conformance/web/index.html +0 -1
- package/contracts/ugc/core-ecs/v1/conformance/web/runner.mjs +0 -4
- package/contracts/ugc/core-ecs/v1/test-fixture.schema.json +0 -169
- package/contracts/ugc/core-ecs/v1/testdata/vectors.json +0 -57
- package/contracts/ugc/document-presentation/v1/README.md +0 -167
- package/contracts/ugc/document-presentation/v1/contract-set.json +0 -18
- package/contracts/ugc/document-presentation/v1/document.schema.json +0 -161
- package/contracts/ugc/document-presentation/v1/document.test.mjs +0 -138
- package/contracts/ugc/document-presentation/v1/source.schema.json +0 -88
- package/contracts/ugc/ecs-runtime/v1/README.md +0 -25
- package/contracts/ugc/ecs-runtime/v1/api.json +0 -46
- package/contracts/ugc/ecs-runtime/v1/conformance/run-vectors.mjs +0 -41
- package/contracts/ugc/ecs-runtime/v1/conformance/web/index.html +0 -3
- package/contracts/ugc/ecs-runtime/v1/conformance/web/runner.mjs +0 -5
- package/contracts/ugc/ecs-runtime/v1/testdata/vectors.json +0 -1318
- package/contracts/ugc/gameplay-tests/v1/README.md +0 -78
- package/contracts/ugc/gameplay-tests/v1/cases.mjs +0 -70
- package/contracts/ugc/gameplay-tests/v1/cases.schema.json +0 -262
- package/contracts/ugc/gameplay-tests/v1/conformance/run-vectors.mjs +0 -21
- package/contracts/ugc/gameplay-tests/v1/conformance/web/index.html +0 -1
- package/contracts/ugc/gameplay-tests/v1/conformance/web/runner.mjs +0 -4
- package/contracts/ugc/gameplay-tests/v1/contract-set.json +0 -9
- package/contracts/ugc/gameplay-tests/v1/scene-step.mjs +0 -49
- package/contracts/ugc/gameplay-tests/v1/testdata/vectors.json +0 -1504
- package/contracts/ugc/ground-rules/v1/README.md +0 -44
- package/contracts/ugc/ground-rules/v1/conformance/run-vectors.mjs +0 -31
- package/contracts/ugc/ground-rules/v1/conformance/web/index.html +0 -1
- package/contracts/ugc/ground-rules/v1/conformance/web/runner.mjs +0 -4
- package/contracts/ugc/ground-rules/v1/contract-set.json +0 -9
- package/contracts/ugc/ground-rules/v1/effective-ground-rules.schema.json +0 -27
- package/contracts/ugc/ground-rules/v1/ground-rules.schema.json +0 -33
- package/contracts/ugc/ground-rules/v1/testdata/vectors.json +0 -57
- package/contracts/ugc/ground-rules/v2/README.md +0 -88
- package/contracts/ugc/ground-rules/v2/contract-set.json +0 -20
- package/contracts/ugc/ground-rules/v2/ground-rules.schema.json +0 -373
- package/contracts/ugc/ground-rules/v2/spaces.test.mjs +0 -58
- package/contracts/ugc/ground-rules/v2/spatial-source.schema.json +0 -788
- package/contracts/ugc/ground-rules/v2/spatial.test.mjs +0 -142
- package/contracts/ugc/ground-rules/v2.2/README.md +0 -73
- package/contracts/ugc/ground-rules/v2.2/center-band.test.mjs +0 -149
- package/contracts/ugc/ground-rules/v2.2/contract-set.json +0 -8
- package/contracts/ugc/ground-rules/v2.2/spatial-source.schema.json +0 -1049
- package/contracts/ugc/personal-state/v1/README.md +0 -181
- package/contracts/ugc/personal-state/v1/declaration.schema.json +0 -295
- package/contracts/ugc/personal-state/v1/declaration.test.mjs +0 -26
- package/contracts/ugc/personal-state/v1/marker.schema.json +0 -9
- package/contracts/ugc/personal-state/v1/node-plan.test.mjs +0 -65
- package/contracts/ugc/pipeline/v1/PLATFORM-SOURCE.md +0 -54
- package/contracts/ugc/pipeline/v1/PRESENTATION.md +0 -13
- package/contracts/ugc/pipeline/v1/build-record.schema.json +0 -93
- package/contracts/ugc/pipeline/v1/conformance/js/pipeline-validator.mjs +0 -196
- package/contracts/ugc/pipeline/v1/conformance/js/platform-release-validator.mjs +0 -78
- package/contracts/ugc/pipeline/v1/conformance/web/index.html +0 -5
- package/contracts/ugc/pipeline/v1/conformance/web/runner.mjs +0 -30
- package/contracts/ugc/pipeline/v1/contract-set.json +0 -30
- package/contracts/ugc/pipeline/v1/error-codes.json +0 -95
- package/contracts/ugc/pipeline/v1/platform-publication-binding.schema.json +0 -56
- package/contracts/ugc/pipeline/v1/public-release-descriptor.schema.json +0 -264
- package/contracts/ugc/pipeline/v1/publication-operation.schema.json +0 -97
- package/contracts/ugc/pipeline/v1/release-index.schema.json +0 -192
- package/contracts/ugc/pipeline/v1/review-decision.schema.json +0 -212
- package/contracts/ugc/pipeline/v1/submission-receipt.schema.json +0 -15
- package/contracts/ugc/pipeline/v1/testdata/vectors.json +0 -1713
- package/contracts/ugc/private-event-view/v1/README.md +0 -83
- package/contracts/ugc/private-event-view/v1/conformance/run-vectors.mjs +0 -65
- package/contracts/ugc/private-event-view/v1/conformance/web/index.html +0 -1
- package/contracts/ugc/private-event-view/v1/conformance/web/runner.mjs +0 -5
- package/contracts/ugc/private-event-view/v1/contract-set.json +0 -9
- package/contracts/ugc/private-event-view/v1/export.mjs +0 -22
- package/contracts/ugc/private-event-view/v1/testdata/vectors.json +0 -22
- package/contracts/ugc/private-event-view/v1/view.mjs +0 -130
- package/contracts/ugc/private-event-view/v1/view.schema.json +0 -204
- package/contracts/ugc/private-events/v1/README.md +0 -102
- package/contracts/ugc/private-events/v1/conformance/run-vectors.mjs +0 -52
- package/contracts/ugc/private-events/v1/conformance/web/index.html +0 -1
- package/contracts/ugc/private-events/v1/conformance/web/runner.mjs +0 -4
- package/contracts/ugc/private-events/v1/contract-set.json +0 -9
- package/contracts/ugc/private-events/v1/events.schema.json +0 -19
- package/contracts/ugc/private-events/v1/grant.schema.json +0 -15
- package/contracts/ugc/private-events/v1/output.schema.json +0 -15
- package/contracts/ugc/private-events/v1/testdata/vectors.json +0 -55
- package/contracts/ugc/private-state/v1/README.md +0 -95
- package/contracts/ugc/private-state/v1/conformance/run-vectors.mjs +0 -40
- package/contracts/ugc/private-state/v1/conformance/web/index.html +0 -1
- package/contracts/ugc/private-state/v1/conformance/web/runner.mjs +0 -4
- package/contracts/ugc/private-state/v1/contract-set.json +0 -9
- package/contracts/ugc/private-state/v1/field-table.schema.json +0 -136
- package/contracts/ugc/private-state/v1/projection.schema.json +0 -515
- package/contracts/ugc/private-state/v1/testdata/vectors.json +0 -76
- package/contracts/ugc/private-state-view/v1/README.md +0 -91
- package/contracts/ugc/private-state-view/v1/conformance/run-vectors.mjs +0 -52
- package/contracts/ugc/private-state-view/v1/conformance/web/index.html +0 -1
- package/contracts/ugc/private-state-view/v1/conformance/web/runner.mjs +0 -5
- package/contracts/ugc/private-state-view/v1/contract-set.json +0 -24
- package/contracts/ugc/private-state-view/v1/export.mjs +0 -29
- package/contracts/ugc/private-state-view/v1/publication.schema.json +0 -82
- package/contracts/ugc/private-state-view/v1/testdata/vectors.json +0 -21
- package/contracts/ugc/private-state-view/v1/view.mjs +0 -199
- package/contracts/ugc/private-state-view/v1/view.schema.json +0 -255
- package/contracts/ugc/public-runtime/v1/static-room-runtime.test.mjs +0 -225
- package/contracts/ugc/registry/v1/capabilities-lock.schema.json +0 -110
- package/contracts/ugc/registry/v1/capability-query-result.schema.json +0 -33
- package/contracts/ugc/registry/v1/capability-query.schema.json +0 -14
- package/contracts/ugc/registry/v1/capability-registry.schema.json +0 -83
- package/contracts/ugc/registry/v1/conformance/web/index.html +0 -5
- package/contracts/ugc/registry/v1/conformance/web/runner.mjs +0 -68
- package/contracts/ugc/registry/v1/contract-set.json +0 -23
- package/contracts/ugc/registry/v1/effective-budgets.schema.json +0 -34
- package/contracts/ugc/registry/v1/error-codes.json +0 -11
- package/contracts/ugc/registry/v1/network-profile-lock.schema.json +0 -26
- package/contracts/ugc/registry/v1/registry.json +0 -1
- package/contracts/ugc/registry/v1/resolution-policy.json +0 -70
- package/contracts/ugc/registry/v1/resolution-result.schema.json +0 -49
- package/contracts/ugc/registry/v1/testdata/vectors.json +0 -405
- package/contracts/ugc/resource-bindings/v1/AUTHORED-AVATAR.md +0 -133
- package/contracts/ugc/resource-bindings/v1/README.md +0 -61
- package/contracts/ugc/resource-bindings/v1/authored-avatar.schema.json +0 -48
- package/contracts/ugc/resource-bindings/v1/bindings.schema.json +0 -45
- package/contracts/ugc/resource-bindings/v1/conformance/authored-avatar-vectors.mjs +0 -26
- package/contracts/ugc/resource-bindings/v1/conformance/run-vectors.mjs +0 -32
- package/contracts/ugc/resource-bindings/v1/conformance/web/index.html +0 -1
- package/contracts/ugc/resource-bindings/v1/conformance/web/runner.mjs +0 -13
- package/contracts/ugc/resource-bindings/v1/contract-set.json +0 -9
- package/contracts/ugc/resource-bindings/v1/testdata/authored-avatar-vectors.json +0 -146
- package/contracts/ugc/resource-bindings/v1/testdata/authored-avatar.json +0 -13
- package/contracts/ugc/resource-bindings/v1/testdata/vectors.json +0 -68
- package/contracts/ugc/sandbox/v1/conformance/web/index.html +0 -5
- package/contracts/ugc/sandbox/v1/conformance/web/runner.mjs +0 -26
- package/contracts/ugc/sandbox/v1/contract-set.json +0 -19
- package/contracts/ugc/sandbox/v1/error-codes.json +0 -25
- package/contracts/ugc/sandbox/v1/execution-result.schema.json +0 -80
- package/contracts/ugc/sandbox/v1/launch-request.schema.json +0 -96
- package/contracts/ugc/sandbox/v1/lifecycle-message.schema.json +0 -18
- package/contracts/ugc/sandbox/v1/local-launch-request.schema.json +0 -34
- package/contracts/ugc/sandbox/v1/private-ecs-grant.schema.json +0 -32
- package/contracts/ugc/sandbox/v1/sandbox-profile.schema.json +0 -70
- package/contracts/ugc/sandbox/v1/testdata/vectors.json +0 -89
- package/contracts/ugc/scene-interaction/v1/README.md +0 -63
- package/contracts/ugc/scene-interaction/v1/conformance/run-vectors.mjs +0 -26
- package/contracts/ugc/scene-interaction/v1/conformance/web/index.html +0 -1
- package/contracts/ugc/scene-interaction/v1/conformance/web/runner.mjs +0 -4
- package/contracts/ugc/scene-interaction/v1/contract-set.json +0 -26
- package/contracts/ugc/scene-interaction/v1/effective-targets.schema.json +0 -76
- package/contracts/ugc/scene-interaction/v1/request.schema.json +0 -30
- package/contracts/ugc/scene-interaction/v1/result.schema.json +0 -88
- package/contracts/ugc/scene-interaction/v1/targets.schema.json +0 -49
- package/contracts/ugc/scene-interaction/v1/testdata/vectors.json +0 -732
- package/contracts/ugc/scene-interaction/v2/README.md +0 -63
- package/contracts/ugc/scene-interaction/v2/contract-set.json +0 -19
- package/contracts/ugc/scene-interaction/v2/metric.test.mjs +0 -99
- package/contracts/ugc/scene-interaction/v2/targets.schema.json +0 -229
- package/contracts/ugc/scene-presentation/v1/INK-MATH.md +0 -64
- package/contracts/ugc/scene-presentation/v1/README.md +0 -126
- package/contracts/ugc/scene-presentation/v1/RENDER-POLICY.md +0 -63
- package/contracts/ugc/scene-presentation/v1/conformance/ink-vectors.mjs +0 -34
- package/contracts/ugc/scene-presentation/v1/conformance/render-policy-vectors.mjs +0 -62
- package/contracts/ugc/scene-presentation/v1/conformance/vectors.mjs +0 -128
- package/contracts/ugc/scene-presentation/v1/contract-set.json +0 -6
- package/contracts/ugc/scene-presentation/v1/ink-math.mjs +0 -70
- package/contracts/ugc/scene-presentation/v1/render-policy.schema.json +0 -27
- package/contracts/ugc/scene-presentation/v1/scene.schema.json +0 -66
- package/contracts/ugc/v1/COVER.md +0 -38
- package/contracts/ugc/v1/SCENE-PROVENANCE.md +0 -54
- package/contracts/ugc/v1/candidate-submission.schema.json +0 -16
- package/contracts/ugc/v1/capability-request.schema.json +0 -29
- package/contracts/ugc/v1/compatibility.json +0 -32
- package/contracts/ugc/v1/components.schema.json +0 -77
- package/contracts/ugc/v1/conformance/js/capability-operations.mjs +0 -13
- package/contracts/ugc/v1/conformance/js/scene-provenance.mjs +0 -121
- package/contracts/ugc/v1/conformance/js/source-validator.mjs +0 -99
- package/contracts/ugc/v1/conformance/web/index.html +0 -5
- package/contracts/ugc/v1/conformance/web/runner.mjs +0 -82
- package/contracts/ugc/v1/contract-set.json +0 -38
- package/contracts/ugc/v1/creator-sdk.json +0 -84
- package/contracts/ugc/v1/error-codes.json +0 -53
- package/contracts/ugc/v1/manifest.schema.json +0 -215
- package/contracts/ugc/v1/network-intent.schema.json +0 -15
- package/contracts/ugc/v1/prefabs.schema.json +0 -29
- package/contracts/ugc/v1/provenance.schema.json +0 -160
- package/contracts/ugc/v1/scene.schema.json +0 -37
- package/contracts/ugc/v1/testdata/capability-operation-vectors.json +0 -243
- package/contracts/ugc/v1/testdata/cover-vectors.json +0 -25
- package/contracts/ugc/v1/testdata/invalid/authored-avatar-missing-capability.json +0 -44
- package/contracts/ugc/v1/testdata/invalid/authored-avatar-wrong-capability.json +0 -51
- package/contracts/ugc/v1/testdata/invalid/budget-overflow.json +0 -1
- package/contracts/ugc/v1/testdata/invalid/build-field-override.json +0 -1
- package/contracts/ugc/v1/testdata/invalid/creator-server-entrypoint.json +0 -5
- package/contracts/ugc/v1/testdata/invalid/forbidden-network-control.json +0 -1
- package/contracts/ugc/v1/testdata/invalid/ground-authority.json +0 -57
- package/contracts/ugc/v1/testdata/invalid/ground-budget.json +0 -56
- package/contracts/ugc/v1/testdata/invalid/ground-dependency.json +0 -49
- package/contracts/ugc/v1/testdata/invalid/ground-identity.json +0 -56
- package/contracts/ugc/v1/testdata/invalid/ground-missing.json +0 -13
- package/contracts/ugc/v1/testdata/invalid/ground-optional.json +0 -60
- package/contracts/ugc/v1/testdata/invalid/ground-path.json +0 -56
- package/contracts/ugc/v1/testdata/invalid/ground-run-dependency.json +0 -56
- package/contracts/ugc/v1/testdata/invalid/ground-version.json +0 -56
- package/contracts/ugc/v1/testdata/invalid/missing-required-field.json +0 -1
- package/contracts/ugc/v1/testdata/invalid/missing-shared-entrypoint.json +0 -5
- package/contracts/ugc/v1/testdata/invalid/path-escape.json +0 -1
- package/contracts/ugc/v1/testdata/invalid/private-events-authority.json +0 -35
- package/contracts/ugc/v1/testdata/invalid/private-events-budget.json +0 -35
- package/contracts/ugc/v1/testdata/invalid/private-events-dependency.json +0 -27
- package/contracts/ugc/v1/testdata/invalid/private-events-empty.json +0 -20
- package/contracts/ugc/v1/testdata/invalid/private-events-identity.json +0 -34
- package/contracts/ugc/v1/testdata/invalid/private-events-missing.json +0 -13
- package/contracts/ugc/v1/testdata/invalid/private-events-optional.json +0 -38
- package/contracts/ugc/v1/testdata/invalid/private-events-path.json +0 -34
- package/contracts/ugc/v1/testdata/invalid/private-events-type.json +0 -34
- package/contracts/ugc/v1/testdata/invalid/private-events-unknown-ref.json +0 -34
- package/contracts/ugc/v1/testdata/invalid/private-events-version.json +0 -34
- package/contracts/ugc/v1/testdata/invalid/resource-bindings-identity.json +0 -18
- package/contracts/ugc/v1/testdata/invalid/resource-bindings-kind.json +0 -19
- package/contracts/ugc/v1/testdata/invalid/resource-bindings-missing.json +0 -6
- package/contracts/ugc/v1/testdata/invalid/resource-bindings-path.json +0 -6
- package/contracts/ugc/v1/testdata/invalid/resource-bindings-type.json +0 -8
- package/contracts/ugc/v1/testdata/invalid/resource-bindings-unknown.json +0 -18
- package/contracts/ugc/v1/testdata/invalid/scene-interactions-authority.json +0 -61
- package/contracts/ugc/v1/testdata/invalid/scene-interactions-core-unknown.json +0 -61
- package/contracts/ugc/v1/testdata/invalid/scene-interactions-dependency.json +0 -53
- package/contracts/ugc/v1/testdata/invalid/scene-interactions-identity.json +0 -60
- package/contracts/ugc/v1/testdata/invalid/scene-interactions-missing-transform.json +0 -50
- package/contracts/ugc/v1/testdata/invalid/scene-interactions-missing.json +0 -49
- package/contracts/ugc/v1/testdata/invalid/scene-interactions-optional.json +0 -64
- package/contracts/ugc/v1/testdata/invalid/scene-interactions-partial-transform.json +0 -59
- package/contracts/ugc/v1/testdata/invalid/scene-interactions-path.json +0 -60
- package/contracts/ugc/v1/testdata/invalid/scene-interactions-radius.json +0 -60
- package/contracts/ugc/v1/testdata/invalid/scene-interactions-unknown-target.json +0 -60
- package/contracts/ugc/v1/testdata/invalid/scene-interactions-version.json +0 -60
- package/contracts/ugc/v1/testdata/invalid/scene-presentation-authority.json +0 -166
- package/contracts/ugc/v1/testdata/invalid/scene-presentation-capability.json +0 -158
- package/contracts/ugc/v1/testdata/invalid/scene-presentation-identity.json +0 -165
- package/contracts/ugc/v1/testdata/invalid/scene-presentation-missing.json +0 -13
- package/contracts/ugc/v1/testdata/invalid/scene-presentation-optional.json +0 -169
- package/contracts/ugc/v1/testdata/invalid/scene-presentation-path.json +0 -165
- package/contracts/ugc/v1/testdata/invalid/scene-presentation-undeclared.json +0 -163
- package/contracts/ugc/v1/testdata/invalid/scene-presentation-unknown-material.json +0 -165
- package/contracts/ugc/v1/testdata/invalid/schema-incompatible.json +0 -1
- package/contracts/ugc/v1/testdata/invalid/unknown-required-component.json +0 -1
- package/contracts/ugc/v1/testdata/invalid/world-scene-dual-motion.json +0 -7
- package/contracts/ugc/v1/testdata/invalid/world-scene-identity.json +0 -90
- package/contracts/ugc/v1/testdata/invalid/world-scene-missing-capability.json +0 -85
- package/contracts/ugc/v1/testdata/invalid/world-scene-missing.json +0 -28
- package/contracts/ugc/v1/testdata/invalid/world-scene-optional-capability.json +0 -94
- package/contracts/ugc/v1/testdata/invalid/world-scene-path.json +0 -6
- package/contracts/ugc/v1/testdata/invalid/world-scene-version.json +0 -90
- package/contracts/ugc/v1/testdata/scene-provenance-vectors.json +0 -56
- package/contracts/ugc/v1/testdata/source-vectors.json +0 -83
- package/contracts/ugc/v1/testdata/valid/authored-avatar.json +0 -51
- package/contracts/ugc/v1/testdata/valid/boundary.json +0 -1
- package/contracts/ugc/v1/testdata/valid/components.json +0 -15
- package/contracts/ugc/v1/testdata/valid/cosmetic.json +0 -9
- package/contracts/ugc/v1/testdata/valid/ground-rules.json +0 -56
- package/contracts/ugc/v1/testdata/valid/minimal.json +0 -15
- package/contracts/ugc/v1/testdata/valid/prefabs.json +0 -11
- package/contracts/ugc/v1/testdata/valid/private-events.json +0 -34
- package/contracts/ugc/v1/testdata/valid/resource-bindings.json +0 -18
- package/contracts/ugc/v1/testdata/valid/scene-interactions.json +0 -60
- package/contracts/ugc/v1/testdata/valid/scene-presentation.json +0 -165
- package/contracts/ugc/v1/testdata/valid/scene.json +0 -6
- package/contracts/ugc/v1/testdata/valid/unknown-optional-component.json +0 -1
- package/contracts/ugc/v1/testdata/valid/world-scene.json +0 -90
- package/contracts/ugc/v1/testdata/vectors.json +0 -555
- package/contracts/ugc/v1/validation-report.schema.json +0 -61
- package/contracts/ugc/world-scene/v1/collision-identity.mjs +0 -73
- package/contracts/ugc/world-scene/v1/collision-target.schema.json +0 -18
- package/contracts/ugc/world-scene/v1/conformance/flight-avatar-vectors.mjs +0 -27
- package/contracts/ugc/world-scene/v1/conformance/run-vectors.mjs +0 -29
- package/contracts/ugc/world-scene/v1/coordinates.schema.json +0 -16
- package/contracts/ugc/world-scene/v1/flight-avatar-actions.mjs +0 -3
- package/contracts/ugc/world-scene/v1/flight-avatar-sample.schema.json +0 -14
- package/contracts/ugc/world-scene/v1/scene-declaration.schema.json +0 -40
- package/contracts/ugc/world-scene/v1/testdata/flight-avatar-actions.json +0 -48
- package/contracts/ugc/world-scene/v1/testdata/scene-declaration-vectors.json +0 -103
- package/contracts/ugc/world-scene/v1/testdata/vectors.json +0 -55
- package/contracts/ugc/world-scene/v1/visual-tileset.mjs +0 -112
- package/contracts/ugc/world-scene/v1/visual-tileset.schema.json +0 -35
- package/contracts/ugc/world-scene/v2/ASSET-GRAPH.md +0 -13
- package/contracts/ugc/world-scene/v2/ENCODED-RESOURCES.md +0 -117
- package/contracts/ugc/world-scene/v2/PARTITION.md +0 -59
- package/contracts/ugc/world-scene/v2/VISUAL-TILESET.md +0 -80
- package/contracts/ugc/world-scene/v2/asset-graph.mjs +0 -169
- package/contracts/ugc/world-scene/v2/collision-index.schema.json +0 -29
- package/contracts/ugc/world-scene/v2/collision-partition.schema.json +0 -37
- package/contracts/ugc/world-scene/v2/conformance/asset-graph-vectors.mjs +0 -52
- package/contracts/ugc/world-scene/v2/conformance/collision-index-vectors.mjs +0 -29
- package/contracts/ugc/world-scene/v2/conformance/encoded-resource-vectors.mjs +0 -17
- package/contracts/ugc/world-scene/v2/conformance/partition-vectors.mjs +0 -74
- package/contracts/ugc/world-scene/v2/conformance/visual-vectors.mjs +0 -24
- package/contracts/ugc/world-scene/v2/contract-set.json +0 -50
- package/contracts/ugc/world-scene/v2/encoded-resource.schema.json +0 -17
- package/contracts/ugc/world-scene/v2/scene-declaration.schema.json +0 -21
- package/contracts/ugc/world-scene/v2/testdata/asset-graph-vectors.json +0 -3354
- package/contracts/ugc/world-scene/v2/testdata/collision-index-vectors.json +0 -103
- package/contracts/ugc/world-scene/v2/testdata/encoded-resource-vectors.json +0 -372
- package/contracts/ugc/world-scene/v2/testdata/visual-vectors.json +0 -43
- package/contracts/ugc/world-scene/v2/vendor/pako-raw-inflate.provenance.json +0 -43
- package/contracts/ugc/world-scene/v2/visual-tileset.mjs +0 -107
- package/contracts/ugc/world-scene/v2/visual-tileset.schema.json +0 -33
- package/contracts/ugc/world-scene-runtime/v1/runtime-plan.schema.json +0 -660
- package/contracts/ugc/world-scene-runtime/v1/testdata/policy-vectors.json +0 -40
- package/contracts/ugc/world-scene-runtime/v2/COLLISION-CAPACITY.md +0 -74
- package/contracts/ugc/world-scene-runtime/v2/REPORT.md +0 -91
- package/contracts/ugc/world-scene-runtime/v2/RUNTIME-PROJECTION.md +0 -110
- package/contracts/ugc/world-scene-runtime/v2/VISUAL-WORK.md +0 -72
- package/contracts/ugc/world-scene-runtime/v2/collision-capacity.schema.json +0 -62
- package/contracts/ugc/world-scene-runtime/v2/conformance/capacity-vectors.mjs +0 -25
- package/contracts/ugc/world-scene-runtime/v2/conformance/report-vectors.mjs +0 -141
- package/contracts/ugc/world-scene-runtime/v2/conformance/runtime-vectors.mjs +0 -41
- package/contracts/ugc/world-scene-runtime/v2/conformance/visual-work-vectors.mjs +0 -21
- package/contracts/ugc/world-scene-runtime/v2/contract-set.json +0 -45
- package/contracts/ugc/world-scene-runtime/v2/report.mjs +0 -184
- package/contracts/ugc/world-scene-runtime/v2/runtime-plan.schema.json +0 -38
- package/contracts/ugc/world-scene-runtime/v2/testdata/capacity-vectors.json +0 -30
- package/contracts/ugc/world-scene-runtime/v2/testdata/report-fixture.json +0 -250
- package/contracts/ugc/world-scene-runtime/v2/testdata/runtime-vectors.json +0 -39
- package/contracts/ugc/world-scene-runtime/v2/testdata/visual-work-vectors.json +0 -28
- package/contracts/ugc/world-scene-runtime/v2/visual-work-policy.mjs +0 -59
- package/document-presentation.snapshot.lock.json +0 -40
- package/ground-endpoint.snapshot.lock.json +0 -36
- package/ground-spaces.snapshot.lock.json +0 -57
- package/lib/creator-source-archive.mjs +0 -182
- package/node_modules/@esbuild/darwin-arm64/README.md +0 -3
- package/node_modules/@esbuild/darwin-arm64/bin/esbuild +0 -0
- package/node_modules/@esbuild/darwin-arm64/package.json +0 -20
- package/node_modules/@esbuild/darwin-x64/README.md +0 -3
- package/node_modules/@esbuild/darwin-x64/bin/esbuild +0 -0
- package/node_modules/@esbuild/darwin-x64/package.json +0 -20
- package/node_modules/@esbuild/linux-arm64/README.md +0 -3
- package/node_modules/@esbuild/linux-arm64/bin/esbuild +0 -0
- package/node_modules/@esbuild/linux-arm64/package.json +0 -20
- package/node_modules/@esbuild/linux-x64/README.md +0 -3
- package/node_modules/@esbuild/linux-x64/bin/esbuild +0 -0
- package/node_modules/@esbuild/linux-x64/package.json +0 -20
- package/node_modules/@modelcontextprotocol/core/LICENSE +0 -216
- package/node_modules/@modelcontextprotocol/core/README.md +0 -40
- package/node_modules/@modelcontextprotocol/core/dist/auth-BWdKR39I.d.mts +0 -8501
- package/node_modules/@modelcontextprotocol/core/dist/auth-BWdKR39I.d.mts.map +0 -1
- package/node_modules/@modelcontextprotocol/core/dist/auth-CUe6YdwF.mjs +0 -1678
- package/node_modules/@modelcontextprotocol/core/dist/auth-CUe6YdwF.mjs.map +0 -1
- package/node_modules/@modelcontextprotocol/core/dist/auth-CfDMXiII.cjs +0 -2899
- package/node_modules/@modelcontextprotocol/core/dist/auth-CfDMXiII.cjs.map +0 -1
- package/node_modules/@modelcontextprotocol/core/dist/auth-hYtaIUZm.d.cts +0 -8501
- package/node_modules/@modelcontextprotocol/core/dist/auth-hYtaIUZm.d.cts.map +0 -1
- package/node_modules/@modelcontextprotocol/core/dist/index.cjs +0 -175
- package/node_modules/@modelcontextprotocol/core/dist/index.d.cts +0 -2
- package/node_modules/@modelcontextprotocol/core/dist/index.d.mts +0 -2
- package/node_modules/@modelcontextprotocol/core/dist/index.mjs +0 -3
- package/node_modules/@modelcontextprotocol/core/dist/internal.cjs +0 -201
- package/node_modules/@modelcontextprotocol/core/dist/internal.d.cts +0 -99
- package/node_modules/@modelcontextprotocol/core/dist/internal.d.cts.map +0 -1
- package/node_modules/@modelcontextprotocol/core/dist/internal.d.mts +0 -99
- package/node_modules/@modelcontextprotocol/core/dist/internal.d.mts.map +0 -1
- package/node_modules/@modelcontextprotocol/core/dist/internal.mjs +0 -3
- package/node_modules/@modelcontextprotocol/core/package.json +0 -85
- package/node_modules/@modelcontextprotocol/server/LICENSE +0 -216
- package/node_modules/@modelcontextprotocol/server/README.md +0 -30
- package/node_modules/@modelcontextprotocol/server/dist/ajvProvider-CEoC__sr.mjs +0 -7514
- package/node_modules/@modelcontextprotocol/server/dist/ajvProvider-CEoC__sr.mjs.map +0 -1
- package/node_modules/@modelcontextprotocol/server/dist/ajvProvider-CgI-5L6O.d.mts +0 -1071
- package/node_modules/@modelcontextprotocol/server/dist/ajvProvider-CgI-5L6O.d.mts.map +0 -1
- package/node_modules/@modelcontextprotocol/server/dist/ajvProvider-FOQRM7up.d.cts +0 -1071
- package/node_modules/@modelcontextprotocol/server/dist/ajvProvider-FOQRM7up.d.cts.map +0 -1
- package/node_modules/@modelcontextprotocol/server/dist/ajvProvider-ZaoO9afR.cjs +0 -7531
- package/node_modules/@modelcontextprotocol/server/dist/ajvProvider-ZaoO9afR.cjs.map +0 -1
- package/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-BwbPzsdI.cjs +0 -986
- package/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-BwbPzsdI.cjs.map +0 -1
- package/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-C03CSigr.d.mts +0 -74
- package/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-C03CSigr.d.mts.map +0 -1
- package/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-doTkZbTr.d.cts +0 -74
- package/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-doTkZbTr.d.cts.map +0 -1
- package/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-p3WaZPqB.mjs +0 -981
- package/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-p3WaZPqB.mjs.map +0 -1
- package/node_modules/@modelcontextprotocol/server/dist/chunk-Bnu9O96Y.cjs +0 -60
- package/node_modules/@modelcontextprotocol/server/dist/chunk-Br0eD_fh.mjs +0 -42
- package/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-CLhGwQTn.d.mts +0 -4043
- package/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-CLhGwQTn.d.mts.map +0 -1
- package/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-dBHMsxwf.d.cts +0 -4045
- package/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-dBHMsxwf.d.cts.map +0 -1
- package/node_modules/@modelcontextprotocol/server/dist/dialects-D8eXzoGv.cjs +0 -46
- package/node_modules/@modelcontextprotocol/server/dist/dialects-D8eXzoGv.cjs.map +0 -1
- package/node_modules/@modelcontextprotocol/server/dist/dialects-DoSzNhcb.mjs +0 -34
- package/node_modules/@modelcontextprotocol/server/dist/dialects-DoSzNhcb.mjs.map +0 -1
- package/node_modules/@modelcontextprotocol/server/dist/index.cjs +0 -2055
- package/node_modules/@modelcontextprotocol/server/dist/index.cjs.map +0 -1
- package/node_modules/@modelcontextprotocol/server/dist/index.d.cts +0 -739
- package/node_modules/@modelcontextprotocol/server/dist/index.d.cts.map +0 -1
- package/node_modules/@modelcontextprotocol/server/dist/index.d.mts +0 -739
- package/node_modules/@modelcontextprotocol/server/dist/index.d.mts.map +0 -1
- package/node_modules/@modelcontextprotocol/server/dist/index.mjs +0 -1870
- package/node_modules/@modelcontextprotocol/server/dist/index.mjs.map +0 -1
- package/node_modules/@modelcontextprotocol/server/dist/mcp-D7GmuPnv.cjs +0 -2022
- package/node_modules/@modelcontextprotocol/server/dist/mcp-D7GmuPnv.cjs.map +0 -1
- package/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs +0 -1931
- package/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs.map +0 -1
- package/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.cjs +0 -23
- package/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.cjs.map +0 -1
- package/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.d.cts +0 -11
- package/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.d.cts.map +0 -1
- package/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.d.mts +0 -11
- package/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.d.mts.map +0 -1
- package/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.mjs +0 -22
- package/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.mjs.map +0 -1
- package/node_modules/@modelcontextprotocol/server/dist/shimsNode.cjs +0 -12
- package/node_modules/@modelcontextprotocol/server/dist/shimsNode.d.cts +0 -3
- package/node_modules/@modelcontextprotocol/server/dist/shimsNode.d.mts +0 -3
- package/node_modules/@modelcontextprotocol/server/dist/shimsNode.mjs +0 -4
- package/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.cjs +0 -30
- package/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.cjs.map +0 -1
- package/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.d.cts +0 -10
- package/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.d.cts.map +0 -1
- package/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.d.mts +0 -10
- package/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.d.mts.map +0 -1
- package/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.mjs +0 -29
- package/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.mjs.map +0 -1
- package/node_modules/@modelcontextprotocol/server/dist/src-CX2iR2pK.mjs +0 -7606
- package/node_modules/@modelcontextprotocol/server/dist/src-CX2iR2pK.mjs.map +0 -1
- package/node_modules/@modelcontextprotocol/server/dist/src-STyD_Vvf.cjs +0 -8104
- package/node_modules/@modelcontextprotocol/server/dist/src-STyD_Vvf.cjs.map +0 -1
- package/node_modules/@modelcontextprotocol/server/dist/stdio.cjs +0 -564
- package/node_modules/@modelcontextprotocol/server/dist/stdio.cjs.map +0 -1
- package/node_modules/@modelcontextprotocol/server/dist/stdio.d.cts +0 -107
- package/node_modules/@modelcontextprotocol/server/dist/stdio.d.cts.map +0 -1
- package/node_modules/@modelcontextprotocol/server/dist/stdio.d.mts +0 -107
- package/node_modules/@modelcontextprotocol/server/dist/stdio.d.mts.map +0 -1
- package/node_modules/@modelcontextprotocol/server/dist/stdio.mjs +0 -562
- package/node_modules/@modelcontextprotocol/server/dist/stdio.mjs.map +0 -1
- package/node_modules/@modelcontextprotocol/server/dist/types-DUs7mGBv.d.mts +0 -1099
- package/node_modules/@modelcontextprotocol/server/dist/types-DUs7mGBv.d.mts.map +0 -1
- package/node_modules/@modelcontextprotocol/server/dist/types-DsbMXNFL.d.cts +0 -1099
- package/node_modules/@modelcontextprotocol/server/dist/types-DsbMXNFL.d.cts.map +0 -1
- package/node_modules/@modelcontextprotocol/server/dist/validators/ajv.cjs +0 -5
- package/node_modules/@modelcontextprotocol/server/dist/validators/ajv.d.cts +0 -2
- package/node_modules/@modelcontextprotocol/server/dist/validators/ajv.d.mts +0 -2
- package/node_modules/@modelcontextprotocol/server/dist/validators/ajv.mjs +0 -3
- package/node_modules/@modelcontextprotocol/server/dist/validators/cfWorker.cjs +0 -3
- package/node_modules/@modelcontextprotocol/server/dist/validators/cfWorker.d.cts +0 -2
- package/node_modules/@modelcontextprotocol/server/dist/validators/cfWorker.d.mts +0 -2
- package/node_modules/@modelcontextprotocol/server/dist/validators/cfWorker.mjs +0 -3
- package/node_modules/@modelcontextprotocol/server/package.json +0 -160
- package/node_modules/esbuild/LICENSE.md +0 -21
- package/node_modules/esbuild/README.md +0 -3
- package/node_modules/esbuild/bin/esbuild +0 -223
- package/node_modules/esbuild/install.js +0 -289
- package/node_modules/esbuild/lib/main.d.ts +0 -716
- package/node_modules/esbuild/lib/main.js +0 -2242
- package/node_modules/esbuild/package.json +0 -49
- package/node_modules/smol-toml/LICENSE +0 -24
- package/node_modules/smol-toml/README.md +0 -236
- package/node_modules/smol-toml/dist/date.d.ts +0 -41
- package/node_modules/smol-toml/dist/date.js +0 -127
- package/node_modules/smol-toml/dist/error.d.ts +0 -38
- package/node_modules/smol-toml/dist/error.js +0 -63
- package/node_modules/smol-toml/dist/extract.d.ts +0 -30
- package/node_modules/smol-toml/dist/extract.js +0 -109
- package/node_modules/smol-toml/dist/index.cjs +0 -906
- package/node_modules/smol-toml/dist/index.d.ts +0 -43
- package/node_modules/smol-toml/dist/index.js +0 -33
- package/node_modules/smol-toml/dist/parse.d.ts +0 -37
- package/node_modules/smol-toml/dist/parse.js +0 -148
- package/node_modules/smol-toml/dist/primitive.d.ts +0 -31
- package/node_modules/smol-toml/dist/primitive.js +0 -178
- package/node_modules/smol-toml/dist/stringify.d.ts +0 -31
- package/node_modules/smol-toml/dist/stringify.js +0 -163
- package/node_modules/smol-toml/dist/struct.d.ts +0 -32
- package/node_modules/smol-toml/dist/struct.js +0 -194
- package/node_modules/smol-toml/dist/util.d.ts +0 -42
- package/node_modules/smol-toml/dist/util.js +0 -106
- package/node_modules/smol-toml/package.json +0 -54
- package/node_modules/zod/LICENSE +0 -21
- package/node_modules/zod/README.md +0 -218
- package/node_modules/zod/compile.cjs +0 -77
- package/node_modules/zod/compile.d.cts +0 -1
- package/node_modules/zod/compile.d.ts +0 -1
- package/node_modules/zod/compile.js +0 -52
- package/node_modules/zod/index.cjs +0 -33
- package/node_modules/zod/index.d.cts +0 -3
- package/node_modules/zod/index.d.ts +0 -3
- package/node_modules/zod/index.js +0 -7
- package/node_modules/zod/locales/index.cjs +0 -17
- package/node_modules/zod/locales/index.d.cts +0 -1
- package/node_modules/zod/locales/index.d.ts +0 -1
- package/node_modules/zod/locales/index.js +0 -1
- package/node_modules/zod/locales/package.json +0 -7
- package/node_modules/zod/mini/index.cjs +0 -32
- package/node_modules/zod/mini/index.d.cts +0 -3
- package/node_modules/zod/mini/index.d.ts +0 -3
- package/node_modules/zod/mini/index.js +0 -3
- package/node_modules/zod/mini/package.json +0 -7
- package/node_modules/zod/package.json +0 -146
- package/node_modules/zod/src/compile.ts +0 -56
- package/node_modules/zod/src/index.ts +0 -7
- package/node_modules/zod/src/locales/index.ts +0 -1
- package/node_modules/zod/src/mini/index.ts +0 -3
- package/node_modules/zod/src/v3/ZodError.ts +0 -340
- package/node_modules/zod/src/v3/benchmarks/datetime.ts +0 -58
- package/node_modules/zod/src/v3/benchmarks/discriminatedUnion.ts +0 -80
- package/node_modules/zod/src/v3/benchmarks/index.ts +0 -59
- package/node_modules/zod/src/v3/benchmarks/ipv4.ts +0 -57
- package/node_modules/zod/src/v3/benchmarks/object.ts +0 -69
- package/node_modules/zod/src/v3/benchmarks/primitives.ts +0 -162
- package/node_modules/zod/src/v3/benchmarks/realworld.ts +0 -63
- package/node_modules/zod/src/v3/benchmarks/string.ts +0 -55
- package/node_modules/zod/src/v3/benchmarks/union.ts +0 -80
- package/node_modules/zod/src/v3/errors.ts +0 -13
- package/node_modules/zod/src/v3/external.ts +0 -6
- package/node_modules/zod/src/v3/helpers/enumUtil.ts +0 -17
- package/node_modules/zod/src/v3/helpers/errorUtil.ts +0 -8
- package/node_modules/zod/src/v3/helpers/parseUtil.ts +0 -176
- package/node_modules/zod/src/v3/helpers/partialUtil.ts +0 -34
- package/node_modules/zod/src/v3/helpers/typeAliases.ts +0 -2
- package/node_modules/zod/src/v3/helpers/util.ts +0 -224
- package/node_modules/zod/src/v3/index.ts +0 -4
- package/node_modules/zod/src/v3/locales/en.ts +0 -124
- package/node_modules/zod/src/v3/standard-schema.ts +0 -113
- package/node_modules/zod/src/v3/tests/Mocker.ts +0 -54
- package/node_modules/zod/src/v3/tests/all-errors.test.ts +0 -157
- package/node_modules/zod/src/v3/tests/anyunknown.test.ts +0 -28
- package/node_modules/zod/src/v3/tests/array.test.ts +0 -71
- package/node_modules/zod/src/v3/tests/async-parsing.test.ts +0 -388
- package/node_modules/zod/src/v3/tests/async-refinements.test.ts +0 -46
- package/node_modules/zod/src/v3/tests/base.test.ts +0 -29
- package/node_modules/zod/src/v3/tests/bigint.test.ts +0 -55
- package/node_modules/zod/src/v3/tests/branded.test.ts +0 -53
- package/node_modules/zod/src/v3/tests/catch.test.ts +0 -220
- package/node_modules/zod/src/v3/tests/coerce.test.ts +0 -133
- package/node_modules/zod/src/v3/tests/complex.test.ts +0 -70
- package/node_modules/zod/src/v3/tests/custom.test.ts +0 -31
- package/node_modules/zod/src/v3/tests/date.test.ts +0 -32
- package/node_modules/zod/src/v3/tests/deepmasking.test.ts +0 -186
- package/node_modules/zod/src/v3/tests/default.test.ts +0 -112
- package/node_modules/zod/src/v3/tests/description.test.ts +0 -33
- package/node_modules/zod/src/v3/tests/discriminated-unions.test.ts +0 -315
- package/node_modules/zod/src/v3/tests/enum.test.ts +0 -80
- package/node_modules/zod/src/v3/tests/error.test.ts +0 -586
- package/node_modules/zod/src/v3/tests/firstparty.test.ts +0 -87
- package/node_modules/zod/src/v3/tests/firstpartyschematypes.test.ts +0 -21
- package/node_modules/zod/src/v3/tests/function.test.ts +0 -261
- package/node_modules/zod/src/v3/tests/generics.test.ts +0 -48
- package/node_modules/zod/src/v3/tests/instanceof.test.ts +0 -37
- package/node_modules/zod/src/v3/tests/intersection.test.ts +0 -128
- package/node_modules/zod/src/v3/tests/language-server.source.ts +0 -76
- package/node_modules/zod/src/v3/tests/language-server.test.ts +0 -206
- package/node_modules/zod/src/v3/tests/literal.test.ts +0 -36
- package/node_modules/zod/src/v3/tests/map.test.ts +0 -110
- package/node_modules/zod/src/v3/tests/masking.test.ts +0 -4
- package/node_modules/zod/src/v3/tests/mocker.test.ts +0 -19
- package/node_modules/zod/src/v3/tests/nan.test.ts +0 -24
- package/node_modules/zod/src/v3/tests/nativeEnum.test.ts +0 -87
- package/node_modules/zod/src/v3/tests/nullable.test.ts +0 -42
- package/node_modules/zod/src/v3/tests/number.test.ts +0 -176
- package/node_modules/zod/src/v3/tests/object-augmentation.test.ts +0 -29
- package/node_modules/zod/src/v3/tests/object-in-es5-env.test.ts +0 -29
- package/node_modules/zod/src/v3/tests/object.test.ts +0 -431
- package/node_modules/zod/src/v3/tests/optional.test.ts +0 -42
- package/node_modules/zod/src/v3/tests/parseUtil.test.ts +0 -23
- package/node_modules/zod/src/v3/tests/parser.test.ts +0 -41
- package/node_modules/zod/src/v3/tests/partials.test.ts +0 -243
- package/node_modules/zod/src/v3/tests/pickomit.test.ts +0 -111
- package/node_modules/zod/src/v3/tests/pipeline.test.ts +0 -29
- package/node_modules/zod/src/v3/tests/preprocess.test.ts +0 -186
- package/node_modules/zod/src/v3/tests/primitive.test.ts +0 -440
- package/node_modules/zod/src/v3/tests/promise.test.ts +0 -90
- package/node_modules/zod/src/v3/tests/readonly.test.ts +0 -114
- package/node_modules/zod/src/v3/tests/record.test.ts +0 -171
- package/node_modules/zod/src/v3/tests/recursive.test.ts +0 -197
- package/node_modules/zod/src/v3/tests/refine.test.ts +0 -313
- package/node_modules/zod/src/v3/tests/safeparse.test.ts +0 -27
- package/node_modules/zod/src/v3/tests/set.test.ts +0 -142
- package/node_modules/zod/src/v3/tests/standard-schema.test.ts +0 -83
- package/node_modules/zod/src/v3/tests/string.test.ts +0 -922
- package/node_modules/zod/src/v3/tests/transformer.test.ts +0 -233
- package/node_modules/zod/src/v3/tests/tuple.test.ts +0 -90
- package/node_modules/zod/src/v3/tests/unions.test.ts +0 -57
- package/node_modules/zod/src/v3/tests/validations.test.ts +0 -133
- package/node_modules/zod/src/v3/tests/void.test.ts +0 -15
- package/node_modules/zod/src/v3/types.ts +0 -5138
- package/node_modules/zod/src/v4/classic/checks.ts +0 -33
- package/node_modules/zod/src/v4/classic/coerce.ts +0 -27
- package/node_modules/zod/src/v4/classic/compat.ts +0 -78
- package/node_modules/zod/src/v4/classic/deep-partial.ts +0 -76
- package/node_modules/zod/src/v4/classic/errors.ts +0 -97
- package/node_modules/zod/src/v4/classic/external.ts +0 -55
- package/node_modules/zod/src/v4/classic/from-json-schema.ts +0 -721
- package/node_modules/zod/src/v4/classic/in-out.ts +0 -45
- package/node_modules/zod/src/v4/classic/index.ts +0 -5
- package/node_modules/zod/src/v4/classic/iso.ts +0 -20
- package/node_modules/zod/src/v4/classic/parse.ts +0 -88
- package/node_modules/zod/src/v4/classic/schemas.ts +0 -2862
- package/node_modules/zod/src/v4/classic/tests/anyunknown.test.ts +0 -26
- package/node_modules/zod/src/v4/classic/tests/apply.test.ts +0 -86
- package/node_modules/zod/src/v4/classic/tests/array.test.ts +0 -264
- package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +0 -351
- package/node_modules/zod/src/v4/classic/tests/async-parsing.test.ts +0 -381
- package/node_modules/zod/src/v4/classic/tests/async-refinements.test.ts +0 -68
- package/node_modules/zod/src/v4/classic/tests/base.test.ts +0 -7
- package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +0 -83
- package/node_modules/zod/src/v4/classic/tests/brand.test.ts +0 -106
- package/node_modules/zod/src/v4/classic/tests/catch.test.ts +0 -604
- package/node_modules/zod/src/v4/classic/tests/coalesce.test.ts +0 -20
- package/node_modules/zod/src/v4/classic/tests/codec-examples.test.ts +0 -572
- package/node_modules/zod/src/v4/classic/tests/codec.test.ts +0 -704
- package/node_modules/zod/src/v4/classic/tests/coerce.test.ts +0 -160
- package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +0 -374
- package/node_modules/zod/src/v4/classic/tests/credit-card.test.ts +0 -76
- package/node_modules/zod/src/v4/classic/tests/custom.test.ts +0 -40
- package/node_modules/zod/src/v4/classic/tests/cyclic-data.test.ts +0 -720
- package/node_modules/zod/src/v4/classic/tests/date.test.ts +0 -92
- package/node_modules/zod/src/v4/classic/tests/datetime.test.ts +0 -316
- package/node_modules/zod/src/v4/classic/tests/deep-partial.test.ts +0 -380
- package/node_modules/zod/src/v4/classic/tests/default-locale.test.ts +0 -32
- package/node_modules/zod/src/v4/classic/tests/default.test.ts +0 -455
- package/node_modules/zod/src/v4/classic/tests/describe-meta-checks.test.ts +0 -27
- package/node_modules/zod/src/v4/classic/tests/description.test.ts +0 -32
- package/node_modules/zod/src/v4/classic/tests/detached-methods.test.ts +0 -221
- package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +0 -836
- package/node_modules/zod/src/v4/classic/tests/enum.test.ts +0 -296
- package/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +0 -917
- package/node_modules/zod/src/v4/classic/tests/error.test.ts +0 -979
- package/node_modules/zod/src/v4/classic/tests/file.test.ts +0 -96
- package/node_modules/zod/src/v4/classic/tests/firstparty.test.ts +0 -179
- package/node_modules/zod/src/v4/classic/tests/fix-json-issue.test.ts +0 -26
- package/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +0 -1310
- package/node_modules/zod/src/v4/classic/tests/function.test.ts +0 -391
- package/node_modules/zod/src/v4/classic/tests/generics.test.ts +0 -72
- package/node_modules/zod/src/v4/classic/tests/global-config.test.ts +0 -32
- package/node_modules/zod/src/v4/classic/tests/hash.test.ts +0 -67
- package/node_modules/zod/src/v4/classic/tests/in-out.test.ts +0 -159
- package/node_modules/zod/src/v4/classic/tests/index.test.ts +0 -958
- package/node_modules/zod/src/v4/classic/tests/instance-footprint.test.ts +0 -281
- package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +0 -107
- package/node_modules/zod/src/v4/classic/tests/intersection.test.ts +0 -334
- package/node_modules/zod/src/v4/classic/tests/issue-schema.test.ts +0 -183
- package/node_modules/zod/src/v4/classic/tests/jitless-allows-eval.test.ts +0 -39
- package/node_modules/zod/src/v4/classic/tests/json.test.ts +0 -109
- package/node_modules/zod/src/v4/classic/tests/lazy.test.ts +0 -262
- package/node_modules/zod/src/v4/classic/tests/literal.test.ts +0 -128
- package/node_modules/zod/src/v4/classic/tests/locales_ka.test.ts +0 -29
- package/node_modules/zod/src/v4/classic/tests/locales_ro.test.ts +0 -24
- package/node_modules/zod/src/v4/classic/tests/map.test.ts +0 -342
- package/node_modules/zod/src/v4/classic/tests/nan.test.ts +0 -21
- package/node_modules/zod/src/v4/classic/tests/nested-refine.test.ts +0 -168
- package/node_modules/zod/src/v4/classic/tests/nonoptional.test.ts +0 -101
- package/node_modules/zod/src/v4/classic/tests/nullable.test.ts +0 -22
- package/node_modules/zod/src/v4/classic/tests/number.test.ts +0 -362
- package/node_modules/zod/src/v4/classic/tests/object.test.ts +0 -950
- package/node_modules/zod/src/v4/classic/tests/optin-ladder.test.ts +0 -234
- package/node_modules/zod/src/v4/classic/tests/optional.test.ts +0 -366
- package/node_modules/zod/src/v4/classic/tests/partial.test.ts +0 -497
- package/node_modules/zod/src/v4/classic/tests/pickomit.test.ts +0 -211
- package/node_modules/zod/src/v4/classic/tests/pipe.test.ts +0 -101
- package/node_modules/zod/src/v4/classic/tests/prefault.test.ts +0 -74
- package/node_modules/zod/src/v4/classic/tests/preprocess-types.test.ts +0 -44
- package/node_modules/zod/src/v4/classic/tests/preprocess.test.ts +0 -351
- package/node_modules/zod/src/v4/classic/tests/primitive.test.ts +0 -175
- package/node_modules/zod/src/v4/classic/tests/promise.test.ts +0 -81
- package/node_modules/zod/src/v4/classic/tests/prototypes.test.ts +0 -23
- package/node_modules/zod/src/v4/classic/tests/readonly.test.ts +0 -184
- package/node_modules/zod/src/v4/classic/tests/record.test.ts +0 -885
- package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +0 -662
- package/node_modules/zod/src/v4/classic/tests/redos.test.ts +0 -68
- package/node_modules/zod/src/v4/classic/tests/refine.test.ts +0 -693
- package/node_modules/zod/src/v4/classic/tests/registries.test.ts +0 -243
- package/node_modules/zod/src/v4/classic/tests/set.test.ts +0 -190
- package/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +0 -134
- package/node_modules/zod/src/v4/classic/tests/string-formats.test.ts +0 -125
- package/node_modules/zod/src/v4/classic/tests/string.test.ts +0 -1346
- package/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +0 -124
- package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +0 -780
- package/node_modules/zod/src/v4/classic/tests/to-json-schema-methods.test.ts +0 -438
- package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +0 -4537
- package/node_modules/zod/src/v4/classic/tests/transform.test.ts +0 -378
- package/node_modules/zod/src/v4/classic/tests/tuple.test.ts +0 -511
- package/node_modules/zod/src/v4/classic/tests/union.test.ts +0 -310
- package/node_modules/zod/src/v4/classic/tests/url.test.ts +0 -13
- package/node_modules/zod/src/v4/classic/tests/validate.test.ts +0 -76
- package/node_modules/zod/src/v4/classic/tests/validations.test.ts +0 -283
- package/node_modules/zod/src/v4/classic/tests/void.test.ts +0 -12
- package/node_modules/zod/src/v4/core/api.ts +0 -1859
- package/node_modules/zod/src/v4/core/checks.ts +0 -1306
- package/node_modules/zod/src/v4/core/compile.ts +0 -2188
- package/node_modules/zod/src/v4/core/core.ts +0 -232
- package/node_modules/zod/src/v4/core/doc.ts +0 -48
- package/node_modules/zod/src/v4/core/errors.ts +0 -546
- package/node_modules/zod/src/v4/core/index.ts +0 -19
- package/node_modules/zod/src/v4/core/json-schema-generator.ts +0 -131
- package/node_modules/zod/src/v4/core/json-schema-processors.ts +0 -830
- package/node_modules/zod/src/v4/core/json-schema.ts +0 -148
- package/node_modules/zod/src/v4/core/memoizer.ts +0 -284
- package/node_modules/zod/src/v4/core/parse.ts +0 -288
- package/node_modules/zod/src/v4/core/regexes.ts +0 -207
- package/node_modules/zod/src/v4/core/registries.ts +0 -105
- package/node_modules/zod/src/v4/core/schemas.ts +0 -5028
- package/node_modules/zod/src/v4/core/standard-schema.ts +0 -159
- package/node_modules/zod/src/v4/core/tests/compile-differential.test.ts +0 -969
- package/node_modules/zod/src/v4/core/tests/compile-global.test.ts +0 -89
- package/node_modules/zod/src/v4/core/tests/compile-off-by-default.test.ts +0 -26
- package/node_modules/zod/src/v4/core/tests/compile-stats.test.ts +0 -34
- package/node_modules/zod/src/v4/core/tests/compile.test.ts +0 -1639
- package/node_modules/zod/src/v4/core/tests/extend.test.ts +0 -59
- package/node_modules/zod/src/v4/core/tests/index.test.ts +0 -46
- package/node_modules/zod/src/v4/core/tests/locales/be.test.ts +0 -124
- package/node_modules/zod/src/v4/core/tests/locales/el.test.ts +0 -214
- package/node_modules/zod/src/v4/core/tests/locales/en.test.ts +0 -22
- package/node_modules/zod/src/v4/core/tests/locales/es.test.ts +0 -180
- package/node_modules/zod/src/v4/core/tests/locales/fr.test.ts +0 -72
- package/node_modules/zod/src/v4/core/tests/locales/he.test.ts +0 -379
- package/node_modules/zod/src/v4/core/tests/locales/hr.test.ts +0 -163
- package/node_modules/zod/src/v4/core/tests/locales/nl.test.ts +0 -46
- package/node_modules/zod/src/v4/core/tests/locales/parity.test.ts +0 -42
- package/node_modules/zod/src/v4/core/tests/locales/ru.test.ts +0 -128
- package/node_modules/zod/src/v4/core/tests/locales/tk.test.ts +0 -69
- package/node_modules/zod/src/v4/core/tests/locales/tr.test.ts +0 -69
- package/node_modules/zod/src/v4/core/tests/locales/uz.test.ts +0 -105
- package/node_modules/zod/src/v4/core/tests/record-constructor.test.ts +0 -125
- package/node_modules/zod/src/v4/core/tests/recursive-tuples.test.ts +0 -45
- package/node_modules/zod/src/v4/core/tests/treeshake.test.ts +0 -51
- package/node_modules/zod/src/v4/core/tests/url-no-canparse.test.ts +0 -31
- package/node_modules/zod/src/v4/core/to-json-schema.ts +0 -855
- package/node_modules/zod/src/v4/core/util.ts +0 -1209
- package/node_modules/zod/src/v4/core/versions.ts +0 -5
- package/node_modules/zod/src/v4/core/visit.ts +0 -193
- package/node_modules/zod/src/v4/core/zsf.ts +0 -323
- package/node_modules/zod/src/v4/index.ts +0 -4
- package/node_modules/zod/src/v4/locales/ar.ts +0 -118
- package/node_modules/zod/src/v4/locales/az.ts +0 -114
- package/node_modules/zod/src/v4/locales/be.ts +0 -186
- package/node_modules/zod/src/v4/locales/bg.ts +0 -131
- package/node_modules/zod/src/v4/locales/bn.ts +0 -121
- package/node_modules/zod/src/v4/locales/ca.ts +0 -119
- package/node_modules/zod/src/v4/locales/ckb.ts +0 -138
- package/node_modules/zod/src/v4/locales/cs.ts +0 -121
- package/node_modules/zod/src/v4/locales/da.ts +0 -126
- package/node_modules/zod/src/v4/locales/de.ts +0 -119
- package/node_modules/zod/src/v4/locales/el.ts +0 -122
- package/node_modules/zod/src/v4/locales/en.ts +0 -134
- package/node_modules/zod/src/v4/locales/eo.ts +0 -121
- package/node_modules/zod/src/v4/locales/es.ts +0 -143
- package/node_modules/zod/src/v4/locales/fa.ts +0 -129
- package/node_modules/zod/src/v4/locales/fi.ts +0 -124
- package/node_modules/zod/src/v4/locales/fr-CA.ts +0 -119
- package/node_modules/zod/src/v4/locales/fr.ts +0 -137
- package/node_modules/zod/src/v4/locales/gu.ts +0 -121
- package/node_modules/zod/src/v4/locales/he.ts +0 -251
- package/node_modules/zod/src/v4/locales/hi.ts +0 -124
- package/node_modules/zod/src/v4/locales/hr.ts +0 -133
- package/node_modules/zod/src/v4/locales/hu.ts +0 -120
- package/node_modules/zod/src/v4/locales/hy.ts +0 -173
- package/node_modules/zod/src/v4/locales/id.ts +0 -118
- package/node_modules/zod/src/v4/locales/index.ts +0 -62
- package/node_modules/zod/src/v4/locales/is.ts +0 -122
- package/node_modules/zod/src/v4/locales/it.ts +0 -119
- package/node_modules/zod/src/v4/locales/ja.ts +0 -117
- package/node_modules/zod/src/v4/locales/ka.ts +0 -126
- package/node_modules/zod/src/v4/locales/kh.ts +0 -7
- package/node_modules/zod/src/v4/locales/km.ts +0 -122
- package/node_modules/zod/src/v4/locales/kn.ts +0 -124
- package/node_modules/zod/src/v4/locales/ko.ts +0 -124
- package/node_modules/zod/src/v4/locales/lt.ts +0 -241
- package/node_modules/zod/src/v4/locales/mk.ts +0 -121
- package/node_modules/zod/src/v4/locales/ms.ts +0 -118
- package/node_modules/zod/src/v4/locales/ne.ts +0 -126
- package/node_modules/zod/src/v4/locales/nl.ts +0 -124
- package/node_modules/zod/src/v4/locales/nn.ts +0 -119
- package/node_modules/zod/src/v4/locales/no.ts +0 -119
- package/node_modules/zod/src/v4/locales/ota.ts +0 -120
- package/node_modules/zod/src/v4/locales/pl.ts +0 -121
- package/node_modules/zod/src/v4/locales/ps.ts +0 -129
- package/node_modules/zod/src/v4/locales/pt-BR.ts +0 -159
- package/node_modules/zod/src/v4/locales/pt.ts +0 -157
- package/node_modules/zod/src/v4/locales/ro.ts +0 -130
- package/node_modules/zod/src/v4/locales/ru.ts +0 -186
- package/node_modules/zod/src/v4/locales/sk.ts +0 -121
- package/node_modules/zod/src/v4/locales/sl.ts +0 -121
- package/node_modules/zod/src/v4/locales/sv.ts +0 -122
- package/node_modules/zod/src/v4/locales/ta.ts +0 -121
- package/node_modules/zod/src/v4/locales/th.ts +0 -122
- package/node_modules/zod/src/v4/locales/tk.ts +0 -111
- package/node_modules/zod/src/v4/locales/tr.ts +0 -114
- package/node_modules/zod/src/v4/locales/ua.ts +0 -7
- package/node_modules/zod/src/v4/locales/uk.ts +0 -120
- package/node_modules/zod/src/v4/locales/ur.ts +0 -122
- package/node_modules/zod/src/v4/locales/uz.ts +0 -118
- package/node_modules/zod/src/v4/locales/vi.ts +0 -120
- package/node_modules/zod/src/v4/locales/yo.ts +0 -127
- package/node_modules/zod/src/v4/locales/zh-CN.ts +0 -119
- package/node_modules/zod/src/v4/locales/zh-TW.ts +0 -118
- package/node_modules/zod/src/v4/mini/checks.ts +0 -33
- package/node_modules/zod/src/v4/mini/coerce.ts +0 -27
- package/node_modules/zod/src/v4/mini/deep-partial.ts +0 -73
- package/node_modules/zod/src/v4/mini/external.ts +0 -50
- package/node_modules/zod/src/v4/mini/in-out.ts +0 -45
- package/node_modules/zod/src/v4/mini/index.ts +0 -3
- package/node_modules/zod/src/v4/mini/iso.ts +0 -66
- package/node_modules/zod/src/v4/mini/parse.ts +0 -16
- package/node_modules/zod/src/v4/mini/schemas.ts +0 -2026
- package/node_modules/zod/src/v4/mini/tests/apply.test.ts +0 -57
- package/node_modules/zod/src/v4/mini/tests/assignability.test.ts +0 -190
- package/node_modules/zod/src/v4/mini/tests/brand.test.ts +0 -94
- package/node_modules/zod/src/v4/mini/tests/checks.test.ts +0 -158
- package/node_modules/zod/src/v4/mini/tests/codec.test.ts +0 -582
- package/node_modules/zod/src/v4/mini/tests/computed.test.ts +0 -36
- package/node_modules/zod/src/v4/mini/tests/cyclic-data.test.ts +0 -84
- package/node_modules/zod/src/v4/mini/tests/deep-partial.test.ts +0 -54
- package/node_modules/zod/src/v4/mini/tests/error.test.ts +0 -41
- package/node_modules/zod/src/v4/mini/tests/functions.test.ts +0 -14
- package/node_modules/zod/src/v4/mini/tests/index.test.ts +0 -1060
- package/node_modules/zod/src/v4/mini/tests/number.test.ts +0 -109
- package/node_modules/zod/src/v4/mini/tests/object.test.ts +0 -292
- package/node_modules/zod/src/v4/mini/tests/prototypes.test.ts +0 -43
- package/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +0 -325
- package/node_modules/zod/src/v4/mini/tests/standard-schema.test.ts +0 -50
- package/node_modules/zod/src/v4/mini/tests/string.test.ts +0 -373
- package/node_modules/zod/src/v4-mini/index.ts +0 -3
- package/node_modules/zod/v3/ZodError.cjs +0 -148
- package/node_modules/zod/v3/ZodError.d.cts +0 -164
- package/node_modules/zod/v3/ZodError.d.ts +0 -164
- package/node_modules/zod/v3/ZodError.js +0 -143
- package/node_modules/zod/v3/errors.cjs +0 -17
- package/node_modules/zod/v3/errors.d.cts +0 -5
- package/node_modules/zod/v3/errors.d.ts +0 -5
- package/node_modules/zod/v3/errors.js +0 -9
- package/node_modules/zod/v3/external.cjs +0 -22
- package/node_modules/zod/v3/external.d.cts +0 -6
- package/node_modules/zod/v3/external.d.ts +0 -6
- package/node_modules/zod/v3/external.js +0 -6
- package/node_modules/zod/v3/helpers/enumUtil.cjs +0 -2
- package/node_modules/zod/v3/helpers/enumUtil.d.cts +0 -8
- package/node_modules/zod/v3/helpers/enumUtil.d.ts +0 -8
- package/node_modules/zod/v3/helpers/enumUtil.js +0 -1
- package/node_modules/zod/v3/helpers/errorUtil.cjs +0 -9
- package/node_modules/zod/v3/helpers/errorUtil.d.cts +0 -9
- package/node_modules/zod/v3/helpers/errorUtil.d.ts +0 -9
- package/node_modules/zod/v3/helpers/errorUtil.js +0 -6
- package/node_modules/zod/v3/helpers/parseUtil.cjs +0 -124
- package/node_modules/zod/v3/helpers/parseUtil.d.cts +0 -78
- package/node_modules/zod/v3/helpers/parseUtil.d.ts +0 -78
- package/node_modules/zod/v3/helpers/parseUtil.js +0 -109
- package/node_modules/zod/v3/helpers/partialUtil.cjs +0 -2
- package/node_modules/zod/v3/helpers/partialUtil.d.cts +0 -8
- package/node_modules/zod/v3/helpers/partialUtil.d.ts +0 -8
- package/node_modules/zod/v3/helpers/partialUtil.js +0 -1
- package/node_modules/zod/v3/helpers/typeAliases.cjs +0 -2
- package/node_modules/zod/v3/helpers/typeAliases.d.cts +0 -2
- package/node_modules/zod/v3/helpers/typeAliases.d.ts +0 -2
- package/node_modules/zod/v3/helpers/typeAliases.js +0 -1
- package/node_modules/zod/v3/helpers/util.cjs +0 -137
- package/node_modules/zod/v3/helpers/util.d.cts +0 -85
- package/node_modules/zod/v3/helpers/util.d.ts +0 -85
- package/node_modules/zod/v3/helpers/util.js +0 -133
- package/node_modules/zod/v3/index.cjs +0 -33
- package/node_modules/zod/v3/index.d.cts +0 -4
- package/node_modules/zod/v3/index.d.ts +0 -4
- package/node_modules/zod/v3/index.js +0 -4
- package/node_modules/zod/v3/locales/en.cjs +0 -112
- package/node_modules/zod/v3/locales/en.d.cts +0 -3
- package/node_modules/zod/v3/locales/en.d.ts +0 -3
- package/node_modules/zod/v3/locales/en.js +0 -109
- package/node_modules/zod/v3/package.json +0 -7
- package/node_modules/zod/v3/standard-schema.cjs +0 -2
- package/node_modules/zod/v3/standard-schema.d.cts +0 -102
- package/node_modules/zod/v3/standard-schema.d.ts +0 -102
- package/node_modules/zod/v3/standard-schema.js +0 -1
- package/node_modules/zod/v3/types.cjs +0 -3779
- package/node_modules/zod/v3/types.d.cts +0 -1034
- package/node_modules/zod/v3/types.d.ts +0 -1034
- package/node_modules/zod/v3/types.js +0 -3697
- package/node_modules/zod/v4/classic/checks.cjs +0 -34
- package/node_modules/zod/v4/classic/checks.d.cts +0 -1
- package/node_modules/zod/v4/classic/checks.d.ts +0 -1
- package/node_modules/zod/v4/classic/checks.js +0 -1
- package/node_modules/zod/v4/classic/coerce.cjs +0 -47
- package/node_modules/zod/v4/classic/coerce.d.cts +0 -17
- package/node_modules/zod/v4/classic/coerce.d.ts +0 -17
- package/node_modules/zod/v4/classic/coerce.js +0 -17
- package/node_modules/zod/v4/classic/compat.cjs +0 -61
- package/node_modules/zod/v4/classic/compat.d.cts +0 -48
- package/node_modules/zod/v4/classic/compat.d.ts +0 -48
- package/node_modules/zod/v4/classic/compat.js +0 -31
- package/node_modules/zod/v4/classic/deep-partial.cjs +0 -39
- package/node_modules/zod/v4/classic/deep-partial.d.cts +0 -14
- package/node_modules/zod/v4/classic/deep-partial.d.ts +0 -14
- package/node_modules/zod/v4/classic/deep-partial.js +0 -13
- package/node_modules/zod/v4/classic/errors.cjs +0 -83
- package/node_modules/zod/v4/classic/errors.d.cts +0 -29
- package/node_modules/zod/v4/classic/errors.d.ts +0 -29
- package/node_modules/zod/v4/classic/errors.js +0 -57
- package/node_modules/zod/v4/classic/external.cjs +0 -76
- package/node_modules/zod/v4/classic/external.d.cts +0 -19
- package/node_modules/zod/v4/classic/external.d.ts +0 -19
- package/node_modules/zod/v4/classic/external.js +0 -17
- package/node_modules/zod/v4/classic/from-json-schema.cjs +0 -686
- package/node_modules/zod/v4/classic/from-json-schema.d.cts +0 -12
- package/node_modules/zod/v4/classic/from-json-schema.d.ts +0 -12
- package/node_modules/zod/v4/classic/from-json-schema.js +0 -660
- package/node_modules/zod/v4/classic/in-out.cjs +0 -63
- package/node_modules/zod/v4/classic/in-out.d.cts +0 -8
- package/node_modules/zod/v4/classic/in-out.d.ts +0 -8
- package/node_modules/zod/v4/classic/in-out.js +0 -36
- package/node_modules/zod/v4/classic/index.cjs +0 -33
- package/node_modules/zod/v4/classic/index.d.cts +0 -3
- package/node_modules/zod/v4/classic/index.d.ts +0 -3
- package/node_modules/zod/v4/classic/index.js +0 -4
- package/node_modules/zod/v4/classic/iso.cjs +0 -49
- package/node_modules/zod/v4/classic/iso.d.cts +0 -7
- package/node_modules/zod/v4/classic/iso.d.ts +0 -7
- package/node_modules/zod/v4/classic/iso.js +0 -15
- package/node_modules/zod/v4/classic/package.json +0 -7
- package/node_modules/zod/v4/classic/parse.cjs +0 -44
- package/node_modules/zod/v4/classic/parse.d.cts +0 -44
- package/node_modules/zod/v4/classic/parse.d.ts +0 -44
- package/node_modules/zod/v4/classic/parse.js +0 -16
- package/node_modules/zod/v4/classic/schemas.cjs +0 -1611
- package/node_modules/zod/v4/classic/schemas.d.cts +0 -802
- package/node_modules/zod/v4/classic/schemas.d.ts +0 -802
- package/node_modules/zod/v4/classic/schemas.js +0 -1491
- package/node_modules/zod/v4/core/api.cjs +0 -1246
- package/node_modules/zod/v4/core/api.d.cts +0 -329
- package/node_modules/zod/v4/core/api.d.ts +0 -329
- package/node_modules/zod/v4/core/api.js +0 -1104
- package/node_modules/zod/v4/core/checks.cjs +0 -607
- package/node_modules/zod/v4/core/checks.d.cts +0 -278
- package/node_modules/zod/v4/core/checks.d.ts +0 -278
- package/node_modules/zod/v4/core/checks.js +0 -581
- package/node_modules/zod/v4/core/compile.cjs +0 -1813
- package/node_modules/zod/v4/core/compile.d.cts +0 -51
- package/node_modules/zod/v4/core/compile.d.ts +0 -51
- package/node_modules/zod/v4/core/compile.js +0 -1783
- package/node_modules/zod/v4/core/core.cjs +0 -148
- package/node_modules/zod/v4/core/core.d.cts +0 -82
- package/node_modules/zod/v4/core/core.d.ts +0 -82
- package/node_modules/zod/v4/core/core.js +0 -141
- package/node_modules/zod/v4/core/doc.cjs +0 -37
- package/node_modules/zod/v4/core/doc.d.cts +0 -16
- package/node_modules/zod/v4/core/doc.d.ts +0 -16
- package/node_modules/zod/v4/core/doc.js +0 -33
- package/node_modules/zod/v4/core/errors.cjs +0 -301
- package/node_modules/zod/v4/core/errors.d.cts +0 -225
- package/node_modules/zod/v4/core/errors.d.ts +0 -225
- package/node_modules/zod/v4/core/errors.js +0 -270
- package/node_modules/zod/v4/core/index.cjs +0 -51
- package/node_modules/zod/v4/core/index.d.cts +0 -19
- package/node_modules/zod/v4/core/index.d.ts +0 -19
- package/node_modules/zod/v4/core/index.js +0 -19
- package/node_modules/zod/v4/core/json-schema-generator.cjs +0 -103
- package/node_modules/zod/v4/core/json-schema-generator.d.cts +0 -65
- package/node_modules/zod/v4/core/json-schema-generator.d.ts +0 -65
- package/node_modules/zod/v4/core/json-schema-generator.js +0 -99
- package/node_modules/zod/v4/core/json-schema-processors.cjs +0 -813
- package/node_modules/zod/v4/core/json-schema-processors.d.cts +0 -49
- package/node_modules/zod/v4/core/json-schema-processors.d.ts +0 -49
- package/node_modules/zod/v4/core/json-schema-processors.js +0 -747
- package/node_modules/zod/v4/core/json-schema.cjs +0 -2
- package/node_modules/zod/v4/core/json-schema.d.cts +0 -89
- package/node_modules/zod/v4/core/json-schema.d.ts +0 -89
- package/node_modules/zod/v4/core/json-schema.js +0 -1
- package/node_modules/zod/v4/core/memoizer.cjs +0 -272
- package/node_modules/zod/v4/core/memoizer.d.cts +0 -15
- package/node_modules/zod/v4/core/memoizer.d.ts +0 -15
- package/node_modules/zod/v4/core/memoizer.js +0 -265
- package/node_modules/zod/v4/core/package.json +0 -7
- package/node_modules/zod/v4/core/parse.cjs +0 -193
- package/node_modules/zod/v4/core/parse.d.cts +0 -52
- package/node_modules/zod/v4/core/parse.d.ts +0 -52
- package/node_modules/zod/v4/core/parse.js +0 -154
- package/node_modules/zod/v4/core/regexes.cjs +0 -184
- package/node_modules/zod/v4/core/regexes.d.cts +0 -87
- package/node_modules/zod/v4/core/regexes.d.ts +0 -87
- package/node_modules/zod/v4/core/regexes.js +0 -150
- package/node_modules/zod/v4/core/registries.cjs +0 -56
- package/node_modules/zod/v4/core/registries.d.cts +0 -35
- package/node_modules/zod/v4/core/registries.d.ts +0 -35
- package/node_modules/zod/v4/core/registries.js +0 -51
- package/node_modules/zod/v4/core/schemas.cjs +0 -2481
- package/node_modules/zod/v4/core/schemas.d.cts +0 -1253
- package/node_modules/zod/v4/core/schemas.d.ts +0 -1253
- package/node_modules/zod/v4/core/schemas.js +0 -2440
- package/node_modules/zod/v4/core/standard-schema.cjs +0 -2
- package/node_modules/zod/v4/core/standard-schema.d.cts +0 -126
- package/node_modules/zod/v4/core/standard-schema.d.ts +0 -126
- package/node_modules/zod/v4/core/standard-schema.js +0 -1
- package/node_modules/zod/v4/core/to-json-schema.cjs +0 -660
- package/node_modules/zod/v4/core/to-json-schema.d.cts +0 -153
- package/node_modules/zod/v4/core/to-json-schema.d.ts +0 -153
- package/node_modules/zod/v4/core/to-json-schema.js +0 -650
- package/node_modules/zod/v4/core/util.cjs +0 -915
- package/node_modules/zod/v4/core/util.d.cts +0 -257
- package/node_modules/zod/v4/core/util.d.ts +0 -257
- package/node_modules/zod/v4/core/util.js +0 -846
- package/node_modules/zod/v4/core/versions.cjs +0 -8
- package/node_modules/zod/v4/core/versions.d.cts +0 -5
- package/node_modules/zod/v4/core/versions.d.ts +0 -5
- package/node_modules/zod/v4/core/versions.js +0 -5
- package/node_modules/zod/v4/core/visit.cjs +0 -195
- package/node_modules/zod/v4/core/visit.d.cts +0 -30
- package/node_modules/zod/v4/core/visit.d.ts +0 -30
- package/node_modules/zod/v4/core/visit.js +0 -169
- package/node_modules/zod/v4/index.cjs +0 -32
- package/node_modules/zod/v4/index.d.cts +0 -3
- package/node_modules/zod/v4/index.d.ts +0 -3
- package/node_modules/zod/v4/index.js +0 -4
- package/node_modules/zod/v4/locales/ar.cjs +0 -136
- package/node_modules/zod/v4/locales/ar.d.cts +0 -5
- package/node_modules/zod/v4/locales/ar.d.ts +0 -4
- package/node_modules/zod/v4/locales/ar.js +0 -109
- package/node_modules/zod/v4/locales/az.cjs +0 -135
- package/node_modules/zod/v4/locales/az.d.cts +0 -5
- package/node_modules/zod/v4/locales/az.d.ts +0 -4
- package/node_modules/zod/v4/locales/az.js +0 -108
- package/node_modules/zod/v4/locales/be.cjs +0 -193
- package/node_modules/zod/v4/locales/be.d.cts +0 -5
- package/node_modules/zod/v4/locales/be.d.ts +0 -4
- package/node_modules/zod/v4/locales/be.js +0 -166
- package/node_modules/zod/v4/locales/bg.cjs +0 -150
- package/node_modules/zod/v4/locales/bg.d.cts +0 -5
- package/node_modules/zod/v4/locales/bg.d.ts +0 -4
- package/node_modules/zod/v4/locales/bg.js +0 -123
- package/node_modules/zod/v4/locales/bn.cjs +0 -138
- package/node_modules/zod/v4/locales/bn.d.cts +0 -5
- package/node_modules/zod/v4/locales/bn.d.ts +0 -4
- package/node_modules/zod/v4/locales/bn.js +0 -111
- package/node_modules/zod/v4/locales/ca.cjs +0 -137
- package/node_modules/zod/v4/locales/ca.d.cts +0 -5
- package/node_modules/zod/v4/locales/ca.d.ts +0 -4
- package/node_modules/zod/v4/locales/ca.js +0 -110
- package/node_modules/zod/v4/locales/ckb.cjs +0 -158
- package/node_modules/zod/v4/locales/ckb.d.cts +0 -5
- package/node_modules/zod/v4/locales/ckb.d.ts +0 -4
- package/node_modules/zod/v4/locales/ckb.js +0 -131
- package/node_modules/zod/v4/locales/cs.cjs +0 -141
- package/node_modules/zod/v4/locales/cs.d.cts +0 -5
- package/node_modules/zod/v4/locales/cs.d.ts +0 -4
- package/node_modules/zod/v4/locales/cs.js +0 -114
- package/node_modules/zod/v4/locales/da.cjs +0 -145
- package/node_modules/zod/v4/locales/da.d.cts +0 -5
- package/node_modules/zod/v4/locales/da.d.ts +0 -4
- package/node_modules/zod/v4/locales/da.js +0 -118
- package/node_modules/zod/v4/locales/de.cjs +0 -138
- package/node_modules/zod/v4/locales/de.d.cts +0 -5
- package/node_modules/zod/v4/locales/de.d.ts +0 -4
- package/node_modules/zod/v4/locales/de.js +0 -111
- package/node_modules/zod/v4/locales/el.cjs +0 -137
- package/node_modules/zod/v4/locales/el.d.cts +0 -5
- package/node_modules/zod/v4/locales/el.d.ts +0 -4
- package/node_modules/zod/v4/locales/el.js +0 -110
- package/node_modules/zod/v4/locales/en.cjs +0 -150
- package/node_modules/zod/v4/locales/en.d.cts +0 -5
- package/node_modules/zod/v4/locales/en.d.ts +0 -4
- package/node_modules/zod/v4/locales/en.js +0 -123
- package/node_modules/zod/v4/locales/eo.cjs +0 -139
- package/node_modules/zod/v4/locales/eo.d.cts +0 -5
- package/node_modules/zod/v4/locales/eo.d.ts +0 -4
- package/node_modules/zod/v4/locales/eo.js +0 -112
- package/node_modules/zod/v4/locales/es.cjs +0 -161
- package/node_modules/zod/v4/locales/es.d.cts +0 -5
- package/node_modules/zod/v4/locales/es.d.ts +0 -4
- package/node_modules/zod/v4/locales/es.js +0 -134
- package/node_modules/zod/v4/locales/fa.cjs +0 -144
- package/node_modules/zod/v4/locales/fa.d.cts +0 -5
- package/node_modules/zod/v4/locales/fa.d.ts +0 -4
- package/node_modules/zod/v4/locales/fa.js +0 -117
- package/node_modules/zod/v4/locales/fi.cjs +0 -142
- package/node_modules/zod/v4/locales/fi.d.cts +0 -5
- package/node_modules/zod/v4/locales/fi.d.ts +0 -4
- package/node_modules/zod/v4/locales/fi.js +0 -115
- package/node_modules/zod/v4/locales/fr-CA.cjs +0 -137
- package/node_modules/zod/v4/locales/fr-CA.d.cts +0 -5
- package/node_modules/zod/v4/locales/fr-CA.d.ts +0 -4
- package/node_modules/zod/v4/locales/fr-CA.js +0 -110
- package/node_modules/zod/v4/locales/fr.cjs +0 -154
- package/node_modules/zod/v4/locales/fr.d.cts +0 -5
- package/node_modules/zod/v4/locales/fr.d.ts +0 -4
- package/node_modules/zod/v4/locales/fr.js +0 -127
- package/node_modules/zod/v4/locales/gu.cjs +0 -138
- package/node_modules/zod/v4/locales/gu.d.cts +0 -5
- package/node_modules/zod/v4/locales/gu.d.ts +0 -4
- package/node_modules/zod/v4/locales/gu.js +0 -111
- package/node_modules/zod/v4/locales/he.cjs +0 -246
- package/node_modules/zod/v4/locales/he.d.cts +0 -5
- package/node_modules/zod/v4/locales/he.d.ts +0 -4
- package/node_modules/zod/v4/locales/he.js +0 -219
- package/node_modules/zod/v4/locales/hi.cjs +0 -136
- package/node_modules/zod/v4/locales/hi.d.cts +0 -5
- package/node_modules/zod/v4/locales/hi.d.ts +0 -4
- package/node_modules/zod/v4/locales/hi.js +0 -109
- package/node_modules/zod/v4/locales/hr.cjs +0 -151
- package/node_modules/zod/v4/locales/hr.d.cts +0 -5
- package/node_modules/zod/v4/locales/hr.d.ts +0 -4
- package/node_modules/zod/v4/locales/hr.js +0 -124
- package/node_modules/zod/v4/locales/hu.cjs +0 -138
- package/node_modules/zod/v4/locales/hu.d.cts +0 -5
- package/node_modules/zod/v4/locales/hu.d.ts +0 -4
- package/node_modules/zod/v4/locales/hu.js +0 -111
- package/node_modules/zod/v4/locales/hy.cjs +0 -183
- package/node_modules/zod/v4/locales/hy.d.cts +0 -5
- package/node_modules/zod/v4/locales/hy.d.ts +0 -4
- package/node_modules/zod/v4/locales/hy.js +0 -156
- package/node_modules/zod/v4/locales/id.cjs +0 -136
- package/node_modules/zod/v4/locales/id.d.cts +0 -5
- package/node_modules/zod/v4/locales/id.d.ts +0 -4
- package/node_modules/zod/v4/locales/id.js +0 -109
- package/node_modules/zod/v4/locales/index.cjs +0 -131
- package/node_modules/zod/v4/locales/index.d.cts +0 -62
- package/node_modules/zod/v4/locales/index.d.ts +0 -62
- package/node_modules/zod/v4/locales/index.js +0 -62
- package/node_modules/zod/v4/locales/is.cjs +0 -139
- package/node_modules/zod/v4/locales/is.d.cts +0 -5
- package/node_modules/zod/v4/locales/is.d.ts +0 -4
- package/node_modules/zod/v4/locales/is.js +0 -112
- package/node_modules/zod/v4/locales/it.cjs +0 -138
- package/node_modules/zod/v4/locales/it.d.cts +0 -5
- package/node_modules/zod/v4/locales/it.d.ts +0 -4
- package/node_modules/zod/v4/locales/it.js +0 -111
- package/node_modules/zod/v4/locales/ja.cjs +0 -137
- package/node_modules/zod/v4/locales/ja.d.cts +0 -5
- package/node_modules/zod/v4/locales/ja.d.ts +0 -4
- package/node_modules/zod/v4/locales/ja.js +0 -110
- package/node_modules/zod/v4/locales/ka.cjs +0 -142
- package/node_modules/zod/v4/locales/ka.d.cts +0 -5
- package/node_modules/zod/v4/locales/ka.d.ts +0 -4
- package/node_modules/zod/v4/locales/ka.js +0 -115
- package/node_modules/zod/v4/locales/kh.cjs +0 -12
- package/node_modules/zod/v4/locales/kh.d.cts +0 -5
- package/node_modules/zod/v4/locales/kh.d.ts +0 -5
- package/node_modules/zod/v4/locales/kh.js +0 -5
- package/node_modules/zod/v4/locales/km.cjs +0 -140
- package/node_modules/zod/v4/locales/km.d.cts +0 -5
- package/node_modules/zod/v4/locales/km.d.ts +0 -4
- package/node_modules/zod/v4/locales/km.js +0 -113
- package/node_modules/zod/v4/locales/kn.cjs +0 -141
- package/node_modules/zod/v4/locales/kn.d.cts +0 -5
- package/node_modules/zod/v4/locales/kn.d.ts +0 -4
- package/node_modules/zod/v4/locales/kn.js +0 -114
- package/node_modules/zod/v4/locales/ko.cjs +0 -141
- package/node_modules/zod/v4/locales/ko.d.cts +0 -5
- package/node_modules/zod/v4/locales/ko.d.ts +0 -4
- package/node_modules/zod/v4/locales/ko.js +0 -114
- package/node_modules/zod/v4/locales/lt.cjs +0 -232
- package/node_modules/zod/v4/locales/lt.d.cts +0 -5
- package/node_modules/zod/v4/locales/lt.d.ts +0 -4
- package/node_modules/zod/v4/locales/lt.js +0 -205
- package/node_modules/zod/v4/locales/mk.cjs +0 -139
- package/node_modules/zod/v4/locales/mk.d.cts +0 -5
- package/node_modules/zod/v4/locales/mk.d.ts +0 -4
- package/node_modules/zod/v4/locales/mk.js +0 -112
- package/node_modules/zod/v4/locales/ms.cjs +0 -137
- package/node_modules/zod/v4/locales/ms.d.cts +0 -5
- package/node_modules/zod/v4/locales/ms.d.ts +0 -4
- package/node_modules/zod/v4/locales/ms.js +0 -110
- package/node_modules/zod/v4/locales/ne.cjs +0 -136
- package/node_modules/zod/v4/locales/ne.d.cts +0 -5
- package/node_modules/zod/v4/locales/ne.d.ts +0 -4
- package/node_modules/zod/v4/locales/ne.js +0 -109
- package/node_modules/zod/v4/locales/nl.cjs +0 -140
- package/node_modules/zod/v4/locales/nl.d.cts +0 -5
- package/node_modules/zod/v4/locales/nl.d.ts +0 -4
- package/node_modules/zod/v4/locales/nl.js +0 -113
- package/node_modules/zod/v4/locales/nn.cjs +0 -138
- package/node_modules/zod/v4/locales/nn.d.cts +0 -5
- package/node_modules/zod/v4/locales/nn.d.ts +0 -4
- package/node_modules/zod/v4/locales/nn.js +0 -111
- package/node_modules/zod/v4/locales/no.cjs +0 -138
- package/node_modules/zod/v4/locales/no.d.cts +0 -5
- package/node_modules/zod/v4/locales/no.d.ts +0 -4
- package/node_modules/zod/v4/locales/no.js +0 -111
- package/node_modules/zod/v4/locales/ota.cjs +0 -139
- package/node_modules/zod/v4/locales/ota.d.cts +0 -5
- package/node_modules/zod/v4/locales/ota.d.ts +0 -4
- package/node_modules/zod/v4/locales/ota.js +0 -112
- package/node_modules/zod/v4/locales/package.json +0 -7
- package/node_modules/zod/v4/locales/pl.cjs +0 -139
- package/node_modules/zod/v4/locales/pl.d.cts +0 -5
- package/node_modules/zod/v4/locales/pl.d.ts +0 -4
- package/node_modules/zod/v4/locales/pl.js +0 -112
- package/node_modules/zod/v4/locales/ps.cjs +0 -144
- package/node_modules/zod/v4/locales/ps.d.cts +0 -5
- package/node_modules/zod/v4/locales/ps.d.ts +0 -4
- package/node_modules/zod/v4/locales/ps.js +0 -117
- package/node_modules/zod/v4/locales/pt-BR.cjs +0 -168
- package/node_modules/zod/v4/locales/pt-BR.d.cts +0 -5
- package/node_modules/zod/v4/locales/pt-BR.d.ts +0 -4
- package/node_modules/zod/v4/locales/pt-BR.js +0 -141
- package/node_modules/zod/v4/locales/pt.cjs +0 -167
- package/node_modules/zod/v4/locales/pt.d.cts +0 -5
- package/node_modules/zod/v4/locales/pt.d.ts +0 -4
- package/node_modules/zod/v4/locales/pt.js +0 -140
- package/node_modules/zod/v4/locales/ro.cjs +0 -147
- package/node_modules/zod/v4/locales/ro.d.cts +0 -5
- package/node_modules/zod/v4/locales/ro.d.ts +0 -4
- package/node_modules/zod/v4/locales/ro.js +0 -120
- package/node_modules/zod/v4/locales/ru.cjs +0 -193
- package/node_modules/zod/v4/locales/ru.d.cts +0 -5
- package/node_modules/zod/v4/locales/ru.d.ts +0 -4
- package/node_modules/zod/v4/locales/ru.js +0 -166
- package/node_modules/zod/v4/locales/sk.cjs +0 -141
- package/node_modules/zod/v4/locales/sk.d.cts +0 -5
- package/node_modules/zod/v4/locales/sk.d.ts +0 -4
- package/node_modules/zod/v4/locales/sk.js +0 -114
- package/node_modules/zod/v4/locales/sl.cjs +0 -139
- package/node_modules/zod/v4/locales/sl.d.cts +0 -5
- package/node_modules/zod/v4/locales/sl.d.ts +0 -4
- package/node_modules/zod/v4/locales/sl.js +0 -112
- package/node_modules/zod/v4/locales/sv.cjs +0 -140
- package/node_modules/zod/v4/locales/sv.d.cts +0 -5
- package/node_modules/zod/v4/locales/sv.d.ts +0 -4
- package/node_modules/zod/v4/locales/sv.js +0 -113
- package/node_modules/zod/v4/locales/ta.cjs +0 -140
- package/node_modules/zod/v4/locales/ta.d.cts +0 -5
- package/node_modules/zod/v4/locales/ta.d.ts +0 -4
- package/node_modules/zod/v4/locales/ta.js +0 -113
- package/node_modules/zod/v4/locales/th.cjs +0 -140
- package/node_modules/zod/v4/locales/th.d.cts +0 -5
- package/node_modules/zod/v4/locales/th.d.ts +0 -4
- package/node_modules/zod/v4/locales/th.js +0 -113
- package/node_modules/zod/v4/locales/tk.cjs +0 -132
- package/node_modules/zod/v4/locales/tk.d.cts +0 -5
- package/node_modules/zod/v4/locales/tk.d.ts +0 -4
- package/node_modules/zod/v4/locales/tk.js +0 -105
- package/node_modules/zod/v4/locales/tr.cjs +0 -135
- package/node_modules/zod/v4/locales/tr.d.cts +0 -5
- package/node_modules/zod/v4/locales/tr.d.ts +0 -4
- package/node_modules/zod/v4/locales/tr.js +0 -108
- package/node_modules/zod/v4/locales/ua.cjs +0 -12
- package/node_modules/zod/v4/locales/ua.d.cts +0 -5
- package/node_modules/zod/v4/locales/ua.d.ts +0 -5
- package/node_modules/zod/v4/locales/ua.js +0 -5
- package/node_modules/zod/v4/locales/uk.cjs +0 -138
- package/node_modules/zod/v4/locales/uk.d.cts +0 -5
- package/node_modules/zod/v4/locales/uk.d.ts +0 -4
- package/node_modules/zod/v4/locales/uk.js +0 -111
- package/node_modules/zod/v4/locales/ur.cjs +0 -140
- package/node_modules/zod/v4/locales/ur.d.cts +0 -5
- package/node_modules/zod/v4/locales/ur.d.ts +0 -4
- package/node_modules/zod/v4/locales/ur.js +0 -113
- package/node_modules/zod/v4/locales/uz.cjs +0 -138
- package/node_modules/zod/v4/locales/uz.d.cts +0 -5
- package/node_modules/zod/v4/locales/uz.d.ts +0 -4
- package/node_modules/zod/v4/locales/uz.js +0 -111
- package/node_modules/zod/v4/locales/vi.cjs +0 -138
- package/node_modules/zod/v4/locales/vi.d.cts +0 -5
- package/node_modules/zod/v4/locales/vi.d.ts +0 -4
- package/node_modules/zod/v4/locales/vi.js +0 -111
- package/node_modules/zod/v4/locales/yo.cjs +0 -137
- package/node_modules/zod/v4/locales/yo.d.cts +0 -5
- package/node_modules/zod/v4/locales/yo.d.ts +0 -4
- package/node_modules/zod/v4/locales/yo.js +0 -110
- package/node_modules/zod/v4/locales/zh-CN.cjs +0 -139
- package/node_modules/zod/v4/locales/zh-CN.d.cts +0 -5
- package/node_modules/zod/v4/locales/zh-CN.d.ts +0 -4
- package/node_modules/zod/v4/locales/zh-CN.js +0 -112
- package/node_modules/zod/v4/locales/zh-TW.cjs +0 -137
- package/node_modules/zod/v4/locales/zh-TW.d.cts +0 -5
- package/node_modules/zod/v4/locales/zh-TW.d.ts +0 -4
- package/node_modules/zod/v4/locales/zh-TW.js +0 -110
- package/node_modules/zod/v4/mini/checks.cjs +0 -35
- package/node_modules/zod/v4/mini/checks.d.cts +0 -1
- package/node_modules/zod/v4/mini/checks.d.ts +0 -1
- package/node_modules/zod/v4/mini/checks.js +0 -1
- package/node_modules/zod/v4/mini/coerce.cjs +0 -52
- package/node_modules/zod/v4/mini/coerce.d.cts +0 -7
- package/node_modules/zod/v4/mini/coerce.d.ts +0 -7
- package/node_modules/zod/v4/mini/coerce.js +0 -22
- package/node_modules/zod/v4/mini/deep-partial.cjs +0 -39
- package/node_modules/zod/v4/mini/deep-partial.d.cts +0 -14
- package/node_modules/zod/v4/mini/deep-partial.d.ts +0 -14
- package/node_modules/zod/v4/mini/deep-partial.js +0 -13
- package/node_modules/zod/v4/mini/external.cjs +0 -74
- package/node_modules/zod/v4/mini/external.d.cts +0 -16
- package/node_modules/zod/v4/mini/external.d.ts +0 -16
- package/node_modules/zod/v4/mini/external.js +0 -16
- package/node_modules/zod/v4/mini/in-out.cjs +0 -63
- package/node_modules/zod/v4/mini/in-out.d.cts +0 -8
- package/node_modules/zod/v4/mini/in-out.d.ts +0 -8
- package/node_modules/zod/v4/mini/in-out.js +0 -36
- package/node_modules/zod/v4/mini/index.cjs +0 -32
- package/node_modules/zod/v4/mini/index.d.cts +0 -3
- package/node_modules/zod/v4/mini/index.d.ts +0 -3
- package/node_modules/zod/v4/mini/index.js +0 -3
- package/node_modules/zod/v4/mini/iso.cjs +0 -64
- package/node_modules/zod/v4/mini/iso.d.cts +0 -22
- package/node_modules/zod/v4/mini/iso.d.ts +0 -22
- package/node_modules/zod/v4/mini/iso.js +0 -34
- package/node_modules/zod/v4/mini/package.json +0 -7
- package/node_modules/zod/v4/mini/parse.cjs +0 -18
- package/node_modules/zod/v4/mini/parse.d.cts +0 -1
- package/node_modules/zod/v4/mini/parse.d.ts +0 -1
- package/node_modules/zod/v4/mini/parse.js +0 -1
- package/node_modules/zod/v4/mini/schemas.cjs +0 -1111
- package/node_modules/zod/v4/mini/schemas.d.cts +0 -475
- package/node_modules/zod/v4/mini/schemas.d.ts +0 -475
- package/node_modules/zod/v4/mini/schemas.js +0 -987
- package/node_modules/zod/v4/package.json +0 -7
- package/node_modules/zod/v4-mini/index.cjs +0 -32
- package/node_modules/zod/v4-mini/index.d.cts +0 -3
- package/node_modules/zod/v4-mini/index.d.ts +0 -3
- package/node_modules/zod/v4-mini/index.js +0 -3
- package/node_modules/zod/v4-mini/package.json +0 -7
- package/personal-state.snapshot.lock.json +0 -40
- package/scene-interaction-v2.snapshot.lock.json +0 -36
|
@@ -1,2481 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.$ZodXor = exports.$ZodUnion = exports.$ZodObjectJIT = exports.$ZodObject = exports.$ZodArray = exports.$ZodDate = exports.$ZodVoid = exports.$ZodNever = exports.$ZodUnknown = exports.$ZodAny = exports.$ZodNull = exports.$ZodUndefined = exports.$ZodSymbol = exports.$ZodBigIntFormat = exports.$ZodBigInt = exports.$ZodBoolean = exports.$ZodNumberFormat = exports.$ZodNumber = exports.$ZodCustomStringFormat = exports.$ZodJWT = exports.$ZodCreditCard = exports.$ZodE164 = exports.$ZodBase64URL = exports.$ZodBase64 = exports.$ZodCIDRv6 = exports.$ZodCIDRv4 = exports.$ZodMAC = exports.$ZodIPv6 = exports.$ZodIPv4 = exports.$ZodISODuration = exports.$ZodISOTime = exports.$ZodISODate = exports.$ZodISODateTime = exports.$ZodKSUID = exports.$ZodXID = exports.$ZodULID = exports.$ZodCUID2 = exports.$ZodCUID = exports.$ZodNanoID = exports.$ZodEmoji = exports.$ZodURL = exports.URL_UNPARSEABLE = exports.URL_BAD_FORMAT = exports.$ZodEmail = exports.$ZodUUID = exports.$ZodGUID = exports.$ZodStringFormat = exports.$ZodString = exports.clone = exports.$ZodType = void 0;
|
|
27
|
-
exports.$ZodCustom = exports.$ZodLazy = exports.$ZodPromise = exports.$ZodFunction = exports.$ZodTemplateLiteral = exports.$ZodReadonly = exports.$ZodPreprocess = exports.$ZodCodec = exports.$ZodPipe = exports.$ZodNaN = exports.$ZodCatch = exports.$ZodSuccess = exports.$ZodNonOptional = exports.$ZodPrefault = exports.$ZodDefault = exports.$ZodNullable = exports.$ZodExactOptional = exports.$ZodOptional = exports.$ZodTransform = exports.$ZodFile = exports.$ZodLiteral = exports.$ZodEnum = exports.$ZodSet = exports.$ZodMap = exports.$ZodRecord = exports.$ZodTuple = exports.$ZodIntersection = exports.$ZodDiscriminatedUnion = void 0;
|
|
28
|
-
exports.standardProps = standardProps;
|
|
29
|
-
exports.parseURLObject = parseURLObject;
|
|
30
|
-
exports.stripTabAndNewline = stripTabAndNewline;
|
|
31
|
-
exports.urlHostnameOk = urlHostnameOk;
|
|
32
|
-
exports.urlProtocolOk = urlProtocolOk;
|
|
33
|
-
exports.isValidIPv6 = isValidIPv6;
|
|
34
|
-
exports.isValidCIDRv6 = isValidCIDRv6;
|
|
35
|
-
exports.isValidBase64 = isValidBase64;
|
|
36
|
-
exports.isValidBase64URL = isValidBase64URL;
|
|
37
|
-
exports.isValidCreditCard = isValidCreditCard;
|
|
38
|
-
exports.isValidJWT = isValidJWT;
|
|
39
|
-
exports.getDiscriminatedOption = getDiscriminatedOption;
|
|
40
|
-
exports.mergeValues = mergeValues;
|
|
41
|
-
const checks = __importStar(require("./checks.cjs"));
|
|
42
|
-
const core = __importStar(require("./core.cjs"));
|
|
43
|
-
const doc_js_1 = require("./doc.cjs");
|
|
44
|
-
const parse_js_1 = require("./parse.cjs");
|
|
45
|
-
const regexes = __importStar(require("./regexes.cjs"));
|
|
46
|
-
const util = __importStar(require("./util.cjs"));
|
|
47
|
-
const versions_js_1 = require("./versions.cjs");
|
|
48
|
-
exports.$ZodType = core.$constructor("$ZodType", (inst, def) => {
|
|
49
|
-
var _a;
|
|
50
|
-
inst ?? (inst = {});
|
|
51
|
-
inst._zod.def = def; // set _def property
|
|
52
|
-
inst._zod.bag = inst._zod.bag || {}; // initialize _bag object
|
|
53
|
-
inst._zod.version = versions_js_1.version;
|
|
54
|
-
const defChecks = inst._zod.def.checks;
|
|
55
|
-
// if inst is itself a checks.$ZodCheck, run it as a check
|
|
56
|
-
const checks = inst._zod.traits.has("$ZodCheck")
|
|
57
|
-
? [inst, ...(defChecks ?? [])]
|
|
58
|
-
: defChecks?.length
|
|
59
|
-
? [...defChecks]
|
|
60
|
-
: [];
|
|
61
|
-
for (const ch of checks) {
|
|
62
|
-
for (const fn of ch._zod.onattach) {
|
|
63
|
-
fn(inst);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
if (checks.length === 0) {
|
|
67
|
-
// deferred initializer inst._zod.parse is not yet defined
|
|
68
|
-
(_a = inst._zod).deferred ?? (_a.deferred = []);
|
|
69
|
-
inst._zod.deferred?.push(() => {
|
|
70
|
-
inst._zod.run = inst._zod.parse;
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
else {
|
|
74
|
-
const runChecks = (payload, checks, ctx) => {
|
|
75
|
-
if (payload.memo)
|
|
76
|
-
return payload;
|
|
77
|
-
let isAborted = util.aborted(payload);
|
|
78
|
-
let asyncResult;
|
|
79
|
-
for (const ch of checks) {
|
|
80
|
-
if (ch._zod.def.when) {
|
|
81
|
-
if (util.explicitlyAborted(payload))
|
|
82
|
-
continue;
|
|
83
|
-
const shouldRun = ch._zod.def.when(payload);
|
|
84
|
-
if (!shouldRun)
|
|
85
|
-
continue;
|
|
86
|
-
}
|
|
87
|
-
else if (isAborted) {
|
|
88
|
-
continue;
|
|
89
|
-
}
|
|
90
|
-
const currLen = payload.issues.length;
|
|
91
|
-
const _ = ch._zod.check(payload);
|
|
92
|
-
if (_ instanceof Promise && ctx?.async === false) {
|
|
93
|
-
throw new core.$ZodAsyncError();
|
|
94
|
-
}
|
|
95
|
-
if (asyncResult || _ instanceof Promise) {
|
|
96
|
-
asyncResult = (asyncResult ?? Promise.resolve()).then(async () => {
|
|
97
|
-
await _;
|
|
98
|
-
const nextLen = payload.issues.length;
|
|
99
|
-
if (nextLen === currLen)
|
|
100
|
-
return;
|
|
101
|
-
util.attachSchema(payload.issues, currLen, inst);
|
|
102
|
-
if (!isAborted)
|
|
103
|
-
isAborted = util.aborted(payload, currLen);
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
else {
|
|
107
|
-
const nextLen = payload.issues.length;
|
|
108
|
-
if (nextLen === currLen)
|
|
109
|
-
continue;
|
|
110
|
-
util.attachSchema(payload.issues, currLen, inst);
|
|
111
|
-
if (!isAborted)
|
|
112
|
-
isAborted = util.aborted(payload, currLen);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
if (asyncResult) {
|
|
116
|
-
return asyncResult.then(() => {
|
|
117
|
-
return payload;
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
return payload;
|
|
121
|
-
};
|
|
122
|
-
const handleCanaryResult = (canary, payload, ctx) => {
|
|
123
|
-
// abort if the canary is aborted
|
|
124
|
-
if (util.aborted(canary)) {
|
|
125
|
-
canary.aborted = true;
|
|
126
|
-
return canary;
|
|
127
|
-
}
|
|
128
|
-
// run checks first, then
|
|
129
|
-
const checkResult = runChecks(payload, checks, ctx);
|
|
130
|
-
if (checkResult instanceof Promise) {
|
|
131
|
-
if (ctx.async === false)
|
|
132
|
-
throw new core.$ZodAsyncError();
|
|
133
|
-
return checkResult.then((checkResult) => inst._zod.parse(checkResult, ctx));
|
|
134
|
-
}
|
|
135
|
-
return inst._zod.parse(checkResult, ctx);
|
|
136
|
-
};
|
|
137
|
-
inst._zod.run = (payload, ctx) => {
|
|
138
|
-
if (ctx.skipChecks) {
|
|
139
|
-
return inst._zod.parse(payload, ctx);
|
|
140
|
-
}
|
|
141
|
-
if (ctx.direction === "backward") {
|
|
142
|
-
// run canary initial pass (no checks)
|
|
143
|
-
const canary = inst._zod.parse({ value: payload.value, issues: [] }, { ...ctx, skipChecks: true });
|
|
144
|
-
if (canary instanceof Promise) {
|
|
145
|
-
return canary.then((canary) => {
|
|
146
|
-
return handleCanaryResult(canary, payload, ctx);
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
return handleCanaryResult(canary, payload, ctx);
|
|
150
|
-
}
|
|
151
|
-
// forward
|
|
152
|
-
const result = inst._zod.parse(payload, ctx);
|
|
153
|
-
if (result instanceof Promise) {
|
|
154
|
-
if (ctx.async === false)
|
|
155
|
-
throw new core.$ZodAsyncError();
|
|
156
|
-
return result.then((result) => runChecks(result, checks, ctx));
|
|
157
|
-
}
|
|
158
|
-
return runChecks(result, checks, ctx);
|
|
159
|
-
};
|
|
160
|
-
}
|
|
161
|
-
}, {
|
|
162
|
-
// Wrappers extend this by installing a richer factory over it; reading it eagerly would defeat the laziness.
|
|
163
|
-
get "~standard"() {
|
|
164
|
-
return util.hide(this, "~standard", standardProps(this));
|
|
165
|
-
},
|
|
166
|
-
set "~standard"(value) {
|
|
167
|
-
util.own(this, "~standard", value);
|
|
168
|
-
},
|
|
169
|
-
});
|
|
170
|
-
/** The Standard Schema surface for `inst`. Shared so wrappers can extend it without forcing it. */
|
|
171
|
-
const toStandardResult = (r) => r.success ? { value: r.data } : { issues: r.error?.issues };
|
|
172
|
-
function standardProps(inst) {
|
|
173
|
-
return {
|
|
174
|
-
validate: (value) => {
|
|
175
|
-
try {
|
|
176
|
-
return toStandardResult((0, parse_js_1.safeParse)(inst, value));
|
|
177
|
-
}
|
|
178
|
-
catch (_) {
|
|
179
|
-
return (0, parse_js_1.safeParseAsync)(inst, value).then(toStandardResult);
|
|
180
|
-
}
|
|
181
|
-
},
|
|
182
|
-
vendor: "zod",
|
|
183
|
-
version: 1,
|
|
184
|
-
};
|
|
185
|
-
}
|
|
186
|
-
var util_js_1 = require("./util.cjs");
|
|
187
|
-
Object.defineProperty(exports, "clone", { enumerable: true, get: function () { return util_js_1.clone; } });
|
|
188
|
-
exports.$ZodString = core.$constructor("$ZodString", (inst, def) => {
|
|
189
|
-
exports.$ZodType.init(inst, def);
|
|
190
|
-
inst._zod.pattern = [...(inst?._zod.bag?.patterns ?? [])].pop() ?? regexes.string(inst._zod.bag);
|
|
191
|
-
inst._zod.parse = (payload, _) => {
|
|
192
|
-
if (def.coerce)
|
|
193
|
-
try {
|
|
194
|
-
payload.value = String(payload.value);
|
|
195
|
-
}
|
|
196
|
-
catch (_) { }
|
|
197
|
-
if (typeof payload.value === "string")
|
|
198
|
-
return payload;
|
|
199
|
-
payload.issues.push({
|
|
200
|
-
expected: "string",
|
|
201
|
-
code: "invalid_type",
|
|
202
|
-
input: payload.value,
|
|
203
|
-
inst,
|
|
204
|
-
});
|
|
205
|
-
return payload;
|
|
206
|
-
};
|
|
207
|
-
});
|
|
208
|
-
exports.$ZodStringFormat = core.$constructor("$ZodStringFormat", (inst, def) => {
|
|
209
|
-
// check initialization must come first
|
|
210
|
-
checks.$ZodCheckStringFormat.init(inst, def);
|
|
211
|
-
exports.$ZodString.init(inst, def);
|
|
212
|
-
});
|
|
213
|
-
exports.$ZodGUID = core.$constructor("$ZodGUID", (inst, def) => {
|
|
214
|
-
def.pattern ?? (def.pattern = regexes.guid);
|
|
215
|
-
exports.$ZodStringFormat.init(inst, def);
|
|
216
|
-
});
|
|
217
|
-
exports.$ZodUUID = core.$constructor("$ZodUUID", (inst, def) => {
|
|
218
|
-
if (def.version) {
|
|
219
|
-
const versionMap = {
|
|
220
|
-
v1: 1,
|
|
221
|
-
v2: 2,
|
|
222
|
-
v3: 3,
|
|
223
|
-
v4: 4,
|
|
224
|
-
v5: 5,
|
|
225
|
-
v6: 6,
|
|
226
|
-
v7: 7,
|
|
227
|
-
v8: 8,
|
|
228
|
-
};
|
|
229
|
-
const v = versionMap[def.version];
|
|
230
|
-
if (v === undefined)
|
|
231
|
-
throw new Error(`Invalid UUID version: "${def.version}"`);
|
|
232
|
-
def.pattern ?? (def.pattern = regexes.uuid(v));
|
|
233
|
-
}
|
|
234
|
-
else
|
|
235
|
-
def.pattern ?? (def.pattern = regexes.uuid());
|
|
236
|
-
exports.$ZodStringFormat.init(inst, def);
|
|
237
|
-
});
|
|
238
|
-
exports.$ZodEmail = core.$constructor("$ZodEmail", (inst, def) => {
|
|
239
|
-
def.pattern ?? (def.pattern = regexes.email);
|
|
240
|
-
exports.$ZodStringFormat.init(inst, def);
|
|
241
|
-
});
|
|
242
|
-
/** The `://` guard rejected the input before the URL constructor saw it. */
|
|
243
|
-
exports.URL_BAD_FORMAT = 1;
|
|
244
|
-
/** The URL constructor rejected the input. */
|
|
245
|
-
exports.URL_UNPARSEABLE = 2;
|
|
246
|
-
/** Parses a URL for `$ZodURL`, applying the one guard the URL constructor cannot express. Returns the parsed URL, or a code naming the stage that rejected it — the runtime needs that distinction to pick an issue note, and compiled code only needs to know it is not a URL. */
|
|
247
|
-
function parseURLObject(trimmed, def) {
|
|
248
|
-
// When normalize is off, require :// for http/https URLs. This prevents strings like "http:example.com" or "https:/path" from being silently accepted
|
|
249
|
-
if (!def.normalize && def.protocol?.source === regexes.httpProtocol.source && !/^https?:\/\//i.test(trimmed)) {
|
|
250
|
-
return exports.URL_BAD_FORMAT;
|
|
251
|
-
}
|
|
252
|
-
try {
|
|
253
|
-
// @ts-ignore
|
|
254
|
-
return new URL(trimmed);
|
|
255
|
-
}
|
|
256
|
-
catch {
|
|
257
|
-
return exports.URL_UNPARSEABLE;
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
const asciiTabOrNewline = /[\t\n\r]/g;
|
|
261
|
-
/** The URL parser deletes every ASCII tab, LF and CR from its input before it parses, so `new URL("https://exa\nmple.com")` reports on `example.com`. Applying the same deletion to the returned value closes the half of that divergence which can move the host; the parser's other rewrite, stripping C0 controls at the edges, cannot. */
|
|
262
|
-
function stripTabAndNewline(value) {
|
|
263
|
-
return value.replace(asciiTabOrNewline, "");
|
|
264
|
-
}
|
|
265
|
-
function urlHostnameOk(url, hostname) {
|
|
266
|
-
hostname.lastIndex = 0;
|
|
267
|
-
return hostname.test(url.hostname);
|
|
268
|
-
}
|
|
269
|
-
function urlProtocolOk(url, protocol) {
|
|
270
|
-
protocol.lastIndex = 0;
|
|
271
|
-
return protocol.test(url.protocol.endsWith(":") ? url.protocol.slice(0, -1) : url.protocol);
|
|
272
|
-
}
|
|
273
|
-
exports.$ZodURL = core.$constructor("$ZodURL", (inst, def) => {
|
|
274
|
-
exports.$ZodStringFormat.init(inst, def);
|
|
275
|
-
inst._zod.check = (payload) => {
|
|
276
|
-
try {
|
|
277
|
-
// Trim whitespace from input
|
|
278
|
-
const trimmed = payload.value.trim();
|
|
279
|
-
const url = parseURLObject(trimmed, def);
|
|
280
|
-
if (url === exports.URL_BAD_FORMAT) {
|
|
281
|
-
payload.issues.push({
|
|
282
|
-
code: "invalid_format",
|
|
283
|
-
format: "url",
|
|
284
|
-
note: "Invalid URL format",
|
|
285
|
-
input: payload.value,
|
|
286
|
-
inst,
|
|
287
|
-
continue: !def.abort,
|
|
288
|
-
});
|
|
289
|
-
return;
|
|
290
|
-
}
|
|
291
|
-
if (url === exports.URL_UNPARSEABLE) {
|
|
292
|
-
payload.issues.push({
|
|
293
|
-
code: "invalid_format",
|
|
294
|
-
format: "url",
|
|
295
|
-
input: payload.value,
|
|
296
|
-
inst,
|
|
297
|
-
continue: !def.abort,
|
|
298
|
-
});
|
|
299
|
-
return;
|
|
300
|
-
}
|
|
301
|
-
if (def.hostname && !urlHostnameOk(url, def.hostname)) {
|
|
302
|
-
payload.issues.push({
|
|
303
|
-
code: "invalid_format",
|
|
304
|
-
format: "url",
|
|
305
|
-
note: "Invalid hostname",
|
|
306
|
-
pattern: def.hostname.source,
|
|
307
|
-
input: payload.value,
|
|
308
|
-
inst,
|
|
309
|
-
continue: !def.abort,
|
|
310
|
-
});
|
|
311
|
-
}
|
|
312
|
-
if (def.protocol && !urlProtocolOk(url, def.protocol)) {
|
|
313
|
-
payload.issues.push({
|
|
314
|
-
code: "invalid_format",
|
|
315
|
-
format: "url",
|
|
316
|
-
note: "Invalid protocol",
|
|
317
|
-
pattern: def.protocol.source,
|
|
318
|
-
input: payload.value,
|
|
319
|
-
inst,
|
|
320
|
-
continue: !def.abort,
|
|
321
|
-
});
|
|
322
|
-
}
|
|
323
|
-
// Set the output value based on normalize flag
|
|
324
|
-
payload.value = def.normalize ? url.href : stripTabAndNewline(trimmed);
|
|
325
|
-
return;
|
|
326
|
-
}
|
|
327
|
-
catch (_) {
|
|
328
|
-
payload.issues.push({
|
|
329
|
-
code: "invalid_format",
|
|
330
|
-
format: "url",
|
|
331
|
-
input: payload.value,
|
|
332
|
-
inst,
|
|
333
|
-
continue: !def.abort,
|
|
334
|
-
});
|
|
335
|
-
}
|
|
336
|
-
};
|
|
337
|
-
});
|
|
338
|
-
exports.$ZodEmoji = core.$constructor("$ZodEmoji", (inst, def) => {
|
|
339
|
-
def.pattern ?? (def.pattern = regexes.emoji());
|
|
340
|
-
exports.$ZodStringFormat.init(inst, def);
|
|
341
|
-
});
|
|
342
|
-
exports.$ZodNanoID = core.$constructor("$ZodNanoID", (inst, def) => {
|
|
343
|
-
if (def.length !== undefined && (!Number.isInteger(def.length) || def.length < 1))
|
|
344
|
-
throw new Error(`Invalid nanoid length: ${def.length}`);
|
|
345
|
-
def.pattern ?? (def.pattern = def.length === undefined ? regexes.nanoid : regexes.nanoidOfLength(def.length));
|
|
346
|
-
exports.$ZodStringFormat.init(inst, def);
|
|
347
|
-
});
|
|
348
|
-
/**
|
|
349
|
-
* @deprecated CUID v1 is deprecated by its authors due to information leakage
|
|
350
|
-
* (timestamps embedded in the id). Use {@link $ZodCUID2} instead.
|
|
351
|
-
* See https://github.com/paralleldrive/cuid.
|
|
352
|
-
*/
|
|
353
|
-
exports.$ZodCUID = core.$constructor("$ZodCUID", (inst, def) => {
|
|
354
|
-
def.pattern ?? (def.pattern = regexes.cuid);
|
|
355
|
-
exports.$ZodStringFormat.init(inst, def);
|
|
356
|
-
});
|
|
357
|
-
exports.$ZodCUID2 = core.$constructor("$ZodCUID2", (inst, def) => {
|
|
358
|
-
def.pattern ?? (def.pattern = regexes.cuid2);
|
|
359
|
-
exports.$ZodStringFormat.init(inst, def);
|
|
360
|
-
});
|
|
361
|
-
exports.$ZodULID = core.$constructor("$ZodULID", (inst, def) => {
|
|
362
|
-
def.pattern ?? (def.pattern = regexes.ulid);
|
|
363
|
-
exports.$ZodStringFormat.init(inst, def);
|
|
364
|
-
});
|
|
365
|
-
exports.$ZodXID = core.$constructor("$ZodXID", (inst, def) => {
|
|
366
|
-
def.pattern ?? (def.pattern = regexes.xid);
|
|
367
|
-
exports.$ZodStringFormat.init(inst, def);
|
|
368
|
-
});
|
|
369
|
-
exports.$ZodKSUID = core.$constructor("$ZodKSUID", (inst, def) => {
|
|
370
|
-
def.pattern ?? (def.pattern = regexes.ksuid);
|
|
371
|
-
exports.$ZodStringFormat.init(inst, def);
|
|
372
|
-
});
|
|
373
|
-
exports.$ZodISODateTime = core.$constructor("$ZodISODateTime", (inst, def) => {
|
|
374
|
-
def.pattern ?? (def.pattern = regexes.datetime(def));
|
|
375
|
-
exports.$ZodStringFormat.init(inst, def);
|
|
376
|
-
// 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
|
|
377
|
-
if (def.local || def.precision === -1) {
|
|
378
|
-
inst._zod.bag.laxFormat = true;
|
|
379
|
-
inst._zod.onattach.push((s) => {
|
|
380
|
-
s._zod.bag.laxFormat = true;
|
|
381
|
-
});
|
|
382
|
-
}
|
|
383
|
-
});
|
|
384
|
-
exports.$ZodISODate = core.$constructor("$ZodISODate", (inst, def) => {
|
|
385
|
-
def.pattern ?? (def.pattern = regexes.date);
|
|
386
|
-
exports.$ZodStringFormat.init(inst, def);
|
|
387
|
-
});
|
|
388
|
-
exports.$ZodISOTime = core.$constructor("$ZodISOTime", (inst, def) => {
|
|
389
|
-
def.pattern ?? (def.pattern = regexes.time(def));
|
|
390
|
-
exports.$ZodStringFormat.init(inst, def);
|
|
391
|
-
});
|
|
392
|
-
exports.$ZodISODuration = core.$constructor("$ZodISODuration", (inst, def) => {
|
|
393
|
-
def.pattern ?? (def.pattern = regexes.duration);
|
|
394
|
-
exports.$ZodStringFormat.init(inst, def);
|
|
395
|
-
});
|
|
396
|
-
exports.$ZodIPv4 = core.$constructor("$ZodIPv4", (inst, def) => {
|
|
397
|
-
def.pattern ?? (def.pattern = regexes.ipv4);
|
|
398
|
-
exports.$ZodStringFormat.init(inst, def);
|
|
399
|
-
inst._zod.bag.format = `ipv4`;
|
|
400
|
-
});
|
|
401
|
-
/** An IPv6 address is written with hex digits, colons and dots, and nothing else. The guard is what makes the check below an IPv6 check: `new URL("http://[...]")` parses an authority, not an address, so `@` and `\` re-delimit it and `"::@1\\"` validates against the host `0.0.0.1`. The URL parser also deletes ASCII tab, LF and CR rather than failing, which is how `"::1\n"` validated as `::1`. */
|
|
402
|
-
const ipv6Alphabet = /^[0-9a-fA-F:.]+$/;
|
|
403
|
-
function isValidIPv6(value) {
|
|
404
|
-
if (!ipv6Alphabet.test(value))
|
|
405
|
-
return false;
|
|
406
|
-
try {
|
|
407
|
-
// @ts-ignore
|
|
408
|
-
new URL(`http://[${value}]`);
|
|
409
|
-
return true;
|
|
410
|
-
}
|
|
411
|
-
catch {
|
|
412
|
-
return false;
|
|
413
|
-
}
|
|
414
|
-
}
|
|
415
|
-
exports.$ZodIPv6 = core.$constructor("$ZodIPv6", (inst, def) => {
|
|
416
|
-
def.pattern ?? (def.pattern = regexes.ipv6);
|
|
417
|
-
exports.$ZodStringFormat.init(inst, def);
|
|
418
|
-
inst._zod.bag.format = `ipv6`;
|
|
419
|
-
inst._zod.check = (payload) => {
|
|
420
|
-
if (!isValidIPv6(payload.value)) {
|
|
421
|
-
payload.issues.push({
|
|
422
|
-
code: "invalid_format",
|
|
423
|
-
format: "ipv6",
|
|
424
|
-
input: payload.value,
|
|
425
|
-
inst,
|
|
426
|
-
continue: !def.abort,
|
|
427
|
-
});
|
|
428
|
-
}
|
|
429
|
-
};
|
|
430
|
-
});
|
|
431
|
-
exports.$ZodMAC = core.$constructor("$ZodMAC", (inst, def) => {
|
|
432
|
-
def.pattern ?? (def.pattern = regexes.mac(def.delimiter));
|
|
433
|
-
exports.$ZodStringFormat.init(inst, def);
|
|
434
|
-
inst._zod.bag.format = `mac`;
|
|
435
|
-
});
|
|
436
|
-
exports.$ZodCIDRv4 = core.$constructor("$ZodCIDRv4", (inst, def) => {
|
|
437
|
-
def.pattern ?? (def.pattern = regexes.cidrv4);
|
|
438
|
-
exports.$ZodStringFormat.init(inst, def);
|
|
439
|
-
});
|
|
440
|
-
function isValidCIDRv6(value) {
|
|
441
|
-
const parts = value.split("/");
|
|
442
|
-
if (parts.length !== 2)
|
|
443
|
-
return false;
|
|
444
|
-
const [address, prefix] = parts;
|
|
445
|
-
if (!prefix)
|
|
446
|
-
return false;
|
|
447
|
-
const prefixNum = Number(prefix);
|
|
448
|
-
if (`${prefixNum}` !== prefix)
|
|
449
|
-
return false;
|
|
450
|
-
if (prefixNum < 0 || prefixNum > 128)
|
|
451
|
-
return false;
|
|
452
|
-
return isValidIPv6(address);
|
|
453
|
-
}
|
|
454
|
-
exports.$ZodCIDRv6 = core.$constructor("$ZodCIDRv6", (inst, def) => {
|
|
455
|
-
def.pattern ?? (def.pattern = regexes.cidrv6); // not used for validation
|
|
456
|
-
exports.$ZodStringFormat.init(inst, def);
|
|
457
|
-
inst._zod.check = (payload) => {
|
|
458
|
-
if (!isValidCIDRv6(payload.value)) {
|
|
459
|
-
payload.issues.push({
|
|
460
|
-
code: "invalid_format",
|
|
461
|
-
format: "cidrv6",
|
|
462
|
-
input: payload.value,
|
|
463
|
-
inst,
|
|
464
|
-
continue: !def.abort,
|
|
465
|
-
});
|
|
466
|
-
}
|
|
467
|
-
};
|
|
468
|
-
});
|
|
469
|
-
////////////////////////////// ZodBase64 //////////////////////////////
|
|
470
|
-
function isValidBase64(data) {
|
|
471
|
-
if (data === "")
|
|
472
|
-
return true;
|
|
473
|
-
// atob ignores whitespace, so reject it up front.
|
|
474
|
-
if (/\s/.test(data))
|
|
475
|
-
return false;
|
|
476
|
-
if (data.length % 4 !== 0)
|
|
477
|
-
return false;
|
|
478
|
-
try {
|
|
479
|
-
// @ts-ignore
|
|
480
|
-
atob(data);
|
|
481
|
-
return true;
|
|
482
|
-
}
|
|
483
|
-
catch {
|
|
484
|
-
return false;
|
|
485
|
-
}
|
|
486
|
-
}
|
|
487
|
-
exports.$ZodBase64 = core.$constructor("$ZodBase64", (inst, def) => {
|
|
488
|
-
def.pattern ?? (def.pattern = regexes.base64);
|
|
489
|
-
exports.$ZodStringFormat.init(inst, def);
|
|
490
|
-
inst._zod.bag.contentEncoding = "base64";
|
|
491
|
-
inst._zod.check = (payload) => {
|
|
492
|
-
if (isValidBase64(payload.value))
|
|
493
|
-
return;
|
|
494
|
-
payload.issues.push({
|
|
495
|
-
code: "invalid_format",
|
|
496
|
-
format: "base64",
|
|
497
|
-
input: payload.value,
|
|
498
|
-
inst,
|
|
499
|
-
continue: !def.abort,
|
|
500
|
-
});
|
|
501
|
-
};
|
|
502
|
-
});
|
|
503
|
-
////////////////////////////// ZodBase64 //////////////////////////////
|
|
504
|
-
function isValidBase64URL(data) {
|
|
505
|
-
if (!regexes.base64url.test(data))
|
|
506
|
-
return false;
|
|
507
|
-
const base64 = data.replace(/[-_]/g, (c) => (c === "-" ? "+" : "/"));
|
|
508
|
-
const padded = base64.padEnd(Math.ceil(base64.length / 4) * 4, "=");
|
|
509
|
-
return isValidBase64(padded);
|
|
510
|
-
}
|
|
511
|
-
exports.$ZodBase64URL = core.$constructor("$ZodBase64URL", (inst, def) => {
|
|
512
|
-
def.pattern ?? (def.pattern = regexes.base64url);
|
|
513
|
-
exports.$ZodStringFormat.init(inst, def);
|
|
514
|
-
inst._zod.bag.contentEncoding = "base64url";
|
|
515
|
-
inst._zod.check = (payload) => {
|
|
516
|
-
if (isValidBase64URL(payload.value))
|
|
517
|
-
return;
|
|
518
|
-
payload.issues.push({
|
|
519
|
-
code: "invalid_format",
|
|
520
|
-
format: "base64url",
|
|
521
|
-
input: payload.value,
|
|
522
|
-
inst,
|
|
523
|
-
continue: !def.abort,
|
|
524
|
-
});
|
|
525
|
-
};
|
|
526
|
-
});
|
|
527
|
-
exports.$ZodE164 = core.$constructor("$ZodE164", (inst, def) => {
|
|
528
|
-
def.pattern ?? (def.pattern = regexes.e164);
|
|
529
|
-
exports.$ZodStringFormat.init(inst, def);
|
|
530
|
-
});
|
|
531
|
-
////////////////////////////// ZodCreditCard //////////////////////////////
|
|
532
|
-
const CC_SANITIZE = /[- ]/g;
|
|
533
|
-
/** Luhn checksum on a digit-only string. Adapted from valibot (MIT). */
|
|
534
|
-
function isLuhnAlgo(digits) {
|
|
535
|
-
let length = digits.length;
|
|
536
|
-
let bit = 1;
|
|
537
|
-
let sum = 0;
|
|
538
|
-
while (length) {
|
|
539
|
-
const value = +digits[--length];
|
|
540
|
-
bit ^= 1;
|
|
541
|
-
sum += bit ? [0, 2, 4, 6, 8, 1, 3, 5, 7, 9][value] : value;
|
|
542
|
-
}
|
|
543
|
-
return sum % 10 === 0;
|
|
544
|
-
}
|
|
545
|
-
function isValidCreditCard(input) {
|
|
546
|
-
if (!regexes.creditCard.test(input))
|
|
547
|
-
return false;
|
|
548
|
-
return isLuhnAlgo(input.replace(CC_SANITIZE, ""));
|
|
549
|
-
}
|
|
550
|
-
exports.$ZodCreditCard = core.$constructor("$ZodCreditCard", (inst, def) => {
|
|
551
|
-
// Shape only — the Luhn check below is not expressible as a pattern, so consumers of `pattern` (JSON Schema, template literals) get the length and separator rules alone.
|
|
552
|
-
def.pattern ?? (def.pattern = regexes.creditCard);
|
|
553
|
-
exports.$ZodStringFormat.init(inst, def);
|
|
554
|
-
inst._zod.check = (payload) => {
|
|
555
|
-
if (isValidCreditCard(payload.value))
|
|
556
|
-
return;
|
|
557
|
-
payload.issues.push({
|
|
558
|
-
code: "invalid_format",
|
|
559
|
-
format: "credit_card",
|
|
560
|
-
input: payload.value,
|
|
561
|
-
inst,
|
|
562
|
-
continue: !def.abort,
|
|
563
|
-
});
|
|
564
|
-
};
|
|
565
|
-
});
|
|
566
|
-
////////////////////////////// ZodJWT //////////////////////////////
|
|
567
|
-
function isValidJWT(token, algorithm = null) {
|
|
568
|
-
try {
|
|
569
|
-
const tokensParts = token.split(".");
|
|
570
|
-
if (tokensParts.length !== 3)
|
|
571
|
-
return false;
|
|
572
|
-
const [header] = tokensParts;
|
|
573
|
-
if (!header)
|
|
574
|
-
return false;
|
|
575
|
-
// @ts-ignore
|
|
576
|
-
const parsedHeader = JSON.parse(atob(header));
|
|
577
|
-
if ("typ" in parsedHeader && parsedHeader?.typ !== "JWT")
|
|
578
|
-
return false;
|
|
579
|
-
if (!parsedHeader.alg)
|
|
580
|
-
return false;
|
|
581
|
-
if (algorithm && (!("alg" in parsedHeader) || parsedHeader.alg !== algorithm))
|
|
582
|
-
return false;
|
|
583
|
-
return true;
|
|
584
|
-
}
|
|
585
|
-
catch {
|
|
586
|
-
return false;
|
|
587
|
-
}
|
|
588
|
-
}
|
|
589
|
-
exports.$ZodJWT = core.$constructor("$ZodJWT", (inst, def) => {
|
|
590
|
-
exports.$ZodStringFormat.init(inst, def);
|
|
591
|
-
inst._zod.check = (payload) => {
|
|
592
|
-
if (isValidJWT(payload.value, def.alg))
|
|
593
|
-
return;
|
|
594
|
-
payload.issues.push({
|
|
595
|
-
code: "invalid_format",
|
|
596
|
-
format: "jwt",
|
|
597
|
-
input: payload.value,
|
|
598
|
-
inst,
|
|
599
|
-
continue: !def.abort,
|
|
600
|
-
});
|
|
601
|
-
};
|
|
602
|
-
});
|
|
603
|
-
exports.$ZodCustomStringFormat = core.$constructor("$ZodCustomStringFormat", (inst, def) => {
|
|
604
|
-
exports.$ZodStringFormat.init(inst, def);
|
|
605
|
-
inst._zod.check = (payload) => {
|
|
606
|
-
if (def.fn(payload.value))
|
|
607
|
-
return;
|
|
608
|
-
payload.issues.push({
|
|
609
|
-
code: "invalid_format",
|
|
610
|
-
format: def.format,
|
|
611
|
-
input: payload.value,
|
|
612
|
-
inst,
|
|
613
|
-
continue: !def.abort,
|
|
614
|
-
});
|
|
615
|
-
};
|
|
616
|
-
});
|
|
617
|
-
exports.$ZodNumber = core.$constructor("$ZodNumber", (inst, def) => {
|
|
618
|
-
exports.$ZodType.init(inst, def);
|
|
619
|
-
inst._zod.pattern = inst._zod.bag.pattern ?? regexes.number;
|
|
620
|
-
inst._zod.parse = (payload, _ctx) => {
|
|
621
|
-
if (def.coerce)
|
|
622
|
-
try {
|
|
623
|
-
payload.value = Number(payload.value);
|
|
624
|
-
}
|
|
625
|
-
catch (_) { }
|
|
626
|
-
const input = payload.value;
|
|
627
|
-
if (typeof input === "number" && !Number.isNaN(input) && Number.isFinite(input)) {
|
|
628
|
-
return payload;
|
|
629
|
-
}
|
|
630
|
-
const received = typeof input === "number"
|
|
631
|
-
? Number.isNaN(input)
|
|
632
|
-
? "NaN"
|
|
633
|
-
: !Number.isFinite(input)
|
|
634
|
-
? String(input)
|
|
635
|
-
: undefined
|
|
636
|
-
: undefined;
|
|
637
|
-
payload.issues.push({
|
|
638
|
-
expected: "number",
|
|
639
|
-
code: "invalid_type",
|
|
640
|
-
input,
|
|
641
|
-
inst,
|
|
642
|
-
...(received ? { received } : {}),
|
|
643
|
-
});
|
|
644
|
-
return payload;
|
|
645
|
-
};
|
|
646
|
-
});
|
|
647
|
-
exports.$ZodNumberFormat = core.$constructor("$ZodNumberFormat", (inst, def) => {
|
|
648
|
-
checks.$ZodCheckNumberFormat.init(inst, def);
|
|
649
|
-
exports.$ZodNumber.init(inst, def); // no format checks
|
|
650
|
-
});
|
|
651
|
-
exports.$ZodBoolean = core.$constructor("$ZodBoolean", (inst, def) => {
|
|
652
|
-
exports.$ZodType.init(inst, def);
|
|
653
|
-
inst._zod.pattern = regexes.boolean;
|
|
654
|
-
inst._zod.parse = (payload, _ctx) => {
|
|
655
|
-
if (def.coerce)
|
|
656
|
-
try {
|
|
657
|
-
payload.value = Boolean(payload.value);
|
|
658
|
-
}
|
|
659
|
-
catch (_) { }
|
|
660
|
-
const input = payload.value;
|
|
661
|
-
if (typeof input === "boolean")
|
|
662
|
-
return payload;
|
|
663
|
-
payload.issues.push({
|
|
664
|
-
expected: "boolean",
|
|
665
|
-
code: "invalid_type",
|
|
666
|
-
input,
|
|
667
|
-
inst,
|
|
668
|
-
});
|
|
669
|
-
return payload;
|
|
670
|
-
};
|
|
671
|
-
});
|
|
672
|
-
exports.$ZodBigInt = core.$constructor("$ZodBigInt", (inst, def) => {
|
|
673
|
-
exports.$ZodType.init(inst, def);
|
|
674
|
-
inst._zod.pattern = regexes.bigint;
|
|
675
|
-
inst._zod.parse = (payload, _ctx) => {
|
|
676
|
-
if (def.coerce)
|
|
677
|
-
try {
|
|
678
|
-
payload.value = BigInt(payload.value);
|
|
679
|
-
}
|
|
680
|
-
catch (_) { }
|
|
681
|
-
if (typeof payload.value === "bigint")
|
|
682
|
-
return payload;
|
|
683
|
-
payload.issues.push({
|
|
684
|
-
expected: "bigint",
|
|
685
|
-
code: "invalid_type",
|
|
686
|
-
input: payload.value,
|
|
687
|
-
inst,
|
|
688
|
-
});
|
|
689
|
-
return payload;
|
|
690
|
-
};
|
|
691
|
-
});
|
|
692
|
-
exports.$ZodBigIntFormat = core.$constructor("$ZodBigIntFormat", (inst, def) => {
|
|
693
|
-
checks.$ZodCheckBigIntFormat.init(inst, def);
|
|
694
|
-
exports.$ZodBigInt.init(inst, def); // no format checks
|
|
695
|
-
});
|
|
696
|
-
exports.$ZodSymbol = core.$constructor("$ZodSymbol", (inst, def) => {
|
|
697
|
-
exports.$ZodType.init(inst, def);
|
|
698
|
-
inst._zod.parse = (payload, _ctx) => {
|
|
699
|
-
const input = payload.value;
|
|
700
|
-
if (typeof input === "symbol")
|
|
701
|
-
return payload;
|
|
702
|
-
payload.issues.push({
|
|
703
|
-
expected: "symbol",
|
|
704
|
-
code: "invalid_type",
|
|
705
|
-
input,
|
|
706
|
-
inst,
|
|
707
|
-
});
|
|
708
|
-
return payload;
|
|
709
|
-
};
|
|
710
|
-
});
|
|
711
|
-
exports.$ZodUndefined = core.$constructor("$ZodUndefined", (inst, def) => {
|
|
712
|
-
exports.$ZodType.init(inst, def);
|
|
713
|
-
inst._zod.pattern = regexes.undefined;
|
|
714
|
-
inst._zod.values = new Set([undefined]);
|
|
715
|
-
inst._zod.parse = (payload, _ctx) => {
|
|
716
|
-
const input = payload.value;
|
|
717
|
-
if (typeof input === "undefined")
|
|
718
|
-
return payload;
|
|
719
|
-
payload.issues.push({
|
|
720
|
-
expected: "undefined",
|
|
721
|
-
code: "invalid_type",
|
|
722
|
-
input,
|
|
723
|
-
inst,
|
|
724
|
-
});
|
|
725
|
-
return payload;
|
|
726
|
-
};
|
|
727
|
-
});
|
|
728
|
-
exports.$ZodNull = core.$constructor("$ZodNull", (inst, def) => {
|
|
729
|
-
exports.$ZodType.init(inst, def);
|
|
730
|
-
inst._zod.pattern = regexes.null;
|
|
731
|
-
inst._zod.values = new Set([null]);
|
|
732
|
-
inst._zod.parse = (payload, _ctx) => {
|
|
733
|
-
const input = payload.value;
|
|
734
|
-
if (input === null)
|
|
735
|
-
return payload;
|
|
736
|
-
payload.issues.push({
|
|
737
|
-
expected: "null",
|
|
738
|
-
code: "invalid_type",
|
|
739
|
-
input,
|
|
740
|
-
inst,
|
|
741
|
-
});
|
|
742
|
-
return payload;
|
|
743
|
-
};
|
|
744
|
-
});
|
|
745
|
-
exports.$ZodAny = core.$constructor("$ZodAny", (inst, def) => {
|
|
746
|
-
exports.$ZodType.init(inst, def);
|
|
747
|
-
inst._zod.parse = (payload) => payload;
|
|
748
|
-
});
|
|
749
|
-
exports.$ZodUnknown = core.$constructor("$ZodUnknown", (inst, def) => {
|
|
750
|
-
exports.$ZodType.init(inst, def);
|
|
751
|
-
inst._zod.parse = (payload) => payload;
|
|
752
|
-
});
|
|
753
|
-
exports.$ZodNever = core.$constructor("$ZodNever", (inst, def) => {
|
|
754
|
-
exports.$ZodType.init(inst, def);
|
|
755
|
-
inst._zod.parse = (payload, _ctx) => {
|
|
756
|
-
payload.issues.push({
|
|
757
|
-
expected: "never",
|
|
758
|
-
code: "invalid_type",
|
|
759
|
-
input: payload.value,
|
|
760
|
-
inst,
|
|
761
|
-
});
|
|
762
|
-
return payload;
|
|
763
|
-
};
|
|
764
|
-
});
|
|
765
|
-
exports.$ZodVoid = core.$constructor("$ZodVoid", (inst, def) => {
|
|
766
|
-
exports.$ZodType.init(inst, def);
|
|
767
|
-
inst._zod.parse = (payload, _ctx) => {
|
|
768
|
-
const input = payload.value;
|
|
769
|
-
if (typeof input === "undefined")
|
|
770
|
-
return payload;
|
|
771
|
-
payload.issues.push({
|
|
772
|
-
expected: "void",
|
|
773
|
-
code: "invalid_type",
|
|
774
|
-
input,
|
|
775
|
-
inst,
|
|
776
|
-
});
|
|
777
|
-
return payload;
|
|
778
|
-
};
|
|
779
|
-
});
|
|
780
|
-
exports.$ZodDate = core.$constructor("$ZodDate", (inst, def) => {
|
|
781
|
-
exports.$ZodType.init(inst, def);
|
|
782
|
-
inst._zod.parse = (payload, _ctx) => {
|
|
783
|
-
if (def.coerce) {
|
|
784
|
-
try {
|
|
785
|
-
payload.value = new Date(payload.value);
|
|
786
|
-
}
|
|
787
|
-
catch (_err) { }
|
|
788
|
-
}
|
|
789
|
-
const input = payload.value;
|
|
790
|
-
const isDate = input instanceof Date;
|
|
791
|
-
const isValidDate = isDate && !Number.isNaN(input.getTime());
|
|
792
|
-
if (isValidDate)
|
|
793
|
-
return payload;
|
|
794
|
-
payload.issues.push({
|
|
795
|
-
expected: "date",
|
|
796
|
-
code: "invalid_type",
|
|
797
|
-
input,
|
|
798
|
-
...(isDate ? { received: "Invalid Date" } : {}),
|
|
799
|
-
inst,
|
|
800
|
-
});
|
|
801
|
-
return payload;
|
|
802
|
-
};
|
|
803
|
-
});
|
|
804
|
-
function handleArrayResult(result, final, index) {
|
|
805
|
-
if (result.issues.length) {
|
|
806
|
-
final.issues.push(...util.prefixIssues(index, result.issues));
|
|
807
|
-
}
|
|
808
|
-
final.value[index] = result.value;
|
|
809
|
-
}
|
|
810
|
-
exports.$ZodArray = core.$constructor("$ZodArray", (inst, def) => {
|
|
811
|
-
exports.$ZodType.init(inst, def);
|
|
812
|
-
const memo = core.globalConfig.memoizer;
|
|
813
|
-
memo?.attach(inst);
|
|
814
|
-
inst._zod.parse = (payload, ctx) => {
|
|
815
|
-
const input = payload.value;
|
|
816
|
-
if (!Array.isArray(input)) {
|
|
817
|
-
payload.issues.push({
|
|
818
|
-
expected: "array",
|
|
819
|
-
code: "invalid_type",
|
|
820
|
-
input,
|
|
821
|
-
inst,
|
|
822
|
-
});
|
|
823
|
-
return payload;
|
|
824
|
-
}
|
|
825
|
-
payload.value = memo ? memo.alloc(inst, payload, Array(input.length), ctx) : Array(input.length);
|
|
826
|
-
const proms = [];
|
|
827
|
-
for (let i = 0; i < input.length; i++) {
|
|
828
|
-
const item = input[i];
|
|
829
|
-
const result = def.element._zod.run({
|
|
830
|
-
value: item,
|
|
831
|
-
issues: [],
|
|
832
|
-
}, ctx);
|
|
833
|
-
if (result instanceof Promise) {
|
|
834
|
-
proms.push(result.then((result) => handleArrayResult(result, payload, i)));
|
|
835
|
-
}
|
|
836
|
-
else {
|
|
837
|
-
handleArrayResult(result, payload, i);
|
|
838
|
-
}
|
|
839
|
-
}
|
|
840
|
-
if (proms.length) {
|
|
841
|
-
return Promise.all(proms).then(() => payload);
|
|
842
|
-
}
|
|
843
|
-
return payload; //handleArrayResultsAsync(parseResults, final);
|
|
844
|
-
};
|
|
845
|
-
});
|
|
846
|
-
function handlePropertyResult(result, final, key, input, optin, optout) {
|
|
847
|
-
const isPresent = key in input;
|
|
848
|
-
const isOptionalOut = optout === "optional";
|
|
849
|
-
// The middle rung means "absence permitted, nothing supplied in its place", so an absent key contributes nothing — whatever the schema made of `undefined` is invented, not substituted. Only `optional` reaches this with a value: `defaulted` substitutes, and a schema that isn't optional-out has to keep the key.
|
|
850
|
-
if (!isPresent && isOptionalOut && optin === "optional") {
|
|
851
|
-
return;
|
|
852
|
-
}
|
|
853
|
-
if (result.issues.length) {
|
|
854
|
-
// For optional-in/out schemas, ignore errors on absent keys.
|
|
855
|
-
if (optin !== undefined && isOptionalOut && !isPresent) {
|
|
856
|
-
return;
|
|
857
|
-
}
|
|
858
|
-
final.issues.push(...util.prefixIssues(key, result.issues));
|
|
859
|
-
}
|
|
860
|
-
if (!isPresent && optin === undefined) {
|
|
861
|
-
if (!result.issues.length) {
|
|
862
|
-
final.issues.push({
|
|
863
|
-
code: "invalid_type",
|
|
864
|
-
expected: "nonoptional",
|
|
865
|
-
input: undefined,
|
|
866
|
-
path: [key],
|
|
867
|
-
});
|
|
868
|
-
}
|
|
869
|
-
return;
|
|
870
|
-
}
|
|
871
|
-
if (result.value === undefined) {
|
|
872
|
-
if (isPresent) {
|
|
873
|
-
final.value[key] = undefined;
|
|
874
|
-
}
|
|
875
|
-
}
|
|
876
|
-
else {
|
|
877
|
-
final.value[key] = result.value;
|
|
878
|
-
}
|
|
879
|
-
}
|
|
880
|
-
// one shared instance; a fresh [] per schema cost 56 bytes retained
|
|
881
|
-
const NO_SYMBOL_KEYS = [];
|
|
882
|
-
function normalizeDef(def) {
|
|
883
|
-
const keys = Object.keys(def.shape);
|
|
884
|
-
const ownSymbols = Object.getOwnPropertySymbols(def.shape);
|
|
885
|
-
const symbolKeys = ownSymbols.length ? ownSymbols : NO_SYMBOL_KEYS;
|
|
886
|
-
// aliases `keys` when there are no symbols, so a string-only shape keeps one array
|
|
887
|
-
const allKeys = symbolKeys.length ? [...keys, ...symbolKeys] : keys;
|
|
888
|
-
for (const k of allKeys) {
|
|
889
|
-
if (!def.shape?.[k]?._zod?.traits?.has("$ZodType")) {
|
|
890
|
-
throw new Error(`Invalid element at key "${String(k)}": expected a Zod schema`);
|
|
891
|
-
}
|
|
892
|
-
}
|
|
893
|
-
const okeys = util.optionalKeys(def.shape);
|
|
894
|
-
return {
|
|
895
|
-
...def,
|
|
896
|
-
allKeys,
|
|
897
|
-
symbolKeys,
|
|
898
|
-
// string-only: handleCatchall matches it against `for...in`, which never yields a symbol
|
|
899
|
-
keySet: new Set(keys),
|
|
900
|
-
numKeys: keys.length,
|
|
901
|
-
optionalKeys: new Set(okeys),
|
|
902
|
-
};
|
|
903
|
-
}
|
|
904
|
-
function handleCatchall(proms, input, payload, ctx, def, inst) {
|
|
905
|
-
const unrecognized = [];
|
|
906
|
-
const keySet = def.keySet;
|
|
907
|
-
const _catchall = def.catchall._zod;
|
|
908
|
-
const t = _catchall.def.type;
|
|
909
|
-
const optin = _catchall.optin;
|
|
910
|
-
const optout = _catchall.optout;
|
|
911
|
-
for (const key in input) {
|
|
912
|
-
// Must precede the __proto__ branch: a declared key is not unrecognized, even though the shape loop deliberately strips __proto__ from the parsed output.
|
|
913
|
-
if (keySet.has(key))
|
|
914
|
-
continue;
|
|
915
|
-
// 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.
|
|
916
|
-
if (key === "__proto__") {
|
|
917
|
-
if (t === "never")
|
|
918
|
-
unrecognized.push(key);
|
|
919
|
-
continue;
|
|
920
|
-
}
|
|
921
|
-
if (t === "never") {
|
|
922
|
-
unrecognized.push(key);
|
|
923
|
-
continue;
|
|
924
|
-
}
|
|
925
|
-
const r = _catchall.run({ value: input[key], issues: [] }, ctx);
|
|
926
|
-
if (r instanceof Promise) {
|
|
927
|
-
proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, optin, optout)));
|
|
928
|
-
}
|
|
929
|
-
else {
|
|
930
|
-
handlePropertyResult(r, payload, key, input, optin, optout);
|
|
931
|
-
}
|
|
932
|
-
}
|
|
933
|
-
if (unrecognized.length) {
|
|
934
|
-
payload.issues.push({
|
|
935
|
-
code: "unrecognized_keys",
|
|
936
|
-
keys: unrecognized,
|
|
937
|
-
input,
|
|
938
|
-
inst,
|
|
939
|
-
// Describes the shape of the input, not the validity of the parsed value, so it never aborts. The parse still fails; the schema's own checks just get to run first, and an enclosing intersection can reconcile the key against a sibling operand.
|
|
940
|
-
continue: true,
|
|
941
|
-
});
|
|
942
|
-
}
|
|
943
|
-
if (!proms.length)
|
|
944
|
-
return payload;
|
|
945
|
-
return Promise.all(proms).then(() => {
|
|
946
|
-
return payload;
|
|
947
|
-
});
|
|
948
|
-
}
|
|
949
|
-
// 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.
|
|
950
|
-
const propShapes = new WeakMap();
|
|
951
|
-
exports.$ZodObject = core.$constructor("$ZodObject", (inst, def) => {
|
|
952
|
-
// requires cast because technically $ZodObject doesn't extend
|
|
953
|
-
exports.$ZodType.init(inst, def);
|
|
954
|
-
// const sh = def.shape;
|
|
955
|
-
const desc = Object.getOwnPropertyDescriptor(def, "shape");
|
|
956
|
-
if (!desc?.get) {
|
|
957
|
-
const sh = def.shape;
|
|
958
|
-
propShapes.set(def, sh);
|
|
959
|
-
Object.defineProperty(def, "shape", {
|
|
960
|
-
get: () => {
|
|
961
|
-
const newSh = { ...sh };
|
|
962
|
-
Object.defineProperty(def, "shape", {
|
|
963
|
-
value: newSh,
|
|
964
|
-
});
|
|
965
|
-
propShapes.set(def, newSh);
|
|
966
|
-
return newSh;
|
|
967
|
-
},
|
|
968
|
-
});
|
|
969
|
-
}
|
|
970
|
-
const _normalized = util.cached(() => normalizeDef(def));
|
|
971
|
-
util.defineLazyInternal(inst, "propValues", (zod) => {
|
|
972
|
-
const shape = zod.def.shape;
|
|
973
|
-
const propValues = {};
|
|
974
|
-
for (const key in shape) {
|
|
975
|
-
const field = shape[key]._zod;
|
|
976
|
-
if (field.values) {
|
|
977
|
-
if (!Object.prototype.hasOwnProperty.call(propValues, key)) {
|
|
978
|
-
util.assignProp(propValues, key, new Set());
|
|
979
|
-
}
|
|
980
|
-
for (const v of field.values)
|
|
981
|
-
propValues[key].add(v);
|
|
982
|
-
// An omittable slot reads back as undefined at a discriminator lookup, so it has to claim undefined: two options that can both omit the key are not discriminable on it.
|
|
983
|
-
if (field.optin !== undefined)
|
|
984
|
-
propValues[key].add(undefined);
|
|
985
|
-
}
|
|
986
|
-
}
|
|
987
|
-
return propValues;
|
|
988
|
-
});
|
|
989
|
-
const isObject = util.isObject;
|
|
990
|
-
const catchall = def.catchall;
|
|
991
|
-
let value;
|
|
992
|
-
const memo = core.globalConfig.memoizer;
|
|
993
|
-
memo?.attach(inst);
|
|
994
|
-
inst._zod.parse = (payload, ctx) => {
|
|
995
|
-
value ?? (value = _normalized.value);
|
|
996
|
-
const input = payload.value;
|
|
997
|
-
if (!isObject(input)) {
|
|
998
|
-
payload.issues.push({
|
|
999
|
-
expected: "object",
|
|
1000
|
-
code: "invalid_type",
|
|
1001
|
-
input,
|
|
1002
|
-
inst,
|
|
1003
|
-
});
|
|
1004
|
-
return payload;
|
|
1005
|
-
}
|
|
1006
|
-
payload.value = memo ? memo.alloc(inst, payload, {}, ctx) : {};
|
|
1007
|
-
const proms = [];
|
|
1008
|
-
const shape = value.shape;
|
|
1009
|
-
for (const key of value.allKeys) {
|
|
1010
|
-
if (key === "__proto__")
|
|
1011
|
-
continue;
|
|
1012
|
-
const el = shape[key];
|
|
1013
|
-
const optin = el._zod.optin;
|
|
1014
|
-
const optout = el._zod.optout;
|
|
1015
|
-
const r = el._zod.run({ value: input[key], issues: [] }, ctx);
|
|
1016
|
-
if (r instanceof Promise) {
|
|
1017
|
-
proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, optin, optout)));
|
|
1018
|
-
}
|
|
1019
|
-
else {
|
|
1020
|
-
handlePropertyResult(r, payload, key, input, optin, optout);
|
|
1021
|
-
}
|
|
1022
|
-
}
|
|
1023
|
-
if (!catchall) {
|
|
1024
|
-
return proms.length ? Promise.all(proms).then(() => payload) : payload;
|
|
1025
|
-
}
|
|
1026
|
-
return handleCatchall(proms, input, payload, ctx, _normalized.value, inst);
|
|
1027
|
-
};
|
|
1028
|
-
});
|
|
1029
|
-
exports.$ZodObjectJIT = core.$constructor("$ZodObjectJIT", (inst, def) => {
|
|
1030
|
-
// requires cast because technically $ZodObject doesn't extend
|
|
1031
|
-
exports.$ZodObject.init(inst, def);
|
|
1032
|
-
const superParse = inst._zod.parse;
|
|
1033
|
-
const _normalized = util.cached(() => normalizeDef(def));
|
|
1034
|
-
const memo = core.globalConfig.memoizer;
|
|
1035
|
-
const generateFastpass = (shape) => {
|
|
1036
|
-
const normalized = _normalized.value;
|
|
1037
|
-
const syms = normalized.symbolKeys;
|
|
1038
|
-
// a symbol has no source literal, so it is read as `syms[i]` off the closed-over scope
|
|
1039
|
-
const doc = new doc_js_1.Doc(["payload", "ctx"], { shape, inst, memo, syms });
|
|
1040
|
-
const parseStr = (k) => `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
|
|
1041
|
-
// Prefixes in place, like util.prefixIssues does for every interpreted path.
|
|
1042
|
-
const prefixStr = (id, k) => `
|
|
1043
|
-
for (let i = 0; i < ${id}.issues.length; i++) {
|
|
1044
|
-
const iss = ${id}.issues[i];
|
|
1045
|
-
iss.path = iss.path ? [${k}, ...iss.path] : [${k}];
|
|
1046
|
-
payload.issues.push(iss);
|
|
1047
|
-
}`;
|
|
1048
|
-
doc.write(`const input = payload.value;`);
|
|
1049
|
-
const ids = Object.create(null);
|
|
1050
|
-
let counter = 0;
|
|
1051
|
-
for (const key of normalized.allKeys) {
|
|
1052
|
-
ids[key] = `key_${counter++}`;
|
|
1053
|
-
}
|
|
1054
|
-
// A: preserve key order {
|
|
1055
|
-
doc.write(memo ? `const newResult = memo.alloc(inst, payload, {}, ctx);` : `const newResult = {};`);
|
|
1056
|
-
for (const key of normalized.allKeys) {
|
|
1057
|
-
if (key === "__proto__")
|
|
1058
|
-
continue;
|
|
1059
|
-
const id = ids[key];
|
|
1060
|
-
const k = typeof key === "symbol" ? `syms[${syms.indexOf(key)}]` : util.esc(key);
|
|
1061
|
-
const isPresent = `${k} in input`;
|
|
1062
|
-
const schema = shape[key];
|
|
1063
|
-
const optin = schema?._zod?.optin;
|
|
1064
|
-
const isOptionalIn = optin !== undefined;
|
|
1065
|
-
const isOptionalOut = schema?._zod?.optout === "optional";
|
|
1066
|
-
doc.write(`const ${id} = ${parseStr(k)};`);
|
|
1067
|
-
if (isOptionalIn && isOptionalOut) {
|
|
1068
|
-
// For optional-in/out schemas, ignore errors on absent keys — and, like the interpreted path, drop the value produced alongside them. The middle rung goes further: it permits absence without supplying anything in its place, so an absent key contributes nothing at all.
|
|
1069
|
-
const assign = optin === "optional" ? `${id}_present` : `${id}.value !== undefined || ${id}_present`;
|
|
1070
|
-
doc.write(`
|
|
1071
|
-
const ${id}_present = ${isPresent};
|
|
1072
|
-
if (!${id}.issues.length || ${id}_present) {
|
|
1073
|
-
if (${id}.issues.length) {${prefixStr(id, k)}
|
|
1074
|
-
}
|
|
1075
|
-
|
|
1076
|
-
if (${assign}) {
|
|
1077
|
-
newResult[${k}] = ${id}.value;
|
|
1078
|
-
}
|
|
1079
|
-
}
|
|
1080
|
-
|
|
1081
|
-
`);
|
|
1082
|
-
}
|
|
1083
|
-
else if (!isOptionalIn) {
|
|
1084
|
-
doc.write(`
|
|
1085
|
-
const ${id}_present = ${isPresent};
|
|
1086
|
-
if (${id}.issues.length) {${prefixStr(id, k)}
|
|
1087
|
-
}
|
|
1088
|
-
if (!${id}_present && !${id}.issues.length) {
|
|
1089
|
-
payload.issues.push({
|
|
1090
|
-
code: "invalid_type",
|
|
1091
|
-
expected: "nonoptional",
|
|
1092
|
-
input: undefined,
|
|
1093
|
-
path: [${k}]
|
|
1094
|
-
});
|
|
1095
|
-
}
|
|
1096
|
-
|
|
1097
|
-
if (${id}_present) {
|
|
1098
|
-
newResult[${k}] = ${id}.value;
|
|
1099
|
-
}
|
|
1100
|
-
|
|
1101
|
-
`);
|
|
1102
|
-
}
|
|
1103
|
-
else {
|
|
1104
|
-
doc.write(`
|
|
1105
|
-
if (${id}.issues.length) {${prefixStr(id, k)}
|
|
1106
|
-
}
|
|
1107
|
-
|
|
1108
|
-
if (${id}.value === undefined) {
|
|
1109
|
-
if (${isPresent}) {
|
|
1110
|
-
newResult[${k}] = undefined;
|
|
1111
|
-
}
|
|
1112
|
-
} else {
|
|
1113
|
-
newResult[${k}] = ${id}.value;
|
|
1114
|
-
}
|
|
1115
|
-
|
|
1116
|
-
`);
|
|
1117
|
-
}
|
|
1118
|
-
}
|
|
1119
|
-
doc.write(`payload.value = newResult;`);
|
|
1120
|
-
doc.write(`return payload;`);
|
|
1121
|
-
// closing `shape` in is what pays: turbofan specializes the parser against that one shape object, so every `shape[k]._zod.run` folds to a known callee. as a parameter it stays a generic load and measures 13% slower even with the forwarding frame gone
|
|
1122
|
-
return doc.compile();
|
|
1123
|
-
};
|
|
1124
|
-
let fastpass;
|
|
1125
|
-
const isObject = util.isObject;
|
|
1126
|
-
const jit = !core.globalConfig.jitless;
|
|
1127
|
-
const allowsEval = util.allowsEval;
|
|
1128
|
-
const fastEnabled = jit && allowsEval.value; // && !def.catchall;
|
|
1129
|
-
const catchall = def.catchall;
|
|
1130
|
-
let value;
|
|
1131
|
-
inst._zod.parse = (payload, ctx) => {
|
|
1132
|
-
value ?? (value = _normalized.value);
|
|
1133
|
-
const input = payload.value;
|
|
1134
|
-
if (!isObject(input)) {
|
|
1135
|
-
payload.issues.push({
|
|
1136
|
-
expected: "object",
|
|
1137
|
-
code: "invalid_type",
|
|
1138
|
-
input,
|
|
1139
|
-
inst,
|
|
1140
|
-
});
|
|
1141
|
-
return payload;
|
|
1142
|
-
}
|
|
1143
|
-
if (jit && fastEnabled && ctx?.async === false && ctx.jitless !== true) {
|
|
1144
|
-
// always synchronous
|
|
1145
|
-
if (!fastpass)
|
|
1146
|
-
fastpass = generateFastpass(def.shape);
|
|
1147
|
-
payload = fastpass(payload, ctx);
|
|
1148
|
-
if (!catchall)
|
|
1149
|
-
return payload;
|
|
1150
|
-
return handleCatchall([], input, payload, ctx, value, inst);
|
|
1151
|
-
}
|
|
1152
|
-
return superParse(payload, ctx);
|
|
1153
|
-
};
|
|
1154
|
-
});
|
|
1155
|
-
function handleUnionResults(results, final, inst, ctx) {
|
|
1156
|
-
for (const result of results) {
|
|
1157
|
-
if (result.issues.length === 0) {
|
|
1158
|
-
final.value = result.value;
|
|
1159
|
-
return final;
|
|
1160
|
-
}
|
|
1161
|
-
}
|
|
1162
|
-
const nonaborted = results.filter((r) => !util.aborted(r));
|
|
1163
|
-
if (nonaborted.length === 1) {
|
|
1164
|
-
final.value = nonaborted[0].value;
|
|
1165
|
-
return nonaborted[0];
|
|
1166
|
-
}
|
|
1167
|
-
final.issues.push({
|
|
1168
|
-
code: "invalid_union",
|
|
1169
|
-
input: final.value,
|
|
1170
|
-
inst,
|
|
1171
|
-
errors: results.map((result) => result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config()))),
|
|
1172
|
-
});
|
|
1173
|
-
return final;
|
|
1174
|
-
}
|
|
1175
|
-
exports.$ZodUnion = core.$constructor("$ZodUnion", (inst, def) => {
|
|
1176
|
-
exports.$ZodType.init(inst, def);
|
|
1177
|
-
util.defineLazyInternal(inst, "optin", (zod) => zod.def.options.some((o) => o._zod.optin === "defaulted")
|
|
1178
|
-
? "defaulted"
|
|
1179
|
-
: zod.def.options.some((o) => o._zod.optin !== undefined)
|
|
1180
|
-
? "optional"
|
|
1181
|
-
: undefined);
|
|
1182
|
-
util.defineLazyInternal(inst, "optout", (zod) => zod.def.options.some((o) => o._zod.optout === "optional") ? "optional" : undefined);
|
|
1183
|
-
util.defineLazyInternal(inst, "values", (zod) => {
|
|
1184
|
-
if (zod.def.options.every((o) => o._zod.values)) {
|
|
1185
|
-
return new Set(zod.def.options.flatMap((option) => Array.from(option._zod.values)));
|
|
1186
|
-
}
|
|
1187
|
-
return undefined;
|
|
1188
|
-
});
|
|
1189
|
-
util.defineLazyInternal(inst, "pattern", (zod) => {
|
|
1190
|
-
if (zod.def.options.every((o) => o._zod.pattern)) {
|
|
1191
|
-
const patterns = zod.def.options.map((o) => o._zod.pattern);
|
|
1192
|
-
return new RegExp(`^(${patterns.map((p) => util.cleanRegex(p.source)).join("|")})$`);
|
|
1193
|
-
}
|
|
1194
|
-
return undefined;
|
|
1195
|
-
});
|
|
1196
|
-
const first = def.options.length === 1 ? def.options[0]._zod.run : null;
|
|
1197
|
-
inst._zod.parse = (payload, ctx) => {
|
|
1198
|
-
if (first) {
|
|
1199
|
-
return first(payload, ctx);
|
|
1200
|
-
}
|
|
1201
|
-
let async = false;
|
|
1202
|
-
const results = [];
|
|
1203
|
-
for (const option of def.options) {
|
|
1204
|
-
const result = option._zod.run({
|
|
1205
|
-
value: payload.value,
|
|
1206
|
-
issues: [],
|
|
1207
|
-
}, ctx);
|
|
1208
|
-
if (result instanceof Promise) {
|
|
1209
|
-
results.push(result);
|
|
1210
|
-
async = true;
|
|
1211
|
-
}
|
|
1212
|
-
else {
|
|
1213
|
-
if (result.issues.length === 0)
|
|
1214
|
-
return result;
|
|
1215
|
-
results.push(result);
|
|
1216
|
-
}
|
|
1217
|
-
}
|
|
1218
|
-
if (!async)
|
|
1219
|
-
return handleUnionResults(results, payload, inst, ctx);
|
|
1220
|
-
return Promise.all(results).then((results) => {
|
|
1221
|
-
return handleUnionResults(results, payload, inst, ctx);
|
|
1222
|
-
});
|
|
1223
|
-
};
|
|
1224
|
-
});
|
|
1225
|
-
function handleExclusiveUnionResults(results, final, inst, ctx) {
|
|
1226
|
-
const matches = [];
|
|
1227
|
-
for (let i = 0; i < results.length; i++) {
|
|
1228
|
-
if (results[i].issues.length === 0)
|
|
1229
|
-
matches.push(i);
|
|
1230
|
-
}
|
|
1231
|
-
if (matches.length === 1) {
|
|
1232
|
-
final.value = results[matches[0]].value;
|
|
1233
|
-
return final;
|
|
1234
|
-
}
|
|
1235
|
-
if (matches.length === 0) {
|
|
1236
|
-
// No matches - same as regular union
|
|
1237
|
-
final.issues.push({
|
|
1238
|
-
code: "invalid_union",
|
|
1239
|
-
input: final.value,
|
|
1240
|
-
inst,
|
|
1241
|
-
errors: results.map((result) => result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config()))),
|
|
1242
|
-
});
|
|
1243
|
-
}
|
|
1244
|
-
else {
|
|
1245
|
-
// Multiple matches - exclusive union failure
|
|
1246
|
-
final.issues.push({
|
|
1247
|
-
code: "invalid_union",
|
|
1248
|
-
input: final.value,
|
|
1249
|
-
inst,
|
|
1250
|
-
errors: [],
|
|
1251
|
-
inclusive: false,
|
|
1252
|
-
matches,
|
|
1253
|
-
});
|
|
1254
|
-
}
|
|
1255
|
-
return final;
|
|
1256
|
-
}
|
|
1257
|
-
exports.$ZodXor = core.$constructor("$ZodXor", (inst, def) => {
|
|
1258
|
-
exports.$ZodUnion.init(inst, def);
|
|
1259
|
-
def.inclusive = false;
|
|
1260
|
-
const first = def.options.length === 1 ? def.options[0]._zod.run : null;
|
|
1261
|
-
inst._zod.parse = (payload, ctx) => {
|
|
1262
|
-
if (first) {
|
|
1263
|
-
return first(payload, ctx);
|
|
1264
|
-
}
|
|
1265
|
-
let async = false;
|
|
1266
|
-
const results = [];
|
|
1267
|
-
for (const option of def.options) {
|
|
1268
|
-
const result = option._zod.run({
|
|
1269
|
-
value: payload.value,
|
|
1270
|
-
issues: [],
|
|
1271
|
-
}, ctx);
|
|
1272
|
-
if (result instanceof Promise) {
|
|
1273
|
-
results.push(result);
|
|
1274
|
-
async = true;
|
|
1275
|
-
}
|
|
1276
|
-
else {
|
|
1277
|
-
results.push(result);
|
|
1278
|
-
}
|
|
1279
|
-
}
|
|
1280
|
-
if (!async)
|
|
1281
|
-
return handleExclusiveUnionResults(results, payload, inst, ctx);
|
|
1282
|
-
return Promise.all(results).then((results) => {
|
|
1283
|
-
return handleExclusiveUnionResults(results, payload, inst, ctx);
|
|
1284
|
-
});
|
|
1285
|
-
};
|
|
1286
|
-
});
|
|
1287
|
-
/** Returns the option of `union` whose discriminator claims `value`. */
|
|
1288
|
-
function getDiscriminatedOption(union, value) {
|
|
1289
|
-
const internals = union._zod;
|
|
1290
|
-
let map = internals.bag.optionsMap;
|
|
1291
|
-
if (!map) {
|
|
1292
|
-
map = new Map();
|
|
1293
|
-
const { options, discriminator } = internals.def;
|
|
1294
|
-
for (const option of options) {
|
|
1295
|
-
// First declaration wins, matching the order the parse path resolves a duplicate in.
|
|
1296
|
-
for (const v of option._zod.propValues?.[discriminator] ?? [])
|
|
1297
|
-
if (!map.has(v))
|
|
1298
|
-
map.set(v, option);
|
|
1299
|
-
}
|
|
1300
|
-
internals.bag.optionsMap = map;
|
|
1301
|
-
}
|
|
1302
|
-
return map.get(value);
|
|
1303
|
-
}
|
|
1304
|
-
exports.$ZodDiscriminatedUnion =
|
|
1305
|
-
/*@__PURE__*/
|
|
1306
|
-
core.$constructor("$ZodDiscriminatedUnion", (inst, def) => {
|
|
1307
|
-
def.inclusive = false;
|
|
1308
|
-
exports.$ZodUnion.init(inst, def);
|
|
1309
|
-
const _super = inst._zod.parse;
|
|
1310
|
-
util.defineLazyInternal(inst, "propValues", (zod) => {
|
|
1311
|
-
const propValues = {};
|
|
1312
|
-
for (const option of zod.def.options) {
|
|
1313
|
-
const pv = option._zod.propValues;
|
|
1314
|
-
if (!pv || Object.keys(pv).length === 0)
|
|
1315
|
-
throw new Error(`Invalid discriminated union option at index "${zod.def.options.indexOf(option)}"`);
|
|
1316
|
-
for (const [k, v] of Object.entries(pv)) {
|
|
1317
|
-
if (!Object.prototype.hasOwnProperty.call(propValues, k)) {
|
|
1318
|
-
util.assignProp(propValues, k, new Set());
|
|
1319
|
-
}
|
|
1320
|
-
for (const val of v) {
|
|
1321
|
-
propValues[k].add(val);
|
|
1322
|
-
}
|
|
1323
|
-
}
|
|
1324
|
-
}
|
|
1325
|
-
return propValues;
|
|
1326
|
-
});
|
|
1327
|
-
// 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, lazies, and objects rebuilt by a builder such as `.extend()` — are left to the map.
|
|
1328
|
-
def.options.forEach((option, i) => {
|
|
1329
|
-
const propShape = propShapes.get(option._zod.def);
|
|
1330
|
-
if (propShape && !Object.prototype.hasOwnProperty.call(propShape, def.discriminator)) {
|
|
1331
|
-
throw new Error(`Invalid discriminated union option at index "${i}"`);
|
|
1332
|
-
}
|
|
1333
|
-
});
|
|
1334
|
-
const disc = util.cached(() => {
|
|
1335
|
-
const opts = def.options;
|
|
1336
|
-
const map = new Map();
|
|
1337
|
-
for (const o of opts) {
|
|
1338
|
-
const values = o._zod.propValues?.[def.discriminator];
|
|
1339
|
-
if (!values || values.size === 0)
|
|
1340
|
-
throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(o)}"`);
|
|
1341
|
-
for (const v of values) {
|
|
1342
|
-
if (map.has(v)) {
|
|
1343
|
-
throw new Error(`Duplicate discriminator value "${String(v)}"`);
|
|
1344
|
-
}
|
|
1345
|
-
map.set(v, o);
|
|
1346
|
-
}
|
|
1347
|
-
}
|
|
1348
|
-
return map;
|
|
1349
|
-
});
|
|
1350
|
-
inst._zod.parse = (payload, ctx) => {
|
|
1351
|
-
const input = payload.value;
|
|
1352
|
-
if (!util.isObject(input)) {
|
|
1353
|
-
payload.issues.push({
|
|
1354
|
-
code: "invalid_type",
|
|
1355
|
-
expected: "object",
|
|
1356
|
-
input,
|
|
1357
|
-
inst,
|
|
1358
|
-
});
|
|
1359
|
-
return payload;
|
|
1360
|
-
}
|
|
1361
|
-
const opt = disc.value.get(input?.[def.discriminator]);
|
|
1362
|
-
if (opt) {
|
|
1363
|
-
return opt._zod.run(payload, ctx);
|
|
1364
|
-
}
|
|
1365
|
-
// Fall back to union matching when the fast discriminator path fails:
|
|
1366
|
-
// - explicitly enabled via unionFallback, or
|
|
1367
|
-
// - during backward direction (encode), since codec-based discriminators have different values in forward vs backward directions
|
|
1368
|
-
if (def.unionFallback || ctx.direction === "backward") {
|
|
1369
|
-
return _super(payload, ctx);
|
|
1370
|
-
}
|
|
1371
|
-
// no matching discriminator
|
|
1372
|
-
payload.issues.push({
|
|
1373
|
-
code: "invalid_union",
|
|
1374
|
-
errors: [],
|
|
1375
|
-
note: "No matching discriminator",
|
|
1376
|
-
discriminator: def.discriminator,
|
|
1377
|
-
options: Array.from(disc.value.keys()),
|
|
1378
|
-
input,
|
|
1379
|
-
path: [def.discriminator],
|
|
1380
|
-
inst,
|
|
1381
|
-
});
|
|
1382
|
-
return payload;
|
|
1383
|
-
};
|
|
1384
|
-
});
|
|
1385
|
-
exports.$ZodIntersection = core.$constructor("$ZodIntersection", (inst, def) => {
|
|
1386
|
-
exports.$ZodType.init(inst, def);
|
|
1387
|
-
inst._zod.parse = (payload, ctx) => {
|
|
1388
|
-
const input = payload.value;
|
|
1389
|
-
const left = def.left._zod.run({ value: input, issues: [] }, ctx);
|
|
1390
|
-
const right = def.right._zod.run({ value: input, issues: [] }, ctx);
|
|
1391
|
-
const async = left instanceof Promise || right instanceof Promise;
|
|
1392
|
-
if (async) {
|
|
1393
|
-
return Promise.all([left, right]).then(([left, right]) => {
|
|
1394
|
-
return handleIntersectionResults(payload, left, right);
|
|
1395
|
-
});
|
|
1396
|
-
}
|
|
1397
|
-
return handleIntersectionResults(payload, left, right);
|
|
1398
|
-
};
|
|
1399
|
-
});
|
|
1400
|
-
function mergeValues(a, b) {
|
|
1401
|
-
// const aType = parse.t(a);
|
|
1402
|
-
// const bType = parse.t(b);
|
|
1403
|
-
if (a === b) {
|
|
1404
|
-
return { valid: true, data: a };
|
|
1405
|
-
}
|
|
1406
|
-
if (a instanceof Date && b instanceof Date && +a === +b) {
|
|
1407
|
-
return { valid: true, data: a };
|
|
1408
|
-
}
|
|
1409
|
-
if (util.isPlainObject(a) && util.isPlainObject(b)) {
|
|
1410
|
-
const bKeys = Object.keys(b);
|
|
1411
|
-
const sharedKeys = Object.keys(a).filter((key) => bKeys.indexOf(key) !== -1);
|
|
1412
|
-
const newObj = { ...a, ...b };
|
|
1413
|
-
if (Object.prototype.hasOwnProperty.call(newObj, "__proto__"))
|
|
1414
|
-
delete newObj.__proto__;
|
|
1415
|
-
for (const key of sharedKeys) {
|
|
1416
|
-
if (key === "__proto__")
|
|
1417
|
-
continue;
|
|
1418
|
-
const sharedValue = mergeValues(a[key], b[key]);
|
|
1419
|
-
if (!sharedValue.valid) {
|
|
1420
|
-
return {
|
|
1421
|
-
valid: false,
|
|
1422
|
-
mergeErrorPath: [key, ...sharedValue.mergeErrorPath],
|
|
1423
|
-
};
|
|
1424
|
-
}
|
|
1425
|
-
newObj[key] = sharedValue.data;
|
|
1426
|
-
}
|
|
1427
|
-
return { valid: true, data: newObj };
|
|
1428
|
-
}
|
|
1429
|
-
if (Array.isArray(a) && Array.isArray(b)) {
|
|
1430
|
-
if (a.length !== b.length) {
|
|
1431
|
-
return { valid: false, mergeErrorPath: [] };
|
|
1432
|
-
}
|
|
1433
|
-
const newArray = [];
|
|
1434
|
-
for (let index = 0; index < a.length; index++) {
|
|
1435
|
-
const itemA = a[index];
|
|
1436
|
-
const itemB = b[index];
|
|
1437
|
-
const sharedValue = mergeValues(itemA, itemB);
|
|
1438
|
-
if (!sharedValue.valid) {
|
|
1439
|
-
return {
|
|
1440
|
-
valid: false,
|
|
1441
|
-
mergeErrorPath: [index, ...sharedValue.mergeErrorPath],
|
|
1442
|
-
};
|
|
1443
|
-
}
|
|
1444
|
-
newArray.push(sharedValue.data);
|
|
1445
|
-
}
|
|
1446
|
-
return { valid: true, data: newArray };
|
|
1447
|
-
}
|
|
1448
|
-
return { valid: false, mergeErrorPath: [] };
|
|
1449
|
-
}
|
|
1450
|
-
function handleIntersectionResults(result, left, right) {
|
|
1451
|
-
// Track which side(s) reject each key. A key rejection is reported only when BOTH sides reject it, so a key owned by one branch survives the other's key schema. strictObject reports these as unrecognized_keys; a record with an open key schema reports one invalid_key per key.
|
|
1452
|
-
const unrecKeys = new Map();
|
|
1453
|
-
let unrecIssue;
|
|
1454
|
-
const keyIssues = new Map();
|
|
1455
|
-
const collect = (iss, side) => {
|
|
1456
|
-
let keys;
|
|
1457
|
-
if (iss.code === "unrecognized_keys" && !iss.path?.length) {
|
|
1458
|
-
unrecIssue ?? (unrecIssue = iss);
|
|
1459
|
-
keys = iss.keys;
|
|
1460
|
-
}
|
|
1461
|
-
else if (iss.code === "invalid_key" && iss.origin === "record" && iss.path?.length === 1) {
|
|
1462
|
-
const k = String(iss.path[0]);
|
|
1463
|
-
if (!keyIssues.has(k))
|
|
1464
|
-
keyIssues.set(k, iss);
|
|
1465
|
-
keys = [k];
|
|
1466
|
-
}
|
|
1467
|
-
else {
|
|
1468
|
-
return false;
|
|
1469
|
-
}
|
|
1470
|
-
for (const k of keys) {
|
|
1471
|
-
if (!unrecKeys.has(k))
|
|
1472
|
-
unrecKeys.set(k, {});
|
|
1473
|
-
unrecKeys.get(k)[side] = true;
|
|
1474
|
-
}
|
|
1475
|
-
return true;
|
|
1476
|
-
};
|
|
1477
|
-
for (const iss of left.issues) {
|
|
1478
|
-
if (!collect(iss, "l"))
|
|
1479
|
-
result.issues.push(iss);
|
|
1480
|
-
}
|
|
1481
|
-
for (const iss of right.issues) {
|
|
1482
|
-
if (!collect(iss, "r"))
|
|
1483
|
-
result.issues.push(iss);
|
|
1484
|
-
}
|
|
1485
|
-
// Report only keys rejected by BOTH sides
|
|
1486
|
-
const bothKeys = [...unrecKeys].filter(([, f]) => f.l && f.r).map(([k]) => k);
|
|
1487
|
-
if (bothKeys.length) {
|
|
1488
|
-
const aggregated = unrecIssue ? bothKeys.filter((k) => unrecIssue.keys.includes(k)) : [];
|
|
1489
|
-
if (aggregated.length)
|
|
1490
|
-
result.issues.push({ ...unrecIssue, keys: aggregated });
|
|
1491
|
-
for (const k of bothKeys) {
|
|
1492
|
-
if (!aggregated.includes(k) && keyIssues.has(k))
|
|
1493
|
-
result.issues.push(keyIssues.get(k));
|
|
1494
|
-
}
|
|
1495
|
-
}
|
|
1496
|
-
const merged = mergeValues(left.value, right.value);
|
|
1497
|
-
if (!merged.valid) {
|
|
1498
|
-
if (util.aborted(result))
|
|
1499
|
-
return result;
|
|
1500
|
-
throw new Error(`Unmergable intersection. Error path: ` + `${JSON.stringify(merged.mergeErrorPath)}`);
|
|
1501
|
-
}
|
|
1502
|
-
result.value = merged.data;
|
|
1503
|
-
return result;
|
|
1504
|
-
}
|
|
1505
|
-
exports.$ZodTuple = core.$constructor("$ZodTuple", (inst, def) => {
|
|
1506
|
-
exports.$ZodType.init(inst, def);
|
|
1507
|
-
const items = def.items;
|
|
1508
|
-
const memo = core.globalConfig.memoizer;
|
|
1509
|
-
memo?.attach(inst);
|
|
1510
|
-
inst._zod.parse = (payload, ctx) => {
|
|
1511
|
-
const input = payload.value;
|
|
1512
|
-
if (!Array.isArray(input)) {
|
|
1513
|
-
payload.issues.push({
|
|
1514
|
-
input,
|
|
1515
|
-
inst,
|
|
1516
|
-
expected: "tuple",
|
|
1517
|
-
code: "invalid_type",
|
|
1518
|
-
});
|
|
1519
|
-
return payload;
|
|
1520
|
-
}
|
|
1521
|
-
payload.value = memo ? memo.alloc(inst, payload, [], ctx) : [];
|
|
1522
|
-
const proms = [];
|
|
1523
|
-
const optinStart = getTupleOptStart(items, "optin");
|
|
1524
|
-
const optoutStart = getTupleOptStart(items, "optout");
|
|
1525
|
-
if (!def.rest) {
|
|
1526
|
-
if (input.length < optinStart) {
|
|
1527
|
-
payload.issues.push({
|
|
1528
|
-
code: "too_small",
|
|
1529
|
-
minimum: optinStart,
|
|
1530
|
-
inclusive: true,
|
|
1531
|
-
input,
|
|
1532
|
-
inst,
|
|
1533
|
-
origin: "array",
|
|
1534
|
-
});
|
|
1535
|
-
return payload;
|
|
1536
|
-
}
|
|
1537
|
-
if (input.length > items.length) {
|
|
1538
|
-
payload.issues.push({
|
|
1539
|
-
code: "too_big",
|
|
1540
|
-
maximum: items.length,
|
|
1541
|
-
inclusive: true,
|
|
1542
|
-
input,
|
|
1543
|
-
inst,
|
|
1544
|
-
origin: "array",
|
|
1545
|
-
});
|
|
1546
|
-
}
|
|
1547
|
-
}
|
|
1548
|
-
// 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.
|
|
1549
|
-
const itemResults = new Array(items.length);
|
|
1550
|
-
for (let i = 0; i < items.length; i++) {
|
|
1551
|
-
const r = items[i]._zod.run({ value: input[i], issues: [] }, ctx);
|
|
1552
|
-
if (r instanceof Promise) {
|
|
1553
|
-
proms.push(r.then((rr) => {
|
|
1554
|
-
itemResults[i] = rr;
|
|
1555
|
-
}));
|
|
1556
|
-
}
|
|
1557
|
-
else {
|
|
1558
|
-
itemResults[i] = r;
|
|
1559
|
-
}
|
|
1560
|
-
}
|
|
1561
|
-
if (def.rest) {
|
|
1562
|
-
let i = items.length - 1;
|
|
1563
|
-
const rest = input.slice(items.length);
|
|
1564
|
-
for (const el of rest) {
|
|
1565
|
-
i++;
|
|
1566
|
-
const result = def.rest._zod.run({ value: el, issues: [] }, ctx);
|
|
1567
|
-
if (result instanceof Promise) {
|
|
1568
|
-
proms.push(result.then((r) => handleTupleResult(r, payload, i)));
|
|
1569
|
-
}
|
|
1570
|
-
else {
|
|
1571
|
-
handleTupleResult(result, payload, i);
|
|
1572
|
-
}
|
|
1573
|
-
}
|
|
1574
|
-
}
|
|
1575
|
-
if (proms.length) {
|
|
1576
|
-
return Promise.all(proms).then(() => handleTupleResults(itemResults, payload, items, input, optoutStart));
|
|
1577
|
-
}
|
|
1578
|
-
return handleTupleResults(itemResults, payload, items, input, optoutStart);
|
|
1579
|
-
};
|
|
1580
|
-
});
|
|
1581
|
-
function getTupleOptStart(items, key) {
|
|
1582
|
-
for (let i = items.length - 1; i >= 0; i--) {
|
|
1583
|
-
// optin is a three-rung ladder so any rung above `undefined` permits an absent slot; optout stays two-valued.
|
|
1584
|
-
const omittable = key === "optin" ? items[i]._zod.optin !== undefined : items[i]._zod.optout === "optional";
|
|
1585
|
-
if (!omittable)
|
|
1586
|
-
return i + 1;
|
|
1587
|
-
}
|
|
1588
|
-
return 0;
|
|
1589
|
-
}
|
|
1590
|
-
function handleTupleResult(result, final, index) {
|
|
1591
|
-
if (result.issues.length) {
|
|
1592
|
-
final.issues.push(...util.prefixIssues(index, result.issues));
|
|
1593
|
-
}
|
|
1594
|
-
final.value[index] = result.value;
|
|
1595
|
-
}
|
|
1596
|
-
function handleTupleResults(itemResults, final, items, input, optoutStart) {
|
|
1597
|
-
// Walk results in order. Mirror $ZodObject's swallow-on-absent-optional rule, but only after `optoutStart`: the first index where the output tuple tail can be absent.
|
|
1598
|
-
for (let i = 0; i < items.length; i++) {
|
|
1599
|
-
const r = itemResults[i];
|
|
1600
|
-
const isPresent = i < input.length;
|
|
1601
|
-
// The array analog of `handlePropertyResult`'s absent-key early return: the middle rung permits absence without supplying anything in its place, so the tail truncates here instead of materializing whatever the item made of `undefined`.
|
|
1602
|
-
if (!isPresent && i >= optoutStart && items[i]._zod.optin === "optional") {
|
|
1603
|
-
final.value.length = i;
|
|
1604
|
-
break;
|
|
1605
|
-
}
|
|
1606
|
-
if (r.issues.length) {
|
|
1607
|
-
if (!isPresent && i >= optoutStart) {
|
|
1608
|
-
final.value.length = i;
|
|
1609
|
-
break;
|
|
1610
|
-
}
|
|
1611
|
-
final.issues.push(...util.prefixIssues(i, r.issues));
|
|
1612
|
-
}
|
|
1613
|
-
final.value[i] = r.value;
|
|
1614
|
-
}
|
|
1615
|
-
// Drop trailing slots that produced `undefined` for absent input
|
|
1616
|
-
// (the array analog of an absent optional key on an object). The
|
|
1617
|
-
// `i >= input.length` floor is critical: an explicit `undefined`
|
|
1618
|
-
// *inside* the input must be preserved even when the schema is
|
|
1619
|
-
// optional-out (e.g. `z.string().or(z.undefined())` accepting an
|
|
1620
|
-
// explicit undefined value).
|
|
1621
|
-
for (let i = final.value.length - 1; i >= input.length; i--) {
|
|
1622
|
-
if (items[i]._zod.optout === "optional" && final.value[i] === undefined) {
|
|
1623
|
-
final.value.length = i;
|
|
1624
|
-
}
|
|
1625
|
-
else {
|
|
1626
|
-
break;
|
|
1627
|
-
}
|
|
1628
|
-
}
|
|
1629
|
-
return final;
|
|
1630
|
-
}
|
|
1631
|
-
exports.$ZodRecord = core.$constructor("$ZodRecord", (inst, def) => {
|
|
1632
|
-
exports.$ZodType.init(inst, def);
|
|
1633
|
-
const memo = core.globalConfig.memoizer;
|
|
1634
|
-
memo?.attach(inst);
|
|
1635
|
-
inst._zod.parse = (payload, ctx) => {
|
|
1636
|
-
const input = payload.value;
|
|
1637
|
-
if (!util.isPlainObject(input)) {
|
|
1638
|
-
payload.issues.push({
|
|
1639
|
-
expected: "record",
|
|
1640
|
-
code: "invalid_type",
|
|
1641
|
-
input,
|
|
1642
|
-
inst,
|
|
1643
|
-
});
|
|
1644
|
-
return payload;
|
|
1645
|
-
}
|
|
1646
|
-
const proms = [];
|
|
1647
|
-
const values = def.keyType._zod.values;
|
|
1648
|
-
if (values && !def.partial) {
|
|
1649
|
-
payload.value = memo ? memo.alloc(inst, payload, {}, ctx) : {};
|
|
1650
|
-
const recordKeys = new Set();
|
|
1651
|
-
for (const key of values) {
|
|
1652
|
-
if (typeof key === "string" || typeof key === "number" || typeof key === "symbol") {
|
|
1653
|
-
recordKeys.add(typeof key === "number" ? key.toString() : key);
|
|
1654
|
-
// A declared __proto__ is stripped but is not an unrecognized key.
|
|
1655
|
-
if (key === "__proto__")
|
|
1656
|
-
continue;
|
|
1657
|
-
const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
|
|
1658
|
-
if (keyResult instanceof Promise) {
|
|
1659
|
-
throw new Error("Async schemas not supported in object keys currently");
|
|
1660
|
-
}
|
|
1661
|
-
if (keyResult.issues.length) {
|
|
1662
|
-
payload.issues.push({
|
|
1663
|
-
code: "invalid_key",
|
|
1664
|
-
origin: "record",
|
|
1665
|
-
issues: keyResult.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),
|
|
1666
|
-
input: key,
|
|
1667
|
-
path: [key],
|
|
1668
|
-
inst,
|
|
1669
|
-
});
|
|
1670
|
-
continue;
|
|
1671
|
-
}
|
|
1672
|
-
const outKey = keyResult.value;
|
|
1673
|
-
if (outKey === "__proto__")
|
|
1674
|
-
continue;
|
|
1675
|
-
const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);
|
|
1676
|
-
if (result instanceof Promise) {
|
|
1677
|
-
proms.push(result.then((result) => {
|
|
1678
|
-
if (result.issues.length) {
|
|
1679
|
-
payload.issues.push(...util.prefixIssues(key, result.issues));
|
|
1680
|
-
}
|
|
1681
|
-
payload.value[outKey] = result.value;
|
|
1682
|
-
}));
|
|
1683
|
-
}
|
|
1684
|
-
else {
|
|
1685
|
-
if (result.issues.length) {
|
|
1686
|
-
payload.issues.push(...util.prefixIssues(key, result.issues));
|
|
1687
|
-
}
|
|
1688
|
-
payload.value[outKey] = result.value;
|
|
1689
|
-
}
|
|
1690
|
-
}
|
|
1691
|
-
}
|
|
1692
|
-
let unrecognized;
|
|
1693
|
-
for (const key in input) {
|
|
1694
|
-
if (!recordKeys.has(key)) {
|
|
1695
|
-
if (def.mode === "loose") {
|
|
1696
|
-
// skip __proto__ so it can't replace the result prototype via the assignment setter on the plain {} we build into
|
|
1697
|
-
if (key === "__proto__")
|
|
1698
|
-
continue;
|
|
1699
|
-
payload.value[key] = input[key];
|
|
1700
|
-
}
|
|
1701
|
-
else {
|
|
1702
|
-
unrecognized = unrecognized ?? [];
|
|
1703
|
-
unrecognized.push(key);
|
|
1704
|
-
}
|
|
1705
|
-
}
|
|
1706
|
-
}
|
|
1707
|
-
if (unrecognized && unrecognized.length > 0) {
|
|
1708
|
-
payload.issues.push({
|
|
1709
|
-
code: "unrecognized_keys",
|
|
1710
|
-
input,
|
|
1711
|
-
inst,
|
|
1712
|
-
keys: unrecognized,
|
|
1713
|
-
continue: true,
|
|
1714
|
-
});
|
|
1715
|
-
}
|
|
1716
|
-
}
|
|
1717
|
-
else {
|
|
1718
|
-
payload.value = memo ? memo.alloc(inst, payload, {}, ctx) : {};
|
|
1719
|
-
// An enumerable key schema declares which keys the record owns, so a key outside the set is unrecognized. A non-enumerable one (regex, refine) is a constraint every key must satisfy, so a failing key is invalid. Only the former is reconcilable against the other side of an intersection.
|
|
1720
|
-
let unrecognized;
|
|
1721
|
-
// Reflect.ownKeys for Symbol-key support; filter non-enumerable to match z.object()
|
|
1722
|
-
for (const key of Reflect.ownKeys(input)) {
|
|
1723
|
-
if (key === "__proto__")
|
|
1724
|
-
continue;
|
|
1725
|
-
if (!Object.prototype.propertyIsEnumerable.call(input, key))
|
|
1726
|
-
continue;
|
|
1727
|
-
let keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
|
|
1728
|
-
if (keyResult instanceof Promise) {
|
|
1729
|
-
throw new Error("Async schemas not supported in object keys currently");
|
|
1730
|
-
}
|
|
1731
|
-
// Numeric string fallback: if key is a numeric string and failed, retry with Number(key). This handles z.number(), z.literal([1, 2, 3]), and unions containing numeric literals
|
|
1732
|
-
const checkNumericKey = typeof key === "string" && regexes.number.test(key) && keyResult.issues.length;
|
|
1733
|
-
if (checkNumericKey) {
|
|
1734
|
-
const retryResult = def.keyType._zod.run({ value: Number(key), issues: [] }, ctx);
|
|
1735
|
-
if (retryResult instanceof Promise) {
|
|
1736
|
-
throw new Error("Async schemas not supported in object keys currently");
|
|
1737
|
-
}
|
|
1738
|
-
if (retryResult.issues.length === 0) {
|
|
1739
|
-
keyResult = retryResult;
|
|
1740
|
-
}
|
|
1741
|
-
}
|
|
1742
|
-
if (keyResult.issues.length) {
|
|
1743
|
-
if (def.mode === "loose") {
|
|
1744
|
-
// Pass through unchanged
|
|
1745
|
-
payload.value[key] = input[key];
|
|
1746
|
-
}
|
|
1747
|
-
else if (values) {
|
|
1748
|
-
unrecognized = unrecognized ?? [];
|
|
1749
|
-
unrecognized.push(key);
|
|
1750
|
-
}
|
|
1751
|
-
else {
|
|
1752
|
-
// Default "strict" behavior: error on invalid key
|
|
1753
|
-
payload.issues.push({
|
|
1754
|
-
code: "invalid_key",
|
|
1755
|
-
origin: "record",
|
|
1756
|
-
issues: keyResult.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),
|
|
1757
|
-
input: key,
|
|
1758
|
-
path: [key],
|
|
1759
|
-
inst,
|
|
1760
|
-
});
|
|
1761
|
-
}
|
|
1762
|
-
continue;
|
|
1763
|
-
}
|
|
1764
|
-
// the guard above tests the raw input key, but the key schema can normalize an ordinary key into __proto__; re-check the key we actually write under
|
|
1765
|
-
const outKey = keyResult.value;
|
|
1766
|
-
if (outKey === "__proto__")
|
|
1767
|
-
continue;
|
|
1768
|
-
const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);
|
|
1769
|
-
if (result instanceof Promise) {
|
|
1770
|
-
proms.push(result.then((result) => {
|
|
1771
|
-
if (result.issues.length) {
|
|
1772
|
-
payload.issues.push(...util.prefixIssues(key, result.issues));
|
|
1773
|
-
}
|
|
1774
|
-
payload.value[outKey] = result.value;
|
|
1775
|
-
}));
|
|
1776
|
-
}
|
|
1777
|
-
else {
|
|
1778
|
-
if (result.issues.length) {
|
|
1779
|
-
payload.issues.push(...util.prefixIssues(key, result.issues));
|
|
1780
|
-
}
|
|
1781
|
-
payload.value[outKey] = result.value;
|
|
1782
|
-
}
|
|
1783
|
-
}
|
|
1784
|
-
if (unrecognized && unrecognized.length > 0) {
|
|
1785
|
-
payload.issues.push({
|
|
1786
|
-
code: "unrecognized_keys",
|
|
1787
|
-
input,
|
|
1788
|
-
inst,
|
|
1789
|
-
keys: unrecognized,
|
|
1790
|
-
continue: true,
|
|
1791
|
-
});
|
|
1792
|
-
}
|
|
1793
|
-
}
|
|
1794
|
-
if (proms.length) {
|
|
1795
|
-
return Promise.all(proms).then(() => payload);
|
|
1796
|
-
}
|
|
1797
|
-
return payload;
|
|
1798
|
-
};
|
|
1799
|
-
});
|
|
1800
|
-
exports.$ZodMap = core.$constructor("$ZodMap", (inst, def) => {
|
|
1801
|
-
exports.$ZodType.init(inst, def);
|
|
1802
|
-
const memo = core.globalConfig.memoizer;
|
|
1803
|
-
memo?.attach(inst);
|
|
1804
|
-
inst._zod.parse = (payload, ctx) => {
|
|
1805
|
-
const input = payload.value;
|
|
1806
|
-
if (!(input instanceof Map)) {
|
|
1807
|
-
payload.issues.push({
|
|
1808
|
-
expected: "map",
|
|
1809
|
-
code: "invalid_type",
|
|
1810
|
-
input,
|
|
1811
|
-
inst,
|
|
1812
|
-
});
|
|
1813
|
-
return payload;
|
|
1814
|
-
}
|
|
1815
|
-
const proms = [];
|
|
1816
|
-
payload.value = memo ? memo.alloc(inst, payload, new Map(), ctx) : new Map();
|
|
1817
|
-
for (const [key, value] of input) {
|
|
1818
|
-
const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
|
|
1819
|
-
const valueResult = def.valueType._zod.run({ value: value, issues: [] }, ctx);
|
|
1820
|
-
if (keyResult instanceof Promise || valueResult instanceof Promise) {
|
|
1821
|
-
proms.push(Promise.all([keyResult, valueResult]).then(([keyResult, valueResult]) => {
|
|
1822
|
-
handleMapResult(keyResult, valueResult, payload, key, input, inst, ctx);
|
|
1823
|
-
}));
|
|
1824
|
-
}
|
|
1825
|
-
else {
|
|
1826
|
-
handleMapResult(keyResult, valueResult, payload, key, input, inst, ctx);
|
|
1827
|
-
}
|
|
1828
|
-
}
|
|
1829
|
-
if (proms.length)
|
|
1830
|
-
return Promise.all(proms).then(() => payload);
|
|
1831
|
-
return payload;
|
|
1832
|
-
};
|
|
1833
|
-
});
|
|
1834
|
-
function handleMapResult(keyResult, valueResult, final, key, input, inst, ctx) {
|
|
1835
|
-
if (keyResult.issues.length) {
|
|
1836
|
-
if (util.propertyKeyTypes.has(typeof key)) {
|
|
1837
|
-
final.issues.push(...util.prefixIssues(key, keyResult.issues));
|
|
1838
|
-
}
|
|
1839
|
-
else {
|
|
1840
|
-
final.issues.push({
|
|
1841
|
-
code: "invalid_key",
|
|
1842
|
-
origin: "map",
|
|
1843
|
-
input,
|
|
1844
|
-
inst,
|
|
1845
|
-
issues: keyResult.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),
|
|
1846
|
-
});
|
|
1847
|
-
}
|
|
1848
|
-
}
|
|
1849
|
-
if (valueResult.issues.length) {
|
|
1850
|
-
if (util.propertyKeyTypes.has(typeof key)) {
|
|
1851
|
-
final.issues.push(...util.prefixIssues(key, valueResult.issues));
|
|
1852
|
-
}
|
|
1853
|
-
else {
|
|
1854
|
-
final.issues.push({
|
|
1855
|
-
origin: "map",
|
|
1856
|
-
code: "invalid_element",
|
|
1857
|
-
input,
|
|
1858
|
-
inst,
|
|
1859
|
-
key: key,
|
|
1860
|
-
issues: valueResult.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),
|
|
1861
|
-
});
|
|
1862
|
-
}
|
|
1863
|
-
}
|
|
1864
|
-
final.value.set(keyResult.value, valueResult.value);
|
|
1865
|
-
}
|
|
1866
|
-
exports.$ZodSet = core.$constructor("$ZodSet", (inst, def) => {
|
|
1867
|
-
exports.$ZodType.init(inst, def);
|
|
1868
|
-
const memo = core.globalConfig.memoizer;
|
|
1869
|
-
memo?.attach(inst);
|
|
1870
|
-
inst._zod.parse = (payload, ctx) => {
|
|
1871
|
-
const input = payload.value;
|
|
1872
|
-
if (!(input instanceof Set)) {
|
|
1873
|
-
payload.issues.push({
|
|
1874
|
-
input,
|
|
1875
|
-
inst,
|
|
1876
|
-
expected: "set",
|
|
1877
|
-
code: "invalid_type",
|
|
1878
|
-
});
|
|
1879
|
-
return payload;
|
|
1880
|
-
}
|
|
1881
|
-
const proms = [];
|
|
1882
|
-
payload.value = memo ? memo.alloc(inst, payload, new Set(), ctx) : new Set();
|
|
1883
|
-
for (const item of input) {
|
|
1884
|
-
const result = def.valueType._zod.run({ value: item, issues: [] }, ctx);
|
|
1885
|
-
if (result instanceof Promise) {
|
|
1886
|
-
proms.push(result.then((result) => handleSetResult(result, payload)));
|
|
1887
|
-
}
|
|
1888
|
-
else
|
|
1889
|
-
handleSetResult(result, payload);
|
|
1890
|
-
}
|
|
1891
|
-
if (proms.length)
|
|
1892
|
-
return Promise.all(proms).then(() => payload);
|
|
1893
|
-
return payload;
|
|
1894
|
-
};
|
|
1895
|
-
});
|
|
1896
|
-
function handleSetResult(result, final) {
|
|
1897
|
-
if (result.issues.length) {
|
|
1898
|
-
final.issues.push(...result.issues);
|
|
1899
|
-
}
|
|
1900
|
-
final.value.add(result.value);
|
|
1901
|
-
}
|
|
1902
|
-
exports.$ZodEnum = core.$constructor("$ZodEnum", (inst, def) => {
|
|
1903
|
-
exports.$ZodType.init(inst, def);
|
|
1904
|
-
const values = util.getEnumValues(def.entries);
|
|
1905
|
-
const valuesSet = new Set(values);
|
|
1906
|
-
inst._zod.values = valuesSet;
|
|
1907
|
-
const patternValues = values.filter((k) => util.propertyKeyTypes.has(typeof k));
|
|
1908
|
-
// unmatchable fallback, RE2-safe: an empty alternation would compile to /^()$/, which matches ""
|
|
1909
|
-
inst._zod.pattern = new RegExp(patternValues.length ? `^(${patternValues.map((o) => util.escapeRegex(o.toString())).join("|")})$` : "^[^\\s\\S]$");
|
|
1910
|
-
inst._zod.parse = (payload, _ctx) => {
|
|
1911
|
-
const input = payload.value;
|
|
1912
|
-
if (valuesSet.has(input)) {
|
|
1913
|
-
return payload;
|
|
1914
|
-
}
|
|
1915
|
-
payload.issues.push({
|
|
1916
|
-
code: "invalid_value",
|
|
1917
|
-
values,
|
|
1918
|
-
input,
|
|
1919
|
-
inst,
|
|
1920
|
-
});
|
|
1921
|
-
return payload;
|
|
1922
|
-
};
|
|
1923
|
-
});
|
|
1924
|
-
exports.$ZodLiteral = core.$constructor("$ZodLiteral", (inst, def) => {
|
|
1925
|
-
exports.$ZodType.init(inst, def);
|
|
1926
|
-
const values = new Set(def.values);
|
|
1927
|
-
inst._zod.values = values;
|
|
1928
|
-
// unmatchable fallback, RE2-safe: an empty alternation would compile to /^()$/, which matches ""
|
|
1929
|
-
inst._zod.pattern = new RegExp(def.values.length
|
|
1930
|
-
? `^(${def.values
|
|
1931
|
-
.map((o) => (typeof o === "string" ? util.escapeRegex(o) : o ? util.escapeRegex(o.toString()) : String(o)))
|
|
1932
|
-
.join("|")})$`
|
|
1933
|
-
: "^[^\\s\\S]$");
|
|
1934
|
-
inst._zod.parse = (payload, _ctx) => {
|
|
1935
|
-
const input = payload.value;
|
|
1936
|
-
if (values.has(input)) {
|
|
1937
|
-
return payload;
|
|
1938
|
-
}
|
|
1939
|
-
payload.issues.push({
|
|
1940
|
-
code: "invalid_value",
|
|
1941
|
-
values: def.values,
|
|
1942
|
-
input,
|
|
1943
|
-
inst,
|
|
1944
|
-
});
|
|
1945
|
-
return payload;
|
|
1946
|
-
};
|
|
1947
|
-
});
|
|
1948
|
-
exports.$ZodFile = core.$constructor("$ZodFile", (inst, def) => {
|
|
1949
|
-
exports.$ZodType.init(inst, def);
|
|
1950
|
-
inst._zod.parse = (payload, _ctx) => {
|
|
1951
|
-
const input = payload.value;
|
|
1952
|
-
// @ts-ignore
|
|
1953
|
-
if (input instanceof File)
|
|
1954
|
-
return payload;
|
|
1955
|
-
payload.issues.push({
|
|
1956
|
-
expected: "file",
|
|
1957
|
-
code: "invalid_type",
|
|
1958
|
-
input,
|
|
1959
|
-
inst,
|
|
1960
|
-
});
|
|
1961
|
-
return payload;
|
|
1962
|
-
};
|
|
1963
|
-
});
|
|
1964
|
-
exports.$ZodTransform = core.$constructor("$ZodTransform", (inst, def) => {
|
|
1965
|
-
exports.$ZodType.init(inst, def);
|
|
1966
|
-
inst._zod.optin = "optional";
|
|
1967
|
-
core.globalConfig.memoizer?.guard(inst);
|
|
1968
|
-
inst._zod.parse = (payload, ctx) => {
|
|
1969
|
-
if (ctx.direction === "backward") {
|
|
1970
|
-
throw new core.$ZodEncodeError(inst.constructor.name);
|
|
1971
|
-
}
|
|
1972
|
-
const _out = def.transform(payload.value, payload);
|
|
1973
|
-
if (ctx.async) {
|
|
1974
|
-
const output = _out instanceof Promise ? _out : Promise.resolve(_out);
|
|
1975
|
-
return output.then((output) => {
|
|
1976
|
-
payload.value = output;
|
|
1977
|
-
return payload;
|
|
1978
|
-
});
|
|
1979
|
-
}
|
|
1980
|
-
if (_out instanceof Promise) {
|
|
1981
|
-
throw new core.$ZodAsyncError();
|
|
1982
|
-
}
|
|
1983
|
-
payload.value = _out;
|
|
1984
|
-
return payload;
|
|
1985
|
-
};
|
|
1986
|
-
});
|
|
1987
|
-
function handleOptionalResult(payload, result) {
|
|
1988
|
-
// A substituting schema that still failed has no usable answer; yield undefined. Its issues are simply dropped: it ran on a payload of its own, so there is no shared array to truncate and nothing of the caller's to lose with it.
|
|
1989
|
-
payload.value = result.issues.length ? undefined : result.value;
|
|
1990
|
-
return payload;
|
|
1991
|
-
}
|
|
1992
|
-
exports.$ZodOptional = core.$constructor("$ZodOptional", (inst, def) => {
|
|
1993
|
-
exports.$ZodType.init(inst, def);
|
|
1994
|
-
// .optional() propagates absence rather than substituting for it, so a defaulted inner keeps its rung.
|
|
1995
|
-
util.defineLazyInternal(inst, "optin", (zod) => zod.def.innerType._zod.optin === "defaulted" ? "defaulted" : "optional");
|
|
1996
|
-
inst._zod.optout = "optional";
|
|
1997
|
-
util.defineLazyInternal(inst, "values", (zod) => {
|
|
1998
|
-
const values = zod.def.innerType._zod.values;
|
|
1999
|
-
return values ? new Set([...values, undefined]) : undefined;
|
|
2000
|
-
});
|
|
2001
|
-
util.defineLazyInternal(inst, "pattern", (zod) => {
|
|
2002
|
-
const pattern = zod.def.innerType._zod.pattern;
|
|
2003
|
-
return pattern ? new RegExp(`^(${util.cleanRegex(pattern.source)})?$`) : undefined;
|
|
2004
|
-
});
|
|
2005
|
-
inst._zod.parse = (payload, ctx) => {
|
|
2006
|
-
if (payload.value === undefined) {
|
|
2007
|
-
// Only the top rung substitutes a value for absence; everything else leaves it intact, which is what .optional() means.
|
|
2008
|
-
if (def.innerType._zod.optin !== "defaulted")
|
|
2009
|
-
return payload;
|
|
2010
|
-
// Its own payload, for the same reason $ZodCatch gets one: a pipe forwards an unrecognized key through the caller's issues array, and this must not read that as the substituting schema failing and drop it.
|
|
2011
|
-
const result = def.innerType._zod.run({ value: payload.value, issues: [] }, ctx);
|
|
2012
|
-
if (result instanceof Promise)
|
|
2013
|
-
return result.then((result) => handleOptionalResult(payload, result));
|
|
2014
|
-
return handleOptionalResult(payload, result);
|
|
2015
|
-
}
|
|
2016
|
-
return def.innerType._zod.run(payload, ctx);
|
|
2017
|
-
};
|
|
2018
|
-
});
|
|
2019
|
-
exports.$ZodExactOptional = core.$constructor("$ZodExactOptional", (inst, def) => {
|
|
2020
|
-
// Call parent init - inherits optin/optout = "optional"
|
|
2021
|
-
exports.$ZodOptional.init(inst, def);
|
|
2022
|
-
// Override values/pattern to NOT add undefined
|
|
2023
|
-
util.defineLazyInternal(inst, "values", (zod) => zod.def.innerType._zod.values);
|
|
2024
|
-
util.defineLazyInternal(inst, "pattern", (zod) => zod.def.innerType._zod.pattern);
|
|
2025
|
-
// Override parse to just delegate (no undefined handling)
|
|
2026
|
-
inst._zod.parse = (payload, ctx) => {
|
|
2027
|
-
return def.innerType._zod.run(payload, ctx);
|
|
2028
|
-
};
|
|
2029
|
-
});
|
|
2030
|
-
exports.$ZodNullable = core.$constructor("$ZodNullable", (inst, def) => {
|
|
2031
|
-
exports.$ZodType.init(inst, def);
|
|
2032
|
-
util.defineLazyInternal(inst, "optin", (zod) => zod.def.innerType._zod.optin);
|
|
2033
|
-
util.defineLazyInternal(inst, "optout", (zod) => zod.def.innerType._zod.optout);
|
|
2034
|
-
util.defineLazyInternal(inst, "pattern", (zod) => {
|
|
2035
|
-
const pattern = zod.def.innerType._zod.pattern;
|
|
2036
|
-
return pattern ? new RegExp(`^(${util.cleanRegex(pattern.source)}|null)$`) : undefined;
|
|
2037
|
-
});
|
|
2038
|
-
util.defineLazyInternal(inst, "values", (zod) => {
|
|
2039
|
-
return zod.def.innerType._zod.values ? new Set([...zod.def.innerType._zod.values, null]) : undefined;
|
|
2040
|
-
});
|
|
2041
|
-
inst._zod.parse = (payload, ctx) => {
|
|
2042
|
-
// Forward direction (decode): allow null to pass through
|
|
2043
|
-
if (payload.value === null)
|
|
2044
|
-
return payload;
|
|
2045
|
-
return def.innerType._zod.run(payload, ctx);
|
|
2046
|
-
};
|
|
2047
|
-
});
|
|
2048
|
-
exports.$ZodDefault = core.$constructor("$ZodDefault", (inst, def) => {
|
|
2049
|
-
exports.$ZodType.init(inst, def);
|
|
2050
|
-
// inst._zod.qin = "true";
|
|
2051
|
-
inst._zod.optin = "defaulted";
|
|
2052
|
-
util.defineLazyInternal(inst, "values", (zod) => zod.def.innerType._zod.values);
|
|
2053
|
-
inst._zod.parse = (payload, ctx) => {
|
|
2054
|
-
if (ctx.direction === "backward") {
|
|
2055
|
-
return def.innerType._zod.run(payload, ctx);
|
|
2056
|
-
}
|
|
2057
|
-
// Forward direction (decode): apply defaults for undefined input
|
|
2058
|
-
if (payload.value === undefined) {
|
|
2059
|
-
payload.value = def.defaultValue;
|
|
2060
|
-
/**
|
|
2061
|
-
* $ZodDefault returns the default value immediately in forward direction.
|
|
2062
|
-
* It doesn't pass the default value into the validator ("prefault"). There's no reason to pass the default value through validation. The validity of the default is enforced by TypeScript statically. Otherwise, it's the responsibility of the user to ensure the default is valid. In the case of pipes with divergent in/out types, you can specify the default on the `in` schema of your ZodPipe to set a "prefault" for the pipe. */
|
|
2063
|
-
return payload;
|
|
2064
|
-
}
|
|
2065
|
-
// Forward direction: continue with default handling
|
|
2066
|
-
const result = def.innerType._zod.run(payload, ctx);
|
|
2067
|
-
if (result instanceof Promise) {
|
|
2068
|
-
return result.then((result) => handleDefaultResult(result, def));
|
|
2069
|
-
}
|
|
2070
|
-
return handleDefaultResult(result, def);
|
|
2071
|
-
};
|
|
2072
|
-
});
|
|
2073
|
-
function handleDefaultResult(payload, def) {
|
|
2074
|
-
if (payload.value === undefined) {
|
|
2075
|
-
payload.value = def.defaultValue;
|
|
2076
|
-
}
|
|
2077
|
-
return payload;
|
|
2078
|
-
}
|
|
2079
|
-
exports.$ZodPrefault = core.$constructor("$ZodPrefault", (inst, def) => {
|
|
2080
|
-
exports.$ZodType.init(inst, def);
|
|
2081
|
-
inst._zod.optin = "defaulted";
|
|
2082
|
-
util.defineLazyInternal(inst, "values", (zod) => zod.def.innerType._zod.values);
|
|
2083
|
-
inst._zod.parse = (payload, ctx) => {
|
|
2084
|
-
if (ctx.direction === "backward") {
|
|
2085
|
-
return def.innerType._zod.run(payload, ctx);
|
|
2086
|
-
}
|
|
2087
|
-
// Forward direction (decode): apply prefault for undefined input
|
|
2088
|
-
if (payload.value === undefined) {
|
|
2089
|
-
payload.value = def.defaultValue;
|
|
2090
|
-
}
|
|
2091
|
-
return def.innerType._zod.run(payload, ctx);
|
|
2092
|
-
};
|
|
2093
|
-
});
|
|
2094
|
-
exports.$ZodNonOptional = core.$constructor("$ZodNonOptional", (inst, def) => {
|
|
2095
|
-
exports.$ZodType.init(inst, def);
|
|
2096
|
-
util.defineLazyInternal(inst, "values", (zod) => {
|
|
2097
|
-
const v = zod.def.innerType._zod.values;
|
|
2098
|
-
return v ? new Set([...v].filter((x) => x !== undefined)) : undefined;
|
|
2099
|
-
});
|
|
2100
|
-
inst._zod.parse = (payload, ctx) => {
|
|
2101
|
-
const result = def.innerType._zod.run(payload, ctx);
|
|
2102
|
-
if (result instanceof Promise) {
|
|
2103
|
-
return result.then((result) => handleNonOptionalResult(result, inst));
|
|
2104
|
-
}
|
|
2105
|
-
return handleNonOptionalResult(result, inst);
|
|
2106
|
-
};
|
|
2107
|
-
});
|
|
2108
|
-
function handleNonOptionalResult(payload, inst) {
|
|
2109
|
-
if (!payload.issues.length && payload.value === undefined) {
|
|
2110
|
-
payload.issues.push({
|
|
2111
|
-
code: "invalid_type",
|
|
2112
|
-
expected: "nonoptional",
|
|
2113
|
-
input: payload.value,
|
|
2114
|
-
inst,
|
|
2115
|
-
});
|
|
2116
|
-
}
|
|
2117
|
-
return payload;
|
|
2118
|
-
}
|
|
2119
|
-
exports.$ZodSuccess = core.$constructor("$ZodSuccess", (inst, def) => {
|
|
2120
|
-
exports.$ZodType.init(inst, def);
|
|
2121
|
-
inst._zod.parse = (payload, ctx) => {
|
|
2122
|
-
if (ctx.direction === "backward") {
|
|
2123
|
-
throw new core.$ZodEncodeError("ZodSuccess");
|
|
2124
|
-
}
|
|
2125
|
-
const result = def.innerType._zod.run(payload, ctx);
|
|
2126
|
-
if (result instanceof Promise) {
|
|
2127
|
-
return result.then((result) => {
|
|
2128
|
-
payload.value = result.issues.length === 0;
|
|
2129
|
-
return payload;
|
|
2130
|
-
});
|
|
2131
|
-
}
|
|
2132
|
-
payload.value = result.issues.length === 0;
|
|
2133
|
-
return payload;
|
|
2134
|
-
};
|
|
2135
|
-
});
|
|
2136
|
-
function handleCatchResult(payload, result, def, ctx) {
|
|
2137
|
-
if (!result.issues.length) {
|
|
2138
|
-
payload.value = result.value;
|
|
2139
|
-
// The value carries up, so the flag describing it has to carry with it: a back-edge into a node still being parsed must not be frozen by an enclosing readonly, and its checks belong to the node itself. Guarded so the ordinary case adds no own property.
|
|
2140
|
-
if (result.memo)
|
|
2141
|
-
payload.memo = true;
|
|
2142
|
-
return payload;
|
|
2143
|
-
}
|
|
2144
|
-
// Spread the inner's own payload, not ours: `value` has to stay the input the catch was handed, and the inner ran on a payload of its own so its issues are already private to this call.
|
|
2145
|
-
payload.value = def.catchValue({
|
|
2146
|
-
...result,
|
|
2147
|
-
value: payload.value,
|
|
2148
|
-
error: {
|
|
2149
|
-
issues: result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),
|
|
2150
|
-
},
|
|
2151
|
-
input: payload.value,
|
|
2152
|
-
});
|
|
2153
|
-
return payload;
|
|
2154
|
-
}
|
|
2155
|
-
exports.$ZodCatch = core.$constructor("$ZodCatch", (inst, def) => {
|
|
2156
|
-
exports.$ZodType.init(inst, def);
|
|
2157
|
-
util.defineLazyInternal(inst, "optin", (zod) => zod.def.innerType._zod.optin === "defaulted" ? "defaulted" : "optional");
|
|
2158
|
-
util.defineLazyInternal(inst, "optout", (zod) => zod.def.innerType._zod.optout);
|
|
2159
|
-
util.defineLazyInternal(inst, "values", (zod) => zod.def.innerType._zod.values);
|
|
2160
|
-
inst._zod.parse = (payload, ctx) => {
|
|
2161
|
-
if (ctx.direction === "backward") {
|
|
2162
|
-
return def.innerType._zod.run(payload, ctx);
|
|
2163
|
-
}
|
|
2164
|
-
// Forward direction (decode): apply catch logic
|
|
2165
|
-
const result = def.innerType._zod.run({ value: payload.value, issues: [] }, ctx);
|
|
2166
|
-
if (result instanceof Promise) {
|
|
2167
|
-
return result.then((result) => handleCatchResult(payload, result, def, ctx));
|
|
2168
|
-
}
|
|
2169
|
-
return handleCatchResult(payload, result, def, ctx);
|
|
2170
|
-
};
|
|
2171
|
-
});
|
|
2172
|
-
exports.$ZodNaN = core.$constructor("$ZodNaN", (inst, def) => {
|
|
2173
|
-
exports.$ZodType.init(inst, def);
|
|
2174
|
-
inst._zod.parse = (payload, _ctx) => {
|
|
2175
|
-
if (typeof payload.value !== "number" || !Number.isNaN(payload.value)) {
|
|
2176
|
-
payload.issues.push({
|
|
2177
|
-
input: payload.value,
|
|
2178
|
-
inst,
|
|
2179
|
-
expected: "nan",
|
|
2180
|
-
code: "invalid_type",
|
|
2181
|
-
});
|
|
2182
|
-
return payload;
|
|
2183
|
-
}
|
|
2184
|
-
return payload;
|
|
2185
|
-
};
|
|
2186
|
-
});
|
|
2187
|
-
exports.$ZodPipe = core.$constructor("$ZodPipe", (inst, def) => {
|
|
2188
|
-
exports.$ZodType.init(inst, def);
|
|
2189
|
-
util.defineLazyInternal(inst, "values", (zod) => zod.def.in._zod.values);
|
|
2190
|
-
util.defineLazyInternal(inst, "optin", (zod) => zod.def.in._zod.optin);
|
|
2191
|
-
util.defineLazyInternal(inst, "optout", (zod) => zod.def.out._zod.optout);
|
|
2192
|
-
util.defineLazyInternal(inst, "propValues", (zod) => zod.def.in._zod.propValues);
|
|
2193
|
-
inst._zod.parse = (payload, ctx) => {
|
|
2194
|
-
if (ctx.direction === "backward") {
|
|
2195
|
-
const right = def.out._zod.run(payload, ctx);
|
|
2196
|
-
if (right instanceof Promise) {
|
|
2197
|
-
return right.then((right) => handlePipeResult(right, def.in, ctx));
|
|
2198
|
-
}
|
|
2199
|
-
return handlePipeResult(right, def.in, ctx);
|
|
2200
|
-
}
|
|
2201
|
-
const left = def.in._zod.run(payload, ctx);
|
|
2202
|
-
if (left instanceof Promise) {
|
|
2203
|
-
return left.then((left) => handlePipeResult(left, def.out, ctx));
|
|
2204
|
-
}
|
|
2205
|
-
return handlePipeResult(left, def.out, ctx);
|
|
2206
|
-
};
|
|
2207
|
-
});
|
|
2208
|
-
function handlePipeResult(left, next, ctx) {
|
|
2209
|
-
// Any issue stops the pipe, so a failing refinement never feeds its transform. An unrecognized key is the exception: it describes the input's extra properties, not the value being piped, and an enclosing intersection may yet reconcile it.
|
|
2210
|
-
if (left.issues.some((iss) => iss.code !== "unrecognized_keys")) {
|
|
2211
|
-
// prevent further checks
|
|
2212
|
-
left.aborted = true;
|
|
2213
|
-
return left;
|
|
2214
|
-
}
|
|
2215
|
-
return next._zod.run({ value: left.value, issues: left.issues }, ctx);
|
|
2216
|
-
}
|
|
2217
|
-
exports.$ZodCodec = core.$constructor("$ZodCodec", (inst, def) => {
|
|
2218
|
-
exports.$ZodType.init(inst, def);
|
|
2219
|
-
util.defineLazyInternal(inst, "values", (zod) => zod.def.in._zod.values);
|
|
2220
|
-
util.defineLazyInternal(inst, "optin", (zod) => zod.def.in._zod.optin);
|
|
2221
|
-
util.defineLazyInternal(inst, "optout", (zod) => zod.def.out._zod.optout);
|
|
2222
|
-
util.defineLazyInternal(inst, "propValues", (zod) => zod.def.in._zod.propValues);
|
|
2223
|
-
inst._zod.parse = (payload, ctx) => {
|
|
2224
|
-
const direction = ctx.direction || "forward";
|
|
2225
|
-
if (direction === "forward") {
|
|
2226
|
-
const left = def.in._zod.run(payload, ctx);
|
|
2227
|
-
if (left instanceof Promise) {
|
|
2228
|
-
return left.then((left) => handleCodecAResult(left, def, ctx));
|
|
2229
|
-
}
|
|
2230
|
-
return handleCodecAResult(left, def, ctx);
|
|
2231
|
-
}
|
|
2232
|
-
else {
|
|
2233
|
-
const right = def.out._zod.run(payload, ctx);
|
|
2234
|
-
if (right instanceof Promise) {
|
|
2235
|
-
return right.then((right) => handleCodecAResult(right, def, ctx));
|
|
2236
|
-
}
|
|
2237
|
-
return handleCodecAResult(right, def, ctx);
|
|
2238
|
-
}
|
|
2239
|
-
};
|
|
2240
|
-
});
|
|
2241
|
-
function handleCodecAResult(result, def, ctx) {
|
|
2242
|
-
if (result.issues.length) {
|
|
2243
|
-
// prevent further checks
|
|
2244
|
-
result.aborted = true;
|
|
2245
|
-
return result;
|
|
2246
|
-
}
|
|
2247
|
-
const direction = ctx.direction || "forward";
|
|
2248
|
-
if (direction === "forward") {
|
|
2249
|
-
const transformed = def.transform(result.value, result);
|
|
2250
|
-
if (transformed instanceof Promise) {
|
|
2251
|
-
return transformed.then((value) => handleCodecTxResult(result, value, def.out, ctx));
|
|
2252
|
-
}
|
|
2253
|
-
return handleCodecTxResult(result, transformed, def.out, ctx);
|
|
2254
|
-
}
|
|
2255
|
-
else {
|
|
2256
|
-
const transformed = def.reverseTransform(result.value, result);
|
|
2257
|
-
if (transformed instanceof Promise) {
|
|
2258
|
-
return transformed.then((value) => handleCodecTxResult(result, value, def.in, ctx));
|
|
2259
|
-
}
|
|
2260
|
-
return handleCodecTxResult(result, transformed, def.in, ctx);
|
|
2261
|
-
}
|
|
2262
|
-
}
|
|
2263
|
-
function handleCodecTxResult(left, value, nextSchema, ctx) {
|
|
2264
|
-
// Check if transform added any issues
|
|
2265
|
-
if (left.issues.length) {
|
|
2266
|
-
left.aborted = true;
|
|
2267
|
-
return left;
|
|
2268
|
-
}
|
|
2269
|
-
return nextSchema._zod.run({ value, issues: left.issues }, ctx);
|
|
2270
|
-
}
|
|
2271
|
-
exports.$ZodPreprocess = core.$constructor("$ZodPreprocess", (inst, def) => {
|
|
2272
|
-
exports.$ZodPipe.init(inst, def);
|
|
2273
|
-
});
|
|
2274
|
-
exports.$ZodReadonly = core.$constructor("$ZodReadonly", (inst, def) => {
|
|
2275
|
-
exports.$ZodType.init(inst, def);
|
|
2276
|
-
util.defineLazyInternal(inst, "propValues", (zod) => zod.def.innerType._zod.propValues);
|
|
2277
|
-
util.defineLazyInternal(inst, "values", (zod) => zod.def.innerType._zod.values);
|
|
2278
|
-
util.defineLazyInternal(inst, "optin", (zod) => zod.def.innerType?._zod?.optin);
|
|
2279
|
-
util.defineLazyInternal(inst, "optout", (zod) => zod.def.innerType?._zod?.optout);
|
|
2280
|
-
inst._zod.parse = (payload, ctx) => {
|
|
2281
|
-
if (ctx.direction === "backward") {
|
|
2282
|
-
return def.innerType._zod.run(payload, ctx);
|
|
2283
|
-
}
|
|
2284
|
-
const result = def.innerType._zod.run(payload, ctx);
|
|
2285
|
-
if (result instanceof Promise) {
|
|
2286
|
-
return result.then(handleReadonlyResult);
|
|
2287
|
-
}
|
|
2288
|
-
return handleReadonlyResult(result);
|
|
2289
|
-
};
|
|
2290
|
-
});
|
|
2291
|
-
function handleReadonlyResult(payload) {
|
|
2292
|
-
// A repeat visit hands back a node that is still being built; freezing it here would make the rest of its keys fail to assign.
|
|
2293
|
-
if (!payload.memo)
|
|
2294
|
-
payload.value = Object.freeze(payload.value);
|
|
2295
|
-
return payload;
|
|
2296
|
-
}
|
|
2297
|
-
exports.$ZodTemplateLiteral = core.$constructor("$ZodTemplateLiteral", (inst, def) => {
|
|
2298
|
-
exports.$ZodType.init(inst, def);
|
|
2299
|
-
const regexParts = [];
|
|
2300
|
-
for (const part of def.parts) {
|
|
2301
|
-
if (typeof part === "object" && part !== null) {
|
|
2302
|
-
// is Zod schema
|
|
2303
|
-
if (!part._zod.pattern) {
|
|
2304
|
-
// if (!source)
|
|
2305
|
-
throw new Error(`Invalid template literal part, no pattern found: ${[...part._zod.traits].shift()}`);
|
|
2306
|
-
}
|
|
2307
|
-
const source = part._zod.pattern instanceof RegExp ? part._zod.pattern.source : part._zod.pattern;
|
|
2308
|
-
if (!source)
|
|
2309
|
-
throw new Error(`Invalid template literal part: ${part._zod.traits}`);
|
|
2310
|
-
const start = source.startsWith("^") ? 1 : 0;
|
|
2311
|
-
const end = source.endsWith("$") ? source.length - 1 : source.length;
|
|
2312
|
-
regexParts.push(source.slice(start, end));
|
|
2313
|
-
}
|
|
2314
|
-
else if (part === null || util.primitiveTypes.has(typeof part)) {
|
|
2315
|
-
regexParts.push(util.escapeRegex(`${part}`));
|
|
2316
|
-
}
|
|
2317
|
-
else {
|
|
2318
|
-
throw new Error(`Invalid template literal part: ${part}`);
|
|
2319
|
-
}
|
|
2320
|
-
}
|
|
2321
|
-
inst._zod.pattern = new RegExp(`^${regexParts.join("")}$`);
|
|
2322
|
-
inst._zod.parse = (payload, _ctx) => {
|
|
2323
|
-
if (typeof payload.value !== "string") {
|
|
2324
|
-
payload.issues.push({
|
|
2325
|
-
input: payload.value,
|
|
2326
|
-
inst,
|
|
2327
|
-
expected: "string",
|
|
2328
|
-
code: "invalid_type",
|
|
2329
|
-
});
|
|
2330
|
-
return payload;
|
|
2331
|
-
}
|
|
2332
|
-
inst._zod.pattern.lastIndex = 0;
|
|
2333
|
-
if (!inst._zod.pattern.test(payload.value)) {
|
|
2334
|
-
payload.issues.push({
|
|
2335
|
-
input: payload.value,
|
|
2336
|
-
inst,
|
|
2337
|
-
code: "invalid_format",
|
|
2338
|
-
format: def.format ?? "template_literal",
|
|
2339
|
-
pattern: inst._zod.pattern.source,
|
|
2340
|
-
});
|
|
2341
|
-
return payload;
|
|
2342
|
-
}
|
|
2343
|
-
return payload;
|
|
2344
|
-
};
|
|
2345
|
-
});
|
|
2346
|
-
exports.$ZodFunction = core.$constructor("$ZodFunction", (inst, def) => {
|
|
2347
|
-
exports.$ZodType.init(inst, def);
|
|
2348
|
-
// Defined, not assigned: the classic prototype exposes `_def` as a getter with no setter.
|
|
2349
|
-
Object.defineProperty(inst, "_def", { value: def });
|
|
2350
|
-
inst._zod.def = def;
|
|
2351
|
-
inst.implement = (func) => {
|
|
2352
|
-
if (typeof func !== "function") {
|
|
2353
|
-
throw new Error("implement() must be called with a function");
|
|
2354
|
-
}
|
|
2355
|
-
// Defined inline so the closure stays anonymous: binding it to a `const` first names it, which costs 256 bytes per implemented function.
|
|
2356
|
-
return Object.defineProperty(function (...args) {
|
|
2357
|
-
const parsedArgs = inst._def.input ? (0, parse_js_1.parse)(inst._def.input, args) : args;
|
|
2358
|
-
const result = Reflect.apply(func, this, parsedArgs);
|
|
2359
|
-
if (inst._def.output) {
|
|
2360
|
-
return (0, parse_js_1.parse)(inst._def.output, result);
|
|
2361
|
-
}
|
|
2362
|
-
return result;
|
|
2363
|
-
}, "_zod", { value: inst._zod, enumerable: false });
|
|
2364
|
-
};
|
|
2365
|
-
inst.implementAsync = (func) => {
|
|
2366
|
-
if (typeof func !== "function") {
|
|
2367
|
-
throw new Error("implementAsync() must be called with a function");
|
|
2368
|
-
}
|
|
2369
|
-
return Object.defineProperty(async function (...args) {
|
|
2370
|
-
const parsedArgs = inst._def.input ? await (0, parse_js_1.parseAsync)(inst._def.input, args) : args;
|
|
2371
|
-
const result = await Reflect.apply(func, this, parsedArgs);
|
|
2372
|
-
if (inst._def.output) {
|
|
2373
|
-
return await (0, parse_js_1.parseAsync)(inst._def.output, result);
|
|
2374
|
-
}
|
|
2375
|
-
return result;
|
|
2376
|
-
}, "_zod", { value: inst._zod, enumerable: false });
|
|
2377
|
-
};
|
|
2378
|
-
inst._zod.parse = (payload, _ctx) => {
|
|
2379
|
-
if (typeof payload.value !== "function") {
|
|
2380
|
-
payload.issues.push({
|
|
2381
|
-
code: "invalid_type",
|
|
2382
|
-
expected: "function",
|
|
2383
|
-
input: payload.value,
|
|
2384
|
-
inst,
|
|
2385
|
-
});
|
|
2386
|
-
return payload;
|
|
2387
|
-
}
|
|
2388
|
-
// Check if output is a promise type to determine if we should use async implementation
|
|
2389
|
-
const hasPromiseOutput = inst._def.output && inst._def.output._zod.def.type === "promise";
|
|
2390
|
-
if (hasPromiseOutput) {
|
|
2391
|
-
payload.value = inst.implementAsync(payload.value);
|
|
2392
|
-
}
|
|
2393
|
-
else {
|
|
2394
|
-
payload.value = inst.implement(payload.value);
|
|
2395
|
-
}
|
|
2396
|
-
return payload;
|
|
2397
|
-
};
|
|
2398
|
-
inst.input = (...args) => {
|
|
2399
|
-
const F = inst.constructor;
|
|
2400
|
-
if (Array.isArray(args[0])) {
|
|
2401
|
-
return new F({
|
|
2402
|
-
type: "function",
|
|
2403
|
-
input: new exports.$ZodTuple({
|
|
2404
|
-
type: "tuple",
|
|
2405
|
-
items: args[0],
|
|
2406
|
-
rest: args[1],
|
|
2407
|
-
}),
|
|
2408
|
-
output: inst._def.output,
|
|
2409
|
-
});
|
|
2410
|
-
}
|
|
2411
|
-
return new F({
|
|
2412
|
-
type: "function",
|
|
2413
|
-
input: args[0],
|
|
2414
|
-
output: inst._def.output,
|
|
2415
|
-
});
|
|
2416
|
-
};
|
|
2417
|
-
inst.output = (output) => {
|
|
2418
|
-
const F = inst.constructor;
|
|
2419
|
-
return new F({
|
|
2420
|
-
type: "function",
|
|
2421
|
-
input: inst._def.input,
|
|
2422
|
-
output,
|
|
2423
|
-
});
|
|
2424
|
-
};
|
|
2425
|
-
return inst;
|
|
2426
|
-
});
|
|
2427
|
-
exports.$ZodPromise = core.$constructor("$ZodPromise", (inst, def) => {
|
|
2428
|
-
exports.$ZodType.init(inst, def);
|
|
2429
|
-
inst._zod.parse = (payload, ctx) => {
|
|
2430
|
-
return Promise.resolve(payload.value).then((inner) => def.innerType._zod.run({ value: inner, issues: [] }, ctx));
|
|
2431
|
-
};
|
|
2432
|
-
});
|
|
2433
|
-
exports.$ZodLazy = core.$constructor("$ZodLazy", (inst, def) => {
|
|
2434
|
-
exports.$ZodType.init(inst, def);
|
|
2435
|
-
// Cache the resolved inner type on the shared `def` so all clones of this lazy (e.g. via `.describe()`/`.meta()`) share the same inner instance, preserving identity for cycle detection on recursive schemas.
|
|
2436
|
-
util.defineLazy(inst._zod, "innerType", () => {
|
|
2437
|
-
const d = def;
|
|
2438
|
-
if (!d._cachedInner)
|
|
2439
|
-
d._cachedInner = def.getter();
|
|
2440
|
-
return d._cachedInner;
|
|
2441
|
-
});
|
|
2442
|
-
util.defineLazyInternal(inst, "pattern", (zod) => zod.innerType?._zod?.pattern);
|
|
2443
|
-
util.defineLazyInternal(inst, "propValues", (zod) => zod.innerType?._zod?.propValues);
|
|
2444
|
-
util.defineLazyInternal(inst, "optin", (zod) => zod.innerType?._zod?.optin ?? undefined);
|
|
2445
|
-
util.defineLazyInternal(inst, "optout", (zod) => zod.innerType?._zod?.optout ?? undefined);
|
|
2446
|
-
inst._zod.parse = (payload, ctx) => {
|
|
2447
|
-
const inner = inst._zod.innerType;
|
|
2448
|
-
return inner._zod.run(payload, ctx);
|
|
2449
|
-
};
|
|
2450
|
-
});
|
|
2451
|
-
exports.$ZodCustom = core.$constructor("$ZodCustom", (inst, def) => {
|
|
2452
|
-
checks.$ZodCheck.init(inst, def);
|
|
2453
|
-
exports.$ZodType.init(inst, def);
|
|
2454
|
-
inst._zod.parse = (payload, _) => {
|
|
2455
|
-
return payload;
|
|
2456
|
-
};
|
|
2457
|
-
inst._zod.check = (payload) => {
|
|
2458
|
-
const input = payload.value;
|
|
2459
|
-
const r = def.fn(input);
|
|
2460
|
-
if (r instanceof Promise) {
|
|
2461
|
-
return r.then((r) => handleRefineResult(r, payload, input, inst));
|
|
2462
|
-
}
|
|
2463
|
-
handleRefineResult(r, payload, input, inst);
|
|
2464
|
-
return;
|
|
2465
|
-
};
|
|
2466
|
-
});
|
|
2467
|
-
function handleRefineResult(result, payload, input, inst) {
|
|
2468
|
-
if (!result) {
|
|
2469
|
-
const _iss = {
|
|
2470
|
-
code: "custom",
|
|
2471
|
-
input,
|
|
2472
|
-
inst, // incorporates params.error into issue reporting
|
|
2473
|
-
path: [...(inst._zod.def.path ?? [])], // incorporates params.error into issue reporting
|
|
2474
|
-
continue: !inst._zod.def.abort,
|
|
2475
|
-
// params: inst._zod.def.params,
|
|
2476
|
-
};
|
|
2477
|
-
if (inst._zod.def.params)
|
|
2478
|
-
_iss.params = inst._zod.def.params;
|
|
2479
|
-
payload.issues.push(util.issue(_iss));
|
|
2480
|
-
}
|
|
2481
|
-
}
|