@openclaw/feishu 2026.9.5 → 2026.9.6

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 (379) hide show
  1. package/dist/.setup/{channel-C1KrXXJa.mjs → channel-DsndN1sp.mjs} +3 -3
  2. package/dist/.setup/{channel.runtime-Bizuv7WZ.mjs → channel.runtime-tihKUwVI.mjs} +3 -3
  3. package/dist/.setup/{chat-dWJYS63b.mjs → chat-BlvUjdN9.mjs} +1 -1
  4. package/dist/.setup/{monitor-C69OLzgO.mjs → monitor-OTT7VckU.mjs} +4 -3
  5. package/dist/.setup/{monitor.account-zwHb3HKM.mjs → monitor.account-D5j6WomE.mjs} +233 -79
  6. package/dist/.setup/{reply-delivery-result-DFjxGLgX.mjs → reply-delivery-result-CRIHpSze.mjs} +9 -4
  7. package/dist/.setup/{setup-api-CTRwX09n.mjs → setup-api-VAUkwtTi.mjs} +1 -1
  8. package/dist/api.js +4 -4
  9. package/dist/channel-plugin-api.js +1 -1
  10. package/dist/setup-api.js +1 -1
  11. package/dist/setup-entry.js +1 -1
  12. package/node_modules/micromark-extension-gfm-table/dev/lib/edit-map.d.ts +13 -0
  13. package/node_modules/micromark-extension-gfm-table/dev/lib/edit-map.d.ts.map +1 -1
  14. package/node_modules/micromark-extension-gfm-table/dev/lib/edit-map.js +35 -16
  15. package/node_modules/micromark-extension-gfm-table/dev/lib/html.js +5 -0
  16. package/node_modules/micromark-extension-gfm-table/dev/lib/syntax.js +26 -3
  17. package/node_modules/micromark-extension-gfm-table/lib/edit-map.d.ts +13 -0
  18. package/node_modules/micromark-extension-gfm-table/lib/edit-map.d.ts.map +1 -1
  19. package/node_modules/micromark-extension-gfm-table/lib/edit-map.js +37 -17
  20. package/node_modules/micromark-extension-gfm-table/lib/html.js +5 -0
  21. package/node_modules/micromark-extension-gfm-table/lib/syntax.js +29 -2
  22. package/node_modules/micromark-extension-gfm-table/package.json +6 -48
  23. package/node_modules/micromark-extension-gfm-table/readme.md +40 -40
  24. package/node_modules/zod/README.md +2 -2
  25. package/node_modules/zod/compile.cjs +19 -0
  26. package/node_modules/zod/index.cjs +19 -0
  27. package/node_modules/zod/locales/index.cjs +19 -0
  28. package/node_modules/zod/mini/index.cjs +19 -0
  29. package/node_modules/zod/package.json +8 -7
  30. package/node_modules/zod/src/v3/helpers/errorUtil.ts +1 -1
  31. package/node_modules/zod/src/v4/classic/external.ts +2 -0
  32. package/node_modules/zod/src/v4/classic/from-json-schema.ts +248 -25
  33. package/node_modules/zod/src/v4/classic/schemas.ts +243 -168
  34. package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +60 -9
  35. package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +6 -0
  36. package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +2 -2
  37. package/node_modules/zod/src/v4/classic/tests/cyclic-data.test.ts +265 -0
  38. package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +112 -6
  39. package/node_modules/zod/src/v4/classic/tests/enum.test.ts +9 -0
  40. package/node_modules/zod/src/v4/classic/tests/error.test.ts +130 -1
  41. package/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +157 -0
  42. package/node_modules/zod/src/v4/classic/tests/iban.test.ts +81 -0
  43. package/node_modules/zod/src/v4/classic/tests/instance-footprint.test.ts +40 -2
  44. package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +27 -7
  45. package/node_modules/zod/src/v4/classic/tests/issue-schema.test.ts +88 -56
  46. package/node_modules/zod/src/v4/classic/tests/number.test.ts +39 -0
  47. package/node_modules/zod/src/v4/classic/tests/object.test.ts +56 -0
  48. package/node_modules/zod/src/v4/classic/tests/optin-ladder.test.ts +3 -2
  49. package/node_modules/zod/src/v4/classic/tests/prefault.test.ts +70 -0
  50. package/node_modules/zod/src/v4/classic/tests/properties.test.ts +141 -0
  51. package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +46 -1
  52. package/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +19 -0
  53. package/node_modules/zod/src/v4/classic/tests/string.test.ts +95 -1
  54. package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +33 -1
  55. package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +234 -38
  56. package/node_modules/zod/src/v4/classic/tests/validate.test.ts +569 -0
  57. package/node_modules/zod/src/v4/core/api.ts +44 -28
  58. package/node_modules/zod/src/v4/core/checks.ts +62 -102
  59. package/node_modules/zod/src/v4/core/compile.ts +218 -93
  60. package/node_modules/zod/src/v4/core/core.ts +1 -3
  61. package/node_modules/zod/src/v4/core/doc.ts +6 -2
  62. package/node_modules/zod/src/v4/core/errors.ts +3 -6
  63. package/node_modules/zod/src/v4/core/json-schema-generator.ts +2 -2
  64. package/node_modules/zod/src/v4/core/json-schema-processors.ts +185 -81
  65. package/node_modules/zod/src/v4/core/memoizer.ts +75 -28
  66. package/node_modules/zod/src/v4/core/parse.ts +37 -16
  67. package/node_modules/zod/src/v4/core/regexes.ts +14 -4
  68. package/node_modules/zod/src/v4/core/schemas.ts +296 -132
  69. package/node_modules/zod/src/v4/core/tests/cached.test.ts +54 -0
  70. package/node_modules/zod/src/v4/core/tests/compile-differential.test.ts +35 -0
  71. package/node_modules/zod/src/v4/core/tests/compile-generative.test.ts +445 -0
  72. package/node_modules/zod/src/v4/core/tests/compile.test.ts +399 -2
  73. package/node_modules/zod/src/v4/core/tests/email-regex.test.ts +140 -0
  74. package/node_modules/zod/src/v4/core/tests/locales/tg.test.ts +85 -0
  75. package/node_modules/zod/src/v4/core/tests/polyfill-collision.test.ts +46 -0
  76. package/node_modules/zod/src/v4/core/tests/url-no-canparse.test.ts +118 -16
  77. package/node_modules/zod/src/v4/core/to-json-schema.ts +9 -7
  78. package/node_modules/zod/src/v4/core/util.ts +218 -147
  79. package/node_modules/zod/src/v4/core/versions.ts +2 -2
  80. package/node_modules/zod/src/v4/locales/ar.ts +2 -0
  81. package/node_modules/zod/src/v4/locales/az.ts +2 -0
  82. package/node_modules/zod/src/v4/locales/be.ts +2 -0
  83. package/node_modules/zod/src/v4/locales/bg.ts +2 -0
  84. package/node_modules/zod/src/v4/locales/bn.ts +2 -0
  85. package/node_modules/zod/src/v4/locales/ca.ts +2 -0
  86. package/node_modules/zod/src/v4/locales/ckb.ts +2 -0
  87. package/node_modules/zod/src/v4/locales/cs.ts +2 -0
  88. package/node_modules/zod/src/v4/locales/da.ts +2 -0
  89. package/node_modules/zod/src/v4/locales/de.ts +2 -0
  90. package/node_modules/zod/src/v4/locales/el.ts +2 -0
  91. package/node_modules/zod/src/v4/locales/en.ts +2 -0
  92. package/node_modules/zod/src/v4/locales/eo.ts +2 -0
  93. package/node_modules/zod/src/v4/locales/es.ts +2 -0
  94. package/node_modules/zod/src/v4/locales/fa.ts +2 -0
  95. package/node_modules/zod/src/v4/locales/fi.ts +2 -0
  96. package/node_modules/zod/src/v4/locales/fr-CA.ts +2 -0
  97. package/node_modules/zod/src/v4/locales/fr.ts +2 -0
  98. package/node_modules/zod/src/v4/locales/gu.ts +2 -0
  99. package/node_modules/zod/src/v4/locales/he.ts +2 -0
  100. package/node_modules/zod/src/v4/locales/hi.ts +2 -0
  101. package/node_modules/zod/src/v4/locales/hr.ts +2 -0
  102. package/node_modules/zod/src/v4/locales/hu.ts +2 -0
  103. package/node_modules/zod/src/v4/locales/hy.ts +2 -0
  104. package/node_modules/zod/src/v4/locales/id.ts +2 -0
  105. package/node_modules/zod/src/v4/locales/index.ts +1 -0
  106. package/node_modules/zod/src/v4/locales/is.ts +2 -0
  107. package/node_modules/zod/src/v4/locales/it.ts +2 -0
  108. package/node_modules/zod/src/v4/locales/ja.ts +2 -0
  109. package/node_modules/zod/src/v4/locales/ka.ts +2 -0
  110. package/node_modules/zod/src/v4/locales/km.ts +2 -0
  111. package/node_modules/zod/src/v4/locales/kn.ts +2 -0
  112. package/node_modules/zod/src/v4/locales/ko.ts +2 -0
  113. package/node_modules/zod/src/v4/locales/lt.ts +2 -0
  114. package/node_modules/zod/src/v4/locales/mk.ts +2 -0
  115. package/node_modules/zod/src/v4/locales/ms.ts +2 -0
  116. package/node_modules/zod/src/v4/locales/ne.ts +2 -0
  117. package/node_modules/zod/src/v4/locales/nl.ts +2 -0
  118. package/node_modules/zod/src/v4/locales/nn.ts +2 -0
  119. package/node_modules/zod/src/v4/locales/no.ts +2 -0
  120. package/node_modules/zod/src/v4/locales/ota.ts +2 -0
  121. package/node_modules/zod/src/v4/locales/pl.ts +2 -0
  122. package/node_modules/zod/src/v4/locales/ps.ts +2 -0
  123. package/node_modules/zod/src/v4/locales/pt-BR.ts +2 -0
  124. package/node_modules/zod/src/v4/locales/pt.ts +2 -0
  125. package/node_modules/zod/src/v4/locales/ro.ts +2 -0
  126. package/node_modules/zod/src/v4/locales/ru.ts +2 -0
  127. package/node_modules/zod/src/v4/locales/sk.ts +2 -0
  128. package/node_modules/zod/src/v4/locales/sl.ts +2 -0
  129. package/node_modules/zod/src/v4/locales/sv.ts +2 -0
  130. package/node_modules/zod/src/v4/locales/ta.ts +2 -0
  131. package/node_modules/zod/src/v4/locales/tg.ts +135 -0
  132. package/node_modules/zod/src/v4/locales/th.ts +2 -0
  133. package/node_modules/zod/src/v4/locales/tk.ts +2 -0
  134. package/node_modules/zod/src/v4/locales/tr.ts +2 -0
  135. package/node_modules/zod/src/v4/locales/uk.ts +2 -0
  136. package/node_modules/zod/src/v4/locales/ur.ts +2 -0
  137. package/node_modules/zod/src/v4/locales/uz.ts +2 -0
  138. package/node_modules/zod/src/v4/locales/vi.ts +2 -0
  139. package/node_modules/zod/src/v4/locales/yo.ts +2 -0
  140. package/node_modules/zod/src/v4/locales/zh-CN.ts +2 -0
  141. package/node_modules/zod/src/v4/locales/zh-TW.ts +2 -0
  142. package/node_modules/zod/src/v4/mini/external.ts +2 -0
  143. package/node_modules/zod/src/v4/mini/schemas.ts +32 -7
  144. package/node_modules/zod/src/v4/mini/tests/checks.test.ts +1 -1
  145. package/node_modules/zod/src/v4/mini/tests/computed.test.ts +11 -17
  146. package/node_modules/zod/src/v4/mini/tests/index.test.ts +86 -0
  147. package/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +16 -0
  148. package/node_modules/zod/src/v4/mini/tests/string.test.ts +23 -0
  149. package/node_modules/zod/v3/ZodError.cjs +19 -0
  150. package/node_modules/zod/v3/errors.cjs +19 -0
  151. package/node_modules/zod/v3/external.cjs +19 -0
  152. package/node_modules/zod/v3/helpers/enumUtil.cjs +19 -0
  153. package/node_modules/zod/v3/helpers/errorUtil.cjs +20 -1
  154. package/node_modules/zod/v3/helpers/errorUtil.js +1 -1
  155. package/node_modules/zod/v3/helpers/parseUtil.cjs +19 -0
  156. package/node_modules/zod/v3/helpers/partialUtil.cjs +19 -0
  157. package/node_modules/zod/v3/helpers/typeAliases.cjs +19 -0
  158. package/node_modules/zod/v3/helpers/util.cjs +19 -0
  159. package/node_modules/zod/v3/index.cjs +19 -0
  160. package/node_modules/zod/v3/standard-schema.cjs +19 -0
  161. package/node_modules/zod/v3/types.cjs +19 -0
  162. package/node_modules/zod/v4/classic/checks.cjs +19 -0
  163. package/node_modules/zod/v4/classic/coerce.cjs +19 -0
  164. package/node_modules/zod/v4/classic/compat.cjs +19 -0
  165. package/node_modules/zod/v4/classic/deep-partial.cjs +19 -0
  166. package/node_modules/zod/v4/classic/errors.cjs +19 -0
  167. package/node_modules/zod/v4/classic/external.cjs +22 -1
  168. package/node_modules/zod/v4/classic/external.d.cts +1 -1
  169. package/node_modules/zod/v4/classic/external.d.ts +1 -1
  170. package/node_modules/zod/v4/classic/external.js +1 -1
  171. package/node_modules/zod/v4/classic/from-json-schema.cjs +264 -24
  172. package/node_modules/zod/v4/classic/from-json-schema.js +245 -24
  173. package/node_modules/zod/v4/classic/in-out.cjs +19 -0
  174. package/node_modules/zod/v4/classic/index.cjs +19 -0
  175. package/node_modules/zod/v4/classic/iso.cjs +19 -0
  176. package/node_modules/zod/v4/classic/parse.cjs +19 -0
  177. package/node_modules/zod/v4/classic/schemas.cjs +100 -35
  178. package/node_modules/zod/v4/classic/schemas.d.cts +15 -1
  179. package/node_modules/zod/v4/classic/schemas.d.ts +15 -1
  180. package/node_modules/zod/v4/classic/schemas.js +77 -33
  181. package/node_modules/zod/v4/core/api.cjs +45 -22
  182. package/node_modules/zod/v4/core/api.d.cts +12 -6
  183. package/node_modules/zod/v4/core/api.d.ts +12 -6
  184. package/node_modules/zod/v4/core/api.js +25 -22
  185. package/node_modules/zod/v4/core/checks.cjs +51 -97
  186. package/node_modules/zod/v4/core/checks.d.cts +17 -1
  187. package/node_modules/zod/v4/core/checks.d.ts +17 -1
  188. package/node_modules/zod/v4/core/checks.js +31 -96
  189. package/node_modules/zod/v4/core/compile.cjs +173 -78
  190. package/node_modules/zod/v4/core/compile.d.cts +18 -4
  191. package/node_modules/zod/v4/core/compile.d.ts +18 -4
  192. package/node_modules/zod/v4/core/compile.js +154 -79
  193. package/node_modules/zod/v4/core/core.cjs +20 -1
  194. package/node_modules/zod/v4/core/core.js +1 -1
  195. package/node_modules/zod/v4/core/doc.cjs +26 -2
  196. package/node_modules/zod/v4/core/doc.js +7 -2
  197. package/node_modules/zod/v4/core/errors.cjs +21 -5
  198. package/node_modules/zod/v4/core/errors.js +2 -5
  199. package/node_modules/zod/v4/core/index.cjs +19 -0
  200. package/node_modules/zod/v4/core/json-schema-generator.cjs +20 -1
  201. package/node_modules/zod/v4/core/json-schema-generator.js +2 -2
  202. package/node_modules/zod/v4/core/json-schema-processors.cjs +188 -72
  203. package/node_modules/zod/v4/core/json-schema-processors.d.cts +16 -0
  204. package/node_modules/zod/v4/core/json-schema-processors.d.ts +16 -0
  205. package/node_modules/zod/v4/core/json-schema-processors.js +170 -74
  206. package/node_modules/zod/v4/core/json-schema.cjs +19 -0
  207. package/node_modules/zod/v4/core/memoizer.cjs +111 -23
  208. package/node_modules/zod/v4/core/memoizer.js +69 -23
  209. package/node_modules/zod/v4/core/parse.cjs +56 -16
  210. package/node_modules/zod/v4/core/parse.js +37 -16
  211. package/node_modules/zod/v4/core/regexes.cjs +31 -6
  212. package/node_modules/zod/v4/core/regexes.d.cts +3 -0
  213. package/node_modules/zod/v4/core/regexes.d.ts +3 -0
  214. package/node_modules/zod/v4/core/regexes.js +10 -4
  215. package/node_modules/zod/v4/core/registries.cjs +19 -0
  216. package/node_modules/zod/v4/core/schemas.cjs +302 -114
  217. package/node_modules/zod/v4/core/schemas.d.cts +28 -8
  218. package/node_modules/zod/v4/core/schemas.d.ts +28 -8
  219. package/node_modules/zod/v4/core/schemas.js +279 -113
  220. package/node_modules/zod/v4/core/standard-schema.cjs +19 -0
  221. package/node_modules/zod/v4/core/to-json-schema.cjs +28 -7
  222. package/node_modules/zod/v4/core/to-json-schema.d.cts +4 -3
  223. package/node_modules/zod/v4/core/to-json-schema.d.ts +4 -3
  224. package/node_modules/zod/v4/core/to-json-schema.js +7 -6
  225. package/node_modules/zod/v4/core/util.cjs +177 -143
  226. package/node_modules/zod/v4/core/util.d.cts +25 -4
  227. package/node_modules/zod/v4/core/util.d.ts +25 -4
  228. package/node_modules/zod/v4/core/util.js +156 -143
  229. package/node_modules/zod/v4/core/versions.cjs +21 -2
  230. package/node_modules/zod/v4/core/versions.d.cts +1 -1
  231. package/node_modules/zod/v4/core/versions.d.ts +1 -1
  232. package/node_modules/zod/v4/core/versions.js +2 -2
  233. package/node_modules/zod/v4/core/visit.cjs +19 -0
  234. package/node_modules/zod/v4/index.cjs +19 -0
  235. package/node_modules/zod/v4/locales/ar.cjs +2 -0
  236. package/node_modules/zod/v4/locales/ar.js +2 -0
  237. package/node_modules/zod/v4/locales/az.cjs +2 -0
  238. package/node_modules/zod/v4/locales/az.js +2 -0
  239. package/node_modules/zod/v4/locales/be.cjs +2 -0
  240. package/node_modules/zod/v4/locales/be.js +2 -0
  241. package/node_modules/zod/v4/locales/bg.cjs +2 -0
  242. package/node_modules/zod/v4/locales/bg.js +2 -0
  243. package/node_modules/zod/v4/locales/bn.cjs +2 -0
  244. package/node_modules/zod/v4/locales/bn.js +2 -0
  245. package/node_modules/zod/v4/locales/ca.cjs +2 -0
  246. package/node_modules/zod/v4/locales/ca.js +2 -0
  247. package/node_modules/zod/v4/locales/ckb.cjs +2 -0
  248. package/node_modules/zod/v4/locales/ckb.js +2 -0
  249. package/node_modules/zod/v4/locales/cs.cjs +2 -0
  250. package/node_modules/zod/v4/locales/cs.js +2 -0
  251. package/node_modules/zod/v4/locales/da.cjs +2 -0
  252. package/node_modules/zod/v4/locales/da.js +2 -0
  253. package/node_modules/zod/v4/locales/de.cjs +2 -0
  254. package/node_modules/zod/v4/locales/de.js +2 -0
  255. package/node_modules/zod/v4/locales/el.cjs +2 -0
  256. package/node_modules/zod/v4/locales/el.js +2 -0
  257. package/node_modules/zod/v4/locales/en.cjs +2 -0
  258. package/node_modules/zod/v4/locales/en.js +2 -0
  259. package/node_modules/zod/v4/locales/eo.cjs +2 -0
  260. package/node_modules/zod/v4/locales/eo.js +2 -0
  261. package/node_modules/zod/v4/locales/es.cjs +2 -0
  262. package/node_modules/zod/v4/locales/es.js +2 -0
  263. package/node_modules/zod/v4/locales/fa.cjs +2 -0
  264. package/node_modules/zod/v4/locales/fa.js +2 -0
  265. package/node_modules/zod/v4/locales/fi.cjs +2 -0
  266. package/node_modules/zod/v4/locales/fi.js +2 -0
  267. package/node_modules/zod/v4/locales/fr-CA.cjs +2 -0
  268. package/node_modules/zod/v4/locales/fr-CA.js +2 -0
  269. package/node_modules/zod/v4/locales/fr.cjs +2 -0
  270. package/node_modules/zod/v4/locales/fr.js +2 -0
  271. package/node_modules/zod/v4/locales/gu.cjs +2 -0
  272. package/node_modules/zod/v4/locales/gu.js +2 -0
  273. package/node_modules/zod/v4/locales/he.cjs +2 -0
  274. package/node_modules/zod/v4/locales/he.js +2 -0
  275. package/node_modules/zod/v4/locales/hi.cjs +2 -0
  276. package/node_modules/zod/v4/locales/hi.js +2 -0
  277. package/node_modules/zod/v4/locales/hr.cjs +2 -0
  278. package/node_modules/zod/v4/locales/hr.js +2 -0
  279. package/node_modules/zod/v4/locales/hu.cjs +2 -0
  280. package/node_modules/zod/v4/locales/hu.js +2 -0
  281. package/node_modules/zod/v4/locales/hy.cjs +2 -0
  282. package/node_modules/zod/v4/locales/hy.js +2 -0
  283. package/node_modules/zod/v4/locales/id.cjs +2 -0
  284. package/node_modules/zod/v4/locales/id.js +2 -0
  285. package/node_modules/zod/v4/locales/index.cjs +22 -1
  286. package/node_modules/zod/v4/locales/index.d.cts +1 -0
  287. package/node_modules/zod/v4/locales/index.d.ts +1 -0
  288. package/node_modules/zod/v4/locales/index.js +1 -0
  289. package/node_modules/zod/v4/locales/is.cjs +2 -0
  290. package/node_modules/zod/v4/locales/is.js +2 -0
  291. package/node_modules/zod/v4/locales/it.cjs +2 -0
  292. package/node_modules/zod/v4/locales/it.js +2 -0
  293. package/node_modules/zod/v4/locales/ja.cjs +2 -0
  294. package/node_modules/zod/v4/locales/ja.js +2 -0
  295. package/node_modules/zod/v4/locales/ka.cjs +2 -0
  296. package/node_modules/zod/v4/locales/ka.js +2 -0
  297. package/node_modules/zod/v4/locales/km.cjs +2 -0
  298. package/node_modules/zod/v4/locales/km.js +2 -0
  299. package/node_modules/zod/v4/locales/kn.cjs +2 -0
  300. package/node_modules/zod/v4/locales/kn.js +2 -0
  301. package/node_modules/zod/v4/locales/ko.cjs +2 -0
  302. package/node_modules/zod/v4/locales/ko.js +2 -0
  303. package/node_modules/zod/v4/locales/lt.cjs +2 -0
  304. package/node_modules/zod/v4/locales/lt.js +2 -0
  305. package/node_modules/zod/v4/locales/mk.cjs +2 -0
  306. package/node_modules/zod/v4/locales/mk.js +2 -0
  307. package/node_modules/zod/v4/locales/ms.cjs +2 -0
  308. package/node_modules/zod/v4/locales/ms.js +2 -0
  309. package/node_modules/zod/v4/locales/ne.cjs +2 -0
  310. package/node_modules/zod/v4/locales/ne.js +2 -0
  311. package/node_modules/zod/v4/locales/nl.cjs +2 -0
  312. package/node_modules/zod/v4/locales/nl.js +2 -0
  313. package/node_modules/zod/v4/locales/nn.cjs +2 -0
  314. package/node_modules/zod/v4/locales/nn.js +2 -0
  315. package/node_modules/zod/v4/locales/no.cjs +2 -0
  316. package/node_modules/zod/v4/locales/no.js +2 -0
  317. package/node_modules/zod/v4/locales/ota.cjs +2 -0
  318. package/node_modules/zod/v4/locales/ota.js +2 -0
  319. package/node_modules/zod/v4/locales/pl.cjs +2 -0
  320. package/node_modules/zod/v4/locales/pl.js +2 -0
  321. package/node_modules/zod/v4/locales/ps.cjs +2 -0
  322. package/node_modules/zod/v4/locales/ps.js +2 -0
  323. package/node_modules/zod/v4/locales/pt-BR.cjs +2 -0
  324. package/node_modules/zod/v4/locales/pt-BR.js +2 -0
  325. package/node_modules/zod/v4/locales/pt.cjs +2 -0
  326. package/node_modules/zod/v4/locales/pt.js +2 -0
  327. package/node_modules/zod/v4/locales/ro.cjs +2 -0
  328. package/node_modules/zod/v4/locales/ro.js +2 -0
  329. package/node_modules/zod/v4/locales/ru.cjs +2 -0
  330. package/node_modules/zod/v4/locales/ru.js +2 -0
  331. package/node_modules/zod/v4/locales/sk.cjs +2 -0
  332. package/node_modules/zod/v4/locales/sk.js +2 -0
  333. package/node_modules/zod/v4/locales/sl.cjs +2 -0
  334. package/node_modules/zod/v4/locales/sl.js +2 -0
  335. package/node_modules/zod/v4/locales/sv.cjs +2 -0
  336. package/node_modules/zod/v4/locales/sv.js +2 -0
  337. package/node_modules/zod/v4/locales/ta.cjs +2 -0
  338. package/node_modules/zod/v4/locales/ta.js +2 -0
  339. package/node_modules/zod/v4/locales/tg.cjs +144 -0
  340. package/node_modules/zod/v4/locales/tg.d.cts +5 -0
  341. package/node_modules/zod/v4/locales/tg.d.ts +4 -0
  342. package/node_modules/zod/v4/locales/tg.js +117 -0
  343. package/node_modules/zod/v4/locales/th.cjs +2 -0
  344. package/node_modules/zod/v4/locales/th.js +2 -0
  345. package/node_modules/zod/v4/locales/tk.cjs +2 -0
  346. package/node_modules/zod/v4/locales/tk.js +2 -0
  347. package/node_modules/zod/v4/locales/tr.cjs +2 -0
  348. package/node_modules/zod/v4/locales/tr.js +2 -0
  349. package/node_modules/zod/v4/locales/uk.cjs +2 -0
  350. package/node_modules/zod/v4/locales/uk.js +2 -0
  351. package/node_modules/zod/v4/locales/ur.cjs +2 -0
  352. package/node_modules/zod/v4/locales/ur.js +2 -0
  353. package/node_modules/zod/v4/locales/uz.cjs +2 -0
  354. package/node_modules/zod/v4/locales/uz.js +2 -0
  355. package/node_modules/zod/v4/locales/vi.cjs +2 -0
  356. package/node_modules/zod/v4/locales/vi.js +2 -0
  357. package/node_modules/zod/v4/locales/yo.cjs +2 -0
  358. package/node_modules/zod/v4/locales/yo.js +2 -0
  359. package/node_modules/zod/v4/locales/zh-CN.cjs +2 -0
  360. package/node_modules/zod/v4/locales/zh-CN.js +2 -0
  361. package/node_modules/zod/v4/locales/zh-TW.cjs +2 -0
  362. package/node_modules/zod/v4/locales/zh-TW.js +2 -0
  363. package/node_modules/zod/v4/mini/checks.cjs +19 -0
  364. package/node_modules/zod/v4/mini/coerce.cjs +19 -0
  365. package/node_modules/zod/v4/mini/deep-partial.cjs +19 -0
  366. package/node_modules/zod/v4/mini/external.cjs +22 -1
  367. package/node_modules/zod/v4/mini/external.d.cts +1 -1
  368. package/node_modules/zod/v4/mini/external.d.ts +1 -1
  369. package/node_modules/zod/v4/mini/external.js +1 -1
  370. package/node_modules/zod/v4/mini/in-out.cjs +19 -0
  371. package/node_modules/zod/v4/mini/index.cjs +19 -0
  372. package/node_modules/zod/v4/mini/iso.cjs +19 -0
  373. package/node_modules/zod/v4/mini/parse.cjs +19 -0
  374. package/node_modules/zod/v4/mini/schemas.cjs +44 -8
  375. package/node_modules/zod/v4/mini/schemas.d.cts +6 -1
  376. package/node_modules/zod/v4/mini/schemas.d.ts +6 -1
  377. package/node_modules/zod/v4/mini/schemas.js +21 -6
  378. package/node_modules/zod/v4-mini/index.cjs +19 -0
  379. package/package.json +6 -6
