@settlemint/sdk-cli 0.7.0-praba7c5d → 0.7.0-prb15c329
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 +222 -62
- package/dist/cli.js.map +21 -17
- package/package.json +3 -3
package/dist/cli.js
CHANGED
|
@@ -197427,7 +197427,7 @@ ${Bt.cyan(Yt)}
|
|
|
197427
197427
|
code: "ENOENT"
|
|
197428
197428
|
}), getPathInfo = (e9, t7) => {
|
|
197429
197429
|
var r6 = t7.colon || or;
|
|
197430
|
-
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.
|
|
197430
|
+
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.FlwEIId87D:/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)];
|
|
197431
197431
|
var n6 = nr ? t7.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
|
|
197432
197432
|
var a5 = nr ? n6.split(r6) : [""];
|
|
197433
197433
|
if (nr) {
|
|
@@ -200564,7 +200564,7 @@ ${whileRunning(e9)}`;
|
|
|
200564
200564
|
};
|
|
200565
200565
|
ni = Object.assign(async function _main() {
|
|
200566
200566
|
var e9 = new Cli({
|
|
200567
|
-
binaryVersion: "0.7.0-
|
|
200567
|
+
binaryVersion: "0.7.0-prb15c329",
|
|
200568
200568
|
binaryLabel: "gql.tada CLI",
|
|
200569
200569
|
binaryName: "gql.tada"
|
|
200570
200570
|
});
|
|
@@ -218401,7 +218401,7 @@ var require_lib4 = __commonJS((exports, module) => {
|
|
|
218401
218401
|
var rRel = new RegExp(`^\\.${rSlash.source}`);
|
|
218402
218402
|
var getNotFoundError2 = (cmd2) => Object.assign(new Error(`not found: ${cmd2}`), { code: "ENOENT" });
|
|
218403
218403
|
var getPathInfo2 = (cmd2, {
|
|
218404
|
-
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.
|
|
218404
|
+
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.FlwEIId87D:/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",
|
|
218405
218405
|
pathExt: optPathExt = process.env.PATHEXT,
|
|
218406
218406
|
delimiter: optDelimiter = delimiter
|
|
218407
218407
|
}) => {
|
|
@@ -218605,7 +218605,7 @@ var require_lib5 = __commonJS((exports, module) => {
|
|
|
218605
218605
|
let pathToInitial;
|
|
218606
218606
|
try {
|
|
218607
218607
|
pathToInitial = which.sync(initialCmd, {
|
|
218608
|
-
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.
|
|
218608
|
+
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.FlwEIId87D:/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",
|
|
218609
218609
|
pathext: options.env && findInObject(options.env, "PATHEXT") || process.env.PATHEXT
|
|
218610
218610
|
}).toLowerCase();
|
|
218611
218611
|
} catch (err) {
|
|
@@ -219322,7 +219322,7 @@ var require_lib6 = __commonJS((exports, module) => {
|
|
|
219322
219322
|
var rRel = new RegExp(`^\\.${rSlash.source}`);
|
|
219323
219323
|
var getNotFoundError2 = (cmd2) => Object.assign(new Error(`not found: ${cmd2}`), { code: "ENOENT" });
|
|
219324
219324
|
var getPathInfo2 = (cmd2, {
|
|
219325
|
-
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.
|
|
219325
|
+
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.FlwEIId87D:/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",
|
|
219326
219326
|
pathExt: optPathExt = process.env.PATHEXT,
|
|
219327
219327
|
delimiter: optDelimiter = delimiter
|
|
219328
219328
|
}) => {
|
|
@@ -235213,7 +235213,7 @@ var require_which2 = __commonJS((exports, module) => {
|
|
|
235213
235213
|
const colon = opt2.colon || COLON;
|
|
235214
235214
|
const pathEnv = cmd2.match(/\//) || isWindows2 && cmd2.match(/\\/) ? [""] : [
|
|
235215
235215
|
...isWindows2 ? [process.cwd()] : [],
|
|
235216
|
-
...(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.
|
|
235216
|
+
...(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.FlwEIId87D:/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)
|
|
235217
235217
|
];
|
|
235218
235218
|
const pathExtExe = isWindows2 ? opt2.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
|
|
235219
235219
|
const pathExt = isWindows2 ? pathExtExe.split(colon) : [""];
|
|
@@ -270460,8 +270460,11 @@ async function writeEnvSpinner(prod, env2) {
|
|
|
270460
270460
|
}
|
|
270461
270461
|
|
|
270462
270462
|
// src/error/missing-config-error.ts
|
|
270463
|
-
function missingAccessTokenError() {
|
|
270464
|
-
|
|
270463
|
+
function missingAccessTokenError(personalAccessTokenExists) {
|
|
270464
|
+
if (personalAccessTokenExists) {
|
|
270465
|
+
return cancel2("No access token found, please run `settlemint connect` to connect to your instance.");
|
|
270466
|
+
}
|
|
270467
|
+
return cancel2("No personal access token found, please run `settlemint login`, then run `settlemint connect` to connect using an application access token.");
|
|
270465
270468
|
}
|
|
270466
270469
|
function missingPersonalAccessTokenError() {
|
|
270467
270470
|
return cancel2("No personal access token found for instance, please run `settlemint login` to login to your instance");
|
|
@@ -271538,6 +271541,7 @@ var BlockchainNodeFragment = graphql(`
|
|
|
271538
271541
|
name
|
|
271539
271542
|
uniqueName
|
|
271540
271543
|
status
|
|
271544
|
+
isEvm
|
|
271541
271545
|
endpoints {
|
|
271542
271546
|
id
|
|
271543
271547
|
label
|
|
@@ -273258,7 +273262,7 @@ function connectCommand() {
|
|
|
273258
273262
|
var package_default = {
|
|
273259
273263
|
name: "@settlemint/sdk-cli",
|
|
273260
273264
|
description: "SettleMint SDK, integrate SettleMint into your application with ease.",
|
|
273261
|
-
version: "0.7.0-
|
|
273265
|
+
version: "0.7.0-prb15c329",
|
|
273262
273266
|
type: "module",
|
|
273263
273267
|
private: false,
|
|
273264
273268
|
license: "FSL-1.1-MIT",
|
|
@@ -273309,8 +273313,8 @@ var package_default = {
|
|
|
273309
273313
|
"@inquirer/input": "4.1.0",
|
|
273310
273314
|
"@inquirer/password": "4.0.3",
|
|
273311
273315
|
"@inquirer/select": "4.0.3",
|
|
273312
|
-
"@settlemint/sdk-js": "0.7.0-
|
|
273313
|
-
"@settlemint/sdk-utils": "0.7.0-
|
|
273316
|
+
"@settlemint/sdk-js": "0.7.0-prb15c329",
|
|
273317
|
+
"@settlemint/sdk-utils": "0.7.0-prb15c329",
|
|
273314
273318
|
"get-tsconfig": "4.8.1",
|
|
273315
273319
|
giget: "1.2.3"
|
|
273316
273320
|
},
|
|
@@ -274369,6 +274373,28 @@ function getActionLabel(action) {
|
|
|
274369
274373
|
return "deployed";
|
|
274370
274374
|
}
|
|
274371
274375
|
|
|
274376
|
+
// src/utils/get-app-or-personal-token.ts
|
|
274377
|
+
var getApplicationOrPersonalAccessToken = async ({
|
|
274378
|
+
validateEnv,
|
|
274379
|
+
prod,
|
|
274380
|
+
instance,
|
|
274381
|
+
prefer,
|
|
274382
|
+
strict
|
|
274383
|
+
}) => {
|
|
274384
|
+
const env2 = await loadEnv(validateEnv, prod);
|
|
274385
|
+
const applicationAccessToken = env2.SETTLEMINT_ACCESS_TOKEN;
|
|
274386
|
+
const personalAccessToken = (await getInstanceCredentials(instance))?.personalAccessToken;
|
|
274387
|
+
const preference = prefer === "application" ? applicationAccessToken : personalAccessToken;
|
|
274388
|
+
const fallback = prefer === "application" ? personalAccessToken : applicationAccessToken;
|
|
274389
|
+
if (preference) {
|
|
274390
|
+
return preference;
|
|
274391
|
+
}
|
|
274392
|
+
if (!strict && fallback) {
|
|
274393
|
+
return fallback;
|
|
274394
|
+
}
|
|
274395
|
+
return preference === "personal" ? missingPersonalAccessTokenError() : missingAccessTokenError(!!personalAccessToken);
|
|
274396
|
+
};
|
|
274397
|
+
|
|
274372
274398
|
// src/utils/sanitize-command-name.ts
|
|
274373
274399
|
function sanitizeCommandName(name2) {
|
|
274374
274400
|
return name2.split(" ").join("-").toLowerCase();
|
|
@@ -274389,11 +274415,14 @@ ${createExamples(examples)}`).argument("<name>", `The ${type4} name`).option("-a
|
|
|
274389
274415
|
intro(`Creating ${type4} in the SettleMint platform`);
|
|
274390
274416
|
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
|
274391
274417
|
const env2 = await loadEnv2(false, !!prod);
|
|
274392
|
-
const instance = await instancePrompt(env2, autoAccept);
|
|
274393
|
-
const accessToken =
|
|
274394
|
-
|
|
274395
|
-
|
|
274396
|
-
|
|
274418
|
+
const instance = env2.SETTLEMINT_INSTANCE ?? await instancePrompt(env2, autoAccept);
|
|
274419
|
+
const accessToken = await getApplicationOrPersonalAccessToken({
|
|
274420
|
+
validateEnv: false,
|
|
274421
|
+
prod: !!prod,
|
|
274422
|
+
instance,
|
|
274423
|
+
prefer: usePersonalAccessToken ? "personal" : "application",
|
|
274424
|
+
strict: true
|
|
274425
|
+
});
|
|
274397
274426
|
const settlemint = createSettleMintClient({
|
|
274398
274427
|
accessToken,
|
|
274399
274428
|
instance
|
|
@@ -274515,7 +274544,7 @@ function blockchainNetworkBesuCreateCommand() {
|
|
|
274515
274544
|
|
|
274516
274545
|
// src/commands/platform/blockchain-network/create.ts
|
|
274517
274546
|
function blockchainNetworkCreateCommand() {
|
|
274518
|
-
return new Command2("blockchain-network").alias("
|
|
274547
|
+
return new Command2("blockchain-network").alias("bnw").description("Create a blockchain network in the SettleMint platform").addCommand(blockchainNetworkBesuCreateCommand());
|
|
274519
274548
|
}
|
|
274520
274549
|
|
|
274521
274550
|
// src/commands/platform/workspace/create.ts
|
|
@@ -274787,6 +274816,110 @@ function applicationCreateCommand() {
|
|
|
274787
274816
|
});
|
|
274788
274817
|
}
|
|
274789
274818
|
|
|
274819
|
+
// src/commands/connect/blockchain-network.prompt.ts
|
|
274820
|
+
async function blockchainNetworkPrompt(env2, networks, accept) {
|
|
274821
|
+
if (networks.length === 0) {
|
|
274822
|
+
return;
|
|
274823
|
+
}
|
|
274824
|
+
const defaultNetwork = networks.find((network) => network.id === env2.SETTLEMINT_BLOCKCHAIN_NETWORK) ?? (networks.length === 1 ? networks[0] : undefined);
|
|
274825
|
+
const defaultPossible = accept;
|
|
274826
|
+
if (defaultPossible) {
|
|
274827
|
+
return defaultNetwork;
|
|
274828
|
+
}
|
|
274829
|
+
return esm_default2({
|
|
274830
|
+
message: "Which blockchain network do you want to connect to?",
|
|
274831
|
+
choices: [
|
|
274832
|
+
...networks.map((network) => ({
|
|
274833
|
+
name: network.name,
|
|
274834
|
+
value: network
|
|
274835
|
+
})),
|
|
274836
|
+
{
|
|
274837
|
+
name: "None",
|
|
274838
|
+
value: undefined
|
|
274839
|
+
}
|
|
274840
|
+
],
|
|
274841
|
+
default: defaultNetwork
|
|
274842
|
+
});
|
|
274843
|
+
}
|
|
274844
|
+
|
|
274845
|
+
// src/commands/platform/blockchain-node/besu/create.ts
|
|
274846
|
+
function blockchainNodeBesuCreateCommand() {
|
|
274847
|
+
return getCreateCommand({
|
|
274848
|
+
name: "besu",
|
|
274849
|
+
type: "blockchain node",
|
|
274850
|
+
alias: "b",
|
|
274851
|
+
execute: (cmd2, baseAction) => {
|
|
274852
|
+
addClusterServiceArgs(cmd2).option("-a, --application-id <applicationId>", "The application ID to create the node in (defaults to application from env)").option("--blockchain-network-id <blockchainNetworkId>", "Blockchain network to add this node to").option("--node-identity <nodeIdentity>", "EC DSA P256 private key to use as the node identity").addOption(new Option("--node-type <nodeType>", "Type of the node").choices(["VALIDATOR", "NON_VALIDATOR"]).makeOptionMandatory()).action(async (name2, {
|
|
274853
|
+
applicationId,
|
|
274854
|
+
provider,
|
|
274855
|
+
region,
|
|
274856
|
+
size,
|
|
274857
|
+
type: type4,
|
|
274858
|
+
blockchainNetworkId,
|
|
274859
|
+
nodeType,
|
|
274860
|
+
nodeIdentity,
|
|
274861
|
+
acceptDefaults,
|
|
274862
|
+
...defaultArgs
|
|
274863
|
+
}) => {
|
|
274864
|
+
return baseAction(defaultArgs, async (settlemint, env2) => {
|
|
274865
|
+
const application = applicationId ?? env2.SETTLEMINT_APPLICATION;
|
|
274866
|
+
if (!application) {
|
|
274867
|
+
cancel2("No application found. Please specify an application or run `settlemint connect` to continue.");
|
|
274868
|
+
}
|
|
274869
|
+
let networkId = blockchainNetworkId ?? (acceptDefaults ? env2.SETTLEMINT_BLOCKCHAIN_NETWORK : undefined);
|
|
274870
|
+
if (!networkId) {
|
|
274871
|
+
const networks = await settlemint.blockchainNetwork.list(application);
|
|
274872
|
+
const network = await blockchainNetworkPrompt(env2, networks, acceptDefaults ?? false);
|
|
274873
|
+
if (!network) {
|
|
274874
|
+
cancel2("No network found. Please specify a network to continue.");
|
|
274875
|
+
}
|
|
274876
|
+
networkId = network?.id;
|
|
274877
|
+
}
|
|
274878
|
+
const result = await settlemint.blockchainNode.create({
|
|
274879
|
+
applicationId: application,
|
|
274880
|
+
name: name2,
|
|
274881
|
+
blockchainNetworkId: networkId,
|
|
274882
|
+
nodeType,
|
|
274883
|
+
keyMaterial: nodeIdentity,
|
|
274884
|
+
provider,
|
|
274885
|
+
region,
|
|
274886
|
+
size,
|
|
274887
|
+
type: type4
|
|
274888
|
+
});
|
|
274889
|
+
return {
|
|
274890
|
+
result,
|
|
274891
|
+
mapDefaultEnv: () => {
|
|
274892
|
+
return {
|
|
274893
|
+
SETTLEMINT_APPLICATION: application,
|
|
274894
|
+
SETTLEMINT_BLOCKCHAIN_NODE: result.id
|
|
274895
|
+
};
|
|
274896
|
+
}
|
|
274897
|
+
};
|
|
274898
|
+
});
|
|
274899
|
+
});
|
|
274900
|
+
},
|
|
274901
|
+
examples: [
|
|
274902
|
+
{
|
|
274903
|
+
description: "Create a Besu blockchain node and save as default",
|
|
274904
|
+
command: "platform create blockchain-node besu my-node --node-type VALIDATOR --accept-defaults -d"
|
|
274905
|
+
},
|
|
274906
|
+
{
|
|
274907
|
+
description: "Create a Besu blockchain node in a different network",
|
|
274908
|
+
command: "platform create blockchain-node besu my-node --blockchain-network-id 12345 --node-type NON_VALIDATOR --accept-defaults"
|
|
274909
|
+
},
|
|
274910
|
+
{
|
|
274911
|
+
description: "Create a Besu blockchain node in a different application",
|
|
274912
|
+
command: "platform create blockchain-node besu my-node --application-id 123456789 --node-type NON_VALIDATOR --accept-defaults"
|
|
274913
|
+
}
|
|
274914
|
+
]
|
|
274915
|
+
});
|
|
274916
|
+
}
|
|
274917
|
+
|
|
274918
|
+
// src/commands/platform/blockchain-node/create.ts
|
|
274919
|
+
function blockchainNodeCreateCommand() {
|
|
274920
|
+
return new Command2("blockchain-node").alias("bn").description("Create a blockchain node in the SettleMint platform").addCommand(blockchainNodeBesuCreateCommand());
|
|
274921
|
+
}
|
|
274922
|
+
|
|
274790
274923
|
// src/commands/platform/insights/blockscout/create.ts
|
|
274791
274924
|
function blockscoutInsightsCreateCommand() {
|
|
274792
274925
|
return getCreateCommand({
|
|
@@ -274902,16 +275035,14 @@ function graphMiddlewareCreateCommand() {
|
|
|
274902
275035
|
type: "middleware",
|
|
274903
275036
|
alias: "gr",
|
|
274904
275037
|
execute: (cmd2, baseAction) => {
|
|
274905
|
-
addClusterServiceArgs(cmd2).option("--application-id <applicationId>", "Application ID").option("--
|
|
275038
|
+
addClusterServiceArgs(cmd2).option("--application-id <applicationId>", "Application ID").option("--blockchain-node-id <blockchainNodeId>", "Blockchain Node ID").action(async (name2, { applicationId, blockchainNodeId, provider, region, size, type: type4, ...defaultArgs }) => {
|
|
274906
275039
|
return baseAction(defaultArgs, async (settlemint, env2) => {
|
|
274907
275040
|
const application = applicationId ?? env2.SETTLEMINT_APPLICATION;
|
|
274908
275041
|
const blockchainNode = blockchainNodeId ?? env2.SETTLEMINT_BLOCKCHAIN_NODE;
|
|
274909
|
-
const storage = storageId ?? env2.SETTLEMINT_IPFS;
|
|
274910
275042
|
const result = await settlemint.middleware.create({
|
|
274911
275043
|
name: name2,
|
|
274912
275044
|
applicationId: application,
|
|
274913
275045
|
interface: "HA_GRAPH",
|
|
274914
|
-
storageId: storage,
|
|
274915
275046
|
blockchainNodeId: blockchainNode,
|
|
274916
275047
|
provider,
|
|
274917
275048
|
region,
|
|
@@ -275227,7 +275358,7 @@ function storageCreateCommand() {
|
|
|
275227
275358
|
|
|
275228
275359
|
// src/commands/platform/create.ts
|
|
275229
275360
|
function createCommand3() {
|
|
275230
|
-
return new Command2("create").alias("c").description("Create a resource in the SettleMint platform").addCommand(workspaceCreateCommand()).addCommand(applicationCreateCommand()).addCommand(blockchainNetworkCreateCommand()).addCommand(privateKeyCreateCommand()).addCommand(middlewareCreateCommand()).addCommand(storageCreateCommand()).addCommand(integrationToolCreateCommand()).addCommand(insightsCreateCommand()).addCommand(applicationAccessTokenCreateCommand());
|
|
275361
|
+
return new Command2("create").alias("c").description("Create a resource in the SettleMint platform").addCommand(workspaceCreateCommand()).addCommand(applicationCreateCommand()).addCommand(blockchainNetworkCreateCommand()).addCommand(blockchainNodeCreateCommand()).addCommand(privateKeyCreateCommand()).addCommand(middlewareCreateCommand()).addCommand(storageCreateCommand()).addCommand(integrationToolCreateCommand()).addCommand(insightsCreateCommand()).addCommand(applicationAccessTokenCreateCommand());
|
|
275231
275362
|
}
|
|
275232
275363
|
|
|
275233
275364
|
// src/commands/platform/prompts/delete-confirmation.prompt.ts
|
|
@@ -275282,10 +275413,13 @@ ${createExamples([
|
|
|
275282
275413
|
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
|
275283
275414
|
const env2 = await loadEnv2(false, !!prod);
|
|
275284
275415
|
const instance = await instancePrompt(env2, autoAccept);
|
|
275285
|
-
const accessToken =
|
|
275286
|
-
|
|
275287
|
-
|
|
275288
|
-
|
|
275416
|
+
const accessToken = await getApplicationOrPersonalAccessToken({
|
|
275417
|
+
validateEnv: false,
|
|
275418
|
+
prod: !!prod,
|
|
275419
|
+
instance,
|
|
275420
|
+
prefer: usePersonalAccessToken ? "personal" : "application",
|
|
275421
|
+
strict: true
|
|
275422
|
+
});
|
|
275289
275423
|
const settlemint = createSettleMintClient({
|
|
275290
275424
|
accessToken,
|
|
275291
275425
|
instance
|
|
@@ -275380,10 +275514,13 @@ ${createExamples([
|
|
|
275380
275514
|
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
|
275381
275515
|
const env2 = await loadEnv2(false, !!prod);
|
|
275382
275516
|
const instance = await instancePrompt(env2, autoAccept);
|
|
275383
|
-
const accessToken =
|
|
275384
|
-
|
|
275385
|
-
|
|
275386
|
-
|
|
275517
|
+
const accessToken = await getApplicationOrPersonalAccessToken({
|
|
275518
|
+
validateEnv: false,
|
|
275519
|
+
prod: !!prod,
|
|
275520
|
+
instance,
|
|
275521
|
+
prefer: usePersonalAccessToken ? "personal" : "application",
|
|
275522
|
+
strict: true
|
|
275523
|
+
});
|
|
275387
275524
|
const settlemint = createSettleMintClient({
|
|
275388
275525
|
accessToken,
|
|
275389
275526
|
instance
|
|
@@ -275570,11 +275707,14 @@ function customDeploymentsUpdateCommand() {
|
|
|
275570
275707
|
if (!customDeploymentId) {
|
|
275571
275708
|
throw new Error("No custom deployment ID specified. Please provide it either via the --id flag or by setting the SETTLEMINT_CUSTOM_DEPLOYMENT environment variable");
|
|
275572
275709
|
}
|
|
275573
|
-
const accessToken = env2.SETTLEMINT_ACCESS_TOKEN;
|
|
275574
|
-
if (!accessToken) {
|
|
275575
|
-
return missingAccessTokenError();
|
|
275576
|
-
}
|
|
275577
275710
|
const instance = await instancePrompt(env2, true);
|
|
275711
|
+
const accessToken = await getApplicationOrPersonalAccessToken({
|
|
275712
|
+
validateEnv: false,
|
|
275713
|
+
prod: !!prod,
|
|
275714
|
+
instance,
|
|
275715
|
+
prefer: "application",
|
|
275716
|
+
strict: true
|
|
275717
|
+
});
|
|
275578
275718
|
const settlemint = createSettleMintClient({
|
|
275579
275719
|
accessToken,
|
|
275580
275720
|
instance
|
|
@@ -275991,33 +276131,41 @@ function hardhatDeployRemoteCommand() {
|
|
|
275991
276131
|
}) => {
|
|
275992
276132
|
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
|
275993
276133
|
const env2 = await loadEnv(false, !!prod);
|
|
275994
|
-
const accessToken = env2.SETTLEMINT_ACCESS_TOKEN;
|
|
275995
|
-
if (!accessToken) {
|
|
275996
|
-
return missingAccessTokenError();
|
|
275997
|
-
}
|
|
275998
276134
|
const instance = await instancePrompt(env2, true);
|
|
276135
|
+
const accessToken = await getApplicationOrPersonalAccessToken({
|
|
276136
|
+
validateEnv: false,
|
|
276137
|
+
prod: !!prod,
|
|
276138
|
+
instance,
|
|
276139
|
+
prefer: "application",
|
|
276140
|
+
strict: false
|
|
276141
|
+
});
|
|
275999
276142
|
const settlemint = createSettleMintClient({
|
|
276000
276143
|
accessToken,
|
|
276001
276144
|
instance
|
|
276002
276145
|
});
|
|
276146
|
+
const nodeId = autoAccept ? env2.SETTLEMINT_BLOCKCHAIN_NODE : blockchainNodeId;
|
|
276003
276147
|
let node = undefined;
|
|
276004
|
-
if (!
|
|
276005
|
-
const
|
|
276006
|
-
|
|
276007
|
-
|
|
276148
|
+
if (!nodeId) {
|
|
276149
|
+
const nodes = await settlemint.blockchainNode.list(env2.SETTLEMINT_APPLICATION);
|
|
276150
|
+
const evmNodes = nodes.filter((node2) => node2.isEvm);
|
|
276151
|
+
if (evmNodes.length === 0) {
|
|
276152
|
+
cancel2("No EVM blockchain nodes found. Please create an EVM blockchain node and try again.");
|
|
276008
276153
|
}
|
|
276009
|
-
const nodesWithPrivateKey = await Promise.all(
|
|
276154
|
+
const nodesWithPrivateKey = await Promise.all(evmNodes.map((node2) => settlemint.blockchainNode.read(node2.id)));
|
|
276010
276155
|
const nodesWithActivePrivateKey = nodesWithPrivateKey.filter((node2) => node2.privateKeys && node2.privateKeys.length > 0);
|
|
276011
276156
|
if (nodesWithActivePrivateKey.length === 0) {
|
|
276012
|
-
cancel2("No blockchain nodes with private keys found. Please activate a private key on your blockchain node and try again.");
|
|
276157
|
+
cancel2("No EVM blockchain nodes with private keys found. Please activate a private key on your EVM blockchain node and try again.");
|
|
276013
276158
|
}
|
|
276014
276159
|
const blockchainNode = await blockchainNodePrompt(env2, nodesWithActivePrivateKey, autoAccept);
|
|
276015
276160
|
if (!blockchainNode) {
|
|
276016
|
-
cancel2("No
|
|
276161
|
+
cancel2("No EVM blockchain node selected. Please select one to continue.");
|
|
276017
276162
|
}
|
|
276018
276163
|
node = blockchainNode;
|
|
276019
276164
|
} else {
|
|
276020
|
-
node = await settlemint.blockchainNode.read(
|
|
276165
|
+
node = await settlemint.blockchainNode.read(nodeId);
|
|
276166
|
+
if (!node.isEvm) {
|
|
276167
|
+
cancel2("The specified blockchain node is not an EVM blockchain node. Please specify an EVM blockchain node to continue.");
|
|
276168
|
+
}
|
|
276021
276169
|
}
|
|
276022
276170
|
const envConfig = await settlemint.foundry.env(node.id);
|
|
276023
276171
|
const hardhatConfig = await getHardhatConfigData(envConfig);
|
|
@@ -276087,11 +276235,14 @@ function hardhatScriptRemoteCommand() {
|
|
|
276087
276235
|
cmd2.action(async ({ script, prod, blockchainNodeId, acceptDefaults, compile }) => {
|
|
276088
276236
|
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
|
276089
276237
|
const env2 = await loadEnv(false, !!prod);
|
|
276090
|
-
const accessToken = env2.SETTLEMINT_ACCESS_TOKEN;
|
|
276091
|
-
if (!accessToken) {
|
|
276092
|
-
return missingAccessTokenError();
|
|
276093
|
-
}
|
|
276094
276238
|
const instance = await instancePrompt(env2, true);
|
|
276239
|
+
const accessToken = await getApplicationOrPersonalAccessToken({
|
|
276240
|
+
validateEnv: false,
|
|
276241
|
+
prod: !!prod,
|
|
276242
|
+
instance,
|
|
276243
|
+
prefer: "application",
|
|
276244
|
+
strict: false
|
|
276245
|
+
});
|
|
276095
276246
|
const settlemint = createSettleMintClient({
|
|
276096
276247
|
accessToken,
|
|
276097
276248
|
instance
|
|
@@ -276333,11 +276484,14 @@ function subgraphBuildCommand() {
|
|
|
276333
276484
|
return new Command2("build").description("Build the subgraph").option("-a, --accept-defaults", "Accept the default and previously set values").option("--prod", "Connect to your production environment").action(async ({ acceptDefaults, prod }) => {
|
|
276334
276485
|
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
|
276335
276486
|
const env2 = await loadEnv(false, !!prod);
|
|
276336
|
-
const accessToken = env2.SETTLEMINT_ACCESS_TOKEN;
|
|
276337
|
-
if (!accessToken) {
|
|
276338
|
-
return missingAccessTokenError();
|
|
276339
|
-
}
|
|
276340
276487
|
const instance = await instancePrompt(env2, true);
|
|
276488
|
+
const accessToken = await getApplicationOrPersonalAccessToken({
|
|
276489
|
+
validateEnv: false,
|
|
276490
|
+
prod: !!prod,
|
|
276491
|
+
instance,
|
|
276492
|
+
prefer: "application",
|
|
276493
|
+
strict: true
|
|
276494
|
+
});
|
|
276341
276495
|
await subgraphSetup({
|
|
276342
276496
|
env: env2,
|
|
276343
276497
|
instance,
|
|
@@ -276358,11 +276512,14 @@ function subgraphCodegenCommand() {
|
|
|
276358
276512
|
return new Command2("codegen").option("-a, --accept-defaults", "Accept the default and previously set values").option("--prod", "Connect to your production environment").description("Codegen the subgraph types").action(async ({ acceptDefaults, prod }) => {
|
|
276359
276513
|
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
|
276360
276514
|
const env2 = await loadEnv(false, !!prod);
|
|
276361
|
-
const accessToken = env2.SETTLEMINT_ACCESS_TOKEN;
|
|
276362
|
-
if (!accessToken) {
|
|
276363
|
-
return missingAccessTokenError();
|
|
276364
|
-
}
|
|
276365
276515
|
const instance = await instancePrompt(env2, true);
|
|
276516
|
+
const accessToken = await getApplicationOrPersonalAccessToken({
|
|
276517
|
+
validateEnv: false,
|
|
276518
|
+
prod: !!prod,
|
|
276519
|
+
instance,
|
|
276520
|
+
prefer: "application",
|
|
276521
|
+
strict: true
|
|
276522
|
+
});
|
|
276366
276523
|
await subgraphSetup({
|
|
276367
276524
|
env: env2,
|
|
276368
276525
|
instance,
|
|
@@ -276412,11 +276569,14 @@ function subgraphDeployCommand() {
|
|
|
276412
276569
|
return new Command2("deploy").description("Deploy the subgraph").option("-a, --accept-defaults", "Accept the default and previously set values").option("--prod", "Connect to your production environment").argument("[subgraphName]", "The name of the subgraph to deploy (defaults to value in .env if not provided)").action(async (subgraphName, { prod, acceptDefaults }) => {
|
|
276413
276570
|
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
|
276414
276571
|
const env2 = await loadEnv(false, !!prod);
|
|
276415
|
-
const accessToken = env2.SETTLEMINT_ACCESS_TOKEN;
|
|
276416
|
-
if (!accessToken) {
|
|
276417
|
-
return missingAccessTokenError();
|
|
276418
|
-
}
|
|
276419
276572
|
const instance = await instancePrompt(env2, true);
|
|
276573
|
+
const accessToken = await getApplicationOrPersonalAccessToken({
|
|
276574
|
+
validateEnv: false,
|
|
276575
|
+
prod: !!prod,
|
|
276576
|
+
instance,
|
|
276577
|
+
prefer: "application",
|
|
276578
|
+
strict: true
|
|
276579
|
+
});
|
|
276420
276580
|
const theGraphMiddleware = await subgraphSetup({
|
|
276421
276581
|
env: env2,
|
|
276422
276582
|
instance,
|
|
@@ -276508,4 +276668,4 @@ sdkcli.parseAsync(process.argv).catch((reason) => {
|
|
|
276508
276668
|
cancel2(reason);
|
|
276509
276669
|
});
|
|
276510
276670
|
|
|
276511
|
-
//# debugId=
|
|
276671
|
+
//# debugId=CE0B32FFC7EEE03E64756E2164756E21
|