@posthog/agent 1.16.6 → 1.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (227) hide show
  1. package/README.md +6 -2
  2. package/dist/claude-cli/cli.js +3617 -0
  3. package/dist/claude-cli/package.json +3 -0
  4. package/dist/index.d.ts +1 -3
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/src/agent.d.ts +0 -3
  7. package/dist/src/agent.d.ts.map +1 -1
  8. package/dist/src/agent.js +6 -27
  9. package/dist/src/agent.js.map +1 -1
  10. package/dist/src/agents/research.d.ts +1 -1
  11. package/dist/src/agents/research.d.ts.map +1 -1
  12. package/dist/src/agents/research.js +84 -53
  13. package/dist/src/agents/research.js.map +1 -1
  14. package/dist/src/file-manager.d.ts +3 -21
  15. package/dist/src/file-manager.d.ts.map +1 -1
  16. package/dist/src/file-manager.js +15 -47
  17. package/dist/src/file-manager.js.map +1 -1
  18. package/dist/src/git-manager.d.ts.map +1 -1
  19. package/dist/src/git-manager.js +8 -1
  20. package/dist/src/git-manager.js.map +1 -1
  21. package/dist/src/posthog-api.d.ts +6 -1
  22. package/dist/src/posthog-api.d.ts.map +1 -1
  23. package/dist/src/posthog-api.js +28 -0
  24. package/dist/src/posthog-api.js.map +1 -1
  25. package/dist/src/task-progress-reporter.d.ts.map +1 -1
  26. package/dist/src/task-progress-reporter.js +0 -1
  27. package/dist/src/task-progress-reporter.js.map +1 -1
  28. package/dist/src/types.d.ts +21 -2
  29. package/dist/src/types.d.ts.map +1 -1
  30. package/dist/src/types.js.map +1 -1
  31. package/dist/src/workflow/steps/plan.d.ts.map +1 -1
  32. package/dist/src/workflow/steps/plan.js +26 -18
  33. package/dist/src/workflow/steps/plan.js.map +1 -1
  34. package/dist/src/workflow/steps/research.d.ts.map +1 -1
  35. package/dist/src/workflow/steps/research.js +100 -66
  36. package/dist/src/workflow/steps/research.js.map +1 -1
  37. package/dist/src/workflow/types.d.ts +0 -2
  38. package/dist/src/workflow/types.d.ts.map +1 -1
  39. package/dist/templates/plan-template.md +1 -5
  40. package/package.json +2 -6
  41. package/src/agent.ts +7 -31
  42. package/src/agents/research.ts +84 -53
  43. package/src/file-manager.ts +18 -73
  44. package/src/git-manager.ts +7 -1
  45. package/src/posthog-api.ts +33 -1
  46. package/src/task-progress-reporter.ts +0 -1
  47. package/src/templates/plan-template.md +1 -5
  48. package/src/types.ts +25 -2
  49. package/src/workflow/steps/plan.ts +28 -21
  50. package/src/workflow/steps/research.ts +109 -74
  51. package/src/workflow/types.ts +0 -2
  52. package/dist/_virtual/_commonjsHelpers.js +0 -6
  53. package/dist/_virtual/_commonjsHelpers.js.map +0 -1
  54. package/dist/_virtual/index.js +0 -4
  55. package/dist/_virtual/index.js.map +0 -1
  56. package/dist/node_modules/@ai-sdk/anthropic/dist/index.js +0 -1154
  57. package/dist/node_modules/@ai-sdk/anthropic/dist/index.js.map +0 -1
  58. package/dist/node_modules/@ai-sdk/provider/dist/index.js +0 -296
  59. package/dist/node_modules/@ai-sdk/provider/dist/index.js.map +0 -1
  60. package/dist/node_modules/@ai-sdk/provider-utils/dist/index.js +0 -576
  61. package/dist/node_modules/@ai-sdk/provider-utils/dist/index.js.map +0 -1
  62. package/dist/node_modules/@ai-sdk/ui-utils/dist/index.js +0 -741
  63. package/dist/node_modules/@ai-sdk/ui-utils/dist/index.js.map +0 -1
  64. package/dist/node_modules/@opentelemetry/api/build/esm/api/context.js +0 -112
  65. package/dist/node_modules/@opentelemetry/api/build/esm/api/context.js.map +0 -1
  66. package/dist/node_modules/@opentelemetry/api/build/esm/api/diag.js +0 -123
  67. package/dist/node_modules/@opentelemetry/api/build/esm/api/diag.js.map +0 -1
  68. package/dist/node_modules/@opentelemetry/api/build/esm/api/metrics.js +0 -62
  69. package/dist/node_modules/@opentelemetry/api/build/esm/api/metrics.js.map +0 -1
  70. package/dist/node_modules/@opentelemetry/api/build/esm/api/propagation.js +0 -91
  71. package/dist/node_modules/@opentelemetry/api/build/esm/api/propagation.js.map +0 -1
  72. package/dist/node_modules/@opentelemetry/api/build/esm/api/trace.js +0 -79
  73. package/dist/node_modules/@opentelemetry/api/build/esm/api/trace.js.map +0 -1
  74. package/dist/node_modules/@opentelemetry/api/build/esm/baggage/context-helpers.js +0 -59
  75. package/dist/node_modules/@opentelemetry/api/build/esm/baggage/context-helpers.js.map +0 -1
  76. package/dist/node_modules/@opentelemetry/api/build/esm/baggage/internal/baggage-impl.js +0 -99
  77. package/dist/node_modules/@opentelemetry/api/build/esm/baggage/internal/baggage-impl.js.map +0 -1
  78. package/dist/node_modules/@opentelemetry/api/build/esm/baggage/utils.js +0 -31
  79. package/dist/node_modules/@opentelemetry/api/build/esm/baggage/utils.js.map +0 -1
  80. package/dist/node_modules/@opentelemetry/api/build/esm/context/NoopContextManager.js +0 -69
  81. package/dist/node_modules/@opentelemetry/api/build/esm/context/NoopContextManager.js.map +0 -1
  82. package/dist/node_modules/@opentelemetry/api/build/esm/context/context.js +0 -54
  83. package/dist/node_modules/@opentelemetry/api/build/esm/context/context.js.map +0 -1
  84. package/dist/node_modules/@opentelemetry/api/build/esm/context-api.js +0 -22
  85. package/dist/node_modules/@opentelemetry/api/build/esm/context-api.js.map +0 -1
  86. package/dist/node_modules/@opentelemetry/api/build/esm/diag/ComponentLogger.js +0 -104
  87. package/dist/node_modules/@opentelemetry/api/build/esm/diag/ComponentLogger.js.map +0 -1
  88. package/dist/node_modules/@opentelemetry/api/build/esm/diag/internal/logLevelLogger.js +0 -44
  89. package/dist/node_modules/@opentelemetry/api/build/esm/diag/internal/logLevelLogger.js.map +0 -1
  90. package/dist/node_modules/@opentelemetry/api/build/esm/diag/types.js +0 -43
  91. package/dist/node_modules/@opentelemetry/api/build/esm/diag/types.js.map +0 -1
  92. package/dist/node_modules/@opentelemetry/api/build/esm/diag-api.js +0 -27
  93. package/dist/node_modules/@opentelemetry/api/build/esm/diag-api.js.map +0 -1
  94. package/dist/node_modules/@opentelemetry/api/build/esm/internal/global-utils.js +0 -62
  95. package/dist/node_modules/@opentelemetry/api/build/esm/internal/global-utils.js.map +0 -1
  96. package/dist/node_modules/@opentelemetry/api/build/esm/internal/semver.js +0 -121
  97. package/dist/node_modules/@opentelemetry/api/build/esm/internal/semver.js.map +0 -1
  98. package/dist/node_modules/@opentelemetry/api/build/esm/metrics/NoopMeter.js +0 -167
  99. package/dist/node_modules/@opentelemetry/api/build/esm/metrics/NoopMeter.js.map +0 -1
  100. package/dist/node_modules/@opentelemetry/api/build/esm/metrics/NoopMeterProvider.js +0 -33
  101. package/dist/node_modules/@opentelemetry/api/build/esm/metrics/NoopMeterProvider.js.map +0 -1
  102. package/dist/node_modules/@opentelemetry/api/build/esm/metrics-api.js +0 -22
  103. package/dist/node_modules/@opentelemetry/api/build/esm/metrics-api.js.map +0 -1
  104. package/dist/node_modules/@opentelemetry/api/build/esm/platform/node/globalThis.js +0 -21
  105. package/dist/node_modules/@opentelemetry/api/build/esm/platform/node/globalThis.js.map +0 -1
  106. package/dist/node_modules/@opentelemetry/api/build/esm/propagation/NoopTextMapPropagator.js +0 -35
  107. package/dist/node_modules/@opentelemetry/api/build/esm/propagation/NoopTextMapPropagator.js.map +0 -1
  108. package/dist/node_modules/@opentelemetry/api/build/esm/propagation/TextMapPropagator.js +0 -40
  109. package/dist/node_modules/@opentelemetry/api/build/esm/propagation/TextMapPropagator.js.map +0 -1
  110. package/dist/node_modules/@opentelemetry/api/build/esm/propagation-api.js +0 -22
  111. package/dist/node_modules/@opentelemetry/api/build/esm/propagation-api.js.map +0 -1
  112. package/dist/node_modules/@opentelemetry/api/build/esm/trace/NonRecordingSpan.js +0 -70
  113. package/dist/node_modules/@opentelemetry/api/build/esm/trace/NonRecordingSpan.js.map +0 -1
  114. package/dist/node_modules/@opentelemetry/api/build/esm/trace/NoopTracer.js +0 -78
  115. package/dist/node_modules/@opentelemetry/api/build/esm/trace/NoopTracer.js.map +0 -1
  116. package/dist/node_modules/@opentelemetry/api/build/esm/trace/NoopTracerProvider.js +0 -34
  117. package/dist/node_modules/@opentelemetry/api/build/esm/trace/NoopTracerProvider.js.map +0 -1
  118. package/dist/node_modules/@opentelemetry/api/build/esm/trace/ProxyTracer.js +0 -55
  119. package/dist/node_modules/@opentelemetry/api/build/esm/trace/ProxyTracer.js.map +0 -1
  120. package/dist/node_modules/@opentelemetry/api/build/esm/trace/ProxyTracerProvider.js +0 -56
  121. package/dist/node_modules/@opentelemetry/api/build/esm/trace/ProxyTracerProvider.js.map +0 -1
  122. package/dist/node_modules/@opentelemetry/api/build/esm/trace/context-utils.js +0 -76
  123. package/dist/node_modules/@opentelemetry/api/build/esm/trace/context-utils.js.map +0 -1
  124. package/dist/node_modules/@opentelemetry/api/build/esm/trace/invalid-span-constants.js +0 -27
  125. package/dist/node_modules/@opentelemetry/api/build/esm/trace/invalid-span-constants.js.map +0 -1
  126. package/dist/node_modules/@opentelemetry/api/build/esm/trace/spancontext-utils.js +0 -45
  127. package/dist/node_modules/@opentelemetry/api/build/esm/trace/spancontext-utils.js.map +0 -1
  128. package/dist/node_modules/@opentelemetry/api/build/esm/trace/status.js +0 -22
  129. package/dist/node_modules/@opentelemetry/api/build/esm/trace/status.js.map +0 -1
  130. package/dist/node_modules/@opentelemetry/api/build/esm/trace/trace_flags.js +0 -25
  131. package/dist/node_modules/@opentelemetry/api/build/esm/trace/trace_flags.js.map +0 -1
  132. package/dist/node_modules/@opentelemetry/api/build/esm/trace-api.js +0 -24
  133. package/dist/node_modules/@opentelemetry/api/build/esm/trace-api.js.map +0 -1
  134. package/dist/node_modules/@opentelemetry/api/build/esm/version.js +0 -20
  135. package/dist/node_modules/@opentelemetry/api/build/esm/version.js.map +0 -1
  136. package/dist/node_modules/ai/dist/index.js +0 -2870
  137. package/dist/node_modules/ai/dist/index.js.map +0 -1
  138. package/dist/node_modules/nanoid/non-secure/index.js +0 -13
  139. package/dist/node_modules/nanoid/non-secure/index.js.map +0 -1
  140. package/dist/node_modules/secure-json-parse/index.js +0 -133
  141. package/dist/node_modules/secure-json-parse/index.js.map +0 -1
  142. package/dist/node_modules/zod-to-json-schema/dist/esm/Options.js +0 -37
  143. package/dist/node_modules/zod-to-json-schema/dist/esm/Options.js.map +0 -1
  144. package/dist/node_modules/zod-to-json-schema/dist/esm/Refs.js +0 -26
  145. package/dist/node_modules/zod-to-json-schema/dist/esm/Refs.js.map +0 -1
  146. package/dist/node_modules/zod-to-json-schema/dist/esm/errorMessages.js +0 -17
  147. package/dist/node_modules/zod-to-json-schema/dist/esm/errorMessages.js.map +0 -1
  148. package/dist/node_modules/zod-to-json-schema/dist/esm/getRelativePath.js +0 -11
  149. package/dist/node_modules/zod-to-json-schema/dist/esm/getRelativePath.js.map +0 -1
  150. package/dist/node_modules/zod-to-json-schema/dist/esm/index.js +0 -8
  151. package/dist/node_modules/zod-to-json-schema/dist/esm/index.js.map +0 -1
  152. package/dist/node_modules/zod-to-json-schema/dist/esm/parseDef.js +0 -66
  153. package/dist/node_modules/zod-to-json-schema/dist/esm/parseDef.js.map +0 -1
  154. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/any.js +0 -21
  155. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/any.js.map +0 -1
  156. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/array.js +0 -30
  157. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/array.js.map +0 -1
  158. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js +0 -53
  159. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js.map +0 -1
  160. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js +0 -8
  161. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js.map +0 -1
  162. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js +0 -8
  163. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js.map +0 -1
  164. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/catch.js +0 -8
  165. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/catch.js.map +0 -1
  166. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/date.js +0 -50
  167. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/date.js.map +0 -1
  168. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/default.js +0 -11
  169. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/default.js.map +0 -1
  170. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/effects.js +0 -11
  171. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/effects.js.map +0 -1
  172. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/enum.js +0 -9
  173. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/enum.js.map +0 -1
  174. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js +0 -56
  175. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js.map +0 -1
  176. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/literal.js +0 -24
  177. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/literal.js.map +0 -1
  178. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/map.js +0 -30
  179. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/map.js.map +0 -1
  180. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js +0 -19
  181. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js.map +0 -1
  182. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/never.js +0 -15
  183. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/never.js.map +0 -1
  184. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/null.js +0 -13
  185. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/null.js.map +0 -1
  186. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js +0 -37
  187. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js.map +0 -1
  188. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/number.js +0 -56
  189. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/number.js.map +0 -1
  190. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/object.js +0 -76
  191. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/object.js.map +0 -1
  192. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js +0 -25
  193. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js.map +0 -1
  194. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js +0 -24
  195. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js.map +0 -1
  196. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/promise.js +0 -8
  197. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/promise.js.map +0 -1
  198. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js +0 -8
  199. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js.map +0 -1
  200. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/record.js +0 -65
  201. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/record.js.map +0 -1
  202. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/set.js +0 -24
  203. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/set.js.map +0 -1
  204. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/string.js +0 -350
  205. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/string.js.map +0 -1
  206. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js +0 -36
  207. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js.map +0 -1
  208. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js +0 -10
  209. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js.map +0 -1
  210. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/union.js +0 -84
  211. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/union.js.map +0 -1
  212. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js +0 -8
  213. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js.map +0 -1
  214. package/dist/node_modules/zod-to-json-schema/dist/esm/selectParser.js +0 -110
  215. package/dist/node_modules/zod-to-json-schema/dist/esm/selectParser.js.map +0 -1
  216. package/dist/node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js +0 -90
  217. package/dist/node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js.map +0 -1
  218. package/dist/src/structured-extraction.d.ts +0 -28
  219. package/dist/src/structured-extraction.d.ts.map +0 -1
  220. package/dist/src/structured-extraction.js +0 -77
  221. package/dist/src/structured-extraction.js.map +0 -1
  222. package/dist/src/utils/ai-sdk.d.ts +0 -14
  223. package/dist/src/utils/ai-sdk.d.ts.map +0 -1
  224. package/dist/src/utils/ai-sdk.js +0 -38
  225. package/dist/src/utils/ai-sdk.js.map +0 -1
  226. package/src/structured-extraction.ts +0 -117
  227. package/src/utils/ai-sdk.ts +0 -47
