@settlemint/sdk-cli 1.1.14-mainab85d0ef → 1.1.14-pr5e4942f2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +295 -223
- package/dist/cli.js.map +16 -16
- package/package.json +3 -3
package/dist/cli.js
CHANGED
@@ -235434,6 +235434,57 @@ ${whileRunning(e10)}`;
|
|
235434
235434
|
}, qe);
|
235435
235435
|
});
|
235436
235436
|
|
235437
|
+
// ../../node_modules/slugify/slugify.js
|
235438
|
+
var require_slugify = __commonJS((exports, module) => {
|
235439
|
+
(function(name2, root, factory) {
|
235440
|
+
if (typeof exports === "object") {
|
235441
|
+
module.exports = factory();
|
235442
|
+
module.exports["default"] = factory();
|
235443
|
+
} else if (typeof define === "function" && define.amd) {
|
235444
|
+
define(factory);
|
235445
|
+
} else {
|
235446
|
+
root[name2] = factory();
|
235447
|
+
}
|
235448
|
+
})("slugify", exports, function() {
|
235449
|
+
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"}');
|
235450
|
+
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"}}');
|
235451
|
+
function replace(string, options) {
|
235452
|
+
if (typeof string !== "string") {
|
235453
|
+
throw new Error("slugify: string argument expected");
|
235454
|
+
}
|
235455
|
+
options = typeof options === "string" ? { replacement: options } : options || {};
|
235456
|
+
var locale = locales[options.locale] || {};
|
235457
|
+
var replacement = options.replacement === undefined ? "-" : options.replacement;
|
235458
|
+
var trim = options.trim === undefined ? true : options.trim;
|
235459
|
+
var slug = string.normalize().split("").reduce(function(result, ch) {
|
235460
|
+
var appendChar = locale[ch];
|
235461
|
+
if (appendChar === undefined)
|
235462
|
+
appendChar = charMap[ch];
|
235463
|
+
if (appendChar === undefined)
|
235464
|
+
appendChar = ch;
|
235465
|
+
if (appendChar === replacement)
|
235466
|
+
appendChar = " ";
|
235467
|
+
return result + appendChar.replace(options.remove || /[^\w\s$*_+~.()'"!\-:@]+/g, "");
|
235468
|
+
}, "");
|
235469
|
+
if (options.strict) {
|
235470
|
+
slug = slug.replace(/[^A-Za-z0-9\s]/g, "");
|
235471
|
+
}
|
235472
|
+
if (trim) {
|
235473
|
+
slug = slug.trim();
|
235474
|
+
}
|
235475
|
+
slug = slug.replace(/\s+/g, replacement);
|
235476
|
+
if (options.lower) {
|
235477
|
+
slug = slug.toLowerCase();
|
235478
|
+
}
|
235479
|
+
return slug;
|
235480
|
+
}
|
235481
|
+
replace.extend = function(customMap) {
|
235482
|
+
Object.assign(charMap, customMap);
|
235483
|
+
};
|
235484
|
+
return replace;
|
235485
|
+
});
|
235486
|
+
});
|
235487
|
+
|
235437
235488
|
// ../../node_modules/node-fetch-native/dist/shared/node-fetch-native.DhEqb06g.cjs
|
235438
235489
|
var require_node_fetch_native_DhEqb06g = __commonJS((exports) => {
|
235439
235490
|
var l3 = Object.defineProperty;
|
@@ -256624,57 +256675,6 @@ var require_public_api = __commonJS((exports) => {
|
|
256624
256675
|
exports.stringify = stringify3;
|
256625
256676
|
});
|
256626
256677
|
|
256627
|
-
// ../../node_modules/slugify/slugify.js
|
256628
|
-
var require_slugify = __commonJS((exports, module) => {
|
256629
|
-
(function(name2, root, factory) {
|
256630
|
-
if (typeof exports === "object") {
|
256631
|
-
module.exports = factory();
|
256632
|
-
module.exports["default"] = factory();
|
256633
|
-
} else if (typeof define === "function" && define.amd) {
|
256634
|
-
define(factory);
|
256635
|
-
} else {
|
256636
|
-
root[name2] = factory();
|
256637
|
-
}
|
256638
|
-
})("slugify", exports, function() {
|
256639
|
-
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"}');
|
256640
|
-
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"}}');
|
256641
|
-
function replace(string, options) {
|
256642
|
-
if (typeof string !== "string") {
|
256643
|
-
throw new Error("slugify: string argument expected");
|
256644
|
-
}
|
256645
|
-
options = typeof options === "string" ? { replacement: options } : options || {};
|
256646
|
-
var locale = locales[options.locale] || {};
|
256647
|
-
var replacement = options.replacement === undefined ? "-" : options.replacement;
|
256648
|
-
var trim = options.trim === undefined ? true : options.trim;
|
256649
|
-
var slug = string.normalize().split("").reduce(function(result, ch) {
|
256650
|
-
var appendChar = locale[ch];
|
256651
|
-
if (appendChar === undefined)
|
256652
|
-
appendChar = charMap[ch];
|
256653
|
-
if (appendChar === undefined)
|
256654
|
-
appendChar = ch;
|
256655
|
-
if (appendChar === replacement)
|
256656
|
-
appendChar = " ";
|
256657
|
-
return result + appendChar.replace(options.remove || /[^\w\s$*_+~.()'"!\-:@]+/g, "");
|
256658
|
-
}, "");
|
256659
|
-
if (options.strict) {
|
256660
|
-
slug = slug.replace(/[^A-Za-z0-9\s]/g, "");
|
256661
|
-
}
|
256662
|
-
if (trim) {
|
256663
|
-
slug = slug.trim();
|
256664
|
-
}
|
256665
|
-
slug = slug.replace(/\s+/g, replacement);
|
256666
|
-
if (options.lower) {
|
256667
|
-
slug = slug.toLowerCase();
|
256668
|
-
}
|
256669
|
-
return slug;
|
256670
|
-
}
|
256671
|
-
replace.extend = function(customMap) {
|
256672
|
-
Object.assign(charMap, customMap);
|
256673
|
-
};
|
256674
|
-
return replace;
|
256675
|
-
});
|
256676
|
-
});
|
256677
|
-
|
256678
256678
|
// ../utils/dist/environment.mjs
|
256679
256679
|
import { join } from "node:path";
|
256680
256680
|
|
@@ -266812,7 +266812,7 @@ var DotEnvSchema = z.object({
|
|
266812
266812
|
SETTLEMINT_HASURA_DATABASE_URL: z.string().optional(),
|
266813
266813
|
SETTLEMINT_THEGRAPH: UniqueNameSchema.optional(),
|
266814
266814
|
SETTLEMINT_THEGRAPH_SUBGRAPHS_ENDPOINTS: z.preprocess((value) => tryParseJson(value, []), z.array(UrlSchema).optional()),
|
266815
|
-
|
266815
|
+
SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH: z.string().optional(),
|
266816
266816
|
SETTLEMINT_PORTAL: UniqueNameSchema.optional(),
|
266817
266817
|
SETTLEMINT_PORTAL_GRAPHQL_ENDPOINT: UrlSchema.optional(),
|
266818
266818
|
SETTLEMINT_PORTAL_REST_ENDPOINT: UrlSchema.optional(),
|
@@ -266997,7 +266997,7 @@ function pruneCurrentEnv(currentEnv, env2) {
|
|
266997
266997
|
var package_default = {
|
266998
266998
|
name: "@settlemint/sdk-cli",
|
266999
266999
|
description: "Command-line interface for SettleMint SDK, providing development tools and project management capabilities",
|
267000
|
-
version: "1.1.14-
|
267000
|
+
version: "1.1.14-pr5e4942f2",
|
267001
267001
|
type: "module",
|
267002
267002
|
private: false,
|
267003
267003
|
license: "FSL-1.1-MIT",
|
@@ -267045,8 +267045,8 @@ var package_default = {
|
|
267045
267045
|
"@inquirer/input": "4.1.6",
|
267046
267046
|
"@inquirer/password": "4.0.9",
|
267047
267047
|
"@inquirer/select": "4.0.9",
|
267048
|
-
"@settlemint/sdk-js": "1.1.14-
|
267049
|
-
"@settlemint/sdk-utils": "1.1.14-
|
267048
|
+
"@settlemint/sdk-js": "1.1.14-pr5e4942f2",
|
267049
|
+
"@settlemint/sdk-utils": "1.1.14-pr5e4942f2",
|
267050
267050
|
"@types/node": "22.13.9",
|
267051
267051
|
"@types/semver": "7.5.8",
|
267052
267052
|
"@types/which": "3.0.4",
|
@@ -268475,7 +268475,7 @@ var DotEnvSchema2 = z.object({
|
|
268475
268475
|
SETTLEMINT_HASURA_DATABASE_URL: z.string().optional(),
|
268476
268476
|
SETTLEMINT_THEGRAPH: UniqueNameSchema2.optional(),
|
268477
268477
|
SETTLEMINT_THEGRAPH_SUBGRAPHS_ENDPOINTS: z.preprocess((value) => tryParseJson2(value, []), z.array(UrlSchema2).optional()),
|
268478
|
-
|
268478
|
+
SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH: z.string().optional(),
|
268479
268479
|
SETTLEMINT_PORTAL: UniqueNameSchema2.optional(),
|
268480
268480
|
SETTLEMINT_PORTAL_GRAPHQL_ENDPOINT: UrlSchema2.optional(),
|
268481
268481
|
SETTLEMINT_PORTAL_REST_ENDPOINT: UrlSchema2.optional(),
|
@@ -271308,6 +271308,21 @@ export const { client: ${graphqlClientVariable}, graphql: ${graphqlVariable} } =
|
|
271308
271308
|
});`
|
271309
271309
|
]);
|
271310
271310
|
}
|
271311
|
+
if (env2.SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH) {
|
271312
|
+
const isDefaulSubgraphGenerated = toGenerate.some((gqlEndpoint) => {
|
271313
|
+
const name2 = gqlEndpoint.split("/").pop();
|
271314
|
+
return name2 === env2.SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH;
|
271315
|
+
});
|
271316
|
+
if (isDefaulSubgraphGenerated) {
|
271317
|
+
const nameSuffix = capitalizeFirstLetter2(env2.SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH);
|
271318
|
+
const graphqlClientVariable = getVariableName(`theGraphClient${nameSuffix}`);
|
271319
|
+
const graphqlVariable = getVariableName(`theGraphGraphql${nameSuffix}`);
|
271320
|
+
template.push(`
|
271321
|
+
export const theGraphClient = ${graphqlClientVariable};
|
271322
|
+
export const theGraphGraphql = ${graphqlVariable};
|
271323
|
+
`);
|
271324
|
+
}
|
271325
|
+
}
|
271311
271326
|
await writeTemplate(template.join(`
|
271312
271327
|
`), "/lib/settlemint", "the-graph.ts");
|
271313
271328
|
const projectDir = await projectRoot3();
|
@@ -272366,6 +272381,101 @@ async function codegenTsconfig(env2, thegraphSubgraphNames) {
|
|
272366
272381
|
};
|
272367
272382
|
}
|
272368
272383
|
|
272384
|
+
// src/utils/subgraph/sanitize-name.ts
|
272385
|
+
var import_slugify = __toESM(require_slugify(), 1);
|
272386
|
+
function sanitizeName(value4, length = 35) {
|
272387
|
+
return import_slugify.default(value4, {
|
272388
|
+
strict: true,
|
272389
|
+
remove: /[!"'()*+.:@~]/g,
|
272390
|
+
replacement: "-",
|
272391
|
+
lower: true
|
272392
|
+
}).slice(0, length).replaceAll(/(^\d*)/g, "").replaceAll(/(-$)/g, "").replaceAll(/(^-)/g, "");
|
272393
|
+
}
|
272394
|
+
|
272395
|
+
// ../../node_modules/@inquirer/input/dist/esm/index.js
|
272396
|
+
var inputTheme = {
|
272397
|
+
validationFailureMode: "keep"
|
272398
|
+
};
|
272399
|
+
var esm_default2 = createPrompt((config3, done) => {
|
272400
|
+
const { required, validate: validate3 = () => true } = config3;
|
272401
|
+
const theme = makeTheme(inputTheme, config3.theme);
|
272402
|
+
const [status, setStatus] = useState("idle");
|
272403
|
+
const [defaultValue = "", setDefaultValue] = useState(config3.default);
|
272404
|
+
const [errorMsg, setError] = useState();
|
272405
|
+
const [value4, setValue] = useState("");
|
272406
|
+
const prefix = usePrefix({ status, theme });
|
272407
|
+
useKeypress(async (key2, rl) => {
|
272408
|
+
if (status !== "idle") {
|
272409
|
+
return;
|
272410
|
+
}
|
272411
|
+
if (isEnterKey(key2)) {
|
272412
|
+
const answer = value4 || defaultValue;
|
272413
|
+
setStatus("loading");
|
272414
|
+
const isValid2 = required && !answer ? "You must provide a value" : await validate3(answer);
|
272415
|
+
if (isValid2 === true) {
|
272416
|
+
setValue(answer);
|
272417
|
+
setStatus("done");
|
272418
|
+
done(answer);
|
272419
|
+
} else {
|
272420
|
+
if (theme.validationFailureMode === "clear") {
|
272421
|
+
setValue("");
|
272422
|
+
} else {
|
272423
|
+
rl.write(value4);
|
272424
|
+
}
|
272425
|
+
setError(isValid2 || "You must provide a valid value");
|
272426
|
+
setStatus("idle");
|
272427
|
+
}
|
272428
|
+
} else if (isBackspaceKey(key2) && !value4) {
|
272429
|
+
setDefaultValue(undefined);
|
272430
|
+
} else if (key2.name === "tab" && !value4) {
|
272431
|
+
setDefaultValue(undefined);
|
272432
|
+
rl.clearLine(0);
|
272433
|
+
rl.write(defaultValue);
|
272434
|
+
setValue(defaultValue);
|
272435
|
+
} else {
|
272436
|
+
setValue(rl.line);
|
272437
|
+
setError(undefined);
|
272438
|
+
}
|
272439
|
+
});
|
272440
|
+
const message = theme.style.message(config3.message, status);
|
272441
|
+
let formattedValue = value4;
|
272442
|
+
if (typeof config3.transformer === "function") {
|
272443
|
+
formattedValue = config3.transformer(value4, { isFinal: status === "done" });
|
272444
|
+
} else if (status === "done") {
|
272445
|
+
formattedValue = theme.style.answer(value4);
|
272446
|
+
}
|
272447
|
+
let defaultStr;
|
272448
|
+
if (defaultValue && status !== "done" && !value4) {
|
272449
|
+
defaultStr = theme.style.defaultAnswer(defaultValue);
|
272450
|
+
}
|
272451
|
+
let error5 = "";
|
272452
|
+
if (errorMsg) {
|
272453
|
+
error5 = theme.style.error(errorMsg);
|
272454
|
+
}
|
272455
|
+
return [
|
272456
|
+
[prefix, message, defaultStr, formattedValue].filter((v7) => v7 !== undefined).join(" "),
|
272457
|
+
error5
|
272458
|
+
];
|
272459
|
+
});
|
272460
|
+
|
272461
|
+
// src/prompts/smart-contract-set/subgraph-name.prompt.ts
|
272462
|
+
async function subgraphNamePrompt({
|
272463
|
+
defaultName,
|
272464
|
+
env: env2,
|
272465
|
+
accept
|
272466
|
+
}) {
|
272467
|
+
const defaultSubgraphName = defaultName ? sanitizeName(defaultName) : undefined;
|
272468
|
+
if (accept) {
|
272469
|
+
return defaultSubgraphName ?? env2.SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH;
|
272470
|
+
}
|
272471
|
+
const subgraphName = await esm_default2({
|
272472
|
+
message: "What is the name of your subgraph?",
|
272473
|
+
default: defaultSubgraphName,
|
272474
|
+
required: true
|
272475
|
+
});
|
272476
|
+
return sanitizeName(subgraphName);
|
272477
|
+
}
|
272478
|
+
|
272369
272479
|
// ../../node_modules/@inquirer/select/dist/esm/index.js
|
272370
272480
|
var import_yoctocolors_cjs3 = __toESM(require_yoctocolors_cjs(), 1);
|
272371
272481
|
var import_ansi_escapes2 = __toESM(require_ansi_escapes(), 1);
|
@@ -272402,7 +272512,7 @@ function normalizeChoices(choices) {
|
|
272402
272512
|
};
|
272403
272513
|
});
|
272404
272514
|
}
|
272405
|
-
var
|
272515
|
+
var esm_default3 = createPrompt((config3, done) => {
|
272406
272516
|
const { loop = true, pageSize = 7 } = config3;
|
272407
272517
|
const firstRender = useRef(true);
|
272408
272518
|
const theme = makeTheme(selectTheme, config3.theme);
|
@@ -272508,11 +272618,19 @@ ${page}${helpTipBottom}${choiceDescription}${import_ansi_escapes2.default.cursor
|
|
272508
272618
|
|
272509
272619
|
// src/prompts/smart-contract-set/subgraph.prompt.ts
|
272510
272620
|
var ALL = "All";
|
272511
|
-
|
272512
|
-
|
272621
|
+
var NEW = "New subgraph";
|
272622
|
+
async function subgraphPrompt({
|
272623
|
+
env: env2,
|
272624
|
+
accept,
|
272625
|
+
message,
|
272626
|
+
allowAll = false,
|
272627
|
+
allowNew = false,
|
272628
|
+
isCi = is_in_ci_default
|
272629
|
+
}) {
|
272630
|
+
const autoAccept = isCi || !!accept;
|
272513
272631
|
const subgraphNames = env2.SETTLEMINT_THEGRAPH_SUBGRAPHS_ENDPOINTS?.map((endpoint) => endpoint.split("/").pop()).filter(Boolean) ?? [];
|
272514
272632
|
if (autoAccept) {
|
272515
|
-
return subgraphNames;
|
272633
|
+
return allowAll ? subgraphNames : env2.SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH ? [env2.SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH] : [];
|
272516
272634
|
}
|
272517
272635
|
if (subgraphNames.length === 0) {
|
272518
272636
|
cancel2("No subgraphs found");
|
@@ -272520,17 +272638,43 @@ async function subgraphPrompt(env2, accept) {
|
|
272520
272638
|
if (subgraphNames.length === 1) {
|
272521
272639
|
return subgraphNames;
|
272522
272640
|
}
|
272523
|
-
const
|
272524
|
-
|
272525
|
-
choices
|
272641
|
+
const choices = subgraphNames.slice();
|
272642
|
+
if (allowAll) {
|
272643
|
+
choices.unshift(ALL);
|
272644
|
+
}
|
272645
|
+
if (allowNew) {
|
272646
|
+
choices.unshift(NEW);
|
272647
|
+
}
|
272648
|
+
let defaultChoice;
|
272649
|
+
if (allowAll) {
|
272650
|
+
defaultChoice = ALL;
|
272651
|
+
} else if (allowNew) {
|
272652
|
+
defaultChoice = env2.SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH ?? NEW;
|
272653
|
+
} else {
|
272654
|
+
defaultChoice = env2.SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH ?? subgraphNames[0];
|
272655
|
+
}
|
272656
|
+
const subgraphName = await esm_default3({
|
272657
|
+
message,
|
272658
|
+
choices: choices.map((name2) => ({
|
272526
272659
|
name: name2,
|
272527
272660
|
value: name2
|
272528
272661
|
})),
|
272529
|
-
default:
|
272662
|
+
default: defaultChoice
|
272530
272663
|
});
|
272531
272664
|
if (!subgraphName) {
|
272532
272665
|
cancel2("No subgraph selected");
|
272533
272666
|
}
|
272667
|
+
if (subgraphName === NEW) {
|
272668
|
+
const newSubgraphName = await subgraphNamePrompt({
|
272669
|
+
defaultName: "",
|
272670
|
+
env: env2,
|
272671
|
+
accept: autoAccept
|
272672
|
+
});
|
272673
|
+
if (!newSubgraphName) {
|
272674
|
+
return [];
|
272675
|
+
}
|
272676
|
+
return [newSubgraphName];
|
272677
|
+
}
|
272534
272678
|
return subgraphName === ALL ? subgraphNames : [subgraphName];
|
272535
272679
|
}
|
272536
272680
|
|
@@ -272791,7 +272935,12 @@ function codegenCommand() {
|
|
272791
272935
|
intro("Generating GraphQL types and queries for your dApp");
|
272792
272936
|
const env2 = await loadEnv(true, !!prod);
|
272793
272937
|
if (!Array.isArray(thegraphSubgraphNames)) {
|
272794
|
-
thegraphSubgraphNames = await subgraphPrompt(
|
272938
|
+
thegraphSubgraphNames = await subgraphPrompt({
|
272939
|
+
env: env2,
|
272940
|
+
accept: true,
|
272941
|
+
message: "Which The Graph subgraph do you want to generate types for?",
|
272942
|
+
allowAll: true
|
272943
|
+
});
|
272795
272944
|
}
|
272796
272945
|
const { hasura, portal, thegraph, blockscout } = await spinner({
|
272797
272946
|
startMessage: "Testing configured GraphQL schema",
|
@@ -272846,7 +272995,7 @@ function getBooleanValue(value4, defaultValue) {
|
|
272846
272995
|
function boolToString(value4) {
|
272847
272996
|
return value4 ? "Yes" : "No";
|
272848
272997
|
}
|
272849
|
-
var
|
272998
|
+
var esm_default4 = createPrompt((config3, done) => {
|
272850
272999
|
const { transformer = boolToString } = config3;
|
272851
273000
|
const [status, setStatus] = useState("idle");
|
272852
273001
|
const [value4, setValue] = useState("");
|
@@ -272878,72 +273027,6 @@ var esm_default3 = createPrompt((config3, done) => {
|
|
272878
273027
|
return `${prefix} ${message}${defaultValue} ${formattedValue}`;
|
272879
273028
|
});
|
272880
273029
|
|
272881
|
-
// ../../node_modules/@inquirer/input/dist/esm/index.js
|
272882
|
-
var inputTheme = {
|
272883
|
-
validationFailureMode: "keep"
|
272884
|
-
};
|
272885
|
-
var esm_default4 = createPrompt((config3, done) => {
|
272886
|
-
const { required, validate: validate3 = () => true } = config3;
|
272887
|
-
const theme = makeTheme(inputTheme, config3.theme);
|
272888
|
-
const [status, setStatus] = useState("idle");
|
272889
|
-
const [defaultValue = "", setDefaultValue] = useState(config3.default);
|
272890
|
-
const [errorMsg, setError] = useState();
|
272891
|
-
const [value4, setValue] = useState("");
|
272892
|
-
const prefix = usePrefix({ status, theme });
|
272893
|
-
useKeypress(async (key2, rl) => {
|
272894
|
-
if (status !== "idle") {
|
272895
|
-
return;
|
272896
|
-
}
|
272897
|
-
if (isEnterKey(key2)) {
|
272898
|
-
const answer = value4 || defaultValue;
|
272899
|
-
setStatus("loading");
|
272900
|
-
const isValid2 = required && !answer ? "You must provide a value" : await validate3(answer);
|
272901
|
-
if (isValid2 === true) {
|
272902
|
-
setValue(answer);
|
272903
|
-
setStatus("done");
|
272904
|
-
done(answer);
|
272905
|
-
} else {
|
272906
|
-
if (theme.validationFailureMode === "clear") {
|
272907
|
-
setValue("");
|
272908
|
-
} else {
|
272909
|
-
rl.write(value4);
|
272910
|
-
}
|
272911
|
-
setError(isValid2 || "You must provide a valid value");
|
272912
|
-
setStatus("idle");
|
272913
|
-
}
|
272914
|
-
} else if (isBackspaceKey(key2) && !value4) {
|
272915
|
-
setDefaultValue(undefined);
|
272916
|
-
} else if (key2.name === "tab" && !value4) {
|
272917
|
-
setDefaultValue(undefined);
|
272918
|
-
rl.clearLine(0);
|
272919
|
-
rl.write(defaultValue);
|
272920
|
-
setValue(defaultValue);
|
272921
|
-
} else {
|
272922
|
-
setValue(rl.line);
|
272923
|
-
setError(undefined);
|
272924
|
-
}
|
272925
|
-
});
|
272926
|
-
const message = theme.style.message(config3.message, status);
|
272927
|
-
let formattedValue = value4;
|
272928
|
-
if (typeof config3.transformer === "function") {
|
272929
|
-
formattedValue = config3.transformer(value4, { isFinal: status === "done" });
|
272930
|
-
} else if (status === "done") {
|
272931
|
-
formattedValue = theme.style.answer(value4);
|
272932
|
-
}
|
272933
|
-
let defaultStr;
|
272934
|
-
if (defaultValue && status !== "done" && !value4) {
|
272935
|
-
defaultStr = theme.style.defaultAnswer(defaultValue);
|
272936
|
-
}
|
272937
|
-
let error5 = "";
|
272938
|
-
if (errorMsg) {
|
272939
|
-
error5 = theme.style.error(errorMsg);
|
272940
|
-
}
|
272941
|
-
return [
|
272942
|
-
[prefix, message, defaultStr, formattedValue].filter((v7) => v7 !== undefined).join(" "),
|
272943
|
-
error5
|
272944
|
-
];
|
272945
|
-
});
|
272946
|
-
|
272947
273030
|
// ../../node_modules/@inquirer/password/dist/esm/index.js
|
272948
273031
|
var import_ansi_escapes3 = __toESM(require_ansi_escapes(), 1);
|
272949
273032
|
var esm_default5 = createPrompt((config3, done) => {
|
@@ -273004,7 +273087,7 @@ async function applicationAccessTokenPrompt(env2, application, settlemint, accep
|
|
273004
273087
|
return defaultAccessToken;
|
273005
273088
|
}
|
273006
273089
|
if (defaultAccessToken) {
|
273007
|
-
const keep = await
|
273090
|
+
const keep = await esm_default4({
|
273008
273091
|
message: "Do you want to use the existing application access token?",
|
273009
273092
|
default: true
|
273010
273093
|
});
|
@@ -273012,12 +273095,12 @@ async function applicationAccessTokenPrompt(env2, application, settlemint, accep
|
|
273012
273095
|
return defaultAccessToken;
|
273013
273096
|
}
|
273014
273097
|
}
|
273015
|
-
const create2 = await
|
273098
|
+
const create2 = await esm_default4({
|
273016
273099
|
message: "Do you want to create a new application access token?",
|
273017
273100
|
default: false
|
273018
273101
|
});
|
273019
273102
|
if (create2) {
|
273020
|
-
const name2 = await
|
273103
|
+
const name2 = await esm_default2({
|
273021
273104
|
message: "How would you like to name this application access token?",
|
273022
273105
|
default: `SettleMint CLI (${Date.now()}${process.env.USER ? ` ${process.env.USER}` : ""})`,
|
273023
273106
|
required: true,
|
@@ -273113,7 +273196,7 @@ async function applicationPrompt(env2, applications, accept) {
|
|
273113
273196
|
if (is_in_ci_default) {
|
273114
273197
|
nothingSelectedError("application");
|
273115
273198
|
}
|
273116
|
-
const application = await
|
273199
|
+
const application = await esm_default3({
|
273117
273200
|
message: "Which application do you want to connect to?",
|
273118
273201
|
choices: applications.map((applications2) => ({
|
273119
273202
|
name: `${applications2.name} (${applications2.uniqueName})`,
|
@@ -273186,7 +273269,7 @@ async function blockchainNodePrompt({
|
|
273186
273269
|
isRequired,
|
273187
273270
|
defaultHandler: async ({ defaultService: defaultNode, choices }) => {
|
273188
273271
|
const filteredChoices = filterRunningOnly ? choices.filter(({ value: node }) => node === undefined || node?.status === "COMPLETED") : choices;
|
273189
|
-
return
|
273272
|
+
return esm_default3({
|
273190
273273
|
message: promptMessage ?? "Which blockchain node do you want to connect to?",
|
273191
273274
|
choices: filteredChoices,
|
273192
273275
|
default: defaultNode
|
@@ -273211,7 +273294,7 @@ async function blockscoutPrompt({
|
|
273211
273294
|
envKey: "SETTLEMINT_BLOCKSCOUT",
|
273212
273295
|
isRequired,
|
273213
273296
|
defaultHandler: async ({ defaultService: defaultBlockscout, choices }) => {
|
273214
|
-
return
|
273297
|
+
return esm_default3({
|
273215
273298
|
message: "Which blockscout instance do you want to connect to?",
|
273216
273299
|
choices,
|
273217
273300
|
default: defaultBlockscout
|
@@ -273234,7 +273317,7 @@ async function customDeploymentPrompt({
|
|
273234
273317
|
envKey: "SETTLEMINT_CUSTOM_DEPLOYMENT",
|
273235
273318
|
isRequired,
|
273236
273319
|
defaultHandler: async ({ defaultService: defaultCustomDeployment, choices }) => {
|
273237
|
-
return
|
273320
|
+
return esm_default3({
|
273238
273321
|
message: "Which Custom Deployment do you want to connect to?",
|
273239
273322
|
choices,
|
273240
273323
|
default: defaultCustomDeployment
|
@@ -273258,7 +273341,7 @@ async function hasuraPrompt({
|
|
273258
273341
|
envKey: "SETTLEMINT_HASURA",
|
273259
273342
|
isRequired,
|
273260
273343
|
defaultHandler: async ({ defaultService: defaultHasura, choices }) => {
|
273261
|
-
return
|
273344
|
+
return esm_default3({
|
273262
273345
|
message: "Which Hasura instance do you want to connect to?",
|
273263
273346
|
choices,
|
273264
273347
|
default: defaultHasura
|
@@ -273282,7 +273365,7 @@ async function hdPrivateKeyPrompt({
|
|
273282
273365
|
envKey: "SETTLEMINT_HD_PRIVATE_KEY",
|
273283
273366
|
isRequired,
|
273284
273367
|
defaultHandler: async ({ defaultService: defaultPrivateKey, choices }) => {
|
273285
|
-
return
|
273368
|
+
return esm_default3({
|
273286
273369
|
message: "Which HD Private Key do you want to use?",
|
273287
273370
|
choices,
|
273288
273371
|
default: defaultPrivateKey
|
@@ -273306,7 +273389,7 @@ async function ipfsPrompt({
|
|
273306
273389
|
envKey: "SETTLEMINT_IPFS",
|
273307
273390
|
isRequired,
|
273308
273391
|
defaultHandler: async ({ defaultService: defaultStorage, choices }) => {
|
273309
|
-
return
|
273392
|
+
return esm_default3({
|
273310
273393
|
message: "Which IPFS instance do you want to connect to?",
|
273311
273394
|
choices,
|
273312
273395
|
default: defaultStorage
|
@@ -273330,7 +273413,7 @@ async function minioPrompt({
|
|
273330
273413
|
envKey: "SETTLEMINT_MINIO",
|
273331
273414
|
isRequired,
|
273332
273415
|
defaultHandler: async ({ defaultService: defaultStorage, choices }) => {
|
273333
|
-
return
|
273416
|
+
return esm_default3({
|
273334
273417
|
message: "Which MinIO instance do you want to connect to?",
|
273335
273418
|
choices,
|
273336
273419
|
default: defaultStorage
|
@@ -273354,7 +273437,7 @@ async function portalPrompt({
|
|
273354
273437
|
envKey: "SETTLEMINT_PORTAL",
|
273355
273438
|
isRequired,
|
273356
273439
|
defaultHandler: async ({ defaultService: defaultMiddleware, choices }) => {
|
273357
|
-
return
|
273440
|
+
return esm_default3({
|
273358
273441
|
message: "Which Smart Contract Portal instance do you want to connect to?",
|
273359
273442
|
choices,
|
273360
273443
|
default: defaultMiddleware
|
@@ -273383,7 +273466,7 @@ async function theGraphPrompt({
|
|
273383
273466
|
isRequired,
|
273384
273467
|
defaultHandler: async ({ defaultService: defaultMiddleware, choices }) => {
|
273385
273468
|
const filteredChoices = filterRunningOnly ? choices.filter(({ value: middleware }) => middleware === undefined || middleware?.status === "COMPLETED") : choices;
|
273386
|
-
return
|
273469
|
+
return esm_default3({
|
273387
273470
|
message: "Which The Graph instance do you want to connect to?",
|
273388
273471
|
choices: filteredChoices,
|
273389
273472
|
default: defaultMiddleware
|
@@ -273417,7 +273500,7 @@ async function instancePrompt(env2, accept, freeTextInput = false, isCi = is_in_
|
|
273417
273500
|
return sanitizeInstanceUrl(defaultPromptInstance);
|
273418
273501
|
}
|
273419
273502
|
if (freeTextInput) {
|
273420
|
-
const instance = await
|
273503
|
+
const instance = await esm_default2({
|
273421
273504
|
message: "What is the URL of your SettleMint instance?",
|
273422
273505
|
default: defaultPromptInstance,
|
273423
273506
|
required: true,
|
@@ -273439,7 +273522,7 @@ async function instancePrompt(env2, accept, freeTextInput = false, isCi = is_in_
|
|
273439
273522
|
if (knownInstances.length === 1) {
|
273440
273523
|
return sanitizeInstanceUrl(knownInstances[0]);
|
273441
273524
|
}
|
273442
|
-
return
|
273525
|
+
return esm_default3({
|
273443
273526
|
message: "What SettleMint instance do you want to connect to?",
|
273444
273527
|
choices: [
|
273445
273528
|
...knownInstances.map((instance) => ({
|
@@ -273465,7 +273548,7 @@ async function workspacePrompt(env2, workspaces, accept) {
|
|
273465
273548
|
if (is_in_ci_default) {
|
273466
273549
|
nothingSelectedError("workspace");
|
273467
273550
|
}
|
273468
|
-
const workspace = await
|
273551
|
+
const workspace = await esm_default3({
|
273469
273552
|
message: "Which workspace do you want to connect to?",
|
273470
273553
|
choices: workspaces.map((workspace2) => ({
|
273471
273554
|
name: `${workspace2.name} (${workspace2.uniqueName})`,
|
@@ -273558,7 +273641,7 @@ async function writeEnvSpinner(prod, env2) {
|
|
273558
273641
|
SETTLEMINT_HASURA_ENDPOINT: env2.SETTLEMINT_HASURA_ENDPOINT,
|
273559
273642
|
SETTLEMINT_THEGRAPH: env2.SETTLEMINT_THEGRAPH,
|
273560
273643
|
SETTLEMINT_THEGRAPH_SUBGRAPHS_ENDPOINTS: env2.SETTLEMINT_THEGRAPH_SUBGRAPHS_ENDPOINTS,
|
273561
|
-
|
273644
|
+
SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH: env2.SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH,
|
273562
273645
|
SETTLEMINT_PORTAL: env2.SETTLEMINT_PORTAL,
|
273563
273646
|
SETTLEMINT_PORTAL_GRAPHQL_ENDPOINT: env2.SETTLEMINT_PORTAL_GRAPHQL_ENDPOINT,
|
273564
273647
|
SETTLEMINT_PORTAL_REST_ENDPOINT: env2.SETTLEMINT_PORTAL_REST_ENDPOINT,
|
@@ -273696,6 +273779,12 @@ function connectCommand() {
|
|
273696
273779
|
middlewares,
|
273697
273780
|
accept: acceptDefaults
|
273698
273781
|
});
|
273782
|
+
const graphEndpoints = await getGraphEndpoint(settlemint, thegraph);
|
273783
|
+
const [defaultSubgraph] = thegraph ? await subgraphPrompt({
|
273784
|
+
env: { ...env2, ...graphEndpoints },
|
273785
|
+
accept: acceptDefaults,
|
273786
|
+
message: "Which TheGraph subgraph do you want to use as the default?"
|
273787
|
+
}) : [];
|
273699
273788
|
const portal = await portalPrompt({
|
273700
273789
|
env: env2,
|
273701
273790
|
middlewares,
|
@@ -273801,7 +273890,8 @@ function connectCommand() {
|
|
273801
273890
|
SETTLEMINT_HASURA: hasura?.uniqueName,
|
273802
273891
|
...getHasuraEndpoints(hasura),
|
273803
273892
|
SETTLEMINT_THEGRAPH: thegraph?.uniqueName,
|
273804
|
-
|
273893
|
+
SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH: defaultSubgraph,
|
273894
|
+
...graphEndpoints,
|
273805
273895
|
SETTLEMINT_PORTAL: portal?.uniqueName,
|
273806
273896
|
...getPortalEndpoints(portal),
|
273807
273897
|
SETTLEMINT_HD_PRIVATE_KEY: hdPrivateKey?.uniqueName,
|
@@ -273828,7 +273918,7 @@ async function projectNamePrompt(env2, argument) {
|
|
273828
273918
|
if (defaultInstance) {
|
273829
273919
|
return defaultInstance;
|
273830
273920
|
}
|
273831
|
-
return
|
273921
|
+
return esm_default2({
|
273832
273922
|
message: "What is the name of your new SettleMint project?",
|
273833
273923
|
default: defaultInstance,
|
273834
273924
|
required: true,
|
@@ -273865,7 +273955,7 @@ async function templatePrompt(platformConfig, argument) {
|
|
273865
273955
|
}
|
273866
273956
|
return template2.id;
|
273867
273957
|
}
|
273868
|
-
const template = await
|
273958
|
+
const template = await esm_default3({
|
273869
273959
|
message: "Which template do you want to use?",
|
273870
273960
|
choices: [
|
273871
273961
|
...kits.map((template2) => ({
|
@@ -277111,7 +277201,7 @@ function createCommand2() {
|
|
277111
277201
|
await mkdir6(projectDir, { recursive: true });
|
277112
277202
|
}
|
277113
277203
|
if (!await isEmpty(projectDir)) {
|
277114
|
-
const confirmEmpty = await
|
277204
|
+
const confirmEmpty = await esm_default4({
|
277115
277205
|
message: `The folder ${projectDir} already exists. Do you want to empty it?`,
|
277116
277206
|
default: false
|
277117
277207
|
});
|
@@ -277141,7 +277231,7 @@ async function personalAccessTokenPrompt(env2, instance, accept) {
|
|
277141
277231
|
return defaultPersonalAccessToken;
|
277142
277232
|
}
|
277143
277233
|
if (existingConfig && defaultPersonalAccessToken) {
|
277144
|
-
const useExisting = await
|
277234
|
+
const useExisting = await esm_default4({
|
277145
277235
|
message: `Do you want to use your existing personal access token for ${instance}?`,
|
277146
277236
|
default: true
|
277147
277237
|
});
|
@@ -277249,7 +277339,7 @@ function logoutCommand() {
|
|
277249
277339
|
}
|
277250
277340
|
const env2 = await loadEnv(false, false);
|
277251
277341
|
const defaultInstance = env2.SETTLEMINT_INSTANCE;
|
277252
|
-
const instance = await
|
277342
|
+
const instance = await esm_default3({
|
277253
277343
|
message: "Select the instance to logout from:",
|
277254
277344
|
choices: instances.map((instance2) => ({
|
277255
277345
|
value: instance2,
|
@@ -277465,7 +277555,7 @@ async function providerPrompt(platformConfig, argument) {
|
|
277465
277555
|
if (possibleProviders.length === 1) {
|
277466
277556
|
return possibleProviders[0];
|
277467
277557
|
}
|
277468
|
-
const provider = await
|
277558
|
+
const provider = await esm_default3({
|
277469
277559
|
message: "Which provider do you want to use?",
|
277470
277560
|
choices: platformConfig.deploymentEngineTargets.map((target) => ({
|
277471
277561
|
name: target.name,
|
@@ -277496,7 +277586,7 @@ async function regionPrompt(provider, argument) {
|
|
277496
277586
|
if (possibleRegions.length === 1) {
|
277497
277587
|
return possibleRegions[0];
|
277498
277588
|
}
|
277499
|
-
const region = await
|
277589
|
+
const region = await esm_default3({
|
277500
277590
|
message: "Which region do you want to use?",
|
277501
277591
|
choices: provider.clusters.map((cluster) => ({
|
277502
277592
|
name: cluster.name,
|
@@ -277984,7 +278074,7 @@ async function blockchainNetworkPrompt({
|
|
277984
278074
|
envKey: "SETTLEMINT_BLOCKCHAIN_NETWORK",
|
277985
278075
|
isRequired,
|
277986
278076
|
defaultHandler: async ({ defaultService: defaultNetwork, choices }) => {
|
277987
|
-
return
|
278077
|
+
return esm_default3({
|
277988
278078
|
message: "Which blockchain network do you want to connect to?",
|
277989
278079
|
choices,
|
277990
278080
|
default: defaultNetwork
|
@@ -278711,7 +278801,7 @@ function createCommand3() {
|
|
278711
278801
|
|
278712
278802
|
// src/prompts/delete-confirmation.prompt.ts
|
278713
278803
|
async function deleteConfirmationPrompt(itemDescription) {
|
278714
|
-
const confirmation = await
|
278804
|
+
const confirmation = await esm_default2({
|
278715
278805
|
message: `Are you sure you want to delete ${itemDescription}? (yes/no)`,
|
278716
278806
|
required: true,
|
278717
278807
|
validate(value4) {
|
@@ -279580,7 +279670,7 @@ async function useCasePrompt(platformConfig, argument) {
|
|
279580
279670
|
if (selectableUseCases.length === 1) {
|
279581
279671
|
return selectableUseCases[0];
|
279582
279672
|
}
|
279583
|
-
const useCase = await
|
279673
|
+
const useCase = await esm_default3({
|
279584
279674
|
message: "Which use case do you want to use?",
|
279585
279675
|
choices: selectableUseCases.map((useCase2) => ({
|
279586
279676
|
name: formatUseCaseName(useCase2.name),
|
@@ -279630,7 +279720,7 @@ function createCommand4() {
|
|
279630
279720
|
const targetDir = formatTargetDir(name2);
|
279631
279721
|
const projectDir = join10(process.cwd(), targetDir);
|
279632
279722
|
if (await exists3(projectDir) && !await isEmpty(projectDir)) {
|
279633
|
-
const confirmEmpty = await
|
279723
|
+
const confirmEmpty = await esm_default4({
|
279634
279724
|
message: `The folder ${projectDir} already exists. Do you want to delete it?`,
|
279635
279725
|
default: false
|
279636
279726
|
});
|
@@ -279871,7 +279961,7 @@ async function addressPrompt({
|
|
279871
279961
|
note(`Private key with address '${defaultAddress}' is not activated on the node '${node.uniqueName}'.
|
279872
279962
|
Please select another key or activate this key on the node and try again.`, "warn");
|
279873
279963
|
}
|
279874
|
-
const address = await
|
279964
|
+
const address = await esm_default3({
|
279875
279965
|
message: "Which private key do you want to deploy from?",
|
279876
279966
|
choices: possiblePrivateKeys.map(({ address: address2, name: name2 }) => ({
|
279877
279967
|
name: name2,
|
@@ -280190,17 +280280,6 @@ import { dirname as dirname10 } from "node:path";
|
|
280190
280280
|
import { rm as rm4 } from "node:fs/promises";
|
280191
280281
|
var import_semver = __toESM(require_semver11(), 1);
|
280192
280282
|
|
280193
|
-
// src/utils/subgraph/sanitize-name.ts
|
280194
|
-
var import_slugify = __toESM(require_slugify(), 1);
|
280195
|
-
function sanitizeName(value4, length = 35) {
|
280196
|
-
return import_slugify.default(value4, {
|
280197
|
-
strict: true,
|
280198
|
-
remove: /[!"'()*+.:@~]/g,
|
280199
|
-
replacement: "-",
|
280200
|
-
lower: true
|
280201
|
-
}).slice(0, length).replaceAll(/(^\d*)/g, "").replaceAll(/(-$)/g, "").replaceAll(/(^-)/g, "");
|
280202
|
-
}
|
280203
|
-
|
280204
280283
|
// src/utils/subgraph/subgraph-config.ts
|
280205
280284
|
import { readFile as readFile7, writeFile as writeFile8 } from "node:fs/promises";
|
280206
280285
|
import { basename as basename4, join as join11 } from "node:path";
|
@@ -280382,40 +280461,6 @@ function subgraphCodegenCommand() {
|
|
280382
280461
|
|
280383
280462
|
// src/commands/smart-contract-set/subgraph/deploy.ts
|
280384
280463
|
import { dirname as dirname12 } from "node:path";
|
280385
|
-
|
280386
|
-
// src/prompts/smart-contract-set/subgraph-name.prompt.ts
|
280387
|
-
async function subgraphNamePrompt({
|
280388
|
-
defaultName,
|
280389
|
-
env: env2,
|
280390
|
-
accept,
|
280391
|
-
prod
|
280392
|
-
}) {
|
280393
|
-
const defaultSubgraphName = defaultName ? sanitizeName(defaultName) : undefined;
|
280394
|
-
if (accept) {
|
280395
|
-
if (defaultSubgraphName && env2.SETTLEMINT_THEGRAPH_SUBGRAPH_NAME !== defaultSubgraphName) {
|
280396
|
-
await saveSubgraphName(defaultSubgraphName, env2, prod);
|
280397
|
-
}
|
280398
|
-
return defaultSubgraphName ?? env2.SETTLEMINT_THEGRAPH_SUBGRAPH_NAME;
|
280399
|
-
}
|
280400
|
-
const subgraphName = await esm_default4({
|
280401
|
-
message: "What is the name of your subgraph?",
|
280402
|
-
default: defaultSubgraphName,
|
280403
|
-
required: true
|
280404
|
-
});
|
280405
|
-
const sanitizedSubgraphName = sanitizeName(subgraphName);
|
280406
|
-
if (env2.SETTLEMINT_THEGRAPH_SUBGRAPH_NAME !== sanitizedSubgraphName) {
|
280407
|
-
await saveSubgraphName(sanitizedSubgraphName, env2, prod);
|
280408
|
-
}
|
280409
|
-
return sanitizedSubgraphName;
|
280410
|
-
}
|
280411
|
-
async function saveSubgraphName(sanitizedSubgraphName, env2, prod) {
|
280412
|
-
await writeEnvSpinner(!!prod, {
|
280413
|
-
...env2,
|
280414
|
-
SETTLEMINT_THEGRAPH_SUBGRAPH_NAME: sanitizedSubgraphName
|
280415
|
-
});
|
280416
|
-
}
|
280417
|
-
|
280418
|
-
// src/commands/smart-contract-set/subgraph/deploy.ts
|
280419
280464
|
function subgraphDeployCommand() {
|
280420
280465
|
return new Command("deploy").description("Deploy the subgraph").usage(createExamples([
|
280421
280466
|
{
|
@@ -280461,14 +280506,24 @@ function subgraphDeployCommand() {
|
|
280461
280506
|
cancel2('The "subgraph/subgraph.config.json" config has not been set, ensure all the contracts listed have an address added');
|
280462
280507
|
}
|
280463
280508
|
}
|
280464
|
-
|
280465
|
-
|
280466
|
-
|
280467
|
-
|
280468
|
-
|
280469
|
-
|
280509
|
+
let graphName;
|
280510
|
+
if (!subgraphName) {
|
280511
|
+
const selectedSubgraphs = await subgraphPrompt({
|
280512
|
+
env: env2,
|
280513
|
+
accept: autoAccept,
|
280514
|
+
message: "Which subgraph do you want to deploy to?",
|
280515
|
+
allowNew: true
|
280516
|
+
});
|
280517
|
+
graphName = selectedSubgraphs[0];
|
280518
|
+
} else {
|
280519
|
+
graphName = await subgraphNamePrompt({
|
280520
|
+
defaultName: subgraphName,
|
280521
|
+
env: env2,
|
280522
|
+
accept: autoAccept
|
280523
|
+
});
|
280524
|
+
}
|
280470
280525
|
if (!graphName) {
|
280471
|
-
cancel2("No
|
280526
|
+
cancel2("No subgraph name provided. Please provide a graph name to continue.");
|
280472
280527
|
}
|
280473
280528
|
const middlewareAdminUrl = new URL(`/${encodeURIComponent(accessToken)}/admin`, theGraphMiddleware.serviceUrl).toString();
|
280474
280529
|
await executeCommand(command, [...args, "graph", "create", "--node", middlewareAdminUrl, graphName]);
|
@@ -280513,14 +280568,20 @@ function subgraphRemoveCommand() {
|
|
280513
280568
|
description: "Remove a subgraph",
|
280514
280569
|
command: "scs subgraph remove my-subgraph"
|
280515
280570
|
}
|
280516
|
-
])).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("
|
280571
|
+
])).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 deploy (defaults to value in .env if not provided)").action(async (subgraphName, { prod, acceptDefaults, force }) => {
|
280517
280572
|
intro("Removing subgraph");
|
280518
280573
|
await validateIfRequiredPackagesAreInstalled(["@graphprotocol/graph-cli"]);
|
280519
|
-
if (!force) {
|
280520
|
-
await deleteConfirmationPrompt(`the subgraph ${subgraphName}`);
|
280521
|
-
}
|
280522
280574
|
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
280523
280575
|
const env2 = await loadEnv(false, !!prod);
|
280576
|
+
const selectedSubgraphs = subgraphName ? [subgraphName] : await subgraphPrompt({
|
280577
|
+
env: env2,
|
280578
|
+
accept: autoAccept,
|
280579
|
+
message: "Which subgraph do you want to remove?"
|
280580
|
+
});
|
280581
|
+
const graphName = selectedSubgraphs[0];
|
280582
|
+
if (!force) {
|
280583
|
+
await deleteConfirmationPrompt(`the subgraph ${graphName}`);
|
280584
|
+
}
|
280524
280585
|
const instance = await instancePrompt(env2, true);
|
280525
280586
|
const accessToken = await getApplicationOrPersonalAccessToken({
|
280526
280587
|
env: env2,
|
@@ -280538,19 +280599,30 @@ function subgraphRemoveCommand() {
|
|
280538
280599
|
const cwd2 = dirname13(subgraphYamlFile);
|
280539
280600
|
const { command, args } = await getPackageManagerExecutable();
|
280540
280601
|
const middlewareAdminUrl = new URL(`/${encodeURIComponent(accessToken)}/admin`, theGraphMiddleware.serviceUrl).toString();
|
280541
|
-
await executeCommand(command, [...args, "graph", "remove", "--node", middlewareAdminUrl,
|
280602
|
+
await executeCommand(command, [...args, "graph", "remove", "--node", middlewareAdminUrl, graphName]);
|
280542
280603
|
const settlemintClient = createSettleMintClient({
|
280543
280604
|
accessToken,
|
280544
280605
|
instance
|
280545
280606
|
});
|
280546
|
-
const
|
280547
|
-
|
280607
|
+
const graphEndpoints = await spinner({
|
280608
|
+
startMessage: "Waiting for subgraph to be removed",
|
280609
|
+
task: () => retryWhenFailed2(async () => {
|
280610
|
+
const middleware = await settlemintClient.middleware.read(theGraphMiddleware.uniqueName);
|
280611
|
+
const endpoints = await getGraphEndpoint(settlemintClient, middleware);
|
280612
|
+
if (endpoints.SETTLEMINT_THEGRAPH_SUBGRAPHS_ENDPOINTS?.some((endpoint) => endpoint.endsWith(graphName))) {
|
280613
|
+
throw new Error(`Subgraph '${graphName}' not removed from middleware '${theGraphMiddleware.uniqueName}'`);
|
280614
|
+
}
|
280615
|
+
return endpoints;
|
280616
|
+
}),
|
280617
|
+
stopMessage: "Waiting finished"
|
280618
|
+
});
|
280548
280619
|
await writeEnvSpinner(!!prod, {
|
280549
280620
|
...env2,
|
280550
280621
|
SETTLEMINT_THEGRAPH: theGraphMiddleware.uniqueName,
|
280622
|
+
SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH: env2.SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH === graphName ? undefined : env2.SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH,
|
280551
280623
|
...graphEndpoints
|
280552
280624
|
});
|
280553
|
-
outro(`Subgraph ${
|
280625
|
+
outro(`Subgraph ${graphName} removed successfully`);
|
280554
280626
|
});
|
280555
280627
|
}
|
280556
280628
|
|
@@ -280693,4 +280765,4 @@ async function sdkCliCommand(argv = process.argv) {
|
|
280693
280765
|
// src/cli.ts
|
280694
280766
|
sdkCliCommand();
|
280695
280767
|
|
280696
|
-
//# debugId=
|
280768
|
+
//# debugId=B92E21806C2C9DFA64756E2164756E21
|