@onlive.ai/flow-client 0.0.3 → 0.1.31

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.
@@ -0,0 +1,1504 @@
1
+ "use strict";
2
+
3
+ // schema-generator.ts
4
+ var import_fs = require("fs");
5
+
6
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.4/node_modules/zod-to-json-schema/dist/esm/Options.js
7
+ var ignoreOverride = Symbol("Let zodToJsonSchema decide on which parser to use");
8
+ var defaultOptions = {
9
+ name: void 0,
10
+ $refStrategy: "root",
11
+ basePath: ["#"],
12
+ effectStrategy: "input",
13
+ pipeStrategy: "all",
14
+ dateStrategy: "format:date-time",
15
+ mapStrategy: "entries",
16
+ removeAdditionalStrategy: "passthrough",
17
+ allowedAdditionalProperties: true,
18
+ rejectedAdditionalProperties: false,
19
+ definitionPath: "definitions",
20
+ target: "jsonSchema7",
21
+ strictUnions: false,
22
+ definitions: {},
23
+ errorMessages: false,
24
+ markdownDescription: false,
25
+ patternStrategy: "escape",
26
+ applyRegexFlags: false,
27
+ emailStrategy: "format:email",
28
+ base64Strategy: "contentEncoding:base64",
29
+ nameStrategy: "ref"
30
+ };
31
+ var getDefaultOptions = (options) => typeof options === "string" ? {
32
+ ...defaultOptions,
33
+ name: options
34
+ } : {
35
+ ...defaultOptions,
36
+ ...options
37
+ };
38
+
39
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.4/node_modules/zod-to-json-schema/dist/esm/Refs.js
40
+ var getRefs = (options) => {
41
+ const _options = getDefaultOptions(options);
42
+ const currentPath = _options.name !== void 0 ? [..._options.basePath, _options.definitionPath, _options.name] : _options.basePath;
43
+ return {
44
+ ..._options,
45
+ currentPath,
46
+ propertyPath: void 0,
47
+ seen: new Map(Object.entries(_options.definitions).map(([name, def]) => [
48
+ def._def,
49
+ {
50
+ def: def._def,
51
+ path: [..._options.basePath, _options.definitionPath, name],
52
+ // Resolution of references will be forced even though seen, so it's ok that the schema is undefined here for now.
53
+ jsonSchema: void 0
54
+ }
55
+ ]))
56
+ };
57
+ };
58
+
59
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.4/node_modules/zod-to-json-schema/dist/esm/errorMessages.js
60
+ function addErrorMessage(res, key, errorMessage, refs) {
61
+ if (!refs?.errorMessages)
62
+ return;
63
+ if (errorMessage) {
64
+ res.errorMessage = {
65
+ ...res.errorMessage,
66
+ [key]: errorMessage
67
+ };
68
+ }
69
+ }
70
+ function setResponseValueAndErrors(res, key, value, errorMessage, refs) {
71
+ res[key] = value;
72
+ addErrorMessage(res, key, errorMessage, refs);
73
+ }
74
+
75
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.4/node_modules/zod-to-json-schema/dist/esm/selectParser.js
76
+ var import_zod4 = require("zod");
77
+
78
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.4/node_modules/zod-to-json-schema/dist/esm/parsers/any.js
79
+ function parseAnyDef() {
80
+ return {};
81
+ }
82
+
83
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.4/node_modules/zod-to-json-schema/dist/esm/parsers/array.js
84
+ var import_zod = require("zod");
85
+ function parseArrayDef(def, refs) {
86
+ const res = {
87
+ type: "array"
88
+ };
89
+ if (def.type?._def && def.type?._def?.typeName !== import_zod.ZodFirstPartyTypeKind.ZodAny) {
90
+ res.items = parseDef(def.type._def, {
91
+ ...refs,
92
+ currentPath: [...refs.currentPath, "items"]
93
+ });
94
+ }
95
+ if (def.minLength) {
96
+ setResponseValueAndErrors(res, "minItems", def.minLength.value, def.minLength.message, refs);
97
+ }
98
+ if (def.maxLength) {
99
+ setResponseValueAndErrors(res, "maxItems", def.maxLength.value, def.maxLength.message, refs);
100
+ }
101
+ if (def.exactLength) {
102
+ setResponseValueAndErrors(res, "minItems", def.exactLength.value, def.exactLength.message, refs);
103
+ setResponseValueAndErrors(res, "maxItems", def.exactLength.value, def.exactLength.message, refs);
104
+ }
105
+ return res;
106
+ }
107
+
108
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.4/node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js
109
+ function parseBigintDef(def, refs) {
110
+ const res = {
111
+ type: "integer",
112
+ format: "int64"
113
+ };
114
+ if (!def.checks)
115
+ return res;
116
+ for (const check of def.checks) {
117
+ switch (check.kind) {
118
+ case "min":
119
+ if (refs.target === "jsonSchema7") {
120
+ if (check.inclusive) {
121
+ setResponseValueAndErrors(res, "minimum", check.value, check.message, refs);
122
+ } else {
123
+ setResponseValueAndErrors(res, "exclusiveMinimum", check.value, check.message, refs);
124
+ }
125
+ } else {
126
+ if (!check.inclusive) {
127
+ res.exclusiveMinimum = true;
128
+ }
129
+ setResponseValueAndErrors(res, "minimum", check.value, check.message, refs);
130
+ }
131
+ break;
132
+ case "max":
133
+ if (refs.target === "jsonSchema7") {
134
+ if (check.inclusive) {
135
+ setResponseValueAndErrors(res, "maximum", check.value, check.message, refs);
136
+ } else {
137
+ setResponseValueAndErrors(res, "exclusiveMaximum", check.value, check.message, refs);
138
+ }
139
+ } else {
140
+ if (!check.inclusive) {
141
+ res.exclusiveMaximum = true;
142
+ }
143
+ setResponseValueAndErrors(res, "maximum", check.value, check.message, refs);
144
+ }
145
+ break;
146
+ case "multipleOf":
147
+ setResponseValueAndErrors(res, "multipleOf", check.value, check.message, refs);
148
+ break;
149
+ }
150
+ }
151
+ return res;
152
+ }
153
+
154
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.4/node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js
155
+ function parseBooleanDef() {
156
+ return {
157
+ type: "boolean"
158
+ };
159
+ }
160
+
161
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.4/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js
162
+ function parseBrandedDef(_def, refs) {
163
+ return parseDef(_def.type._def, refs);
164
+ }
165
+
166
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.4/node_modules/zod-to-json-schema/dist/esm/parsers/catch.js
167
+ var parseCatchDef = (def, refs) => {
168
+ return parseDef(def.innerType._def, refs);
169
+ };
170
+
171
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.4/node_modules/zod-to-json-schema/dist/esm/parsers/date.js
172
+ function parseDateDef(def, refs, overrideDateStrategy) {
173
+ const strategy = overrideDateStrategy ?? refs.dateStrategy;
174
+ if (Array.isArray(strategy)) {
175
+ return {
176
+ anyOf: strategy.map((item, i) => parseDateDef(def, refs, item))
177
+ };
178
+ }
179
+ switch (strategy) {
180
+ case "string":
181
+ case "format:date-time":
182
+ return {
183
+ type: "string",
184
+ format: "date-time"
185
+ };
186
+ case "format:date":
187
+ return {
188
+ type: "string",
189
+ format: "date"
190
+ };
191
+ case "integer":
192
+ return integerDateParser(def, refs);
193
+ }
194
+ }
195
+ var integerDateParser = (def, refs) => {
196
+ const res = {
197
+ type: "integer",
198
+ format: "unix-time"
199
+ };
200
+ if (refs.target === "openApi3") {
201
+ return res;
202
+ }
203
+ for (const check of def.checks) {
204
+ switch (check.kind) {
205
+ case "min":
206
+ setResponseValueAndErrors(
207
+ res,
208
+ "minimum",
209
+ check.value,
210
+ // This is in milliseconds
211
+ check.message,
212
+ refs
213
+ );
214
+ break;
215
+ case "max":
216
+ setResponseValueAndErrors(
217
+ res,
218
+ "maximum",
219
+ check.value,
220
+ // This is in milliseconds
221
+ check.message,
222
+ refs
223
+ );
224
+ break;
225
+ }
226
+ }
227
+ return res;
228
+ };
229
+
230
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.4/node_modules/zod-to-json-schema/dist/esm/parsers/default.js
231
+ function parseDefaultDef(_def, refs) {
232
+ return {
233
+ ...parseDef(_def.innerType._def, refs),
234
+ default: _def.defaultValue()
235
+ };
236
+ }
237
+
238
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.4/node_modules/zod-to-json-schema/dist/esm/parsers/effects.js
239
+ function parseEffectsDef(_def, refs) {
240
+ return refs.effectStrategy === "input" ? parseDef(_def.schema._def, refs) : {};
241
+ }
242
+
243
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.4/node_modules/zod-to-json-schema/dist/esm/parsers/enum.js
244
+ function parseEnumDef(def) {
245
+ return {
246
+ type: "string",
247
+ enum: Array.from(def.values)
248
+ };
249
+ }
250
+
251
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.4/node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js
252
+ var isJsonSchema7AllOfType = (type) => {
253
+ if ("type" in type && type.type === "string")
254
+ return false;
255
+ return "allOf" in type;
256
+ };
257
+ function parseIntersectionDef(def, refs) {
258
+ const allOf = [
259
+ parseDef(def.left._def, {
260
+ ...refs,
261
+ currentPath: [...refs.currentPath, "allOf", "0"]
262
+ }),
263
+ parseDef(def.right._def, {
264
+ ...refs,
265
+ currentPath: [...refs.currentPath, "allOf", "1"]
266
+ })
267
+ ].filter((x) => !!x);
268
+ let unevaluatedProperties = refs.target === "jsonSchema2019-09" ? { unevaluatedProperties: false } : void 0;
269
+ const mergedAllOf = [];
270
+ allOf.forEach((schema) => {
271
+ if (isJsonSchema7AllOfType(schema)) {
272
+ mergedAllOf.push(...schema.allOf);
273
+ if (schema.unevaluatedProperties === void 0) {
274
+ unevaluatedProperties = void 0;
275
+ }
276
+ } else {
277
+ let nestedSchema = schema;
278
+ if ("additionalProperties" in schema && schema.additionalProperties === false) {
279
+ const { additionalProperties, ...rest } = schema;
280
+ nestedSchema = rest;
281
+ } else {
282
+ unevaluatedProperties = void 0;
283
+ }
284
+ mergedAllOf.push(nestedSchema);
285
+ }
286
+ });
287
+ return mergedAllOf.length ? {
288
+ allOf: mergedAllOf,
289
+ ...unevaluatedProperties
290
+ } : void 0;
291
+ }
292
+
293
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.4/node_modules/zod-to-json-schema/dist/esm/parsers/literal.js
294
+ function parseLiteralDef(def, refs) {
295
+ const parsedType = typeof def.value;
296
+ if (parsedType !== "bigint" && parsedType !== "number" && parsedType !== "boolean" && parsedType !== "string") {
297
+ return {
298
+ type: Array.isArray(def.value) ? "array" : "object"
299
+ };
300
+ }
301
+ if (refs.target === "openApi3") {
302
+ return {
303
+ type: parsedType === "bigint" ? "integer" : parsedType,
304
+ enum: [def.value]
305
+ };
306
+ }
307
+ return {
308
+ type: parsedType === "bigint" ? "integer" : parsedType,
309
+ const: def.value
310
+ };
311
+ }
312
+
313
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.4/node_modules/zod-to-json-schema/dist/esm/parsers/record.js
314
+ var import_zod2 = require("zod");
315
+
316
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.4/node_modules/zod-to-json-schema/dist/esm/parsers/string.js
317
+ var emojiRegex = void 0;
318
+ var zodPatterns = {
319
+ /**
320
+ * `c` was changed to `[cC]` to replicate /i flag
321
+ */
322
+ cuid: /^[cC][^\s-]{8,}$/,
323
+ cuid2: /^[0-9a-z]+$/,
324
+ ulid: /^[0-9A-HJKMNP-TV-Z]{26}$/,
325
+ /**
326
+ * `a-z` was added to replicate /i flag
327
+ */
328
+ email: /^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,
329
+ /**
330
+ * Constructed a valid Unicode RegExp
331
+ *
332
+ * Lazily instantiate since this type of regex isn't supported
333
+ * in all envs (e.g. React Native).
334
+ *
335
+ * See:
336
+ * https://github.com/colinhacks/zod/issues/2433
337
+ * Fix in Zod:
338
+ * https://github.com/colinhacks/zod/commit/9340fd51e48576a75adc919bff65dbc4a5d4c99b
339
+ */
340
+ emoji: () => {
341
+ if (emojiRegex === void 0) {
342
+ emojiRegex = RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$", "u");
343
+ }
344
+ return emojiRegex;
345
+ },
346
+ /**
347
+ * Unused
348
+ */
349
+ uuid: /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,
350
+ /**
351
+ * Unused
352
+ */
353
+ ipv4: /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,
354
+ ipv4Cidr: /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,
355
+ /**
356
+ * Unused
357
+ */
358
+ ipv6: /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,
359
+ ipv6Cidr: /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,
360
+ base64: /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,
361
+ base64url: /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,
362
+ nanoid: /^[a-zA-Z0-9_-]{21}$/,
363
+ jwt: /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/
364
+ };
365
+ function parseStringDef(def, refs) {
366
+ const res = {
367
+ type: "string"
368
+ };
369
+ if (def.checks) {
370
+ for (const check of def.checks) {
371
+ switch (check.kind) {
372
+ case "min":
373
+ setResponseValueAndErrors(res, "minLength", typeof res.minLength === "number" ? Math.max(res.minLength, check.value) : check.value, check.message, refs);
374
+ break;
375
+ case "max":
376
+ setResponseValueAndErrors(res, "maxLength", typeof res.maxLength === "number" ? Math.min(res.maxLength, check.value) : check.value, check.message, refs);
377
+ break;
378
+ case "email":
379
+ switch (refs.emailStrategy) {
380
+ case "format:email":
381
+ addFormat(res, "email", check.message, refs);
382
+ break;
383
+ case "format:idn-email":
384
+ addFormat(res, "idn-email", check.message, refs);
385
+ break;
386
+ case "pattern:zod":
387
+ addPattern(res, zodPatterns.email, check.message, refs);
388
+ break;
389
+ }
390
+ break;
391
+ case "url":
392
+ addFormat(res, "uri", check.message, refs);
393
+ break;
394
+ case "uuid":
395
+ addFormat(res, "uuid", check.message, refs);
396
+ break;
397
+ case "regex":
398
+ addPattern(res, check.regex, check.message, refs);
399
+ break;
400
+ case "cuid":
401
+ addPattern(res, zodPatterns.cuid, check.message, refs);
402
+ break;
403
+ case "cuid2":
404
+ addPattern(res, zodPatterns.cuid2, check.message, refs);
405
+ break;
406
+ case "startsWith":
407
+ addPattern(res, RegExp(`^${escapeLiteralCheckValue(check.value, refs)}`), check.message, refs);
408
+ break;
409
+ case "endsWith":
410
+ addPattern(res, RegExp(`${escapeLiteralCheckValue(check.value, refs)}$`), check.message, refs);
411
+ break;
412
+ case "datetime":
413
+ addFormat(res, "date-time", check.message, refs);
414
+ break;
415
+ case "date":
416
+ addFormat(res, "date", check.message, refs);
417
+ break;
418
+ case "time":
419
+ addFormat(res, "time", check.message, refs);
420
+ break;
421
+ case "duration":
422
+ addFormat(res, "duration", check.message, refs);
423
+ break;
424
+ case "length":
425
+ setResponseValueAndErrors(res, "minLength", typeof res.minLength === "number" ? Math.max(res.minLength, check.value) : check.value, check.message, refs);
426
+ setResponseValueAndErrors(res, "maxLength", typeof res.maxLength === "number" ? Math.min(res.maxLength, check.value) : check.value, check.message, refs);
427
+ break;
428
+ case "includes": {
429
+ addPattern(res, RegExp(escapeLiteralCheckValue(check.value, refs)), check.message, refs);
430
+ break;
431
+ }
432
+ case "ip": {
433
+ if (check.version !== "v6") {
434
+ addFormat(res, "ipv4", check.message, refs);
435
+ }
436
+ if (check.version !== "v4") {
437
+ addFormat(res, "ipv6", check.message, refs);
438
+ }
439
+ break;
440
+ }
441
+ case "base64url":
442
+ addPattern(res, zodPatterns.base64url, check.message, refs);
443
+ break;
444
+ case "jwt":
445
+ addPattern(res, zodPatterns.jwt, check.message, refs);
446
+ break;
447
+ case "cidr": {
448
+ if (check.version !== "v6") {
449
+ addPattern(res, zodPatterns.ipv4Cidr, check.message, refs);
450
+ }
451
+ if (check.version !== "v4") {
452
+ addPattern(res, zodPatterns.ipv6Cidr, check.message, refs);
453
+ }
454
+ break;
455
+ }
456
+ case "emoji":
457
+ addPattern(res, zodPatterns.emoji(), check.message, refs);
458
+ break;
459
+ case "ulid": {
460
+ addPattern(res, zodPatterns.ulid, check.message, refs);
461
+ break;
462
+ }
463
+ case "base64": {
464
+ switch (refs.base64Strategy) {
465
+ case "format:binary": {
466
+ addFormat(res, "binary", check.message, refs);
467
+ break;
468
+ }
469
+ case "contentEncoding:base64": {
470
+ setResponseValueAndErrors(res, "contentEncoding", "base64", check.message, refs);
471
+ break;
472
+ }
473
+ case "pattern:zod": {
474
+ addPattern(res, zodPatterns.base64, check.message, refs);
475
+ break;
476
+ }
477
+ }
478
+ break;
479
+ }
480
+ case "nanoid": {
481
+ addPattern(res, zodPatterns.nanoid, check.message, refs);
482
+ }
483
+ case "toLowerCase":
484
+ case "toUpperCase":
485
+ case "trim":
486
+ break;
487
+ default:
488
+ /* @__PURE__ */ ((_) => {
489
+ })(check);
490
+ }
491
+ }
492
+ }
493
+ return res;
494
+ }
495
+ function escapeLiteralCheckValue(literal, refs) {
496
+ return refs.patternStrategy === "escape" ? escapeNonAlphaNumeric(literal) : literal;
497
+ }
498
+ var ALPHA_NUMERIC = new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");
499
+ function escapeNonAlphaNumeric(source) {
500
+ let result = "";
501
+ for (let i = 0; i < source.length; i++) {
502
+ if (!ALPHA_NUMERIC.has(source[i])) {
503
+ result += "\\";
504
+ }
505
+ result += source[i];
506
+ }
507
+ return result;
508
+ }
509
+ function addFormat(schema, value, message, refs) {
510
+ if (schema.format || schema.anyOf?.some((x) => x.format)) {
511
+ if (!schema.anyOf) {
512
+ schema.anyOf = [];
513
+ }
514
+ if (schema.format) {
515
+ schema.anyOf.push({
516
+ format: schema.format,
517
+ ...schema.errorMessage && refs.errorMessages && {
518
+ errorMessage: { format: schema.errorMessage.format }
519
+ }
520
+ });
521
+ delete schema.format;
522
+ if (schema.errorMessage) {
523
+ delete schema.errorMessage.format;
524
+ if (Object.keys(schema.errorMessage).length === 0) {
525
+ delete schema.errorMessage;
526
+ }
527
+ }
528
+ }
529
+ schema.anyOf.push({
530
+ format: value,
531
+ ...message && refs.errorMessages && { errorMessage: { format: message } }
532
+ });
533
+ } else {
534
+ setResponseValueAndErrors(schema, "format", value, message, refs);
535
+ }
536
+ }
537
+ function addPattern(schema, regex, message, refs) {
538
+ if (schema.pattern || schema.allOf?.some((x) => x.pattern)) {
539
+ if (!schema.allOf) {
540
+ schema.allOf = [];
541
+ }
542
+ if (schema.pattern) {
543
+ schema.allOf.push({
544
+ pattern: schema.pattern,
545
+ ...schema.errorMessage && refs.errorMessages && {
546
+ errorMessage: { pattern: schema.errorMessage.pattern }
547
+ }
548
+ });
549
+ delete schema.pattern;
550
+ if (schema.errorMessage) {
551
+ delete schema.errorMessage.pattern;
552
+ if (Object.keys(schema.errorMessage).length === 0) {
553
+ delete schema.errorMessage;
554
+ }
555
+ }
556
+ }
557
+ schema.allOf.push({
558
+ pattern: stringifyRegExpWithFlags(regex, refs),
559
+ ...message && refs.errorMessages && { errorMessage: { pattern: message } }
560
+ });
561
+ } else {
562
+ setResponseValueAndErrors(schema, "pattern", stringifyRegExpWithFlags(regex, refs), message, refs);
563
+ }
564
+ }
565
+ function stringifyRegExpWithFlags(regex, refs) {
566
+ if (!refs.applyRegexFlags || !regex.flags) {
567
+ return regex.source;
568
+ }
569
+ const flags = {
570
+ i: regex.flags.includes("i"),
571
+ m: regex.flags.includes("m"),
572
+ s: regex.flags.includes("s")
573
+ // `.` matches newlines
574
+ };
575
+ const source = flags.i ? regex.source.toLowerCase() : regex.source;
576
+ let pattern = "";
577
+ let isEscaped = false;
578
+ let inCharGroup = false;
579
+ let inCharRange = false;
580
+ for (let i = 0; i < source.length; i++) {
581
+ if (isEscaped) {
582
+ pattern += source[i];
583
+ isEscaped = false;
584
+ continue;
585
+ }
586
+ if (flags.i) {
587
+ if (inCharGroup) {
588
+ if (source[i].match(/[a-z]/)) {
589
+ if (inCharRange) {
590
+ pattern += source[i];
591
+ pattern += `${source[i - 2]}-${source[i]}`.toUpperCase();
592
+ inCharRange = false;
593
+ } else if (source[i + 1] === "-" && source[i + 2]?.match(/[a-z]/)) {
594
+ pattern += source[i];
595
+ inCharRange = true;
596
+ } else {
597
+ pattern += `${source[i]}${source[i].toUpperCase()}`;
598
+ }
599
+ continue;
600
+ }
601
+ } else if (source[i].match(/[a-z]/)) {
602
+ pattern += `[${source[i]}${source[i].toUpperCase()}]`;
603
+ continue;
604
+ }
605
+ }
606
+ if (flags.m) {
607
+ if (source[i] === "^") {
608
+ pattern += `(^|(?<=[\r
609
+ ]))`;
610
+ continue;
611
+ } else if (source[i] === "$") {
612
+ pattern += `($|(?=[\r
613
+ ]))`;
614
+ continue;
615
+ }
616
+ }
617
+ if (flags.s && source[i] === ".") {
618
+ pattern += inCharGroup ? `${source[i]}\r
619
+ ` : `[${source[i]}\r
620
+ ]`;
621
+ continue;
622
+ }
623
+ pattern += source[i];
624
+ if (source[i] === "\\") {
625
+ isEscaped = true;
626
+ } else if (inCharGroup && source[i] === "]") {
627
+ inCharGroup = false;
628
+ } else if (!inCharGroup && source[i] === "[") {
629
+ inCharGroup = true;
630
+ }
631
+ }
632
+ try {
633
+ new RegExp(pattern);
634
+ } catch {
635
+ console.warn(`Could not convert regex pattern at ${refs.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`);
636
+ return regex.source;
637
+ }
638
+ return pattern;
639
+ }
640
+
641
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.4/node_modules/zod-to-json-schema/dist/esm/parsers/record.js
642
+ function parseRecordDef(def, refs) {
643
+ if (refs.target === "openAi") {
644
+ console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead.");
645
+ }
646
+ if (refs.target === "openApi3" && def.keyType?._def.typeName === import_zod2.ZodFirstPartyTypeKind.ZodEnum) {
647
+ return {
648
+ type: "object",
649
+ required: def.keyType._def.values,
650
+ properties: def.keyType._def.values.reduce((acc, key) => ({
651
+ ...acc,
652
+ [key]: parseDef(def.valueType._def, {
653
+ ...refs,
654
+ currentPath: [...refs.currentPath, "properties", key]
655
+ }) ?? {}
656
+ }), {}),
657
+ additionalProperties: refs.rejectedAdditionalProperties
658
+ };
659
+ }
660
+ const schema = {
661
+ type: "object",
662
+ additionalProperties: parseDef(def.valueType._def, {
663
+ ...refs,
664
+ currentPath: [...refs.currentPath, "additionalProperties"]
665
+ }) ?? refs.allowedAdditionalProperties
666
+ };
667
+ if (refs.target === "openApi3") {
668
+ return schema;
669
+ }
670
+ if (def.keyType?._def.typeName === import_zod2.ZodFirstPartyTypeKind.ZodString && def.keyType._def.checks?.length) {
671
+ const { type, ...keyType } = parseStringDef(def.keyType._def, refs);
672
+ return {
673
+ ...schema,
674
+ propertyNames: keyType
675
+ };
676
+ } else if (def.keyType?._def.typeName === import_zod2.ZodFirstPartyTypeKind.ZodEnum) {
677
+ return {
678
+ ...schema,
679
+ propertyNames: {
680
+ enum: def.keyType._def.values
681
+ }
682
+ };
683
+ } else if (def.keyType?._def.typeName === import_zod2.ZodFirstPartyTypeKind.ZodBranded && def.keyType._def.type._def.typeName === import_zod2.ZodFirstPartyTypeKind.ZodString && def.keyType._def.type._def.checks?.length) {
684
+ const { type, ...keyType } = parseBrandedDef(def.keyType._def, refs);
685
+ return {
686
+ ...schema,
687
+ propertyNames: keyType
688
+ };
689
+ }
690
+ return schema;
691
+ }
692
+
693
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.4/node_modules/zod-to-json-schema/dist/esm/parsers/map.js
694
+ function parseMapDef(def, refs) {
695
+ if (refs.mapStrategy === "record") {
696
+ return parseRecordDef(def, refs);
697
+ }
698
+ const keys = parseDef(def.keyType._def, {
699
+ ...refs,
700
+ currentPath: [...refs.currentPath, "items", "items", "0"]
701
+ }) || {};
702
+ const values = parseDef(def.valueType._def, {
703
+ ...refs,
704
+ currentPath: [...refs.currentPath, "items", "items", "1"]
705
+ }) || {};
706
+ return {
707
+ type: "array",
708
+ maxItems: 125,
709
+ items: {
710
+ type: "array",
711
+ items: [keys, values],
712
+ minItems: 2,
713
+ maxItems: 2
714
+ }
715
+ };
716
+ }
717
+
718
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.4/node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js
719
+ function parseNativeEnumDef(def) {
720
+ const object = def.values;
721
+ const actualKeys = Object.keys(def.values).filter((key) => {
722
+ return typeof object[object[key]] !== "number";
723
+ });
724
+ const actualValues = actualKeys.map((key) => object[key]);
725
+ const parsedTypes = Array.from(new Set(actualValues.map((values) => typeof values)));
726
+ return {
727
+ type: parsedTypes.length === 1 ? parsedTypes[0] === "string" ? "string" : "number" : ["string", "number"],
728
+ enum: actualValues
729
+ };
730
+ }
731
+
732
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.4/node_modules/zod-to-json-schema/dist/esm/parsers/never.js
733
+ function parseNeverDef() {
734
+ return {
735
+ not: {}
736
+ };
737
+ }
738
+
739
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.4/node_modules/zod-to-json-schema/dist/esm/parsers/null.js
740
+ function parseNullDef(refs) {
741
+ return refs.target === "openApi3" ? {
742
+ enum: ["null"],
743
+ nullable: true
744
+ } : {
745
+ type: "null"
746
+ };
747
+ }
748
+
749
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.4/node_modules/zod-to-json-schema/dist/esm/parsers/union.js
750
+ var primitiveMappings = {
751
+ ZodString: "string",
752
+ ZodNumber: "number",
753
+ ZodBigInt: "integer",
754
+ ZodBoolean: "boolean",
755
+ ZodNull: "null"
756
+ };
757
+ function parseUnionDef(def, refs) {
758
+ if (refs.target === "openApi3")
759
+ return asAnyOf(def, refs);
760
+ const options = def.options instanceof Map ? Array.from(def.options.values()) : def.options;
761
+ if (options.every((x) => x._def.typeName in primitiveMappings && (!x._def.checks || !x._def.checks.length))) {
762
+ const types = options.reduce((types2, x) => {
763
+ const type = primitiveMappings[x._def.typeName];
764
+ return type && !types2.includes(type) ? [...types2, type] : types2;
765
+ }, []);
766
+ return {
767
+ type: types.length > 1 ? types : types[0]
768
+ };
769
+ } else if (options.every((x) => x._def.typeName === "ZodLiteral" && !x.description)) {
770
+ const types = options.reduce((acc, x) => {
771
+ const type = typeof x._def.value;
772
+ switch (type) {
773
+ case "string":
774
+ case "number":
775
+ case "boolean":
776
+ return [...acc, type];
777
+ case "bigint":
778
+ return [...acc, "integer"];
779
+ case "object":
780
+ if (x._def.value === null)
781
+ return [...acc, "null"];
782
+ case "symbol":
783
+ case "undefined":
784
+ case "function":
785
+ default:
786
+ return acc;
787
+ }
788
+ }, []);
789
+ if (types.length === options.length) {
790
+ const uniqueTypes = types.filter((x, i, a) => a.indexOf(x) === i);
791
+ return {
792
+ type: uniqueTypes.length > 1 ? uniqueTypes : uniqueTypes[0],
793
+ enum: options.reduce((acc, x) => {
794
+ return acc.includes(x._def.value) ? acc : [...acc, x._def.value];
795
+ }, [])
796
+ };
797
+ }
798
+ } else if (options.every((x) => x._def.typeName === "ZodEnum")) {
799
+ return {
800
+ type: "string",
801
+ enum: options.reduce((acc, x) => [
802
+ ...acc,
803
+ ...x._def.values.filter((x2) => !acc.includes(x2))
804
+ ], [])
805
+ };
806
+ }
807
+ return asAnyOf(def, refs);
808
+ }
809
+ var asAnyOf = (def, refs) => {
810
+ const anyOf = (def.options instanceof Map ? Array.from(def.options.values()) : def.options).map((x, i) => parseDef(x._def, {
811
+ ...refs,
812
+ currentPath: [...refs.currentPath, "anyOf", `${i}`]
813
+ })).filter((x) => !!x && (!refs.strictUnions || typeof x === "object" && Object.keys(x).length > 0));
814
+ return anyOf.length ? { anyOf } : void 0;
815
+ };
816
+
817
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.4/node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js
818
+ function parseNullableDef(def, refs) {
819
+ if (["ZodString", "ZodNumber", "ZodBigInt", "ZodBoolean", "ZodNull"].includes(def.innerType._def.typeName) && (!def.innerType._def.checks || !def.innerType._def.checks.length)) {
820
+ if (refs.target === "openApi3") {
821
+ return {
822
+ type: primitiveMappings[def.innerType._def.typeName],
823
+ nullable: true
824
+ };
825
+ }
826
+ return {
827
+ type: [
828
+ primitiveMappings[def.innerType._def.typeName],
829
+ "null"
830
+ ]
831
+ };
832
+ }
833
+ if (refs.target === "openApi3") {
834
+ const base2 = parseDef(def.innerType._def, {
835
+ ...refs,
836
+ currentPath: [...refs.currentPath]
837
+ });
838
+ if (base2 && "$ref" in base2)
839
+ return { allOf: [base2], nullable: true };
840
+ return base2 && { ...base2, nullable: true };
841
+ }
842
+ const base = parseDef(def.innerType._def, {
843
+ ...refs,
844
+ currentPath: [...refs.currentPath, "anyOf", "0"]
845
+ });
846
+ return base && { anyOf: [base, { type: "null" }] };
847
+ }
848
+
849
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.4/node_modules/zod-to-json-schema/dist/esm/parsers/number.js
850
+ function parseNumberDef(def, refs) {
851
+ const res = {
852
+ type: "number"
853
+ };
854
+ if (!def.checks)
855
+ return res;
856
+ for (const check of def.checks) {
857
+ switch (check.kind) {
858
+ case "int":
859
+ res.type = "integer";
860
+ addErrorMessage(res, "type", check.message, refs);
861
+ break;
862
+ case "min":
863
+ if (refs.target === "jsonSchema7") {
864
+ if (check.inclusive) {
865
+ setResponseValueAndErrors(res, "minimum", check.value, check.message, refs);
866
+ } else {
867
+ setResponseValueAndErrors(res, "exclusiveMinimum", check.value, check.message, refs);
868
+ }
869
+ } else {
870
+ if (!check.inclusive) {
871
+ res.exclusiveMinimum = true;
872
+ }
873
+ setResponseValueAndErrors(res, "minimum", check.value, check.message, refs);
874
+ }
875
+ break;
876
+ case "max":
877
+ if (refs.target === "jsonSchema7") {
878
+ if (check.inclusive) {
879
+ setResponseValueAndErrors(res, "maximum", check.value, check.message, refs);
880
+ } else {
881
+ setResponseValueAndErrors(res, "exclusiveMaximum", check.value, check.message, refs);
882
+ }
883
+ } else {
884
+ if (!check.inclusive) {
885
+ res.exclusiveMaximum = true;
886
+ }
887
+ setResponseValueAndErrors(res, "maximum", check.value, check.message, refs);
888
+ }
889
+ break;
890
+ case "multipleOf":
891
+ setResponseValueAndErrors(res, "multipleOf", check.value, check.message, refs);
892
+ break;
893
+ }
894
+ }
895
+ return res;
896
+ }
897
+
898
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.4/node_modules/zod-to-json-schema/dist/esm/parsers/object.js
899
+ var import_zod3 = require("zod");
900
+ function parseObjectDef(def, refs) {
901
+ const forceOptionalIntoNullable = refs.target === "openAi";
902
+ const result = {
903
+ type: "object",
904
+ properties: {}
905
+ };
906
+ const required = [];
907
+ const shape = def.shape();
908
+ for (const propName in shape) {
909
+ let propDef = shape[propName];
910
+ if (propDef === void 0 || propDef._def === void 0) {
911
+ continue;
912
+ }
913
+ let propOptional = safeIsOptional(propDef);
914
+ if (propOptional && forceOptionalIntoNullable) {
915
+ if (propDef instanceof import_zod3.ZodOptional) {
916
+ propDef = propDef._def.innerType;
917
+ }
918
+ if (!propDef.isNullable()) {
919
+ propDef = propDef.nullable();
920
+ }
921
+ propOptional = false;
922
+ }
923
+ const parsedDef = parseDef(propDef._def, {
924
+ ...refs,
925
+ currentPath: [...refs.currentPath, "properties", propName],
926
+ propertyPath: [...refs.currentPath, "properties", propName]
927
+ });
928
+ if (parsedDef === void 0) {
929
+ continue;
930
+ }
931
+ result.properties[propName] = parsedDef;
932
+ if (!propOptional) {
933
+ required.push(propName);
934
+ }
935
+ }
936
+ if (required.length) {
937
+ result.required = required;
938
+ }
939
+ const additionalProperties = decideAdditionalProperties(def, refs);
940
+ if (additionalProperties !== void 0) {
941
+ result.additionalProperties = additionalProperties;
942
+ }
943
+ return result;
944
+ }
945
+ function decideAdditionalProperties(def, refs) {
946
+ if (def.catchall._def.typeName !== "ZodNever") {
947
+ return parseDef(def.catchall._def, {
948
+ ...refs,
949
+ currentPath: [...refs.currentPath, "additionalProperties"]
950
+ });
951
+ }
952
+ switch (def.unknownKeys) {
953
+ case "passthrough":
954
+ return refs.allowedAdditionalProperties;
955
+ case "strict":
956
+ return refs.rejectedAdditionalProperties;
957
+ case "strip":
958
+ return refs.removeAdditionalStrategy === "strict" ? refs.allowedAdditionalProperties : refs.rejectedAdditionalProperties;
959
+ }
960
+ }
961
+ function safeIsOptional(schema) {
962
+ try {
963
+ return schema.isOptional();
964
+ } catch {
965
+ return true;
966
+ }
967
+ }
968
+
969
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.4/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js
970
+ var parseOptionalDef = (def, refs) => {
971
+ if (refs.currentPath.toString() === refs.propertyPath?.toString()) {
972
+ return parseDef(def.innerType._def, refs);
973
+ }
974
+ const innerSchema = parseDef(def.innerType._def, {
975
+ ...refs,
976
+ currentPath: [...refs.currentPath, "anyOf", "1"]
977
+ });
978
+ return innerSchema ? {
979
+ anyOf: [
980
+ {
981
+ not: {}
982
+ },
983
+ innerSchema
984
+ ]
985
+ } : {};
986
+ };
987
+
988
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.4/node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js
989
+ var parsePipelineDef = (def, refs) => {
990
+ if (refs.pipeStrategy === "input") {
991
+ return parseDef(def.in._def, refs);
992
+ } else if (refs.pipeStrategy === "output") {
993
+ return parseDef(def.out._def, refs);
994
+ }
995
+ const a = parseDef(def.in._def, {
996
+ ...refs,
997
+ currentPath: [...refs.currentPath, "allOf", "0"]
998
+ });
999
+ const b = parseDef(def.out._def, {
1000
+ ...refs,
1001
+ currentPath: [...refs.currentPath, "allOf", a ? "1" : "0"]
1002
+ });
1003
+ return {
1004
+ allOf: [a, b].filter((x) => x !== void 0)
1005
+ };
1006
+ };
1007
+
1008
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.4/node_modules/zod-to-json-schema/dist/esm/parsers/promise.js
1009
+ function parsePromiseDef(def, refs) {
1010
+ return parseDef(def.type._def, refs);
1011
+ }
1012
+
1013
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.4/node_modules/zod-to-json-schema/dist/esm/parsers/set.js
1014
+ function parseSetDef(def, refs) {
1015
+ const items = parseDef(def.valueType._def, {
1016
+ ...refs,
1017
+ currentPath: [...refs.currentPath, "items"]
1018
+ });
1019
+ const schema = {
1020
+ type: "array",
1021
+ uniqueItems: true,
1022
+ items
1023
+ };
1024
+ if (def.minSize) {
1025
+ setResponseValueAndErrors(schema, "minItems", def.minSize.value, def.minSize.message, refs);
1026
+ }
1027
+ if (def.maxSize) {
1028
+ setResponseValueAndErrors(schema, "maxItems", def.maxSize.value, def.maxSize.message, refs);
1029
+ }
1030
+ return schema;
1031
+ }
1032
+
1033
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.4/node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js
1034
+ function parseTupleDef(def, refs) {
1035
+ if (def.rest) {
1036
+ return {
1037
+ type: "array",
1038
+ minItems: def.items.length,
1039
+ items: def.items.map((x, i) => parseDef(x._def, {
1040
+ ...refs,
1041
+ currentPath: [...refs.currentPath, "items", `${i}`]
1042
+ })).reduce((acc, x) => x === void 0 ? acc : [...acc, x], []),
1043
+ additionalItems: parseDef(def.rest._def, {
1044
+ ...refs,
1045
+ currentPath: [...refs.currentPath, "additionalItems"]
1046
+ })
1047
+ };
1048
+ } else {
1049
+ return {
1050
+ type: "array",
1051
+ minItems: def.items.length,
1052
+ maxItems: def.items.length,
1053
+ items: def.items.map((x, i) => parseDef(x._def, {
1054
+ ...refs,
1055
+ currentPath: [...refs.currentPath, "items", `${i}`]
1056
+ })).reduce((acc, x) => x === void 0 ? acc : [...acc, x], [])
1057
+ };
1058
+ }
1059
+ }
1060
+
1061
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.4/node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js
1062
+ function parseUndefinedDef() {
1063
+ return {
1064
+ not: {}
1065
+ };
1066
+ }
1067
+
1068
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.4/node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js
1069
+ function parseUnknownDef() {
1070
+ return {};
1071
+ }
1072
+
1073
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.4/node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js
1074
+ var parseReadonlyDef = (def, refs) => {
1075
+ return parseDef(def.innerType._def, refs);
1076
+ };
1077
+
1078
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.4/node_modules/zod-to-json-schema/dist/esm/selectParser.js
1079
+ var selectParser = (def, typeName, refs) => {
1080
+ switch (typeName) {
1081
+ case import_zod4.ZodFirstPartyTypeKind.ZodString:
1082
+ return parseStringDef(def, refs);
1083
+ case import_zod4.ZodFirstPartyTypeKind.ZodNumber:
1084
+ return parseNumberDef(def, refs);
1085
+ case import_zod4.ZodFirstPartyTypeKind.ZodObject:
1086
+ return parseObjectDef(def, refs);
1087
+ case import_zod4.ZodFirstPartyTypeKind.ZodBigInt:
1088
+ return parseBigintDef(def, refs);
1089
+ case import_zod4.ZodFirstPartyTypeKind.ZodBoolean:
1090
+ return parseBooleanDef();
1091
+ case import_zod4.ZodFirstPartyTypeKind.ZodDate:
1092
+ return parseDateDef(def, refs);
1093
+ case import_zod4.ZodFirstPartyTypeKind.ZodUndefined:
1094
+ return parseUndefinedDef();
1095
+ case import_zod4.ZodFirstPartyTypeKind.ZodNull:
1096
+ return parseNullDef(refs);
1097
+ case import_zod4.ZodFirstPartyTypeKind.ZodArray:
1098
+ return parseArrayDef(def, refs);
1099
+ case import_zod4.ZodFirstPartyTypeKind.ZodUnion:
1100
+ case import_zod4.ZodFirstPartyTypeKind.ZodDiscriminatedUnion:
1101
+ return parseUnionDef(def, refs);
1102
+ case import_zod4.ZodFirstPartyTypeKind.ZodIntersection:
1103
+ return parseIntersectionDef(def, refs);
1104
+ case import_zod4.ZodFirstPartyTypeKind.ZodTuple:
1105
+ return parseTupleDef(def, refs);
1106
+ case import_zod4.ZodFirstPartyTypeKind.ZodRecord:
1107
+ return parseRecordDef(def, refs);
1108
+ case import_zod4.ZodFirstPartyTypeKind.ZodLiteral:
1109
+ return parseLiteralDef(def, refs);
1110
+ case import_zod4.ZodFirstPartyTypeKind.ZodEnum:
1111
+ return parseEnumDef(def);
1112
+ case import_zod4.ZodFirstPartyTypeKind.ZodNativeEnum:
1113
+ return parseNativeEnumDef(def);
1114
+ case import_zod4.ZodFirstPartyTypeKind.ZodNullable:
1115
+ return parseNullableDef(def, refs);
1116
+ case import_zod4.ZodFirstPartyTypeKind.ZodOptional:
1117
+ return parseOptionalDef(def, refs);
1118
+ case import_zod4.ZodFirstPartyTypeKind.ZodMap:
1119
+ return parseMapDef(def, refs);
1120
+ case import_zod4.ZodFirstPartyTypeKind.ZodSet:
1121
+ return parseSetDef(def, refs);
1122
+ case import_zod4.ZodFirstPartyTypeKind.ZodLazy:
1123
+ return () => def.getter()._def;
1124
+ case import_zod4.ZodFirstPartyTypeKind.ZodPromise:
1125
+ return parsePromiseDef(def, refs);
1126
+ case import_zod4.ZodFirstPartyTypeKind.ZodNaN:
1127
+ case import_zod4.ZodFirstPartyTypeKind.ZodNever:
1128
+ return parseNeverDef();
1129
+ case import_zod4.ZodFirstPartyTypeKind.ZodEffects:
1130
+ return parseEffectsDef(def, refs);
1131
+ case import_zod4.ZodFirstPartyTypeKind.ZodAny:
1132
+ return parseAnyDef();
1133
+ case import_zod4.ZodFirstPartyTypeKind.ZodUnknown:
1134
+ return parseUnknownDef();
1135
+ case import_zod4.ZodFirstPartyTypeKind.ZodDefault:
1136
+ return parseDefaultDef(def, refs);
1137
+ case import_zod4.ZodFirstPartyTypeKind.ZodBranded:
1138
+ return parseBrandedDef(def, refs);
1139
+ case import_zod4.ZodFirstPartyTypeKind.ZodReadonly:
1140
+ return parseReadonlyDef(def, refs);
1141
+ case import_zod4.ZodFirstPartyTypeKind.ZodCatch:
1142
+ return parseCatchDef(def, refs);
1143
+ case import_zod4.ZodFirstPartyTypeKind.ZodPipeline:
1144
+ return parsePipelineDef(def, refs);
1145
+ case import_zod4.ZodFirstPartyTypeKind.ZodFunction:
1146
+ case import_zod4.ZodFirstPartyTypeKind.ZodVoid:
1147
+ case import_zod4.ZodFirstPartyTypeKind.ZodSymbol:
1148
+ return void 0;
1149
+ default:
1150
+ return /* @__PURE__ */ ((_) => void 0)(typeName);
1151
+ }
1152
+ };
1153
+
1154
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.4/node_modules/zod-to-json-schema/dist/esm/parseDef.js
1155
+ function parseDef(def, refs, forceResolution = false) {
1156
+ const seenItem = refs.seen.get(def);
1157
+ if (refs.override) {
1158
+ const overrideResult = refs.override?.(def, refs, seenItem, forceResolution);
1159
+ if (overrideResult !== ignoreOverride) {
1160
+ return overrideResult;
1161
+ }
1162
+ }
1163
+ if (seenItem && !forceResolution) {
1164
+ const seenSchema = get$ref(seenItem, refs);
1165
+ if (seenSchema !== void 0) {
1166
+ return seenSchema;
1167
+ }
1168
+ }
1169
+ const newItem = { def, path: refs.currentPath, jsonSchema: void 0 };
1170
+ refs.seen.set(def, newItem);
1171
+ const jsonSchemaOrGetter = selectParser(def, def.typeName, refs);
1172
+ const jsonSchema2 = typeof jsonSchemaOrGetter === "function" ? parseDef(jsonSchemaOrGetter(), refs) : jsonSchemaOrGetter;
1173
+ if (jsonSchema2) {
1174
+ addMeta(def, refs, jsonSchema2);
1175
+ }
1176
+ if (refs.postProcess) {
1177
+ const postProcessResult = refs.postProcess(jsonSchema2, def, refs);
1178
+ newItem.jsonSchema = jsonSchema2;
1179
+ return postProcessResult;
1180
+ }
1181
+ newItem.jsonSchema = jsonSchema2;
1182
+ return jsonSchema2;
1183
+ }
1184
+ var get$ref = (item, refs) => {
1185
+ switch (refs.$refStrategy) {
1186
+ case "root":
1187
+ return { $ref: item.path.join("/") };
1188
+ case "relative":
1189
+ return { $ref: getRelativePath(refs.currentPath, item.path) };
1190
+ case "none":
1191
+ case "seen": {
1192
+ if (item.path.length < refs.currentPath.length && item.path.every((value, index) => refs.currentPath[index] === value)) {
1193
+ console.warn(`Recursive reference detected at ${refs.currentPath.join("/")}! Defaulting to any`);
1194
+ return {};
1195
+ }
1196
+ return refs.$refStrategy === "seen" ? {} : void 0;
1197
+ }
1198
+ }
1199
+ };
1200
+ var getRelativePath = (pathA, pathB) => {
1201
+ let i = 0;
1202
+ for (; i < pathA.length && i < pathB.length; i++) {
1203
+ if (pathA[i] !== pathB[i])
1204
+ break;
1205
+ }
1206
+ return [(pathA.length - i).toString(), ...pathB.slice(i)].join("/");
1207
+ };
1208
+ var addMeta = (def, refs, jsonSchema2) => {
1209
+ if (def.description) {
1210
+ jsonSchema2.description = def.description;
1211
+ if (refs.markdownDescription) {
1212
+ jsonSchema2.markdownDescription = def.description;
1213
+ }
1214
+ }
1215
+ return jsonSchema2;
1216
+ };
1217
+
1218
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.24.4/node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js
1219
+ var zodToJsonSchema = (schema, options) => {
1220
+ const refs = getRefs(options);
1221
+ const definitions = typeof options === "object" && options.definitions ? Object.entries(options.definitions).reduce((acc, [name2, schema2]) => ({
1222
+ ...acc,
1223
+ [name2]: parseDef(schema2._def, {
1224
+ ...refs,
1225
+ currentPath: [...refs.basePath, refs.definitionPath, name2]
1226
+ }, true) ?? {}
1227
+ }), {}) : void 0;
1228
+ const name = typeof options === "string" ? options : options?.nameStrategy === "title" ? void 0 : options?.name;
1229
+ const main = parseDef(schema._def, name === void 0 ? refs : {
1230
+ ...refs,
1231
+ currentPath: [...refs.basePath, refs.definitionPath, name]
1232
+ }, false) ?? {};
1233
+ const title = typeof options === "object" && options.name !== void 0 && options.nameStrategy === "title" ? options.name : void 0;
1234
+ if (title !== void 0) {
1235
+ main.title = title;
1236
+ }
1237
+ const combined = name === void 0 ? definitions ? {
1238
+ ...main,
1239
+ [refs.definitionPath]: definitions
1240
+ } : main : {
1241
+ $ref: [
1242
+ ...refs.$refStrategy === "relative" ? [] : refs.basePath,
1243
+ refs.definitionPath,
1244
+ name
1245
+ ].join("/"),
1246
+ [refs.definitionPath]: {
1247
+ ...definitions,
1248
+ [name]: main
1249
+ }
1250
+ };
1251
+ if (refs.target === "jsonSchema7") {
1252
+ combined.$schema = "http://json-schema.org/draft-07/schema#";
1253
+ } else if (refs.target === "jsonSchema2019-09" || refs.target === "openAi") {
1254
+ combined.$schema = "https://json-schema.org/draft/2019-09/schema#";
1255
+ }
1256
+ if (refs.target === "openAi" && ("anyOf" in combined || "oneOf" in combined || "allOf" in combined || "type" in combined && Array.isArray(combined.type))) {
1257
+ console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property.");
1258
+ }
1259
+ return combined;
1260
+ };
1261
+
1262
+ // flow.types.ts
1263
+ var import_zod5 = require("zod");
1264
+ var PlainLiteralObjectSchema = import_zod5.z.record(import_zod5.z.string(), import_zod5.z.any()).describe("Represents a plain literal object.");
1265
+ var FieldTypeEnumSchema = import_zod5.z.enum([
1266
+ "text",
1267
+ "boolean",
1268
+ "number",
1269
+ "email",
1270
+ "phone",
1271
+ "mobile_phone",
1272
+ "date",
1273
+ "time",
1274
+ "datetime",
1275
+ "password",
1276
+ "url",
1277
+ "void",
1278
+ "location",
1279
+ "availability"
1280
+ ]).describe("Enum for field types.");
1281
+ var FieldComponentEnumSchema = import_zod5.z.enum([
1282
+ "input",
1283
+ "textarea",
1284
+ "select",
1285
+ "radio",
1286
+ "checkbox",
1287
+ "switch",
1288
+ "carousel",
1289
+ "button",
1290
+ "label",
1291
+ "calendar",
1292
+ "map"
1293
+ ]).describe("Enum for field components.");
1294
+ var FieldSelectionModeSchema = import_zod5.z.enum(["simple", "multiple"]).describe("Enum for field selection modes.");
1295
+ var FieldDependentBehaviorEnumSchema = import_zod5.z.enum(["hidden", "disabled"]).describe("Enum for field dependent behaviors.");
1296
+ var FieldItemDtoSchema = import_zod5.z.object({
1297
+ /** Label for the field item. Can be a string or a plain literal object. */
1298
+ label: import_zod5.z.union([import_zod5.z.string(), PlainLiteralObjectSchema]).optional().describe("Label for the field item."),
1299
+ /** Value of the field item. */
1300
+ value: PlainLiteralObjectSchema.optional().describe("Value of the field item."),
1301
+ /** Description for the field item. Can be a string or a plain literal object. */
1302
+ description: import_zod5.z.union([import_zod5.z.string(), PlainLiteralObjectSchema]).optional().describe("Description for the field item."),
1303
+ /** URL of an image for the field item. */
1304
+ image: import_zod5.z.string().url().optional().describe("URL of an image for the field item."),
1305
+ /** ID of the next node. */
1306
+ nextNodeId: import_zod5.z.boolean().optional().describe("ID of the next node.")
1307
+ }).describe("Data transfer object for a field item.");
1308
+ var DataProviderSourceTypeSchema = import_zod5.z.enum(["property", "httpRequest", "mqRequest", "function"]).describe("Enum for data provider source types.");
1309
+ var ConditionalOperatorDtoSchema = import_zod5.z.object({
1310
+ /** Checks if a value exists. */
1311
+ exists: import_zod5.z.object({ valueA: import_zod5.z.unknown(), valueB: import_zod5.z.boolean() }).optional().describe("Checks if a value exists."),
1312
+ /** Checks if two values are equal. */
1313
+ equal: import_zod5.z.object({ valueA: import_zod5.z.unknown(), valueB: import_zod5.z.unknown() }).optional().describe("Checks if two values are equal."),
1314
+ /** Checks if two values are not equal. */
1315
+ notEqual: import_zod5.z.object({ valueA: import_zod5.z.unknown(), valueB: import_zod5.z.unknown() }).optional().describe("Checks if two values are not equal."),
1316
+ /** Checks if valueA is equal to or greater than valueB. */
1317
+ equalOrGreater: import_zod5.z.object({ valueA: import_zod5.z.unknown(), valueB: import_zod5.z.unknown() }).optional().describe("Checks if valueA is equal to or greater than valueB."),
1318
+ /** Checks if valueA is equal to or less than valueB. */
1319
+ equalOrLess: import_zod5.z.object({ valueA: import_zod5.z.unknown(), valueB: import_zod5.z.unknown() }).optional().describe("Checks if valueA is equal to or less than valueB."),
1320
+ /** Checks if valueA is greater than valueB. */
1321
+ greater: import_zod5.z.object({ valueA: import_zod5.z.unknown(), valueB: import_zod5.z.unknown() }).optional().describe("Checks if valueA is greater than valueB."),
1322
+ /** Checks if valueA is less than valueB. */
1323
+ less: import_zod5.z.object({ valueA: import_zod5.z.unknown(), valueB: import_zod5.z.unknown() }).optional().describe("Checks if valueA is less than valueB."),
1324
+ /** Checks if valueA starts with valueB. */
1325
+ startsWith: import_zod5.z.object({ valueA: import_zod5.z.string(), valueB: import_zod5.z.string() }).optional().describe("Checks if valueA starts with valueB."),
1326
+ /** Checks if valueA contains valueB. */
1327
+ contains: import_zod5.z.object({ valueA: import_zod5.z.string(), valueB: import_zod5.z.string() }).optional().describe("Checks if valueA contains valueB."),
1328
+ /** Checks if valueA includes valueB. */
1329
+ includes: import_zod5.z.object({ valueA: import_zod5.z.array(import_zod5.z.unknown()), valueB: import_zod5.z.unknown() }).optional().describe("Checks if valueA includes valueB.")
1330
+ }).describe("Data transfer object for conditional operators.");
1331
+ var ConditionalGroupOperatorDtoSchema = import_zod5.z.object({
1332
+ /** Array of OR conditions. */
1333
+ or: import_zod5.z.array(ConditionalOperatorDtoSchema).optional().describe("Array of OR conditions."),
1334
+ /** Array of AND conditions. */
1335
+ and: import_zod5.z.array(ConditionalOperatorDtoSchema).optional().describe("Array of AND conditions.")
1336
+ }).describe("Data transfer object for conditional group operators.");
1337
+ var DataTransformerTypeSchema = import_zod5.z.enum([
1338
+ "map",
1339
+ "concat",
1340
+ "filter",
1341
+ "reduce",
1342
+ "unique",
1343
+ "join",
1344
+ "flat",
1345
+ "flatmap",
1346
+ "sort",
1347
+ "delete"
1348
+ ]).describe("Enum for data transformer types.");
1349
+ var DataTransformerDtoSchema = import_zod5.z.object({
1350
+ /** Type of the data transformer. */
1351
+ type: DataTransformerTypeSchema.describe("Type of the data transformer."),
1352
+ /** Parameters for the data transformer. */
1353
+ params: import_zod5.z.record(import_zod5.z.string(), import_zod5.z.any()).optional().describe("Parameters for the data transformer."),
1354
+ /** Conditions for the data transformer. */
1355
+ conditions: import_zod5.z.array(import_zod5.z.union([ConditionalOperatorDtoSchema, ConditionalGroupOperatorDtoSchema])).optional().describe("Conditions for the data transformer."),
1356
+ /** Required fields for the data transformer. */
1357
+ require: import_zod5.z.array(import_zod5.z.string()).optional().describe("Required fields for the data transformer.")
1358
+ }).describe("Data transfer object for data transformers.");
1359
+ var DataProviderDtoSchema = import_zod5.z.object({
1360
+ /** Type of the data provider source. */
1361
+ type: DataProviderSourceTypeSchema.describe("Type of the data provider source."),
1362
+ /** Name of the data provider. */
1363
+ name: import_zod5.z.string().optional().describe("Name of the data provider."),
1364
+ /** Parameters for the data provider. */
1365
+ params: import_zod5.z.union([import_zod5.z.record(import_zod5.z.string(), import_zod5.z.unknown()), import_zod5.z.string()]).optional().describe("Parameters for the data provider."),
1366
+ /** Whether to persist the data. */
1367
+ persist: import_zod5.z.boolean().optional().describe("Whether to persist the data."),
1368
+ /** Conditions for the data provider. */
1369
+ conditions: import_zod5.z.array(import_zod5.z.union([ConditionalOperatorDtoSchema, ConditionalGroupOperatorDtoSchema])).optional().describe("Conditions for the data provider."),
1370
+ /** Transformers for the data provider. */
1371
+ transformers: import_zod5.z.array(DataTransformerDtoSchema).optional().describe("Transformers for the data provider."),
1372
+ /** Required fields for the data provider. */
1373
+ require: import_zod5.z.array(import_zod5.z.string()).optional().describe("Required fields for the data provider.")
1374
+ }).describe("Data transfer object for data providers.");
1375
+ var FieldDtoSchema = import_zod5.z.object({
1376
+ /** Name of the field. */
1377
+ name: import_zod5.z.string().describe("Name of the field."),
1378
+ /** Type of the field. */
1379
+ type: FieldTypeEnumSchema.describe("Type of the field."),
1380
+ /** Label for the field. Can be a string or a plain literal object. */
1381
+ label: import_zod5.z.union([import_zod5.z.string(), PlainLiteralObjectSchema]).optional().describe("Label for the field."),
1382
+ /** Value of the field. */
1383
+ value: import_zod5.z.any().optional().describe("Value of the field."),
1384
+ /** Component for the field. */
1385
+ component: FieldComponentEnumSchema.optional().describe("Component for the field."),
1386
+ /** Selection mode for the field. */
1387
+ selectionMode: FieldSelectionModeSchema.optional().describe("Selection mode for the field."),
1388
+ /** Whether the field is required. */
1389
+ required: import_zod5.z.boolean().optional().describe("Whether the field is required."),
1390
+ /** Placeholder for the field. Can be a string or a plain literal object. */
1391
+ placeholder: import_zod5.z.union([import_zod5.z.string(), PlainLiteralObjectSchema]).optional().describe("Placeholder for the field."),
1392
+ /** Options for the field. */
1393
+ options: import_zod5.z.array(FieldItemDtoSchema).optional().describe("Options for the field."),
1394
+ /** Data provider for the field options. */
1395
+ optionsProvider: DataProviderDtoSchema.optional().describe(
1396
+ "Data provider for the field options."
1397
+ ),
1398
+ /** Configuration for the field. */
1399
+ configuration: PlainLiteralObjectSchema.optional().describe("Configuration for the field."),
1400
+ /** Fields that this field depends on. */
1401
+ dependsOn: import_zod5.z.array(PlainLiteralObjectSchema).optional().describe("Fields that this field depends on."),
1402
+ /** Behavior of the field when its dependencies are not met. */
1403
+ dependentBehavior: FieldDependentBehaviorEnumSchema.optional().describe(
1404
+ "Behavior of the field when its dependencies are not met."
1405
+ ),
1406
+ /** Conditions for the field. */
1407
+ conditions: import_zod5.z.array(PlainLiteralObjectSchema).optional().describe("Conditions for the field."),
1408
+ /** Custom error message for the field. */
1409
+ customError: PlainLiteralObjectSchema.optional().describe(
1410
+ "Custom error message for the field."
1411
+ )
1412
+ }).describe("Data transfer object for a field.");
1413
+ var ActionTypeEnumSchema = import_zod5.z.enum(["submit", "link", "forward", "script"]).describe("Enum for action types.");
1414
+ var ActionVariantEnumSchema = import_zod5.z.enum(["primary", "secondary", "success", "warning", "info", "danger"]).describe("Enum for action variants.");
1415
+ var ScriptsDtoSchema = import_zod5.z.object({
1416
+ /** Source URL of the script. */
1417
+ src: import_zod5.z.string().url().describe("Source URL of the script."),
1418
+ /** Whether to preload the script. */
1419
+ preload: import_zod5.z.boolean().optional().describe("Whether to preload the script."),
1420
+ /** Name of the script. */
1421
+ name: import_zod5.z.string().describe("Name of the script."),
1422
+ /** Function to execute from the script. */
1423
+ function: import_zod5.z.string().describe("Function to execute from the script."),
1424
+ /** Parameters for the script function. */
1425
+ params: import_zod5.z.record(import_zod5.z.string(), import_zod5.z.any()).optional().describe("Parameters for the script function.")
1426
+ }).describe("Data transfer object for scripts.");
1427
+ var PipelineFunctionTypeSchema = import_zod5.z.string().describe(
1428
+ "Enum for pipeline function types. TODO: Replace z.string() with z.enum([...]) with actual pipeline function types."
1429
+ );
1430
+ var FailFlowSchema = PlainLiteralObjectSchema.describe(
1431
+ "Data transfer object for fail flow. TODO: Define the actual structure for FailFlowSchema if it's not a plain literal object."
1432
+ );
1433
+ var ActionPipelineDtoSchema = import_zod5.z.object({
1434
+ /** Function type for the pipeline. */
1435
+ function: PipelineFunctionTypeSchema.describe("Function type for the pipeline."),
1436
+ /** Parameters for the pipeline function. */
1437
+ params: PlainLiteralObjectSchema.optional().describe("Parameters for the pipeline function."),
1438
+ /** Conditions for the pipeline. */
1439
+ conditions: import_zod5.z.array(import_zod5.z.union([ConditionalOperatorDtoSchema, ConditionalGroupOperatorDtoSchema])).optional().describe("Conditions for the pipeline."),
1440
+ /** Required fields for the pipeline. */
1441
+ require: import_zod5.z.array(import_zod5.z.string()).optional().describe("Required fields for the pipeline."),
1442
+ /** Fail flow configuration. */
1443
+ onFail: FailFlowSchema.optional().describe("Fail flow configuration.")
1444
+ }).describe("Data transfer object for an action pipeline.");
1445
+ var ActionDtoSchema = import_zod5.z.object({
1446
+ /** ID of the action. */
1447
+ id: import_zod5.z.string().describe("ID of the action."),
1448
+ /** Label for the action. Can be a string or a plain literal object. */
1449
+ label: import_zod5.z.union([import_zod5.z.string(), PlainLiteralObjectSchema]).optional().describe("Label for the action."),
1450
+ /** Type of the action. */
1451
+ type: ActionTypeEnumSchema.describe("Type of the action."),
1452
+ /** Variant of the action. */
1453
+ variant: ActionVariantEnumSchema.optional().describe("Variant of the action."),
1454
+ /** URL for link-type actions. */
1455
+ url: import_zod5.z.string().optional().describe("URL for link-type actions."),
1456
+ /** Pipeline for the action. */
1457
+ pipeline: import_zod5.z.array(ActionPipelineDtoSchema).optional().describe("Pipeline for the action."),
1458
+ /** Conditions for the action. */
1459
+ conditions: import_zod5.z.array(PlainLiteralObjectSchema).optional().describe("Conditions for the action."),
1460
+ /** ID of the next step. */
1461
+ nextStepId: import_zod5.z.string().optional().describe("ID of the next step."),
1462
+ /** Scripts associated with the action. */
1463
+ scripts: import_zod5.z.array(ScriptsDtoSchema).optional().describe("Scripts associated with the action.")
1464
+ }).describe("Data transfer object for an action.");
1465
+ var RoutingDtoSchema = import_zod5.z.object({
1466
+ /** Conditions for the routing rule. */
1467
+ conditions: import_zod5.z.array(import_zod5.z.union([ConditionalOperatorDtoSchema, ConditionalGroupOperatorDtoSchema])).optional().describe("Conditions for the routing rule."),
1468
+ /** ID of the next step if conditions are met. */
1469
+ nextStepId: import_zod5.z.string().describe("ID of the next step if conditions are met.")
1470
+ }).describe("Data transfer object for routing.");
1471
+ var NodeDtoSchema = import_zod5.z.object({
1472
+ /** ID of the node. */
1473
+ id: import_zod5.z.string().describe("ID of the node."),
1474
+ /** Whether this is the initial node. */
1475
+ initialNode: import_zod5.z.boolean().optional().describe("Whether this is the initial node."),
1476
+ /** Whether this is a final node. */
1477
+ finalNode: import_zod5.z.boolean().optional().describe("Whether this is a final node."),
1478
+ /** Title of the node. Can be a string or a plain literal object. */
1479
+ title: import_zod5.z.union([import_zod5.z.string(), PlainLiteralObjectSchema]).optional().describe("Title of the node."),
1480
+ /** Description of the node. */
1481
+ description: import_zod5.z.string().optional().describe("Description of the node."),
1482
+ /** Fields in the node. */
1483
+ fields: import_zod5.z.array(FieldDtoSchema).optional().describe("Fields in the node."),
1484
+ /** Actions available in the node. */
1485
+ actions: import_zod5.z.array(ActionDtoSchema).optional().describe("Actions available in the node."),
1486
+ /** Routing rules for the node. */
1487
+ routing: import_zod5.z.array(RoutingDtoSchema).optional().describe("Routing rules for the node."),
1488
+ /** Data providers for state management. */
1489
+ stateProviders: import_zod5.z.array(DataProviderDtoSchema).optional().describe("Data providers for state management."),
1490
+ /** Data providers for tracking. */
1491
+ trackingProviders: import_zod5.z.array(DataProviderDtoSchema).optional().describe("Data providers for tracking."),
1492
+ /** ID of the stage this node belongs to. */
1493
+ stageId: import_zod5.z.string().optional().describe("ID of the stage this node belongs to."),
1494
+ /** Translations for the node. */
1495
+ translations: PlainLiteralObjectSchema.optional().describe("Translations for the node.")
1496
+ }).describe("Data transfer object for a node.");
1497
+ var NodeListDtoSchema = import_zod5.z.array(NodeDtoSchema).describe("List of nodes.");
1498
+ var FlowDtoSchema = import_zod5.z.object({
1499
+ nodes: import_zod5.z.array(NodeDtoSchema).describe("List of nodes.")
1500
+ });
1501
+
1502
+ // schema-generator.ts
1503
+ var jsonSchema = zodToJsonSchema(FlowDtoSchema, "OnliveFlowSchema");
1504
+ (0, import_fs.writeFileSync)("flow-configuration.schema.json", JSON.stringify(jsonSchema, null, 2), "utf-8");