@langchain/core 1.0.0-alpha.3 → 1.0.0-alpha.4

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 (486) hide show
  1. package/README.md +3 -19
  2. package/dist/caches/base.cjs +2 -2
  3. package/dist/caches/base.cjs.map +1 -1
  4. package/dist/callbacks/base.d.ts.map +1 -1
  5. package/dist/document_loaders/langsmith.cjs +1 -1
  6. package/dist/document_loaders/langsmith.cjs.map +1 -1
  7. package/dist/document_loaders/langsmith.js +1 -1
  8. package/dist/document_loaders/langsmith.js.map +1 -1
  9. package/dist/embeddings.cjs.map +1 -1
  10. package/dist/embeddings.d.cts +6 -6
  11. package/dist/embeddings.d.cts.map +1 -1
  12. package/dist/embeddings.d.ts +6 -6
  13. package/dist/embeddings.d.ts.map +1 -1
  14. package/dist/embeddings.js.map +1 -1
  15. package/dist/errors/index.cjs.map +1 -1
  16. package/dist/errors/index.js.map +1 -1
  17. package/dist/indexing/base.cjs +2 -2
  18. package/dist/indexing/base.cjs.map +1 -1
  19. package/dist/indexing/base.d.cts +0 -3
  20. package/dist/indexing/base.d.cts.map +1 -1
  21. package/dist/indexing/base.d.ts +0 -3
  22. package/dist/indexing/base.d.ts.map +1 -1
  23. package/dist/indexing/base.js +2 -2
  24. package/dist/indexing/base.js.map +1 -1
  25. package/dist/language_models/base.cjs +1 -1
  26. package/dist/language_models/base.cjs.map +1 -1
  27. package/dist/language_models/base.d.cts +3 -3
  28. package/dist/language_models/base.d.cts.map +1 -1
  29. package/dist/language_models/base.d.ts +3 -3
  30. package/dist/language_models/base.d.ts.map +1 -1
  31. package/dist/language_models/base.js +1 -1
  32. package/dist/language_models/base.js.map +1 -1
  33. package/dist/language_models/chat_models.cjs.map +1 -1
  34. package/dist/language_models/chat_models.d.ts.map +1 -1
  35. package/dist/language_models/chat_models.js.map +1 -1
  36. package/dist/language_models/llms.cjs.map +1 -1
  37. package/dist/language_models/llms.js.map +1 -1
  38. package/dist/load/import_map.cjs +1 -5
  39. package/dist/load/import_map.cjs.map +1 -1
  40. package/dist/load/import_map.js +3 -7
  41. package/dist/load/import_map.js.map +1 -1
  42. package/dist/load/index.cjs.map +1 -1
  43. package/dist/load/index.js.map +1 -1
  44. package/dist/load/serializable.cjs.map +1 -1
  45. package/dist/load/serializable.d.cts +1 -3
  46. package/dist/load/serializable.d.cts.map +1 -1
  47. package/dist/load/serializable.d.ts +1 -3
  48. package/dist/load/serializable.d.ts.map +1 -1
  49. package/dist/load/serializable.js.map +1 -1
  50. package/dist/messages/ai.cjs +2 -2
  51. package/dist/messages/ai.cjs.map +1 -1
  52. package/dist/messages/ai.js +2 -2
  53. package/dist/messages/ai.js.map +1 -1
  54. package/dist/messages/base.cjs +5 -5
  55. package/dist/messages/base.cjs.map +1 -1
  56. package/dist/messages/base.d.cts +1 -2
  57. package/dist/messages/base.d.cts.map +1 -1
  58. package/dist/messages/base.d.ts +1 -2
  59. package/dist/messages/base.d.ts.map +1 -1
  60. package/dist/messages/base.js +5 -5
  61. package/dist/messages/base.js.map +1 -1
  62. package/dist/messages/block_translators/utils.cjs +1 -1
  63. package/dist/messages/block_translators/utils.cjs.map +1 -1
  64. package/dist/messages/block_translators/utils.js +1 -1
  65. package/dist/messages/block_translators/utils.js.map +1 -1
  66. package/dist/messages/index.cjs +1 -1
  67. package/dist/messages/index.js +1 -1
  68. package/dist/messages/modifier.cjs +4 -1
  69. package/dist/messages/modifier.cjs.map +1 -1
  70. package/dist/messages/modifier.js +4 -1
  71. package/dist/messages/modifier.js.map +1 -1
  72. package/dist/messages/tool.cjs +7 -7
  73. package/dist/messages/tool.cjs.map +1 -1
  74. package/dist/messages/tool.js +7 -7
  75. package/dist/messages/tool.js.map +1 -1
  76. package/dist/messages/transformers.cjs +2 -2
  77. package/dist/messages/transformers.cjs.map +1 -1
  78. package/dist/messages/transformers.js +2 -2
  79. package/dist/messages/transformers.js.map +1 -1
  80. package/dist/messages/utils.cjs +5 -0
  81. package/dist/messages/utils.cjs.map +1 -1
  82. package/dist/messages/utils.js +5 -0
  83. package/dist/messages/utils.js.map +1 -1
  84. package/dist/output_parsers/list.cjs +1 -1
  85. package/dist/output_parsers/list.cjs.map +1 -1
  86. package/dist/output_parsers/list.js +1 -1
  87. package/dist/output_parsers/list.js.map +1 -1
  88. package/dist/output_parsers/openai_functions/json_output_functions_parsers.d.cts +1 -1
  89. package/dist/output_parsers/openai_functions/json_output_functions_parsers.d.ts +1 -1
  90. package/dist/output_parsers/openai_tools/json_output_tools_parsers.cjs +1 -1
  91. package/dist/output_parsers/openai_tools/json_output_tools_parsers.cjs.map +1 -1
  92. package/dist/output_parsers/openai_tools/json_output_tools_parsers.js +1 -1
  93. package/dist/output_parsers/openai_tools/json_output_tools_parsers.js.map +1 -1
  94. package/dist/output_parsers/structured.cjs +2 -1
  95. package/dist/output_parsers/structured.cjs.map +1 -1
  96. package/dist/output_parsers/structured.js +2 -1
  97. package/dist/output_parsers/structured.js.map +1 -1
  98. package/dist/prompts/chat.cjs +3 -1
  99. package/dist/prompts/chat.cjs.map +1 -1
  100. package/dist/prompts/chat.d.cts +4 -12
  101. package/dist/prompts/chat.d.cts.map +1 -1
  102. package/dist/prompts/chat.d.ts +4 -12
  103. package/dist/prompts/chat.d.ts.map +1 -1
  104. package/dist/prompts/chat.js +3 -1
  105. package/dist/prompts/chat.js.map +1 -1
  106. package/dist/prompts/image.cjs.map +1 -1
  107. package/dist/prompts/image.d.cts +0 -2
  108. package/dist/prompts/image.d.cts.map +1 -1
  109. package/dist/prompts/image.d.ts +0 -2
  110. package/dist/prompts/image.d.ts.map +1 -1
  111. package/dist/prompts/image.js.map +1 -1
  112. package/dist/prompts/pipeline.cjs.map +1 -1
  113. package/dist/prompts/pipeline.js.map +1 -1
  114. package/dist/prompts/prompt.cjs.map +1 -1
  115. package/dist/prompts/prompt.d.cts +4 -16
  116. package/dist/prompts/prompt.d.cts.map +1 -1
  117. package/dist/prompts/prompt.d.ts +4 -16
  118. package/dist/prompts/prompt.d.ts.map +1 -1
  119. package/dist/prompts/prompt.js.map +1 -1
  120. package/dist/prompts/structured.cjs.map +1 -1
  121. package/dist/prompts/structured.js.map +1 -1
  122. package/dist/prompts/template.cjs +4 -2
  123. package/dist/prompts/template.cjs.map +1 -1
  124. package/dist/prompts/template.js +4 -2
  125. package/dist/prompts/template.js.map +1 -1
  126. package/dist/runnables/base.cjs +6 -6
  127. package/dist/runnables/base.cjs.map +1 -1
  128. package/dist/runnables/base.d.cts +0 -3
  129. package/dist/runnables/base.d.cts.map +1 -1
  130. package/dist/runnables/base.d.ts +0 -3
  131. package/dist/runnables/base.d.ts.map +1 -1
  132. package/dist/runnables/base.js +6 -6
  133. package/dist/runnables/base.js.map +1 -1
  134. package/dist/runnables/branch.cjs +2 -2
  135. package/dist/runnables/branch.cjs.map +1 -1
  136. package/dist/runnables/branch.js +2 -2
  137. package/dist/runnables/branch.js.map +1 -1
  138. package/dist/runnables/config.cjs.map +1 -1
  139. package/dist/runnables/config.js.map +1 -1
  140. package/dist/runnables/graph.cjs +1 -1
  141. package/dist/runnables/graph.cjs.map +1 -1
  142. package/dist/runnables/graph.js +1 -1
  143. package/dist/runnables/graph.js.map +1 -1
  144. package/dist/runnables/graph_mermaid.cjs +26 -3
  145. package/dist/runnables/graph_mermaid.cjs.map +1 -1
  146. package/dist/runnables/graph_mermaid.js +26 -3
  147. package/dist/runnables/graph_mermaid.js.map +1 -1
  148. package/dist/runnables/remote.cjs.map +1 -1
  149. package/dist/runnables/remote.js.map +1 -1
  150. package/dist/runnables/types.d.cts +0 -1
  151. package/dist/runnables/types.d.cts.map +1 -1
  152. package/dist/runnables/types.d.ts +0 -1
  153. package/dist/runnables/types.d.ts.map +1 -1
  154. package/dist/singletons/async_local_storage/context.cjs.map +1 -1
  155. package/dist/singletons/async_local_storage/context.d.cts +0 -1
  156. package/dist/singletons/async_local_storage/context.d.cts.map +1 -1
  157. package/dist/singletons/async_local_storage/context.d.ts +0 -1
  158. package/dist/singletons/async_local_storage/context.d.ts.map +1 -1
  159. package/dist/singletons/async_local_storage/context.js.map +1 -1
  160. package/dist/singletons/callbacks.cjs.map +1 -1
  161. package/dist/singletons/callbacks.js.map +1 -1
  162. package/dist/tools/index.cjs.map +1 -1
  163. package/dist/tools/index.d.cts +2 -2
  164. package/dist/tools/index.d.cts.map +1 -1
  165. package/dist/tools/index.d.ts +2 -2
  166. package/dist/tools/index.d.ts.map +1 -1
  167. package/dist/tools/index.js.map +1 -1
  168. package/dist/tools/types.d.cts +5 -5
  169. package/dist/tools/types.d.cts.map +1 -1
  170. package/dist/tools/types.d.ts +5 -5
  171. package/dist/tools/types.d.ts.map +1 -1
  172. package/dist/tracers/base.cjs.map +1 -1
  173. package/dist/tracers/base.js.map +1 -1
  174. package/dist/tracers/console.cjs +1 -1
  175. package/dist/tracers/console.cjs.map +1 -1
  176. package/dist/tracers/console.js +1 -1
  177. package/dist/tracers/console.js.map +1 -1
  178. package/dist/tracers/event_stream.cjs +1 -1
  179. package/dist/tracers/event_stream.cjs.map +1 -1
  180. package/dist/tracers/event_stream.d.cts +0 -1
  181. package/dist/tracers/event_stream.d.cts.map +1 -1
  182. package/dist/tracers/event_stream.d.ts +0 -1
  183. package/dist/tracers/event_stream.d.ts.map +1 -1
  184. package/dist/tracers/event_stream.js +1 -1
  185. package/dist/tracers/event_stream.js.map +1 -1
  186. package/dist/tracers/log_stream.cjs.map +1 -1
  187. package/dist/tracers/log_stream.js.map +1 -1
  188. package/dist/tracers/tracer_langchain.cjs.map +1 -1
  189. package/dist/tracers/tracer_langchain.js.map +1 -1
  190. package/dist/utils/chunk_array.cjs.map +1 -1
  191. package/dist/utils/chunk_array.js.map +1 -1
  192. package/dist/utils/env.cjs +1 -1
  193. package/dist/utils/env.cjs.map +1 -1
  194. package/dist/utils/env.js +1 -1
  195. package/dist/utils/env.js.map +1 -1
  196. package/dist/utils/event_source_parse.cjs.map +1 -1
  197. package/dist/utils/event_source_parse.d.cts.map +1 -1
  198. package/dist/utils/event_source_parse.d.ts.map +1 -1
  199. package/dist/utils/event_source_parse.js.map +1 -1
  200. package/dist/utils/hash.cjs +3 -8
  201. package/dist/utils/hash.cjs.map +1 -1
  202. package/dist/utils/hash.d.cts +1 -2
  203. package/dist/utils/hash.d.cts.map +1 -1
  204. package/dist/utils/hash.d.ts +1 -2
  205. package/dist/utils/hash.d.ts.map +1 -1
  206. package/dist/utils/hash.js +2 -6
  207. package/dist/utils/hash.js.map +1 -1
  208. package/dist/utils/js-sha256/hash.cjs +0 -9
  209. package/dist/utils/js-sha256/hash.cjs.map +1 -1
  210. package/dist/utils/js-sha256/hash.js +1 -5
  211. package/dist/utils/js-sha256/hash.js.map +1 -1
  212. package/dist/utils/json.cjs +2 -2
  213. package/dist/utils/json.cjs.map +1 -1
  214. package/dist/utils/json.js +2 -2
  215. package/dist/utils/json.js.map +1 -1
  216. package/dist/utils/json_schema.cjs +3 -2
  217. package/dist/utils/json_schema.cjs.map +1 -1
  218. package/dist/utils/json_schema.d.cts +8 -4
  219. package/dist/utils/json_schema.d.cts.map +1 -1
  220. package/dist/utils/json_schema.d.ts +8 -4
  221. package/dist/utils/json_schema.d.ts.map +1 -1
  222. package/dist/utils/json_schema.js +2 -1
  223. package/dist/utils/json_schema.js.map +1 -1
  224. package/dist/utils/stream.cjs.map +1 -1
  225. package/dist/utils/stream.js.map +1 -1
  226. package/dist/utils/testing/index.cjs.map +1 -1
  227. package/dist/utils/testing/index.d.cts +4 -9
  228. package/dist/utils/testing/index.d.cts.map +1 -1
  229. package/dist/utils/testing/index.d.ts +4 -9
  230. package/dist/utils/testing/index.d.ts.map +1 -1
  231. package/dist/utils/testing/index.js.map +1 -1
  232. package/dist/utils/zod-to-json-schema/Options.cjs +40 -0
  233. package/dist/utils/zod-to-json-schema/Options.cjs.map +1 -0
  234. package/dist/utils/zod-to-json-schema/Options.js +37 -0
  235. package/dist/utils/zod-to-json-schema/Options.js.map +1 -0
  236. package/dist/utils/zod-to-json-schema/Refs.cjs +30 -0
  237. package/dist/utils/zod-to-json-schema/Refs.cjs.map +1 -0
  238. package/dist/utils/zod-to-json-schema/Refs.js +30 -0
  239. package/dist/utils/zod-to-json-schema/Refs.js.map +1 -0
  240. package/dist/utils/zod-to-json-schema/errorMessages.cjs +18 -0
  241. package/dist/utils/zod-to-json-schema/errorMessages.cjs.map +1 -0
  242. package/dist/utils/zod-to-json-schema/errorMessages.d.cts +11 -0
  243. package/dist/utils/zod-to-json-schema/errorMessages.d.cts.map +1 -0
  244. package/dist/utils/zod-to-json-schema/errorMessages.d.ts +11 -0
  245. package/dist/utils/zod-to-json-schema/errorMessages.d.ts.map +1 -0
  246. package/dist/utils/zod-to-json-schema/errorMessages.js +16 -0
  247. package/dist/utils/zod-to-json-schema/errorMessages.js.map +1 -0
  248. package/dist/utils/zod-to-json-schema/getRelativePath.cjs +11 -0
  249. package/dist/utils/zod-to-json-schema/getRelativePath.cjs.map +1 -0
  250. package/dist/utils/zod-to-json-schema/getRelativePath.js +10 -0
  251. package/dist/utils/zod-to-json-schema/getRelativePath.js.map +1 -0
  252. package/dist/utils/zod-to-json-schema/index.cjs +37 -0
  253. package/dist/utils/zod-to-json-schema/index.js +37 -0
  254. package/dist/utils/zod-to-json-schema/parseDef.cjs +57 -0
  255. package/dist/utils/zod-to-json-schema/parseDef.cjs.map +1 -0
  256. package/dist/utils/zod-to-json-schema/parseDef.js +57 -0
  257. package/dist/utils/zod-to-json-schema/parseDef.js.map +1 -0
  258. package/dist/utils/zod-to-json-schema/parseTypes.d.cts +38 -0
  259. package/dist/utils/zod-to-json-schema/parseTypes.d.cts.map +1 -0
  260. package/dist/utils/zod-to-json-schema/parseTypes.d.ts +38 -0
  261. package/dist/utils/zod-to-json-schema/parseTypes.d.ts.map +1 -0
  262. package/dist/utils/zod-to-json-schema/parsers/any.cjs +17 -0
  263. package/dist/utils/zod-to-json-schema/parsers/any.cjs.map +1 -0
  264. package/dist/utils/zod-to-json-schema/parsers/any.d.cts +7 -0
  265. package/dist/utils/zod-to-json-schema/parsers/any.d.cts.map +1 -0
  266. package/dist/utils/zod-to-json-schema/parsers/any.d.ts +7 -0
  267. package/dist/utils/zod-to-json-schema/parsers/any.d.ts.map +1 -0
  268. package/dist/utils/zod-to-json-schema/parsers/any.js +17 -0
  269. package/dist/utils/zod-to-json-schema/parsers/any.js.map +1 -0
  270. package/dist/utils/zod-to-json-schema/parsers/array.cjs +24 -0
  271. package/dist/utils/zod-to-json-schema/parsers/array.cjs.map +1 -0
  272. package/dist/utils/zod-to-json-schema/parsers/array.d.cts +14 -0
  273. package/dist/utils/zod-to-json-schema/parsers/array.d.cts.map +1 -0
  274. package/dist/utils/zod-to-json-schema/parsers/array.d.ts +15 -0
  275. package/dist/utils/zod-to-json-schema/parsers/array.d.ts.map +1 -0
  276. package/dist/utils/zod-to-json-schema/parsers/array.js +23 -0
  277. package/dist/utils/zod-to-json-schema/parsers/array.js.map +1 -0
  278. package/dist/utils/zod-to-json-schema/parsers/bigint.cjs +36 -0
  279. package/dist/utils/zod-to-json-schema/parsers/bigint.cjs.map +1 -0
  280. package/dist/utils/zod-to-json-schema/parsers/bigint.d.cts +16 -0
  281. package/dist/utils/zod-to-json-schema/parsers/bigint.d.cts.map +1 -0
  282. package/dist/utils/zod-to-json-schema/parsers/bigint.d.ts +17 -0
  283. package/dist/utils/zod-to-json-schema/parsers/bigint.d.ts.map +1 -0
  284. package/dist/utils/zod-to-json-schema/parsers/bigint.js +36 -0
  285. package/dist/utils/zod-to-json-schema/parsers/bigint.js.map +1 -0
  286. package/dist/utils/zod-to-json-schema/parsers/boolean.cjs +9 -0
  287. package/dist/utils/zod-to-json-schema/parsers/boolean.cjs.map +1 -0
  288. package/dist/utils/zod-to-json-schema/parsers/boolean.d.cts +7 -0
  289. package/dist/utils/zod-to-json-schema/parsers/boolean.d.cts.map +1 -0
  290. package/dist/utils/zod-to-json-schema/parsers/boolean.d.ts +7 -0
  291. package/dist/utils/zod-to-json-schema/parsers/boolean.d.ts.map +1 -0
  292. package/dist/utils/zod-to-json-schema/parsers/boolean.js +8 -0
  293. package/dist/utils/zod-to-json-schema/parsers/boolean.js.map +1 -0
  294. package/dist/utils/zod-to-json-schema/parsers/branded.cjs +10 -0
  295. package/dist/utils/zod-to-json-schema/parsers/branded.cjs.map +1 -0
  296. package/dist/utils/zod-to-json-schema/parsers/branded.js +10 -0
  297. package/dist/utils/zod-to-json-schema/parsers/branded.js.map +1 -0
  298. package/dist/utils/zod-to-json-schema/parsers/catch.cjs +10 -0
  299. package/dist/utils/zod-to-json-schema/parsers/catch.cjs.map +1 -0
  300. package/dist/utils/zod-to-json-schema/parsers/catch.js +10 -0
  301. package/dist/utils/zod-to-json-schema/parsers/catch.js.map +1 -0
  302. package/dist/utils/zod-to-json-schema/parsers/date.cjs +39 -0
  303. package/dist/utils/zod-to-json-schema/parsers/date.cjs.map +1 -0
  304. package/dist/utils/zod-to-json-schema/parsers/date.d.cts +17 -0
  305. package/dist/utils/zod-to-json-schema/parsers/date.d.cts.map +1 -0
  306. package/dist/utils/zod-to-json-schema/parsers/date.d.ts +17 -0
  307. package/dist/utils/zod-to-json-schema/parsers/date.d.ts.map +1 -0
  308. package/dist/utils/zod-to-json-schema/parsers/date.js +39 -0
  309. package/dist/utils/zod-to-json-schema/parsers/date.js.map +1 -0
  310. package/dist/utils/zod-to-json-schema/parsers/default.cjs +13 -0
  311. package/dist/utils/zod-to-json-schema/parsers/default.cjs.map +1 -0
  312. package/dist/utils/zod-to-json-schema/parsers/default.js +13 -0
  313. package/dist/utils/zod-to-json-schema/parsers/default.js.map +1 -0
  314. package/dist/utils/zod-to-json-schema/parsers/effects.cjs +11 -0
  315. package/dist/utils/zod-to-json-schema/parsers/effects.cjs.map +1 -0
  316. package/dist/utils/zod-to-json-schema/parsers/effects.js +11 -0
  317. package/dist/utils/zod-to-json-schema/parsers/effects.js.map +1 -0
  318. package/dist/utils/zod-to-json-schema/parsers/enum.cjs +12 -0
  319. package/dist/utils/zod-to-json-schema/parsers/enum.cjs.map +1 -0
  320. package/dist/utils/zod-to-json-schema/parsers/enum.d.cts +8 -0
  321. package/dist/utils/zod-to-json-schema/parsers/enum.d.cts.map +1 -0
  322. package/dist/utils/zod-to-json-schema/parsers/enum.d.ts +10 -0
  323. package/dist/utils/zod-to-json-schema/parsers/enum.d.ts.map +1 -0
  324. package/dist/utils/zod-to-json-schema/parsers/enum.js +11 -0
  325. package/dist/utils/zod-to-json-schema/parsers/enum.js.map +1 -0
  326. package/dist/utils/zod-to-json-schema/parsers/intersection.cjs +47 -0
  327. package/dist/utils/zod-to-json-schema/parsers/intersection.cjs.map +1 -0
  328. package/dist/utils/zod-to-json-schema/parsers/intersection.d.cts +10 -0
  329. package/dist/utils/zod-to-json-schema/parsers/intersection.d.cts.map +1 -0
  330. package/dist/utils/zod-to-json-schema/parsers/intersection.d.ts +11 -0
  331. package/dist/utils/zod-to-json-schema/parsers/intersection.d.ts.map +1 -0
  332. package/dist/utils/zod-to-json-schema/parsers/intersection.js +47 -0
  333. package/dist/utils/zod-to-json-schema/parsers/intersection.js.map +1 -0
  334. package/dist/utils/zod-to-json-schema/parsers/literal.cjs +18 -0
  335. package/dist/utils/zod-to-json-schema/parsers/literal.cjs.map +1 -0
  336. package/dist/utils/zod-to-json-schema/parsers/literal.d.cts +11 -0
  337. package/dist/utils/zod-to-json-schema/parsers/literal.d.cts.map +1 -0
  338. package/dist/utils/zod-to-json-schema/parsers/literal.d.ts +12 -0
  339. package/dist/utils/zod-to-json-schema/parsers/literal.d.ts.map +1 -0
  340. package/dist/utils/zod-to-json-schema/parsers/literal.js +17 -0
  341. package/dist/utils/zod-to-json-schema/parsers/literal.js.map +1 -0
  342. package/dist/utils/zod-to-json-schema/parsers/map.cjs +40 -0
  343. package/dist/utils/zod-to-json-schema/parsers/map.cjs.map +1 -0
  344. package/dist/utils/zod-to-json-schema/parsers/map.d.cts +17 -0
  345. package/dist/utils/zod-to-json-schema/parsers/map.d.cts.map +1 -0
  346. package/dist/utils/zod-to-json-schema/parsers/map.d.ts +17 -0
  347. package/dist/utils/zod-to-json-schema/parsers/map.d.ts.map +1 -0
  348. package/dist/utils/zod-to-json-schema/parsers/map.js +40 -0
  349. package/dist/utils/zod-to-json-schema/parsers/map.js.map +1 -0
  350. package/dist/utils/zod-to-json-schema/parsers/nativeEnum.cjs +18 -0
  351. package/dist/utils/zod-to-json-schema/parsers/nativeEnum.cjs.map +1 -0
  352. package/dist/utils/zod-to-json-schema/parsers/nativeEnum.d.cts +8 -0
  353. package/dist/utils/zod-to-json-schema/parsers/nativeEnum.d.cts.map +1 -0
  354. package/dist/utils/zod-to-json-schema/parsers/nativeEnum.d.ts +10 -0
  355. package/dist/utils/zod-to-json-schema/parsers/nativeEnum.d.ts.map +1 -0
  356. package/dist/utils/zod-to-json-schema/parsers/nativeEnum.js +17 -0
  357. package/dist/utils/zod-to-json-schema/parsers/nativeEnum.js.map +1 -0
  358. package/dist/utils/zod-to-json-schema/parsers/never.cjs +13 -0
  359. package/dist/utils/zod-to-json-schema/parsers/never.cjs.map +1 -0
  360. package/dist/utils/zod-to-json-schema/parsers/never.d.cts +9 -0
  361. package/dist/utils/zod-to-json-schema/parsers/never.d.cts.map +1 -0
  362. package/dist/utils/zod-to-json-schema/parsers/never.d.ts +9 -0
  363. package/dist/utils/zod-to-json-schema/parsers/never.d.ts.map +1 -0
  364. package/dist/utils/zod-to-json-schema/parsers/never.js +13 -0
  365. package/dist/utils/zod-to-json-schema/parsers/never.js.map +1 -0
  366. package/dist/utils/zod-to-json-schema/parsers/null.cjs +12 -0
  367. package/dist/utils/zod-to-json-schema/parsers/null.cjs.map +1 -0
  368. package/dist/utils/zod-to-json-schema/parsers/null.d.cts +7 -0
  369. package/dist/utils/zod-to-json-schema/parsers/null.d.cts.map +1 -0
  370. package/dist/utils/zod-to-json-schema/parsers/null.d.ts +7 -0
  371. package/dist/utils/zod-to-json-schema/parsers/null.d.ts.map +1 -0
  372. package/dist/utils/zod-to-json-schema/parsers/null.js +11 -0
  373. package/dist/utils/zod-to-json-schema/parsers/null.js.map +1 -0
  374. package/dist/utils/zod-to-json-schema/parsers/nullable.cjs +46 -0
  375. package/dist/utils/zod-to-json-schema/parsers/nullable.cjs.map +1 -0
  376. package/dist/utils/zod-to-json-schema/parsers/nullable.d.cts +12 -0
  377. package/dist/utils/zod-to-json-schema/parsers/nullable.d.cts.map +1 -0
  378. package/dist/utils/zod-to-json-schema/parsers/nullable.d.ts +13 -0
  379. package/dist/utils/zod-to-json-schema/parsers/nullable.d.ts.map +1 -0
  380. package/dist/utils/zod-to-json-schema/parsers/nullable.js +46 -0
  381. package/dist/utils/zod-to-json-schema/parsers/nullable.js.map +1 -0
  382. package/dist/utils/zod-to-json-schema/parsers/number.cjs +37 -0
  383. package/dist/utils/zod-to-json-schema/parsers/number.cjs.map +1 -0
  384. package/dist/utils/zod-to-json-schema/parsers/number.d.cts +15 -0
  385. package/dist/utils/zod-to-json-schema/parsers/number.d.cts.map +1 -0
  386. package/dist/utils/zod-to-json-schema/parsers/number.d.ts +16 -0
  387. package/dist/utils/zod-to-json-schema/parsers/number.d.ts.map +1 -0
  388. package/dist/utils/zod-to-json-schema/parsers/number.js +37 -0
  389. package/dist/utils/zod-to-json-schema/parsers/number.js.map +1 -0
  390. package/dist/utils/zod-to-json-schema/parsers/object.cjs +64 -0
  391. package/dist/utils/zod-to-json-schema/parsers/object.cjs.map +1 -0
  392. package/dist/utils/zod-to-json-schema/parsers/object.d.cts +12 -0
  393. package/dist/utils/zod-to-json-schema/parsers/object.d.cts.map +1 -0
  394. package/dist/utils/zod-to-json-schema/parsers/object.d.ts +13 -0
  395. package/dist/utils/zod-to-json-schema/parsers/object.d.ts.map +1 -0
  396. package/dist/utils/zod-to-json-schema/parsers/object.js +64 -0
  397. package/dist/utils/zod-to-json-schema/parsers/object.js.map +1 -0
  398. package/dist/utils/zod-to-json-schema/parsers/optional.cjs +20 -0
  399. package/dist/utils/zod-to-json-schema/parsers/optional.cjs.map +1 -0
  400. package/dist/utils/zod-to-json-schema/parsers/optional.js +20 -0
  401. package/dist/utils/zod-to-json-schema/parsers/optional.js.map +1 -0
  402. package/dist/utils/zod-to-json-schema/parsers/pipeline.cjs +28 -0
  403. package/dist/utils/zod-to-json-schema/parsers/pipeline.cjs.map +1 -0
  404. package/dist/utils/zod-to-json-schema/parsers/pipeline.js +28 -0
  405. package/dist/utils/zod-to-json-schema/parsers/pipeline.js.map +1 -0
  406. package/dist/utils/zod-to-json-schema/parsers/promise.cjs +10 -0
  407. package/dist/utils/zod-to-json-schema/parsers/promise.cjs.map +1 -0
  408. package/dist/utils/zod-to-json-schema/parsers/promise.js +10 -0
  409. package/dist/utils/zod-to-json-schema/parsers/promise.js.map +1 -0
  410. package/dist/utils/zod-to-json-schema/parsers/readonly.cjs +10 -0
  411. package/dist/utils/zod-to-json-schema/parsers/readonly.cjs.map +1 -0
  412. package/dist/utils/zod-to-json-schema/parsers/readonly.js +10 -0
  413. package/dist/utils/zod-to-json-schema/parsers/readonly.js.map +1 -0
  414. package/dist/utils/zod-to-json-schema/parsers/record.cjs +57 -0
  415. package/dist/utils/zod-to-json-schema/parsers/record.cjs.map +1 -0
  416. package/dist/utils/zod-to-json-schema/parsers/record.d.cts +14 -0
  417. package/dist/utils/zod-to-json-schema/parsers/record.d.cts.map +1 -0
  418. package/dist/utils/zod-to-json-schema/parsers/record.d.ts +15 -0
  419. package/dist/utils/zod-to-json-schema/parsers/record.d.ts.map +1 -0
  420. package/dist/utils/zod-to-json-schema/parsers/record.js +56 -0
  421. package/dist/utils/zod-to-json-schema/parsers/record.js.map +1 -0
  422. package/dist/utils/zod-to-json-schema/parsers/set.cjs +22 -0
  423. package/dist/utils/zod-to-json-schema/parsers/set.cjs.map +1 -0
  424. package/dist/utils/zod-to-json-schema/parsers/set.d.cts +15 -0
  425. package/dist/utils/zod-to-json-schema/parsers/set.d.cts.map +1 -0
  426. package/dist/utils/zod-to-json-schema/parsers/set.d.ts +16 -0
  427. package/dist/utils/zod-to-json-schema/parsers/set.d.ts.map +1 -0
  428. package/dist/utils/zod-to-json-schema/parsers/set.js +22 -0
  429. package/dist/utils/zod-to-json-schema/parsers/set.js.map +1 -0
  430. package/dist/utils/zod-to-json-schema/parsers/string.cjs +255 -0
  431. package/dist/utils/zod-to-json-schema/parsers/string.cjs.map +1 -0
  432. package/dist/utils/zod-to-json-schema/parsers/string.d.cts +28 -0
  433. package/dist/utils/zod-to-json-schema/parsers/string.d.cts.map +1 -0
  434. package/dist/utils/zod-to-json-schema/parsers/string.d.ts +29 -0
  435. package/dist/utils/zod-to-json-schema/parsers/string.d.ts.map +1 -0
  436. package/dist/utils/zod-to-json-schema/parsers/string.js +254 -0
  437. package/dist/utils/zod-to-json-schema/parsers/string.js.map +1 -0
  438. package/dist/utils/zod-to-json-schema/parsers/tuple.cjs +38 -0
  439. package/dist/utils/zod-to-json-schema/parsers/tuple.cjs.map +1 -0
  440. package/dist/utils/zod-to-json-schema/parsers/tuple.d.cts +15 -0
  441. package/dist/utils/zod-to-json-schema/parsers/tuple.d.cts.map +1 -0
  442. package/dist/utils/zod-to-json-schema/parsers/tuple.d.ts +16 -0
  443. package/dist/utils/zod-to-json-schema/parsers/tuple.d.ts.map +1 -0
  444. package/dist/utils/zod-to-json-schema/parsers/tuple.js +38 -0
  445. package/dist/utils/zod-to-json-schema/parsers/tuple.js.map +1 -0
  446. package/dist/utils/zod-to-json-schema/parsers/undefined.cjs +10 -0
  447. package/dist/utils/zod-to-json-schema/parsers/undefined.cjs.map +1 -0
  448. package/dist/utils/zod-to-json-schema/parsers/undefined.d.cts +9 -0
  449. package/dist/utils/zod-to-json-schema/parsers/undefined.d.cts.map +1 -0
  450. package/dist/utils/zod-to-json-schema/parsers/undefined.d.ts +9 -0
  451. package/dist/utils/zod-to-json-schema/parsers/undefined.d.ts.map +1 -0
  452. package/dist/utils/zod-to-json-schema/parsers/undefined.js +10 -0
  453. package/dist/utils/zod-to-json-schema/parsers/undefined.js.map +1 -0
  454. package/dist/utils/zod-to-json-schema/parsers/union.cjs +67 -0
  455. package/dist/utils/zod-to-json-schema/parsers/union.cjs.map +1 -0
  456. package/dist/utils/zod-to-json-schema/parsers/union.d.cts +24 -0
  457. package/dist/utils/zod-to-json-schema/parsers/union.d.cts.map +1 -0
  458. package/dist/utils/zod-to-json-schema/parsers/union.d.ts +25 -0
  459. package/dist/utils/zod-to-json-schema/parsers/union.d.ts.map +1 -0
  460. package/dist/utils/zod-to-json-schema/parsers/union.js +66 -0
  461. package/dist/utils/zod-to-json-schema/parsers/union.js.map +1 -0
  462. package/dist/utils/zod-to-json-schema/parsers/unknown.cjs +10 -0
  463. package/dist/utils/zod-to-json-schema/parsers/unknown.cjs.map +1 -0
  464. package/dist/utils/zod-to-json-schema/parsers/unknown.d.cts +7 -0
  465. package/dist/utils/zod-to-json-schema/parsers/unknown.d.cts.map +1 -0
  466. package/dist/utils/zod-to-json-schema/parsers/unknown.d.ts +7 -0
  467. package/dist/utils/zod-to-json-schema/parsers/unknown.d.ts.map +1 -0
  468. package/dist/utils/zod-to-json-schema/parsers/unknown.js +10 -0
  469. package/dist/utils/zod-to-json-schema/parsers/unknown.js.map +1 -0
  470. package/dist/utils/zod-to-json-schema/selectParser.cjs +81 -0
  471. package/dist/utils/zod-to-json-schema/selectParser.cjs.map +1 -0
  472. package/dist/utils/zod-to-json-schema/selectParser.js +80 -0
  473. package/dist/utils/zod-to-json-schema/selectParser.js.map +1 -0
  474. package/dist/utils/zod-to-json-schema/zodToJsonSchema.cjs +70 -0
  475. package/dist/utils/zod-to-json-schema/zodToJsonSchema.cjs.map +1 -0
  476. package/dist/utils/zod-to-json-schema/zodToJsonSchema.js +70 -0
  477. package/dist/utils/zod-to-json-schema/zodToJsonSchema.js.map +1 -0
  478. package/package.json +7 -36
  479. package/dist/utils/js-sha1/hash.cjs +0 -291
  480. package/dist/utils/js-sha1/hash.cjs.map +0 -1
  481. package/dist/utils/js-sha1/hash.d.cts +0 -9
  482. package/dist/utils/js-sha1/hash.d.cts.map +0 -1
  483. package/dist/utils/js-sha1/hash.d.ts +0 -9
  484. package/dist/utils/js-sha1/hash.d.ts.map +0 -1
  485. package/dist/utils/js-sha1/hash.js +0 -284
  486. package/dist/utils/js-sha1/hash.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"null.d.cts","names":["Refs","JsonSchema7NullType","parseNullDef"],"sources":["../../../../src/utils/zod-to-json-schema/parsers/null.d.ts"],"sourcesContent":["import { Refs } from \"../Refs.js\";\nexport type JsonSchema7NullType = {\n type: \"null\";\n};\nexport declare function parseNullDef(refs: Refs): JsonSchema7NullType;\n"],"mappings":";AACYC,KAAAA,mBAAAA,GAAmB"}
