@eventcatalog/generator-asyncapi 4.4.0 → 4.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -5,6 +5,7 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __getProtoOf = Object.getPrototypeOf;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
9
  var __commonJS = (cb, mod) => function __require() {
9
10
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
10
11
  };
@@ -29,6 +30,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
29
30
  mod
30
31
  ));
31
32
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
33
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
32
34
 
33
35
  // ../../node_modules/.pnpm/cli-boxes@3.0.0/node_modules/cli-boxes/boxes.json
34
36
  var require_boxes = __commonJS({
@@ -283,1534 +285,292 @@ var require_ansi_align = __commonJS({
283
285
  }
284
286
  });
285
287
 
286
- // ../../node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js
287
- var require_ms = __commonJS({
288
- "../../node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js"(exports2, module2) {
289
- "use strict";
290
- var s = 1e3;
291
- var m = s * 60;
292
- var h = m * 60;
293
- var d = h * 24;
294
- var w = d * 7;
295
- var y = d * 365.25;
296
- module2.exports = function(val, options) {
297
- options = options || {};
298
- var type = typeof val;
299
- if (type === "string" && val.length > 0) {
300
- return parse(val);
301
- } else if (type === "number" && isFinite(val)) {
302
- return options.long ? fmtLong(val) : fmtShort(val);
303
- }
304
- throw new Error(
305
- "val is not a non-empty string or a valid number. val=" + JSON.stringify(val)
306
- );
307
- };
308
- function parse(str) {
309
- str = String(str);
310
- if (str.length > 100) {
311
- return;
312
- }
313
- 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(
314
- str
315
- );
316
- if (!match) {
317
- return;
318
- }
319
- var n = parseFloat(match[1]);
320
- var type = (match[2] || "ms").toLowerCase();
321
- switch (type) {
322
- case "years":
323
- case "year":
324
- case "yrs":
325
- case "yr":
326
- case "y":
327
- return n * y;
328
- case "weeks":
329
- case "week":
330
- case "w":
331
- return n * w;
332
- case "days":
333
- case "day":
334
- case "d":
335
- return n * d;
336
- case "hours":
337
- case "hour":
338
- case "hrs":
339
- case "hr":
340
- case "h":
341
- return n * h;
342
- case "minutes":
343
- case "minute":
344
- case "mins":
345
- case "min":
346
- case "m":
347
- return n * m;
348
- case "seconds":
349
- case "second":
350
- case "secs":
351
- case "sec":
352
- case "s":
353
- return n * s;
354
- case "milliseconds":
355
- case "millisecond":
356
- case "msecs":
357
- case "msec":
358
- case "ms":
359
- return n;
360
- default:
361
- return void 0;
362
- }
363
- }
364
- function fmtShort(ms) {
365
- var msAbs = Math.abs(ms);
366
- if (msAbs >= d) {
367
- return Math.round(ms / d) + "d";
368
- }
369
- if (msAbs >= h) {
370
- return Math.round(ms / h) + "h";
371
- }
372
- if (msAbs >= m) {
373
- return Math.round(ms / m) + "m";
374
- }
375
- if (msAbs >= s) {
376
- return Math.round(ms / s) + "s";
377
- }
378
- return ms + "ms";
379
- }
380
- function fmtLong(ms) {
381
- var msAbs = Math.abs(ms);
382
- if (msAbs >= d) {
383
- return plural(ms, msAbs, d, "day");
384
- }
385
- if (msAbs >= h) {
386
- return plural(ms, msAbs, h, "hour");
387
- }
388
- if (msAbs >= m) {
389
- return plural(ms, msAbs, m, "minute");
390
- }
391
- if (msAbs >= s) {
392
- return plural(ms, msAbs, s, "second");
393
- }
394
- return ms + " ms";
395
- }
396
- function plural(ms, msAbs, n, name) {
397
- var isPlural = msAbs >= n * 1.5;
398
- return Math.round(ms / n) + " " + name + (isPlural ? "s" : "");
399
- }
400
- }
288
+ // src/index.ts
289
+ var index_exports = {};
290
+ __export(index_exports, {
291
+ default: () => index_default
401
292
  });
293
+ module.exports = __toCommonJS(index_exports);
294
+ var import_parser = require("@asyncapi/parser");
295
+ var import_sdk = __toESM(require("@eventcatalog/sdk"));
296
+ var import_promises = require("fs/promises");
297
+ var import_minimist = __toESM(require("minimist"));
298
+ var import_js_yaml = __toESM(require("js-yaml"));
299
+ var import_zod = require("zod");
300
+ var import_chalk4 = __toESM(require("chalk"));
301
+ var import_path3 = __toESM(require("path"));
402
302
 
403
- // ../../node_modules/.pnpm/debug@4.4.1/node_modules/debug/src/common.js
404
- var require_common = __commonJS({
405
- "../../node_modules/.pnpm/debug@4.4.1/node_modules/debug/src/common.js"(exports2, module2) {
406
- "use strict";
407
- function setup(env) {
408
- createDebug.debug = createDebug;
409
- createDebug.default = createDebug;
410
- createDebug.coerce = coerce;
411
- createDebug.disable = disable;
412
- createDebug.enable = enable;
413
- createDebug.enabled = enabled;
414
- createDebug.humanize = require_ms();
415
- createDebug.destroy = destroy;
416
- Object.keys(env).forEach((key) => {
417
- createDebug[key] = env[key];
418
- });
419
- createDebug.names = [];
420
- createDebug.skips = [];
421
- createDebug.formatters = {};
422
- function selectColor(namespace) {
423
- let hash = 0;
424
- for (let i = 0; i < namespace.length; i++) {
425
- hash = (hash << 5) - hash + namespace.charCodeAt(i);
426
- hash |= 0;
427
- }
428
- return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
429
- }
430
- createDebug.selectColor = selectColor;
431
- function createDebug(namespace) {
432
- let prevTime;
433
- let enableOverride = null;
434
- let namespacesCache;
435
- let enabledCache;
436
- function debug(...args) {
437
- if (!debug.enabled) {
438
- return;
439
- }
440
- const self = debug;
441
- const curr = Number(/* @__PURE__ */ new Date());
442
- const ms = curr - (prevTime || curr);
443
- self.diff = ms;
444
- self.prev = prevTime;
445
- self.curr = curr;
446
- prevTime = curr;
447
- args[0] = createDebug.coerce(args[0]);
448
- if (typeof args[0] !== "string") {
449
- args.unshift("%O");
450
- }
451
- let index = 0;
452
- args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
453
- if (match === "%%") {
454
- return "%";
455
- }
456
- index++;
457
- const formatter = createDebug.formatters[format];
458
- if (typeof formatter === "function") {
459
- const val = args[index];
460
- match = formatter.call(self, val);
461
- args.splice(index, 1);
462
- index--;
463
- }
464
- return match;
465
- });
466
- createDebug.formatArgs.call(self, args);
467
- const logFn = self.log || createDebug.log;
468
- logFn.apply(self, args);
469
- }
470
- debug.namespace = namespace;
471
- debug.useColors = createDebug.useColors();
472
- debug.color = createDebug.selectColor(namespace);
473
- debug.extend = extend;
474
- debug.destroy = createDebug.destroy;
475
- Object.defineProperty(debug, "enabled", {
476
- enumerable: true,
477
- configurable: false,
478
- get: () => {
479
- if (enableOverride !== null) {
480
- return enableOverride;
481
- }
482
- if (namespacesCache !== createDebug.namespaces) {
483
- namespacesCache = createDebug.namespaces;
484
- enabledCache = createDebug.enabled(namespace);
485
- }
486
- return enabledCache;
487
- },
488
- set: (v) => {
489
- enableOverride = v;
490
- }
491
- });
492
- if (typeof createDebug.init === "function") {
493
- createDebug.init(debug);
494
- }
495
- return debug;
496
- }
497
- function extend(namespace, delimiter) {
498
- const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace);
499
- newDebug.log = this.log;
500
- return newDebug;
501
- }
502
- function enable(namespaces) {
503
- createDebug.save(namespaces);
504
- createDebug.namespaces = namespaces;
505
- createDebug.names = [];
506
- createDebug.skips = [];
507
- const split = (typeof namespaces === "string" ? namespaces : "").trim().replace(/\s+/g, ",").split(",").filter(Boolean);
508
- for (const ns of split) {
509
- if (ns[0] === "-") {
510
- createDebug.skips.push(ns.slice(1));
511
- } else {
512
- createDebug.names.push(ns);
513
- }
514
- }
515
- }
516
- function matchesTemplate(search, template) {
517
- let searchIndex = 0;
518
- let templateIndex = 0;
519
- let starIndex = -1;
520
- let matchIndex = 0;
521
- while (searchIndex < search.length) {
522
- if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) {
523
- if (template[templateIndex] === "*") {
524
- starIndex = templateIndex;
525
- matchIndex = searchIndex;
526
- templateIndex++;
527
- } else {
528
- searchIndex++;
529
- templateIndex++;
530
- }
531
- } else if (starIndex !== -1) {
532
- templateIndex = starIndex + 1;
533
- matchIndex++;
534
- searchIndex = matchIndex;
535
- } else {
536
- return false;
537
- }
538
- }
539
- while (templateIndex < template.length && template[templateIndex] === "*") {
540
- templateIndex++;
541
- }
542
- return templateIndex === template.length;
543
- }
544
- function disable() {
545
- const namespaces = [
546
- ...createDebug.names,
547
- ...createDebug.skips.map((namespace) => "-" + namespace)
548
- ].join(",");
549
- createDebug.enable("");
550
- return namespaces;
551
- }
552
- function enabled(name) {
553
- for (const skip of createDebug.skips) {
554
- if (matchesTemplate(name, skip)) {
555
- return false;
556
- }
557
- }
558
- for (const ns of createDebug.names) {
559
- if (matchesTemplate(name, ns)) {
560
- return true;
561
- }
562
- }
563
- return false;
564
- }
565
- function coerce(val) {
566
- if (val instanceof Error) {
567
- return val.stack || val.message;
568
- }
569
- return val;
570
- }
571
- function destroy() {
572
- console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
573
- }
574
- createDebug.enable(createDebug.load());
575
- return createDebug;
576
- }
577
- module2.exports = setup;
303
+ // package.json
304
+ var package_default = {
305
+ name: "@eventcatalog/generator-asyncapi",
306
+ version: "4.5.0",
307
+ description: "AsyncAPI generator for EventCatalog",
308
+ scripts: {
309
+ build: "tsup",
310
+ test: "vitest",
311
+ format: "prettier --write .",
312
+ "format:diff": "prettier --list-different .",
313
+ changeset: "changeset",
314
+ release: "changeset publish"
315
+ },
316
+ publishConfig: {
317
+ access: "public"
318
+ },
319
+ keywords: [],
320
+ author: "",
321
+ license: "ISC",
322
+ devDependencies: {
323
+ "@changesets/cli": "^2.27.9",
324
+ "@types/fs-extra": "^11.0.4",
325
+ "@types/js-yaml": "^4.0.9",
326
+ "@types/lodash": "^4.17.7",
327
+ "@types/minimist": "^1.2.5",
328
+ "@types/node": "^20.16.1",
329
+ prettier: "^3.3.3",
330
+ tsup: "^8.1.0",
331
+ typescript: "^5.5.3",
332
+ vitest: "^2.0.2"
333
+ },
334
+ files: [
335
+ "dist",
336
+ "package.json"
337
+ ],
338
+ main: "./dist/index.js",
339
+ module: "./dist/index.mjs",
340
+ types: "./dist/index.d.ts",
341
+ dependencies: {
342
+ "@asyncapi/avro-schema-parser": "^3.0.24",
343
+ "@asyncapi/parser": "^3.4.0",
344
+ "@eventcatalog/sdk": "^2.6.9",
345
+ chalk: "^4",
346
+ "fs-extra": "^11.2.0",
347
+ glob: "^11.0.0",
348
+ "gray-matter": "^4.0.3",
349
+ "js-yaml": "^4.1.0",
350
+ lodash: "^4.17.21",
351
+ minimist: "^1.2.8",
352
+ slugify: "^1.6.6",
353
+ "update-notifier": "^7.3.1",
354
+ zod: "^3.23.8"
578
355
  }
579
- });
356
+ };
580
357
 
581
- // ../../node_modules/.pnpm/debug@4.4.1/node_modules/debug/src/browser.js
582
- var require_browser = __commonJS({
583
- "../../node_modules/.pnpm/debug@4.4.1/node_modules/debug/src/browser.js"(exports2, module2) {
584
- "use strict";
585
- exports2.formatArgs = formatArgs;
586
- exports2.save = save;
587
- exports2.load = load;
588
- exports2.useColors = useColors;
589
- exports2.storage = localstorage();
590
- exports2.destroy = /* @__PURE__ */ (() => {
591
- let warned = false;
592
- return () => {
593
- if (!warned) {
594
- warned = true;
595
- console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
596
- }
597
- };
598
- })();
599
- exports2.colors = [
600
- "#0000CC",
601
- "#0000FF",
602
- "#0033CC",
603
- "#0033FF",
604
- "#0066CC",
605
- "#0066FF",
606
- "#0099CC",
607
- "#0099FF",
608
- "#00CC00",
609
- "#00CC33",
610
- "#00CC66",
611
- "#00CC99",
612
- "#00CCCC",
613
- "#00CCFF",
614
- "#3300CC",
615
- "#3300FF",
616
- "#3333CC",
617
- "#3333FF",
618
- "#3366CC",
619
- "#3366FF",
620
- "#3399CC",
621
- "#3399FF",
622
- "#33CC00",
623
- "#33CC33",
624
- "#33CC66",
625
- "#33CC99",
626
- "#33CCCC",
627
- "#33CCFF",
628
- "#6600CC",
629
- "#6600FF",
630
- "#6633CC",
631
- "#6633FF",
632
- "#66CC00",
633
- "#66CC33",
634
- "#9900CC",
635
- "#9900FF",
636
- "#9933CC",
637
- "#9933FF",
638
- "#99CC00",
639
- "#99CC33",
640
- "#CC0000",
641
- "#CC0033",
642
- "#CC0066",
643
- "#CC0099",
644
- "#CC00CC",
645
- "#CC00FF",
646
- "#CC3300",
647
- "#CC3333",
648
- "#CC3366",
649
- "#CC3399",
650
- "#CC33CC",
651
- "#CC33FF",
652
- "#CC6600",
653
- "#CC6633",
654
- "#CC9900",
655
- "#CC9933",
656
- "#CCCC00",
657
- "#CCCC33",
658
- "#FF0000",
659
- "#FF0033",
660
- "#FF0066",
661
- "#FF0099",
662
- "#FF00CC",
663
- "#FF00FF",
664
- "#FF3300",
665
- "#FF3333",
666
- "#FF3366",
667
- "#FF3399",
668
- "#FF33CC",
669
- "#FF33FF",
670
- "#FF6600",
671
- "#FF6633",
672
- "#FF9900",
673
- "#FF9933",
674
- "#FFCC00",
675
- "#FFCC33"
676
- ];
677
- function useColors() {
678
- if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) {
679
- return true;
680
- }
681
- if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
682
- return false;
683
- }
684
- let m;
685
- return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
686
- typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
687
- // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
688
- 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
689
- typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
690
- }
691
- function formatArgs(args) {
692
- args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module2.exports.humanize(this.diff);
693
- if (!this.useColors) {
694
- return;
695
- }
696
- const c = "color: " + this.color;
697
- args.splice(1, 0, c, "color: inherit");
698
- let index = 0;
699
- let lastC = 0;
700
- args[0].replace(/%[a-zA-Z%]/g, (match) => {
701
- if (match === "%%") {
702
- return;
703
- }
704
- index++;
705
- if (match === "%c") {
706
- lastC = index;
707
- }
708
- });
709
- args.splice(lastC, 0, c);
710
- }
711
- exports2.log = console.debug || console.log || (() => {
712
- });
713
- function save(namespaces) {
714
- try {
715
- if (namespaces) {
716
- exports2.storage.setItem("debug", namespaces);
717
- } else {
718
- exports2.storage.removeItem("debug");
719
- }
720
- } catch (error) {
721
- }
722
- }
723
- function load() {
724
- let r;
725
- try {
726
- r = exports2.storage.getItem("debug") || exports2.storage.getItem("DEBUG");
727
- } catch (error) {
728
- }
729
- if (!r && typeof process !== "undefined" && "env" in process) {
730
- r = process.env.DEBUG;
731
- }
732
- return r;
733
- }
734
- function localstorage() {
735
- try {
736
- return localStorage;
737
- } catch (error) {
738
- }
739
- }
740
- module2.exports = require_common()(exports2);
741
- var { formatters } = module2.exports;
742
- formatters.j = function(v) {
743
- try {
744
- return JSON.stringify(v);
745
- } catch (error) {
746
- return "[UnexpectedJSONParseError]: " + error.message;
747
- }
748
- };
358
+ // ../../node_modules/.pnpm/boxen@8.0.1/node_modules/boxen/index.js
359
+ var import_node_process = __toESM(require("process"), 1);
360
+
361
+ // ../../node_modules/.pnpm/ansi-regex@6.2.0/node_modules/ansi-regex/index.js
362
+ function ansiRegex({ onlyFirst = false } = {}) {
363
+ const ST = "(?:\\u0007|\\u001B\\u005C|\\u009C)";
364
+ const osc = `(?:\\u001B\\][\\s\\S]*?${ST})`;
365
+ const csi = "[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";
366
+ const pattern = `${osc}|${csi}`;
367
+ return new RegExp(pattern, onlyFirst ? void 0 : "g");
368
+ }
369
+
370
+ // ../../node_modules/.pnpm/strip-ansi@7.1.0/node_modules/strip-ansi/index.js
371
+ var regex = ansiRegex();
372
+ function stripAnsi(string) {
373
+ if (typeof string !== "string") {
374
+ throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
749
375
  }
750
- });
376
+ return string.replace(regex, "");
377
+ }
751
378
 
