@cerios/openapi-to-zod 1.4.0 → 1.5.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.
package/dist/cli.js CHANGED
@@ -29,16 +29,16 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
29
29
  mod
30
30
  ));
31
31
 
32
- // ../../node_modules/tsup/assets/cjs_shims.js
32
+ // ../../node_modules/.pnpm/tsup@8.5.1_postcss@8.5.6_tsx@4.21.0_typescript@5.9.3_yaml@2.8.2/node_modules/tsup/assets/cjs_shims.js
33
33
  var init_cjs_shims = __esm({
34
- "../../node_modules/tsup/assets/cjs_shims.js"() {
34
+ "../../node_modules/.pnpm/tsup@8.5.1_postcss@8.5.6_tsx@4.21.0_typescript@5.9.3_yaml@2.8.2/node_modules/tsup/assets/cjs_shims.js"() {
35
35
  "use strict";
36
36
  }
37
37
  });
38
38
 
39
- // ../../node_modules/kleur/index.js
39
+ // ../../node_modules/.pnpm/kleur@3.0.3/node_modules/kleur/index.js
40
40
  var require_kleur = __commonJS({
41
- "../../node_modules/kleur/index.js"(exports2, module2) {
41
+ "../../node_modules/.pnpm/kleur@3.0.3/node_modules/kleur/index.js"(exports2, module2) {
42
42
  "use strict";
43
43
  init_cjs_shims();
44
44
  var { FORCE_COLOR, NODE_DISABLE_COLORS, TERM } = process.env;
@@ -134,9 +134,9 @@ var require_kleur = __commonJS({
134
134
  }
135
135
  });
136
136
 
137
- // ../../node_modules/prompts/dist/util/action.js
137
+ // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/action.js
138
138
  var require_action = __commonJS({
139
- "../../node_modules/prompts/dist/util/action.js"(exports2, module2) {
139
+ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/action.js"(exports2, module2) {
140
140
  "use strict";
141
141
  init_cjs_shims();
142
142
  module2.exports = (key, isSelect) => {
@@ -172,9 +172,9 @@ var require_action = __commonJS({
172
172
  }
173
173
  });
174
174
 
175
- // ../../node_modules/prompts/dist/util/strip.js
175
+ // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/strip.js
176
176
  var require_strip = __commonJS({
177
- "../../node_modules/prompts/dist/util/strip.js"(exports2, module2) {
177
+ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/strip.js"(exports2, module2) {
178
178
  "use strict";
179
179
  init_cjs_shims();
180
180
  module2.exports = (str) => {
@@ -185,9 +185,9 @@ var require_strip = __commonJS({
185
185
  }
186
186
  });
187
187
 
188
- // ../../node_modules/sisteransi/src/index.js
188
+ // ../../node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js
189
189
  var require_src = __commonJS({
190
- "../../node_modules/sisteransi/src/index.js"(exports2, module2) {
190
+ "../../node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js"(exports2, module2) {
191
191
  "use strict";
192
192
  init_cjs_shims();
193
193
  var ESC = "\x1B";
@@ -242,9 +242,9 @@ var require_src = __commonJS({
242
242
  }
243
243
  });
244
244
 
245
- // ../../node_modules/prompts/dist/util/clear.js
245
+ // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/clear.js
246
246
  var require_clear = __commonJS({
247
- "../../node_modules/prompts/dist/util/clear.js"(exports2, module2) {
247
+ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/clear.js"(exports2, module2) {
248
248
  "use strict";
249
249
  init_cjs_shims();
250
250
  function _createForOfIteratorHelper(o, allowArrayLike) {
@@ -320,9 +320,9 @@ var require_clear = __commonJS({
320
320
  }
321
321
  });
322
322
 
323
- // ../../node_modules/prompts/dist/util/figures.js
323
+ // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/figures.js
324
324
  var require_figures = __commonJS({
325
- "../../node_modules/prompts/dist/util/figures.js"(exports2, module2) {
325
+ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/figures.js"(exports2, module2) {
326
326
  "use strict";
327
327
  init_cjs_shims();
328
328
  var main = {
@@ -358,9 +358,9 @@ var require_figures = __commonJS({
358
358
  }
359
359
  });
360
360
 
361
- // ../../node_modules/prompts/dist/util/style.js
361
+ // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/style.js
362
362
  var require_style = __commonJS({
363
- "../../node_modules/prompts/dist/util/style.js"(exports2, module2) {
363
+ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/style.js"(exports2, module2) {
364
364
  "use strict";
365
365
  init_cjs_shims();
366
366
  var c = require_kleur();
@@ -404,9 +404,9 @@ var require_style = __commonJS({
404
404
  }
405
405
  });
406
406
 
407
- // ../../node_modules/prompts/dist/util/lines.js
407
+ // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/lines.js
408
408
  var require_lines = __commonJS({
409
- "../../node_modules/prompts/dist/util/lines.js"(exports2, module2) {
409
+ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/lines.js"(exports2, module2) {
410
410
  "use strict";
411
411
  init_cjs_shims();
412
412
  var strip = require_strip();
@@ -418,9 +418,9 @@ var require_lines = __commonJS({
418
418
  }
419
419
  });
420
420
 
421
- // ../../node_modules/prompts/dist/util/wrap.js
421
+ // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/wrap.js
422
422
  var require_wrap = __commonJS({
423
- "../../node_modules/prompts/dist/util/wrap.js"(exports2, module2) {
423
+ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/wrap.js"(exports2, module2) {
424
424
  "use strict";
425
425
  init_cjs_shims();
426
426
  module2.exports = (msg, opts = {}) => {
@@ -435,9 +435,9 @@ var require_wrap = __commonJS({
435
435
  }
436
436
  });
437
437
 
438
- // ../../node_modules/prompts/dist/util/entriesToDisplay.js
438
+ // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/entriesToDisplay.js
439
439
  var require_entriesToDisplay = __commonJS({
440
- "../../node_modules/prompts/dist/util/entriesToDisplay.js"(exports2, module2) {
440
+ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/entriesToDisplay.js"(exports2, module2) {
441
441
  "use strict";
442
442
  init_cjs_shims();
443
443
  module2.exports = (cursor, total, maxVisible) => {
@@ -453,9 +453,9 @@ var require_entriesToDisplay = __commonJS({
453
453
  }
454
454
  });
455
455
 
456
- // ../../node_modules/prompts/dist/util/index.js
456
+ // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/index.js
457
457
  var require_util = __commonJS({
458
- "../../node_modules/prompts/dist/util/index.js"(exports2, module2) {
458
+ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/index.js"(exports2, module2) {
459
459
  "use strict";
460
460
  init_cjs_shims();
461
461
  module2.exports = {
@@ -471,9 +471,9 @@ var require_util = __commonJS({
471
471
  }
472
472
  });
473
473
 
474
- // ../../node_modules/prompts/dist/elements/prompt.js
474
+ // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/prompt.js
475
475
  var require_prompt = __commonJS({
476
- "../../node_modules/prompts/dist/elements/prompt.js"(exports2, module2) {
476
+ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/prompt.js"(exports2, module2) {
477
477
  "use strict";
478
478
  init_cjs_shims();
479
479
  var readline = require("readline");
@@ -537,9 +537,9 @@ var require_prompt = __commonJS({
537
537
  }
538
538
  });
539
539
 
540
- // ../../node_modules/prompts/dist/elements/text.js
540
+ // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/text.js
541
541
  var require_text = __commonJS({
542
- "../../node_modules/prompts/dist/elements/text.js"(exports2, module2) {
542
+ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/text.js"(exports2, module2) {
543
543
  "use strict";
544
544
  init_cjs_shims();
545
545
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
@@ -754,9 +754,9 @@ ${i ? " " : figures.pointerSmall} ${color.red().italic(l)}`, ``);
754
754
  }
755
755
  });
756
756
 
757
- // ../../node_modules/prompts/dist/elements/select.js
757
+ // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/select.js
758
758
  var require_select = __commonJS({
759
- "../../node_modules/prompts/dist/elements/select.js"(exports2, module2) {
759
+ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/select.js"(exports2, module2) {
760
760
  "use strict";
761
761
  init_cjs_shims();
762
762
  var color = require_kleur();
@@ -903,9 +903,9 @@ var require_select = __commonJS({
903
903
  }
904
904
  });
905
905
 
906
- // ../../node_modules/prompts/dist/elements/toggle.js
906
+ // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/toggle.js
907
907
  var require_toggle = __commonJS({
908
- "../../node_modules/prompts/dist/elements/toggle.js"(exports2, module2) {
908
+ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/toggle.js"(exports2, module2) {
909
909
  "use strict";
910
910
  init_cjs_shims();
911
911
  var color = require_kleur();
@@ -1002,9 +1002,9 @@ var require_toggle = __commonJS({
1002
1002
  }
1003
1003
  });
1004
1004
 
1005
- // ../../node_modules/prompts/dist/dateparts/datepart.js
1005
+ // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/datepart.js
1006
1006
  var require_datepart = __commonJS({
1007
- "../../node_modules/prompts/dist/dateparts/datepart.js"(exports2, module2) {
1007
+ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/datepart.js"(exports2, module2) {
1008
1008
  "use strict";
1009
1009
  init_cjs_shims();
1010
1010
  var DatePart = class _DatePart {
@@ -1042,9 +1042,9 @@ var require_datepart = __commonJS({
1042
1042
  }
1043
1043
  });
1044
1044
 
1045
- // ../../node_modules/prompts/dist/dateparts/meridiem.js
1045
+ // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/meridiem.js
1046
1046
  var require_meridiem = __commonJS({
1047
- "../../node_modules/prompts/dist/dateparts/meridiem.js"(exports2, module2) {
1047
+ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/meridiem.js"(exports2, module2) {
1048
1048
  "use strict";
1049
1049
  init_cjs_shims();
1050
1050
  var DatePart = require_datepart();
@@ -1067,9 +1067,9 @@ var require_meridiem = __commonJS({
1067
1067
  }
1068
1068
  });
1069
1069
 
1070
- // ../../node_modules/prompts/dist/dateparts/day.js
1070
+ // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/day.js
1071
1071
  var require_day = __commonJS({
1072
- "../../node_modules/prompts/dist/dateparts/day.js"(exports2, module2) {
1072
+ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/day.js"(exports2, module2) {
1073
1073
  "use strict";
1074
1074
  init_cjs_shims();
1075
1075
  var DatePart = require_datepart();
@@ -1100,9 +1100,9 @@ var require_day = __commonJS({
1100
1100
  }
1101
1101
  });
1102
1102
 
1103
- // ../../node_modules/prompts/dist/dateparts/hours.js
1103
+ // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/hours.js
1104
1104
  var require_hours = __commonJS({
1105
- "../../node_modules/prompts/dist/dateparts/hours.js"(exports2, module2) {
1105
+ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/hours.js"(exports2, module2) {
1106
1106
  "use strict";
1107
1107
  init_cjs_shims();
1108
1108
  var DatePart = require_datepart();
@@ -1129,9 +1129,9 @@ var require_hours = __commonJS({
1129
1129
  }
1130
1130
  });
1131
1131
 
1132
- // ../../node_modules/prompts/dist/dateparts/milliseconds.js
1132
+ // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/milliseconds.js
1133
1133
  var require_milliseconds = __commonJS({
1134
- "../../node_modules/prompts/dist/dateparts/milliseconds.js"(exports2, module2) {
1134
+ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/milliseconds.js"(exports2, module2) {
1135
1135
  "use strict";
1136
1136
  init_cjs_shims();
1137
1137
  var DatePart = require_datepart();
@@ -1156,9 +1156,9 @@ var require_milliseconds = __commonJS({
1156
1156
  }
1157
1157
  });
1158
1158
 
1159
- // ../../node_modules/prompts/dist/dateparts/minutes.js
1159
+ // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/minutes.js
1160
1160
  var require_minutes = __commonJS({
1161
- "../../node_modules/prompts/dist/dateparts/minutes.js"(exports2, module2) {
1161
+ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/minutes.js"(exports2, module2) {
1162
1162
  "use strict";
1163
1163
  init_cjs_shims();
1164
1164
  var DatePart = require_datepart();
@@ -1184,9 +1184,9 @@ var require_minutes = __commonJS({
1184
1184
  }
1185
1185
  });
1186
1186
 
1187
- // ../../node_modules/prompts/dist/dateparts/month.js
1187
+ // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/month.js
1188
1188
  var require_month = __commonJS({
1189
- "../../node_modules/prompts/dist/dateparts/month.js"(exports2, module2) {
1189
+ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/month.js"(exports2, module2) {
1190
1190
  "use strict";
1191
1191
  init_cjs_shims();
1192
1192
  var DatePart = require_datepart();
@@ -1214,9 +1214,9 @@ var require_month = __commonJS({
1214
1214
  }
1215
1215
  });
1216
1216
 
1217
- // ../../node_modules/prompts/dist/dateparts/seconds.js
1217
+ // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/seconds.js
1218
1218
  var require_seconds = __commonJS({
1219
- "../../node_modules/prompts/dist/dateparts/seconds.js"(exports2, module2) {
1219
+ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/seconds.js"(exports2, module2) {
1220
1220
  "use strict";
1221
1221
  init_cjs_shims();
1222
1222
  var DatePart = require_datepart();
@@ -1242,9 +1242,9 @@ var require_seconds = __commonJS({
1242
1242
  }
1243
1243
  });
1244
1244
 
1245
- // ../../node_modules/prompts/dist/dateparts/year.js
1245
+ // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/year.js
1246
1246
  var require_year = __commonJS({
1247
- "../../node_modules/prompts/dist/dateparts/year.js"(exports2, module2) {
1247
+ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/year.js"(exports2, module2) {
1248
1248
  "use strict";
1249
1249
  init_cjs_shims();
1250
1250
  var DatePart = require_datepart();
@@ -1270,9 +1270,9 @@ var require_year = __commonJS({
1270
1270
  }
1271
1271
  });
1272
1272
 
1273
- // ../../node_modules/prompts/dist/dateparts/index.js
1273
+ // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/index.js
1274
1274
  var require_dateparts = __commonJS({
1275
- "../../node_modules/prompts/dist/dateparts/index.js"(exports2, module2) {
1275
+ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/index.js"(exports2, module2) {
1276
1276
  "use strict";
1277
1277
  init_cjs_shims();
1278
1278
  module2.exports = {
@@ -1289,9 +1289,9 @@ var require_dateparts = __commonJS({
1289
1289
  }
1290
1290
  });
1291
1291
 
1292
- // ../../node_modules/prompts/dist/elements/date.js
1292
+ // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/date.js
1293
1293
  var require_date = __commonJS({
1294
- "../../node_modules/prompts/dist/elements/date.js"(exports2, module2) {
1294
+ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/date.js"(exports2, module2) {
1295
1295
  "use strict";
1296
1296
  init_cjs_shims();
1297
1297
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
@@ -1516,9 +1516,9 @@ ${i ? ` ` : figures.pointerSmall} ${color.red().italic(l)}`, ``);
1516
1516
  }
1517
1517
  });
1518
1518
 
1519
- // ../../node_modules/prompts/dist/elements/number.js
1519
+ // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/number.js
1520
1520
  var require_number = __commonJS({
1521
- "../../node_modules/prompts/dist/elements/number.js"(exports2, module2) {
1521
+ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/number.js"(exports2, module2) {
1522
1522
  "use strict";
1523
1523
  init_cjs_shims();
1524
1524
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
@@ -1732,9 +1732,9 @@ ${i ? ` ` : figures.pointerSmall} ${color.red().italic(l)}`, ``);
1732
1732
  }
1733
1733
  });
1734
1734
 
1735
- // ../../node_modules/prompts/dist/elements/multiselect.js
1735
+ // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/multiselect.js
1736
1736
  var require_multiselect = __commonJS({
1737
- "../../node_modules/prompts/dist/elements/multiselect.js"(exports2, module2) {
1737
+ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/multiselect.js"(exports2, module2) {
1738
1738
  "use strict";
1739
1739
  init_cjs_shims();
1740
1740
  var color = require_kleur();
@@ -1964,9 +1964,9 @@ Instructions:
1964
1964
  }
1965
1965
  });
1966
1966
 
1967
- // ../../node_modules/prompts/dist/elements/autocomplete.js
1967
+ // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/autocomplete.js
1968
1968
  var require_autocomplete = __commonJS({
1969
- "../../node_modules/prompts/dist/elements/autocomplete.js"(exports2, module2) {
1969
+ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/autocomplete.js"(exports2, module2) {
1970
1970
  "use strict";
1971
1971
  init_cjs_shims();
1972
1972
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
@@ -2220,9 +2220,9 @@ var require_autocomplete = __commonJS({
2220
2220
  }
2221
2221
  });
2222
2222
 
2223
- // ../../node_modules/prompts/dist/elements/autocompleteMultiselect.js
2223
+ // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/autocompleteMultiselect.js
2224
2224
  var require_autocompleteMultiselect = __commonJS({
2225
- "../../node_modules/prompts/dist/elements/autocompleteMultiselect.js"(exports2, module2) {
2225
+ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/autocompleteMultiselect.js"(exports2, module2) {
2226
2226
  "use strict";
2227
2227
  init_cjs_shims();
2228
2228
  var color = require_kleur();
@@ -2380,9 +2380,9 @@ Filtered results for: ${this.inputValue ? this.inputValue : color.gray("Enter so
2380
2380
  }
2381
2381
  });
2382
2382
 
2383
- // ../../node_modules/prompts/dist/elements/confirm.js
2383
+ // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/confirm.js
2384
2384
  var require_confirm = __commonJS({
2385
- "../../node_modules/prompts/dist/elements/confirm.js"(exports2, module2) {
2385
+ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/confirm.js"(exports2, module2) {
2386
2386
  "use strict";
2387
2387
  init_cjs_shims();
2388
2388
  var color = require_kleur();
@@ -2453,9 +2453,9 @@ var require_confirm = __commonJS({
2453
2453
  }
2454
2454
  });
2455
2455
 
2456
- // ../../node_modules/prompts/dist/elements/index.js
2456
+ // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/index.js
2457
2457
  var require_elements = __commonJS({
2458
- "../../node_modules/prompts/dist/elements/index.js"(exports2, module2) {
2458
+ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/index.js"(exports2, module2) {
2459
2459
  "use strict";
2460
2460
  init_cjs_shims();
2461
2461
  module2.exports = {
@@ -2472,9 +2472,9 @@ var require_elements = __commonJS({
2472
2472
  }
2473
2473
  });
2474
2474
 
2475
- // ../../node_modules/prompts/dist/prompts.js
2475
+ // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/prompts.js
2476
2476
  var require_prompts = __commonJS({
2477
- "../../node_modules/prompts/dist/prompts.js"(exports2) {
2477
+ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/prompts.js"(exports2) {
2478
2478
  "use strict";
2479
2479
  init_cjs_shims();
2480
2480
  var $ = exports2;
@@ -2537,9 +2537,9 @@ var require_prompts = __commonJS({
2537
2537
  }
2538
2538
  });
2539
2539
 
2540
- // ../../node_modules/prompts/dist/index.js
2540
+ // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/index.js
2541
2541
  var require_dist = __commonJS({
2542
- "../../node_modules/prompts/dist/index.js"(exports2, module2) {
2542
+ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/index.js"(exports2, module2) {
2543
2543
  "use strict";
2544
2544
  init_cjs_shims();
2545
2545
  function ownKeys(object, enumerableOnly) {
@@ -2758,9 +2758,9 @@ var require_dist = __commonJS({
2758
2758
  }
2759
2759
  });
2760
2760
 
2761
- // ../../node_modules/prompts/lib/util/action.js
2761
+ // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/action.js
2762
2762
  var require_action2 = __commonJS({
2763
- "../../node_modules/prompts/lib/util/action.js"(exports2, module2) {
2763
+ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/action.js"(exports2, module2) {
2764
2764
  "use strict";
2765
2765
  init_cjs_shims();
2766
2766
  module2.exports = (key, isSelect) => {
@@ -2796,9 +2796,9 @@ var require_action2 = __commonJS({
2796
2796
  }
2797
2797
  });
2798
2798
 
2799
- // ../../node_modules/prompts/lib/util/strip.js
2799
+ // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/strip.js
2800
2800
  var require_strip2 = __commonJS({
2801
- "../../node_modules/prompts/lib/util/strip.js"(exports2, module2) {
2801
+ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/strip.js"(exports2, module2) {
2802
2802
  "use strict";
2803
2803
  init_cjs_shims();
2804
2804
  module2.exports = (str) => {
@@ -2812,9 +2812,9 @@ var require_strip2 = __commonJS({
2812
2812
  }
2813
2813
  });
2814
2814
 
2815
- // ../../node_modules/prompts/lib/util/clear.js
2815
+ // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/clear.js
2816
2816
  var require_clear2 = __commonJS({
2817
- "../../node_modules/prompts/lib/util/clear.js"(exports2, module2) {
2817
+ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/clear.js"(exports2, module2) {
2818
2818
  "use strict";
2819
2819
  init_cjs_shims();
2820
2820
  var strip = require_strip2();
@@ -2832,9 +2832,9 @@ var require_clear2 = __commonJS({
2832
2832
  }
2833
2833
  });
2834
2834
 
2835
- // ../../node_modules/prompts/lib/util/figures.js
2835
+ // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/figures.js
2836
2836
  var require_figures2 = __commonJS({
2837
- "../../node_modules/prompts/lib/util/figures.js"(exports2, module2) {
2837
+ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/figures.js"(exports2, module2) {
2838
2838
  "use strict";
2839
2839
  init_cjs_shims();
2840
2840
  var main = {
@@ -2870,9 +2870,9 @@ var require_figures2 = __commonJS({
2870
2870
  }
2871
2871
  });
2872
2872
 
2873
- // ../../node_modules/prompts/lib/util/style.js
2873
+ // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/style.js
2874
2874
  var require_style2 = __commonJS({
2875
- "../../node_modules/prompts/lib/util/style.js"(exports2, module2) {
2875
+ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/style.js"(exports2, module2) {
2876
2876
  "use strict";
2877
2877
  init_cjs_shims();
2878
2878
  var c = require_kleur();
@@ -2904,9 +2904,9 @@ var require_style2 = __commonJS({
2904
2904
  }
2905
2905
  });
2906
2906
 
2907
- // ../../node_modules/prompts/lib/util/lines.js
2907
+ // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/lines.js
2908
2908
  var require_lines2 = __commonJS({
2909
- "../../node_modules/prompts/lib/util/lines.js"(exports2, module2) {
2909
+ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/lines.js"(exports2, module2) {
2910
2910
  "use strict";
2911
2911
  init_cjs_shims();
2912
2912
  var strip = require_strip2();
@@ -2918,9 +2918,9 @@ var require_lines2 = __commonJS({
2918
2918
  }
2919
2919
  });
2920
2920
 
2921
- // ../../node_modules/prompts/lib/util/wrap.js
2921
+ // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/wrap.js
2922
2922
  var require_wrap2 = __commonJS({
2923
- "../../node_modules/prompts/lib/util/wrap.js"(exports2, module2) {
2923
+ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/wrap.js"(exports2, module2) {
2924
2924
  "use strict";
2925
2925
  init_cjs_shims();
2926
2926
  module2.exports = (msg, opts = {}) => {
@@ -2936,9 +2936,9 @@ var require_wrap2 = __commonJS({
2936
2936
  }
2937
2937
  });
2938
2938
 
2939
- // ../../node_modules/prompts/lib/util/entriesToDisplay.js
2939
+ // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/entriesToDisplay.js
2940
2940
  var require_entriesToDisplay2 = __commonJS({
2941
- "../../node_modules/prompts/lib/util/entriesToDisplay.js"(exports2, module2) {
2941
+ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/entriesToDisplay.js"(exports2, module2) {
2942
2942
  "use strict";
2943
2943
  init_cjs_shims();
2944
2944
  module2.exports = (cursor, total, maxVisible) => {
@@ -2951,9 +2951,9 @@ var require_entriesToDisplay2 = __commonJS({
2951
2951
  }
2952
2952
  });
2953
2953
 
2954
- // ../../node_modules/prompts/lib/util/index.js
2954
+ // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/index.js
2955
2955
  var require_util2 = __commonJS({
2956
- "../../node_modules/prompts/lib/util/index.js"(exports2, module2) {
2956
+ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/index.js"(exports2, module2) {
2957
2957
  "use strict";
2958
2958
  init_cjs_shims();
2959
2959
  module2.exports = {
@@ -2969,9 +2969,9 @@ var require_util2 = __commonJS({
2969
2969
  }
2970
2970
  });
2971
2971
 
2972
- // ../../node_modules/prompts/lib/elements/prompt.js
2972
+ // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/prompt.js
2973
2973
  var require_prompt2 = __commonJS({
2974
- "../../node_modules/prompts/lib/elements/prompt.js"(exports2, module2) {
2974
+ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/prompt.js"(exports2, module2) {
2975
2975
  "use strict";
2976
2976
  init_cjs_shims();
2977
2977
  var readline = require("readline");
@@ -3029,9 +3029,9 @@ var require_prompt2 = __commonJS({
3029
3029
  }
3030
3030
  });
3031
3031
 
3032
- // ../../node_modules/prompts/lib/elements/text.js
3032
+ // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/text.js
3033
3033
  var require_text2 = __commonJS({
3034
- "../../node_modules/prompts/lib/elements/text.js"(exports2, module2) {
3034
+ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/text.js"(exports2, module2) {
3035
3035
  "use strict";
3036
3036
  init_cjs_shims();
3037
3037
  var color = require_kleur();
@@ -3211,9 +3211,9 @@ ${i ? " " : figures.pointerSmall} ${color.red().italic(l)}`, ``);
3211
3211
  }
3212
3212
  });
3213
3213
 
3214
- // ../../node_modules/prompts/lib/elements/select.js
3214
+ // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/select.js
3215
3215
  var require_select2 = __commonJS({
3216
- "../../node_modules/prompts/lib/elements/select.js"(exports2, module2) {
3216
+ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/select.js"(exports2, module2) {
3217
3217
  "use strict";
3218
3218
  init_cjs_shims();
3219
3219
  var color = require_kleur();
@@ -3355,9 +3355,9 @@ var require_select2 = __commonJS({
3355
3355
  }
3356
3356
  });
3357
3357
 
3358
- // ../../node_modules/prompts/lib/elements/toggle.js
3358
+ // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/toggle.js
3359
3359
  var require_toggle2 = __commonJS({
3360
- "../../node_modules/prompts/lib/elements/toggle.js"(exports2, module2) {
3360
+ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/toggle.js"(exports2, module2) {
3361
3361
  "use strict";
3362
3362
  init_cjs_shims();
3363
3363
  var color = require_kleur();
@@ -3457,9 +3457,9 @@ var require_toggle2 = __commonJS({
3457
3457
  }
3458
3458
  });
3459
3459
 
3460
- // ../../node_modules/prompts/lib/dateparts/datepart.js
3460
+ // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/datepart.js
3461
3461
  var require_datepart2 = __commonJS({
3462
- "../../node_modules/prompts/lib/dateparts/datepart.js"(exports2, module2) {
3462
+ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/datepart.js"(exports2, module2) {
3463
3463
  "use strict";
3464
3464
  init_cjs_shims();
3465
3465
  var DatePart = class _DatePart {
@@ -3492,9 +3492,9 @@ var require_datepart2 = __commonJS({
3492
3492
  }
3493
3493
  });
3494
3494
 
3495
- // ../../node_modules/prompts/lib/dateparts/meridiem.js
3495
+ // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/meridiem.js
3496
3496
  var require_meridiem2 = __commonJS({
3497
- "../../node_modules/prompts/lib/dateparts/meridiem.js"(exports2, module2) {
3497
+ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/meridiem.js"(exports2, module2) {
3498
3498
  "use strict";
3499
3499
  init_cjs_shims();
3500
3500
  var DatePart = require_datepart2();
@@ -3517,9 +3517,9 @@ var require_meridiem2 = __commonJS({
3517
3517
  }
3518
3518
  });
3519
3519
 
3520
- // ../../node_modules/prompts/lib/dateparts/day.js
3520
+ // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/day.js
3521
3521
  var require_day2 = __commonJS({
3522
- "../../node_modules/prompts/lib/dateparts/day.js"(exports2, module2) {
3522
+ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/day.js"(exports2, module2) {
3523
3523
  "use strict";
3524
3524
  init_cjs_shims();
3525
3525
  var DatePart = require_datepart2();
@@ -3550,9 +3550,9 @@ var require_day2 = __commonJS({
3550
3550
  }
3551
3551
  });
3552
3552
 
3553
- // ../../node_modules/prompts/lib/dateparts/hours.js
3553
+ // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/hours.js
3554
3554
  var require_hours2 = __commonJS({
3555
- "../../node_modules/prompts/lib/dateparts/hours.js"(exports2, module2) {
3555
+ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/hours.js"(exports2, module2) {
3556
3556
  "use strict";
3557
3557
  init_cjs_shims();
3558
3558
  var DatePart = require_datepart2();
@@ -3580,9 +3580,9 @@ var require_hours2 = __commonJS({
3580
3580
  }
3581
3581
  });
3582
3582
 
3583
- // ../../node_modules/prompts/lib/dateparts/milliseconds.js
3583
+ // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/milliseconds.js
3584
3584
  var require_milliseconds2 = __commonJS({
3585
- "../../node_modules/prompts/lib/dateparts/milliseconds.js"(exports2, module2) {
3585
+ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/milliseconds.js"(exports2, module2) {
3586
3586
  "use strict";
3587
3587
  init_cjs_shims();
3588
3588
  var DatePart = require_datepart2();
@@ -3607,9 +3607,9 @@ var require_milliseconds2 = __commonJS({
3607
3607
  }
3608
3608
  });
3609
3609
 
3610
- // ../../node_modules/prompts/lib/dateparts/minutes.js
3610
+ // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/minutes.js
3611
3611
  var require_minutes2 = __commonJS({
3612
- "../../node_modules/prompts/lib/dateparts/minutes.js"(exports2, module2) {
3612
+ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/minutes.js"(exports2, module2) {
3613
3613
  "use strict";
3614
3614
  init_cjs_shims();
3615
3615
  var DatePart = require_datepart2();
@@ -3635,9 +3635,9 @@ var require_minutes2 = __commonJS({
3635
3635
  }
3636
3636
  });
3637
3637
 
3638
- // ../../node_modules/prompts/lib/dateparts/month.js
3638
+ // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/month.js
3639
3639
  var require_month2 = __commonJS({
3640
- "../../node_modules/prompts/lib/dateparts/month.js"(exports2, module2) {
3640
+ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/month.js"(exports2, module2) {
3641
3641
  "use strict";
3642
3642
  init_cjs_shims();
3643
3643
  var DatePart = require_datepart2();
@@ -3665,9 +3665,9 @@ var require_month2 = __commonJS({
3665
3665
  }
3666
3666
  });
3667
3667
 
3668
- // ../../node_modules/prompts/lib/dateparts/seconds.js
3668
+ // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/seconds.js
3669
3669
  var require_seconds2 = __commonJS({
3670
- "../../node_modules/prompts/lib/dateparts/seconds.js"(exports2, module2) {
3670
+ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/seconds.js"(exports2, module2) {
3671
3671
  "use strict";
3672
3672
  init_cjs_shims();
3673
3673
  var DatePart = require_datepart2();
@@ -3693,9 +3693,9 @@ var require_seconds2 = __commonJS({
3693
3693
  }
3694
3694
  });
3695
3695
 
3696
- // ../../node_modules/prompts/lib/dateparts/year.js
3696
+ // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/year.js
3697
3697
  var require_year2 = __commonJS({
3698
- "../../node_modules/prompts/lib/dateparts/year.js"(exports2, module2) {
3698
+ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/year.js"(exports2, module2) {
3699
3699
  "use strict";
3700
3700
  init_cjs_shims();
3701
3701
  var DatePart = require_datepart2();
@@ -3721,9 +3721,9 @@ var require_year2 = __commonJS({
3721
3721
  }
3722
3722
  });
3723
3723
 
3724
- // ../../node_modules/prompts/lib/dateparts/index.js
3724
+ // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/index.js
3725
3725
  var require_dateparts2 = __commonJS({
3726
- "../../node_modules/prompts/lib/dateparts/index.js"(exports2, module2) {
3726
+ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/index.js"(exports2, module2) {
3727
3727
  "use strict";
3728
3728
  init_cjs_shims();
3729
3729
  module2.exports = {
@@ -3740,9 +3740,9 @@ var require_dateparts2 = __commonJS({
3740
3740
  }
3741
3741
  });
3742
3742
 
3743
- // ../../node_modules/prompts/lib/elements/date.js
3743
+ // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/date.js
3744
3744
  var require_date2 = __commonJS({
3745
- "../../node_modules/prompts/lib/elements/date.js"(exports2, module2) {
3745
+ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/date.js"(exports2, module2) {
3746
3746
  "use strict";
3747
3747
  init_cjs_shims();
3748
3748
  var color = require_kleur();
@@ -3920,9 +3920,9 @@ ${i ? ` ` : figures.pointerSmall} ${color.red().italic(l)}`,
3920
3920
  }
3921
3921
  });
3922
3922
 
3923
- // ../../node_modules/prompts/lib/elements/number.js
3923
+ // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/number.js
3924
3924
  var require_number2 = __commonJS({
3925
- "../../node_modules/prompts/lib/elements/number.js"(exports2, module2) {
3925
+ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/number.js"(exports2, module2) {
3926
3926
  "use strict";
3927
3927
  init_cjs_shims();
3928
3928
  var color = require_kleur();
@@ -4101,9 +4101,9 @@ ${i ? ` ` : figures.pointerSmall} ${color.red().italic(l)}`, ``);
4101
4101
  }
4102
4102
  });
4103
4103
 
4104
- // ../../node_modules/prompts/lib/elements/multiselect.js
4104
+ // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/multiselect.js
4105
4105
  var require_multiselect2 = __commonJS({
4106
- "../../node_modules/prompts/lib/elements/multiselect.js"(exports2, module2) {
4106
+ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/multiselect.js"(exports2, module2) {
4107
4107
  "use strict";
4108
4108
  init_cjs_shims();
4109
4109
  var color = require_kleur();
@@ -4327,9 +4327,9 @@ Instructions:
4327
4327
  }
4328
4328
  });
4329
4329
 
4330
- // ../../node_modules/prompts/lib/elements/autocomplete.js
4330
+ // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/autocomplete.js
4331
4331
  var require_autocomplete2 = __commonJS({
4332
- "../../node_modules/prompts/lib/elements/autocomplete.js"(exports2, module2) {
4332
+ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/autocomplete.js"(exports2, module2) {
4333
4333
  "use strict";
4334
4334
  init_cjs_shims();
4335
4335
  var color = require_kleur();
@@ -4544,9 +4544,9 @@ var require_autocomplete2 = __commonJS({
4544
4544
  }
4545
4545
  });
4546
4546
 
4547
- // ../../node_modules/prompts/lib/elements/autocompleteMultiselect.js
4547
+ // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/autocompleteMultiselect.js
4548
4548
  var require_autocompleteMultiselect2 = __commonJS({
4549
- "../../node_modules/prompts/lib/elements/autocompleteMultiselect.js"(exports2, module2) {
4549
+ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/autocompleteMultiselect.js"(exports2, module2) {
4550
4550
  "use strict";
4551
4551
  init_cjs_shims();
4552
4552
  var color = require_kleur();
@@ -4705,9 +4705,9 @@ Filtered results for: ${this.inputValue ? this.inputValue : color.gray("Enter so
4705
4705
  }
4706
4706
  });
4707
4707
 
4708
- // ../../node_modules/prompts/lib/elements/confirm.js
4708
+ // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/confirm.js
4709
4709
  var require_confirm2 = __commonJS({
4710
- "../../node_modules/prompts/lib/elements/confirm.js"(exports2, module2) {
4710
+ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/confirm.js"(exports2, module2) {
4711
4711
  "use strict";
4712
4712
  init_cjs_shims();
4713
4713
  var color = require_kleur();
@@ -4779,9 +4779,9 @@ var require_confirm2 = __commonJS({
4779
4779
  }
4780
4780
  });
4781
4781
 
4782
- // ../../node_modules/prompts/lib/elements/index.js
4782
+ // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/index.js
4783
4783
  var require_elements2 = __commonJS({
4784
- "../../node_modules/prompts/lib/elements/index.js"(exports2, module2) {
4784
+ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/index.js"(exports2, module2) {
4785
4785
  "use strict";
4786
4786
  init_cjs_shims();
4787
4787
  module2.exports = {
@@ -4798,9 +4798,9 @@ var require_elements2 = __commonJS({
4798
4798
  }
4799
4799
  });
4800
4800
 
4801
- // ../../node_modules/prompts/lib/prompts.js
4801
+ // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/prompts.js
4802
4802
  var require_prompts2 = __commonJS({
4803
- "../../node_modules/prompts/lib/prompts.js"(exports2) {
4803
+ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/prompts.js"(exports2) {
4804
4804
  "use strict";
4805
4805
  init_cjs_shims();
4806
4806
  var $ = exports2;
@@ -4865,9 +4865,9 @@ var require_prompts2 = __commonJS({
4865
4865
  }
4866
4866
  });
4867
4867
 
4868
- // ../../node_modules/prompts/lib/index.js
4868
+ // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/index.js
4869
4869
  var require_lib = __commonJS({
4870
- "../../node_modules/prompts/lib/index.js"(exports2, module2) {
4870
+ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/index.js"(exports2, module2) {
4871
4871
  "use strict";
4872
4872
  init_cjs_shims();
4873
4873
  var prompts2 = require_prompts2();
@@ -4940,9 +4940,9 @@ var require_lib = __commonJS({
4940
4940
  }
4941
4941
  });
4942
4942
 
4943
- // ../../node_modules/prompts/index.js
4943
+ // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/index.js
4944
4944
  var require_prompts3 = __commonJS({
4945
- "../../node_modules/prompts/index.js"(exports2, module2) {
4945
+ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/index.js"(exports2, module2) {
4946
4946
  "use strict";
4947
4947
  init_cjs_shims();
4948
4948
  function isNodeLT(tar) {
@@ -4961,237 +4961,24 @@ var require_prompts3 = __commonJS({
4961
4961
  // src/cli.ts
4962
4962
  init_cjs_shims();
4963
4963
  var import_node_fs2 = require("fs");
4964
- var import_node_path2 = require("path");
4964
+ var import_openapi_core8 = require("@cerios/openapi-core");
4965
4965
  var import_commander = require("commander");
4966
4966
  var import_prompts = __toESM(require_prompts3());
4967
4967
 
4968
- // src/batch-executor.ts
4969
- init_cjs_shims();
4970
-
4971
- // src/errors.ts
4972
- init_cjs_shims();
4973
- var GeneratorError = class extends Error {
4974
- constructor(message, code, context) {
4975
- var _a;
4976
- super(message);
4977
- this.code = code;
4978
- this.context = context;
4979
- this.name = "GeneratorError";
4980
- (_a = Error.captureStackTrace) == null ? void 0 : _a.call(Error, this, this.constructor);
4981
- }
4982
- };
4983
- var SpecValidationError = class extends GeneratorError {
4984
- constructor(message, context) {
4985
- super(message, "SPEC_VALIDATION_ERROR", context);
4986
- this.name = "SpecValidationError";
4987
- }
4988
- };
4989
- var FileOperationError = class extends GeneratorError {
4990
- constructor(message, filePath, context) {
4991
- super(message, "FILE_OPERATION_ERROR", { ...context, filePath });
4992
- this.filePath = filePath;
4993
- this.name = "FileOperationError";
4994
- }
4995
- };
4996
- var SchemaGenerationError = class extends GeneratorError {
4997
- constructor(message, schemaName, context) {
4998
- super(message, "SCHEMA_GENERATION_ERROR", { ...context, schemaName });
4999
- this.schemaName = schemaName;
5000
- this.name = "SchemaGenerationError";
5001
- }
5002
- };
5003
- var CliOptionsError = class extends GeneratorError {
5004
- constructor(message, context) {
5005
- super(message, "CLI_OPTIONS_ERROR", context);
5006
- this.name = "CliOptionsError";
5007
- }
5008
- };
5009
- var ConfigurationError = class extends GeneratorError {
5010
- constructor(message, context) {
5011
- super(message, "CONFIGURATION_ERROR", context);
5012
- this.name = "ConfigurationError";
5013
- }
5014
- };
5015
-
5016
- // src/batch-executor.ts
5017
- async function processSpec(spec, index, total, createGenerator) {
5018
- const specInput = spec.input || "spec";
5019
- const specOutput = spec.output || "output";
5020
- console.log(`Processing [${index + 1}/${total}] ${specInput}...`);
5021
- try {
5022
- const generator = createGenerator(spec);
5023
- generator.generate();
5024
- return {
5025
- spec,
5026
- success: true
5027
- };
5028
- } catch (error) {
5029
- const errorMessage = error instanceof Error ? error.message : String(error);
5030
- console.error(`\u2717 Failed to generate ${specOutput}: ${errorMessage}`);
5031
- return {
5032
- spec,
5033
- success: false,
5034
- error: errorMessage
5035
- };
5036
- }
5037
- }
5038
- async function executeParallel(specs, createGenerator, batchSize) {
5039
- console.log(`
5040
- Executing ${specs.length} specification(s) in parallel (batch size: ${batchSize})...
5041
- `);
5042
- const results = [];
5043
- for (let i = 0; i < specs.length; i += batchSize) {
5044
- const batch = specs.slice(i, Math.min(i + batchSize, specs.length));
5045
- const batchPromises = batch.map(
5046
- (spec, batchIndex) => processSpec(spec, i + batchIndex, specs.length, createGenerator)
5047
- );
5048
- const batchResults = await Promise.allSettled(batchPromises);
5049
- for (let j = 0; j < batchResults.length; j++) {
5050
- const result = batchResults[j];
5051
- if (result.status === "fulfilled") {
5052
- results.push(result.value);
5053
- } else {
5054
- results.push({
5055
- spec: batch[j],
5056
- success: false,
5057
- error: result.reason instanceof Error ? result.reason.message : String(result.reason)
5058
- });
5059
- }
5060
- }
5061
- }
5062
- return results;
5063
- }
5064
- async function executeSequential(specs, createGenerator) {
5065
- console.log(`
5066
- Executing ${specs.length} spec(s) sequentially...
5067
- `);
5068
- const results = [];
5069
- for (let i = 0; i < specs.length; i++) {
5070
- const result = await processSpec(specs[i], i, specs.length, createGenerator);
5071
- results.push(result);
5072
- }
5073
- return results;
5074
- }
5075
- function printSummary(summary) {
5076
- console.log(`
5077
- ${"=".repeat(50)}`);
5078
- console.log("Batch Execution Summary");
5079
- console.log("=".repeat(50));
5080
- console.log(`Total specs: ${summary.total}`);
5081
- console.log(`Successful: ${summary.successful}`);
5082
- console.log(`Failed: ${summary.failed}`);
5083
- if (summary.failed > 0) {
5084
- console.log("\nFailed specs:");
5085
- for (const result of summary.results) {
5086
- if (!result.success) {
5087
- const specInput = result.spec.input || "spec";
5088
- console.error(` \u2717 ${specInput}`);
5089
- console.error(` Error: ${result.error}`);
5090
- }
5091
- }
5092
- }
5093
- console.log(`${"=".repeat(50)}
5094
- `);
5095
- }
5096
- async function executeBatch(specs, executionMode = "parallel", createGenerator, batchSize) {
5097
- if (specs.length === 0) {
5098
- throw new ConfigurationError("No specs provided for batch execution", { specsCount: 0, executionMode });
5099
- }
5100
- let results = [];
5101
- try {
5102
- results = executionMode === "parallel" ? await executeParallel(specs, createGenerator, batchSize) : await executeSequential(specs, createGenerator);
5103
- const summary = {
5104
- total: results.length,
5105
- successful: results.filter((r) => r.success).length,
5106
- failed: results.filter((r) => !r.success).length,
5107
- results
5108
- };
5109
- printSummary(summary);
5110
- return summary;
5111
- } finally {
5112
- if (results.length > batchSize) {
5113
- for (const result of results) {
5114
- if (result.spec) {
5115
- result.spec = null;
5116
- }
5117
- }
5118
- if (global.gc) {
5119
- global.gc();
5120
- }
5121
- }
5122
- }
5123
- }
5124
- function getBatchExitCode(summary) {
5125
- return summary.failed > 0 ? 1 : 0;
5126
- }
5127
-
5128
4968
  // src/openapi-generator.ts
5129
4969
  init_cjs_shims();
5130
4970
  var import_node_fs = require("fs");
5131
4971
  var import_node_path = require("path");
5132
- var import_minimatch3 = require("minimatch");
5133
- var import_yaml = require("yaml");
4972
+ var import_openapi_core6 = require("@cerios/openapi-core");
4973
+ var import_openapi_to_typescript = require("@cerios/openapi-to-typescript");
4974
+ var import_minimatch = require("minimatch");
5134
4975
 
5135
4976
  // src/generators/enum-generator.ts
5136
4977
  init_cjs_shims();
5137
-
5138
- // src/utils/name-utils.ts
5139
- init_cjs_shims();
5140
- function sanitizeIdentifier(str) {
5141
- return str.replace(/[^a-zA-Z0-9._\-\s]+/g, "_");
5142
- }
5143
- function toCamelCase(str, options) {
5144
- const sanitized = sanitizeIdentifier(str);
5145
- const words = sanitized.split(/[.\-_\s]+/).filter((word) => word.length > 0);
5146
- let name;
5147
- if (words.length === 0) {
5148
- name = str.charAt(0).toLowerCase() + str.slice(1);
5149
- } else if (words.length === 1) {
5150
- name = words[0].charAt(0).toLowerCase() + words[0].slice(1);
5151
- } else {
5152
- name = words[0].charAt(0).toLowerCase() + words[0].slice(1) + words.slice(1).map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join("");
5153
- }
5154
- if (options == null ? void 0 : options.prefix) {
5155
- const prefix = options.prefix.charAt(0).toLowerCase() + options.prefix.slice(1);
5156
- name = prefix + name.charAt(0).toUpperCase() + name.slice(1);
5157
- }
5158
- if (options == null ? void 0 : options.suffix) {
5159
- const suffix = options.suffix.charAt(0).toUpperCase() + options.suffix.slice(1);
5160
- name = name + suffix;
5161
- }
5162
- return name;
5163
- }
5164
- function toPascalCase(str) {
5165
- const stringValue = String(str);
5166
- const isAlreadyValidCase = /^[a-zA-Z][a-zA-Z0-9]*$/.test(stringValue);
5167
- if (isAlreadyValidCase) {
5168
- return stringValue.charAt(0).toUpperCase() + stringValue.slice(1);
5169
- }
5170
- const sanitized = sanitizeIdentifier(stringValue);
5171
- const words = sanitized.split(/[.\-_\s]+/).filter((word) => word.length > 0);
5172
- let result;
5173
- if (words.length === 0) {
5174
- result = "Value";
5175
- } else {
5176
- result = words.map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join("");
5177
- }
5178
- if (/^\d/.test(result)) {
5179
- result = `N${result}`;
5180
- }
5181
- if (!result || /^_+$/.test(result)) {
5182
- return "Value";
5183
- }
5184
- return result;
5185
- }
5186
- function resolveRef(ref) {
5187
- const parts = ref.split("/");
5188
- return parts[parts.length - 1];
5189
- }
5190
-
5191
- // src/generators/enum-generator.ts
4978
+ var import_openapi_core = require("@cerios/openapi-core");
5192
4979
  function generateEnum(name, values, options) {
5193
- const schemaName = `${toCamelCase(name, options)}Schema`;
5194
- const typeName = toPascalCase(name);
4980
+ const schemaName = `${(0, import_openapi_core.toCamelCase)(name, options)}Schema`;
4981
+ const typeName = (0, import_openapi_core.toPascalCase)(name);
5195
4982
  const allBooleans = values.every((v) => typeof v === "boolean");
5196
4983
  if (allBooleans) {
5197
4984
  const schemaCode2 = `export const ${schemaName} = z.boolean();`;
@@ -5218,54 +5005,7 @@ function generateEnum(name, values, options) {
5218
5005
 
5219
5006
  // src/generators/jsdoc-generator.ts
5220
5007
  init_cjs_shims();
5221
-
5222
- // src/utils/string-utils.ts
5223
- init_cjs_shims();
5224
- function escapeDescription(str) {
5225
- return str.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/\n/g, "\\n");
5226
- }
5227
- function escapePattern(str) {
5228
- return str.replace(/(?<!\\)\//g, "\\/");
5229
- }
5230
- function escapeJSDoc(str) {
5231
- return str.replace(/\*\//g, "*\\/");
5232
- }
5233
- function wrapNullable(validation, isNullable2) {
5234
- return isNullable2 ? `${validation}.nullable()` : validation;
5235
- }
5236
- function isNullable(schema, defaultNullable = false) {
5237
- if (schema.nullable === true) {
5238
- return true;
5239
- }
5240
- if (schema.nullable === false) {
5241
- return false;
5242
- }
5243
- if (Array.isArray(schema.type)) {
5244
- return schema.type.includes("null");
5245
- }
5246
- return defaultNullable;
5247
- }
5248
- function getPrimaryType(schema) {
5249
- if (Array.isArray(schema.type)) {
5250
- const nonNullType = schema.type.find((t) => t !== "null");
5251
- return nonNullType;
5252
- }
5253
- return schema.type;
5254
- }
5255
- function hasMultipleTypes(schema) {
5256
- if (Array.isArray(schema.type)) {
5257
- const nonNullTypes = schema.type.filter((t) => t !== "null");
5258
- return nonNullTypes.length > 1;
5259
- }
5260
- return false;
5261
- }
5262
- function addDescription(validation, description, useDescribe) {
5263
- if (!description || !useDescribe) return validation;
5264
- const escapedDesc = escapeDescription(description);
5265
- return `${validation}.describe("${escapedDesc}")`;
5266
- }
5267
-
5268
- // src/generators/jsdoc-generator.ts
5008
+ var import_openapi_core2 = require("@cerios/openapi-core");
5269
5009
  function generateJSDoc(schema, name, options = { includeDescriptions: true }) {
5270
5010
  if (!schema || typeof schema !== "object") {
5271
5011
  return "";
@@ -5281,12 +5021,10 @@ function generateJSDoc(schema, name, options = { includeDescriptions: true }) {
5281
5021
  }
5282
5022
  const parts = [];
5283
5023
  if (schema.title && typeof schema.title === "string" && (!name || schema.title !== name)) {
5284
- const sanitizedTitle = escapeJSDoc(schema.title).replace(/@/g, "\\@");
5285
- parts.push(sanitizedTitle);
5024
+ parts.push((0, import_openapi_core2.escapeJSDoc)(schema.title));
5286
5025
  }
5287
5026
  if (schema.description && typeof schema.description === "string") {
5288
- const sanitizedDesc = escapeJSDoc(schema.description).replace(/@/g, "\\@").replace(/\*\//g, "*\\/");
5289
- parts.push(sanitizedDesc);
5027
+ parts.push((0, import_openapi_core2.escapeJSDoc)(schema.description));
5290
5028
  }
5291
5029
  if (schema.examples && Array.isArray(schema.examples) && schema.examples.length > 0) {
5292
5030
  try {
@@ -5315,120 +5053,18 @@ function generateJSDoc(schema, name, options = { includeDescriptions: true }) {
5315
5053
 
5316
5054
  // src/generators/property-generator.ts
5317
5055
  init_cjs_shims();
5056
+ var import_openapi_core5 = require("@cerios/openapi-core");
5318
5057
 
5319
- // src/utils/lru-cache.ts
5320
- init_cjs_shims();
5321
- var LRUCache = class {
5322
- constructor(maxSize) {
5323
- this.cache = /* @__PURE__ */ new Map();
5324
- this.maxSize = maxSize;
5325
- }
5326
- get capacity() {
5327
- return this.maxSize;
5328
- }
5329
- get(key) {
5330
- if (!this.cache.has(key)) return void 0;
5331
- const value = this.cache.get(key);
5332
- if (value === void 0) return void 0;
5333
- this.cache.delete(key);
5334
- this.cache.set(key, value);
5335
- return value;
5336
- }
5337
- set(key, value) {
5338
- if (this.cache.has(key)) {
5339
- this.cache.delete(key);
5340
- } else if (this.cache.size >= this.maxSize) {
5341
- const firstKey = this.cache.keys().next().value;
5342
- if (firstKey !== void 0) {
5343
- this.cache.delete(firstKey);
5344
- }
5345
- }
5346
- this.cache.set(key, value);
5347
- }
5348
- has(key) {
5349
- return this.cache.has(key);
5350
- }
5351
- clear() {
5352
- this.cache.clear();
5353
- }
5354
- size() {
5355
- return this.cache.size;
5356
- }
5357
- };
5358
-
5359
- // src/utils/pattern-utils.ts
5058
+ // src/utils/string-utils.ts
5360
5059
  init_cjs_shims();
5361
- var import_minimatch = require("minimatch");
5362
- function isValidGlobPattern(pattern) {
5363
- try {
5364
- new import_minimatch.minimatch.Minimatch(pattern);
5365
- return true;
5366
- } catch {
5367
- return false;
5368
- }
5369
- }
5370
- function isGlobPattern(pattern) {
5371
- return /[*?[\]{}!]/.test(pattern);
5372
- }
5373
- function stripPrefix(input, pattern, ensureLeadingChar) {
5374
- if (!pattern) {
5375
- return input;
5376
- }
5377
- if (isGlobPattern(pattern) && !isValidGlobPattern(pattern)) {
5378
- console.warn(`\u26A0\uFE0F Invalid glob pattern "${pattern}": Pattern is malformed`);
5379
- return input;
5380
- }
5381
- if (isGlobPattern(pattern)) {
5382
- let longestMatch = -1;
5383
- for (let i = 1; i <= input.length; i++) {
5384
- const testPrefix = input.substring(0, i);
5385
- if ((0, import_minimatch.minimatch)(testPrefix, pattern)) {
5386
- longestMatch = i;
5387
- }
5388
- }
5389
- if (longestMatch > 0) {
5390
- const stripped = input.substring(longestMatch);
5391
- if (ensureLeadingChar) {
5392
- if (stripped === "") {
5393
- return ensureLeadingChar;
5394
- }
5395
- if (!stripped.startsWith(ensureLeadingChar)) {
5396
- return `${ensureLeadingChar}${stripped}`;
5397
- }
5398
- }
5399
- return stripped === "" && !ensureLeadingChar ? input : stripped;
5400
- }
5401
- return input;
5402
- }
5403
- if (input.startsWith(pattern)) {
5404
- const stripped = input.substring(pattern.length);
5405
- if (ensureLeadingChar) {
5406
- if (stripped === "") {
5407
- return ensureLeadingChar;
5408
- }
5409
- if (!stripped.startsWith(ensureLeadingChar)) {
5410
- return `${ensureLeadingChar}${stripped}`;
5411
- }
5412
- }
5413
- return stripped;
5414
- }
5415
- return input;
5060
+ var import_openapi_core3 = require("@cerios/openapi-core");
5061
+ function wrapNullable(validation, nullable) {
5062
+ return nullable ? `${validation}.nullable()` : validation;
5416
5063
  }
5417
- function stripPathPrefix(path, pattern) {
5418
- if (!pattern) {
5419
- return path;
5420
- }
5421
- if (!isGlobPattern(pattern)) {
5422
- let normalizedPattern = pattern.trim();
5423
- if (!normalizedPattern.startsWith("/")) {
5424
- normalizedPattern = `/${normalizedPattern}`;
5425
- }
5426
- if (normalizedPattern.endsWith("/") && normalizedPattern !== "/") {
5427
- normalizedPattern = normalizedPattern.slice(0, -1);
5428
- }
5429
- return stripPrefix(path, normalizedPattern, "/");
5430
- }
5431
- return stripPrefix(path, pattern, "/");
5064
+ function addDescription(validation, description, useDescribe) {
5065
+ if (!description || !useDescribe) return validation;
5066
+ const escapedDesc = (0, import_openapi_core3.escapeDescription)(description);
5067
+ return `${validation}.describe("${escapedDesc}")`;
5432
5068
  }
5433
5069
 
5434
5070
  // src/validators/array-validator.ts
@@ -5600,15 +5236,14 @@ function detectConflictingProperties(schemas, context) {
5600
5236
  function generateAllOf(schemas, isNullable2, context, currentSchema) {
5601
5237
  if (schemas.length === 1) {
5602
5238
  const singleSchema = context.generatePropertySchema(schemas[0], currentSchema, false, true);
5603
- return wrapNullable(singleSchema, isNullable2);
5239
+ return { schema: wrapNullable(singleSchema, isNullable2), conflicts: [] };
5604
5240
  }
5605
5241
  const conflicts = detectConflictingProperties(schemas, context);
5606
- let conflictDescription = "";
5607
- if (conflicts.length > 0) {
5608
- for (const conflict of conflicts) {
5242
+ const uniqueConflicts = [...new Set(conflicts)];
5243
+ if (uniqueConflicts.length > 0) {
5244
+ for (const conflict of uniqueConflicts) {
5609
5245
  console.warn(`[openapi-to-zod] Warning: allOf composition conflict - ${conflict}`);
5610
5246
  }
5611
- conflictDescription = `allOf property conflicts detected: ${conflicts.join("; ")}`;
5612
5247
  }
5613
5248
  const allObjects = schemas.every((s) => s.type === "object" || s.properties || s.$ref || s.allOf);
5614
5249
  let result;
@@ -5636,10 +5271,7 @@ function generateAllOf(schemas, isNullable2, context, currentSchema) {
5636
5271
  }
5637
5272
  result = merged;
5638
5273
  }
5639
- if (conflictDescription) {
5640
- result = `${result}.describe("${conflictDescription}")`;
5641
- }
5642
- return wrapNullable(result, isNullable2);
5274
+ return { schema: wrapNullable(result, isNullable2), conflicts: uniqueConflicts };
5643
5275
  }
5644
5276
 
5645
5277
  // src/validators/number-validator.ts
@@ -5726,7 +5358,8 @@ function generateConditionalCheck(schema) {
5726
5358
  for (const [prop, propSchema] of Object.entries(schema.properties)) {
5727
5359
  const propAccess = generatePropertyAccess(prop);
5728
5360
  if (propSchema.type) {
5729
- conditions.push(`typeof ${propAccess} === "${propSchema.type}"`);
5361
+ const schemaType = Array.isArray(propSchema.type) ? propSchema.type[0] : propSchema.type;
5362
+ conditions.push(`typeof ${propAccess} === "${schemaType}"`);
5730
5363
  }
5731
5364
  if (propSchema.const !== void 0) {
5732
5365
  const value = typeof propSchema.const === "string" ? `"${propSchema.const}"` : propSchema.const;
@@ -5785,7 +5418,7 @@ function generateIfThenElse(schema) {
5785
5418
  if (!thenValid) {
5786
5419
  ${thenRequiredProps.length > 0 ? `
5787
5420
  const missingThenProps = ${JSON.stringify(thenRequiredProps)}.filter(p => obj[p] === undefined);
5788
- const message = missingThenProps.length > 0
5421
+ const message = missingThenProps.length > 0
5789
5422
  ? \`When condition is met, required properties are missing: \${missingThenProps.join(', ')}\`
5790
5423
  : "When condition is met, validation constraints failed";
5791
5424
  ` : `
@@ -5803,7 +5436,7 @@ function generateIfThenElse(schema) {
5803
5436
  if (!elseValid) {
5804
5437
  ${elseRequiredProps2.length > 0 ? `
5805
5438
  const missingElseProps = ${JSON.stringify(elseRequiredProps2)}.filter(p => obj[p] === undefined);
5806
- const message = missingElseProps.length > 0
5439
+ const message = missingElseProps.length > 0
5807
5440
  ? \`When condition is not met, required properties are missing: \${missingElseProps.join(', ')}\`
5808
5441
  : "When condition is not met, validation constraints failed";
5809
5442
  ` : `
@@ -5828,7 +5461,7 @@ function generateIfThenElse(schema) {
5828
5461
  if (!thenValid) {
5829
5462
  ${thenRequiredProps.length > 0 ? `
5830
5463
  const missingProps = ${JSON.stringify(thenRequiredProps)}.filter(p => obj[p] === undefined);
5831
- const message = missingProps.length > 0
5464
+ const message = missingProps.length > 0
5832
5465
  ? \`When condition is met, required properties are missing: \${missingProps.join(', ')}\`
5833
5466
  : "When condition is met, validation constraints failed";
5834
5467
  ` : `
@@ -5853,7 +5486,7 @@ function generateIfThenElse(schema) {
5853
5486
  if (!elseValid) {
5854
5487
  ${elseRequiredProps.length > 0 ? `
5855
5488
  const missingProps = ${JSON.stringify(elseRequiredProps)}.filter(p => obj[p] === undefined);
5856
- const message = missingProps.length > 0
5489
+ const message = missingProps.length > 0
5857
5490
  ? \`When condition is not met, required properties are missing: \${missingProps.join(', ')}\`
5858
5491
  : "When condition is not met, validation constraints failed";
5859
5492
  ` : `
@@ -5941,8 +5574,9 @@ ${propertyDef}`);
5941
5574
  case "loose":
5942
5575
  objectMethod = "z.looseObject";
5943
5576
  break;
5944
- default:
5577
+ case "normal":
5945
5578
  objectMethod = "z.object";
5579
+ break;
5946
5580
  }
5947
5581
  }
5948
5582
  let objectDef = `${objectMethod}({
@@ -5952,7 +5586,7 @@ ${properties.join(",\n")}
5952
5586
  if (typeof schema.additionalProperties === "object") {
5953
5587
  const additionalSchema = context.generatePropertySchema(schema.additionalProperties, currentSchema);
5954
5588
  objectDef += `.catchall(${additionalSchema})`;
5955
- } else if (schema.additionalProperties === true) {
5589
+ } else if (schema.additionalProperties) {
5956
5590
  objectDef += ".catchall(z.unknown())";
5957
5591
  }
5958
5592
  } else if (schema.patternProperties) {
@@ -6078,6 +5712,7 @@ ${properties.join(",\n")}
6078
5712
 
6079
5713
  // src/validators/string-validator.ts
6080
5714
  init_cjs_shims();
5715
+ var import_openapi_core4 = require("@cerios/openapi-core");
6081
5716
  var DEFAULT_FORMAT_MAP = {
6082
5717
  uuid: "z.uuid()",
6083
5718
  email: "z.email()",
@@ -6121,7 +5756,7 @@ function buildDateTimeValidation(pattern) {
6121
5756
  `Invalid regular expression pattern for customDateTimeFormatRegex: ${patternStr}. ${error instanceof Error ? error.message : "Pattern is malformed"}`
6122
5757
  );
6123
5758
  }
6124
- const escapedPattern = escapePattern(patternStr);
5759
+ const escapedPattern = (0, import_openapi_core4.escapePattern)(patternStr);
6125
5760
  return `z.string().regex(/${escapedPattern}/)`;
6126
5761
  }
6127
5762
  function generateStringValidation(schema, useDescribe, context) {
@@ -6141,7 +5776,7 @@ function generateStringValidation(schema, useDescribe, context) {
6141
5776
  if (schema.pattern) {
6142
5777
  let escapedPattern = context.patternCache.get(schema.pattern);
6143
5778
  if (escapedPattern === void 0) {
6144
- escapedPattern = escapePattern(schema.pattern);
5779
+ escapedPattern = (0, import_openapi_core4.escapePattern)(schema.pattern);
6145
5780
  context.patternCache.set(schema.pattern, escapedPattern);
6146
5781
  }
6147
5782
  validation += `.regex(/${escapedPattern}/)`;
@@ -6174,7 +5809,7 @@ function generateStringValidation(schema, useDescribe, context) {
6174
5809
  if (schema.pattern) {
6175
5810
  let escapedPattern = context.patternCache.get(schema.pattern);
6176
5811
  if (escapedPattern === void 0) {
6177
- escapedPattern = escapePattern(schema.pattern);
5812
+ escapedPattern = (0, import_openapi_core4.escapePattern)(schema.pattern);
6178
5813
  context.patternCache.set(schema.pattern, escapedPattern);
6179
5814
  }
6180
5815
  validation += `.regex(/${escapedPattern}/)`;
@@ -6202,9 +5837,33 @@ var _PropertyGenerator = class _PropertyGenerator {
6202
5837
  // Performance optimization: Memoize filtered property results
6203
5838
  this.filteredPropsCache = /* @__PURE__ */ new Map();
6204
5839
  // Performance optimization: LRU cache for generated schemas
6205
- this.schemaCache = new LRUCache(500);
5840
+ this.schemaCache = new import_openapi_core5.LRUCache(500);
5841
+ // Track allOf conflicts detected during schema generation
5842
+ this.allOfConflicts = [];
5843
+ // Schemas that are part of circular dependency chains (need z.lazy for forward refs)
5844
+ this.circularDependencies = /* @__PURE__ */ new Set();
6206
5845
  this.context = context;
6207
5846
  }
5847
+ /**
5848
+ * Set the schemas that are involved in circular dependency chains.
5849
+ * These schemas will use z.lazy() for forward references.
5850
+ */
5851
+ setCircularDependencies(deps) {
5852
+ this.circularDependencies = deps;
5853
+ }
5854
+ /**
5855
+ * Get allOf conflicts detected during the last schema generation
5856
+ * @returns Array of conflict description strings
5857
+ */
5858
+ getAllOfConflicts() {
5859
+ return [...this.allOfConflicts];
5860
+ }
5861
+ /**
5862
+ * Clear tracked allOf conflicts (call before generating a new schema)
5863
+ */
5864
+ clearAllOfConflicts() {
5865
+ this.allOfConflicts = [];
5866
+ }
6208
5867
  /**
6209
5868
  * Check if a property should be included based on schemaType and readOnly/writeOnly flags
6210
5869
  */
@@ -6237,7 +5896,9 @@ var _PropertyGenerator = class _PropertyGenerator {
6237
5896
  filterNestedProperties(schema) {
6238
5897
  var _a, _b;
6239
5898
  const propKeys = schema.properties ? Object.keys(schema.properties).sort().join(",") : "";
6240
- const cacheKey = `${this.context.schemaType}:${schema.type || "unknown"}:${propKeys}:${((_a = schema.required) == null ? void 0 : _a.join(",")) || ""}`;
5899
+ const requiredKeys = Array.isArray(schema.required) ? schema.required.join(",") : String((_a = schema.required) != null ? _a : "");
5900
+ const schemaType = Array.isArray(schema.type) ? schema.type.join("|") : schema.type || "unknown";
5901
+ const cacheKey = `${this.context.schemaType}:${schemaType}:${propKeys}:${requiredKeys}`;
6241
5902
  const cached = this.filteredPropsCache.get(cacheKey);
6242
5903
  if (cached) {
6243
5904
  return cached;
@@ -6333,7 +5994,7 @@ var _PropertyGenerator = class _PropertyGenerator {
6333
5994
  const schema = (_b = (_a = this.context.spec.components) == null ? void 0 : _a.schemas) == null ? void 0 : _b[schemaName];
6334
5995
  if (!schema) return schemaName;
6335
5996
  if (schema.allOf && schema.allOf.length === 1 && schema.allOf[0].$ref && !schema.properties && !schema.oneOf && !schema.anyOf) {
6336
- const targetName = resolveRef(schema.allOf[0].$ref);
5997
+ const targetName = (0, import_openapi_core5.resolveRefName)(schema.allOf[0].$ref);
6337
5998
  return this.resolveSchemaAlias(targetName);
6338
5999
  }
6339
6000
  return schemaName;
@@ -6346,7 +6007,7 @@ var _PropertyGenerator = class _PropertyGenerator {
6346
6007
  const toSchemaSpec = (_b = (_a = this.context.spec.components) == null ? void 0 : _a.schemas) == null ? void 0 : _b[toSchema];
6347
6008
  if (!toSchemaSpec) return false;
6348
6009
  if (toSchemaSpec.allOf && toSchemaSpec.allOf.length === 1 && toSchemaSpec.allOf[0].$ref) {
6349
- const aliasTarget = resolveRef(toSchemaSpec.allOf[0].$ref);
6010
+ const aliasTarget = (0, import_openapi_core5.resolveRefName)(toSchemaSpec.allOf[0].$ref);
6350
6011
  return aliasTarget === fromSchema;
6351
6012
  }
6352
6013
  return false;
@@ -6441,13 +6102,13 @@ var _PropertyGenerator = class _PropertyGenerator {
6441
6102
  const isConst = schema.const !== void 0;
6442
6103
  const shouldApplyDefaultNullable = !isTopLevel && !isEnum && !isConst && !suppressDefaultNullable;
6443
6104
  const effectiveDefaultNullable = shouldApplyDefaultNullable ? this.context.defaultNullable : false;
6444
- const nullable = isNullable(schema, effectiveDefaultNullable);
6445
- if (hasMultipleTypes(schema)) {
6105
+ const nullable = (0, import_openapi_core5.isNullable)(schema, effectiveDefaultNullable);
6106
+ if ((0, import_openapi_core5.hasMultipleTypes)(schema)) {
6446
6107
  const union = this.generateMultiTypeUnion(schema, currentSchema);
6447
6108
  return wrapNullable(union, nullable);
6448
6109
  }
6449
6110
  if (schema.$ref) {
6450
- const refName = resolveRef(schema.$ref);
6111
+ const refName = (0, import_openapi_core5.resolveRefName)(schema.$ref);
6451
6112
  const resolvedRefName = this.resolveSchemaAlias(refName);
6452
6113
  if (currentSchema && refName !== currentSchema && !isTopLevel) {
6453
6114
  if (!this.context.schemaDependencies.has(currentSchema)) {
@@ -6455,10 +6116,15 @@ var _PropertyGenerator = class _PropertyGenerator {
6455
6116
  }
6456
6117
  (_a = this.context.schemaDependencies.get(currentSchema)) == null ? void 0 : _a.add(refName);
6457
6118
  }
6458
- const strippedRefName = stripPrefix(resolvedRefName, this.context.stripSchemaPrefix);
6459
- const schemaName = `${toCamelCase(strippedRefName, this.context.namingOptions)}Schema`;
6460
- if (currentSchema && (refName === currentSchema || this.isCircularThroughAlias(currentSchema, refName))) {
6461
- const lazySchema = `z.lazy((): z.ZodTypeAny => ${schemaName})`;
6119
+ const strippedRefName = (0, import_openapi_core5.stripPrefix)(resolvedRefName, this.context.stripSchemaPrefix);
6120
+ const schemaName = `${(0, import_openapi_core5.toCamelCase)(strippedRefName, this.context.namingOptions)}Schema`;
6121
+ const typeName = (0, import_openapi_core5.toPascalCase)(strippedRefName);
6122
+ const isDirectSelfRef = currentSchema && refName === currentSchema;
6123
+ const isCircularAlias = currentSchema && this.isCircularThroughAlias(currentSchema, refName);
6124
+ const isMutuallyCircular = currentSchema && this.circularDependencies.has(currentSchema) && this.circularDependencies.has(refName);
6125
+ if (isDirectSelfRef || isCircularAlias || isMutuallyCircular) {
6126
+ const lazyTypeAnnotation = this.context.separateTypesFile ? `z.ZodType<${typeName}>` : "z.ZodTypeAny";
6127
+ const lazySchema = `z.lazy((): ${lazyTypeAnnotation} => ${schemaName})`;
6462
6128
  return wrapNullable(lazySchema, nullable);
6463
6129
  }
6464
6130
  return wrapNullable(schemaName, nullable);
@@ -6490,8 +6156,8 @@ var _PropertyGenerator = class _PropertyGenerator {
6490
6156
  return wrapNullable(zodUnion, nullable);
6491
6157
  }
6492
6158
  if (schema.allOf) {
6493
- const compositionNullable = isNullable(schema, false);
6494
- let composition = generateAllOf(
6159
+ const compositionNullable = (0, import_openapi_core5.isNullable)(schema, false);
6160
+ const allOfResult = generateAllOf(
6495
6161
  schema.allOf,
6496
6162
  compositionNullable,
6497
6163
  {
@@ -6501,13 +6167,17 @@ var _PropertyGenerator = class _PropertyGenerator {
6501
6167
  },
6502
6168
  currentSchema
6503
6169
  );
6170
+ if (allOfResult.conflicts.length > 0) {
6171
+ this.allOfConflicts.push(...allOfResult.conflicts);
6172
+ }
6173
+ let composition = allOfResult.schema;
6504
6174
  if (schema.unevaluatedProperties !== void 0) {
6505
6175
  composition = this.applyUnevaluatedProperties(composition, schema);
6506
6176
  }
6507
6177
  return composition;
6508
6178
  }
6509
6179
  if (schema.oneOf) {
6510
- const compositionNullable = isNullable(schema, false);
6180
+ const compositionNullable = (0, import_openapi_core5.isNullable)(schema, false);
6511
6181
  const needsPassthrough = schema.unevaluatedProperties !== void 0;
6512
6182
  let composition = generateUnion(
6513
6183
  schema.oneOf,
@@ -6530,7 +6200,7 @@ var _PropertyGenerator = class _PropertyGenerator {
6530
6200
  return composition;
6531
6201
  }
6532
6202
  if (schema.anyOf) {
6533
- const compositionNullable = isNullable(schema, false);
6203
+ const compositionNullable = (0, import_openapi_core5.isNullable)(schema, false);
6534
6204
  const needsPassthrough = schema.unevaluatedProperties !== void 0;
6535
6205
  let composition = generateUnion(
6536
6206
  schema.anyOf,
@@ -6565,7 +6235,7 @@ var _PropertyGenerator = class _PropertyGenerator {
6565
6235
  return wrapNullable(refined, nullable);
6566
6236
  }
6567
6237
  let validation = "";
6568
- const primaryType = getPrimaryType(schema);
6238
+ const primaryType = (0, import_openapi_core5.getPrimaryType)(schema);
6569
6239
  switch (primaryType) {
6570
6240
  case "string":
6571
6241
  validation = generateStringValidation(schema, this.context.useDescribe, {
@@ -6612,13 +6282,14 @@ var _PropertyGenerator = class _PropertyGenerator {
6612
6282
  case "loose":
6613
6283
  validation = "z.looseObject({})";
6614
6284
  break;
6615
- default:
6285
+ case "record":
6616
6286
  validation = "z.record(z.string(), z.unknown())";
6617
6287
  break;
6618
6288
  }
6619
6289
  validation = addDescription(validation, schema.description, this.context.useDescribe);
6620
6290
  }
6621
6291
  break;
6292
+ case void 0:
6622
6293
  default:
6623
6294
  validation = "z.unknown()";
6624
6295
  validation = addDescription(validation, schema.description, this.context.useDescribe);
@@ -6677,196 +6348,14 @@ _PropertyGenerator.INCLUSION_RULES = {
6677
6348
  };
6678
6349
  var PropertyGenerator = _PropertyGenerator;
6679
6350
 
6680
- // src/utils/operation-filters.ts
6681
- init_cjs_shims();
6682
- var import_minimatch2 = require("minimatch");
6683
- function createFilterStatistics() {
6684
- return {
6685
- totalOperations: 0,
6686
- includedOperations: 0,
6687
- filteredByTags: 0,
6688
- filteredByPaths: 0,
6689
- filteredByMethods: 0,
6690
- filteredByOperationIds: 0,
6691
- filteredByDeprecated: 0
6692
- };
6693
- }
6694
- function matchesAnyPattern(value, patterns) {
6695
- if (!patterns || patterns.length === 0) {
6696
- return false;
6697
- }
6698
- if (!value) {
6699
- return false;
6700
- }
6701
- return patterns.some((pattern) => (0, import_minimatch2.minimatch)(value, pattern));
6702
- }
6703
- function containsAny(arr, values) {
6704
- if (!values || values.length === 0) {
6705
- return false;
6706
- }
6707
- if (!arr || arr.length === 0) {
6708
- return false;
6709
- }
6710
- return values.some((value) => arr.includes(value));
6711
- }
6712
- function shouldIncludeOperation(operation, path, method, filters, stats) {
6713
- if (!filters) {
6714
- return true;
6715
- }
6716
- const methodLower = method.toLowerCase();
6717
- const operationId = operation == null ? void 0 : operation.operationId;
6718
- const tags = (operation == null ? void 0 : operation.tags) || [];
6719
- const deprecated = (operation == null ? void 0 : operation.deprecated) === true;
6720
- if (filters.includeTags && filters.includeTags.length > 0) {
6721
- if (!containsAny(tags, filters.includeTags)) {
6722
- if (stats) stats.filteredByTags++;
6723
- return false;
6724
- }
6725
- }
6726
- if (filters.includePaths && filters.includePaths.length > 0) {
6727
- if (!matchesAnyPattern(path, filters.includePaths)) {
6728
- if (stats) stats.filteredByPaths++;
6729
- return false;
6730
- }
6731
- }
6732
- if (filters.includeMethods && filters.includeMethods.length > 0) {
6733
- const methodsLower = filters.includeMethods.map((m) => m.toLowerCase());
6734
- if (!methodsLower.includes(methodLower)) {
6735
- if (stats) stats.filteredByMethods++;
6736
- return false;
6737
- }
6738
- }
6739
- if (filters.includeOperationIds && filters.includeOperationIds.length > 0) {
6740
- if (!matchesAnyPattern(operationId, filters.includeOperationIds)) {
6741
- if (stats) stats.filteredByOperationIds++;
6742
- return false;
6743
- }
6744
- }
6745
- if (filters.excludeDeprecated === true && deprecated) {
6746
- if (stats) stats.filteredByDeprecated++;
6747
- return false;
6748
- }
6749
- if (filters.excludeTags && filters.excludeTags.length > 0) {
6750
- if (containsAny(tags, filters.excludeTags)) {
6751
- if (stats) stats.filteredByTags++;
6752
- return false;
6753
- }
6754
- }
6755
- if (filters.excludePaths && filters.excludePaths.length > 0) {
6756
- if (matchesAnyPattern(path, filters.excludePaths)) {
6757
- if (stats) stats.filteredByPaths++;
6758
- return false;
6759
- }
6760
- }
6761
- if (filters.excludeMethods && filters.excludeMethods.length > 0) {
6762
- const methodsLower = filters.excludeMethods.map((m) => m.toLowerCase());
6763
- if (methodsLower.includes(methodLower)) {
6764
- if (stats) stats.filteredByMethods++;
6765
- return false;
6766
- }
6767
- }
6768
- if (filters.excludeOperationIds && filters.excludeOperationIds.length > 0) {
6769
- if (matchesAnyPattern(operationId, filters.excludeOperationIds)) {
6770
- if (stats) stats.filteredByOperationIds++;
6771
- return false;
6772
- }
6773
- }
6774
- return true;
6775
- }
6776
- function validateFilters(stats, filters) {
6777
- if (!filters || stats.totalOperations === 0) {
6778
- return;
6779
- }
6780
- if (stats.includedOperations === 0) {
6781
- console.warn(
6782
- `\u26A0\uFE0F Warning: All ${stats.totalOperations} operations were filtered out. Check your operationFilters configuration.`
6783
- );
6784
- const filterBreakdown = [];
6785
- if (stats.filteredByTags > 0) filterBreakdown.push(`${stats.filteredByTags} by tags`);
6786
- if (stats.filteredByPaths > 0) filterBreakdown.push(`${stats.filteredByPaths} by paths`);
6787
- if (stats.filteredByMethods > 0) filterBreakdown.push(`${stats.filteredByMethods} by methods`);
6788
- if (stats.filteredByOperationIds > 0) filterBreakdown.push(`${stats.filteredByOperationIds} by operationIds`);
6789
- if (stats.filteredByDeprecated > 0) filterBreakdown.push(`${stats.filteredByDeprecated} by deprecated flag`);
6790
- if (filterBreakdown.length > 0) {
6791
- console.warn(` Filtered: ${filterBreakdown.join(", ")}`);
6792
- }
6793
- }
6794
- }
6795
- function formatFilterStatistics(stats) {
6796
- if (stats.totalOperations === 0) {
6797
- return "";
6798
- }
6799
- const lines = [];
6800
- lines.push("Operation Filtering:");
6801
- lines.push(` Total operations: ${stats.totalOperations}`);
6802
- lines.push(` Included operations: ${stats.includedOperations}`);
6803
- const filteredCount = stats.filteredByTags + stats.filteredByPaths + stats.filteredByMethods + stats.filteredByOperationIds + stats.filteredByDeprecated;
6804
- if (filteredCount > 0) {
6805
- lines.push(` Filtered operations: ${filteredCount}`);
6806
- if (stats.filteredByTags > 0) lines.push(` - By tags: ${stats.filteredByTags}`);
6807
- if (stats.filteredByPaths > 0) lines.push(` - By paths: ${stats.filteredByPaths}`);
6808
- if (stats.filteredByMethods > 0) lines.push(` - By methods: ${stats.filteredByMethods}`);
6809
- if (stats.filteredByOperationIds > 0) lines.push(` - By operationIds: ${stats.filteredByOperationIds}`);
6810
- if (stats.filteredByDeprecated > 0) lines.push(` - By deprecated: ${stats.filteredByDeprecated}`);
6811
- }
6812
- return lines.join("\n");
6813
- }
6814
-
6815
- // src/utils/ref-resolver.ts
6816
- init_cjs_shims();
6817
- function resolveRef2(obj, spec, maxDepth = 10) {
6818
- var _a, _b, _c, _d;
6819
- if (!obj || typeof obj !== "object" || maxDepth <= 0) return obj;
6820
- if (!obj.$ref) return obj;
6821
- const ref = obj.$ref;
6822
- let resolved = null;
6823
- const paramMatch = ref.match(/^#\/components\/parameters\/(.+)$/);
6824
- const requestBodyMatch = ref.match(/^#\/components\/requestBodies\/(.+)$/);
6825
- const responseMatch = ref.match(/^#\/components\/responses\/(.+)$/);
6826
- const schemaMatch = ref.match(/^#\/components\/schemas\/(.+)$/);
6827
- if (paramMatch && ((_a = spec.components) == null ? void 0 : _a.parameters)) {
6828
- const name = paramMatch[1];
6829
- resolved = spec.components.parameters[name];
6830
- } else if (requestBodyMatch && ((_b = spec.components) == null ? void 0 : _b.requestBodies)) {
6831
- const name = requestBodyMatch[1];
6832
- resolved = spec.components.requestBodies[name];
6833
- } else if (responseMatch && ((_c = spec.components) == null ? void 0 : _c.responses)) {
6834
- const name = responseMatch[1];
6835
- resolved = spec.components.responses[name];
6836
- } else if (schemaMatch && ((_d = spec.components) == null ? void 0 : _d.schemas)) {
6837
- const name = schemaMatch[1];
6838
- resolved = spec.components.schemas[name];
6839
- }
6840
- if (resolved) {
6841
- if (resolved.$ref) {
6842
- return resolveRef2(resolved, spec, maxDepth - 1);
6843
- }
6844
- return resolved;
6845
- }
6846
- return obj;
6847
- }
6848
- function resolveParameterRef(param, spec) {
6849
- return resolveRef2(param, spec);
6351
+ // src/openapi-generator.ts
6352
+ var HTTP_METHODS = ["get", "post", "put", "patch", "delete", "head", "options"];
6353
+ function isResolvedParameter(param) {
6354
+ return typeof param === "object" && param !== null && "name" in param && typeof param.name === "string" && "in" in param;
6850
6355
  }
6851
- function mergeParameters(pathParams, operationParams, spec) {
6852
- const resolvedPathParams = (pathParams || []).map((p) => resolveParameterRef(p, spec));
6853
- const resolvedOperationParams = (operationParams || []).map((p) => resolveParameterRef(p, spec));
6854
- const merged = [...resolvedPathParams];
6855
- for (const opParam of resolvedOperationParams) {
6856
- if (!opParam || typeof opParam !== "object") continue;
6857
- const existingIndex = merged.findIndex(
6858
- (p) => p && typeof p === "object" && p.name === opParam.name && p.in === opParam.in
6859
- );
6860
- if (existingIndex >= 0) {
6861
- merged[existingIndex] = opParam;
6862
- } else {
6863
- merged.push(opParam);
6864
- }
6865
- }
6866
- return merged;
6356
+ function isOpenAPIPathItem(value) {
6357
+ return typeof value === "object" && value !== null;
6867
6358
  }
6868
-
6869
- // src/openapi-generator.ts
6870
6359
  var OpenApiGenerator = class {
6871
6360
  constructor(options) {
6872
6361
  this.schemas = /* @__PURE__ */ new Map();
@@ -6874,90 +6363,49 @@ var OpenApiGenerator = class {
6874
6363
  this.schemaDependencies = /* @__PURE__ */ new Map();
6875
6364
  this.schemaUsageMap = /* @__PURE__ */ new Map();
6876
6365
  this.needsZodImport = true;
6877
- this.filterStats = createFilterStatistics();
6878
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
6366
+ this.filterStats = (0, import_openapi_core6.createFilterStatistics)();
6367
+ /** Track total allOf conflicts detected across all schemas */
6368
+ this.allOfConflictCount = 0;
6369
+ /** Track schemas involved in circular dependency chains */
6370
+ this.circularDependencies = /* @__PURE__ */ new Set();
6371
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
6879
6372
  if (!options.input) {
6880
- throw new ConfigurationError("Input path is required", { providedOptions: options });
6373
+ throw new import_openapi_core6.ConfigurationError("Input path is required", { providedOptions: options });
6881
6374
  }
6375
+ this.separateSchemasMode = Boolean(options.outputZodSchemas);
6882
6376
  this.options = {
6883
6377
  mode: options.mode || "normal",
6884
6378
  input: options.input,
6885
- output: options.output,
6886
- includeDescriptions: (_a = options.includeDescriptions) != null ? _a : true,
6887
- useDescribe: (_b = options.useDescribe) != null ? _b : false,
6888
- defaultNullable: (_c = options.defaultNullable) != null ? _c : false,
6889
- emptyObjectBehavior: (_d = options.emptyObjectBehavior) != null ? _d : "loose",
6379
+ outputTypes: options.outputTypes,
6380
+ outputZodSchemas: options.outputZodSchemas,
6381
+ enumFormat: options.enumFormat,
6382
+ typeAssertionThreshold: (_a = options.typeAssertionThreshold) != null ? _a : 0,
6383
+ includeDescriptions: (_b = options.includeDescriptions) != null ? _b : true,
6384
+ useDescribe: (_c = options.useDescribe) != null ? _c : false,
6385
+ defaultNullable: (_d = options.defaultNullable) != null ? _d : false,
6386
+ emptyObjectBehavior: (_e = options.emptyObjectBehavior) != null ? _e : "loose",
6890
6387
  schemaType: options.schemaType || "all",
6891
6388
  prefix: options.prefix,
6892
6389
  suffix: options.suffix,
6893
6390
  stripSchemaPrefix: options.stripSchemaPrefix,
6894
6391
  stripPathPrefix: options.stripPathPrefix,
6895
- showStats: (_e = options.showStats) != null ? _e : true,
6392
+ useOperationId: (_f = options.useOperationId) != null ? _f : true,
6393
+ showStats: (_g = options.showStats) != null ? _g : true,
6896
6394
  request: options.request,
6897
6395
  response: options.response,
6898
6396
  operationFilters: options.operationFilters,
6899
6397
  ignoreHeaders: options.ignoreHeaders,
6900
- cacheSize: (_f = options.cacheSize) != null ? _f : 1e3,
6901
- batchSize: (_g = options.batchSize) != null ? _g : 10,
6398
+ cacheSize: (_h = options.cacheSize) != null ? _h : 1e3,
6399
+ batchSize: (_i = options.batchSize) != null ? _i : 10,
6902
6400
  customDateTimeFormatRegex: options.customDateTimeFormatRegex
6903
6401
  };
6904
- this.patternCache = new LRUCache((_h = this.options.cacheSize) != null ? _h : 1e3);
6402
+ this.patternCache = new import_openapi_core6.LRUCache((_j = this.options.cacheSize) != null ? _j : 1e3);
6905
6403
  this.dateTimeValidation = buildDateTimeValidation(this.options.customDateTimeFormatRegex);
6906
- try {
6907
- const fs = require("fs");
6908
- if (!fs.existsSync(this.options.input)) {
6909
- throw new FileOperationError(`Input file not found: ${this.options.input}`, this.options.input);
6910
- }
6911
- } catch (error) {
6912
- if (error instanceof FileOperationError) {
6913
- throw error;
6914
- }
6915
- }
6916
- try {
6917
- const content = (0, import_node_fs.readFileSync)(this.options.input, "utf-8");
6918
- try {
6919
- this.spec = (0, import_yaml.parse)(content);
6920
- } catch (yamlError) {
6921
- try {
6922
- this.spec = JSON.parse(content);
6923
- } catch {
6924
- if (yamlError instanceof Error) {
6925
- const errorMessage = [
6926
- `Failed to parse OpenAPI specification from: ${this.options.input}`,
6927
- "",
6928
- `Error: ${yamlError.message}`,
6929
- "",
6930
- "Please ensure:",
6931
- " - The file exists and is readable",
6932
- " - The file contains valid YAML or JSON syntax",
6933
- " - The file is a valid OpenAPI 3.x specification"
6934
- ].join("\n");
6935
- throw new SpecValidationError(errorMessage, {
6936
- filePath: this.options.input,
6937
- originalError: yamlError.message
6938
- });
6939
- }
6940
- throw yamlError;
6941
- }
6942
- }
6943
- } catch (error) {
6944
- if (error instanceof SpecValidationError) {
6945
- throw error;
6946
- }
6947
- if (error instanceof Error) {
6948
- const errorMessage = [
6949
- `Failed to read OpenAPI specification from: ${this.options.input}`,
6950
- "",
6951
- `Error: ${error.message}`
6952
- ].join("\n");
6953
- throw new SpecValidationError(errorMessage, { filePath: this.options.input, originalError: error.message });
6954
- }
6955
- throw error;
6956
- }
6404
+ this.spec = (0, import_openapi_core6.loadOpenAPISpec)(this.options.input);
6957
6405
  this.validateSpec();
6958
6406
  this.requestOptions = this.resolveOptionsForContext("request");
6959
6407
  this.responseOptions = this.resolveOptionsForContext("response");
6960
- this.analyzeSchemaUsage();
6408
+ this.initializeSchemaUsage();
6961
6409
  this.propertyGenerator = new PropertyGenerator({
6962
6410
  spec: this.spec,
6963
6411
  schemaDependencies: this.schemaDependencies,
@@ -6965,26 +6413,33 @@ var OpenApiGenerator = class {
6965
6413
  mode: this.requestOptions.mode,
6966
6414
  includeDescriptions: this.requestOptions.includeDescriptions,
6967
6415
  useDescribe: this.requestOptions.useDescribe,
6968
- defaultNullable: (_i = this.options.defaultNullable) != null ? _i : false,
6969
- emptyObjectBehavior: (_j = this.options.emptyObjectBehavior) != null ? _j : "loose",
6416
+ defaultNullable: (_k = this.options.defaultNullable) != null ? _k : false,
6417
+ emptyObjectBehavior: (_l = this.options.emptyObjectBehavior) != null ? _l : "loose",
6970
6418
  namingOptions: {
6971
6419
  prefix: this.options.prefix,
6972
6420
  suffix: this.options.suffix
6973
6421
  },
6974
6422
  stripSchemaPrefix: this.options.stripSchemaPrefix,
6975
6423
  dateTimeValidation: this.dateTimeValidation,
6976
- patternCache: this.patternCache
6424
+ patternCache: this.patternCache,
6425
+ separateTypesFile: this.separateSchemasMode
6977
6426
  });
6978
6427
  }
6979
6428
  /**
6980
6429
  * Generate schemas as a string (without writing to file)
6430
+ * When separateSchemasMode is active, generates Zod schemas with explicit type annotations
6981
6431
  * @returns The generated TypeScript code as a string
6982
6432
  */
6983
6433
  generateString() {
6984
6434
  var _a;
6985
6435
  if (!((_a = this.spec.components) == null ? void 0 : _a.schemas)) {
6986
- throw new SpecValidationError("No schemas found in OpenAPI spec", { filePath: this.options.input });
6436
+ throw new import_openapi_core6.SpecValidationError("No schemas found in OpenAPI spec", { filePath: this.options.input });
6437
+ }
6438
+ if (this.separateSchemasMode) {
6439
+ return this.generateSeparateSchemasString();
6987
6440
  }
6441
+ this.analyzeCircularDependencies();
6442
+ this.propertyGenerator.setCircularDependencies(this.circularDependencies);
6988
6443
  for (const [name, schema] of Object.entries(this.spec.components.schemas)) {
6989
6444
  if (this.options.operationFilters && this.schemaUsageMap.size > 0 && !this.schemaUsageMap.has(name)) {
6990
6445
  continue;
@@ -6993,7 +6448,7 @@ var OpenApiGenerator = class {
6993
6448
  }
6994
6449
  this.generateQueryParameterSchemas();
6995
6450
  this.generateHeaderParameterSchemas();
6996
- validateFilters(this.filterStats, this.options.operationFilters);
6451
+ (0, import_openapi_core6.validateFilters)(this.filterStats, this.options.operationFilters);
6997
6452
  const orderedSchemaNames = this.topologicalSort();
6998
6453
  const output = ["// Auto-generated by @cerios/openapi-to-zod", "// Do not edit this file manually", ""];
6999
6454
  if (this.options.showStats === true) {
@@ -7010,10 +6465,10 @@ var OpenApiGenerator = class {
7010
6465
  const typeCode = this.types.get(name);
7011
6466
  if (schemaCode) {
7012
6467
  output.push(schemaCode);
7013
- const strippedName = stripPrefix(name, this.options.stripSchemaPrefix);
7014
- const typeName = toPascalCase(strippedName);
6468
+ const strippedName = (0, import_openapi_core6.stripPrefix)(name, this.options.stripSchemaPrefix);
6469
+ const typeName = (0, import_openapi_core6.toPascalCase)(strippedName);
7015
6470
  if (!schemaCode.includes(`export type ${typeName}`)) {
7016
- const schemaName = `${toCamelCase(strippedName, { prefix: this.options.prefix, suffix: this.options.suffix })}Schema`;
6471
+ const schemaName = `${(0, import_openapi_core6.toCamelCase)(strippedName, { prefix: this.options.prefix, suffix: this.options.suffix })}Schema`;
7017
6472
  output.push(`export type ${typeName} = z.infer<typeof ${schemaName}>;`);
7018
6473
  }
7019
6474
  output.push("");
@@ -7035,14 +6490,224 @@ var OpenApiGenerator = class {
7035
6490
  }
7036
6491
  }
7037
6492
  /**
7038
- * Generate the complete output file
6493
+ * Generate the complete output file(s)
6494
+ * When separateSchemasMode is active, generates both types and schemas files
7039
6495
  */
7040
6496
  generate() {
7041
- const output = this.generateString();
7042
- const normalizedOutput = (0, import_node_path.normalize)(this.options.output);
7043
- this.ensureDirectoryExists(normalizedOutput);
7044
- (0, import_node_fs.writeFileSync)(normalizedOutput, output);
7045
- console.log(` \u2713 Generated ${normalizedOutput}`);
6497
+ if (this.separateSchemasMode) {
6498
+ const typesContent = this.generateTypesString();
6499
+ const schemasContent = this.generateString();
6500
+ const normalizedTypes = (0, import_node_path.normalize)(this.options.outputTypes);
6501
+ this.ensureDirectoryExists(normalizedTypes);
6502
+ (0, import_node_fs.writeFileSync)(normalizedTypes, typesContent, "utf-8");
6503
+ console.log(` \u2713 Generated ${normalizedTypes}`);
6504
+ if (!this.options.outputZodSchemas) {
6505
+ throw new Error("Internal error: outputZodSchemas should be defined in separateSchemasMode");
6506
+ }
6507
+ const outputZodSchemas = this.options.outputZodSchemas;
6508
+ const normalizedSchemas = (0, import_node_path.normalize)(outputZodSchemas);
6509
+ this.ensureDirectoryExists(normalizedSchemas);
6510
+ (0, import_node_fs.writeFileSync)(normalizedSchemas, schemasContent, "utf-8");
6511
+ console.log(` \u2713 Generated ${normalizedSchemas}`);
6512
+ } else {
6513
+ const output = this.generateString();
6514
+ const normalizedOutput = (0, import_node_path.normalize)(this.options.outputTypes);
6515
+ this.ensureDirectoryExists(normalizedOutput);
6516
+ (0, import_node_fs.writeFileSync)(normalizedOutput, output);
6517
+ console.log(` \u2713 Generated ${normalizedOutput}`);
6518
+ }
6519
+ }
6520
+ /**
6521
+ * Generate Zod schemas with explicit type annotations (for outputZodSchemas mode)
6522
+ * Generates schemas like: `export const userSchema: z.ZodType<User> = z.object({...})`
6523
+ * @returns The generated Zod schemas TypeScript code
6524
+ */
6525
+ generateSeparateSchemasString() {
6526
+ var _a;
6527
+ const schemas = (_a = this.spec.components) == null ? void 0 : _a.schemas;
6528
+ if (!schemas) {
6529
+ return "";
6530
+ }
6531
+ if (!this.options.outputZodSchemas) {
6532
+ throw new Error("Internal error: outputZodSchemas should be defined in separateSchemasMode");
6533
+ }
6534
+ const outputZodSchemas = this.options.outputZodSchemas;
6535
+ this.analyzeCircularDependencies();
6536
+ this.propertyGenerator.setCircularDependencies(this.circularDependencies);
6537
+ for (const [name, schema] of Object.entries(schemas)) {
6538
+ if (this.options.operationFilters && this.schemaUsageMap.size > 0 && !this.schemaUsageMap.has(name)) {
6539
+ continue;
6540
+ }
6541
+ this.generateComponentSchema(name, schema);
6542
+ }
6543
+ this.generateQueryParameterSchemas();
6544
+ this.generateHeaderParameterSchemas();
6545
+ (0, import_openapi_core6.validateFilters)(this.filterStats, this.options.operationFilters);
6546
+ const orderedSchemaNames = this.topologicalSort();
6547
+ const output = ["// Auto-generated by @cerios/openapi-to-zod", "// Do not edit this file manually", ""];
6548
+ if (this.options.showStats === true) {
6549
+ output.push(...this.generateStats());
6550
+ output.push("");
6551
+ }
6552
+ output.push('import { z } from "zod";');
6553
+ const typesImportPath = this.calculateRelativeImportPath(outputZodSchemas, this.options.outputTypes);
6554
+ const typeNames = [];
6555
+ for (const name of orderedSchemaNames) {
6556
+ const strippedName = (0, import_openapi_core6.stripPrefix)(name, this.options.stripSchemaPrefix);
6557
+ const typeName = (0, import_openapi_core6.toPascalCase)(strippedName);
6558
+ typeNames.push(typeName);
6559
+ }
6560
+ if (typeNames.length > 0) {
6561
+ output.push(`import type { ${typeNames.join(", ")} } from "${typesImportPath}";`);
6562
+ }
6563
+ output.push("");
6564
+ output.push("// Schemas");
6565
+ for (const name of orderedSchemaNames) {
6566
+ const schemaCode = this.schemas.get(name);
6567
+ if (schemaCode) {
6568
+ const strippedName = (0, import_openapi_core6.stripPrefix)(name, this.options.stripSchemaPrefix);
6569
+ const typeName = (0, import_openapi_core6.toPascalCase)(strippedName);
6570
+ const schemaName = `${(0, import_openapi_core6.toCamelCase)(strippedName, { prefix: this.options.prefix, suffix: this.options.suffix })}Schema`;
6571
+ const schemaDefinition = this.isRecordObject(schemas[name]) ? schemas[name] : void 0;
6572
+ const transformedCode = this.addExplicitTypeAnnotation(schemaCode, schemaName, typeName, schemaDefinition);
6573
+ output.push(transformedCode);
6574
+ output.push("");
6575
+ }
6576
+ }
6577
+ return output.join("\n");
6578
+ }
6579
+ /**
6580
+ * Generate TypeScript types as a string (for outputZodSchemas mode)
6581
+ * Uses @cerios/openapi-to-typescript internally
6582
+ * @returns The generated TypeScript types code
6583
+ */
6584
+ generateTypesString() {
6585
+ var _a;
6586
+ const tsGenerator = new import_openapi_to_typescript.TypeScriptGenerator({
6587
+ input: this.options.input,
6588
+ outputTypes: this.options.outputTypes,
6589
+ includeDescriptions: this.options.includeDescriptions,
6590
+ defaultNullable: this.options.defaultNullable,
6591
+ prefix: this.options.prefix,
6592
+ suffix: this.options.suffix,
6593
+ stripSchemaPrefix: this.options.stripSchemaPrefix,
6594
+ stripPathPrefix: this.options.stripPathPrefix,
6595
+ operationFilters: this.options.operationFilters,
6596
+ showStats: this.options.showStats,
6597
+ enumFormat: (_a = this.options.enumFormat) != null ? _a : "const-object"
6598
+ });
6599
+ return tsGenerator.generateString();
6600
+ }
6601
+ /**
6602
+ * Add explicit type annotation to a schema declaration
6603
+ * Transforms: `export const userSchema = z.object({...})`
6604
+ * To: `export const userSchema: z.ZodType<User> = z.object({...})` (annotation)
6605
+ * Or: `export const userSchema = z.object({...}) as unknown as z.ZodType<User>` (double assertion)
6606
+ *
6607
+ * Uses double assertion via `unknown` when typeAssertionThreshold is set and schema complexity
6608
+ * meets or exceeds the threshold. This completely bypasses TypeScript's structural checking
6609
+ * to avoid "Type instantiation is excessively deep" errors on very large schemas.
6610
+ *
6611
+ * Also removes any `export type X = z.infer<...>` lines since types
6612
+ * are imported from the separate types file.
6613
+ */
6614
+ addExplicitTypeAnnotation(schemaCode, schemaName, typeName, schemaDefinition) {
6615
+ var _a;
6616
+ const code = schemaCode.replace(/\nexport type \w+ = z\.infer<typeof \w+>;/g, "");
6617
+ const jsdocMatch = code.match(/^(\/\*\*[\s\S]*?\*\/\n)?/);
6618
+ const jsdoc = (jsdocMatch == null ? void 0 : jsdocMatch[1]) || "";
6619
+ const codeWithoutJsdoc = code.slice(jsdoc.length);
6620
+ const threshold = (_a = this.options.typeAssertionThreshold) != null ? _a : 0;
6621
+ const useAssertion = threshold > 0 && schemaDefinition && this.calculateSchemaComplexity(schemaDefinition) >= threshold;
6622
+ const pattern = new RegExp(`export const ${schemaName} = `);
6623
+ if (pattern.test(codeWithoutJsdoc)) {
6624
+ let schemaBody = codeWithoutJsdoc.replace(pattern, "");
6625
+ if (useAssertion) {
6626
+ schemaBody = schemaBody.replace(/;$/, "");
6627
+ return `${jsdoc}export const ${schemaName} = ${schemaBody} as unknown as z.ZodType<${typeName}>;`;
6628
+ }
6629
+ return `${jsdoc}export const ${schemaName}: z.ZodType<${typeName}> = ${schemaBody}`;
6630
+ }
6631
+ return code;
6632
+ }
6633
+ /**
6634
+ * Type guard to check if a value is a Record<string, unknown>
6635
+ */
6636
+ isRecordObject(value) {
6637
+ return typeof value === "object" && value !== null && !Array.isArray(value);
6638
+ }
6639
+ /**
6640
+ * Calculate the complexity of a schema for threshold comparison
6641
+ * Complexity formula: properties + (nested levels * 10) + (array/union members * 2)
6642
+ */
6643
+ calculateSchemaComplexity(schema, depth = 0) {
6644
+ if (!schema || typeof schema !== "object") {
6645
+ return 0;
6646
+ }
6647
+ let complexity = depth * 10;
6648
+ if (schema.$ref) {
6649
+ return complexity + 5;
6650
+ }
6651
+ const properties = schema.properties;
6652
+ if (this.isRecordObject(properties)) {
6653
+ const propCount = Object.keys(properties).length;
6654
+ complexity += propCount;
6655
+ for (const prop of Object.values(properties)) {
6656
+ if (this.isRecordObject(prop)) {
6657
+ complexity += this.calculateSchemaComplexity(prop, depth + 1);
6658
+ }
6659
+ }
6660
+ }
6661
+ const allOf = schema.allOf;
6662
+ if (Array.isArray(allOf)) {
6663
+ complexity += allOf.length * 2;
6664
+ for (const subSchema of allOf) {
6665
+ if (this.isRecordObject(subSchema)) {
6666
+ complexity += this.calculateSchemaComplexity(subSchema, depth + 1);
6667
+ }
6668
+ }
6669
+ }
6670
+ const oneOf = schema.oneOf;
6671
+ if (Array.isArray(oneOf)) {
6672
+ complexity += oneOf.length * 2;
6673
+ for (const subSchema of oneOf) {
6674
+ if (this.isRecordObject(subSchema)) {
6675
+ complexity += this.calculateSchemaComplexity(subSchema, depth + 1);
6676
+ }
6677
+ }
6678
+ }
6679
+ const anyOf = schema.anyOf;
6680
+ if (Array.isArray(anyOf)) {
6681
+ complexity += anyOf.length * 2;
6682
+ for (const subSchema of anyOf) {
6683
+ if (this.isRecordObject(subSchema)) {
6684
+ complexity += this.calculateSchemaComplexity(subSchema, depth + 1);
6685
+ }
6686
+ }
6687
+ }
6688
+ const items = schema.items;
6689
+ if (this.isRecordObject(items)) {
6690
+ complexity += 2;
6691
+ complexity += this.calculateSchemaComplexity(items, depth + 1);
6692
+ }
6693
+ const additionalProps = schema.additionalProperties;
6694
+ if (this.isRecordObject(additionalProps)) {
6695
+ complexity += 2;
6696
+ complexity += this.calculateSchemaComplexity(additionalProps, depth + 1);
6697
+ }
6698
+ return complexity;
6699
+ }
6700
+ /**
6701
+ * Calculate relative import path from schema file to types file
6702
+ */
6703
+ calculateRelativeImportPath(fromPath, toPath) {
6704
+ const fromDir = (0, import_node_path.dirname)((0, import_node_path.normalize)(fromPath));
6705
+ const toFile = (0, import_node_path.normalize)(toPath).replace(/\.[tj]s$/, "");
6706
+ let relativePath = (0, import_node_path.relative)(fromDir, toFile);
6707
+ if (!relativePath.startsWith(".") && !relativePath.startsWith("..")) {
6708
+ relativePath = `./${relativePath}`;
6709
+ }
6710
+ return relativePath.replace(/\\/g, "/");
7046
6711
  }
7047
6712
  /**
7048
6713
  * Resolve options for a specific context (request or response)
@@ -7058,191 +6723,84 @@ var OpenApiGenerator = class {
7058
6723
  };
7059
6724
  }
7060
6725
  /**
7061
- * Analyze schema usage across the OpenAPI spec to determine if schemas
7062
- * are used in request, response, or both contexts
6726
+ * Initialize schema usage map using core utilities with operation filtering
6727
+ * This is a wrapper around core's analyzeSchemaUsage that adds operation filtering
7063
6728
  */
7064
- analyzeSchemaUsage() {
7065
- var _a, _b;
7066
- const requestSchemas = /* @__PURE__ */ new Set();
7067
- const responseSchemas = /* @__PURE__ */ new Set();
7068
- if (this.spec.paths) {
6729
+ initializeSchemaUsage() {
6730
+ var _a;
6731
+ if (this.options.operationFilters && this.spec.paths) {
6732
+ const requestSchemas = /* @__PURE__ */ new Set();
6733
+ const responseSchemas = /* @__PURE__ */ new Set();
7069
6734
  for (const [path, pathItem] of Object.entries(this.spec.paths)) {
7070
- const methods = ["get", "post", "put", "patch", "delete", "head", "options"];
7071
- for (const method of methods) {
6735
+ if (!isOpenAPIPathItem(pathItem)) continue;
6736
+ for (const method of HTTP_METHODS) {
7072
6737
  const operation = pathItem[method];
7073
- if (typeof operation !== "object" || !operation) continue;
6738
+ if (!operation) continue;
7074
6739
  this.filterStats.totalOperations++;
7075
- if (!shouldIncludeOperation(operation, path, method, this.options.operationFilters, this.filterStats)) {
6740
+ if (!(0, import_openapi_core6.shouldIncludeOperation)(operation, path, method, this.options.operationFilters, this.filterStats)) {
7076
6741
  continue;
7077
6742
  }
7078
6743
  this.filterStats.includedOperations++;
7079
- if ("requestBody" in operation && operation.requestBody && typeof operation.requestBody === "object" && "content" in operation.requestBody && operation.requestBody.content) {
7080
- for (const mediaType of Object.values(operation.requestBody.content)) {
7081
- if (mediaType && typeof mediaType === "object" && "schema" in mediaType && mediaType.schema) {
7082
- this.extractSchemaRefs(mediaType.schema, requestSchemas);
6744
+ if (operation.requestBody && typeof operation.requestBody === "object") {
6745
+ const reqBody = operation.requestBody;
6746
+ if (reqBody.content && typeof reqBody.content === "object") {
6747
+ for (const mediaType of Object.values(reqBody.content)) {
6748
+ if (mediaType && typeof mediaType === "object" && "schema" in mediaType && mediaType.schema) {
6749
+ (0, import_openapi_core6.extractSchemaRefs)(mediaType.schema, requestSchemas);
6750
+ }
7083
6751
  }
7084
6752
  }
7085
6753
  }
7086
- if ("responses" in operation && operation.responses && typeof operation.responses === "object") {
6754
+ if (operation.responses && typeof operation.responses === "object") {
7087
6755
  for (const response of Object.values(operation.responses)) {
7088
6756
  if (response && typeof response === "object" && "content" in response && response.content && typeof response.content === "object") {
7089
6757
  for (const mediaType of Object.values(response.content)) {
7090
6758
  if (mediaType && typeof mediaType === "object" && "schema" in mediaType && mediaType.schema) {
7091
- this.extractSchemaRefs(mediaType.schema, responseSchemas);
6759
+ (0, import_openapi_core6.extractSchemaRefs)(mediaType.schema, responseSchemas);
7092
6760
  }
7093
6761
  }
7094
6762
  }
7095
6763
  }
7096
6764
  }
7097
- if ("parameters" in operation && Array.isArray(operation.parameters)) {
6765
+ if (operation.parameters && Array.isArray(operation.parameters)) {
7098
6766
  for (const param of operation.parameters) {
7099
- if (param && typeof param === "object" && "schema" in param && param.schema) {
7100
- this.extractSchemaRefs(param.schema, requestSchemas);
6767
+ if (isResolvedParameter(param) && param.schema) {
6768
+ (0, import_openapi_core6.extractSchemaRefs)(param.schema, requestSchemas);
7101
6769
  }
7102
6770
  }
7103
6771
  }
7104
6772
  }
7105
6773
  }
7106
- this.expandTransitiveReferences(requestSchemas);
7107
- this.expandTransitiveReferences(responseSchemas);
7108
- }
7109
- if (!this.spec.paths || requestSchemas.size === 0 && responseSchemas.size === 0) {
7110
- for (const [name, schema] of Object.entries(((_a = this.spec.components) == null ? void 0 : _a.schemas) || {})) {
7111
- const hasReadOnly = this.hasReadOnlyProperties(schema);
7112
- const hasWriteOnly = this.hasWriteOnlyProperties(schema);
7113
- if (hasWriteOnly && !hasReadOnly) {
7114
- requestSchemas.add(name);
7115
- } else if (hasReadOnly && !hasWriteOnly) {
7116
- responseSchemas.add(name);
6774
+ (0, import_openapi_core6.expandTransitiveReferences)(requestSchemas, this.spec);
6775
+ (0, import_openapi_core6.expandTransitiveReferences)(responseSchemas, this.spec);
6776
+ for (const [name] of Object.entries(((_a = this.spec.components) == null ? void 0 : _a.schemas) || {})) {
6777
+ if (requestSchemas.has(name) && responseSchemas.has(name)) {
6778
+ this.schemaUsageMap.set(name, "both");
6779
+ } else if (requestSchemas.has(name)) {
6780
+ this.schemaUsageMap.set(name, "request");
6781
+ } else if (responseSchemas.has(name)) {
6782
+ this.schemaUsageMap.set(name, "response");
7117
6783
  }
7118
6784
  }
7119
- }
7120
- for (const [name] of Object.entries(((_b = this.spec.components) == null ? void 0 : _b.schemas) || {})) {
7121
- if (requestSchemas.has(name) && responseSchemas.has(name)) {
6785
+ const circularSchemas = (0, import_openapi_core6.detectCircularReferences)(this.spec);
6786
+ for (const name of circularSchemas) {
7122
6787
  this.schemaUsageMap.set(name, "both");
7123
- } else if (requestSchemas.has(name)) {
7124
- this.schemaUsageMap.set(name, "request");
7125
- } else if (responseSchemas.has(name)) {
7126
- this.schemaUsageMap.set(name, "response");
7127
6788
  }
7128
- }
7129
- this.detectCircularReferences();
7130
- }
7131
- /**
7132
- * Expand a set of schemas to include all transitively referenced schemas
7133
- */
7134
- expandTransitiveReferences(schemas) {
7135
- var _a, _b;
7136
- const toProcess = Array.from(schemas);
7137
- const processed = /* @__PURE__ */ new Set();
7138
- while (toProcess.length > 0) {
7139
- const schemaName = toProcess.pop();
7140
- if (!schemaName || processed.has(schemaName)) continue;
7141
- processed.add(schemaName);
7142
- const schema = (_b = (_a = this.spec.components) == null ? void 0 : _a.schemas) == null ? void 0 : _b[schemaName];
7143
- if (schema) {
7144
- const refs = /* @__PURE__ */ new Set();
7145
- this.extractSchemaRefs(schema, refs);
7146
- for (const ref of refs) {
7147
- if (!schemas.has(ref)) {
7148
- schemas.add(ref);
7149
- toProcess.push(ref);
7150
- }
7151
- }
7152
- }
7153
- }
7154
- }
7155
- /**
7156
- * Extract schema names from $ref and nested structures
7157
- */
7158
- extractSchemaRefs(schema, refs) {
7159
- if (!schema) return;
7160
- if (schema.$ref) {
7161
- const refName = resolveRef(schema.$ref);
7162
- refs.add(refName);
7163
- }
7164
- if (schema.allOf) {
7165
- for (const subSchema of schema.allOf) {
7166
- this.extractSchemaRefs(subSchema, refs);
7167
- }
7168
- }
7169
- if (schema.oneOf) {
7170
- for (const subSchema of schema.oneOf) {
7171
- this.extractSchemaRefs(subSchema, refs);
7172
- }
7173
- }
7174
- if (schema.anyOf) {
7175
- for (const subSchema of schema.anyOf) {
7176
- this.extractSchemaRefs(subSchema, refs);
7177
- }
7178
- }
7179
- if (schema.items) {
7180
- this.extractSchemaRefs(schema.items, refs);
7181
- }
7182
- if (schema.properties) {
7183
- for (const prop of Object.values(schema.properties)) {
7184
- this.extractSchemaRefs(prop, refs);
7185
- }
7186
- }
7187
- }
7188
- /**
7189
- * Check if schema has readOnly properties
7190
- */
7191
- hasReadOnlyProperties(schema) {
7192
- if (schema.readOnly) return true;
7193
- if (schema.properties) {
7194
- for (const prop of Object.values(schema.properties)) {
7195
- if (this.hasReadOnlyProperties(prop)) return true;
7196
- }
7197
- }
7198
- return false;
7199
- }
7200
- /**
7201
- * Check if schema has writeOnly properties
7202
- */
7203
- hasWriteOnlyProperties(schema) {
7204
- if (schema.writeOnly) return true;
7205
- if (schema.properties) {
7206
- for (const prop of Object.values(schema.properties)) {
7207
- if (this.hasWriteOnlyProperties(prop)) return true;
7208
- }
7209
- }
7210
- return false;
7211
- }
7212
- /**
7213
- * Detect circular references and mark them as "both" context for safety
7214
- */
7215
- detectCircularReferences() {
7216
- var _a;
7217
- const visited = /* @__PURE__ */ new Set();
7218
- const recursionStack = /* @__PURE__ */ new Set();
7219
- const detectCycle = (name) => {
7220
- var _a2, _b;
7221
- if (recursionStack.has(name)) {
7222
- return true;
7223
- }
7224
- if (visited.has(name)) {
7225
- return false;
7226
- }
7227
- visited.add(name);
7228
- recursionStack.add(name);
7229
- const schema = (_b = (_a2 = this.spec.components) == null ? void 0 : _a2.schemas) == null ? void 0 : _b[name];
7230
- if (schema) {
7231
- const refs = /* @__PURE__ */ new Set();
7232
- this.extractSchemaRefs(schema, refs);
7233
- for (const ref of refs) {
7234
- if (detectCycle(ref)) {
7235
- this.schemaUsageMap.set(name, "both");
7236
- recursionStack.delete(name);
7237
- return true;
6789
+ } else {
6790
+ const analysis = (0, import_openapi_core6.analyzeSchemaUsage)(this.spec);
6791
+ this.schemaUsageMap = analysis.usageMap;
6792
+ if (this.spec.paths) {
6793
+ for (const pathItem of Object.values(this.spec.paths)) {
6794
+ if (!isOpenAPIPathItem(pathItem)) continue;
6795
+ for (const method of HTTP_METHODS) {
6796
+ const operation = pathItem[method];
6797
+ if (typeof operation === "object" && operation) {
6798
+ this.filterStats.totalOperations++;
6799
+ this.filterStats.includedOperations++;
6800
+ }
7238
6801
  }
7239
6802
  }
7240
6803
  }
7241
- recursionStack.delete(name);
7242
- return false;
7243
- };
7244
- for (const name of Object.keys(((_a = this.spec.components) == null ? void 0 : _a.schemas) || {})) {
7245
- detectCycle(name);
7246
6804
  }
7247
6805
  }
7248
6806
  /**
@@ -7251,7 +6809,7 @@ var OpenApiGenerator = class {
7251
6809
  validateSpec() {
7252
6810
  var _a;
7253
6811
  if (!((_a = this.spec.components) == null ? void 0 : _a.schemas)) {
7254
- throw new SpecValidationError(
6812
+ throw new import_openapi_core6.SpecValidationError(
7255
6813
  `No schemas found in OpenAPI spec at ${this.options.input}. Expected to find schemas at components.schemas`,
7256
6814
  { filePath: this.options.input }
7257
6815
  );
@@ -7262,7 +6820,7 @@ var OpenApiGenerator = class {
7262
6820
  this.validateSchemaRefs(name, schema, allSchemas);
7263
6821
  } catch (error) {
7264
6822
  if (error instanceof Error) {
7265
- throw new SchemaGenerationError(`Invalid schema '${name}': ${error.message}`, name, {
6823
+ throw new import_openapi_core6.SchemaGenerationError(`Invalid schema '${name}': ${error.message}`, name, {
7266
6824
  originalError: error.message
7267
6825
  });
7268
6826
  }
@@ -7275,9 +6833,9 @@ var OpenApiGenerator = class {
7275
6833
  */
7276
6834
  validateSchemaRefs(schemaName, schema, allSchemas, path = "") {
7277
6835
  if (schema.$ref) {
7278
- const refName = resolveRef(schema.$ref);
6836
+ const refName = (0, import_openapi_core6.resolveRefName)(schema.$ref);
7279
6837
  if (!allSchemas.includes(refName)) {
7280
- throw new SpecValidationError(
6838
+ throw new import_openapi_core6.SpecValidationError(
7281
6839
  `Invalid reference${path ? ` at '${path}'` : ""}: '${schema.$ref}' points to non-existent schema '${refName}'`,
7282
6840
  { schemaName, path, ref: schema.$ref, refName }
7283
6841
  );
@@ -7324,7 +6882,7 @@ var OpenApiGenerator = class {
7324
6882
  const resolvedOptions = context === "response" ? this.responseOptions : this.requestOptions;
7325
6883
  if (schema.enum) {
7326
6884
  const jsdoc2 = generateJSDoc(schema, name, { includeDescriptions: resolvedOptions.includeDescriptions });
7327
- const strippedName2 = stripPrefix(name, this.options.stripSchemaPrefix);
6885
+ const strippedName2 = (0, import_openapi_core6.stripPrefix)(name, this.options.stripSchemaPrefix);
7328
6886
  const { schemaCode, typeCode } = generateEnum(strippedName2, schema.enum, {
7329
6887
  prefix: this.options.prefix,
7330
6888
  suffix: this.options.suffix
@@ -7334,11 +6892,11 @@ ${typeCode}`;
7334
6892
  this.schemas.set(name, enumSchemaCode);
7335
6893
  return;
7336
6894
  }
7337
- const strippedName = stripPrefix(name, this.options.stripSchemaPrefix);
7338
- const schemaName = `${toCamelCase(strippedName, { prefix: this.options.prefix, suffix: this.options.suffix })}Schema`;
7339
- const jsdoc = generateJSDoc(schema, name, { includeDescriptions: resolvedOptions.includeDescriptions });
6895
+ const strippedName = (0, import_openapi_core6.stripPrefix)(name, this.options.stripSchemaPrefix);
6896
+ const schemaName = `${(0, import_openapi_core6.toCamelCase)(strippedName, { prefix: this.options.prefix, suffix: this.options.suffix })}Schema`;
6897
+ let jsdoc = generateJSDoc(schema, name, { includeDescriptions: resolvedOptions.includeDescriptions });
7340
6898
  if (schema.allOf && schema.allOf.length === 1 && schema.allOf[0].$ref) {
7341
- const refName = resolveRef(schema.allOf[0].$ref);
6899
+ const refName = (0, import_openapi_core6.resolveRefName)(schema.allOf[0].$ref);
7342
6900
  (_a = this.schemaDependencies.get(name)) == null ? void 0 : _a.add(refName);
7343
6901
  }
7344
6902
  this.propertyGenerator = new PropertyGenerator({
@@ -7356,9 +6914,26 @@ ${typeCode}`;
7356
6914
  },
7357
6915
  stripSchemaPrefix: this.options.stripSchemaPrefix,
7358
6916
  dateTimeValidation: this.dateTimeValidation,
7359
- patternCache: this.patternCache
6917
+ patternCache: this.patternCache,
6918
+ separateTypesFile: this.separateSchemasMode
7360
6919
  });
6920
+ this.propertyGenerator.setCircularDependencies(this.circularDependencies);
6921
+ this.propertyGenerator.clearAllOfConflicts();
7361
6922
  const zodSchema = this.propertyGenerator.generatePropertySchema(schema, name, true);
6923
+ const allOfConflicts = this.propertyGenerator.getAllOfConflicts();
6924
+ if (allOfConflicts.length > 0) {
6925
+ this.allOfConflictCount += allOfConflicts.length;
6926
+ const conflictWarning = this.generateConflictJSDoc(allOfConflicts);
6927
+ if (jsdoc) {
6928
+ jsdoc = jsdoc.replace(/ \*\/\n$/, `
6929
+ ${conflictWarning} */
6930
+ `);
6931
+ } else {
6932
+ jsdoc = `/**
6933
+ ${conflictWarning} */
6934
+ `;
6935
+ }
6936
+ }
7362
6937
  const zodSchemaCode = `${jsdoc}export const ${schemaName} = ${zodSchema};`;
7363
6938
  if (zodSchema.includes("z.discriminatedUnion(")) {
7364
6939
  const match = zodSchema.match(/z\.discriminatedUnion\([^,]+,\s*\[([^\]]+)\]/);
@@ -7384,28 +6959,27 @@ ${typeCode}`;
7384
6959
  return;
7385
6960
  }
7386
6961
  for (const [path, pathItem] of Object.entries(this.spec.paths)) {
7387
- if (!pathItem || typeof pathItem !== "object") continue;
7388
- const methods = ["get", "post", "put", "patch", "delete", "head", "options"];
7389
- for (const method of methods) {
6962
+ if (!isOpenAPIPathItem(pathItem)) continue;
6963
+ for (const method of HTTP_METHODS) {
7390
6964
  const operation = pathItem[method];
7391
6965
  if (!operation) continue;
7392
- if (!shouldIncludeOperation(operation, path, method, this.options.operationFilters)) {
6966
+ if (!(0, import_openapi_core6.shouldIncludeOperation)(operation, path, method, this.options.operationFilters)) {
7393
6967
  continue;
7394
6968
  }
7395
- const allParams = mergeParameters(pathItem.parameters, operation.parameters, this.spec);
6969
+ const allParams = (0, import_openapi_core6.mergeParameters)(pathItem.parameters, operation.parameters, this.spec);
7396
6970
  const queryParams = allParams.filter(
7397
- (param) => param && typeof param === "object" && param.in === "query"
6971
+ (param) => isResolvedParameter(param) && param.in === "query"
7398
6972
  );
7399
6973
  if (queryParams.length === 0) {
7400
6974
  continue;
7401
6975
  }
7402
- let pascalOperationId;
7403
- if (operation.operationId) {
7404
- pascalOperationId = operation.operationId.includes("-") ? toPascalCase(operation.operationId) : operation.operationId.charAt(0).toUpperCase() + operation.operationId.slice(1);
7405
- } else {
7406
- const strippedPath = stripPathPrefix(path, this.options.stripPathPrefix);
7407
- pascalOperationId = this.generateMethodNameFromPath(method, strippedPath);
7408
- }
6976
+ const strippedPath = (0, import_openapi_core6.stripPathPrefix)(path, this.options.stripPathPrefix);
6977
+ const pascalOperationId = (0, import_openapi_core6.getOperationName)(
6978
+ operation.operationId,
6979
+ method,
6980
+ strippedPath,
6981
+ this.options.useOperationId
6982
+ );
7409
6983
  const schemaName = `${pascalOperationId}QueryParams`;
7410
6984
  if (!this.schemaDependencies.has(schemaName)) {
7411
6985
  this.schemaDependencies.set(schemaName, /* @__PURE__ */ new Set());
@@ -7435,7 +7009,7 @@ ${typeCode}`;
7435
7009
  required.push(paramName);
7436
7010
  }
7437
7011
  if (paramSchema.$ref) {
7438
- const refName = resolveRef(paramSchema.$ref);
7012
+ const refName = (0, import_openapi_core6.resolveRefName)(paramSchema.$ref);
7439
7013
  (_a = this.schemaDependencies.get(schemaName)) == null ? void 0 : _a.add(refName);
7440
7014
  }
7441
7015
  }
@@ -7450,9 +7024,7 @@ ${typeCode}`;
7450
7024
  ${propsCode}
7451
7025
  })`;
7452
7026
  const operationName = pascalOperationId;
7453
- const prefixedName = this.options.prefix ? `${toPascalCase(this.options.prefix)}${operationName}` : operationName;
7454
- const suffixedName = this.options.suffix ? `${prefixedName}${toPascalCase(this.options.suffix)}` : prefixedName;
7455
- const camelCaseSchemaName = `${suffixedName.charAt(0).toLowerCase() + suffixedName.slice(1)}QueryParamsSchema`;
7027
+ const camelCaseSchemaName = `${(0, import_openapi_core6.toCamelCase)(operationName, { prefix: this.options.prefix, suffix: this.options.suffix })}QueryParamsSchema`;
7456
7028
  const jsdocOperationName = operation.operationId || `${method.toUpperCase()} ${path}`;
7457
7029
  const jsdoc = `/**
7458
7030
  * Query parameters for ${jsdocOperationName}
@@ -7464,35 +7036,6 @@ ${propsCode}
7464
7036
  }
7465
7037
  }
7466
7038
  }
7467
- /**
7468
- * Generate a PascalCase method name from HTTP method and path
7469
- * Used as fallback when operationId is not available
7470
- * @internal
7471
- */
7472
- generateMethodNameFromPath(method, path) {
7473
- const segments = path.split("/").filter(Boolean).map((segment) => {
7474
- if (segment.startsWith("{") && segment.endsWith("}")) {
7475
- const paramName = segment.slice(1, -1);
7476
- return `By${this.capitalizeSegment(paramName)}`;
7477
- }
7478
- return this.capitalizeSegment(segment);
7479
- }).join("");
7480
- const capitalizedMethod = method.charAt(0).toUpperCase() + method.slice(1).toLowerCase();
7481
- return `${capitalizedMethod}${segments}`;
7482
- }
7483
- /**
7484
- * Capitalizes a path segment, handling special characters like dashes, underscores, and dots
7485
- * @internal
7486
- */
7487
- capitalizeSegment(str) {
7488
- if (str.includes("-") || str.includes("_") || str.includes(".")) {
7489
- return str.split(/[-_.]/).map((part) => {
7490
- if (!part) return "";
7491
- return part.charAt(0).toUpperCase() + part.slice(1).toLowerCase();
7492
- }).join("");
7493
- }
7494
- return str.charAt(0).toUpperCase() + str.slice(1);
7495
- }
7496
7039
  /**
7497
7040
  * Check if a header should be ignored based on filter patterns
7498
7041
  * @internal
@@ -7508,7 +7051,7 @@ ${propsCode}
7508
7051
  const headerLower = headerName.toLowerCase();
7509
7052
  return ignorePatterns.some((pattern) => {
7510
7053
  const patternLower = pattern.toLowerCase();
7511
- return (0, import_minimatch3.minimatch)(headerLower, patternLower);
7054
+ return (0, import_minimatch.minimatch)(headerLower, patternLower);
7512
7055
  });
7513
7056
  }
7514
7057
  /**
@@ -7521,28 +7064,27 @@ ${propsCode}
7521
7064
  return;
7522
7065
  }
7523
7066
  for (const [path, pathItem] of Object.entries(this.spec.paths)) {
7524
- if (!pathItem || typeof pathItem !== "object") continue;
7525
- const methods = ["get", "post", "put", "patch", "delete", "head", "options"];
7526
- for (const method of methods) {
7067
+ if (!isOpenAPIPathItem(pathItem)) continue;
7068
+ for (const method of HTTP_METHODS) {
7527
7069
  const operation = pathItem[method];
7528
7070
  if (!operation) continue;
7529
- if (!shouldIncludeOperation(operation, path, method, this.options.operationFilters)) {
7071
+ if (!(0, import_openapi_core6.shouldIncludeOperation)(operation, path, method, this.options.operationFilters)) {
7530
7072
  continue;
7531
7073
  }
7532
- const allParams = mergeParameters(pathItem.parameters, operation.parameters, this.spec);
7074
+ const allParams = (0, import_openapi_core6.mergeParameters)(pathItem.parameters, operation.parameters, this.spec);
7533
7075
  const headerParams = allParams.filter(
7534
- (param) => param && typeof param === "object" && param.in === "header" && !this.shouldIgnoreHeader(param.name)
7076
+ (param) => isResolvedParameter(param) && param.in === "header" && !this.shouldIgnoreHeader(param.name)
7535
7077
  );
7536
7078
  if (headerParams.length === 0) {
7537
7079
  continue;
7538
7080
  }
7539
- let pascalOperationId;
7540
- if (operation.operationId) {
7541
- pascalOperationId = operation.operationId.includes("-") ? toPascalCase(operation.operationId) : operation.operationId.charAt(0).toUpperCase() + operation.operationId.slice(1);
7542
- } else {
7543
- const strippedPath = stripPathPrefix(path, this.options.stripPathPrefix);
7544
- pascalOperationId = this.generateMethodNameFromPath(method, strippedPath);
7545
- }
7081
+ const strippedPath = (0, import_openapi_core6.stripPathPrefix)(path, this.options.stripPathPrefix);
7082
+ const pascalOperationId = (0, import_openapi_core6.getOperationName)(
7083
+ operation.operationId,
7084
+ method,
7085
+ strippedPath,
7086
+ this.options.useOperationId
7087
+ );
7546
7088
  const schemaName = `${pascalOperationId}HeaderParams`;
7547
7089
  if (!this.schemaDependencies.has(schemaName)) {
7548
7090
  this.schemaDependencies.set(schemaName, /* @__PURE__ */ new Set());
@@ -7561,7 +7103,7 @@ ${propsCode}
7561
7103
  zodType = `${zodType}.optional()`;
7562
7104
  properties[paramName] = zodType;
7563
7105
  if (paramSchema.$ref) {
7564
- const refName = resolveRef(paramSchema.$ref);
7106
+ const refName = (0, import_openapi_core6.resolveRefName)(paramSchema.$ref);
7565
7107
  (_a = this.schemaDependencies.get(schemaName)) == null ? void 0 : _a.add(refName);
7566
7108
  }
7567
7109
  }
@@ -7576,9 +7118,7 @@ ${propsCode}
7576
7118
  ${propsCode}
7577
7119
  })`;
7578
7120
  const operationName = pascalOperationId;
7579
- const prefixedName = this.options.prefix ? `${toPascalCase(this.options.prefix)}${operationName}` : operationName;
7580
- const suffixedName = this.options.suffix ? `${prefixedName}${toPascalCase(this.options.suffix)}` : prefixedName;
7581
- const camelCaseSchemaName = `${suffixedName.charAt(0).toLowerCase() + suffixedName.slice(1)}HeaderParamsSchema`;
7121
+ const camelCaseSchemaName = `${(0, import_openapi_core6.toCamelCase)(operationName, { prefix: this.options.prefix, suffix: this.options.suffix })}HeaderParamsSchema`;
7582
7122
  const jsdocOperationName = operation.operationId || `${method.toUpperCase()} ${path}`;
7583
7123
  const jsdoc = `/**
7584
7124
  * Header parameters for ${jsdocOperationName}
@@ -7595,9 +7135,9 @@ ${propsCode}
7595
7135
  */
7596
7136
  generateQueryParamType(schema, param) {
7597
7137
  if (schema.$ref) {
7598
- const refName = resolveRef(schema.$ref);
7599
- const strippedRefName = stripPrefix(refName, this.options.stripSchemaPrefix);
7600
- const schemaName = toCamelCase(strippedRefName, { prefix: this.options.prefix, suffix: this.options.suffix });
7138
+ const refName = (0, import_openapi_core6.resolveRefName)(schema.$ref);
7139
+ const strippedRefName = (0, import_openapi_core6.stripPrefix)(refName, this.options.stripSchemaPrefix);
7140
+ const schemaName = (0, import_openapi_core6.toCamelCase)(strippedRefName, { prefix: this.options.prefix, suffix: this.options.suffix });
7601
7141
  return `${schemaName}Schema`;
7602
7142
  }
7603
7143
  if (schema.enum) {
@@ -7614,7 +7154,7 @@ ${propsCode}
7614
7154
  if (typeof v === "string") {
7615
7155
  return `z.literal("${v}")`;
7616
7156
  }
7617
- return `z.literal(${v})`;
7157
+ return `z.literal(${String(v)})`;
7618
7158
  }).join(", ");
7619
7159
  return `z.union([${literalValues}])`;
7620
7160
  }
@@ -7694,17 +7234,23 @@ ${propsCode}
7694
7234
  return;
7695
7235
  }
7696
7236
  const deps = this.schemaDependencies.get(name);
7237
+ let dependsOnCircular = false;
7697
7238
  if (deps && deps.size > 0) {
7698
7239
  for (const dep of deps) {
7699
7240
  if (this.schemas.has(dep) || this.types.has(dep)) {
7700
7241
  visit(dep);
7242
+ if (circularDeps.has(dep)) {
7243
+ dependsOnCircular = true;
7244
+ }
7701
7245
  }
7702
7246
  }
7703
7247
  }
7704
7248
  visiting.delete(name);
7705
7249
  visited.add(name);
7706
- if (!circularDeps.has(name)) {
7250
+ if (!circularDeps.has(name) && !dependsOnCircular) {
7707
7251
  sorted.push(name);
7252
+ } else if (dependsOnCircular && !circularDeps.has(name)) {
7253
+ circularDeps.add(name);
7708
7254
  }
7709
7255
  };
7710
7256
  const allNames = /* @__PURE__ */ new Set([...this.schemas.keys(), ...this.types.keys()]);
@@ -7712,9 +7258,8 @@ ${propsCode}
7712
7258
  visit(name);
7713
7259
  }
7714
7260
  for (const name of circularDeps) {
7715
- if (!visited.has(name)) {
7261
+ if (!sorted.includes(name)) {
7716
7262
  sorted.push(name);
7717
- visited.add(name);
7718
7263
  }
7719
7264
  }
7720
7265
  return [...sorted, ...aliases];
@@ -7741,11 +7286,12 @@ ${propsCode}
7741
7286
  `// Total schemas: ${stats.totalSchemas}`,
7742
7287
  `// Circular references: ${stats.withCircularRefs}`,
7743
7288
  `// Discriminated unions: ${stats.withDiscriminators}`,
7744
- `// With constraints: ${stats.withConstraints}`
7289
+ `// With constraints: ${stats.withConstraints}`,
7290
+ `// AllOf conflicts: ${this.allOfConflictCount}`
7745
7291
  ];
7746
7292
  if (this.options.operationFilters && this.filterStats.totalOperations > 0) {
7747
7293
  output.push("//");
7748
- const filterStatsStr = formatFilterStatistics(this.filterStats);
7294
+ const filterStatsStr = (0, import_openapi_core6.formatFilterStatistics)(this.filterStats);
7749
7295
  for (const line of filterStatsStr.split("\n")) {
7750
7296
  output.push(`// ${line}`);
7751
7297
  }
@@ -7753,220 +7299,229 @@ ${propsCode}
7753
7299
  output.push(`// Generated at: ${(/* @__PURE__ */ new Date()).toISOString()}`);
7754
7300
  return output;
7755
7301
  }
7302
+ /**
7303
+ * Pre-analyze schemas to detect circular dependencies before code generation.
7304
+ * This allows the property generator to use z.lazy() for forward references.
7305
+ */
7306
+ analyzeCircularDependencies() {
7307
+ var _a;
7308
+ if (!((_a = this.spec.components) == null ? void 0 : _a.schemas)) return;
7309
+ const dependencies = /* @__PURE__ */ new Map();
7310
+ const collectDependencies = (name, schema, visited2 = /* @__PURE__ */ new Set()) => {
7311
+ if (visited2.has(name)) return /* @__PURE__ */ new Set();
7312
+ visited2.add(name);
7313
+ const deps = /* @__PURE__ */ new Set();
7314
+ if (schema.$ref) {
7315
+ const refName = (0, import_openapi_core6.resolveRefName)(schema.$ref);
7316
+ deps.add(refName);
7317
+ }
7318
+ if (schema.allOf) {
7319
+ for (const item of schema.allOf) {
7320
+ const itemDeps = collectDependencies(`${name}_allOf`, item, new Set(visited2));
7321
+ for (const dep of itemDeps) deps.add(dep);
7322
+ }
7323
+ }
7324
+ if (schema.oneOf) {
7325
+ for (const item of schema.oneOf) {
7326
+ const itemDeps = collectDependencies(`${name}_oneOf`, item, new Set(visited2));
7327
+ for (const dep of itemDeps) deps.add(dep);
7328
+ }
7329
+ }
7330
+ if (schema.anyOf) {
7331
+ for (const item of schema.anyOf) {
7332
+ const itemDeps = collectDependencies(`${name}_anyOf`, item, new Set(visited2));
7333
+ for (const dep of itemDeps) deps.add(dep);
7334
+ }
7335
+ }
7336
+ if (schema.properties) {
7337
+ for (const propSchema of Object.values(schema.properties)) {
7338
+ const propDeps = collectDependencies(`${name}_prop`, propSchema, new Set(visited2));
7339
+ for (const dep of propDeps) deps.add(dep);
7340
+ }
7341
+ }
7342
+ if (schema.items) {
7343
+ const itemDeps = collectDependencies(`${name}_items`, schema.items, new Set(visited2));
7344
+ for (const dep of itemDeps) deps.add(dep);
7345
+ }
7346
+ if (schema.additionalProperties && typeof schema.additionalProperties === "object") {
7347
+ const addDeps = collectDependencies(`${name}_additional`, schema.additionalProperties, new Set(visited2));
7348
+ for (const dep of addDeps) deps.add(dep);
7349
+ }
7350
+ return deps;
7351
+ };
7352
+ for (const [name, schema] of Object.entries(this.spec.components.schemas)) {
7353
+ if (this.options.operationFilters && this.schemaUsageMap.size > 0 && !this.schemaUsageMap.has(name)) {
7354
+ continue;
7355
+ }
7356
+ dependencies.set(name, collectDependencies(name, schema));
7357
+ }
7358
+ const visited = /* @__PURE__ */ new Set();
7359
+ const visiting = /* @__PURE__ */ new Set();
7360
+ const detectCircular = (name, path = []) => {
7361
+ if (visited.has(name)) return;
7362
+ if (visiting.has(name)) {
7363
+ const cycleStart = path.indexOf(name);
7364
+ if (cycleStart >= 0) {
7365
+ for (let i = cycleStart; i < path.length; i++) {
7366
+ this.circularDependencies.add(path[i]);
7367
+ }
7368
+ }
7369
+ this.circularDependencies.add(name);
7370
+ return;
7371
+ }
7372
+ visiting.add(name);
7373
+ path.push(name);
7374
+ const deps = dependencies.get(name);
7375
+ if (deps) {
7376
+ for (const dep of deps) {
7377
+ if (dependencies.has(dep)) {
7378
+ detectCircular(dep, [...path]);
7379
+ }
7380
+ }
7381
+ }
7382
+ visiting.delete(name);
7383
+ visited.add(name);
7384
+ };
7385
+ for (const name of dependencies.keys()) {
7386
+ detectCircular(name, []);
7387
+ }
7388
+ }
7389
+ /**
7390
+ * Generate JSDoc warning for allOf conflicts
7391
+ * @param conflicts Array of conflict description strings
7392
+ * @returns JSDoc formatted warning string
7393
+ */
7394
+ generateConflictJSDoc(conflicts) {
7395
+ const lines = [" * @warning allOf property conflicts detected:"];
7396
+ for (const conflict of conflicts) {
7397
+ lines.push(` * - ${conflict}`);
7398
+ }
7399
+ return `${lines.join("\n")}
7400
+ `;
7401
+ }
7756
7402
  };
7757
7403
 
7758
7404
  // src/utils/config-loader.ts
7759
7405
  init_cjs_shims();
7760
- var import_cosmiconfig = require("cosmiconfig");
7761
- var import_zod2 = require("zod");
7762
-
7763
- // src/utils/config-schemas.ts
7764
- init_cjs_shims();
7406
+ var import_openapi_core7 = require("@cerios/openapi-core");
7765
7407
  var import_zod = require("zod");
7766
- var RequestResponseOptionsSchema = import_zod.z.strictObject({
7408
+ var ZodSpecificOptionsSchema = import_zod.z.strictObject({
7767
7409
  mode: import_zod.z.enum(["strict", "normal", "loose"]).optional(),
7768
7410
  useDescribe: import_zod.z.boolean().optional(),
7769
- includeDescriptions: import_zod.z.boolean().optional(),
7770
- defaultNullable: import_zod.z.boolean().optional(),
7771
- emptyObjectBehavior: import_zod.z.enum(["strict", "loose", "record"]).optional()
7411
+ emptyObjectBehavior: import_zod.z.enum(["strict", "loose", "record"]).optional(),
7412
+ schemaType: import_zod.z.enum(["all", "request", "response"]).optional(),
7413
+ request: import_openapi_core7.RequestResponseOptionsSchema.optional(),
7414
+ response: import_openapi_core7.RequestResponseOptionsSchema.optional(),
7415
+ customDateTimeFormatRegex: import_openapi_core7.RegexPatternSchema.optional(),
7416
+ outputZodSchemas: import_zod.z.string().optional(),
7417
+ enumFormat: import_zod.z.enum(["union", "const-object"]).optional(),
7418
+ typeAssertionThreshold: import_zod.z.number().int().gte(0).optional()
7772
7419
  });
7773
- var OperationFiltersSchema = import_zod.z.strictObject({
7774
- includeTags: import_zod.z.array(import_zod.z.string()).optional(),
7775
- excludeTags: import_zod.z.array(import_zod.z.string()).optional(),
7776
- includePaths: import_zod.z.array(import_zod.z.string()).optional(),
7777
- excludePaths: import_zod.z.array(import_zod.z.string()).optional(),
7778
- includeMethods: import_zod.z.array(import_zod.z.string()).optional(),
7779
- excludeMethods: import_zod.z.array(import_zod.z.string()).optional(),
7780
- includeOperationIds: import_zod.z.array(import_zod.z.string()).optional(),
7781
- excludeOperationIds: import_zod.z.array(import_zod.z.string()).optional(),
7782
- excludeDeprecated: import_zod.z.boolean().optional()
7420
+ var OpenApiGeneratorOptionsSchema = import_openapi_core7.BaseGeneratorOptionsSchema.extend({
7421
+ ...ZodSpecificOptionsSchema.shape,
7422
+ outputTypes: import_zod.z.string().optional(),
7423
+ output: import_zod.z.string().optional()
7424
+ }).superRefine((spec, ctx) => {
7425
+ const hasOutputTypes = Boolean(spec.outputTypes);
7426
+ const hasOutput = Boolean(spec.output);
7427
+ const hasOutputZodSchemas = Boolean(spec.outputZodSchemas);
7428
+ if (hasOutputZodSchemas && !hasOutputTypes && !hasOutput) {
7429
+ ctx.addIssue({
7430
+ code: "custom",
7431
+ path: ["outputTypes"],
7432
+ message: "When 'outputZodSchemas' is specified, 'outputTypes' is required for TypeScript type definitions."
7433
+ });
7434
+ }
7435
+ if (!hasOutputZodSchemas && !hasOutputTypes && !hasOutput) {
7436
+ ctx.addIssue({
7437
+ code: "custom",
7438
+ path: ["outputTypes"],
7439
+ message: "Each spec must specify an output file path using 'outputTypes' (preferred) or deprecated 'output'."
7440
+ });
7441
+ }
7442
+ if (hasOutputTypes && hasOutput && spec.outputTypes !== spec.output) {
7443
+ ctx.addIssue({
7444
+ code: "custom",
7445
+ path: ["output"],
7446
+ message: "Invalid configuration: 'outputTypes' and deprecated 'output' are both set but have different values."
7447
+ });
7448
+ }
7783
7449
  });
7784
-
7785
- // src/utils/config-validation.ts
7786
- init_cjs_shims();
7787
- function formatConfigValidationError(error, filepath, configPath, additionalNotes) {
7788
- var _a;
7789
- const formattedErrors = ((_a = error.issues) == null ? void 0 : _a.map((err) => {
7790
- const path = err.path.length > 0 ? err.path.join(".") : "root";
7791
- return ` - ${path}: ${err.message}`;
7792
- }).join("\n")) || "Unknown validation error";
7793
- const configSource = filepath || configPath || "config file";
7794
- const lines = [
7795
- `Invalid configuration file at: ${configSource}`,
7796
- "",
7797
- "Validation errors:",
7798
- formattedErrors,
7799
- "",
7800
- "Please check your configuration file and ensure:",
7801
- " - All required fields are present (specs array with input/output)",
7802
- " - Field names are spelled correctly (no typos)",
7803
- " - Values match the expected types (e.g., mode: 'strict' | 'normal' | 'loose')",
7804
- " - No unknown/extra properties are included"
7805
- ];
7806
- if (additionalNotes && additionalNotes.length > 0) {
7807
- lines.push(...additionalNotes.map((note) => ` - ${note}`));
7808
- }
7809
- return lines.join("\n");
7810
- }
7811
-
7812
- // src/utils/typescript-loader.ts
7813
- init_cjs_shims();
7814
- function createTypeScriptLoader() {
7815
- return async (filepath) => {
7816
- try {
7817
- const esbuild = await import("esbuild");
7818
- const fs = await import("fs");
7819
- const path = await import("path");
7820
- const tsCode = fs.readFileSync(filepath, "utf-8");
7821
- const result = await esbuild.build({
7822
- stdin: {
7823
- contents: tsCode,
7824
- loader: "ts",
7825
- resolveDir: path.dirname(filepath),
7826
- sourcefile: filepath
7827
- },
7828
- format: "cjs",
7829
- platform: "node",
7830
- target: "node18",
7831
- bundle: false,
7832
- write: false
7833
- });
7834
- const jsCode = result.outputFiles[0].text;
7835
- const module2 = { exports: {} };
7836
- const func = new Function("exports", "module", "require", "__filename", "__dirname", jsCode);
7837
- func(module2.exports, module2, require, filepath, path.dirname(filepath));
7838
- return module2.exports.default || module2.exports;
7839
- } catch (error) {
7840
- throw new Error(
7841
- `Failed to load TypeScript config from ${filepath}: ${error instanceof Error ? error.message : String(error)}`
7842
- );
7843
- }
7844
- };
7845
- }
7846
-
7847
- // src/utils/config-loader.ts
7848
- var OpenApiGeneratorOptionsSchema = import_zod2.z.strictObject({
7849
- mode: import_zod2.z.enum(["strict", "normal", "loose"]).optional(),
7850
- input: import_zod2.z.string(),
7851
- output: import_zod2.z.string(),
7852
- includeDescriptions: import_zod2.z.boolean().optional(),
7853
- useDescribe: import_zod2.z.boolean().optional(),
7854
- defaultNullable: import_zod2.z.boolean().optional(),
7855
- emptyObjectBehavior: import_zod2.z.enum(["strict", "loose", "record"]).optional(),
7856
- schemaType: import_zod2.z.enum(["all", "request", "response"]).optional(),
7857
- prefix: import_zod2.z.string().optional(),
7858
- suffix: import_zod2.z.string().optional(),
7859
- stripSchemaPrefix: import_zod2.z.string().optional(),
7860
- showStats: import_zod2.z.boolean().optional(),
7861
- request: RequestResponseOptionsSchema.optional(),
7862
- response: RequestResponseOptionsSchema.optional(),
7863
- name: import_zod2.z.string().optional(),
7864
- operationFilters: OperationFiltersSchema.optional(),
7865
- cacheSize: import_zod2.z.number().positive().optional(),
7866
- batchSize: import_zod2.z.number().positive().optional(),
7867
- customDateTimeFormatRegex: import_zod2.z.union([
7868
- import_zod2.z.string().refine(
7869
- (pattern) => {
7870
- try {
7871
- new RegExp(pattern);
7872
- return true;
7873
- } catch {
7874
- return false;
7875
- }
7876
- },
7877
- { message: "Must be a valid regular expression pattern" }
7878
- ),
7879
- import_zod2.z.instanceof(RegExp)
7880
- ]).optional()
7450
+ var ZodDefaultsSchema = import_openapi_core7.BaseDefaultsSchema.extend({
7451
+ ...ZodSpecificOptionsSchema.shape
7881
7452
  });
7882
- var ConfigFileSchema = import_zod2.z.strictObject({
7883
- defaults: import_zod2.z.strictObject({
7884
- mode: import_zod2.z.enum(["strict", "normal", "loose"]).optional(),
7885
- includeDescriptions: import_zod2.z.boolean().optional(),
7886
- useDescribe: import_zod2.z.boolean().optional(),
7887
- defaultNullable: import_zod2.z.boolean().optional(),
7888
- emptyObjectBehavior: import_zod2.z.enum(["strict", "loose", "record"]).optional(),
7889
- schemaType: import_zod2.z.enum(["all", "request", "response"]).optional(),
7890
- prefix: import_zod2.z.string().optional(),
7891
- suffix: import_zod2.z.string().optional(),
7892
- stripSchemaPrefix: import_zod2.z.string().optional(),
7893
- showStats: import_zod2.z.boolean().optional(),
7894
- request: RequestResponseOptionsSchema.optional(),
7895
- response: RequestResponseOptionsSchema.optional(),
7896
- operationFilters: OperationFiltersSchema.optional(),
7897
- cacheSize: import_zod2.z.number().positive().optional(),
7898
- batchSize: import_zod2.z.number().positive().optional(),
7899
- customDateTimeFormatRegex: import_zod2.z.union([
7900
- import_zod2.z.string().refine(
7901
- (pattern) => {
7902
- try {
7903
- new RegExp(pattern);
7904
- return true;
7905
- } catch {
7906
- return false;
7907
- }
7908
- },
7909
- { message: "Must be a valid regular expression pattern" }
7910
- ),
7911
- import_zod2.z.instanceof(RegExp)
7912
- ]).optional()
7913
- }).optional(),
7914
- specs: import_zod2.z.array(OpenApiGeneratorOptionsSchema).min(1, {
7915
- message: "Configuration must include at least one specification. Each specification should have 'input' and 'output' paths."
7916
- }).refine((specs) => specs.every((spec) => spec.input && spec.output), {
7917
- message: "Each specification must have both 'input' and 'output' paths defined"
7453
+ var ConfigFileSchema = import_zod.z.strictObject({
7454
+ defaults: ZodDefaultsSchema.optional(),
7455
+ specs: import_zod.z.array(OpenApiGeneratorOptionsSchema).min(1, {
7456
+ message: "Configuration must include at least one specification. Each specification should have 'input' and 'outputTypes' paths."
7918
7457
  }),
7919
- executionMode: import_zod2.z.enum(["parallel", "sequential"]).optional()
7458
+ executionMode: import_openapi_core7.ExecutionModeSchema.optional()
7920
7459
  });
7921
- async function loadConfig(configPath) {
7922
- const explorer = (0, import_cosmiconfig.cosmiconfig)("openapi-to-zod", {
7923
- searchPlaces: ["openapi-to-zod.config.ts", "openapi-to-zod.config.json", "package.json"],
7924
- loaders: {
7925
- ".ts": createTypeScriptLoader()
7926
- }
7927
- });
7928
- let result;
7929
- if (configPath) {
7930
- result = await explorer.load(configPath);
7931
- } else {
7932
- result = await explorer.search();
7933
- }
7934
- if (!result || !result.config) {
7935
- throw new Error(
7936
- configPath ? `Config file not found at: ${configPath}` : "No config file found. Searched for: openapi-to-zod.config.ts, openapi-to-zod.config.json, package.json (openapi-to-zod key)\nRun 'openapi-to-zod init' to create a new config file."
7937
- );
7938
- }
7939
- try {
7940
- const validatedConfig = ConfigFileSchema.parse(result.config);
7941
- return validatedConfig;
7942
- } catch (error) {
7943
- if (error instanceof import_zod2.z.ZodError) {
7944
- const errorMessage = formatConfigValidationError(error, result.filepath, configPath);
7945
- throw new Error(errorMessage);
7946
- }
7947
- throw error;
7948
- }
7949
- }
7460
+ var errorMessages = {
7461
+ missingFieldMessages: {
7462
+ input: "Each spec must specify the path to your OpenAPI specification file.",
7463
+ outputTypes: "Each spec must specify an output file path for generated Zod schemas."
7464
+ },
7465
+ unrecognizedKeyMessages: {},
7466
+ requiredFieldsHelp: "All required fields are present (specs array with input/outputTypes)"
7467
+ };
7468
+ var configLoader = (0, import_openapi_core7.createConfigLoader)(
7469
+ {
7470
+ packageName: "openapi-to-zod",
7471
+ errorMessages
7472
+ },
7473
+ ConfigFileSchema
7474
+ );
7475
+ var loadConfig = configLoader.loadConfig;
7950
7476
  function mergeConfigWithDefaults(config) {
7951
7477
  if (!(config == null ? void 0 : config.specs) || !Array.isArray(config.specs)) {
7952
7478
  throw new Error("Invalid config: specs array is required");
7953
7479
  }
7954
7480
  const defaults = config.defaults || {};
7481
+ let warnedDeprecatedOutput = false;
7955
7482
  return config.specs.map((spec) => {
7483
+ const output = spec.output;
7484
+ const outputTypes = spec.outputTypes;
7485
+ const resolvedOutputTypes = outputTypes != null ? outputTypes : output;
7486
+ const hasOutputZodSchemas = Boolean(spec.outputZodSchemas);
7487
+ if (hasOutputZodSchemas && resolvedOutputTypes === void 0) {
7488
+ throw new Error(
7489
+ "When 'outputZodSchemas' is specified, 'outputTypes' is required for TypeScript type definitions."
7490
+ );
7491
+ }
7492
+ if (!hasOutputZodSchemas && resolvedOutputTypes === void 0) {
7493
+ throw new Error("Each spec must define 'outputTypes' (preferred) or deprecated 'output'.");
7494
+ }
7495
+ if (output && outputTypes && output !== outputTypes) {
7496
+ throw new Error("Invalid configuration: 'outputTypes' and deprecated 'output' cannot have different values.");
7497
+ }
7498
+ if (!resolvedOutputTypes) {
7499
+ throw new Error("Internal error: outputTypes should be defined after validation");
7500
+ }
7501
+ if (output && !warnedDeprecatedOutput) {
7502
+ console.warn(
7503
+ "[openapi-to-zod] Deprecation warning: 'output' is deprecated and will be removed in a future release. Use 'outputTypes' instead."
7504
+ );
7505
+ warnedDeprecatedOutput = true;
7506
+ }
7507
+ const { output: _deprecatedOutput, ...specWithoutDeprecatedOutput } = spec;
7956
7508
  const merged = {
7957
7509
  // Apply defaults first
7958
7510
  mode: defaults.mode,
7959
7511
  includeDescriptions: defaults.includeDescriptions,
7960
7512
  useDescribe: defaults.useDescribe,
7961
7513
  defaultNullable: defaults.defaultNullable,
7514
+ useOperationId: defaults.useOperationId,
7962
7515
  emptyObjectBehavior: defaults.emptyObjectBehavior,
7963
7516
  schemaType: defaults.schemaType,
7964
7517
  prefix: defaults.prefix,
7965
7518
  suffix: defaults.suffix,
7966
7519
  showStats: defaults.showStats,
7967
7520
  customDateTimeFormatRegex: defaults.customDateTimeFormatRegex,
7968
- // Override with spec-specific values (including required input/output)
7969
- ...spec
7521
+ enumFormat: defaults.enumFormat,
7522
+ // Override with spec-specific values
7523
+ ...specWithoutDeprecatedOutput,
7524
+ outputTypes: resolvedOutputTypes
7970
7525
  };
7971
7526
  return merged;
7972
7527
  });
@@ -7991,7 +7546,7 @@ Examples:
7991
7546
  try {
7992
7547
  await executeConfigMode(options);
7993
7548
  } catch (error) {
7994
- if (error instanceof CliOptionsError) {
7549
+ if (error instanceof import_openapi_core8.CliOptionsError || error instanceof import_openapi_core8.ConfigValidationError) {
7995
7550
  console.error(error.message);
7996
7551
  process.exit(1);
7997
7552
  }
@@ -8011,44 +7566,14 @@ program.command("init").description("Initialize a new openapi-to-zod configurati
8011
7566
  }
8012
7567
  });
8013
7568
  program.parse();
8014
- function findSpecFiles() {
8015
- const specFolders = ["spec", "specs"];
8016
- const validExtensions = [".yaml", ".yml", ".json"];
8017
- const excludePatterns = ["node_modules", ".git", "dist", "build", "coverage"];
8018
- const allFiles = [];
8019
- for (const folder of specFolders) {
8020
- if (!(0, import_node_fs2.existsSync)(folder)) continue;
8021
- try {
8022
- const entries = (0, import_node_fs2.readdirSync)(folder, { recursive: true, encoding: "utf-8" });
8023
- for (const entry of entries) {
8024
- const fullPath = (0, import_node_path2.join)(folder, entry);
8025
- if (excludePatterns.some((pattern) => fullPath.includes(pattern))) continue;
8026
- try {
8027
- const stats = (0, import_node_fs2.statSync)(fullPath);
8028
- if (!stats.isFile()) continue;
8029
- const hasValidExt = validExtensions.some((ext) => fullPath.endsWith(ext));
8030
- if (!hasValidExt) continue;
8031
- const sizeKB = (stats.size / 1024).toFixed(2);
8032
- allFiles.push({ path: fullPath.replace(/\\/g, "/"), size: `${sizeKB} KB` });
8033
- } catch {
8034
- }
8035
- }
8036
- } catch {
8037
- }
8038
- }
8039
- allFiles.sort((a, b) => a.path.localeCompare(b.path));
8040
- const totalCount = allFiles.length;
8041
- const files = allFiles.slice(0, 20);
8042
- return { files, totalCount };
8043
- }
8044
7569
  async function executeConfigMode(options) {
8045
7570
  var _a, _b;
8046
7571
  const config = await loadConfig(options.config);
8047
7572
  const specs = mergeConfigWithDefaults(config);
8048
7573
  const executionMode = config.executionMode || "parallel";
8049
7574
  const batchSize = (_b = (_a = specs[0]) == null ? void 0 : _a.batchSize) != null ? _b : 10;
8050
- const summary = await executeBatch(specs, executionMode, (spec) => new OpenApiGenerator(spec), batchSize);
8051
- const exitCode = getBatchExitCode(summary);
7575
+ const summary = await (0, import_openapi_core8.executeBatch)(specs, executionMode, (spec) => new OpenApiGenerator(spec), batchSize);
7576
+ const exitCode = (0, import_openapi_core8.getBatchExitCode)(summary);
8052
7577
  if (exitCode !== 0) {
8053
7578
  process.exit(exitCode);
8054
7579
  }
@@ -8058,18 +7583,19 @@ async function initConfigFile() {
8058
7583
  const configFiles = ["openapi-to-zod.config.ts", "openapi-to-zod.config.json"];
8059
7584
  const existingConfig = configFiles.find((f) => (0, import_node_fs2.existsSync)(f));
8060
7585
  if (existingConfig) {
8061
- const { overwrite } = await (0, import_prompts.default)({
7586
+ const result = await (0, import_prompts.default)({
8062
7587
  type: "confirm",
8063
7588
  name: "overwrite",
8064
7589
  message: `Config file '${existingConfig}' already exists. Overwrite?`,
8065
7590
  initial: false
8066
7591
  });
7592
+ const overwrite = Boolean(result.overwrite);
8067
7593
  if (!overwrite) {
8068
7594
  console.log("Initialization cancelled.");
8069
7595
  return;
8070
7596
  }
8071
7597
  }
8072
- const { files, totalCount } = findSpecFiles();
7598
+ const { files, totalCount } = (0, import_openapi_core8.findSpecFiles)();
8073
7599
  if (totalCount > 20) {
8074
7600
  console.log(`Showing first 20 of ${totalCount} files found. Use manual entry to specify others.
8075
7601
  `);
@@ -8177,7 +7703,7 @@ export default defineConfig({
8177
7703
  specs: [
8178
7704
  {
8179
7705
  input: '${input}',
8180
- output: '${output}',
7706
+ outputTypes: '${output}',
8181
7707
  },
8182
7708
  ],
8183
7709
  });
@@ -8189,7 +7715,7 @@ export default defineConfig({
8189
7715
  specs: [
8190
7716
  {
8191
7717
  input: '${input}',
8192
- output: '${output}',
7718
+ outputTypes: '${output}',
8193
7719
  },
8194
7720
  ],
8195
7721
  });
@@ -8201,7 +7727,7 @@ export default defineConfig({
8201
7727
  specs: [
8202
7728
  {
8203
7729
  input,
8204
- output
7730
+ outputTypes: output
8205
7731
  }
8206
7732
  ]
8207
7733
  };
@@ -8221,20 +7747,7 @@ export default defineConfig({
8221
7747
  console.log("\nNext steps:");
8222
7748
  console.log(" 1. Review and customize your config file if needed");
8223
7749
  console.log(" 2. Run 'openapi-to-zod' to generate schemas\n");
8224
- const ceriosMessages = [
8225
- "Things just got Cerios!",
8226
- "Getting Cerios about schemas!",
8227
- "Cerios business ahead!",
8228
- "Don't take it too Cerios-ly!",
8229
- "Time to get Cerios!",
8230
- "We're dead Cerios about types!",
8231
- "This is Cerios-ly awesome!",
8232
- "Cerios-ly, you're all set!",
8233
- "You are Cerios right now!",
8234
- "Cerios vibes only!"
8235
- ];
8236
- const randomMessage = ceriosMessages[Math.floor(Math.random() * ceriosMessages.length)];
8237
- console.log(`${randomMessage}
7750
+ console.log(`${(0, import_openapi_core8.getRandomCeriosMessage)()}
8238
7751
  `);
8239
7752
  }
8240
7753
  //# sourceMappingURL=cli.js.map