@eventcatalog/generator-openapi 7.5.1 → 7.5.3

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/index.js CHANGED
@@ -285,6 +285,1246 @@ var require_ansi_align = __commonJS({
285
285
  }
286
286
  });
287
287
 
288
+ // ../../node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js
289
+ var require_ms = __commonJS({
290
+ "../../node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js"(exports2, module2) {
291
+ "use strict";
292
+ var s = 1e3;
293
+ var m = s * 60;
294
+ var h = m * 60;
295
+ var d = h * 24;
296
+ var w = d * 7;
297
+ var y = d * 365.25;
298
+ module2.exports = function(val, options) {
299
+ options = options || {};
300
+ var type = typeof val;
301
+ if (type === "string" && val.length > 0) {
302
+ return parse2(val);
303
+ } else if (type === "number" && isFinite(val)) {
304
+ return options.long ? fmtLong(val) : fmtShort(val);
305
+ }
306
+ throw new Error(
307
+ "val is not a non-empty string or a valid number. val=" + JSON.stringify(val)
308
+ );
309
+ };
310
+ function parse2(str) {
311
+ str = String(str);
312
+ if (str.length > 100) {
313
+ return;
314
+ }
315
+ var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
316
+ str
317
+ );
318
+ if (!match) {
319
+ return;
320
+ }
321
+ var n = parseFloat(match[1]);
322
+ var type = (match[2] || "ms").toLowerCase();
323
+ switch (type) {
324
+ case "years":
325
+ case "year":
326
+ case "yrs":
327
+ case "yr":
328
+ case "y":
329
+ return n * y;
330
+ case "weeks":
331
+ case "week":
332
+ case "w":
333
+ return n * w;
334
+ case "days":
335
+ case "day":
336
+ case "d":
337
+ return n * d;
338
+ case "hours":
339
+ case "hour":
340
+ case "hrs":
341
+ case "hr":
342
+ case "h":
343
+ return n * h;
344
+ case "minutes":
345
+ case "minute":
346
+ case "mins":
347
+ case "min":
348
+ case "m":
349
+ return n * m;
350
+ case "seconds":
351
+ case "second":
352
+ case "secs":
353
+ case "sec":
354
+ case "s":
355
+ return n * s;
356
+ case "milliseconds":
357
+ case "millisecond":
358
+ case "msecs":
359
+ case "msec":
360
+ case "ms":
361
+ return n;
362
+ default:
363
+ return void 0;
364
+ }
365
+ }
366
+ function fmtShort(ms) {
367
+ var msAbs = Math.abs(ms);
368
+ if (msAbs >= d) {
369
+ return Math.round(ms / d) + "d";
370
+ }
371
+ if (msAbs >= h) {
372
+ return Math.round(ms / h) + "h";
373
+ }
374
+ if (msAbs >= m) {
375
+ return Math.round(ms / m) + "m";
376
+ }
377
+ if (msAbs >= s) {
378
+ return Math.round(ms / s) + "s";
379
+ }
380
+ return ms + "ms";
381
+ }
382
+ function fmtLong(ms) {
383
+ var msAbs = Math.abs(ms);
384
+ if (msAbs >= d) {
385
+ return plural(ms, msAbs, d, "day");
386
+ }
387
+ if (msAbs >= h) {
388
+ return plural(ms, msAbs, h, "hour");
389
+ }
390
+ if (msAbs >= m) {
391
+ return plural(ms, msAbs, m, "minute");
392
+ }
393
+ if (msAbs >= s) {
394
+ return plural(ms, msAbs, s, "second");
395
+ }
396
+ return ms + " ms";
397
+ }
398
+ function plural(ms, msAbs, n, name) {
399
+ var isPlural = msAbs >= n * 1.5;
400
+ return Math.round(ms / n) + " " + name + (isPlural ? "s" : "");
401
+ }
402
+ }
403
+ });
404
+
405
+ // ../../node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/common.js
406
+ var require_common = __commonJS({
407
+ "../../node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/common.js"(exports2, module2) {
408
+ "use strict";
409
+ function setup(env) {
410
+ createDebug.debug = createDebug;
411
+ createDebug.default = createDebug;
412
+ createDebug.coerce = coerce;
413
+ createDebug.disable = disable;
414
+ createDebug.enable = enable;
415
+ createDebug.enabled = enabled;
416
+ createDebug.humanize = require_ms();
417
+ createDebug.destroy = destroy;
418
+ Object.keys(env).forEach((key) => {
419
+ createDebug[key] = env[key];
420
+ });
421
+ createDebug.names = [];
422
+ createDebug.skips = [];
423
+ createDebug.formatters = {};
424
+ function selectColor(namespace) {
425
+ let hash = 0;
426
+ for (let i = 0; i < namespace.length; i++) {
427
+ hash = (hash << 5) - hash + namespace.charCodeAt(i);
428
+ hash |= 0;
429
+ }
430
+ return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
431
+ }
432
+ createDebug.selectColor = selectColor;
433
+ function createDebug(namespace) {
434
+ let prevTime;
435
+ let enableOverride = null;
436
+ let namespacesCache;
437
+ let enabledCache;
438
+ function debug(...args) {
439
+ if (!debug.enabled) {
440
+ return;
441
+ }
442
+ const self = debug;
443
+ const curr = Number(/* @__PURE__ */ new Date());
444
+ const ms = curr - (prevTime || curr);
445
+ self.diff = ms;
446
+ self.prev = prevTime;
447
+ self.curr = curr;
448
+ prevTime = curr;
449
+ args[0] = createDebug.coerce(args[0]);
450
+ if (typeof args[0] !== "string") {
451
+ args.unshift("%O");
452
+ }
453
+ let index = 0;
454
+ args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
455
+ if (match === "%%") {
456
+ return "%";
457
+ }
458
+ index++;
459
+ const formatter = createDebug.formatters[format];
460
+ if (typeof formatter === "function") {
461
+ const val = args[index];
462
+ match = formatter.call(self, val);
463
+ args.splice(index, 1);
464
+ index--;
465
+ }
466
+ return match;
467
+ });
468
+ createDebug.formatArgs.call(self, args);
469
+ const logFn = self.log || createDebug.log;
470
+ logFn.apply(self, args);
471
+ }
472
+ debug.namespace = namespace;
473
+ debug.useColors = createDebug.useColors();
474
+ debug.color = createDebug.selectColor(namespace);
475
+ debug.extend = extend;
476
+ debug.destroy = createDebug.destroy;
477
+ Object.defineProperty(debug, "enabled", {
478
+ enumerable: true,
479
+ configurable: false,
480
+ get: () => {
481
+ if (enableOverride !== null) {
482
+ return enableOverride;
483
+ }
484
+ if (namespacesCache !== createDebug.namespaces) {
485
+ namespacesCache = createDebug.namespaces;
486
+ enabledCache = createDebug.enabled(namespace);
487
+ }
488
+ return enabledCache;
489
+ },
490
+ set: (v) => {
491
+ enableOverride = v;
492
+ }
493
+ });
494
+ if (typeof createDebug.init === "function") {
495
+ createDebug.init(debug);
496
+ }
497
+ return debug;
498
+ }
499
+ function extend(namespace, delimiter) {
500
+ const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace);
501
+ newDebug.log = this.log;
502
+ return newDebug;
503
+ }
504
+ function enable(namespaces) {
505
+ createDebug.save(namespaces);
506
+ createDebug.namespaces = namespaces;
507
+ createDebug.names = [];
508
+ createDebug.skips = [];
509
+ const split = (typeof namespaces === "string" ? namespaces : "").trim().replace(/\s+/g, ",").split(",").filter(Boolean);
510
+ for (const ns of split) {
511
+ if (ns[0] === "-") {
512
+ createDebug.skips.push(ns.slice(1));
513
+ } else {
514
+ createDebug.names.push(ns);
515
+ }
516
+ }
517
+ }
518
+ function matchesTemplate(search, template) {
519
+ let searchIndex = 0;
520
+ let templateIndex = 0;
521
+ let starIndex = -1;
522
+ let matchIndex = 0;
523
+ while (searchIndex < search.length) {
524
+ if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) {
525
+ if (template[templateIndex] === "*") {
526
+ starIndex = templateIndex;
527
+ matchIndex = searchIndex;
528
+ templateIndex++;
529
+ } else {
530
+ searchIndex++;
531
+ templateIndex++;
532
+ }
533
+ } else if (starIndex !== -1) {
534
+ templateIndex = starIndex + 1;
535
+ matchIndex++;
536
+ searchIndex = matchIndex;
537
+ } else {
538
+ return false;
539
+ }
540
+ }
541
+ while (templateIndex < template.length && template[templateIndex] === "*") {
542
+ templateIndex++;
543
+ }
544
+ return templateIndex === template.length;
545
+ }
546
+ function disable() {
547
+ const namespaces = [
548
+ ...createDebug.names,
549
+ ...createDebug.skips.map((namespace) => "-" + namespace)
550
+ ].join(",");
551
+ createDebug.enable("");
552
+ return namespaces;
553
+ }
554
+ function enabled(name) {
555
+ for (const skip of createDebug.skips) {
556
+ if (matchesTemplate(name, skip)) {
557
+ return false;
558
+ }
559
+ }
560
+ for (const ns of createDebug.names) {
561
+ if (matchesTemplate(name, ns)) {
562
+ return true;
563
+ }
564
+ }
565
+ return false;
566
+ }
567
+ function coerce(val) {
568
+ if (val instanceof Error) {
569
+ return val.stack || val.message;
570
+ }
571
+ return val;
572
+ }
573
+ function destroy() {
574
+ console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
575
+ }
576
+ createDebug.enable(createDebug.load());
577
+ return createDebug;
578
+ }
579
+ module2.exports = setup;
580
+ }
581
+ });
582
+
583
+ // ../../node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/browser.js
584
+ var require_browser = __commonJS({
585
+ "../../node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/browser.js"(exports2, module2) {
586
+ "use strict";
587
+ exports2.formatArgs = formatArgs;
588
+ exports2.save = save;
589
+ exports2.load = load;
590
+ exports2.useColors = useColors;
591
+ exports2.storage = localstorage();
592
+ exports2.destroy = /* @__PURE__ */ (() => {
593
+ let warned = false;
594
+ return () => {
595
+ if (!warned) {
596
+ warned = true;
597
+ console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
598
+ }
599
+ };
600
+ })();
601
+ exports2.colors = [
602
+ "#0000CC",
603
+ "#0000FF",
604
+ "#0033CC",
605
+ "#0033FF",
606
+ "#0066CC",
607
+ "#0066FF",
608
+ "#0099CC",
609
+ "#0099FF",
610
+ "#00CC00",
611
+ "#00CC33",
612
+ "#00CC66",
613
+ "#00CC99",
614
+ "#00CCCC",
615
+ "#00CCFF",
616
+ "#3300CC",
617
+ "#3300FF",
618
+ "#3333CC",
619
+ "#3333FF",
620
+ "#3366CC",
621
+ "#3366FF",
622
+ "#3399CC",
623
+ "#3399FF",
624
+ "#33CC00",
625
+ "#33CC33",
626
+ "#33CC66",
627
+ "#33CC99",
628
+ "#33CCCC",
629
+ "#33CCFF",
630
+ "#6600CC",
631
+ "#6600FF",
632
+ "#6633CC",
633
+ "#6633FF",
634
+ "#66CC00",
635
+ "#66CC33",
636
+ "#9900CC",
637
+ "#9900FF",
638
+ "#9933CC",
639
+ "#9933FF",
640
+ "#99CC00",
641
+ "#99CC33",
642
+ "#CC0000",
643
+ "#CC0033",
644
+ "#CC0066",
645
+ "#CC0099",
646
+ "#CC00CC",
647
+ "#CC00FF",
648
+ "#CC3300",
649
+ "#CC3333",
650
+ "#CC3366",
651
+ "#CC3399",
652
+ "#CC33CC",
653
+ "#CC33FF",
654
+ "#CC6600",
655
+ "#CC6633",
656
+ "#CC9900",
657
+ "#CC9933",
658
+ "#CCCC00",
659
+ "#CCCC33",
660
+ "#FF0000",
661
+ "#FF0033",
662
+ "#FF0066",
663
+ "#FF0099",
664
+ "#FF00CC",
665
+ "#FF00FF",
666
+ "#FF3300",
667
+ "#FF3333",
668
+ "#FF3366",
669
+ "#FF3399",
670
+ "#FF33CC",
671
+ "#FF33FF",
672
+ "#FF6600",
673
+ "#FF6633",
674
+ "#FF9900",
675
+ "#FF9933",
676
+ "#FFCC00",
677
+ "#FFCC33"
678
+ ];
679
+ function useColors() {
680
+ if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) {
681
+ return true;
682
+ }
683
+ if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
684
+ return false;
685
+ }
686
+ let m;
687
+ return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
688
+ typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
689
+ // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
690
+ typeof navigator !== "undefined" && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker
691
+ typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
692
+ }
693
+ function formatArgs(args) {
694
+ args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module2.exports.humanize(this.diff);
695
+ if (!this.useColors) {
696
+ return;
697
+ }
698
+ const c = "color: " + this.color;
699
+ args.splice(1, 0, c, "color: inherit");
700
+ let index = 0;
701
+ let lastC = 0;
702
+ args[0].replace(/%[a-zA-Z%]/g, (match) => {
703
+ if (match === "%%") {
704
+ return;
705
+ }
706
+ index++;
707
+ if (match === "%c") {
708
+ lastC = index;
709
+ }
710
+ });
711
+ args.splice(lastC, 0, c);
712
+ }
713
+ exports2.log = console.debug || console.log || (() => {
714
+ });
715
+ function save(namespaces) {
716
+ try {
717
+ if (namespaces) {
718
+ exports2.storage.setItem("debug", namespaces);
719
+ } else {
720
+ exports2.storage.removeItem("debug");
721
+ }
722
+ } catch (error) {
723
+ }
724
+ }
725
+ function load() {
726
+ let r;
727
+ try {
728
+ r = exports2.storage.getItem("debug") || exports2.storage.getItem("DEBUG");
729
+ } catch (error) {
730
+ }
731
+ if (!r && typeof process !== "undefined" && "env" in process) {
732
+ r = process.env.DEBUG;
733
+ }
734
+ return r;
735
+ }
736
+ function localstorage() {
737
+ try {
738
+ return localStorage;
739
+ } catch (error) {
740
+ }
741
+ }
742
+ module2.exports = require_common()(exports2);
743
+ var { formatters } = module2.exports;
744
+ formatters.j = function(v) {
745
+ try {
746
+ return JSON.stringify(v);
747
+ } catch (error) {
748
+ return "[UnexpectedJSONParseError]: " + error.message;
749
+ }
750
+ };
751
+ }
752
+ });
753
+
754
+ // ../../node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js
755
+ var require_has_flag = __commonJS({
756
+ "../../node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js"(exports2, module2) {
757
+ "use strict";
758
+ module2.exports = (flag, argv = process.argv) => {
759
+ const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
760
+ const position = argv.indexOf(prefix + flag);
761
+ const terminatorPosition = argv.indexOf("--");
762
+ return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
763
+ };
764
+ }
765
+ });
766
+
767
+ // ../../node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js
768
+ var require_supports_color = __commonJS({
769
+ "../../node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js"(exports2, module2) {
770
+ "use strict";
771
+ var os = require("os");
772
+ var tty = require("tty");
773
+ var hasFlag = require_has_flag();
774
+ var { env } = process;
775
+ var forceColor;
776
+ if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
777
+ forceColor = 0;
778
+ } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
779
+ forceColor = 1;
780
+ }
781
+ if ("FORCE_COLOR" in env) {
782
+ if (env.FORCE_COLOR === "true") {
783
+ forceColor = 1;
784
+ } else if (env.FORCE_COLOR === "false") {
785
+ forceColor = 0;
786
+ } else {
787
+ forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);
788
+ }
789
+ }
790
+ function translateLevel(level) {
791
+ if (level === 0) {
792
+ return false;
793
+ }
794
+ return {
795
+ level,
796
+ hasBasic: true,
797
+ has256: level >= 2,
798
+ has16m: level >= 3
799
+ };
800
+ }
801
+ function supportsColor(haveStream, streamIsTTY) {
802
+ if (forceColor === 0) {
803
+ return 0;
804
+ }
805
+ if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
806
+ return 3;
807
+ }
808
+ if (hasFlag("color=256")) {
809
+ return 2;
810
+ }
811
+ if (haveStream && !streamIsTTY && forceColor === void 0) {
812
+ return 0;
813
+ }
814
+ const min = forceColor || 0;
815
+ if (env.TERM === "dumb") {
816
+ return min;
817
+ }
818
+ if (process.platform === "win32") {
819
+ const osRelease = os.release().split(".");
820
+ if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
821
+ return Number(osRelease[2]) >= 14931 ? 3 : 2;
822
+ }
823
+ return 1;
824
+ }
825
+ if ("CI" in env) {
826
+ if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign3) => sign3 in env) || env.CI_NAME === "codeship") {
827
+ return 1;
828
+ }
829
+ return min;
830
+ }
831
+ if ("TEAMCITY_VERSION" in env) {
832
+ return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
833
+ }
834
+ if (env.COLORTERM === "truecolor") {
835
+ return 3;
836
+ }
837
+ if ("TERM_PROGRAM" in env) {
838
+ const version = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
839
+ switch (env.TERM_PROGRAM) {
840
+ case "iTerm.app":
841
+ return version >= 3 ? 3 : 2;
842
+ case "Apple_Terminal":
843
+ return 2;
844
+ }
845
+ }
846
+ if (/-256(color)?$/i.test(env.TERM)) {
847
+ return 2;
848
+ }
849
+ if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
850
+ return 1;
851
+ }
852
+ if ("COLORTERM" in env) {
853
+ return 1;
854
+ }
855
+ return min;
856
+ }
857
+ function getSupportLevel(stream) {
858
+ const level = supportsColor(stream, stream && stream.isTTY);
859
+ return translateLevel(level);
860
+ }
861
+ module2.exports = {
862
+ supportsColor: getSupportLevel,
863
+ stdout: translateLevel(supportsColor(true, tty.isatty(1))),
864
+ stderr: translateLevel(supportsColor(true, tty.isatty(2)))
865
+ };
866
+ }
867
+ });
868
+
869
+ // ../../node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/node.js
870
+ var require_node = __commonJS({
871
+ "../../node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/node.js"(exports2, module2) {
872
+ "use strict";
873
+ var tty = require("tty");
874
+ var util3 = require("util");
875
+ exports2.init = init;
876
+ exports2.log = log;
877
+ exports2.formatArgs = formatArgs;
878
+ exports2.save = save;
879
+ exports2.load = load;
880
+ exports2.useColors = useColors;
881
+ exports2.destroy = util3.deprecate(
882
+ () => {
883
+ },
884
+ "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."
885
+ );
886
+ exports2.colors = [6, 2, 3, 4, 5, 1];
887
+ try {
888
+ const supportsColor = require_supports_color();
889
+ if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
890
+ exports2.colors = [
891
+ 20,
892
+ 21,
893
+ 26,
894
+ 27,
895
+ 32,
896
+ 33,
897
+ 38,
898
+ 39,
899
+ 40,
900
+ 41,
901
+ 42,
902
+ 43,
903
+ 44,
904
+ 45,
905
+ 56,
906
+ 57,
907
+ 62,
908
+ 63,
909
+ 68,
910
+ 69,
911
+ 74,
912
+ 75,
913
+ 76,
914
+ 77,
915
+ 78,
916
+ 79,
917
+ 80,
918
+ 81,
919
+ 92,
920
+ 93,
921
+ 98,
922
+ 99,
923
+ 112,
924
+ 113,
925
+ 128,
926
+ 129,
927
+ 134,
928
+ 135,
929
+ 148,
930
+ 149,
931
+ 160,
932
+ 161,
933
+ 162,
934
+ 163,
935
+ 164,
936
+ 165,
937
+ 166,
938
+ 167,
939
+ 168,
940
+ 169,
941
+ 170,
942
+ 171,
943
+ 172,
944
+ 173,
945
+ 178,
946
+ 179,
947
+ 184,
948
+ 185,
949
+ 196,
950
+ 197,
951
+ 198,
952
+ 199,
953
+ 200,
954
+ 201,
955
+ 202,
956
+ 203,
957
+ 204,
958
+ 205,
959
+ 206,
960
+ 207,
961
+ 208,
962
+ 209,
963
+ 214,
964
+ 215,
965
+ 220,
966
+ 221
967
+ ];
968
+ }
969
+ } catch (error) {
970
+ }
971
+ exports2.inspectOpts = Object.keys(process.env).filter((key) => {
972
+ return /^debug_/i.test(key);
973
+ }).reduce((obj, key) => {
974
+ const prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (_, k) => {
975
+ return k.toUpperCase();
976
+ });
977
+ let val = process.env[key];
978
+ if (/^(yes|on|true|enabled)$/i.test(val)) {
979
+ val = true;
980
+ } else if (/^(no|off|false|disabled)$/i.test(val)) {
981
+ val = false;
982
+ } else if (val === "null") {
983
+ val = null;
984
+ } else {
985
+ val = Number(val);
986
+ }
987
+ obj[prop] = val;
988
+ return obj;
989
+ }, {});
990
+ function useColors() {
991
+ return "colors" in exports2.inspectOpts ? Boolean(exports2.inspectOpts.colors) : tty.isatty(process.stderr.fd);
992
+ }
993
+ function formatArgs(args) {
994
+ const { namespace: name, useColors: useColors2 } = this;
995
+ if (useColors2) {
996
+ const c = this.color;
997
+ const colorCode = "\x1B[3" + (c < 8 ? c : "8;5;" + c);
998
+ const prefix = ` ${colorCode};1m${name} \x1B[0m`;
999
+ args[0] = prefix + args[0].split("\n").join("\n" + prefix);
1000
+ args.push(colorCode + "m+" + module2.exports.humanize(this.diff) + "\x1B[0m");
1001
+ } else {
1002
+ args[0] = getDate() + name + " " + args[0];
1003
+ }
1004
+ }
1005
+ function getDate() {
1006
+ if (exports2.inspectOpts.hideDate) {
1007
+ return "";
1008
+ }
1009
+ return (/* @__PURE__ */ new Date()).toISOString() + " ";
1010
+ }
1011
+ function log(...args) {
1012
+ return process.stderr.write(util3.formatWithOptions(exports2.inspectOpts, ...args) + "\n");
1013
+ }
1014
+ function save(namespaces) {
1015
+ if (namespaces) {
1016
+ process.env.DEBUG = namespaces;
1017
+ } else {
1018
+ delete process.env.DEBUG;
1019
+ }
1020
+ }
1021
+ function load() {
1022
+ return process.env.DEBUG;
1023
+ }
1024
+ function init(debug) {
1025
+ debug.inspectOpts = {};
1026
+ const keys = Object.keys(exports2.inspectOpts);
1027
+ for (let i = 0; i < keys.length; i++) {
1028
+ debug.inspectOpts[keys[i]] = exports2.inspectOpts[keys[i]];
1029
+ }
1030
+ }
1031
+ module2.exports = require_common()(exports2);
1032
+ var { formatters } = module2.exports;
1033
+ formatters.o = function(v) {
1034
+ this.inspectOpts.colors = this.useColors;
1035
+ return util3.inspect(v, this.inspectOpts).split("\n").map((str) => str.trim()).join(" ");
1036
+ };
1037
+ formatters.O = function(v) {
1038
+ this.inspectOpts.colors = this.useColors;
1039
+ return util3.inspect(v, this.inspectOpts);
1040
+ };
1041
+ }
1042
+ });
1043
+
1044
+ // ../../node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/index.js
1045
+ var require_src = __commonJS({
1046
+ "../../node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/index.js"(exports2, module2) {
1047
+ "use strict";
1048
+ if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) {
1049
+ module2.exports = require_browser();
1050
+ } else {
1051
+ module2.exports = require_node();
1052
+ }
1053
+ }
1054
+ });
1055
+
1056
+ // ../../node_modules/.pnpm/agent-base@7.1.4/node_modules/agent-base/dist/helpers.js
1057
+ var require_helpers = __commonJS({
1058
+ "../../node_modules/.pnpm/agent-base@7.1.4/node_modules/agent-base/dist/helpers.js"(exports2) {
1059
+ "use strict";
1060
+ var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
1061
+ if (k2 === void 0) k2 = k;
1062
+ var desc = Object.getOwnPropertyDescriptor(m, k);
1063
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
1064
+ desc = { enumerable: true, get: function() {
1065
+ return m[k];
1066
+ } };
1067
+ }
1068
+ Object.defineProperty(o, k2, desc);
1069
+ }) : (function(o, m, k, k2) {
1070
+ if (k2 === void 0) k2 = k;
1071
+ o[k2] = m[k];
1072
+ }));
1073
+ var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) {
1074
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
1075
+ }) : function(o, v) {
1076
+ o["default"] = v;
1077
+ });
1078
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
1079
+ if (mod && mod.__esModule) return mod;
1080
+ var result = {};
1081
+ if (mod != null) {
1082
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
1083
+ }
1084
+ __setModuleDefault(result, mod);
1085
+ return result;
1086
+ };
1087
+ Object.defineProperty(exports2, "__esModule", { value: true });
1088
+ exports2.req = exports2.json = exports2.toBuffer = void 0;
1089
+ var http2 = __importStar(require("http"));
1090
+ var https2 = __importStar(require("https"));
1091
+ async function toBuffer(stream) {
1092
+ let length = 0;
1093
+ const chunks = [];
1094
+ for await (const chunk of stream) {
1095
+ length += chunk.length;
1096
+ chunks.push(chunk);
1097
+ }
1098
+ return Buffer.concat(chunks, length);
1099
+ }
1100
+ exports2.toBuffer = toBuffer;
1101
+ async function json(stream) {
1102
+ const buf = await toBuffer(stream);
1103
+ const str = buf.toString("utf8");
1104
+ try {
1105
+ return JSON.parse(str);
1106
+ } catch (_err) {
1107
+ const err = _err;
1108
+ err.message += ` (input: ${str})`;
1109
+ throw err;
1110
+ }
1111
+ }
1112
+ exports2.json = json;
1113
+ function req(url, opts = {}) {
1114
+ const href = typeof url === "string" ? url : url.href;
1115
+ const req2 = (href.startsWith("https:") ? https2 : http2).request(url, opts);
1116
+ const promise = new Promise((resolve, reject) => {
1117
+ req2.once("response", resolve).once("error", reject).end();
1118
+ });
1119
+ req2.then = promise.then.bind(promise);
1120
+ return req2;
1121
+ }
1122
+ exports2.req = req;
1123
+ }
1124
+ });
1125
+
1126
+ // ../../node_modules/.pnpm/agent-base@7.1.4/node_modules/agent-base/dist/index.js
1127
+ var require_dist = __commonJS({
1128
+ "../../node_modules/.pnpm/agent-base@7.1.4/node_modules/agent-base/dist/index.js"(exports2) {
1129
+ "use strict";
1130
+ var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
1131
+ if (k2 === void 0) k2 = k;
1132
+ var desc = Object.getOwnPropertyDescriptor(m, k);
1133
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
1134
+ desc = { enumerable: true, get: function() {
1135
+ return m[k];
1136
+ } };
1137
+ }
1138
+ Object.defineProperty(o, k2, desc);
1139
+ }) : (function(o, m, k, k2) {
1140
+ if (k2 === void 0) k2 = k;
1141
+ o[k2] = m[k];
1142
+ }));
1143
+ var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) {
1144
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
1145
+ }) : function(o, v) {
1146
+ o["default"] = v;
1147
+ });
1148
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
1149
+ if (mod && mod.__esModule) return mod;
1150
+ var result = {};
1151
+ if (mod != null) {
1152
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
1153
+ }
1154
+ __setModuleDefault(result, mod);
1155
+ return result;
1156
+ };
1157
+ var __exportStar = exports2 && exports2.__exportStar || function(m, exports3) {
1158
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding(exports3, m, p);
1159
+ };
1160
+ Object.defineProperty(exports2, "__esModule", { value: true });
1161
+ exports2.Agent = void 0;
1162
+ var net = __importStar(require("net"));
1163
+ var http2 = __importStar(require("http"));
1164
+ var https_1 = require("https");
1165
+ __exportStar(require_helpers(), exports2);
1166
+ var INTERNAL = Symbol("AgentBaseInternalState");
1167
+ var Agent = class extends http2.Agent {
1168
+ constructor(opts) {
1169
+ super(opts);
1170
+ this[INTERNAL] = {};
1171
+ }
1172
+ /**
1173
+ * Determine whether this is an `http` or `https` request.
1174
+ */
1175
+ isSecureEndpoint(options) {
1176
+ if (options) {
1177
+ if (typeof options.secureEndpoint === "boolean") {
1178
+ return options.secureEndpoint;
1179
+ }
1180
+ if (typeof options.protocol === "string") {
1181
+ return options.protocol === "https:";
1182
+ }
1183
+ }
1184
+ const { stack } = new Error();
1185
+ if (typeof stack !== "string")
1186
+ return false;
1187
+ return stack.split("\n").some((l) => l.indexOf("(https.js:") !== -1 || l.indexOf("node:https:") !== -1);
1188
+ }
1189
+ // In order to support async signatures in `connect()` and Node's native
1190
+ // connection pooling in `http.Agent`, the array of sockets for each origin
1191
+ // has to be updated synchronously. This is so the length of the array is
1192
+ // accurate when `addRequest()` is next called. We achieve this by creating a
1193
+ // fake socket and adding it to `sockets[origin]` and incrementing
1194
+ // `totalSocketCount`.
1195
+ incrementSockets(name) {
1196
+ if (this.maxSockets === Infinity && this.maxTotalSockets === Infinity) {
1197
+ return null;
1198
+ }
1199
+ if (!this.sockets[name]) {
1200
+ this.sockets[name] = [];
1201
+ }
1202
+ const fakeSocket = new net.Socket({ writable: false });
1203
+ this.sockets[name].push(fakeSocket);
1204
+ this.totalSocketCount++;
1205
+ return fakeSocket;
1206
+ }
1207
+ decrementSockets(name, socket) {
1208
+ if (!this.sockets[name] || socket === null) {
1209
+ return;
1210
+ }
1211
+ const sockets = this.sockets[name];
1212
+ const index = sockets.indexOf(socket);
1213
+ if (index !== -1) {
1214
+ sockets.splice(index, 1);
1215
+ this.totalSocketCount--;
1216
+ if (sockets.length === 0) {
1217
+ delete this.sockets[name];
1218
+ }
1219
+ }
1220
+ }
1221
+ // In order to properly update the socket pool, we need to call `getName()` on
1222
+ // the core `https.Agent` if it is a secureEndpoint.
1223
+ getName(options) {
1224
+ const secureEndpoint = this.isSecureEndpoint(options);
1225
+ if (secureEndpoint) {
1226
+ return https_1.Agent.prototype.getName.call(this, options);
1227
+ }
1228
+ return super.getName(options);
1229
+ }
1230
+ createSocket(req, options, cb) {
1231
+ const connectOpts = {
1232
+ ...options,
1233
+ secureEndpoint: this.isSecureEndpoint(options)
1234
+ };
1235
+ const name = this.getName(connectOpts);
1236
+ const fakeSocket = this.incrementSockets(name);
1237
+ Promise.resolve().then(() => this.connect(req, connectOpts)).then((socket) => {
1238
+ this.decrementSockets(name, fakeSocket);
1239
+ if (socket instanceof http2.Agent) {
1240
+ try {
1241
+ return socket.addRequest(req, connectOpts);
1242
+ } catch (err) {
1243
+ return cb(err);
1244
+ }
1245
+ }
1246
+ this[INTERNAL].currentSocket = socket;
1247
+ super.createSocket(req, options, cb);
1248
+ }, (err) => {
1249
+ this.decrementSockets(name, fakeSocket);
1250
+ cb(err);
1251
+ });
1252
+ }
1253
+ createConnection() {
1254
+ const socket = this[INTERNAL].currentSocket;
1255
+ this[INTERNAL].currentSocket = void 0;
1256
+ if (!socket) {
1257
+ throw new Error("No socket was returned in the `connect()` function");
1258
+ }
1259
+ return socket;
1260
+ }
1261
+ get defaultPort() {
1262
+ return this[INTERNAL].defaultPort ?? (this.protocol === "https:" ? 443 : 80);
1263
+ }
1264
+ set defaultPort(v) {
1265
+ if (this[INTERNAL]) {
1266
+ this[INTERNAL].defaultPort = v;
1267
+ }
1268
+ }
1269
+ get protocol() {
1270
+ return this[INTERNAL].protocol ?? (this.isSecureEndpoint() ? "https:" : "http:");
1271
+ }
1272
+ set protocol(v) {
1273
+ if (this[INTERNAL]) {
1274
+ this[INTERNAL].protocol = v;
1275
+ }
1276
+ }
1277
+ };
1278
+ exports2.Agent = Agent;
1279
+ }
1280
+ });
1281
+
1282
+ // ../../node_modules/.pnpm/https-proxy-agent@7.0.6/node_modules/https-proxy-agent/dist/parse-proxy-response.js
1283
+ var require_parse_proxy_response = __commonJS({
1284
+ "../../node_modules/.pnpm/https-proxy-agent@7.0.6/node_modules/https-proxy-agent/dist/parse-proxy-response.js"(exports2) {
1285
+ "use strict";
1286
+ var __importDefault = exports2 && exports2.__importDefault || function(mod) {
1287
+ return mod && mod.__esModule ? mod : { "default": mod };
1288
+ };
1289
+ Object.defineProperty(exports2, "__esModule", { value: true });
1290
+ exports2.parseProxyResponse = void 0;
1291
+ var debug_1 = __importDefault(require_src());
1292
+ var debug = (0, debug_1.default)("https-proxy-agent:parse-proxy-response");
1293
+ function parseProxyResponse(socket) {
1294
+ return new Promise((resolve, reject) => {
1295
+ let buffersLength = 0;
1296
+ const buffers = [];
1297
+ function read() {
1298
+ const b = socket.read();
1299
+ if (b)
1300
+ ondata(b);
1301
+ else
1302
+ socket.once("readable", read);
1303
+ }
1304
+ function cleanup() {
1305
+ socket.removeListener("end", onend);
1306
+ socket.removeListener("error", onerror);
1307
+ socket.removeListener("readable", read);
1308
+ }
1309
+ function onend() {
1310
+ cleanup();
1311
+ debug("onend");
1312
+ reject(new Error("Proxy connection ended before receiving CONNECT response"));
1313
+ }
1314
+ function onerror(err) {
1315
+ cleanup();
1316
+ debug("onerror %o", err);
1317
+ reject(err);
1318
+ }
1319
+ function ondata(b) {
1320
+ buffers.push(b);
1321
+ buffersLength += b.length;
1322
+ const buffered = Buffer.concat(buffers, buffersLength);
1323
+ const endOfHeaders = buffered.indexOf("\r\n\r\n");
1324
+ if (endOfHeaders === -1) {
1325
+ debug("have not received end of HTTP headers yet...");
1326
+ read();
1327
+ return;
1328
+ }
1329
+ const headerParts = buffered.slice(0, endOfHeaders).toString("ascii").split("\r\n");
1330
+ const firstLine = headerParts.shift();
1331
+ if (!firstLine) {
1332
+ socket.destroy();
1333
+ return reject(new Error("No header received from proxy CONNECT response"));
1334
+ }
1335
+ const firstLineParts = firstLine.split(" ");
1336
+ const statusCode = +firstLineParts[1];
1337
+ const statusText = firstLineParts.slice(2).join(" ");
1338
+ const headers = {};
1339
+ for (const header of headerParts) {
1340
+ if (!header)
1341
+ continue;
1342
+ const firstColon = header.indexOf(":");
1343
+ if (firstColon === -1) {
1344
+ socket.destroy();
1345
+ return reject(new Error(`Invalid header from proxy CONNECT response: "${header}"`));
1346
+ }
1347
+ const key = header.slice(0, firstColon).toLowerCase();
1348
+ const value = header.slice(firstColon + 1).trimStart();
1349
+ const current = headers[key];
1350
+ if (typeof current === "string") {
1351
+ headers[key] = [current, value];
1352
+ } else if (Array.isArray(current)) {
1353
+ current.push(value);
1354
+ } else {
1355
+ headers[key] = value;
1356
+ }
1357
+ }
1358
+ debug("got proxy server response: %o %o", firstLine, headers);
1359
+ cleanup();
1360
+ resolve({
1361
+ connect: {
1362
+ statusCode,
1363
+ statusText,
1364
+ headers
1365
+ },
1366
+ buffered
1367
+ });
1368
+ }
1369
+ socket.on("error", onerror);
1370
+ socket.on("end", onend);
1371
+ read();
1372
+ });
1373
+ }
1374
+ exports2.parseProxyResponse = parseProxyResponse;
1375
+ }
1376
+ });
1377
+
1378
+ // ../../node_modules/.pnpm/https-proxy-agent@7.0.6/node_modules/https-proxy-agent/dist/index.js
1379
+ var require_dist2 = __commonJS({
1380
+ "../../node_modules/.pnpm/https-proxy-agent@7.0.6/node_modules/https-proxy-agent/dist/index.js"(exports2) {
1381
+ "use strict";
1382
+ var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
1383
+ if (k2 === void 0) k2 = k;
1384
+ var desc = Object.getOwnPropertyDescriptor(m, k);
1385
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
1386
+ desc = { enumerable: true, get: function() {
1387
+ return m[k];
1388
+ } };
1389
+ }
1390
+ Object.defineProperty(o, k2, desc);
1391
+ }) : (function(o, m, k, k2) {
1392
+ if (k2 === void 0) k2 = k;
1393
+ o[k2] = m[k];
1394
+ }));
1395
+ var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) {
1396
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
1397
+ }) : function(o, v) {
1398
+ o["default"] = v;
1399
+ });
1400
+ var __importStar = exports2 && exports2.__importStar || function(mod) {
1401
+ if (mod && mod.__esModule) return mod;
1402
+ var result = {};
1403
+ if (mod != null) {
1404
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
1405
+ }
1406
+ __setModuleDefault(result, mod);
1407
+ return result;
1408
+ };
1409
+ var __importDefault = exports2 && exports2.__importDefault || function(mod) {
1410
+ return mod && mod.__esModule ? mod : { "default": mod };
1411
+ };
1412
+ Object.defineProperty(exports2, "__esModule", { value: true });
1413
+ exports2.HttpsProxyAgent = void 0;
1414
+ var net = __importStar(require("net"));
1415
+ var tls = __importStar(require("tls"));
1416
+ var assert_1 = __importDefault(require("assert"));
1417
+ var debug_1 = __importDefault(require_src());
1418
+ var agent_base_1 = require_dist();
1419
+ var url_1 = require("url");
1420
+ var parse_proxy_response_1 = require_parse_proxy_response();
1421
+ var debug = (0, debug_1.default)("https-proxy-agent");
1422
+ var setServernameFromNonIpHost = (options) => {
1423
+ if (options.servername === void 0 && options.host && !net.isIP(options.host)) {
1424
+ return {
1425
+ ...options,
1426
+ servername: options.host
1427
+ };
1428
+ }
1429
+ return options;
1430
+ };
1431
+ var HttpsProxyAgent2 = class extends agent_base_1.Agent {
1432
+ constructor(proxy, opts) {
1433
+ super(opts);
1434
+ this.options = { path: void 0 };
1435
+ this.proxy = typeof proxy === "string" ? new url_1.URL(proxy) : proxy;
1436
+ this.proxyHeaders = opts?.headers ?? {};
1437
+ debug("Creating new HttpsProxyAgent instance: %o", this.proxy.href);
1438
+ const host = (this.proxy.hostname || this.proxy.host).replace(/^\[|\]$/g, "");
1439
+ const port = this.proxy.port ? parseInt(this.proxy.port, 10) : this.proxy.protocol === "https:" ? 443 : 80;
1440
+ this.connectOpts = {
1441
+ // Attempt to negotiate http/1.1 for proxy servers that support http/2
1442
+ ALPNProtocols: ["http/1.1"],
1443
+ ...opts ? omit(opts, "headers") : null,
1444
+ host,
1445
+ port
1446
+ };
1447
+ }
1448
+ /**
1449
+ * Called when the node-core HTTP client library is creating a
1450
+ * new HTTP request.
1451
+ */
1452
+ async connect(req, opts) {
1453
+ const { proxy } = this;
1454
+ if (!opts.host) {
1455
+ throw new TypeError('No "host" provided');
1456
+ }
1457
+ let socket;
1458
+ if (proxy.protocol === "https:") {
1459
+ debug("Creating `tls.Socket`: %o", this.connectOpts);
1460
+ socket = tls.connect(setServernameFromNonIpHost(this.connectOpts));
1461
+ } else {
1462
+ debug("Creating `net.Socket`: %o", this.connectOpts);
1463
+ socket = net.connect(this.connectOpts);
1464
+ }
1465
+ const headers = typeof this.proxyHeaders === "function" ? this.proxyHeaders() : { ...this.proxyHeaders };
1466
+ const host = net.isIPv6(opts.host) ? `[${opts.host}]` : opts.host;
1467
+ let payload = `CONNECT ${host}:${opts.port} HTTP/1.1\r
1468
+ `;
1469
+ if (proxy.username || proxy.password) {
1470
+ const auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`;
1471
+ headers["Proxy-Authorization"] = `Basic ${Buffer.from(auth).toString("base64")}`;
1472
+ }
1473
+ headers.Host = `${host}:${opts.port}`;
1474
+ if (!headers["Proxy-Connection"]) {
1475
+ headers["Proxy-Connection"] = this.keepAlive ? "Keep-Alive" : "close";
1476
+ }
1477
+ for (const name of Object.keys(headers)) {
1478
+ payload += `${name}: ${headers[name]}\r
1479
+ `;
1480
+ }
1481
+ const proxyResponsePromise = (0, parse_proxy_response_1.parseProxyResponse)(socket);
1482
+ socket.write(`${payload}\r
1483
+ `);
1484
+ const { connect, buffered } = await proxyResponsePromise;
1485
+ req.emit("proxyConnect", connect);
1486
+ this.emit("proxyConnect", connect, req);
1487
+ if (connect.statusCode === 200) {
1488
+ req.once("socket", resume);
1489
+ if (opts.secureEndpoint) {
1490
+ debug("Upgrading socket connection to TLS");
1491
+ return tls.connect({
1492
+ ...omit(setServernameFromNonIpHost(opts), "host", "path", "port"),
1493
+ socket
1494
+ });
1495
+ }
1496
+ return socket;
1497
+ }
1498
+ socket.destroy();
1499
+ const fakeSocket = new net.Socket({ writable: false });
1500
+ fakeSocket.readable = true;
1501
+ req.once("socket", (s) => {
1502
+ debug("Replaying proxy buffer for failed request");
1503
+ (0, assert_1.default)(s.listenerCount("data") > 0);
1504
+ s.push(buffered);
1505
+ s.push(null);
1506
+ });
1507
+ return fakeSocket;
1508
+ }
1509
+ };
1510
+ HttpsProxyAgent2.protocols = ["http", "https"];
1511
+ exports2.HttpsProxyAgent = HttpsProxyAgent2;
1512
+ function resume(socket) {
1513
+ socket.resume();
1514
+ }
1515
+ function omit(obj, ...keys) {
1516
+ const ret = {};
1517
+ let key;
1518
+ for (key in obj) {
1519
+ if (!keys.includes(key)) {
1520
+ ret[key] = obj[key];
1521
+ }
1522
+ }
1523
+ return ret;
1524
+ }
1525
+ }
1526
+ });
1527
+
288
1528
  // src/index.ts
289
1529
  var index_exports = {};
290
1530
  __export(index_exports, {
@@ -309,40 +1549,40 @@ var defaultMarkdown = () => {
309
1549
  // src/utils/services.ts
310
1550
  var import_slugify = __toESM(require("slugify"));
311
1551
  var import_path = __toESM(require("path"));
312
- var defaultMarkdown2 = (document, fileName) => {
1552
+ var defaultMarkdown2 = (document2, fileName) => {
313
1553
  return `
314
1554
 
315
- ${document.info.description ? `${document.info.description}` : ""}
1555
+ ${document2.info.description ? `${document2.info.description}` : ""}
316
1556
 
317
1557
  ## Architecture diagram
318
1558
  <NodeGraph />
319
1559
 
320
- ${document.externalDocs ? `
1560
+ ${document2.externalDocs ? `
321
1561
  ## External documentation
322
- - [${document.externalDocs.description}](${document.externalDocs.url})
1562
+ - [${document2.externalDocs.description}](${document2.externalDocs.url})
323
1563
  ` : ""}
324
1564
 
325
1565
  `;
326
1566
  };
327
- var getSummary = (document) => {
328
- const summary = document.info.description ? document.info.description : "";
1567
+ var getSummary = (document2) => {
1568
+ const summary = document2.info.description ? document2.info.description : "";
329
1569
  return summary && summary.length < 150 ? summary : "";
330
1570
  };
331
- var buildService = (serviceOptions, document, generateMarkdown) => {
1571
+ var buildService = (serviceOptions, document2, generateMarkdown) => {
332
1572
  const schemaPath = import_path.default.basename(serviceOptions.path) || "openapi.yml";
333
- const documentTags = document.tags || [];
334
- const serviceId = serviceOptions.id || (0, import_slugify.default)(document.info.title, { lower: true, strict: true });
335
- const generatedMarkdownForService = defaultMarkdown2(document, schemaPath);
1573
+ const documentTags = document2.tags || [];
1574
+ const serviceId = serviceOptions.id || (0, import_slugify.default)(document2.info.title, { lower: true, strict: true });
1575
+ const generatedMarkdownForService = defaultMarkdown2(document2, schemaPath);
336
1576
  return {
337
1577
  id: serviceId,
338
- version: document.info.version,
339
- name: document.info.title,
340
- summary: getSummary(document),
1578
+ version: document2.info.version,
1579
+ name: document2.info.title,
1580
+ summary: getSummary(document2),
341
1581
  schemaPath,
342
1582
  specifications: {
343
1583
  openapiPath: schemaPath
344
1584
  },
345
- markdown: generateMarkdown ? generateMarkdown({ service: serviceOptions, document, markdown: generatedMarkdownForService }) : generatedMarkdownForService,
1585
+ markdown: generateMarkdown ? generateMarkdown({ service: serviceOptions, document: document2, markdown: generatedMarkdownForService }) : generatedMarkdownForService,
346
1586
  badges: documentTags.map((tag2) => ({ content: tag2.name, textColor: "blue", backgroundColor: "blue" })),
347
1587
  owners: serviceOptions.owners || [],
348
1588
  setMessageOwnersToServiceOwners: serviceOptions.setMessageOwnersToServiceOwners || true,
@@ -574,7 +1814,7 @@ var getSummary2 = (message2) => {
574
1814
  }
575
1815
  return escapeSpecialCharactersThatBreakMarkdown(eventCatalogMessageSummary);
576
1816
  };
577
- var buildMessage = async (pathToFile, document, operation, generateMarkdown, messageIdConfig, serviceId) => {
1817
+ var buildMessage = async (pathToFile, document2, operation, generateMarkdown, messageIdConfig, serviceId) => {
578
1818
  const requestBodiesAndResponses = await getSchemasByOperationId(pathToFile, operation.operationId);
579
1819
  const extensions = operation.extensions || {};
580
1820
  const operationTags = operation.tags.map((badge) => ({
@@ -583,7 +1823,7 @@ var buildMessage = async (pathToFile, document, operation, generateMarkdown, mes
583
1823
  backgroundColor: "blue"
584
1824
  }));
585
1825
  const badges = [{ content: operation.method.toUpperCase(), textColor: "blue", backgroundColor: "blue" }, ...operationTags];
586
- const apiName = (0, import_slugify2.default)(document.info.title, { lower: true });
1826
+ const apiName = (0, import_slugify2.default)(document2.info.title, { lower: true });
587
1827
  const path4 = operation.path.replace(/\//, "").replace(/\//g, "_");
588
1828
  let uniqueIdentifier = operation.operationId || `${apiName}_${operation.method}`;
589
1829
  if (!operation.operationId && path4) {
@@ -602,7 +1842,7 @@ var buildMessage = async (pathToFile, document, operation, generateMarkdown, mes
602
1842
  }
603
1843
  return {
604
1844
  id: extensions["x-eventcatalog-message-id"] || uniqueIdentifier,
605
- version: extensions["x-eventcatalog-message-version"] || document.info.version,
1845
+ version: extensions["x-eventcatalog-message-version"] || document2.info.version,
606
1846
  name: extensions["x-eventcatalog-message-name"] || messageName,
607
1847
  summary: getSummary2(operation),
608
1848
  markdown: generateMarkdown ? generateMarkdown({ operation, markdown: generatedMarkdownForMessage }) : generatedMarkdownForMessage,
@@ -670,7 +1910,7 @@ var getMessageTypeUtils = (projectDirectory, messageType) => {
670
1910
  // ../../shared/checkLicense.ts
671
1911
  var import_chalk3 = __toESM(require("chalk"));
672
1912
 
673
- // ../../node_modules/.pnpm/@eventcatalog+license@0.0.5/node_modules/@eventcatalog/license/dist/verify.js
1913
+ // ../../node_modules/.pnpm/@eventcatalog+license@0.0.7/node_modules/@eventcatalog/license/dist/verify.js
674
1914
  var import_fs = require("fs");
675
1915
 
676
1916
  // ../../node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/base64url.js
@@ -1725,7 +2965,7 @@ async function jwtVerify(jwt, key, options) {
1725
2965
  return result;
1726
2966
  }
1727
2967
 
1728
- // ../../node_modules/.pnpm/@eventcatalog+license@0.0.5/node_modules/@eventcatalog/license/dist/key.js
2968
+ // ../../node_modules/.pnpm/@eventcatalog+license@0.0.7/node_modules/@eventcatalog/license/dist/key.js
1729
2969
  var PUBLIC_KEY = `-----BEGIN PUBLIC KEY-----
1730
2970
  MCowBQYDK2VwAyEA599maqjKG7VW5bnj9fFA3msK691iHUYd+PkiZ7h9LpI=
1731
2971
  -----END PUBLIC KEY-----`;
@@ -1733,7 +2973,7 @@ async function loadPublicPem() {
1733
2973
  return PUBLIC_KEY;
1734
2974
  }
1735
2975
 
1736
- // ../../node_modules/.pnpm/@eventcatalog+license@0.0.5/node_modules/@eventcatalog/license/dist/verify.js
2976
+ // ../../node_modules/.pnpm/@eventcatalog+license@0.0.7/node_modules/@eventcatalog/license/dist/verify.js
1737
2977
  var import_path2 = __toESM(require("path"), 1);
1738
2978
  var import_chalk2 = __toESM(require("chalk"), 1);
1739
2979
 
@@ -2548,10 +3788,11 @@ function boxen(text, options) {
2548
3788
  return boxContent(text, options.width, options);
2549
3789
  }
2550
3790
 
2551
- // ../../node_modules/.pnpm/@eventcatalog+license@0.0.5/node_modules/@eventcatalog/license/dist/verify.js
3791
+ // ../../node_modules/.pnpm/@eventcatalog+license@0.0.7/node_modules/@eventcatalog/license/dist/verify.js
2552
3792
  var import_https = __toESM(require("https"), 1);
2553
3793
  var import_http = __toESM(require("http"), 1);
2554
3794
  var import_url = require("url");
3795
+ var import_https_proxy_agent = __toESM(require_dist2(), 1);
2555
3796
  var cachedEntitlements = null;
2556
3797
  function makeHttpRequest(url, options) {
2557
3798
  return new Promise((resolve, reject) => {
@@ -2567,14 +3808,7 @@ function makeHttpRequest(url, options) {
2567
3808
  };
2568
3809
  const proxyUrl = process.env.PROXY_SERVER_URI || process.env.HTTPS_PROXY || process.env.HTTP_PROXY;
2569
3810
  if (proxyUrl) {
2570
- const proxy = new import_url.URL(proxyUrl);
2571
- requestOptions.hostname = proxy.hostname;
2572
- requestOptions.port = proxy.port || (proxy.protocol === "https:" ? 443 : 80);
2573
- requestOptions.path = url;
2574
- requestOptions.headers = {
2575
- ...requestOptions.headers,
2576
- Host: urlObj.hostname
2577
- };
3811
+ requestOptions.agent = new import_https_proxy_agent.HttpsProxyAgent(proxyUrl);
2578
3812
  }
2579
3813
  const req = client.request(requestOptions, (res) => {
2580
3814
  let data = "";
@@ -2792,7 +4026,7 @@ function isValidLicenseKeyFormat(key) {
2792
4026
  return true;
2793
4027
  }
2794
4028
 
2795
- // ../../node_modules/.pnpm/@eventcatalog+license@0.0.5/node_modules/@eventcatalog/license/dist/plans.js
4029
+ // ../../node_modules/.pnpm/@eventcatalog+license@0.0.7/node_modules/@eventcatalog/license/dist/plans.js
2796
4030
  var isFeatureEnabled2 = async (feature, key) => {
2797
4031
  if (hasOfflineLicenseKey()) {
2798
4032
  await verifyOfflineLicense();
@@ -2837,7 +4071,7 @@ var import_node_path = require("path");
2837
4071
  // package.json
2838
4072
  var package_default = {
2839
4073
  name: "@eventcatalog/generator-openapi",
2840
- version: "7.5.1",
4074
+ version: "7.5.3",
2841
4075
  description: "OpenAPI generator for EventCatalog",
2842
4076
  scripts: {
2843
4077
  build: "tsup",
@@ -2969,9 +4203,9 @@ var index_default = async (_, options) => {
2969
4203
  const specs = specFiles.map(async (specFile) => {
2970
4204
  try {
2971
4205
  await import_swagger_parser2.default.validate(specFile);
2972
- const document = await import_swagger_parser2.default.dereference(specFile);
4206
+ const document2 = await import_swagger_parser2.default.dereference(specFile);
2973
4207
  return {
2974
- document,
4208
+ document: document2,
2975
4209
  path: specFile
2976
4210
  };
2977
4211
  } catch (error) {
@@ -2988,19 +4222,21 @@ var index_default = async (_, options) => {
2988
4222
  return versionA.localeCompare(versionB);
2989
4223
  });
2990
4224
  for (const specification of orderedSpecs) {
2991
- const document = specification.document;
2992
- const version = document.info.version;
4225
+ const document2 = specification.document;
4226
+ const version = document2.info.version;
2993
4227
  const specPath = specification.path;
2994
- const service = buildService({ ...serviceSpec, path: specPath }, document, serviceSpec.generateMarkdown);
4228
+ const service = buildService({ ...serviceSpec, path: specPath }, document2, serviceSpec.generateMarkdown);
2995
4229
  let serviceMarkdown = service.markdown;
2996
4230
  let serviceSpecificationsFiles = [];
2997
4231
  let serviceSpecifications = service.specifications;
2998
4232
  let serviceBadges = null;
2999
4233
  let serviceAttachments = null;
4234
+ let serviceWritesTo = service.writesTo || [];
4235
+ let serviceReadsFrom = service.readsFrom || [];
3000
4236
  const isDomainMarkedAsDraft = options.domain?.draft || null;
3001
4237
  const isServiceMarkedAsDraft = (
3002
4238
  // @ts-ignore
3003
- isDomainMarkedAsDraft || document.info?.["x-eventcatalog-draft"] || serviceSpec.draft || null
4239
+ isDomainMarkedAsDraft || document2.info?.["x-eventcatalog-draft"] || serviceSpec.draft || null
3004
4240
  );
3005
4241
  let servicePath = options.domain ? (0, import_node_path.join)("../", "domains", options.domain.id, "services", service.id) : (0, import_node_path.join)("../", "services", service.id);
3006
4242
  if (options.writeFilesToRoot) {
@@ -3035,7 +4271,7 @@ Processing domain: ${domainName} (v${domainVersion})`));
3035
4271
  }
3036
4272
  const latestServiceInCatalog = await getService(service.id, "latest");
3037
4273
  const versionTheService = latestServiceInCatalog && isVersionGreaterThan(version, latestServiceInCatalog.version);
3038
- console.log(import_chalk4.default.blue(`Processing service: ${document.info.title} (v${version})`));
4274
+ console.log(import_chalk4.default.blue(`Processing service: ${document2.info.title} (v${version})`));
3039
4275
  if (latestServiceInCatalog && isVersionLessThan(version, latestServiceInCatalog.version)) {
3040
4276
  servicePath = (0, import_node_path.join)(servicePath, "versioned", version);
3041
4277
  }
@@ -3043,7 +4279,7 @@ Processing domain: ${domainName} (v${domainVersion})`));
3043
4279
  await versionService(service.id);
3044
4280
  console.log(import_chalk4.default.cyan(` - Versioned previous service (v${latestServiceInCatalog.version})`));
3045
4281
  }
3046
- let { sends, receives } = await processMessagesForOpenAPISpec(specPath, document, servicePath, {
4282
+ let { sends, receives } = await processMessagesForOpenAPISpec(specPath, document2, servicePath, {
3047
4283
  ...options,
3048
4284
  owners: service.setMessageOwnersToServiceOwners ? service.owners : [],
3049
4285
  serviceHasMultipleSpecFiles: Array.isArray(serviceSpec.path),
@@ -3063,6 +4299,8 @@ Processing domain: ${domainName} (v${domainVersion})`));
3063
4299
  styles2 = latestServiceInCatalog.styles || null;
3064
4300
  serviceBadges = latestServiceInCatalog.badges || null;
3065
4301
  serviceAttachments = latestServiceInCatalog.attachments || null;
4302
+ serviceWritesTo = latestServiceInCatalog.writesTo || [];
4303
+ serviceReadsFrom = latestServiceInCatalog.readsFrom || [];
3066
4304
  serviceSpecifications = {
3067
4305
  ...serviceSpecifications,
3068
4306
  ...persistPreviousSpecificationFiles ? latestServiceInCatalog.specifications : {}
@@ -3086,8 +4324,8 @@ Processing domain: ${domainName} (v${domainVersion})`));
3086
4324
  ...styles2 ? { styles: styles2 } : {},
3087
4325
  ...isServiceMarkedAsDraft ? { draft: true } : {},
3088
4326
  ...serviceAttachments ? { attachments: serviceAttachments } : {},
3089
- ...service.writesTo.length > 0 ? { writesTo: service.writesTo } : {},
3090
- ...service.readsFrom.length > 0 ? { readsFrom: service.readsFrom } : {}
4327
+ ...serviceWritesTo.length > 0 ? { writesTo: serviceWritesTo } : {},
4328
+ ...serviceReadsFrom.length > 0 ? { readsFrom: serviceReadsFrom } : {}
3091
4329
  },
3092
4330
  { path: (0, import_node_path.join)(servicePath), override: true }
3093
4331
  );
@@ -3095,7 +4333,7 @@ Processing domain: ${domainName} (v${domainVersion})`));
3095
4333
  // add any previous spec files to the list
3096
4334
  ...persistPreviousSpecificationFiles ? serviceSpecificationsFiles : [],
3097
4335
  {
3098
- content: saveParsedSpecFile ? getParsedSpecFile({ ...serviceSpec, path: specPath }, document) : await getRawSpecFile({ ...serviceSpec, path: specPath }),
4336
+ content: saveParsedSpecFile ? getParsedSpecFile({ ...serviceSpec, path: specPath }, document2) : await getRawSpecFile({ ...serviceSpec, path: specPath }),
3099
4337
  fileName: service.schemaPath
3100
4338
  }
3101
4339
  ];
@@ -3113,17 +4351,17 @@ Processing domain: ${domainName} (v${domainVersion})`));
3113
4351
  }
3114
4352
  }
3115
4353
  };
3116
- var processMessagesForOpenAPISpec = async (pathToSpec, document, servicePath, options) => {
4354
+ var processMessagesForOpenAPISpec = async (pathToSpec, document2, servicePath, options) => {
3117
4355
  const operations = await getOperationsByType(pathToSpec, options.httpMethodsToMessages);
3118
4356
  const sidebarBadgeType = options.sidebarBadgeType || "HTTP_METHOD";
3119
- const version = document.info.version;
4357
+ const version = document2.info.version;
3120
4358
  const preserveExistingMessages = options.preserveExistingMessages ?? true;
3121
4359
  const isDraft = options.isDraft ?? null;
3122
4360
  let receives = [], sends = [];
3123
4361
  for (const operation of operations) {
3124
4362
  const { requestBodiesAndResponses, sidebar, messageName, ...message2 } = await buildMessage(
3125
4363
  pathToSpec,
3126
- document,
4364
+ document2,
3127
4365
  operation,
3128
4366
  options.messages?.generateMarkdown,
3129
4367
  options.messages?.id,
@@ -3233,10 +4471,10 @@ var processMessagesForOpenAPISpec = async (pathToSpec, document, servicePath, op
3233
4471
  }
3234
4472
  return { receives, sends };
3235
4473
  };
3236
- var getParsedSpecFile = (service, document) => {
4474
+ var getParsedSpecFile = (service, document2) => {
3237
4475
  const specPath = service.path;
3238
4476
  const isSpecFileJSON = specPath.endsWith(".json");
3239
- return isSpecFileJSON ? JSON.stringify(document, null, 2) : import_js_yaml.default.dump(document, { noRefs: true });
4477
+ return isSpecFileJSON ? JSON.stringify(document2, null, 2) : import_js_yaml.default.dump(document2, { noRefs: true });
3240
4478
  };
3241
4479
  var getRawSpecFile = async (service) => {
3242
4480
  const specPath = service.path;