752
- // ../../node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js
753
- var require_has_flag = __commonJS({
754
- "../../node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js"(exports2, module2) {
755
- "use strict";
756
- module2.exports = (flag, argv2 = process.argv) => {
757
- const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
758
- const position = argv2.indexOf(prefix + flag);
759
- const terminatorPosition = argv2.indexOf("--");
760
- return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
761
- };
379
+ // ../../node_modules/.pnpm/get-east-asian-width@1.3.1/node_modules/get-east-asian-width/lookup.js
380
+ function isAmbiguous(x) {
381
+ return x === 161 || x === 164 || x === 167 || x === 168 || x === 170 || x === 173 || x === 174 || x >= 176 && x <= 180 || x >= 182 && x <= 186 || x >= 188 && x <= 191 || x === 198 || x === 208 || x === 215 || x === 216 || x >= 222 && x <= 225 || x === 230 || x >= 232 && x <= 234 || x === 236 || x === 237 || x === 240 || x === 242 || x === 243 || x >= 247 && x <= 250 || x === 252 || x === 254 || x === 257 || x === 273 || x === 275 || x === 283 || x === 294 || x === 295 || x === 299 || x >= 305 && x <= 307 || x === 312 || x >= 319 && x <= 322 || x === 324 || x >= 328 && x <= 331 || x === 333 || x === 338 || x === 339 || x === 358 || x === 359 || x === 363 || x === 462 || x === 464 || x === 466 || x === 468 || x === 470 || x === 472 || x === 474 || x === 476 || x === 593 || x === 609 || x === 708 || x === 711 || x >= 713 && x <= 715 || x === 717 || x === 720 || x >= 728 && x <= 731 || x === 733 || x === 735 || x >= 768 && x <= 879 || x >= 913 && x <= 929 || x >= 931 && x <= 937 || x >= 945 && x <= 961 || x >= 963 && x <= 969 || x === 1025 || x >= 1040 && x <= 1103 || x === 1105 || x === 8208 || x >= 8211 && x <= 8214 || x === 8216 || x === 8217 || x === 8220 || x === 8221 || x >= 8224 && x <= 8226 || x >= 8228 && x <= 8231 || x === 8240 || x === 8242 || x === 8243 || x === 8245 || x === 8251 || x === 8254 || x === 8308 || x === 8319 || x >= 8321 && x <= 8324 || x === 8364 || x === 8451 || x === 8453 || x === 8457 || x === 8467 || x === 8470 || x === 8481 || x === 8482 || x === 8486 || x === 8491 || x === 8531 || x === 8532 || x >= 8539 && x <= 8542 || x >= 8544 && x <= 8555 || x >= 8560 && x <= 8569 || x === 8585 || x >= 8592 && x <= 8601 || x === 8632 || x === 8633 || x === 8658 || x === 8660 || x === 8679 || x === 8704 || x === 8706 || x === 8707 || x === 8711 || x === 8712 || x === 8715 || x === 8719 || x === 8721 || x === 8725 || x === 8730 || x >= 8733 && x <= 8736 || x === 8739 || x === 8741 || x >= 8743 && x <= 8748 || x === 8750 || x >= 8756 && x <= 8759 || x === 8764 || x === 8765 || x === 8776 || x === 8780 || x === 8786 || x === 8800 || x === 8801 || x >= 8804 && x <= 8807 || x === 8810 || x === 8811 || x === 8814 || x === 8815 || x === 8834 || x === 8835 || x === 8838 || x === 8839 || x === 8853 || x === 8857 || x === 8869 || x === 8895 || x === 8978 || x >= 9312 && x <= 9449 || x >= 9451 && x <= 9547 || x >= 9552 && x <= 9587 || x >= 9600 && x <= 9615 || x >= 9618 && x <= 9621 || x === 9632 || x === 9633 || x >= 9635 && x <= 9641 || x === 9650 || x === 9651 || x === 9654 || x === 9655 || x === 9660 || x === 9661 || x === 9664 || x === 9665 || x >= 9670 && x <= 9672 || x === 9675 || x >= 9678 && x <= 9681 || x >= 9698 && x <= 9701 || x === 9711 || x === 9733 || x === 9734 || x === 9737 || x === 9742 || x === 9743 || x === 9756 || x === 9758 || x === 9792 || x === 9794 || x === 9824 || x === 9825 || x >= 9827 && x <= 9829 || x >= 9831 && x <= 9834 || x === 9836 || x === 9837 || x === 9839 || x === 9886 || x === 9887 || x === 9919 || x >= 9926 && x <= 9933 || x >= 9935 && x <= 9939 || x >= 9941 && x <= 9953 || x === 9955 || x === 9960 || x === 9961 || x >= 9963 && x <= 9969 || x === 9972 || x >= 9974 && x <= 9977 || x === 9979 || x === 9980 || x === 9982 || x === 9983 || x === 10045 || x >= 10102 && x <= 10111 || x >= 11094 && x <= 11097 || x >= 12872 && x <= 12879 || x >= 57344 && x <= 63743 || x >= 65024 && x <= 65039 || x === 65533 || x >= 127232 && x <= 127242 || x >= 127248 && x <= 127277 || x >= 127280 && x <= 127337 || x >= 127344 && x <= 127373 || x === 127375 || x === 127376 || x >= 127387 && x <= 127404 || x >= 917760 && x <= 917999 || x >= 983040 && x <= 1048573 || x >= 1048576 && x <= 1114109;
382
+ }
383
+ function isFullWidth(x) {
384
+ return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510;
385
+ }
386
+ function isWide(x) {
387
+ return x >= 4352 && x <= 4447 || x === 8986 || x === 8987 || x === 9001 || x === 9002 || x >= 9193 && x <= 9196 || x === 9200 || x === 9203 || x === 9725 || x === 9726 || x === 9748 || x === 9749 || x >= 9776 && x <= 9783 || x >= 9800 && x <= 9811 || x === 9855 || x >= 9866 && x <= 9871 || x === 9875 || x === 9889 || x === 9898 || x === 9899 || x === 9917 || x === 9918 || x === 9924 || x === 9925 || x === 9934 || x === 9940 || x === 9962 || x === 9970 || x === 9971 || x === 9973 || x === 9978 || x === 9981 || x === 9989 || x === 9994 || x === 9995 || x === 10024 || x === 10060 || x === 10062 || x >= 10067 && x <= 10069 || x === 10071 || x >= 10133 && x <= 10135 || x === 10160 || x === 10175 || x === 11035 || x === 11036 || x === 11088 || x === 11093 || x >= 11904 && x <= 11929 || x >= 11931 && x <= 12019 || x >= 12032 && x <= 12245 || x >= 12272 && x <= 12287 || x >= 12289 && x <= 12350 || x >= 12353 && x <= 12438 || x >= 12441 && x <= 12543 || x >= 12549 && x <= 12591 || x >= 12593 && x <= 12686 || x >= 12688 && x <= 12773 || x >= 12783 && x <= 12830 || x >= 12832 && x <= 12871 || x >= 12880 && x <= 42124 || x >= 42128 && x <= 42182 || x >= 43360 && x <= 43388 || x >= 44032 && x <= 55203 || x >= 63744 && x <= 64255 || x >= 65040 && x <= 65049 || x >= 65072 && x <= 65106 || x >= 65108 && x <= 65126 || x >= 65128 && x <= 65131 || x >= 94176 && x <= 94180 || x === 94192 || x === 94193 || x >= 94208 && x <= 100343 || x >= 100352 && x <= 101589 || x >= 101631 && x <= 101640 || x >= 110576 && x <= 110579 || x >= 110581 && x <= 110587 || x === 110589 || x === 110590 || x >= 110592 && x <= 110882 || x === 110898 || x >= 110928 && x <= 110930 || x === 110933 || x >= 110948 && x <= 110951 || x >= 110960 && x <= 111355 || x >= 119552 && x <= 119638 || x >= 119648 && x <= 119670 || x === 126980 || x === 127183 || x === 127374 || x >= 127377 && x <= 127386 || x >= 127488 && x <= 127490 || x >= 127504 && x <= 127547 || x >= 127552 && x <= 127560 || x === 127568 || x === 127569 || x >= 127584 && x <= 127589 || x >= 127744 && x <= 127776 || x >= 127789 && x <= 127797 || x >= 127799 && x <= 127868 || x >= 127870 && x <= 127891 || x >= 127904 && x <= 127946 || x >= 127951 && x <= 127955 || x >= 127968 && x <= 127984 || x === 127988 || x >= 127992 && x <= 128062 || x === 128064 || x >= 128066 && x <= 128252 || x >= 128255 && x <= 128317 || x >= 128331 && x <= 128334 || x >= 128336 && x <= 128359 || x === 128378 || x === 128405 || x === 128406 || x === 128420 || x >= 128507 && x <= 128591 || x >= 128640 && x <= 128709 || x === 128716 || x >= 128720 && x <= 128722 || x >= 128725 && x <= 128727 || x >= 128732 && x <= 128735 || x === 128747 || x === 128748 || x >= 128756 && x <= 128764 || x >= 128992 && x <= 129003 || x === 129008 || x >= 129292 && x <= 129338 || x >= 129340 && x <= 129349 || x >= 129351 && x <= 129535 || x >= 129648 && x <= 129660 || x >= 129664 && x <= 129673 || x >= 129679 && x <= 129734 || x >= 129742 && x <= 129756 || x >= 129759 && x <= 129769 || x >= 129776 && x <= 129784 || x >= 131072 && x <= 196605 || x >= 196608 && x <= 262141;
388
+ }
389
+
390
+ // ../../node_modules/.pnpm/get-east-asian-width@1.3.1/node_modules/get-east-asian-width/index.js
391
+ function validate(codePoint) {
392
+ if (!Number.isSafeInteger(codePoint)) {
393
+ throw new TypeError(`Expected a code point, got \`${typeof codePoint}\`.`);
762
394
  }
763
- });
395
+ }
396
+ function eastAsianWidth(codePoint, { ambiguousAsWide = false } = {}) {
397
+ validate(codePoint);
398
+ if (isFullWidth(codePoint) || isWide(codePoint) || ambiguousAsWide && isAmbiguous(codePoint)) {
399
+ return 2;
400
+ }
401
+ return 1;
402
+ }
764
403
 
765
- // ../../node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js
766
- var require_supports_color = __commonJS({
767
- "../../node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js"(exports2, module2) {
768
- "use strict";
769
- var os = require("os");
770
- var tty = require("tty");
771
- var hasFlag = require_has_flag();
772
- var { env } = process;
773
- var forceColor;
774
- if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
775
- forceColor = 0;
776
- } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
777
- forceColor = 1;
778
- }
779
- if ("FORCE_COLOR" in env) {
780
- if (env.FORCE_COLOR === "true") {
781
- forceColor = 1;
782
- } else if (env.FORCE_COLOR === "false") {
783
- forceColor = 0;
784
- } else {
785
- forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);
786
- }
404
+ // ../../node_modules/.pnpm/emoji-regex@10.5.0/node_modules/emoji-regex/index.mjs
405
+ var emoji_regex_default = () => {
406
+ return /[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;
407
+ };
408
+
409
+ // ../../node_modules/.pnpm/string-width@7.2.0/node_modules/string-width/index.js
410
+ var segmenter = new Intl.Segmenter();
411
+ var defaultIgnorableCodePointRegex = /^\p{Default_Ignorable_Code_Point}$/u;
412
+ function stringWidth(string, options = {}) {
413
+ if (typeof string !== "string" || string.length === 0) {
414
+ return 0;
415
+ }
416
+ const {
417
+ ambiguousIsNarrow = true,
418
+ countAnsiEscapeCodes = false
419
+ } = options;
420
+ if (!countAnsiEscapeCodes) {
421
+ string = stripAnsi(string);
422
+ }
423
+ if (string.length === 0) {
424
+ return 0;
425
+ }
426
+ let width = 0;
427
+ const eastAsianWidthOptions = { ambiguousAsWide: !ambiguousIsNarrow };
428
+ for (const { segment: character } of segmenter.segment(string)) {
429
+ const codePoint = character.codePointAt(0);
430
+ if (codePoint <= 31 || codePoint >= 127 && codePoint <= 159) {
431
+ continue;
787
432
  }
788
- function translateLevel(level) {
789
- if (level === 0) {
790
- return false;
791
- }
792
- return {
793
- level,
794
- hasBasic: true,
795
- has256: level >= 2,
796
- has16m: level >= 3
797
- };
433
+ if (codePoint >= 8203 && codePoint <= 8207 || codePoint === 65279) {
434
+ continue;
798
435
  }
799
- function supportsColor(haveStream, streamIsTTY) {
800
- if (forceColor === 0) {
801
- return 0;
802
- }
803
- if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
804
- return 3;
805
- }
806
- if (hasFlag("color=256")) {
807
- return 2;
808
- }
809
- if (haveStream && !streamIsTTY && forceColor === void 0) {
810
- return 0;
811
- }
812
- const min = forceColor || 0;
813
- if (env.TERM === "dumb") {
814
- return min;
815
- }
816
- if (process.platform === "win32") {
817
- const osRelease = os.release().split(".");
818
- if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
819
- return Number(osRelease[2]) >= 14931 ? 3 : 2;
820
- }
821
- return 1;
822
- }
823
- if ("CI" in env) {
824
- if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
825
- return 1;
826
- }
827
- return min;
828
- }
829
- if ("TEAMCITY_VERSION" in env) {
830
- return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
831
- }
832
- if (env.COLORTERM === "truecolor") {
833
- return 3;
834
- }
835
- if ("TERM_PROGRAM" in env) {
836
- const version = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
837
- switch (env.TERM_PROGRAM) {
838
- case "iTerm.app":
839
- return version >= 3 ? 3 : 2;
840
- case "Apple_Terminal":
841
- return 2;
842
- }
843
- }
844
- if (/-256(color)?$/i.test(env.TERM)) {
845
- return 2;
846
- }
847
- if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
848
- return 1;
849
- }
850
- if ("COLORTERM" in env) {
851
- return 1;
852
- }
853
- return min;
436
+ if (codePoint >= 768 && codePoint <= 879 || codePoint >= 6832 && codePoint <= 6911 || codePoint >= 7616 && codePoint <= 7679 || codePoint >= 8400 && codePoint <= 8447 || codePoint >= 65056 && codePoint <= 65071) {
437
+ continue;
854
438
  }
855
- function getSupportLevel(stream) {
856
- const level = supportsColor(stream, stream && stream.isTTY);
857
- return translateLevel(level);
439
+ if (codePoint >= 55296 && codePoint <= 57343) {
440
+ continue;
858
441
  }
859
- module2.exports = {
860
- supportsColor: getSupportLevel,
861
- stdout: translateLevel(supportsColor(true, tty.isatty(1))),
862
- stderr: translateLevel(supportsColor(true, tty.isatty(2)))
863
- };
864
- }
865
- });
866
-
867
- // ../../node_modules/.pnpm/debug@4.4.1/node_modules/debug/src/node.js
868
- var require_node = __commonJS({
869
- "../../node_modules/.pnpm/debug@4.4.1/node_modules/debug/src/node.js"(exports2, module2) {
870
- "use strict";
871
- var tty = require("tty");
872
- var util = require("util");
873
- exports2.init = init;
874
- exports2.log = log;
875
- exports2.formatArgs = formatArgs;
876
- exports2.save = save;
877
- exports2.load = load;
878
- exports2.useColors = useColors;
879
- exports2.destroy = util.deprecate(
880
- () => {
881
- },
882
- "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."
883
- );
884
- exports2.colors = [6, 2, 3, 4, 5, 1];
885
- try {
886
- const supportsColor = require_supports_color();
887
- if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
888
- exports2.colors = [
889
- 20,
890
- 21,
891
- 26,
892
- 27,
893
- 32,
894
- 33,
895
- 38,
896
- 39,
897
- 40,
898
- 41,
899
- 42,
900
- 43,
901
- 44,
902
- 45,
903
- 56,
904
- 57,
905
- 62,
906
- 63,
907
- 68,
908
- 69,
909
- 74,
910
- 75,
911
- 76,
912
- 77,
913
- 78,
914
- 79,
915
- 80,
916
- 81,
917
- 92,
918
- 93,
919
- 98,
920
- 99,
921
- 112,
922
- 113,
923
- 128,
924
- 129,
925
- 134,
926
- 135,
927
- 148,
928
- 149,
929
- 160,
930
- 161,
931
- 162,
932
- 163,
933
- 164,
934
- 165,
935
- 166,
936
- 167,
937
- 168,
938
- 169,
939
- 170,
940
- 171,
941
- 172,
942
- 173,
943
- 178,
944
- 179,
945
- 184,
946
- 185,
947
- 196,
948
- 197,
949
- 198,
950
- 199,
951
- 200,
952
- 201,
953
- 202,
954
- 203,
955
- 204,
956
- 205,
957
- 206,
958
- 207,
959
- 208,
960
- 209,
961
- 214,
962
- 215,
963
- 220,
964
- 221
965
- ];
966
- }
967
- } catch (error) {
442
+ if (codePoint >= 65024 && codePoint <= 65039) {
443
+ continue;
968
444
  }
969
- exports2.inspectOpts = Object.keys(process.env).filter((key) => {
970
- return /^debug_/i.test(key);
971
- }).reduce((obj, key) => {
972
- const prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (_, k) => {
973
- return k.toUpperCase();
974
- });
975
- let val = process.env[key];
976
- if (/^(yes|on|true|enabled)$/i.test(val)) {
977
- val = true;
978
- } else if (/^(no|off|false|disabled)$/i.test(val)) {
979
- val = false;
980
- } else if (val === "null") {
981
- val = null;
982
- } else {
983
- val = Number(val);
984
- }
985
- obj[prop] = val;
986
- return obj;
987
- }, {});
988
- function useColors() {
989
- return "colors" in exports2.inspectOpts ? Boolean(exports2.inspectOpts.colors) : tty.isatty(process.stderr.fd);
990
- }
991
- function formatArgs(args) {
992
- const { namespace: name, useColors: useColors2 } = this;
993
- if (useColors2) {
994
- const c = this.color;
995
- const colorCode = "\x1B[3" + (c < 8 ? c : "8;5;" + c);
996
- const prefix = ` ${colorCode};1m${name} \x1B[0m`;
997
- args[0] = prefix + args[0].split("\n").join("\n" + prefix);
998
- args.push(colorCode + "m+" + module2.exports.humanize(this.diff) + "\x1B[0m");
999
- } else {
1000
- args[0] = getDate() + name + " " + args[0];
1001
- }
1002
- }
1003
- function getDate() {
1004
- if (exports2.inspectOpts.hideDate) {
1005
- return "";
1006
- }
1007
- return (/* @__PURE__ */ new Date()).toISOString() + " ";
1008
- }
1009
- function log(...args) {
1010
- return process.stderr.write(util.formatWithOptions(exports2.inspectOpts, ...args) + "\n");
1011
- }
1012
- function save(namespaces) {
1013
- if (namespaces) {
1014
- process.env.DEBUG = namespaces;
1015
- } else {
1016
- delete process.env.DEBUG;
1017
- }
1018
- }
1019
- function load() {
1020
- return process.env.DEBUG;
445
+ if (defaultIgnorableCodePointRegex.test(character)) {
446
+ continue;
1021
447
  }
1022
- function init(debug) {
1023
- debug.inspectOpts = {};
1024
- const keys = Object.keys(exports2.inspectOpts);
1025
- for (let i = 0; i < keys.length; i++) {
1026
- debug.inspectOpts[keys[i]] = exports2.inspectOpts[keys[i]];
1027
- }
448
+ if (emoji_regex_default().test(character)) {
449
+ width += 2;
450
+ continue;
1028
451
  }
1029
- module2.exports = require_common()(exports2);
1030
- var { formatters } = module2.exports;
1031
- formatters.o = function(v) {
1032
- this.inspectOpts.colors = this.useColors;
1033
- return util.inspect(v, this.inspectOpts).split("\n").map((str) => str.trim()).join(" ");
1034
- };
1035
- formatters.O = function(v) {
1036
- this.inspectOpts.colors = this.useColors;
1037
- return util.inspect(v, this.inspectOpts);
1038
- };
452
+ width += eastAsianWidth(codePoint, eastAsianWidthOptions);
1039
453
  }
1040
- });
454
+ return width;
455
+ }
1041
456
 
1042
- // ../../node_modules/.pnpm/debug@4.4.1/node_modules/debug/src/index.js
1043
- var require_src = __commonJS({
1044
- "../../node_modules/.pnpm/debug@4.4.1/node_modules/debug/src/index.js"(exports2, module2) {
1045
- "use strict";
1046
- if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) {
1047
- module2.exports = require_browser();
1048
- } else {
1049
- module2.exports = require_node();
1050
- }
1051
- }
1052
- });
457
+ // ../../node_modules/.pnpm/boxen@8.0.1/node_modules/boxen/index.js
458
+ var import_chalk = __toESM(require("chalk"), 1);
1053
459
 
1054
- // ../../node_modules/.pnpm/agent-base@7.1.4/node_modules/agent-base/dist/helpers.js
1055
- var require_helpers = __commonJS({
1056
- "../../node_modules/.pnpm/agent-base@7.1.4/node_modules/agent-base/dist/helpers.js"(exports2) {
1057
- "use strict";
1058
- var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
1059
- if (k2 === void 0) k2 = k;
1060
- var desc = Object.getOwnPropertyDescriptor(m, k);
1061
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
1062
- desc = { enumerable: true, get: function() {
1063
- return m[k];
1064
- } };
1065
- }
1066
- Object.defineProperty(o, k2, desc);
1067
- } : function(o, m, k, k2) {
1068
- if (k2 === void 0) k2 = k;
1069
- o[k2] = m[k];
1070
- });
1071
- var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? function(o, v) {
1072
- Object.defineProperty(o, "default", { enumerable: true, value: v });
1073
- } : function(o, v) {
1074
- o["default"] = v;
1075
- });
1076
- var __importStar = exports2 && exports2.__importStar || function(mod) {
1077
- if (mod && mod.__esModule) return mod;
1078
- var result = {};
1079
- if (mod != null) {
1080
- for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
1081
- }
1082
- __setModuleDefault(result, mod);
1083
- return result;
1084
- };
1085
- Object.defineProperty(exports2, "__esModule", { value: true });
1086
- exports2.req = exports2.json = exports2.toBuffer = void 0;
1087
- var http = __importStar(require("http"));
1088
- var https = __importStar(require("https"));
1089
- async function toBuffer(stream) {
1090
- let length = 0;
1091
- const chunks = [];
1092
- for await (const chunk of stream) {
1093
- length += chunk.length;
1094
- chunks.push(chunk);
1095
- }
1096
- return Buffer.concat(chunks, length);
1097
- }
1098
- exports2.toBuffer = toBuffer;
1099
- async function json(stream) {
1100
- const buf = await toBuffer(stream);
1101
- const str = buf.toString("utf8");
1102
- try {
1103
- return JSON.parse(str);
1104
- } catch (_err) {
1105
- const err = _err;
1106
- err.message += ` (input: ${str})`;
1107
- throw err;
1108
- }
1109
- }
1110
- exports2.json = json;
1111
- function req(url, opts = {}) {
1112
- const href = typeof url === "string" ? url : url.href;
1113
- const req2 = (href.startsWith("https:") ? https : http).request(url, opts);
1114
- const promise = new Promise((resolve, reject) => {
1115
- req2.once("response", resolve).once("error", reject).end();
1116
- });
1117
- req2.then = promise.then.bind(promise);
1118
- return req2;
1119
- }
1120
- exports2.req = req;
460
+ // ../../node_modules/.pnpm/widest-line@5.0.0/node_modules/widest-line/index.js
461
+ function widestLine(string) {
462
+ let lineWidth = 0;
463
+ for (const line of string.split("\n")) {
464
+ lineWidth = Math.max(lineWidth, stringWidth(line));
1121
465
  }
1122
- });
466
+ return lineWidth;
467
+ }
1123
468
 
1124
- // ../../node_modules/.pnpm/agent-base@7.1.4/node_modules/agent-base/dist/index.js
1125
- var require_dist = __commonJS({
1126
- "../../node_modules/.pnpm/agent-base@7.1.4/node_modules/agent-base/dist/index.js"(exports2) {
1127
- "use strict";
1128
- var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
1129
- if (k2 === void 0) k2 = k;
1130
- var desc = Object.getOwnPropertyDescriptor(m, k);
1131
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
1132
- desc = { enumerable: true, get: function() {
1133
- return m[k];
1134
- } };
1135
- }
1136
- Object.defineProperty(o, k2, desc);
1137
- } : function(o, m, k, k2) {
1138
- if (k2 === void 0) k2 = k;
1139
- o[k2] = m[k];
1140
- });
1141
- var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? function(o, v) {
1142
- Object.defineProperty(o, "default", { enumerable: true, value: v });
1143
- } : function(o, v) {
1144
- o["default"] = v;
1145
- });
1146
- var __importStar = exports2 && exports2.__importStar || function(mod) {
1147
- if (mod && mod.__esModule) return mod;
1148
- var result = {};
1149
- if (mod != null) {
1150
- for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
1151
- }
1152
- __setModuleDefault(result, mod);
1153
- return result;
1154
- };
1155
- var __exportStar = exports2 && exports2.__exportStar || function(m, exports3) {
1156
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding(exports3, m, p);
1157
- };
1158
- Object.defineProperty(exports2, "__esModule", { value: true });
1159
- exports2.Agent = void 0;
1160
- var net = __importStar(require("net"));
1161
- var http = __importStar(require("http"));
1162
- var https_1 = require("https");
1163
- __exportStar(require_helpers(), exports2);
1164
- var INTERNAL = Symbol("AgentBaseInternalState");
1165
- var Agent = class extends http.Agent {
1166
- constructor(opts) {
1167
- super(opts);
1168
- this[INTERNAL] = {};
1169
- }
1170
- /**
1171
- * Determine whether this is an `http` or `https` request.
1172
- */
1173
- isSecureEndpoint(options) {
1174
- if (options) {
1175
- if (typeof options.secureEndpoint === "boolean") {
1176
- return options.secureEndpoint;
1177
- }
1178
- if (typeof options.protocol === "string") {
1179
- return options.protocol === "https:";
1180
- }
1181
- }
1182
- const { stack } = new Error();
1183
- if (typeof stack !== "string")
1184
- return false;
1185
- return stack.split("\n").some((l) => l.indexOf("(https.js:") !== -1 || l.indexOf("node:https:") !== -1);
1186
- }
1187
- // In order to support async signatures in `connect()` and Node's native
1188
- // connection pooling in `http.Agent`, the array of sockets for each origin
1189
- // has to be updated synchronously. This is so the length of the array is
1190
- // accurate when `addRequest()` is next called. We achieve this by creating a
1191
- // fake socket and adding it to `sockets[origin]` and incrementing
1192
- // `totalSocketCount`.
1193
- incrementSockets(name) {
1194
- if (this.maxSockets === Infinity && this.maxTotalSockets === Infinity) {
1195
- return null;
1196
- }
1197
- if (!this.sockets[name]) {
1198
- this.sockets[name] = [];
1199
- }
1200
- const fakeSocket = new net.Socket({ writable: false });
1201
- this.sockets[name].push(fakeSocket);
1202
- this.totalSocketCount++;
1203
- return fakeSocket;
1204
- }
1205
- decrementSockets(name, socket) {
1206
- if (!this.sockets[name] || socket === null) {
1207
- return;
1208
- }
1209
- const sockets = this.sockets[name];
1210
- const index = sockets.indexOf(socket);
1211
- if (index !== -1) {
1212
- sockets.splice(index, 1);
1213
- this.totalSocketCount--;
1214
- if (sockets.length === 0) {
1215
- delete this.sockets[name];
1216
- }
1217
- }
1218
- }
1219
- // In order to properly update the socket pool, we need to call `getName()` on
1220
- // the core `https.Agent` if it is a secureEndpoint.
1221
- getName(options) {
1222
- const secureEndpoint = this.isSecureEndpoint(options);
1223
- if (secureEndpoint) {
1224
- return https_1.Agent.prototype.getName.call(this, options);
1225
- }
1226
- return super.getName(options);
1227
- }
1228
- createSocket(req, options, cb) {
1229
- const connectOpts = {
1230
- ...options,
1231
- secureEndpoint: this.isSecureEndpoint(options)
1232
- };
1233
- const name = this.getName(connectOpts);
1234
- const fakeSocket = this.incrementSockets(name);
1235
- Promise.resolve().then(() => this.connect(req, connectOpts)).then((socket) => {
1236
- this.decrementSockets(name, fakeSocket);
1237
- if (socket instanceof http.Agent) {
1238
- try {
1239
- return socket.addRequest(req, connectOpts);
1240
- } catch (err) {
1241
- return cb(err);
1242
- }
1243
- }
1244
- this[INTERNAL].currentSocket = socket;
1245
- super.createSocket(req, options, cb);
1246
- }, (err) => {
1247
- this.decrementSockets(name, fakeSocket);
1248
- cb(err);
1249
- });
1250
- }
1251
- createConnection() {
1252
- const socket = this[INTERNAL].currentSocket;
1253
- this[INTERNAL].currentSocket = void 0;
1254
- if (!socket) {
1255
- throw new Error("No socket was returned in the `connect()` function");
1256
- }
1257
- return socket;
1258
- }
1259
- get defaultPort() {
1260
- return this[INTERNAL].defaultPort ?? (this.protocol === "https:" ? 443 : 80);
1261
- }
1262
- set defaultPort(v) {
1263
- if (this[INTERNAL]) {
1264
- this[INTERNAL].defaultPort = v;
1265
- }
1266
- }
1267
- get protocol() {
1268
- return this[INTERNAL].protocol ?? (this.isSecureEndpoint() ? "https:" : "http:");
1269
- }
1270
- set protocol(v) {
1271
- if (this[INTERNAL]) {
1272
- this[INTERNAL].protocol = v;
1273
- }
1274
- }
1275
- };
1276
- exports2.Agent = Agent;
1277
- }
1278
- });
469
+ // ../../node_modules/.pnpm/boxen@8.0.1/node_modules/boxen/index.js
470
+ var import_cli_boxes = __toESM(require_cli_boxes(), 1);
1279
471
 
