@pdfme/generator 3.1.5 → 3.2.0-dev.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.
Files changed (38) hide show
  1. package/dist/cjs/__tests__/assets/templates/index.js +8 -1
  2. package/dist/cjs/__tests__/assets/templates/index.js.map +1 -1
  3. package/dist/cjs/__tests__/integration1.test.js +8 -1
  4. package/dist/cjs/__tests__/integration1.test.js.map +1 -1
  5. package/dist/cjs/__tests__/integration2.test.js +8 -1
  6. package/dist/cjs/__tests__/integration2.test.js.map +1 -1
  7. package/dist/cjs/__tests__/integration3.test.js +32 -4
  8. package/dist/cjs/__tests__/integration3.test.js.map +1 -1
  9. package/dist/cjs/__tests__/integration4.test.js +51 -0
  10. package/dist/cjs/__tests__/integration4.test.js.map +1 -0
  11. package/dist/cjs/__tests__/utils.js +2 -0
  12. package/dist/cjs/__tests__/utils.js.map +1 -1
  13. package/dist/cjs/src/generate.js +10 -7
  14. package/dist/cjs/src/generate.js.map +1 -1
  15. package/dist/cjs/src/helper.js +8 -3
  16. package/dist/cjs/src/helper.js.map +1 -1
  17. package/dist/esm/__tests__/assets/templates/index.js +7 -0
  18. package/dist/esm/__tests__/assets/templates/index.js.map +1 -1
  19. package/dist/esm/__tests__/integration1.test.js +8 -1
  20. package/dist/esm/__tests__/integration1.test.js.map +1 -1
  21. package/dist/esm/__tests__/integration2.test.js +8 -1
  22. package/dist/esm/__tests__/integration2.test.js.map +1 -1
  23. package/dist/esm/__tests__/integration3.test.js +34 -6
  24. package/dist/esm/__tests__/integration3.test.js.map +1 -1
  25. package/dist/esm/__tests__/integration4.test.js +46 -0
  26. package/dist/esm/__tests__/integration4.test.js.map +1 -0
  27. package/dist/esm/__tests__/utils.js +2 -0
  28. package/dist/esm/__tests__/utils.js.map +1 -1
  29. package/dist/esm/src/generate.js +10 -7
  30. package/dist/esm/src/generate.js.map +1 -1
  31. package/dist/esm/src/helper.js +8 -3
  32. package/dist/esm/src/helper.js.map +1 -1
  33. package/dist/types/__tests__/assets/templates/index.d.ts +134 -0
  34. package/dist/types/__tests__/integration4.test.d.ts +1 -0
  35. package/dist/types/src/helper.d.ts +2 -1
  36. package/package.json +3 -3
  37. package/src/generate.ts +13 -10
  38. package/src/helper.ts +14 -5
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.other = exports.textType = exports.business = exports.barcode = exports.envelope = exports.label = void 0;
3
+ exports.shape = exports.other = exports.textType = exports.business = exports.barcode = exports.envelope = exports.label = void 0;
4
4
  const レターパック = require('./レターパック.json');
5
5
  const レターパックライト = require('./レターパックライト.json');
6
6
  const レターパックプラス = require('./レターパックプラス.json');
@@ -43,6 +43,8 @@ const verticalAlignmentTop = require('./verticalAlignmentTop.json');
43
43
  const verticalAlignmentMiddle = require('./verticalAlignmentMiddle.json');
44
44
  const verticalAlignmentBottom = require('./verticalAlignmentBottom.json');
45
45
  const test = require('./test.json');