@@ -1,11 +0,0 @@
1
- import { parseDef } from '../parseDef.js';
2
- import { parseAnyDef } from './any.js';
3
-
4
- function parseEffectsDef(_def, refs) {
5
- return refs.effectStrategy === "input"
6
- ? parseDef(_def.schema._def, refs)
7
- : parseAnyDef(refs);
8
- }
9
-
10
- export { parseEffectsDef };
11
- //# sourceMappingURL=effects.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"effects.js","sources":["../../../../../../node_modules/zod-to-json-schema/dist/esm/parsers/effects.js"],"sourcesContent":["import { parseDef } from \"../parseDef.js\";\nimport { parseAnyDef } from \"./any.js\";\nexport function parseEffectsDef(_def, refs) {\n return refs.effectStrategy === \"input\"\n ? parseDef(_def.schema._def, refs)\n : parseAnyDef(refs);\n}\n"],"names":[],"mappings":";;;AAEO,SAAS,eAAe,CAAC,IAAI,EAAE,IAAI,EAAE;AAC5C,IAAI,OAAO,IAAI,CAAC,cAAc,KAAK;AACnC,UAAU,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI;AACzC,UAAU,WAAW,CAAC,IAAI,CAAC;AAC3B;;;;","x_google_ignoreList":[0]}
@@ -1,9 +0,0 @@
1
- function parseEnumDef(def) {
2
- return {
3
- type: "string",
4
- enum: Array.from(def.values),
5
- };
6
- }
7
-
8
- export { parseEnumDef };
9
- //# sourceMappingURL=enum.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"enum.js","sources":["../../../../../../node_modules/zod-to-json-schema/dist/esm/parsers/enum.js"],"sourcesContent":["export function parseEnumDef(def) {\n return {\n type: \"string\",\n enum: Array.from(def.values),\n };\n}\n"],"names":[],"mappings":"AAAO,SAAS,YAAY,CAAC,GAAG,EAAE;AAClC,IAAI,OAAO;AACX,QAAQ,IAAI,EAAE,QAAQ;AACtB,QAAQ,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC;AACpC,KAAK;AACL;;;;","x_google_ignoreList":[0]}
@@ -1,56 +0,0 @@
1
- import { parseDef } from '../parseDef.js';
2
-
3
- const isJsonSchema7AllOfType = (type) => {
4
- if ("type" in type && type.type === "string")
5
- return false;
6
- return "allOf" in type;
7
- };
8
- function parseIntersectionDef(def, refs) {
9
- const allOf = [
10
- parseDef(def.left._def, {
11
- ...refs,
12
- currentPath: [...refs.currentPath, "allOf", "0"],
13
- }),
14
- parseDef(def.right._def, {
15
- ...refs,
16
- currentPath: [...refs.currentPath, "allOf", "1"],
17
- }),
18
- ].filter((x) => !!x);
19
- let unevaluatedProperties = refs.target === "jsonSchema2019-09"
20
- ? { unevaluatedProperties: false }
21
- : undefined;
22
- const mergedAllOf = [];
23
- // If either of the schemas is an allOf, merge them into a single allOf
24
- allOf.forEach((schema) => {
25
- if (isJsonSchema7AllOfType(schema)) {
26
- mergedAllOf.push(...schema.allOf);
27
- if (schema.unevaluatedProperties === undefined) {
28
- // If one of the schemas has no unevaluatedProperties set,
29
- // the merged schema should also have no unevaluatedProperties set
30
- unevaluatedProperties = undefined;
31
- }
32
- }
33
- else {
34
- let nestedSchema = schema;
35
- if ("additionalProperties" in schema &&
36
- schema.additionalProperties === false) {
37
- const { additionalProperties, ...rest } = schema;
38
- nestedSchema = rest;
39
- }
40
- else {
41
- // As soon as one of the schemas has additionalProperties set not to false, we allow unevaluatedProperties
42
- unevaluatedProperties = undefined;
43
- }
44
- mergedAllOf.push(nestedSchema);
45
- }
46
- });
47
- return mergedAllOf.length
48
- ? {
49
- allOf: mergedAllOf,
50
- ...unevaluatedProperties,
51
- }
52
- : undefined;
53
- }
54
-
55
- export { parseIntersectionDef };
56
- //# sourceMappingURL=intersection.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"intersection.js","sources":["../../../../../../node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js"],"sourcesContent":["import { parseDef } from \"../parseDef.js\";\nconst isJsonSchema7AllOfType = (type) => {\n if (\"type\" in type && type.type === \"string\")\n return false;\n return \"allOf\" in type;\n};\nexport function parseIntersectionDef(def, refs) {\n const allOf = [\n parseDef(def.left._def, {\n ...refs,\n currentPath: [...refs.currentPath, \"allOf\", \"0\"],\n }),\n parseDef(def.right._def, {\n ...refs,\n currentPath: [...refs.currentPath, \"allOf\", \"1\"],\n }),\n ].filter((x) => !!x);\n let unevaluatedProperties = refs.target === \"jsonSchema2019-09\"\n ? { unevaluatedProperties: false }\n : undefined;\n const mergedAllOf = [];\n // If either of the schemas is an allOf, merge them into a single allOf\n allOf.forEach((schema) => {\n if (isJsonSchema7AllOfType(schema)) {\n mergedAllOf.push(...schema.allOf);\n if (schema.unevaluatedProperties === undefined) {\n // If one of the schemas has no unevaluatedProperties set,\n // the merged schema should also have no unevaluatedProperties set\n unevaluatedProperties = undefined;\n }\n }\n else {\n let nestedSchema = schema;\n if (\"additionalProperties\" in schema &&\n schema.additionalProperties === false) {\n const { additionalProperties, ...rest } = schema;\n nestedSchema = rest;\n }\n else {\n // As soon as one of the schemas has additionalProperties set not to false, we allow unevaluatedProperties\n unevaluatedProperties = undefined;\n }\n mergedAllOf.push(nestedSchema);\n }\n });\n return mergedAllOf.length\n ? {\n allOf: mergedAllOf,\n ...unevaluatedProperties,\n }\n : undefined;\n}\n"],"names":[],"mappings":";;AACA,MAAM,sBAAsB,GAAG,CAAC,IAAI,KAAK;AACzC,IAAI,IAAI,MAAM,IAAI,IAAI,IAAI,IAAI,CAAC,IAAI,KAAK,QAAQ;AAChD,QAAQ,OAAO,KAAK;AACpB,IAAI,OAAO,OAAO,IAAI,IAAI;AAC1B,CAAC;AACM,SAAS,oBAAoB,CAAC,GAAG,EAAE,IAAI,EAAE;AAChD,IAAI,MAAM,KAAK,GAAG;AAClB,QAAQ,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE;AAChC,YAAY,GAAG,IAAI;AACnB,YAAY,WAAW,EAAE,CAAC,GAAG,IAAI,CAAC,WAAW,EAAE,OAAO,EAAE,GAAG,CAAC;AAC5D,SAAS,CAAC;AACV,QAAQ,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE;AACjC,YAAY,GAAG,IAAI;AACnB,YAAY,WAAW,EAAE,CAAC,GAAG,IAAI,CAAC,WAAW,EAAE,OAAO,EAAE,GAAG,CAAC;AAC5D,SAAS,CAAC;AACV,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACxB,IAAI,IAAI,qBAAqB,GAAG,IAAI,CAAC,MAAM,KAAK;AAChD,UAAU,EAAE,qBAAqB,EAAE,KAAK;AACxC,UAAU,SAAS;AACnB,IAAI,MAAM,WAAW,GAAG,EAAE;AAC1B;AACA,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,MAAM,KAAK;AAC9B,QAAQ,IAAI,sBAAsB,CAAC,MAAM,CAAC,EAAE;AAC5C,YAAY,WAAW,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC;AAC7C,YAAY,IAAI,MAAM,CAAC,qBAAqB,KAAK,SAAS,EAAE;AAC5D;AACA;AACA,gBAAgB,qBAAqB,GAAG,SAAS;AACjD,YAAY;AACZ,QAAQ;AACR,aAAa;AACb,YAAY,IAAI,YAAY,GAAG,MAAM;AACrC,YAAY,IAAI,sBAAsB,IAAI,MAAM;AAChD,gBAAgB,MAAM,CAAC,oBAAoB,KAAK,KAAK,EAAE;AACvD,gBAAgB,MAAM,EAAE,oBAAoB,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM;AAChE,gBAAgB,YAAY,GAAG,IAAI;AACnC,YAAY;AACZ,iBAAiB;AACjB;AACA,gBAAgB,qBAAqB,GAAG,SAAS;AACjD,YAAY;AACZ,YAAY,WAAW,CAAC,IAAI,CAAC,YAAY,CAAC;AAC1C,QAAQ;AACR,IAAI,CAAC,CAAC;AACN,IAAI,OAAO,WAAW,CAAC;AACvB,UAAU;AACV,YAAY,KAAK,EAAE,WAAW;AAC9B,YAAY,GAAG,qBAAqB;AACpC;AACA,UAAU,SAAS;AACnB;;;;","x_google_ignoreList":[0]}
@@ -1,24 +0,0 @@
1
- function parseLiteralDef(def, refs) {
2
- const parsedType = typeof def.value;
3
- if (parsedType !== "bigint" &&
4
- parsedType !== "number" &&
5
- parsedType !== "boolean" &&
6
- parsedType !== "string") {
7
- return {
8
- type: Array.isArray(def.value) ? "array" : "object",
9
- };
10
- }
11
- if (refs.target === "openApi3") {
12
- return {
13
- type: parsedType === "bigint" ? "integer" : parsedType,
14
- enum: [def.value],
15
- };
16
- }
17
- return {
18
- type: parsedType === "bigint" ? "integer" : parsedType,
19
- const: def.value,
20
- };
21
- }
22
-
23
- export { parseLiteralDef };
24
- //# sourceMappingURL=literal.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"literal.js","sources":["../../../../../../node_modules/zod-to-json-schema/dist/esm/parsers/literal.js"],"sourcesContent":["export function parseLiteralDef(def, refs) {\n const parsedType = typeof def.value;\n if (parsedType !== \"bigint\" &&\n parsedType !== \"number\" &&\n parsedType !== \"boolean\" &&\n parsedType !== \"string\") {\n return {\n type: Array.isArray(def.value) ? \"array\" : \"object\",\n };\n }\n if (refs.target === \"openApi3\") {\n return {\n type: parsedType === \"bigint\" ? \"integer\" : parsedType,\n enum: [def.value],\n };\n }\n return {\n type: parsedType === \"bigint\" ? \"integer\" : parsedType,\n const: def.value,\n };\n}\n"],"names":[],"mappings":"AAAO,SAAS,eAAe,CAAC,GAAG,EAAE,IAAI,EAAE;AAC3C,IAAI,MAAM,UAAU,GAAG,OAAO,GAAG,CAAC,KAAK;AACvC,IAAI,IAAI,UAAU,KAAK,QAAQ;AAC/B,QAAQ,UAAU,KAAK,QAAQ;AAC/B,QAAQ,UAAU,KAAK,SAAS;AAChC,QAAQ,UAAU,KAAK,QAAQ,EAAE;AACjC,QAAQ,OAAO;AACf,YAAY,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,OAAO,GAAG,QAAQ;AAC/D,SAAS;AACT,IAAI;AACJ,IAAI,IAAI,IAAI,CAAC,MAAM,KAAK,UAAU,EAAE;AACpC,QAAQ,OAAO;AACf,YAAY,IAAI,EAAE,UAAU,KAAK,QAAQ,GAAG,SAAS,GAAG,UAAU;AAClE,YAAY,IAAI,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC;AAC7B,SAAS;AACT,IAAI;AACJ,IAAI,OAAO;AACX,QAAQ,IAAI,EAAE,UAAU,KAAK,QAAQ,GAAG,SAAS,GAAG,UAAU;AAC9D,QAAQ,KAAK,EAAE,GAAG,CAAC,KAAK;AACxB,KAAK;AACL;;;;","x_google_ignoreList":[0]}
@@ -1,30 +0,0 @@
1
- import { parseDef } from '../parseDef.js';
2
- import { parseRecordDef } from './record.js';
3
- import { parseAnyDef } from './any.js';
4
-
5
- function parseMapDef(def, refs) {
6
- if (refs.mapStrategy === "record") {
7
- return parseRecordDef(def, refs);
8
- }
9
- const keys = parseDef(def.keyType._def, {
10
- ...refs,
11
- currentPath: [...refs.currentPath, "items", "items", "0"],
12
- }) || parseAnyDef(refs);
13
- const values = parseDef(def.valueType._def, {
14
- ...refs,
15
- currentPath: [...refs.currentPath, "items", "items", "1"],
16
- }) || parseAnyDef(refs);
17
- return {
18
- type: "array",
19
- maxItems: 125,
20
- items: {
21
- type: "array",
22
- items: [keys, values],
23
- minItems: 2,
24
- maxItems: 2,
25
- },
26
- };
27
- }
28
-
29
- export { parseMapDef };
30
- //# sourceMappingURL=map.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"map.js","sources":["../../../../../../node_modules/zod-to-json-schema/dist/esm/parsers/map.js"],"sourcesContent":["import { parseDef } from \"../parseDef.js\";\nimport { parseRecordDef } from \"./record.js\";\nimport { parseAnyDef } from \"./any.js\";\nexport function parseMapDef(def, refs) {\n if (refs.mapStrategy === \"record\") {\n return parseRecordDef(def, refs);\n }\n const keys = parseDef(def.keyType._def, {\n ...refs,\n currentPath: [...refs.currentPath, \"items\", \"items\", \"0\"],\n }) || parseAnyDef(refs);\n const values = parseDef(def.valueType._def, {\n ...refs,\n currentPath: [...refs.currentPath, \"items\", \"items\", \"1\"],\n }) || parseAnyDef(refs);\n return {\n type: \"array\",\n maxItems: 125,\n items: {\n type: \"array\",\n items: [keys, values],\n minItems: 2,\n maxItems: 2,\n },\n };\n}\n"],"names":[],"mappings":";;;;AAGO,SAAS,WAAW,CAAC,GAAG,EAAE,IAAI,EAAE;AACvC,IAAI,IAAI,IAAI,CAAC,WAAW,KAAK,QAAQ,EAAE;AACvC,QAAQ,OAAO,cAAc,CAAC,GAAG,EAAE,IAAI,CAAC;AACxC,IAAI;AACJ,IAAI,MAAM,IAAI,GAAG,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE;AAC5C,QAAQ,GAAG,IAAI;AACf,QAAQ,WAAW,EAAE,CAAC,GAAG,IAAI,CAAC,WAAW,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,CAAC;AACjE,KAAK,CAAC,IAAI,WAAW,CAAC,IAAI,CAAC;AAC3B,IAAI,MAAM,MAAM,GAAG,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,EAAE;AAChD,QAAQ,GAAG,IAAI;AACf,QAAQ,WAAW,EAAE,CAAC,GAAG,IAAI,CAAC,WAAW,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,CAAC;AACjE,KAAK,CAAC,IAAI,WAAW,CAAC,IAAI,CAAC;AAC3B,IAAI,OAAO;AACX,QAAQ,IAAI,EAAE,OAAO;AACrB,QAAQ,QAAQ,EAAE,GAAG;AACrB,QAAQ,KAAK,EAAE;AACf,YAAY,IAAI,EAAE,OAAO;AACzB,YAAY,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC;AACjC,YAAY,QAAQ,EAAE,CAAC;AACvB,YAAY,QAAQ,EAAE,CAAC;AACvB,SAAS;AACT,KAAK;AACL;;;;","x_google_ignoreList":[0]}
@@ -1,19 +0,0 @@
1
- function parseNativeEnumDef(def) {
2
- const object = def.values;
3
- const actualKeys = Object.keys(def.values).filter((key) => {
4
- return typeof object[object[key]] !== "number";
5
- });
6
- const actualValues = actualKeys.map((key) => object[key]);
7
- const parsedTypes = Array.from(new Set(actualValues.map((values) => typeof values)));
8
- return {
9
- type: parsedTypes.length === 1
10
- ? parsedTypes[0] === "string"
11
- ? "string"
12
- : "number"
13
- : ["string", "number"],
14
- enum: actualValues,
15
- };
16
- }
17
-
18
- export { parseNativeEnumDef };
19
- //# sourceMappingURL=nativeEnum.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"nativeEnum.js","sources":["../../../../../../node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js"],"sourcesContent":["export function parseNativeEnumDef(def) {\n const object = def.values;\n const actualKeys = Object.keys(def.values).filter((key) => {\n return typeof object[object[key]] !== \"number\";\n });\n const actualValues = actualKeys.map((key) => object[key]);\n const parsedTypes = Array.from(new Set(actualValues.map((values) => typeof values)));\n return {\n type: parsedTypes.length === 1\n ? parsedTypes[0] === \"string\"\n ? \"string\"\n : \"number\"\n : [\"string\", \"number\"],\n enum: actualValues,\n };\n}\n"],"names":[],"mappings":"AAAO,SAAS,kBAAkB,CAAC,GAAG,EAAE;AACxC,IAAI,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM;AAC7B,IAAI,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,KAAK;AAC/D,QAAQ,OAAO,OAAO,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,QAAQ;AACtD,IAAI,CAAC,CAAC;AACN,IAAI,MAAM,YAAY,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK,MAAM,CAAC,GAAG,CAAC,CAAC;AAC7D,IAAI,MAAM,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,MAAM,KAAK,OAAO,MAAM,CAAC,CAAC,CAAC;AACxF,IAAI,OAAO;AACX,QAAQ,IAAI,EAAE,WAAW,CAAC,MAAM,KAAK;AACrC,cAAc,WAAW,CAAC,CAAC,CAAC,KAAK;AACjC,kBAAkB;AAClB,kBAAkB;AAClB,cAAc,CAAC,QAAQ,EAAE,QAAQ,CAAC;AAClC,QAAQ,IAAI,EAAE,YAAY;AAC1B,KAAK;AACL;;;;","x_google_ignoreList":[0]}
@@ -1,15 +0,0 @@
1
- import { parseAnyDef } from './any.js';
2
-
3
- function parseNeverDef(refs) {
4
- return refs.target === "openAi"
5
- ? undefined
6
- : {
7
- not: parseAnyDef({
8
- ...refs,
9
- currentPath: [...refs.currentPath, "not"],
10
- }),
11
- };
12
- }
13
-
14
- export { parseNeverDef };
15
- //# sourceMappingURL=never.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"never.js","sources":["../../../../../../node_modules/zod-to-json-schema/dist/esm/parsers/never.js"],"sourcesContent":["import { parseAnyDef } from \"./any.js\";\nexport function parseNeverDef(refs) {\n return refs.target === \"openAi\"\n ? undefined\n : {\n not: parseAnyDef({\n ...refs,\n currentPath: [...refs.currentPath, \"not\"],\n }),\n };\n}\n"],"names":[],"mappings":";;AACO,SAAS,aAAa,CAAC,IAAI,EAAE;AACpC,IAAI,OAAO,IAAI,CAAC,MAAM,KAAK;AAC3B,UAAU;AACV,UAAU;AACV,YAAY,GAAG,EAAE,WAAW,CAAC;AAC7B,gBAAgB,GAAG,IAAI;AACvB,gBAAgB,WAAW,EAAE,CAAC,GAAG,IAAI,CAAC,WAAW,EAAE,KAAK,CAAC;AACzD,aAAa,CAAC;AACd,SAAS;AACT;;;;","x_google_ignoreList":[0]}
@@ -1,13 +0,0 @@
1
- function parseNullDef(refs) {
2
- return refs.target === "openApi3"
3
- ? {
4
- enum: ["null"],
5
- nullable: true,
6
- }
7
- : {
8
- type: "null",
9
- };
10
- }
11
-
12
- export { parseNullDef };
13
- //# sourceMappingURL=null.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"null.js","sources":["../../../../../../node_modules/zod-to-json-schema/dist/esm/parsers/null.js"],"sourcesContent":["export function parseNullDef(refs) {\n return refs.target === \"openApi3\"\n ? {\n enum: [\"null\"],\n nullable: true,\n }\n : {\n type: \"null\",\n };\n}\n"],"names":[],"mappings":"AAAO,SAAS,YAAY,CAAC,IAAI,EAAE;AACnC,IAAI,OAAO,IAAI,CAAC,MAAM,KAAK;AAC3B,UAAU;AACV,YAAY,IAAI,EAAE,CAAC,MAAM,CAAC;AAC1B,YAAY,QAAQ,EAAE,IAAI;AAC1B;AACA,UAAU;AACV,YAAY,IAAI,EAAE,MAAM;AACxB,SAAS;AACT;;;;","x_google_ignoreList":[0]}
@@ -1,37 +0,0 @@
1
- import { parseDef } from '../parseDef.js';
2
- import { primitiveMappings } from './union.js';
3
-
4
- function parseNullableDef(def, refs) {
5
- if (["ZodString", "ZodNumber", "ZodBigInt", "ZodBoolean", "ZodNull"].includes(def.innerType._def.typeName) &&
6
- (!def.innerType._def.checks || !def.innerType._def.checks.length)) {
7
- if (refs.target === "openApi3") {
8
- return {
9
- type: primitiveMappings[def.innerType._def.typeName],
10
- nullable: true,
11
- };
12
- }
13
- return {
14
- type: [
15
- primitiveMappings[def.innerType._def.typeName],
16
- "null",
17
- ],
18
- };
19
- }
20
- if (refs.target === "openApi3") {
21
- const base = parseDef(def.innerType._def, {
22
- ...refs,
23
- currentPath: [...refs.currentPath],
24
- });
25
- if (base && "$ref" in base)
26
- return { allOf: [base], nullable: true };
27
- return base && { ...base, nullable: true };
28
- }
29
- const base = parseDef(def.innerType._def, {
30
- ...refs,
31
- currentPath: [...refs.currentPath, "anyOf", "0"],
32
- });
33
- return base && { anyOf: [base, { type: "null" }] };
34
- }
35
-
36
- export { parseNullableDef };
37
- //# sourceMappingURL=nullable.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"nullable.js","sources":["../../../../../../node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js"],"sourcesContent":["import { parseDef } from \"../parseDef.js\";\nimport { primitiveMappings } from \"./union.js\";\nexport function parseNullableDef(def, refs) {\n if ([\"ZodString\", \"ZodNumber\", \"ZodBigInt\", \"ZodBoolean\", \"ZodNull\"].includes(def.innerType._def.typeName) &&\n (!def.innerType._def.checks || !def.innerType._def.checks.length)) {\n if (refs.target === \"openApi3\") {\n return {\n type: primitiveMappings[def.innerType._def.typeName],\n nullable: true,\n };\n }\n return {\n type: [\n primitiveMappings[def.innerType._def.typeName],\n \"null\",\n ],\n };\n }\n if (refs.target === \"openApi3\") {\n const base = parseDef(def.innerType._def, {\n ...refs,\n currentPath: [...refs.currentPath],\n });\n if (base && \"$ref\" in base)\n return { allOf: [base], nullable: true };\n return base && { ...base, nullable: true };\n }\n const base = parseDef(def.innerType._def, {\n ...refs,\n currentPath: [...refs.currentPath, \"anyOf\", \"0\"],\n });\n return base && { anyOf: [base, { type: \"null\" }] };\n}\n"],"names":[],"mappings":";;;AAEO,SAAS,gB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AC,GAAG,CAAC,SAAS,CAAC,IAAI,EAAE;AAC9C,QAAQ,GAAG,IAAI;AACf,QAAQ,WAAW,EAAE,CAAC,GAAG,IAAI,CAAC,WAAW,EAAE,OAAO,EAAE,GAAG,CAAC;AACxD,KAAK,CAAC;AACN,IAAI,OAAO,IAAI,IAAI,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE;AACtD;;;;","x_google_ignoreList":[0]}
@@ -1,56 +0,0 @@
1
- import { setResponseValueAndErrors, addErrorMessage } from '../errorMessages.js';
2
-
3
- function parseNumberDef(def, refs) {
4
- const res = {
5
- type: "number",
6
- };
7
- if (!def.checks)
8
- return res;
9
- for (const check of def.checks) {
10
- switch (check.kind) {
11
- case "int":
12
- res.type = "integer";
13
- addErrorMessage(res, "type", check.message, refs);
14
- break;
15
- case "min":
16
- if (refs.target === "jsonSchema7") {
17
- if (check.inclusive) {
18
- setResponseValueAndErrors(res, "minimum", check.value, check.message, refs);
19
- }
20
- else {
21
- setResponseValueAndErrors(res, "exclusiveMinimum", check.value, check.message, refs);
22
- }
23
- }
24
- else {
25
- if (!check.inclusive) {
26
- res.exclusiveMinimum = true;
27
- }
28
- setResponseValueAndErrors(res, "minimum", check.value, check.message, refs);
29
- }
30
- break;
31
- case "max":
32
- if (refs.target === "jsonSchema7") {
33
- if (check.inclusive) {
34
- setResponseValueAndErrors(res, "maximum", check.value, check.message, refs);
35
- }
36
- else {
37
- setResponseValueAndErrors(res, "exclusiveMaximum", check.value, check.message, refs);
38
- }
39
- }
40
- else {
41
- if (!check.inclusive) {
42
- res.exclusiveMaximum = true;
43
- }
44
- setResponseValueAndErrors(res, "maximum", check.value, check.message, refs);
45
- }
46
- break;
47
- case "multipleOf":
48
- setResponseValueAndErrors(res, "multipleOf", check.value, check.message, refs);
49
- break;
50
- }
51
- }
52
- return res;
53
- }
54
-
55
- export { parseNumberDef };
56
- //# sourceMappingURL=number.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"number.js","sources":["../../../../../../node_modules/zod-to-json-schema/dist/esm/parsers/number.js"],"sourcesContent":["import { addErrorMessage, setResponseValueAndErrors, } from \"../errorMessages.js\";\nexport function parseNumberDef(def, refs) {\n const res = {\n type: \"number\",\n };\n if (!def.checks)\n return res;\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(res, \"minimum\", check.value, check.message, refs);\n }\n else {\n setResponseValueAndErrors(res, \"exclusiveMinimum\", check.value, check.message, refs);\n }\n }\n else {\n if (!check.inclusive) {\n res.exclusiveMinimum = true;\n }\n setResponseValueAndErrors(res, \"minimum\", check.value, check.message, refs);\n }\n break;\n case \"max\":\n if (refs.target === \"jsonSchema7\") {\n if (check.inclusive) {\n setResponseValueAndErrors(res, \"maximum\", check.value, check.message, refs);\n }\n else {\n setResponseValueAndErrors(res, \"exclusiveMaximum\", check.value, check.message, refs);\n }\n }\n else {\n if (!check.inclusive) {\n res.exclusiveMaximum = true;\n }\n setResponseValueAndErrors(res, \"maximum\", check.value, check.message, refs);\n }\n break;\n case \"multipleOf\":\n setResponseValueAndErrors(res, \"multipleOf\", check.value, check.message, refs);\n break;\n }\n }\n return res;\n}\n"],"names":[],"mappings":";;AACO,SAAS,cAAc,CAAC,GAAG,EAAE,IAAI,EAAE;AAC1C,IAAI,MAAM,GAAG,GAAG;AAChB,QAAQ,IAAI,EAAE,QAAQ;AACtB,KAAK;AACL,IAAI,IAAI,CAAC,GAAG,CAAC,MAAM;AACnB,QAAQ,OAAO,GAAG;AAClB,IAAI,KAAK,MAAM,KAAK,IAAI,GAAG,CAAC,MAAM,EAAE;AACpC,QAAQ,QAAQ,KAAK,CAAC,IAAI;AAC1B,YAAY,KAAK,KAAK;AACtB,gBAAgB,GAAG,CAAC,IAAI,GAAG,SAAS;AACp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C,KAAK,CAAC,SAAS,EAAE;AAC1C,wBAAwB,GAAG,CAAC,gBAAgB,GAAG,IAAI;AACnD,oBAAoB;AACpB,oBAAoB,yBAAyB,CAAC,GAAG,EAAE,SAAS,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC;AAC/F,gBAAgB;AAChB,gBAAgB;AAChB,YAAY,KAAK,YAAY;AAC7B,gBAAgB,yBAAyB,CAAC,GAAG,EAAE,YAAY,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC;AAC9F,gBAAgB;AAChB;AACA,IAAI;AACJ,IAAI,OAAO,GAAG;AACd;;;;","x_google_ignoreList":[0]}
@@ -1,76 +0,0 @@
1
- import { parseDef } from '../parseDef.js';
2
-
3
- function parseObjectDef(def, refs) {
4
- const forceOptionalIntoNullable = refs.target === "openAi";
5
- const result = {
6
- type: "object",
7
- properties: {},
8
- };
9
- const required = [];
10
- const shape = def.shape();
11
- for (const propName in shape) {
12
- let propDef = shape[propName];
13
- if (propDef === undefined || propDef._def === undefined) {
14
- continue;
15
- }
16
- let propOptional = safeIsOptional(propDef);
17
- if (propOptional && forceOptionalIntoNullable) {
18
- if (propDef._def.typeName === "ZodOptional") {
19
- propDef = propDef._def.innerType;
20
- }
21
- if (!propDef.isNullable()) {
22
- propDef = propDef.nullable();
23
- }
24
- propOptional = false;
25
- }
26
- const parsedDef = parseDef(propDef._def, {
27
- ...refs,
28
- currentPath: [...refs.currentPath, "properties", propName],
29
- propertyPath: [...refs.currentPath, "properties", propName],
30
- });
31
- if (parsedDef === undefined) {
32
- continue;
33
- }
34
- result.properties[propName] = parsedDef;
35
- if (!propOptional) {
36
- required.push(propName);
37
- }
38
- }
39
- if (required.length) {
40
- result.required = required;
41
- }
42
- const additionalProperties = decideAdditionalProperties(def, refs);
43
- if (additionalProperties !== undefined) {
44
- result.additionalProperties = additionalProperties;
45
- }
46
- return result;
47
- }
48
- function decideAdditionalProperties(def, refs) {
49
- if (def.catchall._def.typeName !== "ZodNever") {
50
- return parseDef(def.catchall._def, {
51
- ...refs,
52
- currentPath: [...refs.currentPath, "additionalProperties"],
53
- });
54
- }
55
- switch (def.unknownKeys) {
56
- case "passthrough":
57
- return refs.allowedAdditionalProperties;
58
- case "strict":
59
- return refs.rejectedAdditionalProperties;
60
- case "strip":
61
- return refs.removeAdditionalStrategy === "strict"
62
- ? refs.allowedAdditionalProperties
63
- : refs.rejectedAdditionalProperties;
64
- }
65
- }
66
- function safeIsOptional(schema) {
67
- try {
68
- return schema.isOptional();
69
- }
70
- catch {
71
- return true;
72
- }
73
- }
74
-
75
- export { parseObjectDef };
76
- //# sourceMappingURL=object.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"object.js","sources":["../../../../../../node_modules/zod-to-json-schema/dist/esm/parsers/object.js"],"sourcesContent":["import { parseDef } from \"../parseDef.js\";\nexport function parseObjectDef(def, refs) {\n const forceOptionalIntoNullable = refs.target === \"openAi\";\n const result = {\n type: \"object\",\n properties: {},\n };\n const required = [];\n const shape = def.shape();\n for (const propName in shape) {\n let propDef = shape[propName];\n if (propDef === undefined || propDef._def === undefined) {\n continue;\n }\n let propOptional = safeIsOptional(propDef);\n if (propOptional && forceOptionalIntoNullable) {\n if (propDef._def.typeName === \"ZodOptional\") {\n propDef = propDef._def.innerType;\n }\n if (!propDef.isNullable()) {\n propDef = propDef.nullable();\n }\n propOptional = false;\n }\n const parsedDef = parseDef(propDef._def, {\n ...refs,\n currentPath: [...refs.currentPath, \"properties\", propName],\n propertyPath: [...refs.currentPath, \"properties\", propName],\n });\n if (parsedDef === undefined) {\n continue;\n }\n result.properties[propName] = parsedDef;\n if (!propOptional) {\n required.push(propName);\n }\n }\n if (required.length) {\n result.required = required;\n }\n const additionalProperties = decideAdditionalProperties(def, refs);\n if (additionalProperties !== undefined) {\n result.additionalProperties = additionalProperties;\n }\n return result;\n}\nfunction decideAdditionalProperties(def, refs) {\n if (def.catchall._def.typeName !== \"ZodNever\") {\n return parseDef(def.catchall._def, {\n ...refs,\n currentPath: [...refs.currentPath, \"additionalProperties\"],\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}\nfunction safeIsOptional(schema) {\n try {\n return schema.isOptional();\n }\n catch {\n return true;\n }\n}\n"],"names":[],"mappings":";;AACO,SAAS,cAAc,CAAC,GAAG,EAAE,IAAI,EAAE;AAC1C,IAAI,MAAM,yBAAyB,GAAG,IAAI,CAAC,MAAM,KAAK,QAAQ;AAC9D,IAAI,MAAM,MAAM,GAAG;AACnB,QAAQ,IAAI,EAAE,QAAQ;AACtB,QAAQ,UAAU,EAAE,EAAE;AACtB,KAAK;AACL,IAAI,MAAM,QAAQ,GAAG,EAAE;AACvB,IAAI,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,EAAE;AAC7B,IAAI,KAAK,MAAM,QAAQ,IAAI,KAAK,EAAE;AAClC,QAAQ,IAAI,OAAO,GAAG,KAAK,CAAC,QAAQ,CAAC;AACrC,QAAQ,IAAI,OAAO,KAAK,SAAS,IAAI,OAAO,CAAC,IAAI,KAAK,SAAS,EAAE;AACjE,YAAY;AACZ,QAAQ;AACR,QAAQ,IAAI,YAAY,GAAG,cAAc,CAAC,OAAO,CAAC;AAClD,QAAQ,IAAI,YAAY,IAAI,yBAAyB,EAAE;AACvD,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ,KAAK,aAAa,EAAE;AACzD,gBAAgB,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,SAAS;AAChD,YAAY;AACZ,YAAY,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE;AACvC,gBAAgB,OAAO,GAAG,OAAO,CAAC,QAAQ,EAAE;AAC5C,YAAY;AACZ,Y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AW;AAC3B,QAAQ,KAAK,aAAa;AAC1B,YAAY,OAAO,IAAI,CAAC,2BAA2B;AACnD,QAAQ,KAAK,QAAQ;AACrB,YAAY,OAAO,IAAI,CAAC,4BAA4B;AACpD,QAAQ,KAAK,OAAO;AACpB,YAAY,OAAO,IAAI,CAAC,wBAAwB,KAAK;AACrD,kBAAkB,IAAI,CAAC;AACvB,kBAAkB,IAAI,CAAC,4BAA4B;AACnD;AACA;AACA,SAAS,cAAc,CAAC,MAAM,EAAE;AAChC,IAAI,IAAI;AACR,QAAQ,OAAO,MAAM,CAAC,UAAU,EAAE;AAClC,IAAI;AACJ,IAAI,MAAM;AACV,QAAQ,OAAO,IAAI;AACnB,IAAI;AACJ;;;;","x_google_ignoreList":[0]}
@@ -1,25 +0,0 @@
1
- import { parseDef } from '../parseDef.js';
2
- import { parseAnyDef } from './any.js';
3
-
4
- const parseOptionalDef = (def, refs) => {
5
- if (refs.currentPath.toString() === refs.propertyPath?.toString()) {
6
- return parseDef(def.innerType._def, refs);
7
- }
8
- const innerSchema = parseDef(def.innerType._def, {
9
- ...refs,
10
- currentPath: [...refs.currentPath, "anyOf", "1"],
11
- });
12
- return innerSchema
13
- ? {
14
- anyOf: [
15
- {
16
- not: parseAnyDef(refs),
17
- },
18
- innerSchema,
19
- ],
20
- }
21
- : parseAnyDef(refs);
22
- };
23
-
24
- export { parseOptionalDef };
25
- //# sourceMappingURL=optional.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"optional.js","sources":["../../../../../../node_modules/zod-to-json-schema/dist/esm/parsers/optional.js"],"sourcesContent":["import { parseDef } from \"../parseDef.js\";\nimport { parseAnyDef } from \"./any.js\";\nexport const parseOptionalDef = (def, refs) => {\n if (refs.currentPath.toString() === refs.propertyPath?.toString()) {\n return parseDef(def.innerType._def, refs);\n }\n const innerSchema = parseDef(def.innerType._def, {\n ...refs,\n currentPath: [...refs.currentPath, \"anyOf\", \"1\"],\n });\n return innerSchema\n ? {\n anyOf: [\n {\n not: parseAnyDef(refs),\n },\n innerSchema,\n ],\n }\n : parseAnyDef(refs);\n};\n"],"names":[],"mappings":";;;AAEY,MAAC,gBAAgB,GAAG,CAAC,GAAG,EAAE,IAAI,KAAK;AAC/C,IAAI,IAAI,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,KAAK,IAAI,CAAC,YAAY,EAAE,QAAQ,EAAE,EAAE;AACvE,QAAQ,OAAO,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC;AACjD,IAAI;AACJ,IAAI,MAAM,WAAW,GAAG,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,EAAE;AACrD,QAAQ,GAAG,IAAI;AACf,QAAQ,WAAW,EAAE,CAAC,GAAG,IAAI,CAAC,WAAW,EAAE,OAAO,EAAE,GAAG,CAAC;AACxD,KAAK,CAAC;AACN,IAAI,OAAO;AACX,UAAU;AACV,YAAY,KAAK,EAAE;AACnB,gBAAgB;AAChB,oBAAoB,GAAG,EAAE,WAAW,CAAC,IAAI,CAAC;AAC1C,iBAAiB;AACjB,gBAAgB,WAAW;AAC3B,aAAa;AACb;AACA,UAAU,WAAW,CAAC,IAAI,CAAC;AAC3B;;;;","x_google_ignoreList":[0]}
@@ -1,24 +0,0 @@
1
- import { parseDef } from '../parseDef.js';
2
-
3
- const parsePipelineDef = (def, refs) => {
4
- if (refs.pipeStrategy === "input") {
5
- return parseDef(def.in._def, refs);
6
- }
7
- else if (refs.pipeStrategy === "output") {
8
- return parseDef(def.out._def, refs);
9
- }
10
- const a = parseDef(def.in._def, {
11
- ...refs,
12
- currentPath: [...refs.currentPath, "allOf", "0"],
13
- });
14
- const b = parseDef(def.out._def, {
15
- ...refs,
16
- currentPath: [...refs.currentPath, "allOf", a ? "1" : "0"],
17
- });
18
- return {
19
- allOf: [a, b].filter((x) => x !== undefined),
20
- };
21
- };
22
-
23
- export { parsePipelineDef };
24
- //# sourceMappingURL=pipeline.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pipeline.js","sources":["../../../../../../node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js"],"sourcesContent":["import { parseDef } from \"../parseDef.js\";\nexport const parsePipelineDef = (def, refs) => {\n if (refs.pipeStrategy === \"input\") {\n return parseDef(def.in._def, refs);\n }\n else if (refs.pipeStrategy === \"output\") {\n return parseDef(def.out._def, refs);\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 return {\n allOf: [a, b].filter((x) => x !== undefined),\n };\n};\n"],"names":[],"mappings":";;AACY,MAAC,gBAAgB,GAAG,CAAC,GAAG,EAAE,IAAI,KAAK;AAC/C,IAAI,IAAI,IAAI,CAAC,YAAY,KAAK,OAAO,EAAE;AACvC,QAAQ,OAAO,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC;AAC1C,IAAI;AACJ,SAAS,IAAI,IAAI,CAAC,YAAY,KAAK,QAAQ,EAAE;AAC7C,QAAQ,OAAO,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC;AAC3C,IAAI;AACJ,IAAI,MAAM,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE;AACpC,QAAQ,GAAG,IAAI;AACf,QAAQ,WAAW,EAAE,CAAC,GAAG,IAAI,CAAC,WAAW,EAAE,OAAO,EAAE,GAAG,CAAC;AACxD,KAAK,CAAC;AACN,IAAI,MAAM,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE;AACrC,QAAQ,GAAG,IAAI;AACf,QAAQ,WAAW,EAAE,CAAC,GAAG,IAAI,CAAC,WAAW,EAAE,OAAO,EAAE,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC;AAClE,KAAK,CAAC;AACN,IAAI,OAAO;AACX,QAAQ,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,SAAS,CAAC;AACpD,KAAK;AACL;;;;","x_google_ignoreList":[0]}
@@ -1,8 +0,0 @@
1
- import { parseDef } from '../parseDef.js';
2
-
3
- function parsePromiseDef(def, refs) {
4
- return parseDef(def.type._def, refs);
5
- }
6
-
7
- export { parsePromiseDef };
8
- //# sourceMappingURL=promise.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"promise.js","sources":["../../../../../../node_modules/zod-to-json-schema/dist/esm/parsers/promise.js"],"sourcesContent":["import { parseDef } from \"../parseDef.js\";\nexport function parsePromiseDef(def, refs) {\n return parseDef(def.type._def, refs);\n}\n"],"names":[],"mappings":";;AACO,SAAS,eAAe,CAAC,GAAG,EAAE,IAAI,EAAE;AAC3C,IAAI,OAAO,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC;AACxC;;;;","x_google_ignoreList":[0]}
@@ -1,8 +0,0 @@
1
- import { parseDef } from '../parseDef.js';
2
-
3
- const parseReadonlyDef = (def, refs) => {
4
- return parseDef(def.innerType._def, refs);
5
- };
6
-
7
- export { parseReadonlyDef };
8
- //# sourceMappingURL=readonly.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"readonly.js","sources":["../../../../../../node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js"],"sourcesContent":["import { parseDef } from \"../parseDef.js\";\nexport const parseReadonlyDef = (def, refs) => {\n return parseDef(def.innerType._def, refs);\n};\n"],"names":[],"mappings":";;AACY,MAAC,gBAAgB,GAAG,CAAC,GAAG,EAAE,IAAI,KAAK;AAC/C,IAAI,OAAO,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC;AAC7C;;;;","x_google_ignoreList":[0]}
@@ -1,65 +0,0 @@
1
- import { ZodFirstPartyTypeKind } from 'zod';
2
- import { parseDef } from '../parseDef.js';
3
- import { parseStringDef } from './string.js';
4
- import { parseBrandedDef } from './branded.js';
5
- import { parseAnyDef } from './any.js';
6
-
7
- function parseRecordDef(def, refs) {
8
- if (refs.target === "openAi") {
9
- console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead.");
10
- }
11
- if (refs.target === "openApi3" &&
12
- def.keyType?._def.typeName === ZodFirstPartyTypeKind.ZodEnum) {
13
- return {
14
- type: "object",
15
- required: def.keyType._def.values,
16
- properties: def.keyType._def.values.reduce((acc, key) => ({
17
- ...acc,
18
- [key]: parseDef(def.valueType._def, {
19
- ...refs,
20
- currentPath: [...refs.currentPath, "properties", key],
21
- }) ?? parseAnyDef(refs),
22
- }), {}),
23
- additionalProperties: refs.rejectedAdditionalProperties,
24
- };
25
- }
26
- const schema = {
27
- type: "object",
28
- additionalProperties: parseDef(def.valueType._def, {
29
- ...refs,
30
- currentPath: [...refs.currentPath, "additionalProperties"],
31
- }) ?? refs.allowedAdditionalProperties,
32
- };
33
- if (refs.target === "openApi3") {
34
- return schema;
35
- }
36
- if (def.keyType?._def.typeName === ZodFirstPartyTypeKind.ZodString &&
37
- def.keyType._def.checks?.length) {
38
- const { type, ...keyType } = parseStringDef(def.keyType._def, refs);
39
- return {
40
- ...schema,
41
- propertyNames: keyType,
42
- };
43
- }
44
- else if (def.keyType?._def.typeName === ZodFirstPartyTypeKind.ZodEnum) {
45
- return {
46
- ...schema,
47
- propertyNames: {
48
- enum: def.keyType._def.values,
49
- },
50
- };
51
- }
52
- else if (def.keyType?._def.typeName === ZodFirstPartyTypeKind.ZodBranded &&
53
- def.keyType._def.type._def.typeName === ZodFirstPartyTypeKind.ZodString &&
54
- def.keyType._def.type._def.checks?.length) {
55
- const { type, ...keyType } = parseBrandedDef(def.keyType._def, refs);
56
- return {
57
- ...schema,
58
- propertyNames: keyType,
59
- };
60
- }
61
- return schema;
62
- }
63
-
64
- export { parseRecordDef };
65
- //# sourceMappingURL=record.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"record.js","sources":["../../../../../../node_modules/zod-to-json-schema/dist/esm/parsers/record.js"],"sourcesContent":["import { ZodFirstPartyTypeKind, } from \"zod\";\nimport { parseDef } from \"../parseDef.js\";\nimport { parseStringDef } from \"./string.js\";\nimport { parseBrandedDef } from \"./branded.js\";\nimport { parseAnyDef } from \"./any.js\";\nexport function parseRecordDef(def, refs) {\n if (refs.target === \"openAi\") {\n console.warn(\"Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead.\");\n }\n if (refs.target === \"openApi3\" &&\n def.keyType?._def.typeName === ZodFirstPartyTypeKind.ZodEnum) {\n return {\n type: \"object\",\n required: def.keyType._def.values,\n properties: def.keyType._def.values.reduce((acc, key) => ({\n ...acc,\n [key]: parseDef(def.valueType._def, {\n ...refs,\n currentPath: [...refs.currentPath, \"properties\", key],\n }) ?? parseAnyDef(refs),\n }), {}),\n additionalProperties: refs.rejectedAdditionalProperties,\n };\n }\n const schema = {\n type: \"object\",\n additionalProperties: parseDef(def.valueType._def, {\n ...refs,\n currentPath: [...refs.currentPath, \"additionalProperties\"],\n }) ?? refs.allowedAdditionalProperties,\n };\n if (refs.target === \"openApi3\") {\n return schema;\n }\n if (def.keyType?._def.typeName === ZodFirstPartyTypeKind.ZodString &&\n def.keyType._def.checks?.length) {\n const { type, ...keyType } = parseStringDef(def.keyType._def, refs);\n return {\n ...schema,\n propertyNames: keyType,\n };\n }\n else if (def.keyType?._def.typeName === ZodFirstPartyTypeKind.ZodEnum) {\n return {\n ...schema,\n propertyNames: {\n enum: def.keyType._def.values,\n },\n };\n }\n else if (def.keyType?._def.typeName === ZodFirstPartyTypeKind.ZodBranded &&\n def.keyType._def.type._def.typeName === ZodFirstPartyTypeKind.ZodString &&\n def.keyType._def.type._def.checks?.length) {\n const { type, ...keyType } = parseBrandedDef(def.keyType._def, refs);\n return {\n ...schema,\n propertyNames: keyType,\n };\n }\n return schema;\n}\n"],"names":[],"mappings":";;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AI;AACJ,IAAI,OAAO,MAAM;AACjB;;;;","x_google_ignoreList":[0]}
@@ -1,24 +0,0 @@
1
- import { setResponseValueAndErrors } from '../errorMessages.js';
2
- import { parseDef } from '../parseDef.js';
3
-
4
- function parseSetDef(def, refs) {
5
- const items = parseDef(def.valueType._def, {
6
- ...refs,
7
- currentPath: [...refs.currentPath, "items"],
8
- });
9
- const schema = {
10
- type: "array",
11
- uniqueItems: true,
12
- items,
13
- };
14
- if (def.minSize) {
15
- setResponseValueAndErrors(schema, "minItems", def.minSize.value, def.minSize.message, refs);
16
- }
17
- if (def.maxSize) {
18
- setResponseValueAndErrors(schema, "maxItems", def.maxSize.value, def.maxSize.message, refs);
19
- }
20
- return schema;
21
- }
22
-
23
- export { parseSetDef };
24
- //# sourceMappingURL=set.js.map