1280
- // ../../node_modules/.pnpm/https-proxy-agent@7.0.6/node_modules/https-proxy-agent/dist/parse-proxy-response.js
1281
- var require_parse_proxy_response = __commonJS({
1282
- "../../node_modules/.pnpm/https-proxy-agent@7.0.6/node_modules/https-proxy-agent/dist/parse-proxy-response.js"(exports2) {
1283
- "use strict";
1284
- var __importDefault = exports2 && exports2.__importDefault || function(mod) {
1285
- return mod && mod.__esModule ? mod : { "default": mod };
1286
- };
1287
- Object.defineProperty(exports2, "__esModule", { value: true });
1288
- exports2.parseProxyResponse = void 0;
1289
- var debug_1 = __importDefault(require_src());
1290
- var debug = (0, debug_1.default)("https-proxy-agent:parse-proxy-response");
1291
- function parseProxyResponse(socket) {
1292
- return new Promise((resolve, reject) => {
1293
- let buffersLength = 0;
1294
- const buffers = [];
1295
- function read() {
1296
- const b = socket.read();
1297
- if (b)
1298
- ondata(b);
1299
- else
1300
- socket.once("readable", read);
1301
- }
1302
- function cleanup() {
1303
- socket.removeListener("end", onend);
1304
- socket.removeListener("error", onerror);
1305
- socket.removeListener("readable", read);
1306
- }
1307
- function onend() {
1308
- cleanup();
1309
- debug("onend");
1310
- reject(new Error("Proxy connection ended before receiving CONNECT response"));
1311
- }
1312
- function onerror(err) {
1313
- cleanup();
1314
- debug("onerror %o", err);
1315
- reject(err);
1316
- }
1317
- function ondata(b) {
1318
- buffers.push(b);
1319
- buffersLength += b.length;
1320
- const buffered = Buffer.concat(buffers, buffersLength);
1321
- const endOfHeaders = buffered.indexOf("\r\n\r\n");
1322
- if (endOfHeaders === -1) {
1323
- debug("have not received end of HTTP headers yet...");
1324
- read();
1325
- return;
1326
- }
1327
- const headerParts = buffered.slice(0, endOfHeaders).toString("ascii").split("\r\n");
1328
- const firstLine = headerParts.shift();
1329
- if (!firstLine) {
1330
- socket.destroy();
1331
- return reject(new Error("No header received from proxy CONNECT response"));
1332
- }
1333
- const firstLineParts = firstLine.split(" ");
1334
- const statusCode = +firstLineParts[1];
1335
- const statusText = firstLineParts.slice(2).join(" ");
1336
- const headers = {};
1337
- for (const header of headerParts) {
1338
- if (!header)
1339
- continue;
1340
- const firstColon = header.indexOf(":");
1341
- if (firstColon === -1) {
1342
- socket.destroy();
1343
- return reject(new Error(`Invalid header from proxy CONNECT response: "${header}"`));
1344
- }
1345
- const key = header.slice(0, firstColon).toLowerCase();
1346
- const value = header.slice(firstColon + 1).trimStart();
1347
- const current = headers[key];
1348
- if (typeof current === "string") {
1349
- headers[key] = [current, value];
1350
- } else if (Array.isArray(current)) {
1351
- current.push(value);
1352
- } else {
1353
- headers[key] = value;
1354
- }
1355
- }
1356
- debug("got proxy server response: %o %o", firstLine, headers);
1357
- cleanup();
1358
- resolve({
1359
- connect: {
1360
- statusCode,
1361
- statusText,
1362
- headers
1363
- },
1364
- buffered
1365
- });
1366
- }
1367
- socket.on("error", onerror);
1368
- socket.on("end", onend);
1369
- read();
1370
- });
472
+ // ../../node_modules/.pnpm/camelcase@8.0.0/node_modules/camelcase/index.js
473
+ var UPPERCASE = /[\p{Lu}]/u;
474
+ var LOWERCASE = /[\p{Ll}]/u;
475
+ var LEADING_CAPITAL = /^[\p{Lu}](?![\p{Lu}])/gu;
476
+ var IDENTIFIER = /([\p{Alpha}\p{N}_]|$)/u;
477
+ var SEPARATORS = /[_.\- ]+/;
478
+ var LEADING_SEPARATORS = new RegExp("^" + SEPARATORS.source);
479
+ var SEPARATORS_AND_IDENTIFIER = new RegExp(SEPARATORS.source + IDENTIFIER.source, "gu");
480
+ var NUMBERS_AND_IDENTIFIER = new RegExp("\\d+" + IDENTIFIER.source, "gu");
481
+ var preserveCamelCase = (string, toLowerCase, toUpperCase, preserveConsecutiveUppercase2) => {
482
+ let isLastCharLower = false;
483
+ let isLastCharUpper = false;
484
+ let isLastLastCharUpper = false;
485
+ let isLastLastCharPreserved = false;
486
+ for (let index = 0; index < string.length; index++) {
487
+ const character = string[index];
488
+ isLastLastCharPreserved = index > 2 ? string[index - 3] === "-" : true;
489
+ if (isLastCharLower && UPPERCASE.test(character)) {
490
+ string = string.slice(0, index) + "-" + string.slice(index);
491
+ isLastCharLower = false;
492
+ isLastLastCharUpper = isLastCharUpper;
493
+ isLastCharUpper = true;
494
+ index++;
495
+ } else if (isLastCharUpper && isLastLastCharUpper && LOWERCASE.test(character) && (!isLastLastCharPreserved || preserveConsecutiveUppercase2)) {
496
+ string = string.slice(0, index - 1) + "-" + string.slice(index - 1);
497
+ isLastLastCharUpper = isLastCharUpper;
498
+ isLastCharUpper = false;
499
+ isLastCharLower = true;
500
+ } else {
501
+ isLastCharLower = toLowerCase(character) === character && toUpperCase(character) !== character;
502
+ isLastLastCharUpper = isLastCharUpper;
503
+ isLastCharUpper = toUpperCase(character) === character && toLowerCase(character) !== character;
1371
504
  }
1372
- exports2.parseProxyResponse = parseProxyResponse;
1373
505
  }
1374
- });
1375
-
1376
- // ../../node_modules/.pnpm/https-proxy-agent@7.0.6/node_modules/https-proxy-agent/dist/index.js
1377
- var require_dist2 = __commonJS({
1378
- "../../node_modules/.pnpm/https-proxy-agent@7.0.6/node_modules/https-proxy-agent/dist/index.js"(exports2) {
1379
- "use strict";
1380
- var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
1381
- if (k2 === void 0) k2 = k;
1382
- var desc = Object.getOwnPropertyDescriptor(m, k);
1383
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
1384
- desc = { enumerable: true, get: function() {
1385
- return m[k];
1386
- } };
1387
- }
1388
- Object.defineProperty(o, k2, desc);
1389
- } : function(o, m, k, k2) {
1390
- if (k2 === void 0) k2 = k;
1391
- o[k2] = m[k];
1392
- });
1393
- var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? function(o, v) {
1394
- Object.defineProperty(o, "default", { enumerable: true, value: v });
1395
- } : function(o, v) {
1396
- o["default"] = v;
1397
- });
1398
- var __importStar = exports2 && exports2.__importStar || function(mod) {
1399
- if (mod && mod.__esModule) return mod;
1400
- var result = {};
1401
- if (mod != null) {
1402
- for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
1403
- }
1404
- __setModuleDefault(result, mod);
1405
- return result;
1406
- };
1407
- var __importDefault = exports2 && exports2.__importDefault || function(mod) {
1408
- return mod && mod.__esModule ? mod : { "default": mod };
1409
- };
1410
- Object.defineProperty(exports2, "__esModule", { value: true });
1411
- exports2.HttpsProxyAgent = void 0;
1412
- var net = __importStar(require("net"));
1413
- var tls = __importStar(require("tls"));
1414
- var assert_1 = __importDefault(require("assert"));
1415
- var debug_1 = __importDefault(require_src());
1416
- var agent_base_1 = require_dist();
1417
- var url_1 = require("url");
1418
- var parse_proxy_response_1 = require_parse_proxy_response();
1419
- var debug = (0, debug_1.default)("https-proxy-agent");
1420
- var setServernameFromNonIpHost = (options) => {
1421
- if (options.servername === void 0 && options.host && !net.isIP(options.host)) {
1422
- return {
1423
- ...options,
1424
- servername: options.host
1425
- };
1426
- }
1427
- return options;
1428
- };
1429
- var HttpsProxyAgent2 = class extends agent_base_1.Agent {
1430
- constructor(proxy, opts) {
1431
- super(opts);
1432
- this.options = { path: void 0 };
1433
- this.proxy = typeof proxy === "string" ? new url_1.URL(proxy) : proxy;
1434
- this.proxyHeaders = opts?.headers ?? {};
1435
- debug("Creating new HttpsProxyAgent instance: %o", this.proxy.href);
1436
- const host = (this.proxy.hostname || this.proxy.host).replace(/^\[|\]$/g, "");
1437
- const port = this.proxy.port ? parseInt(this.proxy.port, 10) : this.proxy.protocol === "https:" ? 443 : 80;
1438
- this.connectOpts = {
1439
- // Attempt to negotiate http/1.1 for proxy servers that support http/2
1440
- ALPNProtocols: ["http/1.1"],
1441
- ...opts ? omit(opts, "headers") : null,
1442
- host,
1443
- port
1444
- };
1445
- }
1446
- /**
1447
- * Called when the node-core HTTP client library is creating a
1448
- * new HTTP request.
1449
- */
1450
- async connect(req, opts) {
1451
- const { proxy } = this;
1452
- if (!opts.host) {
1453
- throw new TypeError('No "host" provided');
1454
- }
1455
- let socket;
1456
- if (proxy.protocol === "https:") {
1457
- debug("Creating `tls.Socket`: %o", this.connectOpts);
1458
- socket = tls.connect(setServernameFromNonIpHost(this.connectOpts));
1459
- } else {
1460
- debug("Creating `net.Socket`: %o", this.connectOpts);
1461
- socket = net.connect(this.connectOpts);
1462
- }
1463
- const headers = typeof this.proxyHeaders === "function" ? this.proxyHeaders() : { ...this.proxyHeaders };
1464
- const host = net.isIPv6(opts.host) ? `[${opts.host}]` : opts.host;
1465
- let payload = `CONNECT ${host}:${opts.port} HTTP/1.1\r
1466
- `;
1467
- if (proxy.username || proxy.password) {
1468
- const auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`;
1469
- headers["Proxy-Authorization"] = `Basic ${Buffer.from(auth).toString("base64")}`;
1470
- }
1471
- headers.Host = `${host}:${opts.port}`;
1472
- if (!headers["Proxy-Connection"]) {
1473
- headers["Proxy-Connection"] = this.keepAlive ? "Keep-Alive" : "close";
1474
- }
1475
- for (const name of Object.keys(headers)) {
1476
- payload += `${name}: ${headers[name]}\r
1477
- `;
1478
- }
1479
- const proxyResponsePromise = (0, parse_proxy_response_1.parseProxyResponse)(socket);
1480
- socket.write(`${payload}\r
1481
- `);
1482
- const { connect, buffered } = await proxyResponsePromise;
1483
- req.emit("proxyConnect", connect);
1484
- this.emit("proxyConnect", connect, req);
1485
- if (connect.statusCode === 200) {
1486
- req.once("socket", resume);
1487
- if (opts.secureEndpoint) {
1488
- debug("Upgrading socket connection to TLS");
1489
- return tls.connect({
1490
- ...omit(setServernameFromNonIpHost(opts), "host", "path", "port"),
1491
- socket
1492
- });
1493
- }
1494
- return socket;
1495
- }
1496
- socket.destroy();
1497
- const fakeSocket = new net.Socket({ writable: false });
1498
- fakeSocket.readable = true;
1499
- req.once("socket", (s) => {
1500
- debug("Replaying proxy buffer for failed request");
1501
- (0, assert_1.default)(s.listenerCount("data") > 0);
1502
- s.push(buffered);
1503
- s.push(null);
1504
- });
1505
- return fakeSocket;
1506
- }
1507
- };
1508
- HttpsProxyAgent2.protocols = ["http", "https"];
1509
- exports2.HttpsProxyAgent = HttpsProxyAgent2;
1510
- function resume(socket) {
1511
- socket.resume();
1512
- }
1513
- function omit(obj, ...keys) {
1514
- const ret = {};
1515
- let key;
1516
- for (key in obj) {
1517
- if (!keys.includes(key)) {
1518
- ret[key] = obj[key];
1519
- }
1520
- }
1521
- return ret;
506
+ return string;
507
+ };
508
+ var preserveConsecutiveUppercase = (input, toLowerCase) => {
509
+ LEADING_CAPITAL.lastIndex = 0;
510
+ return input.replaceAll(LEADING_CAPITAL, (match) => toLowerCase(match));
511
+ };
512
+ var postProcess = (input, toUpperCase) => {
513
+ SEPARATORS_AND_IDENTIFIER.lastIndex = 0;
514
+ NUMBERS_AND_IDENTIFIER.lastIndex = 0;
515
+ return input.replaceAll(NUMBERS_AND_IDENTIFIER, (match, pattern, offset) => ["_", "-"].includes(input.charAt(offset + match.length)) ? match : toUpperCase(match)).replaceAll(SEPARATORS_AND_IDENTIFIER, (_, identifier) => toUpperCase(identifier));
516
+ };
517
+ function camelCase(input, options) {
518
+ if (!(typeof input === "string" || Array.isArray(input))) {
519
+ throw new TypeError("Expected the input to be `string | string[]`");
520
+ }
521
+ options = {
522
+ pascalCase: false,
523
+ preserveConsecutiveUppercase: false,
524
+ ...options
525
+ };
526
+ if (Array.isArray(input)) {
527
+ input = input.map((x) => x.trim()).filter((x) => x.length).join("-");
528
+ } else {
529
+ input = input.trim();
530
+ }
531
+ if (input.length === 0) {
532
+ return "";
533
+ }
534
+ const toLowerCase = options.locale === false ? (string) => string.toLowerCase() : (string) => string.toLocaleLowerCase(options.locale);
535
+ const toUpperCase = options.locale === false ? (string) => string.toUpperCase() : (string) => string.toLocaleUpperCase(options.locale);
536
+ if (input.length === 1) {
537
+ if (SEPARATORS.test(input)) {
538
+ return "";
1522
539
  }
540
+ return options.pascalCase ? toUpperCase(input) : toLowerCase(input);
1523
541
  }
1524
- });
542
+ const hasUpperCase = input !== toLowerCase(input);
543
+ if (hasUpperCase) {
544
+ input = preserveCamelCase(input, toLowerCase, toUpperCase, options.preserveConsecutiveUppercase);
545
+ }
546
+ input = input.replace(LEADING_SEPARATORS, "");
547
+ input = options.preserveConsecutiveUppercase ? preserveConsecutiveUppercase(input, toLowerCase) : toLowerCase(input);
548
+ if (options.pascalCase) {
549
+ input = toUpperCase(input.charAt(0)) + input.slice(1);
550
+ }
551
+ return postProcess(input, toUpperCase);
552
+ }
1525
553
 
1526
- // src/index.ts
1527
- var index_exports = {};
1528
- __export(index_exports, {
1529
- default: () => index_default
1530
- });
1531
- module.exports = __toCommonJS(index_exports);
1532
- var import_parser = require("@asyncapi/parser");
1533
- var import_sdk = __toESM(require("@eventcatalog/sdk"));
1534
- var import_promises = require("fs/promises");
1535
- var import_minimist = __toESM(require("minimist"));
1536
- var import_js_yaml = __toESM(require("js-yaml"));
1537
- var import_zod = require("zod");
1538
- var import_chalk3 = __toESM(require("chalk"));
1539
- var import_path2 = __toESM(require("path"));
554
+ // ../../node_modules/.pnpm/boxen@8.0.1/node_modules/boxen/index.js
555
+ var import_ansi_align = __toESM(require_ansi_align(), 1);
1540
556
 
1541
- // package.json
1542
- var package_default = {
1543
- name: "@eventcatalog/generator-asyncapi",
1544
- version: "4.4.0",
1545
- description: "AsyncAPI generator for EventCatalog",
1546
- scripts: {
1547
- build: "tsup",
1548
- test: "vitest",
1549
- format: "prettier --write .",
1550
- "format:diff": "prettier --list-different .",
1551
- changeset: "changeset",
1552
- release: "changeset publish"
1553
- },
1554
- publishConfig: {
1555
- access: "public"
1556
- },
1557
- keywords: [],
1558
- author: "",
1559
- license: "ISC",
1560
- devDependencies: {
1561
- "@changesets/cli": "^2.27.9",
1562
- "@types/fs-extra": "^11.0.4",
1563
- "@types/js-yaml": "^4.0.9",
1564
- "@types/lodash": "^4.17.7",
1565
- "@types/minimist": "^1.2.5",
1566
- "@types/node": "^20.16.1",
1567
- prettier: "^3.3.3",
1568
- tsup: "^8.1.0",
1569
- typescript: "^5.5.3",
1570
- vitest: "^2.0.2"
1571
- },
1572
- files: [
1573
- "dist",
1574
- "package.json"
1575
- ],
1576
- main: "./dist/index.js",
1577
- module: "./dist/index.mjs",
1578
- types: "./dist/index.d.ts",
1579
- dependencies: {
1580
- "@asyncapi/avro-schema-parser": "^3.0.24",
1581
- "@asyncapi/parser": "^3.3.0",
1582
- "@eventcatalog/sdk": "^2.6.9",
1583
- chalk: "^4",
1584
- "fs-extra": "^11.2.0",
1585
- glob: "^11.0.0",
1586
- "gray-matter": "^4.0.3",
1587
- "js-yaml": "^4.1.0",
1588
- lodash: "^4.17.21",
1589
- minimist: "^1.2.8",
1590
- "node-fetch": "^3.3.2",
1591
- slugify: "^1.6.6",
1592
- "update-notifier": "^7.3.1",
1593
- zod: "^3.23.8"
1594
- }
1595
- };
1596
-
1597
- // ../../node_modules/.pnpm/boxen@8.0.1/node_modules/boxen/index.js
1598
- var import_node_process = __toESM(require("process"), 1);
1599
-
1600
- // ../../node_modules/.pnpm/ansi-regex@6.1.0/node_modules/ansi-regex/index.js
1601
- function ansiRegex({ onlyFirst = false } = {}) {
1602
- const ST = "(?:\\u0007|\\u001B\\u005C|\\u009C)";
1603
- const pattern = [
1604
- `[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?${ST})`,
1605
- "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"
1606
- ].join("|");
1607
- return new RegExp(pattern, onlyFirst ? void 0 : "g");
1608
- }
1609
-
1610
- // ../../node_modules/.pnpm/strip-ansi@7.1.0/node_modules/strip-ansi/index.js
1611
- var regex = ansiRegex();
1612
- function stripAnsi(string) {
1613
- if (typeof string !== "string") {
1614
- throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
1615
- }
1616
- return string.replace(regex, "");
1617
- }
1618
-
1619
- // ../../node_modules/.pnpm/get-east-asian-width@1.3.0/node_modules/get-east-asian-width/lookup.js
1620
- function isAmbiguous(x) {
1621
- return x === 161 || x === 164 || x === 167 || x === 168 || x === 170 || x === 173 || x === 174 || x >= 176 && x <= 180 || x >= 182 && x <= 186 || x >= 188 && x <= 191 || x === 198 || x === 208 || x === 215 || x === 216 || x >= 222 && x <= 225 || x === 230 || x >= 232 && x <= 234 || x === 236 || x === 237 || x === 240 || x === 242 || x === 243 || x >= 247 && x <= 250 || x === 252 || x === 254 || x === 257 || x === 273 || x === 275 || x === 283 || x === 294 || x === 295 || x === 299 || x >= 305 && x <= 307 || x === 312 || x >= 319 && x <= 322 || x === 324 || x >= 328 && x <= 331 || x === 333 || x === 338 || x === 339 || x === 358 || x === 359 || x === 363 || x === 462 || x === 464 || x === 466 || x === 468 || x === 470 || x === 472 || x === 474 || x === 476 || x === 593 || x === 609 || x === 708 || x === 711 || x >= 713 && x <= 715 || x === 717 || x === 720 || x >= 728 && x <= 731 || x === 733 || x === 735 || x >= 768 && x <= 879 || x >= 913 && x <= 929 || x >= 931 && x <= 937 || x >= 945 && x <= 961 || x >= 963 && x <= 969 || x === 1025 || x >= 1040 && x <= 1103 || x === 1105 || x === 8208 || x >= 8211 && x <= 8214 || x === 8216 || x === 8217 || x === 8220 || x === 8221 || x >= 8224 && x <= 8226 || x >= 8228 && x <= 8231 || x === 8240 || x === 8242 || x === 8243 || x === 8245 || x === 8251 || x === 8254 || x === 8308 || x === 8319 || x >= 8321 && x <= 8324 || x === 8364 || x === 8451 || x === 8453 || x === 8457 || x === 8467 || x === 8470 || x === 8481 || x === 8482 || x === 8486 || x === 8491 || x === 8531 || x === 8532 || x >= 8539 && x <= 8542 || x >= 8544 && x <= 8555 || x >= 8560 && x <= 8569 || x === 8585 || x >= 8592 && x <= 8601 || x === 8632 || x === 8633 || x === 8658 || x === 8660 || x === 8679 || x === 8704 || x === 8706 || x === 8707 || x === 8711 || x === 8712 || x === 8715 || x === 8719 || x === 8721 || x === 8725 || x === 8730 || x >= 8733 && x <= 8736 || x === 8739 || x === 8741 || x >= 8743 && x <= 8748 || x === 8750 || x >= 8756 && x <= 8759 || x === 8764 || x === 8765 || x === 8776 || x === 8780 || x === 8786 || x === 8800 || x === 8801 || x >= 8804 && x <= 8807 || x === 8810 || x === 8811 || x === 8814 || x === 8815 || x === 8834 || x === 8835 || x === 8838 || x === 8839 || x === 8853 || x === 8857 || x === 8869 || x === 8895 || x === 8978 || x >= 9312 && x <= 9449 || x >= 9451 && x <= 9547 || x >= 9552 && x <= 9587 || x >= 9600 && x <= 9615 || x >= 9618 && x <= 9621 || x === 9632 || x === 9633 || x >= 9635 && x <= 9641 || x === 9650 || x === 9651 || x === 9654 || x === 9655 || x === 9660 || x === 9661 || x === 9664 || x === 9665 || x >= 9670 && x <= 9672 || x === 9675 || x >= 9678 && x <= 9681 || x >= 9698 && x <= 9701 || x === 9711 || x === 9733 || x === 9734 || x === 9737 || x === 9742 || x === 9743 || x === 9756 || x === 9758 || x === 9792 || x === 9794 || x === 9824 || x === 9825 || x >= 9827 && x <= 9829 || x >= 9831 && x <= 9834 || x === 9836 || x === 9837 || x === 9839 || x === 9886 || x === 9887 || x === 9919 || x >= 9926 && x <= 9933 || x >= 9935 && x <= 9939 || x >= 9941 && x <= 9953 || x === 9955 || x === 9960 || x === 9961 || x >= 9963 && x <= 9969 || x === 9972 || x >= 9974 && x <= 9977 || x === 9979 || x === 9980 || x === 9982 || x === 9983 || x === 10045 || x >= 10102 && x <= 10111 || x >= 11094 && x <= 11097 || x >= 12872 && x <= 12879 || x >= 57344 && x <= 63743 || x >= 65024 && x <= 65039 || x === 65533 || x >= 127232 && x <= 127242 || x >= 127248 && x <= 127277 || x >= 127280 && x <= 127337 || x >= 127344 && x <= 127373 || x === 127375 || x === 127376 || x >= 127387 && x <= 127404 || x >= 917760 && x <= 917999 || x >= 983040 && x <= 1048573 || x >= 1048576 && x <= 1114109;
1622
- }
1623
- function isFullWidth(x) {
1624
- return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510;
1625
- }
1626
- function isWide(x) {
1627
- return x >= 4352 && x <= 4447 || x === 8986 || x === 8987 || x === 9001 || x === 9002 || x >= 9193 && x <= 9196 || x === 9200 || x === 9203 || x === 9725 || x === 9726 || x === 9748 || x === 9749 || x >= 9776 && x <= 9783 || x >= 9800 && x <= 9811 || x === 9855 || x >= 9866 && x <= 9871 || x === 9875 || x === 9889 || x === 9898 || x === 9899 || x === 9917 || x === 9918 || x === 9924 || x === 9925 || x === 9934 || x === 9940 || x === 9962 || x === 9970 || x === 9971 || x === 9973 || x === 9978 || x === 9981 || x === 9989 || x === 9994 || x === 9995 || x === 10024 || x === 10060 || x === 10062 || x >= 10067 && x <= 10069 || x === 10071 || x >= 10133 && x <= 10135 || x === 10160 || x === 10175 || x === 11035 || x === 11036 || x === 11088 || x === 11093 || x >= 11904 && x <= 11929 || x >= 11931 && x <= 12019 || x >= 12032 && x <= 12245 || x >= 12272 && x <= 12287 || x >= 12289 && x <= 12350 || x >= 12353 && x <= 12438 || x >= 12441 && x <= 12543 || x >= 12549 && x <= 12591 || x >= 12593 && x <= 12686 || x >= 12688 && x <= 12773 || x >= 12783 && x <= 12830 || x >= 12832 && x <= 12871 || x >= 12880 && x <= 42124 || x >= 42128 && x <= 42182 || x >= 43360 && x <= 43388 || x >= 44032 && x <= 55203 || x >= 63744 && x <= 64255 || x >= 65040 && x <= 65049 || x >= 65072 && x <= 65106 || x >= 65108 && x <= 65126 || x >= 65128 && x <= 65131 || x >= 94176 && x <= 94180 || x === 94192 || x === 94193 || x >= 94208 && x <= 100343 || x >= 100352 && x <= 101589 || x >= 101631 && x <= 101640 || x >= 110576 && x <= 110579 || x >= 110581 && x <= 110587 || x === 110589 || x === 110590 || x >= 110592 && x <= 110882 || x === 110898 || x >= 110928 && x <= 110930 || x === 110933 || x >= 110948 && x <= 110951 || x >= 110960 && x <= 111355 || x >= 119552 && x <= 119638 || x >= 119648 && x <= 119670 || x === 126980 || x === 127183 || x === 127374 || x >= 127377 && x <= 127386 || x >= 127488 && x <= 127490 || x >= 127504 && x <= 127547 || x >= 127552 && x <= 127560 || x === 127568 || x === 127569 || x >= 127584 && x <= 127589 || x >= 127744 && x <= 127776 || x >= 127789 && x <= 127797 || x >= 127799 && x <= 127868 || x >= 127870 && x <= 127891 || x >= 127904 && x <= 127946 || x >= 127951 && x <= 127955 || x >= 127968 && x <= 127984 || x === 127988 || x >= 127992 && x <= 128062 || x === 128064 || x >= 128066 && x <= 128252 || x >= 128255 && x <= 128317 || x >= 128331 && x <= 128334 || x >= 128336 && x <= 128359 || x === 128378 || x === 128405 || x === 128406 || x === 128420 || x >= 128507 && x <= 128591 || x >= 128640 && x <= 128709 || x === 128716 || x >= 128720 && x <= 128722 || x >= 128725 && x <= 128727 || x >= 128732 && x <= 128735 || x === 128747 || x === 128748 || x >= 128756 && x <= 128764 || x >= 128992 && x <= 129003 || x === 129008 || x >= 129292 && x <= 129338 || x >= 129340 && x <= 129349 || x >= 129351 && x <= 129535 || x >= 129648 && x <= 129660 || x >= 129664 && x <= 129673 || x >= 129679 && x <= 129734 || x >= 129742 && x <= 129756 || x >= 129759 && x <= 129769 || x >= 129776 && x <= 129784 || x >= 131072 && x <= 196605 || x >= 196608 && x <= 262141;
1628
- }
1629
-
1630
- // ../../node_modules/.pnpm/get-east-asian-width@1.3.0/node_modules/get-east-asian-width/index.js
1631
- function validate(codePoint) {
1632
- if (!Number.isSafeInteger(codePoint)) {
1633
- throw new TypeError(`Expected a code point, got \`${typeof codePoint}\`.`);
1634
- }
1635
- }
1636
- function eastAsianWidth(codePoint, { ambiguousAsWide = false } = {}) {
1637
- validate(codePoint);
1638
- if (isFullWidth(codePoint) || isWide(codePoint) || ambiguousAsWide && isAmbiguous(codePoint)) {
1639
- return 2;
1640
- }
1641
- return 1;
1642
- }
1643
-
1644
- // ../../node_modules/.pnpm/emoji-regex@10.4.0/node_modules/emoji-regex/index.mjs
1645
- var emoji_regex_default = () => {
1646
- return /[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;
1647
- };
1648
-
1649
- // ../../node_modules/.pnpm/string-width@7.2.0/node_modules/string-width/index.js
1650
- var segmenter = new Intl.Segmenter();
1651
- var defaultIgnorableCodePointRegex = /^\p{Default_Ignorable_Code_Point}$/u;
1652
- function stringWidth(string, options = {}) {
1653
- if (typeof string !== "string" || string.length === 0) {
1654
- return 0;
1655
- }
1656
- const {
1657
- ambiguousIsNarrow = true,
1658
- countAnsiEscapeCodes = false
1659
- } = options;
1660
- if (!countAnsiEscapeCodes) {
1661
- string = stripAnsi(string);
1662
- }
1663
- if (string.length === 0) {
1664
- return 0;
1665
- }
1666
- let width = 0;
1667
- const eastAsianWidthOptions = { ambiguousAsWide: !ambiguousIsNarrow };
1668
- for (const { segment: character } of segmenter.segment(string)) {
1669
- const codePoint = character.codePointAt(0);
1670
- if (codePoint <= 31 || codePoint >= 127 && codePoint <= 159) {
1671
- continue;
1672
- }
1673
- if (codePoint >= 8203 && codePoint <= 8207 || codePoint === 65279) {
1674
- continue;
1675
- }
1676
- if (codePoint >= 768 && codePoint <= 879 || codePoint >= 6832 && codePoint <= 6911 || codePoint >= 7616 && codePoint <= 7679 || codePoint >= 8400 && codePoint <= 8447 || codePoint >= 65056 && codePoint <= 65071) {
1677
- continue;
1678
- }
1679
- if (codePoint >= 55296 && codePoint <= 57343) {
1680
- continue;
1681
- }
1682
- if (codePoint >= 65024 && codePoint <= 65039) {
1683
- continue;
1684
- }
1685
- if (defaultIgnorableCodePointRegex.test(character)) {
1686
- continue;
1687
- }
1688
- if (emoji_regex_default().test(character)) {
1689
- width += 2;
1690
- continue;
1691
- }
1692
- width += eastAsianWidth(codePoint, eastAsianWidthOptions);
1693
- }
1694
- return width;
1695
- }
1696
-
1697
- // ../../node_modules/.pnpm/boxen@8.0.1/node_modules/boxen/index.js
1698
- var import_chalk = __toESM(require("chalk"), 1);
1699
-
1700
- // ../../node_modules/.pnpm/widest-line@5.0.0/node_modules/widest-line/index.js
1701
- function widestLine(string) {
1702
- let lineWidth = 0;
1703
- for (const line of string.split("\n")) {
1704
- lineWidth = Math.max(lineWidth, stringWidth(line));
1705
- }
1706
- return lineWidth;
1707
- }
1708
-
1709
- // ../../node_modules/.pnpm/boxen@8.0.1/node_modules/boxen/index.js
1710
- var import_cli_boxes = __toESM(require_cli_boxes(), 1);
1711
-
1712
- // ../../node_modules/.pnpm/camelcase@8.0.0/node_modules/camelcase/index.js
1713
- var UPPERCASE = /[\p{Lu}]/u;
1714
- var LOWERCASE = /[\p{Ll}]/u;
1715
- var LEADING_CAPITAL = /^[\p{Lu}](?![\p{Lu}])/gu;
1716
- var IDENTIFIER = /([\p{Alpha}\p{N}_]|$)/u;
1717
- var SEPARATORS = /[_.\- ]+/;
1718
- var LEADING_SEPARATORS = new RegExp("^" + SEPARATORS.source);
1719
- var SEPARATORS_AND_IDENTIFIER = new RegExp(SEPARATORS.source + IDENTIFIER.source, "gu");
1720
- var NUMBERS_AND_IDENTIFIER = new RegExp("\\d+" + IDENTIFIER.source, "gu");
1721
- var preserveCamelCase = (string, toLowerCase, toUpperCase, preserveConsecutiveUppercase2) => {
1722
- let isLastCharLower = false;
1723
- let isLastCharUpper = false;
1724
- let isLastLastCharUpper = false;
1725
- let isLastLastCharPreserved = false;
1726
- for (let index = 0; index < string.length; index++) {
1727
- const character = string[index];
1728
- isLastLastCharPreserved = index > 2 ? string[index - 3] === "-" : true;
1729
- if (isLastCharLower && UPPERCASE.test(character)) {
1730
- string = string.slice(0, index) + "-" + string.slice(index);
1731
- isLastCharLower = false;
1732
- isLastLastCharUpper = isLastCharUpper;
1733
- isLastCharUpper = true;
1734
- index++;
1735
- } else if (isLastCharUpper && isLastLastCharUpper && LOWERCASE.test(character) && (!isLastLastCharPreserved || preserveConsecutiveUppercase2)) {
1736
- string = string.slice(0, index - 1) + "-" + string.slice(index - 1);
1737
- isLastLastCharUpper = isLastCharUpper;
1738
- isLastCharUpper = false;
1739
- isLastCharLower = true;
1740
- } else {
1741
- isLastCharLower = toLowerCase(character) === character && toUpperCase(character) !== character;
1742
- isLastLastCharUpper = isLastCharUpper;
1743
- isLastCharUpper = toUpperCase(character) === character && toLowerCase(character) !== character;
1744
- }
1745
- }
1746
- return string;
1747
- };
1748
- var preserveConsecutiveUppercase = (input, toLowerCase) => {
1749
- LEADING_CAPITAL.lastIndex = 0;
1750
- return input.replaceAll(LEADING_CAPITAL, (match) => toLowerCase(match));
1751
- };
1752
- var postProcess = (input, toUpperCase) => {
1753
- SEPARATORS_AND_IDENTIFIER.lastIndex = 0;
1754
- NUMBERS_AND_IDENTIFIER.lastIndex = 0;
1755
- return input.replaceAll(NUMBERS_AND_IDENTIFIER, (match, pattern, offset) => ["_", "-"].includes(input.charAt(offset + match.length)) ? match : toUpperCase(match)).replaceAll(SEPARATORS_AND_IDENTIFIER, (_, identifier) => toUpperCase(identifier));
1756
- };
1757
- function camelCase(input, options) {
1758
- if (!(typeof input === "string" || Array.isArray(input))) {
1759
- throw new TypeError("Expected the input to be `string | string[]`");
1760
- }
1761
- options = {
1762
- pascalCase: false,
1763
- preserveConsecutiveUppercase: false,
1764
- ...options
1765
- };
1766
- if (Array.isArray(input)) {
1767
- input = input.map((x) => x.trim()).filter((x) => x.length).join("-");
1768
- } else {
1769
- input = input.trim();
1770
- }
1771
- if (input.length === 0) {
1772
- return "";
1773
- }
1774
- const toLowerCase = options.locale === false ? (string) => string.toLowerCase() : (string) => string.toLocaleLowerCase(options.locale);
1775
- const toUpperCase = options.locale === false ? (string) => string.toUpperCase() : (string) => string.toLocaleUpperCase(options.locale);
1776
- if (input.length === 1) {
1777
- if (SEPARATORS.test(input)) {
1778
- return "";
1779
- }
1780
- return options.pascalCase ? toUpperCase(input) : toLowerCase(input);
1781
- }
1782
- const hasUpperCase = input !== toLowerCase(input);
1783
- if (hasUpperCase) {
1784
- input = preserveCamelCase(input, toLowerCase, toUpperCase, options.preserveConsecutiveUppercase);
1785
- }
1786
- input = input.replace(LEADING_SEPARATORS, "");
1787
- input = options.preserveConsecutiveUppercase ? preserveConsecutiveUppercase(input, toLowerCase) : toLowerCase(input);
1788
- if (options.pascalCase) {
1789
- input = toUpperCase(input.charAt(0)) + input.slice(1);
1790
- }
1791
- return postProcess(input, toUpperCase);
1792
- }
1793
-
1794
- // ../../node_modules/.pnpm/boxen@8.0.1/node_modules/boxen/index.js
1795
- var import_ansi_align = __toESM(require_ansi_align(), 1);
1796
-
1797
- // ../../node_modules/.pnpm/ansi-styles@6.2.1/node_modules/ansi-styles/index.js
1798
- var ANSI_BACKGROUND_OFFSET = 10;
1799
- var wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
1800
- var wrapAnsi256 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`;
1801
- var wrapAnsi16m = (offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`;
1802
- var styles = {
1803
- modifier: {
1804
- reset: [0, 0],
1805
- // 21 isn't widely supported and 22 does the same thing
1806
- bold: [1, 22],
1807
- dim: [2, 22],
1808
- italic: [3, 23],
1809
- underline: [4, 24],
1810
- overline: [53, 55],
1811
- inverse: [7, 27],
1812
- hidden: [8, 28],
1813
- strikethrough: [9, 29]
557
+ // ../../node_modules/.pnpm/ansi-styles@6.2.1/node_modules/ansi-styles/index.js
558
+ var ANSI_BACKGROUND_OFFSET = 10;
559
+ var wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
560
+ var wrapAnsi256 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`;
561
+ var wrapAnsi16m = (offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`;
562
+ var styles = {
563
+ modifier: {
564
+ reset: [0, 0],
565
+ // 21 isn't widely supported and 22 does the same thing
566
+ bold: [1, 22],
567
+ dim: [2, 22],
568
+ italic: [3, 23],
569
+ underline: [4, 24],
570
+ overline: [53, 55],
571
+ inverse: [7, 27],
572
+ hidden: [8, 28],
573
+ strikethrough: [9, 29]
1814
574
  },
1815
575
  color: {
1816
576
  black: [30, 39],
@@ -2029,624 +789,1928 @@ var wrapWord = (rows, word, columns) => {
2029
789
  visible = 0;
2030
790
  }
2031
791
  }
2032
- if (!visible && rows.at(-1).length > 0 && rows.length > 1) {
2033
- rows[rows.length - 2] += rows.pop();
792
+ if (!visible && rows.at(-1).length > 0 && rows.length > 1) {
793
+ rows[rows.length - 2] += rows.pop();
794
+ }
795
+ };
796
+ var stringVisibleTrimSpacesRight = (string) => {
797
+ const words = string.split(" ");
798
+ let last = words.length;
799
+ while (last > 0) {
800
+ if (stringWidth(words[last - 1]) > 0) {
801
+ break;
802
+ }
803
+ last--;
804
+ }
805
+ if (last === words.length) {
806
+ return string;
807
+ }
808
+ return words.slice(0, last).join(" ") + words.slice(last).join("");
809
+ };
810
+ var exec = (string, columns, options = {}) => {
811
+ if (options.trim !== false && string.trim() === "") {
812
+ return "";
813
+ }
814
+ let returnValue = "";
815
+ let escapeCode;
816
+ let escapeUrl;
817
+ const lengths = wordLengths(string);
818
+ let rows = [""];
819
+ for (const [index, word] of string.split(" ").entries()) {
820
+ if (options.trim !== false) {
821
+ rows[rows.length - 1] = rows.at(-1).trimStart();
822
+ }
823
+ let rowLength = stringWidth(rows.at(-1));
824
+ if (index !== 0) {
825
+ if (rowLength >= columns && (options.wordWrap === false || options.trim === false)) {
826
+ rows.push("");
827
+ rowLength = 0;
828
+ }
829
+ if (rowLength > 0 || options.trim === false) {
830
+ rows[rows.length - 1] += " ";
831
+ rowLength++;
832
+ }
833
+ }
834
+ if (options.hard && lengths[index] > columns) {
835
+ const remainingColumns = columns - rowLength;
836
+ const breaksStartingThisLine = 1 + Math.floor((lengths[index] - remainingColumns - 1) / columns);
837
+ const breaksStartingNextLine = Math.floor((lengths[index] - 1) / columns);
838
+ if (breaksStartingNextLine < breaksStartingThisLine) {
839
+ rows.push("");
840
+ }
841
+ wrapWord(rows, word, columns);
842
+ continue;
843
+ }
844
+ if (rowLength + lengths[index] > columns && rowLength > 0 && lengths[index] > 0) {
845
+ if (options.wordWrap === false && rowLength < columns) {
846
+ wrapWord(rows, word, columns);
847
+ continue;
848
+ }
849
+ rows.push("");
850
+ }
851
+ if (rowLength + lengths[index] > columns && options.wordWrap === false) {
852
+ wrapWord(rows, word, columns);
853
+ continue;
854
+ }
855
+ rows[rows.length - 1] += word;
856
+ }
857
+ if (options.trim !== false) {
858
+ rows = rows.map((row) => stringVisibleTrimSpacesRight(row));
859
+ }
860
+ const preString = rows.join("\n");
861
+ const pre = [...preString];
862
+ let preStringIndex = 0;
863
+ for (const [index, character] of pre.entries()) {
864
+ returnValue += character;
865
+ if (ESCAPES.has(character)) {
866
+ const { groups } = new RegExp(`(?:\\${ANSI_CSI}(?<code>\\d+)m|\\${ANSI_ESCAPE_LINK}(?<uri>.*)${ANSI_ESCAPE_BELL})`).exec(preString.slice(preStringIndex)) || { groups: {} };
867
+ if (groups.code !== void 0) {
868
+ const code2 = Number.parseFloat(groups.code);
869
+ escapeCode = code2 === END_CODE ? void 0 : code2;
870
+ } else if (groups.uri !== void 0) {
871
+ escapeUrl = groups.uri.length === 0 ? void 0 : groups.uri;
872
+ }
873
+ }
874
+ const code = ansi_styles_default.codes.get(Number(escapeCode));
875
+ if (pre[index + 1] === "\n") {
876
+ if (escapeUrl) {
877
+ returnValue += wrapAnsiHyperlink("");
878
+ }
879
+ if (escapeCode && code) {
880
+ returnValue += wrapAnsiCode(code);
881
+ }
882
+ } else if (character === "\n") {
883
+ if (escapeCode && code) {
884
+ returnValue += wrapAnsiCode(escapeCode);
885
+ }
886
+ if (escapeUrl) {
887
+ returnValue += wrapAnsiHyperlink(escapeUrl);
888
+ }
889
+ }
890
+ preStringIndex += character.length;
891
+ }
892
+ return returnValue;
893
+ };
894
+ function wrapAnsi(string, columns, options) {
895
+ return String(string).normalize().replaceAll("\r\n", "\n").split("\n").map((line) => exec(line, columns, options)).join("\n");
896
+ }
897
+
898
+ // ../../node_modules/.pnpm/boxen@8.0.1/node_modules/boxen/index.js
899
+ var import_cli_boxes2 = __toESM(require_cli_boxes(), 1);
900
+ var NEWLINE = "\n";
901
+ var PAD = " ";
902
+ var NONE = "none";
903
+ var terminalColumns = () => {
904
+ const { env, stdout, stderr } = import_node_process.default;
905
+ if (stdout?.columns) {
906
+ return stdout.columns;
907
+ }
908
+ if (stderr?.columns) {
909
+ return stderr.columns;
910
+ }
911
+ if (env.COLUMNS) {
912
+ return Number.parseInt(env.COLUMNS, 10);
913
+ }
914
+ return 80;
915
+ };
916
+ var getObject = (detail) => typeof detail === "number" ? {
917
+ top: detail,
918
+ right: detail * 3,
919
+ bottom: detail,
920
+ left: detail * 3
921
+ } : {
922
+ top: 0,
923
+ right: 0,
924
+ bottom: 0,
925
+ left: 0,
926
+ ...detail
927
+ };
928
+ var getBorderWidth = (borderStyle) => borderStyle === NONE ? 0 : 2;
929
+ var getBorderChars = (borderStyle) => {
930
+ const sides = [
931
+ "topLeft",
932
+ "topRight",
933
+ "bottomRight",
934
+ "bottomLeft",
935
+ "left",
936
+ "right",
937
+ "top",
938
+ "bottom"
939
+ ];
940
+ let characters;
941
+ if (borderStyle === NONE) {
942
+ borderStyle = {};
943
+ for (const side of sides) {
944
+ borderStyle[side] = "";
945
+ }
946
+ }
947
+ if (typeof borderStyle === "string") {
948
+ characters = import_cli_boxes.default[borderStyle];
949
+ if (!characters) {
950
+ throw new TypeError(`Invalid border style: ${borderStyle}`);
951
+ }
952
+ } else {
953
+ if (typeof borderStyle?.vertical === "string") {
954
+ borderStyle.left = borderStyle.vertical;
955
+ borderStyle.right = borderStyle.vertical;
956
+ }
957
+ if (typeof borderStyle?.horizontal === "string") {
958
+ borderStyle.top = borderStyle.horizontal;
959
+ borderStyle.bottom = borderStyle.horizontal;
960
+ }
961
+ for (const side of sides) {
962
+ if (borderStyle[side] === null || typeof borderStyle[side] !== "string") {
963
+ throw new TypeError(`Invalid border style: ${side}`);
964
+ }
965
+ }
966
+ characters = borderStyle;
967
+ }
968
+ return characters;
969
+ };
970
+ var makeTitle = (text, horizontal, alignment) => {
971
+ let title = "";
972
+ const textWidth = stringWidth(text);
973
+ switch (alignment) {
974
+ case "left": {
975
+ title = text + horizontal.slice(textWidth);
976
+ break;
977
+ }
978
+ case "right": {
979
+ title = horizontal.slice(textWidth) + text;
980
+ break;
981
+ }
982
+ default: {
983
+ horizontal = horizontal.slice(textWidth);
984
+ if (horizontal.length % 2 === 1) {
985
+ horizontal = horizontal.slice(Math.floor(horizontal.length / 2));
986
+ title = horizontal.slice(1) + text + horizontal;
987
+ } else {
988
+ horizontal = horizontal.slice(horizontal.length / 2);
989
+ title = horizontal + text + horizontal;
990
+ }
991
+ break;
992
+ }
993
+ }
994
+ return title;
995
+ };
996
+ var makeContentText = (text, { padding, width, textAlignment, height }) => {
997
+ text = (0, import_ansi_align.default)(text, { align: textAlignment });
998
+ let lines = text.split(NEWLINE);
999
+ const textWidth = widestLine(text);
1000
+ const max = width - padding.left - padding.right;
1001
+ if (textWidth > max) {
1002
+ const newLines = [];
1003
+ for (const line of lines) {
1004
+ const createdLines = wrapAnsi(line, max, { hard: true });
1005
+ const alignedLines = (0, import_ansi_align.default)(createdLines, { align: textAlignment });
1006
+ const alignedLinesArray = alignedLines.split("\n");
1007
+ const longestLength = Math.max(...alignedLinesArray.map((s) => stringWidth(s)));
1008
+ for (const alignedLine of alignedLinesArray) {
1009
+ let paddedLine;
1010
+ switch (textAlignment) {
1011
+ case "center": {
1012
+ paddedLine = PAD.repeat((max - longestLength) / 2) + alignedLine;
1013
+ break;
1014
+ }
1015
+ case "right": {
1016
+ paddedLine = PAD.repeat(max - longestLength) + alignedLine;
1017
+ break;
1018
+ }
1019
+ default: {
1020
+ paddedLine = alignedLine;
1021
+ break;
1022
+ }
1023
+ }
1024
+ newLines.push(paddedLine);
1025
+ }
1026
+ }
1027
+ lines = newLines;
1028
+ }
1029
+ if (textAlignment === "center" && textWidth < max) {
1030
+ lines = lines.map((line) => PAD.repeat((max - textWidth) / 2) + line);
1031
+ } else if (textAlignment === "right" && textWidth < max) {
1032
+ lines = lines.map((line) => PAD.repeat(max - textWidth) + line);
1033
+ }
1034
+ const paddingLeft = PAD.repeat(padding.left);
1035
+ const paddingRight = PAD.repeat(padding.right);
1036
+ lines = lines.map((line) => {
1037
+ const newLine = paddingLeft + line + paddingRight;
1038
+ return newLine + PAD.repeat(width - stringWidth(newLine));
1039
+ });
1040
+ if (padding.top > 0) {
1041
+ lines = [...Array.from({ length: padding.top }).fill(PAD.repeat(width)), ...lines];
1042
+ }
1043
+ if (padding.bottom > 0) {
1044
+ lines = [...lines, ...Array.from({ length: padding.bottom }).fill(PAD.repeat(width))];
1045
+ }
1046
+ if (height && lines.length > height) {
1047
+ lines = lines.slice(0, height);
1048
+ } else if (height && lines.length < height) {
1049
+ lines = [...lines, ...Array.from({ length: height - lines.length }).fill(PAD.repeat(width))];
1050
+ }
1051
+ return lines.join(NEWLINE);
1052
+ };
1053
+ var boxContent = (content, contentWidth, options) => {
1054
+ const colorizeBorder = (border) => {
1055
+ const newBorder = options.borderColor ? getColorFunction(options.borderColor)(border) : border;
1056
+ return options.dimBorder ? import_chalk.default.dim(newBorder) : newBorder;
1057
+ };
1058
+ const colorizeContent = (content2) => options.backgroundColor ? getBGColorFunction(options.backgroundColor)(content2) : content2;
1059
+ const chars = getBorderChars(options.borderStyle);
1060
+ const columns = terminalColumns();
1061
+ let marginLeft = PAD.repeat(options.margin.left);
1062
+ if (options.float === "center") {
1063
+ const marginWidth = Math.max((columns - contentWidth - getBorderWidth(options.borderStyle)) / 2, 0);
1064
+ marginLeft = PAD.repeat(marginWidth);
1065
+ } else if (options.float === "right") {
1066
+ const marginWidth = Math.max(columns - contentWidth - options.margin.right - getBorderWidth(options.borderStyle), 0);
1067
+ marginLeft = PAD.repeat(marginWidth);
1068
+ }
1069
+ let result = "";
1070
+ if (options.margin.top) {
1071
+ result += NEWLINE.repeat(options.margin.top);
1072
+ }
1073
+ if (options.borderStyle !== NONE || options.title) {
1074
+ result += colorizeBorder(marginLeft + chars.topLeft + (options.title ? makeTitle(options.title, chars.top.repeat(contentWidth), options.titleAlignment) : chars.top.repeat(contentWidth)) + chars.topRight) + NEWLINE;
1075
+ }
1076
+ const lines = content.split(NEWLINE);
1077
+ result += lines.map((line) => marginLeft + colorizeBorder(chars.left) + colorizeContent(line) + colorizeBorder(chars.right)).join(NEWLINE);
1078
+ if (options.borderStyle !== NONE) {
1079
+ result += NEWLINE + colorizeBorder(marginLeft + chars.bottomLeft + chars.bottom.repeat(contentWidth) + chars.bottomRight);
1080
+ }
1081
+ if (options.margin.bottom) {
1082
+ result += NEWLINE.repeat(options.margin.bottom);
1083
+ }
1084
+ return result;
1085
+ };
1086
+ var sanitizeOptions = (options) => {
1087
+ if (options.fullscreen && import_node_process.default?.stdout) {
1088
+ let newDimensions = [import_node_process.default.stdout.columns, import_node_process.default.stdout.rows];
1089
+ if (typeof options.fullscreen === "function") {
1090
+ newDimensions = options.fullscreen(...newDimensions);
1091
+ }
1092
+ options.width || (options.width = newDimensions[0]);
1093
+ options.height || (options.height = newDimensions[1]);
1094
+ }
1095
+ options.width && (options.width = Math.max(1, options.width - getBorderWidth(options.borderStyle)));
1096
+ options.height && (options.height = Math.max(1, options.height - getBorderWidth(options.borderStyle)));
1097
+ return options;
1098
+ };
1099
+ var formatTitle = (title, borderStyle) => borderStyle === NONE ? title : ` ${title} `;
1100
+ var determineDimensions = (text, options) => {
1101
+ options = sanitizeOptions(options);
1102
+ const widthOverride = options.width !== void 0;
1103
+ const columns = terminalColumns();
1104
+ const borderWidth = getBorderWidth(options.borderStyle);
1105
+ const maxWidth = columns - options.margin.left - options.margin.right - borderWidth;
1106
+ const widest = widestLine(wrapAnsi(text, columns - borderWidth, { hard: true, trim: false })) + options.padding.left + options.padding.right;
1107
+ if (options.title && widthOverride) {
1108
+ options.title = options.title.slice(0, Math.max(0, options.width - 2));
1109
+ options.title && (options.title = formatTitle(options.title, options.borderStyle));
1110
+ } else if (options.title) {
1111
+ options.title = options.title.slice(0, Math.max(0, maxWidth - 2));
1112
+ if (options.title) {
1113
+ options.title = formatTitle(options.title, options.borderStyle);
1114
+ if (stringWidth(options.title) > widest) {
1115
+ options.width = stringWidth(options.title);
1116
+ }
1117
+ }
1118
+ }
1119
+ options.width || (options.width = widest);
1120
+ if (!widthOverride) {
1121
+ if (options.margin.left && options.margin.right && options.width > maxWidth) {
1122
+ const spaceForMargins = columns - options.width - borderWidth;
1123
+ const multiplier = spaceForMargins / (options.margin.left + options.margin.right);
1124
+ options.margin.left = Math.max(0, Math.floor(options.margin.left * multiplier));
1125
+ options.margin.right = Math.max(0, Math.floor(options.margin.right * multiplier));
1126
+ }
1127
+ options.width = Math.min(options.width, columns - borderWidth - options.margin.left - options.margin.right);
1128
+ }
1129
+ if (options.width - (options.padding.left + options.padding.right) <= 0) {
1130
+ options.padding.left = 0;
1131
+ options.padding.right = 0;
1132
+ }
1133
+ if (options.height && options.height - (options.padding.top + options.padding.bottom) <= 0) {
1134
+ options.padding.top = 0;
1135
+ options.padding.bottom = 0;
1136
+ }
1137
+ return options;
1138
+ };
1139
+ var isHex = (color) => color.match(/^#(?:[0-f]{3}){1,2}$/i);
1140
+ var isColorValid = (color) => typeof color === "string" && (import_chalk.default[color] ?? isHex(color));
1141
+ var getColorFunction = (color) => isHex(color) ? import_chalk.default.hex(color) : import_chalk.default[color];
1142
+ var getBGColorFunction = (color) => isHex(color) ? import_chalk.default.bgHex(color) : import_chalk.default[camelCase(["bg", color])];
1143
+ function boxen(text, options) {
1144
+ options = {
1145
+ padding: 0,
1146
+ borderStyle: "single",
1147
+ dimBorder: false,
1148
+ textAlignment: "left",
1149
+ float: "left",
1150
+ titleAlignment: "left",
1151
+ ...options
1152
+ };
1153
+ if (options.align) {
1154
+ options.textAlignment = options.align;
1155
+ }
1156
+ if (options.borderColor && !isColorValid(options.borderColor)) {
1157
+ throw new Error(`${options.borderColor} is not a valid borderColor`);
1158
+ }
1159
+ if (options.backgroundColor && !isColorValid(options.backgroundColor)) {
1160
+ throw new Error(`${options.backgroundColor} is not a valid backgroundColor`);
1161
+ }
1162
+ options.padding = getObject(options.padding);
1163
+ options.margin = getObject(options.margin);
1164
+ options = determineDimensions(text, options);
1165
+ text = makeContentText(text, options);
1166
+ return boxContent(text, options.width, options);
1167
+ }
1168
+
1169
+ // ../../shared/check-for-package-update.ts
1170
+ var import_fs = __toESM(require("fs"));
1171
+ var import_path = __toESM(require("path"));
1172
+ var getInstalledVersionOfPackage = (packageName) => {
1173
+ try {
1174
+ const PROJECT_DIR = process.env.PROJECT_DIR || process.cwd();
1175
+ const pkg = import_fs.default.readFileSync(import_path.default.join(PROJECT_DIR, "package.json"), "utf8");
1176
+ const json = JSON.parse(pkg);
1177
+ const version = json.dependencies[packageName];
1178
+ return version?.replace(/[\^~><=]/g, "");
1179
+ } catch (error) {
1180
+ return null;
1181
+ }
1182
+ };
1183
+ async function checkForPackageUpdate(packageName) {
1184
+ const installedVersion = getInstalledVersionOfPackage(packageName);
1185
+ if (!installedVersion || installedVersion === "latest") return;
1186
+ const pkg = { name: packageName, version: installedVersion };
1187
+ const updateNotifierModule = await import("update-notifier");
1188
+ const notifier = updateNotifierModule.default({ pkg, updateCheckInterval: 0, shouldNotifyInNpmScript: true });
1189
+ const info = await notifier.fetchInfo();
1190
+ if (info?.type !== "latest") {
1191
+ const message2 = `Package ${packageName} update available ${info.current} \u2192 ${info.latest}
1192
+ Run npm i ${packageName} to update`;
1193
+ console.log(
1194
+ boxen(message2, {
1195
+ padding: 1,
1196
+ margin: 1,
1197
+ align: "center",
1198
+ borderColor: "yellow",
1199
+ borderStyle: {
1200
+ topLeft: " ",
1201
+ topRight: " ",
1202
+ bottomLeft: " ",
1203
+ bottomRight: " ",
1204
+ right: " ",
1205
+ top: "-",
1206
+ bottom: "-",
1207
+ left: " "
1208
+ }
1209
+ })
1210
+ );
1211
+ }
1212
+ }
1213
+
1214
+ // src/index.ts
1215
+ var import_avro_schema_parser = require("@asyncapi/avro-schema-parser");
1216
+
1217
+ // src/utils/schemas.ts
1218
+ var getFileExtentionFromSchemaFormat = (format = "") => {
1219
+ if (format.includes("avro")) return "avsc";
1220
+ if (format.includes("yml")) return "yml";
1221
+ if (format.includes("json")) return "json";
1222
+ if (format.includes("openapi")) return "openapi";
1223
+ if (format.includes("protobuf")) return "protobuf";
1224
+ if (format.includes("yaml")) return "yaml";
1225
+ return "json";
1226
+ };
1227
+
1228
+ // src/utils/messages.ts
1229
+ var defaultMarkdown = (_document, message2) => {
1230
+ return `
1231
+ ## Architecture
1232
+ <NodeGraph />
1233
+
1234
+ ${messageHasSchema(message2) && messageIsJSON(message2) ? `
1235
+ ## Schema
1236
+ <SchemaViewer file="${getSchemaFileName(message2)}" title="Message Schema" maxHeight="500" />
1237
+ ` : ""}
1238
+ ${messageHasSchema(message2) && !messageIsJSON(message2) ? `
1239
+ ## Schema
1240
+ <Schema file="${getSchemaFileName(message2)}" title="Message Schema" maxHeight="500" />
1241
+ ` : ""}
1242
+
1243
+ ${message2.externalDocs() ? `
1244
+ ## External documentation
1245
+ - [${message2.externalDocs()?.description()}](${message2.externalDocs()?.url()})
1246
+ ` : ""}
1247
+
1248
+ `;
1249
+ };
1250
+ var getSummary = (message2) => {
1251
+ const messageSummary = message2.hasSummary() ? message2.summary() : "";
1252
+ const messageDescription = message2.hasDescription() ? message2.description() : "";
1253
+ let eventCatalogMessageSummary = messageSummary;
1254
+ if (!eventCatalogMessageSummary) {
1255
+ eventCatalogMessageSummary = messageDescription && messageDescription.length < 150 ? messageDescription : "";
1256
+ }
1257
+ return eventCatalogMessageSummary;
1258
+ };
1259
+ var messageHasSchema = (message2) => {
1260
+ return message2.hasPayload() && message2.schemaFormat();
1261
+ };
1262
+ var messageIsJSON = (message2) => {
1263
+ const fileName = getSchemaFileName(message2);
1264
+ return fileName.endsWith(".json");
1265
+ };
1266
+ var getSchemaFileName = (message2) => {
1267
+ const extension = getFileExtentionFromSchemaFormat(message2.schemaFormat());
1268
+ return `schema.${extension}`;
1269
+ };
1270
+ var getMessageName = (message2) => {
1271
+ return message2.hasTitle() && message2.title() ? message2.title() : message2.id();
1272
+ };
1273
+ var getChannelsForMessage = (message2, channels, document) => {
1274
+ let channelsForMessage = [];
1275
+ const globalVersion = document.info().version();
1276
+ for (const channel of channels) {
1277
+ for (const channelMessage of channel.messages()) {
1278
+ if (channelMessage.id() === message2.id()) {
1279
+ channelsForMessage.push(channel);
1280
+ }
1281
+ }
1282
+ }
1283
+ for (const messageChannel of message2.channels()) {
1284
+ channelsForMessage.push(messageChannel);
2034
1285
  }
1286
+ const uniqueChannels = channelsForMessage.filter(
1287
+ (channel, index, self) => index === self.findIndex((t) => t.id() === channel.id())
1288
+ );
1289
+ return uniqueChannels.map((channel) => {
1290
+ const channelVersion = channel.extensions().get("x-eventcatalog-channel-version")?.value() || globalVersion;
1291
+ return {
1292
+ id: channel.id(),
1293
+ version: channelVersion
1294
+ };
1295
+ });
2035
1296
  };
2036
- var stringVisibleTrimSpacesRight = (string) => {
2037
- const words = string.split(" ");
2038
- let last = words.length;
2039
- while (last > 0) {
2040
- if (stringWidth(words[last - 1]) > 0) {
2041
- break;
1297
+
1298
+ // src/utils/services.ts
1299
+ var defaultMarkdown2 = (document) => {
1300
+ return `
1301
+
1302
+ ${document.info().hasDescription() ? `${document.info().description()}` : ""}
1303
+
1304
+ ## Architecture diagram
1305
+ <NodeGraph />
1306
+
1307
+ ${document.info().externalDocs() ? `
1308
+ ## External documentation
1309
+ - [${document.info().externalDocs()?.description()}](${document.info().externalDocs()?.url()})
1310
+ ` : ""}
1311
+ `;
1312
+ };
1313
+ var getSummary2 = (document) => {
1314
+ const summary = document.info().hasDescription() ? document.info().description() : "";
1315
+ return summary && summary.length < 150 ? summary : "";
1316
+ };
1317
+
1318
+ // src/utils/domains.ts
1319
+ var defaultMarkdown3 = (document) => {
1320
+ return `
1321
+
1322
+ ## Architecture diagram
1323
+ <NodeGraph />
1324
+
1325
+ `;
1326
+ };
1327
+
1328
+ // src/utils/channels.ts
1329
+ var getChannelProtocols = (channel) => {
1330
+ const protocols = [];
1331
+ const bindings = channel.bindings();
1332
+ for (const binding of bindings) {
1333
+ protocols.push(binding.protocol());
1334
+ }
1335
+ return protocols;
1336
+ };
1337
+ var getChannelTags = (channel) => {
1338
+ const tags = [];
1339
+ const jsonTags = channel.json()?.tags;
1340
+ if (Array.isArray(jsonTags)) {
1341
+ for (const tag2 of jsonTags) {
1342
+ if (tag2.name && !tags.includes(tag2.name)) {
1343
+ tags.push(tag2.name);
1344
+ }
2042
1345
  }
2043
- last--;
2044
1346
  }
2045
- if (last === words.length) {
2046
- return string;
1347
+ return tags;
1348
+ };
1349
+ var defaultMarkdown4 = (_document, channel) => {
1350
+ return `
1351
+ ${channel.hasDescription() ? `
1352
+ ## Overview
1353
+ ${channel.description()}
1354
+ ` : ""}
1355
+
1356
+ <ChannelInformation />
1357
+
1358
+ ${channel.json()?.externalDocs ? `
1359
+ ## External documentation
1360
+ - [${channel.json()?.externalDocs?.description}](${channel.json()?.externalDocs?.url})
1361
+ ` : ""}
1362
+
1363
+ `;
1364
+ };
1365
+
1366
+ // ../../shared/checkLicense.ts
1367
+ var import_chalk3 = __toESM(require("chalk"));
1368
+
1369
+ // ../../node_modules/.pnpm/@eventcatalog+license@0.0.5/node_modules/@eventcatalog/license/dist/verify.js
1370
+ var import_fs2 = require("fs");
1371
+
1372
+ // ../../node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/base64url.js
1373
+ var import_node_buffer = require("buffer");
1374
+
1375
+ // ../../node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/buffer_utils.js
1376
+ var encoder = new TextEncoder();
1377
+ var decoder = new TextDecoder();
1378
+ var MAX_INT32 = 2 ** 32;
1379
+ function concat(...buffers) {
1380
+ const size = buffers.reduce((acc, { length }) => acc + length, 0);
1381
+ const buf = new Uint8Array(size);
1382
+ let i = 0;
1383
+ for (const buffer of buffers) {
1384
+ buf.set(buffer, i);
1385
+ i += buffer.length;
1386
+ }
1387
+ return buf;
1388
+ }
1389
+
1390
+ // ../../node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/base64url.js
1391
+ function normalize(input) {
1392
+ let encoded = input;
1393
+ if (encoded instanceof Uint8Array) {
1394
+ encoded = decoder.decode(encoded);
1395
+ }
1396
+ return encoded;
1397
+ }
1398
+ var decode = (input) => new Uint8Array(import_node_buffer.Buffer.from(normalize(input), "base64url"));
1399
+
1400
+ // ../../node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/util/errors.js
1401
+ var JOSEError = class extends Error {
1402
+ constructor(message2, options) {
1403
+ super(message2, options);
1404
+ __publicField(this, "code", "ERR_JOSE_GENERIC");
1405
+ this.name = this.constructor.name;
1406
+ Error.captureStackTrace?.(this, this.constructor);
2047
1407
  }
2048
- return words.slice(0, last).join(" ") + words.slice(last).join("");
2049
1408
  };
2050
- var exec = (string, columns, options = {}) => {
2051
- if (options.trim !== false && string.trim() === "") {
2052
- return "";
1409
+ __publicField(JOSEError, "code", "ERR_JOSE_GENERIC");
1410
+ var JWTClaimValidationFailed = class extends JOSEError {
1411
+ constructor(message2, payload, claim = "unspecified", reason = "unspecified") {
1412
+ super(message2, { cause: { claim, reason, payload } });
1413
+ __publicField(this, "code", "ERR_JWT_CLAIM_VALIDATION_FAILED");
1414
+ __publicField(this, "claim");
1415
+ __publicField(this, "reason");
1416
+ __publicField(this, "payload");
1417
+ this.claim = claim;
1418
+ this.reason = reason;
1419
+ this.payload = payload;
2053
1420
  }
2054
- let returnValue = "";
2055
- let escapeCode;
2056
- let escapeUrl;
2057
- const lengths = wordLengths(string);
2058
- let rows = [""];
2059
- for (const [index, word] of string.split(" ").entries()) {
2060
- if (options.trim !== false) {
2061
- rows[rows.length - 1] = rows.at(-1).trimStart();
2062
- }
2063
- let rowLength = stringWidth(rows.at(-1));
2064
- if (index !== 0) {
2065
- if (rowLength >= columns && (options.wordWrap === false || options.trim === false)) {
2066
- rows.push("");
2067
- rowLength = 0;
2068
- }
2069
- if (rowLength > 0 || options.trim === false) {
2070
- rows[rows.length - 1] += " ";
2071
- rowLength++;
2072
- }
2073
- }
2074
- if (options.hard && lengths[index] > columns) {
2075
- const remainingColumns = columns - rowLength;
2076
- const breaksStartingThisLine = 1 + Math.floor((lengths[index] - remainingColumns - 1) / columns);
2077
- const breaksStartingNextLine = Math.floor((lengths[index] - 1) / columns);
2078
- if (breaksStartingNextLine < breaksStartingThisLine) {
2079
- rows.push("");
2080
- }
2081
- wrapWord(rows, word, columns);
2082
- continue;
2083
- }
2084
- if (rowLength + lengths[index] > columns && rowLength > 0 && lengths[index] > 0) {
2085
- if (options.wordWrap === false && rowLength < columns) {
2086
- wrapWord(rows, word, columns);
2087
- continue;
2088
- }
2089
- rows.push("");
2090
- }
2091
- if (rowLength + lengths[index] > columns && options.wordWrap === false) {
2092
- wrapWord(rows, word, columns);
2093
- continue;
2094
- }
2095
- rows[rows.length - 1] += word;
1421
+ };
1422
+ __publicField(JWTClaimValidationFailed, "code", "ERR_JWT_CLAIM_VALIDATION_FAILED");
1423
+ var JWTExpired = class extends JOSEError {
1424
+ constructor(message2, payload, claim = "unspecified", reason = "unspecified") {
1425
+ super(message2, { cause: { claim, reason, payload } });
1426
+ __publicField(this, "code", "ERR_JWT_EXPIRED");
1427
+ __publicField(this, "claim");
1428
+ __publicField(this, "reason");
1429
+ __publicField(this, "payload");
1430
+ this.claim = claim;
1431
+ this.reason = reason;
1432
+ this.payload = payload;
2096
1433
  }
2097
- if (options.trim !== false) {
2098
- rows = rows.map((row) => stringVisibleTrimSpacesRight(row));
1434
+ };
1435
+ __publicField(JWTExpired, "code", "ERR_JWT_EXPIRED");
1436
+ var JOSEAlgNotAllowed = class extends JOSEError {
1437
+ constructor() {
1438
+ super(...arguments);
1439
+ __publicField(this, "code", "ERR_JOSE_ALG_NOT_ALLOWED");
2099
1440
  }
2100
- const preString = rows.join("\n");
2101
- const pre = [...preString];
2102
- let preStringIndex = 0;
2103
- for (const [index, character] of pre.entries()) {
2104
- returnValue += character;
2105
- if (ESCAPES.has(character)) {
2106
- const { groups } = new RegExp(`(?:\\${ANSI_CSI}(?<code>\\d+)m|\\${ANSI_ESCAPE_LINK}(?<uri>.*)${ANSI_ESCAPE_BELL})`).exec(preString.slice(preStringIndex)) || { groups: {} };
2107
- if (groups.code !== void 0) {
2108
- const code2 = Number.parseFloat(groups.code);
2109
- escapeCode = code2 === END_CODE ? void 0 : code2;
2110
- } else if (groups.uri !== void 0) {
2111
- escapeUrl = groups.uri.length === 0 ? void 0 : groups.uri;
2112
- }
2113
- }
2114
- const code = ansi_styles_default.codes.get(Number(escapeCode));
2115
- if (pre[index + 1] === "\n") {
2116
- if (escapeUrl) {
2117
- returnValue += wrapAnsiHyperlink("");
2118
- }
2119
- if (escapeCode && code) {
2120
- returnValue += wrapAnsiCode(code);
2121
- }
2122
- } else if (character === "\n") {
2123
- if (escapeCode && code) {
2124
- returnValue += wrapAnsiCode(escapeCode);
2125
- }
2126
- if (escapeUrl) {
2127
- returnValue += wrapAnsiHyperlink(escapeUrl);
2128
- }
2129
- }
2130
- preStringIndex += character.length;
1441
+ };
1442
+ __publicField(JOSEAlgNotAllowed, "code", "ERR_JOSE_ALG_NOT_ALLOWED");
1443
+ var JOSENotSupported = class extends JOSEError {
1444
+ constructor() {
1445
+ super(...arguments);
1446
+ __publicField(this, "code", "ERR_JOSE_NOT_SUPPORTED");
2131
1447
  }
2132
- return returnValue;
2133
1448
  };
2134
- function wrapAnsi(string, columns, options) {
2135
- return String(string).normalize().replaceAll("\r\n", "\n").split("\n").map((line) => exec(line, columns, options)).join("\n");
2136
- }
2137
-
2138
- // ../../node_modules/.pnpm/boxen@8.0.1/node_modules/boxen/index.js
2139
- var import_cli_boxes2 = __toESM(require_cli_boxes(), 1);
2140
- var NEWLINE = "\n";
2141
- var PAD = " ";
2142
- var NONE = "none";
2143
- var terminalColumns = () => {
2144
- const { env, stdout, stderr } = import_node_process.default;
2145
- if (stdout?.columns) {
2146
- return stdout.columns;
1449
+ __publicField(JOSENotSupported, "code", "ERR_JOSE_NOT_SUPPORTED");
1450
+ var JWSInvalid = class extends JOSEError {
1451
+ constructor() {
1452
+ super(...arguments);
1453
+ __publicField(this, "code", "ERR_JWS_INVALID");
2147
1454
  }
2148
- if (stderr?.columns) {
2149
- return stderr.columns;
1455
+ };
1456
+ __publicField(JWSInvalid, "code", "ERR_JWS_INVALID");
1457
+ var JWTInvalid = class extends JOSEError {
1458
+ constructor() {
1459
+ super(...arguments);
1460
+ __publicField(this, "code", "ERR_JWT_INVALID");
2150
1461
  }
2151
- if (env.COLUMNS) {
2152
- return Number.parseInt(env.COLUMNS, 10);
1462
+ };
1463
+ __publicField(JWTInvalid, "code", "ERR_JWT_INVALID");
1464
+ var _a, _b;
1465
+ var JWKSMultipleMatchingKeys = class extends (_b = JOSEError, _a = Symbol.asyncIterator, _b) {
1466
+ constructor(message2 = "multiple matching keys found in the JSON Web Key Set", options) {
1467
+ super(message2, options);
1468
+ __publicField(this, _a);
1469
+ __publicField(this, "code", "ERR_JWKS_MULTIPLE_MATCHING_KEYS");
2153
1470
  }
2154
- return 80;
2155
1471
  };
2156
- var getObject = (detail) => typeof detail === "number" ? {
2157
- top: detail,
2158
- right: detail * 3,
2159
- bottom: detail,
2160
- left: detail * 3
2161
- } : {
2162
- top: 0,
2163
- right: 0,
2164
- bottom: 0,
2165
- left: 0,
2166
- ...detail
1472
+ __publicField(JWKSMultipleMatchingKeys, "code", "ERR_JWKS_MULTIPLE_MATCHING_KEYS");
1473
+ var JWSSignatureVerificationFailed = class extends JOSEError {
1474
+ constructor(message2 = "signature verification failed", options) {
1475
+ super(message2, options);
1476
+ __publicField(this, "code", "ERR_JWS_SIGNATURE_VERIFICATION_FAILED");
1477
+ }
2167
1478
  };
2168
- var getBorderWidth = (borderStyle) => borderStyle === NONE ? 0 : 2;
2169
- var getBorderChars = (borderStyle) => {
2170
- const sides = [
2171
- "topLeft",
2172
- "topRight",
2173
- "bottomRight",
2174
- "bottomLeft",
2175
- "left",
2176
- "right",
2177
- "top",
2178
- "bottom"
2179
- ];
2180
- let characters;
2181
- if (borderStyle === NONE) {
2182
- borderStyle = {};
2183
- for (const side of sides) {
2184
- borderStyle[side] = "";
1479
+ __publicField(JWSSignatureVerificationFailed, "code", "ERR_JWS_SIGNATURE_VERIFICATION_FAILED");
1480
+
1481
+ // ../../node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/is_key_object.js
1482
+ var util = __toESM(require("util"), 1);
1483
+ var is_key_object_default = (obj) => util.types.isKeyObject(obj);
1484
+
1485
+ // ../../node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/webcrypto.js
1486
+ var crypto = __toESM(require("crypto"), 1);
1487
+ var util2 = __toESM(require("util"), 1);
1488
+ var webcrypto2 = crypto.webcrypto;
1489
+ var webcrypto_default = webcrypto2;
1490
+ var isCryptoKey = (key) => util2.types.isCryptoKey(key);
1491
+
1492
+ // ../../node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/crypto_key.js
1493
+ function unusable(name, prop = "algorithm.name") {
1494
+ return new TypeError(`CryptoKey does not support this operation, its ${prop} must be ${name}`);
1495
+ }
1496
+ function isAlgorithm(algorithm, name) {
1497
+ return algorithm.name === name;
1498
+ }
1499
+ function getHashLength(hash) {
1500
+ return parseInt(hash.name.slice(4), 10);
1501
+ }
1502
+ function getNamedCurve(alg) {
1503
+ switch (alg) {
1504
+ case "ES256":
1505
+ return "P-256";
1506
+ case "ES384":
1507
+ return "P-384";
1508
+ case "ES512":
1509
+ return "P-521";
1510
+ default:
1511
+ throw new Error("unreachable");
1512
+ }
1513
+ }
1514
+ function checkUsage(key, usages) {
1515
+ if (usages.length && !usages.some((expected) => key.usages.includes(expected))) {
1516
+ let msg = "CryptoKey does not support this operation, its usages must include ";
1517
+ if (usages.length > 2) {
1518
+ const last = usages.pop();
1519
+ msg += `one of ${usages.join(", ")}, or ${last}.`;
1520
+ } else if (usages.length === 2) {
1521
+ msg += `one of ${usages[0]} or ${usages[1]}.`;
1522
+ } else {
1523
+ msg += `${usages[0]}.`;
2185
1524
  }
1525
+ throw new TypeError(msg);
2186
1526
  }
2187
- if (typeof borderStyle === "string") {
2188
- characters = import_cli_boxes.default[borderStyle];
2189
- if (!characters) {
2190
- throw new TypeError(`Invalid border style: ${borderStyle}`);
1527
+ }
1528
+ function checkSigCryptoKey(key, alg, ...usages) {
1529
+ switch (alg) {
1530
+ case "HS256":
1531
+ case "HS384":
1532
+ case "HS512": {
1533
+ if (!isAlgorithm(key.algorithm, "HMAC"))
1534
+ throw unusable("HMAC");
1535
+ const expected = parseInt(alg.slice(2), 10);
1536
+ const actual = getHashLength(key.algorithm.hash);
1537
+ if (actual !== expected)
1538
+ throw unusable(`SHA-${expected}`, "algorithm.hash");
1539
+ break;
2191
1540
  }
2192
- } else {
2193
- if (typeof borderStyle?.vertical === "string") {
2194
- borderStyle.left = borderStyle.vertical;
2195
- borderStyle.right = borderStyle.vertical;
1541
+ case "RS256":
1542
+ case "RS384":
1543
+ case "RS512": {
1544
+ if (!isAlgorithm(key.algorithm, "RSASSA-PKCS1-v1_5"))
1545
+ throw unusable("RSASSA-PKCS1-v1_5");
1546
+ const expected = parseInt(alg.slice(2), 10);
1547
+ const actual = getHashLength(key.algorithm.hash);
1548
+ if (actual !== expected)
1549
+ throw unusable(`SHA-${expected}`, "algorithm.hash");
1550
+ break;
2196
1551
  }
2197
- if (typeof borderStyle?.horizontal === "string") {
2198
- borderStyle.top = borderStyle.horizontal;
2199
- borderStyle.bottom = borderStyle.horizontal;
1552
+ case "PS256":
1553
+ case "PS384":
1554
+ case "PS512": {
1555
+ if (!isAlgorithm(key.algorithm, "RSA-PSS"))
1556
+ throw unusable("RSA-PSS");
1557
+ const expected = parseInt(alg.slice(2), 10);
1558
+ const actual = getHashLength(key.algorithm.hash);
1559
+ if (actual !== expected)
1560
+ throw unusable(`SHA-${expected}`, "algorithm.hash");
1561
+ break;
2200
1562
  }
2201
- for (const side of sides) {
2202
- if (borderStyle[side] === null || typeof borderStyle[side] !== "string") {
2203
- throw new TypeError(`Invalid border style: ${side}`);
1563
+ case "EdDSA": {
1564
+ if (key.algorithm.name !== "Ed25519" && key.algorithm.name !== "Ed448") {
1565
+ throw unusable("Ed25519 or Ed448");
2204
1566
  }
2205
- }
2206
- characters = borderStyle;
2207
- }
2208
- return characters;
2209
- };
2210
- var makeTitle = (text, horizontal, alignment) => {
2211
- let title = "";
2212
- const textWidth = stringWidth(text);
2213
- switch (alignment) {
2214
- case "left": {
2215
- title = text + horizontal.slice(textWidth);
2216
1567
  break;
2217
1568
  }
2218
- case "right": {
2219
- title = horizontal.slice(textWidth) + text;
1569
+ case "Ed25519": {
1570
+ if (!isAlgorithm(key.algorithm, "Ed25519"))
1571
+ throw unusable("Ed25519");
2220
1572
  break;
2221
1573
  }
2222
- default: {
2223
- horizontal = horizontal.slice(textWidth);
2224
- if (horizontal.length % 2 === 1) {
2225
- horizontal = horizontal.slice(Math.floor(horizontal.length / 2));
2226
- title = horizontal.slice(1) + text + horizontal;
2227
- } else {
2228
- horizontal = horizontal.slice(horizontal.length / 2);
2229
- title = horizontal + text + horizontal;
2230
- }
1574
+ case "ES256":
1575
+ case "ES384":
1576
+ case "ES512": {
1577
+ if (!isAlgorithm(key.algorithm, "ECDSA"))
1578
+ throw unusable("ECDSA");
1579
+ const expected = getNamedCurve(alg);
1580
+ const actual = key.algorithm.namedCurve;
1581
+ if (actual !== expected)
1582
+ throw unusable(expected, "algorithm.namedCurve");
2231
1583
  break;
2232
1584
  }
1585
+ default:
1586
+ throw new TypeError("CryptoKey does not support this operation");
2233
1587
  }
2234
- return title;
1588
+ checkUsage(key, usages);
1589
+ }
1590
+
1591
+ // ../../node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/invalid_key_input.js
1592
+ function message(msg, actual, ...types4) {
1593
+ types4 = types4.filter(Boolean);
1594
+ if (types4.length > 2) {
1595
+ const last = types4.pop();
1596
+ msg += `one of type ${types4.join(", ")}, or ${last}.`;
1597
+ } else if (types4.length === 2) {
1598
+ msg += `one of type ${types4[0]} or ${types4[1]}.`;
1599
+ } else {
1600
+ msg += `of type ${types4[0]}.`;
1601
+ }
1602
+ if (actual == null) {
1603
+ msg += ` Received ${actual}`;
1604
+ } else if (typeof actual === "function" && actual.name) {
1605
+ msg += ` Received function ${actual.name}`;
1606
+ } else if (typeof actual === "object" && actual != null) {
1607
+ if (actual.constructor?.name) {
1608
+ msg += ` Received an instance of ${actual.constructor.name}`;
1609
+ }
1610
+ }
1611
+ return msg;
1612
+ }
1613
+ var invalid_key_input_default = (actual, ...types4) => {
1614
+ return message("Key must be ", actual, ...types4);
2235
1615
  };
2236
- var makeContentText = (text, { padding, width, textAlignment, height }) => {
2237
- text = (0, import_ansi_align.default)(text, { align: textAlignment });
2238
- let lines = text.split(NEWLINE);
2239
- const textWidth = widestLine(text);
2240
- const max = width - padding.left - padding.right;
2241
- if (textWidth > max) {
2242
- const newLines = [];
2243
- for (const line of lines) {
2244
- const createdLines = wrapAnsi(line, max, { hard: true });
2245
- const alignedLines = (0, import_ansi_align.default)(createdLines, { align: textAlignment });
2246
- const alignedLinesArray = alignedLines.split("\n");
2247
- const longestLength = Math.max(...alignedLinesArray.map((s) => stringWidth(s)));
2248
- for (const alignedLine of alignedLinesArray) {
2249
- let paddedLine;
2250
- switch (textAlignment) {
2251
- case "center": {
2252
- paddedLine = PAD.repeat((max - longestLength) / 2) + alignedLine;
2253
- break;
2254
- }
2255
- case "right": {
2256
- paddedLine = PAD.repeat(max - longestLength) + alignedLine;
2257
- break;
2258
- }
2259
- default: {
2260
- paddedLine = alignedLine;
2261
- break;
2262
- }
2263
- }
2264
- newLines.push(paddedLine);
1616
+ function withAlg(alg, actual, ...types4) {
1617
+ return message(`Key for the ${alg} algorithm must be `, actual, ...types4);
1618
+ }
1619
+
1620
+ // ../../node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/is_key_like.js
1621
+ var is_key_like_default = (key) => is_key_object_default(key) || isCryptoKey(key);
1622
+ var types3 = ["KeyObject"];
1623
+ if (globalThis.CryptoKey || webcrypto_default?.CryptoKey) {
1624
+ types3.push("CryptoKey");
1625
+ }
1626
+
1627
+ // ../../node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/is_disjoint.js
1628
+ var isDisjoint = (...headers) => {
1629
+ const sources = headers.filter(Boolean);
1630
+ if (sources.length === 0 || sources.length === 1) {
1631
+ return true;
1632
+ }
1633
+ let acc;
1634
+ for (const header of sources) {
1635
+ const parameters = Object.keys(header);
1636
+ if (!acc || acc.size === 0) {
1637
+ acc = new Set(parameters);
1638
+ continue;
1639
+ }
1640
+ for (const parameter of parameters) {
1641
+ if (acc.has(parameter)) {
1642
+ return false;
2265
1643
  }
1644
+ acc.add(parameter);
2266
1645
  }
2267
- lines = newLines;
2268
1646
  }
2269
- if (textAlignment === "center" && textWidth < max) {
2270
- lines = lines.map((line) => PAD.repeat((max - textWidth) / 2) + line);
2271
- } else if (textAlignment === "right" && textWidth < max) {
2272
- lines = lines.map((line) => PAD.repeat(max - textWidth) + line);
1647
+ return true;
1648
+ };
1649
+ var is_disjoint_default = isDisjoint;
1650
+
1651
+ // ../../node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/is_object.js
1652
+ function isObjectLike(value) {
1653
+ return typeof value === "object" && value !== null;
1654
+ }
1655
+ function isObject(input) {
1656
+ if (!isObjectLike(input) || Object.prototype.toString.call(input) !== "[object Object]") {
1657
+ return false;
2273
1658
  }
2274
- const paddingLeft = PAD.repeat(padding.left);
2275
- const paddingRight = PAD.repeat(padding.right);
2276
- lines = lines.map((line) => {
2277
- const newLine = paddingLeft + line + paddingRight;
2278
- return newLine + PAD.repeat(width - stringWidth(newLine));
2279
- });
2280
- if (padding.top > 0) {
2281
- lines = [...Array.from({ length: padding.top }).fill(PAD.repeat(width)), ...lines];
1659
+ if (Object.getPrototypeOf(input) === null) {
1660
+ return true;
2282
1661
  }
2283
- if (padding.bottom > 0) {
2284
- lines = [...lines, ...Array.from({ length: padding.bottom }).fill(PAD.repeat(width))];
1662
+ let proto = input;
1663
+ while (Object.getPrototypeOf(proto) !== null) {
1664
+ proto = Object.getPrototypeOf(proto);
2285
1665
  }
2286
- if (height && lines.length > height) {
2287
- lines = lines.slice(0, height);
2288
- } else if (height && lines.length < height) {
2289
- lines = [...lines, ...Array.from({ length: height - lines.length }).fill(PAD.repeat(width))];
1666
+ return Object.getPrototypeOf(input) === proto;
1667
+ }
1668
+
1669
+ // ../../node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/get_named_curve.js
1670
+ var import_node_crypto = require("crypto");
1671
+
1672
+ // ../../node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/is_jwk.js
1673
+ function isJWK(key) {
1674
+ return isObject(key) && typeof key.kty === "string";
1675
+ }
1676
+ function isPrivateJWK(key) {
1677
+ return key.kty !== "oct" && typeof key.d === "string";
1678
+ }
1679
+ function isPublicJWK(key) {
1680
+ return key.kty !== "oct" && typeof key.d === "undefined";
1681
+ }
1682
+ function isSecretJWK(key) {
1683
+ return isJWK(key) && key.kty === "oct" && typeof key.k === "string";
1684
+ }
1685
+
1686
+ // ../../node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/get_named_curve.js
1687
+ var namedCurveToJOSE = (namedCurve) => {
1688
+ switch (namedCurve) {
1689
+ case "prime256v1":
1690
+ return "P-256";
1691
+ case "secp384r1":
1692
+ return "P-384";
1693
+ case "secp521r1":
1694
+ return "P-521";
1695
+ case "secp256k1":
1696
+ return "secp256k1";
1697
+ default:
1698
+ throw new JOSENotSupported("Unsupported key curve for this operation");
2290
1699
  }
2291
- return lines.join(NEWLINE);
2292
1700
  };
2293
- var boxContent = (content, contentWidth, options) => {
2294
- const colorizeBorder = (border) => {
2295
- const newBorder = options.borderColor ? getColorFunction(options.borderColor)(border) : border;
2296
- return options.dimBorder ? import_chalk.default.dim(newBorder) : newBorder;
2297
- };
2298
- const colorizeContent = (content2) => options.backgroundColor ? getBGColorFunction(options.backgroundColor)(content2) : content2;
2299
- const chars = getBorderChars(options.borderStyle);
2300
- const columns = terminalColumns();
2301
- let marginLeft = PAD.repeat(options.margin.left);
2302
- if (options.float === "center") {
2303
- const marginWidth = Math.max((columns - contentWidth - getBorderWidth(options.borderStyle)) / 2, 0);
2304
- marginLeft = PAD.repeat(marginWidth);
2305
- } else if (options.float === "right") {
2306
- const marginWidth = Math.max(columns - contentWidth - options.margin.right - getBorderWidth(options.borderStyle), 0);
2307
- marginLeft = PAD.repeat(marginWidth);
1701
+ var getNamedCurve2 = (kee, raw) => {
1702
+ let key;
1703
+ if (isCryptoKey(kee)) {
1704
+ key = import_node_crypto.KeyObject.from(kee);
1705
+ } else if (is_key_object_default(kee)) {
1706
+ key = kee;
1707
+ } else if (isJWK(kee)) {
1708
+ return kee.crv;
1709
+ } else {
1710
+ throw new TypeError(invalid_key_input_default(kee, ...types3));
2308
1711
  }
2309
- let result = "";
2310
- if (options.margin.top) {
2311
- result += NEWLINE.repeat(options.margin.top);
1712
+ if (key.type === "secret") {
1713
+ throw new TypeError('only "private" or "public" type keys can be used for this operation');
2312
1714
  }
2313
- if (options.borderStyle !== NONE || options.title) {
2314
- result += colorizeBorder(marginLeft + chars.topLeft + (options.title ? makeTitle(options.title, chars.top.repeat(contentWidth), options.titleAlignment) : chars.top.repeat(contentWidth)) + chars.topRight) + NEWLINE;
1715
+ switch (key.asymmetricKeyType) {
1716
+ case "ed25519":
1717
+ case "ed448":
1718
+ return `Ed${key.asymmetricKeyType.slice(2)}`;
1719
+ case "x25519":
1720
+ case "x448":
1721
+ return `X${key.asymmetricKeyType.slice(1)}`;
1722
+ case "ec": {
1723
+ const namedCurve = key.asymmetricKeyDetails.namedCurve;
1724
+ if (raw) {
1725
+ return namedCurve;
1726
+ }
1727
+ return namedCurveToJOSE(namedCurve);
1728
+ }
1729
+ default:
1730
+ throw new TypeError("Invalid asymmetric key type for this operation");
2315
1731
  }
2316
- const lines = content.split(NEWLINE);
2317
- result += lines.map((line) => marginLeft + colorizeBorder(chars.left) + colorizeContent(line) + colorizeBorder(chars.right)).join(NEWLINE);
2318
- if (options.borderStyle !== NONE) {
2319
- result += NEWLINE + colorizeBorder(marginLeft + chars.bottomLeft + chars.bottom.repeat(contentWidth) + chars.bottomRight);
1732
+ };
1733
+ var get_named_curve_default = getNamedCurve2;
1734
+
1735
+ // ../../node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/check_key_length.js
1736
+ var import_node_crypto2 = require("crypto");
1737
+ var check_key_length_default = (key, alg) => {
1738
+ let modulusLength;
1739
+ try {
1740
+ if (key instanceof import_node_crypto2.KeyObject) {
1741
+ modulusLength = key.asymmetricKeyDetails?.modulusLength;
1742
+ } else {
1743
+ modulusLength = Buffer.from(key.n, "base64url").byteLength << 3;
1744
+ }
1745
+ } catch {
2320
1746
  }
2321
- if (options.margin.bottom) {
2322
- result += NEWLINE.repeat(options.margin.bottom);
1747
+ if (typeof modulusLength !== "number" || modulusLength < 2048) {
1748
+ throw new TypeError(`${alg} requires key modulusLength to be 2048 bits or larger`);
2323
1749
  }
2324
- return result;
2325
1750
  };
2326
- var sanitizeOptions = (options) => {
2327
- if (options.fullscreen && import_node_process.default?.stdout) {
2328
- let newDimensions = [import_node_process.default.stdout.columns, import_node_process.default.stdout.rows];
2329
- if (typeof options.fullscreen === "function") {
2330
- newDimensions = options.fullscreen(...newDimensions);
2331
- }
2332
- options.width || (options.width = newDimensions[0]);
2333
- options.height || (options.height = newDimensions[1]);
1751
+
1752
+ // ../../node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/asn1.js
1753
+ var import_node_crypto3 = require("crypto");
1754
+ var import_node_buffer2 = require("buffer");
1755
+ var fromSPKI = (pem) => (0, import_node_crypto3.createPublicKey)({
1756
+ key: import_node_buffer2.Buffer.from(pem.replace(/(?:-----(?:BEGIN|END) PUBLIC KEY-----|\s)/g, ""), "base64"),
1757
+ type: "spki",
1758
+ format: "der"
1759
+ });
1760
+
1761
+ // ../../node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/jwk_to_key.js
1762
+ var import_node_crypto4 = require("crypto");
1763
+ var parse = (key) => {
1764
+ if (key.d) {
1765
+ return (0, import_node_crypto4.createPrivateKey)({ format: "jwk", key });
2334
1766
  }
2335
- options.width && (options.width = Math.max(1, options.width - getBorderWidth(options.borderStyle)));
2336
- options.height && (options.height = Math.max(1, options.height - getBorderWidth(options.borderStyle)));
2337
- return options;
1767
+ return (0, import_node_crypto4.createPublicKey)({ format: "jwk", key });
2338
1768
  };
2339
- var formatTitle = (title, borderStyle) => borderStyle === NONE ? title : ` ${title} `;
2340
- var determineDimensions = (text, options) => {
2341
- options = sanitizeOptions(options);
2342
- const widthOverride = options.width !== void 0;
2343
- const columns = terminalColumns();
2344
- const borderWidth = getBorderWidth(options.borderStyle);
2345
- const maxWidth = columns - options.margin.left - options.margin.right - borderWidth;
2346
- const widest = widestLine(wrapAnsi(text, columns - borderWidth, { hard: true, trim: false })) + options.padding.left + options.padding.right;
2347
- if (options.title && widthOverride) {
2348
- options.title = options.title.slice(0, Math.max(0, options.width - 2));
2349
- options.title && (options.title = formatTitle(options.title, options.borderStyle));
2350
- } else if (options.title) {
2351
- options.title = options.title.slice(0, Math.max(0, maxWidth - 2));
2352
- if (options.title) {
2353
- options.title = formatTitle(options.title, options.borderStyle);
2354
- if (stringWidth(options.title) > widest) {
2355
- options.width = stringWidth(options.title);
2356
- }
2357
- }
1769
+ var jwk_to_key_default = parse;
1770
+
1771
+ // ../../node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/key/import.js
1772
+ async function importSPKI(spki, alg, options) {
1773
+ if (typeof spki !== "string" || spki.indexOf("-----BEGIN PUBLIC KEY-----") !== 0) {
1774
+ throw new TypeError('"spki" must be SPKI formatted string');
2358
1775
  }
2359
- options.width || (options.width = widest);
2360
- if (!widthOverride) {
2361
- if (options.margin.left && options.margin.right && options.width > maxWidth) {
2362
- const spaceForMargins = columns - options.width - borderWidth;
2363
- const multiplier = spaceForMargins / (options.margin.left + options.margin.right);
2364
- options.margin.left = Math.max(0, Math.floor(options.margin.left * multiplier));
2365
- options.margin.right = Math.max(0, Math.floor(options.margin.right * multiplier));
2366
- }
2367
- options.width = Math.min(options.width, columns - borderWidth - options.margin.left - options.margin.right);
1776
+ return fromSPKI(spki, alg, options);
1777
+ }
1778
+ async function importJWK(jwk, alg) {
1779
+ if (!isObject(jwk)) {
1780
+ throw new TypeError("JWK must be an object");
1781
+ }
1782
+ alg || (alg = jwk.alg);
1783
+ switch (jwk.kty) {
1784
+ case "oct":
1785
+ if (typeof jwk.k !== "string" || !jwk.k) {
1786
+ throw new TypeError('missing "k" (Key Value) Parameter value');
1787
+ }
1788
+ return decode(jwk.k);
1789
+ case "RSA":
1790
+ if ("oth" in jwk && jwk.oth !== void 0) {
1791
+ throw new JOSENotSupported('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');
1792
+ }
1793
+ case "EC":
1794
+ case "OKP":
1795
+ return jwk_to_key_default({ ...jwk, alg });
1796
+ default:
1797
+ throw new JOSENotSupported('Unsupported "kty" (Key Type) Parameter value');
2368
1798
  }
2369
- if (options.width - (options.padding.left + options.padding.right) <= 0) {
2370
- options.padding.left = 0;
2371
- options.padding.right = 0;
1799
+ }
1800
+
1801
+ // ../../node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/check_key_type.js
1802
+ var tag = (key) => key?.[Symbol.toStringTag];
1803
+ var jwkMatchesOp = (alg, key, usage) => {
1804
+ if (key.use !== void 0 && key.use !== "sig") {
1805
+ throw new TypeError("Invalid key for this operation, when present its use must be sig");
2372
1806
  }
2373
- if (options.height && options.height - (options.padding.top + options.padding.bottom) <= 0) {
2374
- options.padding.top = 0;
2375
- options.padding.bottom = 0;
1807
+ if (key.key_ops !== void 0 && key.key_ops.includes?.(usage) !== true) {
1808
+ throw new TypeError(`Invalid key for this operation, when present its key_ops must include ${usage}`);
2376
1809
  }
2377
- return options;
1810
+ if (key.alg !== void 0 && key.alg !== alg) {
1811
+ throw new TypeError(`Invalid key for this operation, when present its alg must be ${alg}`);
1812
+ }
1813
+ return true;
2378
1814
  };
2379
- var isHex = (color) => color.match(/^#(?:[0-f]{3}){1,2}$/i);
2380
- var isColorValid = (color) => typeof color === "string" && (import_chalk.default[color] ?? isHex(color));
2381
- var getColorFunction = (color) => isHex(color) ? import_chalk.default.hex(color) : import_chalk.default[color];
2382
- var getBGColorFunction = (color) => isHex(color) ? import_chalk.default.bgHex(color) : import_chalk.default[camelCase(["bg", color])];
2383
- function boxen(text, options) {
2384
- options = {
2385
- padding: 0,
2386
- borderStyle: "single",
2387
- dimBorder: false,
2388
- textAlignment: "left",
2389
- float: "left",
2390
- titleAlignment: "left",
2391
- ...options
2392
- };
2393
- if (options.align) {
2394
- options.textAlignment = options.align;
1815
+ var symmetricTypeCheck = (alg, key, usage, allowJwk) => {
1816
+ if (key instanceof Uint8Array)
1817
+ return;
1818
+ if (allowJwk && isJWK(key)) {
1819
+ if (isSecretJWK(key) && jwkMatchesOp(alg, key, usage))
1820
+ return;
1821
+ throw new TypeError(`JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present`);
2395
1822
  }
2396
- if (options.borderColor && !isColorValid(options.borderColor)) {
2397
- throw new Error(`${options.borderColor} is not a valid borderColor`);
1823
+ if (!is_key_like_default(key)) {
1824
+ throw new TypeError(withAlg(alg, key, ...types3, "Uint8Array", allowJwk ? "JSON Web Key" : null));
2398
1825
  }
2399
- if (options.backgroundColor && !isColorValid(options.backgroundColor)) {
2400
- throw new Error(`${options.backgroundColor} is not a valid backgroundColor`);
1826
+ if (key.type !== "secret") {
1827
+ throw new TypeError(`${tag(key)} instances for symmetric algorithms must be of type "secret"`);
1828
+ }
1829
+ };
1830
+ var asymmetricTypeCheck = (alg, key, usage, allowJwk) => {
1831
+ if (allowJwk && isJWK(key)) {
1832
+ switch (usage) {
1833
+ case "sign":
1834
+ if (isPrivateJWK(key) && jwkMatchesOp(alg, key, usage))
1835
+ return;
1836
+ throw new TypeError(`JSON Web Key for this operation be a private JWK`);
1837
+ case "verify":
1838
+ if (isPublicJWK(key) && jwkMatchesOp(alg, key, usage))
1839
+ return;
1840
+ throw new TypeError(`JSON Web Key for this operation be a public JWK`);
1841
+ }
1842
+ }
1843
+ if (!is_key_like_default(key)) {
1844
+ throw new TypeError(withAlg(alg, key, ...types3, allowJwk ? "JSON Web Key" : null));
1845
+ }
1846
+ if (key.type === "secret") {
1847
+ throw new TypeError(`${tag(key)} instances for asymmetric algorithms must not be of type "secret"`);
1848
+ }
1849
+ if (usage === "sign" && key.type === "public") {
1850
+ throw new TypeError(`${tag(key)} instances for asymmetric algorithm signing must be of type "private"`);
1851
+ }
1852
+ if (usage === "decrypt" && key.type === "public") {
1853
+ throw new TypeError(`${tag(key)} instances for asymmetric algorithm decryption must be of type "private"`);
1854
+ }
1855
+ if (key.algorithm && usage === "verify" && key.type === "private") {
1856
+ throw new TypeError(`${tag(key)} instances for asymmetric algorithm verifying must be of type "public"`);
1857
+ }
1858
+ if (key.algorithm && usage === "encrypt" && key.type === "private") {
1859
+ throw new TypeError(`${tag(key)} instances for asymmetric algorithm encryption must be of type "public"`);
1860
+ }
1861
+ };
1862
+ function checkKeyType(allowJwk, alg, key, usage) {
1863
+ const symmetric = alg.startsWith("HS") || alg === "dir" || alg.startsWith("PBES2") || /^A\d{3}(?:GCM)?KW$/.test(alg);
1864
+ if (symmetric) {
1865
+ symmetricTypeCheck(alg, key, usage, allowJwk);
1866
+ } else {
1867
+ asymmetricTypeCheck(alg, key, usage, allowJwk);
2401
1868
  }
2402
- options.padding = getObject(options.padding);
2403
- options.margin = getObject(options.margin);
2404
- options = determineDimensions(text, options);
2405
- text = makeContentText(text, options);
2406
- return boxContent(text, options.width, options);
2407
1869
  }
1870
+ var check_key_type_default = checkKeyType.bind(void 0, false);
1871
+ var checkKeyTypeWithJwk = checkKeyType.bind(void 0, true);
2408
1872
 
2409
- // ../../shared/check-for-package-update.ts
2410
- var import_fs = __toESM(require("fs"));
2411
- var import_path = __toESM(require("path"));
2412
- var getInstalledVersionOfPackage = (packageName) => {
2413
- try {
2414
- const PROJECT_DIR = process.env.PROJECT_DIR || process.cwd();
2415
- const pkg = import_fs.default.readFileSync(import_path.default.join(PROJECT_DIR, "package.json"), "utf8");
2416
- const json = JSON.parse(pkg);
2417
- const version = json.dependencies[packageName];
2418
- return version?.replace(/[\^~><=]/g, "");
2419
- } catch (error) {
2420
- return null;
1873
+ // ../../node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/validate_crit.js
1874
+ function validateCrit(Err, recognizedDefault, recognizedOption, protectedHeader, joseHeader) {
1875
+ if (joseHeader.crit !== void 0 && protectedHeader?.crit === void 0) {
1876
+ throw new Err('"crit" (Critical) Header Parameter MUST be integrity protected');
2421
1877
  }
2422
- };
2423
- async function checkForPackageUpdate(packageName) {
2424
- const installedVersion = getInstalledVersionOfPackage(packageName);
2425
- if (!installedVersion || installedVersion === "latest") return;
2426
- const pkg = { name: packageName, version: installedVersion };
2427
- const updateNotifierModule = await import("update-notifier");
2428
- const notifier = updateNotifierModule.default({ pkg, updateCheckInterval: 0, shouldNotifyInNpmScript: true });
2429
- const info = await notifier.fetchInfo();
2430
- if (info?.type !== "latest") {
2431
- const message = `Package ${packageName} update available ${info.current} \u2192 ${info.latest}
2432
- Run npm i ${packageName} to update`;
2433
- console.log(
2434
- boxen(message, {
2435
- padding: 1,
2436
- margin: 1,
2437
- align: "center",
2438
- borderColor: "yellow",
2439
- borderStyle: {
2440
- topLeft: " ",
2441
- topRight: " ",
2442
- bottomLeft: " ",
2443
- bottomRight: " ",
2444
- right: " ",
2445
- top: "-",
2446
- bottom: "-",
2447
- left: " "
2448
- }
2449
- })
2450
- );
1878
+ if (!protectedHeader || protectedHeader.crit === void 0) {
1879
+ return /* @__PURE__ */ new Set();
1880
+ }
1881
+ if (!Array.isArray(protectedHeader.crit) || protectedHeader.crit.length === 0 || protectedHeader.crit.some((input) => typeof input !== "string" || input.length === 0)) {
1882
+ throw new Err('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');
1883
+ }
1884
+ let recognized;
1885
+ if (recognizedOption !== void 0) {
1886
+ recognized = new Map([...Object.entries(recognizedOption), ...recognizedDefault.entries()]);
1887
+ } else {
1888
+ recognized = recognizedDefault;
1889
+ }
1890
+ for (const parameter of protectedHeader.crit) {
1891
+ if (!recognized.has(parameter)) {
1892
+ throw new JOSENotSupported(`Extension Header Parameter "${parameter}" is not recognized`);
1893
+ }
1894
+ if (joseHeader[parameter] === void 0) {
1895
+ throw new Err(`Extension Header Parameter "${parameter}" is missing`);
1896
+ }
1897
+ if (recognized.get(parameter) && protectedHeader[parameter] === void 0) {
1898
+ throw new Err(`Extension Header Parameter "${parameter}" MUST be integrity protected`);
1899
+ }
2451
1900
  }
1901
+ return new Set(protectedHeader.crit);
2452
1902
  }
1903
+ var validate_crit_default = validateCrit;
2453
1904
 
2454
- // src/index.ts
2455
- var import_avro_schema_parser = require("@asyncapi/avro-schema-parser");
2456
-
2457
- // src/utils/schemas.ts
2458
- var getFileExtentionFromSchemaFormat = (format = "") => {
2459
- if (format.includes("avro")) return "avsc";
2460
- if (format.includes("yml")) return "yml";
2461
- if (format.includes("json")) return "json";
2462
- if (format.includes("openapi")) return "openapi";
2463
- if (format.includes("protobuf")) return "protobuf";
2464
- if (format.includes("yaml")) return "yaml";
2465
- return "json";
1905
+ // ../../node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/validate_algorithms.js
1906
+ var validateAlgorithms = (option, algorithms) => {
1907
+ if (algorithms !== void 0 && (!Array.isArray(algorithms) || algorithms.some((s) => typeof s !== "string"))) {
1908
+ throw new TypeError(`"${option}" option must be an array of strings`);
1909
+ }
1910
+ if (!algorithms) {
1911
+ return void 0;
1912
+ }
1913
+ return new Set(algorithms);
2466
1914
  };
1915
+ var validate_algorithms_default = validateAlgorithms;
2467
1916
 
2468
- // src/utils/messages.ts
2469
- var defaultMarkdown = (_document, message) => {
2470
- return `
2471
- ## Architecture
2472
- <NodeGraph />
2473
-
2474
- ${messageHasSchema(message) && messageIsJSON(message) ? `
2475
- ## Schema
2476
- <SchemaViewer file="${getSchemaFileName(message)}" title="Message Schema" maxHeight="500" />
2477
- ` : ""}
2478
- ${messageHasSchema(message) && !messageIsJSON(message) ? `
2479
- ## Schema
2480
- <Schema file="${getSchemaFileName(message)}" title="Message Schema" maxHeight="500" />
2481
- ` : ""}
1917
+ // ../../node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/verify.js
1918
+ var crypto3 = __toESM(require("crypto"), 1);
1919
+ var import_node_util2 = require("util");
2482
1920
 
2483
- ${message.externalDocs() ? `
2484
- ## External documentation
2485
- - [${message.externalDocs()?.description()}](${message.externalDocs()?.url()})
2486
- ` : ""}
1921
+ // ../../node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/dsa_digest.js
1922
+ function dsaDigest(alg) {
1923
+ switch (alg) {
1924
+ case "PS256":
1925
+ case "RS256":
1926
+ case "ES256":
1927
+ case "ES256K":
1928
+ return "sha256";
1929
+ case "PS384":
1930
+ case "RS384":
1931
+ case "ES384":
1932
+ return "sha384";
1933
+ case "PS512":
1934
+ case "RS512":
1935
+ case "ES512":
1936
+ return "sha512";
1937
+ case "Ed25519":
1938
+ case "EdDSA":
1939
+ return void 0;
1940
+ default:
1941
+ throw new JOSENotSupported(`alg ${alg} is not supported either by JOSE or your javascript runtime`);
1942
+ }
1943
+ }
2487
1944
 
2488
- `;
2489
- };
2490
- var getSummary = (message) => {
2491
- const messageSummary = message.hasSummary() ? message.summary() : "";
2492
- const messageDescription = message.hasDescription() ? message.description() : "";
2493
- let eventCatalogMessageSummary = messageSummary;
2494
- if (!eventCatalogMessageSummary) {
2495
- eventCatalogMessageSummary = messageDescription && messageDescription.length < 150 ? messageDescription : "";
1945
+ // ../../node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/node_key.js
1946
+ var import_node_crypto5 = require("crypto");
1947
+ var ecCurveAlgMap = /* @__PURE__ */ new Map([
1948
+ ["ES256", "P-256"],
1949
+ ["ES256K", "secp256k1"],
1950
+ ["ES384", "P-384"],
1951
+ ["ES512", "P-521"]
1952
+ ]);
1953
+ function keyForCrypto(alg, key) {
1954
+ let asymmetricKeyType;
1955
+ let asymmetricKeyDetails;
1956
+ let isJWK2;
1957
+ if (key instanceof import_node_crypto5.KeyObject) {
1958
+ asymmetricKeyType = key.asymmetricKeyType;
1959
+ asymmetricKeyDetails = key.asymmetricKeyDetails;
1960
+ } else {
1961
+ isJWK2 = true;
1962
+ switch (key.kty) {
1963
+ case "RSA":
1964
+ asymmetricKeyType = "rsa";
1965
+ break;
1966
+ case "EC":
1967
+ asymmetricKeyType = "ec";
1968
+ break;
1969
+ case "OKP": {
1970
+ if (key.crv === "Ed25519") {
1971
+ asymmetricKeyType = "ed25519";
1972
+ break;
1973
+ }
1974
+ if (key.crv === "Ed448") {
1975
+ asymmetricKeyType = "ed448";
1976
+ break;
1977
+ }
1978
+ throw new TypeError("Invalid key for this operation, its crv must be Ed25519 or Ed448");
1979
+ }
1980
+ default:
1981
+ throw new TypeError("Invalid key for this operation, its kty must be RSA, OKP, or EC");
1982
+ }
2496
1983
  }
2497
- return eventCatalogMessageSummary;
2498
- };
2499
- var messageHasSchema = (message) => {
2500
- return message.hasPayload() && message.schemaFormat();
2501
- };
2502
- var messageIsJSON = (message) => {
2503
- const fileName = getSchemaFileName(message);
2504
- return fileName.endsWith(".json");
2505
- };
2506
- var getSchemaFileName = (message) => {
2507
- const extension = getFileExtentionFromSchemaFormat(message.schemaFormat());
2508
- return `schema.${extension}`;
2509
- };
2510
- var getMessageName = (message) => {
2511
- return message.hasTitle() && message.title() ? message.title() : message.id();
2512
- };
2513
- var getChannelsForMessage = (message, channels, document2) => {
2514
- let channelsForMessage = [];
2515
- const globalVersion = document2.info().version();
2516
- for (const channel of channels) {
2517
- for (const channelMessage of channel.messages()) {
2518
- if (channelMessage.id() === message.id()) {
2519
- channelsForMessage.push(channel);
1984
+ let options;
1985
+ switch (alg) {
1986
+ case "Ed25519":
1987
+ if (asymmetricKeyType !== "ed25519") {
1988
+ throw new TypeError(`Invalid key for this operation, its asymmetricKeyType must be ed25519`);
1989
+ }
1990
+ break;
1991
+ case "EdDSA":
1992
+ if (!["ed25519", "ed448"].includes(asymmetricKeyType)) {
1993
+ throw new TypeError("Invalid key for this operation, its asymmetricKeyType must be ed25519 or ed448");
1994
+ }
1995
+ break;
1996
+ case "RS256":
1997
+ case "RS384":
1998
+ case "RS512":
1999
+ if (asymmetricKeyType !== "rsa") {
2000
+ throw new TypeError("Invalid key for this operation, its asymmetricKeyType must be rsa");
2520
2001
  }
2002
+ check_key_length_default(key, alg);
2003
+ break;
2004
+ case "PS256":
2005
+ case "PS384":
2006
+ case "PS512":
2007
+ if (asymmetricKeyType === "rsa-pss") {
2008
+ const { hashAlgorithm, mgf1HashAlgorithm, saltLength } = asymmetricKeyDetails;
2009
+ const length = parseInt(alg.slice(-3), 10);
2010
+ if (hashAlgorithm !== void 0 && (hashAlgorithm !== `sha${length}` || mgf1HashAlgorithm !== hashAlgorithm)) {
2011
+ throw new TypeError(`Invalid key for this operation, its RSA-PSS parameters do not meet the requirements of "alg" ${alg}`);
2012
+ }
2013
+ if (saltLength !== void 0 && saltLength > length >> 3) {
2014
+ throw new TypeError(`Invalid key for this operation, its RSA-PSS parameter saltLength does not meet the requirements of "alg" ${alg}`);
2015
+ }
2016
+ } else if (asymmetricKeyType !== "rsa") {
2017
+ throw new TypeError("Invalid key for this operation, its asymmetricKeyType must be rsa or rsa-pss");
2018
+ }
2019
+ check_key_length_default(key, alg);
2020
+ options = {
2021
+ padding: import_node_crypto5.constants.RSA_PKCS1_PSS_PADDING,
2022
+ saltLength: import_node_crypto5.constants.RSA_PSS_SALTLEN_DIGEST
2023
+ };
2024
+ break;
2025
+ case "ES256":
2026
+ case "ES256K":
2027
+ case "ES384":
2028
+ case "ES512": {
2029
+ if (asymmetricKeyType !== "ec") {
2030
+ throw new TypeError("Invalid key for this operation, its asymmetricKeyType must be ec");
2031
+ }
2032
+ const actual = get_named_curve_default(key);
2033
+ const expected = ecCurveAlgMap.get(alg);
2034
+ if (actual !== expected) {
2035
+ throw new TypeError(`Invalid key curve for the algorithm, its curve must be ${expected}, got ${actual}`);
2036
+ }
2037
+ options = { dsaEncoding: "ieee-p1363" };
2038
+ break;
2521
2039
  }
2040
+ default:
2041
+ throw new JOSENotSupported(`alg ${alg} is not supported either by JOSE or your javascript runtime`);
2522
2042
  }
2523
- for (const messageChannel of message.channels()) {
2524
- channelsForMessage.push(messageChannel);
2043
+ if (isJWK2) {
2044
+ return { format: "jwk", key, ...options };
2525
2045
  }
2526
- const uniqueChannels = channelsForMessage.filter(
2527
- (channel, index, self) => index === self.findIndex((t) => t.id() === channel.id())
2528
- );
2529
- return uniqueChannels.map((channel) => {
2530
- const channelVersion = channel.extensions().get("x-eventcatalog-channel-version")?.value() || globalVersion;
2531
- return {
2532
- id: channel.id(),
2533
- version: channelVersion
2534
- };
2535
- });
2536
- };
2046
+ return options ? { ...options, key } : key;
2047
+ }
2537
2048
 
2538
- // src/utils/services.ts
2539
- var defaultMarkdown2 = (document2) => {
2540
- return `
2049
+ // ../../node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/sign.js
2050
+ var crypto2 = __toESM(require("crypto"), 1);
2051
+ var import_node_util = require("util");
2541
2052
 
2542
- ${document2.info().hasDescription() ? `${document2.info().description()}` : ""}
2053
+ // ../../node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/hmac_digest.js
2054
+ function hmacDigest(alg) {
2055
+ switch (alg) {
2056
+ case "HS256":
2057
+ return "sha256";
2058
+ case "HS384":
2059
+ return "sha384";
2060
+ case "HS512":
2061
+ return "sha512";
2062
+ default:
2063
+ throw new JOSENotSupported(`alg ${alg} is not supported either by JOSE or your javascript runtime`);
2064
+ }
2065
+ }
2543
2066
 
2544
- ## Architecture diagram
2545
- <NodeGraph />
2067
+ // ../../node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/get_sign_verify_key.js
2068
+ var import_node_crypto6 = require("crypto");
2069
+ function getSignVerifyKey(alg, key, usage) {
2070
+ if (key instanceof Uint8Array) {
2071
+ if (!alg.startsWith("HS")) {
2072
+ throw new TypeError(invalid_key_input_default(key, ...types3));
2073
+ }
2074
+ return (0, import_node_crypto6.createSecretKey)(key);
2075
+ }
2076
+ if (key instanceof import_node_crypto6.KeyObject) {
2077
+ return key;
2078
+ }
2079
+ if (isCryptoKey(key)) {
2080
+ checkSigCryptoKey(key, alg, usage);
2081
+ return import_node_crypto6.KeyObject.from(key);
2082
+ }
2083
+ if (isJWK(key)) {
2084
+ if (alg.startsWith("HS")) {
2085
+ return (0, import_node_crypto6.createSecretKey)(Buffer.from(key.k, "base64url"));
2086
+ }
2087
+ return key;
2088
+ }
2089
+ throw new TypeError(invalid_key_input_default(key, ...types3, "Uint8Array", "JSON Web Key"));
2090
+ }
2546
2091
 
2547
- ${document2.info().externalDocs() ? `
2548
- ## External documentation
2549
- - [${document2.info().externalDocs()?.description()}](${document2.info().externalDocs()?.url()})
2550
- ` : ""}
2551
- `;
2092
+ // ../../node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/sign.js
2093
+ var oneShotSign = (0, import_node_util.promisify)(crypto2.sign);
2094
+ var sign2 = async (alg, key, data) => {
2095
+ const k = getSignVerifyKey(alg, key, "sign");
2096
+ if (alg.startsWith("HS")) {
2097
+ const hmac = crypto2.createHmac(hmacDigest(alg), k);
2098
+ hmac.update(data);
2099
+ return hmac.digest();
2100
+ }
2101
+ return oneShotSign(dsaDigest(alg), data, keyForCrypto(alg, k));
2552
2102
  };
2553
- var getSummary2 = (document2) => {
2554
- const summary = document2.info().hasDescription() ? document2.info().description() : "";
2555
- return summary && summary.length < 150 ? summary : "";
2103
+ var sign_default = sign2;
2104
+
2105
+ // ../../node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/runtime/verify.js
2106
+ var oneShotVerify = (0, import_node_util2.promisify)(crypto3.verify);
2107
+ var verify2 = async (alg, key, signature, data) => {
2108
+ const k = getSignVerifyKey(alg, key, "verify");
2109
+ if (alg.startsWith("HS")) {
2110
+ const expected = await sign_default(alg, k, data);
2111
+ const actual = signature;
2112
+ try {
2113
+ return crypto3.timingSafeEqual(actual, expected);
2114
+ } catch {
2115
+ return false;
2116
+ }
2117
+ }
2118
+ const algorithm = dsaDigest(alg);
2119
+ const keyInput = keyForCrypto(alg, k);
2120
+ try {
2121
+ return await oneShotVerify(algorithm, data, keyInput, signature);
2122
+ } catch {
2123
+ return false;
2124
+ }
2556
2125
  };
2126
+ var verify_default = verify2;
2557
2127
 
2558
- // src/utils/domains.ts
2559
- var defaultMarkdown3 = (document2) => {
2560
- return `
2128
+ // ../../node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/jws/flattened/verify.js
2129
+ async function flattenedVerify(jws, key, options) {
2130
+ if (!isObject(jws)) {
2131
+ throw new JWSInvalid("Flattened JWS must be an object");
2132
+ }
2133
+ if (jws.protected === void 0 && jws.header === void 0) {
2134
+ throw new JWSInvalid('Flattened JWS must have either of the "protected" or "header" members');
2135
+ }
2136
+ if (jws.protected !== void 0 && typeof jws.protected !== "string") {
2137
+ throw new JWSInvalid("JWS Protected Header incorrect type");
2138
+ }
2139
+ if (jws.payload === void 0) {
2140
+ throw new JWSInvalid("JWS Payload missing");
2141
+ }
2142
+ if (typeof jws.signature !== "string") {
2143
+ throw new JWSInvalid("JWS Signature missing or incorrect type");
2144
+ }
2145
+ if (jws.header !== void 0 && !isObject(jws.header)) {
2146
+ throw new JWSInvalid("JWS Unprotected Header incorrect type");
2147
+ }
2148
+ let parsedProt = {};
2149
+ if (jws.protected) {
2150
+ try {
2151
+ const protectedHeader = decode(jws.protected);
2152
+ parsedProt = JSON.parse(decoder.decode(protectedHeader));
2153
+ } catch {
2154
+ throw new JWSInvalid("JWS Protected Header is invalid");
2155
+ }
2156
+ }
2157
+ if (!is_disjoint_default(parsedProt, jws.header)) {
2158
+ throw new JWSInvalid("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");
2159
+ }
2160
+ const joseHeader = {
2161
+ ...parsedProt,
2162
+ ...jws.header
2163
+ };
2164
+ const extensions = validate_crit_default(JWSInvalid, /* @__PURE__ */ new Map([["b64", true]]), options?.crit, parsedProt, joseHeader);
2165
+ let b64 = true;
2166
+ if (extensions.has("b64")) {
2167
+ b64 = parsedProt.b64;
2168
+ if (typeof b64 !== "boolean") {
2169
+ throw new JWSInvalid('The "b64" (base64url-encode payload) Header Parameter must be a boolean');
2170
+ }
2171
+ }
2172
+ const { alg } = joseHeader;
2173
+ if (typeof alg !== "string" || !alg) {
2174
+ throw new JWSInvalid('JWS "alg" (Algorithm) Header Parameter missing or invalid');
2175
+ }
2176
+ const algorithms = options && validate_algorithms_default("algorithms", options.algorithms);
2177
+ if (algorithms && !algorithms.has(alg)) {
2178
+ throw new JOSEAlgNotAllowed('"alg" (Algorithm) Header Parameter value not allowed');
2179
+ }
2180
+ if (b64) {
2181
+ if (typeof jws.payload !== "string") {
2182
+ throw new JWSInvalid("JWS Payload must be a string");
2183
+ }
2184
+ } else if (typeof jws.payload !== "string" && !(jws.payload instanceof Uint8Array)) {
2185
+ throw new JWSInvalid("JWS Payload must be a string or an Uint8Array instance");
2186
+ }
2187
+ let resolvedKey = false;
2188
+ if (typeof key === "function") {
2189
+ key = await key(parsedProt, jws);
2190
+ resolvedKey = true;
2191
+ checkKeyTypeWithJwk(alg, key, "verify");
2192
+ if (isJWK(key)) {
2193
+ key = await importJWK(key, alg);
2194
+ }
2195
+ } else {
2196
+ checkKeyTypeWithJwk(alg, key, "verify");
2197
+ }
2198
+ const data = concat(encoder.encode(jws.protected ?? ""), encoder.encode("."), typeof jws.payload === "string" ? encoder.encode(jws.payload) : jws.payload);
2199
+ let signature;
2200
+ try {
2201
+ signature = decode(jws.signature);
2202
+ } catch {
2203
+ throw new JWSInvalid("Failed to base64url decode the signature");
2204
+ }
2205
+ const verified = await verify_default(alg, key, signature, data);
2206
+ if (!verified) {
2207
+ throw new JWSSignatureVerificationFailed();
2208
+ }
2209
+ let payload;
2210
+ if (b64) {
2211
+ try {
2212
+ payload = decode(jws.payload);
2213
+ } catch {
2214
+ throw new JWSInvalid("Failed to base64url decode the payload");
2215
+ }
2216
+ } else if (typeof jws.payload === "string") {
2217
+ payload = encoder.encode(jws.payload);
2218
+ } else {
2219
+ payload = jws.payload;
2220
+ }
2221
+ const result = { payload };
2222
+ if (jws.protected !== void 0) {
2223
+ result.protectedHeader = parsedProt;
2224
+ }
2225
+ if (jws.header !== void 0) {
2226
+ result.unprotectedHeader = jws.header;
2227
+ }
2228
+ if (resolvedKey) {
2229
+ return { ...result, key };
2230
+ }
2231
+ return result;
2232
+ }
2561
2233
 
2562
- ## Architecture diagram
2563
- <NodeGraph />
2234
+ // ../../node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/jws/compact/verify.js
2235
+ async function compactVerify(jws, key, options) {
2236
+ if (jws instanceof Uint8Array) {
2237
+ jws = decoder.decode(jws);
2238
+ }
2239
+ if (typeof jws !== "string") {
2240
+ throw new JWSInvalid("Compact JWS must be a string or Uint8Array");
2241
+ }
2242
+ const { 0: protectedHeader, 1: payload, 2: signature, length } = jws.split(".");
2243
+ if (length !== 3) {
2244
+ throw new JWSInvalid("Invalid Compact JWS");
2245
+ }
2246
+ const verified = await flattenedVerify({ payload, protected: protectedHeader, signature }, key, options);
2247
+ const result = { payload: verified.payload, protectedHeader: verified.protectedHeader };
2248
+ if (typeof key === "function") {
2249
+ return { ...result, key: verified.key };
2250
+ }
2251
+ return result;
2252
+ }
2564
2253
 
2565
- `;
2254
+ // ../../node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/epoch.js
2255
+ var epoch_default = (date) => Math.floor(date.getTime() / 1e3);
2256
+
2257
+ // ../../node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/secs.js
2258
+ var minute = 60;
2259
+ var hour = minute * 60;
2260
+ var day = hour * 24;
2261
+ var week = day * 7;
2262
+ var year = day * 365.25;
2263
+ var REGEX = /^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i;
2264
+ var secs_default = (str) => {
2265
+ const matched = REGEX.exec(str);
2266
+ if (!matched || matched[4] && matched[1]) {
2267
+ throw new TypeError("Invalid time period format");
2268
+ }
2269
+ const value = parseFloat(matched[2]);
2270
+ const unit = matched[3].toLowerCase();
2271
+ let numericDate;
2272
+ switch (unit) {
2273
+ case "sec":
2274
+ case "secs":
2275
+ case "second":
2276
+ case "seconds":
2277
+ case "s":
2278
+ numericDate = Math.round(value);
2279
+ break;
2280
+ case "minute":
2281
+ case "minutes":
2282
+ case "min":
2283
+ case "mins":
2284
+ case "m":
2285
+ numericDate = Math.round(value * minute);
2286
+ break;
2287
+ case "hour":
2288
+ case "hours":
2289
+ case "hr":
2290
+ case "hrs":
2291
+ case "h":
2292
+ numericDate = Math.round(value * hour);
2293
+ break;
2294
+ case "day":
2295
+ case "days":
2296
+ case "d":
2297
+ numericDate = Math.round(value * day);
2298
+ break;
2299
+ case "week":
2300
+ case "weeks":
2301
+ case "w":
2302
+ numericDate = Math.round(value * week);
2303
+ break;
2304
+ default:
2305
+ numericDate = Math.round(value * year);
2306
+ break;
2307
+ }
2308
+ if (matched[1] === "-" || matched[4] === "ago") {
2309
+ return -numericDate;
2310
+ }
2311
+ return numericDate;
2566
2312
  };
2567
2313
 
2568
- // src/utils/channels.ts
2569
- var getChannelProtocols = (channel) => {
2570
- const protocols = [];
2571
- const bindings = channel.bindings();
2572
- for (const binding of bindings) {
2573
- protocols.push(binding.protocol());
2314
+ // ../../node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/jwt_claims_set.js
2315
+ var normalizeTyp = (value) => value.toLowerCase().replace(/^application\//, "");
2316
+ var checkAudiencePresence = (audPayload, audOption) => {
2317
+ if (typeof audPayload === "string") {
2318
+ return audOption.includes(audPayload);
2574
2319
  }
2575
- return protocols;
2320
+ if (Array.isArray(audPayload)) {
2321
+ return audOption.some(Set.prototype.has.bind(new Set(audPayload)));
2322
+ }
2323
+ return false;
2324
+ };
2325
+ var jwt_claims_set_default = (protectedHeader, encodedPayload, options = {}) => {
2326
+ let payload;
2327
+ try {
2328
+ payload = JSON.parse(decoder.decode(encodedPayload));
2329
+ } catch {
2330
+ }
2331
+ if (!isObject(payload)) {
2332
+ throw new JWTInvalid("JWT Claims Set must be a top-level JSON object");
2333
+ }
2334
+ const { typ } = options;
2335
+ if (typ && (typeof protectedHeader.typ !== "string" || normalizeTyp(protectedHeader.typ) !== normalizeTyp(typ))) {
2336
+ throw new JWTClaimValidationFailed('unexpected "typ" JWT header value', payload, "typ", "check_failed");
2337
+ }
2338
+ const { requiredClaims = [], issuer, subject, audience, maxTokenAge } = options;
2339
+ const presenceCheck = [...requiredClaims];
2340
+ if (maxTokenAge !== void 0)
2341
+ presenceCheck.push("iat");
2342
+ if (audience !== void 0)
2343
+ presenceCheck.push("aud");
2344
+ if (subject !== void 0)
2345
+ presenceCheck.push("sub");
2346
+ if (issuer !== void 0)
2347
+ presenceCheck.push("iss");
2348
+ for (const claim of new Set(presenceCheck.reverse())) {
2349
+ if (!(claim in payload)) {
2350
+ throw new JWTClaimValidationFailed(`missing required "${claim}" claim`, payload, claim, "missing");
2351
+ }
2352
+ }
2353
+ if (issuer && !(Array.isArray(issuer) ? issuer : [issuer]).includes(payload.iss)) {
2354
+ throw new JWTClaimValidationFailed('unexpected "iss" claim value', payload, "iss", "check_failed");
2355
+ }
2356
+ if (subject && payload.sub !== subject) {
2357
+ throw new JWTClaimValidationFailed('unexpected "sub" claim value', payload, "sub", "check_failed");
2358
+ }
2359
+ if (audience && !checkAudiencePresence(payload.aud, typeof audience === "string" ? [audience] : audience)) {
2360
+ throw new JWTClaimValidationFailed('unexpected "aud" claim value', payload, "aud", "check_failed");
2361
+ }
2362
+ let tolerance;
2363
+ switch (typeof options.clockTolerance) {
2364
+ case "string":
2365
+ tolerance = secs_default(options.clockTolerance);
2366
+ break;
2367
+ case "number":
2368
+ tolerance = options.clockTolerance;
2369
+ break;
2370
+ case "undefined":
2371
+ tolerance = 0;
2372
+ break;
2373
+ default:
2374
+ throw new TypeError("Invalid clockTolerance option type");
2375
+ }
2376
+ const { currentDate } = options;
2377
+ const now = epoch_default(currentDate || /* @__PURE__ */ new Date());
2378
+ if ((payload.iat !== void 0 || maxTokenAge) && typeof payload.iat !== "number") {
2379
+ throw new JWTClaimValidationFailed('"iat" claim must be a number', payload, "iat", "invalid");
2380
+ }
2381
+ if (payload.nbf !== void 0) {
2382
+ if (typeof payload.nbf !== "number") {
2383
+ throw new JWTClaimValidationFailed('"nbf" claim must be a number', payload, "nbf", "invalid");
2384
+ }
2385
+ if (payload.nbf > now + tolerance) {
2386
+ throw new JWTClaimValidationFailed('"nbf" claim timestamp check failed', payload, "nbf", "check_failed");
2387
+ }
2388
+ }
2389
+ if (payload.exp !== void 0) {
2390
+ if (typeof payload.exp !== "number") {
2391
+ throw new JWTClaimValidationFailed('"exp" claim must be a number', payload, "exp", "invalid");
2392
+ }
2393
+ if (payload.exp <= now - tolerance) {
2394
+ throw new JWTExpired('"exp" claim timestamp check failed', payload, "exp", "check_failed");
2395
+ }
2396
+ }
2397
+ if (maxTokenAge) {
2398
+ const age = now - payload.iat;
2399
+ const max = typeof maxTokenAge === "number" ? maxTokenAge : secs_default(maxTokenAge);
2400
+ if (age - tolerance > max) {
2401
+ throw new JWTExpired('"iat" claim timestamp check failed (too far in the past)', payload, "iat", "check_failed");
2402
+ }
2403
+ if (age < 0 - tolerance) {
2404
+ throw new JWTClaimValidationFailed('"iat" claim timestamp check failed (it should be in the past)', payload, "iat", "check_failed");
2405
+ }
2406
+ }
2407
+ return payload;
2576
2408
  };
2577
- var defaultMarkdown4 = (_document, channel) => {
2578
- return `
2579
- ${channel.hasDescription() ? `
2580
- ## Overview
2581
- ${channel.description()}
2582
- ` : ""}
2583
2409
 
2584
- <ChannelInformation />
2410
+ // ../../node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/jwt/verify.js
2411
+ async function jwtVerify(jwt, key, options) {
2412
+ const verified = await compactVerify(jwt, key, options);
2413
+ if (verified.protectedHeader.crit?.includes("b64") && verified.protectedHeader.b64 === false) {
2414
+ throw new JWTInvalid("JWTs MUST NOT use unencoded payload");
2415
+ }
2416
+ const payload = jwt_claims_set_default(verified.protectedHeader, verified.payload, options);
2417
+ const result = { payload, protectedHeader: verified.protectedHeader };
2418
+ if (typeof key === "function") {
2419
+ return { ...result, key: verified.key };
2420
+ }
2421
+ return result;
2422
+ }
2585
2423
 
2586
- ${channel.json()?.externalDocs ? `
2587
- ## External documentation
2588
- - [${channel.json()?.externalDocs?.description}](${channel.json()?.externalDocs?.url})
2589
- ` : ""}
2590
-
2591
- `;
2592
- };
2424
+ // ../../node_modules/.pnpm/@eventcatalog+license@0.0.5/node_modules/@eventcatalog/license/dist/key.js
2425
+ var PUBLIC_KEY = `-----BEGIN PUBLIC KEY-----
2426
+ MCowBQYDK2VwAyEA599maqjKG7VW5bnj9fFA3msK691iHUYd+PkiZ7h9LpI=
2427
+ -----END PUBLIC KEY-----`;
2428
+ async function loadPublicPem() {
2429
+ return PUBLIC_KEY;
2430
+ }
2593
2431
 
2594
- // ../../shared/checkLicense.ts
2595
- var import_node_fetch = __toESM(require("node-fetch"));
2596
- var import_https_proxy_agent = __toESM(require_dist2());
2597
- var import_chalk2 = __toESM(require("chalk"));
2598
- var checkLicense_default = async (pkgName, licenseKey) => {
2599
- const PROXY_SERVER_URI = process.env.PROXY_SERVER_URI || null;
2600
- if (!licenseKey) {
2601
- console.log(import_chalk2.default.bgRed(`
2602
- This plugin requires a license key to use`));
2603
- console.log(import_chalk2.default.redBright(`
2604
- Visit https://eventcatalog.cloud/ to get a 14 day trial or purchase a license`));
2605
- process.exit(1);
2432
+ // ../../node_modules/.pnpm/@eventcatalog+license@0.0.5/node_modules/@eventcatalog/license/dist/verify.js
2433
+ var import_path2 = __toESM(require("path"), 1);
2434
+ var import_chalk2 = __toESM(require("chalk"), 1);
2435
+ var import_https = __toESM(require("https"), 1);
2436
+ var import_http = __toESM(require("http"), 1);
2437
+ var import_url = require("url");
2438
+ var cachedEntitlements = null;
2439
+ function makeHttpRequest(url, options) {
2440
+ return new Promise((resolve, reject) => {
2441
+ const urlObj = new import_url.URL(url);
2442
+ const isHttps = urlObj.protocol === "https:";
2443
+ const client = isHttps ? import_https.default : import_http.default;
2444
+ const requestOptions = {
2445
+ hostname: urlObj.hostname,
2446
+ port: urlObj.port || (isHttps ? 443 : 80),
2447
+ path: urlObj.pathname + urlObj.search,
2448
+ method: options.method || "GET",
2449
+ headers: options.headers || {}
2450
+ };
2451
+ const proxyUrl = process.env.PROXY_SERVER_URI || process.env.HTTPS_PROXY || process.env.HTTP_PROXY;
2452
+ if (proxyUrl) {
2453
+ const proxy = new import_url.URL(proxyUrl);
2454
+ requestOptions.hostname = proxy.hostname;
2455
+ requestOptions.port = proxy.port || (proxy.protocol === "https:" ? 443 : 80);
2456
+ requestOptions.path = url;
2457
+ requestOptions.headers = {
2458
+ ...requestOptions.headers,
2459
+ Host: urlObj.hostname
2460
+ };
2461
+ }
2462
+ const req = client.request(requestOptions, (res) => {
2463
+ let data = "";
2464
+ res.on("data", (chunk) => data += chunk);
2465
+ res.on("end", () => {
2466
+ resolve({
2467
+ status: res.statusCode,
2468
+ json: () => Promise.resolve(JSON.parse(data))
2469
+ });
2470
+ });
2471
+ });
2472
+ req.on("error", reject);
2473
+ if (options.body) {
2474
+ req.write(options.body);
2475
+ }
2476
+ req.end();
2477
+ });
2478
+ }
2479
+ async function verifyOfflineLicense(opts = {}) {
2480
+ if (cachedEntitlements) {
2481
+ return cachedEntitlements;
2606
2482
  }
2607
- const fetchOptions = {
2483
+ const { licensePath, audience = "EventCatalog", issuer = "EventCatalog Ltd", clockTolerance = "12h", currentVersion, fingerprintProvider } = opts;
2484
+ try {
2485
+ const licenseFilePath = licensePath || findLicenseFile();
2486
+ if (!licenseFilePath) {
2487
+ const licenseError = new Error("License file not found. Check EC_LICENSE environment variable or place license.jwt in current directory or /etc/eventcatalog/");
2488
+ licenseError.code = "LICENSE_FILE_NOT_FOUND";
2489
+ throw licenseError;
2490
+ }
2491
+ const token = (0, import_fs2.readFileSync)(licenseFilePath, "utf8").trim();
2492
+ if (!token) {
2493
+ const licenseError = new Error("License file is empty");
2494
+ licenseError.code = "LICENSE_FILE_EMPTY";
2495
+ throw licenseError;
2496
+ }
2497
+ const pemContent = await loadPublicPem();
2498
+ const publicKey = await importSPKI(pemContent, "EdDSA");
2499
+ const { payload } = await jwtVerify(token, publicKey, {
2500
+ issuer,
2501
+ audience,
2502
+ clockTolerance
2503
+ });
2504
+ const entitlements = payload;
2505
+ await performAdditionalChecks(entitlements, { currentVersion, fingerprintProvider });
2506
+ cachedEntitlements = entitlements;
2507
+ return entitlements;
2508
+ } catch (error) {
2509
+ const errorMessage = error instanceof Error ? error.message : String(error);
2510
+ const errorName = error && typeof error === "object" && "name" in error ? error.name : "";
2511
+ const errorCode = error && typeof error === "object" && "code" in error ? error.code : "";
2512
+ if (errorName === "JWTExpired" || errorMessage.includes("JWTExpired") || errorCode === "JWTExpired") {
2513
+ const licenseError = new Error("License has expired");
2514
+ licenseError.code = "LICENSE_EXPIRED";
2515
+ console.error(import_chalk2.default.red(`You have an expired license. Please renew your license to continue using EventCatalog.`));
2516
+ throw licenseError;
2517
+ }
2518
+ if (errorName === "JWTNotYetValid" || errorMessage.includes("JWTNotYetValid") || errorCode === "JWTNotYetValid") {
2519
+ const licenseError = new Error("License is not yet valid");
2520
+ licenseError.code = "LICENSE_NOT_YET_VALID";
2521
+ console.error(import_chalk2.default.red(`License is not yet valid`));
2522
+ throw licenseError;
2523
+ }
2524
+ if (errorName === "JWTClaimValidationFailed" || errorMessage.includes("JWTClaimValidationFailed") || errorCode === "JWTClaimValidationFailed") {
2525
+ const licenseError = new Error("License validation failed - invalid issuer or audience");
2526
+ licenseError.code = "LICENSE_VALIDATION_FAILED";
2527
+ console.error(import_chalk2.default.red(`License validation failed - invalid issuer or audience`));
2528
+ throw licenseError;
2529
+ }
2530
+ if (errorName === "JWSSignatureVerificationFailed" || errorMessage.includes("JWSSignatureVerificationFailed") || errorCode === "JWSSignatureVerificationFailed") {
2531
+ const licenseError = new Error("License signature verification failed - invalid or tampered license");
2532
+ licenseError.code = "LICENSE_SIGNATURE_INVALID";
2533
+ console.error(import_chalk2.default.red(`License signature verification failed - invalid or tampered license`));
2534
+ throw licenseError;
2535
+ }
2536
+ throw error;
2537
+ }
2538
+ }
2539
+ async function verifyOnlineLicense(key, plugin) {
2540
+ if (!isValidLicenseKeyFormat(key)) {
2541
+ const licenseError = new Error("Invalid license key format. Expected format: XXXX-XXXX-XXXX-XXXX-XXXX-XXXX");
2542
+ licenseError.code = "INVALID_LICENSE_KEY_FORMAT";
2543
+ throw licenseError;
2544
+ }
2545
+ const PLANS = {
2546
+ "@eventcatalog/eventcatalog-starter": "EventCatalog Starter",
2547
+ "@eventcatalog/eventcatalog-scale": "EventCatalog Scale",
2548
+ "@eventcatalog/eventcatalog-enterprise": "EventCatalog Enterprise",
2549
+ "@eventcatalog/generator-amazon-apigateway": "Amazon API Gateway",
2550
+ "@eventcatalog/generator-asyncapi": "AsyncAPI",
2551
+ "@eventcatalog/generator-openapi": "OpenAPI",
2552
+ "@eventcatalog/backstage-plugin-eventcatalog": "Backstage",
2553
+ "@eventcatalog/generator-aws-glue": "AWS Glue",
2554
+ "@eventcatalog/generator-confluent-schema-registry": "Confluent Schema Registry",
2555
+ "@eventcatalog/generator-github": "GitHub",
2556
+ "@eventcatalog/generator-federation": "Federation"
2557
+ };
2558
+ const requestOptions = {
2608
2559
  method: "POST",
2609
2560
  headers: {
2610
- Authorization: `Bearer ${licenseKey}`,
2561
+ Authorization: `Bearer ${key}`,
2611
2562
  "Content-Type": "application/json"
2612
2563
  }
2613
2564
  };
2614
2565
  let response;
2615
2566
  try {
2616
- if (PROXY_SERVER_URI) {
2617
- const proxyAgent = new import_https_proxy_agent.HttpsProxyAgent(PROXY_SERVER_URI);
2618
- fetchOptions.agent = proxyAgent;
2619
- }
2620
- response = await (0, import_node_fetch.default)("https://api.eventcatalog.cloud/functions/v1/license", fetchOptions);
2567
+ response = await makeHttpRequest("https://api.eventcatalog.cloud/functions/v1/license", requestOptions);
2621
2568
  } catch (err) {
2622
- console.log(
2623
- import_chalk2.default.redBright(
2624
- "Network Connection Error: Unable to establish a connection to licence server. Check network or proxy settings."
2625
- )
2626
- );
2569
+ console.log(import_chalk2.default.redBright("Network Connection Error: Unable to establish a connection to license server. Check network or proxy settings."));
2627
2570
  console.log(import_chalk2.default.red(`Error details: ${err?.message || err}`));
2571
+ const proxyUrl = process.env.PROXY_SERVER_URI || process.env.HTTPS_PROXY || process.env.HTTP_PROXY;
2572
+ if (proxyUrl) {
2573
+ console.log(import_chalk2.default.yellow("\n\u{1F4A1} Proxy is configured but connection failed."));
2574
+ console.log(import_chalk2.default.yellow(` Proxy: ${proxyUrl}`));
2575
+ } else {
2576
+ console.log(import_chalk2.default.yellow("\n\u{1F4A1} For proxy support, set PROXY_SERVER_URI, HTTPS_PROXY, or HTTP_PROXY environment variable"));
2577
+ }
2628
2578
  process.exit(1);
2629
2579
  }
2630
2580
  if (response.status !== 200) {
2631
2581
  console.log(import_chalk2.default.bgRed(`
2632
2582
  Invalid license key`));
2633
- console.log(import_chalk2.default.redBright("Please check your plugin license key or purchase a license at https://eventcatalog.cloud/"));
2634
- process.exit(1);
2583
+ console.log(`
2584
+ Tried to verify your ${PLANS[plugin]} license, but your license key is not valid. Please check your license key or purchase a license at https://eventcatalog.cloud/
2585
+ `);
2586
+ return false;
2635
2587
  }
2636
2588
  if (response.status === 200) {
2637
2589
  const data = await response.json();
2638
- if (pkgName !== data.plugin) {
2590
+ if (plugin !== data.plugin) {
2639
2591
  console.log(import_chalk2.default.bgRed(`
2640
2592
  Invalid license key for this plugin`));
2641
- console.log(import_chalk2.default.redBright("Please check your plugin license key or purchase a license at https://eventcatalog.cloud/"));
2642
- process.exit(1);
2593
+ console.log(`
2594
+ Invalid license key for ${PLANS[plugin]} license, please check your license key or purchase a license at https://eventcatalog.cloud/
2595
+ `);
2596
+ return false;
2643
2597
  }
2598
+ let message2 = `${PLANS[plugin]} license is enabled for EventCatalog`;
2644
2599
  if (data.is_trial) {
2645
- console.log(import_chalk2.default.bgBlue(`
2646
- You are using a trial license for this plugin`));
2600
+ message2 += `
2601
+ You are using a trial license for ${PLANS[plugin]}. Please upgrade to a paid version to continue using EventCatalog.`;
2647
2602
  }
2603
+ if (PLANS[plugin]) {
2604
+ console.log(boxen(message2, {
2605
+ padding: 1,
2606
+ margin: 1,
2607
+ borderColor: "green",
2608
+ title: PLANS[plugin],
2609
+ titleAlignment: "center"
2610
+ }));
2611
+ }
2612
+ }
2613
+ return true;
2614
+ }
2615
+ function isFeatureEnabled(name) {
2616
+ if (!cachedEntitlements?.plugins) {
2617
+ return false;
2618
+ }
2619
+ const isEnabled = cachedEntitlements.plugins.some((plugin) => plugin === name);
2620
+ let message2 = `${name} is enabled for EventCatalog`;
2621
+ if (isEnabled) {
2622
+ console.log(boxen(message2, {
2623
+ padding: 1,
2624
+ margin: 1,
2625
+ borderColor: "green",
2626
+ title: name,
2627
+ titleAlignment: "center"
2628
+ }));
2629
+ }
2630
+ return isEnabled;
2631
+ }
2632
+ function hasOfflineLicenseKey() {
2633
+ return findLicenseFile() !== null;
2634
+ }
2635
+ function findLicenseFile() {
2636
+ const candidates = [
2637
+ process.env.EC_LICENSE,
2638
+ import_path2.default.join(process.env.PROJECT_DIR || process.cwd(), "license.jwt"),
2639
+ "./license.jwt",
2640
+ "/etc/eventcatalog/license.jwt"
2641
+ ].filter(Boolean);
2642
+ for (const candidate of candidates) {
2643
+ if ((0, import_fs2.existsSync)(candidate)) {
2644
+ return candidate;
2645
+ }
2646
+ }
2647
+ return null;
2648
+ }
2649
+ async function performAdditionalChecks(entitlements, options) {
2650
+ const { currentVersion, fingerprintProvider } = options;
2651
+ if (entitlements.fingerprint && fingerprintProvider) {
2652
+ const actualFingerprint = fingerprintProvider();
2653
+ if (actualFingerprint && actualFingerprint !== entitlements.fingerprint) {
2654
+ const licenseError = new Error("License fingerprint mismatch - license is bound to a different machine");
2655
+ licenseError.code = "LICENSE_FINGERPRINT_MISMATCH";
2656
+ throw licenseError;
2657
+ }
2658
+ }
2659
+ }
2660
+ function isValidLicenseKeyFormat(key) {
2661
+ if (typeof key !== "string") {
2662
+ return false;
2663
+ }
2664
+ const trimmedKey = key.trim();
2665
+ const licenseKeyPattern = /^[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{4}$/;
2666
+ if (!licenseKeyPattern.test(trimmedKey)) {
2667
+ return false;
2668
+ }
2669
+ if (trimmedKey.length !== 29) {
2670
+ return false;
2671
+ }
2672
+ if (trimmedKey.includes("--") || /[^A-Z0-9-]/.test(trimmedKey)) {
2673
+ return false;
2674
+ }
2675
+ return true;
2676
+ }
2677
+
2678
+ // ../../node_modules/.pnpm/@eventcatalog+license@0.0.5/node_modules/@eventcatalog/license/dist/plans.js
2679
+ var isFeatureEnabled2 = async (feature, key) => {
2680
+ if (hasOfflineLicenseKey()) {
2681
+ await verifyOfflineLicense();
2682
+ return isFeatureEnabled(feature);
2683
+ }
2684
+ if (!key) {
2685
+ return false;
2686
+ }
2687
+ return verifyOnlineLicense(key, feature);
2688
+ };
2689
+
2690
+ // ../../shared/checkLicense.ts
2691
+ var checkLicense_default = async (pkgName, licenseKey) => {
2692
+ if (!hasOfflineLicenseKey() && !licenseKey) {
2693
+ console.log(import_chalk3.default.bgRed(`
2694
+ No license key provided for ${pkgName}`));
2695
+ console.log(import_chalk3.default.redBright("You can get a free 14 day trial license at https://eventcatalog.cloud/"));
2696
+ process.exit(1);
2697
+ }
2698
+ try {
2699
+ const featureEnabled = await isFeatureEnabled2(pkgName, licenseKey);
2700
+ if (!featureEnabled) {
2701
+ console.log(import_chalk3.default.bgRed(`
2702
+ Invalid license key`));
2703
+ console.log(import_chalk3.default.redBright("Please check your plugin license key or purchase a license at https://eventcatalog.cloud/"));
2704
+ process.exit(1);
2705
+ }
2706
+ return Promise.resolve();
2707
+ } catch (error) {
2708
+ console.log(error);
2709
+ console.log(import_chalk3.default.bgRed(`
2710
+ Failed to verify license key`));
2711
+ console.log(import_chalk3.default.redBright("Please check your plugin license key or purchase a license at https://eventcatalog.cloud/"));
2712
+ process.exit(1);
2648
2713
  }
2649
- return Promise.resolve();
2650
2714
  };
2651
2715
 
2652
2716
  // src/index.ts
@@ -2779,45 +2843,45 @@ var index_default = async (config, options) => {
2779
2843
  };
2780
2844
  validateOptions(options);
2781
2845
  const { services, saveParsedSpecFile = false, parseSchemas = true, parseChannels = false } = options;
2782
- console.log(import_chalk3.default.green(`Processing ${services.length} AsyncAPI files...`));
2846
+ console.log(import_chalk4.default.green(`Processing ${services.length} AsyncAPI files...`));
2783
2847
  for (const service of services) {
2784
- console.log(import_chalk3.default.gray(`Processing ${service.path}`));
2785
- const { document: document2, diagnostics } = service.path.startsWith("http") ? await (0, import_parser.fromURL)(parser, service.path).parse({
2848
+ console.log(import_chalk4.default.gray(`Processing ${service.path}`));
2849
+ const { document, diagnostics } = service.path.startsWith("http") ? await (0, import_parser.fromURL)(parser, service.path).parse({
2786
2850
  parseSchemas
2787
2851
  }) : await (0, import_parser.fromFile)(parser, service.path).parse({
2788
2852
  parseSchemas
2789
2853
  });
2790
- if (!document2) {
2791
- console.log(import_chalk3.default.red("Failed to parse AsyncAPI file"));
2854
+ if (!document) {
2855
+ console.log(import_chalk4.default.red("Failed to parse AsyncAPI file"));
2792
2856
  if (options.debug || cliArgs.debug) {
2793
2857
  console.log(diagnostics);
2794
2858
  } else {
2795
- console.log(import_chalk3.default.red("Run with debug option in the generator to see diagnostics"));
2859
+ console.log(import_chalk4.default.red("Run with debug option in the generator to see diagnostics"));
2796
2860
  }
2797
2861
  continue;
2798
2862
  }
2799
- const operations = document2.allOperations();
2800
- const channels = document2.allChannels();
2801
- const documentTags = document2.info().tags().all() || [];
2863
+ const operations = document.allOperations();
2864
+ const channels = document.allChannels();
2865
+ const documentTags = document.info().tags().all() || [];
2802
2866
  const isDomainMarkedAsDraft = options.domain?.draft || false;
2803
- const isServiceMarkedAsDraft = isDomainMarkedAsDraft || document2.info().extensions().get("x-eventcatalog-draft")?.value() || service.draft || false;
2867
+ const isServiceMarkedAsDraft = isDomainMarkedAsDraft || document.info().extensions().get("x-eventcatalog-draft")?.value() || service.draft || false;
2804
2868
  const serviceId = service.id;
2805
- const serviceName = service.name || document2.info().title();
2806
- const version = document2.info().version();
2869
+ const serviceName = service.name || document.info().title();
2870
+ const version = document.info().version();
2807
2871
  let sends = [];
2808
2872
  let receives = [];
2809
2873
  let owners = service.owners || null;
2810
2874
  let repository = null;
2811
2875
  let serviceSpecifications = {};
2812
2876
  let serviceSpecificationsFiles = [];
2813
- const generatedMarkdownForService = defaultMarkdown2(document2);
2877
+ const generatedMarkdownForService = defaultMarkdown2(document);
2814
2878
  let serviceMarkdown = service.generateMarkdown ? service.generateMarkdown({
2815
2879
  service: { id: service.id, name: serviceName, version },
2816
- document: document2,
2880
+ document,
2817
2881
  markdown: generatedMarkdownForService
2818
2882
  }) : generatedMarkdownForService;
2819
2883
  let styles2 = null;
2820
- let servicePath = options.domain ? import_path2.default.join("../", "domains", options.domain.id, "services", service.id) : import_path2.default.join("../", "services", service.id);
2884
+ let servicePath = options.domain ? import_path3.default.join("../", "domains", options.domain.id, "services", service.id) : import_path3.default.join("../", "services", service.id);
2821
2885
  if (options.writeFilesToRoot) {
2822
2886
  servicePath = service.id;
2823
2887
  }
@@ -2826,14 +2890,14 @@ var index_default = async (config, options) => {
2826
2890
  const domain = await getDomain(options.domain.id, domainVersion || "latest");
2827
2891
  const currentDomain = await getDomain(options.domain.id, "latest");
2828
2892
  const domainIsDraft = isDomainMarkedAsDraft || currentDomain?.draft || false;
2829
- console.log(import_chalk3.default.blue(`
2893
+ console.log(import_chalk4.default.blue(`
2830
2894
  Processing domain: ${domainName} (v${domainVersion})`));
2831
2895
  if (currentDomain && currentDomain.version !== domainVersion) {
2832
2896
  await versionDomain(domainId);
2833
- console.log(import_chalk3.default.cyan(` - Versioned previous domain (v${currentDomain.version})`));
2897
+ console.log(import_chalk4.default.cyan(` - Versioned previous domain (v${currentDomain.version})`));
2834
2898
  }
2835
2899
  if (!domain || domain && domain.version !== domainVersion) {
2836
- const generatedMarkdownForDomain = defaultMarkdown3(document2);
2900
+ const generatedMarkdownForDomain = defaultMarkdown3(document);
2837
2901
  await writeDomain({
2838
2902
  id: domainId,
2839
2903
  name: domainName,
@@ -2843,10 +2907,10 @@ Processing domain: ${domainName} (v${domainVersion})`));
2843
2907
  ...domainIsDraft && { draft: true }
2844
2908
  // services: [{ id: serviceId, version: version }],
2845
2909
  });
2846
- console.log(import_chalk3.default.cyan(` - Domain (v${domainVersion}) created`));
2910
+ console.log(import_chalk4.default.cyan(` - Domain (v${domainVersion}) created`));
2847
2911
  }
2848
2912
  if (currentDomain && currentDomain.version === domainVersion) {
2849
- console.log(import_chalk3.default.yellow(` - Domain (v${domainVersion}) already exists, skipped creation...`));
2913
+ console.log(import_chalk4.default.yellow(` - Domain (v${domainVersion}) already exists, skipped creation...`));
2850
2914
  }
2851
2915
  await addServiceToDomain(domainId, { id: serviceId, version }, domainVersion);
2852
2916
  }
@@ -2856,9 +2920,10 @@ Processing domain: ${domainName} (v${domainVersion})`));
2856
2920
  const channelId = channel.id();
2857
2921
  const params = channelAsJSON?.parameters || {};
2858
2922
  const protocols = getChannelProtocols(channel);
2923
+ const channelTags = getChannelTags(channel);
2859
2924
  const channelVersion = channel.extensions().get("x-eventcatalog-channel-version")?.value() || version;
2860
- let channelMarkdown = defaultMarkdown4(document2, channel);
2861
- console.log(import_chalk3.default.blue(`Processing channel: ${channelId} (v${channelVersion})`));
2925
+ let channelMarkdown = defaultMarkdown4(document, channel);
2926
+ console.log(import_chalk4.default.blue(`Processing channel: ${channelId} (v${channelVersion})`));
2862
2927
  const paramsForCatalog = Object.keys(params).reduce(
2863
2928
  (acc, key) => {
2864
2929
  const param = params[key];
@@ -2876,7 +2941,7 @@ Processing domain: ${domainName} (v${domainVersion})`));
2876
2941
  channelMarkdown = catalogedChannel.markdown;
2877
2942
  if (catalogedChannel.version !== channelVersion) {
2878
2943
  await versionChannel(channelId);
2879
- console.log(import_chalk3.default.cyan(` - Versioned previous channel: ${channelId} (v${channelVersion})`));
2944
+ console.log(import_chalk4.default.cyan(` - Versioned previous channel: ${channelId} (v${channelVersion})`));
2880
2945
  }
2881
2946
  }
2882
2947
  await writeChannel(
@@ -2888,25 +2953,28 @@ Processing domain: ${domainName} (v${domainVersion})`));
2888
2953
  ...Object.keys(paramsForCatalog).length > 0 && { parameters: paramsForCatalog },
2889
2954
  ...channel.address() && { address: channel.address() },
2890
2955
  ...channelAsJSON?.summary && { summary: channelAsJSON.summary },
2956
+ ...channelTags.length > 0 && {
2957
+ badges: channelTags.map((tagName) => ({ content: tagName, textColor: "blue", backgroundColor: "blue" }))
2958
+ },
2891
2959
  ...protocols.length > 0 && { protocols },
2892
2960
  ...(isDomainMarkedAsDraft || isServiceMarkedAsDraft) && { draft: true }
2893
2961
  },
2894
2962
  { override: true }
2895
2963
  );
2896
- console.log(import_chalk3.default.cyan(` - Message ${channelId} (v${version}) created`));
2964
+ console.log(import_chalk4.default.cyan(` - Message ${channelId} (v${version}) created`));
2897
2965
  }
2898
2966
  }
2899
2967
  for (const operation of operations) {
2900
- for (const message of operation.messages()) {
2901
- const eventType = message.extensions().get("x-eventcatalog-message-type")?.value() || "event";
2902
- const messageVersion = message.extensions().get("x-eventcatalog-message-version")?.value() || version;
2903
- const deprecatedDate = message.extensions().get("x-eventcatalog-deprecated-date")?.value() || null;
2904
- const deprecatedMessage = message.extensions().get("x-eventcatalog-deprecated-message")?.value() || null;
2905
- const isMessageMarkedAsDraft = isDomainMarkedAsDraft || isServiceMarkedAsDraft || message.extensions().get("x-eventcatalog-draft")?.value() || null;
2906
- const serviceOwnsMessageContract = isServiceMessageOwner(message);
2968
+ for (const message2 of operation.messages()) {
2969
+ const eventType = message2.extensions().get("x-eventcatalog-message-type")?.value() || "event";
2970
+ const messageVersion = message2.extensions().get("x-eventcatalog-message-version")?.value() || version;
2971
+ const deprecatedDate = message2.extensions().get("x-eventcatalog-deprecated-date")?.value() || null;
2972
+ const deprecatedMessage = message2.extensions().get("x-eventcatalog-deprecated-message")?.value() || null;
2973
+ const isMessageMarkedAsDraft = isDomainMarkedAsDraft || isServiceMarkedAsDraft || message2.extensions().get("x-eventcatalog-draft")?.value() || null;
2974
+ const serviceOwnsMessageContract = isServiceMessageOwner(message2);
2907
2975
  const isReceived = operation.action() === "receive" || operation.action() === "subscribe";
2908
2976
  const isSent = operation.action() === "send" || operation.action() === "publish";
2909
- const messageId = message.id().toLowerCase();
2977
+ const messageId = message2.id().toLowerCase();
2910
2978
  if (eventType !== "event" && eventType !== "command" && eventType !== "query") {
2911
2979
  throw new Error("Invalid message type");
2912
2980
  }
@@ -2917,33 +2985,33 @@ Processing domain: ${domainName} (v${domainVersion})`));
2917
2985
  addSchema: addSchemaToMessage,
2918
2986
  collection: folder
2919
2987
  } = MESSAGE_OPERATIONS[eventType];
2920
- const generatedMarkdownForMessage = defaultMarkdown(document2, message);
2921
- let messageMarkdown = options.messages?.generateMarkdown ? options.messages.generateMarkdown({ message, document: document2, markdown: generatedMarkdownForMessage }) : generatedMarkdownForMessage;
2922
- const badges = message.tags().all() || [];
2923
- console.log(import_chalk3.default.blue(`Processing message: ${getMessageName(message)} (v${messageVersion})`));
2924
- let messagePath = (0, import_node_path.join)(servicePath, folder, message.id());
2988
+ const generatedMarkdownForMessage = defaultMarkdown(document, message2);
2989
+ let messageMarkdown = options.messages?.generateMarkdown ? options.messages.generateMarkdown({ message: message2, document, markdown: generatedMarkdownForMessage }) : generatedMarkdownForMessage;
2990
+ const badges = message2.tags().all() || [];
2991
+ console.log(import_chalk4.default.blue(`Processing message: ${getMessageName(message2)} (v${messageVersion})`));
2992
+ let messagePath = (0, import_node_path.join)(servicePath, folder, message2.id());
2925
2993
  if (options.writeFilesToRoot) {
2926
- messagePath = message.id();
2994
+ messagePath = message2.id();
2927
2995
  }
2928
2996
  if (serviceOwnsMessageContract) {
2929
- const catalogedMessage = await getMessage(message.id().toLowerCase(), "latest");
2997
+ const catalogedMessage = await getMessage(message2.id().toLowerCase(), "latest");
2930
2998
  if (catalogedMessage) {
2931
2999
  messageMarkdown = catalogedMessage.markdown;
2932
3000
  if (catalogedMessage.version !== messageVersion) {
2933
3001
  await versionMessage(messageId);
2934
- console.log(import_chalk3.default.cyan(` - Versioned previous message: (v${catalogedMessage.version})`));
3002
+ console.log(import_chalk4.default.cyan(` - Versioned previous message: (v${catalogedMessage.version})`));
2935
3003
  }
2936
3004
  }
2937
- const channelsForMessage = parseChannels ? getChannelsForMessage(message, channels, document2) : [];
3005
+ const channelsForMessage = parseChannels ? getChannelsForMessage(message2, channels, document) : [];
2938
3006
  await writeMessage(
2939
3007
  {
2940
3008
  id: messageId,
2941
3009
  version: messageVersion,
2942
- name: getMessageName(message),
2943
- summary: getSummary(message),
3010
+ name: getMessageName(message2),
3011
+ summary: getSummary(message2),
2944
3012
  markdown: messageMarkdown,
2945
3013
  badges: badges.map((badge) => ({ content: badge.name(), textColor: "blue", backgroundColor: "blue" })),
2946
- ...messageHasSchema(message) && { schemaPath: getSchemaFileName(message) },
3014
+ ...messageHasSchema(message2) && { schemaPath: getSchemaFileName(message2) },
2947
3015
  ...owners && { owners },
2948
3016
  ...channelsForMessage.length > 0 && { channels: channelsForMessage },
2949
3017
  ...deprecatedDate && {
@@ -2956,31 +3024,31 @@ Processing domain: ${domainName} (v${domainVersion})`));
2956
3024
  path: messagePath
2957
3025
  }
2958
3026
  );
2959
- console.log(import_chalk3.default.cyan(` - Message (v${messageVersion}) created`));
2960
- if (messageHasSchema(message)) {
2961
- let schema = message.payload()?.extensions()?.get("x-parser-original-payload")?.json() || message.payload()?.json();
3027
+ console.log(import_chalk4.default.cyan(` - Message (v${messageVersion}) created`));
3028
+ if (messageHasSchema(message2)) {
3029
+ let schema = message2.payload()?.extensions()?.get("x-parser-original-payload")?.json() || message2.payload()?.json();
2962
3030
  if (schema?.schema) {
2963
3031
  schema = schema.schema;
2964
3032
  }
2965
3033
  await addSchemaToMessage(
2966
3034
  messageId,
2967
3035
  {
2968
- fileName: getSchemaFileName(message),
3036
+ fileName: getSchemaFileName(message2),
2969
3037
  schema: JSON.stringify(schema, null, 4)
2970
3038
  },
2971
3039
  messageVersion
2972
3040
  );
2973
- console.log(import_chalk3.default.cyan(` - Schema added to message (v${messageVersion})`));
3041
+ console.log(import_chalk4.default.cyan(` - Schema added to message (v${messageVersion})`));
2974
3042
  }
2975
3043
  } else {
2976
- console.log(import_chalk3.default.yellow(` - Skipping external message: ${getMessageName(message)}(v${messageVersion})`));
3044
+ console.log(import_chalk4.default.yellow(` - Skipping external message: ${getMessageName(message2)}(v${messageVersion})`));
2977
3045
  }
2978
3046
  if (isSent) sends.push({ id: messageId, version: messageVersion });
2979
3047
  if (isReceived) receives.push({ id: messageId, version: messageVersion });
2980
3048
  }
2981
3049
  }
2982
3050
  const latestServiceInCatalog = await getService(serviceId, "latest");
2983
- console.log(import_chalk3.default.blue(`Processing service: ${serviceId} (v${version})`));
3051
+ console.log(import_chalk4.default.blue(`Processing service: ${serviceId} (v${version})`));
2984
3052
  if (latestServiceInCatalog) {
2985
3053
  serviceMarkdown = latestServiceInCatalog.markdown;
2986
3054
  owners = latestServiceInCatalog.owners || owners;
@@ -2988,7 +3056,7 @@ Processing domain: ${domainName} (v${domainVersion})`));
2988
3056
  styles2 = latestServiceInCatalog.styles || null;
2989
3057
  if (latestServiceInCatalog.version !== version) {
2990
3058
  await versionService(serviceId);
2991
- console.log(import_chalk3.default.cyan(` - Versioned previous service (v${latestServiceInCatalog.version})`));
3059
+ console.log(import_chalk4.default.cyan(` - Versioned previous service (v${latestServiceInCatalog.version})`));
2992
3060
  }
2993
3061
  if (latestServiceInCatalog.version === version) {
2994
3062
  serviceMarkdown = latestServiceInCatalog.markdown;
@@ -2998,14 +3066,14 @@ Processing domain: ${domainName} (v${domainVersion})`));
2998
3066
  serviceSpecificationsFiles = await getSpecificationFilesForService(serviceId, version);
2999
3067
  }
3000
3068
  }
3001
- const fileName = import_path2.default.basename(service.path);
3069
+ const fileName = import_path3.default.basename(service.path);
3002
3070
  await writeService(
3003
3071
  {
3004
3072
  id: serviceId,
3005
3073
  name: serviceName,
3006
3074
  version,
3007
- summary: getSummary2(document2),
3008
- badges: documentTags.map((tag) => ({ content: tag.name(), textColor: "blue", backgroundColor: "blue" })),
3075
+ summary: getSummary2(document),
3076
+ badges: documentTags.map((tag2) => ({ content: tag2.name(), textColor: "blue", backgroundColor: "blue" })),
3009
3077
  markdown: serviceMarkdown,
3010
3078
  sends,
3011
3079
  receives,
@@ -3028,8 +3096,8 @@ Processing domain: ${domainName} (v${domainVersion})`));
3028
3096
  // add any previous spec files to the list
3029
3097
  ...serviceSpecificationsFiles,
3030
3098
  {
3031
- content: saveParsedSpecFile ? getParsedSpecFile(service, document2) : await getRawSpecFile(service),
3032
- fileName: import_path2.default.basename(service.path) || "asyncapi.yml"
3099
+ content: saveParsedSpecFile ? getParsedSpecFile(service, document) : await getRawSpecFile(service),
3100
+ fileName: import_path3.default.basename(service.path) || "asyncapi.yml"
3033
3101
  }
3034
3102
  ];
3035
3103
  for (const specFile of specFiles) {
@@ -3042,14 +3110,14 @@ Processing domain: ${domainName} (v${domainVersion})`));
3042
3110
  version
3043
3111
  );
3044
3112
  }
3045
- console.log(import_chalk3.default.cyan(` - Service (v${version}) created`));
3046
- console.log(import_chalk3.default.green(`
3113
+ console.log(import_chalk4.default.cyan(` - Service (v${version}) created`));
3114
+ console.log(import_chalk4.default.green(`
3047
3115
  Finished generating event catalog for AsyncAPI ${serviceId} (v${version})`));
3048
3116
  }
3049
3117
  };
3050
- var getParsedSpecFile = (service, document2) => {
3118
+ var getParsedSpecFile = (service, document) => {
3051
3119
  const isSpecFileJSON = service.path.endsWith(".json");
3052
- return isSpecFileJSON ? JSON.stringify(document2.meta().asyncapi.parsed, null, 4) : import_js_yaml.default.dump(document2.meta().asyncapi.parsed, { noRefs: true });
3120
+ return isSpecFileJSON ? JSON.stringify(document.meta().asyncapi.parsed, null, 4) : import_js_yaml.default.dump(document.meta().asyncapi.parsed, { noRefs: true });
3053
3121
  };
3054
3122
  var getRawSpecFile = async (service) => {
3055
3123
  if (service.path.startsWith("http")) {
@@ -3057,7 +3125,7 @@ var getRawSpecFile = async (service) => {
3057
3125
  const response = await fetch(service.path);
3058
3126
  return response.text();
3059
3127
  } catch (error) {
3060
- console.log(import_chalk3.default.red(`
3128
+ console.log(import_chalk4.default.red(`
3061
3129
  Failed to request AsyncAPI file from ${service.path}`));
3062
3130
  return "";
3063
3131
  }
@@ -3065,8 +3133,8 @@ Failed to request AsyncAPI file from ${service.path}`));
3065
3133
  return await (0, import_promises.readFile)(service.path, "utf8");
3066
3134
  }
3067
3135
  };
3068
- var isServiceMessageOwner = (message) => {
3069
- const value = message.extensions().get("x-eventcatalog-role")?.value() || "provider";
3136
+ var isServiceMessageOwner = (message2) => {
3137
+ const value = message2.extensions().get("x-eventcatalog-role")?.value() || "provider";
3070
3138
  return value === "provider";
3071
3139
  };
3072
3140
  //# sourceMappingURL=index.js.map