ima2-gen 3.19.0 → 3.20.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 (384) hide show
  1. package/docs/migration/runtime-test-inventory.md +2 -1
  2. package/lib/oauthLauncher.js +10 -5
  3. package/node_modules/zod/README.md +2 -2
  4. package/node_modules/zod/compile.cjs +19 -0
  5. package/node_modules/zod/index.cjs +19 -0
  6. package/node_modules/zod/locales/index.cjs +19 -0
  7. package/node_modules/zod/mini/index.cjs +19 -0
  8. package/node_modules/zod/package.json +8 -7
  9. package/node_modules/zod/src/v3/helpers/errorUtil.ts +1 -1
  10. package/node_modules/zod/src/v4/classic/external.ts +2 -0
  11. package/node_modules/zod/src/v4/classic/from-json-schema.ts +248 -25
  12. package/node_modules/zod/src/v4/classic/schemas.ts +243 -168
  13. package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +60 -9
  14. package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +6 -0
  15. package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +2 -2
  16. package/node_modules/zod/src/v4/classic/tests/cyclic-data.test.ts +265 -0
  17. package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +112 -6
  18. package/node_modules/zod/src/v4/classic/tests/enum.test.ts +9 -0
  19. package/node_modules/zod/src/v4/classic/tests/error.test.ts +130 -1
  20. package/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +157 -0
  21. package/node_modules/zod/src/v4/classic/tests/iban.test.ts +81 -0
  22. package/node_modules/zod/src/v4/classic/tests/instance-footprint.test.ts +40 -2
  23. package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +27 -7
  24. package/node_modules/zod/src/v4/classic/tests/issue-schema.test.ts +88 -56
  25. package/node_modules/zod/src/v4/classic/tests/number.test.ts +39 -0
  26. package/node_modules/zod/src/v4/classic/tests/object.test.ts +56 -0
  27. package/node_modules/zod/src/v4/classic/tests/optin-ladder.test.ts +3 -2
  28. package/node_modules/zod/src/v4/classic/tests/prefault.test.ts +70 -0
  29. package/node_modules/zod/src/v4/classic/tests/properties.test.ts +141 -0
  30. package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +46 -1
  31. package/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +19 -0
  32. package/node_modules/zod/src/v4/classic/tests/string.test.ts +95 -1
  33. package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +33 -1
  34. package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +234 -38
  35. package/node_modules/zod/src/v4/classic/tests/validate.test.ts +569 -0
  36. package/node_modules/zod/src/v4/core/api.ts +44 -28
  37. package/node_modules/zod/src/v4/core/checks.ts +62 -102
  38. package/node_modules/zod/src/v4/core/compile.ts +218 -93
  39. package/node_modules/zod/src/v4/core/core.ts +1 -3
  40. package/node_modules/zod/src/v4/core/doc.ts +6 -2
  41. package/node_modules/zod/src/v4/core/errors.ts +3 -6
  42. package/node_modules/zod/src/v4/core/json-schema-generator.ts +2 -2
  43. package/node_modules/zod/src/v4/core/json-schema-processors.ts +185 -81
  44. package/node_modules/zod/src/v4/core/memoizer.ts +75 -28
  45. package/node_modules/zod/src/v4/core/parse.ts +37 -16
  46. package/node_modules/zod/src/v4/core/regexes.ts +14 -4
  47. package/node_modules/zod/src/v4/core/schemas.ts +296 -132
  48. package/node_modules/zod/src/v4/core/tests/cached.test.ts +54 -0
  49. package/node_modules/zod/src/v4/core/tests/compile-differential.test.ts +35 -0
  50. package/node_modules/zod/src/v4/core/tests/compile-generative.test.ts +445 -0
  51. package/node_modules/zod/src/v4/core/tests/compile.test.ts +399 -2
  52. package/node_modules/zod/src/v4/core/tests/email-regex.test.ts +140 -0
  53. package/node_modules/zod/src/v4/core/tests/locales/tg.test.ts +85 -0
  54. package/node_modules/zod/src/v4/core/tests/polyfill-collision.test.ts +46 -0
  55. package/node_modules/zod/src/v4/core/tests/url-no-canparse.test.ts +118 -16
  56. package/node_modules/zod/src/v4/core/to-json-schema.ts +9 -7
  57. package/node_modules/zod/src/v4/core/util.ts +218 -147
  58. package/node_modules/zod/src/v4/core/versions.ts +2 -2
  59. package/node_modules/zod/src/v4/locales/ar.ts +2 -0
  60. package/node_modules/zod/src/v4/locales/az.ts +2 -0
  61. package/node_modules/zod/src/v4/locales/be.ts +2 -0
  62. package/node_modules/zod/src/v4/locales/bg.ts +2 -0
  63. package/node_modules/zod/src/v4/locales/bn.ts +2 -0
  64. package/node_modules/zod/src/v4/locales/ca.ts +2 -0
  65. package/node_modules/zod/src/v4/locales/ckb.ts +2 -0
  66. package/node_modules/zod/src/v4/locales/cs.ts +2 -0
  67. package/node_modules/zod/src/v4/locales/da.ts +2 -0
  68. package/node_modules/zod/src/v4/locales/de.ts +2 -0
  69. package/node_modules/zod/src/v4/locales/el.ts +2 -0
  70. package/node_modules/zod/src/v4/locales/en.ts +2 -0
  71. package/node_modules/zod/src/v4/locales/eo.ts +2 -0
  72. package/node_modules/zod/src/v4/locales/es.ts +2 -0
  73. package/node_modules/zod/src/v4/locales/fa.ts +2 -0
  74. package/node_modules/zod/src/v4/locales/fi.ts +2 -0
  75. package/node_modules/zod/src/v4/locales/fr-CA.ts +2 -0
  76. package/node_modules/zod/src/v4/locales/fr.ts +2 -0
  77. package/node_modules/zod/src/v4/locales/gu.ts +2 -0
  78. package/node_modules/zod/src/v4/locales/he.ts +2 -0
  79. package/node_modules/zod/src/v4/locales/hi.ts +2 -0
  80. package/node_modules/zod/src/v4/locales/hr.ts +2 -0
  81. package/node_modules/zod/src/v4/locales/hu.ts +2 -0
  82. package/node_modules/zod/src/v4/locales/hy.ts +2 -0
  83. package/node_modules/zod/src/v4/locales/id.ts +2 -0
  84. package/node_modules/zod/src/v4/locales/index.ts +1 -0
  85. package/node_modules/zod/src/v4/locales/is.ts +2 -0
  86. package/node_modules/zod/src/v4/locales/it.ts +2 -0
  87. package/node_modules/zod/src/v4/locales/ja.ts +2 -0
  88. package/node_modules/zod/src/v4/locales/ka.ts +2 -0
  89. package/node_modules/zod/src/v4/locales/km.ts +2 -0
  90. package/node_modules/zod/src/v4/locales/kn.ts +2 -0
  91. package/node_modules/zod/src/v4/locales/ko.ts +2 -0
  92. package/node_modules/zod/src/v4/locales/lt.ts +2 -0
  93. package/node_modules/zod/src/v4/locales/mk.ts +2 -0
  94. package/node_modules/zod/src/v4/locales/ms.ts +2 -0
  95. package/node_modules/zod/src/v4/locales/ne.ts +2 -0
  96. package/node_modules/zod/src/v4/locales/nl.ts +2 -0
  97. package/node_modules/zod/src/v4/locales/nn.ts +2 -0
  98. package/node_modules/zod/src/v4/locales/no.ts +2 -0
  99. package/node_modules/zod/src/v4/locales/ota.ts +2 -0
  100. package/node_modules/zod/src/v4/locales/pl.ts +2 -0
  101. package/node_modules/zod/src/v4/locales/ps.ts +2 -0
  102. package/node_modules/zod/src/v4/locales/pt-BR.ts +2 -0
  103. package/node_modules/zod/src/v4/locales/pt.ts +2 -0
  104. package/node_modules/zod/src/v4/locales/ro.ts +2 -0
  105. package/node_modules/zod/src/v4/locales/ru.ts +2 -0
  106. package/node_modules/zod/src/v4/locales/sk.ts +2 -0
  107. package/node_modules/zod/src/v4/locales/sl.ts +2 -0
  108. package/node_modules/zod/src/v4/locales/sv.ts +2 -0
  109. package/node_modules/zod/src/v4/locales/ta.ts +2 -0
  110. package/node_modules/zod/src/v4/locales/tg.ts +135 -0
  111. package/node_modules/zod/src/v4/locales/th.ts +2 -0
  112. package/node_modules/zod/src/v4/locales/tk.ts +2 -0
  113. package/node_modules/zod/src/v4/locales/tr.ts +2 -0
  114. package/node_modules/zod/src/v4/locales/uk.ts +2 -0
  115. package/node_modules/zod/src/v4/locales/ur.ts +2 -0
  116. package/node_modules/zod/src/v4/locales/uz.ts +2 -0
  117. package/node_modules/zod/src/v4/locales/vi.ts +2 -0
  118. package/node_modules/zod/src/v4/locales/yo.ts +2 -0
  119. package/node_modules/zod/src/v4/locales/zh-CN.ts +2 -0
  120. package/node_modules/zod/src/v4/locales/zh-TW.ts +2 -0
  121. package/node_modules/zod/src/v4/mini/external.ts +2 -0
  122. package/node_modules/zod/src/v4/mini/schemas.ts +32 -7
  123. package/node_modules/zod/src/v4/mini/tests/checks.test.ts +1 -1
  124. package/node_modules/zod/src/v4/mini/tests/computed.test.ts +11 -17
  125. package/node_modules/zod/src/v4/mini/tests/index.test.ts +86 -0
  126. package/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +16 -0
  127. package/node_modules/zod/src/v4/mini/tests/string.test.ts +23 -0
  128. package/node_modules/zod/v3/ZodError.cjs +19 -0
  129. package/node_modules/zod/v3/errors.cjs +19 -0
  130. package/node_modules/zod/v3/external.cjs +19 -0
  131. package/node_modules/zod/v3/helpers/enumUtil.cjs +19 -0
  132. package/node_modules/zod/v3/helpers/errorUtil.cjs +20 -1
  133. package/node_modules/zod/v3/helpers/errorUtil.js +1 -1
  134. package/node_modules/zod/v3/helpers/parseUtil.cjs +19 -0
  135. package/node_modules/zod/v3/helpers/partialUtil.cjs +19 -0
  136. package/node_modules/zod/v3/helpers/typeAliases.cjs +19 -0
  137. package/node_modules/zod/v3/helpers/util.cjs +19 -0
  138. package/node_modules/zod/v3/index.cjs +19 -0
  139. package/node_modules/zod/v3/standard-schema.cjs +19 -0
  140. package/node_modules/zod/v3/types.cjs +19 -0
  141. package/node_modules/zod/v4/classic/checks.cjs +19 -0
  142. package/node_modules/zod/v4/classic/coerce.cjs +19 -0
  143. package/node_modules/zod/v4/classic/compat.cjs +19 -0
  144. package/node_modules/zod/v4/classic/deep-partial.cjs +19 -0
  145. package/node_modules/zod/v4/classic/errors.cjs +19 -0
  146. package/node_modules/zod/v4/classic/external.cjs +22 -1
  147. package/node_modules/zod/v4/classic/external.d.cts +1 -1
  148. package/node_modules/zod/v4/classic/external.d.ts +1 -1
  149. package/node_modules/zod/v4/classic/external.js +1 -1
  150. package/node_modules/zod/v4/classic/from-json-schema.cjs +264 -24
  151. package/node_modules/zod/v4/classic/from-json-schema.js +245 -24
  152. package/node_modules/zod/v4/classic/in-out.cjs +19 -0
  153. package/node_modules/zod/v4/classic/index.cjs +19 -0
  154. package/node_modules/zod/v4/classic/iso.cjs +19 -0
  155. package/node_modules/zod/v4/classic/parse.cjs +19 -0
  156. package/node_modules/zod/v4/classic/schemas.cjs +100 -35
  157. package/node_modules/zod/v4/classic/schemas.d.cts +15 -1
  158. package/node_modules/zod/v4/classic/schemas.d.ts +15 -1
  159. package/node_modules/zod/v4/classic/schemas.js +77 -33
  160. package/node_modules/zod/v4/core/api.cjs +45 -22
  161. package/node_modules/zod/v4/core/api.d.cts +12 -6
  162. package/node_modules/zod/v4/core/api.d.ts +12 -6
  163. package/node_modules/zod/v4/core/api.js +25 -22
  164. package/node_modules/zod/v4/core/checks.cjs +51 -97
  165. package/node_modules/zod/v4/core/checks.d.cts +17 -1
  166. package/node_modules/zod/v4/core/checks.d.ts +17 -1
  167. package/node_modules/zod/v4/core/checks.js +31 -96
  168. package/node_modules/zod/v4/core/compile.cjs +173 -78
  169. package/node_modules/zod/v4/core/compile.d.cts +18 -4
  170. package/node_modules/zod/v4/core/compile.d.ts +18 -4
  171. package/node_modules/zod/v4/core/compile.js +154 -79
  172. package/node_modules/zod/v4/core/core.cjs +20 -1
  173. package/node_modules/zod/v4/core/core.js +1 -1
  174. package/node_modules/zod/v4/core/doc.cjs +26 -2
  175. package/node_modules/zod/v4/core/doc.js +7 -2
  176. package/node_modules/zod/v4/core/errors.cjs +21 -5
  177. package/node_modules/zod/v4/core/errors.js +2 -5
  178. package/node_modules/zod/v4/core/index.cjs +19 -0
  179. package/node_modules/zod/v4/core/json-schema-generator.cjs +20 -1
  180. package/node_modules/zod/v4/core/json-schema-generator.js +2 -2
  181. package/node_modules/zod/v4/core/json-schema-processors.cjs +188 -72
  182. package/node_modules/zod/v4/core/json-schema-processors.d.cts +16 -0
  183. package/node_modules/zod/v4/core/json-schema-processors.d.ts +16 -0
  184. package/node_modules/zod/v4/core/json-schema-processors.js +170 -74
  185. package/node_modules/zod/v4/core/json-schema.cjs +19 -0
  186. package/node_modules/zod/v4/core/memoizer.cjs +111 -23
  187. package/node_modules/zod/v4/core/memoizer.js +69 -23
  188. package/node_modules/zod/v4/core/parse.cjs +56 -16
  189. package/node_modules/zod/v4/core/parse.js +37 -16
  190. package/node_modules/zod/v4/core/regexes.cjs +31 -6
  191. package/node_modules/zod/v4/core/regexes.d.cts +3 -0
  192. package/node_modules/zod/v4/core/regexes.d.ts +3 -0
  193. package/node_modules/zod/v4/core/regexes.js +10 -4
  194. package/node_modules/zod/v4/core/registries.cjs +19 -0
  195. package/node_modules/zod/v4/core/schemas.cjs +302 -114
  196. package/node_modules/zod/v4/core/schemas.d.cts +28 -8
  197. package/node_modules/zod/v4/core/schemas.d.ts +28 -8
  198. package/node_modules/zod/v4/core/schemas.js +279 -113
  199. package/node_modules/zod/v4/core/standard-schema.cjs +19 -0
  200. package/node_modules/zod/v4/core/to-json-schema.cjs +28 -7
  201. package/node_modules/zod/v4/core/to-json-schema.d.cts +4 -3
  202. package/node_modules/zod/v4/core/to-json-schema.d.ts +4 -3
  203. package/node_modules/zod/v4/core/to-json-schema.js +7 -6
  204. package/node_modules/zod/v4/core/util.cjs +177 -143
  205. package/node_modules/zod/v4/core/util.d.cts +25 -4
  206. package/node_modules/zod/v4/core/util.d.ts +25 -4
  207. package/node_modules/zod/v4/core/util.js +156 -143
  208. package/node_modules/zod/v4/core/versions.cjs +21 -2
  209. package/node_modules/zod/v4/core/versions.d.cts +1 -1
  210. package/node_modules/zod/v4/core/versions.d.ts +1 -1
  211. package/node_modules/zod/v4/core/versions.js +2 -2
  212. package/node_modules/zod/v4/core/visit.cjs +19 -0
  213. package/node_modules/zod/v4/index.cjs +19 -0
  214. package/node_modules/zod/v4/locales/ar.cjs +2 -0
  215. package/node_modules/zod/v4/locales/ar.js +2 -0
  216. package/node_modules/zod/v4/locales/az.cjs +2 -0
  217. package/node_modules/zod/v4/locales/az.js +2 -0
  218. package/node_modules/zod/v4/locales/be.cjs +2 -0
  219. package/node_modules/zod/v4/locales/be.js +2 -0
  220. package/node_modules/zod/v4/locales/bg.cjs +2 -0
  221. package/node_modules/zod/v4/locales/bg.js +2 -0
  222. package/node_modules/zod/v4/locales/bn.cjs +2 -0
  223. package/node_modules/zod/v4/locales/bn.js +2 -0
  224. package/node_modules/zod/v4/locales/ca.cjs +2 -0
  225. package/node_modules/zod/v4/locales/ca.js +2 -0
  226. package/node_modules/zod/v4/locales/ckb.cjs +2 -0
  227. package/node_modules/zod/v4/locales/ckb.js +2 -0
  228. package/node_modules/zod/v4/locales/cs.cjs +2 -0
  229. package/node_modules/zod/v4/locales/cs.js +2 -0
  230. package/node_modules/zod/v4/locales/da.cjs +2 -0
  231. package/node_modules/zod/v4/locales/da.js +2 -0
  232. package/node_modules/zod/v4/locales/de.cjs +2 -0
  233. package/node_modules/zod/v4/locales/de.js +2 -0
  234. package/node_modules/zod/v4/locales/el.cjs +2 -0
  235. package/node_modules/zod/v4/locales/el.js +2 -0
  236. package/node_modules/zod/v4/locales/en.cjs +2 -0
  237. package/node_modules/zod/v4/locales/en.js +2 -0
  238. package/node_modules/zod/v4/locales/eo.cjs +2 -0
  239. package/node_modules/zod/v4/locales/eo.js +2 -0
  240. package/node_modules/zod/v4/locales/es.cjs +2 -0
  241. package/node_modules/zod/v4/locales/es.js +2 -0
  242. package/node_modules/zod/v4/locales/fa.cjs +2 -0
  243. package/node_modules/zod/v4/locales/fa.js +2 -0
  244. package/node_modules/zod/v4/locales/fi.cjs +2 -0
  245. package/node_modules/zod/v4/locales/fi.js +2 -0
  246. package/node_modules/zod/v4/locales/fr-CA.cjs +2 -0
  247. package/node_modules/zod/v4/locales/fr-CA.js +2 -0
  248. package/node_modules/zod/v4/locales/fr.cjs +2 -0
  249. package/node_modules/zod/v4/locales/fr.js +2 -0
  250. package/node_modules/zod/v4/locales/gu.cjs +2 -0
  251. package/node_modules/zod/v4/locales/gu.js +2 -0
  252. package/node_modules/zod/v4/locales/he.cjs +2 -0
  253. package/node_modules/zod/v4/locales/he.js +2 -0
  254. package/node_modules/zod/v4/locales/hi.cjs +2 -0
  255. package/node_modules/zod/v4/locales/hi.js +2 -0
  256. package/node_modules/zod/v4/locales/hr.cjs +2 -0
  257. package/node_modules/zod/v4/locales/hr.js +2 -0
  258. package/node_modules/zod/v4/locales/hu.cjs +2 -0
  259. package/node_modules/zod/v4/locales/hu.js +2 -0
  260. package/node_modules/zod/v4/locales/hy.cjs +2 -0
  261. package/node_modules/zod/v4/locales/hy.js +2 -0
  262. package/node_modules/zod/v4/locales/id.cjs +2 -0
  263. package/node_modules/zod/v4/locales/id.js +2 -0
  264. package/node_modules/zod/v4/locales/index.cjs +22 -1
  265. package/node_modules/zod/v4/locales/index.d.cts +1 -0
  266. package/node_modules/zod/v4/locales/index.d.ts +1 -0
  267. package/node_modules/zod/v4/locales/index.js +1 -0
  268. package/node_modules/zod/v4/locales/is.cjs +2 -0
  269. package/node_modules/zod/v4/locales/is.js +2 -0
  270. package/node_modules/zod/v4/locales/it.cjs +2 -0
  271. package/node_modules/zod/v4/locales/it.js +2 -0
  272. package/node_modules/zod/v4/locales/ja.cjs +2 -0
  273. package/node_modules/zod/v4/locales/ja.js +2 -0
  274. package/node_modules/zod/v4/locales/ka.cjs +2 -0
  275. package/node_modules/zod/v4/locales/ka.js +2 -0
  276. package/node_modules/zod/v4/locales/km.cjs +2 -0
  277. package/node_modules/zod/v4/locales/km.js +2 -0
  278. package/node_modules/zod/v4/locales/kn.cjs +2 -0
  279. package/node_modules/zod/v4/locales/kn.js +2 -0
  280. package/node_modules/zod/v4/locales/ko.cjs +2 -0
  281. package/node_modules/zod/v4/locales/ko.js +2 -0
  282. package/node_modules/zod/v4/locales/lt.cjs +2 -0
  283. package/node_modules/zod/v4/locales/lt.js +2 -0
  284. package/node_modules/zod/v4/locales/mk.cjs +2 -0
  285. package/node_modules/zod/v4/locales/mk.js +2 -0
  286. package/node_modules/zod/v4/locales/ms.cjs +2 -0
  287. package/node_modules/zod/v4/locales/ms.js +2 -0
  288. package/node_modules/zod/v4/locales/ne.cjs +2 -0
  289. package/node_modules/zod/v4/locales/ne.js +2 -0
  290. package/node_modules/zod/v4/locales/nl.cjs +2 -0
  291. package/node_modules/zod/v4/locales/nl.js +2 -0
  292. package/node_modules/zod/v4/locales/nn.cjs +2 -0
  293. package/node_modules/zod/v4/locales/nn.js +2 -0
  294. package/node_modules/zod/v4/locales/no.cjs +2 -0
  295. package/node_modules/zod/v4/locales/no.js +2 -0
  296. package/node_modules/zod/v4/locales/ota.cjs +2 -0
  297. package/node_modules/zod/v4/locales/ota.js +2 -0
  298. package/node_modules/zod/v4/locales/pl.cjs +2 -0
  299. package/node_modules/zod/v4/locales/pl.js +2 -0
  300. package/node_modules/zod/v4/locales/ps.cjs +2 -0
  301. package/node_modules/zod/v4/locales/ps.js +2 -0
  302. package/node_modules/zod/v4/locales/pt-BR.cjs +2 -0
  303. package/node_modules/zod/v4/locales/pt-BR.js +2 -0
  304. package/node_modules/zod/v4/locales/pt.cjs +2 -0
  305. package/node_modules/zod/v4/locales/pt.js +2 -0
  306. package/node_modules/zod/v4/locales/ro.cjs +2 -0
  307. package/node_modules/zod/v4/locales/ro.js +2 -0
  308. package/node_modules/zod/v4/locales/ru.cjs +2 -0
  309. package/node_modules/zod/v4/locales/ru.js +2 -0
  310. package/node_modules/zod/v4/locales/sk.cjs +2 -0
  311. package/node_modules/zod/v4/locales/sk.js +2 -0
  312. package/node_modules/zod/v4/locales/sl.cjs +2 -0
  313. package/node_modules/zod/v4/locales/sl.js +2 -0
  314. package/node_modules/zod/v4/locales/sv.cjs +2 -0
  315. package/node_modules/zod/v4/locales/sv.js +2 -0
  316. package/node_modules/zod/v4/locales/ta.cjs +2 -0
  317. package/node_modules/zod/v4/locales/ta.js +2 -0
  318. package/node_modules/zod/v4/locales/tg.cjs +144 -0
  319. package/node_modules/zod/v4/locales/tg.d.cts +5 -0
  320. package/node_modules/zod/v4/locales/tg.d.ts +4 -0
  321. package/node_modules/zod/v4/locales/tg.js +117 -0
  322. package/node_modules/zod/v4/locales/th.cjs +2 -0
  323. package/node_modules/zod/v4/locales/th.js +2 -0
  324. package/node_modules/zod/v4/locales/tk.cjs +2 -0
  325. package/node_modules/zod/v4/locales/tk.js +2 -0
  326. package/node_modules/zod/v4/locales/tr.cjs +2 -0
  327. package/node_modules/zod/v4/locales/tr.js +2 -0
  328. package/node_modules/zod/v4/locales/uk.cjs +2 -0
  329. package/node_modules/zod/v4/locales/uk.js +2 -0
  330. package/node_modules/zod/v4/locales/ur.cjs +2 -0
  331. package/node_modules/zod/v4/locales/ur.js +2 -0
  332. package/node_modules/zod/v4/locales/uz.cjs +2 -0
  333. package/node_modules/zod/v4/locales/uz.js +2 -0
  334. package/node_modules/zod/v4/locales/vi.cjs +2 -0
  335. package/node_modules/zod/v4/locales/vi.js +2 -0
  336. package/node_modules/zod/v4/locales/yo.cjs +2 -0
  337. package/node_modules/zod/v4/locales/yo.js +2 -0
  338. package/node_modules/zod/v4/locales/zh-CN.cjs +2 -0
  339. package/node_modules/zod/v4/locales/zh-CN.js +2 -0
  340. package/node_modules/zod/v4/locales/zh-TW.cjs +2 -0
  341. package/node_modules/zod/v4/locales/zh-TW.js +2 -0
  342. package/node_modules/zod/v4/mini/checks.cjs +19 -0
  343. package/node_modules/zod/v4/mini/coerce.cjs +19 -0
  344. package/node_modules/zod/v4/mini/deep-partial.cjs +19 -0
  345. package/node_modules/zod/v4/mini/external.cjs +22 -1
  346. package/node_modules/zod/v4/mini/external.d.cts +1 -1
  347. package/node_modules/zod/v4/mini/external.d.ts +1 -1
  348. package/node_modules/zod/v4/mini/external.js +1 -1
  349. package/node_modules/zod/v4/mini/in-out.cjs +19 -0
  350. package/node_modules/zod/v4/mini/index.cjs +19 -0
  351. package/node_modules/zod/v4/mini/iso.cjs +19 -0
  352. package/node_modules/zod/v4/mini/parse.cjs +19 -0
  353. package/node_modules/zod/v4/mini/schemas.cjs +44 -8
  354. package/node_modules/zod/v4/mini/schemas.d.cts +6 -1
  355. package/node_modules/zod/v4/mini/schemas.d.ts +6 -1
  356. package/node_modules/zod/v4/mini/schemas.js +21 -6
  357. package/node_modules/zod/v4-mini/index.cjs +19 -0
  358. package/package.json +6 -6
  359. package/routes/health.js +10 -1
  360. package/ui/dist/.vite/manifest.json +64 -64
  361. package/ui/dist/assets/{AgentWorkspace-C6ke6Eo4.js → AgentWorkspace-CENfXAob.js} +1 -1
  362. package/ui/dist/assets/{App-pMN1OjNW.js → App-B9y6oVuL.js} +8 -8
  363. package/ui/dist/assets/{AssetGenWorkspace-DzEfpUy_.js → AssetGenWorkspace-fL2MjYj9.js} +2 -2
  364. package/ui/dist/assets/{AssetMediaLightbox-Bx0azN0S.js → AssetMediaLightbox-Be4arnGs.js} +1 -1
  365. package/ui/dist/assets/{AssetsWorkspace-CHw1u9VC.js → AssetsWorkspace-7z4wyfp0.js} +1 -1
  366. package/ui/dist/assets/{CardNewsWorkspace-DsjqhaYO.js → CardNewsWorkspace-DSldDpsl.js} +1 -1
  367. package/ui/dist/assets/{GenerationRequestLogPanel-EYEiHIr9.js → GenerationRequestLogPanel-CcQKi89f.js} +1 -1
  368. package/ui/dist/assets/{HomeWorkspace-DbnY1YF2.js → HomeWorkspace-BZDk2X1U.js} +1 -1
  369. package/ui/dist/assets/{KeyingPanel-8J_RMrxg.js → KeyingPanel-snhXKnA3.js} +1 -1
  370. package/ui/dist/assets/{NodeCanvas-DmjbNcTa.js → NodeCanvas-CJQXsS0r.js} +1 -1
  371. package/ui/dist/assets/{PromptBuilderPanel-CL34Jpso.js → PromptBuilderPanel-B-YP1ph5.js} +1 -1
  372. package/ui/dist/assets/{PromptImportDialog-B24cvEkK.js → PromptImportDialog-ssPMxE4j.js} +2 -2
  373. package/ui/dist/assets/{PromptImportDiscoverySection-Bbw1_J_3.js → PromptImportDiscoverySection-CvOgGTOs.js} +1 -1
  374. package/ui/dist/assets/{PromptImportFolderSection-CMpxuE8e.js → PromptImportFolderSection-CxR9qxbi.js} +1 -1
  375. package/ui/dist/assets/{PromptLibraryPanel-Ct98TJ61.js → PromptLibraryPanel-DjYgbXes.js} +2 -2
  376. package/ui/dist/assets/{SettingsWorkspace-DL9Tm90P.js → SettingsWorkspace-BtruYb6g.js} +1 -1
  377. package/ui/dist/assets/{SpriteRecipeWorkspace-BJUH1ddP.js → SpriteRecipeWorkspace-DBrYOYOK.js} +1 -1
  378. package/ui/dist/assets/{index-D_LpLGWV.js → index-CWFgCqE1.js} +3 -3
  379. package/ui/dist/assets/{index-CHeVGnoy.js → index-va83o9G5.js} +12 -12
  380. package/ui/dist/assets/{pptxgen.es-s4xfPXLT.js → pptxgen.es-D-kntoLD.js} +1 -1
  381. package/ui/dist/assets/{promptBuilderStore-DQR29LwN.js → promptBuilderStore-BdGPLEra.js} +1 -1
  382. package/ui/dist/assets/useAgentDialogFocus-BDdVl-nq.js +1 -0
  383. package/ui/dist/index.html +1 -1
  384. package/ui/dist/assets/useAgentDialogFocus-DAeS9IWG.js +0 -1