@@ -432,84 +432,84 @@ abide by its terms.
432
432
 
433
433
  <!-- Definitions -->
434
434
 
435
- [build-badge]: https://github.com/micromark/micromark-extension-gfm-table/workflows/main/badge.svg
436
-
437
- [build]: https://github.com/micromark/micromark-extension-gfm-table/actions
435
+ [api-gfm-table]: #gfmtable
438
436
 
439
- [coverage-badge]: https://img.shields.io/codecov/c/github/micromark/micromark-extension-gfm-table.svg
437
+ [api-gfm-table-html]: #gfmtablehtml
440
438
 
441
- [coverage]: https://codecov.io/github/micromark/micromark-extension-gfm-table
439
+ [author]: https://wooorm.com
442
440
 
443
- [downloads-badge]: https://img.shields.io/npm/dm/micromark-extension-gfm-table.svg
441
+ [backers-badge]: https://opencollective.com/unified/backers/badge.svg
444
442
 
445
- [downloads]: https://www.npmjs.com/package/micromark-extension-gfm-table
443
+ [build]: https://github.com/micromark/micromark-extension-gfm-table/actions
446
444
 
447
- [size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=micromark-extension-gfm-table
445
+ [build-badge]: https://github.com/micromark/micromark-extension-gfm-table/workflows/main/badge.svg
448
446
 
449
- [size]: https://bundlejs.com/?q=micromark-extension-gfm-table
447
+ [chat]: https://github.com/micromark/micromark/discussions
450
448
 
451
- [sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg
449
+ [chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg
452
450
 
453
- [backers-badge]: https://opencollective.com/unified/backers/badge.svg
451
+ [coc]: https://github.com/micromark/.github/blob/main/code-of-conduct.md
454
452
 
455
453
  [collective]: https://opencollective.com/unified
456
454
 
457
- [chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg
458
-
459
- [chat]: https://github.com/micromark/micromark/discussions
455
+ [contributing]: https://github.com/micromark/.github/blob/main/contributing.md
460
456
 
461
- [npm]: https://docs.npmjs.com/cli/install
457
+ [coverage]: https://codecov.io/github/micromark/micromark-extension-gfm-table
462
458
 
463
- [esmsh]: https://esm.sh
459
+ [coverage-badge]: https://img.shields.io/codecov/c/github/micromark/micromark-extension-gfm-table.svg
464
460
 
465
- [license]: license
461
+ [development]: https://nodejs.org/api/packages.html#packages_resolving_user_conditions
466
462
 
467
- [author]: https://wooorm.com
463
+ [downloads]: https://www.npmjs.com/package/micromark-extension-gfm-table
468
464
 
469
- [contributing]: https://github.com/micromark/.github/blob/main/contributing.md
465
+ [downloads-badge]: https://img.shields.io/npm/dm/micromark-extension-gfm-table.svg
470
466
 
471
- [support]: https://github.com/micromark/.github/blob/main/support.md
467
+ [esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c
472
468
 
473
- [coc]: https://github.com/micromark/.github/blob/main/code-of-conduct.md
469
+ [esmsh]: https://esm.sh
474
470
 
475
- [esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c
471
+ [github-markdown-css]: https://github.com/sindresorhus/github-markdown-css
476
472
 
477
- [typescript]: https://www.typescriptlang.org
473
+ [html-table]: https://html.spec.whatwg.org/multipage/tables.html#the-table-element
478
474
 
479
- [development]: https://nodejs.org/api/packages.html#packages_resolving_user_conditions
475
+ [html-tbody]: https://html.spec.whatwg.org/multipage/tables.html#the-tbody-element
480
476
 
481
- [micromark]: https://github.com/micromark/micromark
477
+ [html-td]: https://html.spec.whatwg.org/multipage/tables.html#the-td-element
482
478
 
483
- [micromark-extension]: https://github.com/micromark/micromark#syntaxextension
479
+ [html-th]: https://html.spec.whatwg.org/multipage/tables.html#the-th-element
484
480
 
485
- [micromark-html-extension]: https://github.com/micromark/micromark#htmlextension
481
+ [html-thead]: https://html.spec.whatwg.org/multipage/tables.html#the-thead-element
486
482
 
487
- [micromark-content-type]: https://github.com/micromark/micromark#content-types
483
+ [html-tr]: https://html.spec.whatwg.org/multipage/tables.html#the-tr-element
488
484
 
489
- [micromark-extension-gfm]: https://github.com/micromark/micromark-extension-gfm
485
+ [license]: license
490
486
 
491
487
  [mdast-util-gfm]: https://github.com/syntax-tree/mdast-util-gfm
492
488
 
493
489
  [mdast-util-gfm-table]: https://github.com/syntax-tree/mdast-util-gfm-table
494
490
 
495
- [remark-gfm]: https://github.com/remarkjs/remark-gfm
491
+ [micromark]: https://github.com/micromark/micromark
496
492
 
497
- [tables]: https://github.github.com/gfm/#tables-extension-
493
+ [micromark-content-type]: https://github.com/micromark/micromark#content-types
498
494
 
499
- [html-table]: https://html.spec.whatwg.org/multipage/tables.html#the-table-element
495
+ [micromark-extension]: https://github.com/micromark/micromark#syntaxextension
500
496
 
501
- [html-tbody]: https://html.spec.whatwg.org/multipage/tables.html#the-tbody-element
497
+ [micromark-extension-gfm]: https://github.com/micromark/micromark-extension-gfm
502
498
 
503
- [html-thead]: https://html.spec.whatwg.org/multipage/tables.html#the-thead-element
499
+ [micromark-html-extension]: https://github.com/micromark/micromark#htmlextension
504
500
 
505
- [html-tr]: https://html.spec.whatwg.org/multipage/tables.html#the-tr-element
501
+ [npm]: https://docs.npmjs.com/cli/install
506
502
 
507
- [html-td]: https://html.spec.whatwg.org/multipage/tables.html#the-td-element
503
+ [remark-gfm]: https://github.com/remarkjs/remark-gfm
508
504
 
509
- [html-th]: https://html.spec.whatwg.org/multipage/tables.html#the-th-element
505
+ [size]: https://bundlejs.com/?q=micromark-extension-gfm-table
510
506
 
511
- [github-markdown-css]: https://github.com/sindresorhus/github-markdown-css
507
+ [size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=micromark-extension-gfm-table
512
508
 
513
- [api-gfm-table]: #gfmtable
509
+ [sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg
514
510
 
515
- [api-gfm-table-html]: #gfmtablehtml
511
+ [support]: https://github.com/micromark/.github/blob/main/support.md
512
+
513
+ [tables]: https://github.github.com/gfm/#tables-extension-
514
+
515
+ [typescript]: https://www.typescriptlang.org
@@ -155,13 +155,13 @@ try {
155
155
  expected: 'string',
156
156
  code: 'invalid_type',
157
157
  path: [ 'username' ],
158
- message: 'Invalid input: expected string'
158
+ message: 'Invalid input: expected string, received number'
159
159
  },
160
160
  {
161
161
  expected: 'number',
162
162
  code: 'invalid_type',
163
163
  path: [ 'xp' ],
164
- message: 'Invalid input: expected number'
164
+ message: 'Invalid input: expected number, received string'
165
165
  }
166
166
  ] */
167
167
  }
@@ -75,3 +75,22 @@ core.globalConfig.postProcessor = (inst) => {
75
75
  shim.__originalRun = originalRun;
76
76
  inst._zod.run = shim;
77
77
  };
78
+
79
+ // seal-cjs-exports
80
+ (function () {
81
+ var keys = Object.getOwnPropertyNames(exports);
82
+ for (var i = 0; i < keys.length; i++) {
83
+ var desc = Object.getOwnPropertyDescriptor(exports, keys[i]);
84
+ if (!desc || !desc.get || !desc.configurable) continue;
85
+ var value;
86
+ try {
87
+ value = desc.get();
88
+ } catch (e) {
89
+ continue;
90
+ }
91
+ // a circular require may not have settled this one yet, so leave it live
92
+ if (value === undefined) continue;
93
+ Object.defineProperty(exports, keys[i], { value: value, writable: false, enumerable: desc.enumerable, configurable: false });
94
+ }
95
+ Object.freeze(exports);
96
+ })();
@@ -31,3 +31,22 @@ const z = __importStar(require("./v4/classic/external.cjs"));
31
31
  exports.z = z;
32
32
  exports.default = z;
33
33
  __exportStar(require("./v4/classic/external.cjs"), exports);
34
+
35
+ // seal-cjs-exports
36
+ (function () {
37
+ var keys = Object.getOwnPropertyNames(exports);
38
+ for (var i = 0; i < keys.length; i++) {
39
+ var desc = Object.getOwnPropertyDescriptor(exports, keys[i]);
40
+ if (!desc || !desc.get || !desc.configurable) continue;
41
+ var value;
42
+ try {
43
+ value = desc.get();
44
+ } catch (e) {
45
+ continue;
46
+ }
47
+ // a circular require may not have settled this one yet, so leave it live
48
+ if (value === undefined) continue;
49
+ Object.defineProperty(exports, keys[i], { value: value, writable: false, enumerable: desc.enumerable, configurable: false });
50
+ }
51
+ Object.freeze(exports);
52
+ })();
@@ -15,3 +15,22 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("../v4/locales/index.cjs"), exports);
18
+
19
+ // seal-cjs-exports
20
+ (function () {
21
+ var keys = Object.getOwnPropertyNames(exports);
22
+ for (var i = 0; i < keys.length; i++) {
23
+ var desc = Object.getOwnPropertyDescriptor(exports, keys[i]);
24
+ if (!desc || !desc.get || !desc.configurable) continue;
25
+ var value;
26
+ try {
27
+ value = desc.get();
28
+ } catch (e) {
29
+ continue;
30
+ }
31
+ // a circular require may not have settled this one yet, so leave it live
32
+ if (value === undefined) continue;
33
+ Object.defineProperty(exports, keys[i], { value: value, writable: false, enumerable: desc.enumerable, configurable: false });
34
+ }
35
+ Object.freeze(exports);
36
+ })();
@@ -30,3 +30,22 @@ exports.z = void 0;
30
30
  const z = __importStar(require("../v4/mini/external.cjs"));
31
31
  exports.z = z;
32
32
  __exportStar(require("../v4/mini/external.cjs"), exports);
33
+
34
+ // seal-cjs-exports
35
+ (function () {
36
+ var keys = Object.getOwnPropertyNames(exports);
37
+ for (var i = 0; i < keys.length; i++) {
38
+ var desc = Object.getOwnPropertyDescriptor(exports, keys[i]);
39
+ if (!desc || !desc.get || !desc.configurable) continue;
40
+ var value;
41
+ try {
42
+ value = desc.get();
43
+ } catch (e) {
44
+ continue;
45
+ }
46
+ // a circular require may not have settled this one yet, so leave it live
47
+ if (value === undefined) continue;
48
+ Object.defineProperty(exports, keys[i], { value: value, writable: false, enumerable: desc.enumerable, configurable: false });
49
+ }
50
+ Object.freeze(exports);
51
+ })();
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zod",
3
- "version": "4.5.4",
3
+ "version": "4.6.5",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "author": "Colin McDonnell <zod@colinhacks.com>",
@@ -52,7 +52,8 @@
52
52
  },
53
53
  "conditions": {
54
54
  "@zod/source": "src"
55
- }
55
+ },
56
+ "sealCjsExports": true
56
57
  },
57
58
  "exports": {
58
59
  "./package.json": "./package.json",
@@ -137,10 +138,10 @@
137
138
  },
138
139
  "scripts": {
139
140
  "clean": "git clean -xdf . -e node_modules",
140
- "build": "zshy --project tsconfig.build.json",
141
- "postbuild": "tsx ../../scripts/write-stub-package-jsons.ts && pnpm biome check --write .",
142
- "test:watch": "pnpm vitest",
143
- "test": "pnpm vitest run",
144
- "prepublishOnly": "tsx ../../scripts/check-versions.ts"
141
+ "build": "nub exec --node zshy --project tsconfig.build.json",
142
+ "postbuild": "nub ../../scripts/write-stub-package-jsons.ts && nub exec --node biome check --write .",
143
+ "test:watch": "nub exec --node vitest",
144
+ "test": "nub exec --node vitest run",
145
+ "prepublishOnly": "nub ../../scripts/check-versions.ts"
145
146
  }
146
147
  }
@@ -2,7 +2,7 @@ export namespace errorUtil {
2
2
  export type ErrMessage = string | { message?: string | undefined };
3
3
  export const errToObj = (message?: ErrMessage): { message?: string | undefined } =>
4
4
  typeof message === "string" ? { message } : message || {};
5
- // biome-ignore lint:
5
+ // biome-ignore lint/suspicious/noShadowRestrictedNames: renaming churns 31 v3 call sites
6
6
  export const toString = (message?: ErrMessage): string | undefined =>
7
7
  typeof message === "string" ? message : message?.message;
8
8
  }
@@ -26,8 +26,10 @@ export {
26
26
  TimePrecision,
27
27
  util,
28
28
  NEVER,
29
+ INVALID,
29
30
  toZod,
30
31
  compile,
32
+ withParser,
31
33
  ZodCompileAsyncError,
32
34
  ZodCompileUnsupportedError,
33
35
  getDiscriminatedOption,
@@ -155,34 +155,225 @@ function resolveRef(ref: string, ctx: ConversionContext): JSONSchema.JSONSchema
155
155
  }
156
156
 
157
157
  /**
158
- * Rejects every own key that fails `keySchema`, before `objectSchema` runs. The
159
- * guard has to see the raw input: an object parse drops `__proto__` and can add
160
- * keys from a property `default`, so its output is not the set of names the
161
- * instance actually carried.
158
+ * Enforces the keywords that constrain an object's own keys — `propertyNames`,
159
+ * `minProperties`, `maxProperties` — before `objectSchema` runs. The guard has
160
+ * to see the raw input: an object parse drops `__proto__` and can add keys from
161
+ * a property `default`, so its output is not the set of names the instance
162
+ * actually carried.
162
163
  */
163
- function checkPropertyNames(objectSchema: ZodType, keySchema: ZodType): ZodType {
164
+ function checkObjectGuards(
165
+ objectSchema: ZodType,
166
+ guards: { keySchema?: ZodType | undefined; minProperties?: number | undefined; maxProperties?: number | undefined }
167
+ ): ZodType {
164
168
  // An identity transform, not z.any(), so `toJSONSchema` reports the object on both the input and the output side of the pipe.
165
169
  const guard = z
166
170
  .transform((value: unknown) => value)
167
171
  .check((payload) => {
168
172
  const value = payload.value;
169
173
  if (typeof value !== "object" || value === null || Array.isArray(value)) return;
170
- for (const key of Object.getOwnPropertyNames(value)) {
171
- const result = keySchema.safeParse(key);
172
- if (result.success) continue;
174
+ const keys = Object.getOwnPropertyNames(value);
175
+ if (guards.minProperties !== undefined && keys.length < guards.minProperties) {
173
176
  payload.issues.push({
174
- code: "invalid_key",
175
- origin: "record",
176
- issues: result.error.issues,
177
- input: key,
178
- path: [key],
177
+ origin: "object",
178
+ code: "too_small",
179
+ minimum: guards.minProperties,
180
+ inclusive: true,
181
+ message: `Too small: expected object to have >=${guards.minProperties} properties`,
182
+ input: value,
183
+ inst: objectSchema,
179
184
  continue: true,
180
185
  });
181
186
  }
187
+ if (guards.maxProperties !== undefined && keys.length > guards.maxProperties) {
188
+ payload.issues.push({
189
+ origin: "object",
190
+ code: "too_big",
191
+ maximum: guards.maxProperties,
192
+ inclusive: true,
193
+ message: `Too big: expected object to have <=${guards.maxProperties} properties`,
194
+ input: value,
195
+ inst: objectSchema,
196
+ continue: true,
197
+ });
198
+ }
199
+ if (guards.keySchema) {
200
+ for (const key of keys) {
201
+ const result = guards.keySchema.safeParse(key);
202
+ if (result.success) continue;
203
+ payload.issues.push({
204
+ code: "invalid_key",
205
+ origin: "record",
206
+ issues: result.error.issues,
207
+ input: key,
208
+ path: [key],
209
+ continue: true,
210
+ });
211
+ }
212
+ }
182
213
  });
183
214
  return guard.pipe(objectSchema);
184
215
  }
185
216
 
217
+ /**
218
+ * An injective string for JSON data: two values share a key exactly when `uniqueItems` calls them
219
+ * equal, so duplicate detection is a Map lookup rather than a pairwise walk. Strings and keys are
220
+ * length-prefixed so no value can spell another one. `null` means "never equal to anything" — a
221
+ * cycle or a NaN, neither of which JSON can express.
222
+ */
223
+ function canonicalKey(value: unknown, seen: Set<object>): string | null {
224
+ if (value === null) return "z";
225
+ const type = typeof value;
226
+ if (type !== "object") {
227
+ if (type === "number" && Number.isNaN(value)) return null;
228
+ const raw = String(value);
229
+ return `${type[0]}${raw.length}:${raw}`;
230
+ }
231
+ if (seen.has(value as object)) return null;
232
+ seen.add(value as object);
233
+ try {
234
+ if (Array.isArray(value)) {
235
+ const parts: string[] = [];
236
+ for (const item of value) {
237
+ const key = canonicalKey(item, seen);
238
+ if (key === null) return null;
239
+ parts.push(key);
240
+ }
241
+ return `a${parts.length}:[${parts.join(",")}]`;
242
+ }
243
+ const keys = Object.keys(value as object).sort();
244
+ const parts: string[] = [];
245
+ for (const k of keys) {
246
+ const key = canonicalKey((value as any)[k], seen);
247
+ if (key === null) return null;
248
+ parts.push(`${k.length}:${k}=${key}`);
249
+ }
250
+ return `o${parts.length}:{${parts.join(",")}}`;
251
+ } finally {
252
+ seen.delete(value as object);
253
+ }
254
+ }
255
+
256
+ // keywords whose value is a schema or an array of them
257
+ const SCHEMA_KEYWORDS = /*@__PURE__*/ new Set([
258
+ "items",
259
+ "prefixItems",
260
+ "additionalItems",
261
+ "additionalProperties",
262
+ "contains",
263
+ "propertyNames",
264
+ "not",
265
+ "if",
266
+ "then",
267
+ "else",
268
+ "allOf",
269
+ "anyOf",
270
+ "oneOf",
271
+ "unevaluatedItems",
272
+ "unevaluatedProperties",
273
+ "contentSchema",
274
+ ]);
275
+
276
+ // keywords whose value maps names to schemas. draft-7 `dependencies` also allows an array of property names, which holds no schema to walk
277
+ const SCHEMA_MAP_KEYWORDS = /*@__PURE__*/ new Set([
278
+ "properties",
279
+ "patternProperties",
280
+ "dependentSchemas",
281
+ "dependencies",
282
+ "$defs",
283
+ "definitions",
284
+ ]);
285
+
286
+ /**
287
+ * True when a subschema holds a `$ref` anywhere a schema can appear. Only those positions are
288
+ * walked: `$ref` under `default` or an `x-` annotation is instance data with an ordinary key, and
289
+ * reading it as a reference would drop a constraint that resolves perfectly well.
290
+ */
291
+ function containsRef(value: unknown): boolean {
292
+ if (typeof value !== "object" || value === null) return false;
293
+ if (Array.isArray(value)) return value.some(containsRef);
294
+ if (typeof (value as any).$ref === "string") return true;
295
+ return Object.entries(value).some(([key, sub]) => {
296
+ if (SCHEMA_KEYWORDS.has(key)) return containsRef(sub);
297
+ if (!SCHEMA_MAP_KEYWORDS.has(key) || typeof sub !== "object" || sub === null) return false;
298
+ return Object.values(sub).some(containsRef);
299
+ });
300
+ }
301
+
302
+ function plural(n: number): string {
303
+ return n === 1 ? "element" : "elements";
304
+ }
305
+
306
+ /**
307
+ * Enforces `uniqueItems` and the `contains` family before `arraySchema` runs, for the same reason
308
+ * `checkObjectGuards` runs pre-pipe: an item parse can apply a nested `default`, so the parsed
309
+ * array is not the instance the keywords are defined over. A guard issue aborts the pipe, so
310
+ * `minItems`/`maxItems` are not also reported on the same parse — instance correctness is worth
311
+ * more than co-reporting two issues.
312
+ */
313
+ function checkArrayGuards(
314
+ arraySchema: ZodType,
315
+ guards: {
316
+ uniqueItems?: boolean | undefined;
317
+ containsSchema?: ZodType | undefined;
318
+ minContains?: number | undefined;
319
+ maxContains?: number | undefined;
320
+ }
321
+ ): ZodType {
322
+ // An identity transform, not z.any(), so `toJSONSchema` reports the array on both the input and the output side of the pipe.
323
+ const guard = z
324
+ .transform((value: unknown) => value)
325
+ .check((payload) => {
326
+ const items = payload.value;
327
+ if (!Array.isArray(items)) return;
328
+ if (guards.uniqueItems === true) {
329
+ const firstSeen = new Map<string, number>();
330
+ for (let i = 0; i < items.length; i++) {
331
+ const key = canonicalKey(items[i], new Set());
332
+ if (key === null) continue;
333
+ const first = firstSeen.get(key);
334
+ if (first === undefined) {
335
+ firstSeen.set(key, i);
336
+ continue;
337
+ }
338
+ payload.issues.push({
339
+ code: "custom",
340
+ message: `Array items must be unique: element at index ${i} duplicates the one at index ${first}`,
341
+ input: items,
342
+ path: [i],
343
+ continue: true,
344
+ });
345
+ }
346
+ }
347
+ if (guards.containsSchema) {
348
+ const minContains = guards.minContains ?? 1;
349
+ // one past the ceiling already proves the failure, and nothing above it changes the verdict
350
+ const ceiling = guards.maxContains !== undefined ? guards.maxContains + 1 : Number.POSITIVE_INFINITY;
351
+ let matches = 0;
352
+ for (const item of items) {
353
+ if (guards.containsSchema.safeParse(item).success && ++matches >= ceiling) break;
354
+ }
355
+ if (matches < minContains) {
356
+ // the scan ran to the end, so this count is exact
357
+ payload.issues.push({
358
+ code: "custom",
359
+ message: `Array must contain at least ${minContains} matching ${plural(minContains)}; found ${matches}`,
360
+ input: items,
361
+ continue: true,
362
+ });
363
+ }
364
+ if (guards.maxContains !== undefined && matches > guards.maxContains) {
365
+ payload.issues.push({
366
+ code: "custom",
367
+ message: `Array must contain at most ${guards.maxContains} matching ${plural(guards.maxContains)}`,
368
+ input: items,
369
+ continue: true,
370
+ });
371
+ }
372
+ }
373
+ });
374
+ return guard.pipe(arraySchema);
375
+ }
376
+
186
377
  function getTupleRest(restSchema: JSONSchema._JSONSchema | undefined, ctx: ConversionContext): ZodType | undefined {
187
378
  if (restSchema === false) {
188
379
  return undefined;
@@ -351,6 +542,8 @@ function convertBaseSchema(schema: JSONSchema.JSONSchema, ctx: ConversionContext
351
542
  stringSchema = stringSchema.check(z.e164());
352
543
  } else if (format === "credit_card") {
353
544
  stringSchema = stringSchema.check(z.creditCard());
545
+ } else if (format === "iban") {
546
+ stringSchema = stringSchema.check(z.iban());
354
547
  } else if (format === "jwt") {
355
548
  stringSchema = stringSchema.check(z.jwt());
356
549
  } else if (format === "emoji") {
@@ -519,20 +712,25 @@ function convertBaseSchema(schema: JSONSchema.JSONSchema, ctx: ConversionContext
519
712
  }
520
713
 
521
714
  // propertyNames constrains key *names* only, and says nothing about which keys are required or how their values validate. Layering it on top of the result keeps properties/patternProperties/additionalProperties composing underneath. `true` allows every name, so it needs no guard.
522
- if (schema.propertyNames !== undefined && schema.propertyNames !== true) {
523
- // Keys are always strings, so a propertyNames subschema that omits `type` still constrains them — without this it would convert to z.any().
524
- const keyJSONSchema =
525
- typeof schema.propertyNames === "object" && schema.propertyNames.type === undefined
526
- ? { type: "string", ...schema.propertyNames }
527
- : schema.propertyNames;
528
- zodSchema = checkPropertyNames(zodSchema, convertSchema(keyJSONSchema as JSONSchema.JSONSchema, ctx));
715
+ const hasKeyGuard = schema.propertyNames !== undefined && schema.propertyNames !== true;
716
+ const minProperties = typeof schema.minProperties === "number" ? schema.minProperties : undefined;
717
+ const maxProperties = typeof schema.maxProperties === "number" ? schema.maxProperties : undefined;
718
+ if (hasKeyGuard || minProperties !== undefined || maxProperties !== undefined) {
719
+ let keySchema: ZodType | undefined;
720
+ if (hasKeyGuard) {
721
+ // Keys are always strings, so a propertyNames subschema that omits `type` still constrains them — without this it would convert to z.any().
722
+ const keyJSONSchema =
723
+ typeof schema.propertyNames === "object" && schema.propertyNames.type === undefined
724
+ ? { type: "string", ...schema.propertyNames }
725
+ : schema.propertyNames;
726
+ keySchema = convertSchema(keyJSONSchema as JSONSchema.JSONSchema, ctx);
727
+ }
728
+ zodSchema = checkObjectGuards(zodSchema, { keySchema, minProperties, maxProperties });
529
729
  }
530
730
  break;
531
731
  }
532
732
 
533
733
  case "array": {
534
- // TODO: uniqueItems and contains/minContains/maxContains are not supported
535
-
536
734
  // Check if this is a tuple (prefixItems or items as array)
537
735
  const prefixItems = schema.prefixItems;
538
736
  const items = schema.items;
@@ -585,6 +783,18 @@ function convertBaseSchema(schema: JSONSchema.JSONSchema, ctx: ConversionContext
585
783
  // No items specified - array of any
586
784
  zodSchema = z.array(z.any());
587
785
  }
786
+
787
+ // minContains/maxContains only constrain anything when `contains` itself is present
788
+ if (schema.uniqueItems === true || schema.contains !== undefined) {
789
+ zodSchema = checkArrayGuards(zodSchema, {
790
+ uniqueItems: schema.uniqueItems === true,
791
+ containsSchema:
792
+ schema.contains !== undefined ? convertSchema(schema.contains as JSONSchema.JSONSchema, ctx) : undefined,
793
+ minContains: typeof schema.minContains === "number" ? schema.minContains : undefined,
794
+ maxContains: typeof schema.maxContains === "number" ? schema.maxContains : undefined,
795
+ });
796
+ }
797
+
588
798
  break;
589
799
  }
590
800
 
@@ -666,9 +876,22 @@ function convertSchema(schema: JSONSchema.JSONSchema | boolean, ctx: ConversionC
666
876
  }
667
877
  }
668
878
 
669
- // `propertyNames` is enforced by a key guard, which `toJSONSchema` cannot infer, so the original keyword is carried as metadata to keep the round-trip lossless. Only where it was actually applied: on any other type it is inert, and on a `$ref` the metadata would land on the target every reference shares.
670
- if (schema.propertyNames !== undefined && schema.type === "object" && schema.$ref === undefined) {
671
- extraMeta.propertyNames = schema.propertyNames;
879
+ // `propertyNames` and `contains` are enforced by a guard, which `toJSONSchema` cannot infer, so the original keyword is carried as metadata to keep the round-trip lossless. Only where it was actually applied: on any other type it is inert, and on a `$ref` the metadata would land on the target every reference shares. A carried subschema is copied verbatim while the root `$defs` stay behind, so one holding a `$ref` is dropped rather than emitted as a dangling reference.
880
+ if (schema.type === "object" && schema.$ref === undefined) {
881
+ if (schema.propertyNames !== undefined && !containsRef(schema.propertyNames)) {
882
+ extraMeta.propertyNames = schema.propertyNames;
883
+ }
884
+ for (const key of ["minProperties", "maxProperties"] as const) {
885
+ if (schema[key] !== undefined) extraMeta[key] = schema[key];
886
+ }
887
+ }
888
+ if (schema.type === "array" && schema.$ref === undefined) {
889
+ if (schema.contains !== undefined && !containsRef(schema.contains)) {
890
+ extraMeta.contains = schema.contains;
891
+ }
892
+ for (const key of ["uniqueItems", "minContains", "maxContains"] as const) {
893
+ if (schema[key] !== undefined) extraMeta[key] = schema[key];
894
+ }
672
895
  }
673
896
 
674
897
  for (const key of Object.keys(schema)) {