@eventcatalog/generator-openapi 4.0.3 → 4.0.5
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 +1141 -25
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1164 -25
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -2
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,286 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
8
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
19
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
20
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
21
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
22
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
23
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
24
|
+
mod
|
|
25
|
+
));
|
|
26
|
+
|
|
27
|
+
// ../../node_modules/.pnpm/cli-boxes@3.0.0/node_modules/cli-boxes/boxes.json
|
|
28
|
+
var require_boxes = __commonJS({
|
|
29
|
+
"../../node_modules/.pnpm/cli-boxes@3.0.0/node_modules/cli-boxes/boxes.json"(exports, module) {
|
|
30
|
+
module.exports = {
|
|
31
|
+
single: {
|
|
32
|
+
topLeft: "\u250C",
|
|
33
|
+
top: "\u2500",
|
|
34
|
+
topRight: "\u2510",
|
|
35
|
+
right: "\u2502",
|
|
36
|
+
bottomRight: "\u2518",
|
|
37
|
+
bottom: "\u2500",
|
|
38
|
+
bottomLeft: "\u2514",
|
|
39
|
+
left: "\u2502"
|
|
40
|
+
},
|
|
41
|
+
double: {
|
|
42
|
+
topLeft: "\u2554",
|
|
43
|
+
top: "\u2550",
|
|
44
|
+
topRight: "\u2557",
|
|
45
|
+
right: "\u2551",
|
|
46
|
+
bottomRight: "\u255D",
|
|
47
|
+
bottom: "\u2550",
|
|
48
|
+
bottomLeft: "\u255A",
|
|
49
|
+
left: "\u2551"
|
|
50
|
+
},
|
|
51
|
+
round: {
|
|
52
|
+
topLeft: "\u256D",
|
|
53
|
+
top: "\u2500",
|
|
54
|
+
topRight: "\u256E",
|
|
55
|
+
right: "\u2502",
|
|
56
|
+
bottomRight: "\u256F",
|
|
57
|
+
bottom: "\u2500",
|
|
58
|
+
bottomLeft: "\u2570",
|
|
59
|
+
left: "\u2502"
|
|
60
|
+
},
|
|
61
|
+
bold: {
|
|
62
|
+
topLeft: "\u250F",
|
|
63
|
+
top: "\u2501",
|
|
64
|
+
topRight: "\u2513",
|
|
65
|
+
right: "\u2503",
|
|
66
|
+
bottomRight: "\u251B",
|
|
67
|
+
bottom: "\u2501",
|
|
68
|
+
bottomLeft: "\u2517",
|
|
69
|
+
left: "\u2503"
|
|
70
|
+
},
|
|
71
|
+
singleDouble: {
|
|
72
|
+
topLeft: "\u2553",
|
|
73
|
+
top: "\u2500",
|
|
74
|
+
topRight: "\u2556",
|
|
75
|
+
right: "\u2551",
|
|
76
|
+
bottomRight: "\u255C",
|
|
77
|
+
bottom: "\u2500",
|
|
78
|
+
bottomLeft: "\u2559",
|
|
79
|
+
left: "\u2551"
|
|
80
|
+
},
|
|
81
|
+
doubleSingle: {
|
|
82
|
+
topLeft: "\u2552",
|
|
83
|
+
top: "\u2550",
|
|
84
|
+
topRight: "\u2555",
|
|
85
|
+
right: "\u2502",
|
|
86
|
+
bottomRight: "\u255B",
|
|
87
|
+
bottom: "\u2550",
|
|
88
|
+
bottomLeft: "\u2558",
|
|
89
|
+
left: "\u2502"
|
|
90
|
+
},
|
|
91
|
+
classic: {
|
|
92
|
+
topLeft: "+",
|
|
93
|
+
top: "-",
|
|
94
|
+
topRight: "+",
|
|
95
|
+
right: "|",
|
|
96
|
+
bottomRight: "+",
|
|
97
|
+
bottom: "-",
|
|
98
|
+
bottomLeft: "+",
|
|
99
|
+
left: "|"
|
|
100
|
+
},
|
|
101
|
+
arrow: {
|
|
102
|
+
topLeft: "\u2198",
|
|
103
|
+
top: "\u2193",
|
|
104
|
+
topRight: "\u2199",
|
|
105
|
+
right: "\u2190",
|
|
106
|
+
bottomRight: "\u2196",
|
|
107
|
+
bottom: "\u2191",
|
|
108
|
+
bottomLeft: "\u2197",
|
|
109
|
+
left: "\u2192"
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
// ../../node_modules/.pnpm/cli-boxes@3.0.0/node_modules/cli-boxes/index.js
|
|
116
|
+
var require_cli_boxes = __commonJS({
|
|
117
|
+
"../../node_modules/.pnpm/cli-boxes@3.0.0/node_modules/cli-boxes/index.js"(exports, module) {
|
|
118
|
+
"use strict";
|
|
119
|
+
var cliBoxes2 = require_boxes();
|
|
120
|
+
module.exports = cliBoxes2;
|
|
121
|
+
module.exports.default = cliBoxes2;
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
// ../../node_modules/.pnpm/ansi-regex@5.0.1/node_modules/ansi-regex/index.js
|
|
126
|
+
var require_ansi_regex = __commonJS({
|
|
127
|
+
"../../node_modules/.pnpm/ansi-regex@5.0.1/node_modules/ansi-regex/index.js"(exports, module) {
|
|
128
|
+
"use strict";
|
|
129
|
+
module.exports = ({ onlyFirst = false } = {}) => {
|
|
130
|
+
const pattern = [
|
|
131
|
+
"[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)",
|
|
132
|
+
"(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"
|
|
133
|
+
].join("|");
|
|
134
|
+
return new RegExp(pattern, onlyFirst ? void 0 : "g");
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
// ../../node_modules/.pnpm/strip-ansi@6.0.1/node_modules/strip-ansi/index.js
|
|
140
|
+
var require_strip_ansi = __commonJS({
|
|
141
|
+
"../../node_modules/.pnpm/strip-ansi@6.0.1/node_modules/strip-ansi/index.js"(exports, module) {
|
|
142
|
+
"use strict";
|
|
143
|
+
var ansiRegex2 = require_ansi_regex();
|
|
144
|
+
module.exports = (string) => typeof string === "string" ? string.replace(ansiRegex2(), "") : string;
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
// ../../node_modules/.pnpm/is-fullwidth-code-point@3.0.0/node_modules/is-fullwidth-code-point/index.js
|
|
149
|
+
var require_is_fullwidth_code_point = __commonJS({
|
|
150
|
+
"../../node_modules/.pnpm/is-fullwidth-code-point@3.0.0/node_modules/is-fullwidth-code-point/index.js"(exports, module) {
|
|
151
|
+
"use strict";
|
|
152
|
+
var isFullwidthCodePoint = (codePoint) => {
|
|
153
|
+
if (Number.isNaN(codePoint)) {
|
|
154
|
+
return false;
|
|
155
|
+
}
|
|
156
|
+
if (codePoint >= 4352 && (codePoint <= 4447 || // Hangul Jamo
|
|
157
|
+
codePoint === 9001 || // LEFT-POINTING ANGLE BRACKET
|
|
158
|
+
codePoint === 9002 || // RIGHT-POINTING ANGLE BRACKET
|
|
159
|
+
// CJK Radicals Supplement .. Enclosed CJK Letters and Months
|
|
160
|
+
11904 <= codePoint && codePoint <= 12871 && codePoint !== 12351 || // Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A
|
|
161
|
+
12880 <= codePoint && codePoint <= 19903 || // CJK Unified Ideographs .. Yi Radicals
|
|
162
|
+
19968 <= codePoint && codePoint <= 42182 || // Hangul Jamo Extended-A
|
|
163
|
+
43360 <= codePoint && codePoint <= 43388 || // Hangul Syllables
|
|
164
|
+
44032 <= codePoint && codePoint <= 55203 || // CJK Compatibility Ideographs
|
|
165
|
+
63744 <= codePoint && codePoint <= 64255 || // Vertical Forms
|
|
166
|
+
65040 <= codePoint && codePoint <= 65049 || // CJK Compatibility Forms .. Small Form Variants
|
|
167
|
+
65072 <= codePoint && codePoint <= 65131 || // Halfwidth and Fullwidth Forms
|
|
168
|
+
65281 <= codePoint && codePoint <= 65376 || 65504 <= codePoint && codePoint <= 65510 || // Kana Supplement
|
|
169
|
+
110592 <= codePoint && codePoint <= 110593 || // Enclosed Ideographic Supplement
|
|
170
|
+
127488 <= codePoint && codePoint <= 127569 || // CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane
|
|
171
|
+
131072 <= codePoint && codePoint <= 262141)) {
|
|
172
|
+
return true;
|
|
173
|
+
}
|
|
174
|
+
return false;
|
|
175
|
+
};
|
|
176
|
+
module.exports = isFullwidthCodePoint;
|
|
177
|
+
module.exports.default = isFullwidthCodePoint;
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
// ../../node_modules/.pnpm/emoji-regex@8.0.0/node_modules/emoji-regex/index.js
|
|
182
|
+
var require_emoji_regex = __commonJS({
|
|
183
|
+
"../../node_modules/.pnpm/emoji-regex@8.0.0/node_modules/emoji-regex/index.js"(exports, module) {
|
|
184
|
+
"use strict";
|
|
185
|
+
module.exports = function() {
|
|
186
|
+
return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g;
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
// ../../node_modules/.pnpm/string-width@4.2.3/node_modules/string-width/index.js
|
|
192
|
+
var require_string_width = __commonJS({
|
|
193
|
+
"../../node_modules/.pnpm/string-width@4.2.3/node_modules/string-width/index.js"(exports, module) {
|
|
194
|
+
"use strict";
|
|
195
|
+
var stripAnsi2 = require_strip_ansi();
|
|
196
|
+
var isFullwidthCodePoint = require_is_fullwidth_code_point();
|
|
197
|
+
var emojiRegex = require_emoji_regex();
|
|
198
|
+
var stringWidth2 = (string) => {
|
|
199
|
+
if (typeof string !== "string" || string.length === 0) {
|
|
200
|
+
return 0;
|
|
201
|
+
}
|
|
202
|
+
string = stripAnsi2(string);
|
|
203
|
+
if (string.length === 0) {
|
|
204
|
+
return 0;
|
|
205
|
+
}
|
|
206
|
+
string = string.replace(emojiRegex(), " ");
|
|
207
|
+
let width = 0;
|
|
208
|
+
for (let i = 0; i < string.length; i++) {
|
|
209
|
+
const code = string.codePointAt(i);
|
|
210
|
+
if (code <= 31 || code >= 127 && code <= 159) {
|
|
211
|
+
continue;
|
|
212
|
+
}
|
|
213
|
+
if (code >= 768 && code <= 879) {
|
|
214
|
+
continue;
|
|
215
|
+
}
|
|
216
|
+
if (code > 65535) {
|
|
217
|
+
i++;
|
|
218
|
+
}
|
|
219
|
+
width += isFullwidthCodePoint(code) ? 2 : 1;
|
|
220
|
+
}
|
|
221
|
+
return width;
|
|
222
|
+
};
|
|
223
|
+
module.exports = stringWidth2;
|
|
224
|
+
module.exports.default = stringWidth2;
|
|
225
|
+
}
|
|
226
|
+
});
|
|
227
|
+
|
|
228
|
+
// ../../node_modules/.pnpm/ansi-align@3.0.1/node_modules/ansi-align/index.js
|
|
229
|
+
var require_ansi_align = __commonJS({
|
|
230
|
+
"../../node_modules/.pnpm/ansi-align@3.0.1/node_modules/ansi-align/index.js"(exports, module) {
|
|
231
|
+
"use strict";
|
|
232
|
+
var stringWidth2 = require_string_width();
|
|
233
|
+
function ansiAlign2(text, opts) {
|
|
234
|
+
if (!text) return text;
|
|
235
|
+
opts = opts || {};
|
|
236
|
+
const align = opts.align || "center";
|
|
237
|
+
if (align === "left") return text;
|
|
238
|
+
const split = opts.split || "\n";
|
|
239
|
+
const pad = opts.pad || " ";
|
|
240
|
+
const widthDiffFn = align !== "right" ? halfDiff : fullDiff;
|
|
241
|
+
let returnString = false;
|
|
242
|
+
if (!Array.isArray(text)) {
|
|
243
|
+
returnString = true;
|
|
244
|
+
text = String(text).split(split);
|
|
245
|
+
}
|
|
246
|
+
let width;
|
|
247
|
+
let maxWidth = 0;
|
|
248
|
+
text = text.map(function(str) {
|
|
249
|
+
str = String(str);
|
|
250
|
+
width = stringWidth2(str);
|
|
251
|
+
maxWidth = Math.max(width, maxWidth);
|
|
252
|
+
return {
|
|
253
|
+
str,
|
|
254
|
+
width
|
|
255
|
+
};
|
|
256
|
+
}).map(function(obj) {
|
|
257
|
+
return new Array(widthDiffFn(maxWidth, obj.width) + 1).join(pad) + obj.str;
|
|
258
|
+
});
|
|
259
|
+
return returnString ? text.join(split) : text;
|
|
260
|
+
}
|
|
261
|
+
ansiAlign2.left = function left(text) {
|
|
262
|
+
return ansiAlign2(text, { align: "left" });
|
|
263
|
+
};
|
|
264
|
+
ansiAlign2.center = function center(text) {
|
|
265
|
+
return ansiAlign2(text, { align: "center" });
|
|
266
|
+
};
|
|
267
|
+
ansiAlign2.right = function right(text) {
|
|
268
|
+
return ansiAlign2(text, { align: "right" });
|
|
269
|
+
};
|
|
270
|
+
module.exports = ansiAlign2;
|
|
271
|
+
function halfDiff(maxWidth, curWidth) {
|
|
272
|
+
return Math.floor((maxWidth - curWidth) / 2);
|
|
273
|
+
}
|
|
274
|
+
function fullDiff(maxWidth, curWidth) {
|
|
275
|
+
return maxWidth - curWidth;
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
});
|
|
279
|
+
|
|
1
280
|
// src/index.ts
|
|
2
281
|
import utils2 from "@eventcatalog/sdk";
|
|
3
282
|
import { readFile } from "node:fs/promises";
|
|
4
|
-
import
|
|
283
|
+
import chalk3 from "chalk";
|
|
5
284
|
import SwaggerParser2 from "@apidevtools/swagger-parser";
|
|
6
285
|
|
|
7
286
|
// src/utils/domains.ts
|
|
@@ -67,7 +346,7 @@ async function getSchemasByOperationId(filePath, operationId) {
|
|
|
67
346
|
requestBody: null,
|
|
68
347
|
responses: {}
|
|
69
348
|
};
|
|
70
|
-
for (const [
|
|
349
|
+
for (const [path3, pathItem] of Object.entries(api.paths)) {
|
|
71
350
|
for (const [method, operation] of Object.entries(pathItem)) {
|
|
72
351
|
const typedOperation = operation;
|
|
73
352
|
if (typedOperation.operationId === operationId) {
|
|
@@ -101,8 +380,8 @@ async function getOperationsByType(openApiPath) {
|
|
|
101
380
|
try {
|
|
102
381
|
const api = await SwaggerParser.validate(openApiPath);
|
|
103
382
|
const operations = [];
|
|
104
|
-
for (const
|
|
105
|
-
const pathItem = api.paths[
|
|
383
|
+
for (const path3 in api.paths) {
|
|
384
|
+
const pathItem = api.paths[path3];
|
|
106
385
|
for (const method in pathItem) {
|
|
107
386
|
const openAPIOperation = pathItem[method];
|
|
108
387
|
const messageType = openAPIOperation["x-eventcatalog-message-type"] || DEFAULT_MESSAGE_TYPE;
|
|
@@ -114,7 +393,7 @@ async function getOperationsByType(openApiPath) {
|
|
|
114
393
|
return acc;
|
|
115
394
|
}, {});
|
|
116
395
|
const operation = {
|
|
117
|
-
path:
|
|
396
|
+
path: path3,
|
|
118
397
|
method: method.toUpperCase(),
|
|
119
398
|
operationId: openAPIOperation.operationId,
|
|
120
399
|
externalDocs: openAPIOperation.externalDocs,
|
|
@@ -257,10 +536,10 @@ var buildMessage = async (pathToFile, document, operation) => {
|
|
|
257
536
|
}));
|
|
258
537
|
const badges = [{ content: operation.method.toUpperCase(), textColor: "blue", backgroundColor: "blue" }, ...operationTags];
|
|
259
538
|
const apiName = slugify2(document.info.title, { lower: true });
|
|
260
|
-
const
|
|
539
|
+
const path3 = operation.path.replace(/\//, "").replace(/\//g, "_");
|
|
261
540
|
let uniqueIdentifier = operation.operationId || `${apiName}_${operation.method}`;
|
|
262
|
-
if (!operation.operationId &&
|
|
263
|
-
uniqueIdentifier = uniqueIdentifier.concat(`_${
|
|
541
|
+
if (!operation.operationId && path3) {
|
|
542
|
+
uniqueIdentifier = uniqueIdentifier.concat(`_${path3}`);
|
|
264
543
|
}
|
|
265
544
|
return {
|
|
266
545
|
id: extensions["x-eventcatalog-message-id"] || uniqueIdentifier,
|
|
@@ -329,7 +608,7 @@ import chalk from "chalk";
|
|
|
329
608
|
// package.json
|
|
330
609
|
var package_default = {
|
|
331
610
|
name: "@eventcatalog/generator-openapi",
|
|
332
|
-
version: "4.0.
|
|
611
|
+
version: "4.0.5",
|
|
333
612
|
description: "OpenAPI generator for EventCatalog",
|
|
334
613
|
scripts: {
|
|
335
614
|
build: "tsup",
|
|
@@ -369,7 +648,8 @@ var package_default = {
|
|
|
369
648
|
chalk: "^4",
|
|
370
649
|
"js-yaml": "^4.1.0",
|
|
371
650
|
"openapi-types": "^12.1.3",
|
|
372
|
-
slugify: "^1.6.6"
|
|
651
|
+
slugify: "^1.6.6",
|
|
652
|
+
"update-notifier": "^7.3.1"
|
|
373
653
|
}
|
|
374
654
|
};
|
|
375
655
|
|
|
@@ -415,6 +695,864 @@ You are using a trial license for this plugin`));
|
|
|
415
695
|
// src/index.ts
|
|
416
696
|
import yaml from "js-yaml";
|
|
417
697
|
import { join } from "node:path";
|
|
698
|
+
|
|
699
|
+
// ../../node_modules/.pnpm/boxen@8.0.1/node_modules/boxen/index.js
|
|
700
|
+
import process2 from "node:process";
|
|
701
|
+
|
|
702
|
+
// ../../node_modules/.pnpm/ansi-regex@6.1.0/node_modules/ansi-regex/index.js
|
|
703
|
+
function ansiRegex({ onlyFirst = false } = {}) {
|
|
704
|
+
const ST = "(?:\\u0007|\\u001B\\u005C|\\u009C)";
|
|
705
|
+
const pattern = [
|
|
706
|
+
`[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?${ST})`,
|
|
707
|
+
"(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"
|
|
708
|
+
].join("|");
|
|
709
|
+
return new RegExp(pattern, onlyFirst ? void 0 : "g");
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
// ../../node_modules/.pnpm/strip-ansi@7.1.0/node_modules/strip-ansi/index.js
|
|
713
|
+
var regex = ansiRegex();
|
|
714
|
+
function stripAnsi(string) {
|
|
715
|
+
if (typeof string !== "string") {
|
|
716
|
+
throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
|
|
717
|
+
}
|
|
718
|
+
return string.replace(regex, "");
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
// ../../node_modules/.pnpm/get-east-asian-width@1.3.0/node_modules/get-east-asian-width/lookup.js
|
|
722
|
+
function isAmbiguous(x) {
|
|
723
|
+
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;
|
|
724
|
+
}
|
|
725
|
+
function isFullWidth(x) {
|
|
726
|
+
return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510;
|
|
727
|
+
}
|
|
728
|
+
function isWide(x) {
|
|
729
|
+
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;
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
// ../../node_modules/.pnpm/get-east-asian-width@1.3.0/node_modules/get-east-asian-width/index.js
|
|
733
|
+
function validate(codePoint) {
|
|
734
|
+
if (!Number.isSafeInteger(codePoint)) {
|
|
735
|
+
throw new TypeError(`Expected a code point, got \`${typeof codePoint}\`.`);
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
function eastAsianWidth(codePoint, { ambiguousAsWide = false } = {}) {
|
|
739
|
+
validate(codePoint);
|
|
740
|
+
if (isFullWidth(codePoint) || isWide(codePoint) || ambiguousAsWide && isAmbiguous(codePoint)) {
|
|
741
|
+
return 2;
|
|
742
|
+
}
|
|
743
|
+
return 1;
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
// ../../node_modules/.pnpm/emoji-regex@10.4.0/node_modules/emoji-regex/index.mjs
|
|
747
|
+
var emoji_regex_default = () => {
|
|
748
|
+
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;
|
|
749
|
+
};
|
|
750
|
+
|
|
751
|
+
// ../../node_modules/.pnpm/string-width@7.2.0/node_modules/string-width/index.js
|
|
752
|
+
var segmenter = new Intl.Segmenter();
|
|
753
|
+
var defaultIgnorableCodePointRegex = /^\p{Default_Ignorable_Code_Point}$/u;
|
|
754
|
+
function stringWidth(string, options = {}) {
|
|
755
|
+
if (typeof string !== "string" || string.length === 0) {
|
|
756
|
+
return 0;
|
|
757
|
+
}
|
|
758
|
+
const {
|
|
759
|
+
ambiguousIsNarrow = true,
|
|
760
|
+
countAnsiEscapeCodes = false
|
|
761
|
+
} = options;
|
|
762
|
+
if (!countAnsiEscapeCodes) {
|
|
763
|
+
string = stripAnsi(string);
|
|
764
|
+
}
|
|
765
|
+
if (string.length === 0) {
|
|
766
|
+
return 0;
|
|
767
|
+
}
|
|
768
|
+
let width = 0;
|
|
769
|
+
const eastAsianWidthOptions = { ambiguousAsWide: !ambiguousIsNarrow };
|
|
770
|
+
for (const { segment: character } of segmenter.segment(string)) {
|
|
771
|
+
const codePoint = character.codePointAt(0);
|
|
772
|
+
if (codePoint <= 31 || codePoint >= 127 && codePoint <= 159) {
|
|
773
|
+
continue;
|
|
774
|
+
}
|
|
775
|
+
if (codePoint >= 8203 && codePoint <= 8207 || codePoint === 65279) {
|
|
776
|
+
continue;
|
|
777
|
+
}
|
|
778
|
+
if (codePoint >= 768 && codePoint <= 879 || codePoint >= 6832 && codePoint <= 6911 || codePoint >= 7616 && codePoint <= 7679 || codePoint >= 8400 && codePoint <= 8447 || codePoint >= 65056 && codePoint <= 65071) {
|
|
779
|
+
continue;
|
|
780
|
+
}
|
|
781
|
+
if (codePoint >= 55296 && codePoint <= 57343) {
|
|
782
|
+
continue;
|
|
783
|
+
}
|
|
784
|
+
if (codePoint >= 65024 && codePoint <= 65039) {
|
|
785
|
+
continue;
|
|
786
|
+
}
|
|
787
|
+
if (defaultIgnorableCodePointRegex.test(character)) {
|
|
788
|
+
continue;
|
|
789
|
+
}
|
|
790
|
+
if (emoji_regex_default().test(character)) {
|
|
791
|
+
width += 2;
|
|
792
|
+
continue;
|
|
793
|
+
}
|
|
794
|
+
width += eastAsianWidth(codePoint, eastAsianWidthOptions);
|
|
795
|
+
}
|
|
796
|
+
return width;
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
// ../../node_modules/.pnpm/boxen@8.0.1/node_modules/boxen/index.js
|
|
800
|
+
import chalk2 from "chalk";
|
|
801
|
+
|
|
802
|
+
// ../../node_modules/.pnpm/widest-line@5.0.0/node_modules/widest-line/index.js
|
|
803
|
+
function widestLine(string) {
|
|
804
|
+
let lineWidth = 0;
|
|
805
|
+
for (const line of string.split("\n")) {
|
|
806
|
+
lineWidth = Math.max(lineWidth, stringWidth(line));
|
|
807
|
+
}
|
|
808
|
+
return lineWidth;
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
// ../../node_modules/.pnpm/boxen@8.0.1/node_modules/boxen/index.js
|
|
812
|
+
var import_cli_boxes = __toESM(require_cli_boxes(), 1);
|
|
813
|
+
|
|
814
|
+
// ../../node_modules/.pnpm/camelcase@8.0.0/node_modules/camelcase/index.js
|
|
815
|
+
var UPPERCASE = /[\p{Lu}]/u;
|
|
816
|
+
var LOWERCASE = /[\p{Ll}]/u;
|
|
817
|
+
var LEADING_CAPITAL = /^[\p{Lu}](?![\p{Lu}])/gu;
|
|
818
|
+
var IDENTIFIER = /([\p{Alpha}\p{N}_]|$)/u;
|
|
819
|
+
var SEPARATORS = /[_.\- ]+/;
|
|
820
|
+
var LEADING_SEPARATORS = new RegExp("^" + SEPARATORS.source);
|
|
821
|
+
var SEPARATORS_AND_IDENTIFIER = new RegExp(SEPARATORS.source + IDENTIFIER.source, "gu");
|
|
822
|
+
var NUMBERS_AND_IDENTIFIER = new RegExp("\\d+" + IDENTIFIER.source, "gu");
|
|
823
|
+
var preserveCamelCase = (string, toLowerCase, toUpperCase, preserveConsecutiveUppercase2) => {
|
|
824
|
+
let isLastCharLower = false;
|
|
825
|
+
let isLastCharUpper = false;
|
|
826
|
+
let isLastLastCharUpper = false;
|
|
827
|
+
let isLastLastCharPreserved = false;
|
|
828
|
+
for (let index = 0; index < string.length; index++) {
|
|
829
|
+
const character = string[index];
|
|
830
|
+
isLastLastCharPreserved = index > 2 ? string[index - 3] === "-" : true;
|
|
831
|
+
if (isLastCharLower && UPPERCASE.test(character)) {
|
|
832
|
+
string = string.slice(0, index) + "-" + string.slice(index);
|
|
833
|
+
isLastCharLower = false;
|
|
834
|
+
isLastLastCharUpper = isLastCharUpper;
|
|
835
|
+
isLastCharUpper = true;
|
|
836
|
+
index++;
|
|
837
|
+
} else if (isLastCharUpper && isLastLastCharUpper && LOWERCASE.test(character) && (!isLastLastCharPreserved || preserveConsecutiveUppercase2)) {
|
|
838
|
+
string = string.slice(0, index - 1) + "-" + string.slice(index - 1);
|
|
839
|
+
isLastLastCharUpper = isLastCharUpper;
|
|
840
|
+
isLastCharUpper = false;
|
|
841
|
+
isLastCharLower = true;
|
|
842
|
+
} else {
|
|
843
|
+
isLastCharLower = toLowerCase(character) === character && toUpperCase(character) !== character;
|
|
844
|
+
isLastLastCharUpper = isLastCharUpper;
|
|
845
|
+
isLastCharUpper = toUpperCase(character) === character && toLowerCase(character) !== character;
|
|
846
|
+
}
|
|
847
|
+
}
|
|
848
|
+
return string;
|
|
849
|
+
};
|
|
850
|
+
var preserveConsecutiveUppercase = (input, toLowerCase) => {
|
|
851
|
+
LEADING_CAPITAL.lastIndex = 0;
|
|
852
|
+
return input.replaceAll(LEADING_CAPITAL, (match) => toLowerCase(match));
|
|
853
|
+
};
|
|
854
|
+
var postProcess = (input, toUpperCase) => {
|
|
855
|
+
SEPARATORS_AND_IDENTIFIER.lastIndex = 0;
|
|
856
|
+
NUMBERS_AND_IDENTIFIER.lastIndex = 0;
|
|
857
|
+
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));
|
|
858
|
+
};
|
|
859
|
+
function camelCase(input, options) {
|
|
860
|
+
if (!(typeof input === "string" || Array.isArray(input))) {
|
|
861
|
+
throw new TypeError("Expected the input to be `string | string[]`");
|
|
862
|
+
}
|
|
863
|
+
options = {
|
|
864
|
+
pascalCase: false,
|
|
865
|
+
preserveConsecutiveUppercase: false,
|
|
866
|
+
...options
|
|
867
|
+
};
|
|
868
|
+
if (Array.isArray(input)) {
|
|
869
|
+
input = input.map((x) => x.trim()).filter((x) => x.length).join("-");
|
|
870
|
+
} else {
|
|
871
|
+
input = input.trim();
|
|
872
|
+
}
|
|
873
|
+
if (input.length === 0) {
|
|
874
|
+
return "";
|
|
875
|
+
}
|
|
876
|
+
const toLowerCase = options.locale === false ? (string) => string.toLowerCase() : (string) => string.toLocaleLowerCase(options.locale);
|
|
877
|
+
const toUpperCase = options.locale === false ? (string) => string.toUpperCase() : (string) => string.toLocaleUpperCase(options.locale);
|
|
878
|
+
if (input.length === 1) {
|
|
879
|
+
if (SEPARATORS.test(input)) {
|
|
880
|
+
return "";
|
|
881
|
+
}
|
|
882
|
+
return options.pascalCase ? toUpperCase(input) : toLowerCase(input);
|
|
883
|
+
}
|
|
884
|
+
const hasUpperCase = input !== toLowerCase(input);
|
|
885
|
+
if (hasUpperCase) {
|
|
886
|
+
input = preserveCamelCase(input, toLowerCase, toUpperCase, options.preserveConsecutiveUppercase);
|
|
887
|
+
}
|
|
888
|
+
input = input.replace(LEADING_SEPARATORS, "");
|
|
889
|
+
input = options.preserveConsecutiveUppercase ? preserveConsecutiveUppercase(input, toLowerCase) : toLowerCase(input);
|
|
890
|
+
if (options.pascalCase) {
|
|
891
|
+
input = toUpperCase(input.charAt(0)) + input.slice(1);
|
|
892
|
+
}
|
|
893
|
+
return postProcess(input, toUpperCase);
|
|
894
|
+
}
|
|
895
|
+
|
|
896
|
+
// ../../node_modules/.pnpm/boxen@8.0.1/node_modules/boxen/index.js
|
|
897
|
+
var import_ansi_align = __toESM(require_ansi_align(), 1);
|
|
898
|
+
|
|
899
|
+
// ../../node_modules/.pnpm/ansi-styles@6.2.1/node_modules/ansi-styles/index.js
|
|
900
|
+
var ANSI_BACKGROUND_OFFSET = 10;
|
|
901
|
+
var wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
|
|
902
|
+
var wrapAnsi256 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`;
|
|
903
|
+
var wrapAnsi16m = (offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`;
|
|
904
|
+
var styles = {
|
|
905
|
+
modifier: {
|
|
906
|
+
reset: [0, 0],
|
|
907
|
+
// 21 isn't widely supported and 22 does the same thing
|
|
908
|
+
bold: [1, 22],
|
|
909
|
+
dim: [2, 22],
|
|
910
|
+
italic: [3, 23],
|
|
911
|
+
underline: [4, 24],
|
|
912
|
+
overline: [53, 55],
|
|
913
|
+
inverse: [7, 27],
|
|
914
|
+
hidden: [8, 28],
|
|
915
|
+
strikethrough: [9, 29]
|
|
916
|
+
},
|
|
917
|
+
color: {
|
|
918
|
+
black: [30, 39],
|
|
919
|
+
red: [31, 39],
|
|
920
|
+
green: [32, 39],
|
|
921
|
+
yellow: [33, 39],
|
|
922
|
+
blue: [34, 39],
|
|
923
|
+
magenta: [35, 39],
|
|
924
|
+
cyan: [36, 39],
|
|
925
|
+
white: [37, 39],
|
|
926
|
+
// Bright color
|
|
927
|
+
blackBright: [90, 39],
|
|
928
|
+
gray: [90, 39],
|
|
929
|
+
// Alias of `blackBright`
|
|
930
|
+
grey: [90, 39],
|
|
931
|
+
// Alias of `blackBright`
|
|
932
|
+
redBright: [91, 39],
|
|
933
|
+
greenBright: [92, 39],
|
|
934
|
+
yellowBright: [93, 39],
|
|
935
|
+
blueBright: [94, 39],
|
|
936
|
+
magentaBright: [95, 39],
|
|
937
|
+
cyanBright: [96, 39],
|
|
938
|
+
whiteBright: [97, 39]
|
|
939
|
+
},
|
|
940
|
+
bgColor: {
|
|
941
|
+
bgBlack: [40, 49],
|
|
942
|
+
bgRed: [41, 49],
|
|
943
|
+
bgGreen: [42, 49],
|
|
944
|
+
bgYellow: [43, 49],
|
|
945
|
+
bgBlue: [44, 49],
|
|
946
|
+
bgMagenta: [45, 49],
|
|
947
|
+
bgCyan: [46, 49],
|
|
948
|
+
bgWhite: [47, 49],
|
|
949
|
+
// Bright color
|
|
950
|
+
bgBlackBright: [100, 49],
|
|
951
|
+
bgGray: [100, 49],
|
|
952
|
+
// Alias of `bgBlackBright`
|
|
953
|
+
bgGrey: [100, 49],
|
|
954
|
+
// Alias of `bgBlackBright`
|
|
955
|
+
bgRedBright: [101, 49],
|
|
956
|
+
bgGreenBright: [102, 49],
|
|
957
|
+
bgYellowBright: [103, 49],
|
|
958
|
+
bgBlueBright: [104, 49],
|
|
959
|
+
bgMagentaBright: [105, 49],
|
|
960
|
+
bgCyanBright: [106, 49],
|
|
961
|
+
bgWhiteBright: [107, 49]
|
|
962
|
+
}
|
|
963
|
+
};
|
|
964
|
+
var modifierNames = Object.keys(styles.modifier);
|
|
965
|
+
var foregroundColorNames = Object.keys(styles.color);
|
|
966
|
+
var backgroundColorNames = Object.keys(styles.bgColor);
|
|
967
|
+
var colorNames = [...foregroundColorNames, ...backgroundColorNames];
|
|
968
|
+
function assembleStyles() {
|
|
969
|
+
const codes = /* @__PURE__ */ new Map();
|
|
970
|
+
for (const [groupName, group] of Object.entries(styles)) {
|
|
971
|
+
for (const [styleName, style] of Object.entries(group)) {
|
|
972
|
+
styles[styleName] = {
|
|
973
|
+
open: `\x1B[${style[0]}m`,
|
|
974
|
+
close: `\x1B[${style[1]}m`
|
|
975
|
+
};
|
|
976
|
+
group[styleName] = styles[styleName];
|
|
977
|
+
codes.set(style[0], style[1]);
|
|
978
|
+
}
|
|
979
|
+
Object.defineProperty(styles, groupName, {
|
|
980
|
+
value: group,
|
|
981
|
+
enumerable: false
|
|
982
|
+
});
|
|
983
|
+
}
|
|
984
|
+
Object.defineProperty(styles, "codes", {
|
|
985
|
+
value: codes,
|
|
986
|
+
enumerable: false
|
|
987
|
+
});
|
|
988
|
+
styles.color.close = "\x1B[39m";
|
|
989
|
+
styles.bgColor.close = "\x1B[49m";
|
|
990
|
+
styles.color.ansi = wrapAnsi16();
|
|
991
|
+
styles.color.ansi256 = wrapAnsi256();
|
|
992
|
+
styles.color.ansi16m = wrapAnsi16m();
|
|
993
|
+
styles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
|
|
994
|
+
styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
|
|
995
|
+
styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
|
|
996
|
+
Object.defineProperties(styles, {
|
|
997
|
+
rgbToAnsi256: {
|
|
998
|
+
value: (red, green, blue) => {
|
|
999
|
+
if (red === green && green === blue) {
|
|
1000
|
+
if (red < 8) {
|
|
1001
|
+
return 16;
|
|
1002
|
+
}
|
|
1003
|
+
if (red > 248) {
|
|
1004
|
+
return 231;
|
|
1005
|
+
}
|
|
1006
|
+
return Math.round((red - 8) / 247 * 24) + 232;
|
|
1007
|
+
}
|
|
1008
|
+
return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
|
|
1009
|
+
},
|
|
1010
|
+
enumerable: false
|
|
1011
|
+
},
|
|
1012
|
+
hexToRgb: {
|
|
1013
|
+
value: (hex) => {
|
|
1014
|
+
const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
|
|
1015
|
+
if (!matches) {
|
|
1016
|
+
return [0, 0, 0];
|
|
1017
|
+
}
|
|
1018
|
+
let [colorString] = matches;
|
|
1019
|
+
if (colorString.length === 3) {
|
|
1020
|
+
colorString = [...colorString].map((character) => character + character).join("");
|
|
1021
|
+
}
|
|
1022
|
+
const integer = Number.parseInt(colorString, 16);
|
|
1023
|
+
return [
|
|
1024
|
+
/* eslint-disable no-bitwise */
|
|
1025
|
+
integer >> 16 & 255,
|
|
1026
|
+
integer >> 8 & 255,
|
|
1027
|
+
integer & 255
|
|
1028
|
+
/* eslint-enable no-bitwise */
|
|
1029
|
+
];
|
|
1030
|
+
},
|
|
1031
|
+
enumerable: false
|
|
1032
|
+
},
|
|
1033
|
+
hexToAnsi256: {
|
|
1034
|
+
value: (hex) => styles.rgbToAnsi256(...styles.hexToRgb(hex)),
|
|
1035
|
+
enumerable: false
|
|
1036
|
+
},
|
|
1037
|
+
ansi256ToAnsi: {
|
|
1038
|
+
value: (code) => {
|
|
1039
|
+
if (code < 8) {
|
|
1040
|
+
return 30 + code;
|
|
1041
|
+
}
|
|
1042
|
+
if (code < 16) {
|
|
1043
|
+
return 90 + (code - 8);
|
|
1044
|
+
}
|
|
1045
|
+
let red;
|
|
1046
|
+
let green;
|
|
1047
|
+
let blue;
|
|
1048
|
+
if (code >= 232) {
|
|
1049
|
+
red = ((code - 232) * 10 + 8) / 255;
|
|
1050
|
+
green = red;
|
|
1051
|
+
blue = red;
|
|
1052
|
+
} else {
|
|
1053
|
+
code -= 16;
|
|
1054
|
+
const remainder = code % 36;
|
|
1055
|
+
red = Math.floor(code / 36) / 5;
|
|
1056
|
+
green = Math.floor(remainder / 6) / 5;
|
|
1057
|
+
blue = remainder % 6 / 5;
|
|
1058
|
+
}
|
|
1059
|
+
const value = Math.max(red, green, blue) * 2;
|
|
1060
|
+
if (value === 0) {
|
|
1061
|
+
return 30;
|
|
1062
|
+
}
|
|
1063
|
+
let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
|
|
1064
|
+
if (value === 2) {
|
|
1065
|
+
result += 60;
|
|
1066
|
+
}
|
|
1067
|
+
return result;
|
|
1068
|
+
},
|
|
1069
|
+
enumerable: false
|
|
1070
|
+
},
|
|
1071
|
+
rgbToAnsi: {
|
|
1072
|
+
value: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)),
|
|
1073
|
+
enumerable: false
|
|
1074
|
+
},
|
|
1075
|
+
hexToAnsi: {
|
|
1076
|
+
value: (hex) => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),
|
|
1077
|
+
enumerable: false
|
|
1078
|
+
}
|
|
1079
|
+
});
|
|
1080
|
+
return styles;
|
|
1081
|
+
}
|
|
1082
|
+
var ansiStyles = assembleStyles();
|
|
1083
|
+
var ansi_styles_default = ansiStyles;
|
|
1084
|
+
|
|
1085
|
+
// ../../node_modules/.pnpm/wrap-ansi@9.0.0/node_modules/wrap-ansi/index.js
|
|
1086
|
+
var ESCAPES = /* @__PURE__ */ new Set([
|
|
1087
|
+
"\x1B",
|
|
1088
|
+
"\x9B"
|
|
1089
|
+
]);
|
|
1090
|
+
var END_CODE = 39;
|
|
1091
|
+
var ANSI_ESCAPE_BELL = "\x07";
|
|
1092
|
+
var ANSI_CSI = "[";
|
|
1093
|
+
var ANSI_OSC = "]";
|
|
1094
|
+
var ANSI_SGR_TERMINATOR = "m";
|
|
1095
|
+
var ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`;
|
|
1096
|
+
var wrapAnsiCode = (code) => `${ESCAPES.values().next().value}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`;
|
|
1097
|
+
var wrapAnsiHyperlink = (url) => `${ESCAPES.values().next().value}${ANSI_ESCAPE_LINK}${url}${ANSI_ESCAPE_BELL}`;
|
|
1098
|
+
var wordLengths = (string) => string.split(" ").map((character) => stringWidth(character));
|
|
1099
|
+
var wrapWord = (rows, word, columns) => {
|
|
1100
|
+
const characters = [...word];
|
|
1101
|
+
let isInsideEscape = false;
|
|
1102
|
+
let isInsideLinkEscape = false;
|
|
1103
|
+
let visible = stringWidth(stripAnsi(rows.at(-1)));
|
|
1104
|
+
for (const [index, character] of characters.entries()) {
|
|
1105
|
+
const characterLength = stringWidth(character);
|
|
1106
|
+
if (visible + characterLength <= columns) {
|
|
1107
|
+
rows[rows.length - 1] += character;
|
|
1108
|
+
} else {
|
|
1109
|
+
rows.push(character);
|
|
1110
|
+
visible = 0;
|
|
1111
|
+
}
|
|
1112
|
+
if (ESCAPES.has(character)) {
|
|
1113
|
+
isInsideEscape = true;
|
|
1114
|
+
const ansiEscapeLinkCandidate = characters.slice(index + 1, index + 1 + ANSI_ESCAPE_LINK.length).join("");
|
|
1115
|
+
isInsideLinkEscape = ansiEscapeLinkCandidate === ANSI_ESCAPE_LINK;
|
|
1116
|
+
}
|
|
1117
|
+
if (isInsideEscape) {
|
|
1118
|
+
if (isInsideLinkEscape) {
|
|
1119
|
+
if (character === ANSI_ESCAPE_BELL) {
|
|
1120
|
+
isInsideEscape = false;
|
|
1121
|
+
isInsideLinkEscape = false;
|
|
1122
|
+
}
|
|
1123
|
+
} else if (character === ANSI_SGR_TERMINATOR) {
|
|
1124
|
+
isInsideEscape = false;
|
|
1125
|
+
}
|
|
1126
|
+
continue;
|
|
1127
|
+
}
|
|
1128
|
+
visible += characterLength;
|
|
1129
|
+
if (visible === columns && index < characters.length - 1) {
|
|
1130
|
+
rows.push("");
|
|
1131
|
+
visible = 0;
|
|
1132
|
+
}
|
|
1133
|
+
}
|
|
1134
|
+
if (!visible && rows.at(-1).length > 0 && rows.length > 1) {
|
|
1135
|
+
rows[rows.length - 2] += rows.pop();
|
|
1136
|
+
}
|
|
1137
|
+
};
|
|
1138
|
+
var stringVisibleTrimSpacesRight = (string) => {
|
|
1139
|
+
const words = string.split(" ");
|
|
1140
|
+
let last = words.length;
|
|
1141
|
+
while (last > 0) {
|
|
1142
|
+
if (stringWidth(words[last - 1]) > 0) {
|
|
1143
|
+
break;
|
|
1144
|
+
}
|
|
1145
|
+
last--;
|
|
1146
|
+
}
|
|
1147
|
+
if (last === words.length) {
|
|
1148
|
+
return string;
|
|
1149
|
+
}
|
|
1150
|
+
return words.slice(0, last).join(" ") + words.slice(last).join("");
|
|
1151
|
+
};
|
|
1152
|
+
var exec = (string, columns, options = {}) => {
|
|
1153
|
+
if (options.trim !== false && string.trim() === "") {
|
|
1154
|
+
return "";
|
|
1155
|
+
}
|
|
1156
|
+
let returnValue = "";
|
|
1157
|
+
let escapeCode;
|
|
1158
|
+
let escapeUrl;
|
|
1159
|
+
const lengths = wordLengths(string);
|
|
1160
|
+
let rows = [""];
|
|
1161
|
+
for (const [index, word] of string.split(" ").entries()) {
|
|
1162
|
+
if (options.trim !== false) {
|
|
1163
|
+
rows[rows.length - 1] = rows.at(-1).trimStart();
|
|
1164
|
+
}
|
|
1165
|
+
let rowLength = stringWidth(rows.at(-1));
|
|
1166
|
+
if (index !== 0) {
|
|
1167
|
+
if (rowLength >= columns && (options.wordWrap === false || options.trim === false)) {
|
|
1168
|
+
rows.push("");
|
|
1169
|
+
rowLength = 0;
|
|
1170
|
+
}
|
|
1171
|
+
if (rowLength > 0 || options.trim === false) {
|
|
1172
|
+
rows[rows.length - 1] += " ";
|
|
1173
|
+
rowLength++;
|
|
1174
|
+
}
|
|
1175
|
+
}
|
|
1176
|
+
if (options.hard && lengths[index] > columns) {
|
|
1177
|
+
const remainingColumns = columns - rowLength;
|
|
1178
|
+
const breaksStartingThisLine = 1 + Math.floor((lengths[index] - remainingColumns - 1) / columns);
|
|
1179
|
+
const breaksStartingNextLine = Math.floor((lengths[index] - 1) / columns);
|
|
1180
|
+
if (breaksStartingNextLine < breaksStartingThisLine) {
|
|
1181
|
+
rows.push("");
|
|
1182
|
+
}
|
|
1183
|
+
wrapWord(rows, word, columns);
|
|
1184
|
+
continue;
|
|
1185
|
+
}
|
|
1186
|
+
if (rowLength + lengths[index] > columns && rowLength > 0 && lengths[index] > 0) {
|
|
1187
|
+
if (options.wordWrap === false && rowLength < columns) {
|
|
1188
|
+
wrapWord(rows, word, columns);
|
|
1189
|
+
continue;
|
|
1190
|
+
}
|
|
1191
|
+
rows.push("");
|
|
1192
|
+
}
|
|
1193
|
+
if (rowLength + lengths[index] > columns && options.wordWrap === false) {
|
|
1194
|
+
wrapWord(rows, word, columns);
|
|
1195
|
+
continue;
|
|
1196
|
+
}
|
|
1197
|
+
rows[rows.length - 1] += word;
|
|
1198
|
+
}
|
|
1199
|
+
if (options.trim !== false) {
|
|
1200
|
+
rows = rows.map((row) => stringVisibleTrimSpacesRight(row));
|
|
1201
|
+
}
|
|
1202
|
+
const preString = rows.join("\n");
|
|
1203
|
+
const pre = [...preString];
|
|
1204
|
+
let preStringIndex = 0;
|
|
1205
|
+
for (const [index, character] of pre.entries()) {
|
|
1206
|
+
returnValue += character;
|
|
1207
|
+
if (ESCAPES.has(character)) {
|
|
1208
|
+
const { groups } = new RegExp(`(?:\\${ANSI_CSI}(?<code>\\d+)m|\\${ANSI_ESCAPE_LINK}(?<uri>.*)${ANSI_ESCAPE_BELL})`).exec(preString.slice(preStringIndex)) || { groups: {} };
|
|
1209
|
+
if (groups.code !== void 0) {
|
|
1210
|
+
const code2 = Number.parseFloat(groups.code);
|
|
1211
|
+
escapeCode = code2 === END_CODE ? void 0 : code2;
|
|
1212
|
+
} else if (groups.uri !== void 0) {
|
|
1213
|
+
escapeUrl = groups.uri.length === 0 ? void 0 : groups.uri;
|
|
1214
|
+
}
|
|
1215
|
+
}
|
|
1216
|
+
const code = ansi_styles_default.codes.get(Number(escapeCode));
|
|
1217
|
+
if (pre[index + 1] === "\n") {
|
|
1218
|
+
if (escapeUrl) {
|
|
1219
|
+
returnValue += wrapAnsiHyperlink("");
|
|
1220
|
+
}
|
|
1221
|
+
if (escapeCode && code) {
|
|
1222
|
+
returnValue += wrapAnsiCode(code);
|
|
1223
|
+
}
|
|
1224
|
+
} else if (character === "\n") {
|
|
1225
|
+
if (escapeCode && code) {
|
|
1226
|
+
returnValue += wrapAnsiCode(escapeCode);
|
|
1227
|
+
}
|
|
1228
|
+
if (escapeUrl) {
|
|
1229
|
+
returnValue += wrapAnsiHyperlink(escapeUrl);
|
|
1230
|
+
}
|
|
1231
|
+
}
|
|
1232
|
+
preStringIndex += character.length;
|
|
1233
|
+
}
|
|
1234
|
+
return returnValue;
|
|
1235
|
+
};
|
|
1236
|
+
function wrapAnsi(string, columns, options) {
|
|
1237
|
+
return String(string).normalize().replaceAll("\r\n", "\n").split("\n").map((line) => exec(line, columns, options)).join("\n");
|
|
1238
|
+
}
|
|
1239
|
+
|
|
1240
|
+
// ../../node_modules/.pnpm/boxen@8.0.1/node_modules/boxen/index.js
|
|
1241
|
+
var import_cli_boxes2 = __toESM(require_cli_boxes(), 1);
|
|
1242
|
+
var NEWLINE = "\n";
|
|
1243
|
+
var PAD = " ";
|
|
1244
|
+
var NONE = "none";
|
|
1245
|
+
var terminalColumns = () => {
|
|
1246
|
+
const { env, stdout, stderr } = process2;
|
|
1247
|
+
if (stdout?.columns) {
|
|
1248
|
+
return stdout.columns;
|
|
1249
|
+
}
|
|
1250
|
+
if (stderr?.columns) {
|
|
1251
|
+
return stderr.columns;
|
|
1252
|
+
}
|
|
1253
|
+
if (env.COLUMNS) {
|
|
1254
|
+
return Number.parseInt(env.COLUMNS, 10);
|
|
1255
|
+
}
|
|
1256
|
+
return 80;
|
|
1257
|
+
};
|
|
1258
|
+
var getObject = (detail) => typeof detail === "number" ? {
|
|
1259
|
+
top: detail,
|
|
1260
|
+
right: detail * 3,
|
|
1261
|
+
bottom: detail,
|
|
1262
|
+
left: detail * 3
|
|
1263
|
+
} : {
|
|
1264
|
+
top: 0,
|
|
1265
|
+
right: 0,
|
|
1266
|
+
bottom: 0,
|
|
1267
|
+
left: 0,
|
|
1268
|
+
...detail
|
|
1269
|
+
};
|
|
1270
|
+
var getBorderWidth = (borderStyle) => borderStyle === NONE ? 0 : 2;
|
|
1271
|
+
var getBorderChars = (borderStyle) => {
|
|
1272
|
+
const sides = [
|
|
1273
|
+
"topLeft",
|
|
1274
|
+
"topRight",
|
|
1275
|
+
"bottomRight",
|
|
1276
|
+
"bottomLeft",
|
|
1277
|
+
"left",
|
|
1278
|
+
"right",
|
|
1279
|
+
"top",
|
|
1280
|
+
"bottom"
|
|
1281
|
+
];
|
|
1282
|
+
let characters;
|
|
1283
|
+
if (borderStyle === NONE) {
|
|
1284
|
+
borderStyle = {};
|
|
1285
|
+
for (const side of sides) {
|
|
1286
|
+
borderStyle[side] = "";
|
|
1287
|
+
}
|
|
1288
|
+
}
|
|
1289
|
+
if (typeof borderStyle === "string") {
|
|
1290
|
+
characters = import_cli_boxes.default[borderStyle];
|
|
1291
|
+
if (!characters) {
|
|
1292
|
+
throw new TypeError(`Invalid border style: ${borderStyle}`);
|
|
1293
|
+
}
|
|
1294
|
+
} else {
|
|
1295
|
+
if (typeof borderStyle?.vertical === "string") {
|
|
1296
|
+
borderStyle.left = borderStyle.vertical;
|
|
1297
|
+
borderStyle.right = borderStyle.vertical;
|
|
1298
|
+
}
|
|
1299
|
+
if (typeof borderStyle?.horizontal === "string") {
|
|
1300
|
+
borderStyle.top = borderStyle.horizontal;
|
|
1301
|
+
borderStyle.bottom = borderStyle.horizontal;
|
|
1302
|
+
}
|
|
1303
|
+
for (const side of sides) {
|
|
1304
|
+
if (borderStyle[side] === null || typeof borderStyle[side] !== "string") {
|
|
1305
|
+
throw new TypeError(`Invalid border style: ${side}`);
|
|
1306
|
+
}
|
|
1307
|
+
}
|
|
1308
|
+
characters = borderStyle;
|
|
1309
|
+
}
|
|
1310
|
+
return characters;
|
|
1311
|
+
};
|
|
1312
|
+
var makeTitle = (text, horizontal, alignment) => {
|
|
1313
|
+
let title = "";
|
|
1314
|
+
const textWidth = stringWidth(text);
|
|
1315
|
+
switch (alignment) {
|
|
1316
|
+
case "left": {
|
|
1317
|
+
title = text + horizontal.slice(textWidth);
|
|
1318
|
+
break;
|
|
1319
|
+
}
|
|
1320
|
+
case "right": {
|
|
1321
|
+
title = horizontal.slice(textWidth) + text;
|
|
1322
|
+
break;
|
|
1323
|
+
}
|
|
1324
|
+
default: {
|
|
1325
|
+
horizontal = horizontal.slice(textWidth);
|
|
1326
|
+
if (horizontal.length % 2 === 1) {
|
|
1327
|
+
horizontal = horizontal.slice(Math.floor(horizontal.length / 2));
|
|
1328
|
+
title = horizontal.slice(1) + text + horizontal;
|
|
1329
|
+
} else {
|
|
1330
|
+
horizontal = horizontal.slice(horizontal.length / 2);
|
|
1331
|
+
title = horizontal + text + horizontal;
|
|
1332
|
+
}
|
|
1333
|
+
break;
|
|
1334
|
+
}
|
|
1335
|
+
}
|
|
1336
|
+
return title;
|
|
1337
|
+
};
|
|
1338
|
+
var makeContentText = (text, { padding, width, textAlignment, height }) => {
|
|
1339
|
+
text = (0, import_ansi_align.default)(text, { align: textAlignment });
|
|
1340
|
+
let lines = text.split(NEWLINE);
|
|
1341
|
+
const textWidth = widestLine(text);
|
|
1342
|
+
const max = width - padding.left - padding.right;
|
|
1343
|
+
if (textWidth > max) {
|
|
1344
|
+
const newLines = [];
|
|
1345
|
+
for (const line of lines) {
|
|
1346
|
+
const createdLines = wrapAnsi(line, max, { hard: true });
|
|
1347
|
+
const alignedLines = (0, import_ansi_align.default)(createdLines, { align: textAlignment });
|
|
1348
|
+
const alignedLinesArray = alignedLines.split("\n");
|
|
1349
|
+
const longestLength = Math.max(...alignedLinesArray.map((s) => stringWidth(s)));
|
|
1350
|
+
for (const alignedLine of alignedLinesArray) {
|
|
1351
|
+
let paddedLine;
|
|
1352
|
+
switch (textAlignment) {
|
|
1353
|
+
case "center": {
|
|
1354
|
+
paddedLine = PAD.repeat((max - longestLength) / 2) + alignedLine;
|
|
1355
|
+
break;
|
|
1356
|
+
}
|
|
1357
|
+
case "right": {
|
|
1358
|
+
paddedLine = PAD.repeat(max - longestLength) + alignedLine;
|
|
1359
|
+
break;
|
|
1360
|
+
}
|
|
1361
|
+
default: {
|
|
1362
|
+
paddedLine = alignedLine;
|
|
1363
|
+
break;
|
|
1364
|
+
}
|
|
1365
|
+
}
|
|
1366
|
+
newLines.push(paddedLine);
|
|
1367
|
+
}
|
|
1368
|
+
}
|
|
1369
|
+
lines = newLines;
|
|
1370
|
+
}
|
|
1371
|
+
if (textAlignment === "center" && textWidth < max) {
|
|
1372
|
+
lines = lines.map((line) => PAD.repeat((max - textWidth) / 2) + line);
|
|
1373
|
+
} else if (textAlignment === "right" && textWidth < max) {
|
|
1374
|
+
lines = lines.map((line) => PAD.repeat(max - textWidth) + line);
|
|
1375
|
+
}
|
|
1376
|
+
const paddingLeft = PAD.repeat(padding.left);
|
|
1377
|
+
const paddingRight = PAD.repeat(padding.right);
|
|
1378
|
+
lines = lines.map((line) => {
|
|
1379
|
+
const newLine = paddingLeft + line + paddingRight;
|
|
1380
|
+
return newLine + PAD.repeat(width - stringWidth(newLine));
|
|
1381
|
+
});
|
|
1382
|
+
if (padding.top > 0) {
|
|
1383
|
+
lines = [...Array.from({ length: padding.top }).fill(PAD.repeat(width)), ...lines];
|
|
1384
|
+
}
|
|
1385
|
+
if (padding.bottom > 0) {
|
|
1386
|
+
lines = [...lines, ...Array.from({ length: padding.bottom }).fill(PAD.repeat(width))];
|
|
1387
|
+
}
|
|
1388
|
+
if (height && lines.length > height) {
|
|
1389
|
+
lines = lines.slice(0, height);
|
|
1390
|
+
} else if (height && lines.length < height) {
|
|
1391
|
+
lines = [...lines, ...Array.from({ length: height - lines.length }).fill(PAD.repeat(width))];
|
|
1392
|
+
}
|
|
1393
|
+
return lines.join(NEWLINE);
|
|
1394
|
+
};
|
|
1395
|
+
var boxContent = (content, contentWidth, options) => {
|
|
1396
|
+
const colorizeBorder = (border) => {
|
|
1397
|
+
const newBorder = options.borderColor ? getColorFunction(options.borderColor)(border) : border;
|
|
1398
|
+
return options.dimBorder ? chalk2.dim(newBorder) : newBorder;
|
|
1399
|
+
};
|
|
1400
|
+
const colorizeContent = (content2) => options.backgroundColor ? getBGColorFunction(options.backgroundColor)(content2) : content2;
|
|
1401
|
+
const chars = getBorderChars(options.borderStyle);
|
|
1402
|
+
const columns = terminalColumns();
|
|
1403
|
+
let marginLeft = PAD.repeat(options.margin.left);
|
|
1404
|
+
if (options.float === "center") {
|
|
1405
|
+
const marginWidth = Math.max((columns - contentWidth - getBorderWidth(options.borderStyle)) / 2, 0);
|
|
1406
|
+
marginLeft = PAD.repeat(marginWidth);
|
|
1407
|
+
} else if (options.float === "right") {
|
|
1408
|
+
const marginWidth = Math.max(columns - contentWidth - options.margin.right - getBorderWidth(options.borderStyle), 0);
|
|
1409
|
+
marginLeft = PAD.repeat(marginWidth);
|
|
1410
|
+
}
|
|
1411
|
+
let result = "";
|
|
1412
|
+
if (options.margin.top) {
|
|
1413
|
+
result += NEWLINE.repeat(options.margin.top);
|
|
1414
|
+
}
|
|
1415
|
+
if (options.borderStyle !== NONE || options.title) {
|
|
1416
|
+
result += colorizeBorder(marginLeft + chars.topLeft + (options.title ? makeTitle(options.title, chars.top.repeat(contentWidth), options.titleAlignment) : chars.top.repeat(contentWidth)) + chars.topRight) + NEWLINE;
|
|
1417
|
+
}
|
|
1418
|
+
const lines = content.split(NEWLINE);
|
|
1419
|
+
result += lines.map((line) => marginLeft + colorizeBorder(chars.left) + colorizeContent(line) + colorizeBorder(chars.right)).join(NEWLINE);
|
|
1420
|
+
if (options.borderStyle !== NONE) {
|
|
1421
|
+
result += NEWLINE + colorizeBorder(marginLeft + chars.bottomLeft + chars.bottom.repeat(contentWidth) + chars.bottomRight);
|
|
1422
|
+
}
|
|
1423
|
+
if (options.margin.bottom) {
|
|
1424
|
+
result += NEWLINE.repeat(options.margin.bottom);
|
|
1425
|
+
}
|
|
1426
|
+
return result;
|
|
1427
|
+
};
|
|
1428
|
+
var sanitizeOptions = (options) => {
|
|
1429
|
+
if (options.fullscreen && process2?.stdout) {
|
|
1430
|
+
let newDimensions = [process2.stdout.columns, process2.stdout.rows];
|
|
1431
|
+
if (typeof options.fullscreen === "function") {
|
|
1432
|
+
newDimensions = options.fullscreen(...newDimensions);
|
|
1433
|
+
}
|
|
1434
|
+
options.width || (options.width = newDimensions[0]);
|
|
1435
|
+
options.height || (options.height = newDimensions[1]);
|
|
1436
|
+
}
|
|
1437
|
+
options.width && (options.width = Math.max(1, options.width - getBorderWidth(options.borderStyle)));
|
|
1438
|
+
options.height && (options.height = Math.max(1, options.height - getBorderWidth(options.borderStyle)));
|
|
1439
|
+
return options;
|
|
1440
|
+
};
|
|
1441
|
+
var formatTitle = (title, borderStyle) => borderStyle === NONE ? title : ` ${title} `;
|
|
1442
|
+
var determineDimensions = (text, options) => {
|
|
1443
|
+
options = sanitizeOptions(options);
|
|
1444
|
+
const widthOverride = options.width !== void 0;
|
|
1445
|
+
const columns = terminalColumns();
|
|
1446
|
+
const borderWidth = getBorderWidth(options.borderStyle);
|
|
1447
|
+
const maxWidth = columns - options.margin.left - options.margin.right - borderWidth;
|
|
1448
|
+
const widest = widestLine(wrapAnsi(text, columns - borderWidth, { hard: true, trim: false })) + options.padding.left + options.padding.right;
|
|
1449
|
+
if (options.title && widthOverride) {
|
|
1450
|
+
options.title = options.title.slice(0, Math.max(0, options.width - 2));
|
|
1451
|
+
options.title && (options.title = formatTitle(options.title, options.borderStyle));
|
|
1452
|
+
} else if (options.title) {
|
|
1453
|
+
options.title = options.title.slice(0, Math.max(0, maxWidth - 2));
|
|
1454
|
+
if (options.title) {
|
|
1455
|
+
options.title = formatTitle(options.title, options.borderStyle);
|
|
1456
|
+
if (stringWidth(options.title) > widest) {
|
|
1457
|
+
options.width = stringWidth(options.title);
|
|
1458
|
+
}
|
|
1459
|
+
}
|
|
1460
|
+
}
|
|
1461
|
+
options.width || (options.width = widest);
|
|
1462
|
+
if (!widthOverride) {
|
|
1463
|
+
if (options.margin.left && options.margin.right && options.width > maxWidth) {
|
|
1464
|
+
const spaceForMargins = columns - options.width - borderWidth;
|
|
1465
|
+
const multiplier = spaceForMargins / (options.margin.left + options.margin.right);
|
|
1466
|
+
options.margin.left = Math.max(0, Math.floor(options.margin.left * multiplier));
|
|
1467
|
+
options.margin.right = Math.max(0, Math.floor(options.margin.right * multiplier));
|
|
1468
|
+
}
|
|
1469
|
+
options.width = Math.min(options.width, columns - borderWidth - options.margin.left - options.margin.right);
|
|
1470
|
+
}
|
|
1471
|
+
if (options.width - (options.padding.left + options.padding.right) <= 0) {
|
|
1472
|
+
options.padding.left = 0;
|
|
1473
|
+
options.padding.right = 0;
|
|
1474
|
+
}
|
|
1475
|
+
if (options.height && options.height - (options.padding.top + options.padding.bottom) <= 0) {
|
|
1476
|
+
options.padding.top = 0;
|
|
1477
|
+
options.padding.bottom = 0;
|
|
1478
|
+
}
|
|
1479
|
+
return options;
|
|
1480
|
+
};
|
|
1481
|
+
var isHex = (color) => color.match(/^#(?:[0-f]{3}){1,2}$/i);
|
|
1482
|
+
var isColorValid = (color) => typeof color === "string" && (chalk2[color] ?? isHex(color));
|
|
1483
|
+
var getColorFunction = (color) => isHex(color) ? chalk2.hex(color) : chalk2[color];
|
|
1484
|
+
var getBGColorFunction = (color) => isHex(color) ? chalk2.bgHex(color) : chalk2[camelCase(["bg", color])];
|
|
1485
|
+
function boxen(text, options) {
|
|
1486
|
+
options = {
|
|
1487
|
+
padding: 0,
|
|
1488
|
+
borderStyle: "single",
|
|
1489
|
+
dimBorder: false,
|
|
1490
|
+
textAlignment: "left",
|
|
1491
|
+
float: "left",
|
|
1492
|
+
titleAlignment: "left",
|
|
1493
|
+
...options
|
|
1494
|
+
};
|
|
1495
|
+
if (options.align) {
|
|
1496
|
+
options.textAlignment = options.align;
|
|
1497
|
+
}
|
|
1498
|
+
if (options.borderColor && !isColorValid(options.borderColor)) {
|
|
1499
|
+
throw new Error(`${options.borderColor} is not a valid borderColor`);
|
|
1500
|
+
}
|
|
1501
|
+
if (options.backgroundColor && !isColorValid(options.backgroundColor)) {
|
|
1502
|
+
throw new Error(`${options.backgroundColor} is not a valid backgroundColor`);
|
|
1503
|
+
}
|
|
1504
|
+
options.padding = getObject(options.padding);
|
|
1505
|
+
options.margin = getObject(options.margin);
|
|
1506
|
+
options = determineDimensions(text, options);
|
|
1507
|
+
text = makeContentText(text, options);
|
|
1508
|
+
return boxContent(text, options.width, options);
|
|
1509
|
+
}
|
|
1510
|
+
|
|
1511
|
+
// ../../shared/check-for-package-update.ts
|
|
1512
|
+
import fs from "fs";
|
|
1513
|
+
import path2 from "path";
|
|
1514
|
+
var getInstalledVersionOfPackage = (packageName) => {
|
|
1515
|
+
try {
|
|
1516
|
+
const PROJECT_DIR = process.env.PROJECT_DIR || process.cwd();
|
|
1517
|
+
const pkg = fs.readFileSync(path2.join(PROJECT_DIR, "package.json"), "utf8");
|
|
1518
|
+
const json = JSON.parse(pkg);
|
|
1519
|
+
return json.dependencies[packageName];
|
|
1520
|
+
} catch (error) {
|
|
1521
|
+
return null;
|
|
1522
|
+
}
|
|
1523
|
+
};
|
|
1524
|
+
async function checkForPackageUpdate(packageName) {
|
|
1525
|
+
const installedVersion = getInstalledVersionOfPackage(packageName);
|
|
1526
|
+
if (!installedVersion || installedVersion === "latest") return;
|
|
1527
|
+
const pkg = { name: packageName, version: installedVersion };
|
|
1528
|
+
const updateNotifierModule = await import("update-notifier");
|
|
1529
|
+
const notifier = updateNotifierModule.default({ pkg, updateCheckInterval: 0, shouldNotifyInNpmScript: true });
|
|
1530
|
+
const info = await notifier.fetchInfo();
|
|
1531
|
+
if (info?.type !== "latest") {
|
|
1532
|
+
const message = `Package ${packageName} update available ${info.current} \u2192 ${info.latest}
|
|
1533
|
+
Run npm i ${packageName} to update`;
|
|
1534
|
+
console.log(
|
|
1535
|
+
boxen(message, {
|
|
1536
|
+
padding: 1,
|
|
1537
|
+
margin: 1,
|
|
1538
|
+
align: "center",
|
|
1539
|
+
borderColor: "yellow",
|
|
1540
|
+
borderStyle: {
|
|
1541
|
+
topLeft: " ",
|
|
1542
|
+
topRight: " ",
|
|
1543
|
+
bottomLeft: " ",
|
|
1544
|
+
bottomRight: " ",
|
|
1545
|
+
right: " ",
|
|
1546
|
+
top: "-",
|
|
1547
|
+
bottom: "-",
|
|
1548
|
+
left: " "
|
|
1549
|
+
}
|
|
1550
|
+
})
|
|
1551
|
+
);
|
|
1552
|
+
}
|
|
1553
|
+
}
|
|
1554
|
+
|
|
1555
|
+
// src/index.ts
|
|
418
1556
|
var index_default = async (_, options) => {
|
|
419
1557
|
if (!process.env.PROJECT_DIR) {
|
|
420
1558
|
process.env.PROJECT_DIR = process.cwd();
|
|
@@ -423,6 +1561,7 @@ var index_default = async (_, options) => {
|
|
|
423
1561
|
throw new Error("Please provide catalog url (env variable PROJECT_DIR)");
|
|
424
1562
|
}
|
|
425
1563
|
await checkLicense_default(options.licenseKey);
|
|
1564
|
+
await checkForPackageUpdate(package_default.name);
|
|
426
1565
|
const {
|
|
427
1566
|
getDomain,
|
|
428
1567
|
versionDomain,
|
|
@@ -436,12 +1575,12 @@ var index_default = async (_, options) => {
|
|
|
436
1575
|
} = utils2(process.env.PROJECT_DIR);
|
|
437
1576
|
const { services = [], saveParsedSpecFile = false } = options;
|
|
438
1577
|
for (const serviceSpec of services) {
|
|
439
|
-
console.log(
|
|
1578
|
+
console.log(chalk3.green(`Processing ${serviceSpec.path}`));
|
|
440
1579
|
try {
|
|
441
1580
|
await SwaggerParser2.validate(serviceSpec.path);
|
|
442
1581
|
} catch (error) {
|
|
443
|
-
console.error(
|
|
444
|
-
console.error(
|
|
1582
|
+
console.error(chalk3.red(`Failed to parse OpenAPI file: ${serviceSpec.path}`));
|
|
1583
|
+
console.error(chalk3.red(error));
|
|
445
1584
|
continue;
|
|
446
1585
|
}
|
|
447
1586
|
const document = await SwaggerParser2.dereference(serviceSpec.path);
|
|
@@ -458,11 +1597,11 @@ var index_default = async (_, options) => {
|
|
|
458
1597
|
const { id: domainId, name: domainName, version: domainVersion } = options.domain;
|
|
459
1598
|
const domain = await getDomain(options.domain.id, domainVersion || "latest");
|
|
460
1599
|
const currentDomain = await getDomain(options.domain.id, "latest");
|
|
461
|
-
console.log(
|
|
1600
|
+
console.log(chalk3.blue(`
|
|
462
1601
|
Processing domain: ${domainName} (v${domainVersion})`));
|
|
463
1602
|
if (currentDomain && currentDomain.version !== domainVersion) {
|
|
464
1603
|
await versionDomain(domainId);
|
|
465
|
-
console.log(
|
|
1604
|
+
console.log(chalk3.cyan(` - Versioned previous domain (v${currentDomain.version})`));
|
|
466
1605
|
}
|
|
467
1606
|
if (!domain || domain && domain.version !== domainVersion) {
|
|
468
1607
|
await writeDomain({
|
|
@@ -472,10 +1611,10 @@ Processing domain: ${domainName} (v${domainVersion})`));
|
|
|
472
1611
|
markdown: defaultMarkdown(),
|
|
473
1612
|
...options.domain?.owners ? { owners: options.domain.owners } : {}
|
|
474
1613
|
});
|
|
475
|
-
console.log(
|
|
1614
|
+
console.log(chalk3.cyan(` - Domain (v${domainVersion}) created`));
|
|
476
1615
|
}
|
|
477
1616
|
if (currentDomain && currentDomain.version === domainVersion) {
|
|
478
|
-
console.log(
|
|
1617
|
+
console.log(chalk3.yellow(` - Domain (v${domainVersion}) already exists, skipped creation...`));
|
|
479
1618
|
}
|
|
480
1619
|
await addServiceToDomain(domainId, { id: service.id, version: service.version }, domainVersion);
|
|
481
1620
|
}
|
|
@@ -486,7 +1625,7 @@ Processing domain: ${domainName} (v${domainVersion})`));
|
|
|
486
1625
|
let owners = service.owners || [];
|
|
487
1626
|
let repository = null;
|
|
488
1627
|
const latestServiceInCatalog = await getService(service.id, "latest");
|
|
489
|
-
console.log(
|
|
1628
|
+
console.log(chalk3.blue(`Processing service: ${document.info.title} (v${version})`));
|
|
490
1629
|
if (latestServiceInCatalog) {
|
|
491
1630
|
serviceMarkdown = latestServiceInCatalog.markdown;
|
|
492
1631
|
serviceSpecificationsFiles = await getSpecificationFilesForService(service.id, "latest");
|
|
@@ -499,7 +1638,7 @@ Processing domain: ${domainName} (v${domainVersion})`));
|
|
|
499
1638
|
};
|
|
500
1639
|
if (latestServiceInCatalog.version !== version) {
|
|
501
1640
|
await versionService(service.id);
|
|
502
|
-
console.log(
|
|
1641
|
+
console.log(chalk3.cyan(` - Versioned previous service (v${latestServiceInCatalog.version})`));
|
|
503
1642
|
}
|
|
504
1643
|
if (latestServiceInCatalog.version === version) {
|
|
505
1644
|
receives = latestServiceInCatalog.receives ? [...latestServiceInCatalog.receives, ...receives] : receives;
|
|
@@ -535,7 +1674,7 @@ Processing domain: ${domainName} (v${domainVersion})`));
|
|
|
535
1674
|
version
|
|
536
1675
|
);
|
|
537
1676
|
}
|
|
538
|
-
console.log(
|
|
1677
|
+
console.log(chalk3.cyan(` - Service (v${version}) created`));
|
|
539
1678
|
}
|
|
540
1679
|
};
|
|
541
1680
|
var processMessagesForOpenAPISpec = async (pathToSpec, document, servicePath, options) => {
|
|
@@ -547,7 +1686,7 @@ var processMessagesForOpenAPISpec = async (pathToSpec, document, servicePath, op
|
|
|
547
1686
|
let messageMarkdown = message.markdown;
|
|
548
1687
|
const messageType = operation.type;
|
|
549
1688
|
const messageAction = operation.action;
|
|
550
|
-
console.log(
|
|
1689
|
+
console.log(chalk3.blue(`Processing message: ${message.name} (v${message.version})`));
|
|
551
1690
|
const {
|
|
552
1691
|
addFileToMessage,
|
|
553
1692
|
writeMessage,
|
|
@@ -560,7 +1699,7 @@ var processMessagesForOpenAPISpec = async (pathToSpec, document, servicePath, op
|
|
|
560
1699
|
messageMarkdown = catalogedMessage.markdown;
|
|
561
1700
|
if (catalogedMessage.version !== version) {
|
|
562
1701
|
await versionMessage(message.id);
|
|
563
|
-
console.log(
|
|
1702
|
+
console.log(chalk3.cyan(` - Versioned previous message: (v${catalogedMessage.version})`));
|
|
564
1703
|
}
|
|
565
1704
|
}
|
|
566
1705
|
let messagePath = join(servicePath, folder, message.id);
|
|
@@ -604,10 +1743,10 @@ var processMessagesForOpenAPISpec = async (pathToSpec, document, servicePath, op
|
|
|
604
1743
|
);
|
|
605
1744
|
}
|
|
606
1745
|
}
|
|
607
|
-
console.log(
|
|
1746
|
+
console.log(chalk3.cyan(` - Message (v${message.version}) created`));
|
|
608
1747
|
if (!operation.operationId) {
|
|
609
|
-
console.log(
|
|
610
|
-
console.log(
|
|
1748
|
+
console.log(chalk3.yellow(` - OperationId not found for ${operation.method} ${operation.path}, creating one...`));
|
|
1749
|
+
console.log(chalk3.yellow(` - Use operationIds to give better unique names for EventCatalog`));
|
|
611
1750
|
}
|
|
612
1751
|
}
|
|
613
1752
|
return { receives, sends };
|