@settlemint/sdk-cli 1.1.15 → 1.1.16-pr04fb0456
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/dist/cli.js +1326 -498
- package/dist/cli.js.map +36 -21
- package/package.json +5 -5
package/dist/cli.js
CHANGED
@@ -228098,6 +228098,57 @@ ${whileRunning(e10)}`;
|
|
228098
228098
|
}, qe);
|
228099
228099
|
});
|
228100
228100
|
|
228101
|
+
// ../../node_modules/slugify/slugify.js
|
228102
|
+
var require_slugify = __commonJS((exports, module) => {
|
228103
|
+
(function(name3, root, factory) {
|
228104
|
+
if (typeof exports === "object") {
|
228105
|
+
module.exports = factory();
|
228106
|
+
module.exports["default"] = factory();
|
228107
|
+
} else if (typeof define === "function" && define.amd) {
|
228108
|
+
define(factory);
|
228109
|
+
} else {
|
228110
|
+
root[name3] = factory();
|
228111
|
+
}
|
228112
|
+
})("slugify", exports, function() {
|
228113
|
+
var charMap = JSON.parse('{"$":"dollar","%":"percent","&":"and","<":"less",">":"greater","|":"or","¢":"cent","£":"pound","¤":"currency","¥":"yen","©":"(c)","ª":"a","®":"(r)","º":"o","À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","Æ":"AE","Ç":"C","È":"E","É":"E","Ê":"E","Ë":"E","Ì":"I","Í":"I","Î":"I","Ï":"I","Ð":"D","Ñ":"N","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","Ù":"U","Ú":"U","Û":"U","Ü":"U","Ý":"Y","Þ":"TH","ß":"ss","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","æ":"ae","ç":"c","è":"e","é":"e","ê":"e","ë":"e","ì":"i","í":"i","î":"i","ï":"i","ð":"d","ñ":"n","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","ù":"u","ú":"u","û":"u","ü":"u","ý":"y","þ":"th","ÿ":"y","Ā":"A","ā":"a","Ă":"A","ă":"a","Ą":"A","ą":"a","Ć":"C","ć":"c","Č":"C","č":"c","Ď":"D","ď":"d","Đ":"DJ","đ":"dj","Ē":"E","ē":"e","Ė":"E","ė":"e","Ę":"e","ę":"e","Ě":"E","ě":"e","Ğ":"G","ğ":"g","Ģ":"G","ģ":"g","Ĩ":"I","ĩ":"i","Ī":"i","ī":"i","Į":"I","į":"i","İ":"I","ı":"i","Ķ":"k","ķ":"k","Ļ":"L","ļ":"l","Ľ":"L","ľ":"l","Ł":"L","ł":"l","Ń":"N","ń":"n","Ņ":"N","ņ":"n","Ň":"N","ň":"n","Ō":"O","ō":"o","Ő":"O","ő":"o","Œ":"OE","œ":"oe","Ŕ":"R","ŕ":"r","Ř":"R","ř":"r","Ś":"S","ś":"s","Ş":"S","ş":"s","Š":"S","š":"s","Ţ":"T","ţ":"t","Ť":"T","ť":"t","Ũ":"U","ũ":"u","Ū":"u","ū":"u","Ů":"U","ů":"u","Ű":"U","ű":"u","Ų":"U","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","ź":"z","Ż":"Z","ż":"z","Ž":"Z","ž":"z","Ə":"E","ƒ":"f","Ơ":"O","ơ":"o","Ư":"U","ư":"u","Lj":"LJ","lj":"lj","Nj":"NJ","nj":"nj","Ș":"S","ș":"s","Ț":"T","ț":"t","ə":"e","˚":"o","Ά":"A","Έ":"E","Ή":"H","Ί":"I","Ό":"O","Ύ":"Y","Ώ":"W","ΐ":"i","Α":"A","Β":"B","Γ":"G","Δ":"D","Ε":"E","Ζ":"Z","Η":"H","Θ":"8","Ι":"I","Κ":"K","Λ":"L","Μ":"M","Ν":"N","Ξ":"3","Ο":"O","Π":"P","Ρ":"R","Σ":"S","Τ":"T","Υ":"Y","Φ":"F","Χ":"X","Ψ":"PS","Ω":"W","Ϊ":"I","Ϋ":"Y","ά":"a","έ":"e","ή":"h","ί":"i","ΰ":"y","α":"a","β":"b","γ":"g","δ":"d","ε":"e","ζ":"z","η":"h","θ":"8","ι":"i","κ":"k","λ":"l","μ":"m","ν":"n","ξ":"3","ο":"o","π":"p","ρ":"r","ς":"s","σ":"s","τ":"t","υ":"y","φ":"f","χ":"x","ψ":"ps","ω":"w","ϊ":"i","ϋ":"y","ό":"o","ύ":"y","ώ":"w","Ё":"Yo","Ђ":"DJ","Є":"Ye","І":"I","Ї":"Yi","Ј":"J","Љ":"LJ","Њ":"NJ","Ћ":"C","Џ":"DZ","А":"A","Б":"B","В":"V","Г":"G","Д":"D","Е":"E","Ж":"Zh","З":"Z","И":"I","Й":"J","К":"K","Л":"L","М":"M","Н":"N","О":"O","П":"P","Р":"R","С":"S","Т":"T","У":"U","Ф":"F","Х":"H","Ц":"C","Ч":"Ch","Ш":"Sh","Щ":"Sh","Ъ":"U","Ы":"Y","Ь":"","Э":"E","Ю":"Yu","Я":"Ya","а":"a","б":"b","в":"v","г":"g","д":"d","е":"e","ж":"zh","з":"z","и":"i","й":"j","к":"k","л":"l","м":"m","н":"n","о":"o","п":"p","р":"r","с":"s","т":"t","у":"u","ф":"f","х":"h","ц":"c","ч":"ch","ш":"sh","щ":"sh","ъ":"u","ы":"y","ь":"","э":"e","ю":"yu","я":"ya","ё":"yo","ђ":"dj","є":"ye","і":"i","ї":"yi","ј":"j","љ":"lj","њ":"nj","ћ":"c","ѝ":"u","џ":"dz","Ґ":"G","ґ":"g","Ғ":"GH","ғ":"gh","Қ":"KH","қ":"kh","Ң":"NG","ң":"ng","Ү":"UE","ү":"ue","Ұ":"U","ұ":"u","Һ":"H","һ":"h","Ә":"AE","ә":"ae","Ө":"OE","ө":"oe","Ա":"A","Բ":"B","Գ":"G","Դ":"D","Ե":"E","Զ":"Z","Է":"E\'","Ը":"Y\'","Թ":"T\'","Ժ":"JH","Ի":"I","Լ":"L","Խ":"X","Ծ":"C\'","Կ":"K","Հ":"H","Ձ":"D\'","Ղ":"GH","Ճ":"TW","Մ":"M","Յ":"Y","Ն":"N","Շ":"SH","Չ":"CH","Պ":"P","Ջ":"J","Ռ":"R\'","Ս":"S","Վ":"V","Տ":"T","Ր":"R","Ց":"C","Փ":"P\'","Ք":"Q\'","Օ":"O\'\'","Ֆ":"F","և":"EV","ء":"a","آ":"aa","أ":"a","ؤ":"u","إ":"i","ئ":"e","ا":"a","ب":"b","ة":"h","ت":"t","ث":"th","ج":"j","ح":"h","خ":"kh","د":"d","ذ":"th","ر":"r","ز":"z","س":"s","ش":"sh","ص":"s","ض":"dh","ط":"t","ظ":"z","ع":"a","غ":"gh","ف":"f","ق":"q","ك":"k","ل":"l","م":"m","ن":"n","ه":"h","و":"w","ى":"a","ي":"y","ً":"an","ٌ":"on","ٍ":"en","َ":"a","ُ":"u","ِ":"e","ْ":"","٠":"0","١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","پ":"p","چ":"ch","ژ":"zh","ک":"k","گ":"g","ی":"y","۰":"0","۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9","฿":"baht","ა":"a","ბ":"b","გ":"g","დ":"d","ე":"e","ვ":"v","ზ":"z","თ":"t","ი":"i","კ":"k","ლ":"l","მ":"m","ნ":"n","ო":"o","პ":"p","ჟ":"zh","რ":"r","ს":"s","ტ":"t","უ":"u","ფ":"f","ქ":"k","ღ":"gh","ყ":"q","შ":"sh","ჩ":"ch","ც":"ts","ძ":"dz","წ":"ts","ჭ":"ch","ხ":"kh","ჯ":"j","ჰ":"h","Ṣ":"S","ṣ":"s","Ẁ":"W","ẁ":"w","Ẃ":"W","ẃ":"w","Ẅ":"W","ẅ":"w","ẞ":"SS","Ạ":"A","ạ":"a","Ả":"A","ả":"a","Ấ":"A","ấ":"a","Ầ":"A","ầ":"a","Ẩ":"A","ẩ":"a","Ẫ":"A","ẫ":"a","Ậ":"A","ậ":"a","Ắ":"A","ắ":"a","Ằ":"A","ằ":"a","Ẳ":"A","ẳ":"a","Ẵ":"A","ẵ":"a","Ặ":"A","ặ":"a","Ẹ":"E","ẹ":"e","Ẻ":"E","ẻ":"e","Ẽ":"E","ẽ":"e","Ế":"E","ế":"e","Ề":"E","ề":"e","Ể":"E","ể":"e","Ễ":"E","ễ":"e","Ệ":"E","ệ":"e","Ỉ":"I","ỉ":"i","Ị":"I","ị":"i","Ọ":"O","ọ":"o","Ỏ":"O","ỏ":"o","Ố":"O","ố":"o","Ồ":"O","ồ":"o","Ổ":"O","ổ":"o","Ỗ":"O","ỗ":"o","Ộ":"O","ộ":"o","Ớ":"O","ớ":"o","Ờ":"O","ờ":"o","Ở":"O","ở":"o","Ỡ":"O","ỡ":"o","Ợ":"O","ợ":"o","Ụ":"U","ụ":"u","Ủ":"U","ủ":"u","Ứ":"U","ứ":"u","Ừ":"U","ừ":"u","Ử":"U","ử":"u","Ữ":"U","ữ":"u","Ự":"U","ự":"u","Ỳ":"Y","ỳ":"y","Ỵ":"Y","ỵ":"y","Ỷ":"Y","ỷ":"y","Ỹ":"Y","ỹ":"y","–":"-","‘":"\'","’":"\'","“":"\\"","”":"\\"","„":"\\"","†":"+","•":"*","…":"...","₠":"ecu","₢":"cruzeiro","₣":"french franc","₤":"lira","₥":"mill","₦":"naira","₧":"peseta","₨":"rupee","₩":"won","₪":"new shequel","₫":"dong","€":"euro","₭":"kip","₮":"tugrik","₯":"drachma","₰":"penny","₱":"peso","₲":"guarani","₳":"austral","₴":"hryvnia","₵":"cedi","₸":"kazakhstani tenge","₹":"indian rupee","₺":"turkish lira","₽":"russian ruble","₿":"bitcoin","℠":"sm","™":"tm","∂":"d","∆":"delta","∑":"sum","∞":"infinity","♥":"love","元":"yuan","円":"yen","﷼":"rial","ﻵ":"laa","ﻷ":"laa","ﻹ":"lai","ﻻ":"la"}');
|
228114
|
+
var locales = JSON.parse('{"bg":{"Й":"Y","Ц":"Ts","Щ":"Sht","Ъ":"A","Ь":"Y","й":"y","ц":"ts","щ":"sht","ъ":"a","ь":"y"},"de":{"Ä":"AE","ä":"ae","Ö":"OE","ö":"oe","Ü":"UE","ü":"ue","ß":"ss","%":"prozent","&":"und","|":"oder","∑":"summe","∞":"unendlich","♥":"liebe"},"es":{"%":"por ciento","&":"y","<":"menor que",">":"mayor que","|":"o","¢":"centavos","£":"libras","¤":"moneda","₣":"francos","∑":"suma","∞":"infinito","♥":"amor"},"fr":{"%":"pourcent","&":"et","<":"plus petit",">":"plus grand","|":"ou","¢":"centime","£":"livre","¤":"devise","₣":"franc","∑":"somme","∞":"infini","♥":"amour"},"pt":{"%":"porcento","&":"e","<":"menor",">":"maior","|":"ou","¢":"centavo","∑":"soma","£":"libra","∞":"infinito","♥":"amor"},"uk":{"И":"Y","и":"y","Й":"Y","й":"y","Ц":"Ts","ц":"ts","Х":"Kh","х":"kh","Щ":"Shch","щ":"shch","Г":"H","г":"h"},"vi":{"Đ":"D","đ":"d"},"da":{"Ø":"OE","ø":"oe","Å":"AA","å":"aa","%":"procent","&":"og","|":"eller","$":"dollar","<":"mindre end",">":"større end"},"nb":{"&":"og","Å":"AA","Æ":"AE","Ø":"OE","å":"aa","æ":"ae","ø":"oe"},"it":{"&":"e"},"nl":{"&":"en"},"sv":{"&":"och","Å":"AA","Ä":"AE","Ö":"OE","å":"aa","ä":"ae","ö":"oe"}}');
|
228115
|
+
function replace(string, options) {
|
228116
|
+
if (typeof string !== "string") {
|
228117
|
+
throw new Error("slugify: string argument expected");
|
228118
|
+
}
|
228119
|
+
options = typeof options === "string" ? { replacement: options } : options || {};
|
228120
|
+
var locale = locales[options.locale] || {};
|
228121
|
+
var replacement = options.replacement === undefined ? "-" : options.replacement;
|
228122
|
+
var trim = options.trim === undefined ? true : options.trim;
|
228123
|
+
var slug = string.normalize().split("").reduce(function(result, ch) {
|
228124
|
+
var appendChar = locale[ch];
|
228125
|
+
if (appendChar === undefined)
|
228126
|
+
appendChar = charMap[ch];
|
228127
|
+
if (appendChar === undefined)
|
228128
|
+
appendChar = ch;
|
228129
|
+
if (appendChar === replacement)
|
228130
|
+
appendChar = " ";
|
228131
|
+
return result + appendChar.replace(options.remove || /[^\w\s$*_+~.()'"!\-:@]+/g, "");
|
228132
|
+
}, "");
|
228133
|
+
if (options.strict) {
|
228134
|
+
slug = slug.replace(/[^A-Za-z0-9\s]/g, "");
|
228135
|
+
}
|
228136
|
+
if (trim) {
|
228137
|
+
slug = slug.trim();
|
228138
|
+
}
|
228139
|
+
slug = slug.replace(/\s+/g, replacement);
|
228140
|
+
if (options.lower) {
|
228141
|
+
slug = slug.toLowerCase();
|
228142
|
+
}
|
228143
|
+
return slug;
|
228144
|
+
}
|
228145
|
+
replace.extend = function(customMap) {
|
228146
|
+
Object.assign(charMap, customMap);
|
228147
|
+
};
|
228148
|
+
return replace;
|
228149
|
+
});
|
228150
|
+
});
|
228151
|
+
|
228101
228152
|
// ../../node_modules/node-fetch-native/dist/shared/node-fetch-native.DhEqb06g.cjs
|
228102
228153
|
var require_node_fetch_native_DhEqb06g = __commonJS((exports) => {
|
228103
228154
|
var l2 = Object.defineProperty;
|
@@ -232194,8 +232245,8 @@ var require_lib13 = __commonJS((exports, module) => {
|
|
232194
232245
|
function fetch2(input, options) {
|
232195
232246
|
return nodeFetch.fetch(input, options);
|
232196
232247
|
}
|
232197
|
-
for (const
|
232198
|
-
fetch2[
|
232248
|
+
for (const key3 in nodeFetch) {
|
232249
|
+
fetch2[key3] = nodeFetch[key3];
|
232199
232250
|
}
|
232200
232251
|
module.exports = fetch2;
|
232201
232252
|
});
|
@@ -232288,11 +232339,11 @@ var require_proxy = __commonJS((exports) => {
|
|
232288
232339
|
return hasRequiredSymbols$4 || (hasRequiredSymbols$4 = 1, symbols$4 = { kClose: Symbol("close"), kDestroy: Symbol("destroy"), kDispatch: Symbol("dispatch"), kUrl: Symbol("url"), kWriting: Symbol("writing"), kResuming: Symbol("resuming"), kQueue: Symbol("queue"), kConnect: Symbol("connect"), kConnecting: Symbol("connecting"), kKeepAliveDefaultTimeout: Symbol("default keep alive timeout"), kKeepAliveMaxTimeout: Symbol("max keep alive timeout"), kKeepAliveTimeoutThreshold: Symbol("keep alive timeout threshold"), kKeepAliveTimeoutValue: Symbol("keep alive timeout"), kKeepAlive: Symbol("keep alive"), kHeadersTimeout: Symbol("headers timeout"), kBodyTimeout: Symbol("body timeout"), kServerName: Symbol("server name"), kLocalAddress: Symbol("local address"), kHost: Symbol("host"), kNoRef: Symbol("no ref"), kBodyUsed: Symbol("used"), kBody: Symbol("abstracted request body"), kRunning: Symbol("running"), kBlocking: Symbol("blocking"), kPending: Symbol("pending"), kSize: Symbol("size"), kBusy: Symbol("busy"), kQueued: Symbol("queued"), kFree: Symbol("free"), kConnected: Symbol("connected"), kClosed: Symbol("closed"), kNeedDrain: Symbol("need drain"), kReset: Symbol("reset"), kDestroyed: Symbol.for("nodejs.stream.destroyed"), kResume: Symbol("resume"), kOnError: Symbol("on error"), kMaxHeadersSize: Symbol("max headers size"), kRunningIdx: Symbol("running index"), kPendingIdx: Symbol("pending index"), kError: Symbol("error"), kClients: Symbol("clients"), kClient: Symbol("client"), kParser: Symbol("parser"), kOnDestroyed: Symbol("destroy callbacks"), kPipelining: Symbol("pipelining"), kSocket: Symbol("socket"), kHostHeader: Symbol("host header"), kConnector: Symbol("connector"), kStrictContentLength: Symbol("strict content length"), kMaxRedirections: Symbol("maxRedirections"), kMaxRequests: Symbol("maxRequestsPerClient"), kProxy: Symbol("proxy agent options"), kCounter: Symbol("socket request counter"), kInterceptors: Symbol("dispatch interceptors"), kMaxResponseSize: Symbol("max response size"), kHTTP2Session: Symbol("http2Session"), kHTTP2SessionState: Symbol("http2Session state"), kRetryHandlerDefaultRetry: Symbol("retry agent default retry"), kConstruct: Symbol("constructable"), kListeners: Symbol("listeners"), kHTTPContext: Symbol("http context"), kMaxConcurrentStreams: Symbol("max concurrent streams"), kNoProxyAgent: Symbol("no proxy agent"), kHttpProxyAgent: Symbol("http proxy agent"), kHttpsProxyAgent: Symbol("https proxy agent") }), symbols$4;
|
232289
232340
|
}
|
232290
232341
|
e10(requireSymbols$4, "requireSymbols$4");
|
232291
|
-
var
|
232342
|
+
var errors3;
|
232292
232343
|
var hasRequiredErrors;
|
232293
232344
|
function requireErrors() {
|
232294
232345
|
if (hasRequiredErrors)
|
232295
|
-
return
|
232346
|
+
return errors3;
|
232296
232347
|
hasRequiredErrors = 1;
|
232297
232348
|
|
232298
232349
|
class A5 extends Error {
|
@@ -232501,7 +232552,7 @@ var require_proxy = __commonJS((exports) => {
|
|
232501
232552
|
super(i6, { cause: k5, ...F3 ?? {} }), this.name = "SecureProxyConnectionError", this.message = i6 || "Secure Proxy Connection failed", this.code = "UND_ERR_PRX_TLS", this.cause = k5;
|
232502
232553
|
}
|
232503
232554
|
}
|
232504
|
-
return
|
232555
|
+
return errors3 = { AbortError: Q4, HTTPParserError: Y4, UndiciError: A5, HeadersTimeoutError: c3, HeadersOverflowError: E6, BodyTimeoutError: t8, RequestContentLengthMismatchError: r6, ConnectTimeoutError: p6, ResponseStatusCodeError: B4, InvalidArgumentError: f5, InvalidReturnValueError: l2, RequestAbortedError: u6, ClientDestroyedError: a7, ClientClosedError: g5, InformationalError: n6, SocketError: d6, NotSupportedError: N6, ResponseContentLengthMismatchError: o8, BalancedPoolMissingUpstreamError: M5, ResponseExceededMaxSizeError: J4, RequestRetryError: V5, ResponseError: H4, SecureProxyConnectionError: h7 }, errors3;
|
232505
232556
|
}
|
232506
232557
|
e10(requireErrors, "requireErrors");
|
232507
232558
|
var constants$4;
|
@@ -241790,11 +241841,11 @@ ${g5}`;
|
|
241790
241841
|
return e10(u6, "plural"), ms;
|
241791
241842
|
}
|
241792
241843
|
e10(requireMs, "requireMs");
|
241793
|
-
var
|
241844
|
+
var common3;
|
241794
241845
|
var hasRequiredCommon;
|
241795
241846
|
function requireCommon() {
|
241796
241847
|
if (hasRequiredCommon)
|
241797
|
-
return
|
241848
|
+
return common3;
|
241798
241849
|
hasRequiredCommon = 1;
|
241799
241850
|
function A5(p6) {
|
241800
241851
|
E6.debug = E6, E6.default = E6, E6.coerce = u6, E6.disable = l2, E6.enable = B4, E6.enabled = Q4, E6.humanize = requireMs(), E6.destroy = n6, Object.keys(p6).forEach((r6) => {
|
@@ -241882,7 +241933,7 @@ ${g5}`;
|
|
241882
241933
|
}
|
241883
241934
|
return e10(n6, "destroy"), E6.enable(E6.load()), E6;
|
241884
241935
|
}
|
241885
|
-
return e10(A5, "setup"),
|
241936
|
+
return e10(A5, "setup"), common3 = A5, common3;
|
241886
241937
|
}
|
241887
241938
|
e10(requireCommon, "requireCommon");
|
241888
241939
|
var hasRequiredBrowser;
|
@@ -242474,11 +242525,11 @@ var require_visit = __commonJS((exports) => {
|
|
242474
242525
|
visit2.BREAK = BREAK;
|
242475
242526
|
visit2.SKIP = SKIP;
|
242476
242527
|
visit2.REMOVE = REMOVE;
|
242477
|
-
function visit_(
|
242478
|
-
const ctrl = callVisitor(
|
242528
|
+
function visit_(key3, node, visitor, path5) {
|
242529
|
+
const ctrl = callVisitor(key3, node, visitor, path5);
|
242479
242530
|
if (identity2.isNode(ctrl) || identity2.isPair(ctrl)) {
|
242480
|
-
replaceNode(
|
242481
|
-
return visit_(
|
242531
|
+
replaceNode(key3, path5, ctrl);
|
242532
|
+
return visit_(key3, ctrl, visitor, path5);
|
242482
242533
|
}
|
242483
242534
|
if (typeof ctrl !== "symbol") {
|
242484
242535
|
if (identity2.isCollection(node)) {
|
@@ -242522,11 +242573,11 @@ var require_visit = __commonJS((exports) => {
|
|
242522
242573
|
visitAsync.BREAK = BREAK;
|
242523
242574
|
visitAsync.SKIP = SKIP;
|
242524
242575
|
visitAsync.REMOVE = REMOVE;
|
242525
|
-
async function visitAsync_(
|
242526
|
-
const ctrl = await callVisitor(
|
242576
|
+
async function visitAsync_(key3, node, visitor, path5) {
|
242577
|
+
const ctrl = await callVisitor(key3, node, visitor, path5);
|
242527
242578
|
if (identity2.isNode(ctrl) || identity2.isPair(ctrl)) {
|
242528
|
-
replaceNode(
|
242529
|
-
return visitAsync_(
|
242579
|
+
replaceNode(key3, path5, ctrl);
|
242580
|
+
return visitAsync_(key3, ctrl, visitor, path5);
|
242530
242581
|
}
|
242531
242582
|
if (typeof ctrl !== "symbol") {
|
242532
242583
|
if (identity2.isCollection(node)) {
|
@@ -242576,27 +242627,27 @@ var require_visit = __commonJS((exports) => {
|
|
242576
242627
|
}
|
242577
242628
|
return visitor;
|
242578
242629
|
}
|
242579
|
-
function callVisitor(
|
242630
|
+
function callVisitor(key3, node, visitor, path5) {
|
242580
242631
|
if (typeof visitor === "function")
|
242581
|
-
return visitor(
|
242632
|
+
return visitor(key3, node, path5);
|
242582
242633
|
if (identity2.isMap(node))
|
242583
|
-
return visitor.Map?.(
|
242634
|
+
return visitor.Map?.(key3, node, path5);
|
242584
242635
|
if (identity2.isSeq(node))
|
242585
|
-
return visitor.Seq?.(
|
242636
|
+
return visitor.Seq?.(key3, node, path5);
|
242586
242637
|
if (identity2.isPair(node))
|
242587
|
-
return visitor.Pair?.(
|
242638
|
+
return visitor.Pair?.(key3, node, path5);
|
242588
242639
|
if (identity2.isScalar(node))
|
242589
|
-
return visitor.Scalar?.(
|
242640
|
+
return visitor.Scalar?.(key3, node, path5);
|
242590
242641
|
if (identity2.isAlias(node))
|
242591
|
-
return visitor.Alias?.(
|
242642
|
+
return visitor.Alias?.(key3, node, path5);
|
242592
242643
|
return;
|
242593
242644
|
}
|
242594
|
-
function replaceNode(
|
242645
|
+
function replaceNode(key3, path5, node) {
|
242595
242646
|
const parent = path5[path5.length - 1];
|
242596
242647
|
if (identity2.isCollection(parent)) {
|
242597
|
-
parent.items[
|
242648
|
+
parent.items[key3] = node;
|
242598
242649
|
} else if (identity2.isPair(parent)) {
|
242599
|
-
if (
|
242650
|
+
if (key3 === "key")
|
242600
242651
|
parent.key = node;
|
242601
242652
|
else
|
242602
242653
|
parent.value = node;
|
@@ -242828,7 +242879,7 @@ var require_anchors = __commonJS((exports) => {
|
|
242828
242879
|
|
242829
242880
|
// ../../node_modules/yaml/dist/doc/applyReviver.js
|
242830
242881
|
var require_applyReviver = __commonJS((exports) => {
|
242831
|
-
function applyReviver(reviver, obj,
|
242882
|
+
function applyReviver(reviver, obj, key3, val) {
|
242832
242883
|
if (val && typeof val === "object") {
|
242833
242884
|
if (Array.isArray(val)) {
|
242834
242885
|
for (let i7 = 0, len = val.length;i7 < len; ++i7) {
|
@@ -242868,7 +242919,7 @@ var require_applyReviver = __commonJS((exports) => {
|
|
242868
242919
|
}
|
242869
242920
|
}
|
242870
242921
|
}
|
242871
|
-
return reviver.call(obj,
|
242922
|
+
return reviver.call(obj, key3, val);
|
242872
242923
|
}
|
242873
242924
|
exports.applyReviver = applyReviver;
|
242874
242925
|
});
|
@@ -243186,29 +243237,29 @@ var require_Collection = __commonJS((exports) => {
|
|
243186
243237
|
if (isEmptyPath(path5))
|
243187
243238
|
this.add(value4);
|
243188
243239
|
else {
|
243189
|
-
const [
|
243190
|
-
const node = this.get(
|
243240
|
+
const [key3, ...rest] = path5;
|
243241
|
+
const node = this.get(key3, true);
|
243191
243242
|
if (identity2.isCollection(node))
|
243192
243243
|
node.addIn(rest, value4);
|
243193
243244
|
else if (node === undefined && this.schema)
|
243194
|
-
this.set(
|
243245
|
+
this.set(key3, collectionFromPath(this.schema, rest, value4));
|
243195
243246
|
else
|
243196
|
-
throw new Error(`Expected YAML collection at ${
|
243247
|
+
throw new Error(`Expected YAML collection at ${key3}. Remaining path: ${rest}`);
|
243197
243248
|
}
|
243198
243249
|
}
|
243199
243250
|
deleteIn(path5) {
|
243200
|
-
const [
|
243251
|
+
const [key3, ...rest] = path5;
|
243201
243252
|
if (rest.length === 0)
|
243202
|
-
return this.delete(
|
243203
|
-
const node = this.get(
|
243253
|
+
return this.delete(key3);
|
243254
|
+
const node = this.get(key3, true);
|
243204
243255
|
if (identity2.isCollection(node))
|
243205
243256
|
return node.deleteIn(rest);
|
243206
243257
|
else
|
243207
|
-
throw new Error(`Expected YAML collection at ${
|
243258
|
+
throw new Error(`Expected YAML collection at ${key3}. Remaining path: ${rest}`);
|
243208
243259
|
}
|
243209
243260
|
getIn(path5, keepScalar) {
|
243210
|
-
const [
|
243211
|
-
const node = this.get(
|
243261
|
+
const [key3, ...rest] = path5;
|
243262
|
+
const node = this.get(key3, true);
|
243212
243263
|
if (rest.length === 0)
|
243213
243264
|
return !keepScalar && identity2.isScalar(node) ? node.value : node;
|
243214
243265
|
else
|
@@ -243223,24 +243274,24 @@ var require_Collection = __commonJS((exports) => {
|
|
243223
243274
|
});
|
243224
243275
|
}
|
243225
243276
|
hasIn(path5) {
|
243226
|
-
const [
|
243277
|
+
const [key3, ...rest] = path5;
|
243227
243278
|
if (rest.length === 0)
|
243228
|
-
return this.has(
|
243229
|
-
const node = this.get(
|
243279
|
+
return this.has(key3);
|
243280
|
+
const node = this.get(key3, true);
|
243230
243281
|
return identity2.isCollection(node) ? node.hasIn(rest) : false;
|
243231
243282
|
}
|
243232
243283
|
setIn(path5, value4) {
|
243233
|
-
const [
|
243284
|
+
const [key3, ...rest] = path5;
|
243234
243285
|
if (rest.length === 0) {
|
243235
|
-
this.set(
|
243286
|
+
this.set(key3, value4);
|
243236
243287
|
} else {
|
243237
|
-
const node = this.get(
|
243288
|
+
const node = this.get(key3, true);
|
243238
243289
|
if (identity2.isCollection(node))
|
243239
243290
|
node.setIn(rest, value4);
|
243240
243291
|
else if (node === undefined && this.schema)
|
243241
|
-
this.set(
|
243292
|
+
this.set(key3, collectionFromPath(this.schema, rest, value4));
|
243242
243293
|
else
|
243243
|
-
throw new Error(`Expected YAML collection at ${
|
243294
|
+
throw new Error(`Expected YAML collection at ${key3}. Remaining path: ${rest}`);
|
243244
243295
|
}
|
243245
243296
|
}
|
243246
243297
|
}
|
@@ -243828,19 +243879,19 @@ var require_stringifyPair = __commonJS((exports) => {
|
|
243828
243879
|
var Scalar = require_Scalar();
|
243829
243880
|
var stringify3 = require_stringify();
|
243830
243881
|
var stringifyComment = require_stringifyComment();
|
243831
|
-
function stringifyPair2({ key:
|
243882
|
+
function stringifyPair2({ key: key3, value: value4 }, ctx, onComment, onChompKeep) {
|
243832
243883
|
const { allNullValues, doc, indent: indent2, indentStep, options: { commentString, indentSeq, simpleKeys } } = ctx;
|
243833
|
-
let keyComment = identity2.isNode(
|
243884
|
+
let keyComment = identity2.isNode(key3) && key3.comment || null;
|
243834
243885
|
if (simpleKeys) {
|
243835
243886
|
if (keyComment) {
|
243836
243887
|
throw new Error("With simple keys, key nodes cannot have comments");
|
243837
243888
|
}
|
243838
|
-
if (identity2.isCollection(
|
243889
|
+
if (identity2.isCollection(key3) || !identity2.isNode(key3) && typeof key3 === "object") {
|
243839
243890
|
const msg = "With simple keys, collection cannot be used as a key value";
|
243840
243891
|
throw new Error(msg);
|
243841
243892
|
}
|
243842
243893
|
}
|
243843
|
-
let explicitKey = !simpleKeys && (!
|
243894
|
+
let explicitKey = !simpleKeys && (!key3 || keyComment && value4 == null && !ctx.inFlow || identity2.isCollection(key3) || (identity2.isScalar(key3) ? key3.type === Scalar.Scalar.BLOCK_FOLDED || key3.type === Scalar.Scalar.BLOCK_LITERAL : typeof key3 === "object"));
|
243844
243895
|
ctx = Object.assign({}, ctx, {
|
243845
243896
|
allNullValues: false,
|
243846
243897
|
implicitKey: !explicitKey && (simpleKeys || !allNullValues),
|
@@ -243848,7 +243899,7 @@ var require_stringifyPair = __commonJS((exports) => {
|
|
243848
243899
|
});
|
243849
243900
|
let keyCommentDone = false;
|
243850
243901
|
let chompKeep = false;
|
243851
|
-
let str = stringify3.stringify(
|
243902
|
+
let str = stringify3.stringify(key3, ctx, () => keyCommentDone = true, () => chompKeep = true);
|
243852
243903
|
if (!explicitKey && !ctx.inFlow && str.length > 1024) {
|
243853
243904
|
if (simpleKeys)
|
243854
243905
|
throw new Error("With simple keys, single line scalar must not span more than 1024 characters");
|
@@ -243992,7 +244043,7 @@ var require_merge = __commonJS((exports) => {
|
|
243992
244043
|
}),
|
243993
244044
|
stringify: () => MERGE_KEY
|
243994
244045
|
};
|
243995
|
-
var isMergeKey = (ctx,
|
244046
|
+
var isMergeKey = (ctx, key3) => (merge3.identify(key3) || identity2.isScalar(key3) && (!key3.type || key3.type === Scalar.Scalar.PLAIN) && merge3.identify(key3.value)) && ctx?.doc.schema.tags.some((tag) => tag.tag === merge3.tag && tag.default);
|
243996
244047
|
function addMergeToJSMap(ctx, map3, value4) {
|
243997
244048
|
value4 = ctx && identity2.isAlias(value4) ? value4.resolve(ctx.doc) : value4;
|
243998
244049
|
if (identity2.isSeq(value4))
|
@@ -244009,14 +244060,14 @@ var require_merge = __commonJS((exports) => {
|
|
244009
244060
|
if (!identity2.isMap(source))
|
244010
244061
|
throw new Error("Merge sources must be maps or map aliases");
|
244011
244062
|
const srcMap = source.toJSON(null, ctx, Map);
|
244012
|
-
for (const [
|
244063
|
+
for (const [key3, value5] of srcMap) {
|
244013
244064
|
if (map3 instanceof Map) {
|
244014
|
-
if (!map3.has(
|
244015
|
-
map3.set(
|
244065
|
+
if (!map3.has(key3))
|
244066
|
+
map3.set(key3, value5);
|
244016
244067
|
} else if (map3 instanceof Set) {
|
244017
|
-
map3.add(
|
244018
|
-
} else if (!Object.prototype.hasOwnProperty.call(map3,
|
244019
|
-
Object.defineProperty(map3,
|
244068
|
+
map3.add(key3);
|
244069
|
+
} else if (!Object.prototype.hasOwnProperty.call(map3, key3)) {
|
244070
|
+
Object.defineProperty(map3, key3, {
|
244020
244071
|
value: value5,
|
244021
244072
|
writable: true,
|
244022
244073
|
enumerable: true,
|
@@ -244038,19 +244089,19 @@ var require_addPairToJSMap = __commonJS((exports) => {
|
|
244038
244089
|
var stringify3 = require_stringify();
|
244039
244090
|
var identity2 = require_identity();
|
244040
244091
|
var toJS = require_toJS();
|
244041
|
-
function addPairToJSMap(ctx, map3, { key:
|
244042
|
-
if (identity2.isNode(
|
244043
|
-
|
244044
|
-
else if (merge3.isMergeKey(ctx,
|
244092
|
+
function addPairToJSMap(ctx, map3, { key: key3, value: value4 }) {
|
244093
|
+
if (identity2.isNode(key3) && key3.addToJSMap)
|
244094
|
+
key3.addToJSMap(ctx, map3, value4);
|
244095
|
+
else if (merge3.isMergeKey(ctx, key3))
|
244045
244096
|
merge3.addMergeToJSMap(ctx, map3, value4);
|
244046
244097
|
else {
|
244047
|
-
const jsKey = toJS.toJS(
|
244098
|
+
const jsKey = toJS.toJS(key3, "", ctx);
|
244048
244099
|
if (map3 instanceof Map) {
|
244049
244100
|
map3.set(jsKey, toJS.toJS(value4, jsKey, ctx));
|
244050
244101
|
} else if (map3 instanceof Set) {
|
244051
244102
|
map3.add(jsKey);
|
244052
244103
|
} else {
|
244053
|
-
const stringKey = stringifyKey(
|
244104
|
+
const stringKey = stringifyKey(key3, jsKey, ctx);
|
244054
244105
|
const jsValue = toJS.toJS(value4, stringKey, ctx);
|
244055
244106
|
if (stringKey in map3)
|
244056
244107
|
Object.defineProperty(map3, stringKey, {
|
@@ -244065,19 +244116,19 @@ var require_addPairToJSMap = __commonJS((exports) => {
|
|
244065
244116
|
}
|
244066
244117
|
return map3;
|
244067
244118
|
}
|
244068
|
-
function stringifyKey(
|
244119
|
+
function stringifyKey(key3, jsKey, ctx) {
|
244069
244120
|
if (jsKey === null)
|
244070
244121
|
return "";
|
244071
244122
|
if (typeof jsKey !== "object")
|
244072
244123
|
return String(jsKey);
|
244073
|
-
if (identity2.isNode(
|
244124
|
+
if (identity2.isNode(key3) && ctx?.doc) {
|
244074
244125
|
const strCtx = stringify3.createStringifyContext(ctx.doc, {});
|
244075
244126
|
strCtx.anchors = new Set;
|
244076
244127
|
for (const node of ctx.anchors.keys())
|
244077
244128
|
strCtx.anchors.add(node.anchor);
|
244078
244129
|
strCtx.inFlow = true;
|
244079
244130
|
strCtx.inStringifyKey = true;
|
244080
|
-
const strKey =
|
244131
|
+
const strKey = key3.toString(strCtx);
|
244081
244132
|
if (!ctx.mapKeyWarned) {
|
244082
244133
|
let jsonStr = JSON.stringify(strKey);
|
244083
244134
|
if (jsonStr.length > 40)
|
@@ -244098,25 +244149,25 @@ var require_Pair = __commonJS((exports) => {
|
|
244098
244149
|
var stringifyPair2 = require_stringifyPair();
|
244099
244150
|
var addPairToJSMap = require_addPairToJSMap();
|
244100
244151
|
var identity2 = require_identity();
|
244101
|
-
function createPair(
|
244102
|
-
const k6 = createNode.createNode(
|
244152
|
+
function createPair(key3, value4, ctx) {
|
244153
|
+
const k6 = createNode.createNode(key3, undefined, ctx);
|
244103
244154
|
const v7 = createNode.createNode(value4, undefined, ctx);
|
244104
244155
|
return new Pair(k6, v7);
|
244105
244156
|
}
|
244106
244157
|
|
244107
244158
|
class Pair {
|
244108
|
-
constructor(
|
244159
|
+
constructor(key3, value4 = null) {
|
244109
244160
|
Object.defineProperty(this, identity2.NODE_TYPE, { value: identity2.PAIR });
|
244110
|
-
this.key =
|
244161
|
+
this.key = key3;
|
244111
244162
|
this.value = value4;
|
244112
244163
|
}
|
244113
244164
|
clone(schema) {
|
244114
|
-
let { key:
|
244115
|
-
if (identity2.isNode(
|
244116
|
-
|
244165
|
+
let { key: key3, value: value4 } = this;
|
244166
|
+
if (identity2.isNode(key3))
|
244167
|
+
key3 = key3.clone(schema);
|
244117
244168
|
if (identity2.isNode(value4))
|
244118
244169
|
value4 = value4.clone(schema);
|
244119
|
-
return new Pair(
|
244170
|
+
return new Pair(key3, value4);
|
244120
244171
|
}
|
244121
244172
|
toJSON(_6, ctx) {
|
244122
244173
|
const pair = ctx?.mapAsMap ? new Map : {};
|
@@ -244283,11 +244334,11 @@ var require_YAMLMap = __commonJS((exports) => {
|
|
244283
244334
|
var identity2 = require_identity();
|
244284
244335
|
var Pair = require_Pair();
|
244285
244336
|
var Scalar = require_Scalar();
|
244286
|
-
function findPair(items,
|
244287
|
-
const k6 = identity2.isScalar(
|
244337
|
+
function findPair(items, key3) {
|
244338
|
+
const k6 = identity2.isScalar(key3) ? key3.value : key3;
|
244288
244339
|
for (const it2 of items) {
|
244289
244340
|
if (identity2.isPair(it2)) {
|
244290
|
-
if (it2.key ===
|
244341
|
+
if (it2.key === key3 || it2.key === k6)
|
244291
244342
|
return it2;
|
244292
244343
|
if (identity2.isScalar(it2.key) && it2.key.value === k6)
|
244293
244344
|
return it2;
|
@@ -244307,20 +244358,20 @@ var require_YAMLMap = __commonJS((exports) => {
|
|
244307
244358
|
static from(schema, obj, ctx) {
|
244308
244359
|
const { keepUndefined, replacer } = ctx;
|
244309
244360
|
const map3 = new this(schema);
|
244310
|
-
const add = (
|
244361
|
+
const add = (key3, value4) => {
|
244311
244362
|
if (typeof replacer === "function")
|
244312
|
-
value4 = replacer.call(obj,
|
244313
|
-
else if (Array.isArray(replacer) && !replacer.includes(
|
244363
|
+
value4 = replacer.call(obj, key3, value4);
|
244364
|
+
else if (Array.isArray(replacer) && !replacer.includes(key3))
|
244314
244365
|
return;
|
244315
244366
|
if (value4 !== undefined || keepUndefined)
|
244316
|
-
map3.items.push(Pair.createPair(
|
244367
|
+
map3.items.push(Pair.createPair(key3, value4, ctx));
|
244317
244368
|
};
|
244318
244369
|
if (obj instanceof Map) {
|
244319
|
-
for (const [
|
244320
|
-
add(
|
244370
|
+
for (const [key3, value4] of obj)
|
244371
|
+
add(key3, value4);
|
244321
244372
|
} else if (obj && typeof obj === "object") {
|
244322
|
-
for (const
|
244323
|
-
add(
|
244373
|
+
for (const key3 of Object.keys(obj))
|
244374
|
+
add(key3, obj[key3]);
|
244324
244375
|
}
|
244325
244376
|
if (typeof schema.sortMapEntries === "function") {
|
244326
244377
|
map3.items.sort(schema.sortMapEntries);
|
@@ -244354,23 +244405,23 @@ var require_YAMLMap = __commonJS((exports) => {
|
|
244354
244405
|
this.items.push(_pair);
|
244355
244406
|
}
|
244356
244407
|
}
|
244357
|
-
delete(
|
244358
|
-
const it2 = findPair(this.items,
|
244408
|
+
delete(key3) {
|
244409
|
+
const it2 = findPair(this.items, key3);
|
244359
244410
|
if (!it2)
|
244360
244411
|
return false;
|
244361
244412
|
const del = this.items.splice(this.items.indexOf(it2), 1);
|
244362
244413
|
return del.length > 0;
|
244363
244414
|
}
|
244364
|
-
get(
|
244365
|
-
const it2 = findPair(this.items,
|
244415
|
+
get(key3, keepScalar) {
|
244416
|
+
const it2 = findPair(this.items, key3);
|
244366
244417
|
const node = it2?.value;
|
244367
244418
|
return (!keepScalar && identity2.isScalar(node) ? node.value : node) ?? undefined;
|
244368
244419
|
}
|
244369
|
-
has(
|
244370
|
-
return !!findPair(this.items,
|
244420
|
+
has(key3) {
|
244421
|
+
return !!findPair(this.items, key3);
|
244371
244422
|
}
|
244372
|
-
set(
|
244373
|
-
this.add(new Pair.Pair(
|
244423
|
+
set(key3, value4) {
|
244424
|
+
this.add(new Pair.Pair(key3, value4), true);
|
244374
244425
|
}
|
244375
244426
|
toJSON(_6, ctx, Type) {
|
244376
244427
|
const map3 = Type ? new Type : ctx?.mapAsMap ? new Map : {};
|
@@ -244441,28 +244492,28 @@ var require_YAMLSeq = __commonJS((exports) => {
|
|
244441
244492
|
add(value4) {
|
244442
244493
|
this.items.push(value4);
|
244443
244494
|
}
|
244444
|
-
delete(
|
244445
|
-
const idx = asItemIndex(
|
244495
|
+
delete(key3) {
|
244496
|
+
const idx = asItemIndex(key3);
|
244446
244497
|
if (typeof idx !== "number")
|
244447
244498
|
return false;
|
244448
244499
|
const del = this.items.splice(idx, 1);
|
244449
244500
|
return del.length > 0;
|
244450
244501
|
}
|
244451
|
-
get(
|
244452
|
-
const idx = asItemIndex(
|
244502
|
+
get(key3, keepScalar) {
|
244503
|
+
const idx = asItemIndex(key3);
|
244453
244504
|
if (typeof idx !== "number")
|
244454
244505
|
return;
|
244455
244506
|
const it2 = this.items[idx];
|
244456
244507
|
return !keepScalar && identity2.isScalar(it2) ? it2.value : it2;
|
244457
244508
|
}
|
244458
|
-
has(
|
244459
|
-
const idx = asItemIndex(
|
244509
|
+
has(key3) {
|
244510
|
+
const idx = asItemIndex(key3);
|
244460
244511
|
return typeof idx === "number" && idx < this.items.length;
|
244461
244512
|
}
|
244462
|
-
set(
|
244463
|
-
const idx = asItemIndex(
|
244513
|
+
set(key3, value4) {
|
244514
|
+
const idx = asItemIndex(key3);
|
244464
244515
|
if (typeof idx !== "number")
|
244465
|
-
throw new Error(`Expected a valid index, not ${
|
244516
|
+
throw new Error(`Expected a valid index, not ${key3}.`);
|
244466
244517
|
const prev = this.items[idx];
|
244467
244518
|
if (identity2.isScalar(prev) && Scalar.isScalarValue(value4))
|
244468
244519
|
prev.value = value4;
|
@@ -244496,8 +244547,8 @@ var require_YAMLSeq = __commonJS((exports) => {
|
|
244496
244547
|
let i7 = 0;
|
244497
244548
|
for (let it2 of obj) {
|
244498
244549
|
if (typeof replacer === "function") {
|
244499
|
-
const
|
244500
|
-
it2 = replacer.call(obj,
|
244550
|
+
const key3 = obj instanceof Set ? it2 : String(i7++);
|
244551
|
+
it2 = replacer.call(obj, key3, it2);
|
244501
244552
|
}
|
244502
244553
|
seq.items.push(createNode.createNode(it2, undefined, ctx));
|
244503
244554
|
}
|
@@ -244505,8 +244556,8 @@ var require_YAMLSeq = __commonJS((exports) => {
|
|
244505
244556
|
return seq;
|
244506
244557
|
}
|
244507
244558
|
}
|
244508
|
-
function asItemIndex(
|
244509
|
-
let idx = identity2.isScalar(
|
244559
|
+
function asItemIndex(key3) {
|
244560
|
+
let idx = identity2.isScalar(key3) ? key3.value : key3;
|
244510
244561
|
if (idx && typeof idx === "string")
|
244511
244562
|
idx = Number(idx);
|
244512
244563
|
return typeof idx === "number" && Number.isInteger(idx) && idx >= 0 ? idx : null;
|
@@ -244878,25 +244929,25 @@ ${cn.comment}` : item.comment;
|
|
244878
244929
|
for (let it2 of iterable) {
|
244879
244930
|
if (typeof replacer === "function")
|
244880
244931
|
it2 = replacer.call(iterable, String(i7++), it2);
|
244881
|
-
let
|
244932
|
+
let key3, value4;
|
244882
244933
|
if (Array.isArray(it2)) {
|
244883
244934
|
if (it2.length === 2) {
|
244884
|
-
|
244935
|
+
key3 = it2[0];
|
244885
244936
|
value4 = it2[1];
|
244886
244937
|
} else
|
244887
244938
|
throw new TypeError(`Expected [key, value] tuple: ${it2}`);
|
244888
244939
|
} else if (it2 && it2 instanceof Object) {
|
244889
244940
|
const keys = Object.keys(it2);
|
244890
244941
|
if (keys.length === 1) {
|
244891
|
-
|
244892
|
-
value4 = it2[
|
244942
|
+
key3 = keys[0];
|
244943
|
+
value4 = it2[key3];
|
244893
244944
|
} else {
|
244894
244945
|
throw new TypeError(`Expected tuple with one key, not ${keys.length} keys`);
|
244895
244946
|
}
|
244896
244947
|
} else {
|
244897
|
-
|
244948
|
+
key3 = it2;
|
244898
244949
|
}
|
244899
|
-
pairs2.items.push(Pair.createPair(
|
244950
|
+
pairs2.items.push(Pair.createPair(key3, value4, ctx));
|
244900
244951
|
}
|
244901
244952
|
return pairs2;
|
244902
244953
|
}
|
@@ -244937,16 +244988,16 @@ var require_omap = __commonJS((exports) => {
|
|
244937
244988
|
if (ctx?.onCreate)
|
244938
244989
|
ctx.onCreate(map3);
|
244939
244990
|
for (const pair of this.items) {
|
244940
|
-
let
|
244991
|
+
let key3, value4;
|
244941
244992
|
if (identity2.isPair(pair)) {
|
244942
|
-
|
244943
|
-
value4 = toJS.toJS(pair.value,
|
244993
|
+
key3 = toJS.toJS(pair.key, "", ctx);
|
244994
|
+
value4 = toJS.toJS(pair.value, key3, ctx);
|
244944
244995
|
} else {
|
244945
|
-
|
244996
|
+
key3 = toJS.toJS(pair, "", ctx);
|
244946
244997
|
}
|
244947
|
-
if (map3.has(
|
244998
|
+
if (map3.has(key3))
|
244948
244999
|
throw new Error("Ordered maps must not include duplicate keys");
|
244949
|
-
map3.set(
|
245000
|
+
map3.set(key3, value4);
|
244950
245001
|
}
|
244951
245002
|
return map3;
|
244952
245003
|
}
|
@@ -244967,12 +245018,12 @@ var require_omap = __commonJS((exports) => {
|
|
244967
245018
|
resolve(seq, onError) {
|
244968
245019
|
const pairs$1 = pairs.resolvePairs(seq, onError);
|
244969
245020
|
const seenKeys = [];
|
244970
|
-
for (const { key:
|
244971
|
-
if (identity2.isScalar(
|
244972
|
-
if (seenKeys.includes(
|
244973
|
-
onError(`Ordered maps must not include duplicate keys: ${
|
245021
|
+
for (const { key: key3 } of pairs$1.items) {
|
245022
|
+
if (identity2.isScalar(key3)) {
|
245023
|
+
if (seenKeys.includes(key3.value)) {
|
245024
|
+
onError(`Ordered maps must not include duplicate keys: ${key3.value}`);
|
244974
245025
|
} else {
|
244975
|
-
seenKeys.push(
|
245026
|
+
seenKeys.push(key3.value);
|
244976
245027
|
}
|
244977
245028
|
}
|
244978
245029
|
}
|
@@ -245146,30 +245197,30 @@ var require_set = __commonJS((exports) => {
|
|
245146
245197
|
super(schema);
|
245147
245198
|
this.tag = YAMLSet.tag;
|
245148
245199
|
}
|
245149
|
-
add(
|
245200
|
+
add(key3) {
|
245150
245201
|
let pair;
|
245151
|
-
if (identity2.isPair(
|
245152
|
-
pair =
|
245153
|
-
else if (
|
245154
|
-
pair = new Pair.Pair(
|
245202
|
+
if (identity2.isPair(key3))
|
245203
|
+
pair = key3;
|
245204
|
+
else if (key3 && typeof key3 === "object" && "key" in key3 && "value" in key3 && key3.value === null)
|
245205
|
+
pair = new Pair.Pair(key3.key, null);
|
245155
245206
|
else
|
245156
|
-
pair = new Pair.Pair(
|
245207
|
+
pair = new Pair.Pair(key3, null);
|
245157
245208
|
const prev = YAMLMap.findPair(this.items, pair.key);
|
245158
245209
|
if (!prev)
|
245159
245210
|
this.items.push(pair);
|
245160
245211
|
}
|
245161
|
-
get(
|
245162
|
-
const pair = YAMLMap.findPair(this.items,
|
245212
|
+
get(key3, keepPair) {
|
245213
|
+
const pair = YAMLMap.findPair(this.items, key3);
|
245163
245214
|
return !keepPair && identity2.isPair(pair) ? identity2.isScalar(pair.key) ? pair.key.value : pair.key : pair;
|
245164
245215
|
}
|
245165
|
-
set(
|
245216
|
+
set(key3, value4) {
|
245166
245217
|
if (typeof value4 !== "boolean")
|
245167
245218
|
throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof value4}`);
|
245168
|
-
const prev = YAMLMap.findPair(this.items,
|
245219
|
+
const prev = YAMLMap.findPair(this.items, key3);
|
245169
245220
|
if (prev && !value4) {
|
245170
245221
|
this.items.splice(this.items.indexOf(prev), 1);
|
245171
245222
|
} else if (!prev && value4) {
|
245172
|
-
this.items.push(new Pair.Pair(
|
245223
|
+
this.items.push(new Pair.Pair(key3));
|
245173
245224
|
}
|
245174
245225
|
}
|
245175
245226
|
toJSON(_6, ctx) {
|
@@ -245404,7 +245455,7 @@ var require_tags = __commonJS((exports) => {
|
|
245404
245455
|
if (Array.isArray(customTags))
|
245405
245456
|
tags = [];
|
245406
245457
|
else {
|
245407
|
-
const keys = Array.from(schemas.keys()).filter((
|
245458
|
+
const keys = Array.from(schemas.keys()).filter((key3) => key3 !== "yaml11").map((key3) => JSON.stringify(key3)).join(", ");
|
245408
245459
|
throw new Error(`Unknown schema "${schemaName}"; use one of ${keys} or define customTags array`);
|
245409
245460
|
}
|
245410
245461
|
}
|
@@ -245420,7 +245471,7 @@ var require_tags = __commonJS((exports) => {
|
|
245420
245471
|
const tagObj = typeof tag === "string" ? tagsByName[tag] : tag;
|
245421
245472
|
if (!tagObj) {
|
245422
245473
|
const tagName = JSON.stringify(tag);
|
245423
|
-
const keys = Object.keys(tagsByName).map((
|
245474
|
+
const keys = Object.keys(tagsByName).map((key3) => JSON.stringify(key3)).join(", ");
|
245424
245475
|
throw new Error(`Unknown custom tag ${tagName}; use one of ${keys}`);
|
245425
245476
|
}
|
245426
245477
|
if (!tags2.includes(tagObj))
|
@@ -245655,13 +245706,13 @@ var require_Document = __commonJS((exports) => {
|
|
245655
245706
|
setAnchors();
|
245656
245707
|
return node;
|
245657
245708
|
}
|
245658
|
-
createPair(
|
245659
|
-
const k6 = this.createNode(
|
245709
|
+
createPair(key3, value4, options = {}) {
|
245710
|
+
const k6 = this.createNode(key3, null, options);
|
245660
245711
|
const v7 = this.createNode(value4, null, options);
|
245661
245712
|
return new Pair.Pair(k6, v7);
|
245662
245713
|
}
|
245663
|
-
delete(
|
245664
|
-
return assertCollection(this.contents) ? this.contents.delete(
|
245714
|
+
delete(key3) {
|
245715
|
+
return assertCollection(this.contents) ? this.contents.delete(key3) : false;
|
245665
245716
|
}
|
245666
245717
|
deleteIn(path5) {
|
245667
245718
|
if (Collection.isEmptyPath(path5)) {
|
@@ -245672,27 +245723,27 @@ var require_Document = __commonJS((exports) => {
|
|
245672
245723
|
}
|
245673
245724
|
return assertCollection(this.contents) ? this.contents.deleteIn(path5) : false;
|
245674
245725
|
}
|
245675
|
-
get(
|
245676
|
-
return identity2.isCollection(this.contents) ? this.contents.get(
|
245726
|
+
get(key3, keepScalar) {
|
245727
|
+
return identity2.isCollection(this.contents) ? this.contents.get(key3, keepScalar) : undefined;
|
245677
245728
|
}
|
245678
245729
|
getIn(path5, keepScalar) {
|
245679
245730
|
if (Collection.isEmptyPath(path5))
|
245680
245731
|
return !keepScalar && identity2.isScalar(this.contents) ? this.contents.value : this.contents;
|
245681
245732
|
return identity2.isCollection(this.contents) ? this.contents.getIn(path5, keepScalar) : undefined;
|
245682
245733
|
}
|
245683
|
-
has(
|
245684
|
-
return identity2.isCollection(this.contents) ? this.contents.has(
|
245734
|
+
has(key3) {
|
245735
|
+
return identity2.isCollection(this.contents) ? this.contents.has(key3) : false;
|
245685
245736
|
}
|
245686
245737
|
hasIn(path5) {
|
245687
245738
|
if (Collection.isEmptyPath(path5))
|
245688
245739
|
return this.contents !== undefined;
|
245689
245740
|
return identity2.isCollection(this.contents) ? this.contents.hasIn(path5) : false;
|
245690
245741
|
}
|
245691
|
-
set(
|
245742
|
+
set(key3, value4) {
|
245692
245743
|
if (this.contents == null) {
|
245693
|
-
this.contents = Collection.collectionFromPath(this.schema, [
|
245744
|
+
this.contents = Collection.collectionFromPath(this.schema, [key3], value4);
|
245694
245745
|
} else if (assertCollection(this.contents)) {
|
245695
|
-
this.contents.set(
|
245746
|
+
this.contents.set(key3, value4);
|
245696
245747
|
}
|
245697
245748
|
}
|
245698
245749
|
setIn(path5, value4) {
|
@@ -245976,25 +246027,25 @@ var require_resolve_props = __commonJS((exports) => {
|
|
245976
246027
|
|
245977
246028
|
// ../../node_modules/yaml/dist/compose/util-contains-newline.js
|
245978
246029
|
var require_util_contains_newline = __commonJS((exports) => {
|
245979
|
-
function containsNewline(
|
245980
|
-
if (!
|
246030
|
+
function containsNewline(key3) {
|
246031
|
+
if (!key3)
|
245981
246032
|
return null;
|
245982
|
-
switch (
|
246033
|
+
switch (key3.type) {
|
245983
246034
|
case "alias":
|
245984
246035
|
case "scalar":
|
245985
246036
|
case "double-quoted-scalar":
|
245986
246037
|
case "single-quoted-scalar":
|
245987
|
-
if (
|
246038
|
+
if (key3.source.includes(`
|
245988
246039
|
`))
|
245989
246040
|
return true;
|
245990
|
-
if (
|
245991
|
-
for (const st2 of
|
246041
|
+
if (key3.end) {
|
246042
|
+
for (const st2 of key3.end)
|
245992
246043
|
if (st2.type === "newline")
|
245993
246044
|
return true;
|
245994
246045
|
}
|
245995
246046
|
return false;
|
245996
246047
|
case "flow-collection":
|
245997
|
-
for (const it2 of
|
246048
|
+
for (const it2 of key3.items) {
|
245998
246049
|
for (const st2 of it2.start)
|
245999
246050
|
if (st2.type === "newline")
|
246000
246051
|
return true;
|
@@ -246059,10 +246110,10 @@ var require_resolve_block_map = __commonJS((exports) => {
|
|
246059
246110
|
let offset = bm.offset;
|
246060
246111
|
let commentEnd = null;
|
246061
246112
|
for (const collItem of bm.items) {
|
246062
|
-
const { start: start3, key:
|
246113
|
+
const { start: start3, key: key3, sep: sep3, value: value4 } = collItem;
|
246063
246114
|
const keyProps = resolveProps.resolveProps(start3, {
|
246064
246115
|
indicator: "explicit-key-ind",
|
246065
|
-
next:
|
246116
|
+
next: key3 ?? sep3?.[0],
|
246066
246117
|
offset,
|
246067
246118
|
onError,
|
246068
246119
|
parentIndent: bm.indent,
|
@@ -246070,10 +246121,10 @@ var require_resolve_block_map = __commonJS((exports) => {
|
|
246070
246121
|
});
|
246071
246122
|
const implicitKey = !keyProps.found;
|
246072
246123
|
if (implicitKey) {
|
246073
|
-
if (
|
246074
|
-
if (
|
246124
|
+
if (key3) {
|
246125
|
+
if (key3.type === "block-seq")
|
246075
246126
|
onError(offset, "BLOCK_AS_IMPLICIT_KEY", "A block sequence may not be used as an implicit map key");
|
246076
|
-
else if ("indent" in
|
246127
|
+
else if ("indent" in key3 && key3.indent !== bm.indent)
|
246077
246128
|
onError(offset, "BAD_INDENT", startColMsg);
|
246078
246129
|
}
|
246079
246130
|
if (!keyProps.anchor && !keyProps.tag && !sep3) {
|
@@ -246087,17 +246138,17 @@ var require_resolve_block_map = __commonJS((exports) => {
|
|
246087
246138
|
}
|
246088
246139
|
continue;
|
246089
246140
|
}
|
246090
|
-
if (keyProps.newlineAfterProp || utilContainsNewline.containsNewline(
|
246091
|
-
onError(
|
246141
|
+
if (keyProps.newlineAfterProp || utilContainsNewline.containsNewline(key3)) {
|
246142
|
+
onError(key3 ?? start3[start3.length - 1], "MULTILINE_IMPLICIT_KEY", "Implicit keys need to be on a single line");
|
246092
246143
|
}
|
246093
246144
|
} else if (keyProps.found?.indent !== bm.indent) {
|
246094
246145
|
onError(offset, "BAD_INDENT", startColMsg);
|
246095
246146
|
}
|
246096
246147
|
ctx.atKey = true;
|
246097
246148
|
const keyStart = keyProps.end;
|
246098
|
-
const keyNode =
|
246149
|
+
const keyNode = key3 ? composeNode(ctx, key3, keyProps, onError) : composeEmptyNode(ctx, keyStart, start3, null, keyProps, onError);
|
246099
246150
|
if (ctx.schema.compat)
|
246100
|
-
utilFlowIndentCheck.flowIndentCheck(bm.indent,
|
246151
|
+
utilFlowIndentCheck.flowIndentCheck(bm.indent, key3, onError);
|
246101
246152
|
ctx.atKey = false;
|
246102
246153
|
if (utilMapIncludes.mapIncludes(ctx, map3.items, keyNode))
|
246103
246154
|
onError(keyStart, "DUPLICATE_KEY", "Map keys must be unique");
|
@@ -246107,7 +246158,7 @@ var require_resolve_block_map = __commonJS((exports) => {
|
|
246107
246158
|
offset: keyNode.range[2],
|
246108
246159
|
onError,
|
246109
246160
|
parentIndent: bm.indent,
|
246110
|
-
startOnNewline: !
|
246161
|
+
startOnNewline: !key3 || key3.type === "block-scalar"
|
246111
246162
|
});
|
246112
246163
|
offset = valueProps.end;
|
246113
246164
|
if (valueProps.found) {
|
@@ -246263,11 +246314,11 @@ var require_resolve_flow_collection = __commonJS((exports) => {
|
|
246263
246314
|
let offset = fc.offset + fc.start.source.length;
|
246264
246315
|
for (let i7 = 0;i7 < fc.items.length; ++i7) {
|
246265
246316
|
const collItem = fc.items[i7];
|
246266
|
-
const { start: start3, key:
|
246317
|
+
const { start: start3, key: key3, sep: sep3, value: value4 } = collItem;
|
246267
246318
|
const props = resolveProps.resolveProps(start3, {
|
246268
246319
|
flow: fcName,
|
246269
246320
|
indicator: "explicit-key-ind",
|
246270
|
-
next:
|
246321
|
+
next: key3 ?? sep3?.[0],
|
246271
246322
|
offset,
|
246272
246323
|
onError,
|
246273
246324
|
parentIndent: fc.indent,
|
@@ -246289,8 +246340,8 @@ var require_resolve_flow_collection = __commonJS((exports) => {
|
|
246289
246340
|
offset = props.end;
|
246290
246341
|
continue;
|
246291
246342
|
}
|
246292
|
-
if (!isMap && ctx.options.strict && utilContainsNewline.containsNewline(
|
246293
|
-
onError(
|
246343
|
+
if (!isMap && ctx.options.strict && utilContainsNewline.containsNewline(key3))
|
246344
|
+
onError(key3, "MULTILINE_IMPLICIT_KEY", "Implicit keys of flow sequence pairs need to be on a single line");
|
246294
246345
|
}
|
246295
246346
|
if (i7 === 0) {
|
246296
246347
|
if (props.comma)
|
@@ -246335,8 +246386,8 @@ var require_resolve_flow_collection = __commonJS((exports) => {
|
|
246335
246386
|
} else {
|
246336
246387
|
ctx.atKey = true;
|
246337
246388
|
const keyStart = props.end;
|
246338
|
-
const keyNode =
|
246339
|
-
if (isBlock(
|
246389
|
+
const keyNode = key3 ? composeNode(ctx, key3, props, onError) : composeEmptyNode(ctx, keyStart, start3, null, props, onError);
|
246390
|
+
if (isBlock(key3))
|
246340
246391
|
onError(keyNode.range, "BLOCK_IN_FLOW", blockMsg);
|
246341
246392
|
ctx.atKey = false;
|
246342
246393
|
const valueProps = resolveProps.resolveProps(sep3 ?? [], {
|
@@ -247148,7 +247199,7 @@ var require_composer = __commonJS((exports) => {
|
|
247148
247199
|
var node_process = __require("node:process");
|
247149
247200
|
var directives4 = require_directives2();
|
247150
247201
|
var Document = require_Document();
|
247151
|
-
var
|
247202
|
+
var errors3 = require_errors3();
|
247152
247203
|
var identity2 = require_identity();
|
247153
247204
|
var composeDoc = require_compose_doc();
|
247154
247205
|
var resolveEnd = require_resolve_end();
|
@@ -247199,9 +247250,9 @@ var require_composer = __commonJS((exports) => {
|
|
247199
247250
|
this.onError = (source, code2, message, warning) => {
|
247200
247251
|
const pos = getErrorPos(source);
|
247201
247252
|
if (warning)
|
247202
|
-
this.warnings.push(new
|
247253
|
+
this.warnings.push(new errors3.YAMLWarning(pos, code2, message));
|
247203
247254
|
else
|
247204
|
-
this.errors.push(new
|
247255
|
+
this.errors.push(new errors3.YAMLParseError(pos, code2, message));
|
247205
247256
|
};
|
247206
247257
|
this.directives = new directives4.Directives({ version: options.version || "1.2" });
|
247207
247258
|
this.options = options;
|
@@ -247285,7 +247336,7 @@ ${cb}` : comment;
|
|
247285
247336
|
break;
|
247286
247337
|
case "error": {
|
247287
247338
|
const msg = token.source ? `${token.message}: ${JSON.stringify(token.source)}` : token.message;
|
247288
|
-
const error5 = new
|
247339
|
+
const error5 = new errors3.YAMLParseError(getErrorPos(token), "UNEXPECTED_TOKEN", msg);
|
247289
247340
|
if (this.atDirectives || !this.doc)
|
247290
247341
|
this.errors.push(error5);
|
247291
247342
|
else
|
@@ -247295,7 +247346,7 @@ ${cb}` : comment;
|
|
247295
247346
|
case "doc-end": {
|
247296
247347
|
if (!this.doc) {
|
247297
247348
|
const msg = "Unexpected doc-end without preceding document";
|
247298
|
-
this.errors.push(new
|
247349
|
+
this.errors.push(new errors3.YAMLParseError(getErrorPos(token), "UNEXPECTED_TOKEN", msg));
|
247299
247350
|
break;
|
247300
247351
|
}
|
247301
247352
|
this.doc.directives.docEnd = true;
|
@@ -247310,7 +247361,7 @@ ${end.comment}` : end.comment;
|
|
247310
247361
|
break;
|
247311
247362
|
}
|
247312
247363
|
default:
|
247313
|
-
this.errors.push(new
|
247364
|
+
this.errors.push(new errors3.YAMLParseError(getErrorPos(token), "UNEXPECTED_TOKEN", `Unsupported token ${token.type}`));
|
247314
247365
|
}
|
247315
247366
|
}
|
247316
247367
|
*end(forceDoc = false, endOffset = -1) {
|
@@ -247336,7 +247387,7 @@ ${end.comment}` : end.comment;
|
|
247336
247387
|
var require_cst_scalar = __commonJS((exports) => {
|
247337
247388
|
var resolveBlockScalar = require_resolve_block_scalar();
|
247338
247389
|
var resolveFlowScalar = require_resolve_flow_scalar();
|
247339
|
-
var
|
247390
|
+
var errors3 = require_errors3();
|
247340
247391
|
var stringifyString = require_stringifyString();
|
247341
247392
|
function resolveAsScalar(token, strict = true, onError) {
|
247342
247393
|
if (token) {
|
@@ -247345,7 +247396,7 @@ var require_cst_scalar = __commonJS((exports) => {
|
|
247345
247396
|
if (onError)
|
247346
247397
|
onError(offset, code2, message);
|
247347
247398
|
else
|
247348
|
-
throw new
|
247399
|
+
throw new errors3.YAMLParseError([offset, offset + 1], code2, message);
|
247349
247400
|
};
|
247350
247401
|
switch (token.type) {
|
247351
247402
|
case "scalar":
|
@@ -247459,9 +247510,9 @@ var require_cst_scalar = __commonJS((exports) => {
|
|
247459
247510
|
if (!addEndtoBlockProps(props, "end" in token ? token.end : undefined))
|
247460
247511
|
props.push({ type: "newline", offset: -1, indent: indent2, source: `
|
247461
247512
|
` });
|
247462
|
-
for (const
|
247463
|
-
if (
|
247464
|
-
delete token[
|
247513
|
+
for (const key3 of Object.keys(token))
|
247514
|
+
if (key3 !== "type" && key3 !== "offset")
|
247515
|
+
delete token[key3];
|
247465
247516
|
Object.assign(token, { type: "block-scalar", indent: indent2, props, source: body });
|
247466
247517
|
}
|
247467
247518
|
}
|
@@ -247510,9 +247561,9 @@ var require_cst_scalar = __commonJS((exports) => {
|
|
247510
247561
|
default: {
|
247511
247562
|
const indent2 = "indent" in token ? token.indent : -1;
|
247512
247563
|
const end = "end" in token && Array.isArray(token.end) ? token.end.filter((st2) => st2.type === "space" || st2.type === "comment" || st2.type === "newline") : [];
|
247513
|
-
for (const
|
247514
|
-
if (
|
247515
|
-
delete token[
|
247564
|
+
for (const key3 of Object.keys(token))
|
247565
|
+
if (key3 !== "type" && key3 !== "offset")
|
247566
|
+
delete token[key3];
|
247516
247567
|
Object.assign(token, { type: type4, indent: indent2, source, end });
|
247517
247568
|
}
|
247518
247569
|
}
|
@@ -247564,12 +247615,12 @@ var require_cst_stringify = __commonJS((exports) => {
|
|
247564
247615
|
}
|
247565
247616
|
}
|
247566
247617
|
}
|
247567
|
-
function stringifyItem({ start: start3, key:
|
247618
|
+
function stringifyItem({ start: start3, key: key3, sep: sep3, value: value4 }) {
|
247568
247619
|
let res = "";
|
247569
247620
|
for (const st2 of start3)
|
247570
247621
|
res += st2.source;
|
247571
|
-
if (
|
247572
|
-
res += stringifyToken(
|
247622
|
+
if (key3)
|
247623
|
+
res += stringifyToken(key3);
|
247573
247624
|
if (sep3)
|
247574
247625
|
for (const st2 of sep3)
|
247575
247626
|
res += st2.source;
|
@@ -248866,7 +248917,7 @@ var require_parser2 = __commonJS((exports) => {
|
|
248866
248917
|
});
|
248867
248918
|
} else if (isFlowToken(it2.key) && !includesToken(it2.sep, "newline")) {
|
248868
248919
|
const start4 = getFirstKeyStartProps(it2.start);
|
248869
|
-
const
|
248920
|
+
const key3 = it2.key;
|
248870
248921
|
const sep3 = it2.sep;
|
248871
248922
|
sep3.push(this.sourceToken);
|
248872
248923
|
delete it2.key;
|
@@ -248875,7 +248926,7 @@ var require_parser2 = __commonJS((exports) => {
|
|
248875
248926
|
type: "block-map",
|
248876
248927
|
offset: this.offset,
|
248877
248928
|
indent: this.indent,
|
248878
|
-
items: [{ start: start4, key:
|
248929
|
+
items: [{ start: start4, key: key3, sep: sep3 }]
|
248879
248930
|
});
|
248880
248931
|
} else if (start3.length > 0) {
|
248881
248932
|
it2.sep = it2.sep.concat(start3, this.sourceToken);
|
@@ -249198,7 +249249,7 @@ var require_parser2 = __commonJS((exports) => {
|
|
249198
249249
|
var require_public_api = __commonJS((exports) => {
|
249199
249250
|
var composer = require_composer();
|
249200
249251
|
var Document = require_Document();
|
249201
|
-
var
|
249252
|
+
var errors3 = require_errors3();
|
249202
249253
|
var log = require_log();
|
249203
249254
|
var identity2 = require_identity();
|
249204
249255
|
var lineCounter = require_line_counter();
|
@@ -249215,8 +249266,8 @@ var require_public_api = __commonJS((exports) => {
|
|
249215
249266
|
const docs = Array.from(composer$1.compose(parser$1.parse(source)));
|
249216
249267
|
if (prettyErrors && lineCounter2)
|
249217
249268
|
for (const doc of docs) {
|
249218
|
-
doc.errors.forEach(
|
249219
|
-
doc.warnings.forEach(
|
249269
|
+
doc.errors.forEach(errors3.prettifyError(source, lineCounter2));
|
249270
|
+
doc.warnings.forEach(errors3.prettifyError(source, lineCounter2));
|
249220
249271
|
}
|
249221
249272
|
if (docs.length > 0)
|
249222
249273
|
return docs;
|
@@ -249231,13 +249282,13 @@ var require_public_api = __commonJS((exports) => {
|
|
249231
249282
|
if (!doc)
|
249232
249283
|
doc = _doc;
|
249233
249284
|
else if (doc.options.logLevel !== "silent") {
|
249234
|
-
doc.errors.push(new
|
249285
|
+
doc.errors.push(new errors3.YAMLParseError(_doc.range.slice(0, 2), "MULTIPLE_DOCS", "Source contains multiple documents; please use YAML.parseAllDocuments()"));
|
249235
249286
|
break;
|
249236
249287
|
}
|
249237
249288
|
}
|
249238
249289
|
if (prettyErrors && lineCounter2) {
|
249239
|
-
doc.errors.forEach(
|
249240
|
-
doc.warnings.forEach(
|
249290
|
+
doc.errors.forEach(errors3.prettifyError(source, lineCounter2));
|
249291
|
+
doc.warnings.forEach(errors3.prettifyError(source, lineCounter2));
|
249241
249292
|
}
|
249242
249293
|
return doc;
|
249243
249294
|
}
|
@@ -249288,57 +249339,6 @@ var require_public_api = __commonJS((exports) => {
|
|
249288
249339
|
exports.stringify = stringify3;
|
249289
249340
|
});
|
249290
249341
|
|
249291
|
-
// ../../node_modules/slugify/slugify.js
|
249292
|
-
var require_slugify = __commonJS((exports, module) => {
|
249293
|
-
(function(name3, root, factory) {
|
249294
|
-
if (typeof exports === "object") {
|
249295
|
-
module.exports = factory();
|
249296
|
-
module.exports["default"] = factory();
|
249297
|
-
} else if (typeof define === "function" && define.amd) {
|
249298
|
-
define(factory);
|
249299
|
-
} else {
|
249300
|
-
root[name3] = factory();
|
249301
|
-
}
|
249302
|
-
})("slugify", exports, function() {
|
249303
|
-
var charMap = JSON.parse('{"$":"dollar","%":"percent","&":"and","<":"less",">":"greater","|":"or","¢":"cent","£":"pound","¤":"currency","¥":"yen","©":"(c)","ª":"a","®":"(r)","º":"o","À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","Æ":"AE","Ç":"C","È":"E","É":"E","Ê":"E","Ë":"E","Ì":"I","Í":"I","Î":"I","Ï":"I","Ð":"D","Ñ":"N","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","Ù":"U","Ú":"U","Û":"U","Ü":"U","Ý":"Y","Þ":"TH","ß":"ss","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","æ":"ae","ç":"c","è":"e","é":"e","ê":"e","ë":"e","ì":"i","í":"i","î":"i","ï":"i","ð":"d","ñ":"n","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","ù":"u","ú":"u","û":"u","ü":"u","ý":"y","þ":"th","ÿ":"y","Ā":"A","ā":"a","Ă":"A","ă":"a","Ą":"A","ą":"a","Ć":"C","ć":"c","Č":"C","č":"c","Ď":"D","ď":"d","Đ":"DJ","đ":"dj","Ē":"E","ē":"e","Ė":"E","ė":"e","Ę":"e","ę":"e","Ě":"E","ě":"e","Ğ":"G","ğ":"g","Ģ":"G","ģ":"g","Ĩ":"I","ĩ":"i","Ī":"i","ī":"i","Į":"I","į":"i","İ":"I","ı":"i","Ķ":"k","ķ":"k","Ļ":"L","ļ":"l","Ľ":"L","ľ":"l","Ł":"L","ł":"l","Ń":"N","ń":"n","Ņ":"N","ņ":"n","Ň":"N","ň":"n","Ō":"O","ō":"o","Ő":"O","ő":"o","Œ":"OE","œ":"oe","Ŕ":"R","ŕ":"r","Ř":"R","ř":"r","Ś":"S","ś":"s","Ş":"S","ş":"s","Š":"S","š":"s","Ţ":"T","ţ":"t","Ť":"T","ť":"t","Ũ":"U","ũ":"u","Ū":"u","ū":"u","Ů":"U","ů":"u","Ű":"U","ű":"u","Ų":"U","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","ź":"z","Ż":"Z","ż":"z","Ž":"Z","ž":"z","Ə":"E","ƒ":"f","Ơ":"O","ơ":"o","Ư":"U","ư":"u","Lj":"LJ","lj":"lj","Nj":"NJ","nj":"nj","Ș":"S","ș":"s","Ț":"T","ț":"t","ə":"e","˚":"o","Ά":"A","Έ":"E","Ή":"H","Ί":"I","Ό":"O","Ύ":"Y","Ώ":"W","ΐ":"i","Α":"A","Β":"B","Γ":"G","Δ":"D","Ε":"E","Ζ":"Z","Η":"H","Θ":"8","Ι":"I","Κ":"K","Λ":"L","Μ":"M","Ν":"N","Ξ":"3","Ο":"O","Π":"P","Ρ":"R","Σ":"S","Τ":"T","Υ":"Y","Φ":"F","Χ":"X","Ψ":"PS","Ω":"W","Ϊ":"I","Ϋ":"Y","ά":"a","έ":"e","ή":"h","ί":"i","ΰ":"y","α":"a","β":"b","γ":"g","δ":"d","ε":"e","ζ":"z","η":"h","θ":"8","ι":"i","κ":"k","λ":"l","μ":"m","ν":"n","ξ":"3","ο":"o","π":"p","ρ":"r","ς":"s","σ":"s","τ":"t","υ":"y","φ":"f","χ":"x","ψ":"ps","ω":"w","ϊ":"i","ϋ":"y","ό":"o","ύ":"y","ώ":"w","Ё":"Yo","Ђ":"DJ","Є":"Ye","І":"I","Ї":"Yi","Ј":"J","Љ":"LJ","Њ":"NJ","Ћ":"C","Џ":"DZ","А":"A","Б":"B","В":"V","Г":"G","Д":"D","Е":"E","Ж":"Zh","З":"Z","И":"I","Й":"J","К":"K","Л":"L","М":"M","Н":"N","О":"O","П":"P","Р":"R","С":"S","Т":"T","У":"U","Ф":"F","Х":"H","Ц":"C","Ч":"Ch","Ш":"Sh","Щ":"Sh","Ъ":"U","Ы":"Y","Ь":"","Э":"E","Ю":"Yu","Я":"Ya","а":"a","б":"b","в":"v","г":"g","д":"d","е":"e","ж":"zh","з":"z","и":"i","й":"j","к":"k","л":"l","м":"m","н":"n","о":"o","п":"p","р":"r","с":"s","т":"t","у":"u","ф":"f","х":"h","ц":"c","ч":"ch","ш":"sh","щ":"sh","ъ":"u","ы":"y","ь":"","э":"e","ю":"yu","я":"ya","ё":"yo","ђ":"dj","є":"ye","і":"i","ї":"yi","ј":"j","љ":"lj","њ":"nj","ћ":"c","ѝ":"u","џ":"dz","Ґ":"G","ґ":"g","Ғ":"GH","ғ":"gh","Қ":"KH","қ":"kh","Ң":"NG","ң":"ng","Ү":"UE","ү":"ue","Ұ":"U","ұ":"u","Һ":"H","һ":"h","Ә":"AE","ә":"ae","Ө":"OE","ө":"oe","Ա":"A","Բ":"B","Գ":"G","Դ":"D","Ե":"E","Զ":"Z","Է":"E\'","Ը":"Y\'","Թ":"T\'","Ժ":"JH","Ի":"I","Լ":"L","Խ":"X","Ծ":"C\'","Կ":"K","Հ":"H","Ձ":"D\'","Ղ":"GH","Ճ":"TW","Մ":"M","Յ":"Y","Ն":"N","Շ":"SH","Չ":"CH","Պ":"P","Ջ":"J","Ռ":"R\'","Ս":"S","Վ":"V","Տ":"T","Ր":"R","Ց":"C","Փ":"P\'","Ք":"Q\'","Օ":"O\'\'","Ֆ":"F","և":"EV","ء":"a","آ":"aa","أ":"a","ؤ":"u","إ":"i","ئ":"e","ا":"a","ب":"b","ة":"h","ت":"t","ث":"th","ج":"j","ح":"h","خ":"kh","د":"d","ذ":"th","ر":"r","ز":"z","س":"s","ش":"sh","ص":"s","ض":"dh","ط":"t","ظ":"z","ع":"a","غ":"gh","ف":"f","ق":"q","ك":"k","ل":"l","م":"m","ن":"n","ه":"h","و":"w","ى":"a","ي":"y","ً":"an","ٌ":"on","ٍ":"en","َ":"a","ُ":"u","ِ":"e","ْ":"","٠":"0","١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","پ":"p","چ":"ch","ژ":"zh","ک":"k","گ":"g","ی":"y","۰":"0","۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9","฿":"baht","ა":"a","ბ":"b","გ":"g","დ":"d","ე":"e","ვ":"v","ზ":"z","თ":"t","ი":"i","კ":"k","ლ":"l","მ":"m","ნ":"n","ო":"o","პ":"p","ჟ":"zh","რ":"r","ს":"s","ტ":"t","უ":"u","ფ":"f","ქ":"k","ღ":"gh","ყ":"q","შ":"sh","ჩ":"ch","ც":"ts","ძ":"dz","წ":"ts","ჭ":"ch","ხ":"kh","ჯ":"j","ჰ":"h","Ṣ":"S","ṣ":"s","Ẁ":"W","ẁ":"w","Ẃ":"W","ẃ":"w","Ẅ":"W","ẅ":"w","ẞ":"SS","Ạ":"A","ạ":"a","Ả":"A","ả":"a","Ấ":"A","ấ":"a","Ầ":"A","ầ":"a","Ẩ":"A","ẩ":"a","Ẫ":"A","ẫ":"a","Ậ":"A","ậ":"a","Ắ":"A","ắ":"a","Ằ":"A","ằ":"a","Ẳ":"A","ẳ":"a","Ẵ":"A","ẵ":"a","Ặ":"A","ặ":"a","Ẹ":"E","ẹ":"e","Ẻ":"E","ẻ":"e","Ẽ":"E","ẽ":"e","Ế":"E","ế":"e","Ề":"E","ề":"e","Ể":"E","ể":"e","Ễ":"E","ễ":"e","Ệ":"E","ệ":"e","Ỉ":"I","ỉ":"i","Ị":"I","ị":"i","Ọ":"O","ọ":"o","Ỏ":"O","ỏ":"o","Ố":"O","ố":"o","Ồ":"O","ồ":"o","Ổ":"O","ổ":"o","Ỗ":"O","ỗ":"o","Ộ":"O","ộ":"o","Ớ":"O","ớ":"o","Ờ":"O","ờ":"o","Ở":"O","ở":"o","Ỡ":"O","ỡ":"o","Ợ":"O","ợ":"o","Ụ":"U","ụ":"u","Ủ":"U","ủ":"u","Ứ":"U","ứ":"u","Ừ":"U","ừ":"u","Ử":"U","ử":"u","Ữ":"U","ữ":"u","Ự":"U","ự":"u","Ỳ":"Y","ỳ":"y","Ỵ":"Y","ỵ":"y","Ỷ":"Y","ỷ":"y","Ỹ":"Y","ỹ":"y","–":"-","‘":"\'","’":"\'","“":"\\"","”":"\\"","„":"\\"","†":"+","•":"*","…":"...","₠":"ecu","₢":"cruzeiro","₣":"french franc","₤":"lira","₥":"mill","₦":"naira","₧":"peseta","₨":"rupee","₩":"won","₪":"new shequel","₫":"dong","€":"euro","₭":"kip","₮":"tugrik","₯":"drachma","₰":"penny","₱":"peso","₲":"guarani","₳":"austral","₴":"hryvnia","₵":"cedi","₸":"kazakhstani tenge","₹":"indian rupee","₺":"turkish lira","₽":"russian ruble","₿":"bitcoin","℠":"sm","™":"tm","∂":"d","∆":"delta","∑":"sum","∞":"infinity","♥":"love","元":"yuan","円":"yen","﷼":"rial","ﻵ":"laa","ﻷ":"laa","ﻹ":"lai","ﻻ":"la"}');
|
249304
|
-
var locales = JSON.parse('{"bg":{"Й":"Y","Ц":"Ts","Щ":"Sht","Ъ":"A","Ь":"Y","й":"y","ц":"ts","щ":"sht","ъ":"a","ь":"y"},"de":{"Ä":"AE","ä":"ae","Ö":"OE","ö":"oe","Ü":"UE","ü":"ue","ß":"ss","%":"prozent","&":"und","|":"oder","∑":"summe","∞":"unendlich","♥":"liebe"},"es":{"%":"por ciento","&":"y","<":"menor que",">":"mayor que","|":"o","¢":"centavos","£":"libras","¤":"moneda","₣":"francos","∑":"suma","∞":"infinito","♥":"amor"},"fr":{"%":"pourcent","&":"et","<":"plus petit",">":"plus grand","|":"ou","¢":"centime","£":"livre","¤":"devise","₣":"franc","∑":"somme","∞":"infini","♥":"amour"},"pt":{"%":"porcento","&":"e","<":"menor",">":"maior","|":"ou","¢":"centavo","∑":"soma","£":"libra","∞":"infinito","♥":"amor"},"uk":{"И":"Y","и":"y","Й":"Y","й":"y","Ц":"Ts","ц":"ts","Х":"Kh","х":"kh","Щ":"Shch","щ":"shch","Г":"H","г":"h"},"vi":{"Đ":"D","đ":"d"},"da":{"Ø":"OE","ø":"oe","Å":"AA","å":"aa","%":"procent","&":"og","|":"eller","$":"dollar","<":"mindre end",">":"større end"},"nb":{"&":"og","Å":"AA","Æ":"AE","Ø":"OE","å":"aa","æ":"ae","ø":"oe"},"it":{"&":"e"},"nl":{"&":"en"},"sv":{"&":"och","Å":"AA","Ä":"AE","Ö":"OE","å":"aa","ä":"ae","ö":"oe"}}');
|
249305
|
-
function replace(string, options) {
|
249306
|
-
if (typeof string !== "string") {
|
249307
|
-
throw new Error("slugify: string argument expected");
|
249308
|
-
}
|
249309
|
-
options = typeof options === "string" ? { replacement: options } : options || {};
|
249310
|
-
var locale = locales[options.locale] || {};
|
249311
|
-
var replacement = options.replacement === undefined ? "-" : options.replacement;
|
249312
|
-
var trim = options.trim === undefined ? true : options.trim;
|
249313
|
-
var slug = string.normalize().split("").reduce(function(result, ch) {
|
249314
|
-
var appendChar = locale[ch];
|
249315
|
-
if (appendChar === undefined)
|
249316
|
-
appendChar = charMap[ch];
|
249317
|
-
if (appendChar === undefined)
|
249318
|
-
appendChar = ch;
|
249319
|
-
if (appendChar === replacement)
|
249320
|
-
appendChar = " ";
|
249321
|
-
return result + appendChar.replace(options.remove || /[^\w\s$*_+~.()'"!\-:@]+/g, "");
|
249322
|
-
}, "");
|
249323
|
-
if (options.strict) {
|
249324
|
-
slug = slug.replace(/[^A-Za-z0-9\s]/g, "");
|
249325
|
-
}
|
249326
|
-
if (trim) {
|
249327
|
-
slug = slug.trim();
|
249328
|
-
}
|
249329
|
-
slug = slug.replace(/\s+/g, replacement);
|
249330
|
-
if (options.lower) {
|
249331
|
-
slug = slug.toLowerCase();
|
249332
|
-
}
|
249333
|
-
return slug;
|
249334
|
-
}
|
249335
|
-
replace.extend = function(customMap) {
|
249336
|
-
Object.assign(charMap, customMap);
|
249337
|
-
};
|
249338
|
-
return replace;
|
249339
|
-
});
|
249340
|
-
});
|
249341
|
-
|
249342
249342
|
// ../utils/dist/environment.mjs
|
249343
249343
|
import { join } from "node:path";
|
249344
249344
|
|
@@ -259498,7 +259498,7 @@ var DotEnvSchema = z.object({
|
|
259498
259498
|
SETTLEMINT_HASURA_DATABASE_URL: z.string().optional(),
|
259499
259499
|
SETTLEMINT_THEGRAPH: UniqueNameSchema.optional(),
|
259500
259500
|
SETTLEMINT_THEGRAPH_SUBGRAPHS_ENDPOINTS: z.preprocess((value) => tryParseJson(value, []), z.array(UrlSchema).optional()),
|
259501
|
-
|
259501
|
+
SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH: z.string().optional(),
|
259502
259502
|
SETTLEMINT_PORTAL: UniqueNameSchema.optional(),
|
259503
259503
|
SETTLEMINT_PORTAL_GRAPHQL_ENDPOINT: UrlSchema.optional(),
|
259504
259504
|
SETTLEMINT_PORTAL_REST_ENDPOINT: UrlSchema.optional(),
|
@@ -259683,7 +259683,7 @@ function pruneCurrentEnv(currentEnv, env2) {
|
|
259683
259683
|
var package_default = {
|
259684
259684
|
name: "@settlemint/sdk-cli",
|
259685
259685
|
description: "Command-line interface for SettleMint SDK, providing development tools and project management capabilities",
|
259686
|
-
version: "1.1.
|
259686
|
+
version: "1.1.16-pr04fb0456",
|
259687
259687
|
type: "module",
|
259688
259688
|
private: false,
|
259689
259689
|
license: "FSL-1.1-MIT",
|
@@ -259728,12 +259728,12 @@ var package_default = {
|
|
259728
259728
|
devDependencies: {
|
259729
259729
|
"@commander-js/extra-typings": "13.1.0",
|
259730
259730
|
"@inquirer/confirm": "5.1.6",
|
259731
|
-
"@inquirer/input": "4.1.
|
259731
|
+
"@inquirer/input": "4.1.7",
|
259732
259732
|
"@inquirer/password": "4.0.9",
|
259733
259733
|
"@inquirer/select": "4.0.9",
|
259734
|
-
"@settlemint/sdk-js": "1.1.
|
259735
|
-
"@settlemint/sdk-utils": "1.1.
|
259736
|
-
"@types/node": "22.13.
|
259734
|
+
"@settlemint/sdk-js": "1.1.16-pr04fb0456",
|
259735
|
+
"@settlemint/sdk-utils": "1.1.16-pr04fb0456",
|
259736
|
+
"@types/node": "22.13.10",
|
259737
259737
|
"@types/semver": "7.5.8",
|
259738
259738
|
"@types/which": "3.0.4",
|
259739
259739
|
"get-tsconfig": "4.10.0",
|
@@ -261002,7 +261002,7 @@ ${error.stack}`));
|
|
261002
261002
|
return handleError(err);
|
261003
261003
|
}
|
261004
261004
|
}
|
261005
|
-
const spinner2 = yoctoSpinner().start(options.startMessage);
|
261005
|
+
const spinner2 = yoctoSpinner({ stream: process.stdout }).start(options.startMessage);
|
261006
261006
|
try {
|
261007
261007
|
const result = await options.task(spinner2);
|
261008
261008
|
spinner2.success(options.stopMessage);
|
@@ -261161,7 +261161,7 @@ var DotEnvSchema2 = z.object({
|
|
261161
261161
|
SETTLEMINT_HASURA_DATABASE_URL: z.string().optional(),
|
261162
261162
|
SETTLEMINT_THEGRAPH: UniqueNameSchema2.optional(),
|
261163
261163
|
SETTLEMINT_THEGRAPH_SUBGRAPHS_ENDPOINTS: z.preprocess((value) => tryParseJson2(value, []), z.array(UrlSchema2).optional()),
|
261164
|
-
|
261164
|
+
SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH: z.string().optional(),
|
261165
261165
|
SETTLEMINT_PORTAL: UniqueNameSchema2.optional(),
|
261166
261166
|
SETTLEMINT_PORTAL_GRAPHQL_ENDPOINT: UrlSchema2.optional(),
|
261167
261167
|
SETTLEMINT_PORTAL_REST_ENDPOINT: UrlSchema2.optional(),
|
@@ -264003,6 +264003,21 @@ export const { client: ${graphqlClientVariable}, graphql: ${graphqlVariable} } =
|
|
264003
264003
|
});`
|
264004
264004
|
]);
|
264005
264005
|
}
|
264006
|
+
if (env2.SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH) {
|
264007
|
+
const isDefaulSubgraphGenerated = toGenerate.some((gqlEndpoint) => {
|
264008
|
+
const name3 = gqlEndpoint.split("/").pop();
|
264009
|
+
return name3 === env2.SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH;
|
264010
|
+
});
|
264011
|
+
if (isDefaulSubgraphGenerated) {
|
264012
|
+
const nameSuffix = capitalizeFirstLetter2(env2.SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH);
|
264013
|
+
const graphqlClientVariable = getVariableName(`theGraphClient${nameSuffix}`);
|
264014
|
+
const graphqlVariable = getVariableName(`theGraphGraphql${nameSuffix}`);
|
264015
|
+
template.push(`
|
264016
|
+
export const theGraphClient = ${graphqlClientVariable};
|
264017
|
+
export const theGraphGraphql = ${graphqlVariable};
|
264018
|
+
`);
|
264019
|
+
}
|
264020
|
+
}
|
264006
264021
|
await writeTemplate(template.join(`
|
264007
264022
|
`), "/lib/settlemint", "the-graph.ts");
|
264008
264023
|
const projectDir = await projectRoot3();
|
@@ -265061,14 +265076,852 @@ async function codegenTsconfig(env2, thegraphSubgraphNames) {
|
|
265061
265076
|
};
|
265062
265077
|
}
|
265063
265078
|
|
265064
|
-
//
|
265079
|
+
// src/utils/subgraph/sanitize-name.ts
|
265080
|
+
var import_slugify = __toESM(require_slugify(), 1);
|
265081
|
+
function sanitizeName(value4, length = 35) {
|
265082
|
+
return import_slugify.default(value4, {
|
265083
|
+
strict: true,
|
265084
|
+
remove: /[!"'()*+.:@~]/g,
|
265085
|
+
replacement: "-",
|
265086
|
+
lower: true
|
265087
|
+
}).slice(0, length).replaceAll(/(^\d*)/g, "").replaceAll(/(-$)/g, "").replaceAll(/(^-)/g, "");
|
265088
|
+
}
|
265089
|
+
|
265090
|
+
// ../../node_modules/@inquirer/input/node_modules/@inquirer/core/dist/esm/lib/key.js
|
265091
|
+
var isBackspaceKey2 = (key2) => key2.name === "backspace";
|
265092
|
+
var isEnterKey2 = (key2) => key2.name === "enter" || key2.name === "return";
|
265093
|
+
// ../../node_modules/@inquirer/input/node_modules/@inquirer/core/dist/esm/lib/errors.js
|
265094
|
+
class AbortPromptError2 extends Error {
|
265095
|
+
name = "AbortPromptError";
|
265096
|
+
message = "Prompt was aborted";
|
265097
|
+
constructor(options) {
|
265098
|
+
super();
|
265099
|
+
this.cause = options?.cause;
|
265100
|
+
}
|
265101
|
+
}
|
265102
|
+
|
265103
|
+
class CancelPromptError2 extends Error {
|
265104
|
+
name = "CancelPromptError";
|
265105
|
+
message = "Prompt was canceled";
|
265106
|
+
}
|
265107
|
+
|
265108
|
+
class ExitPromptError2 extends Error {
|
265109
|
+
name = "ExitPromptError";
|
265110
|
+
}
|
265111
|
+
|
265112
|
+
class HookError2 extends Error {
|
265113
|
+
name = "HookError";
|
265114
|
+
}
|
265115
|
+
|
265116
|
+
class ValidationError2 extends Error {
|
265117
|
+
name = "ValidationError";
|
265118
|
+
}
|
265119
|
+
// ../../node_modules/@inquirer/input/node_modules/@inquirer/core/dist/esm/lib/use-prefix.js
|
265120
|
+
import { AsyncResource as AsyncResource5 } from "node:async_hooks";
|
265121
|
+
|
265122
|
+
// ../../node_modules/@inquirer/input/node_modules/@inquirer/core/dist/esm/lib/hook-engine.js
|
265123
|
+
import { AsyncLocalStorage as AsyncLocalStorage2, AsyncResource as AsyncResource4 } from "node:async_hooks";
|
265124
|
+
var hookStorage2 = new AsyncLocalStorage2;
|
265125
|
+
function createStore2(rl) {
|
265126
|
+
const store = {
|
265127
|
+
rl,
|
265128
|
+
hooks: [],
|
265129
|
+
hooksCleanup: [],
|
265130
|
+
hooksEffect: [],
|
265131
|
+
index: 0,
|
265132
|
+
handleChange() {
|
265133
|
+
}
|
265134
|
+
};
|
265135
|
+
return store;
|
265136
|
+
}
|
265137
|
+
function withHooks2(rl, cb) {
|
265138
|
+
const store = createStore2(rl);
|
265139
|
+
return hookStorage2.run(store, () => {
|
265140
|
+
function cycle(render) {
|
265141
|
+
store.handleChange = () => {
|
265142
|
+
store.index = 0;
|
265143
|
+
render();
|
265144
|
+
};
|
265145
|
+
store.handleChange();
|
265146
|
+
}
|
265147
|
+
return cb(cycle);
|
265148
|
+
});
|
265149
|
+
}
|
265150
|
+
function getStore2() {
|
265151
|
+
const store = hookStorage2.getStore();
|
265152
|
+
if (!store) {
|
265153
|
+
throw new HookError2("[Inquirer] Hook functions can only be called from within a prompt");
|
265154
|
+
}
|
265155
|
+
return store;
|
265156
|
+
}
|
265157
|
+
function readline3() {
|
265158
|
+
return getStore2().rl;
|
265159
|
+
}
|
265160
|
+
function withUpdates2(fn) {
|
265161
|
+
const wrapped = (...args) => {
|
265162
|
+
const store = getStore2();
|
265163
|
+
let shouldUpdate = false;
|
265164
|
+
const oldHandleChange = store.handleChange;
|
265165
|
+
store.handleChange = () => {
|
265166
|
+
shouldUpdate = true;
|
265167
|
+
};
|
265168
|
+
const returnValue = fn(...args);
|
265169
|
+
if (shouldUpdate) {
|
265170
|
+
oldHandleChange();
|
265171
|
+
}
|
265172
|
+
store.handleChange = oldHandleChange;
|
265173
|
+
return returnValue;
|
265174
|
+
};
|
265175
|
+
return AsyncResource4.bind(wrapped);
|
265176
|
+
}
|
265177
|
+
function withPointer2(cb) {
|
265178
|
+
const store = getStore2();
|
265179
|
+
const { index } = store;
|
265180
|
+
const pointer = {
|
265181
|
+
get() {
|
265182
|
+
return store.hooks[index];
|
265183
|
+
},
|
265184
|
+
set(value4) {
|
265185
|
+
store.hooks[index] = value4;
|
265186
|
+
},
|
265187
|
+
initialized: index in store.hooks
|
265188
|
+
};
|
265189
|
+
const returnValue = cb(pointer);
|
265190
|
+
store.index++;
|
265191
|
+
return returnValue;
|
265192
|
+
}
|
265193
|
+
function handleChange2() {
|
265194
|
+
getStore2().handleChange();
|
265195
|
+
}
|
265196
|
+
var effectScheduler2 = {
|
265197
|
+
queue(cb) {
|
265198
|
+
const store = getStore2();
|
265199
|
+
const { index } = store;
|
265200
|
+
store.hooksEffect.push(() => {
|
265201
|
+
store.hooksCleanup[index]?.();
|
265202
|
+
const cleanFn = cb(readline3());
|
265203
|
+
if (cleanFn != null && typeof cleanFn !== "function") {
|
265204
|
+
throw new ValidationError2("useEffect return value must be a cleanup function or nothing.");
|
265205
|
+
}
|
265206
|
+
store.hooksCleanup[index] = cleanFn;
|
265207
|
+
});
|
265208
|
+
},
|
265209
|
+
run() {
|
265210
|
+
const store = getStore2();
|
265211
|
+
withUpdates2(() => {
|
265212
|
+
store.hooksEffect.forEach((effect) => {
|
265213
|
+
effect();
|
265214
|
+
});
|
265215
|
+
store.hooksEffect.length = 0;
|
265216
|
+
})();
|
265217
|
+
},
|
265218
|
+
clearAll() {
|
265219
|
+
const store = getStore2();
|
265220
|
+
store.hooksCleanup.forEach((cleanFn) => {
|
265221
|
+
cleanFn?.();
|
265222
|
+
});
|
265223
|
+
store.hooksEffect.length = 0;
|
265224
|
+
store.hooksCleanup.length = 0;
|
265225
|
+
}
|
265226
|
+
};
|
265227
|
+
|
265228
|
+
// ../../node_modules/@inquirer/input/node_modules/@inquirer/core/dist/esm/lib/use-state.js
|
265229
|
+
function useState2(defaultValue) {
|
265230
|
+
return withPointer2((pointer) => {
|
265231
|
+
const setFn = (newValue) => {
|
265232
|
+
if (pointer.get() !== newValue) {
|
265233
|
+
pointer.set(newValue);
|
265234
|
+
handleChange2();
|
265235
|
+
}
|
265236
|
+
};
|
265237
|
+
if (pointer.initialized) {
|
265238
|
+
return [pointer.get(), setFn];
|
265239
|
+
}
|
265240
|
+
const value4 = typeof defaultValue === "function" ? defaultValue() : defaultValue;
|
265241
|
+
pointer.set(value4);
|
265242
|
+
return [value4, setFn];
|
265243
|
+
});
|
265244
|
+
}
|
265245
|
+
|
265246
|
+
// ../../node_modules/@inquirer/input/node_modules/@inquirer/core/dist/esm/lib/use-effect.js
|
265247
|
+
function useEffect2(cb, depArray) {
|
265248
|
+
withPointer2((pointer) => {
|
265249
|
+
const oldDeps = pointer.get();
|
265250
|
+
const hasChanged = !Array.isArray(oldDeps) || depArray.some((dep, i6) => !Object.is(dep, oldDeps[i6]));
|
265251
|
+
if (hasChanged) {
|
265252
|
+
effectScheduler2.queue(cb);
|
265253
|
+
}
|
265254
|
+
pointer.set(depArray);
|
265255
|
+
});
|
265256
|
+
}
|
265257
|
+
|
265258
|
+
// ../../node_modules/@inquirer/input/node_modules/@inquirer/core/dist/esm/lib/theme.js
|
265065
265259
|
var import_yoctocolors_cjs3 = __toESM(require_yoctocolors_cjs(), 1);
|
265260
|
+
|
265261
|
+
// ../../node_modules/@inquirer/input/node_modules/@inquirer/core/node_modules/@inquirer/figures/dist/esm/index.js
|
265262
|
+
import process8 from "node:process";
|
265263
|
+
function isUnicodeSupported3() {
|
265264
|
+
if (process8.platform !== "win32") {
|
265265
|
+
return process8.env["TERM"] !== "linux";
|
265266
|
+
}
|
265267
|
+
return Boolean(process8.env["WT_SESSION"]) || Boolean(process8.env["TERMINUS_SUBLIME"]) || process8.env["ConEmuTask"] === "{cmd::Cmder}" || process8.env["TERM_PROGRAM"] === "Terminus-Sublime" || process8.env["TERM_PROGRAM"] === "vscode" || process8.env["TERM"] === "xterm-256color" || process8.env["TERM"] === "alacritty" || process8.env["TERMINAL_EMULATOR"] === "JetBrains-JediTerm";
|
265268
|
+
}
|
265269
|
+
var common2 = {
|
265270
|
+
circleQuestionMark: "(?)",
|
265271
|
+
questionMarkPrefix: "(?)",
|
265272
|
+
square: "█",
|
265273
|
+
squareDarkShade: "▓",
|
265274
|
+
squareMediumShade: "▒",
|
265275
|
+
squareLightShade: "░",
|
265276
|
+
squareTop: "▀",
|
265277
|
+
squareBottom: "▄",
|
265278
|
+
squareLeft: "▌",
|
265279
|
+
squareRight: "▐",
|
265280
|
+
squareCenter: "■",
|
265281
|
+
bullet: "●",
|
265282
|
+
dot: "․",
|
265283
|
+
ellipsis: "…",
|
265284
|
+
pointerSmall: "›",
|
265285
|
+
triangleUp: "▲",
|
265286
|
+
triangleUpSmall: "▴",
|
265287
|
+
triangleDown: "▼",
|
265288
|
+
triangleDownSmall: "▾",
|
265289
|
+
triangleLeftSmall: "◂",
|
265290
|
+
triangleRightSmall: "▸",
|
265291
|
+
home: "⌂",
|
265292
|
+
heart: "♥",
|
265293
|
+
musicNote: "♪",
|
265294
|
+
musicNoteBeamed: "♫",
|
265295
|
+
arrowUp: "↑",
|
265296
|
+
arrowDown: "↓",
|
265297
|
+
arrowLeft: "←",
|
265298
|
+
arrowRight: "→",
|
265299
|
+
arrowLeftRight: "↔",
|
265300
|
+
arrowUpDown: "↕",
|
265301
|
+
almostEqual: "≈",
|
265302
|
+
notEqual: "≠",
|
265303
|
+
lessOrEqual: "≤",
|
265304
|
+
greaterOrEqual: "≥",
|
265305
|
+
identical: "≡",
|
265306
|
+
infinity: "∞",
|
265307
|
+
subscriptZero: "₀",
|
265308
|
+
subscriptOne: "₁",
|
265309
|
+
subscriptTwo: "₂",
|
265310
|
+
subscriptThree: "₃",
|
265311
|
+
subscriptFour: "₄",
|
265312
|
+
subscriptFive: "₅",
|
265313
|
+
subscriptSix: "₆",
|
265314
|
+
subscriptSeven: "₇",
|
265315
|
+
subscriptEight: "₈",
|
265316
|
+
subscriptNine: "₉",
|
265317
|
+
oneHalf: "½",
|
265318
|
+
oneThird: "⅓",
|
265319
|
+
oneQuarter: "¼",
|
265320
|
+
oneFifth: "⅕",
|
265321
|
+
oneSixth: "⅙",
|
265322
|
+
oneEighth: "⅛",
|
265323
|
+
twoThirds: "⅔",
|
265324
|
+
twoFifths: "⅖",
|
265325
|
+
threeQuarters: "¾",
|
265326
|
+
threeFifths: "⅗",
|
265327
|
+
threeEighths: "⅜",
|
265328
|
+
fourFifths: "⅘",
|
265329
|
+
fiveSixths: "⅚",
|
265330
|
+
fiveEighths: "⅝",
|
265331
|
+
sevenEighths: "⅞",
|
265332
|
+
line: "─",
|
265333
|
+
lineBold: "━",
|
265334
|
+
lineDouble: "═",
|
265335
|
+
lineDashed0: "┄",
|
265336
|
+
lineDashed1: "┅",
|
265337
|
+
lineDashed2: "┈",
|
265338
|
+
lineDashed3: "┉",
|
265339
|
+
lineDashed4: "╌",
|
265340
|
+
lineDashed5: "╍",
|
265341
|
+
lineDashed6: "╴",
|
265342
|
+
lineDashed7: "╶",
|
265343
|
+
lineDashed8: "╸",
|
265344
|
+
lineDashed9: "╺",
|
265345
|
+
lineDashed10: "╼",
|
265346
|
+
lineDashed11: "╾",
|
265347
|
+
lineDashed12: "−",
|
265348
|
+
lineDashed13: "–",
|
265349
|
+
lineDashed14: "‐",
|
265350
|
+
lineDashed15: "⁃",
|
265351
|
+
lineVertical: "│",
|
265352
|
+
lineVerticalBold: "┃",
|
265353
|
+
lineVerticalDouble: "║",
|
265354
|
+
lineVerticalDashed0: "┆",
|
265355
|
+
lineVerticalDashed1: "┇",
|
265356
|
+
lineVerticalDashed2: "┊",
|
265357
|
+
lineVerticalDashed3: "┋",
|
265358
|
+
lineVerticalDashed4: "╎",
|
265359
|
+
lineVerticalDashed5: "╏",
|
265360
|
+
lineVerticalDashed6: "╵",
|
265361
|
+
lineVerticalDashed7: "╷",
|
265362
|
+
lineVerticalDashed8: "╹",
|
265363
|
+
lineVerticalDashed9: "╻",
|
265364
|
+
lineVerticalDashed10: "╽",
|
265365
|
+
lineVerticalDashed11: "╿",
|
265366
|
+
lineDownLeft: "┐",
|
265367
|
+
lineDownLeftArc: "╮",
|
265368
|
+
lineDownBoldLeftBold: "┓",
|
265369
|
+
lineDownBoldLeft: "┒",
|
265370
|
+
lineDownLeftBold: "┑",
|
265371
|
+
lineDownDoubleLeftDouble: "╗",
|
265372
|
+
lineDownDoubleLeft: "╖",
|
265373
|
+
lineDownLeftDouble: "╕",
|
265374
|
+
lineDownRight: "┌",
|
265375
|
+
lineDownRightArc: "╭",
|
265376
|
+
lineDownBoldRightBold: "┏",
|
265377
|
+
lineDownBoldRight: "┎",
|
265378
|
+
lineDownRightBold: "┍",
|
265379
|
+
lineDownDoubleRightDouble: "╔",
|
265380
|
+
lineDownDoubleRight: "╓",
|
265381
|
+
lineDownRightDouble: "╒",
|
265382
|
+
lineUpLeft: "┘",
|
265383
|
+
lineUpLeftArc: "╯",
|
265384
|
+
lineUpBoldLeftBold: "┛",
|
265385
|
+
lineUpBoldLeft: "┚",
|
265386
|
+
lineUpLeftBold: "┙",
|
265387
|
+
lineUpDoubleLeftDouble: "╝",
|
265388
|
+
lineUpDoubleLeft: "╜",
|
265389
|
+
lineUpLeftDouble: "╛",
|
265390
|
+
lineUpRight: "└",
|
265391
|
+
lineUpRightArc: "╰",
|
265392
|
+
lineUpBoldRightBold: "┗",
|
265393
|
+
lineUpBoldRight: "┖",
|
265394
|
+
lineUpRightBold: "┕",
|
265395
|
+
lineUpDoubleRightDouble: "╚",
|
265396
|
+
lineUpDoubleRight: "╙",
|
265397
|
+
lineUpRightDouble: "╘",
|
265398
|
+
lineUpDownLeft: "┤",
|
265399
|
+
lineUpBoldDownBoldLeftBold: "┫",
|
265400
|
+
lineUpBoldDownBoldLeft: "┨",
|
265401
|
+
lineUpDownLeftBold: "┥",
|
265402
|
+
lineUpBoldDownLeftBold: "┩",
|
265403
|
+
lineUpDownBoldLeftBold: "┪",
|
265404
|
+
lineUpDownBoldLeft: "┧",
|
265405
|
+
lineUpBoldDownLeft: "┦",
|
265406
|
+
lineUpDoubleDownDoubleLeftDouble: "╣",
|
265407
|
+
lineUpDoubleDownDoubleLeft: "╢",
|
265408
|
+
lineUpDownLeftDouble: "╡",
|
265409
|
+
lineUpDownRight: "├",
|
265410
|
+
lineUpBoldDownBoldRightBold: "┣",
|
265411
|
+
lineUpBoldDownBoldRight: "┠",
|
265412
|
+
lineUpDownRightBold: "┝",
|
265413
|
+
lineUpBoldDownRightBold: "┡",
|
265414
|
+
lineUpDownBoldRightBold: "┢",
|
265415
|
+
lineUpDownBoldRight: "┟",
|
265416
|
+
lineUpBoldDownRight: "┞",
|
265417
|
+
lineUpDoubleDownDoubleRightDouble: "╠",
|
265418
|
+
lineUpDoubleDownDoubleRight: "╟",
|
265419
|
+
lineUpDownRightDouble: "╞",
|
265420
|
+
lineDownLeftRight: "┬",
|
265421
|
+
lineDownBoldLeftBoldRightBold: "┳",
|
265422
|
+
lineDownLeftBoldRightBold: "┯",
|
265423
|
+
lineDownBoldLeftRight: "┰",
|
265424
|
+
lineDownBoldLeftBoldRight: "┱",
|
265425
|
+
lineDownBoldLeftRightBold: "┲",
|
265426
|
+
lineDownLeftRightBold: "┮",
|
265427
|
+
lineDownLeftBoldRight: "┭",
|
265428
|
+
lineDownDoubleLeftDoubleRightDouble: "╦",
|
265429
|
+
lineDownDoubleLeftRight: "╥",
|
265430
|
+
lineDownLeftDoubleRightDouble: "╤",
|
265431
|
+
lineUpLeftRight: "┴",
|
265432
|
+
lineUpBoldLeftBoldRightBold: "┻",
|
265433
|
+
lineUpLeftBoldRightBold: "┷",
|
265434
|
+
lineUpBoldLeftRight: "┸",
|
265435
|
+
lineUpBoldLeftBoldRight: "┹",
|
265436
|
+
lineUpBoldLeftRightBold: "┺",
|
265437
|
+
lineUpLeftRightBold: "┶",
|
265438
|
+
lineUpLeftBoldRight: "┵",
|
265439
|
+
lineUpDoubleLeftDoubleRightDouble: "╩",
|
265440
|
+
lineUpDoubleLeftRight: "╨",
|
265441
|
+
lineUpLeftDoubleRightDouble: "╧",
|
265442
|
+
lineUpDownLeftRight: "┼",
|
265443
|
+
lineUpBoldDownBoldLeftBoldRightBold: "╋",
|
265444
|
+
lineUpDownBoldLeftBoldRightBold: "╈",
|
265445
|
+
lineUpBoldDownLeftBoldRightBold: "╇",
|
265446
|
+
lineUpBoldDownBoldLeftRightBold: "╊",
|
265447
|
+
lineUpBoldDownBoldLeftBoldRight: "╉",
|
265448
|
+
lineUpBoldDownLeftRight: "╀",
|
265449
|
+
lineUpDownBoldLeftRight: "╁",
|
265450
|
+
lineUpDownLeftBoldRight: "┽",
|
265451
|
+
lineUpDownLeftRightBold: "┾",
|
265452
|
+
lineUpBoldDownBoldLeftRight: "╂",
|
265453
|
+
lineUpDownLeftBoldRightBold: "┿",
|
265454
|
+
lineUpBoldDownLeftBoldRight: "╃",
|
265455
|
+
lineUpBoldDownLeftRightBold: "╄",
|
265456
|
+
lineUpDownBoldLeftBoldRight: "╅",
|
265457
|
+
lineUpDownBoldLeftRightBold: "╆",
|
265458
|
+
lineUpDoubleDownDoubleLeftDoubleRightDouble: "╬",
|
265459
|
+
lineUpDoubleDownDoubleLeftRight: "╫",
|
265460
|
+
lineUpDownLeftDoubleRightDouble: "╪",
|
265461
|
+
lineCross: "╳",
|
265462
|
+
lineBackslash: "╲",
|
265463
|
+
lineSlash: "╱"
|
265464
|
+
};
|
265465
|
+
var specialMainSymbols2 = {
|
265466
|
+
tick: "✔",
|
265467
|
+
info: "ℹ",
|
265468
|
+
warning: "⚠",
|
265469
|
+
cross: "✘",
|
265470
|
+
squareSmall: "◻",
|
265471
|
+
squareSmallFilled: "◼",
|
265472
|
+
circle: "◯",
|
265473
|
+
circleFilled: "◉",
|
265474
|
+
circleDotted: "◌",
|
265475
|
+
circleDouble: "◎",
|
265476
|
+
circleCircle: "ⓞ",
|
265477
|
+
circleCross: "ⓧ",
|
265478
|
+
circlePipe: "Ⓘ",
|
265479
|
+
radioOn: "◉",
|
265480
|
+
radioOff: "◯",
|
265481
|
+
checkboxOn: "☒",
|
265482
|
+
checkboxOff: "☐",
|
265483
|
+
checkboxCircleOn: "ⓧ",
|
265484
|
+
checkboxCircleOff: "Ⓘ",
|
265485
|
+
pointer: "❯",
|
265486
|
+
triangleUpOutline: "△",
|
265487
|
+
triangleLeft: "◀",
|
265488
|
+
triangleRight: "▶",
|
265489
|
+
lozenge: "◆",
|
265490
|
+
lozengeOutline: "◇",
|
265491
|
+
hamburger: "☰",
|
265492
|
+
smiley: "㋡",
|
265493
|
+
mustache: "෴",
|
265494
|
+
star: "★",
|
265495
|
+
play: "▶",
|
265496
|
+
nodejs: "⬢",
|
265497
|
+
oneSeventh: "⅐",
|
265498
|
+
oneNinth: "⅑",
|
265499
|
+
oneTenth: "⅒"
|
265500
|
+
};
|
265501
|
+
var specialFallbackSymbols2 = {
|
265502
|
+
tick: "√",
|
265503
|
+
info: "i",
|
265504
|
+
warning: "‼",
|
265505
|
+
cross: "×",
|
265506
|
+
squareSmall: "□",
|
265507
|
+
squareSmallFilled: "■",
|
265508
|
+
circle: "( )",
|
265509
|
+
circleFilled: "(*)",
|
265510
|
+
circleDotted: "( )",
|
265511
|
+
circleDouble: "( )",
|
265512
|
+
circleCircle: "(○)",
|
265513
|
+
circleCross: "(×)",
|
265514
|
+
circlePipe: "(│)",
|
265515
|
+
radioOn: "(*)",
|
265516
|
+
radioOff: "( )",
|
265517
|
+
checkboxOn: "[×]",
|
265518
|
+
checkboxOff: "[ ]",
|
265519
|
+
checkboxCircleOn: "(×)",
|
265520
|
+
checkboxCircleOff: "( )",
|
265521
|
+
pointer: ">",
|
265522
|
+
triangleUpOutline: "∆",
|
265523
|
+
triangleLeft: "◄",
|
265524
|
+
triangleRight: "►",
|
265525
|
+
lozenge: "♦",
|
265526
|
+
lozengeOutline: "◊",
|
265527
|
+
hamburger: "≡",
|
265528
|
+
smiley: "☺",
|
265529
|
+
mustache: "┌─┐",
|
265530
|
+
star: "✶",
|
265531
|
+
play: "►",
|
265532
|
+
nodejs: "♦",
|
265533
|
+
oneSeventh: "1/7",
|
265534
|
+
oneNinth: "1/9",
|
265535
|
+
oneTenth: "1/10"
|
265536
|
+
};
|
265537
|
+
var mainSymbols2 = { ...common2, ...specialMainSymbols2 };
|
265538
|
+
var fallbackSymbols2 = {
|
265539
|
+
...common2,
|
265540
|
+
...specialFallbackSymbols2
|
265541
|
+
};
|
265542
|
+
var shouldUseMain2 = isUnicodeSupported3();
|
265543
|
+
var figures2 = shouldUseMain2 ? mainSymbols2 : fallbackSymbols2;
|
265544
|
+
var esm_default2 = figures2;
|
265545
|
+
var replacements2 = Object.entries(specialMainSymbols2);
|
265546
|
+
|
265547
|
+
// ../../node_modules/@inquirer/input/node_modules/@inquirer/core/dist/esm/lib/theme.js
|
265548
|
+
var defaultTheme2 = {
|
265549
|
+
prefix: {
|
265550
|
+
idle: import_yoctocolors_cjs3.default.blue("?"),
|
265551
|
+
done: import_yoctocolors_cjs3.default.green(esm_default2.tick)
|
265552
|
+
},
|
265553
|
+
spinner: {
|
265554
|
+
interval: 80,
|
265555
|
+
frames: ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"].map((frame) => import_yoctocolors_cjs3.default.yellow(frame))
|
265556
|
+
},
|
265557
|
+
style: {
|
265558
|
+
answer: import_yoctocolors_cjs3.default.cyan,
|
265559
|
+
message: import_yoctocolors_cjs3.default.bold,
|
265560
|
+
error: (text2) => import_yoctocolors_cjs3.default.red(`> ${text2}`),
|
265561
|
+
defaultAnswer: (text2) => import_yoctocolors_cjs3.default.dim(`(${text2})`),
|
265562
|
+
help: import_yoctocolors_cjs3.default.dim,
|
265563
|
+
highlight: import_yoctocolors_cjs3.default.cyan,
|
265564
|
+
key: (text2) => import_yoctocolors_cjs3.default.cyan(import_yoctocolors_cjs3.default.bold(`<${text2}>`))
|
265565
|
+
}
|
265566
|
+
};
|
265567
|
+
|
265568
|
+
// ../../node_modules/@inquirer/input/node_modules/@inquirer/core/dist/esm/lib/make-theme.js
|
265569
|
+
function isPlainObject3(value4) {
|
265570
|
+
if (typeof value4 !== "object" || value4 === null)
|
265571
|
+
return false;
|
265572
|
+
let proto = value4;
|
265573
|
+
while (Object.getPrototypeOf(proto) !== null) {
|
265574
|
+
proto = Object.getPrototypeOf(proto);
|
265575
|
+
}
|
265576
|
+
return Object.getPrototypeOf(value4) === proto;
|
265577
|
+
}
|
265578
|
+
function deepMerge3(...objects) {
|
265579
|
+
const output = {};
|
265580
|
+
for (const obj of objects) {
|
265581
|
+
for (const [key2, value4] of Object.entries(obj)) {
|
265582
|
+
const prevValue = output[key2];
|
265583
|
+
output[key2] = isPlainObject3(prevValue) && isPlainObject3(value4) ? deepMerge3(prevValue, value4) : value4;
|
265584
|
+
}
|
265585
|
+
}
|
265586
|
+
return output;
|
265587
|
+
}
|
265588
|
+
function makeTheme2(...themes) {
|
265589
|
+
const themesToMerge = [
|
265590
|
+
defaultTheme2,
|
265591
|
+
...themes.filter((theme) => theme != null)
|
265592
|
+
];
|
265593
|
+
return deepMerge3(...themesToMerge);
|
265594
|
+
}
|
265595
|
+
|
265596
|
+
// ../../node_modules/@inquirer/input/node_modules/@inquirer/core/dist/esm/lib/use-prefix.js
|
265597
|
+
function usePrefix2({ status = "idle", theme }) {
|
265598
|
+
const [showLoader, setShowLoader] = useState2(false);
|
265599
|
+
const [tick, setTick] = useState2(0);
|
265600
|
+
const { prefix, spinner: spinner2 } = makeTheme2(theme);
|
265601
|
+
useEffect2(() => {
|
265602
|
+
if (status === "loading") {
|
265603
|
+
let tickInterval;
|
265604
|
+
let inc = -1;
|
265605
|
+
const delayTimeout = setTimeout(AsyncResource5.bind(() => {
|
265606
|
+
setShowLoader(true);
|
265607
|
+
tickInterval = setInterval(AsyncResource5.bind(() => {
|
265608
|
+
inc = inc + 1;
|
265609
|
+
setTick(inc % spinner2.frames.length);
|
265610
|
+
}), spinner2.interval);
|
265611
|
+
}), 300);
|
265612
|
+
return () => {
|
265613
|
+
clearTimeout(delayTimeout);
|
265614
|
+
clearInterval(tickInterval);
|
265615
|
+
};
|
265616
|
+
} else {
|
265617
|
+
setShowLoader(false);
|
265618
|
+
}
|
265619
|
+
}, [status]);
|
265620
|
+
if (showLoader) {
|
265621
|
+
return spinner2.frames[tick];
|
265622
|
+
}
|
265623
|
+
const iconName = status === "loading" ? "idle" : status;
|
265624
|
+
return typeof prefix === "string" ? prefix : prefix[iconName] ?? prefix["idle"];
|
265625
|
+
}
|
265626
|
+
// ../../node_modules/@inquirer/input/node_modules/@inquirer/core/dist/esm/lib/use-ref.js
|
265627
|
+
function useRef2(val) {
|
265628
|
+
return useState2({ current: val })[0];
|
265629
|
+
}
|
265630
|
+
|
265631
|
+
// ../../node_modules/@inquirer/input/node_modules/@inquirer/core/dist/esm/lib/use-keypress.js
|
265632
|
+
function useKeypress2(userHandler) {
|
265633
|
+
const signal = useRef2(userHandler);
|
265634
|
+
signal.current = userHandler;
|
265635
|
+
useEffect2((rl) => {
|
265636
|
+
let ignore = false;
|
265637
|
+
const handler = withUpdates2((_input, event) => {
|
265638
|
+
if (ignore)
|
265639
|
+
return;
|
265640
|
+
signal.current(event, rl);
|
265641
|
+
});
|
265642
|
+
rl.input.on("keypress", handler);
|
265643
|
+
return () => {
|
265644
|
+
ignore = true;
|
265645
|
+
rl.input.removeListener("keypress", handler);
|
265646
|
+
};
|
265647
|
+
}, []);
|
265648
|
+
}
|
265649
|
+
// ../../node_modules/@inquirer/input/node_modules/@inquirer/core/dist/esm/lib/utils.js
|
265650
|
+
var import_cli_width2 = __toESM(require_cli_width(), 1);
|
265651
|
+
var import_wrap_ansi2 = __toESM(require_wrap_ansi(), 1);
|
265652
|
+
function breakLines2(content, width) {
|
265653
|
+
return content.split(`
|
265654
|
+
`).flatMap((line) => import_wrap_ansi2.default(line, width, { trim: false, hard: true }).split(`
|
265655
|
+
`).map((str) => str.trimEnd())).join(`
|
265656
|
+
`);
|
265657
|
+
}
|
265658
|
+
function readlineWidth2() {
|
265659
|
+
return import_cli_width2.default({ defaultWidth: 80, output: readline3().output });
|
265660
|
+
}
|
265661
|
+
|
265662
|
+
// ../../node_modules/@inquirer/input/node_modules/@inquirer/core/dist/esm/lib/create-prompt.js
|
265663
|
+
var import_mute_stream2 = __toESM(require_lib(), 1);
|
265664
|
+
import * as readline4 from "node:readline";
|
265665
|
+
import { AsyncResource as AsyncResource6 } from "node:async_hooks";
|
265666
|
+
|
265667
|
+
// ../../node_modules/@inquirer/input/node_modules/@inquirer/core/dist/esm/lib/screen-manager.js
|
265066
265668
|
var import_ansi_escapes2 = __toESM(require_ansi_escapes(), 1);
|
265669
|
+
import { stripVTControlCharacters as stripVTControlCharacters3 } from "node:util";
|
265670
|
+
var height2 = (content) => content.split(`
|
265671
|
+
`).length;
|
265672
|
+
var lastLine2 = (content) => content.split(`
|
265673
|
+
`).pop() ?? "";
|
265674
|
+
function cursorDown2(n6) {
|
265675
|
+
return n6 > 0 ? import_ansi_escapes2.default.cursorDown(n6) : "";
|
265676
|
+
}
|
265677
|
+
|
265678
|
+
class ScreenManager2 {
|
265679
|
+
height = 0;
|
265680
|
+
extraLinesUnderPrompt = 0;
|
265681
|
+
cursorPos;
|
265682
|
+
rl;
|
265683
|
+
constructor(rl) {
|
265684
|
+
this.rl = rl;
|
265685
|
+
this.cursorPos = rl.getCursorPos();
|
265686
|
+
}
|
265687
|
+
write(content) {
|
265688
|
+
this.rl.output.unmute();
|
265689
|
+
this.rl.output.write(content);
|
265690
|
+
this.rl.output.mute();
|
265691
|
+
}
|
265692
|
+
render(content, bottomContent = "") {
|
265693
|
+
const promptLine = lastLine2(content);
|
265694
|
+
const rawPromptLine = stripVTControlCharacters3(promptLine);
|
265695
|
+
let prompt = rawPromptLine;
|
265696
|
+
if (this.rl.line.length > 0) {
|
265697
|
+
prompt = prompt.slice(0, -this.rl.line.length);
|
265698
|
+
}
|
265699
|
+
this.rl.setPrompt(prompt);
|
265700
|
+
this.cursorPos = this.rl.getCursorPos();
|
265701
|
+
const width = readlineWidth2();
|
265702
|
+
content = breakLines2(content, width);
|
265703
|
+
bottomContent = breakLines2(bottomContent, width);
|
265704
|
+
if (rawPromptLine.length % width === 0) {
|
265705
|
+
content += `
|
265706
|
+
`;
|
265707
|
+
}
|
265708
|
+
let output = content + (bottomContent ? `
|
265709
|
+
` + bottomContent : "");
|
265710
|
+
const promptLineUpDiff = Math.floor(rawPromptLine.length / width) - this.cursorPos.rows;
|
265711
|
+
const bottomContentHeight = promptLineUpDiff + (bottomContent ? height2(bottomContent) : 0);
|
265712
|
+
if (bottomContentHeight > 0)
|
265713
|
+
output += import_ansi_escapes2.default.cursorUp(bottomContentHeight);
|
265714
|
+
output += import_ansi_escapes2.default.cursorTo(this.cursorPos.cols);
|
265715
|
+
this.write(cursorDown2(this.extraLinesUnderPrompt) + import_ansi_escapes2.default.eraseLines(this.height) + output);
|
265716
|
+
this.extraLinesUnderPrompt = bottomContentHeight;
|
265717
|
+
this.height = height2(output);
|
265718
|
+
}
|
265719
|
+
checkCursorPos() {
|
265720
|
+
const cursorPos = this.rl.getCursorPos();
|
265721
|
+
if (cursorPos.cols !== this.cursorPos.cols) {
|
265722
|
+
this.write(import_ansi_escapes2.default.cursorTo(cursorPos.cols));
|
265723
|
+
this.cursorPos = cursorPos;
|
265724
|
+
}
|
265725
|
+
}
|
265726
|
+
done({ clearContent }) {
|
265727
|
+
this.rl.setPrompt("");
|
265728
|
+
let output = cursorDown2(this.extraLinesUnderPrompt);
|
265729
|
+
output += clearContent ? import_ansi_escapes2.default.eraseLines(this.height) : `
|
265730
|
+
`;
|
265731
|
+
output += import_ansi_escapes2.default.cursorShow;
|
265732
|
+
this.write(output);
|
265733
|
+
this.rl.close();
|
265734
|
+
}
|
265735
|
+
}
|
265736
|
+
|
265737
|
+
// ../../node_modules/@inquirer/input/node_modules/@inquirer/core/dist/esm/lib/promise-polyfill.js
|
265738
|
+
class PromisePolyfill2 extends Promise {
|
265739
|
+
static withResolver() {
|
265740
|
+
let resolve5;
|
265741
|
+
let reject;
|
265742
|
+
const promise = new Promise((res, rej) => {
|
265743
|
+
resolve5 = res;
|
265744
|
+
reject = rej;
|
265745
|
+
});
|
265746
|
+
return { promise, resolve: resolve5, reject };
|
265747
|
+
}
|
265748
|
+
}
|
265749
|
+
|
265750
|
+
// ../../node_modules/@inquirer/input/node_modules/@inquirer/core/dist/esm/lib/create-prompt.js
|
265751
|
+
function getCallSites2() {
|
265752
|
+
const _prepareStackTrace = Error.prepareStackTrace;
|
265753
|
+
let result = [];
|
265754
|
+
try {
|
265755
|
+
Error.prepareStackTrace = (_5, callSites) => {
|
265756
|
+
const callSitesWithoutCurrent = callSites.slice(1);
|
265757
|
+
result = callSitesWithoutCurrent;
|
265758
|
+
return callSitesWithoutCurrent;
|
265759
|
+
};
|
265760
|
+
new Error().stack;
|
265761
|
+
} catch {
|
265762
|
+
return result;
|
265763
|
+
}
|
265764
|
+
Error.prepareStackTrace = _prepareStackTrace;
|
265765
|
+
return result;
|
265766
|
+
}
|
265767
|
+
function createPrompt2(view) {
|
265768
|
+
const callSites = getCallSites2();
|
265769
|
+
const prompt = (config3, context = {}) => {
|
265770
|
+
const { input = process.stdin, signal } = context;
|
265771
|
+
const cleanups = new Set;
|
265772
|
+
const output = new import_mute_stream2.default;
|
265773
|
+
output.pipe(context.output ?? process.stdout);
|
265774
|
+
const rl = readline4.createInterface({
|
265775
|
+
terminal: true,
|
265776
|
+
input,
|
265777
|
+
output
|
265778
|
+
});
|
265779
|
+
const screen = new ScreenManager2(rl);
|
265780
|
+
const { promise, resolve: resolve5, reject } = PromisePolyfill2.withResolver();
|
265781
|
+
const cancel3 = () => reject(new CancelPromptError2);
|
265782
|
+
if (signal) {
|
265783
|
+
const abort = () => reject(new AbortPromptError2({ cause: signal.reason }));
|
265784
|
+
if (signal.aborted) {
|
265785
|
+
abort();
|
265786
|
+
return Object.assign(promise, { cancel: cancel3 });
|
265787
|
+
}
|
265788
|
+
signal.addEventListener("abort", abort);
|
265789
|
+
cleanups.add(() => signal.removeEventListener("abort", abort));
|
265790
|
+
}
|
265791
|
+
cleanups.add(onExit((code2, signal2) => {
|
265792
|
+
reject(new ExitPromptError2(`User force closed the prompt with ${code2} ${signal2}`));
|
265793
|
+
}));
|
265794
|
+
const checkCursorPos = () => screen.checkCursorPos();
|
265795
|
+
rl.input.on("keypress", checkCursorPos);
|
265796
|
+
cleanups.add(() => rl.input.removeListener("keypress", checkCursorPos));
|
265797
|
+
return withHooks2(rl, (cycle) => {
|
265798
|
+
const hooksCleanup = AsyncResource6.bind(() => effectScheduler2.clearAll());
|
265799
|
+
rl.on("close", hooksCleanup);
|
265800
|
+
cleanups.add(() => rl.removeListener("close", hooksCleanup));
|
265801
|
+
cycle(() => {
|
265802
|
+
try {
|
265803
|
+
const nextView = view(config3, (value4) => {
|
265804
|
+
setImmediate(() => resolve5(value4));
|
265805
|
+
});
|
265806
|
+
if (nextView === undefined) {
|
265807
|
+
const callerFilename = callSites[1]?.getFileName?.();
|
265808
|
+
throw new Error(`Prompt functions must return a string.
|
265809
|
+
at ${callerFilename}`);
|
265810
|
+
}
|
265811
|
+
const [content, bottomContent] = typeof nextView === "string" ? [nextView] : nextView;
|
265812
|
+
screen.render(content, bottomContent);
|
265813
|
+
effectScheduler2.run();
|
265814
|
+
} catch (error5) {
|
265815
|
+
reject(error5);
|
265816
|
+
}
|
265817
|
+
});
|
265818
|
+
return Object.assign(promise.then((answer) => {
|
265819
|
+
effectScheduler2.clearAll();
|
265820
|
+
return answer;
|
265821
|
+
}, (error5) => {
|
265822
|
+
effectScheduler2.clearAll();
|
265823
|
+
throw error5;
|
265824
|
+
}).finally(() => {
|
265825
|
+
cleanups.forEach((cleanup) => cleanup());
|
265826
|
+
screen.done({ clearContent: Boolean(context.clearPromptOnDone) });
|
265827
|
+
output.end();
|
265828
|
+
}).then(() => promise), { cancel: cancel3 });
|
265829
|
+
});
|
265830
|
+
};
|
265831
|
+
return prompt;
|
265832
|
+
}
|
265833
|
+
// ../../node_modules/@inquirer/input/dist/esm/index.js
|
265834
|
+
var inputTheme = {
|
265835
|
+
validationFailureMode: "keep"
|
265836
|
+
};
|
265837
|
+
var esm_default3 = createPrompt2((config3, done) => {
|
265838
|
+
const { required, validate: validate3 = () => true } = config3;
|
265839
|
+
const theme = makeTheme2(inputTheme, config3.theme);
|
265840
|
+
const [status, setStatus] = useState2("idle");
|
265841
|
+
const [defaultValue = "", setDefaultValue] = useState2(config3.default);
|
265842
|
+
const [errorMsg, setError] = useState2();
|
265843
|
+
const [value4, setValue] = useState2("");
|
265844
|
+
const prefix = usePrefix2({ status, theme });
|
265845
|
+
useKeypress2(async (key3, rl) => {
|
265846
|
+
if (status !== "idle") {
|
265847
|
+
return;
|
265848
|
+
}
|
265849
|
+
if (isEnterKey2(key3)) {
|
265850
|
+
const answer = value4 || defaultValue;
|
265851
|
+
setStatus("loading");
|
265852
|
+
const isValid2 = required && !answer ? "You must provide a value" : await validate3(answer);
|
265853
|
+
if (isValid2 === true) {
|
265854
|
+
setValue(answer);
|
265855
|
+
setStatus("done");
|
265856
|
+
done(answer);
|
265857
|
+
} else {
|
265858
|
+
if (theme.validationFailureMode === "clear") {
|
265859
|
+
setValue("");
|
265860
|
+
} else {
|
265861
|
+
rl.write(value4);
|
265862
|
+
}
|
265863
|
+
setError(isValid2 || "You must provide a valid value");
|
265864
|
+
setStatus("idle");
|
265865
|
+
}
|
265866
|
+
} else if (isBackspaceKey2(key3) && !value4) {
|
265867
|
+
setDefaultValue(undefined);
|
265868
|
+
} else if (key3.name === "tab" && !value4) {
|
265869
|
+
setDefaultValue(undefined);
|
265870
|
+
rl.clearLine(0);
|
265871
|
+
rl.write(defaultValue);
|
265872
|
+
setValue(defaultValue);
|
265873
|
+
} else {
|
265874
|
+
setValue(rl.line);
|
265875
|
+
setError(undefined);
|
265876
|
+
}
|
265877
|
+
});
|
265878
|
+
const message = theme.style.message(config3.message, status);
|
265879
|
+
let formattedValue = value4;
|
265880
|
+
if (typeof config3.transformer === "function") {
|
265881
|
+
formattedValue = config3.transformer(value4, { isFinal: status === "done" });
|
265882
|
+
} else if (status === "done") {
|
265883
|
+
formattedValue = theme.style.answer(value4);
|
265884
|
+
}
|
265885
|
+
let defaultStr;
|
265886
|
+
if (defaultValue && status !== "done" && !value4) {
|
265887
|
+
defaultStr = theme.style.defaultAnswer(defaultValue);
|
265888
|
+
}
|
265889
|
+
let error5 = "";
|
265890
|
+
if (errorMsg) {
|
265891
|
+
error5 = theme.style.error(errorMsg);
|
265892
|
+
}
|
265893
|
+
return [
|
265894
|
+
[prefix, message, defaultStr, formattedValue].filter((v6) => v6 !== undefined).join(" "),
|
265895
|
+
error5
|
265896
|
+
];
|
265897
|
+
});
|
265898
|
+
|
265899
|
+
// src/prompts/smart-contract-set/subgraph-name.prompt.ts
|
265900
|
+
async function subgraphNamePrompt({
|
265901
|
+
defaultName,
|
265902
|
+
env: env2,
|
265903
|
+
accept
|
265904
|
+
}) {
|
265905
|
+
const defaultSubgraphName = defaultName ? sanitizeName(defaultName) : undefined;
|
265906
|
+
if (accept) {
|
265907
|
+
return defaultSubgraphName ?? env2.SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH;
|
265908
|
+
}
|
265909
|
+
const subgraphName = await esm_default3({
|
265910
|
+
message: "What is the name of your subgraph?",
|
265911
|
+
default: defaultSubgraphName,
|
265912
|
+
required: true
|
265913
|
+
});
|
265914
|
+
return sanitizeName(subgraphName);
|
265915
|
+
}
|
265916
|
+
|
265917
|
+
// ../../node_modules/@inquirer/select/dist/esm/index.js
|
265918
|
+
var import_yoctocolors_cjs4 = __toESM(require_yoctocolors_cjs(), 1);
|
265919
|
+
var import_ansi_escapes3 = __toESM(require_ansi_escapes(), 1);
|
265067
265920
|
var selectTheme = {
|
265068
265921
|
icon: { cursor: esm_default.pointer },
|
265069
265922
|
style: {
|
265070
|
-
disabled: (text2) =>
|
265071
|
-
description: (text2) =>
|
265923
|
+
disabled: (text2) => import_yoctocolors_cjs4.default.dim(`- ${text2}`),
|
265924
|
+
description: (text2) => import_yoctocolors_cjs4.default.cyan(text2)
|
265072
265925
|
},
|
265073
265926
|
helpMode: "auto"
|
265074
265927
|
};
|
@@ -265097,7 +265950,7 @@ function normalizeChoices(choices) {
|
|
265097
265950
|
};
|
265098
265951
|
});
|
265099
265952
|
}
|
265100
|
-
var
|
265953
|
+
var esm_default4 = createPrompt((config3, done) => {
|
265101
265954
|
const { loop = true, pageSize = 7 } = config3;
|
265102
265955
|
const firstRender = useRef(true);
|
265103
265956
|
const theme = makeTheme(selectTheme, config3.theme);
|
@@ -265120,29 +265973,29 @@ var esm_default2 = createPrompt((config3, done) => {
|
|
265120
265973
|
}, [config3.default, items]);
|
265121
265974
|
const [active, setActive] = useState(defaultItemIndex === -1 ? bounds.first : defaultItemIndex);
|
265122
265975
|
const selectedChoice = items[active];
|
265123
|
-
useKeypress((
|
265976
|
+
useKeypress((key3, rl) => {
|
265124
265977
|
clearTimeout(searchTimeoutRef.current);
|
265125
|
-
if (isEnterKey(
|
265978
|
+
if (isEnterKey(key3)) {
|
265126
265979
|
setStatus("done");
|
265127
265980
|
done(selectedChoice.value);
|
265128
|
-
} else if (isUpKey(
|
265981
|
+
} else if (isUpKey(key3) || isDownKey(key3)) {
|
265129
265982
|
rl.clearLine(0);
|
265130
|
-
if (loop || isUpKey(
|
265131
|
-
const offset = isUpKey(
|
265983
|
+
if (loop || isUpKey(key3) && active !== bounds.first || isDownKey(key3) && active !== bounds.last) {
|
265984
|
+
const offset = isUpKey(key3) ? -1 : 1;
|
265132
265985
|
let next = active;
|
265133
265986
|
do {
|
265134
265987
|
next = (next + offset + items.length) % items.length;
|
265135
265988
|
} while (!isSelectable(items[next]));
|
265136
265989
|
setActive(next);
|
265137
265990
|
}
|
265138
|
-
} else if (isNumberKey(
|
265991
|
+
} else if (isNumberKey(key3)) {
|
265139
265992
|
rl.clearLine(0);
|
265140
|
-
const position = Number(
|
265993
|
+
const position = Number(key3.name) - 1;
|
265141
265994
|
const item = items[position];
|
265142
265995
|
if (item != null && isSelectable(item)) {
|
265143
265996
|
setActive(position);
|
265144
265997
|
}
|
265145
|
-
} else if (isBackspaceKey(
|
265998
|
+
} else if (isBackspaceKey(key3)) {
|
265146
265999
|
rl.clearLine(0);
|
265147
266000
|
} else {
|
265148
266001
|
const searchTerm = rl.line.toLowerCase();
|
@@ -265198,16 +266051,24 @@ ${theme.style.help("(Use arrow keys to reveal more choices)")}`;
|
|
265198
266051
|
const choiceDescription = selectedChoice.description ? `
|
265199
266052
|
${theme.style.description(selectedChoice.description)}` : ``;
|
265200
266053
|
return `${[prefix, message, helpTipTop].filter(Boolean).join(" ")}
|
265201
|
-
${page}${helpTipBottom}${choiceDescription}${
|
266054
|
+
${page}${helpTipBottom}${choiceDescription}${import_ansi_escapes3.default.cursorHide}`;
|
265202
266055
|
});
|
265203
266056
|
|
265204
266057
|
// src/prompts/smart-contract-set/subgraph.prompt.ts
|
265205
266058
|
var ALL = "All";
|
265206
|
-
|
265207
|
-
|
266059
|
+
var NEW = "New subgraph";
|
266060
|
+
async function subgraphPrompt({
|
266061
|
+
env: env2,
|
266062
|
+
accept,
|
266063
|
+
message,
|
266064
|
+
allowAll = false,
|
266065
|
+
allowNew = false,
|
266066
|
+
isCi = is_in_ci_default
|
266067
|
+
}) {
|
266068
|
+
const autoAccept = isCi || !!accept;
|
265208
266069
|
const subgraphNames = env2.SETTLEMINT_THEGRAPH_SUBGRAPHS_ENDPOINTS?.map((endpoint) => endpoint.split("/").pop()).filter(Boolean) ?? [];
|
265209
266070
|
if (autoAccept) {
|
265210
|
-
return subgraphNames;
|
266071
|
+
return allowAll ? subgraphNames : env2.SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH ? [env2.SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH] : [];
|
265211
266072
|
}
|
265212
266073
|
if (subgraphNames.length === 0) {
|
265213
266074
|
cancel2("No subgraphs found");
|
@@ -265215,17 +266076,43 @@ async function subgraphPrompt(env2, accept) {
|
|
265215
266076
|
if (subgraphNames.length === 1) {
|
265216
266077
|
return subgraphNames;
|
265217
266078
|
}
|
265218
|
-
const
|
265219
|
-
|
265220
|
-
choices
|
266079
|
+
const choices = subgraphNames.slice().sort();
|
266080
|
+
if (allowAll) {
|
266081
|
+
choices.unshift(ALL);
|
266082
|
+
}
|
266083
|
+
if (allowNew) {
|
266084
|
+
choices.unshift(NEW);
|
266085
|
+
}
|
266086
|
+
let defaultChoice;
|
266087
|
+
if (allowAll) {
|
266088
|
+
defaultChoice = ALL;
|
266089
|
+
} else if (allowNew) {
|
266090
|
+
defaultChoice = env2.SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH ?? NEW;
|
266091
|
+
} else {
|
266092
|
+
defaultChoice = env2.SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH ?? subgraphNames[0];
|
266093
|
+
}
|
266094
|
+
const subgraphName = await esm_default4({
|
266095
|
+
message,
|
266096
|
+
choices: choices.map((name3) => ({
|
265221
266097
|
name: name3,
|
265222
266098
|
value: name3
|
265223
266099
|
})),
|
265224
|
-
default:
|
266100
|
+
default: defaultChoice
|
265225
266101
|
});
|
265226
266102
|
if (!subgraphName) {
|
265227
266103
|
cancel2("No subgraph selected");
|
265228
266104
|
}
|
266105
|
+
if (subgraphName === NEW) {
|
266106
|
+
const newSubgraphName = await subgraphNamePrompt({
|
266107
|
+
defaultName: "",
|
266108
|
+
env: env2,
|
266109
|
+
accept: autoAccept
|
266110
|
+
});
|
266111
|
+
if (!newSubgraphName) {
|
266112
|
+
return [];
|
266113
|
+
}
|
266114
|
+
return [newSubgraphName];
|
266115
|
+
}
|
265229
266116
|
return subgraphName === ALL ? subgraphNames : [subgraphName];
|
265230
266117
|
}
|
265231
266118
|
|
@@ -265486,7 +266373,12 @@ function codegenCommand() {
|
|
265486
266373
|
intro("Generating GraphQL types and queries for your dApp");
|
265487
266374
|
const env2 = await loadEnv(true, !!prod);
|
265488
266375
|
if (!Array.isArray(thegraphSubgraphNames)) {
|
265489
|
-
thegraphSubgraphNames = await subgraphPrompt(
|
266376
|
+
thegraphSubgraphNames = await subgraphPrompt({
|
266377
|
+
env: env2,
|
266378
|
+
accept: true,
|
266379
|
+
message: "Which The Graph subgraph do you want to generate types for?",
|
266380
|
+
allowAll: true
|
266381
|
+
});
|
265490
266382
|
}
|
265491
266383
|
const { hasura, portal, thegraph, blockscout } = await spinner({
|
265492
266384
|
startMessage: "Testing configured GraphQL schema",
|
@@ -265541,19 +266433,19 @@ function getBooleanValue(value4, defaultValue) {
|
|
265541
266433
|
function boolToString(value4) {
|
265542
266434
|
return value4 ? "Yes" : "No";
|
265543
266435
|
}
|
265544
|
-
var
|
266436
|
+
var esm_default5 = createPrompt((config3, done) => {
|
265545
266437
|
const { transformer = boolToString } = config3;
|
265546
266438
|
const [status, setStatus] = useState("idle");
|
265547
266439
|
const [value4, setValue] = useState("");
|
265548
266440
|
const theme = makeTheme(config3.theme);
|
265549
266441
|
const prefix = usePrefix({ status, theme });
|
265550
|
-
useKeypress((
|
265551
|
-
if (isEnterKey(
|
266442
|
+
useKeypress((key3, rl) => {
|
266443
|
+
if (isEnterKey(key3)) {
|
265552
266444
|
const answer = getBooleanValue(value4, config3.default);
|
265553
266445
|
setValue(transformer(answer));
|
265554
266446
|
setStatus("done");
|
265555
266447
|
done(answer);
|
265556
|
-
} else if (
|
266448
|
+
} else if (key3.name === "tab") {
|
265557
266449
|
const answer = boolToString(!getBooleanValue(value4, config3.default));
|
265558
266450
|
rl.clearLine(0);
|
265559
266451
|
rl.write(answer);
|
@@ -265573,86 +266465,20 @@ var esm_default3 = createPrompt((config3, done) => {
|
|
265573
266465
|
return `${prefix} ${message}${defaultValue} ${formattedValue}`;
|
265574
266466
|
});
|
265575
266467
|
|
265576
|
-
// ../../node_modules/@inquirer/input/dist/esm/index.js
|
265577
|
-
var inputTheme = {
|
265578
|
-
validationFailureMode: "keep"
|
265579
|
-
};
|
265580
|
-
var esm_default4 = createPrompt((config3, done) => {
|
265581
|
-
const { required, validate: validate3 = () => true } = config3;
|
265582
|
-
const theme = makeTheme(inputTheme, config3.theme);
|
265583
|
-
const [status, setStatus] = useState("idle");
|
265584
|
-
const [defaultValue = "", setDefaultValue] = useState(config3.default);
|
265585
|
-
const [errorMsg, setError] = useState();
|
265586
|
-
const [value4, setValue] = useState("");
|
265587
|
-
const prefix = usePrefix({ status, theme });
|
265588
|
-
useKeypress(async (key2, rl) => {
|
265589
|
-
if (status !== "idle") {
|
265590
|
-
return;
|
265591
|
-
}
|
265592
|
-
if (isEnterKey(key2)) {
|
265593
|
-
const answer = value4 || defaultValue;
|
265594
|
-
setStatus("loading");
|
265595
|
-
const isValid2 = required && !answer ? "You must provide a value" : await validate3(answer);
|
265596
|
-
if (isValid2 === true) {
|
265597
|
-
setValue(answer);
|
265598
|
-
setStatus("done");
|
265599
|
-
done(answer);
|
265600
|
-
} else {
|
265601
|
-
if (theme.validationFailureMode === "clear") {
|
265602
|
-
setValue("");
|
265603
|
-
} else {
|
265604
|
-
rl.write(value4);
|
265605
|
-
}
|
265606
|
-
setError(isValid2 || "You must provide a valid value");
|
265607
|
-
setStatus("idle");
|
265608
|
-
}
|
265609
|
-
} else if (isBackspaceKey(key2) && !value4) {
|
265610
|
-
setDefaultValue(undefined);
|
265611
|
-
} else if (key2.name === "tab" && !value4) {
|
265612
|
-
setDefaultValue(undefined);
|
265613
|
-
rl.clearLine(0);
|
265614
|
-
rl.write(defaultValue);
|
265615
|
-
setValue(defaultValue);
|
265616
|
-
} else {
|
265617
|
-
setValue(rl.line);
|
265618
|
-
setError(undefined);
|
265619
|
-
}
|
265620
|
-
});
|
265621
|
-
const message = theme.style.message(config3.message, status);
|
265622
|
-
let formattedValue = value4;
|
265623
|
-
if (typeof config3.transformer === "function") {
|
265624
|
-
formattedValue = config3.transformer(value4, { isFinal: status === "done" });
|
265625
|
-
} else if (status === "done") {
|
265626
|
-
formattedValue = theme.style.answer(value4);
|
265627
|
-
}
|
265628
|
-
let defaultStr;
|
265629
|
-
if (defaultValue && status !== "done" && !value4) {
|
265630
|
-
defaultStr = theme.style.defaultAnswer(defaultValue);
|
265631
|
-
}
|
265632
|
-
let error5 = "";
|
265633
|
-
if (errorMsg) {
|
265634
|
-
error5 = theme.style.error(errorMsg);
|
265635
|
-
}
|
265636
|
-
return [
|
265637
|
-
[prefix, message, defaultStr, formattedValue].filter((v6) => v6 !== undefined).join(" "),
|
265638
|
-
error5
|
265639
|
-
];
|
265640
|
-
});
|
265641
|
-
|
265642
266468
|
// ../../node_modules/@inquirer/password/dist/esm/index.js
|
265643
|
-
var
|
265644
|
-
var
|
266469
|
+
var import_ansi_escapes4 = __toESM(require_ansi_escapes(), 1);
|
266470
|
+
var esm_default6 = createPrompt((config3, done) => {
|
265645
266471
|
const { validate: validate3 = () => true } = config3;
|
265646
266472
|
const theme = makeTheme(config3.theme);
|
265647
266473
|
const [status, setStatus] = useState("idle");
|
265648
266474
|
const [errorMsg, setError] = useState();
|
265649
266475
|
const [value4, setValue] = useState("");
|
265650
266476
|
const prefix = usePrefix({ status, theme });
|
265651
|
-
useKeypress(async (
|
266477
|
+
useKeypress(async (key3, rl) => {
|
265652
266478
|
if (status !== "idle") {
|
265653
266479
|
return;
|
265654
266480
|
}
|
265655
|
-
if (isEnterKey(
|
266481
|
+
if (isEnterKey(key3)) {
|
265656
266482
|
const answer = value4;
|
265657
266483
|
setStatus("loading");
|
265658
266484
|
const isValid2 = await validate3(answer);
|
@@ -265677,7 +266503,7 @@ var esm_default5 = createPrompt((config3, done) => {
|
|
265677
266503
|
const maskChar = typeof config3.mask === "string" ? config3.mask : "*";
|
265678
266504
|
formattedValue = maskChar.repeat(value4.length);
|
265679
266505
|
} else if (status !== "done") {
|
265680
|
-
helpTip = `${theme.style.help("[input is masked]")}${
|
266506
|
+
helpTip = `${theme.style.help("[input is masked]")}${import_ansi_escapes4.default.cursorHide}`;
|
265681
266507
|
}
|
265682
266508
|
if (status === "done") {
|
265683
266509
|
formattedValue = theme.style.answer(formattedValue);
|
@@ -265699,7 +266525,7 @@ async function applicationAccessTokenPrompt(env2, application, settlemint, accep
|
|
265699
266525
|
return defaultAccessToken;
|
265700
266526
|
}
|
265701
266527
|
if (defaultAccessToken) {
|
265702
|
-
const keep = await
|
266528
|
+
const keep = await esm_default5({
|
265703
266529
|
message: "Do you want to use the existing application access token?",
|
265704
266530
|
default: true
|
265705
266531
|
});
|
@@ -265707,12 +266533,12 @@ async function applicationAccessTokenPrompt(env2, application, settlemint, accep
|
|
265707
266533
|
return defaultAccessToken;
|
265708
266534
|
}
|
265709
266535
|
}
|
265710
|
-
const create2 = await
|
266536
|
+
const create2 = await esm_default5({
|
265711
266537
|
message: "Do you want to create a new application access token?",
|
265712
266538
|
default: false
|
265713
266539
|
});
|
265714
266540
|
if (create2) {
|
265715
|
-
const name3 = await
|
266541
|
+
const name3 = await esm_default3({
|
265716
266542
|
message: "How would you like to name this application access token?",
|
265717
266543
|
default: `SettleMint CLI (${Date.now()}${process.env.USER ? ` ${process.env.USER}` : ""})`,
|
265718
266544
|
required: true,
|
@@ -265776,7 +266602,7 @@ async function applicationAccessTokenPrompt(env2, application, settlemint, accep
|
|
265776
266602
|
} catch (error5) {
|
265777
266603
|
}
|
265778
266604
|
}
|
265779
|
-
return
|
266605
|
+
return esm_default6({
|
265780
266606
|
message: "What is the application access token for your application in SettleMint? (format: sm_aat_...)",
|
265781
266607
|
validate(value4) {
|
265782
266608
|
try {
|
@@ -265808,7 +266634,7 @@ async function applicationPrompt(env2, applications, accept) {
|
|
265808
266634
|
if (is_in_ci_default) {
|
265809
266635
|
nothingSelectedError("application");
|
265810
266636
|
}
|
265811
|
-
const application = await
|
266637
|
+
const application = await esm_default4({
|
265812
266638
|
message: "Which application do you want to connect to?",
|
265813
266639
|
choices: applications.map((applications2) => ({
|
265814
266640
|
name: `${applications2.name} (${applications2.uniqueName})`,
|
@@ -265881,7 +266707,7 @@ async function blockchainNodePrompt({
|
|
265881
266707
|
isRequired,
|
265882
266708
|
defaultHandler: async ({ defaultService: defaultNode, choices }) => {
|
265883
266709
|
const filteredChoices = filterRunningOnly ? choices.filter(({ value: node }) => node === undefined || node?.status === "COMPLETED") : choices;
|
265884
|
-
return
|
266710
|
+
return esm_default4({
|
265885
266711
|
message: promptMessage ?? "Which blockchain node do you want to connect to?",
|
265886
266712
|
choices: filteredChoices,
|
265887
266713
|
default: defaultNode
|
@@ -265906,7 +266732,7 @@ async function blockscoutPrompt({
|
|
265906
266732
|
envKey: "SETTLEMINT_BLOCKSCOUT",
|
265907
266733
|
isRequired,
|
265908
266734
|
defaultHandler: async ({ defaultService: defaultBlockscout, choices }) => {
|
265909
|
-
return
|
266735
|
+
return esm_default4({
|
265910
266736
|
message: "Which blockscout instance do you want to connect to?",
|
265911
266737
|
choices,
|
265912
266738
|
default: defaultBlockscout
|
@@ -265929,7 +266755,7 @@ async function customDeploymentPrompt({
|
|
265929
266755
|
envKey: "SETTLEMINT_CUSTOM_DEPLOYMENT",
|
265930
266756
|
isRequired,
|
265931
266757
|
defaultHandler: async ({ defaultService: defaultCustomDeployment, choices }) => {
|
265932
|
-
return
|
266758
|
+
return esm_default4({
|
265933
266759
|
message: "Which Custom Deployment do you want to connect to?",
|
265934
266760
|
choices,
|
265935
266761
|
default: defaultCustomDeployment
|
@@ -265953,7 +266779,7 @@ async function hasuraPrompt({
|
|
265953
266779
|
envKey: "SETTLEMINT_HASURA",
|
265954
266780
|
isRequired,
|
265955
266781
|
defaultHandler: async ({ defaultService: defaultHasura, choices }) => {
|
265956
|
-
return
|
266782
|
+
return esm_default4({
|
265957
266783
|
message: "Which Hasura instance do you want to connect to?",
|
265958
266784
|
choices,
|
265959
266785
|
default: defaultHasura
|
@@ -265977,7 +266803,7 @@ async function hdPrivateKeyPrompt({
|
|
265977
266803
|
envKey: "SETTLEMINT_HD_PRIVATE_KEY",
|
265978
266804
|
isRequired,
|
265979
266805
|
defaultHandler: async ({ defaultService: defaultPrivateKey, choices }) => {
|
265980
|
-
return
|
266806
|
+
return esm_default4({
|
265981
266807
|
message: "Which HD Private Key do you want to use?",
|
265982
266808
|
choices,
|
265983
266809
|
default: defaultPrivateKey
|
@@ -266001,7 +266827,7 @@ async function ipfsPrompt({
|
|
266001
266827
|
envKey: "SETTLEMINT_IPFS",
|
266002
266828
|
isRequired,
|
266003
266829
|
defaultHandler: async ({ defaultService: defaultStorage, choices }) => {
|
266004
|
-
return
|
266830
|
+
return esm_default4({
|
266005
266831
|
message: "Which IPFS instance do you want to connect to?",
|
266006
266832
|
choices,
|
266007
266833
|
default: defaultStorage
|
@@ -266025,7 +266851,7 @@ async function minioPrompt({
|
|
266025
266851
|
envKey: "SETTLEMINT_MINIO",
|
266026
266852
|
isRequired,
|
266027
266853
|
defaultHandler: async ({ defaultService: defaultStorage, choices }) => {
|
266028
|
-
return
|
266854
|
+
return esm_default4({
|
266029
266855
|
message: "Which MinIO instance do you want to connect to?",
|
266030
266856
|
choices,
|
266031
266857
|
default: defaultStorage
|
@@ -266049,7 +266875,7 @@ async function portalPrompt({
|
|
266049
266875
|
envKey: "SETTLEMINT_PORTAL",
|
266050
266876
|
isRequired,
|
266051
266877
|
defaultHandler: async ({ defaultService: defaultMiddleware, choices }) => {
|
266052
|
-
return
|
266878
|
+
return esm_default4({
|
266053
266879
|
message: "Which Smart Contract Portal instance do you want to connect to?",
|
266054
266880
|
choices,
|
266055
266881
|
default: defaultMiddleware
|
@@ -266078,7 +266904,7 @@ async function theGraphPrompt({
|
|
266078
266904
|
isRequired,
|
266079
266905
|
defaultHandler: async ({ defaultService: defaultMiddleware, choices }) => {
|
266080
266906
|
const filteredChoices = filterRunningOnly ? choices.filter(({ value: middleware }) => middleware === undefined || middleware?.status === "COMPLETED") : choices;
|
266081
|
-
return
|
266907
|
+
return esm_default4({
|
266082
266908
|
message: "Which The Graph instance do you want to connect to?",
|
266083
266909
|
choices: filteredChoices,
|
266084
266910
|
default: defaultMiddleware
|
@@ -266112,7 +266938,7 @@ async function instancePrompt(env2, accept, freeTextInput = false, isCi = is_in_
|
|
266112
266938
|
return sanitizeInstanceUrl(defaultPromptInstance);
|
266113
266939
|
}
|
266114
266940
|
if (freeTextInput) {
|
266115
|
-
const instance = await
|
266941
|
+
const instance = await esm_default3({
|
266116
266942
|
message: "What is the URL of your SettleMint instance?",
|
266117
266943
|
default: defaultPromptInstance,
|
266118
266944
|
required: true,
|
@@ -266134,7 +266960,7 @@ async function instancePrompt(env2, accept, freeTextInput = false, isCi = is_in_
|
|
266134
266960
|
if (knownInstances.length === 1) {
|
266135
266961
|
return sanitizeInstanceUrl(knownInstances[0]);
|
266136
266962
|
}
|
266137
|
-
return
|
266963
|
+
return esm_default4({
|
266138
266964
|
message: "What SettleMint instance do you want to connect to?",
|
266139
266965
|
choices: [
|
266140
266966
|
...knownInstances.map((instance) => ({
|
@@ -266160,7 +266986,7 @@ async function workspacePrompt(env2, workspaces, accept) {
|
|
266160
266986
|
if (is_in_ci_default) {
|
266161
266987
|
nothingSelectedError("workspace");
|
266162
266988
|
}
|
266163
|
-
const workspace = await
|
266989
|
+
const workspace = await esm_default4({
|
266164
266990
|
message: "Which workspace do you want to connect to?",
|
266165
266991
|
choices: workspaces.map((workspace2) => ({
|
266166
266992
|
name: `${workspace2.name} (${workspace2.uniqueName})`,
|
@@ -266253,7 +267079,7 @@ async function writeEnvSpinner(prod, env2) {
|
|
266253
267079
|
SETTLEMINT_HASURA_ENDPOINT: env2.SETTLEMINT_HASURA_ENDPOINT,
|
266254
267080
|
SETTLEMINT_THEGRAPH: env2.SETTLEMINT_THEGRAPH,
|
266255
267081
|
SETTLEMINT_THEGRAPH_SUBGRAPHS_ENDPOINTS: env2.SETTLEMINT_THEGRAPH_SUBGRAPHS_ENDPOINTS,
|
266256
|
-
|
267082
|
+
SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH: env2.SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH,
|
266257
267083
|
SETTLEMINT_PORTAL: env2.SETTLEMINT_PORTAL,
|
266258
267084
|
SETTLEMINT_PORTAL_GRAPHQL_ENDPOINT: env2.SETTLEMINT_PORTAL_GRAPHQL_ENDPOINT,
|
266259
267085
|
SETTLEMINT_PORTAL_REST_ENDPOINT: env2.SETTLEMINT_PORTAL_REST_ENDPOINT,
|
@@ -266391,6 +267217,12 @@ function connectCommand() {
|
|
266391
267217
|
middlewares,
|
266392
267218
|
accept: acceptDefaults
|
266393
267219
|
});
|
267220
|
+
const graphEndpoints = await getGraphEndpoint(settlemint, thegraph);
|
267221
|
+
const [defaultSubgraph] = thegraph ? await subgraphPrompt({
|
267222
|
+
env: { ...env2, ...graphEndpoints },
|
267223
|
+
accept: acceptDefaults,
|
267224
|
+
message: "Which The Graph subgraph do you want to use as the default?"
|
267225
|
+
}) : [];
|
266394
267226
|
const portal = await portalPrompt({
|
266395
267227
|
env: env2,
|
266396
267228
|
middlewares,
|
@@ -266496,7 +267328,8 @@ function connectCommand() {
|
|
266496
267328
|
SETTLEMINT_HASURA: hasura?.uniqueName,
|
266497
267329
|
...getHasuraEndpoints(hasura),
|
266498
267330
|
SETTLEMINT_THEGRAPH: thegraph?.uniqueName,
|
266499
|
-
|
267331
|
+
SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH: defaultSubgraph,
|
267332
|
+
...graphEndpoints,
|
266500
267333
|
SETTLEMINT_PORTAL: portal?.uniqueName,
|
266501
267334
|
...getPortalEndpoints(portal),
|
266502
267335
|
SETTLEMINT_HD_PRIVATE_KEY: hdPrivateKey?.uniqueName,
|
@@ -266517,27 +267350,6 @@ function connectCommand() {
|
|
266517
267350
|
import { mkdir as mkdir6 } from "node:fs/promises";
|
266518
267351
|
import { join as join9 } from "node:path";
|
266519
267352
|
|
266520
|
-
// src/prompts/project-name.prompt.ts
|
266521
|
-
async function projectNamePrompt(env2, argument) {
|
266522
|
-
const defaultInstance = env2.SETTLEMINT_NEW_PROJECT_NAME ?? argument;
|
266523
|
-
if (defaultInstance) {
|
266524
|
-
return defaultInstance;
|
266525
|
-
}
|
266526
|
-
return esm_default4({
|
266527
|
-
message: "What is the name of your new SettleMint project?",
|
266528
|
-
default: defaultInstance,
|
266529
|
-
required: true,
|
266530
|
-
validate(value4) {
|
266531
|
-
try {
|
266532
|
-
validate2(z.string(), value4);
|
266533
|
-
return true;
|
266534
|
-
} catch (error5) {
|
266535
|
-
return "Invalid projectname";
|
266536
|
-
}
|
266537
|
-
}
|
266538
|
-
});
|
266539
|
-
}
|
266540
|
-
|
266541
267353
|
// src/utils/platform-utils.ts
|
266542
267354
|
function getUseCases(platformConfig) {
|
266543
267355
|
return platformConfig.smartContractSets.sets.filter((useCase) => !useCase.featureflagged);
|
@@ -266546,7 +267358,7 @@ function getKits(platformConfig) {
|
|
266546
267358
|
return platformConfig.kits ?? [];
|
266547
267359
|
}
|
266548
267360
|
|
266549
|
-
// src/prompts/
|
267361
|
+
// src/prompts/kit/template.prompt.ts
|
266550
267362
|
async function templatePrompt(platformConfig, argument) {
|
266551
267363
|
const kits = getKits(platformConfig);
|
266552
267364
|
if (kits.length === 0) {
|
@@ -266560,7 +267372,7 @@ async function templatePrompt(platformConfig, argument) {
|
|
266560
267372
|
}
|
266561
267373
|
return template2;
|
266562
267374
|
}
|
266563
|
-
const template = await
|
267375
|
+
const template = await esm_default4({
|
266564
267376
|
message: "Which template do you want to use?",
|
266565
267377
|
choices: [
|
266566
267378
|
...kits.map((template2) => ({
|
@@ -266572,6 +267384,27 @@ async function templatePrompt(platformConfig, argument) {
|
|
266572
267384
|
return template;
|
266573
267385
|
}
|
266574
267386
|
|
267387
|
+
// src/prompts/project-name.prompt.ts
|
267388
|
+
async function projectNamePrompt(env2, argument) {
|
267389
|
+
const defaultInstance = env2.SETTLEMINT_NEW_PROJECT_NAME ?? argument;
|
267390
|
+
if (defaultInstance) {
|
267391
|
+
return defaultInstance;
|
267392
|
+
}
|
267393
|
+
return esm_default3({
|
267394
|
+
message: "What is the name of your new SettleMint project?",
|
267395
|
+
default: defaultInstance,
|
267396
|
+
required: true,
|
267397
|
+
validate(value4) {
|
267398
|
+
try {
|
267399
|
+
validate2(z.string(), value4);
|
267400
|
+
return true;
|
267401
|
+
} catch (error5) {
|
267402
|
+
return "Invalid projectname";
|
267403
|
+
}
|
267404
|
+
}
|
267405
|
+
});
|
267406
|
+
}
|
267407
|
+
|
266575
267408
|
// src/utils/download-extract.ts
|
266576
267409
|
import { mkdir as mkdir5 } from "node:fs/promises";
|
266577
267410
|
|
@@ -266759,7 +267592,7 @@ var basename2 = function(p6, extension) {
|
|
266759
267592
|
return extension && lastSegment.endsWith(extension) ? lastSegment.slice(0, -extension.length) : lastSegment;
|
266760
267593
|
};
|
266761
267594
|
// ../../node_modules/defu/dist/defu.mjs
|
266762
|
-
function
|
267595
|
+
function isPlainObject4(value4) {
|
266763
267596
|
if (value4 === null || typeof value4 !== "object") {
|
266764
267597
|
return false;
|
266765
267598
|
}
|
@@ -266776,27 +267609,27 @@ function isPlainObject3(value4) {
|
|
266776
267609
|
return true;
|
266777
267610
|
}
|
266778
267611
|
function _defu(baseObject, defaults2, namespace = ".", merger) {
|
266779
|
-
if (!
|
267612
|
+
if (!isPlainObject4(defaults2)) {
|
266780
267613
|
return _defu(baseObject, {}, namespace, merger);
|
266781
267614
|
}
|
266782
267615
|
const object = Object.assign({}, defaults2);
|
266783
|
-
for (const
|
266784
|
-
if (
|
267616
|
+
for (const key3 in baseObject) {
|
267617
|
+
if (key3 === "__proto__" || key3 === "constructor") {
|
266785
267618
|
continue;
|
266786
267619
|
}
|
266787
|
-
const value4 = baseObject[
|
267620
|
+
const value4 = baseObject[key3];
|
266788
267621
|
if (value4 === null || value4 === undefined) {
|
266789
267622
|
continue;
|
266790
267623
|
}
|
266791
|
-
if (merger && merger(object,
|
267624
|
+
if (merger && merger(object, key3, value4, namespace)) {
|
266792
267625
|
continue;
|
266793
267626
|
}
|
266794
|
-
if (Array.isArray(value4) && Array.isArray(object[
|
266795
|
-
object[
|
266796
|
-
} else if (
|
266797
|
-
object[
|
267627
|
+
if (Array.isArray(value4) && Array.isArray(object[key3])) {
|
267628
|
+
object[key3] = [...value4, ...object[key3]];
|
267629
|
+
} else if (isPlainObject4(value4) && isPlainObject4(object[key3])) {
|
267630
|
+
object[key3] = _defu(value4, object[key3], (namespace ? `${namespace}.` : "") + key3.toString(), merger);
|
266798
267631
|
} else {
|
266799
|
-
object[
|
267632
|
+
object[key3] = value4;
|
266800
267633
|
}
|
266801
267634
|
}
|
266802
267635
|
return object;
|
@@ -266805,15 +267638,15 @@ function createDefu(merger) {
|
|
266805
267638
|
return (...arguments_4) => arguments_4.reduce((p6, c3) => _defu(p6, c3, "", merger), {});
|
266806
267639
|
}
|
266807
267640
|
var defu = createDefu();
|
266808
|
-
var defuFn = createDefu((object,
|
266809
|
-
if (object[
|
266810
|
-
object[
|
267641
|
+
var defuFn = createDefu((object, key3, currentValue) => {
|
267642
|
+
if (object[key3] !== undefined && typeof currentValue === "function") {
|
267643
|
+
object[key3] = currentValue(object[key3]);
|
266811
267644
|
return true;
|
266812
267645
|
}
|
266813
267646
|
});
|
266814
|
-
var defuArrayFn = createDefu((object,
|
266815
|
-
if (Array.isArray(object[
|
266816
|
-
object[
|
267647
|
+
var defuArrayFn = createDefu((object, key3, currentValue) => {
|
267648
|
+
if (Array.isArray(object[key3]) && typeof currentValue === "function") {
|
267649
|
+
object[key3] = currentValue(object[key3]);
|
266817
267650
|
return true;
|
266818
267651
|
}
|
266819
267652
|
});
|
@@ -269527,11 +270360,11 @@ function cacheDirectory() {
|
|
269527
270360
|
}
|
269528
270361
|
function normalizeHeaders(headers = {}) {
|
269529
270362
|
const normalized = {};
|
269530
|
-
for (const [
|
270363
|
+
for (const [key3, value4] of Object.entries(headers)) {
|
269531
270364
|
if (!value4) {
|
269532
270365
|
continue;
|
269533
270366
|
}
|
269534
|
-
normalized[
|
270367
|
+
normalized[key3.toLowerCase()] = value4;
|
269535
270368
|
}
|
269536
270369
|
return normalized;
|
269537
270370
|
}
|
@@ -269768,7 +270601,11 @@ async function downloadTemplate(input, options = {}) {
|
|
269768
270601
|
var import_proxy2 = __toESM(require_proxy(), 1);
|
269769
270602
|
|
269770
270603
|
// src/utils/download-extract.ts
|
269771
|
-
async function downloadAndExtractNpmPackage(
|
270604
|
+
async function downloadAndExtractNpmPackage({
|
270605
|
+
template,
|
270606
|
+
version,
|
270607
|
+
targetDir
|
270608
|
+
}) {
|
269772
270609
|
await mkdir5(targetDir, { recursive: true });
|
269773
270610
|
const response = await fetch(`https://registry.npmjs.org/${template}`);
|
269774
270611
|
if (!response.ok) {
|
@@ -269776,7 +270613,7 @@ async function downloadAndExtractNpmPackage(template, targetDir) {
|
|
269776
270613
|
}
|
269777
270614
|
const data = await response.json();
|
269778
270615
|
const latestVersion = data["dist-tags"].latest;
|
269779
|
-
const tarball = data.versions[latestVersion].dist.tarball;
|
270616
|
+
const tarball = data.versions[version ?? latestVersion].dist.tarball;
|
269780
270617
|
await downloadTemplate(tarball, {
|
269781
270618
|
dir: targetDir,
|
269782
270619
|
force: true
|
@@ -269785,9 +270622,12 @@ async function downloadAndExtractNpmPackage(template, targetDir) {
|
|
269785
270622
|
|
269786
270623
|
// src/commands/create.ts
|
269787
270624
|
function createCommand2() {
|
269788
|
-
return new Command("create").description("Bootstrap your SettleMint project").option("-n, --project-name <name>", "The name for your SettleMint project").option("-t, --template <template>", "The template for your SettleMint project (run `settlemint platform config` to see available templates)").option("-i, --instance <instance>", "The instance to connect to").action(async ({ projectName, template, instance }) => {
|
270625
|
+
return new Command("create").description("Bootstrap your SettleMint project").option("-n, --project-name <name>", "The name for your SettleMint project").option("-t, --template <template>", "The template for your SettleMint project (run `settlemint platform config` to see available templates)").option("-v, --version <version>", "Specify the template version to use (defaults to latest stable version)").option("-i, --instance <instance>", "The instance to connect to").action(async ({ projectName, template, version, instance }) => {
|
269789
270626
|
intro("Creating a new SettleMint project");
|
269790
270627
|
const env2 = await loadEnv(false, false);
|
270628
|
+
if (version && !template) {
|
270629
|
+
cancel2("The --version option requires the --template option to be set");
|
270630
|
+
}
|
269791
270631
|
const selectedInstance = instance ? sanitizeAndValidateInstanceUrl(instance) : await instancePrompt(env2, true);
|
269792
270632
|
const settlemint = createSettleMintClient({
|
269793
270633
|
instance: selectedInstance,
|
@@ -269806,7 +270646,7 @@ function createCommand2() {
|
|
269806
270646
|
await mkdir6(projectDir, { recursive: true });
|
269807
270647
|
}
|
269808
270648
|
if (!await isEmpty(projectDir)) {
|
269809
|
-
const confirmEmpty = await
|
270649
|
+
const confirmEmpty = await esm_default5({
|
269810
270650
|
message: `The folder ${projectDir} already exists. Do you want to empty it?`,
|
269811
270651
|
default: false
|
269812
270652
|
});
|
@@ -269818,7 +270658,11 @@ function createCommand2() {
|
|
269818
270658
|
await spinner({
|
269819
270659
|
startMessage: "Scaffolding the project",
|
269820
270660
|
task: async () => {
|
269821
|
-
await downloadAndExtractNpmPackage(
|
270661
|
+
await downloadAndExtractNpmPackage({
|
270662
|
+
template: selectedTemplate.npmPackageName,
|
270663
|
+
version,
|
270664
|
+
targetDir: projectDir
|
270665
|
+
});
|
269822
270666
|
await setName(name3, projectDir);
|
269823
270667
|
},
|
269824
270668
|
stopMessage: "Project fully scaffolded"
|
@@ -269836,7 +270680,7 @@ async function personalAccessTokenPrompt(env2, instance, accept) {
|
|
269836
270680
|
return defaultPersonalAccessToken;
|
269837
270681
|
}
|
269838
270682
|
if (existingConfig && defaultPersonalAccessToken) {
|
269839
|
-
const useExisting = await
|
270683
|
+
const useExisting = await esm_default5({
|
269840
270684
|
message: `Do you want to use your existing personal access token for ${instance}?`,
|
269841
270685
|
default: true
|
269842
270686
|
});
|
@@ -269844,7 +270688,7 @@ async function personalAccessTokenPrompt(env2, instance, accept) {
|
|
269844
270688
|
return defaultPersonalAccessToken;
|
269845
270689
|
}
|
269846
270690
|
}
|
269847
|
-
return
|
270691
|
+
return esm_default6({
|
269848
270692
|
message: "What is your personal access token in SettleMint? (format: sm_pat_...)",
|
269849
270693
|
validate(value4) {
|
269850
270694
|
try {
|
@@ -269944,7 +270788,7 @@ function logoutCommand() {
|
|
269944
270788
|
}
|
269945
270789
|
const env2 = await loadEnv(false, false);
|
269946
270790
|
const defaultInstance = env2.SETTLEMINT_INSTANCE;
|
269947
|
-
const instance = await
|
270791
|
+
const instance = await esm_default4({
|
269948
270792
|
message: "Select the instance to logout from:",
|
269949
270793
|
choices: instances.map((instance2) => ({
|
269950
270794
|
value: instance2,
|
@@ -270034,7 +270878,7 @@ function pincodeVerificationResponseCommand() {
|
|
270034
270878
|
return nothingSelectedError("blockchain node");
|
270035
270879
|
}
|
270036
270880
|
}
|
270037
|
-
const pincode = await
|
270881
|
+
const pincode = await esm_default6({
|
270038
270882
|
message: "Enter your pincode",
|
270039
270883
|
validate(value4) {
|
270040
270884
|
if (!value4.trim()) {
|
@@ -270160,7 +271004,7 @@ async function providerPrompt(platformConfig, argument) {
|
|
270160
271004
|
if (possibleProviders.length === 1) {
|
270161
271005
|
return possibleProviders[0];
|
270162
271006
|
}
|
270163
|
-
const provider = await
|
271007
|
+
const provider = await esm_default4({
|
270164
271008
|
message: "Which provider do you want to use?",
|
270165
271009
|
choices: platformConfig.deploymentEngineTargets.map((target) => ({
|
270166
271010
|
name: target.name,
|
@@ -270191,7 +271035,7 @@ async function regionPrompt(provider, argument) {
|
|
270191
271035
|
if (possibleRegions.length === 1) {
|
270192
271036
|
return possibleRegions[0];
|
270193
271037
|
}
|
270194
|
-
const region = await
|
271038
|
+
const region = await esm_default4({
|
270195
271039
|
message: "Which region do you want to use?",
|
270196
271040
|
choices: provider.clusters.map((cluster) => ({
|
270197
271041
|
name: cluster.name,
|
@@ -270679,7 +271523,7 @@ async function blockchainNetworkPrompt({
|
|
270679
271523
|
envKey: "SETTLEMINT_BLOCKCHAIN_NETWORK",
|
270680
271524
|
isRequired,
|
270681
271525
|
defaultHandler: async ({ defaultService: defaultNetwork, choices }) => {
|
270682
|
-
return
|
271526
|
+
return esm_default4({
|
270683
271527
|
message: "Which blockchain network do you want to connect to?",
|
270684
271528
|
choices,
|
270685
271529
|
default: defaultNetwork
|
@@ -271406,7 +272250,7 @@ function createCommand3() {
|
|
271406
272250
|
|
271407
272251
|
// src/prompts/delete-confirmation.prompt.ts
|
271408
272252
|
async function deleteConfirmationPrompt(itemDescription) {
|
271409
|
-
const confirmation = await
|
272253
|
+
const confirmation = await esm_default3({
|
271410
272254
|
message: `Are you sure you want to delete ${itemDescription}? (yes/no)`,
|
271411
272255
|
required: true,
|
271412
272256
|
validate(value4) {
|
@@ -271763,7 +272607,7 @@ function jsonOutput(data) {
|
|
271763
272607
|
var composer = require_composer();
|
271764
272608
|
var Document = require_Document();
|
271765
272609
|
var Schema = require_Schema();
|
271766
|
-
var
|
272610
|
+
var errors3 = require_errors3();
|
271767
272611
|
var Alias = require_Alias();
|
271768
272612
|
var identity2 = require_identity();
|
271769
272613
|
var Pair = require_Pair();
|
@@ -271779,9 +272623,9 @@ var visit2 = require_visit();
|
|
271779
272623
|
var $Composer = composer.Composer;
|
271780
272624
|
var $Document = Document.Document;
|
271781
272625
|
var $Schema = Schema.Schema;
|
271782
|
-
var $YAMLError =
|
271783
|
-
var $YAMLParseError =
|
271784
|
-
var $YAMLWarning =
|
272626
|
+
var $YAMLError = errors3.YAMLError;
|
272627
|
+
var $YAMLParseError = errors3.YAMLParseError;
|
272628
|
+
var $YAMLWarning = errors3.YAMLWarning;
|
271785
272629
|
var $Alias = Alias.Alias;
|
271786
272630
|
var $isAlias = identity2.isAlias;
|
271787
272631
|
var $isCollection = identity2.isCollection;
|
@@ -271834,7 +272678,9 @@ function configCommand() {
|
|
271834
272678
|
})).sort((a8, b4) => a8.name.localeCompare(b4.name)),
|
271835
272679
|
kits: kits.map((kit) => ({
|
271836
272680
|
id: kit.id,
|
271837
|
-
name: kit.name
|
272681
|
+
name: kit.name,
|
272682
|
+
description: kit.description,
|
272683
|
+
npmPackage: kit.npmPackageName
|
271838
272684
|
})).sort((a8, b4) => a8.name.localeCompare(b4.name)),
|
271839
272685
|
deploymentEngineTargets: platformConfig.deploymentEngineTargets.filter((provider) => !provider.disabled).flatMap((provider) => provider.clusters.filter((cluster) => !cluster.disabled).map((region) => ({
|
271840
272686
|
providerId: provider.id,
|
@@ -272127,7 +272973,7 @@ async function getServicesAndMapResults({
|
|
272127
272973
|
const application = await settlemint.application.read(applicationUniqueName);
|
272128
272974
|
const services = await servicesSpinner(settlemint, applicationUniqueName, types2);
|
272129
272975
|
const results = (types2 ?? SERVICE_TYPES).filter((serviceType) => !types2 || types2.includes(serviceType)).map((serviceType) => {
|
272130
|
-
const [_6, labels] = Object.entries(LABELS_MAP).find(([
|
272976
|
+
const [_6, labels] = Object.entries(LABELS_MAP).find(([key3, value4]) => value4.command === serviceType) ?? [
|
272131
272977
|
null,
|
272132
272978
|
{ plural: serviceType }
|
272133
272979
|
];
|
@@ -272275,7 +273121,7 @@ async function useCasePrompt(platformConfig, argument) {
|
|
272275
273121
|
if (selectableUseCases.length === 1) {
|
272276
273122
|
return selectableUseCases[0];
|
272277
273123
|
}
|
272278
|
-
const useCase = await
|
273124
|
+
const useCase = await esm_default4({
|
272279
273125
|
message: "Which use case do you want to use?",
|
272280
273126
|
choices: selectableUseCases.map((useCase2) => ({
|
272281
273127
|
name: formatUseCaseName(useCase2.name),
|
@@ -272325,7 +273171,7 @@ function createCommand4() {
|
|
272325
273171
|
const targetDir = formatTargetDir(name3);
|
272326
273172
|
const projectDir = join10(process.cwd(), targetDir);
|
272327
273173
|
if (await exists3(projectDir) && !await isEmpty(projectDir)) {
|
272328
|
-
const confirmEmpty = await
|
273174
|
+
const confirmEmpty = await esm_default5({
|
272329
273175
|
message: `The folder ${projectDir} already exists. Do you want to delete it?`,
|
272330
273176
|
default: false
|
272331
273177
|
});
|
@@ -272355,11 +273201,11 @@ function createCommand4() {
|
|
272355
273201
|
|
272356
273202
|
// src/utils/commands/passthrough-options.ts
|
272357
273203
|
function mapPassthroughOptions(options, command) {
|
272358
|
-
const optionArgs = Object.entries(options).map(([
|
273204
|
+
const optionArgs = Object.entries(options).map(([key3, value4]) => {
|
272359
273205
|
if (value4 === true) {
|
272360
|
-
return `--${
|
273206
|
+
return `--${key3}`;
|
272361
273207
|
}
|
272362
|
-
return `--${
|
273208
|
+
return `--${key3}=${value4}`;
|
272363
273209
|
});
|
272364
273210
|
return [...optionArgs, ...command.args];
|
272365
273211
|
}
|
@@ -272566,7 +273412,7 @@ async function addressPrompt({
|
|
272566
273412
|
note(`Private key with address '${defaultAddress}' is not activated on the node '${node.uniqueName}'.
|
272567
273413
|
Please select another key or activate this key on the node and try again.`, "warn");
|
272568
273414
|
}
|
272569
|
-
const address = await
|
273415
|
+
const address = await esm_default4({
|
272570
273416
|
message: "Which private key do you want to deploy from?",
|
272571
273417
|
choices: possiblePrivateKeys.map(({ address: address2, name: name3 }) => ({
|
272572
273418
|
name: name3,
|
@@ -272885,17 +273731,6 @@ import { dirname as dirname10 } from "node:path";
|
|
272885
273731
|
import { rm as rm4 } from "node:fs/promises";
|
272886
273732
|
var import_semver = __toESM(require_semver2(), 1);
|
272887
273733
|
|
272888
|
-
// src/utils/subgraph/sanitize-name.ts
|
272889
|
-
var import_slugify = __toESM(require_slugify(), 1);
|
272890
|
-
function sanitizeName(value4, length = 35) {
|
272891
|
-
return import_slugify.default(value4, {
|
272892
|
-
strict: true,
|
272893
|
-
remove: /[!"'()*+.:@~]/g,
|
272894
|
-
replacement: "-",
|
272895
|
-
lower: true
|
272896
|
-
}).slice(0, length).replaceAll(/(^\d*)/g, "").replaceAll(/(-$)/g, "").replaceAll(/(^-)/g, "");
|
272897
|
-
}
|
272898
|
-
|
272899
273734
|
// src/utils/subgraph/subgraph-config.ts
|
272900
273735
|
import { readFile as readFile7, writeFile as writeFile8 } from "node:fs/promises";
|
272901
273736
|
import { basename as basename4, join as join11 } from "node:path";
|
@@ -273077,40 +273912,6 @@ function subgraphCodegenCommand() {
|
|
273077
273912
|
|
273078
273913
|
// src/commands/smart-contract-set/subgraph/deploy.ts
|
273079
273914
|
import { dirname as dirname12 } from "node:path";
|
273080
|
-
|
273081
|
-
// src/prompts/smart-contract-set/subgraph-name.prompt.ts
|
273082
|
-
async function subgraphNamePrompt({
|
273083
|
-
defaultName,
|
273084
|
-
env: env2,
|
273085
|
-
accept,
|
273086
|
-
prod
|
273087
|
-
}) {
|
273088
|
-
const defaultSubgraphName = defaultName ? sanitizeName(defaultName) : undefined;
|
273089
|
-
if (accept) {
|
273090
|
-
if (defaultSubgraphName && env2.SETTLEMINT_THEGRAPH_SUBGRAPH_NAME !== defaultSubgraphName) {
|
273091
|
-
await saveSubgraphName(defaultSubgraphName, env2, prod);
|
273092
|
-
}
|
273093
|
-
return defaultSubgraphName ?? env2.SETTLEMINT_THEGRAPH_SUBGRAPH_NAME;
|
273094
|
-
}
|
273095
|
-
const subgraphName = await esm_default4({
|
273096
|
-
message: "What is the name of your subgraph?",
|
273097
|
-
default: defaultSubgraphName,
|
273098
|
-
required: true
|
273099
|
-
});
|
273100
|
-
const sanitizedSubgraphName = sanitizeName(subgraphName);
|
273101
|
-
if (env2.SETTLEMINT_THEGRAPH_SUBGRAPH_NAME !== sanitizedSubgraphName) {
|
273102
|
-
await saveSubgraphName(sanitizedSubgraphName, env2, prod);
|
273103
|
-
}
|
273104
|
-
return sanitizedSubgraphName;
|
273105
|
-
}
|
273106
|
-
async function saveSubgraphName(sanitizedSubgraphName, env2, prod) {
|
273107
|
-
await writeEnvSpinner(!!prod, {
|
273108
|
-
...env2,
|
273109
|
-
SETTLEMINT_THEGRAPH_SUBGRAPH_NAME: sanitizedSubgraphName
|
273110
|
-
});
|
273111
|
-
}
|
273112
|
-
|
273113
|
-
// src/commands/smart-contract-set/subgraph/deploy.ts
|
273114
273915
|
function subgraphDeployCommand() {
|
273115
273916
|
return new Command("deploy").description("Deploy the subgraph").usage(createExamples([
|
273116
273917
|
{
|
@@ -273156,14 +273957,24 @@ function subgraphDeployCommand() {
|
|
273156
273957
|
cancel2('The "subgraph/subgraph.config.json" config has not been set, ensure all the contracts listed have an address added');
|
273157
273958
|
}
|
273158
273959
|
}
|
273159
|
-
|
273160
|
-
|
273161
|
-
|
273162
|
-
|
273163
|
-
|
273164
|
-
|
273960
|
+
let graphName;
|
273961
|
+
if (!subgraphName) {
|
273962
|
+
const selectedSubgraphs = await subgraphPrompt({
|
273963
|
+
env: env2,
|
273964
|
+
accept: autoAccept,
|
273965
|
+
message: "Which subgraph do you want to deploy to?",
|
273966
|
+
allowNew: true
|
273967
|
+
});
|
273968
|
+
graphName = selectedSubgraphs[0];
|
273969
|
+
} else {
|
273970
|
+
graphName = await subgraphNamePrompt({
|
273971
|
+
defaultName: subgraphName,
|
273972
|
+
env: env2,
|
273973
|
+
accept: autoAccept
|
273974
|
+
});
|
273975
|
+
}
|
273165
273976
|
if (!graphName) {
|
273166
|
-
cancel2("No
|
273977
|
+
cancel2("No subgraph name provided. Please provide a subgraph name to continue.");
|
273167
273978
|
}
|
273168
273979
|
const middlewareAdminUrl = new URL(`/${encodeURIComponent(accessToken)}/admin`, theGraphMiddleware.serviceUrl).toString();
|
273169
273980
|
await executeCommand(command, [...args, "graph", "create", "--node", middlewareAdminUrl, graphName]);
|
@@ -273208,14 +274019,20 @@ function subgraphRemoveCommand() {
|
|
273208
274019
|
description: "Remove a subgraph",
|
273209
274020
|
command: "scs subgraph remove my-subgraph"
|
273210
274021
|
}
|
273211
|
-
])).option("-a, --accept-defaults", "Accept the default and previously set values").option("--prod", "Connect to your production environment").option("-f, --force", "Force remove the subgraph without confirmation").argument("
|
274022
|
+
])).option("-a, --accept-defaults", "Accept the default and previously set values").option("--prod", "Connect to your production environment").option("-f, --force", "Force remove the subgraph without confirmation").argument("[subgraph-name]", "The name of the subgraph to remove (defaults to value in .env if not provided)").action(async (subgraphName, { prod, acceptDefaults, force }) => {
|
273212
274023
|
intro("Removing subgraph");
|
273213
274024
|
await validateIfRequiredPackagesAreInstalled(["@graphprotocol/graph-cli"]);
|
273214
|
-
if (!force) {
|
273215
|
-
await deleteConfirmationPrompt(`the subgraph ${subgraphName}`);
|
273216
|
-
}
|
273217
274025
|
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
273218
274026
|
const env2 = await loadEnv(false, !!prod);
|
274027
|
+
const selectedSubgraphs = subgraphName ? [subgraphName] : await subgraphPrompt({
|
274028
|
+
env: env2,
|
274029
|
+
accept: autoAccept,
|
274030
|
+
message: "Which subgraph do you want to remove?"
|
274031
|
+
});
|
274032
|
+
const graphName = selectedSubgraphs[0];
|
274033
|
+
if (!force) {
|
274034
|
+
await deleteConfirmationPrompt(`the subgraph ${graphName}`);
|
274035
|
+
}
|
273219
274036
|
const instance = await instancePrompt(env2, true);
|
273220
274037
|
const accessToken = await getApplicationOrPersonalAccessToken({
|
273221
274038
|
env: env2,
|
@@ -273233,19 +274050,30 @@ function subgraphRemoveCommand() {
|
|
273233
274050
|
const cwd2 = dirname13(subgraphYamlFile);
|
273234
274051
|
const { command, args } = await getPackageManagerExecutable();
|
273235
274052
|
const middlewareAdminUrl = new URL(`/${encodeURIComponent(accessToken)}/admin`, theGraphMiddleware.serviceUrl).toString();
|
273236
|
-
await executeCommand(command, [...args, "graph", "remove", "--node", middlewareAdminUrl,
|
274053
|
+
await executeCommand(command, [...args, "graph", "remove", "--node", middlewareAdminUrl, graphName]);
|
273237
274054
|
const settlemintClient = createSettleMintClient({
|
273238
274055
|
accessToken,
|
273239
274056
|
instance
|
273240
274057
|
});
|
273241
|
-
const
|
273242
|
-
|
274058
|
+
const graphEndpoints = await spinner({
|
274059
|
+
startMessage: "Waiting for subgraph to be removed",
|
274060
|
+
task: () => retryWhenFailed2(async () => {
|
274061
|
+
const middleware = await settlemintClient.middleware.read(theGraphMiddleware.uniqueName);
|
274062
|
+
const endpoints = await getGraphEndpoint(settlemintClient, middleware);
|
274063
|
+
if (endpoints.SETTLEMINT_THEGRAPH_SUBGRAPHS_ENDPOINTS?.some((endpoint) => endpoint.endsWith(graphName))) {
|
274064
|
+
throw new Error(`Subgraph '${graphName}' not removed from middleware '${theGraphMiddleware.uniqueName}'`);
|
274065
|
+
}
|
274066
|
+
return endpoints;
|
274067
|
+
}, 5, 5000),
|
274068
|
+
stopMessage: "Waiting finished"
|
274069
|
+
});
|
273243
274070
|
await writeEnvSpinner(!!prod, {
|
273244
274071
|
...env2,
|
273245
274072
|
SETTLEMINT_THEGRAPH: theGraphMiddleware.uniqueName,
|
274073
|
+
SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH: env2.SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH === graphName ? undefined : env2.SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH,
|
273246
274074
|
...graphEndpoints
|
273247
274075
|
});
|
273248
|
-
outro(`Subgraph ${
|
274076
|
+
outro(`Subgraph ${graphName} removed successfully`);
|
273249
274077
|
});
|
273250
274078
|
}
|
273251
274079
|
|
@@ -273388,4 +274216,4 @@ async function sdkCliCommand(argv = process.argv) {
|
|
273388
274216
|
// src/cli.ts
|
273389
274217
|
sdkCliCommand();
|
273390
274218
|
|
273391
|
-
//# debugId=
|
274219
|
+
//# debugId=797306128A6BE57D64756E2164756E21
|