@suveren/gateway 0.39.0 → 0.41.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1039) hide show
  1. package/dist/control-plane/index.mjs +182 -37
  2. package/dist/mcp-server/http.mjs +356 -72
  3. package/dist/ui/assets/index-CO-dj98E.js +123 -0
  4. package/dist/ui/assets/index-DM9WXky8.css +1 -0
  5. package/dist/ui/index.html +2 -2
  6. package/node_modules/@hap/core/README.md +3 -3
  7. package/node_modules/@hap/core/dist/index.d.mts +567 -123
  8. package/node_modules/@hap/core/dist/index.d.ts +567 -123
  9. package/node_modules/@hap/core/dist/index.js +869 -23
  10. package/node_modules/@hap/core/dist/index.mjs +829 -22
  11. package/node_modules/@hap/core/node_modules/@hpke/core/LICENSE +21 -0
  12. package/node_modules/@hap/core/node_modules/@hpke/core/README.md +263 -0
  13. package/node_modules/@hap/core/node_modules/@hpke/core/esm/mod.d.ts +11 -0
  14. package/node_modules/@hap/core/node_modules/@hpke/core/esm/mod.d.ts.map +1 -0
  15. package/node_modules/@hap/core/node_modules/@hpke/core/esm/mod.js +6 -0
  16. package/node_modules/@hap/core/node_modules/@hpke/core/esm/package.json +3 -0
  17. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/aeads/aesGcm.d.ts +80 -0
  18. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/aeads/aesGcm.d.ts.map +1 -0
  19. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/aeads/aesGcm.js +167 -0
  20. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/aeads/exportOnly.d.ts +34 -0
  21. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/aeads/exportOnly.d.ts.map +1 -0
  22. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/aeads/exportOnly.js +56 -0
  23. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/cipherSuiteNative.d.ts +145 -0
  24. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/cipherSuiteNative.d.ts.map +1 -0
  25. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/cipherSuiteNative.js +326 -0
  26. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/encryptionContext.d.ts +15 -0
  27. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/encryptionContext.d.ts.map +1 -0
  28. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/encryptionContext.js +68 -0
  29. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/exporterContext.d.ts +19 -0
  30. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/exporterContext.d.ts.map +1 -0
  31. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/exporterContext.js +62 -0
  32. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/interfaces/aeadParams.d.ts +17 -0
  33. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/interfaces/aeadParams.d.ts.map +1 -0
  34. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/interfaces/aeadParams.js +1 -0
  35. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/interfaces/cipherSuiteParams.d.ts +13 -0
  36. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/interfaces/cipherSuiteParams.d.ts.map +1 -0
  37. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/interfaces/cipherSuiteParams.js +1 -0
  38. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/interfaces/encapsulator.d.ts +8 -0
  39. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/interfaces/encapsulator.d.ts.map +1 -0
  40. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/interfaces/encapsulator.js +1 -0
  41. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/interfaces/encryptionContext.d.ts +40 -0
  42. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/interfaces/encryptionContext.d.ts.map +1 -0
  43. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/interfaces/encryptionContext.js +1 -0
  44. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/interfaces/exporter.d.ts +17 -0
  45. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/interfaces/exporter.d.ts.map +1 -0
  46. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/interfaces/exporter.js +1 -0
  47. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/interfaces/keyInfo.d.ts +7 -0
  48. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/interfaces/keyInfo.d.ts.map +1 -0
  49. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/interfaces/keyInfo.js +1 -0
  50. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/interfaces/responses.d.ts +10 -0
  51. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/interfaces/responses.d.ts.map +1 -0
  52. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/interfaces/responses.js +1 -0
  53. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/kems/dhkemNative.d.ts +26 -0
  54. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/kems/dhkemNative.d.ts.map +1 -0
  55. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/kems/dhkemNative.js +112 -0
  56. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/kems/dhkemPrimitives/x25519.d.ts +24 -0
  57. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/kems/dhkemPrimitives/x25519.d.ts.map +1 -0
  58. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/kems/dhkemPrimitives/x25519.js +214 -0
  59. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/kems/dhkemPrimitives/x448.d.ts +24 -0
  60. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/kems/dhkemPrimitives/x448.d.ts.map +1 -0
  61. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/kems/dhkemPrimitives/x448.js +214 -0
  62. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/kems/dhkemX25519.d.ts +38 -0
  63. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/kems/dhkemX25519.d.ts.map +1 -0
  64. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/kems/dhkemX25519.js +66 -0
  65. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/kems/dhkemX448.d.ts +38 -0
  66. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/kems/dhkemX448.d.ts.map +1 -0
  67. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/kems/dhkemX448.js +66 -0
  68. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/mutex.d.ts +5 -0
  69. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/mutex.d.ts.map +1 -0
  70. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/mutex.js +28 -0
  71. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/native.d.ts +236 -0
  72. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/native.d.ts.map +1 -0
  73. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/native.js +235 -0
  74. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/recipientContext.d.ts +6 -0
  75. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/recipientContext.d.ts.map +1 -0
  76. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/recipientContext.js +38 -0
  77. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/senderContext.d.ts +11 -0
  78. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/senderContext.d.ts.map +1 -0
  79. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/senderContext.js +45 -0
  80. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/utils/emitNotSupported.d.ts +2 -0
  81. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/utils/emitNotSupported.d.ts.map +1 -0
  82. package/node_modules/@hap/core/node_modules/@hpke/core/esm/src/utils/emitNotSupported.js +6 -0
  83. package/node_modules/@hap/core/node_modules/@hpke/core/package.json +46 -0
  84. package/node_modules/@hap/core/node_modules/@hpke/core/script/mod.d.ts +11 -0
  85. package/node_modules/@hap/core/node_modules/@hpke/core/script/mod.d.ts.map +1 -0
  86. package/node_modules/@hap/core/node_modules/@hpke/core/script/mod.js +47 -0
  87. package/node_modules/@hap/core/node_modules/@hpke/core/script/package.json +3 -0
  88. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/aeads/aesGcm.d.ts +80 -0
  89. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/aeads/aesGcm.d.ts.map +1 -0
  90. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/aeads/aesGcm.js +183 -0
  91. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/aeads/exportOnly.d.ts +34 -0
  92. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/aeads/exportOnly.d.ts.map +1 -0
  93. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/aeads/exportOnly.js +70 -0
  94. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/cipherSuiteNative.d.ts +145 -0
  95. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/cipherSuiteNative.d.ts.map +1 -0
  96. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/cipherSuiteNative.js +340 -0
  97. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/encryptionContext.d.ts +15 -0
  98. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/encryptionContext.d.ts.map +1 -0
  99. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/encryptionContext.js +82 -0
  100. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/exporterContext.d.ts +19 -0
  101. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/exporterContext.d.ts.map +1 -0
  102. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/exporterContext.js +78 -0
  103. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/interfaces/aeadParams.d.ts +17 -0
  104. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/interfaces/aeadParams.d.ts.map +1 -0
  105. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/interfaces/aeadParams.js +12 -0
  106. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/interfaces/cipherSuiteParams.d.ts +13 -0
  107. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/interfaces/cipherSuiteParams.d.ts.map +1 -0
  108. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/interfaces/cipherSuiteParams.js +12 -0
  109. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/interfaces/encapsulator.d.ts +8 -0
  110. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/interfaces/encapsulator.d.ts.map +1 -0
  111. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/interfaces/encapsulator.js +12 -0
  112. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/interfaces/encryptionContext.d.ts +40 -0
  113. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/interfaces/encryptionContext.d.ts.map +1 -0
  114. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/interfaces/encryptionContext.js +12 -0
  115. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/interfaces/exporter.d.ts +17 -0
  116. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/interfaces/exporter.d.ts.map +1 -0
  117. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/interfaces/exporter.js +12 -0
  118. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/interfaces/keyInfo.d.ts +7 -0
  119. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/interfaces/keyInfo.d.ts.map +1 -0
  120. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/interfaces/keyInfo.js +12 -0
  121. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/interfaces/responses.d.ts +10 -0
  122. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/interfaces/responses.d.ts.map +1 -0
  123. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/interfaces/responses.js +12 -0
  124. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/kems/dhkemNative.d.ts +26 -0
  125. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/kems/dhkemNative.d.ts.map +1 -0
  126. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/kems/dhkemNative.js +128 -0
  127. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/kems/dhkemPrimitives/x25519.d.ts +24 -0
  128. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/kems/dhkemPrimitives/x25519.d.ts.map +1 -0
  129. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/kems/dhkemPrimitives/x25519.js +228 -0
  130. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/kems/dhkemPrimitives/x448.d.ts +24 -0
  131. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/kems/dhkemPrimitives/x448.d.ts.map +1 -0
  132. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/kems/dhkemPrimitives/x448.js +228 -0
  133. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/kems/dhkemX25519.d.ts +38 -0
  134. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/kems/dhkemX25519.d.ts.map +1 -0
  135. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/kems/dhkemX25519.js +80 -0
  136. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/kems/dhkemX448.d.ts +38 -0
  137. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/kems/dhkemX448.d.ts.map +1 -0
  138. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/kems/dhkemX448.js +80 -0
  139. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/mutex.d.ts +5 -0
  140. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/mutex.d.ts.map +1 -0
  141. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/mutex.js +42 -0
  142. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/native.d.ts +236 -0
  143. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/native.d.ts.map +1 -0
  144. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/native.js +255 -0
  145. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/recipientContext.d.ts +6 -0
  146. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/recipientContext.d.ts.map +1 -0
  147. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/recipientContext.js +52 -0
  148. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/senderContext.d.ts +11 -0
  149. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/senderContext.d.ts.map +1 -0
  150. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/senderContext.js +59 -0
  151. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/utils/emitNotSupported.d.ts +2 -0
  152. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/utils/emitNotSupported.d.ts.map +1 -0
  153. package/node_modules/@hap/core/node_modules/@hpke/core/script/src/utils/emitNotSupported.js +19 -0
  154. package/node_modules/@hap/core/package.json +2 -1
  155. package/node_modules/@hap/core/src/canonicalize.ts +9 -0
  156. package/node_modules/@hap/core/src/commitment-modes.ts +21 -9
  157. package/node_modules/@hap/core/src/errors.ts +24 -8
  158. package/node_modules/@hap/core/src/gatekeeper.ts +52 -8
  159. package/node_modules/@hap/core/src/index.ts +5 -1
  160. package/node_modules/@hap/core/src/issuance.ts +250 -0
  161. package/node_modules/@hap/core/src/mandate.ts +52 -14
  162. package/node_modules/@hap/core/src/owner-signature.ts +86 -39
  163. package/node_modules/@hap/core/src/profile.ts +45 -0
  164. package/node_modules/@hap/core/src/proposal-content.ts +219 -0
  165. package/node_modules/@hap/core/src/ticket-projection.ts +167 -0
  166. package/node_modules/@hap/core/src/ticket.ts +254 -20
  167. package/node_modules/@hap/core/src/types.ts +33 -5
  168. package/node_modules/@hap/core/src/verifier-policy.ts +178 -0
  169. package/node_modules/@hap/core/src/versions.ts +50 -19
  170. package/node_modules/@hono/node-server/dist/index.cjs +31 -6
  171. package/node_modules/@hono/node-server/dist/index.mjs +31 -6
  172. package/node_modules/@hono/node-server/package.json +1 -1
  173. package/node_modules/@hpke/common/esm/package.json +5 -1
  174. package/node_modules/@hpke/common/esm/src/curve/montgomery.d.ts +2 -2
  175. package/node_modules/@hpke/common/esm/src/curve/montgomery.d.ts.map +1 -1
  176. package/node_modules/@hpke/common/esm/src/curve/montgomery.js +41 -26
  177. package/node_modules/@hpke/common/esm/src/hash/sha3.d.ts.map +1 -1
  178. package/node_modules/@hpke/common/esm/src/hash/sha3.js +0 -15
  179. package/node_modules/@hpke/common/esm/src/kdfs/hkdf.d.ts +2 -1
  180. package/node_modules/@hpke/common/esm/src/kdfs/hkdf.d.ts.map +1 -1
  181. package/node_modules/@hpke/common/esm/src/kdfs/hkdf.js +12 -2
  182. package/node_modules/@hpke/common/esm/src/kems/dhkemPrimitives/xCurve.d.ts.map +1 -1
  183. package/node_modules/@hpke/common/esm/src/kems/dhkemPrimitives/xCurve.js +14 -3
  184. package/node_modules/@hpke/common/esm/src/utils/misc.d.ts +6 -0
  185. package/node_modules/@hpke/common/esm/src/utils/misc.d.ts.map +1 -1
  186. package/node_modules/@hpke/common/esm/src/utils/misc.js +43 -10
  187. package/node_modules/@hpke/common/esm/src/utils/noble.d.ts +1 -1
  188. package/node_modules/@hpke/common/esm/src/utils/noble.d.ts.map +1 -1
  189. package/node_modules/@hpke/common/esm/src/utils/noble.js +21 -10
  190. package/node_modules/@hpke/common/package.json +5 -1
  191. package/node_modules/@hpke/common/script/src/curve/montgomery.d.ts +2 -2
  192. package/node_modules/@hpke/common/script/src/curve/montgomery.d.ts.map +1 -1
  193. package/node_modules/@hpke/common/script/src/curve/montgomery.js +40 -25
  194. package/node_modules/@hpke/common/script/src/hash/sha3.d.ts.map +1 -1
  195. package/node_modules/@hpke/common/script/src/hash/sha3.js +0 -15
  196. package/node_modules/@hpke/common/script/src/kdfs/hkdf.d.ts +2 -1
  197. package/node_modules/@hpke/common/script/src/kdfs/hkdf.d.ts.map +1 -1
  198. package/node_modules/@hpke/common/script/src/kdfs/hkdf.js +12 -2
  199. package/node_modules/@hpke/common/script/src/kems/dhkemPrimitives/xCurve.d.ts.map +1 -1
  200. package/node_modules/@hpke/common/script/src/kems/dhkemPrimitives/xCurve.js +13 -2
  201. package/node_modules/@hpke/common/script/src/utils/misc.d.ts +6 -0
  202. package/node_modules/@hpke/common/script/src/utils/misc.d.ts.map +1 -1
  203. package/node_modules/@hpke/common/script/src/utils/misc.js +43 -9
  204. package/node_modules/@hpke/common/script/src/utils/noble.d.ts +1 -1
  205. package/node_modules/@hpke/common/script/src/utils/noble.d.ts.map +1 -1
  206. package/node_modules/@hpke/common/script/src/utils/noble.js +22 -11
  207. package/node_modules/@hpke/core/README.md +56 -56
  208. package/node_modules/@hpke/core/esm/package.json +2 -1
  209. package/node_modules/@hpke/core/esm/src/kems/dhkemPrimitives/x25519.d.ts +3 -21
  210. package/node_modules/@hpke/core/esm/src/kems/dhkemPrimitives/x25519.d.ts.map +1 -1
  211. package/node_modules/@hpke/core/esm/src/kems/dhkemPrimitives/x25519.js +3 -201
  212. package/node_modules/@hpke/core/esm/src/kems/dhkemPrimitives/x448.d.ts +3 -21
  213. package/node_modules/@hpke/core/esm/src/kems/dhkemPrimitives/x448.d.ts.map +1 -1
  214. package/node_modules/@hpke/core/esm/src/kems/dhkemPrimitives/x448.js +3 -201
  215. package/node_modules/@hpke/core/esm/src/kems/dhkemPrimitives/xCurveNative.d.ts +26 -0
  216. package/node_modules/@hpke/core/esm/src/kems/dhkemPrimitives/xCurveNative.d.ts.map +1 -0
  217. package/node_modules/@hpke/core/esm/src/kems/dhkemPrimitives/xCurveNative.js +216 -0
  218. package/node_modules/@hpke/core/package.json +6 -2
  219. package/node_modules/@hpke/core/script/src/kems/dhkemPrimitives/x25519.d.ts +3 -21
  220. package/node_modules/@hpke/core/script/src/kems/dhkemPrimitives/x25519.d.ts.map +1 -1
  221. package/node_modules/@hpke/core/script/src/kems/dhkemPrimitives/x25519.js +4 -202
  222. package/node_modules/@hpke/core/script/src/kems/dhkemPrimitives/x448.d.ts +3 -21
  223. package/node_modules/@hpke/core/script/src/kems/dhkemPrimitives/x448.d.ts.map +1 -1
  224. package/node_modules/@hpke/core/script/src/kems/dhkemPrimitives/x448.js +4 -202
  225. package/node_modules/@hpke/core/script/src/kems/dhkemPrimitives/xCurveNative.d.ts +26 -0
  226. package/node_modules/@hpke/core/script/src/kems/dhkemPrimitives/xCurveNative.d.ts.map +1 -0
  227. package/node_modules/@hpke/core/script/src/kems/dhkemPrimitives/xCurveNative.js +230 -0
  228. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/mcp.d.ts.map +1 -1
  229. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/mcp.js +10 -0
  230. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/mcp.js.map +1 -1
  231. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/transport.d.ts +8 -8
  232. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/transport.d.ts.map +1 -1
  233. package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.d.ts.map +1 -1
  234. package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js +10 -0
  235. package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js.map +1 -1
  236. package/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/transport.d.ts +8 -8
  237. package/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/transport.d.ts.map +1 -1
  238. package/node_modules/@modelcontextprotocol/sdk/package.json +1 -1
  239. package/node_modules/@types/node/README.md +1 -1
  240. package/node_modules/@types/node/package.json +2 -2
  241. package/node_modules/@types/node/zlib.d.ts +752 -0
  242. package/node_modules/encodeurl/README.md +14 -0
  243. package/node_modules/encodeurl/index.js +5 -10
  244. package/node_modules/encodeurl/package.json +10 -6
  245. package/node_modules/express-rate-limit/dist/index.cjs +7 -3
  246. package/node_modules/express-rate-limit/dist/index.mjs +7 -3
  247. package/node_modules/express-rate-limit/package.json +10 -10
  248. package/node_modules/follow-redirects/README.md +27 -1
  249. package/node_modules/follow-redirects/index.js +1 -5
  250. package/node_modules/follow-redirects/package.json +1 -1
  251. package/node_modules/hono/README.md +2 -3
  252. package/node_modules/hono/dist/cjs/adapter/bun/serve-static.js +1 -1
  253. package/node_modules/hono/dist/cjs/adapter/bun/websocket.js +1 -1
  254. package/node_modules/hono/dist/cjs/context.js +1 -1
  255. package/node_modules/hono/dist/cjs/helper/css/common.js +11 -8
  256. package/node_modules/hono/dist/cjs/helper/css/index.js +1 -1
  257. package/node_modules/hono/dist/cjs/helper/route/index.js +3 -1
  258. package/node_modules/hono/dist/cjs/hono-base.js +4 -10
  259. package/node_modules/hono/dist/cjs/hono.js +0 -1
  260. package/node_modules/hono/dist/cjs/jsx/base.js +1 -1
  261. package/node_modules/hono/dist/cjs/middleware/basic-auth/index.js +1 -1
  262. package/node_modules/hono/dist/cjs/middleware/bearer-auth/index.js +9 -1
  263. package/node_modules/hono/dist/cjs/middleware/csrf/index.js +2 -2
  264. package/node_modules/hono/dist/cjs/middleware/jwk/jwk.js +2 -2
  265. package/node_modules/hono/dist/cjs/middleware/jwt/jwt.js +2 -2
  266. package/node_modules/hono/dist/cjs/middleware/mount/index.js +4 -4
  267. package/node_modules/hono/dist/cjs/middleware/serve-static/index.js +3 -1
  268. package/node_modules/hono/dist/cjs/router/reg-exp-router/node.js +13 -11
  269. package/node_modules/hono/dist/cjs/router/reg-exp-router/prepared-router.js +4 -4
  270. package/node_modules/hono/dist/cjs/router/reg-exp-router/router.js +39 -51
  271. package/node_modules/hono/dist/cjs/router/reg-exp-router/trie.js +15 -5
  272. package/node_modules/hono/dist/cjs/router/trie-router/node.js +2 -2
  273. package/node_modules/hono/dist/cjs/utils/jwt/jwt.js +2 -1
  274. package/node_modules/hono/dist/cjs/utils/mount.js +35 -0
  275. package/node_modules/hono/dist/cjs/utils/url.js +21 -6
  276. package/node_modules/hono/dist/cjs/validator/validator.js +1 -1
  277. package/node_modules/hono/dist/context.js +1 -1
  278. package/node_modules/hono/dist/helper/css/common.js +11 -8
  279. package/node_modules/hono/dist/helper/css/index.js +1 -1
  280. package/node_modules/hono/dist/helper/route/index.js +3 -1
  281. package/node_modules/hono/dist/hono-base.js +4 -10
  282. package/node_modules/hono/dist/hono.js +0 -1
  283. package/node_modules/hono/dist/jsx/base.js +1 -1
  284. package/node_modules/hono/dist/middleware/basic-auth/index.js +1 -1
  285. package/node_modules/hono/dist/middleware/bearer-auth/index.js +9 -1
  286. package/node_modules/hono/dist/middleware/csrf/index.js +2 -2
  287. package/node_modules/hono/dist/middleware/jwk/jwk.js +2 -2
  288. package/node_modules/hono/dist/middleware/jwt/jwt.js +2 -2
  289. package/node_modules/hono/dist/middleware/language/language.js +1 -1
  290. package/node_modules/hono/dist/middleware/mount/index.js +4 -4
  291. package/node_modules/hono/dist/middleware/serve-static/index.js +3 -1
  292. package/node_modules/hono/dist/router/reg-exp-router/node.js +13 -11
  293. package/node_modules/hono/dist/router/reg-exp-router/prepared-router.js +5 -5
  294. package/node_modules/hono/dist/router/reg-exp-router/router.js +40 -52
  295. package/node_modules/hono/dist/router/reg-exp-router/trie.js +15 -5
  296. package/node_modules/hono/dist/router/trie-router/node.js +2 -2
  297. package/node_modules/hono/dist/types/adapter/aws-lambda/conninfo.d.ts +1 -1
  298. package/node_modules/hono/dist/types/adapter/bun/conninfo.d.ts +1 -1
  299. package/node_modules/hono/dist/types/adapter/bun/ssg.d.ts +1 -1
  300. package/node_modules/hono/dist/types/adapter/cloudflare-pages/conninfo.d.ts +1 -1
  301. package/node_modules/hono/dist/types/adapter/cloudflare-workers/conninfo.d.ts +1 -1
  302. package/node_modules/hono/dist/types/adapter/deno/conninfo.d.ts +1 -1
  303. package/node_modules/hono/dist/types/adapter/deno/ssg.d.ts +1 -1
  304. package/node_modules/hono/dist/types/adapter/lambda-edge/conninfo.d.ts +1 -1
  305. package/node_modules/hono/dist/types/adapter/netlify/conninfo.d.ts +1 -1
  306. package/node_modules/hono/dist/types/adapter/vercel/conninfo.d.ts +1 -1
  307. package/node_modules/hono/dist/types/helper/testing/index.d.ts +2 -1
  308. package/node_modules/hono/dist/types/hono-base.d.ts +21 -9
  309. package/node_modules/hono/dist/types/index.d.ts +1 -1
  310. package/node_modules/hono/dist/types/jsx/components.d.ts +2 -2
  311. package/node_modules/hono/dist/types/jsx/context.d.ts +2 -2
  312. package/node_modules/hono/dist/types/jsx/dom/components.d.ts +2 -2
  313. package/node_modules/hono/dist/types/jsx/dom/css.d.ts +2 -2
  314. package/node_modules/hono/dist/types/jsx/streaming.d.ts +4 -3
  315. package/node_modules/hono/dist/types/middleware/bearer-auth/index.d.ts +2 -1
  316. package/node_modules/hono/dist/types/middleware/ip-restriction/index.d.ts +3 -3
  317. package/node_modules/hono/dist/types/middleware/jsx-renderer/index.d.ts +3 -3
  318. package/node_modules/hono/dist/types/middleware/mount/index.d.ts +1 -0
  319. package/node_modules/hono/dist/types/router/reg-exp-router/node.d.ts +3 -3
  320. package/node_modules/hono/dist/types/router/reg-exp-router/trie.d.ts +1 -1
  321. package/node_modules/hono/dist/types/utils/ipaddr.d.ts +1 -1
  322. package/node_modules/hono/dist/types/utils/mount.d.ts +4 -0
  323. package/node_modules/hono/dist/types/utils/url.d.ts +1 -0
  324. package/node_modules/hono/dist/utils/jwt/jwt.js +2 -1
  325. package/node_modules/hono/dist/utils/mount.js +34 -0
  326. package/node_modules/hono/dist/utils/url.js +21 -7
  327. package/node_modules/hono/dist/validator/validator.js +1 -1
  328. package/node_modules/hono/package.json +1 -1
  329. package/node_modules/http-proxy-middleware/dist/handlers/fix-request-body.js +2 -2
  330. package/node_modules/http-proxy-middleware/package.json +1 -1
  331. package/node_modules/ip-address/README.md +39 -39
  332. package/node_modules/ip-address/dist/common.js +2 -2
  333. package/node_modules/ip-address/dist/common.js.map +1 -1
  334. package/node_modules/ip-address/dist/ipv6.js +1 -1
  335. package/node_modules/ip-address/dist/ipv6.js.map +1 -1
  336. package/node_modules/ip-address/package.json +2 -2
  337. package/node_modules/jose/dist/types/jwt/decrypt.d.ts +3 -0
  338. package/node_modules/jose/dist/types/jwt/unsecured.d.ts +2 -0
  339. package/node_modules/jose/dist/types/jwt/verify.d.ts +3 -0
  340. package/node_modules/jose/dist/types/types.d.ts +8 -0
  341. package/node_modules/jose/dist/types/util/decode_jwt.d.ts +1 -0
  342. package/node_modules/jose/dist/webapi/jwks/remote.js +3 -1
  343. package/node_modules/jose/dist/webapi/lib/deflate.js +2 -1
  344. package/node_modules/jose/dist/webapi/lib/jwt_claims_set.js +2 -1
  345. package/node_modules/jose/package.json +1 -1
  346. package/node_modules/postcss/lib/input.js +1 -1
  347. package/node_modules/postcss/lib/lazy-result.js +1 -1
  348. package/node_modules/postcss/lib/no-work-result.js +1 -1
  349. package/node_modules/postcss/lib/node.js +2 -2
  350. package/node_modules/postcss/lib/processor.js +1 -1
  351. package/node_modules/postcss/lib/warning.js +1 -0
  352. package/node_modules/postcss/package.json +1 -1
  353. package/node_modules/qs/CHANGELOG.md +29 -22
  354. package/node_modules/qs/dist/qs.js +14 -14
  355. package/node_modules/qs/eslint.config.mjs +6 -0
  356. package/node_modules/qs/lib/stringify.js +1 -1
  357. package/node_modules/qs/package.json +5 -5
  358. package/node_modules/qs/test/stringify.js +74 -0
  359. package/node_modules/zod/README.md +34 -24
  360. package/node_modules/zod/compile.cjs +96 -0
  361. package/node_modules/zod/compile.d.cts +1 -0
  362. package/node_modules/zod/compile.d.ts +1 -0
  363. package/node_modules/zod/compile.js +52 -0
  364. package/node_modules/zod/index.cjs +22 -3
  365. package/node_modules/zod/index.d.cts +3 -4
  366. package/node_modules/zod/index.d.ts +3 -4
  367. package/node_modules/zod/index.js +7 -4
  368. package/node_modules/zod/locales/index.cjs +36 -0
  369. package/node_modules/zod/locales/index.d.cts +1 -0
  370. package/node_modules/zod/locales/index.d.ts +1 -0
  371. package/node_modules/zod/locales/index.js +1 -0
  372. package/node_modules/zod/locales/package.json +7 -0
  373. package/node_modules/zod/mini/index.cjs +51 -0
  374. package/node_modules/zod/mini/index.d.cts +3 -0
  375. package/node_modules/zod/mini/index.d.ts +3 -0
  376. package/node_modules/zod/mini/index.js +3 -0
  377. package/node_modules/zod/mini/package.json +7 -0
  378. package/node_modules/zod/package.json +44 -15
  379. package/node_modules/zod/src/compile.ts +56 -0
  380. package/node_modules/zod/src/index.ts +7 -4
  381. package/node_modules/zod/src/locales/index.ts +1 -0
  382. package/node_modules/zod/src/mini/index.ts +3 -0
  383. package/node_modules/zod/src/v3/ZodError.ts +23 -13
  384. package/node_modules/zod/src/v3/helpers/errorUtil.ts +1 -1
  385. package/node_modules/zod/src/v3/tests/all-errors.test.ts +3 -3
  386. package/node_modules/zod/src/v3/tests/complex.test.ts +17 -3
  387. package/node_modules/zod/src/v3/tests/error.test.ts +35 -0
  388. package/node_modules/zod/src/v3/tests/function.test.ts +7 -3
  389. package/node_modules/zod/src/v3/tests/intersection.test.ts +18 -0
  390. package/node_modules/zod/src/v3/tests/language-server.test.ts +1 -2
  391. package/node_modules/zod/src/v3/tests/nan.test.ts +5 -2
  392. package/node_modules/zod/src/v3/tests/object.test.ts +10 -13
  393. package/node_modules/zod/src/v3/tests/partials.test.ts +3 -3
  394. package/node_modules/zod/src/v3/tests/readonly.test.ts +0 -80
  395. package/node_modules/zod/src/v3/tests/string.test.ts +8 -2
  396. package/node_modules/zod/src/v3/types.ts +8 -6
  397. package/node_modules/zod/src/v4/classic/checks.ts +3 -0
  398. package/node_modules/zod/src/v4/classic/compat.ts +30 -18
  399. package/node_modules/zod/src/v4/classic/deep-partial.ts +76 -0
  400. package/node_modules/zod/src/v4/classic/errors.ts +61 -39
  401. package/node_modules/zod/src/v4/classic/external.ts +18 -11
  402. package/node_modules/zod/src/v4/classic/from-json-schema.ts +944 -0
  403. package/node_modules/zod/src/v4/classic/in-out.ts +45 -0
  404. package/node_modules/zod/src/v4/classic/index.ts +2 -2
  405. package/node_modules/zod/src/v4/classic/iso.ts +2 -72
  406. package/node_modules/zod/src/v4/classic/parse.ts +57 -2
  407. package/node_modules/zod/src/v4/classic/schemas.ts +1258 -375
  408. package/node_modules/zod/src/v4/classic/tests/apply.test.ts +86 -0
  409. package/node_modules/zod/src/v4/classic/tests/array.test.ts +35 -8
  410. package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +192 -0
  411. package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +36 -1
  412. package/node_modules/zod/src/v4/classic/tests/brand.test.ts +43 -0
  413. package/node_modules/zod/src/v4/classic/tests/catch.test.ts +357 -5
  414. package/node_modules/zod/src/v4/classic/tests/codec-examples.test.ts +572 -0
  415. package/node_modules/zod/src/v4/classic/tests/codec.test.ts +704 -0
  416. package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +27 -5
  417. package/node_modules/zod/src/v4/classic/tests/credit-card.test.ts +76 -0
  418. package/node_modules/zod/src/v4/classic/tests/cyclic-data.test.ts +985 -0
  419. package/node_modules/zod/src/v4/classic/tests/date.test.ts +67 -6
  420. package/node_modules/zod/src/v4/classic/tests/datetime.test.ts +37 -17
  421. package/node_modules/zod/src/v4/classic/tests/deep-partial.test.ts +380 -0
  422. package/node_modules/zod/src/v4/classic/tests/default-locale.test.ts +32 -0
  423. package/node_modules/zod/src/v4/classic/tests/default.test.ts +142 -0
  424. package/node_modules/zod/src/v4/classic/tests/describe-meta-checks.test.ts +27 -0
  425. package/node_modules/zod/src/v4/classic/tests/detached-methods.test.ts +221 -0
  426. package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +333 -10
  427. package/node_modules/zod/src/v4/classic/tests/enum.test.ts +20 -0
  428. package/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +394 -4
  429. package/node_modules/zod/src/v4/classic/tests/error.test.ts +403 -6
  430. package/node_modules/zod/src/v4/classic/tests/file.test.ts +9 -4
  431. package/node_modules/zod/src/v4/classic/tests/firstparty.test.ts +4 -0
  432. package/node_modules/zod/src/v4/classic/tests/fix-json-issue.test.ts +26 -0
  433. package/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +1467 -0
  434. package/node_modules/zod/src/v4/classic/tests/function.test.ts +160 -37
  435. package/node_modules/zod/src/v4/classic/tests/global-config.test.ts +32 -0
  436. package/node_modules/zod/src/v4/classic/tests/hash.test.ts +67 -0
  437. package/node_modules/zod/src/v4/classic/tests/iban.test.ts +81 -0
  438. package/node_modules/zod/src/v4/classic/tests/in-out.test.ts +159 -0
  439. package/node_modules/zod/src/v4/classic/tests/index.test.ts +134 -5
  440. package/node_modules/zod/src/v4/classic/tests/instance-footprint.test.ts +319 -0
  441. package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +93 -0
  442. package/node_modules/zod/src/v4/classic/tests/intersection.test.ts +168 -5
  443. package/node_modules/zod/src/v4/classic/tests/issue-schema.test.ts +215 -0
  444. package/node_modules/zod/src/v4/classic/tests/jitless-allows-eval.test.ts +39 -0
  445. package/node_modules/zod/src/v4/classic/tests/json.test.ts +4 -3
  446. package/node_modules/zod/src/v4/classic/tests/lazy.test.ts +36 -1
  447. package/node_modules/zod/src/v4/classic/tests/literal.test.ts +37 -1
  448. package/node_modules/zod/src/v4/classic/tests/locales_ka.test.ts +29 -0
  449. package/node_modules/zod/src/v4/classic/tests/locales_ro.test.ts +24 -0
  450. package/node_modules/zod/src/v4/classic/tests/map.test.ts +153 -0
  451. package/node_modules/zod/src/v4/classic/tests/nonoptional.test.ts +15 -0
  452. package/node_modules/zod/src/v4/classic/tests/number.test.ts +161 -7
  453. package/node_modules/zod/src/v4/classic/tests/object.test.ts +457 -14
  454. package/node_modules/zod/src/v4/classic/tests/optin-ladder.test.ts +235 -0
  455. package/node_modules/zod/src/v4/classic/tests/optional.test.ts +255 -12
  456. package/node_modules/zod/src/v4/classic/tests/partial.test.ts +350 -0
  457. package/node_modules/zod/src/v4/classic/tests/pickomit.test.ts +89 -5
  458. package/node_modules/zod/src/v4/classic/tests/pipe.test.ts +25 -5
  459. package/node_modules/zod/src/v4/classic/tests/prefault.test.ts +107 -0
  460. package/node_modules/zod/src/v4/classic/tests/preprocess-types.test.ts +44 -0
  461. package/node_modules/zod/src/v4/classic/tests/preprocess.test.ts +74 -21
  462. package/node_modules/zod/src/v4/classic/tests/promise.test.ts +1 -1
  463. package/node_modules/zod/src/v4/classic/tests/properties.test.ts +141 -0
  464. package/node_modules/zod/src/v4/classic/tests/readonly.test.ts +1 -69
  465. package/node_modules/zod/src/v4/classic/tests/record.test.ts +553 -10
  466. package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +352 -1
  467. package/node_modules/zod/src/v4/classic/tests/redos.test.ts +68 -0
  468. package/node_modules/zod/src/v4/classic/tests/refine.test.ts +229 -68
  469. package/node_modules/zod/src/v4/classic/tests/registries.test.ts +40 -1
  470. package/node_modules/zod/src/v4/classic/tests/set.test.ts +20 -3
  471. package/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +96 -0
  472. package/node_modules/zod/src/v4/classic/tests/string-formats.test.ts +16 -0
  473. package/node_modules/zod/src/v4/classic/tests/string.test.ts +568 -9
  474. package/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +58 -0
  475. package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +70 -16
  476. package/node_modules/zod/src/v4/classic/tests/to-json-schema-methods.test.ts +438 -0
  477. package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +3409 -990
  478. package/node_modules/zod/src/v4/classic/tests/transform.test.ts +128 -0
  479. package/node_modules/zod/src/v4/classic/tests/tuple.test.ts +353 -5
  480. package/node_modules/zod/src/v4/classic/tests/union.test.ts +219 -3
  481. package/node_modules/zod/src/v4/classic/tests/url.test.ts +13 -0
  482. package/node_modules/zod/src/v4/classic/tests/validate.test.ts +645 -0
  483. package/node_modules/zod/src/v4/classic/tests/validations.test.ts +2 -2
  484. package/node_modules/zod/src/v4/core/api.ts +442 -161
  485. package/node_modules/zod/src/v4/core/checks.ts +134 -151
  486. package/node_modules/zod/src/v4/core/compile.ts +2322 -0
  487. package/node_modules/zod/src/v4/core/core.ts +146 -50
  488. package/node_modules/zod/src/v4/core/doc.ts +18 -10
  489. package/node_modules/zod/src/v4/core/errors.ts +221 -102
  490. package/node_modules/zod/src/v4/core/index.ts +5 -1
  491. package/node_modules/zod/src/v4/core/json-schema-generator.ts +131 -0
  492. package/node_modules/zod/src/v4/core/json-schema-processors.ts +934 -0
  493. package/node_modules/zod/src/v4/core/json-schema.ts +9 -4
  494. package/node_modules/zod/src/v4/core/memoizer.ts +331 -0
  495. package/node_modules/zod/src/v4/core/parse.ts +252 -37
  496. package/node_modules/zod/src/v4/core/regexes.ts +112 -30
  497. package/node_modules/zod/src/v4/core/registries.ts +19 -10
  498. package/node_modules/zod/src/v4/core/schemas.ts +1972 -588
  499. package/node_modules/zod/src/v4/core/standard-schema.ts +114 -19
  500. package/node_modules/zod/src/v4/core/tests/cached.test.ts +54 -0
  501. package/node_modules/zod/src/v4/core/tests/compile-differential.test.ts +1004 -0
  502. package/node_modules/zod/src/v4/core/tests/compile-generative.test.ts +445 -0
  503. package/node_modules/zod/src/v4/core/tests/compile-global.test.ts +89 -0
  504. package/node_modules/zod/src/v4/core/tests/compile-off-by-default.test.ts +26 -0
  505. package/node_modules/zod/src/v4/core/tests/compile-stats.test.ts +34 -0
  506. package/node_modules/zod/src/v4/core/tests/compile.test.ts +2036 -0
  507. package/node_modules/zod/src/v4/core/tests/email-regex.test.ts +140 -0
  508. package/node_modules/zod/src/v4/core/tests/extend.test.ts +59 -0
  509. package/node_modules/zod/src/v4/core/tests/locales/el.test.ts +214 -0
  510. package/node_modules/zod/src/v4/core/tests/locales/en.test.ts +1 -1
  511. package/node_modules/zod/src/v4/core/tests/locales/es.test.ts +180 -0
  512. package/node_modules/zod/src/v4/core/tests/locales/fr.test.ts +72 -0
  513. package/node_modules/zod/src/v4/core/tests/locales/he.test.ts +379 -0
  514. package/node_modules/zod/src/v4/core/tests/locales/hr.test.ts +163 -0
  515. package/node_modules/zod/src/v4/core/tests/locales/nl.test.ts +46 -0
  516. package/node_modules/zod/src/v4/core/tests/locales/parity.test.ts +42 -0
  517. package/node_modules/zod/src/v4/core/tests/locales/tg.test.ts +85 -0
  518. package/node_modules/zod/src/v4/core/tests/locales/tk.test.ts +69 -0
  519. package/node_modules/zod/src/v4/core/tests/locales/tr.test.ts +2 -2
  520. package/node_modules/zod/src/v4/core/tests/locales/uz.test.ts +105 -0
  521. package/node_modules/zod/src/v4/core/tests/polyfill-collision.test.ts +46 -0
  522. package/node_modules/zod/src/v4/core/tests/record-constructor.test.ts +125 -0
  523. package/node_modules/zod/src/v4/core/tests/recursive-tuples.test.ts +45 -0
  524. package/node_modules/zod/src/v4/core/tests/treeshake.test.ts +51 -0
  525. package/node_modules/zod/src/v4/core/tests/url-no-canparse.test.ts +133 -0
  526. package/node_modules/zod/src/v4/core/to-json-schema.ts +706 -826
  527. package/node_modules/zod/src/v4/core/util.ts +675 -157
  528. package/node_modules/zod/src/v4/core/versions.ts +2 -2
  529. package/node_modules/zod/src/v4/core/visit.ts +193 -0
  530. package/node_modules/zod/src/v4/index.ts +3 -3
  531. package/node_modules/zod/src/v4/locales/ar.ts +22 -27
  532. package/node_modules/zod/src/v4/locales/az.ts +22 -27
  533. package/node_modules/zod/src/v4/locales/be.ts +31 -27
  534. package/node_modules/zod/src/v4/locales/bg.ts +133 -0
  535. package/node_modules/zod/src/v4/locales/bn.ts +123 -0
  536. package/node_modules/zod/src/v4/locales/ca.ts +22 -28
  537. package/node_modules/zod/src/v4/locales/ckb.ts +140 -0
  538. package/node_modules/zod/src/v4/locales/cs.ts +26 -45
  539. package/node_modules/zod/src/v4/locales/da.ts +128 -0
  540. package/node_modules/zod/src/v4/locales/de.ts +24 -27
  541. package/node_modules/zod/src/v4/locales/el.ts +124 -0
  542. package/node_modules/zod/src/v4/locales/en.ts +38 -29
  543. package/node_modules/zod/src/v4/locales/eo.ts +25 -27
  544. package/node_modules/zod/src/v4/locales/es.ts +53 -33
  545. package/node_modules/zod/src/v4/locales/fa.ts +24 -27
  546. package/node_modules/zod/src/v4/locales/fi.ts +22 -27
  547. package/node_modules/zod/src/v4/locales/fr-CA.ts +22 -27
  548. package/node_modules/zod/src/v4/locales/fr.ts +58 -43
  549. package/node_modules/zod/src/v4/locales/gu.ts +123 -0
  550. package/node_modules/zod/src/v4/locales/he.ts +208 -80
  551. package/node_modules/zod/src/v4/locales/hi.ts +126 -0
  552. package/node_modules/zod/src/v4/locales/hr.ts +135 -0
  553. package/node_modules/zod/src/v4/locales/hu.ts +24 -28
  554. package/node_modules/zod/src/v4/locales/hy.ts +175 -0
  555. package/node_modules/zod/src/v4/locales/id.ts +22 -27
  556. package/node_modules/zod/src/v4/locales/index.ts +24 -0
  557. package/node_modules/zod/src/v4/locales/is.ts +124 -0
  558. package/node_modules/zod/src/v4/locales/it.ts +24 -28
  559. package/node_modules/zod/src/v4/locales/ja.ts +24 -27
  560. package/node_modules/zod/src/v4/locales/ka.ts +128 -0
  561. package/node_modules/zod/src/v4/locales/kh.ts +3 -122
  562. package/node_modules/zod/src/v4/locales/km.ts +124 -0
  563. package/node_modules/zod/src/v4/locales/kn.ts +126 -0
  564. package/node_modules/zod/src/v4/locales/ko.ts +22 -27
  565. package/node_modules/zod/src/v4/locales/lt.ts +243 -0
  566. package/node_modules/zod/src/v4/locales/mk.ts +24 -28
  567. package/node_modules/zod/src/v4/locales/ms.ts +23 -27
  568. package/node_modules/zod/src/v4/locales/ne.ts +128 -0
  569. package/node_modules/zod/src/v4/locales/nl.ts +37 -37
  570. package/node_modules/zod/src/v4/locales/nn.ts +121 -0
  571. package/node_modules/zod/src/v4/locales/no.ts +26 -29
  572. package/node_modules/zod/src/v4/locales/ota.ts +25 -28
  573. package/node_modules/zod/src/v4/locales/pl.ts +24 -27
  574. package/node_modules/zod/src/v4/locales/ps.ts +24 -26
  575. package/node_modules/zod/src/v4/locales/pt-BR.ts +161 -0
  576. package/node_modules/zod/src/v4/locales/pt.ts +107 -71
  577. package/node_modules/zod/src/v4/locales/ro.ts +132 -0
  578. package/node_modules/zod/src/v4/locales/ru.ts +31 -27
  579. package/node_modules/zod/src/v4/locales/sk.ts +123 -0
  580. package/node_modules/zod/src/v4/locales/sl.ts +24 -27
  581. package/node_modules/zod/src/v4/locales/sv.ts +26 -29
  582. package/node_modules/zod/src/v4/locales/ta.ts +25 -27
  583. package/node_modules/zod/src/v4/locales/tg.ts +135 -0
  584. package/node_modules/zod/src/v4/locales/th.ts +25 -27
  585. package/node_modules/zod/src/v4/locales/tk.ts +113 -0
  586. package/node_modules/zod/src/v4/locales/tr.ts +22 -27
  587. package/node_modules/zod/src/v4/locales/ua.ts +3 -122
  588. package/node_modules/zod/src/v4/locales/uk.ts +122 -0
  589. package/node_modules/zod/src/v4/locales/ur.ts +25 -27
  590. package/node_modules/zod/src/v4/locales/uz.ts +120 -0
  591. package/node_modules/zod/src/v4/locales/vi.ts +24 -27
  592. package/node_modules/zod/src/v4/locales/yo.ts +129 -0
  593. package/node_modules/zod/src/v4/locales/zh-CN.ts +25 -27
  594. package/node_modules/zod/src/v4/locales/zh-TW.ts +22 -27
  595. package/node_modules/zod/src/v4/mini/checks.ts +1 -0
  596. package/node_modules/zod/src/v4/mini/coerce.ts +5 -0
  597. package/node_modules/zod/src/v4/mini/deep-partial.ts +73 -0
  598. package/node_modules/zod/src/v4/mini/external.ts +15 -3
  599. package/node_modules/zod/src/v4/mini/in-out.ts +45 -0
  600. package/node_modules/zod/src/v4/mini/iso.ts +8 -4
  601. package/node_modules/zod/src/v4/mini/parse.ts +16 -1
  602. package/node_modules/zod/src/v4/mini/schemas.ts +586 -114
  603. package/node_modules/zod/src/v4/mini/tests/apply.test.ts +57 -0
  604. package/node_modules/zod/src/v4/mini/tests/assignability.test.ts +63 -2
  605. package/node_modules/zod/src/v4/mini/tests/brand.test.ts +43 -0
  606. package/node_modules/zod/src/v4/mini/tests/checks.test.ts +14 -0
  607. package/node_modules/zod/src/v4/mini/tests/codec.test.ts +582 -0
  608. package/node_modules/zod/src/v4/mini/tests/computed.test.ts +12 -18
  609. package/node_modules/zod/src/v4/mini/tests/cyclic-data.test.ts +84 -0
  610. package/node_modules/zod/src/v4/mini/tests/deep-partial.test.ts +54 -0
  611. package/node_modules/zod/src/v4/mini/tests/error.test.ts +24 -5
  612. package/node_modules/zod/src/v4/mini/tests/functions.test.ts +7 -36
  613. package/node_modules/zod/src/v4/mini/tests/index.test.ts +281 -6
  614. package/node_modules/zod/src/v4/mini/tests/number.test.ts +15 -1
  615. package/node_modules/zod/src/v4/mini/tests/object.test.ts +116 -9
  616. package/node_modules/zod/src/v4/mini/tests/prototypes.test.ts +1 -1
  617. package/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +68 -2
  618. package/node_modules/zod/src/v4/mini/tests/standard-schema.test.ts +50 -0
  619. package/node_modules/zod/src/v4/mini/tests/string.test.ts +98 -1
  620. package/node_modules/zod/src/v4-mini/index.ts +3 -1
  621. package/node_modules/zod/v3/ZodError.cjs +42 -13
  622. package/node_modules/zod/v3/ZodError.d.cts +6 -6
  623. package/node_modules/zod/v3/ZodError.d.ts +6 -6
  624. package/node_modules/zod/v3/ZodError.js +23 -13
  625. package/node_modules/zod/v3/errors.cjs +19 -0
  626. package/node_modules/zod/v3/external.cjs +19 -0
  627. package/node_modules/zod/v3/helpers/enumUtil.cjs +19 -0
  628. package/node_modules/zod/v3/helpers/errorUtil.cjs +20 -1
  629. package/node_modules/zod/v3/helpers/errorUtil.js +1 -1
  630. package/node_modules/zod/v3/helpers/parseUtil.cjs +19 -0
  631. package/node_modules/zod/v3/helpers/partialUtil.cjs +19 -0
  632. package/node_modules/zod/v3/helpers/typeAliases.cjs +19 -0
  633. package/node_modules/zod/v3/helpers/util.cjs +19 -0
  634. package/node_modules/zod/v3/index.cjs +19 -0
  635. package/node_modules/zod/v3/locales/en.cjs +1 -0
  636. package/node_modules/zod/v3/locales/en.d.cts +1 -1
  637. package/node_modules/zod/v3/package.json +7 -0
  638. package/node_modules/zod/v3/standard-schema.cjs +19 -0
  639. package/node_modules/zod/v3/types.cjs +28 -5
  640. package/node_modules/zod/v3/types.d.cts +4 -1
  641. package/node_modules/zod/v3/types.d.ts +4 -1
  642. package/node_modules/zod/v3/types.js +9 -5
  643. package/node_modules/zod/v4/classic/checks.cjs +22 -1
  644. package/node_modules/zod/v4/classic/checks.d.cts +1 -1
  645. package/node_modules/zod/v4/classic/checks.d.ts +1 -1
  646. package/node_modules/zod/v4/classic/checks.js +1 -1
  647. package/node_modules/zod/v4/classic/coerce.cjs +19 -0
  648. package/node_modules/zod/v4/classic/compat.cjs +24 -1
  649. package/node_modules/zod/v4/classic/compat.d.cts +13 -11
  650. package/node_modules/zod/v4/classic/compat.d.ts +13 -11
  651. package/node_modules/zod/v4/classic/compat.js +4 -0
  652. package/node_modules/zod/v4/classic/deep-partial.cjs +58 -0
  653. package/node_modules/zod/v4/classic/deep-partial.d.cts +14 -0
  654. package/node_modules/zod/v4/classic/deep-partial.d.ts +14 -0
  655. package/node_modules/zod/v4/classic/deep-partial.js +13 -0
  656. package/node_modules/zod/v4/classic/errors.cjs +63 -28
  657. package/node_modules/zod/v4/classic/errors.d.cts +3 -4
  658. package/node_modules/zod/v4/classic/errors.d.ts +3 -4
  659. package/node_modules/zod/v4/classic/errors.js +45 -29
  660. package/node_modules/zod/v4/classic/external.cjs +55 -28
  661. package/node_modules/zod/v4/classic/external.d.cts +8 -2
  662. package/node_modules/zod/v4/classic/external.d.ts +8 -2
  663. package/node_modules/zod/v4/classic/external.js +7 -8
  664. package/node_modules/zod/v4/classic/from-json-schema.cjs +926 -0
  665. package/node_modules/zod/v4/classic/from-json-schema.d.cts +12 -0
  666. package/node_modules/zod/v4/classic/from-json-schema.d.ts +12 -0
  667. package/node_modules/zod/v4/classic/from-json-schema.js +881 -0
  668. package/node_modules/zod/v4/classic/in-out.cjs +82 -0
  669. package/node_modules/zod/v4/classic/in-out.d.cts +8 -0
  670. package/node_modules/zod/v4/classic/in-out.d.ts +8 -0
  671. package/node_modules/zod/v4/classic/in-out.js +36 -0
  672. package/node_modules/zod/v4/classic/index.cjs +21 -2
  673. package/node_modules/zod/v4/classic/index.d.cts +1 -2
  674. package/node_modules/zod/v4/classic/index.d.ts +1 -2
  675. package/node_modules/zod/v4/classic/index.js +2 -2
  676. package/node_modules/zod/v4/classic/iso.cjs +30 -22
  677. package/node_modules/zod/v4/classic/iso.d.cts +2 -17
  678. package/node_modules/zod/v4/classic/iso.d.ts +2 -17
  679. package/node_modules/zod/v4/classic/iso.js +2 -17
  680. package/node_modules/zod/v4/classic/package.json +7 -0
  681. package/node_modules/zod/v4/classic/parse.cjs +32 -1
  682. package/node_modules/zod/v4/classic/parse.d.cts +21 -0
  683. package/node_modules/zod/v4/classic/parse.d.ts +21 -0
  684. package/node_modules/zod/v4/classic/parse.js +10 -0
  685. package/node_modules/zod/v4/classic/schemas.cjs +805 -238
  686. package/node_modules/zod/v4/classic/schemas.d.cts +241 -55
  687. package/node_modules/zod/v4/classic/schemas.d.ts +241 -55
  688. package/node_modules/zod/v4/classic/schemas.js +766 -237
  689. package/node_modules/zod/v4/core/api.cjs +284 -54
  690. package/node_modules/zod/v4/core/api.d.cts +133 -82
  691. package/node_modules/zod/v4/core/api.d.ts +133 -82
  692. package/node_modules/zod/v4/core/api.js +255 -54
  693. package/node_modules/zod/v4/core/checks.cjs +100 -130
  694. package/node_modules/zod/v4/core/checks.d.cts +32 -16
  695. package/node_modules/zod/v4/core/checks.d.ts +32 -16
  696. package/node_modules/zod/v4/core/checks.js +80 -129
  697. package/node_modules/zod/v4/core/compile.cjs +1916 -0
  698. package/node_modules/zod/v4/core/compile.d.cts +65 -0
  699. package/node_modules/zod/v4/core/compile.d.ts +65 -0
  700. package/node_modules/zod/v4/core/compile.js +1866 -0
  701. package/node_modules/zod/v4/core/core.cjs +120 -20
  702. package/node_modules/zod/v4/core/core.d.cts +40 -7
  703. package/node_modules/zod/v4/core/core.d.ts +40 -7
  704. package/node_modules/zod/v4/core/core.js +101 -21
  705. package/node_modules/zod/v4/core/doc.cjs +31 -9
  706. package/node_modules/zod/v4/core/doc.d.cts +4 -2
  707. package/node_modules/zod/v4/core/doc.d.ts +4 -2
  708. package/node_modules/zod/v4/core/doc.js +12 -9
  709. package/node_modules/zod/v4/core/errors.cjs +151 -60
  710. package/node_modules/zod/v4/core/errors.d.cts +41 -24
  711. package/node_modules/zod/v4/core/errors.d.ts +41 -24
  712. package/node_modules/zod/v4/core/errors.js +132 -60
  713. package/node_modules/zod/v4/core/index.cjs +28 -2
  714. package/node_modules/zod/v4/core/index.d.cts +5 -1
  715. package/node_modules/zod/v4/core/index.d.ts +5 -1
  716. package/node_modules/zod/v4/core/index.js +5 -1
  717. package/node_modules/zod/v4/core/json-schema-generator.cjs +122 -0
  718. package/node_modules/zod/v4/core/json-schema-generator.d.cts +65 -0
  719. package/node_modules/zod/v4/core/json-schema-generator.d.ts +65 -0
  720. package/node_modules/zod/v4/core/json-schema-generator.js +99 -0
  721. package/node_modules/zod/v4/core/json-schema-processors.cjs +929 -0
  722. package/node_modules/zod/v4/core/json-schema-processors.d.cts +65 -0
  723. package/node_modules/zod/v4/core/json-schema-processors.d.ts +65 -0
  724. package/node_modules/zod/v4/core/json-schema-processors.js +843 -0
  725. package/node_modules/zod/v4/core/json-schema.cjs +19 -0
  726. package/node_modules/zod/v4/core/json-schema.d.cts +6 -4
  727. package/node_modules/zod/v4/core/json-schema.d.ts +6 -4
  728. package/node_modules/zod/v4/core/memoizer.cjs +360 -0
  729. package/node_modules/zod/v4/core/memoizer.d.cts +15 -0
  730. package/node_modules/zod/v4/core/memoizer.d.ts +15 -0
  731. package/node_modules/zod/v4/core/memoizer.js +311 -0
  732. package/node_modules/zod/v4/core/package.json +7 -0
  733. package/node_modules/zod/v4/core/parse.cjs +183 -37
  734. package/node_modules/zod/v4/core/parse.d.cts +34 -7
  735. package/node_modules/zod/v4/core/parse.d.ts +34 -7
  736. package/node_modules/zod/v4/core/parse.js +154 -36
  737. package/node_modules/zod/v4/core/regexes.cjs +137 -31
  738. package/node_modules/zod/v4/core/regexes.d.cts +30 -2
  739. package/node_modules/zod/v4/core/regexes.d.ts +30 -2
  740. package/node_modules/zod/v4/core/regexes.js +90 -29
  741. package/node_modules/zod/v4/core/registries.cjs +26 -7
  742. package/node_modules/zod/v4/core/registries.d.cts +2 -2
  743. package/node_modules/zod/v4/core/registries.d.ts +2 -2
  744. package/node_modules/zod/v4/core/registries.js +9 -9
  745. package/node_modules/zod/v4/core/schemas.cjs +1373 -422
  746. package/node_modules/zod/v4/core/schemas.d.cts +276 -42
  747. package/node_modules/zod/v4/core/schemas.d.ts +276 -42
  748. package/node_modules/zod/v4/core/schemas.js +1341 -422
  749. package/node_modules/zod/v4/core/standard-schema.cjs +19 -0
  750. package/node_modules/zod/v4/core/standard-schema.d.cts +90 -19
  751. package/node_modules/zod/v4/core/standard-schema.d.ts +90 -19
  752. package/node_modules/zod/v4/core/to-json-schema.cjs +628 -801
  753. package/node_modules/zod/v4/core/to-json-schema.d.cts +103 -37
  754. package/node_modules/zod/v4/core/to-json-schema.d.ts +103 -37
  755. package/node_modules/zod/v4/core/to-json-schema.js +602 -800
  756. package/node_modules/zod/v4/core/util.cjs +580 -155
  757. package/node_modules/zod/v4/core/util.d.cts +98 -1
  758. package/node_modules/zod/v4/core/util.d.ts +98 -1
  759. package/node_modules/zod/v4/core/util.js +536 -156
  760. package/node_modules/zod/v4/core/versions.cjs +21 -2
  761. package/node_modules/zod/v4/core/versions.d.cts +1 -1
  762. package/node_modules/zod/v4/core/versions.d.ts +1 -1
  763. package/node_modules/zod/v4/core/versions.js +2 -2
  764. package/node_modules/zod/v4/core/visit.cjs +214 -0
  765. package/node_modules/zod/v4/core/visit.d.cts +30 -0
  766. package/node_modules/zod/v4/core/visit.d.ts +30 -0
  767. package/node_modules/zod/v4/core/visit.js +169 -0
  768. package/node_modules/zod/v4/index.cjs +34 -5
  769. package/node_modules/zod/v4/index.d.cts +2 -2
  770. package/node_modules/zod/v4/index.d.ts +2 -2
  771. package/node_modules/zod/v4/index.js +3 -2
  772. package/node_modules/zod/v4/locales/ar.cjs +20 -24
  773. package/node_modules/zod/v4/locales/ar.d.cts +2 -1
  774. package/node_modules/zod/v4/locales/ar.js +19 -24
  775. package/node_modules/zod/v4/locales/az.cjs +20 -24
  776. package/node_modules/zod/v4/locales/az.d.cts +2 -1
  777. package/node_modules/zod/v4/locales/az.js +19 -24
  778. package/node_modules/zod/v4/locales/be.cjs +29 -24
  779. package/node_modules/zod/v4/locales/be.d.cts +2 -1
  780. package/node_modules/zod/v4/locales/be.js +28 -24
  781. package/node_modules/zod/v4/locales/bg.cjs +152 -0
  782. package/node_modules/zod/v4/locales/bg.d.cts +5 -0
  783. package/node_modules/zod/v4/locales/bg.d.ts +4 -0
  784. package/node_modules/zod/v4/locales/bg.js +125 -0
  785. package/node_modules/zod/v4/locales/bn.cjs +140 -0
  786. package/node_modules/zod/v4/locales/bn.d.cts +5 -0
  787. package/node_modules/zod/v4/locales/bn.d.ts +4 -0
  788. package/node_modules/zod/v4/locales/bn.js +113 -0
  789. package/node_modules/zod/v4/locales/ca.cjs +20 -25
  790. package/node_modules/zod/v4/locales/ca.d.cts +2 -1
  791. package/node_modules/zod/v4/locales/ca.js +19 -25
  792. package/node_modules/zod/v4/locales/ckb.cjs +160 -0
  793. package/node_modules/zod/v4/locales/ckb.d.cts +5 -0
  794. package/node_modules/zod/v4/locales/ckb.d.ts +4 -0
  795. package/node_modules/zod/v4/locales/ckb.js +133 -0
  796. package/node_modules/zod/v4/locales/cs.cjs +24 -42
  797. package/node_modules/zod/v4/locales/cs.d.cts +2 -1
  798. package/node_modules/zod/v4/locales/cs.js +23 -42
  799. package/node_modules/zod/v4/locales/da.cjs +147 -0
  800. package/node_modules/zod/v4/locales/da.d.cts +5 -0
  801. package/node_modules/zod/v4/locales/da.d.ts +4 -0
  802. package/node_modules/zod/v4/locales/da.js +120 -0
  803. package/node_modules/zod/v4/locales/de.cjs +22 -24
  804. package/node_modules/zod/v4/locales/de.d.cts +2 -1
  805. package/node_modules/zod/v4/locales/de.js +21 -24
  806. package/node_modules/zod/v4/locales/el.cjs +139 -0
  807. package/node_modules/zod/v4/locales/el.d.cts +5 -0
  808. package/node_modules/zod/v4/locales/el.d.ts +4 -0
  809. package/node_modules/zod/v4/locales/el.js +112 -0
  810. package/node_modules/zod/v4/locales/en.cjs +35 -28
  811. package/node_modules/zod/v4/locales/en.d.cts +2 -2
  812. package/node_modules/zod/v4/locales/en.d.ts +0 -1
  813. package/node_modules/zod/v4/locales/en.js +34 -26
  814. package/node_modules/zod/v4/locales/eo.cjs +23 -26
  815. package/node_modules/zod/v4/locales/eo.d.cts +2 -2
  816. package/node_modules/zod/v4/locales/eo.d.ts +0 -1
  817. package/node_modules/zod/v4/locales/eo.js +22 -24
  818. package/node_modules/zod/v4/locales/es.cjs +51 -31
  819. package/node_modules/zod/v4/locales/es.d.cts +2 -1
  820. package/node_modules/zod/v4/locales/es.js +50 -31
  821. package/node_modules/zod/v4/locales/fa.cjs +22 -24
  822. package/node_modules/zod/v4/locales/fa.d.cts +2 -1
  823. package/node_modules/zod/v4/locales/fa.js +21 -24
  824. package/node_modules/zod/v4/locales/fi.cjs +20 -24
  825. package/node_modules/zod/v4/locales/fi.d.cts +2 -1
  826. package/node_modules/zod/v4/locales/fi.js +19 -24
  827. package/node_modules/zod/v4/locales/fr-CA.cjs +20 -24
  828. package/node_modules/zod/v4/locales/fr-CA.d.cts +2 -1
  829. package/node_modules/zod/v4/locales/fr-CA.js +19 -24
  830. package/node_modules/zod/v4/locales/fr.cjs +53 -39
  831. package/node_modules/zod/v4/locales/fr.d.cts +2 -1
  832. package/node_modules/zod/v4/locales/fr.js +52 -39
  833. package/node_modules/zod/v4/locales/gu.cjs +140 -0
  834. package/node_modules/zod/v4/locales/gu.d.cts +5 -0
  835. package/node_modules/zod/v4/locales/gu.d.ts +4 -0
  836. package/node_modules/zod/v4/locales/gu.js +113 -0
  837. package/node_modules/zod/v4/locales/he.cjs +183 -78
  838. package/node_modules/zod/v4/locales/he.d.cts +2 -1
  839. package/node_modules/zod/v4/locales/he.js +182 -78
  840. package/node_modules/zod/v4/locales/hi.cjs +138 -0
  841. package/node_modules/zod/v4/locales/hi.d.cts +5 -0
  842. package/node_modules/zod/v4/locales/hi.d.ts +4 -0
  843. package/node_modules/zod/v4/locales/hi.js +111 -0
  844. package/node_modules/zod/v4/locales/hr.cjs +153 -0
  845. package/node_modules/zod/v4/locales/hr.d.cts +5 -0
  846. package/node_modules/zod/v4/locales/hr.d.ts +4 -0
  847. package/node_modules/zod/v4/locales/hr.js +126 -0
  848. package/node_modules/zod/v4/locales/hu.cjs +22 -25
  849. package/node_modules/zod/v4/locales/hu.d.cts +2 -1
  850. package/node_modules/zod/v4/locales/hu.js +21 -25
  851. package/node_modules/zod/v4/locales/hy.cjs +185 -0
  852. package/node_modules/zod/v4/locales/hy.d.cts +5 -0
  853. package/node_modules/zod/v4/locales/hy.d.ts +4 -0
  854. package/node_modules/zod/v4/locales/hy.js +158 -0
  855. package/node_modules/zod/v4/locales/id.cjs +20 -24
  856. package/node_modules/zod/v4/locales/id.d.cts +2 -1
  857. package/node_modules/zod/v4/locales/id.js +19 -24
  858. package/node_modules/zod/v4/locales/index.cjs +69 -1
  859. package/node_modules/zod/v4/locales/index.d.cts +24 -0
  860. package/node_modules/zod/v4/locales/index.d.ts +24 -0
  861. package/node_modules/zod/v4/locales/index.js +24 -0
  862. package/node_modules/zod/v4/locales/is.cjs +141 -0
  863. package/node_modules/zod/v4/locales/is.d.cts +5 -0
  864. package/node_modules/zod/v4/locales/is.d.ts +4 -0
  865. package/node_modules/zod/v4/locales/is.js +114 -0
  866. package/node_modules/zod/v4/locales/it.cjs +22 -25
  867. package/node_modules/zod/v4/locales/it.d.cts +2 -1
  868. package/node_modules/zod/v4/locales/it.js +21 -25
  869. package/node_modules/zod/v4/locales/ja.cjs +22 -24
  870. package/node_modules/zod/v4/locales/ja.d.cts +2 -1
  871. package/node_modules/zod/v4/locales/ja.js +21 -24
  872. package/node_modules/zod/v4/locales/ka.cjs +144 -0
  873. package/node_modules/zod/v4/locales/ka.d.cts +5 -0
  874. package/node_modules/zod/v4/locales/ka.d.ts +4 -0
  875. package/node_modules/zod/v4/locales/ka.js +117 -0
  876. package/node_modules/zod/v4/locales/kh.cjs +6 -137
  877. package/node_modules/zod/v4/locales/kh.d.cts +2 -1
  878. package/node_modules/zod/v4/locales/kh.d.ts +1 -0
  879. package/node_modules/zod/v4/locales/kh.js +3 -115
  880. package/node_modules/zod/v4/locales/km.cjs +142 -0
  881. package/node_modules/zod/v4/locales/km.d.cts +5 -0
  882. package/node_modules/zod/v4/locales/km.d.ts +4 -0
  883. package/node_modules/zod/v4/locales/km.js +115 -0
  884. package/node_modules/zod/v4/locales/kn.cjs +143 -0
  885. package/node_modules/zod/v4/locales/kn.d.cts +5 -0
  886. package/node_modules/zod/v4/locales/kn.d.ts +4 -0
  887. package/node_modules/zod/v4/locales/kn.js +116 -0
  888. package/node_modules/zod/v4/locales/ko.cjs +20 -24
  889. package/node_modules/zod/v4/locales/ko.d.cts +2 -1
  890. package/node_modules/zod/v4/locales/ko.js +19 -24
  891. package/node_modules/zod/v4/locales/lt.cjs +234 -0
  892. package/node_modules/zod/v4/locales/lt.d.cts +5 -0
  893. package/node_modules/zod/v4/locales/lt.d.ts +4 -0
  894. package/node_modules/zod/v4/locales/lt.js +207 -0
  895. package/node_modules/zod/v4/locales/mk.cjs +22 -25
  896. package/node_modules/zod/v4/locales/mk.d.cts +2 -1
  897. package/node_modules/zod/v4/locales/mk.js +21 -25
  898. package/node_modules/zod/v4/locales/ms.cjs +21 -24
  899. package/node_modules/zod/v4/locales/ms.d.cts +2 -1
  900. package/node_modules/zod/v4/locales/ms.js +20 -24
  901. package/node_modules/zod/v4/locales/ne.cjs +138 -0
  902. package/node_modules/zod/v4/locales/ne.d.cts +5 -0
  903. package/node_modules/zod/v4/locales/ne.d.ts +4 -0
  904. package/node_modules/zod/v4/locales/ne.js +111 -0
  905. package/node_modules/zod/v4/locales/nl.cjs +31 -32
  906. package/node_modules/zod/v4/locales/nl.d.cts +2 -1
  907. package/node_modules/zod/v4/locales/nl.js +30 -32
  908. package/node_modules/zod/v4/locales/nn.cjs +140 -0
  909. package/node_modules/zod/v4/locales/nn.d.cts +5 -0
  910. package/node_modules/zod/v4/locales/nn.d.ts +4 -0
  911. package/node_modules/zod/v4/locales/nn.js +113 -0
  912. package/node_modules/zod/v4/locales/no.cjs +24 -26
  913. package/node_modules/zod/v4/locales/no.d.cts +2 -1
  914. package/node_modules/zod/v4/locales/no.js +23 -26
  915. package/node_modules/zod/v4/locales/ota.cjs +23 -25
  916. package/node_modules/zod/v4/locales/ota.d.cts +2 -1
  917. package/node_modules/zod/v4/locales/ota.js +22 -25
  918. package/node_modules/zod/v4/locales/package.json +7 -0
  919. package/node_modules/zod/v4/locales/pl.cjs +22 -24
  920. package/node_modules/zod/v4/locales/pl.d.cts +2 -1
  921. package/node_modules/zod/v4/locales/pl.js +21 -24
  922. package/node_modules/zod/v4/locales/ps.cjs +22 -24
  923. package/node_modules/zod/v4/locales/ps.d.cts +2 -1
  924. package/node_modules/zod/v4/locales/ps.js +21 -24
  925. package/node_modules/zod/v4/locales/pt-BR.cjs +170 -0
  926. package/node_modules/zod/v4/locales/pt-BR.d.cts +5 -0
  927. package/node_modules/zod/v4/locales/pt-BR.d.ts +4 -0
  928. package/node_modules/zod/v4/locales/pt-BR.js +143 -0
  929. package/node_modules/zod/v4/locales/pt.cjs +95 -68
  930. package/node_modules/zod/v4/locales/pt.d.cts +2 -1
  931. package/node_modules/zod/v4/locales/pt.js +94 -68
  932. package/node_modules/zod/v4/locales/ro.cjs +149 -0
  933. package/node_modules/zod/v4/locales/ro.d.cts +5 -0
  934. package/node_modules/zod/v4/locales/ro.d.ts +4 -0
  935. package/node_modules/zod/v4/locales/ro.js +122 -0
  936. package/node_modules/zod/v4/locales/ru.cjs +29 -24
  937. package/node_modules/zod/v4/locales/ru.d.cts +2 -1
  938. package/node_modules/zod/v4/locales/ru.js +28 -24
  939. package/node_modules/zod/v4/locales/sk.cjs +143 -0
  940. package/node_modules/zod/v4/locales/sk.d.cts +5 -0
  941. package/node_modules/zod/v4/locales/sk.d.ts +4 -0
  942. package/node_modules/zod/v4/locales/sk.js +116 -0
  943. package/node_modules/zod/v4/locales/sl.cjs +22 -24
  944. package/node_modules/zod/v4/locales/sl.d.cts +2 -1
  945. package/node_modules/zod/v4/locales/sl.js +21 -24
  946. package/node_modules/zod/v4/locales/sv.cjs +24 -26
  947. package/node_modules/zod/v4/locales/sv.d.cts +2 -1
  948. package/node_modules/zod/v4/locales/sv.js +23 -26
  949. package/node_modules/zod/v4/locales/ta.cjs +23 -24
  950. package/node_modules/zod/v4/locales/ta.d.cts +2 -1
  951. package/node_modules/zod/v4/locales/ta.js +22 -24
  952. package/node_modules/zod/v4/locales/tg.cjs +144 -0
  953. package/node_modules/zod/v4/locales/tg.d.cts +5 -0
  954. package/node_modules/zod/v4/locales/tg.d.ts +4 -0
  955. package/node_modules/zod/v4/locales/tg.js +117 -0
  956. package/node_modules/zod/v4/locales/th.cjs +23 -24
  957. package/node_modules/zod/v4/locales/th.d.cts +2 -1
  958. package/node_modules/zod/v4/locales/th.js +22 -24
  959. package/node_modules/zod/v4/locales/tk.cjs +134 -0
  960. package/node_modules/zod/v4/locales/tk.d.cts +5 -0
  961. package/node_modules/zod/v4/locales/tk.d.ts +4 -0
  962. package/node_modules/zod/v4/locales/tk.js +107 -0
  963. package/node_modules/zod/v4/locales/tr.cjs +20 -26
  964. package/node_modules/zod/v4/locales/tr.d.cts +2 -2
  965. package/node_modules/zod/v4/locales/tr.d.ts +0 -1
  966. package/node_modules/zod/v4/locales/tr.js +19 -24
  967. package/node_modules/zod/v4/locales/ua.cjs +6 -137
  968. package/node_modules/zod/v4/locales/ua.d.cts +2 -1
  969. package/node_modules/zod/v4/locales/ua.d.ts +1 -0
  970. package/node_modules/zod/v4/locales/ua.js +3 -115
  971. package/node_modules/zod/v4/locales/uk.cjs +140 -0
  972. package/node_modules/zod/v4/locales/uk.d.cts +5 -0
  973. package/node_modules/zod/v4/locales/uk.d.ts +4 -0
  974. package/node_modules/zod/v4/locales/uk.js +113 -0
  975. package/node_modules/zod/v4/locales/ur.cjs +23 -24
  976. package/node_modules/zod/v4/locales/ur.d.cts +2 -1
  977. package/node_modules/zod/v4/locales/ur.js +22 -24
  978. package/node_modules/zod/v4/locales/uz.cjs +140 -0
  979. package/node_modules/zod/v4/locales/uz.d.cts +5 -0
  980. package/node_modules/zod/v4/locales/uz.d.ts +4 -0
  981. package/node_modules/zod/v4/locales/uz.js +113 -0
  982. package/node_modules/zod/v4/locales/vi.cjs +22 -24
  983. package/node_modules/zod/v4/locales/vi.d.cts +2 -1
  984. package/node_modules/zod/v4/locales/vi.js +21 -24
  985. package/node_modules/zod/v4/locales/yo.cjs +139 -0
  986. package/node_modules/zod/v4/locales/yo.d.cts +5 -0
  987. package/node_modules/zod/v4/locales/yo.d.ts +4 -0
  988. package/node_modules/zod/v4/locales/yo.js +112 -0
  989. package/node_modules/zod/v4/locales/zh-CN.cjs +23 -24
  990. package/node_modules/zod/v4/locales/zh-CN.d.cts +2 -1
  991. package/node_modules/zod/v4/locales/zh-CN.js +22 -24
  992. package/node_modules/zod/v4/locales/zh-TW.cjs +20 -24
  993. package/node_modules/zod/v4/locales/zh-TW.d.cts +2 -1
  994. package/node_modules/zod/v4/locales/zh-TW.js +19 -24
  995. package/node_modules/zod/v4/mini/checks.cjs +21 -1
  996. package/node_modules/zod/v4/mini/checks.d.cts +1 -1
  997. package/node_modules/zod/v4/mini/checks.d.ts +1 -1
  998. package/node_modules/zod/v4/mini/checks.js +1 -1
  999. package/node_modules/zod/v4/mini/coerce.cjs +24 -0
  1000. package/node_modules/zod/v4/mini/coerce.js +5 -0
  1001. package/node_modules/zod/v4/mini/deep-partial.cjs +58 -0
  1002. package/node_modules/zod/v4/mini/deep-partial.d.cts +14 -0
  1003. package/node_modules/zod/v4/mini/deep-partial.d.ts +14 -0
  1004. package/node_modules/zod/v4/mini/deep-partial.js +13 -0
  1005. package/node_modules/zod/v4/mini/external.cjs +36 -3
  1006. package/node_modules/zod/v4/mini/external.d.cts +7 -2
  1007. package/node_modules/zod/v4/mini/external.d.ts +7 -2
  1008. package/node_modules/zod/v4/mini/external.js +4 -1
  1009. package/node_modules/zod/v4/mini/in-out.cjs +82 -0
  1010. package/node_modules/zod/v4/mini/in-out.d.cts +8 -0
  1011. package/node_modules/zod/v4/mini/in-out.d.ts +8 -0
  1012. package/node_modules/zod/v4/mini/in-out.js +36 -0
  1013. package/node_modules/zod/v4/mini/index.cjs +19 -0
  1014. package/node_modules/zod/v4/mini/iso.cjs +27 -4
  1015. package/node_modules/zod/v4/mini/iso.js +8 -4
  1016. package/node_modules/zod/v4/mini/package.json +7 -0
  1017. package/node_modules/zod/v4/mini/parse.cjs +30 -1
  1018. package/node_modules/zod/v4/mini/parse.d.cts +1 -1
  1019. package/node_modules/zod/v4/mini/parse.d.ts +1 -1
  1020. package/node_modules/zod/v4/mini/parse.js +1 -1
  1021. package/node_modules/zod/v4/mini/schemas.cjs +390 -82
  1022. package/node_modules/zod/v4/mini/schemas.d.cts +156 -32
  1023. package/node_modules/zod/v4/mini/schemas.d.ts +156 -32
  1024. package/node_modules/zod/v4/mini/schemas.js +329 -59
  1025. package/node_modules/zod/v4/package.json +7 -0
  1026. package/node_modules/zod/v4-mini/index.cjs +35 -1
  1027. package/node_modules/zod/v4-mini/index.d.cts +3 -1
  1028. package/node_modules/zod/v4-mini/index.d.ts +3 -1
  1029. package/node_modules/zod/v4-mini/index.js +3 -1
  1030. package/node_modules/zod/v4-mini/package.json +7 -0
  1031. package/package.json +4 -4
  1032. package/dist/ui/assets/index-DNNXeRpZ.js +0 -123
  1033. package/dist/ui/assets/index-Osk4E49r.css +0 -1
  1034. package/node_modules/zod/src/v4/core/config.ts +0 -15
  1035. package/node_modules/zod/src/v4/core/function.ts +0 -176
  1036. package/node_modules/zod/v4/core/function.cjs +0 -102
  1037. package/node_modules/zod/v4/core/function.d.cts +0 -52
  1038. package/node_modules/zod/v4/core/function.d.ts +0 -52
  1039. package/node_modules/zod/v4/core/function.js +0 -75
