@pdfme/cli 6.1.11 → 6.1.12-dev.11
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.
|
@@ -1,43 +1,43 @@
|
|
|
1
1
|
declare const _default: import("citty").CommandDef<{
|
|
2
2
|
target: {
|
|
3
|
-
type:
|
|
3
|
+
type: 'positional';
|
|
4
4
|
description: string;
|
|
5
5
|
required: boolean;
|
|
6
6
|
};
|
|
7
7
|
file: {
|
|
8
|
-
type:
|
|
8
|
+
type: 'positional';
|
|
9
9
|
description: string;
|
|
10
10
|
required: boolean;
|
|
11
11
|
};
|
|
12
12
|
verbose: {
|
|
13
|
-
type:
|
|
13
|
+
type: 'boolean';
|
|
14
14
|
alias: string;
|
|
15
15
|
description: string;
|
|
16
16
|
default: boolean;
|
|
17
17
|
};
|
|
18
18
|
json: {
|
|
19
|
-
type:
|
|
19
|
+
type: 'boolean';
|
|
20
20
|
description: string;
|
|
21
21
|
default: boolean;
|
|
22
22
|
};
|
|
23
23
|
noAutoFont: {
|
|
24
|
-
type:
|
|
24
|
+
type: 'boolean';
|
|
25
25
|
description: string;
|
|
26
26
|
default: boolean;
|
|
27
27
|
};
|
|
28
28
|
output: {
|
|
29
|
-
type:
|
|
29
|
+
type: 'string';
|
|
30
30
|
alias: string;
|
|
31
31
|
description: string;
|
|
32
32
|
default: string;
|
|
33
33
|
};
|
|
34
34
|
force: {
|
|
35
|
-
type:
|
|
35
|
+
type: 'boolean';
|
|
36
36
|
description: string;
|
|
37
37
|
default: boolean;
|
|
38
38
|
};
|
|
39
39
|
image: {
|
|
40
|
-
type:
|
|
40
|
+
type: 'boolean';
|
|
41
41
|
description: string;
|
|
42
42
|
default: boolean;
|
|
43
43
|
};
|
|
@@ -1,71 +1,71 @@
|
|
|
1
1
|
declare const _default: import("citty").CommandDef<{
|
|
2
2
|
file: {
|
|
3
|
-
type:
|
|
3
|
+
type: 'positional';
|
|
4
4
|
description: string;
|
|
5
5
|
required: boolean;
|
|
6
6
|
};
|
|
7
7
|
template: {
|
|
8
|
-
type:
|
|
8
|
+
type: 'string';
|
|
9
9
|
alias: string;
|
|
10
10
|
description: string;
|
|
11
11
|
};
|
|
12
12
|
inputs: {
|
|
13
|
-
type:
|
|
13
|
+
type: 'string';
|
|
14
14
|
alias: string;
|
|
15
15
|
description: string;
|
|
16
16
|
};
|
|
17
17
|
output: {
|
|
18
|
-
type:
|
|
18
|
+
type: 'string';
|
|
19
19
|
alias: string;
|
|
20
20
|
description: string;
|
|
21
21
|
default: string;
|
|
22
22
|
};
|
|
23
23
|
force: {
|
|
24
|
-
type:
|
|
24
|
+
type: 'boolean';
|
|
25
25
|
description: string;
|
|
26
26
|
default: boolean;
|
|
27
27
|
};
|
|
28
28
|
image: {
|
|
29
|
-
type:
|
|
29
|
+
type: 'boolean';
|
|
30
30
|
description: string;
|
|
31
31
|
default: boolean;
|
|
32
32
|
};
|
|
33
33
|
scale: {
|
|
34
|
-
type:
|
|
34
|
+
type: 'string';
|
|
35
35
|
description: string;
|
|
36
36
|
default: string;
|
|
37
37
|
};
|
|
38
38
|
grid: {
|
|
39
|
-
type:
|
|
39
|
+
type: 'boolean';
|
|
40
40
|
description: string;
|
|
41
41
|
default: boolean;
|
|
42
42
|
};
|
|
43
43
|
gridSize: {
|
|
44
|
-
type:
|
|
44
|
+
type: 'string';
|
|
45
45
|
description: string;
|
|
46
46
|
default: string;
|
|
47
47
|
};
|
|
48
48
|
font: {
|
|
49
|
-
type:
|
|
49
|
+
type: 'string';
|
|
50
50
|
description: string;
|
|
51
51
|
};
|
|
52
52
|
basePdf: {
|
|
53
|
-
type:
|
|
53
|
+
type: 'string';
|
|
54
54
|
description: string;
|
|
55
55
|
};
|
|
56
56
|
noAutoFont: {
|
|
57
|
-
type:
|
|
57
|
+
type: 'boolean';
|
|
58
58
|
description: string;
|
|
59
59
|
default: boolean;
|
|
60
60
|
};
|
|
61
61
|
verbose: {
|
|
62
|
-
type:
|
|
62
|
+
type: 'boolean';
|
|
63
63
|
alias: string;
|
|
64
64
|
description: string;
|
|
65
65
|
default: boolean;
|
|
66
66
|
};
|
|
67
67
|
json: {
|
|
68
|
-
type:
|
|
68
|
+
type: 'boolean';
|
|
69
69
|
description: string;
|
|
70
70
|
default: boolean;
|
|
71
71
|
};
|
|
@@ -1,41 +1,41 @@
|
|
|
1
1
|
declare const _default: import("citty").CommandDef<{
|
|
2
2
|
file: {
|
|
3
|
-
type:
|
|
3
|
+
type: 'positional';
|
|
4
4
|
description: string;
|
|
5
5
|
required: boolean;
|
|
6
6
|
};
|
|
7
7
|
output: {
|
|
8
|
-
type:
|
|
8
|
+
type: 'string';
|
|
9
9
|
alias: string;
|
|
10
10
|
description: string;
|
|
11
11
|
};
|
|
12
12
|
grid: {
|
|
13
|
-
type:
|
|
13
|
+
type: 'boolean';
|
|
14
14
|
description: string;
|
|
15
15
|
default: boolean;
|
|
16
16
|
};
|
|
17
17
|
gridSize: {
|
|
18
|
-
type:
|
|
18
|
+
type: 'string';
|
|
19
19
|
description: string;
|
|
20
20
|
default: string;
|
|
21
21
|
};
|
|
22
22
|
scale: {
|
|
23
|
-
type:
|
|
23
|
+
type: 'string';
|
|
24
24
|
description: string;
|
|
25
25
|
default: string;
|
|
26
26
|
};
|
|
27
27
|
pages: {
|
|
28
|
-
type:
|
|
28
|
+
type: 'string';
|
|
29
29
|
description: string;
|
|
30
30
|
};
|
|
31
31
|
verbose: {
|
|
32
|
-
type:
|
|
32
|
+
type: 'boolean';
|
|
33
33
|
alias: string;
|
|
34
34
|
description: string;
|
|
35
35
|
default: boolean;
|
|
36
36
|
};
|
|
37
37
|
json: {
|
|
38
|
-
type:
|
|
38
|
+
type: 'boolean';
|
|
39
39
|
description: string;
|
|
40
40
|
default: boolean;
|
|
41
41
|
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
declare const _default: import("citty").CommandDef<{
|
|
2
2
|
file: {
|
|
3
|
-
type:
|
|
3
|
+
type: 'positional';
|
|
4
4
|
description: string;
|
|
5
5
|
required: boolean;
|
|
6
6
|
};
|
|
7
7
|
verbose: {
|
|
8
|
-
type:
|
|
8
|
+
type: 'boolean';
|
|
9
9
|
alias: string;
|
|
10
10
|
description: string;
|
|
11
11
|
default: boolean;
|
|
12
12
|
};
|
|
13
13
|
json: {
|
|
14
|
-
type:
|
|
14
|
+
type: 'boolean';
|
|
15
15
|
description: string;
|
|
16
16
|
default: boolean;
|
|
17
17
|
};
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
declare const _default: import("citty").CommandDef<{
|
|
2
2
|
file: {
|
|
3
|
-
type:
|
|
3
|
+
type: 'positional';
|
|
4
4
|
description: string;
|
|
5
5
|
required: boolean;
|
|
6
6
|
};
|
|
7
7
|
verbose: {
|
|
8
|
-
type:
|
|
8
|
+
type: 'boolean';
|
|
9
9
|
alias: string;
|
|
10
10
|
description: string;
|
|
11
11
|
default: boolean;
|
|
12
12
|
};
|
|
13
13
|
json: {
|
|
14
|
-
type:
|
|
14
|
+
type: 'boolean';
|
|
15
15
|
description: string;
|
|
16
16
|
default: boolean;
|
|
17
17
|
};
|
|
18
18
|
strict: {
|
|
19
|
-
type:
|
|
19
|
+
type: 'boolean';
|
|
20
20
|
description: string;
|
|
21
21
|
default: boolean;
|
|
22
22
|
};
|
package/dist/index.js
CHANGED
|
@@ -429,14 +429,14 @@ function getFsEntryType(path) {
|
|
|
429
429
|
}
|
|
430
430
|
//#endregion
|
|
431
431
|
//#region src/diagnostics.ts
|
|
432
|
-
var KNOWN_TEMPLATE_KEYS = new Set([
|
|
432
|
+
var KNOWN_TEMPLATE_KEYS = /* @__PURE__ */ new Set([
|
|
433
433
|
"author",
|
|
434
434
|
"basePdf",
|
|
435
435
|
"columns",
|
|
436
436
|
"pdfmeVersion",
|
|
437
437
|
"schemas"
|
|
438
438
|
]);
|
|
439
|
-
var KNOWN_JOB_KEYS = new Set([
|
|
439
|
+
var KNOWN_JOB_KEYS = /* @__PURE__ */ new Set([
|
|
440
440
|
"template",
|
|
441
441
|
"inputs",
|
|
442
442
|
"options"
|
|
@@ -562,7 +562,7 @@ function collectInputHints(template) {
|
|
|
562
562
|
].join("");
|
|
563
563
|
const existing = hintMap.get(key);
|
|
564
564
|
if (existing) {
|
|
565
|
-
existing.pages = [
|
|
565
|
+
existing.pages = [.../* @__PURE__ */ new Set([...existing.pages, pageIdx + 1])].sort((a, b) => a - b);
|
|
566
566
|
existing.required = existing.required || hint.required;
|
|
567
567
|
continue;
|
|
568
568
|
}
|
|
@@ -1172,7 +1172,7 @@ var CACHE_DIR = join(homedir(), ".pdfme", "fonts");
|
|
|
1172
1172
|
var NOTO_SANS_JP_URL = "https://github.com/google/fonts/raw/main/ofl/notosansjp/NotoSansJP%5Bwght%5D.ttf";
|
|
1173
1173
|
var NOTO_CACHE_FILE = join(CACHE_DIR, "NotoSansJP-Regular.ttf");
|
|
1174
1174
|
var REMOTE_FONT_TIMEOUT_MS = 15e3;
|
|
1175
|
-
var MAX_REMOTE_FONT_BYTES =
|
|
1175
|
+
var MAX_REMOTE_FONT_BYTES = 33554432;
|
|
1176
1176
|
function ensureCacheDir() {
|
|
1177
1177
|
if (!existsSync(CACHE_DIR)) mkdirSync(CACHE_DIR, { recursive: true });
|
|
1178
1178
|
}
|
|
@@ -1922,8 +1922,8 @@ var generate_default = defineCommand({
|
|
|
1922
1922
|
});
|
|
1923
1923
|
function formatBytes(bytes) {
|
|
1924
1924
|
if (bytes < 1024) return `${bytes}B`;
|
|
1925
|
-
if (bytes <
|
|
1926
|
-
return `${(bytes /
|
|
1925
|
+
if (bytes < 1048576) return `${(bytes / 1024).toFixed(1)}KB`;
|
|
1926
|
+
return `${(bytes / 1048576).toFixed(1)}MB`;
|
|
1927
1927
|
}
|
|
1928
1928
|
function normalizeJobOptions(rawJobOptions) {
|
|
1929
1929
|
if (rawJobOptions === void 0) return {};
|
|
@@ -2214,7 +2214,8 @@ var pdf2size_default = defineCommand({
|
|
|
2214
2214
|
code: "EARG",
|
|
2215
2215
|
exitCode: 1
|
|
2216
2216
|
});
|
|
2217
|
-
const
|
|
2217
|
+
const pdfData = readPdfFile(args.file);
|
|
2218
|
+
const sizes = await pdf2size(pdfData);
|
|
2218
2219
|
if (args.verbose) {
|
|
2219
2220
|
console.error(`Input: ${args.file}`);
|
|
2220
2221
|
console.error(`Pages: ${sizes.length}`);
|
|
@@ -2241,7 +2242,7 @@ var pdf2size_default = defineCommand({
|
|
|
2241
2242
|
});
|
|
2242
2243
|
//#endregion
|
|
2243
2244
|
//#region src/version.ts
|
|
2244
|
-
var CLI_VERSION = "6.1.11";
|
|
2245
|
+
var CLI_VERSION = "6.1.12-dev.11";
|
|
2245
2246
|
//#endregion
|
|
2246
2247
|
//#region src/commands/doctor.ts
|
|
2247
2248
|
var doctorArgs = {
|
|
@@ -2594,17 +2595,17 @@ function diagnoseFonts(source, environment, noAutoFont, requiredFonts) {
|
|
|
2594
2595
|
else if (autoFontNeeded && !autoFontCached) warnings.push(`CJK text detected and NotoSansJP is not cached at ${NOTO_CACHE_FILE}. Generate will require network access to fetch it.`);
|
|
2595
2596
|
const resolvedFont = autoFontNeeded ? {
|
|
2596
2597
|
NotoSansJP: {
|
|
2597
|
-
data: new Uint8Array(),
|
|
2598
|
+
data: /* @__PURE__ */ new Uint8Array(),
|
|
2598
2599
|
fallback: true,
|
|
2599
2600
|
subset: true
|
|
2600
2601
|
},
|
|
2601
2602
|
[DEFAULT_FONT_NAME]: {
|
|
2602
|
-
data: new Uint8Array(),
|
|
2603
|
+
data: /* @__PURE__ */ new Uint8Array(),
|
|
2603
2604
|
fallback: false,
|
|
2604
2605
|
subset: true
|
|
2605
2606
|
}
|
|
2606
2607
|
} : { [DEFAULT_FONT_NAME]: {
|
|
2607
|
-
data: new Uint8Array(),
|
|
2608
|
+
data: /* @__PURE__ */ new Uint8Array(),
|
|
2608
2609
|
fallback: true,
|
|
2609
2610
|
subset: true
|
|
2610
2611
|
} };
|
|
@@ -2783,7 +2784,7 @@ function describeDoctorInput(file) {
|
|
|
2783
2784
|
}
|
|
2784
2785
|
//#endregion
|
|
2785
2786
|
//#region src/index.ts
|
|
2786
|
-
|
|
2787
|
+
var main = defineCommand({
|
|
2787
2788
|
meta: {
|
|
2788
2789
|
name: "pdfme",
|
|
2789
2790
|
version: CLI_VERSION,
|
|
@@ -2796,7 +2797,8 @@ runMain(defineCommand({
|
|
|
2796
2797
|
pdf2size: pdf2size_default,
|
|
2797
2798
|
doctor: doctor_default
|
|
2798
2799
|
}
|
|
2799
|
-
})
|
|
2800
|
+
});
|
|
2801
|
+
runMain(main);
|
|
2800
2802
|
//#endregion
|
|
2801
2803
|
|
|
2802
2804
|
//# sourceMappingURL=index.js.map
|