@shuttl-io/core 0.2.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 (802) hide show
  1. package/CHANGELOG.md +96 -0
  2. package/README.md +3 -0
  3. package/dist/Server.d.ts +5 -0
  4. package/dist/Server.js +3 -0
  5. package/dist/Triggers.d.ts +0 -0
  6. package/dist/Triggers.js +2 -0
  7. package/dist/agent.d.ts +49 -0
  8. package/dist/agent.js +251 -0
  9. package/dist/app.d.ts +17 -0
  10. package/dist/app.js +46 -0
  11. package/dist/index.d.ts +12 -0
  12. package/dist/index.js +29 -0
  13. package/dist/model.d.ts +6 -0
  14. package/dist/model.js +16 -0
  15. package/dist/models/openAi.d.ts +40 -0
  16. package/dist/models/openAi.js +346 -0
  17. package/dist/models/types.d.ts +102 -0
  18. package/dist/models/types.js +27 -0
  19. package/dist/outcomes/CombinationOutcome.d.ts +9 -0
  20. package/dist/outcomes/CombinationOutcome.js +41 -0
  21. package/dist/outcomes/IOutcomes.d.ts +9 -0
  22. package/dist/outcomes/IOutcomes.js +19 -0
  23. package/dist/outcomes/StreamingOutcome.d.ts +6 -0
  24. package/dist/outcomes/StreamingOutcome.js +30 -0
  25. package/dist/outcomes/index.d.ts +3 -0
  26. package/dist/outcomes/index.js +20 -0
  27. package/dist/secrets.d.ts +19 -0
  28. package/dist/secrets.js +34 -0
  29. package/dist/server/http.d.ts +68 -0
  30. package/dist/server/http.js +654 -0
  31. package/dist/server/index.d.ts +1 -0
  32. package/dist/server/index.js +18 -0
  33. package/dist/src/Server.d.ts +5 -0
  34. package/dist/src/Server.js +3 -0
  35. package/dist/src/Triggers.d.ts +0 -0
  36. package/dist/src/Triggers.js +2 -0
  37. package/dist/src/agent.d.ts +49 -0
  38. package/dist/src/agent.js +251 -0
  39. package/dist/src/app.d.ts +17 -0
  40. package/dist/src/app.js +46 -0
  41. package/dist/src/index.d.ts +12 -0
  42. package/dist/src/index.js +29 -0
  43. package/dist/src/model.d.ts +6 -0
  44. package/dist/src/model.js +16 -0
  45. package/dist/src/models/openAi.d.ts +38 -0
  46. package/dist/src/models/openAi.js +344 -0
  47. package/dist/src/models/types.d.ts +101 -0
  48. package/dist/src/models/types.js +27 -0
  49. package/dist/src/outcomes/CombinationOutcome.d.ts +9 -0
  50. package/dist/src/outcomes/CombinationOutcome.js +41 -0
  51. package/dist/src/outcomes/IOutcomes.d.ts +9 -0
  52. package/dist/src/outcomes/IOutcomes.js +19 -0
  53. package/dist/src/outcomes/StreamingOutcome.d.ts +6 -0
  54. package/dist/src/outcomes/StreamingOutcome.js +30 -0
  55. package/dist/src/outcomes/index.d.ts +3 -0
  56. package/dist/src/outcomes/index.js +20 -0
  57. package/dist/src/secrets.d.ts +19 -0
  58. package/dist/src/secrets.js +34 -0
  59. package/dist/src/server/http.d.ts +68 -0
  60. package/dist/src/server/http.js +654 -0
  61. package/dist/src/server/index.d.ts +1 -0
  62. package/dist/src/server/index.js +18 -0
  63. package/dist/src/tools/tool.d.ts +33 -0
  64. package/dist/src/tools/tool.js +49 -0
  65. package/dist/src/tools/toolkit.d.ts +13 -0
  66. package/dist/src/tools/toolkit.js +19 -0
  67. package/dist/src/trigger/ApiTrigger.d.ts +37 -0
  68. package/dist/src/trigger/ApiTrigger.js +106 -0
  69. package/dist/src/trigger/EmailTrigger.d.ts +15 -0
  70. package/dist/src/trigger/EmailTrigger.js +22 -0
  71. package/dist/src/trigger/FileTrigger.d.ts +14 -0
  72. package/dist/src/trigger/FileTrigger.js +37 -0
  73. package/dist/src/trigger/ITrigger.d.ts +89 -0
  74. package/dist/src/trigger/ITrigger.js +35 -0
  75. package/dist/src/trigger/RateTrigger.d.ts +23 -0
  76. package/dist/src/trigger/RateTrigger.js +58 -0
  77. package/dist/src/trigger/index.d.ts +5 -0
  78. package/dist/src/trigger/index.js +22 -0
  79. package/dist/tests/agent.test.d.ts +1 -0
  80. package/dist/tests/agent.test.js +388 -0
  81. package/dist/tests/agentStreamer.test.d.ts +1 -0
  82. package/dist/tests/agentStreamer.test.js +530 -0
  83. package/dist/tests/app.test.d.ts +1 -0
  84. package/dist/tests/app.test.js +423 -0
  85. package/dist/tests/model.test.d.ts +1 -0
  86. package/dist/tests/model.test.js +310 -0
  87. package/dist/tests/openAi.test.d.ts +1 -0
  88. package/dist/tests/openAi.test.js +701 -0
  89. package/dist/tests/outcomes.test.d.ts +1 -0
  90. package/dist/tests/outcomes.test.js +257 -0
  91. package/dist/tests/secrets.test.d.ts +1 -0
  92. package/dist/tests/secrets.test.js +263 -0
  93. package/dist/tests/server/http.test.d.ts +1 -0
  94. package/dist/tests/server/http.test.js +553 -0
  95. package/dist/tests/tool.test.d.ts +1 -0
  96. package/dist/tests/tool.test.js +315 -0
  97. package/dist/tests/toolkit.test.d.ts +1 -0
  98. package/dist/tests/toolkit.test.js +189 -0
  99. package/dist/tests/triggers.test.d.ts +1 -0
  100. package/dist/tests/triggers.test.js +203 -0
  101. package/dist/tests/types.test.d.ts +1 -0
  102. package/dist/tests/types.test.js +429 -0
  103. package/dist/tools/tool.d.ts +33 -0
  104. package/dist/tools/tool.js +49 -0
  105. package/dist/tools/toolkit.d.ts +13 -0
  106. package/dist/tools/toolkit.js +19 -0
  107. package/dist/trigger/ApiTrigger.d.ts +37 -0
  108. package/dist/trigger/ApiTrigger.js +106 -0
  109. package/dist/trigger/EmailTrigger.d.ts +15 -0
  110. package/dist/trigger/EmailTrigger.js +22 -0
  111. package/dist/trigger/FileTrigger.d.ts +14 -0
  112. package/dist/trigger/FileTrigger.js +37 -0
  113. package/dist/trigger/ITrigger.d.ts +90 -0
  114. package/dist/trigger/ITrigger.js +38 -0
  115. package/dist/trigger/RateTrigger.d.ts +23 -0
  116. package/dist/trigger/RateTrigger.js +58 -0
  117. package/dist/trigger/index.d.ts +5 -0
  118. package/dist/trigger/index.js +22 -0
  119. package/jest.config.js +20 -0
  120. package/node_modules/zod/LICENSE +21 -0
  121. package/node_modules/zod/README.md +208 -0
  122. package/node_modules/zod/index.cjs +33 -0
  123. package/node_modules/zod/index.d.cts +4 -0
  124. package/node_modules/zod/index.d.ts +4 -0
  125. package/node_modules/zod/index.js +4 -0
  126. package/node_modules/zod/locales/index.cjs +17 -0
  127. package/node_modules/zod/locales/index.d.cts +1 -0
  128. package/node_modules/zod/locales/index.d.ts +1 -0
  129. package/node_modules/zod/locales/index.js +1 -0
  130. package/node_modules/zod/locales/package.json +6 -0
  131. package/node_modules/zod/mini/index.cjs +17 -0
  132. package/node_modules/zod/mini/index.d.cts +1 -0
  133. package/node_modules/zod/mini/index.d.ts +1 -0
  134. package/node_modules/zod/mini/index.js +1 -0
  135. package/node_modules/zod/mini/package.json +6 -0
  136. package/node_modules/zod/package.json +135 -0
  137. package/node_modules/zod/src/index.ts +4 -0
  138. package/node_modules/zod/src/locales/index.ts +1 -0
  139. package/node_modules/zod/src/mini/index.ts +1 -0
  140. package/node_modules/zod/src/v3/ZodError.ts +330 -0
  141. package/node_modules/zod/src/v3/benchmarks/datetime.ts +58 -0
  142. package/node_modules/zod/src/v3/benchmarks/discriminatedUnion.ts +80 -0
  143. package/node_modules/zod/src/v3/benchmarks/index.ts +59 -0
  144. package/node_modules/zod/src/v3/benchmarks/ipv4.ts +57 -0
  145. package/node_modules/zod/src/v3/benchmarks/object.ts +69 -0
  146. package/node_modules/zod/src/v3/benchmarks/primitives.ts +162 -0
  147. package/node_modules/zod/src/v3/benchmarks/realworld.ts +63 -0
  148. package/node_modules/zod/src/v3/benchmarks/string.ts +55 -0
  149. package/node_modules/zod/src/v3/benchmarks/union.ts +80 -0
  150. package/node_modules/zod/src/v3/errors.ts +13 -0
  151. package/node_modules/zod/src/v3/external.ts +6 -0
  152. package/node_modules/zod/src/v3/helpers/enumUtil.ts +17 -0
  153. package/node_modules/zod/src/v3/helpers/errorUtil.ts +8 -0
  154. package/node_modules/zod/src/v3/helpers/parseUtil.ts +176 -0
  155. package/node_modules/zod/src/v3/helpers/partialUtil.ts +34 -0
  156. package/node_modules/zod/src/v3/helpers/typeAliases.ts +2 -0
  157. package/node_modules/zod/src/v3/helpers/util.ts +224 -0
  158. package/node_modules/zod/src/v3/index.ts +4 -0
  159. package/node_modules/zod/src/v3/locales/en.ts +124 -0
  160. package/node_modules/zod/src/v3/standard-schema.ts +113 -0
  161. package/node_modules/zod/src/v3/tests/Mocker.ts +54 -0
  162. package/node_modules/zod/src/v3/tests/all-errors.test.ts +157 -0
  163. package/node_modules/zod/src/v3/tests/anyunknown.test.ts +28 -0
  164. package/node_modules/zod/src/v3/tests/array.test.ts +71 -0
  165. package/node_modules/zod/src/v3/tests/async-parsing.test.ts +388 -0
  166. package/node_modules/zod/src/v3/tests/async-refinements.test.ts +46 -0
  167. package/node_modules/zod/src/v3/tests/base.test.ts +29 -0
  168. package/node_modules/zod/src/v3/tests/bigint.test.ts +55 -0
  169. package/node_modules/zod/src/v3/tests/branded.test.ts +53 -0
  170. package/node_modules/zod/src/v3/tests/catch.test.ts +220 -0
  171. package/node_modules/zod/src/v3/tests/coerce.test.ts +133 -0
  172. package/node_modules/zod/src/v3/tests/complex.test.ts +70 -0
  173. package/node_modules/zod/src/v3/tests/custom.test.ts +31 -0
  174. package/node_modules/zod/src/v3/tests/date.test.ts +32 -0
  175. package/node_modules/zod/src/v3/tests/deepmasking.test.ts +186 -0
  176. package/node_modules/zod/src/v3/tests/default.test.ts +112 -0
  177. package/node_modules/zod/src/v3/tests/description.test.ts +33 -0
  178. package/node_modules/zod/src/v3/tests/discriminated-unions.test.ts +315 -0
  179. package/node_modules/zod/src/v3/tests/enum.test.ts +80 -0
  180. package/node_modules/zod/src/v3/tests/error.test.ts +551 -0
  181. package/node_modules/zod/src/v3/tests/firstparty.test.ts +87 -0
  182. package/node_modules/zod/src/v3/tests/firstpartyschematypes.test.ts +21 -0
  183. package/node_modules/zod/src/v3/tests/function.test.ts +261 -0
  184. package/node_modules/zod/src/v3/tests/generics.test.ts +48 -0
  185. package/node_modules/zod/src/v3/tests/instanceof.test.ts +37 -0
  186. package/node_modules/zod/src/v3/tests/intersection.test.ts +110 -0
  187. package/node_modules/zod/src/v3/tests/language-server.source.ts +76 -0
  188. package/node_modules/zod/src/v3/tests/language-server.test.ts +207 -0
  189. package/node_modules/zod/src/v3/tests/literal.test.ts +36 -0
  190. package/node_modules/zod/src/v3/tests/map.test.ts +110 -0
  191. package/node_modules/zod/src/v3/tests/masking.test.ts +4 -0
  192. package/node_modules/zod/src/v3/tests/mocker.test.ts +19 -0
  193. package/node_modules/zod/src/v3/tests/nan.test.ts +24 -0
  194. package/node_modules/zod/src/v3/tests/nativeEnum.test.ts +87 -0
  195. package/node_modules/zod/src/v3/tests/nullable.test.ts +42 -0
  196. package/node_modules/zod/src/v3/tests/number.test.ts +176 -0
  197. package/node_modules/zod/src/v3/tests/object-augmentation.test.ts +29 -0
  198. package/node_modules/zod/src/v3/tests/object-in-es5-env.test.ts +29 -0
  199. package/node_modules/zod/src/v3/tests/object.test.ts +434 -0
  200. package/node_modules/zod/src/v3/tests/optional.test.ts +42 -0
  201. package/node_modules/zod/src/v3/tests/parseUtil.test.ts +23 -0
  202. package/node_modules/zod/src/v3/tests/parser.test.ts +41 -0
  203. package/node_modules/zod/src/v3/tests/partials.test.ts +243 -0
  204. package/node_modules/zod/src/v3/tests/pickomit.test.ts +111 -0
  205. package/node_modules/zod/src/v3/tests/pipeline.test.ts +29 -0
  206. package/node_modules/zod/src/v3/tests/preprocess.test.ts +186 -0
  207. package/node_modules/zod/src/v3/tests/primitive.test.ts +440 -0
  208. package/node_modules/zod/src/v3/tests/promise.test.ts +90 -0
  209. package/node_modules/zod/src/v3/tests/readonly.test.ts +194 -0
  210. package/node_modules/zod/src/v3/tests/record.test.ts +171 -0
  211. package/node_modules/zod/src/v3/tests/recursive.test.ts +197 -0
  212. package/node_modules/zod/src/v3/tests/refine.test.ts +313 -0
  213. package/node_modules/zod/src/v3/tests/safeparse.test.ts +27 -0
  214. package/node_modules/zod/src/v3/tests/set.test.ts +142 -0
  215. package/node_modules/zod/src/v3/tests/standard-schema.test.ts +83 -0
  216. package/node_modules/zod/src/v3/tests/string.test.ts +916 -0
  217. package/node_modules/zod/src/v3/tests/transformer.test.ts +233 -0
  218. package/node_modules/zod/src/v3/tests/tuple.test.ts +90 -0
  219. package/node_modules/zod/src/v3/tests/unions.test.ts +57 -0
  220. package/node_modules/zod/src/v3/tests/validations.test.ts +133 -0
  221. package/node_modules/zod/src/v3/tests/void.test.ts +15 -0
  222. package/node_modules/zod/src/v3/types.ts +5138 -0
  223. package/node_modules/zod/src/v4/classic/checks.ts +32 -0
  224. package/node_modules/zod/src/v4/classic/coerce.ts +27 -0
  225. package/node_modules/zod/src/v4/classic/compat.ts +70 -0
  226. package/node_modules/zod/src/v4/classic/errors.ts +82 -0
  227. package/node_modules/zod/src/v4/classic/external.ts +51 -0
  228. package/node_modules/zod/src/v4/classic/from-json-schema.ts +536 -0
  229. package/node_modules/zod/src/v4/classic/index.ts +5 -0
  230. package/node_modules/zod/src/v4/classic/iso.ts +90 -0
  231. package/node_modules/zod/src/v4/classic/parse.ts +82 -0
  232. package/node_modules/zod/src/v4/classic/schemas.ts +2352 -0
  233. package/node_modules/zod/src/v4/classic/tests/anyunknown.test.ts +26 -0
  234. package/node_modules/zod/src/v4/classic/tests/array.test.ts +264 -0
  235. package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +210 -0
  236. package/node_modules/zod/src/v4/classic/tests/async-parsing.test.ts +381 -0
  237. package/node_modules/zod/src/v4/classic/tests/async-refinements.test.ts +68 -0
  238. package/node_modules/zod/src/v4/classic/tests/base.test.ts +7 -0
  239. package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +54 -0
  240. package/node_modules/zod/src/v4/classic/tests/brand.test.ts +63 -0
  241. package/node_modules/zod/src/v4/classic/tests/catch.test.ts +276 -0
  242. package/node_modules/zod/src/v4/classic/tests/coalesce.test.ts +20 -0
  243. package/node_modules/zod/src/v4/classic/tests/codec-examples.test.ts +573 -0
  244. package/node_modules/zod/src/v4/classic/tests/codec.test.ts +562 -0
  245. package/node_modules/zod/src/v4/classic/tests/coerce.test.ts +160 -0
  246. package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +374 -0
  247. package/node_modules/zod/src/v4/classic/tests/custom.test.ts +40 -0
  248. package/node_modules/zod/src/v4/classic/tests/date.test.ts +31 -0
  249. package/node_modules/zod/src/v4/classic/tests/datetime.test.ts +302 -0
  250. package/node_modules/zod/src/v4/classic/tests/default.test.ts +365 -0
  251. package/node_modules/zod/src/v4/classic/tests/describe-meta-checks.test.ts +27 -0
  252. package/node_modules/zod/src/v4/classic/tests/description.test.ts +32 -0
  253. package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +661 -0
  254. package/node_modules/zod/src/v4/classic/tests/enum.test.ts +285 -0
  255. package/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +595 -0
  256. package/node_modules/zod/src/v4/classic/tests/error.test.ts +711 -0
  257. package/node_modules/zod/src/v4/classic/tests/file.test.ts +96 -0
  258. package/node_modules/zod/src/v4/classic/tests/firstparty.test.ts +179 -0
  259. package/node_modules/zod/src/v4/classic/tests/fix-json-issue.test.ts +26 -0
  260. package/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +537 -0
  261. package/node_modules/zod/src/v4/classic/tests/function.test.ts +308 -0
  262. package/node_modules/zod/src/v4/classic/tests/generics.test.ts +72 -0
  263. package/node_modules/zod/src/v4/classic/tests/hash.test.ts +68 -0
  264. package/node_modules/zod/src/v4/classic/tests/index.test.ts +898 -0
  265. package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +34 -0
  266. package/node_modules/zod/src/v4/classic/tests/intersection.test.ts +171 -0
  267. package/node_modules/zod/src/v4/classic/tests/json.test.ts +109 -0
  268. package/node_modules/zod/src/v4/classic/tests/lazy.test.ts +227 -0
  269. package/node_modules/zod/src/v4/classic/tests/literal.test.ts +117 -0
  270. package/node_modules/zod/src/v4/classic/tests/map.test.ts +196 -0
  271. package/node_modules/zod/src/v4/classic/tests/nan.test.ts +21 -0
  272. package/node_modules/zod/src/v4/classic/tests/nested-refine.test.ts +168 -0
  273. package/node_modules/zod/src/v4/classic/tests/nonoptional.test.ts +101 -0
  274. package/node_modules/zod/src/v4/classic/tests/nullable.test.ts +22 -0
  275. package/node_modules/zod/src/v4/classic/tests/number.test.ts +270 -0
  276. package/node_modules/zod/src/v4/classic/tests/object.test.ts +609 -0
  277. package/node_modules/zod/src/v4/classic/tests/optional.test.ts +136 -0
  278. package/node_modules/zod/src/v4/classic/tests/partial.test.ts +340 -0
  279. package/node_modules/zod/src/v4/classic/tests/pickomit.test.ts +127 -0
  280. package/node_modules/zod/src/v4/classic/tests/pipe.test.ts +101 -0
  281. package/node_modules/zod/src/v4/classic/tests/prefault.test.ts +74 -0
  282. package/node_modules/zod/src/v4/classic/tests/preprocess.test.ts +282 -0
  283. package/node_modules/zod/src/v4/classic/tests/primitive.test.ts +175 -0
  284. package/node_modules/zod/src/v4/classic/tests/promise.test.ts +81 -0
  285. package/node_modules/zod/src/v4/classic/tests/prototypes.test.ts +23 -0
  286. package/node_modules/zod/src/v4/classic/tests/readonly.test.ts +252 -0
  287. package/node_modules/zod/src/v4/classic/tests/record.test.ts +525 -0
  288. package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +582 -0
  289. package/node_modules/zod/src/v4/classic/tests/refine.test.ts +605 -0
  290. package/node_modules/zod/src/v4/classic/tests/registries.test.ts +208 -0
  291. package/node_modules/zod/src/v4/classic/tests/set.test.ts +181 -0
  292. package/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +134 -0
  293. package/node_modules/zod/src/v4/classic/tests/string-formats.test.ts +125 -0
  294. package/node_modules/zod/src/v4/classic/tests/string.test.ts +1152 -0
  295. package/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +106 -0
  296. package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +771 -0
  297. package/node_modules/zod/src/v4/classic/tests/to-json-schema-methods.test.ts +438 -0
  298. package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +2755 -0
  299. package/node_modules/zod/src/v4/classic/tests/transform.test.ts +361 -0
  300. package/node_modules/zod/src/v4/classic/tests/tuple.test.ts +181 -0
  301. package/node_modules/zod/src/v4/classic/tests/union.test.ts +219 -0
  302. package/node_modules/zod/src/v4/classic/tests/url.test.ts +13 -0
  303. package/node_modules/zod/src/v4/classic/tests/validations.test.ts +283 -0
  304. package/node_modules/zod/src/v4/classic/tests/void.test.ts +12 -0
  305. package/node_modules/zod/src/v4/core/api.ts +1681 -0
  306. package/node_modules/zod/src/v4/core/checks.ts +1287 -0
  307. package/node_modules/zod/src/v4/core/config.ts +15 -0
  308. package/node_modules/zod/src/v4/core/core.ts +128 -0
  309. package/node_modules/zod/src/v4/core/doc.ts +44 -0
  310. package/node_modules/zod/src/v4/core/errors.ts +424 -0
  311. package/node_modules/zod/src/v4/core/index.ts +16 -0
  312. package/node_modules/zod/src/v4/core/json-schema-generator.ts +124 -0
  313. package/node_modules/zod/src/v4/core/json-schema-processors.ts +630 -0
  314. package/node_modules/zod/src/v4/core/json-schema.ts +147 -0
  315. package/node_modules/zod/src/v4/core/parse.ts +195 -0
  316. package/node_modules/zod/src/v4/core/regexes.ts +182 -0
  317. package/node_modules/zod/src/v4/core/registries.ts +108 -0
  318. package/node_modules/zod/src/v4/core/schemas.ts +4418 -0
  319. package/node_modules/zod/src/v4/core/standard-schema.ts +159 -0
  320. package/node_modules/zod/src/v4/core/tests/extend.test.ts +59 -0
  321. package/node_modules/zod/src/v4/core/tests/index.test.ts +46 -0
  322. package/node_modules/zod/src/v4/core/tests/locales/be.test.ts +124 -0
  323. package/node_modules/zod/src/v4/core/tests/locales/en.test.ts +22 -0
  324. package/node_modules/zod/src/v4/core/tests/locales/es.test.ts +181 -0
  325. package/node_modules/zod/src/v4/core/tests/locales/he.test.ts +379 -0
  326. package/node_modules/zod/src/v4/core/tests/locales/nl.test.ts +46 -0
  327. package/node_modules/zod/src/v4/core/tests/locales/ru.test.ts +128 -0
  328. package/node_modules/zod/src/v4/core/tests/locales/tr.test.ts +69 -0
  329. package/node_modules/zod/src/v4/core/tests/record-constructor.test.ts +67 -0
  330. package/node_modules/zod/src/v4/core/tests/recursive-tuples.test.ts +45 -0
  331. package/node_modules/zod/src/v4/core/to-json-schema.ts +554 -0
  332. package/node_modules/zod/src/v4/core/util.ts +921 -0
  333. package/node_modules/zod/src/v4/core/versions.ts +5 -0
  334. package/node_modules/zod/src/v4/core/zsf.ts +323 -0
  335. package/node_modules/zod/src/v4/index.ts +4 -0
  336. package/node_modules/zod/src/v4/locales/ar.ts +125 -0
  337. package/node_modules/zod/src/v4/locales/az.ts +121 -0
  338. package/node_modules/zod/src/v4/locales/be.ts +184 -0
  339. package/node_modules/zod/src/v4/locales/bg.ts +136 -0
  340. package/node_modules/zod/src/v4/locales/ca.ts +127 -0
  341. package/node_modules/zod/src/v4/locales/cs.ts +142 -0
  342. package/node_modules/zod/src/v4/locales/da.ts +141 -0
  343. package/node_modules/zod/src/v4/locales/de.ts +124 -0
  344. package/node_modules/zod/src/v4/locales/en.ts +128 -0
  345. package/node_modules/zod/src/v4/locales/eo.ts +125 -0
  346. package/node_modules/zod/src/v4/locales/es.ts +159 -0
  347. package/node_modules/zod/src/v4/locales/fa.ts +134 -0
  348. package/node_modules/zod/src/v4/locales/fi.ts +131 -0
  349. package/node_modules/zod/src/v4/locales/fr-CA.ts +126 -0
  350. package/node_modules/zod/src/v4/locales/fr.ts +124 -0
  351. package/node_modules/zod/src/v4/locales/he.ts +256 -0
  352. package/node_modules/zod/src/v4/locales/hu.ts +126 -0
  353. package/node_modules/zod/src/v4/locales/id.ts +125 -0
  354. package/node_modules/zod/src/v4/locales/index.ts +47 -0
  355. package/node_modules/zod/src/v4/locales/is.ts +127 -0
  356. package/node_modules/zod/src/v4/locales/it.ts +125 -0
  357. package/node_modules/zod/src/v4/locales/ja.ts +122 -0
  358. package/node_modules/zod/src/v4/locales/ka.ts +138 -0
  359. package/node_modules/zod/src/v4/locales/kh.ts +7 -0
  360. package/node_modules/zod/src/v4/locales/km.ts +126 -0
  361. package/node_modules/zod/src/v4/locales/ko.ts +131 -0
  362. package/node_modules/zod/src/v4/locales/lt.ts +265 -0
  363. package/node_modules/zod/src/v4/locales/mk.ts +127 -0
  364. package/node_modules/zod/src/v4/locales/ms.ts +124 -0
  365. package/node_modules/zod/src/v4/locales/nl.ts +126 -0
  366. package/node_modules/zod/src/v4/locales/no.ts +124 -0
  367. package/node_modules/zod/src/v4/locales/ota.ts +125 -0
  368. package/node_modules/zod/src/v4/locales/pl.ts +126 -0
  369. package/node_modules/zod/src/v4/locales/ps.ts +133 -0
  370. package/node_modules/zod/src/v4/locales/pt.ts +123 -0
  371. package/node_modules/zod/src/v4/locales/ru.ts +184 -0
  372. package/node_modules/zod/src/v4/locales/sl.ts +126 -0
  373. package/node_modules/zod/src/v4/locales/sv.ts +127 -0
  374. package/node_modules/zod/src/v4/locales/ta.ts +125 -0
  375. package/node_modules/zod/src/v4/locales/th.ts +126 -0
  376. package/node_modules/zod/src/v4/locales/tr.ts +121 -0
  377. package/node_modules/zod/src/v4/locales/ua.ts +7 -0
  378. package/node_modules/zod/src/v4/locales/uk.ts +126 -0
  379. package/node_modules/zod/src/v4/locales/ur.ts +126 -0
  380. package/node_modules/zod/src/v4/locales/vi.ts +125 -0
  381. package/node_modules/zod/src/v4/locales/yo.ts +131 -0
  382. package/node_modules/zod/src/v4/locales/zh-CN.ts +123 -0
  383. package/node_modules/zod/src/v4/locales/zh-TW.ts +125 -0
  384. package/node_modules/zod/src/v4/mini/checks.ts +32 -0
  385. package/node_modules/zod/src/v4/mini/coerce.ts +22 -0
  386. package/node_modules/zod/src/v4/mini/external.ts +40 -0
  387. package/node_modules/zod/src/v4/mini/index.ts +3 -0
  388. package/node_modules/zod/src/v4/mini/iso.ts +62 -0
  389. package/node_modules/zod/src/v4/mini/parse.ts +14 -0
  390. package/node_modules/zod/src/v4/mini/schemas.ts +1781 -0
  391. package/node_modules/zod/src/v4/mini/tests/assignability.test.ts +129 -0
  392. package/node_modules/zod/src/v4/mini/tests/brand.test.ts +51 -0
  393. package/node_modules/zod/src/v4/mini/tests/checks.test.ts +144 -0
  394. package/node_modules/zod/src/v4/mini/tests/codec.test.ts +529 -0
  395. package/node_modules/zod/src/v4/mini/tests/computed.test.ts +36 -0
  396. package/node_modules/zod/src/v4/mini/tests/error.test.ts +22 -0
  397. package/node_modules/zod/src/v4/mini/tests/functions.test.ts +5 -0
  398. package/node_modules/zod/src/v4/mini/tests/index.test.ts +922 -0
  399. package/node_modules/zod/src/v4/mini/tests/number.test.ts +95 -0
  400. package/node_modules/zod/src/v4/mini/tests/object.test.ts +200 -0
  401. package/node_modules/zod/src/v4/mini/tests/prototypes.test.ts +43 -0
  402. package/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +275 -0
  403. package/node_modules/zod/src/v4/mini/tests/standard-schema.test.ts +17 -0
  404. package/node_modules/zod/src/v4/mini/tests/string.test.ts +347 -0
  405. package/node_modules/zod/src/v4-mini/index.ts +1 -0
  406. package/node_modules/zod/v3/ZodError.cjs +138 -0
  407. package/node_modules/zod/v3/ZodError.d.cts +164 -0
  408. package/node_modules/zod/v3/ZodError.d.ts +164 -0
  409. package/node_modules/zod/v3/ZodError.js +133 -0
  410. package/node_modules/zod/v3/errors.cjs +17 -0
  411. package/node_modules/zod/v3/errors.d.cts +5 -0
  412. package/node_modules/zod/v3/errors.d.ts +5 -0
  413. package/node_modules/zod/v3/errors.js +9 -0
  414. package/node_modules/zod/v3/external.cjs +22 -0
  415. package/node_modules/zod/v3/external.d.cts +6 -0
  416. package/node_modules/zod/v3/external.d.ts +6 -0
  417. package/node_modules/zod/v3/external.js +6 -0
  418. package/node_modules/zod/v3/helpers/enumUtil.cjs +2 -0
  419. package/node_modules/zod/v3/helpers/enumUtil.d.cts +8 -0
  420. package/node_modules/zod/v3/helpers/enumUtil.d.ts +8 -0
  421. package/node_modules/zod/v3/helpers/enumUtil.js +1 -0
  422. package/node_modules/zod/v3/helpers/errorUtil.cjs +9 -0
  423. package/node_modules/zod/v3/helpers/errorUtil.d.cts +9 -0
  424. package/node_modules/zod/v3/helpers/errorUtil.d.ts +9 -0
  425. package/node_modules/zod/v3/helpers/errorUtil.js +6 -0
  426. package/node_modules/zod/v3/helpers/parseUtil.cjs +124 -0
  427. package/node_modules/zod/v3/helpers/parseUtil.d.cts +78 -0
  428. package/node_modules/zod/v3/helpers/parseUtil.d.ts +78 -0
  429. package/node_modules/zod/v3/helpers/parseUtil.js +109 -0
  430. package/node_modules/zod/v3/helpers/partialUtil.cjs +2 -0
  431. package/node_modules/zod/v3/helpers/partialUtil.d.cts +8 -0
  432. package/node_modules/zod/v3/helpers/partialUtil.d.ts +8 -0
  433. package/node_modules/zod/v3/helpers/partialUtil.js +1 -0
  434. package/node_modules/zod/v3/helpers/typeAliases.cjs +2 -0
  435. package/node_modules/zod/v3/helpers/typeAliases.d.cts +2 -0
  436. package/node_modules/zod/v3/helpers/typeAliases.d.ts +2 -0
  437. package/node_modules/zod/v3/helpers/typeAliases.js +1 -0
  438. package/node_modules/zod/v3/helpers/util.cjs +137 -0
  439. package/node_modules/zod/v3/helpers/util.d.cts +85 -0
  440. package/node_modules/zod/v3/helpers/util.d.ts +85 -0
  441. package/node_modules/zod/v3/helpers/util.js +133 -0
  442. package/node_modules/zod/v3/index.cjs +33 -0
  443. package/node_modules/zod/v3/index.d.cts +4 -0
  444. package/node_modules/zod/v3/index.d.ts +4 -0
  445. package/node_modules/zod/v3/index.js +4 -0
  446. package/node_modules/zod/v3/locales/en.cjs +112 -0
  447. package/node_modules/zod/v3/locales/en.d.cts +3 -0
  448. package/node_modules/zod/v3/locales/en.d.ts +3 -0
  449. package/node_modules/zod/v3/locales/en.js +109 -0
  450. package/node_modules/zod/v3/package.json +6 -0
  451. package/node_modules/zod/v3/standard-schema.cjs +2 -0
  452. package/node_modules/zod/v3/standard-schema.d.cts +102 -0
  453. package/node_modules/zod/v3/standard-schema.d.ts +102 -0
  454. package/node_modules/zod/v3/standard-schema.js +1 -0
  455. package/node_modules/zod/v3/types.cjs +3777 -0
  456. package/node_modules/zod/v3/types.d.cts +1034 -0
  457. package/node_modules/zod/v3/types.d.ts +1034 -0
  458. package/node_modules/zod/v3/types.js +3695 -0
  459. package/node_modules/zod/v4/classic/checks.cjs +33 -0
  460. package/node_modules/zod/v4/classic/checks.d.cts +1 -0
  461. package/node_modules/zod/v4/classic/checks.d.ts +1 -0
  462. package/node_modules/zod/v4/classic/checks.js +1 -0
  463. package/node_modules/zod/v4/classic/coerce.cjs +47 -0
  464. package/node_modules/zod/v4/classic/coerce.d.cts +17 -0
  465. package/node_modules/zod/v4/classic/coerce.d.ts +17 -0
  466. package/node_modules/zod/v4/classic/coerce.js +17 -0
  467. package/node_modules/zod/v4/classic/compat.cjs +61 -0
  468. package/node_modules/zod/v4/classic/compat.d.cts +50 -0
  469. package/node_modules/zod/v4/classic/compat.d.ts +50 -0
  470. package/node_modules/zod/v4/classic/compat.js +31 -0
  471. package/node_modules/zod/v4/classic/errors.cjs +74 -0
  472. package/node_modules/zod/v4/classic/errors.d.cts +30 -0
  473. package/node_modules/zod/v4/classic/errors.d.ts +30 -0
  474. package/node_modules/zod/v4/classic/errors.js +48 -0
  475. package/node_modules/zod/v4/classic/external.cjs +73 -0
  476. package/node_modules/zod/v4/classic/external.d.cts +15 -0
  477. package/node_modules/zod/v4/classic/external.d.ts +15 -0
  478. package/node_modules/zod/v4/classic/external.js +20 -0
  479. package/node_modules/zod/v4/classic/from-json-schema.cjs +511 -0
  480. package/node_modules/zod/v4/classic/from-json-schema.d.cts +10 -0
  481. package/node_modules/zod/v4/classic/from-json-schema.d.ts +10 -0
  482. package/node_modules/zod/v4/classic/from-json-schema.js +485 -0
  483. package/node_modules/zod/v4/classic/index.cjs +33 -0
  484. package/node_modules/zod/v4/classic/index.d.cts +4 -0
  485. package/node_modules/zod/v4/classic/index.d.ts +4 -0
  486. package/node_modules/zod/v4/classic/index.js +4 -0
  487. package/node_modules/zod/v4/classic/iso.cjs +60 -0
  488. package/node_modules/zod/v4/classic/iso.d.cts +22 -0
  489. package/node_modules/zod/v4/classic/iso.d.ts +22 -0
  490. package/node_modules/zod/v4/classic/iso.js +30 -0
  491. package/node_modules/zod/v4/classic/package.json +6 -0
  492. package/node_modules/zod/v4/classic/parse.cjs +41 -0
  493. package/node_modules/zod/v4/classic/parse.d.cts +31 -0
  494. package/node_modules/zod/v4/classic/parse.d.ts +31 -0
  495. package/node_modules/zod/v4/classic/parse.js +15 -0
  496. package/node_modules/zod/v4/classic/schemas.cjs +1240 -0
  497. package/node_modules/zod/v4/classic/schemas.d.cts +726 -0
  498. package/node_modules/zod/v4/classic/schemas.d.ts +726 -0
  499. package/node_modules/zod/v4/classic/schemas.js +1126 -0
  500. package/node_modules/zod/v4/core/api.cjs +1109 -0
  501. package/node_modules/zod/v4/core/api.d.cts +304 -0
  502. package/node_modules/zod/v4/core/api.d.ts +304 -0
  503. package/node_modules/zod/v4/core/api.js +969 -0
  504. package/node_modules/zod/v4/core/checks.cjs +595 -0
  505. package/node_modules/zod/v4/core/checks.d.cts +278 -0
  506. package/node_modules/zod/v4/core/checks.d.ts +278 -0
  507. package/node_modules/zod/v4/core/checks.js +569 -0
  508. package/node_modules/zod/v4/core/core.cjs +83 -0
  509. package/node_modules/zod/v4/core/core.d.cts +52 -0
  510. package/node_modules/zod/v4/core/core.d.ts +52 -0
  511. package/node_modules/zod/v4/core/core.js +76 -0
  512. package/node_modules/zod/v4/core/doc.cjs +39 -0
  513. package/node_modules/zod/v4/core/doc.d.cts +14 -0
  514. package/node_modules/zod/v4/core/doc.d.ts +14 -0
  515. package/node_modules/zod/v4/core/doc.js +35 -0
  516. package/node_modules/zod/v4/core/errors.cjs +213 -0
  517. package/node_modules/zod/v4/core/errors.d.cts +219 -0
  518. package/node_modules/zod/v4/core/errors.d.ts +219 -0
  519. package/node_modules/zod/v4/core/errors.js +182 -0
  520. package/node_modules/zod/v4/core/index.cjs +47 -0
  521. package/node_modules/zod/v4/core/index.d.cts +16 -0
  522. package/node_modules/zod/v4/core/index.d.ts +16 -0
  523. package/node_modules/zod/v4/core/index.js +16 -0
  524. package/node_modules/zod/v4/core/json-schema-generator.cjs +99 -0
  525. package/node_modules/zod/v4/core/json-schema-generator.d.cts +64 -0
  526. package/node_modules/zod/v4/core/json-schema-generator.d.ts +64 -0
  527. package/node_modules/zod/v4/core/json-schema-generator.js +95 -0
  528. package/node_modules/zod/v4/core/json-schema-processors.cjs +617 -0
  529. package/node_modules/zod/v4/core/json-schema-processors.d.cts +49 -0
  530. package/node_modules/zod/v4/core/json-schema-processors.d.ts +49 -0
  531. package/node_modules/zod/v4/core/json-schema-processors.js +574 -0
  532. package/node_modules/zod/v4/core/json-schema.cjs +2 -0
  533. package/node_modules/zod/v4/core/json-schema.d.cts +88 -0
  534. package/node_modules/zod/v4/core/json-schema.d.ts +88 -0
  535. package/node_modules/zod/v4/core/json-schema.js +1 -0
  536. package/node_modules/zod/v4/core/package.json +6 -0
  537. package/node_modules/zod/v4/core/parse.cjs +131 -0
  538. package/node_modules/zod/v4/core/parse.d.cts +49 -0
  539. package/node_modules/zod/v4/core/parse.d.ts +49 -0
  540. package/node_modules/zod/v4/core/parse.js +93 -0
  541. package/node_modules/zod/v4/core/regexes.cjs +165 -0
  542. package/node_modules/zod/v4/core/regexes.d.cts +79 -0
  543. package/node_modules/zod/v4/core/regexes.d.ts +79 -0
  544. package/node_modules/zod/v4/core/regexes.js +132 -0
  545. package/node_modules/zod/v4/core/registries.cjs +59 -0
  546. package/node_modules/zod/v4/core/registries.d.cts +35 -0
  547. package/node_modules/zod/v4/core/registries.d.ts +35 -0
  548. package/node_modules/zod/v4/core/registries.js +54 -0
  549. package/node_modules/zod/v4/core/schemas.cjs +2040 -0
  550. package/node_modules/zod/v4/core/schemas.d.cts +1135 -0
  551. package/node_modules/zod/v4/core/schemas.d.ts +1135 -0
  552. package/node_modules/zod/v4/core/schemas.js +2009 -0
  553. package/node_modules/zod/v4/core/standard-schema.cjs +2 -0
  554. package/node_modules/zod/v4/core/standard-schema.d.cts +126 -0
  555. package/node_modules/zod/v4/core/standard-schema.d.ts +126 -0
  556. package/node_modules/zod/v4/core/standard-schema.js +1 -0
  557. package/node_modules/zod/v4/core/to-json-schema.cjs +392 -0
  558. package/node_modules/zod/v4/core/to-json-schema.d.cts +113 -0
  559. package/node_modules/zod/v4/core/to-json-schema.d.ts +113 -0
  560. package/node_modules/zod/v4/core/to-json-schema.js +383 -0
  561. package/node_modules/zod/v4/core/util.cjs +669 -0
  562. package/node_modules/zod/v4/core/util.d.cts +198 -0
  563. package/node_modules/zod/v4/core/util.d.ts +198 -0
  564. package/node_modules/zod/v4/core/util.js +611 -0
  565. package/node_modules/zod/v4/core/versions.cjs +8 -0
  566. package/node_modules/zod/v4/core/versions.d.cts +5 -0
  567. package/node_modules/zod/v4/core/versions.d.ts +5 -0
  568. package/node_modules/zod/v4/core/versions.js +5 -0
  569. package/node_modules/zod/v4/index.cjs +22 -0
  570. package/node_modules/zod/v4/index.d.cts +3 -0
  571. package/node_modules/zod/v4/index.d.ts +3 -0
  572. package/node_modules/zod/v4/index.js +3 -0
  573. package/node_modules/zod/v4/locales/ar.cjs +143 -0
  574. package/node_modules/zod/v4/locales/ar.d.cts +5 -0
  575. package/node_modules/zod/v4/locales/ar.d.ts +4 -0
  576. package/node_modules/zod/v4/locales/ar.js +116 -0
  577. package/node_modules/zod/v4/locales/az.cjs +142 -0
  578. package/node_modules/zod/v4/locales/az.d.cts +5 -0
  579. package/node_modules/zod/v4/locales/az.d.ts +4 -0
  580. package/node_modules/zod/v4/locales/az.js +115 -0
  581. package/node_modules/zod/v4/locales/be.cjs +191 -0
  582. package/node_modules/zod/v4/locales/be.d.cts +5 -0
  583. package/node_modules/zod/v4/locales/be.d.ts +4 -0
  584. package/node_modules/zod/v4/locales/be.js +164 -0
  585. package/node_modules/zod/v4/locales/bg.cjs +156 -0
  586. package/node_modules/zod/v4/locales/bg.d.cts +5 -0
  587. package/node_modules/zod/v4/locales/bg.d.ts +5 -0
  588. package/node_modules/zod/v4/locales/bg.js +128 -0
  589. package/node_modules/zod/v4/locales/ca.cjs +145 -0
  590. package/node_modules/zod/v4/locales/ca.d.cts +5 -0
  591. package/node_modules/zod/v4/locales/ca.d.ts +4 -0
  592. package/node_modules/zod/v4/locales/ca.js +118 -0
  593. package/node_modules/zod/v4/locales/cs.cjs +162 -0
  594. package/node_modules/zod/v4/locales/cs.d.cts +5 -0
  595. package/node_modules/zod/v4/locales/cs.d.ts +4 -0
  596. package/node_modules/zod/v4/locales/cs.js +135 -0
  597. package/node_modules/zod/v4/locales/da.cjs +158 -0
  598. package/node_modules/zod/v4/locales/da.d.cts +5 -0
  599. package/node_modules/zod/v4/locales/da.d.ts +4 -0
  600. package/node_modules/zod/v4/locales/da.js +131 -0
  601. package/node_modules/zod/v4/locales/de.cjs +143 -0
  602. package/node_modules/zod/v4/locales/de.d.cts +5 -0
  603. package/node_modules/zod/v4/locales/de.d.ts +4 -0
  604. package/node_modules/zod/v4/locales/de.js +116 -0
  605. package/node_modules/zod/v4/locales/en.cjs +146 -0
  606. package/node_modules/zod/v4/locales/en.d.cts +5 -0
  607. package/node_modules/zod/v4/locales/en.d.ts +5 -0
  608. package/node_modules/zod/v4/locales/en.js +118 -0
  609. package/node_modules/zod/v4/locales/eo.cjs +144 -0
  610. package/node_modules/zod/v4/locales/eo.d.cts +5 -0
  611. package/node_modules/zod/v4/locales/eo.d.ts +5 -0
  612. package/node_modules/zod/v4/locales/eo.js +116 -0
  613. package/node_modules/zod/v4/locales/es.cjs +176 -0
  614. package/node_modules/zod/v4/locales/es.d.cts +5 -0
  615. package/node_modules/zod/v4/locales/es.d.ts +4 -0
  616. package/node_modules/zod/v4/locales/es.js +149 -0
  617. package/node_modules/zod/v4/locales/fa.cjs +149 -0
  618. package/node_modules/zod/v4/locales/fa.d.cts +5 -0
  619. package/node_modules/zod/v4/locales/fa.d.ts +4 -0
  620. package/node_modules/zod/v4/locales/fa.js +122 -0
  621. package/node_modules/zod/v4/locales/fi.cjs +149 -0
  622. package/node_modules/zod/v4/locales/fi.d.cts +5 -0
  623. package/node_modules/zod/v4/locales/fi.d.ts +4 -0
  624. package/node_modules/zod/v4/locales/fi.js +122 -0
  625. package/node_modules/zod/v4/locales/fr-CA.cjs +144 -0
  626. package/node_modules/zod/v4/locales/fr-CA.d.cts +5 -0
  627. package/node_modules/zod/v4/locales/fr-CA.d.ts +4 -0
  628. package/node_modules/zod/v4/locales/fr-CA.js +117 -0
  629. package/node_modules/zod/v4/locales/fr.cjs +143 -0
  630. package/node_modules/zod/v4/locales/fr.d.cts +5 -0
  631. package/node_modules/zod/v4/locales/fr.d.ts +4 -0
  632. package/node_modules/zod/v4/locales/fr.js +116 -0
  633. package/node_modules/zod/v4/locales/he.cjs +255 -0
  634. package/node_modules/zod/v4/locales/he.d.cts +5 -0
  635. package/node_modules/zod/v4/locales/he.d.ts +4 -0
  636. package/node_modules/zod/v4/locales/he.js +228 -0
  637. package/node_modules/zod/v4/locales/hu.cjs +144 -0
  638. package/node_modules/zod/v4/locales/hu.d.cts +5 -0
  639. package/node_modules/zod/v4/locales/hu.d.ts +4 -0
  640. package/node_modules/zod/v4/locales/hu.js +117 -0
  641. package/node_modules/zod/v4/locales/id.cjs +143 -0
  642. package/node_modules/zod/v4/locales/id.d.cts +5 -0
  643. package/node_modules/zod/v4/locales/id.d.ts +4 -0
  644. package/node_modules/zod/v4/locales/id.js +116 -0
  645. package/node_modules/zod/v4/locales/index.cjs +100 -0
  646. package/node_modules/zod/v4/locales/index.d.cts +47 -0
  647. package/node_modules/zod/v4/locales/index.d.ts +47 -0
  648. package/node_modules/zod/v4/locales/index.js +47 -0
  649. package/node_modules/zod/v4/locales/is.cjs +145 -0
  650. package/node_modules/zod/v4/locales/is.d.cts +5 -0
  651. package/node_modules/zod/v4/locales/is.d.ts +5 -0
  652. package/node_modules/zod/v4/locales/is.js +117 -0
  653. package/node_modules/zod/v4/locales/it.cjs +144 -0
  654. package/node_modules/zod/v4/locales/it.d.cts +5 -0
  655. package/node_modules/zod/v4/locales/it.d.ts +4 -0
  656. package/node_modules/zod/v4/locales/it.js +117 -0
  657. package/node_modules/zod/v4/locales/ja.cjs +142 -0
  658. package/node_modules/zod/v4/locales/ja.d.cts +5 -0
  659. package/node_modules/zod/v4/locales/ja.d.ts +4 -0
  660. package/node_modules/zod/v4/locales/ja.js +115 -0
  661. package/node_modules/zod/v4/locales/ka.cjs +153 -0
  662. package/node_modules/zod/v4/locales/ka.d.cts +5 -0
  663. package/node_modules/zod/v4/locales/ka.d.ts +5 -0
  664. package/node_modules/zod/v4/locales/ka.js +125 -0
  665. package/node_modules/zod/v4/locales/kh.cjs +12 -0
  666. package/node_modules/zod/v4/locales/kh.d.cts +5 -0
  667. package/node_modules/zod/v4/locales/kh.d.ts +5 -0
  668. package/node_modules/zod/v4/locales/kh.js +5 -0
  669. package/node_modules/zod/v4/locales/km.cjs +144 -0
  670. package/node_modules/zod/v4/locales/km.d.cts +5 -0
  671. package/node_modules/zod/v4/locales/km.d.ts +4 -0
  672. package/node_modules/zod/v4/locales/km.js +117 -0
  673. package/node_modules/zod/v4/locales/ko.cjs +148 -0
  674. package/node_modules/zod/v4/locales/ko.d.cts +5 -0
  675. package/node_modules/zod/v4/locales/ko.d.ts +4 -0
  676. package/node_modules/zod/v4/locales/ko.js +121 -0
  677. package/node_modules/zod/v4/locales/lt.cjs +258 -0
  678. package/node_modules/zod/v4/locales/lt.d.cts +5 -0
  679. package/node_modules/zod/v4/locales/lt.d.ts +5 -0
  680. package/node_modules/zod/v4/locales/lt.js +230 -0
  681. package/node_modules/zod/v4/locales/mk.cjs +145 -0
  682. package/node_modules/zod/v4/locales/mk.d.cts +5 -0
  683. package/node_modules/zod/v4/locales/mk.d.ts +4 -0
  684. package/node_modules/zod/v4/locales/mk.js +118 -0
  685. package/node_modules/zod/v4/locales/ms.cjs +143 -0
  686. package/node_modules/zod/v4/locales/ms.d.cts +5 -0
  687. package/node_modules/zod/v4/locales/ms.d.ts +4 -0
  688. package/node_modules/zod/v4/locales/ms.js +116 -0
  689. package/node_modules/zod/v4/locales/nl.cjs +144 -0
  690. package/node_modules/zod/v4/locales/nl.d.cts +5 -0
  691. package/node_modules/zod/v4/locales/nl.d.ts +4 -0
  692. package/node_modules/zod/v4/locales/nl.js +117 -0
  693. package/node_modules/zod/v4/locales/no.cjs +143 -0
  694. package/node_modules/zod/v4/locales/no.d.cts +5 -0
  695. package/node_modules/zod/v4/locales/no.d.ts +4 -0
  696. package/node_modules/zod/v4/locales/no.js +116 -0
  697. package/node_modules/zod/v4/locales/ota.cjs +144 -0
  698. package/node_modules/zod/v4/locales/ota.d.cts +5 -0
  699. package/node_modules/zod/v4/locales/ota.d.ts +4 -0
  700. package/node_modules/zod/v4/locales/ota.js +117 -0
  701. package/node_modules/zod/v4/locales/package.json +6 -0
  702. package/node_modules/zod/v4/locales/pl.cjs +144 -0
  703. package/node_modules/zod/v4/locales/pl.d.cts +5 -0
  704. package/node_modules/zod/v4/locales/pl.d.ts +4 -0
  705. package/node_modules/zod/v4/locales/pl.js +117 -0
  706. package/node_modules/zod/v4/locales/ps.cjs +149 -0
  707. package/node_modules/zod/v4/locales/ps.d.cts +5 -0
  708. package/node_modules/zod/v4/locales/ps.d.ts +4 -0
  709. package/node_modules/zod/v4/locales/ps.js +122 -0
  710. package/node_modules/zod/v4/locales/pt.cjs +143 -0
  711. package/node_modules/zod/v4/locales/pt.d.cts +5 -0
  712. package/node_modules/zod/v4/locales/pt.d.ts +4 -0
  713. package/node_modules/zod/v4/locales/pt.js +116 -0
  714. package/node_modules/zod/v4/locales/ru.cjs +191 -0
  715. package/node_modules/zod/v4/locales/ru.d.cts +5 -0
  716. package/node_modules/zod/v4/locales/ru.d.ts +4 -0
  717. package/node_modules/zod/v4/locales/ru.js +164 -0
  718. package/node_modules/zod/v4/locales/sl.cjs +144 -0
  719. package/node_modules/zod/v4/locales/sl.d.cts +5 -0
  720. package/node_modules/zod/v4/locales/sl.d.ts +4 -0
  721. package/node_modules/zod/v4/locales/sl.js +117 -0
  722. package/node_modules/zod/v4/locales/sv.cjs +145 -0
  723. package/node_modules/zod/v4/locales/sv.d.cts +5 -0
  724. package/node_modules/zod/v4/locales/sv.d.ts +4 -0
  725. package/node_modules/zod/v4/locales/sv.js +118 -0
  726. package/node_modules/zod/v4/locales/ta.cjs +144 -0
  727. package/node_modules/zod/v4/locales/ta.d.cts +5 -0
  728. package/node_modules/zod/v4/locales/ta.d.ts +4 -0
  729. package/node_modules/zod/v4/locales/ta.js +117 -0
  730. package/node_modules/zod/v4/locales/th.cjs +144 -0
  731. package/node_modules/zod/v4/locales/th.d.cts +5 -0
  732. package/node_modules/zod/v4/locales/th.d.ts +4 -0
  733. package/node_modules/zod/v4/locales/th.js +117 -0
  734. package/node_modules/zod/v4/locales/tr.cjs +143 -0
  735. package/node_modules/zod/v4/locales/tr.d.cts +5 -0
  736. package/node_modules/zod/v4/locales/tr.d.ts +5 -0
  737. package/node_modules/zod/v4/locales/tr.js +115 -0
  738. package/node_modules/zod/v4/locales/ua.cjs +12 -0
  739. package/node_modules/zod/v4/locales/ua.d.cts +5 -0
  740. package/node_modules/zod/v4/locales/ua.d.ts +5 -0
  741. package/node_modules/zod/v4/locales/ua.js +5 -0
  742. package/node_modules/zod/v4/locales/uk.cjs +144 -0
  743. package/node_modules/zod/v4/locales/uk.d.cts +5 -0
  744. package/node_modules/zod/v4/locales/uk.d.ts +4 -0
  745. package/node_modules/zod/v4/locales/uk.js +117 -0
  746. package/node_modules/zod/v4/locales/ur.cjs +144 -0
  747. package/node_modules/zod/v4/locales/ur.d.cts +5 -0
  748. package/node_modules/zod/v4/locales/ur.d.ts +4 -0
  749. package/node_modules/zod/v4/locales/ur.js +117 -0
  750. package/node_modules/zod/v4/locales/vi.cjs +143 -0
  751. package/node_modules/zod/v4/locales/vi.d.cts +5 -0
  752. package/node_modules/zod/v4/locales/vi.d.ts +4 -0
  753. package/node_modules/zod/v4/locales/vi.js +116 -0
  754. package/node_modules/zod/v4/locales/yo.cjs +142 -0
  755. package/node_modules/zod/v4/locales/yo.d.cts +5 -0
  756. package/node_modules/zod/v4/locales/yo.d.ts +4 -0
  757. package/node_modules/zod/v4/locales/yo.js +115 -0
  758. package/node_modules/zod/v4/locales/zh-CN.cjs +143 -0
  759. package/node_modules/zod/v4/locales/zh-CN.d.cts +5 -0
  760. package/node_modules/zod/v4/locales/zh-CN.d.ts +4 -0
  761. package/node_modules/zod/v4/locales/zh-CN.js +116 -0
  762. package/node_modules/zod/v4/locales/zh-TW.cjs +144 -0
  763. package/node_modules/zod/v4/locales/zh-TW.d.cts +5 -0
  764. package/node_modules/zod/v4/locales/zh-TW.d.ts +4 -0
  765. package/node_modules/zod/v4/locales/zh-TW.js +117 -0
  766. package/node_modules/zod/v4/mini/checks.cjs +34 -0
  767. package/node_modules/zod/v4/mini/checks.d.cts +1 -0
  768. package/node_modules/zod/v4/mini/checks.d.ts +1 -0
  769. package/node_modules/zod/v4/mini/checks.js +1 -0
  770. package/node_modules/zod/v4/mini/coerce.cjs +47 -0
  771. package/node_modules/zod/v4/mini/coerce.d.cts +7 -0
  772. package/node_modules/zod/v4/mini/coerce.d.ts +7 -0
  773. package/node_modules/zod/v4/mini/coerce.js +17 -0
  774. package/node_modules/zod/v4/mini/external.cjs +63 -0
  775. package/node_modules/zod/v4/mini/external.d.cts +12 -0
  776. package/node_modules/zod/v4/mini/external.d.ts +12 -0
  777. package/node_modules/zod/v4/mini/external.js +14 -0
  778. package/node_modules/zod/v4/mini/index.cjs +32 -0
  779. package/node_modules/zod/v4/mini/index.d.cts +3 -0
  780. package/node_modules/zod/v4/mini/index.d.ts +3 -0
  781. package/node_modules/zod/v4/mini/index.js +3 -0
  782. package/node_modules/zod/v4/mini/iso.cjs +60 -0
  783. package/node_modules/zod/v4/mini/iso.d.cts +22 -0
  784. package/node_modules/zod/v4/mini/iso.d.ts +22 -0
  785. package/node_modules/zod/v4/mini/iso.js +30 -0
  786. package/node_modules/zod/v4/mini/package.json +6 -0
  787. package/node_modules/zod/v4/mini/parse.cjs +16 -0
  788. package/node_modules/zod/v4/mini/parse.d.cts +1 -0
  789. package/node_modules/zod/v4/mini/parse.d.ts +1 -0
  790. package/node_modules/zod/v4/mini/parse.js +1 -0
  791. package/node_modules/zod/v4/mini/schemas.cjs +929 -0
  792. package/node_modules/zod/v4/mini/schemas.d.cts +421 -0
  793. package/node_modules/zod/v4/mini/schemas.d.ts +421 -0
  794. package/node_modules/zod/v4/mini/schemas.js +809 -0
  795. package/node_modules/zod/v4/package.json +6 -0
  796. package/node_modules/zod/v4-mini/index.cjs +17 -0
  797. package/node_modules/zod/v4-mini/index.d.cts +1 -0
  798. package/node_modules/zod/v4-mini/index.d.ts +1 -0
  799. package/node_modules/zod/v4-mini/index.js +1 -0
  800. package/node_modules/zod/v4-mini/package.json +6 -0
  801. package/package.json +93 -0
  802. package/publish.sh +449 -0