@@ -1,10 +1,27 @@
1
+ import type { $ZodBigIntFormats } from "../core/checks.js";
1
2
  import * as core from "../core/index.js";
2
- import { util } from "../core/index.js";
3
+ import { util, type $ZodNumberFormats } from "../core/index.js";
4
+ import * as processors from "../core/json-schema-processors.js";
5
+ import * as regexes from "../core/regexes.js";
6
+ import type { StandardSchemaWithJSONProps } from "../core/standard-schema.js";
7
+ import { createStandardJSONSchemaMethod, createToJSONSchemaMethod } from "../core/to-json-schema.js";
8
+ import en from "../locales/en.js";
3
9
 
4
10
  import * as checks from "./checks.js";
5
- import * as iso from "./iso.js";
6
11
  import * as parse from "./parse.js";
7
12
 
13
+ // Register English as the default locale on first ZodType construction. Hooked into the `ZodType` `$constructor` (rather than a top-level `config(en())` in `external.ts`) so bundlers honoring `sideEffects: false` can't tree-shake it out — see #5953, #5725. An explicit `z.config(z.locales.xx())` call wins regardless of order, since this only sets the default when none is present.
14
+ function _ensureDefaultLocale(): void {
15
+ if (!core.globalConfig.localeError) core.config(en());
16
+ }
17
+
18
+ // the default memoizer is read by the core container init, which runs before `ZodType.init`, so each container calls this first
19
+ function _ensureDefaultMemoizer(): void {
20
+ if (!core.globalConfig.memoizer) core.config({ memoizer: core.memoizer() });
21
+ }
22
+
23
+ // Methods live on each concrete constructor's prototype and materialize per instance on first access, so a schema only pays for what it is asked for.
24
+
8
25
  ///////////////////////////////////////////
