@manfred-kunze-dev/backbone-cli 2.8.0-dev.1 → 2.8.0-dev.3
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/commands/convert.js +13 -8
- package/package.json +1 -1
package/dist/commands/convert.js
CHANGED
|
@@ -22,7 +22,7 @@ export function makeConvertCommand() {
|
|
|
22
22
|
.description("Convert local files")
|
|
23
23
|
.argument("<paths...>", "File paths to convert")
|
|
24
24
|
.option("--format <formats...>", "Output formats (md, text, html, json)", ["md"])
|
|
25
|
-
.option("--pipeline <name>", "Pipeline (
|
|
25
|
+
.option("--pipeline <name>", "Pipeline (fast, ocr, vlm)")
|
|
26
26
|
.option("--async", "Run asynchronously")
|
|
27
27
|
.action(async (paths, opts, command) => {
|
|
28
28
|
await runAction(command, async () => {
|
|
@@ -38,12 +38,14 @@ export function makeConvertCommand() {
|
|
|
38
38
|
mimeType: getMimeType(filename),
|
|
39
39
|
};
|
|
40
40
|
});
|
|
41
|
-
const
|
|
41
|
+
const outputFormats = opts.format.map(mapFormat);
|
|
42
42
|
const body = {
|
|
43
43
|
sources,
|
|
44
44
|
options: {
|
|
45
|
-
toFormats,
|
|
46
45
|
pipeline: opts.pipeline,
|
|
46
|
+
options: {
|
|
47
|
+
outputFormats,
|
|
48
|
+
},
|
|
47
49
|
},
|
|
48
50
|
};
|
|
49
51
|
if (opts.async) {
|
|
@@ -61,7 +63,7 @@ export function makeConvertCommand() {
|
|
|
61
63
|
.description("Convert documents from URLs")
|
|
62
64
|
.argument("<urls...>", "URLs to convert")
|
|
63
65
|
.option("--format <formats...>", "Output formats (md, text, html, json)", ["md"])
|
|
64
|
-
.option("--pipeline <name>", "Pipeline (
|
|
66
|
+
.option("--pipeline <name>", "Pipeline (fast, ocr, vlm)")
|
|
65
67
|
.option("--async", "Run asynchronously")
|
|
66
68
|
.action(async (urls, opts, command) => {
|
|
67
69
|
await runAction(command, async () => {
|
|
@@ -70,12 +72,14 @@ export function makeConvertCommand() {
|
|
|
70
72
|
kind: "http",
|
|
71
73
|
url,
|
|
72
74
|
}));
|
|
73
|
-
const
|
|
75
|
+
const outputFormats = opts.format.map(mapFormat);
|
|
74
76
|
const body = {
|
|
75
77
|
sources,
|
|
76
78
|
options: {
|
|
77
|
-
toFormats,
|
|
78
79
|
pipeline: opts.pipeline,
|
|
80
|
+
options: {
|
|
81
|
+
outputFormats,
|
|
82
|
+
},
|
|
79
83
|
},
|
|
80
84
|
};
|
|
81
85
|
if (opts.async) {
|
|
@@ -92,14 +96,15 @@ export function makeConvertCommand() {
|
|
|
92
96
|
.command("status")
|
|
93
97
|
.description("Check async conversion task status")
|
|
94
98
|
.argument("<taskId>", "Task ID")
|
|
95
|
-
.option("-w, --wait", "Wait for completion")
|
|
99
|
+
.option("-w, --wait [seconds]", "Wait for completion (default: 30s)", parseFloat)
|
|
96
100
|
.action(async (taskId, opts, command) => {
|
|
97
101
|
await runAction(command, async () => {
|
|
98
102
|
const client = getClient(command);
|
|
103
|
+
const wait = opts.wait === true ? 30 : opts.wait;
|
|
99
104
|
const { data } = await client.GET("/v1/convert/tasks/{taskId}", {
|
|
100
105
|
params: {
|
|
101
106
|
path: { taskId },
|
|
102
|
-
query: { wait
|
|
107
|
+
query: { wait },
|
|
103
108
|
},
|
|
104
109
|
});
|
|
105
110
|
formatDetail(data, command);
|