@settlemint/sdk-cli 1.0.8-pr1bec8f0c → 1.0.8-pr23e99b83
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 +96 -207
- package/dist/cli.js.map +9 -11
- package/package.json +3 -3
package/dist/cli.js
CHANGED
|
@@ -209465,7 +209465,7 @@ ${Bt.cyan(Yt)}
|
|
|
209465
209465
|
code: "ENOENT"
|
|
209466
209466
|
}), getPathInfo = (e9, t7) => {
|
|
209467
209467
|
var r6 = t7.colon || or;
|
|
209468
|
-
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.
|
|
209468
|
+
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.oia2EoFHRj:/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)];
|
|
209469
209469
|
var n6 = nr ? t7.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
|
|
209470
209470
|
var a5 = nr ? n6.split(r6) : [""];
|
|
209471
209471
|
if (nr) {
|
|
@@ -212602,7 +212602,7 @@ ${whileRunning(e9)}`;
|
|
|
212602
212602
|
};
|
|
212603
212603
|
ni = Object.assign(async function _main() {
|
|
212604
212604
|
var e9 = new Cli({
|
|
212605
|
-
binaryVersion: "1.0.8-
|
|
212605
|
+
binaryVersion: "1.0.8-pr23e99b83",
|
|
212606
212606
|
binaryLabel: "gql.tada CLI",
|
|
212607
212607
|
binaryName: "gql.tada"
|
|
212608
212608
|
});
|
|
@@ -220192,7 +220192,7 @@ var require_lib4 = __commonJS((exports, module) => {
|
|
|
220192
220192
|
var rRel = new RegExp(`^\\.${rSlash.source}`);
|
|
220193
220193
|
var getNotFoundError2 = (cmd2) => Object.assign(new Error(`not found: ${cmd2}`), { code: "ENOENT" });
|
|
220194
220194
|
var getPathInfo2 = (cmd2, {
|
|
220195
|
-
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.
|
|
220195
|
+
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.oia2EoFHRj:/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",
|
|
220196
220196
|
pathExt: optPathExt = process.env.PATHEXT,
|
|
220197
220197
|
delimiter: optDelimiter = delimiter
|
|
220198
220198
|
}) => {
|
|
@@ -220396,7 +220396,7 @@ var require_lib5 = __commonJS((exports, module) => {
|
|
|
220396
220396
|
let pathToInitial;
|
|
220397
220397
|
try {
|
|
220398
220398
|
pathToInitial = which.sync(initialCmd, {
|
|
220399
|
-
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.
|
|
220399
|
+
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.oia2EoFHRj:/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",
|
|
220400
220400
|
pathext: options.env && findInObject(options.env, "PATHEXT") || process.env.PATHEXT
|
|
220401
220401
|
}).toLowerCase();
|
|
220402
220402
|
} catch (err) {
|
|
@@ -221113,7 +221113,7 @@ var require_lib6 = __commonJS((exports, module) => {
|
|
|
221113
221113
|
var rRel = new RegExp(`^\\.${rSlash.source}`);
|
|
221114
221114
|
var getNotFoundError2 = (cmd2) => Object.assign(new Error(`not found: ${cmd2}`), { code: "ENOENT" });
|
|
221115
221115
|
var getPathInfo2 = (cmd2, {
|
|
221116
|
-
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.
|
|
221116
|
+
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.oia2EoFHRj:/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",
|
|
221117
221117
|
pathExt: optPathExt = process.env.PATHEXT,
|
|
221118
221118
|
delimiter: optDelimiter = delimiter
|
|
221119
221119
|
}) => {
|
|
@@ -234988,7 +234988,7 @@ var require_which2 = __commonJS((exports, module) => {
|
|
|
234988
234988
|
const colon = opt2.colon || COLON;
|
|
234989
234989
|
const pathEnv = cmd2.match(/\//) || isWindows2 && cmd2.match(/\\/) ? [""] : [
|
|
234990
234990
|
...isWindows2 ? [process.cwd()] : [],
|
|
234991
|
-
...(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.
|
|
234991
|
+
...(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.oia2EoFHRj:/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)
|
|
234992
234992
|
];
|
|
234993
234993
|
const pathExtExe = isWindows2 ? opt2.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
|
|
234994
234994
|
const pathExt = isWindows2 ? pathExtExe.split(colon) : [""];
|
|
@@ -267180,11 +267180,13 @@ function mergeOthers(values, utils, meta) {
|
|
|
267180
267180
|
var maskTokens = (output) => {
|
|
267181
267181
|
return output.replace(/sm_(pat|aat|sat)_[0-9a-zA-Z]+/g, "***");
|
|
267182
267182
|
};
|
|
267183
|
+
var CancelError = class extends Error {
|
|
267184
|
+
};
|
|
267183
267185
|
var cancel = (msg) => {
|
|
267184
267186
|
console.log("");
|
|
267185
267187
|
console.log(inverse(redBright(maskTokens(msg))));
|
|
267186
267188
|
console.log("");
|
|
267187
|
-
|
|
267189
|
+
throw new CancelError(msg);
|
|
267188
267190
|
};
|
|
267189
267191
|
function validate(schema, value) {
|
|
267190
267192
|
try {
|
|
@@ -267481,11 +267483,13 @@ var ascii = () => console.log(magentaBright(`
|
|
|
267481
267483
|
var maskTokens2 = (output) => {
|
|
267482
267484
|
return output.replace(/sm_(pat|aat|sat)_[0-9a-zA-Z]+/g, "***");
|
|
267483
267485
|
};
|
|
267486
|
+
var CancelError2 = class extends Error {
|
|
267487
|
+
};
|
|
267484
267488
|
var cancel2 = (msg) => {
|
|
267485
267489
|
console.log("");
|
|
267486
267490
|
console.log(inverse(redBright(maskTokens2(msg))));
|
|
267487
267491
|
console.log("");
|
|
267488
|
-
|
|
267492
|
+
throw new CancelError2(msg);
|
|
267489
267493
|
};
|
|
267490
267494
|
async function executeCommand(command, args, options) {
|
|
267491
267495
|
const child = spawn(command, args, { env: { ...process.env, ...options?.env } });
|
|
@@ -267562,10 +267566,11 @@ var spinner = async (options) => {
|
|
|
267562
267566
|
return result;
|
|
267563
267567
|
} catch (error) {
|
|
267564
267568
|
spinner2.error(redBright(`${options.startMessage} --> Error!`));
|
|
267565
|
-
|
|
267569
|
+
const errorMessage = maskTokens2(error.message);
|
|
267570
|
+
note(redBright(`${errorMessage}
|
|
267566
267571
|
|
|
267567
267572
|
${error.stack}`));
|
|
267568
|
-
|
|
267573
|
+
throw new Error(errorMessage);
|
|
267569
267574
|
}
|
|
267570
267575
|
};
|
|
267571
267576
|
function capitalizeFirstLetter(val) {
|
|
@@ -267601,7 +267606,7 @@ function table(title, data, compact = true) {
|
|
|
267601
267606
|
var package_default = {
|
|
267602
267607
|
name: "@settlemint/sdk-cli",
|
|
267603
267608
|
description: "Command-line interface for SettleMint SDK, providing development tools and project management capabilities",
|
|
267604
|
-
version: "1.0.8-
|
|
267609
|
+
version: "1.0.8-pr23e99b83",
|
|
267605
267610
|
type: "module",
|
|
267606
267611
|
private: false,
|
|
267607
267612
|
license: "FSL-1.1-MIT",
|
|
@@ -267657,8 +267662,8 @@ var package_default = {
|
|
|
267657
267662
|
"@inquirer/input": "4.1.3",
|
|
267658
267663
|
"@inquirer/password": "4.0.6",
|
|
267659
267664
|
"@inquirer/select": "4.0.6",
|
|
267660
|
-
"@settlemint/sdk-js": "1.0.8-
|
|
267661
|
-
"@settlemint/sdk-utils": "1.0.8-
|
|
267665
|
+
"@settlemint/sdk-js": "1.0.8-pr23e99b83",
|
|
267666
|
+
"@settlemint/sdk-utils": "1.0.8-pr23e99b83",
|
|
267662
267667
|
"get-tsconfig": "4.9.0",
|
|
267663
267668
|
giget: "1.2.3",
|
|
267664
267669
|
yaml: "2.7.0"
|
|
@@ -276455,6 +276460,14 @@ function configCommand() {
|
|
|
276455
276460
|
});
|
|
276456
276461
|
}
|
|
276457
276462
|
|
|
276463
|
+
// src/commands/platform/utils/formatting/format-service-sub-type.ts
|
|
276464
|
+
function formatServiceSubType(service, printToTerminal = true) {
|
|
276465
|
+
if ("__typename" in service && typeof service.__typename === "string") {
|
|
276466
|
+
return printToTerminal ? camelCaseToWords2(service.__typename) : service.__typename;
|
|
276467
|
+
}
|
|
276468
|
+
return printToTerminal ? "Unknown" : "Unknown";
|
|
276469
|
+
}
|
|
276470
|
+
|
|
276458
276471
|
// src/spinners/applications.spinner.ts
|
|
276459
276472
|
async function applicationsSpinner(settlemint, workspaceUniqueName) {
|
|
276460
276473
|
return spinner({
|
|
@@ -276466,6 +276479,35 @@ async function applicationsSpinner(settlemint, workspaceUniqueName) {
|
|
|
276466
276479
|
});
|
|
276467
276480
|
}
|
|
276468
276481
|
|
|
276482
|
+
// src/utils/get-cluster-service-platform-url.ts
|
|
276483
|
+
function getClusterServicePlatformUrl(instance, application, service, serviceType) {
|
|
276484
|
+
return new URL(`workspaces/${encodeURIComponent(application.workspace.id)}/applications/${encodeURIComponent(application.id)}/${getUrlPathForService(service, serviceType)}`, instance).toString();
|
|
276485
|
+
}
|
|
276486
|
+
function getUrlPathForService(service, serviceType) {
|
|
276487
|
+
if (serviceType === "blockchain-network") {
|
|
276488
|
+
return `networks/${encodeURIComponent(service.id)}/details`;
|
|
276489
|
+
}
|
|
276490
|
+
if (serviceType === "blockchain-node") {
|
|
276491
|
+
return `nodes/${encodeURIComponent(service.id)}/details`;
|
|
276492
|
+
}
|
|
276493
|
+
if (serviceType === "middleware") {
|
|
276494
|
+
return `middlewares/${encodeURIComponent(service.id)}/details`;
|
|
276495
|
+
}
|
|
276496
|
+
if (serviceType === "integration-tool") {
|
|
276497
|
+
return `integration/${encodeURIComponent(service.id)}/details`;
|
|
276498
|
+
}
|
|
276499
|
+
if (serviceType === "private-key") {
|
|
276500
|
+
return `keyvault/${encodeURIComponent(service.id)}/details`;
|
|
276501
|
+
}
|
|
276502
|
+
if (serviceType === "storage") {
|
|
276503
|
+
return `storage/${encodeURIComponent(service.id)}/details`;
|
|
276504
|
+
}
|
|
276505
|
+
if (serviceType === "insights") {
|
|
276506
|
+
return `insights/${encodeURIComponent(service.id)}/details`;
|
|
276507
|
+
}
|
|
276508
|
+
return "";
|
|
276509
|
+
}
|
|
276510
|
+
|
|
276469
276511
|
// ../../node_modules/yaml/dist/index.js
|
|
276470
276512
|
var composer = require_composer();
|
|
276471
276513
|
var Document = require_Document();
|
|
@@ -276512,112 +276554,6 @@ var $stringify = publicApi.stringify;
|
|
|
276512
276554
|
var $visit = visit2.visit;
|
|
276513
276555
|
var $visitAsync = visit2.visitAsync;
|
|
276514
276556
|
|
|
276515
|
-
// src/commands/platform/application/list.ts
|
|
276516
|
-
function applicationsListCommand() {
|
|
276517
|
-
return new Command("applications").alias("a").description("List applications").usage(createExamples([
|
|
276518
|
-
{
|
|
276519
|
-
description: "List applications",
|
|
276520
|
-
command: "platform list applications"
|
|
276521
|
-
},
|
|
276522
|
-
{
|
|
276523
|
-
description: "List applications in wide format with more information",
|
|
276524
|
-
command: "platform list applications -o wide"
|
|
276525
|
-
},
|
|
276526
|
-
{
|
|
276527
|
-
description: "List applications in JSON format",
|
|
276528
|
-
command: "platform list applications -o json > applications.json"
|
|
276529
|
-
},
|
|
276530
|
-
{
|
|
276531
|
-
description: "List applications in YAML format",
|
|
276532
|
-
command: "platform list applications -o yaml > applications.yaml"
|
|
276533
|
-
}
|
|
276534
|
-
])).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 }) => {
|
|
276535
|
-
const printToTerminal = !output || output === "wide";
|
|
276536
|
-
if (printToTerminal) {
|
|
276537
|
-
intro("Listing applications");
|
|
276538
|
-
}
|
|
276539
|
-
const env2 = await loadEnv(false, false);
|
|
276540
|
-
const selectedInstance = await instancePrompt(env2, true);
|
|
276541
|
-
const personalAccessToken = await getInstanceCredentials(selectedInstance);
|
|
276542
|
-
if (!personalAccessToken) {
|
|
276543
|
-
return missingPersonalAccessTokenError();
|
|
276544
|
-
}
|
|
276545
|
-
const settlemint = createSettleMintClient({
|
|
276546
|
-
accessToken: personalAccessToken.personalAccessToken,
|
|
276547
|
-
instance: selectedInstance
|
|
276548
|
-
});
|
|
276549
|
-
const workspaceUniqueName = workspace ?? env2.SETTLEMINT_WORKSPACE ?? await selectWorkspace(settlemint, env2);
|
|
276550
|
-
const applications = await applicationsSpinner(settlemint, workspaceUniqueName);
|
|
276551
|
-
const wide = output === "wide";
|
|
276552
|
-
const applicationsData = applications.map((application) => {
|
|
276553
|
-
const basicFields = {
|
|
276554
|
-
name: application.name,
|
|
276555
|
-
uniqueName: application.uniqueName
|
|
276556
|
-
};
|
|
276557
|
-
if (wide || !printToTerminal) {
|
|
276558
|
-
return {
|
|
276559
|
-
...basicFields,
|
|
276560
|
-
url: `https://console-release.settlemint.com/applications/${application.id}/overview`
|
|
276561
|
-
};
|
|
276562
|
-
}
|
|
276563
|
-
return basicFields;
|
|
276564
|
-
});
|
|
276565
|
-
if (printToTerminal) {
|
|
276566
|
-
const selectedWorkspace = await settlemint.workspace.read(workspaceUniqueName);
|
|
276567
|
-
table(`Applications for workspace ${selectedWorkspace.name} (${selectedWorkspace}) - ${"TODO: url"}`, applicationsData);
|
|
276568
|
-
} else if (output === "json") {
|
|
276569
|
-
console.log(JSON.stringify(applicationsData, null, 2));
|
|
276570
|
-
} else if (output === "yaml") {
|
|
276571
|
-
console.log($stringify(applicationsData));
|
|
276572
|
-
}
|
|
276573
|
-
if (printToTerminal) {
|
|
276574
|
-
outro("Applications listed");
|
|
276575
|
-
}
|
|
276576
|
-
});
|
|
276577
|
-
}
|
|
276578
|
-
async function selectWorkspace(settlemint, env2) {
|
|
276579
|
-
const workspaces = await workspaceSpinner(settlemint);
|
|
276580
|
-
const workspace = await workspacePrompt(env2, workspaces, true);
|
|
276581
|
-
return workspace.uniqueName;
|
|
276582
|
-
}
|
|
276583
|
-
|
|
276584
|
-
// src/commands/platform/utils/formatting/format-service-sub-type.ts
|
|
276585
|
-
function formatServiceSubType(service, printToTerminal = true) {
|
|
276586
|
-
if ("__typename" in service && typeof service.__typename === "string") {
|
|
276587
|
-
return printToTerminal ? camelCaseToWords2(service.__typename) : service.__typename;
|
|
276588
|
-
}
|
|
276589
|
-
return printToTerminal ? "Unknown" : "Unknown";
|
|
276590
|
-
}
|
|
276591
|
-
|
|
276592
|
-
// src/utils/get-cluster-service-platform-url.ts
|
|
276593
|
-
function getClusterServicePlatformUrl(instance, application, service, serviceType) {
|
|
276594
|
-
return new URL(`workspaces/${encodeURIComponent(application.workspace.id)}/applications/${encodeURIComponent(application.id)}/${getUrlPathForService(service, serviceType)}`, instance).toString();
|
|
276595
|
-
}
|
|
276596
|
-
function getUrlPathForService(service, serviceType) {
|
|
276597
|
-
if (serviceType === "blockchain-network") {
|
|
276598
|
-
return `networks/${encodeURIComponent(service.id)}/details`;
|
|
276599
|
-
}
|
|
276600
|
-
if (serviceType === "blockchain-node") {
|
|
276601
|
-
return `nodes/${encodeURIComponent(service.id)}/details`;
|
|
276602
|
-
}
|
|
276603
|
-
if (serviceType === "middleware") {
|
|
276604
|
-
return `middlewares/${encodeURIComponent(service.id)}/details`;
|
|
276605
|
-
}
|
|
276606
|
-
if (serviceType === "integration-tool") {
|
|
276607
|
-
return `integration/${encodeURIComponent(service.id)}/details`;
|
|
276608
|
-
}
|
|
276609
|
-
if (serviceType === "private-key") {
|
|
276610
|
-
return `keyvault/${encodeURIComponent(service.id)}/details`;
|
|
276611
|
-
}
|
|
276612
|
-
if (serviceType === "storage") {
|
|
276613
|
-
return `storage/${encodeURIComponent(service.id)}/details`;
|
|
276614
|
-
}
|
|
276615
|
-
if (serviceType === "insights") {
|
|
276616
|
-
return `insights/${encodeURIComponent(service.id)}/details`;
|
|
276617
|
-
}
|
|
276618
|
-
return "";
|
|
276619
|
-
}
|
|
276620
|
-
|
|
276621
276557
|
// src/commands/platform/utils/formatting/format-health-status.ts
|
|
276622
276558
|
function formatHealthStatus(healthStatus, printToTerminal = true) {
|
|
276623
276559
|
if (healthStatus === "HEALTHY") {
|
|
@@ -276811,71 +276747,9 @@ function getItemsForServiceType(services, serviceType) {
|
|
|
276811
276747
|
}
|
|
276812
276748
|
}
|
|
276813
276749
|
|
|
276814
|
-
// src/commands/platform/workspace/list.ts
|
|
276815
|
-
function workspacesListCommand() {
|
|
276816
|
-
return new Command("workspaces").alias("w").description("List workspaces").usage(createExamples([
|
|
276817
|
-
{
|
|
276818
|
-
description: "List workspaces",
|
|
276819
|
-
command: "platform list workspaces"
|
|
276820
|
-
},
|
|
276821
|
-
{
|
|
276822
|
-
description: "List workspaces in wide format with more information",
|
|
276823
|
-
command: "platform list workspaces -o wide"
|
|
276824
|
-
},
|
|
276825
|
-
{
|
|
276826
|
-
description: "List workspaces in JSON format",
|
|
276827
|
-
command: "platform list workspaces -o json > workspaces.json"
|
|
276828
|
-
},
|
|
276829
|
-
{
|
|
276830
|
-
description: "List workspaces in YAML format",
|
|
276831
|
-
command: "platform list workspaces -o yaml > workspaces.yaml"
|
|
276832
|
-
}
|
|
276833
|
-
])).addOption(new Option("-o, --output <output>", "The output format").choices(["wide", "json", "yaml"])).action(async ({ output }) => {
|
|
276834
|
-
const printToTerminal = !output || output === "wide";
|
|
276835
|
-
if (printToTerminal) {
|
|
276836
|
-
intro("Listing workspaces");
|
|
276837
|
-
}
|
|
276838
|
-
const env2 = await loadEnv(false, false);
|
|
276839
|
-
const selectedInstance = await instancePrompt(env2, true);
|
|
276840
|
-
const personalAccessToken = await getInstanceCredentials(selectedInstance);
|
|
276841
|
-
if (!personalAccessToken) {
|
|
276842
|
-
return missingPersonalAccessTokenError();
|
|
276843
|
-
}
|
|
276844
|
-
const settlemint = createSettleMintClient({
|
|
276845
|
-
accessToken: personalAccessToken.personalAccessToken,
|
|
276846
|
-
instance: selectedInstance
|
|
276847
|
-
});
|
|
276848
|
-
const workspaces = await workspaceSpinner(settlemint);
|
|
276849
|
-
const wide = output === "wide";
|
|
276850
|
-
const workspacesData = workspaces.map((workspace) => {
|
|
276851
|
-
const basicFields = {
|
|
276852
|
-
name: workspace.name,
|
|
276853
|
-
uniqueName: workspace.uniqueName
|
|
276854
|
-
};
|
|
276855
|
-
if (wide || !printToTerminal) {
|
|
276856
|
-
return {
|
|
276857
|
-
...basicFields,
|
|
276858
|
-
url: `https://console-release.settlemint.com/workspaces/${workspace.id}/overview`
|
|
276859
|
-
};
|
|
276860
|
-
}
|
|
276861
|
-
return basicFields;
|
|
276862
|
-
});
|
|
276863
|
-
if (printToTerminal) {
|
|
276864
|
-
table("Workspaces", workspacesData);
|
|
276865
|
-
} else if (output === "json") {
|
|
276866
|
-
console.log(JSON.stringify(workspacesData, null, 2));
|
|
276867
|
-
} else if (output === "yaml") {
|
|
276868
|
-
console.log($stringify(workspacesData));
|
|
276869
|
-
}
|
|
276870
|
-
if (printToTerminal) {
|
|
276871
|
-
outro("Workspaces listed");
|
|
276872
|
-
}
|
|
276873
|
-
});
|
|
276874
|
-
}
|
|
276875
|
-
|
|
276876
276750
|
// src/commands/platform/list.ts
|
|
276877
276751
|
function listCommand() {
|
|
276878
|
-
return new Command("list").alias("ls").description("List resources in the SettleMint platform").addCommand(servicesCommand())
|
|
276752
|
+
return new Command("list").alias("ls").description("List resources in the SettleMint platform").addCommand(servicesCommand());
|
|
276879
276753
|
}
|
|
276880
276754
|
|
|
276881
276755
|
// src/commands/platform.ts
|
|
@@ -277781,6 +277655,14 @@ function getCommandPath(command) {
|
|
|
277781
277655
|
}
|
|
277782
277656
|
return parts.join(" ");
|
|
277783
277657
|
}
|
|
277658
|
+
function getCommandPathFromArgv(argv) {
|
|
277659
|
+
const settlemintIndex = argv.indexOf("settlemint");
|
|
277660
|
+
const args = argv.slice(settlemintIndex !== -1 ? settlemintIndex + 1 : 0);
|
|
277661
|
+
if (!args.length) {
|
|
277662
|
+
return null;
|
|
277663
|
+
}
|
|
277664
|
+
return args.join(" ");
|
|
277665
|
+
}
|
|
277784
277666
|
function isLeafCommand(command) {
|
|
277785
277667
|
return command.commands.length === 0;
|
|
277786
277668
|
}
|
|
@@ -277788,18 +277670,20 @@ function isJsonOrYamlOutput(command) {
|
|
|
277788
277670
|
const options = command.opts();
|
|
277789
277671
|
return typeof options.output === "string" && (options.output === "json" || options.output === "yaml");
|
|
277790
277672
|
}
|
|
277791
|
-
function addHooksToCommand(cmd2, rootCmd) {
|
|
277673
|
+
function addHooksToCommand(cmd2, rootCmd, argv) {
|
|
277792
277674
|
const extendedCmd = cmd2;
|
|
277793
277675
|
extendedCmd.hook("preAction", async (thisCommand) => {
|
|
277676
|
+
if (isLeafCommand(thisCommand)) {
|
|
277677
|
+
const commandPath = getCommandPath(thisCommand);
|
|
277678
|
+
rootCmd._lastCommand = thisCommand;
|
|
277679
|
+
rootCmd._lastCommand._commandPath = commandPath;
|
|
277680
|
+
}
|
|
277794
277681
|
if (isLeafCommand(thisCommand) && !isJsonOrYamlOutput(thisCommand)) {
|
|
277795
277682
|
ascii();
|
|
277796
277683
|
}
|
|
277797
|
-
const commandPath = getCommandPath(thisCommand);
|
|
277798
|
-
rootCmd._lastCommand = thisCommand;
|
|
277799
|
-
rootCmd._lastCommand._commandPath = commandPath;
|
|
277800
277684
|
}).hook("postAction", async (thisCommand) => {
|
|
277801
277685
|
if (isLeafCommand(thisCommand)) {
|
|
277802
|
-
const commandPath =
|
|
277686
|
+
const commandPath = thisCommand._commandPath ?? getCommandPathFromArgv(argv);
|
|
277803
277687
|
if (commandPath) {
|
|
277804
277688
|
await telemetry({
|
|
277805
277689
|
command: commandPath,
|
|
@@ -277809,14 +277693,11 @@ function addHooksToCommand(cmd2, rootCmd) {
|
|
|
277809
277693
|
}
|
|
277810
277694
|
});
|
|
277811
277695
|
for (const subcmd of cmd2.commands) {
|
|
277812
|
-
addHooksToCommand(subcmd, rootCmd);
|
|
277696
|
+
addHooksToCommand(subcmd, rootCmd, argv);
|
|
277813
277697
|
}
|
|
277814
277698
|
}
|
|
277815
|
-
function
|
|
277699
|
+
function registerCommands() {
|
|
277816
277700
|
const sdkcli = new Command;
|
|
277817
|
-
if (exitOverride) {
|
|
277818
|
-
sdkcli.exitOverride(exitOverride);
|
|
277819
|
-
}
|
|
277820
277701
|
sdkcli.name("settlemint").usage("[command]").description(`CLI for SettleMint (v${package_default.version})`).version(package_default.version, "-v, --version", "Output the current version").helpOption("-h, --help", "Display help for command").allowUnknownOption().showSuggestionAfterError(true).showHelpAfterError();
|
|
277821
277702
|
sdkcli.addCommand(connectCommand());
|
|
277822
277703
|
sdkcli.addCommand(codegenCommand());
|
|
@@ -277825,26 +277706,34 @@ function sdkCliCommand(exitOverride = undefined) {
|
|
|
277825
277706
|
sdkcli.addCommand(createCommand2());
|
|
277826
277707
|
sdkcli.addCommand(loginCommand());
|
|
277827
277708
|
sdkcli.addCommand(logoutCommand());
|
|
277709
|
+
return sdkcli;
|
|
277710
|
+
}
|
|
277711
|
+
async function sdkCliCommand(argv = process.argv) {
|
|
277712
|
+
const sdkcli = registerCommands();
|
|
277713
|
+
sdkcli.exitOverride(onError);
|
|
277714
|
+
async function onError(error5) {
|
|
277715
|
+
const commandPath = sdkcli._lastCommand?._commandPath ?? getCommandPathFromArgv(argv);
|
|
277716
|
+
if (commandPath) {
|
|
277717
|
+
await telemetry({
|
|
277718
|
+
command: commandPath,
|
|
277719
|
+
status: "error",
|
|
277720
|
+
message: error5.message
|
|
277721
|
+
});
|
|
277722
|
+
}
|
|
277723
|
+
}
|
|
277828
277724
|
for (const cmd2 of sdkcli.commands) {
|
|
277829
|
-
addHooksToCommand(cmd2, sdkcli);
|
|
277725
|
+
addHooksToCommand(cmd2, sdkcli, argv);
|
|
277830
277726
|
}
|
|
277831
|
-
|
|
277832
|
-
sdkcli.parseAsync(
|
|
277833
|
-
|
|
277834
|
-
|
|
277835
|
-
|
|
277836
|
-
|
|
277837
|
-
status: "error",
|
|
277838
|
-
message: error5.message
|
|
277839
|
-
});
|
|
277840
|
-
}
|
|
277841
|
-
cancel2(error5.message);
|
|
277842
|
-
});
|
|
277727
|
+
try {
|
|
277728
|
+
await sdkcli.parseAsync(argv);
|
|
277729
|
+
} catch (err) {
|
|
277730
|
+
const error5 = err;
|
|
277731
|
+
onError(error5);
|
|
277732
|
+
process.exit(1);
|
|
277843
277733
|
}
|
|
277844
|
-
return sdkcli;
|
|
277845
277734
|
}
|
|
277846
277735
|
|
|
277847
277736
|
// src/cli.ts
|
|
277848
277737
|
sdkCliCommand();
|
|
277849
277738
|
|
|
277850
|
-
//# debugId=
|
|
277739
|
+
//# debugId=9FB61B2487A9BA1464756E2164756E21
|