@@ -838,6 +838,62 @@ describe("__proto__ as a declared shape key", () => {
838
838
  expect(() => (schema[method] as any)(mask).shape).toThrow('Unrecognized key: "__proto__"');
839
839
  });
840
840
 
841
+ // the mask is checked against the source's declared keys, which reads without resolving them, so it throws where the mistake is
842
+ test.each(["pick", "omit", "partial", "required"] as const)("%s rejects an undeclared key at the call", (method) => {
843
+ const schema = z.object({ value: z.string() });
844
+
845
+ expect(() => (schema[method] as any)({ nope: true })).toThrow('Unrecognized key: "nope"');
846
+ });
847
+
848
+ // a derived shape is built key by key, and a plain assignment runs whatever setter answers to the key — `__proto__` always has one, and a polluted prototype can supply one for any name
849
+ test("an inherited setter cannot swallow a derived key", () => {
850
+ let swallowed: unknown;
851
+ Object.defineProperty(Object.prototype, "field", {
852
+ configurable: true,
853
+ set(v) {
854
+ swallowed = v;
855
+ },
856
+ get() {
857
+ return undefined;
858
+ },
859
+ });
860
+
861
+ try {
862
+ const derived = z.object({ field: z.string() }).extend({ extra: z.number() });
863
+
864
+ expect(Object.keys(derived.shape)).toEqual(["field", "extra"]);
865
+ expect(swallowed).toBeUndefined();
866
+ // the key is still validated; what a parse writes into its result is the ambient prototype's business, as it is without a builder
867
+ expect(derived.safeParse({ field: 123, extra: 1 }).success).toBe(false);
868
+ expect(derived.safeParse({ field: "a", extra: 1 }).success).toBe(true);
869
+ } finally {
870
+ delete (Object.prototype as any).field;
871
+ }
872
+ });
873
+
874
+ // a shape resolves by object spread, so a non-enumerable entry is no part of it and no builder may promote one into a derived shape
875
+ test("a non-enumerable shape entry stays out of every derived shape", () => {
876
+ const sym = Symbol("kept");
877
+ const hide = (target: Record<string, any>) =>
878
+ Object.defineProperty(target, "hidden", { value: z.string(), enumerable: false, configurable: true });
879
+ // each case needs a source whose shape is still unresolved, since resolving drops the entry on its own
880
+ const source = () => z.object(hide({ b: z.number(), [sym]: z.boolean() }) as any);
881
+
882
+ expect(Reflect.ownKeys(source().shape)).toEqual(["b", sym]);
883
+ expect(Reflect.ownKeys(source().extend({ c: z.boolean() }).shape)).toEqual(["b", "c", sym]);
884
+ expect(Reflect.ownKeys(source().partial().shape)).toEqual(["b", sym]);
885
+ expect(Reflect.ownKeys(source().merge(z.object({ c: z.boolean() })).shape)).toEqual(["b", "c", sym]);
886
+ expect(Object.keys(z.object({ b: z.number() }).extend(hide({}) as any).shape)).toEqual(["b"]);
887
+ expect(() => source().pick({ hidden: true } as any)).toThrow('Unrecognized key: "hidden"');
888
+
889
+ // promoting it would make a key the source ignores required
890
+ expect(
891
+ source()
892
+ .extend({ c: z.boolean() })
893
+ .safeParse({ b: 1, [sym]: true, c: true }).success
894
+ ).toBe(true);
895
+ });
896
+
841
897
  test("shape helpers preserve a declared key", () => {
842
898
  const shape = () =>
843
899
  Object.fromEntries([
@@ -222,7 +222,8 @@ test("ladder: the rung values themselves", () => {
222
222
 
223
223
  test("exactOptional overrides the values and pattern optional installs", () => {
224
224
  expect(z.exactOptional(z.enum(["a", "b"]))._zod.values).toEqual(new Set(["a", "b"]));
225
- expect(z.exactOptional(z.string().regex(/^abc$/))._zod.pattern).toEqual(/^abc$/);
225
+ // a format carries its pattern on its def; a chained `.regex()` no longer folds into the inner `_zod.pattern`, the template literal derives that itself
226
+ expect(z.exactOptional(z.stringFormat("abc", /^abc$/))._zod.pattern).toEqual(/^abc$/);
226
227
  expect(z.templateLiteral(["a", z.exactOptional(z.literal("b"))]).safeParse("a").success).toEqual(false);
227
228
  });
228
229
 
@@ -230,5 +231,5 @@ test("exactOptional overrides the values and pattern optional installs", () => {
230
231
  test("exactOptional's override holds for later instances", () => {
231
232
  z.exactOptional(z.enum(["a", "b"]));
232
233
  expect(z.exactOptional(z.enum(["c", "d"]))._zod.values).toEqual(new Set(["c", "d"]));
233
- expect(z.exactOptional(z.string().regex(/^xyz$/))._zod.pattern).toEqual(/^xyz$/);
234
+ expect(z.exactOptional(z.stringFormat("xyz", /^xyz$/))._zod.pattern).toEqual(/^xyz$/);
234
235
  });
@@ -1,6 +1,76 @@
1
1
  import { expect, expectTypeOf, test } from "vitest";
2
2
  import { z } from "zod/v4";
3
3
 
4
+ test.each([false, true])("undefined prefault preserves object keys (jitless: %s)", async (jitless) => {
5
+ const previous = z.config().jitless;
6
+ z.config({ jitless });
7
+ try {
8
+ let calls = 0;
9
+ const field = z.union([z.string(), z.undefined()]).prefault(() => {
10
+ calls++;
11
+ return undefined;
12
+ });
13
+ const schema = z.object({ a: field });
14
+ expectTypeOf<z.output<typeof field>>().toEqualTypeOf<string | undefined>();
15
+ expectTypeOf<z.input<typeof schema>>().toEqualTypeOf<{ a?: string | undefined }>();
16
+ expectTypeOf<z.output<typeof schema>>().toEqualTypeOf<{ a: string | undefined }>();
17
+ expect(schema.parse({})).toStrictEqual({ a: undefined });
18
+ expect(calls).toBe(1);
19
+ expect(schema.parse({ a: undefined })).toStrictEqual({ a: undefined });
20
+ expect(calls).toBe(2);
21
+ expect(await schema.parseAsync({})).toStrictEqual({ a: undefined });
22
+ expect(calls).toBe(3);
23
+ expect(schema.parse({ a: "value" })).toStrictEqual({ a: "value" });
24
+ expect(schema.safeParse({ a: 123 }).success).toBe(false);
25
+ expect(calls).toBe(3);
26
+
27
+ const literal = z.prefault(z.string().optional(), undefined);
28
+ expect(z.core.compileFn(z.object({ a: literal }))({})).toStrictEqual({ a: undefined });
29
+ for (const wrapped of [literal, literal.readonly(), literal.nullable(), z.lazy(() => literal)]) {
30
+ expect(z.object({ a: wrapped }).parse({})).toStrictEqual({ a: undefined });
31
+ }
32
+ expect(z.object({ a: literal.optional() }).parse({})).toStrictEqual({});
33
+ expect(z.object({ a: literal.optional() }).parse({ a: undefined })).toStrictEqual({ a: undefined });
34
+ expect(z.tuple([literal]).parse([])).toStrictEqual([undefined]);
35
+ } finally {
36
+ z.config({ jitless: previous });
37
+ }
38
+ });
39
+
40
+ test("prefault preserves transformed undefined output", async () => {
41
+ const field = z
42
+ .string()
43
+ .transform(() => undefined)
44
+ .prefault("fallback");
45
+ expectTypeOf<z.output<typeof field>>().toEqualTypeOf<undefined>();
46
+ expect(field.parse(undefined)).toBeUndefined();
47
+ const schema = z.object({ a: field, optional: z.string().optional() });
48
+ expectTypeOf<z.output<typeof schema>>().toEqualTypeOf<{ a: undefined; optional?: string | undefined }>();
49
+ expect(schema.parse({})).toStrictEqual({ a: undefined });
50
+ expect(z.core.compileFn(schema)({})).toStrictEqual({ a: undefined });
51
+ expect(z.compile(schema).parse({})).toStrictEqual({ a: undefined });
52
+ expect(
53
+ await z
54
+ .object({
55
+ a: z
56
+ .string()
57
+ .transform(async () => undefined)
58
+ .prefault("fallback"),
59
+ })
60
+ .parseAsync({})
61
+ ).toStrictEqual({ a: undefined });
62
+ expect(
63
+ z
64
+ .object({
65
+ a: z
66
+ .string()
67
+ .prefault("fallback")
68
+ .transform(() => undefined),
69
+ })
70
+ .parse({})
71
+ ).toStrictEqual({ a: undefined });
72
+ });
73
+
4
74
  test("basic prefault", () => {
5
75
  const a = z.prefault(z.string().trim(), " default ");
6
76
  expect(a).toBeInstanceOf(z.ZodPrefault);
@@ -0,0 +1,141 @@
1
+ import { expect, expectTypeOf, test } from "vitest";
2
+ import * as z from "zod/v4";
3
+
4
+ test("z.properties is a check", () => {
5
+ const s = z.object({ a: z.string(), b: z.string() }).check(z.properties({ a: z.literal("x"), b: z.literal("y") }));
6
+
7
+ // asserts in place: extra keys pass, and every failing key reports
8
+ expect(s.safeParse({ a: "x", b: "y", extra: 1 }).success).toBe(true);
9
+ expect(s.safeParse({ a: "!", b: "!" }).error!.issues.map((i) => i.path)).toEqual([["a"], ["b"]]);
10
+
11
+ // the base already typed the value, so the properties are asserted on whatever it produced — a string's length, as z.property() does
12
+ const long = z.string().check(z.properties({ length: z.number().min(3) }));
13
+ expect(long.parse("abc")).toBe("abc");
14
+ expect(long.safeParse("ab").error!.issues.map((i) => i.path)).toEqual([["length"]]);
15
+ expect(
16
+ z
17
+ .compile(long)
18
+ .safeParse("ab")
19
+ .error!.issues.map((i) => i.path)
20
+ ).toEqual([["length"]]);
21
+
22
+ // not a schema
23
+ // @ts-expect-error a check has no parse of its own
24
+ z.properties({ a: z.string() }).parse;
25
+ });
26
+
27
+ test("z.properties discards transformed output", () => {
28
+ // asserts and never writes back, exactly as z.property() behaves; a nested object schema rebuilds its output even without transforms, so identity cannot distinguish the two
29
+ const s = z.any().check(z.properties({ a: z.string().transform((s) => s.toUpperCase()) }));
30
+ const input = { a: "hi" };
31
+ expect(s.parse(input)).toBe(input);
32
+ expect(input.a).toBe("hi");
33
+ });
34
+
35
+ test("z.instanceof().properties()", () => {
36
+ const httpsUrl = z.instanceof(URL).properties({ protocol: z.literal("https:") });
37
+ expectTypeOf<z.infer<typeof httpsUrl>>().toEqualTypeOf<URL & { protocol: "https:" }>();
38
+
39
+ const u = new URL("https://example.com");
40
+ expect(httpsUrl.parse(u)).toBe(u);
41
+ expect(httpsUrl.safeParse(new URL("http://example.com")).error!.issues.map((i) => i.path)).toEqual([["protocol"]]);
42
+
43
+ // chains, and each call narrows further
44
+ const chained = httpsUrl.properties({ port: z.literal("") });
45
+ expectTypeOf<z.infer<typeof chained>>().toEqualTypeOf<URL & { protocol: "https:" } & { port: "" }>();
46
+ expect(chained.safeParse(u).success).toBe(true);
47
+ expect(chained.safeParse(new URL("https://example.com:8443")).error!.issues.map((i) => i.path)).toEqual([["port"]]);
48
+
49
+ // nothing is written back, so the narrowing is over the shape's input side
50
+ const W = z.instanceof(URL).properties({ search: z.string().transform((s) => s.length) });
51
+ expectTypeOf<z.infer<typeof W>>().toEqualTypeOf<URL & { search: string }>();
52
+ });
53
+
54
+ test("z.instanceof().properties() constrains the shape to the instance type", () => {
55
+ const file = z.instanceof(File).properties({ name: z.string(), size: z.number().max(1024) });
56
+ expectTypeOf<z.infer<typeof file>>().toEqualTypeOf<File & { name: string; size: number }>();
57
+
58
+ // @ts-expect-error no such property on File
59
+ z.instanceof(File).properties({ nmae: z.string() });
60
+
61
+ // @ts-expect-error File["size"] is a number
62
+ z.instanceof(File).properties({ size: z.string() });
63
+
64
+ // methods are out of the shape, so an object literal's inherited toString can't collide with the constraint
65
+ // @ts-expect-error
66
+ z.instanceof(File).properties({ text: z.any() });
67
+
68
+ // a literal still narrows a wider property
69
+ const png = z.instanceof(File).properties({ type: z.literal("image/png") });
70
+ expectTypeOf<z.infer<typeof png>>().toEqualTypeOf<File & { type: "image/png" }>();
71
+ });
72
+
73
+ test("z.properties spreads into .check()", () => {
74
+ // the 4.5 array call sites: the check yields itself from Symbol.iterator
75
+ const p = z.properties({ a: z.literal("x") });
76
+ expect([...p]).toEqual([p]);
77
+
78
+ const s = z.object({ a: z.string() }).check(...z.properties({ a: z.literal("x") }));
79
+ expect(s.safeParse({ a: "x" }).success).toBe(true);
80
+ expect(s.safeParse({ a: "!" }).error!.issues.map((i) => i.path)).toEqual([["a"]]);
81
+ });
82
+
83
+ test("z.properties compiles inside a container", () => {
84
+ const outer = z.compile(z.object({ url: z.instanceof(URL).properties({ protocol: z.literal("https:") }) }));
85
+ expect(outer.safeParse({ url: new URL("http://example.com") }).error!.issues.map((i) => i.path)).toEqual([
86
+ ["url", "protocol"],
87
+ ]);
88
+ });
89
+
90
+ test("z.properties async", async () => {
91
+ const s = z.any().check(z.properties({ a: z.string().refine(async (s) => s.length > 1) }));
92
+ const ok = { a: "hi" };
93
+ await expect(s.parseAsync(ok)).resolves.toBe(ok);
94
+ const bad = await s.safeParseAsync({ a: "!" });
95
+ expect(bad.error!.issues.map((i) => i.path)).toEqual([["a"]]);
96
+ });
97
+
98
+ test("z.properties validates symbol keys", () => {
99
+ const sym = Symbol("tag");
100
+ const s = z.any().check(z.properties({ [sym]: z.string() }));
101
+ expect(s.safeParse({ [sym]: "ok" }).success).toBe(true);
102
+ expect(s.safeParse({ [sym]: 123 }).error!.issues.map((i) => i.path)).toEqual([[sym]]);
103
+ expect(
104
+ z
105
+ .compile(s)
106
+ .safeParse({ [sym]: 123 })
107
+ .error!.issues.map((i) => i.path)
108
+ ).toEqual([[sym]]);
109
+ });
110
+
111
+ test("z.properties compiled and interpreted agree on a nullish value", () => {
112
+ // a base that permits null reaches the check with one; the compiled property read must not throw where the runtime reports an issue
113
+ const s = z.any().check(...z.properties({ a: z.string() }));
114
+ const expected = [["invalid_type", []]];
115
+ expect(s.safeParse(null).error!.issues.map((i) => [i.code, i.path])).toEqual(expected);
116
+ expect(
117
+ z
118
+ .compile(s)
119
+ .safeParse(null)
120
+ .error!.issues.map((i) => [i.code, i.path])
121
+ ).toEqual(expected);
122
+ });
123
+
124
+ test("z.properties with a custom when refuses to compile", () => {
125
+ // `when` is not publicly settable, since it gates the assertion inside the run loop. A hand-built def can still carry one, and compiling it must refuse rather than run the shape unconditionally: a union branch compiles to its own IIFE, so a wrong rejection is absorbed as a branch failure with no fallback.
126
+ const p = new z.core.$ZodCheckProperties({ check: "properties", shape: { a: z.literal("x") }, when: () => false });
127
+ const s = z.union([z.any().check(p), z.object({ b: z.string() })]);
128
+ const input = { a: "wrong", b: "hello" };
129
+ expect(z.compile(s).safeParse(input)).toEqual(s.safeParse(input));
130
+ });
131
+
132
+ test("z.properties survives shape mutation", () => {
133
+ // key and schema are snapshotted together; caching one and reading the other live paired a stale key with a missing schema
134
+ const shape: Record<string, z.ZodType> = { a: z.string() };
135
+ const s = z.any().check(z.properties(shape));
136
+ expect(s.safeParse({ a: "x" }).success).toBe(true);
137
+ delete shape.a;
138
+ expect(s.safeParse({ a: "x" }).success).toBe(true);
139
+ shape.b = z.string();
140
+ expect(s.safeParse({ a: "x" }).success).toBe(true);
141
+ });
@@ -1,6 +1,51 @@
1
1
  import { expect, expectTypeOf, test } from "vitest";
2
2
  import { z } from "zod/v4";
3
3
 
4
+ test("recursive object schema type aliases", () => {
5
+ type ObjectField = z.ZodObject<{ [k: string]: ObjectField }>;
6
+ type MixedField = z.ZodString | z.ZodObject<{ [k: string]: MixedField }>;
7
+ expectTypeOf<ObjectField>().toExtend<z.ZodType>();
8
+ expectTypeOf<MixedField>().toExtend<z.ZodType>();
9
+
10
+ type ObjectValue = { [k: string]: ObjectValue };
11
+ type MixedValue = string | { [k: string]: MixedValue };
12
+ expectTypeOf<z.input<ObjectField>>().toEqualTypeOf<ObjectValue>();
13
+ expectTypeOf<z.output<ObjectField>>().toEqualTypeOf<ObjectValue>();
14
+ expectTypeOf<z.input<MixedField>>().toEqualTypeOf<MixedValue>();
15
+ expectTypeOf<z.output<MixedField>>().toEqualTypeOf<MixedValue>();
16
+
17
+ const schema: MixedField = z.object({ name: z.string(), nested: z.object({ name: z.string() }) });
18
+ expect(schema.parse({ name: "a", nested: { name: "b", extra: true } })).toEqual({
19
+ name: "a",
20
+ nested: { name: "b" },
21
+ });
22
+ expect(schema.safeParse({ name: "a", nested: { name: 123 } }).success).toBe(false);
23
+
24
+ type CoreField = z.core.$ZodString<string> | z.core.$ZodObject<{ [k: string]: CoreField }>;
25
+ expectTypeOf<z.input<CoreField>>().toEqualTypeOf<MixedValue>();
26
+ expectTypeOf<z.output<CoreField>>().toEqualTypeOf<MixedValue>();
27
+ });
28
+
29
+ test("recursive object aliases preserve distinct input and output", () => {
30
+ type Field = z.ZodPipe<z.ZodString, z.ZodTransform<number, string>> | z.ZodObject<{ [k: string]: Field }>;
31
+ type Input = string | { [k: string]: Input };
32
+ type Output = number | { [k: string]: Output };
33
+ expectTypeOf<z.input<Field>>().toEqualTypeOf<Input>();
34
+ expectTypeOf<z.output<Field>>().toEqualTypeOf<Output>();
35
+ const schema: Field = z.object({ nested: z.object({ length: z.string().transform((s) => s.length) }) });
36
+ expect(schema.parse({ nested: { length: "abc" } })).toEqual({ nested: { length: 3 } });
37
+ expect(schema.safeParse({ nested: { length: 3 } }).success).toBe(false);
38
+ });
39
+
40
+ test("indexed object inference preserves string keys", () => {
41
+ type Indexed = z.ZodObject<Record<string, z.ZodString>>;
42
+ type Recursive = z.ZodObject<Record<string, Recursive>>;
43
+ expectTypeOf<keyof z.input<Indexed>>().toEqualTypeOf<string>();
44
+ expectTypeOf<keyof z.output<Indexed>>().toEqualTypeOf<string>();
45
+ expectTypeOf<keyof z.input<Recursive>>().toEqualTypeOf<string>();
46
+ expectTypeOf<keyof z.output<Recursive>>().toEqualTypeOf<string>();
47
+ });
48
+
4
49
  test("recursion with z.lazy", () => {
5
50
  const data = {
6
51
  name: "I",
@@ -556,7 +601,7 @@ test("recursive object with .check()", () => {
556
601
  expect(() => Category.parse(invalidData)).toThrow();
557
602
  });
558
603
 
559
- // biome-ignore lint: sadf
604
+ // biome-ignore lint/suspicious/noExportsInTest: unexported it trips noUnusedVariables instead
560
605
  export type RecursiveA = z.ZodUnion<
561
606
  [
562
607
  z.ZodObject<{
@@ -132,3 +132,22 @@ test("z.toJSONSchema() returns StandardJSONSchemaV1", async () => {
132
132
  }
133
133
  `);
134
134
  });
135
+
136
+ test("a failing validate reports the same issues as safeParse, without a ZodError", async () => {
137
+ const schema = z.object({ name: z.string().min(3), age: z.number().refine(async (n) => n > 0) });
138
+ const input = { name: "ab", age: -1 };
139
+ const result = (await schema["~standard"].validate(input)) as { issues: unknown[] };
140
+ expect(result.issues).toEqual((await schema.safeParseAsync(input)).error!.issues);
141
+ expect(result).not.toHaveProperty("error");
142
+ const sync = z.string().min(3)["~standard"].validate("ab") as { issues: unknown[] };
143
+ expect(sync.issues).toEqual(z.string().min(3).safeParse("ab").error!.issues);
144
+ });
145
+
146
+ test("a synchronously throwing check rejects through ~standard instead of throwing", async () => {
147
+ const schema = z.string().refine(() => {
148
+ throw new Error("boom");
149
+ });
150
+ const result = schema["~standard"].validate("abc");
151
+ expect(result).toBeInstanceOf(Promise);
152
+ await expect(result as Promise<unknown>).rejects.toThrow("boom");
153
+ });
@@ -1,5 +1,5 @@
1
1
  import { randomBytes } from "node:crypto";
2
- import { expect, test } from "vitest";
2
+ import { expect, expectTypeOf, test } from "vitest";
3
3
 
4
4
  import * as z from "zod/v4";
5
5
 
@@ -12,6 +12,63 @@ const includesFromIndex2 = z.string().includes("includes", { position: 2 });
12
12
  const startsWith = z.string().startsWith("startsWith");
13
13
  const endsWith = z.string().endsWith("endsWith");
14
14
 
15
+ test("string factory checks", async () => {
16
+ const schema = z.string({ checks: [z.minLength(1), z.maxLength(3)] as const });
17
+ const chained = z.string().min(1).max(3);
18
+ expectTypeOf<z.output<typeof schema>>().toEqualTypeOf<string>();
19
+ for (const value of ["", "ab", "abcd", 1, undefined]) {
20
+ expect(z.validate(schema, value)).toBe(z.validate(chained, value));
21
+ expect(schema.safeParse(value)).toEqual(chained.safeParse(value));
22
+ }
23
+ expect(z.toJSONSchema(schema)).toEqual(z.toJSONSchema(chained));
24
+ expect(schema.minLength).toBe(1);
25
+ expect(schema.maxLength).toBe(3);
26
+ expect(schema._zod.parent).toBeUndefined();
27
+ expect([...schema._zod.traits]).toEqual([...chained._zod.traits]);
28
+ const extended = schema.max(2);
29
+ expect(extended._zod.parent).toBe(schema);
30
+ expect(z.validate(schema, "abc")).toBe(true);
31
+ expect(z.validate(extended, "abc")).toBe(false);
32
+ const coerce = z.coerce.string({ checks: [z.minLength(2)] });
33
+ expect(coerce.parse(12)).toBe("12");
34
+ expect(z.validate(coerce, 1)).toBe(false);
35
+ const asyncSchema = z.string({
36
+ checks: [
37
+ z.check<string>(async (ctx) => {
38
+ if (ctx.value !== "ok") ctx.issues.push({ code: "custom", input: ctx.value });
39
+ }),
40
+ ],
41
+ });
42
+ expect(await asyncSchema.safeParseAsync("ok")).toEqual({ success: true, data: "ok" });
43
+ expect((await asyncSchema.safeParseAsync("bad")).success).toBe(false);
44
+ // @ts-expect-error numeric checks cannot validate strings
45
+ z.string({ checks: [z.gte(1)] });
46
+ });
47
+
48
+ test("factory checks snapshot caller arrays", () => {
49
+ for (const factory of [z.string, z.coerce.string]) {
50
+ for (const initial of [[], [z.minLength(1)]]) {
51
+ const schema = factory({ checks: initial });
52
+ let reads = 0;
53
+ const getterSchema = factory({
54
+ get checks() {
55
+ if (++reads > 1) throw new Error("checks read twice");
56
+ return initial;
57
+ },
58
+ });
59
+ expect(reads).toBe(1);
60
+ expect(z.validate(getterSchema, "long")).toBe(true);
61
+ const before = z.toJSONSchema(schema);
62
+ initial.push(z.minLength(10));
63
+ expect(schema._zod.def.checks).not.toBe(initial);
64
+ expect(z.validate(schema, "long")).toBe(true);
65
+ expect(z.validate(z.compile(schema), "long")).toBe(true);
66
+ expect(z.toJSONSchema(schema)).toEqual(before);
67
+ expect(z.validate(schema.check(z.minLength(2)), "long")).toBe(true);
68
+ }
69
+ }
70
+ });
71
+
15
72
  test("length checks", () => {
16
73
  minFive.parse("12345");
17
74
  minFive.parse("123456");
@@ -264,6 +321,7 @@ test("base64url validations", () => {
264
321
 
265
322
  const invalidBase64URLStrings = [
266
323
  "w7/Dv8O+w74K", // Has + and / characters (is base64)
324
+ "A", // Invalid length (1 mod 4 carries no whole byte)
267
325
  "12345", // Invalid length (not a multiple of 4 characters when adding allowed number of padding characters)
268
326
  "12345===", // Not padded correctly
269
327
  "!UGF0aWVuY2UgaXMgdGhlIGtleSB0byBzdWNjZXNz", // Invalid character '!'
@@ -291,6 +349,18 @@ test("big base64 and base64url", () => {
291
349
  z.base64().parse(bigbase64);
292
350
  const bigbase64url = randomBytes(1024 * 1024 * 10).toString("base64url");
293
351
  z.base64url().parse(bigbase64url);
352
+
353
+ // template literals compose def.pattern and test it on every parse; the quantified block forms overflowed the regex stack here
354
+ expect(z.templateLiteral(["id-", z.base64()]).safeParse(`id-${bigbase64}`).success).toBe(true);
355
+ expect(z.templateLiteral(["id-", z.base64url()]).safeParse(`id-${bigbase64url}`).success).toBe(true);
356
+ });
357
+
358
+ test("template literal composes base64 without alternation leaks", () => {
359
+ // the ^$| alternation in regexes.base64 used to leak: "AAAA" matched with the prefix dropped and "id-AAAA" was rejected
360
+ const tl = z.templateLiteral(["id-", z.base64()]);
361
+ expect(tl.safeParse("id-AAAA").success).toBe(true);
362
+ expect(tl.safeParse("id-").success).toBe(true);
363
+ expect(tl.safeParse("AAAA").success).toBe(false);
294
364
  });
295
365
 
296
366
  function makeJwt(header: object, payload: object) {
@@ -552,6 +622,18 @@ test("emoji validations", () => {
552
622
  expect(() => emoji.parse("😀 is an emoji")).toThrow();
553
623
  expect(() => emoji.parse("😀stuff")).toThrow();
554
624
  expect(() => emoji.parse("stuff😀")).toThrow();
625
+
626
+ emoji.parse("1\u{FE0F}\u{20E3}"); // keycap sequences stay valid
627
+ emoji.parse("#\u{FE0F}\u{20E3}");
628
+
629
+ // `\p{Emoji_Component}` alone covers ASCII digits, "#", "*", ZWJ, variation selectors and skin tone modifiers; none is an emoji without a base, so a component-only string is not one either
630
+ expect(() => emoji.parse("123")).toThrow();
631
+ expect(() => emoji.parse("#")).toThrow();
632
+ expect(() => emoji.parse("*")).toThrow();
633
+ expect(() => emoji.parse("\u{200D}")).toThrow();
634
+ expect(() => emoji.parse("\u{FE0F}")).toThrow();
635
+ expect(() => emoji.parse("\u{1F3FD}")).toThrow();
636
+ expect(() => emoji.parse("1\u{FE0F}")).toThrow();
555
637
  });
556
638
 
557
639
  test("nanoid", () => {
@@ -1264,6 +1346,18 @@ test("hostname", () => {
1264
1346
  expect(() => hostname.parse("example..com")).toThrow();
1265
1347
  });
1266
1348
 
1349
+ test("currency code", () => {
1350
+ const currency = z.currencyCode();
1351
+ for (const code of ["USD", "EUR", "XXX", "XCG", "XAD"]) expect(currency.parse(code)).toBe(code);
1352
+ for (const input of ["", "usd", "US", "USDX", " USD", "ANG", "BGN"])
1353
+ expect(currency.safeParse(input).success).toBe(false);
1354
+ expect(currency.safeParse("usd").error!.issues[0]).toMatchObject({
1355
+ code: "invalid_format",
1356
+ format: "currency_code",
1357
+ message: "Invalid currency code",
1358
+ });
1359
+ });
1360
+
1267
1361
  test("hash validation", () => {
1268
1362
  // MD5 tests
1269
1363
  const md5hex = z.hash("md5");
@@ -565,7 +565,7 @@ test("regexes", () => {
565
565
  `"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"`
566
566
  );
567
567
  expect(email._zod.pattern.source).toMatchInlineSnapshot(
568
- `"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"`
568
+ `"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"`
569
569
  );
570
570
  // expect(ip._zod.pattern.source).toMatchInlineSnapshot(
571
571
  // `"^(^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$)|(^(([a-fA-F0-9]{1,4}:){7}|::([a-fA-F0-9]{1,4}:){0,6}|([a-fA-F0-9]{1,4}:){1}:([a-fA-F0-9]{1,4}:){0,5}|([a-fA-F0-9]{1,4}:){2}:([a-fA-F0-9]{1,4}:){0,4}|([a-fA-F0-9]{1,4}:){3}:([a-fA-F0-9]{1,4}:){0,3}|([a-fA-F0-9]{1,4}:){4}:([a-fA-F0-9]{1,4}:){0,2}|([a-fA-F0-9]{1,4}:){5}:([a-fA-F0-9]{1,4}:){0,1})([a-fA-F0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$)$"`
@@ -778,3 +778,35 @@ test("template literal parsing - failure - issue format", () => {
778
778
  }
779
779
  `);
780
780
  });
781
+
782
+ test("part patterns fold checks through wrappers and unions", () => {
783
+ // a constrained string keeps its bounds under a wrapper and inside a union
784
+ const wrapped = z.templateLiteral(["a-", z.string().min(2).max(3).optional()]);
785
+ expect(wrapped.safeParse("a-").success).toBe(true);
786
+ expect(wrapped.safeParse("a-xy").success).toBe(true);
787
+ expect(wrapped.safeParse("a-x").success).toBe(false);
788
+ expect(wrapped.safeParse("a-wxyz").success).toBe(false);
789
+
790
+ const union = z.templateLiteral(["", z.union([z.string().regex(/^[a-c]+$/), z.number().int()])]);
791
+ expect(union.safeParse("abc").success).toBe(true);
792
+ expect(union.safeParse("12").success).toBe(true);
793
+ expect(union.safeParse("xyz").success).toBe(false);
794
+ expect(union.safeParse("1.5").success).toBe(false);
795
+
796
+ // an empty length range matches nothing rather than building an invalid quantifier
797
+ const empty = z.templateLiteral(["", z.string().min(8).length(5)]);
798
+ expect(empty.safeParse("abcde").success).toBe(false);
799
+
800
+ // lazy resolves its inner schema on the internals, not the def
801
+ const lazy = z.templateLiteral(["", z.lazy(() => z.string().min(2)).optional()]);
802
+ expect(lazy.safeParse("x").success).toBe(false);
803
+ expect(lazy.safeParse("xy").success).toBe(true);
804
+ });
805
+
806
+ test("an embedded email does not constrain the other parts", () => {
807
+ const schema = z.templateLiteral([z.email(), "|", z.string()]);
808
+ expect(schema.safeParse("a@b.cc|a..b").success).toBe(true);
809
+ expect(schema.safeParse("a@b.cc|xy").success).toBe(true);
810
+ expect(schema.safeParse("a..b@b.cc|xy").success).toBe(false);
811
+ expect(schema.safeParse(".a@b.cc|xy").success).toBe(false);
812
+ });