@robinmordasiewicz/f5xc-xcsh 6.41.0 → 6.43.0
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 +25 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -45354,8 +45354,8 @@ function getLogoModeFromEnv(envPrefix) {
|
|
|
45354
45354
|
var CLI_NAME = "xcsh";
|
|
45355
45355
|
var CLI_FULL_NAME = "F5 Distributed Cloud Shell";
|
|
45356
45356
|
function getVersion() {
|
|
45357
|
-
if ("6.
|
|
45358
|
-
return "6.
|
|
45357
|
+
if ("6.43.0") {
|
|
45358
|
+
return "6.43.0";
|
|
45359
45359
|
}
|
|
45360
45360
|
if (process.env.XCSH_VERSION) {
|
|
45361
45361
|
return process.env.XCSH_VERSION;
|
|
@@ -45821,27 +45821,44 @@ var APIClient = class {
|
|
|
45821
45821
|
this._validationError = "No API token configured";
|
|
45822
45822
|
return { valid: false, error: this._validationError };
|
|
45823
45823
|
}
|
|
45824
|
+
if (this.debug) {
|
|
45825
|
+
console.error(`DEBUG: Validating token against ${this.serverUrl}`);
|
|
45826
|
+
}
|
|
45824
45827
|
try {
|
|
45825
45828
|
await this.get("/api/web/namespaces");
|
|
45826
45829
|
this._isValidated = true;
|
|
45827
45830
|
this._validationError = null;
|
|
45828
45831
|
return { valid: true };
|
|
45829
45832
|
} catch (error) {
|
|
45830
|
-
this._isValidated = false;
|
|
45831
45833
|
if (error instanceof APIError) {
|
|
45832
45834
|
if (error.statusCode === 401) {
|
|
45835
|
+
this._isValidated = false;
|
|
45833
45836
|
this._validationError = "Invalid or expired API token";
|
|
45837
|
+
return { valid: false, error: this._validationError };
|
|
45834
45838
|
} else if (error.statusCode === 403) {
|
|
45839
|
+
this._isValidated = false;
|
|
45835
45840
|
this._validationError = "Token lacks required permissions";
|
|
45836
|
-
|
|
45837
|
-
this._validationError = "Network error - could not reach server";
|
|
45841
|
+
return { valid: false, error: this._validationError };
|
|
45838
45842
|
} else {
|
|
45839
|
-
this.
|
|
45843
|
+
if (this.debug) {
|
|
45844
|
+
console.error(
|
|
45845
|
+
`DEBUG: Validation endpoint returned ${error.statusCode}, assuming token is valid`
|
|
45846
|
+
);
|
|
45847
|
+
}
|
|
45848
|
+
this._isValidated = true;
|
|
45849
|
+
this._validationError = null;
|
|
45850
|
+
return { valid: true };
|
|
45840
45851
|
}
|
|
45841
45852
|
} else {
|
|
45842
|
-
this.
|
|
45853
|
+
if (this.debug) {
|
|
45854
|
+
console.error(
|
|
45855
|
+
`DEBUG: Validation error: ${error instanceof Error ? error.message : "Unknown"}, assuming token is valid`
|
|
45856
|
+
);
|
|
45857
|
+
}
|
|
45858
|
+
this._isValidated = true;
|
|
45859
|
+
this._validationError = null;
|
|
45860
|
+
return { valid: true };
|
|
45843
45861
|
}
|
|
45844
|
-
return { valid: false, error: this._validationError };
|
|
45845
45862
|
}
|
|
45846
45863
|
}
|
|
45847
45864
|
/**
|