@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.
Files changed (1674) hide show
  1. package/.agents/skills/chrona-3d-assets/SKILL.md +15 -0
  2. package/.agents/skills/chrona-ecs-creator/SKILL.md +17 -0
  3. package/.agents/skills/chrona-gameplay-js/SKILL.md +19 -0
  4. package/.agents/skills/chrona-realtime/SKILL.md +23 -0
  5. package/.agents/skills/chrona-repair/SKILL.md +13 -0
  6. package/README.md +89 -8
  7. package/bin/chrona.mjs +6 -2
  8. package/chrona.contract.lock.json +74 -6
  9. package/chrona.controlled-presentation.lock.json +8 -8
  10. package/chrona.core.lock.json +16 -12
  11. package/chrona.document-presentation.lock.json +52 -0
  12. package/chrona.ecs.lock.json +3 -3
  13. package/chrona.gameplay-tests.lock.json +9 -9
  14. package/chrona.ground-endpoint.lock.json +28 -0
  15. package/chrona.ground-spaces.lock.json +40 -0
  16. package/chrona.personal-state.lock.json +28 -0
  17. package/chrona.pipeline.lock.json +10 -10
  18. package/chrona.private-state-view.lock.json +2 -2
  19. package/chrona.private-state.lock.json +2 -2
  20. package/chrona.registry.lock.json +2 -2
  21. package/chrona.sandbox.lock.json +11 -7
  22. package/chrona.scene-interaction-v2.lock.json +28 -0
  23. package/chrona.world-scene-runtime.lock.json +49 -9
  24. package/chrona.world-scene.lock.json +9 -5
  25. package/compiler/local-builder.lock.json +1 -1
  26. package/compiler/source/contracts/creator/rules/v1/rules.mjs +99 -0
  27. package/compiler/source/contracts/creator/rules/v1/ugc-rules.json +807 -0
  28. package/compiler/source/contracts/ugc/authored-motion/v1/declaration.mjs +124 -0
  29. package/compiler/source/contracts/ugc/core-ecs/v1/core-view.mjs +146 -0
  30. package/compiler/source/contracts/ugc/core-ecs/v1/limits.json +4 -0
  31. package/compiler/source/contracts/ugc/document-presentation/v1/document.mjs +148 -27
  32. package/compiler/source/contracts/ugc/document-presentation/v1/profile-1.1.0.json +25 -0
  33. package/compiler/source/contracts/ugc/document-presentation/v1/profile-1.2.0.json +25 -0
  34. package/compiler/source/contracts/ugc/document-presentation/v1/profile-1.3.0.json +26 -0
  35. package/compiler/source/contracts/ugc/document-presentation/v1/profile-1.5.0.json +25 -0
  36. package/compiler/source/contracts/ugc/document-presentation/v1/profile-1.6.0.json +26 -0
  37. package/compiler/source/contracts/ugc/ecs-runtime/v1/private-world.mjs +313 -0
  38. package/compiler/source/contracts/ugc/live-rule-slot/v1/slot.json +58 -0
  39. package/compiler/source/contracts/ugc/local-content/v1/document-snapshot.mjs +13 -29
  40. package/compiler/source/contracts/ugc/local-content/v1/ground-snapshot.mjs +89 -0
  41. package/compiler/source/contracts/ugc/local-content/v1/snapshot.mjs +49 -6
  42. package/compiler/source/contracts/ugc/open-creation/v1/custom-actions.mjs +92 -0
  43. package/compiler/source/contracts/ugc/open-creation/v1/data-authority.mjs +37 -0
  44. package/compiler/source/contracts/ugc/open-creation/v1/declaration.mjs +28 -0
  45. package/compiler/source/contracts/ugc/open-creation/v1/dynamic-entities.mjs +186 -0
  46. package/compiler/source/contracts/ugc/open-creation/v1/open-world.mjs +269 -0
  47. package/compiler/source/contracts/ugc/pipeline/v1/conformance/js/pipeline-validator.mjs +35 -7
  48. package/compiler/source/contracts/ugc/private-state/v1/projection.mjs +178 -0
  49. package/compiler/source/contracts/ugc/registry/v1/resolution-policy.json +3 -3
  50. package/compiler/source/contracts/ugc/runtime-content/v1/asset-budget.mjs +21 -0
  51. package/compiler/source/contracts/ugc/runtime-content/v1/limits.json +5 -0
  52. package/compiler/source/contracts/ugc/runtime-content/v1/validate.mjs +420 -0
  53. package/compiler/source/contracts/ugc/sandbox/v1/sha256.mjs +47 -0
  54. package/compiler/source/contracts/ugc/server-entities/v1/entities.mjs +221 -0
  55. package/compiler/source/contracts/ugc/server-entities/v1/events.mjs +336 -0
  56. package/compiler/source/contracts/ugc/server-entities/v1/limits.json +112 -0
  57. package/compiler/source/contracts/ugc/server-entities/v1/roads.mjs +164 -0
  58. package/compiler/source/contracts/ugc/v1/conformance/js/package-validator.mjs +51 -5
  59. package/compiler/source/contracts/ugc/v1/host-runnable.mjs +23 -0
  60. package/compiler/source/contracts/ugc/world-scene/v2/asset-graph.mjs +8 -12
  61. package/compiler/source/contracts/ugc/world-scene/v2/contract-set.json +1 -0
  62. package/compiler/source/contracts/ugc/world-scene-runtime/v1/runtime-plan.schema.json +41 -13
  63. package/compiler/source/contracts/ugc/world-scene-runtime/v1/runtime-policy.mjs +2 -2
  64. package/compiler/source/contracts/ugc/world-scene-runtime/v2/contract-set.json +10 -0
  65. package/compiler/source/contracts/ugc/world-scene-runtime/v2/report.mjs +21 -14
  66. package/compiler/source/contracts/ugc/world-scene-runtime/v2/runtime-policy.mjs +17 -3
  67. package/compiler/source/services/game-worker/src/runtime/content/flight-runtime.js +2 -1
  68. package/compiler/source/services/game-worker/src/runtime/rooms/flight-collision.js +55 -30
  69. package/compiler/source/services/game-worker/src/runtime/rooms/flight-motion.js +99 -0
  70. package/compiler/source/services/game-worker/src/runtime/rooms/flight-preparation.js +3 -2
  71. package/compiler/source/services/game-worker/src/runtime/rooms/flight-room-controller.js +130 -24
  72. package/compiler/source/services/ugc-pipeline/src/asset-inspection.mjs +78 -28
  73. package/compiler/source/services/ugc-pipeline/src/document-presentation-model.mjs +2 -2
  74. package/compiler/source/services/ugc-pipeline/src/ground-rules-model.mjs +4 -5
  75. package/compiler/source/services/ugc-pipeline/src/local-content.mjs +29 -16
  76. package/compiler/source/services/ugc-pipeline/src/registry-release.mjs +4 -1
  77. package/compiler/source/services/ugc-pipeline/src/resource-bindings-model.mjs +3 -3
  78. package/compiler/source/services/ugc-pipeline/src/rules-locks.mjs +18 -0
  79. package/compiler/source/services/ugc-pipeline/src/scene-interaction-model.mjs +4 -5
  80. package/compiler/source/services/ugc-pipeline/src/visual-closure-v2.mjs +2 -2
  81. package/compiler/source/services/ugc-pipeline/src/world-scene-model.mjs +3 -3
  82. package/compiler/source/services/ugc-pipeline/src/world-scene-policies.json +138 -0
  83. package/compiler/source/services/ugc-pipeline/src/world-scene-runtime.mjs +4 -3
  84. package/consistency-vectors.snapshot.lock.json +14 -0
  85. package/contracts/creator/check/v1/rule-table.json +433 -0
  86. package/contracts/creator/check/v1/rules/client.json +924 -0
  87. package/contracts/creator/check/v1/rules/kit.json +1702 -0
  88. package/contracts/creator/check/v1/rules/platform.json +608 -0
  89. package/contracts/creator/check/v1/rules/publish.json +2484 -0
  90. package/contracts/creator/check/v1/rules/room.json +279 -0
  91. package/contracts/creator/rules/v1/rules.mjs +69 -0
  92. package/contracts/creator/rules/v1/vectors.json +39 -0
  93. package/contracts/ecs/realtime/consistency/v1/vectors.json +2437 -0
  94. package/contracts/errors/registry/v1/codes.json +13255 -0
  95. package/contracts/gameplay/step-input/step-input.mjs +16 -0
  96. package/contracts/network/realtime/authored-entity.mjs +67 -0
  97. package/contracts/network/realtime/revision-selection.mjs +65 -0
  98. package/contracts/testdata/gameplay-consistency/vectors.json +149 -0
  99. package/contracts/ugc/authored-motion/v1/declaration.mjs +124 -0
  100. package/contracts/ugc/core-ecs/v1/core-view.mjs +13 -5
  101. package/contracts/ugc/core-ecs/v1/limits.json +4 -0
  102. package/contracts/ugc/creator-source/v1/SOURCE-PACKAGE.md +1 -1
  103. package/contracts/ugc/creator-source/v1/source-package.mjs +24 -7
  104. package/contracts/ugc/creator-source/v1/source-package.schema.json +3 -3
  105. package/contracts/ugc/creator-source/v1/source-package.test.mjs +20 -2
  106. package/contracts/ugc/document-presentation/v1/document.mjs +148 -27
  107. package/contracts/ugc/document-presentation/v1/profile-1.1.0.json +25 -0
  108. package/contracts/ugc/document-presentation/v1/profile-1.2.0.json +25 -0
  109. package/contracts/ugc/document-presentation/v1/profile-1.3.0.json +26 -0
  110. package/contracts/ugc/document-presentation/v1/profile-1.5.0.json +25 -0
  111. package/contracts/ugc/document-presentation/v1/profile-1.6.0.json +26 -0
  112. package/contracts/ugc/ecs-runtime/v1/private-world.mjs +21 -7
  113. package/contracts/ugc/live-rule-slot/v1/slot.json +58 -0
  114. package/contracts/ugc/live-rule-slot/v1/slot.mjs +80 -0
  115. package/contracts/ugc/local-content/v1/README.md +10 -0
  116. package/contracts/ugc/local-content/v1/document-snapshot.mjs +13 -29
  117. package/contracts/ugc/local-content/v1/ground-snapshot.mjs +89 -0
  118. package/contracts/ugc/local-content/v1/snapshot.mjs +49 -6
  119. package/contracts/ugc/local-content/v1/spatial-plan.mjs +24 -0
  120. package/contracts/ugc/open-creation/v1/custom-actions.mjs +92 -0
  121. package/contracts/ugc/open-creation/v1/data-authority.mjs +37 -0
  122. package/contracts/ugc/open-creation/v1/declaration.mjs +28 -0
  123. package/contracts/ugc/open-creation/v1/dynamic-entities.mjs +186 -0
  124. package/contracts/ugc/open-creation/v1/open-world.mjs +269 -0
  125. package/contracts/ugc/public-runtime/v1/README.md +13 -1
  126. package/contracts/ugc/public-runtime/v1/compatibility-rows.test.mjs +79 -0
  127. package/contracts/ugc/public-runtime/v1/document-runtime.test.mjs +20 -5
  128. package/contracts/ugc/public-runtime/v1/manifest.mjs +24 -12
  129. package/contracts/ugc/public-runtime/v1/revision-vectors.test.mjs +49 -0
  130. package/contracts/ugc/public-runtime/v1/runtime-manifest.schema.json +119 -6
  131. package/contracts/ugc/runtime-content/v1/asset-budget.mjs +21 -0
  132. package/contracts/ugc/runtime-content/v1/limits.json +5 -0
  133. package/contracts/ugc/runtime-content/v1/validate.mjs +420 -0
  134. package/contracts/ugc/sandbox/v1/conformance/js/sandbox-validator.mjs +85 -6
  135. package/contracts/ugc/server-entities/v1/entities.mjs +221 -0
  136. package/contracts/ugc/server-entities/v1/events.mjs +336 -0
  137. package/contracts/ugc/server-entities/v1/limits.json +112 -0
  138. package/contracts/ugc/server-entities/v1/roads.mjs +164 -0
  139. package/contracts/ugc/v1/conformance/js/package-validator.mjs +51 -5
  140. package/contracts/ugc/v1/host-runnable.mjs +23 -0
  141. package/contracts/ugc/world-scene-runtime/v1/runtime-policy.mjs +2 -2
  142. package/contracts/ugc/world-scene-runtime/v2/runtime-policy.mjs +17 -3
  143. package/creator-check.source-lock.json +40 -0
  144. package/creator-release.json +1 -1
  145. package/docs/ai-index.md +193 -0
  146. package/docs/assets-3d-spec.md +114 -3
  147. package/docs/audio.md +110 -0
  148. package/docs/authored-avatars.md +67 -0
  149. package/docs/authored-entities.md +165 -0
  150. package/docs/capability-map.json +57 -0
  151. package/docs/controlled-presentation.md +53 -0
  152. package/docs/core-ecs.md +46 -0
  153. package/docs/declaration-generator.md +292 -0
  154. package/docs/document-presentation.md +14 -0
  155. package/docs/gameplay-inputs.md +77 -0
  156. package/docs/gameplay-lifecycle-tests.md +89 -0
  157. package/docs/ground-rules.md +63 -0
  158. package/docs/harness-onboarding.md +83 -22
  159. package/docs/live-rule-slots.md +57 -0
  160. package/docs/mcp-tools.md +39 -0
  161. package/docs/meshy.md +17 -4
  162. package/docs/migrate-1.6.md +63 -0
  163. package/docs/npm-creator.md +419 -254
  164. package/docs/open-creation.md +259 -0
  165. package/docs/player-private-components.md +51 -0
  166. package/docs/player-saves.md +175 -0
  167. package/docs/player-visible-state.md +65 -0
  168. package/docs/playtest.md +223 -0
  169. package/docs/private-ecs.md +48 -0
  170. package/docs/private-events.md +82 -0
  171. package/docs/private-state.md +30 -0
  172. package/docs/realtime-patterns.md +624 -0
  173. package/docs/recipes.md +397 -0
  174. package/docs/reference.md +365 -0
  175. package/docs/runtime-download.md +22 -5
  176. package/docs/scene-import.md +132 -0
  177. package/docs/scene-interactions.md +28 -0
  178. package/docs/server-entities.md +83 -0
  179. package/docs/weather.md +77 -0
  180. package/docs/work-brief.md +71 -0
  181. package/document-action-result.source-lock.json +8 -4
  182. package/error-codes.snapshot.lock.json +14 -0
  183. package/gameplay-consistency.source-lock.json +20 -0
  184. package/lib/authority-notice.mjs +76 -0
  185. package/lib/behavior-radius-check.mjs +71 -0
  186. package/lib/builtin-write.mjs +70 -0
  187. package/lib/capability-harness.mjs +4 -3
  188. package/lib/compress-model.mjs +266 -0
  189. package/lib/creator-agent-live.mjs +3 -0
  190. package/lib/creator-api.mjs +367 -144
  191. package/lib/creator-assets-restore.mjs +102 -0
  192. package/lib/creator-capability-map.mjs +28 -0
  193. package/lib/creator-check.mjs +338 -0
  194. package/lib/creator-cli.mjs +940 -119
  195. package/lib/creator-contribution.mjs +46 -37
  196. package/lib/creator-docs.mjs +56 -0
  197. package/lib/creator-entry.mjs +134 -0
  198. package/lib/creator-fix.mjs +208 -0
  199. package/lib/creator-init-paths.mjs +22 -13
  200. package/lib/creator-init.mjs +22 -9
  201. package/lib/creator-install.mjs +379 -66
  202. package/lib/creator-installed-platform.mjs +13 -0
  203. package/lib/creator-intent-rules.mjs +15 -0
  204. package/lib/creator-intent.mjs +147 -0
  205. package/lib/creator-issue.mjs +241 -0
  206. package/lib/creator-mcp.mjs +337 -140
  207. package/lib/creator-migrate.mjs +194 -0
  208. package/lib/creator-onboarding.mjs +3 -1
  209. package/lib/creator-platform.mjs +223 -29
  210. package/lib/creator-playtest.mjs +398 -0
  211. package/lib/creator-preview.mjs +80 -0
  212. package/lib/creator-project-snapshot.mjs +182 -108
  213. package/lib/creator-project-update.mjs +132 -102
  214. package/lib/creator-project.mjs +213 -62
  215. package/lib/creator-provenance.mjs +12 -10
  216. package/lib/creator-rebundle.mjs +68 -0
  217. package/lib/creator-rules.mjs +76 -0
  218. package/lib/creator-session.mjs +128 -25
  219. package/lib/creator-source-package.mjs +2 -2
  220. package/lib/creator-submit.mjs +252 -101
  221. package/lib/creator-toolchain-compat.mjs +476 -3
  222. package/lib/creator-upgrade.mjs +58 -33
  223. package/lib/creator-upload-state.mjs +61 -6
  224. package/lib/creator-workspace-guide.mjs +79 -0
  225. package/lib/declaration-generator.mjs +609 -0
  226. package/lib/declaration-problems.mjs +108 -0
  227. package/lib/document-action-result.mjs +7 -4
  228. package/lib/document-prechecks.mjs +633 -0
  229. package/lib/document-presentation.mjs +47 -15
  230. package/lib/document-refresh.mjs +46 -0
  231. package/lib/ecs-access.mjs +179 -0
  232. package/lib/failure-messages.mjs +42 -0
  233. package/lib/gameplay-imports.mjs +34 -0
  234. package/lib/host-consistency.mjs +74 -0
  235. package/lib/host-ipc/distribution-static-room-semantic-contract/contracts/ugc/public-runtime/v1/manifest.mjs +24 -12
  236. package/lib/host-ipc/distribution-static-room-semantic-contract/contracts/ugc/public-runtime/v1/runtime-manifest.schema.json +119 -6
  237. package/lib/host-ipc/host-ipc.schema.json +80 -0
  238. package/lib/host-ipc/runtime-contract.mjs +2 -0
  239. package/lib/host-ipc/source-lock.json +5 -5
  240. package/lib/host-runnable-scope.mjs +19 -0
  241. package/lib/legacy-patterns.mjs +705 -0
  242. package/lib/live-baseline-shape.mjs +30 -0
  243. package/lib/live-baseline.mjs +108 -0
  244. package/lib/live-rule-check.mjs +96 -0
  245. package/lib/local-builder.mjs +20 -5
  246. package/lib/local-content.mjs +6 -4
  247. package/lib/local-development.mjs +96 -24
  248. package/lib/local-room.mjs +12 -0
  249. package/lib/meshy-api.mjs +57 -1
  250. package/lib/meshy-cli.mjs +23 -0
  251. package/lib/meshy-store.mjs +34 -11
  252. package/lib/movement-authority.mjs +24 -0
  253. package/lib/platform-discovery.mjs +61 -0
  254. package/lib/platform-limits.mjs +6 -0
  255. package/lib/playtest-browser.mjs +121 -0
  256. package/lib/playtest-compare.mjs +42 -0
  257. package/lib/playtest-page.mjs +372 -0
  258. package/lib/playtest-vehicle.mjs +234 -0
  259. package/lib/presentation-project-update.mjs +126 -4
  260. package/lib/private-ecs-harness.mjs +39 -17
  261. package/lib/private-event-harness.mjs +3 -5
  262. package/lib/project-validation.mjs +852 -167
  263. package/lib/publish-prechecks.mjs +28 -0
  264. package/lib/relay-notice.mjs +13 -0
  265. package/lib/rule-fuzz.mjs +45 -0
  266. package/lib/rule-pack.mjs +150 -0
  267. package/lib/rule-selection.mjs +130 -0
  268. package/lib/rule-tests-child.mjs +40 -0
  269. package/lib/rule-tests-sandbox.mjs +75 -0
  270. package/lib/runtime-content.mjs +49 -0
  271. package/lib/runtime-download.mjs +94 -31
  272. package/lib/runtime-host-client.mjs +30 -12
  273. package/lib/runtime-host.mjs +7 -10
  274. package/lib/runtime-install.mjs +46 -6
  275. package/lib/runtime-prechecks.mjs +133 -0
  276. package/lib/runtime-proxy-fetch.mjs +117 -0
  277. package/lib/runtime-snapshot.mjs +20 -20
  278. package/lib/runtime-source.mjs +30 -14
  279. package/lib/sandbox-projection/v1/room-state-projection.mjs +116 -0
  280. package/lib/scene-assets.mjs +5 -5
  281. package/lib/scene-import-profiles.mjs +8 -0
  282. package/lib/scene-import.mjs +737 -0
  283. package/lib/server-entities-check.mjs +160 -0
  284. package/lib/toolchain-history.json +602 -0
  285. package/lib/vendor/mcp.mjs +33787 -0
  286. package/lib/vendor/smol-toml.mjs +744 -0
  287. package/lib/writable-by-others.mjs +8 -0
  288. package/live-rule-slot.source-lock.json +20 -0
  289. package/llms.txt +43 -0
  290. package/local-builder.snapshot.lock.json +3 -3
  291. package/local-content.snapshot.lock.json +112 -8
  292. package/node_modules/pngjs/CHANGELOG.md +128 -0
  293. package/package.json +251 -23
  294. package/public-runtime.snapshot.lock.json +13 -9
  295. package/realtime-revision.source-lock.json +20 -0
  296. package/runtime-catalog.json +16 -16
  297. package/sandbox-projection.source-lock.json +15 -0
  298. package/sdk/client/index.js +3 -2
  299. package/source-package.snapshot.lock.json +5 -5
  300. package/templates/document-presentation/README.md +5 -0
  301. package/templates/document-presentation/assets.js +36 -10
  302. package/templates/document-presentation/authority.js +25 -7
  303. package/templates/document-presentation/live-view.js +100 -0
  304. package/templates/document-presentation/local-first.js +45 -0
  305. package/templates/document-presentation/motion.js +2 -0
  306. package/templates/document-presentation/ready-gate.js +37 -0
  307. package/templates/document-presentation/state-view.js +26 -0
  308. package/templates/document-presentation/weather-blend.js +57 -0
  309. package/templates/document-presentation/weather-particles.js +192 -0
  310. package/templates/document-presentation/wet-ripples.js +61 -0
  311. package/templates/examples/coin-rush/README.md +5 -0
  312. package/templates/examples/coin-rush/chrona.generate.json +63 -0
  313. package/templates/examples/coin-rush/content/assets/runtime/arena.gltf +399 -0
  314. package/templates/examples/coin-rush/content/assets/runtime/runner.gltf +197 -0
  315. package/templates/examples/coin-rush/content/bindings/resources.json +19 -0
  316. package/templates/examples/coin-rush/content/gameplay/client/presentation.js +44 -0
  317. package/templates/examples/coin-rush/content/gameplay/shared/rules.js +49 -0
  318. package/templates/examples/coin-rush/content/manifest.json +100 -0
  319. package/templates/examples/coin-rush/content/provenance.json +20 -0
  320. package/templates/examples/coin-rush/content/rules/ground.json +45 -0
  321. package/templates/examples/coin-rush/content/tests/budgets.json +5 -0
  322. package/templates/examples/coin-rush/content/tests/rules.json +16 -0
  323. package/templates/examples/open-creation/README.md +5 -0
  324. package/templates/examples/open-creation/chrona.generate.json +55 -0
  325. package/templates/examples/open-creation/content/assets/runtime/arena.gltf +399 -0
  326. package/templates/examples/open-creation/content/assets/runtime/runner.gltf +197 -0
  327. package/templates/examples/open-creation/content/bindings/resources.json +19 -0
  328. package/templates/examples/open-creation/content/gameplay/client/presentation.js +33 -0
  329. package/templates/examples/open-creation/content/gameplay/shared/rules.js +29 -0
  330. package/templates/examples/open-creation/content/manifest.json +100 -0
  331. package/templates/examples/open-creation/content/provenance.json +20 -0
  332. package/templates/examples/open-creation/content/rules/ground.json +45 -0
  333. package/templates/examples/open-creation/content/tests/budgets.json +5 -0
  334. package/templates/examples/open-creation/content/tests/rules.json +16 -0
  335. package/templates/live-rule-slot/score-slot.js +16 -0
  336. package/templates/npm-project/AGENTS.md +101 -4
  337. package/templates/npm-project/preview.command +7 -0
  338. package/templates/npm-project/preview.ps1 +6 -0
  339. package/templates/npm-project/scripts/install-kit.mjs +70 -0
  340. package/templates/npm-project/setup.command +3 -0
  341. package/templates/npm-project/setup.ps1 +14 -0
  342. package/templates/npm-project/setup.sh +11 -0
  343. package/templates/public-untrusted/content/gameplay/client/local-first.js +45 -0
  344. package/templates/public-untrusted/content/gameplay/client/smoothing.js +83 -0
  345. package/templates/public-untrusted/content/manifest.json +2 -1
  346. package/templates/public-untrusted/content/tests/scenarios.json +20 -2
  347. package/contracts/ugc/capability-wiring/v1/capability-proposal.schema.json +0 -82
  348. package/contracts/ugc/capability-wiring/v1/conformance/js/wiring-validator.mjs +0 -95
  349. package/contracts/ugc/capability-wiring/v1/conformance/web/index.html +0 -5
  350. package/contracts/ugc/capability-wiring/v1/conformance/web/runner.mjs +0 -32
  351. package/contracts/ugc/capability-wiring/v1/contract-set.json +0 -8
  352. package/contracts/ugc/capability-wiring/v1/error-codes.json +0 -15
  353. package/contracts/ugc/capability-wiring/v1/needs-capability.schema.json +0 -18
  354. package/contracts/ugc/capability-wiring/v1/testdata/vectors.json +0 -128
  355. package/contracts/ugc/capability-wiring/v1/wiring-release.schema.json +0 -66
  356. package/contracts/ugc/controlled-presentation/v1/README.md +0 -175
  357. package/contracts/ugc/controlled-presentation/v1/approval.schema.json +0 -53
  358. package/contracts/ugc/controlled-presentation/v1/command.schema.json +0 -243
  359. package/contracts/ugc/controlled-presentation/v1/conformance/run-vectors.mjs +0 -39
  360. package/contracts/ugc/controlled-presentation/v1/conformance/run-view-vectors.mjs +0 -54
  361. package/contracts/ugc/controlled-presentation/v1/conformance/web/index.html +0 -1
  362. package/contracts/ugc/controlled-presentation/v1/conformance/web/runner.mjs +0 -4
  363. package/contracts/ugc/controlled-presentation/v1/conformance/web/view-runner.mjs +0 -5
  364. package/contracts/ugc/controlled-presentation/v1/conformance/web/view.html +0 -1
  365. package/contracts/ugc/controlled-presentation/v1/context.schema.json +0 -19
  366. package/contracts/ugc/controlled-presentation/v1/contract-set.json +0 -33
  367. package/contracts/ugc/controlled-presentation/v1/export-view.mjs +0 -44
  368. package/contracts/ugc/controlled-presentation/v1/grant.schema.json +0 -120
  369. package/contracts/ugc/controlled-presentation/v1/presentation.mjs +0 -180
  370. package/contracts/ugc/controlled-presentation/v1/testdata/vectors.json +0 -565
  371. package/contracts/ugc/controlled-presentation/v1/view.mjs +0 -46
  372. package/contracts/ugc/controlled-presentation/v1/view.schema.json +0 -90
  373. package/contracts/ugc/core-ecs/v1/README.md +0 -13
  374. package/contracts/ugc/core-ecs/v1/api.json +0 -28
  375. package/contracts/ugc/core-ecs/v1/conformance/run-vectors.mjs +0 -33
  376. package/contracts/ugc/core-ecs/v1/conformance/web/index.html +0 -1
  377. package/contracts/ugc/core-ecs/v1/conformance/web/runner.mjs +0 -4
  378. package/contracts/ugc/core-ecs/v1/test-fixture.schema.json +0 -169
  379. package/contracts/ugc/core-ecs/v1/testdata/vectors.json +0 -57
  380. package/contracts/ugc/document-presentation/v1/README.md +0 -167
  381. package/contracts/ugc/document-presentation/v1/contract-set.json +0 -18
  382. package/contracts/ugc/document-presentation/v1/document.schema.json +0 -161
  383. package/contracts/ugc/document-presentation/v1/document.test.mjs +0 -138
  384. package/contracts/ugc/document-presentation/v1/source.schema.json +0 -88
  385. package/contracts/ugc/ecs-runtime/v1/README.md +0 -25
  386. package/contracts/ugc/ecs-runtime/v1/api.json +0 -46
  387. package/contracts/ugc/ecs-runtime/v1/conformance/run-vectors.mjs +0 -41
  388. package/contracts/ugc/ecs-runtime/v1/conformance/web/index.html +0 -3
  389. package/contracts/ugc/ecs-runtime/v1/conformance/web/runner.mjs +0 -5
  390. package/contracts/ugc/ecs-runtime/v1/testdata/vectors.json +0 -1318
  391. package/contracts/ugc/gameplay-tests/v1/README.md +0 -78
  392. package/contracts/ugc/gameplay-tests/v1/cases.mjs +0 -70
  393. package/contracts/ugc/gameplay-tests/v1/cases.schema.json +0 -262
  394. package/contracts/ugc/gameplay-tests/v1/conformance/run-vectors.mjs +0 -21
  395. package/contracts/ugc/gameplay-tests/v1/conformance/web/index.html +0 -1
  396. package/contracts/ugc/gameplay-tests/v1/conformance/web/runner.mjs +0 -4
  397. package/contracts/ugc/gameplay-tests/v1/contract-set.json +0 -9
  398. package/contracts/ugc/gameplay-tests/v1/scene-step.mjs +0 -49
  399. package/contracts/ugc/gameplay-tests/v1/testdata/vectors.json +0 -1504
  400. package/contracts/ugc/ground-rules/v1/README.md +0 -44
  401. package/contracts/ugc/ground-rules/v1/conformance/run-vectors.mjs +0 -31
  402. package/contracts/ugc/ground-rules/v1/conformance/web/index.html +0 -1
  403. package/contracts/ugc/ground-rules/v1/conformance/web/runner.mjs +0 -4
  404. package/contracts/ugc/ground-rules/v1/contract-set.json +0 -9
  405. package/contracts/ugc/ground-rules/v1/effective-ground-rules.schema.json +0 -27
  406. package/contracts/ugc/ground-rules/v1/ground-rules.schema.json +0 -33
  407. package/contracts/ugc/ground-rules/v1/testdata/vectors.json +0 -57
  408. package/contracts/ugc/ground-rules/v2/README.md +0 -88
  409. package/contracts/ugc/ground-rules/v2/contract-set.json +0 -20
  410. package/contracts/ugc/ground-rules/v2/ground-rules.schema.json +0 -373
  411. package/contracts/ugc/ground-rules/v2/spaces.test.mjs +0 -58
  412. package/contracts/ugc/ground-rules/v2/spatial-source.schema.json +0 -788
  413. package/contracts/ugc/ground-rules/v2/spatial.test.mjs +0 -142
  414. package/contracts/ugc/ground-rules/v2.2/README.md +0 -73
  415. package/contracts/ugc/ground-rules/v2.2/center-band.test.mjs +0 -149
  416. package/contracts/ugc/ground-rules/v2.2/contract-set.json +0 -8
  417. package/contracts/ugc/ground-rules/v2.2/spatial-source.schema.json +0 -1049
  418. package/contracts/ugc/personal-state/v1/README.md +0 -181
  419. package/contracts/ugc/personal-state/v1/declaration.schema.json +0 -295
  420. package/contracts/ugc/personal-state/v1/declaration.test.mjs +0 -26
  421. package/contracts/ugc/personal-state/v1/marker.schema.json +0 -9
  422. package/contracts/ugc/personal-state/v1/node-plan.test.mjs +0 -65
  423. package/contracts/ugc/pipeline/v1/PLATFORM-SOURCE.md +0 -54
  424. package/contracts/ugc/pipeline/v1/PRESENTATION.md +0 -13
  425. package/contracts/ugc/pipeline/v1/build-record.schema.json +0 -93
  426. package/contracts/ugc/pipeline/v1/conformance/js/pipeline-validator.mjs +0 -196
  427. package/contracts/ugc/pipeline/v1/conformance/js/platform-release-validator.mjs +0 -78
  428. package/contracts/ugc/pipeline/v1/conformance/web/index.html +0 -5
  429. package/contracts/ugc/pipeline/v1/conformance/web/runner.mjs +0 -30
  430. package/contracts/ugc/pipeline/v1/contract-set.json +0 -30
  431. package/contracts/ugc/pipeline/v1/error-codes.json +0 -95
  432. package/contracts/ugc/pipeline/v1/platform-publication-binding.schema.json +0 -56
  433. package/contracts/ugc/pipeline/v1/public-release-descriptor.schema.json +0 -264
  434. package/contracts/ugc/pipeline/v1/publication-operation.schema.json +0 -97
  435. package/contracts/ugc/pipeline/v1/release-index.schema.json +0 -192
  436. package/contracts/ugc/pipeline/v1/review-decision.schema.json +0 -212
  437. package/contracts/ugc/pipeline/v1/submission-receipt.schema.json +0 -15
  438. package/contracts/ugc/pipeline/v1/testdata/vectors.json +0 -1713
  439. package/contracts/ugc/private-event-view/v1/README.md +0 -83
  440. package/contracts/ugc/private-event-view/v1/conformance/run-vectors.mjs +0 -65
  441. package/contracts/ugc/private-event-view/v1/conformance/web/index.html +0 -1
  442. package/contracts/ugc/private-event-view/v1/conformance/web/runner.mjs +0 -5
  443. package/contracts/ugc/private-event-view/v1/contract-set.json +0 -9
  444. package/contracts/ugc/private-event-view/v1/export.mjs +0 -22
  445. package/contracts/ugc/private-event-view/v1/testdata/vectors.json +0 -22
  446. package/contracts/ugc/private-event-view/v1/view.mjs +0 -130
  447. package/contracts/ugc/private-event-view/v1/view.schema.json +0 -204
  448. package/contracts/ugc/private-events/v1/README.md +0 -102
  449. package/contracts/ugc/private-events/v1/conformance/run-vectors.mjs +0 -52
  450. package/contracts/ugc/private-events/v1/conformance/web/index.html +0 -1
  451. package/contracts/ugc/private-events/v1/conformance/web/runner.mjs +0 -4
  452. package/contracts/ugc/private-events/v1/contract-set.json +0 -9
  453. package/contracts/ugc/private-events/v1/events.schema.json +0 -19
  454. package/contracts/ugc/private-events/v1/grant.schema.json +0 -15
  455. package/contracts/ugc/private-events/v1/output.schema.json +0 -15
  456. package/contracts/ugc/private-events/v1/testdata/vectors.json +0 -55
  457. package/contracts/ugc/private-state/v1/README.md +0 -95
  458. package/contracts/ugc/private-state/v1/conformance/run-vectors.mjs +0 -40
  459. package/contracts/ugc/private-state/v1/conformance/web/index.html +0 -1
  460. package/contracts/ugc/private-state/v1/conformance/web/runner.mjs +0 -4
  461. package/contracts/ugc/private-state/v1/contract-set.json +0 -9
  462. package/contracts/ugc/private-state/v1/field-table.schema.json +0 -136
  463. package/contracts/ugc/private-state/v1/projection.schema.json +0 -515
  464. package/contracts/ugc/private-state/v1/testdata/vectors.json +0 -76
  465. package/contracts/ugc/private-state-view/v1/README.md +0 -91
  466. package/contracts/ugc/private-state-view/v1/conformance/run-vectors.mjs +0 -52
  467. package/contracts/ugc/private-state-view/v1/conformance/web/index.html +0 -1
  468. package/contracts/ugc/private-state-view/v1/conformance/web/runner.mjs +0 -5
  469. package/contracts/ugc/private-state-view/v1/contract-set.json +0 -24
  470. package/contracts/ugc/private-state-view/v1/export.mjs +0 -29
  471. package/contracts/ugc/private-state-view/v1/publication.schema.json +0 -82
  472. package/contracts/ugc/private-state-view/v1/testdata/vectors.json +0 -21
  473. package/contracts/ugc/private-state-view/v1/view.mjs +0 -199
  474. package/contracts/ugc/private-state-view/v1/view.schema.json +0 -255
  475. package/contracts/ugc/public-runtime/v1/static-room-runtime.test.mjs +0 -225
  476. package/contracts/ugc/registry/v1/capabilities-lock.schema.json +0 -110
  477. package/contracts/ugc/registry/v1/capability-query-result.schema.json +0 -33
  478. package/contracts/ugc/registry/v1/capability-query.schema.json +0 -14
  479. package/contracts/ugc/registry/v1/capability-registry.schema.json +0 -83
  480. package/contracts/ugc/registry/v1/conformance/web/index.html +0 -5
  481. package/contracts/ugc/registry/v1/conformance/web/runner.mjs +0 -68
  482. package/contracts/ugc/registry/v1/contract-set.json +0 -23
  483. package/contracts/ugc/registry/v1/effective-budgets.schema.json +0 -34
  484. package/contracts/ugc/registry/v1/error-codes.json +0 -11
  485. package/contracts/ugc/registry/v1/network-profile-lock.schema.json +0 -26
  486. package/contracts/ugc/registry/v1/registry.json +0 -1
  487. package/contracts/ugc/registry/v1/resolution-policy.json +0 -70
  488. package/contracts/ugc/registry/v1/resolution-result.schema.json +0 -49
  489. package/contracts/ugc/registry/v1/testdata/vectors.json +0 -405
  490. package/contracts/ugc/resource-bindings/v1/AUTHORED-AVATAR.md +0 -133
  491. package/contracts/ugc/resource-bindings/v1/README.md +0 -61
  492. package/contracts/ugc/resource-bindings/v1/authored-avatar.schema.json +0 -48
  493. package/contracts/ugc/resource-bindings/v1/bindings.schema.json +0 -45
  494. package/contracts/ugc/resource-bindings/v1/conformance/authored-avatar-vectors.mjs +0 -26
  495. package/contracts/ugc/resource-bindings/v1/conformance/run-vectors.mjs +0 -32
  496. package/contracts/ugc/resource-bindings/v1/conformance/web/index.html +0 -1
  497. package/contracts/ugc/resource-bindings/v1/conformance/web/runner.mjs +0 -13
  498. package/contracts/ugc/resource-bindings/v1/contract-set.json +0 -9
  499. package/contracts/ugc/resource-bindings/v1/testdata/authored-avatar-vectors.json +0 -146
  500. package/contracts/ugc/resource-bindings/v1/testdata/authored-avatar.json +0 -13
  501. package/contracts/ugc/resource-bindings/v1/testdata/vectors.json +0 -68
  502. package/contracts/ugc/sandbox/v1/conformance/web/index.html +0 -5
  503. package/contracts/ugc/sandbox/v1/conformance/web/runner.mjs +0 -26
  504. package/contracts/ugc/sandbox/v1/contract-set.json +0 -19
  505. package/contracts/ugc/sandbox/v1/error-codes.json +0 -25
  506. package/contracts/ugc/sandbox/v1/execution-result.schema.json +0 -80
  507. package/contracts/ugc/sandbox/v1/launch-request.schema.json +0 -96
  508. package/contracts/ugc/sandbox/v1/lifecycle-message.schema.json +0 -18
  509. package/contracts/ugc/sandbox/v1/local-launch-request.schema.json +0 -34
  510. package/contracts/ugc/sandbox/v1/private-ecs-grant.schema.json +0 -32
  511. package/contracts/ugc/sandbox/v1/sandbox-profile.schema.json +0 -70
  512. package/contracts/ugc/sandbox/v1/testdata/vectors.json +0 -89
  513. package/contracts/ugc/scene-interaction/v1/README.md +0 -63
  514. package/contracts/ugc/scene-interaction/v1/conformance/run-vectors.mjs +0 -26
  515. package/contracts/ugc/scene-interaction/v1/conformance/web/index.html +0 -1
  516. package/contracts/ugc/scene-interaction/v1/conformance/web/runner.mjs +0 -4
  517. package/contracts/ugc/scene-interaction/v1/contract-set.json +0 -26
  518. package/contracts/ugc/scene-interaction/v1/effective-targets.schema.json +0 -76
  519. package/contracts/ugc/scene-interaction/v1/request.schema.json +0 -30
  520. package/contracts/ugc/scene-interaction/v1/result.schema.json +0 -88
  521. package/contracts/ugc/scene-interaction/v1/targets.schema.json +0 -49
  522. package/contracts/ugc/scene-interaction/v1/testdata/vectors.json +0 -732
  523. package/contracts/ugc/scene-interaction/v2/README.md +0 -63
  524. package/contracts/ugc/scene-interaction/v2/contract-set.json +0 -19
  525. package/contracts/ugc/scene-interaction/v2/metric.test.mjs +0 -99
  526. package/contracts/ugc/scene-interaction/v2/targets.schema.json +0 -229
  527. package/contracts/ugc/scene-presentation/v1/INK-MATH.md +0 -64
  528. package/contracts/ugc/scene-presentation/v1/README.md +0 -126
  529. package/contracts/ugc/scene-presentation/v1/RENDER-POLICY.md +0 -63
  530. package/contracts/ugc/scene-presentation/v1/conformance/ink-vectors.mjs +0 -34
  531. package/contracts/ugc/scene-presentation/v1/conformance/render-policy-vectors.mjs +0 -62
  532. package/contracts/ugc/scene-presentation/v1/conformance/vectors.mjs +0 -128
  533. package/contracts/ugc/scene-presentation/v1/contract-set.json +0 -6
  534. package/contracts/ugc/scene-presentation/v1/ink-math.mjs +0 -70
  535. package/contracts/ugc/scene-presentation/v1/render-policy.schema.json +0 -27
  536. package/contracts/ugc/scene-presentation/v1/scene.schema.json +0 -66
  537. package/contracts/ugc/v1/COVER.md +0 -38
  538. package/contracts/ugc/v1/SCENE-PROVENANCE.md +0 -54
  539. package/contracts/ugc/v1/candidate-submission.schema.json +0 -16
  540. package/contracts/ugc/v1/capability-request.schema.json +0 -29
  541. package/contracts/ugc/v1/compatibility.json +0 -32
  542. package/contracts/ugc/v1/components.schema.json +0 -77
  543. package/contracts/ugc/v1/conformance/js/capability-operations.mjs +0 -13
  544. package/contracts/ugc/v1/conformance/js/scene-provenance.mjs +0 -121
  545. package/contracts/ugc/v1/conformance/js/source-validator.mjs +0 -99
  546. package/contracts/ugc/v1/conformance/web/index.html +0 -5
  547. package/contracts/ugc/v1/conformance/web/runner.mjs +0 -82
  548. package/contracts/ugc/v1/contract-set.json +0 -38
  549. package/contracts/ugc/v1/creator-sdk.json +0 -84
  550. package/contracts/ugc/v1/error-codes.json +0 -53
  551. package/contracts/ugc/v1/manifest.schema.json +0 -215
  552. package/contracts/ugc/v1/network-intent.schema.json +0 -15
  553. package/contracts/ugc/v1/prefabs.schema.json +0 -29
  554. package/contracts/ugc/v1/provenance.schema.json +0 -160
  555. package/contracts/ugc/v1/scene.schema.json +0 -37
  556. package/contracts/ugc/v1/testdata/capability-operation-vectors.json +0 -243
  557. package/contracts/ugc/v1/testdata/cover-vectors.json +0 -25
  558. package/contracts/ugc/v1/testdata/invalid/authored-avatar-missing-capability.json +0 -44
  559. package/contracts/ugc/v1/testdata/invalid/authored-avatar-wrong-capability.json +0 -51
  560. package/contracts/ugc/v1/testdata/invalid/budget-overflow.json +0 -1
  561. package/contracts/ugc/v1/testdata/invalid/build-field-override.json +0 -1
  562. package/contracts/ugc/v1/testdata/invalid/creator-server-entrypoint.json +0 -5
  563. package/contracts/ugc/v1/testdata/invalid/forbidden-network-control.json +0 -1
  564. package/contracts/ugc/v1/testdata/invalid/ground-authority.json +0 -57
  565. package/contracts/ugc/v1/testdata/invalid/ground-budget.json +0 -56
  566. package/contracts/ugc/v1/testdata/invalid/ground-dependency.json +0 -49
  567. package/contracts/ugc/v1/testdata/invalid/ground-identity.json +0 -56
  568. package/contracts/ugc/v1/testdata/invalid/ground-missing.json +0 -13
  569. package/contracts/ugc/v1/testdata/invalid/ground-optional.json +0 -60
  570. package/contracts/ugc/v1/testdata/invalid/ground-path.json +0 -56
  571. package/contracts/ugc/v1/testdata/invalid/ground-run-dependency.json +0 -56
  572. package/contracts/ugc/v1/testdata/invalid/ground-version.json +0 -56
  573. package/contracts/ugc/v1/testdata/invalid/missing-required-field.json +0 -1
  574. package/contracts/ugc/v1/testdata/invalid/missing-shared-entrypoint.json +0 -5
  575. package/contracts/ugc/v1/testdata/invalid/path-escape.json +0 -1
  576. package/contracts/ugc/v1/testdata/invalid/private-events-authority.json +0 -35
  577. package/contracts/ugc/v1/testdata/invalid/private-events-budget.json +0 -35
  578. package/contracts/ugc/v1/testdata/invalid/private-events-dependency.json +0 -27
  579. package/contracts/ugc/v1/testdata/invalid/private-events-empty.json +0 -20
  580. package/contracts/ugc/v1/testdata/invalid/private-events-identity.json +0 -34
  581. package/contracts/ugc/v1/testdata/invalid/private-events-missing.json +0 -13
  582. package/contracts/ugc/v1/testdata/invalid/private-events-optional.json +0 -38
  583. package/contracts/ugc/v1/testdata/invalid/private-events-path.json +0 -34
  584. package/contracts/ugc/v1/testdata/invalid/private-events-type.json +0 -34
  585. package/contracts/ugc/v1/testdata/invalid/private-events-unknown-ref.json +0 -34
  586. package/contracts/ugc/v1/testdata/invalid/private-events-version.json +0 -34
  587. package/contracts/ugc/v1/testdata/invalid/resource-bindings-identity.json +0 -18
  588. package/contracts/ugc/v1/testdata/invalid/resource-bindings-kind.json +0 -19
  589. package/contracts/ugc/v1/testdata/invalid/resource-bindings-missing.json +0 -6
  590. package/contracts/ugc/v1/testdata/invalid/resource-bindings-path.json +0 -6
  591. package/contracts/ugc/v1/testdata/invalid/resource-bindings-type.json +0 -8
  592. package/contracts/ugc/v1/testdata/invalid/resource-bindings-unknown.json +0 -18
  593. package/contracts/ugc/v1/testdata/invalid/scene-interactions-authority.json +0 -61
  594. package/contracts/ugc/v1/testdata/invalid/scene-interactions-core-unknown.json +0 -61
  595. package/contracts/ugc/v1/testdata/invalid/scene-interactions-dependency.json +0 -53
  596. package/contracts/ugc/v1/testdata/invalid/scene-interactions-identity.json +0 -60
  597. package/contracts/ugc/v1/testdata/invalid/scene-interactions-missing-transform.json +0 -50
  598. package/contracts/ugc/v1/testdata/invalid/scene-interactions-missing.json +0 -49
  599. package/contracts/ugc/v1/testdata/invalid/scene-interactions-optional.json +0 -64
  600. package/contracts/ugc/v1/testdata/invalid/scene-interactions-partial-transform.json +0 -59
  601. package/contracts/ugc/v1/testdata/invalid/scene-interactions-path.json +0 -60
  602. package/contracts/ugc/v1/testdata/invalid/scene-interactions-radius.json +0 -60
  603. package/contracts/ugc/v1/testdata/invalid/scene-interactions-unknown-target.json +0 -60
  604. package/contracts/ugc/v1/testdata/invalid/scene-interactions-version.json +0 -60
  605. package/contracts/ugc/v1/testdata/invalid/scene-presentation-authority.json +0 -166
  606. package/contracts/ugc/v1/testdata/invalid/scene-presentation-capability.json +0 -158
  607. package/contracts/ugc/v1/testdata/invalid/scene-presentation-identity.json +0 -165
  608. package/contracts/ugc/v1/testdata/invalid/scene-presentation-missing.json +0 -13
  609. package/contracts/ugc/v1/testdata/invalid/scene-presentation-optional.json +0 -169
  610. package/contracts/ugc/v1/testdata/invalid/scene-presentation-path.json +0 -165
  611. package/contracts/ugc/v1/testdata/invalid/scene-presentation-undeclared.json +0 -163
  612. package/contracts/ugc/v1/testdata/invalid/scene-presentation-unknown-material.json +0 -165
  613. package/contracts/ugc/v1/testdata/invalid/schema-incompatible.json +0 -1
  614. package/contracts/ugc/v1/testdata/invalid/unknown-required-component.json +0 -1
  615. package/contracts/ugc/v1/testdata/invalid/world-scene-dual-motion.json +0 -7
  616. package/contracts/ugc/v1/testdata/invalid/world-scene-identity.json +0 -90
  617. package/contracts/ugc/v1/testdata/invalid/world-scene-missing-capability.json +0 -85
  618. package/contracts/ugc/v1/testdata/invalid/world-scene-missing.json +0 -28
  619. package/contracts/ugc/v1/testdata/invalid/world-scene-optional-capability.json +0 -94
  620. package/contracts/ugc/v1/testdata/invalid/world-scene-path.json +0 -6
  621. package/contracts/ugc/v1/testdata/invalid/world-scene-version.json +0 -90
  622. package/contracts/ugc/v1/testdata/scene-provenance-vectors.json +0 -56
  623. package/contracts/ugc/v1/testdata/source-vectors.json +0 -83
  624. package/contracts/ugc/v1/testdata/valid/authored-avatar.json +0 -51
  625. package/contracts/ugc/v1/testdata/valid/boundary.json +0 -1
  626. package/contracts/ugc/v1/testdata/valid/components.json +0 -15
  627. package/contracts/ugc/v1/testdata/valid/cosmetic.json +0 -9
  628. package/contracts/ugc/v1/testdata/valid/ground-rules.json +0 -56
  629. package/contracts/ugc/v1/testdata/valid/minimal.json +0 -15
  630. package/contracts/ugc/v1/testdata/valid/prefabs.json +0 -11
  631. package/contracts/ugc/v1/testdata/valid/private-events.json +0 -34
  632. package/contracts/ugc/v1/testdata/valid/resource-bindings.json +0 -18
  633. package/contracts/ugc/v1/testdata/valid/scene-interactions.json +0 -60
  634. package/contracts/ugc/v1/testdata/valid/scene-presentation.json +0 -165
  635. package/contracts/ugc/v1/testdata/valid/scene.json +0 -6
  636. package/contracts/ugc/v1/testdata/valid/unknown-optional-component.json +0 -1
  637. package/contracts/ugc/v1/testdata/valid/world-scene.json +0 -90
  638. package/contracts/ugc/v1/testdata/vectors.json +0 -555
  639. package/contracts/ugc/v1/validation-report.schema.json +0 -61
  640. package/contracts/ugc/world-scene/v1/collision-identity.mjs +0 -73
  641. package/contracts/ugc/world-scene/v1/collision-target.schema.json +0 -18
  642. package/contracts/ugc/world-scene/v1/conformance/flight-avatar-vectors.mjs +0 -27
  643. package/contracts/ugc/world-scene/v1/conformance/run-vectors.mjs +0 -29
  644. package/contracts/ugc/world-scene/v1/coordinates.schema.json +0 -16
  645. package/contracts/ugc/world-scene/v1/flight-avatar-actions.mjs +0 -3
  646. package/contracts/ugc/world-scene/v1/flight-avatar-sample.schema.json +0 -14
  647. package/contracts/ugc/world-scene/v1/scene-declaration.schema.json +0 -40
  648. package/contracts/ugc/world-scene/v1/testdata/flight-avatar-actions.json +0 -48
  649. package/contracts/ugc/world-scene/v1/testdata/scene-declaration-vectors.json +0 -103
  650. package/contracts/ugc/world-scene/v1/testdata/vectors.json +0 -55
  651. package/contracts/ugc/world-scene/v1/visual-tileset.mjs +0 -112
  652. package/contracts/ugc/world-scene/v1/visual-tileset.schema.json +0 -35
  653. package/contracts/ugc/world-scene/v2/ASSET-GRAPH.md +0 -13
  654. package/contracts/ugc/world-scene/v2/ENCODED-RESOURCES.md +0 -117
  655. package/contracts/ugc/world-scene/v2/PARTITION.md +0 -59
  656. package/contracts/ugc/world-scene/v2/VISUAL-TILESET.md +0 -80
  657. package/contracts/ugc/world-scene/v2/asset-graph.mjs +0 -169
  658. package/contracts/ugc/world-scene/v2/collision-index.schema.json +0 -29
  659. package/contracts/ugc/world-scene/v2/collision-partition.schema.json +0 -37
  660. package/contracts/ugc/world-scene/v2/conformance/asset-graph-vectors.mjs +0 -52
  661. package/contracts/ugc/world-scene/v2/conformance/collision-index-vectors.mjs +0 -29
  662. package/contracts/ugc/world-scene/v2/conformance/encoded-resource-vectors.mjs +0 -17
  663. package/contracts/ugc/world-scene/v2/conformance/partition-vectors.mjs +0 -74
  664. package/contracts/ugc/world-scene/v2/conformance/visual-vectors.mjs +0 -24
  665. package/contracts/ugc/world-scene/v2/contract-set.json +0 -50
  666. package/contracts/ugc/world-scene/v2/encoded-resource.schema.json +0 -17
  667. package/contracts/ugc/world-scene/v2/scene-declaration.schema.json +0 -21
  668. package/contracts/ugc/world-scene/v2/testdata/asset-graph-vectors.json +0 -3354
  669. package/contracts/ugc/world-scene/v2/testdata/collision-index-vectors.json +0 -103
  670. package/contracts/ugc/world-scene/v2/testdata/encoded-resource-vectors.json +0 -372
  671. package/contracts/ugc/world-scene/v2/testdata/visual-vectors.json +0 -43
  672. package/contracts/ugc/world-scene/v2/vendor/pako-raw-inflate.provenance.json +0 -43
  673. package/contracts/ugc/world-scene/v2/visual-tileset.mjs +0 -107
  674. package/contracts/ugc/world-scene/v2/visual-tileset.schema.json +0 -33
  675. package/contracts/ugc/world-scene-runtime/v1/runtime-plan.schema.json +0 -660
  676. package/contracts/ugc/world-scene-runtime/v1/testdata/policy-vectors.json +0 -40
  677. package/contracts/ugc/world-scene-runtime/v2/COLLISION-CAPACITY.md +0 -74
  678. package/contracts/ugc/world-scene-runtime/v2/REPORT.md +0 -91
  679. package/contracts/ugc/world-scene-runtime/v2/RUNTIME-PROJECTION.md +0 -110
  680. package/contracts/ugc/world-scene-runtime/v2/VISUAL-WORK.md +0 -72
  681. package/contracts/ugc/world-scene-runtime/v2/collision-capacity.schema.json +0 -62
  682. package/contracts/ugc/world-scene-runtime/v2/conformance/capacity-vectors.mjs +0 -25
  683. package/contracts/ugc/world-scene-runtime/v2/conformance/report-vectors.mjs +0 -141
  684. package/contracts/ugc/world-scene-runtime/v2/conformance/runtime-vectors.mjs +0 -41
  685. package/contracts/ugc/world-scene-runtime/v2/conformance/visual-work-vectors.mjs +0 -21
  686. package/contracts/ugc/world-scene-runtime/v2/contract-set.json +0 -45
  687. package/contracts/ugc/world-scene-runtime/v2/report.mjs +0 -184
  688. package/contracts/ugc/world-scene-runtime/v2/runtime-plan.schema.json +0 -38
  689. package/contracts/ugc/world-scene-runtime/v2/testdata/capacity-vectors.json +0 -30
  690. package/contracts/ugc/world-scene-runtime/v2/testdata/report-fixture.json +0 -250
  691. package/contracts/ugc/world-scene-runtime/v2/testdata/runtime-vectors.json +0 -39
  692. package/contracts/ugc/world-scene-runtime/v2/testdata/visual-work-vectors.json +0 -28
  693. package/contracts/ugc/world-scene-runtime/v2/visual-work-policy.mjs +0 -59
  694. package/document-presentation.snapshot.lock.json +0 -40
  695. package/ground-endpoint.snapshot.lock.json +0 -36
  696. package/ground-spaces.snapshot.lock.json +0 -57
  697. package/lib/creator-source-archive.mjs +0 -182
  698. package/node_modules/@esbuild/darwin-arm64/README.md +0 -3
  699. package/node_modules/@esbuild/darwin-arm64/bin/esbuild +0 -0
  700. package/node_modules/@esbuild/darwin-arm64/package.json +0 -20
  701. package/node_modules/@esbuild/darwin-x64/README.md +0 -3
  702. package/node_modules/@esbuild/darwin-x64/bin/esbuild +0 -0
  703. package/node_modules/@esbuild/darwin-x64/package.json +0 -20
  704. package/node_modules/@esbuild/linux-arm64/README.md +0 -3
  705. package/node_modules/@esbuild/linux-arm64/bin/esbuild +0 -0
  706. package/node_modules/@esbuild/linux-arm64/package.json +0 -20
  707. package/node_modules/@esbuild/linux-x64/README.md +0 -3
  708. package/node_modules/@esbuild/linux-x64/bin/esbuild +0 -0
  709. package/node_modules/@esbuild/linux-x64/package.json +0 -20
  710. package/node_modules/@modelcontextprotocol/core/LICENSE +0 -216
  711. package/node_modules/@modelcontextprotocol/core/README.md +0 -40
  712. package/node_modules/@modelcontextprotocol/core/dist/auth-BWdKR39I.d.mts +0 -8501
  713. package/node_modules/@modelcontextprotocol/core/dist/auth-BWdKR39I.d.mts.map +0 -1
  714. package/node_modules/@modelcontextprotocol/core/dist/auth-CUe6YdwF.mjs +0 -1678
  715. package/node_modules/@modelcontextprotocol/core/dist/auth-CUe6YdwF.mjs.map +0 -1
  716. package/node_modules/@modelcontextprotocol/core/dist/auth-CfDMXiII.cjs +0 -2899
  717. package/node_modules/@modelcontextprotocol/core/dist/auth-CfDMXiII.cjs.map +0 -1
  718. package/node_modules/@modelcontextprotocol/core/dist/auth-hYtaIUZm.d.cts +0 -8501
  719. package/node_modules/@modelcontextprotocol/core/dist/auth-hYtaIUZm.d.cts.map +0 -1
  720. package/node_modules/@modelcontextprotocol/core/dist/index.cjs +0 -175
  721. package/node_modules/@modelcontextprotocol/core/dist/index.d.cts +0 -2
  722. package/node_modules/@modelcontextprotocol/core/dist/index.d.mts +0 -2
  723. package/node_modules/@modelcontextprotocol/core/dist/index.mjs +0 -3
  724. package/node_modules/@modelcontextprotocol/core/dist/internal.cjs +0 -201
  725. package/node_modules/@modelcontextprotocol/core/dist/internal.d.cts +0 -99
  726. package/node_modules/@modelcontextprotocol/core/dist/internal.d.cts.map +0 -1
  727. package/node_modules/@modelcontextprotocol/core/dist/internal.d.mts +0 -99
  728. package/node_modules/@modelcontextprotocol/core/dist/internal.d.mts.map +0 -1
  729. package/node_modules/@modelcontextprotocol/core/dist/internal.mjs +0 -3
  730. package/node_modules/@modelcontextprotocol/core/package.json +0 -85
  731. package/node_modules/@modelcontextprotocol/server/LICENSE +0 -216
  732. package/node_modules/@modelcontextprotocol/server/README.md +0 -30
  733. package/node_modules/@modelcontextprotocol/server/dist/ajvProvider-CEoC__sr.mjs +0 -7514
  734. package/node_modules/@modelcontextprotocol/server/dist/ajvProvider-CEoC__sr.mjs.map +0 -1
  735. package/node_modules/@modelcontextprotocol/server/dist/ajvProvider-CgI-5L6O.d.mts +0 -1071
  736. package/node_modules/@modelcontextprotocol/server/dist/ajvProvider-CgI-5L6O.d.mts.map +0 -1
  737. package/node_modules/@modelcontextprotocol/server/dist/ajvProvider-FOQRM7up.d.cts +0 -1071
  738. package/node_modules/@modelcontextprotocol/server/dist/ajvProvider-FOQRM7up.d.cts.map +0 -1
  739. package/node_modules/@modelcontextprotocol/server/dist/ajvProvider-ZaoO9afR.cjs +0 -7531
  740. package/node_modules/@modelcontextprotocol/server/dist/ajvProvider-ZaoO9afR.cjs.map +0 -1
  741. package/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-BwbPzsdI.cjs +0 -986
  742. package/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-BwbPzsdI.cjs.map +0 -1
  743. package/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-C03CSigr.d.mts +0 -74
  744. package/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-C03CSigr.d.mts.map +0 -1
  745. package/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-doTkZbTr.d.cts +0 -74
  746. package/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-doTkZbTr.d.cts.map +0 -1
  747. package/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-p3WaZPqB.mjs +0 -981
  748. package/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-p3WaZPqB.mjs.map +0 -1
  749. package/node_modules/@modelcontextprotocol/server/dist/chunk-Bnu9O96Y.cjs +0 -60
  750. package/node_modules/@modelcontextprotocol/server/dist/chunk-Br0eD_fh.mjs +0 -42
  751. package/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-CLhGwQTn.d.mts +0 -4043
  752. package/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-CLhGwQTn.d.mts.map +0 -1
  753. package/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-dBHMsxwf.d.cts +0 -4045
  754. package/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-dBHMsxwf.d.cts.map +0 -1
  755. package/node_modules/@modelcontextprotocol/server/dist/dialects-D8eXzoGv.cjs +0 -46
  756. package/node_modules/@modelcontextprotocol/server/dist/dialects-D8eXzoGv.cjs.map +0 -1
  757. package/node_modules/@modelcontextprotocol/server/dist/dialects-DoSzNhcb.mjs +0 -34
  758. package/node_modules/@modelcontextprotocol/server/dist/dialects-DoSzNhcb.mjs.map +0 -1
  759. package/node_modules/@modelcontextprotocol/server/dist/index.cjs +0 -2055
  760. package/node_modules/@modelcontextprotocol/server/dist/index.cjs.map +0 -1
  761. package/node_modules/@modelcontextprotocol/server/dist/index.d.cts +0 -739
  762. package/node_modules/@modelcontextprotocol/server/dist/index.d.cts.map +0 -1
  763. package/node_modules/@modelcontextprotocol/server/dist/index.d.mts +0 -739
  764. package/node_modules/@modelcontextprotocol/server/dist/index.d.mts.map +0 -1
  765. package/node_modules/@modelcontextprotocol/server/dist/index.mjs +0 -1870
  766. package/node_modules/@modelcontextprotocol/server/dist/index.mjs.map +0 -1
  767. package/node_modules/@modelcontextprotocol/server/dist/mcp-D7GmuPnv.cjs +0 -2022
  768. package/node_modules/@modelcontextprotocol/server/dist/mcp-D7GmuPnv.cjs.map +0 -1
  769. package/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs +0 -1931
  770. package/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs.map +0 -1
  771. package/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.cjs +0 -23
  772. package/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.cjs.map +0 -1
  773. package/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.d.cts +0 -11
  774. package/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.d.cts.map +0 -1
  775. package/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.d.mts +0 -11
  776. package/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.d.mts.map +0 -1
  777. package/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.mjs +0 -22
  778. package/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.mjs.map +0 -1
  779. package/node_modules/@modelcontextprotocol/server/dist/shimsNode.cjs +0 -12
  780. package/node_modules/@modelcontextprotocol/server/dist/shimsNode.d.cts +0 -3
  781. package/node_modules/@modelcontextprotocol/server/dist/shimsNode.d.mts +0 -3
  782. package/node_modules/@modelcontextprotocol/server/dist/shimsNode.mjs +0 -4
  783. package/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.cjs +0 -30
  784. package/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.cjs.map +0 -1
  785. package/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.d.cts +0 -10
  786. package/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.d.cts.map +0 -1
  787. package/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.d.mts +0 -10
  788. package/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.d.mts.map +0 -1
  789. package/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.mjs +0 -29
  790. package/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.mjs.map +0 -1
  791. package/node_modules/@modelcontextprotocol/server/dist/src-CX2iR2pK.mjs +0 -7606
  792. package/node_modules/@modelcontextprotocol/server/dist/src-CX2iR2pK.mjs.map +0 -1
  793. package/node_modules/@modelcontextprotocol/server/dist/src-STyD_Vvf.cjs +0 -8104
  794. package/node_modules/@modelcontextprotocol/server/dist/src-STyD_Vvf.cjs.map +0 -1
  795. package/node_modules/@modelcontextprotocol/server/dist/stdio.cjs +0 -564
  796. package/node_modules/@modelcontextprotocol/server/dist/stdio.cjs.map +0 -1
  797. package/node_modules/@modelcontextprotocol/server/dist/stdio.d.cts +0 -107
  798. package/node_modules/@modelcontextprotocol/server/dist/stdio.d.cts.map +0 -1
  799. package/node_modules/@modelcontextprotocol/server/dist/stdio.d.mts +0 -107
  800. package/node_modules/@modelcontextprotocol/server/dist/stdio.d.mts.map +0 -1
  801. package/node_modules/@modelcontextprotocol/server/dist/stdio.mjs +0 -562
  802. package/node_modules/@modelcontextprotocol/server/dist/stdio.mjs.map +0 -1
  803. package/node_modules/@modelcontextprotocol/server/dist/types-DUs7mGBv.d.mts +0 -1099
  804. package/node_modules/@modelcontextprotocol/server/dist/types-DUs7mGBv.d.mts.map +0 -1
  805. package/node_modules/@modelcontextprotocol/server/dist/types-DsbMXNFL.d.cts +0 -1099
  806. package/node_modules/@modelcontextprotocol/server/dist/types-DsbMXNFL.d.cts.map +0 -1
  807. package/node_modules/@modelcontextprotocol/server/dist/validators/ajv.cjs +0 -5
  808. package/node_modules/@modelcontextprotocol/server/dist/validators/ajv.d.cts +0 -2
  809. package/node_modules/@modelcontextprotocol/server/dist/validators/ajv.d.mts +0 -2
  810. package/node_modules/@modelcontextprotocol/server/dist/validators/ajv.mjs +0 -3
  811. package/node_modules/@modelcontextprotocol/server/dist/validators/cfWorker.cjs +0 -3
  812. package/node_modules/@modelcontextprotocol/server/dist/validators/cfWorker.d.cts +0 -2
  813. package/node_modules/@modelcontextprotocol/server/dist/validators/cfWorker.d.mts +0 -2
  814. package/node_modules/@modelcontextprotocol/server/dist/validators/cfWorker.mjs +0 -3
  815. package/node_modules/@modelcontextprotocol/server/package.json +0 -160
  816. package/node_modules/esbuild/LICENSE.md +0 -21
  817. package/node_modules/esbuild/README.md +0 -3
  818. package/node_modules/esbuild/bin/esbuild +0 -223
  819. package/node_modules/esbuild/install.js +0 -289
  820. package/node_modules/esbuild/lib/main.d.ts +0 -716
  821. package/node_modules/esbuild/lib/main.js +0 -2242
  822. package/node_modules/esbuild/package.json +0 -49
  823. package/node_modules/smol-toml/LICENSE +0 -24
  824. package/node_modules/smol-toml/README.md +0 -236
  825. package/node_modules/smol-toml/dist/date.d.ts +0 -41
  826. package/node_modules/smol-toml/dist/date.js +0 -127
  827. package/node_modules/smol-toml/dist/error.d.ts +0 -38
  828. package/node_modules/smol-toml/dist/error.js +0 -63
  829. package/node_modules/smol-toml/dist/extract.d.ts +0 -30
  830. package/node_modules/smol-toml/dist/extract.js +0 -109
  831. package/node_modules/smol-toml/dist/index.cjs +0 -906
  832. package/node_modules/smol-toml/dist/index.d.ts +0 -43
  833. package/node_modules/smol-toml/dist/index.js +0 -33
  834. package/node_modules/smol-toml/dist/parse.d.ts +0 -37
  835. package/node_modules/smol-toml/dist/parse.js +0 -148
  836. package/node_modules/smol-toml/dist/primitive.d.ts +0 -31
  837. package/node_modules/smol-toml/dist/primitive.js +0 -178
  838. package/node_modules/smol-toml/dist/stringify.d.ts +0 -31
  839. package/node_modules/smol-toml/dist/stringify.js +0 -163
  840. package/node_modules/smol-toml/dist/struct.d.ts +0 -32
  841. package/node_modules/smol-toml/dist/struct.js +0 -194
  842. package/node_modules/smol-toml/dist/util.d.ts +0 -42
  843. package/node_modules/smol-toml/dist/util.js +0 -106
  844. package/node_modules/smol-toml/package.json +0 -54
  845. package/node_modules/zod/LICENSE +0 -21
  846. package/node_modules/zod/README.md +0 -218
  847. package/node_modules/zod/compile.cjs +0 -77
  848. package/node_modules/zod/compile.d.cts +0 -1
  849. package/node_modules/zod/compile.d.ts +0 -1
  850. package/node_modules/zod/compile.js +0 -52
  851. package/node_modules/zod/index.cjs +0 -33
  852. package/node_modules/zod/index.d.cts +0 -3
  853. package/node_modules/zod/index.d.ts +0 -3
  854. package/node_modules/zod/index.js +0 -7
  855. package/node_modules/zod/locales/index.cjs +0 -17
  856. package/node_modules/zod/locales/index.d.cts +0 -1
  857. package/node_modules/zod/locales/index.d.ts +0 -1
  858. package/node_modules/zod/locales/index.js +0 -1
  859. package/node_modules/zod/locales/package.json +0 -7
  860. package/node_modules/zod/mini/index.cjs +0 -32
  861. package/node_modules/zod/mini/index.d.cts +0 -3
  862. package/node_modules/zod/mini/index.d.ts +0 -3
  863. package/node_modules/zod/mini/index.js +0 -3
  864. package/node_modules/zod/mini/package.json +0 -7
  865. package/node_modules/zod/package.json +0 -146
  866. package/node_modules/zod/src/compile.ts +0 -56
  867. package/node_modules/zod/src/index.ts +0 -7
  868. package/node_modules/zod/src/locales/index.ts +0 -1
  869. package/node_modules/zod/src/mini/index.ts +0 -3
  870. package/node_modules/zod/src/v3/ZodError.ts +0 -340
  871. package/node_modules/zod/src/v3/benchmarks/datetime.ts +0 -58
  872. package/node_modules/zod/src/v3/benchmarks/discriminatedUnion.ts +0 -80
  873. package/node_modules/zod/src/v3/benchmarks/index.ts +0 -59
  874. package/node_modules/zod/src/v3/benchmarks/ipv4.ts +0 -57
  875. package/node_modules/zod/src/v3/benchmarks/object.ts +0 -69
  876. package/node_modules/zod/src/v3/benchmarks/primitives.ts +0 -162
  877. package/node_modules/zod/src/v3/benchmarks/realworld.ts +0 -63
  878. package/node_modules/zod/src/v3/benchmarks/string.ts +0 -55
  879. package/node_modules/zod/src/v3/benchmarks/union.ts +0 -80
  880. package/node_modules/zod/src/v3/errors.ts +0 -13
  881. package/node_modules/zod/src/v3/external.ts +0 -6
  882. package/node_modules/zod/src/v3/helpers/enumUtil.ts +0 -17
  883. package/node_modules/zod/src/v3/helpers/errorUtil.ts +0 -8
  884. package/node_modules/zod/src/v3/helpers/parseUtil.ts +0 -176
  885. package/node_modules/zod/src/v3/helpers/partialUtil.ts +0 -34
  886. package/node_modules/zod/src/v3/helpers/typeAliases.ts +0 -2
  887. package/node_modules/zod/src/v3/helpers/util.ts +0 -224
  888. package/node_modules/zod/src/v3/index.ts +0 -4
  889. package/node_modules/zod/src/v3/locales/en.ts +0 -124
  890. package/node_modules/zod/src/v3/standard-schema.ts +0 -113
  891. package/node_modules/zod/src/v3/tests/Mocker.ts +0 -54
  892. package/node_modules/zod/src/v3/tests/all-errors.test.ts +0 -157
  893. package/node_modules/zod/src/v3/tests/anyunknown.test.ts +0 -28
  894. package/node_modules/zod/src/v3/tests/array.test.ts +0 -71
  895. package/node_modules/zod/src/v3/tests/async-parsing.test.ts +0 -388
  896. package/node_modules/zod/src/v3/tests/async-refinements.test.ts +0 -46
  897. package/node_modules/zod/src/v3/tests/base.test.ts +0 -29
  898. package/node_modules/zod/src/v3/tests/bigint.test.ts +0 -55
  899. package/node_modules/zod/src/v3/tests/branded.test.ts +0 -53
  900. package/node_modules/zod/src/v3/tests/catch.test.ts +0 -220
  901. package/node_modules/zod/src/v3/tests/coerce.test.ts +0 -133
  902. package/node_modules/zod/src/v3/tests/complex.test.ts +0 -70
  903. package/node_modules/zod/src/v3/tests/custom.test.ts +0 -31
  904. package/node_modules/zod/src/v3/tests/date.test.ts +0 -32
  905. package/node_modules/zod/src/v3/tests/deepmasking.test.ts +0 -186
  906. package/node_modules/zod/src/v3/tests/default.test.ts +0 -112
  907. package/node_modules/zod/src/v3/tests/description.test.ts +0 -33
  908. package/node_modules/zod/src/v3/tests/discriminated-unions.test.ts +0 -315
  909. package/node_modules/zod/src/v3/tests/enum.test.ts +0 -80
  910. package/node_modules/zod/src/v3/tests/error.test.ts +0 -586
  911. package/node_modules/zod/src/v3/tests/firstparty.test.ts +0 -87
  912. package/node_modules/zod/src/v3/tests/firstpartyschematypes.test.ts +0 -21
  913. package/node_modules/zod/src/v3/tests/function.test.ts +0 -261
  914. package/node_modules/zod/src/v3/tests/generics.test.ts +0 -48
  915. package/node_modules/zod/src/v3/tests/instanceof.test.ts +0 -37
  916. package/node_modules/zod/src/v3/tests/intersection.test.ts +0 -128
  917. package/node_modules/zod/src/v3/tests/language-server.source.ts +0 -76
  918. package/node_modules/zod/src/v3/tests/language-server.test.ts +0 -206
  919. package/node_modules/zod/src/v3/tests/literal.test.ts +0 -36
  920. package/node_modules/zod/src/v3/tests/map.test.ts +0 -110
  921. package/node_modules/zod/src/v3/tests/masking.test.ts +0 -4
  922. package/node_modules/zod/src/v3/tests/mocker.test.ts +0 -19
  923. package/node_modules/zod/src/v3/tests/nan.test.ts +0 -24
  924. package/node_modules/zod/src/v3/tests/nativeEnum.test.ts +0 -87
  925. package/node_modules/zod/src/v3/tests/nullable.test.ts +0 -42
  926. package/node_modules/zod/src/v3/tests/number.test.ts +0 -176
  927. package/node_modules/zod/src/v3/tests/object-augmentation.test.ts +0 -29
  928. package/node_modules/zod/src/v3/tests/object-in-es5-env.test.ts +0 -29
  929. package/node_modules/zod/src/v3/tests/object.test.ts +0 -431
  930. package/node_modules/zod/src/v3/tests/optional.test.ts +0 -42
  931. package/node_modules/zod/src/v3/tests/parseUtil.test.ts +0 -23
  932. package/node_modules/zod/src/v3/tests/parser.test.ts +0 -41
  933. package/node_modules/zod/src/v3/tests/partials.test.ts +0 -243
  934. package/node_modules/zod/src/v3/tests/pickomit.test.ts +0 -111
  935. package/node_modules/zod/src/v3/tests/pipeline.test.ts +0 -29
  936. package/node_modules/zod/src/v3/tests/preprocess.test.ts +0 -186
  937. package/node_modules/zod/src/v3/tests/primitive.test.ts +0 -440
  938. package/node_modules/zod/src/v3/tests/promise.test.ts +0 -90
  939. package/node_modules/zod/src/v3/tests/readonly.test.ts +0 -114
  940. package/node_modules/zod/src/v3/tests/record.test.ts +0 -171
  941. package/node_modules/zod/src/v3/tests/recursive.test.ts +0 -197
  942. package/node_modules/zod/src/v3/tests/refine.test.ts +0 -313
  943. package/node_modules/zod/src/v3/tests/safeparse.test.ts +0 -27
  944. package/node_modules/zod/src/v3/tests/set.test.ts +0 -142
  945. package/node_modules/zod/src/v3/tests/standard-schema.test.ts +0 -83
  946. package/node_modules/zod/src/v3/tests/string.test.ts +0 -922
  947. package/node_modules/zod/src/v3/tests/transformer.test.ts +0 -233
  948. package/node_modules/zod/src/v3/tests/tuple.test.ts +0 -90
  949. package/node_modules/zod/src/v3/tests/unions.test.ts +0 -57
  950. package/node_modules/zod/src/v3/tests/validations.test.ts +0 -133
  951. package/node_modules/zod/src/v3/tests/void.test.ts +0 -15
  952. package/node_modules/zod/src/v3/types.ts +0 -5138
  953. package/node_modules/zod/src/v4/classic/checks.ts +0 -33
  954. package/node_modules/zod/src/v4/classic/coerce.ts +0 -27
  955. package/node_modules/zod/src/v4/classic/compat.ts +0 -78
  956. package/node_modules/zod/src/v4/classic/deep-partial.ts +0 -76
  957. package/node_modules/zod/src/v4/classic/errors.ts +0 -97
  958. package/node_modules/zod/src/v4/classic/external.ts +0 -55
  959. package/node_modules/zod/src/v4/classic/from-json-schema.ts +0 -721
  960. package/node_modules/zod/src/v4/classic/in-out.ts +0 -45
  961. package/node_modules/zod/src/v4/classic/index.ts +0 -5
  962. package/node_modules/zod/src/v4/classic/iso.ts +0 -20
  963. package/node_modules/zod/src/v4/classic/parse.ts +0 -88
  964. package/node_modules/zod/src/v4/classic/schemas.ts +0 -2862
  965. package/node_modules/zod/src/v4/classic/tests/anyunknown.test.ts +0 -26
  966. package/node_modules/zod/src/v4/classic/tests/apply.test.ts +0 -86
  967. package/node_modules/zod/src/v4/classic/tests/array.test.ts +0 -264
  968. package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +0 -351
  969. package/node_modules/zod/src/v4/classic/tests/async-parsing.test.ts +0 -381
  970. package/node_modules/zod/src/v4/classic/tests/async-refinements.test.ts +0 -68
  971. package/node_modules/zod/src/v4/classic/tests/base.test.ts +0 -7
  972. package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +0 -83
  973. package/node_modules/zod/src/v4/classic/tests/brand.test.ts +0 -106
  974. package/node_modules/zod/src/v4/classic/tests/catch.test.ts +0 -604
  975. package/node_modules/zod/src/v4/classic/tests/coalesce.test.ts +0 -20
  976. package/node_modules/zod/src/v4/classic/tests/codec-examples.test.ts +0 -572
  977. package/node_modules/zod/src/v4/classic/tests/codec.test.ts +0 -704
  978. package/node_modules/zod/src/v4/classic/tests/coerce.test.ts +0 -160
  979. package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +0 -374
  980. package/node_modules/zod/src/v4/classic/tests/credit-card.test.ts +0 -76
  981. package/node_modules/zod/src/v4/classic/tests/custom.test.ts +0 -40
  982. package/node_modules/zod/src/v4/classic/tests/cyclic-data.test.ts +0 -720
  983. package/node_modules/zod/src/v4/classic/tests/date.test.ts +0 -92
  984. package/node_modules/zod/src/v4/classic/tests/datetime.test.ts +0 -316
  985. package/node_modules/zod/src/v4/classic/tests/deep-partial.test.ts +0 -380
  986. package/node_modules/zod/src/v4/classic/tests/default-locale.test.ts +0 -32
  987. package/node_modules/zod/src/v4/classic/tests/default.test.ts +0 -455
  988. package/node_modules/zod/src/v4/classic/tests/describe-meta-checks.test.ts +0 -27
  989. package/node_modules/zod/src/v4/classic/tests/description.test.ts +0 -32
  990. package/node_modules/zod/src/v4/classic/tests/detached-methods.test.ts +0 -221
  991. package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +0 -836
  992. package/node_modules/zod/src/v4/classic/tests/enum.test.ts +0 -296
  993. package/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +0 -917
  994. package/node_modules/zod/src/v4/classic/tests/error.test.ts +0 -979
  995. package/node_modules/zod/src/v4/classic/tests/file.test.ts +0 -96
  996. package/node_modules/zod/src/v4/classic/tests/firstparty.test.ts +0 -179
  997. package/node_modules/zod/src/v4/classic/tests/fix-json-issue.test.ts +0 -26
  998. package/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +0 -1310
  999. package/node_modules/zod/src/v4/classic/tests/function.test.ts +0 -391
  1000. package/node_modules/zod/src/v4/classic/tests/generics.test.ts +0 -72
  1001. package/node_modules/zod/src/v4/classic/tests/global-config.test.ts +0 -32
  1002. package/node_modules/zod/src/v4/classic/tests/hash.test.ts +0 -67
  1003. package/node_modules/zod/src/v4/classic/tests/in-out.test.ts +0 -159
  1004. package/node_modules/zod/src/v4/classic/tests/index.test.ts +0 -958
  1005. package/node_modules/zod/src/v4/classic/tests/instance-footprint.test.ts +0 -281
  1006. package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +0 -107
  1007. package/node_modules/zod/src/v4/classic/tests/intersection.test.ts +0 -334
  1008. package/node_modules/zod/src/v4/classic/tests/issue-schema.test.ts +0 -183
  1009. package/node_modules/zod/src/v4/classic/tests/jitless-allows-eval.test.ts +0 -39
  1010. package/node_modules/zod/src/v4/classic/tests/json.test.ts +0 -109
  1011. package/node_modules/zod/src/v4/classic/tests/lazy.test.ts +0 -262
  1012. package/node_modules/zod/src/v4/classic/tests/literal.test.ts +0 -128
  1013. package/node_modules/zod/src/v4/classic/tests/locales_ka.test.ts +0 -29
  1014. package/node_modules/zod/src/v4/classic/tests/locales_ro.test.ts +0 -24
  1015. package/node_modules/zod/src/v4/classic/tests/map.test.ts +0 -342
  1016. package/node_modules/zod/src/v4/classic/tests/nan.test.ts +0 -21
  1017. package/node_modules/zod/src/v4/classic/tests/nested-refine.test.ts +0 -168
  1018. package/node_modules/zod/src/v4/classic/tests/nonoptional.test.ts +0 -101
  1019. package/node_modules/zod/src/v4/classic/tests/nullable.test.ts +0 -22
  1020. package/node_modules/zod/src/v4/classic/tests/number.test.ts +0 -362
  1021. package/node_modules/zod/src/v4/classic/tests/object.test.ts +0 -950
  1022. package/node_modules/zod/src/v4/classic/tests/optin-ladder.test.ts +0 -234
  1023. package/node_modules/zod/src/v4/classic/tests/optional.test.ts +0 -366
  1024. package/node_modules/zod/src/v4/classic/tests/partial.test.ts +0 -497
  1025. package/node_modules/zod/src/v4/classic/tests/pickomit.test.ts +0 -211
  1026. package/node_modules/zod/src/v4/classic/tests/pipe.test.ts +0 -101
  1027. package/node_modules/zod/src/v4/classic/tests/prefault.test.ts +0 -74
  1028. package/node_modules/zod/src/v4/classic/tests/preprocess-types.test.ts +0 -44
  1029. package/node_modules/zod/src/v4/classic/tests/preprocess.test.ts +0 -351
  1030. package/node_modules/zod/src/v4/classic/tests/primitive.test.ts +0 -175
  1031. package/node_modules/zod/src/v4/classic/tests/promise.test.ts +0 -81
  1032. package/node_modules/zod/src/v4/classic/tests/prototypes.test.ts +0 -23
  1033. package/node_modules/zod/src/v4/classic/tests/readonly.test.ts +0 -184
  1034. package/node_modules/zod/src/v4/classic/tests/record.test.ts +0 -885
  1035. package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +0 -662
  1036. package/node_modules/zod/src/v4/classic/tests/redos.test.ts +0 -68
  1037. package/node_modules/zod/src/v4/classic/tests/refine.test.ts +0 -693
  1038. package/node_modules/zod/src/v4/classic/tests/registries.test.ts +0 -243
  1039. package/node_modules/zod/src/v4/classic/tests/set.test.ts +0 -190
  1040. package/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +0 -134
  1041. package/node_modules/zod/src/v4/classic/tests/string-formats.test.ts +0 -125
  1042. package/node_modules/zod/src/v4/classic/tests/string.test.ts +0 -1346
  1043. package/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +0 -124
  1044. package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +0 -780
  1045. package/node_modules/zod/src/v4/classic/tests/to-json-schema-methods.test.ts +0 -438
  1046. package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +0 -4537
  1047. package/node_modules/zod/src/v4/classic/tests/transform.test.ts +0 -378
  1048. package/node_modules/zod/src/v4/classic/tests/tuple.test.ts +0 -511
  1049. package/node_modules/zod/src/v4/classic/tests/union.test.ts +0 -310
  1050. package/node_modules/zod/src/v4/classic/tests/url.test.ts +0 -13
  1051. package/node_modules/zod/src/v4/classic/tests/validate.test.ts +0 -76
  1052. package/node_modules/zod/src/v4/classic/tests/validations.test.ts +0 -283
  1053. package/node_modules/zod/src/v4/classic/tests/void.test.ts +0 -12
  1054. package/node_modules/zod/src/v4/core/api.ts +0 -1859
  1055. package/node_modules/zod/src/v4/core/checks.ts +0 -1306
  1056. package/node_modules/zod/src/v4/core/compile.ts +0 -2188
  1057. package/node_modules/zod/src/v4/core/core.ts +0 -232
  1058. package/node_modules/zod/src/v4/core/doc.ts +0 -48
  1059. package/node_modules/zod/src/v4/core/errors.ts +0 -546
  1060. package/node_modules/zod/src/v4/core/index.ts +0 -19
  1061. package/node_modules/zod/src/v4/core/json-schema-generator.ts +0 -131
  1062. package/node_modules/zod/src/v4/core/json-schema-processors.ts +0 -830
  1063. package/node_modules/zod/src/v4/core/json-schema.ts +0 -148
  1064. package/node_modules/zod/src/v4/core/memoizer.ts +0 -284
  1065. package/node_modules/zod/src/v4/core/parse.ts +0 -288
  1066. package/node_modules/zod/src/v4/core/regexes.ts +0 -207
  1067. package/node_modules/zod/src/v4/core/registries.ts +0 -105
  1068. package/node_modules/zod/src/v4/core/schemas.ts +0 -5028
  1069. package/node_modules/zod/src/v4/core/standard-schema.ts +0 -159
  1070. package/node_modules/zod/src/v4/core/tests/compile-differential.test.ts +0 -969
  1071. package/node_modules/zod/src/v4/core/tests/compile-global.test.ts +0 -89
  1072. package/node_modules/zod/src/v4/core/tests/compile-off-by-default.test.ts +0 -26
  1073. package/node_modules/zod/src/v4/core/tests/compile-stats.test.ts +0 -34
  1074. package/node_modules/zod/src/v4/core/tests/compile.test.ts +0 -1639
  1075. package/node_modules/zod/src/v4/core/tests/extend.test.ts +0 -59
  1076. package/node_modules/zod/src/v4/core/tests/index.test.ts +0 -46
  1077. package/node_modules/zod/src/v4/core/tests/locales/be.test.ts +0 -124
  1078. package/node_modules/zod/src/v4/core/tests/locales/el.test.ts +0 -214
  1079. package/node_modules/zod/src/v4/core/tests/locales/en.test.ts +0 -22
  1080. package/node_modules/zod/src/v4/core/tests/locales/es.test.ts +0 -180
  1081. package/node_modules/zod/src/v4/core/tests/locales/fr.test.ts +0 -72
  1082. package/node_modules/zod/src/v4/core/tests/locales/he.test.ts +0 -379
  1083. package/node_modules/zod/src/v4/core/tests/locales/hr.test.ts +0 -163
  1084. package/node_modules/zod/src/v4/core/tests/locales/nl.test.ts +0 -46
  1085. package/node_modules/zod/src/v4/core/tests/locales/parity.test.ts +0 -42
  1086. package/node_modules/zod/src/v4/core/tests/locales/ru.test.ts +0 -128
  1087. package/node_modules/zod/src/v4/core/tests/locales/tk.test.ts +0 -69
  1088. package/node_modules/zod/src/v4/core/tests/locales/tr.test.ts +0 -69
  1089. package/node_modules/zod/src/v4/core/tests/locales/uz.test.ts +0 -105
  1090. package/node_modules/zod/src/v4/core/tests/record-constructor.test.ts +0 -125
  1091. package/node_modules/zod/src/v4/core/tests/recursive-tuples.test.ts +0 -45
  1092. package/node_modules/zod/src/v4/core/tests/treeshake.test.ts +0 -51
  1093. package/node_modules/zod/src/v4/core/tests/url-no-canparse.test.ts +0 -31
  1094. package/node_modules/zod/src/v4/core/to-json-schema.ts +0 -855
  1095. package/node_modules/zod/src/v4/core/util.ts +0 -1209
  1096. package/node_modules/zod/src/v4/core/versions.ts +0 -5
  1097. package/node_modules/zod/src/v4/core/visit.ts +0 -193
  1098. package/node_modules/zod/src/v4/core/zsf.ts +0 -323
  1099. package/node_modules/zod/src/v4/index.ts +0 -4
  1100. package/node_modules/zod/src/v4/locales/ar.ts +0 -118
  1101. package/node_modules/zod/src/v4/locales/az.ts +0 -114
  1102. package/node_modules/zod/src/v4/locales/be.ts +0 -186
  1103. package/node_modules/zod/src/v4/locales/bg.ts +0 -131
  1104. package/node_modules/zod/src/v4/locales/bn.ts +0 -121
  1105. package/node_modules/zod/src/v4/locales/ca.ts +0 -119
  1106. package/node_modules/zod/src/v4/locales/ckb.ts +0 -138
  1107. package/node_modules/zod/src/v4/locales/cs.ts +0 -121
  1108. package/node_modules/zod/src/v4/locales/da.ts +0 -126
  1109. package/node_modules/zod/src/v4/locales/de.ts +0 -119
  1110. package/node_modules/zod/src/v4/locales/el.ts +0 -122
  1111. package/node_modules/zod/src/v4/locales/en.ts +0 -134
  1112. package/node_modules/zod/src/v4/locales/eo.ts +0 -121
  1113. package/node_modules/zod/src/v4/locales/es.ts +0 -143
  1114. package/node_modules/zod/src/v4/locales/fa.ts +0 -129
  1115. package/node_modules/zod/src/v4/locales/fi.ts +0 -124
  1116. package/node_modules/zod/src/v4/locales/fr-CA.ts +0 -119
  1117. package/node_modules/zod/src/v4/locales/fr.ts +0 -137
  1118. package/node_modules/zod/src/v4/locales/gu.ts +0 -121
  1119. package/node_modules/zod/src/v4/locales/he.ts +0 -251
  1120. package/node_modules/zod/src/v4/locales/hi.ts +0 -124
  1121. package/node_modules/zod/src/v4/locales/hr.ts +0 -133
  1122. package/node_modules/zod/src/v4/locales/hu.ts +0 -120
  1123. package/node_modules/zod/src/v4/locales/hy.ts +0 -173
  1124. package/node_modules/zod/src/v4/locales/id.ts +0 -118
  1125. package/node_modules/zod/src/v4/locales/index.ts +0 -62
  1126. package/node_modules/zod/src/v4/locales/is.ts +0 -122
  1127. package/node_modules/zod/src/v4/locales/it.ts +0 -119
  1128. package/node_modules/zod/src/v4/locales/ja.ts +0 -117
  1129. package/node_modules/zod/src/v4/locales/ka.ts +0 -126
  1130. package/node_modules/zod/src/v4/locales/kh.ts +0 -7
  1131. package/node_modules/zod/src/v4/locales/km.ts +0 -122
  1132. package/node_modules/zod/src/v4/locales/kn.ts +0 -124
  1133. package/node_modules/zod/src/v4/locales/ko.ts +0 -124
  1134. package/node_modules/zod/src/v4/locales/lt.ts +0 -241
  1135. package/node_modules/zod/src/v4/locales/mk.ts +0 -121
  1136. package/node_modules/zod/src/v4/locales/ms.ts +0 -118
  1137. package/node_modules/zod/src/v4/locales/ne.ts +0 -126
  1138. package/node_modules/zod/src/v4/locales/nl.ts +0 -124
  1139. package/node_modules/zod/src/v4/locales/nn.ts +0 -119
  1140. package/node_modules/zod/src/v4/locales/no.ts +0 -119
  1141. package/node_modules/zod/src/v4/locales/ota.ts +0 -120
  1142. package/node_modules/zod/src/v4/locales/pl.ts +0 -121
  1143. package/node_modules/zod/src/v4/locales/ps.ts +0 -129
  1144. package/node_modules/zod/src/v4/locales/pt-BR.ts +0 -159
  1145. package/node_modules/zod/src/v4/locales/pt.ts +0 -157
  1146. package/node_modules/zod/src/v4/locales/ro.ts +0 -130
  1147. package/node_modules/zod/src/v4/locales/ru.ts +0 -186
  1148. package/node_modules/zod/src/v4/locales/sk.ts +0 -121
  1149. package/node_modules/zod/src/v4/locales/sl.ts +0 -121
  1150. package/node_modules/zod/src/v4/locales/sv.ts +0 -122
  1151. package/node_modules/zod/src/v4/locales/ta.ts +0 -121
  1152. package/node_modules/zod/src/v4/locales/th.ts +0 -122
  1153. package/node_modules/zod/src/v4/locales/tk.ts +0 -111
  1154. package/node_modules/zod/src/v4/locales/tr.ts +0 -114
  1155. package/node_modules/zod/src/v4/locales/ua.ts +0 -7
  1156. package/node_modules/zod/src/v4/locales/uk.ts +0 -120
  1157. package/node_modules/zod/src/v4/locales/ur.ts +0 -122
  1158. package/node_modules/zod/src/v4/locales/uz.ts +0 -118
  1159. package/node_modules/zod/src/v4/locales/vi.ts +0 -120
  1160. package/node_modules/zod/src/v4/locales/yo.ts +0 -127
  1161. package/node_modules/zod/src/v4/locales/zh-CN.ts +0 -119
  1162. package/node_modules/zod/src/v4/locales/zh-TW.ts +0 -118
  1163. package/node_modules/zod/src/v4/mini/checks.ts +0 -33
  1164. package/node_modules/zod/src/v4/mini/coerce.ts +0 -27
  1165. package/node_modules/zod/src/v4/mini/deep-partial.ts +0 -73
  1166. package/node_modules/zod/src/v4/mini/external.ts +0 -50
  1167. package/node_modules/zod/src/v4/mini/in-out.ts +0 -45
  1168. package/node_modules/zod/src/v4/mini/index.ts +0 -3
  1169. package/node_modules/zod/src/v4/mini/iso.ts +0 -66
  1170. package/node_modules/zod/src/v4/mini/parse.ts +0 -16
  1171. package/node_modules/zod/src/v4/mini/schemas.ts +0 -2026
  1172. package/node_modules/zod/src/v4/mini/tests/apply.test.ts +0 -57
  1173. package/node_modules/zod/src/v4/mini/tests/assignability.test.ts +0 -190
  1174. package/node_modules/zod/src/v4/mini/tests/brand.test.ts +0 -94
  1175. package/node_modules/zod/src/v4/mini/tests/checks.test.ts +0 -158
  1176. package/node_modules/zod/src/v4/mini/tests/codec.test.ts +0 -582
  1177. package/node_modules/zod/src/v4/mini/tests/computed.test.ts +0 -36
  1178. package/node_modules/zod/src/v4/mini/tests/cyclic-data.test.ts +0 -84
  1179. package/node_modules/zod/src/v4/mini/tests/deep-partial.test.ts +0 -54
  1180. package/node_modules/zod/src/v4/mini/tests/error.test.ts +0 -41
  1181. package/node_modules/zod/src/v4/mini/tests/functions.test.ts +0 -14
  1182. package/node_modules/zod/src/v4/mini/tests/index.test.ts +0 -1060
  1183. package/node_modules/zod/src/v4/mini/tests/number.test.ts +0 -109
  1184. package/node_modules/zod/src/v4/mini/tests/object.test.ts +0 -292
  1185. package/node_modules/zod/src/v4/mini/tests/prototypes.test.ts +0 -43
  1186. package/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +0 -325
  1187. package/node_modules/zod/src/v4/mini/tests/standard-schema.test.ts +0 -50
  1188. package/node_modules/zod/src/v4/mini/tests/string.test.ts +0 -373
  1189. package/node_modules/zod/src/v4-mini/index.ts +0 -3
  1190. package/node_modules/zod/v3/ZodError.cjs +0 -148
  1191. package/node_modules/zod/v3/ZodError.d.cts +0 -164
  1192. package/node_modules/zod/v3/ZodError.d.ts +0 -164
  1193. package/node_modules/zod/v3/ZodError.js +0 -143
  1194. package/node_modules/zod/v3/errors.cjs +0 -17
  1195. package/node_modules/zod/v3/errors.d.cts +0 -5
  1196. package/node_modules/zod/v3/errors.d.ts +0 -5
  1197. package/node_modules/zod/v3/errors.js +0 -9
  1198. package/node_modules/zod/v3/external.cjs +0 -22
  1199. package/node_modules/zod/v3/external.d.cts +0 -6
  1200. package/node_modules/zod/v3/external.d.ts +0 -6
  1201. package/node_modules/zod/v3/external.js +0 -6
  1202. package/node_modules/zod/v3/helpers/enumUtil.cjs +0 -2
  1203. package/node_modules/zod/v3/helpers/enumUtil.d.cts +0 -8
  1204. package/node_modules/zod/v3/helpers/enumUtil.d.ts +0 -8
  1205. package/node_modules/zod/v3/helpers/enumUtil.js +0 -1
  1206. package/node_modules/zod/v3/helpers/errorUtil.cjs +0 -9
  1207. package/node_modules/zod/v3/helpers/errorUtil.d.cts +0 -9
  1208. package/node_modules/zod/v3/helpers/errorUtil.d.ts +0 -9
  1209. package/node_modules/zod/v3/helpers/errorUtil.js +0 -6
  1210. package/node_modules/zod/v3/helpers/parseUtil.cjs +0 -124
  1211. package/node_modules/zod/v3/helpers/parseUtil.d.cts +0 -78
  1212. package/node_modules/zod/v3/helpers/parseUtil.d.ts +0 -78
  1213. package/node_modules/zod/v3/helpers/parseUtil.js +0 -109
  1214. package/node_modules/zod/v3/helpers/partialUtil.cjs +0 -2
  1215. package/node_modules/zod/v3/helpers/partialUtil.d.cts +0 -8
  1216. package/node_modules/zod/v3/helpers/partialUtil.d.ts +0 -8
  1217. package/node_modules/zod/v3/helpers/partialUtil.js +0 -1
  1218. package/node_modules/zod/v3/helpers/typeAliases.cjs +0 -2
  1219. package/node_modules/zod/v3/helpers/typeAliases.d.cts +0 -2
  1220. package/node_modules/zod/v3/helpers/typeAliases.d.ts +0 -2
  1221. package/node_modules/zod/v3/helpers/typeAliases.js +0 -1
  1222. package/node_modules/zod/v3/helpers/util.cjs +0 -137
  1223. package/node_modules/zod/v3/helpers/util.d.cts +0 -85
  1224. package/node_modules/zod/v3/helpers/util.d.ts +0 -85
  1225. package/node_modules/zod/v3/helpers/util.js +0 -133
  1226. package/node_modules/zod/v3/index.cjs +0 -33
  1227. package/node_modules/zod/v3/index.d.cts +0 -4
  1228. package/node_modules/zod/v3/index.d.ts +0 -4
  1229. package/node_modules/zod/v3/index.js +0 -4
  1230. package/node_modules/zod/v3/locales/en.cjs +0 -112
  1231. package/node_modules/zod/v3/locales/en.d.cts +0 -3
  1232. package/node_modules/zod/v3/locales/en.d.ts +0 -3
  1233. package/node_modules/zod/v3/locales/en.js +0 -109
  1234. package/node_modules/zod/v3/package.json +0 -7
  1235. package/node_modules/zod/v3/standard-schema.cjs +0 -2
  1236. package/node_modules/zod/v3/standard-schema.d.cts +0 -102
  1237. package/node_modules/zod/v3/standard-schema.d.ts +0 -102
  1238. package/node_modules/zod/v3/standard-schema.js +0 -1
  1239. package/node_modules/zod/v3/types.cjs +0 -3779
  1240. package/node_modules/zod/v3/types.d.cts +0 -1034
  1241. package/node_modules/zod/v3/types.d.ts +0 -1034
  1242. package/node_modules/zod/v3/types.js +0 -3697
  1243. package/node_modules/zod/v4/classic/checks.cjs +0 -34
  1244. package/node_modules/zod/v4/classic/checks.d.cts +0 -1
  1245. package/node_modules/zod/v4/classic/checks.d.ts +0 -1
  1246. package/node_modules/zod/v4/classic/checks.js +0 -1
  1247. package/node_modules/zod/v4/classic/coerce.cjs +0 -47
  1248. package/node_modules/zod/v4/classic/coerce.d.cts +0 -17
  1249. package/node_modules/zod/v4/classic/coerce.d.ts +0 -17
  1250. package/node_modules/zod/v4/classic/coerce.js +0 -17
  1251. package/node_modules/zod/v4/classic/compat.cjs +0 -61
  1252. package/node_modules/zod/v4/classic/compat.d.cts +0 -48
  1253. package/node_modules/zod/v4/classic/compat.d.ts +0 -48
  1254. package/node_modules/zod/v4/classic/compat.js +0 -31
  1255. package/node_modules/zod/v4/classic/deep-partial.cjs +0 -39
  1256. package/node_modules/zod/v4/classic/deep-partial.d.cts +0 -14
  1257. package/node_modules/zod/v4/classic/deep-partial.d.ts +0 -14
  1258. package/node_modules/zod/v4/classic/deep-partial.js +0 -13
  1259. package/node_modules/zod/v4/classic/errors.cjs +0 -83
  1260. package/node_modules/zod/v4/classic/errors.d.cts +0 -29
  1261. package/node_modules/zod/v4/classic/errors.d.ts +0 -29
  1262. package/node_modules/zod/v4/classic/errors.js +0 -57
  1263. package/node_modules/zod/v4/classic/external.cjs +0 -76
  1264. package/node_modules/zod/v4/classic/external.d.cts +0 -19
  1265. package/node_modules/zod/v4/classic/external.d.ts +0 -19
  1266. package/node_modules/zod/v4/classic/external.js +0 -17
  1267. package/node_modules/zod/v4/classic/from-json-schema.cjs +0 -686
  1268. package/node_modules/zod/v4/classic/from-json-schema.d.cts +0 -12
  1269. package/node_modules/zod/v4/classic/from-json-schema.d.ts +0 -12
  1270. package/node_modules/zod/v4/classic/from-json-schema.js +0 -660
  1271. package/node_modules/zod/v4/classic/in-out.cjs +0 -63
  1272. package/node_modules/zod/v4/classic/in-out.d.cts +0 -8
  1273. package/node_modules/zod/v4/classic/in-out.d.ts +0 -8
  1274. package/node_modules/zod/v4/classic/in-out.js +0 -36
  1275. package/node_modules/zod/v4/classic/index.cjs +0 -33
  1276. package/node_modules/zod/v4/classic/index.d.cts +0 -3
  1277. package/node_modules/zod/v4/classic/index.d.ts +0 -3
  1278. package/node_modules/zod/v4/classic/index.js +0 -4
  1279. package/node_modules/zod/v4/classic/iso.cjs +0 -49
  1280. package/node_modules/zod/v4/classic/iso.d.cts +0 -7
  1281. package/node_modules/zod/v4/classic/iso.d.ts +0 -7
  1282. package/node_modules/zod/v4/classic/iso.js +0 -15
  1283. package/node_modules/zod/v4/classic/package.json +0 -7
  1284. package/node_modules/zod/v4/classic/parse.cjs +0 -44
  1285. package/node_modules/zod/v4/classic/parse.d.cts +0 -44
  1286. package/node_modules/zod/v4/classic/parse.d.ts +0 -44
  1287. package/node_modules/zod/v4/classic/parse.js +0 -16
  1288. package/node_modules/zod/v4/classic/schemas.cjs +0 -1611
  1289. package/node_modules/zod/v4/classic/schemas.d.cts +0 -802
  1290. package/node_modules/zod/v4/classic/schemas.d.ts +0 -802
  1291. package/node_modules/zod/v4/classic/schemas.js +0 -1491
  1292. package/node_modules/zod/v4/core/api.cjs +0 -1246
  1293. package/node_modules/zod/v4/core/api.d.cts +0 -329
  1294. package/node_modules/zod/v4/core/api.d.ts +0 -329
  1295. package/node_modules/zod/v4/core/api.js +0 -1104
  1296. package/node_modules/zod/v4/core/checks.cjs +0 -607
  1297. package/node_modules/zod/v4/core/checks.d.cts +0 -278
  1298. package/node_modules/zod/v4/core/checks.d.ts +0 -278
  1299. package/node_modules/zod/v4/core/checks.js +0 -581
  1300. package/node_modules/zod/v4/core/compile.cjs +0 -1813
  1301. package/node_modules/zod/v4/core/compile.d.cts +0 -51
  1302. package/node_modules/zod/v4/core/compile.d.ts +0 -51
  1303. package/node_modules/zod/v4/core/compile.js +0 -1783
  1304. package/node_modules/zod/v4/core/core.cjs +0 -148
  1305. package/node_modules/zod/v4/core/core.d.cts +0 -82
  1306. package/node_modules/zod/v4/core/core.d.ts +0 -82
  1307. package/node_modules/zod/v4/core/core.js +0 -141
  1308. package/node_modules/zod/v4/core/doc.cjs +0 -37
  1309. package/node_modules/zod/v4/core/doc.d.cts +0 -16
  1310. package/node_modules/zod/v4/core/doc.d.ts +0 -16
  1311. package/node_modules/zod/v4/core/doc.js +0 -33
  1312. package/node_modules/zod/v4/core/errors.cjs +0 -301
  1313. package/node_modules/zod/v4/core/errors.d.cts +0 -225
  1314. package/node_modules/zod/v4/core/errors.d.ts +0 -225
  1315. package/node_modules/zod/v4/core/errors.js +0 -270
  1316. package/node_modules/zod/v4/core/index.cjs +0 -51
  1317. package/node_modules/zod/v4/core/index.d.cts +0 -19
  1318. package/node_modules/zod/v4/core/index.d.ts +0 -19
  1319. package/node_modules/zod/v4/core/index.js +0 -19
  1320. package/node_modules/zod/v4/core/json-schema-generator.cjs +0 -103
  1321. package/node_modules/zod/v4/core/json-schema-generator.d.cts +0 -65
  1322. package/node_modules/zod/v4/core/json-schema-generator.d.ts +0 -65
  1323. package/node_modules/zod/v4/core/json-schema-generator.js +0 -99
  1324. package/node_modules/zod/v4/core/json-schema-processors.cjs +0 -813
  1325. package/node_modules/zod/v4/core/json-schema-processors.d.cts +0 -49
  1326. package/node_modules/zod/v4/core/json-schema-processors.d.ts +0 -49
  1327. package/node_modules/zod/v4/core/json-schema-processors.js +0 -747
  1328. package/node_modules/zod/v4/core/json-schema.cjs +0 -2
  1329. package/node_modules/zod/v4/core/json-schema.d.cts +0 -89
  1330. package/node_modules/zod/v4/core/json-schema.d.ts +0 -89
  1331. package/node_modules/zod/v4/core/json-schema.js +0 -1
  1332. package/node_modules/zod/v4/core/memoizer.cjs +0 -272
  1333. package/node_modules/zod/v4/core/memoizer.d.cts +0 -15
  1334. package/node_modules/zod/v4/core/memoizer.d.ts +0 -15
  1335. package/node_modules/zod/v4/core/memoizer.js +0 -265
  1336. package/node_modules/zod/v4/core/package.json +0 -7
  1337. package/node_modules/zod/v4/core/parse.cjs +0 -193
  1338. package/node_modules/zod/v4/core/parse.d.cts +0 -52
  1339. package/node_modules/zod/v4/core/parse.d.ts +0 -52
  1340. package/node_modules/zod/v4/core/parse.js +0 -154
  1341. package/node_modules/zod/v4/core/regexes.cjs +0 -184
  1342. package/node_modules/zod/v4/core/regexes.d.cts +0 -87
  1343. package/node_modules/zod/v4/core/regexes.d.ts +0 -87
  1344. package/node_modules/zod/v4/core/regexes.js +0 -150
  1345. package/node_modules/zod/v4/core/registries.cjs +0 -56
  1346. package/node_modules/zod/v4/core/registries.d.cts +0 -35
  1347. package/node_modules/zod/v4/core/registries.d.ts +0 -35
  1348. package/node_modules/zod/v4/core/registries.js +0 -51
  1349. package/node_modules/zod/v4/core/schemas.cjs +0 -2481
  1350. package/node_modules/zod/v4/core/schemas.d.cts +0 -1253
  1351. package/node_modules/zod/v4/core/schemas.d.ts +0 -1253
  1352. package/node_modules/zod/v4/core/schemas.js +0 -2440
  1353. package/node_modules/zod/v4/core/standard-schema.cjs +0 -2
  1354. package/node_modules/zod/v4/core/standard-schema.d.cts +0 -126
  1355. package/node_modules/zod/v4/core/standard-schema.d.ts +0 -126
  1356. package/node_modules/zod/v4/core/standard-schema.js +0 -1
  1357. package/node_modules/zod/v4/core/to-json-schema.cjs +0 -660
  1358. package/node_modules/zod/v4/core/to-json-schema.d.cts +0 -153
  1359. package/node_modules/zod/v4/core/to-json-schema.d.ts +0 -153
  1360. package/node_modules/zod/v4/core/to-json-schema.js +0 -650
  1361. package/node_modules/zod/v4/core/util.cjs +0 -915
  1362. package/node_modules/zod/v4/core/util.d.cts +0 -257
  1363. package/node_modules/zod/v4/core/util.d.ts +0 -257
  1364. package/node_modules/zod/v4/core/util.js +0 -846
  1365. package/node_modules/zod/v4/core/versions.cjs +0 -8
  1366. package/node_modules/zod/v4/core/versions.d.cts +0 -5
  1367. package/node_modules/zod/v4/core/versions.d.ts +0 -5
  1368. package/node_modules/zod/v4/core/versions.js +0 -5
  1369. package/node_modules/zod/v4/core/visit.cjs +0 -195
  1370. package/node_modules/zod/v4/core/visit.d.cts +0 -30
  1371. package/node_modules/zod/v4/core/visit.d.ts +0 -30
  1372. package/node_modules/zod/v4/core/visit.js +0 -169
  1373. package/node_modules/zod/v4/index.cjs +0 -32
  1374. package/node_modules/zod/v4/index.d.cts +0 -3
  1375. package/node_modules/zod/v4/index.d.ts +0 -3
  1376. package/node_modules/zod/v4/index.js +0 -4
  1377. package/node_modules/zod/v4/locales/ar.cjs +0 -136
  1378. package/node_modules/zod/v4/locales/ar.d.cts +0 -5
  1379. package/node_modules/zod/v4/locales/ar.d.ts +0 -4
  1380. package/node_modules/zod/v4/locales/ar.js +0 -109
  1381. package/node_modules/zod/v4/locales/az.cjs +0 -135
  1382. package/node_modules/zod/v4/locales/az.d.cts +0 -5
  1383. package/node_modules/zod/v4/locales/az.d.ts +0 -4
  1384. package/node_modules/zod/v4/locales/az.js +0 -108
  1385. package/node_modules/zod/v4/locales/be.cjs +0 -193
  1386. package/node_modules/zod/v4/locales/be.d.cts +0 -5
  1387. package/node_modules/zod/v4/locales/be.d.ts +0 -4
  1388. package/node_modules/zod/v4/locales/be.js +0 -166
  1389. package/node_modules/zod/v4/locales/bg.cjs +0 -150
  1390. package/node_modules/zod/v4/locales/bg.d.cts +0 -5
  1391. package/node_modules/zod/v4/locales/bg.d.ts +0 -4
  1392. package/node_modules/zod/v4/locales/bg.js +0 -123
  1393. package/node_modules/zod/v4/locales/bn.cjs +0 -138
  1394. package/node_modules/zod/v4/locales/bn.d.cts +0 -5
  1395. package/node_modules/zod/v4/locales/bn.d.ts +0 -4
  1396. package/node_modules/zod/v4/locales/bn.js +0 -111
  1397. package/node_modules/zod/v4/locales/ca.cjs +0 -137
  1398. package/node_modules/zod/v4/locales/ca.d.cts +0 -5
  1399. package/node_modules/zod/v4/locales/ca.d.ts +0 -4
  1400. package/node_modules/zod/v4/locales/ca.js +0 -110
  1401. package/node_modules/zod/v4/locales/ckb.cjs +0 -158
  1402. package/node_modules/zod/v4/locales/ckb.d.cts +0 -5
  1403. package/node_modules/zod/v4/locales/ckb.d.ts +0 -4
  1404. package/node_modules/zod/v4/locales/ckb.js +0 -131
  1405. package/node_modules/zod/v4/locales/cs.cjs +0 -141
  1406. package/node_modules/zod/v4/locales/cs.d.cts +0 -5
  1407. package/node_modules/zod/v4/locales/cs.d.ts +0 -4
  1408. package/node_modules/zod/v4/locales/cs.js +0 -114
  1409. package/node_modules/zod/v4/locales/da.cjs +0 -145
  1410. package/node_modules/zod/v4/locales/da.d.cts +0 -5
  1411. package/node_modules/zod/v4/locales/da.d.ts +0 -4
  1412. package/node_modules/zod/v4/locales/da.js +0 -118
  1413. package/node_modules/zod/v4/locales/de.cjs +0 -138
  1414. package/node_modules/zod/v4/locales/de.d.cts +0 -5
  1415. package/node_modules/zod/v4/locales/de.d.ts +0 -4
  1416. package/node_modules/zod/v4/locales/de.js +0 -111
  1417. package/node_modules/zod/v4/locales/el.cjs +0 -137
  1418. package/node_modules/zod/v4/locales/el.d.cts +0 -5
  1419. package/node_modules/zod/v4/locales/el.d.ts +0 -4
  1420. package/node_modules/zod/v4/locales/el.js +0 -110
  1421. package/node_modules/zod/v4/locales/en.cjs +0 -150
  1422. package/node_modules/zod/v4/locales/en.d.cts +0 -5
  1423. package/node_modules/zod/v4/locales/en.d.ts +0 -4
  1424. package/node_modules/zod/v4/locales/en.js +0 -123
  1425. package/node_modules/zod/v4/locales/eo.cjs +0 -139
  1426. package/node_modules/zod/v4/locales/eo.d.cts +0 -5
  1427. package/node_modules/zod/v4/locales/eo.d.ts +0 -4
  1428. package/node_modules/zod/v4/locales/eo.js +0 -112
  1429. package/node_modules/zod/v4/locales/es.cjs +0 -161
  1430. package/node_modules/zod/v4/locales/es.d.cts +0 -5
  1431. package/node_modules/zod/v4/locales/es.d.ts +0 -4
  1432. package/node_modules/zod/v4/locales/es.js +0 -134
  1433. package/node_modules/zod/v4/locales/fa.cjs +0 -144
  1434. package/node_modules/zod/v4/locales/fa.d.cts +0 -5
  1435. package/node_modules/zod/v4/locales/fa.d.ts +0 -4
  1436. package/node_modules/zod/v4/locales/fa.js +0 -117
  1437. package/node_modules/zod/v4/locales/fi.cjs +0 -142
  1438. package/node_modules/zod/v4/locales/fi.d.cts +0 -5
  1439. package/node_modules/zod/v4/locales/fi.d.ts +0 -4
  1440. package/node_modules/zod/v4/locales/fi.js +0 -115
  1441. package/node_modules/zod/v4/locales/fr-CA.cjs +0 -137
  1442. package/node_modules/zod/v4/locales/fr-CA.d.cts +0 -5
  1443. package/node_modules/zod/v4/locales/fr-CA.d.ts +0 -4
  1444. package/node_modules/zod/v4/locales/fr-CA.js +0 -110
  1445. package/node_modules/zod/v4/locales/fr.cjs +0 -154
  1446. package/node_modules/zod/v4/locales/fr.d.cts +0 -5
  1447. package/node_modules/zod/v4/locales/fr.d.ts +0 -4
  1448. package/node_modules/zod/v4/locales/fr.js +0 -127
  1449. package/node_modules/zod/v4/locales/gu.cjs +0 -138
  1450. package/node_modules/zod/v4/locales/gu.d.cts +0 -5
  1451. package/node_modules/zod/v4/locales/gu.d.ts +0 -4
  1452. package/node_modules/zod/v4/locales/gu.js +0 -111
  1453. package/node_modules/zod/v4/locales/he.cjs +0 -246
  1454. package/node_modules/zod/v4/locales/he.d.cts +0 -5
  1455. package/node_modules/zod/v4/locales/he.d.ts +0 -4
  1456. package/node_modules/zod/v4/locales/he.js +0 -219
  1457. package/node_modules/zod/v4/locales/hi.cjs +0 -136
  1458. package/node_modules/zod/v4/locales/hi.d.cts +0 -5
  1459. package/node_modules/zod/v4/locales/hi.d.ts +0 -4
  1460. package/node_modules/zod/v4/locales/hi.js +0 -109
  1461. package/node_modules/zod/v4/locales/hr.cjs +0 -151
  1462. package/node_modules/zod/v4/locales/hr.d.cts +0 -5
  1463. package/node_modules/zod/v4/locales/hr.d.ts +0 -4
  1464. package/node_modules/zod/v4/locales/hr.js +0 -124
  1465. package/node_modules/zod/v4/locales/hu.cjs +0 -138
  1466. package/node_modules/zod/v4/locales/hu.d.cts +0 -5
  1467. package/node_modules/zod/v4/locales/hu.d.ts +0 -4
  1468. package/node_modules/zod/v4/locales/hu.js +0 -111
  1469. package/node_modules/zod/v4/locales/hy.cjs +0 -183
  1470. package/node_modules/zod/v4/locales/hy.d.cts +0 -5
  1471. package/node_modules/zod/v4/locales/hy.d.ts +0 -4
  1472. package/node_modules/zod/v4/locales/hy.js +0 -156
  1473. package/node_modules/zod/v4/locales/id.cjs +0 -136
  1474. package/node_modules/zod/v4/locales/id.d.cts +0 -5
  1475. package/node_modules/zod/v4/locales/id.d.ts +0 -4
  1476. package/node_modules/zod/v4/locales/id.js +0 -109
  1477. package/node_modules/zod/v4/locales/index.cjs +0 -131
  1478. package/node_modules/zod/v4/locales/index.d.cts +0 -62
  1479. package/node_modules/zod/v4/locales/index.d.ts +0 -62
  1480. package/node_modules/zod/v4/locales/index.js +0 -62
  1481. package/node_modules/zod/v4/locales/is.cjs +0 -139
  1482. package/node_modules/zod/v4/locales/is.d.cts +0 -5
  1483. package/node_modules/zod/v4/locales/is.d.ts +0 -4
  1484. package/node_modules/zod/v4/locales/is.js +0 -112
  1485. package/node_modules/zod/v4/locales/it.cjs +0 -138
  1486. package/node_modules/zod/v4/locales/it.d.cts +0 -5
  1487. package/node_modules/zod/v4/locales/it.d.ts +0 -4
  1488. package/node_modules/zod/v4/locales/it.js +0 -111
  1489. package/node_modules/zod/v4/locales/ja.cjs +0 -137
  1490. package/node_modules/zod/v4/locales/ja.d.cts +0 -5
  1491. package/node_modules/zod/v4/locales/ja.d.ts +0 -4
  1492. package/node_modules/zod/v4/locales/ja.js +0 -110
  1493. package/node_modules/zod/v4/locales/ka.cjs +0 -142
  1494. package/node_modules/zod/v4/locales/ka.d.cts +0 -5
  1495. package/node_modules/zod/v4/locales/ka.d.ts +0 -4
  1496. package/node_modules/zod/v4/locales/ka.js +0 -115
  1497. package/node_modules/zod/v4/locales/kh.cjs +0 -12
  1498. package/node_modules/zod/v4/locales/kh.d.cts +0 -5
  1499. package/node_modules/zod/v4/locales/kh.d.ts +0 -5
  1500. package/node_modules/zod/v4/locales/kh.js +0 -5
  1501. package/node_modules/zod/v4/locales/km.cjs +0 -140
  1502. package/node_modules/zod/v4/locales/km.d.cts +0 -5
  1503. package/node_modules/zod/v4/locales/km.d.ts +0 -4
  1504. package/node_modules/zod/v4/locales/km.js +0 -113
  1505. package/node_modules/zod/v4/locales/kn.cjs +0 -141
  1506. package/node_modules/zod/v4/locales/kn.d.cts +0 -5
  1507. package/node_modules/zod/v4/locales/kn.d.ts +0 -4
  1508. package/node_modules/zod/v4/locales/kn.js +0 -114
  1509. package/node_modules/zod/v4/locales/ko.cjs +0 -141
  1510. package/node_modules/zod/v4/locales/ko.d.cts +0 -5
  1511. package/node_modules/zod/v4/locales/ko.d.ts +0 -4
  1512. package/node_modules/zod/v4/locales/ko.js +0 -114
  1513. package/node_modules/zod/v4/locales/lt.cjs +0 -232
  1514. package/node_modules/zod/v4/locales/lt.d.cts +0 -5
  1515. package/node_modules/zod/v4/locales/lt.d.ts +0 -4
  1516. package/node_modules/zod/v4/locales/lt.js +0 -205
  1517. package/node_modules/zod/v4/locales/mk.cjs +0 -139
  1518. package/node_modules/zod/v4/locales/mk.d.cts +0 -5
  1519. package/node_modules/zod/v4/locales/mk.d.ts +0 -4
  1520. package/node_modules/zod/v4/locales/mk.js +0 -112
  1521. package/node_modules/zod/v4/locales/ms.cjs +0 -137
  1522. package/node_modules/zod/v4/locales/ms.d.cts +0 -5
  1523. package/node_modules/zod/v4/locales/ms.d.ts +0 -4
  1524. package/node_modules/zod/v4/locales/ms.js +0 -110
  1525. package/node_modules/zod/v4/locales/ne.cjs +0 -136
  1526. package/node_modules/zod/v4/locales/ne.d.cts +0 -5
  1527. package/node_modules/zod/v4/locales/ne.d.ts +0 -4
  1528. package/node_modules/zod/v4/locales/ne.js +0 -109
  1529. package/node_modules/zod/v4/locales/nl.cjs +0 -140
  1530. package/node_modules/zod/v4/locales/nl.d.cts +0 -5
  1531. package/node_modules/zod/v4/locales/nl.d.ts +0 -4
  1532. package/node_modules/zod/v4/locales/nl.js +0 -113
  1533. package/node_modules/zod/v4/locales/nn.cjs +0 -138
  1534. package/node_modules/zod/v4/locales/nn.d.cts +0 -5
  1535. package/node_modules/zod/v4/locales/nn.d.ts +0 -4
  1536. package/node_modules/zod/v4/locales/nn.js +0 -111
  1537. package/node_modules/zod/v4/locales/no.cjs +0 -138
  1538. package/node_modules/zod/v4/locales/no.d.cts +0 -5
  1539. package/node_modules/zod/v4/locales/no.d.ts +0 -4
  1540. package/node_modules/zod/v4/locales/no.js +0 -111
  1541. package/node_modules/zod/v4/locales/ota.cjs +0 -139
  1542. package/node_modules/zod/v4/locales/ota.d.cts +0 -5
  1543. package/node_modules/zod/v4/locales/ota.d.ts +0 -4
  1544. package/node_modules/zod/v4/locales/ota.js +0 -112
  1545. package/node_modules/zod/v4/locales/package.json +0 -7
  1546. package/node_modules/zod/v4/locales/pl.cjs +0 -139
  1547. package/node_modules/zod/v4/locales/pl.d.cts +0 -5
  1548. package/node_modules/zod/v4/locales/pl.d.ts +0 -4
  1549. package/node_modules/zod/v4/locales/pl.js +0 -112
  1550. package/node_modules/zod/v4/locales/ps.cjs +0 -144
  1551. package/node_modules/zod/v4/locales/ps.d.cts +0 -5
  1552. package/node_modules/zod/v4/locales/ps.d.ts +0 -4
  1553. package/node_modules/zod/v4/locales/ps.js +0 -117
  1554. package/node_modules/zod/v4/locales/pt-BR.cjs +0 -168
  1555. package/node_modules/zod/v4/locales/pt-BR.d.cts +0 -5
  1556. package/node_modules/zod/v4/locales/pt-BR.d.ts +0 -4
  1557. package/node_modules/zod/v4/locales/pt-BR.js +0 -141
  1558. package/node_modules/zod/v4/locales/pt.cjs +0 -167
  1559. package/node_modules/zod/v4/locales/pt.d.cts +0 -5
  1560. package/node_modules/zod/v4/locales/pt.d.ts +0 -4
  1561. package/node_modules/zod/v4/locales/pt.js +0 -140
  1562. package/node_modules/zod/v4/locales/ro.cjs +0 -147
  1563. package/node_modules/zod/v4/locales/ro.d.cts +0 -5
  1564. package/node_modules/zod/v4/locales/ro.d.ts +0 -4
  1565. package/node_modules/zod/v4/locales/ro.js +0 -120
  1566. package/node_modules/zod/v4/locales/ru.cjs +0 -193
  1567. package/node_modules/zod/v4/locales/ru.d.cts +0 -5
  1568. package/node_modules/zod/v4/locales/ru.d.ts +0 -4
  1569. package/node_modules/zod/v4/locales/ru.js +0 -166
  1570. package/node_modules/zod/v4/locales/sk.cjs +0 -141
  1571. package/node_modules/zod/v4/locales/sk.d.cts +0 -5
  1572. package/node_modules/zod/v4/locales/sk.d.ts +0 -4
  1573. package/node_modules/zod/v4/locales/sk.js +0 -114
  1574. package/node_modules/zod/v4/locales/sl.cjs +0 -139
  1575. package/node_modules/zod/v4/locales/sl.d.cts +0 -5
  1576. package/node_modules/zod/v4/locales/sl.d.ts +0 -4
  1577. package/node_modules/zod/v4/locales/sl.js +0 -112
  1578. package/node_modules/zod/v4/locales/sv.cjs +0 -140
  1579. package/node_modules/zod/v4/locales/sv.d.cts +0 -5
  1580. package/node_modules/zod/v4/locales/sv.d.ts +0 -4
  1581. package/node_modules/zod/v4/locales/sv.js +0 -113
  1582. package/node_modules/zod/v4/locales/ta.cjs +0 -140
  1583. package/node_modules/zod/v4/locales/ta.d.cts +0 -5
  1584. package/node_modules/zod/v4/locales/ta.d.ts +0 -4
  1585. package/node_modules/zod/v4/locales/ta.js +0 -113
  1586. package/node_modules/zod/v4/locales/th.cjs +0 -140
  1587. package/node_modules/zod/v4/locales/th.d.cts +0 -5
  1588. package/node_modules/zod/v4/locales/th.d.ts +0 -4
  1589. package/node_modules/zod/v4/locales/th.js +0 -113
  1590. package/node_modules/zod/v4/locales/tk.cjs +0 -132
  1591. package/node_modules/zod/v4/locales/tk.d.cts +0 -5
  1592. package/node_modules/zod/v4/locales/tk.d.ts +0 -4
  1593. package/node_modules/zod/v4/locales/tk.js +0 -105
  1594. package/node_modules/zod/v4/locales/tr.cjs +0 -135
  1595. package/node_modules/zod/v4/locales/tr.d.cts +0 -5
  1596. package/node_modules/zod/v4/locales/tr.d.ts +0 -4
  1597. package/node_modules/zod/v4/locales/tr.js +0 -108
  1598. package/node_modules/zod/v4/locales/ua.cjs +0 -12
  1599. package/node_modules/zod/v4/locales/ua.d.cts +0 -5
  1600. package/node_modules/zod/v4/locales/ua.d.ts +0 -5
  1601. package/node_modules/zod/v4/locales/ua.js +0 -5
  1602. package/node_modules/zod/v4/locales/uk.cjs +0 -138
  1603. package/node_modules/zod/v4/locales/uk.d.cts +0 -5
  1604. package/node_modules/zod/v4/locales/uk.d.ts +0 -4
  1605. package/node_modules/zod/v4/locales/uk.js +0 -111
  1606. package/node_modules/zod/v4/locales/ur.cjs +0 -140
  1607. package/node_modules/zod/v4/locales/ur.d.cts +0 -5
  1608. package/node_modules/zod/v4/locales/ur.d.ts +0 -4
  1609. package/node_modules/zod/v4/locales/ur.js +0 -113
  1610. package/node_modules/zod/v4/locales/uz.cjs +0 -138
  1611. package/node_modules/zod/v4/locales/uz.d.cts +0 -5
  1612. package/node_modules/zod/v4/locales/uz.d.ts +0 -4
  1613. package/node_modules/zod/v4/locales/uz.js +0 -111
  1614. package/node_modules/zod/v4/locales/vi.cjs +0 -138
  1615. package/node_modules/zod/v4/locales/vi.d.cts +0 -5
  1616. package/node_modules/zod/v4/locales/vi.d.ts +0 -4
  1617. package/node_modules/zod/v4/locales/vi.js +0 -111
  1618. package/node_modules/zod/v4/locales/yo.cjs +0 -137
  1619. package/node_modules/zod/v4/locales/yo.d.cts +0 -5
  1620. package/node_modules/zod/v4/locales/yo.d.ts +0 -4
  1621. package/node_modules/zod/v4/locales/yo.js +0 -110
  1622. package/node_modules/zod/v4/locales/zh-CN.cjs +0 -139
  1623. package/node_modules/zod/v4/locales/zh-CN.d.cts +0 -5
  1624. package/node_modules/zod/v4/locales/zh-CN.d.ts +0 -4
  1625. package/node_modules/zod/v4/locales/zh-CN.js +0 -112
  1626. package/node_modules/zod/v4/locales/zh-TW.cjs +0 -137
  1627. package/node_modules/zod/v4/locales/zh-TW.d.cts +0 -5
  1628. package/node_modules/zod/v4/locales/zh-TW.d.ts +0 -4
  1629. package/node_modules/zod/v4/locales/zh-TW.js +0 -110
  1630. package/node_modules/zod/v4/mini/checks.cjs +0 -35
  1631. package/node_modules/zod/v4/mini/checks.d.cts +0 -1
  1632. package/node_modules/zod/v4/mini/checks.d.ts +0 -1
  1633. package/node_modules/zod/v4/mini/checks.js +0 -1
  1634. package/node_modules/zod/v4/mini/coerce.cjs +0 -52
  1635. package/node_modules/zod/v4/mini/coerce.d.cts +0 -7
  1636. package/node_modules/zod/v4/mini/coerce.d.ts +0 -7
  1637. package/node_modules/zod/v4/mini/coerce.js +0 -22
  1638. package/node_modules/zod/v4/mini/deep-partial.cjs +0 -39
  1639. package/node_modules/zod/v4/mini/deep-partial.d.cts +0 -14
  1640. package/node_modules/zod/v4/mini/deep-partial.d.ts +0 -14
  1641. package/node_modules/zod/v4/mini/deep-partial.js +0 -13
  1642. package/node_modules/zod/v4/mini/external.cjs +0 -74
  1643. package/node_modules/zod/v4/mini/external.d.cts +0 -16
  1644. package/node_modules/zod/v4/mini/external.d.ts +0 -16
  1645. package/node_modules/zod/v4/mini/external.js +0 -16
  1646. package/node_modules/zod/v4/mini/in-out.cjs +0 -63
  1647. package/node_modules/zod/v4/mini/in-out.d.cts +0 -8
  1648. package/node_modules/zod/v4/mini/in-out.d.ts +0 -8
  1649. package/node_modules/zod/v4/mini/in-out.js +0 -36
  1650. package/node_modules/zod/v4/mini/index.cjs +0 -32
  1651. package/node_modules/zod/v4/mini/index.d.cts +0 -3
  1652. package/node_modules/zod/v4/mini/index.d.ts +0 -3
  1653. package/node_modules/zod/v4/mini/index.js +0 -3
  1654. package/node_modules/zod/v4/mini/iso.cjs +0 -64
  1655. package/node_modules/zod/v4/mini/iso.d.cts +0 -22
  1656. package/node_modules/zod/v4/mini/iso.d.ts +0 -22
  1657. package/node_modules/zod/v4/mini/iso.js +0 -34
  1658. package/node_modules/zod/v4/mini/package.json +0 -7
  1659. package/node_modules/zod/v4/mini/parse.cjs +0 -18
  1660. package/node_modules/zod/v4/mini/parse.d.cts +0 -1
  1661. package/node_modules/zod/v4/mini/parse.d.ts +0 -1
  1662. package/node_modules/zod/v4/mini/parse.js +0 -1
  1663. package/node_modules/zod/v4/mini/schemas.cjs +0 -1111
  1664. package/node_modules/zod/v4/mini/schemas.d.cts +0 -475
  1665. package/node_modules/zod/v4/mini/schemas.d.ts +0 -475
  1666. package/node_modules/zod/v4/mini/schemas.js +0 -987
  1667. package/node_modules/zod/v4/package.json +0 -7
  1668. package/node_modules/zod/v4-mini/index.cjs +0 -32
  1669. package/node_modules/zod/v4-mini/index.d.cts +0 -3
  1670. package/node_modules/zod/v4-mini/index.d.ts +0 -3
  1671. package/node_modules/zod/v4-mini/index.js +0 -3
  1672. package/node_modules/zod/v4-mini/package.json +0 -7
  1673. package/personal-state.snapshot.lock.json +0 -40
  1674. package/scene-interaction-v2.snapshot.lock.json +0 -36
