@eventcatalog/generator-asyncapi 5.0.0 → 5.0.2

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, argv2 = process.argv) => {
759
+ const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
760
+ const position = argv2.indexOf(prefix + flag);
761
+ const terminatorPosition = argv2.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, {
@@ -303,7 +1543,7 @@ var import_path3 = __toESM(require("path"));
303
1543
  // package.json
304
1544
  var package_default = {
305
1545
  name: "@eventcatalog/generator-asyncapi",
306
- version: "5.0.0",
1546
+ version: "5.0.2",
307
1547
  description: "AsyncAPI generator for EventCatalog",
308
1548
  scripts: {
309
1549
  build: "tsup",
@@ -1273,9 +2513,9 @@ var getSchemaFileName = (message2) => {
1273
2513
  var getMessageName = (message2) => {
1274
2514
  return message2.hasTitle() && message2.title() ? message2.title() : message2.id();
1275
2515
  };
1276
- var getChannelsForMessage = (message2, channels, document) => {
2516
+ var getChannelsForMessage = (message2, channels, document2) => {
1277
2517
  let channelsForMessage = [];
1278
- const globalVersion = document.info().version();
2518
+ const globalVersion = document2.info().version();
1279
2519
  for (const channel of channels) {
1280
2520
  for (const channelMessage of channel.messages()) {
1281
2521
  if (channelMessage.id() === message2.id()) {
@@ -1299,27 +2539,27 @@ var getChannelsForMessage = (message2, channels, document) => {
1299
2539
  };
1300
2540
 
1301
2541
  // src/utils/services.ts
1302
- var defaultMarkdown2 = (document) => {
2542
+ var defaultMarkdown2 = (document2) => {
1303
2543
  return `
1304
2544
 
1305
- ${document.info().hasDescription() ? `${document.info().description()}` : ""}
2545
+ ${document2.info().hasDescription() ? `${document2.info().description()}` : ""}
1306
2546
 
1307
2547
  ## Architecture diagram
1308
2548
  <NodeGraph />
1309
2549
 
1310
- ${document.info().externalDocs() ? `
2550
+ ${document2.info().externalDocs() ? `
1311
2551
  ## External documentation
1312
- - [${document.info().externalDocs()?.description()}](${document.info().externalDocs()?.url()})
2552
+ - [${document2.info().externalDocs()?.description()}](${document2.info().externalDocs()?.url()})
1313
2553
  ` : ""}
1314
2554
  `;
1315
2555
  };
1316
- var getSummary2 = (document) => {
1317
- const summary = document.info().hasDescription() ? document.info().description() : "";
2556
+ var getSummary2 = (document2) => {
2557
+ const summary = document2.info().hasDescription() ? document2.info().description() : "";
1318
2558
  return summary && summary.length < 150 ? summary : "";
1319
2559
  };
1320
2560
 
1321
2561
  // src/utils/domains.ts
1322
- var defaultMarkdown3 = (document) => {
2562
+ var defaultMarkdown3 = (document2) => {
1323
2563
  return `
1324
2564
 
1325
2565
  ## Architecture diagram
@@ -1369,7 +2609,7 @@ var defaultMarkdown4 = (_document, channel) => {
1369
2609
  // ../../shared/checkLicense.ts
1370
2610
  var import_chalk3 = __toESM(require("chalk"));
1371
2611
 
1372
- // ../../node_modules/.pnpm/@eventcatalog+license@0.0.5/node_modules/@eventcatalog/license/dist/verify.js
2612
+ // ../../node_modules/.pnpm/@eventcatalog+license@0.0.7/node_modules/@eventcatalog/license/dist/verify.js
1373
2613
  var import_fs2 = require("fs");
1374
2614
 
1375
2615
  // ../../node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/base64url.js
@@ -2424,7 +3664,7 @@ async function jwtVerify(jwt, key, options) {
2424
3664
  return result;
2425
3665
  }
2426
3666
 
2427
- // ../../node_modules/.pnpm/@eventcatalog+license@0.0.5/node_modules/@eventcatalog/license/dist/key.js
3667
+ // ../../node_modules/.pnpm/@eventcatalog+license@0.0.7/node_modules/@eventcatalog/license/dist/key.js
2428
3668
  var PUBLIC_KEY = `-----BEGIN PUBLIC KEY-----
2429
3669
  MCowBQYDK2VwAyEA599maqjKG7VW5bnj9fFA3msK691iHUYd+PkiZ7h9LpI=
2430
3670
  -----END PUBLIC KEY-----`;
@@ -2432,12 +3672,13 @@ async function loadPublicPem() {
2432
3672
  return PUBLIC_KEY;
2433
3673
  }
2434
3674
 
2435
- // ../../node_modules/.pnpm/@eventcatalog+license@0.0.5/node_modules/@eventcatalog/license/dist/verify.js
3675
+ // ../../node_modules/.pnpm/@eventcatalog+license@0.0.7/node_modules/@eventcatalog/license/dist/verify.js
2436
3676
  var import_path2 = __toESM(require("path"), 1);
2437
3677
  var import_chalk2 = __toESM(require("chalk"), 1);
2438
3678
  var import_https = __toESM(require("https"), 1);
2439
3679
  var import_http = __toESM(require("http"), 1);
2440
3680
  var import_url = require("url");
3681
+ var import_https_proxy_agent = __toESM(require_dist2(), 1);
2441
3682
  var cachedEntitlements = null;
2442
3683
  function makeHttpRequest(url, options) {
2443
3684
  return new Promise((resolve, reject) => {
@@ -2453,14 +3694,7 @@ function makeHttpRequest(url, options) {
2453
3694
  };
2454
3695
  const proxyUrl = process.env.PROXY_SERVER_URI || process.env.HTTPS_PROXY || process.env.HTTP_PROXY;
2455
3696
  if (proxyUrl) {
2456
- const proxy = new import_url.URL(proxyUrl);
2457
- requestOptions.hostname = proxy.hostname;
2458
- requestOptions.port = proxy.port || (proxy.protocol === "https:" ? 443 : 80);
2459
- requestOptions.path = url;
2460
- requestOptions.headers = {
2461
- ...requestOptions.headers,
2462
- Host: urlObj.hostname
2463
- };
3697
+ requestOptions.agent = new import_https_proxy_agent.HttpsProxyAgent(proxyUrl);
2464
3698
  }
2465
3699
  const req = client.request(requestOptions, (res) => {
2466
3700
  let data = "";
@@ -2678,7 +3912,7 @@ function isValidLicenseKeyFormat(key) {
2678
3912
  return true;
2679
3913
  }
2680
3914
 
2681
- // ../../node_modules/.pnpm/@eventcatalog+license@0.0.5/node_modules/@eventcatalog/license/dist/plans.js
3915
+ // ../../node_modules/.pnpm/@eventcatalog+license@0.0.7/node_modules/@eventcatalog/license/dist/plans.js
2682
3916
  var isFeatureEnabled2 = async (feature, key) => {
2683
3917
  if (hasOfflineLicenseKey()) {
2684
3918
  await verifyOfflineLicense();
@@ -2858,12 +4092,12 @@ var index_default = async (config, options) => {
2858
4092
  console.log(import_chalk4.default.green(`Processing ${services.length} AsyncAPI files...`));
2859
4093
  for (const service of services) {
2860
4094
  console.log(import_chalk4.default.gray(`Processing ${service.path}`));
2861
- const { document, diagnostics } = service.path.startsWith("http") ? await (0, import_parser.fromURL)(parser, service.path).parse({
4095
+ const { document: document2, diagnostics } = service.path.startsWith("http") ? await (0, import_parser.fromURL)(parser, service.path).parse({
2862
4096
  parseSchemas
2863
4097
  }) : await (0, import_parser.fromFile)(parser, service.path).parse({
2864
4098
  parseSchemas
2865
4099
  });
2866
- if (!document) {
4100
+ if (!document2) {
2867
4101
  console.log(import_chalk4.default.red("Failed to parse AsyncAPI file"));
2868
4102
  if (options.debug || cliArgs.debug) {
2869
4103
  console.log(diagnostics);
@@ -2872,14 +4106,14 @@ var index_default = async (config, options) => {
2872
4106
  }
2873
4107
  continue;
2874
4108
  }
2875
- const operations = document.allOperations();
2876
- const channels = document.allChannels();
2877
- const documentTags = document.info().tags().all() || [];
4109
+ const operations = document2.allOperations();
4110
+ const channels = document2.allChannels();
4111
+ const documentTags = document2.info().tags().all() || [];
2878
4112
  const isDomainMarkedAsDraft = options.domain?.draft || false;
2879
- const isServiceMarkedAsDraft = isDomainMarkedAsDraft || document.info().extensions().get("x-eventcatalog-draft")?.value() || service.draft || false;
4113
+ const isServiceMarkedAsDraft = isDomainMarkedAsDraft || document2.info().extensions().get("x-eventcatalog-draft")?.value() || service.draft || false;
2880
4114
  const serviceId = service.id;
2881
- const serviceName = service.name || document.info().title();
2882
- const version = document.info().version();
4115
+ const serviceName = service.name || document2.info().title();
4116
+ const version = document2.info().version();
2883
4117
  let sends = [];
2884
4118
  let receives = [];
2885
4119
  let owners = service.owners || null;
@@ -2888,10 +4122,10 @@ var index_default = async (config, options) => {
2888
4122
  let attachments = null;
2889
4123
  let serviceSpecifications = {};
2890
4124
  let serviceSpecificationsFiles = [];
2891
- const generatedMarkdownForService = defaultMarkdown2(document);
4125
+ const generatedMarkdownForService = defaultMarkdown2(document2);
2892
4126
  let serviceMarkdown = service.generateMarkdown ? service.generateMarkdown({
2893
4127
  service: { id: service.id, name: serviceName, version },
2894
- document,
4128
+ document: document2,
2895
4129
  markdown: generatedMarkdownForService
2896
4130
  }) : generatedMarkdownForService;
2897
4131
  let styles2 = null;
@@ -2911,7 +4145,7 @@ Processing domain: ${domainName} (v${domainVersion})`));
2911
4145
  console.log(import_chalk4.default.cyan(` - Versioned previous domain (v${currentDomain.version})`));
2912
4146
  }
2913
4147
  if (!domain || domain && domain.version !== domainVersion) {
2914
- const generatedMarkdownForDomain = defaultMarkdown3(document);
4148
+ const generatedMarkdownForDomain = defaultMarkdown3(document2);
2915
4149
  await writeDomain({
2916
4150
  id: domainId,
2917
4151
  name: domainName,
@@ -2936,7 +4170,7 @@ Processing domain: ${domainName} (v${domainVersion})`));
2936
4170
  const protocols = getChannelProtocols(channel);
2937
4171
  const channelTags = getChannelTags(channel);
2938
4172
  const channelVersion = channel.extensions().get("x-eventcatalog-channel-version")?.value() || version;
2939
- let channelMarkdown = defaultMarkdown4(document, channel);
4173
+ let channelMarkdown = defaultMarkdown4(document2, channel);
2940
4174
  console.log(import_chalk4.default.blue(`Processing channel: ${channelId} (v${channelVersion})`));
2941
4175
  const paramsForCatalog = Object.keys(params).reduce(
2942
4176
  (acc, key) => {
@@ -2989,6 +4223,7 @@ Processing domain: ${domainName} (v${domainVersion})`));
2989
4223
  const isReceived = operation.action() === "receive" || operation.action() === "subscribe";
2990
4224
  const isSent = operation.action() === "send" || operation.action() === "publish";
2991
4225
  let messageId = options.messages?.id?.lowerCase ? message2.id().toLowerCase() : message2.id();
4226
+ const messageName = messageId;
2992
4227
  if (eventType !== "event" && eventType !== "command" && eventType !== "query") {
2993
4228
  throw new Error("Invalid message type");
2994
4229
  }
@@ -3005,13 +4240,13 @@ Processing domain: ${domainName} (v${domainVersion})`));
3005
4240
  addSchema: addSchemaToMessage,
3006
4241
  collection: folder
3007
4242
  } = MESSAGE_OPERATIONS[eventType];
3008
- const generatedMarkdownForMessage = defaultMarkdown(document, message2);
3009
- let messageMarkdown = options.messages?.generateMarkdown ? options.messages.generateMarkdown({ message: message2, document, markdown: generatedMarkdownForMessage }) : generatedMarkdownForMessage;
4243
+ const generatedMarkdownForMessage = defaultMarkdown(document2, message2);
4244
+ let messageMarkdown = options.messages?.generateMarkdown ? options.messages.generateMarkdown({ message: message2, document: document2, markdown: generatedMarkdownForMessage }) : generatedMarkdownForMessage;
3010
4245
  const badges2 = message2.tags().all() || [];
3011
4246
  let messageBadges = null;
3012
4247
  let messageAttachments = null;
3013
4248
  console.log(import_chalk4.default.blue(`Processing message: ${getMessageName(message2)} (v${messageVersion})`));
3014
- let messagePath = (0, import_node_path.join)(servicePath, folder, messageId);
4249
+ let messagePath = (0, import_node_path.join)(servicePath, folder, messageName);
3015
4250
  if (options.writeFilesToRoot) {
3016
4251
  messagePath = messageId;
3017
4252
  }
@@ -3026,7 +4261,7 @@ Processing domain: ${domainName} (v${domainVersion})`));
3026
4261
  console.log(import_chalk4.default.cyan(` - Versioned previous message: (v${catalogedMessage.version})`));
3027
4262
  }
3028
4263
  }
3029
- const channelsForMessage = parseChannels ? getChannelsForMessage(message2, channels, document) : [];
4264
+ const channelsForMessage = parseChannels ? getChannelsForMessage(message2, channels, document2) : [];
3030
4265
  await writeMessage(
3031
4266
  {
3032
4267
  id: messageId,
@@ -3099,7 +4334,7 @@ Processing domain: ${domainName} (v${domainVersion})`));
3099
4334
  id: serviceId,
3100
4335
  name: serviceName,
3101
4336
  version,
3102
- summary: service.summary || getSummary2(document),
4337
+ summary: service.summary || getSummary2(document2),
3103
4338
  badges: badges || documentTags.map((tag2) => ({ content: tag2.name(), textColor: "blue", backgroundColor: "blue" })),
3104
4339
  markdown: serviceMarkdown,
3105
4340
  sends,
@@ -3126,7 +4361,7 @@ Processing domain: ${domainName} (v${domainVersion})`));
3126
4361
  // add any previous spec files to the list
3127
4362
  ...serviceSpecificationsFiles,
3128
4363
  {
3129
- content: saveParsedSpecFile ? getParsedSpecFile(service, document) : await getRawSpecFile(service),
4364
+ content: saveParsedSpecFile ? getParsedSpecFile(service, document2) : await getRawSpecFile(service),
3130
4365
  fileName: import_path3.default.basename(service.path) || "asyncapi.yml"
3131
4366
  }
3132
4367
  ];
@@ -3145,9 +4380,9 @@ Processing domain: ${domainName} (v${domainVersion})`));
3145
4380
  Finished generating event catalog for AsyncAPI ${serviceId} (v${version})`));
3146
4381
  }
3147
4382
  };
3148
- var getParsedSpecFile = (service, document) => {
4383
+ var getParsedSpecFile = (service, document2) => {
3149
4384
  const isSpecFileJSON = service.path.endsWith(".json");
3150
- return isSpecFileJSON ? JSON.stringify(document.meta().asyncapi.parsed, null, 4) : import_js_yaml.default.dump(document.meta().asyncapi.parsed, { noRefs: true });
4385
+ return isSpecFileJSON ? JSON.stringify(document2.meta().asyncapi.parsed, null, 4) : import_js_yaml.default.dump(document2.meta().asyncapi.parsed, { noRefs: true });
3151
4386
  };
3152
4387
  var getRawSpecFile = async (service) => {
3153
4388
  if (service.path.startsWith("http")) {