@settlemint/sdk-cli 0.7.0-pra80778e → 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 +119 -62
- package/dist/cli.js.map +16 -15
- 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();
|
|
@@ -274390,10 +274416,13 @@ ${createExamples(examples)}`).argument("<name>", `The ${type4} name`).option("-a
|
|
|
274390
274416
|
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
|
274391
274417
|
const env2 = await loadEnv2(false, !!prod);
|
|
274392
274418
|
const instance = env2.SETTLEMINT_INSTANCE ?? await instancePrompt(env2, autoAccept);
|
|
274393
|
-
const accessToken =
|
|
274394
|
-
|
|
274395
|
-
|
|
274396
|
-
|
|
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
|
|
@@ -274792,17 +274821,17 @@ async function blockchainNetworkPrompt(env2, networks, accept) {
|
|
|
274792
274821
|
if (networks.length === 0) {
|
|
274793
274822
|
return;
|
|
274794
274823
|
}
|
|
274795
|
-
const defaultNetwork = networks.find((
|
|
274824
|
+
const defaultNetwork = networks.find((network) => network.id === env2.SETTLEMINT_BLOCKCHAIN_NETWORK) ?? (networks.length === 1 ? networks[0] : undefined);
|
|
274796
274825
|
const defaultPossible = accept;
|
|
274797
274826
|
if (defaultPossible) {
|
|
274798
274827
|
return defaultNetwork;
|
|
274799
274828
|
}
|
|
274800
|
-
|
|
274829
|
+
return esm_default2({
|
|
274801
274830
|
message: "Which blockchain network do you want to connect to?",
|
|
274802
274831
|
choices: [
|
|
274803
|
-
...networks.map((
|
|
274804
|
-
name:
|
|
274805
|
-
value:
|
|
274832
|
+
...networks.map((network) => ({
|
|
274833
|
+
name: network.name,
|
|
274834
|
+
value: network
|
|
274806
274835
|
})),
|
|
274807
274836
|
{
|
|
274808
274837
|
name: "None",
|
|
@@ -274811,7 +274840,6 @@ async function blockchainNetworkPrompt(env2, networks, accept) {
|
|
|
274811
274840
|
],
|
|
274812
274841
|
default: defaultNetwork
|
|
274813
274842
|
});
|
|
274814
|
-
return network;
|
|
274815
274843
|
}
|
|
274816
274844
|
|
|
274817
274845
|
// src/commands/platform/blockchain-node/besu/create.ts
|
|
@@ -275385,10 +275413,13 @@ ${createExamples([
|
|
|
275385
275413
|
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
|
275386
275414
|
const env2 = await loadEnv2(false, !!prod);
|
|
275387
275415
|
const instance = await instancePrompt(env2, autoAccept);
|
|
275388
|
-
const accessToken =
|
|
275389
|
-
|
|
275390
|
-
|
|
275391
|
-
|
|
275416
|
+
const accessToken = await getApplicationOrPersonalAccessToken({
|
|
275417
|
+
validateEnv: false,
|
|
275418
|
+
prod: !!prod,
|
|
275419
|
+
instance,
|
|
275420
|
+
prefer: usePersonalAccessToken ? "personal" : "application",
|
|
275421
|
+
strict: true
|
|
275422
|
+
});
|
|
275392
275423
|
const settlemint = createSettleMintClient({
|
|
275393
275424
|
accessToken,
|
|
275394
275425
|
instance
|
|
@@ -275483,10 +275514,13 @@ ${createExamples([
|
|
|
275483
275514
|
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
|
275484
275515
|
const env2 = await loadEnv2(false, !!prod);
|
|
275485
275516
|
const instance = await instancePrompt(env2, autoAccept);
|
|
275486
|
-
const accessToken =
|
|
275487
|
-
|
|
275488
|
-
|
|
275489
|
-
|
|
275517
|
+
const accessToken = await getApplicationOrPersonalAccessToken({
|
|
275518
|
+
validateEnv: false,
|
|
275519
|
+
prod: !!prod,
|
|
275520
|
+
instance,
|
|
275521
|
+
prefer: usePersonalAccessToken ? "personal" : "application",
|
|
275522
|
+
strict: true
|
|
275523
|
+
});
|
|
275490
275524
|
const settlemint = createSettleMintClient({
|
|
275491
275525
|
accessToken,
|
|
275492
275526
|
instance
|
|
@@ -275673,11 +275707,14 @@ function customDeploymentsUpdateCommand() {
|
|
|
275673
275707
|
if (!customDeploymentId) {
|
|
275674
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");
|
|
275675
275709
|
}
|
|
275676
|
-
const accessToken = env2.SETTLEMINT_ACCESS_TOKEN;
|
|
275677
|
-
if (!accessToken) {
|
|
275678
|
-
return missingAccessTokenError();
|
|
275679
|
-
}
|
|
275680
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
|
+
});
|
|
275681
275718
|
const settlemint = createSettleMintClient({
|
|
275682
275719
|
accessToken,
|
|
275683
275720
|
instance
|
|
@@ -276094,33 +276131,41 @@ function hardhatDeployRemoteCommand() {
|
|
|
276094
276131
|
}) => {
|
|
276095
276132
|
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
|
276096
276133
|
const env2 = await loadEnv(false, !!prod);
|
|
276097
|
-
const accessToken = env2.SETTLEMINT_ACCESS_TOKEN;
|
|
276098
|
-
if (!accessToken) {
|
|
276099
|
-
return missingAccessTokenError();
|
|
276100
|
-
}
|
|
276101
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
|
+
});
|
|
276102
276142
|
const settlemint = createSettleMintClient({
|
|
276103
276143
|
accessToken,
|
|
276104
276144
|
instance
|
|
276105
276145
|
});
|
|
276146
|
+
const nodeId = autoAccept ? env2.SETTLEMINT_BLOCKCHAIN_NODE : blockchainNodeId;
|
|
276106
276147
|
let node = undefined;
|
|
276107
|
-
if (!
|
|
276108
|
-
const
|
|
276109
|
-
|
|
276110
|
-
|
|
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.");
|
|
276111
276153
|
}
|
|
276112
|
-
const nodesWithPrivateKey = await Promise.all(
|
|
276154
|
+
const nodesWithPrivateKey = await Promise.all(evmNodes.map((node2) => settlemint.blockchainNode.read(node2.id)));
|
|
276113
276155
|
const nodesWithActivePrivateKey = nodesWithPrivateKey.filter((node2) => node2.privateKeys && node2.privateKeys.length > 0);
|
|
276114
276156
|
if (nodesWithActivePrivateKey.length === 0) {
|
|
276115
|
-
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.");
|
|
276116
276158
|
}
|
|
276117
276159
|
const blockchainNode = await blockchainNodePrompt(env2, nodesWithActivePrivateKey, autoAccept);
|
|
276118
276160
|
if (!blockchainNode) {
|
|
276119
|
-
cancel2("No
|
|
276161
|
+
cancel2("No EVM blockchain node selected. Please select one to continue.");
|
|
276120
276162
|
}
|
|
276121
276163
|
node = blockchainNode;
|
|
276122
276164
|
} else {
|
|
276123
|
-
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
|
+
}
|
|
276124
276169
|
}
|
|
276125
276170
|
const envConfig = await settlemint.foundry.env(node.id);
|
|
276126
276171
|
const hardhatConfig = await getHardhatConfigData(envConfig);
|
|
@@ -276190,11 +276235,14 @@ function hardhatScriptRemoteCommand() {
|
|
|
276190
276235
|
cmd2.action(async ({ script, prod, blockchainNodeId, acceptDefaults, compile }) => {
|
|
276191
276236
|
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
|
276192
276237
|
const env2 = await loadEnv(false, !!prod);
|
|
276193
|
-
const accessToken = env2.SETTLEMINT_ACCESS_TOKEN;
|
|
276194
|
-
if (!accessToken) {
|
|
276195
|
-
return missingAccessTokenError();
|
|
276196
|
-
}
|
|
276197
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
|
+
});
|
|
276198
276246
|
const settlemint = createSettleMintClient({
|
|
276199
276247
|
accessToken,
|
|
276200
276248
|
instance
|
|
@@ -276436,11 +276484,14 @@ function subgraphBuildCommand() {
|
|
|
276436
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 }) => {
|
|
276437
276485
|
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
|
276438
276486
|
const env2 = await loadEnv(false, !!prod);
|
|
276439
|
-
const accessToken = env2.SETTLEMINT_ACCESS_TOKEN;
|
|
276440
|
-
if (!accessToken) {
|
|
276441
|
-
return missingAccessTokenError();
|
|
276442
|
-
}
|
|
276443
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
|
+
});
|
|
276444
276495
|
await subgraphSetup({
|
|
276445
276496
|
env: env2,
|
|
276446
276497
|
instance,
|
|
@@ -276461,11 +276512,14 @@ function subgraphCodegenCommand() {
|
|
|
276461
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 }) => {
|
|
276462
276513
|
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
|
276463
276514
|
const env2 = await loadEnv(false, !!prod);
|
|
276464
|
-
const accessToken = env2.SETTLEMINT_ACCESS_TOKEN;
|
|
276465
|
-
if (!accessToken) {
|
|
276466
|
-
return missingAccessTokenError();
|
|
276467
|
-
}
|
|
276468
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
|
+
});
|
|
276469
276523
|
await subgraphSetup({
|
|
276470
276524
|
env: env2,
|
|
276471
276525
|
instance,
|
|
@@ -276515,11 +276569,14 @@ function subgraphDeployCommand() {
|
|
|
276515
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 }) => {
|
|
276516
276570
|
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
|
276517
276571
|
const env2 = await loadEnv(false, !!prod);
|
|
276518
|
-
const accessToken = env2.SETTLEMINT_ACCESS_TOKEN;
|
|
276519
|
-
if (!accessToken) {
|
|
276520
|
-
return missingAccessTokenError();
|
|
276521
|
-
}
|
|
276522
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
|
+
});
|
|
276523
276580
|
const theGraphMiddleware = await subgraphSetup({
|
|
276524
276581
|
env: env2,
|
|
276525
276582
|
instance,
|
|
@@ -276611,4 +276668,4 @@ sdkcli.parseAsync(process.argv).catch((reason) => {
|
|
|
276611
276668
|
cancel2(reason);
|
|
276612
276669
|
});
|
|
276613
276670
|
|
|
276614
|
-
//# debugId=
|
|
276671
|
+
//# debugId=CE0B32FFC7EEE03E64756E2164756E21
|