46
+ const shapes = require('./shapes.json');
47
+ const pet = require('./pet.json');
46
48
  exports.label = {
47
49
  宛名8面,
48
50
  シンプルラベル24面,
@@ -83,6 +85,7 @@ exports.business = {
83
85
  履歴書,
84
86
  労働条件通知書,
85
87
  };
88
+ // These tests are slower, so we allow more time for them to pass
86
89
  exports.textType = {
87
90
  dynamicFontSizeHorizontal,
88
91
  dynamicFontSizeVertical,
@@ -96,5 +99,9 @@ exports.other = {
96
99
  canvasPdf,
97
100
  background,
98
101
  rotation,
102
+ pet,
103
+ };
104
+ exports.shape = {
105
+ shapes,
99
106
  };
100
107
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../__tests__/assets/templates/index.ts"],"names":[],"mappings":";;;AAEA,MAAM,MAAM,GAAG,OAAO,CAAC,eAAe,CAAa,CAAC;AACpD,MAAM,SAAS,GAAG,OAAO,CAAC,kBAAkB,CAAa,CAAC;AAC1D,MAAM,SAAS,GAAG,O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AAQ,GAAG;IACtB,MAAM;IACN,MAAM;IACN,MAAM;CACP,CAAC;AAEW,QAAA,OAAO,GAAG;IACrB,cAAc;IACd,cAAc;IACd,iBAAiB;IACjB,iBAAiB;IACjB,QAAQ;CACT,CAAC;AAEW,QAAA,QAAQ,GAAG;IACtB,GAAG;IACH,KAAK;IACL,GAAG;IACH,GAAG;IACH,GAAG;IACH,GAAG;IACH,KAAK;IACL,GAAG;IACH,OAAO;CACR,CAAC;AAEW,QAAA,QAAQ,GAAG;IACtB,yBAAyB;IACzB,uBAAuB;IACvB,oBAAoB;IACpB,uBAAuB;IACvB,uBAAuB;CACxB,CAAC;AAEW,QAAA,KAAK,GAAG;IACnB,IAAI;IACJ,WAAW;IACX,SAAS;IACT,UAAU;IACV,QAAQ;CACT,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../__tests__/assets/templates/index.ts"],"names":[],"mappings":";;;AAEA,MAAM,MAAM,GAAG,OAAO,CAAC,eAAe,CAAa,CAAC;AACpD,MAAM,SAAS,GAAG,OAAO,CAAC,kBAAkB,CAAa,CAAC;AAC1D,MAAM,SAAS,GAAG,OAAO,CAAC,kBAAkB,CAAa,CAAC;AAC1D,MAAM,IAAI,GAAG,OAAO,CAAC,aAAa,CAAa,CAAC;AAChD,MAAM,UAAU,GAAG,OAAO,CAAC,mBAAmB,CAAa,CAAC;AAC5D,MAAM,cAAc,GAAG,OAAO,CAAC,uBAAuB,CAAa,CAAC;AACpE,MAAM,OAAO,GAAG,OAAO,CAAC,gBAAgB,CAAa,CAAC;AACtD,MAAM,WAAW,GAAG,OAAO,CAAC,oBAAoB,CAAa,CAAC;AAC9D,MAAM,UAAU,GAAG,OAAO,CAAC,mBAAmB,CAAa,CAAC;AAC5D,MAAM,UAAU,GAAG,OAAO,CAAC,mBAAmB,CAAa,CAAC;AAC5D,MAAM,QAAQ,GAAG,OAAO,CAAC,iBAAiB,CAAa,CAAC;AACxD,MAAM,MAAM,GAAG,OAAO,CA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;AAEW,QAAA,KAAK,GAAG;IACnB,IAAI;IACJ,WAAW;IACX,SAAS;IACT,UAAU;IACV,QAAQ;IACR,GAAG;CACJ,CAAC;AAEW,QAAA,KAAK,GAAG;IACnB,MAAM;CACP,CAAC"}
@@ -8,6 +8,7 @@ const generate_1 = __importDefault(require("../src/generate"));
8
8
  const templates_1 = require("./assets/templates");
9
9
  const schemas_1 = require("@pdfme/schemas");
10
10
  const utils_1 = require("./utils");
11
+ const PERFORMANCE_THRESHOLD = parseFloat(process.env.PERFORMANCE_THRESHOLD || '1.5');
11
12
  describe('generate integration test(label, envelope)', () => {
12
13
  describe.each([templates_1.label, templates_1.envelope])('%s', (templateData) => {
13
14
  const entries = Object.entries(templateData);
@@ -30,7 +31,13 @@ describe('generate integration test(label, envelope)', () => {
30
31
  options: { font },
31
32
  });
32
33
  const hrend = process.hrtime(hrstart);
33
- expect(hrend[0]).toBeLessThanOrEqual(1);
34
+ const execSeconds = hrend[0] + hrend[1] / 1000000000;
35
+ if (process.env.CI) {
36
+ expect(execSeconds).toBeLessThan(PERFORMANCE_THRESHOLD);
37
+ }
38
+ else if (execSeconds >= PERFORMANCE_THRESHOLD) {
39
+ console.warn(`Warning: Execution time for ${key} is ${execSeconds} seconds, which is above the threshold of ${PERFORMANCE_THRESHOLD} seconds.`);
40
+ }
34
41
  const tmpFile = (0, utils_1.getPdfTmpPath)(`${key}.pdf`);
35
42
  const assertFile = (0, utils_1.getPdfAssertPath)(`${key}.pdf`);
36
43
  (0, fs_1.writeFileSync)(tmpFile, pdf);
@@ -1 +1 @@
1
- {"version":3,"file":"integration1.test.js","sourceRoot":"","sources":["../../../__tests__/integration1.test.ts"],"names":[],"mappings":";;;;;AAAA,2BAAmC;AACnC,+DAAuC;AACvC,kDAAqD;AACrD,4CAA6C;AAC7C,mCAA2E;AAE3E,QAAQ,CAAC,4CAA4C,EAAE,GAAG,EAAE;IAC1D,QAAQ,CAAC,IAAI,CAAC,CAAC,iBAAK,EAAE,oBAAQ,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AAM,CAAC,CAAC;gBAElD,IAAA,kBAAa,EAAC,OAAO,EAAE,GAAG,CAAC,CAAC;gBAC5B,MAAM,GAAG,GAAQ,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC,IAAA,cAAM,EAAC,OAAO,CAAC,EAAE,IAAA,cAAM,EAAC,UAAU,CAAC,CAAC,CAAC,CAAC;gBAC1E,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,GAAG,CAAC;gBACnB,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;YACnC,CAAC,CAAC,CAAC;SACJ;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -8,6 +8,7 @@ const generate_1 = __importDefault(require("../src/generate"));
8
8
  const templates_1 = require("./assets/templates");
9
9
  const schemas_1 = require("@pdfme/schemas");
10
10
  const utils_1 = require("./utils");
11
+ const PERFORMANCE_THRESHOLD = parseFloat(process.env.PERFORMANCE_THRESHOLD || '2.0');
11
12
  describe('generate integration test(barcode, business)', () => {
12
13
  describe.each([templates_1.barcode, templates_1.business])('%s', (templateData) => {
13
14
  const entries = Object.entries(templateData);
@@ -30,7 +31,13 @@ describe('generate integration test(barcode, business)', () => {
30
31
  options: { font },
31
32
  });
32
33
  const hrend = process.hrtime(hrstart);
33
- expect(hrend[0]).toBeLessThanOrEqual(1);
34
+ const execSeconds = hrend[0] + hrend[1] / 1000000000;
35
+ if (process.env.CI) {
36
+ expect(execSeconds).toBeLessThan(PERFORMANCE_THRESHOLD);
37
+ }
38
+ else if (execSeconds >= PERFORMANCE_THRESHOLD) {
39
+ console.warn(`Warning: Execution time for ${key} is ${execSeconds} seconds, which is above the threshold of ${PERFORMANCE_THRESHOLD} seconds.`);
40
+ }
34
41
  const tmpFile = (0, utils_1.getPdfTmpPath)(`${key}.pdf`);
35
42
  const assertFile = (0, utils_1.getPdfAssertPath)(`${key}.pdf`);
36
43
  (0, fs_1.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AC,WAAW,CAAC,CAAC,YAAY,CAAC,qBAAqB,CAAC,CAAC;iBACzD;qBAAM,IAAI,WAAW,IAAI,qBAAqB,EAAE;oBAC/C,OAAO,CAAC,IAAI,CAAC,+BAA+B,GAAG,OAAO,WAAW,6CAA6C,qBAAqB,WAAW,CAAC,CAAC;iBACjJ;gBAED,MAAM,OAAO,GAAG,IAAA,qBAAa,EAAC,GAAG,GAAG,MAAM,CAAC,CAAC;gBAC5C,MAAM,UAAU,GAAG,IAAA,wBAAgB,EAAC,GAAG,GAAG,MAAM,CAAC,CAAC;gBAElD,IAAA,kBAAa,EAAC,OAAO,EAAE,GAAG,CAAC,CAAC;gBAC5B,MAAM,GAAG,GAAQ,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC,IAAA,cAAM,EAAC,OAAO,CAAC,EAAE,IAAA,cAAM,EAAC,UAAU,CAAC,CAAC,CAAC,CAAC;gBAC1E,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,GAAG,CAAC;gBACnB,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;YACnC,CAAC,CAAC,CAAC;SACJ;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -8,8 +8,20 @@ const generate_1 = __importDefault(require("../src/generate"));
8
8
  const templates_1 = require("./assets/templates");
9
9
  const schemas_1 = require("@pdfme/schemas");
10
10
  const utils_1 = require("./utils");
11
- describe('generate integration test(textType, other)', () => {
12
- describe.each([templates_1.textType, templates_1.other])('%s', (templateData) => {
11
+ const signature = {
12
+ pdf: schemas_1.image.pdf,
13
+ ui: () => { },
14
+ propPanel: {
15
+ ...schemas_1.image.propPanel,
16
+ defaultSchema: {
17
+ ...schemas_1.image.propPanel.defaultSchema,
18
+ type: 'signature',
19
+ },
20
+ },
21
+ };
22
+ const PERFORMANCE_THRESHOLD = parseFloat(process.env.PERFORMANCE_THRESHOLD || '1.5');
23
+ describe('generate integration test(other, shape)', () => {
24
+ describe.each([templates_1.other, templates_1.shape])('%s', (templateData) => {
13
25
  const entries = Object.entries(templateData);
14
26
  for (let l = 0; l < entries.length; l += 1) {
15
27
  const [key, template] = entries[l];
@@ -26,11 +38,27 @@ describe('generate integration test(textType, other)', () => {
26
38
  const pdf = await (0, generate_1.default)({
27
39
  inputs,
28
40
  template,
29
- plugins: { text: schemas_1.text, image: schemas_1.image },
41
+ plugins: {
42
+ text: schemas_1.text,
43
+ image: schemas_1.image,
44
+ line: schemas_1.line,
45
+ rectangle: schemas_1.rectangle,
46
+ ellipse: schemas_1.ellipse,
47
+ signature,
48
+ qrcode: schemas_1.barcodes.qrcode,
49
+ readOnlyText: schemas_1.readOnlyText,
50
+ readOnlySvg: schemas_1.readOnlySvg,
51
+ },
30
52
  options: { font },
31
53
  });
32
54
  const hrend = process.hrtime(hrstart);
33
- expect(hrend[0]).toBeLessThanOrEqual(1);
55
+ const execSeconds = hrend[0] + hrend[1] / 1000000000;
56
+ if (process.env.CI) {
57
+ expect(execSeconds).toBeLessThan(PERFORMANCE_THRESHOLD);
58
+ }
59
+ else if (execSeconds >= PERFORMANCE_THRESHOLD) {
60
+ console.warn(`Warning: Execution time for ${key} is ${execSeconds} seconds, which is above the threshold of ${PERFORMANCE_THRESHOLD} seconds.`);
61
+ }
34
62
  const tmpFile = (0, utils_1.getPdfTmpPath)(`${key}.pdf`);
35
63
  const assertFile = (0, utils_1.getPdfAssertPath)(`${key}.pdf`);
36
64
  (0, fs_1.writeFileSync)(tmpFile, pdf);
@@ -1 +1 @@
1
- {"version":3,"file":"integration3.test.js","sourceRoot":"","sources":["../../../__tests__/integration3.test.ts"],"names":[],"mappings":";;;;;AAAA,2BAAmC;AACnC,+DAAuC;AACvC,kDAAqD;AACrD,4CAA6C;AAC7C,mCAA2E;AAE3E,QAAQ,CAAC,4CAA4C,EAAE,GAAG,EAAE;IAC1D,QAAQ,CAAC,IAAI,CAAC,CAAC,oBAAQ,EAAE,iB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AC,CAAC,CAAC,GAAG,UAAU,CAAC;gBACrD,IAAI,OAAO,CAAC,GAAG,CAAC,EAAE,EAAE;oBAClB,MAAM,CAAC,WAAW,CAAC,CAAC,YAAY,CAAC,qBAAqB,CAAC,CAAC;iBACzD;qBAAM,IAAI,WAAW,IAAI,qBAAqB,EAAE;oBAC/C,OAAO,CAAC,IAAI,CAAC,+BAA+B,GAAG,OAAO,WAAW,6CAA6C,qBAAqB,WAAW,CAAC,CAAC;iBACjJ;gBAED,MAAM,OAAO,GAAG,IAAA,qBAAa,EAAC,GAAG,GAAG,MAAM,CAAC,CAAC;gBAC5C,MAAM,UAAU,GAAG,IAAA,wBAAgB,EAAC,GAAG,GAAG,MAAM,CAAC,CAAC;gBAElD,IAAA,kBAAa,EAAC,OAAO,EAAE,GAAG,CAAC,CAAC;gBAC5B,MAAM,GAAG,GAAQ,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC,IAAA,cAAM,EAAC,OAAO,CAAC,EAAE,IAAA,cAAM,EAAC,UAAU,CAAC,CAAC,CAAC,CAAC;gBAC1E,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,GAAG,CAAC;gBACnB,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;YACnC,CAAC,CAAC,CAAC;SACJ;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const fs_1 = require("fs");
7
+ const generate_1 = __importDefault(require("../src/generate"));
8
+ const templates_1 = require("./assets/templates");
9
+ const schemas_1 = require("@pdfme/schemas");
10
+ const utils_1 = require("./utils");
11
+ const PERFORMANCE_THRESHOLD = parseFloat(process.env.PERFORMANCE_THRESHOLD || '2.5');
12
+ describe('generate integration test(slower)', () => {
13
+ describe.each([templates_1.textType])('%s', (templateData) => {
14
+ const entries = Object.entries(templateData);
15
+ for (let l = 0; l < entries.length; l += 1) {
16
+ const [key, template] = entries[l];
17
+ // eslint-disable-next-line no-loop-func
18
+ test(`snapshot ${key}`, async () => {
19
+ const inputs = template.sampledata;
20
+ const font = (0, utils_1.getFont)();
21
+ font.SauceHanSansJP.fallback = false;
22
+ font.SauceHanSerifJP.fallback = false;
23
+ font['NotoSerifJP-Regular'].fallback = false;
24
+ // @ts-ignore
25
+ font[template.fontName].fallback = true;
26
+ const hrstart = process.hrtime();
27
+ const pdf = await (0, generate_1.default)({
28
+ inputs,
29
+ template,
30
+ plugins: { text: schemas_1.text, image: schemas_1.image, ...schemas_1.barcodes },
31
+ options: { font },
32
+ });
33
+ const hrend = process.hrtime(hrstart);
34
+ const execSeconds = hrend[0] + hrend[1] / 1000000000;
35
+ if (process.env.CI) {
36
+ expect(execSeconds).toBeLessThan(PERFORMANCE_THRESHOLD);
37
+ }
38
+ else if (execSeconds >= PERFORMANCE_THRESHOLD) {
39
+ console.warn(`Warning: Execution time for ${key} is ${execSeconds} seconds, which is above the threshold of ${PERFORMANCE_THRESHOLD} seconds.`);
40
+ }
41
+ const tmpFile = (0, utils_1.getPdfTmpPath)(`${key}.pdf`);
42
+ const assertFile = (0, utils_1.getPdfAssertPath)(`${key}.pdf`);
43
+ (0, fs_1.writeFileSync)(tmpFile, pdf);
44
+ const res = await Promise.all([(0, utils_1.getPdf)(tmpFile), (0, utils_1.getPdf)(assertFile)]);
45
+ const [a, e] = res;
46
+ expect(a.Pages).toEqual(e.Pages);
47
+ });
48
+ }
49
+ });
50
+ });
51
+ //# sourceMappingURL=integration4.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"integration4.test.js","sourceRoot":"","sources":["../../../__tests__/integration4.test.ts"],"names":[],"mappings":";;;;;AAAA,2BAAmC;AACnC,+DAAuC;AACvC,kDAA8C;AAC9C,4CAAuD;A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AAC;gBAEH,MAAM,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;gBACtC,MAAM,WAAW,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC;gBACrD,IAAI,OAAO,CAAC,GAAG,CAAC,EAAE,EAAE;oBAClB,MAAM,CAAC,WAAW,CAAC,CAAC,YAAY,CAAC,qBAAqB,CAAC,CAAC;iBACzD;qBAAM,IAAI,WAAW,IAAI,qBAAqB,EAAE;oBAC/C,OAAO,CAAC,IAAI,CAAC,+BAA+B,GAAG,OAAO,WAAW,6CAA6C,qBAAqB,WAAW,CAAC,CAAC;iBACjJ;gBAED,MAAM,OAAO,GAAG,IAAA,qBAAa,EAAC,GAAG,GAAG,MAAM,CAAC,CAAC;gBAC5C,MAAM,UAAU,GAAG,IAAA,wBAAgB,EAAC,GAAG,GAAG,MAAM,CAAC,CAAC;gBAElD,IAAA,kBAAa,EAAC,OAAO,EAAE,GAAG,CAAC,CAAC;gBAC5B,MAAM,GAAG,GAAQ,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC,IAAA,cAAM,EAAC,OAAO,CAAC,EAAE,IAAA,cAAM,EAAC,UAAU,CAAC,CAAC,CAAC,CAAC;gBAC1E,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,GAAG,CAAC;gBACnB,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;YACnC,CAAC,CAAC,CAAC;SACJ;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -30,6 +30,7 @@ const PDFParser = require('pdf2json');
30
30
  const SauceHanSansJPData = (0, fs_1.readFileSync)(path.join(__dirname, `/assets/fonts/SauceHanSansJP.ttf`));
31
31
  const SauceHanSerifJPData = (0, fs_1.readFileSync)(path.join(__dirname, `/assets/fonts/SauceHanSerifJP.ttf`));
32
32
  const NotoSerifJPRegularData = (0, fs_1.readFileSync)(path.join(__dirname, `/assets/fonts/NotoSerifJP-Regular.otf`));
33
+ const NotoSansJPRegularData = (0, fs_1.readFileSync)(path.join(__dirname, `/assets/fonts/NotoSansJP-Regular.otf`));
33
34
  const GloriaHallelujahRegularData = (0, fs_1.readFileSync)(path.join(__dirname, `/assets/fonts/GloriaHallelujah-Regular.ttf`));
34
35
  const GreatVibesRegularData = (0, fs_1.readFileSync)(path.join(__dirname, `/assets/fonts/GreatVibes-Regular.ttf`));
35
36
  const JuliusSansOneRegularData = (0, fs_1.readFileSync)(path.join(__dirname, `/assets/fonts/JuliusSansOne-Regular.ttf`));
@@ -37,6 +38,7 @@ const getFont = () => ({
37
38
  SauceHanSansJP: { fallback: true, data: SauceHanSansJPData },
38
39
  SauceHanSerifJP: { data: SauceHanSerifJPData },
39
40
  'NotoSerifJP-Regular': { data: NotoSerifJPRegularData },
41
+ 'NotoSansJP-Regular': { data: NotoSansJPRegularData },
40
42
  'GloriaHallelujah-Regular': { data: GloriaHallelujahRegularData },
41
43
  'GreatVibes-Regular': { data: GreatVibesRegularData },
42
44
  'JuliusSansOne-Regular': { data: JuliusSansOneRegularData },
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../__tests__/utils.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2BAAkC;AAClC,2CAA6B;AAG7B,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AACtC,MAAM,kBAAkB,GAAG,IAAA,iBAAY,EAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,kCAAkC,CAAC,CAAC,CAAC;AAClG,MAAM,mBAAmB,GAAG,IAAA,iBAAY,EAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,mCAAmC,CAAC,CAAC,CAAC;AACpG,MAAM,sBAAsB,GAAG,IAAA,iBAAY,EACzC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,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,iBAAqD;AACxE,MAAM,gBAAgB,GAAG,CAAC,QAAgB,EAAE,EAAE,CAAC,UAAU,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;AAAxE,QAAA,gBAAgB,oBAAwD"}
@@ -29,14 +29,17 @@ const helper_js_1 = require("./helper.js");
29
29
  const generate = async (props) => {
30
30
  (0, common_1.checkGenerateProps)(props);
31
31
  const { inputs, template, options = {}, plugins: userPlugins = {} } = props;
32
- const { pdfDoc, embeddedPages, embedPdfBoxes, renderObj } = await (0, helper_js_1.preprocessing)({
33
- template,
34
- userPlugins,
35
- });
32
+ if (inputs.length === 0) {
33
+ throw new Error('inputs should not be empty');
34
+ }
35
+ const { pdfDoc, embeddedPages, embedPdfBoxes, renderObj, readOnlySchemaKeys } = await (0, helper_js_1.preprocessing)({ template, userPlugins });
36
+ const keys = readOnlySchemaKeys.concat(Object.keys(inputs[0]));
37
+ if (template.columns) {
38
+ keys.sort((a, b) => (template.columns ?? []).indexOf(a) - (template.columns ?? []).indexOf(b));
39
+ }
36
40
  const _cache = new Map();
37
41
  for (let i = 0; i < inputs.length; i += 1) {
38
42
  const inputObj = inputs[i];
39
- const keys = Object.keys(inputObj);
40
43
  for (let j = 0; j < embeddedPages.length; j += 1) {
41
44
  const embeddedPage = embeddedPages[j];
42
45
  const { width: pageWidth, height: pageHeight } = embeddedPage;
@@ -47,14 +50,14 @@ const generate = async (props) => {
47
50
  const key = keys[l];
48
51
  const schemaObj = template.schemas[j];
49
52
  const schema = schemaObj[key];
50
- const value = inputObj[key];
51
- if (!schema || !value) {
53
+ if (!schema) {
52
54
  continue;
53
55
  }
54
56
  const render = renderObj[schema.type];
55
57
  if (!render) {
56
58
  continue;
57
59
  }
60
+ const value = schema.readOnly ? schema.readOnlyValue || '' : inputObj[key];
58
61
  await render({ key, value, schema, pdfLib, pdfDoc, page, options, _cache });
59
62
  }
60
63
  }
@@ -1 +1 @@
1
- {"version":3,"file":"generate.js","sourceRoot":"","sources":["../../../src/generate.ts"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E,YAAY,EAAE,WAAW,EAAE,CAAC,CAAC;YACtD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE;gBACvC,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;gBACpB,MAAM,SAAS,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;gBACtC,MAAM,MAAM,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC;gBAC9B,IAAI,CAAC,MAAM,EAAE;oBACX,SAAS;iBACV;gBAED,MAAM,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;gBACtC,IAAI,CAAC,MAAM,EAAE;oBACX,SAAS;iBACV;gBACD,MAAM,KAAK,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,IAAI,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;gBAC3E,MAAM,MAAM,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;aAC7E;SACF;KACF;IAED,IAAA,0BAAc,EAAC,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC;IAEpC,OAAO,MAAM,CAAC,IAAI,EAAE,CAAC;AACvB,CAAC,CAAC;AAEF,kBAAe,QAAQ,CAAC"}
@@ -62,7 +62,7 @@ const drawEmbeddedPage = (arg) => {
62
62
  exports.drawEmbeddedPage = drawEmbeddedPage;
63
63
  const preprocessing = async (arg) => {
64
64
  const { template, userPlugins } = arg;
65
- const { basePdf } = template;
65
+ const { basePdf, schemas } = template;
66
66
  const pdfDoc = await pdfLib.PDFDocument.create();
67
67
  // @ts-ignore
68
68
  pdfDoc.registerFontkit(fontkit);
@@ -71,7 +71,7 @@ const preprocessing = async (arg) => {
71
71
  const pluginValues = (Object.values(userPlugins).length > 0
72
72
  ? Object.values(userPlugins)
73
73
  : Object.values(schemas_1.builtInPlugins));
74
- const schemaTypes = template.schemas.flatMap((schemaObj) => Object.values(schemaObj).map((schema) => schema.type));
74
+ const schemaTypes = schemas.flatMap((schemaObj) => Object.values(schemaObj).map((schema) => schema.type));
75
75
  const renderObj = schemaTypes.reduce((acc, type) => {
76
76
  const render = pluginValues.find((pv) => pv.propPanel.defaultSchema.type === type);
77
77
  if (!render) {
@@ -80,7 +80,12 @@ Check this document: https://pdfme.com/docs/custom-schemas`);
80
80
  }
81
81
  return { ...acc, [type]: render.pdf };
82
82
  }, {});
83
- return { pdfDoc, embeddedPages, embedPdfBoxes, renderObj };
83
+ const readOnlySchemaKeys = schemas.reduce((acc, schema) => {
84
+ const entries = Object.entries(schema);
85
+ const keys = entries.reduce((acc, [key, value]) => (value.readOnly ? [...acc, key] : acc), []);
86
+ return [...acc, ...keys];
87
+ }, []);
88
+ return { pdfDoc, embeddedPages, embedPdfBoxes, renderObj, readOnlySchemaKeys };
84
89
  };
85
90
  exports.preprocessing = preprocessing;
86
91
  const postProcessing = (props) => {
@@ -1 +1 @@
1
- {"version":3,"file":"helper.js","sourceRoot":"","sources":["../../../src/helper.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAAmC;AACnC,uDAAyC;AAGzC,4CAAgD;AAChD,4CAA6F;AAC7F,0CAAuD;AACvD,iDAA2C;AAGpC,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,IAAA,sBAAa,EAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO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EACb,QAAQ,GAAG,OAAO,EAClB,gBAAgB,GAAG,IAAI,IAAI,EAAE,EAC7B,QAAQ,GAAG,wBAAS,EACpB,OAAO,GAAG,EAAE,EACZ,KAAK,GAAG,EAAE,GACX,GAAG,OAAO,CAAC;IACZ,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IACzB,MAAM,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;IACrC,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IAC3B,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;IAC7B,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;IAC7B,MAAM,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;IAC7C,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;IAC7B,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IAC3B,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AACzB,CAAC,CAAC;AAzBW,QAAA,cAAc,kBAyBzB"}
@@ -40,6 +40,8 @@ const verticalAlignmentTop = require('./verticalAlignmentTop.json');
40
40
  const verticalAlignmentMiddle = require('./verticalAlignmentMiddle.json');
41
41
  const verticalAlignmentBottom = require('./verticalAlignmentBottom.json');
42
42
  const test = require('./test.json');
43
+ const shapes = require('./shapes.json');
44
+ const pet = require('./pet.json');
43
45
  export const label = {
44
46
  宛名8面,
45
47
  シンプルラベル24面,
@@ -80,6 +82,7 @@ export const business = {
80
82
  履歴書,
81
83
  労働条件通知書,
82
84
  };
85
+ // These tests are slower, so we allow more time for them to pass
83
86
  export const textType = {
84
87
  dynamicFontSizeHorizontal,
85
88
  dynamicFontSizeVertical,
@@ -93,5 +96,9 @@ export const other = {
93
96
  canvasPdf,
94
97
  background,
95
98
  rotation,
99
+ pet,
100
+ };
101
+ export const shape = {
102
+ shapes,
96
103
  };
97
104
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":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,CAAC,MAAM,KAAK,GAAG;IACnB,IAAI;IACJ,UAAU;IACV,UAAU;IACV,WAAW;IACX,UAAU;IACV,cAAc;IACd,QAAQ;IACR,MAAM;IACN,SAAS;IACT,SAAS;IACT,OAAO;IACP,MAAM;IACN,WAAW;IACX,QAAQ;IACR,UAAU;CACX,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,MAAM;IACN,MAAM;IACN,MAAM;CACP,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,cAAc;IACd,cAAc;IACd,iBAAiB;IACjB,iBAAiB;IACjB,QAAQ;CACT,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,GAAG;IACH,KAAK;IACL,GAAG;IACH,GAAG;IACH,GAAG;IACH,GAAG;IACH,KAAK;IACL,GAAG;IACH,OAAO;CACR,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,yBAAyB;IACzB,uBAAuB;IACvB,oBAAoB;IACpB,uBAAuB;IACvB,uBAAuB;CACxB,CAAC;AAEF,MAAM,CAAC,MAAM,KAAK,GAAG;IACnB,IAAI;IACJ,WAAW;IACX,SAAS;IACT,UAAU;IACV,QAAQ;CACT,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../__tests__/assets/templates/index.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,GAAG,OAAO,CAAC,eAAe,CAAa,CAAC;AACpD,MAAM,SAAS,GAAG,OAAO,CAAC,kBAAkB,CAAa,CAAC;AAC1D,MAAM,SAAS,GAAG,OAAO,CAAC,kBAAkB,CAAa,CAAC;AAC1D,MAAM,IAAI,GAAG,OAAO,CAAC,aAAa,CAAa,CAAC;AAChD,MAAM,UAAU,GAAG,OAAO,CAAC,mBAAmB,CAAa,CAAC;AAC5D,MAAM,cAAc,GAAG,OAAO,CAAC,uBAAuB,CAAa,CAAC;AACpE,MAAM,OAAO,GAAG,OAAO,CAAC,gBAAgB,C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;IACd,iBAAiB;IACjB,iBAAiB;IACjB,QAAQ;CACT,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,GAAG;IACH,KAAK;IACL,GAAG;IACH,GAAG;IACH,GAAG;IACH,GAAG;IACH,KAAK;IACL,GAAG;IACH,OAAO;CACR,CAAC;AAEF,iEAAiE;AACjE,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,yBAAyB;IACzB,uBAAuB;IACvB,oBAAoB;IACpB,uBAAuB;IACvB,uBAAuB;CACxB,CAAC;AAEF,MAAM,CAAC,MAAM,KAAK,GAAG;IACnB,IAAI;IACJ,WAAW;IACX,SAAS;IACT,UAAU;IACV,QAAQ;IACR,GAAG;CACJ,CAAC;AAEF,MAAM,CAAC,MAAM,KAAK,GAAG;IACnB,MAAM;CACP,CAAC"}
@@ -3,6 +3,7 @@ import generate from '../src/generate';
3
3
  import { label, envelope } from './assets/templates';
4
4
  import { text, image } from '@pdfme/schemas';
5
5
  import { getFont, getPdf, getPdfTmpPath, getPdfAssertPath } from './utils';
6
+ const PERFORMANCE_THRESHOLD = parseFloat(process.env.PERFORMANCE_THRESHOLD || '1.5');
6
7
  describe('generate integration test(label, envelope)', () => {
7
8
  describe.each([label, envelope])('%s', (templateData) => {
8
9
  const entries = Object.entries(templateData);
@@ -25,7 +26,13 @@ describe('generate integration test(label, envelope)', () => {
25
26
  options: { font },
26
27
  });
27
28
  const hrend = process.hrtime(hrstart);
28
- expect(hrend[0]).toBeLessThanOrEqual(1);
29
+ const execSeconds = hrend[0] + hrend[1] / 1000000000;
30
+ if (process.env.CI) {
31
+ expect(execSeconds).toBeLessThan(PERFORMANCE_THRESHOLD);
32
+ }
33
+ else if (execSeconds >= PERFORMANCE_THRESHOLD) {
34
+ console.warn(`Warning: Execution time for ${key} is ${execSeconds} seconds, which is above the threshold of ${PERFORMANCE_THRESHOLD} seconds.`);
35
+ }
29
36
  const tmpFile = getPdfTmpPath(`${key}.pdf`);
30
37
  const assertFile = getP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EAAE,EAAE,IAAI,EAAE,KAAK,EAAE;oBACxB,OAAO,EAAE,EAAE,IAAI,EAAE;iBAClB,CAAC,CAAC;gBAEH,MAAM,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;gBACtC,MAAM,WAAW,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC;gBACrD,IAAI,OAAO,CAAC,GAAG,CAAC,EAAE,EAAE;oBAClB,MAAM,CAAC,WAAW,CAAC,CAAC,YAAY,CAAC,qBAAqB,CAAC,CAAC;iBACzD;qBAAM,IAAI,WAAW,IAAI,qBAAqB,EAAE;oBAC/C,OAAO,CAAC,IAAI,CAAC,+BAA+B,GAAG,OAAO,WAAW,6CAA6C,qBAAqB,WAAW,CAAC,CAAC;iBACjJ;gBAED,MAAM,OAAO,GAAG,aAAa,CAAC,GAAG,GAAG,MAAM,CAAC,CAAC;gBAC5C,MAAM,UAAU,GAAG,gBAAgB,CAAC,GAAG,GAAG,MAAM,CAAC,CAAC;gBAElD,aAAa,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;gBAC5B,MAAM,GAAG,GAAQ,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;gBAC1E,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,GAAG,CAAC;gBACnB,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;YACnC,CAAC,CAAC,CAAC;SACJ;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -3,6 +3,7 @@ import generate from '../src/generate';
3
3
  import { barcode, business } from './assets/templates';
4
4
  import { text, image, barcodes } from '@pdfme/schemas';
5
5
  import { getFont, getPdf, getPdfTmpPath, getPdfAssertPath } from './utils';
6
+ const PERFORMANCE_THRESHOLD = parseFloat(process.env.PERFORMANCE_THRESHOLD || '2.0');
6
7
  describe('generate integration test(barcode, business)', () => {
7
8
  describe.each([barcode, business])('%s', (templateData) => {
8
9
  const entries = Object.entries(templateData);
@@ -25,7 +26,13 @@ describe('generate integration test(barcode, business)', () => {
25
26
  options: { font },
26
27
  });
27
28
  const hrend = process.hrtime(hrstart);
28
- expect(hrend[0]).toBeLessThanOrEqual(1);
29
+ const execSeconds = hrend[0] + hrend[1] / 1000000000;
30
+ if (process.env.CI) {
31
+ expect(execSeconds).toBeLessThan(PERFORMANCE_THRESHOLD);
32
+ }
33
+ else if (execSeconds >= PERFORMANCE_THRESHOLD) {
34
+ console.warn(`Warning: Execution time for ${key} is ${execSeconds} seconds, which is above the threshold of ${PERFORMANCE_THRESHOLD} seconds.`);
35
+ }
29
36
  const tmpFile = getPdfTmpPath(`${key}.pdf`);
30
37
  const assertFile = getPdfAssertPath(`${key}.pdf`);
31
38
  writeFileSync(tmpFile, pdf);
@@ -1 +1 @@
1
- {"version":3,"file":"integration2.test.js","sourceRoot":"","sources":["../../../__tests__/integration2.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AACnC,OAAO,QAAQ,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE3E,QAAQ,CAAC,8CAA8C,EAAE,GAAG,EAAE;IAC5D,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,YAAY,EAAE,EAAE;QACxD,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAA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5C,MAAM,UAAU,GAAG,gBAAgB,CAAC,GAAG,GAAG,MAAM,CAAC,CAAC;gBAElD,aAAa,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;gBAC5B,MAAM,GAAG,GAAQ,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;gBAC1E,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,GAAG,CAAC;gBACnB,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;YACnC,CAAC,CAAC,CAAC;SACJ;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,10 +1,22 @@
1
1
  import { writeFileSync } from 'fs';
2
2
  import generate from '../src/generate';
3
- import { textType, other } from './assets/templates';
4
- import { text, image } from '@pdfme/schemas';
3
+ import { other, shape } from './assets/templates';
4
+ import { text, image, line, rectangle, ellipse, readOnlyText, barcodes, readOnlySvg, } from '@pdfme/schemas';
5
5
  import { getFont, getPdf, getPdfTmpPath, getPdfAssertPath } from './utils';
6
- describe('generate integration test(textType, other)', () => {
7
- describe.each([textType, other])('%s', (templateData) => {
6
+ const signature = {
7
+ pdf: image.pdf,
8
+ ui: () => { },
9
+ propPanel: {
10
+ ...image.propPanel,
11
+ defaultSchema: {
12
+ ...image.propPanel.defaultSchema,
13
+ type: 'signature',
14
+ },
15
+ },
16
+ };
17
+ const PERFORMANCE_THRESHOLD = parseFloat(process.env.PERFORMANCE_THRESHOLD || '1.5');
18
+ describe('generate integration test(other, shape)', () => {
19
+ describe.each([other, shape])('%s', (templateData) => {
8
20
  const entries = Object.entries(templateData);
9
21
  for (let l = 0; l < entries.length; l += 1) {
10
22
  const [key, template] = entries[l];
@@ -21,11 +33,27 @@ describe('generate integration test(textType, other)', () => {
21
33
  const pdf = await generate({
22
34
  inputs,
23
35
  template,
24
- plugins: { text, image },
36
+ plugins: {
37
+ text,
38
+ image,
39
+ line,
40
+ rectangle,
41
+ ellipse,
42
+ signature,
43
+ qrcode: barcodes.qrcode,
44
+ readOnlyText,
45
+ readOnlySvg,
46
+ },
25
47
  options: { font },
26
48
  });
27
49
  const hrend = process.hrtime(hrstart);
28
- expect(hrend[0]).toBeLessThanOrEqual(1);
50
+ const execSeconds = hrend[0] + hrend[1] / 1000000000;
51
+ if (process.env.CI) {
52
+ expect(execSeconds).toBeLessThan(PERFORMANCE_THRESHOLD);
53
+ }
54
+ else if (execSeconds >= PERFORMANCE_THRESHOLD) {
55
+ console.warn(`Warning: Execution time for ${key} is ${execSeconds} seconds, which is above the threshold of ${PERFORMANCE_THRESHOLD} seconds.`);
56
+ }
29
57
  const tmpFile = getPdfTmpPath(`${key}.pdf`);
30
58
  const assertFile = getPdfAssertPath(`${key}.pdf`);
31
59
  writeFileSync(tmpFile, pdf);
@@ -1 +1 @@
1
- {"version":3,"file":"integration3.test.js","sourceRoot":"","sources":["../../../__tests__/integration3.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AACnC,OAAO,QAAQ,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE3E,QAAQ,CAAC,4CAA4C,EAAE,GAAG,EAAE;IAC1D,QAAQ,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,YAAY,EAAE,EAAE;QACtD,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;QAC7C,KAAK,IAAI,CAAC,GAAG,CA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