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