@settlemint/sdk-cli 1.0.0-mainf5733251 → 1.0.0-pr0552c9c8
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 +82 -105
- 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.Dg2fle7RIG:/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.Dg2fle7RIG:/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.Dg2fle7RIG:/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.Dg2fle7RIG:/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-pr0552c9c8",
|
|
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.Dg2fle7RIG:/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-pr0552c9c8",
|
|
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-pr0552c9c8",
|
|
256845
|
+
"@settlemint/sdk-utils": "1.0.0-pr0552c9c8",
|
|
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.Dg2fle7RIG:/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,6 +268203,37 @@ 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
|
+
}
|
|
268206
268237
|
async function retryWhenFailed(fn, maxRetries = 5, initialSleepTime = 3000, stopOnError) {
|
|
268207
268238
|
let attempt = 0;
|
|
268208
268239
|
while (attempt < maxRetries) {
|
|
@@ -268238,47 +268269,6 @@ async function fetchWithRetry(input, init, maxRetries = 5, initialSleepTime = 30
|
|
|
268238
268269
|
throw new Error(`HTTP error! status: ${response.status} ${response.statusText}`);
|
|
268239
268270
|
}, maxRetries, initialSleepTime);
|
|
268240
268271
|
}
|
|
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
|
-
}
|
|
268282
268272
|
function capitalizeFirstLetter(val) {
|
|
268283
268273
|
return String(val).charAt(0).toUpperCase() + String(val).slice(1);
|
|
268284
268274
|
}
|
|
@@ -268566,7 +268556,7 @@ async function testGqlEndpoint({
|
|
|
268566
268556
|
if (!gqlEndpoint) {
|
|
268567
268557
|
return false;
|
|
268568
268558
|
}
|
|
268569
|
-
await
|
|
268559
|
+
const response = await fetchWithRetry(gqlEndpoint, {
|
|
268570
268560
|
method: "POST",
|
|
268571
268561
|
headers: {
|
|
268572
268562
|
"x-auth-token": accessToken,
|
|
@@ -268585,6 +268575,10 @@ async function testGqlEndpoint({
|
|
|
268585
268575
|
`
|
|
268586
268576
|
})
|
|
268587
268577
|
});
|
|
268578
|
+
const data = await response.json();
|
|
268579
|
+
if (data.errors) {
|
|
268580
|
+
throw new Error("GraphQL errors in response");
|
|
268581
|
+
}
|
|
268588
268582
|
return true;
|
|
268589
268583
|
}
|
|
268590
268584
|
|
|
@@ -270854,7 +270848,7 @@ async function codegenBlockscout(env2) {
|
|
|
270854
270848
|
if (!accessToken) {
|
|
270855
270849
|
return;
|
|
270856
270850
|
}
|
|
270857
|
-
const
|
|
270851
|
+
const response = await fetch(endpoint, {
|
|
270858
270852
|
method: "POST",
|
|
270859
270853
|
headers: {
|
|
270860
270854
|
"x-auth-token": accessToken,
|
|
@@ -270963,8 +270957,15 @@ async function codegenBlockscout(env2) {
|
|
|
270963
270957
|
`
|
|
270964
270958
|
})
|
|
270965
270959
|
});
|
|
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
|
+
}
|
|
270966
270967
|
const introspectionJsonPath = resolve4(process.cwd(), "__blockscout-introspection__.json");
|
|
270967
|
-
await writeFile6(introspectionJsonPath, JSON.stringify(data));
|
|
270968
|
+
await writeFile6(introspectionJsonPath, JSON.stringify(data.data));
|
|
270968
270969
|
try {
|
|
270969
270970
|
await generateSchema({
|
|
270970
270971
|
input: basename(introspectionJsonPath),
|
|
@@ -271186,19 +271187,15 @@ async function writeEnvSpinner(prod, env2) {
|
|
|
271186
271187
|
}
|
|
271187
271188
|
|
|
271188
271189
|
// src/utils/get-cluster-service-endpoint.ts
|
|
271189
|
-
async function getGraphEndpoint(
|
|
271190
|
+
async function getGraphEndpoint(service, env2, graphName) {
|
|
271190
271191
|
if (!service || service.__typename !== "HAGraphMiddleware") {
|
|
271191
271192
|
return {};
|
|
271192
271193
|
}
|
|
271193
|
-
const middleware = await retryWhenFailed(() => settlemint.middleware.graphSubgraphs(service.uniqueName, !!graphName));
|
|
271194
|
-
if (!middleware || middleware.__typename !== "HAGraphMiddleware") {
|
|
271195
|
-
return {};
|
|
271196
|
-
}
|
|
271197
271194
|
const isStarterKit = (id) => id.endsWith("-starterkits");
|
|
271198
|
-
const testEndpoint =
|
|
271199
|
-
const starterKitEndpoint =
|
|
271195
|
+
const testEndpoint = service.subgraphs.find(({ graphqlQueryEndpoint }) => graphName ? graphqlQueryEndpoint?.id.endsWith(graphName) : !isStarterKit(graphqlQueryEndpoint?.id))?.graphqlQueryEndpoint?.displayValue;
|
|
271196
|
+
const starterKitEndpoint = service.subgraphs.find(({ graphqlQueryEndpoint }) => isStarterKit(graphqlQueryEndpoint?.id))?.graphqlQueryEndpoint?.displayValue;
|
|
271200
271197
|
const hasEndpoint = testEndpoint && env2.SETTLEMINT_ACCESS_TOKEN ? await testGqlEndpoint({ accessToken: env2.SETTLEMINT_ACCESS_TOKEN, gqlEndpoint: testEndpoint }) : false;
|
|
271201
|
-
const endpoints = hasEndpoint ?
|
|
271198
|
+
const endpoints = hasEndpoint ? service.subgraphs.map(({ graphqlQueryEndpoint }) => graphqlQueryEndpoint?.displayValue) : starterKitEndpoint ? [starterKitEndpoint] : [];
|
|
271202
271199
|
if (endpoints.length === 0) {
|
|
271203
271200
|
return {};
|
|
271204
271201
|
}
|
|
@@ -272944,11 +272941,18 @@ var MiddlewareFragment = graphql(`
|
|
|
272944
272941
|
}
|
|
272945
272942
|
... on HAGraphMiddleware {
|
|
272946
272943
|
specVersion
|
|
272944
|
+
subgraphs(noCache: $noCache) {
|
|
272945
|
+
name
|
|
272946
|
+
graphqlQueryEndpoint {
|
|
272947
|
+
displayValue
|
|
272948
|
+
id
|
|
272949
|
+
}
|
|
272950
|
+
}
|
|
272947
272951
|
}
|
|
272948
272952
|
}
|
|
272949
272953
|
`);
|
|
272950
272954
|
var getMiddlewares = graphql(`
|
|
272951
|
-
query GetMiddlewares($applicationUniqueName: String
|
|
272955
|
+
query GetMiddlewares($applicationUniqueName: String!, $noCache: Boolean = false) {
|
|
272952
272956
|
middlewaresByUniqueName(applicationUniqueName: $applicationUniqueName) {
|
|
272953
272957
|
items {
|
|
272954
272958
|
...Middleware
|
|
@@ -272957,25 +272961,9 @@ var getMiddlewares = graphql(`
|
|
|
272957
272961
|
}
|
|
272958
272962
|
`, [MiddlewareFragment]);
|
|
272959
272963
|
var getMiddleware = graphql(`
|
|
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) {
|
|
272964
|
+
query GetMiddleware($uniqueName: String!, $noCache: Boolean = true) {
|
|
272968
272965
|
middlewareByUniqueName(uniqueName: $uniqueName) {
|
|
272969
272966
|
...Middleware
|
|
272970
|
-
... on HAGraphMiddleware {
|
|
272971
|
-
subgraphs(noCache: $noCache) {
|
|
272972
|
-
name
|
|
272973
|
-
graphqlQueryEndpoint {
|
|
272974
|
-
displayValue
|
|
272975
|
-
id
|
|
272976
|
-
}
|
|
272977
|
-
}
|
|
272978
|
-
}
|
|
272979
272967
|
}
|
|
272980
272968
|
}
|
|
272981
272969
|
`, [MiddlewareFragment]);
|
|
@@ -272993,6 +272981,7 @@ var createMiddleware = graphql(`
|
|
|
272993
272981
|
$loadBalancerId: ID
|
|
272994
272982
|
$abis: [SmartContractPortalMiddlewareAbiInputDto!]
|
|
272995
272983
|
$includePredeployedAbis: [String!]
|
|
272984
|
+
$noCache: Boolean = false
|
|
272996
272985
|
) {
|
|
272997
272986
|
createMiddleware(
|
|
272998
272987
|
applicationId: $applicationId
|
|
@@ -273013,7 +273002,7 @@ var createMiddleware = graphql(`
|
|
|
273013
273002
|
}
|
|
273014
273003
|
`, [MiddlewareFragment]);
|
|
273015
273004
|
var restartMiddleware = graphql(`
|
|
273016
|
-
mutation RestartMiddleware($uniqueName: String
|
|
273005
|
+
mutation RestartMiddleware($uniqueName: String!, $noCache: Boolean = false) {
|
|
273017
273006
|
restartMiddlewareByUniqueName(uniqueName: $uniqueName) {
|
|
273018
273007
|
...Middleware
|
|
273019
273008
|
}
|
|
@@ -273035,15 +273024,6 @@ var middlewareRead = (gqlClient) => {
|
|
|
273035
273024
|
return middleware;
|
|
273036
273025
|
};
|
|
273037
273026
|
};
|
|
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
|
-
};
|
|
273047
273027
|
var middlewareCreate = (gqlClient) => {
|
|
273048
273028
|
return async (args) => {
|
|
273049
273029
|
const { applicationUniqueName, blockchainNodeUniqueName, loadBalancerUniqueName, storageUniqueName, ...otherArgs } = args;
|
|
@@ -273242,7 +273222,6 @@ function createSettleMintClient(options) {
|
|
|
273242
273222
|
middleware: {
|
|
273243
273223
|
list: middlewareList(gqlClient),
|
|
273244
273224
|
read: middlewareRead(gqlClient),
|
|
273245
|
-
graphSubgraphs: graphMiddlewareSubgraphs(gqlClient),
|
|
273246
273225
|
create: middlewareCreate(gqlClient),
|
|
273247
273226
|
restart: middlewareRestart(gqlClient)
|
|
273248
273227
|
},
|
|
@@ -273739,23 +273718,18 @@ async function hdPrivateKeyPrompt({
|
|
|
273739
273718
|
}
|
|
273740
273719
|
|
|
273741
273720
|
// src/commands/connect/instance.prompt.ts
|
|
273742
|
-
async function instancePrompt(env2, accept, freeTextInput = false
|
|
273721
|
+
async function instancePrompt(env2, accept, freeTextInput = false) {
|
|
273743
273722
|
const knownInstances = await getInstances();
|
|
273744
|
-
const autoAccept = !!accept ||
|
|
273745
|
-
const defaultInstance = env2.SETTLEMINT_INSTANCE;
|
|
273723
|
+
const autoAccept = !!accept || is_in_ci_default;
|
|
273724
|
+
const defaultInstance = env2.SETTLEMINT_INSTANCE ?? knownInstances[0] ?? "https://console.settlemint.com";
|
|
273746
273725
|
const defaultPossible = autoAccept && defaultInstance;
|
|
273747
273726
|
if (defaultPossible) {
|
|
273748
273727
|
return defaultInstance;
|
|
273749
273728
|
}
|
|
273750
|
-
const defaultLoginInstance = await getDefaultInstance();
|
|
273751
|
-
const defaultPromptInstance = defaultInstance ?? defaultLoginInstance ?? "https://console.settlemint.com";
|
|
273752
|
-
if (isCi) {
|
|
273753
|
-
return defaultPromptInstance;
|
|
273754
|
-
}
|
|
273755
273729
|
if (freeTextInput) {
|
|
273756
273730
|
const instance = await esm_default4({
|
|
273757
273731
|
message: "What is the URL of your SettleMint instance?",
|
|
273758
|
-
default:
|
|
273732
|
+
default: defaultInstance,
|
|
273759
273733
|
required: true,
|
|
273760
273734
|
validate(value4) {
|
|
273761
273735
|
try {
|
|
@@ -273783,7 +273757,7 @@ async function instancePrompt(env2, accept, freeTextInput = false, isCi = is_in_
|
|
|
273783
273757
|
value: instance
|
|
273784
273758
|
}))
|
|
273785
273759
|
],
|
|
273786
|
-
default:
|
|
273760
|
+
default: defaultInstance
|
|
273787
273761
|
});
|
|
273788
273762
|
}
|
|
273789
273763
|
|
|
@@ -274047,7 +274021,7 @@ function connectCommand() {
|
|
|
274047
274021
|
SETTLEMINT_HASURA: hasura?.uniqueName,
|
|
274048
274022
|
...getHasuraEndpoints(hasura),
|
|
274049
274023
|
SETTLEMINT_THEGRAPH: thegraph?.uniqueName,
|
|
274050
|
-
...await getGraphEndpoint(
|
|
274024
|
+
...await getGraphEndpoint(thegraph, env2),
|
|
274051
274025
|
SETTLEMINT_PORTAL: portal?.uniqueName,
|
|
274052
274026
|
...getPortalEndpoints(portal),
|
|
274053
274027
|
SETTLEMINT_HD_PRIVATE_KEY: hdPrivateKey?.uniqueName,
|
|
@@ -274958,6 +274932,9 @@ function loginCommand() {
|
|
|
274958
274932
|
intro("Login to your SettleMint account");
|
|
274959
274933
|
const autoAccept = !!acceptDefaults || !!tokenStdin;
|
|
274960
274934
|
const env2 = await loadEnv2(false, false);
|
|
274935
|
+
if (instance) {
|
|
274936
|
+
validate3(UrlSchema, instance);
|
|
274937
|
+
}
|
|
274961
274938
|
const selectedInstance = instance ? sanitizeAndValidateInstanceUrl(instance) : await instancePrompt(env2, autoAccept, true);
|
|
274962
274939
|
let personalAccessToken = "";
|
|
274963
274940
|
if (tokenStdin) {
|
|
@@ -275938,7 +275915,7 @@ function graphMiddlewareCreateCommand() {
|
|
|
275938
275915
|
return {
|
|
275939
275916
|
SETTLEMINT_APPLICATION: applicationUniqueName,
|
|
275940
275917
|
SETTLEMINT_THEGRAPH: result.uniqueName,
|
|
275941
|
-
...await getGraphEndpoint(
|
|
275918
|
+
...await getGraphEndpoint(graphMiddleware, env2)
|
|
275942
275919
|
};
|
|
275943
275920
|
}
|
|
275944
275921
|
};
|
|
@@ -277612,7 +277589,7 @@ function subgraphDeployCommand() {
|
|
|
277612
277589
|
instance
|
|
277613
277590
|
});
|
|
277614
277591
|
const middleware = await settlemintClient.middleware.read(theGraphMiddleware.uniqueName);
|
|
277615
|
-
const graphEndpoints = await getGraphEndpoint(
|
|
277592
|
+
const graphEndpoints = await getGraphEndpoint(middleware, env2, graphName);
|
|
277616
277593
|
await writeEnvSpinner(!!prod, {
|
|
277617
277594
|
...env2,
|
|
277618
277595
|
SETTLEMINT_THEGRAPH: theGraphMiddleware.uniqueName,
|
|
@@ -277672,4 +277649,4 @@ function sdkCliCommand(exitOverride = undefined) {
|
|
|
277672
277649
|
ascii();
|
|
277673
277650
|
sdkCliCommand();
|
|
277674
277651
|
|
|
277675
|
-
//# debugId=
|
|
277652
|
+
//# debugId=CAB12221082709C764756E2164756E21
|