aws-runtime-bridge 1.9.135 → 1.9.137

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 (820) hide show
  1. package/dist/adapter/AcodeSdkAdapter.d.ts +8 -0
  2. package/dist/adapter/AcodeSdkAdapter.js +5 -5
  3. package/dist/config.d.ts +4 -0
  4. package/dist/config.js +2 -2
  5. package/dist/index.js +1 -1
  6. package/dist/routes/ai-sources.js +1 -1
  7. package/dist/routes/capabilities.d.ts +2 -0
  8. package/dist/routes/capabilities.js +2 -0
  9. package/dist/routes/instance.d.ts +0 -1
  10. package/dist/routes/instance.js +1 -1
  11. package/dist/routes/mcp-extra.d.ts +2 -0
  12. package/dist/routes/mcp-extra.js +3 -0
  13. package/dist/routes/mcp.d.ts +1 -0
  14. package/dist/routes/mcp.js +1 -1
  15. package/dist/routes/plugins.d.ts +2 -0
  16. package/dist/routes/plugins.js +2 -0
  17. package/dist/routes/skills.d.ts +1 -0
  18. package/dist/routes/skills.js +1 -1
  19. package/dist/routes/terminal.js +25 -25
  20. package/dist/services/agent-capability-sync.d.ts +7 -0
  21. package/dist/services/agent-capability-sync.js +2 -0
  22. package/{package/cc-switch-sdk/dist → dist}/services/ai-config-service.d.ts +3 -0
  23. package/dist/services/ai-config-service.js +4 -0
  24. package/dist/services/ai-source-apply.d.ts +1 -1
  25. package/dist/services/ai-source-apply.js +1 -1
  26. package/dist/services/capability-config.d.ts +21 -0
  27. package/dist/services/capability-config.js +3 -0
  28. package/dist/services/instance-ai-config-service.d.ts +1 -0
  29. package/dist/services/instance-ai-config-service.js +1 -1
  30. package/dist/services/instance-features.d.ts +21 -0
  31. package/dist/services/instance-features.js +1 -1
  32. package/dist/services/instance-init-service.d.ts +7 -4
  33. package/dist/services/instance-init-service.js +1 -1
  34. package/dist/services/instance-state.js +1 -1
  35. package/dist/services/legacy-path-migration.d.ts +2 -0
  36. package/dist/services/legacy-path-migration.js +1 -1
  37. package/dist/services/mcp-deploy.d.ts +49 -0
  38. package/dist/services/mcp-deploy.js +4 -0
  39. package/dist/services/plugin-event-buffer.d.ts +49 -0
  40. package/dist/services/plugin-event-buffer.js +2 -0
  41. package/dist/services/plugin-manager.d.ts +240 -0
  42. package/dist/services/plugin-manager.js +10 -0
  43. package/dist/services/plugin-package.d.ts +8 -0
  44. package/dist/services/plugin-package.js +2 -0
  45. package/dist/services/skill-manager.d.ts +41 -0
  46. package/dist/services/skill-manager.js +3 -0
  47. package/dist/types.d.ts +11 -61
  48. package/dist/utils/file-utils.d.ts +9 -6
  49. package/dist/utils/file-utils.js +2 -2
  50. package/dist/utils/mcp-utils.d.ts +1 -37
  51. package/dist/utils/mcp-utils.js +1 -1
  52. package/package/acode/dist/built-in-file-tools.js +2 -2
  53. package/package/acode/dist/commands/commandRegistry.d.ts +2 -0
  54. package/package/acode/dist/commands/commandRegistry.js +1 -1
  55. package/package/acode/dist/index.d.ts +2 -0
  56. package/package/acode/dist/index.js +1 -1
  57. package/package/acode/dist/plugin-tools.d.ts +14 -0
  58. package/package/acode/dist/plugin-tools.js +14 -0
  59. package/package/acode/dist/plugin-types.d.ts +109 -0
  60. package/package/acode/dist/runtime.d.ts +2 -0
  61. package/package/acode/dist/runtime.js +14 -14
  62. package/package/acode/dist/sub-agent-manager.js +1 -1
  63. package/package/acode/dist/types.d.ts +3 -0
  64. package/package/aws-client-agent-mcp/dist/agent-client.d.ts +9 -1
  65. package/package/aws-client-agent-mcp/dist/agent-client.js +1 -1
  66. package/package/aws-client-agent-mcp/dist/mcp-server.d.ts +11 -0
  67. package/package/aws-client-agent-mcp/dist/mcp-server.js +21 -21
  68. package/package/aws-client-agent-mcp/dist/mcp-tools.js +2 -4
  69. package/package/aws-client-agent-mcp/dist/memory-tools.js +8 -10
  70. package/package/aws-client-agent-mcp/dist/types.d.ts +21 -0
  71. package/package.json +4 -10
  72. package/dist/adapters/cc-switch/common.d.ts +0 -41
  73. package/dist/adapters/cc-switch/common.js +0 -2
  74. package/dist/adapters/cc-switch/index.d.ts +0 -19
  75. package/dist/adapters/cc-switch/index.js +0 -2
  76. package/dist/adapters/cc-switch/mcp-acode.d.ts +0 -10
  77. package/dist/adapters/cc-switch/mcp-acode.js +0 -2
  78. package/dist/adapters/cc-switch/mcp-claude.d.ts +0 -10
  79. package/dist/adapters/cc-switch/mcp-claude.js +0 -2
  80. package/dist/adapters/cc-switch/mcp-claudecode.d.ts +0 -10
  81. package/dist/adapters/cc-switch/mcp-claudecode.js +0 -2
  82. package/dist/adapters/cc-switch/mcp-codex.d.ts +0 -10
  83. package/dist/adapters/cc-switch/mcp-codex.js +0 -11
  84. package/dist/adapters/cc-switch/mcp-opencode.d.ts +0 -14
  85. package/dist/adapters/cc-switch/mcp-opencode.js +0 -2
  86. package/dist/adapters/cc-switch/mcp-placeholder.d.ts +0 -9
  87. package/dist/adapters/cc-switch/mcp-placeholder.js +0 -2
  88. package/dist/adapters/cc-switch/skill-acode.d.ts +0 -5
  89. package/dist/adapters/cc-switch/skill-acode.js +0 -2
  90. package/dist/adapters/cc-switch/skill-claude.d.ts +0 -5
  91. package/dist/adapters/cc-switch/skill-claude.js +0 -2
  92. package/dist/adapters/cc-switch/skill-claudecode.d.ts +0 -5
  93. package/dist/adapters/cc-switch/skill-claudecode.js +0 -2
  94. package/dist/adapters/cc-switch/skill-codex.d.ts +0 -4
  95. package/dist/adapters/cc-switch/skill-codex.js +0 -2
  96. package/dist/adapters/cc-switch/skill-directory.d.ts +0 -9
  97. package/dist/adapters/cc-switch/skill-directory.js +0 -3
  98. package/dist/adapters/cc-switch/skill-opencode.d.ts +0 -5
  99. package/dist/adapters/cc-switch/skill-opencode.js +0 -2
  100. package/dist/adapters/cc-switch/skill-placeholder.d.ts +0 -9
  101. package/dist/adapters/cc-switch/skill-placeholder.js +0 -2
  102. package/dist/services/cc-switch-sdk.d.ts +0 -17
  103. package/dist/services/cc-switch-sdk.js +0 -2
  104. package/dist/services/instance-service.d.ts +0 -78
  105. package/dist/services/instance-service.js +0 -2
  106. package/node_modules/@cc-switch/sdk/README.md +0 -541
  107. package/node_modules/@cc-switch/sdk/dist/constants.d.ts +0 -8
  108. package/node_modules/@cc-switch/sdk/dist/constants.js +0 -2
  109. package/node_modules/@cc-switch/sdk/dist/errors.d.ts +0 -5
  110. package/node_modules/@cc-switch/sdk/dist/errors.js +0 -2
  111. package/node_modules/@cc-switch/sdk/dist/index.d.ts +0 -5
  112. package/node_modules/@cc-switch/sdk/dist/index.js +0 -2
  113. package/node_modules/@cc-switch/sdk/dist/schemas.d.ts +0 -7
  114. package/node_modules/@cc-switch/sdk/dist/schemas.js +0 -2
  115. package/node_modules/@cc-switch/sdk/dist/sdk.d.ts +0 -59
  116. package/node_modules/@cc-switch/sdk/dist/sdk.js +0 -2
  117. package/node_modules/@cc-switch/sdk/dist/services/ai-config-service.d.ts +0 -81
  118. package/node_modules/@cc-switch/sdk/dist/services/ai-config-service.js +0 -4
  119. package/node_modules/@cc-switch/sdk/dist/services/mcp-model.d.ts +0 -16
  120. package/node_modules/@cc-switch/sdk/dist/services/mcp-model.js +0 -2
  121. package/node_modules/@cc-switch/sdk/dist/services/mcp-service.d.ts +0 -17
  122. package/node_modules/@cc-switch/sdk/dist/services/mcp-service.js +0 -2
  123. package/node_modules/@cc-switch/sdk/dist/services/skill-model.d.ts +0 -16
  124. package/node_modules/@cc-switch/sdk/dist/services/skill-model.js +0 -2
  125. package/node_modules/@cc-switch/sdk/dist/services/skill-service.d.ts +0 -16
  126. package/node_modules/@cc-switch/sdk/dist/services/skill-service.js +0 -2
  127. package/node_modules/@cc-switch/sdk/dist/state.d.ts +0 -3
  128. package/node_modules/@cc-switch/sdk/dist/state.js +0 -2
  129. package/node_modules/@cc-switch/sdk/dist/types.d.ts +0 -78
  130. package/node_modules/@cc-switch/sdk/dist/utils/fs.d.ts +0 -10
  131. package/node_modules/@cc-switch/sdk/dist/utils/fs.js +0 -3
  132. package/node_modules/@cc-switch/sdk/dist/utils/id.d.ts +0 -3
  133. package/node_modules/@cc-switch/sdk/dist/utils/id.js +0 -2
  134. package/node_modules/@cc-switch/sdk/package.json +0 -31
  135. package/node_modules/zod/LICENSE +0 -21
  136. package/node_modules/zod/README.md +0 -208
  137. package/node_modules/zod/index.cjs +0 -33
  138. package/node_modules/zod/index.d.cts +0 -4
  139. package/node_modules/zod/index.d.ts +0 -4
  140. package/node_modules/zod/index.js +0 -4
  141. package/node_modules/zod/locales/index.cjs +0 -17
  142. package/node_modules/zod/locales/index.d.cts +0 -1
  143. package/node_modules/zod/locales/index.d.ts +0 -1
  144. package/node_modules/zod/locales/index.js +0 -1
  145. package/node_modules/zod/locales/package.json +0 -6
  146. package/node_modules/zod/mini/index.cjs +0 -17
  147. package/node_modules/zod/mini/index.d.cts +0 -1
  148. package/node_modules/zod/mini/index.d.ts +0 -1
  149. package/node_modules/zod/mini/index.js +0 -1
  150. package/node_modules/zod/mini/package.json +0 -6
  151. package/node_modules/zod/package.json +0 -135
  152. package/node_modules/zod/src/index.ts +0 -4
  153. package/node_modules/zod/src/locales/index.ts +0 -1
  154. package/node_modules/zod/src/mini/index.ts +0 -1
  155. package/node_modules/zod/src/v3/ZodError.ts +0 -330
  156. package/node_modules/zod/src/v3/benchmarks/datetime.ts +0 -58
  157. package/node_modules/zod/src/v3/benchmarks/discriminatedUnion.ts +0 -80
  158. package/node_modules/zod/src/v3/benchmarks/index.ts +0 -59
  159. package/node_modules/zod/src/v3/benchmarks/ipv4.ts +0 -57
  160. package/node_modules/zod/src/v3/benchmarks/object.ts +0 -69
  161. package/node_modules/zod/src/v3/benchmarks/primitives.ts +0 -162
  162. package/node_modules/zod/src/v3/benchmarks/realworld.ts +0 -63
  163. package/node_modules/zod/src/v3/benchmarks/string.ts +0 -55
  164. package/node_modules/zod/src/v3/benchmarks/union.ts +0 -80
  165. package/node_modules/zod/src/v3/errors.ts +0 -13
  166. package/node_modules/zod/src/v3/external.ts +0 -6
  167. package/node_modules/zod/src/v3/helpers/enumUtil.ts +0 -17
  168. package/node_modules/zod/src/v3/helpers/errorUtil.ts +0 -8
  169. package/node_modules/zod/src/v3/helpers/parseUtil.ts +0 -176
  170. package/node_modules/zod/src/v3/helpers/partialUtil.ts +0 -34
  171. package/node_modules/zod/src/v3/helpers/typeAliases.ts +0 -2
  172. package/node_modules/zod/src/v3/helpers/util.ts +0 -224
  173. package/node_modules/zod/src/v3/index.ts +0 -4
  174. package/node_modules/zod/src/v3/locales/en.ts +0 -124
  175. package/node_modules/zod/src/v3/standard-schema.ts +0 -113
  176. package/node_modules/zod/src/v3/tests/Mocker.ts +0 -54
  177. package/node_modules/zod/src/v3/tests/all-errors.test.ts +0 -157
  178. package/node_modules/zod/src/v3/tests/anyunknown.test.ts +0 -28
  179. package/node_modules/zod/src/v3/tests/array.test.ts +0 -71
  180. package/node_modules/zod/src/v3/tests/async-parsing.test.ts +0 -388
  181. package/node_modules/zod/src/v3/tests/async-refinements.test.ts +0 -46
  182. package/node_modules/zod/src/v3/tests/base.test.ts +0 -29
  183. package/node_modules/zod/src/v3/tests/bigint.test.ts +0 -55
  184. package/node_modules/zod/src/v3/tests/branded.test.ts +0 -53
  185. package/node_modules/zod/src/v3/tests/catch.test.ts +0 -220
  186. package/node_modules/zod/src/v3/tests/coerce.test.ts +0 -133
  187. package/node_modules/zod/src/v3/tests/complex.test.ts +0 -56
  188. package/node_modules/zod/src/v3/tests/custom.test.ts +0 -31
  189. package/node_modules/zod/src/v3/tests/date.test.ts +0 -32
  190. package/node_modules/zod/src/v3/tests/deepmasking.test.ts +0 -186
  191. package/node_modules/zod/src/v3/tests/default.test.ts +0 -112
  192. package/node_modules/zod/src/v3/tests/description.test.ts +0 -33
  193. package/node_modules/zod/src/v3/tests/discriminated-unions.test.ts +0 -315
  194. package/node_modules/zod/src/v3/tests/enum.test.ts +0 -80
  195. package/node_modules/zod/src/v3/tests/error.test.ts +0 -551
  196. package/node_modules/zod/src/v3/tests/firstparty.test.ts +0 -87
  197. package/node_modules/zod/src/v3/tests/firstpartyschematypes.test.ts +0 -21
  198. package/node_modules/zod/src/v3/tests/function.test.ts +0 -257
  199. package/node_modules/zod/src/v3/tests/generics.test.ts +0 -48
  200. package/node_modules/zod/src/v3/tests/instanceof.test.ts +0 -37
  201. package/node_modules/zod/src/v3/tests/intersection.test.ts +0 -110
  202. package/node_modules/zod/src/v3/tests/language-server.source.ts +0 -76
  203. package/node_modules/zod/src/v3/tests/language-server.test.ts +0 -207
  204. package/node_modules/zod/src/v3/tests/literal.test.ts +0 -36
  205. package/node_modules/zod/src/v3/tests/map.test.ts +0 -110
  206. package/node_modules/zod/src/v3/tests/masking.test.ts +0 -4
  207. package/node_modules/zod/src/v3/tests/mocker.test.ts +0 -19
  208. package/node_modules/zod/src/v3/tests/nan.test.ts +0 -21
  209. package/node_modules/zod/src/v3/tests/nativeEnum.test.ts +0 -87
  210. package/node_modules/zod/src/v3/tests/nullable.test.ts +0 -42
  211. package/node_modules/zod/src/v3/tests/number.test.ts +0 -176
  212. package/node_modules/zod/src/v3/tests/object-augmentation.test.ts +0 -29
  213. package/node_modules/zod/src/v3/tests/object-in-es5-env.test.ts +0 -29
  214. package/node_modules/zod/src/v3/tests/object.test.ts +0 -434
  215. package/node_modules/zod/src/v3/tests/optional.test.ts +0 -42
  216. package/node_modules/zod/src/v3/tests/parseUtil.test.ts +0 -23
  217. package/node_modules/zod/src/v3/tests/parser.test.ts +0 -41
  218. package/node_modules/zod/src/v3/tests/partials.test.ts +0 -243
  219. package/node_modules/zod/src/v3/tests/pickomit.test.ts +0 -111
  220. package/node_modules/zod/src/v3/tests/pipeline.test.ts +0 -29
  221. package/node_modules/zod/src/v3/tests/preprocess.test.ts +0 -186
  222. package/node_modules/zod/src/v3/tests/primitive.test.ts +0 -440
  223. package/node_modules/zod/src/v3/tests/promise.test.ts +0 -90
  224. package/node_modules/zod/src/v3/tests/readonly.test.ts +0 -194
  225. package/node_modules/zod/src/v3/tests/record.test.ts +0 -171
  226. package/node_modules/zod/src/v3/tests/recursive.test.ts +0 -197
  227. package/node_modules/zod/src/v3/tests/refine.test.ts +0 -313
  228. package/node_modules/zod/src/v3/tests/safeparse.test.ts +0 -27
  229. package/node_modules/zod/src/v3/tests/set.test.ts +0 -142
  230. package/node_modules/zod/src/v3/tests/standard-schema.test.ts +0 -83
  231. package/node_modules/zod/src/v3/tests/string.test.ts +0 -916
  232. package/node_modules/zod/src/v3/tests/transformer.test.ts +0 -233
  233. package/node_modules/zod/src/v3/tests/tuple.test.ts +0 -90
  234. package/node_modules/zod/src/v3/tests/unions.test.ts +0 -57
  235. package/node_modules/zod/src/v3/tests/validations.test.ts +0 -133
  236. package/node_modules/zod/src/v3/tests/void.test.ts +0 -15
  237. package/node_modules/zod/src/v3/types.ts +0 -5138
  238. package/node_modules/zod/src/v4/classic/checks.ts +0 -31
  239. package/node_modules/zod/src/v4/classic/coerce.ts +0 -27
  240. package/node_modules/zod/src/v4/classic/compat.ts +0 -70
  241. package/node_modules/zod/src/v4/classic/errors.ts +0 -82
  242. package/node_modules/zod/src/v4/classic/external.ts +0 -50
  243. package/node_modules/zod/src/v4/classic/index.ts +0 -5
  244. package/node_modules/zod/src/v4/classic/iso.ts +0 -90
  245. package/node_modules/zod/src/v4/classic/parse.ts +0 -82
  246. package/node_modules/zod/src/v4/classic/schemas.ts +0 -2197
  247. package/node_modules/zod/src/v4/classic/tests/anyunknown.test.ts +0 -26
  248. package/node_modules/zod/src/v4/classic/tests/array.test.ts +0 -264
  249. package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +0 -210
  250. package/node_modules/zod/src/v4/classic/tests/async-parsing.test.ts +0 -381
  251. package/node_modules/zod/src/v4/classic/tests/async-refinements.test.ts +0 -68
  252. package/node_modules/zod/src/v4/classic/tests/base.test.ts +0 -7
  253. package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +0 -54
  254. package/node_modules/zod/src/v4/classic/tests/brand.test.ts +0 -63
  255. package/node_modules/zod/src/v4/classic/tests/catch.test.ts +0 -276
  256. package/node_modules/zod/src/v4/classic/tests/coalesce.test.ts +0 -20
  257. package/node_modules/zod/src/v4/classic/tests/codec-examples.test.ts +0 -573
  258. package/node_modules/zod/src/v4/classic/tests/codec.test.ts +0 -562
  259. package/node_modules/zod/src/v4/classic/tests/coerce.test.ts +0 -160
  260. package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +0 -352
  261. package/node_modules/zod/src/v4/classic/tests/custom.test.ts +0 -40
  262. package/node_modules/zod/src/v4/classic/tests/date.test.ts +0 -31
  263. package/node_modules/zod/src/v4/classic/tests/datetime.test.ts +0 -302
  264. package/node_modules/zod/src/v4/classic/tests/default.test.ts +0 -365
  265. package/node_modules/zod/src/v4/classic/tests/description.test.ts +0 -32
  266. package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +0 -661
  267. package/node_modules/zod/src/v4/classic/tests/enum.test.ts +0 -285
  268. package/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +0 -595
  269. package/node_modules/zod/src/v4/classic/tests/error.test.ts +0 -711
  270. package/node_modules/zod/src/v4/classic/tests/file.test.ts +0 -96
  271. package/node_modules/zod/src/v4/classic/tests/firstparty.test.ts +0 -179
  272. package/node_modules/zod/src/v4/classic/tests/function.test.ts +0 -308
  273. package/node_modules/zod/src/v4/classic/tests/generics.test.ts +0 -72
  274. package/node_modules/zod/src/v4/classic/tests/hash.test.ts +0 -68
  275. package/node_modules/zod/src/v4/classic/tests/index.test.ts +0 -844
  276. package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +0 -34
  277. package/node_modules/zod/src/v4/classic/tests/intersection.test.ts +0 -171
  278. package/node_modules/zod/src/v4/classic/tests/json.test.ts +0 -108
  279. package/node_modules/zod/src/v4/classic/tests/lazy.test.ts +0 -227
  280. package/node_modules/zod/src/v4/classic/tests/literal.test.ts +0 -117
  281. package/node_modules/zod/src/v4/classic/tests/map.test.ts +0 -196
  282. package/node_modules/zod/src/v4/classic/tests/nan.test.ts +0 -21
  283. package/node_modules/zod/src/v4/classic/tests/nested-refine.test.ts +0 -168
  284. package/node_modules/zod/src/v4/classic/tests/nonoptional.test.ts +0 -101
  285. package/node_modules/zod/src/v4/classic/tests/nullable.test.ts +0 -22
  286. package/node_modules/zod/src/v4/classic/tests/number.test.ts +0 -270
  287. package/node_modules/zod/src/v4/classic/tests/object.test.ts +0 -609
  288. package/node_modules/zod/src/v4/classic/tests/optional.test.ts +0 -136
  289. package/node_modules/zod/src/v4/classic/tests/partial.test.ts +0 -340
  290. package/node_modules/zod/src/v4/classic/tests/pickomit.test.ts +0 -127
  291. package/node_modules/zod/src/v4/classic/tests/pipe.test.ts +0 -101
  292. package/node_modules/zod/src/v4/classic/tests/prefault.test.ts +0 -74
  293. package/node_modules/zod/src/v4/classic/tests/preprocess.test.ts +0 -282
  294. package/node_modules/zod/src/v4/classic/tests/primitive.test.ts +0 -175
  295. package/node_modules/zod/src/v4/classic/tests/promise.test.ts +0 -81
  296. package/node_modules/zod/src/v4/classic/tests/prototypes.test.ts +0 -23
  297. package/node_modules/zod/src/v4/classic/tests/readonly.test.ts +0 -252
  298. package/node_modules/zod/src/v4/classic/tests/record.test.ts +0 -356
  299. package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +0 -582
  300. package/node_modules/zod/src/v4/classic/tests/refine.test.ts +0 -605
  301. package/node_modules/zod/src/v4/classic/tests/registries.test.ts +0 -204
  302. package/node_modules/zod/src/v4/classic/tests/set.test.ts +0 -181
  303. package/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +0 -57
  304. package/node_modules/zod/src/v4/classic/tests/string-formats.test.ts +0 -125
  305. package/node_modules/zod/src/v4/classic/tests/string.test.ts +0 -1080
  306. package/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +0 -106
  307. package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +0 -763
  308. package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +0 -2622
  309. package/node_modules/zod/src/v4/classic/tests/transform.test.ts +0 -361
  310. package/node_modules/zod/src/v4/classic/tests/tuple.test.ts +0 -163
  311. package/node_modules/zod/src/v4/classic/tests/union.test.ts +0 -181
  312. package/node_modules/zod/src/v4/classic/tests/validations.test.ts +0 -283
  313. package/node_modules/zod/src/v4/classic/tests/void.test.ts +0 -12
  314. package/node_modules/zod/src/v4/core/api.ts +0 -1621
  315. package/node_modules/zod/src/v4/core/checks.ts +0 -1287
  316. package/node_modules/zod/src/v4/core/config.ts +0 -15
  317. package/node_modules/zod/src/v4/core/core.ts +0 -115
  318. package/node_modules/zod/src/v4/core/doc.ts +0 -44
  319. package/node_modules/zod/src/v4/core/errors.ts +0 -413
  320. package/node_modules/zod/src/v4/core/index.ts +0 -14
  321. package/node_modules/zod/src/v4/core/json-schema.ts +0 -147
  322. package/node_modules/zod/src/v4/core/parse.ts +0 -195
  323. package/node_modules/zod/src/v4/core/regexes.ts +0 -177
  324. package/node_modules/zod/src/v4/core/registries.ts +0 -97
  325. package/node_modules/zod/src/v4/core/schemas.ts +0 -4317
  326. package/node_modules/zod/src/v4/core/standard-schema.ts +0 -64
  327. package/node_modules/zod/src/v4/core/tests/extend.test.ts +0 -18
  328. package/node_modules/zod/src/v4/core/tests/index.test.ts +0 -46
  329. package/node_modules/zod/src/v4/core/tests/locales/be.test.ts +0 -124
  330. package/node_modules/zod/src/v4/core/tests/locales/en.test.ts +0 -22
  331. package/node_modules/zod/src/v4/core/tests/locales/es.test.ts +0 -181
  332. package/node_modules/zod/src/v4/core/tests/locales/ru.test.ts +0 -128
  333. package/node_modules/zod/src/v4/core/tests/locales/tr.test.ts +0 -69
  334. package/node_modules/zod/src/v4/core/to-json-schema.ts +0 -1044
  335. package/node_modules/zod/src/v4/core/util.ts +0 -910
  336. package/node_modules/zod/src/v4/core/versions.ts +0 -5
  337. package/node_modules/zod/src/v4/core/zsf.ts +0 -323
  338. package/node_modules/zod/src/v4/index.ts +0 -4
  339. package/node_modules/zod/src/v4/locales/ar.ts +0 -125
  340. package/node_modules/zod/src/v4/locales/az.ts +0 -121
  341. package/node_modules/zod/src/v4/locales/be.ts +0 -184
  342. package/node_modules/zod/src/v4/locales/bg.ts +0 -136
  343. package/node_modules/zod/src/v4/locales/ca.ts +0 -127
  344. package/node_modules/zod/src/v4/locales/cs.ts +0 -142
  345. package/node_modules/zod/src/v4/locales/da.ts +0 -141
  346. package/node_modules/zod/src/v4/locales/de.ts +0 -124
  347. package/node_modules/zod/src/v4/locales/en.ts +0 -127
  348. package/node_modules/zod/src/v4/locales/eo.ts +0 -125
  349. package/node_modules/zod/src/v4/locales/es.ts +0 -159
  350. package/node_modules/zod/src/v4/locales/fa.ts +0 -134
  351. package/node_modules/zod/src/v4/locales/fi.ts +0 -131
  352. package/node_modules/zod/src/v4/locales/fr-CA.ts +0 -126
  353. package/node_modules/zod/src/v4/locales/fr.ts +0 -124
  354. package/node_modules/zod/src/v4/locales/he.ts +0 -125
  355. package/node_modules/zod/src/v4/locales/hu.ts +0 -126
  356. package/node_modules/zod/src/v4/locales/id.ts +0 -125
  357. package/node_modules/zod/src/v4/locales/index.ts +0 -47
  358. package/node_modules/zod/src/v4/locales/is.ts +0 -127
  359. package/node_modules/zod/src/v4/locales/it.ts +0 -125
  360. package/node_modules/zod/src/v4/locales/ja.ts +0 -122
  361. package/node_modules/zod/src/v4/locales/ka.ts +0 -138
  362. package/node_modules/zod/src/v4/locales/kh.ts +0 -7
  363. package/node_modules/zod/src/v4/locales/km.ts +0 -126
  364. package/node_modules/zod/src/v4/locales/ko.ts +0 -131
  365. package/node_modules/zod/src/v4/locales/lt.ts +0 -265
  366. package/node_modules/zod/src/v4/locales/mk.ts +0 -127
  367. package/node_modules/zod/src/v4/locales/ms.ts +0 -124
  368. package/node_modules/zod/src/v4/locales/nl.ts +0 -126
  369. package/node_modules/zod/src/v4/locales/no.ts +0 -124
  370. package/node_modules/zod/src/v4/locales/ota.ts +0 -125
  371. package/node_modules/zod/src/v4/locales/pl.ts +0 -126
  372. package/node_modules/zod/src/v4/locales/ps.ts +0 -133
  373. package/node_modules/zod/src/v4/locales/pt.ts +0 -123
  374. package/node_modules/zod/src/v4/locales/ru.ts +0 -184
  375. package/node_modules/zod/src/v4/locales/sl.ts +0 -126
  376. package/node_modules/zod/src/v4/locales/sv.ts +0 -127
  377. package/node_modules/zod/src/v4/locales/ta.ts +0 -125
  378. package/node_modules/zod/src/v4/locales/th.ts +0 -126
  379. package/node_modules/zod/src/v4/locales/tr.ts +0 -121
  380. package/node_modules/zod/src/v4/locales/ua.ts +0 -7
  381. package/node_modules/zod/src/v4/locales/uk.ts +0 -126
  382. package/node_modules/zod/src/v4/locales/ur.ts +0 -126
  383. package/node_modules/zod/src/v4/locales/vi.ts +0 -125
  384. package/node_modules/zod/src/v4/locales/yo.ts +0 -131
  385. package/node_modules/zod/src/v4/locales/zh-CN.ts +0 -123
  386. package/node_modules/zod/src/v4/locales/zh-TW.ts +0 -125
  387. package/node_modules/zod/src/v4/mini/checks.ts +0 -32
  388. package/node_modules/zod/src/v4/mini/coerce.ts +0 -22
  389. package/node_modules/zod/src/v4/mini/external.ts +0 -40
  390. package/node_modules/zod/src/v4/mini/index.ts +0 -3
  391. package/node_modules/zod/src/v4/mini/iso.ts +0 -62
  392. package/node_modules/zod/src/v4/mini/parse.ts +0 -14
  393. package/node_modules/zod/src/v4/mini/schemas.ts +0 -1725
  394. package/node_modules/zod/src/v4/mini/tests/assignability.test.ts +0 -129
  395. package/node_modules/zod/src/v4/mini/tests/brand.test.ts +0 -51
  396. package/node_modules/zod/src/v4/mini/tests/checks.test.ts +0 -144
  397. package/node_modules/zod/src/v4/mini/tests/codec.test.ts +0 -529
  398. package/node_modules/zod/src/v4/mini/tests/computed.test.ts +0 -36
  399. package/node_modules/zod/src/v4/mini/tests/error.test.ts +0 -22
  400. package/node_modules/zod/src/v4/mini/tests/functions.test.ts +0 -43
  401. package/node_modules/zod/src/v4/mini/tests/index.test.ts +0 -899
  402. package/node_modules/zod/src/v4/mini/tests/number.test.ts +0 -95
  403. package/node_modules/zod/src/v4/mini/tests/object.test.ts +0 -200
  404. package/node_modules/zod/src/v4/mini/tests/prototypes.test.ts +0 -43
  405. package/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +0 -275
  406. package/node_modules/zod/src/v4/mini/tests/string.test.ts +0 -315
  407. package/node_modules/zod/src/v4-mini/index.ts +0 -1
  408. package/node_modules/zod/v3/ZodError.cjs +0 -138
  409. package/node_modules/zod/v3/ZodError.d.cts +0 -164
  410. package/node_modules/zod/v3/ZodError.d.ts +0 -164
  411. package/node_modules/zod/v3/ZodError.js +0 -133
  412. package/node_modules/zod/v3/errors.cjs +0 -17
  413. package/node_modules/zod/v3/errors.d.cts +0 -5
  414. package/node_modules/zod/v3/errors.d.ts +0 -5
  415. package/node_modules/zod/v3/errors.js +0 -9
  416. package/node_modules/zod/v3/external.cjs +0 -22
  417. package/node_modules/zod/v3/external.d.cts +0 -6
  418. package/node_modules/zod/v3/external.d.ts +0 -6
  419. package/node_modules/zod/v3/external.js +0 -6
  420. package/node_modules/zod/v3/helpers/enumUtil.cjs +0 -2
  421. package/node_modules/zod/v3/helpers/enumUtil.d.cts +0 -8
  422. package/node_modules/zod/v3/helpers/enumUtil.d.ts +0 -8
  423. package/node_modules/zod/v3/helpers/enumUtil.js +0 -1
  424. package/node_modules/zod/v3/helpers/errorUtil.cjs +0 -9
  425. package/node_modules/zod/v3/helpers/errorUtil.d.cts +0 -9
  426. package/node_modules/zod/v3/helpers/errorUtil.d.ts +0 -9
  427. package/node_modules/zod/v3/helpers/errorUtil.js +0 -6
  428. package/node_modules/zod/v3/helpers/parseUtil.cjs +0 -124
  429. package/node_modules/zod/v3/helpers/parseUtil.d.cts +0 -78
  430. package/node_modules/zod/v3/helpers/parseUtil.d.ts +0 -78
  431. package/node_modules/zod/v3/helpers/parseUtil.js +0 -109
  432. package/node_modules/zod/v3/helpers/partialUtil.cjs +0 -2
  433. package/node_modules/zod/v3/helpers/partialUtil.d.cts +0 -8
  434. package/node_modules/zod/v3/helpers/partialUtil.d.ts +0 -8
  435. package/node_modules/zod/v3/helpers/partialUtil.js +0 -1
  436. package/node_modules/zod/v3/helpers/typeAliases.cjs +0 -2
  437. package/node_modules/zod/v3/helpers/typeAliases.d.cts +0 -2
  438. package/node_modules/zod/v3/helpers/typeAliases.d.ts +0 -2
  439. package/node_modules/zod/v3/helpers/typeAliases.js +0 -1
  440. package/node_modules/zod/v3/helpers/util.cjs +0 -137
  441. package/node_modules/zod/v3/helpers/util.d.cts +0 -85
  442. package/node_modules/zod/v3/helpers/util.d.ts +0 -85
  443. package/node_modules/zod/v3/helpers/util.js +0 -133
  444. package/node_modules/zod/v3/index.cjs +0 -33
  445. package/node_modules/zod/v3/index.d.cts +0 -4
  446. package/node_modules/zod/v3/index.d.ts +0 -4
  447. package/node_modules/zod/v3/index.js +0 -4
  448. package/node_modules/zod/v3/locales/en.cjs +0 -112
  449. package/node_modules/zod/v3/locales/en.d.cts +0 -3
  450. package/node_modules/zod/v3/locales/en.d.ts +0 -3
  451. package/node_modules/zod/v3/locales/en.js +0 -109
  452. package/node_modules/zod/v3/package.json +0 -6
  453. package/node_modules/zod/v3/standard-schema.cjs +0 -2
  454. package/node_modules/zod/v3/standard-schema.d.cts +0 -102
  455. package/node_modules/zod/v3/standard-schema.d.ts +0 -102
  456. package/node_modules/zod/v3/standard-schema.js +0 -1
  457. package/node_modules/zod/v3/types.cjs +0 -3777
  458. package/node_modules/zod/v3/types.d.cts +0 -1034
  459. package/node_modules/zod/v3/types.d.ts +0 -1034
  460. package/node_modules/zod/v3/types.js +0 -3695
  461. package/node_modules/zod/v4/classic/checks.cjs +0 -32
  462. package/node_modules/zod/v4/classic/checks.d.cts +0 -1
  463. package/node_modules/zod/v4/classic/checks.d.ts +0 -1
  464. package/node_modules/zod/v4/classic/checks.js +0 -1
  465. package/node_modules/zod/v4/classic/coerce.cjs +0 -47
  466. package/node_modules/zod/v4/classic/coerce.d.cts +0 -17
  467. package/node_modules/zod/v4/classic/coerce.d.ts +0 -17
  468. package/node_modules/zod/v4/classic/coerce.js +0 -17
  469. package/node_modules/zod/v4/classic/compat.cjs +0 -61
  470. package/node_modules/zod/v4/classic/compat.d.cts +0 -50
  471. package/node_modules/zod/v4/classic/compat.d.ts +0 -50
  472. package/node_modules/zod/v4/classic/compat.js +0 -31
  473. package/node_modules/zod/v4/classic/errors.cjs +0 -74
  474. package/node_modules/zod/v4/classic/errors.d.cts +0 -30
  475. package/node_modules/zod/v4/classic/errors.d.ts +0 -30
  476. package/node_modules/zod/v4/classic/errors.js +0 -48
  477. package/node_modules/zod/v4/classic/external.cjs +0 -70
  478. package/node_modules/zod/v4/classic/external.d.cts +0 -13
  479. package/node_modules/zod/v4/classic/external.d.ts +0 -13
  480. package/node_modules/zod/v4/classic/external.js +0 -18
  481. package/node_modules/zod/v4/classic/index.cjs +0 -33
  482. package/node_modules/zod/v4/classic/index.d.cts +0 -4
  483. package/node_modules/zod/v4/classic/index.d.ts +0 -4
  484. package/node_modules/zod/v4/classic/index.js +0 -4
  485. package/node_modules/zod/v4/classic/iso.cjs +0 -60
  486. package/node_modules/zod/v4/classic/iso.d.cts +0 -22
  487. package/node_modules/zod/v4/classic/iso.d.ts +0 -22
  488. package/node_modules/zod/v4/classic/iso.js +0 -30
  489. package/node_modules/zod/v4/classic/package.json +0 -6
  490. package/node_modules/zod/v4/classic/parse.cjs +0 -41
  491. package/node_modules/zod/v4/classic/parse.d.cts +0 -31
  492. package/node_modules/zod/v4/classic/parse.d.ts +0 -31
  493. package/node_modules/zod/v4/classic/parse.js +0 -15
  494. package/node_modules/zod/v4/classic/schemas.cjs +0 -1151
  495. package/node_modules/zod/v4/classic/schemas.d.cts +0 -673
  496. package/node_modules/zod/v4/classic/schemas.d.ts +0 -673
  497. package/node_modules/zod/v4/classic/schemas.js +0 -1040
  498. package/node_modules/zod/v4/core/api.cjs +0 -1060
  499. package/node_modules/zod/v4/core/api.d.cts +0 -295
  500. package/node_modules/zod/v4/core/api.d.ts +0 -295
  501. package/node_modules/zod/v4/core/api.js +0 -925
  502. package/node_modules/zod/v4/core/checks.cjs +0 -595
  503. package/node_modules/zod/v4/core/checks.d.cts +0 -278
  504. package/node_modules/zod/v4/core/checks.d.ts +0 -278
  505. package/node_modules/zod/v4/core/checks.js +0 -569
  506. package/node_modules/zod/v4/core/core.cjs +0 -74
  507. package/node_modules/zod/v4/core/core.d.cts +0 -52
  508. package/node_modules/zod/v4/core/core.d.ts +0 -52
  509. package/node_modules/zod/v4/core/core.js +0 -67
  510. package/node_modules/zod/v4/core/doc.cjs +0 -39
  511. package/node_modules/zod/v4/core/doc.d.cts +0 -14
  512. package/node_modules/zod/v4/core/doc.d.ts +0 -14
  513. package/node_modules/zod/v4/core/doc.js +0 -35
  514. package/node_modules/zod/v4/core/errors.cjs +0 -213
  515. package/node_modules/zod/v4/core/errors.d.cts +0 -210
  516. package/node_modules/zod/v4/core/errors.d.ts +0 -210
  517. package/node_modules/zod/v4/core/errors.js +0 -182
  518. package/node_modules/zod/v4/core/index.cjs +0 -43
  519. package/node_modules/zod/v4/core/index.d.cts +0 -14
  520. package/node_modules/zod/v4/core/index.d.ts +0 -14
  521. package/node_modules/zod/v4/core/index.js +0 -14
  522. package/node_modules/zod/v4/core/json-schema.cjs +0 -2
  523. package/node_modules/zod/v4/core/json-schema.d.cts +0 -88
  524. package/node_modules/zod/v4/core/json-schema.d.ts +0 -88
  525. package/node_modules/zod/v4/core/json-schema.js +0 -1
  526. package/node_modules/zod/v4/core/package.json +0 -6
  527. package/node_modules/zod/v4/core/parse.cjs +0 -131
  528. package/node_modules/zod/v4/core/parse.d.cts +0 -49
  529. package/node_modules/zod/v4/core/parse.d.ts +0 -49
  530. package/node_modules/zod/v4/core/parse.js +0 -93
  531. package/node_modules/zod/v4/core/regexes.cjs +0 -136
  532. package/node_modules/zod/v4/core/regexes.d.cts +0 -78
  533. package/node_modules/zod/v4/core/regexes.d.ts +0 -78
  534. package/node_modules/zod/v4/core/regexes.js +0 -127
  535. package/node_modules/zod/v4/core/registries.cjs +0 -57
  536. package/node_modules/zod/v4/core/registries.d.cts +0 -35
  537. package/node_modules/zod/v4/core/registries.d.ts +0 -35
  538. package/node_modules/zod/v4/core/registries.js +0 -52
  539. package/node_modules/zod/v4/core/schemas.cjs +0 -1986
  540. package/node_modules/zod/v4/core/schemas.d.cts +0 -1113
  541. package/node_modules/zod/v4/core/schemas.d.ts +0 -1113
  542. package/node_modules/zod/v4/core/schemas.js +0 -1955
  543. package/node_modules/zod/v4/core/standard-schema.cjs +0 -2
  544. package/node_modules/zod/v4/core/standard-schema.d.cts +0 -55
  545. package/node_modules/zod/v4/core/standard-schema.d.ts +0 -55
  546. package/node_modules/zod/v4/core/standard-schema.js +0 -1
  547. package/node_modules/zod/v4/core/to-json-schema.cjs +0 -920
  548. package/node_modules/zod/v4/core/to-json-schema.d.cts +0 -90
  549. package/node_modules/zod/v4/core/to-json-schema.d.ts +0 -90
  550. package/node_modules/zod/v4/core/to-json-schema.js +0 -915
  551. package/node_modules/zod/v4/core/util.cjs +0 -658
  552. package/node_modules/zod/v4/core/util.d.cts +0 -197
  553. package/node_modules/zod/v4/core/util.d.ts +0 -197
  554. package/node_modules/zod/v4/core/util.js +0 -601
  555. package/node_modules/zod/v4/core/versions.cjs +0 -8
  556. package/node_modules/zod/v4/core/versions.d.cts +0 -5
  557. package/node_modules/zod/v4/core/versions.d.ts +0 -5
  558. package/node_modules/zod/v4/core/versions.js +0 -5
  559. package/node_modules/zod/v4/index.cjs +0 -22
  560. package/node_modules/zod/v4/index.d.cts +0 -3
  561. package/node_modules/zod/v4/index.d.ts +0 -3
  562. package/node_modules/zod/v4/index.js +0 -3
  563. package/node_modules/zod/v4/locales/ar.cjs +0 -143
  564. package/node_modules/zod/v4/locales/ar.d.cts +0 -5
  565. package/node_modules/zod/v4/locales/ar.d.ts +0 -4
  566. package/node_modules/zod/v4/locales/ar.js +0 -116
  567. package/node_modules/zod/v4/locales/az.cjs +0 -142
  568. package/node_modules/zod/v4/locales/az.d.cts +0 -5
  569. package/node_modules/zod/v4/locales/az.d.ts +0 -4
  570. package/node_modules/zod/v4/locales/az.js +0 -115
  571. package/node_modules/zod/v4/locales/be.cjs +0 -191
  572. package/node_modules/zod/v4/locales/be.d.cts +0 -5
  573. package/node_modules/zod/v4/locales/be.d.ts +0 -4
  574. package/node_modules/zod/v4/locales/be.js +0 -164
  575. package/node_modules/zod/v4/locales/bg.cjs +0 -156
  576. package/node_modules/zod/v4/locales/bg.d.cts +0 -5
  577. package/node_modules/zod/v4/locales/bg.d.ts +0 -5
  578. package/node_modules/zod/v4/locales/bg.js +0 -128
  579. package/node_modules/zod/v4/locales/ca.cjs +0 -145
  580. package/node_modules/zod/v4/locales/ca.d.cts +0 -5
  581. package/node_modules/zod/v4/locales/ca.d.ts +0 -4
  582. package/node_modules/zod/v4/locales/ca.js +0 -118
  583. package/node_modules/zod/v4/locales/cs.cjs +0 -162
  584. package/node_modules/zod/v4/locales/cs.d.cts +0 -5
  585. package/node_modules/zod/v4/locales/cs.d.ts +0 -4
  586. package/node_modules/zod/v4/locales/cs.js +0 -135
  587. package/node_modules/zod/v4/locales/da.cjs +0 -158
  588. package/node_modules/zod/v4/locales/da.d.cts +0 -5
  589. package/node_modules/zod/v4/locales/da.d.ts +0 -4
  590. package/node_modules/zod/v4/locales/da.js +0 -131
  591. package/node_modules/zod/v4/locales/de.cjs +0 -143
  592. package/node_modules/zod/v4/locales/de.d.cts +0 -5
  593. package/node_modules/zod/v4/locales/de.d.ts +0 -4
  594. package/node_modules/zod/v4/locales/de.js +0 -116
  595. package/node_modules/zod/v4/locales/en.cjs +0 -145
  596. package/node_modules/zod/v4/locales/en.d.cts +0 -5
  597. package/node_modules/zod/v4/locales/en.d.ts +0 -5
  598. package/node_modules/zod/v4/locales/en.js +0 -117
  599. package/node_modules/zod/v4/locales/eo.cjs +0 -144
  600. package/node_modules/zod/v4/locales/eo.d.cts +0 -5
  601. package/node_modules/zod/v4/locales/eo.d.ts +0 -5
  602. package/node_modules/zod/v4/locales/eo.js +0 -116
  603. package/node_modules/zod/v4/locales/es.cjs +0 -176
  604. package/node_modules/zod/v4/locales/es.d.cts +0 -5
  605. package/node_modules/zod/v4/locales/es.d.ts +0 -4
  606. package/node_modules/zod/v4/locales/es.js +0 -149
  607. package/node_modules/zod/v4/locales/fa.cjs +0 -149
  608. package/node_modules/zod/v4/locales/fa.d.cts +0 -5
  609. package/node_modules/zod/v4/locales/fa.d.ts +0 -4
  610. package/node_modules/zod/v4/locales/fa.js +0 -122
  611. package/node_modules/zod/v4/locales/fi.cjs +0 -149
  612. package/node_modules/zod/v4/locales/fi.d.cts +0 -5
  613. package/node_modules/zod/v4/locales/fi.d.ts +0 -4
  614. package/node_modules/zod/v4/locales/fi.js +0 -122
  615. package/node_modules/zod/v4/locales/fr-CA.cjs +0 -144
  616. package/node_modules/zod/v4/locales/fr-CA.d.cts +0 -5
  617. package/node_modules/zod/v4/locales/fr-CA.d.ts +0 -4
  618. package/node_modules/zod/v4/locales/fr-CA.js +0 -117
  619. package/node_modules/zod/v4/locales/fr.cjs +0 -143
  620. package/node_modules/zod/v4/locales/fr.d.cts +0 -5
  621. package/node_modules/zod/v4/locales/fr.d.ts +0 -4
  622. package/node_modules/zod/v4/locales/fr.js +0 -116
  623. package/node_modules/zod/v4/locales/he.cjs +0 -144
  624. package/node_modules/zod/v4/locales/he.d.cts +0 -5
  625. package/node_modules/zod/v4/locales/he.d.ts +0 -4
  626. package/node_modules/zod/v4/locales/he.js +0 -117
  627. package/node_modules/zod/v4/locales/hu.cjs +0 -144
  628. package/node_modules/zod/v4/locales/hu.d.cts +0 -5
  629. package/node_modules/zod/v4/locales/hu.d.ts +0 -4
  630. package/node_modules/zod/v4/locales/hu.js +0 -117
  631. package/node_modules/zod/v4/locales/id.cjs +0 -143
  632. package/node_modules/zod/v4/locales/id.d.cts +0 -5
  633. package/node_modules/zod/v4/locales/id.d.ts +0 -4
  634. package/node_modules/zod/v4/locales/id.js +0 -116
  635. package/node_modules/zod/v4/locales/index.cjs +0 -100
  636. package/node_modules/zod/v4/locales/index.d.cts +0 -47
  637. package/node_modules/zod/v4/locales/index.d.ts +0 -47
  638. package/node_modules/zod/v4/locales/index.js +0 -47
  639. package/node_modules/zod/v4/locales/is.cjs +0 -145
  640. package/node_modules/zod/v4/locales/is.d.cts +0 -5
  641. package/node_modules/zod/v4/locales/is.d.ts +0 -5
  642. package/node_modules/zod/v4/locales/is.js +0 -117
  643. package/node_modules/zod/v4/locales/it.cjs +0 -144
  644. package/node_modules/zod/v4/locales/it.d.cts +0 -5
  645. package/node_modules/zod/v4/locales/it.d.ts +0 -4
  646. package/node_modules/zod/v4/locales/it.js +0 -117
  647. package/node_modules/zod/v4/locales/ja.cjs +0 -142
  648. package/node_modules/zod/v4/locales/ja.d.cts +0 -5
  649. package/node_modules/zod/v4/locales/ja.d.ts +0 -4
  650. package/node_modules/zod/v4/locales/ja.js +0 -115
  651. package/node_modules/zod/v4/locales/ka.cjs +0 -153
  652. package/node_modules/zod/v4/locales/ka.d.cts +0 -5
  653. package/node_modules/zod/v4/locales/ka.d.ts +0 -5
  654. package/node_modules/zod/v4/locales/ka.js +0 -125
  655. package/node_modules/zod/v4/locales/kh.cjs +0 -12
  656. package/node_modules/zod/v4/locales/kh.d.cts +0 -5
  657. package/node_modules/zod/v4/locales/kh.d.ts +0 -5
  658. package/node_modules/zod/v4/locales/kh.js +0 -5
  659. package/node_modules/zod/v4/locales/km.cjs +0 -144
  660. package/node_modules/zod/v4/locales/km.d.cts +0 -5
  661. package/node_modules/zod/v4/locales/km.d.ts +0 -4
  662. package/node_modules/zod/v4/locales/km.js +0 -117
  663. package/node_modules/zod/v4/locales/ko.cjs +0 -148
  664. package/node_modules/zod/v4/locales/ko.d.cts +0 -5
  665. package/node_modules/zod/v4/locales/ko.d.ts +0 -4
  666. package/node_modules/zod/v4/locales/ko.js +0 -121
  667. package/node_modules/zod/v4/locales/lt.cjs +0 -258
  668. package/node_modules/zod/v4/locales/lt.d.cts +0 -5
  669. package/node_modules/zod/v4/locales/lt.d.ts +0 -5
  670. package/node_modules/zod/v4/locales/lt.js +0 -230
  671. package/node_modules/zod/v4/locales/mk.cjs +0 -145
  672. package/node_modules/zod/v4/locales/mk.d.cts +0 -5
  673. package/node_modules/zod/v4/locales/mk.d.ts +0 -4
  674. package/node_modules/zod/v4/locales/mk.js +0 -118
  675. package/node_modules/zod/v4/locales/ms.cjs +0 -143
  676. package/node_modules/zod/v4/locales/ms.d.cts +0 -5
  677. package/node_modules/zod/v4/locales/ms.d.ts +0 -4
  678. package/node_modules/zod/v4/locales/ms.js +0 -116
  679. package/node_modules/zod/v4/locales/nl.cjs +0 -144
  680. package/node_modules/zod/v4/locales/nl.d.cts +0 -5
  681. package/node_modules/zod/v4/locales/nl.d.ts +0 -4
  682. package/node_modules/zod/v4/locales/nl.js +0 -117
  683. package/node_modules/zod/v4/locales/no.cjs +0 -143
  684. package/node_modules/zod/v4/locales/no.d.cts +0 -5
  685. package/node_modules/zod/v4/locales/no.d.ts +0 -4
  686. package/node_modules/zod/v4/locales/no.js +0 -116
  687. package/node_modules/zod/v4/locales/ota.cjs +0 -144
  688. package/node_modules/zod/v4/locales/ota.d.cts +0 -5
  689. package/node_modules/zod/v4/locales/ota.d.ts +0 -4
  690. package/node_modules/zod/v4/locales/ota.js +0 -117
  691. package/node_modules/zod/v4/locales/package.json +0 -6
  692. package/node_modules/zod/v4/locales/pl.cjs +0 -144
  693. package/node_modules/zod/v4/locales/pl.d.cts +0 -5
  694. package/node_modules/zod/v4/locales/pl.d.ts +0 -4
  695. package/node_modules/zod/v4/locales/pl.js +0 -117
  696. package/node_modules/zod/v4/locales/ps.cjs +0 -149
  697. package/node_modules/zod/v4/locales/ps.d.cts +0 -5
  698. package/node_modules/zod/v4/locales/ps.d.ts +0 -4
  699. package/node_modules/zod/v4/locales/ps.js +0 -122
  700. package/node_modules/zod/v4/locales/pt.cjs +0 -143
  701. package/node_modules/zod/v4/locales/pt.d.cts +0 -5
  702. package/node_modules/zod/v4/locales/pt.d.ts +0 -4
  703. package/node_modules/zod/v4/locales/pt.js +0 -116
  704. package/node_modules/zod/v4/locales/ru.cjs +0 -191
  705. package/node_modules/zod/v4/locales/ru.d.cts +0 -5
  706. package/node_modules/zod/v4/locales/ru.d.ts +0 -4
  707. package/node_modules/zod/v4/locales/ru.js +0 -164
  708. package/node_modules/zod/v4/locales/sl.cjs +0 -144
  709. package/node_modules/zod/v4/locales/sl.d.cts +0 -5
  710. package/node_modules/zod/v4/locales/sl.d.ts +0 -4
  711. package/node_modules/zod/v4/locales/sl.js +0 -117
  712. package/node_modules/zod/v4/locales/sv.cjs +0 -145
  713. package/node_modules/zod/v4/locales/sv.d.cts +0 -5
  714. package/node_modules/zod/v4/locales/sv.d.ts +0 -4
  715. package/node_modules/zod/v4/locales/sv.js +0 -118
  716. package/node_modules/zod/v4/locales/ta.cjs +0 -144
  717. package/node_modules/zod/v4/locales/ta.d.cts +0 -5
  718. package/node_modules/zod/v4/locales/ta.d.ts +0 -4
  719. package/node_modules/zod/v4/locales/ta.js +0 -117
  720. package/node_modules/zod/v4/locales/th.cjs +0 -144
  721. package/node_modules/zod/v4/locales/th.d.cts +0 -5
  722. package/node_modules/zod/v4/locales/th.d.ts +0 -4
  723. package/node_modules/zod/v4/locales/th.js +0 -117
  724. package/node_modules/zod/v4/locales/tr.cjs +0 -143
  725. package/node_modules/zod/v4/locales/tr.d.cts +0 -5
  726. package/node_modules/zod/v4/locales/tr.d.ts +0 -5
  727. package/node_modules/zod/v4/locales/tr.js +0 -115
  728. package/node_modules/zod/v4/locales/ua.cjs +0 -12
  729. package/node_modules/zod/v4/locales/ua.d.cts +0 -5
  730. package/node_modules/zod/v4/locales/ua.d.ts +0 -5
  731. package/node_modules/zod/v4/locales/ua.js +0 -5
  732. package/node_modules/zod/v4/locales/uk.cjs +0 -144
  733. package/node_modules/zod/v4/locales/uk.d.cts +0 -5
  734. package/node_modules/zod/v4/locales/uk.d.ts +0 -4
  735. package/node_modules/zod/v4/locales/uk.js +0 -117
  736. package/node_modules/zod/v4/locales/ur.cjs +0 -144
  737. package/node_modules/zod/v4/locales/ur.d.cts +0 -5
  738. package/node_modules/zod/v4/locales/ur.d.ts +0 -4
  739. package/node_modules/zod/v4/locales/ur.js +0 -117
  740. package/node_modules/zod/v4/locales/vi.cjs +0 -143
  741. package/node_modules/zod/v4/locales/vi.d.cts +0 -5
  742. package/node_modules/zod/v4/locales/vi.d.ts +0 -4
  743. package/node_modules/zod/v4/locales/vi.js +0 -116
  744. package/node_modules/zod/v4/locales/yo.cjs +0 -142
  745. package/node_modules/zod/v4/locales/yo.d.cts +0 -5
  746. package/node_modules/zod/v4/locales/yo.d.ts +0 -4
  747. package/node_modules/zod/v4/locales/yo.js +0 -115
  748. package/node_modules/zod/v4/locales/zh-CN.cjs +0 -143
  749. package/node_modules/zod/v4/locales/zh-CN.d.cts +0 -5
  750. package/node_modules/zod/v4/locales/zh-CN.d.ts +0 -4
  751. package/node_modules/zod/v4/locales/zh-CN.js +0 -116
  752. package/node_modules/zod/v4/locales/zh-TW.cjs +0 -144
  753. package/node_modules/zod/v4/locales/zh-TW.d.cts +0 -5
  754. package/node_modules/zod/v4/locales/zh-TW.d.ts +0 -4
  755. package/node_modules/zod/v4/locales/zh-TW.js +0 -117
  756. package/node_modules/zod/v4/mini/checks.cjs +0 -34
  757. package/node_modules/zod/v4/mini/checks.d.cts +0 -1
  758. package/node_modules/zod/v4/mini/checks.d.ts +0 -1
  759. package/node_modules/zod/v4/mini/checks.js +0 -1
  760. package/node_modules/zod/v4/mini/coerce.cjs +0 -47
  761. package/node_modules/zod/v4/mini/coerce.d.cts +0 -7
  762. package/node_modules/zod/v4/mini/coerce.d.ts +0 -7
  763. package/node_modules/zod/v4/mini/coerce.js +0 -17
  764. package/node_modules/zod/v4/mini/external.cjs +0 -62
  765. package/node_modules/zod/v4/mini/external.d.cts +0 -11
  766. package/node_modules/zod/v4/mini/external.d.ts +0 -11
  767. package/node_modules/zod/v4/mini/external.js +0 -13
  768. package/node_modules/zod/v4/mini/index.cjs +0 -32
  769. package/node_modules/zod/v4/mini/index.d.cts +0 -3
  770. package/node_modules/zod/v4/mini/index.d.ts +0 -3
  771. package/node_modules/zod/v4/mini/index.js +0 -3
  772. package/node_modules/zod/v4/mini/iso.cjs +0 -60
  773. package/node_modules/zod/v4/mini/iso.d.cts +0 -22
  774. package/node_modules/zod/v4/mini/iso.d.ts +0 -22
  775. package/node_modules/zod/v4/mini/iso.js +0 -30
  776. package/node_modules/zod/v4/mini/package.json +0 -6
  777. package/node_modules/zod/v4/mini/parse.cjs +0 -16
  778. package/node_modules/zod/v4/mini/parse.d.cts +0 -1
  779. package/node_modules/zod/v4/mini/parse.d.ts +0 -1
  780. package/node_modules/zod/v4/mini/parse.js +0 -1
  781. package/node_modules/zod/v4/mini/schemas.cjs +0 -892
  782. package/node_modules/zod/v4/mini/schemas.d.cts +0 -407
  783. package/node_modules/zod/v4/mini/schemas.d.ts +0 -407
  784. package/node_modules/zod/v4/mini/schemas.js +0 -775
  785. package/node_modules/zod/v4/package.json +0 -6
  786. package/node_modules/zod/v4-mini/index.cjs +0 -17
  787. package/node_modules/zod/v4-mini/index.d.cts +0 -1
  788. package/node_modules/zod/v4-mini/index.d.ts +0 -1
  789. package/node_modules/zod/v4-mini/index.js +0 -1
  790. package/node_modules/zod/v4-mini/package.json +0 -6
  791. package/package/cc-switch-sdk/README.md +0 -541
  792. package/package/cc-switch-sdk/dist/constants.d.ts +0 -8
  793. package/package/cc-switch-sdk/dist/constants.js +0 -2
  794. package/package/cc-switch-sdk/dist/errors.d.ts +0 -5
  795. package/package/cc-switch-sdk/dist/errors.js +0 -2
  796. package/package/cc-switch-sdk/dist/index.d.ts +0 -5
  797. package/package/cc-switch-sdk/dist/index.js +0 -2
  798. package/package/cc-switch-sdk/dist/schemas.d.ts +0 -7
  799. package/package/cc-switch-sdk/dist/schemas.js +0 -2
  800. package/package/cc-switch-sdk/dist/sdk.d.ts +0 -59
  801. package/package/cc-switch-sdk/dist/sdk.js +0 -2
  802. package/package/cc-switch-sdk/dist/services/ai-config-service.js +0 -4
  803. package/package/cc-switch-sdk/dist/services/mcp-model.d.ts +0 -16
  804. package/package/cc-switch-sdk/dist/services/mcp-model.js +0 -2
  805. package/package/cc-switch-sdk/dist/services/mcp-service.d.ts +0 -17
  806. package/package/cc-switch-sdk/dist/services/mcp-service.js +0 -2
  807. package/package/cc-switch-sdk/dist/services/skill-model.d.ts +0 -16
  808. package/package/cc-switch-sdk/dist/services/skill-model.js +0 -2
  809. package/package/cc-switch-sdk/dist/services/skill-service.d.ts +0 -16
  810. package/package/cc-switch-sdk/dist/services/skill-service.js +0 -2
  811. package/package/cc-switch-sdk/dist/state.d.ts +0 -3
  812. package/package/cc-switch-sdk/dist/state.js +0 -2
  813. package/package/cc-switch-sdk/dist/types.d.ts +0 -78
  814. package/package/cc-switch-sdk/dist/types.js +0 -1
  815. package/package/cc-switch-sdk/dist/utils/fs.d.ts +0 -10
  816. package/package/cc-switch-sdk/dist/utils/fs.js +0 -3
  817. package/package/cc-switch-sdk/dist/utils/id.d.ts +0 -3
  818. package/package/cc-switch-sdk/dist/utils/id.js +0 -2
  819. package/package/cc-switch-sdk/package.json +0 -31
  820. /package/{node_modules/@cc-switch/sdk/dist/types.js → package/acode/dist/plugin-types.js} +0 -0
