@settlemint/sdk-cli 2.4.0-prb9f64cf3 → 2.4.0-prc1e1fd02
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 +2670 -613
- package/dist/cli.js.map +89 -19
- package/package.json +7 -7
package/dist/cli.js
CHANGED
@@ -161742,7 +161742,7 @@ ${lanes.join(`
|
|
161742
161742
|
function generateOptionOutput(sys2, option, rightAlignOfLeft, leftAlignOfRight) {
|
161743
161743
|
var _a;
|
161744
161744
|
const text = [];
|
161745
|
-
const
|
161745
|
+
const colors2 = createColors(sys2);
|
161746
161746
|
const name2 = getDisplayNameTextOfOption(option);
|
161747
161747
|
const valueCandidates = getValueCandidate(option);
|
161748
161748
|
const defaultValueDescription = typeof option.defaultValueDescription === "object" ? getDiagnosticText(option.defaultValueDescription) : formatDefaultValue(option.defaultValueDescription, option.type === "list" || option.type === "listOrElement" ? option.element.type : option.type);
|
@@ -161763,7 +161763,7 @@ ${lanes.join(`
|
|
161763
161763
|
}
|
161764
161764
|
text.push(sys2.newLine);
|
161765
161765
|
} else {
|
161766
|
-
text.push(
|
161766
|
+
text.push(colors2.blue(name2), sys2.newLine);
|
161767
161767
|
if (option.description) {
|
161768
161768
|
const description3 = getDiagnosticText(option.description);
|
161769
161769
|
text.push(description3);
|
@@ -161808,7 +161808,7 @@ ${lanes.join(`
|
|
161808
161808
|
if (isFirstLine) {
|
161809
161809
|
curLeft = left.padStart(rightAlignOfLeft2);
|
161810
161810
|
curLeft = curLeft.padEnd(leftAlignOfRight2);
|
161811
|
-
curLeft = colorLeft ?
|
161811
|
+
curLeft = colorLeft ? colors2.blue(curLeft) : curLeft;
|
161812
161812
|
} else {
|
161813
161813
|
curLeft = "".padStart(leftAlignOfRight2);
|
161814
161814
|
}
|
@@ -161920,9 +161920,9 @@ ${lanes.join(`
|
|
161920
161920
|
return res;
|
161921
161921
|
}
|
161922
161922
|
function printEasyHelp(sys2, simpleOptions) {
|
161923
|
-
const
|
161923
|
+
const colors2 = createColors(sys2);
|
161924
161924
|
let output = [...getHeader(sys2, `${getDiagnosticText(Diagnostics.tsc_Colon_The_TypeScript_Compiler)} - ${getDiagnosticText(Diagnostics.Version_0, version4)}`)];
|
161925
|
-
output.push(
|
161925
|
+
output.push(colors2.bold(getDiagnosticText(Diagnostics.COMMON_COMMANDS)) + sys2.newLine + sys2.newLine);
|
161926
161926
|
example("tsc", Diagnostics.Compiles_the_current_project_tsconfig_json_in_the_working_directory);
|
161927
161927
|
example("tsc app.ts util.ts", Diagnostics.Ignoring_tsconfig_json_compiles_the_specified_files_with_default_compiler_options);
|
161928
161928
|
example("tsc -b", Diagnostics.Build_a_composite_project_in_the_working_directory);
|
@@ -161943,7 +161943,7 @@ ${lanes.join(`
|
|
161943
161943
|
function example(ex, desc) {
|
161944
161944
|
const examples = typeof ex === "string" ? [ex] : ex;
|
161945
161945
|
for (const example2 of examples) {
|
161946
|
-
output.push(" " +
|
161946
|
+
output.push(" " + colors2.blue(example2) + sys2.newLine);
|
161947
161947
|
}
|
161948
161948
|
output.push(" " + getDiagnosticText(desc) + sys2.newLine + sys2.newLine);
|
161949
161949
|
}
|
@@ -161966,12 +161966,12 @@ ${lanes.join(`
|
|
161966
161966
|
}
|
161967
161967
|
function getHeader(sys2, message) {
|
161968
161968
|
var _a;
|
161969
|
-
const
|
161969
|
+
const colors2 = createColors(sys2);
|
161970
161970
|
const header = [];
|
161971
161971
|
const terminalWidth = ((_a = sys2.getWidthOfTerminal) == null ? undefined : _a.call(sys2)) ?? 0;
|
161972
161972
|
const tsIconLength = 5;
|
161973
|
-
const tsIconFirstLine =
|
161974
|
-
const tsIconSecondLine =
|
161973
|
+
const tsIconFirstLine = colors2.blueBackground("".padStart(tsIconLength));
|
161974
|
+
const tsIconSecondLine = colors2.blueBackground(colors2.brightWhite("TS ".padStart(tsIconLength)));
|
161975
161975
|
if (terminalWidth >= message.length + tsIconLength) {
|
161976
161976
|
const rightAlign = terminalWidth > 120 ? 120 : terminalWidth;
|
161977
161977
|
const leftAlign = rightAlign - tsIconLength;
|
@@ -231623,7 +231623,7 @@ function size(value4) {
|
|
231623
231623
|
var init_size = () => {};
|
231624
231624
|
|
231625
231625
|
// ../../node_modules/viem/_esm/errors/version.js
|
231626
|
-
var version5 = "2.31.
|
231626
|
+
var version5 = "2.31.6";
|
231627
231627
|
|
231628
231628
|
// ../../node_modules/viem/_esm/errors/base.js
|
231629
231629
|
function walk(err, fn) {
|
@@ -232832,16 +232832,16 @@ var init_lru = __esm(() => {
|
|
232832
232832
|
});
|
232833
232833
|
this.maxSize = size2;
|
232834
232834
|
}
|
232835
|
-
get(
|
232836
|
-
const value4 = super.get(
|
232837
|
-
if (super.has(
|
232838
|
-
this.delete(
|
232839
|
-
super.set(
|
232835
|
+
get(key4) {
|
232836
|
+
const value4 = super.get(key4);
|
232837
|
+
if (super.has(key4) && value4 !== undefined) {
|
232838
|
+
this.delete(key4);
|
232839
|
+
super.set(key4, value4);
|
232840
232840
|
}
|
232841
232841
|
return value4;
|
232842
232842
|
}
|
232843
|
-
set(
|
232844
|
-
super.set(
|
232843
|
+
set(key4, value4) {
|
232844
|
+
super.set(key4, value4);
|
232845
232845
|
if (this.maxSize && this.size > this.maxSize) {
|
232846
232846
|
const firstKey = this.keys().next().value;
|
232847
232847
|
if (firstKey)
|
@@ -233883,9 +233883,9 @@ var init_decodeErrorResult = __esm(() => {
|
|
233883
233883
|
});
|
233884
233884
|
|
233885
233885
|
// ../../node_modules/viem/_esm/utils/stringify.js
|
233886
|
-
var stringify3 = (value4, replacer, space) => JSON.stringify(value4, (
|
233886
|
+
var stringify3 = (value4, replacer, space) => JSON.stringify(value4, (key4, value_) => {
|
233887
233887
|
const value5 = typeof value_ === "bigint" ? value_.toString() : value_;
|
233888
|
-
return typeof replacer === "function" ? replacer(
|
233888
|
+
return typeof replacer === "function" ? replacer(key4, value5) : value5;
|
233889
233889
|
}, space);
|
233890
233890
|
|
233891
233891
|
// ../../node_modules/viem/_esm/utils/abi/formatAbiItemWithArgs.js
|
@@ -233999,13 +233999,13 @@ var init_stateOverride = __esm(() => {
|
|
233999
233999
|
|
234000
234000
|
// ../../node_modules/viem/_esm/errors/transaction.js
|
234001
234001
|
function prettyPrint(args) {
|
234002
|
-
const entries = Object.entries(args).map(([
|
234002
|
+
const entries = Object.entries(args).map(([key4, value4]) => {
|
234003
234003
|
if (value4 === undefined || value4 === false)
|
234004
234004
|
return null;
|
234005
|
-
return [
|
234005
|
+
return [key4, value4];
|
234006
234006
|
}).filter(Boolean);
|
234007
|
-
const maxLength = entries.reduce((acc, [
|
234008
|
-
return entries.map(([
|
234007
|
+
const maxLength = entries.reduce((acc, [key4]) => Math.max(acc, key4.length), 0);
|
234008
|
+
return entries.map(([key4, value4]) => ` ${`${key4}:`.padEnd(maxLength + 1)} ${value4}`).join(`
|
234009
234009
|
`);
|
234010
234010
|
}
|
234011
234011
|
var FeeConflictError, InvalidSerializableTransactionError, TransactionNotFoundError, TransactionReceiptNotFoundError, WaitForTransactionReceiptTimeoutError;
|
@@ -235111,7 +235111,7 @@ var init_sha2 = __esm(() => {
|
|
235111
235111
|
});
|
235112
235112
|
|
235113
235113
|
// ../../node_modules/@noble/hashes/esm/hmac.js
|
235114
|
-
var HMAC, hmac = (hash2,
|
235114
|
+
var HMAC, hmac = (hash2, key4, message) => new HMAC(hash2, key4).update(message).digest();
|
235115
235115
|
var init_hmac = __esm(() => {
|
235116
235116
|
init_utils2();
|
235117
235117
|
HMAC = class HMAC extends Hash {
|
@@ -235120,7 +235120,7 @@ var init_hmac = __esm(() => {
|
|
235120
235120
|
this.finished = false;
|
235121
235121
|
this.destroyed = false;
|
235122
235122
|
ahash(hash2);
|
235123
|
-
const
|
235123
|
+
const key4 = toBytes2(_key);
|
235124
235124
|
this.iHash = hash2.create();
|
235125
235125
|
if (typeof this.iHash.update !== "function")
|
235126
235126
|
throw new Error("Expected instance of class which extends utils.Hash");
|
@@ -235128,7 +235128,7 @@ var init_hmac = __esm(() => {
|
|
235128
235128
|
this.outputLen = this.iHash.outputLen;
|
235129
235129
|
const blockLen = this.blockLen;
|
235130
235130
|
const pad2 = new Uint8Array(blockLen);
|
235131
|
-
pad2.set(
|
235131
|
+
pad2.set(key4.length > blockLen ? hash2.create().update(key4).digest() : key4);
|
235132
235132
|
for (let i6 = 0;i6 < pad2.length; i6++)
|
235133
235133
|
pad2[i6] ^= 54;
|
235134
235134
|
this.iHash.update(pad2);
|
@@ -235178,7 +235178,7 @@ var init_hmac = __esm(() => {
|
|
235178
235178
|
this.iHash.destroy();
|
235179
235179
|
}
|
235180
235180
|
};
|
235181
|
-
hmac.create = (hash2,
|
235181
|
+
hmac.create = (hash2, key4) => new HMAC(hash2, key4);
|
235182
235182
|
});
|
235183
235183
|
|
235184
235184
|
// ../../node_modules/@noble/curves/esm/utils.js
|
@@ -235579,13 +235579,13 @@ function getMinHashLength(fieldOrder) {
|
|
235579
235579
|
const length = getFieldBytesLength(fieldOrder);
|
235580
235580
|
return length + Math.ceil(length / 2);
|
235581
235581
|
}
|
235582
|
-
function mapHashToField(
|
235583
|
-
const len =
|
235582
|
+
function mapHashToField(key4, fieldOrder, isLE2 = false) {
|
235583
|
+
const len = key4.length;
|
235584
235584
|
const fieldLen = getFieldBytesLength(fieldOrder);
|
235585
235585
|
const minLen = getMinHashLength(fieldOrder);
|
235586
235586
|
if (len < 16 || len < minLen || len > 1024)
|
235587
235587
|
throw new Error("expected " + minLen + "-1024 bytes of input, got " + len);
|
235588
|
-
const num = isLE2 ? bytesToNumberLE(
|
235588
|
+
const num = isLE2 ? bytesToNumberLE(key4) : bytesToNumberBE(key4);
|
235589
235589
|
const reduced = mod(num, fieldOrder - _1n3) + _1n3;
|
235590
235590
|
return isLE2 ? numberToBytesLE(reduced, fieldLen) : numberToBytesBE(reduced, fieldLen);
|
235591
235591
|
}
|
@@ -235888,12 +235888,12 @@ function _legacyHelperEquat(Fp, a7, b4) {
|
|
235888
235888
|
}
|
235889
235889
|
function _legacyHelperNormPriv(Fn, allowedPrivateKeyLengths, wrapPrivateKey) {
|
235890
235890
|
const { BYTES: expected } = Fn;
|
235891
|
-
function normPrivateKeyToScalar(
|
235891
|
+
function normPrivateKeyToScalar(key4) {
|
235892
235892
|
let num;
|
235893
|
-
if (typeof
|
235894
|
-
num =
|
235893
|
+
if (typeof key4 === "bigint") {
|
235894
|
+
num = key4;
|
235895
235895
|
} else {
|
235896
|
-
let bytes = ensureBytes("private key",
|
235896
|
+
let bytes = ensureBytes("private key", key4);
|
235897
235897
|
if (allowedPrivateKeyLengths) {
|
235898
235898
|
if (!allowedPrivateKeyLengths.includes(bytes.length * 2))
|
235899
235899
|
throw new Error("invalid private key");
|
@@ -235904,7 +235904,7 @@ function _legacyHelperNormPriv(Fn, allowedPrivateKeyLengths, wrapPrivateKey) {
|
|
235904
235904
|
try {
|
235905
235905
|
num = Fn.fromBytes(bytes);
|
235906
235906
|
} catch (error44) {
|
235907
|
-
throw new Error(`invalid private key: expected ui8a of size ${expected}, got ${typeof
|
235907
|
+
throw new Error(`invalid private key: expected ui8a of size ${expected}, got ${typeof key4}`);
|
235908
235908
|
}
|
235909
235909
|
}
|
235910
235910
|
if (wrapPrivateKey)
|
@@ -236306,7 +236306,7 @@ function ecdsa(Point, ecdsaOpts, curveOpts = {}) {
|
|
236306
236306
|
bits2int_modN: "function"
|
236307
236307
|
});
|
236308
236308
|
const randomBytes_ = ecdsaOpts.randomBytes || randomBytes;
|
236309
|
-
const hmac_ = ecdsaOpts.hmac || ((
|
236309
|
+
const hmac_ = ecdsaOpts.hmac || ((key4, ...msgs) => hmac(ecdsaOpts.hash, key4, concatBytes(...msgs)));
|
236310
236310
|
const { Fp, Fn } = Point;
|
236311
236311
|
const { ORDER: CURVE_ORDER, BITS: fnBits } = Fn;
|
236312
236312
|
function isBiggerThanHalfOrder(number6) {
|
@@ -237464,11 +237464,11 @@ function extract2(value_, { format: format2 }) {
|
|
237464
237464
|
const value4 = {};
|
237465
237465
|
function extract_(formatted2) {
|
237466
237466
|
const keys = Object.keys(formatted2);
|
237467
|
-
for (const
|
237468
|
-
if (
|
237469
|
-
value4[
|
237470
|
-
if (formatted2[
|
237471
|
-
extract_(formatted2[
|
237467
|
+
for (const key4 of keys) {
|
237468
|
+
if (key4 in value_)
|
237469
|
+
value4[key4] = value_[key4];
|
237470
|
+
if (formatted2[key4] && typeof formatted2[key4] === "object" && !Array.isArray(formatted2[key4]))
|
237471
|
+
extract_(formatted2[key4]);
|
237472
237472
|
}
|
237473
237473
|
}
|
237474
237474
|
const formatted = format2(value_ || {});
|
@@ -237872,9 +237872,9 @@ var init_Errors = __esm(() => {
|
|
237872
237872
|
|
237873
237873
|
// ../../node_modules/ox/_esm/core/Json.js
|
237874
237874
|
function stringify4(value4, replacer, space) {
|
237875
|
-
return JSON.stringify(value4, (
|
237875
|
+
return JSON.stringify(value4, (key4, value5) => {
|
237876
237876
|
if (typeof replacer === "function")
|
237877
|
-
return replacer(
|
237877
|
+
return replacer(key4, value5);
|
237878
237878
|
if (typeof value5 === "bigint")
|
237879
237879
|
return value5.toString() + bigIntSuffix;
|
237880
237880
|
return value5;
|
@@ -238855,7 +238855,7 @@ async function localBatchGatewayRequest(parameters) {
|
|
238855
238855
|
const responses = [];
|
238856
238856
|
await Promise.all(queries.map(async (query, i6) => {
|
238857
238857
|
try {
|
238858
|
-
responses[i6] = await ccipRequest(query);
|
238858
|
+
responses[i6] = query.urls.includes(localBatchGatewayUrl) ? await localBatchGatewayRequest({ data: query.data, ccipRequest }) : await ccipRequest(query);
|
238859
238859
|
failures[i6] = false;
|
238860
238860
|
} catch (err) {
|
238861
238861
|
failures[i6] = true;
|
@@ -239297,11 +239297,11 @@ var require_visit = __commonJS((exports) => {
|
|
239297
239297
|
visit2.BREAK = BREAK;
|
239298
239298
|
visit2.SKIP = SKIP;
|
239299
239299
|
visit2.REMOVE = REMOVE;
|
239300
|
-
function visit_(
|
239301
|
-
const ctrl = callVisitor(
|
239300
|
+
function visit_(key5, node, visitor, path7) {
|
239301
|
+
const ctrl = callVisitor(key5, node, visitor, path7);
|
239302
239302
|
if (identity2.isNode(ctrl) || identity2.isPair(ctrl)) {
|
239303
|
-
replaceNode(
|
239304
|
-
return visit_(
|
239303
|
+
replaceNode(key5, path7, ctrl);
|
239304
|
+
return visit_(key5, ctrl, visitor, path7);
|
239305
239305
|
}
|
239306
239306
|
if (typeof ctrl !== "symbol") {
|
239307
239307
|
if (identity2.isCollection(node)) {
|
@@ -239345,11 +239345,11 @@ var require_visit = __commonJS((exports) => {
|
|
239345
239345
|
visitAsync.BREAK = BREAK;
|
239346
239346
|
visitAsync.SKIP = SKIP;
|
239347
239347
|
visitAsync.REMOVE = REMOVE;
|
239348
|
-
async function visitAsync_(
|
239349
|
-
const ctrl = await callVisitor(
|
239348
|
+
async function visitAsync_(key5, node, visitor, path7) {
|
239349
|
+
const ctrl = await callVisitor(key5, node, visitor, path7);
|
239350
239350
|
if (identity2.isNode(ctrl) || identity2.isPair(ctrl)) {
|
239351
|
-
replaceNode(
|
239352
|
-
return visitAsync_(
|
239351
|
+
replaceNode(key5, path7, ctrl);
|
239352
|
+
return visitAsync_(key5, ctrl, visitor, path7);
|
239353
239353
|
}
|
239354
239354
|
if (typeof ctrl !== "symbol") {
|
239355
239355
|
if (identity2.isCollection(node)) {
|
@@ -239399,27 +239399,27 @@ var require_visit = __commonJS((exports) => {
|
|
239399
239399
|
}
|
239400
239400
|
return visitor;
|
239401
239401
|
}
|
239402
|
-
function callVisitor(
|
239402
|
+
function callVisitor(key5, node, visitor, path7) {
|
239403
239403
|
if (typeof visitor === "function")
|
239404
|
-
return visitor(
|
239404
|
+
return visitor(key5, node, path7);
|
239405
239405
|
if (identity2.isMap(node))
|
239406
|
-
return visitor.Map?.(
|
239406
|
+
return visitor.Map?.(key5, node, path7);
|
239407
239407
|
if (identity2.isSeq(node))
|
239408
|
-
return visitor.Seq?.(
|
239408
|
+
return visitor.Seq?.(key5, node, path7);
|
239409
239409
|
if (identity2.isPair(node))
|
239410
|
-
return visitor.Pair?.(
|
239410
|
+
return visitor.Pair?.(key5, node, path7);
|
239411
239411
|
if (identity2.isScalar(node))
|
239412
|
-
return visitor.Scalar?.(
|
239412
|
+
return visitor.Scalar?.(key5, node, path7);
|
239413
239413
|
if (identity2.isAlias(node))
|
239414
|
-
return visitor.Alias?.(
|
239414
|
+
return visitor.Alias?.(key5, node, path7);
|
239415
239415
|
return;
|
239416
239416
|
}
|
239417
|
-
function replaceNode(
|
239417
|
+
function replaceNode(key5, path7, node) {
|
239418
239418
|
const parent = path7[path7.length - 1];
|
239419
239419
|
if (identity2.isCollection(parent)) {
|
239420
|
-
parent.items[
|
239420
|
+
parent.items[key5] = node;
|
239421
239421
|
} else if (identity2.isPair(parent)) {
|
239422
|
-
if (
|
239422
|
+
if (key5 === "key")
|
239423
239423
|
parent.key = node;
|
239424
239424
|
else
|
239425
239425
|
parent.value = node;
|
@@ -239650,7 +239650,7 @@ var require_anchors = __commonJS((exports) => {
|
|
239650
239650
|
|
239651
239651
|
// ../../node_modules/yaml/dist/doc/applyReviver.js
|
239652
239652
|
var require_applyReviver = __commonJS((exports) => {
|
239653
|
-
function applyReviver(reviver, obj,
|
239653
|
+
function applyReviver(reviver, obj, key5, val) {
|
239654
239654
|
if (val && typeof val === "object") {
|
239655
239655
|
if (Array.isArray(val)) {
|
239656
239656
|
for (let i7 = 0, len = val.length;i7 < len; ++i7) {
|
@@ -239690,7 +239690,7 @@ var require_applyReviver = __commonJS((exports) => {
|
|
239690
239690
|
}
|
239691
239691
|
}
|
239692
239692
|
}
|
239693
|
-
return reviver.call(obj,
|
239693
|
+
return reviver.call(obj, key5, val);
|
239694
239694
|
}
|
239695
239695
|
exports.applyReviver = applyReviver;
|
239696
239696
|
});
|
@@ -240019,29 +240019,29 @@ var require_Collection = __commonJS((exports) => {
|
|
240019
240019
|
if (isEmptyPath(path7))
|
240020
240020
|
this.add(value4);
|
240021
240021
|
else {
|
240022
|
-
const [
|
240023
|
-
const node = this.get(
|
240022
|
+
const [key5, ...rest] = path7;
|
240023
|
+
const node = this.get(key5, true);
|
240024
240024
|
if (identity2.isCollection(node))
|
240025
240025
|
node.addIn(rest, value4);
|
240026
240026
|
else if (node === undefined && this.schema)
|
240027
|
-
this.set(
|
240027
|
+
this.set(key5, collectionFromPath(this.schema, rest, value4));
|
240028
240028
|
else
|
240029
|
-
throw new Error(`Expected YAML collection at ${
|
240029
|
+
throw new Error(`Expected YAML collection at ${key5}. Remaining path: ${rest}`);
|
240030
240030
|
}
|
240031
240031
|
}
|
240032
240032
|
deleteIn(path7) {
|
240033
|
-
const [
|
240033
|
+
const [key5, ...rest] = path7;
|
240034
240034
|
if (rest.length === 0)
|
240035
|
-
return this.delete(
|
240036
|
-
const node = this.get(
|
240035
|
+
return this.delete(key5);
|
240036
|
+
const node = this.get(key5, true);
|
240037
240037
|
if (identity2.isCollection(node))
|
240038
240038
|
return node.deleteIn(rest);
|
240039
240039
|
else
|
240040
|
-
throw new Error(`Expected YAML collection at ${
|
240040
|
+
throw new Error(`Expected YAML collection at ${key5}. Remaining path: ${rest}`);
|
240041
240041
|
}
|
240042
240042
|
getIn(path7, keepScalar) {
|
240043
|
-
const [
|
240044
|
-
const node = this.get(
|
240043
|
+
const [key5, ...rest] = path7;
|
240044
|
+
const node = this.get(key5, true);
|
240045
240045
|
if (rest.length === 0)
|
240046
240046
|
return !keepScalar && identity2.isScalar(node) ? node.value : node;
|
240047
240047
|
else
|
@@ -240056,24 +240056,24 @@ var require_Collection = __commonJS((exports) => {
|
|
240056
240056
|
});
|
240057
240057
|
}
|
240058
240058
|
hasIn(path7) {
|
240059
|
-
const [
|
240059
|
+
const [key5, ...rest] = path7;
|
240060
240060
|
if (rest.length === 0)
|
240061
|
-
return this.has(
|
240062
|
-
const node = this.get(
|
240061
|
+
return this.has(key5);
|
240062
|
+
const node = this.get(key5, true);
|
240063
240063
|
return identity2.isCollection(node) ? node.hasIn(rest) : false;
|
240064
240064
|
}
|
240065
240065
|
setIn(path7, value4) {
|
240066
|
-
const [
|
240066
|
+
const [key5, ...rest] = path7;
|
240067
240067
|
if (rest.length === 0) {
|
240068
|
-
this.set(
|
240068
|
+
this.set(key5, value4);
|
240069
240069
|
} else {
|
240070
|
-
const node = this.get(
|
240070
|
+
const node = this.get(key5, true);
|
240071
240071
|
if (identity2.isCollection(node))
|
240072
240072
|
node.setIn(rest, value4);
|
240073
240073
|
else if (node === undefined && this.schema)
|
240074
|
-
this.set(
|
240074
|
+
this.set(key5, collectionFromPath(this.schema, rest, value4));
|
240075
240075
|
else
|
240076
|
-
throw new Error(`Expected YAML collection at ${
|
240076
|
+
throw new Error(`Expected YAML collection at ${key5}. Remaining path: ${rest}`);
|
240077
240077
|
}
|
240078
240078
|
}
|
240079
240079
|
}
|
@@ -240660,19 +240660,19 @@ var require_stringifyPair = __commonJS((exports) => {
|
|
240660
240660
|
var Scalar = require_Scalar();
|
240661
240661
|
var stringify5 = require_stringify();
|
240662
240662
|
var stringifyComment = require_stringifyComment();
|
240663
|
-
function stringifyPair2({ key:
|
240663
|
+
function stringifyPair2({ key: key5, value: value4 }, ctx, onComment, onChompKeep) {
|
240664
240664
|
const { allNullValues, doc: doc2, indent: indent2, indentStep, options: { commentString, indentSeq, simpleKeys } } = ctx;
|
240665
|
-
let keyComment = identity2.isNode(
|
240665
|
+
let keyComment = identity2.isNode(key5) && key5.comment || null;
|
240666
240666
|
if (simpleKeys) {
|
240667
240667
|
if (keyComment) {
|
240668
240668
|
throw new Error("With simple keys, key nodes cannot have comments");
|
240669
240669
|
}
|
240670
|
-
if (identity2.isCollection(
|
240670
|
+
if (identity2.isCollection(key5) || !identity2.isNode(key5) && typeof key5 === "object") {
|
240671
240671
|
const msg = "With simple keys, collection cannot be used as a key value";
|
240672
240672
|
throw new Error(msg);
|
240673
240673
|
}
|
240674
240674
|
}
|
240675
|
-
let explicitKey = !simpleKeys && (!
|
240675
|
+
let explicitKey = !simpleKeys && (!key5 || keyComment && value4 == null && !ctx.inFlow || identity2.isCollection(key5) || (identity2.isScalar(key5) ? key5.type === Scalar.Scalar.BLOCK_FOLDED || key5.type === Scalar.Scalar.BLOCK_LITERAL : typeof key5 === "object"));
|
240676
240676
|
ctx = Object.assign({}, ctx, {
|
240677
240677
|
allNullValues: false,
|
240678
240678
|
implicitKey: !explicitKey && (simpleKeys || !allNullValues),
|
@@ -240680,7 +240680,7 @@ var require_stringifyPair = __commonJS((exports) => {
|
|
240680
240680
|
});
|
240681
240681
|
let keyCommentDone = false;
|
240682
240682
|
let chompKeep = false;
|
240683
|
-
let str = stringify5.stringify(
|
240683
|
+
let str = stringify5.stringify(key5, ctx, () => keyCommentDone = true, () => chompKeep = true);
|
240684
240684
|
if (!explicitKey && !ctx.inFlow && str.length > 1024) {
|
240685
240685
|
if (simpleKeys)
|
240686
240686
|
throw new Error("With simple keys, single line scalar must not span more than 1024 characters");
|
@@ -240824,7 +240824,7 @@ var require_merge = __commonJS((exports) => {
|
|
240824
240824
|
}),
|
240825
240825
|
stringify: () => MERGE_KEY
|
240826
240826
|
};
|
240827
|
-
var isMergeKey = (ctx,
|
240827
|
+
var isMergeKey = (ctx, key5) => (merge7.identify(key5) || identity2.isScalar(key5) && (!key5.type || key5.type === Scalar.Scalar.PLAIN) && merge7.identify(key5.value)) && ctx?.doc.schema.tags.some((tag) => tag.tag === merge7.tag && tag.default);
|
240828
240828
|
function addMergeToJSMap(ctx, map7, value4) {
|
240829
240829
|
value4 = ctx && identity2.isAlias(value4) ? value4.resolve(ctx.doc) : value4;
|
240830
240830
|
if (identity2.isSeq(value4))
|
@@ -240841,14 +240841,14 @@ var require_merge = __commonJS((exports) => {
|
|
240841
240841
|
if (!identity2.isMap(source))
|
240842
240842
|
throw new Error("Merge sources must be maps or map aliases");
|
240843
240843
|
const srcMap = source.toJSON(null, ctx, Map);
|
240844
|
-
for (const [
|
240844
|
+
for (const [key5, value5] of srcMap) {
|
240845
240845
|
if (map7 instanceof Map) {
|
240846
|
-
if (!map7.has(
|
240847
|
-
map7.set(
|
240846
|
+
if (!map7.has(key5))
|
240847
|
+
map7.set(key5, value5);
|
240848
240848
|
} else if (map7 instanceof Set) {
|
240849
|
-
map7.add(
|
240850
|
-
} else if (!Object.prototype.hasOwnProperty.call(map7,
|
240851
|
-
Object.defineProperty(map7,
|
240849
|
+
map7.add(key5);
|
240850
|
+
} else if (!Object.prototype.hasOwnProperty.call(map7, key5)) {
|
240851
|
+
Object.defineProperty(map7, key5, {
|
240852
240852
|
value: value5,
|
240853
240853
|
writable: true,
|
240854
240854
|
enumerable: true,
|
@@ -240870,19 +240870,19 @@ var require_addPairToJSMap = __commonJS((exports) => {
|
|
240870
240870
|
var stringify5 = require_stringify();
|
240871
240871
|
var identity2 = require_identity();
|
240872
240872
|
var toJS = require_toJS();
|
240873
|
-
function addPairToJSMap(ctx, map7, { key:
|
240874
|
-
if (identity2.isNode(
|
240875
|
-
|
240876
|
-
else if (merge7.isMergeKey(ctx,
|
240873
|
+
function addPairToJSMap(ctx, map7, { key: key5, value: value4 }) {
|
240874
|
+
if (identity2.isNode(key5) && key5.addToJSMap)
|
240875
|
+
key5.addToJSMap(ctx, map7, value4);
|
240876
|
+
else if (merge7.isMergeKey(ctx, key5))
|
240877
240877
|
merge7.addMergeToJSMap(ctx, map7, value4);
|
240878
240878
|
else {
|
240879
|
-
const jsKey = toJS.toJS(
|
240879
|
+
const jsKey = toJS.toJS(key5, "", ctx);
|
240880
240880
|
if (map7 instanceof Map) {
|
240881
240881
|
map7.set(jsKey, toJS.toJS(value4, jsKey, ctx));
|
240882
240882
|
} else if (map7 instanceof Set) {
|
240883
240883
|
map7.add(jsKey);
|
240884
240884
|
} else {
|
240885
|
-
const stringKey = stringifyKey(
|
240885
|
+
const stringKey = stringifyKey(key5, jsKey, ctx);
|
240886
240886
|
const jsValue = toJS.toJS(value4, stringKey, ctx);
|
240887
240887
|
if (stringKey in map7)
|
240888
240888
|
Object.defineProperty(map7, stringKey, {
|
@@ -240897,19 +240897,19 @@ var require_addPairToJSMap = __commonJS((exports) => {
|
|
240897
240897
|
}
|
240898
240898
|
return map7;
|
240899
240899
|
}
|
240900
|
-
function stringifyKey(
|
240900
|
+
function stringifyKey(key5, jsKey, ctx) {
|
240901
240901
|
if (jsKey === null)
|
240902
240902
|
return "";
|
240903
240903
|
if (typeof jsKey !== "object")
|
240904
240904
|
return String(jsKey);
|
240905
|
-
if (identity2.isNode(
|
240905
|
+
if (identity2.isNode(key5) && ctx?.doc) {
|
240906
240906
|
const strCtx = stringify5.createStringifyContext(ctx.doc, {});
|
240907
240907
|
strCtx.anchors = new Set;
|
240908
240908
|
for (const node of ctx.anchors.keys())
|
240909
240909
|
strCtx.anchors.add(node.anchor);
|
240910
240910
|
strCtx.inFlow = true;
|
240911
240911
|
strCtx.inStringifyKey = true;
|
240912
|
-
const strKey =
|
240912
|
+
const strKey = key5.toString(strCtx);
|
240913
240913
|
if (!ctx.mapKeyWarned) {
|
240914
240914
|
let jsonStr = JSON.stringify(strKey);
|
240915
240915
|
if (jsonStr.length > 40)
|
@@ -240930,25 +240930,25 @@ var require_Pair = __commonJS((exports) => {
|
|
240930
240930
|
var stringifyPair2 = require_stringifyPair();
|
240931
240931
|
var addPairToJSMap = require_addPairToJSMap();
|
240932
240932
|
var identity2 = require_identity();
|
240933
|
-
function createPair(
|
240934
|
-
const k6 = createNode.createNode(
|
240933
|
+
function createPair(key5, value4, ctx) {
|
240934
|
+
const k6 = createNode.createNode(key5, undefined, ctx);
|
240935
240935
|
const v7 = createNode.createNode(value4, undefined, ctx);
|
240936
240936
|
return new Pair(k6, v7);
|
240937
240937
|
}
|
240938
240938
|
|
240939
240939
|
class Pair {
|
240940
|
-
constructor(
|
240940
|
+
constructor(key5, value4 = null) {
|
240941
240941
|
Object.defineProperty(this, identity2.NODE_TYPE, { value: identity2.PAIR });
|
240942
|
-
this.key =
|
240942
|
+
this.key = key5;
|
240943
240943
|
this.value = value4;
|
240944
240944
|
}
|
240945
240945
|
clone(schema) {
|
240946
|
-
let { key:
|
240947
|
-
if (identity2.isNode(
|
240948
|
-
|
240946
|
+
let { key: key5, value: value4 } = this;
|
240947
|
+
if (identity2.isNode(key5))
|
240948
|
+
key5 = key5.clone(schema);
|
240949
240949
|
if (identity2.isNode(value4))
|
240950
240950
|
value4 = value4.clone(schema);
|
240951
|
-
return new Pair(
|
240951
|
+
return new Pair(key5, value4);
|
240952
240952
|
}
|
240953
240953
|
toJSON(_6, ctx) {
|
240954
240954
|
const pair = ctx?.mapAsMap ? new Map : {};
|
@@ -241115,11 +241115,11 @@ var require_YAMLMap = __commonJS((exports) => {
|
|
241115
241115
|
var identity2 = require_identity();
|
241116
241116
|
var Pair = require_Pair();
|
241117
241117
|
var Scalar = require_Scalar();
|
241118
|
-
function findPair(items,
|
241119
|
-
const k6 = identity2.isScalar(
|
241118
|
+
function findPair(items, key5) {
|
241119
|
+
const k6 = identity2.isScalar(key5) ? key5.value : key5;
|
241120
241120
|
for (const it2 of items) {
|
241121
241121
|
if (identity2.isPair(it2)) {
|
241122
|
-
if (it2.key ===
|
241122
|
+
if (it2.key === key5 || it2.key === k6)
|
241123
241123
|
return it2;
|
241124
241124
|
if (identity2.isScalar(it2.key) && it2.key.value === k6)
|
241125
241125
|
return it2;
|
@@ -241139,20 +241139,20 @@ var require_YAMLMap = __commonJS((exports) => {
|
|
241139
241139
|
static from(schema, obj, ctx) {
|
241140
241140
|
const { keepUndefined, replacer } = ctx;
|
241141
241141
|
const map7 = new this(schema);
|
241142
|
-
const add = (
|
241142
|
+
const add = (key5, value4) => {
|
241143
241143
|
if (typeof replacer === "function")
|
241144
|
-
value4 = replacer.call(obj,
|
241145
|
-
else if (Array.isArray(replacer) && !replacer.includes(
|
241144
|
+
value4 = replacer.call(obj, key5, value4);
|
241145
|
+
else if (Array.isArray(replacer) && !replacer.includes(key5))
|
241146
241146
|
return;
|
241147
241147
|
if (value4 !== undefined || keepUndefined)
|
241148
|
-
map7.items.push(Pair.createPair(
|
241148
|
+
map7.items.push(Pair.createPair(key5, value4, ctx));
|
241149
241149
|
};
|
241150
241150
|
if (obj instanceof Map) {
|
241151
|
-
for (const [
|
241152
|
-
add(
|
241151
|
+
for (const [key5, value4] of obj)
|
241152
|
+
add(key5, value4);
|
241153
241153
|
} else if (obj && typeof obj === "object") {
|
241154
|
-
for (const
|
241155
|
-
add(
|
241154
|
+
for (const key5 of Object.keys(obj))
|
241155
|
+
add(key5, obj[key5]);
|
241156
241156
|
}
|
241157
241157
|
if (typeof schema.sortMapEntries === "function") {
|
241158
241158
|
map7.items.sort(schema.sortMapEntries);
|
@@ -241186,23 +241186,23 @@ var require_YAMLMap = __commonJS((exports) => {
|
|
241186
241186
|
this.items.push(_pair);
|
241187
241187
|
}
|
241188
241188
|
}
|
241189
|
-
delete(
|
241190
|
-
const it2 = findPair(this.items,
|
241189
|
+
delete(key5) {
|
241190
|
+
const it2 = findPair(this.items, key5);
|
241191
241191
|
if (!it2)
|
241192
241192
|
return false;
|
241193
241193
|
const del = this.items.splice(this.items.indexOf(it2), 1);
|
241194
241194
|
return del.length > 0;
|
241195
241195
|
}
|
241196
|
-
get(
|
241197
|
-
const it2 = findPair(this.items,
|
241196
|
+
get(key5, keepScalar) {
|
241197
|
+
const it2 = findPair(this.items, key5);
|
241198
241198
|
const node = it2?.value;
|
241199
241199
|
return (!keepScalar && identity2.isScalar(node) ? node.value : node) ?? undefined;
|
241200
241200
|
}
|
241201
|
-
has(
|
241202
|
-
return !!findPair(this.items,
|
241201
|
+
has(key5) {
|
241202
|
+
return !!findPair(this.items, key5);
|
241203
241203
|
}
|
241204
|
-
set(
|
241205
|
-
this.add(new Pair.Pair(
|
241204
|
+
set(key5, value4) {
|
241205
|
+
this.add(new Pair.Pair(key5, value4), true);
|
241206
241206
|
}
|
241207
241207
|
toJSON(_6, ctx, Type) {
|
241208
241208
|
const map7 = Type ? new Type : ctx?.mapAsMap ? new Map : {};
|
@@ -241273,28 +241273,28 @@ var require_YAMLSeq = __commonJS((exports) => {
|
|
241273
241273
|
add(value4) {
|
241274
241274
|
this.items.push(value4);
|
241275
241275
|
}
|
241276
|
-
delete(
|
241277
|
-
const idx = asItemIndex(
|
241276
|
+
delete(key5) {
|
241277
|
+
const idx = asItemIndex(key5);
|
241278
241278
|
if (typeof idx !== "number")
|
241279
241279
|
return false;
|
241280
241280
|
const del = this.items.splice(idx, 1);
|
241281
241281
|
return del.length > 0;
|
241282
241282
|
}
|
241283
|
-
get(
|
241284
|
-
const idx = asItemIndex(
|
241283
|
+
get(key5, keepScalar) {
|
241284
|
+
const idx = asItemIndex(key5);
|
241285
241285
|
if (typeof idx !== "number")
|
241286
241286
|
return;
|
241287
241287
|
const it2 = this.items[idx];
|
241288
241288
|
return !keepScalar && identity2.isScalar(it2) ? it2.value : it2;
|
241289
241289
|
}
|
241290
|
-
has(
|
241291
|
-
const idx = asItemIndex(
|
241290
|
+
has(key5) {
|
241291
|
+
const idx = asItemIndex(key5);
|
241292
241292
|
return typeof idx === "number" && idx < this.items.length;
|
241293
241293
|
}
|
241294
|
-
set(
|
241295
|
-
const idx = asItemIndex(
|
241294
|
+
set(key5, value4) {
|
241295
|
+
const idx = asItemIndex(key5);
|
241296
241296
|
if (typeof idx !== "number")
|
241297
|
-
throw new Error(`Expected a valid index, not ${
|
241297
|
+
throw new Error(`Expected a valid index, not ${key5}.`);
|
241298
241298
|
const prev = this.items[idx];
|
241299
241299
|
if (identity2.isScalar(prev) && Scalar.isScalarValue(value4))
|
241300
241300
|
prev.value = value4;
|
@@ -241328,8 +241328,8 @@ var require_YAMLSeq = __commonJS((exports) => {
|
|
241328
241328
|
let i7 = 0;
|
241329
241329
|
for (let it2 of obj) {
|
241330
241330
|
if (typeof replacer === "function") {
|
241331
|
-
const
|
241332
|
-
it2 = replacer.call(obj,
|
241331
|
+
const key5 = obj instanceof Set ? it2 : String(i7++);
|
241332
|
+
it2 = replacer.call(obj, key5, it2);
|
241333
241333
|
}
|
241334
241334
|
seq.items.push(createNode.createNode(it2, undefined, ctx));
|
241335
241335
|
}
|
@@ -241337,8 +241337,8 @@ var require_YAMLSeq = __commonJS((exports) => {
|
|
241337
241337
|
return seq;
|
241338
241338
|
}
|
241339
241339
|
}
|
241340
|
-
function asItemIndex(
|
241341
|
-
let idx = identity2.isScalar(
|
241340
|
+
function asItemIndex(key5) {
|
241341
|
+
let idx = identity2.isScalar(key5) ? key5.value : key5;
|
241342
241342
|
if (idx && typeof idx === "string")
|
241343
241343
|
idx = Number(idx);
|
241344
241344
|
return typeof idx === "number" && Number.isInteger(idx) && idx >= 0 ? idx : null;
|
@@ -241711,25 +241711,25 @@ ${cn.comment}` : item.comment;
|
|
241711
241711
|
for (let it2 of iterable) {
|
241712
241712
|
if (typeof replacer === "function")
|
241713
241713
|
it2 = replacer.call(iterable, String(i7++), it2);
|
241714
|
-
let
|
241714
|
+
let key5, value4;
|
241715
241715
|
if (Array.isArray(it2)) {
|
241716
241716
|
if (it2.length === 2) {
|
241717
|
-
|
241717
|
+
key5 = it2[0];
|
241718
241718
|
value4 = it2[1];
|
241719
241719
|
} else
|
241720
241720
|
throw new TypeError(`Expected [key, value] tuple: ${it2}`);
|
241721
241721
|
} else if (it2 && it2 instanceof Object) {
|
241722
241722
|
const keys = Object.keys(it2);
|
241723
241723
|
if (keys.length === 1) {
|
241724
|
-
|
241725
|
-
value4 = it2[
|
241724
|
+
key5 = keys[0];
|
241725
|
+
value4 = it2[key5];
|
241726
241726
|
} else {
|
241727
241727
|
throw new TypeError(`Expected tuple with one key, not ${keys.length} keys`);
|
241728
241728
|
}
|
241729
241729
|
} else {
|
241730
|
-
|
241730
|
+
key5 = it2;
|
241731
241731
|
}
|
241732
|
-
pairs2.items.push(Pair.createPair(
|
241732
|
+
pairs2.items.push(Pair.createPair(key5, value4, ctx));
|
241733
241733
|
}
|
241734
241734
|
return pairs2;
|
241735
241735
|
}
|
@@ -241770,16 +241770,16 @@ var require_omap = __commonJS((exports) => {
|
|
241770
241770
|
if (ctx?.onCreate)
|
241771
241771
|
ctx.onCreate(map7);
|
241772
241772
|
for (const pair of this.items) {
|
241773
|
-
let
|
241773
|
+
let key5, value4;
|
241774
241774
|
if (identity2.isPair(pair)) {
|
241775
|
-
|
241776
|
-
value4 = toJS.toJS(pair.value,
|
241775
|
+
key5 = toJS.toJS(pair.key, "", ctx);
|
241776
|
+
value4 = toJS.toJS(pair.value, key5, ctx);
|
241777
241777
|
} else {
|
241778
|
-
|
241778
|
+
key5 = toJS.toJS(pair, "", ctx);
|
241779
241779
|
}
|
241780
|
-
if (map7.has(
|
241780
|
+
if (map7.has(key5))
|
241781
241781
|
throw new Error("Ordered maps must not include duplicate keys");
|
241782
|
-
map7.set(
|
241782
|
+
map7.set(key5, value4);
|
241783
241783
|
}
|
241784
241784
|
return map7;
|
241785
241785
|
}
|
@@ -241800,12 +241800,12 @@ var require_omap = __commonJS((exports) => {
|
|
241800
241800
|
resolve(seq, onError) {
|
241801
241801
|
const pairs$1 = pairs.resolvePairs(seq, onError);
|
241802
241802
|
const seenKeys = [];
|
241803
|
-
for (const { key:
|
241804
|
-
if (identity2.isScalar(
|
241805
|
-
if (seenKeys.includes(
|
241806
|
-
onError(`Ordered maps must not include duplicate keys: ${
|
241803
|
+
for (const { key: key5 } of pairs$1.items) {
|
241804
|
+
if (identity2.isScalar(key5)) {
|
241805
|
+
if (seenKeys.includes(key5.value)) {
|
241806
|
+
onError(`Ordered maps must not include duplicate keys: ${key5.value}`);
|
241807
241807
|
} else {
|
241808
|
-
seenKeys.push(
|
241808
|
+
seenKeys.push(key5.value);
|
241809
241809
|
}
|
241810
241810
|
}
|
241811
241811
|
}
|
@@ -241979,30 +241979,30 @@ var require_set = __commonJS((exports) => {
|
|
241979
241979
|
super(schema);
|
241980
241980
|
this.tag = YAMLSet.tag;
|
241981
241981
|
}
|
241982
|
-
add(
|
241982
|
+
add(key5) {
|
241983
241983
|
let pair;
|
241984
|
-
if (identity2.isPair(
|
241985
|
-
pair =
|
241986
|
-
else if (
|
241987
|
-
pair = new Pair.Pair(
|
241984
|
+
if (identity2.isPair(key5))
|
241985
|
+
pair = key5;
|
241986
|
+
else if (key5 && typeof key5 === "object" && "key" in key5 && "value" in key5 && key5.value === null)
|
241987
|
+
pair = new Pair.Pair(key5.key, null);
|
241988
241988
|
else
|
241989
|
-
pair = new Pair.Pair(
|
241989
|
+
pair = new Pair.Pair(key5, null);
|
241990
241990
|
const prev = YAMLMap.findPair(this.items, pair.key);
|
241991
241991
|
if (!prev)
|
241992
241992
|
this.items.push(pair);
|
241993
241993
|
}
|
241994
|
-
get(
|
241995
|
-
const pair = YAMLMap.findPair(this.items,
|
241994
|
+
get(key5, keepPair) {
|
241995
|
+
const pair = YAMLMap.findPair(this.items, key5);
|
241996
241996
|
return !keepPair && identity2.isPair(pair) ? identity2.isScalar(pair.key) ? pair.key.value : pair.key : pair;
|
241997
241997
|
}
|
241998
|
-
set(
|
241998
|
+
set(key5, value4) {
|
241999
241999
|
if (typeof value4 !== "boolean")
|
242000
242000
|
throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof value4}`);
|
242001
|
-
const prev = YAMLMap.findPair(this.items,
|
242001
|
+
const prev = YAMLMap.findPair(this.items, key5);
|
242002
242002
|
if (prev && !value4) {
|
242003
242003
|
this.items.splice(this.items.indexOf(prev), 1);
|
242004
242004
|
} else if (!prev && value4) {
|
242005
|
-
this.items.push(new Pair.Pair(
|
242005
|
+
this.items.push(new Pair.Pair(key5));
|
242006
242006
|
}
|
242007
242007
|
}
|
242008
242008
|
toJSON(_6, ctx) {
|
@@ -242237,7 +242237,7 @@ var require_tags = __commonJS((exports) => {
|
|
242237
242237
|
if (Array.isArray(customTags))
|
242238
242238
|
tags = [];
|
242239
242239
|
else {
|
242240
|
-
const keys = Array.from(schemas3.keys()).filter((
|
242240
|
+
const keys = Array.from(schemas3.keys()).filter((key5) => key5 !== "yaml11").map((key5) => JSON.stringify(key5)).join(", ");
|
242241
242241
|
throw new Error(`Unknown schema "${schemaName}"; use one of ${keys} or define customTags array`);
|
242242
242242
|
}
|
242243
242243
|
}
|
@@ -242253,7 +242253,7 @@ var require_tags = __commonJS((exports) => {
|
|
242253
242253
|
const tagObj = typeof tag === "string" ? tagsByName[tag] : tag;
|
242254
242254
|
if (!tagObj) {
|
242255
242255
|
const tagName = JSON.stringify(tag);
|
242256
|
-
const keys = Object.keys(tagsByName).map((
|
242256
|
+
const keys = Object.keys(tagsByName).map((key5) => JSON.stringify(key5)).join(", ");
|
242257
242257
|
throw new Error(`Unknown custom tag ${tagName}; use one of ${keys}`);
|
242258
242258
|
}
|
242259
242259
|
if (!tags2.includes(tagObj))
|
@@ -242488,13 +242488,13 @@ var require_Document = __commonJS((exports) => {
|
|
242488
242488
|
setAnchors();
|
242489
242489
|
return node;
|
242490
242490
|
}
|
242491
|
-
createPair(
|
242492
|
-
const k6 = this.createNode(
|
242491
|
+
createPair(key5, value4, options = {}) {
|
242492
|
+
const k6 = this.createNode(key5, null, options);
|
242493
242493
|
const v7 = this.createNode(value4, null, options);
|
242494
242494
|
return new Pair.Pair(k6, v7);
|
242495
242495
|
}
|
242496
|
-
delete(
|
242497
|
-
return assertCollection(this.contents) ? this.contents.delete(
|
242496
|
+
delete(key5) {
|
242497
|
+
return assertCollection(this.contents) ? this.contents.delete(key5) : false;
|
242498
242498
|
}
|
242499
242499
|
deleteIn(path7) {
|
242500
242500
|
if (Collection.isEmptyPath(path7)) {
|
@@ -242505,27 +242505,27 @@ var require_Document = __commonJS((exports) => {
|
|
242505
242505
|
}
|
242506
242506
|
return assertCollection(this.contents) ? this.contents.deleteIn(path7) : false;
|
242507
242507
|
}
|
242508
|
-
get(
|
242509
|
-
return identity2.isCollection(this.contents) ? this.contents.get(
|
242508
|
+
get(key5, keepScalar) {
|
242509
|
+
return identity2.isCollection(this.contents) ? this.contents.get(key5, keepScalar) : undefined;
|
242510
242510
|
}
|
242511
242511
|
getIn(path7, keepScalar) {
|
242512
242512
|
if (Collection.isEmptyPath(path7))
|
242513
242513
|
return !keepScalar && identity2.isScalar(this.contents) ? this.contents.value : this.contents;
|
242514
242514
|
return identity2.isCollection(this.contents) ? this.contents.getIn(path7, keepScalar) : undefined;
|
242515
242515
|
}
|
242516
|
-
has(
|
242517
|
-
return identity2.isCollection(this.contents) ? this.contents.has(
|
242516
|
+
has(key5) {
|
242517
|
+
return identity2.isCollection(this.contents) ? this.contents.has(key5) : false;
|
242518
242518
|
}
|
242519
242519
|
hasIn(path7) {
|
242520
242520
|
if (Collection.isEmptyPath(path7))
|
242521
242521
|
return this.contents !== undefined;
|
242522
242522
|
return identity2.isCollection(this.contents) ? this.contents.hasIn(path7) : false;
|
242523
242523
|
}
|
242524
|
-
set(
|
242524
|
+
set(key5, value4) {
|
242525
242525
|
if (this.contents == null) {
|
242526
|
-
this.contents = Collection.collectionFromPath(this.schema, [
|
242526
|
+
this.contents = Collection.collectionFromPath(this.schema, [key5], value4);
|
242527
242527
|
} else if (assertCollection(this.contents)) {
|
242528
|
-
this.contents.set(
|
242528
|
+
this.contents.set(key5, value4);
|
242529
242529
|
}
|
242530
242530
|
}
|
242531
242531
|
setIn(path7, value4) {
|
@@ -242807,25 +242807,25 @@ var require_resolve_props = __commonJS((exports) => {
|
|
242807
242807
|
|
242808
242808
|
// ../../node_modules/yaml/dist/compose/util-contains-newline.js
|
242809
242809
|
var require_util_contains_newline = __commonJS((exports) => {
|
242810
|
-
function containsNewline(
|
242811
|
-
if (!
|
242810
|
+
function containsNewline(key5) {
|
242811
|
+
if (!key5)
|
242812
242812
|
return null;
|
242813
|
-
switch (
|
242813
|
+
switch (key5.type) {
|
242814
242814
|
case "alias":
|
242815
242815
|
case "scalar":
|
242816
242816
|
case "double-quoted-scalar":
|
242817
242817
|
case "single-quoted-scalar":
|
242818
|
-
if (
|
242818
|
+
if (key5.source.includes(`
|
242819
242819
|
`))
|
242820
242820
|
return true;
|
242821
|
-
if (
|
242822
|
-
for (const st2 of
|
242821
|
+
if (key5.end) {
|
242822
|
+
for (const st2 of key5.end)
|
242823
242823
|
if (st2.type === "newline")
|
242824
242824
|
return true;
|
242825
242825
|
}
|
242826
242826
|
return false;
|
242827
242827
|
case "flow-collection":
|
242828
|
-
for (const it2 of
|
242828
|
+
for (const it2 of key5.items) {
|
242829
242829
|
for (const st2 of it2.start)
|
242830
242830
|
if (st2.type === "newline")
|
242831
242831
|
return true;
|
@@ -242890,10 +242890,10 @@ var require_resolve_block_map = __commonJS((exports) => {
|
|
242890
242890
|
let offset = bm.offset;
|
242891
242891
|
let commentEnd = null;
|
242892
242892
|
for (const collItem of bm.items) {
|
242893
|
-
const { start: start3, key:
|
242893
|
+
const { start: start3, key: key5, sep: sep5, value: value4 } = collItem;
|
242894
242894
|
const keyProps = resolveProps.resolveProps(start3, {
|
242895
242895
|
indicator: "explicit-key-ind",
|
242896
|
-
next:
|
242896
|
+
next: key5 ?? sep5?.[0],
|
242897
242897
|
offset,
|
242898
242898
|
onError,
|
242899
242899
|
parentIndent: bm.indent,
|
@@ -242901,10 +242901,10 @@ var require_resolve_block_map = __commonJS((exports) => {
|
|
242901
242901
|
});
|
242902
242902
|
const implicitKey = !keyProps.found;
|
242903
242903
|
if (implicitKey) {
|
242904
|
-
if (
|
242905
|
-
if (
|
242904
|
+
if (key5) {
|
242905
|
+
if (key5.type === "block-seq")
|
242906
242906
|
onError(offset, "BLOCK_AS_IMPLICIT_KEY", "A block sequence may not be used as an implicit map key");
|
242907
|
-
else if ("indent" in
|
242907
|
+
else if ("indent" in key5 && key5.indent !== bm.indent)
|
242908
242908
|
onError(offset, "BAD_INDENT", startColMsg);
|
242909
242909
|
}
|
242910
242910
|
if (!keyProps.anchor && !keyProps.tag && !sep5) {
|
@@ -242918,17 +242918,17 @@ var require_resolve_block_map = __commonJS((exports) => {
|
|
242918
242918
|
}
|
242919
242919
|
continue;
|
242920
242920
|
}
|
242921
|
-
if (keyProps.newlineAfterProp || utilContainsNewline.containsNewline(
|
242922
|
-
onError(
|
242921
|
+
if (keyProps.newlineAfterProp || utilContainsNewline.containsNewline(key5)) {
|
242922
|
+
onError(key5 ?? start3[start3.length - 1], "MULTILINE_IMPLICIT_KEY", "Implicit keys need to be on a single line");
|
242923
242923
|
}
|
242924
242924
|
} else if (keyProps.found?.indent !== bm.indent) {
|
242925
242925
|
onError(offset, "BAD_INDENT", startColMsg);
|
242926
242926
|
}
|
242927
242927
|
ctx.atKey = true;
|
242928
242928
|
const keyStart = keyProps.end;
|
242929
|
-
const keyNode =
|
242929
|
+
const keyNode = key5 ? composeNode(ctx, key5, keyProps, onError) : composeEmptyNode(ctx, keyStart, start3, null, keyProps, onError);
|
242930
242930
|
if (ctx.schema.compat)
|
242931
|
-
utilFlowIndentCheck.flowIndentCheck(bm.indent,
|
242931
|
+
utilFlowIndentCheck.flowIndentCheck(bm.indent, key5, onError);
|
242932
242932
|
ctx.atKey = false;
|
242933
242933
|
if (utilMapIncludes.mapIncludes(ctx, map7.items, keyNode))
|
242934
242934
|
onError(keyStart, "DUPLICATE_KEY", "Map keys must be unique");
|
@@ -242938,7 +242938,7 @@ var require_resolve_block_map = __commonJS((exports) => {
|
|
242938
242938
|
offset: keyNode.range[2],
|
242939
242939
|
onError,
|
242940
242940
|
parentIndent: bm.indent,
|
242941
|
-
startOnNewline: !
|
242941
|
+
startOnNewline: !key5 || key5.type === "block-scalar"
|
242942
242942
|
});
|
242943
242943
|
offset = valueProps.end;
|
242944
242944
|
if (valueProps.found) {
|
@@ -243094,11 +243094,11 @@ var require_resolve_flow_collection = __commonJS((exports) => {
|
|
243094
243094
|
let offset = fc.offset + fc.start.source.length;
|
243095
243095
|
for (let i7 = 0;i7 < fc.items.length; ++i7) {
|
243096
243096
|
const collItem = fc.items[i7];
|
243097
|
-
const { start: start3, key:
|
243097
|
+
const { start: start3, key: key5, sep: sep5, value: value4 } = collItem;
|
243098
243098
|
const props = resolveProps.resolveProps(start3, {
|
243099
243099
|
flow: fcName,
|
243100
243100
|
indicator: "explicit-key-ind",
|
243101
|
-
next:
|
243101
|
+
next: key5 ?? sep5?.[0],
|
243102
243102
|
offset,
|
243103
243103
|
onError,
|
243104
243104
|
parentIndent: fc.indent,
|
@@ -243120,8 +243120,8 @@ var require_resolve_flow_collection = __commonJS((exports) => {
|
|
243120
243120
|
offset = props.end;
|
243121
243121
|
continue;
|
243122
243122
|
}
|
243123
|
-
if (!isMap && ctx.options.strict && utilContainsNewline.containsNewline(
|
243124
|
-
onError(
|
243123
|
+
if (!isMap && ctx.options.strict && utilContainsNewline.containsNewline(key5))
|
243124
|
+
onError(key5, "MULTILINE_IMPLICIT_KEY", "Implicit keys of flow sequence pairs need to be on a single line");
|
243125
243125
|
}
|
243126
243126
|
if (i7 === 0) {
|
243127
243127
|
if (props.comma)
|
@@ -243166,8 +243166,8 @@ var require_resolve_flow_collection = __commonJS((exports) => {
|
|
243166
243166
|
} else {
|
243167
243167
|
ctx.atKey = true;
|
243168
243168
|
const keyStart = props.end;
|
243169
|
-
const keyNode =
|
243170
|
-
if (isBlock(
|
243169
|
+
const keyNode = key5 ? composeNode(ctx, key5, props, onError) : composeEmptyNode(ctx, keyStart, start3, null, props, onError);
|
243170
|
+
if (isBlock(key5))
|
243171
243171
|
onError(keyNode.range, "BLOCK_IN_FLOW", blockMsg);
|
243172
243172
|
ctx.atKey = false;
|
243173
243173
|
const valueProps = resolveProps.resolveProps(sep5 ?? [], {
|
@@ -243978,7 +243978,7 @@ var require_composer = __commonJS((exports) => {
|
|
243978
243978
|
var node_process = __require("process");
|
243979
243979
|
var directives4 = require_directives2();
|
243980
243980
|
var Document = require_Document();
|
243981
|
-
var
|
243981
|
+
var errors7 = require_errors3();
|
243982
243982
|
var identity2 = require_identity();
|
243983
243983
|
var composeDoc = require_compose_doc();
|
243984
243984
|
var resolveEnd = require_resolve_end();
|
@@ -244029,9 +244029,9 @@ var require_composer = __commonJS((exports) => {
|
|
244029
244029
|
this.onError = (source, code2, message, warning) => {
|
244030
244030
|
const pos = getErrorPos(source);
|
244031
244031
|
if (warning)
|
244032
|
-
this.warnings.push(new
|
244032
|
+
this.warnings.push(new errors7.YAMLWarning(pos, code2, message));
|
244033
244033
|
else
|
244034
|
-
this.errors.push(new
|
244034
|
+
this.errors.push(new errors7.YAMLParseError(pos, code2, message));
|
244035
244035
|
};
|
244036
244036
|
this.directives = new directives4.Directives({ version: options.version || "1.2" });
|
244037
244037
|
this.options = options;
|
@@ -244115,7 +244115,7 @@ ${cb}` : comment;
|
|
244115
244115
|
break;
|
244116
244116
|
case "error": {
|
244117
244117
|
const msg = token.source ? `${token.message}: ${JSON.stringify(token.source)}` : token.message;
|
244118
|
-
const error45 = new
|
244118
|
+
const error45 = new errors7.YAMLParseError(getErrorPos(token), "UNEXPECTED_TOKEN", msg);
|
244119
244119
|
if (this.atDirectives || !this.doc)
|
244120
244120
|
this.errors.push(error45);
|
244121
244121
|
else
|
@@ -244125,7 +244125,7 @@ ${cb}` : comment;
|
|
244125
244125
|
case "doc-end": {
|
244126
244126
|
if (!this.doc) {
|
244127
244127
|
const msg = "Unexpected doc-end without preceding document";
|
244128
|
-
this.errors.push(new
|
244128
|
+
this.errors.push(new errors7.YAMLParseError(getErrorPos(token), "UNEXPECTED_TOKEN", msg));
|
244129
244129
|
break;
|
244130
244130
|
}
|
244131
244131
|
this.doc.directives.docEnd = true;
|
@@ -244140,7 +244140,7 @@ ${end.comment}` : end.comment;
|
|
244140
244140
|
break;
|
244141
244141
|
}
|
244142
244142
|
default:
|
244143
|
-
this.errors.push(new
|
244143
|
+
this.errors.push(new errors7.YAMLParseError(getErrorPos(token), "UNEXPECTED_TOKEN", `Unsupported token ${token.type}`));
|
244144
244144
|
}
|
244145
244145
|
}
|
244146
244146
|
*end(forceDoc = false, endOffset = -1) {
|
@@ -244166,7 +244166,7 @@ ${end.comment}` : end.comment;
|
|
244166
244166
|
var require_cst_scalar = __commonJS((exports) => {
|
244167
244167
|
var resolveBlockScalar = require_resolve_block_scalar();
|
244168
244168
|
var resolveFlowScalar = require_resolve_flow_scalar();
|
244169
|
-
var
|
244169
|
+
var errors7 = require_errors3();
|
244170
244170
|
var stringifyString = require_stringifyString();
|
244171
244171
|
function resolveAsScalar(token, strict = true, onError) {
|
244172
244172
|
if (token) {
|
@@ -244175,7 +244175,7 @@ var require_cst_scalar = __commonJS((exports) => {
|
|
244175
244175
|
if (onError)
|
244176
244176
|
onError(offset, code2, message);
|
244177
244177
|
else
|
244178
|
-
throw new
|
244178
|
+
throw new errors7.YAMLParseError([offset, offset + 1], code2, message);
|
244179
244179
|
};
|
244180
244180
|
switch (token.type) {
|
244181
244181
|
case "scalar":
|
@@ -244289,9 +244289,9 @@ var require_cst_scalar = __commonJS((exports) => {
|
|
244289
244289
|
if (!addEndtoBlockProps(props, "end" in token ? token.end : undefined))
|
244290
244290
|
props.push({ type: "newline", offset: -1, indent: indent2, source: `
|
244291
244291
|
` });
|
244292
|
-
for (const
|
244293
|
-
if (
|
244294
|
-
delete token[
|
244292
|
+
for (const key5 of Object.keys(token))
|
244293
|
+
if (key5 !== "type" && key5 !== "offset")
|
244294
|
+
delete token[key5];
|
244295
244295
|
Object.assign(token, { type: "block-scalar", indent: indent2, props, source: body });
|
244296
244296
|
}
|
244297
244297
|
}
|
@@ -244340,9 +244340,9 @@ var require_cst_scalar = __commonJS((exports) => {
|
|
244340
244340
|
default: {
|
244341
244341
|
const indent2 = "indent" in token ? token.indent : -1;
|
244342
244342
|
const end = "end" in token && Array.isArray(token.end) ? token.end.filter((st2) => st2.type === "space" || st2.type === "comment" || st2.type === "newline") : [];
|
244343
|
-
for (const
|
244344
|
-
if (
|
244345
|
-
delete token[
|
244343
|
+
for (const key5 of Object.keys(token))
|
244344
|
+
if (key5 !== "type" && key5 !== "offset")
|
244345
|
+
delete token[key5];
|
244346
244346
|
Object.assign(token, { type: type4, indent: indent2, source, end });
|
244347
244347
|
}
|
244348
244348
|
}
|
@@ -244394,12 +244394,12 @@ var require_cst_stringify = __commonJS((exports) => {
|
|
244394
244394
|
}
|
244395
244395
|
}
|
244396
244396
|
}
|
244397
|
-
function stringifyItem({ start: start3, key:
|
244397
|
+
function stringifyItem({ start: start3, key: key5, sep: sep5, value: value4 }) {
|
244398
244398
|
let res = "";
|
244399
244399
|
for (const st2 of start3)
|
244400
244400
|
res += st2.source;
|
244401
|
-
if (
|
244402
|
-
res += stringifyToken(
|
244401
|
+
if (key5)
|
244402
|
+
res += stringifyToken(key5);
|
244403
244403
|
if (sep5)
|
244404
244404
|
for (const st2 of sep5)
|
244405
244405
|
res += st2.source;
|
@@ -245695,7 +245695,7 @@ var require_parser2 = __commonJS((exports) => {
|
|
245695
245695
|
});
|
245696
245696
|
} else if (isFlowToken(it2.key) && !includesToken(it2.sep, "newline")) {
|
245697
245697
|
const start4 = getFirstKeyStartProps(it2.start);
|
245698
|
-
const
|
245698
|
+
const key5 = it2.key;
|
245699
245699
|
const sep5 = it2.sep;
|
245700
245700
|
sep5.push(this.sourceToken);
|
245701
245701
|
delete it2.key;
|
@@ -245704,7 +245704,7 @@ var require_parser2 = __commonJS((exports) => {
|
|
245704
245704
|
type: "block-map",
|
245705
245705
|
offset: this.offset,
|
245706
245706
|
indent: this.indent,
|
245707
|
-
items: [{ start: start4, key:
|
245707
|
+
items: [{ start: start4, key: key5, sep: sep5 }]
|
245708
245708
|
});
|
245709
245709
|
} else if (start3.length > 0) {
|
245710
245710
|
it2.sep = it2.sep.concat(start3, this.sourceToken);
|
@@ -246037,7 +246037,7 @@ var require_parser2 = __commonJS((exports) => {
|
|
246037
246037
|
var require_public_api = __commonJS((exports) => {
|
246038
246038
|
var composer = require_composer();
|
246039
246039
|
var Document = require_Document();
|
246040
|
-
var
|
246040
|
+
var errors7 = require_errors3();
|
246041
246041
|
var log = require_log();
|
246042
246042
|
var identity2 = require_identity();
|
246043
246043
|
var lineCounter = require_line_counter();
|
@@ -246054,8 +246054,8 @@ var require_public_api = __commonJS((exports) => {
|
|
246054
246054
|
const docs = Array.from(composer$1.compose(parser$1.parse(source)));
|
246055
246055
|
if (prettyErrors && lineCounter2)
|
246056
246056
|
for (const doc2 of docs) {
|
246057
|
-
doc2.errors.forEach(
|
246058
|
-
doc2.warnings.forEach(
|
246057
|
+
doc2.errors.forEach(errors7.prettifyError(source, lineCounter2));
|
246058
|
+
doc2.warnings.forEach(errors7.prettifyError(source, lineCounter2));
|
246059
246059
|
}
|
246060
246060
|
if (docs.length > 0)
|
246061
246061
|
return docs;
|
@@ -246070,13 +246070,13 @@ var require_public_api = __commonJS((exports) => {
|
|
246070
246070
|
if (!doc2)
|
246071
246071
|
doc2 = _doc;
|
246072
246072
|
else if (doc2.options.logLevel !== "silent") {
|
246073
|
-
doc2.errors.push(new
|
246073
|
+
doc2.errors.push(new errors7.YAMLParseError(_doc.range.slice(0, 2), "MULTIPLE_DOCS", "Source contains multiple documents; please use YAML.parseAllDocuments()"));
|
246074
246074
|
break;
|
246075
246075
|
}
|
246076
246076
|
}
|
246077
246077
|
if (prettyErrors && lineCounter2) {
|
246078
|
-
doc2.errors.forEach(
|
246079
|
-
doc2.warnings.forEach(
|
246078
|
+
doc2.errors.forEach(errors7.prettifyError(source, lineCounter2));
|
246079
|
+
doc2.warnings.forEach(errors7.prettifyError(source, lineCounter2));
|
246080
246080
|
}
|
246081
246081
|
return doc2;
|
246082
246082
|
}
|
@@ -263840,7 +263840,7 @@ function pruneCurrentEnv(currentEnv, env2) {
|
|
263840
263840
|
var package_default = {
|
263841
263841
|
name: "@settlemint/sdk-cli",
|
263842
263842
|
description: "Command-line interface for SettleMint SDK, providing development tools and project management capabilities",
|
263843
|
-
version: "2.4.0-
|
263843
|
+
version: "2.4.0-prc1e1fd02",
|
263844
263844
|
type: "module",
|
263845
263845
|
private: false,
|
263846
263846
|
license: "FSL-1.1-MIT",
|
@@ -263887,14 +263887,14 @@ var package_default = {
|
|
263887
263887
|
devDependencies: {
|
263888
263888
|
"@commander-js/extra-typings": "14.0.0",
|
263889
263889
|
commander: "14.0.0",
|
263890
|
-
"@inquirer/confirm": "5.1.
|
263890
|
+
"@inquirer/confirm": "5.1.13",
|
263891
263891
|
"@inquirer/input": "4.1.12",
|
263892
263892
|
"@inquirer/password": "4.0.15",
|
263893
263893
|
"@inquirer/select": "4.2.3",
|
263894
|
-
"@settlemint/sdk-js": "2.4.0-
|
263895
|
-
"@settlemint/sdk-utils": "2.4.0-
|
263896
|
-
"@settlemint/sdk-viem": "2.4.0-
|
263897
|
-
"@types/node": "24.0.
|
263894
|
+
"@settlemint/sdk-js": "2.4.0-prc1e1fd02",
|
263895
|
+
"@settlemint/sdk-utils": "2.4.0-prc1e1fd02",
|
263896
|
+
"@settlemint/sdk-viem": "2.4.0-prc1e1fd02",
|
263897
|
+
"@types/node": "24.0.8",
|
263898
263898
|
"@types/semver": "7.7.0",
|
263899
263899
|
"@types/which": "3.0.4",
|
263900
263900
|
"get-tsconfig": "4.10.1",
|
@@ -263902,7 +263902,7 @@ var package_default = {
|
|
263902
263902
|
"is-in-ci": "1.0.0",
|
263903
263903
|
semver: "7.7.2",
|
263904
263904
|
slugify: "1.6.6",
|
263905
|
-
viem: "2.31.
|
263905
|
+
viem: "2.31.6",
|
263906
263906
|
which: "5.0.0",
|
263907
263907
|
yaml: "2.8.0",
|
263908
263908
|
yoctocolors: "2.1.1"
|
@@ -263983,10 +263983,6 @@ var {
|
|
263983
263983
|
} = import__.default;
|
263984
263984
|
|
263985
263985
|
// ../../node_modules/@inquirer/core/dist/esm/lib/key.js
|
263986
|
-
var isUpKey = (key) => key.name === "up" || key.name === "k" || key.ctrl && key.name === "p";
|
263987
|
-
var isDownKey = (key) => key.name === "down" || key.name === "j" || key.ctrl && key.name === "n";
|
263988
|
-
var isBackspaceKey = (key) => key.name === "backspace";
|
263989
|
-
var isNumberKey = (key) => "1234567890".includes(key.name);
|
263990
263986
|
var isEnterKey = (key) => key.name === "enter" || key.name === "return";
|
263991
263987
|
// ../../node_modules/@inquirer/core/dist/esm/lib/errors.js
|
263992
263988
|
class AbortPromptError extends Error {
|
@@ -264520,22 +264516,11 @@ function usePrefix({ status = "idle", theme }) {
|
|
264520
264516
|
const iconName = status === "loading" ? "idle" : status;
|
264521
264517
|
return typeof prefix === "string" ? prefix : prefix[iconName] ?? prefix["idle"];
|
264522
264518
|
}
|
264523
|
-
// ../../node_modules/@inquirer/core/dist/esm/lib/use-memo.js
|
264524
|
-
function useMemo(fn, dependencies) {
|
264525
|
-
return withPointer((pointer) => {
|
264526
|
-
const prev = pointer.get();
|
264527
|
-
if (!prev || prev.dependencies.length !== dependencies.length || prev.dependencies.some((dep, i) => dep !== dependencies[i])) {
|
264528
|
-
const value = fn();
|
264529
|
-
pointer.set({ value, dependencies });
|
264530
|
-
return value;
|
264531
|
-
}
|
264532
|
-
return prev.value;
|
264533
|
-
});
|
264534
|
-
}
|
264535
264519
|
// ../../node_modules/@inquirer/core/dist/esm/lib/use-ref.js
|
264536
264520
|
function useRef(val) {
|
264537
264521
|
return useState({ current: val })[0];
|
264538
264522
|
}
|
264523
|
+
|
264539
264524
|
// ../../node_modules/@inquirer/core/dist/esm/lib/use-keypress.js
|
264540
264525
|
function useKeypress(userHandler) {
|
264541
264526
|
const signal = useRef(userHandler);
|
@@ -264567,72 +264552,6 @@ function readlineWidth() {
|
|
264567
264552
|
return import_cli_width.default({ defaultWidth: 80, output: readline().output });
|
264568
264553
|
}
|
264569
264554
|
|
264570
|
-
// ../../node_modules/@inquirer/core/dist/esm/lib/pagination/use-pagination.js
|
264571
|
-
function usePointerPosition({ active, renderedItems, pageSize, loop }) {
|
264572
|
-
const state = useRef({
|
264573
|
-
lastPointer: active,
|
264574
|
-
lastActive: undefined
|
264575
|
-
});
|
264576
|
-
const { lastPointer, lastActive } = state.current;
|
264577
|
-
const middle = Math.floor(pageSize / 2);
|
264578
|
-
const renderedLength = renderedItems.reduce((acc, item) => acc + item.length, 0);
|
264579
|
-
const defaultPointerPosition = renderedItems.slice(0, active).reduce((acc, item) => acc + item.length, 0);
|
264580
|
-
let pointer = defaultPointerPosition;
|
264581
|
-
if (renderedLength > pageSize) {
|
264582
|
-
if (loop) {
|
264583
|
-
pointer = lastPointer;
|
264584
|
-
if (lastActive != null && lastActive < active && active - lastActive < pageSize) {
|
264585
|
-
pointer = Math.min(middle, Math.abs(active - lastActive) === 1 ? Math.min(lastPointer + (renderedItems[lastActive]?.length ?? 0), Math.max(defaultPointerPosition, lastPointer)) : lastPointer + active - lastActive);
|
264586
|
-
}
|
264587
|
-
} else {
|
264588
|
-
const spaceUnderActive = renderedItems.slice(active).reduce((acc, item) => acc + item.length, 0);
|
264589
|
-
pointer = spaceUnderActive < pageSize - middle ? pageSize - spaceUnderActive : Math.min(defaultPointerPosition, middle);
|
264590
|
-
}
|
264591
|
-
}
|
264592
|
-
state.current.lastPointer = pointer;
|
264593
|
-
state.current.lastActive = active;
|
264594
|
-
return pointer;
|
264595
|
-
}
|
264596
|
-
function usePagination({ items, active, renderItem, pageSize, loop = true }) {
|
264597
|
-
const width = readlineWidth();
|
264598
|
-
const bound = (num) => (num % items.length + items.length) % items.length;
|
264599
|
-
const renderedItems = items.map((item, index) => {
|
264600
|
-
if (item == null)
|
264601
|
-
return [];
|
264602
|
-
return breakLines(renderItem({ item, index, isActive: index === active }), width).split(`
|
264603
|
-
`);
|
264604
|
-
});
|
264605
|
-
const renderedLength = renderedItems.reduce((acc, item) => acc + item.length, 0);
|
264606
|
-
const renderItemAtIndex = (index) => renderedItems[index] ?? [];
|
264607
|
-
const pointer = usePointerPosition({ active, renderedItems, pageSize, loop });
|
264608
|
-
const activeItem = renderItemAtIndex(active).slice(0, pageSize);
|
264609
|
-
const activeItemPosition = pointer + activeItem.length <= pageSize ? pointer : pageSize - activeItem.length;
|
264610
|
-
const pageBuffer = Array.from({ length: pageSize });
|
264611
|
-
pageBuffer.splice(activeItemPosition, activeItem.length, ...activeItem);
|
264612
|
-
const itemVisited = new Set([active]);
|
264613
|
-
let bufferPointer = activeItemPosition + activeItem.length;
|
264614
|
-
let itemPointer = bound(active + 1);
|
264615
|
-
while (bufferPointer < pageSize && !itemVisited.has(itemPointer) && (loop && renderedLength > pageSize ? itemPointer !== active : itemPointer > active)) {
|
264616
|
-
const lines = renderItemAtIndex(itemPointer);
|
264617
|
-
const linesToAdd = lines.slice(0, pageSize - bufferPointer);
|
264618
|
-
pageBuffer.splice(bufferPointer, linesToAdd.length, ...linesToAdd);
|
264619
|
-
itemVisited.add(itemPointer);
|
264620
|
-
bufferPointer += linesToAdd.length;
|
264621
|
-
itemPointer = bound(itemPointer + 1);
|
264622
|
-
}
|
264623
|
-
bufferPointer = activeItemPosition - 1;
|
264624
|
-
itemPointer = bound(active - 1);
|
264625
|
-
while (bufferPointer >= 0 && !itemVisited.has(itemPointer) && (loop && renderedLength > pageSize ? itemPointer !== active : itemPointer < active)) {
|
264626
|
-
const lines = renderItemAtIndex(itemPointer);
|
264627
|
-
const linesToAdd = lines.slice(Math.max(0, lines.length - bufferPointer - 1));
|
264628
|
-
pageBuffer.splice(bufferPointer - linesToAdd.length + 1, linesToAdd.length, ...linesToAdd);
|
264629
|
-
itemVisited.add(itemPointer);
|
264630
|
-
bufferPointer -= linesToAdd.length;
|
264631
|
-
itemPointer = bound(itemPointer - 1);
|
264632
|
-
}
|
264633
|
-
return pageBuffer.filter((line) => typeof line === "string").join(`
|
264634
|
-
`);
|
264635
|
-
}
|
264636
264555
|
// ../../node_modules/@inquirer/core/dist/esm/lib/create-prompt.js
|
264637
264556
|
var import_mute_stream = __toESM(require_lib(), 1);
|
264638
264557
|
import * as readline2 from "node:readline";
|
@@ -265015,20 +264934,6 @@ function createPrompt(view) {
|
|
265015
264934
|
};
|
265016
264935
|
return prompt;
|
265017
264936
|
}
|
265018
|
-
// ../../node_modules/@inquirer/core/dist/esm/lib/Separator.js
|
265019
|
-
var import_yoctocolors_cjs2 = __toESM(require_yoctocolors_cjs(), 1);
|
265020
|
-
class Separator {
|
265021
|
-
separator = import_yoctocolors_cjs2.default.dim(Array.from({ length: 15 }).join(esm_default.line));
|
265022
|
-
type = "separator";
|
265023
|
-
constructor(separator) {
|
265024
|
-
if (separator) {
|
265025
|
-
this.separator = separator;
|
265026
|
-
}
|
265027
|
-
}
|
265028
|
-
static isSeparator(choice) {
|
265029
|
-
return Boolean(choice && typeof choice === "object" && "type" in choice && choice.type === "separator");
|
265030
|
-
}
|
265031
|
-
}
|
265032
264937
|
// ../utils/dist/terminal.js
|
265033
264938
|
import { spawn } from "node:child_process";
|
265034
264939
|
var import_console_table_printer2 = __toESM(require_dist2(), 1);
|
@@ -288291,6 +288196,20 @@ var restartBlockchainNetwork = graphql(`
|
|
288291
288196
|
}
|
288292
288197
|
}
|
288293
288198
|
`, [BlockchainNetworkFragment]);
|
288199
|
+
var pauseBlockchainNetwork = graphql(`
|
288200
|
+
mutation PauseBlockchainNetwork($uniqueName: String!) {
|
288201
|
+
pauseBlockchainNetworkByUniqueName(uniqueName: $uniqueName) {
|
288202
|
+
...BlockchainNetwork
|
288203
|
+
}
|
288204
|
+
}
|
288205
|
+
`, [BlockchainNetworkFragment]);
|
288206
|
+
var resumeBlockchainNetwork = graphql(`
|
288207
|
+
mutation ResumeBlockchainNetwork($uniqueName: String!) {
|
288208
|
+
resumeBlockchainNetworkByUniqueName(uniqueName: $uniqueName) {
|
288209
|
+
...BlockchainNetwork
|
288210
|
+
}
|
288211
|
+
}
|
288212
|
+
`, [BlockchainNetworkFragment]);
|
288294
288213
|
var blockchainNetworkList = (gqlClient) => {
|
288295
288214
|
return async (applicationUniqueName) => {
|
288296
288215
|
const { blockchainNetworksByUniqueName: { items } } = await gqlClient.request(getBlockchainNetworks, { applicationUniqueName });
|
@@ -288325,6 +288244,14 @@ var blockchainNetworkRestart = (gqlClient) => async (blockchainNetworkUniqueName
|
|
288325
288244
|
const { restartBlockchainNetworkByUniqueName: blockchainNetwork } = await gqlClient.request(restartBlockchainNetwork, { uniqueName: blockchainNetworkUniqueName });
|
288326
288245
|
return blockchainNetwork;
|
288327
288246
|
};
|
288247
|
+
var blockchainNetworkPause = (gqlClient) => async (blockchainNetworkUniqueName) => {
|
288248
|
+
const { pauseBlockchainNetworkByUniqueName: blockchainNetwork } = await gqlClient.request(pauseBlockchainNetwork, { uniqueName: blockchainNetworkUniqueName });
|
288249
|
+
return blockchainNetwork;
|
288250
|
+
};
|
288251
|
+
var blockchainNetworkResume = (gqlClient) => async (blockchainNetworkUniqueName) => {
|
288252
|
+
const { resumeBlockchainNetworkByUniqueName: blockchainNetwork } = await gqlClient.request(resumeBlockchainNetwork, { uniqueName: blockchainNetworkUniqueName });
|
288253
|
+
return blockchainNetwork;
|
288254
|
+
};
|
288328
288255
|
var BlockchainNodeFragment = graphql(`
|
288329
288256
|
fragment BlockchainNode on BlockchainNode {
|
288330
288257
|
__typename
|
@@ -288458,6 +288385,20 @@ var restartBlockchainNode = graphql(`
|
|
288458
288385
|
}
|
288459
288386
|
}
|
288460
288387
|
`, [BlockchainNodeFragment]);
|
288388
|
+
var pauseBlockchainNode = graphql(`
|
288389
|
+
mutation PauseBlockchainNode($uniqueName: String!) {
|
288390
|
+
pauseBlockchainNodeByUniqueName(uniqueName: $uniqueName) {
|
288391
|
+
...BlockchainNode
|
288392
|
+
}
|
288393
|
+
}
|
288394
|
+
`, [BlockchainNodeFragment]);
|
288395
|
+
var resumeBlockchainNode = graphql(`
|
288396
|
+
mutation ResumeBlockchainNode($uniqueName: String!) {
|
288397
|
+
resumeBlockchainNodeByUniqueName(uniqueName: $uniqueName) {
|
288398
|
+
...BlockchainNode
|
288399
|
+
}
|
288400
|
+
}
|
288401
|
+
`, [BlockchainNodeFragment]);
|
288461
288402
|
var blockchainNodeList = (gqlClient) => {
|
288462
288403
|
return async (applicationUniqueName) => {
|
288463
288404
|
const { blockchainNodesByUniqueName: { items } } = await gqlClient.request(getBlockchainNodes, { applicationUniqueName });
|
@@ -288486,6 +288427,14 @@ var blockchainNodeRestart = (gqlClient) => async (blockchainNodeUniqueName) => {
|
|
288486
288427
|
const { restartBlockchainNodeByUniqueName: blockchainNode } = await gqlClient.request(restartBlockchainNode, { uniqueName: blockchainNodeUniqueName });
|
288487
288428
|
return blockchainNode;
|
288488
288429
|
};
|
288430
|
+
var blockchainNodePause = (gqlClient) => async (blockchainNodeUniqueName) => {
|
288431
|
+
const { pauseBlockchainNodeByUniqueName: blockchainNode } = await gqlClient.request(pauseBlockchainNode, { uniqueName: blockchainNodeUniqueName });
|
288432
|
+
return blockchainNode;
|
288433
|
+
};
|
288434
|
+
var blockchainNodeResume = (gqlClient) => async (blockchainNodeUniqueName) => {
|
288435
|
+
const { resumeBlockchainNodeByUniqueName: blockchainNode } = await gqlClient.request(resumeBlockchainNode, { uniqueName: blockchainNodeUniqueName });
|
288436
|
+
return blockchainNode;
|
288437
|
+
};
|
288489
288438
|
var CustomDeploymentFragment = graphql(`
|
288490
288439
|
fragment CustomDeployment on CustomDeployment {
|
288491
288440
|
id
|
@@ -288568,6 +288517,20 @@ var restartCustomDeployment = graphql(`
|
|
288568
288517
|
}
|
288569
288518
|
}
|
288570
288519
|
`, [CustomDeploymentFragment]);
|
288520
|
+
var pauseCustomDeployment = graphql(`
|
288521
|
+
mutation PauseCustomDeployment($uniqueName: String!) {
|
288522
|
+
pauseCustomDeploymentByUniqueName(uniqueName: $uniqueName) {
|
288523
|
+
...CustomDeployment
|
288524
|
+
}
|
288525
|
+
}
|
288526
|
+
`, [CustomDeploymentFragment]);
|
288527
|
+
var resumeCustomDeployment = graphql(`
|
288528
|
+
mutation ResumeCustomDeployment($uniqueName: String!) {
|
288529
|
+
resumeCustomDeploymentByUniqueName(uniqueName: $uniqueName) {
|
288530
|
+
...CustomDeployment
|
288531
|
+
}
|
288532
|
+
}
|
288533
|
+
`, [CustomDeploymentFragment]);
|
288571
288534
|
var customdeploymentList = (gqlClient) => {
|
288572
288535
|
return async (applicationUniqueName) => {
|
288573
288536
|
const { customDeploymentsByUniqueName: { items } } = await gqlClient.request(getCustomDeployments, { applicationUniqueName });
|
@@ -288604,6 +288567,14 @@ var customDeploymentRestart = (gqlClient) => async (customDeploymentUniqueName)
|
|
288604
288567
|
const { restartCustomDeploymentByUniqueName: customDeployment } = await gqlClient.request(restartCustomDeployment, { uniqueName: customDeploymentUniqueName });
|
288605
288568
|
return customDeployment;
|
288606
288569
|
};
|
288570
|
+
var customDeploymentPause = (gqlClient) => async (customDeploymentUniqueName) => {
|
288571
|
+
const { pauseCustomDeploymentByUniqueName: customDeployment } = await gqlClient.request(pauseCustomDeployment, { uniqueName: customDeploymentUniqueName });
|
288572
|
+
return customDeployment;
|
288573
|
+
};
|
288574
|
+
var customDeploymentResume = (gqlClient) => async (customDeploymentUniqueName) => {
|
288575
|
+
const { resumeCustomDeploymentByUniqueName: customDeployment } = await gqlClient.request(resumeCustomDeployment, { uniqueName: customDeploymentUniqueName });
|
288576
|
+
return customDeployment;
|
288577
|
+
};
|
288607
288578
|
var getFoundryEnvConfig = graphql(`
|
288608
288579
|
query GetFoundryEnvConfig($blockchainNodeUniqueName: String!) {
|
288609
288580
|
foundryEnvConfigByUniqueName(blockchainNodeUniqueName: $blockchainNodeUniqueName)
|
@@ -288680,6 +288651,20 @@ var restartLoadBalancer = graphql(`
|
|
288680
288651
|
}
|
288681
288652
|
}
|
288682
288653
|
`, [LoadBalancerFragment]);
|
288654
|
+
var pauseLoadBalancer = graphql(`
|
288655
|
+
mutation PauseLoadBalancer($uniqueName: String!) {
|
288656
|
+
pauseLoadBalancerByUniqueName(uniqueName: $uniqueName) {
|
288657
|
+
...LoadBalancer
|
288658
|
+
}
|
288659
|
+
}
|
288660
|
+
`, [LoadBalancerFragment]);
|
288661
|
+
var resumeLoadBalancer = graphql(`
|
288662
|
+
mutation ResumeLoadBalancer($uniqueName: String!) {
|
288663
|
+
resumeLoadBalancerByUniqueName(uniqueName: $uniqueName) {
|
288664
|
+
...LoadBalancer
|
288665
|
+
}
|
288666
|
+
}
|
288667
|
+
`, [LoadBalancerFragment]);
|
288683
288668
|
var loadBalancerRead = (gqlClient) => {
|
288684
288669
|
return async (loadBalancerUniqueName) => {
|
288685
288670
|
const { loadBalancerByUniqueName: loadBalancer } = await gqlClient.request(getLoadBalancer, { uniqueName: loadBalancerUniqueName });
|
@@ -288713,6 +288698,14 @@ var loadBalancerRestart = (gqlClient) => async (loadBalancerUniqueName) => {
|
|
288713
288698
|
const { restartLoadBalancerByUniqueName: loadBalancer } = await gqlClient.request(restartLoadBalancer, { uniqueName: loadBalancerUniqueName });
|
288714
288699
|
return loadBalancer;
|
288715
288700
|
};
|
288701
|
+
var loadBalancerPause = (gqlClient) => async (loadBalancerUniqueName) => {
|
288702
|
+
const { pauseLoadBalancerByUniqueName: loadBalancer } = await gqlClient.request(pauseLoadBalancer, { uniqueName: loadBalancerUniqueName });
|
288703
|
+
return loadBalancer;
|
288704
|
+
};
|
288705
|
+
var loadBalancerResume = (gqlClient) => async (loadBalancerUniqueName) => {
|
288706
|
+
const { resumeLoadBalancerByUniqueName: loadBalancer } = await gqlClient.request(resumeLoadBalancer, { uniqueName: loadBalancerUniqueName });
|
288707
|
+
return loadBalancer;
|
288708
|
+
};
|
288716
288709
|
var InsightsFragment = graphql(`
|
288717
288710
|
fragment Insights on Insights {
|
288718
288711
|
__typename
|
@@ -288786,6 +288779,20 @@ var restartInsights = graphql(`
|
|
288786
288779
|
}
|
288787
288780
|
}
|
288788
288781
|
`, [InsightsFragment]);
|
288782
|
+
var pauseInsights = graphql(`
|
288783
|
+
mutation PauseInsights($uniqueName: String!) {
|
288784
|
+
pauseInsightsByUniqueName(uniqueName: $uniqueName) {
|
288785
|
+
...Insights
|
288786
|
+
}
|
288787
|
+
}
|
288788
|
+
`, [InsightsFragment]);
|
288789
|
+
var resumeInsights = graphql(`
|
288790
|
+
mutation ResumeInsights($uniqueName: String!) {
|
288791
|
+
resumeInsightsByUniqueName(uniqueName: $uniqueName) {
|
288792
|
+
...Insights
|
288793
|
+
}
|
288794
|
+
}
|
288795
|
+
`, [InsightsFragment]);
|
288789
288796
|
var insightsList = (gqlClient) => {
|
288790
288797
|
return async (applicationUniqueName) => {
|
288791
288798
|
const { insightsListByUniqueName: { items } } = await gqlClient.request(getInsights, { applicationUniqueName });
|
@@ -288819,6 +288826,14 @@ var insightsRestart = (gqlClient) => async (insightsUniqueName) => {
|
|
288819
288826
|
const { restartInsightsByUniqueName: insights } = await gqlClient.request(restartInsights, { uniqueName: insightsUniqueName });
|
288820
288827
|
return insights;
|
288821
288828
|
};
|
288829
|
+
var insightsPause = (gqlClient) => async (insightsUniqueName) => {
|
288830
|
+
const { pauseInsightsByUniqueName: insights } = await gqlClient.request(pauseInsights, { uniqueName: insightsUniqueName });
|
288831
|
+
return insights;
|
288832
|
+
};
|
288833
|
+
var insightsResume = (gqlClient) => async (insightsUniqueName) => {
|
288834
|
+
const { resumeInsightsByUniqueName: insights } = await gqlClient.request(resumeInsights, { uniqueName: insightsUniqueName });
|
288835
|
+
return insights;
|
288836
|
+
};
|
288822
288837
|
var IntegrationFragment = graphql(`
|
288823
288838
|
fragment Integration on Integration {
|
288824
288839
|
__typename
|
@@ -288888,6 +288903,20 @@ var restartIntegrationTool = graphql(`
|
|
288888
288903
|
}
|
288889
288904
|
}
|
288890
288905
|
`, [IntegrationFragment]);
|
288906
|
+
var pauseIntegrationTool = graphql(`
|
288907
|
+
mutation PauseIntegrationTool($uniqueName: String!) {
|
288908
|
+
pauseIntegrationByUniqueName(uniqueName: $uniqueName) {
|
288909
|
+
...Integration
|
288910
|
+
}
|
288911
|
+
}
|
288912
|
+
`, [IntegrationFragment]);
|
288913
|
+
var resumeIntegrationTool = graphql(`
|
288914
|
+
mutation ResumeIntegrationTool($uniqueName: String!) {
|
288915
|
+
resumeIntegrationByUniqueName(uniqueName: $uniqueName) {
|
288916
|
+
...Integration
|
288917
|
+
}
|
288918
|
+
}
|
288919
|
+
`, [IntegrationFragment]);
|
288891
288920
|
var integrationToolList = (gqlClient) => {
|
288892
288921
|
return async (applicationUniqueName) => {
|
288893
288922
|
const { integrationsByUniqueName: { items } } = await gqlClient.request(getIntegrations, { applicationUniqueName });
|
@@ -288915,6 +288944,14 @@ var integrationToolRestart = (gqlClient) => async (integrationUniqueName) => {
|
|
288915
288944
|
const { restartIntegrationByUniqueName: integration } = await gqlClient.request(restartIntegrationTool, { uniqueName: integrationUniqueName });
|
288916
288945
|
return integration;
|
288917
288946
|
};
|
288947
|
+
var integrationToolPause = (gqlClient) => async (integrationUniqueName) => {
|
288948
|
+
const { pauseIntegrationByUniqueName: integration } = await gqlClient.request(pauseIntegrationTool, { uniqueName: integrationUniqueName });
|
288949
|
+
return integration;
|
288950
|
+
};
|
288951
|
+
var integrationToolResume = (gqlClient) => async (integrationUniqueName) => {
|
288952
|
+
const { resumeIntegrationByUniqueName: integration } = await gqlClient.request(resumeIntegrationTool, { uniqueName: integrationUniqueName });
|
288953
|
+
return integration;
|
288954
|
+
};
|
288918
288955
|
var StorageFragment = graphql(`
|
288919
288956
|
fragment Storage on Storage {
|
288920
288957
|
__typename
|
@@ -288984,6 +289021,20 @@ var restartStorage = graphql(`
|
|
288984
289021
|
}
|
288985
289022
|
}
|
288986
289023
|
`, [StorageFragment]);
|
289024
|
+
var pauseStorage = graphql(`
|
289025
|
+
mutation PauseStorage($uniqueName: String!) {
|
289026
|
+
pauseStorageByUniqueName(uniqueName: $uniqueName) {
|
289027
|
+
...Storage
|
289028
|
+
}
|
289029
|
+
}
|
289030
|
+
`, [StorageFragment]);
|
289031
|
+
var resumeStorage = graphql(`
|
289032
|
+
mutation ResumeStorage($uniqueName: String!) {
|
289033
|
+
resumeStorageByUniqueName(uniqueName: $uniqueName) {
|
289034
|
+
...Storage
|
289035
|
+
}
|
289036
|
+
}
|
289037
|
+
`, [StorageFragment]);
|
288987
289038
|
var storageList = (gqlClient) => {
|
288988
289039
|
return async (applicationUniqueName) => {
|
288989
289040
|
const { storagesByUniqueName: { items } } = await gqlClient.request(getStorages, { applicationUniqueName });
|
@@ -289011,6 +289062,14 @@ var storageRestart = (gqlClient) => async (storageUniqueName) => {
|
|
289011
289062
|
const { restartStorageByUniqueName: storage } = await gqlClient.request(restartStorage, { uniqueName: storageUniqueName });
|
289012
289063
|
return storage;
|
289013
289064
|
};
|
289065
|
+
var storagePause = (gqlClient) => async (storageUniqueName) => {
|
289066
|
+
const { pauseStorageByUniqueName: storage } = await gqlClient.request(pauseStorage, { uniqueName: storageUniqueName });
|
289067
|
+
return storage;
|
289068
|
+
};
|
289069
|
+
var storageResume = (gqlClient) => async (storageUniqueName) => {
|
289070
|
+
const { resumeStorageByUniqueName: storage } = await gqlClient.request(resumeStorage, { uniqueName: storageUniqueName });
|
289071
|
+
return storage;
|
289072
|
+
};
|
289014
289073
|
var MiddlewareFragment = graphql(`
|
289015
289074
|
fragment Middleware on Middleware {
|
289016
289075
|
__typename
|
@@ -289111,6 +289170,20 @@ var restartMiddleware = graphql(`
|
|
289111
289170
|
}
|
289112
289171
|
}
|
289113
289172
|
`, [MiddlewareFragment]);
|
289173
|
+
var pauseMiddleware = graphql(`
|
289174
|
+
mutation PauseMiddleware($uniqueName: String!) {
|
289175
|
+
pauseMiddlewareByUniqueName(uniqueName: $uniqueName) {
|
289176
|
+
...Middleware
|
289177
|
+
}
|
289178
|
+
}
|
289179
|
+
`, [MiddlewareFragment]);
|
289180
|
+
var resumeMiddleware = graphql(`
|
289181
|
+
mutation ResumeMiddleware($uniqueName: String!) {
|
289182
|
+
resumeMiddlewareByUniqueName(uniqueName: $uniqueName) {
|
289183
|
+
...Middleware
|
289184
|
+
}
|
289185
|
+
}
|
289186
|
+
`, [MiddlewareFragment]);
|
289114
289187
|
var middlewareList = (gqlClient) => {
|
289115
289188
|
return async (applicationUniqueName) => {
|
289116
289189
|
const { middlewaresByUniqueName: { items } } = await gqlClient.request(getMiddlewares, { applicationUniqueName });
|
@@ -289155,6 +289228,14 @@ var middlewareRestart = (gqlClient) => async (middlewareUniqueName) => {
|
|
289155
289228
|
const { restartMiddlewareByUniqueName: middleware } = await gqlClient.request(restartMiddleware, { uniqueName: middlewareUniqueName });
|
289156
289229
|
return middleware;
|
289157
289230
|
};
|
289231
|
+
var middlewarePause = (gqlClient) => async (middlewareUniqueName) => {
|
289232
|
+
const { pauseMiddlewareByUniqueName: middleware } = await gqlClient.request(pauseMiddleware, { uniqueName: middlewareUniqueName });
|
289233
|
+
return middleware;
|
289234
|
+
};
|
289235
|
+
var middlewareResume = (gqlClient) => async (middlewareUniqueName) => {
|
289236
|
+
const { resumeMiddlewareByUniqueName: middleware } = await gqlClient.request(resumeMiddleware, { uniqueName: middlewareUniqueName });
|
289237
|
+
return middleware;
|
289238
|
+
};
|
289158
289239
|
var getPlatformConfigQuery = graphql(`
|
289159
289240
|
query platformConfig {
|
289160
289241
|
config {
|
@@ -289287,6 +289368,20 @@ var restartPrivateKey = graphql(`
|
|
289287
289368
|
}
|
289288
289369
|
}
|
289289
289370
|
`, [PrivateKeyFragment]);
|
289371
|
+
var pausePrivateKey = graphql(`
|
289372
|
+
mutation PausePrivateKey($uniqueName: String!) {
|
289373
|
+
pausePrivateKeyByUniqueName(uniqueName: $uniqueName) {
|
289374
|
+
...PrivateKey
|
289375
|
+
}
|
289376
|
+
}
|
289377
|
+
`, [PrivateKeyFragment]);
|
289378
|
+
var resumePrivateKey = graphql(`
|
289379
|
+
mutation ResumePrivateKey($uniqueName: String!) {
|
289380
|
+
resumePrivateKeyByUniqueName(uniqueName: $uniqueName) {
|
289381
|
+
...PrivateKey
|
289382
|
+
}
|
289383
|
+
}
|
289384
|
+
`, [PrivateKeyFragment]);
|
289290
289385
|
var privateKeyList = (gqlClient) => {
|
289291
289386
|
return async (applicationUniqueName) => {
|
289292
289387
|
const { privateKeysByUniqueName: { items } } = await gqlClient.request(getPrivateKeys, { applicationUniqueName });
|
@@ -289325,6 +289420,14 @@ var privateKeyRestart = (gqlClient) => async (privateKeyUniqueName) => {
|
|
289325
289420
|
const { restartPrivateKeyByUniqueName: privateKey } = await gqlClient.request(restartPrivateKey, { uniqueName: privateKeyUniqueName });
|
289326
289421
|
return privateKey;
|
289327
289422
|
};
|
289423
|
+
var privateKeyPause = (gqlClient) => async (privateKeyUniqueName) => {
|
289424
|
+
const { pausePrivateKeyByUniqueName: privateKey } = await gqlClient.request(pausePrivateKey, { uniqueName: privateKeyUniqueName });
|
289425
|
+
return privateKey;
|
289426
|
+
};
|
289427
|
+
var privateKeyResume = (gqlClient) => async (privateKeyUniqueName) => {
|
289428
|
+
const { resumePrivateKeyByUniqueName: privateKey } = await gqlClient.request(resumePrivateKey, { uniqueName: privateKeyUniqueName });
|
289429
|
+
return privateKey;
|
289430
|
+
};
|
289328
289431
|
var ClientOptionsSchema = exports_external.object({
|
289329
289432
|
accessToken: AccessTokenSchema2,
|
289330
289433
|
instance: UrlSchema2
|
@@ -289404,57 +289507,75 @@ function createSettleMintClient(options) {
|
|
289404
289507
|
read: blockchainNetworkRead(gqlClient),
|
289405
289508
|
create: blockchainNetworkCreate(gqlClient),
|
289406
289509
|
delete: blockchainNetworkDelete(gqlClient),
|
289407
|
-
restart: blockchainNetworkRestart(gqlClient)
|
289510
|
+
restart: blockchainNetworkRestart(gqlClient),
|
289511
|
+
pause: blockchainNetworkPause(gqlClient),
|
289512
|
+
resume: blockchainNetworkResume(gqlClient)
|
289408
289513
|
},
|
289409
289514
|
blockchainNode: {
|
289410
289515
|
list: blockchainNodeList(gqlClient),
|
289411
289516
|
read: blockchainNodeRead(gqlClient),
|
289412
289517
|
create: blockchainNodeCreate(gqlClient),
|
289413
|
-
restart: blockchainNodeRestart(gqlClient)
|
289518
|
+
restart: blockchainNodeRestart(gqlClient),
|
289519
|
+
pause: blockchainNodePause(gqlClient),
|
289520
|
+
resume: blockchainNodeResume(gqlClient)
|
289414
289521
|
},
|
289415
289522
|
loadBalancer: {
|
289416
289523
|
list: loadBalancerList(gqlClient),
|
289417
289524
|
read: loadBalancerRead(gqlClient),
|
289418
289525
|
create: loadBalancerCreate(gqlClient),
|
289419
|
-
restart: loadBalancerRestart(gqlClient)
|
289526
|
+
restart: loadBalancerRestart(gqlClient),
|
289527
|
+
pause: loadBalancerPause(gqlClient),
|
289528
|
+
resume: loadBalancerResume(gqlClient)
|
289420
289529
|
},
|
289421
289530
|
middleware: {
|
289422
289531
|
list: middlewareList(gqlClient),
|
289423
289532
|
read: middlewareRead(gqlClient),
|
289424
289533
|
graphSubgraphs: graphMiddlewareSubgraphs(gqlClient),
|
289425
289534
|
create: middlewareCreate(gqlClient),
|
289426
|
-
restart: middlewareRestart(gqlClient)
|
289535
|
+
restart: middlewareRestart(gqlClient),
|
289536
|
+
pause: middlewarePause(gqlClient),
|
289537
|
+
resume: middlewareResume(gqlClient)
|
289427
289538
|
},
|
289428
289539
|
integrationTool: {
|
289429
289540
|
list: integrationToolList(gqlClient),
|
289430
289541
|
read: integrationToolRead(gqlClient),
|
289431
289542
|
create: integrationToolCreate(gqlClient),
|
289432
|
-
restart: integrationToolRestart(gqlClient)
|
289543
|
+
restart: integrationToolRestart(gqlClient),
|
289544
|
+
pause: integrationToolPause(gqlClient),
|
289545
|
+
resume: integrationToolResume(gqlClient)
|
289433
289546
|
},
|
289434
289547
|
storage: {
|
289435
289548
|
list: storageList(gqlClient),
|
289436
289549
|
read: storageRead(gqlClient),
|
289437
289550
|
create: storageCreate(gqlClient),
|
289438
|
-
restart: storageRestart(gqlClient)
|
289551
|
+
restart: storageRestart(gqlClient),
|
289552
|
+
pause: storagePause(gqlClient),
|
289553
|
+
resume: storageResume(gqlClient)
|
289439
289554
|
},
|
289440
289555
|
privateKey: {
|
289441
289556
|
list: privateKeyList(gqlClient),
|
289442
289557
|
read: privatekeyRead(gqlClient),
|
289443
289558
|
create: privateKeyCreate(gqlClient),
|
289444
|
-
restart: privateKeyRestart(gqlClient)
|
289559
|
+
restart: privateKeyRestart(gqlClient),
|
289560
|
+
pause: privateKeyPause(gqlClient),
|
289561
|
+
resume: privateKeyResume(gqlClient)
|
289445
289562
|
},
|
289446
289563
|
insights: {
|
289447
289564
|
list: insightsList(gqlClient),
|
289448
289565
|
read: insightsRead(gqlClient),
|
289449
289566
|
create: insightsCreate(gqlClient),
|
289450
|
-
restart: insightsRestart(gqlClient)
|
289567
|
+
restart: insightsRestart(gqlClient),
|
289568
|
+
pause: insightsPause(gqlClient),
|
289569
|
+
resume: insightsResume(gqlClient)
|
289451
289570
|
},
|
289452
289571
|
customDeployment: {
|
289453
289572
|
list: customdeploymentList(gqlClient),
|
289454
289573
|
read: customdeploymentRead(gqlClient),
|
289455
289574
|
create: customdeploymentCreate(gqlClient),
|
289456
289575
|
update: customdeploymentUpdate(gqlClient),
|
289457
|
-
restart: customDeploymentRestart(gqlClient)
|
289576
|
+
restart: customDeploymentRestart(gqlClient),
|
289577
|
+
pause: customDeploymentPause(gqlClient),
|
289578
|
+
resume: customDeploymentResume(gqlClient)
|
289458
289579
|
},
|
289459
289580
|
foundry: { env: getEnv(gqlClient) },
|
289460
289581
|
applicationAccessToken: { create: applicationAccessTokenCreate(gqlClient) },
|
@@ -303013,23 +303134,480 @@ function sanitizeName(value4, length = 35) {
|
|
303013
303134
|
}).slice(0, length).replaceAll(/(^\d*)/g, "").replaceAll(/(-$)/g, "").replaceAll(/(^-)/g, "");
|
303014
303135
|
}
|
303015
303136
|
|
303137
|
+
// ../../node_modules/@inquirer/input/node_modules/@inquirer/core/dist/esm/lib/key.js
|
303138
|
+
var isBackspaceKey = (key2) => key2.name === "backspace";
|
303139
|
+
var isEnterKey2 = (key2) => key2.name === "enter" || key2.name === "return";
|
303140
|
+
// ../../node_modules/@inquirer/input/node_modules/@inquirer/core/dist/esm/lib/errors.js
|
303141
|
+
class AbortPromptError2 extends Error {
|
303142
|
+
name = "AbortPromptError";
|
303143
|
+
message = "Prompt was aborted";
|
303144
|
+
constructor(options) {
|
303145
|
+
super();
|
303146
|
+
this.cause = options?.cause;
|
303147
|
+
}
|
303148
|
+
}
|
303149
|
+
|
303150
|
+
class CancelPromptError2 extends Error {
|
303151
|
+
name = "CancelPromptError";
|
303152
|
+
message = "Prompt was canceled";
|
303153
|
+
}
|
303154
|
+
|
303155
|
+
class ExitPromptError2 extends Error {
|
303156
|
+
name = "ExitPromptError";
|
303157
|
+
}
|
303158
|
+
|
303159
|
+
class HookError2 extends Error {
|
303160
|
+
name = "HookError";
|
303161
|
+
}
|
303162
|
+
|
303163
|
+
class ValidationError2 extends Error {
|
303164
|
+
name = "ValidationError";
|
303165
|
+
}
|
303166
|
+
// ../../node_modules/@inquirer/input/node_modules/@inquirer/core/dist/esm/lib/use-state.js
|
303167
|
+
import { AsyncResource as AsyncResource5 } from "node:async_hooks";
|
303168
|
+
|
303169
|
+
// ../../node_modules/@inquirer/input/node_modules/@inquirer/core/dist/esm/lib/hook-engine.js
|
303170
|
+
import { AsyncLocalStorage as AsyncLocalStorage2, AsyncResource as AsyncResource4 } from "node:async_hooks";
|
303171
|
+
var hookStorage2 = new AsyncLocalStorage2;
|
303172
|
+
function createStore2(rl) {
|
303173
|
+
const store = {
|
303174
|
+
rl,
|
303175
|
+
hooks: [],
|
303176
|
+
hooksCleanup: [],
|
303177
|
+
hooksEffect: [],
|
303178
|
+
index: 0,
|
303179
|
+
handleChange() {}
|
303180
|
+
};
|
303181
|
+
return store;
|
303182
|
+
}
|
303183
|
+
function withHooks2(rl, cb) {
|
303184
|
+
const store = createStore2(rl);
|
303185
|
+
return hookStorage2.run(store, () => {
|
303186
|
+
function cycle(render) {
|
303187
|
+
store.handleChange = () => {
|
303188
|
+
store.index = 0;
|
303189
|
+
render();
|
303190
|
+
};
|
303191
|
+
store.handleChange();
|
303192
|
+
}
|
303193
|
+
return cb(cycle);
|
303194
|
+
});
|
303195
|
+
}
|
303196
|
+
function getStore2() {
|
303197
|
+
const store = hookStorage2.getStore();
|
303198
|
+
if (!store) {
|
303199
|
+
throw new HookError2("[Inquirer] Hook functions can only be called from within a prompt");
|
303200
|
+
}
|
303201
|
+
return store;
|
303202
|
+
}
|
303203
|
+
function readline3() {
|
303204
|
+
return getStore2().rl;
|
303205
|
+
}
|
303206
|
+
function withUpdates2(fn) {
|
303207
|
+
const wrapped = (...args) => {
|
303208
|
+
const store = getStore2();
|
303209
|
+
let shouldUpdate = false;
|
303210
|
+
const oldHandleChange = store.handleChange;
|
303211
|
+
store.handleChange = () => {
|
303212
|
+
shouldUpdate = true;
|
303213
|
+
};
|
303214
|
+
const returnValue = fn(...args);
|
303215
|
+
if (shouldUpdate) {
|
303216
|
+
oldHandleChange();
|
303217
|
+
}
|
303218
|
+
store.handleChange = oldHandleChange;
|
303219
|
+
return returnValue;
|
303220
|
+
};
|
303221
|
+
return AsyncResource4.bind(wrapped);
|
303222
|
+
}
|
303223
|
+
function withPointer2(cb) {
|
303224
|
+
const store = getStore2();
|
303225
|
+
const { index } = store;
|
303226
|
+
const pointer = {
|
303227
|
+
get() {
|
303228
|
+
return store.hooks[index];
|
303229
|
+
},
|
303230
|
+
set(value4) {
|
303231
|
+
store.hooks[index] = value4;
|
303232
|
+
},
|
303233
|
+
initialized: index in store.hooks
|
303234
|
+
};
|
303235
|
+
const returnValue = cb(pointer);
|
303236
|
+
store.index++;
|
303237
|
+
return returnValue;
|
303238
|
+
}
|
303239
|
+
function handleChange2() {
|
303240
|
+
getStore2().handleChange();
|
303241
|
+
}
|
303242
|
+
var effectScheduler2 = {
|
303243
|
+
queue(cb) {
|
303244
|
+
const store = getStore2();
|
303245
|
+
const { index } = store;
|
303246
|
+
store.hooksEffect.push(() => {
|
303247
|
+
store.hooksCleanup[index]?.();
|
303248
|
+
const cleanFn = cb(readline3());
|
303249
|
+
if (cleanFn != null && typeof cleanFn !== "function") {
|
303250
|
+
throw new ValidationError2("useEffect return value must be a cleanup function or nothing.");
|
303251
|
+
}
|
303252
|
+
store.hooksCleanup[index] = cleanFn;
|
303253
|
+
});
|
303254
|
+
},
|
303255
|
+
run() {
|
303256
|
+
const store = getStore2();
|
303257
|
+
withUpdates2(() => {
|
303258
|
+
store.hooksEffect.forEach((effect) => {
|
303259
|
+
effect();
|
303260
|
+
});
|
303261
|
+
store.hooksEffect.length = 0;
|
303262
|
+
})();
|
303263
|
+
},
|
303264
|
+
clearAll() {
|
303265
|
+
const store = getStore2();
|
303266
|
+
store.hooksCleanup.forEach((cleanFn) => {
|
303267
|
+
cleanFn?.();
|
303268
|
+
});
|
303269
|
+
store.hooksEffect.length = 0;
|
303270
|
+
store.hooksCleanup.length = 0;
|
303271
|
+
}
|
303272
|
+
};
|
303273
|
+
|
303274
|
+
// ../../node_modules/@inquirer/input/node_modules/@inquirer/core/dist/esm/lib/use-state.js
|
303275
|
+
function useState2(defaultValue) {
|
303276
|
+
return withPointer2((pointer) => {
|
303277
|
+
const setState = AsyncResource5.bind(function setState(newValue) {
|
303278
|
+
if (pointer.get() !== newValue) {
|
303279
|
+
pointer.set(newValue);
|
303280
|
+
handleChange2();
|
303281
|
+
}
|
303282
|
+
});
|
303283
|
+
if (pointer.initialized) {
|
303284
|
+
return [pointer.get(), setState];
|
303285
|
+
}
|
303286
|
+
const value4 = typeof defaultValue === "function" ? defaultValue() : defaultValue;
|
303287
|
+
pointer.set(value4);
|
303288
|
+
return [value4, setState];
|
303289
|
+
});
|
303290
|
+
}
|
303291
|
+
|
303292
|
+
// ../../node_modules/@inquirer/input/node_modules/@inquirer/core/dist/esm/lib/use-effect.js
|
303293
|
+
function useEffect2(cb, depArray) {
|
303294
|
+
withPointer2((pointer) => {
|
303295
|
+
const oldDeps = pointer.get();
|
303296
|
+
const hasChanged = !Array.isArray(oldDeps) || depArray.some((dep, i6) => !Object.is(dep, oldDeps[i6]));
|
303297
|
+
if (hasChanged) {
|
303298
|
+
effectScheduler2.queue(cb);
|
303299
|
+
}
|
303300
|
+
pointer.set(depArray);
|
303301
|
+
});
|
303302
|
+
}
|
303303
|
+
|
303304
|
+
// ../../node_modules/@inquirer/input/node_modules/@inquirer/core/dist/esm/lib/theme.js
|
303305
|
+
var import_yoctocolors_cjs2 = __toESM(require_yoctocolors_cjs(), 1);
|
303306
|
+
var defaultTheme2 = {
|
303307
|
+
prefix: {
|
303308
|
+
idle: import_yoctocolors_cjs2.default.blue("?"),
|
303309
|
+
done: import_yoctocolors_cjs2.default.green(esm_default.tick)
|
303310
|
+
},
|
303311
|
+
spinner: {
|
303312
|
+
interval: 80,
|
303313
|
+
frames: ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"].map((frame) => import_yoctocolors_cjs2.default.yellow(frame))
|
303314
|
+
},
|
303315
|
+
style: {
|
303316
|
+
answer: import_yoctocolors_cjs2.default.cyan,
|
303317
|
+
message: import_yoctocolors_cjs2.default.bold,
|
303318
|
+
error: (text2) => import_yoctocolors_cjs2.default.red(`> ${text2}`),
|
303319
|
+
defaultAnswer: (text2) => import_yoctocolors_cjs2.default.dim(`(${text2})`),
|
303320
|
+
help: import_yoctocolors_cjs2.default.dim,
|
303321
|
+
highlight: import_yoctocolors_cjs2.default.cyan,
|
303322
|
+
key: (text2) => import_yoctocolors_cjs2.default.cyan(import_yoctocolors_cjs2.default.bold(`<${text2}>`))
|
303323
|
+
}
|
303324
|
+
};
|
303325
|
+
|
303326
|
+
// ../../node_modules/@inquirer/input/node_modules/@inquirer/core/dist/esm/lib/make-theme.js
|
303327
|
+
function isPlainObject6(value4) {
|
303328
|
+
if (typeof value4 !== "object" || value4 === null)
|
303329
|
+
return false;
|
303330
|
+
let proto = value4;
|
303331
|
+
while (Object.getPrototypeOf(proto) !== null) {
|
303332
|
+
proto = Object.getPrototypeOf(proto);
|
303333
|
+
}
|
303334
|
+
return Object.getPrototypeOf(value4) === proto;
|
303335
|
+
}
|
303336
|
+
function deepMerge3(...objects) {
|
303337
|
+
const output = {};
|
303338
|
+
for (const obj of objects) {
|
303339
|
+
for (const [key2, value4] of Object.entries(obj)) {
|
303340
|
+
const prevValue = output[key2];
|
303341
|
+
output[key2] = isPlainObject6(prevValue) && isPlainObject6(value4) ? deepMerge3(prevValue, value4) : value4;
|
303342
|
+
}
|
303343
|
+
}
|
303344
|
+
return output;
|
303345
|
+
}
|
303346
|
+
function makeTheme2(...themes) {
|
303347
|
+
const themesToMerge = [
|
303348
|
+
defaultTheme2,
|
303349
|
+
...themes.filter((theme) => theme != null)
|
303350
|
+
];
|
303351
|
+
return deepMerge3(...themesToMerge);
|
303352
|
+
}
|
303353
|
+
|
303354
|
+
// ../../node_modules/@inquirer/input/node_modules/@inquirer/core/dist/esm/lib/use-prefix.js
|
303355
|
+
function usePrefix2({ status = "idle", theme }) {
|
303356
|
+
const [showLoader, setShowLoader] = useState2(false);
|
303357
|
+
const [tick, setTick] = useState2(0);
|
303358
|
+
const { prefix, spinner: spinner2 } = makeTheme2(theme);
|
303359
|
+
useEffect2(() => {
|
303360
|
+
if (status === "loading") {
|
303361
|
+
let tickInterval;
|
303362
|
+
let inc = -1;
|
303363
|
+
const delayTimeout = setTimeout(() => {
|
303364
|
+
setShowLoader(true);
|
303365
|
+
tickInterval = setInterval(() => {
|
303366
|
+
inc = inc + 1;
|
303367
|
+
setTick(inc % spinner2.frames.length);
|
303368
|
+
}, spinner2.interval);
|
303369
|
+
}, 300);
|
303370
|
+
return () => {
|
303371
|
+
clearTimeout(delayTimeout);
|
303372
|
+
clearInterval(tickInterval);
|
303373
|
+
};
|
303374
|
+
} else {
|
303375
|
+
setShowLoader(false);
|
303376
|
+
}
|
303377
|
+
}, [status]);
|
303378
|
+
if (showLoader) {
|
303379
|
+
return spinner2.frames[tick];
|
303380
|
+
}
|
303381
|
+
const iconName = status === "loading" ? "idle" : status;
|
303382
|
+
return typeof prefix === "string" ? prefix : prefix[iconName] ?? prefix["idle"];
|
303383
|
+
}
|
303384
|
+
// ../../node_modules/@inquirer/input/node_modules/@inquirer/core/dist/esm/lib/use-ref.js
|
303385
|
+
function useRef2(val) {
|
303386
|
+
return useState2({ current: val })[0];
|
303387
|
+
}
|
303388
|
+
|
303389
|
+
// ../../node_modules/@inquirer/input/node_modules/@inquirer/core/dist/esm/lib/use-keypress.js
|
303390
|
+
function useKeypress2(userHandler) {
|
303391
|
+
const signal = useRef2(userHandler);
|
303392
|
+
signal.current = userHandler;
|
303393
|
+
useEffect2((rl) => {
|
303394
|
+
let ignore = false;
|
303395
|
+
const handler = withUpdates2((_input, event) => {
|
303396
|
+
if (ignore)
|
303397
|
+
return;
|
303398
|
+
signal.current(event, rl);
|
303399
|
+
});
|
303400
|
+
rl.input.on("keypress", handler);
|
303401
|
+
return () => {
|
303402
|
+
ignore = true;
|
303403
|
+
rl.input.removeListener("keypress", handler);
|
303404
|
+
};
|
303405
|
+
}, []);
|
303406
|
+
}
|
303407
|
+
// ../../node_modules/@inquirer/input/node_modules/@inquirer/core/dist/esm/lib/utils.js
|
303408
|
+
var import_cli_width2 = __toESM(require_cli_width(), 1);
|
303409
|
+
var import_wrap_ansi2 = __toESM(require_wrap_ansi(), 1);
|
303410
|
+
function breakLines2(content, width) {
|
303411
|
+
return content.split(`
|
303412
|
+
`).flatMap((line) => import_wrap_ansi2.default(line, width, { trim: false, hard: true }).split(`
|
303413
|
+
`).map((str) => str.trimEnd())).join(`
|
303414
|
+
`);
|
303415
|
+
}
|
303416
|
+
function readlineWidth2() {
|
303417
|
+
return import_cli_width2.default({ defaultWidth: 80, output: readline3().output });
|
303418
|
+
}
|
303419
|
+
|
303420
|
+
// ../../node_modules/@inquirer/input/node_modules/@inquirer/core/dist/esm/lib/create-prompt.js
|
303421
|
+
var import_mute_stream2 = __toESM(require_lib(), 1);
|
303422
|
+
import * as readline4 from "node:readline";
|
303423
|
+
import { AsyncResource as AsyncResource6 } from "node:async_hooks";
|
303424
|
+
|
303425
|
+
// ../../node_modules/@inquirer/input/node_modules/@inquirer/core/dist/esm/lib/screen-manager.js
|
303426
|
+
var import_ansi_escapes2 = __toESM(require_ansi_escapes(), 1);
|
303427
|
+
import { stripVTControlCharacters as stripVTControlCharacters3 } from "node:util";
|
303428
|
+
var height2 = (content) => content.split(`
|
303429
|
+
`).length;
|
303430
|
+
var lastLine2 = (content) => content.split(`
|
303431
|
+
`).pop() ?? "";
|
303432
|
+
function cursorDown2(n6) {
|
303433
|
+
return n6 > 0 ? import_ansi_escapes2.default.cursorDown(n6) : "";
|
303434
|
+
}
|
303435
|
+
|
303436
|
+
class ScreenManager2 {
|
303437
|
+
height = 0;
|
303438
|
+
extraLinesUnderPrompt = 0;
|
303439
|
+
cursorPos;
|
303440
|
+
rl;
|
303441
|
+
constructor(rl) {
|
303442
|
+
this.rl = rl;
|
303443
|
+
this.cursorPos = rl.getCursorPos();
|
303444
|
+
}
|
303445
|
+
write(content) {
|
303446
|
+
this.rl.output.unmute();
|
303447
|
+
this.rl.output.write(content);
|
303448
|
+
this.rl.output.mute();
|
303449
|
+
}
|
303450
|
+
render(content, bottomContent = "") {
|
303451
|
+
const promptLine = lastLine2(content);
|
303452
|
+
const rawPromptLine = stripVTControlCharacters3(promptLine);
|
303453
|
+
let prompt = rawPromptLine;
|
303454
|
+
if (this.rl.line.length > 0) {
|
303455
|
+
prompt = prompt.slice(0, -this.rl.line.length);
|
303456
|
+
}
|
303457
|
+
this.rl.setPrompt(prompt);
|
303458
|
+
this.cursorPos = this.rl.getCursorPos();
|
303459
|
+
const width = readlineWidth2();
|
303460
|
+
content = breakLines2(content, width);
|
303461
|
+
bottomContent = breakLines2(bottomContent, width);
|
303462
|
+
if (rawPromptLine.length % width === 0) {
|
303463
|
+
content += `
|
303464
|
+
`;
|
303465
|
+
}
|
303466
|
+
let output = content + (bottomContent ? `
|
303467
|
+
` + bottomContent : "");
|
303468
|
+
const promptLineUpDiff = Math.floor(rawPromptLine.length / width) - this.cursorPos.rows;
|
303469
|
+
const bottomContentHeight = promptLineUpDiff + (bottomContent ? height2(bottomContent) : 0);
|
303470
|
+
if (bottomContentHeight > 0)
|
303471
|
+
output += import_ansi_escapes2.default.cursorUp(bottomContentHeight);
|
303472
|
+
output += import_ansi_escapes2.default.cursorTo(this.cursorPos.cols);
|
303473
|
+
this.write(cursorDown2(this.extraLinesUnderPrompt) + import_ansi_escapes2.default.eraseLines(this.height) + output);
|
303474
|
+
this.extraLinesUnderPrompt = bottomContentHeight;
|
303475
|
+
this.height = height2(output);
|
303476
|
+
}
|
303477
|
+
checkCursorPos() {
|
303478
|
+
const cursorPos = this.rl.getCursorPos();
|
303479
|
+
if (cursorPos.cols !== this.cursorPos.cols) {
|
303480
|
+
this.write(import_ansi_escapes2.default.cursorTo(cursorPos.cols));
|
303481
|
+
this.cursorPos = cursorPos;
|
303482
|
+
}
|
303483
|
+
}
|
303484
|
+
done({ clearContent }) {
|
303485
|
+
this.rl.setPrompt("");
|
303486
|
+
let output = cursorDown2(this.extraLinesUnderPrompt);
|
303487
|
+
output += clearContent ? import_ansi_escapes2.default.eraseLines(this.height) : `
|
303488
|
+
`;
|
303489
|
+
output += import_ansi_escapes2.default.cursorShow;
|
303490
|
+
this.write(output);
|
303491
|
+
this.rl.close();
|
303492
|
+
}
|
303493
|
+
}
|
303494
|
+
|
303495
|
+
// ../../node_modules/@inquirer/input/node_modules/@inquirer/core/dist/esm/lib/promise-polyfill.js
|
303496
|
+
class PromisePolyfill2 extends Promise {
|
303497
|
+
static withResolver() {
|
303498
|
+
let resolve5;
|
303499
|
+
let reject;
|
303500
|
+
const promise4 = new Promise((res, rej) => {
|
303501
|
+
resolve5 = res;
|
303502
|
+
reject = rej;
|
303503
|
+
});
|
303504
|
+
return { promise: promise4, resolve: resolve5, reject };
|
303505
|
+
}
|
303506
|
+
}
|
303507
|
+
|
303508
|
+
// ../../node_modules/@inquirer/input/node_modules/@inquirer/core/dist/esm/lib/create-prompt.js
|
303509
|
+
function getCallSites2() {
|
303510
|
+
const _prepareStackTrace = Error.prepareStackTrace;
|
303511
|
+
let result = [];
|
303512
|
+
try {
|
303513
|
+
Error.prepareStackTrace = (_5, callSites) => {
|
303514
|
+
const callSitesWithoutCurrent = callSites.slice(1);
|
303515
|
+
result = callSitesWithoutCurrent;
|
303516
|
+
return callSitesWithoutCurrent;
|
303517
|
+
};
|
303518
|
+
new Error().stack;
|
303519
|
+
} catch {
|
303520
|
+
return result;
|
303521
|
+
}
|
303522
|
+
Error.prepareStackTrace = _prepareStackTrace;
|
303523
|
+
return result;
|
303524
|
+
}
|
303525
|
+
function createPrompt2(view) {
|
303526
|
+
const callSites = getCallSites2();
|
303527
|
+
const prompt = (config4, context = {}) => {
|
303528
|
+
const { input = process.stdin, signal } = context;
|
303529
|
+
const cleanups = new Set;
|
303530
|
+
const output = new import_mute_stream2.default;
|
303531
|
+
output.pipe(context.output ?? process.stdout);
|
303532
|
+
const rl = readline4.createInterface({
|
303533
|
+
terminal: true,
|
303534
|
+
input,
|
303535
|
+
output
|
303536
|
+
});
|
303537
|
+
const screen = new ScreenManager2(rl);
|
303538
|
+
const { promise: promise4, resolve: resolve5, reject } = PromisePolyfill2.withResolver();
|
303539
|
+
const cancel3 = () => reject(new CancelPromptError2);
|
303540
|
+
if (signal) {
|
303541
|
+
const abort = () => reject(new AbortPromptError2({ cause: signal.reason }));
|
303542
|
+
if (signal.aborted) {
|
303543
|
+
abort();
|
303544
|
+
return Object.assign(promise4, { cancel: cancel3 });
|
303545
|
+
}
|
303546
|
+
signal.addEventListener("abort", abort);
|
303547
|
+
cleanups.add(() => signal.removeEventListener("abort", abort));
|
303548
|
+
}
|
303549
|
+
cleanups.add(onExit((code2, signal2) => {
|
303550
|
+
reject(new ExitPromptError2(`User force closed the prompt with ${code2} ${signal2}`));
|
303551
|
+
}));
|
303552
|
+
const sigint = () => reject(new ExitPromptError2(`User force closed the prompt with SIGINT`));
|
303553
|
+
rl.on("SIGINT", sigint);
|
303554
|
+
cleanups.add(() => rl.removeListener("SIGINT", sigint));
|
303555
|
+
const checkCursorPos = () => screen.checkCursorPos();
|
303556
|
+
rl.input.on("keypress", checkCursorPos);
|
303557
|
+
cleanups.add(() => rl.input.removeListener("keypress", checkCursorPos));
|
303558
|
+
return withHooks2(rl, (cycle) => {
|
303559
|
+
const hooksCleanup = AsyncResource6.bind(() => effectScheduler2.clearAll());
|
303560
|
+
rl.on("close", hooksCleanup);
|
303561
|
+
cleanups.add(() => rl.removeListener("close", hooksCleanup));
|
303562
|
+
cycle(() => {
|
303563
|
+
try {
|
303564
|
+
const nextView = view(config4, (value4) => {
|
303565
|
+
setImmediate(() => resolve5(value4));
|
303566
|
+
});
|
303567
|
+
if (nextView === undefined) {
|
303568
|
+
const callerFilename = callSites[1]?.getFileName();
|
303569
|
+
throw new Error(`Prompt functions must return a string.
|
303570
|
+
at ${callerFilename}`);
|
303571
|
+
}
|
303572
|
+
const [content, bottomContent] = typeof nextView === "string" ? [nextView] : nextView;
|
303573
|
+
screen.render(content, bottomContent);
|
303574
|
+
effectScheduler2.run();
|
303575
|
+
} catch (error44) {
|
303576
|
+
reject(error44);
|
303577
|
+
}
|
303578
|
+
});
|
303579
|
+
return Object.assign(promise4.then((answer) => {
|
303580
|
+
effectScheduler2.clearAll();
|
303581
|
+
return answer;
|
303582
|
+
}, (error44) => {
|
303583
|
+
effectScheduler2.clearAll();
|
303584
|
+
throw error44;
|
303585
|
+
}).finally(() => {
|
303586
|
+
cleanups.forEach((cleanup) => cleanup());
|
303587
|
+
screen.done({ clearContent: Boolean(context.clearPromptOnDone) });
|
303588
|
+
output.end();
|
303589
|
+
}).then(() => promise4), { cancel: cancel3 });
|
303590
|
+
});
|
303591
|
+
};
|
303592
|
+
return prompt;
|
303593
|
+
}
|
303016
303594
|
// ../../node_modules/@inquirer/input/dist/esm/index.js
|
303017
303595
|
var inputTheme = {
|
303018
303596
|
validationFailureMode: "keep"
|
303019
303597
|
};
|
303020
|
-
var esm_default2 =
|
303598
|
+
var esm_default2 = createPrompt2((config4, done) => {
|
303021
303599
|
const { required: required4, validate: validate3 = () => true } = config4;
|
303022
|
-
const theme =
|
303023
|
-
const [status, setStatus] =
|
303024
|
-
const [defaultValue = "", setDefaultValue] =
|
303025
|
-
const [errorMsg, setError] =
|
303026
|
-
const [value4, setValue] =
|
303027
|
-
const prefix =
|
303028
|
-
|
303600
|
+
const theme = makeTheme2(inputTheme, config4.theme);
|
303601
|
+
const [status, setStatus] = useState2("idle");
|
303602
|
+
const [defaultValue = "", setDefaultValue] = useState2(config4.default);
|
303603
|
+
const [errorMsg, setError] = useState2();
|
303604
|
+
const [value4, setValue] = useState2("");
|
303605
|
+
const prefix = usePrefix2({ status, theme });
|
303606
|
+
useKeypress2(async (key3, rl) => {
|
303029
303607
|
if (status !== "idle") {
|
303030
303608
|
return;
|
303031
303609
|
}
|
303032
|
-
if (
|
303610
|
+
if (isEnterKey2(key3)) {
|
303033
303611
|
const answer = value4 || defaultValue;
|
303034
303612
|
setStatus("loading");
|
303035
303613
|
const isValid = required4 && !answer ? "You must provide a value" : await validate3(answer);
|
@@ -303046,9 +303624,9 @@ var esm_default2 = createPrompt((config4, done) => {
|
|
303046
303624
|
setError(isValid || "You must provide a valid value");
|
303047
303625
|
setStatus("idle");
|
303048
303626
|
}
|
303049
|
-
} else if (isBackspaceKey(
|
303627
|
+
} else if (isBackspaceKey(key3) && !value4) {
|
303050
303628
|
setDefaultValue(undefined);
|
303051
|
-
} else if (
|
303629
|
+
} else if (key3.name === "tab" && !value4) {
|
303052
303630
|
setDefaultValue(undefined);
|
303053
303631
|
rl.clearLine(0);
|
303054
303632
|
rl.write(defaultValue);
|
@@ -303097,14 +303675,565 @@ async function subgraphNamePrompt({
|
|
303097
303675
|
return sanitizeName(subgraphName);
|
303098
303676
|
}
|
303099
303677
|
|
303100
|
-
// ../../node_modules/@inquirer/select/dist/esm/
|
303678
|
+
// ../../node_modules/@inquirer/select/node_modules/@inquirer/core/dist/esm/lib/key.js
|
303679
|
+
var isUpKey = (key3) => key3.name === "up" || key3.name === "k" || key3.ctrl && key3.name === "p";
|
303680
|
+
var isDownKey = (key3) => key3.name === "down" || key3.name === "j" || key3.ctrl && key3.name === "n";
|
303681
|
+
var isBackspaceKey2 = (key3) => key3.name === "backspace";
|
303682
|
+
var isNumberKey = (key3) => "1234567890".includes(key3.name);
|
303683
|
+
var isEnterKey3 = (key3) => key3.name === "enter" || key3.name === "return";
|
303684
|
+
// ../../node_modules/@inquirer/select/node_modules/@inquirer/core/dist/esm/lib/errors.js
|
303685
|
+
class AbortPromptError3 extends Error {
|
303686
|
+
name = "AbortPromptError";
|
303687
|
+
message = "Prompt was aborted";
|
303688
|
+
constructor(options) {
|
303689
|
+
super();
|
303690
|
+
this.cause = options?.cause;
|
303691
|
+
}
|
303692
|
+
}
|
303693
|
+
|
303694
|
+
class CancelPromptError3 extends Error {
|
303695
|
+
name = "CancelPromptError";
|
303696
|
+
message = "Prompt was canceled";
|
303697
|
+
}
|
303698
|
+
|
303699
|
+
class ExitPromptError3 extends Error {
|
303700
|
+
name = "ExitPromptError";
|
303701
|
+
}
|
303702
|
+
|
303703
|
+
class HookError3 extends Error {
|
303704
|
+
name = "HookError";
|
303705
|
+
}
|
303706
|
+
|
303707
|
+
class ValidationError3 extends Error {
|
303708
|
+
name = "ValidationError";
|
303709
|
+
}
|
303710
|
+
// ../../node_modules/@inquirer/select/node_modules/@inquirer/core/dist/esm/lib/use-state.js
|
303711
|
+
import { AsyncResource as AsyncResource8 } from "node:async_hooks";
|
303712
|
+
|
303713
|
+
// ../../node_modules/@inquirer/select/node_modules/@inquirer/core/dist/esm/lib/hook-engine.js
|
303714
|
+
import { AsyncLocalStorage as AsyncLocalStorage3, AsyncResource as AsyncResource7 } from "node:async_hooks";
|
303715
|
+
var hookStorage3 = new AsyncLocalStorage3;
|
303716
|
+
function createStore3(rl) {
|
303717
|
+
const store = {
|
303718
|
+
rl,
|
303719
|
+
hooks: [],
|
303720
|
+
hooksCleanup: [],
|
303721
|
+
hooksEffect: [],
|
303722
|
+
index: 0,
|
303723
|
+
handleChange() {}
|
303724
|
+
};
|
303725
|
+
return store;
|
303726
|
+
}
|
303727
|
+
function withHooks3(rl, cb) {
|
303728
|
+
const store = createStore3(rl);
|
303729
|
+
return hookStorage3.run(store, () => {
|
303730
|
+
function cycle(render) {
|
303731
|
+
store.handleChange = () => {
|
303732
|
+
store.index = 0;
|
303733
|
+
render();
|
303734
|
+
};
|
303735
|
+
store.handleChange();
|
303736
|
+
}
|
303737
|
+
return cb(cycle);
|
303738
|
+
});
|
303739
|
+
}
|
303740
|
+
function getStore3() {
|
303741
|
+
const store = hookStorage3.getStore();
|
303742
|
+
if (!store) {
|
303743
|
+
throw new HookError3("[Inquirer] Hook functions can only be called from within a prompt");
|
303744
|
+
}
|
303745
|
+
return store;
|
303746
|
+
}
|
303747
|
+
function readline5() {
|
303748
|
+
return getStore3().rl;
|
303749
|
+
}
|
303750
|
+
function withUpdates3(fn) {
|
303751
|
+
const wrapped = (...args) => {
|
303752
|
+
const store = getStore3();
|
303753
|
+
let shouldUpdate = false;
|
303754
|
+
const oldHandleChange = store.handleChange;
|
303755
|
+
store.handleChange = () => {
|
303756
|
+
shouldUpdate = true;
|
303757
|
+
};
|
303758
|
+
const returnValue = fn(...args);
|
303759
|
+
if (shouldUpdate) {
|
303760
|
+
oldHandleChange();
|
303761
|
+
}
|
303762
|
+
store.handleChange = oldHandleChange;
|
303763
|
+
return returnValue;
|
303764
|
+
};
|
303765
|
+
return AsyncResource7.bind(wrapped);
|
303766
|
+
}
|
303767
|
+
function withPointer3(cb) {
|
303768
|
+
const store = getStore3();
|
303769
|
+
const { index } = store;
|
303770
|
+
const pointer = {
|
303771
|
+
get() {
|
303772
|
+
return store.hooks[index];
|
303773
|
+
},
|
303774
|
+
set(value4) {
|
303775
|
+
store.hooks[index] = value4;
|
303776
|
+
},
|
303777
|
+
initialized: index in store.hooks
|
303778
|
+
};
|
303779
|
+
const returnValue = cb(pointer);
|
303780
|
+
store.index++;
|
303781
|
+
return returnValue;
|
303782
|
+
}
|
303783
|
+
function handleChange3() {
|
303784
|
+
getStore3().handleChange();
|
303785
|
+
}
|
303786
|
+
var effectScheduler3 = {
|
303787
|
+
queue(cb) {
|
303788
|
+
const store = getStore3();
|
303789
|
+
const { index } = store;
|
303790
|
+
store.hooksEffect.push(() => {
|
303791
|
+
store.hooksCleanup[index]?.();
|
303792
|
+
const cleanFn = cb(readline5());
|
303793
|
+
if (cleanFn != null && typeof cleanFn !== "function") {
|
303794
|
+
throw new ValidationError3("useEffect return value must be a cleanup function or nothing.");
|
303795
|
+
}
|
303796
|
+
store.hooksCleanup[index] = cleanFn;
|
303797
|
+
});
|
303798
|
+
},
|
303799
|
+
run() {
|
303800
|
+
const store = getStore3();
|
303801
|
+
withUpdates3(() => {
|
303802
|
+
store.hooksEffect.forEach((effect) => {
|
303803
|
+
effect();
|
303804
|
+
});
|
303805
|
+
store.hooksEffect.length = 0;
|
303806
|
+
})();
|
303807
|
+
},
|
303808
|
+
clearAll() {
|
303809
|
+
const store = getStore3();
|
303810
|
+
store.hooksCleanup.forEach((cleanFn) => {
|
303811
|
+
cleanFn?.();
|
303812
|
+
});
|
303813
|
+
store.hooksEffect.length = 0;
|
303814
|
+
store.hooksCleanup.length = 0;
|
303815
|
+
}
|
303816
|
+
};
|
303817
|
+
|
303818
|
+
// ../../node_modules/@inquirer/select/node_modules/@inquirer/core/dist/esm/lib/use-state.js
|
303819
|
+
function useState3(defaultValue) {
|
303820
|
+
return withPointer3((pointer) => {
|
303821
|
+
const setState = AsyncResource8.bind(function setState(newValue) {
|
303822
|
+
if (pointer.get() !== newValue) {
|
303823
|
+
pointer.set(newValue);
|
303824
|
+
handleChange3();
|
303825
|
+
}
|
303826
|
+
});
|
303827
|
+
if (pointer.initialized) {
|
303828
|
+
return [pointer.get(), setState];
|
303829
|
+
}
|
303830
|
+
const value4 = typeof defaultValue === "function" ? defaultValue() : defaultValue;
|
303831
|
+
pointer.set(value4);
|
303832
|
+
return [value4, setState];
|
303833
|
+
});
|
303834
|
+
}
|
303835
|
+
|
303836
|
+
// ../../node_modules/@inquirer/select/node_modules/@inquirer/core/dist/esm/lib/use-effect.js
|
303837
|
+
function useEffect3(cb, depArray) {
|
303838
|
+
withPointer3((pointer) => {
|
303839
|
+
const oldDeps = pointer.get();
|
303840
|
+
const hasChanged = !Array.isArray(oldDeps) || depArray.some((dep, i6) => !Object.is(dep, oldDeps[i6]));
|
303841
|
+
if (hasChanged) {
|
303842
|
+
effectScheduler3.queue(cb);
|
303843
|
+
}
|
303844
|
+
pointer.set(depArray);
|
303845
|
+
});
|
303846
|
+
}
|
303847
|
+
|
303848
|
+
// ../../node_modules/@inquirer/select/node_modules/@inquirer/core/dist/esm/lib/theme.js
|
303101
303849
|
var import_yoctocolors_cjs3 = __toESM(require_yoctocolors_cjs(), 1);
|
303102
|
-
var
|
303850
|
+
var defaultTheme3 = {
|
303851
|
+
prefix: {
|
303852
|
+
idle: import_yoctocolors_cjs3.default.blue("?"),
|
303853
|
+
done: import_yoctocolors_cjs3.default.green(esm_default.tick)
|
303854
|
+
},
|
303855
|
+
spinner: {
|
303856
|
+
interval: 80,
|
303857
|
+
frames: ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"].map((frame) => import_yoctocolors_cjs3.default.yellow(frame))
|
303858
|
+
},
|
303859
|
+
style: {
|
303860
|
+
answer: import_yoctocolors_cjs3.default.cyan,
|
303861
|
+
message: import_yoctocolors_cjs3.default.bold,
|
303862
|
+
error: (text2) => import_yoctocolors_cjs3.default.red(`> ${text2}`),
|
303863
|
+
defaultAnswer: (text2) => import_yoctocolors_cjs3.default.dim(`(${text2})`),
|
303864
|
+
help: import_yoctocolors_cjs3.default.dim,
|
303865
|
+
highlight: import_yoctocolors_cjs3.default.cyan,
|
303866
|
+
key: (text2) => import_yoctocolors_cjs3.default.cyan(import_yoctocolors_cjs3.default.bold(`<${text2}>`))
|
303867
|
+
}
|
303868
|
+
};
|
303869
|
+
|
303870
|
+
// ../../node_modules/@inquirer/select/node_modules/@inquirer/core/dist/esm/lib/make-theme.js
|
303871
|
+
function isPlainObject7(value4) {
|
303872
|
+
if (typeof value4 !== "object" || value4 === null)
|
303873
|
+
return false;
|
303874
|
+
let proto = value4;
|
303875
|
+
while (Object.getPrototypeOf(proto) !== null) {
|
303876
|
+
proto = Object.getPrototypeOf(proto);
|
303877
|
+
}
|
303878
|
+
return Object.getPrototypeOf(value4) === proto;
|
303879
|
+
}
|
303880
|
+
function deepMerge4(...objects) {
|
303881
|
+
const output = {};
|
303882
|
+
for (const obj of objects) {
|
303883
|
+
for (const [key3, value4] of Object.entries(obj)) {
|
303884
|
+
const prevValue = output[key3];
|
303885
|
+
output[key3] = isPlainObject7(prevValue) && isPlainObject7(value4) ? deepMerge4(prevValue, value4) : value4;
|
303886
|
+
}
|
303887
|
+
}
|
303888
|
+
return output;
|
303889
|
+
}
|
303890
|
+
function makeTheme3(...themes) {
|
303891
|
+
const themesToMerge = [
|
303892
|
+
defaultTheme3,
|
303893
|
+
...themes.filter((theme) => theme != null)
|
303894
|
+
];
|
303895
|
+
return deepMerge4(...themesToMerge);
|
303896
|
+
}
|
303897
|
+
|
303898
|
+
// ../../node_modules/@inquirer/select/node_modules/@inquirer/core/dist/esm/lib/use-prefix.js
|
303899
|
+
function usePrefix3({ status = "idle", theme }) {
|
303900
|
+
const [showLoader, setShowLoader] = useState3(false);
|
303901
|
+
const [tick, setTick] = useState3(0);
|
303902
|
+
const { prefix, spinner: spinner2 } = makeTheme3(theme);
|
303903
|
+
useEffect3(() => {
|
303904
|
+
if (status === "loading") {
|
303905
|
+
let tickInterval;
|
303906
|
+
let inc = -1;
|
303907
|
+
const delayTimeout = setTimeout(() => {
|
303908
|
+
setShowLoader(true);
|
303909
|
+
tickInterval = setInterval(() => {
|
303910
|
+
inc = inc + 1;
|
303911
|
+
setTick(inc % spinner2.frames.length);
|
303912
|
+
}, spinner2.interval);
|
303913
|
+
}, 300);
|
303914
|
+
return () => {
|
303915
|
+
clearTimeout(delayTimeout);
|
303916
|
+
clearInterval(tickInterval);
|
303917
|
+
};
|
303918
|
+
} else {
|
303919
|
+
setShowLoader(false);
|
303920
|
+
}
|
303921
|
+
}, [status]);
|
303922
|
+
if (showLoader) {
|
303923
|
+
return spinner2.frames[tick];
|
303924
|
+
}
|
303925
|
+
const iconName = status === "loading" ? "idle" : status;
|
303926
|
+
return typeof prefix === "string" ? prefix : prefix[iconName] ?? prefix["idle"];
|
303927
|
+
}
|
303928
|
+
// ../../node_modules/@inquirer/select/node_modules/@inquirer/core/dist/esm/lib/use-memo.js
|
303929
|
+
function useMemo(fn, dependencies) {
|
303930
|
+
return withPointer3((pointer) => {
|
303931
|
+
const prev = pointer.get();
|
303932
|
+
if (!prev || prev.dependencies.length !== dependencies.length || prev.dependencies.some((dep, i6) => dep !== dependencies[i6])) {
|
303933
|
+
const value4 = fn();
|
303934
|
+
pointer.set({ value: value4, dependencies });
|
303935
|
+
return value4;
|
303936
|
+
}
|
303937
|
+
return prev.value;
|
303938
|
+
});
|
303939
|
+
}
|
303940
|
+
// ../../node_modules/@inquirer/select/node_modules/@inquirer/core/dist/esm/lib/use-ref.js
|
303941
|
+
function useRef3(val) {
|
303942
|
+
return useState3({ current: val })[0];
|
303943
|
+
}
|
303944
|
+
// ../../node_modules/@inquirer/select/node_modules/@inquirer/core/dist/esm/lib/use-keypress.js
|
303945
|
+
function useKeypress3(userHandler) {
|
303946
|
+
const signal = useRef3(userHandler);
|
303947
|
+
signal.current = userHandler;
|
303948
|
+
useEffect3((rl) => {
|
303949
|
+
let ignore = false;
|
303950
|
+
const handler = withUpdates3((_input, event) => {
|
303951
|
+
if (ignore)
|
303952
|
+
return;
|
303953
|
+
signal.current(event, rl);
|
303954
|
+
});
|
303955
|
+
rl.input.on("keypress", handler);
|
303956
|
+
return () => {
|
303957
|
+
ignore = true;
|
303958
|
+
rl.input.removeListener("keypress", handler);
|
303959
|
+
};
|
303960
|
+
}, []);
|
303961
|
+
}
|
303962
|
+
// ../../node_modules/@inquirer/select/node_modules/@inquirer/core/dist/esm/lib/utils.js
|
303963
|
+
var import_cli_width3 = __toESM(require_cli_width(), 1);
|
303964
|
+
var import_wrap_ansi3 = __toESM(require_wrap_ansi(), 1);
|
303965
|
+
function breakLines3(content, width) {
|
303966
|
+
return content.split(`
|
303967
|
+
`).flatMap((line) => import_wrap_ansi3.default(line, width, { trim: false, hard: true }).split(`
|
303968
|
+
`).map((str) => str.trimEnd())).join(`
|
303969
|
+
`);
|
303970
|
+
}
|
303971
|
+
function readlineWidth3() {
|
303972
|
+
return import_cli_width3.default({ defaultWidth: 80, output: readline5().output });
|
303973
|
+
}
|
303974
|
+
|
303975
|
+
// ../../node_modules/@inquirer/select/node_modules/@inquirer/core/dist/esm/lib/pagination/use-pagination.js
|
303976
|
+
function usePointerPosition({ active, renderedItems, pageSize, loop }) {
|
303977
|
+
const state = useRef3({
|
303978
|
+
lastPointer: active,
|
303979
|
+
lastActive: undefined
|
303980
|
+
});
|
303981
|
+
const { lastPointer, lastActive } = state.current;
|
303982
|
+
const middle = Math.floor(pageSize / 2);
|
303983
|
+
const renderedLength = renderedItems.reduce((acc, item) => acc + item.length, 0);
|
303984
|
+
const defaultPointerPosition = renderedItems.slice(0, active).reduce((acc, item) => acc + item.length, 0);
|
303985
|
+
let pointer = defaultPointerPosition;
|
303986
|
+
if (renderedLength > pageSize) {
|
303987
|
+
if (loop) {
|
303988
|
+
pointer = lastPointer;
|
303989
|
+
if (lastActive != null && lastActive < active && active - lastActive < pageSize) {
|
303990
|
+
pointer = Math.min(middle, Math.abs(active - lastActive) === 1 ? Math.min(lastPointer + (renderedItems[lastActive]?.length ?? 0), Math.max(defaultPointerPosition, lastPointer)) : lastPointer + active - lastActive);
|
303991
|
+
}
|
303992
|
+
} else {
|
303993
|
+
const spaceUnderActive = renderedItems.slice(active).reduce((acc, item) => acc + item.length, 0);
|
303994
|
+
pointer = spaceUnderActive < pageSize - middle ? pageSize - spaceUnderActive : Math.min(defaultPointerPosition, middle);
|
303995
|
+
}
|
303996
|
+
}
|
303997
|
+
state.current.lastPointer = pointer;
|
303998
|
+
state.current.lastActive = active;
|
303999
|
+
return pointer;
|
304000
|
+
}
|
304001
|
+
function usePagination({ items, active, renderItem, pageSize, loop = true }) {
|
304002
|
+
const width = readlineWidth3();
|
304003
|
+
const bound = (num) => (num % items.length + items.length) % items.length;
|
304004
|
+
const renderedItems = items.map((item, index) => {
|
304005
|
+
if (item == null)
|
304006
|
+
return [];
|
304007
|
+
return breakLines3(renderItem({ item, index, isActive: index === active }), width).split(`
|
304008
|
+
`);
|
304009
|
+
});
|
304010
|
+
const renderedLength = renderedItems.reduce((acc, item) => acc + item.length, 0);
|
304011
|
+
const renderItemAtIndex = (index) => renderedItems[index] ?? [];
|
304012
|
+
const pointer = usePointerPosition({ active, renderedItems, pageSize, loop });
|
304013
|
+
const activeItem = renderItemAtIndex(active).slice(0, pageSize);
|
304014
|
+
const activeItemPosition = pointer + activeItem.length <= pageSize ? pointer : pageSize - activeItem.length;
|
304015
|
+
const pageBuffer = Array.from({ length: pageSize });
|
304016
|
+
pageBuffer.splice(activeItemPosition, activeItem.length, ...activeItem);
|
304017
|
+
const itemVisited = new Set([active]);
|
304018
|
+
let bufferPointer = activeItemPosition + activeItem.length;
|
304019
|
+
let itemPointer = bound(active + 1);
|
304020
|
+
while (bufferPointer < pageSize && !itemVisited.has(itemPointer) && (loop && renderedLength > pageSize ? itemPointer !== active : itemPointer > active)) {
|
304021
|
+
const lines = renderItemAtIndex(itemPointer);
|
304022
|
+
const linesToAdd = lines.slice(0, pageSize - bufferPointer);
|
304023
|
+
pageBuffer.splice(bufferPointer, linesToAdd.length, ...linesToAdd);
|
304024
|
+
itemVisited.add(itemPointer);
|
304025
|
+
bufferPointer += linesToAdd.length;
|
304026
|
+
itemPointer = bound(itemPointer + 1);
|
304027
|
+
}
|
304028
|
+
bufferPointer = activeItemPosition - 1;
|
304029
|
+
itemPointer = bound(active - 1);
|
304030
|
+
while (bufferPointer >= 0 && !itemVisited.has(itemPointer) && (loop && renderedLength > pageSize ? itemPointer !== active : itemPointer < active)) {
|
304031
|
+
const lines = renderItemAtIndex(itemPointer);
|
304032
|
+
const linesToAdd = lines.slice(Math.max(0, lines.length - bufferPointer - 1));
|
304033
|
+
pageBuffer.splice(bufferPointer - linesToAdd.length + 1, linesToAdd.length, ...linesToAdd);
|
304034
|
+
itemVisited.add(itemPointer);
|
304035
|
+
bufferPointer -= linesToAdd.length;
|
304036
|
+
itemPointer = bound(itemPointer - 1);
|
304037
|
+
}
|
304038
|
+
return pageBuffer.filter((line) => typeof line === "string").join(`
|
304039
|
+
`);
|
304040
|
+
}
|
304041
|
+
// ../../node_modules/@inquirer/select/node_modules/@inquirer/core/dist/esm/lib/create-prompt.js
|
304042
|
+
var import_mute_stream3 = __toESM(require_lib(), 1);
|
304043
|
+
import * as readline6 from "node:readline";
|
304044
|
+
import { AsyncResource as AsyncResource9 } from "node:async_hooks";
|
304045
|
+
|
304046
|
+
// ../../node_modules/@inquirer/select/node_modules/@inquirer/core/dist/esm/lib/screen-manager.js
|
304047
|
+
var import_ansi_escapes3 = __toESM(require_ansi_escapes(), 1);
|
304048
|
+
import { stripVTControlCharacters as stripVTControlCharacters4 } from "node:util";
|
304049
|
+
var height3 = (content) => content.split(`
|
304050
|
+
`).length;
|
304051
|
+
var lastLine3 = (content) => content.split(`
|
304052
|
+
`).pop() ?? "";
|
304053
|
+
function cursorDown3(n6) {
|
304054
|
+
return n6 > 0 ? import_ansi_escapes3.default.cursorDown(n6) : "";
|
304055
|
+
}
|
304056
|
+
|
304057
|
+
class ScreenManager3 {
|
304058
|
+
height = 0;
|
304059
|
+
extraLinesUnderPrompt = 0;
|
304060
|
+
cursorPos;
|
304061
|
+
rl;
|
304062
|
+
constructor(rl) {
|
304063
|
+
this.rl = rl;
|
304064
|
+
this.cursorPos = rl.getCursorPos();
|
304065
|
+
}
|
304066
|
+
write(content) {
|
304067
|
+
this.rl.output.unmute();
|
304068
|
+
this.rl.output.write(content);
|
304069
|
+
this.rl.output.mute();
|
304070
|
+
}
|
304071
|
+
render(content, bottomContent = "") {
|
304072
|
+
const promptLine = lastLine3(content);
|
304073
|
+
const rawPromptLine = stripVTControlCharacters4(promptLine);
|
304074
|
+
let prompt = rawPromptLine;
|
304075
|
+
if (this.rl.line.length > 0) {
|
304076
|
+
prompt = prompt.slice(0, -this.rl.line.length);
|
304077
|
+
}
|
304078
|
+
this.rl.setPrompt(prompt);
|
304079
|
+
this.cursorPos = this.rl.getCursorPos();
|
304080
|
+
const width = readlineWidth3();
|
304081
|
+
content = breakLines3(content, width);
|
304082
|
+
bottomContent = breakLines3(bottomContent, width);
|
304083
|
+
if (rawPromptLine.length % width === 0) {
|
304084
|
+
content += `
|
304085
|
+
`;
|
304086
|
+
}
|
304087
|
+
let output = content + (bottomContent ? `
|
304088
|
+
` + bottomContent : "");
|
304089
|
+
const promptLineUpDiff = Math.floor(rawPromptLine.length / width) - this.cursorPos.rows;
|
304090
|
+
const bottomContentHeight = promptLineUpDiff + (bottomContent ? height3(bottomContent) : 0);
|
304091
|
+
if (bottomContentHeight > 0)
|
304092
|
+
output += import_ansi_escapes3.default.cursorUp(bottomContentHeight);
|
304093
|
+
output += import_ansi_escapes3.default.cursorTo(this.cursorPos.cols);
|
304094
|
+
this.write(cursorDown3(this.extraLinesUnderPrompt) + import_ansi_escapes3.default.eraseLines(this.height) + output);
|
304095
|
+
this.extraLinesUnderPrompt = bottomContentHeight;
|
304096
|
+
this.height = height3(output);
|
304097
|
+
}
|
304098
|
+
checkCursorPos() {
|
304099
|
+
const cursorPos = this.rl.getCursorPos();
|
304100
|
+
if (cursorPos.cols !== this.cursorPos.cols) {
|
304101
|
+
this.write(import_ansi_escapes3.default.cursorTo(cursorPos.cols));
|
304102
|
+
this.cursorPos = cursorPos;
|
304103
|
+
}
|
304104
|
+
}
|
304105
|
+
done({ clearContent }) {
|
304106
|
+
this.rl.setPrompt("");
|
304107
|
+
let output = cursorDown3(this.extraLinesUnderPrompt);
|
304108
|
+
output += clearContent ? import_ansi_escapes3.default.eraseLines(this.height) : `
|
304109
|
+
`;
|
304110
|
+
output += import_ansi_escapes3.default.cursorShow;
|
304111
|
+
this.write(output);
|
304112
|
+
this.rl.close();
|
304113
|
+
}
|
304114
|
+
}
|
304115
|
+
|
304116
|
+
// ../../node_modules/@inquirer/select/node_modules/@inquirer/core/dist/esm/lib/promise-polyfill.js
|
304117
|
+
class PromisePolyfill3 extends Promise {
|
304118
|
+
static withResolver() {
|
304119
|
+
let resolve5;
|
304120
|
+
let reject;
|
304121
|
+
const promise4 = new Promise((res, rej) => {
|
304122
|
+
resolve5 = res;
|
304123
|
+
reject = rej;
|
304124
|
+
});
|
304125
|
+
return { promise: promise4, resolve: resolve5, reject };
|
304126
|
+
}
|
304127
|
+
}
|
304128
|
+
|
304129
|
+
// ../../node_modules/@inquirer/select/node_modules/@inquirer/core/dist/esm/lib/create-prompt.js
|
304130
|
+
function getCallSites3() {
|
304131
|
+
const _prepareStackTrace = Error.prepareStackTrace;
|
304132
|
+
let result = [];
|
304133
|
+
try {
|
304134
|
+
Error.prepareStackTrace = (_5, callSites) => {
|
304135
|
+
const callSitesWithoutCurrent = callSites.slice(1);
|
304136
|
+
result = callSitesWithoutCurrent;
|
304137
|
+
return callSitesWithoutCurrent;
|
304138
|
+
};
|
304139
|
+
new Error().stack;
|
304140
|
+
} catch {
|
304141
|
+
return result;
|
304142
|
+
}
|
304143
|
+
Error.prepareStackTrace = _prepareStackTrace;
|
304144
|
+
return result;
|
304145
|
+
}
|
304146
|
+
function createPrompt3(view) {
|
304147
|
+
const callSites = getCallSites3();
|
304148
|
+
const prompt = (config4, context = {}) => {
|
304149
|
+
const { input = process.stdin, signal } = context;
|
304150
|
+
const cleanups = new Set;
|
304151
|
+
const output = new import_mute_stream3.default;
|
304152
|
+
output.pipe(context.output ?? process.stdout);
|
304153
|
+
const rl = readline6.createInterface({
|
304154
|
+
terminal: true,
|
304155
|
+
input,
|
304156
|
+
output
|
304157
|
+
});
|
304158
|
+
const screen = new ScreenManager3(rl);
|
304159
|
+
const { promise: promise4, resolve: resolve5, reject } = PromisePolyfill3.withResolver();
|
304160
|
+
const cancel3 = () => reject(new CancelPromptError3);
|
304161
|
+
if (signal) {
|
304162
|
+
const abort = () => reject(new AbortPromptError3({ cause: signal.reason }));
|
304163
|
+
if (signal.aborted) {
|
304164
|
+
abort();
|
304165
|
+
return Object.assign(promise4, { cancel: cancel3 });
|
304166
|
+
}
|
304167
|
+
signal.addEventListener("abort", abort);
|
304168
|
+
cleanups.add(() => signal.removeEventListener("abort", abort));
|
304169
|
+
}
|
304170
|
+
cleanups.add(onExit((code2, signal2) => {
|
304171
|
+
reject(new ExitPromptError3(`User force closed the prompt with ${code2} ${signal2}`));
|
304172
|
+
}));
|
304173
|
+
const sigint = () => reject(new ExitPromptError3(`User force closed the prompt with SIGINT`));
|
304174
|
+
rl.on("SIGINT", sigint);
|
304175
|
+
cleanups.add(() => rl.removeListener("SIGINT", sigint));
|
304176
|
+
const checkCursorPos = () => screen.checkCursorPos();
|
304177
|
+
rl.input.on("keypress", checkCursorPos);
|
304178
|
+
cleanups.add(() => rl.input.removeListener("keypress", checkCursorPos));
|
304179
|
+
return withHooks3(rl, (cycle) => {
|
304180
|
+
const hooksCleanup = AsyncResource9.bind(() => effectScheduler3.clearAll());
|
304181
|
+
rl.on("close", hooksCleanup);
|
304182
|
+
cleanups.add(() => rl.removeListener("close", hooksCleanup));
|
304183
|
+
cycle(() => {
|
304184
|
+
try {
|
304185
|
+
const nextView = view(config4, (value4) => {
|
304186
|
+
setImmediate(() => resolve5(value4));
|
304187
|
+
});
|
304188
|
+
if (nextView === undefined) {
|
304189
|
+
const callerFilename = callSites[1]?.getFileName();
|
304190
|
+
throw new Error(`Prompt functions must return a string.
|
304191
|
+
at ${callerFilename}`);
|
304192
|
+
}
|
304193
|
+
const [content, bottomContent] = typeof nextView === "string" ? [nextView] : nextView;
|
304194
|
+
screen.render(content, bottomContent);
|
304195
|
+
effectScheduler3.run();
|
304196
|
+
} catch (error44) {
|
304197
|
+
reject(error44);
|
304198
|
+
}
|
304199
|
+
});
|
304200
|
+
return Object.assign(promise4.then((answer) => {
|
304201
|
+
effectScheduler3.clearAll();
|
304202
|
+
return answer;
|
304203
|
+
}, (error44) => {
|
304204
|
+
effectScheduler3.clearAll();
|
304205
|
+
throw error44;
|
304206
|
+
}).finally(() => {
|
304207
|
+
cleanups.forEach((cleanup) => cleanup());
|
304208
|
+
screen.done({ clearContent: Boolean(context.clearPromptOnDone) });
|
304209
|
+
output.end();
|
304210
|
+
}).then(() => promise4), { cancel: cancel3 });
|
304211
|
+
});
|
304212
|
+
};
|
304213
|
+
return prompt;
|
304214
|
+
}
|
304215
|
+
// ../../node_modules/@inquirer/select/node_modules/@inquirer/core/dist/esm/lib/Separator.js
|
304216
|
+
var import_yoctocolors_cjs4 = __toESM(require_yoctocolors_cjs(), 1);
|
304217
|
+
class Separator {
|
304218
|
+
separator = import_yoctocolors_cjs4.default.dim(Array.from({ length: 15 }).join(esm_default.line));
|
304219
|
+
type = "separator";
|
304220
|
+
constructor(separator) {
|
304221
|
+
if (separator) {
|
304222
|
+
this.separator = separator;
|
304223
|
+
}
|
304224
|
+
}
|
304225
|
+
static isSeparator(choice) {
|
304226
|
+
return Boolean(choice && typeof choice === "object" && "type" in choice && choice.type === "separator");
|
304227
|
+
}
|
304228
|
+
}
|
304229
|
+
// ../../node_modules/@inquirer/select/dist/esm/index.js
|
304230
|
+
var import_yoctocolors_cjs5 = __toESM(require_yoctocolors_cjs(), 1);
|
304231
|
+
var import_ansi_escapes4 = __toESM(require_ansi_escapes(), 1);
|
303103
304232
|
var selectTheme = {
|
303104
304233
|
icon: { cursor: esm_default.pointer },
|
303105
304234
|
style: {
|
303106
|
-
disabled: (text2) =>
|
303107
|
-
description: (text2) =>
|
304235
|
+
disabled: (text2) => import_yoctocolors_cjs5.default.dim(`- ${text2}`),
|
304236
|
+
description: (text2) => import_yoctocolors_cjs5.default.cyan(text2)
|
303108
304237
|
},
|
303109
304238
|
helpMode: "auto",
|
303110
304239
|
indexMode: "hidden"
|
@@ -303137,19 +304266,19 @@ function normalizeChoices(choices) {
|
|
303137
304266
|
return normalizedChoice;
|
303138
304267
|
});
|
303139
304268
|
}
|
303140
|
-
var esm_default3 =
|
304269
|
+
var esm_default3 = createPrompt3((config4, done) => {
|
303141
304270
|
const { loop = true, pageSize = 7 } = config4;
|
303142
|
-
const firstRender =
|
303143
|
-
const theme =
|
303144
|
-
const [status, setStatus] =
|
303145
|
-
const prefix =
|
303146
|
-
const searchTimeoutRef =
|
304271
|
+
const firstRender = useRef3(true);
|
304272
|
+
const theme = makeTheme3(selectTheme, config4.theme);
|
304273
|
+
const [status, setStatus] = useState3("idle");
|
304274
|
+
const prefix = usePrefix3({ status, theme });
|
304275
|
+
const searchTimeoutRef = useRef3();
|
303147
304276
|
const items = useMemo(() => normalizeChoices(config4.choices), [config4.choices]);
|
303148
304277
|
const bounds = useMemo(() => {
|
303149
304278
|
const first = items.findIndex(isSelectable);
|
303150
304279
|
const last = items.findLastIndex(isSelectable);
|
303151
304280
|
if (first === -1) {
|
303152
|
-
throw new
|
304281
|
+
throw new ValidationError3("[select prompt] No selectable choices. All choices are disabled.");
|
303153
304282
|
}
|
303154
304283
|
return { first, last };
|
303155
304284
|
}, [items]);
|
@@ -303158,24 +304287,24 @@ var esm_default3 = createPrompt((config4, done) => {
|
|
303158
304287
|
return -1;
|
303159
304288
|
return items.findIndex((item) => isSelectable(item) && item.value === config4.default);
|
303160
304289
|
}, [config4.default, items]);
|
303161
|
-
const [active, setActive] =
|
304290
|
+
const [active, setActive] = useState3(defaultItemIndex === -1 ? bounds.first : defaultItemIndex);
|
303162
304291
|
const selectedChoice = items[active];
|
303163
|
-
|
304292
|
+
useKeypress3((key4, rl) => {
|
303164
304293
|
clearTimeout(searchTimeoutRef.current);
|
303165
|
-
if (
|
304294
|
+
if (isEnterKey3(key4)) {
|
303166
304295
|
setStatus("done");
|
303167
304296
|
done(selectedChoice.value);
|
303168
|
-
} else if (isUpKey(
|
304297
|
+
} else if (isUpKey(key4) || isDownKey(key4)) {
|
303169
304298
|
rl.clearLine(0);
|
303170
|
-
if (loop || isUpKey(
|
303171
|
-
const offset = isUpKey(
|
304299
|
+
if (loop || isUpKey(key4) && active !== bounds.first || isDownKey(key4) && active !== bounds.last) {
|
304300
|
+
const offset = isUpKey(key4) ? -1 : 1;
|
303172
304301
|
let next = active;
|
303173
304302
|
do {
|
303174
304303
|
next = (next + offset + items.length) % items.length;
|
303175
304304
|
} while (!isSelectable(items[next]));
|
303176
304305
|
setActive(next);
|
303177
304306
|
}
|
303178
|
-
} else if (isNumberKey(
|
304307
|
+
} else if (isNumberKey(key4) && !Number.isNaN(Number(rl.line))) {
|
303179
304308
|
const position = Number(rl.line) - 1;
|
303180
304309
|
const item = items[position];
|
303181
304310
|
if (item != null && isSelectable(item)) {
|
@@ -303184,7 +304313,7 @@ var esm_default3 = createPrompt((config4, done) => {
|
|
303184
304313
|
searchTimeoutRef.current = setTimeout(() => {
|
303185
304314
|
rl.clearLine(0);
|
303186
304315
|
}, 700);
|
303187
|
-
} else if (
|
304316
|
+
} else if (isBackspaceKey2(key4)) {
|
303188
304317
|
rl.clearLine(0);
|
303189
304318
|
} else {
|
303190
304319
|
const searchTerm = rl.line.toLowerCase();
|
@@ -303201,7 +304330,7 @@ var esm_default3 = createPrompt((config4, done) => {
|
|
303201
304330
|
}, 700);
|
303202
304331
|
}
|
303203
304332
|
});
|
303204
|
-
|
304333
|
+
useEffect3(() => () => {
|
303205
304334
|
clearTimeout(searchTimeoutRef.current);
|
303206
304335
|
}, []);
|
303207
304336
|
const message = theme.style.message(config4.message, status);
|
@@ -303241,7 +304370,7 @@ ${theme.style.help(`(${config4.instructions?.pager ?? "Use arrow keys to reveal
|
|
303241
304370
|
const choiceDescription = selectedChoice.description ? `
|
303242
304371
|
${theme.style.description(selectedChoice.description)}` : ``;
|
303243
304372
|
return `${[prefix, message, helpTipTop].filter(Boolean).join(" ")}
|
303244
|
-
${page}${helpTipBottom}${choiceDescription}${
|
304373
|
+
${page}${helpTipBottom}${choiceDescription}${import_ansi_escapes4.default.cursorHide}`;
|
303245
304374
|
});
|
303246
304375
|
|
303247
304376
|
// src/prompts/smart-contract-set/subgraph.prompt.ts
|
@@ -304822,14 +305951,14 @@ function includesArgs(parameters) {
|
|
304822
305951
|
});
|
304823
305952
|
}
|
304824
305953
|
if (typeof args === "object" && !Array.isArray(args) && typeof matchArgs === "object" && !Array.isArray(matchArgs))
|
304825
|
-
return Object.entries(matchArgs).every(([
|
305954
|
+
return Object.entries(matchArgs).every(([key4, value4]) => {
|
304826
305955
|
if (value4 === null || value4 === undefined)
|
304827
305956
|
return true;
|
304828
|
-
const input = inputs.find((input2) => input2.name ===
|
305957
|
+
const input = inputs.find((input2) => input2.name === key4);
|
304829
305958
|
if (!input)
|
304830
305959
|
return false;
|
304831
305960
|
const value_ = Array.isArray(value4) ? value4 : [value4];
|
304832
|
-
return value_.some((value5) => isEqual(input, value5, args[
|
305961
|
+
return value_.some((value5) => isEqual(input, value5, args[key4]));
|
304833
305962
|
});
|
304834
305963
|
return false;
|
304835
305964
|
}
|
@@ -305028,13 +306157,13 @@ function observe(observerId, callbacks, fn) {
|
|
305028
306157
|
if (listeners && listeners.length > 0)
|
305029
306158
|
return unwatch;
|
305030
306159
|
const emit = {};
|
305031
|
-
for (const
|
305032
|
-
emit[
|
306160
|
+
for (const key4 in callbacks) {
|
306161
|
+
emit[key4] = (...args) => {
|
305033
306162
|
const listeners2 = getListeners();
|
305034
306163
|
if (listeners2.length === 0)
|
305035
306164
|
return;
|
305036
306165
|
for (const listener of listeners2)
|
305037
|
-
listener.fns[
|
306166
|
+
listener.fns[key4]?.(...args);
|
305038
306167
|
};
|
305039
306168
|
}
|
305040
306169
|
const cleanup = fn(emit);
|
@@ -305373,7 +306502,7 @@ function uid(length = 11) {
|
|
305373
306502
|
|
305374
306503
|
// ../../node_modules/viem/_esm/clients/createClient.js
|
305375
306504
|
function createClient(parameters) {
|
305376
|
-
const { batch, chain, ccipRead, key:
|
306505
|
+
const { batch, chain, ccipRead, key: key4 = "base", name: name3 = "Base Client", type: type4 = "base" } = parameters;
|
305377
306506
|
const blockTime = chain?.blockTime ?? 12000;
|
305378
306507
|
const defaultPollingInterval = Math.min(Math.max(Math.floor(blockTime / 2), 500), 4000);
|
305379
306508
|
const pollingInterval = parameters.pollingInterval ?? defaultPollingInterval;
|
@@ -305390,7 +306519,7 @@ function createClient(parameters) {
|
|
305390
306519
|
cacheTime,
|
305391
306520
|
ccipRead,
|
305392
306521
|
chain,
|
305393
|
-
key:
|
306522
|
+
key: key4,
|
305394
306523
|
name: name3,
|
305395
306524
|
pollingInterval,
|
305396
306525
|
request: request2,
|
@@ -305401,8 +306530,8 @@ function createClient(parameters) {
|
|
305401
306530
|
function extend4(base2) {
|
305402
306531
|
return (extendFn) => {
|
305403
306532
|
const extended = extendFn(base2);
|
305404
|
-
for (const
|
305405
|
-
delete extended[
|
306533
|
+
for (const key5 in client)
|
306534
|
+
delete extended[key5];
|
305406
306535
|
const combined = { ...base2, ...extended };
|
305407
306536
|
return Object.assign(combined, { extend: extend4(combined) });
|
305408
306537
|
};
|
@@ -305582,11 +306711,11 @@ function shouldRetry(error44) {
|
|
305582
306711
|
}
|
305583
306712
|
|
305584
306713
|
// ../../node_modules/viem/_esm/clients/transports/createTransport.js
|
305585
|
-
function createTransport({ key:
|
306714
|
+
function createTransport({ key: key4, methods, name: name3, request: request2, retryCount = 3, retryDelay = 150, timeout, type: type4 }, value4) {
|
305586
306715
|
const uid2 = uid();
|
305587
306716
|
return {
|
305588
306717
|
config: {
|
305589
|
-
key:
|
306718
|
+
key: key4,
|
305590
306719
|
methods,
|
305591
306720
|
name: name3,
|
305592
306721
|
request: request2,
|
@@ -305743,7 +306872,7 @@ function getHttpRpcClient(url4, options = {}) {
|
|
305743
306872
|
|
305744
306873
|
// ../../node_modules/viem/_esm/clients/transports/http.js
|
305745
306874
|
function http(url4, config4 = {}) {
|
305746
|
-
const { batch, fetchOptions, key:
|
306875
|
+
const { batch, fetchOptions, key: key4 = "http", methods, name: name3 = "HTTP JSON-RPC", onFetchRequest, onFetchResponse, retryDelay, raw } = config4;
|
305747
306876
|
return ({ chain, retryCount: retryCount_, timeout: timeout_ }) => {
|
305748
306877
|
const { batchSize = 1000, wait: wait2 = 0 } = typeof batch === "object" ? batch : {};
|
305749
306878
|
const retryCount = config4.retryCount ?? retryCount_;
|
@@ -305758,7 +306887,7 @@ function http(url4, config4 = {}) {
|
|
305758
306887
|
timeout
|
305759
306888
|
});
|
305760
306889
|
return createTransport({
|
305761
|
-
key:
|
306890
|
+
key: key4,
|
305762
306891
|
methods,
|
305763
306892
|
name: name3,
|
305764
306893
|
async request({ method, params }) {
|
@@ -306209,7 +307338,7 @@ init_getChainContractAddress();
|
|
306209
307338
|
init_toHex();
|
306210
307339
|
init_localBatchGatewayRequest();
|
306211
307340
|
async function getEnsText(client, parameters) {
|
306212
|
-
const { blockNumber, blockTag, key:
|
307341
|
+
const { blockNumber, blockTag, key: key4, name: name3, gatewayUrls, strict } = parameters;
|
306213
307342
|
const { chain } = client;
|
306214
307343
|
const universalResolverAddress = (() => {
|
306215
307344
|
if (parameters.universalResolverAddress)
|
@@ -306235,7 +307364,7 @@ async function getEnsText(client, parameters) {
|
|
306235
307364
|
encodeFunctionData({
|
306236
307365
|
abi: textResolverAbi,
|
306237
307366
|
functionName: "text",
|
306238
|
-
args: [namehash(name3),
|
307367
|
+
args: [namehash(name3), key4]
|
306239
307368
|
}),
|
306240
307369
|
gatewayUrls ?? [localBatchGatewayUrl]
|
306241
307370
|
],
|
@@ -307258,16 +308387,16 @@ class LruMap2 extends Map {
|
|
307258
308387
|
});
|
307259
308388
|
this.maxSize = size5;
|
307260
308389
|
}
|
307261
|
-
get(
|
307262
|
-
const value4 = super.get(
|
307263
|
-
if (super.has(
|
307264
|
-
this.delete(
|
307265
|
-
super.set(
|
308390
|
+
get(key4) {
|
308391
|
+
const value4 = super.get(key4);
|
308392
|
+
if (super.has(key4) && value4 !== undefined) {
|
308393
|
+
this.delete(key4);
|
308394
|
+
super.set(key4, value4);
|
307266
308395
|
}
|
307267
308396
|
return value4;
|
307268
308397
|
}
|
307269
|
-
set(
|
307270
|
-
super.set(
|
308398
|
+
set(key4, value4) {
|
308399
|
+
super.set(key4, value4);
|
307271
308400
|
if (this.maxSize && this.size > this.maxSize) {
|
307272
308401
|
const firstKey = this.keys().next().value;
|
307273
308402
|
if (firstKey)
|
@@ -309110,10 +310239,10 @@ function publicActions(client) {
|
|
309110
310239
|
|
309111
310240
|
// ../../node_modules/viem/_esm/clients/createPublicClient.js
|
309112
310241
|
function createPublicClient(parameters) {
|
309113
|
-
const { key:
|
310242
|
+
const { key: key4 = "public", name: name3 = "Public Client" } = parameters;
|
309114
310243
|
const client = createClient({
|
309115
310244
|
...parameters,
|
309116
|
-
key:
|
310245
|
+
key: key4,
|
309117
310246
|
name: name3,
|
309118
310247
|
type: "publicClient"
|
309119
310248
|
});
|
@@ -309214,7 +310343,7 @@ __export4(util_exports3, {
|
|
309214
310343
|
getParsedType: () => getParsedType4,
|
309215
310344
|
getSizableOrigin: () => getSizableOrigin4,
|
309216
310345
|
isObject: () => isObject4,
|
309217
|
-
isPlainObject: () =>
|
310346
|
+
isPlainObject: () => isPlainObject8,
|
309218
310347
|
issue: () => issue4,
|
309219
310348
|
joinValues: () => joinValues4,
|
309220
310349
|
jsonStringifyReplacer: () => jsonStringifyReplacer4,
|
@@ -309286,19 +310415,19 @@ function floatSafeRemainder4(val, step) {
|
|
309286
310415
|
const stepInt = Number.parseInt(step.toFixed(decCount).replace(".", ""));
|
309287
310416
|
return valInt % stepInt / 10 ** decCount;
|
309288
310417
|
}
|
309289
|
-
function defineLazy4(object$1,
|
310418
|
+
function defineLazy4(object$1, key4, getter) {
|
309290
310419
|
const set$1 = false;
|
309291
|
-
Object.defineProperty(object$1,
|
310420
|
+
Object.defineProperty(object$1, key4, {
|
309292
310421
|
get() {
|
309293
310422
|
if (!set$1) {
|
309294
310423
|
const value4 = getter();
|
309295
|
-
object$1[
|
310424
|
+
object$1[key4] = value4;
|
309296
310425
|
return value4;
|
309297
310426
|
}
|
309298
310427
|
throw new Error("cached value already set");
|
309299
310428
|
},
|
309300
310429
|
set(v6) {
|
309301
|
-
Object.defineProperty(object$1,
|
310430
|
+
Object.defineProperty(object$1, key4, { value: v6 });
|
309302
310431
|
},
|
309303
310432
|
configurable: true
|
309304
310433
|
});
|
@@ -309314,11 +310443,11 @@ function assignProp4(target, prop, value4) {
|
|
309314
310443
|
function getElementAtPath4(obj, path7) {
|
309315
310444
|
if (!path7)
|
309316
310445
|
return obj;
|
309317
|
-
return path7.reduce((acc,
|
310446
|
+
return path7.reduce((acc, key4) => acc?.[key4], obj);
|
309318
310447
|
}
|
309319
310448
|
function promiseAllObject4(promisesObj) {
|
309320
310449
|
const keys = Object.keys(promisesObj);
|
309321
|
-
const promises = keys.map((
|
310450
|
+
const promises = keys.map((key4) => promisesObj[key4]);
|
309322
310451
|
return Promise.all(promises).then((results) => {
|
309323
310452
|
const resolvedObj = {};
|
309324
310453
|
for (let i6 = 0;i6 < keys.length; i6++) {
|
@@ -309350,7 +310479,7 @@ var allowsEval4 = cached4(() => {
|
|
309350
310479
|
return false;
|
309351
310480
|
}
|
309352
310481
|
});
|
309353
|
-
function
|
310482
|
+
function isPlainObject8(o8) {
|
309354
310483
|
if (isObject4(o8) === false)
|
309355
310484
|
return false;
|
309356
310485
|
const ctor = o8.constructor;
|
@@ -309366,8 +310495,8 @@ function isPlainObject6(o8) {
|
|
309366
310495
|
}
|
309367
310496
|
function numKeys4(data) {
|
309368
310497
|
let keyCount = 0;
|
309369
|
-
for (const
|
309370
|
-
if (Object.prototype.hasOwnProperty.call(data,
|
310498
|
+
for (const key4 in data) {
|
310499
|
+
if (Object.prototype.hasOwnProperty.call(data, key4)) {
|
309371
310500
|
keyCount++;
|
309372
310501
|
}
|
309373
310502
|
}
|
@@ -309517,13 +310646,13 @@ var BIGINT_FORMAT_RANGES4 = {
|
|
309517
310646
|
function pick4(schema, mask) {
|
309518
310647
|
const newShape = {};
|
309519
310648
|
const currDef = schema._zod.def;
|
309520
|
-
for (const
|
309521
|
-
if (!(
|
309522
|
-
throw new Error(`Unrecognized key: "${
|
310649
|
+
for (const key4 in mask) {
|
310650
|
+
if (!(key4 in currDef.shape)) {
|
310651
|
+
throw new Error(`Unrecognized key: "${key4}"`);
|
309523
310652
|
}
|
309524
|
-
if (!mask[
|
310653
|
+
if (!mask[key4])
|
309525
310654
|
continue;
|
309526
|
-
newShape[
|
310655
|
+
newShape[key4] = currDef.shape[key4];
|
309527
310656
|
}
|
309528
310657
|
return clone4(schema, {
|
309529
310658
|
...schema._zod.def,
|
@@ -309534,13 +310663,13 @@ function pick4(schema, mask) {
|
|
309534
310663
|
function omit4(schema, mask) {
|
309535
310664
|
const newShape = { ...schema._zod.def.shape };
|
309536
310665
|
const currDef = schema._zod.def;
|
309537
|
-
for (const
|
309538
|
-
if (!(
|
309539
|
-
throw new Error(`Unrecognized key: "${
|
310666
|
+
for (const key4 in mask) {
|
310667
|
+
if (!(key4 in currDef.shape)) {
|
310668
|
+
throw new Error(`Unrecognized key: "${key4}"`);
|
309540
310669
|
}
|
309541
|
-
if (!mask[
|
310670
|
+
if (!mask[key4])
|
309542
310671
|
continue;
|
309543
|
-
delete newShape[
|
310672
|
+
delete newShape[key4];
|
309544
310673
|
}
|
309545
310674
|
return clone4(schema, {
|
309546
310675
|
...schema._zod.def,
|
@@ -309582,23 +310711,23 @@ function partial4(Class$1, schema, mask) {
|
|
309582
310711
|
const oldShape = schema._zod.def.shape;
|
309583
310712
|
const shape = { ...oldShape };
|
309584
310713
|
if (mask) {
|
309585
|
-
for (const
|
309586
|
-
if (!(
|
309587
|
-
throw new Error(`Unrecognized key: "${
|
310714
|
+
for (const key4 in mask) {
|
310715
|
+
if (!(key4 in oldShape)) {
|
310716
|
+
throw new Error(`Unrecognized key: "${key4}"`);
|
309588
310717
|
}
|
309589
|
-
if (!mask[
|
310718
|
+
if (!mask[key4])
|
309590
310719
|
continue;
|
309591
|
-
shape[
|
310720
|
+
shape[key4] = Class$1 ? new Class$1({
|
309592
310721
|
type: "optional",
|
309593
|
-
innerType: oldShape[
|
309594
|
-
}) : oldShape[
|
310722
|
+
innerType: oldShape[key4]
|
310723
|
+
}) : oldShape[key4];
|
309595
310724
|
}
|
309596
310725
|
} else {
|
309597
|
-
for (const
|
309598
|
-
shape[
|
310726
|
+
for (const key4 in oldShape) {
|
310727
|
+
shape[key4] = Class$1 ? new Class$1({
|
309599
310728
|
type: "optional",
|
309600
|
-
innerType: oldShape[
|
309601
|
-
}) : oldShape[
|
310729
|
+
innerType: oldShape[key4]
|
310730
|
+
}) : oldShape[key4];
|
309602
310731
|
}
|
309603
310732
|
}
|
309604
310733
|
return clone4(schema, {
|
@@ -309611,22 +310740,22 @@ function required4(Class$1, schema, mask) {
|
|
309611
310740
|
const oldShape = schema._zod.def.shape;
|
309612
310741
|
const shape = { ...oldShape };
|
309613
310742
|
if (mask) {
|
309614
|
-
for (const
|
309615
|
-
if (!(
|
309616
|
-
throw new Error(`Unrecognized key: "${
|
310743
|
+
for (const key4 in mask) {
|
310744
|
+
if (!(key4 in shape)) {
|
310745
|
+
throw new Error(`Unrecognized key: "${key4}"`);
|
309617
310746
|
}
|
309618
|
-
if (!mask[
|
310747
|
+
if (!mask[key4])
|
309619
310748
|
continue;
|
309620
|
-
shape[
|
310749
|
+
shape[key4] = new Class$1({
|
309621
310750
|
type: "nonoptional",
|
309622
|
-
innerType: oldShape[
|
310751
|
+
innerType: oldShape[key4]
|
309623
310752
|
});
|
309624
310753
|
}
|
309625
310754
|
} else {
|
309626
|
-
for (const
|
309627
|
-
shape[
|
310755
|
+
for (const key4 in oldShape) {
|
310756
|
+
shape[key4] = new Class$1({
|
309628
310757
|
type: "nonoptional",
|
309629
|
-
innerType: oldShape[
|
310758
|
+
innerType: oldShape[key4]
|
309630
310759
|
});
|
309631
310760
|
}
|
309632
310761
|
}
|
@@ -311206,28 +312335,28 @@ var $ZodArray4 = /* @__PURE__ */ $constructor4("$ZodArray", (inst, def) => {
|
|
311206
312335
|
return payload;
|
311207
312336
|
};
|
311208
312337
|
});
|
311209
|
-
function handleObjectResult4(result, final,
|
312338
|
+
function handleObjectResult4(result, final, key4) {
|
311210
312339
|
if (result.issues.length) {
|
311211
|
-
final.issues.push(...prefixIssues4(
|
312340
|
+
final.issues.push(...prefixIssues4(key4, result.issues));
|
311212
312341
|
}
|
311213
|
-
final.value[
|
312342
|
+
final.value[key4] = result.value;
|
311214
312343
|
}
|
311215
|
-
function handleOptionalObjectResult4(result, final,
|
312344
|
+
function handleOptionalObjectResult4(result, final, key4, input) {
|
311216
312345
|
if (result.issues.length) {
|
311217
|
-
if (input[
|
311218
|
-
if (
|
311219
|
-
final.value[
|
312346
|
+
if (input[key4] === undefined) {
|
312347
|
+
if (key4 in input) {
|
312348
|
+
final.value[key4] = undefined;
|
311220
312349
|
} else {
|
311221
|
-
final.value[
|
312350
|
+
final.value[key4] = result.value;
|
311222
312351
|
}
|
311223
312352
|
} else {
|
311224
|
-
final.issues.push(...prefixIssues4(
|
312353
|
+
final.issues.push(...prefixIssues4(key4, result.issues));
|
311225
312354
|
}
|
311226
312355
|
} else if (result.value === undefined) {
|
311227
|
-
if (
|
311228
|
-
final.value[
|
312356
|
+
if (key4 in input)
|
312357
|
+
final.value[key4] = undefined;
|
311229
312358
|
} else {
|
311230
|
-
final.value[
|
312359
|
+
final.value[key4] = result.value;
|
311231
312360
|
}
|
311232
312361
|
}
|
311233
312362
|
var $ZodObject4 = /* @__PURE__ */ $constructor4("$ZodObject", (inst, def) => {
|
@@ -311251,12 +312380,12 @@ var $ZodObject4 = /* @__PURE__ */ $constructor4("$ZodObject", (inst, def) => {
|
|
311251
312380
|
defineLazy4(inst._zod, "propValues", () => {
|
311252
312381
|
const shape = def.shape;
|
311253
312382
|
const propValues = {};
|
311254
|
-
for (const
|
311255
|
-
const field2 = shape[
|
312383
|
+
for (const key4 in shape) {
|
312384
|
+
const field2 = shape[key4]._zod;
|
311256
312385
|
if (field2.values) {
|
311257
|
-
propValues[
|
312386
|
+
propValues[key4] ?? (propValues[key4] = new Set);
|
311258
312387
|
for (const v6 of field2.values)
|
311259
|
-
propValues[
|
312388
|
+
propValues[key4].add(v6);
|
311260
312389
|
}
|
311261
312390
|
}
|
311262
312391
|
return propValues;
|
@@ -311268,21 +312397,21 @@ var $ZodObject4 = /* @__PURE__ */ $constructor4("$ZodObject", (inst, def) => {
|
|
311268
312397
|
"ctx"
|
311269
312398
|
]);
|
311270
312399
|
const { keys, optionalKeys: optionalKeys$1 } = _normalized.value;
|
311271
|
-
const parseStr = (
|
311272
|
-
const k5 = esc4(
|
312400
|
+
const parseStr = (key4) => {
|
312401
|
+
const k5 = esc4(key4);
|
311273
312402
|
return `shape[${k5}]._zod.run({ value: input[${k5}], issues: [] }, ctx)`;
|
311274
312403
|
};
|
311275
312404
|
doc2.write(`const input = payload.value;`);
|
311276
312405
|
const ids = Object.create(null);
|
311277
|
-
for (const
|
311278
|
-
ids[
|
312406
|
+
for (const key4 of keys) {
|
312407
|
+
ids[key4] = randomString4(15);
|
311279
312408
|
}
|
311280
312409
|
doc2.write(`const newResult = {}`);
|
311281
|
-
for (const
|
311282
|
-
if (optionalKeys$1.has(
|
311283
|
-
const id = ids[
|
311284
|
-
doc2.write(`const ${id} = ${parseStr(
|
311285
|
-
const k5 = esc4(
|
312410
|
+
for (const key4 of keys) {
|
312411
|
+
if (optionalKeys$1.has(key4)) {
|
312412
|
+
const id = ids[key4];
|
312413
|
+
doc2.write(`const ${id} = ${parseStr(key4)};`);
|
312414
|
+
const k5 = esc4(key4);
|
311286
312415
|
doc2.write(`
|
311287
312416
|
if (${id}.issues.length) {
|
311288
312417
|
if (input[${k5}] === undefined) {
|
@@ -311304,14 +312433,14 @@ var $ZodObject4 = /* @__PURE__ */ $constructor4("$ZodObject", (inst, def) => {
|
|
311304
312433
|
}
|
311305
312434
|
`);
|
311306
312435
|
} else {
|
311307
|
-
const id = ids[
|
311308
|
-
doc2.write(`const ${id} = ${parseStr(
|
312436
|
+
const id = ids[key4];
|
312437
|
+
doc2.write(`const ${id} = ${parseStr(key4)};`);
|
311309
312438
|
doc2.write(`
|
311310
312439
|
if (${id}.issues.length) payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
|
311311
312440
|
...iss,
|
311312
|
-
path: iss.path ? [${esc4(
|
312441
|
+
path: iss.path ? [${esc4(key4)}, ...iss.path] : [${esc4(key4)}]
|
311313
312442
|
})));`);
|
311314
|
-
doc2.write(`newResult[${esc4(
|
312443
|
+
doc2.write(`newResult[${esc4(key4)}] = ${id}.value`);
|
311315
312444
|
}
|
311316
312445
|
}
|
311317
312446
|
doc2.write(`payload.value = newResult;`);
|
@@ -311346,20 +312475,20 @@ var $ZodObject4 = /* @__PURE__ */ $constructor4("$ZodObject", (inst, def) => {
|
|
311346
312475
|
} else {
|
311347
312476
|
payload.value = {};
|
311348
312477
|
const shape = value4.shape;
|
311349
|
-
for (const
|
311350
|
-
const el = shape[
|
312478
|
+
for (const key4 of value4.keys) {
|
312479
|
+
const el = shape[key4];
|
311351
312480
|
const r6 = el._zod.run({
|
311352
|
-
value: input[
|
312481
|
+
value: input[key4],
|
311353
312482
|
issues: []
|
311354
312483
|
}, ctx);
|
311355
312484
|
const isOptional = el._zod.optin === "optional" && el._zod.optout === "optional";
|
311356
312485
|
if (r6 instanceof Promise) {
|
311357
|
-
proms.push(r6.then((r$1) => isOptional ? handleOptionalObjectResult4(r$1, payload,
|
312486
|
+
proms.push(r6.then((r$1) => isOptional ? handleOptionalObjectResult4(r$1, payload, key4, input) : handleObjectResult4(r$1, payload, key4)));
|
311358
312487
|
} else {
|
311359
312488
|
if (isOptional) {
|
311360
|
-
handleOptionalObjectResult4(r6, payload,
|
312489
|
+
handleOptionalObjectResult4(r6, payload, key4, input);
|
311361
312490
|
} else {
|
311362
|
-
handleObjectResult4(r6, payload,
|
312491
|
+
handleObjectResult4(r6, payload, key4);
|
311363
312492
|
}
|
311364
312493
|
}
|
311365
312494
|
}
|
@@ -311371,21 +312500,21 @@ var $ZodObject4 = /* @__PURE__ */ $constructor4("$ZodObject", (inst, def) => {
|
|
311371
312500
|
const keySet = value4.keySet;
|
311372
312501
|
const _catchall = catchall._zod;
|
311373
312502
|
const t8 = _catchall.def.type;
|
311374
|
-
for (const
|
311375
|
-
if (keySet.has(
|
312503
|
+
for (const key4 of Object.keys(input)) {
|
312504
|
+
if (keySet.has(key4))
|
311376
312505
|
continue;
|
311377
312506
|
if (t8 === "never") {
|
311378
|
-
unrecognized.push(
|
312507
|
+
unrecognized.push(key4);
|
311379
312508
|
continue;
|
311380
312509
|
}
|
311381
312510
|
const r6 = _catchall.run({
|
311382
|
-
value: input[
|
312511
|
+
value: input[key4],
|
311383
312512
|
issues: []
|
311384
312513
|
}, ctx);
|
311385
312514
|
if (r6 instanceof Promise) {
|
311386
|
-
proms.push(r6.then((r$1) => handleObjectResult4(r$1, payload,
|
312515
|
+
proms.push(r6.then((r$1) => handleObjectResult4(r$1, payload, key4)));
|
311387
312516
|
} else {
|
311388
|
-
handleObjectResult4(r6, payload,
|
312517
|
+
handleObjectResult4(r6, payload, key4);
|
311389
312518
|
}
|
311390
312519
|
}
|
311391
312520
|
if (unrecognized.length) {
|
@@ -311555,22 +312684,22 @@ function mergeValues4(a7, b4) {
|
|
311555
312684
|
data: a7
|
311556
312685
|
};
|
311557
312686
|
}
|
311558
|
-
if (
|
312687
|
+
if (isPlainObject8(a7) && isPlainObject8(b4)) {
|
311559
312688
|
const bKeys = Object.keys(b4);
|
311560
|
-
const sharedKeys = Object.keys(a7).filter((
|
312689
|
+
const sharedKeys = Object.keys(a7).filter((key4) => bKeys.indexOf(key4) !== -1);
|
311561
312690
|
const newObj = {
|
311562
312691
|
...a7,
|
311563
312692
|
...b4
|
311564
312693
|
};
|
311565
|
-
for (const
|
311566
|
-
const sharedValue = mergeValues4(a7[
|
312694
|
+
for (const key4 of sharedKeys) {
|
312695
|
+
const sharedValue = mergeValues4(a7[key4], b4[key4]);
|
311567
312696
|
if (!sharedValue.valid) {
|
311568
312697
|
return {
|
311569
312698
|
valid: false,
|
311570
|
-
mergeErrorPath: [
|
312699
|
+
mergeErrorPath: [key4, ...sharedValue.mergeErrorPath]
|
311571
312700
|
};
|
311572
312701
|
}
|
311573
|
-
newObj[
|
312702
|
+
newObj[key4] = sharedValue.data;
|
311574
312703
|
}
|
311575
312704
|
return {
|
311576
312705
|
valid: true,
|
@@ -311706,7 +312835,7 @@ var $ZodRecord4 = /* @__PURE__ */ $constructor4("$ZodRecord", (inst, def) => {
|
|
311706
312835
|
$ZodType4.init(inst, def);
|
311707
312836
|
inst._zod.parse = (payload, ctx) => {
|
311708
312837
|
const input = payload.value;
|
311709
|
-
if (!
|
312838
|
+
if (!isPlainObject8(input)) {
|
311710
312839
|
payload.issues.push({
|
311711
312840
|
expected: "record",
|
311712
312841
|
code: "invalid_type",
|
@@ -311719,32 +312848,32 @@ var $ZodRecord4 = /* @__PURE__ */ $constructor4("$ZodRecord", (inst, def) => {
|
|
311719
312848
|
if (def.keyType._zod.values) {
|
311720
312849
|
const values = def.keyType._zod.values;
|
311721
312850
|
payload.value = {};
|
311722
|
-
for (const
|
311723
|
-
if (typeof
|
312851
|
+
for (const key4 of values) {
|
312852
|
+
if (typeof key4 === "string" || typeof key4 === "number" || typeof key4 === "symbol") {
|
311724
312853
|
const result = def.valueType._zod.run({
|
311725
|
-
value: input[
|
312854
|
+
value: input[key4],
|
311726
312855
|
issues: []
|
311727
312856
|
}, ctx);
|
311728
312857
|
if (result instanceof Promise) {
|
311729
312858
|
proms.push(result.then((result$1) => {
|
311730
312859
|
if (result$1.issues.length) {
|
311731
|
-
payload.issues.push(...prefixIssues4(
|
312860
|
+
payload.issues.push(...prefixIssues4(key4, result$1.issues));
|
311732
312861
|
}
|
311733
|
-
payload.value[
|
312862
|
+
payload.value[key4] = result$1.value;
|
311734
312863
|
}));
|
311735
312864
|
} else {
|
311736
312865
|
if (result.issues.length) {
|
311737
|
-
payload.issues.push(...prefixIssues4(
|
312866
|
+
payload.issues.push(...prefixIssues4(key4, result.issues));
|
311738
312867
|
}
|
311739
|
-
payload.value[
|
312868
|
+
payload.value[key4] = result.value;
|
311740
312869
|
}
|
311741
312870
|
}
|
311742
312871
|
}
|
311743
312872
|
let unrecognized;
|
311744
|
-
for (const
|
311745
|
-
if (!values.has(
|
312873
|
+
for (const key4 in input) {
|
312874
|
+
if (!values.has(key4)) {
|
311746
312875
|
unrecognized = unrecognized ?? [];
|
311747
|
-
unrecognized.push(
|
312876
|
+
unrecognized.push(key4);
|
311748
312877
|
}
|
311749
312878
|
}
|
311750
312879
|
if (unrecognized && unrecognized.length > 0) {
|
@@ -311757,11 +312886,11 @@ var $ZodRecord4 = /* @__PURE__ */ $constructor4("$ZodRecord", (inst, def) => {
|
|
311757
312886
|
}
|
311758
312887
|
} else {
|
311759
312888
|
payload.value = {};
|
311760
|
-
for (const
|
311761
|
-
if (
|
312889
|
+
for (const key4 of Reflect.ownKeys(input)) {
|
312890
|
+
if (key4 === "__proto__")
|
311762
312891
|
continue;
|
311763
312892
|
const keyResult = def.keyType._zod.run({
|
311764
|
-
value:
|
312893
|
+
value: key4,
|
311765
312894
|
issues: []
|
311766
312895
|
}, ctx);
|
311767
312896
|
if (keyResult instanceof Promise) {
|
@@ -311772,27 +312901,27 @@ var $ZodRecord4 = /* @__PURE__ */ $constructor4("$ZodRecord", (inst, def) => {
|
|
311772
312901
|
origin: "record",
|
311773
312902
|
code: "invalid_key",
|
311774
312903
|
issues: keyResult.issues.map((iss) => finalizeIssue4(iss, ctx, config4())),
|
311775
|
-
input:
|
311776
|
-
path: [
|
312904
|
+
input: key4,
|
312905
|
+
path: [key4],
|
311777
312906
|
inst
|
311778
312907
|
});
|
311779
312908
|
payload.value[keyResult.value] = keyResult.value;
|
311780
312909
|
continue;
|
311781
312910
|
}
|
311782
312911
|
const result = def.valueType._zod.run({
|
311783
|
-
value: input[
|
312912
|
+
value: input[key4],
|
311784
312913
|
issues: []
|
311785
312914
|
}, ctx);
|
311786
312915
|
if (result instanceof Promise) {
|
311787
312916
|
proms.push(result.then((result$1) => {
|
311788
312917
|
if (result$1.issues.length) {
|
311789
|
-
payload.issues.push(...prefixIssues4(
|
312918
|
+
payload.issues.push(...prefixIssues4(key4, result$1.issues));
|
311790
312919
|
}
|
311791
312920
|
payload.value[keyResult.value] = result$1.value;
|
311792
312921
|
}));
|
311793
312922
|
} else {
|
311794
312923
|
if (result.issues.length) {
|
311795
|
-
payload.issues.push(...prefixIssues4(
|
312924
|
+
payload.issues.push(...prefixIssues4(key4, result.issues));
|
311796
312925
|
}
|
311797
312926
|
payload.value[keyResult.value] = result.value;
|
311798
312927
|
}
|
@@ -311819,9 +312948,9 @@ var $ZodMap4 = /* @__PURE__ */ $constructor4("$ZodMap", (inst, def) => {
|
|
311819
312948
|
}
|
311820
312949
|
const proms = [];
|
311821
312950
|
payload.value = new Map;
|
311822
|
-
for (const [
|
312951
|
+
for (const [key4, value4] of input) {
|
311823
312952
|
const keyResult = def.keyType._zod.run({
|
311824
|
-
value:
|
312953
|
+
value: key4,
|
311825
312954
|
issues: []
|
311826
312955
|
}, ctx);
|
311827
312956
|
const valueResult = def.valueType._zod.run({
|
@@ -311830,10 +312959,10 @@ var $ZodMap4 = /* @__PURE__ */ $constructor4("$ZodMap", (inst, def) => {
|
|
311830
312959
|
}, ctx);
|
311831
312960
|
if (keyResult instanceof Promise || valueResult instanceof Promise) {
|
311832
312961
|
proms.push(Promise.all([keyResult, valueResult]).then(([keyResult$1, valueResult$1]) => {
|
311833
|
-
handleMapResult4(keyResult$1, valueResult$1, payload,
|
312962
|
+
handleMapResult4(keyResult$1, valueResult$1, payload, key4, input, inst, ctx);
|
311834
312963
|
}));
|
311835
312964
|
} else {
|
311836
|
-
handleMapResult4(keyResult, valueResult, payload,
|
312965
|
+
handleMapResult4(keyResult, valueResult, payload, key4, input, inst, ctx);
|
311837
312966
|
}
|
311838
312967
|
}
|
311839
312968
|
if (proms.length)
|
@@ -311841,10 +312970,10 @@ var $ZodMap4 = /* @__PURE__ */ $constructor4("$ZodMap", (inst, def) => {
|
|
311841
312970
|
return payload;
|
311842
312971
|
};
|
311843
312972
|
});
|
311844
|
-
function handleMapResult4(keyResult, valueResult, final,
|
312973
|
+
function handleMapResult4(keyResult, valueResult, final, key4, input, inst, ctx) {
|
311845
312974
|
if (keyResult.issues.length) {
|
311846
|
-
if (propertyKeyTypes4.has(typeof
|
311847
|
-
final.issues.push(...prefixIssues4(
|
312975
|
+
if (propertyKeyTypes4.has(typeof key4)) {
|
312976
|
+
final.issues.push(...prefixIssues4(key4, keyResult.issues));
|
311848
312977
|
} else {
|
311849
312978
|
final.issues.push({
|
311850
312979
|
origin: "map",
|
@@ -311856,15 +312985,15 @@ function handleMapResult4(keyResult, valueResult, final, key2, input, inst, ctx)
|
|
311856
312985
|
}
|
311857
312986
|
}
|
311858
312987
|
if (valueResult.issues.length) {
|
311859
|
-
if (propertyKeyTypes4.has(typeof
|
311860
|
-
final.issues.push(...prefixIssues4(
|
312988
|
+
if (propertyKeyTypes4.has(typeof key4)) {
|
312989
|
+
final.issues.push(...prefixIssues4(key4, valueResult.issues));
|
311861
312990
|
} else {
|
311862
312991
|
final.issues.push({
|
311863
312992
|
origin: "map",
|
311864
312993
|
code: "invalid_element",
|
311865
312994
|
input,
|
311866
312995
|
inst,
|
311867
|
-
key:
|
312996
|
+
key: key4,
|
311868
312997
|
issues: valueResult.issues.map((iss) => finalizeIssue4(iss, ctx, config4()))
|
311869
312998
|
});
|
311870
312999
|
}
|
@@ -318186,19 +319315,19 @@ var JSONSchemaGenerator4 = class {
|
|
318186
319315
|
json$1.type = "object";
|
318187
319316
|
json$1.properties = {};
|
318188
319317
|
const shape = def.shape;
|
318189
|
-
for (const
|
318190
|
-
json$1.properties[
|
319318
|
+
for (const key4 in shape) {
|
319319
|
+
json$1.properties[key4] = this.process(shape[key4], {
|
318191
319320
|
...params,
|
318192
319321
|
path: [
|
318193
319322
|
...params.path,
|
318194
319323
|
"properties",
|
318195
|
-
|
319324
|
+
key4
|
318196
319325
|
]
|
318197
319326
|
});
|
318198
319327
|
}
|
318199
319328
|
const allKeys = new Set(Object.keys(shape));
|
318200
|
-
const requiredKeys = new Set([...allKeys].filter((
|
318201
|
-
const v6 = def.shape[
|
319329
|
+
const requiredKeys = new Set([...allKeys].filter((key4) => {
|
319330
|
+
const v6 = def.shape[key4]._zod;
|
318202
319331
|
if (this.io === "input") {
|
318203
319332
|
return v6.optin === undefined;
|
318204
319333
|
} else {
|
@@ -318550,8 +319679,8 @@ var JSONSchemaGenerator4 = class {
|
|
318550
319679
|
if (defId)
|
318551
319680
|
seen.defId = defId;
|
318552
319681
|
const schema$1 = seen.schema;
|
318553
|
-
for (const
|
318554
|
-
delete schema$1[
|
319682
|
+
for (const key4 in schema$1) {
|
319683
|
+
delete schema$1[key4];
|
318555
319684
|
}
|
318556
319685
|
schema$1.$ref = ref;
|
318557
319686
|
};
|
@@ -318662,8 +319791,8 @@ function toJSONSchema4(input, _params) {
|
|
318662
319791
|
defs
|
318663
319792
|
};
|
318664
319793
|
for (const entry of input._idmap.entries()) {
|
318665
|
-
const [
|
318666
|
-
schemas3[
|
319794
|
+
const [key4, schema] = entry;
|
319795
|
+
schemas3[key4] = gen$1.emit(schema, {
|
318667
319796
|
..._params,
|
318668
319797
|
external: external2
|
318669
319798
|
});
|
@@ -318708,8 +319837,8 @@ function isTransforming4(_schema, _ctx) {
|
|
318708
319837
|
return isTransforming4(def.element, ctx);
|
318709
319838
|
}
|
318710
319839
|
case "object": {
|
318711
|
-
for (const
|
318712
|
-
if (isTransforming4(def.shape[
|
319840
|
+
for (const key4 in def.shape) {
|
319841
|
+
if (isTransforming4(def.shape[key4], ctx))
|
318713
319842
|
return true;
|
318714
319843
|
}
|
318715
319844
|
return false;
|
@@ -320452,13 +321581,13 @@ var esm_default4 = createPrompt((config5, done) => {
|
|
320452
321581
|
const [value4, setValue] = useState("");
|
320453
321582
|
const theme = makeTheme(config5.theme);
|
320454
321583
|
const prefix = usePrefix({ status, theme });
|
320455
|
-
useKeypress((
|
320456
|
-
if (isEnterKey(
|
321584
|
+
useKeypress((key4, rl) => {
|
321585
|
+
if (isEnterKey(key4)) {
|
320457
321586
|
const answer = getBooleanValue(value4, config5.default);
|
320458
321587
|
setValue(transformer(answer));
|
320459
321588
|
setStatus("done");
|
320460
321589
|
done(answer);
|
320461
|
-
} else if (
|
321590
|
+
} else if (key4.name === "tab") {
|
320462
321591
|
const answer = boolToString(!getBooleanValue(value4, config5.default));
|
320463
321592
|
rl.clearLine(0);
|
320464
321593
|
rl.write(answer);
|
@@ -320478,20 +321607,476 @@ var esm_default4 = createPrompt((config5, done) => {
|
|
320478
321607
|
return `${prefix} ${message}${defaultValue} ${formattedValue}`;
|
320479
321608
|
});
|
320480
321609
|
|
321610
|
+
// ../../node_modules/@inquirer/password/node_modules/@inquirer/core/dist/esm/lib/key.js
|
321611
|
+
var isEnterKey4 = (key4) => key4.name === "enter" || key4.name === "return";
|
321612
|
+
// ../../node_modules/@inquirer/password/node_modules/@inquirer/core/dist/esm/lib/errors.js
|
321613
|
+
class AbortPromptError4 extends Error {
|
321614
|
+
name = "AbortPromptError";
|
321615
|
+
message = "Prompt was aborted";
|
321616
|
+
constructor(options) {
|
321617
|
+
super();
|
321618
|
+
this.cause = options?.cause;
|
321619
|
+
}
|
321620
|
+
}
|
321621
|
+
|
321622
|
+
class CancelPromptError4 extends Error {
|
321623
|
+
name = "CancelPromptError";
|
321624
|
+
message = "Prompt was canceled";
|
321625
|
+
}
|
321626
|
+
|
321627
|
+
class ExitPromptError4 extends Error {
|
321628
|
+
name = "ExitPromptError";
|
321629
|
+
}
|
321630
|
+
|
321631
|
+
class HookError4 extends Error {
|
321632
|
+
name = "HookError";
|
321633
|
+
}
|
321634
|
+
|
321635
|
+
class ValidationError4 extends Error {
|
321636
|
+
name = "ValidationError";
|
321637
|
+
}
|
321638
|
+
// ../../node_modules/@inquirer/password/node_modules/@inquirer/core/dist/esm/lib/use-state.js
|
321639
|
+
import { AsyncResource as AsyncResource11 } from "node:async_hooks";
|
321640
|
+
|
321641
|
+
// ../../node_modules/@inquirer/password/node_modules/@inquirer/core/dist/esm/lib/hook-engine.js
|
321642
|
+
import { AsyncLocalStorage as AsyncLocalStorage4, AsyncResource as AsyncResource10 } from "node:async_hooks";
|
321643
|
+
var hookStorage4 = new AsyncLocalStorage4;
|
321644
|
+
function createStore4(rl) {
|
321645
|
+
const store = {
|
321646
|
+
rl,
|
321647
|
+
hooks: [],
|
321648
|
+
hooksCleanup: [],
|
321649
|
+
hooksEffect: [],
|
321650
|
+
index: 0,
|
321651
|
+
handleChange() {}
|
321652
|
+
};
|
321653
|
+
return store;
|
321654
|
+
}
|
321655
|
+
function withHooks4(rl, cb) {
|
321656
|
+
const store = createStore4(rl);
|
321657
|
+
return hookStorage4.run(store, () => {
|
321658
|
+
function cycle(render) {
|
321659
|
+
store.handleChange = () => {
|
321660
|
+
store.index = 0;
|
321661
|
+
render();
|
321662
|
+
};
|
321663
|
+
store.handleChange();
|
321664
|
+
}
|
321665
|
+
return cb(cycle);
|
321666
|
+
});
|
321667
|
+
}
|
321668
|
+
function getStore4() {
|
321669
|
+
const store = hookStorage4.getStore();
|
321670
|
+
if (!store) {
|
321671
|
+
throw new HookError4("[Inquirer] Hook functions can only be called from within a prompt");
|
321672
|
+
}
|
321673
|
+
return store;
|
321674
|
+
}
|
321675
|
+
function readline7() {
|
321676
|
+
return getStore4().rl;
|
321677
|
+
}
|
321678
|
+
function withUpdates4(fn) {
|
321679
|
+
const wrapped = (...args) => {
|
321680
|
+
const store = getStore4();
|
321681
|
+
let shouldUpdate = false;
|
321682
|
+
const oldHandleChange = store.handleChange;
|
321683
|
+
store.handleChange = () => {
|
321684
|
+
shouldUpdate = true;
|
321685
|
+
};
|
321686
|
+
const returnValue = fn(...args);
|
321687
|
+
if (shouldUpdate) {
|
321688
|
+
oldHandleChange();
|
321689
|
+
}
|
321690
|
+
store.handleChange = oldHandleChange;
|
321691
|
+
return returnValue;
|
321692
|
+
};
|
321693
|
+
return AsyncResource10.bind(wrapped);
|
321694
|
+
}
|
321695
|
+
function withPointer4(cb) {
|
321696
|
+
const store = getStore4();
|
321697
|
+
const { index: index2 } = store;
|
321698
|
+
const pointer = {
|
321699
|
+
get() {
|
321700
|
+
return store.hooks[index2];
|
321701
|
+
},
|
321702
|
+
set(value4) {
|
321703
|
+
store.hooks[index2] = value4;
|
321704
|
+
},
|
321705
|
+
initialized: index2 in store.hooks
|
321706
|
+
};
|
321707
|
+
const returnValue = cb(pointer);
|
321708
|
+
store.index++;
|
321709
|
+
return returnValue;
|
321710
|
+
}
|
321711
|
+
function handleChange4() {
|
321712
|
+
getStore4().handleChange();
|
321713
|
+
}
|
321714
|
+
var effectScheduler4 = {
|
321715
|
+
queue(cb) {
|
321716
|
+
const store = getStore4();
|
321717
|
+
const { index: index2 } = store;
|
321718
|
+
store.hooksEffect.push(() => {
|
321719
|
+
store.hooksCleanup[index2]?.();
|
321720
|
+
const cleanFn = cb(readline7());
|
321721
|
+
if (cleanFn != null && typeof cleanFn !== "function") {
|
321722
|
+
throw new ValidationError4("useEffect return value must be a cleanup function or nothing.");
|
321723
|
+
}
|
321724
|
+
store.hooksCleanup[index2] = cleanFn;
|
321725
|
+
});
|
321726
|
+
},
|
321727
|
+
run() {
|
321728
|
+
const store = getStore4();
|
321729
|
+
withUpdates4(() => {
|
321730
|
+
store.hooksEffect.forEach((effect) => {
|
321731
|
+
effect();
|
321732
|
+
});
|
321733
|
+
store.hooksEffect.length = 0;
|
321734
|
+
})();
|
321735
|
+
},
|
321736
|
+
clearAll() {
|
321737
|
+
const store = getStore4();
|
321738
|
+
store.hooksCleanup.forEach((cleanFn) => {
|
321739
|
+
cleanFn?.();
|
321740
|
+
});
|
321741
|
+
store.hooksEffect.length = 0;
|
321742
|
+
store.hooksCleanup.length = 0;
|
321743
|
+
}
|
321744
|
+
};
|
321745
|
+
|
321746
|
+
// ../../node_modules/@inquirer/password/node_modules/@inquirer/core/dist/esm/lib/use-state.js
|
321747
|
+
function useState4(defaultValue) {
|
321748
|
+
return withPointer4((pointer) => {
|
321749
|
+
const setState = AsyncResource11.bind(function setState(newValue) {
|
321750
|
+
if (pointer.get() !== newValue) {
|
321751
|
+
pointer.set(newValue);
|
321752
|
+
handleChange4();
|
321753
|
+
}
|
321754
|
+
});
|
321755
|
+
if (pointer.initialized) {
|
321756
|
+
return [pointer.get(), setState];
|
321757
|
+
}
|
321758
|
+
const value4 = typeof defaultValue === "function" ? defaultValue() : defaultValue;
|
321759
|
+
pointer.set(value4);
|
321760
|
+
return [value4, setState];
|
321761
|
+
});
|
321762
|
+
}
|
321763
|
+
|
321764
|
+
// ../../node_modules/@inquirer/password/node_modules/@inquirer/core/dist/esm/lib/use-effect.js
|
321765
|
+
function useEffect4(cb, depArray) {
|
321766
|
+
withPointer4((pointer) => {
|
321767
|
+
const oldDeps = pointer.get();
|
321768
|
+
const hasChanged = !Array.isArray(oldDeps) || depArray.some((dep, i6) => !Object.is(dep, oldDeps[i6]));
|
321769
|
+
if (hasChanged) {
|
321770
|
+
effectScheduler4.queue(cb);
|
321771
|
+
}
|
321772
|
+
pointer.set(depArray);
|
321773
|
+
});
|
321774
|
+
}
|
321775
|
+
|
321776
|
+
// ../../node_modules/@inquirer/password/node_modules/@inquirer/core/dist/esm/lib/theme.js
|
321777
|
+
var import_yoctocolors_cjs6 = __toESM(require_yoctocolors_cjs(), 1);
|
321778
|
+
var defaultTheme4 = {
|
321779
|
+
prefix: {
|
321780
|
+
idle: import_yoctocolors_cjs6.default.blue("?"),
|
321781
|
+
done: import_yoctocolors_cjs6.default.green(esm_default.tick)
|
321782
|
+
},
|
321783
|
+
spinner: {
|
321784
|
+
interval: 80,
|
321785
|
+
frames: ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"].map((frame) => import_yoctocolors_cjs6.default.yellow(frame))
|
321786
|
+
},
|
321787
|
+
style: {
|
321788
|
+
answer: import_yoctocolors_cjs6.default.cyan,
|
321789
|
+
message: import_yoctocolors_cjs6.default.bold,
|
321790
|
+
error: (text2) => import_yoctocolors_cjs6.default.red(`> ${text2}`),
|
321791
|
+
defaultAnswer: (text2) => import_yoctocolors_cjs6.default.dim(`(${text2})`),
|
321792
|
+
help: import_yoctocolors_cjs6.default.dim,
|
321793
|
+
highlight: import_yoctocolors_cjs6.default.cyan,
|
321794
|
+
key: (text2) => import_yoctocolors_cjs6.default.cyan(import_yoctocolors_cjs6.default.bold(`<${text2}>`))
|
321795
|
+
}
|
321796
|
+
};
|
321797
|
+
|
321798
|
+
// ../../node_modules/@inquirer/password/node_modules/@inquirer/core/dist/esm/lib/make-theme.js
|
321799
|
+
function isPlainObject9(value4) {
|
321800
|
+
if (typeof value4 !== "object" || value4 === null)
|
321801
|
+
return false;
|
321802
|
+
let proto = value4;
|
321803
|
+
while (Object.getPrototypeOf(proto) !== null) {
|
321804
|
+
proto = Object.getPrototypeOf(proto);
|
321805
|
+
}
|
321806
|
+
return Object.getPrototypeOf(value4) === proto;
|
321807
|
+
}
|
321808
|
+
function deepMerge5(...objects) {
|
321809
|
+
const output = {};
|
321810
|
+
for (const obj of objects) {
|
321811
|
+
for (const [key4, value4] of Object.entries(obj)) {
|
321812
|
+
const prevValue = output[key4];
|
321813
|
+
output[key4] = isPlainObject9(prevValue) && isPlainObject9(value4) ? deepMerge5(prevValue, value4) : value4;
|
321814
|
+
}
|
321815
|
+
}
|
321816
|
+
return output;
|
321817
|
+
}
|
321818
|
+
function makeTheme4(...themes) {
|
321819
|
+
const themesToMerge = [
|
321820
|
+
defaultTheme4,
|
321821
|
+
...themes.filter((theme) => theme != null)
|
321822
|
+
];
|
321823
|
+
return deepMerge5(...themesToMerge);
|
321824
|
+
}
|
321825
|
+
|
321826
|
+
// ../../node_modules/@inquirer/password/node_modules/@inquirer/core/dist/esm/lib/use-prefix.js
|
321827
|
+
function usePrefix4({ status = "idle", theme }) {
|
321828
|
+
const [showLoader, setShowLoader] = useState4(false);
|
321829
|
+
const [tick, setTick] = useState4(0);
|
321830
|
+
const { prefix, spinner: spinner2 } = makeTheme4(theme);
|
321831
|
+
useEffect4(() => {
|
321832
|
+
if (status === "loading") {
|
321833
|
+
let tickInterval;
|
321834
|
+
let inc = -1;
|
321835
|
+
const delayTimeout = setTimeout(() => {
|
321836
|
+
setShowLoader(true);
|
321837
|
+
tickInterval = setInterval(() => {
|
321838
|
+
inc = inc + 1;
|
321839
|
+
setTick(inc % spinner2.frames.length);
|
321840
|
+
}, spinner2.interval);
|
321841
|
+
}, 300);
|
321842
|
+
return () => {
|
321843
|
+
clearTimeout(delayTimeout);
|
321844
|
+
clearInterval(tickInterval);
|
321845
|
+
};
|
321846
|
+
} else {
|
321847
|
+
setShowLoader(false);
|
321848
|
+
}
|
321849
|
+
}, [status]);
|
321850
|
+
if (showLoader) {
|
321851
|
+
return spinner2.frames[tick];
|
321852
|
+
}
|
321853
|
+
const iconName = status === "loading" ? "idle" : status;
|
321854
|
+
return typeof prefix === "string" ? prefix : prefix[iconName] ?? prefix["idle"];
|
321855
|
+
}
|
321856
|
+
// ../../node_modules/@inquirer/password/node_modules/@inquirer/core/dist/esm/lib/use-ref.js
|
321857
|
+
function useRef4(val) {
|
321858
|
+
return useState4({ current: val })[0];
|
321859
|
+
}
|
321860
|
+
|
321861
|
+
// ../../node_modules/@inquirer/password/node_modules/@inquirer/core/dist/esm/lib/use-keypress.js
|
321862
|
+
function useKeypress4(userHandler) {
|
321863
|
+
const signal = useRef4(userHandler);
|
321864
|
+
signal.current = userHandler;
|
321865
|
+
useEffect4((rl) => {
|
321866
|
+
let ignore = false;
|
321867
|
+
const handler = withUpdates4((_input, event) => {
|
321868
|
+
if (ignore)
|
321869
|
+
return;
|
321870
|
+
signal.current(event, rl);
|
321871
|
+
});
|
321872
|
+
rl.input.on("keypress", handler);
|
321873
|
+
return () => {
|
321874
|
+
ignore = true;
|
321875
|
+
rl.input.removeListener("keypress", handler);
|
321876
|
+
};
|
321877
|
+
}, []);
|
321878
|
+
}
|
321879
|
+
// ../../node_modules/@inquirer/password/node_modules/@inquirer/core/dist/esm/lib/utils.js
|
321880
|
+
var import_cli_width4 = __toESM(require_cli_width(), 1);
|
321881
|
+
var import_wrap_ansi4 = __toESM(require_wrap_ansi(), 1);
|
321882
|
+
function breakLines4(content, width) {
|
321883
|
+
return content.split(`
|
321884
|
+
`).flatMap((line) => import_wrap_ansi4.default(line, width, { trim: false, hard: true }).split(`
|
321885
|
+
`).map((str) => str.trimEnd())).join(`
|
321886
|
+
`);
|
321887
|
+
}
|
321888
|
+
function readlineWidth4() {
|
321889
|
+
return import_cli_width4.default({ defaultWidth: 80, output: readline7().output });
|
321890
|
+
}
|
321891
|
+
|
321892
|
+
// ../../node_modules/@inquirer/password/node_modules/@inquirer/core/dist/esm/lib/create-prompt.js
|
321893
|
+
var import_mute_stream4 = __toESM(require_lib(), 1);
|
321894
|
+
import * as readline8 from "node:readline";
|
321895
|
+
import { AsyncResource as AsyncResource12 } from "node:async_hooks";
|
321896
|
+
|
321897
|
+
// ../../node_modules/@inquirer/password/node_modules/@inquirer/core/dist/esm/lib/screen-manager.js
|
321898
|
+
var import_ansi_escapes5 = __toESM(require_ansi_escapes(), 1);
|
321899
|
+
import { stripVTControlCharacters as stripVTControlCharacters5 } from "node:util";
|
321900
|
+
var height4 = (content) => content.split(`
|
321901
|
+
`).length;
|
321902
|
+
var lastLine4 = (content) => content.split(`
|
321903
|
+
`).pop() ?? "";
|
321904
|
+
function cursorDown4(n6) {
|
321905
|
+
return n6 > 0 ? import_ansi_escapes5.default.cursorDown(n6) : "";
|
321906
|
+
}
|
321907
|
+
|
321908
|
+
class ScreenManager4 {
|
321909
|
+
height = 0;
|
321910
|
+
extraLinesUnderPrompt = 0;
|
321911
|
+
cursorPos;
|
321912
|
+
rl;
|
321913
|
+
constructor(rl) {
|
321914
|
+
this.rl = rl;
|
321915
|
+
this.cursorPos = rl.getCursorPos();
|
321916
|
+
}
|
321917
|
+
write(content) {
|
321918
|
+
this.rl.output.unmute();
|
321919
|
+
this.rl.output.write(content);
|
321920
|
+
this.rl.output.mute();
|
321921
|
+
}
|
321922
|
+
render(content, bottomContent = "") {
|
321923
|
+
const promptLine = lastLine4(content);
|
321924
|
+
const rawPromptLine = stripVTControlCharacters5(promptLine);
|
321925
|
+
let prompt = rawPromptLine;
|
321926
|
+
if (this.rl.line.length > 0) {
|
321927
|
+
prompt = prompt.slice(0, -this.rl.line.length);
|
321928
|
+
}
|
321929
|
+
this.rl.setPrompt(prompt);
|
321930
|
+
this.cursorPos = this.rl.getCursorPos();
|
321931
|
+
const width = readlineWidth4();
|
321932
|
+
content = breakLines4(content, width);
|
321933
|
+
bottomContent = breakLines4(bottomContent, width);
|
321934
|
+
if (rawPromptLine.length % width === 0) {
|
321935
|
+
content += `
|
321936
|
+
`;
|
321937
|
+
}
|
321938
|
+
let output = content + (bottomContent ? `
|
321939
|
+
` + bottomContent : "");
|
321940
|
+
const promptLineUpDiff = Math.floor(rawPromptLine.length / width) - this.cursorPos.rows;
|
321941
|
+
const bottomContentHeight = promptLineUpDiff + (bottomContent ? height4(bottomContent) : 0);
|
321942
|
+
if (bottomContentHeight > 0)
|
321943
|
+
output += import_ansi_escapes5.default.cursorUp(bottomContentHeight);
|
321944
|
+
output += import_ansi_escapes5.default.cursorTo(this.cursorPos.cols);
|
321945
|
+
this.write(cursorDown4(this.extraLinesUnderPrompt) + import_ansi_escapes5.default.eraseLines(this.height) + output);
|
321946
|
+
this.extraLinesUnderPrompt = bottomContentHeight;
|
321947
|
+
this.height = height4(output);
|
321948
|
+
}
|
321949
|
+
checkCursorPos() {
|
321950
|
+
const cursorPos = this.rl.getCursorPos();
|
321951
|
+
if (cursorPos.cols !== this.cursorPos.cols) {
|
321952
|
+
this.write(import_ansi_escapes5.default.cursorTo(cursorPos.cols));
|
321953
|
+
this.cursorPos = cursorPos;
|
321954
|
+
}
|
321955
|
+
}
|
321956
|
+
done({ clearContent }) {
|
321957
|
+
this.rl.setPrompt("");
|
321958
|
+
let output = cursorDown4(this.extraLinesUnderPrompt);
|
321959
|
+
output += clearContent ? import_ansi_escapes5.default.eraseLines(this.height) : `
|
321960
|
+
`;
|
321961
|
+
output += import_ansi_escapes5.default.cursorShow;
|
321962
|
+
this.write(output);
|
321963
|
+
this.rl.close();
|
321964
|
+
}
|
321965
|
+
}
|
321966
|
+
|
321967
|
+
// ../../node_modules/@inquirer/password/node_modules/@inquirer/core/dist/esm/lib/promise-polyfill.js
|
321968
|
+
class PromisePolyfill4 extends Promise {
|
321969
|
+
static withResolver() {
|
321970
|
+
let resolve6;
|
321971
|
+
let reject;
|
321972
|
+
const promise5 = new Promise((res, rej) => {
|
321973
|
+
resolve6 = res;
|
321974
|
+
reject = rej;
|
321975
|
+
});
|
321976
|
+
return { promise: promise5, resolve: resolve6, reject };
|
321977
|
+
}
|
321978
|
+
}
|
321979
|
+
|
321980
|
+
// ../../node_modules/@inquirer/password/node_modules/@inquirer/core/dist/esm/lib/create-prompt.js
|
321981
|
+
function getCallSites4() {
|
321982
|
+
const _prepareStackTrace = Error.prepareStackTrace;
|
321983
|
+
let result = [];
|
321984
|
+
try {
|
321985
|
+
Error.prepareStackTrace = (_5, callSites) => {
|
321986
|
+
const callSitesWithoutCurrent = callSites.slice(1);
|
321987
|
+
result = callSitesWithoutCurrent;
|
321988
|
+
return callSitesWithoutCurrent;
|
321989
|
+
};
|
321990
|
+
new Error().stack;
|
321991
|
+
} catch {
|
321992
|
+
return result;
|
321993
|
+
}
|
321994
|
+
Error.prepareStackTrace = _prepareStackTrace;
|
321995
|
+
return result;
|
321996
|
+
}
|
321997
|
+
function createPrompt4(view) {
|
321998
|
+
const callSites = getCallSites4();
|
321999
|
+
const prompt = (config5, context = {}) => {
|
322000
|
+
const { input = process.stdin, signal } = context;
|
322001
|
+
const cleanups = new Set;
|
322002
|
+
const output = new import_mute_stream4.default;
|
322003
|
+
output.pipe(context.output ?? process.stdout);
|
322004
|
+
const rl = readline8.createInterface({
|
322005
|
+
terminal: true,
|
322006
|
+
input,
|
322007
|
+
output
|
322008
|
+
});
|
322009
|
+
const screen = new ScreenManager4(rl);
|
322010
|
+
const { promise: promise5, resolve: resolve6, reject } = PromisePolyfill4.withResolver();
|
322011
|
+
const cancel3 = () => reject(new CancelPromptError4);
|
322012
|
+
if (signal) {
|
322013
|
+
const abort = () => reject(new AbortPromptError4({ cause: signal.reason }));
|
322014
|
+
if (signal.aborted) {
|
322015
|
+
abort();
|
322016
|
+
return Object.assign(promise5, { cancel: cancel3 });
|
322017
|
+
}
|
322018
|
+
signal.addEventListener("abort", abort);
|
322019
|
+
cleanups.add(() => signal.removeEventListener("abort", abort));
|
322020
|
+
}
|
322021
|
+
cleanups.add(onExit((code2, signal2) => {
|
322022
|
+
reject(new ExitPromptError4(`User force closed the prompt with ${code2} ${signal2}`));
|
322023
|
+
}));
|
322024
|
+
const sigint = () => reject(new ExitPromptError4(`User force closed the prompt with SIGINT`));
|
322025
|
+
rl.on("SIGINT", sigint);
|
322026
|
+
cleanups.add(() => rl.removeListener("SIGINT", sigint));
|
322027
|
+
const checkCursorPos = () => screen.checkCursorPos();
|
322028
|
+
rl.input.on("keypress", checkCursorPos);
|
322029
|
+
cleanups.add(() => rl.input.removeListener("keypress", checkCursorPos));
|
322030
|
+
return withHooks4(rl, (cycle) => {
|
322031
|
+
const hooksCleanup = AsyncResource12.bind(() => effectScheduler4.clearAll());
|
322032
|
+
rl.on("close", hooksCleanup);
|
322033
|
+
cleanups.add(() => rl.removeListener("close", hooksCleanup));
|
322034
|
+
cycle(() => {
|
322035
|
+
try {
|
322036
|
+
const nextView = view(config5, (value4) => {
|
322037
|
+
setImmediate(() => resolve6(value4));
|
322038
|
+
});
|
322039
|
+
if (nextView === undefined) {
|
322040
|
+
const callerFilename = callSites[1]?.getFileName();
|
322041
|
+
throw new Error(`Prompt functions must return a string.
|
322042
|
+
at ${callerFilename}`);
|
322043
|
+
}
|
322044
|
+
const [content, bottomContent] = typeof nextView === "string" ? [nextView] : nextView;
|
322045
|
+
screen.render(content, bottomContent);
|
322046
|
+
effectScheduler4.run();
|
322047
|
+
} catch (error45) {
|
322048
|
+
reject(error45);
|
322049
|
+
}
|
322050
|
+
});
|
322051
|
+
return Object.assign(promise5.then((answer) => {
|
322052
|
+
effectScheduler4.clearAll();
|
322053
|
+
return answer;
|
322054
|
+
}, (error45) => {
|
322055
|
+
effectScheduler4.clearAll();
|
322056
|
+
throw error45;
|
322057
|
+
}).finally(() => {
|
322058
|
+
cleanups.forEach((cleanup) => cleanup());
|
322059
|
+
screen.done({ clearContent: Boolean(context.clearPromptOnDone) });
|
322060
|
+
output.end();
|
322061
|
+
}).then(() => promise5), { cancel: cancel3 });
|
322062
|
+
});
|
322063
|
+
};
|
322064
|
+
return prompt;
|
322065
|
+
}
|
320481
322066
|
// ../../node_modules/@inquirer/password/dist/esm/index.js
|
320482
|
-
var
|
320483
|
-
var esm_default5 =
|
322067
|
+
var import_ansi_escapes6 = __toESM(require_ansi_escapes(), 1);
|
322068
|
+
var esm_default5 = createPrompt4((config5, done) => {
|
320484
322069
|
const { validate: validate5 = () => true } = config5;
|
320485
|
-
const theme =
|
320486
|
-
const [status, setStatus] =
|
320487
|
-
const [errorMsg, setError] =
|
320488
|
-
const [value4, setValue] =
|
320489
|
-
const prefix =
|
320490
|
-
|
322070
|
+
const theme = makeTheme4(config5.theme);
|
322071
|
+
const [status, setStatus] = useState4("idle");
|
322072
|
+
const [errorMsg, setError] = useState4();
|
322073
|
+
const [value4, setValue] = useState4("");
|
322074
|
+
const prefix = usePrefix4({ status, theme });
|
322075
|
+
useKeypress4(async (key5, rl) => {
|
320491
322076
|
if (status !== "idle") {
|
320492
322077
|
return;
|
320493
322078
|
}
|
320494
|
-
if (
|
322079
|
+
if (isEnterKey4(key5)) {
|
320495
322080
|
const answer = value4;
|
320496
322081
|
setStatus("loading");
|
320497
322082
|
const isValid = await validate5(answer);
|
@@ -320516,7 +322101,7 @@ var esm_default5 = createPrompt((config5, done) => {
|
|
320516
322101
|
const maskChar = typeof config5.mask === "string" ? config5.mask : "*";
|
320517
322102
|
formattedValue = maskChar.repeat(value4.length);
|
320518
322103
|
} else if (status !== "done") {
|
320519
|
-
helpTip = `${theme.style.help("[input is masked]")}${
|
322104
|
+
helpTip = `${theme.style.help("[input is masked]")}${import_ansi_escapes6.default.cursorHide}`;
|
320520
322105
|
}
|
320521
322106
|
if (status === "done") {
|
320522
322107
|
formattedValue = theme.style.answer(formattedValue);
|
@@ -322247,7 +323832,7 @@ var basename2 = function(p5, extension) {
|
|
322247
323832
|
return extension && lastSegment.endsWith(extension) ? lastSegment.slice(0, -extension.length) : lastSegment;
|
322248
323833
|
};
|
322249
323834
|
// ../../node_modules/defu/dist/defu.mjs
|
322250
|
-
function
|
323835
|
+
function isPlainObject10(value4) {
|
322251
323836
|
if (value4 === null || typeof value4 !== "object") {
|
322252
323837
|
return false;
|
322253
323838
|
}
|
@@ -322264,27 +323849,27 @@ function isPlainObject7(value4) {
|
|
322264
323849
|
return true;
|
322265
323850
|
}
|
322266
323851
|
function _defu(baseObject, defaults4, namespace = ".", merger) {
|
322267
|
-
if (!
|
323852
|
+
if (!isPlainObject10(defaults4)) {
|
322268
323853
|
return _defu(baseObject, {}, namespace, merger);
|
322269
323854
|
}
|
322270
323855
|
const object5 = Object.assign({}, defaults4);
|
322271
|
-
for (const
|
322272
|
-
if (
|
323856
|
+
for (const key5 in baseObject) {
|
323857
|
+
if (key5 === "__proto__" || key5 === "constructor") {
|
322273
323858
|
continue;
|
322274
323859
|
}
|
322275
|
-
const value4 = baseObject[
|
323860
|
+
const value4 = baseObject[key5];
|
322276
323861
|
if (value4 === null || value4 === undefined) {
|
322277
323862
|
continue;
|
322278
323863
|
}
|
322279
|
-
if (merger && merger(object5,
|
323864
|
+
if (merger && merger(object5, key5, value4, namespace)) {
|
322280
323865
|
continue;
|
322281
323866
|
}
|
322282
|
-
if (Array.isArray(value4) && Array.isArray(object5[
|
322283
|
-
object5[
|
322284
|
-
} else if (
|
322285
|
-
object5[
|
323867
|
+
if (Array.isArray(value4) && Array.isArray(object5[key5])) {
|
323868
|
+
object5[key5] = [...value4, ...object5[key5]];
|
323869
|
+
} else if (isPlainObject10(value4) && isPlainObject10(object5[key5])) {
|
323870
|
+
object5[key5] = _defu(value4, object5[key5], (namespace ? `${namespace}.` : "") + key5.toString(), merger);
|
322286
323871
|
} else {
|
322287
|
-
object5[
|
323872
|
+
object5[key5] = value4;
|
322288
323873
|
}
|
322289
323874
|
}
|
322290
323875
|
return object5;
|
@@ -322293,15 +323878,15 @@ function createDefu(merger) {
|
|
322293
323878
|
return (...arguments_4) => arguments_4.reduce((p5, c3) => _defu(p5, c3, "", merger), {});
|
322294
323879
|
}
|
322295
323880
|
var defu = createDefu();
|
322296
|
-
var defuFn = createDefu((object5,
|
322297
|
-
if (object5[
|
322298
|
-
object5[
|
323881
|
+
var defuFn = createDefu((object5, key5, currentValue) => {
|
323882
|
+
if (object5[key5] !== undefined && typeof currentValue === "function") {
|
323883
|
+
object5[key5] = currentValue(object5[key5]);
|
322299
323884
|
return true;
|
322300
323885
|
}
|
322301
323886
|
});
|
322302
|
-
var defuArrayFn = createDefu((object5,
|
322303
|
-
if (Array.isArray(object5[
|
322304
|
-
object5[
|
323887
|
+
var defuArrayFn = createDefu((object5, key5, currentValue) => {
|
323888
|
+
if (Array.isArray(object5[key5]) && typeof currentValue === "function") {
|
323889
|
+
object5[key5] = currentValue(object5[key5]);
|
322305
323890
|
return true;
|
322306
323891
|
}
|
322307
323892
|
});
|
@@ -325511,11 +327096,11 @@ function cacheDirectory() {
|
|
325511
327096
|
}
|
325512
327097
|
function normalizeHeaders(headers = {}) {
|
325513
327098
|
const normalized = {};
|
325514
|
-
for (const [
|
327099
|
+
for (const [key5, value4] of Object.entries(headers)) {
|
325515
327100
|
if (!value4) {
|
325516
327101
|
continue;
|
325517
327102
|
}
|
325518
|
-
normalized[
|
327103
|
+
normalized[key5.toLowerCase()] = value4;
|
325519
327104
|
}
|
325520
327105
|
return normalized;
|
325521
327106
|
}
|
@@ -326272,13 +327857,17 @@ function addClusterServiceArgs(cmd2) {
|
|
326272
327857
|
// src/commands/platform/utils/wait-for-completion.ts
|
326273
327858
|
class TimeoutError2 extends Error {
|
326274
327859
|
}
|
327860
|
+
|
327861
|
+
class DeploymentFailedError extends Error {
|
327862
|
+
}
|
326275
327863
|
async function waitForCompletion({
|
326276
327864
|
settlemint,
|
326277
327865
|
type: type4,
|
326278
327866
|
uniqueName,
|
326279
327867
|
action,
|
326280
327868
|
maxTimeout = 10 * 60 * 1000,
|
326281
|
-
restartIfTimeout = false
|
327869
|
+
restartIfTimeout = false,
|
327870
|
+
restartOnError = false
|
326282
327871
|
}) {
|
326283
327872
|
const serviceType = SETTLEMINT_CLIENT_MAP[type4];
|
326284
327873
|
if (serviceType === "workspace" || serviceType === "application" || serviceType === "foundry" || serviceType === "applicationAccessToken" || serviceType === "platform" || serviceType === "wallet") {
|
@@ -326288,6 +327877,7 @@ async function waitForCompletion({
|
|
326288
327877
|
if (!service || !("read" in service)) {
|
326289
327878
|
throw new Error(`Service ${serviceType} does not support status checking`);
|
326290
327879
|
}
|
327880
|
+
let hasRestarted = false;
|
326291
327881
|
function showSpinner() {
|
326292
327882
|
return spinner({
|
326293
327883
|
startMessage: `Waiting for ${type4} to be ${getActionLabel(action)}`,
|
@@ -326297,33 +327887,20 @@ async function waitForCompletion({
|
|
326297
327887
|
while (true) {
|
326298
327888
|
try {
|
326299
327889
|
const resource = await service.read(uniqueName);
|
326300
|
-
if (resource.status === "COMPLETED") {
|
326301
|
-
if (spinner2) {
|
326302
|
-
spinner2.text = `${capitalizeFirstLetter2(type4)} is ${getActionLabel(action)}`;
|
326303
|
-
} else {
|
326304
|
-
note(`${capitalizeFirstLetter2(type4)} is ${getActionLabel(action)}`);
|
326305
|
-
}
|
326306
|
-
return true;
|
326307
|
-
}
|
326308
327890
|
if (resource.status === "FAILED") {
|
326309
|
-
|
326310
|
-
|
326311
|
-
|
326312
|
-
note(`${capitalizeFirstLetter2(type4)} failed to ${getActionLabel(action)}`);
|
327891
|
+
updateStatus(spinner2, `${capitalizeFirstLetter2(type4)} failed to ${getActionLabel(action)}`);
|
327892
|
+
if (restartOnError) {
|
327893
|
+
throw new DeploymentFailedError;
|
326313
327894
|
}
|
326314
327895
|
return false;
|
326315
327896
|
}
|
326316
|
-
if (
|
326317
|
-
spinner2
|
326318
|
-
|
326319
|
-
note(`${capitalizeFirstLetter2(type4)} is not ready yet (status: ${resource.status})`);
|
327897
|
+
if (isActionComplete(action, resource.status)) {
|
327898
|
+
updateStatus(spinner2, `${capitalizeFirstLetter2(type4)} is ${getActionLabel(action)}`);
|
327899
|
+
return true;
|
326320
327900
|
}
|
327901
|
+
updateStatus(spinner2, `${capitalizeFirstLetter2(type4)} is not ready yet (status: ${resource.status})`);
|
326321
327902
|
} catch (_error) {
|
326322
|
-
|
326323
|
-
spinner2.text = `${capitalizeFirstLetter2(type4)} is not ready yet (status: UNKNOWN)`;
|
326324
|
-
} else {
|
326325
|
-
note(`${capitalizeFirstLetter2(type4)} is not ready yet (status: UNKNOWN)`);
|
326326
|
-
}
|
327903
|
+
updateStatus(spinner2, `${capitalizeFirstLetter2(type4)} is not ready yet (status: UNKNOWN)`);
|
326327
327904
|
}
|
326328
327905
|
if (Date.now() - startTime > maxTimeout) {
|
326329
327906
|
throw new TimeoutError2(`Operation timed out after ${maxTimeout / 60000} minutes for ${type4} with unique name ${uniqueName}`);
|
@@ -326336,23 +327913,59 @@ async function waitForCompletion({
|
|
326336
327913
|
try {
|
326337
327914
|
return await showSpinner();
|
326338
327915
|
} catch (error45) {
|
326339
|
-
|
326340
|
-
if (restartIfTimeout && isTimeoutError) {
|
327916
|
+
if (!hasRestarted && shouldRestart(error45, restartIfTimeout)) {
|
326341
327917
|
note(`Restarting ${capitalizeFirstLetter2(type4)}`);
|
327918
|
+
hasRestarted = true;
|
326342
327919
|
await service.restart(uniqueName);
|
326343
327920
|
return showSpinner();
|
326344
327921
|
}
|
326345
327922
|
throw error45;
|
326346
327923
|
}
|
326347
327924
|
}
|
326348
|
-
function
|
326349
|
-
|
326350
|
-
|
327925
|
+
function shouldRestart(error45, restartIfTimeout) {
|
327926
|
+
const isSpinnerError = error45 instanceof SpinnerError;
|
327927
|
+
const isDeploymentFailedError = error45 instanceof DeploymentFailedError || isSpinnerError && error45.originalError instanceof DeploymentFailedError;
|
327928
|
+
if (isDeploymentFailedError) {
|
327929
|
+
return true;
|
326351
327930
|
}
|
326352
|
-
|
326353
|
-
|
327931
|
+
const isTimeoutError = error45 instanceof TimeoutError2 || isSpinnerError && error45.originalError instanceof TimeoutError2;
|
327932
|
+
return restartIfTimeout && isTimeoutError;
|
327933
|
+
}
|
327934
|
+
function updateStatus(spinner2, message) {
|
327935
|
+
if (spinner2) {
|
327936
|
+
spinner2.text = message;
|
327937
|
+
} else {
|
327938
|
+
note(message);
|
327939
|
+
}
|
327940
|
+
}
|
327941
|
+
function isActionComplete(action, status) {
|
327942
|
+
switch (action) {
|
327943
|
+
case "pause":
|
327944
|
+
return status === "PAUSED" || status === "AUTO_PAUSED";
|
327945
|
+
case "resume":
|
327946
|
+
case "deploy":
|
327947
|
+
case "destroy":
|
327948
|
+
case "restart":
|
327949
|
+
return status === "COMPLETED";
|
327950
|
+
default:
|
327951
|
+
return false;
|
327952
|
+
}
|
327953
|
+
}
|
327954
|
+
function getActionLabel(action) {
|
327955
|
+
switch (action) {
|
327956
|
+
case "restart":
|
327957
|
+
return "restarted";
|
327958
|
+
case "destroy":
|
327959
|
+
return "destroyed";
|
327960
|
+
case "pause":
|
327961
|
+
return "paused";
|
327962
|
+
case "resume":
|
327963
|
+
return "resumed";
|
327964
|
+
case "deploy":
|
327965
|
+
return "deployed";
|
327966
|
+
default:
|
327967
|
+
return "deployed";
|
326354
327968
|
}
|
326355
|
-
return "deployed";
|
326356
327969
|
}
|
326357
327970
|
|
326358
327971
|
// src/prompts/provider.prompt.ts
|
@@ -326433,9 +328046,9 @@ function getCreateCommand({
|
|
326433
328046
|
cmd2.alias(alias);
|
326434
328047
|
}
|
326435
328048
|
if (requiresDeployment) {
|
326436
|
-
cmd2.option("-w, --wait", "Wait until deployed").option("
|
328049
|
+
cmd2.option("-w, --wait", "Wait until deployed").option("--restart-if-timeout", "Restart if wait time is exceeded").option("--restart-on-error", "Restart if deployment fails");
|
326437
328050
|
}
|
326438
|
-
execute2(cmd2, async ({ acceptDefaults, prod, default: isDefault, wait: wait2, restartIfTimeout, provider, region }, createFunction) => {
|
328051
|
+
execute2(cmd2, async ({ acceptDefaults, prod, default: isDefault, wait: wait2, restartIfTimeout, restartOnError, provider, region }, createFunction) => {
|
326439
328052
|
intro(`Creating ${type4} in the SettleMint platform`);
|
326440
328053
|
const env2 = await loadEnv(false, !!prod);
|
326441
328054
|
const instance = await instancePrompt({ env: env2, accept: acceptDefaults });
|
@@ -326479,7 +328092,8 @@ function getCreateCommand({
|
|
326479
328092
|
type: waitFor?.resourceType ?? type4,
|
326480
328093
|
uniqueName: waitFor?.uniqueName ?? result.uniqueName,
|
326481
328094
|
action: "deploy",
|
326482
|
-
restartIfTimeout
|
328095
|
+
restartIfTimeout,
|
328096
|
+
restartOnError
|
326483
328097
|
});
|
326484
328098
|
if (!isDeployed) {
|
326485
328099
|
throw new Error(`Failed to deploy ${waitFor?.resourceType ?? type4} ${waitFor?.uniqueName ?? result.uniqueName}`);
|
@@ -327950,25 +329564,249 @@ function deleteCommand() {
|
|
327950
329564
|
return new Command("delete").alias("d").description("Delete a resource in the SettleMint platform").addCommand(applicationDeleteCommand()).addCommand(workspaceDeleteCommand());
|
327951
329565
|
}
|
327952
329566
|
|
329567
|
+
// src/commands/platform/common/pause-command.ts
|
329568
|
+
function getPauseCommand({
|
329569
|
+
name: name3,
|
329570
|
+
type: type4,
|
329571
|
+
alias,
|
329572
|
+
envKey,
|
329573
|
+
pauseFunction,
|
329574
|
+
usePersonalAccessToken = true
|
329575
|
+
}) {
|
329576
|
+
const commandName = sanitizeCommandName(name3);
|
329577
|
+
const typeCommandName = sanitizeCommandName(type4);
|
329578
|
+
const exampleCommandPrefix = `platform pause ${typeCommandName !== commandName ? `${typeCommandName} ` : ""}${commandName}`;
|
329579
|
+
return new Command(commandName).alias(alias).description(`Pause a ${type4} in the SettleMint platform. Provide the ${type4} unique name or use 'default' to pause the default ${type4} from your .env file.`).usage(createExamples([
|
329580
|
+
{
|
329581
|
+
description: `Pauses the specified ${type4} by unique name`,
|
329582
|
+
command: `${exampleCommandPrefix} <unique-name>`
|
329583
|
+
},
|
329584
|
+
{
|
329585
|
+
description: `Pauses the default ${type4} in the production environment`,
|
329586
|
+
command: `${exampleCommandPrefix} default --prod`
|
329587
|
+
}
|
329588
|
+
])).argument("<unique-name>", `The unique name of the ${type4}, use 'default' to pause the default one from your .env file`).option("-a, --accept-defaults", "Accept the default and previously set values").option("--prod", "Connect to your production environment").option("-w, --wait", "Wait until paused").action(async (uniqueName, { acceptDefaults, prod, wait: wait2 }) => {
|
329589
|
+
intro(`Pausing ${type4} in the SettleMint platform`);
|
329590
|
+
const env2 = await loadEnv(false, !!prod);
|
329591
|
+
const instance = await instancePrompt({ env: env2, accept: acceptDefaults });
|
329592
|
+
const accessToken = await getApplicationOrPersonalAccessToken({
|
329593
|
+
env: env2,
|
329594
|
+
instance,
|
329595
|
+
prefer: usePersonalAccessToken ? "personal" : "application"
|
329596
|
+
});
|
329597
|
+
const settlemint = createSettleMintClient({
|
329598
|
+
accessToken,
|
329599
|
+
instance
|
329600
|
+
});
|
329601
|
+
const isDefaultUniqueName = uniqueName === "default";
|
329602
|
+
const serviceUniqueName = isDefaultUniqueName ? typeof env2[envKey] === "string" ? env2[envKey] : null : uniqueName;
|
329603
|
+
if (!serviceUniqueName) {
|
329604
|
+
cancel2(`No default ${type4} found in your .env file. Please provide a valid ${type4} unique name or set a default ${type4} first.`);
|
329605
|
+
}
|
329606
|
+
const result = await spinner({
|
329607
|
+
startMessage: `Pausing ${type4}`,
|
329608
|
+
task: async () => {
|
329609
|
+
return pauseFunction(settlemint, serviceUniqueName);
|
329610
|
+
},
|
329611
|
+
stopMessage: `${capitalizeFirstLetter2(type4)} pause initiated`
|
329612
|
+
});
|
329613
|
+
if (wait2) {
|
329614
|
+
const isPaused = await waitForCompletion({
|
329615
|
+
settlemint,
|
329616
|
+
type: type4,
|
329617
|
+
uniqueName: serviceUniqueName,
|
329618
|
+
action: "pause"
|
329619
|
+
});
|
329620
|
+
if (!isPaused) {
|
329621
|
+
throw new Error(`Failed to pause ${type4} ${serviceUniqueName}`);
|
329622
|
+
}
|
329623
|
+
}
|
329624
|
+
outro(`${capitalizeFirstLetter2(type4)} ${result.name} pause initiated successfully`);
|
329625
|
+
});
|
329626
|
+
}
|
329627
|
+
|
329628
|
+
// src/commands/platform/blockchain-network/pause.ts
|
329629
|
+
function blockchainNetworkPauseCommand() {
|
329630
|
+
return getPauseCommand({
|
329631
|
+
name: "blockchain-network",
|
329632
|
+
type: "blockchain network",
|
329633
|
+
alias: "bnw",
|
329634
|
+
envKey: "SETTLEMINT_BLOCKCHAIN_NETWORK",
|
329635
|
+
pauseFunction: async (settlemint, id) => {
|
329636
|
+
return settlemint.blockchainNetwork.pause(id);
|
329637
|
+
}
|
329638
|
+
});
|
329639
|
+
}
|
329640
|
+
|
329641
|
+
// src/commands/platform/blockchain-node/pause.ts
|
329642
|
+
function blockchainNodePauseCommand() {
|
329643
|
+
return getPauseCommand({
|
329644
|
+
name: "blockchain-node",
|
329645
|
+
type: "blockchain node",
|
329646
|
+
alias: "bn",
|
329647
|
+
envKey: "SETTLEMINT_BLOCKCHAIN_NODE",
|
329648
|
+
pauseFunction: async (settlemint, id) => {
|
329649
|
+
return settlemint.blockchainNode.pause(id);
|
329650
|
+
}
|
329651
|
+
});
|
329652
|
+
}
|
329653
|
+
|
329654
|
+
// src/commands/platform/custom-deployments/pause.ts
|
329655
|
+
function customDeploymentPauseCommand() {
|
329656
|
+
return getPauseCommand({
|
329657
|
+
name: "custom-deployment",
|
329658
|
+
type: "custom deployment",
|
329659
|
+
alias: "cd",
|
329660
|
+
envKey: "SETTLEMINT_CUSTOM_DEPLOYMENT",
|
329661
|
+
pauseFunction: async (settlemint, id) => {
|
329662
|
+
return settlemint.customDeployment.pause(id);
|
329663
|
+
}
|
329664
|
+
});
|
329665
|
+
}
|
329666
|
+
|
329667
|
+
// src/commands/platform/insights/blockscout/pause.ts
|
329668
|
+
function blockscoutPauseCommand() {
|
329669
|
+
return getPauseCommand({
|
329670
|
+
name: "blockscout",
|
329671
|
+
type: "insights",
|
329672
|
+
alias: "bs",
|
329673
|
+
envKey: "SETTLEMINT_BLOCKSCOUT",
|
329674
|
+
pauseFunction: async (settlemint, id) => {
|
329675
|
+
return settlemint.insights.pause(id);
|
329676
|
+
}
|
329677
|
+
});
|
329678
|
+
}
|
329679
|
+
|
329680
|
+
// src/commands/platform/integration-tools/hasura/pause.ts
|
329681
|
+
function hasuraPauseCommand() {
|
329682
|
+
return getPauseCommand({
|
329683
|
+
name: "hasura",
|
329684
|
+
type: "integration tool",
|
329685
|
+
alias: "ha",
|
329686
|
+
envKey: "SETTLEMINT_HASURA",
|
329687
|
+
pauseFunction: async (settlemint, id) => {
|
329688
|
+
return settlemint.integrationTool.pause(id);
|
329689
|
+
}
|
329690
|
+
});
|
329691
|
+
}
|
329692
|
+
|
329693
|
+
// src/commands/platform/load-balancer/evm/pause.ts
|
329694
|
+
function evmLoadBalancerPauseCommand() {
|
329695
|
+
return getPauseCommand({
|
329696
|
+
name: "evm",
|
329697
|
+
type: "load balancer",
|
329698
|
+
alias: "lb",
|
329699
|
+
envKey: "SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER",
|
329700
|
+
pauseFunction: async (settlemint, id) => {
|
329701
|
+
return settlemint.loadBalancer.pause(id);
|
329702
|
+
}
|
329703
|
+
});
|
329704
|
+
}
|
329705
|
+
|
329706
|
+
// src/commands/platform/middleware/graph/pause.ts
|
329707
|
+
function graphMiddlewarePauseCommand() {
|
329708
|
+
return getPauseCommand({
|
329709
|
+
name: "graph",
|
329710
|
+
type: "middleware",
|
329711
|
+
alias: "gr",
|
329712
|
+
envKey: "SETTLEMINT_THEGRAPH",
|
329713
|
+
pauseFunction: async (settlemint, id) => {
|
329714
|
+
return settlemint.middleware.pause(id);
|
329715
|
+
}
|
329716
|
+
});
|
329717
|
+
}
|
329718
|
+
|
329719
|
+
// src/commands/platform/middleware/smart-contract-portal/pause.ts
|
329720
|
+
function smartContractPortalMiddlewarePauseCommand() {
|
329721
|
+
return getPauseCommand({
|
329722
|
+
name: "smart-contract-portal",
|
329723
|
+
type: "middleware",
|
329724
|
+
alias: "scp",
|
329725
|
+
envKey: "SETTLEMINT_PORTAL",
|
329726
|
+
pauseFunction: async (settlemint, id) => {
|
329727
|
+
return settlemint.middleware.pause(id);
|
329728
|
+
}
|
329729
|
+
});
|
329730
|
+
}
|
329731
|
+
|
329732
|
+
// src/commands/platform/private-key/accessible-ecdsa-p256/pause.ts
|
329733
|
+
function accessibleEcdsaP256PrivateKeyPauseCommand() {
|
329734
|
+
return getPauseCommand({
|
329735
|
+
name: "accessible-ecdsa-p256",
|
329736
|
+
type: "private key",
|
329737
|
+
alias: "acc",
|
329738
|
+
envKey: "SETTLEMINT_ACCESSIBLE_PRIVATE_KEY",
|
329739
|
+
pauseFunction: async (settlemint, id) => {
|
329740
|
+
return settlemint.privateKey.pause(id);
|
329741
|
+
}
|
329742
|
+
});
|
329743
|
+
}
|
329744
|
+
|
329745
|
+
// src/commands/platform/private-key/hd-ecdsa-p256/pause.ts
|
329746
|
+
function hdEcdsaP256PrivateKeyPauseCommand() {
|
329747
|
+
return getPauseCommand({
|
329748
|
+
name: "hd-ecdsa-p256",
|
329749
|
+
type: "private key",
|
329750
|
+
alias: "hd",
|
329751
|
+
envKey: "SETTLEMINT_HD_PRIVATE_KEY",
|
329752
|
+
pauseFunction: async (settlemint, id) => {
|
329753
|
+
return settlemint.privateKey.pause(id);
|
329754
|
+
}
|
329755
|
+
});
|
329756
|
+
}
|
329757
|
+
|
329758
|
+
// src/commands/platform/storage/ipfs/pause.ts
|
329759
|
+
function ipfsStoragePauseCommand() {
|
329760
|
+
return getPauseCommand({
|
329761
|
+
name: "ipfs",
|
329762
|
+
type: "storage",
|
329763
|
+
alias: "ip",
|
329764
|
+
envKey: "SETTLEMINT_IPFS",
|
329765
|
+
pauseFunction: async (settlemint, id) => {
|
329766
|
+
return settlemint.storage.pause(id);
|
329767
|
+
}
|
329768
|
+
});
|
329769
|
+
}
|
329770
|
+
|
329771
|
+
// src/commands/platform/storage/minio/pause.ts
|
329772
|
+
function minioStoragePauseCommand() {
|
329773
|
+
return getPauseCommand({
|
329774
|
+
name: "minio",
|
329775
|
+
type: "storage",
|
329776
|
+
alias: "m",
|
329777
|
+
envKey: "SETTLEMINT_MINIO",
|
329778
|
+
pauseFunction: async (settlemint, id) => {
|
329779
|
+
return settlemint.storage.pause(id);
|
329780
|
+
}
|
329781
|
+
});
|
329782
|
+
}
|
329783
|
+
|
329784
|
+
// src/commands/platform/pause.ts
|
329785
|
+
function pauseCommand() {
|
329786
|
+
const cmd2 = new Command("pause").description("Pause a resource in the SettleMint platform").addCommand(blockchainNodePauseCommand()).addCommand(blockchainNetworkPauseCommand()).addCommand(customDeploymentPauseCommand()).addCommand(blockscoutPauseCommand()).addCommand(hasuraPauseCommand()).addCommand(evmLoadBalancerPauseCommand()).addCommand(graphMiddlewarePauseCommand()).addCommand(smartContractPortalMiddlewarePauseCommand()).addCommand(accessibleEcdsaP256PrivateKeyPauseCommand()).addCommand(hdEcdsaP256PrivateKeyPauseCommand()).addCommand(ipfsStoragePauseCommand()).addCommand(minioStoragePauseCommand());
|
329787
|
+
return cmd2;
|
329788
|
+
}
|
329789
|
+
|
327953
329790
|
// src/commands/platform/common/restart-command.ts
|
327954
329791
|
function getRestartCommand({
|
327955
329792
|
name: name3,
|
327956
329793
|
type: type4,
|
327957
|
-
subType,
|
327958
329794
|
alias,
|
327959
329795
|
envKey,
|
327960
329796
|
restartFunction,
|
327961
329797
|
usePersonalAccessToken = true
|
327962
329798
|
}) {
|
327963
329799
|
const commandName = sanitizeCommandName(name3);
|
329800
|
+
const typeCommandName = sanitizeCommandName(type4);
|
329801
|
+
const exampleCommandPrefix = `platform restart ${typeCommandName !== commandName ? `${typeCommandName} ` : ""}${commandName}`;
|
327964
329802
|
return new Command(commandName).alias(alias).description(`Restart a ${type4} in the SettleMint platform. Provide the ${type4} unique name or use 'default' to restart the default ${type4} from your .env file.`).usage(createExamples([
|
327965
329803
|
{
|
327966
|
-
description: `Restarts the specified ${type4} by
|
327967
|
-
command:
|
329804
|
+
description: `Restarts the specified ${type4} by unique name`,
|
329805
|
+
command: `${exampleCommandPrefix} <unique-name>`
|
327968
329806
|
},
|
327969
329807
|
{
|
327970
329808
|
description: `Restarts the default ${type4} in the production environment`,
|
327971
|
-
command:
|
329809
|
+
command: `${exampleCommandPrefix} default --prod`
|
327972
329810
|
}
|
327973
329811
|
])).argument("<unique-name>", `The unique name of the ${type4}, use 'default' to restart the default one from your .env file`).option("-a, --accept-defaults", "Accept the default and previously set values").option("--prod", "Connect to your production environment").option("-w, --wait", "Wait until restarted").action(async (uniqueName, { acceptDefaults, prod, wait: wait2 }) => {
|
327974
329812
|
intro(`Restarting ${type4} in the SettleMint platform`);
|
@@ -328055,7 +329893,6 @@ function blockscoutRestartCommand() {
|
|
328055
329893
|
return getRestartCommand({
|
328056
329894
|
name: "blockscout",
|
328057
329895
|
type: "insights",
|
328058
|
-
subType: "blockscout",
|
328059
329896
|
alias: "bs",
|
328060
329897
|
envKey: "SETTLEMINT_BLOCKSCOUT",
|
328061
329898
|
restartFunction: async (settlemint, uniqueName) => {
|
@@ -328074,7 +329911,6 @@ function hasuraRestartCommand() {
|
|
328074
329911
|
return getRestartCommand({
|
328075
329912
|
name: "hasura",
|
328076
329913
|
type: "integration tool",
|
328077
|
-
subType: "hasura",
|
328078
329914
|
alias: "ha",
|
328079
329915
|
envKey: "SETTLEMINT_HASURA",
|
328080
329916
|
restartFunction: async (settlemint, uniqueName) => {
|
@@ -328106,7 +329942,6 @@ function graphRestartCommand() {
|
|
328106
329942
|
return getRestartCommand({
|
328107
329943
|
name: "graph",
|
328108
329944
|
type: "middleware",
|
328109
|
-
subType: "graph",
|
328110
329945
|
alias: "gr",
|
328111
329946
|
envKey: "SETTLEMINT_THEGRAPH",
|
328112
329947
|
restartFunction: async (settlemint, id) => {
|
@@ -328120,7 +329955,6 @@ function smartContractPortalRestartCommand() {
|
|
328120
329955
|
return getRestartCommand({
|
328121
329956
|
name: "smart-contract-portal",
|
328122
329957
|
type: "middleware",
|
328123
|
-
subType: "smart-contract-portal",
|
328124
329958
|
alias: "scp",
|
328125
329959
|
envKey: "SETTLEMINT_PORTAL",
|
328126
329960
|
restartFunction: async (settlemint, uniqueName) => {
|
@@ -328171,6 +330005,229 @@ function restartCommand() {
|
|
328171
330005
|
return cmd2;
|
328172
330006
|
}
|
328173
330007
|
|
330008
|
+
// src/commands/platform/common/resume-command.ts
|
330009
|
+
function getResumeCommand({
|
330010
|
+
name: name3,
|
330011
|
+
type: type4,
|
330012
|
+
alias,
|
330013
|
+
envKey,
|
330014
|
+
resumeFunction,
|
330015
|
+
usePersonalAccessToken = true
|
330016
|
+
}) {
|
330017
|
+
const commandName = sanitizeCommandName(name3);
|
330018
|
+
const typeCommandName = sanitizeCommandName(type4);
|
330019
|
+
const exampleCommandPrefix = `platform resume ${typeCommandName !== commandName ? `${typeCommandName} ` : ""}${commandName}`;
|
330020
|
+
return new Command(commandName).alias(alias).description(`Resume a ${type4} in the SettleMint platform. Provide the ${type4} unique name or use 'default' to resume the default ${type4} from your .env file.`).usage(createExamples([
|
330021
|
+
{
|
330022
|
+
description: `Resumes the specified ${type4} by unique name`,
|
330023
|
+
command: `${exampleCommandPrefix} <unique-name>`
|
330024
|
+
},
|
330025
|
+
{
|
330026
|
+
description: `Resumes the default ${type4} in the production environment`,
|
330027
|
+
command: `${exampleCommandPrefix} default --prod`
|
330028
|
+
}
|
330029
|
+
])).argument("<unique-name>", `The unique name of the ${type4}, use 'default' to resume the default one from your .env file`).option("-a, --accept-defaults", "Accept the default and previously set values").option("--prod", "Connect to your production environment").option("-w, --wait", "Wait until resumed").action(async (uniqueName, { acceptDefaults, prod, wait: wait2 }) => {
|
330030
|
+
intro(`Resuming ${type4} in the SettleMint platform`);
|
330031
|
+
const env2 = await loadEnv(false, !!prod);
|
330032
|
+
const instance = await instancePrompt({ env: env2, accept: acceptDefaults });
|
330033
|
+
const accessToken = await getApplicationOrPersonalAccessToken({
|
330034
|
+
env: env2,
|
330035
|
+
instance,
|
330036
|
+
prefer: usePersonalAccessToken ? "personal" : "application"
|
330037
|
+
});
|
330038
|
+
const settlemint = createSettleMintClient({
|
330039
|
+
accessToken,
|
330040
|
+
instance
|
330041
|
+
});
|
330042
|
+
const isDefaultUniqueName = uniqueName === "default";
|
330043
|
+
const serviceUniqueName = isDefaultUniqueName ? typeof env2[envKey] === "string" ? env2[envKey] : null : uniqueName;
|
330044
|
+
if (!serviceUniqueName) {
|
330045
|
+
cancel2(`No default ${type4} found in your .env file. Please provide a valid ${type4} unique name or set a default ${type4} first.`);
|
330046
|
+
}
|
330047
|
+
const result = await spinner({
|
330048
|
+
startMessage: `Resuming ${type4}`,
|
330049
|
+
task: async () => {
|
330050
|
+
return resumeFunction(settlemint, serviceUniqueName);
|
330051
|
+
},
|
330052
|
+
stopMessage: `${capitalizeFirstLetter2(type4)} resume initiated`
|
330053
|
+
});
|
330054
|
+
if (wait2) {
|
330055
|
+
const isResumed = await waitForCompletion({
|
330056
|
+
settlemint,
|
330057
|
+
type: type4,
|
330058
|
+
uniqueName: serviceUniqueName,
|
330059
|
+
action: "resume"
|
330060
|
+
});
|
330061
|
+
if (!isResumed) {
|
330062
|
+
throw new Error(`Failed to resume ${type4} ${serviceUniqueName}`);
|
330063
|
+
}
|
330064
|
+
}
|
330065
|
+
outro(`${capitalizeFirstLetter2(type4)} ${result.name} resume initiated successfully`);
|
330066
|
+
});
|
330067
|
+
}
|
330068
|
+
|
330069
|
+
// src/commands/platform/blockchain-network/resume.ts
|
330070
|
+
function blockchainNetworkResumeCommand() {
|
330071
|
+
return getResumeCommand({
|
330072
|
+
name: "blockchain-network",
|
330073
|
+
type: "blockchain network",
|
330074
|
+
alias: "bnw",
|
330075
|
+
envKey: "SETTLEMINT_BLOCKCHAIN_NETWORK",
|
330076
|
+
resumeFunction: async (settlemint, id) => {
|
330077
|
+
return settlemint.blockchainNetwork.resume(id);
|
330078
|
+
}
|
330079
|
+
});
|
330080
|
+
}
|
330081
|
+
|
330082
|
+
// src/commands/platform/blockchain-node/resume.ts
|
330083
|
+
function blockchainNodeResumeCommand() {
|
330084
|
+
return getResumeCommand({
|
330085
|
+
name: "blockchain-node",
|
330086
|
+
type: "blockchain node",
|
330087
|
+
alias: "bn",
|
330088
|
+
envKey: "SETTLEMINT_BLOCKCHAIN_NODE",
|
330089
|
+
resumeFunction: async (settlemint, id) => {
|
330090
|
+
return settlemint.blockchainNode.resume(id);
|
330091
|
+
}
|
330092
|
+
});
|
330093
|
+
}
|
330094
|
+
|
330095
|
+
// src/commands/platform/custom-deployments/resume.ts
|
330096
|
+
function customDeploymentResumeCommand() {
|
330097
|
+
return getResumeCommand({
|
330098
|
+
name: "custom-deployment",
|
330099
|
+
type: "custom deployment",
|
330100
|
+
alias: "cd",
|
330101
|
+
envKey: "SETTLEMINT_CUSTOM_DEPLOYMENT",
|
330102
|
+
resumeFunction: async (settlemint, id) => {
|
330103
|
+
return settlemint.customDeployment.resume(id);
|
330104
|
+
}
|
330105
|
+
});
|
330106
|
+
}
|
330107
|
+
|
330108
|
+
// src/commands/platform/insights/blockscout/resume.ts
|
330109
|
+
function blockscoutResumeCommand() {
|
330110
|
+
return getResumeCommand({
|
330111
|
+
name: "blockscout",
|
330112
|
+
type: "insights",
|
330113
|
+
alias: "bs",
|
330114
|
+
envKey: "SETTLEMINT_BLOCKSCOUT",
|
330115
|
+
resumeFunction: async (settlemint, id) => {
|
330116
|
+
return settlemint.insights.resume(id);
|
330117
|
+
}
|
330118
|
+
});
|
330119
|
+
}
|
330120
|
+
|
330121
|
+
// src/commands/platform/integration-tools/hasura/resume.ts
|
330122
|
+
function hasuraResumeCommand() {
|
330123
|
+
return getResumeCommand({
|
330124
|
+
name: "hasura",
|
330125
|
+
type: "integration tool",
|
330126
|
+
alias: "ha",
|
330127
|
+
envKey: "SETTLEMINT_HASURA",
|
330128
|
+
resumeFunction: async (settlemint, id) => {
|
330129
|
+
return settlemint.integrationTool.resume(id);
|
330130
|
+
}
|
330131
|
+
});
|
330132
|
+
}
|
330133
|
+
|
330134
|
+
// src/commands/platform/load-balancer/evm/resume.ts
|
330135
|
+
function evmLoadBalancerResumeCommand() {
|
330136
|
+
return getResumeCommand({
|
330137
|
+
name: "evm",
|
330138
|
+
type: "load balancer",
|
330139
|
+
alias: "lb",
|
330140
|
+
envKey: "SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER",
|
330141
|
+
resumeFunction: async (settlemint, id) => {
|
330142
|
+
return settlemint.loadBalancer.resume(id);
|
330143
|
+
}
|
330144
|
+
});
|
330145
|
+
}
|
330146
|
+
|
330147
|
+
// src/commands/platform/middleware/graph/resume.ts
|
330148
|
+
function graphMiddlewareResumeCommand() {
|
330149
|
+
return getResumeCommand({
|
330150
|
+
name: "graph",
|
330151
|
+
type: "middleware",
|
330152
|
+
alias: "gr",
|
330153
|
+
envKey: "SETTLEMINT_THEGRAPH",
|
330154
|
+
resumeFunction: async (settlemint, id) => {
|
330155
|
+
return settlemint.middleware.resume(id);
|
330156
|
+
}
|
330157
|
+
});
|
330158
|
+
}
|
330159
|
+
|
330160
|
+
// src/commands/platform/middleware/smart-contract-portal/resume.ts
|
330161
|
+
function smartContractPortalMiddlewareResumeCommand() {
|
330162
|
+
return getResumeCommand({
|
330163
|
+
name: "smart-contract-portal",
|
330164
|
+
type: "middleware",
|
330165
|
+
alias: "scp",
|
330166
|
+
envKey: "SETTLEMINT_PORTAL",
|
330167
|
+
resumeFunction: async (settlemint, id) => {
|
330168
|
+
return settlemint.middleware.resume(id);
|
330169
|
+
}
|
330170
|
+
});
|
330171
|
+
}
|
330172
|
+
|
330173
|
+
// src/commands/platform/private-key/accessible-ecdsa-p256/resume.ts
|
330174
|
+
function accessibleEcdsaP256PrivateKeyResumeCommand() {
|
330175
|
+
return getResumeCommand({
|
330176
|
+
name: "accessible-ecdsa-p256",
|
330177
|
+
type: "private key",
|
330178
|
+
alias: "acc",
|
330179
|
+
envKey: "SETTLEMINT_ACCESSIBLE_PRIVATE_KEY",
|
330180
|
+
resumeFunction: async (settlemint, id) => {
|
330181
|
+
return settlemint.privateKey.resume(id);
|
330182
|
+
}
|
330183
|
+
});
|
330184
|
+
}
|
330185
|
+
|
330186
|
+
// src/commands/platform/private-key/hd-ecdsa-p256/resume.ts
|
330187
|
+
function hdEcdsaP256PrivateKeyResumeCommand() {
|
330188
|
+
return getResumeCommand({
|
330189
|
+
name: "hd-ecdsa-p256",
|
330190
|
+
type: "private key",
|
330191
|
+
alias: "hd",
|
330192
|
+
envKey: "SETTLEMINT_HD_PRIVATE_KEY",
|
330193
|
+
resumeFunction: async (settlemint, id) => {
|
330194
|
+
return settlemint.privateKey.resume(id);
|
330195
|
+
}
|
330196
|
+
});
|
330197
|
+
}
|
330198
|
+
|
330199
|
+
// src/commands/platform/storage/ipfs/resume.ts
|
330200
|
+
function ipfsStorageResumeCommand() {
|
330201
|
+
return getResumeCommand({
|
330202
|
+
name: "ipfs",
|
330203
|
+
type: "storage",
|
330204
|
+
alias: "ip",
|
330205
|
+
envKey: "SETTLEMINT_IPFS",
|
330206
|
+
resumeFunction: async (settlemint, id) => {
|
330207
|
+
return settlemint.storage.resume(id);
|
330208
|
+
}
|
330209
|
+
});
|
330210
|
+
}
|
330211
|
+
|
330212
|
+
// src/commands/platform/storage/minio/resume.ts
|
330213
|
+
function minioStorageResumeCommand() {
|
330214
|
+
return getResumeCommand({
|
330215
|
+
name: "minio",
|
330216
|
+
type: "storage",
|
330217
|
+
alias: "m",
|
330218
|
+
envKey: "SETTLEMINT_MINIO",
|
330219
|
+
resumeFunction: async (settlemint, id) => {
|
330220
|
+
return settlemint.storage.resume(id);
|
330221
|
+
}
|
330222
|
+
});
|
330223
|
+
}
|
330224
|
+
|
330225
|
+
// src/commands/platform/resume.ts
|
330226
|
+
function resumeCommand() {
|
330227
|
+
const cmd2 = new Command("resume").description("Resume a resource in the SettleMint platform").addCommand(blockchainNodeResumeCommand()).addCommand(blockchainNetworkResumeCommand()).addCommand(customDeploymentResumeCommand()).addCommand(blockscoutResumeCommand()).addCommand(hasuraResumeCommand()).addCommand(evmLoadBalancerResumeCommand()).addCommand(graphMiddlewareResumeCommand()).addCommand(smartContractPortalMiddlewareResumeCommand()).addCommand(accessibleEcdsaP256PrivateKeyResumeCommand()).addCommand(hdEcdsaP256PrivateKeyResumeCommand()).addCommand(ipfsStorageResumeCommand()).addCommand(minioStorageResumeCommand());
|
330228
|
+
return cmd2;
|
330229
|
+
}
|
330230
|
+
|
328174
330231
|
// src/commands/platform/custom-deployments/update.ts
|
328175
330232
|
function customDeploymentsUpdateCommand() {
|
328176
330233
|
return new Command("custom-deployment").alias("cd").argument("<tag>", "The tag to update the custom deployment to").option("--unique-name <uniqueName>", "The unique name of the custom deployment to update. If not provided, will use SETTLEMINT_CUSTOM_DEPLOYMENT from env").option("--prod", "Connect to your production environment").option("--wait", "Wait for the custom deployment to be redeployed").description("Update a custom deployment in the SettleMint platform").usage(createExamples([
|
@@ -328235,7 +330292,7 @@ function jsonOutput(data) {
|
|
328235
330292
|
var composer = require_composer();
|
328236
330293
|
var Document = require_Document();
|
328237
330294
|
var Schema = require_Schema();
|
328238
|
-
var
|
330295
|
+
var errors7 = require_errors3();
|
328239
330296
|
var Alias = require_Alias();
|
328240
330297
|
var identity2 = require_identity();
|
328241
330298
|
var Pair = require_Pair();
|
@@ -328251,9 +330308,9 @@ var visit2 = require_visit();
|
|
328251
330308
|
var $Composer = composer.Composer;
|
328252
330309
|
var $Document = Document.Document;
|
328253
330310
|
var $Schema = Schema.Schema;
|
328254
|
-
var $YAMLError =
|
328255
|
-
var $YAMLParseError =
|
328256
|
-
var $YAMLWarning =
|
330311
|
+
var $YAMLError = errors7.YAMLError;
|
330312
|
+
var $YAMLParseError = errors7.YAMLParseError;
|
330313
|
+
var $YAMLWarning = errors7.YAMLWarning;
|
328257
330314
|
var $Alias = Alias.Alias;
|
328258
330315
|
var $isAlias = identity2.isAlias;
|
328259
330316
|
var $isCollection = identity2.isCollection;
|
@@ -328746,7 +330803,7 @@ function listCommand() {
|
|
328746
330803
|
|
328747
330804
|
// src/commands/platform.ts
|
328748
330805
|
function platformCommand() {
|
328749
|
-
return new Command("platform").description("Manage SettleMint platform resources").addCommand(configCommand()).addCommand(createCommand3()).addCommand(deleteCommand()).addCommand(listCommand()).addCommand(restartCommand()).addCommand(updateCommand());
|
330806
|
+
return new Command("platform").description("Manage SettleMint platform resources").addCommand(configCommand()).addCommand(createCommand3()).addCommand(deleteCommand()).addCommand(listCommand()).addCommand(pauseCommand()).addCommand(resumeCommand()).addCommand(restartCommand()).addCommand(updateCommand());
|
328750
330807
|
}
|
328751
330808
|
|
328752
330809
|
// src/commands/smart-contract-set/create.ts
|
@@ -328860,11 +330917,11 @@ function createCommand4() {
|
|
328860
330917
|
|
328861
330918
|
// src/utils/commands/passthrough-options.ts
|
328862
330919
|
function mapPassthroughOptions(options, command) {
|
328863
|
-
const optionArgs = Object.entries(options).map(([
|
330920
|
+
const optionArgs = Object.entries(options).map(([key5, value4]) => {
|
328864
330921
|
if (value4 === true) {
|
328865
|
-
return `--${
|
330922
|
+
return `--${key5}`;
|
328866
330923
|
}
|
328867
|
-
return `--${
|
330924
|
+
return `--${key5}=${value4}`;
|
328868
330925
|
});
|
328869
330926
|
return [...optionArgs, ...command.args];
|
328870
330927
|
}
|
@@ -329682,12 +331739,12 @@ async function getNodeName({
|
|
329682
331739
|
|
329683
331740
|
// src/commands/smart-contract-set/subgraph/build.ts
|
329684
331741
|
function subgraphBuildCommand() {
|
329685
|
-
return new Command("build").description("Build the subgraph").usage(createExamples([
|
331742
|
+
return new Command("build").description("Build the subgraph").option("--ipfs <ipfs-url>", "The IPFS URL to use for the subgraph deployment").usage(createExamples([
|
329686
331743
|
{
|
329687
331744
|
description: "Build the subgraph",
|
329688
331745
|
command: "scs subgraph build"
|
329689
331746
|
}
|
329690
|
-
])).action(async () => {
|
331747
|
+
])).action(async ({ ipfs }) => {
|
329691
331748
|
intro("Building subgraph");
|
329692
331749
|
await validateIfRequiredPackagesAreInstalled(["@graphprotocol/graph-cli"]);
|
329693
331750
|
await subgraphSetup({
|
@@ -329696,7 +331753,7 @@ function subgraphBuildCommand() {
|
|
329696
331753
|
const { command, args } = await getPackageManagerExecutable();
|
329697
331754
|
const subgraphYamlFile = await getSubgraphYamlFile();
|
329698
331755
|
await executeCommand(command, [...args, "graph", "codegen", subgraphYamlFile]);
|
329699
|
-
await executeCommand(command, [...args, "graph", "build", subgraphYamlFile]);
|
331756
|
+
await executeCommand(command, [...args, "graph", "build", ...ipfs ? ["--ipfs", ipfs] : [], subgraphYamlFile]);
|
329700
331757
|
outro("Subgraph built successfully");
|
329701
331758
|
});
|
329702
331759
|
}
|
@@ -330092,4 +332149,4 @@ async function sdkCliCommand(argv = process.argv) {
|
|
330092
332149
|
// src/cli.ts
|
330093
332150
|
sdkCliCommand();
|
330094
332151
|
|
330095
|
-
//# debugId=
|
332152
|
+
//# debugId=90DC15CB570F9B4764756E2164756E21
|