@settlemint/sdk-cli 2.6.4-prb18a8132 → 2.6.4-prfe37148c
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 +261 -248
- package/dist/cli.js.map +8 -8
- package/package.json +9 -9
package/dist/cli.js
CHANGED
|
@@ -161879,7 +161879,7 @@ ${lanes.join(`
|
|
|
161879
161879
|
function generateOptionOutput(sys2, option, rightAlignOfLeft, leftAlignOfRight) {
|
|
161880
161880
|
var _a;
|
|
161881
161881
|
const text = [];
|
|
161882
|
-
const
|
|
161882
|
+
const colors3 = createColors(sys2);
|
|
161883
161883
|
const name2 = getDisplayNameTextOfOption(option);
|
|
161884
161884
|
const valueCandidates = getValueCandidate(option);
|
|
161885
161885
|
const defaultValueDescription = typeof option.defaultValueDescription === "object" ? getDiagnosticText(option.defaultValueDescription) : formatDefaultValue(option.defaultValueDescription, option.type === "list" || option.type === "listOrElement" ? option.element.type : option.type);
|
|
@@ -161900,7 +161900,7 @@ ${lanes.join(`
|
|
|
161900
161900
|
}
|
|
161901
161901
|
text.push(sys2.newLine);
|
|
161902
161902
|
} else {
|
|
161903
|
-
text.push(
|
|
161903
|
+
text.push(colors3.blue(name2), sys2.newLine);
|
|
161904
161904
|
if (option.description) {
|
|
161905
161905
|
const description3 = getDiagnosticText(option.description);
|
|
161906
161906
|
text.push(description3);
|
|
@@ -161945,7 +161945,7 @@ ${lanes.join(`
|
|
|
161945
161945
|
if (isFirstLine) {
|
|
161946
161946
|
curLeft = left.padStart(rightAlignOfLeft2);
|
|
161947
161947
|
curLeft = curLeft.padEnd(leftAlignOfRight2);
|
|
161948
|
-
curLeft = colorLeft ?
|
|
161948
|
+
curLeft = colorLeft ? colors3.blue(curLeft) : curLeft;
|
|
161949
161949
|
} else {
|
|
161950
161950
|
curLeft = "".padStart(leftAlignOfRight2);
|
|
161951
161951
|
}
|
|
@@ -162057,9 +162057,9 @@ ${lanes.join(`
|
|
|
162057
162057
|
return res;
|
|
162058
162058
|
}
|
|
162059
162059
|
function printEasyHelp(sys2, simpleOptions) {
|
|
162060
|
-
const
|
|
162060
|
+
const colors3 = createColors(sys2);
|
|
162061
162061
|
let output = [...getHeader(sys2, `${getDiagnosticText(Diagnostics.tsc_Colon_The_TypeScript_Compiler)} - ${getDiagnosticText(Diagnostics.Version_0, version2)}`)];
|
|
162062
|
-
output.push(
|
|
162062
|
+
output.push(colors3.bold(getDiagnosticText(Diagnostics.COMMON_COMMANDS)) + sys2.newLine + sys2.newLine);
|
|
162063
162063
|
example("tsc", Diagnostics.Compiles_the_current_project_tsconfig_json_in_the_working_directory);
|
|
162064
162064
|
example("tsc app.ts util.ts", Diagnostics.Ignoring_tsconfig_json_compiles_the_specified_files_with_default_compiler_options);
|
|
162065
162065
|
example("tsc -b", Diagnostics.Build_a_composite_project_in_the_working_directory);
|
|
@@ -162080,7 +162080,7 @@ ${lanes.join(`
|
|
|
162080
162080
|
function example(ex, desc) {
|
|
162081
162081
|
const examples = typeof ex === "string" ? [ex] : ex;
|
|
162082
162082
|
for (const example2 of examples) {
|
|
162083
|
-
output.push(" " +
|
|
162083
|
+
output.push(" " + colors3.blue(example2) + sys2.newLine);
|
|
162084
162084
|
}
|
|
162085
162085
|
output.push(" " + getDiagnosticText(desc) + sys2.newLine + sys2.newLine);
|
|
162086
162086
|
}
|
|
@@ -162103,12 +162103,12 @@ ${lanes.join(`
|
|
|
162103
162103
|
}
|
|
162104
162104
|
function getHeader(sys2, message) {
|
|
162105
162105
|
var _a;
|
|
162106
|
-
const
|
|
162106
|
+
const colors3 = createColors(sys2);
|
|
162107
162107
|
const header = [];
|
|
162108
162108
|
const terminalWidth = ((_a = sys2.getWidthOfTerminal) == null ? undefined : _a.call(sys2)) ?? 0;
|
|
162109
162109
|
const tsIconLength = 5;
|
|
162110
|
-
const tsIconFirstLine =
|
|
162111
|
-
const tsIconSecondLine =
|
|
162110
|
+
const tsIconFirstLine = colors3.blueBackground("".padStart(tsIconLength));
|
|
162111
|
+
const tsIconSecondLine = colors3.blueBackground(colors3.brightWhite("TS ".padStart(tsIconLength)));
|
|
162112
162112
|
if (terminalWidth >= message.length + tsIconLength) {
|
|
162113
162113
|
const rightAlign = terminalWidth > 120 ? 120 : terminalWidth;
|
|
162114
162114
|
const leftAlign = rightAlign - tsIconLength;
|
|
@@ -261866,8 +261866,10 @@ var {
|
|
|
261866
261866
|
} = import__.default;
|
|
261867
261867
|
|
|
261868
261868
|
// ../../node_modules/.bun/@inquirer+core@10.3.0+c30ff3a63f0500d5/node_modules/@inquirer/core/dist/esm/lib/key.js
|
|
261869
|
+
var isUpKey = (key, keybindings = []) => key.name === "up" || keybindings.includes("vim") && key.name === "k" || keybindings.includes("emacs") && key.ctrl && key.name === "p";
|
|
261870
|
+
var isDownKey = (key, keybindings = []) => key.name === "down" || keybindings.includes("vim") && key.name === "j" || keybindings.includes("emacs") && key.ctrl && key.name === "n";
|
|
261869
261871
|
var isBackspaceKey = (key) => key.name === "backspace";
|
|
261870
|
-
var
|
|
261872
|
+
var isNumberKey = (key) => "1234567890".includes(key.name);
|
|
261871
261873
|
var isEnterKey = (key) => key.name === "enter" || key.name === "return";
|
|
261872
261874
|
// ../../node_modules/.bun/@inquirer+core@10.3.0+c30ff3a63f0500d5/node_modules/@inquirer/core/dist/esm/lib/errors.js
|
|
261873
261875
|
class AbortPromptError extends Error {
|
|
@@ -262401,11 +262403,22 @@ function usePrefix({ status = "idle", theme }) {
|
|
|
262401
262403
|
const iconName = status === "loading" ? "idle" : status;
|
|
262402
262404
|
return typeof prefix === "string" ? prefix : prefix[iconName] ?? prefix["idle"];
|
|
262403
262405
|
}
|
|
262406
|
+
// ../../node_modules/.bun/@inquirer+core@10.3.0+c30ff3a63f0500d5/node_modules/@inquirer/core/dist/esm/lib/use-memo.js
|
|
262407
|
+
function useMemo(fn, dependencies) {
|
|
262408
|
+
return withPointer((pointer) => {
|
|
262409
|
+
const prev = pointer.get();
|
|
262410
|
+
if (!prev || prev.dependencies.length !== dependencies.length || prev.dependencies.some((dep, i) => dep !== dependencies[i])) {
|
|
262411
|
+
const value = fn();
|
|
262412
|
+
pointer.set({ value, dependencies });
|
|
262413
|
+
return value;
|
|
262414
|
+
}
|
|
262415
|
+
return prev.value;
|
|
262416
|
+
});
|
|
262417
|
+
}
|
|
262404
262418
|
// ../../node_modules/.bun/@inquirer+core@10.3.0+c30ff3a63f0500d5/node_modules/@inquirer/core/dist/esm/lib/use-ref.js
|
|
262405
262419
|
function useRef(val) {
|
|
262406
262420
|
return useState({ current: val })[0];
|
|
262407
262421
|
}
|
|
262408
|
-
|
|
262409
262422
|
// ../../node_modules/.bun/@inquirer+core@10.3.0+c30ff3a63f0500d5/node_modules/@inquirer/core/dist/esm/lib/use-keypress.js
|
|
262410
262423
|
function useKeypress(userHandler) {
|
|
262411
262424
|
const signal = useRef(userHandler);
|
|
@@ -262437,6 +262450,72 @@ function readlineWidth() {
|
|
|
262437
262450
|
return import_cli_width.default({ defaultWidth: 80, output: readline().output });
|
|
262438
262451
|
}
|
|
262439
262452
|
|
|
262453
|
+
// ../../node_modules/.bun/@inquirer+core@10.3.0+c30ff3a63f0500d5/node_modules/@inquirer/core/dist/esm/lib/pagination/use-pagination.js
|
|
262454
|
+
function usePointerPosition({ active, renderedItems, pageSize, loop }) {
|
|
262455
|
+
const state = useRef({
|
|
262456
|
+
lastPointer: active,
|
|
262457
|
+
lastActive: undefined
|
|
262458
|
+
});
|
|
262459
|
+
const { lastPointer, lastActive } = state.current;
|
|
262460
|
+
const middle = Math.floor(pageSize / 2);
|
|
262461
|
+
const renderedLength = renderedItems.reduce((acc, item) => acc + item.length, 0);
|
|
262462
|
+
const defaultPointerPosition = renderedItems.slice(0, active).reduce((acc, item) => acc + item.length, 0);
|
|
262463
|
+
let pointer = defaultPointerPosition;
|
|
262464
|
+
if (renderedLength > pageSize) {
|
|
262465
|
+
if (loop) {
|
|
262466
|
+
pointer = lastPointer;
|
|
262467
|
+
if (lastActive != null && lastActive < active && active - lastActive < pageSize) {
|
|
262468
|
+
pointer = Math.min(middle, Math.abs(active - lastActive) === 1 ? Math.min(lastPointer + (renderedItems[lastActive]?.length ?? 0), Math.max(defaultPointerPosition, lastPointer)) : lastPointer + active - lastActive);
|
|
262469
|
+
}
|
|
262470
|
+
} else {
|
|
262471
|
+
const spaceUnderActive = renderedItems.slice(active).reduce((acc, item) => acc + item.length, 0);
|
|
262472
|
+
pointer = spaceUnderActive < pageSize - middle ? pageSize - spaceUnderActive : Math.min(defaultPointerPosition, middle);
|
|
262473
|
+
}
|
|
262474
|
+
}
|
|
262475
|
+
state.current.lastPointer = pointer;
|
|
262476
|
+
state.current.lastActive = active;
|
|
262477
|
+
return pointer;
|
|
262478
|
+
}
|
|
262479
|
+
function usePagination({ items, active, renderItem, pageSize, loop = true }) {
|
|
262480
|
+
const width = readlineWidth();
|
|
262481
|
+
const bound = (num) => (num % items.length + items.length) % items.length;
|
|
262482
|
+
const renderedItems = items.map((item, index) => {
|
|
262483
|
+
if (item == null)
|
|
262484
|
+
return [];
|
|
262485
|
+
return breakLines(renderItem({ item, index, isActive: index === active }), width).split(`
|
|
262486
|
+
`);
|
|
262487
|
+
});
|
|
262488
|
+
const renderedLength = renderedItems.reduce((acc, item) => acc + item.length, 0);
|
|
262489
|
+
const renderItemAtIndex = (index) => renderedItems[index] ?? [];
|
|
262490
|
+
const pointer = usePointerPosition({ active, renderedItems, pageSize, loop });
|
|
262491
|
+
const activeItem = renderItemAtIndex(active).slice(0, pageSize);
|
|
262492
|
+
const activeItemPosition = pointer + activeItem.length <= pageSize ? pointer : pageSize - activeItem.length;
|
|
262493
|
+
const pageBuffer = Array.from({ length: pageSize });
|
|
262494
|
+
pageBuffer.splice(activeItemPosition, activeItem.length, ...activeItem);
|
|
262495
|
+
const itemVisited = new Set([active]);
|
|
262496
|
+
let bufferPointer = activeItemPosition + activeItem.length;
|
|
262497
|
+
let itemPointer = bound(active + 1);
|
|
262498
|
+
while (bufferPointer < pageSize && !itemVisited.has(itemPointer) && (loop && renderedLength > pageSize ? itemPointer !== active : itemPointer > active)) {
|
|
262499
|
+
const lines = renderItemAtIndex(itemPointer);
|
|
262500
|
+
const linesToAdd = lines.slice(0, pageSize - bufferPointer);
|
|
262501
|
+
pageBuffer.splice(bufferPointer, linesToAdd.length, ...linesToAdd);
|
|
262502
|
+
itemVisited.add(itemPointer);
|
|
262503
|
+
bufferPointer += linesToAdd.length;
|
|
262504
|
+
itemPointer = bound(itemPointer + 1);
|
|
262505
|
+
}
|
|
262506
|
+
bufferPointer = activeItemPosition - 1;
|
|
262507
|
+
itemPointer = bound(active - 1);
|
|
262508
|
+
while (bufferPointer >= 0 && !itemVisited.has(itemPointer) && (loop && renderedLength > pageSize ? itemPointer !== active : itemPointer < active)) {
|
|
262509
|
+
const lines = renderItemAtIndex(itemPointer);
|
|
262510
|
+
const linesToAdd = lines.slice(Math.max(0, lines.length - bufferPointer - 1));
|
|
262511
|
+
pageBuffer.splice(bufferPointer - linesToAdd.length + 1, linesToAdd.length, ...linesToAdd);
|
|
262512
|
+
itemVisited.add(itemPointer);
|
|
262513
|
+
bufferPointer -= linesToAdd.length;
|
|
262514
|
+
itemPointer = bound(itemPointer - 1);
|
|
262515
|
+
}
|
|
262516
|
+
return pageBuffer.filter((line) => typeof line === "string").join(`
|
|
262517
|
+
`);
|
|
262518
|
+
}
|
|
262440
262519
|
// ../../node_modules/.bun/@inquirer+core@10.3.0+c30ff3a63f0500d5/node_modules/@inquirer/core/dist/esm/lib/create-prompt.js
|
|
262441
262520
|
var import_mute_stream = __toESM(require_lib(), 1);
|
|
262442
262521
|
import * as readline2 from "node:readline";
|
|
@@ -262833,6 +262912,20 @@ function createPrompt(view) {
|
|
|
262833
262912
|
};
|
|
262834
262913
|
return prompt;
|
|
262835
262914
|
}
|
|
262915
|
+
// ../../node_modules/.bun/@inquirer+core@10.3.0+c30ff3a63f0500d5/node_modules/@inquirer/core/dist/esm/lib/Separator.js
|
|
262916
|
+
var import_yoctocolors_cjs2 = __toESM(require_yoctocolors_cjs(), 1);
|
|
262917
|
+
class Separator {
|
|
262918
|
+
separator = import_yoctocolors_cjs2.default.dim(Array.from({ length: 15 }).join(esm_default.line));
|
|
262919
|
+
type = "separator";
|
|
262920
|
+
constructor(separator) {
|
|
262921
|
+
if (separator) {
|
|
262922
|
+
this.separator = separator;
|
|
262923
|
+
}
|
|
262924
|
+
}
|
|
262925
|
+
static isSeparator(choice) {
|
|
262926
|
+
return Boolean(choice && typeof choice === "object" && "type" in choice && choice.type === "separator");
|
|
262927
|
+
}
|
|
262928
|
+
}
|
|
262836
262929
|
// ../../node_modules/.bun/yoctocolors@2.1.2/node_modules/yoctocolors/base.js
|
|
262837
262930
|
var exports_base = {};
|
|
262838
262931
|
__export(exports_base, {
|
|
@@ -282090,7 +282183,7 @@ function pruneCurrentEnv(currentEnv, env2) {
|
|
|
282090
282183
|
var package_default = {
|
|
282091
282184
|
name: "@settlemint/sdk-cli",
|
|
282092
282185
|
description: "Command-line interface for SettleMint SDK, providing development tools and project management capabilities",
|
|
282093
|
-
version: "2.6.4-
|
|
282186
|
+
version: "2.6.4-prfe37148c",
|
|
282094
282187
|
type: "module",
|
|
282095
282188
|
private: false,
|
|
282096
282189
|
license: "FSL-1.1-MIT",
|
|
@@ -282140,14 +282233,14 @@ var package_default = {
|
|
|
282140
282233
|
devDependencies: {
|
|
282141
282234
|
"@commander-js/extra-typings": "14.0.0",
|
|
282142
282235
|
commander: "14.0.2",
|
|
282143
|
-
"@inquirer/confirm": "5.1.
|
|
282144
|
-
"@inquirer/input": "4.
|
|
282236
|
+
"@inquirer/confirm": "5.1.20",
|
|
282237
|
+
"@inquirer/input": "4.3.0",
|
|
282145
282238
|
"@inquirer/password": "4.0.21",
|
|
282146
|
-
"@inquirer/select": "4.4.
|
|
282147
|
-
"@settlemint/sdk-hasura": "2.6.4-
|
|
282148
|
-
"@settlemint/sdk-js": "2.6.4-
|
|
282149
|
-
"@settlemint/sdk-utils": "2.6.4-
|
|
282150
|
-
"@settlemint/sdk-viem": "2.6.4-
|
|
282239
|
+
"@inquirer/select": "4.4.0",
|
|
282240
|
+
"@settlemint/sdk-hasura": "2.6.4-prfe37148c",
|
|
282241
|
+
"@settlemint/sdk-js": "2.6.4-prfe37148c",
|
|
282242
|
+
"@settlemint/sdk-utils": "2.6.4-prfe37148c",
|
|
282243
|
+
"@settlemint/sdk-viem": "2.6.4-prfe37148c",
|
|
282151
282244
|
"@types/node": "24.10.0",
|
|
282152
282245
|
"@types/semver": "7.7.1",
|
|
282153
282246
|
"@types/which": "3.0.4",
|
|
@@ -282164,7 +282257,7 @@ var package_default = {
|
|
|
282164
282257
|
},
|
|
282165
282258
|
peerDependencies: {
|
|
282166
282259
|
hardhat: "<= 4",
|
|
282167
|
-
"@settlemint/sdk-js": "2.6.4-
|
|
282260
|
+
"@settlemint/sdk-js": "2.6.4-prfe37148c"
|
|
282168
282261
|
},
|
|
282169
282262
|
peerDependenciesMeta: {
|
|
282170
282263
|
hardhat: {
|
|
@@ -288061,101 +288154,9 @@ function sanitizeName(value5, length = 35) {
|
|
|
288061
288154
|
}).slice(0, length).replaceAll(/(^\d*)/g, "").replaceAll(/(-$)/g, "").replaceAll(/(^-)/g, "");
|
|
288062
288155
|
}
|
|
288063
288156
|
|
|
288064
|
-
// ../../node_modules/.bun/@inquirer+input@4.2.5+c30ff3a63f0500d5/node_modules/@inquirer/input/dist/esm/index.js
|
|
288065
|
-
var inputTheme = {
|
|
288066
|
-
validationFailureMode: "keep"
|
|
288067
|
-
};
|
|
288068
|
-
var esm_default2 = createPrompt((config3, done) => {
|
|
288069
|
-
const { required: required2, validate: validate3 = () => true, prefill = "tab" } = config3;
|
|
288070
|
-
const theme = makeTheme(inputTheme, config3.theme);
|
|
288071
|
-
const [status, setStatus] = useState("idle");
|
|
288072
|
-
const [defaultValue = "", setDefaultValue] = useState(config3.default);
|
|
288073
|
-
const [errorMsg, setError] = useState();
|
|
288074
|
-
const [value5, setValue] = useState("");
|
|
288075
|
-
const prefix = usePrefix({ status, theme });
|
|
288076
|
-
useKeypress(async (key, rl) => {
|
|
288077
|
-
if (status !== "idle") {
|
|
288078
|
-
return;
|
|
288079
|
-
}
|
|
288080
|
-
if (isEnterKey(key)) {
|
|
288081
|
-
const answer = value5 || defaultValue;
|
|
288082
|
-
setStatus("loading");
|
|
288083
|
-
const isValid = required2 && !answer ? "You must provide a value" : await validate3(answer);
|
|
288084
|
-
if (isValid === true) {
|
|
288085
|
-
setValue(answer);
|
|
288086
|
-
setStatus("done");
|
|
288087
|
-
done(answer);
|
|
288088
|
-
} else {
|
|
288089
|
-
if (theme.validationFailureMode === "clear") {
|
|
288090
|
-
setValue("");
|
|
288091
|
-
} else {
|
|
288092
|
-
rl.write(value5);
|
|
288093
|
-
}
|
|
288094
|
-
setError(isValid || "You must provide a valid value");
|
|
288095
|
-
setStatus("idle");
|
|
288096
|
-
}
|
|
288097
|
-
} else if (isBackspaceKey(key) && !value5) {
|
|
288098
|
-
setDefaultValue(undefined);
|
|
288099
|
-
} else if (isTabKey(key) && !value5) {
|
|
288100
|
-
setDefaultValue(undefined);
|
|
288101
|
-
rl.clearLine(0);
|
|
288102
|
-
rl.write(defaultValue);
|
|
288103
|
-
setValue(defaultValue);
|
|
288104
|
-
} else {
|
|
288105
|
-
setValue(rl.line);
|
|
288106
|
-
setError(undefined);
|
|
288107
|
-
}
|
|
288108
|
-
});
|
|
288109
|
-
useEffect((rl) => {
|
|
288110
|
-
if (prefill === "editable" && defaultValue) {
|
|
288111
|
-
rl.write(defaultValue);
|
|
288112
|
-
setValue(defaultValue);
|
|
288113
|
-
}
|
|
288114
|
-
}, []);
|
|
288115
|
-
const message = theme.style.message(config3.message, status);
|
|
288116
|
-
let formattedValue = value5;
|
|
288117
|
-
if (typeof config3.transformer === "function") {
|
|
288118
|
-
formattedValue = config3.transformer(value5, { isFinal: status === "done" });
|
|
288119
|
-
} else if (status === "done") {
|
|
288120
|
-
formattedValue = theme.style.answer(value5);
|
|
288121
|
-
}
|
|
288122
|
-
let defaultStr;
|
|
288123
|
-
if (defaultValue && status !== "done" && !value5) {
|
|
288124
|
-
defaultStr = theme.style.defaultAnswer(defaultValue);
|
|
288125
|
-
}
|
|
288126
|
-
let error51 = "";
|
|
288127
|
-
if (errorMsg) {
|
|
288128
|
-
error51 = theme.style.error(errorMsg);
|
|
288129
|
-
}
|
|
288130
|
-
return [
|
|
288131
|
-
[prefix, message, defaultStr, formattedValue].filter((v6) => v6 !== undefined).join(" "),
|
|
288132
|
-
error51
|
|
288133
|
-
];
|
|
288134
|
-
});
|
|
288135
|
-
|
|
288136
|
-
// src/prompts/smart-contract-set/subgraph-name.prompt.ts
|
|
288137
|
-
async function subgraphNamePrompt({
|
|
288138
|
-
defaultName,
|
|
288139
|
-
env: env2,
|
|
288140
|
-
accept
|
|
288141
|
-
}) {
|
|
288142
|
-
const defaultSubgraphName = defaultName ? sanitizeName(defaultName) : undefined;
|
|
288143
|
-
if (accept) {
|
|
288144
|
-
return defaultSubgraphName ?? env2.SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH;
|
|
288145
|
-
}
|
|
288146
|
-
const subgraphName = await esm_default2({
|
|
288147
|
-
message: "What is the name of your subgraph?",
|
|
288148
|
-
default: defaultSubgraphName,
|
|
288149
|
-
required: true
|
|
288150
|
-
});
|
|
288151
|
-
return sanitizeName(subgraphName);
|
|
288152
|
-
}
|
|
288153
|
-
|
|
288154
288157
|
// ../../node_modules/.bun/@inquirer+core@10.3.1+c30ff3a63f0500d5/node_modules/@inquirer/core/dist/esm/lib/key.js
|
|
288155
|
-
var isUpKey2 = (key, keybindings = []) => key.name === "up" || keybindings.includes("vim") && key.name === "k" || keybindings.includes("emacs") && key.ctrl && key.name === "p";
|
|
288156
|
-
var isDownKey2 = (key, keybindings = []) => key.name === "down" || keybindings.includes("vim") && key.name === "j" || keybindings.includes("emacs") && key.ctrl && key.name === "n";
|
|
288157
288158
|
var isBackspaceKey2 = (key) => key.name === "backspace";
|
|
288158
|
-
var
|
|
288159
|
+
var isTabKey2 = (key) => key.name === "tab";
|
|
288159
288160
|
var isEnterKey2 = (key) => key.name === "enter" || key.name === "return";
|
|
288160
288161
|
// ../../node_modules/.bun/@inquirer+core@10.3.1+c30ff3a63f0500d5/node_modules/@inquirer/core/dist/esm/lib/errors.js
|
|
288161
288162
|
class AbortPromptError2 extends Error {
|
|
@@ -288322,7 +288323,7 @@ function useEffect2(cb, depArray) {
|
|
|
288322
288323
|
}
|
|
288323
288324
|
|
|
288324
288325
|
// ../../node_modules/.bun/@inquirer+core@10.3.1+c30ff3a63f0500d5/node_modules/@inquirer/core/dist/esm/lib/theme.js
|
|
288325
|
-
var
|
|
288326
|
+
var import_yoctocolors_cjs3 = __toESM(require_yoctocolors_cjs(), 1);
|
|
288326
288327
|
|
|
288327
288328
|
// ../../node_modules/.bun/@inquirer+figures@1.0.15/node_modules/@inquirer/figures/dist/esm/index.js
|
|
288328
288329
|
import process8 from "node:process";
|
|
@@ -288610,27 +288611,27 @@ var fallbackSymbols2 = {
|
|
|
288610
288611
|
};
|
|
288611
288612
|
var shouldUseMain2 = isUnicodeSupported3();
|
|
288612
288613
|
var figures2 = shouldUseMain2 ? mainSymbols2 : fallbackSymbols2;
|
|
288613
|
-
var
|
|
288614
|
+
var esm_default2 = figures2;
|
|
288614
288615
|
var replacements2 = Object.entries(specialMainSymbols2);
|
|
288615
288616
|
|
|
288616
288617
|
// ../../node_modules/.bun/@inquirer+core@10.3.1+c30ff3a63f0500d5/node_modules/@inquirer/core/dist/esm/lib/theme.js
|
|
288617
288618
|
var defaultTheme2 = {
|
|
288618
288619
|
prefix: {
|
|
288619
|
-
idle:
|
|
288620
|
-
done:
|
|
288620
|
+
idle: import_yoctocolors_cjs3.default.blue("?"),
|
|
288621
|
+
done: import_yoctocolors_cjs3.default.green(esm_default2.tick)
|
|
288621
288622
|
},
|
|
288622
288623
|
spinner: {
|
|
288623
288624
|
interval: 80,
|
|
288624
|
-
frames: ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"].map((frame) =>
|
|
288625
|
+
frames: ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"].map((frame) => import_yoctocolors_cjs3.default.yellow(frame))
|
|
288625
288626
|
},
|
|
288626
288627
|
style: {
|
|
288627
|
-
answer:
|
|
288628
|
-
message:
|
|
288629
|
-
error: (text2) =>
|
|
288630
|
-
defaultAnswer: (text2) =>
|
|
288631
|
-
help:
|
|
288632
|
-
highlight:
|
|
288633
|
-
key: (text2) =>
|
|
288628
|
+
answer: import_yoctocolors_cjs3.default.cyan,
|
|
288629
|
+
message: import_yoctocolors_cjs3.default.bold,
|
|
288630
|
+
error: (text2) => import_yoctocolors_cjs3.default.red(`> ${text2}`),
|
|
288631
|
+
defaultAnswer: (text2) => import_yoctocolors_cjs3.default.dim(`(${text2})`),
|
|
288632
|
+
help: import_yoctocolors_cjs3.default.dim,
|
|
288633
|
+
highlight: import_yoctocolors_cjs3.default.cyan,
|
|
288634
|
+
key: (text2) => import_yoctocolors_cjs3.default.cyan(import_yoctocolors_cjs3.default.bold(`<${text2}>`))
|
|
288634
288635
|
}
|
|
288635
288636
|
};
|
|
288636
288637
|
|
|
@@ -288692,22 +288693,11 @@ function usePrefix2({ status = "idle", theme }) {
|
|
|
288692
288693
|
const iconName = status === "loading" ? "idle" : status;
|
|
288693
288694
|
return typeof prefix === "string" ? prefix : prefix[iconName] ?? prefix["idle"];
|
|
288694
288695
|
}
|
|
288695
|
-
// ../../node_modules/.bun/@inquirer+core@10.3.1+c30ff3a63f0500d5/node_modules/@inquirer/core/dist/esm/lib/use-memo.js
|
|
288696
|
-
function useMemo(fn, dependencies) {
|
|
288697
|
-
return withPointer2((pointer) => {
|
|
288698
|
-
const prev = pointer.get();
|
|
288699
|
-
if (!prev || prev.dependencies.length !== dependencies.length || prev.dependencies.some((dep, i7) => dep !== dependencies[i7])) {
|
|
288700
|
-
const value5 = fn();
|
|
288701
|
-
pointer.set({ value: value5, dependencies });
|
|
288702
|
-
return value5;
|
|
288703
|
-
}
|
|
288704
|
-
return prev.value;
|
|
288705
|
-
});
|
|
288706
|
-
}
|
|
288707
288696
|
// ../../node_modules/.bun/@inquirer+core@10.3.1+c30ff3a63f0500d5/node_modules/@inquirer/core/dist/esm/lib/use-ref.js
|
|
288708
288697
|
function useRef2(val) {
|
|
288709
288698
|
return useState2({ current: val })[0];
|
|
288710
288699
|
}
|
|
288700
|
+
|
|
288711
288701
|
// ../../node_modules/.bun/@inquirer+core@10.3.1+c30ff3a63f0500d5/node_modules/@inquirer/core/dist/esm/lib/use-keypress.js
|
|
288712
288702
|
function useKeypress2(userHandler) {
|
|
288713
288703
|
const signal = useRef2(userHandler);
|
|
@@ -288739,72 +288729,6 @@ function readlineWidth2() {
|
|
|
288739
288729
|
return import_cli_width2.default({ defaultWidth: 80, output: readline3().output });
|
|
288740
288730
|
}
|
|
288741
288731
|
|
|
288742
|
-
// ../../node_modules/.bun/@inquirer+core@10.3.1+c30ff3a63f0500d5/node_modules/@inquirer/core/dist/esm/lib/pagination/use-pagination.js
|
|
288743
|
-
function usePointerPosition({ active, renderedItems, pageSize, loop }) {
|
|
288744
|
-
const state = useRef2({
|
|
288745
|
-
lastPointer: active,
|
|
288746
|
-
lastActive: undefined
|
|
288747
|
-
});
|
|
288748
|
-
const { lastPointer, lastActive } = state.current;
|
|
288749
|
-
const middle = Math.floor(pageSize / 2);
|
|
288750
|
-
const renderedLength = renderedItems.reduce((acc, item) => acc + item.length, 0);
|
|
288751
|
-
const defaultPointerPosition = renderedItems.slice(0, active).reduce((acc, item) => acc + item.length, 0);
|
|
288752
|
-
let pointer = defaultPointerPosition;
|
|
288753
|
-
if (renderedLength > pageSize) {
|
|
288754
|
-
if (loop) {
|
|
288755
|
-
pointer = lastPointer;
|
|
288756
|
-
if (lastActive != null && lastActive < active && active - lastActive < pageSize) {
|
|
288757
|
-
pointer = Math.min(middle, Math.abs(active - lastActive) === 1 ? Math.min(lastPointer + (renderedItems[lastActive]?.length ?? 0), Math.max(defaultPointerPosition, lastPointer)) : lastPointer + active - lastActive);
|
|
288758
|
-
}
|
|
288759
|
-
} else {
|
|
288760
|
-
const spaceUnderActive = renderedItems.slice(active).reduce((acc, item) => acc + item.length, 0);
|
|
288761
|
-
pointer = spaceUnderActive < pageSize - middle ? pageSize - spaceUnderActive : Math.min(defaultPointerPosition, middle);
|
|
288762
|
-
}
|
|
288763
|
-
}
|
|
288764
|
-
state.current.lastPointer = pointer;
|
|
288765
|
-
state.current.lastActive = active;
|
|
288766
|
-
return pointer;
|
|
288767
|
-
}
|
|
288768
|
-
function usePagination({ items, active, renderItem, pageSize, loop = true }) {
|
|
288769
|
-
const width = readlineWidth2();
|
|
288770
|
-
const bound = (num) => (num % items.length + items.length) % items.length;
|
|
288771
|
-
const renderedItems = items.map((item, index) => {
|
|
288772
|
-
if (item == null)
|
|
288773
|
-
return [];
|
|
288774
|
-
return breakLines2(renderItem({ item, index, isActive: index === active }), width).split(`
|
|
288775
|
-
`);
|
|
288776
|
-
});
|
|
288777
|
-
const renderedLength = renderedItems.reduce((acc, item) => acc + item.length, 0);
|
|
288778
|
-
const renderItemAtIndex = (index) => renderedItems[index] ?? [];
|
|
288779
|
-
const pointer = usePointerPosition({ active, renderedItems, pageSize, loop });
|
|
288780
|
-
const activeItem = renderItemAtIndex(active).slice(0, pageSize);
|
|
288781
|
-
const activeItemPosition = pointer + activeItem.length <= pageSize ? pointer : pageSize - activeItem.length;
|
|
288782
|
-
const pageBuffer = Array.from({ length: pageSize });
|
|
288783
|
-
pageBuffer.splice(activeItemPosition, activeItem.length, ...activeItem);
|
|
288784
|
-
const itemVisited = new Set([active]);
|
|
288785
|
-
let bufferPointer = activeItemPosition + activeItem.length;
|
|
288786
|
-
let itemPointer = bound(active + 1);
|
|
288787
|
-
while (bufferPointer < pageSize && !itemVisited.has(itemPointer) && (loop && renderedLength > pageSize ? itemPointer !== active : itemPointer > active)) {
|
|
288788
|
-
const lines = renderItemAtIndex(itemPointer);
|
|
288789
|
-
const linesToAdd = lines.slice(0, pageSize - bufferPointer);
|
|
288790
|
-
pageBuffer.splice(bufferPointer, linesToAdd.length, ...linesToAdd);
|
|
288791
|
-
itemVisited.add(itemPointer);
|
|
288792
|
-
bufferPointer += linesToAdd.length;
|
|
288793
|
-
itemPointer = bound(itemPointer + 1);
|
|
288794
|
-
}
|
|
288795
|
-
bufferPointer = activeItemPosition - 1;
|
|
288796
|
-
itemPointer = bound(active - 1);
|
|
288797
|
-
while (bufferPointer >= 0 && !itemVisited.has(itemPointer) && (loop && renderedLength > pageSize ? itemPointer !== active : itemPointer < active)) {
|
|
288798
|
-
const lines = renderItemAtIndex(itemPointer);
|
|
288799
|
-
const linesToAdd = lines.slice(Math.max(0, lines.length - bufferPointer - 1));
|
|
288800
|
-
pageBuffer.splice(bufferPointer - linesToAdd.length + 1, linesToAdd.length, ...linesToAdd);
|
|
288801
|
-
itemVisited.add(itemPointer);
|
|
288802
|
-
bufferPointer -= linesToAdd.length;
|
|
288803
|
-
itemPointer = bound(itemPointer - 1);
|
|
288804
|
-
}
|
|
288805
|
-
return pageBuffer.filter((line) => typeof line === "string").join(`
|
|
288806
|
-
`);
|
|
288807
|
-
}
|
|
288808
288732
|
// ../../node_modules/.bun/@inquirer+core@10.3.1+c30ff3a63f0500d5/node_modules/@inquirer/core/dist/esm/lib/create-prompt.js
|
|
288809
288733
|
var import_mute_stream2 = __toESM(require_lib13(), 1);
|
|
288810
288734
|
import * as readline4 from "node:readline";
|
|
@@ -288993,24 +288917,113 @@ function createPrompt2(view) {
|
|
|
288993
288917
|
};
|
|
288994
288918
|
return prompt;
|
|
288995
288919
|
}
|
|
288996
|
-
// ../../node_modules/.bun/@inquirer+
|
|
288997
|
-
var
|
|
288998
|
-
|
|
288999
|
-
|
|
289000
|
-
|
|
289001
|
-
|
|
289002
|
-
|
|
289003
|
-
|
|
288920
|
+
// ../../node_modules/.bun/@inquirer+input@4.3.0+c30ff3a63f0500d5/node_modules/@inquirer/input/dist/esm/index.js
|
|
288921
|
+
var inputTheme = {
|
|
288922
|
+
validationFailureMode: "keep"
|
|
288923
|
+
};
|
|
288924
|
+
var esm_default3 = createPrompt2((config3, done) => {
|
|
288925
|
+
const { prefill = "tab" } = config3;
|
|
288926
|
+
const theme = makeTheme2(inputTheme, config3.theme);
|
|
288927
|
+
const [status, setStatus] = useState2("idle");
|
|
288928
|
+
const [defaultValue = "", setDefaultValue] = useState2(config3.default);
|
|
288929
|
+
const [errorMsg, setError] = useState2();
|
|
288930
|
+
const [value5, setValue] = useState2("");
|
|
288931
|
+
const prefix = usePrefix2({ status, theme });
|
|
288932
|
+
async function validate3(value6) {
|
|
288933
|
+
const { required: required2, pattern, patternError = "Invalid input" } = config3;
|
|
288934
|
+
if (required2 && !value6) {
|
|
288935
|
+
return "You must provide a value";
|
|
288936
|
+
}
|
|
288937
|
+
if (pattern && !pattern.test(value6)) {
|
|
288938
|
+
return patternError;
|
|
289004
288939
|
}
|
|
288940
|
+
if (typeof config3.validate === "function") {
|
|
288941
|
+
return await config3.validate(value6) || "You must provide a valid value";
|
|
288942
|
+
}
|
|
288943
|
+
return true;
|
|
289005
288944
|
}
|
|
289006
|
-
|
|
289007
|
-
|
|
288945
|
+
useKeypress2(async (key, rl) => {
|
|
288946
|
+
if (status !== "idle") {
|
|
288947
|
+
return;
|
|
288948
|
+
}
|
|
288949
|
+
if (isEnterKey2(key)) {
|
|
288950
|
+
const answer = value5 || defaultValue;
|
|
288951
|
+
setStatus("loading");
|
|
288952
|
+
const isValid = await validate3(answer);
|
|
288953
|
+
if (isValid === true) {
|
|
288954
|
+
setValue(answer);
|
|
288955
|
+
setStatus("done");
|
|
288956
|
+
done(answer);
|
|
288957
|
+
} else {
|
|
288958
|
+
if (theme.validationFailureMode === "clear") {
|
|
288959
|
+
setValue("");
|
|
288960
|
+
} else {
|
|
288961
|
+
rl.write(value5);
|
|
288962
|
+
}
|
|
288963
|
+
setError(isValid);
|
|
288964
|
+
setStatus("idle");
|
|
288965
|
+
}
|
|
288966
|
+
} else if (isBackspaceKey2(key) && !value5) {
|
|
288967
|
+
setDefaultValue(undefined);
|
|
288968
|
+
} else if (isTabKey2(key) && !value5) {
|
|
288969
|
+
setDefaultValue(undefined);
|
|
288970
|
+
rl.clearLine(0);
|
|
288971
|
+
rl.write(defaultValue);
|
|
288972
|
+
setValue(defaultValue);
|
|
288973
|
+
} else {
|
|
288974
|
+
setValue(rl.line);
|
|
288975
|
+
setError(undefined);
|
|
288976
|
+
}
|
|
288977
|
+
});
|
|
288978
|
+
useEffect2((rl) => {
|
|
288979
|
+
if (prefill === "editable" && defaultValue) {
|
|
288980
|
+
rl.write(defaultValue);
|
|
288981
|
+
setValue(defaultValue);
|
|
288982
|
+
}
|
|
288983
|
+
}, []);
|
|
288984
|
+
const message = theme.style.message(config3.message, status);
|
|
288985
|
+
let formattedValue = value5;
|
|
288986
|
+
if (typeof config3.transformer === "function") {
|
|
288987
|
+
formattedValue = config3.transformer(value5, { isFinal: status === "done" });
|
|
288988
|
+
} else if (status === "done") {
|
|
288989
|
+
formattedValue = theme.style.answer(value5);
|
|
288990
|
+
}
|
|
288991
|
+
let defaultStr;
|
|
288992
|
+
if (defaultValue && status !== "done" && !value5) {
|
|
288993
|
+
defaultStr = theme.style.defaultAnswer(defaultValue);
|
|
289008
288994
|
}
|
|
288995
|
+
let error51 = "";
|
|
288996
|
+
if (errorMsg) {
|
|
288997
|
+
error51 = theme.style.error(errorMsg);
|
|
288998
|
+
}
|
|
288999
|
+
return [
|
|
289000
|
+
[prefix, message, defaultStr, formattedValue].filter((v6) => v6 !== undefined).join(" "),
|
|
289001
|
+
error51
|
|
289002
|
+
];
|
|
289003
|
+
});
|
|
289004
|
+
|
|
289005
|
+
// src/prompts/smart-contract-set/subgraph-name.prompt.ts
|
|
289006
|
+
async function subgraphNamePrompt({
|
|
289007
|
+
defaultName,
|
|
289008
|
+
env: env2,
|
|
289009
|
+
accept
|
|
289010
|
+
}) {
|
|
289011
|
+
const defaultSubgraphName = defaultName ? sanitizeName(defaultName) : undefined;
|
|
289012
|
+
if (accept) {
|
|
289013
|
+
return defaultSubgraphName ?? env2.SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH;
|
|
289014
|
+
}
|
|
289015
|
+
const subgraphName = await esm_default3({
|
|
289016
|
+
message: "What is the name of your subgraph?",
|
|
289017
|
+
default: defaultSubgraphName,
|
|
289018
|
+
required: true
|
|
289019
|
+
});
|
|
289020
|
+
return sanitizeName(subgraphName);
|
|
289009
289021
|
}
|
|
289010
|
-
|
|
289022
|
+
|
|
289023
|
+
// ../../node_modules/.bun/@inquirer+select@4.4.0+c30ff3a63f0500d5/node_modules/@inquirer/select/dist/esm/index.js
|
|
289011
289024
|
var import_yoctocolors_cjs4 = __toESM(require_yoctocolors_cjs(), 1);
|
|
289012
289025
|
var selectTheme = {
|
|
289013
|
-
icon: { cursor:
|
|
289026
|
+
icon: { cursor: esm_default.pointer },
|
|
289014
289027
|
style: {
|
|
289015
289028
|
disabled: (text2) => import_yoctocolors_cjs4.default.dim(`- ${text2}`),
|
|
289016
289029
|
description: (text2) => import_yoctocolors_cjs4.default.cyan(text2),
|
|
@@ -289048,20 +289061,20 @@ function normalizeChoices(choices) {
|
|
|
289048
289061
|
return normalizedChoice;
|
|
289049
289062
|
});
|
|
289050
289063
|
}
|
|
289051
|
-
var esm_default4 =
|
|
289064
|
+
var esm_default4 = createPrompt((config3, done) => {
|
|
289052
289065
|
const { loop = true, pageSize = 7 } = config3;
|
|
289053
|
-
const theme =
|
|
289066
|
+
const theme = makeTheme(selectTheme, config3.theme);
|
|
289054
289067
|
const { keybindings } = theme;
|
|
289055
|
-
const [status, setStatus] =
|
|
289056
|
-
const prefix =
|
|
289057
|
-
const searchTimeoutRef =
|
|
289068
|
+
const [status, setStatus] = useState("idle");
|
|
289069
|
+
const prefix = usePrefix({ status, theme });
|
|
289070
|
+
const searchTimeoutRef = useRef();
|
|
289058
289071
|
const searchEnabled = !keybindings.includes("vim");
|
|
289059
289072
|
const items = useMemo(() => normalizeChoices(config3.choices), [config3.choices]);
|
|
289060
289073
|
const bounds = useMemo(() => {
|
|
289061
289074
|
const first = items.findIndex(isSelectable);
|
|
289062
289075
|
const last = items.findLastIndex(isSelectable);
|
|
289063
289076
|
if (first === -1) {
|
|
289064
|
-
throw new
|
|
289077
|
+
throw new ValidationError("[select prompt] No selectable choices. All choices are disabled.");
|
|
289065
289078
|
}
|
|
289066
289079
|
return { first, last };
|
|
289067
289080
|
}, [items]);
|
|
@@ -289070,24 +289083,24 @@ var esm_default4 = createPrompt2((config3, done) => {
|
|
|
289070
289083
|
return -1;
|
|
289071
289084
|
return items.findIndex((item) => isSelectable(item) && item.value === config3.default);
|
|
289072
289085
|
}, [config3.default, items]);
|
|
289073
|
-
const [active, setActive] =
|
|
289086
|
+
const [active, setActive] = useState(defaultItemIndex === -1 ? bounds.first : defaultItemIndex);
|
|
289074
289087
|
const selectedChoice = items[active];
|
|
289075
|
-
|
|
289088
|
+
useKeypress((key, rl) => {
|
|
289076
289089
|
clearTimeout(searchTimeoutRef.current);
|
|
289077
|
-
if (
|
|
289090
|
+
if (isEnterKey(key)) {
|
|
289078
289091
|
setStatus("done");
|
|
289079
289092
|
done(selectedChoice.value);
|
|
289080
|
-
} else if (
|
|
289093
|
+
} else if (isUpKey(key, keybindings) || isDownKey(key, keybindings)) {
|
|
289081
289094
|
rl.clearLine(0);
|
|
289082
|
-
if (loop ||
|
|
289083
|
-
const offset =
|
|
289095
|
+
if (loop || isUpKey(key, keybindings) && active !== bounds.first || isDownKey(key, keybindings) && active !== bounds.last) {
|
|
289096
|
+
const offset = isUpKey(key, keybindings) ? -1 : 1;
|
|
289084
289097
|
let next = active;
|
|
289085
289098
|
do {
|
|
289086
289099
|
next = (next + offset + items.length) % items.length;
|
|
289087
289100
|
} while (!isSelectable(items[next]));
|
|
289088
289101
|
setActive(next);
|
|
289089
289102
|
}
|
|
289090
|
-
} else if (
|
|
289103
|
+
} else if (isNumberKey(key) && !Number.isNaN(Number(rl.line))) {
|
|
289091
289104
|
const selectedIndex = Number(rl.line) - 1;
|
|
289092
289105
|
let selectableIndex = -1;
|
|
289093
289106
|
const position = items.findIndex((item2) => {
|
|
@@ -289103,7 +289116,7 @@ var esm_default4 = createPrompt2((config3, done) => {
|
|
|
289103
289116
|
searchTimeoutRef.current = setTimeout(() => {
|
|
289104
289117
|
rl.clearLine(0);
|
|
289105
289118
|
}, 700);
|
|
289106
|
-
} else if (
|
|
289119
|
+
} else if (isBackspaceKey(key)) {
|
|
289107
289120
|
rl.clearLine(0);
|
|
289108
289121
|
} else if (searchEnabled) {
|
|
289109
289122
|
const searchTerm = rl.line.toLowerCase();
|
|
@@ -289120,7 +289133,7 @@ var esm_default4 = createPrompt2((config3, done) => {
|
|
|
289120
289133
|
}, 700);
|
|
289121
289134
|
}
|
|
289122
289135
|
});
|
|
289123
|
-
|
|
289136
|
+
useEffect(() => () => {
|
|
289124
289137
|
clearTimeout(searchTimeoutRef.current);
|
|
289125
289138
|
}, []);
|
|
289126
289139
|
const message = theme.style.message(config3.message, status);
|
|
@@ -289169,7 +289182,7 @@ var esm_default4 = createPrompt2((config3, done) => {
|
|
|
289169
289182
|
helpLine
|
|
289170
289183
|
].filter(Boolean).join(`
|
|
289171
289184
|
`).trimEnd();
|
|
289172
|
-
return `${lines}${
|
|
289185
|
+
return `${lines}${cursorHide}`;
|
|
289173
289186
|
});
|
|
289174
289187
|
|
|
289175
289188
|
// src/prompts/smart-contract-set/subgraph.prompt.ts
|
|
@@ -314686,7 +314699,7 @@ function extractInfoFromBody(body) {
|
|
|
314686
314699
|
}
|
|
314687
314700
|
}
|
|
314688
314701
|
|
|
314689
|
-
// ../../node_modules/.bun/@inquirer+confirm@5.1.
|
|
314702
|
+
// ../../node_modules/.bun/@inquirer+confirm@5.1.20+c30ff3a63f0500d5/node_modules/@inquirer/confirm/dist/esm/index.js
|
|
314690
314703
|
function getBooleanValue(value5, defaultValue) {
|
|
314691
314704
|
let answer = defaultValue !== false;
|
|
314692
314705
|
if (/^(y|yes)/i.test(value5))
|
|
@@ -314698,21 +314711,21 @@ function getBooleanValue(value5, defaultValue) {
|
|
|
314698
314711
|
function boolToString(value5) {
|
|
314699
314712
|
return value5 ? "Yes" : "No";
|
|
314700
314713
|
}
|
|
314701
|
-
var esm_default5 =
|
|
314714
|
+
var esm_default5 = createPrompt2((config3, done) => {
|
|
314702
314715
|
const { transformer = boolToString } = config3;
|
|
314703
|
-
const [status, setStatus] =
|
|
314704
|
-
const [value5, setValue] =
|
|
314705
|
-
const theme =
|
|
314706
|
-
const prefix =
|
|
314707
|
-
|
|
314716
|
+
const [status, setStatus] = useState2("idle");
|
|
314717
|
+
const [value5, setValue] = useState2("");
|
|
314718
|
+
const theme = makeTheme2(config3.theme);
|
|
314719
|
+
const prefix = usePrefix2({ status, theme });
|
|
314720
|
+
useKeypress2((key, rl) => {
|
|
314708
314721
|
if (status !== "idle")
|
|
314709
314722
|
return;
|
|
314710
|
-
if (
|
|
314723
|
+
if (isEnterKey2(key)) {
|
|
314711
314724
|
const answer = getBooleanValue(value5, config3.default);
|
|
314712
314725
|
setValue(transformer(answer));
|
|
314713
314726
|
setStatus("done");
|
|
314714
314727
|
done(answer);
|
|
314715
|
-
} else if (
|
|
314728
|
+
} else if (isTabKey2(key)) {
|
|
314716
314729
|
const answer = boolToString(!getBooleanValue(value5, config3.default));
|
|
314717
314730
|
rl.clearLine(0);
|
|
314718
314731
|
rl.write(answer);
|
|
@@ -314804,7 +314817,7 @@ async function applicationAccessTokenPrompt(env2, application, settlemint, accep
|
|
|
314804
314817
|
default: false
|
|
314805
314818
|
});
|
|
314806
314819
|
if (create3) {
|
|
314807
|
-
const name4 = await
|
|
314820
|
+
const name4 = await esm_default3({
|
|
314808
314821
|
message: "How would you like to name this application access token?",
|
|
314809
314822
|
default: `SettleMint CLI (${Date.now()}${process.env.USER ? ` ${process.env.USER}` : ""})`,
|
|
314810
314823
|
required: true,
|
|
@@ -315270,7 +315283,7 @@ async function instancePrompt({
|
|
|
315270
315283
|
return sanitizeInstanceUrl(defaultPromptInstance);
|
|
315271
315284
|
}
|
|
315272
315285
|
if (freeTextInput) {
|
|
315273
|
-
const instance = await
|
|
315286
|
+
const instance = await esm_default3({
|
|
315274
315287
|
message: "What is the URL of your SettleMint instance?",
|
|
315275
315288
|
default: defaultPromptInstance,
|
|
315276
315289
|
required: true,
|
|
@@ -315354,7 +315367,7 @@ async function serviceUrlPrompt({
|
|
|
315354
315367
|
if (isCi) {
|
|
315355
315368
|
return defaultUrl ? new URL(defaultUrl).toString() : undefined;
|
|
315356
315369
|
}
|
|
315357
|
-
const serviceUrl = await
|
|
315370
|
+
const serviceUrl = await esm_default3({
|
|
315358
315371
|
message: example ? `${message} (eg ${example})` : message,
|
|
315359
315372
|
default: defaultUrl,
|
|
315360
315373
|
required: true,
|
|
@@ -315789,7 +315802,7 @@ async function serviceValuePrompt({
|
|
|
315789
315802
|
if (isCi) {
|
|
315790
315803
|
return defaultValue;
|
|
315791
315804
|
}
|
|
315792
|
-
const serviceSecret = await
|
|
315805
|
+
const serviceSecret = await esm_default3({
|
|
315793
315806
|
message: example ? `${message} (eg ${example})` : message,
|
|
315794
315807
|
default: defaultValue
|
|
315795
315808
|
});
|
|
@@ -316245,7 +316258,7 @@ async function projectNamePrompt(env2, argument) {
|
|
|
316245
316258
|
if (defaultInstance) {
|
|
316246
316259
|
return defaultInstance;
|
|
316247
316260
|
}
|
|
316248
|
-
return
|
|
316261
|
+
return esm_default3({
|
|
316249
316262
|
message: "What is the name of your new SettleMint project?",
|
|
316250
316263
|
default: defaultInstance,
|
|
316251
316264
|
required: true,
|
|
@@ -321603,7 +321616,7 @@ function createCommand3() {
|
|
|
321603
321616
|
|
|
321604
321617
|
// src/prompts/delete-confirmation.prompt.ts
|
|
321605
321618
|
async function deleteConfirmationPrompt(itemDescription) {
|
|
321606
|
-
const confirmation = await
|
|
321619
|
+
const confirmation = await esm_default3({
|
|
321607
321620
|
message: `Are you sure you want to delete ${itemDescription}? (yes/no)`,
|
|
321608
321621
|
required: true,
|
|
321609
321622
|
validate(value5) {
|
|
@@ -323371,7 +323384,7 @@ async function addressPrompt({
|
|
|
323371
323384
|
hardhatConfig
|
|
323372
323385
|
}) {
|
|
323373
323386
|
if (!node) {
|
|
323374
|
-
return
|
|
323387
|
+
return esm_default3({
|
|
323375
323388
|
message: "Which private key address do you want to deploy from?",
|
|
323376
323389
|
validate: (value5) => {
|
|
323377
323390
|
if (!isAddress(value5)) {
|
|
@@ -324342,4 +324355,4 @@ async function sdkCliCommand(argv = process.argv) {
|
|
|
324342
324355
|
// src/cli.ts
|
|
324343
324356
|
sdkCliCommand();
|
|
324344
324357
|
|
|
324345
|
-
//# debugId=
|
|
324358
|
+
//# debugId=8AAD9B0EBF521D2F64756E2164756E21
|