@settlemint/sdk-cli 0.7.0 → 0.7.1-main12cc7b0
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 +218 -68
- package/dist/cli.js.map +24 -20
- package/package.json +7 -7
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.r0eO5RVEvF:/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.
|
|
200567
|
+
binaryVersion: "0.7.1-main12cc7b0",
|
|
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.r0eO5RVEvF:/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.r0eO5RVEvF:/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.r0eO5RVEvF:/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.r0eO5RVEvF:/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) : [""];
|
|
@@ -267876,7 +267876,7 @@ export const { client: theGraphClient${nameSuffix}, graphql: theGraphGraphql${na
|
|
|
267876
267876
|
Timestamp: string;
|
|
267877
267877
|
};
|
|
267878
267878
|
}>({
|
|
267879
|
-
instances: JSON.parse(process.env.SETTLEMINT_THEGRAPH_SUBGRAPHS_ENDPOINTS
|
|
267879
|
+
instances: JSON.parse(process.env.SETTLEMINT_THEGRAPH_SUBGRAPHS_ENDPOINTS || '[]'),
|
|
267880
267880
|
accessToken: process.env.SETTLEMINT_ACCESS_TOKEN!, // undefined in browser, by design to not leak the secrets
|
|
267881
267881
|
subgraphName: "${name2}",
|
|
267882
267882
|
});`
|
|
@@ -270326,7 +270326,7 @@ async function codegenIpfs(env2) {
|
|
|
270326
270326
|
const clientTemplate = `import { createServerIpfsClient } from "@settlemint/sdk-ipfs";
|
|
270327
270327
|
|
|
270328
270328
|
export const { client } = createServerIpfsClient({
|
|
270329
|
-
instance: process.env.
|
|
270329
|
+
instance: process.env.SETTLEMINT_IPFS_API_ENDPOINT!,
|
|
270330
270330
|
accessToken: process.env.SETTLEMINT_ACCESS_TOKEN!,
|
|
270331
270331
|
});`;
|
|
270332
270332
|
await writeTemplate(clientTemplate, "/lib/settlemint", "ipfs.ts");
|
|
@@ -270344,7 +270344,7 @@ async function codegenMinio(env2) {
|
|
|
270344
270344
|
const clientTemplate = `import { createServerMinioClient } from "@settlemint/sdk-minio";
|
|
270345
270345
|
|
|
270346
270346
|
export const { client } = createServerMinioClient({
|
|
270347
|
-
instance: process.env.
|
|
270347
|
+
instance: process.env.SETTLEMINT_MINIO_ENDPOINT!,
|
|
270348
270348
|
accessToken: process.env.SETTLEMINT_ACCESS_TOKEN!,
|
|
270349
270349
|
accessKey: process.env.SETTLEMINT_MINIO_ACCESS_KEY!,
|
|
270350
270350
|
secretKey: process.env.SETTLEMINT_MINIO_SECRET_KEY!
|
|
@@ -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.
|
|
273265
|
+
version: "0.7.1-main12cc7b0",
|
|
273262
273266
|
type: "module",
|
|
273263
273267
|
private: false,
|
|
273264
273268
|
license: "FSL-1.1-MIT",
|
|
@@ -273305,12 +273309,12 @@ var package_default = {
|
|
|
273305
273309
|
slugify: "1.6.6",
|
|
273306
273310
|
yoctocolors: "2.1.1",
|
|
273307
273311
|
"@commander-js/extra-typings": "12.1.0",
|
|
273308
|
-
"@inquirer/confirm": "5.1.
|
|
273309
|
-
"@inquirer/input": "4.1.
|
|
273310
|
-
"@inquirer/password": "4.0.
|
|
273311
|
-
"@inquirer/select": "4.0.
|
|
273312
|
-
"@settlemint/sdk-js": "0.7.
|
|
273313
|
-
"@settlemint/sdk-utils": "0.7.
|
|
273312
|
+
"@inquirer/confirm": "5.1.1",
|
|
273313
|
+
"@inquirer/input": "4.1.1",
|
|
273314
|
+
"@inquirer/password": "4.0.4",
|
|
273315
|
+
"@inquirer/select": "4.0.4",
|
|
273316
|
+
"@settlemint/sdk-js": "0.7.1-main12cc7b0",
|
|
273317
|
+
"@settlemint/sdk-utils": "0.7.1-main12cc7b0",
|
|
273314
273318
|
"get-tsconfig": "4.8.1",
|
|
273315
273319
|
giget: "1.2.3"
|
|
273316
273320
|
},
|
|
@@ -274369,6 +274373,26 @@ 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
|
+
env: env2,
|
|
274379
|
+
instance,
|
|
274380
|
+
prefer,
|
|
274381
|
+
allowFallback
|
|
274382
|
+
}) => {
|
|
274383
|
+
const applicationAccessToken = env2.SETTLEMINT_ACCESS_TOKEN;
|
|
274384
|
+
const personalAccessToken = (await getInstanceCredentials(instance))?.personalAccessToken;
|
|
274385
|
+
const preferredToken = prefer === "application" ? applicationAccessToken : personalAccessToken;
|
|
274386
|
+
const fallbackToken = prefer === "application" ? personalAccessToken : applicationAccessToken;
|
|
274387
|
+
if (preferredToken) {
|
|
274388
|
+
return preferredToken;
|
|
274389
|
+
}
|
|
274390
|
+
if (allowFallback && fallbackToken) {
|
|
274391
|
+
return fallbackToken;
|
|
274392
|
+
}
|
|
274393
|
+
return prefer === "personal" ? missingPersonalAccessTokenError() : missingAccessTokenError(!!personalAccessToken);
|
|
274394
|
+
};
|
|
274395
|
+
|
|
274372
274396
|
// src/utils/sanitize-command-name.ts
|
|
274373
274397
|
function sanitizeCommandName(name2) {
|
|
274374
274398
|
return name2.split(" ").join("-").toLowerCase();
|
|
@@ -274390,10 +274414,12 @@ ${createExamples(examples)}`).argument("<name>", `The ${type4} name`).option("-a
|
|
|
274390
274414
|
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
|
274391
274415
|
const env2 = await loadEnv2(false, !!prod);
|
|
274392
274416
|
const instance = await instancePrompt(env2, autoAccept);
|
|
274393
|
-
const accessToken =
|
|
274394
|
-
|
|
274395
|
-
|
|
274396
|
-
|
|
274417
|
+
const accessToken = await getApplicationOrPersonalAccessToken({
|
|
274418
|
+
env: env2,
|
|
274419
|
+
instance,
|
|
274420
|
+
prefer: usePersonalAccessToken ? "personal" : "application",
|
|
274421
|
+
allowFallback: false
|
|
274422
|
+
});
|
|
274397
274423
|
const settlemint = createSettleMintClient({
|
|
274398
274424
|
accessToken,
|
|
274399
274425
|
instance
|
|
@@ -274515,7 +274541,7 @@ function blockchainNetworkBesuCreateCommand() {
|
|
|
274515
274541
|
|
|
274516
274542
|
// src/commands/platform/blockchain-network/create.ts
|
|
274517
274543
|
function blockchainNetworkCreateCommand() {
|
|
274518
|
-
return new Command2("blockchain-network").alias("
|
|
274544
|
+
return new Command2("blockchain-network").alias("bnw").description("Create a blockchain network in the SettleMint platform").addCommand(blockchainNetworkBesuCreateCommand());
|
|
274519
274545
|
}
|
|
274520
274546
|
|
|
274521
274547
|
// src/commands/platform/workspace/create.ts
|
|
@@ -274787,6 +274813,111 @@ function applicationCreateCommand() {
|
|
|
274787
274813
|
});
|
|
274788
274814
|
}
|
|
274789
274815
|
|
|
274816
|
+
// src/commands/connect/blockchain-network.prompt.ts
|
|
274817
|
+
async function blockchainNetworkPrompt(env2, networks, accept) {
|
|
274818
|
+
if (networks.length === 0) {
|
|
274819
|
+
return;
|
|
274820
|
+
}
|
|
274821
|
+
const defaultNetwork = networks.find((network) => network.id === env2.SETTLEMINT_BLOCKCHAIN_NETWORK) ?? (networks.length === 1 ? networks[0] : undefined);
|
|
274822
|
+
const defaultPossible = accept;
|
|
274823
|
+
if (defaultPossible) {
|
|
274824
|
+
return defaultNetwork;
|
|
274825
|
+
}
|
|
274826
|
+
return esm_default2({
|
|
274827
|
+
message: "Which blockchain network do you want to connect to?",
|
|
274828
|
+
choices: [
|
|
274829
|
+
...networks.map((network) => ({
|
|
274830
|
+
name: network.name,
|
|
274831
|
+
value: network
|
|
274832
|
+
})),
|
|
274833
|
+
{
|
|
274834
|
+
name: "None",
|
|
274835
|
+
value: undefined
|
|
274836
|
+
}
|
|
274837
|
+
],
|
|
274838
|
+
default: defaultNetwork
|
|
274839
|
+
});
|
|
274840
|
+
}
|
|
274841
|
+
|
|
274842
|
+
// src/commands/platform/blockchain-node/besu/create.ts
|
|
274843
|
+
function blockchainNodeBesuCreateCommand() {
|
|
274844
|
+
return getCreateCommand({
|
|
274845
|
+
name: "besu",
|
|
274846
|
+
type: "blockchain node",
|
|
274847
|
+
alias: "b",
|
|
274848
|
+
execute: (cmd2, baseAction) => {
|
|
274849
|
+
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, {
|
|
274850
|
+
applicationId,
|
|
274851
|
+
provider,
|
|
274852
|
+
region,
|
|
274853
|
+
size,
|
|
274854
|
+
type: type4,
|
|
274855
|
+
blockchainNetworkId,
|
|
274856
|
+
nodeType,
|
|
274857
|
+
nodeIdentity,
|
|
274858
|
+
acceptDefaults,
|
|
274859
|
+
...defaultArgs
|
|
274860
|
+
}) => {
|
|
274861
|
+
return baseAction(defaultArgs, async (settlemint, env2) => {
|
|
274862
|
+
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
|
274863
|
+
const application = applicationId ?? env2.SETTLEMINT_APPLICATION;
|
|
274864
|
+
if (!application) {
|
|
274865
|
+
cancel2("No application found. Please specify an application or run `settlemint connect` to continue.");
|
|
274866
|
+
}
|
|
274867
|
+
let networkId = blockchainNetworkId ?? (autoAccept ? env2.SETTLEMINT_BLOCKCHAIN_NETWORK : undefined);
|
|
274868
|
+
if (!networkId) {
|
|
274869
|
+
const networks = await settlemint.blockchainNetwork.list(application);
|
|
274870
|
+
const network = await blockchainNetworkPrompt(env2, networks, acceptDefaults ?? false);
|
|
274871
|
+
if (!network) {
|
|
274872
|
+
cancel2("No network found. Please specify a network to continue.");
|
|
274873
|
+
}
|
|
274874
|
+
networkId = network?.id;
|
|
274875
|
+
}
|
|
274876
|
+
const result = await settlemint.blockchainNode.create({
|
|
274877
|
+
applicationId: application,
|
|
274878
|
+
name: name2,
|
|
274879
|
+
blockchainNetworkId: networkId,
|
|
274880
|
+
nodeType,
|
|
274881
|
+
keyMaterial: nodeIdentity,
|
|
274882
|
+
provider,
|
|
274883
|
+
region,
|
|
274884
|
+
size,
|
|
274885
|
+
type: type4
|
|
274886
|
+
});
|
|
274887
|
+
return {
|
|
274888
|
+
result,
|
|
274889
|
+
mapDefaultEnv: () => {
|
|
274890
|
+
return {
|
|
274891
|
+
SETTLEMINT_APPLICATION: application,
|
|
274892
|
+
SETTLEMINT_BLOCKCHAIN_NODE: result.id
|
|
274893
|
+
};
|
|
274894
|
+
}
|
|
274895
|
+
};
|
|
274896
|
+
});
|
|
274897
|
+
});
|
|
274898
|
+
},
|
|
274899
|
+
examples: [
|
|
274900
|
+
{
|
|
274901
|
+
description: "Create a Besu blockchain node and save as default",
|
|
274902
|
+
command: "platform create blockchain-node besu my-node --node-type VALIDATOR --accept-defaults -d"
|
|
274903
|
+
},
|
|
274904
|
+
{
|
|
274905
|
+
description: "Create a Besu blockchain node in a different network",
|
|
274906
|
+
command: "platform create blockchain-node besu my-node --blockchain-network-id 12345 --node-type NON_VALIDATOR --accept-defaults"
|
|
274907
|
+
},
|
|
274908
|
+
{
|
|
274909
|
+
description: "Create a Besu blockchain node in a different application",
|
|
274910
|
+
command: "platform create blockchain-node besu my-node --application-id 123456789 --node-type NON_VALIDATOR --accept-defaults"
|
|
274911
|
+
}
|
|
274912
|
+
]
|
|
274913
|
+
});
|
|
274914
|
+
}
|
|
274915
|
+
|
|
274916
|
+
// src/commands/platform/blockchain-node/create.ts
|
|
274917
|
+
function blockchainNodeCreateCommand() {
|
|
274918
|
+
return new Command2("blockchain-node").alias("bn").description("Create a blockchain node in the SettleMint platform").addCommand(blockchainNodeBesuCreateCommand());
|
|
274919
|
+
}
|
|
274920
|
+
|
|
274790
274921
|
// src/commands/platform/insights/blockscout/create.ts
|
|
274791
274922
|
function blockscoutInsightsCreateCommand() {
|
|
274792
274923
|
return getCreateCommand({
|
|
@@ -274902,16 +275033,14 @@ function graphMiddlewareCreateCommand() {
|
|
|
274902
275033
|
type: "middleware",
|
|
274903
275034
|
alias: "gr",
|
|
274904
275035
|
execute: (cmd2, baseAction) => {
|
|
274905
|
-
addClusterServiceArgs(cmd2).option("--application-id <applicationId>", "Application ID").option("--
|
|
275036
|
+
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
275037
|
return baseAction(defaultArgs, async (settlemint, env2) => {
|
|
274907
275038
|
const application = applicationId ?? env2.SETTLEMINT_APPLICATION;
|
|
274908
275039
|
const blockchainNode = blockchainNodeId ?? env2.SETTLEMINT_BLOCKCHAIN_NODE;
|
|
274909
|
-
const storage = storageId ?? env2.SETTLEMINT_IPFS;
|
|
274910
275040
|
const result = await settlemint.middleware.create({
|
|
274911
275041
|
name: name2,
|
|
274912
275042
|
applicationId: application,
|
|
274913
275043
|
interface: "HA_GRAPH",
|
|
274914
|
-
storageId: storage,
|
|
274915
275044
|
blockchainNodeId: blockchainNode,
|
|
274916
275045
|
provider,
|
|
274917
275046
|
region,
|
|
@@ -275227,7 +275356,7 @@ function storageCreateCommand() {
|
|
|
275227
275356
|
|
|
275228
275357
|
// src/commands/platform/create.ts
|
|
275229
275358
|
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());
|
|
275359
|
+
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
275360
|
}
|
|
275232
275361
|
|
|
275233
275362
|
// src/commands/platform/prompts/delete-confirmation.prompt.ts
|
|
@@ -275282,10 +275411,12 @@ ${createExamples([
|
|
|
275282
275411
|
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
|
275283
275412
|
const env2 = await loadEnv2(false, !!prod);
|
|
275284
275413
|
const instance = await instancePrompt(env2, autoAccept);
|
|
275285
|
-
const accessToken =
|
|
275286
|
-
|
|
275287
|
-
|
|
275288
|
-
|
|
275414
|
+
const accessToken = await getApplicationOrPersonalAccessToken({
|
|
275415
|
+
env: env2,
|
|
275416
|
+
instance,
|
|
275417
|
+
prefer: usePersonalAccessToken ? "personal" : "application",
|
|
275418
|
+
allowFallback: false
|
|
275419
|
+
});
|
|
275289
275420
|
const settlemint = createSettleMintClient({
|
|
275290
275421
|
accessToken,
|
|
275291
275422
|
instance
|
|
@@ -275380,10 +275511,12 @@ ${createExamples([
|
|
|
275380
275511
|
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
|
275381
275512
|
const env2 = await loadEnv2(false, !!prod);
|
|
275382
275513
|
const instance = await instancePrompt(env2, autoAccept);
|
|
275383
|
-
const accessToken =
|
|
275384
|
-
|
|
275385
|
-
|
|
275386
|
-
|
|
275514
|
+
const accessToken = await getApplicationOrPersonalAccessToken({
|
|
275515
|
+
env: env2,
|
|
275516
|
+
instance,
|
|
275517
|
+
prefer: usePersonalAccessToken ? "personal" : "application",
|
|
275518
|
+
allowFallback: false
|
|
275519
|
+
});
|
|
275387
275520
|
const settlemint = createSettleMintClient({
|
|
275388
275521
|
accessToken,
|
|
275389
275522
|
instance
|
|
@@ -275570,11 +275703,13 @@ function customDeploymentsUpdateCommand() {
|
|
|
275570
275703
|
if (!customDeploymentId) {
|
|
275571
275704
|
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
275705
|
}
|
|
275573
|
-
const accessToken = env2.SETTLEMINT_ACCESS_TOKEN;
|
|
275574
|
-
if (!accessToken) {
|
|
275575
|
-
return missingAccessTokenError();
|
|
275576
|
-
}
|
|
275577
275706
|
const instance = await instancePrompt(env2, true);
|
|
275707
|
+
const accessToken = await getApplicationOrPersonalAccessToken({
|
|
275708
|
+
env: env2,
|
|
275709
|
+
instance,
|
|
275710
|
+
prefer: "application",
|
|
275711
|
+
allowFallback: false
|
|
275712
|
+
});
|
|
275578
275713
|
const settlemint = createSettleMintClient({
|
|
275579
275714
|
accessToken,
|
|
275580
275715
|
instance
|
|
@@ -275991,33 +276126,40 @@ function hardhatDeployRemoteCommand() {
|
|
|
275991
276126
|
}) => {
|
|
275992
276127
|
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
|
275993
276128
|
const env2 = await loadEnv(false, !!prod);
|
|
275994
|
-
const accessToken = env2.SETTLEMINT_ACCESS_TOKEN;
|
|
275995
|
-
if (!accessToken) {
|
|
275996
|
-
return missingAccessTokenError();
|
|
275997
|
-
}
|
|
275998
276129
|
const instance = await instancePrompt(env2, true);
|
|
276130
|
+
const accessToken = await getApplicationOrPersonalAccessToken({
|
|
276131
|
+
env: env2,
|
|
276132
|
+
instance,
|
|
276133
|
+
prefer: "application",
|
|
276134
|
+
allowFallback: true
|
|
276135
|
+
});
|
|
275999
276136
|
const settlemint = createSettleMintClient({
|
|
276000
276137
|
accessToken,
|
|
276001
276138
|
instance
|
|
276002
276139
|
});
|
|
276140
|
+
const nodeId = blockchainNodeId ?? (autoAccept ? env2.SETTLEMINT_BLOCKCHAIN_NODE : undefined);
|
|
276003
276141
|
let node = undefined;
|
|
276004
|
-
if (!
|
|
276005
|
-
const
|
|
276006
|
-
|
|
276007
|
-
|
|
276142
|
+
if (!nodeId) {
|
|
276143
|
+
const nodes = await settlemint.blockchainNode.list(env2.SETTLEMINT_APPLICATION);
|
|
276144
|
+
const evmNodes = nodes.filter((node2) => node2.isEvm);
|
|
276145
|
+
if (evmNodes.length === 0) {
|
|
276146
|
+
cancel2("No EVM blockchain nodes found. Please create an EVM blockchain node and try again.");
|
|
276008
276147
|
}
|
|
276009
|
-
const nodesWithPrivateKey = await Promise.all(
|
|
276148
|
+
const nodesWithPrivateKey = await Promise.all(evmNodes.map((node2) => settlemint.blockchainNode.read(node2.id)));
|
|
276010
276149
|
const nodesWithActivePrivateKey = nodesWithPrivateKey.filter((node2) => node2.privateKeys && node2.privateKeys.length > 0);
|
|
276011
276150
|
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.");
|
|
276151
|
+
cancel2("No EVM blockchain nodes with private keys found. Please activate a private key on your EVM blockchain node and try again.");
|
|
276013
276152
|
}
|
|
276014
276153
|
const blockchainNode = await blockchainNodePrompt(env2, nodesWithActivePrivateKey, autoAccept);
|
|
276015
276154
|
if (!blockchainNode) {
|
|
276016
|
-
cancel2("No
|
|
276155
|
+
cancel2("No EVM blockchain node selected. Please select one to continue.");
|
|
276017
276156
|
}
|
|
276018
276157
|
node = blockchainNode;
|
|
276019
276158
|
} else {
|
|
276020
|
-
node = await settlemint.blockchainNode.read(
|
|
276159
|
+
node = await settlemint.blockchainNode.read(nodeId);
|
|
276160
|
+
if (!node.isEvm) {
|
|
276161
|
+
cancel2("The specified blockchain node is not an EVM blockchain node. Please specify an EVM blockchain node to continue.");
|
|
276162
|
+
}
|
|
276021
276163
|
}
|
|
276022
276164
|
const envConfig = await settlemint.foundry.env(node.id);
|
|
276023
276165
|
const hardhatConfig = await getHardhatConfigData(envConfig);
|
|
@@ -276087,11 +276229,13 @@ function hardhatScriptRemoteCommand() {
|
|
|
276087
276229
|
cmd2.action(async ({ script, prod, blockchainNodeId, acceptDefaults, compile }) => {
|
|
276088
276230
|
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
|
276089
276231
|
const env2 = await loadEnv(false, !!prod);
|
|
276090
|
-
const accessToken = env2.SETTLEMINT_ACCESS_TOKEN;
|
|
276091
|
-
if (!accessToken) {
|
|
276092
|
-
return missingAccessTokenError();
|
|
276093
|
-
}
|
|
276094
276232
|
const instance = await instancePrompt(env2, true);
|
|
276233
|
+
const accessToken = await getApplicationOrPersonalAccessToken({
|
|
276234
|
+
env: env2,
|
|
276235
|
+
instance,
|
|
276236
|
+
prefer: "application",
|
|
276237
|
+
allowFallback: true
|
|
276238
|
+
});
|
|
276095
276239
|
const settlemint = createSettleMintClient({
|
|
276096
276240
|
accessToken,
|
|
276097
276241
|
instance
|
|
@@ -276333,11 +276477,13 @@ function subgraphBuildCommand() {
|
|
|
276333
276477
|
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
276478
|
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
|
276335
276479
|
const env2 = await loadEnv(false, !!prod);
|
|
276336
|
-
const accessToken = env2.SETTLEMINT_ACCESS_TOKEN;
|
|
276337
|
-
if (!accessToken) {
|
|
276338
|
-
return missingAccessTokenError();
|
|
276339
|
-
}
|
|
276340
276480
|
const instance = await instancePrompt(env2, true);
|
|
276481
|
+
const accessToken = await getApplicationOrPersonalAccessToken({
|
|
276482
|
+
env: env2,
|
|
276483
|
+
instance,
|
|
276484
|
+
prefer: "application",
|
|
276485
|
+
allowFallback: false
|
|
276486
|
+
});
|
|
276341
276487
|
await subgraphSetup({
|
|
276342
276488
|
env: env2,
|
|
276343
276489
|
instance,
|
|
@@ -276358,11 +276504,13 @@ function subgraphCodegenCommand() {
|
|
|
276358
276504
|
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
276505
|
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
|
276360
276506
|
const env2 = await loadEnv(false, !!prod);
|
|
276361
|
-
const accessToken = env2.SETTLEMINT_ACCESS_TOKEN;
|
|
276362
|
-
if (!accessToken) {
|
|
276363
|
-
return missingAccessTokenError();
|
|
276364
|
-
}
|
|
276365
276507
|
const instance = await instancePrompt(env2, true);
|
|
276508
|
+
const accessToken = await getApplicationOrPersonalAccessToken({
|
|
276509
|
+
env: env2,
|
|
276510
|
+
instance,
|
|
276511
|
+
prefer: "application",
|
|
276512
|
+
allowFallback: false
|
|
276513
|
+
});
|
|
276366
276514
|
await subgraphSetup({
|
|
276367
276515
|
env: env2,
|
|
276368
276516
|
instance,
|
|
@@ -276412,11 +276560,13 @@ function subgraphDeployCommand() {
|
|
|
276412
276560
|
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
276561
|
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
|
276414
276562
|
const env2 = await loadEnv(false, !!prod);
|
|
276415
|
-
const accessToken = env2.SETTLEMINT_ACCESS_TOKEN;
|
|
276416
|
-
if (!accessToken) {
|
|
276417
|
-
return missingAccessTokenError();
|
|
276418
|
-
}
|
|
276419
276563
|
const instance = await instancePrompt(env2, true);
|
|
276564
|
+
const accessToken = await getApplicationOrPersonalAccessToken({
|
|
276565
|
+
env: env2,
|
|
276566
|
+
instance,
|
|
276567
|
+
prefer: "application",
|
|
276568
|
+
allowFallback: false
|
|
276569
|
+
});
|
|
276420
276570
|
const theGraphMiddleware = await subgraphSetup({
|
|
276421
276571
|
env: env2,
|
|
276422
276572
|
instance,
|
|
@@ -276508,4 +276658,4 @@ sdkcli.parseAsync(process.argv).catch((reason) => {
|
|
|
276508
276658
|
cancel2(reason);
|
|
276509
276659
|
});
|
|
276510
276660
|
|
|
276511
|
-
//# debugId=
|
|
276661
|
+
//# debugId=A16E825A66BA4BE864756E2164756E21
|