@settlemint/sdk-cli 1.0.8-main8adcdc2a → 1.0.8-main97edc681
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 +168 -24
- package/dist/cli.js.map +19 -17
- package/package.json +3 -3
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.3lhXtrWZLx:/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-main97edc681",
|
|
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.3lhXtrWZLx:/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.3lhXtrWZLx:/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.3lhXtrWZLx:/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
|
}) => {
|
|
@@ -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.3lhXtrWZLx:/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-main97edc681",
|
|
268412
268412
|
type: "module",
|
|
268413
268413
|
private: false,
|
|
268414
268414
|
license: "FSL-1.1-MIT",
|
|
@@ -268463,8 +268463,8 @@ var package_default = {
|
|
|
268463
268463
|
"@inquirer/input": "4.1.3",
|
|
268464
268464
|
"@inquirer/password": "4.0.6",
|
|
268465
268465
|
"@inquirer/select": "4.0.6",
|
|
268466
|
-
"@settlemint/sdk-js": "1.0.8-
|
|
268467
|
-
"@settlemint/sdk-utils": "1.0.8-
|
|
268466
|
+
"@settlemint/sdk-js": "1.0.8-main97edc681",
|
|
268467
|
+
"@settlemint/sdk-utils": "1.0.8-main97edc681",
|
|
268468
268468
|
"get-tsconfig": "4.10.0",
|
|
268469
268469
|
giget: "1.2.3",
|
|
268470
268470
|
yaml: "2.7.0"
|
|
@@ -271885,7 +271885,8 @@ async function servicePrompt({
|
|
|
271885
271885
|
envKey,
|
|
271886
271886
|
defaultHandler,
|
|
271887
271887
|
isRequired = false,
|
|
271888
|
-
isCi = is_in_ci_default
|
|
271888
|
+
isCi = is_in_ci_default,
|
|
271889
|
+
singleOptionMessage
|
|
271889
271890
|
}) {
|
|
271890
271891
|
if (services.length === 0) {
|
|
271891
271892
|
return;
|
|
@@ -271899,6 +271900,9 @@ async function servicePrompt({
|
|
|
271899
271900
|
return;
|
|
271900
271901
|
}
|
|
271901
271902
|
if (isRequired && services.length === 1) {
|
|
271903
|
+
if (singleOptionMessage) {
|
|
271904
|
+
note(singleOptionMessage(services[0].uniqueName));
|
|
271905
|
+
}
|
|
271902
271906
|
return services[0];
|
|
271903
271907
|
}
|
|
271904
271908
|
const choices = services.map((service) => ({
|
|
@@ -271919,6 +271923,8 @@ async function blockchainNodePrompt({
|
|
|
271919
271923
|
env: env2,
|
|
271920
271924
|
nodes,
|
|
271921
271925
|
accept,
|
|
271926
|
+
singleOptionMessage,
|
|
271927
|
+
promptMessage,
|
|
271922
271928
|
filterRunningOnly = false,
|
|
271923
271929
|
isRequired = false
|
|
271924
271930
|
}) {
|
|
@@ -271931,11 +271937,12 @@ async function blockchainNodePrompt({
|
|
|
271931
271937
|
defaultHandler: async ({ defaultService: defaultNode, choices }) => {
|
|
271932
271938
|
const filteredChoices = filterRunningOnly ? choices.filter(({ value: node }) => node === undefined || node?.status === "COMPLETED") : choices;
|
|
271933
271939
|
return esm_default2({
|
|
271934
|
-
message: "Which blockchain node do you want to connect to?",
|
|
271940
|
+
message: promptMessage ?? "Which blockchain node do you want to connect to?",
|
|
271935
271941
|
choices: filteredChoices,
|
|
271936
271942
|
default: defaultNode
|
|
271937
271943
|
});
|
|
271938
|
-
}
|
|
271944
|
+
},
|
|
271945
|
+
singleOptionMessage
|
|
271939
271946
|
});
|
|
271940
271947
|
}
|
|
271941
271948
|
|
|
@@ -272107,6 +272114,9 @@ async function portalPrompt({
|
|
|
272107
272114
|
}
|
|
272108
272115
|
|
|
272109
272116
|
// src/prompts/cluster-service/thegraph.prompt.ts
|
|
272117
|
+
function isHAGraphMiddleware(middleware) {
|
|
272118
|
+
return middleware.__typename === "HAGraphMiddleware";
|
|
272119
|
+
}
|
|
272110
272120
|
async function theGraphPrompt({
|
|
272111
272121
|
env: env2,
|
|
272112
272122
|
middlewares,
|
|
@@ -272114,7 +272124,7 @@ async function theGraphPrompt({
|
|
|
272114
272124
|
filterRunningOnly = false,
|
|
272115
272125
|
isRequired = false
|
|
272116
272126
|
}) {
|
|
272117
|
-
const graphMiddlewares = middlewares.filter(
|
|
272127
|
+
const graphMiddlewares = middlewares.filter(isHAGraphMiddleware);
|
|
272118
272128
|
return servicePrompt({
|
|
272119
272129
|
env: env2,
|
|
272120
272130
|
services: graphMiddlewares,
|
|
@@ -277284,14 +277294,6 @@ function configCommand() {
|
|
|
277284
277294
|
});
|
|
277285
277295
|
}
|
|
277286
277296
|
|
|
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
277297
|
// src/spinners/applications.spinner.ts
|
|
277296
277298
|
async function applicationsSpinner(settlemint, workspaceUniqueName) {
|
|
277297
277299
|
return spinner({
|
|
@@ -277391,6 +277393,83 @@ var $stringify = publicApi.stringify;
|
|
|
277391
277393
|
var $visit = visit2.visit;
|
|
277392
277394
|
var $visitAsync = visit2.visitAsync;
|
|
277393
277395
|
|
|
277396
|
+
// src/commands/platform/application/list.ts
|
|
277397
|
+
function applicationsListCommand() {
|
|
277398
|
+
return new Command("applications").alias("a").description("List applications").usage(createExamples([
|
|
277399
|
+
{
|
|
277400
|
+
description: "List applications",
|
|
277401
|
+
command: "platform list applications"
|
|
277402
|
+
},
|
|
277403
|
+
{
|
|
277404
|
+
description: "List applications in wide format with more information",
|
|
277405
|
+
command: "platform list applications -o wide"
|
|
277406
|
+
},
|
|
277407
|
+
{
|
|
277408
|
+
description: "List applications in JSON format",
|
|
277409
|
+
command: "platform list applications -o json > applications.json"
|
|
277410
|
+
},
|
|
277411
|
+
{
|
|
277412
|
+
description: "List applications in YAML format",
|
|
277413
|
+
command: "platform list applications -o yaml > applications.yaml"
|
|
277414
|
+
}
|
|
277415
|
+
])).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 }) => {
|
|
277416
|
+
const printToTerminal = !output || output === "wide";
|
|
277417
|
+
if (printToTerminal) {
|
|
277418
|
+
intro("Listing applications");
|
|
277419
|
+
}
|
|
277420
|
+
const env2 = await loadEnv(false, false);
|
|
277421
|
+
const selectedInstance = await instancePrompt(env2, true);
|
|
277422
|
+
const personalAccessToken = await getInstanceCredentials(selectedInstance);
|
|
277423
|
+
if (!personalAccessToken) {
|
|
277424
|
+
return missingPersonalAccessTokenError();
|
|
277425
|
+
}
|
|
277426
|
+
const settlemint = createSettleMintClient({
|
|
277427
|
+
accessToken: personalAccessToken.personalAccessToken,
|
|
277428
|
+
instance: selectedInstance
|
|
277429
|
+
});
|
|
277430
|
+
const workspaceUniqueName = workspace ?? env2.SETTLEMINT_WORKSPACE ?? await selectWorkspace(settlemint, env2);
|
|
277431
|
+
const applications = await applicationsSpinner(settlemint, workspaceUniqueName);
|
|
277432
|
+
const wide = output === "wide";
|
|
277433
|
+
const applicationsData = applications.map((application) => {
|
|
277434
|
+
const basicFields = {
|
|
277435
|
+
name: application.name,
|
|
277436
|
+
uniqueName: application.uniqueName
|
|
277437
|
+
};
|
|
277438
|
+
if (wide || !printToTerminal) {
|
|
277439
|
+
return {
|
|
277440
|
+
...basicFields,
|
|
277441
|
+
url: getApplicationUrl(selectedInstance, application)
|
|
277442
|
+
};
|
|
277443
|
+
}
|
|
277444
|
+
return basicFields;
|
|
277445
|
+
});
|
|
277446
|
+
if (printToTerminal) {
|
|
277447
|
+
const selectedWorkspace = await settlemint.workspace.read(workspaceUniqueName);
|
|
277448
|
+
table(`Applications for workspace ${selectedWorkspace.name} (${selectedWorkspace}) - ${getWorkspaceUrl(selectedInstance, selectedWorkspace)}`, applicationsData);
|
|
277449
|
+
} else if (output === "json") {
|
|
277450
|
+
console.log(JSON.stringify(applicationsData, null, 2));
|
|
277451
|
+
} else if (output === "yaml") {
|
|
277452
|
+
console.log($stringify(applicationsData));
|
|
277453
|
+
}
|
|
277454
|
+
if (printToTerminal) {
|
|
277455
|
+
outro("Applications listed");
|
|
277456
|
+
}
|
|
277457
|
+
});
|
|
277458
|
+
}
|
|
277459
|
+
async function selectWorkspace(settlemint, env2) {
|
|
277460
|
+
const workspaces = await workspaceSpinner(settlemint);
|
|
277461
|
+
const workspace = await workspacePrompt(env2, workspaces, true);
|
|
277462
|
+
return workspace.uniqueName;
|
|
277463
|
+
}
|
|
277464
|
+
|
|
277465
|
+
// src/commands/platform/utils/formatting/format-service-sub-type.ts
|
|
277466
|
+
function formatServiceSubType(service, printToTerminal = true) {
|
|
277467
|
+
if ("__typename" in service && typeof service.__typename === "string") {
|
|
277468
|
+
return printToTerminal ? camelCaseToWords2(service.__typename) : service.__typename;
|
|
277469
|
+
}
|
|
277470
|
+
return printToTerminal ? "Unknown" : "Unknown";
|
|
277471
|
+
}
|
|
277472
|
+
|
|
277394
277473
|
// src/commands/platform/utils/formatting/format-health-status.ts
|
|
277395
277474
|
function formatHealthStatus(healthStatus, printToTerminal = true) {
|
|
277396
277475
|
if (healthStatus === "HEALTHY") {
|
|
@@ -277582,9 +277661,71 @@ function getItemsForServiceType(services, serviceType) {
|
|
|
277582
277661
|
}
|
|
277583
277662
|
}
|
|
277584
277663
|
|
|
277664
|
+
// src/commands/platform/workspace/list.ts
|
|
277665
|
+
function workspacesListCommand() {
|
|
277666
|
+
return new Command("workspaces").alias("w").description("List workspaces").usage(createExamples([
|
|
277667
|
+
{
|
|
277668
|
+
description: "List workspaces",
|
|
277669
|
+
command: "platform list workspaces"
|
|
277670
|
+
},
|
|
277671
|
+
{
|
|
277672
|
+
description: "List workspaces in wide format with more information",
|
|
277673
|
+
command: "platform list workspaces -o wide"
|
|
277674
|
+
},
|
|
277675
|
+
{
|
|
277676
|
+
description: "List workspaces in JSON format",
|
|
277677
|
+
command: "platform list workspaces -o json > workspaces.json"
|
|
277678
|
+
},
|
|
277679
|
+
{
|
|
277680
|
+
description: "List workspaces in YAML format",
|
|
277681
|
+
command: "platform list workspaces -o yaml > workspaces.yaml"
|
|
277682
|
+
}
|
|
277683
|
+
])).addOption(new Option("-o, --output <output>", "The output format").choices(["wide", "json", "yaml"])).action(async ({ output }) => {
|
|
277684
|
+
const printToTerminal = !output || output === "wide";
|
|
277685
|
+
if (printToTerminal) {
|
|
277686
|
+
intro("Listing workspaces");
|
|
277687
|
+
}
|
|
277688
|
+
const env2 = await loadEnv(false, false);
|
|
277689
|
+
const selectedInstance = await instancePrompt(env2, true);
|
|
277690
|
+
const personalAccessToken = await getInstanceCredentials(selectedInstance);
|
|
277691
|
+
if (!personalAccessToken) {
|
|
277692
|
+
return missingPersonalAccessTokenError();
|
|
277693
|
+
}
|
|
277694
|
+
const settlemint = createSettleMintClient({
|
|
277695
|
+
accessToken: personalAccessToken.personalAccessToken,
|
|
277696
|
+
instance: selectedInstance
|
|
277697
|
+
});
|
|
277698
|
+
const workspaces = await workspaceSpinner(settlemint);
|
|
277699
|
+
const wide = output === "wide";
|
|
277700
|
+
const workspacesData = workspaces.map((workspace) => {
|
|
277701
|
+
const basicFields = {
|
|
277702
|
+
name: workspace.name,
|
|
277703
|
+
uniqueName: workspace.uniqueName
|
|
277704
|
+
};
|
|
277705
|
+
if (wide || !printToTerminal) {
|
|
277706
|
+
return {
|
|
277707
|
+
...basicFields,
|
|
277708
|
+
url: getWorkspaceUrl(selectedInstance, workspace)
|
|
277709
|
+
};
|
|
277710
|
+
}
|
|
277711
|
+
return basicFields;
|
|
277712
|
+
});
|
|
277713
|
+
if (printToTerminal) {
|
|
277714
|
+
table("Workspaces", workspacesData);
|
|
277715
|
+
} else if (output === "json") {
|
|
277716
|
+
console.log(JSON.stringify(workspacesData, null, 2));
|
|
277717
|
+
} else if (output === "yaml") {
|
|
277718
|
+
console.log($stringify(workspacesData));
|
|
277719
|
+
}
|
|
277720
|
+
if (printToTerminal) {
|
|
277721
|
+
outro("Workspaces listed");
|
|
277722
|
+
}
|
|
277723
|
+
});
|
|
277724
|
+
}
|
|
277725
|
+
|
|
277585
277726
|
// src/commands/platform/list.ts
|
|
277586
277727
|
function listCommand() {
|
|
277587
|
-
return new Command("list").alias("ls").description("List resources in the SettleMint platform").addCommand(servicesCommand());
|
|
277728
|
+
return new Command("list").alias("ls").description("List resources in the SettleMint platform").addCommand(servicesCommand()).addCommand(workspacesListCommand()).addCommand(applicationsListCommand());
|
|
277588
277729
|
}
|
|
277589
277730
|
|
|
277590
277731
|
// src/commands/platform.ts
|
|
@@ -277876,7 +278017,9 @@ async function selectTargetNode({
|
|
|
277876
278017
|
env: env2,
|
|
277877
278018
|
nodes: nodesWithActivePrivateKey,
|
|
277878
278019
|
accept: autoAccept,
|
|
277879
|
-
isRequired: true
|
|
278020
|
+
isRequired: true,
|
|
278021
|
+
promptMessage: "Which blockchain node do you want to connect to? (Only nodes with private keys activated are shown)",
|
|
278022
|
+
singleOptionMessage: (node2) => `Using '${node2}' - the only node with active private keys. To use a different node, ensure it has a private key activated.`
|
|
277880
278023
|
});
|
|
277881
278024
|
if (!blockchainNode) {
|
|
277882
278025
|
return nothingSelectedError("EVM blockchain node");
|
|
@@ -277891,6 +278034,7 @@ async function selectTargetNode({
|
|
|
277891
278034
|
if (node.status !== "COMPLETED") {
|
|
277892
278035
|
serviceNotRunningError("blockchain node", node.status);
|
|
277893
278036
|
}
|
|
278037
|
+
note(`\uD83D\uDD17 Connected to blockchain node '${node.uniqueName}'`);
|
|
277894
278038
|
return node;
|
|
277895
278039
|
}
|
|
277896
278040
|
|
|
@@ -278571,4 +278715,4 @@ async function sdkCliCommand(argv = process.argv) {
|
|
|
278571
278715
|
// src/cli.ts
|
|
278572
278716
|
sdkCliCommand();
|
|
278573
278717
|
|
|
278574
|
-
//# debugId=
|
|
278718
|
+
//# debugId=560E076B2804CE1F64756E2164756E21
|