@settlemint/sdk-cli 1.0.8-prd53f40a0 → 1.0.8-prd55df8b6
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 +264 -92
- package/dist/cli.js.map +24 -20
- package/package.json +6 -5
package/dist/cli.js
CHANGED
|
@@ -210270,7 +210270,7 @@ ${Bt.cyan(Yt)}
|
|
|
210270
210270
|
code: "ENOENT"
|
|
210271
210271
|
}), getPathInfo = (e9, t7) => {
|
|
210272
210272
|
var r6 = t7.colon || or;
|
|
210273
|
-
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.13.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.
|
|
210273
|
+
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.13.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.3RPAbK6kEA:/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)];
|
|
210274
210274
|
var n6 = nr ? t7.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
|
|
210275
210275
|
var a5 = nr ? n6.split(r6) : [""];
|
|
210276
210276
|
if (nr) {
|
|
@@ -213407,7 +213407,7 @@ ${whileRunning(e9)}`;
|
|
|
213407
213407
|
};
|
|
213408
213408
|
ni = Object.assign(async function _main() {
|
|
213409
213409
|
var e9 = new Cli({
|
|
213410
|
-
binaryVersion: "1.0.8-
|
|
213410
|
+
binaryVersion: "1.0.8-prd55df8b6",
|
|
213411
213411
|
binaryLabel: "gql.tada CLI",
|
|
213412
213412
|
binaryName: "gql.tada"
|
|
213413
213413
|
});
|
|
@@ -220997,7 +220997,7 @@ var require_lib4 = __commonJS((exports, module) => {
|
|
|
220997
220997
|
var rRel = new RegExp(`^\\.${rSlash.source}`);
|
|
220998
220998
|
var getNotFoundError2 = (cmd2) => Object.assign(new Error(`not found: ${cmd2}`), { code: "ENOENT" });
|
|
220999
220999
|
var getPathInfo2 = (cmd2, {
|
|
221000
|
-
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.13.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.
|
|
221000
|
+
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.13.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.3RPAbK6kEA:/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",
|
|
221001
221001
|
pathExt: optPathExt = process.env.PATHEXT,
|
|
221002
221002
|
delimiter: optDelimiter = delimiter
|
|
221003
221003
|
}) => {
|
|
@@ -221201,7 +221201,7 @@ var require_lib5 = __commonJS((exports, module) => {
|
|
|
221201
221201
|
let pathToInitial;
|
|
221202
221202
|
try {
|
|
221203
221203
|
pathToInitial = which.sync(initialCmd, {
|
|
221204
|
-
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.13.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.
|
|
221204
|
+
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.13.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.3RPAbK6kEA:/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",
|
|
221205
221205
|
pathext: options.env && findInObject(options.env, "PATHEXT") || process.env.PATHEXT
|
|
221206
221206
|
}).toLowerCase();
|
|
221207
221207
|
} catch (err) {
|
|
@@ -221918,7 +221918,7 @@ var require_lib6 = __commonJS((exports, module) => {
|
|
|
221918
221918
|
var rRel = new RegExp(`^\\.${rSlash.source}`);
|
|
221919
221919
|
var getNotFoundError2 = (cmd2) => Object.assign(new Error(`not found: ${cmd2}`), { code: "ENOENT" });
|
|
221920
221920
|
var getPathInfo2 = (cmd2, {
|
|
221921
|
-
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.13.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.
|
|
221921
|
+
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.13.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.3RPAbK6kEA:/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",
|
|
221922
221922
|
pathExt: optPathExt = process.env.PATHEXT,
|
|
221923
221923
|
delimiter: optDelimiter = delimiter
|
|
221924
221924
|
}) => {
|
|
@@ -228577,7 +228577,7 @@ var require_ansi_styles = __commonJS((exports, module) => {
|
|
|
228577
228577
|
});
|
|
228578
228578
|
});
|
|
228579
228579
|
|
|
228580
|
-
// ../../node_modules/wrap-ansi/index.js
|
|
228580
|
+
// ../../node_modules/@inquirer/core/node_modules/wrap-ansi/index.js
|
|
228581
228581
|
var require_wrap_ansi = __commonJS((exports, module) => {
|
|
228582
228582
|
var stringWidth = require_string_width();
|
|
228583
228583
|
var stripAnsi2 = require_strip_ansi();
|
|
@@ -235793,7 +235793,7 @@ var require_which2 = __commonJS((exports, module) => {
|
|
|
235793
235793
|
const colon = opt2.colon || COLON;
|
|
235794
235794
|
const pathEnv = cmd2.match(/\//) || isWindows2 && cmd2.match(/\\/) ? [""] : [
|
|
235795
235795
|
...isWindows2 ? [process.cwd()] : [],
|
|
235796
|
-
...(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.13.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.
|
|
235796
|
+
...(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.13.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.3RPAbK6kEA:/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)
|
|
235797
235797
|
];
|
|
235798
235798
|
const pathExtExe = isWindows2 ? opt2.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
|
|
235799
235799
|
const pathExt = isWindows2 ? pathExtExe.split(colon) : [""];
|
|
@@ -268408,7 +268408,7 @@ function table(title, data) {
|
|
|
268408
268408
|
var package_default = {
|
|
268409
268409
|
name: "@settlemint/sdk-cli",
|
|
268410
268410
|
description: "Command-line interface for SettleMint SDK, providing development tools and project management capabilities",
|
|
268411
|
-
version: "1.0.8-
|
|
268411
|
+
version: "1.0.8-prd55df8b6",
|
|
268412
268412
|
type: "module",
|
|
268413
268413
|
private: false,
|
|
268414
268414
|
license: "FSL-1.1-MIT",
|
|
@@ -268448,7 +268448,6 @@ var package_default = {
|
|
|
268448
268448
|
prepack: "cp ../../LICENSE ."
|
|
268449
268449
|
},
|
|
268450
268450
|
dependencies: {
|
|
268451
|
-
hardhat: "2.22.18",
|
|
268452
268451
|
tinyexec: "0.3.2"
|
|
268453
268452
|
},
|
|
268454
268453
|
devDependencies: {
|
|
@@ -268463,13 +268462,15 @@ var package_default = {
|
|
|
268463
268462
|
"@inquirer/input": "4.1.3",
|
|
268464
268463
|
"@inquirer/password": "4.0.6",
|
|
268465
268464
|
"@inquirer/select": "4.0.6",
|
|
268466
|
-
"@settlemint/sdk-js": "1.0.8-
|
|
268467
|
-
"@settlemint/sdk-utils": "1.0.8-
|
|
268465
|
+
"@settlemint/sdk-js": "1.0.8-prd55df8b6",
|
|
268466
|
+
"@settlemint/sdk-utils": "1.0.8-prd55df8b6",
|
|
268468
268467
|
"get-tsconfig": "4.10.0",
|
|
268469
268468
|
giget: "1.2.3",
|
|
268470
268469
|
yaml: "2.7.0"
|
|
268471
268470
|
},
|
|
268472
|
-
peerDependencies: {
|
|
268471
|
+
peerDependencies: {
|
|
268472
|
+
hardhat: "2.22.18"
|
|
268473
|
+
},
|
|
268473
268474
|
engines: {
|
|
268474
268475
|
node: ">=20"
|
|
268475
268476
|
},
|
|
@@ -271885,7 +271886,8 @@ async function servicePrompt({
|
|
|
271885
271886
|
envKey,
|
|
271886
271887
|
defaultHandler,
|
|
271887
271888
|
isRequired = false,
|
|
271888
|
-
isCi = is_in_ci_default
|
|
271889
|
+
isCi = is_in_ci_default,
|
|
271890
|
+
singleOptionMessage
|
|
271889
271891
|
}) {
|
|
271890
271892
|
if (services.length === 0) {
|
|
271891
271893
|
return;
|
|
@@ -271899,6 +271901,9 @@ async function servicePrompt({
|
|
|
271899
271901
|
return;
|
|
271900
271902
|
}
|
|
271901
271903
|
if (isRequired && services.length === 1) {
|
|
271904
|
+
if (singleOptionMessage) {
|
|
271905
|
+
note(singleOptionMessage(services[0].uniqueName));
|
|
271906
|
+
}
|
|
271902
271907
|
return services[0];
|
|
271903
271908
|
}
|
|
271904
271909
|
const choices = services.map((service) => ({
|
|
@@ -271919,6 +271924,8 @@ async function blockchainNodePrompt({
|
|
|
271919
271924
|
env: env2,
|
|
271920
271925
|
nodes,
|
|
271921
271926
|
accept,
|
|
271927
|
+
singleOptionMessage,
|
|
271928
|
+
promptMessage,
|
|
271922
271929
|
filterRunningOnly = false,
|
|
271923
271930
|
isRequired = false
|
|
271924
271931
|
}) {
|
|
@@ -271931,11 +271938,12 @@ async function blockchainNodePrompt({
|
|
|
271931
271938
|
defaultHandler: async ({ defaultService: defaultNode, choices }) => {
|
|
271932
271939
|
const filteredChoices = filterRunningOnly ? choices.filter(({ value: node }) => node === undefined || node?.status === "COMPLETED") : choices;
|
|
271933
271940
|
return esm_default2({
|
|
271934
|
-
message: "Which blockchain node do you want to connect to?",
|
|
271941
|
+
message: promptMessage ?? "Which blockchain node do you want to connect to?",
|
|
271935
271942
|
choices: filteredChoices,
|
|
271936
271943
|
default: defaultNode
|
|
271937
271944
|
});
|
|
271938
|
-
}
|
|
271945
|
+
},
|
|
271946
|
+
singleOptionMessage
|
|
271939
271947
|
});
|
|
271940
271948
|
}
|
|
271941
271949
|
|
|
@@ -272107,6 +272115,9 @@ async function portalPrompt({
|
|
|
272107
272115
|
}
|
|
272108
272116
|
|
|
272109
272117
|
// src/prompts/cluster-service/thegraph.prompt.ts
|
|
272118
|
+
function isHAGraphMiddleware(middleware) {
|
|
272119
|
+
return middleware.__typename === "HAGraphMiddleware";
|
|
272120
|
+
}
|
|
272110
272121
|
async function theGraphPrompt({
|
|
272111
272122
|
env: env2,
|
|
272112
272123
|
middlewares,
|
|
@@ -272114,7 +272125,7 @@ async function theGraphPrompt({
|
|
|
272114
272125
|
filterRunningOnly = false,
|
|
272115
272126
|
isRequired = false
|
|
272116
272127
|
}) {
|
|
272117
|
-
const graphMiddlewares = middlewares.filter(
|
|
272128
|
+
const graphMiddlewares = middlewares.filter(isHAGraphMiddleware);
|
|
272118
272129
|
return servicePrompt({
|
|
272119
272130
|
env: env2,
|
|
272120
272131
|
services: graphMiddlewares,
|
|
@@ -277251,10 +277262,69 @@ function updateCommand() {
|
|
|
277251
277262
|
return new Command("update").alias("u").description("Update a resource in the SettleMint platform").addCommand(customDeploymentsUpdateCommand());
|
|
277252
277263
|
}
|
|
277253
277264
|
|
|
277265
|
+
// src/utils/output/json-output.ts
|
|
277266
|
+
function jsonOutput(data) {
|
|
277267
|
+
console.log(JSON.stringify(data, null, 2));
|
|
277268
|
+
}
|
|
277269
|
+
|
|
277270
|
+
// ../../node_modules/yaml/dist/index.js
|
|
277271
|
+
var composer = require_composer();
|
|
277272
|
+
var Document = require_Document();
|
|
277273
|
+
var Schema = require_Schema();
|
|
277274
|
+
var errors2 = require_errors3();
|
|
277275
|
+
var Alias = require_Alias();
|
|
277276
|
+
var identity3 = require_identity();
|
|
277277
|
+
var Pair = require_Pair();
|
|
277278
|
+
var Scalar = require_Scalar();
|
|
277279
|
+
var YAMLMap = require_YAMLMap();
|
|
277280
|
+
var YAMLSeq = require_YAMLSeq();
|
|
277281
|
+
var cst = require_cst();
|
|
277282
|
+
var lexer = require_lexer2();
|
|
277283
|
+
var lineCounter = require_line_counter();
|
|
277284
|
+
var parser = require_parser2();
|
|
277285
|
+
var publicApi = require_public_api();
|
|
277286
|
+
var visit2 = require_visit();
|
|
277287
|
+
var $Composer = composer.Composer;
|
|
277288
|
+
var $Document = Document.Document;
|
|
277289
|
+
var $Schema = Schema.Schema;
|
|
277290
|
+
var $YAMLError = errors2.YAMLError;
|
|
277291
|
+
var $YAMLParseError = errors2.YAMLParseError;
|
|
277292
|
+
var $YAMLWarning = errors2.YAMLWarning;
|
|
277293
|
+
var $Alias = Alias.Alias;
|
|
277294
|
+
var $isAlias = identity3.isAlias;
|
|
277295
|
+
var $isCollection = identity3.isCollection;
|
|
277296
|
+
var $isDocument = identity3.isDocument;
|
|
277297
|
+
var $isMap = identity3.isMap;
|
|
277298
|
+
var $isNode = identity3.isNode;
|
|
277299
|
+
var $isPair = identity3.isPair;
|
|
277300
|
+
var $isScalar = identity3.isScalar;
|
|
277301
|
+
var $isSeq = identity3.isSeq;
|
|
277302
|
+
var $Pair = Pair.Pair;
|
|
277303
|
+
var $Scalar = Scalar.Scalar;
|
|
277304
|
+
var $YAMLMap = YAMLMap.YAMLMap;
|
|
277305
|
+
var $YAMLSeq = YAMLSeq.YAMLSeq;
|
|
277306
|
+
var $Lexer = lexer.Lexer;
|
|
277307
|
+
var $LineCounter = lineCounter.LineCounter;
|
|
277308
|
+
var $Parser = parser.Parser;
|
|
277309
|
+
var $parse = publicApi.parse;
|
|
277310
|
+
var $parseAllDocuments = publicApi.parseAllDocuments;
|
|
277311
|
+
var $parseDocument = publicApi.parseDocument;
|
|
277312
|
+
var $stringify = publicApi.stringify;
|
|
277313
|
+
var $visit = visit2.visit;
|
|
277314
|
+
var $visitAsync = visit2.visitAsync;
|
|
277315
|
+
|
|
277316
|
+
// src/utils/output/yaml-output.ts
|
|
277317
|
+
function yamlOutput(data) {
|
|
277318
|
+
console.log($stringify(data));
|
|
277319
|
+
}
|
|
277320
|
+
|
|
277254
277321
|
// src/commands/platform/config.ts
|
|
277255
277322
|
function configCommand() {
|
|
277256
|
-
return new Command("config").alias("c").description("Get platform configuration").option("--prod", "Connect to your production environment").option("-i, --instance <instance>", "The instance to connect to (defaults to the instance in the .env file)").action(async ({ prod, instance }) => {
|
|
277257
|
-
|
|
277323
|
+
return new Command("config").alias("c").description("Get platform configuration").option("--prod", "Connect to your production environment").option("-i, --instance <instance>", "The instance to connect to (defaults to the instance in the .env file)").addOption(new Option("-o, --output <output>", "The output format").choices(["json", "yaml"])).action(async ({ prod, instance, output }) => {
|
|
277324
|
+
const printToTerminal = !output;
|
|
277325
|
+
if (printToTerminal) {
|
|
277326
|
+
intro("Getting platform configuration");
|
|
277327
|
+
}
|
|
277258
277328
|
const env2 = await loadEnv(false, !!prod);
|
|
277259
277329
|
const selectedInstance = instance ? sanitizeAndValidateInstanceUrl(instance) : await instancePrompt(env2, true);
|
|
277260
277330
|
const settlemint = createSettleMintClient({
|
|
@@ -277265,33 +277335,39 @@ function configCommand() {
|
|
|
277265
277335
|
const platformConfig = await settlemint.platform.config();
|
|
277266
277336
|
const useCases = getUseCases(platformConfig);
|
|
277267
277337
|
const starterkits = getStarterkits(platformConfig);
|
|
277268
|
-
|
|
277269
|
-
|
|
277270
|
-
|
|
277271
|
-
|
|
277272
|
-
|
|
277273
|
-
|
|
277274
|
-
|
|
277275
|
-
|
|
277276
|
-
|
|
277277
|
-
|
|
277278
|
-
|
|
277279
|
-
|
|
277280
|
-
|
|
277281
|
-
|
|
277282
|
-
|
|
277283
|
-
|
|
277338
|
+
const platformConfigData = {
|
|
277339
|
+
useCases: useCases.map((useCase) => ({
|
|
277340
|
+
id: useCase.id,
|
|
277341
|
+
name: useCase.name
|
|
277342
|
+
})).sort((a7, b4) => a7.name.localeCompare(b4.name)),
|
|
277343
|
+
starterkits: starterkits.map((starterkit) => ({
|
|
277344
|
+
id: starterkit.id,
|
|
277345
|
+
name: starterkit.name
|
|
277346
|
+
})).sort((a7, b4) => a7.name.localeCompare(b4.name)),
|
|
277347
|
+
deploymentEngineTargets: platformConfig.deploymentEngineTargets.filter((provider) => !provider.disabled).flatMap((provider) => provider.clusters.filter((cluster) => !cluster.disabled).map((region) => ({
|
|
277348
|
+
providerId: provider.id,
|
|
277349
|
+
regionId: getRegionId(region.id),
|
|
277350
|
+
providerName: provider.name,
|
|
277351
|
+
regionName: region.name
|
|
277352
|
+
}))).sort((a7, b4) => a7.providerId.localeCompare(b4.providerId) || a7.regionId.localeCompare(b4.regionId)),
|
|
277353
|
+
preDeployedContracts: platformConfig.preDeployedContracts.sort()
|
|
277354
|
+
};
|
|
277355
|
+
if (printToTerminal) {
|
|
277356
|
+
table("Templates (Starterkits)", platformConfigData.starterkits);
|
|
277357
|
+
table("Use cases (Smart Contract Sets)", platformConfigData.useCases);
|
|
277358
|
+
table("Providers and regions", platformConfigData.deploymentEngineTargets);
|
|
277359
|
+
list("Pre-deployed abis (Smart Contract Portal)", platformConfigData.preDeployedContracts);
|
|
277360
|
+
} else if (output === "json") {
|
|
277361
|
+
jsonOutput(platformConfigData);
|
|
277362
|
+
} else if (output === "yaml") {
|
|
277363
|
+
yamlOutput(platformConfigData);
|
|
277364
|
+
}
|
|
277365
|
+
if (printToTerminal) {
|
|
277366
|
+
outro("Platform configuration retrieved");
|
|
277367
|
+
}
|
|
277284
277368
|
});
|
|
277285
277369
|
}
|
|
277286
277370
|
|
|
277287
|
-
// src/commands/platform/utils/formatting/format-service-sub-type.ts
|
|
277288
|
-
function formatServiceSubType(service, printToTerminal = true) {
|
|
277289
|
-
if ("__typename" in service && typeof service.__typename === "string") {
|
|
277290
|
-
return printToTerminal ? camelCaseToWords2(service.__typename) : service.__typename;
|
|
277291
|
-
}
|
|
277292
|
-
return printToTerminal ? "Unknown" : "Unknown";
|
|
277293
|
-
}
|
|
277294
|
-
|
|
277295
277371
|
// src/spinners/applications.spinner.ts
|
|
277296
277372
|
async function applicationsSpinner(settlemint, workspaceUniqueName) {
|
|
277297
277373
|
return spinner({
|
|
@@ -277345,51 +277421,82 @@ function getApplicationUrlPath(application) {
|
|
|
277345
277421
|
return `/applications/${encodeURIComponent(application.id)}`;
|
|
277346
277422
|
}
|
|
277347
277423
|
|
|
277348
|
-
//
|
|
277349
|
-
|
|
277350
|
-
|
|
277351
|
-
|
|
277352
|
-
|
|
277353
|
-
|
|
277354
|
-
|
|
277355
|
-
|
|
277356
|
-
|
|
277357
|
-
|
|
277358
|
-
|
|
277359
|
-
|
|
277360
|
-
|
|
277361
|
-
|
|
277362
|
-
|
|
277363
|
-
|
|
277364
|
-
|
|
277365
|
-
|
|
277366
|
-
|
|
277367
|
-
|
|
277368
|
-
|
|
277369
|
-
|
|
277370
|
-
|
|
277371
|
-
|
|
277372
|
-
|
|
277373
|
-
|
|
277374
|
-
|
|
277375
|
-
|
|
277376
|
-
|
|
277377
|
-
|
|
277378
|
-
|
|
277379
|
-
|
|
277380
|
-
|
|
277381
|
-
|
|
277382
|
-
|
|
277383
|
-
|
|
277384
|
-
|
|
277385
|
-
|
|
277386
|
-
|
|
277387
|
-
|
|
277388
|
-
|
|
277389
|
-
|
|
277390
|
-
|
|
277391
|
-
|
|
277392
|
-
|
|
277424
|
+
// src/commands/platform/application/list.ts
|
|
277425
|
+
function applicationsListCommand() {
|
|
277426
|
+
return new Command("applications").alias("a").description("List applications").usage(createExamples([
|
|
277427
|
+
{
|
|
277428
|
+
description: "List applications",
|
|
277429
|
+
command: "platform list applications"
|
|
277430
|
+
},
|
|
277431
|
+
{
|
|
277432
|
+
description: "List applications in wide format with more information",
|
|
277433
|
+
command: "platform list applications -o wide"
|
|
277434
|
+
},
|
|
277435
|
+
{
|
|
277436
|
+
description: "List applications in JSON format",
|
|
277437
|
+
command: "platform list applications -o json > applications.json"
|
|
277438
|
+
},
|
|
277439
|
+
{
|
|
277440
|
+
description: "List applications in YAML format",
|
|
277441
|
+
command: "platform list applications -o yaml > applications.yaml"
|
|
277442
|
+
}
|
|
277443
|
+
])).option("-w, --workspace <workspace>", "The workspace unique name to list applications for (defaults to workspace from env)").addOption(new Option("-o, --output <output>", "The output format").choices(["wide", "json", "yaml"])).action(async ({ workspace, output }) => {
|
|
277444
|
+
const printToTerminal = !output || output === "wide";
|
|
277445
|
+
if (printToTerminal) {
|
|
277446
|
+
intro("Listing applications");
|
|
277447
|
+
}
|
|
277448
|
+
const env2 = await loadEnv(false, false);
|
|
277449
|
+
const selectedInstance = await instancePrompt(env2, true);
|
|
277450
|
+
const personalAccessToken = await getInstanceCredentials(selectedInstance);
|
|
277451
|
+
if (!personalAccessToken) {
|
|
277452
|
+
return missingPersonalAccessTokenError();
|
|
277453
|
+
}
|
|
277454
|
+
const settlemint = createSettleMintClient({
|
|
277455
|
+
accessToken: personalAccessToken.personalAccessToken,
|
|
277456
|
+
instance: selectedInstance
|
|
277457
|
+
});
|
|
277458
|
+
const workspaceUniqueName = workspace ?? env2.SETTLEMINT_WORKSPACE ?? await selectWorkspace(settlemint, env2);
|
|
277459
|
+
const applications = await applicationsSpinner(settlemint, workspaceUniqueName);
|
|
277460
|
+
const wide = output === "wide";
|
|
277461
|
+
const applicationsData = applications.map((application) => {
|
|
277462
|
+
const basicFields = {
|
|
277463
|
+
name: application.name,
|
|
277464
|
+
uniqueName: application.uniqueName
|
|
277465
|
+
};
|
|
277466
|
+
if (wide || !printToTerminal) {
|
|
277467
|
+
return {
|
|
277468
|
+
...basicFields,
|
|
277469
|
+
url: getApplicationUrl(selectedInstance, application)
|
|
277470
|
+
};
|
|
277471
|
+
}
|
|
277472
|
+
return basicFields;
|
|
277473
|
+
});
|
|
277474
|
+
if (printToTerminal) {
|
|
277475
|
+
const selectedWorkspace = await settlemint.workspace.read(workspaceUniqueName);
|
|
277476
|
+
table(`Applications for workspace ${selectedWorkspace.name} (${selectedWorkspace}) - ${getWorkspaceUrl(selectedInstance, selectedWorkspace)}`, applicationsData);
|
|
277477
|
+
} else if (output === "json") {
|
|
277478
|
+
jsonOutput(applicationsData);
|
|
277479
|
+
} else if (output === "yaml") {
|
|
277480
|
+
yamlOutput(applicationsData);
|
|
277481
|
+
}
|
|
277482
|
+
if (printToTerminal) {
|
|
277483
|
+
outro("Applications listed");
|
|
277484
|
+
}
|
|
277485
|
+
});
|
|
277486
|
+
}
|
|
277487
|
+
async function selectWorkspace(settlemint, env2) {
|
|
277488
|
+
const workspaces = await workspaceSpinner(settlemint);
|
|
277489
|
+
const workspace = await workspacePrompt(env2, workspaces, true);
|
|
277490
|
+
return workspace.uniqueName;
|
|
277491
|
+
}
|
|
277492
|
+
|
|
277493
|
+
// src/commands/platform/utils/formatting/format-service-sub-type.ts
|
|
277494
|
+
function formatServiceSubType(service, printToTerminal = true) {
|
|
277495
|
+
if ("__typename" in service && typeof service.__typename === "string") {
|
|
277496
|
+
return printToTerminal ? camelCaseToWords2(service.__typename) : service.__typename;
|
|
277497
|
+
}
|
|
277498
|
+
return printToTerminal ? "Unknown" : "Unknown";
|
|
277499
|
+
}
|
|
277393
277500
|
|
|
277394
277501
|
// src/commands/platform/utils/formatting/format-health-status.ts
|
|
277395
277502
|
function formatHealthStatus(healthStatus, printToTerminal = true) {
|
|
@@ -277502,9 +277609,9 @@ function servicesCommand() {
|
|
|
277502
277609
|
if (printToTerminal) {
|
|
277503
277610
|
table(`Services for ${selectedApplication.name} (${applicationUniqueName}) - ${getApplicationUrl(selectedInstance, selectedApplication)}`, servicesToShow);
|
|
277504
277611
|
} else if (output === "json") {
|
|
277505
|
-
|
|
277612
|
+
jsonOutput(data);
|
|
277506
277613
|
} else if (output === "yaml") {
|
|
277507
|
-
|
|
277614
|
+
yamlOutput(data);
|
|
277508
277615
|
}
|
|
277509
277616
|
if (printToTerminal) {
|
|
277510
277617
|
outro("Application services listed");
|
|
@@ -277582,9 +277689,71 @@ function getItemsForServiceType(services, serviceType) {
|
|
|
277582
277689
|
}
|
|
277583
277690
|
}
|
|
277584
277691
|
|
|
277692
|
+
// src/commands/platform/workspace/list.ts
|
|
277693
|
+
function workspacesListCommand() {
|
|
277694
|
+
return new Command("workspaces").alias("w").description("List workspaces").usage(createExamples([
|
|
277695
|
+
{
|
|
277696
|
+
description: "List workspaces",
|
|
277697
|
+
command: "platform list workspaces"
|
|
277698
|
+
},
|
|
277699
|
+
{
|
|
277700
|
+
description: "List workspaces in wide format with more information",
|
|
277701
|
+
command: "platform list workspaces -o wide"
|
|
277702
|
+
},
|
|
277703
|
+
{
|
|
277704
|
+
description: "List workspaces in JSON format",
|
|
277705
|
+
command: "platform list workspaces -o json > workspaces.json"
|
|
277706
|
+
},
|
|
277707
|
+
{
|
|
277708
|
+
description: "List workspaces in YAML format",
|
|
277709
|
+
command: "platform list workspaces -o yaml > workspaces.yaml"
|
|
277710
|
+
}
|
|
277711
|
+
])).addOption(new Option("-o, --output <output>", "The output format").choices(["wide", "json", "yaml"])).action(async ({ output }) => {
|
|
277712
|
+
const printToTerminal = !output || output === "wide";
|
|
277713
|
+
if (printToTerminal) {
|
|
277714
|
+
intro("Listing workspaces");
|
|
277715
|
+
}
|
|
277716
|
+
const env2 = await loadEnv(false, false);
|
|
277717
|
+
const selectedInstance = await instancePrompt(env2, true);
|
|
277718
|
+
const personalAccessToken = await getInstanceCredentials(selectedInstance);
|
|
277719
|
+
if (!personalAccessToken) {
|
|
277720
|
+
return missingPersonalAccessTokenError();
|
|
277721
|
+
}
|
|
277722
|
+
const settlemint = createSettleMintClient({
|
|
277723
|
+
accessToken: personalAccessToken.personalAccessToken,
|
|
277724
|
+
instance: selectedInstance
|
|
277725
|
+
});
|
|
277726
|
+
const workspaces = await workspaceSpinner(settlemint);
|
|
277727
|
+
const wide = output === "wide";
|
|
277728
|
+
const workspacesData = workspaces.map((workspace) => {
|
|
277729
|
+
const basicFields = {
|
|
277730
|
+
name: workspace.name,
|
|
277731
|
+
uniqueName: workspace.uniqueName
|
|
277732
|
+
};
|
|
277733
|
+
if (wide || !printToTerminal) {
|
|
277734
|
+
return {
|
|
277735
|
+
...basicFields,
|
|
277736
|
+
url: getWorkspaceUrl(selectedInstance, workspace)
|
|
277737
|
+
};
|
|
277738
|
+
}
|
|
277739
|
+
return basicFields;
|
|
277740
|
+
});
|
|
277741
|
+
if (printToTerminal) {
|
|
277742
|
+
table("Workspaces", workspacesData);
|
|
277743
|
+
} else if (output === "json") {
|
|
277744
|
+
jsonOutput(workspacesData);
|
|
277745
|
+
} else if (output === "yaml") {
|
|
277746
|
+
yamlOutput(workspacesData);
|
|
277747
|
+
}
|
|
277748
|
+
if (printToTerminal) {
|
|
277749
|
+
outro("Workspaces listed");
|
|
277750
|
+
}
|
|
277751
|
+
});
|
|
277752
|
+
}
|
|
277753
|
+
|
|
277585
277754
|
// src/commands/platform/list.ts
|
|
277586
277755
|
function listCommand() {
|
|
277587
|
-
return new Command("list").alias("ls").description("List resources in the SettleMint platform").addCommand(servicesCommand());
|
|
277756
|
+
return new Command("list").alias("ls").description("List resources in the SettleMint platform").addCommand(servicesCommand()).addCommand(workspacesListCommand()).addCommand(applicationsListCommand());
|
|
277588
277757
|
}
|
|
277589
277758
|
|
|
277590
277759
|
// src/commands/platform.ts
|
|
@@ -277876,7 +278045,9 @@ async function selectTargetNode({
|
|
|
277876
278045
|
env: env2,
|
|
277877
278046
|
nodes: nodesWithActivePrivateKey,
|
|
277878
278047
|
accept: autoAccept,
|
|
277879
|
-
isRequired: true
|
|
278048
|
+
isRequired: true,
|
|
278049
|
+
promptMessage: "Which blockchain node do you want to connect to? (Only nodes with private keys activated are shown)",
|
|
278050
|
+
singleOptionMessage: (node2) => `Using '${node2}' - the only node with active private keys. To use a different node, ensure it has a private key activated.`
|
|
277880
278051
|
});
|
|
277881
278052
|
if (!blockchainNode) {
|
|
277882
278053
|
return nothingSelectedError("EVM blockchain node");
|
|
@@ -277891,6 +278062,7 @@ async function selectTargetNode({
|
|
|
277891
278062
|
if (node.status !== "COMPLETED") {
|
|
277892
278063
|
serviceNotRunningError("blockchain node", node.status);
|
|
277893
278064
|
}
|
|
278065
|
+
note(`\uD83D\uDD17 Connected to blockchain node '${node.uniqueName}'`);
|
|
277894
278066
|
return node;
|
|
277895
278067
|
}
|
|
277896
278068
|
|
|
@@ -278571,4 +278743,4 @@ async function sdkCliCommand(argv = process.argv) {
|
|
|
278571
278743
|
// src/cli.ts
|
|
278572
278744
|
sdkCliCommand();
|
|
278573
278745
|
|
|
278574
|
-
//# debugId=
|
|
278746
|
+
//# debugId=B1C8F833CAF391DF64756E2164756E21
|