@@ -1,2197 +0,0 @@
1
- import * as core from "../core/index.js";
2
- import { util } from "../core/index.js";
3
-
4
- import * as checks from "./checks.js";
5
- import * as iso from "./iso.js";
6
- import * as parse from "./parse.js";
7
-
8
- ///////////////////////////////////////////
9
- ///////////////////////////////////////////
10
- //////////// ////////////
11
- //////////// ZodType ////////////
12
- //////////// ////////////
13
- ///////////////////////////////////////////
14
- ///////////////////////////////////////////
15
-
16
- export interface ZodType<
17
- out Output = unknown,
18
- out Input = unknown,
19
- out Internals extends core.$ZodTypeInternals<Output, Input> = core.$ZodTypeInternals<Output, Input>,
20
- > extends core.$ZodType<Output, Input, Internals> {
21
- def: Internals["def"];
22
- type: Internals["def"]["type"];
23
-
24
- /** @deprecated Use `.def` instead. */
25
- _def: Internals["def"];
26
- /** @deprecated Use `z.output<typeof schema>` instead. */
27
- _output: Internals["output"];
28
- /** @deprecated Use `z.input<typeof schema>` instead. */
29
- _input: Internals["input"];
30
-
31
- // base methods
32
- check(...checks: (core.CheckFn<core.output<this>> | core.$ZodCheck<core.output<this>>)[]): this;
33
- clone(def?: Internals["def"], params?: { parent: boolean }): this;
34
- register<R extends core.$ZodRegistry>(
35
- registry: R,
36
- ...meta: this extends R["_schema"]
37
- ? undefined extends R["_meta"]
38
- ? [core.$replace<R["_meta"], this>?]
39
- : [core.$replace<R["_meta"], this>]
40
- : ["Incompatible schema"]
41
- ): this;
42
-
43
- brand<T extends PropertyKey = PropertyKey>(value?: T): PropertyKey extends T ? this : core.$ZodBranded<this, T>;
44
-
45
- // parsing
46
- parse(data: unknown, params?: core.ParseContext<core.$ZodIssue>): core.output<this>;
47
- safeParse(data: unknown, params?: core.ParseContext<core.$ZodIssue>): parse.ZodSafeParseResult<core.output<this>>;
48
- parseAsync(data: unknown, params?: core.ParseContext<core.$ZodIssue>): Promise<core.output<this>>;
49
- safeParseAsync(
50
- data: unknown,
51
- params?: core.ParseContext<core.$ZodIssue>
52
- ): Promise<parse.ZodSafeParseResult<core.output<this>>>;
53
- spa: (
54
- data: unknown,
55
- params?: core.ParseContext<core.$ZodIssue>
56
- ) => Promise<parse.ZodSafeParseResult<core.output<this>>>;
57
-
58
- // encoding/decoding
59
- encode(data: core.output<this>, params?: core.ParseContext<core.$ZodIssue>): core.input<this>;
60
- decode(data: core.input<this>, params?: core.ParseContext<core.$ZodIssue>): core.output<this>;
61
- encodeAsync(data: core.output<this>, params?: core.ParseContext<core.$ZodIssue>): Promise<core.input<this>>;
62
- decodeAsync(data: core.input<this>, params?: core.ParseContext<core.$ZodIssue>): Promise<core.output<this>>;
63
- safeEncode(
64
- data: core.output<this>,
65
- params?: core.ParseContext<core.$ZodIssue>
66
- ): parse.ZodSafeParseResult<core.input<this>>;
67
- safeDecode(
68
- data: core.input<this>,
69
- params?: core.ParseContext<core.$ZodIssue>
70
- ): parse.ZodSafeParseResult<core.output<this>>;
71
- safeEncodeAsync(
72
- data: core.output<this>,
73
- params?: core.ParseContext<core.$ZodIssue>
74
- ): Promise<parse.ZodSafeParseResult<core.input<this>>>;
75
- safeDecodeAsync(
76
- data: core.input<this>,
77
- params?: core.ParseContext<core.$ZodIssue>
78
- ): Promise<parse.ZodSafeParseResult<core.output<this>>>;
79
-
80
- // refinements
81
- refine(check: (arg: core.output<this>) => unknown | Promise<unknown>, params?: string | core.$ZodCustomParams): this;
82
- superRefine(
83
- refinement: (arg: core.output<this>, ctx: core.$RefinementCtx<core.output<this>>) => void | Promise<void>
84
- ): this;
85
- overwrite(fn: (x: core.output<this>) => core.output<this>): this;
86
-
87
- // wrappers
88
- optional(): ZodOptional<this>;
89
- nonoptional(params?: string | core.$ZodNonOptionalParams): ZodNonOptional<this>;
90
- nullable(): ZodNullable<this>;
91
- nullish(): ZodOptional<ZodNullable<this>>;
92
- default(def: util.NoUndefined<core.output<this>>): ZodDefault<this>;
93
- default(def: () => util.NoUndefined<core.output<this>>): ZodDefault<this>;
94
- prefault(def: () => core.input<this>): ZodPrefault<this>;
95
- prefault(def: core.input<this>): ZodPrefault<this>;
96
- array(): ZodArray<this>;
97
- or<T extends core.SomeType>(option: T): ZodUnion<[this, T]>;
98
- and<T extends core.SomeType>(incoming: T): ZodIntersection<this, T>;
99
- transform<NewOut>(
100
- transform: (arg: core.output<this>, ctx: core.$RefinementCtx<core.output<this>>) => NewOut | Promise<NewOut>
101
- ): ZodPipe<this, ZodTransform<Awaited<NewOut>, core.output<this>>>;
102
- catch(def: core.output<this>): ZodCatch<this>;
103
- catch(def: (ctx: core.$ZodCatchCtx) => core.output<this>): ZodCatch<this>;
104
- pipe<T extends core.$ZodType<any, core.output<this>>>(
105
- target: T | core.$ZodType<any, core.output<this>>
106
- ): ZodPipe<this, T>;
107
- readonly(): ZodReadonly<this>;
108
-
109
- /** Returns a new instance that has been registered in `z.globalRegistry` with the specified description */
110
- describe(description: string): this;
111
- description?: string;
112
- /** Returns the metadata associated with this instance in `z.globalRegistry` */
113
- meta(): core.$replace<core.GlobalMeta, this> | undefined;
114
- /** Returns a new instance that has been registered in `z.globalRegistry` with the specified metadata */
115
- meta(data: core.$replace<core.GlobalMeta, this>): this;
116
-
117
- // helpers
118
- /** @deprecated Try safe-parsing `undefined` (this is what `isOptional` does internally):
119
- *
120
- * ```ts
121
- * const schema = z.string().optional();
122
- * const isOptional = schema.safeParse(undefined).success; // true
123
- * ```
124
- */
125
- isOptional(): boolean;
126
- /**
127
- * @deprecated Try safe-parsing `null` (this is what `isNullable` does internally):
128
- *
129
- * ```ts
130
- * const schema = z.string().nullable();
131
- * const isNullable = schema.safeParse(null).success; // true
132
- * ```
133
- */
134
- isNullable(): boolean;
135
- }
136
-
137
- export interface _ZodType<out Internals extends core.$ZodTypeInternals = core.$ZodTypeInternals>
138
- extends ZodType<any, any, Internals> {}
139
-
140
- export const ZodType: core.$constructor<ZodType> = /*@__PURE__*/ core.$constructor("ZodType", (inst, def) => {
141
- core.$ZodType.init(inst, def);
142
- inst.def = def;
143
- inst.type = def.type;
144
- Object.defineProperty(inst, "_def", { value: def });
145
-
146
- // base methods
147
- inst.check = (...checks) => {
148
- return inst.clone(
149
- util.mergeDefs(def, {
150
- checks: [
151
- ...(def.checks ?? []),
152
- ...checks.map((ch) =>
153
- typeof ch === "function" ? { _zod: { check: ch, def: { check: "custom" }, onattach: [] } } : ch
154
- ),
155
- ],
156
- })
157
- );
158
- };
159
- inst.clone = (def, params) => core.clone(inst, def, params);
160
- inst.brand = () => inst as any;
161
- inst.register = ((reg: any, meta: any) => {
162
- reg.add(inst, meta);
163
- return inst;
164
- }) as any;
165
-
166
- // parsing
167
- inst.parse = (data, params) => parse.parse(inst, data, params, { callee: inst.parse });
168
- inst.safeParse = (data, params) => parse.safeParse(inst, data, params);
169
- inst.parseAsync = async (data, params) => parse.parseAsync(inst, data, params, { callee: inst.parseAsync });
170
- inst.safeParseAsync = async (data, params) => parse.safeParseAsync(inst, data, params);
171
- inst.spa = inst.safeParseAsync;
172
-
173
- // encoding/decoding
174
- inst.encode = (data, params) => parse.encode(inst, data, params);
175
- inst.decode = (data, params) => parse.decode(inst, data, params);
176
- inst.encodeAsync = async (data, params) => parse.encodeAsync(inst, data, params);
177
- inst.decodeAsync = async (data, params) => parse.decodeAsync(inst, data, params);
178
- inst.safeEncode = (data, params) => parse.safeEncode(inst, data, params);
179
- inst.safeDecode = (data, params) => parse.safeDecode(inst, data, params);
180
- inst.safeEncodeAsync = async (data, params) => parse.safeEncodeAsync(inst, data, params);
181
- inst.safeDecodeAsync = async (data, params) => parse.safeDecodeAsync(inst, data, params);
182
-
183
- // refinements
184
- inst.refine = (check, params) => inst.check(refine(check, params));
185
- inst.superRefine = (refinement) => inst.check(superRefine(refinement));
186
- inst.overwrite = (fn) => inst.check(checks.overwrite(fn));
187
-
188
- // wrappers
189
- inst.optional = () => optional(inst);
190
- inst.nullable = () => nullable(inst);
191
- inst.nullish = () => optional(nullable(inst));
192
- inst.nonoptional = (params) => nonoptional(inst, params);
193
- inst.array = () => array(inst);
194
- inst.or = (arg) => union([inst, arg]);
195
- inst.and = (arg) => intersection(inst, arg);
196
- inst.transform = (tx) => pipe(inst, transform(tx as any)) as never;
197
- inst.default = (def) => _default(inst, def);
198
- inst.prefault = (def) => prefault(inst, def);
199
- // inst.coalesce = (def, params) => coalesce(inst, def, params);
200
- inst.catch = (params) => _catch(inst, params);
201
- inst.pipe = (target) => pipe(inst, target);
202
- inst.readonly = () => readonly(inst);
203
-
204
- // meta
205
- inst.describe = (description) => {
206
- const cl = inst.clone();
207
- core.globalRegistry.add(cl, { description });
208
- return cl;
209
- };
210
- Object.defineProperty(inst, "description", {
211
- get() {
212
- return core.globalRegistry.get(inst)?.description;
213
- },
214
- configurable: true,
215
- });
216
- inst.meta = (...args: any) => {
217
- if (args.length === 0) {
218
- return core.globalRegistry.get(inst);
219
- }
220
- const cl = inst.clone();
221
- core.globalRegistry.add(cl, args[0]);
222
- return cl as any;
223
- };
224
-
225
- // helpers
226
- inst.isOptional = () => inst.safeParse(undefined).success;
227
- inst.isNullable = () => inst.safeParse(null).success;
228
- return inst;
229
- });
230
-
231
- // ZodString
232
- export interface _ZodString<T extends core.$ZodStringInternals<unknown> = core.$ZodStringInternals<unknown>>
233
- extends _ZodType<T> {
234
- format: string | null;
235
- minLength: number | null;
236
- maxLength: number | null;
237
-
238
- // miscellaneous checks
239
- regex(regex: RegExp, params?: string | core.$ZodCheckRegexParams): this;
240
- includes(value: string, params?: core.$ZodCheckIncludesParams): this;
241
- startsWith(value: string, params?: string | core.$ZodCheckStartsWithParams): this;
242
- endsWith(value: string, params?: string | core.$ZodCheckEndsWithParams): this;
243
- min(minLength: number, params?: string | core.$ZodCheckMinLengthParams): this;
244
- max(maxLength: number, params?: string | core.$ZodCheckMaxLengthParams): this;
245
- length(len: number, params?: string | core.$ZodCheckLengthEqualsParams): this;
246
- nonempty(params?: string | core.$ZodCheckMinLengthParams): this;
247
- lowercase(params?: string | core.$ZodCheckLowerCaseParams): this;
248
- uppercase(params?: string | core.$ZodCheckUpperCaseParams): this;
249
-
250
- // transforms
251
- trim(): this;
252
- normalize(form?: "NFC" | "NFD" | "NFKC" | "NFKD" | (string & {})): this;
253
- toLowerCase(): this;
254
- toUpperCase(): this;
255
- }
256
-
257
- /** @internal */
258
- export const _ZodString: core.$constructor<_ZodString> = /*@__PURE__*/ core.$constructor("_ZodString", (inst, def) => {
259
- core.$ZodString.init(inst, def);
260
- ZodType.init(inst, def);
261
-
262
- const bag = inst._zod.bag;
263
- inst.format = bag.format ?? null;
264
- inst.minLength = bag.minimum ?? null;
265
- inst.maxLength = bag.maximum ?? null;
266
-
267
- // validations
268
- inst.regex = (...args) => inst.check(checks.regex(...args));
269
- inst.includes = (...args) => inst.check(checks.includes(...args));
270
- inst.startsWith = (...args) => inst.check(checks.startsWith(...args));
271
- inst.endsWith = (...args) => inst.check(checks.endsWith(...args));
272
- inst.min = (...args) => inst.check(checks.minLength(...args));
273
- inst.max = (...args) => inst.check(checks.maxLength(...args));
274
- inst.length = (...args) => inst.check(checks.length(...args));
275
- inst.nonempty = (...args) => inst.check(checks.minLength(1, ...args));
276
- inst.lowercase = (params) => inst.check(checks.lowercase(params));
277
- inst.uppercase = (params) => inst.check(checks.uppercase(params));
278
-
279
- // transforms
280
- inst.trim = () => inst.check(checks.trim());
281
- inst.normalize = (...args) => inst.check(checks.normalize(...args));
282
- inst.toLowerCase = () => inst.check(checks.toLowerCase());
283
- inst.toUpperCase = () => inst.check(checks.toUpperCase());
284
- });
285
-
286
- export interface ZodString extends _ZodString<core.$ZodStringInternals<string>> {
287
- // string format checks
288
-
289
- /** @deprecated Use `z.email()` instead. */
290
- email(params?: string | core.$ZodCheckEmailParams): this;
291
- /** @deprecated Use `z.url()` instead. */
292
- url(params?: string | core.$ZodCheckURLParams): this;
293
- /** @deprecated Use `z.jwt()` instead. */
294
- jwt(params?: string | core.$ZodCheckJWTParams): this;
295
- /** @deprecated Use `z.emoji()` instead. */
296
- emoji(params?: string | core.$ZodCheckEmojiParams): this;
297
- /** @deprecated Use `z.guid()` instead. */
298
- guid(params?: string | core.$ZodCheckGUIDParams): this;
299
- /** @deprecated Use `z.uuid()` instead. */
300
- uuid(params?: string | core.$ZodCheckUUIDParams): this;
301
- /** @deprecated Use `z.uuid()` instead. */
302
- uuidv4(params?: string | core.$ZodCheckUUIDParams): this;
303
- /** @deprecated Use `z.uuid()` instead. */
304
- uuidv6(params?: string | core.$ZodCheckUUIDParams): this;
305
- /** @deprecated Use `z.uuid()` instead. */
306
- uuidv7(params?: string | core.$ZodCheckUUIDParams): this;
307
- /** @deprecated Use `z.nanoid()` instead. */
308
- nanoid(params?: string | core.$ZodCheckNanoIDParams): this;
309
- /** @deprecated Use `z.guid()` instead. */
310
- guid(params?: string | core.$ZodCheckGUIDParams): this;
311
- /** @deprecated Use `z.cuid()` instead. */
312
- cuid(params?: string | core.$ZodCheckCUIDParams): this;
313
- /** @deprecated Use `z.cuid2()` instead. */
314
- cuid2(params?: string | core.$ZodCheckCUID2Params): this;
315
- /** @deprecated Use `z.ulid()` instead. */
316
- ulid(params?: string | core.$ZodCheckULIDParams): this;
317
- /** @deprecated Use `z.base64()` instead. */
318
- base64(params?: string | core.$ZodCheckBase64Params): this;
319
- /** @deprecated Use `z.base64url()` instead. */
320
- base64url(params?: string | core.$ZodCheckBase64URLParams): this;
321
- // /** @deprecated Use `z.jsonString()` instead. */
322
- // jsonString(params?: string | core.$ZodCheckJSONStringParams): this;
323
- /** @deprecated Use `z.xid()` instead. */
324
- xid(params?: string | core.$ZodCheckXIDParams): this;
325
- /** @deprecated Use `z.ksuid()` instead. */
326
- ksuid(params?: string | core.$ZodCheckKSUIDParams): this;
327
- // /** @deprecated Use `z.ipv4()` or `z.ipv6()` instead. */
328
- // ip(params?: string | (core.$ZodCheckIPv4Params & { version?: "v4" | "v6" })): ZodUnion<[this, this]>;
329
- /** @deprecated Use `z.ipv4()` instead. */
330
- ipv4(params?: string | core.$ZodCheckIPv4Params): this;
331
- /** @deprecated Use `z.ipv6()` instead. */
332
- ipv6(params?: string | core.$ZodCheckIPv6Params): this;
333
- /** @deprecated Use `z.cidrv4()` instead. */
334
- cidrv4(params?: string | core.$ZodCheckCIDRv4Params): this;
335
- /** @deprecated Use `z.cidrv6()` instead. */
336
- cidrv6(params?: string | core.$ZodCheckCIDRv6Params): this;
337
- /** @deprecated Use `z.e164()` instead. */
338
- e164(params?: string | core.$ZodCheckE164Params): this;
339
-
340
- // ISO 8601 checks
341
- /** @deprecated Use `z.iso.datetime()` instead. */
342
- datetime(params?: string | core.$ZodCheckISODateTimeParams): this;
343
- /** @deprecated Use `z.iso.date()` instead. */
344
- date(params?: string | core.$ZodCheckISODateParams): this;
345
- /** @deprecated Use `z.iso.time()` instead. */
346
- time(
347
- params?:
348
- | string
349
- // | {
350
- // message?: string | undefined;
351
- // precision?: number | null;
352
- // }
353
- | core.$ZodCheckISOTimeParams
354
- ): this;
355
- /** @deprecated Use `z.iso.duration()` instead. */
356
- duration(params?: string | core.$ZodCheckISODurationParams): this;
357
- }
358
-
359
- export const ZodString: core.$constructor<ZodString> = /*@__PURE__*/ core.$constructor("ZodString", (inst, def) => {
360
- core.$ZodString.init(inst, def);
361
- _ZodString.init(inst, def);
362
-
363
- inst.email = (params) => inst.check(core._email(ZodEmail, params));
364
- inst.url = (params) => inst.check(core._url(ZodURL, params));
365
- inst.jwt = (params) => inst.check(core._jwt(ZodJWT, params));
366
- inst.emoji = (params) => inst.check(core._emoji(ZodEmoji, params));
367
- inst.guid = (params) => inst.check(core._guid(ZodGUID, params));
368
- inst.uuid = (params) => inst.check(core._uuid(ZodUUID, params));
369
- inst.uuidv4 = (params) => inst.check(core._uuidv4(ZodUUID, params));
370
- inst.uuidv6 = (params) => inst.check(core._uuidv6(ZodUUID, params));
371
- inst.uuidv7 = (params) => inst.check(core._uuidv7(ZodUUID, params));
372
- inst.nanoid = (params) => inst.check(core._nanoid(ZodNanoID, params));
373
- inst.guid = (params) => inst.check(core._guid(ZodGUID, params));
374
- inst.cuid = (params) => inst.check(core._cuid(ZodCUID, params));
375
- inst.cuid2 = (params) => inst.check(core._cuid2(ZodCUID2, params));
376
- inst.ulid = (params) => inst.check(core._ulid(ZodULID, params));
377
- inst.base64 = (params) => inst.check(core._base64(ZodBase64, params));
378
- inst.base64url = (params) => inst.check(core._base64url(ZodBase64URL, params));
379
- inst.xid = (params) => inst.check(core._xid(ZodXID, params));
380
- inst.ksuid = (params) => inst.check(core._ksuid(ZodKSUID, params));
381
- inst.ipv4 = (params) => inst.check(core._ipv4(ZodIPv4, params));
382
- inst.ipv6 = (params) => inst.check(core._ipv6(ZodIPv6, params));
383
- inst.cidrv4 = (params) => inst.check(core._cidrv4(ZodCIDRv4, params));
384
- inst.cidrv6 = (params) => inst.check(core._cidrv6(ZodCIDRv6, params));
385
- inst.e164 = (params) => inst.check(core._e164(ZodE164, params));
386
-
387
- // iso
388
- inst.datetime = (params) => inst.check(iso.datetime(params as any));
389
- inst.date = (params) => inst.check(iso.date(params as any));
390
- inst.time = (params) => inst.check(iso.time(params as any));
391
- inst.duration = (params) => inst.check(iso.duration(params as any));
392
- });
393
-
394
- export function string(params?: string | core.$ZodStringParams): ZodString;
395
- export function string<T extends string>(params?: string | core.$ZodStringParams): core.$ZodType<T, T>;
396
- export function string(params?: string | core.$ZodStringParams): ZodString {
397
- return core._string(ZodString, params) as any;
398
- }
399
-
400
- // ZodStringFormat
401
- export interface ZodStringFormat<Format extends string = string>
402
- extends _ZodString<core.$ZodStringFormatInternals<Format>> {}
403
- export const ZodStringFormat: core.$constructor<ZodStringFormat> = /*@__PURE__*/ core.$constructor(
404
- "ZodStringFormat",
405
- (inst, def) => {
406
- core.$ZodStringFormat.init(inst, def);
407
- _ZodString.init(inst, def);
408
- }
409
- );
410
-
411
- // ZodEmail
412
- export interface ZodEmail extends ZodStringFormat<"email"> {
413
- _zod: core.$ZodEmailInternals;
414
- }
415
- export const ZodEmail: core.$constructor<ZodEmail> = /*@__PURE__*/ core.$constructor("ZodEmail", (inst, def) => {
416
- // ZodStringFormat.init(inst, def);
417
- core.$ZodEmail.init(inst, def);
418
- ZodStringFormat.init(inst, def);
419
- });
420
-
421
- export function email(params?: string | core.$ZodEmailParams): ZodEmail {
422
- return core._email(ZodEmail, params);
423
- }
424
-
425
- // ZodGUID
426
- export interface ZodGUID extends ZodStringFormat<"guid"> {
427
- _zod: core.$ZodGUIDInternals;
428
- }
429
- export const ZodGUID: core.$constructor<ZodGUID> = /*@__PURE__*/ core.$constructor("ZodGUID", (inst, def) => {
430
- // ZodStringFormat.init(inst, def);
431
- core.$ZodGUID.init(inst, def);
432
- ZodStringFormat.init(inst, def);
433
- });
434
-
435
- export function guid(params?: string | core.$ZodGUIDParams): ZodGUID {
436
- return core._guid(ZodGUID, params);
437
- }
438
-
439
- // ZodUUID
440
- export interface ZodUUID extends ZodStringFormat<"uuid"> {
441
- _zod: core.$ZodUUIDInternals;
442
- }
443
- export const ZodUUID: core.$constructor<ZodUUID> = /*@__PURE__*/ core.$constructor("ZodUUID", (inst, def) => {
444
- // ZodStringFormat.init(inst, def);
445
- core.$ZodUUID.init(inst, def);
446
- ZodStringFormat.init(inst, def);
447
- });
448
-
449
- export function uuid(params?: string | core.$ZodUUIDParams): ZodUUID {
450
- return core._uuid(ZodUUID, params);
451
- }
452
-
453
- export function uuidv4(params?: string | core.$ZodUUIDv4Params): ZodUUID {
454
- return core._uuidv4(ZodUUID, params);
455
- }
456
-
457
- // ZodUUIDv6
458
-
459
- export function uuidv6(params?: string | core.$ZodUUIDv6Params): ZodUUID {
460
- return core._uuidv6(ZodUUID, params);
461
- }
462
-
463
- // ZodUUIDv7
464
-
465
- export function uuidv7(params?: string | core.$ZodUUIDv7Params): ZodUUID {
466
- return core._uuidv7(ZodUUID, params);
467
- }
468
-
469
- // ZodURL
470
- export interface ZodURL extends ZodStringFormat<"url"> {
471
- _zod: core.$ZodURLInternals;
472
- }
473
- export const ZodURL: core.$constructor<ZodURL> = /*@__PURE__*/ core.$constructor("ZodURL", (inst, def) => {
474
- // ZodStringFormat.init(inst, def);
475
- core.$ZodURL.init(inst, def);
476
- ZodStringFormat.init(inst, def);
477
- });
478
-
479
- export function url(params?: string | core.$ZodURLParams): ZodURL {
480
- return core._url(ZodURL, params);
481
- }
482
-
483
- export function httpUrl(params?: string | Omit<core.$ZodURLParams, "protocol" | "hostname">): ZodURL {
484
- return core._url(ZodURL, {
485
- protocol: /^https?$/,
486
- hostname: core.regexes.domain,
487
- ...util.normalizeParams(params),
488
- });
489
- }
490
-
491
- // ZodEmoji
492
- export interface ZodEmoji extends ZodStringFormat<"emoji"> {
493
- _zod: core.$ZodEmojiInternals;
494
- }
495
- export const ZodEmoji: core.$constructor<ZodEmoji> = /*@__PURE__*/ core.$constructor("ZodEmoji", (inst, def) => {
496
- // ZodStringFormat.init(inst, def);
497
- core.$ZodEmoji.init(inst, def);
498
- ZodStringFormat.init(inst, def);
499
- });
500
-
501
- export function emoji(params?: string | core.$ZodEmojiParams): ZodEmoji {
502
- return core._emoji(ZodEmoji, params);
503
- }
504
-
505
- // ZodNanoID
506
- export interface ZodNanoID extends ZodStringFormat<"nanoid"> {
507
- _zod: core.$ZodNanoIDInternals;
508
- }
509
- export const ZodNanoID: core.$constructor<ZodNanoID> = /*@__PURE__*/ core.$constructor("ZodNanoID", (inst, def) => {
510
- // ZodStringFormat.init(inst, def);
511
- core.$ZodNanoID.init(inst, def);
512
- ZodStringFormat.init(inst, def);
513
- });
514
-
515
- export function nanoid(params?: string | core.$ZodNanoIDParams): ZodNanoID {
516
- return core._nanoid(ZodNanoID, params);
517
- }
518
-
519
- // ZodCUID
520
- export interface ZodCUID extends ZodStringFormat<"cuid"> {
521
- _zod: core.$ZodCUIDInternals;
522
- }
523
- export const ZodCUID: core.$constructor<ZodCUID> = /*@__PURE__*/ core.$constructor("ZodCUID", (inst, def) => {
524
- // ZodStringFormat.init(inst, def);
525
- core.$ZodCUID.init(inst, def);
526
- ZodStringFormat.init(inst, def);
527
- });
528
-
529
- export function cuid(params?: string | core.$ZodCUIDParams): ZodCUID {
530
- return core._cuid(ZodCUID, params);
531
- }
532
-
533
- // ZodCUID2
534
- export interface ZodCUID2 extends ZodStringFormat<"cuid2"> {
535
- _zod: core.$ZodCUID2Internals;
536
- }
537
- export const ZodCUID2: core.$constructor<ZodCUID2> = /*@__PURE__*/ core.$constructor("ZodCUID2", (inst, def) => {
538
- // ZodStringFormat.init(inst, def);
539
- core.$ZodCUID2.init(inst, def);
540
- ZodStringFormat.init(inst, def);
541
- });
542
-
543
- export function cuid2(params?: string | core.$ZodCUID2Params): ZodCUID2 {
544
- return core._cuid2(ZodCUID2, params);
545
- }
546
-
547
- // ZodULID
548
- export interface ZodULID extends ZodStringFormat<"ulid"> {
549
- _zod: core.$ZodULIDInternals;
550
- }
551
- export const ZodULID: core.$constructor<ZodULID> = /*@__PURE__*/ core.$constructor("ZodULID", (inst, def) => {
552
- // ZodStringFormat.init(inst, def);
553
- core.$ZodULID.init(inst, def);
554
- ZodStringFormat.init(inst, def);
555
- });
556
-
557
- export function ulid(params?: string | core.$ZodULIDParams): ZodULID {
558
- return core._ulid(ZodULID, params);
559
- }
560
-
561
- // ZodXID
562
- export interface ZodXID extends ZodStringFormat<"xid"> {
563
- _zod: core.$ZodXIDInternals;
564
- }
565
- export const ZodXID: core.$constructor<ZodXID> = /*@__PURE__*/ core.$constructor("ZodXID", (inst, def) => {
566
- // ZodStringFormat.init(inst, def);
567
- core.$ZodXID.init(inst, def);
568
- ZodStringFormat.init(inst, def);
569
- });
570
-
571
- export function xid(params?: string | core.$ZodXIDParams): ZodXID {
572
- return core._xid(ZodXID, params);
573
- }
574
-
575
- // ZodKSUID
576
- export interface ZodKSUID extends ZodStringFormat<"ksuid"> {
577
- _zod: core.$ZodKSUIDInternals;
578
- }
579
- export const ZodKSUID: core.$constructor<ZodKSUID> = /*@__PURE__*/ core.$constructor("ZodKSUID", (inst, def) => {
580
- // ZodStringFormat.init(inst, def);
581
- core.$ZodKSUID.init(inst, def);
582
- ZodStringFormat.init(inst, def);
583
- });
584
-
585
- export function ksuid(params?: string | core.$ZodKSUIDParams): ZodKSUID {
586
- return core._ksuid(ZodKSUID, params);
587
- }
588
-
589
- // ZodIP
590
- // export interface ZodIP extends ZodStringFormat<"ip"> {
591
- // _zod: core.$ZodIPInternals;
592
- // }
593
- // export const ZodIP: core.$constructor<ZodIP> = /*@__PURE__*/ core.$constructor("ZodIP", (inst, def) => {
594
- // // ZodStringFormat.init(inst, def);
595
- // core.$ZodIP.init(inst, def);
596
- // ZodStringFormat.init(inst, def);
597
- // });
598
-
599
- // export function ip(params?: string | core.$ZodIPParams): ZodIP {
600
- // return core._ip(ZodIP, params);
601
- // }
602
-
603
- // ZodIPv4
604
- export interface ZodIPv4 extends ZodStringFormat<"ipv4"> {
605
- _zod: core.$ZodIPv4Internals;
606
- }
607
- export const ZodIPv4: core.$constructor<ZodIPv4> = /*@__PURE__*/ core.$constructor("ZodIPv4", (inst, def) => {
608
- // ZodStringFormat.init(inst, def);
609
- core.$ZodIPv4.init(inst, def);
610
- ZodStringFormat.init(inst, def);
611
- });
612
-
613
- export function ipv4(params?: string | core.$ZodIPv4Params): ZodIPv4 {
614
- return core._ipv4(ZodIPv4, params);
615
- }
616
-
617
- // ZodIPv6
618
- export interface ZodIPv6 extends ZodStringFormat<"ipv6"> {
619
- _zod: core.$ZodIPv6Internals;
620
- }
621
- export const ZodIPv6: core.$constructor<ZodIPv6> = /*@__PURE__*/ core.$constructor("ZodIPv6", (inst, def) => {
622
- // ZodStringFormat.init(inst, def);
623
- core.$ZodIPv6.init(inst, def);
624
- ZodStringFormat.init(inst, def);
625
- });
626
- export function ipv6(params?: string | core.$ZodIPv6Params): ZodIPv6 {
627
- return core._ipv6(ZodIPv6, params);
628
- }
629
-
630
- // ZodCIDRv4
631
- export interface ZodCIDRv4 extends ZodStringFormat<"cidrv4"> {
632
- _zod: core.$ZodCIDRv4Internals;
633
- }
634
- export const ZodCIDRv4: core.$constructor<ZodCIDRv4> = /*@__PURE__*/ core.$constructor("ZodCIDRv4", (inst, def) => {
635
- core.$ZodCIDRv4.init(inst, def);
636
- ZodStringFormat.init(inst, def);
637
- });
638
-
639
- export function cidrv4(params?: string | core.$ZodCIDRv4Params): ZodCIDRv4 {
640
- return core._cidrv4(ZodCIDRv4, params);
641
- }
642
-
643
- // ZodCIDRv6
644
- export interface ZodCIDRv6 extends ZodStringFormat<"cidrv6"> {
645
- _zod: core.$ZodCIDRv6Internals;
646
- }
647
- export const ZodCIDRv6: core.$constructor<ZodCIDRv6> = /*@__PURE__*/ core.$constructor("ZodCIDRv6", (inst, def) => {
648
- core.$ZodCIDRv6.init(inst, def);
649
- ZodStringFormat.init(inst, def);
650
- });
651
-
652
- export function cidrv6(params?: string | core.$ZodCIDRv6Params): ZodCIDRv6 {
653
- return core._cidrv6(ZodCIDRv6, params);
654
- }
655
-
656
- // ZodBase64
657
- export interface ZodBase64 extends ZodStringFormat<"base64"> {
658
- _zod: core.$ZodBase64Internals;
659
- }
660
- export const ZodBase64: core.$constructor<ZodBase64> = /*@__PURE__*/ core.$constructor("ZodBase64", (inst, def) => {
661
- // ZodStringFormat.init(inst, def);
662
- core.$ZodBase64.init(inst, def);
663
- ZodStringFormat.init(inst, def);
664
- });
665
- export function base64(params?: string | core.$ZodBase64Params): ZodBase64 {
666
- return core._base64(ZodBase64, params);
667
- }
668
-
669
- // ZodBase64URL
670
- export interface ZodBase64URL extends ZodStringFormat<"base64url"> {
671
- _zod: core.$ZodBase64URLInternals;
672
- }
673
- export const ZodBase64URL: core.$constructor<ZodBase64URL> = /*@__PURE__*/ core.$constructor(
674
- "ZodBase64URL",
675
- (inst, def) => {
676
- // ZodStringFormat.init(inst, def);
677
- core.$ZodBase64URL.init(inst, def);
678
- ZodStringFormat.init(inst, def);
679
- }
680
- );
681
- export function base64url(params?: string | core.$ZodBase64URLParams): ZodBase64URL {
682
- return core._base64url(ZodBase64URL, params);
683
- }
684
-
685
- // ZodE164
686
- export interface ZodE164 extends ZodStringFormat<"e164"> {
687
- _zod: core.$ZodE164Internals;
688
- }
689
- export const ZodE164: core.$constructor<ZodE164> = /*@__PURE__*/ core.$constructor("ZodE164", (inst, def) => {
690
- // ZodStringFormat.init(inst, def);
691
- core.$ZodE164.init(inst, def);
692
- ZodStringFormat.init(inst, def);
693
- });
694
-
695
- export function e164(params?: string | core.$ZodE164Params): ZodE164 {
696
- return core._e164(ZodE164, params);
697
- }
698
-
699
- // ZodJWT
700
- export interface ZodJWT extends ZodStringFormat<"jwt"> {
701
- _zod: core.$ZodJWTInternals;
702
- }
703
- export const ZodJWT: core.$constructor<ZodJWT> = /*@__PURE__*/ core.$constructor("ZodJWT", (inst, def) => {
704
- // ZodStringFormat.init(inst, def);
705
- core.$ZodJWT.init(inst, def);
706
- ZodStringFormat.init(inst, def);
707
- });
708
-
709
- export function jwt(params?: string | core.$ZodJWTParams): ZodJWT {
710
- return core._jwt(ZodJWT, params);
711
- }
712
-
713
- // ZodCustomStringFormat
714
- export interface ZodCustomStringFormat<Format extends string = string>
715
- extends ZodStringFormat<Format>,
716
- core.$ZodCustomStringFormat<Format> {
717
- _zod: core.$ZodCustomStringFormatInternals<Format>;
718
- }
719
- export const ZodCustomStringFormat: core.$constructor<ZodCustomStringFormat> = /*@__PURE__*/ core.$constructor(
720
- "ZodCustomStringFormat",
721
- (inst, def) => {
722
- // ZodStringFormat.init(inst, def);
723
- core.$ZodCustomStringFormat.init(inst, def);
724
- ZodStringFormat.init(inst, def);
725
- }
726
- );
727
- export function stringFormat<Format extends string>(
728
- format: Format,
729
- fnOrRegex: ((arg: string) => util.MaybeAsync<unknown>) | RegExp,
730
- _params: string | core.$ZodStringFormatParams = {}
731
- ): ZodCustomStringFormat<Format> {
732
- return core._stringFormat(ZodCustomStringFormat, format, fnOrRegex, _params) as any;
733
- }
734
-
735
- export function hostname(_params?: string | core.$ZodStringFormatParams): ZodCustomStringFormat<"hostname"> {
736
- return core._stringFormat(ZodCustomStringFormat, "hostname", core.regexes.hostname, _params) as any;
737
- }
738
-
739
- export function hex(_params?: string | core.$ZodStringFormatParams): ZodCustomStringFormat<"hex"> {
740
- return core._stringFormat(ZodCustomStringFormat, "hex", core.regexes.hex, _params) as any;
741
- }
742
-
743
- export function hash<Alg extends util.HashAlgorithm, Enc extends util.HashEncoding = "hex">(
744
- alg: Alg,
745
- params?: {
746
- enc?: Enc;
747
- } & core.$ZodStringFormatParams
748
- ): ZodCustomStringFormat<`${Alg}_${Enc}`> {
749
- const enc = params?.enc ?? "hex";
750
- const format = `${alg}_${enc}` as const;
751
- const regex = core.regexes[format as keyof typeof core.regexes] as RegExp;
752
- if (!regex) throw new Error(`Unrecognized hash format: ${format}`);
753
- return core._stringFormat(ZodCustomStringFormat, format, regex, params) as any;
754
- }
755
-
756
- // ZodNumber
757
- export interface _ZodNumber<Internals extends core.$ZodNumberInternals = core.$ZodNumberInternals>
758
- extends _ZodType<Internals> {
759
- gt(value: number, params?: string | core.$ZodCheckGreaterThanParams): this;
760
- /** Identical to .min() */
761
- gte(value: number, params?: string | core.$ZodCheckGreaterThanParams): this;
762
- min(value: number, params?: string | core.$ZodCheckGreaterThanParams): this;
763
- lt(value: number, params?: string | core.$ZodCheckLessThanParams): this;
764
- /** Identical to .max() */
765
- lte(value: number, params?: string | core.$ZodCheckLessThanParams): this;
766
- max(value: number, params?: string | core.$ZodCheckLessThanParams): this;
767
- /** Consider `z.int()` instead. This API is considered *legacy*; it will never be removed but a better alternative exists. */
768
- int(params?: string | core.$ZodCheckNumberFormatParams): this;
769
- /** @deprecated This is now identical to `.int()`. Only numbers in the safe integer range are accepted. */
770
- safe(params?: string | core.$ZodCheckNumberFormatParams): this;
771
- positive(params?: string | core.$ZodCheckGreaterThanParams): this;
772
- nonnegative(params?: string | core.$ZodCheckGreaterThanParams): this;
773
- negative(params?: string | core.$ZodCheckLessThanParams): this;
774
- nonpositive(params?: string | core.$ZodCheckLessThanParams): this;
775
- multipleOf(value: number, params?: string | core.$ZodCheckMultipleOfParams): this;
776
- /** @deprecated Use `.multipleOf()` instead. */
777
- step(value: number, params?: string | core.$ZodCheckMultipleOfParams): this;
778
-
779
- /** @deprecated In v4 and later, z.number() does not allow infinite values by default. This is a no-op. */
780
- finite(params?: unknown): this;
781
-
782
- minValue: number | null;
783
- maxValue: number | null;
784
- /** @deprecated Check the `format` property instead. */
785
- isInt: boolean;
786
- /** @deprecated Number schemas no longer accept infinite values, so this always returns `true`. */
787
- isFinite: boolean;
788
- format: string | null;
789
- }
790
-
791
- export interface ZodNumber extends _ZodNumber<core.$ZodNumberInternals<number>> {}
792
-
793
- export const ZodNumber: core.$constructor<ZodNumber> = /*@__PURE__*/ core.$constructor("ZodNumber", (inst, def) => {
794
- core.$ZodNumber.init(inst, def);
795
- ZodType.init(inst, def);
796
-
797
- inst.gt = (value, params) => inst.check(checks.gt(value, params));
798
- inst.gte = (value, params) => inst.check(checks.gte(value, params));
799
- inst.min = (value, params) => inst.check(checks.gte(value, params));
800
- inst.lt = (value, params) => inst.check(checks.lt(value, params));
801
- inst.lte = (value, params) => inst.check(checks.lte(value, params));
802
- inst.max = (value, params) => inst.check(checks.lte(value, params));
803
- inst.int = (params) => inst.check(int(params));
804
- inst.safe = (params) => inst.check(int(params));
805
- inst.positive = (params) => inst.check(checks.gt(0, params));
806
- inst.nonnegative = (params) => inst.check(checks.gte(0, params));
807
- inst.negative = (params) => inst.check(checks.lt(0, params));
808
- inst.nonpositive = (params) => inst.check(checks.lte(0, params));
809
- inst.multipleOf = (value, params) => inst.check(checks.multipleOf(value, params));
810
- inst.step = (value, params) => inst.check(checks.multipleOf(value, params));
811
-
812
- // inst.finite = (params) => inst.check(core.finite(params));
813
- inst.finite = () => inst;
814
-
815
- const bag = inst._zod.bag;
816
- inst.minValue =
817
- Math.max(bag.minimum ?? Number.NEGATIVE_INFINITY, bag.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null;
818
- inst.maxValue =
819
- Math.min(bag.maximum ?? Number.POSITIVE_INFINITY, bag.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null;
820
- inst.isInt = (bag.format ?? "").includes("int") || Number.isSafeInteger(bag.multipleOf ?? 0.5);
821
- inst.isFinite = true;
822
- inst.format = bag.format ?? null;
823
- });
824
-
825
- export function number(params?: string | core.$ZodNumberParams): ZodNumber {
826
- return core._number(ZodNumber, params) as any;
827
- }
828
-
829
- // ZodNumberFormat
830
- export interface ZodNumberFormat extends ZodNumber {
831
- _zod: core.$ZodNumberFormatInternals;
832
- }
833
- export const ZodNumberFormat: core.$constructor<ZodNumberFormat> = /*@__PURE__*/ core.$constructor(
834
- "ZodNumberFormat",
835
- (inst, def) => {
836
- core.$ZodNumberFormat.init(inst, def);
837
- ZodNumber.init(inst, def);
838
- }
839
- );
840
-
841
- // int
842
- export interface ZodInt extends ZodNumberFormat {}
843
- export function int(params?: string | core.$ZodCheckNumberFormatParams): ZodInt {
844
- return core._int(ZodNumberFormat, params);
845
- }
846
-
847
- // float32
848
- export interface ZodFloat32 extends ZodNumberFormat {}
849
- export function float32(params?: string | core.$ZodCheckNumberFormatParams): ZodFloat32 {
850
- return core._float32(ZodNumberFormat, params);
851
- }
852
-
853
- // float64
854
- export interface ZodFloat64 extends ZodNumberFormat {}
855
- export function float64(params?: string | core.$ZodCheckNumberFormatParams): ZodFloat64 {
856
- return core._float64(ZodNumberFormat, params);
857
- }
858
-
859
- // int32
860
- export interface ZodInt32 extends ZodNumberFormat {}
861
- export function int32(params?: string | core.$ZodCheckNumberFormatParams): ZodInt32 {
862
- return core._int32(ZodNumberFormat, params);
863
- }
864
-
865
- // uint32
866
- export interface ZodUInt32 extends ZodNumberFormat {}
867
- export function uint32(params?: string | core.$ZodCheckNumberFormatParams): ZodUInt32 {
868
- return core._uint32(ZodNumberFormat, params);
869
- }
870
-
871
- // boolean
872
- export interface _ZodBoolean<T extends core.$ZodBooleanInternals = core.$ZodBooleanInternals> extends _ZodType<T> {}
873
- export interface ZodBoolean extends _ZodBoolean<core.$ZodBooleanInternals<boolean>> {}
874
- export const ZodBoolean: core.$constructor<ZodBoolean> = /*@__PURE__*/ core.$constructor("ZodBoolean", (inst, def) => {
875
- core.$ZodBoolean.init(inst, def);
876
- ZodType.init(inst, def);
877
- });
878
-
879
- export function boolean(params?: string | core.$ZodBooleanParams): ZodBoolean {
880
- return core._boolean(ZodBoolean, params) as any;
881
- }
882
-
883
- // bigint
884
- export interface _ZodBigInt<T extends core.$ZodBigIntInternals = core.$ZodBigIntInternals> extends _ZodType<T> {
885
- gte(value: bigint, params?: string | core.$ZodCheckGreaterThanParams): this;
886
- /** Alias of `.gte()` */
887
- min(value: bigint, params?: string | core.$ZodCheckGreaterThanParams): this;
888
- gt(value: bigint, params?: string | core.$ZodCheckGreaterThanParams): this;
889
- /** Alias of `.lte()` */
890
- lte(value: bigint, params?: string | core.$ZodCheckLessThanParams): this;
891
- max(value: bigint, params?: string | core.$ZodCheckLessThanParams): this;
892
- lt(value: bigint, params?: string | core.$ZodCheckLessThanParams): this;
893
- positive(params?: string | core.$ZodCheckGreaterThanParams): this;
894
- negative(params?: string | core.$ZodCheckLessThanParams): this;
895
- nonpositive(params?: string | core.$ZodCheckLessThanParams): this;
896
- nonnegative(params?: string | core.$ZodCheckGreaterThanParams): this;
897
- multipleOf(value: bigint, params?: string | core.$ZodCheckMultipleOfParams): this;
898
-
899
- minValue: bigint | null;
900
- maxValue: bigint | null;
901
- format: string | null;
902
- }
903
-
904
- export interface ZodBigInt extends _ZodBigInt<core.$ZodBigIntInternals<bigint>> {}
905
- export const ZodBigInt: core.$constructor<ZodBigInt> = /*@__PURE__*/ core.$constructor("ZodBigInt", (inst, def) => {
906
- core.$ZodBigInt.init(inst, def);
907
- ZodType.init(inst, def);
908
-
909
- inst.gte = (value, params) => inst.check(checks.gte(value, params));
910
- inst.min = (value, params) => inst.check(checks.gte(value, params));
911
- inst.gt = (value, params) => inst.check(checks.gt(value, params));
912
- inst.gte = (value, params) => inst.check(checks.gte(value, params));
913
- inst.min = (value, params) => inst.check(checks.gte(value, params));
914
- inst.lt = (value, params) => inst.check(checks.lt(value, params));
915
- inst.lte = (value, params) => inst.check(checks.lte(value, params));
916
- inst.max = (value, params) => inst.check(checks.lte(value, params));
917
- inst.positive = (params) => inst.check(checks.gt(BigInt(0), params));
918
- inst.negative = (params) => inst.check(checks.lt(BigInt(0), params));
919
- inst.nonpositive = (params) => inst.check(checks.lte(BigInt(0), params));
920
- inst.nonnegative = (params) => inst.check(checks.gte(BigInt(0), params));
921
- inst.multipleOf = (value, params) => inst.check(checks.multipleOf(value, params));
922
-
923
- const bag = inst._zod.bag;
924
- inst.minValue = bag.minimum ?? null;
925
- inst.maxValue = bag.maximum ?? null;
926
- inst.format = bag.format ?? null;
927
- });
928
-
929
- export function bigint(params?: string | core.$ZodBigIntParams): ZodBigInt {
930
- return core._bigint(ZodBigInt, params) as any;
931
- }
932
- // bigint formats
933
-
934
- // ZodBigIntFormat
935
- export interface ZodBigIntFormat extends ZodBigInt {
936
- _zod: core.$ZodBigIntFormatInternals;
937
- }
938
- export const ZodBigIntFormat: core.$constructor<ZodBigIntFormat> = /*@__PURE__*/ core.$constructor(
939
- "ZodBigIntFormat",
940
- (inst, def) => {
941
- core.$ZodBigIntFormat.init(inst, def);
942
- ZodBigInt.init(inst, def);
943
- }
944
- );
945
-
946
- // int64
947
- export function int64(params?: string | core.$ZodBigIntFormatParams): ZodBigIntFormat {
948
- return core._int64(ZodBigIntFormat, params);
949
- }
950
-
951
- // uint64
952
- export function uint64(params?: string | core.$ZodBigIntFormatParams): ZodBigIntFormat {
953
- return core._uint64(ZodBigIntFormat, params);
954
- }
955
-
956
- // symbol
957
- export interface ZodSymbol extends _ZodType<core.$ZodSymbolInternals> {}
958
- export const ZodSymbol: core.$constructor<ZodSymbol> = /*@__PURE__*/ core.$constructor("ZodSymbol", (inst, def) => {
959
- core.$ZodSymbol.init(inst, def);
960
- ZodType.init(inst, def);
961
- });
962
-
963
- export function symbol(params?: string | core.$ZodSymbolParams): ZodSymbol {
964
- return core._symbol(ZodSymbol, params);
965
- }
966
-
967
- // ZodUndefined
968
- export interface ZodUndefined extends _ZodType<core.$ZodUndefinedInternals> {}
969
- export const ZodUndefined: core.$constructor<ZodUndefined> = /*@__PURE__*/ core.$constructor(
970
- "ZodUndefined",
971
- (inst, def) => {
972
- core.$ZodUndefined.init(inst, def);
973
- ZodType.init(inst, def);
974
- }
975
- );
976
-
977
- function _undefined(params?: string | core.$ZodUndefinedParams): ZodUndefined {
978
- return core._undefined(ZodUndefined, params);
979
- }
980
- export { _undefined as undefined };
981
-
982
- // ZodNull
983
- export interface ZodNull extends _ZodType<core.$ZodNullInternals> {}
984
- export const ZodNull: core.$constructor<ZodNull> = /*@__PURE__*/ core.$constructor("ZodNull", (inst, def) => {
985
- core.$ZodNull.init(inst, def);
986
- ZodType.init(inst, def);
987
- });
988
-
989
- function _null(params?: string | core.$ZodNullParams): ZodNull {
990
- return core._null(ZodNull, params);
991
- }
992
- export { _null as null };
993
-
994
- // ZodAny
995
- export interface ZodAny extends _ZodType<core.$ZodAnyInternals> {}
996
- export const ZodAny: core.$constructor<ZodAny> = /*@__PURE__*/ core.$constructor("ZodAny", (inst, def) => {
997
- core.$ZodAny.init(inst, def);
998
- ZodType.init(inst, def);
999
- });
1000
-
1001
- export function any(): ZodAny {
1002
- return core._any(ZodAny);
1003
- }
1004
-
1005
- // ZodUnknown
1006
- export interface ZodUnknown extends _ZodType<core.$ZodUnknownInternals> {}
1007
- export const ZodUnknown: core.$constructor<ZodUnknown> = /*@__PURE__*/ core.$constructor("ZodUnknown", (inst, def) => {
1008
- core.$ZodUnknown.init(inst, def);
1009
- ZodType.init(inst, def);
1010
- });
1011
-
1012
- export function unknown(): ZodUnknown {
1013
- return core._unknown(ZodUnknown);
1014
- }
1015
-
1016
- // ZodNever
1017
- export interface ZodNever extends _ZodType<core.$ZodNeverInternals> {}
1018
- export const ZodNever: core.$constructor<ZodNever> = /*@__PURE__*/ core.$constructor("ZodNever", (inst, def) => {
1019
- core.$ZodNever.init(inst, def);
1020
- ZodType.init(inst, def);
1021
- });
1022
-
1023
- export function never(params?: string | core.$ZodNeverParams): ZodNever {
1024
- return core._never(ZodNever, params);
1025
- }
1026
-
1027
- // ZodVoid
1028
- export interface ZodVoid extends _ZodType<core.$ZodVoidInternals> {}
1029
- export const ZodVoid: core.$constructor<ZodVoid> = /*@__PURE__*/ core.$constructor("ZodVoid", (inst, def) => {
1030
- core.$ZodVoid.init(inst, def);
1031
- ZodType.init(inst, def);
1032
- });
1033
-
1034
- function _void(params?: string | core.$ZodVoidParams): ZodVoid {
1035
- return core._void(ZodVoid, params);
1036
- }
1037
- export { _void as void };
1038
-
1039
- // ZodDate
1040
- export interface _ZodDate<T extends core.$ZodDateInternals = core.$ZodDateInternals> extends _ZodType<T> {
1041
- min(value: number | Date, params?: string | core.$ZodCheckGreaterThanParams): this;
1042
- max(value: number | Date, params?: string | core.$ZodCheckLessThanParams): this;
1043
-
1044
- /** @deprecated Not recommended. */
1045
- minDate: Date | null;
1046
- /** @deprecated Not recommended. */
1047
- maxDate: Date | null;
1048
- }
1049
-
1050
- export interface ZodDate extends _ZodDate<core.$ZodDateInternals<Date>> {}
1051
- export const ZodDate: core.$constructor<ZodDate> = /*@__PURE__*/ core.$constructor("ZodDate", (inst, def) => {
1052
- core.$ZodDate.init(inst, def);
1053
- ZodType.init(inst, def);
1054
-
1055
- inst.min = (value, params) => inst.check(checks.gte(value, params));
1056
- inst.max = (value, params) => inst.check(checks.lte(value, params));
1057
-
1058
- const c = inst._zod.bag;
1059
- inst.minDate = c.minimum ? new Date(c.minimum) : null;
1060
- inst.maxDate = c.maximum ? new Date(c.maximum) : null;
1061
- });
1062
-
1063
- export function date(params?: string | core.$ZodDateParams): ZodDate {
1064
- return core._date(ZodDate, params);
1065
- }
1066
-
1067
- // ZodArray
1068
- export interface ZodArray<T extends core.SomeType = core.$ZodType>
1069
- extends _ZodType<core.$ZodArrayInternals<T>>,
1070
- core.$ZodArray<T> {
1071
- element: T;
1072
- min(minLength: number, params?: string | core.$ZodCheckMinLengthParams): this;
1073
- nonempty(params?: string | core.$ZodCheckMinLengthParams): this;
1074
- max(maxLength: number, params?: string | core.$ZodCheckMaxLengthParams): this;
1075
- length(len: number, params?: string | core.$ZodCheckLengthEqualsParams): this;
1076
-
1077
- unwrap(): T;
1078
- }
1079
- export const ZodArray: core.$constructor<ZodArray> = /*@__PURE__*/ core.$constructor("ZodArray", (inst, def) => {
1080
- core.$ZodArray.init(inst, def);
1081
- ZodType.init(inst, def);
1082
-
1083
- inst.element = def.element as any;
1084
- inst.min = (minLength, params) => inst.check(checks.minLength(minLength, params));
1085
- inst.nonempty = (params) => inst.check(checks.minLength(1, params));
1086
- inst.max = (maxLength, params) => inst.check(checks.maxLength(maxLength, params));
1087
- inst.length = (len, params) => inst.check(checks.length(len, params));
1088
-
1089
- inst.unwrap = () => inst.element;
1090
- });
1091
-
1092
- export function array<T extends core.SomeType>(element: T, params?: string | core.$ZodArrayParams): ZodArray<T> {
1093
- return core._array(ZodArray, element as any, params) as any;
1094
- }
1095
-
1096
- // .keyof
1097
- export function keyof<T extends ZodObject>(schema: T): ZodEnum<util.KeysEnum<T["_zod"]["output"]>> {
1098
- const shape = schema._zod.def.shape;
1099
- return _enum(Object.keys(shape)) as any;
1100
- }
1101
-
1102
- // ZodObject
1103
-
1104
- export type SafeExtendShape<Base extends core.$ZodShape, Ext extends core.$ZodLooseShape> = {
1105
- [K in keyof Ext]: K extends keyof Base
1106
- ? core.output<Ext[K]> extends core.output<Base[K]>
1107
- ? core.input<Ext[K]> extends core.input<Base[K]>
1108
- ? Ext[K]
1109
- : never
1110
- : never
1111
- : Ext[K];
1112
- };
1113
-
1114
- export interface ZodObject<
1115
- /** @ts-ignore Cast variance */
1116
- out Shape extends core.$ZodShape = core.$ZodLooseShape,
1117
- out Config extends core.$ZodObjectConfig = core.$strip,
1118
- > extends _ZodType<core.$ZodObjectInternals<Shape, Config>>,
1119
- core.$ZodObject<Shape, Config> {
1120
- shape: Shape;
1121
-
1122
- keyof(): ZodEnum<util.ToEnum<keyof Shape & string>>;
1123
- /** Define a schema to validate all unrecognized keys. This overrides the existing strict/loose behavior. */
1124
- catchall<T extends core.SomeType>(schema: T): ZodObject<Shape, core.$catchall<T>>;
1125
-
1126
- /** @deprecated Use `z.looseObject()` or `.loose()` instead. */
1127
- passthrough(): ZodObject<Shape, core.$loose>;
1128
- /** Consider `z.looseObject(A.shape)` instead */
1129
- loose(): ZodObject<Shape, core.$loose>;
1130
-
1131
- /** Consider `z.strictObject(A.shape)` instead */
1132
- strict(): ZodObject<Shape, core.$strict>;
1133
-
1134
- /** This is the default behavior. This method call is likely unnecessary. */
1135
- strip(): ZodObject<Shape, core.$strip>;
1136
-
1137
- extend<U extends core.$ZodLooseShape>(shape: U): ZodObject<util.Extend<Shape, U>, Config>;
1138
-
1139
- safeExtend<U extends core.$ZodLooseShape>(
1140
- shape: SafeExtendShape<Shape, U> & Partial<Record<keyof Shape, core.SomeType>>
1141
- ): ZodObject<util.Extend<Shape, U>, Config>;
1142
-
1143
- /**
1144
- * @deprecated Use [`A.extend(B.shape)`](https://zod.dev/api?id=extend) instead.
1145
- */
1146
- merge<U extends ZodObject>(other: U): ZodObject<util.Extend<Shape, U["shape"]>, U["_zod"]["config"]>;
1147
-
1148
- pick<M extends util.Mask<keyof Shape>>(
1149
- mask: M
1150
- ): ZodObject<util.Flatten<Pick<Shape, Extract<keyof Shape, keyof M>>>, Config>;
1151
-
1152
- omit<M extends util.Mask<keyof Shape>>(
1153
- mask: M
1154
- ): ZodObject<util.Flatten<Omit<Shape, Extract<keyof Shape, keyof M>>>, Config>;
1155
-
1156
- partial(): ZodObject<
1157
- {
1158
- [k in keyof Shape]: ZodOptional<Shape[k]>;
1159
- },
1160
- Config
1161
- >;
1162
- partial<M extends util.Mask<keyof Shape>>(
1163
- mask: M
1164
- ): ZodObject<
1165
- {
1166
- [k in keyof Shape]: k extends keyof M
1167
- ? // Shape[k] extends OptionalInSchema
1168
- // ? Shape[k]
1169
- // :
1170
- ZodOptional<Shape[k]>
1171
- : Shape[k];
1172
- },
1173
- Config
1174
- >;
1175
-
1176
- // required
1177
- required(): ZodObject<
1178
- {
1179
- [k in keyof Shape]: ZodNonOptional<Shape[k]>;
1180
- },
1181
- Config
1182
- >;
1183
- required<M extends util.Mask<keyof Shape>>(
1184
- mask: M
1185
- ): ZodObject<
1186
- {
1187
- [k in keyof Shape]: k extends keyof M ? ZodNonOptional<Shape[k]> : Shape[k];
1188
- },
1189
- Config
1190
- >;
1191
- }
1192
-
1193
- export const ZodObject: core.$constructor<ZodObject> = /*@__PURE__*/ core.$constructor("ZodObject", (inst, def) => {
1194
- core.$ZodObjectJIT.init(inst, def);
1195
- ZodType.init(inst, def);
1196
-
1197
- util.defineLazy(inst, "shape", () => {
1198
- return def.shape;
1199
- });
1200
-
1201
- inst.keyof = () => _enum(Object.keys(inst._zod.def.shape)) as any;
1202
- inst.catchall = (catchall) => inst.clone({ ...inst._zod.def, catchall: catchall as any as core.$ZodType }) as any;
1203
- inst.passthrough = () => inst.clone({ ...inst._zod.def, catchall: unknown() });
1204
- inst.loose = () => inst.clone({ ...inst._zod.def, catchall: unknown() });
1205
- inst.strict = () => inst.clone({ ...inst._zod.def, catchall: never() });
1206
- inst.strip = () => inst.clone({ ...inst._zod.def, catchall: undefined });
1207
-
1208
- inst.extend = (incoming: any) => {
1209
- return util.extend(inst, incoming);
1210
- };
1211
- inst.safeExtend = (incoming: any) => {
1212
- return util.safeExtend(inst, incoming);
1213
- };
1214
- inst.merge = (other) => util.merge(inst, other);
1215
- inst.pick = (mask) => util.pick(inst, mask);
1216
- inst.omit = (mask) => util.omit(inst, mask);
1217
- inst.partial = (...args: any[]) => util.partial(ZodOptional, inst, args[0] as object);
1218
- inst.required = (...args: any[]) => util.required(ZodNonOptional, inst, args[0] as object);
1219
- });
1220
-
1221
- export function object<T extends core.$ZodLooseShape = Partial<Record<never, core.SomeType>>>(
1222
- shape?: T,
1223
- params?: string | core.$ZodObjectParams
1224
- ): ZodObject<util.Writeable<T>, core.$strip> {
1225
- const def: core.$ZodObjectDef = {
1226
- type: "object",
1227
- shape: shape ?? {},
1228
- ...util.normalizeParams(params),
1229
- };
1230
- return new ZodObject(def) as any;
1231
- }
1232
-
1233
- // strictObject
1234
-
1235
- export function strictObject<T extends core.$ZodLooseShape>(
1236
- shape: T,
1237
- params?: string | core.$ZodObjectParams
1238
- ): ZodObject<T, core.$strict> {
1239
- return new ZodObject({
1240
- type: "object",
1241
- shape,
1242
- catchall: never(),
1243
- ...util.normalizeParams(params),
1244
- }) as any;
1245
- }
1246
-
1247
- // looseObject
1248
-
1249
- export function looseObject<T extends core.$ZodLooseShape>(
1250
- shape: T,
1251
- params?: string | core.$ZodObjectParams
1252
- ): ZodObject<T, core.$loose> {
1253
- return new ZodObject({
1254
- type: "object",
1255
- shape,
1256
- catchall: unknown(),
1257
- ...util.normalizeParams(params),
1258
- }) as any;
1259
- }
1260
-
1261
- // ZodUnion
1262
- export interface ZodUnion<T extends readonly core.SomeType[] = readonly core.$ZodType[]>
1263
- extends _ZodType<core.$ZodUnionInternals<T>>,
1264
- core.$ZodUnion<T> {
1265
- options: T;
1266
- }
1267
- export const ZodUnion: core.$constructor<ZodUnion> = /*@__PURE__*/ core.$constructor("ZodUnion", (inst, def) => {
1268
- core.$ZodUnion.init(inst, def);
1269
- ZodType.init(inst, def);
1270
- inst.options = def.options;
1271
- });
1272
-
1273
- export function union<const T extends readonly core.SomeType[]>(
1274
- options: T,
1275
- params?: string | core.$ZodUnionParams
1276
- ): ZodUnion<T> {
1277
- return new ZodUnion({
1278
- type: "union",
1279
- options: options as any as core.$ZodType[],
1280
- ...util.normalizeParams(params),
1281
- }) as any;
1282
- }
1283
-
1284
- // ZodDiscriminatedUnion
1285
- export interface ZodDiscriminatedUnion<
1286
- Options extends readonly core.SomeType[] = readonly core.$ZodType[],
1287
- Disc extends string = string,
1288
- > extends ZodUnion<Options>,
1289
- core.$ZodDiscriminatedUnion<Options, Disc> {
1290
- _zod: core.$ZodDiscriminatedUnionInternals<Options, Disc>;
1291
- def: core.$ZodDiscriminatedUnionDef<Options, Disc>;
1292
- }
1293
- export const ZodDiscriminatedUnion: core.$constructor<ZodDiscriminatedUnion> = /*@__PURE__*/ core.$constructor(
1294
- "ZodDiscriminatedUnion",
1295
- (inst, def) => {
1296
- ZodUnion.init(inst, def);
1297
- core.$ZodDiscriminatedUnion.init(inst, def);
1298
- }
1299
- );
1300
-
1301
- export function discriminatedUnion<
1302
- Types extends readonly [core.$ZodTypeDiscriminable, ...core.$ZodTypeDiscriminable[]],
1303
- Disc extends string,
1304
- >(
1305
- discriminator: Disc,
1306
- options: Types,
1307
- params?: string | core.$ZodDiscriminatedUnionParams
1308
- ): ZodDiscriminatedUnion<Types, Disc> {
1309
- // const [options, params] = args;
1310
- return new ZodDiscriminatedUnion({
1311
- type: "union",
1312
- options,
1313
- discriminator,
1314
- ...util.normalizeParams(params),
1315
- }) as any;
1316
- }
1317
-
1318
- // ZodIntersection
1319
- export interface ZodIntersection<A extends core.SomeType = core.$ZodType, B extends core.SomeType = core.$ZodType>
1320
- extends _ZodType<core.$ZodIntersectionInternals<A, B>>,
1321
- core.$ZodIntersection<A, B> {}
1322
- export const ZodIntersection: core.$constructor<ZodIntersection> = /*@__PURE__*/ core.$constructor(
1323
- "ZodIntersection",
1324
- (inst, def) => {
1325
- core.$ZodIntersection.init(inst, def);
1326
- ZodType.init(inst, def);
1327
- }
1328
- );
1329
-
1330
- export function intersection<T extends core.SomeType, U extends core.SomeType>(
1331
- left: T,
1332
- right: U
1333
- ): ZodIntersection<T, U> {
1334
- return new ZodIntersection({
1335
- type: "intersection",
1336
- left: left as any as core.$ZodType,
1337
- right: right as any as core.$ZodType,
1338
- }) as any;
1339
- }
1340
-
1341
- // ZodTuple
1342
- export interface ZodTuple<
1343
- T extends util.TupleItems = readonly core.$ZodType[],
1344
- Rest extends core.SomeType | null = core.$ZodType | null,
1345
- > extends _ZodType<core.$ZodTupleInternals<T, Rest>>,
1346
- core.$ZodTuple<T, Rest> {
1347
- rest<Rest extends core.SomeType = core.$ZodType>(rest: Rest): ZodTuple<T, Rest>;
1348
- }
1349
- export const ZodTuple: core.$constructor<ZodTuple> = /*@__PURE__*/ core.$constructor("ZodTuple", (inst, def) => {
1350
- core.$ZodTuple.init(inst, def);
1351
- ZodType.init(inst, def);
1352
- inst.rest = (rest) =>
1353
- inst.clone({
1354
- ...inst._zod.def,
1355
- rest: rest as any as core.$ZodType,
1356
- }) as any;
1357
- });
1358
-
1359
- export function tuple<T extends readonly [core.SomeType, ...core.SomeType[]]>(
1360
- items: T,
1361
- params?: string | core.$ZodTupleParams
1362
- ): ZodTuple<T, null>;
1363
- export function tuple<T extends readonly [core.SomeType, ...core.SomeType[]], Rest extends core.SomeType>(
1364
- items: T,
1365
- rest: Rest,
1366
- params?: string | core.$ZodTupleParams
1367
- ): ZodTuple<T, Rest>;
1368
- export function tuple(items: [], params?: string | core.$ZodTupleParams): ZodTuple<[], null>;
1369
- export function tuple(
1370
- items: core.SomeType[],
1371
- _paramsOrRest?: string | core.$ZodTupleParams | core.SomeType,
1372
- _params?: string | core.$ZodTupleParams
1373
- ) {
1374
- const hasRest = _paramsOrRest instanceof core.$ZodType;
1375
- const params = hasRest ? _params : _paramsOrRest;
1376
- const rest = hasRest ? _paramsOrRest : null;
1377
- return new ZodTuple({
1378
- type: "tuple",
1379
- items: items as any as core.$ZodType[],
1380
- rest,
1381
- ...util.normalizeParams(params),
1382
- });
1383
- }
1384
-
1385
- // ZodRecord
1386
- export interface ZodRecord<
1387
- Key extends core.$ZodRecordKey = core.$ZodRecordKey,
1388
- Value extends core.SomeType = core.$ZodType,
1389
- > extends _ZodType<core.$ZodRecordInternals<Key, Value>>,
1390
- core.$ZodRecord<Key, Value> {
1391
- keyType: Key;
1392
- valueType: Value;
1393
- }
1394
- export const ZodRecord: core.$constructor<ZodRecord> = /*@__PURE__*/ core.$constructor("ZodRecord", (inst, def) => {
1395
- core.$ZodRecord.init(inst, def);
1396
- ZodType.init(inst, def);
1397
-
1398
- inst.keyType = def.keyType;
1399
- inst.valueType = def.valueType;
1400
- });
1401
-
1402
- export function record<Key extends core.$ZodRecordKey, Value extends core.SomeType>(
1403
- keyType: Key,
1404
- valueType: Value,
1405
- params?: string | core.$ZodRecordParams
1406
- ): ZodRecord<Key, Value> {
1407
- return new ZodRecord({
1408
- type: "record",
1409
- keyType,
1410
- valueType: valueType as any as core.$ZodType,
1411
- ...util.normalizeParams(params),
1412
- }) as any;
1413
- }
1414
- // type alksjf = core.output<core.$ZodRecordKey>;
1415
- export function partialRecord<Key extends core.$ZodRecordKey, Value extends core.SomeType>(
1416
- keyType: Key,
1417
- valueType: Value,
1418
- params?: string | core.$ZodRecordParams
1419
- ): ZodRecord<Key & core.$partial, Value> {
1420
- const k = core.clone(keyType);
1421
- k._zod.values = undefined;
1422
- return new ZodRecord({
1423
- type: "record",
1424
- keyType: k,
1425
- valueType: valueType as any,
1426
- ...util.normalizeParams(params),
1427
- }) as any;
1428
- }
1429
-
1430
- // ZodMap
1431
- export interface ZodMap<Key extends core.SomeType = core.$ZodType, Value extends core.SomeType = core.$ZodType>
1432
- extends _ZodType<core.$ZodMapInternals<Key, Value>>,
1433
- core.$ZodMap<Key, Value> {
1434
- keyType: Key;
1435
- valueType: Value;
1436
- }
1437
- export const ZodMap: core.$constructor<ZodMap> = /*@__PURE__*/ core.$constructor("ZodMap", (inst, def) => {
1438
- core.$ZodMap.init(inst, def);
1439
- ZodType.init(inst, def);
1440
- inst.keyType = def.keyType;
1441
- inst.valueType = def.valueType;
1442
- });
1443
-
1444
- export function map<Key extends core.SomeType, Value extends core.SomeType>(
1445
- keyType: Key,
1446
- valueType: Value,
1447
- params?: string | core.$ZodMapParams
1448
- ): ZodMap<Key, Value> {
1449
- return new ZodMap({
1450
- type: "map",
1451
- keyType: keyType as any as core.$ZodType,
1452
- valueType: valueType as any as core.$ZodType,
1453
- ...util.normalizeParams(params),
1454
- }) as any;
1455
- }
1456
-
1457
- // ZodSet
1458
- export interface ZodSet<T extends core.SomeType = core.$ZodType>
1459
- extends _ZodType<core.$ZodSetInternals<T>>,
1460
- core.$ZodSet<T> {
1461
- min(minSize: number, params?: string | core.$ZodCheckMinSizeParams): this;
1462
- nonempty(params?: string | core.$ZodCheckMinSizeParams): this;
1463
- max(maxSize: number, params?: string | core.$ZodCheckMaxSizeParams): this;
1464
- size(size: number, params?: string | core.$ZodCheckSizeEqualsParams): this;
1465
- }
1466
- export const ZodSet: core.$constructor<ZodSet> = /*@__PURE__*/ core.$constructor("ZodSet", (inst, def) => {
1467
- core.$ZodSet.init(inst, def);
1468
- ZodType.init(inst, def);
1469
-
1470
- inst.min = (...args) => inst.check(core._minSize(...args));
1471
- inst.nonempty = (params) => inst.check(core._minSize(1, params));
1472
- inst.max = (...args) => inst.check(core._maxSize(...args));
1473
- inst.size = (...args) => inst.check(core._size(...args));
1474
- });
1475
-
1476
- export function set<Value extends core.SomeType>(
1477
- valueType: Value,
1478
- params?: string | core.$ZodSetParams
1479
- ): ZodSet<Value> {
1480
- return new ZodSet({
1481
- type: "set",
1482
- valueType: valueType as any as core.$ZodType,
1483
- ...util.normalizeParams(params),
1484
- }) as any;
1485
- }
1486
-
1487
- // ZodEnum
1488
- export interface ZodEnum<
1489
- /** @ts-ignore Cast variance */
1490
- out T extends util.EnumLike = util.EnumLike,
1491
- > extends _ZodType<core.$ZodEnumInternals<T>>,
1492
- core.$ZodEnum<T> {
1493
- enum: T;
1494
- options: Array<T[keyof T]>;
1495
-
1496
- extract<const U extends readonly (keyof T)[]>(
1497
- values: U,
1498
- params?: string | core.$ZodEnumParams
1499
- ): ZodEnum<util.Flatten<Pick<T, U[number]>>>;
1500
- exclude<const U extends readonly (keyof T)[]>(
1501
- values: U,
1502
- params?: string | core.$ZodEnumParams
1503
- ): ZodEnum<util.Flatten<Omit<T, U[number]>>>;
1504
- }
1505
- export const ZodEnum: core.$constructor<ZodEnum> = /*@__PURE__*/ core.$constructor("ZodEnum", (inst, def) => {
1506
- core.$ZodEnum.init(inst, def);
1507
- ZodType.init(inst, def);
1508
-
1509
- inst.enum = def.entries;
1510
- inst.options = Object.values(def.entries);
1511
-
1512
- const keys = new Set(Object.keys(def.entries));
1513
-
1514
- inst.extract = (values, params) => {
1515
- const newEntries: Record<string, any> = {};
1516
- for (const value of values) {
1517
- if (keys.has(value)) {
1518
- newEntries[value] = def.entries[value];
1519
- } else throw new Error(`Key ${value} not found in enum`);
1520
- }
1521
- return new ZodEnum({
1522
- ...def,
1523
- checks: [],
1524
- ...util.normalizeParams(params),
1525
- entries: newEntries,
1526
- }) as any;
1527
- };
1528
-
1529
- inst.exclude = (values, params) => {
1530
- const newEntries: Record<string, any> = { ...def.entries };
1531
- for (const value of values) {
1532
- if (keys.has(value)) {
1533
- delete newEntries[value];
1534
- } else throw new Error(`Key ${value} not found in enum`);
1535
- }
1536
- return new ZodEnum({
1537
- ...def,
1538
- checks: [],
1539
- ...util.normalizeParams(params),
1540
- entries: newEntries,
1541
- }) as any;
1542
- };
1543
- });
1544
-
1545
- function _enum<const T extends readonly string[]>(
1546
- values: T,
1547
- params?: string | core.$ZodEnumParams
1548
- ): ZodEnum<util.ToEnum<T[number]>>;
1549
- function _enum<const T extends util.EnumLike>(entries: T, params?: string | core.$ZodEnumParams): ZodEnum<T>;
1550
- function _enum(values: any, params?: string | core.$ZodEnumParams) {
1551
- const entries: any = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;
1552
-
1553
- return new ZodEnum({
1554
- type: "enum",
1555
- entries,
1556
- ...util.normalizeParams(params),
1557
- }) as any;
1558
- }
1559
- export { _enum as enum };
1560
-
1561
- /** @deprecated This API has been merged into `z.enum()`. Use `z.enum()` instead.
1562
- *
1563
- * ```ts
1564
- * enum Colors { red, green, blue }
1565
- * z.enum(Colors);
1566
- * ```
1567
- */
1568
- export function nativeEnum<T extends util.EnumLike>(entries: T, params?: string | core.$ZodEnumParams): ZodEnum<T> {
1569
- return new ZodEnum({
1570
- type: "enum",
1571
- entries,
1572
- ...util.normalizeParams(params),
1573
- }) as any as ZodEnum<T>;
1574
- }
1575
-
1576
- // ZodLiteral
1577
- export interface ZodLiteral<T extends util.Literal = util.Literal>
1578
- extends _ZodType<core.$ZodLiteralInternals<T>>,
1579
- core.$ZodLiteral<T> {
1580
- values: Set<T>;
1581
- /** @legacy Use `.values` instead. Accessing this property will throw an error if the literal accepts multiple values. */
1582
- value: T;
1583
- }
1584
- export const ZodLiteral: core.$constructor<ZodLiteral> = /*@__PURE__*/ core.$constructor("ZodLiteral", (inst, def) => {
1585
- core.$ZodLiteral.init(inst, def);
1586
- ZodType.init(inst, def);
1587
- inst.values = new Set(def.values);
1588
- Object.defineProperty(inst, "value", {
1589
- get() {
1590
- if (def.values.length > 1) {
1591
- throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");
1592
- }
1593
- return def.values[0];
1594
- },
1595
- });
1596
- });
1597
-
1598
- export function literal<const T extends ReadonlyArray<util.Literal>>(
1599
- value: T,
1600
- params?: string | core.$ZodLiteralParams
1601
- ): ZodLiteral<T[number]>;
1602
- export function literal<const T extends util.Literal>(
1603
- value: T,
1604
- params?: string | core.$ZodLiteralParams
1605
- ): ZodLiteral<T>;
1606
- export function literal(value: any, params: any) {
1607
- return new ZodLiteral({
1608
- type: "literal",
1609
- values: Array.isArray(value) ? value : [value],
1610
- ...util.normalizeParams(params),
1611
- });
1612
- }
1613
-
1614
- // ZodFile
1615
- export interface ZodFile extends _ZodType<core.$ZodFileInternals>, core.$ZodFile {
1616
- min(size: number, params?: string | core.$ZodCheckMinSizeParams): this;
1617
- max(size: number, params?: string | core.$ZodCheckMaxSizeParams): this;
1618
- mime(types: util.MimeTypes | Array<util.MimeTypes>, params?: string | core.$ZodCheckMimeTypeParams): this;
1619
- }
1620
- export const ZodFile: core.$constructor<ZodFile> = /*@__PURE__*/ core.$constructor("ZodFile", (inst, def) => {
1621
- core.$ZodFile.init(inst, def);
1622
- ZodType.init(inst, def);
1623
-
1624
- inst.min = (size, params) => inst.check(core._minSize(size, params));
1625
- inst.max = (size, params) => inst.check(core._maxSize(size, params));
1626
- inst.mime = (types, params) => inst.check(core._mime(Array.isArray(types) ? types : [types], params));
1627
- });
1628
-
1629
- export function file(params?: string | core.$ZodFileParams): ZodFile {
1630
- return core._file(ZodFile, params) as any;
1631
- }
1632
-
1633
- // ZodTransform
1634
- export interface ZodTransform<O = unknown, I = unknown>
1635
- extends _ZodType<core.$ZodTransformInternals<O, I>>,
1636
- core.$ZodTransform<O, I> {}
1637
- export const ZodTransform: core.$constructor<ZodTransform> = /*@__PURE__*/ core.$constructor(
1638
- "ZodTransform",
1639
- (inst, def) => {
1640
- core.$ZodTransform.init(inst, def);
1641
- ZodType.init(inst, def);
1642
-
1643
- inst._zod.parse = (payload, _ctx) => {
1644
- if (_ctx.direction === "backward") {
1645
- throw new core.$ZodEncodeError(inst.constructor.name);
1646
- }
1647
-
1648
- (payload as core.$RefinementCtx).addIssue = (issue) => {
1649
- if (typeof issue === "string") {
1650
- payload.issues.push(util.issue(issue, payload.value, def));
1651
- } else {
1652
- // for Zod 3 backwards compatibility
1653
- const _issue = issue as any;
1654
-
1655
- if (_issue.fatal) _issue.continue = false;
1656
- _issue.code ??= "custom";
1657
- _issue.input ??= payload.value;
1658
- _issue.inst ??= inst;
1659
- // _issue.continue ??= true;
1660
- payload.issues.push(util.issue(_issue));
1661
- }
1662
- };
1663
-
1664
- const output = def.transform(payload.value, payload);
1665
- if (output instanceof Promise) {
1666
- return output.then((output) => {
1667
- payload.value = output;
1668
- return payload;
1669
- });
1670
- }
1671
- payload.value = output;
1672
- return payload;
1673
- };
1674
- }
1675
- );
1676
-
1677
- export function transform<I = unknown, O = I>(
1678
- fn: (input: I, ctx: core.ParsePayload) => O
1679
- ): ZodTransform<Awaited<O>, I> {
1680
- return new ZodTransform({
1681
- type: "transform",
1682
- transform: fn as any,
1683
- }) as any;
1684
- }
1685
-
1686
- // ZodOptional
1687
- export interface ZodOptional<T extends core.SomeType = core.$ZodType>
1688
- extends _ZodType<core.$ZodOptionalInternals<T>>,
1689
- core.$ZodOptional<T> {
1690
- unwrap(): T;
1691
- }
1692
- export const ZodOptional: core.$constructor<ZodOptional> = /*@__PURE__*/ core.$constructor(
1693
- "ZodOptional",
1694
- (inst, def) => {
1695
- core.$ZodOptional.init(inst, def);
1696
- ZodType.init(inst, def);
1697
-
1698
- inst.unwrap = () => inst._zod.def.innerType;
1699
- }
1700
- );
1701
-
1702
- export function optional<T extends core.SomeType>(innerType: T): ZodOptional<T> {
1703
- return new ZodOptional({
1704
- type: "optional",
1705
- innerType: innerType as any as core.$ZodType,
1706
- }) as any;
1707
- }
1708
-
1709
- // ZodNullable
1710
- export interface ZodNullable<T extends core.SomeType = core.$ZodType>
1711
- extends _ZodType<core.$ZodNullableInternals<T>>,
1712
- core.$ZodNullable<T> {
1713
- unwrap(): T;
1714
- }
1715
- export const ZodNullable: core.$constructor<ZodNullable> = /*@__PURE__*/ core.$constructor(
1716
- "ZodNullable",
1717
- (inst, def) => {
1718
- core.$ZodNullable.init(inst, def);
1719
- ZodType.init(inst, def);
1720
-
1721
- inst.unwrap = () => inst._zod.def.innerType;
1722
- }
1723
- );
1724
-
1725
- export function nullable<T extends core.SomeType>(innerType: T): ZodNullable<T> {
1726
- return new ZodNullable({
1727
- type: "nullable",
1728
- innerType: innerType as any as core.$ZodType,
1729
- }) as any;
1730
- }
1731
-
1732
- // nullish
1733
- export function nullish<T extends core.SomeType>(innerType: T): ZodOptional<ZodNullable<T>> {
1734
- return optional(nullable(innerType));
1735
- }
1736
-
1737
- // ZodDefault
1738
- export interface ZodDefault<T extends core.SomeType = core.$ZodType>
1739
- extends _ZodType<core.$ZodDefaultInternals<T>>,
1740
- core.$ZodDefault<T> {
1741
- unwrap(): T;
1742
- /** @deprecated Use `.unwrap()` instead. */
1743
- removeDefault(): T;
1744
- }
1745
- export const ZodDefault: core.$constructor<ZodDefault> = /*@__PURE__*/ core.$constructor("ZodDefault", (inst, def) => {
1746
- core.$ZodDefault.init(inst, def);
1747
- ZodType.init(inst, def);
1748
-
1749
- inst.unwrap = () => inst._zod.def.innerType;
1750
- inst.removeDefault = inst.unwrap;
1751
- });
1752
-
1753
- export function _default<T extends core.SomeType>(
1754
- innerType: T,
1755
- defaultValue: util.NoUndefined<core.output<T>> | (() => util.NoUndefined<core.output<T>>)
1756
- ): ZodDefault<T> {
1757
- return new ZodDefault({
1758
- type: "default",
1759
- innerType: innerType as any as core.$ZodType,
1760
- get defaultValue() {
1761
- return typeof defaultValue === "function" ? (defaultValue as Function)() : util.shallowClone(defaultValue);
1762
- },
1763
- }) as any;
1764
- }
1765
-
1766
- // ZodPrefault
1767
- export interface ZodPrefault<T extends core.SomeType = core.$ZodType>
1768
- extends _ZodType<core.$ZodPrefaultInternals<T>>,
1769
- core.$ZodPrefault<T> {
1770
- unwrap(): T;
1771
- }
1772
- export const ZodPrefault: core.$constructor<ZodPrefault> = /*@__PURE__*/ core.$constructor(
1773
- "ZodPrefault",
1774
- (inst, def) => {
1775
- core.$ZodPrefault.init(inst, def);
1776
- ZodType.init(inst, def);
1777
- inst.unwrap = () => inst._zod.def.innerType;
1778
- }
1779
- );
1780
-
1781
- export function prefault<T extends core.SomeType>(
1782
- innerType: T,
1783
- defaultValue: core.input<T> | (() => core.input<T>)
1784
- ): ZodPrefault<T> {
1785
- return new ZodPrefault({
1786
- type: "prefault",
1787
- innerType: innerType as any as core.$ZodType,
1788
- get defaultValue() {
1789
- return typeof defaultValue === "function" ? (defaultValue as Function)() : util.shallowClone(defaultValue);
1790
- },
1791
- }) as any;
1792
- }
1793
-
1794
- // ZodNonOptional
1795
- export interface ZodNonOptional<T extends core.SomeType = core.$ZodType>
1796
- extends _ZodType<core.$ZodNonOptionalInternals<T>>,
1797
- core.$ZodNonOptional<T> {
1798
- unwrap(): T;
1799
- }
1800
- export const ZodNonOptional: core.$constructor<ZodNonOptional> = /*@__PURE__*/ core.$constructor(
1801
- "ZodNonOptional",
1802
- (inst, def) => {
1803
- core.$ZodNonOptional.init(inst, def);
1804
- ZodType.init(inst, def);
1805
-
1806
- inst.unwrap = () => inst._zod.def.innerType;
1807
- }
1808
- );
1809
-
1810
- export function nonoptional<T extends core.SomeType>(
1811
- innerType: T,
1812
- params?: string | core.$ZodNonOptionalParams
1813
- ): ZodNonOptional<T> {
1814
- return new ZodNonOptional({
1815
- type: "nonoptional",
1816
- innerType: innerType as any as core.$ZodType,
1817
- ...util.normalizeParams(params),
1818
- }) as any;
1819
- }
1820
-
1821
- // ZodSuccess
1822
- export interface ZodSuccess<T extends core.SomeType = core.$ZodType>
1823
- extends _ZodType<core.$ZodSuccessInternals<T>>,
1824
- core.$ZodSuccess<T> {
1825
- unwrap(): T;
1826
- }
1827
- export const ZodSuccess: core.$constructor<ZodSuccess> = /*@__PURE__*/ core.$constructor("ZodSuccess", (inst, def) => {
1828
- core.$ZodSuccess.init(inst, def);
1829
- ZodType.init(inst, def);
1830
-
1831
- inst.unwrap = () => inst._zod.def.innerType;
1832
- });
1833
-
1834
- export function success<T extends core.SomeType>(innerType: T): ZodSuccess<T> {
1835
- return new ZodSuccess({
1836
- type: "success",
1837
- innerType: innerType as any as core.$ZodType,
1838
- }) as any;
1839
- }
1840
-
1841
- // ZodCatch
1842
- export interface ZodCatch<T extends core.SomeType = core.$ZodType>
1843
- extends _ZodType<core.$ZodCatchInternals<T>>,
1844
- core.$ZodCatch<T> {
1845
- unwrap(): T;
1846
- /** @deprecated Use `.unwrap()` instead. */
1847
- removeCatch(): T;
1848
- }
1849
- export const ZodCatch: core.$constructor<ZodCatch> = /*@__PURE__*/ core.$constructor("ZodCatch", (inst, def) => {
1850
- core.$ZodCatch.init(inst, def);
1851
- ZodType.init(inst, def);
1852
-
1853
- inst.unwrap = () => inst._zod.def.innerType;
1854
- inst.removeCatch = inst.unwrap;
1855
- });
1856
-
1857
- function _catch<T extends core.SomeType>(
1858
- innerType: T,
1859
- catchValue: core.output<T> | ((ctx: core.$ZodCatchCtx) => core.output<T>)
1860
- ): ZodCatch<T> {
1861
- return new ZodCatch({
1862
- type: "catch",
1863
- innerType: innerType as any as core.$ZodType,
1864
- catchValue: (typeof catchValue === "function" ? catchValue : () => catchValue) as (
1865
- ctx: core.$ZodCatchCtx
1866
- ) => core.output<T>,
1867
- }) as any;
1868
- }
1869
- export { _catch as catch };
1870
-
1871
- // ZodNaN
1872
- export interface ZodNaN extends _ZodType<core.$ZodNaNInternals>, core.$ZodNaN {}
1873
- export const ZodNaN: core.$constructor<ZodNaN> = /*@__PURE__*/ core.$constructor("ZodNaN", (inst, def) => {
1874
- core.$ZodNaN.init(inst, def);
1875
- ZodType.init(inst, def);
1876
- });
1877
-
1878
- export function nan(params?: string | core.$ZodNaNParams): ZodNaN {
1879
- return core._nan(ZodNaN, params);
1880
- }
1881
-
1882
- // ZodPipe
1883
- export interface ZodPipe<A extends core.SomeType = core.$ZodType, B extends core.SomeType = core.$ZodType>
1884
- extends _ZodType<core.$ZodPipeInternals<A, B>>,
1885
- core.$ZodPipe<A, B> {
1886
- in: A;
1887
- out: B;
1888
- }
1889
- export const ZodPipe: core.$constructor<ZodPipe> = /*@__PURE__*/ core.$constructor("ZodPipe", (inst, def) => {
1890
- core.$ZodPipe.init(inst, def);
1891
- ZodType.init(inst, def);
1892
-
1893
- inst.in = def.in;
1894
- inst.out = def.out;
1895
- });
1896
-
1897
- export function pipe<
1898
- const A extends core.SomeType,
1899
- B extends core.$ZodType<unknown, core.output<A>> = core.$ZodType<unknown, core.output<A>>,
1900
- >(in_: A, out: B | core.$ZodType<unknown, core.output<A>>): ZodPipe<A, B>;
1901
- export function pipe(in_: core.SomeType, out: core.SomeType) {
1902
- return new ZodPipe({
1903
- type: "pipe",
1904
- in: in_ as unknown as core.$ZodType,
1905
- out: out as unknown as core.$ZodType,
1906
- // ...util.normalizeParams(params),
1907
- });
1908
- }
1909
-
1910
- // ZodCodec
1911
- export interface ZodCodec<A extends core.SomeType = core.$ZodType, B extends core.SomeType = core.$ZodType>
1912
- extends ZodPipe<A, B>,
1913
- core.$ZodCodec<A, B> {
1914
- _zod: core.$ZodCodecInternals<A, B>;
1915
- def: core.$ZodCodecDef<A, B>;
1916
- }
1917
- export const ZodCodec: core.$constructor<ZodCodec> = /*@__PURE__*/ core.$constructor("ZodCodec", (inst, def) => {
1918
- ZodPipe.init(inst, def);
1919
- core.$ZodCodec.init(inst, def);
1920
- });
1921
-
1922
- export function codec<const A extends core.SomeType, B extends core.SomeType = core.$ZodType>(
1923
- in_: A,
1924
- out: B,
1925
- params: {
1926
- decode: (value: core.output<A>, payload: core.ParsePayload<core.output<A>>) => core.util.MaybeAsync<core.input<B>>;
1927
- encode: (value: core.input<B>, payload: core.ParsePayload<core.input<B>>) => core.util.MaybeAsync<core.output<A>>;
1928
- }
1929
- ): ZodCodec<A, B> {
1930
- return new ZodCodec({
1931
- type: "pipe",
1932
- in: in_ as any as core.$ZodType,
1933
- out: out as any as core.$ZodType,
1934
- transform: params.decode as any,
1935
- reverseTransform: params.encode as any,
1936
- }) as any;
1937
- }
1938
-
1939
- // ZodReadonly
1940
- export interface ZodReadonly<T extends core.SomeType = core.$ZodType>
1941
- extends _ZodType<core.$ZodReadonlyInternals<T>>,
1942
- core.$ZodReadonly<T> {
1943
- unwrap(): T;
1944
- }
1945
- export const ZodReadonly: core.$constructor<ZodReadonly> = /*@__PURE__*/ core.$constructor(
1946
- "ZodReadonly",
1947
- (inst, def) => {
1948
- core.$ZodReadonly.init(inst, def);
1949
- ZodType.init(inst, def);
1950
-
1951
- inst.unwrap = () => inst._zod.def.innerType;
1952
- }
1953
- );
1954
-
1955
- export function readonly<T extends core.SomeType>(innerType: T): ZodReadonly<T> {
1956
- return new ZodReadonly({
1957
- type: "readonly",
1958
- innerType: innerType as any as core.$ZodType,
1959
- }) as any;
1960
- }
1961
-
1962
- // ZodTemplateLiteral
1963
- export interface ZodTemplateLiteral<Template extends string = string>
1964
- extends _ZodType<core.$ZodTemplateLiteralInternals<Template>>,
1965
- core.$ZodTemplateLiteral<Template> {}
1966
- export const ZodTemplateLiteral: core.$constructor<ZodTemplateLiteral> = /*@__PURE__*/ core.$constructor(
1967
- "ZodTemplateLiteral",
1968
- (inst, def) => {
1969
- core.$ZodTemplateLiteral.init(inst, def);
1970
- ZodType.init(inst, def);
1971
- }
1972
- );
1973
-
1974
- export function templateLiteral<const Parts extends core.$ZodTemplateLiteralPart[]>(
1975
- parts: Parts,
1976
- params?: string | core.$ZodTemplateLiteralParams
1977
- ): ZodTemplateLiteral<core.$PartsToTemplateLiteral<Parts>> {
1978
- return new ZodTemplateLiteral({
1979
- type: "template_literal",
1980
- parts,
1981
- ...util.normalizeParams(params),
1982
- }) as any;
1983
- }
1984
-
1985
- // ZodLazy
1986
- export interface ZodLazy<T extends core.SomeType = core.$ZodType>
1987
- extends _ZodType<core.$ZodLazyInternals<T>>,
1988
- core.$ZodLazy<T> {
1989
- unwrap(): T;
1990
- }
1991
- export const ZodLazy: core.$constructor<ZodLazy> = /*@__PURE__*/ core.$constructor("ZodLazy", (inst, def) => {
1992
- core.$ZodLazy.init(inst, def);
1993
- ZodType.init(inst, def);
1994
-
1995
- inst.unwrap = () => inst._zod.def.getter();
1996
- });
1997
-
1998
- export function lazy<T extends core.SomeType>(getter: () => T): ZodLazy<T> {
1999
- return new ZodLazy({
2000
- type: "lazy",
2001
- getter: getter as any,
2002
- }) as any;
2003
- }
2004
-
2005
- // ZodPromise
2006
- export interface ZodPromise<T extends core.SomeType = core.$ZodType>
2007
- extends _ZodType<core.$ZodPromiseInternals<T>>,
2008
- core.$ZodPromise<T> {
2009
- unwrap(): T;
2010
- }
2011
- export const ZodPromise: core.$constructor<ZodPromise> = /*@__PURE__*/ core.$constructor("ZodPromise", (inst, def) => {
2012
- core.$ZodPromise.init(inst, def);
2013
- ZodType.init(inst, def);
2014
-
2015
- inst.unwrap = () => inst._zod.def.innerType;
2016
- });
2017
-
2018
- export function promise<T extends core.SomeType>(innerType: T): ZodPromise<T> {
2019
- return new ZodPromise({
2020
- type: "promise",
2021
- innerType: innerType as any as core.$ZodType,
2022
- }) as any;
2023
- }
2024
-
2025
- // ZodFunction
2026
- export interface ZodFunction<
2027
- Args extends core.$ZodFunctionIn = core.$ZodFunctionIn,
2028
- Returns extends core.$ZodFunctionOut = core.$ZodFunctionOut,
2029
- > extends _ZodType<core.$ZodFunctionInternals<Args, Returns>>,
2030
- core.$ZodFunction<Args, Returns> {
2031
- _def: core.$ZodFunctionDef<Args, Returns>;
2032
- _input: core.$InferInnerFunctionType<Args, Returns>;
2033
- _output: core.$InferOuterFunctionType<Args, Returns>;
2034
-
2035
- input<const Items extends util.TupleItems, const Rest extends core.$ZodFunctionOut = core.$ZodFunctionOut>(
2036
- args: Items,
2037
- rest?: Rest
2038
- ): ZodFunction<core.$ZodTuple<Items, Rest>, Returns>;
2039
- input<NewArgs extends core.$ZodFunctionIn>(args: NewArgs): ZodFunction<NewArgs, Returns>;
2040
- input(...args: any[]): ZodFunction<any, Returns>;
2041
-
2042
- output<NewReturns extends core.$ZodType>(output: NewReturns): ZodFunction<Args, NewReturns>;
2043
- }
2044
-
2045
- export const ZodFunction: core.$constructor<ZodFunction> = /*@__PURE__*/ core.$constructor(
2046
- "ZodFunction",
2047
- (inst, def) => {
2048
- core.$ZodFunction.init(inst, def);
2049
- ZodType.init(inst, def);
2050
- }
2051
- );
2052
-
2053
- export function _function(): ZodFunction;
2054
- export function _function<const In extends ReadonlyArray<core.$ZodType>>(params: {
2055
- input: In;
2056
- }): ZodFunction<ZodTuple<In, null>, core.$ZodFunctionOut>;
2057
- export function _function<
2058
- const In extends ReadonlyArray<core.$ZodType>,
2059
- const Out extends core.$ZodFunctionOut = core.$ZodFunctionOut,
2060
- >(params: {
2061
- input: In;
2062
- output: Out;
2063
- }): ZodFunction<ZodTuple<In, null>, Out>;
2064
- export function _function<const In extends core.$ZodFunctionIn = core.$ZodFunctionIn>(params: {
2065
- input: In;
2066
- }): ZodFunction<In, core.$ZodFunctionOut>;
2067
- export function _function<const Out extends core.$ZodFunctionOut = core.$ZodFunctionOut>(params: {
2068
- output: Out;
2069
- }): ZodFunction<core.$ZodFunctionIn, Out>;
2070
- export function _function<
2071
- In extends core.$ZodFunctionIn = core.$ZodFunctionIn,
2072
- Out extends core.$ZodType = core.$ZodType,
2073
- >(params?: {
2074
- input: In;
2075
- output: Out;
2076
- }): ZodFunction<In, Out>;
2077
- export function _function(params?: {
2078
- output?: core.$ZodType;
2079
- input?: core.$ZodFunctionArgs | Array<core.$ZodType>;
2080
- }): ZodFunction {
2081
- return new ZodFunction({
2082
- type: "function",
2083
- input: Array.isArray(params?.input) ? tuple(params?.input as any) : (params?.input ?? array(unknown())),
2084
- output: params?.output ?? unknown(),
2085
- });
2086
- }
2087
-
2088
- export { _function as function };
2089
-
2090
- // ZodCustom
2091
- export interface ZodCustom<O = unknown, I = unknown>
2092
- extends _ZodType<core.$ZodCustomInternals<O, I>>,
2093
- core.$ZodCustom<O, I> {}
2094
- export const ZodCustom: core.$constructor<ZodCustom> = /*@__PURE__*/ core.$constructor("ZodCustom", (inst, def) => {
2095
- core.$ZodCustom.init(inst, def);
2096
- ZodType.init(inst, def);
2097
- });
2098
-
2099
- // custom checks
2100
- export function check<O = unknown>(fn: core.CheckFn<O>): core.$ZodCheck<O> {
2101
- const ch = new core.$ZodCheck({
2102
- check: "custom",
2103
- // ...util.normalizeParams(params),
2104
- });
2105
-
2106
- ch._zod.check = fn;
2107
- return ch;
2108
- }
2109
-
2110
- export function custom<O>(
2111
- fn?: (data: unknown) => unknown,
2112
- _params?: string | core.$ZodCustomParams | undefined
2113
- ): ZodCustom<O, O> {
2114
- return core._custom(ZodCustom, fn ?? (() => true), _params) as any;
2115
- }
2116
-
2117
- export function refine<T>(
2118
- fn: (arg: NoInfer<T>) => util.MaybeAsync<unknown>,
2119
- _params: string | core.$ZodCustomParams = {}
2120
- ): core.$ZodCheck<T> {
2121
- return core._refine(ZodCustom, fn, _params);
2122
- }
2123
-
2124
- // superRefine
2125
- export function superRefine<T>(
2126
- fn: (arg: T, payload: core.$RefinementCtx<T>) => void | Promise<void>
2127
- ): core.$ZodCheck<T> {
2128
- return core._superRefine(fn);
2129
- }
2130
-
2131
- type ZodInstanceOfParams = core.Params<
2132
- ZodCustom,
2133
- core.$ZodIssueCustom,
2134
- "type" | "check" | "checks" | "fn" | "abort" | "error" | "params" | "path"
2135
- >;
2136
- function _instanceof<T extends typeof util.Class>(
2137
- cls: T,
2138
- params: ZodInstanceOfParams = {
2139
- error: `Input not instance of ${cls.name}`,
2140
- }
2141
- ): ZodCustom<InstanceType<T>, InstanceType<T>> {
2142
- const inst = new ZodCustom({
2143
- type: "custom",
2144
- check: "custom",
2145
- fn: (data) => data instanceof cls,
2146
- abort: true,
2147
- ...(util.normalizeParams(params) as any),
2148
- });
2149
- inst._zod.bag.Class = cls;
2150
- return inst as any;
2151
- }
2152
- export { _instanceof as instanceof };
2153
-
2154
- // stringbool
2155
- export const stringbool: (_params?: string | core.$ZodStringBoolParams) => ZodCodec<ZodString, ZodBoolean> = (
2156
- ...args
2157
- ) =>
2158
- core._stringbool(
2159
- {
2160
- Codec: ZodCodec,
2161
- Boolean: ZodBoolean,
2162
- String: ZodString,
2163
- },
2164
- ...args
2165
- ) as any;
2166
-
2167
- // json
2168
- type _ZodJSONSchema = ZodUnion<
2169
- [ZodString, ZodNumber, ZodBoolean, ZodNull, ZodArray<ZodJSONSchema>, ZodRecord<ZodString, ZodJSONSchema>]
2170
- >;
2171
- type _ZodJSONSchemaInternals = _ZodJSONSchema["_zod"];
2172
-
2173
- export interface ZodJSONSchemaInternals extends _ZodJSONSchemaInternals {
2174
- output: util.JSONType;
2175
- input: util.JSONType;
2176
- }
2177
- export interface ZodJSONSchema extends _ZodJSONSchema {
2178
- _zod: ZodJSONSchemaInternals;
2179
- }
2180
-
2181
- export function json(params?: string | core.$ZodCustomParams): ZodJSONSchema {
2182
- const jsonSchema: any = lazy(() => {
2183
- return union([string(params), number(), boolean(), _null(), array(jsonSchema), record(string(), jsonSchema)]);
2184
- });
2185
-
2186
- return jsonSchema;
2187
- }
2188
-
2189
- // preprocess
2190
-
2191
- // /** @deprecated Use `z.pipe()` and `z.transform()` instead. */
2192
- export function preprocess<A, U extends core.SomeType, B = unknown>(
2193
- fn: (arg: B, ctx: core.$RefinementCtx) => A,
2194
- schema: U
2195
- ): ZodPipe<ZodTransform<A, B>, U> {
2196
- return pipe(transform(fn as any), schema as any) as any;
2197
- }