@settlemint/sdk-cli 0.9.3-pr3f0e6746 → 0.9.3-pr79efb0e3
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 +442 -288
- package/dist/cli.js.map +46 -44
- 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.0vjsRGUO4n:/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.0vjsRGUO4n:/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.0vjsRGUO4n:/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.0vjsRGUO4n:/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: "0.9.3-
|
|
226467
|
+
binaryVersion: "0.9.3-pr79efb0e3",
|
|
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.0vjsRGUO4n:/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: "SettleMint SDK, integrate SettleMint into your application with ease.",
|
|
256791
|
-
version: "0.9.3-
|
|
256791
|
+
version: "0.9.3-pr79efb0e3",
|
|
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.1",
|
|
256842
256842
|
"@inquirer/password": "4.0.4",
|
|
256843
256843
|
"@inquirer/select": "4.0.4",
|
|
256844
|
-
"@settlemint/sdk-js": "0.9.3-
|
|
256845
|
-
"@settlemint/sdk-utils": "0.9.3-
|
|
256844
|
+
"@settlemint/sdk-js": "0.9.3-pr79efb0e3",
|
|
256845
|
+
"@settlemint/sdk-utils": "0.9.3-pr79efb0e3",
|
|
256846
256846
|
"get-tsconfig": "4.8.1",
|
|
256847
256847
|
giget: "1.2.3"
|
|
256848
256848
|
},
|
|
@@ -257103,9 +257103,12 @@ async function findUp(name, options = {}) {
|
|
|
257103
257103
|
|
|
257104
257104
|
// ../utils/dist/filesystem.mjs
|
|
257105
257105
|
import { stat } from "node:fs/promises";
|
|
257106
|
-
async function projectRoot() {
|
|
257106
|
+
async function projectRoot(fallbackToCwd = false) {
|
|
257107
257107
|
const packageJsonPath = await findUp("package.json");
|
|
257108
257108
|
if (!packageJsonPath) {
|
|
257109
|
+
if (fallbackToCwd) {
|
|
257110
|
+
return process.cwd();
|
|
257111
|
+
}
|
|
257109
257112
|
throw new Error("Unable to find project root (no package.json found)");
|
|
257110
257113
|
}
|
|
257111
257114
|
return dirname(packageJsonPath);
|
|
@@ -257140,6 +257143,9 @@ function missingAccessTokenError(personalAccessTokenExists) {
|
|
|
257140
257143
|
function missingPersonalAccessTokenError() {
|
|
257141
257144
|
return cancel("No personal access token found for instance, please run `settlemint login` to login to your instance");
|
|
257142
257145
|
}
|
|
257146
|
+
function missingApplication() {
|
|
257147
|
+
return cancel("No application configured, please run `settlemint connect` to connect to your application");
|
|
257148
|
+
}
|
|
257143
257149
|
|
|
257144
257150
|
// src/utils/config.ts
|
|
257145
257151
|
import { mkdir as mkdir2, readFile, writeFile as writeFile2 } from "node:fs/promises";
|
|
@@ -270060,9 +270066,12 @@ async function loadEnvironmentEnv2(validateEnv, prod, path5 = process.cwd()) {
|
|
|
270060
270066
|
return {};
|
|
270061
270067
|
}
|
|
270062
270068
|
}
|
|
270063
|
-
async function projectRoot2() {
|
|
270069
|
+
async function projectRoot2(fallbackToCwd = false) {
|
|
270064
270070
|
const packageJsonPath = await findUp("package.json");
|
|
270065
270071
|
if (!packageJsonPath) {
|
|
270072
|
+
if (fallbackToCwd) {
|
|
270073
|
+
return process.cwd();
|
|
270074
|
+
}
|
|
270066
270075
|
throw new Error("Unable to find project root (no package.json found)");
|
|
270067
270076
|
}
|
|
270068
270077
|
return dirname5(packageJsonPath);
|
|
@@ -270113,7 +270122,7 @@ async function findMonoRepoPackages(projectDir) {
|
|
|
270113
270122
|
}
|
|
270114
270123
|
}
|
|
270115
270124
|
async function writeEnv(prod, env2, secrets) {
|
|
270116
|
-
const projectDir = await projectRoot2();
|
|
270125
|
+
const projectDir = await projectRoot2(true);
|
|
270117
270126
|
if (prod) {
|
|
270118
270127
|
process.env.NODE_ENV = "production";
|
|
270119
270128
|
}
|
|
@@ -272750,8 +272759,9 @@ var esm_default5 = createPrompt((config4, done) => {
|
|
|
272750
272759
|
|
|
272751
272760
|
// src/commands/connect/aat.prompt.ts
|
|
272752
272761
|
async function applicationAccessTokenPrompt(env2, application, settlemint, accept) {
|
|
272762
|
+
const autoAccept = !!accept || is_in_ci_default;
|
|
272753
272763
|
const defaultAccessToken = env2.SETTLEMINT_ACCESS_TOKEN;
|
|
272754
|
-
const defaultPossible =
|
|
272764
|
+
const defaultPossible = autoAccept && defaultAccessToken;
|
|
272755
272765
|
if (defaultPossible || is_in_ci_default) {
|
|
272756
272766
|
return defaultAccessToken;
|
|
272757
272767
|
}
|
|
@@ -272846,16 +272856,25 @@ async function applicationAccessTokenPrompt(env2, application, settlemint, accep
|
|
|
272846
272856
|
});
|
|
272847
272857
|
}
|
|
272848
272858
|
|
|
272859
|
+
// src/error/nothing-selected-error.ts
|
|
272860
|
+
function nothingSelectedError(type4) {
|
|
272861
|
+
return cancel2(`No ${type4} selected. Please select a ${type4} to continue.`);
|
|
272862
|
+
}
|
|
272863
|
+
|
|
272849
272864
|
// src/commands/connect/application.prompt.ts
|
|
272850
272865
|
async function applicationPrompt(env2, applications, accept) {
|
|
272866
|
+
const autoAccept = !!accept || is_in_ci_default;
|
|
272851
272867
|
const defaultApplication = applications.find((application2) => application2.uniqueName === env2.SETTLEMINT_APPLICATION);
|
|
272852
|
-
const defaultPossible =
|
|
272868
|
+
const defaultPossible = autoAccept && defaultApplication;
|
|
272853
272869
|
if (defaultPossible) {
|
|
272854
272870
|
return defaultApplication;
|
|
272855
272871
|
}
|
|
272856
272872
|
if (applications.length === 0) {
|
|
272857
272873
|
cancel("No applications found");
|
|
272858
272874
|
}
|
|
272875
|
+
if (is_in_ci_default) {
|
|
272876
|
+
nothingSelectedError("application");
|
|
272877
|
+
}
|
|
272859
272878
|
const application = await esm_default2({
|
|
272860
272879
|
message: "Which application do you want to connect to?",
|
|
272861
272880
|
choices: applications.map((applications2) => ({
|
|
@@ -272870,146 +272889,170 @@ async function applicationPrompt(env2, applications, accept) {
|
|
|
272870
272889
|
return application;
|
|
272871
272890
|
}
|
|
272872
272891
|
|
|
272873
|
-
// src/commands/connect/
|
|
272874
|
-
async function
|
|
272875
|
-
|
|
272892
|
+
// src/commands/connect/service.prompt.ts
|
|
272893
|
+
async function servicePrompt({
|
|
272894
|
+
env: env2,
|
|
272895
|
+
services,
|
|
272896
|
+
accept,
|
|
272897
|
+
envKey,
|
|
272898
|
+
defaultHandler,
|
|
272899
|
+
isCi = is_in_ci_default
|
|
272900
|
+
}) {
|
|
272901
|
+
if (services.length === 0) {
|
|
272876
272902
|
return;
|
|
272877
272903
|
}
|
|
272878
|
-
const
|
|
272879
|
-
const
|
|
272880
|
-
if (
|
|
272881
|
-
return
|
|
272904
|
+
const selectedService = services.find((service) => service.uniqueName === env2[envKey]);
|
|
272905
|
+
const autoAccept = isCi || accept;
|
|
272906
|
+
if (autoAccept && selectedService) {
|
|
272907
|
+
return selectedService;
|
|
272882
272908
|
}
|
|
272883
|
-
|
|
272884
|
-
|
|
272885
|
-
|
|
272886
|
-
|
|
272887
|
-
|
|
272888
|
-
|
|
272889
|
-
|
|
272890
|
-
|
|
272891
|
-
|
|
272892
|
-
|
|
272893
|
-
|
|
272894
|
-
|
|
272895
|
-
|
|
272909
|
+
if (isCi) {
|
|
272910
|
+
return;
|
|
272911
|
+
}
|
|
272912
|
+
if (services.length === 1) {
|
|
272913
|
+
return services[0];
|
|
272914
|
+
}
|
|
272915
|
+
return defaultHandler({ defaultService: selectedService });
|
|
272916
|
+
}
|
|
272917
|
+
|
|
272918
|
+
// src/commands/connect/blockchain-node.prompt.ts
|
|
272919
|
+
async function blockchainNodePrompt(env2, nodes, accept) {
|
|
272920
|
+
return servicePrompt({
|
|
272921
|
+
env: env2,
|
|
272922
|
+
services: nodes,
|
|
272923
|
+
accept,
|
|
272924
|
+
envKey: "SETTLEMINT_BLOCKCHAIN_NODE",
|
|
272925
|
+
defaultHandler: async ({ defaultService: defaultNode }) => {
|
|
272926
|
+
return esm_default2({
|
|
272927
|
+
message: "Which blockchain node do you want to connect to?",
|
|
272928
|
+
choices: [
|
|
272929
|
+
...nodes.map((node) => ({
|
|
272930
|
+
name: node.name,
|
|
272931
|
+
value: node
|
|
272932
|
+
})),
|
|
272933
|
+
{
|
|
272934
|
+
name: "None",
|
|
272935
|
+
value: undefined
|
|
272936
|
+
}
|
|
272937
|
+
],
|
|
272938
|
+
default: defaultNode
|
|
272939
|
+
});
|
|
272940
|
+
}
|
|
272896
272941
|
});
|
|
272897
|
-
return node;
|
|
272898
272942
|
}
|
|
272899
272943
|
|
|
272900
272944
|
// src/commands/connect/blockscout.prompt.ts
|
|
272901
272945
|
async function blockscoutPrompt(env2, insights, accept) {
|
|
272902
272946
|
const possible = insights.filter((insight) => insight.insightsCategory === "BLOCKCHAIN_EXPLORER");
|
|
272903
|
-
|
|
272904
|
-
|
|
272905
|
-
|
|
272906
|
-
|
|
272907
|
-
|
|
272908
|
-
|
|
272909
|
-
|
|
272910
|
-
|
|
272911
|
-
|
|
272912
|
-
|
|
272913
|
-
|
|
272914
|
-
|
|
272915
|
-
|
|
272916
|
-
|
|
272917
|
-
|
|
272918
|
-
|
|
272919
|
-
|
|
272920
|
-
|
|
272921
|
-
|
|
272922
|
-
|
|
272923
|
-
|
|
272947
|
+
return servicePrompt({
|
|
272948
|
+
env: env2,
|
|
272949
|
+
services: possible,
|
|
272950
|
+
accept,
|
|
272951
|
+
envKey: "SETTLEMINT_BLOCKSCOUT",
|
|
272952
|
+
defaultHandler: async ({ defaultService: defaultBlockscout }) => {
|
|
272953
|
+
return esm_default2({
|
|
272954
|
+
message: "Which blockscout instance do you want to connect to?",
|
|
272955
|
+
choices: [
|
|
272956
|
+
...possible.map((insight) => ({
|
|
272957
|
+
name: insight.name,
|
|
272958
|
+
value: insight
|
|
272959
|
+
})),
|
|
272960
|
+
{
|
|
272961
|
+
name: "None",
|
|
272962
|
+
value: undefined
|
|
272963
|
+
}
|
|
272964
|
+
],
|
|
272965
|
+
default: defaultBlockscout
|
|
272966
|
+
});
|
|
272967
|
+
}
|
|
272924
272968
|
});
|
|
272925
|
-
return blockscout;
|
|
272926
272969
|
}
|
|
272927
272970
|
|
|
272928
272971
|
// src/commands/connect/custom-deployment.prompt.ts
|
|
272929
272972
|
async function customDeploymentPrompt(env2, customDeployments, accept) {
|
|
272930
|
-
|
|
272931
|
-
|
|
272932
|
-
|
|
272933
|
-
|
|
272934
|
-
|
|
272935
|
-
|
|
272936
|
-
|
|
272937
|
-
|
|
272938
|
-
|
|
272939
|
-
|
|
272940
|
-
|
|
272941
|
-
|
|
272942
|
-
|
|
272943
|
-
|
|
272944
|
-
|
|
272945
|
-
|
|
272946
|
-
|
|
272947
|
-
|
|
272948
|
-
|
|
272949
|
-
|
|
272950
|
-
|
|
272973
|
+
return servicePrompt({
|
|
272974
|
+
env: env2,
|
|
272975
|
+
services: customDeployments,
|
|
272976
|
+
accept,
|
|
272977
|
+
envKey: "SETTLEMINT_CUSTOM_DEPLOYMENT",
|
|
272978
|
+
defaultHandler: async ({
|
|
272979
|
+
defaultService: defaultCustomDeployment
|
|
272980
|
+
}) => {
|
|
272981
|
+
return esm_default2({
|
|
272982
|
+
message: "Which Custom Deployment do you want to connect to?",
|
|
272983
|
+
choices: [
|
|
272984
|
+
...customDeployments.map((customDeployment) => ({
|
|
272985
|
+
name: customDeployment.name,
|
|
272986
|
+
value: customDeployment
|
|
272987
|
+
})),
|
|
272988
|
+
{
|
|
272989
|
+
name: "None",
|
|
272990
|
+
value: undefined
|
|
272991
|
+
}
|
|
272992
|
+
],
|
|
272993
|
+
default: defaultCustomDeployment
|
|
272994
|
+
});
|
|
272995
|
+
}
|
|
272951
272996
|
});
|
|
272952
|
-
return middleware;
|
|
272953
272997
|
}
|
|
272954
272998
|
|
|
272955
272999
|
// src/commands/connect/hasura.prompt.ts
|
|
272956
273000
|
async function hasuraPrompt(env2, integrations, accept) {
|
|
272957
273001
|
const possible = integrations.filter((integration) => integration.integrationType === "HASURA");
|
|
272958
|
-
|
|
272959
|
-
|
|
272960
|
-
|
|
272961
|
-
|
|
272962
|
-
|
|
272963
|
-
|
|
272964
|
-
|
|
272965
|
-
|
|
272966
|
-
|
|
272967
|
-
|
|
272968
|
-
|
|
272969
|
-
|
|
272970
|
-
|
|
272971
|
-
|
|
272972
|
-
|
|
272973
|
-
|
|
272974
|
-
|
|
272975
|
-
|
|
272976
|
-
|
|
272977
|
-
|
|
272978
|
-
|
|
273002
|
+
return servicePrompt({
|
|
273003
|
+
env: env2,
|
|
273004
|
+
services: possible,
|
|
273005
|
+
accept,
|
|
273006
|
+
envKey: "SETTLEMINT_HASURA",
|
|
273007
|
+
defaultHandler: async ({ defaultService: defaultHasura }) => {
|
|
273008
|
+
return esm_default2({
|
|
273009
|
+
message: "Which Hasura instance do you want to connect to?",
|
|
273010
|
+
choices: [
|
|
273011
|
+
...possible.map((integration) => ({
|
|
273012
|
+
name: integration.name,
|
|
273013
|
+
value: integration
|
|
273014
|
+
})),
|
|
273015
|
+
{
|
|
273016
|
+
name: "None",
|
|
273017
|
+
value: undefined
|
|
273018
|
+
}
|
|
273019
|
+
],
|
|
273020
|
+
default: defaultHasura
|
|
273021
|
+
});
|
|
273022
|
+
}
|
|
272979
273023
|
});
|
|
272980
|
-
return hasura;
|
|
272981
273024
|
}
|
|
272982
273025
|
|
|
272983
273026
|
// src/commands/connect/hd-private-keys.prompt.ts
|
|
272984
273027
|
async function hdPrivateKeyPrompt(env2, privateKeys, accept) {
|
|
272985
|
-
const possible = privateKeys.filter((
|
|
272986
|
-
|
|
272987
|
-
|
|
272988
|
-
|
|
272989
|
-
|
|
272990
|
-
|
|
272991
|
-
|
|
272992
|
-
|
|
272993
|
-
|
|
272994
|
-
|
|
272995
|
-
|
|
272996
|
-
|
|
272997
|
-
|
|
272998
|
-
|
|
272999
|
-
|
|
273000
|
-
|
|
273001
|
-
|
|
273002
|
-
|
|
273003
|
-
|
|
273004
|
-
|
|
273005
|
-
|
|
273006
|
-
|
|
273028
|
+
const possible = privateKeys.filter((privateKey) => privateKey.privateKeyType === "HD_ECDSA_P256");
|
|
273029
|
+
return servicePrompt({
|
|
273030
|
+
env: env2,
|
|
273031
|
+
services: possible,
|
|
273032
|
+
accept,
|
|
273033
|
+
envKey: "SETTLEMINT_HD_PRIVATE_KEY",
|
|
273034
|
+
defaultHandler: async ({ defaultService: defaultPrivateKey }) => {
|
|
273035
|
+
return esm_default2({
|
|
273036
|
+
message: "Which HD Private Key do you want to use?",
|
|
273037
|
+
choices: [
|
|
273038
|
+
...possible.map((privateKey) => ({
|
|
273039
|
+
name: privateKey.name,
|
|
273040
|
+
value: privateKey
|
|
273041
|
+
})),
|
|
273042
|
+
{
|
|
273043
|
+
name: "None",
|
|
273044
|
+
value: undefined
|
|
273045
|
+
}
|
|
273046
|
+
],
|
|
273047
|
+
default: defaultPrivateKey
|
|
273048
|
+
});
|
|
273049
|
+
}
|
|
273007
273050
|
});
|
|
273008
|
-
return privateKey;
|
|
273009
273051
|
}
|
|
273010
273052
|
|
|
273011
273053
|
// src/commands/connect/instance.prompt.ts
|
|
273012
273054
|
async function instancePrompt(env2, accept) {
|
|
273055
|
+
const autoAccept = !!accept || is_in_ci_default;
|
|
273013
273056
|
const defaultInstance = env2.SETTLEMINT_INSTANCE ?? "https://console.settlemint.com";
|
|
273014
273057
|
const defaultPossible = accept && defaultInstance;
|
|
273015
273058
|
if (defaultPossible) {
|
|
@@ -273034,85 +273077,82 @@ async function instancePrompt(env2, accept) {
|
|
|
273034
273077
|
// src/commands/connect/ipfs.prompt.ts
|
|
273035
273078
|
async function ipfsPrompt(env2, storages, accept) {
|
|
273036
273079
|
const possible = storages.filter((storage) => storage.storageProtocol === "IPFS");
|
|
273037
|
-
|
|
273038
|
-
|
|
273039
|
-
|
|
273040
|
-
|
|
273041
|
-
|
|
273042
|
-
|
|
273043
|
-
|
|
273044
|
-
|
|
273045
|
-
|
|
273046
|
-
|
|
273047
|
-
|
|
273048
|
-
|
|
273049
|
-
|
|
273050
|
-
|
|
273051
|
-
|
|
273052
|
-
|
|
273053
|
-
|
|
273054
|
-
|
|
273055
|
-
|
|
273056
|
-
|
|
273057
|
-
|
|
273080
|
+
return servicePrompt({
|
|
273081
|
+
env: env2,
|
|
273082
|
+
services: possible,
|
|
273083
|
+
accept,
|
|
273084
|
+
envKey: "SETTLEMINT_IPFS",
|
|
273085
|
+
defaultHandler: async ({ defaultService: defaultStorage }) => {
|
|
273086
|
+
return esm_default2({
|
|
273087
|
+
message: "Which IPFS instance do you want to connect to?",
|
|
273088
|
+
choices: [
|
|
273089
|
+
...possible.map((storage) => ({
|
|
273090
|
+
name: storage.name,
|
|
273091
|
+
value: storage
|
|
273092
|
+
})),
|
|
273093
|
+
{
|
|
273094
|
+
name: "None",
|
|
273095
|
+
value: undefined
|
|
273096
|
+
}
|
|
273097
|
+
],
|
|
273098
|
+
default: defaultStorage
|
|
273099
|
+
});
|
|
273100
|
+
}
|
|
273058
273101
|
});
|
|
273059
|
-
return minio;
|
|
273060
273102
|
}
|
|
273061
273103
|
|
|
273062
273104
|
// src/commands/connect/minio.prompt.ts
|
|
273063
273105
|
async function minioPrompt(env2, storages, accept) {
|
|
273064
273106
|
const possible = storages.filter((storage) => storage.storageProtocol === "MINIO");
|
|
273065
|
-
|
|
273066
|
-
|
|
273067
|
-
|
|
273068
|
-
|
|
273069
|
-
|
|
273070
|
-
|
|
273071
|
-
|
|
273072
|
-
|
|
273073
|
-
|
|
273074
|
-
|
|
273075
|
-
|
|
273076
|
-
|
|
273077
|
-
|
|
273078
|
-
|
|
273079
|
-
|
|
273080
|
-
|
|
273081
|
-
|
|
273082
|
-
|
|
273083
|
-
|
|
273084
|
-
|
|
273085
|
-
|
|
273107
|
+
return servicePrompt({
|
|
273108
|
+
env: env2,
|
|
273109
|
+
services: possible,
|
|
273110
|
+
accept,
|
|
273111
|
+
envKey: "SETTLEMINT_MINIO",
|
|
273112
|
+
defaultHandler: async ({ defaultService: defaultStorage }) => {
|
|
273113
|
+
return esm_default2({
|
|
273114
|
+
message: "Which MinIO instance do you want to connect to?",
|
|
273115
|
+
choices: [
|
|
273116
|
+
...possible.map((storage) => ({
|
|
273117
|
+
name: storage.name,
|
|
273118
|
+
value: storage
|
|
273119
|
+
})),
|
|
273120
|
+
{
|
|
273121
|
+
name: "None",
|
|
273122
|
+
value: undefined
|
|
273123
|
+
}
|
|
273124
|
+
],
|
|
273125
|
+
default: defaultStorage
|
|
273126
|
+
});
|
|
273127
|
+
}
|
|
273086
273128
|
});
|
|
273087
|
-
return minio;
|
|
273088
273129
|
}
|
|
273089
273130
|
|
|
273090
273131
|
// src/commands/connect/portal.prompt.ts
|
|
273091
273132
|
async function portalPrompt(env2, middlewares, accept) {
|
|
273092
|
-
const possible = middlewares.filter((
|
|
273093
|
-
|
|
273094
|
-
|
|
273095
|
-
|
|
273096
|
-
|
|
273097
|
-
|
|
273098
|
-
|
|
273099
|
-
|
|
273100
|
-
|
|
273101
|
-
|
|
273102
|
-
|
|
273103
|
-
|
|
273104
|
-
|
|
273105
|
-
|
|
273106
|
-
|
|
273107
|
-
|
|
273108
|
-
|
|
273109
|
-
|
|
273110
|
-
|
|
273111
|
-
|
|
273112
|
-
|
|
273113
|
-
|
|
273133
|
+
const possible = middlewares.filter((middleware) => middleware.interface === "SMART_CONTRACT_PORTAL");
|
|
273134
|
+
return servicePrompt({
|
|
273135
|
+
env: env2,
|
|
273136
|
+
services: possible,
|
|
273137
|
+
accept,
|
|
273138
|
+
envKey: "SETTLEMINT_PORTAL",
|
|
273139
|
+
defaultHandler: async ({ defaultService: defaultMiddleware }) => {
|
|
273140
|
+
return esm_default2({
|
|
273141
|
+
message: "Which Smart Contract Portal instance do you want to connect to?",
|
|
273142
|
+
choices: [
|
|
273143
|
+
...possible.map((middleware) => ({
|
|
273144
|
+
name: middleware.name,
|
|
273145
|
+
value: middleware
|
|
273146
|
+
})),
|
|
273147
|
+
{
|
|
273148
|
+
name: "None",
|
|
273149
|
+
value: undefined
|
|
273150
|
+
}
|
|
273151
|
+
],
|
|
273152
|
+
default: defaultMiddleware
|
|
273153
|
+
});
|
|
273154
|
+
}
|
|
273114
273155
|
});
|
|
273115
|
-
return middleware;
|
|
273116
273156
|
}
|
|
273117
273157
|
|
|
273118
273158
|
// src/commands/connect/services.spinner.ts
|
|
@@ -273156,42 +273196,45 @@ async function servicesSpinner(settlemint, application) {
|
|
|
273156
273196
|
|
|
273157
273197
|
// src/commands/connect/thegraph.prompt.ts
|
|
273158
273198
|
async function theGraphPrompt(env2, middlewares, accept) {
|
|
273159
|
-
const possible = middlewares.filter((
|
|
273160
|
-
|
|
273161
|
-
|
|
273162
|
-
|
|
273163
|
-
|
|
273164
|
-
|
|
273165
|
-
|
|
273166
|
-
|
|
273167
|
-
|
|
273168
|
-
|
|
273169
|
-
|
|
273170
|
-
|
|
273171
|
-
|
|
273172
|
-
|
|
273173
|
-
|
|
273174
|
-
|
|
273175
|
-
|
|
273176
|
-
|
|
273177
|
-
|
|
273178
|
-
|
|
273179
|
-
|
|
273180
|
-
|
|
273199
|
+
const possible = middlewares.filter((middleware) => middleware.__typename === "HAGraphMiddleware");
|
|
273200
|
+
return servicePrompt({
|
|
273201
|
+
env: env2,
|
|
273202
|
+
services: possible,
|
|
273203
|
+
accept,
|
|
273204
|
+
envKey: "SETTLEMINT_THEGRAPH",
|
|
273205
|
+
defaultHandler: async ({ defaultService: defaultMiddleware }) => {
|
|
273206
|
+
return esm_default2({
|
|
273207
|
+
message: "Which The Graph instance do you want to connect to?",
|
|
273208
|
+
choices: [
|
|
273209
|
+
...possible.map((middleware) => ({
|
|
273210
|
+
name: middleware.name,
|
|
273211
|
+
value: middleware
|
|
273212
|
+
})),
|
|
273213
|
+
{
|
|
273214
|
+
name: "None",
|
|
273215
|
+
value: undefined
|
|
273216
|
+
}
|
|
273217
|
+
],
|
|
273218
|
+
default: defaultMiddleware
|
|
273219
|
+
});
|
|
273220
|
+
}
|
|
273181
273221
|
});
|
|
273182
|
-
return middleware;
|
|
273183
273222
|
}
|
|
273184
273223
|
|
|
273185
273224
|
// src/commands/connect/workspace.prompt.ts
|
|
273186
273225
|
async function workspacePrompt(env2, workspaces, accept) {
|
|
273226
|
+
const autoAccept = !!accept || is_in_ci_default;
|
|
273187
273227
|
const defaultWorkspace = workspaces.find((workspace2) => workspace2.uniqueName === env2.SETTLEMINT_WORKSPACE);
|
|
273188
|
-
const defaultPossible =
|
|
273228
|
+
const defaultPossible = autoAccept && defaultWorkspace;
|
|
273189
273229
|
if (defaultPossible) {
|
|
273190
273230
|
return defaultWorkspace;
|
|
273191
273231
|
}
|
|
273192
273232
|
if (workspaces.length === 0) {
|
|
273193
273233
|
cancel2("No workspaces found");
|
|
273194
273234
|
}
|
|
273235
|
+
if (is_in_ci_default) {
|
|
273236
|
+
nothingSelectedError("workspace");
|
|
273237
|
+
}
|
|
273195
273238
|
const workspace = await esm_default2({
|
|
273196
273239
|
message: "Which workspace do you want to connect to?",
|
|
273197
273240
|
choices: workspaces.map((workspace2) => ({
|
|
@@ -273210,9 +273253,8 @@ async function workspacePrompt(env2, workspaces, accept) {
|
|
|
273210
273253
|
function connectCommand() {
|
|
273211
273254
|
return new Command("connect").option("--prod", "Connect to your production environment").option("-a, --accept-defaults", "Accept the default and previously set values").description("Connects your project to your application on SettleMint").action(async ({ acceptDefaults, prod }) => {
|
|
273212
273255
|
intro("Connecting your dApp to SettleMint");
|
|
273213
|
-
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
|
273214
273256
|
const env2 = await loadEnv2(false, !!prod);
|
|
273215
|
-
const instance = await instancePrompt(env2,
|
|
273257
|
+
const instance = await instancePrompt(env2, acceptDefaults);
|
|
273216
273258
|
const personalAccessToken = await getInstanceCredentials(instance);
|
|
273217
273259
|
if (!personalAccessToken) {
|
|
273218
273260
|
return missingPersonalAccessTokenError();
|
|
@@ -273223,20 +273265,20 @@ function connectCommand() {
|
|
|
273223
273265
|
instance
|
|
273224
273266
|
});
|
|
273225
273267
|
const workspaces = await workspaceSpinner(settlemint);
|
|
273226
|
-
const workspace = await workspacePrompt(env2, workspaces,
|
|
273227
|
-
const application = await applicationPrompt(env2, workspace?.applications ?? [],
|
|
273228
|
-
const aatToken = await applicationAccessTokenPrompt(env2, application, settlemint,
|
|
273268
|
+
const workspace = await workspacePrompt(env2, workspaces, acceptDefaults);
|
|
273269
|
+
const application = await applicationPrompt(env2, workspace?.applications ?? [], acceptDefaults);
|
|
273270
|
+
const aatToken = await applicationAccessTokenPrompt(env2, application, settlemint, acceptDefaults);
|
|
273229
273271
|
const { middleware, integrationTool, storage, privateKey, insights, customDeployment, blockchainNodes } = await servicesSpinner(settlemint, application);
|
|
273230
|
-
const blockchainNode = await blockchainNodePrompt(env2, blockchainNodes,
|
|
273231
|
-
const hasura = await hasuraPrompt(env2, integrationTool,
|
|
273232
|
-
const thegraph = await theGraphPrompt(env2, middleware,
|
|
273233
|
-
const portal = await portalPrompt(env2, middleware,
|
|
273234
|
-
const ipfs = await ipfsPrompt(env2, storage,
|
|
273235
|
-
const minio = await minioPrompt(env2, storage,
|
|
273236
|
-
const hdPrivateKey = await hdPrivateKeyPrompt(env2, privateKey,
|
|
273237
|
-
const cDeployment = await customDeploymentPrompt(env2, customDeployment,
|
|
273238
|
-
const blockscout = await blockscoutPrompt(env2, insights,
|
|
273239
|
-
if (
|
|
273272
|
+
const blockchainNode = await blockchainNodePrompt(env2, blockchainNodes, acceptDefaults);
|
|
273273
|
+
const hasura = await hasuraPrompt(env2, integrationTool, acceptDefaults);
|
|
273274
|
+
const thegraph = await theGraphPrompt(env2, middleware, acceptDefaults);
|
|
273275
|
+
const portal = await portalPrompt(env2, middleware, acceptDefaults);
|
|
273276
|
+
const ipfs = await ipfsPrompt(env2, storage, acceptDefaults);
|
|
273277
|
+
const minio = await minioPrompt(env2, storage, acceptDefaults);
|
|
273278
|
+
const hdPrivateKey = await hdPrivateKeyPrompt(env2, privateKey, acceptDefaults);
|
|
273279
|
+
const cDeployment = await customDeploymentPrompt(env2, customDeployment, acceptDefaults);
|
|
273280
|
+
const blockscout = await blockscoutPrompt(env2, insights, acceptDefaults);
|
|
273281
|
+
if (acceptDefaults) {
|
|
273240
273282
|
const selectedServices = [
|
|
273241
273283
|
`Workspace: ${workspace.name}`,
|
|
273242
273284
|
`Application: ${application.name}`,
|
|
@@ -273340,9 +273382,12 @@ import { dirname as dirname6 } from "node:path";
|
|
|
273340
273382
|
import { stat as stat8 } from "node:fs/promises";
|
|
273341
273383
|
var import_package_json3 = __toESM(require_lib12(), 1);
|
|
273342
273384
|
var import_package_json4 = __toESM(require_lib12(), 1);
|
|
273343
|
-
async function projectRoot3() {
|
|
273385
|
+
async function projectRoot3(fallbackToCwd = false) {
|
|
273344
273386
|
const packageJsonPath = await findUp("package.json");
|
|
273345
273387
|
if (!packageJsonPath) {
|
|
273388
|
+
if (fallbackToCwd) {
|
|
273389
|
+
return process.cwd();
|
|
273390
|
+
}
|
|
273346
273391
|
throw new Error("Unable to find project root (no package.json found)");
|
|
273347
273392
|
}
|
|
273348
273393
|
return dirname6(packageJsonPath);
|
|
@@ -274103,7 +274148,7 @@ function createCommand2() {
|
|
|
274103
274148
|
}
|
|
274104
274149
|
const selectedTemplate = await templatePrompt(templates, template);
|
|
274105
274150
|
if (!selectedTemplate) {
|
|
274106
|
-
|
|
274151
|
+
return nothingSelectedError("template");
|
|
274107
274152
|
}
|
|
274108
274153
|
await spinner({
|
|
274109
274154
|
startMessage: "Scaffolding the project",
|
|
@@ -274435,11 +274480,11 @@ function getCreateCommand({
|
|
|
274435
274480
|
if (requiresDeployment) {
|
|
274436
274481
|
const selectedProvider = await providerPrompt(platformConfig, provider);
|
|
274437
274482
|
if (!selectedProvider) {
|
|
274438
|
-
|
|
274483
|
+
return nothingSelectedError("provider");
|
|
274439
274484
|
}
|
|
274440
274485
|
const selectedRegion = await regionPrompt(selectedProvider, region);
|
|
274441
274486
|
if (!selectedRegion) {
|
|
274442
|
-
|
|
274487
|
+
return nothingSelectedError("region");
|
|
274443
274488
|
}
|
|
274444
274489
|
}
|
|
274445
274490
|
const { result, waitFor, mapDefaultEnv } = await spinner({
|
|
@@ -274515,6 +274560,9 @@ function blockchainNetworkBesuCreateCommand() {
|
|
|
274515
274560
|
region
|
|
274516
274561
|
}, async (settlemint, env2) => {
|
|
274517
274562
|
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
274563
|
+
if (!applicationUniqueName) {
|
|
274564
|
+
return missingApplication();
|
|
274565
|
+
}
|
|
274518
274566
|
const result = await settlemint.blockchainNetwork.create({
|
|
274519
274567
|
name: name2,
|
|
274520
274568
|
applicationUniqueName,
|
|
@@ -274722,6 +274770,9 @@ function applicationAccessTokenCreateCommand() {
|
|
|
274722
274770
|
cmd2.option("-a, --application <application>", "The application unique name to create the application access token for (defaults to application from env)").addOption(new Option("-v, --validity-period <period>", "The validity period for the token").choices(["DAYS_7", "DAYS_30", "DAYS_60", "DAYS_90", "NONE"]).default("DAYS_7")).action(async (name2, { application, validityPeriod, ...defaultArgs }) => {
|
|
274723
274771
|
return baseAction(defaultArgs, async (settlemint, env2) => {
|
|
274724
274772
|
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
274773
|
+
if (!applicationUniqueName) {
|
|
274774
|
+
return missingApplication();
|
|
274775
|
+
}
|
|
274725
274776
|
const aatToken = await settlemint.applicationAccessToken.create({
|
|
274726
274777
|
applicationUniqueName,
|
|
274727
274778
|
name: name2,
|
|
@@ -274774,6 +274825,7 @@ function applicationAccessTokenCreateCommand() {
|
|
|
274774
274825
|
uniqueName: ""
|
|
274775
274826
|
},
|
|
274776
274827
|
mapDefaultEnv: () => ({
|
|
274828
|
+
SETTLEMINT_APPLICATION: applicationUniqueName,
|
|
274777
274829
|
SETTLEMINT_ACCESS_TOKEN: aatToken
|
|
274778
274830
|
})
|
|
274779
274831
|
};
|
|
@@ -274805,11 +274857,23 @@ function applicationCreateCommand() {
|
|
|
274805
274857
|
type: "application",
|
|
274806
274858
|
alias: "a",
|
|
274807
274859
|
execute: (cmd2, baseAction) => {
|
|
274808
|
-
cmd2.option("-w, --workspace <workspace>", "The workspace unique name to create the application in (defaults to workspace from env)").action(async (name2, { workspace, ...defaultArgs }) => {
|
|
274809
|
-
return baseAction(
|
|
274860
|
+
cmd2.option("-w, --workspace <workspace>", "The workspace unique name to create the application in (defaults to workspace from env)").action(async (name2, { workspace, acceptDefaults, ...defaultArgs }) => {
|
|
274861
|
+
return baseAction({
|
|
274862
|
+
...defaultArgs,
|
|
274863
|
+
acceptDefaults
|
|
274864
|
+
}, async (settlemint, env2) => {
|
|
274865
|
+
let workspaceUniqueName = workspace;
|
|
274866
|
+
if (!workspaceUniqueName) {
|
|
274867
|
+
const workspaces = await settlemint.workspace.list();
|
|
274868
|
+
const workspace2 = await workspacePrompt(env2, workspaces, acceptDefaults);
|
|
274869
|
+
if (!workspace2) {
|
|
274870
|
+
return nothingSelectedError("workspace");
|
|
274871
|
+
}
|
|
274872
|
+
workspaceUniqueName = workspace2.uniqueName;
|
|
274873
|
+
}
|
|
274810
274874
|
const result = await settlemint.application.create({
|
|
274811
274875
|
name: name2,
|
|
274812
|
-
workspaceUniqueName
|
|
274876
|
+
workspaceUniqueName
|
|
274813
274877
|
});
|
|
274814
274878
|
return {
|
|
274815
274879
|
result,
|
|
@@ -274842,27 +274906,27 @@ function applicationCreateCommand() {
|
|
|
274842
274906
|
|
|
274843
274907
|
// src/commands/connect/blockchain-network.prompt.ts
|
|
274844
274908
|
async function blockchainNetworkPrompt(env2, networks, accept) {
|
|
274845
|
-
|
|
274846
|
-
|
|
274847
|
-
|
|
274848
|
-
|
|
274849
|
-
|
|
274850
|
-
|
|
274851
|
-
|
|
274852
|
-
|
|
274853
|
-
|
|
274854
|
-
|
|
274855
|
-
|
|
274856
|
-
|
|
274857
|
-
|
|
274858
|
-
|
|
274859
|
-
|
|
274860
|
-
|
|
274861
|
-
|
|
274862
|
-
|
|
274863
|
-
|
|
274864
|
-
|
|
274865
|
-
|
|
274909
|
+
return servicePrompt({
|
|
274910
|
+
env: env2,
|
|
274911
|
+
services: networks,
|
|
274912
|
+
accept,
|
|
274913
|
+
envKey: "SETTLEMINT_BLOCKCHAIN_NETWORK",
|
|
274914
|
+
defaultHandler: async ({ defaultService: defaultNetwork }) => {
|
|
274915
|
+
return esm_default2({
|
|
274916
|
+
message: "Which blockchain network do you want to connect to?",
|
|
274917
|
+
choices: [
|
|
274918
|
+
...networks.map((network) => ({
|
|
274919
|
+
name: network.name,
|
|
274920
|
+
value: network
|
|
274921
|
+
})),
|
|
274922
|
+
{
|
|
274923
|
+
name: "None",
|
|
274924
|
+
value: undefined
|
|
274925
|
+
}
|
|
274926
|
+
],
|
|
274927
|
+
default: defaultNetwork
|
|
274928
|
+
});
|
|
274929
|
+
}
|
|
274866
274930
|
});
|
|
274867
274931
|
}
|
|
274868
274932
|
|
|
@@ -274891,19 +274955,18 @@ function blockchainNodeBesuCreateCommand() {
|
|
|
274891
274955
|
provider,
|
|
274892
274956
|
region
|
|
274893
274957
|
}, async (settlemint, env2) => {
|
|
274894
|
-
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
|
274895
274958
|
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
274896
274959
|
if (!applicationUniqueName) {
|
|
274897
|
-
|
|
274960
|
+
return missingApplication();
|
|
274898
274961
|
}
|
|
274899
|
-
let networkUniqueName = blockchainNetwork
|
|
274962
|
+
let networkUniqueName = blockchainNetwork;
|
|
274900
274963
|
if (!networkUniqueName) {
|
|
274901
274964
|
const networks = await settlemint.blockchainNetwork.list(applicationUniqueName);
|
|
274902
|
-
const network = await blockchainNetworkPrompt(env2, networks, acceptDefaults
|
|
274965
|
+
const network = await blockchainNetworkPrompt(env2, networks, acceptDefaults);
|
|
274903
274966
|
if (!network) {
|
|
274904
|
-
|
|
274967
|
+
return nothingSelectedError("blockchain network");
|
|
274905
274968
|
}
|
|
274906
|
-
networkUniqueName = network?.
|
|
274969
|
+
networkUniqueName = network?.uniqueName;
|
|
274907
274970
|
}
|
|
274908
274971
|
const result = await settlemint.blockchainNode.create({
|
|
274909
274972
|
applicationUniqueName,
|
|
@@ -274921,7 +274984,7 @@ function blockchainNodeBesuCreateCommand() {
|
|
|
274921
274984
|
mapDefaultEnv: () => {
|
|
274922
274985
|
return {
|
|
274923
274986
|
SETTLEMINT_APPLICATION: applicationUniqueName,
|
|
274924
|
-
SETTLEMINT_BLOCKCHAIN_NODE: result.
|
|
274987
|
+
SETTLEMINT_BLOCKCHAIN_NODE: result.uniqueName
|
|
274925
274988
|
};
|
|
274926
274989
|
}
|
|
274927
274990
|
};
|
|
@@ -274957,15 +275020,27 @@ function blockscoutInsightsCreateCommand() {
|
|
|
274957
275020
|
type: "insights",
|
|
274958
275021
|
alias: "bs",
|
|
274959
275022
|
execute: (cmd2, baseAction) => {
|
|
274960
|
-
addClusterServiceArgs(cmd2).option("--application <application>", "Application unique name").option("--load-balancer <loadBalancer>", "Load Balancer unique name (mutually exclusive with blockchain-node)").option("--blockchain-node <blockchainNode>", "Blockchain Node unique name (mutually exclusive with load-balancer)").action(async (name2, { application, provider, region, size, type: type4, blockchainNode, loadBalancer, ...defaultArgs }) => {
|
|
275023
|
+
addClusterServiceArgs(cmd2).option("--application <application>", "Application unique name").option("--load-balancer <loadBalancer>", "Load Balancer unique name (mutually exclusive with blockchain-node)").option("--blockchain-node <blockchainNode>", "Blockchain Node unique name (mutually exclusive with load-balancer)").action(async (name2, { application, provider, region, size, type: type4, blockchainNode, loadBalancer, acceptDefaults, ...defaultArgs }) => {
|
|
274961
275024
|
return baseAction({
|
|
274962
275025
|
...defaultArgs,
|
|
275026
|
+
acceptDefaults,
|
|
274963
275027
|
provider,
|
|
274964
275028
|
region
|
|
274965
275029
|
}, async (settlemint, env2) => {
|
|
274966
275030
|
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
274967
|
-
|
|
275031
|
+
if (!applicationUniqueName) {
|
|
275032
|
+
return missingApplication();
|
|
275033
|
+
}
|
|
275034
|
+
let blockchainNodeUniqueName = loadBalancer ? undefined : blockchainNode ?? env2.SETTLEMINT_BLOCKCHAIN_NODE;
|
|
274968
275035
|
const loadBalancerUniqueName = blockchainNodeUniqueName ? undefined : loadBalancer ?? env2.SETTLEMINT_LOAD_BALANCER;
|
|
275036
|
+
if (!blockchainNodeUniqueName && !loadBalancerUniqueName) {
|
|
275037
|
+
const blockchainNodes = await settlemint.blockchainNode.list(applicationUniqueName);
|
|
275038
|
+
const node = await blockchainNodePrompt(env2, blockchainNodes, acceptDefaults);
|
|
275039
|
+
if (!node) {
|
|
275040
|
+
return nothingSelectedError("blockchain node");
|
|
275041
|
+
}
|
|
275042
|
+
blockchainNodeUniqueName = node.uniqueName;
|
|
275043
|
+
}
|
|
274969
275044
|
const result = await settlemint.insights.create({
|
|
274970
275045
|
name: name2,
|
|
274971
275046
|
applicationUniqueName,
|
|
@@ -275024,6 +275099,9 @@ function hasuraIntegrationCreateCommand() {
|
|
|
275024
275099
|
region
|
|
275025
275100
|
}, async (settlemint, env2) => {
|
|
275026
275101
|
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
275102
|
+
if (!applicationUniqueName) {
|
|
275103
|
+
return missingApplication();
|
|
275104
|
+
}
|
|
275027
275105
|
const result = await settlemint.integrationTool.create({
|
|
275028
275106
|
name: name2,
|
|
275029
275107
|
applicationUniqueName,
|
|
@@ -275073,14 +275151,26 @@ function graphMiddlewareCreateCommand() {
|
|
|
275073
275151
|
type: "middleware",
|
|
275074
275152
|
alias: "gr",
|
|
275075
275153
|
execute: (cmd2, baseAction) => {
|
|
275076
|
-
addClusterServiceArgs(cmd2).option("--application <application>", "Application unique name").option("--blockchain-node <blockchainNode>", "Blockchain Node unique name").action(async (name2, { application, blockchainNode, provider, region, size, type: type4, ...defaultArgs }) => {
|
|
275154
|
+
addClusterServiceArgs(cmd2).option("--application <application>", "Application unique name").option("--blockchain-node <blockchainNode>", "Blockchain Node unique name").action(async (name2, { application, blockchainNode, provider, region, size, type: type4, acceptDefaults, ...defaultArgs }) => {
|
|
275077
275155
|
return baseAction({
|
|
275078
275156
|
...defaultArgs,
|
|
275157
|
+
acceptDefaults,
|
|
275079
275158
|
provider,
|
|
275080
275159
|
region
|
|
275081
275160
|
}, async (settlemint, env2) => {
|
|
275082
275161
|
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
275083
|
-
|
|
275162
|
+
if (!applicationUniqueName) {
|
|
275163
|
+
return missingApplication();
|
|
275164
|
+
}
|
|
275165
|
+
let blockchainNodeUniqueName = blockchainNode;
|
|
275166
|
+
if (!blockchainNodeUniqueName) {
|
|
275167
|
+
const blockchainNodes = await settlemint.blockchainNode.list(applicationUniqueName);
|
|
275168
|
+
const node = await blockchainNodePrompt(env2, blockchainNodes, acceptDefaults);
|
|
275169
|
+
if (!node) {
|
|
275170
|
+
return nothingSelectedError("blockchain node");
|
|
275171
|
+
}
|
|
275172
|
+
blockchainNodeUniqueName = node.uniqueName;
|
|
275173
|
+
}
|
|
275084
275174
|
const result = await settlemint.middleware.create({
|
|
275085
275175
|
name: name2,
|
|
275086
275176
|
applicationUniqueName,
|
|
@@ -275136,16 +275226,29 @@ function smartContractPortalMiddlewareCreateCommand() {
|
|
|
275136
275226
|
type: type4,
|
|
275137
275227
|
includePredeployedAbis,
|
|
275138
275228
|
abis,
|
|
275229
|
+
acceptDefaults,
|
|
275139
275230
|
...defaultArgs
|
|
275140
275231
|
}) => {
|
|
275141
275232
|
return baseAction({
|
|
275142
275233
|
...defaultArgs,
|
|
275234
|
+
acceptDefaults,
|
|
275143
275235
|
provider,
|
|
275144
275236
|
region
|
|
275145
275237
|
}, async (settlemint, env2) => {
|
|
275146
275238
|
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
275147
|
-
|
|
275239
|
+
if (!applicationUniqueName) {
|
|
275240
|
+
return missingApplication();
|
|
275241
|
+
}
|
|
275242
|
+
let blockchainNodeUniqueName = loadBalancer ? undefined : blockchainNode ?? env2.SETTLEMINT_BLOCKCHAIN_NODE;
|
|
275148
275243
|
const loadBalancerUniqueName = blockchainNodeUniqueName ? undefined : loadBalancer ?? env2.SETTLEMINT_LOAD_BALANCER;
|
|
275244
|
+
if (!blockchainNodeUniqueName && !loadBalancerUniqueName) {
|
|
275245
|
+
const blockchainNodes = await settlemint.blockchainNode.list(applicationUniqueName);
|
|
275246
|
+
const node = await blockchainNodePrompt(env2, blockchainNodes, acceptDefaults);
|
|
275247
|
+
if (!node) {
|
|
275248
|
+
return nothingSelectedError("blockchain node");
|
|
275249
|
+
}
|
|
275250
|
+
blockchainNodeUniqueName = node.uniqueName;
|
|
275251
|
+
}
|
|
275149
275252
|
const parsedAbis = [];
|
|
275150
275253
|
if (abis && abis.length > 0) {
|
|
275151
275254
|
try {
|
|
@@ -275218,14 +275321,26 @@ function privateKeyHdCreateCommand() {
|
|
|
275218
275321
|
type: "private key",
|
|
275219
275322
|
alias: "hd",
|
|
275220
275323
|
execute: (cmd2, baseAction) => {
|
|
275221
|
-
addClusterServiceArgs(cmd2).option("--application <application>", "Application unique name").option("--blockchain-node <blockchainNode>", "Blockchain Node unique name").action(async (name2, { application, blockchainNode, provider, region, size, type: type4, ...defaultArgs }) => {
|
|
275324
|
+
addClusterServiceArgs(cmd2).option("--application <application>", "Application unique name").option("--blockchain-node <blockchainNode>", "Blockchain Node unique name").action(async (name2, { application, blockchainNode, provider, region, size, type: type4, acceptDefaults, ...defaultArgs }) => {
|
|
275222
275325
|
return baseAction({
|
|
275223
275326
|
...defaultArgs,
|
|
275327
|
+
acceptDefaults,
|
|
275224
275328
|
provider,
|
|
275225
275329
|
region
|
|
275226
275330
|
}, async (settlemint, env2) => {
|
|
275227
275331
|
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
275228
|
-
|
|
275332
|
+
if (!applicationUniqueName) {
|
|
275333
|
+
return missingApplication();
|
|
275334
|
+
}
|
|
275335
|
+
let blockchainNodeUniqueName = blockchainNode;
|
|
275336
|
+
if (!blockchainNodeUniqueName) {
|
|
275337
|
+
const blockchainNodes = await settlemint.blockchainNode.list(applicationUniqueName);
|
|
275338
|
+
const node = await blockchainNodePrompt(env2, blockchainNodes, acceptDefaults);
|
|
275339
|
+
if (!node) {
|
|
275340
|
+
return nothingSelectedError("blockchain node");
|
|
275341
|
+
}
|
|
275342
|
+
blockchainNodeUniqueName = node.uniqueName;
|
|
275343
|
+
}
|
|
275229
275344
|
const result = await settlemint.privateKey.create({
|
|
275230
275345
|
name: name2,
|
|
275231
275346
|
applicationUniqueName,
|
|
@@ -275272,14 +275387,26 @@ function privateKeyHsmCreateCommand() {
|
|
|
275272
275387
|
type: "private key",
|
|
275273
275388
|
alias: "hd",
|
|
275274
275389
|
execute: (cmd2, baseAction) => {
|
|
275275
|
-
addClusterServiceArgs(cmd2).option("--application <application>", "Application unique name").option("--blockchain-node <blockchainNode>", "Blockchain Node unique name").action(async (name2, { application, blockchainNode, provider, region, size, type: type4, ...defaultArgs }) => {
|
|
275390
|
+
addClusterServiceArgs(cmd2).option("--application <application>", "Application unique name").option("--blockchain-node <blockchainNode>", "Blockchain Node unique name").action(async (name2, { application, blockchainNode, provider, region, size, type: type4, acceptDefaults, ...defaultArgs }) => {
|
|
275276
275391
|
return baseAction({
|
|
275277
275392
|
...defaultArgs,
|
|
275393
|
+
acceptDefaults,
|
|
275278
275394
|
provider,
|
|
275279
275395
|
region
|
|
275280
275396
|
}, async (settlemint, env2) => {
|
|
275281
275397
|
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
275282
|
-
|
|
275398
|
+
if (!applicationUniqueName) {
|
|
275399
|
+
return missingApplication();
|
|
275400
|
+
}
|
|
275401
|
+
let blockchainNodeUniqueName = blockchainNode;
|
|
275402
|
+
if (!blockchainNodeUniqueName) {
|
|
275403
|
+
const blockchainNodes = await settlemint.blockchainNode.list(applicationUniqueName);
|
|
275404
|
+
const node = await blockchainNodePrompt(env2, blockchainNodes, acceptDefaults);
|
|
275405
|
+
if (!node) {
|
|
275406
|
+
return nothingSelectedError("blockchain node");
|
|
275407
|
+
}
|
|
275408
|
+
blockchainNodeUniqueName = node.uniqueName;
|
|
275409
|
+
}
|
|
275283
275410
|
const result = await settlemint.privateKey.create({
|
|
275284
275411
|
name: name2,
|
|
275285
275412
|
applicationUniqueName,
|
|
@@ -275332,6 +275459,9 @@ function ipfsStorageCreateCommand() {
|
|
|
275332
275459
|
region
|
|
275333
275460
|
}, async (settlemint, env2) => {
|
|
275334
275461
|
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
275462
|
+
if (!applicationUniqueName) {
|
|
275463
|
+
return missingApplication();
|
|
275464
|
+
}
|
|
275335
275465
|
const result = await settlemint.storage.create({
|
|
275336
275466
|
name: name2,
|
|
275337
275467
|
applicationUniqueName,
|
|
@@ -275381,6 +275511,9 @@ function minioStorageCreateCommand() {
|
|
|
275381
275511
|
region
|
|
275382
275512
|
}, async (settlemint, env2) => {
|
|
275383
275513
|
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
275514
|
+
if (!applicationUniqueName) {
|
|
275515
|
+
return missingApplication();
|
|
275516
|
+
}
|
|
275384
275517
|
const result = await settlemint.storage.create({
|
|
275385
275518
|
name: name2,
|
|
275386
275519
|
applicationUniqueName,
|
|
@@ -275474,9 +275607,8 @@ function getDeleteCommand({
|
|
|
275474
275607
|
if (!force) {
|
|
275475
275608
|
await deleteConfirmationPrompt(`this ${type4}`);
|
|
275476
275609
|
}
|
|
275477
|
-
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
|
275478
275610
|
const env2 = await loadEnv2(false, !!prod);
|
|
275479
|
-
const instance = await instancePrompt(env2,
|
|
275611
|
+
const instance = await instancePrompt(env2, acceptDefaults);
|
|
275480
275612
|
const accessToken = await getApplicationOrPersonalAccessToken({
|
|
275481
275613
|
env: env2,
|
|
275482
275614
|
instance,
|
|
@@ -275569,9 +275701,8 @@ function getRestartCommand({
|
|
|
275569
275701
|
}
|
|
275570
275702
|
])).argument("<unique-name>", `The unique name of the ${type4}, use 'default' to restart the default one from your .env file`).option("-a, --accept-defaults", "Accept the default and previously set values").option("--prod", "Connect to your production environment").option("-w, --wait", "Wait until restarted").action(async (uniqueName, { acceptDefaults, prod, wait }) => {
|
|
275571
275703
|
intro(`Restarting ${type4} in the SettleMint platform`);
|
|
275572
|
-
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
|
275573
275704
|
const env2 = await loadEnv2(false, !!prod);
|
|
275574
|
-
const instance = await instancePrompt(env2,
|
|
275705
|
+
const instance = await instancePrompt(env2, acceptDefaults);
|
|
275575
275706
|
const accessToken = await getApplicationOrPersonalAccessToken({
|
|
275576
275707
|
env: env2,
|
|
275577
275708
|
instance,
|
|
@@ -275885,7 +276016,7 @@ function createCommand4() {
|
|
|
275885
276016
|
const platformConfig = await settlemint.platform.config();
|
|
275886
276017
|
const selectedUseCase = await useCasePrompt(platformConfig, useCase);
|
|
275887
276018
|
if (!selectedUseCase) {
|
|
275888
|
-
|
|
276019
|
+
return nothingSelectedError("use case");
|
|
275889
276020
|
}
|
|
275890
276021
|
const targetDir = formatTargetDir(name2);
|
|
275891
276022
|
const projectDir = join8(process.cwd(), targetDir);
|
|
@@ -276187,6 +276318,9 @@ function hardhatDeployRemoteCommand() {
|
|
|
276187
276318
|
const nodeUniqueName = blockchainNodeUniqueName ?? (autoAccept ? env2.SETTLEMINT_BLOCKCHAIN_NODE : undefined);
|
|
276188
276319
|
let node = undefined;
|
|
276189
276320
|
if (!nodeUniqueName) {
|
|
276321
|
+
if (!env2.SETTLEMINT_APPLICATION) {
|
|
276322
|
+
return missingApplication();
|
|
276323
|
+
}
|
|
276190
276324
|
const nodes = await settlemint.blockchainNode.list(env2.SETTLEMINT_APPLICATION);
|
|
276191
276325
|
const evmNodes = nodes.filter((node2) => node2.isEvm);
|
|
276192
276326
|
if (evmNodes.length === 0) {
|
|
@@ -276197,9 +276331,9 @@ function hardhatDeployRemoteCommand() {
|
|
|
276197
276331
|
if (nodesWithActivePrivateKey.length === 0) {
|
|
276198
276332
|
cancel("No EVM blockchain nodes with private keys found. Please activate a private key on your EVM blockchain node and try again.");
|
|
276199
276333
|
}
|
|
276200
|
-
const blockchainNode = await blockchainNodePrompt(env2, nodesWithActivePrivateKey,
|
|
276334
|
+
const blockchainNode = await blockchainNodePrompt(env2, nodesWithActivePrivateKey, acceptDefaults);
|
|
276201
276335
|
if (!blockchainNode) {
|
|
276202
|
-
|
|
276336
|
+
return nothingSelectedError("EVM blockchain node");
|
|
276203
276337
|
}
|
|
276204
276338
|
node = blockchainNode;
|
|
276205
276339
|
} else {
|
|
@@ -276215,7 +276349,7 @@ function hardhatDeployRemoteCommand() {
|
|
|
276215
276349
|
}
|
|
276216
276350
|
const address = await addressPrompt({ env: env2, accept: autoAccept, prod, node, hardhatConfig });
|
|
276217
276351
|
if (!address) {
|
|
276218
|
-
|
|
276352
|
+
return nothingSelectedError("private key");
|
|
276219
276353
|
}
|
|
276220
276354
|
const { command, args } = await getPackageManagerExecutable();
|
|
276221
276355
|
await executeCommand(command, [
|
|
@@ -276299,14 +276433,31 @@ function hardhatScriptRemoteCommand() {
|
|
|
276299
276433
|
accessToken,
|
|
276300
276434
|
instance
|
|
276301
276435
|
});
|
|
276302
|
-
let nodeUniqueName = blockchainNodeUniqueName;
|
|
276436
|
+
let nodeUniqueName = blockchainNodeUniqueName ?? (autoAccept ? env2.SETTLEMINT_BLOCKCHAIN_NODE : undefined);
|
|
276303
276437
|
if (!nodeUniqueName) {
|
|
276304
|
-
|
|
276305
|
-
|
|
276438
|
+
if (!env2.SETTLEMINT_APPLICATION) {
|
|
276439
|
+
return missingApplication();
|
|
276440
|
+
}
|
|
276441
|
+
const nodes = await settlemint.blockchainNode.list(env2.SETTLEMINT_APPLICATION);
|
|
276442
|
+
const evmNodes = nodes.filter((node) => node.isEvm);
|
|
276443
|
+
if (evmNodes.length === 0) {
|
|
276444
|
+
cancel("No EVM blockchain nodes found. Please create an EVM blockchain node and try again.");
|
|
276445
|
+
}
|
|
276446
|
+
const nodesWithPrivateKey = await Promise.all(nodes.map((node) => settlemint.blockchainNode.read(node.uniqueName)));
|
|
276447
|
+
const nodesWithActivePrivateKey = nodesWithPrivateKey.filter((node) => node.privateKeys && node.privateKeys.length > 0);
|
|
276448
|
+
if (nodesWithActivePrivateKey.length === 0) {
|
|
276449
|
+
cancel("No EVM blockchain nodes with private keys found. Please activate a private key on your EVM blockchain node and try again.");
|
|
276450
|
+
}
|
|
276451
|
+
const blockchainNode = await blockchainNodePrompt(env2, nodesWithActivePrivateKey, acceptDefaults);
|
|
276306
276452
|
if (!blockchainNode) {
|
|
276307
|
-
|
|
276453
|
+
return nothingSelectedError("EVM blockchain node");
|
|
276308
276454
|
}
|
|
276309
276455
|
nodeUniqueName = blockchainNode.uniqueName;
|
|
276456
|
+
} else {
|
|
276457
|
+
const node = await settlemint.blockchainNode.read(nodeUniqueName);
|
|
276458
|
+
if (!node.isEvm) {
|
|
276459
|
+
cancel("The specified blockchain node is not an EVM blockchain node. Please specify an EVM blockchain node to continue.");
|
|
276460
|
+
}
|
|
276310
276461
|
}
|
|
276311
276462
|
const envConfig = await settlemint.foundry.env(nodeUniqueName);
|
|
276312
276463
|
const { command, args } = await getPackageManagerExecutable();
|
|
@@ -276525,6 +276676,9 @@ async function getTheGraphMiddleware({
|
|
|
276525
276676
|
return defaultTheGraphMiddleware;
|
|
276526
276677
|
}
|
|
276527
276678
|
}
|
|
276679
|
+
if (!env2.SETTLEMINT_APPLICATION) {
|
|
276680
|
+
return missingApplication();
|
|
276681
|
+
}
|
|
276528
276682
|
const middlewares = await settlemintClient.middleware.list(env2.SETTLEMINT_APPLICATION);
|
|
276529
276683
|
return theGraphPrompt(env2, middlewares, autoAccept);
|
|
276530
276684
|
}
|
|
@@ -276634,7 +276788,7 @@ function subgraphDeployCommand() {
|
|
|
276634
276788
|
});
|
|
276635
276789
|
const theGraphMiddleware = await getTheGraphMiddleware({ env: env2, instance, accessToken, autoAccept });
|
|
276636
276790
|
if (!theGraphMiddleware) {
|
|
276637
|
-
|
|
276791
|
+
return nothingSelectedError("graph middleware");
|
|
276638
276792
|
}
|
|
276639
276793
|
const network = await getTheGraphNetwork({ theGraphMiddleware, env: env2, instance, accessToken });
|
|
276640
276794
|
await subgraphSetup({
|
|
@@ -276737,4 +276891,4 @@ function sdkCliCommand(exitOverride = undefined) {
|
|
|
276737
276891
|
ascii();
|
|
276738
276892
|
sdkCliCommand();
|
|
276739
276893
|
|
|
276740
|
-
//# debugId=
|
|
276894
|
+
//# debugId=511923E9B1FE059C64756E2164756E21
|