@@ -0,0 +1,7 @@
1
+ //#region src/utils/zod-to-json-schema/parsers/null.d.ts
2
+ type JsonSchema7NullType = {
3
+ type: "null";
4
+ };
5
+ //#endregion
6
+ export { JsonSchema7NullType };
7
+ //# sourceMappingURL=null.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"null.d.ts","names":["Refs","JsonSchema7NullType","parseNullDef"],"sources":["../../../../src/utils/zod-to-json-schema/parsers/null.d.ts"],"sourcesContent":["import { Refs } from \"../Refs.js\";\nexport type JsonSchema7NullType = {\n type: \"null\";\n};\nexport declare function parseNullDef(refs: Refs): JsonSchema7NullType;\n"],"mappings":";AACYC,KAAAA,mBAAAA,GAAmB"}
@@ -0,0 +1,11 @@
1
+ //#region src/utils/zod-to-json-schema/parsers/null.ts
2
+ function parseNullDef(refs) {
3
+ return refs.target === "openApi3" ? {
4
+ enum: ["null"],
5
+ nullable: true
6
+ } : { type: "null" };
7
+ }
8
+
9
+ //#endregion
10
+ export { parseNullDef };
11
+ //# sourceMappingURL=null.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"null.js","names":["refs: Refs"],"sources":["../../../../src/utils/zod-to-json-schema/parsers/null.ts"],"sourcesContent":["import { Refs } from \"../Refs.js\";\n\nexport type JsonSchema7NullType = {\n type: \"null\";\n};\n\nexport function parseNullDef(refs: Refs): JsonSchema7NullType {\n return refs.target === \"openApi3\"\n ? ({\n enum: [\"null\"],\n nullable: true,\n } as any)\n : {\n type: \"null\",\n };\n}\n"],"mappings":";AAMA,SAAgB,aAAaA,MAAiC;AAC5D,QAAO,KAAK,WAAW,aAClB;EACC,MAAM,CAAC,MAAO;EACd,UAAU;CACX,IACD,EACE,MAAM,OACP;AACN"}
@@ -0,0 +1,46 @@
1
+ const require_union = require('./union.cjs');
2
+ const require_parseDef = require('../parseDef.cjs');
3
+
4
+ //#region src/utils/zod-to-json-schema/parsers/nullable.ts
5
+ function parseNullableDef(def, refs) {
6
+ if ([
7
+ "ZodString",
8
+ "ZodNumber",
9
+ "ZodBigInt",
10
+ "ZodBoolean",
11
+ "ZodNull"
12
+ ].includes(def.innerType._def.typeName) && (!def.innerType._def.checks || !def.innerType._def.checks.length)) {
13
+ if (refs.target === "openApi3") return {
14
+ type: require_union.primitiveMappings[def.innerType._def.typeName],
15
+ nullable: true
16
+ };
17
+ return { type: [require_union.primitiveMappings[def.innerType._def.typeName], "null"] };
18
+ }
19
+ if (refs.target === "openApi3") {
20
+ const base$1 = require_parseDef.parseDef(def.innerType._def, {
21
+ ...refs,
22
+ currentPath: [...refs.currentPath]
23
+ });
24
+ if (base$1 && "$ref" in base$1) return {
25
+ allOf: [base$1],
26
+ nullable: true
27
+ };
28
+ return base$1 && {
29
+ ...base$1,
30
+ nullable: true
31
+ };
32
+ }
33
+ const base = require_parseDef.parseDef(def.innerType._def, {
34
+ ...refs,
35
+ currentPath: [
36
+ ...refs.currentPath,
37
+ "anyOf",
38
+ "0"
39
+ ]
40
+ });
41
+ return base && { anyOf: [base, { type: "null" }] };
42
+ }
43
+
44
+ //#endregion
45
+ exports.parseNullableDef = parseNullableDef;
46
+ //# sourceMappingURL=nullable.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nullable.cjs","names":["def: ZodNullableDef","refs: Refs","primitiveMappings","base","parseDef"],"sources":["../../../../src/utils/zod-to-json-schema/parsers/nullable.ts"],"sourcesContent":["import { ZodNullableDef } from \"zod/v3\";\nimport { parseDef } from \"../parseDef.js\";\nimport { JsonSchema7Type } from \"../parseTypes.js\";\nimport { Refs } from \"../Refs.js\";\nimport { JsonSchema7NullType } from \"./null.js\";\nimport { primitiveMappings } from \"./union.js\";\n\nexport type JsonSchema7NullableType =\n | {\n anyOf: [JsonSchema7Type, JsonSchema7NullType];\n }\n | {\n type: [string, \"null\"];\n };\n\nexport function parseNullableDef(\n def: ZodNullableDef,\n refs: Refs\n): JsonSchema7NullableType | undefined {\n if (\n [\"ZodString\", \"ZodNumber\", \"ZodBigInt\", \"ZodBoolean\", \"ZodNull\"].includes(\n def.innerType._def.typeName\n ) &&\n (!def.innerType._def.checks || !def.innerType._def.checks.length)\n ) {\n if (refs.target === \"openApi3\") {\n return {\n type: primitiveMappings[\n def.innerType._def.typeName as keyof typeof primitiveMappings\n ],\n nullable: true,\n } as any;\n }\n\n return {\n type: [\n primitiveMappings[\n def.innerType._def.typeName as keyof typeof primitiveMappings\n ],\n \"null\",\n ],\n };\n }\n\n if (refs.target === \"openApi3\") {\n const base = parseDef(def.innerType._def, {\n ...refs,\n currentPath: [...refs.currentPath],\n });\n\n if (base && \"$ref\" in base) return { allOf: [base], nullable: true } as any;\n\n return base && ({ ...base, nullable: true } as any);\n }\n\n const base = parseDef(def.innerType._def, {\n ...refs,\n currentPath: [...refs.currentPath, \"anyOf\", \"0\"],\n });\n\n return base && { anyOf: [base, { type: \"null\" }] };\n}\n"],"mappings":";;;;AAeA,SAAgB,iBACdA,KACAC,MACqC;AACrC,KACE;EAAC;EAAa;EAAa;EAAa;EAAc;CAAU,EAAC,SAC/D,IAAI,UAAU,KAAK,SACpB,KACA,CAAC,IAAI,UAAU,KAAK,UAAU,CAAC,IAAI,UAAU,KAAK,OAAO,SAC1D;AACA,MAAI,KAAK,WAAW,WAClB,QAAO;GACL,MAAMC,gCACJ,IAAI,UAAU,KAAK;GAErB,UAAU;EACX;AAGH,SAAO,EACL,MAAM,CACJA,gCACE,IAAI,UAAU,KAAK,WAErB,MACD,EACF;CACF;AAED,KAAI,KAAK,WAAW,YAAY;EAC9B,MAAMC,SAAOC,0BAAS,IAAI,UAAU,MAAM;GACxC,GAAG;GACH,aAAa,CAAC,GAAG,KAAK,WAAY;EACnC,EAAC;AAEF,MAAID,UAAQ,UAAUA,OAAM,QAAO;GAAE,OAAO,CAACA,MAAK;GAAE,UAAU;EAAM;AAEpE,SAAOA,UAAS;GAAE,GAAGA;GAAM,UAAU;EAAM;CAC5C;CAED,MAAM,OAAOC,0BAAS,IAAI,UAAU,MAAM;EACxC,GAAG;EACH,aAAa;GAAC,GAAG,KAAK;GAAa;GAAS;EAAI;CACjD,EAAC;AAEF,QAAO,QAAQ,EAAE,OAAO,CAAC,MAAM,EAAE,MAAM,OAAQ,CAAC,EAAE;AACnD"}
@@ -0,0 +1,12 @@
1
+ import { JsonSchema7NullType } from "./null.cjs";
2
+ import { JsonSchema7Type } from "../parseTypes.cjs";
3
+
4
+ //#region src/utils/zod-to-json-schema/parsers/nullable.d.ts
5
+ type JsonSchema7NullableType = {
6
+ anyOf: [JsonSchema7Type, JsonSchema7NullType];
7
+ } | {
8
+ type: [string, "null"];
9
+ };
10
+ //#endregion
11
+ export { JsonSchema7NullableType };
12
+ //# sourceMappingURL=nullable.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nullable.d.cts","names":["ZodNullableDef","JsonSchema7Type","Refs","JsonSchema7NullType","JsonSchema7NullableType","parseNullableDef"],"sources":["../../../../src/utils/zod-to-json-schema/parsers/nullable.d.ts"],"sourcesContent":["import { ZodNullableDef } from \"zod/v3\";\nimport { JsonSchema7Type } from \"../parseTypes.js\";\nimport { Refs } from \"../Refs.js\";\nimport { JsonSchema7NullType } from \"./null.js\";\nexport type JsonSchema7NullableType = {\n anyOf: [JsonSchema7Type, JsonSchema7NullType];\n} | {\n type: [string, \"null\"];\n};\nexport declare function parseNullableDef(def: ZodNullableDef, refs: Refs): JsonSchema7NullableType | undefined;\n"],"mappings":";;;;AAIYI,KAAAA,uBAAAA,GAAuB;EAAA,KAAA,EAAA,CACvBH,eADuB,EACNE,mBADM,CAAA;CAAA,GAAA;EACR,IAAEA,EAAAA,CAAAA,MAAAA,EAAAA,MAAAA,CAAAA;AAAmB,CAAA"}
@@ -0,0 +1,13 @@
1
+ import { JsonSchema7NullType } from "./null.js";
2
+ import { JsonSchema7Type } from "../parseTypes.js";
3
+ import "zod/v3";
4
+
5
+ //#region src/utils/zod-to-json-schema/parsers/nullable.d.ts
6
+ type JsonSchema7NullableType = {
7
+ anyOf: [JsonSchema7Type, JsonSchema7NullType];
8
+ } | {
9
+ type: [string, "null"];
10
+ };
11
+ //#endregion
12
+ export { JsonSchema7NullableType };
13
+ //# sourceMappingURL=nullable.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nullable.d.ts","names":["ZodNullableDef","JsonSchema7Type","Refs","JsonSchema7NullType","JsonSchema7NullableType","parseNullableDef"],"sources":["../../../../src/utils/zod-to-json-schema/parsers/nullable.d.ts"],"sourcesContent":["import { ZodNullableDef } from \"zod/v3\";\nimport { JsonSchema7Type } from \"../parseTypes.js\";\nimport { Refs } from \"../Refs.js\";\nimport { JsonSchema7NullType } from \"./null.js\";\nexport type JsonSchema7NullableType = {\n anyOf: [JsonSchema7Type, JsonSchema7NullType];\n} | {\n type: [string, \"null\"];\n};\nexport declare function parseNullableDef(def: ZodNullableDef, refs: Refs): JsonSchema7NullableType | undefined;\n"],"mappings":";;;;;KAIYI,uBAAAA;EAAAA,KAAAA,EAAAA,CACAH,eADAG,EACiBD,mBADM,CAAA;CAAA,GAAA;EAAA,IACvBF,EAAAA,CAAAA,MAAAA,EAAAA,MAAAA,CAAAA;CAAe"}
@@ -0,0 +1,46 @@
1
+ import { primitiveMappings } from "./union.js";
2
+ import { parseDef } from "../parseDef.js";
3
+
4
+ //#region src/utils/zod-to-json-schema/parsers/nullable.ts
5
+ function parseNullableDef(def, refs) {
6
+ if ([
7
+ "ZodString",
8
+ "ZodNumber",
9
+ "ZodBigInt",
10
+ "ZodBoolean",
11
+ "ZodNull"
12
+ ].includes(def.innerType._def.typeName) && (!def.innerType._def.checks || !def.innerType._def.checks.length)) {
13
+ if (refs.target === "openApi3") return {
14
+ type: primitiveMappings[def.innerType._def.typeName],
15
+ nullable: true
16
+ };
17
+ return { type: [primitiveMappings[def.innerType._def.typeName], "null"] };
18
+ }
19
+ if (refs.target === "openApi3") {
20
+ const base$1 = parseDef(def.innerType._def, {
21
+ ...refs,
22
+ currentPath: [...refs.currentPath]
23
+ });
24
+ if (base$1 && "$ref" in base$1) return {
25
+ allOf: [base$1],
26
+ nullable: true
27
+ };
28
+ return base$1 && {
29
+ ...base$1,
30
+ nullable: true
31
+ };
32
+ }
33
+ const base = parseDef(def.innerType._def, {
34
+ ...refs,
35
+ currentPath: [
36
+ ...refs.currentPath,
37
+ "anyOf",
38
+ "0"
39
+ ]
40
+ });
41
+ return base && { anyOf: [base, { type: "null" }] };
42
+ }
43
+
44
+ //#endregion
45
+ export { parseNullableDef };
46
+ //# sourceMappingURL=nullable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nullable.js","names":["def: ZodNullableDef","refs: Refs","base"],"sources":["../../../../src/utils/zod-to-json-schema/parsers/nullable.ts"],"sourcesContent":["import { ZodNullableDef } from \"zod/v3\";\nimport { parseDef } from \"../parseDef.js\";\nimport { JsonSchema7Type } from \"../parseTypes.js\";\nimport { Refs } from \"../Refs.js\";\nimport { JsonSchema7NullType } from \"./null.js\";\nimport { primitiveMappings } from \"./union.js\";\n\nexport type JsonSchema7NullableType =\n | {\n anyOf: [JsonSchema7Type, JsonSchema7NullType];\n }\n | {\n type: [string, \"null\"];\n };\n\nexport function parseNullableDef(\n def: ZodNullableDef,\n refs: Refs\n): JsonSchema7NullableType | undefined {\n if (\n [\"ZodString\", \"ZodNumber\", \"ZodBigInt\", \"ZodBoolean\", \"ZodNull\"].includes(\n def.innerType._def.typeName\n ) &&\n (!def.innerType._def.checks || !def.innerType._def.checks.length)\n ) {\n if (refs.target === \"openApi3\") {\n return {\n type: primitiveMappings[\n def.innerType._def.typeName as keyof typeof primitiveMappings\n ],\n nullable: true,\n } as any;\n }\n\n return {\n type: [\n primitiveMappings[\n def.innerType._def.typeName as keyof typeof primitiveMappings\n ],\n \"null\",\n ],\n };\n }\n\n if (refs.target === \"openApi3\") {\n const base = parseDef(def.innerType._def, {\n ...refs,\n currentPath: [...refs.currentPath],\n });\n\n if (base && \"$ref\" in base) return { allOf: [base], nullable: true } as any;\n\n return base && ({ ...base, nullable: true } as any);\n }\n\n const base = parseDef(def.innerType._def, {\n ...refs,\n currentPath: [...refs.currentPath, \"anyOf\", \"0\"],\n });\n\n return base && { anyOf: [base, { type: \"null\" }] };\n}\n"],"mappings":";;;;AAeA,SAAgB,iBACdA,KACAC,MACqC;AACrC,KACE;EAAC;EAAa;EAAa;EAAa;EAAc;CAAU,EAAC,SAC/D,IAAI,UAAU,KAAK,SACpB,KACA,CAAC,IAAI,UAAU,KAAK,UAAU,CAAC,IAAI,UAAU,KAAK,OAAO,SAC1D;AACA,MAAI,KAAK,WAAW,WAClB,QAAO;GACL,MAAM,kBACJ,IAAI,UAAU,KAAK;GAErB,UAAU;EACX;AAGH,SAAO,EACL,MAAM,CACJ,kBACE,IAAI,UAAU,KAAK,WAErB,MACD,EACF;CACF;AAED,KAAI,KAAK,WAAW,YAAY;EAC9B,MAAMC,SAAO,SAAS,IAAI,UAAU,MAAM;GACxC,GAAG;GACH,aAAa,CAAC,GAAG,KAAK,WAAY;EACnC,EAAC;AAEF,MAAIA,UAAQ,UAAUA,OAAM,QAAO;GAAE,OAAO,CAACA,MAAK;GAAE,UAAU;EAAM;AAEpE,SAAOA,UAAS;GAAE,GAAGA;GAAM,UAAU;EAAM;CAC5C;CAED,MAAM,OAAO,SAAS,IAAI,UAAU,MAAM;EACxC,GAAG;EACH,aAAa;GAAC,GAAG,KAAK;GAAa;GAAS;EAAI;CACjD,EAAC;AAEF,QAAO,QAAQ,EAAE,OAAO,CAAC,MAAM,EAAE,MAAM,OAAQ,CAAC,EAAE;AACnD"}
@@ -0,0 +1,37 @@
1
+ const require_errorMessages = require('../errorMessages.cjs');
2
+
3
+ //#region src/utils/zod-to-json-schema/parsers/number.ts
4
+ function parseNumberDef(def, refs) {
5
+ const res = { type: "number" };
6
+ if (!def.checks) return res;
7
+ for (const check of def.checks) switch (check.kind) {
8
+ case "int":
9
+ res.type = "integer";
10
+ require_errorMessages.addErrorMessage(res, "type", check.message, refs);
11
+ break;
12
+ case "min":
13
+ if (refs.target === "jsonSchema7") if (check.inclusive) require_errorMessages.setResponseValueAndErrors(res, "minimum", check.value, check.message, refs);
14
+ else require_errorMessages.setResponseValueAndErrors(res, "exclusiveMinimum", check.value, check.message, refs);
15
+ else {
16
+ if (!check.inclusive) res.exclusiveMinimum = true;
17
+ require_errorMessages.setResponseValueAndErrors(res, "minimum", check.value, check.message, refs);
18
+ }
19
+ break;
20
+ case "max":
21
+ if (refs.target === "jsonSchema7") if (check.inclusive) require_errorMessages.setResponseValueAndErrors(res, "maximum", check.value, check.message, refs);
22
+ else require_errorMessages.setResponseValueAndErrors(res, "exclusiveMaximum", check.value, check.message, refs);
23
+ else {
24
+ if (!check.inclusive) res.exclusiveMaximum = true;
25
+ require_errorMessages.setResponseValueAndErrors(res, "maximum", check.value, check.message, refs);
26
+ }
27
+ break;
28
+ case "multipleOf":
29
+ require_errorMessages.setResponseValueAndErrors(res, "multipleOf", check.value, check.message, refs);
30
+ break;
31
+ }
32
+ return res;
33
+ }
34
+
35
+ //#endregion
36
+ exports.parseNumberDef = parseNumberDef;
37
+ //# sourceMappingURL=number.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"number.cjs","names":["def: ZodNumberDef","refs: Refs","res: JsonSchema7NumberType","addErrorMessage","setResponseValueAndErrors"],"sources":["../../../../src/utils/zod-to-json-schema/parsers/number.ts"],"sourcesContent":["import { ZodNumberDef } from \"zod/v3\";\nimport {\n addErrorMessage,\n ErrorMessages,\n setResponseValueAndErrors,\n} from \"../errorMessages.js\";\nimport { Refs } from \"../Refs.js\";\n\nexport type JsonSchema7NumberType = {\n type: \"number\" | \"integer\";\n minimum?: number;\n exclusiveMinimum?: number;\n maximum?: number;\n exclusiveMaximum?: number;\n multipleOf?: number;\n errorMessage?: ErrorMessages<JsonSchema7NumberType>;\n};\n\nexport function parseNumberDef(\n def: ZodNumberDef,\n refs: Refs\n): JsonSchema7NumberType {\n const res: JsonSchema7NumberType = {\n type: \"number\",\n };\n\n if (!def.checks) return res;\n\n for (const check of def.checks) {\n switch (check.kind) {\n case \"int\":\n res.type = \"integer\";\n addErrorMessage(res, \"type\", check.message, refs);\n break;\n case \"min\":\n if (refs.target === \"jsonSchema7\") {\n if (check.inclusive) {\n setResponseValueAndErrors(\n res,\n \"minimum\",\n check.value,\n check.message,\n refs\n );\n } else {\n setResponseValueAndErrors(\n res,\n \"exclusiveMinimum\",\n check.value,\n check.message,\n refs\n );\n }\n } else {\n if (!check.inclusive) {\n res.exclusiveMinimum = true as any;\n }\n setResponseValueAndErrors(\n res,\n \"minimum\",\n check.value,\n check.message,\n refs\n );\n }\n break;\n case \"max\":\n if (refs.target === \"jsonSchema7\") {\n if (check.inclusive) {\n setResponseValueAndErrors(\n res,\n \"maximum\",\n check.value,\n check.message,\n refs\n );\n } else {\n setResponseValueAndErrors(\n res,\n \"exclusiveMaximum\",\n check.value,\n check.message,\n refs\n );\n }\n } else {\n if (!check.inclusive) {\n res.exclusiveMaximum = true as any;\n }\n setResponseValueAndErrors(\n res,\n \"maximum\",\n check.value,\n check.message,\n refs\n );\n }\n break;\n case \"multipleOf\":\n setResponseValueAndErrors(\n res,\n \"multipleOf\",\n check.value,\n check.message,\n refs\n );\n break;\n }\n }\n return res;\n}\n"],"mappings":";;;AAkBA,SAAgB,eACdA,KACAC,MACuB;CACvB,MAAMC,MAA6B,EACjC,MAAM,SACP;AAED,KAAI,CAAC,IAAI,OAAQ,QAAO;AAExB,MAAK,MAAM,SAAS,IAAI,OACtB,SAAQ,MAAM,MAAd;EACE,KAAK;GACH,IAAI,OAAO;GACXC,sCAAgB,KAAK,QAAQ,MAAM,SAAS,KAAK;AACjD;EACF,KAAK;AACH,OAAI,KAAK,WAAW,cAClB,KAAI,MAAM,WACRC,gDACE,KACA,WACA,MAAM,OACN,MAAM,SACN,KACD;QAEDA,gDACE,KACA,oBACA,MAAM,OACN,MAAM,SACN,KACD;QAEE;AACL,QAAI,CAAC,MAAM,WACT,IAAI,mBAAmB;IAEzBA,gDACE,KACA,WACA,MAAM,OACN,MAAM,SACN,KACD;GACF;AACD;EACF,KAAK;AACH,OAAI,KAAK,WAAW,cAClB,KAAI,MAAM,WACRA,gDACE,KACA,WACA,MAAM,OACN,MAAM,SACN,KACD;QAEDA,gDACE,KACA,oBACA,MAAM,OACN,MAAM,SACN,KACD;QAEE;AACL,QAAI,CAAC,MAAM,WACT,IAAI,mBAAmB;IAEzBA,gDACE,KACA,WACA,MAAM,OACN,MAAM,SACN,KACD;GACF;AACD;EACF,KAAK;GACHA,gDACE,KACA,cACA,MAAM,OACN,MAAM,SACN,KACD;AACD;CACH;AAEH,QAAO;AACR"}
@@ -0,0 +1,15 @@
1
+ import { ErrorMessages } from "../errorMessages.cjs";
2
+
3
+ //#region src/utils/zod-to-json-schema/parsers/number.d.ts
4
+ type JsonSchema7NumberType = {
5
+ type: "number" | "integer";
6
+ minimum?: number;
7
+ exclusiveMinimum?: number;
8
+ maximum?: number;
9
+ exclusiveMaximum?: number;
10
+ multipleOf?: number;
11
+ errorMessage?: ErrorMessages<JsonSchema7NumberType>;
12
+ };
13
+ //#endregion
14
+ export { JsonSchema7NumberType };
15
+ //# sourceMappingURL=number.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"number.d.cts","names":["ZodNumberDef","ErrorMessages","Refs","JsonSchema7NumberType","parseNumberDef"],"sources":["../../../../src/utils/zod-to-json-schema/parsers/number.d.ts"],"sourcesContent":["import { ZodNumberDef } from \"zod/v3\";\nimport { ErrorMessages } from \"../errorMessages.js\";\nimport { Refs } from \"../Refs.js\";\nexport type JsonSchema7NumberType = {\n type: \"number\" | \"integer\";\n minimum?: number;\n exclusiveMinimum?: number;\n maximum?: number;\n exclusiveMaximum?: number;\n multipleOf?: number;\n errorMessage?: ErrorMessages<JsonSchema7NumberType>;\n};\nexport declare function parseNumberDef(def: ZodNumberDef, refs: Refs): JsonSchema7NumberType;\n"],"mappings":";;;AAGYG,KAAAA,qBAAAA,GAAqB;EAAA,IAAA,EAAA,QAAA,GAAA,SAAA;EAAA,OAOAA,CAAAA,EAAAA,MAAAA;EAAqB,gBAAnCF,CAAAA,EAAAA,MAAAA;EAAa,OAAA,CAAA,EAAA,MAAA;;;iBAAbA,cAAcE"}
@@ -0,0 +1,16 @@
1
+ import { ErrorMessages } from "../errorMessages.js";
2
+ import "zod/v3";
3
+
4
+ //#region src/utils/zod-to-json-schema/parsers/number.d.ts
5
+ type JsonSchema7NumberType = {
6
+ type: "number" | "integer";
7
+ minimum?: number;
8
+ exclusiveMinimum?: number;
9
+ maximum?: number;
10
+ exclusiveMaximum?: number;
11
+ multipleOf?: number;
12
+ errorMessage?: ErrorMessages<JsonSchema7NumberType>;
13
+ };
14
+ //#endregion
15
+ export { JsonSchema7NumberType };
16
+ //# sourceMappingURL=number.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"number.d.ts","names":["ZodNumberDef","ErrorMessages","Refs","JsonSchema7NumberType","parseNumberDef"],"sources":["../../../../src/utils/zod-to-json-schema/parsers/number.d.ts"],"sourcesContent":["import { ZodNumberDef } from \"zod/v3\";\nimport { ErrorMessages } from \"../errorMessages.js\";\nimport { Refs } from \"../Refs.js\";\nexport type JsonSchema7NumberType = {\n type: \"number\" | \"integer\";\n minimum?: number;\n exclusiveMinimum?: number;\n maximum?: number;\n exclusiveMaximum?: number;\n multipleOf?: number;\n errorMessage?: ErrorMessages<JsonSchema7NumberType>;\n};\nexport declare function parseNumberDef(def: ZodNumberDef, refs: Refs): JsonSchema7NumberType;\n"],"mappings":";;;;KAGYG,qBAAAA;EAAAA,IAAAA,EAAAA,QAAAA,GAAAA,SAAqB;EAAA,OAAA,CAAA,EAAA,MAAA;EAAA,gBAOAA,CAAAA,EAAAA,MAAAA;EAAqB,OAAnCF,CAAAA,EAAAA,MAAAA;EAAa,gBAAA,CAAA,EAAA,MAAA;;iBAAbA,cAAcE"}
@@ -0,0 +1,37 @@
1
+ import { addErrorMessage, setResponseValueAndErrors } from "../errorMessages.js";
2
+
3
+ //#region src/utils/zod-to-json-schema/parsers/number.ts
4
+ function parseNumberDef(def, refs) {
5
+ const res = { type: "number" };
6
+ if (!def.checks) return res;
7
+ for (const check of def.checks) switch (check.kind) {
8
+ case "int":
9
+ res.type = "integer";
10
+ addErrorMessage(res, "type", check.message, refs);
11
+ break;
12
+ case "min":
13
+ if (refs.target === "jsonSchema7") if (check.inclusive) setResponseValueAndErrors(res, "minimum", check.value, check.message, refs);
14
+ else setResponseValueAndErrors(res, "exclusiveMinimum", check.value, check.message, refs);
15
+ else {
16
+ if (!check.inclusive) res.exclusiveMinimum = true;
17
+ setResponseValueAndErrors(res, "minimum", check.value, check.message, refs);
18
+ }
19
+ break;
20
+ case "max":
21
+ if (refs.target === "jsonSchema7") if (check.inclusive) setResponseValueAndErrors(res, "maximum", check.value, check.message, refs);
22
+ else setResponseValueAndErrors(res, "exclusiveMaximum", check.value, check.message, refs);
23
+ else {
24
+ if (!check.inclusive) res.exclusiveMaximum = true;
25
+ setResponseValueAndErrors(res, "maximum", check.value, check.message, refs);
26
+ }
27
+ break;
28
+ case "multipleOf":
29
+ setResponseValueAndErrors(res, "multipleOf", check.value, check.message, refs);
30
+ break;
31
+ }
32
+ return res;
33
+ }
34
+
35
+ //#endregion
36
+ export { parseNumberDef };
37
+ //# sourceMappingURL=number.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"number.js","names":["def: ZodNumberDef","refs: Refs","res: JsonSchema7NumberType"],"sources":["../../../../src/utils/zod-to-json-schema/parsers/number.ts"],"sourcesContent":["import { ZodNumberDef } from \"zod/v3\";\nimport {\n addErrorMessage,\n ErrorMessages,\n setResponseValueAndErrors,\n} from \"../errorMessages.js\";\nimport { Refs } from \"../Refs.js\";\n\nexport type JsonSchema7NumberType = {\n type: \"number\" | \"integer\";\n minimum?: number;\n exclusiveMinimum?: number;\n maximum?: number;\n exclusiveMaximum?: number;\n multipleOf?: number;\n errorMessage?: ErrorMessages<JsonSchema7NumberType>;\n};\n\nexport function parseNumberDef(\n def: ZodNumberDef,\n refs: Refs\n): JsonSchema7NumberType {\n const res: JsonSchema7NumberType = {\n type: \"number\",\n };\n\n if (!def.checks) return res;\n\n for (const check of def.checks) {\n switch (check.kind) {\n case \"int\":\n res.type = \"integer\";\n addErrorMessage(res, \"type\", check.message, refs);\n break;\n case \"min\":\n if (refs.target === \"jsonSchema7\") {\n if (check.inclusive) {\n setResponseValueAndErrors(\n res,\n \"minimum\",\n check.value,\n check.message,\n refs\n );\n } else {\n setResponseValueAndErrors(\n res,\n \"exclusiveMinimum\",\n check.value,\n check.message,\n refs\n );\n }\n } else {\n if (!check.inclusive) {\n res.exclusiveMinimum = true as any;\n }\n setResponseValueAndErrors(\n res,\n \"minimum\",\n check.value,\n check.message,\n refs\n );\n }\n break;\n case \"max\":\n if (refs.target === \"jsonSchema7\") {\n if (check.inclusive) {\n setResponseValueAndErrors(\n res,\n \"maximum\",\n check.value,\n check.message,\n refs\n );\n } else {\n setResponseValueAndErrors(\n res,\n \"exclusiveMaximum\",\n check.value,\n check.message,\n refs\n );\n }\n } else {\n if (!check.inclusive) {\n res.exclusiveMaximum = true as any;\n }\n setResponseValueAndErrors(\n res,\n \"maximum\",\n check.value,\n check.message,\n refs\n );\n }\n break;\n case \"multipleOf\":\n setResponseValueAndErrors(\n res,\n \"multipleOf\",\n check.value,\n check.message,\n refs\n );\n break;\n }\n }\n return res;\n}\n"],"mappings":";;;AAkBA,SAAgB,eACdA,KACAC,MACuB;CACvB,MAAMC,MAA6B,EACjC,MAAM,SACP;AAED,KAAI,CAAC,IAAI,OAAQ,QAAO;AAExB,MAAK,MAAM,SAAS,IAAI,OACtB,SAAQ,MAAM,MAAd;EACE,KAAK;GACH,IAAI,OAAO;GACX,gBAAgB,KAAK,QAAQ,MAAM,SAAS,KAAK;AACjD;EACF,KAAK;AACH,OAAI,KAAK,WAAW,cAClB,KAAI,MAAM,WACR,0BACE,KACA,WACA,MAAM,OACN,MAAM,SACN,KACD;QAED,0BACE,KACA,oBACA,MAAM,OACN,MAAM,SACN,KACD;QAEE;AACL,QAAI,CAAC,MAAM,WACT,IAAI,mBAAmB;IAEzB,0BACE,KACA,WACA,MAAM,OACN,MAAM,SACN,KACD;GACF;AACD;EACF,KAAK;AACH,OAAI,KAAK,WAAW,cAClB,KAAI,MAAM,WACR,0BACE,KACA,WACA,MAAM,OACN,MAAM,SACN,KACD;QAED,0BACE,KACA,oBACA,MAAM,OACN,MAAM,SACN,KACD;QAEE;AACL,QAAI,CAAC,MAAM,WACT,IAAI,mBAAmB;IAEzB,0BACE,KACA,WACA,MAAM,OACN,MAAM,SACN,KACD;GACF;AACD;EACF,KAAK;GACH,0BACE,KACA,cACA,MAAM,OACN,MAAM,SACN,KACD;AACD;CACH;AAEH,QAAO;AACR"}
@@ -0,0 +1,64 @@
1
+ const require_parseDef = require('../parseDef.cjs');
2
+
3
+ //#region src/utils/zod-to-json-schema/parsers/object.ts
4
+ function parseObjectDef(def, refs) {
5
+ const forceOptionalIntoNullable = refs.target === "openAi";
6
+ const result = {
7
+ type: "object",
8
+ properties: {}
9
+ };
10
+ const required = [];
11
+ const shape = def.shape();
12
+ for (const propName in shape) {
13
+ let propDef = shape[propName];
14
+ if (propDef === void 0 || propDef._def === void 0) continue;
15
+ let propOptional = safeIsOptional(propDef);
16
+ if (propOptional && forceOptionalIntoNullable) {
17
+ if (propDef._def.typeName === "ZodOptional") propDef = propDef._def.innerType;
18
+ if (!propDef.isNullable()) propDef = propDef.nullable();
19
+ propOptional = false;
20
+ }
21
+ const parsedDef = require_parseDef.parseDef(propDef._def, {
22
+ ...refs,
23
+ currentPath: [
24
+ ...refs.currentPath,
25
+ "properties",
26
+ propName
27
+ ],
28
+ propertyPath: [
29
+ ...refs.currentPath,
30
+ "properties",
31
+ propName
32
+ ]
33
+ });
34
+ if (parsedDef === void 0) continue;
35
+ result.properties[propName] = parsedDef;
36
+ if (!propOptional) required.push(propName);
37
+ }
38
+ if (required.length) result.required = required;
39
+ const additionalProperties = decideAdditionalProperties(def, refs);
40
+ if (additionalProperties !== void 0) result.additionalProperties = additionalProperties;
41
+ return result;
42
+ }
43
+ function decideAdditionalProperties(def, refs) {
44
+ if (def.catchall._def.typeName !== "ZodNever") return require_parseDef.parseDef(def.catchall._def, {
45
+ ...refs,
46
+ currentPath: [...refs.currentPath, "additionalProperties"]
47
+ });
48
+ switch (def.unknownKeys) {
49
+ case "passthrough": return refs.allowedAdditionalProperties;
50
+ case "strict": return refs.rejectedAdditionalProperties;
51
+ case "strip": return refs.removeAdditionalStrategy === "strict" ? refs.allowedAdditionalProperties : refs.rejectedAdditionalProperties;
52
+ }
53
+ }
54
+ function safeIsOptional(schema) {
55
+ try {
56
+ return schema.isOptional();
57
+ } catch {
58
+ return true;
59
+ }
60
+ }
61
+
62
+ //#endregion
63
+ exports.parseObjectDef = parseObjectDef;
64
+ //# sourceMappingURL=object.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"object.cjs","names":["def: ZodObjectDef","refs: Refs","result: JsonSchema7ObjectType","required: string[]","parseDef","schema: ZodTypeAny"],"sources":["../../../../src/utils/zod-to-json-schema/parsers/object.ts"],"sourcesContent":["import { ZodObjectDef, ZodTypeAny } from \"zod/v3\";\nimport { parseDef } from \"../parseDef.js\";\nimport { JsonSchema7Type } from \"../parseTypes.js\";\nimport { Refs } from \"../Refs.js\";\n\nexport type JsonSchema7ObjectType = {\n type: \"object\";\n properties: Record<string, JsonSchema7Type>;\n additionalProperties?: boolean | JsonSchema7Type;\n required?: string[];\n};\n\nexport function parseObjectDef(def: ZodObjectDef, refs: Refs) {\n const forceOptionalIntoNullable = refs.target === \"openAi\";\n\n const result: JsonSchema7ObjectType = {\n type: \"object\",\n properties: {},\n };\n\n const required: string[] = [];\n\n const shape = def.shape();\n\n for (const propName in shape) {\n let propDef = shape[propName];\n\n if (propDef === undefined || propDef._def === undefined) {\n continue;\n }\n\n let propOptional = safeIsOptional(propDef);\n\n if (propOptional && forceOptionalIntoNullable) {\n if (propDef._def.typeName === \"ZodOptional\") {\n propDef = propDef._def.innerType;\n }\n\n if (!propDef.isNullable()) {\n propDef = propDef.nullable();\n }\n\n propOptional = false;\n }\n\n const parsedDef = parseDef(propDef._def, {\n ...refs,\n currentPath: [...refs.currentPath, \"properties\", propName],\n propertyPath: [...refs.currentPath, \"properties\", propName],\n });\n\n if (parsedDef === undefined) {\n continue;\n }\n\n result.properties[propName] = parsedDef;\n\n if (!propOptional) {\n required.push(propName);\n }\n }\n\n if (required.length) {\n result.required = required;\n }\n\n const additionalProperties = decideAdditionalProperties(def, refs);\n\n if (additionalProperties !== undefined) {\n result.additionalProperties = additionalProperties;\n }\n\n return result;\n}\n\nfunction decideAdditionalProperties(def: ZodObjectDef, refs: Refs) {\n if (def.catchall._def.typeName !== \"ZodNever\") {\n return parseDef(def.catchall._def, {\n ...refs,\n currentPath: [...refs.currentPath, \"additionalProperties\"],\n });\n }\n\n switch (def.unknownKeys) {\n case \"passthrough\":\n return refs.allowedAdditionalProperties;\n case \"strict\":\n return refs.rejectedAdditionalProperties;\n case \"strip\":\n return refs.removeAdditionalStrategy === \"strict\"\n ? refs.allowedAdditionalProperties\n : refs.rejectedAdditionalProperties;\n }\n}\n\nfunction safeIsOptional(schema: ZodTypeAny): boolean {\n try {\n return schema.isOptional();\n } catch {\n return true;\n }\n}\n"],"mappings":";;;AAYA,SAAgB,eAAeA,KAAmBC,MAAY;CAC5D,MAAM,4BAA4B,KAAK,WAAW;CAElD,MAAMC,SAAgC;EACpC,MAAM;EACN,YAAY,CAAE;CACf;CAED,MAAMC,WAAqB,CAAE;CAE7B,MAAM,QAAQ,IAAI,OAAO;AAEzB,MAAK,MAAM,YAAY,OAAO;EAC5B,IAAI,UAAU,MAAM;AAEpB,MAAI,YAAY,UAAa,QAAQ,SAAS,OAC5C;EAGF,IAAI,eAAe,eAAe,QAAQ;AAE1C,MAAI,gBAAgB,2BAA2B;AAC7C,OAAI,QAAQ,KAAK,aAAa,eAC5B,UAAU,QAAQ,KAAK;AAGzB,OAAI,CAAC,QAAQ,YAAY,EACvB,UAAU,QAAQ,UAAU;GAG9B,eAAe;EAChB;EAED,MAAM,YAAYC,0BAAS,QAAQ,MAAM;GACvC,GAAG;GACH,aAAa;IAAC,GAAG,KAAK;IAAa;IAAc;GAAS;GAC1D,cAAc;IAAC,GAAG,KAAK;IAAa;IAAc;GAAS;EAC5D,EAAC;AAEF,MAAI,cAAc,OAChB;EAGF,OAAO,WAAW,YAAY;AAE9B,MAAI,CAAC,cACH,SAAS,KAAK,SAAS;CAE1B;AAED,KAAI,SAAS,QACX,OAAO,WAAW;CAGpB,MAAM,uBAAuB,2BAA2B,KAAK,KAAK;AAElE,KAAI,yBAAyB,QAC3B,OAAO,uBAAuB;AAGhC,QAAO;AACR;AAED,SAAS,2BAA2BJ,KAAmBC,MAAY;AACjE,KAAI,IAAI,SAAS,KAAK,aAAa,WACjC,QAAOG,0BAAS,IAAI,SAAS,MAAM;EACjC,GAAG;EACH,aAAa,CAAC,GAAG,KAAK,aAAa,sBAAuB;CAC3D,EAAC;AAGJ,SAAQ,IAAI,aAAZ;EACE,KAAK,cACH,QAAO,KAAK;EACd,KAAK,SACH,QAAO,KAAK;EACd,KAAK,QACH,QAAO,KAAK,6BAA6B,WACrC,KAAK,8BACL,KAAK;CACZ;AACF;AAED,SAAS,eAAeC,QAA6B;AACnD,KAAI;AACF,SAAO,OAAO,YAAY;CAC3B,QAAO;AACN,SAAO;CACR;AACF"}
@@ -0,0 +1,12 @@
1
+ import { JsonSchema7Type } from "../parseTypes.cjs";
2
+
3
+ //#region src/utils/zod-to-json-schema/parsers/object.d.ts
4
+ type JsonSchema7ObjectType = {
5
+ type: "object";
6
+ properties: Record<string, JsonSchema7Type>;
7
+ additionalProperties?: boolean | JsonSchema7Type;
8
+ required?: string[];
9
+ };
10
+ //#endregion
11
+ export { JsonSchema7ObjectType };
12
+ //# sourceMappingURL=object.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"object.d.cts","names":["ZodObjectDef","JsonSchema7Type","Refs","JsonSchema7ObjectType","Record","parseObjectDef"],"sources":["../../../../src/utils/zod-to-json-schema/parsers/object.d.ts"],"sourcesContent":["import { ZodObjectDef } from \"zod/v3\";\nimport { JsonSchema7Type } from \"../parseTypes.js\";\nimport { Refs } from \"../Refs.js\";\nexport type JsonSchema7ObjectType = {\n type: \"object\";\n properties: Record<string, JsonSchema7Type>;\n additionalProperties?: boolean | JsonSchema7Type;\n required?: string[];\n};\nexport declare function parseObjectDef(def: ZodObjectDef, refs: Refs): JsonSchema7ObjectType;\n"],"mappings":";;;AAGYG,KAAAA,qBAAAA,GAAqB;EAAA,IAAA,EAAA,QAAA;EAAA,UAEFF,EAAfG,MAAeH,CAAAA,MAAAA,EAAAA,eAAAA,CAAAA;EAAe,oBAA9BG,CAAAA,EAAAA,OAAAA,GACqBH,eADrBG;EAAM,QACeH,CAAAA,EAAAA,MAAAA,EAAAA;AAAe,CAAA"}
@@ -0,0 +1,13 @@
1
+ import { JsonSchema7Type } from "../parseTypes.js";
2
+ import "zod/v3";
3
+
4
+ //#region src/utils/zod-to-json-schema/parsers/object.d.ts
5
+ type JsonSchema7ObjectType = {
6
+ type: "object";
7
+ properties: Record<string, JsonSchema7Type>;
8
+ additionalProperties?: boolean | JsonSchema7Type;
9
+ required?: string[];
10
+ };
11
+ //#endregion
12
+ export { JsonSchema7ObjectType };
13
+ //# sourceMappingURL=object.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"object.d.ts","names":["ZodObjectDef","JsonSchema7Type","Refs","JsonSchema7ObjectType","Record","parseObjectDef"],"sources":["../../../../src/utils/zod-to-json-schema/parsers/object.d.ts"],"sourcesContent":["import { ZodObjectDef } from \"zod/v3\";\nimport { JsonSchema7Type } from \"../parseTypes.js\";\nimport { Refs } from \"../Refs.js\";\nexport type JsonSchema7ObjectType = {\n type: \"object\";\n properties: Record<string, JsonSchema7Type>;\n additionalProperties?: boolean | JsonSchema7Type;\n required?: string[];\n};\nexport declare function parseObjectDef(def: ZodObjectDef, refs: Refs): JsonSchema7ObjectType;\n"],"mappings":";;;;KAGYG,qBAAAA;EAAAA,IAAAA,EAAAA,QAAAA;EAAqB,UAAA,EAEjBC,MAFiB,CAAA,MAAA,EAEFH,eAFE,CAAA;EAAA,oBAEFA,CAAAA,EAAAA,OAAAA,GACMA,eADNA;EAAe,QAA9BG,CAAAA,EAAAA,MAAAA,EAAAA;CAAM"}
@@ -0,0 +1,64 @@
1
+ import { parseDef } from "../parseDef.js";
2
+
3
+ //#region src/utils/zod-to-json-schema/parsers/object.ts
4
+ function parseObjectDef(def, refs) {
5
+ const forceOptionalIntoNullable = refs.target === "openAi";
6
+ const result = {
7
+ type: "object",
8
+ properties: {}
9
+ };
10
+ const required = [];
11
+ const shape = def.shape();
12
+ for (const propName in shape) {
13
+ let propDef = shape[propName];
14
+ if (propDef === void 0 || propDef._def === void 0) continue;
15
+ let propOptional = safeIsOptional(propDef);
16
+ if (propOptional && forceOptionalIntoNullable) {
17
+ if (propDef._def.typeName === "ZodOptional") propDef = propDef._def.innerType;
18
+ if (!propDef.isNullable()) propDef = propDef.nullable();
19
+ propOptional = false;
20
+ }
21
+ const parsedDef = parseDef(propDef._def, {
22
+ ...refs,
23
+ currentPath: [
24
+ ...refs.currentPath,
25
+ "properties",
26
+ propName
27
+ ],
28
+ propertyPath: [
29
+ ...refs.currentPath,
30
+ "properties",
31
+ propName
32
+ ]
33
+ });
34
+ if (parsedDef === void 0) continue;
35
+ result.properties[propName] = parsedDef;
36
+ if (!propOptional) required.push(propName);
37
+ }
38
+ if (required.length) result.required = required;
39
+ const additionalProperties = decideAdditionalProperties(def, refs);
40
+ if (additionalProperties !== void 0) result.additionalProperties = additionalProperties;
41
+ return result;
42
+ }
43
+ function decideAdditionalProperties(def, refs) {
44
+ if (def.catchall._def.typeName !== "ZodNever") return parseDef(def.catchall._def, {
45
+ ...refs,
46
+ currentPath: [...refs.currentPath, "additionalProperties"]
47
+ });
48
+ switch (def.unknownKeys) {
49
+ case "passthrough": return refs.allowedAdditionalProperties;
50
+ case "strict": return refs.rejectedAdditionalProperties;
51
+ case "strip": return refs.removeAdditionalStrategy === "strict" ? refs.allowedAdditionalProperties : refs.rejectedAdditionalProperties;
52
+ }
53
+ }
54
+ function safeIsOptional(schema) {
55
+ try {
56
+ return schema.isOptional();
57
+ } catch {
58
+ return true;
59
+ }
60
+ }
61
+
62
+ //#endregion
63
+ export { parseObjectDef };
64
+ //# sourceMappingURL=object.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"object.js","names":["def: ZodObjectDef","refs: Refs","result: JsonSchema7ObjectType","required: string[]","schema: ZodTypeAny"],"sources":["../../../../src/utils/zod-to-json-schema/parsers/object.ts"],"sourcesContent":["import { ZodObjectDef, ZodTypeAny } from \"zod/v3\";\nimport { parseDef } from \"../parseDef.js\";\nimport { JsonSchema7Type } from \"../parseTypes.js\";\nimport { Refs } from \"../Refs.js\";\n\nexport type JsonSchema7ObjectType = {\n type: \"object\";\n properties: Record<string, JsonSchema7Type>;\n additionalProperties?: boolean | JsonSchema7Type;\n required?: string[];\n};\n\nexport function parseObjectDef(def: ZodObjectDef, refs: Refs) {\n const forceOptionalIntoNullable = refs.target === \"openAi\";\n\n const result: JsonSchema7ObjectType = {\n type: \"object\",\n properties: {},\n };\n\n const required: string[] = [];\n\n const shape = def.shape();\n\n for (const propName in shape) {\n let propDef = shape[propName];\n\n if (propDef === undefined || propDef._def === undefined) {\n continue;\n }\n\n let propOptional = safeIsOptional(propDef);\n\n if (propOptional && forceOptionalIntoNullable) {\n if (propDef._def.typeName === \"ZodOptional\") {\n propDef = propDef._def.innerType;\n }\n\n if (!propDef.isNullable()) {\n propDef = propDef.nullable();\n }\n\n propOptional = false;\n }\n\n const parsedDef = parseDef(propDef._def, {\n ...refs,\n currentPath: [...refs.currentPath, \"properties\", propName],\n propertyPath: [...refs.currentPath, \"properties\", propName],\n });\n\n if (parsedDef === undefined) {\n continue;\n }\n\n result.properties[propName] = parsedDef;\n\n if (!propOptional) {\n required.push(propName);\n }\n }\n\n if (required.length) {\n result.required = required;\n }\n\n const additionalProperties = decideAdditionalProperties(def, refs);\n\n if (additionalProperties !== undefined) {\n result.additionalProperties = additionalProperties;\n }\n\n return result;\n}\n\nfunction decideAdditionalProperties(def: ZodObjectDef, refs: Refs) {\n if (def.catchall._def.typeName !== \"ZodNever\") {\n return parseDef(def.catchall._def, {\n ...refs,\n currentPath: [...refs.currentPath, \"additionalProperties\"],\n });\n }\n\n switch (def.unknownKeys) {\n case \"passthrough\":\n return refs.allowedAdditionalProperties;\n case \"strict\":\n return refs.rejectedAdditionalProperties;\n case \"strip\":\n return refs.removeAdditionalStrategy === \"strict\"\n ? refs.allowedAdditionalProperties\n : refs.rejectedAdditionalProperties;\n }\n}\n\nfunction safeIsOptional(schema: ZodTypeAny): boolean {\n try {\n return schema.isOptional();\n } catch {\n return true;\n }\n}\n"],"mappings":";;;AAYA,SAAgB,eAAeA,KAAmBC,MAAY;CAC5D,MAAM,4BAA4B,KAAK,WAAW;CAElD,MAAMC,SAAgC;EACpC,MAAM;EACN,YAAY,CAAE;CACf;CAED,MAAMC,WAAqB,CAAE;CAE7B,MAAM,QAAQ,IAAI,OAAO;AAEzB,MAAK,MAAM,YAAY,OAAO;EAC5B,IAAI,UAAU,MAAM;AAEpB,MAAI,YAAY,UAAa,QAAQ,SAAS,OAC5C;EAGF,IAAI,eAAe,eAAe,QAAQ;AAE1C,MAAI,gBAAgB,2BAA2B;AAC7C,OAAI,QAAQ,KAAK,aAAa,eAC5B,UAAU,QAAQ,KAAK;AAGzB,OAAI,CAAC,QAAQ,YAAY,EACvB,UAAU,QAAQ,UAAU;GAG9B,eAAe;EAChB;EAED,MAAM,YAAY,SAAS,QAAQ,MAAM;GACvC,GAAG;GACH,aAAa;IAAC,GAAG,KAAK;IAAa;IAAc;GAAS;GAC1D,cAAc;IAAC,GAAG,KAAK;IAAa;IAAc;GAAS;EAC5D,EAAC;AAEF,MAAI,cAAc,OAChB;EAGF,OAAO,WAAW,YAAY;AAE9B,MAAI,CAAC,cACH,SAAS,KAAK,SAAS;CAE1B;AAED,KAAI,SAAS,QACX,OAAO,WAAW;CAGpB,MAAM,uBAAuB,2BAA2B,KAAK,KAAK;AAElE,KAAI,yBAAyB,QAC3B,OAAO,uBAAuB;AAGhC,QAAO;AACR;AAED,SAAS,2BAA2BH,KAAmBC,MAAY;AACjE,KAAI,IAAI,SAAS,KAAK,aAAa,WACjC,QAAO,SAAS,IAAI,SAAS,MAAM;EACjC,GAAG;EACH,aAAa,CAAC,GAAG,KAAK,aAAa,sBAAuB;CAC3D,EAAC;AAGJ,SAAQ,IAAI,aAAZ;EACE,KAAK,cACH,QAAO,KAAK;EACd,KAAK,SACH,QAAO,KAAK;EACd,KAAK,QACH,QAAO,KAAK,6BAA6B,WACrC,KAAK,8BACL,KAAK;CACZ;AACF;AAED,SAAS,eAAeG,QAA6B;AACnD,KAAI;AACF,SAAO,OAAO,YAAY;CAC3B,QAAO;AACN,SAAO;CACR;AACF"}
@@ -0,0 +1,20 @@
1
+ const require_any = require('./any.cjs');
2
+ const require_parseDef = require('../parseDef.cjs');
3
+
4
+ //#region src/utils/zod-to-json-schema/parsers/optional.ts
5
+ const parseOptionalDef = (def, refs) => {
6
+ if (refs.currentPath.toString() === refs.propertyPath?.toString()) return require_parseDef.parseDef(def.innerType._def, refs);
7
+ const innerSchema = require_parseDef.parseDef(def.innerType._def, {
8
+ ...refs,
9
+ currentPath: [
10
+ ...refs.currentPath,
11
+ "anyOf",
12
+ "1"
13
+ ]
14
+ });
15
+ return innerSchema ? { anyOf: [{ not: require_any.parseAnyDef(refs) }, innerSchema] } : require_any.parseAnyDef(refs);
16
+ };
17
+
18
+ //#endregion
19
+ exports.parseOptionalDef = parseOptionalDef;
20
+ //# sourceMappingURL=optional.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"optional.cjs","names":["def: ZodOptionalDef","refs: Refs","parseDef","parseAnyDef"],"sources":["../../../../src/utils/zod-to-json-schema/parsers/optional.ts"],"sourcesContent":["import { ZodOptionalDef } from \"zod/v3\";\nimport { parseDef } from \"../parseDef.js\";\nimport { JsonSchema7Type } from \"../parseTypes.js\";\nimport { Refs } from \"../Refs.js\";\nimport { parseAnyDef } from \"./any.js\";\n\nexport const parseOptionalDef = (\n def: ZodOptionalDef,\n refs: Refs\n): JsonSchema7Type | undefined => {\n if (refs.currentPath.toString() === refs.propertyPath?.toString()) {\n return parseDef(def.innerType._def, refs);\n }\n\n const innerSchema = parseDef(def.innerType._def, {\n ...refs,\n currentPath: [...refs.currentPath, \"anyOf\", \"1\"],\n });\n\n return innerSchema\n ? {\n anyOf: [\n {\n not: parseAnyDef(refs),\n },\n innerSchema,\n ],\n }\n : parseAnyDef(refs);\n};\n"],"mappings":";;;;AAMA,MAAa,mBAAmB,CAC9BA,KACAC,SACgC;AAChC,KAAI,KAAK,YAAY,UAAU,KAAK,KAAK,cAAc,UAAU,CAC/D,QAAOC,0BAAS,IAAI,UAAU,MAAM,KAAK;CAG3C,MAAM,cAAcA,0BAAS,IAAI,UAAU,MAAM;EAC/C,GAAG;EACH,aAAa;GAAC,GAAG,KAAK;GAAa;GAAS;EAAI;CACjD,EAAC;AAEF,QAAO,cACH,EACE,OAAO,CACL,EACE,KAAKC,wBAAY,KAAK,CACvB,GACD,WACD,EACF,IACDA,wBAAY,KAAK;AACtB"}
@@ -0,0 +1,20 @@
1
+ import { parseAnyDef } from "./any.js";
2
+ import { parseDef } from "../parseDef.js";
3
+
4
+ //#region src/utils/zod-to-json-schema/parsers/optional.ts
5
+ const parseOptionalDef = (def, refs) => {
6
+ if (refs.currentPath.toString() === refs.propertyPath?.toString()) return parseDef(def.innerType._def, refs);
7
+ const innerSchema = parseDef(def.innerType._def, {
8
+ ...refs,
9
+ currentPath: [
10
+ ...refs.currentPath,
11
+ "anyOf",
12
+ "1"
13
+ ]
14
+ });
15
+ return innerSchema ? { anyOf: [{ not: parseAnyDef(refs) }, innerSchema] } : parseAnyDef(refs);
16
+ };
17
+
18
+ //#endregion
19
+ export { parseOptionalDef };
20
+ //# sourceMappingURL=optional.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"optional.js","names":["def: ZodOptionalDef","refs: Refs"],"sources":["../../../../src/utils/zod-to-json-schema/parsers/optional.ts"],"sourcesContent":["import { ZodOptionalDef } from \"zod/v3\";\nimport { parseDef } from \"../parseDef.js\";\nimport { JsonSchema7Type } from \"../parseTypes.js\";\nimport { Refs } from \"../Refs.js\";\nimport { parseAnyDef } from \"./any.js\";\n\nexport const parseOptionalDef = (\n def: ZodOptionalDef,\n refs: Refs\n): JsonSchema7Type | undefined => {\n if (refs.currentPath.toString() === refs.propertyPath?.toString()) {\n return parseDef(def.innerType._def, refs);\n }\n\n const innerSchema = parseDef(def.innerType._def, {\n ...refs,\n currentPath: [...refs.currentPath, \"anyOf\", \"1\"],\n });\n\n return innerSchema\n ? {\n anyOf: [\n {\n not: parseAnyDef(refs),\n },\n innerSchema,\n ],\n }\n : parseAnyDef(refs);\n};\n"],"mappings":";;;;AAMA,MAAa,mBAAmB,CAC9BA,KACAC,SACgC;AAChC,KAAI,KAAK,YAAY,UAAU,KAAK,KAAK,cAAc,UAAU,CAC/D,QAAO,SAAS,IAAI,UAAU,MAAM,KAAK;CAG3C,MAAM,cAAc,SAAS,IAAI,UAAU,MAAM;EAC/C,GAAG;EACH,aAAa;GAAC,GAAG,KAAK;GAAa;GAAS;EAAI;CACjD,EAAC;AAEF,QAAO,cACH,EACE,OAAO,CACL,EACE,KAAK,YAAY,KAAK,CACvB,GACD,WACD,EACF,IACD,YAAY,KAAK;AACtB"}
@@ -0,0 +1,28 @@
1
+ const require_parseDef = require('../parseDef.cjs');
2
+
3
+ //#region src/utils/zod-to-json-schema/parsers/pipeline.ts
4
+ const parsePipelineDef = (def, refs) => {
5
+ if (refs.pipeStrategy === "input") return require_parseDef.parseDef(def.in._def, refs);
6
+ else if (refs.pipeStrategy === "output") return require_parseDef.parseDef(def.out._def, refs);
7
+ const a = require_parseDef.parseDef(def.in._def, {
8
+ ...refs,
9
+ currentPath: [
10
+ ...refs.currentPath,
11
+ "allOf",
12
+ "0"
13
+ ]
14
+ });
15
+ const b = require_parseDef.parseDef(def.out._def, {
16
+ ...refs,
17
+ currentPath: [
18
+ ...refs.currentPath,
19
+ "allOf",
20
+ a ? "1" : "0"
21
+ ]
22
+ });
23
+ return { allOf: [a, b].filter((x) => x !== void 0) };
24
+ };
25
+
26
+ //#endregion
27
+ exports.parsePipelineDef = parsePipelineDef;
28
+ //# sourceMappingURL=pipeline.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pipeline.cjs","names":["def: ZodPipelineDef<any, any>","refs: Refs","parseDef"],"sources":["../../../../src/utils/zod-to-json-schema/parsers/pipeline.ts"],"sourcesContent":["import { ZodPipelineDef } from \"zod/v3\";\nimport { parseDef } from \"../parseDef.js\";\nimport { JsonSchema7Type } from \"../parseTypes.js\";\nimport { Refs } from \"../Refs.js\";\nimport { JsonSchema7AllOfType } from \"./intersection.js\";\n\nexport const parsePipelineDef = (\n def: ZodPipelineDef<any, any>,\n refs: Refs\n): JsonSchema7AllOfType | JsonSchema7Type | undefined => {\n if (refs.pipeStrategy === \"input\") {\n return parseDef(def.in._def, refs);\n } else if (refs.pipeStrategy === \"output\") {\n return parseDef(def.out._def, refs);\n }\n\n const a = parseDef(def.in._def, {\n ...refs,\n currentPath: [...refs.currentPath, \"allOf\", \"0\"],\n });\n const b = parseDef(def.out._def, {\n ...refs,\n currentPath: [...refs.currentPath, \"allOf\", a ? \"1\" : \"0\"],\n });\n\n return {\n allOf: [a, b].filter((x): x is JsonSchema7Type => x !== undefined),\n };\n};\n"],"mappings":";;;AAMA,MAAa,mBAAmB,CAC9BA,KACAC,SACuD;AACvD,KAAI,KAAK,iBAAiB,QACxB,QAAOC,0BAAS,IAAI,GAAG,MAAM,KAAK;UACzB,KAAK,iBAAiB,SAC/B,QAAOA,0BAAS,IAAI,IAAI,MAAM,KAAK;CAGrC,MAAM,IAAIA,0BAAS,IAAI,GAAG,MAAM;EAC9B,GAAG;EACH,aAAa;GAAC,GAAG,KAAK;GAAa;GAAS;EAAI;CACjD,EAAC;CACF,MAAM,IAAIA,0BAAS,IAAI,IAAI,MAAM;EAC/B,GAAG;EACH,aAAa;GAAC,GAAG,KAAK;GAAa;GAAS,IAAI,MAAM;EAAI;CAC3D,EAAC;AAEF,QAAO,EACL,OAAO,CAAC,GAAG,CAAE,EAAC,OAAO,CAAC,MAA4B,MAAM,OAAU,CACnE;AACF"}
@@ -0,0 +1,28 @@
1
+ import { parseDef } from "../parseDef.js";
2
+
3
+ //#region src/utils/zod-to-json-schema/parsers/pipeline.ts
4
+ const parsePipelineDef = (def, refs) => {
5
+ if (refs.pipeStrategy === "input") return parseDef(def.in._def, refs);
6
+ else if (refs.pipeStrategy === "output") return parseDef(def.out._def, refs);
7
+ const a = parseDef(def.in._def, {
8
+ ...refs,
9
+ currentPath: [
10
+ ...refs.currentPath,
11
+ "allOf",
12
+ "0"
13
+ ]
14
+ });
15
+ const b = parseDef(def.out._def, {
16
+ ...refs,
17
+ currentPath: [
18
+ ...refs.currentPath,
19
+ "allOf",
20
+ a ? "1" : "0"
21
+ ]
22
+ });
23
+ return { allOf: [a, b].filter((x) => x !== void 0) };
24
+ };
25
+
26
+ //#endregion
27
+ export { parsePipelineDef };
28
+ //# sourceMappingURL=pipeline.js.map