9
26
  ///////////////////////////////////////////
10
27
  //////////// ////////////
@@ -13,10 +30,7 @@ import * as parse from "./parse.js";
13
30
  ///////////////////////////////////////////
14
31
  ///////////////////////////////////////////
15
32
 
16
- export interface RefinementCtx<T = unknown> extends core.ParsePayload<T> {
17
- addIssue(arg: string | core.$ZodRawIssue | Partial<core.$ZodIssueCustom>): void;
18
- }
19
-
33
+ export type ZodStandardSchemaWithJSON<T> = StandardSchemaWithJSONProps<core.input<T>, core.output<T>>;
20
34
  export interface ZodType<
21
35
  out Output = unknown,
22
36
  out Input = unknown,
@@ -32,8 +46,13 @@ export interface ZodType<
32
46
  /** @deprecated Use `z.input<typeof schema>` instead. */
33
47
  _input: Internals["input"];
34
48
 
49
+ "~standard": ZodStandardSchemaWithJSON<this>;
50
+ /** Converts this schema to a JSON Schema representation. */
51
+ toJSONSchema(params?: core.ToJSONSchemaParams): core.ZodStandardJSONSchemaPayload<this>;
52
+
35
53
  // base methods
36
54
  check(...checks: (core.CheckFn<core.output<this>> | core.$ZodCheck<core.output<this>>)[]): this;
