av6-pdf-engine 1.0.8 → 1.0.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/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +32 -32
- package/dist/index.mjs +32 -32
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -312,9 +312,6 @@ declare enum PdfEngineErrorCode {
|
|
|
312
312
|
PDF_ERROR_PDFKIT_ERROR = "PDF_ERROR_PDFKIT_ERROR"
|
|
313
313
|
}
|
|
314
314
|
|
|
315
|
-
declare function renderCustomPdf(def: CustomDocDefinition, outputPath: string): Promise<void>;
|
|
316
|
-
declare function renderCustomPdfToBuffer(def: CustomDocDefinition): Promise<Buffer>;
|
|
317
|
-
|
|
318
315
|
declare class PdfEngineError extends Error {
|
|
319
316
|
readonly code: PdfEngineErrorCode;
|
|
320
317
|
readonly statusCode: number;
|
|
@@ -339,4 +336,7 @@ declare function toPdfEngineError(cause: unknown, fallback: {
|
|
|
339
336
|
retryable?: boolean;
|
|
340
337
|
}): PdfEngineError;
|
|
341
338
|
|
|
339
|
+
declare function renderCustomPdf(def: CustomDocDefinition, outputPath: string): Promise<void>;
|
|
340
|
+
declare function renderCustomPdfToBuffer(def: CustomDocDefinition): Promise<Buffer>;
|
|
341
|
+
|
|
342
342
|
export { type Alignment, BARCODE_TYPES, type BarcodeBlock, type BarcodeType, type BaseBlock, type Block, type BuiltInFont, type ColumnsBlock, type CustomDocDefinition, type FontName, type FontRegistration, type FooterDef, type FooterInput, type HeaderDef, type ImageBlock, type InlineTextStyle, type KeyValueGridBlock, type KeyValueItem, type LineBlock, type Orientation, type PDFDoc, type PageBackgroundDef, type PageBreakBlock, type PageContext, type PageMargins, PdfEngineError, PdfEngineErrorCode, type QRErrorLevel, QR_ERROR_LEVEL, type QrCodeBlock, type RenderEnv, type SignatureBlock, type StyleDef, type StyleRef, type TableBlock, type TableCell, type TextBlock, type WatermarkDef, type WatermarkMode, type Width, isPdfEngineError, renderCustomPdf, renderCustomPdfToBuffer, toPdfEngineError };
|
package/dist/index.d.ts
CHANGED
|
@@ -312,9 +312,6 @@ declare enum PdfEngineErrorCode {
|
|
|
312
312
|
PDF_ERROR_PDFKIT_ERROR = "PDF_ERROR_PDFKIT_ERROR"
|
|
313
313
|
}
|
|
314
314
|
|
|
315
|
-
declare function renderCustomPdf(def: CustomDocDefinition, outputPath: string): Promise<void>;
|
|
316
|
-
declare function renderCustomPdfToBuffer(def: CustomDocDefinition): Promise<Buffer>;
|
|
317
|
-
|
|
318
315
|
declare class PdfEngineError extends Error {
|
|
319
316
|
readonly code: PdfEngineErrorCode;
|
|
320
317
|
readonly statusCode: number;
|
|
@@ -339,4 +336,7 @@ declare function toPdfEngineError(cause: unknown, fallback: {
|
|
|
339
336
|
retryable?: boolean;
|
|
340
337
|
}): PdfEngineError;
|
|
341
338
|
|
|
339
|
+
declare function renderCustomPdf(def: CustomDocDefinition, outputPath: string): Promise<void>;
|
|
340
|
+
declare function renderCustomPdfToBuffer(def: CustomDocDefinition): Promise<Buffer>;
|
|
341
|
+
|
|
342
342
|
export { type Alignment, BARCODE_TYPES, type BarcodeBlock, type BarcodeType, type BaseBlock, type Block, type BuiltInFont, type ColumnsBlock, type CustomDocDefinition, type FontName, type FontRegistration, type FooterDef, type FooterInput, type HeaderDef, type ImageBlock, type InlineTextStyle, type KeyValueGridBlock, type KeyValueItem, type LineBlock, type Orientation, type PDFDoc, type PageBackgroundDef, type PageBreakBlock, type PageContext, type PageMargins, PdfEngineError, PdfEngineErrorCode, type QRErrorLevel, QR_ERROR_LEVEL, type QrCodeBlock, type RenderEnv, type SignatureBlock, type StyleDef, type StyleRef, type TableBlock, type TableCell, type TextBlock, type WatermarkDef, type WatermarkMode, type Width, isPdfEngineError, renderCustomPdf, renderCustomPdfToBuffer, toPdfEngineError };
|
package/dist/index.js
CHANGED
|
@@ -41,6 +41,38 @@ __export(index_exports, {
|
|
|
41
41
|
});
|
|
42
42
|
module.exports = __toCommonJS(index_exports);
|
|
43
43
|
|
|
44
|
+
// src/error/index.ts
|
|
45
|
+
var PdfEngineError = class extends Error {
|
|
46
|
+
code;
|
|
47
|
+
statusCode;
|
|
48
|
+
details;
|
|
49
|
+
retryable;
|
|
50
|
+
cause;
|
|
51
|
+
constructor(args) {
|
|
52
|
+
super(args.message);
|
|
53
|
+
this.name = "PdfEngineError";
|
|
54
|
+
this.code = args.code;
|
|
55
|
+
this.statusCode = args.statusCode ?? 400;
|
|
56
|
+
this.details = args.details;
|
|
57
|
+
this.retryable = args.retryable ?? false;
|
|
58
|
+
this.cause = args.cause;
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
function isPdfEngineError(e) {
|
|
62
|
+
return e instanceof PdfEngineError;
|
|
63
|
+
}
|
|
64
|
+
function toPdfEngineError(cause, fallback) {
|
|
65
|
+
if (cause instanceof PdfEngineError) return cause;
|
|
66
|
+
return new PdfEngineError({
|
|
67
|
+
code: fallback.code,
|
|
68
|
+
message: fallback.message,
|
|
69
|
+
statusCode: fallback.statusCode,
|
|
70
|
+
details: fallback.details,
|
|
71
|
+
retryable: fallback.retryable,
|
|
72
|
+
cause
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
|
|
44
76
|
// src/renderer-engine/index.ts
|
|
45
77
|
var import_fs = __toESM(require("fs"));
|
|
46
78
|
var import_pdfkit = __toESM(require("pdfkit"));
|
|
@@ -828,38 +860,6 @@ var contentEnv = (doc) => ({
|
|
|
828
860
|
allowPageBreak: true
|
|
829
861
|
});
|
|
830
862
|
|
|
831
|
-
// src/renderer-engine/utils/error.ts
|
|
832
|
-
var PdfEngineError = class extends Error {
|
|
833
|
-
code;
|
|
834
|
-
statusCode;
|
|
835
|
-
details;
|
|
836
|
-
retryable;
|
|
837
|
-
cause;
|
|
838
|
-
constructor(args) {
|
|
839
|
-
super(args.message);
|
|
840
|
-
this.name = "PdfEngineError";
|
|
841
|
-
this.code = args.code;
|
|
842
|
-
this.statusCode = args.statusCode ?? 400;
|
|
843
|
-
this.details = args.details;
|
|
844
|
-
this.retryable = args.retryable ?? false;
|
|
845
|
-
this.cause = args.cause;
|
|
846
|
-
}
|
|
847
|
-
};
|
|
848
|
-
function isPdfEngineError(e) {
|
|
849
|
-
return e instanceof PdfEngineError;
|
|
850
|
-
}
|
|
851
|
-
function toPdfEngineError(cause, fallback) {
|
|
852
|
-
if (cause instanceof PdfEngineError) return cause;
|
|
853
|
-
return new PdfEngineError({
|
|
854
|
-
code: fallback.code,
|
|
855
|
-
message: fallback.message,
|
|
856
|
-
statusCode: fallback.statusCode,
|
|
857
|
-
details: fallback.details,
|
|
858
|
-
retryable: fallback.retryable,
|
|
859
|
-
cause
|
|
860
|
-
});
|
|
861
|
-
}
|
|
862
|
-
|
|
863
863
|
// src/renderer-engine/utils/finish-page.ts
|
|
864
864
|
function finishPage({
|
|
865
865
|
addNewPage,
|
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,35 @@
|
|
|
1
|
+
// src/error/index.ts
|
|
2
|
+
var PdfEngineError = class extends Error {
|
|
3
|
+
code;
|
|
4
|
+
statusCode;
|
|
5
|
+
details;
|
|
6
|
+
retryable;
|
|
7
|
+
cause;
|
|
8
|
+
constructor(args) {
|
|
9
|
+
super(args.message);
|
|
10
|
+
this.name = "PdfEngineError";
|
|
11
|
+
this.code = args.code;
|
|
12
|
+
this.statusCode = args.statusCode ?? 400;
|
|
13
|
+
this.details = args.details;
|
|
14
|
+
this.retryable = args.retryable ?? false;
|
|
15
|
+
this.cause = args.cause;
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
function isPdfEngineError(e) {
|
|
19
|
+
return e instanceof PdfEngineError;
|
|
20
|
+
}
|
|
21
|
+
function toPdfEngineError(cause, fallback) {
|
|
22
|
+
if (cause instanceof PdfEngineError) return cause;
|
|
23
|
+
return new PdfEngineError({
|
|
24
|
+
code: fallback.code,
|
|
25
|
+
message: fallback.message,
|
|
26
|
+
statusCode: fallback.statusCode,
|
|
27
|
+
details: fallback.details,
|
|
28
|
+
retryable: fallback.retryable,
|
|
29
|
+
cause
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
|
|
1
33
|
// src/renderer-engine/index.ts
|
|
2
34
|
import fs from "fs";
|
|
3
35
|
import PDFDocument from "pdfkit";
|
|
@@ -785,38 +817,6 @@ var contentEnv = (doc) => ({
|
|
|
785
817
|
allowPageBreak: true
|
|
786
818
|
});
|
|
787
819
|
|
|
788
|
-
// src/renderer-engine/utils/error.ts
|
|
789
|
-
var PdfEngineError = class extends Error {
|
|
790
|
-
code;
|
|
791
|
-
statusCode;
|
|
792
|
-
details;
|
|
793
|
-
retryable;
|
|
794
|
-
cause;
|
|
795
|
-
constructor(args) {
|
|
796
|
-
super(args.message);
|
|
797
|
-
this.name = "PdfEngineError";
|
|
798
|
-
this.code = args.code;
|
|
799
|
-
this.statusCode = args.statusCode ?? 400;
|
|
800
|
-
this.details = args.details;
|
|
801
|
-
this.retryable = args.retryable ?? false;
|
|
802
|
-
this.cause = args.cause;
|
|
803
|
-
}
|
|
804
|
-
};
|
|
805
|
-
function isPdfEngineError(e) {
|
|
806
|
-
return e instanceof PdfEngineError;
|
|
807
|
-
}
|
|
808
|
-
function toPdfEngineError(cause, fallback) {
|
|
809
|
-
if (cause instanceof PdfEngineError) return cause;
|
|
810
|
-
return new PdfEngineError({
|
|
811
|
-
code: fallback.code,
|
|
812
|
-
message: fallback.message,
|
|
813
|
-
statusCode: fallback.statusCode,
|
|
814
|
-
details: fallback.details,
|
|
815
|
-
retryable: fallback.retryable,
|
|
816
|
-
cause
|
|
817
|
-
});
|
|
818
|
-
}
|
|
819
|
-
|
|
820
820
|
// src/renderer-engine/utils/finish-page.ts
|
|
821
821
|
function finishPage({
|
|
822
822
|
addNewPage,
|