@ykdz/template 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (891) hide show
  1. package/dist/input-schemas.d.ts +21 -30
  2. package/dist/input-schemas.js +46 -32
  3. package/dist/main.js +42 -43
  4. package/dist/result-schemas.d.ts +146 -249
  5. package/dist/result-schemas.js +55 -57
  6. package/node_modules/@ykdz/default-content-authoring/package.json +2 -2
  7. package/node_modules/@ykdz/reference-rust-bin/native/template/rust-toolchain.toml +1 -1
  8. package/node_modules/@ykdz/reference-ts-cli/native/package.json +1 -2
  9. package/node_modules/@ykdz/reference-ts-cli/native/src/main.ts +8 -18
  10. package/node_modules/@ykdz/reference-ts-lib/native/package.json +1 -1
  11. package/node_modules/@ykdz/reference-ts-lib/native/src/index.ts +1 -3
  12. package/node_modules/@ykdz/reference-ts-lib/native/src/name-schema.ts +2 -2
  13. package/node_modules/@ykdz/reference-workspace-root/native/package.json +2 -2
  14. package/node_modules/@ykdz/reference-workspace-root/native/template-dist/definition.js +2 -2
  15. package/node_modules/@ykdz/reference-workspace-root/native/template-dist/editor-customization.d.ts.map +1 -1
  16. package/node_modules/@ykdz/reference-workspace-root/native/template-dist/editor-customization.js +13 -14
  17. package/node_modules/@ykdz/reference-workspace-root/package.json +2 -2
  18. package/node_modules/@ykdz/template-core/dist/generation-record.d.ts +36 -32
  19. package/node_modules/@ykdz/template-core/dist/generation-record.js +22 -22
  20. package/node_modules/@ykdz/template-core/dist/project-blueprint.d.ts +14 -14
  21. package/node_modules/@ykdz/template-core/dist/project-blueprint.js +51 -47
  22. package/node_modules/@ykdz/template-core/package.json +3 -3
  23. package/node_modules/@ykdz/template-environment/package.json +2 -2
  24. package/node_modules/@ykdz/template-generator/package.json +2 -2
  25. package/node_modules/@ykdz/template-workspace/dist/release-toolchain-snapshot.d.ts +1 -1
  26. package/node_modules/@ykdz/template-workspace/dist/release-toolchain-snapshot.js +1 -1
  27. package/node_modules/@ykdz/template-workspace/dist/workspace-policy-snapshot.js +7 -8
  28. package/node_modules/@ykdz/template-workspace/package.json +2 -3
  29. package/node_modules/@ykdz/template-workspace-authoring/package.json +2 -2
  30. package/node_modules/@ykdz/tooling-config/package.json +2 -2
  31. package/node_modules/zod/LICENSE +21 -0
  32. package/node_modules/zod/README.md +218 -0
  33. package/node_modules/zod/compile.cjs +96 -0
  34. package/node_modules/zod/compile.d.cts +1 -0
  35. package/node_modules/zod/compile.d.ts +1 -0
  36. package/node_modules/zod/compile.js +52 -0
  37. package/node_modules/zod/index.cjs +52 -0
  38. package/node_modules/zod/index.d.cts +3 -0
  39. package/node_modules/zod/index.d.ts +3 -0
  40. package/node_modules/zod/index.js +7 -0
  41. package/node_modules/zod/locales/index.cjs +36 -0
  42. package/node_modules/zod/locales/index.d.cts +1 -0
  43. package/node_modules/zod/locales/index.d.ts +1 -0
  44. package/node_modules/zod/locales/index.js +1 -0
  45. package/node_modules/zod/locales/package.json +7 -0
  46. package/node_modules/zod/mini/index.cjs +51 -0
  47. package/node_modules/zod/mini/index.d.cts +3 -0
  48. package/node_modules/zod/mini/index.d.ts +3 -0
  49. package/node_modules/zod/mini/index.js +3 -0
  50. package/node_modules/zod/mini/package.json +7 -0
  51. package/node_modules/zod/package.json +147 -0
  52. package/node_modules/zod/src/compile.ts +56 -0
  53. package/node_modules/zod/src/index.ts +7 -0
  54. package/node_modules/zod/src/locales/index.ts +1 -0
  55. package/node_modules/zod/src/mini/index.ts +3 -0
  56. package/node_modules/zod/src/v3/ZodError.ts +340 -0
  57. package/node_modules/zod/src/v3/benchmarks/datetime.ts +58 -0
  58. package/node_modules/zod/src/v3/benchmarks/discriminatedUnion.ts +80 -0
  59. package/node_modules/zod/src/v3/benchmarks/index.ts +59 -0
  60. package/node_modules/zod/src/v3/benchmarks/ipv4.ts +57 -0
  61. package/node_modules/zod/src/v3/benchmarks/object.ts +69 -0
  62. package/node_modules/zod/src/v3/benchmarks/primitives.ts +162 -0
  63. package/node_modules/zod/src/v3/benchmarks/realworld.ts +63 -0
  64. package/node_modules/zod/src/v3/benchmarks/string.ts +55 -0
  65. package/node_modules/zod/src/v3/benchmarks/union.ts +80 -0
  66. package/node_modules/zod/src/v3/errors.ts +13 -0
  67. package/node_modules/zod/src/v3/external.ts +6 -0
  68. package/node_modules/zod/src/v3/helpers/enumUtil.ts +17 -0
  69. package/node_modules/zod/src/v3/helpers/errorUtil.ts +8 -0
  70. package/node_modules/zod/src/v3/helpers/parseUtil.ts +176 -0
  71. package/node_modules/zod/src/v3/helpers/partialUtil.ts +34 -0
  72. package/node_modules/zod/src/v3/helpers/typeAliases.ts +2 -0
  73. package/node_modules/zod/src/v3/helpers/util.ts +224 -0
  74. package/node_modules/zod/src/v3/index.ts +4 -0
  75. package/node_modules/zod/src/v3/locales/en.ts +124 -0
  76. package/node_modules/zod/src/v3/standard-schema.ts +113 -0
  77. package/node_modules/zod/src/v3/tests/Mocker.ts +54 -0
  78. package/node_modules/zod/src/v3/tests/all-errors.test.ts +157 -0
  79. package/node_modules/zod/src/v3/tests/anyunknown.test.ts +28 -0
  80. package/node_modules/zod/src/v3/tests/array.test.ts +71 -0
  81. package/node_modules/zod/src/v3/tests/async-parsing.test.ts +388 -0
  82. package/node_modules/zod/src/v3/tests/async-refinements.test.ts +46 -0
  83. package/node_modules/zod/src/v3/tests/base.test.ts +29 -0
  84. package/node_modules/zod/src/v3/tests/bigint.test.ts +55 -0
  85. package/node_modules/zod/src/v3/tests/branded.test.ts +53 -0
  86. package/node_modules/zod/src/v3/tests/catch.test.ts +220 -0
  87. package/node_modules/zod/src/v3/tests/coerce.test.ts +133 -0
  88. package/node_modules/zod/src/v3/tests/complex.test.ts +70 -0
  89. package/node_modules/zod/src/v3/tests/custom.test.ts +31 -0
  90. package/node_modules/zod/src/v3/tests/date.test.ts +32 -0
  91. package/node_modules/zod/src/v3/tests/deepmasking.test.ts +186 -0
  92. package/node_modules/zod/src/v3/tests/default.test.ts +112 -0
  93. package/node_modules/zod/src/v3/tests/description.test.ts +33 -0
  94. package/node_modules/zod/src/v3/tests/discriminated-unions.test.ts +315 -0
  95. package/node_modules/zod/src/v3/tests/enum.test.ts +80 -0
  96. package/node_modules/zod/src/v3/tests/error.test.ts +586 -0
  97. package/node_modules/zod/src/v3/tests/firstparty.test.ts +87 -0
  98. package/node_modules/zod/src/v3/tests/firstpartyschematypes.test.ts +21 -0
  99. package/node_modules/zod/src/v3/tests/function.test.ts +261 -0
  100. package/node_modules/zod/src/v3/tests/generics.test.ts +48 -0
  101. package/node_modules/zod/src/v3/tests/instanceof.test.ts +37 -0
  102. package/node_modules/zod/src/v3/tests/intersection.test.ts +128 -0
  103. package/node_modules/zod/src/v3/tests/language-server.source.ts +76 -0
  104. package/node_modules/zod/src/v3/tests/language-server.test.ts +206 -0
  105. package/node_modules/zod/src/v3/tests/literal.test.ts +36 -0
  106. package/node_modules/zod/src/v3/tests/map.test.ts +110 -0
  107. package/node_modules/zod/src/v3/tests/masking.test.ts +4 -0
  108. package/node_modules/zod/src/v3/tests/mocker.test.ts +19 -0
  109. package/node_modules/zod/src/v3/tests/nan.test.ts +24 -0
  110. package/node_modules/zod/src/v3/tests/nativeEnum.test.ts +87 -0
  111. package/node_modules/zod/src/v3/tests/nullable.test.ts +42 -0
  112. package/node_modules/zod/src/v3/tests/number.test.ts +176 -0
  113. package/node_modules/zod/src/v3/tests/object-augmentation.test.ts +29 -0
  114. package/node_modules/zod/src/v3/tests/object-in-es5-env.test.ts +29 -0
  115. package/node_modules/zod/src/v3/tests/object.test.ts +431 -0
  116. package/node_modules/zod/src/v3/tests/optional.test.ts +42 -0
  117. package/node_modules/zod/src/v3/tests/parseUtil.test.ts +23 -0
  118. package/node_modules/zod/src/v3/tests/parser.test.ts +41 -0
  119. package/node_modules/zod/src/v3/tests/partials.test.ts +243 -0
  120. package/node_modules/zod/src/v3/tests/pickomit.test.ts +111 -0
  121. package/node_modules/zod/src/v3/tests/pipeline.test.ts +29 -0
  122. package/node_modules/zod/src/v3/tests/preprocess.test.ts +186 -0
  123. package/node_modules/zod/src/v3/tests/primitive.test.ts +440 -0
  124. package/node_modules/zod/src/v3/tests/promise.test.ts +90 -0
  125. package/node_modules/zod/src/v3/tests/readonly.test.ts +114 -0
  126. package/node_modules/zod/src/v3/tests/record.test.ts +171 -0
  127. package/node_modules/zod/src/v3/tests/recursive.test.ts +197 -0
  128. package/node_modules/zod/src/v3/tests/refine.test.ts +313 -0
  129. package/node_modules/zod/src/v3/tests/safeparse.test.ts +27 -0
  130. package/node_modules/zod/src/v3/tests/set.test.ts +142 -0
  131. package/node_modules/zod/src/v3/tests/standard-schema.test.ts +83 -0
  132. package/node_modules/zod/src/v3/tests/string.test.ts +922 -0
  133. package/node_modules/zod/src/v3/tests/transformer.test.ts +233 -0
  134. package/node_modules/zod/src/v3/tests/tuple.test.ts +90 -0
  135. package/node_modules/zod/src/v3/tests/unions.test.ts +57 -0
  136. package/node_modules/zod/src/v3/tests/validations.test.ts +133 -0
  137. package/node_modules/zod/src/v3/tests/void.test.ts +15 -0
  138. package/node_modules/zod/src/v3/types.ts +5138 -0
  139. package/node_modules/zod/src/v4/classic/checks.ts +33 -0
  140. package/node_modules/zod/src/v4/classic/coerce.ts +27 -0
  141. package/node_modules/zod/src/v4/classic/compat.ts +78 -0
  142. package/node_modules/zod/src/v4/classic/deep-partial.ts +76 -0
  143. package/node_modules/zod/src/v4/classic/errors.ts +97 -0
  144. package/node_modules/zod/src/v4/classic/external.ts +57 -0
  145. package/node_modules/zod/src/v4/classic/from-json-schema.ts +944 -0
  146. package/node_modules/zod/src/v4/classic/in-out.ts +45 -0
  147. package/node_modules/zod/src/v4/classic/index.ts +5 -0
  148. package/node_modules/zod/src/v4/classic/iso.ts +20 -0
  149. package/node_modules/zod/src/v4/classic/parse.ts +88 -0
  150. package/node_modules/zod/src/v4/classic/schemas.ts +2937 -0
  151. package/node_modules/zod/src/v4/classic/tests/anyunknown.test.ts +26 -0
  152. package/node_modules/zod/src/v4/classic/tests/apply.test.ts +86 -0
  153. package/node_modules/zod/src/v4/classic/tests/array.test.ts +291 -0
  154. package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +402 -0
  155. package/node_modules/zod/src/v4/classic/tests/async-parsing.test.ts +381 -0
  156. package/node_modules/zod/src/v4/classic/tests/async-refinements.test.ts +68 -0
  157. package/node_modules/zod/src/v4/classic/tests/base.test.ts +7 -0
  158. package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +89 -0
  159. package/node_modules/zod/src/v4/classic/tests/brand.test.ts +106 -0
  160. package/node_modules/zod/src/v4/classic/tests/catch.test.ts +604 -0
  161. package/node_modules/zod/src/v4/classic/tests/coalesce.test.ts +20 -0
  162. package/node_modules/zod/src/v4/classic/tests/codec-examples.test.ts +572 -0
  163. package/node_modules/zod/src/v4/classic/tests/codec.test.ts +704 -0
  164. package/node_modules/zod/src/v4/classic/tests/coerce.test.ts +160 -0
  165. package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +374 -0
  166. package/node_modules/zod/src/v4/classic/tests/credit-card.test.ts +76 -0
  167. package/node_modules/zod/src/v4/classic/tests/custom.test.ts +40 -0
  168. package/node_modules/zod/src/v4/classic/tests/cyclic-data.test.ts +985 -0
  169. package/node_modules/zod/src/v4/classic/tests/date.test.ts +92 -0
  170. package/node_modules/zod/src/v4/classic/tests/datetime.test.ts +316 -0
  171. package/node_modules/zod/src/v4/classic/tests/deep-partial.test.ts +380 -0
  172. package/node_modules/zod/src/v4/classic/tests/default-locale.test.ts +32 -0
  173. package/node_modules/zod/src/v4/classic/tests/default.test.ts +455 -0
  174. package/node_modules/zod/src/v4/classic/tests/describe-meta-checks.test.ts +27 -0
  175. package/node_modules/zod/src/v4/classic/tests/description.test.ts +32 -0
  176. package/node_modules/zod/src/v4/classic/tests/detached-methods.test.ts +221 -0
  177. package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +942 -0
  178. package/node_modules/zod/src/v4/classic/tests/enum.test.ts +305 -0
  179. package/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +917 -0
  180. package/node_modules/zod/src/v4/classic/tests/error.test.ts +1108 -0
  181. package/node_modules/zod/src/v4/classic/tests/file.test.ts +96 -0
  182. package/node_modules/zod/src/v4/classic/tests/firstparty.test.ts +179 -0
  183. package/node_modules/zod/src/v4/classic/tests/fix-json-issue.test.ts +26 -0
  184. package/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +1467 -0
  185. package/node_modules/zod/src/v4/classic/tests/function.test.ts +391 -0
  186. package/node_modules/zod/src/v4/classic/tests/generics.test.ts +72 -0
  187. package/node_modules/zod/src/v4/classic/tests/global-config.test.ts +32 -0
  188. package/node_modules/zod/src/v4/classic/tests/hash.test.ts +67 -0
  189. package/node_modules/zod/src/v4/classic/tests/iban.test.ts +81 -0
  190. package/node_modules/zod/src/v4/classic/tests/in-out.test.ts +159 -0
  191. package/node_modules/zod/src/v4/classic/tests/index.test.ts +958 -0
  192. package/node_modules/zod/src/v4/classic/tests/instance-footprint.test.ts +319 -0
  193. package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +127 -0
  194. package/node_modules/zod/src/v4/classic/tests/intersection.test.ts +334 -0
  195. package/node_modules/zod/src/v4/classic/tests/issue-schema.test.ts +215 -0
  196. package/node_modules/zod/src/v4/classic/tests/jitless-allows-eval.test.ts +39 -0
  197. package/node_modules/zod/src/v4/classic/tests/json.test.ts +109 -0
  198. package/node_modules/zod/src/v4/classic/tests/lazy.test.ts +262 -0
  199. package/node_modules/zod/src/v4/classic/tests/literal.test.ts +128 -0
  200. package/node_modules/zod/src/v4/classic/tests/locales_ka.test.ts +29 -0
  201. package/node_modules/zod/src/v4/classic/tests/locales_ro.test.ts +24 -0
  202. package/node_modules/zod/src/v4/classic/tests/map.test.ts +349 -0
  203. package/node_modules/zod/src/v4/classic/tests/nan.test.ts +21 -0
  204. package/node_modules/zod/src/v4/classic/tests/nested-refine.test.ts +168 -0
  205. package/node_modules/zod/src/v4/classic/tests/nonoptional.test.ts +101 -0
  206. package/node_modules/zod/src/v4/classic/tests/nullable.test.ts +22 -0
  207. package/node_modules/zod/src/v4/classic/tests/number.test.ts +401 -0
  208. package/node_modules/zod/src/v4/classic/tests/object.test.ts +1006 -0
  209. package/node_modules/zod/src/v4/classic/tests/optin-ladder.test.ts +235 -0
  210. package/node_modules/zod/src/v4/classic/tests/optional.test.ts +366 -0
  211. package/node_modules/zod/src/v4/classic/tests/partial.test.ts +497 -0
  212. package/node_modules/zod/src/v4/classic/tests/pickomit.test.ts +211 -0
  213. package/node_modules/zod/src/v4/classic/tests/pipe.test.ts +101 -0
  214. package/node_modules/zod/src/v4/classic/tests/prefault.test.ts +144 -0
  215. package/node_modules/zod/src/v4/classic/tests/preprocess-types.test.ts +44 -0
  216. package/node_modules/zod/src/v4/classic/tests/preprocess.test.ts +351 -0
  217. package/node_modules/zod/src/v4/classic/tests/primitive.test.ts +175 -0
  218. package/node_modules/zod/src/v4/classic/tests/promise.test.ts +81 -0
  219. package/node_modules/zod/src/v4/classic/tests/properties.test.ts +141 -0
  220. package/node_modules/zod/src/v4/classic/tests/prototypes.test.ts +23 -0
  221. package/node_modules/zod/src/v4/classic/tests/readonly.test.ts +184 -0
  222. package/node_modules/zod/src/v4/classic/tests/record.test.ts +885 -0
  223. package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +707 -0
  224. package/node_modules/zod/src/v4/classic/tests/redos.test.ts +68 -0
  225. package/node_modules/zod/src/v4/classic/tests/refine.test.ts +693 -0
  226. package/node_modules/zod/src/v4/classic/tests/registries.test.ts +243 -0
  227. package/node_modules/zod/src/v4/classic/tests/set.test.ts +196 -0
  228. package/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +153 -0
  229. package/node_modules/zod/src/v4/classic/tests/string-formats.test.ts +125 -0
  230. package/node_modules/zod/src/v4/classic/tests/string.test.ts +1440 -0
  231. package/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +124 -0
  232. package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +812 -0
  233. package/node_modules/zod/src/v4/classic/tests/to-json-schema-methods.test.ts +438 -0
  234. package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +4733 -0
  235. package/node_modules/zod/src/v4/classic/tests/transform.test.ts +378 -0
  236. package/node_modules/zod/src/v4/classic/tests/tuple.test.ts +511 -0
  237. package/node_modules/zod/src/v4/classic/tests/union.test.ts +310 -0
  238. package/node_modules/zod/src/v4/classic/tests/url.test.ts +13 -0
  239. package/node_modules/zod/src/v4/classic/tests/validate.test.ts +645 -0
  240. package/node_modules/zod/src/v4/classic/tests/validations.test.ts +283 -0
  241. package/node_modules/zod/src/v4/classic/tests/void.test.ts +12 -0
  242. package/node_modules/zod/src/v4/core/api.ts +1875 -0
  243. package/node_modules/zod/src/v4/core/checks.ts +1266 -0
  244. package/node_modules/zod/src/v4/core/compile.ts +2322 -0
  245. package/node_modules/zod/src/v4/core/core.ts +230 -0
  246. package/node_modules/zod/src/v4/core/doc.ts +52 -0
  247. package/node_modules/zod/src/v4/core/errors.ts +543 -0
  248. package/node_modules/zod/src/v4/core/index.ts +19 -0
  249. package/node_modules/zod/src/v4/core/json-schema-generator.ts +131 -0
  250. package/node_modules/zod/src/v4/core/json-schema-processors.ts +934 -0
  251. package/node_modules/zod/src/v4/core/json-schema.ts +148 -0
  252. package/node_modules/zod/src/v4/core/memoizer.ts +331 -0
  253. package/node_modules/zod/src/v4/core/parse.ts +309 -0
  254. package/node_modules/zod/src/v4/core/regexes.ts +217 -0
  255. package/node_modules/zod/src/v4/core/registries.ts +105 -0
  256. package/node_modules/zod/src/v4/core/schemas.ts +5226 -0
  257. package/node_modules/zod/src/v4/core/standard-schema.ts +159 -0
  258. package/node_modules/zod/src/v4/core/tests/cached.test.ts +54 -0
  259. package/node_modules/zod/src/v4/core/tests/compile-differential.test.ts +1004 -0
  260. package/node_modules/zod/src/v4/core/tests/compile-generative.test.ts +445 -0
  261. package/node_modules/zod/src/v4/core/tests/compile-global.test.ts +89 -0
  262. package/node_modules/zod/src/v4/core/tests/compile-off-by-default.test.ts +26 -0
  263. package/node_modules/zod/src/v4/core/tests/compile-stats.test.ts +34 -0
  264. package/node_modules/zod/src/v4/core/tests/compile.test.ts +2036 -0
  265. package/node_modules/zod/src/v4/core/tests/email-regex.test.ts +140 -0
  266. package/node_modules/zod/src/v4/core/tests/extend.test.ts +59 -0
  267. package/node_modules/zod/src/v4/core/tests/index.test.ts +46 -0
  268. package/node_modules/zod/src/v4/core/tests/locales/be.test.ts +124 -0
  269. package/node_modules/zod/src/v4/core/tests/locales/el.test.ts +214 -0
  270. package/node_modules/zod/src/v4/core/tests/locales/en.test.ts +22 -0
  271. package/node_modules/zod/src/v4/core/tests/locales/es.test.ts +180 -0
  272. package/node_modules/zod/src/v4/core/tests/locales/fr.test.ts +72 -0
  273. package/node_modules/zod/src/v4/core/tests/locales/he.test.ts +379 -0
  274. package/node_modules/zod/src/v4/core/tests/locales/hr.test.ts +163 -0
  275. package/node_modules/zod/src/v4/core/tests/locales/nl.test.ts +46 -0
  276. package/node_modules/zod/src/v4/core/tests/locales/parity.test.ts +42 -0
  277. package/node_modules/zod/src/v4/core/tests/locales/ru.test.ts +128 -0
  278. package/node_modules/zod/src/v4/core/tests/locales/tg.test.ts +85 -0
  279. package/node_modules/zod/src/v4/core/tests/locales/tk.test.ts +69 -0
  280. package/node_modules/zod/src/v4/core/tests/locales/tr.test.ts +69 -0
  281. package/node_modules/zod/src/v4/core/tests/locales/uz.test.ts +105 -0
  282. package/node_modules/zod/src/v4/core/tests/polyfill-collision.test.ts +46 -0
  283. package/node_modules/zod/src/v4/core/tests/record-constructor.test.ts +125 -0
  284. package/node_modules/zod/src/v4/core/tests/recursive-tuples.test.ts +45 -0
  285. package/node_modules/zod/src/v4/core/tests/treeshake.test.ts +51 -0
  286. package/node_modules/zod/src/v4/core/tests/url-no-canparse.test.ts +133 -0
  287. package/node_modules/zod/src/v4/core/to-json-schema.ts +857 -0
  288. package/node_modules/zod/src/v4/core/util.ts +1293 -0
  289. package/node_modules/zod/src/v4/core/versions.ts +5 -0
  290. package/node_modules/zod/src/v4/core/visit.ts +193 -0
  291. package/node_modules/zod/src/v4/core/zsf.ts +323 -0
  292. package/node_modules/zod/src/v4/index.ts +4 -0
  293. package/node_modules/zod/src/v4/locales/ar.ts +120 -0
  294. package/node_modules/zod/src/v4/locales/az.ts +116 -0
  295. package/node_modules/zod/src/v4/locales/be.ts +188 -0
  296. package/node_modules/zod/src/v4/locales/bg.ts +133 -0
  297. package/node_modules/zod/src/v4/locales/bn.ts +123 -0
  298. package/node_modules/zod/src/v4/locales/ca.ts +121 -0
  299. package/node_modules/zod/src/v4/locales/ckb.ts +140 -0
  300. package/node_modules/zod/src/v4/locales/cs.ts +123 -0
  301. package/node_modules/zod/src/v4/locales/da.ts +128 -0
  302. package/node_modules/zod/src/v4/locales/de.ts +121 -0
  303. package/node_modules/zod/src/v4/locales/el.ts +124 -0
  304. package/node_modules/zod/src/v4/locales/en.ts +136 -0
  305. package/node_modules/zod/src/v4/locales/eo.ts +123 -0
  306. package/node_modules/zod/src/v4/locales/es.ts +145 -0
  307. package/node_modules/zod/src/v4/locales/fa.ts +131 -0
  308. package/node_modules/zod/src/v4/locales/fi.ts +126 -0
  309. package/node_modules/zod/src/v4/locales/fr-CA.ts +121 -0
  310. package/node_modules/zod/src/v4/locales/fr.ts +139 -0
  311. package/node_modules/zod/src/v4/locales/gu.ts +123 -0
  312. package/node_modules/zod/src/v4/locales/he.ts +253 -0
  313. package/node_modules/zod/src/v4/locales/hi.ts +126 -0
  314. package/node_modules/zod/src/v4/locales/hr.ts +135 -0
  315. package/node_modules/zod/src/v4/locales/hu.ts +122 -0
  316. package/node_modules/zod/src/v4/locales/hy.ts +175 -0
  317. package/node_modules/zod/src/v4/locales/id.ts +120 -0
  318. package/node_modules/zod/src/v4/locales/index.ts +63 -0
  319. package/node_modules/zod/src/v4/locales/is.ts +124 -0
  320. package/node_modules/zod/src/v4/locales/it.ts +121 -0
  321. package/node_modules/zod/src/v4/locales/ja.ts +119 -0
  322. package/node_modules/zod/src/v4/locales/ka.ts +128 -0
  323. package/node_modules/zod/src/v4/locales/kh.ts +7 -0
  324. package/node_modules/zod/src/v4/locales/km.ts +124 -0
  325. package/node_modules/zod/src/v4/locales/kn.ts +126 -0
  326. package/node_modules/zod/src/v4/locales/ko.ts +126 -0
  327. package/node_modules/zod/src/v4/locales/lt.ts +243 -0
  328. package/node_modules/zod/src/v4/locales/mk.ts +123 -0
  329. package/node_modules/zod/src/v4/locales/ms.ts +120 -0
  330. package/node_modules/zod/src/v4/locales/ne.ts +128 -0
  331. package/node_modules/zod/src/v4/locales/nl.ts +126 -0
  332. package/node_modules/zod/src/v4/locales/nn.ts +121 -0
  333. package/node_modules/zod/src/v4/locales/no.ts +121 -0
  334. package/node_modules/zod/src/v4/locales/ota.ts +122 -0
  335. package/node_modules/zod/src/v4/locales/pl.ts +123 -0
  336. package/node_modules/zod/src/v4/locales/ps.ts +131 -0
  337. package/node_modules/zod/src/v4/locales/pt-BR.ts +161 -0
  338. package/node_modules/zod/src/v4/locales/pt.ts +159 -0
  339. package/node_modules/zod/src/v4/locales/ro.ts +132 -0
  340. package/node_modules/zod/src/v4/locales/ru.ts +188 -0
  341. package/node_modules/zod/src/v4/locales/sk.ts +123 -0
  342. package/node_modules/zod/src/v4/locales/sl.ts +123 -0
  343. package/node_modules/zod/src/v4/locales/sv.ts +124 -0
  344. package/node_modules/zod/src/v4/locales/ta.ts +123 -0
  345. package/node_modules/zod/src/v4/locales/tg.ts +135 -0
  346. package/node_modules/zod/src/v4/locales/th.ts +124 -0
  347. package/node_modules/zod/src/v4/locales/tk.ts +113 -0
  348. package/node_modules/zod/src/v4/locales/tr.ts +116 -0
  349. package/node_modules/zod/src/v4/locales/ua.ts +7 -0
  350. package/node_modules/zod/src/v4/locales/uk.ts +122 -0
  351. package/node_modules/zod/src/v4/locales/ur.ts +124 -0
  352. package/node_modules/zod/src/v4/locales/uz.ts +120 -0
  353. package/node_modules/zod/src/v4/locales/vi.ts +122 -0
  354. package/node_modules/zod/src/v4/locales/yo.ts +129 -0
  355. package/node_modules/zod/src/v4/locales/zh-CN.ts +121 -0
  356. package/node_modules/zod/src/v4/locales/zh-TW.ts +120 -0
  357. package/node_modules/zod/src/v4/mini/checks.ts +33 -0
  358. package/node_modules/zod/src/v4/mini/coerce.ts +27 -0
  359. package/node_modules/zod/src/v4/mini/deep-partial.ts +73 -0
  360. package/node_modules/zod/src/v4/mini/external.ts +52 -0
  361. package/node_modules/zod/src/v4/mini/in-out.ts +45 -0
  362. package/node_modules/zod/src/v4/mini/index.ts +3 -0
  363. package/node_modules/zod/src/v4/mini/iso.ts +66 -0
  364. package/node_modules/zod/src/v4/mini/parse.ts +16 -0
  365. package/node_modules/zod/src/v4/mini/schemas.ts +2051 -0
  366. package/node_modules/zod/src/v4/mini/tests/apply.test.ts +57 -0
  367. package/node_modules/zod/src/v4/mini/tests/assignability.test.ts +190 -0
  368. package/node_modules/zod/src/v4/mini/tests/brand.test.ts +94 -0
  369. package/node_modules/zod/src/v4/mini/tests/checks.test.ts +158 -0
  370. package/node_modules/zod/src/v4/mini/tests/codec.test.ts +582 -0
  371. package/node_modules/zod/src/v4/mini/tests/computed.test.ts +30 -0
  372. package/node_modules/zod/src/v4/mini/tests/cyclic-data.test.ts +84 -0
  373. package/node_modules/zod/src/v4/mini/tests/deep-partial.test.ts +54 -0
  374. package/node_modules/zod/src/v4/mini/tests/error.test.ts +41 -0
  375. package/node_modules/zod/src/v4/mini/tests/functions.test.ts +14 -0
  376. package/node_modules/zod/src/v4/mini/tests/index.test.ts +1146 -0
  377. package/node_modules/zod/src/v4/mini/tests/number.test.ts +109 -0
  378. package/node_modules/zod/src/v4/mini/tests/object.test.ts +292 -0
  379. package/node_modules/zod/src/v4/mini/tests/prototypes.test.ts +43 -0
  380. package/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +341 -0
  381. package/node_modules/zod/src/v4/mini/tests/standard-schema.test.ts +50 -0
  382. package/node_modules/zod/src/v4/mini/tests/string.test.ts +396 -0
  383. package/node_modules/zod/src/v4-mini/index.ts +3 -0
  384. package/node_modules/zod/v3/ZodError.cjs +167 -0
  385. package/node_modules/zod/v3/ZodError.d.cts +164 -0
  386. package/node_modules/zod/v3/ZodError.d.ts +164 -0
  387. package/node_modules/zod/v3/ZodError.js +143 -0
  388. package/node_modules/zod/v3/errors.cjs +36 -0
  389. package/node_modules/zod/v3/errors.d.cts +5 -0
  390. package/node_modules/zod/v3/errors.d.ts +5 -0
  391. package/node_modules/zod/v3/errors.js +9 -0
  392. package/node_modules/zod/v3/external.cjs +41 -0
  393. package/node_modules/zod/v3/external.d.cts +6 -0
  394. package/node_modules/zod/v3/external.d.ts +6 -0
  395. package/node_modules/zod/v3/external.js +6 -0
  396. package/node_modules/zod/v3/helpers/enumUtil.cjs +21 -0
  397. package/node_modules/zod/v3/helpers/enumUtil.d.cts +8 -0
  398. package/node_modules/zod/v3/helpers/enumUtil.d.ts +8 -0
  399. package/node_modules/zod/v3/helpers/enumUtil.js +1 -0
  400. package/node_modules/zod/v3/helpers/errorUtil.cjs +28 -0
  401. package/node_modules/zod/v3/helpers/errorUtil.d.cts +9 -0
  402. package/node_modules/zod/v3/helpers/errorUtil.d.ts +9 -0
  403. package/node_modules/zod/v3/helpers/errorUtil.js +6 -0
  404. package/node_modules/zod/v3/helpers/parseUtil.cjs +143 -0
  405. package/node_modules/zod/v3/helpers/parseUtil.d.cts +78 -0
  406. package/node_modules/zod/v3/helpers/parseUtil.d.ts +78 -0
  407. package/node_modules/zod/v3/helpers/parseUtil.js +109 -0
  408. package/node_modules/zod/v3/helpers/partialUtil.cjs +21 -0
  409. package/node_modules/zod/v3/helpers/partialUtil.d.cts +8 -0
  410. package/node_modules/zod/v3/helpers/partialUtil.d.ts +8 -0
  411. package/node_modules/zod/v3/helpers/partialUtil.js +1 -0
  412. package/node_modules/zod/v3/helpers/typeAliases.cjs +21 -0
  413. package/node_modules/zod/v3/helpers/typeAliases.d.cts +2 -0
  414. package/node_modules/zod/v3/helpers/typeAliases.d.ts +2 -0
  415. package/node_modules/zod/v3/helpers/typeAliases.js +1 -0
  416. package/node_modules/zod/v3/helpers/util.cjs +156 -0
  417. package/node_modules/zod/v3/helpers/util.d.cts +85 -0
  418. package/node_modules/zod/v3/helpers/util.d.ts +85 -0
  419. package/node_modules/zod/v3/helpers/util.js +133 -0
  420. package/node_modules/zod/v3/index.cjs +52 -0
  421. package/node_modules/zod/v3/index.d.cts +4 -0
  422. package/node_modules/zod/v3/index.d.ts +4 -0
  423. package/node_modules/zod/v3/index.js +4 -0
  424. package/node_modules/zod/v3/locales/en.cjs +112 -0
  425. package/node_modules/zod/v3/locales/en.d.cts +3 -0
  426. package/node_modules/zod/v3/locales/en.d.ts +3 -0
  427. package/node_modules/zod/v3/locales/en.js +109 -0
  428. package/node_modules/zod/v3/package.json +7 -0
  429. package/node_modules/zod/v3/standard-schema.cjs +21 -0
  430. package/node_modules/zod/v3/standard-schema.d.cts +102 -0
  431. package/node_modules/zod/v3/standard-schema.d.ts +102 -0
  432. package/node_modules/zod/v3/standard-schema.js +1 -0
  433. package/node_modules/zod/v3/types.cjs +3798 -0
  434. package/node_modules/zod/v3/types.d.cts +1034 -0
  435. package/node_modules/zod/v3/types.d.ts +1034 -0
  436. package/node_modules/zod/v3/types.js +3697 -0
  437. package/node_modules/zod/v4/classic/checks.cjs +53 -0
  438. package/node_modules/zod/v4/classic/checks.d.cts +1 -0
  439. package/node_modules/zod/v4/classic/checks.d.ts +1 -0
  440. package/node_modules/zod/v4/classic/checks.js +1 -0
  441. package/node_modules/zod/v4/classic/coerce.cjs +66 -0
  442. package/node_modules/zod/v4/classic/coerce.d.cts +17 -0
  443. package/node_modules/zod/v4/classic/coerce.d.ts +17 -0
  444. package/node_modules/zod/v4/classic/coerce.js +17 -0
  445. package/node_modules/zod/v4/classic/compat.cjs +80 -0
  446. package/node_modules/zod/v4/classic/compat.d.cts +48 -0
  447. package/node_modules/zod/v4/classic/compat.d.ts +48 -0
  448. package/node_modules/zod/v4/classic/compat.js +31 -0
  449. package/node_modules/zod/v4/classic/deep-partial.cjs +58 -0
  450. package/node_modules/zod/v4/classic/deep-partial.d.cts +14 -0
  451. package/node_modules/zod/v4/classic/deep-partial.d.ts +14 -0
  452. package/node_modules/zod/v4/classic/deep-partial.js +13 -0
  453. package/node_modules/zod/v4/classic/errors.cjs +102 -0
  454. package/node_modules/zod/v4/classic/errors.d.cts +29 -0
  455. package/node_modules/zod/v4/classic/errors.d.ts +29 -0
  456. package/node_modules/zod/v4/classic/errors.js +57 -0
  457. package/node_modules/zod/v4/classic/external.cjs +97 -0
  458. package/node_modules/zod/v4/classic/external.d.cts +19 -0
  459. package/node_modules/zod/v4/classic/external.d.ts +19 -0
  460. package/node_modules/zod/v4/classic/external.js +17 -0
  461. package/node_modules/zod/v4/classic/from-json-schema.cjs +926 -0
  462. package/node_modules/zod/v4/classic/from-json-schema.d.cts +12 -0
  463. package/node_modules/zod/v4/classic/from-json-schema.d.ts +12 -0
  464. package/node_modules/zod/v4/classic/from-json-schema.js +881 -0
  465. package/node_modules/zod/v4/classic/in-out.cjs +82 -0
  466. package/node_modules/zod/v4/classic/in-out.d.cts +8 -0
  467. package/node_modules/zod/v4/classic/in-out.d.ts +8 -0
  468. package/node_modules/zod/v4/classic/in-out.js +36 -0
  469. package/node_modules/zod/v4/classic/index.cjs +52 -0
  470. package/node_modules/zod/v4/classic/index.d.cts +3 -0
  471. package/node_modules/zod/v4/classic/index.d.ts +3 -0
  472. package/node_modules/zod/v4/classic/index.js +4 -0
  473. package/node_modules/zod/v4/classic/iso.cjs +68 -0
  474. package/node_modules/zod/v4/classic/iso.d.cts +7 -0
  475. package/node_modules/zod/v4/classic/iso.d.ts +7 -0
  476. package/node_modules/zod/v4/classic/iso.js +15 -0
  477. package/node_modules/zod/v4/classic/package.json +7 -0
  478. package/node_modules/zod/v4/classic/parse.cjs +63 -0
  479. package/node_modules/zod/v4/classic/parse.d.cts +44 -0
  480. package/node_modules/zod/v4/classic/parse.d.ts +44 -0
  481. package/node_modules/zod/v4/classic/parse.js +16 -0
  482. package/node_modules/zod/v4/classic/schemas.cjs +1676 -0
  483. package/node_modules/zod/v4/classic/schemas.d.cts +816 -0
  484. package/node_modules/zod/v4/classic/schemas.d.ts +816 -0
  485. package/node_modules/zod/v4/classic/schemas.js +1535 -0
  486. package/node_modules/zod/v4/core/api.cjs +1269 -0
  487. package/node_modules/zod/v4/core/api.d.cts +335 -0
  488. package/node_modules/zod/v4/core/api.d.ts +335 -0
  489. package/node_modules/zod/v4/core/api.js +1107 -0
  490. package/node_modules/zod/v4/core/checks.cjs +561 -0
  491. package/node_modules/zod/v4/core/checks.d.cts +294 -0
  492. package/node_modules/zod/v4/core/checks.d.ts +294 -0
  493. package/node_modules/zod/v4/core/checks.js +516 -0
  494. package/node_modules/zod/v4/core/compile.cjs +1916 -0
  495. package/node_modules/zod/v4/core/compile.d.cts +65 -0
  496. package/node_modules/zod/v4/core/compile.d.ts +65 -0
  497. package/node_modules/zod/v4/core/compile.js +1866 -0
  498. package/node_modules/zod/v4/core/core.cjs +167 -0
  499. package/node_modules/zod/v4/core/core.d.cts +82 -0
  500. package/node_modules/zod/v4/core/core.d.ts +82 -0
  501. package/node_modules/zod/v4/core/core.js +141 -0
  502. package/node_modules/zod/v4/core/doc.cjs +61 -0
  503. package/node_modules/zod/v4/core/doc.d.cts +16 -0
  504. package/node_modules/zod/v4/core/doc.d.ts +16 -0
  505. package/node_modules/zod/v4/core/doc.js +38 -0
  506. package/node_modules/zod/v4/core/errors.cjs +317 -0
  507. package/node_modules/zod/v4/core/errors.d.cts +225 -0
  508. package/node_modules/zod/v4/core/errors.d.ts +225 -0
  509. package/node_modules/zod/v4/core/errors.js +267 -0
  510. package/node_modules/zod/v4/core/index.cjs +70 -0
  511. package/node_modules/zod/v4/core/index.d.cts +19 -0
  512. package/node_modules/zod/v4/core/index.d.ts +19 -0
  513. package/node_modules/zod/v4/core/index.js +19 -0
  514. package/node_modules/zod/v4/core/json-schema-generator.cjs +122 -0
  515. package/node_modules/zod/v4/core/json-schema-generator.d.cts +65 -0
  516. package/node_modules/zod/v4/core/json-schema-generator.d.ts +65 -0
  517. package/node_modules/zod/v4/core/json-schema-generator.js +99 -0
  518. package/node_modules/zod/v4/core/json-schema-processors.cjs +929 -0
  519. package/node_modules/zod/v4/core/json-schema-processors.d.cts +65 -0
  520. package/node_modules/zod/v4/core/json-schema-processors.d.ts +65 -0
  521. package/node_modules/zod/v4/core/json-schema-processors.js +843 -0
  522. package/node_modules/zod/v4/core/json-schema.cjs +21 -0
  523. package/node_modules/zod/v4/core/json-schema.d.cts +89 -0
  524. package/node_modules/zod/v4/core/json-schema.d.ts +89 -0
  525. package/node_modules/zod/v4/core/json-schema.js +1 -0
  526. package/node_modules/zod/v4/core/memoizer.cjs +360 -0
  527. package/node_modules/zod/v4/core/memoizer.d.cts +15 -0
  528. package/node_modules/zod/v4/core/memoizer.d.ts +15 -0
  529. package/node_modules/zod/v4/core/memoizer.js +311 -0
  530. package/node_modules/zod/v4/core/package.json +7 -0
  531. package/node_modules/zod/v4/core/parse.cjs +233 -0
  532. package/node_modules/zod/v4/core/parse.d.cts +52 -0
  533. package/node_modules/zod/v4/core/parse.d.ts +52 -0
  534. package/node_modules/zod/v4/core/parse.js +175 -0
  535. package/node_modules/zod/v4/core/regexes.cjs +209 -0
  536. package/node_modules/zod/v4/core/regexes.d.cts +90 -0
  537. package/node_modules/zod/v4/core/regexes.d.ts +90 -0
  538. package/node_modules/zod/v4/core/regexes.js +156 -0
  539. package/node_modules/zod/v4/core/registries.cjs +75 -0
  540. package/node_modules/zod/v4/core/registries.d.cts +35 -0
  541. package/node_modules/zod/v4/core/registries.d.ts +35 -0
  542. package/node_modules/zod/v4/core/registries.js +51 -0
  543. package/node_modules/zod/v4/core/schemas.cjs +2699 -0
  544. package/node_modules/zod/v4/core/schemas.d.cts +1275 -0
  545. package/node_modules/zod/v4/core/schemas.d.ts +1275 -0
  546. package/node_modules/zod/v4/core/schemas.js +2636 -0
  547. package/node_modules/zod/v4/core/standard-schema.cjs +21 -0
  548. package/node_modules/zod/v4/core/standard-schema.d.cts +126 -0
  549. package/node_modules/zod/v4/core/standard-schema.d.ts +126 -0
  550. package/node_modules/zod/v4/core/standard-schema.js +1 -0
  551. package/node_modules/zod/v4/core/to-json-schema.cjs +681 -0
  552. package/node_modules/zod/v4/core/to-json-schema.d.cts +154 -0
  553. package/node_modules/zod/v4/core/to-json-schema.d.ts +154 -0
  554. package/node_modules/zod/v4/core/to-json-schema.js +651 -0
  555. package/node_modules/zod/v4/core/util.cjs +964 -0
  556. package/node_modules/zod/v4/core/util.d.cts +280 -0
  557. package/node_modules/zod/v4/core/util.d.ts +280 -0
  558. package/node_modules/zod/v4/core/util.js +873 -0
  559. package/node_modules/zod/v4/core/versions.cjs +27 -0
  560. package/node_modules/zod/v4/core/versions.d.cts +5 -0
  561. package/node_modules/zod/v4/core/versions.d.ts +5 -0
  562. package/node_modules/zod/v4/core/versions.js +5 -0
  563. package/node_modules/zod/v4/core/visit.cjs +214 -0
  564. package/node_modules/zod/v4/core/visit.d.cts +30 -0
  565. package/node_modules/zod/v4/core/visit.d.ts +30 -0
  566. package/node_modules/zod/v4/core/visit.js +169 -0
  567. package/node_modules/zod/v4/index.cjs +51 -0
  568. package/node_modules/zod/v4/index.d.cts +3 -0
  569. package/node_modules/zod/v4/index.d.ts +3 -0
  570. package/node_modules/zod/v4/index.js +4 -0
  571. package/node_modules/zod/v4/locales/ar.cjs +138 -0
  572. package/node_modules/zod/v4/locales/ar.d.cts +5 -0
  573. package/node_modules/zod/v4/locales/ar.d.ts +4 -0
  574. package/node_modules/zod/v4/locales/ar.js +111 -0
  575. package/node_modules/zod/v4/locales/az.cjs +137 -0
  576. package/node_modules/zod/v4/locales/az.d.cts +5 -0
  577. package/node_modules/zod/v4/locales/az.d.ts +4 -0
  578. package/node_modules/zod/v4/locales/az.js +110 -0
  579. package/node_modules/zod/v4/locales/be.cjs +195 -0
  580. package/node_modules/zod/v4/locales/be.d.cts +5 -0
  581. package/node_modules/zod/v4/locales/be.d.ts +4 -0
  582. package/node_modules/zod/v4/locales/be.js +168 -0
  583. package/node_modules/zod/v4/locales/bg.cjs +152 -0
  584. package/node_modules/zod/v4/locales/bg.d.cts +5 -0
  585. package/node_modules/zod/v4/locales/bg.d.ts +4 -0
  586. package/node_modules/zod/v4/locales/bg.js +125 -0
  587. package/node_modules/zod/v4/locales/bn.cjs +140 -0
  588. package/node_modules/zod/v4/locales/bn.d.cts +5 -0
  589. package/node_modules/zod/v4/locales/bn.d.ts +4 -0
  590. package/node_modules/zod/v4/locales/bn.js +113 -0
  591. package/node_modules/zod/v4/locales/ca.cjs +139 -0
  592. package/node_modules/zod/v4/locales/ca.d.cts +5 -0
  593. package/node_modules/zod/v4/locales/ca.d.ts +4 -0
  594. package/node_modules/zod/v4/locales/ca.js +112 -0
  595. package/node_modules/zod/v4/locales/ckb.cjs +160 -0
  596. package/node_modules/zod/v4/locales/ckb.d.cts +5 -0
  597. package/node_modules/zod/v4/locales/ckb.d.ts +4 -0
  598. package/node_modules/zod/v4/locales/ckb.js +133 -0
  599. package/node_modules/zod/v4/locales/cs.cjs +143 -0
  600. package/node_modules/zod/v4/locales/cs.d.cts +5 -0
  601. package/node_modules/zod/v4/locales/cs.d.ts +4 -0
  602. package/node_modules/zod/v4/locales/cs.js +116 -0
  603. package/node_modules/zod/v4/locales/da.cjs +147 -0
  604. package/node_modules/zod/v4/locales/da.d.cts +5 -0
  605. package/node_modules/zod/v4/locales/da.d.ts +4 -0
  606. package/node_modules/zod/v4/locales/da.js +120 -0
  607. package/node_modules/zod/v4/locales/de.cjs +140 -0
  608. package/node_modules/zod/v4/locales/de.d.cts +5 -0
  609. package/node_modules/zod/v4/locales/de.d.ts +4 -0
  610. package/node_modules/zod/v4/locales/de.js +113 -0
  611. package/node_modules/zod/v4/locales/el.cjs +139 -0
  612. package/node_modules/zod/v4/locales/el.d.cts +5 -0
  613. package/node_modules/zod/v4/locales/el.d.ts +4 -0
  614. package/node_modules/zod/v4/locales/el.js +112 -0
  615. package/node_modules/zod/v4/locales/en.cjs +152 -0
  616. package/node_modules/zod/v4/locales/en.d.cts +5 -0
  617. package/node_modules/zod/v4/locales/en.d.ts +4 -0
  618. package/node_modules/zod/v4/locales/en.js +125 -0
  619. package/node_modules/zod/v4/locales/eo.cjs +141 -0
  620. package/node_modules/zod/v4/locales/eo.d.cts +5 -0
  621. package/node_modules/zod/v4/locales/eo.d.ts +4 -0
  622. package/node_modules/zod/v4/locales/eo.js +114 -0
  623. package/node_modules/zod/v4/locales/es.cjs +163 -0
  624. package/node_modules/zod/v4/locales/es.d.cts +5 -0
  625. package/node_modules/zod/v4/locales/es.d.ts +4 -0
  626. package/node_modules/zod/v4/locales/es.js +136 -0
  627. package/node_modules/zod/v4/locales/fa.cjs +146 -0
  628. package/node_modules/zod/v4/locales/fa.d.cts +5 -0
  629. package/node_modules/zod/v4/locales/fa.d.ts +4 -0
  630. package/node_modules/zod/v4/locales/fa.js +119 -0
  631. package/node_modules/zod/v4/locales/fi.cjs +144 -0
  632. package/node_modules/zod/v4/locales/fi.d.cts +5 -0
  633. package/node_modules/zod/v4/locales/fi.d.ts +4 -0
  634. package/node_modules/zod/v4/locales/fi.js +117 -0
  635. package/node_modules/zod/v4/locales/fr-CA.cjs +139 -0
  636. package/node_modules/zod/v4/locales/fr-CA.d.cts +5 -0
  637. package/node_modules/zod/v4/locales/fr-CA.d.ts +4 -0
  638. package/node_modules/zod/v4/locales/fr-CA.js +112 -0
  639. package/node_modules/zod/v4/locales/fr.cjs +156 -0
  640. package/node_modules/zod/v4/locales/fr.d.cts +5 -0
  641. package/node_modules/zod/v4/locales/fr.d.ts +4 -0
  642. package/node_modules/zod/v4/locales/fr.js +129 -0
  643. package/node_modules/zod/v4/locales/gu.cjs +140 -0
  644. package/node_modules/zod/v4/locales/gu.d.cts +5 -0
  645. package/node_modules/zod/v4/locales/gu.d.ts +4 -0
  646. package/node_modules/zod/v4/locales/gu.js +113 -0
  647. package/node_modules/zod/v4/locales/he.cjs +248 -0
  648. package/node_modules/zod/v4/locales/he.d.cts +5 -0
  649. package/node_modules/zod/v4/locales/he.d.ts +4 -0
  650. package/node_modules/zod/v4/locales/he.js +221 -0
  651. package/node_modules/zod/v4/locales/hi.cjs +138 -0
  652. package/node_modules/zod/v4/locales/hi.d.cts +5 -0
  653. package/node_modules/zod/v4/locales/hi.d.ts +4 -0
  654. package/node_modules/zod/v4/locales/hi.js +111 -0
  655. package/node_modules/zod/v4/locales/hr.cjs +153 -0
  656. package/node_modules/zod/v4/locales/hr.d.cts +5 -0
  657. package/node_modules/zod/v4/locales/hr.d.ts +4 -0
  658. package/node_modules/zod/v4/locales/hr.js +126 -0
  659. package/node_modules/zod/v4/locales/hu.cjs +140 -0
  660. package/node_modules/zod/v4/locales/hu.d.cts +5 -0
  661. package/node_modules/zod/v4/locales/hu.d.ts +4 -0
  662. package/node_modules/zod/v4/locales/hu.js +113 -0
  663. package/node_modules/zod/v4/locales/hy.cjs +185 -0
  664. package/node_modules/zod/v4/locales/hy.d.cts +5 -0
  665. package/node_modules/zod/v4/locales/hy.d.ts +4 -0
  666. package/node_modules/zod/v4/locales/hy.js +158 -0
  667. package/node_modules/zod/v4/locales/id.cjs +138 -0
  668. package/node_modules/zod/v4/locales/id.d.cts +5 -0
  669. package/node_modules/zod/v4/locales/id.d.ts +4 -0
  670. package/node_modules/zod/v4/locales/id.js +111 -0
  671. package/node_modules/zod/v4/locales/index.cjs +152 -0
  672. package/node_modules/zod/v4/locales/index.d.cts +63 -0
  673. package/node_modules/zod/v4/locales/index.d.ts +63 -0
  674. package/node_modules/zod/v4/locales/index.js +63 -0
  675. package/node_modules/zod/v4/locales/is.cjs +141 -0
  676. package/node_modules/zod/v4/locales/is.d.cts +5 -0
  677. package/node_modules/zod/v4/locales/is.d.ts +4 -0
  678. package/node_modules/zod/v4/locales/is.js +114 -0
  679. package/node_modules/zod/v4/locales/it.cjs +140 -0
  680. package/node_modules/zod/v4/locales/it.d.cts +5 -0
  681. package/node_modules/zod/v4/locales/it.d.ts +4 -0
  682. package/node_modules/zod/v4/locales/it.js +113 -0
  683. package/node_modules/zod/v4/locales/ja.cjs +139 -0
  684. package/node_modules/zod/v4/locales/ja.d.cts +5 -0
  685. package/node_modules/zod/v4/locales/ja.d.ts +4 -0
  686. package/node_modules/zod/v4/locales/ja.js +112 -0
  687. package/node_modules/zod/v4/locales/ka.cjs +144 -0
  688. package/node_modules/zod/v4/locales/ka.d.cts +5 -0
  689. package/node_modules/zod/v4/locales/ka.d.ts +4 -0
  690. package/node_modules/zod/v4/locales/ka.js +117 -0
  691. package/node_modules/zod/v4/locales/kh.cjs +12 -0
  692. package/node_modules/zod/v4/locales/kh.d.cts +5 -0
  693. package/node_modules/zod/v4/locales/kh.d.ts +5 -0
  694. package/node_modules/zod/v4/locales/kh.js +5 -0
  695. package/node_modules/zod/v4/locales/km.cjs +142 -0
  696. package/node_modules/zod/v4/locales/km.d.cts +5 -0
  697. package/node_modules/zod/v4/locales/km.d.ts +4 -0
  698. package/node_modules/zod/v4/locales/km.js +115 -0
  699. package/node_modules/zod/v4/locales/kn.cjs +143 -0
  700. package/node_modules/zod/v4/locales/kn.d.cts +5 -0
  701. package/node_modules/zod/v4/locales/kn.d.ts +4 -0
  702. package/node_modules/zod/v4/locales/kn.js +116 -0
  703. package/node_modules/zod/v4/locales/ko.cjs +143 -0
  704. package/node_modules/zod/v4/locales/ko.d.cts +5 -0
  705. package/node_modules/zod/v4/locales/ko.d.ts +4 -0
  706. package/node_modules/zod/v4/locales/ko.js +116 -0
  707. package/node_modules/zod/v4/locales/lt.cjs +234 -0
  708. package/node_modules/zod/v4/locales/lt.d.cts +5 -0
  709. package/node_modules/zod/v4/locales/lt.d.ts +4 -0
  710. package/node_modules/zod/v4/locales/lt.js +207 -0
  711. package/node_modules/zod/v4/locales/mk.cjs +141 -0
  712. package/node_modules/zod/v4/locales/mk.d.cts +5 -0
  713. package/node_modules/zod/v4/locales/mk.d.ts +4 -0
  714. package/node_modules/zod/v4/locales/mk.js +114 -0
  715. package/node_modules/zod/v4/locales/ms.cjs +139 -0
  716. package/node_modules/zod/v4/locales/ms.d.cts +5 -0
  717. package/node_modules/zod/v4/locales/ms.d.ts +4 -0
  718. package/node_modules/zod/v4/locales/ms.js +112 -0
  719. package/node_modules/zod/v4/locales/ne.cjs +138 -0
  720. package/node_modules/zod/v4/locales/ne.d.cts +5 -0
  721. package/node_modules/zod/v4/locales/ne.d.ts +4 -0
  722. package/node_modules/zod/v4/locales/ne.js +111 -0
  723. package/node_modules/zod/v4/locales/nl.cjs +142 -0
  724. package/node_modules/zod/v4/locales/nl.d.cts +5 -0
  725. package/node_modules/zod/v4/locales/nl.d.ts +4 -0
  726. package/node_modules/zod/v4/locales/nl.js +115 -0
  727. package/node_modules/zod/v4/locales/nn.cjs +140 -0
  728. package/node_modules/zod/v4/locales/nn.d.cts +5 -0
  729. package/node_modules/zod/v4/locales/nn.d.ts +4 -0
  730. package/node_modules/zod/v4/locales/nn.js +113 -0
  731. package/node_modules/zod/v4/locales/no.cjs +140 -0
  732. package/node_modules/zod/v4/locales/no.d.cts +5 -0
  733. package/node_modules/zod/v4/locales/no.d.ts +4 -0
  734. package/node_modules/zod/v4/locales/no.js +113 -0
  735. package/node_modules/zod/v4/locales/ota.cjs +141 -0
  736. package/node_modules/zod/v4/locales/ota.d.cts +5 -0
  737. package/node_modules/zod/v4/locales/ota.d.ts +4 -0
  738. package/node_modules/zod/v4/locales/ota.js +114 -0
  739. package/node_modules/zod/v4/locales/package.json +7 -0
  740. package/node_modules/zod/v4/locales/pl.cjs +141 -0
  741. package/node_modules/zod/v4/locales/pl.d.cts +5 -0
  742. package/node_modules/zod/v4/locales/pl.d.ts +4 -0
  743. package/node_modules/zod/v4/locales/pl.js +114 -0
  744. package/node_modules/zod/v4/locales/ps.cjs +146 -0
  745. package/node_modules/zod/v4/locales/ps.d.cts +5 -0
  746. package/node_modules/zod/v4/locales/ps.d.ts +4 -0
  747. package/node_modules/zod/v4/locales/ps.js +119 -0
  748. package/node_modules/zod/v4/locales/pt-BR.cjs +170 -0
  749. package/node_modules/zod/v4/locales/pt-BR.d.cts +5 -0
  750. package/node_modules/zod/v4/locales/pt-BR.d.ts +4 -0
  751. package/node_modules/zod/v4/locales/pt-BR.js +143 -0
  752. package/node_modules/zod/v4/locales/pt.cjs +169 -0
  753. package/node_modules/zod/v4/locales/pt.d.cts +5 -0
  754. package/node_modules/zod/v4/locales/pt.d.ts +4 -0
  755. package/node_modules/zod/v4/locales/pt.js +142 -0
  756. package/node_modules/zod/v4/locales/ro.cjs +149 -0
  757. package/node_modules/zod/v4/locales/ro.d.cts +5 -0
  758. package/node_modules/zod/v4/locales/ro.d.ts +4 -0
  759. package/node_modules/zod/v4/locales/ro.js +122 -0
  760. package/node_modules/zod/v4/locales/ru.cjs +195 -0
  761. package/node_modules/zod/v4/locales/ru.d.cts +5 -0
  762. package/node_modules/zod/v4/locales/ru.d.ts +4 -0
  763. package/node_modules/zod/v4/locales/ru.js +168 -0
  764. package/node_modules/zod/v4/locales/sk.cjs +143 -0
  765. package/node_modules/zod/v4/locales/sk.d.cts +5 -0
  766. package/node_modules/zod/v4/locales/sk.d.ts +4 -0
  767. package/node_modules/zod/v4/locales/sk.js +116 -0
  768. package/node_modules/zod/v4/locales/sl.cjs +141 -0
  769. package/node_modules/zod/v4/locales/sl.d.cts +5 -0
  770. package/node_modules/zod/v4/locales/sl.d.ts +4 -0
  771. package/node_modules/zod/v4/locales/sl.js +114 -0
  772. package/node_modules/zod/v4/locales/sv.cjs +142 -0
  773. package/node_modules/zod/v4/locales/sv.d.cts +5 -0
  774. package/node_modules/zod/v4/locales/sv.d.ts +4 -0
  775. package/node_modules/zod/v4/locales/sv.js +115 -0
  776. package/node_modules/zod/v4/locales/ta.cjs +142 -0
  777. package/node_modules/zod/v4/locales/ta.d.cts +5 -0
  778. package/node_modules/zod/v4/locales/ta.d.ts +4 -0
  779. package/node_modules/zod/v4/locales/ta.js +115 -0
  780. package/node_modules/zod/v4/locales/tg.cjs +144 -0
  781. package/node_modules/zod/v4/locales/tg.d.cts +5 -0
  782. package/node_modules/zod/v4/locales/tg.d.ts +4 -0
  783. package/node_modules/zod/v4/locales/tg.js +117 -0
  784. package/node_modules/zod/v4/locales/th.cjs +142 -0
  785. package/node_modules/zod/v4/locales/th.d.cts +5 -0
  786. package/node_modules/zod/v4/locales/th.d.ts +4 -0
  787. package/node_modules/zod/v4/locales/th.js +115 -0
  788. package/node_modules/zod/v4/locales/tk.cjs +134 -0
  789. package/node_modules/zod/v4/locales/tk.d.cts +5 -0
  790. package/node_modules/zod/v4/locales/tk.d.ts +4 -0
  791. package/node_modules/zod/v4/locales/tk.js +107 -0
  792. package/node_modules/zod/v4/locales/tr.cjs +137 -0
  793. package/node_modules/zod/v4/locales/tr.d.cts +5 -0
  794. package/node_modules/zod/v4/locales/tr.d.ts +4 -0
  795. package/node_modules/zod/v4/locales/tr.js +110 -0
  796. package/node_modules/zod/v4/locales/ua.cjs +12 -0
  797. package/node_modules/zod/v4/locales/ua.d.cts +5 -0
  798. package/node_modules/zod/v4/locales/ua.d.ts +5 -0
  799. package/node_modules/zod/v4/locales/ua.js +5 -0
  800. package/node_modules/zod/v4/locales/uk.cjs +140 -0
  801. package/node_modules/zod/v4/locales/uk.d.cts +5 -0
  802. package/node_modules/zod/v4/locales/uk.d.ts +4 -0
  803. package/node_modules/zod/v4/locales/uk.js +113 -0
  804. package/node_modules/zod/v4/locales/ur.cjs +142 -0
  805. package/node_modules/zod/v4/locales/ur.d.cts +5 -0
  806. package/node_modules/zod/v4/locales/ur.d.ts +4 -0
  807. package/node_modules/zod/v4/locales/ur.js +115 -0
  808. package/node_modules/zod/v4/locales/uz.cjs +140 -0
  809. package/node_modules/zod/v4/locales/uz.d.cts +5 -0
  810. package/node_modules/zod/v4/locales/uz.d.ts +4 -0
  811. package/node_modules/zod/v4/locales/uz.js +113 -0
  812. package/node_modules/zod/v4/locales/vi.cjs +140 -0
  813. package/node_modules/zod/v4/locales/vi.d.cts +5 -0
  814. package/node_modules/zod/v4/locales/vi.d.ts +4 -0
  815. package/node_modules/zod/v4/locales/vi.js +113 -0
  816. package/node_modules/zod/v4/locales/yo.cjs +139 -0
  817. package/node_modules/zod/v4/locales/yo.d.cts +5 -0
  818. package/node_modules/zod/v4/locales/yo.d.ts +4 -0
  819. package/node_modules/zod/v4/locales/yo.js +112 -0
  820. package/node_modules/zod/v4/locales/zh-CN.cjs +141 -0
  821. package/node_modules/zod/v4/locales/zh-CN.d.cts +5 -0
  822. package/node_modules/zod/v4/locales/zh-CN.d.ts +4 -0
  823. package/node_modules/zod/v4/locales/zh-CN.js +114 -0
  824. package/node_modules/zod/v4/locales/zh-TW.cjs +139 -0
  825. package/node_modules/zod/v4/locales/zh-TW.d.cts +5 -0
  826. package/node_modules/zod/v4/locales/zh-TW.d.ts +4 -0
  827. package/node_modules/zod/v4/locales/zh-TW.js +112 -0
  828. package/node_modules/zod/v4/mini/checks.cjs +54 -0
  829. package/node_modules/zod/v4/mini/checks.d.cts +1 -0
  830. package/node_modules/zod/v4/mini/checks.d.ts +1 -0
  831. package/node_modules/zod/v4/mini/checks.js +1 -0
  832. package/node_modules/zod/v4/mini/coerce.cjs +71 -0
  833. package/node_modules/zod/v4/mini/coerce.d.cts +7 -0
  834. package/node_modules/zod/v4/mini/coerce.d.ts +7 -0
  835. package/node_modules/zod/v4/mini/coerce.js +22 -0
  836. package/node_modules/zod/v4/mini/deep-partial.cjs +58 -0
  837. package/node_modules/zod/v4/mini/deep-partial.d.cts +14 -0
  838. package/node_modules/zod/v4/mini/deep-partial.d.ts +14 -0
  839. package/node_modules/zod/v4/mini/deep-partial.js +13 -0
  840. package/node_modules/zod/v4/mini/external.cjs +95 -0
  841. package/node_modules/zod/v4/mini/external.d.cts +16 -0
  842. package/node_modules/zod/v4/mini/external.d.ts +16 -0
  843. package/node_modules/zod/v4/mini/external.js +16 -0
  844. package/node_modules/zod/v4/mini/in-out.cjs +82 -0
  845. package/node_modules/zod/v4/mini/in-out.d.cts +8 -0
  846. package/node_modules/zod/v4/mini/in-out.d.ts +8 -0
  847. package/node_modules/zod/v4/mini/in-out.js +36 -0
  848. package/node_modules/zod/v4/mini/index.cjs +51 -0
  849. package/node_modules/zod/v4/mini/index.d.cts +3 -0
  850. package/node_modules/zod/v4/mini/index.d.ts +3 -0
  851. package/node_modules/zod/v4/mini/index.js +3 -0
  852. package/node_modules/zod/v4/mini/iso.cjs +83 -0
  853. package/node_modules/zod/v4/mini/iso.d.cts +22 -0
  854. package/node_modules/zod/v4/mini/iso.d.ts +22 -0
  855. package/node_modules/zod/v4/mini/iso.js +34 -0
  856. package/node_modules/zod/v4/mini/package.json +7 -0
  857. package/node_modules/zod/v4/mini/parse.cjs +37 -0
  858. package/node_modules/zod/v4/mini/parse.d.cts +1 -0
  859. package/node_modules/zod/v4/mini/parse.d.ts +1 -0
  860. package/node_modules/zod/v4/mini/parse.js +1 -0
  861. package/node_modules/zod/v4/mini/schemas.cjs +1147 -0
  862. package/node_modules/zod/v4/mini/schemas.d.cts +480 -0
  863. package/node_modules/zod/v4/mini/schemas.d.ts +480 -0
  864. package/node_modules/zod/v4/mini/schemas.js +1002 -0
  865. package/node_modules/zod/v4/package.json +7 -0
  866. package/node_modules/zod/v4-mini/index.cjs +51 -0
  867. package/node_modules/zod/v4-mini/index.d.cts +3 -0
  868. package/node_modules/zod/v4-mini/index.d.ts +3 -0
  869. package/node_modules/zod/v4-mini/index.js +3 -0
  870. package/node_modules/zod/v4-mini/package.json +7 -0
  871. package/package.json +2 -5
  872. package/dist/standard-schema.d.ts +0 -3
  873. package/dist/standard-schema.js +0 -21
  874. package/node_modules/@valibot/to-json-schema/LICENSE.md +0 -9
  875. package/node_modules/@valibot/to-json-schema/README.md +0 -475
  876. package/node_modules/@valibot/to-json-schema/dist/index.cjs +0 -800
  877. package/node_modules/@valibot/to-json-schema/dist/index.d.cts +0 -991
  878. package/node_modules/@valibot/to-json-schema/dist/index.d.mts +0 -991
  879. package/node_modules/@valibot/to-json-schema/dist/index.min.cjs +0 -1
  880. package/node_modules/@valibot/to-json-schema/dist/index.min.mjs +0 -1
  881. package/node_modules/@valibot/to-json-schema/dist/index.mjs +0 -795
  882. package/node_modules/@valibot/to-json-schema/package.json +0 -75
  883. package/node_modules/valibot/LICENSE.md +0 -9
  884. package/node_modules/valibot/README.md +0 -94
  885. package/node_modules/valibot/dist/index.cjs +0 -7897
  886. package/node_modules/valibot/dist/index.d.cts +0 -16579
  887. package/node_modules/valibot/dist/index.d.mts +0 -16579
  888. package/node_modules/valibot/dist/index.min.cjs +0 -2
  889. package/node_modules/valibot/dist/index.min.mjs +0 -2
  890. package/node_modules/valibot/dist/index.mjs +0 -7577
  891. package/node_modules/valibot/package.json +0 -84