55
+ with(...checks: (core.CheckFn<core.output<this>> | core.$ZodCheck<core.output<this>>)[]): this;
37
56
  clone(def?: Internals["def"], params?: { parent: boolean }): this;
38
57
  register<R extends core.$ZodRegistry>(
39
58
  registry: R,
@@ -44,7 +63,9 @@ export interface ZodType<
44
63
  : ["Incompatible schema"]
45
64
  ): this;
46
65
 
47
- brand<T extends PropertyKey = PropertyKey>(value?: T): PropertyKey extends T ? this : core.$ZodBranded<this, T>;
66
+ brand<T extends PropertyKey = PropertyKey, Dir extends "in" | "out" | "inout" = "out">(
67
+ value?: T
68
+ ): PropertyKey extends T ? this : core.$ZodBranded<this, T, Dir>;
48
69
 
49
70
  // parsing
50
71
  parse(data: unknown, params?: core.ParseContext<core.$ZodIssue>): core.output<this>;
@@ -58,21 +79,49 @@ export interface ZodType<
58
79
  data: unknown,
59
80
  params?: core.ParseContext<core.$ZodIssue>
60
81
  ) => Promise<parse.ZodSafeParseResult<core.output<this>>>;
82
+ validate(data: unknown, params?: core.ParseContext<core.$ZodIssue>): data is core.input<this>;
83
+ validateAsync(data: unknown, params?: core.ParseContext<core.$ZodIssue>): Promise<boolean>;
84
+
85
+ // encoding/decoding
86
+ encode(data: core.output<this>, params?: core.ParseContext<core.$ZodIssue>): core.input<this>;
87
+ decode(data: core.input<this>, params?: core.ParseContext<core.$ZodIssue>): core.output<this>;
88
+ encodeAsync(data: core.output<this>, params?: core.ParseContext<core.$ZodIssue>): Promise<core.input<this>>;
89
+ decodeAsync(data: core.input<this>, params?: core.ParseContext<core.$ZodIssue>): Promise<core.output<this>>;
90
+ safeEncode(
91
+ data: core.output<this>,
92
+ params?: core.ParseContext<core.$ZodIssue>
93
+ ): parse.ZodSafeParseResult<core.input<this>>;
94
+ safeDecode(
95
+ data: core.input<this>,
96
+ params?: core.ParseContext<core.$ZodIssue>
97
+ ): parse.ZodSafeParseResult<core.output<this>>;
98
+ safeEncodeAsync(
99
+ data: core.output<this>,
100
+ params?: core.ParseContext<core.$ZodIssue>
101
+ ): Promise<parse.ZodSafeParseResult<core.input<this>>>;
102
+ safeDecodeAsync(
103
+ data: core.input<this>,
104
+ params?: core.ParseContext<core.$ZodIssue>
105
+ ): Promise<parse.ZodSafeParseResult<core.output<this>>>;
61
106
 
62
107
  // refinements
63
- refine(check: (arg: core.output<this>) => unknown | Promise<unknown>, params?: string | core.$ZodCustomParams): this;
64
- /** @deprecated Use `.check()` instead. */
108
+ refine<Ch extends (arg: core.output<this>) => unknown | Promise<unknown>>(
109
+ check: Ch,
110
+ params?: string | core.$ZodCustomParams
111
+ ): Ch extends (arg: any) => arg is infer R ? this & ZodType<R, core.input<this>> : this;
65
112
  superRefine(
66
- refinement: (arg: core.output<this>, ctx: RefinementCtx<core.output<this>>) => void | Promise<void>
113
+ refinement: (arg: core.output<this>, ctx: core.$RefinementCtx<core.output<this>>) => void | Promise<void>,
114
+ params?: core.$ZodSuperRefineParams
67
115
  ): this;
68
116
  overwrite(fn: (x: core.output<this>) => core.output<this>): this;
69
117
 
70
118
  // wrappers
71
119
  optional(): ZodOptional<this>;
120
+ exactOptional(): ZodExactOptional<this>;
72
121
  nonoptional(params?: string | core.$ZodNonOptionalParams): ZodNonOptional<this>;
73
122
  nullable(): ZodNullable<this>;
74
123
  nullish(): ZodOptional<ZodNullable<this>>;
75
- default(def: core.output<this>): ZodDefault<this>;
124
+ default(def: util.NoUndefined<core.output<this>>): ZodDefault<this>;
76
125
  default(def: () => util.NoUndefined<core.output<this>>): ZodDefault<this>;
77
126
  prefault(def: () => core.input<this>): ZodPrefault<this>;
78
127
  prefault(def: core.input<this>): ZodPrefault<this>;
@@ -80,7 +129,7 @@ export interface ZodType<
80
129
  or<T extends core.SomeType>(option: T): ZodUnion<[this, T]>;
81
130
  and<T extends core.SomeType>(incoming: T): ZodIntersection<this, T>;
82
131
  transform<NewOut>(
83
- transform: (arg: core.output<this>, ctx: RefinementCtx<core.output<this>>) => NewOut | Promise<NewOut>
132
+ transform: (arg: core.output<this>, ctx: core.$RefinementCtx<core.output<this>>) => NewOut | Promise<NewOut>
84
133
  ): ZodPipe<this, ZodTransform<Awaited<NewOut>, core.output<this>>>;
85
134
  catch(def: core.output<this>): ZodCatch<this>;
86
135
  catch(def: (ctx: core.$ZodCatchCtx) => core.output<this>): ZodCatch<this>;
