@settlemint/sdk-cli 1.0.0-prcaa712c1 → 1.0.0-prd58fd4d0
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/README.md +1 -1
- package/dist/cli.js +357 -256
- package/dist/cli.js.map +9 -8
- package/package.json +8 -8
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.lFNccQTBKb:/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.lFNccQTBKb:/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.lFNccQTBKb:/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.lFNccQTBKb:/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-prd58fd4d0",
|
|
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.lFNccQTBKb:/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-prd58fd4d0",
|
|
256792
256792
|
type: "module",
|
|
256793
256793
|
private: false,
|
|
256794
256794
|
license: "FSL-1.1-MIT",
|
|
@@ -256828,7 +256828,7 @@ var package_default = {
|
|
|
256828
256828
|
prepack: "cp ../../LICENSE ."
|
|
256829
256829
|
},
|
|
256830
256830
|
dependencies: {
|
|
256831
|
-
hardhat: "2.22.
|
|
256831
|
+
hardhat: "2.22.18"
|
|
256832
256832
|
},
|
|
256833
256833
|
devDependencies: {
|
|
256834
256834
|
"@types/semver": "7.5.8",
|
|
@@ -256837,12 +256837,12 @@ var package_default = {
|
|
|
256837
256837
|
slugify: "1.6.6",
|
|
256838
256838
|
yoctocolors: "2.1.1",
|
|
256839
256839
|
"@commander-js/extra-typings": "13.0.0",
|
|
256840
|
-
"@inquirer/confirm": "5.1.
|
|
256841
|
-
"@inquirer/input": "4.1.
|
|
256842
|
-
"@inquirer/password": "4.0.
|
|
256843
|
-
"@inquirer/select": "4.0.
|
|
256844
|
-
"@settlemint/sdk-js": "1.0.0-
|
|
256845
|
-
"@settlemint/sdk-utils": "1.0.0-
|
|
256840
|
+
"@inquirer/confirm": "5.1.3",
|
|
256841
|
+
"@inquirer/input": "4.1.3",
|
|
256842
|
+
"@inquirer/password": "4.0.6",
|
|
256843
|
+
"@inquirer/select": "4.0.6",
|
|
256844
|
+
"@settlemint/sdk-js": "1.0.0-prd58fd4d0",
|
|
256845
|
+
"@settlemint/sdk-utils": "1.0.0-prd58fd4d0",
|
|
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.lFNccQTBKb:/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,
|
|
@@ -270831,6 +270831,39 @@ function stringify2(obj) {
|
|
|
270831
270831
|
`);
|
|
270832
270832
|
}
|
|
270833
270833
|
|
|
270834
|
+
// src/utils/telemetry.ts
|
|
270835
|
+
async function telemetry(data) {
|
|
270836
|
+
if (process.env.SETTLEMINT_DISABLE_TELEMETRY) {
|
|
270837
|
+
return;
|
|
270838
|
+
}
|
|
270839
|
+
try {
|
|
270840
|
+
const { prod, command, status, message, instance } = data;
|
|
270841
|
+
const env2 = await loadEnv2(false, !!prod);
|
|
270842
|
+
const targetInstance = instance ?? env2.SETTLEMINT_INSTANCE;
|
|
270843
|
+
if (!targetInstance) {
|
|
270844
|
+
return;
|
|
270845
|
+
}
|
|
270846
|
+
const controller = new AbortController;
|
|
270847
|
+
const timeout = setTimeout(() => controller.abort(), 500);
|
|
270848
|
+
await fetch(`${targetInstance}/api/telemetry`, {
|
|
270849
|
+
method: "POST",
|
|
270850
|
+
headers: {
|
|
270851
|
+
"Content-Type": "application/json"
|
|
270852
|
+
},
|
|
270853
|
+
body: JSON.stringify({
|
|
270854
|
+
command,
|
|
270855
|
+
status,
|
|
270856
|
+
message,
|
|
270857
|
+
workspace: env2.SETTLEMINT_WORKSPACE,
|
|
270858
|
+
application: env2.SETTLEMINT_APPLICATION
|
|
270859
|
+
}),
|
|
270860
|
+
signal: controller.signal
|
|
270861
|
+
});
|
|
270862
|
+
clearTimeout(timeout);
|
|
270863
|
+
} catch {
|
|
270864
|
+
}
|
|
270865
|
+
}
|
|
270866
|
+
|
|
270834
270867
|
// src/commands/codegen/codegen-blockscout.ts
|
|
270835
270868
|
import { rm, writeFile as writeFile6 } from "node:fs/promises";
|
|
270836
270869
|
import { basename, resolve as resolve4 } from "node:path";
|
|
@@ -271078,53 +271111,66 @@ function codegenCommand() {
|
|
|
271078
271111
|
}
|
|
271079
271112
|
])).action(async ({ prod, thegraphSubgraphNames }) => {
|
|
271080
271113
|
intro("Generating GraphQL types and queries for your dApp");
|
|
271081
|
-
|
|
271082
|
-
|
|
271083
|
-
|
|
271084
|
-
|
|
271085
|
-
|
|
271086
|
-
|
|
271087
|
-
|
|
271088
|
-
|
|
271089
|
-
|
|
271090
|
-
|
|
271091
|
-
|
|
271092
|
-
|
|
271093
|
-
|
|
271094
|
-
|
|
271095
|
-
|
|
271096
|
-
|
|
271097
|
-
|
|
271098
|
-
|
|
271099
|
-
|
|
271100
|
-
|
|
271101
|
-
|
|
271102
|
-
|
|
271103
|
-
|
|
271104
|
-
|
|
271105
|
-
|
|
271106
|
-
|
|
271107
|
-
|
|
271108
|
-
|
|
271109
|
-
|
|
271110
|
-
|
|
271111
|
-
|
|
271112
|
-
|
|
271113
|
-
|
|
271114
|
-
|
|
271115
|
-
|
|
271116
|
-
|
|
271117
|
-
|
|
271118
|
-
|
|
271119
|
-
|
|
271120
|
-
|
|
271121
|
-
|
|
271122
|
-
|
|
271123
|
-
|
|
271124
|
-
|
|
271114
|
+
try {
|
|
271115
|
+
const env2 = await loadEnv2(true, !!prod);
|
|
271116
|
+
if (!Array.isArray(thegraphSubgraphNames)) {
|
|
271117
|
+
thegraphSubgraphNames = await subgraphNamePrompt(env2);
|
|
271118
|
+
}
|
|
271119
|
+
const { hasura, portal, thegraph, blockscout } = await spinner({
|
|
271120
|
+
startMessage: "Testing configured GraphQL schema",
|
|
271121
|
+
task: async () => {
|
|
271122
|
+
return codegenTsconfig(env2, thegraphSubgraphNames);
|
|
271123
|
+
},
|
|
271124
|
+
stopMessage: "Tested GraphQL schemas"
|
|
271125
|
+
});
|
|
271126
|
+
const promises = [];
|
|
271127
|
+
if (hasura) {
|
|
271128
|
+
note("Generating Hasura resources");
|
|
271129
|
+
promises.push(codegenHasura(env2));
|
|
271130
|
+
}
|
|
271131
|
+
if (portal) {
|
|
271132
|
+
note("Generating Portal resources");
|
|
271133
|
+
promises.push(codegenPortal(env2));
|
|
271134
|
+
}
|
|
271135
|
+
if (thegraph) {
|
|
271136
|
+
note("Generating TheGraph resources");
|
|
271137
|
+
promises.push(codegenTheGraph(env2, thegraphSubgraphNames));
|
|
271138
|
+
}
|
|
271139
|
+
if (blockscout) {
|
|
271140
|
+
note("Generating Blockscout resources");
|
|
271141
|
+
promises.push(codegenBlockscout(env2));
|
|
271142
|
+
}
|
|
271143
|
+
if (shouldCodegenMinio(env2)) {
|
|
271144
|
+
note("Generating Minio resources");
|
|
271145
|
+
promises.push(codegenMinio(env2));
|
|
271146
|
+
}
|
|
271147
|
+
if (shouldCodegenIpfs(env2)) {
|
|
271148
|
+
note("Generating IPFS resources");
|
|
271149
|
+
promises.push(codegenIpfs(env2));
|
|
271150
|
+
}
|
|
271151
|
+
const results = await Promise.allSettled(promises);
|
|
271152
|
+
if (results.some((r6) => r6.status === "rejected")) {
|
|
271153
|
+
cancel("An error occurred while generating resources");
|
|
271154
|
+
}
|
|
271155
|
+
if (hasura || portal || thegraph || blockscout) {
|
|
271156
|
+
await generateOutput({
|
|
271157
|
+
output: undefined,
|
|
271158
|
+
tsconfig: undefined
|
|
271159
|
+
});
|
|
271160
|
+
}
|
|
271161
|
+
outro("Codegen complete");
|
|
271162
|
+
await telemetry({
|
|
271163
|
+
command: "codegen",
|
|
271164
|
+
status: "success"
|
|
271165
|
+
});
|
|
271166
|
+
} catch (error5) {
|
|
271167
|
+
await telemetry({
|
|
271168
|
+
command: "codegen",
|
|
271169
|
+
status: "error",
|
|
271170
|
+
message: error5.message
|
|
271125
271171
|
});
|
|
271172
|
+
throw error5;
|
|
271126
271173
|
}
|
|
271127
|
-
outro("Codegen complete");
|
|
271128
271174
|
});
|
|
271129
271175
|
}
|
|
271130
271176
|
|
|
@@ -273929,112 +273975,125 @@ async function workspacePrompt(env2, workspaces, accept) {
|
|
|
273929
273975
|
// src/commands/connect.ts
|
|
273930
273976
|
function connectCommand() {
|
|
273931
273977
|
return new Command("connect").option("--prod", "Connect to your production environment").option("-a, --accept-defaults", "Accept the default and previously set values").option("-i, --instance <instance>", "The instance to connect to (defaults to the instance in the .env file)").description("Connects your project to your application on SettleMint").action(async ({ acceptDefaults, prod, instance }) => {
|
|
273932
|
-
|
|
273933
|
-
|
|
273934
|
-
|
|
273935
|
-
|
|
273936
|
-
|
|
273937
|
-
|
|
273938
|
-
|
|
273939
|
-
|
|
273940
|
-
|
|
273941
|
-
|
|
273942
|
-
|
|
273943
|
-
|
|
273944
|
-
|
|
273945
|
-
|
|
273946
|
-
|
|
273947
|
-
|
|
273948
|
-
|
|
273949
|
-
|
|
273950
|
-
|
|
273951
|
-
|
|
273952
|
-
|
|
273953
|
-
|
|
273954
|
-
|
|
273955
|
-
|
|
273956
|
-
|
|
273957
|
-
|
|
273958
|
-
|
|
273959
|
-
|
|
273960
|
-
|
|
273961
|
-
|
|
273962
|
-
|
|
273963
|
-
|
|
273964
|
-
|
|
273965
|
-
|
|
273966
|
-
|
|
273967
|
-
|
|
273968
|
-
|
|
273969
|
-
|
|
273970
|
-
|
|
273971
|
-
|
|
273972
|
-
|
|
273973
|
-
|
|
273974
|
-
|
|
273975
|
-
|
|
273976
|
-
|
|
273977
|
-
|
|
273978
|
-
|
|
273979
|
-
|
|
273980
|
-
|
|
273981
|
-
|
|
273982
|
-
|
|
273983
|
-
|
|
273984
|
-
|
|
273985
|
-
|
|
273986
|
-
|
|
273987
|
-
|
|
273988
|
-
|
|
273989
|
-
|
|
273990
|
-
|
|
273991
|
-
|
|
273992
|
-
|
|
273993
|
-
|
|
273994
|
-
|
|
273995
|
-
|
|
273996
|
-
|
|
273997
|
-
|
|
273998
|
-
|
|
273999
|
-
|
|
274000
|
-
|
|
274001
|
-
|
|
274002
|
-
|
|
274003
|
-
|
|
274004
|
-
|
|
274005
|
-
|
|
274006
|
-
|
|
274007
|
-
|
|
274008
|
-
|
|
274009
|
-
|
|
273978
|
+
try {
|
|
273979
|
+
intro("Connecting your dApp to SettleMint");
|
|
273980
|
+
const env2 = await loadEnv2(false, !!prod);
|
|
273981
|
+
const selectedInstance = instance ? sanitizeAndValidateInstanceUrl(instance) : await instancePrompt(env2, true);
|
|
273982
|
+
const personalAccessToken = await getInstanceCredentials(selectedInstance);
|
|
273983
|
+
if (!personalAccessToken) {
|
|
273984
|
+
return missingPersonalAccessTokenError();
|
|
273985
|
+
}
|
|
273986
|
+
const accessToken = personalAccessToken.personalAccessToken;
|
|
273987
|
+
const settlemint = createSettleMintClient({
|
|
273988
|
+
accessToken,
|
|
273989
|
+
instance: selectedInstance
|
|
273990
|
+
});
|
|
273991
|
+
const workspaces = await workspaceSpinner(settlemint);
|
|
273992
|
+
const workspace = await workspacePrompt(env2, workspaces, acceptDefaults);
|
|
273993
|
+
const application = await applicationPrompt(env2, workspace?.applications ?? [], acceptDefaults);
|
|
273994
|
+
const aatToken = await applicationAccessTokenPrompt(env2, application, settlemint, acceptDefaults);
|
|
273995
|
+
const { middlewares, integrationTools, storages, privateKeys, insights, customDeployments, blockchainNodes } = await servicesSpinner(settlemint, application);
|
|
273996
|
+
const blockchainNode = await blockchainNodePrompt({
|
|
273997
|
+
env: env2,
|
|
273998
|
+
nodes: blockchainNodes,
|
|
273999
|
+
accept: acceptDefaults
|
|
274000
|
+
});
|
|
274001
|
+
const hasura = await hasuraPrompt({
|
|
274002
|
+
env: env2,
|
|
274003
|
+
integrations: integrationTools,
|
|
274004
|
+
accept: acceptDefaults
|
|
274005
|
+
});
|
|
274006
|
+
const thegraph = await theGraphPrompt({
|
|
274007
|
+
env: env2,
|
|
274008
|
+
middlewares,
|
|
274009
|
+
accept: acceptDefaults
|
|
274010
|
+
});
|
|
274011
|
+
const portal = await portalPrompt({
|
|
274012
|
+
env: env2,
|
|
274013
|
+
middlewares,
|
|
274014
|
+
accept: acceptDefaults
|
|
274015
|
+
});
|
|
274016
|
+
const ipfs = await ipfsPrompt({
|
|
274017
|
+
env: env2,
|
|
274018
|
+
storages,
|
|
274019
|
+
accept: acceptDefaults
|
|
274020
|
+
});
|
|
274021
|
+
const minio = await minioPrompt({
|
|
274022
|
+
env: env2,
|
|
274023
|
+
storages,
|
|
274024
|
+
accept: acceptDefaults
|
|
274025
|
+
});
|
|
274026
|
+
const hdPrivateKey = await hdPrivateKeyPrompt({
|
|
274027
|
+
env: env2,
|
|
274028
|
+
privateKeys,
|
|
274029
|
+
accept: acceptDefaults
|
|
274030
|
+
});
|
|
274031
|
+
const cDeployment = await customDeploymentPrompt({
|
|
274032
|
+
env: env2,
|
|
274033
|
+
customDeployments,
|
|
274034
|
+
accept: acceptDefaults
|
|
274035
|
+
});
|
|
274036
|
+
const blockscout = await blockscoutPrompt({
|
|
274037
|
+
env: env2,
|
|
274038
|
+
insights,
|
|
274039
|
+
accept: acceptDefaults
|
|
274040
|
+
});
|
|
274041
|
+
if (acceptDefaults) {
|
|
274042
|
+
const selectedServices = [
|
|
274043
|
+
`Workspace: ${workspace.name}`,
|
|
274044
|
+
`Application: ${application.name}`,
|
|
274045
|
+
blockchainNode && `Blockchain Network: ${blockchainNode?.blockchainNetwork?.name}`,
|
|
274046
|
+
blockchainNode && `Blockchain Node: ${blockchainNode?.name}`,
|
|
274047
|
+
hasura && `Hasura: ${hasura?.name}`,
|
|
274048
|
+
thegraph && `TheGraph: ${thegraph?.name}`,
|
|
274049
|
+
portal && `Portal: ${portal?.name}`,
|
|
274050
|
+
ipfs && `IPFS: ${ipfs?.name}`,
|
|
274051
|
+
minio && `MinIO: ${minio?.name}`,
|
|
274052
|
+
hdPrivateKey && `HD Private Key: ${hdPrivateKey?.name}`,
|
|
274053
|
+
cDeployment && `Custom Deployment: ${cDeployment?.name}`,
|
|
274054
|
+
blockscout && `Blockscout: ${blockscout?.name}`
|
|
274055
|
+
];
|
|
274056
|
+
note2(`Selected services:
|
|
274010
274057
|
• ${selectedServices.filter(Boolean).join(`
|
|
274011
274058
|
• `)}
|
|
274012
274059
|
`);
|
|
274060
|
+
}
|
|
274061
|
+
await writeEnvSpinner(!!prod, {
|
|
274062
|
+
SETTLEMINT_ACCESS_TOKEN: aatToken,
|
|
274063
|
+
SETTLEMINT_INSTANCE: selectedInstance,
|
|
274064
|
+
SETTLEMINT_WORKSPACE: workspace.uniqueName,
|
|
274065
|
+
SETTLEMINT_APPLICATION: application.uniqueName,
|
|
274066
|
+
SETTLEMINT_BLOCKCHAIN_NETWORK: blockchainNode?.blockchainNetwork?.uniqueName,
|
|
274067
|
+
SETTLEMINT_BLOCKCHAIN_NODE: blockchainNode?.uniqueName,
|
|
274068
|
+
SETTLEMINT_HASURA: hasura?.uniqueName,
|
|
274069
|
+
...getHasuraEndpoints(hasura),
|
|
274070
|
+
SETTLEMINT_THEGRAPH: thegraph?.uniqueName,
|
|
274071
|
+
...await getGraphEndpoint(thegraph, env2),
|
|
274072
|
+
SETTLEMINT_PORTAL: portal?.uniqueName,
|
|
274073
|
+
...getPortalEndpoints(portal),
|
|
274074
|
+
SETTLEMINT_HD_PRIVATE_KEY: hdPrivateKey?.uniqueName,
|
|
274075
|
+
SETTLEMINT_MINIO: minio?.uniqueName,
|
|
274076
|
+
...getMinioEndpoints(minio),
|
|
274077
|
+
SETTLEMINT_IPFS: ipfs?.uniqueName,
|
|
274078
|
+
...getIpfsEndpoints(ipfs),
|
|
274079
|
+
SETTLEMINT_CUSTOM_DEPLOYMENT: cDeployment?.uniqueName,
|
|
274080
|
+
SETTLEMINT_CUSTOM_DEPLOYMENT_ENDPOINT: cDeployment?.endpoints.find((endpoint) => endpoint.id.includes("internal"))?.displayValue,
|
|
274081
|
+
SETTLEMINT_BLOCKSCOUT: blockscout?.uniqueName,
|
|
274082
|
+
...getBlockscoutEndpoints(blockscout)
|
|
274083
|
+
});
|
|
274084
|
+
outro("Connected to SettleMint");
|
|
274085
|
+
await telemetry({
|
|
274086
|
+
command: "connect",
|
|
274087
|
+
status: "success"
|
|
274088
|
+
});
|
|
274089
|
+
} catch (error5) {
|
|
274090
|
+
await telemetry({
|
|
274091
|
+
command: "connect",
|
|
274092
|
+
status: "error",
|
|
274093
|
+
message: error5.message
|
|
274094
|
+
});
|
|
274095
|
+
throw error5;
|
|
274013
274096
|
}
|
|
274014
|
-
await writeEnvSpinner(!!prod, {
|
|
274015
|
-
SETTLEMINT_ACCESS_TOKEN: aatToken,
|
|
274016
|
-
SETTLEMINT_INSTANCE: selectedInstance,
|
|
274017
|
-
SETTLEMINT_WORKSPACE: workspace.uniqueName,
|
|
274018
|
-
SETTLEMINT_APPLICATION: application.uniqueName,
|
|
274019
|
-
SETTLEMINT_BLOCKCHAIN_NETWORK: blockchainNode?.blockchainNetwork?.uniqueName,
|
|
274020
|
-
SETTLEMINT_BLOCKCHAIN_NODE: blockchainNode?.uniqueName,
|
|
274021
|
-
SETTLEMINT_HASURA: hasura?.uniqueName,
|
|
274022
|
-
...getHasuraEndpoints(hasura),
|
|
274023
|
-
SETTLEMINT_THEGRAPH: thegraph?.uniqueName,
|
|
274024
|
-
...await getGraphEndpoint(thegraph, env2),
|
|
274025
|
-
SETTLEMINT_PORTAL: portal?.uniqueName,
|
|
274026
|
-
...getPortalEndpoints(portal),
|
|
274027
|
-
SETTLEMINT_HD_PRIVATE_KEY: hdPrivateKey?.uniqueName,
|
|
274028
|
-
SETTLEMINT_MINIO: minio?.uniqueName,
|
|
274029
|
-
...getMinioEndpoints(minio),
|
|
274030
|
-
SETTLEMINT_IPFS: ipfs?.uniqueName,
|
|
274031
|
-
...getIpfsEndpoints(ipfs),
|
|
274032
|
-
SETTLEMINT_CUSTOM_DEPLOYMENT: cDeployment?.uniqueName,
|
|
274033
|
-
SETTLEMINT_CUSTOM_DEPLOYMENT_ENDPOINT: cDeployment?.endpoints.find((endpoint) => endpoint.id.includes("internal"))?.displayValue,
|
|
274034
|
-
SETTLEMINT_BLOCKSCOUT: blockscout?.uniqueName,
|
|
274035
|
-
...getBlockscoutEndpoints(blockscout)
|
|
274036
|
-
});
|
|
274037
|
-
outro("Connected to SettleMint");
|
|
274038
274097
|
});
|
|
274039
274098
|
}
|
|
274040
274099
|
|
|
@@ -274842,36 +274901,50 @@ async function downloadAndExtractNpmPackage(template, targetDir) {
|
|
|
274842
274901
|
function createCommand2() {
|
|
274843
274902
|
return new Command("create").description("Bootstrap your SettleMint project").option("-n, --project-name <name>", "The name for your SettleMint project").addOption(new Option("-t, --template <template>", "Thehe template for your SettleMint project").choices(templates.map((templates2) => templates2.value))).action(async ({ projectName, template }) => {
|
|
274844
274903
|
intro("Creating a new SettleMint project");
|
|
274845
|
-
|
|
274846
|
-
|
|
274847
|
-
|
|
274848
|
-
|
|
274849
|
-
|
|
274850
|
-
await
|
|
274851
|
-
|
|
274852
|
-
|
|
274853
|
-
|
|
274854
|
-
|
|
274855
|
-
|
|
274856
|
-
|
|
274857
|
-
|
|
274858
|
-
|
|
274904
|
+
try {
|
|
274905
|
+
const env2 = await loadEnv2(false, false);
|
|
274906
|
+
const name2 = await namePrompt(env2, projectName);
|
|
274907
|
+
const targetDir = formatTargetDir(name2);
|
|
274908
|
+
const projectDir = join7(process.cwd(), targetDir);
|
|
274909
|
+
if (!await exists(projectDir)) {
|
|
274910
|
+
await mkdir6(projectDir, { recursive: true });
|
|
274911
|
+
}
|
|
274912
|
+
if (!await isEmpty(projectDir)) {
|
|
274913
|
+
const confirmEmpty = await esm_default3({
|
|
274914
|
+
message: `The folder ${projectDir} already exists. Do you want to empty it?`,
|
|
274915
|
+
default: false
|
|
274916
|
+
});
|
|
274917
|
+
if (!confirmEmpty) {
|
|
274918
|
+
cancel(`Error: A folder with the name ${targetDir} already exists in the current directory.`);
|
|
274919
|
+
}
|
|
274920
|
+
await emptyDir(projectDir);
|
|
274859
274921
|
}
|
|
274860
|
-
await
|
|
274861
|
-
|
|
274862
|
-
|
|
274863
|
-
|
|
274864
|
-
|
|
274922
|
+
const selectedTemplate = await templatePrompt(templates, template);
|
|
274923
|
+
if (!selectedTemplate) {
|
|
274924
|
+
return nothingSelectedError("template");
|
|
274925
|
+
}
|
|
274926
|
+
await spinner({
|
|
274927
|
+
startMessage: "Scaffolding the project",
|
|
274928
|
+
task: async () => {
|
|
274929
|
+
await downloadAndExtractNpmPackage(selectedTemplate.value, projectDir);
|
|
274930
|
+
await setName(name2, projectDir);
|
|
274931
|
+
},
|
|
274932
|
+
stopMessage: "Project fully scaffolded"
|
|
274933
|
+
});
|
|
274934
|
+
outro("Your project is ready to go!");
|
|
274935
|
+
await telemetry({
|
|
274936
|
+
command: "create",
|
|
274937
|
+
status: "success",
|
|
274938
|
+
message: selectedTemplate.value
|
|
274939
|
+
});
|
|
274940
|
+
} catch (error5) {
|
|
274941
|
+
await telemetry({
|
|
274942
|
+
command: "create",
|
|
274943
|
+
status: "error",
|
|
274944
|
+
message: error5.message
|
|
274945
|
+
});
|
|
274946
|
+
throw error5;
|
|
274865
274947
|
}
|
|
274866
|
-
await spinner({
|
|
274867
|
-
startMessage: "Scaffolding the project",
|
|
274868
|
-
task: async () => {
|
|
274869
|
-
await downloadAndExtractNpmPackage(selectedTemplate.value, projectDir);
|
|
274870
|
-
await setName(name2, projectDir);
|
|
274871
|
-
},
|
|
274872
|
-
stopMessage: "Project fully scaffolded"
|
|
274873
|
-
});
|
|
274874
|
-
outro("Your project is ready to go!");
|
|
274875
274948
|
});
|
|
274876
274949
|
}
|
|
274877
274950
|
|
|
@@ -274930,49 +275003,63 @@ function loginCommand() {
|
|
|
274930
275003
|
}
|
|
274931
275004
|
])).option("-a, --accept-defaults", "Accept the default and previously set values").option("-d, --default", "Set this instance as the default").option("--token-stdin", "Provide a token using STDIN").option("-i, --instance <instance>", "The instance to login to (defaults to the instance in the .env file)").action(async ({ acceptDefaults, default: isDefault, tokenStdin, instance }, cmd2) => {
|
|
274932
275005
|
intro("Login to your SettleMint account");
|
|
274933
|
-
|
|
274934
|
-
|
|
274935
|
-
|
|
274936
|
-
|
|
274937
|
-
|
|
274938
|
-
|
|
274939
|
-
|
|
274940
|
-
|
|
274941
|
-
if (
|
|
274942
|
-
|
|
274943
|
-
|
|
274944
|
-
|
|
274945
|
-
|
|
274946
|
-
|
|
274947
|
-
|
|
274948
|
-
|
|
274949
|
-
|
|
274950
|
-
|
|
274951
|
-
|
|
274952
|
-
|
|
274953
|
-
|
|
275006
|
+
try {
|
|
275007
|
+
const autoAccept = !!acceptDefaults || !!tokenStdin;
|
|
275008
|
+
const env2 = await loadEnv2(false, false);
|
|
275009
|
+
if (instance) {
|
|
275010
|
+
validate3(UrlSchema, instance);
|
|
275011
|
+
}
|
|
275012
|
+
const selectedInstance = instance ? sanitizeAndValidateInstanceUrl(instance) : await instancePrompt(env2, autoAccept, true);
|
|
275013
|
+
let personalAccessToken = "";
|
|
275014
|
+
if (tokenStdin) {
|
|
275015
|
+
if (cmd2.args.length > 0) {
|
|
275016
|
+
cancel("A token should be provided using STDIN, not as an argument");
|
|
275017
|
+
}
|
|
275018
|
+
personalAccessToken = await Promise.race([
|
|
275019
|
+
(async () => {
|
|
275020
|
+
const chunks = [];
|
|
275021
|
+
for await (const chunk of process.stdin) {
|
|
275022
|
+
chunks.push(Buffer.from(chunk));
|
|
275023
|
+
}
|
|
275024
|
+
return Buffer.concat(chunks).toString().trim();
|
|
275025
|
+
})(),
|
|
275026
|
+
new Promise((resolve7) => setTimeout(() => resolve7(""), 1000))
|
|
275027
|
+
]);
|
|
275028
|
+
try {
|
|
275029
|
+
validate3(PersonalAccessTokenSchema3, personalAccessToken);
|
|
275030
|
+
} catch {
|
|
275031
|
+
cancel("Invalid personal access token");
|
|
275032
|
+
}
|
|
275033
|
+
} else {
|
|
275034
|
+
personalAccessToken = await personalAccessTokenPrompt(env2, selectedInstance, autoAccept);
|
|
275035
|
+
}
|
|
275036
|
+
const client = createSettleMintClient({
|
|
275037
|
+
instance: selectedInstance,
|
|
275038
|
+
accessToken: personalAccessToken
|
|
275039
|
+
});
|
|
274954
275040
|
try {
|
|
274955
|
-
|
|
274956
|
-
} catch {
|
|
274957
|
-
cancel(
|
|
275041
|
+
await loginSpinner(client);
|
|
275042
|
+
} catch (error5) {
|
|
275043
|
+
cancel(`Invalid personal access token for instance ${selectedInstance}`);
|
|
274958
275044
|
}
|
|
274959
|
-
|
|
274960
|
-
|
|
274961
|
-
|
|
274962
|
-
|
|
274963
|
-
|
|
274964
|
-
|
|
274965
|
-
|
|
274966
|
-
|
|
274967
|
-
|
|
275045
|
+
await storeCredentials(personalAccessToken, selectedInstance);
|
|
275046
|
+
if (isDefault) {
|
|
275047
|
+
await setDefaultInstance(selectedInstance);
|
|
275048
|
+
}
|
|
275049
|
+
outro("Successfully logged in to SettleMint!");
|
|
275050
|
+
await telemetry({
|
|
275051
|
+
command: "login",
|
|
275052
|
+
status: "success",
|
|
275053
|
+
instance: selectedInstance
|
|
275054
|
+
});
|
|
274968
275055
|
} catch (error5) {
|
|
274969
|
-
|
|
274970
|
-
|
|
274971
|
-
|
|
274972
|
-
|
|
274973
|
-
|
|
275056
|
+
await telemetry({
|
|
275057
|
+
command: "login",
|
|
275058
|
+
status: "error",
|
|
275059
|
+
message: error5.message
|
|
275060
|
+
});
|
|
275061
|
+
throw error5;
|
|
274974
275062
|
}
|
|
274975
|
-
outro("Successfully logged in to SettleMint!");
|
|
274976
275063
|
});
|
|
274977
275064
|
}
|
|
274978
275065
|
|
|
@@ -274980,33 +275067,47 @@ function loginCommand() {
|
|
|
274980
275067
|
function logoutCommand() {
|
|
274981
275068
|
return new Command("logout").description("Logout from your SettleMint account").option("--all", "Logout from all instances").action(async (options) => {
|
|
274982
275069
|
intro("Logging out from SettleMint");
|
|
274983
|
-
|
|
274984
|
-
|
|
274985
|
-
|
|
274986
|
-
|
|
274987
|
-
|
|
274988
|
-
|
|
274989
|
-
|
|
274990
|
-
|
|
274991
|
-
|
|
274992
|
-
|
|
274993
|
-
|
|
274994
|
-
|
|
274995
|
-
|
|
274996
|
-
|
|
274997
|
-
|
|
275070
|
+
try {
|
|
275071
|
+
const instances = await getInstances();
|
|
275072
|
+
if (instances.length === 0) {
|
|
275073
|
+
outro("No instances to logout from");
|
|
275074
|
+
return;
|
|
275075
|
+
}
|
|
275076
|
+
if (options.all) {
|
|
275077
|
+
await Promise.all(instances.map((instance2) => removeCredentials(instance2)));
|
|
275078
|
+
outro("Successfully logged out from all instances");
|
|
275079
|
+
return;
|
|
275080
|
+
}
|
|
275081
|
+
if (instances.length === 1) {
|
|
275082
|
+
const instance2 = instances[0];
|
|
275083
|
+
await removeCredentials(instance2);
|
|
275084
|
+
outro(`Successfully logged out from ${instance2}`);
|
|
275085
|
+
return;
|
|
275086
|
+
}
|
|
275087
|
+
const defaultInstance = await getDefaultInstance();
|
|
275088
|
+
const instance = await esm_default2({
|
|
275089
|
+
message: "Select the instance to logout from:",
|
|
275090
|
+
choices: instances.map((instance2) => ({
|
|
275091
|
+
value: instance2,
|
|
275092
|
+
label: instance2,
|
|
275093
|
+
description: instance2 === defaultInstance ? "(default)" : undefined
|
|
275094
|
+
}))
|
|
275095
|
+
});
|
|
275096
|
+
await removeCredentials(instance);
|
|
275097
|
+
outro(`Successfully logged out from ${instance}`);
|
|
275098
|
+
await telemetry({
|
|
275099
|
+
command: "logout",
|
|
275100
|
+
status: "success",
|
|
275101
|
+
instance
|
|
275102
|
+
});
|
|
275103
|
+
} catch (error5) {
|
|
275104
|
+
await telemetry({
|
|
275105
|
+
command: "logout",
|
|
275106
|
+
status: "error",
|
|
275107
|
+
message: error5.message
|
|
275108
|
+
});
|
|
275109
|
+
throw error5;
|
|
274998
275110
|
}
|
|
274999
|
-
const defaultInstance = await getDefaultInstance();
|
|
275000
|
-
const instance = await esm_default2({
|
|
275001
|
-
message: "Select the instance to logout from:",
|
|
275002
|
-
choices: instances.map((instance2) => ({
|
|
275003
|
-
value: instance2,
|
|
275004
|
-
label: instance2,
|
|
275005
|
-
description: instance2 === defaultInstance ? "(default)" : undefined
|
|
275006
|
-
}))
|
|
275007
|
-
});
|
|
275008
|
-
await removeCredentials(instance);
|
|
275009
|
-
outro(`Successfully logged out from ${instance}`);
|
|
275010
275111
|
});
|
|
275011
275112
|
}
|
|
275012
275113
|
|
|
@@ -277649,4 +277750,4 @@ function sdkCliCommand(exitOverride = undefined) {
|
|
|
277649
277750
|
ascii();
|
|
277650
277751
|
sdkCliCommand();
|
|
277651
277752
|
|
|
277652
|
-
//# debugId=
|
|
277753
|
+
//# debugId=0478CEF1FEC87B7064756E2164756E21
|