@@ -1,3697 +0,0 @@
1
- import { ZodError, ZodIssueCode, } from "./ZodError.js";
2
- import { defaultErrorMap, getErrorMap } from "./errors.js";
3
- import { errorUtil } from "./helpers/errorUtil.js";
4
- import { DIRTY, INVALID, OK, ParseStatus, addIssueToContext, isAborted, isAsync, isDirty, isValid, makeIssue, } from "./helpers/parseUtil.js";
5
- import { util, ZodParsedType, getParsedType } from "./helpers/util.js";
6
- class ParseInputLazyPath {
7
- constructor(parent, value, path, key) {
8
- this._cachedPath = [];
9
- this.parent = parent;
10
- this.data = value;
11
- this._path = path;
12
- this._key = key;
13
- }
14
- get path() {
15
- if (!this._cachedPath.length) {
16
- if (Array.isArray(this._key)) {
17
- this._cachedPath.push(...this._path, ...this._key);
18
- }
19
- else {
20
- this._cachedPath.push(...this._path, this._key);
21
- }
22
- }
23
- return this._cachedPath;
24
- }
25
- }
26
- const handleResult = (ctx, result) => {
27
- if (isValid(result)) {
28
- return { success: true, data: result.value };
29
- }
30
- else {
31
- if (!ctx.common.issues.length) {
32
- throw new Error("Validation failed but no issues detected.");
33
- }
34
- return {
35
- success: false,
36
- get error() {
37
- if (this._error)
38
- return this._error;
39
- const error = new ZodError(ctx.common.issues);
40
- this._error = error;
41
- return this._error;
42
- },
43
- };
44
- }
45
- };
46
- function processCreateParams(params) {
47
- if (!params)
48
- return {};
49
- const { errorMap, invalid_type_error, required_error, description } = params;
50
- if (errorMap && (invalid_type_error || required_error)) {
51
- throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
52
- }
53
- if (errorMap)
54
- return { errorMap: errorMap, description };
55
- const customMap = (iss, ctx) => {
56
- const { message } = params;
57
- if (iss.code === "invalid_enum_value") {
58
- return { message: message ?? ctx.defaultError };
59
- }
60
- if (typeof ctx.data === "undefined") {
61
- return { message: message ?? required_error ?? ctx.defaultError };
62
- }
63
- if (iss.code !== "invalid_type")
64
- return { message: ctx.defaultError };
65
- return { message: message ?? invalid_type_error ?? ctx.defaultError };
66
- };
67
- return { errorMap: customMap, description };
68
- }
69
- export class ZodType {
70
- get description() {
71
- return this._def.description;
72
- }
73
- _getType(input) {
74
- return getParsedType(input.data);
75
- }
76
- _getOrReturnCtx(input, ctx) {
77
- return (ctx || {
78
- common: input.parent.common,
79
- data: input.data,
80
- parsedType: getParsedType(input.data),
81
- schemaErrorMap: this._def.errorMap,
82
- path: input.path,
83
- parent: input.parent,
84
- });
85
- }
86
- _processInputParams(input) {
87
- return {
88
- status: new ParseStatus(),
89
- ctx: {
90
- common: input.parent.common,
91
- data: input.data,
92
- parsedType: getParsedType(input.data),
93
- schemaErrorMap: this._def.errorMap,
94
- path: input.path,
95
- parent: input.parent,
96
- },
97
- };
98
- }
99
- _parseSync(input) {
100
- const result = this._parse(input);
101
- if (isAsync(result)) {
102
- throw new Error("Synchronous parse encountered promise.");
103
- }
104
- return result;
105
- }
106
- _parseAsync(input) {
107
- const result = this._parse(input);
108
- return Promise.resolve(result);
109
- }
110
- parse(data, params) {
111
- const result = this.safeParse(data, params);
112
- if (result.success)
113
- return result.data;
114
- throw result.error;
115
- }
116
- safeParse(data, params) {
117
- const ctx = {
118
- common: {
119
- issues: [],
120
- async: params?.async ?? false,
121
- contextualErrorMap: params?.errorMap,
122
- },
123
- path: params?.path || [],
124
- schemaErrorMap: this._def.errorMap,
125
- parent: null,
126
- data,
127
- parsedType: getParsedType(data),
128
- };
129
- const result = this._parseSync({ data, path: ctx.path, parent: ctx });
130
- return handleResult(ctx, result);
131
- }
132
- "~validate"(data) {
133
- const ctx = {
134
- common: {
135
- issues: [],
136
- async: !!this["~standard"].async,
137
- },
138
- path: [],
139
- schemaErrorMap: this._def.errorMap,
140
- parent: null,
141
- data,
142
- parsedType: getParsedType(data),
143
- };
144
- if (!this["~standard"].async) {
145
- try {
146
- const result = this._parseSync({ data, path: [], parent: ctx });
147
- return isValid(result)
148
- ? {
149
- value: result.value,
150
- }
151
- : {
152
- issues: ctx.common.issues,
153
- };
154
- }
155
- catch (err) {
156
- if (err?.message?.toLowerCase()?.includes("encountered")) {
157
- this["~standard"].async = true;
158
- }
159
- ctx.common = {
160
- issues: [],
161
- async: true,
162
- };
163
- }
164
- }
165
- return this._parseAsync({ data, path: [], parent: ctx }).then((result) => isValid(result)
166
- ? {
167
- value: result.value,
168
- }
169
- : {
170
- issues: ctx.common.issues,
171
- });
172
- }
173
- async parseAsync(data, params) {
174
- const result = await this.safeParseAsync(data, params);
175
- if (result.success)
176
- return result.data;
177
- throw result.error;
178
- }
179
- async safeParseAsync(data, params) {
180
- const ctx = {
181
- common: {
182
- issues: [],
183
- contextualErrorMap: params?.errorMap,
184
- async: true,
185
- },
186
- path: params?.path || [],
187
- schemaErrorMap: this._def.errorMap,
188
- parent: null,
189
- data,
190
- parsedType: getParsedType(data),
191
- };
192
- const maybeAsyncResult = this._parse({ data, path: ctx.path, parent: ctx });
193
- const result = await (isAsync(maybeAsyncResult) ? maybeAsyncResult : Promise.resolve(maybeAsyncResult));
194
- return handleResult(ctx, result);
195
- }
196
- refine(check, message) {
197
- const getIssueProperties = (val) => {
198
- if (typeof message === "string" || typeof message === "undefined") {
199
- return { message };
200
- }
201
- else if (typeof message === "function") {
202
- return message(val);
203
- }
204
- else {
205
- return message;
206
- }
207
- };
208
- return this._refinement((val, ctx) => {
209
- const result = check(val);
210
- const setError = () => ctx.addIssue({
211
- code: ZodIssueCode.custom,
212
- ...getIssueProperties(val),
213
- });
214
- if (typeof Promise !== "undefined" && result instanceof Promise) {
215
- return result.then((data) => {
216
- if (!data) {
217
- setError();
218
- return false;
219
- }
220
- else {
221
- return true;
222
- }
223
- });
224
- }
225
- if (!result) {
226
- setError();
227
- return false;
228
- }
229
- else {
230
- return true;
231
- }
232
- });
233
- }
234
- refinement(check, refinementData) {
235
- return this._refinement((val, ctx) => {
236
- if (!check(val)) {
237
- ctx.addIssue(typeof refinementData === "function" ? refinementData(val, ctx) : refinementData);
238
- return false;
239
- }
240
- else {
241
- return true;
242
- }
243
- });
244
- }
245
- _refinement(refinement) {
246
- return new ZodEffects({
247
- schema: this,
248
- typeName: ZodFirstPartyTypeKind.ZodEffects,
249
- effect: { type: "refinement", refinement },
250
- });
251
- }
252
- superRefine(refinement) {
253
- return this._refinement(refinement);
254
- }
255
- constructor(def) {
256
- /** Alias of safeParseAsync */
257
- this.spa = this.safeParseAsync;
258
- this._def = def;
259
- this.parse = this.parse.bind(this);
260
- this.safeParse = this.safeParse.bind(this);
261
- this.parseAsync = this.parseAsync.bind(this);
262
- this.safeParseAsync = this.safeParseAsync.bind(this);
263
- this.spa = this.spa.bind(this);
264
- this.refine = this.refine.bind(this);
265
- this.refinement = this.refinement.bind(this);
266
- this.superRefine = this.superRefine.bind(this);
267
- this.optional = this.optional.bind(this);
268
- this.nullable = this.nullable.bind(this);
269
- this.nullish = this.nullish.bind(this);
270
- this.array = this.array.bind(this);
271
- this.promise = this.promise.bind(this);
272
- this.or = this.or.bind(this);
273
- this.and = this.and.bind(this);
274
- this.transform = this.transform.bind(this);
275
- this.brand = this.brand.bind(this);
276
- this.default = this.default.bind(this);
277
- this.catch = this.catch.bind(this);
278
- this.describe = this.describe.bind(this);
279
- this.pipe = this.pipe.bind(this);
280
- this.readonly = this.readonly.bind(this);
281
- this.isNullable = this.isNullable.bind(this);
282
- this.isOptional = this.isOptional.bind(this);
283
- this["~standard"] = {
284
- version: 1,
285
- vendor: "zod",
286
- validate: (data) => this["~validate"](data),
287
- };
288
- }
289
- optional() {
290
- return ZodOptional.create(this, this._def);
291
- }
292
- nullable() {
293
- return ZodNullable.create(this, this._def);
294
- }
295
- nullish() {
296
- return this.nullable().optional();
297
- }
298
- array() {
299
- return ZodArray.create(this);
300
- }
301
- promise() {
302
- return ZodPromise.create(this, this._def);
303
- }
304
- or(option) {
305
- return ZodUnion.create([this, option], this._def);
306
- }
307
- and(incoming) {
308
- return ZodIntersection.create(this, incoming, this._def);
309
- }
310
- transform(transform) {
311
- return new ZodEffects({
312
- ...processCreateParams(this._def),
313
- schema: this,
314
- typeName: ZodFirstPartyTypeKind.ZodEffects,
315
- effect: { type: "transform", transform },
316
- });
317
- }
318
- default(def) {
319
- const defaultValueFunc = typeof def === "function" ? def : () => def;
320
- return new ZodDefault({
321
- ...processCreateParams(this._def),
322
- innerType: this,
323
- defaultValue: defaultValueFunc,
324
- typeName: ZodFirstPartyTypeKind.ZodDefault,
325
- });
326
- }
327
- brand() {
328
- return new ZodBranded({
329
- typeName: ZodFirstPartyTypeKind.ZodBranded,
330
- type: this,
331
- ...processCreateParams(this._def),
332
- });
333
- }
334
- catch(def) {
335
- const catchValueFunc = typeof def === "function" ? def : () => def;
336
- return new ZodCatch({
337
- ...processCreateParams(this._def),
338
- innerType: this,
339
- catchValue: catchValueFunc,
340
- typeName: ZodFirstPartyTypeKind.ZodCatch,
341
- });
342
- }
343
- describe(description) {
344
- const This = this.constructor;
345
- return new This({
346
- ...this._def,
347
- description,
348
- });
349
- }
350
- pipe(target) {
351
- return ZodPipeline.create(this, target);
352
- }
353
- readonly() {
354
- return ZodReadonly.create(this);
355
- }
356
- isOptional() {
357
- return this.safeParse(undefined).success;
358
- }
359
- isNullable() {
360
- return this.safeParse(null).success;
361
- }
362
- }
363
- const cuidRegex = /^c[^\s-]{8,}$/i;
364
- const cuid2Regex = /^[0-9a-z]+$/;
365
- const ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/i;
366
- // const uuidRegex =
367
- // /^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i;
368
- const uuidRegex = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i;
369
- const nanoidRegex = /^[a-z0-9_-]{21}$/i;
370
- const jwtRegex = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/;
371
- const durationRegex = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/;
372
- // from https://stackoverflow.com/a/46181/1550155
373
- // old version: too slow, didn't support unicode
374
- // const emailRegex = /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i;
375
- //old email regex
376
- // const emailRegex = /^(([^<>()[\].,;:\s@"]+(\.[^<>()[\].,;:\s@"]+)*)|(".+"))@((?!-)([^<>()[\].,;:\s@"]+\.)+[^<>()[\].,;:\s@"]{1,})[^-<>()[\].,;:\s@"]$/i;
377
- // eslint-disable-next-line
378
- // const emailRegex =
379
- // /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\])|(\[IPv6:(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))\])|([A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])*(\.[A-Za-z]{2,})+))$/;
380
- // const emailRegex =
381
- // /^[a-zA-Z0-9\.\!\#\$\%\&\'\*\+\/\=\?\^\_\`\{\|\}\~\-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
382
- // const emailRegex =
383
- // /^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i;
384
- const emailRegex = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;
385
- // const emailRegex =
386
- // /^[a-z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-z0-9-]+(?:\.[a-z0-9\-]+)*$/i;
387
- // from https://thekevinscott.com/emojis-in-javascript/#writing-a-regular-expression
388
- const _emojiRegex = `^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;
389
- let emojiRegex;
390
- // faster, simpler, safer
391
- const ipv4Regex = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/;
392
- const ipv4CidrRegex = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/;
393
- // const ipv6Regex =
394
- // /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/;
395
- const ipv6Regex = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/;
396
- const ipv6CidrRegex = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;
397
- // https://stackoverflow.com/questions/7860392/determine-if-string-is-in-base64-using-javascript
398
- const base64Regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;
399
- // https://base64.guru/standards/base64url
400
- const base64urlRegex = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/;
401
- // simple
402
- // const dateRegexSource = `\\d{4}-\\d{2}-\\d{2}`;
403
- // no leap year validation
404
- // const dateRegexSource = `\\d{4}-((0[13578]|10|12)-31|(0[13-9]|1[0-2])-30|(0[1-9]|1[0-2])-(0[1-9]|1\\d|2\\d))`;
405
- // with leap year validation
406
- const dateRegexSource = `((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`;
407
- const dateRegex = new RegExp(`^${dateRegexSource}$`);
408
- function timeRegexSource(args) {
409
- let secondsRegexSource = `[0-5]\\d`;
410
- if (args.precision) {
411
- secondsRegexSource = `${secondsRegexSource}\\.\\d{${args.precision}}`;
412
- }
413
- else if (args.precision == null) {
414
- secondsRegexSource = `${secondsRegexSource}(\\.\\d+)?`;
415
- }
416
- const secondsQuantifier = args.precision ? "+" : "?"; // require seconds if precision is nonzero
417
- return `([01]\\d|2[0-3]):[0-5]\\d(:${secondsRegexSource})${secondsQuantifier}`;
418
- }
419
- function timeRegex(args) {
420
- return new RegExp(`^${timeRegexSource(args)}$`);
421
- }
422
- // Adapted from https://stackoverflow.com/a/3143231
423
- export function datetimeRegex(args) {
424
- let regex = `${dateRegexSource}T${timeRegexSource(args)}`;
425
- const opts = [];
426
- opts.push(args.local ? `Z?` : `Z`);
427
- if (args.offset)
428
- opts.push(`([+-]\\d{2}:?\\d{2})`);
429
- regex = `${regex}(${opts.join("|")})`;
430
- return new RegExp(`^${regex}$`);
431
- }
432
- function isValidIP(ip, version) {
433
- if ((version === "v4" || !version) && ipv4Regex.test(ip)) {
434
- return true;
435
- }
436
- if ((version === "v6" || !version) && ipv6Regex.test(ip)) {
437
- return true;
438
- }
439
- return false;
440
- }
441
- function isValidJWT(jwt, alg) {
442
- if (!jwtRegex.test(jwt))
443
- return false;
444
- try {
445
- const [header] = jwt.split(".");
446
- if (!header)
447
- return false;
448
- // Convert base64url to base64
449
- const base64 = header
450
- .replace(/-/g, "+")
451
- .replace(/_/g, "/")
452
- .padEnd(header.length + ((4 - (header.length % 4)) % 4), "=");
453
- // @ts-ignore
454
- const decoded = JSON.parse(atob(base64));
455
- if (typeof decoded !== "object" || decoded === null)
456
- return false;
457
- if ("typ" in decoded && decoded?.typ !== "JWT")
458
- return false;
459
- if (!decoded.alg)
460
- return false;
461
- if (alg && decoded.alg !== alg)
462
- return false;
463
- return true;
464
- }
465
- catch {
466
- return false;
467
- }
468
- }
469
- function isValidCidr(ip, version) {
470
- if ((version === "v4" || !version) && ipv4CidrRegex.test(ip)) {
471
- return true;
472
- }
473
- if ((version === "v6" || !version) && ipv6CidrRegex.test(ip)) {
474
- return true;
475
- }
476
- return false;
477
- }
478
- export class ZodString extends ZodType {
479
- _parse(input) {
480
- if (this._def.coerce) {
481
- input.data = String(input.data);
482
- }
483
- const parsedType = this._getType(input);
484
- if (parsedType !== ZodParsedType.string) {
485
- const ctx = this._getOrReturnCtx(input);
486
- addIssueToContext(ctx, {
487
- code: ZodIssueCode.invalid_type,
488
- expected: ZodParsedType.string,
489
- received: ctx.parsedType,
490
- });
491
- return INVALID;
492
- }
493
- const status = new ParseStatus();
494
- let ctx = undefined;
495
- for (const check of this._def.checks) {
496
- if (check.kind === "min") {
497
- if (input.data.length < check.value) {
498
- ctx = this._getOrReturnCtx(input, ctx);
499
- addIssueToContext(ctx, {
500
- code: ZodIssueCode.too_small,
501
- minimum: check.value,
502
- type: "string",
503
- inclusive: true,
504
- exact: false,
505
- message: check.message,
506
- });
507
- status.dirty();
508
- }
509
- }
510
- else if (check.kind === "max") {
511
- if (input.data.length > check.value) {
512
- ctx = this._getOrReturnCtx(input, ctx);
513
- addIssueToContext(ctx, {
514
- code: ZodIssueCode.too_big,
515
- maximum: check.value,
516
- type: "string",
517
- inclusive: true,
518
- exact: false,
519
- message: check.message,
520
- });
521
- status.dirty();
522
- }
523
- }
524
- else if (check.kind === "length") {
525
- const tooBig = input.data.length > check.value;
526
- const tooSmall = input.data.length < check.value;
527
- if (tooBig || tooSmall) {
528
- ctx = this._getOrReturnCtx(input, ctx);
529
- if (tooBig) {
530
- addIssueToContext(ctx, {
531
- code: ZodIssueCode.too_big,
532
- maximum: check.value,
533
- type: "string",
534
- inclusive: true,
535
- exact: true,
536
- message: check.message,
537
- });
538
- }
539
- else if (tooSmall) {
540
- addIssueToContext(ctx, {
541
- code: ZodIssueCode.too_small,
542
- minimum: check.value,
543
- type: "string",
544
- inclusive: true,
545
- exact: true,
546
- message: check.message,
547
- });
548
- }
549
- status.dirty();
550
- }
551
- }
552
- else if (check.kind === "email") {
553
- if (!emailRegex.test(input.data)) {
554
- ctx = this._getOrReturnCtx(input, ctx);
555
- addIssueToContext(ctx, {
556
- validation: "email",
557
- code: ZodIssueCode.invalid_string,
558
- message: check.message,
559
- });
560
- status.dirty();
561
- }
562
- }
563
- else if (check.kind === "emoji") {
564
- if (!emojiRegex) {
565
- emojiRegex = new RegExp(_emojiRegex, "u");
566
- }
567
- if (!emojiRegex.test(input.data)) {
568
- ctx = this._getOrReturnCtx(input, ctx);
569
- addIssueToContext(ctx, {
570
- validation: "emoji",
571
- code: ZodIssueCode.invalid_string,
572
- message: check.message,
573
- });
574
- status.dirty();
575
- }
576
- }
577
- else if (check.kind === "uuid") {
578
- if (!uuidRegex.test(input.data)) {
579
- ctx = this._getOrReturnCtx(input, ctx);
580
- addIssueToContext(ctx, {
581
- validation: "uuid",
582
- code: ZodIssueCode.invalid_string,
583
- message: check.message,
584
- });
585
- status.dirty();
586
- }
587
- }
588
- else if (check.kind === "nanoid") {
589
- if (!nanoidRegex.test(input.data)) {
590
- ctx = this._getOrReturnCtx(input, ctx);
591
- addIssueToContext(ctx, {
592
- validation: "nanoid",
593
- code: ZodIssueCode.invalid_string,
594
- message: check.message,
595
- });
596
- status.dirty();
597
- }
598
- }
599
- else if (check.kind === "cuid") {
600
- if (!cuidRegex.test(input.data)) {
601
- ctx = this._getOrReturnCtx(input, ctx);
602
- addIssueToContext(ctx, {
603
- validation: "cuid",
604
- code: ZodIssueCode.invalid_string,
605
- message: check.message,
606
- });
607
- status.dirty();
608
- }
609
- }
610
- else if (check.kind === "cuid2") {
611
- if (!cuid2Regex.test(input.data)) {
612
- ctx = this._getOrReturnCtx(input, ctx);
613
- addIssueToContext(ctx, {
614
- validation: "cuid2",
615
- code: ZodIssueCode.invalid_string,
616
- message: check.message,
617
- });
618
- status.dirty();
619
- }
620
- }
621
- else if (check.kind === "ulid") {
622
- if (!ulidRegex.test(input.data)) {
623
- ctx = this._getOrReturnCtx(input, ctx);
624
- addIssueToContext(ctx, {
625
- validation: "ulid",
626
- code: ZodIssueCode.invalid_string,
627
- message: check.message,
628
- });
629
- status.dirty();
630
- }
631
- }
632
- else if (check.kind === "url") {
633
- try {
634
- // @ts-ignore
635
- new URL(input.data);
636
- }
637
- catch {
638
- ctx = this._getOrReturnCtx(input, ctx);
639
- addIssueToContext(ctx, {
640
- validation: "url",
641
- code: ZodIssueCode.invalid_string,
642
- message: check.message,
643
- });
644
- status.dirty();
645
- }
646
- }
647
- else if (check.kind === "regex") {
648
- check.regex.lastIndex = 0;
649
- const testResult = check.regex.test(input.data);
650
- if (!testResult) {
651
- ctx = this._getOrReturnCtx(input, ctx);
652
- addIssueToContext(ctx, {
653
- validation: "regex",
654
- code: ZodIssueCode.invalid_string,
655
- message: check.message,
656
- });
657
- status.dirty();
658
- }
659
- }
660
- else if (check.kind === "trim") {
661
- input.data = input.data.trim();
662
- }
663
- else if (check.kind === "includes") {
664
- if (!input.data.includes(check.value, check.position)) {
665
- ctx = this._getOrReturnCtx(input, ctx);
666
- addIssueToContext(ctx, {
667
- code: ZodIssueCode.invalid_string,
668
- validation: { includes: check.value, position: check.position },
669
- message: check.message,
670
- });
671
- status.dirty();
672
- }
673
- }
674
- else if (check.kind === "toLowerCase") {
675
- input.data = input.data.toLowerCase();
676
- }
677
- else if (check.kind === "toUpperCase") {
678
- input.data = input.data.toUpperCase();
679
- }
680
- else if (check.kind === "startsWith") {
681
- if (!input.data.startsWith(check.value)) {
682
- ctx = this._getOrReturnCtx(input, ctx);
683
- addIssueToContext(ctx, {
684
- code: ZodIssueCode.invalid_string,
685
- validation: { startsWith: check.value },
686
- message: check.message,
687
- });
688
- status.dirty();
689
- }
690
- }
691
- else if (check.kind === "endsWith") {
692
- if (!input.data.endsWith(check.value)) {
693
- ctx = this._getOrReturnCtx(input, ctx);
694
- addIssueToContext(ctx, {
695
- code: ZodIssueCode.invalid_string,
696
- validation: { endsWith: check.value },
697
- message: check.message,
698
- });
699
- status.dirty();
700
- }
701
- }
702
- else if (check.kind === "datetime") {
703
- const regex = datetimeRegex(check);
704
- if (!regex.test(input.data)) {
705
- ctx = this._getOrReturnCtx(input, ctx);
706
- addIssueToContext(ctx, {
707
- code: ZodIssueCode.invalid_string,
708
- validation: "datetime",
709
- message: check.message,
710
- });
711
- status.dirty();
712
- }
713
- }
714
- else if (check.kind === "date") {
715
- const regex = dateRegex;
716
- if (!regex.test(input.data)) {
717
- ctx = this._getOrReturnCtx(input, ctx);
718
- addIssueToContext(ctx, {
719
- code: ZodIssueCode.invalid_string,
720
- validation: "date",
721
- message: check.message,
722
- });
723
- status.dirty();
724
- }
725
- }
726
- else if (check.kind === "time") {
727
- const regex = timeRegex(check);
728
- if (!regex.test(input.data)) {
729
- ctx = this._getOrReturnCtx(input, ctx);
730
- addIssueToContext(ctx, {
731
- code: ZodIssueCode.invalid_string,
732
- validation: "time",
733
- message: check.message,
734
- });
735
- status.dirty();
736
- }
737
- }
738
- else if (check.kind === "duration") {
739
- if (!durationRegex.test(input.data)) {
740
- ctx = this._getOrReturnCtx(input, ctx);
741
- addIssueToContext(ctx, {
742
- validation: "duration",
743
- code: ZodIssueCode.invalid_string,
744
- message: check.message,
745
- });
746
- status.dirty();
747
- }
748
- }
749
- else if (check.kind === "ip") {
750
- if (!isValidIP(input.data, check.version)) {
751
- ctx = this._getOrReturnCtx(input, ctx);
752
- addIssueToContext(ctx, {
753
- validation: "ip",
754
- code: ZodIssueCode.invalid_string,
755
- message: check.message,
756
- });
757
- status.dirty();
758
- }
759
- }
760
- else if (check.kind === "jwt") {
761
- if (!isValidJWT(input.data, check.alg)) {
762
- ctx = this._getOrReturnCtx(input, ctx);
763
- addIssueToContext(ctx, {
764
- validation: "jwt",
765
- code: ZodIssueCode.invalid_string,
766
- message: check.message,
767
- });
768
- status.dirty();
769
- }
770
- }
771
- else if (check.kind === "cidr") {
772
- if (!isValidCidr(input.data, check.version)) {
773
- ctx = this._getOrReturnCtx(input, ctx);
774
- addIssueToContext(ctx, {
775
- validation: "cidr",
776
- code: ZodIssueCode.invalid_string,
777
- message: check.message,
778
- });
779
- status.dirty();
780
- }
781
- }
782
- else if (check.kind === "base64") {
783
- if (!base64Regex.test(input.data)) {
784
- ctx = this._getOrReturnCtx(input, ctx);
785
- addIssueToContext(ctx, {
786
- validation: "base64",
787
- code: ZodIssueCode.invalid_string,
788
- message: check.message,
789
- });
790
- status.dirty();
791
- }
792
- }
793
- else if (check.kind === "base64url") {
794
- if (!base64urlRegex.test(input.data)) {
795
- ctx = this._getOrReturnCtx(input, ctx);
796
- addIssueToContext(ctx, {
797
- validation: "base64url",
798
- code: ZodIssueCode.invalid_string,
799
- message: check.message,
800
- });
801
- status.dirty();
802
- }
803
- }
804
- else {
805
- util.assertNever(check);
806
- }
807
- }
808
- return { status: status.value, value: input.data };
809
- }
810
- _regex(regex, validation, message) {
811
- return this.refinement((data) => regex.test(data), {
812
- validation,
813
- code: ZodIssueCode.invalid_string,
814
- ...errorUtil.errToObj(message),
815
- });
816
- }
817
- _addCheck(check) {
818
- return new ZodString({
819
- ...this._def,
820
- checks: [...this._def.checks, check],
821
- });
822
- }
823
- email(message) {
824
- return this._addCheck({ kind: "email", ...errorUtil.errToObj(message) });
825
- }
826
- url(message) {
827
- return this._addCheck({ kind: "url", ...errorUtil.errToObj(message) });
828
- }
829
- emoji(message) {
830
- return this._addCheck({ kind: "emoji", ...errorUtil.errToObj(message) });
831
- }
832
- uuid(message) {
833
- return this._addCheck({ kind: "uuid", ...errorUtil.errToObj(message) });
834
- }
835
- nanoid(message) {
836
- return this._addCheck({ kind: "nanoid", ...errorUtil.errToObj(message) });
837
- }
838
- cuid(message) {
839
- return this._addCheck({ kind: "cuid", ...errorUtil.errToObj(message) });
840
- }
841
- cuid2(message) {
842
- return this._addCheck({ kind: "cuid2", ...errorUtil.errToObj(message) });
843
- }
844
- ulid(message) {
845
- return this._addCheck({ kind: "ulid", ...errorUtil.errToObj(message) });
846
- }
847
- base64(message) {
848
- return this._addCheck({ kind: "base64", ...errorUtil.errToObj(message) });
849
- }
850
- base64url(message) {
851
- // base64url encoding is a modification of base64 that can safely be used in URLs and filenames
852
- return this._addCheck({
853
- kind: "base64url",
854
- ...errorUtil.errToObj(message),
855
- });
856
- }
857
- jwt(options) {
858
- return this._addCheck({ kind: "jwt", ...errorUtil.errToObj(options) });
859
- }
860
- ip(options) {
861
- return this._addCheck({ kind: "ip", ...errorUtil.errToObj(options) });
862
- }
863
- cidr(options) {
864
- return this._addCheck({ kind: "cidr", ...errorUtil.errToObj(options) });
865
- }
866
- datetime(options) {
867
- if (typeof options === "string") {
868
- return this._addCheck({
869
- kind: "datetime",
870
- precision: null,
871
- offset: false,
872
- local: false,
873
- message: options,
874
- });
875
- }
876
- return this._addCheck({
877
- kind: "datetime",
878
- precision: typeof options?.precision === "undefined" ? null : options?.precision,
879
- offset: options?.offset ?? false,
880
- local: options?.local ?? false,
881
- ...errorUtil.errToObj(options?.message),
882
- });
883
- }
884
- date(message) {
885
- return this._addCheck({ kind: "date", message });
886
- }
887
- time(options) {
888
- if (typeof options === "string") {
889
- return this._addCheck({
890
- kind: "time",
891
- precision: null,
892
- message: options,
893
- });
894
- }
895
- return this._addCheck({
896
- kind: "time",
897
- precision: typeof options?.precision === "undefined" ? null : options?.precision,
898
- ...errorUtil.errToObj(options?.message),
899
- });
900
- }
901
- duration(message) {
902
- return this._addCheck({ kind: "duration", ...errorUtil.errToObj(message) });
903
- }
904
- regex(regex, message) {
905
- return this._addCheck({
906
- kind: "regex",
907
- regex: regex,
908
- ...errorUtil.errToObj(message),
909
- });
910
- }
911
- includes(value, options) {
912
- return this._addCheck({
913
- kind: "includes",
914
- value: value,
915
- position: options?.position,
916
- ...errorUtil.errToObj(options?.message),
917
- });
918
- }
919
- startsWith(value, message) {
920
- return this._addCheck({
921
- kind: "startsWith",
922
- value: value,
923
- ...errorUtil.errToObj(message),
924
- });
925
- }
926
- endsWith(value, message) {
927
- return this._addCheck({
928
- kind: "endsWith",
929
- value: value,
930
- ...errorUtil.errToObj(message),
931
- });
932
- }
933
- min(minLength, message) {
934
- return this._addCheck({
935
- kind: "min",
936
- value: minLength,
937
- ...errorUtil.errToObj(message),
938
- });
939
- }
940
- max(maxLength, message) {
941
- return this._addCheck({
942
- kind: "max",
943
- value: maxLength,
944
- ...errorUtil.errToObj(message),
945
- });
946
- }
947
- length(len, message) {
948
- return this._addCheck({
949
- kind: "length",
950
- value: len,
951
- ...errorUtil.errToObj(message),
952
- });
953
- }
954
- /**
955
- * Equivalent to `.min(1)`
956
- */
957
- nonempty(message) {
958
- return this.min(1, errorUtil.errToObj(message));
959
- }
960
- trim() {
961
- return new ZodString({
962
- ...this._def,
963
- checks: [...this._def.checks, { kind: "trim" }],
964
- });
965
- }
966
- toLowerCase() {
967
- return new ZodString({
968
- ...this._def,
969
- checks: [...this._def.checks, { kind: "toLowerCase" }],
970
- });
971
- }
972
- toUpperCase() {
973
- return new ZodString({
974
- ...this._def,
975
- checks: [...this._def.checks, { kind: "toUpperCase" }],
976
- });
977
- }
978
- get isDatetime() {
979
- return !!this._def.checks.find((ch) => ch.kind === "datetime");
980
- }
981
- get isDate() {
982
- return !!this._def.checks.find((ch) => ch.kind === "date");
983
- }
984
- get isTime() {
985
- return !!this._def.checks.find((ch) => ch.kind === "time");
986
- }
987
- get isDuration() {
988
- return !!this._def.checks.find((ch) => ch.kind === "duration");
989
- }
990
- get isEmail() {
991
- return !!this._def.checks.find((ch) => ch.kind === "email");
992
- }
993
- get isURL() {
994
- return !!this._def.checks.find((ch) => ch.kind === "url");
995
- }
996
- get isEmoji() {
997
- return !!this._def.checks.find((ch) => ch.kind === "emoji");
998
- }
999
- get isUUID() {
1000
- return !!this._def.checks.find((ch) => ch.kind === "uuid");
1001
- }
1002
- get isNANOID() {
1003
- return !!this._def.checks.find((ch) => ch.kind === "nanoid");
1004
- }
1005
- get isCUID() {
1006
- return !!this._def.checks.find((ch) => ch.kind === "cuid");
1007
- }
1008
- get isCUID2() {
1009
- return !!this._def.checks.find((ch) => ch.kind === "cuid2");
1010
- }
1011
- get isULID() {
1012
- return !!this._def.checks.find((ch) => ch.kind === "ulid");
1013
- }
1014
- get isIP() {
1015
- return !!this._def.checks.find((ch) => ch.kind === "ip");
1016
- }
1017
- get isCIDR() {
1018
- return !!this._def.checks.find((ch) => ch.kind === "cidr");
1019
- }
1020
- get isBase64() {
1021
- return !!this._def.checks.find((ch) => ch.kind === "base64");
1022
- }
1023
- get isBase64url() {
1024
- // base64url encoding is a modification of base64 that can safely be used in URLs and filenames
1025
- return !!this._def.checks.find((ch) => ch.kind === "base64url");
1026
- }
1027
- get minLength() {
1028
- let min = null;
1029
- for (const ch of this._def.checks) {
1030
- if (ch.kind === "min") {
1031
- if (min === null || ch.value > min)
1032
- min = ch.value;
1033
- }
1034
- }
1035
- return min;
1036
- }
1037
- get maxLength() {
1038
- let max = null;
1039
- for (const ch of this._def.checks) {
1040
- if (ch.kind === "max") {
1041
- if (max === null || ch.value < max)
1042
- max = ch.value;
1043
- }
1044
- }
1045
- return max;
1046
- }
1047
- }
1048
- ZodString.create = (params) => {
1049
- return new ZodString({
1050
- checks: [],
1051
- typeName: ZodFirstPartyTypeKind.ZodString,
1052
- coerce: params?.coerce ?? false,
1053
- ...processCreateParams(params),
1054
- });
1055
- };
1056
- // https://stackoverflow.com/questions/3966484/why-does-modulus-operator-return-fractional-number-in-javascript/31711034#31711034
1057
- function floatSafeRemainder(val, step) {
1058
- const valDecCount = (val.toString().split(".")[1] || "").length;
1059
- const stepDecCount = (step.toString().split(".")[1] || "").length;
1060
- const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;
1061
- const valInt = Number.parseInt(val.toFixed(decCount).replace(".", ""));
1062
- const stepInt = Number.parseInt(step.toFixed(decCount).replace(".", ""));
1063
- return (valInt % stepInt) / 10 ** decCount;
1064
- }
1065
- export class ZodNumber extends ZodType {
1066
- constructor() {
1067
- super(...arguments);
1068
- this.min = this.gte;
1069
- this.max = this.lte;
1070
- this.step = this.multipleOf;
1071
- }
1072
- _parse(input) {
1073
- if (this._def.coerce) {
1074
- input.data = Number(input.data);
1075
- }
1076
- const parsedType = this._getType(input);
1077
- if (parsedType !== ZodParsedType.number) {
1078
- const ctx = this._getOrReturnCtx(input);
1079
- addIssueToContext(ctx, {
1080
- code: ZodIssueCode.invalid_type,
1081
- expected: ZodParsedType.number,
1082
- received: ctx.parsedType,
1083
- });
1084
- return INVALID;
1085
- }
1086
- let ctx = undefined;
1087
- const status = new ParseStatus();
1088
- for (const check of this._def.checks) {
1089
- if (check.kind === "int") {
1090
- if (!util.isInteger(input.data)) {
1091
- ctx = this._getOrReturnCtx(input, ctx);
1092
- addIssueToContext(ctx, {
1093
- code: ZodIssueCode.invalid_type,
1094
- expected: "integer",
1095
- received: "float",
1096
- message: check.message,
1097
- });
1098
- status.dirty();
1099
- }
1100
- }
1101
- else if (check.kind === "min") {
1102
- const tooSmall = check.inclusive ? input.data < check.value : input.data <= check.value;
1103
- if (tooSmall) {
1104
- ctx = this._getOrReturnCtx(input, ctx);
1105
- addIssueToContext(ctx, {
1106
- code: ZodIssueCode.too_small,
1107
- minimum: check.value,
1108
- type: "number",
1109
- inclusive: check.inclusive,
1110
- exact: false,
1111
- message: check.message,
1112
- });
1113
- status.dirty();
1114
- }
1115
- }
1116
- else if (check.kind === "max") {
1117
- const tooBig = check.inclusive ? input.data > check.value : input.data >= check.value;
1118
- if (tooBig) {
1119
- ctx = this._getOrReturnCtx(input, ctx);
1120
- addIssueToContext(ctx, {
1121
- code: ZodIssueCode.too_big,
1122
- maximum: check.value,
1123
- type: "number",
1124
- inclusive: check.inclusive,
1125
- exact: false,
1126
- message: check.message,
1127
- });
1128
- status.dirty();
1129
- }
1130
- }
1131
- else if (check.kind === "multipleOf") {
1132
- if (floatSafeRemainder(input.data, check.value) !== 0) {
1133
- ctx = this._getOrReturnCtx(input, ctx);
1134
- addIssueToContext(ctx, {
1135
- code: ZodIssueCode.not_multiple_of,
1136
- multipleOf: check.value,
1137
- message: check.message,
1138
- });
1139
- status.dirty();
1140
- }
1141
- }
1142
- else if (check.kind === "finite") {
1143
- if (!Number.isFinite(input.data)) {
1144
- ctx = this._getOrReturnCtx(input, ctx);
1145
- addIssueToContext(ctx, {
1146
- code: ZodIssueCode.not_finite,
1147
- message: check.message,
1148
- });
1149
- status.dirty();
1150
- }
1151
- }
1152
- else {
1153
- util.assertNever(check);
1154
- }
1155
- }
1156
- return { status: status.value, value: input.data };
1157
- }
1158
- gte(value, message) {
1159
- return this.setLimit("min", value, true, errorUtil.toString(message));
1160
- }
1161
- gt(value, message) {
1162
- return this.setLimit("min", value, false, errorUtil.toString(message));
1163
- }
1164
- lte(value, message) {
1165
- return this.setLimit("max", value, true, errorUtil.toString(message));
1166
- }
1167
- lt(value, message) {
1168
- return this.setLimit("max", value, false, errorUtil.toString(message));
1169
- }
1170
- setLimit(kind, value, inclusive, message) {
1171
- return new ZodNumber({
1172
- ...this._def,
1173
- checks: [
1174
- ...this._def.checks,
1175
- {
1176
- kind,
1177
- value,
1178
- inclusive,
1179
- message: errorUtil.toString(message),
1180
- },
1181
- ],
1182
- });
1183
- }
1184
- _addCheck(check) {
1185
- return new ZodNumber({
1186
- ...this._def,
1187
- checks: [...this._def.checks, check],
1188
- });
1189
- }
1190
- int(message) {
1191
- return this._addCheck({
1192
- kind: "int",
1193
- message: errorUtil.toString(message),
1194
- });
1195
- }
1196
- positive(message) {
1197
- return this._addCheck({
1198
- kind: "min",
1199
- value: 0,
1200
- inclusive: false,
1201
- message: errorUtil.toString(message),
1202
- });
1203
- }
1204
- negative(message) {
1205
- return this._addCheck({
1206
- kind: "max",
1207
- value: 0,
1208
- inclusive: false,
1209
- message: errorUtil.toString(message),
1210
- });
1211
- }
1212
- nonpositive(message) {
1213
- return this._addCheck({
1214
- kind: "max",
1215
- value: 0,
1216
- inclusive: true,
1217
- message: errorUtil.toString(message),
1218
- });
1219
- }
1220
- nonnegative(message) {
1221
- return this._addCheck({
1222
- kind: "min",
1223
- value: 0,
1224
- inclusive: true,
1225
- message: errorUtil.toString(message),
1226
- });
1227
- }
1228
- multipleOf(value, message) {
1229
- return this._addCheck({
1230
- kind: "multipleOf",
1231
- value: value,
1232
- message: errorUtil.toString(message),
1233
- });
1234
- }
1235
- finite(message) {
1236
- return this._addCheck({
1237
- kind: "finite",
1238
- message: errorUtil.toString(message),
1239
- });
1240
- }
1241
- safe(message) {
1242
- return this._addCheck({
1243
- kind: "min",
1244
- inclusive: true,
1245
- value: Number.MIN_SAFE_INTEGER,
1246
- message: errorUtil.toString(message),
1247
- })._addCheck({
1248
- kind: "max",
1249
- inclusive: true,
1250
- value: Number.MAX_SAFE_INTEGER,
1251
- message: errorUtil.toString(message),
1252
- });
1253
- }
1254
- get minValue() {
1255
- let min = null;
1256
- for (const ch of this._def.checks) {
1257
- if (ch.kind === "min") {
1258
- if (min === null || ch.value > min)
1259
- min = ch.value;
1260
- }
1261
- }
1262
- return min;
1263
- }
1264
- get maxValue() {
1265
- let max = null;
1266
- for (const ch of this._def.checks) {
1267
- if (ch.kind === "max") {
1268
- if (max === null || ch.value < max)
1269
- max = ch.value;
1270
- }
1271
- }
1272
- return max;
1273
- }
1274
- get isInt() {
1275
- return !!this._def.checks.find((ch) => ch.kind === "int" || (ch.kind === "multipleOf" && util.isInteger(ch.value)));
1276
- }
1277
- get isFinite() {
1278
- let max = null;
1279
- let min = null;
1280
- for (const ch of this._def.checks) {
1281
- if (ch.kind === "finite" || ch.kind === "int" || ch.kind === "multipleOf") {
1282
- return true;
1283
- }
1284
- else if (ch.kind === "min") {
1285
- if (min === null || ch.value > min)
1286
- min = ch.value;
1287
- }
1288
- else if (ch.kind === "max") {
1289
- if (max === null || ch.value < max)
1290
- max = ch.value;
1291
- }
1292
- }
1293
- return Number.isFinite(min) && Number.isFinite(max);
1294
- }
1295
- }
1296
- ZodNumber.create = (params) => {
1297
- return new ZodNumber({
1298
- checks: [],
1299
- typeName: ZodFirstPartyTypeKind.ZodNumber,
1300
- coerce: params?.coerce || false,
1301
- ...processCreateParams(params),
1302
- });
1303
- };
1304
- export class ZodBigInt extends ZodType {
1305
- constructor() {
1306
- super(...arguments);
1307
- this.min = this.gte;
1308
- this.max = this.lte;
1309
- }
1310
- _parse(input) {
1311
- if (this._def.coerce) {
1312
- try {
1313
- input.data = BigInt(input.data);
1314
- }
1315
- catch {
1316
- return this._getInvalidInput(input);
1317
- }
1318
- }
1319
- const parsedType = this._getType(input);
1320
- if (parsedType !== ZodParsedType.bigint) {
1321
- return this._getInvalidInput(input);
1322
- }
1323
- let ctx = undefined;
1324
- const status = new ParseStatus();
1325
- for (const check of this._def.checks) {
1326
- if (check.kind === "min") {
1327
- const tooSmall = check.inclusive ? input.data < check.value : input.data <= check.value;
1328
- if (tooSmall) {
1329
- ctx = this._getOrReturnCtx(input, ctx);
1330
- addIssueToContext(ctx, {
1331
- code: ZodIssueCode.too_small,
1332
- type: "bigint",
1333
- minimum: check.value,
1334
- inclusive: check.inclusive,
1335
- message: check.message,
1336
- });
1337
- status.dirty();
1338
- }
1339
- }
1340
- else if (check.kind === "max") {
1341
- const tooBig = check.inclusive ? input.data > check.value : input.data >= check.value;
1342
- if (tooBig) {
1343
- ctx = this._getOrReturnCtx(input, ctx);
1344
- addIssueToContext(ctx, {
1345
- code: ZodIssueCode.too_big,
1346
- type: "bigint",
1347
- maximum: check.value,
1348
- inclusive: check.inclusive,
1349
- message: check.message,
1350
- });
1351
- status.dirty();
1352
- }
1353
- }
1354
- else if (check.kind === "multipleOf") {
1355
- if (input.data % check.value !== BigInt(0)) {
1356
- ctx = this._getOrReturnCtx(input, ctx);
1357
- addIssueToContext(ctx, {
1358
- code: ZodIssueCode.not_multiple_of,
1359
- multipleOf: check.value,
1360
- message: check.message,
1361
- });
1362
- status.dirty();
1363
- }
1364
- }
1365
- else {
1366
- util.assertNever(check);
1367
- }
1368
- }
1369
- return { status: status.value, value: input.data };
1370
- }
1371
- _getInvalidInput(input) {
1372
- const ctx = this._getOrReturnCtx(input);
1373
- addIssueToContext(ctx, {
1374
- code: ZodIssueCode.invalid_type,
1375
- expected: ZodParsedType.bigint,
1376
- received: ctx.parsedType,
1377
- });
1378
- return INVALID;
1379
- }
1380
- gte(value, message) {
1381
- return this.setLimit("min", value, true, errorUtil.toString(message));
1382
- }
1383
- gt(value, message) {
1384
- return this.setLimit("min", value, false, errorUtil.toString(message));
1385
- }
1386
- lte(value, message) {
1387
- return this.setLimit("max", value, true, errorUtil.toString(message));
1388
- }
1389
- lt(value, message) {
1390
- return this.setLimit("max", value, false, errorUtil.toString(message));
1391
- }
1392
- setLimit(kind, value, inclusive, message) {
1393
- return new ZodBigInt({
1394
- ...this._def,
1395
- checks: [
1396
- ...this._def.checks,
1397
- {
1398
- kind,
1399
- value,
1400
- inclusive,
1401
- message: errorUtil.toString(message),
1402
- },
1403
- ],
1404
- });
1405
- }
1406
- _addCheck(check) {
1407
- return new ZodBigInt({
1408
- ...this._def,
1409
- checks: [...this._def.checks, check],
1410
- });
1411
- }
1412
- positive(message) {
1413
- return this._addCheck({
1414
- kind: "min",
1415
- value: BigInt(0),
1416
- inclusive: false,
1417
- message: errorUtil.toString(message),
1418
- });
1419
- }
1420
- negative(message) {
1421
- return this._addCheck({
1422
- kind: "max",
1423
- value: BigInt(0),
1424
- inclusive: false,
1425
- message: errorUtil.toString(message),
1426
- });
1427
- }
1428
- nonpositive(message) {
1429
- return this._addCheck({
1430
- kind: "max",
1431
- value: BigInt(0),
1432
- inclusive: true,
1433
- message: errorUtil.toString(message),
1434
- });
1435
- }
1436
- nonnegative(message) {
1437
- return this._addCheck({
1438
- kind: "min",
1439
- value: BigInt(0),
1440
- inclusive: true,
1441
- message: errorUtil.toString(message),
1442
- });
1443
- }
1444
- multipleOf(value, message) {
1445
- return this._addCheck({
1446
- kind: "multipleOf",
1447
- value,
1448
- message: errorUtil.toString(message),
1449
- });
1450
- }
1451
- get minValue() {
1452
- let min = null;
1453
- for (const ch of this._def.checks) {
1454
- if (ch.kind === "min") {
1455
- if (min === null || ch.value > min)
1456
- min = ch.value;
1457
- }
1458
- }
1459
- return min;
1460
- }
1461
- get maxValue() {
1462
- let max = null;
1463
- for (const ch of this._def.checks) {
1464
- if (ch.kind === "max") {
1465
- if (max === null || ch.value < max)
1466
- max = ch.value;
1467
- }
1468
- }
1469
- return max;
1470
- }
1471
- }
1472
- ZodBigInt.create = (params) => {
1473
- return new ZodBigInt({
1474
- checks: [],
1475
- typeName: ZodFirstPartyTypeKind.ZodBigInt,
1476
- coerce: params?.coerce ?? false,
1477
- ...processCreateParams(params),
1478
- });
1479
- };
1480
- export class ZodBoolean extends ZodType {
1481
- _parse(input) {
1482
- if (this._def.coerce) {
1483
- input.data = Boolean(input.data);
1484
- }
1485
- const parsedType = this._getType(input);
1486
- if (parsedType !== ZodParsedType.boolean) {
1487
- const ctx = this._getOrReturnCtx(input);
1488
- addIssueToContext(ctx, {
1489
- code: ZodIssueCode.invalid_type,
1490
- expected: ZodParsedType.boolean,
1491
- received: ctx.parsedType,
1492
- });
1493
- return INVALID;
1494
- }
1495
- return OK(input.data);
1496
- }
1497
- }
1498
- ZodBoolean.create = (params) => {
1499
- return new ZodBoolean({
1500
- typeName: ZodFirstPartyTypeKind.ZodBoolean,
1501
- coerce: params?.coerce || false,
1502
- ...processCreateParams(params),
1503
- });
1504
- };
1505
- export class ZodDate extends ZodType {
1506
- _parse(input) {
1507
- if (this._def.coerce) {
1508
- input.data = new Date(input.data);
1509
- }
1510
- const parsedType = this._getType(input);
1511
- if (parsedType !== ZodParsedType.date) {
1512
- const ctx = this._getOrReturnCtx(input);
1513
- addIssueToContext(ctx, {
1514
- code: ZodIssueCode.invalid_type,
1515
- expected: ZodParsedType.date,
1516
- received: ctx.parsedType,
1517
- });
1518
- return INVALID;
1519
- }
1520
- if (Number.isNaN(input.data.getTime())) {
1521
- const ctx = this._getOrReturnCtx(input);
1522
- addIssueToContext(ctx, {
1523
- code: ZodIssueCode.invalid_date,
1524
- });
1525
- return INVALID;
1526
- }
1527
- const status = new ParseStatus();
1528
- let ctx = undefined;
1529
- for (const check of this._def.checks) {
1530
- if (check.kind === "min") {
1531
- if (input.data.getTime() < check.value) {
1532
- ctx = this._getOrReturnCtx(input, ctx);
1533
- addIssueToContext(ctx, {
1534
- code: ZodIssueCode.too_small,
1535
- message: check.message,
1536
- inclusive: true,
1537
- exact: false,
1538
- minimum: check.value,
1539
- type: "date",
1540
- });
1541
- status.dirty();
1542
- }
1543
- }
1544
- else if (check.kind === "max") {
1545
- if (input.data.getTime() > check.value) {
1546
- ctx = this._getOrReturnCtx(input, ctx);
1547
- addIssueToContext(ctx, {
1548
- code: ZodIssueCode.too_big,
1549
- message: check.message,
1550
- inclusive: true,
1551
- exact: false,
1552
- maximum: check.value,
1553
- type: "date",
1554
- });
1555
- status.dirty();
1556
- }
1557
- }
1558
- else {
1559
- util.assertNever(check);
1560
- }
1561
- }
1562
- return {
1563
- status: status.value,
1564
- value: new Date(input.data.getTime()),
1565
- };
1566
- }
1567
- _addCheck(check) {
1568
- return new ZodDate({
1569
- ...this._def,
1570
- checks: [...this._def.checks, check],
1571
- });
1572
- }
1573
- min(minDate, message) {
1574
- return this._addCheck({
1575
- kind: "min",
1576
- value: minDate.getTime(),
1577
- message: errorUtil.toString(message),
1578
- });
1579
- }
1580
- max(maxDate, message) {
1581
- return this._addCheck({
1582
- kind: "max",
1583
- value: maxDate.getTime(),
1584
- message: errorUtil.toString(message),
1585
- });
1586
- }
1587
- get minDate() {
1588
- let min = null;
1589
- for (const ch of this._def.checks) {
1590
- if (ch.kind === "min") {
1591
- if (min === null || ch.value > min)
1592
- min = ch.value;
1593
- }
1594
- }
1595
- return min != null ? new Date(min) : null;
1596
- }
1597
- get maxDate() {
1598
- let max = null;
1599
- for (const ch of this._def.checks) {
1600
- if (ch.kind === "max") {
1601
- if (max === null || ch.value < max)
1602
- max = ch.value;
1603
- }
1604
- }
1605
- return max != null ? new Date(max) : null;
1606
- }
1607
- }
1608
- ZodDate.create = (params) => {
1609
- return new ZodDate({
1610
- checks: [],
1611
- coerce: params?.coerce || false,
1612
- typeName: ZodFirstPartyTypeKind.ZodDate,
1613
- ...processCreateParams(params),
1614
- });
1615
- };
1616
- export class ZodSymbol extends ZodType {
1617
- _parse(input) {
1618
- const parsedType = this._getType(input);
1619
- if (parsedType !== ZodParsedType.symbol) {
1620
- const ctx = this._getOrReturnCtx(input);
1621
- addIssueToContext(ctx, {
1622
- code: ZodIssueCode.invalid_type,
1623
- expected: ZodParsedType.symbol,
1624
- received: ctx.parsedType,
1625
- });
1626
- return INVALID;
1627
- }
1628
- return OK(input.data);
1629
- }
1630
- }
1631
- ZodSymbol.create = (params) => {
1632
- return new ZodSymbol({
1633
- typeName: ZodFirstPartyTypeKind.ZodSymbol,
1634
- ...processCreateParams(params),
1635
- });
1636
- };
1637
- export class ZodUndefined extends ZodType {
1638
- _parse(input) {
1639
- const parsedType = this._getType(input);
1640
- if (parsedType !== ZodParsedType.undefined) {
1641
- const ctx = this._getOrReturnCtx(input);
1642
- addIssueToContext(ctx, {
1643
- code: ZodIssueCode.invalid_type,
1644
- expected: ZodParsedType.undefined,
1645
- received: ctx.parsedType,
1646
- });
1647
- return INVALID;
1648
- }
1649
- return OK(input.data);
1650
- }
1651
- }
1652
- ZodUndefined.create = (params) => {
1653
- return new ZodUndefined({
1654
- typeName: ZodFirstPartyTypeKind.ZodUndefined,
1655
- ...processCreateParams(params),
1656
- });
1657
- };
1658
- export class ZodNull extends ZodType {
1659
- _parse(input) {
1660
- const parsedType = this._getType(input);
1661
- if (parsedType !== ZodParsedType.null) {
1662
- const ctx = this._getOrReturnCtx(input);
1663
- addIssueToContext(ctx, {
1664
- code: ZodIssueCode.invalid_type,
1665
- expected: ZodParsedType.null,
1666
- received: ctx.parsedType,
1667
- });
1668
- return INVALID;
1669
- }
1670
- return OK(input.data);
1671
- }
1672
- }
1673
- ZodNull.create = (params) => {
1674
- return new ZodNull({
1675
- typeName: ZodFirstPartyTypeKind.ZodNull,
1676
- ...processCreateParams(params),
1677
- });
1678
- };
1679
- export class ZodAny extends ZodType {
1680
- constructor() {
1681
- super(...arguments);
1682
- // to prevent instances of other classes from extending ZodAny. this causes issues with catchall in ZodObject.
1683
- this._any = true;
1684
- }
1685
- _parse(input) {
1686
- return OK(input.data);
1687
- }
1688
- }
1689
- ZodAny.create = (params) => {
1690
- return new ZodAny({
1691
- typeName: ZodFirstPartyTypeKind.ZodAny,
1692
- ...processCreateParams(params),
1693
- });
1694
- };
1695
- export class ZodUnknown extends ZodType {
1696
- constructor() {
1697
- super(...arguments);
1698
- // required
1699
- this._unknown = true;
1700
- }
1701
- _parse(input) {
1702
- return OK(input.data);
1703
- }
1704
- }
1705
- ZodUnknown.create = (params) => {
1706
- return new ZodUnknown({
1707
- typeName: ZodFirstPartyTypeKind.ZodUnknown,
1708
- ...processCreateParams(params),
1709
- });
1710
- };
1711
- export class ZodNever extends ZodType {
1712
- _parse(input) {
1713
- const ctx = this._getOrReturnCtx(input);
1714
- addIssueToContext(ctx, {
1715
- code: ZodIssueCode.invalid_type,
1716
- expected: ZodParsedType.never,
1717
- received: ctx.parsedType,
1718
- });
1719
- return INVALID;
1720
- }
1721
- }
1722
- ZodNever.create = (params) => {
1723
- return new ZodNever({
1724
- typeName: ZodFirstPartyTypeKind.ZodNever,
1725
- ...processCreateParams(params),
1726
- });
1727
- };
1728
- export class ZodVoid extends ZodType {
1729
- _parse(input) {
1730
- const parsedType = this._getType(input);
1731
- if (parsedType !== ZodParsedType.undefined) {
1732
- const ctx = this._getOrReturnCtx(input);
1733
- addIssueToContext(ctx, {
1734
- code: ZodIssueCode.invalid_type,
1735
- expected: ZodParsedType.void,
1736
- received: ctx.parsedType,
1737
- });
1738
- return INVALID;
1739
- }
1740
- return OK(input.data);
1741
- }
1742
- }
1743
- ZodVoid.create = (params) => {
1744
- return new ZodVoid({
1745
- typeName: ZodFirstPartyTypeKind.ZodVoid,
1746
- ...processCreateParams(params),
1747
- });
1748
- };
1749
- export class ZodArray extends ZodType {
1750
- _parse(input) {
1751
- const { ctx, status } = this._processInputParams(input);
1752
- const def = this._def;
1753
- if (ctx.parsedType !== ZodParsedType.array) {
1754
- addIssueToContext(ctx, {
1755
- code: ZodIssueCode.invalid_type,
1756
- expected: ZodParsedType.array,
1757
- received: ctx.parsedType,
1758
- });
1759
- return INVALID;
1760
- }
1761
- if (def.exactLength !== null) {
1762
- const tooBig = ctx.data.length > def.exactLength.value;
1763
- const tooSmall = ctx.data.length < def.exactLength.value;
1764
- if (tooBig || tooSmall) {
1765
- addIssueToContext(ctx, {
1766
- code: tooBig ? ZodIssueCode.too_big : ZodIssueCode.too_small,
1767
- minimum: (tooSmall ? def.exactLength.value : undefined),
1768
- maximum: (tooBig ? def.exactLength.value : undefined),
1769
- type: "array",
1770
- inclusive: true,
1771
- exact: true,
1772
- message: def.exactLength.message,
1773
- });
1774
- status.dirty();
1775
- }
1776
- }
1777
- if (def.minLength !== null) {
1778
- if (ctx.data.length < def.minLength.value) {
1779
- addIssueToContext(ctx, {
1780
- code: ZodIssueCode.too_small,
1781
- minimum: def.minLength.value,
1782
- type: "array",
1783
- inclusive: true,
1784
- exact: false,
1785
- message: def.minLength.message,
1786
- });
1787
- status.dirty();
1788
- }
1789
- }
1790
- if (def.maxLength !== null) {
1791
- if (ctx.data.length > def.maxLength.value) {
1792
- addIssueToContext(ctx, {
1793
- code: ZodIssueCode.too_big,
1794
- maximum: def.maxLength.value,
1795
- type: "array",
1796
- inclusive: true,
1797
- exact: false,
1798
- message: def.maxLength.message,
1799
- });
1800
- status.dirty();
1801
- }
1802
- }
1803
- if (ctx.common.async) {
1804
- return Promise.all([...ctx.data].map((item, i) => {
1805
- return def.type._parseAsync(new ParseInputLazyPath(ctx, item, ctx.path, i));
1806
- })).then((result) => {
1807
- return ParseStatus.mergeArray(status, result);
1808
- });
1809
- }
1810
- const result = [...ctx.data].map((item, i) => {
1811
- return def.type._parseSync(new ParseInputLazyPath(ctx, item, ctx.path, i));
1812
- });
1813
- return ParseStatus.mergeArray(status, result);
1814
- }
1815
- get element() {
1816
- return this._def.type;
1817
- }
1818
- min(minLength, message) {
1819
- return new ZodArray({
1820
- ...this._def,
1821
- minLength: { value: minLength, message: errorUtil.toString(message) },
1822
- });
1823
- }
1824
- max(maxLength, message) {
1825
- return new ZodArray({
1826
- ...this._def,
1827
- maxLength: { value: maxLength, message: errorUtil.toString(message) },
1828
- });
1829
- }
1830
- length(len, message) {
1831
- return new ZodArray({
1832
- ...this._def,
1833
- exactLength: { value: len, message: errorUtil.toString(message) },
1834
- });
1835
- }
1836
- nonempty(message) {
1837
- return this.min(1, message);
1838
- }
1839
- }
1840
- ZodArray.create = (schema, params) => {
1841
- return new ZodArray({
1842
- type: schema,
1843
- minLength: null,
1844
- maxLength: null,
1845
- exactLength: null,
1846
- typeName: ZodFirstPartyTypeKind.ZodArray,
1847
- ...processCreateParams(params),
1848
- });
1849
- };
1850
- function deepPartialify(schema) {
1851
- if (schema instanceof ZodObject) {
1852
- const newShape = {};
1853
- for (const key in schema.shape) {
1854
- const fieldSchema = schema.shape[key];
1855
- newShape[key] = ZodOptional.create(deepPartialify(fieldSchema));
1856
- }
1857
- return new ZodObject({
1858
- ...schema._def,
1859
- shape: () => newShape,
1860
- });
1861
- }
1862
- else if (schema instanceof ZodArray) {
1863
- return new ZodArray({
1864
- ...schema._def,
1865
- type: deepPartialify(schema.element),
1866
- });
1867
- }
1868
- else if (schema instanceof ZodOptional) {
1869
- return ZodOptional.create(deepPartialify(schema.unwrap()));
1870
- }
1871
- else if (schema instanceof ZodNullable) {
1872
- return ZodNullable.create(deepPartialify(schema.unwrap()));
1873
- }
1874
- else if (schema instanceof ZodTuple) {
1875
- return ZodTuple.create(schema.items.map((item) => deepPartialify(item)));
1876
- }
1877
- else {
1878
- return schema;
1879
- }
1880
- }
1881
- export class ZodObject extends ZodType {
1882
- constructor() {
1883
- super(...arguments);
1884
- this._cached = null;
1885
- /**
1886
- * @deprecated In most cases, this is no longer needed - unknown properties are now silently stripped.
1887
- * If you want to pass through unknown properties, use `.passthrough()` instead.
1888
- */
1889
- this.nonstrict = this.passthrough;
1890
- // extend<
1891
- // Augmentation extends ZodRawShape,
1892
- // NewOutput extends util.flatten<{
1893
- // [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation
1894
- // ? Augmentation[k]["_output"]
1895
- // : k extends keyof Output
1896
- // ? Output[k]
1897
- // : never;
1898
- // }>,
1899
- // NewInput extends util.flatten<{
1900
- // [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation
1901
- // ? Augmentation[k]["_input"]
1902
- // : k extends keyof Input
1903
- // ? Input[k]
1904
- // : never;
1905
- // }>
1906
- // >(
1907
- // augmentation: Augmentation
1908
- // ): ZodObject<
1909
- // extendShape<T, Augmentation>,
1910
- // UnknownKeys,
1911
- // Catchall,
1912
- // NewOutput,
1913
- // NewInput
1914
- // > {
1915
- // return new ZodObject({
1916
- // ...this._def,
1917
- // shape: () => ({
1918
- // ...this._def.shape(),
1919
- // ...augmentation,
1920
- // }),
1921
- // }) as any;
1922
- // }
1923
- /**
1924
- * @deprecated Use `.extend` instead
1925
- * */
1926
- this.augment = this.extend;
1927
- }
1928
- _getCached() {
1929
- if (this._cached !== null)
1930
- return this._cached;
1931
- const shape = this._def.shape();
1932
- const keys = util.objectKeys(shape);
1933
- this._cached = { shape, keys };
1934
- return this._cached;
1935
- }
1936
- _parse(input) {
1937
- const parsedType = this._getType(input);
1938
- if (parsedType !== ZodParsedType.object) {
1939
- const ctx = this._getOrReturnCtx(input);
1940
- addIssueToContext(ctx, {
1941
- code: ZodIssueCode.invalid_type,
1942
- expected: ZodParsedType.object,
1943
- received: ctx.parsedType,
1944
- });
1945
- return INVALID;
1946
- }
1947
- const { status, ctx } = this._processInputParams(input);
1948
- const { shape, keys: shapeKeys } = this._getCached();
1949
- const extraKeys = [];
1950
- if (!(this._def.catchall instanceof ZodNever && this._def.unknownKeys === "strip")) {
1951
- for (const key in ctx.data) {
1952
- if (!shapeKeys.includes(key)) {
1953
- extraKeys.push(key);
1954
- }
1955
- }
1956
- }
1957
- const pairs = [];
1958
- for (const key of shapeKeys) {
1959
- const keyValidator = shape[key];
1960
- const value = ctx.data[key];
1961
- pairs.push({
1962
- key: { status: "valid", value: key },
1963
- value: keyValidator._parse(new ParseInputLazyPath(ctx, value, ctx.path, key)),
1964
- alwaysSet: key in ctx.data,
1965
- });
1966
- }
1967
- if (this._def.catchall instanceof ZodNever) {
1968
- const unknownKeys = this._def.unknownKeys;
1969
- if (unknownKeys === "passthrough") {
1970
- for (const key of extraKeys) {
1971
- pairs.push({
1972
- key: { status: "valid", value: key },
1973
- value: { status: "valid", value: ctx.data[key] },
1974
- });
1975
- }
1976
- }
1977
- else if (unknownKeys === "strict") {
1978
- if (extraKeys.length > 0) {
1979
- addIssueToContext(ctx, {
1980
- code: ZodIssueCode.unrecognized_keys,
1981
- keys: extraKeys,
1982
- });
1983
- status.dirty();
1984
- }
1985
- }
1986
- else if (unknownKeys === "strip") {
1987
- }
1988
- else {
1989
- throw new Error(`Internal ZodObject error: invalid unknownKeys value.`);
1990
- }
1991
- }
1992
- else {
1993
- // run catchall validation
1994
- const catchall = this._def.catchall;
1995
- for (const key of extraKeys) {
1996
- const value = ctx.data[key];
1997
- pairs.push({
1998
- key: { status: "valid", value: key },
1999
- value: catchall._parse(new ParseInputLazyPath(ctx, value, ctx.path, key) //, ctx.child(key), value, getParsedType(value)
2000
- ),
2001
- alwaysSet: key in ctx.data,
2002
- });
2003
- }
2004
- }
2005
- if (ctx.common.async) {
2006
- return Promise.resolve()
2007
- .then(async () => {
2008
- const syncPairs = [];
2009
- for (const pair of pairs) {
2010
- const key = await pair.key;
2011
- const value = await pair.value;
2012
- syncPairs.push({
2013
- key,
2014
- value,
2015
- alwaysSet: pair.alwaysSet,
2016
- });
2017
- }
2018
- return syncPairs;
2019
- })
2020
- .then((syncPairs) => {
2021
- return ParseStatus.mergeObjectSync(status, syncPairs);
2022
- });
2023
- }
2024
- else {
2025
- return ParseStatus.mergeObjectSync(status, pairs);
2026
- }
2027
- }
2028
- get shape() {
2029
- return this._def.shape();
2030
- }
2031
- strict(message) {
2032
- errorUtil.errToObj;
2033
- return new ZodObject({
2034
- ...this._def,
2035
- unknownKeys: "strict",
2036
- ...(message !== undefined
2037
- ? {
2038
- errorMap: (issue, ctx) => {
2039
- const defaultError = this._def.errorMap?.(issue, ctx).message ?? ctx.defaultError;
2040
- if (issue.code === "unrecognized_keys")
2041
- return {
2042
- message: errorUtil.errToObj(message).message ?? defaultError,
2043
- };
2044
- return {
2045
- message: defaultError,
2046
- };
2047
- },
2048
- }
2049
- : {}),
2050
- });
2051
- }
2052
- strip() {
2053
- return new ZodObject({
2054
- ...this._def,
2055
- unknownKeys: "strip",
2056
- });
2057
- }
2058
- passthrough() {
2059
- return new ZodObject({
2060
- ...this._def,
2061
- unknownKeys: "passthrough",
2062
- });
2063
- }
2064
- // const AugmentFactory =
2065
- // <Def extends ZodObjectDef>(def: Def) =>
2066
- // <Augmentation extends ZodRawShape>(
2067
- // augmentation: Augmentation
2068
- // ): ZodObject<
2069
- // extendShape<ReturnType<Def["shape"]>, Augmentation>,
2070
- // Def["unknownKeys"],
2071
- // Def["catchall"]
2072
- // > => {
2073
- // return new ZodObject({
2074
- // ...def,
2075
- // shape: () => ({
2076
- // ...def.shape(),
2077
- // ...augmentation,
2078
- // }),
2079
- // }) as any;
2080
- // };
2081
- extend(augmentation) {
2082
- return new ZodObject({
2083
- ...this._def,
2084
- shape: () => ({
2085
- ...this._def.shape(),
2086
- ...augmentation,
2087
- }),
2088
- });
2089
- }
2090
- /**
2091
- * Prior to zod@1.0.12 there was a bug in the
2092
- * inferred type of merged objects. Please
2093
- * upgrade if you are experiencing issues.
2094
- */
2095
- merge(merging) {
2096
- const merged = new ZodObject({
2097
- unknownKeys: merging._def.unknownKeys,
2098
- catchall: merging._def.catchall,
2099
- shape: () => ({
2100
- ...this._def.shape(),
2101
- ...merging._def.shape(),
2102
- }),
2103
- typeName: ZodFirstPartyTypeKind.ZodObject,
2104
- });
2105
- return merged;
2106
- }
2107
- // merge<
2108
- // Incoming extends AnyZodObject,
2109
- // Augmentation extends Incoming["shape"],
2110
- // NewOutput extends {
2111
- // [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation
2112
- // ? Augmentation[k]["_output"]
2113
- // : k extends keyof Output
2114
- // ? Output[k]
2115
- // : never;
2116
- // },
2117
- // NewInput extends {
2118
- // [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation
2119
- // ? Augmentation[k]["_input"]
2120
- // : k extends keyof Input
2121
- // ? Input[k]
2122
- // : never;
2123
- // }
2124
- // >(
2125
- // merging: Incoming
2126
- // ): ZodObject<
2127
- // extendShape<T, ReturnType<Incoming["_def"]["shape"]>>,
2128
- // Incoming["_def"]["unknownKeys"],
2129
- // Incoming["_def"]["catchall"],
2130
- // NewOutput,
2131
- // NewInput
2132
- // > {
2133
- // const merged: any = new ZodObject({
2134
- // unknownKeys: merging._def.unknownKeys,
2135
- // catchall: merging._def.catchall,
2136
- // shape: () =>
2137
- // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),
2138
- // typeName: ZodFirstPartyTypeKind.ZodObject,
2139
- // }) as any;
2140
- // return merged;
2141
- // }
2142
- setKey(key, schema) {
2143
- return this.augment({ [key]: schema });
2144
- }
2145
- // merge<Incoming extends AnyZodObject>(
2146
- // merging: Incoming
2147
- // ): //ZodObject<T & Incoming["_shape"], UnknownKeys, Catchall> = (merging) => {
2148
- // ZodObject<
2149
- // extendShape<T, ReturnType<Incoming["_def"]["shape"]>>,
2150
- // Incoming["_def"]["unknownKeys"],
2151
- // Incoming["_def"]["catchall"]
2152
- // > {
2153
- // // const mergedShape = objectUtil.mergeShapes(
2154
- // // this._def.shape(),
2155
- // // merging._def.shape()
2156
- // // );
2157
- // const merged: any = new ZodObject({
2158
- // unknownKeys: merging._def.unknownKeys,
2159
- // catchall: merging._def.catchall,
2160
- // shape: () =>
2161
- // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),
2162
- // typeName: ZodFirstPartyTypeKind.ZodObject,
2163
- // }) as any;
2164
- // return merged;
2165
- // }
2166
- catchall(index) {
2167
- return new ZodObject({
2168
- ...this._def,
2169
- catchall: index,
2170
- });
2171
- }
2172
- pick(mask) {
2173
- const shape = {};
2174
- for (const key of util.objectKeys(mask)) {
2175
- if (mask[key] && this.shape[key]) {
2176
- shape[key] = this.shape[key];
2177
- }
2178
- }
2179
- return new ZodObject({
2180
- ...this._def,
2181
- shape: () => shape,
2182
- });
2183
- }
2184
- omit(mask) {
2185
- const shape = {};
2186
- for (const key of util.objectKeys(this.shape)) {
2187
- if (!mask[key]) {
2188
- shape[key] = this.shape[key];
2189
- }
2190
- }
2191
- return new ZodObject({
2192
- ...this._def,
2193
- shape: () => shape,
2194
- });
2195
- }
2196
- /**
2197
- * @deprecated
2198
- */
2199
- deepPartial() {
2200
- return deepPartialify(this);
2201
- }
2202
- partial(mask) {
2203
- const newShape = {};
2204
- for (const key of util.objectKeys(this.shape)) {
2205
- const fieldSchema = this.shape[key];
2206
- if (mask && !mask[key]) {
2207
- newShape[key] = fieldSchema;
2208
- }
2209
- else {
2210
- newShape[key] = fieldSchema.optional();
2211
- }
2212
- }
2213
- return new ZodObject({
2214
- ...this._def,
2215
- shape: () => newShape,
2216
- });
2217
- }
2218
- required(mask) {
2219
- const newShape = {};
2220
- for (const key of util.objectKeys(this.shape)) {
2221
- if (mask && !mask[key]) {
2222
- newShape[key] = this.shape[key];
2223
- }
2224
- else {
2225
- const fieldSchema = this.shape[key];
2226
- let newField = fieldSchema;
2227
- while (newField instanceof ZodOptional) {
2228
- newField = newField._def.innerType;
2229
- }
2230
- newShape[key] = newField;
2231
- }
2232
- }
2233
- return new ZodObject({
2234
- ...this._def,
2235
- shape: () => newShape,
2236
- });
2237
- }
2238
- keyof() {
2239
- return createZodEnum(util.objectKeys(this.shape));
2240
- }
2241
- }
2242
- ZodObject.create = (shape, params) => {
2243
- return new ZodObject({
2244
- shape: () => shape,
2245
- unknownKeys: "strip",
2246
- catchall: ZodNever.create(),
2247
- typeName: ZodFirstPartyTypeKind.ZodObject,
2248
- ...processCreateParams(params),
2249
- });
2250
- };
2251
- ZodObject.strictCreate = (shape, params) => {
2252
- return new ZodObject({
2253
- shape: () => shape,
2254
- unknownKeys: "strict",
2255
- catchall: ZodNever.create(),
2256
- typeName: ZodFirstPartyTypeKind.ZodObject,
2257
- ...processCreateParams(params),
2258
- });
2259
- };
2260
- ZodObject.lazycreate = (shape, params) => {
2261
- return new ZodObject({
2262
- shape,
2263
- unknownKeys: "strip",
2264
- catchall: ZodNever.create(),
2265
- typeName: ZodFirstPartyTypeKind.ZodObject,
2266
- ...processCreateParams(params),
2267
- });
2268
- };
2269
- export class ZodUnion extends ZodType {
2270
- _parse(input) {
2271
- const { ctx } = this._processInputParams(input);
2272
- const options = this._def.options;
2273
- function handleResults(results) {
2274
- // return first issue-free validation if it exists
2275
- for (const result of results) {
2276
- if (result.result.status === "valid") {
2277
- return result.result;
2278
- }
2279
- }
2280
- for (const result of results) {
2281
- if (result.result.status === "dirty") {
2282
- // add issues from dirty option
2283
- ctx.common.issues.push(...result.ctx.common.issues);
2284
- return result.result;
2285
- }
2286
- }
2287
- // return invalid
2288
- const unionErrors = results.map((result) => new ZodError(result.ctx.common.issues));
2289
- addIssueToContext(ctx, {
2290
- code: ZodIssueCode.invalid_union,
2291
- unionErrors,
2292
- });
2293
- return INVALID;
2294
- }
2295
- if (ctx.common.async) {
2296
- return Promise.all(options.map(async (option) => {
2297
- const childCtx = {
2298
- ...ctx,
2299
- common: {
2300
- ...ctx.common,
2301
- issues: [],
2302
- },
2303
- parent: null,
2304
- };
2305
- return {
2306
- result: await option._parseAsync({
2307
- data: ctx.data,
2308
- path: ctx.path,
2309
- parent: childCtx,
2310
- }),
2311
- ctx: childCtx,
2312
- };
2313
- })).then(handleResults);
2314
- }
2315
- else {
2316
- let dirty = undefined;
2317
- const issues = [];
2318
- for (const option of options) {
2319
- const childCtx = {
2320
- ...ctx,
2321
- common: {
2322
- ...ctx.common,
2323
- issues: [],
2324
- },
2325
- parent: null,
2326
- };
2327
- const result = option._parseSync({
2328
- data: ctx.data,
2329
- path: ctx.path,
2330
- parent: childCtx,
2331
- });
2332
- if (result.status === "valid") {
2333
- return result;
2334
- }
2335
- else if (result.status === "dirty" && !dirty) {
2336
- dirty = { result, ctx: childCtx };
2337
- }
2338
- if (childCtx.common.issues.length) {
2339
- issues.push(childCtx.common.issues);
2340
- }
2341
- }
2342
- if (dirty) {
2343
- ctx.common.issues.push(...dirty.ctx.common.issues);
2344
- return dirty.result;
2345
- }
2346
- const unionErrors = issues.map((issues) => new ZodError(issues));
2347
- addIssueToContext(ctx, {
2348
- code: ZodIssueCode.invalid_union,
2349
- unionErrors,
2350
- });
2351
- return INVALID;
2352
- }
2353
- }
2354
- get options() {
2355
- return this._def.options;
2356
- }
2357
- }
2358
- ZodUnion.create = (types, params) => {
2359
- return new ZodUnion({
2360
- options: types,
2361
- typeName: ZodFirstPartyTypeKind.ZodUnion,
2362
- ...processCreateParams(params),
2363
- });
2364
- };
2365
- /////////////////////////////////////////////////////
2366
- /////////////////////////////////////////////////////
2367
- ////////// //////////
2368
- ////////// ZodDiscriminatedUnion //////////
2369
- ////////// //////////
2370
- /////////////////////////////////////////////////////
2371
- /////////////////////////////////////////////////////
2372
- const getDiscriminator = (type) => {
2373
- if (type instanceof ZodLazy) {
2374
- return getDiscriminator(type.schema);
2375
- }
2376
- else if (type instanceof ZodEffects) {
2377
- return getDiscriminator(type.innerType());
2378
- }
2379
- else if (type instanceof ZodLiteral) {
2380
- return [type.value];
2381
- }
2382
- else if (type instanceof ZodEnum) {
2383
- return type.options;
2384
- }
2385
- else if (type instanceof ZodNativeEnum) {
2386
- // eslint-disable-next-line ban/ban
2387
- return util.objectValues(type.enum);
2388
- }
2389
- else if (type instanceof ZodDefault) {
2390
- return getDiscriminator(type._def.innerType);
2391
- }
2392
- else if (type instanceof ZodUndefined) {
2393
- return [undefined];
2394
- }
2395
- else if (type instanceof ZodNull) {
2396
- return [null];
2397
- }
2398
- else if (type instanceof ZodOptional) {
2399
- return [undefined, ...getDiscriminator(type.unwrap())];
2400
- }
2401
- else if (type instanceof ZodNullable) {
2402
- return [null, ...getDiscriminator(type.unwrap())];
2403
- }
2404
- else if (type instanceof ZodBranded) {
2405
- return getDiscriminator(type.unwrap());
2406
- }
2407
- else if (type instanceof ZodReadonly) {
2408
- return getDiscriminator(type.unwrap());
2409
- }
2410
- else if (type instanceof ZodCatch) {
2411
- return getDiscriminator(type._def.innerType);
2412
- }
2413
- else {
2414
- return [];
2415
- }
2416
- };
2417
- export class ZodDiscriminatedUnion extends ZodType {
2418
- _parse(input) {
2419
- const { ctx } = this._processInputParams(input);
2420
- if (ctx.parsedType !== ZodParsedType.object) {
2421
- addIssueToContext(ctx, {
2422
- code: ZodIssueCode.invalid_type,
2423
- expected: ZodParsedType.object,
2424
- received: ctx.parsedType,
2425
- });
2426
- return INVALID;
2427
- }
2428
- const discriminator = this.discriminator;
2429
- const discriminatorValue = ctx.data[discriminator];
2430
- const option = this.optionsMap.get(discriminatorValue);
2431
- if (!option) {
2432
- addIssueToContext(ctx, {
2433
- code: ZodIssueCode.invalid_union_discriminator,
2434
- options: Array.from(this.optionsMap.keys()),
2435
- path: [discriminator],
2436
- });
2437
- return INVALID;
2438
- }
2439
- if (ctx.common.async) {
2440
- return option._parseAsync({
2441
- data: ctx.data,
2442
- path: ctx.path,
2443
- parent: ctx,
2444
- });
2445
- }
2446
- else {
2447
- return option._parseSync({
2448
- data: ctx.data,
2449
- path: ctx.path,
2450
- parent: ctx,
2451
- });
2452
- }
2453
- }
2454
- get discriminator() {
2455
- return this._def.discriminator;
2456
- }
2457
- get options() {
2458
- return this._def.options;
2459
- }
2460
- get optionsMap() {
2461
- return this._def.optionsMap;
2462
- }
2463
- /**
2464
- * The constructor of the discriminated union schema. Its behaviour is very similar to that of the normal z.union() constructor.
2465
- * However, it only allows a union of objects, all of which need to share a discriminator property. This property must
2466
- * have a different value for each object in the union.
2467
- * @param discriminator the name of the discriminator property
2468
- * @param types an array of object schemas
2469
- * @param params
2470
- */
2471
- static create(discriminator, options, params) {
2472
- // Get all the valid discriminator values
2473
- const optionsMap = new Map();
2474
- // try {
2475
- for (const type of options) {
2476
- const discriminatorValues = getDiscriminator(type.shape[discriminator]);
2477
- if (!discriminatorValues.length) {
2478
- throw new Error(`A discriminator value for key \`${discriminator}\` could not be extracted from all schema options`);
2479
- }
2480
- for (const value of discriminatorValues) {
2481
- if (optionsMap.has(value)) {
2482
- throw new Error(`Discriminator property ${String(discriminator)} has duplicate value ${String(value)}`);
2483
- }
2484
- optionsMap.set(value, type);
2485
- }
2486
- }
2487
- return new ZodDiscriminatedUnion({
2488
- typeName: ZodFirstPartyTypeKind.ZodDiscriminatedUnion,
2489
- discriminator,
2490
- options,
2491
- optionsMap,
2492
- ...processCreateParams(params),
2493
- });
2494
- }
2495
- }
2496
- function mergeValues(a, b) {
2497
- const aType = getParsedType(a);
2498
- const bType = getParsedType(b);
2499
- if (a === b) {
2500
- return { valid: true, data: a };
2501
- }
2502
- else if (aType === ZodParsedType.object && bType === ZodParsedType.object) {
2503
- const bKeys = util.objectKeys(b);
2504
- const sharedKeys = util.objectKeys(a).filter((key) => bKeys.indexOf(key) !== -1);
2505
- const newObj = { ...a, ...b };
2506
- if (Object.prototype.hasOwnProperty.call(newObj, "__proto__"))
2507
- delete newObj.__proto__;
2508
- for (const key of sharedKeys) {
2509
- if (key === "__proto__")
2510
- continue;
2511
- const sharedValue = mergeValues(a[key], b[key]);
2512
- if (!sharedValue.valid) {
2513
- return { valid: false };
2514
- }
2515
- newObj[key] = sharedValue.data;
2516
- }
2517
- return { valid: true, data: newObj };
2518
- }
2519
- else if (aType === ZodParsedType.array && bType === ZodParsedType.array) {
2520
- if (a.length !== b.length) {
2521
- return { valid: false };
2522
- }
2523
- const newArray = [];
2524
- for (let index = 0; index < a.length; index++) {
2525
- const itemA = a[index];
2526
- const itemB = b[index];
2527
- const sharedValue = mergeValues(itemA, itemB);
2528
- if (!sharedValue.valid) {
2529
- return { valid: false };
2530
- }
2531
- newArray.push(sharedValue.data);
2532
- }
2533
- return { valid: true, data: newArray };
2534
- }
2535
- else if (aType === ZodParsedType.date && bType === ZodParsedType.date && +a === +b) {
2536
- return { valid: true, data: a };
2537
- }
2538
- else {
2539
- return { valid: false };
2540
- }
2541
- }
2542
- export class ZodIntersection extends ZodType {
2543
- _parse(input) {
2544
- const { status, ctx } = this._processInputParams(input);
2545
- const handleParsed = (parsedLeft, parsedRight) => {
2546
- if (isAborted(parsedLeft) || isAborted(parsedRight)) {
2547
- return INVALID;
2548
- }
2549
- const merged = mergeValues(parsedLeft.value, parsedRight.value);
2550
- if (!merged.valid) {
2551
- addIssueToContext(ctx, {
2552
- code: ZodIssueCode.invalid_intersection_types,
2553
- });
2554
- return INVALID;
2555
- }
2556
- if (isDirty(parsedLeft) || isDirty(parsedRight)) {
2557
- status.dirty();
2558
- }
2559
- return { status: status.value, value: merged.data };
2560
- };
2561
- if (ctx.common.async) {
2562
- return Promise.all([
2563
- this._def.left._parseAsync({
2564
- data: ctx.data,
2565
- path: ctx.path,
2566
- parent: ctx,
2567
- }),
2568
- this._def.right._parseAsync({
2569
- data: ctx.data,
2570
- path: ctx.path,
2571
- parent: ctx,
2572
- }),
2573
- ]).then(([left, right]) => handleParsed(left, right));
2574
- }
2575
- else {
2576
- return handleParsed(this._def.left._parseSync({
2577
- data: ctx.data,
2578
- path: ctx.path,
2579
- parent: ctx,
2580
- }), this._def.right._parseSync({
2581
- data: ctx.data,
2582
- path: ctx.path,
2583
- parent: ctx,
2584
- }));
2585
- }
2586
- }
2587
- }
2588
- ZodIntersection.create = (left, right, params) => {
2589
- return new ZodIntersection({
2590
- left: left,
2591
- right: right,
2592
- typeName: ZodFirstPartyTypeKind.ZodIntersection,
2593
- ...processCreateParams(params),
2594
- });
2595
- };
2596
- // type ZodTupleItems = [ZodTypeAny, ...ZodTypeAny[]];
2597
- export class ZodTuple extends ZodType {
2598
- _parse(input) {
2599
- const { status, ctx } = this._processInputParams(input);
2600
- if (ctx.parsedType !== ZodParsedType.array) {
2601
- addIssueToContext(ctx, {
2602
- code: ZodIssueCode.invalid_type,
2603
- expected: ZodParsedType.array,
2604
- received: ctx.parsedType,
2605
- });
2606
- return INVALID;
2607
- }
2608
- if (ctx.data.length < this._def.items.length) {
2609
- addIssueToContext(ctx, {
2610
- code: ZodIssueCode.too_small,
2611
- minimum: this._def.items.length,
2612
- inclusive: true,
2613
- exact: false,
2614
- type: "array",
2615
- });
2616
- return INVALID;
2617
- }
2618
- const rest = this._def.rest;
2619
- if (!rest && ctx.data.length > this._def.items.length) {
2620
- addIssueToContext(ctx, {
2621
- code: ZodIssueCode.too_big,
2622
- maximum: this._def.items.length,
2623
- inclusive: true,
2624
- exact: false,
2625
- type: "array",
2626
- });
2627
- status.dirty();
2628
- }
2629
- const items = [...ctx.data]
2630
- .map((item, itemIndex) => {
2631
- const schema = this._def.items[itemIndex] || this._def.rest;
2632
- if (!schema)
2633
- return null;
2634
- return schema._parse(new ParseInputLazyPath(ctx, item, ctx.path, itemIndex));
2635
- })
2636
- .filter((x) => !!x); // filter nulls
2637
- if (ctx.common.async) {
2638
- return Promise.all(items).then((results) => {
2639
- return ParseStatus.mergeArray(status, results);
2640
- });
2641
- }
2642
- else {
2643
- return ParseStatus.mergeArray(status, items);
2644
- }
2645
- }
2646
- get items() {
2647
- return this._def.items;
2648
- }
2649
- rest(rest) {
2650
- return new ZodTuple({
2651
- ...this._def,
2652
- rest,
2653
- });
2654
- }
2655
- }
2656
- ZodTuple.create = (schemas, params) => {
2657
- if (!Array.isArray(schemas)) {
2658
- throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
2659
- }
2660
- return new ZodTuple({
2661
- items: schemas,
2662
- typeName: ZodFirstPartyTypeKind.ZodTuple,
2663
- rest: null,
2664
- ...processCreateParams(params),
2665
- });
2666
- };
2667
- export class ZodRecord extends ZodType {
2668
- get keySchema() {
2669
- return this._def.keyType;
2670
- }
2671
- get valueSchema() {
2672
- return this._def.valueType;
2673
- }
2674
- _parse(input) {
2675
- const { status, ctx } = this._processInputParams(input);
2676
- if (ctx.parsedType !== ZodParsedType.object) {
2677
- addIssueToContext(ctx, {
2678
- code: ZodIssueCode.invalid_type,
2679
- expected: ZodParsedType.object,
2680
- received: ctx.parsedType,
2681
- });
2682
- return INVALID;
2683
- }
2684
- const pairs = [];
2685
- const keyType = this._def.keyType;
2686
- const valueType = this._def.valueType;
2687
- for (const key in ctx.data) {
2688
- pairs.push({
2689
- key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, key)),
2690
- value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, key)),
2691
- alwaysSet: key in ctx.data,
2692
- });
2693
- }
2694
- if (ctx.common.async) {
2695
- return ParseStatus.mergeObjectAsync(status, pairs);
2696
- }
2697
- else {
2698
- return ParseStatus.mergeObjectSync(status, pairs);
2699
- }
2700
- }
2701
- get element() {
2702
- return this._def.valueType;
2703
- }
2704
- static create(first, second, third) {
2705
- if (second instanceof ZodType) {
2706
- return new ZodRecord({
2707
- keyType: first,
2708
- valueType: second,
2709
- typeName: ZodFirstPartyTypeKind.ZodRecord,
2710
- ...processCreateParams(third),
2711
- });
2712
- }
2713
- return new ZodRecord({
2714
- keyType: ZodString.create(),
2715
- valueType: first,
2716
- typeName: ZodFirstPartyTypeKind.ZodRecord,
2717
- ...processCreateParams(second),
2718
- });
2719
- }
2720
- }
2721
- export class ZodMap extends ZodType {
2722
- get keySchema() {
2723
- return this._def.keyType;
2724
- }
2725
- get valueSchema() {
2726
- return this._def.valueType;
2727
- }
2728
- _parse(input) {
2729
- const { status, ctx } = this._processInputParams(input);
2730
- if (ctx.parsedType !== ZodParsedType.map) {
2731
- addIssueToContext(ctx, {
2732
- code: ZodIssueCode.invalid_type,
2733
- expected: ZodParsedType.map,
2734
- received: ctx.parsedType,
2735
- });
2736
- return INVALID;
2737
- }
2738
- const keyType = this._def.keyType;
2739
- const valueType = this._def.valueType;
2740
- const pairs = [...ctx.data.entries()].map(([key, value], index) => {
2741
- return {
2742
- key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, [index, "key"])),
2743
- value: valueType._parse(new ParseInputLazyPath(ctx, value, ctx.path, [index, "value"])),
2744
- };
2745
- });
2746
- if (ctx.common.async) {
2747
- const finalMap = new Map();
2748
- return Promise.resolve().then(async () => {
2749
- for (const pair of pairs) {
2750
- const key = await pair.key;
2751
- const value = await pair.value;
2752
- if (key.status === "aborted" || value.status === "aborted") {
2753
- return INVALID;
2754
- }
2755
- if (key.status === "dirty" || value.status === "dirty") {
2756
- status.dirty();
2757
- }
2758
- finalMap.set(key.value, value.value);
2759
- }
2760
- return { status: status.value, value: finalMap };
2761
- });
2762
- }
2763
- else {
2764
- const finalMap = new Map();
2765
- for (const pair of pairs) {
2766
- const key = pair.key;
2767
- const value = pair.value;
2768
- if (key.status === "aborted" || value.status === "aborted") {
2769
- return INVALID;
2770
- }
2771
- if (key.status === "dirty" || value.status === "dirty") {
2772
- status.dirty();
2773
- }
2774
- finalMap.set(key.value, value.value);
2775
- }
2776
- return { status: status.value, value: finalMap };
2777
- }
2778
- }
2779
- }
2780
- ZodMap.create = (keyType, valueType, params) => {
2781
- return new ZodMap({
2782
- valueType,
2783
- keyType,
2784
- typeName: ZodFirstPartyTypeKind.ZodMap,
2785
- ...processCreateParams(params),
2786
- });
2787
- };
2788
- export class ZodSet extends ZodType {
2789
- _parse(input) {
2790
- const { status, ctx } = this._processInputParams(input);
2791
- if (ctx.parsedType !== ZodParsedType.set) {
2792
- addIssueToContext(ctx, {
2793
- code: ZodIssueCode.invalid_type,
2794
- expected: ZodParsedType.set,
2795
- received: ctx.parsedType,
2796
- });
2797
- return INVALID;
2798
- }
2799
- const def = this._def;
2800
- if (def.minSize !== null) {
2801
- if (ctx.data.size < def.minSize.value) {
2802
- addIssueToContext(ctx, {
2803
- code: ZodIssueCode.too_small,
2804
- minimum: def.minSize.value,
2805
- type: "set",
2806
- inclusive: true,
2807
- exact: false,
2808
- message: def.minSize.message,
2809
- });
2810
- status.dirty();
2811
- }
2812
- }
2813
- if (def.maxSize !== null) {
2814
- if (ctx.data.size > def.maxSize.value) {
2815
- addIssueToContext(ctx, {
2816
- code: ZodIssueCode.too_big,
2817
- maximum: def.maxSize.value,
2818
- type: "set",
2819
- inclusive: true,
2820
- exact: false,
2821
- message: def.maxSize.message,
2822
- });
2823
- status.dirty();
2824
- }
2825
- }
2826
- const valueType = this._def.valueType;
2827
- function finalizeSet(elements) {
2828
- const parsedSet = new Set();
2829
- for (const element of elements) {
2830
- if (element.status === "aborted")
2831
- return INVALID;
2832
- if (element.status === "dirty")
2833
- status.dirty();
2834
- parsedSet.add(element.value);
2835
- }
2836
- return { status: status.value, value: parsedSet };
2837
- }
2838
- const elements = [...ctx.data.values()].map((item, i) => valueType._parse(new ParseInputLazyPath(ctx, item, ctx.path, i)));
2839
- if (ctx.common.async) {
2840
- return Promise.all(elements).then((elements) => finalizeSet(elements));
2841
- }
2842
- else {
2843
- return finalizeSet(elements);
2844
- }
2845
- }
2846
- min(minSize, message) {
2847
- return new ZodSet({
2848
- ...this._def,
2849
- minSize: { value: minSize, message: errorUtil.toString(message) },
2850
- });
2851
- }
2852
- max(maxSize, message) {
2853
- return new ZodSet({
2854
- ...this._def,
2855
- maxSize: { value: maxSize, message: errorUtil.toString(message) },
2856
- });
2857
- }
2858
- size(size, message) {
2859
- return this.min(size, message).max(size, message);
2860
- }
2861
- nonempty(message) {
2862
- return this.min(1, message);
2863
- }
2864
- }
2865
- ZodSet.create = (valueType, params) => {
2866
- return new ZodSet({
2867
- valueType,
2868
- minSize: null,
2869
- maxSize: null,
2870
- typeName: ZodFirstPartyTypeKind.ZodSet,
2871
- ...processCreateParams(params),
2872
- });
2873
- };
2874
- export class ZodFunction extends ZodType {
2875
- constructor() {
2876
- super(...arguments);
2877
- this.validate = this.implement;
2878
- }
2879
- _parse(input) {
2880
- const { ctx } = this._processInputParams(input);
2881
- if (ctx.parsedType !== ZodParsedType.function) {
2882
- addIssueToContext(ctx, {
2883
- code: ZodIssueCode.invalid_type,
2884
- expected: ZodParsedType.function,
2885
- received: ctx.parsedType,
2886
- });
2887
- return INVALID;
2888
- }
2889
- function makeArgsIssue(args, error) {
2890
- return makeIssue({
2891
- data: args,
2892
- path: ctx.path,
2893
- errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap(), defaultErrorMap].filter((x) => !!x),
2894
- issueData: {
2895
- code: ZodIssueCode.invalid_arguments,
2896
- argumentsError: error,
2897
- },
2898
- });
2899
- }
2900
- function makeReturnsIssue(returns, error) {
2901
- return makeIssue({
2902
- data: returns,
2903
- path: ctx.path,
2904
- errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap(), defaultErrorMap].filter((x) => !!x),
2905
- issueData: {
2906
- code: ZodIssueCode.invalid_return_type,
2907
- returnTypeError: error,
2908
- },
2909
- });
2910
- }
2911
- const params = { errorMap: ctx.common.contextualErrorMap };
2912
- const fn = ctx.data;
2913
- if (this._def.returns instanceof ZodPromise) {
2914
- // Would love a way to avoid disabling this rule, but we need an alias (using an arrow function was what caused 2651).
2915
- // eslint-disable-next-line @typescript-eslint/no-this-alias
2916
- const me = this;
2917
- return OK(async function (...args) {
2918
- const error = new ZodError([]);
2919
- const parsedArgs = await me._def.args.parseAsync(args, params).catch((e) => {
2920
- error.addIssue(makeArgsIssue(args, e));
2921
- throw error;
2922
- });
2923
- const result = await Reflect.apply(fn, this, parsedArgs);
2924
- const parsedReturns = await me._def.returns._def.type
2925
- .parseAsync(result, params)
2926
- .catch((e) => {
2927
- error.addIssue(makeReturnsIssue(result, e));
2928
- throw error;
2929
- });
2930
- return parsedReturns;
2931
- });
2932
- }
2933
- else {
2934
- // Would love a way to avoid disabling this rule, but we need an alias (using an arrow function was what caused 2651).
2935
- // eslint-disable-next-line @typescript-eslint/no-this-alias
2936
- const me = this;
2937
- return OK(function (...args) {
2938
- const parsedArgs = me._def.args.safeParse(args, params);
2939
- if (!parsedArgs.success) {
2940
- throw new ZodError([makeArgsIssue(args, parsedArgs.error)]);
2941
- }
2942
- const result = Reflect.apply(fn, this, parsedArgs.data);
2943
- const parsedReturns = me._def.returns.safeParse(result, params);
2944
- if (!parsedReturns.success) {
2945
- throw new ZodError([makeReturnsIssue(result, parsedReturns.error)]);
2946
- }
2947
- return parsedReturns.data;
2948
- });
2949
- }
2950
- }
2951
- parameters() {
2952
- return this._def.args;
2953
- }
2954
- returnType() {
2955
- return this._def.returns;
2956
- }
2957
- args(...items) {
2958
- return new ZodFunction({
2959
- ...this._def,
2960
- args: ZodTuple.create(items).rest(ZodUnknown.create()),
2961
- });
2962
- }
2963
- returns(returnType) {
2964
- return new ZodFunction({
2965
- ...this._def,
2966
- returns: returnType,
2967
- });
2968
- }
2969
- implement(func) {
2970
- const validatedFunc = this.parse(func);
2971
- return validatedFunc;
2972
- }
2973
- strictImplement(func) {
2974
- const validatedFunc = this.parse(func);
2975
- return validatedFunc;
2976
- }
2977
- static create(args, returns, params) {
2978
- return new ZodFunction({
2979
- args: (args ? args : ZodTuple.create([]).rest(ZodUnknown.create())),
2980
- returns: returns || ZodUnknown.create(),
2981
- typeName: ZodFirstPartyTypeKind.ZodFunction,
2982
- ...processCreateParams(params),
2983
- });
2984
- }
2985
- }
2986
- export class ZodLazy extends ZodType {
2987
- get schema() {
2988
- return this._def.getter();
2989
- }
2990
- _parse(input) {
2991
- const { ctx } = this._processInputParams(input);
2992
- const lazySchema = this._def.getter();
2993
- return lazySchema._parse({ data: ctx.data, path: ctx.path, parent: ctx });
2994
- }
2995
- }
2996
- ZodLazy.create = (getter, params) => {
2997
- return new ZodLazy({
2998
- getter: getter,
2999
- typeName: ZodFirstPartyTypeKind.ZodLazy,
3000
- ...processCreateParams(params),
3001
- });
3002
- };
3003
- export class ZodLiteral extends ZodType {
3004
- _parse(input) {
3005
- if (input.data !== this._def.value) {
3006
- const ctx = this._getOrReturnCtx(input);
3007
- addIssueToContext(ctx, {
3008
- received: ctx.data,
3009
- code: ZodIssueCode.invalid_literal,
3010
- expected: this._def.value,
3011
- });
3012
- return INVALID;
3013
- }
3014
- return { status: "valid", value: input.data };
3015
- }
3016
- get value() {
3017
- return this._def.value;
3018
- }
3019
- }
3020
- ZodLiteral.create = (value, params) => {
3021
- return new ZodLiteral({
3022
- value: value,
3023
- typeName: ZodFirstPartyTypeKind.ZodLiteral,
3024
- ...processCreateParams(params),
3025
- });
3026
- };
3027
- function createZodEnum(values, params) {
3028
- return new ZodEnum({
3029
- values,
3030
- typeName: ZodFirstPartyTypeKind.ZodEnum,
3031
- ...processCreateParams(params),
3032
- });
3033
- }
3034
- export class ZodEnum extends ZodType {
3035
- _parse(input) {
3036
- if (typeof input.data !== "string") {
3037
- const ctx = this._getOrReturnCtx(input);
3038
- const expectedValues = this._def.values;
3039
- addIssueToContext(ctx, {
3040
- expected: util.joinValues(expectedValues),
3041
- received: ctx.parsedType,
3042
- code: ZodIssueCode.invalid_type,
3043
- });
3044
- return INVALID;
3045
- }
3046
- if (!this._cache) {
3047
- this._cache = new Set(this._def.values);
3048
- }
3049
- if (!this._cache.has(input.data)) {
3050
- const ctx = this._getOrReturnCtx(input);
3051
- const expectedValues = this._def.values;
3052
- addIssueToContext(ctx, {
3053
- received: ctx.data,
3054
- code: ZodIssueCode.invalid_enum_value,
3055
- options: expectedValues,
3056
- });
3057
- return INVALID;
3058
- }
3059
- return OK(input.data);
3060
- }
3061
- get options() {
3062
- return this._def.values;
3063
- }
3064
- get enum() {
3065
- const enumValues = {};
3066
- for (const val of this._def.values) {
3067
- enumValues[val] = val;
3068
- }
3069
- return enumValues;
3070
- }
3071
- get Values() {
3072
- const enumValues = {};
3073
- for (const val of this._def.values) {
3074
- enumValues[val] = val;
3075
- }
3076
- return enumValues;
3077
- }
3078
- get Enum() {
3079
- const enumValues = {};
3080
- for (const val of this._def.values) {
3081
- enumValues[val] = val;
3082
- }
3083
- return enumValues;
3084
- }
3085
- extract(values, newDef = this._def) {
3086
- return ZodEnum.create(values, {
3087
- ...this._def,
3088
- ...newDef,
3089
- });
3090
- }
3091
- exclude(values, newDef = this._def) {
3092
- return ZodEnum.create(this.options.filter((opt) => !values.includes(opt)), {
3093
- ...this._def,
3094
- ...newDef,
3095
- });
3096
- }
3097
- }
3098
- ZodEnum.create = createZodEnum;
3099
- export class ZodNativeEnum extends ZodType {
3100
- _parse(input) {
3101
- const nativeEnumValues = util.getValidEnumValues(this._def.values);
3102
- const ctx = this._getOrReturnCtx(input);
3103
- if (ctx.parsedType !== ZodParsedType.string && ctx.parsedType !== ZodParsedType.number) {
3104
- const expectedValues = util.objectValues(nativeEnumValues);
3105
- addIssueToContext(ctx, {
3106
- expected: util.joinValues(expectedValues),
3107
- received: ctx.parsedType,
3108
- code: ZodIssueCode.invalid_type,
3109
- });
3110
- return INVALID;
3111
- }
3112
- if (!this._cache) {
3113
- this._cache = new Set(util.getValidEnumValues(this._def.values));
3114
- }
3115
- if (!this._cache.has(input.data)) {
3116
- const expectedValues = util.objectValues(nativeEnumValues);
3117
- addIssueToContext(ctx, {
3118
- received: ctx.data,
3119
- code: ZodIssueCode.invalid_enum_value,
3120
- options: expectedValues,
3121
- });
3122
- return INVALID;
3123
- }
3124
- return OK(input.data);
3125
- }
3126
- get enum() {
3127
- return this._def.values;
3128
- }
3129
- }
3130
- ZodNativeEnum.create = (values, params) => {
3131
- return new ZodNativeEnum({
3132
- values: values,
3133
- typeName: ZodFirstPartyTypeKind.ZodNativeEnum,
3134
- ...processCreateParams(params),
3135
- });
3136
- };
3137
- export class ZodPromise extends ZodType {
3138
- unwrap() {
3139
- return this._def.type;
3140
- }
3141
- _parse(input) {
3142
- const { ctx } = this._processInputParams(input);
3143
- if (ctx.parsedType !== ZodParsedType.promise && ctx.common.async === false) {
3144
- addIssueToContext(ctx, {
3145
- code: ZodIssueCode.invalid_type,
3146
- expected: ZodParsedType.promise,
3147
- received: ctx.parsedType,
3148
- });
3149
- return INVALID;
3150
- }
3151
- const promisified = ctx.parsedType === ZodParsedType.promise ? ctx.data : Promise.resolve(ctx.data);
3152
- return OK(promisified.then((data) => {
3153
- return this._def.type.parseAsync(data, {
3154
- path: ctx.path,
3155
- errorMap: ctx.common.contextualErrorMap,
3156
- });
3157
- }));
3158
- }
3159
- }
3160
- ZodPromise.create = (schema, params) => {
3161
- return new ZodPromise({
3162
- type: schema,
3163
- typeName: ZodFirstPartyTypeKind.ZodPromise,
3164
- ...processCreateParams(params),
3165
- });
3166
- };
3167
- export class ZodEffects extends ZodType {
3168
- innerType() {
3169
- return this._def.schema;
3170
- }
3171
- sourceType() {
3172
- return this._def.schema._def.typeName === ZodFirstPartyTypeKind.ZodEffects
3173
- ? this._def.schema.sourceType()
3174
- : this._def.schema;
3175
- }
3176
- _parse(input) {
3177
- const { status, ctx } = this._processInputParams(input);
3178
- const effect = this._def.effect || null;
3179
- const checkCtx = {
3180
- addIssue: (arg) => {
3181
- addIssueToContext(ctx, arg);
3182
- if (arg.fatal) {
3183
- status.abort();
3184
- }
3185
- else {
3186
- status.dirty();
3187
- }
3188
- },
3189
- get path() {
3190
- return ctx.path;
3191
- },
3192
- };
3193
- checkCtx.addIssue = checkCtx.addIssue.bind(checkCtx);
3194
- if (effect.type === "preprocess") {
3195
- const processed = effect.transform(ctx.data, checkCtx);
3196
- if (ctx.common.async) {
3197
- return Promise.resolve(processed).then(async (processed) => {
3198
- if (status.value === "aborted")
3199
- return INVALID;
3200
- const result = await this._def.schema._parseAsync({
3201
- data: processed,
3202
- path: ctx.path,
3203
- parent: ctx,
3204
- });
3205
- if (result.status === "aborted")
3206
- return INVALID;
3207
- if (result.status === "dirty")
3208
- return DIRTY(result.value);
3209
- if (status.value === "dirty")
3210
- return DIRTY(result.value);
3211
- return result;
3212
- });
3213
- }
3214
- else {
3215
- if (status.value === "aborted")
3216
- return INVALID;
3217
- const result = this._def.schema._parseSync({
3218
- data: processed,
3219
- path: ctx.path,
3220
- parent: ctx,
3221
- });
3222
- if (result.status === "aborted")
3223
- return INVALID;
3224
- if (result.status === "dirty")
3225
- return DIRTY(result.value);
3226
- if (status.value === "dirty")
3227
- return DIRTY(result.value);
3228
- return result;
3229
- }
3230
- }
3231
- if (effect.type === "refinement") {
3232
- const executeRefinement = (acc) => {
3233
- const result = effect.refinement(acc, checkCtx);
3234
- if (ctx.common.async) {
3235
- return Promise.resolve(result);
3236
- }
3237
- if (result instanceof Promise) {
3238
- throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");
3239
- }
3240
- return acc;
3241
- };
3242
- if (ctx.common.async === false) {
3243
- const inner = this._def.schema._parseSync({
3244
- data: ctx.data,
3245
- path: ctx.path,
3246
- parent: ctx,
3247
- });
3248
- if (inner.status === "aborted")
3249
- return INVALID;
3250
- if (inner.status === "dirty")
3251
- status.dirty();
3252
- // return value is ignored
3253
- executeRefinement(inner.value);
3254
- return { status: status.value, value: inner.value };
3255
- }
3256
- else {
3257
- return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((inner) => {
3258
- if (inner.status === "aborted")
3259
- return INVALID;
3260
- if (inner.status === "dirty")
3261
- status.dirty();
3262
- return executeRefinement(inner.value).then(() => {
3263
- return { status: status.value, value: inner.value };
3264
- });
3265
- });
3266
- }
3267
- }
3268
- if (effect.type === "transform") {
3269
- if (ctx.common.async === false) {
3270
- const base = this._def.schema._parseSync({
3271
- data: ctx.data,
3272
- path: ctx.path,
3273
- parent: ctx,
3274
- });
3275
- if (!isValid(base))
3276
- return INVALID;
3277
- const result = effect.transform(base.value, checkCtx);
3278
- if (result instanceof Promise) {
3279
- throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);
3280
- }
3281
- return { status: status.value, value: result };
3282
- }
3283
- else {
3284
- return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((base) => {
3285
- if (!isValid(base))
3286
- return INVALID;
3287
- return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({
3288
- status: status.value,
3289
- value: result,
3290
- }));
3291
- });
3292
- }
3293
- }
3294
- util.assertNever(effect);
3295
- }
3296
- }
3297
- ZodEffects.create = (schema, effect, params) => {
3298
- return new ZodEffects({
3299
- schema,
3300
- typeName: ZodFirstPartyTypeKind.ZodEffects,
3301
- effect,
3302
- ...processCreateParams(params),
3303
- });
3304
- };
3305
- ZodEffects.createWithPreprocess = (preprocess, schema, params) => {
3306
- return new ZodEffects({
3307
- schema,
3308
- effect: { type: "preprocess", transform: preprocess },
3309
- typeName: ZodFirstPartyTypeKind.ZodEffects,
3310
- ...processCreateParams(params),
3311
- });
3312
- };
3313
- export { ZodEffects as ZodTransformer };
3314
- export class ZodOptional extends ZodType {
3315
- _parse(input) {
3316
- const parsedType = this._getType(input);
3317
- if (parsedType === ZodParsedType.undefined) {
3318
- return OK(undefined);
3319
- }
3320
- return this._def.innerType._parse(input);
3321
- }
3322
- unwrap() {
3323
- return this._def.innerType;
3324
- }
3325
- }
3326
- ZodOptional.create = (type, params) => {
3327
- return new ZodOptional({
3328
- innerType: type,
3329
- typeName: ZodFirstPartyTypeKind.ZodOptional,
3330
- ...processCreateParams(params),
3331
- });
3332
- };
3333
- export class ZodNullable extends ZodType {
3334
- _parse(input) {
3335
- const parsedType = this._getType(input);
3336
- if (parsedType === ZodParsedType.null) {
3337
- return OK(null);
3338
- }
3339
- return this._def.innerType._parse(input);
3340
- }
3341
- unwrap() {
3342
- return this._def.innerType;
3343
- }
3344
- }
3345
- ZodNullable.create = (type, params) => {
3346
- return new ZodNullable({
3347
- innerType: type,
3348
- typeName: ZodFirstPartyTypeKind.ZodNullable,
3349
- ...processCreateParams(params),
3350
- });
3351
- };
3352
- export class ZodDefault extends ZodType {
3353
- _parse(input) {
3354
- const { ctx } = this._processInputParams(input);
3355
- let data = ctx.data;
3356
- if (ctx.parsedType === ZodParsedType.undefined) {
3357
- data = this._def.defaultValue();
3358
- }
3359
- return this._def.innerType._parse({
3360
- data,
3361
- path: ctx.path,
3362
- parent: ctx,
3363
- });
3364
- }
3365
- removeDefault() {
3366
- return this._def.innerType;
3367
- }
3368
- }
3369
- ZodDefault.create = (type, params) => {
3370
- return new ZodDefault({
3371
- innerType: type,
3372
- typeName: ZodFirstPartyTypeKind.ZodDefault,
3373
- defaultValue: typeof params.default === "function" ? params.default : () => params.default,
3374
- ...processCreateParams(params),
3375
- });
3376
- };
3377
- export class ZodCatch extends ZodType {
3378
- _parse(input) {
3379
- const { ctx } = this._processInputParams(input);
3380
- // newCtx is used to not collect issues from inner types in ctx
3381
- const newCtx = {
3382
- ...ctx,
3383
- common: {
3384
- ...ctx.common,
3385
- issues: [],
3386
- },
3387
- };
3388
- const result = this._def.innerType._parse({
3389
- data: newCtx.data,
3390
- path: newCtx.path,
3391
- parent: {
3392
- ...newCtx,
3393
- },
3394
- });
3395
- if (isAsync(result)) {
3396
- return result.then((result) => {
3397
- return {
3398
- status: "valid",
3399
- value: result.status === "valid"
3400
- ? result.value
3401
- : this._def.catchValue({
3402
- get error() {
3403
- return new ZodError(newCtx.common.issues);
3404
- },
3405
- input: newCtx.data,
3406
- }),
3407
- };
3408
- });
3409
- }
3410
- else {
3411
- return {
3412
- status: "valid",
3413
- value: result.status === "valid"
3414
- ? result.value
3415
- : this._def.catchValue({
3416
- get error() {
3417
- return new ZodError(newCtx.common.issues);
3418
- },
3419
- input: newCtx.data,
3420
- }),
3421
- };
3422
- }
3423
- }
3424
- removeCatch() {
3425
- return this._def.innerType;
3426
- }
3427
- }
3428
- ZodCatch.create = (type, params) => {
3429
- return new ZodCatch({
3430
- innerType: type,
3431
- typeName: ZodFirstPartyTypeKind.ZodCatch,
3432
- catchValue: typeof params.catch === "function" ? params.catch : () => params.catch,
3433
- ...processCreateParams(params),
3434
- });
3435
- };
3436
- export class ZodNaN extends ZodType {
3437
- _parse(input) {
3438
- const parsedType = this._getType(input);
3439
- if (parsedType !== ZodParsedType.nan) {
3440
- const ctx = this._getOrReturnCtx(input);
3441
- addIssueToContext(ctx, {
3442
- code: ZodIssueCode.invalid_type,
3443
- expected: ZodParsedType.nan,
3444
- received: ctx.parsedType,
3445
- });
3446
- return INVALID;
3447
- }
3448
- return { status: "valid", value: input.data };
3449
- }
3450
- }
3451
- ZodNaN.create = (params) => {
3452
- return new ZodNaN({
3453
- typeName: ZodFirstPartyTypeKind.ZodNaN,
3454
- ...processCreateParams(params),
3455
- });
3456
- };
3457
- export const BRAND = Symbol("zod_brand");
3458
- export class ZodBranded extends ZodType {
3459
- _parse(input) {
3460
- const { ctx } = this._processInputParams(input);
3461
- const data = ctx.data;
3462
- return this._def.type._parse({
3463
- data,
3464
- path: ctx.path,
3465
- parent: ctx,
3466
- });
3467
- }
3468
- unwrap() {
3469
- return this._def.type;
3470
- }
3471
- }
3472
- export class ZodPipeline extends ZodType {
3473
- _parse(input) {
3474
- const { status, ctx } = this._processInputParams(input);
3475
- if (ctx.common.async) {
3476
- const handleAsync = async () => {
3477
- const inResult = await this._def.in._parseAsync({
3478
- data: ctx.data,
3479
- path: ctx.path,
3480
- parent: ctx,
3481
- });
3482
- if (inResult.status === "aborted")
3483
- return INVALID;
3484
- if (inResult.status === "dirty") {
3485
- status.dirty();
3486
- return DIRTY(inResult.value);
3487
- }
3488
- else {
3489
- return this._def.out._parseAsync({
3490
- data: inResult.value,
3491
- path: ctx.path,
3492
- parent: ctx,
3493
- });
3494
- }
3495
- };
3496
- return handleAsync();
3497
- }
3498
- else {
3499
- const inResult = this._def.in._parseSync({
3500
- data: ctx.data,
3501
- path: ctx.path,
3502
- parent: ctx,
3503
- });
3504
- if (inResult.status === "aborted")
3505
- return INVALID;
3506
- if (inResult.status === "dirty") {
3507
- status.dirty();
3508
- return {
3509
- status: "dirty",
3510
- value: inResult.value,
3511
- };
3512
- }
3513
- else {
3514
- return this._def.out._parseSync({
3515
- data: inResult.value,
3516
- path: ctx.path,
3517
- parent: ctx,
3518
- });
3519
- }
3520
- }
3521
- }
3522
- static create(a, b) {
3523
- return new ZodPipeline({
3524
- in: a,
3525
- out: b,
3526
- typeName: ZodFirstPartyTypeKind.ZodPipeline,
3527
- });
3528
- }
3529
- }
3530
- export class ZodReadonly extends ZodType {
3531
- _parse(input) {
3532
- const result = this._def.innerType._parse(input);
3533
- const freeze = (data) => {
3534
- if (isValid(data)) {
3535
- data.value = Object.freeze(data.value);
3536
- }
3537
- return data;
3538
- };
3539
- return isAsync(result) ? result.then((data) => freeze(data)) : freeze(result);
3540
- }
3541
- unwrap() {
3542
- return this._def.innerType;
3543
- }
3544
- }
3545
- ZodReadonly.create = (type, params) => {
3546
- return new ZodReadonly({
3547
- innerType: type,
3548
- typeName: ZodFirstPartyTypeKind.ZodReadonly,
3549
- ...processCreateParams(params),
3550
- });
3551
- };
3552
- ////////////////////////////////////////
3553
- ////////////////////////////////////////
3554
- ////////// //////////
3555
- ////////// z.custom //////////
3556
- ////////// //////////
3557
- ////////////////////////////////////////
3558
- ////////////////////////////////////////
3559
- function cleanParams(params, data) {
3560
- const p = typeof params === "function" ? params(data) : typeof params === "string" ? { message: params } : params;
3561
- const p2 = typeof p === "string" ? { message: p } : p;
3562
- return p2;
3563
- }
3564
- export function custom(check, _params = {},
3565
- /**
3566
- * @deprecated
3567
- *
3568
- * Pass `fatal` into the params object instead:
3569
- *
3570
- * ```ts
3571
- * z.string().custom((val) => val.length > 5, { fatal: false })
3572
- * ```
3573
- *
3574
- */
3575
- fatal) {
3576
- if (check)
3577
- return ZodAny.create().superRefine((data, ctx) => {
3578
- const r = check(data);
3579
- if (r instanceof Promise) {
3580
- return r.then((r) => {
3581
- if (!r) {
3582
- const params = cleanParams(_params, data);
3583
- const _fatal = params.fatal ?? fatal ?? true;
3584
- ctx.addIssue({ code: "custom", ...params, fatal: _fatal });
3585
- }
3586
- });
3587
- }
3588
- if (!r) {
3589
- const params = cleanParams(_params, data);
3590
- const _fatal = params.fatal ?? fatal ?? true;
3591
- ctx.addIssue({ code: "custom", ...params, fatal: _fatal });
3592
- }
3593
- return;
3594
- });
3595
- return ZodAny.create();
3596
- }
3597
- export { ZodType as Schema, ZodType as ZodSchema };
3598
- export const late = {
3599
- object: ZodObject.lazycreate,
3600
- };
3601
- export var ZodFirstPartyTypeKind;
3602
- (function (ZodFirstPartyTypeKind) {
3603
- ZodFirstPartyTypeKind["ZodString"] = "ZodString";
3604
- ZodFirstPartyTypeKind["ZodNumber"] = "ZodNumber";
3605
- ZodFirstPartyTypeKind["ZodNaN"] = "ZodNaN";
3606
- ZodFirstPartyTypeKind["ZodBigInt"] = "ZodBigInt";
3607
- ZodFirstPartyTypeKind["ZodBoolean"] = "ZodBoolean";
3608
- ZodFirstPartyTypeKind["ZodDate"] = "ZodDate";
3609
- ZodFirstPartyTypeKind["ZodSymbol"] = "ZodSymbol";
3610
- ZodFirstPartyTypeKind["ZodUndefined"] = "ZodUndefined";
3611
- ZodFirstPartyTypeKind["ZodNull"] = "ZodNull";
3612
- ZodFirstPartyTypeKind["ZodAny"] = "ZodAny";
3613
- ZodFirstPartyTypeKind["ZodUnknown"] = "ZodUnknown";
3614
- ZodFirstPartyTypeKind["ZodNever"] = "ZodNever";
3615
- ZodFirstPartyTypeKind["ZodVoid"] = "ZodVoid";
3616
- ZodFirstPartyTypeKind["ZodArray"] = "ZodArray";
3617
- ZodFirstPartyTypeKind["ZodObject"] = "ZodObject";
3618
- ZodFirstPartyTypeKind["ZodUnion"] = "ZodUnion";
3619
- ZodFirstPartyTypeKind["ZodDiscriminatedUnion"] = "ZodDiscriminatedUnion";
3620
- ZodFirstPartyTypeKind["ZodIntersection"] = "ZodIntersection";
3621
- ZodFirstPartyTypeKind["ZodTuple"] = "ZodTuple";
3622
- ZodFirstPartyTypeKind["ZodRecord"] = "ZodRecord";
3623
- ZodFirstPartyTypeKind["ZodMap"] = "ZodMap";
3624
- ZodFirstPartyTypeKind["ZodSet"] = "ZodSet";
3625
- ZodFirstPartyTypeKind["ZodFunction"] = "ZodFunction";
3626
- ZodFirstPartyTypeKind["ZodLazy"] = "ZodLazy";
3627
- ZodFirstPartyTypeKind["ZodLiteral"] = "ZodLiteral";
3628
- ZodFirstPartyTypeKind["ZodEnum"] = "ZodEnum";
3629
- ZodFirstPartyTypeKind["ZodEffects"] = "ZodEffects";
3630
- ZodFirstPartyTypeKind["ZodNativeEnum"] = "ZodNativeEnum";
3631
- ZodFirstPartyTypeKind["ZodOptional"] = "ZodOptional";
3632
- ZodFirstPartyTypeKind["ZodNullable"] = "ZodNullable";
3633
- ZodFirstPartyTypeKind["ZodDefault"] = "ZodDefault";
3634
- ZodFirstPartyTypeKind["ZodCatch"] = "ZodCatch";
3635
- ZodFirstPartyTypeKind["ZodPromise"] = "ZodPromise";
3636
- ZodFirstPartyTypeKind["ZodBranded"] = "ZodBranded";
3637
- ZodFirstPartyTypeKind["ZodPipeline"] = "ZodPipeline";
3638
- ZodFirstPartyTypeKind["ZodReadonly"] = "ZodReadonly";
3639
- })(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));
3640
- // requires TS 4.4+
3641
- class Class {
3642
- constructor(..._) { }
3643
- }
3644
- const instanceOfType = (
3645
- // const instanceOfType = <T extends new (...args: any[]) => any>(
3646
- cls, params = {
3647
- message: `Input not instance of ${cls.name}`,
3648
- }) => custom((data) => data instanceof cls, params);
3649
- const stringType = ZodString.create;
3650
- const numberType = ZodNumber.create;
3651
- const nanType = ZodNaN.create;
3652
- const bigIntType = ZodBigInt.create;
3653
- const booleanType = ZodBoolean.create;
3654
- const dateType = ZodDate.create;
3655
- const symbolType = ZodSymbol.create;
3656
- const undefinedType = ZodUndefined.create;
3657
- const nullType = ZodNull.create;
3658
- const anyType = ZodAny.create;
3659
- const unknownType = ZodUnknown.create;
3660
- const neverType = ZodNever.create;
3661
- const voidType = ZodVoid.create;
3662
- const arrayType = ZodArray.create;
3663
- const objectType = ZodObject.create;
3664
- const strictObjectType = ZodObject.strictCreate;
3665
- const unionType = ZodUnion.create;
3666
- const discriminatedUnionType = ZodDiscriminatedUnion.create;
3667
- const intersectionType = ZodIntersection.create;
3668
- const tupleType = ZodTuple.create;
3669
- const recordType = ZodRecord.create;
3670
- const mapType = ZodMap.create;
3671
- const setType = ZodSet.create;
3672
- const functionType = ZodFunction.create;
3673
- const lazyType = ZodLazy.create;
3674
- const literalType = ZodLiteral.create;
3675
- const enumType = ZodEnum.create;
3676
- const nativeEnumType = ZodNativeEnum.create;
3677
- const promiseType = ZodPromise.create;
3678
- const effectsType = ZodEffects.create;
3679
- const optionalType = ZodOptional.create;
3680
- const nullableType = ZodNullable.create;
3681
- const preprocessType = ZodEffects.createWithPreprocess;
3682
- const pipelineType = ZodPipeline.create;
3683
- const ostring = () => stringType().optional();
3684
- const onumber = () => numberType().optional();
3685
- const oboolean = () => booleanType().optional();
3686
- export const coerce = {
3687
- string: ((arg) => ZodString.create({ ...arg, coerce: true })),
3688
- number: ((arg) => ZodNumber.create({ ...arg, coerce: true })),
3689
- boolean: ((arg) => ZodBoolean.create({
3690
- ...arg,
3691
- coerce: true,
3692
- })),
3693
- bigint: ((arg) => ZodBigInt.create({ ...arg, coerce: true })),
3694
- date: ((arg) => ZodDate.create({ ...arg, coerce: true })),
3695
- };
3696
- export { anyType as any, arrayType as array, bigIntType as bigint, booleanType as boolean, dateType as date, discriminatedUnionType as discriminatedUnion, effectsType as effect, enumType as enum, functionType as function, instanceOfType as instanceof, intersectionType as intersection, lazyType as lazy, literalType as literal, mapType as map, nanType as nan, nativeEnumType as nativeEnum, neverType as never, nullType as null, nullableType as nullable, numberType as number, objectType as object, oboolean, onumber, optionalType as optional, ostring, pipelineType as pipeline, preprocessType as preprocess, promiseType as promise, recordType as record, setType as set, strictObjectType as strictObject, stringType as string, symbolType as symbol, effectsType as transformer, tupleType as tuple, undefinedType as undefined, unionType as union, unknownType as unknown, voidType as void, };
3697
- export const NEVER = INVALID;