@@ -115,92 +164,198 @@ export interface ZodType<
115
164
  * ```
116
165
  */
117
166
  isNullable(): boolean;
167
+ apply<T, TArgs extends unknown[] = []>(fn: (schema: this, ...args: TArgs) => T, ...args: TArgs): T;
118
168
  }
119
169
 
120
170
  export interface _ZodType<out Internals extends core.$ZodTypeInternals = core.$ZodTypeInternals>
121
171
  extends ZodType<any, any, Internals> {}
122
172
 
123
- export const ZodType: core.$constructor<ZodType> = /*@__PURE__*/ core.$constructor("ZodType", (inst, def) => {
124
- core.$ZodType.init(inst, def);
125
- inst.def = def;
126
- Object.defineProperty(inst, "_def", { value: def });
127
-
128
- // base methods
129
- inst.check = (...checks) => {
130
- return inst.clone(
131
- {
132
- ...def,
133
- checks: [
134
- ...(def.checks ?? []),
135
- ...checks.map((ch) =>
136
- typeof ch === "function" ? { _zod: { check: ch, def: { check: "custom" }, onattach: [] } } : ch
137
- ),
138
- ],
139
- }
140
- // { parent: true }
141
- );
142
- };
143
- inst.clone = (def, params) => core.clone(inst, def, params);
144
- inst.brand = () => inst as any;
145
- inst.register = ((reg: any, meta: any) => {
146
- reg.add(inst, meta);
147
- return inst;
148
- }) as any;
149
-
150
- // parsing
151
- inst.parse = (data, params) => parse.parse(inst, data, params, { callee: inst.parse });
152
- inst.safeParse = (data, params) => parse.safeParse(inst, data, params);
153
- inst.parseAsync = async (data, params) => parse.parseAsync(inst, data, params, { callee: inst.parseAsync });
154
- inst.safeParseAsync = async (data, params) => parse.safeParseAsync(inst, data, params);
155
- inst.spa = inst.safeParseAsync;
173
+ export const ZodType: core.$constructor<ZodType> = /*@__PURE__*/ core.$constructor<ZodType>(
174
+ "ZodType",
175
+ (inst, def) => {
176
+ _ensureDefaultLocale();
177
+ core.$ZodType.init(inst, def);
156
178
 
157
- // refinements
158
- inst.refine = (check, params) => inst.check(refine(check, params));
159
- inst.superRefine = (refinement) => inst.check(superRefine(refinement));
160
- inst.overwrite = (fn) => inst.check(checks.overwrite(fn));
179
+ inst.def = def;
180
+ inst.type = def.type;
161
181
 
162
- // wrappers
163
- inst.optional = () => optional(inst);
164
- inst.nullable = () => nullable(inst);
165
- inst.nullish = () => optional(nullable(inst));
166
- inst.nonoptional = (params) => nonoptional(inst, params);
167
- inst.array = () => array(inst);
168
- inst.or = (arg) => union([inst, arg]);
169
- inst.and = (arg) => intersection(inst, arg);
170
- inst.transform = (tx) => pipe(inst, transform(tx as any)) as never;
171
- inst.default = (def) => _default(inst, def);
172
- inst.prefault = (def) => prefault(inst, def);
173
- // inst.coalesce = (def, params) => coalesce(inst, def, params);
174
- inst.catch = (params) => _catch(inst, params);
175
- inst.pipe = (target) => pipe(inst, target);
176
- inst.readonly = () => readonly(inst);
177
-
178
- // meta
179
- inst.describe = (description) => {
180
- const cl = inst.clone();
181
- core.globalRegistry.add(cl, { description });
182
- return cl;
183
- };
184
- Object.defineProperty(inst, "description", {
185
- get() {
186
- return core.globalRegistry.get(inst)?.description;
182
+ return inst;
183
+ },
184
+ {
185
+ check(...chks) {
186
+ const def = this.def;
187
+ return this.clone(
188
+ util.mergeDefs(def, {
189
+ checks: [
190
+ ...(def.checks ?? []),
191
+ ...chks.map((ch) =>
192
+ typeof ch === "function" ? { _zod: { check: ch, def: { check: "custom" }, onattach: [] } } : ch
193
+ ),
194
+ ],
195
+ }),
196
+ { parent: true }
197
+ );
187
198
  },
188
- configurable: true,
189
- });
190
- inst.meta = (...args: any) => {
191
- if (args.length === 0) {
192
- return core.globalRegistry.get(inst);
193
- }
194
- const cl = inst.clone();
195
- core.globalRegistry.add(cl, args[0]);
196
- return cl as any;
197
- };
198
-
199
- // helpers
200
- inst.isOptional = () => inst.safeParse(undefined).success;
201
- inst.isNullable = () => inst.safeParse(null).success;
202
- return inst;
203
- });
199
+ with(...chks) {
200
+ return this.check(...chks);
201
+ },
202
+ clone(def, params) {
203
+ return core.clone(this, def, params);
204
+ },
205
+ brand() {
206
+ return this;
207
+ },
208
+ register(reg, meta) {
209
+ reg.add(this, meta);
210
+ return this;
211
+ },
212
+ refine(check, params) {
213
+ return this.check(refine(check, params));
214
+ },
215
+ superRefine(refinement, params) {
216
+ return this.check(superRefine(refinement, params));
217
+ },
218
+ overwrite(fn) {
219
+ return this.check(checks.overwrite(fn));
220
+ },
221
+ optional() {
222
+ return optional(this);
223
+ },
224
+ exactOptional() {
225
+ return exactOptional(this);
226
+ },
227
+ nullable() {
228
+ return nullable(this);
229
+ },
230
+ nullish() {
231
+ return optional(nullable(this));
232
+ },
233
+ nonoptional(params) {
234
+ return nonoptional(this, params);
235
+ },
236
+ array() {
237
+ return array(this);
238
+ },
239
+ or(arg) {
240
+ return union([this, arg]);
241
+ },
242
+ and(arg) {
243
+ return intersection(this, arg);
244
+ },
245
+ transform(tx) {
246
+ return pipe(this, transform(tx));
247
+ },
248
+ default(d) {
249
+ return _default(this, d);
250
+ },
251
+ prefault(d) {
252
+ return prefault(this, d);
253
+ },
254
+ catch(params) {
255
+ return _catch(this, params);
256
+ },
257
+ pipe(target) {
258
+ return pipe(this, target);
259
+ },
260
+ readonly() {
261
+ return readonly(this);
262
+ },
263
+ describe(description) {
264
+ const cl = this.clone();
265
+ core.globalRegistry.add(cl, { description });
266
+ return cl;
267
+ },
268
+ meta(...args: any[]): any {
269
+ // overloaded: meta() returns the registered metadata, meta(data) returns a clone with `data` registered. The mapped type picks up the second overload, so we accept variadic any-args and return `any` to satisfy both at runtime.
270
+ if (args.length === 0) return core.globalRegistry.get(this);
271
+ const cl = this.clone();
272
+ core.globalRegistry.add(cl, args[0]);
273
+ return cl;
274
+ },
275
+ isOptional() {
276
+ return this.safeParse(undefined).success;
277
+ },
278
+ isNullable() {
279
+ return this.safeParse(null).success;
280
+ },
281
+ apply(fn, ...args) {
282
+ return args.length === 0 ? fn(this) : fn(this, ...args);
283
+ },
284
+ // Overrides core's `~standard` to add `jsonSchema`. Must stay a prototype entry: redefining it per instance demotes instances to dictionary mode.
285
+ get "~standard"(): ZodType["~standard"] {
286
+ return util.hide(this, "~standard", {
287
+ ...core.standardProps(this),
288
+ jsonSchema: {
289
+ input: createStandardJSONSchemaMethod(this, "input"),
290
+ output: createStandardJSONSchemaMethod(this, "output"),
291
+ },
292
+ } as ZodType["~standard"]);
293
+ },
294
+ set "~standard"(value: ZodType["~standard"]) {
295
+ util.own(this, "~standard", value);
296
+ },
297
+ parse: function _parse(data, params) {
298
+ return parse.parse(this, data, params, { callee: _parse });
299
+ },
300
+ parseAsync: async function _parseAsync(data, params) {
301
+ return await parse.parseAsync(this, data, params, { callee: _parseAsync });
302
+ },
303
+ safeParse(data, params) {
304
+ return parse.safeParse(this, data, params);
305
+ },
306
+ async safeParseAsync(data, params) {
307
+ return parse.safeParseAsync(this, data, params);
308
+ },
309
+ // `spa` is an alias: same function object as `safeParseAsync`, as before.
310
+ get spa(): ZodType["safeParseAsync"] {
311
+ return this?.safeParseAsync;
312
+ },
313
+ set spa(value: ZodType["safeParseAsync"]) {
314
+ util.own(this, "spa", value);
315
+ },
316
+ validate(data, params) {
317
+ return parse.validate(this, data, params);
318
+ },
319
+ validateAsync(data, params) {
320
+ return parse.validateAsync(this, data, params);
321
+ },
322
+ encode: function _encode(data, params) {
323
+ return parse.encode(this, data, params, { callee: _encode });
324
+ },
325
+ decode: function _decode(data, params) {
326
+ return parse.decode(this, data, params, { callee: _decode });
327
+ },
328
+ encodeAsync: async function _encodeAsync(data, params) {
329
+ return await parse.encodeAsync(this, data, params, { callee: _encodeAsync });
330
+ },
331
+ decodeAsync: async function _decodeAsync(data, params) {
332
+ return await parse.decodeAsync(this, data, params, { callee: _decodeAsync });
333
+ },
334
+ safeEncode(data, params) {
335
+ return parse.safeEncode(this, data, params);
336
+ },
337
+ safeDecode(data, params) {
338
+ return parse.safeDecode(this, data, params);
339
+ },
340
+ async safeEncodeAsync(data, params) {
341
+ return parse.safeEncodeAsync(this, data, params);
342
+ },
343
+ async safeDecodeAsync(data, params) {
344
+ return parse.safeDecodeAsync(this, data, params);
345
+ },
346
+ toJSONSchema(params) {
347
+ return createToJSONSchemaMethod(this, {})(params);
348
+ },
349
+ // Reads through to the registry on every access, so it must not cache.
350
+ get description(): string | undefined {
351
+ return core.globalRegistry.get(this as unknown as ZodType)?.description;
352
+ },
353
+ // No setter: `schema._def = x` throws, as it did when `_def` was a non-writable own property.
354
+ get _def(): core.$ZodTypeDef {
355
+ return (this as unknown as ZodType)._zod.def;
356
+ },
357
+ }
358
+ );
204
359
 
205
360
  // ZodString
206
361
  export interface _ZodString<T extends core.$ZodStringInternals<unknown> = core.$ZodStringInternals<unknown>>
@@ -211,7 +366,7 @@ export interface _ZodString<T extends core.$ZodStringInternals<unknown> = core.$
211
366
 
212
367
  // miscellaneous checks
213
368
  regex(regex: RegExp, params?: string | core.$ZodCheckRegexParams): this;
214
- includes(value: string, params?: core.$ZodCheckIncludesParams): this;
369
+ includes(value: string, params?: string | core.$ZodCheckIncludesParams): this;
215
370
  startsWith(value: string, params?: string | core.$ZodCheckStartsWithParams): this;
216
371
  endsWith(value: string, params?: string | core.$ZodCheckEndsWithParams): this;
217
372
  min(minLength: number, params?: string | core.$ZodCheckMinLengthParams): this;
@@ -226,36 +381,73 @@ export interface _ZodString<T extends core.$ZodStringInternals<unknown> = core.$
226
381
  normalize(form?: "NFC" | "NFD" | "NFKC" | "NFKD" | (string & {})): this;
227
382
  toLowerCase(): this;
228
383
  toUpperCase(): this;
384
+ slugify(): this;
229
385
  }
230
386
 
231
387
  /** @internal */
232
- export const _ZodString: core.$constructor<_ZodString> = /*@__PURE__*/ core.$constructor("_ZodString", (inst, def) => {
233
- core.$ZodString.init(inst, def);
234
- ZodType.init(inst, def);
235
-
236
- const bag = inst._zod.bag;
237
- inst.format = bag.format ?? null;
238
- inst.minLength = bag.minimum ?? null;
239
- inst.maxLength = bag.maximum ?? null;
240
-
241
- // validations
242
- inst.regex = (...args) => inst.check(checks.regex(...args));
243
- inst.includes = (...args) => inst.check(checks.includes(...args));
244
- inst.startsWith = (...args) => inst.check(checks.startsWith(...args));
245
- inst.endsWith = (...args) => inst.check(checks.endsWith(...args));
246
- inst.min = (...args) => inst.check(checks.minLength(...args));
247
- inst.max = (...args) => inst.check(checks.maxLength(...args));
248
- inst.length = (...args) => inst.check(checks.length(...args));
249
- inst.nonempty = (...args) => inst.check(checks.minLength(1, ...args));
250
- inst.lowercase = (params) => inst.check(checks.lowercase(params));
251
- inst.uppercase = (params) => inst.check(checks.uppercase(params));
388
+ export const _ZodString: core.$constructor<_ZodString> = /*@__PURE__*/ core.$constructor<_ZodString>(
389
+ "_ZodString",
390
+ (inst, def) => {
391
+ core.$ZodString.init(inst, def);
392
+ ZodType.init(inst, def);
252
393
 
253
- // transforms
254
- inst.trim = () => inst.check(checks.trim());
255
- inst.normalize = (...args) => inst.check(checks.normalize(...args));
256
- inst.toLowerCase = () => inst.check(checks.toLowerCase());
257
- inst.toUpperCase = () => inst.check(checks.toUpperCase());
258
- });
394
+ inst._zod.processJSONSchema = (ctx, json, params) => processors.stringProcessor(inst, ctx, json, params);
395
+ },
396
+ /*@__PURE__*/ util.derived<_ZodString>(
397
+ {
398
+ format: (inst) => processors.aggregateChecks(inst).format ?? null,
399
+ minLength: (inst) => processors.aggregateChecks<number>(inst).minimum ?? null,
400
+ maxLength: (inst) => processors.aggregateChecks<number>(inst).maximum ?? null,
401
+ },
402
+ {
403
+ regex(...args) {
404
+ return this.check((checks.regex as any)(...args));
405
+ },
406
+ includes(...args) {
407
+ return this.check((checks.includes as any)(...args));
408
+ },
409
+ startsWith(...args) {
410
+ return this.check((checks.startsWith as any)(...args));
411
+ },
412
+ endsWith(...args) {
413
+ return this.check((checks.endsWith as any)(...args));
414
+ },
415
+ min(...args) {
416
+ return this.check((checks.minLength as any)(...args));
417
+ },
418
+ max(...args) {
419
+ return this.check((checks.maxLength as any)(...args));
420
+ },
421
+ length(...args) {
422
+ return this.check((checks.length as any)(...args));
423
+ },
424
+ nonempty(...args) {
425
+ return this.check((checks.minLength as any)(1, ...args));
426
+ },
427
+ lowercase(params) {
428
+ return this.check(checks.lowercase(params));
429
+ },
430
+ uppercase(params) {
431
+ return this.check(checks.uppercase(params));
432
+ },
433
+ trim() {
434
+ return this.check(checks.trim());
435
+ },
436
+ normalize(...args) {
437
+ return this.check(checks.normalize(...args));
438
+ },
439
+ toLowerCase() {
440
+ return this.check(checks.toLowerCase());
441
+ },
442
+ toUpperCase() {
443
+ return this.check(checks.toUpperCase());
444
+ },
445
+ slugify() {
446
+ return this.check(checks.slugify());
447
+ },
448
+ }
449
+ )
450
+ );
259
451
 
260
452
  export interface ZodString extends _ZodString<core.$ZodStringInternals<string>> {
261
453
  // string format checks
@@ -282,7 +474,11 @@ export interface ZodString extends _ZodString<core.$ZodStringInternals<string>>
282
474
  nanoid(params?: string | core.$ZodCheckNanoIDParams): this;
283
475
  /** @deprecated Use `z.guid()` instead. */
284
476
  guid(params?: string | core.$ZodCheckGUIDParams): this;
285
- /** @deprecated Use `z.cuid()` instead. */
477
+ /**
478
+ * @deprecated CUID v1 is deprecated by its authors due to information leakage
479
+ * (timestamps embedded in the id). Use `z.cuid2()` instead.
480
+ * See https://github.com/paralleldrive/cuid.
481
+ */
286
482
  cuid(params?: string | core.$ZodCheckCUIDParams): this;
287
483
  /** @deprecated Use `z.cuid2()` instead. */
288
484
  cuid2(params?: string | core.$ZodCheckCUID2Params): this;
@@ -330,45 +526,98 @@ export interface ZodString extends _ZodString<core.$ZodStringInternals<string>>
330
526
  duration(params?: string | core.$ZodCheckISODurationParams): this;
331
527
  }
332
528
 
333
- export const ZodString: core.$constructor<ZodString> = /*@__PURE__*/ core.$constructor("ZodString", (inst, def) => {
334
- core.$ZodString.init(inst, def);
335
- _ZodString.init(inst, def);
336
-
337
- inst.email = (params) => inst.check(core._email(ZodEmail, params));
338
- inst.url = (params) => inst.check(core._url(ZodURL, params));
339
- inst.jwt = (params) => inst.check(core._jwt(ZodJWT, params));
340
- inst.emoji = (params) => inst.check(core._emoji(ZodEmoji, params));
341
- inst.guid = (params) => inst.check(core._guid(ZodGUID, params));
342
- inst.uuid = (params) => inst.check(core._uuid(ZodUUID, params));
343
- inst.uuidv4 = (params) => inst.check(core._uuidv4(ZodUUID, params));
344
- inst.uuidv6 = (params) => inst.check(core._uuidv6(ZodUUID, params));
345
- inst.uuidv7 = (params) => inst.check(core._uuidv7(ZodUUID, params));
346
- inst.nanoid = (params) => inst.check(core._nanoid(ZodNanoID, params));
347
- inst.guid = (params) => inst.check(core._guid(ZodGUID, params));
348
- inst.cuid = (params) => inst.check(core._cuid(ZodCUID, params));
349
- inst.cuid2 = (params) => inst.check(core._cuid2(ZodCUID2, params));
350
- inst.ulid = (params) => inst.check(core._ulid(ZodULID, params));
351
- inst.base64 = (params) => inst.check(core._base64(ZodBase64, params));
352
- inst.base64url = (params) => inst.check(core._base64url(ZodBase64URL, params));
353
- inst.xid = (params) => inst.check(core._xid(ZodXID, params));
354
- inst.ksuid = (params) => inst.check(core._ksuid(ZodKSUID, params));
355
- inst.ipv4 = (params) => inst.check(core._ipv4(ZodIPv4, params));
356
- inst.ipv6 = (params) => inst.check(core._ipv6(ZodIPv6, params));
357
- inst.cidrv4 = (params) => inst.check(core._cidrv4(ZodCIDRv4, params));
358
- inst.cidrv6 = (params) => inst.check(core._cidrv6(ZodCIDRv6, params));
359
- inst.e164 = (params) => inst.check(core._e164(ZodE164, params));
360
-
361
- // iso
362
- inst.datetime = (params) => inst.check(iso.datetime(params as any));
363
- inst.date = (params) => inst.check(iso.date(params as any));
364
- inst.time = (params) => inst.check(iso.time(params as any));
365
- inst.duration = (params) => inst.check(iso.duration(params as any));
366
- });
529
+ export const ZodString: core.$constructor<ZodString> = /*@__PURE__*/ core.$constructor<ZodString>(
530
+ "ZodString",
531
+ (inst, def) => {
532
+ core.$ZodString.init(inst, def);
533
+ _ZodString.init(inst, def);
534
+ },
535
+ {
536
+ email(params) {
537
+ return this.check(core._email(ZodEmail, params));
538
+ },
539
+ url(params) {
540
+ return this.check(core._url(ZodURL, params));
541
+ },
542
+ jwt(params) {
543
+ return this.check(core._jwt(ZodJWT, params));
544
+ },
545
+ emoji(params) {
546
+ return this.check(core._emoji(ZodEmoji, params));
547
+ },
548
+ guid(params) {
549
+ return this.check(core._guid(ZodGUID, params));
550
+ },
551
+ uuid(params) {
552
+ return this.check(core._uuid(ZodUUID, params));
553
+ },
554
+ uuidv4(params) {
555
+ return this.check(core._uuidv4(ZodUUID, params));
556
+ },
557
+ uuidv6(params) {
558
+ return this.check(core._uuidv6(ZodUUID, params));
559
+ },
560
+ uuidv7(params) {
561
+ return this.check(core._uuidv7(ZodUUID, params));
562
+ },
563
+ nanoid(params) {
564
+ return this.check(core._nanoid(ZodNanoID, params));
565
+ },
566
+ cuid(params) {
567
+ return this.check(core._cuid(ZodCUID, params));
568
+ },
569
+ cuid2(params) {
570
+ return this.check(core._cuid2(ZodCUID2, params));
571
+ },
572
+ ulid(params) {
573
+ return this.check(core._ulid(ZodULID, params));
574
+ },
575
+ base64(params) {
576
+ return this.check(core._base64(ZodBase64, params));
577
+ },
578
+ base64url(params) {
579
+ return this.check(core._base64url(ZodBase64URL, params));
580
+ },
581
+ xid(params) {
582
+ return this.check(core._xid(ZodXID, params));
583
+ },
584
+ ksuid(params) {
585
+ return this.check(core._ksuid(ZodKSUID, params));
586
+ },
587
+ ipv4(params) {
588
+ return this.check(core._ipv4(ZodIPv4, params));
589
+ },
590
+ ipv6(params) {
591
+ return this.check(core._ipv6(ZodIPv6, params));
592
+ },
593
+ cidrv4(params) {
594
+ return this.check(core._cidrv4(ZodCIDRv4, params));
595
+ },
596
+ cidrv6(params) {
597
+ return this.check(core._cidrv6(ZodCIDRv6, params));
598
+ },
599
+ e164(params) {
600
+ return this.check(core._e164(ZodE164, params));
601
+ },
602
+ datetime(params) {
603
+ return this.check(core._isoDateTime(ZodISODateTime, params as any));
604
+ },
605
+ date(params) {
606
+ return this.check(core._isoDate(ZodISODate, params as any));
607
+ },
608
+ time(params) {
609
+ return this.check(core._isoTime(ZodISOTime, params as any));
610
+ },
611
+ duration(params) {
612
+ return this.check(core._isoDuration(ZodISODuration, params as any));
613
+ },
614
+ }
615
+ );
367
616
 
368
617
  export function string(params?: string | core.$ZodStringParams): ZodString;
369
618
  export function string<T extends string>(params?: string | core.$ZodStringParams): core.$ZodType<T, T>;
370
619
  export function string(params?: string | core.$ZodStringParams): ZodString {
371
- return core._string(ZodString, params) as any;
620
+ return core._string(ZodString, params);
372
621
  }
373
622
 
374
623
  // ZodStringFormat
@@ -382,6 +631,72 @@ export const ZodStringFormat: core.$constructor<ZodStringFormat> = /*@__PURE__*/
382
631
  }
383
632
  );
384
633
 
634
+ //////////////////////////////////////////////
635
+ //////////////////////////////////////////////
636
+ ////////// //////////
637
+ ////////// ZodISODateTime //////////
638
+ ////////// //////////
639
+ //////////////////////////////////////////////
640
+ //////////////////////////////////////////////
641
+ export interface ZodISODateTime extends ZodStringFormat {
642
+ _zod: core.$ZodISODateTimeInternals;
643
+ }
644
+ export const ZodISODateTime: core.$constructor<ZodISODateTime> = /*@__PURE__*/ core.$constructor(
645
+ "ZodISODateTime",
646
+ (inst, def) => {
647
+ core.$ZodISODateTime.init(inst, def);
648
+ ZodStringFormat.init(inst, def);
649
+ }
650
+ );
651
+
652
+ //////////////////////////////////////////
653
+ //////////////////////////////////////////
654
+ ////////// //////////
655
+ ////////// ZodISODate //////////
656
+ ////////// //////////
657
+ //////////////////////////////////////////
658
+ //////////////////////////////////////////
659
+ export interface ZodISODate extends ZodStringFormat {
660
+ _zod: core.$ZodISODateInternals;
661
+ }
662
+ export const ZodISODate: core.$constructor<ZodISODate> = /*@__PURE__*/ core.$constructor("ZodISODate", (inst, def) => {
663
+ core.$ZodISODate.init(inst, def);
664
+ ZodStringFormat.init(inst, def);
665
+ });
666
+
667
+ //////////////////////////////////////////
668
+ //////////////////////////////////////////
669
+ ////////// //////////
670
+ ////////// ZodISOTime //////////
671
+ ////////// //////////
672
+ //////////////////////////////////////////
673
+ //////////////////////////////////////////
674
+ export interface ZodISOTime extends ZodStringFormat {
675
+ _zod: core.$ZodISOTimeInternals;
676
+ }
677
+ export const ZodISOTime: core.$constructor<ZodISOTime> = /*@__PURE__*/ core.$constructor("ZodISOTime", (inst, def) => {
678
+ core.$ZodISOTime.init(inst, def);
679
+ ZodStringFormat.init(inst, def);
680
+ });
681
+
682
+ //////////////////////////////////////////////
683
+ //////////////////////////////////////////////
684
+ ////////// //////////
685
+ ////////// ZodISODuration //////////
686
+ ////////// //////////
687
+ //////////////////////////////////////////////
688
+ //////////////////////////////////////////////
689
+ export interface ZodISODuration extends ZodStringFormat {
690
+ _zod: core.$ZodISODurationInternals;
691
+ }
692
+ export const ZodISODuration: core.$constructor<ZodISODuration> = /*@__PURE__*/ core.$constructor(
693
+ "ZodISODuration",
694
+ (inst, def) => {
695
+ core.$ZodISODuration.init(inst, def);
696
+ ZodStringFormat.init(inst, def);
697
+ }
698
+ );
699
+
385
700
  // ZodEmail
386
701
  export interface ZodEmail extends ZodStringFormat<"email"> {
387
702
  _zod: core.$ZodEmailInternals;
@@ -454,6 +769,14 @@ export function url(params?: string | core.$ZodURLParams): ZodURL {
454
769
  return core._url(ZodURL, params);
455
770
  }
456
771
 
772
+ export function httpUrl(params?: string | Omit<core.$ZodURLParams, "protocol" | "hostname">): ZodURL {
773
+ return core._url(ZodURL, {
774
+ protocol: regexes.httpProtocol,
775
+ hostname: regexes.domain,
776
+ ...util.normalizeParams(params),
777
+ });
778
+ }
779
+
457
780
  // ZodEmoji
458
781
  export interface ZodEmoji extends ZodStringFormat<"emoji"> {
459
782
  _zod: core.$ZodEmojiInternals;
@@ -483,15 +806,32 @@ export function nanoid(params?: string | core.$ZodNanoIDParams): ZodNanoID {
483
806
  }
484
807
 
485
808
  // ZodCUID
809
+ /**
810
+ * @deprecated CUID v1 is deprecated by its authors due to information leakage
811
+ * (timestamps embedded in the id). Use {@link ZodCUID2} instead.
812
+ * See https://github.com/paralleldrive/cuid.
813
+ */
486
814
  export interface ZodCUID extends ZodStringFormat<"cuid"> {
487
815
  _zod: core.$ZodCUIDInternals;
488
816
  }
817
+ /**
818
+ * @deprecated CUID v1 is deprecated by its authors due to information leakage
819
+ * (timestamps embedded in the id). Use {@link ZodCUID2} instead.
820
+ * See https://github.com/paralleldrive/cuid.
821
+ */
489
822
  export const ZodCUID: core.$constructor<ZodCUID> = /*@__PURE__*/ core.$constructor("ZodCUID", (inst, def) => {
490
823
  // ZodStringFormat.init(inst, def);
491
824
  core.$ZodCUID.init(inst, def);
492
825
  ZodStringFormat.init(inst, def);
493
826
  });
494
827
 
828
+ /**
829
+ * Validates a CUID v1 string.
830
+ *
831
+ * @deprecated CUID v1 is deprecated by its authors due to information leakage
832
+ * (timestamps embedded in the id). Use {@link cuid2 | `z.cuid2()`} instead.
833
+ * See https://github.com/paralleldrive/cuid.
834
+ */
495
835
  export function cuid(params?: string | core.$ZodCUIDParams): ZodCUID {
496
836
  return core._cuid(ZodCUID, params);
497
837
  }
@@ -580,6 +920,19 @@ export function ipv4(params?: string | core.$ZodIPv4Params): ZodIPv4 {
580
920
  return core._ipv4(ZodIPv4, params);
581
921
  }
582
922
 
923
+ // ZodMAC
924
+ export interface ZodMAC extends ZodStringFormat<"mac"> {
925
+ _zod: core.$ZodMACInternals;
926
+ }
927
+ export const ZodMAC: core.$constructor<ZodMAC> = /*@__PURE__*/ core.$constructor("ZodMAC", (inst, def) => {
928
+ // ZodStringFormat.init(inst, def);
929
+ core.$ZodMAC.init(inst, def);
930
+ ZodStringFormat.init(inst, def);
931
+ });
932
+ export function mac(params?: string | core.$ZodMACParams): ZodMAC {
933
+ return core._mac(ZodMAC, params);
934
+ }
935
+
583
936
  // ZodIPv6
584
937
  export interface ZodIPv6 extends ZodStringFormat<"ipv6"> {
585
938
  _zod: core.$ZodIPv6Internals;
@@ -662,6 +1015,35 @@ export function e164(params?: string | core.$ZodE164Params): ZodE164 {
662
1015
  return core._e164(ZodE164, params);
663
1016
  }
664
1017
 
1018
+ // ZodCreditCard
1019
+ export interface ZodCreditCard extends ZodStringFormat<"credit_card"> {
1020
+ _zod: core.$ZodCreditCardInternals;
1021
+ }
1022
+ export const ZodCreditCard: core.$constructor<ZodCreditCard> = /*@__PURE__*/ core.$constructor(
1023
+ "ZodCreditCard",
1024
+ (inst, def) => {
1025
+ core.$ZodCreditCard.init(inst, def);
1026
+ ZodStringFormat.init(inst, def);
1027
+ }
1028
+ );
1029
+
1030
+ export function creditCard(params?: string | core.$ZodCreditCardParams): ZodCreditCard {
1031
+ return core._creditCard(ZodCreditCard, params);
1032
+ }
1033
+
1034
+ // ZodIBAN
1035
+ export interface ZodIBAN extends ZodStringFormat<"iban"> {
1036
+ _zod: core.$ZodIBANInternals;
1037
+ }
1038
+ export const ZodIBAN: core.$constructor<ZodIBAN> = /*@__PURE__*/ core.$constructor("ZodIBAN", (inst, def) => {
1039
+ core.$ZodIBAN.init(inst, def);
1040
+ ZodStringFormat.init(inst, def);
1041
+ });
1042
+
1043
+ export function iban(params?: string | core.$ZodIBANParams): ZodIBAN {
1044
+ return core._iban(ZodIBAN, params);
1045
+ }
1046
+
665
1047
  // ZodJWT
666
1048
  export interface ZodJWT extends ZodStringFormat<"jwt"> {
667
1049
  _zod: core.$ZodJWTInternals;
@@ -681,6 +1063,7 @@ export interface ZodCustomStringFormat<Format extends string = string>
681
1063
  extends ZodStringFormat<Format>,
682
1064
  core.$ZodCustomStringFormat<Format> {
683
1065
  _zod: core.$ZodCustomStringFormatInternals<Format>;
1066
+ "~standard": ZodStandardSchemaWithJSON<this>;
684
1067
  }
685
1068
  export const ZodCustomStringFormat: core.$constructor<ZodCustomStringFormat> = /*@__PURE__*/ core.$constructor(
686
1069
  "ZodCustomStringFormat",
@@ -698,6 +1081,31 @@ export function stringFormat<Format extends string>(
698
1081
  return core._stringFormat(ZodCustomStringFormat, format, fnOrRegex, _params) as any;
699
1082
  }
700
1083
 
1084
+ export function hostname(_params?: string | core.$ZodStringFormatParams): ZodCustomStringFormat<"hostname"> {
1085
+ return core._stringFormat(ZodCustomStringFormat, "hostname", regexes.hostname, _params) as any;
1086
+ }
1087
+
1088
+ export function hex(_params?: string | core.$ZodStringFormatParams): ZodCustomStringFormat<"hex"> {
1089
+ return core._stringFormat(ZodCustomStringFormat, "hex", regexes.hex, _params) as any;
1090
+ }
1091
+
1092
+ export function currencyCode(_params?: string | core.$ZodStringFormatParams): ZodCustomStringFormat<"currency_code"> {
1093
+ return core._stringFormat(ZodCustomStringFormat, "currency_code", regexes.currencyCode, _params) as any;
1094
+ }
1095
+
1096
+ export function hash<Alg extends util.HashAlgorithm, Enc extends util.HashEncoding = "hex">(
1097
+ alg: Alg,
1098
+ params?: {
1099
+ enc?: Enc;
1100
+ } & core.$ZodStringFormatParams
1101
+ ): ZodCustomStringFormat<`${Alg}_${Enc}`> {
1102
+ const enc = params?.enc ?? "hex";
1103
+ const format = `${alg}_${enc}` as const;
1104
+ const regex = core.regexes[format as keyof typeof core.regexes] as RegExp;
1105
+ if (!regex) throw new Error(`Unrecognized hash format: ${format}`);
1106
+ return core._stringFormat(ZodCustomStringFormat, format, regex, params) as any;
1107
+ }
1108
+
701
1109
  // ZodNumber
702
1110
  export interface _ZodNumber<Internals extends core.$ZodNumberInternals = core.$ZodNumberInternals>
703
1111
  extends _ZodType<Internals> {
@@ -735,45 +1143,89 @@ export interface _ZodNumber<Internals extends core.$ZodNumberInternals = core.$Z
735
1143
 
736
1144
  export interface ZodNumber extends _ZodNumber<core.$ZodNumberInternals<number>> {}
737
1145
 
738
- export const ZodNumber: core.$constructor<ZodNumber> = /*@__PURE__*/ core.$constructor("ZodNumber", (inst, def) => {
739
- core.$ZodNumber.init(inst, def);
740
- ZodType.init(inst, def);
1146
+ export const ZodNumber: core.$constructor<ZodNumber> = /*@__PURE__*/ core.$constructor<ZodNumber>(
1147
+ "ZodNumber",
1148
+ (inst, def) => {
1149
+ core.$ZodNumber.init(inst, def);
741
1150
 
742
- inst.gt = (value, params) => inst.check(checks.gt(value, params));
743
- inst.gte = (value, params) => inst.check(checks.gte(value, params));
744
- inst.min = (value, params) => inst.check(checks.gte(value, params));
745
- inst.lt = (value, params) => inst.check(checks.lt(value, params));
746
- inst.lte = (value, params) => inst.check(checks.lte(value, params));
747
- inst.max = (value, params) => inst.check(checks.lte(value, params));
748
- inst.int = (params) => inst.check(int(params));
749
- inst.safe = (params) => inst.check(int(params));
750
- inst.positive = (params) => inst.check(checks.gt(0, params));
751
- inst.nonnegative = (params) => inst.check(checks.gte(0, params));
752
- inst.negative = (params) => inst.check(checks.lt(0, params));
753
- inst.nonpositive = (params) => inst.check(checks.lte(0, params));
754
- inst.multipleOf = (value, params) => inst.check(checks.multipleOf(value, params));
755
- inst.step = (value, params) => inst.check(checks.multipleOf(value, params));
756
-
757
- // inst.finite = (params) => inst.check(core.finite(params));
758
- inst.finite = () => inst;
759
-
760
- const bag = inst._zod.bag;
761
- inst.minValue =
762
- Math.max(bag.minimum ?? Number.NEGATIVE_INFINITY, bag.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null;
763
- inst.maxValue =
764
- Math.min(bag.maximum ?? Number.POSITIVE_INFINITY, bag.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null;
765
- inst.isInt = (bag.format ?? "").includes("int") || Number.isSafeInteger(bag.multipleOf ?? 0.5);
766
- inst.isFinite = true;
767
- inst.format = bag.format ?? null;
768
- });
1151
+ ZodType.init(inst, def);
1152
+
1153
+ inst._zod.processJSONSchema = (ctx, json, params) => processors.numberProcessor(inst, ctx, json, params);
1154
+ inst.isFinite = true;
1155
+ },
1156
+ /*@__PURE__*/ util.derived<ZodNumber>(
1157
+ {
1158
+ minValue: (inst) => {
1159
+ const { minimum, exclusiveMinimum } = processors.aggregateChecks<number>(inst);
1160
+ return Math.max(minimum ?? Number.NEGATIVE_INFINITY, exclusiveMinimum ?? Number.NEGATIVE_INFINITY);
1161
+ },
1162
+ maxValue: (inst) => {
1163
+ const { maximum, exclusiveMaximum } = processors.aggregateChecks<number>(inst);
1164
+ return Math.min(maximum ?? Number.POSITIVE_INFINITY, exclusiveMaximum ?? Number.POSITIVE_INFINITY);
1165
+ },
1166
+ isInt: (inst) => {
1167
+ const { isInt, multipleOf } = processors.aggregateChecks(inst);
1168
+ return !!isInt || !!multipleOf?.some(Number.isSafeInteger);
1169
+ },
1170
+ format: (inst) => processors.aggregateChecks(inst).format ?? null,
1171
+ },
1172
+ {
1173
+ gt(value, params) {
1174
+ return this.check(checks.gt(value, params));
1175
+ },
1176
+ gte(value, params) {
1177
+ return this.check(checks.gte(value, params));
1178
+ },
1179
+ min(value, params) {
1180
+ return this.check(checks.gte(value, params));
1181
+ },
1182
+ lt(value, params) {
1183
+ return this.check(checks.lt(value, params));
1184
+ },
1185
+ lte(value, params) {
1186
+ return this.check(checks.lte(value, params));
1187
+ },
1188
+ max(value, params) {
1189
+ return this.check(checks.lte(value, params));
1190
+ },
1191
+ int(params) {
1192
+ return this.check(int(params));
1193
+ },
1194
+ safe(params) {
1195
+ return this.check(int(params));
1196
+ },
1197
+ positive(params) {
1198
+ return this.check(checks.gt(0, params));
1199
+ },
1200
+ nonnegative(params) {
1201
+ return this.check(checks.gte(0, params));
1202
+ },
1203
+ negative(params) {
1204
+ return this.check(checks.lt(0, params));
1205
+ },
1206
+ nonpositive(params) {
1207
+ return this.check(checks.lte(0, params));
1208
+ },
1209
+ multipleOf(value, params) {
1210
+ return this.check(checks.multipleOf(value, params));
1211
+ },
1212
+ step(value, params) {
1213
+ return this.check(checks.multipleOf(value, params));
1214
+ },
1215
+ finite() {
1216
+ return this;
1217
+ },
1218
+ }
1219
+ )
1220
+ );
769
1221
 
770
1222
  export function number(params?: string | core.$ZodNumberParams): ZodNumber {
771
- return core._number(ZodNumber, params) as any;
1223
+ return core._number(ZodNumber, params);
772
1224
  }
773
1225
 
774
1226
  // ZodNumberFormat
775
- export interface ZodNumberFormat extends ZodNumber {
776
- _zod: core.$ZodNumberFormatInternals;
1227
+ export interface ZodNumberFormat<Format extends $ZodNumberFormats = $ZodNumberFormats> extends ZodNumber {
1228
+ _zod: core.$ZodNumberFormatInternals<Format>;
777
1229
  }
778
1230
  export const ZodNumberFormat: core.$constructor<ZodNumberFormat> = /*@__PURE__*/ core.$constructor(
779
1231
  "ZodNumberFormat",
@@ -784,33 +1236,33 @@ export const ZodNumberFormat: core.$constructor<ZodNumberFormat> = /*@__PURE__*/
784
1236
  );
785
1237
 
786
1238
  // int
787
- export interface ZodInt extends ZodNumberFormat {}
1239
+ export interface ZodInt extends ZodNumberFormat<"safeint"> {}
788
1240
  export function int(params?: string | core.$ZodCheckNumberFormatParams): ZodInt {
789
- return core._int(ZodNumberFormat, params);
1241
+ return core._int(ZodNumberFormat, params) as ZodInt;
790
1242
  }
791
1243
 
792
1244
  // float32
793
- export interface ZodFloat32 extends ZodNumberFormat {}
1245
+ export interface ZodFloat32 extends ZodNumberFormat<"float32"> {}
794
1246
  export function float32(params?: string | core.$ZodCheckNumberFormatParams): ZodFloat32 {
795
- return core._float32(ZodNumberFormat, params);
1247
+ return core._float32(ZodNumberFormat, params) as ZodFloat32;
796
1248
  }
797
1249
 
798
1250
  // float64
799
- export interface ZodFloat64 extends ZodNumberFormat {}
1251
+ export interface ZodFloat64 extends ZodNumberFormat<"float64"> {}
800
1252
  export function float64(params?: string | core.$ZodCheckNumberFormatParams): ZodFloat64 {
801
- return core._float64(ZodNumberFormat, params);
1253
+ return core._float64(ZodNumberFormat, params) as ZodFloat64;
802
1254
  }
803
1255
 
804
1256
  // int32
805
- export interface ZodInt32 extends ZodNumberFormat {}
1257
+ export interface ZodInt32 extends ZodNumberFormat<"int32"> {}
806
1258
  export function int32(params?: string | core.$ZodCheckNumberFormatParams): ZodInt32 {
807
- return core._int32(ZodNumberFormat, params);
1259
+ return core._int32(ZodNumberFormat, params) as ZodInt32;
808
1260
  }
809
1261
 
810
1262
  // uint32
811
- export interface ZodUInt32 extends ZodNumberFormat {}
1263
+ export interface ZodUInt32 extends ZodNumberFormat<"uint32"> {}
812
1264
  export function uint32(params?: string | core.$ZodCheckNumberFormatParams): ZodUInt32 {
813
- return core._uint32(ZodNumberFormat, params);
1265
+ return core._uint32(ZodNumberFormat, params) as ZodUInt32;
814
1266
  }
815
1267
 
816
1268
  // boolean
@@ -819,10 +1271,11 @@ export interface ZodBoolean extends _ZodBoolean<core.$ZodBooleanInternals<boolea
819
1271
  export const ZodBoolean: core.$constructor<ZodBoolean> = /*@__PURE__*/ core.$constructor("ZodBoolean", (inst, def) => {
820
1272
  core.$ZodBoolean.init(inst, def);
821
1273
  ZodType.init(inst, def);
1274
+ inst._zod.processJSONSchema = (ctx, json, params) => processors.booleanProcessor(inst, ctx, json, params);
822
1275
  });
823
1276
 
824
1277
  export function boolean(params?: string | core.$ZodBooleanParams): ZodBoolean {
825
- return core._boolean(ZodBoolean, params) as any;
1278
+ return core._boolean(ZodBoolean, params);
826
1279
  }
827
1280
 
828
1281
  // bigint
@@ -847,38 +1300,65 @@ export interface _ZodBigInt<T extends core.$ZodBigIntInternals = core.$ZodBigInt
847
1300
  }
848
1301
 
849
1302
  export interface ZodBigInt extends _ZodBigInt<core.$ZodBigIntInternals<bigint>> {}
850
- export const ZodBigInt: core.$constructor<ZodBigInt> = /*@__PURE__*/ core.$constructor("ZodBigInt", (inst, def) => {
851
- core.$ZodBigInt.init(inst, def);
852
- ZodType.init(inst, def);
853
-
854
- inst.gte = (value, params) => inst.check(checks.gte(value, params));
855
- inst.min = (value, params) => inst.check(checks.gte(value, params));
856
- inst.gt = (value, params) => inst.check(checks.gt(value, params));
857
- inst.gte = (value, params) => inst.check(checks.gte(value, params));
858
- inst.min = (value, params) => inst.check(checks.gte(value, params));
859
- inst.lt = (value, params) => inst.check(checks.lt(value, params));
860
- inst.lte = (value, params) => inst.check(checks.lte(value, params));
861
- inst.max = (value, params) => inst.check(checks.lte(value, params));
862
- inst.positive = (params) => inst.check(checks.gt(BigInt(0), params));
863
- inst.negative = (params) => inst.check(checks.lt(BigInt(0), params));
864
- inst.nonpositive = (params) => inst.check(checks.lte(BigInt(0), params));
865
- inst.nonnegative = (params) => inst.check(checks.gte(BigInt(0), params));
866
- inst.multipleOf = (value, params) => inst.check(checks.multipleOf(value, params));
867
-
868
- const bag = inst._zod.bag;
869
- inst.minValue = bag.minimum ?? null;
870
- inst.maxValue = bag.maximum ?? null;
871
- inst.format = bag.format ?? null;
872
- });
1303
+ export const ZodBigInt: core.$constructor<ZodBigInt> = /*@__PURE__*/ core.$constructor<ZodBigInt>(
1304
+ "ZodBigInt",
1305
+ (inst, def) => {
1306
+ core.$ZodBigInt.init(inst, def);
1307
+ ZodType.init(inst, def);
1308
+ inst._zod.processJSONSchema = (ctx, json, params) => processors.bigintProcessor(inst, ctx, json, params);
1309
+ },
1310
+ /*@__PURE__*/ util.derived<ZodBigInt>(
1311
+ {
1312
+ minValue: (inst) => processors.aggregateChecks<bigint>(inst).minimum ?? null,
1313
+ maxValue: (inst) => processors.aggregateChecks<bigint>(inst).maximum ?? null,
1314
+ format: (inst) => processors.aggregateChecks(inst).format ?? null,
1315
+ },
1316
+ {
1317
+ gte(value, params) {
1318
+ return this.check(checks.gte(value, params));
1319
+ },
1320
+ min(value, params) {
1321
+ return this.check(checks.gte(value, params));
1322
+ },
1323
+ gt(value, params) {
1324
+ return this.check(checks.gt(value, params));
1325
+ },
1326
+ lt(value, params) {
1327
+ return this.check(checks.lt(value, params));
1328
+ },
1329
+ lte(value, params) {
1330
+ return this.check(checks.lte(value, params));
1331
+ },
1332
+ max(value, params) {
1333
+ return this.check(checks.lte(value, params));
1334
+ },
1335
+ positive(params) {
1336
+ return this.check(checks.gt(BigInt(0), params));
1337
+ },
1338
+ negative(params) {
1339
+ return this.check(checks.lt(BigInt(0), params));
1340
+ },
1341
+ nonpositive(params) {
1342
+ return this.check(checks.lte(BigInt(0), params));
1343
+ },
1344
+ nonnegative(params) {
1345
+ return this.check(checks.gte(BigInt(0), params));
1346
+ },
1347
+ multipleOf(value, params) {
1348
+ return this.check(checks.multipleOf(value, params));
1349
+ },
1350
+ }
1351
+ )
1352
+ );
873
1353
 
874
1354
  export function bigint(params?: string | core.$ZodBigIntParams): ZodBigInt {
875
- return core._bigint(ZodBigInt, params) as any;
1355
+ return core._bigint(ZodBigInt, params);
876
1356
  }
877
1357
  // bigint formats
878
1358
 
879
1359
  // ZodBigIntFormat
880
- export interface ZodBigIntFormat extends ZodBigInt {
881
- _zod: core.$ZodBigIntFormatInternals;
1360
+ export interface ZodBigIntFormat<Format extends $ZodBigIntFormats = $ZodBigIntFormats> extends ZodBigInt {
1361
+ _zod: core.$ZodBigIntFormatInternals<Format>;
882
1362
  }
883
1363
  export const ZodBigIntFormat: core.$constructor<ZodBigIntFormat> = /*@__PURE__*/ core.$constructor(
884
1364
  "ZodBigIntFormat",
@@ -889,13 +1369,15 @@ export const ZodBigIntFormat: core.$constructor<ZodBigIntFormat> = /*@__PURE__*/
889
1369
  );
890
1370
 
891
1371
  // int64
892
- export function int64(params?: string | core.$ZodBigIntFormatParams): ZodBigIntFormat {
893
- return core._int64(ZodBigIntFormat, params);
1372
+ export interface ZodInt64 extends ZodBigIntFormat<"int64"> {}
1373
+ export function int64(params?: string | core.$ZodBigIntFormatParams): ZodInt64 {
1374
+ return core._int64(ZodBigIntFormat, params) as ZodInt64;
894
1375
  }
895
1376
 
896
1377
  // uint64
897
- export function uint64(params?: string | core.$ZodBigIntFormatParams): ZodBigIntFormat {
898
- return core._uint64(ZodBigIntFormat, params);
1378
+ export interface ZodUInt64 extends ZodBigIntFormat<"uint64"> {}
1379
+ export function uint64(params?: string | core.$ZodBigIntFormatParams): ZodUInt64 {
1380
+ return core._uint64(ZodBigIntFormat, params) as ZodUInt64;
899
1381
  }
900
1382
 
901
1383
  // symbol
@@ -903,6 +1385,7 @@ export interface ZodSymbol extends _ZodType<core.$ZodSymbolInternals> {}
903
1385
  export const ZodSymbol: core.$constructor<ZodSymbol> = /*@__PURE__*/ core.$constructor("ZodSymbol", (inst, def) => {
904
1386
  core.$ZodSymbol.init(inst, def);
905
1387
  ZodType.init(inst, def);
1388
+ inst._zod.processJSONSchema = (ctx, json, params) => processors.symbolProcessor(inst, ctx, json, params);
906
1389
  });
907
1390
 
908
1391
  export function symbol(params?: string | core.$ZodSymbolParams): ZodSymbol {
@@ -916,6 +1399,7 @@ export const ZodUndefined: core.$constructor<ZodUndefined> = /*@__PURE__*/ core.
916
1399
  (inst, def) => {
917
1400
  core.$ZodUndefined.init(inst, def);
918
1401
  ZodType.init(inst, def);
1402
+ inst._zod.processJSONSchema = (ctx, json, params) => processors.undefinedProcessor(inst, ctx, json, params);
919
1403
  }
920
1404
  );
921
1405
 
@@ -929,6 +1413,7 @@ export interface ZodNull extends _ZodType<core.$ZodNullInternals> {}
929
1413
  export const ZodNull: core.$constructor<ZodNull> = /*@__PURE__*/ core.$constructor("ZodNull", (inst, def) => {
930
1414
  core.$ZodNull.init(inst, def);
931
1415
  ZodType.init(inst, def);
1416
+ inst._zod.processJSONSchema = (ctx, json, params) => processors.nullProcessor(inst, ctx, json, params);
932
1417
  });
933
1418
 
934
1419
  function _null(params?: string | core.$ZodNullParams): ZodNull {
@@ -941,6 +1426,7 @@ export interface ZodAny extends _ZodType<core.$ZodAnyInternals> {}
941
1426
  export const ZodAny: core.$constructor<ZodAny> = /*@__PURE__*/ core.$constructor("ZodAny", (inst, def) => {
942
1427
  core.$ZodAny.init(inst, def);
943
1428
  ZodType.init(inst, def);
1429
+ inst._zod.processJSONSchema = (ctx, json, params) => processors.anyProcessor(inst, ctx, json, params);
944
1430
  });
945
1431
 
946
1432
  export function any(): ZodAny {
@@ -952,6 +1438,7 @@ export interface ZodUnknown extends _ZodType<core.$ZodUnknownInternals> {}
952
1438
  export const ZodUnknown: core.$constructor<ZodUnknown> = /*@__PURE__*/ core.$constructor("ZodUnknown", (inst, def) => {
953
1439
  core.$ZodUnknown.init(inst, def);
954
1440
  ZodType.init(inst, def);
1441
+ inst._zod.processJSONSchema = (ctx, json, params) => processors.unknownProcessor(inst, ctx, json, params);
955
1442
  });
956
1443
 
957
1444
  export function unknown(): ZodUnknown {
@@ -963,6 +1450,7 @@ export interface ZodNever extends _ZodType<core.$ZodNeverInternals> {}
963
1450
  export const ZodNever: core.$constructor<ZodNever> = /*@__PURE__*/ core.$constructor("ZodNever", (inst, def) => {
964
1451
  core.$ZodNever.init(inst, def);
965
1452
  ZodType.init(inst, def);
1453
+ inst._zod.processJSONSchema = (ctx, json, params) => processors.neverProcessor(inst, ctx, json, params);
966
1454
  });
967
1455
 
968
1456
  export function never(params?: string | core.$ZodNeverParams): ZodNever {
@@ -974,6 +1462,7 @@ export interface ZodVoid extends _ZodType<core.$ZodVoidInternals> {}
974
1462
  export const ZodVoid: core.$constructor<ZodVoid> = /*@__PURE__*/ core.$constructor("ZodVoid", (inst, def) => {
975
1463
  core.$ZodVoid.init(inst, def);
976
1464
  ZodType.init(inst, def);
1465
+ inst._zod.processJSONSchema = (ctx, json, params) => processors.voidProcessor(inst, ctx, json, params);
977
1466
  });
978
1467
 
979
1468
  function _void(params?: string | core.$ZodVoidParams): ZodVoid {
@@ -993,17 +1482,30 @@ export interface _ZodDate<T extends core.$ZodDateInternals = core.$ZodDateIntern
993
1482
  }
994
1483
 
995
1484
  export interface ZodDate extends _ZodDate<core.$ZodDateInternals<Date>> {}
996
- export const ZodDate: core.$constructor<ZodDate> = /*@__PURE__*/ core.$constructor("ZodDate", (inst, def) => {
997
- core.$ZodDate.init(inst, def);
998
- ZodType.init(inst, def);
999
-
1000
- inst.min = (value, params) => inst.check(checks.gte(value, params));
1001
- inst.max = (value, params) => inst.check(checks.lte(value, params));
1485
+ export const ZodDate: core.$constructor<ZodDate> = /*@__PURE__*/ core.$constructor<ZodDate>(
1486
+ "ZodDate",
1487
+ (inst, def) => {
1488
+ core.$ZodDate.init(inst, def);
1489
+ ZodType.init(inst, def);
1490
+ inst._zod.processJSONSchema = (ctx, json, params) => processors.dateProcessor(inst, ctx, json, params);
1002
1491
 
1003
- const c = inst._zod.bag;
1004
- inst.minDate = c.minimum ? new Date(c.minimum) : null;
1005
- inst.maxDate = c.maximum ? new Date(c.maximum) : null;
1006
- });
1492
+ inst.min = (value, params) => inst.check(checks.gte(value, params));
1493
+ inst.max = (value, params) => inst.check(checks.lte(value, params));
1494
+ },
1495
+ /*@__PURE__*/ util.derived<ZodDate>(
1496
+ {
1497
+ minDate: (inst) => {
1498
+ const { minimum } = processors.aggregateChecks<Date>(inst);
1499
+ return minimum ? new Date(minimum) : null;
1500
+ },
1501
+ maxDate: (inst) => {
1502
+ const { maximum } = processors.aggregateChecks<Date>(inst);
1503
+ return maximum ? new Date(maximum) : null;
1504
+ },
1505
+ },
1506
+ {}
1507
+ )
1508
+ );
1007
1509
 
1008
1510
  export function date(params?: string | core.$ZodDateParams): ZodDate {
1009
1511
  return core._date(ZodDate, params);
@@ -1020,38 +1522,66 @@ export interface ZodArray<T extends core.SomeType = core.$ZodType>
1020
1522
  length(len: number, params?: string | core.$ZodCheckLengthEqualsParams): this;
1021
1523
 
1022
1524
  unwrap(): T;
1525
+ "~standard": ZodStandardSchemaWithJSON<this>;
1023
1526
  }
1024
- export const ZodArray: core.$constructor<ZodArray> = /*@__PURE__*/ core.$constructor("ZodArray", (inst, def) => {
1025
- core.$ZodArray.init(inst, def);
1026
- ZodType.init(inst, def);
1027
-
1028
- inst.element = def.element as any;
1029
- inst.min = (minLength, params) => inst.check(checks.minLength(minLength, params));
1030
- inst.nonempty = (params) => inst.check(checks.minLength(1, params));
1031
- inst.max = (maxLength, params) => inst.check(checks.maxLength(maxLength, params));
1032
- inst.length = (len, params) => inst.check(checks.length(len, params));
1527
+ export const ZodArray: core.$constructor<ZodArray> = /*@__PURE__*/ core.$constructor<ZodArray>(
1528
+ "ZodArray",
1529
+ (inst, def) => {
1530
+ _ensureDefaultMemoizer();
1531
+ core.$ZodArray.init(inst, def);
1532
+ ZodType.init(inst, def);
1533
+ inst._zod.processJSONSchema = (ctx, json, params) => processors.arrayProcessor(inst, ctx, json, params);
1033
1534
 
1034
- inst.unwrap = () => inst.element;
1035
- });
1535
+ inst.element = def.element;
1536
+ },
1537
+ {
1538
+ min(n, params) {
1539
+ return this.check(checks.minLength(n, params));
1540
+ },
1541
+ nonempty(params) {
1542
+ return this.check(checks.minLength(1, params));
1543
+ },
1544
+ max(n, params) {
1545
+ return this.check(checks.maxLength(n, params));
1546
+ },
1547
+ length(n, params) {
1548
+ return this.check(checks.length(n, params));
1549
+ },
1550
+ unwrap() {
1551
+ return this.element;
1552
+ },
1553
+ }
1554
+ );
1036
1555
 
1037
1556
  export function array<T extends core.SomeType>(element: T, params?: string | core.$ZodArrayParams): ZodArray<T> {
1038
1557
  return core._array(ZodArray, element as any, params) as any;
1039
1558
  }
1040
1559
 
1041
1560
  // .keyof
1042
- export function keyof<T extends ZodObject>(schema: T): ZodLiteral<Exclude<keyof T["_zod"]["output"], symbol>> {
1561
+ export function keyof<T extends ZodObject>(schema: T): ZodEnum<util.KeysEnum<T["_zod"]["output"]>> {
1043
1562
  const shape = schema._zod.def.shape;
1044
- return literal(Object.keys(shape)) as any;
1563
+ return _enum(Object.keys(shape)) as any;
1045
1564
  }
1046
1565
 
1047
1566
  // ZodObject
1048
1567
 
1568
+ export type SafeExtendShape<Base extends core.$ZodShape, Ext extends core.$ZodLooseShape> = {
1569
+ [K in keyof Ext]: K extends keyof Base
1570
+ ? core.output<Ext[K]> extends core.output<Base[K]>
1571
+ ? core.input<Ext[K]> extends core.input<Base[K]>
1572
+ ? Ext[K]
1573
+ : never
1574
+ : never
1575
+ : Ext[K];
1576
+ };
1577
+
1049
1578
  export interface ZodObject<
1050
1579
  /** @ts-ignore Cast variance */
1051
1580
  out Shape extends core.$ZodShape = core.$ZodLooseShape,
1052
1581
  out Config extends core.$ZodObjectConfig = core.$strip,
1053
1582
  > extends _ZodType<core.$ZodObjectInternals<Shape, Config>>,
1054
1583
  core.$ZodObject<Shape, Config> {
1584
+ "~standard": ZodStandardSchemaWithJSON<this>;
1055
1585
  shape: Shape;
1056
1586
 
1057
1587
  keyof(): ZodEnum<util.ToEnum<keyof Shape & string>>;
@@ -1069,44 +1599,36 @@ export interface ZodObject<
1069
1599
  /** This is the default behavior. This method call is likely unnecessary. */
1070
1600
  strip(): ZodObject<Shape, core.$strip>;
1071
1601
 
1072
- extend<U extends core.$ZodLooseShape & Partial<Record<keyof Shape, core.SomeType>>>(
1073
- shape: U
1074
- ): ZodObject<util.Extend<Shape, U>, Config>;
1602
+ extend<U extends core.$ZodLooseShape>(shape: U): ZodObject<util.Extend<Shape, util.Writeable<U>>, Config>;
1603
+
1604
+ safeExtend<U extends core.$ZodLooseShape>(
1605
+ shape: SafeExtendShape<Shape, U> & Partial<Record<keyof Shape, core.SomeType>>
1606
+ ): ZodObject<util.Extend<Shape, util.Writeable<U>>, Config>;
1075
1607
 
1076
1608
  /**
1077
- * @deprecated Use spread syntax and the `.shape` property to combine two object schemas:
1078
- *
1079
- * ```ts
1080
- * const A = z.object({ a: z.string() });
1081
- * const B = z.object({ b: z.number() });
1082
- *
1083
- * const C = z.object({
1084
- * ...A.shape,
1085
- * ...B.shape
1086
- * });
1087
- * ```
1609
+ * @deprecated Use [`A.extend(B.shape)`](https://zod.dev/api?id=extend) instead.
1088
1610
  */
1089
1611
  merge<U extends ZodObject>(other: U): ZodObject<util.Extend<Shape, U["shape"]>, U["_zod"]["config"]>;
1090
1612
 
1091
1613
  pick<M extends util.Mask<keyof Shape>>(
1092
- mask: M
1614
+ mask: M & Record<Exclude<keyof M, keyof Shape>, never>
1093
1615
  ): ZodObject<util.Flatten<Pick<Shape, Extract<keyof Shape, keyof M>>>, Config>;
1094
1616
 
1095
1617
  omit<M extends util.Mask<keyof Shape>>(
1096
- mask: M
1618
+ mask: M & Record<Exclude<keyof M, keyof Shape>, never>
1097
1619
  ): ZodObject<util.Flatten<Omit<Shape, Extract<keyof Shape, keyof M>>>, Config>;
1098
1620
 
1099
1621
  partial(): ZodObject<
1100
1622
  {
1101
- [k in keyof Shape]: ZodOptional<Shape[k]>;
1623
+ -readonly [k in keyof Shape]: ZodOptional<Shape[k]>;
1102
1624
  },
1103
1625
  Config
1104
1626
  >;
1105
1627
  partial<M extends util.Mask<keyof Shape>>(
1106
- mask: M
1628
+ mask: M & Record<Exclude<keyof M, keyof Shape>, never>
1107
1629
  ): ZodObject<
1108
1630
  {
1109
- [k in keyof Shape]: k extends keyof M
1631
+ -readonly [k in keyof Shape]: k extends keyof M
1110
1632
  ? // Shape[k] extends OptionalInSchema
1111
1633
  // ? Shape[k]
1112
1634
  // :
@@ -1116,45 +1638,95 @@ export interface ZodObject<
1116
1638
  Config
1117
1639
  >;
1118
1640
 
1641
+ // exactPartial
1642
+ exactPartial(): ZodObject<
1643
+ {
1644
+ -readonly [k in keyof Shape]: ZodExactOptional<Shape[k]>;
1645
+ },
1646
+ Config
1647
+ >;
1648
+ exactPartial<M extends util.Mask<keyof Shape>>(
1649
+ mask: M & Record<Exclude<keyof M, keyof Shape>, never>
1650
+ ): ZodObject<
1651
+ {
1652
+ -readonly [k in keyof Shape]: k extends keyof M ? ZodExactOptional<Shape[k]> : Shape[k];
1653
+ },
1654
+ Config
1655
+ >;
1656
+
1119
1657
  // required
1120
1658
  required(): ZodObject<
1121
1659
  {
1122
- [k in keyof Shape]: ZodNonOptional<Shape[k]>;
1660
+ -readonly [k in keyof Shape]: ZodNonOptional<Shape[k]>;
1123
1661
  },
1124
1662
  Config
1125
1663
  >;
1126
1664
  required<M extends util.Mask<keyof Shape>>(
1127
- mask: M
1665
+ mask: M & Record<Exclude<keyof M, keyof Shape>, never>
1128
1666
  ): ZodObject<
1129
1667
  {
1130
- [k in keyof Shape]: k extends keyof M ? ZodNonOptional<Shape[k]> : Shape[k];
1668
+ -readonly [k in keyof Shape]: k extends keyof M ? ZodNonOptional<Shape[k]> : Shape[k];
1131
1669
  },
1132
1670
  Config
1133
1671
  >;
1134
1672
  }
1135
1673
 
1136
- export const ZodObject: core.$constructor<ZodObject> = /*@__PURE__*/ core.$constructor("ZodObject", (inst, def) => {
1137
- core.$ZodObject.init(inst, def);
1138
- ZodType.init(inst, def);
1674
+ export const ZodObject: core.$constructor<ZodObject> = /*@__PURE__*/ core.$constructor<ZodObject>(
1675
+ "ZodObject",
1676
+ (inst, def) => {
1677
+ _ensureDefaultMemoizer();
1678
+ core.$ZodObjectJIT.init(inst, def);
1679
+ ZodType.init(inst, def);
1680
+ inst._zod.processJSONSchema = (ctx, json, params) => processors.objectProcessor(inst, ctx, json, params);
1139
1681
 
1140
- util.defineLazy(inst, "shape", () => def.shape);
1141
- inst.keyof = () => _enum(Object.keys(inst._zod.def.shape)) as any;
1142
- inst.catchall = (catchall) => inst.clone({ ...inst._zod.def, catchall: catchall as any as core.$ZodType }) as any;
1143
- inst.passthrough = () => inst.clone({ ...inst._zod.def, catchall: unknown() });
1144
- // inst.nonstrict = () => inst.clone({ ...inst._zod.def, catchall: api.unknown() });
1145
- inst.loose = () => inst.clone({ ...inst._zod.def, catchall: unknown() });
1146
- inst.strict = () => inst.clone({ ...inst._zod.def, catchall: never() });
1147
- inst.strip = () => inst.clone({ ...inst._zod.def, catchall: undefined });
1148
-
1149
- inst.extend = (incoming: any) => {
1150
- return util.extend(inst, incoming);
1151
- };
1152
- inst.merge = (other) => util.merge(inst, other);
1153
- inst.pick = (mask) => util.pick(inst, mask);
1154
- inst.omit = (mask) => util.omit(inst, mask);
1155
- inst.partial = (...args: any[]) => util.partial(ZodOptional, inst, args[0] as object);
1156
- inst.required = (...args: any[]) => util.required(ZodNonOptional, inst, args[0] as object);
1157
- });
1682
+ util.installLazyProp(inst, "shape", (self) => self._zod.def.shape, false);
1683
+ },
1684
+ {
1685
+ keyof() {
1686
+ return _enum(Object.keys(this._zod.def.shape));
1687
+ },
1688
+ catchall(catchall) {
1689
+ // `mergeDefs` rather than a spread: spreading reads `shape`, and resolving it can mint a whole fresh subtree
1690
+ return this.clone(util.mergeDefs(this._zod.def, { catchall: catchall as any }));
1691
+ },
1692
+ passthrough() {
1693
+ return this.clone(util.mergeDefs(this._zod.def, { catchall: unknown() }));
1694
+ },
1695
+ loose() {
1696
+ return this.clone(util.mergeDefs(this._zod.def, { catchall: unknown() }));
1697
+ },
1698
+ strict() {
1699
+ return this.clone(util.mergeDefs(this._zod.def, { catchall: never() }));
1700
+ },
1701
+ strip() {
1702
+ return this.clone(util.mergeDefs(this._zod.def, { catchall: undefined }));
1703
+ },
1704
+ extend(incoming) {
1705
+ return util.extend(this, incoming);
1706
+ },
1707
+ safeExtend(incoming) {
1708
+ return util.safeExtend(this, incoming);
1709
+ },
1710
+ merge(other) {
1711
+ return util.merge(this, other);
1712
+ },
1713
+ pick(mask) {
1714
+ return util.pick(this, mask);
1715
+ },
1716
+ omit(mask) {
1717
+ return util.omit(this, mask);
1718
+ },
1719
+ partial(...args) {
1720
+ return util.partial(ZodOptional, this, args[0]);
1721
+ },
1722
+ exactPartial(...args) {
1723
+ return util.partial(ZodExactOptional, this, args[0], "exactPartial");
1724
+ },
1725
+ required(...args) {
1726
+ return util.required(ZodNonOptional, this, args[0]);
1727
+ },
1728
+ }
1729
+ );
1158
1730
 
1159
1731
  export function object<T extends core.$ZodLooseShape = Partial<Record<never, core.SomeType>>>(
1160
1732
  shape?: T,
@@ -1162,10 +1734,7 @@ export function object<T extends core.$ZodLooseShape = Partial<Record<never, cor
1162
1734
  ): ZodObject<util.Writeable<T>, core.$strip> {
1163
1735
  const def: core.$ZodObjectDef = {
1164
1736
  type: "object",
1165
- get shape() {
1166
- util.assignProp(this, "shape", { ...shape });
1167
- return this.shape;
1168
- },
1737
+ shape: shape ?? {},
1169
1738
  ...util.normalizeParams(params),
1170
1739
  };
1171
1740
  return new ZodObject(def) as any;
@@ -1176,13 +1745,10 @@ export function object<T extends core.$ZodLooseShape = Partial<Record<never, cor
1176
1745
  export function strictObject<T extends core.$ZodLooseShape>(
1177
1746
  shape: T,
1178
1747
  params?: string | core.$ZodObjectParams
1179
- ): ZodObject<T, core.$strict> {
1748
+ ): ZodObject<util.Writeable<T>, core.$strict> {
1180
1749
  return new ZodObject({
1181
1750
  type: "object",
1182
- get shape() {
1183
- util.assignProp(this, "shape", { ...shape });
1184
- return this.shape;
1185
- },
1751
+ shape,
1186
1752
  catchall: never(),
1187
1753
  ...util.normalizeParams(params),
1188
1754
  }) as any;
@@ -1193,13 +1759,10 @@ export function strictObject<T extends core.$ZodLooseShape>(
1193
1759
  export function looseObject<T extends core.$ZodLooseShape>(
1194
1760
  shape: T,
1195
1761
  params?: string | core.$ZodObjectParams
1196
- ): ZodObject<T, core.$loose> {
1762
+ ): ZodObject<util.Writeable<T>, core.$loose> {
1197
1763
  return new ZodObject({
1198
1764
  type: "object",
1199
- get shape() {
1200
- util.assignProp(this, "shape", { ...shape });
1201
- return this.shape;
1202
- },
1765
+ shape,
1203
1766
  catchall: unknown(),
1204
1767
  ...util.normalizeParams(params),
1205
1768
  }) as any;
@@ -1209,11 +1772,13 @@ export function looseObject<T extends core.$ZodLooseShape>(
1209
1772
  export interface ZodUnion<T extends readonly core.SomeType[] = readonly core.$ZodType[]>
1210
1773
  extends _ZodType<core.$ZodUnionInternals<T>>,
1211
1774
  core.$ZodUnion<T> {
1775
+ "~standard": ZodStandardSchemaWithJSON<this>;
1212
1776
  options: T;
1213
1777
  }
1214
1778
  export const ZodUnion: core.$constructor<ZodUnion> = /*@__PURE__*/ core.$constructor("ZodUnion", (inst, def) => {
1215
1779
  core.$ZodUnion.init(inst, def);
1216
1780
  ZodType.init(inst, def);
1781
+ inst._zod.processJSONSchema = (ctx, json, params) => processors.unionProcessor(inst, ctx, json, params);
1217
1782
  inst.options = def.options;
1218
1783
  });
1219
1784
 
@@ -1228,11 +1793,44 @@ export function union<const T extends readonly core.SomeType[]>(
1228
1793
  }) as any;
1229
1794
  }
1230
1795
 
1796
+ // ZodXor
1797
+ export interface ZodXor<T extends readonly core.SomeType[] = readonly core.$ZodType[]>
1798
+ extends _ZodType<core.$ZodXorInternals<T>>,
1799
+ core.$ZodXor<T> {
1800
+ "~standard": ZodStandardSchemaWithJSON<this>;
1801
+ options: T;
1802
+ }
1803
+ export const ZodXor: core.$constructor<ZodXor> = /*@__PURE__*/ core.$constructor("ZodXor", (inst, def) => {
1804
+ ZodUnion.init(inst, def);
1805
+ core.$ZodXor.init(inst, def);
1806
+ inst._zod.processJSONSchema = (ctx, json, params) => processors.unionProcessor(inst, ctx, json, params);
1807
+ inst.options = def.options;
1808
+ });
1809
+
1810
+ /** Creates an exclusive union (XOR) where exactly one option must match.
1811
+ * Unlike regular unions that succeed when any option matches, xor fails if
1812
+ * zero or more than one option matches the input. */
1813
+ export function xor<const T extends readonly core.SomeType[]>(
1814
+ options: T,
1815
+ params?: string | core.$ZodXorParams
1816
+ ): ZodXor<T> {
1817
+ return new ZodXor({
1818
+ type: "union",
1819
+ options: options as any as core.$ZodType[],
1820
+ inclusive: false,
1821
+ ...util.normalizeParams(params),
1822
+ }) as any;
1823
+ }
1824
+
1231
1825
  // ZodDiscriminatedUnion
1232
- export interface ZodDiscriminatedUnion<Options extends readonly core.SomeType[] = readonly core.$ZodType[]>
1233
- extends ZodUnion<Options>,
1234
- core.$ZodDiscriminatedUnion<Options> {
1235
- _zod: core.$ZodDiscriminatedUnionInternals<Options>;
1826
+ export interface ZodDiscriminatedUnion<
1827
+ Options extends readonly core.SomeType[] = readonly core.$ZodType[],
1828
+ Disc extends string = string,
1829
+ > extends ZodUnion<Options>,
1830
+ core.$ZodDiscriminatedUnion<Options, Disc> {
1831
+ "~standard": ZodStandardSchemaWithJSON<this>;
1832
+ _zod: core.$ZodDiscriminatedUnionInternals<Options, Disc>;
1833
+ def: core.$ZodDiscriminatedUnionDef<Options, Disc>;
1236
1834
  }
1237
1835
  export const ZodDiscriminatedUnion: core.$constructor<ZodDiscriminatedUnion> = /*@__PURE__*/ core.$constructor(
1238
1836
  "ZodDiscriminatedUnion",
@@ -1244,15 +1842,16 @@ export const ZodDiscriminatedUnion: core.$constructor<ZodDiscriminatedUnion> = /
1244
1842
 
1245
1843
  export function discriminatedUnion<
1246
1844
  Types extends readonly [core.$ZodTypeDiscriminable, ...core.$ZodTypeDiscriminable[]],
1845
+ Disc extends string,
1247
1846
  >(
1248
- discriminator: string,
1847
+ discriminator: Disc,
1249
1848
  options: Types,
1250
1849
  params?: string | core.$ZodDiscriminatedUnionParams
1251
- ): ZodDiscriminatedUnion<Types> {
1850
+ ): ZodDiscriminatedUnion<Types, Disc> {
1252
1851
  // const [options, params] = args;
1253
1852
  return new ZodDiscriminatedUnion({
1254
1853
  type: "union",
1255
- options,
1854
+ options: options as any as core.$ZodType[],
1256
1855
  discriminator,
1257
1856
  ...util.normalizeParams(params),
1258
1857
  }) as any;
@@ -1261,12 +1860,15 @@ export function discriminatedUnion<
1261
1860
  // ZodIntersection
1262
1861
  export interface ZodIntersection<A extends core.SomeType = core.$ZodType, B extends core.SomeType = core.$ZodType>
1263
1862
  extends _ZodType<core.$ZodIntersectionInternals<A, B>>,
1264
- core.$ZodIntersection<A, B> {}
1863
+ core.$ZodIntersection<A, B> {
1864
+ "~standard": ZodStandardSchemaWithJSON<this>;
1865
+ }
1265
1866
  export const ZodIntersection: core.$constructor<ZodIntersection> = /*@__PURE__*/ core.$constructor(
1266
1867
  "ZodIntersection",
1267
1868
  (inst, def) => {
1268
1869
  core.$ZodIntersection.init(inst, def);
1269
1870
  ZodType.init(inst, def);
1871
+ inst._zod.processJSONSchema = (ctx, json, params) => processors.intersectionProcessor(inst, ctx, json, params);
1270
1872
  }
1271
1873
  );
1272
1874
 
@@ -1287,17 +1889,36 @@ export interface ZodTuple<
1287
1889
  Rest extends core.SomeType | null = core.$ZodType | null,
1288
1890
  > extends _ZodType<core.$ZodTupleInternals<T, Rest>>,
1289
1891
  core.$ZodTuple<T, Rest> {
1892
+ "~standard": ZodStandardSchemaWithJSON<this>;
1290
1893
  rest<Rest extends core.SomeType = core.$ZodType>(rest: Rest): ZodTuple<T, Rest>;
1894
+ partial(): ZodTuple<{ -readonly [k in keyof T]: ZodOptional<T[k]> }, Rest>;
1291
1895
  }
1292
- export const ZodTuple: core.$constructor<ZodTuple> = /*@__PURE__*/ core.$constructor("ZodTuple", (inst, def) => {
1293
- core.$ZodTuple.init(inst, def);
1294
- ZodType.init(inst, def);
1295
- inst.rest = (rest) =>
1296
- inst.clone({
1297
- ...inst._zod.def,
1298
- rest: rest as any as core.$ZodType,
1299
- }) as any;
1300
- });
1896
+ export const ZodTuple: core.$constructor<ZodTuple> = /*@__PURE__*/ core.$constructor<ZodTuple>(
1897
+ "ZodTuple",
1898
+ (inst, def) => {
1899
+ _ensureDefaultMemoizer();
1900
+ core.$ZodTuple.init(inst, def);
1901
+ ZodType.init(inst, def);
1902
+ inst._zod.processJSONSchema = (ctx, json, params) => processors.tupleProcessor(inst, ctx, json, params);
1903
+ },
1904
+ {
1905
+ rest(rest) {
1906
+ return this.clone({
1907
+ ...this._zod.def,
1908
+ rest: rest as any as core.$ZodType,
1909
+ }) as any;
1910
+ },
1911
+ partial() {
1912
+ const def = this._zod.def;
1913
+ // a refinement was authored against the full arity; partialing would run it on a shorter array
1914
+ if (def.checks?.length) throw new Error(".partial() cannot be used on tuple schemas containing refinements");
1915
+ return this.clone({
1916
+ ...def,
1917
+ items: def.items.map((item) => new ZodOptional({ type: "optional", innerType: item })),
1918
+ }) as any;
1919
+ },
1920
+ }
1921
+ );
1301
1922
 
1302
1923
  export function tuple<T extends readonly [core.SomeType, ...core.SomeType[]]>(
1303
1924
  items: T,
@@ -1331,12 +1952,15 @@ export interface ZodRecord<
1331
1952
  Value extends core.SomeType = core.$ZodType,
1332
1953
  > extends _ZodType<core.$ZodRecordInternals<Key, Value>>,
1333
1954
  core.$ZodRecord<Key, Value> {
1955
+ "~standard": ZodStandardSchemaWithJSON<this>;
1334
1956
  keyType: Key;
1335
1957
  valueType: Value;
1336
1958
  }
1337
1959
  export const ZodRecord: core.$constructor<ZodRecord> = /*@__PURE__*/ core.$constructor("ZodRecord", (inst, def) => {
1960
+ _ensureDefaultMemoizer();
1338
1961
  core.$ZodRecord.init(inst, def);
1339
1962
  ZodType.init(inst, def);
1963
+ inst._zod.processJSONSchema = (ctx, json, params) => processors.recordProcessor(inst, ctx, json, params);
1340
1964
 
1341
1965
  inst.keyType = def.keyType;
1342
1966
  inst.valueType = def.valueType;
@@ -1347,6 +1971,15 @@ export function record<Key extends core.$ZodRecordKey, Value extends core.SomeTy
1347
1971
  valueType: Value,
1348
1972
  params?: string | core.$ZodRecordParams
1349
1973
  ): ZodRecord<Key, Value> {
1974
+ // v3-compat: z.record(valueType, params?) — defaults keyType to z.string()
1975
+ if (!valueType || !(valueType as any)._zod) {
1976
+ return new ZodRecord({
1977
+ type: "record",
1978
+ keyType: string() as any,
1979
+ valueType: keyType as any as core.$ZodType,
1980
+ ...util.normalizeParams(valueType as string | core.$ZodRecordParams | undefined),
1981
+ }) as any;
1982
+ }
1350
1983
  return new ZodRecord({
1351
1984
  type: "record",
1352
1985
  keyType,
@@ -1362,9 +1995,24 @@ export function partialRecord<Key extends core.$ZodRecordKey, Value extends core
1362
1995
  ): ZodRecord<Key & core.$partial, Value> {
1363
1996
  return new ZodRecord({
1364
1997
  type: "record",
1365
- keyType: union([keyType, never()]),
1998
+ keyType,
1366
1999
  valueType: valueType as any,
1367
2000
  ...util.normalizeParams(params),
2001
+ partial: true,
2002
+ }) as any;
2003
+ }
2004
+
2005
+ export function looseRecord<Key extends core.$ZodRecordKey, Value extends core.SomeType>(
2006
+ keyType: Key,
2007
+ valueType: Value,
2008
+ params?: string | core.$ZodRecordParams
2009
+ ): ZodRecord<Key, Value> {
2010
+ return new ZodRecord({
2011
+ type: "record",
2012
+ keyType,
2013
+ valueType: valueType as any as core.$ZodType,
2014
+ mode: "loose",
2015
+ ...util.normalizeParams(params),
1368
2016
  }) as any;
1369
2017
  }
1370
2018
 
@@ -1372,14 +2020,25 @@ export function partialRecord<Key extends core.$ZodRecordKey, Value extends core
1372
2020
  export interface ZodMap<Key extends core.SomeType = core.$ZodType, Value extends core.SomeType = core.$ZodType>
1373
2021
  extends _ZodType<core.$ZodMapInternals<Key, Value>>,
1374
2022
  core.$ZodMap<Key, Value> {
2023
+ "~standard": ZodStandardSchemaWithJSON<this>;
1375
2024
  keyType: Key;
1376
2025
  valueType: Value;
2026
+ min(minSize: number, params?: string | core.$ZodCheckMinSizeParams): this;
2027
+ nonempty(params?: string | core.$ZodCheckMinSizeParams): this;
2028
+ max(maxSize: number, params?: string | core.$ZodCheckMaxSizeParams): this;
2029
+ size(size: number, params?: string | core.$ZodCheckSizeEqualsParams): this;
1377
2030
  }
1378
2031
  export const ZodMap: core.$constructor<ZodMap> = /*@__PURE__*/ core.$constructor("ZodMap", (inst, def) => {
2032
+ _ensureDefaultMemoizer();
1379
2033
  core.$ZodMap.init(inst, def);
1380
2034
  ZodType.init(inst, def);
2035
+ inst._zod.processJSONSchema = (ctx, json, params) => processors.mapProcessor(inst, ctx, json, params);
1381
2036
  inst.keyType = def.keyType;
1382
2037
  inst.valueType = def.valueType;
2038
+ inst.min = (...args) => inst.check(core._minSize(...args));
2039
+ inst.nonempty = (params) => inst.check(core._minSize(1, params));
2040
+ inst.max = (...args) => inst.check(core._maxSize(...args));
2041
+ inst.size = (...args) => inst.check(core._size(...args));
1383
2042
  });
1384
2043
 
1385
2044
  export function map<Key extends core.SomeType, Value extends core.SomeType>(
@@ -1399,15 +2058,17 @@ export function map<Key extends core.SomeType, Value extends core.SomeType>(
1399
2058
  export interface ZodSet<T extends core.SomeType = core.$ZodType>
1400
2059
  extends _ZodType<core.$ZodSetInternals<T>>,
1401
2060
  core.$ZodSet<T> {
2061
+ "~standard": ZodStandardSchemaWithJSON<this>;
1402
2062
  min(minSize: number, params?: string | core.$ZodCheckMinSizeParams): this;
1403
- /** */
1404
2063
  nonempty(params?: string | core.$ZodCheckMinSizeParams): this;
1405
2064
  max(maxSize: number, params?: string | core.$ZodCheckMaxSizeParams): this;
1406
2065
  size(size: number, params?: string | core.$ZodCheckSizeEqualsParams): this;
1407
2066
  }
1408
2067
  export const ZodSet: core.$constructor<ZodSet> = /*@__PURE__*/ core.$constructor("ZodSet", (inst, def) => {
2068
+ _ensureDefaultMemoizer();
1409
2069
  core.$ZodSet.init(inst, def);
1410
2070
  ZodType.init(inst, def);
2071
+ inst._zod.processJSONSchema = (ctx, json, params) => processors.setProcessor(inst, ctx, json, params);
1411
2072
 
1412
2073
  inst.min = (...args) => inst.check(core._minSize(...args));
1413
2074
  inst.nonempty = (params) => inst.check(core._minSize(1, params));
@@ -1432,6 +2093,7 @@ export interface ZodEnum<
1432
2093
  out T extends util.EnumLike = util.EnumLike,
1433
2094
  > extends _ZodType<core.$ZodEnumInternals<T>>,
1434
2095
  core.$ZodEnum<T> {
2096
+ "~standard": ZodStandardSchemaWithJSON<this>;
1435
2097
  enum: T;
1436
2098
  options: Array<T[keyof T]>;
1437
2099
 
@@ -1447,9 +2109,11 @@ export interface ZodEnum<
1447
2109
  export const ZodEnum: core.$constructor<ZodEnum> = /*@__PURE__*/ core.$constructor("ZodEnum", (inst, def) => {
1448
2110
  core.$ZodEnum.init(inst, def);
1449
2111
  ZodType.init(inst, def);
2112
+ inst._zod.processJSONSchema = (ctx, json, params) => processors.enumProcessor(inst, ctx, json, params);
1450
2113
 
1451
2114
  inst.enum = def.entries;
1452
- inst.options = Object.values(def.entries);
2115
+ // reuse the parsed value set so a numeric TS enum's reverse-mapping keys stay out
2116
+ inst.options = [...inst._zod.values] as util.EnumValue[];
1453
2117
 
1454
2118
  const keys = new Set(Object.keys(def.entries));
1455
2119
 
@@ -1512,13 +2176,14 @@ export function nativeEnum<T extends util.EnumLike>(entries: T, params?: string
1512
2176
  type: "enum",
1513
2177
  entries,
1514
2178
  ...util.normalizeParams(params),
1515
- }) as any as ZodEnum<T>;
2179
+ }) as ZodEnum<T>;
1516
2180
  }
1517
2181
 
1518
2182
  // ZodLiteral
1519
2183
  export interface ZodLiteral<T extends util.Literal = util.Literal>
1520
2184
  extends _ZodType<core.$ZodLiteralInternals<T>>,
1521
2185
  core.$ZodLiteral<T> {
2186
+ "~standard": ZodStandardSchemaWithJSON<this>;
1522
2187
  values: Set<T>;
1523
2188
  /** @legacy Use `.values` instead. Accessing this property will throw an error if the literal accepts multiple values. */
1524
2189
  value: T;
@@ -1526,6 +2191,7 @@ export interface ZodLiteral<T extends util.Literal = util.Literal>
1526
2191
  export const ZodLiteral: core.$constructor<ZodLiteral> = /*@__PURE__*/ core.$constructor("ZodLiteral", (inst, def) => {
1527
2192
  core.$ZodLiteral.init(inst, def);
1528
2193
  ZodType.init(inst, def);
2194
+ inst._zod.processJSONSchema = (ctx, json, params) => processors.literalProcessor(inst, ctx, json, params);
1529
2195
  inst.values = new Set(def.values);
1530
2196
  Object.defineProperty(inst, "value", {
1531
2197
  get() {
@@ -1555,6 +2221,7 @@ export function literal(value: any, params: any) {
1555
2221
 
1556
2222
  // ZodFile
1557
2223
  export interface ZodFile extends _ZodType<core.$ZodFileInternals>, core.$ZodFile {
2224
+ "~standard": ZodStandardSchemaWithJSON<this>;
1558
2225
  min(size: number, params?: string | core.$ZodCheckMinSizeParams): this;
1559
2226
  max(size: number, params?: string | core.$ZodCheckMaxSizeParams): this;
1560
2227
  mime(types: util.MimeTypes | Array<util.MimeTypes>, params?: string | core.$ZodCheckMimeTypeParams): this;
@@ -1562,6 +2229,7 @@ export interface ZodFile extends _ZodType<core.$ZodFileInternals>, core.$ZodFile
1562
2229
  export const ZodFile: core.$constructor<ZodFile> = /*@__PURE__*/ core.$constructor("ZodFile", (inst, def) => {
1563
2230
  core.$ZodFile.init(inst, def);
1564
2231
  ZodType.init(inst, def);
2232
+ inst._zod.processJSONSchema = (ctx, json, params) => processors.fileProcessor(inst, ctx, json, params);
1565
2233
 
1566
2234
  inst.min = (size, params) => inst.check(core._minSize(size, params));
1567
2235
  inst.max = (size, params) => inst.check(core._maxSize(size, params));
@@ -1575,15 +2243,23 @@ export function file(params?: string | core.$ZodFileParams): ZodFile {
1575
2243
  // ZodTransform
1576
2244
  export interface ZodTransform<O = unknown, I = unknown>
1577
2245
  extends _ZodType<core.$ZodTransformInternals<O, I>>,
1578
- core.$ZodTransform<O, I> {}
2246
+ core.$ZodTransform<O, I> {
2247
+ "~standard": ZodStandardSchemaWithJSON<this>;
2248
+ }
1579
2249
  export const ZodTransform: core.$constructor<ZodTransform> = /*@__PURE__*/ core.$constructor(
1580
2250
  "ZodTransform",
1581
2251
  (inst, def) => {
2252
+ _ensureDefaultMemoizer();
1582
2253
  core.$ZodTransform.init(inst, def);
1583
2254
  ZodType.init(inst, def);
2255
+ inst._zod.processJSONSchema = (ctx, json, params) => processors.transformProcessor(inst, ctx, json, params);
1584
2256
 
1585
2257
  inst._zod.parse = (payload, _ctx) => {
1586
- (payload as RefinementCtx).addIssue = (issue) => {
2258
+ if (_ctx.direction === "backward") {
2259
+ throw new core.$ZodEncodeError(inst.constructor.name);
2260
+ }
2261
+
2262
+ (payload as core.$RefinementCtx).addIssue = (issue) => {
1587
2263
  if (typeof issue === "string") {
1588
2264
  payload.issues.push(util.issue(issue, payload.value, def));
1589
2265
  } else {
@@ -1592,9 +2268,9 @@ export const ZodTransform: core.$constructor<ZodTransform> = /*@__PURE__*/ core.
1592
2268
 
1593
2269
  if (_issue.fatal) _issue.continue = false;
1594
2270
  _issue.code ??= "custom";
1595
- _issue.input ??= payload.value;
2271
+ if (!("input" in _issue)) _issue.input = payload.value;
1596
2272
  _issue.inst ??= inst;
1597
- _issue.continue ??= true;
2273
+ // _issue.continue ??= true;
1598
2274
  payload.issues.push(util.issue(_issue));
1599
2275
  }
1600
2276
  };
@@ -1613,7 +2289,7 @@ export const ZodTransform: core.$constructor<ZodTransform> = /*@__PURE__*/ core.
1613
2289
  );
1614
2290
 
1615
2291
  export function transform<I = unknown, O = I>(
1616
- fn: (input: I, ctx: core.ParsePayload) => O
2292
+ fn: (input: I, ctx: core.$RefinementCtx) => O
1617
2293
  ): ZodTransform<Awaited<O>, I> {
1618
2294
  return new ZodTransform({
1619
2295
  type: "transform",
@@ -1625,6 +2301,7 @@ export function transform<I = unknown, O = I>(
1625
2301
  export interface ZodOptional<T extends core.SomeType = core.$ZodType>
1626
2302
  extends _ZodType<core.$ZodOptionalInternals<T>>,
1627
2303
  core.$ZodOptional<T> {
2304
+ "~standard": ZodStandardSchemaWithJSON<this>;
1628
2305
  unwrap(): T;
1629
2306
  }
1630
2307
  export const ZodOptional: core.$constructor<ZodOptional> = /*@__PURE__*/ core.$constructor(
@@ -1632,6 +2309,7 @@ export const ZodOptional: core.$constructor<ZodOptional> = /*@__PURE__*/ core.$c
1632
2309
  (inst, def) => {
1633
2310
  core.$ZodOptional.init(inst, def);
1634
2311
  ZodType.init(inst, def);
2312
+ inst._zod.processJSONSchema = (ctx, json, params) => processors.optionalProcessor(inst, ctx, json, params);
1635
2313
 
1636
2314
  inst.unwrap = () => inst._zod.def.innerType;
1637
2315
  }
@@ -1644,10 +2322,36 @@ export function optional<T extends core.SomeType>(innerType: T): ZodOptional<T>
1644
2322
  }) as any;
1645
2323
  }
1646
2324
 
2325
+ // ZodExactOptional
2326
+ export interface ZodExactOptional<T extends core.SomeType = core.$ZodType>
2327
+ extends _ZodType<core.$ZodExactOptionalInternals<T>>,
2328
+ core.$ZodExactOptional<T> {
2329
+ "~standard": ZodStandardSchemaWithJSON<this>;
2330
+ unwrap(): T;
2331
+ }
2332
+ export const ZodExactOptional: core.$constructor<ZodExactOptional> = /*@__PURE__*/ core.$constructor(
2333
+ "ZodExactOptional",
2334
+ (inst, def) => {
2335
+ core.$ZodExactOptional.init(inst, def);
2336
+ ZodType.init(inst, def);
2337
+ inst._zod.processJSONSchema = (ctx, json, params) => processors.optionalProcessor(inst, ctx, json, params);
2338
+
2339
+ inst.unwrap = () => inst._zod.def.innerType;
2340
+ }
2341
+ );
2342
+
2343
+ export function exactOptional<T extends core.SomeType>(innerType: T): ZodExactOptional<T> {
2344
+ return new ZodExactOptional({
2345
+ type: "optional",
2346
+ innerType: innerType as any as core.$ZodType,
2347
+ }) as any;
2348
+ }
2349
+
1647
2350
  // ZodNullable
1648
2351
  export interface ZodNullable<T extends core.SomeType = core.$ZodType>
1649
2352
  extends _ZodType<core.$ZodNullableInternals<T>>,
1650
2353
  core.$ZodNullable<T> {
2354
+ "~standard": ZodStandardSchemaWithJSON<this>;
1651
2355
  unwrap(): T;
1652
2356
  }
1653
2357
  export const ZodNullable: core.$constructor<ZodNullable> = /*@__PURE__*/ core.$constructor(
@@ -1655,6 +2359,7 @@ export const ZodNullable: core.$constructor<ZodNullable> = /*@__PURE__*/ core.$c
1655
2359
  (inst, def) => {
1656
2360
  core.$ZodNullable.init(inst, def);
1657
2361
  ZodType.init(inst, def);
2362
+ inst._zod.processJSONSchema = (ctx, json, params) => processors.nullableProcessor(inst, ctx, json, params);
1658
2363
 
1659
2364
  inst.unwrap = () => inst._zod.def.innerType;
1660
2365
  }
@@ -1676,6 +2381,7 @@ export function nullish<T extends core.SomeType>(innerType: T): ZodOptional<ZodN
1676
2381
  export interface ZodDefault<T extends core.SomeType = core.$ZodType>
1677
2382
  extends _ZodType<core.$ZodDefaultInternals<T>>,
1678
2383
  core.$ZodDefault<T> {
2384
+ "~standard": ZodStandardSchemaWithJSON<this>;
1679
2385
  unwrap(): T;
1680
2386
  /** @deprecated Use `.unwrap()` instead. */
1681
2387
  removeDefault(): T;
@@ -1683,6 +2389,7 @@ export interface ZodDefault<T extends core.SomeType = core.$ZodType>
1683
2389
  export const ZodDefault: core.$constructor<ZodDefault> = /*@__PURE__*/ core.$constructor("ZodDefault", (inst, def) => {
1684
2390
  core.$ZodDefault.init(inst, def);
1685
2391
  ZodType.init(inst, def);
2392
+ inst._zod.processJSONSchema = (ctx, json, params) => processors.defaultProcessor(inst, ctx, json, params);
1686
2393
 
1687
2394
  inst.unwrap = () => inst._zod.def.innerType;
1688
2395
  inst.removeDefault = inst.unwrap;
@@ -1696,7 +2403,7 @@ export function _default<T extends core.SomeType>(
1696
2403
  type: "default",
1697
2404
  innerType: innerType as any as core.$ZodType,
1698
2405
  get defaultValue() {
1699
- return typeof defaultValue === "function" ? (defaultValue as Function)() : defaultValue;
2406
+ return typeof defaultValue === "function" ? (defaultValue as Function)() : util.shallowClone(defaultValue);
1700
2407
  },
1701
2408
  }) as any;
1702
2409
  }
@@ -1705,6 +2412,7 @@ export function _default<T extends core.SomeType>(
1705
2412
  export interface ZodPrefault<T extends core.SomeType = core.$ZodType>
1706
2413
  extends _ZodType<core.$ZodPrefaultInternals<T>>,
1707
2414
  core.$ZodPrefault<T> {
2415
+ "~standard": ZodStandardSchemaWithJSON<this>;
1708
2416
  unwrap(): T;
1709
2417
  }
1710
2418
  export const ZodPrefault: core.$constructor<ZodPrefault> = /*@__PURE__*/ core.$constructor(
@@ -1712,6 +2420,7 @@ export const ZodPrefault: core.$constructor<ZodPrefault> = /*@__PURE__*/ core.$c
1712
2420
  (inst, def) => {
1713
2421
  core.$ZodPrefault.init(inst, def);
1714
2422
  ZodType.init(inst, def);
2423
+ inst._zod.processJSONSchema = (ctx, json, params) => processors.prefaultProcessor(inst, ctx, json, params);
1715
2424
  inst.unwrap = () => inst._zod.def.innerType;
1716
2425
  }
1717
2426
  );
@@ -1724,7 +2433,7 @@ export function prefault<T extends core.SomeType>(
1724
2433
  type: "prefault",
1725
2434
  innerType: innerType as any as core.$ZodType,
1726
2435
  get defaultValue() {
1727
- return typeof defaultValue === "function" ? (defaultValue as Function)() : defaultValue;
2436
+ return typeof defaultValue === "function" ? (defaultValue as Function)() : util.shallowClone(defaultValue);
1728
2437
  },
1729
2438
  }) as any;
1730
2439
  }
@@ -1733,6 +2442,7 @@ export function prefault<T extends core.SomeType>(
1733
2442
  export interface ZodNonOptional<T extends core.SomeType = core.$ZodType>
1734
2443
  extends _ZodType<core.$ZodNonOptionalInternals<T>>,
1735
2444
  core.$ZodNonOptional<T> {
2445
+ "~standard": ZodStandardSchemaWithJSON<this>;
1736
2446
  unwrap(): T;
1737
2447
  }
1738
2448
  export const ZodNonOptional: core.$constructor<ZodNonOptional> = /*@__PURE__*/ core.$constructor(
@@ -1740,6 +2450,7 @@ export const ZodNonOptional: core.$constructor<ZodNonOptional> = /*@__PURE__*/ c
1740
2450
  (inst, def) => {
1741
2451
  core.$ZodNonOptional.init(inst, def);
1742
2452
  ZodType.init(inst, def);
2453
+ inst._zod.processJSONSchema = (ctx, json, params) => processors.nonoptionalProcessor(inst, ctx, json, params);
1743
2454
 
1744
2455
  inst.unwrap = () => inst._zod.def.innerType;
1745
2456
  }
@@ -1760,11 +2471,13 @@ export function nonoptional<T extends core.SomeType>(
1760
2471
  export interface ZodSuccess<T extends core.SomeType = core.$ZodType>
1761
2472
  extends _ZodType<core.$ZodSuccessInternals<T>>,
1762
2473
  core.$ZodSuccess<T> {
2474
+ "~standard": ZodStandardSchemaWithJSON<this>;
1763
2475
  unwrap(): T;
1764
2476
  }
1765
2477
  export const ZodSuccess: core.$constructor<ZodSuccess> = /*@__PURE__*/ core.$constructor("ZodSuccess", (inst, def) => {
1766
2478
  core.$ZodSuccess.init(inst, def);
1767
2479
  ZodType.init(inst, def);
2480
+ inst._zod.processJSONSchema = (ctx, json, params) => processors.successProcessor(inst, ctx, json, params);
1768
2481
 
1769
2482
  inst.unwrap = () => inst._zod.def.innerType;
1770
2483
  });
@@ -1780,6 +2493,7 @@ export function success<T extends core.SomeType>(innerType: T): ZodSuccess<T> {
1780
2493
  export interface ZodCatch<T extends core.SomeType = core.$ZodType>
1781
2494
  extends _ZodType<core.$ZodCatchInternals<T>>,
1782
2495
  core.$ZodCatch<T> {
2496
+ "~standard": ZodStandardSchemaWithJSON<this>;
1783
2497
  unwrap(): T;
1784
2498
  /** @deprecated Use `.unwrap()` instead. */
1785
2499
  removeCatch(): T;
@@ -1787,6 +2501,7 @@ export interface ZodCatch<T extends core.SomeType = core.$ZodType>
1787
2501
  export const ZodCatch: core.$constructor<ZodCatch> = /*@__PURE__*/ core.$constructor("ZodCatch", (inst, def) => {
1788
2502
  core.$ZodCatch.init(inst, def);
1789
2503
  ZodType.init(inst, def);
2504
+ inst._zod.processJSONSchema = (ctx, json, params) => processors.catchProcessor(inst, ctx, json, params);
1790
2505
 
1791
2506
  inst.unwrap = () => inst._zod.def.innerType;
1792
2507
  inst.removeCatch = inst.unwrap;
@@ -1799,7 +2514,7 @@ function _catch<T extends core.SomeType>(
1799
2514
  return new ZodCatch({
1800
2515
  type: "catch",
1801
2516
  innerType: innerType as any as core.$ZodType,
1802
- catchValue: (typeof catchValue === "function" ? catchValue : () => catchValue) as (
2517
+ catchValue: (typeof catchValue === "function" ? catchValue : core.util.constantCatch(catchValue)) as (
1803
2518
  ctx: core.$ZodCatchCtx
1804
2519
  ) => core.output<T>,
1805
2520
  }) as any;
@@ -1807,10 +2522,13 @@ function _catch<T extends core.SomeType>(
1807
2522
  export { _catch as catch };
1808
2523
 
1809
2524
  // ZodNaN
1810
- export interface ZodNaN extends _ZodType<core.$ZodNaNInternals>, core.$ZodNaN {}
2525
+ export interface ZodNaN extends _ZodType<core.$ZodNaNInternals>, core.$ZodNaN {
2526
+ "~standard": ZodStandardSchemaWithJSON<this>;
2527
+ }
1811
2528
  export const ZodNaN: core.$constructor<ZodNaN> = /*@__PURE__*/ core.$constructor("ZodNaN", (inst, def) => {
1812
2529
  core.$ZodNaN.init(inst, def);
1813
2530
  ZodType.init(inst, def);
2531
+ inst._zod.processJSONSchema = (ctx, json, params) => processors.nanProcessor(inst, ctx, json, params);
1814
2532
  });
1815
2533
 
1816
2534
  export function nan(params?: string | core.$ZodNaNParams): ZodNaN {
@@ -1821,12 +2539,14 @@ export function nan(params?: string | core.$ZodNaNParams): ZodNaN {
1821
2539
  export interface ZodPipe<A extends core.SomeType = core.$ZodType, B extends core.SomeType = core.$ZodType>
1822
2540
  extends _ZodType<core.$ZodPipeInternals<A, B>>,
1823
2541
  core.$ZodPipe<A, B> {
2542
+ "~standard": ZodStandardSchemaWithJSON<this>;
1824
2543
  in: A;
1825
2544
  out: B;
1826
2545
  }
1827
2546
  export const ZodPipe: core.$constructor<ZodPipe> = /*@__PURE__*/ core.$constructor("ZodPipe", (inst, def) => {
1828
2547
  core.$ZodPipe.init(inst, def);
1829
2548
  ZodType.init(inst, def);
2549
+ inst._zod.processJSONSchema = (ctx, json, params) => processors.pipeProcessor(inst, ctx, json, params);
1830
2550
 
1831
2551
  inst.in = def.in;
1832
2552
  inst.out = def.out;
@@ -1845,15 +2565,78 @@ export function pipe(in_: core.SomeType, out: core.SomeType) {
1845
2565
  });
1846
2566
  }
1847
2567
 
2568
+ // ZodCodec
2569
+ export interface ZodCodec<A extends core.SomeType = core.$ZodType, B extends core.SomeType = core.$ZodType>
2570
+ extends ZodPipe<A, B>,
2571
+ core.$ZodCodec<A, B> {
2572
+ "~standard": ZodStandardSchemaWithJSON<this>;
2573
+ _zod: core.$ZodCodecInternals<A, B>;
2574
+ def: core.$ZodCodecDef<A, B>;
2575
+ }
2576
+ export const ZodCodec: core.$constructor<ZodCodec> = /*@__PURE__*/ core.$constructor("ZodCodec", (inst, def) => {
2577
+ ZodPipe.init(inst, def);
2578
+ core.$ZodCodec.init(inst, def);
2579
+ });
2580
+
2581
+ export function codec<const A extends core.SomeType, B extends core.SomeType = core.$ZodType>(
2582
+ in_: A,
2583
+ out: B,
2584
+ params: {
2585
+ decode: (value: core.output<A>, payload: core.ParsePayload<core.output<A>>) => core.util.MaybeAsync<core.input<B>>;
2586
+ encode: (value: core.input<B>, payload: core.ParsePayload<core.input<B>>) => core.util.MaybeAsync<core.output<A>>;
2587
+ }
2588
+ ): ZodCodec<A, B> {
2589
+ return new ZodCodec({
2590
+ type: "pipe",
2591
+ in: in_ as any as core.$ZodType,
2592
+ out: out as any as core.$ZodType,
2593
+ transform: params.decode as any,
2594
+ reverseTransform: params.encode as any,
2595
+ }) as any;
2596
+ }
2597
+
2598
+ export function invertCodec<A extends core.SomeType, B extends core.SomeType>(codec: ZodCodec<A, B>): ZodCodec<B, A> {
2599
+ const def = codec._zod.def;
2600
+ return new ZodCodec({
2601
+ type: "pipe",
2602
+ in: def.out as any,
2603
+ out: def.in as any,
2604
+ transform: def.reverseTransform as any,
2605
+ reverseTransform: def.transform as any,
2606
+ }) as any;
2607
+ }
2608
+
2609
+ // ZodPreprocess
2610
+ export interface ZodPreprocess<B extends core.SomeType = core.$ZodType, I = unknown>
2611
+ extends ZodPipe<core.$ZodTransform<unknown, I>, B>,
2612
+ core.$ZodPreprocess<B, I> {
2613
+ "~standard": ZodStandardSchemaWithJSON<this>;
2614
+ _zod: core.$ZodPreprocessInternals<B, I>;
2615
+ def: core.$ZodPreprocessDef<B, I>;
2616
+ }
2617
+ export const ZodPreprocess: core.$constructor<ZodPreprocess> = /*@__PURE__*/ core.$constructor(
2618
+ "ZodPreprocess",
2619
+ (inst, def) => {
2620
+ ZodPipe.init(inst, def);
2621
+ core.$ZodPreprocess.init(inst, def);
2622
+ }
2623
+ );
2624
+
1848
2625
  // ZodReadonly
1849
2626
  export interface ZodReadonly<T extends core.SomeType = core.$ZodType>
1850
2627
  extends _ZodType<core.$ZodReadonlyInternals<T>>,
1851
- core.$ZodReadonly<T> {}
2628
+ core.$ZodReadonly<T> {
2629
+ "~standard": ZodStandardSchemaWithJSON<this>;
2630
+ unwrap(): T;
2631
+ }
1852
2632
  export const ZodReadonly: core.$constructor<ZodReadonly> = /*@__PURE__*/ core.$constructor(
1853
2633
  "ZodReadonly",
1854
2634
  (inst, def) => {
1855
2635
  core.$ZodReadonly.init(inst, def);
1856
2636
  ZodType.init(inst, def);
2637
+ inst._zod.processJSONSchema = (ctx, json, params) => processors.readonlyProcessor(inst, ctx, json, params);
2638
+
2639
+ inst.unwrap = () => inst._zod.def.innerType;
1857
2640
  }
1858
2641
  );
1859
2642
 
@@ -1867,12 +2650,15 @@ export function readonly<T extends core.SomeType>(innerType: T): ZodReadonly<T>
1867
2650
  // ZodTemplateLiteral
1868
2651
  export interface ZodTemplateLiteral<Template extends string = string>
1869
2652
  extends _ZodType<core.$ZodTemplateLiteralInternals<Template>>,
1870
- core.$ZodTemplateLiteral<Template> {}
2653
+ core.$ZodTemplateLiteral<Template> {
2654
+ "~standard": ZodStandardSchemaWithJSON<this>;
2655
+ }
1871
2656
  export const ZodTemplateLiteral: core.$constructor<ZodTemplateLiteral> = /*@__PURE__*/ core.$constructor(
1872
2657
  "ZodTemplateLiteral",
1873
2658
  (inst, def) => {
1874
2659
  core.$ZodTemplateLiteral.init(inst, def);
1875
2660
  ZodType.init(inst, def);
2661
+ inst._zod.processJSONSchema = (ctx, json, params) => processors.templateLiteralProcessor(inst, ctx, json, params);
1876
2662
  }
1877
2663
  );
1878
2664
 
@@ -1891,11 +2677,13 @@ export function templateLiteral<const Parts extends core.$ZodTemplateLiteralPart
1891
2677
  export interface ZodLazy<T extends core.SomeType = core.$ZodType>
1892
2678
  extends _ZodType<core.$ZodLazyInternals<T>>,
1893
2679
  core.$ZodLazy<T> {
2680
+ "~standard": ZodStandardSchemaWithJSON<this>;
1894
2681
  unwrap(): T;
1895
2682
  }
1896
2683
  export const ZodLazy: core.$constructor<ZodLazy> = /*@__PURE__*/ core.$constructor("ZodLazy", (inst, def) => {
1897
2684
  core.$ZodLazy.init(inst, def);
1898
2685
  ZodType.init(inst, def);
2686
+ inst._zod.processJSONSchema = (ctx, json, params) => processors.lazyProcessor(inst, ctx, json, params);
1899
2687
 
1900
2688
  inst.unwrap = () => inst._zod.def.getter();
1901
2689
  });
@@ -1911,11 +2699,13 @@ export function lazy<T extends core.SomeType>(getter: () => T): ZodLazy<T> {
1911
2699
  export interface ZodPromise<T extends core.SomeType = core.$ZodType>
1912
2700
  extends _ZodType<core.$ZodPromiseInternals<T>>,
1913
2701
  core.$ZodPromise<T> {
2702
+ "~standard": ZodStandardSchemaWithJSON<this>;
1914
2703
  unwrap(): T;
1915
2704
  }
1916
2705
  export const ZodPromise: core.$constructor<ZodPromise> = /*@__PURE__*/ core.$constructor("ZodPromise", (inst, def) => {
1917
2706
  core.$ZodPromise.init(inst, def);
1918
2707
  ZodType.init(inst, def);
2708
+ inst._zod.processJSONSchema = (ctx, json, params) => processors.promiseProcessor(inst, ctx, json, params);
1919
2709
 
1920
2710
  inst.unwrap = () => inst._zod.def.innerType;
1921
2711
  });
@@ -1927,13 +2717,83 @@ export function promise<T extends core.SomeType>(innerType: T): ZodPromise<T> {
1927
2717
  }) as any;
1928
2718
  }
1929
2719
 
2720
+ // ZodFunction
2721
+ export interface ZodFunction<
2722
+ Args extends core.$ZodFunctionIn = core.$ZodFunctionIn,
2723
+ Returns extends core.$ZodFunctionOut = core.$ZodFunctionOut,
2724
+ > extends _ZodType<core.$ZodFunctionInternals<Args, Returns>>,
2725
+ core.$ZodFunction<Args, Returns> {
2726
+ "~standard": ZodStandardSchemaWithJSON<this>;
2727
+ _def: core.$ZodFunctionDef<Args, Returns>;
2728
+ _input: core.$InferInnerFunctionType<Args, Returns>;
2729
+ _output: core.$InferOuterFunctionType<Args, Returns>;
2730
+
2731
+ input<const Items extends util.TupleItems, const Rest extends core.$ZodFunctionOut = core.$ZodFunctionOut>(
2732
+ args: Items,
2733
+ rest?: Rest
2734
+ ): ZodFunction<core.$ZodTuple<Items, Rest>, Returns>;
2735
+ input<NewArgs extends core.$ZodFunctionIn>(args: NewArgs): ZodFunction<NewArgs, Returns>;
2736
+ input(...args: any[]): ZodFunction<any, Returns>;
2737
+
2738
+ output<NewReturns extends core.$ZodType>(output: NewReturns): ZodFunction<Args, NewReturns>;
2739
+ }
2740
+
2741
+ export const ZodFunction: core.$constructor<ZodFunction> = /*@__PURE__*/ core.$constructor(
2742
+ "ZodFunction",
2743
+ (inst, def) => {
2744
+ core.$ZodFunction.init(inst, def);
2745
+ ZodType.init(inst, def);
2746
+ inst._zod.processJSONSchema = (ctx, json, params) => processors.functionProcessor(inst, ctx, json, params);
2747
+ }
2748
+ );
2749
+
2750
+ export function _function(): ZodFunction;
2751
+ export function _function<const In extends ReadonlyArray<core.$ZodType>>(params: {
2752
+ input: In;
2753
+ }): ZodFunction<ZodTuple<In, null>, core.$ZodFunctionOut>;
2754
+ export function _function<
2755
+ const In extends ReadonlyArray<core.$ZodType>,
2756
+ const Out extends core.$ZodFunctionOut = core.$ZodFunctionOut,
2757
+ >(params: {
2758
+ input: In;
2759
+ output: Out;
2760
+ }): ZodFunction<ZodTuple<In, null>, Out>;
2761
+ export function _function<const In extends core.$ZodFunctionIn = core.$ZodFunctionIn>(params: {
2762
+ input: In;
2763
+ }): ZodFunction<In, core.$ZodFunctionOut>;
2764
+ export function _function<const Out extends core.$ZodFunctionOut = core.$ZodFunctionOut>(params: {
2765
+ output: Out;
2766
+ }): ZodFunction<core.$ZodFunctionIn, Out>;
2767
+ export function _function<
2768
+ In extends core.$ZodFunctionIn = core.$ZodFunctionIn,
2769
+ Out extends core.$ZodType = core.$ZodType,
2770
+ >(params?: {
2771
+ input: In;
2772
+ output: Out;
2773
+ }): ZodFunction<In, Out>;
2774
+ export function _function(params?: {
2775
+ output?: core.$ZodType;
2776
+ input?: core.$ZodFunctionArgs | Array<core.$ZodType>;
2777
+ }): ZodFunction {
2778
+ return new ZodFunction({
2779
+ type: "function",
2780
+ input: Array.isArray(params?.input) ? tuple(params?.input as any) : (params?.input ?? array(unknown())),
2781
+ output: params?.output ?? unknown(),
2782
+ });
2783
+ }
2784
+
2785
+ export { _function as function };
2786
+
1930
2787
  // ZodCustom
1931
2788
  export interface ZodCustom<O = unknown, I = unknown>
1932
2789
  extends _ZodType<core.$ZodCustomInternals<O, I>>,
1933
- core.$ZodCustom<O, I> {}
2790
+ core.$ZodCustom<O, I> {
2791
+ "~standard": ZodStandardSchemaWithJSON<this>;
2792
+ }
1934
2793
  export const ZodCustom: core.$constructor<ZodCustom> = /*@__PURE__*/ core.$constructor("ZodCustom", (inst, def) => {
1935
2794
  core.$ZodCustom.init(inst, def);
1936
2795
  ZodType.init(inst, def);
2796
+ inst._zod.processJSONSchema = (ctx, json, params) => processors.customProcessor(inst, ctx, json, params);
1937
2797
  });
1938
2798
 
1939
2799
  // custom checks
@@ -1962,61 +2822,81 @@ export function refine<T>(
1962
2822
  }
1963
2823
 
1964
2824
  // superRefine
1965
- export function superRefine<T>(fn: (arg: T, payload: RefinementCtx<T>) => void | Promise<void>): core.$ZodCheck<T> {
1966
- const ch = check<T>((payload) => {
1967
- (payload as RefinementCtx).addIssue = (issue) => {
1968
- if (typeof issue === "string") {
1969
- payload.issues.push(util.issue(issue, payload.value, ch._zod.def));
1970
- } else {
1971
- // for Zod 3 backwards compatibility
1972
- const _issue: any = issue;
1973
- if (_issue.fatal) _issue.continue = false;
1974
- _issue.code ??= "custom";
1975
- _issue.input ??= payload.value;
1976
- _issue.inst ??= ch;
1977
- _issue.continue ??= !ch._zod.def.abort;
1978
- payload.issues.push(util.issue(_issue));
1979
- }
1980
- };
1981
-
1982
- return fn(payload.value, payload as RefinementCtx<T>);
1983
- });
1984
- return ch;
2825
+ export function superRefine<T>(
2826
+ fn: (arg: T, payload: core.$RefinementCtx<T>) => void | Promise<void>,
2827
+ params?: core.$ZodSuperRefineParams
2828
+ ): core.$ZodCheck<T> {
2829
+ return core._superRefine(fn, params);
1985
2830
  }
1986
2831
 
2832
+ // Re-export describe and meta from core
2833
+ export const describe = core.describe;
2834
+ export const meta = core.meta;
2835
+
1987
2836
  type ZodInstanceOfParams = core.Params<
1988
2837
  ZodCustom,
1989
2838
  core.$ZodIssueCustom,
1990
2839
  "type" | "check" | "checks" | "fn" | "abort" | "error" | "params" | "path"
1991
2840
  >;
2841
+
2842
+ // ZodInstanceOf
2843
+ export interface ZodInstanceOf<T = unknown> extends ZodCustom<T, T> {
2844
+ // the shape is keyed off the instance type, so keys autocomplete and a schema that can't accept the property's type is an error. Methods are excluded: every object literal inherits Object.prototype.toString, which would otherwise collide with the constraint's own toString entry and reject every shape.
2845
+ properties<Shape extends { [k in keyof T as T[k] extends Function ? never : k]?: core.$ZodType<unknown, T[k]> }>(
2846
+ shape: Shape,
2847
+ params?: string | core.$ZodCheckPropertiesParams
2848
+ ): ZodInstanceOf<T & core.$InferObjectInput<Shape, {}>>;
2849
+ }
2850
+ export const ZodInstanceOf: core.$constructor<ZodInstanceOf> = /*@__PURE__*/ core.$constructor(
2851
+ "ZodInstanceOf",
2852
+ (inst, def) => {
2853
+ ZodCustom.init(inst, def);
2854
+ },
2855
+ {
2856
+ properties(shape: core.$ZodShape, params?: string | core.$ZodCheckPropertiesParams) {
2857
+ // asserts in place, so the narrowed output type is truthful without a wrapper
2858
+ return this.check(core._properties(shape, params)) as any;
2859
+ },
2860
+ }
2861
+ );
2862
+
1992
2863
  function _instanceof<T extends typeof util.Class>(
1993
2864
  cls: T,
1994
- params: ZodInstanceOfParams = {
1995
- error: `Input not instance of ${cls.name}`,
1996
- }
1997
- ): ZodCustom<InstanceType<T>, InstanceType<T>> {
1998
- const inst = new ZodCustom({
2865
+ params: ZodInstanceOfParams = {}
2866
+ ): ZodInstanceOf<InstanceType<T>> {
2867
+ const inst = new ZodInstanceOf({
1999
2868
  type: "custom",
2000
2869
  check: "custom",
2001
- fn: (data) => data instanceof cls,
2870
+ fn: (data: unknown) => data instanceof cls,
2002
2871
  abort: true,
2003
2872
  ...(util.normalizeParams(params) as any),
2004
2873
  });
2005
2874
  inst._zod.bag.Class = cls;
2875
+ // Override check to emit invalid_type instead of custom
2876
+ inst._zod.check = (payload) => {
2877
+ if (!(payload.value instanceof cls)) {
2878
+ payload.issues.push({
2879
+ code: "invalid_type",
2880
+ expected: cls.name,
2881
+ input: payload.value,
2882
+ inst,
2883
+ path: [...(inst._zod.def.path ?? [])],
2884
+ });
2885
+ }
2886
+ };
2006
2887
  return inst as any;
2007
2888
  }
2008
2889
  export { _instanceof as instanceof };
2009
2890
 
2010
2891
  // stringbool
2011
- export const stringbool: (
2012
- _params?: string | core.$ZodStringBoolParams
2013
- ) => ZodPipe<ZodPipe<ZodString, ZodTransform<boolean, string>>, ZodBoolean> = (...args) =>
2892
+ export const stringbool: (_params?: string | core.$ZodStringBoolParams) => ZodCodec<ZodString, ZodBoolean> = (
2893
+ ...args
2894
+ ) =>
2014
2895
  core._stringbool(
2015
2896
  {
2016
- Pipe: ZodPipe,
2897
+ Codec: ZodCodec,
2017
2898
  Boolean: ZodBoolean,
2018
2899
  String: ZodString,
2019
- Transform: ZodTransform,
2020
2900
  },
2021
2901
  ...args
2022
2902
  ) as any;
@@ -2045,10 +2925,13 @@ export function json(params?: string | core.$ZodCustomParams): ZodJSONSchema {
2045
2925
 
2046
2926
  // preprocess
2047
2927
 
2048
- // /** @deprecated Use `z.pipe()` and `z.transform()` instead. */
2049
2928
  export function preprocess<A, U extends core.SomeType, B = unknown>(
2050
- fn: (arg: B, ctx: RefinementCtx) => A,
2929
+ fn: (arg: B, ctx: core.$RefinementCtx) => A,
2051
2930
  schema: U
2052
- ): ZodPipe<ZodTransform<A, B>, U> {
2053
- return pipe(transform(fn as any), schema as any) as any;
2931
+ ): ZodPreprocess<U, B> {
2932
+ return new ZodPreprocess({
2933
+ type: "pipe",
2934
+ in: transform(fn as any) as any as core.$ZodTransform,
2935
+ out: schema as any as core.$ZodType,
2936
+ }) as any;
2054
2937
  }