@robinmordasiewicz/f5xc-xcsh 2.0.21-2601090658 → 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.
Files changed (2) hide show
  1. package/dist/index.js +11 -6
  2. 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-2601090658") {
46998
- return "v2.0.21-2601090658";
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;
@@ -77873,14 +77873,19 @@ function renderResponse(response) {
77873
77873
  }
77874
77874
  return lines;
77875
77875
  }
77876
+ function stripHtml(html) {
77877
+ return html.replace(/&amp;/g, "&").replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&quot;/g, '"').replace(/&#39;/g, "'").replace(/&nbsp;/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
+ }
77876
77879
  function renderGenericResponse(response) {
77877
77880
  const lines = [];
77878
- if (response.error) {
77879
- lines.push(`Error: ${response.error}`);
77881
+ if (response.is_error || response.error && response.error !== null) {
77882
+ lines.push(`Error: ${response.error ?? "Unknown error"}`);
77880
77883
  return lines;
77881
77884
  }
77882
- if (response.text) {
77883
- lines.push(...response.text.split("\n"));
77885
+ const content = response.summary ?? response.text;
77886
+ if (content) {
77887
+ const plainText = stripHtml(content);
77888
+ lines.push(...plainText.split("\n"));
77884
77889
  }
77885
77890
  if (response.links && response.links.length > 0) {
77886
77891
  lines.push("");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@robinmordasiewicz/f5xc-xcsh",
3
- "version": "2.0.21-2601090658",
3
+ "version": "2.0.21-2601091357",
4
4
  "description": "F5 Distributed Cloud Shell - Interactive CLI for F5 XC",
5
5
  "type": "module",
6
6
  "bin": {