@@ -1,800 +0,0 @@
1
-
2
- //#region src/utils/addError.ts
3
- /**
4
- * Adds an error message to the errors array.
5
- *
6
- * @param errors The array of error messages.
7
- * @param message The error message to add.
8
- *
9
- * @returns The new errors.
10
- */
11
- function addError(errors, message) {
12
- if (errors) {
13
- errors.push(message);
14
- return errors;
15
- }
16
- return [message];
17
- }
18
-
19
- //#endregion
20
- //#region src/utils/escapeRegExp.ts
21
- const ESCAPE_REGEX = /[.*+?^${}()|[\]\\]/g;
22
- /**
23
- * Escapes special regex characters in a string.
24
- *
25
- * @param string The string to escape.
26
- *
27
- * @returns The escaped string.
28
- */
29
- function escapeRegExp(string) {
30
- return string.replace(ESCAPE_REGEX, "\\$&");
31
- }
32
-
33
- //#endregion
34
- //#region src/utils/handleError.ts
35
- /**
36
- * Throws an error or logs a warning based on the configuration.
37
- *
38
- * @param message The message to throw or log.
39
- * @param config The conversion configuration.
40
- */
41
- function handleError(message, config) {
42
- switch (config?.errorMode) {
43
- case "ignore": break;
44
- case "warn":
45
- console.warn(message);
46
- break;
47
- default: throw new Error(message);
48
- }
49
- }
50
-
51
- //#endregion
52
- //#region src/utils/isJsonConstValue.ts
53
- /**
54
- * Whether a value is JSON compatible for a const keyword.
55
- *
56
- * @param value The value to check.
57
- *
58
- * @returns Whether the value is JSON compatible.
59
- */
60
- function isJsonConstValue(value) {
61
- return typeof value === "boolean" || typeof value === "number" && Number.isFinite(value) || typeof value === "string";
62
- }
63
-
64
- //#endregion
65
- //#region src/utils/isJsonEnumValues.ts
66
- /**
67
- * Whether values are JSON compatible for an enum keyword.
68
- *
69
- * @param values The values to check.
70
- *
71
- * @returns Whether the values are JSON compatible.
72
- */
73
- function isJsonEnumValues(values) {
74
- return values.every(isJsonConstValue);
75
- }
76
-
77
- //#endregion
78
- //#region src/utils/ReferenceMap.ts
79
- /**
80
- * Schema reference map with collision-free reference ID allocation.
81
- */
82
- var ReferenceMap = class extends Map {
83
- /**
84
- * Creates an empty schema reference map.
85
- */
86
- constructor() {
87
- super();
88
- this.count = 0;
89
- this.usedIds = /* @__PURE__ */ new Set();
90
- }
91
- /**
92
- * Adds a schema reference and reserves its ID.
93
- *
94
- * @param schema The Valibot schema.
95
- * @param referenceId The reference ID.
96
- *
97
- * @returns The reference map.
98
- */
99
- set(schema, referenceId) {
100
- this.usedIds.add(referenceId);
101
- return super.set(schema, referenceId);
102
- }
103
- /**
104
- * Creates a reference ID that is not yet used.
105
- *
106
- * @param definitions The JSON Schema definitions.
107
- *
108
- * @returns The unused reference ID.
109
- */
110
- createId(definitions) {
111
- while (this.usedIds.has(`${this.count}`) || `${this.count}` in definitions) this.count++;
112
- return `${this.count++}`;
113
- }
114
- };
115
-
116
- //#endregion
117
- //#region src/converters/convertAction/convertAction.ts
118
- /**
119
- * Returns the stricter lower bound.
120
- *
121
- * @param current The current lower bound.
122
- * @param value The new lower bound.
123
- *
124
- * @returns The stricter lower bound.
125
- */
126
- function getLowerBound(current, value) {
127
- if (typeof current !== "number" || !Number.isFinite(current) || value > current) return value;
128
- return current;
129
- }
130
- /**
131
- * Returns the stricter upper bound.
132
- *
133
- * @param current The current upper bound.
134
- * @param value The new upper bound.
135
- *
136
- * @returns The stricter upper bound.
137
- */
138
- function getUpperBound(current, value) {
139
- if (typeof current !== "number" || !Number.isFinite(current) || value < current) return value;
140
- return current;
141
- }
142
- /**
143
- * Returns the combined not restriction.
144
- *
145
- * @param current The current not restriction.
146
- * @param value The new not restriction.
147
- *
148
- * @returns The combined not restriction.
149
- */
150
- /* @__NO_SIDE_EFFECTS__ */
151
- function getNotRestriction(current, value) {
152
- return current !== void 0 ? { anyOf: [current, value] } : value;
153
- }
154
- /**
155
- * Intersects allowed values with an existing enum restriction.
156
- *
157
- * @param jsonSchema The JSON Schema object.
158
- * @param values The allowed values.
159
- */
160
- function intersectEnum(jsonSchema, values) {
161
- let enumValues = jsonSchema.enum ?? values;
162
- if (jsonSchema.enum) {
163
- const valueSet = new Set(values);
164
- enumValues = enumValues.filter((value) => valueSet.has(value));
165
- }
166
- if (enumValues.length) jsonSchema.enum = [...new Set(enumValues)];
167
- else {
168
- delete jsonSchema.enum;
169
- jsonSchema.not = /* @__PURE__ */ getNotRestriction(jsonSchema.not, {});
170
- }
171
- }
172
- /**
173
- * Converts any supported Valibot action to the JSON Schema format.
174
- *
175
- * @param jsonSchema The JSON Schema object.
176
- * @param valibotAction The Valibot action object.
177
- * @param config The conversion configuration.
178
- *
179
- * @returns The converted JSON Schema.
180
- */
181
- function convertAction(jsonSchema, valibotAction, config) {
182
- if (config?.ignoreActions?.includes(valibotAction.type)) return jsonSchema;
183
- let errors;
184
- switch (valibotAction.type) {
185
- case "base64":
186
- jsonSchema.contentEncoding = "base64";
187
- break;
188
- case "bic":
189
- case "cuid2":
190
- case "decimal":
191
- case "digits":
192
- case "domain":
193
- case "emoji":
194
- case "hash":
195
- case "hexadecimal":
196
- case "hex_color":
197
- case "isrc":
198
- case "iso_time_second":
199
- case "iso_week":
200
- case "ksuid":
201
- case "mac":
202
- case "mac48":
203
- case "mac64":
204
- case "nanoid":
205
- case "octal":
206
- case "slug":
207
- case "ulid":
208
- if (jsonSchema.pattern) errors = addError(errors, `The "${valibotAction.type}" action is not supported in combination with another regex action.`);
209
- else jsonSchema.pattern = valibotAction.requirement.source;
210
- break;
211
- case "description":
212
- jsonSchema.description = valibotAction.description;
213
- break;
214
- case "email":
215
- case "rfc_email":
216
- jsonSchema.format = "email";
217
- break;
218
- case "ends_with":
219
- if (jsonSchema.pattern) errors = addError(errors, `The "${valibotAction.type}" action is not supported in combination with another regex action.`);
220
- else jsonSchema.pattern = `${escapeRegExp(valibotAction.requirement)}$`;
221
- break;
222
- case "empty":
223
- if (jsonSchema.type === "array") jsonSchema.maxItems = 0;
224
- else {
225
- if (jsonSchema.type !== "string") errors = addError(errors, `The "${valibotAction.type}" action is not supported on type "${jsonSchema.type}".`);
226
- jsonSchema.maxLength = 0;
227
- }
228
- break;
229
- case "entries":
230
- if (!Number.isInteger(valibotAction.requirement) || valibotAction.requirement < 0) {
231
- errors = addError(errors, "The requirement of the \"entries\" action must be a non-negative integer.");
232
- break;
233
- }
234
- jsonSchema.minProperties = getLowerBound(jsonSchema.minProperties, valibotAction.requirement);
235
- jsonSchema.maxProperties = getUpperBound(jsonSchema.maxProperties, valibotAction.requirement);
236
- break;
237
- case "examples":
238
- if (Array.isArray(jsonSchema.examples)) jsonSchema.examples = [...jsonSchema.examples, ...valibotAction.examples];
239
- else jsonSchema.examples = valibotAction.examples;
240
- break;
241
- case "gt_value":
242
- if (jsonSchema.type !== "number" && jsonSchema.type !== "integer") {
243
- errors = addError(errors, `The "gt_value" action is not supported on type "${jsonSchema.type}".`);
244
- break;
245
- }
246
- if (!Number.isFinite(valibotAction.requirement)) {
247
- errors = addError(errors, "The requirement of the \"gt_value\" action is not JSON compatible.");
248
- break;
249
- }
250
- if (config?.target === "openapi-3.0") {
251
- errors = addError(errors, "The \"gt_value\" action is not supported for OpenAPI 3.0.");
252
- break;
253
- }
254
- jsonSchema.exclusiveMinimum = getLowerBound(jsonSchema.exclusiveMinimum, valibotAction.requirement);
255
- break;
256
- case "includes":
257
- if (jsonSchema.pattern) errors = addError(errors, `The "${valibotAction.type}" action is not supported in combination with another regex action.`);
258
- else jsonSchema.pattern = escapeRegExp(valibotAction.requirement);
259
- break;
260
- case "integer":
261
- jsonSchema.type = "integer";
262
- break;
263
- case "ipv4":
264
- jsonSchema.format = "ipv4";
265
- break;
266
- case "ipv6":
267
- jsonSchema.format = "ipv6";
268
- break;
269
- case "iso_date":
270
- jsonSchema.format = "date";
271
- break;
272
- case "iso_date_time":
273
- case "iso_timestamp":
274
- jsonSchema.format = "date-time";
275
- break;
276
- case "iso_time":
277
- jsonSchema.format = "time";
278
- break;
279
- case "jws_compact":
280
- if (jsonSchema.pattern) errors = addError(errors, `The "${valibotAction.type}" action is not supported in combination with another regex action.`);
281
- else jsonSchema.pattern = valibotAction.requirement.source;
282
- break;
283
- case "length":
284
- if (!Number.isInteger(valibotAction.requirement) || valibotAction.requirement < 0) {
285
- errors = addError(errors, "The requirement of the \"length\" action must be a non-negative integer.");
286
- break;
287
- }
288
- if (jsonSchema.type === "array") {
289
- jsonSchema.minItems = getLowerBound(jsonSchema.minItems, valibotAction.requirement);
290
- jsonSchema.maxItems = getUpperBound(jsonSchema.maxItems, valibotAction.requirement);
291
- } else {
292
- if (jsonSchema.type !== "string") errors = addError(errors, `The "${valibotAction.type}" action is not supported on type "${jsonSchema.type}".`);
293
- jsonSchema.minLength = getLowerBound(jsonSchema.minLength, valibotAction.requirement);
294
- jsonSchema.maxLength = getUpperBound(jsonSchema.maxLength, valibotAction.requirement);
295
- }
296
- break;
297
- case "lt_value":
298
- if (jsonSchema.type !== "number" && jsonSchema.type !== "integer") {
299
- errors = addError(errors, `The "lt_value" action is not supported on type "${jsonSchema.type}".`);
300
- break;
301
- }
302
- if (!Number.isFinite(valibotAction.requirement)) {
303
- errors = addError(errors, "The requirement of the \"lt_value\" action is not JSON compatible.");
304
- break;
305
- }
306
- if (config?.target === "openapi-3.0") {
307
- errors = addError(errors, "The \"lt_value\" action is not supported for OpenAPI 3.0.");
308
- break;
309
- }
310
- jsonSchema.exclusiveMaximum = getUpperBound(jsonSchema.exclusiveMaximum, valibotAction.requirement);
311
- break;
312
- case "max_entries":
313
- if (!Number.isInteger(valibotAction.requirement) || valibotAction.requirement < 0) {
314
- errors = addError(errors, "The requirement of the \"max_entries\" action must be a non-negative integer.");
315
- break;
316
- }
317
- jsonSchema.maxProperties = getUpperBound(jsonSchema.maxProperties, valibotAction.requirement);
318
- break;
319
- case "max_length":
320
- if (!Number.isInteger(valibotAction.requirement) || valibotAction.requirement < 0) {
321
- errors = addError(errors, "The requirement of the \"max_length\" action must be a non-negative integer.");
322
- break;
323
- }
324
- if (jsonSchema.type === "array") jsonSchema.maxItems = getUpperBound(jsonSchema.maxItems, valibotAction.requirement);
325
- else {
326
- if (jsonSchema.type !== "string") errors = addError(errors, `The "${valibotAction.type}" action is not supported on type "${jsonSchema.type}".`);
327
- jsonSchema.maxLength = getUpperBound(jsonSchema.maxLength, valibotAction.requirement);
328
- }
329
- break;
330
- case "max_value":
331
- if (jsonSchema.type !== "number" && jsonSchema.type !== "integer") {
332
- errors = addError(errors, `The "max_value" action is not supported on type "${jsonSchema.type}".`);
333
- break;
334
- }
335
- if (!Number.isFinite(valibotAction.requirement)) {
336
- errors = addError(errors, "The requirement of the \"max_value\" action is not JSON compatible.");
337
- break;
338
- }
339
- jsonSchema.maximum = getUpperBound(jsonSchema.maximum, valibotAction.requirement);
340
- break;
341
- case "metadata":
342
- if (typeof valibotAction.metadata.title === "string") jsonSchema.title = valibotAction.metadata.title;
343
- if (typeof valibotAction.metadata.description === "string") jsonSchema.description = valibotAction.metadata.description;
344
- if (Array.isArray(valibotAction.metadata.examples)) if (Array.isArray(jsonSchema.examples)) jsonSchema.examples = [...jsonSchema.examples, ...valibotAction.metadata.examples];
345
- else jsonSchema.examples = valibotAction.metadata.examples;
346
- for (const key of Object.keys(valibotAction.metadata)) if (key !== "title" && key !== "description" && key !== "examples" && key !== "__proto__") jsonSchema[key] = valibotAction.metadata[key];
347
- break;
348
- case "min_entries":
349
- if (!Number.isInteger(valibotAction.requirement) || valibotAction.requirement < 0) {
350
- errors = addError(errors, "The requirement of the \"min_entries\" action must be a non-negative integer.");
351
- break;
352
- }
353
- jsonSchema.minProperties = getLowerBound(jsonSchema.minProperties, valibotAction.requirement);
354
- break;
355
- case "min_length":
356
- if (!Number.isInteger(valibotAction.requirement) || valibotAction.requirement < 0) {
357
- errors = addError(errors, "The requirement of the \"min_length\" action must be a non-negative integer.");
358
- break;
359
- }
360
- if (jsonSchema.type === "array") jsonSchema.minItems = getLowerBound(jsonSchema.minItems, valibotAction.requirement);
361
- else {
362
- if (jsonSchema.type !== "string") errors = addError(errors, `The "${valibotAction.type}" action is not supported on type "${jsonSchema.type}".`);
363
- jsonSchema.minLength = getLowerBound(jsonSchema.minLength, valibotAction.requirement);
364
- }
365
- break;
366
- case "min_value":
367
- if (jsonSchema.type !== "number" && jsonSchema.type !== "integer") {
368
- errors = addError(errors, `The "min_value" action is not supported on type "${jsonSchema.type}".`);
369
- break;
370
- }
371
- if (!Number.isFinite(valibotAction.requirement)) {
372
- errors = addError(errors, "The requirement of the \"min_value\" action is not JSON compatible.");
373
- break;
374
- }
375
- jsonSchema.minimum = getLowerBound(jsonSchema.minimum, valibotAction.requirement);
376
- break;
377
- case "multiple_of":
378
- jsonSchema.multipleOf = valibotAction.requirement;
379
- break;
380
- case "non_empty":
381
- if (jsonSchema.type === "array") jsonSchema.minItems = getLowerBound(jsonSchema.minItems, 1);
382
- else {
383
- if (jsonSchema.type !== "string") errors = addError(errors, `The "${valibotAction.type}" action is not supported on type "${jsonSchema.type}".`);
384
- jsonSchema.minLength = getLowerBound(jsonSchema.minLength, 1);
385
- }
386
- break;
387
- case "not_value":
388
- if (!isJsonConstValue(valibotAction.requirement)) {
389
- errors = addError(errors, "The requirement of the \"not_value\" action is not JSON compatible.");
390
- break;
391
- }
392
- jsonSchema.not = /* @__PURE__ */ getNotRestriction(jsonSchema.not, config?.target === "openapi-3.0" ? { enum: [valibotAction.requirement] } : { const: valibotAction.requirement });
393
- break;
394
- case "not_values":
395
- if (!isJsonEnumValues(valibotAction.requirement)) {
396
- errors = addError(errors, "A requirement of the \"not_values\" action is not JSON compatible.");
397
- break;
398
- }
399
- if (valibotAction.requirement.length) jsonSchema.not = /* @__PURE__ */ getNotRestriction(jsonSchema.not, { enum: [...new Set(valibotAction.requirement)] });
400
- break;
401
- case "regex":
402
- if (valibotAction.requirement.flags) errors = addError(errors, "RegExp flags are not supported by JSON Schema.");
403
- if (jsonSchema.pattern) errors = addError(errors, `The "${valibotAction.type}" action is not supported in combination with another regex action.`);
404
- else jsonSchema.pattern = valibotAction.requirement.source;
405
- break;
406
- case "safe_integer":
407
- jsonSchema.type = "integer";
408
- jsonSchema.minimum = getLowerBound(jsonSchema.minimum, Number.MIN_SAFE_INTEGER);
409
- jsonSchema.maximum = getUpperBound(jsonSchema.maximum, Number.MAX_SAFE_INTEGER);
410
- break;
411
- case "starts_with":
412
- if (jsonSchema.pattern) errors = addError(errors, `The "${valibotAction.type}" action is not supported in combination with another regex action.`);
413
- else jsonSchema.pattern = `^${escapeRegExp(valibotAction.requirement)}`;
414
- break;
415
- case "title":
416
- jsonSchema.title = valibotAction.title;
417
- break;
418
- case "url":
419
- jsonSchema.format = "uri";
420
- break;
421
- case "uuid":
422
- jsonSchema.format = "uuid";
423
- break;
424
- case "value":
425
- if (!isJsonConstValue(valibotAction.requirement)) {
426
- errors = addError(errors, "The requirement of the \"value\" action is not JSON compatible.");
427
- break;
428
- }
429
- if (config?.target === "openapi-3.0") intersectEnum(jsonSchema, [valibotAction.requirement]);
430
- else if ("const" in jsonSchema && jsonSchema.const !== valibotAction.requirement) errors = addError(errors, `The "${valibotAction.type}" action is not supported in combination with a different "const" restriction.`);
431
- else jsonSchema.const = valibotAction.requirement;
432
- break;
433
- case "values":
434
- if (!isJsonEnumValues(valibotAction.requirement)) {
435
- errors = addError(errors, "A requirement of the \"values\" action is not JSON compatible.");
436
- break;
437
- }
438
- intersectEnum(jsonSchema, valibotAction.requirement);
439
- break;
440
- default: errors = addError(errors, `The "${valibotAction.type}" action cannot be converted to JSON Schema.`);
441
- }
442
- if (config?.overrideAction) {
443
- const actionOverride = config.overrideAction({
444
- valibotAction,
445
- jsonSchema,
446
- errors
447
- });
448
- if (actionOverride) return { ...actionOverride };
449
- }
450
- if (errors) for (const message of errors) handleError(message, config);
451
- return jsonSchema;
452
- }
453
-
454
- //#endregion
455
- //#region src/converters/convertSchema/convertSchema.ts
456
- /**
457
- * Flattens a Valibot pipe by recursively expanding nested pipes.
458
- *
459
- * @param pipe The pipeline to flatten.
460
- *
461
- * @returns A flat pipeline.
462
- */
463
- function flattenPipe(pipe) {
464
- return pipe.flatMap((item) => "pipe" in item ? flattenPipe(item.pipe) : item);
465
- }
466
- /**
467
- * Returns the JSON Pointer reference for a definition key.
468
- *
469
- * @param referenceId The unescaped definition key.
470
- *
471
- * @returns The encoded JSON Pointer fragment.
472
- */
473
- function getDefinitionRef(referenceId) {
474
- return `#/$defs/${referenceId.replaceAll("~", "~0").replaceAll("/", "~1")}`;
475
- }
476
- /**
477
- * Converts any supported Valibot schema to the JSON Schema format.
478
- *
479
- * @param jsonSchema The JSON Schema object.
480
- * @param valibotSchema The Valibot schema object.
481
- * @param config The conversion configuration.
482
- * @param context The conversion context.
483
- * @param skipRef Whether to skip using a reference.
484
- *
485
- * @returns The converted JSON Schema.
486
- */
487
- function convertSchema(jsonSchema, valibotSchema, config, context, skipRef = false) {
488
- if (!skipRef) {
489
- const referenceId = context.referenceMap.get(valibotSchema);
490
- if (referenceId) {
491
- jsonSchema.$ref = getDefinitionRef(referenceId);
492
- if (config?.overrideRef) {
493
- const refOverride = config.overrideRef({
494
- ...context,
495
- referenceId,
496
- valibotSchema,
497
- jsonSchema
498
- });
499
- if (refOverride) jsonSchema.$ref = refOverride;
500
- }
501
- return jsonSchema;
502
- }
503
- }
504
- if ("pipe" in valibotSchema) {
505
- const flatPipe = flattenPipe(valibotSchema.pipe);
506
- let startIndex = 0;
507
- let stopIndex = flatPipe.length - 1;
508
- if (config?.typeMode === "input") {
509
- const inputStopIndex = flatPipe.slice(1).findIndex((item) => item.kind === "schema" || item.kind === "transformation" && (item.type === "find_item" || item.type === "parse_json" || item.type === "raw_transform" || item.type === "reduce_items" || item.type === "stringify_json" || item.type === "to_bigint" || item.type === "to_boolean" || item.type === "to_date" || item.type === "to_number" || item.type === "to_string" || item.type === "transform"));
510
- if (inputStopIndex !== -1) stopIndex = inputStopIndex;
511
- } else if (config?.typeMode === "output") {
512
- const outputStartIndex = flatPipe.findLastIndex((item) => item.kind === "schema");
513
- if (outputStartIndex !== -1) startIndex = outputStartIndex;
514
- }
515
- for (let index = startIndex; index <= stopIndex; index++) {
516
- const valibotPipeItem = flatPipe[index];
517
- if (valibotPipeItem.kind === "schema") {
518
- if (index > startIndex) handleError("Set the \"typeMode\" config to \"input\" or \"output\" to convert pipelines with multiple schemas.", config);
519
- jsonSchema = convertSchema(jsonSchema, valibotPipeItem, config, context, true);
520
- } else jsonSchema = convertAction(jsonSchema, valibotPipeItem, config);
521
- }
522
- return jsonSchema;
523
- }
524
- let errors;
525
- switch (valibotSchema.type) {
526
- case "boolean":
527
- jsonSchema.type = "boolean";
528
- break;
529
- case "null":
530
- if (config?.target === "openapi-3.0") jsonSchema.enum = [null];
531
- else jsonSchema.type = "null";
532
- break;
533
- case "number":
534
- jsonSchema.type = "number";
535
- break;
536
- case "string":
537
- jsonSchema.type = "string";
538
- break;
539
- case "array":
540
- jsonSchema.type = "array";
541
- jsonSchema.items = convertSchema({}, valibotSchema.item, config, context);
542
- break;
543
- case "tuple":
544
- case "tuple_with_rest":
545
- case "loose_tuple":
546
- case "strict_tuple":
547
- jsonSchema.type = "array";
548
- if (config?.target === "openapi-3.0") {
549
- jsonSchema.items = { anyOf: [] };
550
- jsonSchema.minItems = valibotSchema.items.length;
551
- for (const item of valibotSchema.items) jsonSchema.items.anyOf.push(convertSchema({}, item, config, context));
552
- if (valibotSchema.type === "tuple_with_rest") jsonSchema.items.anyOf.push(convertSchema({}, valibotSchema.rest, config, context));
553
- else if (valibotSchema.type === "strict_tuple" || valibotSchema.type === "tuple") jsonSchema.maxItems = valibotSchema.items.length;
554
- } else if (config?.target === "draft-2020-12") {
555
- jsonSchema.prefixItems = [];
556
- jsonSchema.minItems = valibotSchema.items.length;
557
- for (const item of valibotSchema.items) jsonSchema.prefixItems.push(convertSchema({}, item, config, context));
558
- if (valibotSchema.type === "tuple_with_rest") jsonSchema.items = convertSchema({}, valibotSchema.rest, config, context);
559
- else if (valibotSchema.type === "strict_tuple") jsonSchema.items = false;
560
- } else {
561
- jsonSchema.items = [];
562
- jsonSchema.minItems = valibotSchema.items.length;
563
- for (const item of valibotSchema.items) jsonSchema.items.push(convertSchema({}, item, config, context));
564
- if (valibotSchema.type === "tuple_with_rest") jsonSchema.additionalItems = convertSchema({}, valibotSchema.rest, config, context);
565
- else if (valibotSchema.type === "strict_tuple") jsonSchema.additionalItems = false;
566
- }
567
- break;
568
- case "object":
569
- case "object_with_rest":
570
- case "loose_object":
571
- case "strict_object":
572
- jsonSchema.type = "object";
573
- jsonSchema.properties = {};
574
- jsonSchema.required = [];
575
- for (const key in valibotSchema.entries) {
576
- const entry = valibotSchema.entries[key];
577
- jsonSchema.properties[key] = convertSchema({}, entry, config, context);
578
- if (entry.type !== "exact_optional" && entry.type !== "nullish" && entry.type !== "optional") jsonSchema.required.push(key);
579
- }
580
- if (valibotSchema.type === "object_with_rest") jsonSchema.additionalProperties = convertSchema({}, valibotSchema.rest, config, context);
581
- else if (valibotSchema.type === "strict_object") jsonSchema.additionalProperties = false;
582
- break;
583
- case "record":
584
- if (config?.target === "openapi-3.0" && "pipe" in valibotSchema.key) errors = addError(errors, "The \"record\" schema with a schema for the key that contains a \"pipe\" cannot be converted to JSON Schema.");
585
- if (valibotSchema.key.type !== "string") errors = addError(errors, `The "record" schema with the "${valibotSchema.key.type}" schema for the key cannot be converted to JSON Schema.`);
586
- jsonSchema.type = "object";
587
- if (config?.target !== "openapi-3.0") jsonSchema.propertyNames = convertSchema({}, valibotSchema.key, config, context);
588
- jsonSchema.additionalProperties = convertSchema({}, valibotSchema.value, config, context);
589
- break;
590
- case "any":
591
- case "unknown": break;
592
- case "never":
593
- jsonSchema.not = {};
594
- break;
595
- case "nullable":
596
- case "nullish":
597
- if (config?.target === "openapi-3.0") {
598
- const innerSchema = convertSchema({}, valibotSchema.wrapped, config, context);
599
- Object.assign(jsonSchema, innerSchema);
600
- jsonSchema.nullable = true;
601
- } else jsonSchema.anyOf = [convertSchema({}, valibotSchema.wrapped, config, context), { type: "null" }];
602
- if (valibotSchema.default !== void 0) jsonSchema.default = typeof valibotSchema.default === "function" ? valibotSchema.default() : valibotSchema.default;
603
- break;
604
- case "exact_optional":
605
- case "optional":
606
- case "undefinedable":
607
- jsonSchema = convertSchema(jsonSchema, valibotSchema.wrapped, config, context);
608
- if (valibotSchema.default !== void 0) jsonSchema.default = typeof valibotSchema.default === "function" ? valibotSchema.default() : valibotSchema.default;
609
- break;
610
- case "literal":
611
- if (!isJsonConstValue(valibotSchema.literal)) {
612
- errors = addError(errors, "The value of the \"literal\" schema is not JSON compatible.");
613
- break;
614
- }
615
- if (config?.target === "openapi-3.0") jsonSchema.enum = [valibotSchema.literal];
616
- else jsonSchema.const = valibotSchema.literal;
617
- break;
618
- case "enum":
619
- case "picklist": {
620
- const options = valibotSchema.options;
621
- if (!options.every((option) => typeof option === "string" || typeof option === "number" && Number.isFinite(option))) {
622
- errors = addError(errors, `An option of the "${valibotSchema.type}" schema is not JSON compatible.`);
623
- break;
624
- }
625
- jsonSchema.enum = options;
626
- if (options.every((option) => typeof option === "string")) jsonSchema.type = "string";
627
- else if (options.every((option) => typeof option === "number")) jsonSchema.type = "number";
628
- else if (config?.target !== "openapi-3.0") jsonSchema.type = ["string", "number"];
629
- break;
630
- }
631
- case "union":
632
- jsonSchema.anyOf = valibotSchema.options.map((option) => convertSchema({}, option, config, context));
633
- break;
634
- case "variant":
635
- jsonSchema.oneOf = valibotSchema.options.map((option) => convertSchema({}, option, config, context));
636
- break;
637
- case "intersect":
638
- jsonSchema.allOf = valibotSchema.options.map((option) => convertSchema({}, option, config, context));
639
- break;
640
- case "lazy": {
641
- let wrappedValibotSchema = context.getterMap.get(valibotSchema.getter);
642
- if (!wrappedValibotSchema) {
643
- wrappedValibotSchema = valibotSchema.getter(void 0);
644
- context.getterMap.set(valibotSchema.getter, wrappedValibotSchema);
645
- }
646
- let referenceId = context.referenceMap.get(wrappedValibotSchema);
647
- if (!referenceId) {
648
- referenceId = context.referenceMap.createId(context.definitions);
649
- context.referenceMap.set(wrappedValibotSchema, referenceId);
650
- context.definitions[referenceId] = convertSchema({}, wrappedValibotSchema, config, context, true);
651
- }
652
- jsonSchema.$ref = getDefinitionRef(referenceId);
653
- if (config?.overrideRef) {
654
- const refOverride = config.overrideRef({
655
- ...context,
656
- referenceId,
657
- valibotSchema: wrappedValibotSchema,
658
- jsonSchema
659
- });
660
- if (refOverride) jsonSchema.$ref = refOverride;
661
- }
662
- break;
663
- }
664
- default: errors = addError(errors, `The "${valibotSchema.type}" schema cannot be converted to JSON Schema.`);
665
- }
666
- if (config?.overrideSchema) {
667
- const schemaOverride = config.overrideSchema({
668
- ...context,
669
- referenceId: context.referenceMap.get(valibotSchema),
670
- valibotSchema,
671
- jsonSchema,
672
- errors
673
- });
674
- if (schemaOverride) return { ...schemaOverride };
675
- }
676
- if (errors) for (const message of errors) handleError(message, config);
677
- return jsonSchema;
678
- }
679
-
680
- //#endregion
681
- //#region src/storages/globalDefs/globalDefs.ts
682
- let store;
683
- /**
684
- * Adds new definitions to the global schema definitions.
685
- *
686
- * @param definitions The schema definitions.
687
- *
688
- * @beta
689
- */
690
- function addGlobalDefs(definitions) {
691
- store = {
692
- ...store ?? {},
693
- ...definitions
694
- };
695
- }
696
- /**
697
- * Returns the current global schema definitions.
698
- *
699
- * @returns The schema definitions.
700
- *
701
- * @beta
702
- */
703
- function getGlobalDefs() {
704
- return store;
705
- }
706
-
707
- //#endregion
708
- //#region src/functions/toJsonSchema/toJsonSchema.ts
709
- /**
710
- * Converts a Valibot schema to the JSON Schema format.
711
- *
712
- * @param schema The Valibot schema object.
713
- * @param config The JSON Schema configuration.
714
- *
715
- * @returns The converted JSON Schema.
716
- */
717
- function toJsonSchema(schema, config) {
718
- const context = {
719
- definitions: {},
720
- referenceMap: new ReferenceMap(),
721
- getterMap: /* @__PURE__ */ new Map()
722
- };
723
- const definitions = config?.definitions ?? getGlobalDefs();
724
- if (definitions) {
725
- for (const key in definitions) context.referenceMap.set(definitions[key], key);
726
- for (const key in definitions) context.definitions[key] = convertSchema({}, definitions[key], config, context, true);
727
- }
728
- const jsonSchema = convertSchema({}, schema, config, context);
729
- const target = config?.target ?? "draft-07";
730
- if (target === "draft-2020-12") jsonSchema.$schema = "https://json-schema.org/draft/2020-12/schema";
731
- else if (target === "draft-07") jsonSchema.$schema = "http://json-schema.org/draft-07/schema#";
732
- if (context.referenceMap.size) jsonSchema.$defs = context.definitions;
733
- return jsonSchema;
734
- }
735
-
736
- //#endregion
737
- //#region src/functions/toJsonSchemaDefs/toJsonSchemaDefs.ts
738
- /**
739
- * Converts Valibot schema definitions to JSON Schema definitions.
740
- *
741
- * @param definitions The Valibot schema definitions.
742
- * @param config The JSON Schema configuration.
743
- *
744
- * @returns The converted JSON Schema definitions.
745
- */
746
- function toJsonSchemaDefs(definitions, config) {
747
- const context = {
748
- definitions: {},
749
- referenceMap: new ReferenceMap(),
750
- getterMap: /* @__PURE__ */ new Map()
751
- };
752
- for (const key in definitions) context.referenceMap.set(definitions[key], key);
753
- for (const key in definitions) context.definitions[key] = convertSchema({}, definitions[key], config, context, true);
754
- return context.definitions;
755
- }
756
-
757
- //#endregion
758
- //#region src/functions/toStandardJsonSchema/toStandardJsonSchema.ts
759
- const SUPPORTED_TARGETS = [
760
- "draft-07",
761
- "draft-2020-12",
762
- "openapi-3.0"
763
- ];
764
- /**
765
- * Converts a Valibot schema to the Standard JSON Schema format.
766
- *
767
- * @param schema The Valibot schema object.
768
- *
769
- * @returns The Standard JSON Schema.
770
- */
771
- function toStandardJsonSchema(schema) {
772
- return { "~standard": {
773
- ...schema["~standard"],
774
- jsonSchema: {
775
- input(options) {
776
- if (SUPPORTED_TARGETS.includes(options.target)) return toJsonSchema(schema, {
777
- typeMode: "input",
778
- target: options.target,
779
- ...options.libraryOptions
780
- });
781
- throw new Error(`Unsupported target: ${options.target}`);
782
- },
783
- output(options) {
784
- if (SUPPORTED_TARGETS.includes(options.target)) return toJsonSchema(schema, {
785
- typeMode: "output",
786
- target: options.target,
787
- ...options.libraryOptions
788
- });
789
- throw new Error(`Unsupported target: ${options.target}`);
790
- }
791
- }
792
- } };
793
- }
794
-
795
- //#endregion
796
- exports.addGlobalDefs = addGlobalDefs;
797
- exports.getGlobalDefs = getGlobalDefs;
798
- exports.toJsonSchema = toJsonSchema;
799
- exports.toJsonSchemaDefs = toJsonSchemaDefs;
800
- exports.toStandardJsonSchema = toStandardJsonSchema;