@settlemint/sdk-cli 1.0.0-mainf5733251 → 1.0.0-mainfa7f92bd
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 +74 -95
- package/dist/cli.js.map +10 -10
- 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.aoXLz3tjxv:/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.aoXLz3tjxv:/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.aoXLz3tjxv:/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.aoXLz3tjxv:/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-mainfa7f92bd",
|
|
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.aoXLz3tjxv:/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-mainfa7f92bd",
|
|
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-mainfa7f92bd",
|
|
256845
|
+
"@settlemint/sdk-utils": "1.0.0-mainfa7f92bd",
|
|
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.aoXLz3tjxv:/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,28 +272961,12 @@ var getMiddlewares = graphql(`
|
|
|
272957
272961
|
}
|
|
272958
272962
|
`, [MiddlewareFragment]);
|
|
272959
272963
|
var getMiddleware = graphql(`
|
|
272960
|
-
query GetMiddleware($uniqueName: String
|
|
272964
|
+
query GetMiddleware($uniqueName: String!, $noCache: Boolean = true) {
|
|
272961
272965
|
middlewareByUniqueName(uniqueName: $uniqueName) {
|
|
272962
272966
|
...Middleware
|
|
272963
272967
|
}
|
|
272964
272968
|
}
|
|
272965
272969
|
`, [MiddlewareFragment]);
|
|
272966
|
-
var getGraphMiddlewareSubgraphs = graphql(`
|
|
272967
|
-
query GetMiddleware($uniqueName: String!, $noCache: Boolean) {
|
|
272968
|
-
middlewareByUniqueName(uniqueName: $uniqueName) {
|
|
272969
|
-
...Middleware
|
|
272970
|
-
... on HAGraphMiddleware {
|
|
272971
|
-
subgraphs(noCache: $noCache) {
|
|
272972
|
-
name
|
|
272973
|
-
graphqlQueryEndpoint {
|
|
272974
|
-
displayValue
|
|
272975
|
-
id
|
|
272976
|
-
}
|
|
272977
|
-
}
|
|
272978
|
-
}
|
|
272979
|
-
}
|
|
272980
|
-
}
|
|
272981
|
-
`, [MiddlewareFragment]);
|
|
272982
272970
|
var createMiddleware = graphql(`
|
|
272983
272971
|
mutation CreateMiddleware(
|
|
272984
272972
|
$applicationId: ID!
|
|
@@ -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
|
},
|
|
@@ -274047,7 +274026,7 @@ function connectCommand() {
|
|
|
274047
274026
|
SETTLEMINT_HASURA: hasura?.uniqueName,
|
|
274048
274027
|
...getHasuraEndpoints(hasura),
|
|
274049
274028
|
SETTLEMINT_THEGRAPH: thegraph?.uniqueName,
|
|
274050
|
-
...await getGraphEndpoint(
|
|
274029
|
+
...await getGraphEndpoint(thegraph, env2),
|
|
274051
274030
|
SETTLEMINT_PORTAL: portal?.uniqueName,
|
|
274052
274031
|
...getPortalEndpoints(portal),
|
|
274053
274032
|
SETTLEMINT_HD_PRIVATE_KEY: hdPrivateKey?.uniqueName,
|
|
@@ -275938,7 +275917,7 @@ function graphMiddlewareCreateCommand() {
|
|
|
275938
275917
|
return {
|
|
275939
275918
|
SETTLEMINT_APPLICATION: applicationUniqueName,
|
|
275940
275919
|
SETTLEMINT_THEGRAPH: result.uniqueName,
|
|
275941
|
-
...await getGraphEndpoint(
|
|
275920
|
+
...await getGraphEndpoint(graphMiddleware, env2)
|
|
275942
275921
|
};
|
|
275943
275922
|
}
|
|
275944
275923
|
};
|
|
@@ -277612,7 +277591,7 @@ function subgraphDeployCommand() {
|
|
|
277612
277591
|
instance
|
|
277613
277592
|
});
|
|
277614
277593
|
const middleware = await settlemintClient.middleware.read(theGraphMiddleware.uniqueName);
|
|
277615
|
-
const graphEndpoints = await getGraphEndpoint(
|
|
277594
|
+
const graphEndpoints = await getGraphEndpoint(middleware, env2, graphName);
|
|
277616
277595
|
await writeEnvSpinner(!!prod, {
|
|
277617
277596
|
...env2,
|
|
277618
277597
|
SETTLEMINT_THEGRAPH: theGraphMiddleware.uniqueName,
|
|
@@ -277672,4 +277651,4 @@ function sdkCliCommand(exitOverride = undefined) {
|
|
|
277672
277651
|
ascii();
|
|
277673
277652
|
sdkCliCommand();
|
|
277674
277653
|
|
|
277675
|
-
//# debugId=
|
|
277654
|
+
//# debugId=07F3F21BB816D37F64756E2164756E21
|