@settlemint/sdk-cli 1.0.0-main6dfb9f04 → 1.0.0-maind552bede
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 +105 -82
- package/dist/cli.js.map +12 -12
- package/package.json +3 -3
package/dist/cli.js
CHANGED
|
@@ -19613,7 +19613,7 @@ var require_lib4 = __commonJS((exports, module) => {
|
|
|
19613
19613
|
var rRel = new RegExp(`^\\.${rSlash.source}`);
|
|
19614
19614
|
var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
|
|
19615
19615
|
var getPathInfo = (cmd, {
|
|
19616
|
-
path: optPath = "/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/tmp/bunx-1001-turbo@latest/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.
|
|
19616
|
+
path: optPath = "/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/tmp/bunx-1001-turbo@latest/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.Q1ZfVcAqCa:/nsc/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/snap/bin/:/usr/games:/usr/local/games:/home/linuxbrew/.linuxbrew/bin:/home/runner/.config/composer/vendor/bin:/home/runner/.dotnet/tools:/home/runner/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin",
|
|
19617
19617
|
pathExt: optPathExt = process.env.PATHEXT,
|
|
19618
19618
|
delimiter: optDelimiter = delimiter
|
|
19619
19619
|
}) => {
|
|
@@ -19817,7 +19817,7 @@ var require_lib5 = __commonJS((exports, module) => {
|
|
|
19817
19817
|
let pathToInitial;
|
|
19818
19818
|
try {
|
|
19819
19819
|
pathToInitial = which.sync(initialCmd, {
|
|
19820
|
-
path: options.env && findInObject(options.env, "PATH") || "/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/tmp/bunx-1001-turbo@latest/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.
|
|
19820
|
+
path: options.env && findInObject(options.env, "PATH") || "/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/tmp/bunx-1001-turbo@latest/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.Q1ZfVcAqCa:/nsc/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/snap/bin/:/usr/games:/usr/local/games:/home/linuxbrew/.linuxbrew/bin:/home/runner/.config/composer/vendor/bin:/home/runner/.dotnet/tools:/home/runner/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin",
|
|
19821
19821
|
pathext: options.env && findInObject(options.env, "PATHEXT") || process.env.PATHEXT
|
|
19822
19822
|
}).toLowerCase();
|
|
19823
19823
|
} catch (err) {
|
|
@@ -20534,7 +20534,7 @@ var require_lib6 = __commonJS((exports, module) => {
|
|
|
20534
20534
|
var rRel = new RegExp(`^\\.${rSlash.source}`);
|
|
20535
20535
|
var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
|
|
20536
20536
|
var getPathInfo = (cmd, {
|
|
20537
|
-
path: optPath = "/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/tmp/bunx-1001-turbo@latest/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.
|
|
20537
|
+
path: optPath = "/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/tmp/bunx-1001-turbo@latest/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.Q1ZfVcAqCa:/nsc/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/snap/bin/:/usr/games:/usr/local/games:/home/linuxbrew/.linuxbrew/bin:/home/runner/.config/composer/vendor/bin:/home/runner/.dotnet/tools:/home/runner/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin",
|
|
20538
20538
|
pathExt: optPathExt = process.env.PATHEXT,
|
|
20539
20539
|
delimiter: optDelimiter = delimiter
|
|
20540
20540
|
}) => {
|
|
@@ -223327,7 +223327,7 @@ ${Bt.cyan(Yt)}
|
|
|
223327
223327
|
code: "ENOENT"
|
|
223328
223328
|
}), getPathInfo = (e9, t7) => {
|
|
223329
223329
|
var r6 = t7.colon || or;
|
|
223330
|
-
var i6 = e9.match(/\//) || nr && e9.match(/\\/) ? [""] : [...nr ? [process.cwd()] : [], ...(t7.path || "/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/tmp/bunx-1001-turbo@latest/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.
|
|
223330
|
+
var i6 = e9.match(/\//) || nr && e9.match(/\\/) ? [""] : [...nr ? [process.cwd()] : [], ...(t7.path || "/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/tmp/bunx-1001-turbo@latest/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.Q1ZfVcAqCa:/nsc/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/snap/bin/:/usr/games:/usr/local/games:/home/linuxbrew/.linuxbrew/bin:/home/runner/.config/composer/vendor/bin:/home/runner/.dotnet/tools:/home/runner/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin").split(r6)];
|
|
223331
223331
|
var n6 = nr ? t7.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
|
|
223332
223332
|
var a5 = nr ? n6.split(r6) : [""];
|
|
223333
223333
|
if (nr) {
|
|
@@ -226464,7 +226464,7 @@ ${whileRunning(e9)}`;
|
|
|
226464
226464
|
};
|
|
226465
226465
|
ni = Object.assign(async function _main() {
|
|
226466
226466
|
var e9 = new Cli({
|
|
226467
|
-
binaryVersion: "1.0.0-
|
|
226467
|
+
binaryVersion: "1.0.0-maind552bede",
|
|
226468
226468
|
binaryLabel: "gql.tada CLI",
|
|
226469
226469
|
binaryName: "gql.tada"
|
|
226470
226470
|
});
|
|
@@ -234964,7 +234964,7 @@ var require_which2 = __commonJS((exports, module) => {
|
|
|
234964
234964
|
const colon = opt2.colon || COLON;
|
|
234965
234965
|
const pathEnv = cmd2.match(/\//) || isWindows2 && cmd2.match(/\\/) ? [""] : [
|
|
234966
234966
|
...isWindows2 ? [process.cwd()] : [],
|
|
234967
|
-
...(opt2.path || "/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/tmp/bunx-1001-turbo@latest/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.
|
|
234967
|
+
...(opt2.path || "/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/tmp/bunx-1001-turbo@latest/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.Q1ZfVcAqCa:/nsc/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/snap/bin/:/usr/games:/usr/local/games:/home/linuxbrew/.linuxbrew/bin:/home/runner/.config/composer/vendor/bin:/home/runner/.dotnet/tools:/home/runner/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin").split(colon)
|
|
234968
234968
|
];
|
|
234969
234969
|
const pathExtExe = isWindows2 ? opt2.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
|
|
234970
234970
|
const pathExt = isWindows2 ? pathExtExe.split(colon) : [""];
|
|
@@ -256788,7 +256788,7 @@ ${error.stack}`));
|
|
|
256788
256788
|
var package_default = {
|
|
256789
256789
|
name: "@settlemint/sdk-cli",
|
|
256790
256790
|
description: "Command-line interface for SettleMint SDK, providing development tools and project management capabilities",
|
|
256791
|
-
version: "1.0.0-
|
|
256791
|
+
version: "1.0.0-maind552bede",
|
|
256792
256792
|
type: "module",
|
|
256793
256793
|
private: false,
|
|
256794
256794
|
license: "FSL-1.1-MIT",
|
|
@@ -256841,8 +256841,8 @@ var package_default = {
|
|
|
256841
256841
|
"@inquirer/input": "4.1.3",
|
|
256842
256842
|
"@inquirer/password": "4.0.6",
|
|
256843
256843
|
"@inquirer/select": "4.0.6",
|
|
256844
|
-
"@settlemint/sdk-js": "1.0.0-
|
|
256845
|
-
"@settlemint/sdk-utils": "1.0.0-
|
|
256844
|
+
"@settlemint/sdk-js": "1.0.0-maind552bede",
|
|
256845
|
+
"@settlemint/sdk-utils": "1.0.0-maind552bede",
|
|
256846
256846
|
"get-tsconfig": "4.8.1",
|
|
256847
256847
|
giget: "1.2.3"
|
|
256848
256848
|
},
|
|
@@ -267563,7 +267563,7 @@ var et = l((Re, tt) => {
|
|
|
267563
267563
|
var g = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys", Y = h("path"), Bt = g ? ";" : ":", V = U(), J = (t) => Object.assign(new Error(`not found: ${t}`), { code: "ENOENT" }), Q = (t, e) => {
|
|
267564
267564
|
let n = e.colon || Bt, r = t.match(/\//) || g && t.match(/\\/) ? [""] : [
|
|
267565
267565
|
...g ? [process.cwd()] : [],
|
|
267566
|
-
...(e.path || "/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/tmp/bunx-1001-turbo@latest/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.
|
|
267566
|
+
...(e.path || "/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/tmp/bunx-1001-turbo@latest/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.Q1ZfVcAqCa:/nsc/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/snap/bin/:/usr/games:/usr/local/games:/home/linuxbrew/.linuxbrew/bin:/home/runner/.config/composer/vendor/bin:/home/runner/.dotnet/tools:/home/runner/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin").split(n)
|
|
267567
267567
|
], s = g ? e.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "", o = g ? s.split(n) : [""];
|
|
267568
267568
|
return g && t.indexOf(".") !== -1 && o[0] !== "" && o.unshift(""), {
|
|
267569
267569
|
pathEnv: r,
|
|
@@ -268203,37 +268203,6 @@ async function exists2(path5) {
|
|
|
268203
268203
|
return false;
|
|
268204
268204
|
}
|
|
268205
268205
|
}
|
|
268206
|
-
async function getPackageManager(targetDir) {
|
|
268207
|
-
const packageManager = await detect({ cwd: targetDir || process.cwd() });
|
|
268208
|
-
return packageManager?.name ?? "npm";
|
|
268209
|
-
}
|
|
268210
|
-
async function getPackageManagerExecutable(targetDir) {
|
|
268211
|
-
const packageManager = await getPackageManager(targetDir ?? process.cwd());
|
|
268212
|
-
switch (packageManager) {
|
|
268213
|
-
case "pnpm":
|
|
268214
|
-
return { command: "pnpm", args: ["dlx"] };
|
|
268215
|
-
case "bun":
|
|
268216
|
-
return { command: "bunx", args: [] };
|
|
268217
|
-
case "yarn":
|
|
268218
|
-
return { command: "yarn", args: ["create"] };
|
|
268219
|
-
}
|
|
268220
|
-
return { command: "npx", args: [] };
|
|
268221
|
-
}
|
|
268222
|
-
async function installDependencies(pkgs, cwd) {
|
|
268223
|
-
try {
|
|
268224
|
-
await installPackage(pkgs, { silent: true, additionalArgs: ["--exact"], cwd });
|
|
268225
|
-
} catch (err) {
|
|
268226
|
-
const error = err instanceof Error ? err.message : "Unknown error";
|
|
268227
|
-
note2(`Failed to install ${Array.isArray(pkgs) ? `dependencies '${pkgs.join(", ")}'` : `dependency '${pkgs}'`}: ${error}`, "warn");
|
|
268228
|
-
}
|
|
268229
|
-
}
|
|
268230
|
-
async function isPackageInstalled(name, path5) {
|
|
268231
|
-
const pkgJson = await import_package_json.default.load(path5 ?? await projectRoot2());
|
|
268232
|
-
const inDependencies = !!pkgJson.content.dependencies?.[name];
|
|
268233
|
-
const inDevDependencies = !!pkgJson.content.devDependencies?.[name];
|
|
268234
|
-
const inPeerDependencies = !!pkgJson.content.peerDependencies?.[name];
|
|
268235
|
-
return inDependencies || inDevDependencies || inPeerDependencies;
|
|
268236
|
-
}
|
|
268237
268206
|
async function retryWhenFailed(fn, maxRetries = 5, initialSleepTime = 3000, stopOnError) {
|
|
268238
268207
|
let attempt = 0;
|
|
268239
268208
|
while (attempt < maxRetries) {
|
|
@@ -268269,6 +268238,47 @@ async function fetchWithRetry(input, init, maxRetries = 5, initialSleepTime = 30
|
|
|
268269
268238
|
throw new Error(`HTTP error! status: ${response.status} ${response.statusText}`);
|
|
268270
268239
|
}, maxRetries, initialSleepTime);
|
|
268271
268240
|
}
|
|
268241
|
+
async function graphqlFetchWithRetry(input, init, maxRetries = 5, initialSleepTime = 3000) {
|
|
268242
|
+
return retryWhenFailed(async () => {
|
|
268243
|
+
const response = await fetchWithRetry(input, init);
|
|
268244
|
+
const json = await response.json();
|
|
268245
|
+
if (json.errors) {
|
|
268246
|
+
throw new Error(`GraphQL errors in response: ${json.errors.map((error) => error.message).join(", ")}`);
|
|
268247
|
+
}
|
|
268248
|
+
return json.data;
|
|
268249
|
+
}, maxRetries, initialSleepTime);
|
|
268250
|
+
}
|
|
268251
|
+
async function getPackageManager(targetDir) {
|
|
268252
|
+
const packageManager = await detect({ cwd: targetDir || process.cwd() });
|
|
268253
|
+
return packageManager?.name ?? "npm";
|
|
268254
|
+
}
|
|
268255
|
+
async function getPackageManagerExecutable(targetDir) {
|
|
268256
|
+
const packageManager = await getPackageManager(targetDir ?? process.cwd());
|
|
268257
|
+
switch (packageManager) {
|
|
268258
|
+
case "pnpm":
|
|
268259
|
+
return { command: "pnpm", args: ["dlx"] };
|
|
268260
|
+
case "bun":
|
|
268261
|
+
return { command: "bunx", args: [] };
|
|
268262
|
+
case "yarn":
|
|
268263
|
+
return { command: "yarn", args: ["create"] };
|
|
268264
|
+
}
|
|
268265
|
+
return { command: "npx", args: [] };
|
|
268266
|
+
}
|
|
268267
|
+
async function installDependencies(pkgs, cwd) {
|
|
268268
|
+
try {
|
|
268269
|
+
await installPackage(pkgs, { silent: true, additionalArgs: ["--exact"], cwd });
|
|
268270
|
+
} catch (err) {
|
|
268271
|
+
const error = err instanceof Error ? err.message : "Unknown error";
|
|
268272
|
+
note2(`Failed to install ${Array.isArray(pkgs) ? `dependencies '${pkgs.join(", ")}'` : `dependency '${pkgs}'`}: ${error}`, "warn");
|
|
268273
|
+
}
|
|
268274
|
+
}
|
|
268275
|
+
async function isPackageInstalled(name, path5) {
|
|
268276
|
+
const pkgJson = await import_package_json.default.load(path5 ?? await projectRoot2());
|
|
268277
|
+
const inDependencies = !!pkgJson.content.dependencies?.[name];
|
|
268278
|
+
const inDevDependencies = !!pkgJson.content.devDependencies?.[name];
|
|
268279
|
+
const inPeerDependencies = !!pkgJson.content.peerDependencies?.[name];
|
|
268280
|
+
return inDependencies || inDevDependencies || inPeerDependencies;
|
|
268281
|
+
}
|
|
268272
268282
|
function capitalizeFirstLetter(val) {
|
|
268273
268283
|
return String(val).charAt(0).toUpperCase() + String(val).slice(1);
|
|
268274
268284
|
}
|
|
@@ -268556,7 +268566,7 @@ async function testGqlEndpoint({
|
|
|
268556
268566
|
if (!gqlEndpoint) {
|
|
268557
268567
|
return false;
|
|
268558
268568
|
}
|
|
268559
|
-
|
|
268569
|
+
await graphqlFetchWithRetry(gqlEndpoint, {
|
|
268560
268570
|
method: "POST",
|
|
268561
268571
|
headers: {
|
|
268562
268572
|
"x-auth-token": accessToken,
|
|
@@ -268575,10 +268585,6 @@ async function testGqlEndpoint({
|
|
|
268575
268585
|
`
|
|
268576
268586
|
})
|
|
268577
268587
|
});
|
|
268578
|
-
const data = await response.json();
|
|
268579
|
-
if (data.errors) {
|
|
268580
|
-
throw new Error("GraphQL errors in response");
|
|
268581
|
-
}
|
|
268582
268588
|
return true;
|
|
268583
268589
|
}
|
|
268584
268590
|
|
|
@@ -270848,7 +270854,7 @@ async function codegenBlockscout(env2) {
|
|
|
270848
270854
|
if (!accessToken) {
|
|
270849
270855
|
return;
|
|
270850
270856
|
}
|
|
270851
|
-
const
|
|
270857
|
+
const data = await graphqlFetchWithRetry(endpoint, {
|
|
270852
270858
|
method: "POST",
|
|
270853
270859
|
headers: {
|
|
270854
270860
|
"x-auth-token": accessToken,
|
|
@@ -270957,15 +270963,8 @@ async function codegenBlockscout(env2) {
|
|
|
270957
270963
|
`
|
|
270958
270964
|
})
|
|
270959
270965
|
});
|
|
270960
|
-
if (!response.ok) {
|
|
270961
|
-
throw new Error(`HTTP error! status: ${response.status}`);
|
|
270962
|
-
}
|
|
270963
|
-
const data = await response.json();
|
|
270964
|
-
if (data.errors) {
|
|
270965
|
-
throw new Error("GraphQL errors in response");
|
|
270966
|
-
}
|
|
270967
270966
|
const introspectionJsonPath = resolve4(process.cwd(), "__blockscout-introspection__.json");
|
|
270968
|
-
await writeFile6(introspectionJsonPath, JSON.stringify(data
|
|
270967
|
+
await writeFile6(introspectionJsonPath, JSON.stringify(data));
|
|
270969
270968
|
try {
|
|
270970
270969
|
await generateSchema({
|
|
270971
270970
|
input: basename(introspectionJsonPath),
|
|
@@ -271187,15 +271186,19 @@ async function writeEnvSpinner(prod, env2) {
|
|
|
271187
271186
|
}
|
|
271188
271187
|
|
|
271189
271188
|
// src/utils/get-cluster-service-endpoint.ts
|
|
271190
|
-
async function getGraphEndpoint(service, env2, graphName) {
|
|
271189
|
+
async function getGraphEndpoint(settlemint, service, env2, graphName) {
|
|
271191
271190
|
if (!service || service.__typename !== "HAGraphMiddleware") {
|
|
271192
271191
|
return {};
|
|
271193
271192
|
}
|
|
271193
|
+
const middleware = await retryWhenFailed(() => settlemint.middleware.graphSubgraphs(service.uniqueName, !!graphName));
|
|
271194
|
+
if (!middleware || middleware.__typename !== "HAGraphMiddleware") {
|
|
271195
|
+
return {};
|
|
271196
|
+
}
|
|
271194
271197
|
const isStarterKit = (id) => id.endsWith("-starterkits");
|
|
271195
|
-
const testEndpoint =
|
|
271196
|
-
const starterKitEndpoint =
|
|
271198
|
+
const testEndpoint = middleware.subgraphs.find(({ graphqlQueryEndpoint }) => graphName ? graphqlQueryEndpoint?.id.endsWith(graphName) : !isStarterKit(graphqlQueryEndpoint?.id))?.graphqlQueryEndpoint?.displayValue;
|
|
271199
|
+
const starterKitEndpoint = middleware.subgraphs.find(({ graphqlQueryEndpoint }) => isStarterKit(graphqlQueryEndpoint?.id))?.graphqlQueryEndpoint?.displayValue;
|
|
271197
271200
|
const hasEndpoint = testEndpoint && env2.SETTLEMINT_ACCESS_TOKEN ? await testGqlEndpoint({ accessToken: env2.SETTLEMINT_ACCESS_TOKEN, gqlEndpoint: testEndpoint }) : false;
|
|
271198
|
-
const endpoints = hasEndpoint ?
|
|
271201
|
+
const endpoints = hasEndpoint ? middleware.subgraphs.map(({ graphqlQueryEndpoint }) => graphqlQueryEndpoint?.displayValue) : starterKitEndpoint ? [starterKitEndpoint] : [];
|
|
271199
271202
|
if (endpoints.length === 0) {
|
|
271200
271203
|
return {};
|
|
271201
271204
|
}
|
|
@@ -272941,18 +272944,11 @@ var MiddlewareFragment = graphql(`
|
|
|
272941
272944
|
}
|
|
272942
272945
|
... on HAGraphMiddleware {
|
|
272943
272946
|
specVersion
|
|
272944
|
-
subgraphs(noCache: $noCache) {
|
|
272945
|
-
name
|
|
272946
|
-
graphqlQueryEndpoint {
|
|
272947
|
-
displayValue
|
|
272948
|
-
id
|
|
272949
|
-
}
|
|
272950
|
-
}
|
|
272951
272947
|
}
|
|
272952
272948
|
}
|
|
272953
272949
|
`);
|
|
272954
272950
|
var getMiddlewares = graphql(`
|
|
272955
|
-
query GetMiddlewares($applicationUniqueName: String
|
|
272951
|
+
query GetMiddlewares($applicationUniqueName: String!) {
|
|
272956
272952
|
middlewaresByUniqueName(applicationUniqueName: $applicationUniqueName) {
|
|
272957
272953
|
items {
|
|
272958
272954
|
...Middleware
|
|
@@ -272961,9 +272957,25 @@ var getMiddlewares = graphql(`
|
|
|
272961
272957
|
}
|
|
272962
272958
|
`, [MiddlewareFragment]);
|
|
272963
272959
|
var getMiddleware = graphql(`
|
|
272964
|
-
query GetMiddleware($uniqueName: String
|
|
272960
|
+
query GetMiddleware($uniqueName: String!) {
|
|
272961
|
+
middlewareByUniqueName(uniqueName: $uniqueName) {
|
|
272962
|
+
...Middleware
|
|
272963
|
+
}
|
|
272964
|
+
}
|
|
272965
|
+
`, [MiddlewareFragment]);
|
|
272966
|
+
var getGraphMiddlewareSubgraphs = graphql(`
|
|
272967
|
+
query GetMiddleware($uniqueName: String!, $noCache: Boolean) {
|
|
272965
272968
|
middlewareByUniqueName(uniqueName: $uniqueName) {
|
|
272966
272969
|
...Middleware
|
|
272970
|
+
... on HAGraphMiddleware {
|
|
272971
|
+
subgraphs(noCache: $noCache) {
|
|
272972
|
+
name
|
|
272973
|
+
graphqlQueryEndpoint {
|
|
272974
|
+
displayValue
|
|
272975
|
+
id
|
|
272976
|
+
}
|
|
272977
|
+
}
|
|
272978
|
+
}
|
|
272967
272979
|
}
|
|
272968
272980
|
}
|
|
272969
272981
|
`, [MiddlewareFragment]);
|
|
@@ -272981,7 +272993,6 @@ var createMiddleware = graphql(`
|
|
|
272981
272993
|
$loadBalancerId: ID
|
|
272982
272994
|
$abis: [SmartContractPortalMiddlewareAbiInputDto!]
|
|
272983
272995
|
$includePredeployedAbis: [String!]
|
|
272984
|
-
$noCache: Boolean = false
|
|
272985
272996
|
) {
|
|
272986
272997
|
createMiddleware(
|
|
272987
272998
|
applicationId: $applicationId
|
|
@@ -273002,7 +273013,7 @@ var createMiddleware = graphql(`
|
|
|
273002
273013
|
}
|
|
273003
273014
|
`, [MiddlewareFragment]);
|
|
273004
273015
|
var restartMiddleware = graphql(`
|
|
273005
|
-
mutation RestartMiddleware($uniqueName: String
|
|
273016
|
+
mutation RestartMiddleware($uniqueName: String!) {
|
|
273006
273017
|
restartMiddlewareByUniqueName(uniqueName: $uniqueName) {
|
|
273007
273018
|
...Middleware
|
|
273008
273019
|
}
|
|
@@ -273024,6 +273035,15 @@ var middlewareRead = (gqlClient) => {
|
|
|
273024
273035
|
return middleware;
|
|
273025
273036
|
};
|
|
273026
273037
|
};
|
|
273038
|
+
var graphMiddlewareSubgraphs = (gqlClient) => {
|
|
273039
|
+
return async (middlewareUniqueName, noCache = false) => {
|
|
273040
|
+
const { middlewareByUniqueName: middleware } = await gqlClient.request(getGraphMiddlewareSubgraphs, {
|
|
273041
|
+
uniqueName: middlewareUniqueName,
|
|
273042
|
+
noCache
|
|
273043
|
+
});
|
|
273044
|
+
return middleware;
|
|
273045
|
+
};
|
|
273046
|
+
};
|
|
273027
273047
|
var middlewareCreate = (gqlClient) => {
|
|
273028
273048
|
return async (args) => {
|
|
273029
273049
|
const { applicationUniqueName, blockchainNodeUniqueName, loadBalancerUniqueName, storageUniqueName, ...otherArgs } = args;
|
|
@@ -273222,6 +273242,7 @@ function createSettleMintClient(options) {
|
|
|
273222
273242
|
middleware: {
|
|
273223
273243
|
list: middlewareList(gqlClient),
|
|
273224
273244
|
read: middlewareRead(gqlClient),
|
|
273245
|
+
graphSubgraphs: graphMiddlewareSubgraphs(gqlClient),
|
|
273225
273246
|
create: middlewareCreate(gqlClient),
|
|
273226
273247
|
restart: middlewareRestart(gqlClient)
|
|
273227
273248
|
},
|
|
@@ -273718,18 +273739,23 @@ async function hdPrivateKeyPrompt({
|
|
|
273718
273739
|
}
|
|
273719
273740
|
|
|
273720
273741
|
// src/commands/connect/instance.prompt.ts
|
|
273721
|
-
async function instancePrompt(env2, accept, freeTextInput = false) {
|
|
273742
|
+
async function instancePrompt(env2, accept, freeTextInput = false, isCi = is_in_ci_default) {
|
|
273722
273743
|
const knownInstances = await getInstances();
|
|
273723
|
-
const autoAccept = !!accept ||
|
|
273724
|
-
const defaultInstance = env2.SETTLEMINT_INSTANCE
|
|
273744
|
+
const autoAccept = !!accept || isCi;
|
|
273745
|
+
const defaultInstance = env2.SETTLEMINT_INSTANCE;
|
|
273725
273746
|
const defaultPossible = autoAccept && defaultInstance;
|
|
273726
273747
|
if (defaultPossible) {
|
|
273727
273748
|
return defaultInstance;
|
|
273728
273749
|
}
|
|
273750
|
+
const defaultLoginInstance = await getDefaultInstance();
|
|
273751
|
+
const defaultPromptInstance = defaultInstance ?? defaultLoginInstance ?? "https://console.settlemint.com";
|
|
273752
|
+
if (isCi) {
|
|
273753
|
+
return defaultPromptInstance;
|
|
273754
|
+
}
|
|
273729
273755
|
if (freeTextInput) {
|
|
273730
273756
|
const instance = await esm_default4({
|
|
273731
273757
|
message: "What is the URL of your SettleMint instance?",
|
|
273732
|
-
default:
|
|
273758
|
+
default: defaultPromptInstance,
|
|
273733
273759
|
required: true,
|
|
273734
273760
|
validate(value4) {
|
|
273735
273761
|
try {
|
|
@@ -273757,7 +273783,7 @@ async function instancePrompt(env2, accept, freeTextInput = false) {
|
|
|
273757
273783
|
value: instance
|
|
273758
273784
|
}))
|
|
273759
273785
|
],
|
|
273760
|
-
default:
|
|
273786
|
+
default: defaultPromptInstance
|
|
273761
273787
|
});
|
|
273762
273788
|
}
|
|
273763
273789
|
|
|
@@ -274021,7 +274047,7 @@ function connectCommand() {
|
|
|
274021
274047
|
SETTLEMINT_HASURA: hasura?.uniqueName,
|
|
274022
274048
|
...getHasuraEndpoints(hasura),
|
|
274023
274049
|
SETTLEMINT_THEGRAPH: thegraph?.uniqueName,
|
|
274024
|
-
...await getGraphEndpoint(thegraph, env2),
|
|
274050
|
+
...await getGraphEndpoint(settlemint, thegraph, env2),
|
|
274025
274051
|
SETTLEMINT_PORTAL: portal?.uniqueName,
|
|
274026
274052
|
...getPortalEndpoints(portal),
|
|
274027
274053
|
SETTLEMINT_HD_PRIVATE_KEY: hdPrivateKey?.uniqueName,
|
|
@@ -274932,9 +274958,6 @@ function loginCommand() {
|
|
|
274932
274958
|
intro("Login to your SettleMint account");
|
|
274933
274959
|
const autoAccept = !!acceptDefaults || !!tokenStdin;
|
|
274934
274960
|
const env2 = await loadEnv2(false, false);
|
|
274935
|
-
if (instance) {
|
|
274936
|
-
validate3(UrlSchema, instance);
|
|
274937
|
-
}
|
|
274938
274961
|
const selectedInstance = instance ? sanitizeAndValidateInstanceUrl(instance) : await instancePrompt(env2, autoAccept, true);
|
|
274939
274962
|
let personalAccessToken = "";
|
|
274940
274963
|
if (tokenStdin) {
|
|
@@ -275915,7 +275938,7 @@ function graphMiddlewareCreateCommand() {
|
|
|
275915
275938
|
return {
|
|
275916
275939
|
SETTLEMINT_APPLICATION: applicationUniqueName,
|
|
275917
275940
|
SETTLEMINT_THEGRAPH: result.uniqueName,
|
|
275918
|
-
...await getGraphEndpoint(graphMiddleware, env2)
|
|
275941
|
+
...await getGraphEndpoint(settlemint, graphMiddleware, env2)
|
|
275919
275942
|
};
|
|
275920
275943
|
}
|
|
275921
275944
|
};
|
|
@@ -277589,7 +277612,7 @@ function subgraphDeployCommand() {
|
|
|
277589
277612
|
instance
|
|
277590
277613
|
});
|
|
277591
277614
|
const middleware = await settlemintClient.middleware.read(theGraphMiddleware.uniqueName);
|
|
277592
|
-
const graphEndpoints = await getGraphEndpoint(middleware, env2, graphName);
|
|
277615
|
+
const graphEndpoints = await getGraphEndpoint(settlemintClient, middleware, env2, graphName);
|
|
277593
277616
|
await writeEnvSpinner(!!prod, {
|
|
277594
277617
|
...env2,
|
|
277595
277618
|
SETTLEMINT_THEGRAPH: theGraphMiddleware.uniqueName,
|
|
@@ -277649,4 +277672,4 @@ function sdkCliCommand(exitOverride = undefined) {
|
|
|
277649
277672
|
ascii();
|
|
277650
277673
|
sdkCliCommand();
|
|
277651
277674
|
|
|
277652
|
-
//# debugId=
|
|
277675
|
+
//# debugId=40C482F4175C417364756E2164756E21
|