@eventcatalog/generator-asyncapi 5.0.1 → 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/README.md +1 -1
- package/dist/index.js +1275 -41
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1282 -42
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -5,7 +5,13 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
7
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
-
var
|
|
8
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
9
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
10
|
+
}) : x)(function(x) {
|
|
11
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
12
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
13
|
+
});
|
|
14
|
+
var __commonJS = (cb, mod) => function __require2() {
|
|
9
15
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
10
16
|
};
|
|
11
17
|
var __copyProps = (to, from, except, desc) => {
|
|
@@ -279,6 +285,1246 @@ var require_ansi_align = __commonJS({
|
|
|
279
285
|
}
|
|
280
286
|
});
|
|
281
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"(exports, module) {
|
|
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
|
+
module.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"(exports, module) {
|
|
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
|
+
module.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"(exports, module) {
|
|
586
|
+
"use strict";
|
|
587
|
+
exports.formatArgs = formatArgs;
|
|
588
|
+
exports.save = save;
|
|
589
|
+
exports.load = load;
|
|
590
|
+
exports.useColors = useColors;
|
|
591
|
+
exports.storage = localstorage();
|
|
592
|
+
exports.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
|
+
exports.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 " : " ") + "+" + module.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
|
+
exports.log = console.debug || console.log || (() => {
|
|
714
|
+
});
|
|
715
|
+
function save(namespaces) {
|
|
716
|
+
try {
|
|
717
|
+
if (namespaces) {
|
|
718
|
+
exports.storage.setItem("debug", namespaces);
|
|
719
|
+
} else {
|
|
720
|
+
exports.storage.removeItem("debug");
|
|
721
|
+
}
|
|
722
|
+
} catch (error) {
|
|
723
|
+
}
|
|
724
|
+
}
|
|
725
|
+
function load() {
|
|
726
|
+
let r;
|
|
727
|
+
try {
|
|
728
|
+
r = exports.storage.getItem("debug") || exports.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
|
+
module.exports = require_common()(exports);
|
|
743
|
+
var { formatters } = module.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"(exports, module) {
|
|
757
|
+
"use strict";
|
|
758
|
+
module.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"(exports, module) {
|
|
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
|
+
module.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"(exports, module) {
|
|
872
|
+
"use strict";
|
|
873
|
+
var tty = __require("tty");
|
|
874
|
+
var util3 = __require("util");
|
|
875
|
+
exports.init = init;
|
|
876
|
+
exports.log = log;
|
|
877
|
+
exports.formatArgs = formatArgs;
|
|
878
|
+
exports.save = save;
|
|
879
|
+
exports.load = load;
|
|
880
|
+
exports.useColors = useColors;
|
|
881
|
+
exports.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
|
+
exports.colors = [6, 2, 3, 4, 5, 1];
|
|
887
|
+
try {
|
|
888
|
+
const supportsColor = require_supports_color();
|
|
889
|
+
if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
|
|
890
|
+
exports.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
|
+
exports.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 exports.inspectOpts ? Boolean(exports.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+" + module.exports.humanize(this.diff) + "\x1B[0m");
|
|
1001
|
+
} else {
|
|
1002
|
+
args[0] = getDate() + name + " " + args[0];
|
|
1003
|
+
}
|
|
1004
|
+
}
|
|
1005
|
+
function getDate() {
|
|
1006
|
+
if (exports.inspectOpts.hideDate) {
|
|
1007
|
+
return "";
|
|
1008
|
+
}
|
|
1009
|
+
return (/* @__PURE__ */ new Date()).toISOString() + " ";
|
|
1010
|
+
}
|
|
1011
|
+
function log(...args) {
|
|
1012
|
+
return process.stderr.write(util3.formatWithOptions(exports.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(exports.inspectOpts);
|
|
1027
|
+
for (let i = 0; i < keys.length; i++) {
|
|
1028
|
+
debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
|
|
1029
|
+
}
|
|
1030
|
+
}
|
|
1031
|
+
module.exports = require_common()(exports);
|
|
1032
|
+
var { formatters } = module.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"(exports, module) {
|
|
1047
|
+
"use strict";
|
|
1048
|
+
if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) {
|
|
1049
|
+
module.exports = require_browser();
|
|
1050
|
+
} else {
|
|
1051
|
+
module.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"(exports) {
|
|
1059
|
+
"use strict";
|
|
1060
|
+
var __createBinding = exports && exports.__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 = exports && exports.__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 = exports && exports.__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(exports, "__esModule", { value: true });
|
|
1088
|
+
exports.req = exports.json = exports.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
|
+
exports.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
|
+
exports.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
|
+
exports.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"(exports) {
|
|
1129
|
+
"use strict";
|
|
1130
|
+
var __createBinding = exports && exports.__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 = exports && exports.__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 = exports && exports.__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 = exports && exports.__exportStar || function(m, exports2) {
|
|
1158
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p)) __createBinding(exports2, m, p);
|
|
1159
|
+
};
|
|
1160
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1161
|
+
exports.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(), exports);
|
|
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
|
+
exports.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"(exports) {
|
|
1285
|
+
"use strict";
|
|
1286
|
+
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
1287
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
1288
|
+
};
|
|
1289
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1290
|
+
exports.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
|
+
exports.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"(exports) {
|
|
1381
|
+
"use strict";
|
|
1382
|
+
var __createBinding = exports && exports.__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 = exports && exports.__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 = exports && exports.__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 = exports && exports.__importDefault || function(mod) {
|
|
1410
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
1411
|
+
};
|
|
1412
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1413
|
+
exports.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
|
+
exports.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
|
+
|
|
282
1528
|
// src/index.ts
|
|
283
1529
|
import { Parser, fromFile, fromURL } from "@asyncapi/parser";
|
|
284
1530
|
import utils from "@eventcatalog/sdk";
|
|
@@ -292,7 +1538,7 @@ import path3 from "path";
|
|
|
292
1538
|
// package.json
|
|
293
1539
|
var package_default = {
|
|
294
1540
|
name: "@eventcatalog/generator-asyncapi",
|
|
295
|
-
version: "5.0.
|
|
1541
|
+
version: "5.0.2",
|
|
296
1542
|
description: "AsyncAPI generator for EventCatalog",
|
|
297
1543
|
scripts: {
|
|
298
1544
|
build: "tsup",
|
|
@@ -1262,9 +2508,9 @@ var getSchemaFileName = (message2) => {
|
|
|
1262
2508
|
var getMessageName = (message2) => {
|
|
1263
2509
|
return message2.hasTitle() && message2.title() ? message2.title() : message2.id();
|
|
1264
2510
|
};
|
|
1265
|
-
var getChannelsForMessage = (message2, channels,
|
|
2511
|
+
var getChannelsForMessage = (message2, channels, document2) => {
|
|
1266
2512
|
let channelsForMessage = [];
|
|
1267
|
-
const globalVersion =
|
|
2513
|
+
const globalVersion = document2.info().version();
|
|
1268
2514
|
for (const channel of channels) {
|
|
1269
2515
|
for (const channelMessage of channel.messages()) {
|
|
1270
2516
|
if (channelMessage.id() === message2.id()) {
|
|
@@ -1288,27 +2534,27 @@ var getChannelsForMessage = (message2, channels, document) => {
|
|
|
1288
2534
|
};
|
|
1289
2535
|
|
|
1290
2536
|
// src/utils/services.ts
|
|
1291
|
-
var defaultMarkdown2 = (
|
|
2537
|
+
var defaultMarkdown2 = (document2) => {
|
|
1292
2538
|
return `
|
|
1293
2539
|
|
|
1294
|
-
${
|
|
2540
|
+
${document2.info().hasDescription() ? `${document2.info().description()}` : ""}
|
|
1295
2541
|
|
|
1296
2542
|
## Architecture diagram
|
|
1297
2543
|
<NodeGraph />
|
|
1298
2544
|
|
|
1299
|
-
${
|
|
2545
|
+
${document2.info().externalDocs() ? `
|
|
1300
2546
|
## External documentation
|
|
1301
|
-
- [${
|
|
2547
|
+
- [${document2.info().externalDocs()?.description()}](${document2.info().externalDocs()?.url()})
|
|
1302
2548
|
` : ""}
|
|
1303
2549
|
`;
|
|
1304
2550
|
};
|
|
1305
|
-
var getSummary2 = (
|
|
1306
|
-
const summary =
|
|
2551
|
+
var getSummary2 = (document2) => {
|
|
2552
|
+
const summary = document2.info().hasDescription() ? document2.info().description() : "";
|
|
1307
2553
|
return summary && summary.length < 150 ? summary : "";
|
|
1308
2554
|
};
|
|
1309
2555
|
|
|
1310
2556
|
// src/utils/domains.ts
|
|
1311
|
-
var defaultMarkdown3 = (
|
|
2557
|
+
var defaultMarkdown3 = (document2) => {
|
|
1312
2558
|
return `
|
|
1313
2559
|
|
|
1314
2560
|
## Architecture diagram
|
|
@@ -1358,7 +2604,7 @@ var defaultMarkdown4 = (_document, channel) => {
|
|
|
1358
2604
|
// ../../shared/checkLicense.ts
|
|
1359
2605
|
import chalk3 from "chalk";
|
|
1360
2606
|
|
|
1361
|
-
// ../../node_modules/.pnpm/@eventcatalog+license@0.0.
|
|
2607
|
+
// ../../node_modules/.pnpm/@eventcatalog+license@0.0.7/node_modules/@eventcatalog/license/dist/verify.js
|
|
1362
2608
|
import { readFileSync, existsSync } from "fs";
|
|
1363
2609
|
|
|
1364
2610
|
// ../../node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/base64url.js
|
|
@@ -2413,7 +3659,7 @@ async function jwtVerify(jwt, key, options) {
|
|
|
2413
3659
|
return result;
|
|
2414
3660
|
}
|
|
2415
3661
|
|
|
2416
|
-
// ../../node_modules/.pnpm/@eventcatalog+license@0.0.
|
|
3662
|
+
// ../../node_modules/.pnpm/@eventcatalog+license@0.0.7/node_modules/@eventcatalog/license/dist/key.js
|
|
2417
3663
|
var PUBLIC_KEY = `-----BEGIN PUBLIC KEY-----
|
|
2418
3664
|
MCowBQYDK2VwAyEA599maqjKG7VW5bnj9fFA3msK691iHUYd+PkiZ7h9LpI=
|
|
2419
3665
|
-----END PUBLIC KEY-----`;
|
|
@@ -2421,9 +3667,10 @@ async function loadPublicPem() {
|
|
|
2421
3667
|
return PUBLIC_KEY;
|
|
2422
3668
|
}
|
|
2423
3669
|
|
|
2424
|
-
// ../../node_modules/.pnpm/@eventcatalog+license@0.0.
|
|
3670
|
+
// ../../node_modules/.pnpm/@eventcatalog+license@0.0.7/node_modules/@eventcatalog/license/dist/verify.js
|
|
2425
3671
|
import path2 from "path";
|
|
2426
3672
|
import chalk2 from "chalk";
|
|
3673
|
+
var import_https_proxy_agent = __toESM(require_dist2(), 1);
|
|
2427
3674
|
import https from "https";
|
|
2428
3675
|
import http from "http";
|
|
2429
3676
|
import { URL } from "url";
|
|
@@ -2442,14 +3689,7 @@ function makeHttpRequest(url, options) {
|
|
|
2442
3689
|
};
|
|
2443
3690
|
const proxyUrl = process.env.PROXY_SERVER_URI || process.env.HTTPS_PROXY || process.env.HTTP_PROXY;
|
|
2444
3691
|
if (proxyUrl) {
|
|
2445
|
-
|
|
2446
|
-
requestOptions.hostname = proxy.hostname;
|
|
2447
|
-
requestOptions.port = proxy.port || (proxy.protocol === "https:" ? 443 : 80);
|
|
2448
|
-
requestOptions.path = url;
|
|
2449
|
-
requestOptions.headers = {
|
|
2450
|
-
...requestOptions.headers,
|
|
2451
|
-
Host: urlObj.hostname
|
|
2452
|
-
};
|
|
3692
|
+
requestOptions.agent = new import_https_proxy_agent.HttpsProxyAgent(proxyUrl);
|
|
2453
3693
|
}
|
|
2454
3694
|
const req = client.request(requestOptions, (res) => {
|
|
2455
3695
|
let data = "";
|
|
@@ -2667,7 +3907,7 @@ function isValidLicenseKeyFormat(key) {
|
|
|
2667
3907
|
return true;
|
|
2668
3908
|
}
|
|
2669
3909
|
|
|
2670
|
-
// ../../node_modules/.pnpm/@eventcatalog+license@0.0.
|
|
3910
|
+
// ../../node_modules/.pnpm/@eventcatalog+license@0.0.7/node_modules/@eventcatalog/license/dist/plans.js
|
|
2671
3911
|
var isFeatureEnabled2 = async (feature, key) => {
|
|
2672
3912
|
if (hasOfflineLicenseKey()) {
|
|
2673
3913
|
await verifyOfflineLicense();
|
|
@@ -2847,12 +4087,12 @@ var index_default = async (config, options) => {
|
|
|
2847
4087
|
console.log(chalk4.green(`Processing ${services.length} AsyncAPI files...`));
|
|
2848
4088
|
for (const service of services) {
|
|
2849
4089
|
console.log(chalk4.gray(`Processing ${service.path}`));
|
|
2850
|
-
const { document, diagnostics } = service.path.startsWith("http") ? await fromURL(parser, service.path).parse({
|
|
4090
|
+
const { document: document2, diagnostics } = service.path.startsWith("http") ? await fromURL(parser, service.path).parse({
|
|
2851
4091
|
parseSchemas
|
|
2852
4092
|
}) : await fromFile(parser, service.path).parse({
|
|
2853
4093
|
parseSchemas
|
|
2854
4094
|
});
|
|
2855
|
-
if (!
|
|
4095
|
+
if (!document2) {
|
|
2856
4096
|
console.log(chalk4.red("Failed to parse AsyncAPI file"));
|
|
2857
4097
|
if (options.debug || cliArgs.debug) {
|
|
2858
4098
|
console.log(diagnostics);
|
|
@@ -2861,14 +4101,14 @@ var index_default = async (config, options) => {
|
|
|
2861
4101
|
}
|
|
2862
4102
|
continue;
|
|
2863
4103
|
}
|
|
2864
|
-
const operations =
|
|
2865
|
-
const channels =
|
|
2866
|
-
const documentTags =
|
|
4104
|
+
const operations = document2.allOperations();
|
|
4105
|
+
const channels = document2.allChannels();
|
|
4106
|
+
const documentTags = document2.info().tags().all() || [];
|
|
2867
4107
|
const isDomainMarkedAsDraft = options.domain?.draft || false;
|
|
2868
|
-
const isServiceMarkedAsDraft = isDomainMarkedAsDraft ||
|
|
4108
|
+
const isServiceMarkedAsDraft = isDomainMarkedAsDraft || document2.info().extensions().get("x-eventcatalog-draft")?.value() || service.draft || false;
|
|
2869
4109
|
const serviceId = service.id;
|
|
2870
|
-
const serviceName = service.name ||
|
|
2871
|
-
const version =
|
|
4110
|
+
const serviceName = service.name || document2.info().title();
|
|
4111
|
+
const version = document2.info().version();
|
|
2872
4112
|
let sends = [];
|
|
2873
4113
|
let receives = [];
|
|
2874
4114
|
let owners = service.owners || null;
|
|
@@ -2877,10 +4117,10 @@ var index_default = async (config, options) => {
|
|
|
2877
4117
|
let attachments = null;
|
|
2878
4118
|
let serviceSpecifications = {};
|
|
2879
4119
|
let serviceSpecificationsFiles = [];
|
|
2880
|
-
const generatedMarkdownForService = defaultMarkdown2(
|
|
4120
|
+
const generatedMarkdownForService = defaultMarkdown2(document2);
|
|
2881
4121
|
let serviceMarkdown = service.generateMarkdown ? service.generateMarkdown({
|
|
2882
4122
|
service: { id: service.id, name: serviceName, version },
|
|
2883
|
-
document,
|
|
4123
|
+
document: document2,
|
|
2884
4124
|
markdown: generatedMarkdownForService
|
|
2885
4125
|
}) : generatedMarkdownForService;
|
|
2886
4126
|
let styles2 = null;
|
|
@@ -2900,7 +4140,7 @@ Processing domain: ${domainName} (v${domainVersion})`));
|
|
|
2900
4140
|
console.log(chalk4.cyan(` - Versioned previous domain (v${currentDomain.version})`));
|
|
2901
4141
|
}
|
|
2902
4142
|
if (!domain || domain && domain.version !== domainVersion) {
|
|
2903
|
-
const generatedMarkdownForDomain = defaultMarkdown3(
|
|
4143
|
+
const generatedMarkdownForDomain = defaultMarkdown3(document2);
|
|
2904
4144
|
await writeDomain({
|
|
2905
4145
|
id: domainId,
|
|
2906
4146
|
name: domainName,
|
|
@@ -2925,7 +4165,7 @@ Processing domain: ${domainName} (v${domainVersion})`));
|
|
|
2925
4165
|
const protocols = getChannelProtocols(channel);
|
|
2926
4166
|
const channelTags = getChannelTags(channel);
|
|
2927
4167
|
const channelVersion = channel.extensions().get("x-eventcatalog-channel-version")?.value() || version;
|
|
2928
|
-
let channelMarkdown = defaultMarkdown4(
|
|
4168
|
+
let channelMarkdown = defaultMarkdown4(document2, channel);
|
|
2929
4169
|
console.log(chalk4.blue(`Processing channel: ${channelId} (v${channelVersion})`));
|
|
2930
4170
|
const paramsForCatalog = Object.keys(params).reduce(
|
|
2931
4171
|
(acc, key) => {
|
|
@@ -2995,8 +4235,8 @@ Processing domain: ${domainName} (v${domainVersion})`));
|
|
|
2995
4235
|
addSchema: addSchemaToMessage,
|
|
2996
4236
|
collection: folder
|
|
2997
4237
|
} = MESSAGE_OPERATIONS[eventType];
|
|
2998
|
-
const generatedMarkdownForMessage = defaultMarkdown(
|
|
2999
|
-
let messageMarkdown = options.messages?.generateMarkdown ? options.messages.generateMarkdown({ message: message2, document, markdown: generatedMarkdownForMessage }) : generatedMarkdownForMessage;
|
|
4238
|
+
const generatedMarkdownForMessage = defaultMarkdown(document2, message2);
|
|
4239
|
+
let messageMarkdown = options.messages?.generateMarkdown ? options.messages.generateMarkdown({ message: message2, document: document2, markdown: generatedMarkdownForMessage }) : generatedMarkdownForMessage;
|
|
3000
4240
|
const badges2 = message2.tags().all() || [];
|
|
3001
4241
|
let messageBadges = null;
|
|
3002
4242
|
let messageAttachments = null;
|
|
@@ -3016,7 +4256,7 @@ Processing domain: ${domainName} (v${domainVersion})`));
|
|
|
3016
4256
|
console.log(chalk4.cyan(` - Versioned previous message: (v${catalogedMessage.version})`));
|
|
3017
4257
|
}
|
|
3018
4258
|
}
|
|
3019
|
-
const channelsForMessage = parseChannels ? getChannelsForMessage(message2, channels,
|
|
4259
|
+
const channelsForMessage = parseChannels ? getChannelsForMessage(message2, channels, document2) : [];
|
|
3020
4260
|
await writeMessage(
|
|
3021
4261
|
{
|
|
3022
4262
|
id: messageId,
|
|
@@ -3089,7 +4329,7 @@ Processing domain: ${domainName} (v${domainVersion})`));
|
|
|
3089
4329
|
id: serviceId,
|
|
3090
4330
|
name: serviceName,
|
|
3091
4331
|
version,
|
|
3092
|
-
summary: service.summary || getSummary2(
|
|
4332
|
+
summary: service.summary || getSummary2(document2),
|
|
3093
4333
|
badges: badges || documentTags.map((tag2) => ({ content: tag2.name(), textColor: "blue", backgroundColor: "blue" })),
|
|
3094
4334
|
markdown: serviceMarkdown,
|
|
3095
4335
|
sends,
|
|
@@ -3116,7 +4356,7 @@ Processing domain: ${domainName} (v${domainVersion})`));
|
|
|
3116
4356
|
// add any previous spec files to the list
|
|
3117
4357
|
...serviceSpecificationsFiles,
|
|
3118
4358
|
{
|
|
3119
|
-
content: saveParsedSpecFile ? getParsedSpecFile(service,
|
|
4359
|
+
content: saveParsedSpecFile ? getParsedSpecFile(service, document2) : await getRawSpecFile(service),
|
|
3120
4360
|
fileName: path3.basename(service.path) || "asyncapi.yml"
|
|
3121
4361
|
}
|
|
3122
4362
|
];
|
|
@@ -3135,9 +4375,9 @@ Processing domain: ${domainName} (v${domainVersion})`));
|
|
|
3135
4375
|
Finished generating event catalog for AsyncAPI ${serviceId} (v${version})`));
|
|
3136
4376
|
}
|
|
3137
4377
|
};
|
|
3138
|
-
var getParsedSpecFile = (service,
|
|
4378
|
+
var getParsedSpecFile = (service, document2) => {
|
|
3139
4379
|
const isSpecFileJSON = service.path.endsWith(".json");
|
|
3140
|
-
return isSpecFileJSON ? JSON.stringify(
|
|
4380
|
+
return isSpecFileJSON ? JSON.stringify(document2.meta().asyncapi.parsed, null, 4) : yaml.dump(document2.meta().asyncapi.parsed, { noRefs: true });
|
|
3141
4381
|
};
|
|
3142
4382
|
var getRawSpecFile = async (service) => {
|
|
3143
4383
|
if (service.path.startsWith("http")) {
|