@@ -0,0 +1,1681 @@
1
+ import * as checks from "./checks.js";
2
+ import type * as core from "./core.js";
3
+ import type * as errors from "./errors.js";
4
+ import * as registries from "./registries.js";
5
+ import * as schemas from "./schemas.js";
6
+ import * as util from "./util.js";
7
+
8
+ export type Params<
9
+ T extends schemas.$ZodType | checks.$ZodCheck,
10
+ IssueTypes extends errors.$ZodIssueBase,
11
+ OmitKeys extends keyof T["_zod"]["def"] = never,
12
+ > = util.Flatten<
13
+ Partial<
14
+ util.EmptyToNever<
15
+ Omit<T["_zod"]["def"], OmitKeys> &
16
+ ([IssueTypes] extends [never]
17
+ ? {} // unknown
18
+ : {
19
+ error?: string | errors.$ZodErrorMap<IssueTypes> | undefined;
20
+ /** @deprecated This parameter is deprecated. Use `error` instead. */
21
+ message?: string | undefined; // supported in Zod 3
22
+ })
23
+ >
24
+ >
25
+ >;
26
+
27
+ export type TypeParams<
28
+ T extends schemas.$ZodType = schemas.$ZodType & { _isst: never },
29
+ AlsoOmit extends Exclude<keyof T["_zod"]["def"], "type" | "checks" | "error"> = never,
30
+ > = Params<T, NonNullable<T["_zod"]["isst"]>, "type" | "checks" | "error" | AlsoOmit>;
31
+
32
+ // strips types that are not exposed in the public factory
33
+ // incl. `error`, `check`
34
+ export type CheckParams<
35
+ T extends checks.$ZodCheck = checks.$ZodCheck, // & { _issc: never },
36
+ AlsoOmit extends Exclude<keyof T["_zod"]["def"], "check" | "error"> = never,
37
+ > = Params<T, NonNullable<T["_zod"]["issc"]>, "check" | "error" | AlsoOmit>;
38
+
39
+ // strips types that are not exposed in the public factory
40
+ // incl. `type`, `checks`, `error`, `check`, `format`
41
+ export type StringFormatParams<
42
+ T extends schemas.$ZodStringFormat = schemas.$ZodStringFormat,
43
+ AlsoOmit extends Exclude<keyof T["_zod"]["def"], "type" | "coerce" | "checks" | "error" | "check" | "format"> = never,
44
+ > = Params<
45
+ T,
46
+ NonNullable<T["_zod"]["isst"] | T["_zod"]["issc"]>,
47
+ "type" | "coerce" | "checks" | "error" | "check" | "format" | AlsoOmit
48
+ >;
49
+
50
+ export type CheckStringFormatParams<
51
+ T extends schemas.$ZodStringFormat = schemas.$ZodStringFormat,
52
+ AlsoOmit extends Exclude<keyof T["_zod"]["def"], "type" | "coerce" | "checks" | "error" | "check" | "format"> = never,
53
+ > = Params<T, NonNullable<T["_zod"]["issc"]>, "type" | "coerce" | "checks" | "error" | "check" | "format" | AlsoOmit>;
54
+
55
+ export type CheckTypeParams<
56
+ T extends schemas.$ZodType & checks.$ZodCheck = schemas.$ZodType & checks.$ZodCheck,
57
+ AlsoOmit extends Exclude<keyof T["_zod"]["def"], "type" | "checks" | "error" | "check"> = never,
58
+ > = Params<T, NonNullable<T["_zod"]["isst"] | T["_zod"]["issc"]>, "type" | "checks" | "error" | "check" | AlsoOmit>;
59
+
60
+ // String
61
+ export type $ZodStringParams = TypeParams<schemas.$ZodString<string>, "coerce">;
62
+ export function _string<T extends schemas.$ZodString>(
63
+ Class: util.SchemaClass<T>,
64
+ params?: string | $ZodStringParams
65
+ ): T {
66
+ return new Class({
67
+ type: "string",
68
+ ...util.normalizeParams(params),
69
+ });
70
+ }
71
+
72
+ export function _coercedString<T extends schemas.$ZodString>(
73
+ Class: util.SchemaClass<T>,
74
+ params?: string | $ZodStringParams
75
+ ): T {
76
+ return new Class({
77
+ type: "string",
78
+ coerce: true,
79
+ ...util.normalizeParams(params),
80
+ });
81
+ }
82
+
83
+ export type $ZodStringFormatParams = CheckTypeParams<
84
+ schemas.$ZodStringFormat,
85
+ "format" | "coerce" | "when" | "pattern"
86
+ >;
87
+ export type $ZodCheckStringFormatParams = CheckParams<checks.$ZodCheckStringFormat, "format">;
88
+ // custom format
89
+
90
+ // Email
91
+ export type $ZodEmailParams = StringFormatParams<schemas.$ZodEmail, "when">;
92
+ export type $ZodCheckEmailParams = CheckStringFormatParams<schemas.$ZodEmail, "when">;
93
+ export function _email<T extends schemas.$ZodEmail>(
94
+ Class: util.SchemaClass<T>,
95
+ params?: string | $ZodEmailParams | $ZodCheckEmailParams
96
+ ): T {
97
+ return new Class({
98
+ type: "string",
99
+ format: "email",
100
+ check: "string_format",
101
+ abort: false,
102
+ ...util.normalizeParams(params),
103
+ });
104
+ }
105
+
106
+ // GUID
107
+ export type $ZodGUIDParams = StringFormatParams<schemas.$ZodGUID, "pattern" | "when">;
108
+ export type $ZodCheckGUIDParams = CheckStringFormatParams<schemas.$ZodGUID, "pattern" | "when">;
109
+ export function _guid<T extends schemas.$ZodGUID>(
110
+ Class: util.SchemaClass<T>,
111
+ params?: string | $ZodGUIDParams | $ZodCheckGUIDParams
112
+ ): T {
113
+ return new Class({
114
+ type: "string",
115
+ format: "guid",
116
+ check: "string_format",
117
+ abort: false,
118
+ ...util.normalizeParams(params),
119
+ });
120
+ }
121
+
122
+ // UUID
123
+ export type $ZodUUIDParams = StringFormatParams<schemas.$ZodUUID, "pattern" | "when">;
124
+ export type $ZodCheckUUIDParams = CheckStringFormatParams<schemas.$ZodUUID, "pattern" | "when">;
125
+ export function _uuid<T extends schemas.$ZodUUID>(
126
+ Class: util.SchemaClass<T>,
127
+ params?: string | $ZodUUIDParams | $ZodCheckUUIDParams
128
+ ): T {
129
+ return new Class({
130
+ type: "string",
131
+ format: "uuid",
132
+ check: "string_format",
133
+ abort: false,
134
+ ...util.normalizeParams(params),
135
+ });
136
+ }
137
+
138
+ // UUIDv4
139
+ export type $ZodUUIDv4Params = StringFormatParams<schemas.$ZodUUID, "pattern" | "when">;
140
+ export type $ZodCheckUUIDv4Params = CheckStringFormatParams<schemas.$ZodUUID, "pattern" | "when">;
141
+ export function _uuidv4<T extends schemas.$ZodUUID>(
142
+ Class: util.SchemaClass<T>,
143
+ params?: string | $ZodUUIDv4Params | $ZodCheckUUIDv4Params
144
+ ): T {
145
+ return new Class({
146
+ type: "string",
147
+ format: "uuid",
148
+ check: "string_format",
149
+ abort: false,
150
+ version: "v4",
151
+ ...util.normalizeParams(params),
152
+ });
153
+ }
154
+
155
+ // UUIDv6
156
+ export type $ZodUUIDv6Params = StringFormatParams<schemas.$ZodUUID, "pattern" | "when">;
157
+ export type $ZodCheckUUIDv6Params = CheckStringFormatParams<schemas.$ZodUUID, "pattern" | "when">;
158
+ export function _uuidv6<T extends schemas.$ZodUUID>(
159
+ Class: util.SchemaClass<T>,
160
+ params?: string | $ZodUUIDv6Params | $ZodCheckUUIDv6Params
161
+ ): T {
162
+ return new Class({
163
+ type: "string",
164
+ format: "uuid",
165
+ check: "string_format",
166
+ abort: false,
167
+ version: "v6",
168
+ ...util.normalizeParams(params),
169
+ });
170
+ }
171
+
172
+ // UUIDv7
173
+ export type $ZodUUIDv7Params = StringFormatParams<schemas.$ZodUUID, "pattern" | "when">;
174
+ export type $ZodCheckUUIDv7Params = CheckStringFormatParams<schemas.$ZodUUID, "pattern" | "when">;
175
+ export function _uuidv7<T extends schemas.$ZodUUID>(
176
+ Class: util.SchemaClass<T>,
177
+ params?: string | $ZodUUIDv7Params | $ZodCheckUUIDv7Params
178
+ ): T {
179
+ return new Class({
180
+ type: "string",
181
+ format: "uuid",
182
+ check: "string_format",
183
+ abort: false,
184
+ version: "v7",
185
+ ...util.normalizeParams(params),
186
+ });
187
+ }
188
+
189
+ // URL
190
+ export type $ZodURLParams = StringFormatParams<schemas.$ZodURL, "when">;
191
+ export type $ZodCheckURLParams = CheckStringFormatParams<schemas.$ZodURL, "when">;
192
+ export function _url<T extends schemas.$ZodURL>(
193
+ Class: util.SchemaClass<T>,
194
+ params?: string | $ZodURLParams | $ZodCheckURLParams
195
+ ): T {
196
+ return new Class({
197
+ type: "string",
198
+ format: "url",
199
+ check: "string_format",
200
+ abort: false,
201
+ ...util.normalizeParams(params),
202
+ });
203
+ }
204
+
205
+ // Emoji
206
+ export type $ZodEmojiParams = StringFormatParams<schemas.$ZodEmoji, "when">;
207
+ export type $ZodCheckEmojiParams = CheckStringFormatParams<schemas.$ZodEmoji, "when">;
208
+ export function _emoji<T extends schemas.$ZodEmoji>(
209
+ Class: util.SchemaClass<T>,
210
+ params?: string | $ZodEmojiParams | $ZodCheckEmojiParams
211
+ ): T {
212
+ return new Class({
213
+ type: "string",
214
+ format: "emoji",
215
+ check: "string_format",
216
+ abort: false,
217
+ ...util.normalizeParams(params),
218
+ });
219
+ }
220
+
221
+ // NanoID
222
+ export type $ZodNanoIDParams = StringFormatParams<schemas.$ZodNanoID, "when">;
223
+ export type $ZodCheckNanoIDParams = CheckStringFormatParams<schemas.$ZodNanoID, "when">;
224
+ export function _nanoid<T extends schemas.$ZodNanoID>(
225
+ Class: util.SchemaClass<T>,
226
+ params?: string | $ZodNanoIDParams | $ZodCheckNanoIDParams
227
+ ): T {
228
+ return new Class({
229
+ type: "string",
230
+ format: "nanoid",
231
+ check: "string_format",
232
+ abort: false,
233
+ ...util.normalizeParams(params),
234
+ });
235
+ }
236
+
237
+ // CUID
238
+ export type $ZodCUIDParams = StringFormatParams<schemas.$ZodCUID, "when">;
239
+ export type $ZodCheckCUIDParams = CheckStringFormatParams<schemas.$ZodCUID, "when">;
240
+ export function _cuid<T extends schemas.$ZodCUID>(
241
+ Class: util.SchemaClass<T>,
242
+ params?: string | $ZodCUIDParams | $ZodCheckCUIDParams
243
+ ): T {
244
+ return new Class({
245
+ type: "string",
246
+ format: "cuid",
247
+ check: "string_format",
248
+ abort: false,
249
+ ...util.normalizeParams(params),
250
+ });
251
+ }
252
+
253
+ // CUID2
254
+ export type $ZodCUID2Params = StringFormatParams<schemas.$ZodCUID2, "when">;
255
+ export type $ZodCheckCUID2Params = CheckStringFormatParams<schemas.$ZodCUID2, "when">;
256
+ export function _cuid2<T extends schemas.$ZodCUID2>(
257
+ Class: util.SchemaClass<T>,
258
+ params?: string | $ZodCUID2Params | $ZodCheckCUID2Params
259
+ ): T {
260
+ return new Class({
261
+ type: "string",
262
+ format: "cuid2",
263
+ check: "string_format",
264
+ abort: false,
265
+ ...util.normalizeParams(params),
266
+ });
267
+ }
268
+
269
+ // ULID
270
+ export type $ZodULIDParams = StringFormatParams<schemas.$ZodULID, "when">;
271
+ export type $ZodCheckULIDParams = CheckStringFormatParams<schemas.$ZodULID, "when">;
272
+ export function _ulid<T extends schemas.$ZodULID>(
273
+ Class: util.SchemaClass<T>,
274
+ params?: string | $ZodULIDParams | $ZodCheckULIDParams
275
+ ): T {
276
+ return new Class({
277
+ type: "string",
278
+ format: "ulid",
279
+ check: "string_format",
280
+ abort: false,
281
+ ...util.normalizeParams(params),
282
+ });
283
+ }
284
+
285
+ // XID
286
+ export type $ZodXIDParams = StringFormatParams<schemas.$ZodXID, "when">;
287
+ export type $ZodCheckXIDParams = CheckStringFormatParams<schemas.$ZodXID, "when">;
288
+ export function _xid<T extends schemas.$ZodXID>(
289
+ Class: util.SchemaClass<T>,
290
+ params?: string | $ZodXIDParams | $ZodCheckXIDParams
291
+ ): T {
292
+ return new Class({
293
+ type: "string",
294
+ format: "xid",
295
+ check: "string_format",
296
+ abort: false,
297
+ ...util.normalizeParams(params),
298
+ });
299
+ }
300
+
301
+ // KSUID
302
+ export type $ZodKSUIDParams = StringFormatParams<schemas.$ZodKSUID, "when">;
303
+ export type $ZodCheckKSUIDParams = CheckStringFormatParams<schemas.$ZodKSUID, "when">;
304
+ export function _ksuid<T extends schemas.$ZodKSUID>(
305
+ Class: util.SchemaClass<T>,
306
+ params?: string | $ZodKSUIDParams | $ZodCheckKSUIDParams
307
+ ): T {
308
+ return new Class({
309
+ type: "string",
310
+ format: "ksuid",
311
+ check: "string_format",
312
+ abort: false,
313
+ ...util.normalizeParams(params),
314
+ });
315
+ }
316
+
317
+ // IPv4
318
+ export type $ZodIPv4Params = StringFormatParams<schemas.$ZodIPv4, "pattern" | "when" | "version">;
319
+ export type $ZodCheckIPv4Params = CheckStringFormatParams<schemas.$ZodIPv4, "pattern" | "when" | "version">;
320
+ export function _ipv4<T extends schemas.$ZodIPv4>(
321
+ Class: util.SchemaClass<T>,
322
+ params?: string | $ZodIPv4Params | $ZodCheckIPv4Params
323
+ ): T {
324
+ return new Class({
325
+ type: "string",
326
+ format: "ipv4",
327
+ check: "string_format",
328
+ abort: false,
329
+ ...util.normalizeParams(params),
330
+ });
331
+ }
332
+
333
+ // IPv6
334
+ export type $ZodIPv6Params = StringFormatParams<schemas.$ZodIPv6, "pattern" | "when" | "version">;
335
+ export type $ZodCheckIPv6Params = CheckStringFormatParams<schemas.$ZodIPv6, "pattern" | "when" | "version">;
336
+ export function _ipv6<T extends schemas.$ZodIPv6>(
337
+ Class: util.SchemaClass<T>,
338
+ params?: string | $ZodIPv6Params | $ZodCheckIPv6Params
339
+ ): T {
340
+ return new Class({
341
+ type: "string",
342
+ format: "ipv6",
343
+ check: "string_format",
344
+ abort: false,
345
+ ...util.normalizeParams(params),
346
+ });
347
+ }
348
+
349
+ // MAC
350
+ export type $ZodMACParams = StringFormatParams<schemas.$ZodMAC, "pattern" | "when">;
351
+ export type $ZodCheckMACParams = CheckStringFormatParams<schemas.$ZodMAC, "pattern" | "when">;
352
+ export function _mac<T extends schemas.$ZodMAC>(
353
+ Class: util.SchemaClass<T>,
354
+ params?: string | $ZodMACParams | $ZodCheckMACParams
355
+ ): T {
356
+ return new Class({
357
+ type: "string",
358
+ format: "mac",
359
+ check: "string_format",
360
+ abort: false,
361
+ ...util.normalizeParams(params),
362
+ });
363
+ }
364
+
365
+ // CIDRv4
366
+ export type $ZodCIDRv4Params = StringFormatParams<schemas.$ZodCIDRv4, "pattern" | "when">;
367
+ export type $ZodCheckCIDRv4Params = CheckStringFormatParams<schemas.$ZodCIDRv4, "pattern" | "when">;
368
+ export function _cidrv4<T extends schemas.$ZodCIDRv4>(
369
+ Class: util.SchemaClass<T>,
370
+ params?: string | $ZodCIDRv4Params | $ZodCheckCIDRv4Params
371
+ ): T {
372
+ return new Class({
373
+ type: "string",
374
+ format: "cidrv4",
375
+ check: "string_format",
376
+ abort: false,
377
+ ...util.normalizeParams(params),
378
+ });
379
+ }
380
+
381
+ // CIDRv6
382
+ export type $ZodCIDRv6Params = StringFormatParams<schemas.$ZodCIDRv6, "pattern" | "when">;
383
+ export type $ZodCheckCIDRv6Params = CheckStringFormatParams<schemas.$ZodCIDRv6, "pattern" | "when">;
384
+ export function _cidrv6<T extends schemas.$ZodCIDRv6>(
385
+ Class: util.SchemaClass<T>,
386
+ params?: string | $ZodCIDRv6Params | $ZodCheckCIDRv6Params
387
+ ): T {
388
+ return new Class({
389
+ type: "string",
390
+ format: "cidrv6",
391
+ check: "string_format",
392
+ abort: false,
393
+ ...util.normalizeParams(params),
394
+ });
395
+ }
396
+
397
+ // Base64
398
+ export type $ZodBase64Params = StringFormatParams<schemas.$ZodBase64, "pattern" | "when">;
399
+ export type $ZodCheckBase64Params = CheckStringFormatParams<schemas.$ZodBase64, "pattern" | "when">;
400
+ export function _base64<T extends schemas.$ZodBase64>(
401
+ Class: util.SchemaClass<T>,
402
+ params?: string | $ZodBase64Params | $ZodCheckBase64Params
403
+ ): T {
404
+ return new Class({
405
+ type: "string",
406
+ format: "base64",
407
+ check: "string_format",
408
+ abort: false,
409
+ ...util.normalizeParams(params),
410
+ });
411
+ }
412
+
413
+ // base64url
414
+ export type $ZodBase64URLParams = StringFormatParams<schemas.$ZodBase64URL, "pattern" | "when">;
415
+ export type $ZodCheckBase64URLParams = CheckStringFormatParams<schemas.$ZodBase64URL, "pattern" | "when">;
416
+ export function _base64url<T extends schemas.$ZodBase64URL>(
417
+ Class: util.SchemaClass<T>,
418
+ params?: string | $ZodBase64URLParams | $ZodCheckBase64URLParams
419
+ ): T {
420
+ return new Class({
421
+ type: "string",
422
+ format: "base64url",
423
+ check: "string_format",
424
+ abort: false,
425
+ ...util.normalizeParams(params),
426
+ });
427
+ }
428
+
429
+ // E164
430
+ export type $ZodE164Params = StringFormatParams<schemas.$ZodE164, "when">;
431
+ export type $ZodCheckE164Params = CheckStringFormatParams<schemas.$ZodE164, "when">;
432
+ export function _e164<T extends schemas.$ZodE164>(
433
+ Class: util.SchemaClass<T>,
434
+ params?: string | $ZodE164Params | $ZodCheckE164Params
435
+ ): T {
436
+ return new Class({
437
+ type: "string",
438
+ format: "e164",
439
+ check: "string_format",
440
+ abort: false,
441
+ ...util.normalizeParams(params),
442
+ });
443
+ }
444
+
445
+ // JWT
446
+ export type $ZodJWTParams = StringFormatParams<schemas.$ZodJWT, "pattern" | "when">;
447
+ export type $ZodCheckJWTParams = CheckStringFormatParams<schemas.$ZodJWT, "pattern" | "when">;
448
+ export function _jwt<T extends schemas.$ZodJWT>(
449
+ Class: util.SchemaClass<T>,
450
+ params?: string | $ZodJWTParams | $ZodCheckJWTParams
451
+ ): T {
452
+ return new Class({
453
+ type: "string",
454
+ format: "jwt",
455
+ check: "string_format",
456
+ abort: false,
457
+ ...util.normalizeParams(params),
458
+ });
459
+ }
460
+
461
+ export const TimePrecision = {
462
+ Any: null,
463
+ Minute: -1,
464
+ Second: 0,
465
+ Millisecond: 3,
466
+ Microsecond: 6,
467
+ } as const;
468
+ // ISODateTime
469
+ export type $ZodISODateTimeParams = StringFormatParams<schemas.$ZodISODateTime, "pattern" | "when">;
470
+ export type $ZodCheckISODateTimeParams = CheckStringFormatParams<schemas.$ZodISODateTime, "pattern" | "when">;
471
+ export function _isoDateTime<T extends schemas.$ZodISODateTime>(
472
+ Class: util.SchemaClass<T>,
473
+ params?: string | $ZodISODateTimeParams | $ZodCheckISODateTimeParams
474
+ ): T {
475
+ return new Class({
476
+ type: "string",
477
+ format: "datetime",
478
+ check: "string_format",
479
+ offset: false,
480
+ local: false,
481
+ precision: null,
482
+ ...util.normalizeParams(params),
483
+ });
484
+ }
485
+
486
+ // ISODate
487
+ export type $ZodISODateParams = StringFormatParams<schemas.$ZodISODate, "pattern" | "when">;
488
+ export type $ZodCheckISODateParams = CheckStringFormatParams<schemas.$ZodISODate, "pattern" | "when">;
489
+ export function _isoDate<T extends schemas.$ZodISODate>(
490
+ Class: util.SchemaClass<T>,
491
+ params?: string | $ZodISODateParams | $ZodCheckISODateParams
492
+ ): T {
493
+ return new Class({
494
+ type: "string",
495
+ format: "date",
496
+ check: "string_format",
497
+ ...util.normalizeParams(params),
498
+ });
499
+ }
500
+
501
+ // ISOTime
502
+ export type $ZodISOTimeParams = StringFormatParams<schemas.$ZodISOTime, "pattern" | "when">;
503
+ export type $ZodCheckISOTimeParams = CheckStringFormatParams<schemas.$ZodISOTime, "pattern" | "when">;
504
+ export function _isoTime<T extends schemas.$ZodISOTime>(
505
+ Class: util.SchemaClass<T>,
506
+ params?: string | $ZodISOTimeParams | $ZodCheckISOTimeParams
507
+ ): T {
508
+ return new Class({
509
+ type: "string",
510
+ format: "time",
511
+ check: "string_format",
512
+ precision: null,
513
+ ...util.normalizeParams(params),
514
+ });
515
+ }
516
+
517
+ // ISODuration
518
+ export type $ZodISODurationParams = StringFormatParams<schemas.$ZodISODuration, "when">;
519
+ export type $ZodCheckISODurationParams = CheckStringFormatParams<schemas.$ZodISODuration, "when">;
520
+ export function _isoDuration<T extends schemas.$ZodISODuration>(
521
+ Class: util.SchemaClass<T>,
522
+ params?: string | $ZodISODurationParams | $ZodCheckISODurationParams
523
+ ): T {
524
+ return new Class({
525
+ type: "string",
526
+ format: "duration",
527
+ check: "string_format",
528
+ ...util.normalizeParams(params),
529
+ });
530
+ }
531
+
532
+ // Number
533
+ export type $ZodNumberParams = TypeParams<schemas.$ZodNumber<number>, "coerce">;
534
+ export type $ZodNumberFormatParams = CheckTypeParams<schemas.$ZodNumberFormat, "format" | "coerce">;
535
+ export type $ZodCheckNumberFormatParams = CheckParams<checks.$ZodCheckNumberFormat, "format" | "when">;
536
+ export function _number<T extends schemas.$ZodNumber>(
537
+ Class: util.SchemaClass<T>,
538
+ params?: string | $ZodNumberParams
539
+ ): T {
540
+ return new Class({
541
+ type: "number",
542
+ checks: [],
543
+ ...util.normalizeParams(params),
544
+ });
545
+ }
546
+
547
+ export function _coercedNumber<T extends schemas.$ZodNumber>(
548
+ Class: util.SchemaClass<T>,
549
+ params?: string | $ZodNumberParams
550
+ ): T {
551
+ return new Class({
552
+ type: "number",
553
+ coerce: true,
554
+ checks: [],
555
+ ...util.normalizeParams(params),
556
+ });
557
+ }
558
+
559
+ export function _int<T extends schemas.$ZodNumberFormat>(
560
+ Class: util.SchemaClass<T>,
561
+ params?: string | $ZodCheckNumberFormatParams
562
+ ): T {
563
+ return new Class({
564
+ type: "number",
565
+ check: "number_format",
566
+ abort: false,
567
+ format: "safeint",
568
+ ...util.normalizeParams(params),
569
+ });
570
+ }
571
+ export function _float32<T extends schemas.$ZodNumberFormat>(
572
+ Class: util.SchemaClass<T>,
573
+ params?: string | $ZodCheckNumberFormatParams
574
+ ): T {
575
+ return new Class({
576
+ type: "number",
577
+ check: "number_format",
578
+ abort: false,
579
+ format: "float32",
580
+ ...util.normalizeParams(params),
581
+ });
582
+ }
583
+ export function _float64<T extends schemas.$ZodNumberFormat>(
584
+ Class: util.SchemaClass<T>,
585
+ params?: string | $ZodCheckNumberFormatParams
586
+ ): T {
587
+ return new Class({
588
+ type: "number",
589
+ check: "number_format",
590
+ abort: false,
591
+ format: "float64",
592
+ ...util.normalizeParams(params),
593
+ });
594
+ }
595
+ export function _int32<T extends schemas.$ZodNumberFormat>(
596
+ Class: util.SchemaClass<T>,
597
+ params?: string | $ZodCheckNumberFormatParams
598
+ ): T {
599
+ return new Class({
600
+ type: "number",
601
+ check: "number_format",
602
+ abort: false,
603
+ format: "int32",
604
+ ...util.normalizeParams(params),
605
+ });
606
+ }
607
+ export function _uint32<T extends schemas.$ZodNumberFormat>(
608
+ Class: util.SchemaClass<T>,
609
+ params?: string | $ZodCheckNumberFormatParams
610
+ ): T {
611
+ return new Class({
612
+ type: "number",
613
+ check: "number_format",
614
+ abort: false,
615
+ format: "uint32",
616
+ ...util.normalizeParams(params),
617
+ });
618
+ }
619
+
620
+ // Boolean
621
+ export type $ZodBooleanParams = TypeParams<schemas.$ZodBoolean<boolean>, "coerce">;
622
+ export function _boolean<T extends schemas.$ZodBoolean>(
623
+ Class: util.SchemaClass<T>,
624
+ params?: string | $ZodBooleanParams
625
+ ): T {
626
+ return new Class({
627
+ type: "boolean",
628
+ ...util.normalizeParams(params),
629
+ });
630
+ }
631
+ export function _coercedBoolean<T extends schemas.$ZodBoolean>(
632
+ Class: util.SchemaClass<T>,
633
+ params?: string | $ZodBooleanParams
634
+ ): T {
635
+ return new Class({
636
+ type: "boolean",
637
+ coerce: true,
638
+ ...util.normalizeParams(params),
639
+ });
640
+ }
641
+
642
+ // BigInt
643
+ export type $ZodBigIntParams = TypeParams<schemas.$ZodBigInt<bigint>>;
644
+ export type $ZodBigIntFormatParams = CheckTypeParams<schemas.$ZodBigIntFormat, "format" | "coerce">;
645
+ export type $ZodCheckBigIntFormatParams = CheckParams<checks.$ZodCheckBigIntFormat, "format" | "when">;
646
+ export function _bigint<T extends schemas.$ZodBigInt>(
647
+ Class: util.SchemaClass<T>,
648
+ params?: string | $ZodBigIntParams
649
+ ): T {
650
+ return new Class({
651
+ type: "bigint",
652
+ ...util.normalizeParams(params),
653
+ });
654
+ }
655
+ export function _coercedBigint<T extends schemas.$ZodBigInt>(
656
+ Class: util.SchemaClass<T>,
657
+ params?: string | $ZodBigIntParams
658
+ ): T {
659
+ return new Class({
660
+ type: "bigint",
661
+ coerce: true,
662
+ ...util.normalizeParams(params),
663
+ });
664
+ }
665
+
666
+ export function _int64<T extends schemas.$ZodBigIntFormat>(
667
+ Class: util.SchemaClass<T>,
668
+ params?: string | $ZodBigIntFormatParams
669
+ ): T {
670
+ return new Class({
671
+ type: "bigint",
672
+ check: "bigint_format",
673
+ abort: false,
674
+ format: "int64",
675
+ ...util.normalizeParams(params),
676
+ });
677
+ }
678
+ export function _uint64<T extends schemas.$ZodBigIntFormat>(
679
+ Class: util.SchemaClass<T>,
680
+ params?: string | $ZodBigIntFormatParams
681
+ ): T {
682
+ return new Class({
683
+ type: "bigint",
684
+ check: "bigint_format",
685
+ abort: false,
686
+ format: "uint64",
687
+ ...util.normalizeParams(params),
688
+ });
689
+ }
690
+
691
+ // Symbol
692
+ export type $ZodSymbolParams = TypeParams<schemas.$ZodSymbol>;
693
+ export function _symbol<T extends schemas.$ZodSymbol>(
694
+ Class: util.SchemaClass<T>,
695
+ params?: string | $ZodSymbolParams
696
+ ): T {
697
+ return new Class({
698
+ type: "symbol",
699
+ ...util.normalizeParams(params),
700
+ });
701
+ }
702
+
703
+ // Undefined
704
+ export type $ZodUndefinedParams = TypeParams<schemas.$ZodUndefined>;
705
+ export function _undefined<T extends schemas.$ZodUndefined>(
706
+ Class: util.SchemaClass<T>,
707
+ params?: string | $ZodUndefinedParams
708
+ ): T {
709
+ return new Class({
710
+ type: "undefined",
711
+ ...util.normalizeParams(params),
712
+ });
713
+ }
714
+
715
+ // Null
716
+ export type $ZodNullParams = TypeParams<schemas.$ZodNull>;
717
+ export function _null<T extends schemas.$ZodNull>(Class: util.SchemaClass<T>, params?: string | $ZodNullParams): T {
718
+ return new Class({
719
+ type: "null",
720
+ ...util.normalizeParams(params),
721
+ });
722
+ }
723
+
724
+ // Any
725
+ export type $ZodAnyParams = TypeParams<schemas.$ZodAny>;
726
+ export function _any<T extends schemas.$ZodAny>(Class: util.SchemaClass<T>): T {
727
+ return new Class({
728
+ type: "any",
729
+ });
730
+ }
731
+
732
+ // Unknown
733
+ export type $ZodUnknownParams = TypeParams<schemas.$ZodUnknown>;
734
+ export function _unknown<T extends schemas.$ZodUnknown>(Class: util.SchemaClass<T>): T {
735
+ return new Class({
736
+ type: "unknown",
737
+ });
738
+ }
739
+
740
+ // Never
741
+ export type $ZodNeverParams = TypeParams<schemas.$ZodNever>;
742
+ export function _never<T extends schemas.$ZodNever>(Class: util.SchemaClass<T>, params?: string | $ZodNeverParams): T {
743
+ return new Class({
744
+ type: "never",
745
+ ...util.normalizeParams(params),
746
+ });
747
+ }
748
+
749
+ // Void
750
+ export type $ZodVoidParams = TypeParams<schemas.$ZodVoid>;
751
+ export function _void<T extends schemas.$ZodVoid>(Class: util.SchemaClass<T>, params?: string | $ZodVoidParams): T {
752
+ return new Class({
753
+ type: "void",
754
+ ...util.normalizeParams(params),
755
+ });
756
+ }
757
+
758
+ // Date
759
+ export type $ZodDateParams = TypeParams<schemas.$ZodDate, "coerce">;
760
+ export function _date<T extends schemas.$ZodDate>(Class: util.SchemaClass<T>, params?: string | $ZodDateParams): T {
761
+ return new Class({
762
+ type: "date",
763
+ ...util.normalizeParams(params),
764
+ });
765
+ }
766
+ export function _coercedDate<T extends schemas.$ZodDate>(
767
+ Class: util.SchemaClass<T>,
768
+ params?: string | $ZodDateParams
769
+ ): T {
770
+ return new Class({
771
+ type: "date",
772
+ coerce: true,
773
+ ...util.normalizeParams(params),
774
+ });
775
+ }
776
+
777
+ // NaN
778
+ export type $ZodNaNParams = TypeParams<schemas.$ZodNaN>;
779
+ export function _nan<T extends schemas.$ZodNaN>(Class: util.SchemaClass<T>, params?: string | $ZodNaNParams): T {
780
+ return new Class({
781
+ type: "nan",
782
+ ...util.normalizeParams(params),
783
+ });
784
+ }
785
+
786
+ // export type $ZodCheckParams = CheckParams<checks.$ZodCheck, "abort" | "when">;
787
+
788
+ export type $ZodCheckLessThanParams = CheckParams<checks.$ZodCheckLessThan, "inclusive" | "value" | "when">;
789
+ export function _lt(
790
+ value: util.Numeric,
791
+ params?: string | $ZodCheckLessThanParams
792
+ ): checks.$ZodCheckLessThan<util.Numeric> {
793
+ return new checks.$ZodCheckLessThan({
794
+ check: "less_than",
795
+ ...util.normalizeParams(params),
796
+ value,
797
+ inclusive: false,
798
+ });
799
+ }
800
+
801
+ export function _lte(
802
+ value: util.Numeric,
803
+ params?: string | $ZodCheckLessThanParams
804
+ ): checks.$ZodCheckLessThan<util.Numeric> {
805
+ return new checks.$ZodCheckLessThan({
806
+ check: "less_than",
807
+
808
+ ...util.normalizeParams(params),
809
+ value,
810
+ inclusive: true,
811
+ });
812
+ }
813
+ export {
814
+ /** @deprecated Use `z.lte()` instead. */
815
+ _lte as _max,
816
+ };
817
+
818
+ // ZodCheckGreaterThan
819
+ export type $ZodCheckGreaterThanParams = CheckParams<checks.$ZodCheckGreaterThan, "inclusive" | "value" | "when">;
820
+ export function _gt(value: util.Numeric, params?: string | $ZodCheckGreaterThanParams): checks.$ZodCheckGreaterThan {
821
+ return new checks.$ZodCheckGreaterThan({
822
+ check: "greater_than",
823
+
824
+ ...util.normalizeParams(params),
825
+ value,
826
+ inclusive: false,
827
+ });
828
+ }
829
+
830
+ export function _gte(value: util.Numeric, params?: string | $ZodCheckGreaterThanParams): checks.$ZodCheckGreaterThan {
831
+ return new checks.$ZodCheckGreaterThan({
832
+ check: "greater_than",
833
+ ...util.normalizeParams(params),
834
+ value,
835
+ inclusive: true,
836
+ });
837
+ }
838
+
839
+ export {
840
+ /** @deprecated Use `z.gte()` instead. */
841
+ _gte as _min,
842
+ };
843
+
844
+ export function _positive(params?: string | $ZodCheckGreaterThanParams): checks.$ZodCheckGreaterThan {
845
+ return _gt(0, params);
846
+ }
847
+
848
+ // negative
849
+ export function _negative(params?: string | $ZodCheckLessThanParams): checks.$ZodCheckLessThan {
850
+ return _lt(0, params);
851
+ }
852
+
853
+ // nonpositive
854
+ export function _nonpositive(params?: string | $ZodCheckLessThanParams): checks.$ZodCheckLessThan {
855
+ return _lte(0, params);
856
+ }
857
+
858
+ // nonnegative
859
+ export function _nonnegative(params?: string | $ZodCheckGreaterThanParams): checks.$ZodCheckGreaterThan {
860
+ return _gte(0, params);
861
+ }
862
+
863
+ export type $ZodCheckMultipleOfParams = CheckParams<checks.$ZodCheckMultipleOf, "value" | "when">;
864
+ export function _multipleOf(
865
+ value: number | bigint,
866
+ params?: string | $ZodCheckMultipleOfParams
867
+ ): checks.$ZodCheckMultipleOf {
868
+ return new checks.$ZodCheckMultipleOf({
869
+ check: "multiple_of",
870
+ ...util.normalizeParams(params),
871
+ value,
872
+ });
873
+ }
874
+
875
+ export type $ZodCheckMaxSizeParams = CheckParams<checks.$ZodCheckMaxSize, "maximum" | "when">;
876
+ export function _maxSize(
877
+ maximum: number,
878
+ params?: string | $ZodCheckMaxSizeParams
879
+ ): checks.$ZodCheckMaxSize<util.HasSize> {
880
+ return new checks.$ZodCheckMaxSize({
881
+ check: "max_size",
882
+ ...util.normalizeParams(params),
883
+ maximum,
884
+ });
885
+ }
886
+
887
+ export type $ZodCheckMinSizeParams = CheckParams<checks.$ZodCheckMinSize, "minimum" | "when">;
888
+ export function _minSize(
889
+ minimum: number,
890
+ params?: string | $ZodCheckMinSizeParams
891
+ ): checks.$ZodCheckMinSize<util.HasSize> {
892
+ return new checks.$ZodCheckMinSize({
893
+ check: "min_size",
894
+ ...util.normalizeParams(params),
895
+ minimum,
896
+ });
897
+ }
898
+
899
+ export type $ZodCheckSizeEqualsParams = CheckParams<checks.$ZodCheckSizeEquals, "size" | "when">;
900
+ export function _size(
901
+ size: number,
902
+ params?: string | $ZodCheckSizeEqualsParams
903
+ ): checks.$ZodCheckSizeEquals<util.HasSize> {
904
+ return new checks.$ZodCheckSizeEquals({
905
+ check: "size_equals",
906
+ ...util.normalizeParams(params),
907
+ size,
908
+ });
909
+ }
910
+
911
+ export type $ZodCheckMaxLengthParams = CheckParams<checks.$ZodCheckMaxLength, "maximum" | "when">;
912
+ export function _maxLength(
913
+ maximum: number,
914
+ params?: string | $ZodCheckMaxLengthParams
915
+ ): checks.$ZodCheckMaxLength<util.HasLength> {
916
+ const ch = new checks.$ZodCheckMaxLength({
917
+ check: "max_length",
918
+ ...util.normalizeParams(params),
919
+ maximum,
920
+ });
921
+ return ch;
922
+ }
923
+
924
+ export type $ZodCheckMinLengthParams = CheckParams<checks.$ZodCheckMinLength, "minimum" | "when">;
925
+ export function _minLength(
926
+ minimum: number,
927
+ params?: string | $ZodCheckMinLengthParams
928
+ ): checks.$ZodCheckMinLength<util.HasLength> {
929
+ return new checks.$ZodCheckMinLength({
930
+ check: "min_length",
931
+ ...util.normalizeParams(params),
932
+ minimum,
933
+ });
934
+ }
935
+
936
+ export type $ZodCheckLengthEqualsParams = CheckParams<checks.$ZodCheckLengthEquals, "length" | "when">;
937
+ export function _length(
938
+ length: number,
939
+ params?: string | $ZodCheckLengthEqualsParams
940
+ ): checks.$ZodCheckLengthEquals<util.HasLength> {
941
+ return new checks.$ZodCheckLengthEquals({
942
+ check: "length_equals",
943
+ ...util.normalizeParams(params),
944
+ length,
945
+ });
946
+ }
947
+
948
+ export type $ZodCheckRegexParams = CheckParams<checks.$ZodCheckRegex, "format" | "pattern" | "when">;
949
+ export function _regex(pattern: RegExp, params?: string | $ZodCheckRegexParams): checks.$ZodCheckRegex {
950
+ return new checks.$ZodCheckRegex({
951
+ check: "string_format",
952
+ format: "regex",
953
+ ...util.normalizeParams(params),
954
+ pattern,
955
+ });
956
+ }
957
+
958
+ export type $ZodCheckLowerCaseParams = CheckParams<checks.$ZodCheckLowerCase, "format" | "when">;
959
+ export function _lowercase(params?: string | $ZodCheckLowerCaseParams): checks.$ZodCheckLowerCase {
960
+ return new checks.$ZodCheckLowerCase({
961
+ check: "string_format",
962
+ format: "lowercase",
963
+ ...util.normalizeParams(params),
964
+ });
965
+ }
966
+
967
+ export type $ZodCheckUpperCaseParams = CheckParams<checks.$ZodCheckUpperCase, "format" | "when">;
968
+
969
+ export function _uppercase(params?: string | $ZodCheckUpperCaseParams): checks.$ZodCheckUpperCase {
970
+ return new checks.$ZodCheckUpperCase({
971
+ check: "string_format",
972
+ format: "uppercase",
973
+ ...util.normalizeParams(params),
974
+ });
975
+ }
976
+
977
+ export type $ZodCheckIncludesParams = CheckParams<checks.$ZodCheckIncludes, "includes" | "format" | "when" | "pattern">;
978
+ export function _includes(includes: string, params?: string | $ZodCheckIncludesParams): checks.$ZodCheckIncludes {
979
+ return new checks.$ZodCheckIncludes({
980
+ check: "string_format",
981
+ format: "includes",
982
+ ...util.normalizeParams(params),
983
+ includes,
984
+ });
985
+ }
986
+ export type $ZodCheckStartsWithParams = CheckParams<
987
+ checks.$ZodCheckStartsWith,
988
+ "prefix" | "format" | "when" | "pattern"
989
+ >;
990
+ export function _startsWith(prefix: string, params?: string | $ZodCheckStartsWithParams): checks.$ZodCheckStartsWith {
991
+ return new checks.$ZodCheckStartsWith({
992
+ check: "string_format",
993
+ format: "starts_with",
994
+ ...util.normalizeParams(params),
995
+ prefix,
996
+ });
997
+ }
998
+
999
+ export type $ZodCheckEndsWithParams = CheckParams<checks.$ZodCheckEndsWith, "suffix" | "format" | "pattern" | "when">;
1000
+
1001
+ export function _endsWith(suffix: string, params?: string | $ZodCheckEndsWithParams): checks.$ZodCheckEndsWith {
1002
+ return new checks.$ZodCheckEndsWith({
1003
+ check: "string_format",
1004
+ format: "ends_with",
1005
+ ...util.normalizeParams(params),
1006
+ suffix,
1007
+ });
1008
+ }
1009
+
1010
+ export type $ZodCheckPropertyParams = CheckParams<checks.$ZodCheckProperty, "property" | "schema" | "when">;
1011
+ export function _property<K extends string, T extends schemas.$ZodType>(
1012
+ property: K,
1013
+ schema: T,
1014
+ params?: string | $ZodCheckPropertyParams
1015
+ ): checks.$ZodCheckProperty<{ [k in K]: core.output<T> }> {
1016
+ return new checks.$ZodCheckProperty({
1017
+ check: "property",
1018
+ property,
1019
+ schema,
1020
+ ...util.normalizeParams(params),
1021
+ });
1022
+ }
1023
+
1024
+ export type $ZodCheckMimeTypeParams = CheckParams<checks.$ZodCheckMimeType, "mime" | "when">;
1025
+ export function _mime(types: util.MimeTypes[], params?: string | $ZodCheckMimeTypeParams): checks.$ZodCheckMimeType {
1026
+ return new checks.$ZodCheckMimeType({
1027
+ check: "mime_type",
1028
+ mime: types,
1029
+ ...util.normalizeParams(params),
1030
+ });
1031
+ }
1032
+
1033
+ export function _overwrite<T>(tx: (input: T) => T): checks.$ZodCheckOverwrite<T> {
1034
+ return new checks.$ZodCheckOverwrite({
1035
+ check: "overwrite",
1036
+ tx,
1037
+ }) as checks.$ZodCheckOverwrite<T>;
1038
+ }
1039
+ // normalize
1040
+ export function _normalize(form?: "NFC" | "NFD" | "NFKC" | "NFKD" | (string & {})): checks.$ZodCheckOverwrite<string> {
1041
+ return _overwrite((input) => input.normalize(form));
1042
+ }
1043
+
1044
+ // trim
1045
+ export function _trim(): checks.$ZodCheckOverwrite<string> {
1046
+ return _overwrite((input) => input.trim());
1047
+ }
1048
+ // toLowerCase
1049
+ export function _toLowerCase(): checks.$ZodCheckOverwrite<string> {
1050
+ return _overwrite((input) => input.toLowerCase());
1051
+ }
1052
+ // toUpperCase
1053
+ export function _toUpperCase(): checks.$ZodCheckOverwrite<string> {
1054
+ return _overwrite((input) => input.toUpperCase());
1055
+ }
1056
+ // slugify
1057
+ export function _slugify(): checks.$ZodCheckOverwrite<string> {
1058
+ return _overwrite((input) => util.slugify(input));
1059
+ }
1060
+
1061
+ /////// collections ///////
1062
+
1063
+ // Array
1064
+ export type $ZodArrayParams = TypeParams<schemas.$ZodArray, "element">;
1065
+ export function _array<T extends schemas.$ZodType>(
1066
+ Class: util.SchemaClass<schemas.$ZodArray>,
1067
+ element: T,
1068
+ params?: string | $ZodArrayParams
1069
+ ): schemas.$ZodArray<T> {
1070
+ return new Class({
1071
+ type: "array",
1072
+ element,
1073
+ // get element() {
1074
+ // return element;
1075
+ // },
1076
+ ...util.normalizeParams(params),
1077
+ }) as any;
1078
+ }
1079
+
1080
+ export type $ZodObjectParams = TypeParams<schemas.$ZodObject, "shape" | "catchall">;
1081
+
1082
+ // ZodUnion
1083
+ export type $ZodUnionParams = TypeParams<schemas.$ZodUnion, "options">;
1084
+ export function _union<const T extends readonly schemas.$ZodObject[]>(
1085
+ Class: util.SchemaClass<schemas.$ZodUnion>,
1086
+ options: T,
1087
+ params?: string | $ZodUnionParams
1088
+ ): schemas.$ZodUnion<T> {
1089
+ return new Class({
1090
+ type: "union",
1091
+ options,
1092
+ ...util.normalizeParams(params),
1093
+ }) as any;
1094
+ }
1095
+
1096
+ // ZodXor
1097
+ export type $ZodXorParams = TypeParams<schemas.$ZodXor, "options">;
1098
+ export function _xor<const T extends readonly schemas.$ZodObject[]>(
1099
+ Class: util.SchemaClass<schemas.$ZodXor>,
1100
+ options: T,
1101
+ params?: string | $ZodXorParams
1102
+ ): schemas.$ZodXor<T> {
1103
+ return new Class({
1104
+ type: "union",
1105
+ options,
1106
+ inclusive: false,
1107
+ ...util.normalizeParams(params),
1108
+ }) as any;
1109
+ }
1110
+
1111
+ // ZodDiscriminatedUnion
1112
+ export interface $ZodTypeDiscriminableInternals extends schemas.$ZodTypeInternals {
1113
+ propValues: util.PropValues;
1114
+ }
1115
+
1116
+ export interface $ZodTypeDiscriminable extends schemas.$ZodType {
1117
+ _zod: $ZodTypeDiscriminableInternals;
1118
+ }
1119
+ export type $ZodDiscriminatedUnionParams = TypeParams<schemas.$ZodDiscriminatedUnion, "options" | "discriminator">;
1120
+ export function _discriminatedUnion<
1121
+ Types extends [$ZodTypeDiscriminable, ...$ZodTypeDiscriminable[]],
1122
+ Disc extends string,
1123
+ >(
1124
+ Class: util.SchemaClass<schemas.$ZodDiscriminatedUnion>,
1125
+ discriminator: Disc,
1126
+ options: Types,
1127
+ params?: string | $ZodDiscriminatedUnionParams
1128
+ ): schemas.$ZodDiscriminatedUnion<Types, Disc> {
1129
+ return new Class({
1130
+ type: "union",
1131
+ options,
1132
+ discriminator,
1133
+ ...util.normalizeParams(params),
1134
+ }) as any;
1135
+ }
1136
+
1137
+ // ZodIntersection
1138
+ export type $ZodIntersectionParams = TypeParams<schemas.$ZodIntersection, "left" | "right">;
1139
+ export function _intersection<T extends schemas.$ZodObject, U extends schemas.$ZodObject>(
1140
+ Class: util.SchemaClass<schemas.$ZodIntersection>,
1141
+ left: T,
1142
+ right: U
1143
+ ): schemas.$ZodIntersection<T, U> {
1144
+ return new Class({
1145
+ type: "intersection",
1146
+ left,
1147
+ right,
1148
+ }) as any;
1149
+ }
1150
+
1151
+ // ZodTuple
1152
+ export type $ZodTupleParams = TypeParams<schemas.$ZodTuple, "items" | "rest">;
1153
+ export function _tuple<T extends readonly [schemas.$ZodType, ...schemas.$ZodType[]]>(
1154
+ Class: util.SchemaClass<schemas.$ZodTuple>,
1155
+ items: T,
1156
+ params?: string | $ZodTupleParams
1157
+ ): schemas.$ZodTuple<T, null>;
1158
+ export function _tuple<T extends readonly [schemas.$ZodType, ...schemas.$ZodType[]], Rest extends schemas.$ZodType>(
1159
+ Class: util.SchemaClass<schemas.$ZodTuple>,
1160
+ items: T,
1161
+ rest: Rest,
1162
+ params?: string | $ZodTupleParams
1163
+ ): schemas.$ZodTuple<T, Rest>;
1164
+ // export function _tuple(
1165
+ // Class: util.SchemaClass<schemas.$ZodTuple>,
1166
+ // items: [],
1167
+ // params?: string | $ZodTupleParams
1168
+ // ): schemas.$ZodTuple<[], null>;
1169
+ export function _tuple(
1170
+ Class: util.SchemaClass<schemas.$ZodTuple>,
1171
+ items: schemas.$ZodType[],
1172
+ _paramsOrRest?: string | $ZodTupleParams | schemas.$ZodType,
1173
+ _params?: string | $ZodTupleParams
1174
+ ) {
1175
+ const hasRest = _paramsOrRest instanceof schemas.$ZodType;
1176
+ const params = hasRest ? _params : _paramsOrRest;
1177
+ const rest = hasRest ? _paramsOrRest : null;
1178
+ return new Class({
1179
+ type: "tuple",
1180
+ items,
1181
+ rest,
1182
+ ...util.normalizeParams(params),
1183
+ });
1184
+ }
1185
+
1186
+ // ZodRecord
1187
+ export type $ZodRecordParams = TypeParams<schemas.$ZodRecord, "keyType" | "valueType">;
1188
+ export function _record<Key extends schemas.$ZodRecordKey, Value extends schemas.$ZodObject>(
1189
+ Class: util.SchemaClass<schemas.$ZodRecord>,
1190
+ keyType: Key,
1191
+ valueType: Value,
1192
+ params?: string | $ZodRecordParams
1193
+ ): schemas.$ZodRecord<Key, Value> {
1194
+ return new Class({
1195
+ type: "record",
1196
+ keyType,
1197
+ valueType,
1198
+ ...util.normalizeParams(params),
1199
+ }) as any;
1200
+ }
1201
+
1202
+ // ZodMap
1203
+ export type $ZodMapParams = TypeParams<schemas.$ZodMap, "keyType" | "valueType">;
1204
+ export function _map<Key extends schemas.$ZodObject, Value extends schemas.$ZodObject>(
1205
+ Class: util.SchemaClass<schemas.$ZodMap>,
1206
+ keyType: Key,
1207
+ valueType: Value,
1208
+ params?: string | $ZodMapParams
1209
+ ): schemas.$ZodMap<Key, Value> {
1210
+ return new Class({
1211
+ type: "map",
1212
+ keyType,
1213
+ valueType,
1214
+ ...util.normalizeParams(params),
1215
+ }) as any;
1216
+ }
1217
+
1218
+ // ZodSet
1219
+ export type $ZodSetParams = TypeParams<schemas.$ZodSet, "valueType">;
1220
+ export function _set<Value extends schemas.$ZodObject>(
1221
+ Class: util.SchemaClass<schemas.$ZodSet>,
1222
+ valueType: Value,
1223
+ params?: string | $ZodSetParams
1224
+ ): schemas.$ZodSet<Value> {
1225
+ return new Class({
1226
+ type: "set",
1227
+ valueType,
1228
+ ...util.normalizeParams(params),
1229
+ }) as any;
1230
+ }
1231
+
1232
+ // ZodEnum
1233
+ export type $ZodEnumParams = TypeParams<schemas.$ZodEnum, "entries">;
1234
+ export function _enum<const T extends string[]>(
1235
+ Class: util.SchemaClass<schemas.$ZodEnum>,
1236
+ values: T,
1237
+ params?: string | $ZodEnumParams
1238
+ ): schemas.$ZodEnum<util.ToEnum<T[number]>>;
1239
+ export function _enum<T extends util.EnumLike>(
1240
+ Class: util.SchemaClass<schemas.$ZodEnum>,
1241
+ entries: T,
1242
+ params?: string | $ZodEnumParams
1243
+ ): schemas.$ZodEnum<T>;
1244
+ export function _enum(Class: util.SchemaClass<schemas.$ZodEnum>, values: any, params?: string | $ZodEnumParams) {
1245
+ const entries: any = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;
1246
+ // if (Array.isArray(values)) {
1247
+ // for (const value of values) {
1248
+ // entries[value] = value;
1249
+ // }
1250
+ // } else {
1251
+ // Object.assign(entries, values);
1252
+ // }
1253
+ // const entries: util.EnumLike = {};
1254
+ // for (const val of values) {
1255
+ // entries[val] = val;
1256
+ // }
1257
+
1258
+ return new Class({
1259
+ type: "enum",
1260
+ entries,
1261
+ ...util.normalizeParams(params),
1262
+ }) as any;
1263
+ }
1264
+
1265
+ /** @deprecated This API has been merged into `z.enum()`. Use `z.enum()` instead.
1266
+ *
1267
+ * ```ts
1268
+ * enum Colors { red, green, blue }
1269
+ * z.enum(Colors);
1270
+ * ```
1271
+ */
1272
+ export function _nativeEnum<T extends util.EnumLike>(
1273
+ Class: util.SchemaClass<schemas.$ZodEnum>,
1274
+ entries: T,
1275
+ params?: string | $ZodEnumParams
1276
+ ): schemas.$ZodEnum<T> {
1277
+ return new Class({
1278
+ type: "enum",
1279
+ entries,
1280
+ ...util.normalizeParams(params),
1281
+ }) as any;
1282
+ }
1283
+
1284
+ // ZodLiteral
1285
+ export type $ZodLiteralParams = TypeParams<schemas.$ZodLiteral, "values">;
1286
+ export function _literal<const T extends Array<util.Literal>>(
1287
+ Class: util.SchemaClass<schemas.$ZodLiteral>,
1288
+ value: T,
1289
+ params?: string | $ZodLiteralParams
1290
+ ): schemas.$ZodLiteral<T[number]>;
1291
+ export function _literal<const T extends util.Literal>(
1292
+ Class: util.SchemaClass<schemas.$ZodLiteral>,
1293
+ value: T,
1294
+ params?: string | $ZodLiteralParams
1295
+ ): schemas.$ZodLiteral<T>;
1296
+ export function _literal(Class: util.SchemaClass<schemas.$ZodLiteral>, value: any, params: any) {
1297
+ return new Class({
1298
+ type: "literal",
1299
+ values: Array.isArray(value) ? value : [value],
1300
+ ...util.normalizeParams(params),
1301
+ });
1302
+ }
1303
+
1304
+ // ZodFile
1305
+ export type $ZodFileParams = TypeParams<schemas.$ZodFile>;
1306
+ export function _file(Class: util.SchemaClass<schemas.$ZodFile>, params?: string | $ZodFileParams): schemas.$ZodFile {
1307
+ return new Class({
1308
+ type: "file",
1309
+ ...util.normalizeParams(params),
1310
+ });
1311
+ }
1312
+
1313
+ // ZodTransform
1314
+ export type $ZodTransformParams = TypeParams<schemas.$ZodTransform, "transform">;
1315
+ export function _transform<I = unknown, O = I>(
1316
+ Class: util.SchemaClass<schemas.$ZodTransform>,
1317
+ fn: (input: I, ctx?: schemas.ParsePayload) => O
1318
+ ): schemas.$ZodTransform<Awaited<O>, I> {
1319
+ return new Class({
1320
+ type: "transform",
1321
+ transform: fn as any,
1322
+ }) as any;
1323
+ }
1324
+
1325
+ // ZodOptional
1326
+ export type $ZodOptionalParams = TypeParams<schemas.$ZodOptional, "innerType">;
1327
+ export function _optional<T extends schemas.$ZodObject>(
1328
+ Class: util.SchemaClass<schemas.$ZodOptional>,
1329
+ innerType: T
1330
+ ): schemas.$ZodOptional<T> {
1331
+ return new Class({
1332
+ type: "optional",
1333
+ innerType,
1334
+ }) as any;
1335
+ }
1336
+
1337
+ // ZodNullable
1338
+ export type $ZodNullableParams = TypeParams<schemas.$ZodNullable, "innerType">;
1339
+ export function _nullable<T extends schemas.$ZodObject>(
1340
+ Class: util.SchemaClass<schemas.$ZodNullable>,
1341
+ innerType: T
1342
+ ): schemas.$ZodNullable<T> {
1343
+ return new Class({
1344
+ type: "nullable",
1345
+ innerType,
1346
+ }) as any;
1347
+ }
1348
+
1349
+ // ZodDefault
1350
+ export type $ZodDefaultParams = TypeParams<schemas.$ZodDefault, "innerType" | "defaultValue">;
1351
+ export function _default<T extends schemas.$ZodObject>(
1352
+ Class: util.SchemaClass<schemas.$ZodDefault>,
1353
+ innerType: T,
1354
+ defaultValue: util.NoUndefined<core.output<T>> | (() => util.NoUndefined<core.output<T>>)
1355
+ ): schemas.$ZodDefault<T> {
1356
+ return new Class({
1357
+ type: "default",
1358
+ innerType,
1359
+ get defaultValue() {
1360
+ return typeof defaultValue === "function" ? (defaultValue as Function)() : util.shallowClone(defaultValue);
1361
+ },
1362
+ }) as any;
1363
+ }
1364
+
1365
+ // ZodNonOptional
1366
+ export type $ZodNonOptionalParams = TypeParams<schemas.$ZodNonOptional, "innerType">;
1367
+ export function _nonoptional<T extends schemas.$ZodObject>(
1368
+ Class: util.SchemaClass<schemas.$ZodNonOptional>,
1369
+ innerType: T,
1370
+ params?: string | $ZodNonOptionalParams
1371
+ ): schemas.$ZodNonOptional<T> {
1372
+ return new Class({
1373
+ type: "nonoptional",
1374
+ innerType,
1375
+ ...util.normalizeParams(params),
1376
+ }) as any;
1377
+ }
1378
+
1379
+ // ZodSuccess
1380
+ export type $ZodSuccessParams = TypeParams<schemas.$ZodSuccess, "innerType">;
1381
+ export function _success<T extends schemas.$ZodObject>(
1382
+ Class: util.SchemaClass<schemas.$ZodSuccess>,
1383
+ innerType: T
1384
+ ): schemas.$ZodSuccess<T> {
1385
+ return new Class({
1386
+ type: "success",
1387
+ innerType,
1388
+ }) as any;
1389
+ }
1390
+
1391
+ // ZodCatch
1392
+ export type $ZodCatchParams = TypeParams<schemas.$ZodCatch, "innerType" | "catchValue">;
1393
+ export function _catch<T extends schemas.$ZodObject>(
1394
+ Class: util.SchemaClass<schemas.$ZodCatch>,
1395
+ innerType: T,
1396
+ catchValue: core.output<T> | ((ctx: schemas.$ZodCatchCtx) => core.output<T>)
1397
+ ): schemas.$ZodCatch<T> {
1398
+ return new Class({
1399
+ type: "catch",
1400
+ innerType,
1401
+ catchValue: (typeof catchValue === "function" ? catchValue : () => catchValue) as any,
1402
+ }) as any;
1403
+ }
1404
+
1405
+ // ZodPipe
1406
+ export type $ZodPipeParams = TypeParams<schemas.$ZodPipe, "in" | "out">;
1407
+ export function _pipe<
1408
+ const A extends schemas.$ZodType,
1409
+ B extends schemas.$ZodType<unknown, core.output<A>> = schemas.$ZodType<unknown, core.output<A>>,
1410
+ >(
1411
+ Class: util.SchemaClass<schemas.$ZodPipe>,
1412
+ in_: A,
1413
+ out: B | schemas.$ZodType<unknown, core.output<A>>
1414
+ ): schemas.$ZodPipe<A, B> {
1415
+ return new Class({
1416
+ type: "pipe",
1417
+ in: in_,
1418
+ out,
1419
+ }) as any;
1420
+ }
1421
+
1422
+ // ZodReadonly
1423
+ export type $ZodReadonlyParams = TypeParams<schemas.$ZodReadonly, "innerType">;
1424
+ export function _readonly<T extends schemas.$ZodObject>(
1425
+ Class: util.SchemaClass<schemas.$ZodReadonly>,
1426
+ innerType: T
1427
+ ): schemas.$ZodReadonly<T> {
1428
+ return new Class({
1429
+ type: "readonly",
1430
+ innerType,
1431
+ }) as any;
1432
+ }
1433
+
1434
+ // ZodTemplateLiteral
1435
+ export type $ZodTemplateLiteralParams = TypeParams<schemas.$ZodTemplateLiteral, "parts">;
1436
+ export function _templateLiteral<const Parts extends schemas.$ZodTemplateLiteralPart[]>(
1437
+ Class: util.SchemaClass<schemas.$ZodTemplateLiteral>,
1438
+ parts: Parts,
1439
+ params?: string | $ZodTemplateLiteralParams
1440
+ ): schemas.$ZodTemplateLiteral<schemas.$PartsToTemplateLiteral<Parts>> {
1441
+ return new Class({
1442
+ type: "template_literal",
1443
+ parts,
1444
+ ...util.normalizeParams(params),
1445
+ }) as any;
1446
+ }
1447
+
1448
+ // ZodLazy
1449
+ export type $ZodLazyParams = TypeParams<schemas.$ZodLazy, "getter">;
1450
+ export function _lazy<T extends schemas.$ZodType>(
1451
+ Class: util.SchemaClass<schemas.$ZodLazy>,
1452
+ getter: () => T
1453
+ ): schemas.$ZodLazy<T> {
1454
+ return new Class({
1455
+ type: "lazy",
1456
+ getter,
1457
+ }) as any;
1458
+ }
1459
+
1460
+ // ZodPromise
1461
+ export type $ZodPromiseParams = TypeParams<schemas.$ZodPromise, "innerType">;
1462
+ export function _promise<T extends schemas.$ZodObject>(
1463
+ Class: util.SchemaClass<schemas.$ZodPromise>,
1464
+ innerType: T
1465
+ ): schemas.$ZodPromise<T> {
1466
+ return new Class({
1467
+ type: "promise",
1468
+ innerType,
1469
+ }) as any;
1470
+ }
1471
+
1472
+ // ZodCustom
1473
+ export type $ZodCustomParams = CheckTypeParams<schemas.$ZodCustom, "fn">;
1474
+ export function _custom<O = unknown, I = O>(
1475
+ Class: util.SchemaClass<schemas.$ZodCustom>,
1476
+ fn: (data: O) => unknown,
1477
+ _params: string | $ZodCustomParams | undefined
1478
+ ): schemas.$ZodCustom<O, I> {
1479
+ const norm = util.normalizeParams(_params);
1480
+ norm.abort ??= true; // default to abort:false
1481
+ const schema = new Class({
1482
+ type: "custom",
1483
+ check: "custom",
1484
+ fn: fn as any,
1485
+ ...norm,
1486
+ });
1487
+
1488
+ return schema as any;
1489
+ }
1490
+
1491
+ // same as _custom but defaults to abort:false
1492
+ export function _refine<O = unknown, I = O>(
1493
+ Class: util.SchemaClass<schemas.$ZodCustom>,
1494
+ fn: (data: O) => unknown,
1495
+ _params: string | $ZodCustomParams | undefined
1496
+ ): schemas.$ZodCustom<O, I> {
1497
+ const schema = new Class({
1498
+ type: "custom",
1499
+ check: "custom",
1500
+ fn: fn as any,
1501
+ ...util.normalizeParams(_params),
1502
+ });
1503
+
1504
+ return schema as any;
1505
+ }
1506
+
1507
+ export type $ZodSuperRefineIssue<T extends errors.$ZodIssueBase = errors.$ZodIssue> = T extends any
1508
+ ? RawIssue<T>
1509
+ : never;
1510
+ type RawIssue<T extends errors.$ZodIssueBase> = T extends any
1511
+ ? util.Flatten<
1512
+ util.MakePartial<T, "message" | "path"> & {
1513
+ /** The schema or check that originated this issue. */
1514
+ readonly inst?: schemas.$ZodType | checks.$ZodCheck;
1515
+ /** If `true`, Zod will execute subsequent checks/refinements instead of immediately aborting */
1516
+ readonly continue?: boolean | undefined;
1517
+ } & Record<string, unknown>
1518
+ >
1519
+ : never;
1520
+
1521
+ export interface $RefinementCtx<T = unknown> extends schemas.ParsePayload<T> {
1522
+ addIssue(arg: string | $ZodSuperRefineIssue): void;
1523
+ }
1524
+
1525
+ export function _superRefine<T>(fn: (arg: T, payload: $RefinementCtx<T>) => void | Promise<void>): checks.$ZodCheck<T> {
1526
+ const ch = _check<T>((payload) => {
1527
+ (payload as $RefinementCtx).addIssue = (issue) => {
1528
+ if (typeof issue === "string") {
1529
+ payload.issues.push(util.issue(issue, payload.value, ch._zod.def));
1530
+ } else {
1531
+ // for Zod 3 backwards compatibility
1532
+ const _issue: any = issue;
1533
+ if (_issue.fatal) _issue.continue = false;
1534
+ _issue.code ??= "custom";
1535
+ _issue.input ??= payload.value;
1536
+ _issue.inst ??= ch;
1537
+ _issue.continue ??= !ch._zod.def.abort; // abort is always undefined, so this is always true...
1538
+ payload.issues.push(util.issue(_issue));
1539
+ }
1540
+ };
1541
+
1542
+ return fn(payload.value, payload as $RefinementCtx<T>);
1543
+ });
1544
+ return ch;
1545
+ }
1546
+
1547
+ export function _check<O = unknown>(fn: schemas.CheckFn<O>, params?: string | $ZodCustomParams): checks.$ZodCheck<O> {
1548
+ const ch = new checks.$ZodCheck({
1549
+ check: "custom",
1550
+ ...util.normalizeParams(params),
1551
+ });
1552
+
1553
+ ch._zod.check = fn;
1554
+ return ch;
1555
+ }
1556
+
1557
+ export function describe<T>(description: string): checks.$ZodCheck<T> {
1558
+ const ch = new checks.$ZodCheck({ check: "describe" });
1559
+ ch._zod.onattach = [
1560
+ (inst) => {
1561
+ const existing = registries.globalRegistry.get(inst) ?? {};
1562
+ registries.globalRegistry.add(inst, { ...existing, description });
1563
+ },
1564
+ ];
1565
+ ch._zod.check = () => {}; // no-op check
1566
+ return ch;
1567
+ }
1568
+
1569
+ export function meta<T>(metadata: registries.GlobalMeta): checks.$ZodCheck<T> {
1570
+ const ch = new checks.$ZodCheck({ check: "meta" });
1571
+ ch._zod.onattach = [
1572
+ (inst) => {
1573
+ const existing = registries.globalRegistry.get(inst) ?? {};
1574
+ registries.globalRegistry.add(inst, { ...existing, ...metadata });
1575
+ },
1576
+ ];
1577
+ ch._zod.check = () => {}; // no-op check
1578
+ return ch;
1579
+ }
1580
+
1581
+ // export type $ZodCustomParams = CheckTypeParams<schemas.$ZodCustom, "fn">
1582
+
1583
+ ///////// STRINGBOOL /////////
1584
+
1585
+ // stringbool
1586
+ export interface $ZodStringBoolParams extends TypeParams {
1587
+ truthy?: string[];
1588
+ falsy?: string[];
1589
+ /**
1590
+ * Options: `"sensitive"`, `"insensitive"`
1591
+ *
1592
+ * @default `"insensitive"`
1593
+ */
1594
+ case?: "sensitive" | "insensitive" | undefined;
1595
+ }
1596
+
1597
+ export function _stringbool(
1598
+ Classes: {
1599
+ Codec?: typeof schemas.$ZodCodec;
1600
+ Boolean?: typeof schemas.$ZodBoolean;
1601
+ String?: typeof schemas.$ZodString;
1602
+ },
1603
+ _params?: string | $ZodStringBoolParams
1604
+ ): schemas.$ZodCodec<schemas.$ZodString, schemas.$ZodBoolean> {
1605
+ const params = util.normalizeParams(_params);
1606
+
1607
+ let truthyArray = params.truthy ?? ["true", "1", "yes", "on", "y", "enabled"];
1608
+ let falsyArray = params.falsy ?? ["false", "0", "no", "off", "n", "disabled"];
1609
+ if (params.case !== "sensitive") {
1610
+ truthyArray = truthyArray.map((v) => (typeof v === "string" ? v.toLowerCase() : v));
1611
+ falsyArray = falsyArray.map((v) => (typeof v === "string" ? v.toLowerCase() : v));
1612
+ }
1613
+
1614
+ const truthySet = new Set(truthyArray);
1615
+ const falsySet = new Set(falsyArray);
1616
+
1617
+ const _Codec = Classes.Codec ?? schemas.$ZodCodec;
1618
+ const _Boolean = Classes.Boolean ?? schemas.$ZodBoolean;
1619
+ const _String = Classes.String ?? schemas.$ZodString;
1620
+
1621
+ const stringSchema = new _String({ type: "string", error: params.error });
1622
+ const booleanSchema = new _Boolean({ type: "boolean", error: params.error });
1623
+
1624
+ const codec = new _Codec({
1625
+ type: "pipe",
1626
+ in: stringSchema as any,
1627
+ out: booleanSchema as any,
1628
+ transform: ((input: string, payload: schemas.ParsePayload<string>) => {
1629
+ let data: string = input;
1630
+ if (params.case !== "sensitive") data = data.toLowerCase();
1631
+ if (truthySet.has(data)) {
1632
+ return true;
1633
+ } else if (falsySet.has(data)) {
1634
+ return false;
1635
+ } else {
1636
+ payload.issues.push({
1637
+ code: "invalid_value",
1638
+ expected: "stringbool",
1639
+ values: [...truthySet, ...falsySet],
1640
+ input: payload.value,
1641
+ inst: codec,
1642
+ continue: false,
1643
+ });
1644
+ return {} as never;
1645
+ }
1646
+ }) as any,
1647
+ reverseTransform: ((input: boolean, _payload: schemas.ParsePayload<boolean>) => {
1648
+ if (input === true) {
1649
+ return truthyArray[0] || "true";
1650
+ } else {
1651
+ return falsyArray[0] || "false";
1652
+ }
1653
+ }) as any,
1654
+ error: params.error,
1655
+ }) as any;
1656
+
1657
+ return codec;
1658
+ }
1659
+
1660
+ export function _stringFormat<Format extends string>(
1661
+ Class: typeof schemas.$ZodCustomStringFormat,
1662
+ format: Format,
1663
+ fnOrRegex: ((arg: string) => util.MaybeAsync<unknown>) | RegExp,
1664
+ _params: string | $ZodStringFormatParams = {}
1665
+ ): schemas.$ZodCustomStringFormat<Format> {
1666
+ const params = util.normalizeParams(_params);
1667
+ const def: schemas.$ZodCustomStringFormatDef = {
1668
+ ...util.normalizeParams(_params),
1669
+ check: "string_format",
1670
+ type: "string",
1671
+ format,
1672
+ fn: typeof fnOrRegex === "function" ? fnOrRegex : (val) => fnOrRegex.test(val),
1673
+ ...params,
1674
+ };
1675
+ if (fnOrRegex instanceof RegExp) {
1676
+ def.pattern = fnOrRegex;
1677
+ }
1678
+
1679
+ const inst = new Class(def);
1680
+ return inst as any;
1681
+ }