@settlemint/sdk-cli 2.6.4-pr5d528293 → 2.6.4-pr729a5586
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 +247 -260
- 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 colors2 = 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(colors2.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 ? colors2.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 colors2 = 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(colors2.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(" " + colors2.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 colors2 = 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 = colors2.blueBackground("".padStart(tsIconLength));
|
|
162111
|
+
const tsIconSecondLine = colors2.blueBackground(colors2.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,11 +261866,8 @@ 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";
|
|
261871
261869
|
var isBackspaceKey = (key) => key.name === "backspace";
|
|
261872
261870
|
var isTabKey = (key) => key.name === "tab";
|
|
261873
|
-
var isNumberKey = (key) => "1234567890".includes(key.name);
|
|
261874
261871
|
var isEnterKey = (key) => key.name === "enter" || key.name === "return";
|
|
261875
261872
|
// ../../node_modules/.bun/@inquirer+core@10.3.0+c30ff3a63f0500d5/node_modules/@inquirer/core/dist/esm/lib/errors.js
|
|
261876
261873
|
class AbortPromptError extends Error {
|
|
@@ -262404,22 +262401,11 @@ function usePrefix({ status = "idle", theme }) {
|
|
|
262404
262401
|
const iconName = status === "loading" ? "idle" : status;
|
|
262405
262402
|
return typeof prefix === "string" ? prefix : prefix[iconName] ?? prefix["idle"];
|
|
262406
262403
|
}
|
|
262407
|
-
// ../../node_modules/.bun/@inquirer+core@10.3.0+c30ff3a63f0500d5/node_modules/@inquirer/core/dist/esm/lib/use-memo.js
|
|
262408
|
-
function useMemo(fn, dependencies) {
|
|
262409
|
-
return withPointer((pointer) => {
|
|
262410
|
-
const prev = pointer.get();
|
|
262411
|
-
if (!prev || prev.dependencies.length !== dependencies.length || prev.dependencies.some((dep, i) => dep !== dependencies[i])) {
|
|
262412
|
-
const value = fn();
|
|
262413
|
-
pointer.set({ value, dependencies });
|
|
262414
|
-
return value;
|
|
262415
|
-
}
|
|
262416
|
-
return prev.value;
|
|
262417
|
-
});
|
|
262418
|
-
}
|
|
262419
262404
|
// ../../node_modules/.bun/@inquirer+core@10.3.0+c30ff3a63f0500d5/node_modules/@inquirer/core/dist/esm/lib/use-ref.js
|
|
262420
262405
|
function useRef(val) {
|
|
262421
262406
|
return useState({ current: val })[0];
|
|
262422
262407
|
}
|
|
262408
|
+
|
|
262423
262409
|
// ../../node_modules/.bun/@inquirer+core@10.3.0+c30ff3a63f0500d5/node_modules/@inquirer/core/dist/esm/lib/use-keypress.js
|
|
262424
262410
|
function useKeypress(userHandler) {
|
|
262425
262411
|
const signal = useRef(userHandler);
|
|
@@ -262451,72 +262437,6 @@ function readlineWidth() {
|
|
|
262451
262437
|
return import_cli_width.default({ defaultWidth: 80, output: readline().output });
|
|
262452
262438
|
}
|
|
262453
262439
|
|
|
262454
|
-
// ../../node_modules/.bun/@inquirer+core@10.3.0+c30ff3a63f0500d5/node_modules/@inquirer/core/dist/esm/lib/pagination/use-pagination.js
|
|
262455
|
-
function usePointerPosition({ active, renderedItems, pageSize, loop }) {
|
|
262456
|
-
const state = useRef({
|
|
262457
|
-
lastPointer: active,
|
|
262458
|
-
lastActive: undefined
|
|
262459
|
-
});
|
|
262460
|
-
const { lastPointer, lastActive } = state.current;
|
|
262461
|
-
const middle = Math.floor(pageSize / 2);
|
|
262462
|
-
const renderedLength = renderedItems.reduce((acc, item) => acc + item.length, 0);
|
|
262463
|
-
const defaultPointerPosition = renderedItems.slice(0, active).reduce((acc, item) => acc + item.length, 0);
|
|
262464
|
-
let pointer = defaultPointerPosition;
|
|
262465
|
-
if (renderedLength > pageSize) {
|
|
262466
|
-
if (loop) {
|
|
262467
|
-
pointer = lastPointer;
|
|
262468
|
-
if (lastActive != null && lastActive < active && active - lastActive < pageSize) {
|
|
262469
|
-
pointer = Math.min(middle, Math.abs(active - lastActive) === 1 ? Math.min(lastPointer + (renderedItems[lastActive]?.length ?? 0), Math.max(defaultPointerPosition, lastPointer)) : lastPointer + active - lastActive);
|
|
262470
|
-
}
|
|
262471
|
-
} else {
|
|
262472
|
-
const spaceUnderActive = renderedItems.slice(active).reduce((acc, item) => acc + item.length, 0);
|
|
262473
|
-
pointer = spaceUnderActive < pageSize - middle ? pageSize - spaceUnderActive : Math.min(defaultPointerPosition, middle);
|
|
262474
|
-
}
|
|
262475
|
-
}
|
|
262476
|
-
state.current.lastPointer = pointer;
|
|
262477
|
-
state.current.lastActive = active;
|
|
262478
|
-
return pointer;
|
|
262479
|
-
}
|
|
262480
|
-
function usePagination({ items, active, renderItem, pageSize, loop = true }) {
|
|
262481
|
-
const width = readlineWidth();
|
|
262482
|
-
const bound = (num) => (num % items.length + items.length) % items.length;
|
|
262483
|
-
const renderedItems = items.map((item, index) => {
|
|
262484
|
-
if (item == null)
|
|
262485
|
-
return [];
|
|
262486
|
-
return breakLines(renderItem({ item, index, isActive: index === active }), width).split(`
|
|
262487
|
-
`);
|
|
262488
|
-
});
|
|
262489
|
-
const renderedLength = renderedItems.reduce((acc, item) => acc + item.length, 0);
|
|
262490
|
-
const renderItemAtIndex = (index) => renderedItems[index] ?? [];
|
|
262491
|
-
const pointer = usePointerPosition({ active, renderedItems, pageSize, loop });
|
|
262492
|
-
const activeItem = renderItemAtIndex(active).slice(0, pageSize);
|
|
262493
|
-
const activeItemPosition = pointer + activeItem.length <= pageSize ? pointer : pageSize - activeItem.length;
|
|
262494
|
-
const pageBuffer = Array.from({ length: pageSize });
|
|
262495
|
-
pageBuffer.splice(activeItemPosition, activeItem.length, ...activeItem);
|
|
262496
|
-
const itemVisited = new Set([active]);
|
|
262497
|
-
let bufferPointer = activeItemPosition + activeItem.length;
|
|
262498
|
-
let itemPointer = bound(active + 1);
|
|
262499
|
-
while (bufferPointer < pageSize && !itemVisited.has(itemPointer) && (loop && renderedLength > pageSize ? itemPointer !== active : itemPointer > active)) {
|
|
262500
|
-
const lines = renderItemAtIndex(itemPointer);
|
|
262501
|
-
const linesToAdd = lines.slice(0, pageSize - bufferPointer);
|
|
262502
|
-
pageBuffer.splice(bufferPointer, linesToAdd.length, ...linesToAdd);
|
|
262503
|
-
itemVisited.add(itemPointer);
|
|
262504
|
-
bufferPointer += linesToAdd.length;
|
|
262505
|
-
itemPointer = bound(itemPointer + 1);
|
|
262506
|
-
}
|
|
262507
|
-
bufferPointer = activeItemPosition - 1;
|
|
262508
|
-
itemPointer = bound(active - 1);
|
|
262509
|
-
while (bufferPointer >= 0 && !itemVisited.has(itemPointer) && (loop && renderedLength > pageSize ? itemPointer !== active : itemPointer < active)) {
|
|
262510
|
-
const lines = renderItemAtIndex(itemPointer);
|
|
262511
|
-
const linesToAdd = lines.slice(Math.max(0, lines.length - bufferPointer - 1));
|
|
262512
|
-
pageBuffer.splice(bufferPointer - linesToAdd.length + 1, linesToAdd.length, ...linesToAdd);
|
|
262513
|
-
itemVisited.add(itemPointer);
|
|
262514
|
-
bufferPointer -= linesToAdd.length;
|
|
262515
|
-
itemPointer = bound(itemPointer - 1);
|
|
262516
|
-
}
|
|
262517
|
-
return pageBuffer.filter((line) => typeof line === "string").join(`
|
|
262518
|
-
`);
|
|
262519
|
-
}
|
|
262520
262440
|
// ../../node_modules/.bun/@inquirer+core@10.3.0+c30ff3a63f0500d5/node_modules/@inquirer/core/dist/esm/lib/create-prompt.js
|
|
262521
262441
|
var import_mute_stream = __toESM(require_lib(), 1);
|
|
262522
262442
|
import * as readline2 from "node:readline";
|
|
@@ -262913,20 +262833,6 @@ function createPrompt(view) {
|
|
|
262913
262833
|
};
|
|
262914
262834
|
return prompt;
|
|
262915
262835
|
}
|
|
262916
|
-
// ../../node_modules/.bun/@inquirer+core@10.3.0+c30ff3a63f0500d5/node_modules/@inquirer/core/dist/esm/lib/Separator.js
|
|
262917
|
-
var import_yoctocolors_cjs2 = __toESM(require_yoctocolors_cjs(), 1);
|
|
262918
|
-
class Separator {
|
|
262919
|
-
separator = import_yoctocolors_cjs2.default.dim(Array.from({ length: 15 }).join(esm_default.line));
|
|
262920
|
-
type = "separator";
|
|
262921
|
-
constructor(separator) {
|
|
262922
|
-
if (separator) {
|
|
262923
|
-
this.separator = separator;
|
|
262924
|
-
}
|
|
262925
|
-
}
|
|
262926
|
-
static isSeparator(choice) {
|
|
262927
|
-
return Boolean(choice && typeof choice === "object" && "type" in choice && choice.type === "separator");
|
|
262928
|
-
}
|
|
262929
|
-
}
|
|
262930
262836
|
// ../../node_modules/.bun/yoctocolors@2.1.2/node_modules/yoctocolors/base.js
|
|
262931
262837
|
var exports_base = {};
|
|
262932
262838
|
__export(exports_base, {
|
|
@@ -282184,7 +282090,7 @@ function pruneCurrentEnv(currentEnv, env2) {
|
|
|
282184
282090
|
var package_default = {
|
|
282185
282091
|
name: "@settlemint/sdk-cli",
|
|
282186
282092
|
description: "Command-line interface for SettleMint SDK, providing development tools and project management capabilities",
|
|
282187
|
-
version: "2.6.4-
|
|
282093
|
+
version: "2.6.4-pr729a5586",
|
|
282188
282094
|
type: "module",
|
|
282189
282095
|
private: false,
|
|
282190
282096
|
license: "FSL-1.1-MIT",
|
|
@@ -282234,14 +282140,14 @@ var package_default = {
|
|
|
282234
282140
|
devDependencies: {
|
|
282235
282141
|
"@commander-js/extra-typings": "14.0.0",
|
|
282236
282142
|
commander: "14.0.2",
|
|
282237
|
-
"@inquirer/confirm": "5.1.
|
|
282238
|
-
"@inquirer/input": "4.
|
|
282143
|
+
"@inquirer/confirm": "5.1.20",
|
|
282144
|
+
"@inquirer/input": "4.2.5",
|
|
282239
282145
|
"@inquirer/password": "4.0.21",
|
|
282240
|
-
"@inquirer/select": "4.4.
|
|
282241
|
-
"@settlemint/sdk-hasura": "2.6.4-
|
|
282242
|
-
"@settlemint/sdk-js": "2.6.4-
|
|
282243
|
-
"@settlemint/sdk-utils": "2.6.4-
|
|
282244
|
-
"@settlemint/sdk-viem": "2.6.4-
|
|
282146
|
+
"@inquirer/select": "4.4.1",
|
|
282147
|
+
"@settlemint/sdk-hasura": "2.6.4-pr729a5586",
|
|
282148
|
+
"@settlemint/sdk-js": "2.6.4-pr729a5586",
|
|
282149
|
+
"@settlemint/sdk-utils": "2.6.4-pr729a5586",
|
|
282150
|
+
"@settlemint/sdk-viem": "2.6.4-pr729a5586",
|
|
282245
282151
|
"@types/node": "24.10.0",
|
|
282246
282152
|
"@types/semver": "7.7.1",
|
|
282247
282153
|
"@types/which": "3.0.4",
|
|
@@ -282258,7 +282164,7 @@ var package_default = {
|
|
|
282258
282164
|
},
|
|
282259
282165
|
peerDependencies: {
|
|
282260
282166
|
hardhat: "<= 4",
|
|
282261
|
-
"@settlemint/sdk-js": "2.6.4-
|
|
282167
|
+
"@settlemint/sdk-js": "2.6.4-pr729a5586"
|
|
282262
282168
|
},
|
|
282263
282169
|
peerDependenciesMeta: {
|
|
282264
282170
|
hardhat: {
|
|
@@ -288155,9 +288061,102 @@ function sanitizeName(value5, length = 35) {
|
|
|
288155
288061
|
}).slice(0, length).replaceAll(/(^\d*)/g, "").replaceAll(/(-$)/g, "").replaceAll(/(^-)/g, "");
|
|
288156
288062
|
}
|
|
288157
288063
|
|
|
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
|
+
|
|
288158
288154
|
// ../../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";
|
|
288159
288157
|
var isBackspaceKey2 = (key) => key.name === "backspace";
|
|
288160
288158
|
var isTabKey2 = (key) => key.name === "tab";
|
|
288159
|
+
var isNumberKey2 = (key) => "1234567890".includes(key.name);
|
|
288161
288160
|
var isEnterKey2 = (key) => key.name === "enter" || key.name === "return";
|
|
288162
288161
|
// ../../node_modules/.bun/@inquirer+core@10.3.1+c30ff3a63f0500d5/node_modules/@inquirer/core/dist/esm/lib/errors.js
|
|
288163
288162
|
class AbortPromptError2 extends Error {
|
|
@@ -288324,7 +288323,7 @@ function useEffect2(cb, depArray) {
|
|
|
288324
288323
|
}
|
|
288325
288324
|
|
|
288326
288325
|
// ../../node_modules/.bun/@inquirer+core@10.3.1+c30ff3a63f0500d5/node_modules/@inquirer/core/dist/esm/lib/theme.js
|
|
288327
|
-
var
|
|
288326
|
+
var import_yoctocolors_cjs2 = __toESM(require_yoctocolors_cjs(), 1);
|
|
288328
288327
|
|
|
288329
288328
|
// ../../node_modules/.bun/@inquirer+figures@1.0.15/node_modules/@inquirer/figures/dist/esm/index.js
|
|
288330
288329
|
import process8 from "node:process";
|
|
@@ -288612,27 +288611,27 @@ var fallbackSymbols2 = {
|
|
|
288612
288611
|
};
|
|
288613
288612
|
var shouldUseMain2 = isUnicodeSupported3();
|
|
288614
288613
|
var figures2 = shouldUseMain2 ? mainSymbols2 : fallbackSymbols2;
|
|
288615
|
-
var
|
|
288614
|
+
var esm_default3 = figures2;
|
|
288616
288615
|
var replacements2 = Object.entries(specialMainSymbols2);
|
|
288617
288616
|
|
|
288618
288617
|
// ../../node_modules/.bun/@inquirer+core@10.3.1+c30ff3a63f0500d5/node_modules/@inquirer/core/dist/esm/lib/theme.js
|
|
288619
288618
|
var defaultTheme2 = {
|
|
288620
288619
|
prefix: {
|
|
288621
|
-
idle:
|
|
288622
|
-
done:
|
|
288620
|
+
idle: import_yoctocolors_cjs2.default.blue("?"),
|
|
288621
|
+
done: import_yoctocolors_cjs2.default.green(esm_default3.tick)
|
|
288623
288622
|
},
|
|
288624
288623
|
spinner: {
|
|
288625
288624
|
interval: 80,
|
|
288626
|
-
frames: ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"].map((frame) =>
|
|
288625
|
+
frames: ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"].map((frame) => import_yoctocolors_cjs2.default.yellow(frame))
|
|
288627
288626
|
},
|
|
288628
288627
|
style: {
|
|
288629
|
-
answer:
|
|
288630
|
-
message:
|
|
288631
|
-
error: (text2) =>
|
|
288632
|
-
defaultAnswer: (text2) =>
|
|
288633
|
-
help:
|
|
288634
|
-
highlight:
|
|
288635
|
-
key: (text2) =>
|
|
288628
|
+
answer: import_yoctocolors_cjs2.default.cyan,
|
|
288629
|
+
message: import_yoctocolors_cjs2.default.bold,
|
|
288630
|
+
error: (text2) => import_yoctocolors_cjs2.default.red(`> ${text2}`),
|
|
288631
|
+
defaultAnswer: (text2) => import_yoctocolors_cjs2.default.dim(`(${text2})`),
|
|
288632
|
+
help: import_yoctocolors_cjs2.default.dim,
|
|
288633
|
+
highlight: import_yoctocolors_cjs2.default.cyan,
|
|
288634
|
+
key: (text2) => import_yoctocolors_cjs2.default.cyan(import_yoctocolors_cjs2.default.bold(`<${text2}>`))
|
|
288636
288635
|
}
|
|
288637
288636
|
};
|
|
288638
288637
|
|
|
@@ -288694,11 +288693,22 @@ function usePrefix2({ status = "idle", theme }) {
|
|
|
288694
288693
|
const iconName = status === "loading" ? "idle" : status;
|
|
288695
288694
|
return typeof prefix === "string" ? prefix : prefix[iconName] ?? prefix["idle"];
|
|
288696
288695
|
}
|
|
288696
|
+
// ../../node_modules/.bun/@inquirer+core@10.3.1+c30ff3a63f0500d5/node_modules/@inquirer/core/dist/esm/lib/use-memo.js
|
|
288697
|
+
function useMemo(fn, dependencies) {
|
|
288698
|
+
return withPointer2((pointer) => {
|
|
288699
|
+
const prev = pointer.get();
|
|
288700
|
+
if (!prev || prev.dependencies.length !== dependencies.length || prev.dependencies.some((dep, i7) => dep !== dependencies[i7])) {
|
|
288701
|
+
const value5 = fn();
|
|
288702
|
+
pointer.set({ value: value5, dependencies });
|
|
288703
|
+
return value5;
|
|
288704
|
+
}
|
|
288705
|
+
return prev.value;
|
|
288706
|
+
});
|
|
288707
|
+
}
|
|
288697
288708
|
// ../../node_modules/.bun/@inquirer+core@10.3.1+c30ff3a63f0500d5/node_modules/@inquirer/core/dist/esm/lib/use-ref.js
|
|
288698
288709
|
function useRef2(val) {
|
|
288699
288710
|
return useState2({ current: val })[0];
|
|
288700
288711
|
}
|
|
288701
|
-
|
|
288702
288712
|
// ../../node_modules/.bun/@inquirer+core@10.3.1+c30ff3a63f0500d5/node_modules/@inquirer/core/dist/esm/lib/use-keypress.js
|
|
288703
288713
|
function useKeypress2(userHandler) {
|
|
288704
288714
|
const signal = useRef2(userHandler);
|
|
@@ -288730,6 +288740,72 @@ function readlineWidth2() {
|
|
|
288730
288740
|
return import_cli_width2.default({ defaultWidth: 80, output: readline3().output });
|
|
288731
288741
|
}
|
|
288732
288742
|
|
|
288743
|
+
// ../../node_modules/.bun/@inquirer+core@10.3.1+c30ff3a63f0500d5/node_modules/@inquirer/core/dist/esm/lib/pagination/use-pagination.js
|
|
288744
|
+
function usePointerPosition({ active, renderedItems, pageSize, loop }) {
|
|
288745
|
+
const state = useRef2({
|
|
288746
|
+
lastPointer: active,
|
|
288747
|
+
lastActive: undefined
|
|
288748
|
+
});
|
|
288749
|
+
const { lastPointer, lastActive } = state.current;
|
|
288750
|
+
const middle = Math.floor(pageSize / 2);
|
|
288751
|
+
const renderedLength = renderedItems.reduce((acc, item) => acc + item.length, 0);
|
|
288752
|
+
const defaultPointerPosition = renderedItems.slice(0, active).reduce((acc, item) => acc + item.length, 0);
|
|
288753
|
+
let pointer = defaultPointerPosition;
|
|
288754
|
+
if (renderedLength > pageSize) {
|
|
288755
|
+
if (loop) {
|
|
288756
|
+
pointer = lastPointer;
|
|
288757
|
+
if (lastActive != null && lastActive < active && active - lastActive < pageSize) {
|
|
288758
|
+
pointer = Math.min(middle, Math.abs(active - lastActive) === 1 ? Math.min(lastPointer + (renderedItems[lastActive]?.length ?? 0), Math.max(defaultPointerPosition, lastPointer)) : lastPointer + active - lastActive);
|
|
288759
|
+
}
|
|
288760
|
+
} else {
|
|
288761
|
+
const spaceUnderActive = renderedItems.slice(active).reduce((acc, item) => acc + item.length, 0);
|
|
288762
|
+
pointer = spaceUnderActive < pageSize - middle ? pageSize - spaceUnderActive : Math.min(defaultPointerPosition, middle);
|
|
288763
|
+
}
|
|
288764
|
+
}
|
|
288765
|
+
state.current.lastPointer = pointer;
|
|
288766
|
+
state.current.lastActive = active;
|
|
288767
|
+
return pointer;
|
|
288768
|
+
}
|
|
288769
|
+
function usePagination({ items, active, renderItem, pageSize, loop = true }) {
|
|
288770
|
+
const width = readlineWidth2();
|
|
288771
|
+
const bound = (num) => (num % items.length + items.length) % items.length;
|
|
288772
|
+
const renderedItems = items.map((item, index) => {
|
|
288773
|
+
if (item == null)
|
|
288774
|
+
return [];
|
|
288775
|
+
return breakLines2(renderItem({ item, index, isActive: index === active }), width).split(`
|
|
288776
|
+
`);
|
|
288777
|
+
});
|
|
288778
|
+
const renderedLength = renderedItems.reduce((acc, item) => acc + item.length, 0);
|
|
288779
|
+
const renderItemAtIndex = (index) => renderedItems[index] ?? [];
|
|
288780
|
+
const pointer = usePointerPosition({ active, renderedItems, pageSize, loop });
|
|
288781
|
+
const activeItem = renderItemAtIndex(active).slice(0, pageSize);
|
|
288782
|
+
const activeItemPosition = pointer + activeItem.length <= pageSize ? pointer : pageSize - activeItem.length;
|
|
288783
|
+
const pageBuffer = Array.from({ length: pageSize });
|
|
288784
|
+
pageBuffer.splice(activeItemPosition, activeItem.length, ...activeItem);
|
|
288785
|
+
const itemVisited = new Set([active]);
|
|
288786
|
+
let bufferPointer = activeItemPosition + activeItem.length;
|
|
288787
|
+
let itemPointer = bound(active + 1);
|
|
288788
|
+
while (bufferPointer < pageSize && !itemVisited.has(itemPointer) && (loop && renderedLength > pageSize ? itemPointer !== active : itemPointer > active)) {
|
|
288789
|
+
const lines = renderItemAtIndex(itemPointer);
|
|
288790
|
+
const linesToAdd = lines.slice(0, pageSize - bufferPointer);
|
|
288791
|
+
pageBuffer.splice(bufferPointer, linesToAdd.length, ...linesToAdd);
|
|
288792
|
+
itemVisited.add(itemPointer);
|
|
288793
|
+
bufferPointer += linesToAdd.length;
|
|
288794
|
+
itemPointer = bound(itemPointer + 1);
|
|
288795
|
+
}
|
|
288796
|
+
bufferPointer = activeItemPosition - 1;
|
|
288797
|
+
itemPointer = bound(active - 1);
|
|
288798
|
+
while (bufferPointer >= 0 && !itemVisited.has(itemPointer) && (loop && renderedLength > pageSize ? itemPointer !== active : itemPointer < active)) {
|
|
288799
|
+
const lines = renderItemAtIndex(itemPointer);
|
|
288800
|
+
const linesToAdd = lines.slice(Math.max(0, lines.length - bufferPointer - 1));
|
|
288801
|
+
pageBuffer.splice(bufferPointer - linesToAdd.length + 1, linesToAdd.length, ...linesToAdd);
|
|
288802
|
+
itemVisited.add(itemPointer);
|
|
288803
|
+
bufferPointer -= linesToAdd.length;
|
|
288804
|
+
itemPointer = bound(itemPointer - 1);
|
|
288805
|
+
}
|
|
288806
|
+
return pageBuffer.filter((line) => typeof line === "string").join(`
|
|
288807
|
+
`);
|
|
288808
|
+
}
|
|
288733
288809
|
// ../../node_modules/.bun/@inquirer+core@10.3.1+c30ff3a63f0500d5/node_modules/@inquirer/core/dist/esm/lib/create-prompt.js
|
|
288734
288810
|
var import_mute_stream2 = __toESM(require_lib13(), 1);
|
|
288735
288811
|
import * as readline4 from "node:readline";
|
|
@@ -288918,113 +288994,24 @@ function createPrompt2(view) {
|
|
|
288918
288994
|
};
|
|
288919
288995
|
return prompt;
|
|
288920
288996
|
}
|
|
288921
|
-
// ../../node_modules/.bun/@inquirer+
|
|
288922
|
-
var
|
|
288923
|
-
|
|
288924
|
-
};
|
|
288925
|
-
|
|
288926
|
-
|
|
288927
|
-
|
|
288928
|
-
|
|
288929
|
-
const [defaultValue = "", setDefaultValue] = useState2(config3.default);
|
|
288930
|
-
const [errorMsg, setError] = useState2();
|
|
288931
|
-
const [value5, setValue] = useState2("");
|
|
288932
|
-
const prefix = usePrefix2({ status, theme });
|
|
288933
|
-
async function validate3(value6) {
|
|
288934
|
-
const { required: required2, pattern, patternError = "Invalid input" } = config3;
|
|
288935
|
-
if (required2 && !value6) {
|
|
288936
|
-
return "You must provide a value";
|
|
288937
|
-
}
|
|
288938
|
-
if (pattern && !pattern.test(value6)) {
|
|
288939
|
-
return patternError;
|
|
288940
|
-
}
|
|
288941
|
-
if (typeof config3.validate === "function") {
|
|
288942
|
-
return await config3.validate(value6) || "You must provide a valid value";
|
|
288943
|
-
}
|
|
288944
|
-
return true;
|
|
288945
|
-
}
|
|
288946
|
-
useKeypress2(async (key, rl) => {
|
|
288947
|
-
if (status !== "idle") {
|
|
288948
|
-
return;
|
|
288949
|
-
}
|
|
288950
|
-
if (isEnterKey2(key)) {
|
|
288951
|
-
const answer = value5 || defaultValue;
|
|
288952
|
-
setStatus("loading");
|
|
288953
|
-
const isValid = await validate3(answer);
|
|
288954
|
-
if (isValid === true) {
|
|
288955
|
-
setValue(answer);
|
|
288956
|
-
setStatus("done");
|
|
288957
|
-
done(answer);
|
|
288958
|
-
} else {
|
|
288959
|
-
if (theme.validationFailureMode === "clear") {
|
|
288960
|
-
setValue("");
|
|
288961
|
-
} else {
|
|
288962
|
-
rl.write(value5);
|
|
288963
|
-
}
|
|
288964
|
-
setError(isValid);
|
|
288965
|
-
setStatus("idle");
|
|
288966
|
-
}
|
|
288967
|
-
} else if (isBackspaceKey2(key) && !value5) {
|
|
288968
|
-
setDefaultValue(undefined);
|
|
288969
|
-
} else if (isTabKey2(key) && !value5) {
|
|
288970
|
-
setDefaultValue(undefined);
|
|
288971
|
-
rl.clearLine(0);
|
|
288972
|
-
rl.write(defaultValue);
|
|
288973
|
-
setValue(defaultValue);
|
|
288974
|
-
} else {
|
|
288975
|
-
setValue(rl.line);
|
|
288976
|
-
setError(undefined);
|
|
288977
|
-
}
|
|
288978
|
-
});
|
|
288979
|
-
useEffect2((rl) => {
|
|
288980
|
-
if (prefill === "editable" && defaultValue) {
|
|
288981
|
-
rl.write(defaultValue);
|
|
288982
|
-
setValue(defaultValue);
|
|
288997
|
+
// ../../node_modules/.bun/@inquirer+core@10.3.1+c30ff3a63f0500d5/node_modules/@inquirer/core/dist/esm/lib/Separator.js
|
|
288998
|
+
var import_yoctocolors_cjs3 = __toESM(require_yoctocolors_cjs(), 1);
|
|
288999
|
+
class Separator {
|
|
289000
|
+
separator = import_yoctocolors_cjs3.default.dim(Array.from({ length: 15 }).join(esm_default3.line));
|
|
289001
|
+
type = "separator";
|
|
289002
|
+
constructor(separator) {
|
|
289003
|
+
if (separator) {
|
|
289004
|
+
this.separator = separator;
|
|
288983
289005
|
}
|
|
288984
|
-
}, []);
|
|
288985
|
-
const message = theme.style.message(config3.message, status);
|
|
288986
|
-
let formattedValue = value5;
|
|
288987
|
-
if (typeof config3.transformer === "function") {
|
|
288988
|
-
formattedValue = config3.transformer(value5, { isFinal: status === "done" });
|
|
288989
|
-
} else if (status === "done") {
|
|
288990
|
-
formattedValue = theme.style.answer(value5);
|
|
288991
|
-
}
|
|
288992
|
-
let defaultStr;
|
|
288993
|
-
if (defaultValue && status !== "done" && !value5) {
|
|
288994
|
-
defaultStr = theme.style.defaultAnswer(defaultValue);
|
|
288995
289006
|
}
|
|
288996
|
-
|
|
288997
|
-
|
|
288998
|
-
error51 = theme.style.error(errorMsg);
|
|
288999
|
-
}
|
|
289000
|
-
return [
|
|
289001
|
-
[prefix, message, defaultStr, formattedValue].filter((v6) => v6 !== undefined).join(" "),
|
|
289002
|
-
error51
|
|
289003
|
-
];
|
|
289004
|
-
});
|
|
289005
|
-
|
|
289006
|
-
// src/prompts/smart-contract-set/subgraph-name.prompt.ts
|
|
289007
|
-
async function subgraphNamePrompt({
|
|
289008
|
-
defaultName,
|
|
289009
|
-
env: env2,
|
|
289010
|
-
accept
|
|
289011
|
-
}) {
|
|
289012
|
-
const defaultSubgraphName = defaultName ? sanitizeName(defaultName) : undefined;
|
|
289013
|
-
if (accept) {
|
|
289014
|
-
return defaultSubgraphName ?? env2.SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH;
|
|
289007
|
+
static isSeparator(choice) {
|
|
289008
|
+
return Boolean(choice && typeof choice === "object" && "type" in choice && choice.type === "separator");
|
|
289015
289009
|
}
|
|
289016
|
-
const subgraphName = await esm_default3({
|
|
289017
|
-
message: "What is the name of your subgraph?",
|
|
289018
|
-
default: defaultSubgraphName,
|
|
289019
|
-
required: true
|
|
289020
|
-
});
|
|
289021
|
-
return sanitizeName(subgraphName);
|
|
289022
289010
|
}
|
|
289023
|
-
|
|
289024
|
-
// ../../node_modules/.bun/@inquirer+select@4.4.0+c30ff3a63f0500d5/node_modules/@inquirer/select/dist/esm/index.js
|
|
289011
|
+
// ../../node_modules/.bun/@inquirer+select@4.4.1+c30ff3a63f0500d5/node_modules/@inquirer/select/dist/esm/index.js
|
|
289025
289012
|
var import_yoctocolors_cjs4 = __toESM(require_yoctocolors_cjs(), 1);
|
|
289026
289013
|
var selectTheme = {
|
|
289027
|
-
icon: { cursor:
|
|
289014
|
+
icon: { cursor: esm_default3.pointer },
|
|
289028
289015
|
style: {
|
|
289029
289016
|
disabled: (text2) => import_yoctocolors_cjs4.default.dim(`- ${text2}`),
|
|
289030
289017
|
description: (text2) => import_yoctocolors_cjs4.default.cyan(text2),
|
|
@@ -289062,20 +289049,20 @@ function normalizeChoices(choices) {
|
|
|
289062
289049
|
return normalizedChoice;
|
|
289063
289050
|
});
|
|
289064
289051
|
}
|
|
289065
|
-
var esm_default4 =
|
|
289052
|
+
var esm_default4 = createPrompt2((config3, done) => {
|
|
289066
289053
|
const { loop = true, pageSize = 7 } = config3;
|
|
289067
|
-
const theme =
|
|
289054
|
+
const theme = makeTheme2(selectTheme, config3.theme);
|
|
289068
289055
|
const { keybindings } = theme;
|
|
289069
|
-
const [status, setStatus] =
|
|
289070
|
-
const prefix =
|
|
289071
|
-
const searchTimeoutRef =
|
|
289056
|
+
const [status, setStatus] = useState2("idle");
|
|
289057
|
+
const prefix = usePrefix2({ status, theme });
|
|
289058
|
+
const searchTimeoutRef = useRef2();
|
|
289072
289059
|
const searchEnabled = !keybindings.includes("vim");
|
|
289073
289060
|
const items = useMemo(() => normalizeChoices(config3.choices), [config3.choices]);
|
|
289074
289061
|
const bounds = useMemo(() => {
|
|
289075
289062
|
const first = items.findIndex(isSelectable);
|
|
289076
289063
|
const last = items.findLastIndex(isSelectable);
|
|
289077
289064
|
if (first === -1) {
|
|
289078
|
-
throw new
|
|
289065
|
+
throw new ValidationError2("[select prompt] No selectable choices. All choices are disabled.");
|
|
289079
289066
|
}
|
|
289080
289067
|
return { first, last };
|
|
289081
289068
|
}, [items]);
|
|
@@ -289084,24 +289071,24 @@ var esm_default4 = createPrompt((config3, done) => {
|
|
|
289084
289071
|
return -1;
|
|
289085
289072
|
return items.findIndex((item) => isSelectable(item) && item.value === config3.default);
|
|
289086
289073
|
}, [config3.default, items]);
|
|
289087
|
-
const [active, setActive] =
|
|
289074
|
+
const [active, setActive] = useState2(defaultItemIndex === -1 ? bounds.first : defaultItemIndex);
|
|
289088
289075
|
const selectedChoice = items[active];
|
|
289089
|
-
|
|
289076
|
+
useKeypress2((key, rl) => {
|
|
289090
289077
|
clearTimeout(searchTimeoutRef.current);
|
|
289091
|
-
if (
|
|
289078
|
+
if (isEnterKey2(key)) {
|
|
289092
289079
|
setStatus("done");
|
|
289093
289080
|
done(selectedChoice.value);
|
|
289094
|
-
} else if (
|
|
289081
|
+
} else if (isUpKey2(key, keybindings) || isDownKey2(key, keybindings)) {
|
|
289095
289082
|
rl.clearLine(0);
|
|
289096
|
-
if (loop ||
|
|
289097
|
-
const offset =
|
|
289083
|
+
if (loop || isUpKey2(key, keybindings) && active !== bounds.first || isDownKey2(key, keybindings) && active !== bounds.last) {
|
|
289084
|
+
const offset = isUpKey2(key, keybindings) ? -1 : 1;
|
|
289098
289085
|
let next = active;
|
|
289099
289086
|
do {
|
|
289100
289087
|
next = (next + offset + items.length) % items.length;
|
|
289101
289088
|
} while (!isSelectable(items[next]));
|
|
289102
289089
|
setActive(next);
|
|
289103
289090
|
}
|
|
289104
|
-
} else if (
|
|
289091
|
+
} else if (isNumberKey2(key) && !Number.isNaN(Number(rl.line))) {
|
|
289105
289092
|
const selectedIndex = Number(rl.line) - 1;
|
|
289106
289093
|
let selectableIndex = -1;
|
|
289107
289094
|
const position = items.findIndex((item2) => {
|
|
@@ -289117,7 +289104,7 @@ var esm_default4 = createPrompt((config3, done) => {
|
|
|
289117
289104
|
searchTimeoutRef.current = setTimeout(() => {
|
|
289118
289105
|
rl.clearLine(0);
|
|
289119
289106
|
}, 700);
|
|
289120
|
-
} else if (
|
|
289107
|
+
} else if (isBackspaceKey2(key)) {
|
|
289121
289108
|
rl.clearLine(0);
|
|
289122
289109
|
} else if (searchEnabled) {
|
|
289123
289110
|
const searchTerm = rl.line.toLowerCase();
|
|
@@ -289134,7 +289121,7 @@ var esm_default4 = createPrompt((config3, done) => {
|
|
|
289134
289121
|
}, 700);
|
|
289135
289122
|
}
|
|
289136
289123
|
});
|
|
289137
|
-
|
|
289124
|
+
useEffect2(() => () => {
|
|
289138
289125
|
clearTimeout(searchTimeoutRef.current);
|
|
289139
289126
|
}, []);
|
|
289140
289127
|
const message = theme.style.message(config3.message, status);
|
|
@@ -289183,7 +289170,7 @@ var esm_default4 = createPrompt((config3, done) => {
|
|
|
289183
289170
|
helpLine
|
|
289184
289171
|
].filter(Boolean).join(`
|
|
289185
289172
|
`).trimEnd();
|
|
289186
|
-
return `${lines}${
|
|
289173
|
+
return `${lines}${cursorHide2}`;
|
|
289187
289174
|
});
|
|
289188
289175
|
|
|
289189
289176
|
// src/prompts/smart-contract-set/subgraph.prompt.ts
|
|
@@ -314700,7 +314687,7 @@ function extractInfoFromBody(body) {
|
|
|
314700
314687
|
}
|
|
314701
314688
|
}
|
|
314702
314689
|
|
|
314703
|
-
// ../../node_modules/.bun/@inquirer+confirm@5.1.
|
|
314690
|
+
// ../../node_modules/.bun/@inquirer+confirm@5.1.20+c30ff3a63f0500d5/node_modules/@inquirer/confirm/dist/esm/index.js
|
|
314704
314691
|
function getBooleanValue(value5, defaultValue) {
|
|
314705
314692
|
let answer = defaultValue !== false;
|
|
314706
314693
|
if (/^(y|yes)/i.test(value5))
|
|
@@ -314712,21 +314699,21 @@ function getBooleanValue(value5, defaultValue) {
|
|
|
314712
314699
|
function boolToString(value5) {
|
|
314713
314700
|
return value5 ? "Yes" : "No";
|
|
314714
314701
|
}
|
|
314715
|
-
var esm_default5 =
|
|
314702
|
+
var esm_default5 = createPrompt2((config3, done) => {
|
|
314716
314703
|
const { transformer = boolToString } = config3;
|
|
314717
|
-
const [status, setStatus] =
|
|
314718
|
-
const [value5, setValue] =
|
|
314719
|
-
const theme =
|
|
314720
|
-
const prefix =
|
|
314721
|
-
|
|
314704
|
+
const [status, setStatus] = useState2("idle");
|
|
314705
|
+
const [value5, setValue] = useState2("");
|
|
314706
|
+
const theme = makeTheme2(config3.theme);
|
|
314707
|
+
const prefix = usePrefix2({ status, theme });
|
|
314708
|
+
useKeypress2((key, rl) => {
|
|
314722
314709
|
if (status !== "idle")
|
|
314723
314710
|
return;
|
|
314724
|
-
if (
|
|
314711
|
+
if (isEnterKey2(key)) {
|
|
314725
314712
|
const answer = getBooleanValue(value5, config3.default);
|
|
314726
314713
|
setValue(transformer(answer));
|
|
314727
314714
|
setStatus("done");
|
|
314728
314715
|
done(answer);
|
|
314729
|
-
} else if (
|
|
314716
|
+
} else if (isTabKey2(key)) {
|
|
314730
314717
|
const answer = boolToString(!getBooleanValue(value5, config3.default));
|
|
314731
314718
|
rl.clearLine(0);
|
|
314732
314719
|
rl.write(answer);
|
|
@@ -314818,7 +314805,7 @@ async function applicationAccessTokenPrompt(env2, application, settlemint, accep
|
|
|
314818
314805
|
default: false
|
|
314819
314806
|
});
|
|
314820
314807
|
if (create3) {
|
|
314821
|
-
const name4 = await
|
|
314808
|
+
const name4 = await esm_default2({
|
|
314822
314809
|
message: "How would you like to name this application access token?",
|
|
314823
314810
|
default: `SettleMint CLI (${Date.now()}${process.env.USER ? ` ${process.env.USER}` : ""})`,
|
|
314824
314811
|
required: true,
|
|
@@ -315284,7 +315271,7 @@ async function instancePrompt({
|
|
|
315284
315271
|
return sanitizeInstanceUrl(defaultPromptInstance);
|
|
315285
315272
|
}
|
|
315286
315273
|
if (freeTextInput) {
|
|
315287
|
-
const instance = await
|
|
315274
|
+
const instance = await esm_default2({
|
|
315288
315275
|
message: "What is the URL of your SettleMint instance?",
|
|
315289
315276
|
default: defaultPromptInstance,
|
|
315290
315277
|
required: true,
|
|
@@ -315368,7 +315355,7 @@ async function serviceUrlPrompt({
|
|
|
315368
315355
|
if (isCi) {
|
|
315369
315356
|
return defaultUrl ? new URL(defaultUrl).toString() : undefined;
|
|
315370
315357
|
}
|
|
315371
|
-
const serviceUrl = await
|
|
315358
|
+
const serviceUrl = await esm_default2({
|
|
315372
315359
|
message: example ? `${message} (eg ${example})` : message,
|
|
315373
315360
|
default: defaultUrl,
|
|
315374
315361
|
required: true,
|
|
@@ -315803,7 +315790,7 @@ async function serviceValuePrompt({
|
|
|
315803
315790
|
if (isCi) {
|
|
315804
315791
|
return defaultValue;
|
|
315805
315792
|
}
|
|
315806
|
-
const serviceSecret = await
|
|
315793
|
+
const serviceSecret = await esm_default2({
|
|
315807
315794
|
message: example ? `${message} (eg ${example})` : message,
|
|
315808
315795
|
default: defaultValue
|
|
315809
315796
|
});
|
|
@@ -316259,7 +316246,7 @@ async function projectNamePrompt(env2, argument) {
|
|
|
316259
316246
|
if (defaultInstance) {
|
|
316260
316247
|
return defaultInstance;
|
|
316261
316248
|
}
|
|
316262
|
-
return
|
|
316249
|
+
return esm_default2({
|
|
316263
316250
|
message: "What is the name of your new SettleMint project?",
|
|
316264
316251
|
default: defaultInstance,
|
|
316265
316252
|
required: true,
|
|
@@ -321617,7 +321604,7 @@ function createCommand3() {
|
|
|
321617
321604
|
|
|
321618
321605
|
// src/prompts/delete-confirmation.prompt.ts
|
|
321619
321606
|
async function deleteConfirmationPrompt(itemDescription) {
|
|
321620
|
-
const confirmation = await
|
|
321607
|
+
const confirmation = await esm_default2({
|
|
321621
321608
|
message: `Are you sure you want to delete ${itemDescription}? (yes/no)`,
|
|
321622
321609
|
required: true,
|
|
321623
321610
|
validate(value5) {
|
|
@@ -323385,7 +323372,7 @@ async function addressPrompt({
|
|
|
323385
323372
|
hardhatConfig
|
|
323386
323373
|
}) {
|
|
323387
323374
|
if (!node) {
|
|
323388
|
-
return
|
|
323375
|
+
return esm_default2({
|
|
323389
323376
|
message: "Which private key address do you want to deploy from?",
|
|
323390
323377
|
validate: (value5) => {
|
|
323391
323378
|
if (!isAddress(value5)) {
|
|
@@ -324356,4 +324343,4 @@ async function sdkCliCommand(argv = process.argv) {
|
|
|
324356
324343
|
// src/cli.ts
|
|
324357
324344
|
sdkCliCommand();
|
|
324358
324345
|
|
|
324359
|
-
//# debugId=
|
|
324346
|
+
//# debugId=D574FAF769AD585B64756E2164756E21
|