@robinmordasiewicz/f5xc-xcsh 2.0.21-2601090523 → 2.0.21-2601090658
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 +36 -8
- 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-2601090658") {
|
|
46998
|
+
return "v2.0.21-2601090658";
|
|
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
|
|
@@ -80472,12 +80479,15 @@ for (const [, info] of domainRegistry) {
|
|
|
80472
80479
|
var domainAliases = /* @__PURE__ */ new Map();
|
|
80473
80480
|
for (const alias of cloudstatusAliases) {
|
|
80474
80481
|
domainAliases.set(alias, "cloudstatus");
|
|
80482
|
+
completionRegistry.registerAlias(alias, "cloudstatus");
|
|
80475
80483
|
}
|
|
80476
80484
|
for (const alias of aiServicesAliases) {
|
|
80477
80485
|
domainAliases.set(alias, "ai_services");
|
|
80486
|
+
completionRegistry.registerAlias(alias, "ai_services");
|
|
80478
80487
|
}
|
|
80479
80488
|
for (const alias of subscriptionAliases) {
|
|
80480
80489
|
domainAliases.set(alias, "subscription");
|
|
80490
|
+
completionRegistry.registerAlias(alias, "subscription");
|
|
80481
80491
|
}
|
|
80482
80492
|
function resolveDomainAlias(name) {
|
|
80483
80493
|
return domainAliases.get(name) ?? name;
|
|
@@ -81920,7 +81930,7 @@ function parseCommand(input) {
|
|
|
81920
81930
|
};
|
|
81921
81931
|
}
|
|
81922
81932
|
if (trimmed.startsWith("/") && trimmed.length > 1) {
|
|
81923
|
-
const parts2 = trimmed.slice(1)
|
|
81933
|
+
const parts2 = parseInputArgs(trimmed.slice(1));
|
|
81924
81934
|
const domainPart = parts2[0] ?? "";
|
|
81925
81935
|
const hasExtension = extensionRegistry.hasExtension(domainPart);
|
|
81926
81936
|
if (isValidDomain(domainPart) || isCustomDomain(domainPart) || hasExtension) {
|
|
@@ -81955,10 +81965,10 @@ function parseCommand(input) {
|
|
|
81955
81965
|
raw: effectiveCommand,
|
|
81956
81966
|
isDirectNavigation: false,
|
|
81957
81967
|
isBuiltin: true,
|
|
81958
|
-
args: trimmed
|
|
81968
|
+
args: parseInputArgs(trimmed).slice(1)
|
|
81959
81969
|
};
|
|
81960
81970
|
}
|
|
81961
|
-
const parts = trimmed
|
|
81971
|
+
const parts = parseInputArgs(trimmed);
|
|
81962
81972
|
return {
|
|
81963
81973
|
raw: trimmed,
|
|
81964
81974
|
isDirectNavigation: false,
|
|
@@ -82078,7 +82088,7 @@ function executeBuiltin(cmd, session, ctx) {
|
|
|
82078
82088
|
};
|
|
82079
82089
|
}
|
|
82080
82090
|
if (command === "whoami" || command.startsWith("whoami ")) {
|
|
82081
|
-
const parts = command
|
|
82091
|
+
const parts = parseInputArgs(command).slice(1);
|
|
82082
82092
|
const options = {};
|
|
82083
82093
|
for (const arg of parts) {
|
|
82084
82094
|
const lowerArg = arg.toLowerCase();
|
|
@@ -82311,7 +82321,25 @@ async function handleDirectNavigation(cmd, ctx, session) {
|
|
|
82311
82321
|
async function handleDomainNavigation(domain, args, ctx, session) {
|
|
82312
82322
|
if (isCustomDomain(domain)) {
|
|
82313
82323
|
const canonicalDomain = resolveDomainAlias(domain);
|
|
82314
|
-
|
|
82324
|
+
let effectiveArgs = args;
|
|
82325
|
+
if (domain !== canonicalDomain) {
|
|
82326
|
+
const domainDef = customDomains.get(canonicalDomain);
|
|
82327
|
+
if (domainDef) {
|
|
82328
|
+
let isCommand = domainDef.commands.has(domain);
|
|
82329
|
+
if (!isCommand) {
|
|
82330
|
+
for (const cmd of domainDef.commands.values()) {
|
|
82331
|
+
if (cmd.aliases?.includes(domain)) {
|
|
82332
|
+
isCommand = true;
|
|
82333
|
+
break;
|
|
82334
|
+
}
|
|
82335
|
+
}
|
|
82336
|
+
}
|
|
82337
|
+
if (isCommand) {
|
|
82338
|
+
effectiveArgs = [domain, ...args];
|
|
82339
|
+
}
|
|
82340
|
+
}
|
|
82341
|
+
}
|
|
82342
|
+
return customDomains.execute(canonicalDomain, effectiveArgs, session);
|
|
82315
82343
|
}
|
|
82316
82344
|
const firstArg = args[0]?.toLowerCase() ?? "";
|
|
82317
82345
|
if (firstArg === "--help" || firstArg === "-h" || firstArg === "help") {
|
|
@@ -82585,7 +82613,7 @@ async function executeAPICommand(session, ctx, cmd) {
|
|
|
82585
82613
|
args = cmd.args;
|
|
82586
82614
|
}
|
|
82587
82615
|
} else {
|
|
82588
|
-
const parts = cmd.raw
|
|
82616
|
+
const parts = parseInputArgs(cmd.raw);
|
|
82589
82617
|
domain = parts[0] ?? "";
|
|
82590
82618
|
action = parts[1]?.toLowerCase() ?? "list";
|
|
82591
82619
|
args = parts.slice(validActions.has(action) ? 2 : 1);
|