document-cli 3.1.7 → 3.1.9
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/cli.js +7 -4
- package/dist/index.cjs +7 -4
- package/dist/index.js +7 -4
- package/package.json +9 -7
package/dist/cli.js
CHANGED
|
@@ -3,8 +3,9 @@ import { a as odbFormSummary, c as formatDocxExtrasLines, d as writeOutput, f as
|
|
|
3
3
|
import { Command, CommanderError, InvalidArgumentError } from "commander";
|
|
4
4
|
import { writeFile } from "node:fs/promises";
|
|
5
5
|
import { basename, dirname, extname, join, resolve } from "node:path";
|
|
6
|
-
import { CsvSheetNotFoundError, CsvSheetNotSpecifiedError, HsqldbSqlEvaluationError, HsqldbSqlParseError, HsqldbSqlUnsupportedError, OdbNoEmbeddedDataSourceError, OdbReportNotSpecifiedError, OdbTableNotFoundError, OdbTableNotSpecifiedError, OdbUnsupportedFormatError, OdmUnresolvedSectionError, PdfEncryptedError, PdfParseError, SvgMultiPageNotSpecifiedError, SvgPageNotFoundError, UnrecognizedDocumentSchemaError, UnsupportedFontSourceFormatError, buildCsvText, buildDocumentBytes, buildSvgText, createLocalDocumentConverter, decodeOdbPackage, decodePackage, documentFromJson, documentPackageWithSchema, encodeCsvText, encodeSvgText, evaluateSelect, extractSourceFontsForFormat,
|
|
6
|
+
import { CsvSheetNotFoundError, CsvSheetNotSpecifiedError, HsqldbSqlEvaluationError, HsqldbSqlParseError, HsqldbSqlUnsupportedError, OdbNoEmbeddedDataSourceError, OdbReportNotSpecifiedError, OdbTableNotFoundError, OdbTableNotSpecifiedError, OdbUnsupportedFormatError, OdmUnresolvedSectionError, PdfEncryptedError, PdfParseError, SvgMultiPageNotSpecifiedError, SvgPageNotFoundError, UnrecognizedDocumentSchemaError, UnsupportedFontSourceFormatError, buildCsvText, buildDocumentBytes, buildSvgText, createLocalDocumentConverter, decodeOdbPackage, decodePackage, documentFromJson, documentPackageWithSchema, encodeCsvText, encodeSvgText, evaluateSelect, extractSourceFontsForFormat, hsqldbCellDisplayText, odbReportToDocx, odbReportToOdt, odbReportToPdf, odbToCsv, odbToXlsx, odmToPdf, parseSelect, readDocumentMetadata, readDocxExtras, readOdbForms, readOdbInventory, readOdbReportContent, readOdbReports, readOdbTables, readPdf, setDocumentMetadata } from "documents.js";
|
|
7
7
|
import { existsSync, readFileSync } from "node:fs";
|
|
8
|
+
import { flattenPackage } from "document-schema.js";
|
|
8
9
|
import { buildOutline, isOutlineNode, outlineLeafText } from "document-outline.js";
|
|
9
10
|
//#region src/runtime/abort.ts
|
|
10
11
|
function combineSignals(a, b) {
|
|
@@ -189,8 +190,10 @@ function buildConversionAction(source, target) {
|
|
|
189
190
|
command
|
|
190
191
|
});
|
|
191
192
|
for (const diagnostic of result.diagnostics) reporter.report(diagnostic);
|
|
192
|
-
if (options.dumpPackage !== void 0)
|
|
193
|
-
|
|
193
|
+
if (options.dumpPackage !== void 0) {
|
|
194
|
+
if (result.package === void 0) process.stderr.write(`[${command}] this conversion does not produce an intermediate DocumentPackage\n`);
|
|
195
|
+
else await writeFile(options.dumpPackage, JSON.stringify(documentPackageWithSchema(result.package), void 0, 2));
|
|
196
|
+
}
|
|
194
197
|
reporter.summarize({
|
|
195
198
|
output: resolvedOutput,
|
|
196
199
|
bytes: result.document.bytes.byteLength,
|
|
@@ -1201,7 +1204,7 @@ function registerSetMetadataCommand(program) {
|
|
|
1201
1204
|
}
|
|
1202
1205
|
//#endregion
|
|
1203
1206
|
//#region package.json
|
|
1204
|
-
var version = "3.1.
|
|
1207
|
+
var version = "3.1.9";
|
|
1205
1208
|
//#endregion
|
|
1206
1209
|
//#region src/program.ts
|
|
1207
1210
|
function createProgram() {
|
package/dist/index.cjs
CHANGED
|
@@ -4,6 +4,7 @@ let node_path = require("node:path");
|
|
|
4
4
|
let documents_js = require("documents.js");
|
|
5
5
|
let node_fs = require("node:fs");
|
|
6
6
|
let commander = require("commander");
|
|
7
|
+
let document_schema_js = require("document-schema.js");
|
|
7
8
|
let document_outline_js = require("document-outline.js");
|
|
8
9
|
//#region src/format.ts
|
|
9
10
|
const EXTENSION_TO_FORMAT = {
|
|
@@ -307,8 +308,10 @@ function buildConversionAction(source, target) {
|
|
|
307
308
|
command
|
|
308
309
|
});
|
|
309
310
|
for (const diagnostic of result.diagnostics) reporter.report(diagnostic);
|
|
310
|
-
if (options.dumpPackage !== void 0)
|
|
311
|
-
|
|
311
|
+
if (options.dumpPackage !== void 0) {
|
|
312
|
+
if (result.package === void 0) process.stderr.write(`[${command}] this conversion does not produce an intermediate DocumentPackage\n`);
|
|
313
|
+
else await (0, node_fs_promises.writeFile)(options.dumpPackage, JSON.stringify((0, documents_js.documentPackageWithSchema)(result.package), void 0, 2));
|
|
314
|
+
}
|
|
312
315
|
reporter.summarize({
|
|
313
316
|
output: resolvedOutput,
|
|
314
317
|
bytes: result.document.bytes.byteLength,
|
|
@@ -608,7 +611,7 @@ async function runFromPackage(input, output, options) {
|
|
|
608
611
|
process.stderr.write(`[${command}] '${input}' is a ${result.kind}, not a DocumentPackage -- only a file written by --dump-package can be read back by this command\n`);
|
|
609
612
|
return 2;
|
|
610
613
|
}
|
|
611
|
-
const content = (0,
|
|
614
|
+
const content = (0, document_schema_js.flattenPackage)(result.value);
|
|
612
615
|
const bytes = target.format === "csv" ? (0, documents_js.encodeCsvText)((0, documents_js.buildCsvText)(content, {
|
|
613
616
|
delimiter: options.delimiter,
|
|
614
617
|
sheet: options.sheet
|
|
@@ -1533,7 +1536,7 @@ function registerSetMetadataCommand(program) {
|
|
|
1533
1536
|
}
|
|
1534
1537
|
//#endregion
|
|
1535
1538
|
//#region package.json
|
|
1536
|
-
var version = "3.1.
|
|
1539
|
+
var version = "3.1.9";
|
|
1537
1540
|
//#endregion
|
|
1538
1541
|
//#region src/program.ts
|
|
1539
1542
|
function createProgram() {
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { readFile, writeFile } from "node:fs/promises";
|
|
2
2
|
import { basename, dirname, extname, join, resolve } from "node:path";
|
|
3
|
-
import { CsvSheetNotFoundError, CsvSheetNotSpecifiedError, HsqldbSqlEvaluationError, HsqldbSqlParseError, HsqldbSqlUnsupportedError, OdbNoEmbeddedDataSourceError, OdbReportNotSpecifiedError, OdbTableNotFoundError, OdbTableNotSpecifiedError, OdbUnsupportedFormatError, OdmUnresolvedSectionError, PdfEncryptedError, PdfParseError, SvgMultiPageNotSpecifiedError, SvgPageNotFoundError, UnrecognizedDocumentSchemaError, UnsupportedFontSourceFormatError, buildCsvText, buildDocumentBytes, buildSvgText, createLocalDocumentConverter, decodeOdbPackage, decodePackage, describeFontFace, documentFromJson, documentPackageWithSchema, encodeCsvText, encodeSvgText, evaluateSelect, extractSourceFontsForFormat,
|
|
3
|
+
import { CsvSheetNotFoundError, CsvSheetNotSpecifiedError, HsqldbSqlEvaluationError, HsqldbSqlParseError, HsqldbSqlUnsupportedError, OdbNoEmbeddedDataSourceError, OdbReportNotSpecifiedError, OdbTableNotFoundError, OdbTableNotSpecifiedError, OdbUnsupportedFormatError, OdmUnresolvedSectionError, PdfEncryptedError, PdfParseError, SvgMultiPageNotSpecifiedError, SvgPageNotFoundError, UnrecognizedDocumentSchemaError, UnsupportedFontSourceFormatError, buildCsvText, buildDocumentBytes, buildSvgText, createLocalDocumentConverter, decodeOdbPackage, decodePackage, describeFontFace, documentFromJson, documentPackageWithSchema, encodeCsvText, encodeSvgText, evaluateSelect, extractSourceFontsForFormat, hsqldbCellDisplayText, odbReportToDocx, odbReportToOdt, odbReportToPdf, odbToCsv, odbToXlsx, odmToPdf, parseSelect, readDocumentMetadata, readDocxExtras, readOdbForms, readOdbInventory, readOdbReportContent, readOdbReports, readOdbTables, readPdf, setDocumentMetadata } from "documents.js";
|
|
4
4
|
import { existsSync, readFileSync } from "node:fs";
|
|
5
5
|
import { Command, InvalidArgumentError } from "commander";
|
|
6
|
+
import { flattenPackage } from "document-schema.js";
|
|
6
7
|
import { buildOutline, isOutlineNode, outlineLeafText } from "document-outline.js";
|
|
7
8
|
//#region src/format.ts
|
|
8
9
|
const EXTENSION_TO_FORMAT = {
|
|
@@ -306,8 +307,10 @@ function buildConversionAction(source, target) {
|
|
|
306
307
|
command
|
|
307
308
|
});
|
|
308
309
|
for (const diagnostic of result.diagnostics) reporter.report(diagnostic);
|
|
309
|
-
if (options.dumpPackage !== void 0)
|
|
310
|
-
|
|
310
|
+
if (options.dumpPackage !== void 0) {
|
|
311
|
+
if (result.package === void 0) process.stderr.write(`[${command}] this conversion does not produce an intermediate DocumentPackage\n`);
|
|
312
|
+
else await writeFile(options.dumpPackage, JSON.stringify(documentPackageWithSchema(result.package), void 0, 2));
|
|
313
|
+
}
|
|
311
314
|
reporter.summarize({
|
|
312
315
|
output: resolvedOutput,
|
|
313
316
|
bytes: result.document.bytes.byteLength,
|
|
@@ -1532,7 +1535,7 @@ function registerSetMetadataCommand(program) {
|
|
|
1532
1535
|
}
|
|
1533
1536
|
//#endregion
|
|
1534
1537
|
//#region package.json
|
|
1535
|
-
var version = "3.1.
|
|
1538
|
+
var version = "3.1.9";
|
|
1536
1539
|
//#endregion
|
|
1537
1540
|
//#region src/program.ts
|
|
1538
1541
|
function createProgram() {
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "document-cli",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.9",
|
|
4
4
|
"description": "CLI and interactive Ink TUI for documents.js: every docx/pptx/odt/odp/ods/odg/odf/pdf/odm/odb/xlsx/csv/svg/markdown conversion, bridge, and editor as a scriptable command or a terminal app.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
|
-
"url": "git+https://github.com/ExaDev/
|
|
8
|
+
"url": "git+https://github.com/ExaDev/documents.js.git",
|
|
9
|
+
"directory": "packages/document-cli"
|
|
9
10
|
},
|
|
10
11
|
"homepage": "https://github.com/ExaDev/document-cli#readme",
|
|
11
12
|
"bugs": {
|
|
@@ -62,7 +63,7 @@
|
|
|
62
63
|
"test:coverage": "turbo run _test:coverage",
|
|
63
64
|
"_test:coverage": "vitest run --project unit --coverage",
|
|
64
65
|
"test:smoke": "turbo run _test:smoke",
|
|
65
|
-
"_test:smoke": "
|
|
66
|
+
"_test:smoke": "vitest run --project smoke",
|
|
66
67
|
"test:workers": "turbo run _test:workers",
|
|
67
68
|
"_test:workers": "vitest run --config vitest.workers.config.ts",
|
|
68
69
|
"prepare": "husky",
|
|
@@ -88,8 +89,9 @@
|
|
|
88
89
|
"packageManager": "pnpm@11.6.0",
|
|
89
90
|
"dependencies": {
|
|
90
91
|
"commander": "^15.0.0",
|
|
91
|
-
"document-outline.js": "^1.0.
|
|
92
|
-
"
|
|
92
|
+
"document-outline.js": "^1.0.1",
|
|
93
|
+
"document-schema.js": "^4.3.4",
|
|
94
|
+
"documents.js": "^4.0.21",
|
|
93
95
|
"ink": "^7.1.1",
|
|
94
96
|
"ink-text-input": "^6.0.0",
|
|
95
97
|
"react": "^19.2.8"
|
|
@@ -111,8 +113,8 @@
|
|
|
111
113
|
"husky": "^9.1.7",
|
|
112
114
|
"ink-testing-library": "^4.0.0",
|
|
113
115
|
"lint-staged": "^17.3.0",
|
|
114
|
-
"odf.js": "^5.0.
|
|
115
|
-
"pdf-codec": "^3.0.
|
|
116
|
+
"odf.js": "^5.0.4",
|
|
117
|
+
"pdf-codec": "^3.0.9",
|
|
116
118
|
"publint": "^0.3.22",
|
|
117
119
|
"semantic-release": "^25.0.8",
|
|
118
120
|
"tsdown": "^0.22.14",
|