@robinmordasiewicz/f5xc-xcsh 2.0.21-2601090626 → 2.0.21-2601091357
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/index.js +26 -11
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -46994,8 +46994,8 @@ function getLogoModeFromEnv(envPrefix) {
|
|
|
46994
46994
|
var CLI_NAME = "xcsh";
|
|
46995
46995
|
var CLI_FULL_NAME = "F5 Distributed Cloud Shell";
|
|
46996
46996
|
function getVersion() {
|
|
46997
|
-
if ("v2.0.21-
|
|
46998
|
-
return "v2.0.21-
|
|
46997
|
+
if ("v2.0.21-2601091357") {
|
|
46998
|
+
return "v2.0.21-2601091357";
|
|
46999
46999
|
}
|
|
47000
47000
|
if (process.env.XCSH_VERSION) {
|
|
47001
47001
|
return process.env.XCSH_VERSION;
|
|
@@ -77130,6 +77130,13 @@ var CompletionRegistry = class {
|
|
|
77130
77130
|
}
|
|
77131
77131
|
}
|
|
77132
77132
|
}
|
|
77133
|
+
/**
|
|
77134
|
+
* Register an alias for a domain
|
|
77135
|
+
* Used for domain aliases that aren't part of the domain definition
|
|
77136
|
+
*/
|
|
77137
|
+
registerAlias(alias, canonicalName) {
|
|
77138
|
+
this.aliases.set(alias, canonicalName);
|
|
77139
|
+
}
|
|
77133
77140
|
/**
|
|
77134
77141
|
* Add or merge children into an existing domain
|
|
77135
77142
|
* Used for extensions that augment API domains
|
|
@@ -77866,14 +77873,19 @@ function renderResponse(response) {
|
|
|
77866
77873
|
}
|
|
77867
77874
|
return lines;
|
|
77868
77875
|
}
|
|
77876
|
+
function stripHtml(html) {
|
|
77877
|
+
return html.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, '"').replace(/'/g, "'").replace(/ /g, " ").replace(/<br\s*\/?>/gi, "\n").replace(/<\/p>/gi, "\n\n").replace(/<\/li>/gi, "\n").replace(/<\/h[1-6]>/gi, "\n\n").replace(/<hr\s*\/?>/gi, "\n---\n").replace(/<a[^>]*href="([^"]*)"[^>]*>([^<]*)<\/a>/gi, "$2 ($1)").replace(/<code>([^<]*)<\/code>/gi, "`$1`").replace(/<li[^>]*>/gi, " \u2022 ").replace(/<h3[^>]*>/gi, "\n### ").replace(/<h[1-6][^>]*>/gi, "\n").replace(/<ol[^>]*>/gi, "").replace(/<\/ol>/gi, "").replace(/<ul[^>]*>/gi, "").replace(/<\/ul>/gi, "").replace(/<strong>([^<]*)<\/strong>/gi, "**$1**").replace(/<b>([^<]*)<\/b>/gi, "**$1**").replace(/<em>([^<]*)<\/em>/gi, "*$1*").replace(/<i>([^<]*)<\/i>/gi, "*$1*").replace(/<[^>]+>/g, "").replace(/\n{3,}/g, "\n\n").trim();
|
|
77878
|
+
}
|
|
77869
77879
|
function renderGenericResponse(response) {
|
|
77870
77880
|
const lines = [];
|
|
77871
|
-
if (response.error) {
|
|
77872
|
-
lines.push(`Error: ${response.error}`);
|
|
77881
|
+
if (response.is_error || response.error && response.error !== null) {
|
|
77882
|
+
lines.push(`Error: ${response.error ?? "Unknown error"}`);
|
|
77873
77883
|
return lines;
|
|
77874
77884
|
}
|
|
77875
|
-
|
|
77876
|
-
|
|
77885
|
+
const content = response.summary ?? response.text;
|
|
77886
|
+
if (content) {
|
|
77887
|
+
const plainText = stripHtml(content);
|
|
77888
|
+
lines.push(...plainText.split("\n"));
|
|
77877
77889
|
}
|
|
77878
77890
|
if (response.links && response.links.length > 0) {
|
|
77879
77891
|
lines.push("");
|
|
@@ -80472,12 +80484,15 @@ for (const [, info] of domainRegistry) {
|
|
|
80472
80484
|
var domainAliases = /* @__PURE__ */ new Map();
|
|
80473
80485
|
for (const alias of cloudstatusAliases) {
|
|
80474
80486
|
domainAliases.set(alias, "cloudstatus");
|
|
80487
|
+
completionRegistry.registerAlias(alias, "cloudstatus");
|
|
80475
80488
|
}
|
|
80476
80489
|
for (const alias of aiServicesAliases) {
|
|
80477
80490
|
domainAliases.set(alias, "ai_services");
|
|
80491
|
+
completionRegistry.registerAlias(alias, "ai_services");
|
|
80478
80492
|
}
|
|
80479
80493
|
for (const alias of subscriptionAliases) {
|
|
80480
80494
|
domainAliases.set(alias, "subscription");
|
|
80495
|
+
completionRegistry.registerAlias(alias, "subscription");
|
|
80481
80496
|
}
|
|
80482
80497
|
function resolveDomainAlias(name) {
|
|
80483
80498
|
return domainAliases.get(name) ?? name;
|
|
@@ -81920,7 +81935,7 @@ function parseCommand(input) {
|
|
|
81920
81935
|
};
|
|
81921
81936
|
}
|
|
81922
81937
|
if (trimmed.startsWith("/") && trimmed.length > 1) {
|
|
81923
|
-
const parts2 = trimmed.slice(1)
|
|
81938
|
+
const parts2 = parseInputArgs(trimmed.slice(1));
|
|
81924
81939
|
const domainPart = parts2[0] ?? "";
|
|
81925
81940
|
const hasExtension = extensionRegistry.hasExtension(domainPart);
|
|
81926
81941
|
if (isValidDomain(domainPart) || isCustomDomain(domainPart) || hasExtension) {
|
|
@@ -81955,10 +81970,10 @@ function parseCommand(input) {
|
|
|
81955
81970
|
raw: effectiveCommand,
|
|
81956
81971
|
isDirectNavigation: false,
|
|
81957
81972
|
isBuiltin: true,
|
|
81958
|
-
args: trimmed
|
|
81973
|
+
args: parseInputArgs(trimmed).slice(1)
|
|
81959
81974
|
};
|
|
81960
81975
|
}
|
|
81961
|
-
const parts = trimmed
|
|
81976
|
+
const parts = parseInputArgs(trimmed);
|
|
81962
81977
|
return {
|
|
81963
81978
|
raw: trimmed,
|
|
81964
81979
|
isDirectNavigation: false,
|
|
@@ -82078,7 +82093,7 @@ function executeBuiltin(cmd, session, ctx) {
|
|
|
82078
82093
|
};
|
|
82079
82094
|
}
|
|
82080
82095
|
if (command === "whoami" || command.startsWith("whoami ")) {
|
|
82081
|
-
const parts = command
|
|
82096
|
+
const parts = parseInputArgs(command).slice(1);
|
|
82082
82097
|
const options = {};
|
|
82083
82098
|
for (const arg of parts) {
|
|
82084
82099
|
const lowerArg = arg.toLowerCase();
|
|
@@ -82603,7 +82618,7 @@ async function executeAPICommand(session, ctx, cmd) {
|
|
|
82603
82618
|
args = cmd.args;
|
|
82604
82619
|
}
|
|
82605
82620
|
} else {
|
|
82606
|
-
const parts = cmd.raw
|
|
82621
|
+
const parts = parseInputArgs(cmd.raw);
|
|
82607
82622
|
domain = parts[0] ?? "";
|
|
82608
82623
|
action = parts[1]?.toLowerCase() ?? "list";
|
|
82609
82624
|
args = parts.slice(validActions.has(action) ? 2 : 1);
|