@lotics/cli 0.129.0 → 0.130.1
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/render_page.js +4 -0
- package/dist/src/cli.js +44 -12
- package/package.json +1 -1
package/dist/render_page.js
CHANGED
|
@@ -54538,6 +54538,7 @@ ${e.toString()}`);
|
|
|
54538
54538
|
}
|
|
54539
54539
|
function loadSheetFromParsed(ps, styles) {
|
|
54540
54540
|
const sheet = new SheetModel(ps.name, styles);
|
|
54541
|
+
sheet.sheetState = ps.sheetState;
|
|
54541
54542
|
sheet.defaultRowHeight = ps.defaultRowHeight;
|
|
54542
54543
|
sheet.defaultColWidth = ps.defaultColWidth;
|
|
54543
54544
|
sheet.view.showGridLines = ps.showGridLines;
|
|
@@ -66303,6 +66304,9 @@ ${e.toString()}`);
|
|
|
66303
66304
|
);
|
|
66304
66305
|
parsed.name = sheetInfo.name;
|
|
66305
66306
|
if (isHidden) parsed.hidden = true;
|
|
66307
|
+
if (sheetInfo.state === "hidden" || sheetInfo.state === "veryHidden") {
|
|
66308
|
+
parsed.sheetState = sheetInfo.state;
|
|
66309
|
+
}
|
|
66306
66310
|
const printTitlesRaw = workbookInfo.printTitlesBySheet.get(i3);
|
|
66307
66311
|
if (printTitlesRaw) {
|
|
66308
66312
|
const pt = parsePrintTitlesRef(printTitlesRaw);
|
package/dist/src/cli.js
CHANGED
|
@@ -45571,6 +45571,41 @@ Update available: ${current} \u2192 ${latest}`);
|
|
|
45571
45571
|
`);
|
|
45572
45572
|
}
|
|
45573
45573
|
|
|
45574
|
+
// src/cli_error.ts
|
|
45575
|
+
var CAUSE_HINT = {
|
|
45576
|
+
ENOTFOUND: "the hostname did not resolve (DNS)",
|
|
45577
|
+
EAI_AGAIN: "DNS lookup timed out \u2014 usually transient",
|
|
45578
|
+
ECONNREFUSED: "the host refused the connection",
|
|
45579
|
+
ECONNRESET: "the connection was reset mid-request",
|
|
45580
|
+
ETIMEDOUT: "the connection timed out",
|
|
45581
|
+
UND_ERR_CONNECT_TIMEOUT: "the connection timed out",
|
|
45582
|
+
CERT_HAS_EXPIRED: "the server's TLS certificate has expired",
|
|
45583
|
+
UNABLE_TO_VERIFY_LEAF_SIGNATURE: "the server's TLS certificate could not be verified"
|
|
45584
|
+
};
|
|
45585
|
+
function describeTransportFailure(cause) {
|
|
45586
|
+
if (typeof cause !== "object" || cause === null) return null;
|
|
45587
|
+
const { code, hostname: hostname3, message: message2 } = cause;
|
|
45588
|
+
if (typeof code !== "string") return null;
|
|
45589
|
+
const where = typeof hostname3 === "string" && hostname3 ? ` reaching ${hostname3}` : "";
|
|
45590
|
+
const hint = CAUSE_HINT[code] ?? (typeof message2 === "string" ? message2 : void 0);
|
|
45591
|
+
return `${code}${where}${hint ? ` \u2014 ${hint}` : ""}`;
|
|
45592
|
+
}
|
|
45593
|
+
function describeCliError(error52) {
|
|
45594
|
+
if (!(error52 instanceof Error)) return String(error52);
|
|
45595
|
+
const transport = describeTransportFailure(error52.cause);
|
|
45596
|
+
if (transport) {
|
|
45597
|
+
return error52.message === "fetch failed" ? `Network request failed: ${transport}` : `${error52.message}
|
|
45598
|
+
Network request failed: ${transport}`;
|
|
45599
|
+
}
|
|
45600
|
+
if (error52.message.includes("fetch failed") || error52.message.includes("ECONNREFUSED")) {
|
|
45601
|
+
return error52.message === "fetch failed" ? "Network request failed \u2014 check your connection." : `${error52.message}
|
|
45602
|
+
Network request failed \u2014 check your connection.`;
|
|
45603
|
+
}
|
|
45604
|
+
const enoent = error52.message.match(/open '([^']+)'/);
|
|
45605
|
+
if (error52.message.includes("ENOENT")) return `File not found: ${enoent?.[1] ?? error52.message}`;
|
|
45606
|
+
return error52.message;
|
|
45607
|
+
}
|
|
45608
|
+
|
|
45574
45609
|
// src/version.ts
|
|
45575
45610
|
import { readFileSync } from "node:fs";
|
|
45576
45611
|
import { fileURLToPath } from "node:url";
|
|
@@ -82471,6 +82506,9 @@ function parseExcelFromZip(zip, options) {
|
|
|
82471
82506
|
);
|
|
82472
82507
|
parsed.name = sheetInfo.name;
|
|
82473
82508
|
if (isHidden) parsed.hidden = true;
|
|
82509
|
+
if (sheetInfo.state === "hidden" || sheetInfo.state === "veryHidden") {
|
|
82510
|
+
parsed.sheetState = sheetInfo.state;
|
|
82511
|
+
}
|
|
82474
82512
|
const printTitlesRaw = workbookInfo.printTitlesBySheet.get(i2);
|
|
82475
82513
|
if (printTitlesRaw) {
|
|
82476
82514
|
const pt = parsePrintTitlesRef(printTitlesRaw);
|
|
@@ -84015,9 +84053,10 @@ function quoteSheetName(name2) {
|
|
|
84015
84053
|
return /^[A-Za-z_][A-Za-z0-9_]*$/.test(name2) ? name2 : `'${name2.replace(/'/g, "''")}'`;
|
|
84016
84054
|
}
|
|
84017
84055
|
function buildWorkbookXml(workbook, pivotInfo) {
|
|
84018
|
-
const sheets = workbook.sheets.map(
|
|
84019
|
-
|
|
84020
|
-
|
|
84056
|
+
const sheets = workbook.sheets.map((s, i2) => {
|
|
84057
|
+
const state = s.sheetState === void 0 ? "" : ` state="${s.sheetState}"`;
|
|
84058
|
+
return `<sheet name="${escapeXml(s.name)}" sheetId="${i2 + 1}" r:id="rId${i2 + 1}"${state}/>`;
|
|
84059
|
+
}).join("\n");
|
|
84021
84060
|
const nameEntries = [];
|
|
84022
84061
|
for (const [name2, value2] of workbook.namedRanges) {
|
|
84023
84062
|
nameEntries.push(`<definedName name="${escapeXml(name2)}">${escapeXml(value2)}</definedName>`);
|
|
@@ -84949,6 +84988,7 @@ function loadWorkbookFromSnapshot(parsed, date1904 = false) {
|
|
|
84949
84988
|
}
|
|
84950
84989
|
function loadSheetFromParsed(ps, styles) {
|
|
84951
84990
|
const sheet = new SheetModel(ps.name, styles);
|
|
84991
|
+
sheet.sheetState = ps.sheetState;
|
|
84952
84992
|
sheet.defaultRowHeight = ps.defaultRowHeight;
|
|
84953
84993
|
sheet.defaultColWidth = ps.defaultColWidth;
|
|
84954
84994
|
sheet.view.showGridLines = ps.showGridLines;
|
|
@@ -101252,14 +101292,6 @@ ${JSON.stringify(info.input_schema, null, 2)}`);
|
|
|
101252
101292
|
}
|
|
101253
101293
|
}
|
|
101254
101294
|
main().then(() => checkForUpdate(VERSION)).catch((error52) => {
|
|
101255
|
-
|
|
101256
|
-
if (message2.includes("fetch failed") || message2.includes("ECONNREFUSED")) {
|
|
101257
|
-
console.error("Could not connect to the Lotics API.");
|
|
101258
|
-
} else if (message2.includes("ENOENT")) {
|
|
101259
|
-
const pathMatch = message2.match(/open '([^']+)'/);
|
|
101260
|
-
console.error(`File not found: ${pathMatch?.[1] ?? message2}`);
|
|
101261
|
-
} else {
|
|
101262
|
-
console.error(message2);
|
|
101263
|
-
}
|
|
101295
|
+
console.error(describeCliError(error52));
|
|
101264
101296
|
process.exit(1);
|
|
101265
101297
|
});
|