@pdfme/generator 3.0.0-dev.2 → 3.0.1-dev.13
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/cjs/__tests__/assets/templates/index.js +23 -46
- package/dist/cjs/__tests__/assets/templates/index.js.map +1 -1
- package/dist/cjs/__tests__/generate.test.js +36 -181
- package/dist/cjs/__tests__/generate.test.js.map +1 -1
- package/dist/cjs/__tests__/integration1.test.js +44 -0
- package/dist/cjs/__tests__/integration1.test.js.map +1 -0
- package/dist/cjs/__tests__/integration2.test.js +44 -0
- package/dist/cjs/__tests__/integration2.test.js.map +1 -0
- package/dist/cjs/__tests__/integration3.test.js +44 -0
- package/dist/cjs/__tests__/integration3.test.js.map +1 -0
- package/dist/cjs/__tests__/utils.js +59 -0
- package/dist/cjs/__tests__/utils.js.map +1 -0
- package/dist/cjs/src/generate.js +9 -19
- package/dist/cjs/src/generate.js.map +1 -1
- package/dist/cjs/src/pdfUtils.js +5 -14
- package/dist/cjs/src/pdfUtils.js.map +1 -1
- package/dist/esm/__tests__/assets/templates/index.js +22 -46
- package/dist/esm/__tests__/assets/templates/index.js.map +1 -1
- package/dist/esm/__tests__/generate.test.js +29 -151
- package/dist/esm/__tests__/generate.test.js.map +1 -1
- package/dist/esm/__tests__/integration1.test.js +39 -0
- package/dist/esm/__tests__/integration1.test.js.map +1 -0
- package/dist/esm/__tests__/integration2.test.js +39 -0
- package/dist/esm/__tests__/integration2.test.js.map +1 -0
- package/dist/esm/__tests__/integration3.test.js +39 -0
- package/dist/esm/__tests__/integration3.test.js.map +1 -0
- package/dist/esm/__tests__/utils.js +29 -0
- package/dist/esm/__tests__/utils.js.map +1 -0
- package/dist/esm/src/generate.js +9 -19
- package/dist/esm/src/generate.js.map +1 -1
- package/dist/esm/src/pdfUtils.js +5 -14
- package/dist/esm/src/pdfUtils.js.map +1 -1
- package/dist/types/__tests__/assets/templates/index.d.ts +29 -83
- package/dist/types/__tests__/integration1.test.d.ts +1 -0
- package/dist/types/__tests__/integration2.test.d.ts +1 -0
- package/dist/types/__tests__/integration3.test.d.ts +1 -0
- package/dist/types/__tests__/utils.d.ts +5 -0
- package/package.json +3 -2
- package/teardown.js +21 -0
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"pdfUtils.js","sourceRoot":"","sources":["../../../src/pdfUtils.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"pdfUtils.js","sourceRoot":"","sources":["../../../src/pdfUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,WAAW,EAAyC,MAAM,gBAAgB,CAAC;AAC7F,OAAO,EAAE,aAAa,EAAW,MAAM,eAAe,CAAC;AAGvD,MAAM,CAAC,MAAM,gCAAgC,GAAG,KAAK,EAAE,GAGtD,EAAE,EAAE;IACH,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,GAAG,CAAC;IAChC,IAAI,aAAa,GAAsB,EAAE,CAAC;IAC1C,IAAI,aAAa,GAAkB,EAAE,CAAC;IACtC,MAAM,WAAW,GAAG,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;IACzF,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACrD,MAAM,aAAa,GAAG,QAAQ,CAAC,QAAQ,EAAE,CAAC;IAE1C,aAAa,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACxC,QAAQ,EAAE,CAAC,CAAC,WAAW,EAAE;QACzB,QAAQ,EAAE,CAAC,CAAC,WAAW,EAAE;QACzB,OAAO,EAAE,CAAC,CAAC,UAAU,EAAE;KACxB,CAAC,CAAC,CAAC;IAEJ,MAAM,aAAa,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;QAC5C,MAAM,EAAE,CAAC,EAAE,CAAC,E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,CAAC;AACnD,CAAC,CAAC"}
|
@@ -1,25 +1,4 @@
|
|
1
|
-
declare const
|
2
|
-
test: {
|
3
|
-
schemas: Record<string, import("zod").objectOutputType<{
|
4
|
-
type: import("zod").ZodString;
|
5
|
-
position: import("zod").ZodObject<{
|
6
|
-
x: import("zod").ZodNumber;
|
7
|
-
y: import("zod").ZodNumber;
|
8
|
-
}, "strip", import("zod").ZodTypeAny, {
|
9
|
-
x: number;
|
10
|
-
y: number;
|
11
|
-
}, {
|
12
|
-
x: number;
|
13
|
-
y: number;
|
14
|
-
}>;
|
15
|
-
width: import("zod").ZodNumber;
|
16
|
-
height: import("zod").ZodNumber;
|
17
|
-
rotate: import("zod").ZodOptional<import("zod").ZodNumber>;
|
18
|
-
}, import("zod").ZodTypeAny, "passthrough">>[];
|
19
|
-
basePdf: (string | ArrayBuffer | Uint8Array) & (string | ArrayBuffer | Uint8Array | undefined);
|
20
|
-
sampledata?: Record<string, string>[] | undefined;
|
21
|
-
columns?: string[] | undefined;
|
22
|
-
};
|
1
|
+
export declare const label: {
|
23
2
|
宛名8面: {
|
24
3
|
schemas: Record<string, import("zod").objectOutputType<{
|
25
4
|
type: import("zod").ZodString;
|
@@ -62,27 +41,6 @@ declare const _default: {
|
|
62
41
|
sampledata?: Record<string, string>[] | undefined;
|
63
42
|
columns?: string[] | undefined;
|
64
43
|
};
|
65
|
-
シンプルラベル24面BASE: {
|
66
|
-
schemas: Record<string, import("zod").objectOutputType<{
|
67
|
-
type: import("zod").ZodString;
|
68
|
-
position: import("zod").ZodObject<{
|
69
|
-
x: import("zod").ZodNumber;
|
70
|
-
y: import("zod").ZodNumber;
|
71
|
-
}, "strip", import("zod").ZodTypeAny, {
|
72
|
-
x: number;
|
73
|
-
y: number;
|
74
|
-
}, {
|
75
|
-
x: number;
|
76
|
-
y: number;
|
77
|
-
}>;
|
78
|
-
width: import("zod").ZodNumber;
|
79
|
-
height: import("zod").ZodNumber;
|
80
|
-
rotate: import("zod").ZodOptional<import("zod").ZodNumber>;
|
81
|
-
}, import("zod").ZodTypeAny, "passthrough">>[];
|
82
|
-
basePdf: (string | ArrayBuffer | Uint8Array) & (string | ArrayBuffer | Uint8Array | undefined);
|
83
|
-
sampledata?: Record<string, string>[] | undefined;
|
84
|
-
columns?: string[] | undefined;
|
85
|
-
};
|
86
44
|
フレームラベル24面: {
|
87
45
|
schemas: Record<string, import("zod").objectOutputType<{
|
88
46
|
type: import("zod").ZodString;
|
@@ -272,28 +230,7 @@ declare const _default: {
|
|
272
230
|
sampledata?: Record<string, string>[] | undefined;
|
273
231
|
columns?: string[] | undefined;
|
274
232
|
};
|
275
|
-
|
276
|
-
schemas: Record<string, import("zod").objectOutputType<{
|
277
|
-
type: import("zod").ZodString;
|
278
|
-
position: import("zod").ZodObject<{
|
279
|
-
x: import("zod").ZodNumber;
|
280
|
-
y: import("zod").ZodNumber;
|
281
|
-
}, "strip", import("zod").ZodTypeAny, {
|
282
|
-
x: number;
|
283
|
-
y: number;
|
284
|
-
}, {
|
285
|
-
x: number;
|
286
|
-
y: number;
|
287
|
-
}>;
|
288
|
-
width: import("zod").ZodNumber;
|
289
|
-
height: import("zod").ZodNumber;
|
290
|
-
rotate: import("zod").ZodOptional<import("zod").ZodNumber>;
|
291
|
-
}, import("zod").ZodTypeAny, "passthrough">>[];
|
292
|
-
basePdf: (string | ArrayBuffer | Uint8Array) & (string | ArrayBuffer | Uint8Array | undefined);
|
293
|
-
sampledata?: Record<string, string>[] | undefined;
|
294
|
-
columns?: string[] | undefined;
|
295
|
-
};
|
296
|
-
洋長3号封筒: {
|
233
|
+
ゆうパケット: {
|
297
234
|
schemas: Record<string, import("zod").objectOutputType<{
|
298
235
|
type: import("zod").ZodString;
|
299
236
|
position: import("zod").ZodObject<{
|
@@ -314,7 +251,7 @@ declare const _default: {
|
|
314
251
|
sampledata?: Record<string, string>[] | undefined;
|
315
252
|
columns?: string[] | undefined;
|
316
253
|
};
|
317
|
-
|
254
|
+
Aone72312宛名: {
|
318
255
|
schemas: Record<string, import("zod").objectOutputType<{
|
319
256
|
type: import("zod").ZodString;
|
320
257
|
position: import("zod").ZodObject<{
|
@@ -335,7 +272,7 @@ declare const _default: {
|
|
335
272
|
sampledata?: Record<string, string>[] | undefined;
|
336
273
|
columns?: string[] | undefined;
|
337
274
|
};
|
338
|
-
|
275
|
+
名刺サイズの名札: {
|
339
276
|
schemas: Record<string, import("zod").objectOutputType<{
|
340
277
|
type: import("zod").ZodString;
|
341
278
|
position: import("zod").ZodObject<{
|
@@ -356,7 +293,7 @@ declare const _default: {
|
|
356
293
|
sampledata?: Record<string, string>[] | undefined;
|
357
294
|
columns?: string[] | undefined;
|
358
295
|
};
|
359
|
-
|
296
|
+
connpass名札: {
|
360
297
|
schemas: Record<string, import("zod").objectOutputType<{
|
361
298
|
type: import("zod").ZodString;
|
362
299
|
position: import("zod").ZodObject<{
|
@@ -377,7 +314,9 @@ declare const _default: {
|
|
377
314
|
sampledata?: Record<string, string>[] | undefined;
|
378
315
|
columns?: string[] | undefined;
|
379
316
|
};
|
380
|
-
|
317
|
+
};
|
318
|
+
export declare const envelope: {
|
319
|
+
長形3号封筒: {
|
381
320
|
schemas: Record<string, import("zod").objectOutputType<{
|
382
321
|
type: import("zod").ZodString;
|
383
322
|
position: import("zod").ZodObject<{
|
@@ -398,7 +337,7 @@ declare const _default: {
|
|
398
337
|
sampledata?: Record<string, string>[] | undefined;
|
399
338
|
columns?: string[] | undefined;
|
400
339
|
};
|
401
|
-
|
340
|
+
洋長3号封筒: {
|
402
341
|
schemas: Record<string, import("zod").objectOutputType<{
|
403
342
|
type: import("zod").ZodString;
|
404
343
|
position: import("zod").ZodObject<{
|
@@ -419,7 +358,7 @@ declare const _default: {
|
|
419
358
|
sampledata?: Record<string, string>[] | undefined;
|
420
359
|
columns?: string[] | undefined;
|
421
360
|
};
|
422
|
-
|
361
|
+
角形2号封筒: {
|
423
362
|
schemas: Record<string, import("zod").objectOutputType<{
|
424
363
|
type: import("zod").ZodString;
|
425
364
|
position: import("zod").ZodObject<{
|
@@ -440,6 +379,8 @@ declare const _default: {
|
|
440
379
|
sampledata?: Record<string, string>[] | undefined;
|
441
380
|
columns?: string[] | undefined;
|
442
381
|
};
|
382
|
+
};
|
383
|
+
export declare const barcode: {
|
443
384
|
Aone31555QRコード: {
|
444
385
|
schemas: Record<string, import("zod").objectOutputType<{
|
445
386
|
type: import("zod").ZodString;
|
@@ -524,7 +465,7 @@ declare const _default: {
|
|
524
465
|
sampledata?: Record<string, string>[] | undefined;
|
525
466
|
columns?: string[] | undefined;
|
526
467
|
};
|
527
|
-
|
468
|
+
barcodes: {
|
528
469
|
schemas: Record<string, import("zod").objectOutputType<{
|
529
470
|
type: import("zod").ZodString;
|
530
471
|
position: import("zod").ZodObject<{
|
@@ -545,6 +486,8 @@ declare const _default: {
|
|
545
486
|
sampledata?: Record<string, string>[] | undefined;
|
546
487
|
columns?: string[] | undefined;
|
547
488
|
};
|
489
|
+
};
|
490
|
+
export declare const business: {
|
548
491
|
領収書: {
|
549
492
|
schemas: Record<string, import("zod").objectOutputType<{
|
550
493
|
type: import("zod").ZodString;
|
@@ -734,7 +677,9 @@ declare const _default: {
|
|
734
677
|
sampledata?: Record<string, string>[] | undefined;
|
735
678
|
columns?: string[] | undefined;
|
736
679
|
};
|
737
|
-
|
680
|
+
};
|
681
|
+
export declare const textType: {
|
682
|
+
dynamicFontSizeHorizontal: {
|
738
683
|
schemas: Record<string, import("zod").objectOutputType<{
|
739
684
|
type: import("zod").ZodString;
|
740
685
|
position: import("zod").ZodObject<{
|
@@ -755,7 +700,7 @@ declare const _default: {
|
|
755
700
|
sampledata?: Record<string, string>[] | undefined;
|
756
701
|
columns?: string[] | undefined;
|
757
702
|
};
|
758
|
-
|
703
|
+
dynamicFontSizeVertical: {
|
759
704
|
schemas: Record<string, import("zod").objectOutputType<{
|
760
705
|
type: import("zod").ZodString;
|
761
706
|
position: import("zod").ZodObject<{
|
@@ -776,7 +721,7 @@ declare const _default: {
|
|
776
721
|
sampledata?: Record<string, string>[] | undefined;
|
777
722
|
columns?: string[] | undefined;
|
778
723
|
};
|
779
|
-
|
724
|
+
verticalAlignmentTop: {
|
780
725
|
schemas: Record<string, import("zod").objectOutputType<{
|
781
726
|
type: import("zod").ZodString;
|
782
727
|
position: import("zod").ZodObject<{
|
@@ -797,7 +742,7 @@ declare const _default: {
|
|
797
742
|
sampledata?: Record<string, string>[] | undefined;
|
798
743
|
columns?: string[] | undefined;
|
799
744
|
};
|
800
|
-
|
745
|
+
verticalAlignmentMiddle: {
|
801
746
|
schemas: Record<string, import("zod").objectOutputType<{
|
802
747
|
type: import("zod").ZodString;
|
803
748
|
position: import("zod").ZodObject<{
|
@@ -818,7 +763,7 @@ declare const _default: {
|
|
818
763
|
sampledata?: Record<string, string>[] | undefined;
|
819
764
|
columns?: string[] | undefined;
|
820
765
|
};
|
821
|
-
|
766
|
+
verticalAlignmentBottom: {
|
822
767
|
schemas: Record<string, import("zod").objectOutputType<{
|
823
768
|
type: import("zod").ZodString;
|
824
769
|
position: import("zod").ZodObject<{
|
@@ -839,7 +784,9 @@ declare const _default: {
|
|
839
784
|
sampledata?: Record<string, string>[] | undefined;
|
840
785
|
columns?: string[] | undefined;
|
841
786
|
};
|
842
|
-
|
787
|
+
};
|
788
|
+
export declare const other: {
|
789
|
+
test: {
|
843
790
|
schemas: Record<string, import("zod").objectOutputType<{
|
844
791
|
type: import("zod").ZodString;
|
845
792
|
position: import("zod").ZodObject<{
|
@@ -860,7 +807,7 @@ declare const _default: {
|
|
860
807
|
sampledata?: Record<string, string>[] | undefined;
|
861
808
|
columns?: string[] | undefined;
|
862
809
|
};
|
863
|
-
|
810
|
+
z97mmx210mm: {
|
864
811
|
schemas: Record<string, import("zod").objectOutputType<{
|
865
812
|
type: import("zod").ZodString;
|
866
813
|
position: import("zod").ZodObject<{
|
@@ -881,7 +828,7 @@ declare const _default: {
|
|
881
828
|
sampledata?: Record<string, string>[] | undefined;
|
882
829
|
columns?: string[] | undefined;
|
883
830
|
};
|
884
|
-
|
831
|
+
canvasPdf: {
|
885
832
|
schemas: Record<string, import("zod").objectOutputType<{
|
886
833
|
type: import("zod").ZodString;
|
887
834
|
position: import("zod").ZodObject<{
|
@@ -902,7 +849,7 @@ declare const _default: {
|
|
902
849
|
sampledata?: Record<string, string>[] | undefined;
|
903
850
|
columns?: string[] | undefined;
|
904
851
|
};
|
905
|
-
|
852
|
+
background: {
|
906
853
|
schemas: Record<string, import("zod").objectOutputType<{
|
907
854
|
type: import("zod").ZodString;
|
908
855
|
position: import("zod").ZodObject<{
|
@@ -923,7 +870,7 @@ declare const _default: {
|
|
923
870
|
sampledata?: Record<string, string>[] | undefined;
|
924
871
|
columns?: string[] | undefined;
|
925
872
|
};
|
926
|
-
|
873
|
+
rotation: {
|
927
874
|
schemas: Record<string, import("zod").objectOutputType<{
|
928
875
|
type: import("zod").ZodString;
|
929
876
|
position: import("zod").ZodObject<{
|
@@ -945,4 +892,3 @@ declare const _default: {
|
|
945
892
|
columns?: string[] | undefined;
|
946
893
|
};
|
947
894
|
};
|
948
|
-
export default _default;
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import { Font } from '@pdfme/common';
|
2
|
+
export declare const getFont: () => Font;
|
3
|
+
export declare const getPdf: (pdfFilePath: string) => Promise<unknown>;
|
4
|
+
export declare const getPdfTmpPath: (fileName: string) => string;
|
5
|
+
export declare const getPdfAssertPath: (fileName: string) => string;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@pdfme/generator",
|
3
|
-
"version": "3.0.
|
3
|
+
"version": "3.0.1-dev.13",
|
4
4
|
"sideEffects": false,
|
5
5
|
"author": "hand-dot",
|
6
6
|
"license": "MIT",
|
@@ -35,7 +35,7 @@
|
|
35
35
|
},
|
36
36
|
"scripts": {
|
37
37
|
"develop": "tsc -w",
|
38
|
-
"build": "npm
|
38
|
+
"build": "npm-run-all --parallel build:cjs build:esm",
|
39
39
|
"build:cjs": "tsc -p tsconfig.cjs.json",
|
40
40
|
"build:esm": "tsc -p tsconfig.esm.json",
|
41
41
|
"clean": "rimraf dist",
|
@@ -62,6 +62,7 @@
|
|
62
62
|
},
|
63
63
|
"jest": {
|
64
64
|
"resolver": "ts-jest-resolver",
|
65
|
+
"globalTeardown": "<rootDir>/teardown.js",
|
65
66
|
"moduleFileExtensions": [
|
66
67
|
"js",
|
67
68
|
"ts"
|
package/teardown.js
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
const path = require('path');
|
2
|
+
const { readdir, unlink } = require('fs');
|
3
|
+
|
4
|
+
module.exports = async () => {
|
5
|
+
const dir = path.join(__dirname, '__tests__/assets/pdfs/tmp');
|
6
|
+
const unLinkFile = (file) => {
|
7
|
+
if (file !== '.gitkeep') {
|
8
|
+
unlink(`${dir}/${file}`, (e) => {
|
9
|
+
if (e) {
|
10
|
+
throw e;
|
11
|
+
}
|
12
|
+
});
|
13
|
+
}
|
14
|
+
};
|
15
|
+
readdir(dir, (err, files) => {
|
16
|
+
if (err) {
|
17
|
+
throw err;
|
18
|
+
}
|
19
|
+
files.forEach(unLinkFile);
|
20
|
+
});
|
21
|
+
};
|