chromiumly 2.4.0 → 2.5.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.
- package/README.md +57 -40
- package/dist/chromium/converters/converter.d.ts +13 -0
- package/dist/chromium/converters/converter.js +10 -0
- package/dist/chromium/converters/converter.js.map +1 -1
- package/dist/chromium/converters/html.converter.d.ts +32 -6
- package/dist/chromium/converters/html.converter.js +30 -9
- package/dist/chromium/converters/html.converter.js.map +1 -1
- package/dist/chromium/converters/markdown.converter.d.ts +34 -7
- package/dist/chromium/converters/markdown.converter.js +32 -16
- package/dist/chromium/converters/markdown.converter.js.map +1 -1
- package/dist/chromium/converters/url.converter.d.ts +31 -5
- package/dist/chromium/converters/url.converter.js +29 -1
- package/dist/chromium/converters/url.converter.js.map +1 -1
- package/dist/chromium/index.js.map +1 -1
- package/dist/chromium/interfaces/converter.types.d.ts +3 -6
- package/dist/chromium/utils/converter.utils.d.ts +27 -1
- package/dist/chromium/utils/converter.utils.js +48 -21
- package/dist/chromium/utils/converter.utils.js.map +1 -1
- package/dist/common/constants.js.map +1 -1
- package/dist/common/gotenberg.utils.d.ts +18 -0
- package/dist/common/gotenberg.utils.js +18 -0
- package/dist/common/gotenberg.utils.js.map +1 -1
- package/dist/common/index.d.ts +1 -0
- package/dist/common/index.js.map +1 -1
- package/dist/common/types.d.ts +3 -0
- package/dist/common/types.js +3 -0
- package/dist/common/types.js.map +1 -0
- package/dist/gotenberg.d.ts +8 -0
- package/dist/gotenberg.js +8 -0
- package/dist/gotenberg.js.map +1 -1
- package/dist/libre-office/index.js.map +1 -1
- package/dist/libre-office/utils/constants.js +76 -76
- package/dist/libre-office/utils/constants.js.map +1 -1
- package/dist/libre-office/utils/libre-office.utils.d.ts +19 -4
- package/dist/libre-office/utils/libre-office.utils.js +39 -7
- package/dist/libre-office/utils/libre-office.utils.js.map +1 -1
- package/dist/main.config.d.ts +43 -0
- package/dist/main.config.js +43 -0
- package/dist/main.config.js.map +1 -1
- package/dist/main.js.map +1 -1
- package/dist/pdf-engines/index.js.map +1 -1
- package/dist/pdf-engines/pdf.engine.d.ts +31 -5
- package/dist/pdf-engines/pdf.engine.js +31 -3
- package/dist/pdf-engines/pdf.engine.js.map +1 -1
- package/dist/pdf-engines/utils/engine.utils.d.ts +12 -3
- package/dist/pdf-engines/utils/engine.utils.js +27 -8
- package/dist/pdf-engines/utils/engine.utils.js.map +1 -1
- package/package.json +8 -7
- package/src/chromium/converters/converter.ts +18 -5
- package/src/chromium/converters/html.converter.ts +82 -61
- package/src/chromium/converters/markdown.converter.ts +86 -69
- package/src/chromium/converters/tests/html.converter.test.ts +119 -135
- package/src/chromium/converters/tests/markdown.converter.test.ts +131 -150
- package/src/chromium/converters/tests/url.converter.test.ts +114 -123
- package/src/chromium/converters/url.converter.ts +84 -60
- package/src/chromium/index.ts +3 -3
- package/src/chromium/interfaces/converter.types.ts +27 -27
- package/src/chromium/utils/converter.utils.ts +165 -139
- package/src/chromium/utils/tests/converter.utils.test.ts +312 -311
- package/src/common/constants.ts +3 -3
- package/src/common/gotenberg.utils.ts +36 -17
- package/src/common/index.ts +3 -2
- package/src/common/tests/gotenberg.utils.test.ts +54 -54
- package/src/common/types.ts +3 -0
- package/src/gotenberg.ts +13 -4
- package/src/libre-office/index.ts +2 -2
- package/src/libre-office/interfaces/libre-office.types.ts +2 -2
- package/src/libre-office/utils/constants.ts +76 -76
- package/src/libre-office/utils/libre-office.utils.ts +72 -37
- package/src/libre-office/utils/tests/libre-office.utils.test.ts +100 -68
- package/src/main.config.ts +68 -22
- package/src/main.ts +3 -3
- package/src/pdf-engines/index.ts +1 -1
- package/src/pdf-engines/pdf.engine.ts +77 -49
- package/src/pdf-engines/tests/pdf.engine.test.ts +94 -94
- package/src/pdf-engines/utils/engine.utils.ts +30 -12
- package/src/pdf-engines/utils/tests/engine.utils.test.ts +60 -48
|
@@ -1,6 +1,32 @@
|
|
|
1
1
|
import FormData from "form-data";
|
|
2
2
|
import { ConversionOptions, PageProperties } from "../interfaces/converter.types";
|
|
3
|
+
import { PathLikeOrReadStream } from "../../common";
|
|
4
|
+
/**
|
|
5
|
+
* Utility class for handling common tasks related to conversion.
|
|
6
|
+
*/
|
|
3
7
|
export declare class ConverterUtils {
|
|
4
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Adds page properties to the FormData object based on the provided PageProperties.
|
|
10
|
+
*
|
|
11
|
+
* @param {FormData} data - The FormData object to which page properties will be added.
|
|
12
|
+
* @param {PageProperties} pageProperties - The page properties to be added to the FormData.
|
|
13
|
+
*/
|
|
14
|
+
static addPageProperties(data: FormData, pageProperties: PageProperties): void;
|
|
15
|
+
/**
|
|
16
|
+
* Adds a file to the FormData object.
|
|
17
|
+
*
|
|
18
|
+
* @param {FormData} data - The FormData object to which the file will be added.
|
|
19
|
+
* @param {PathLikeOrReadStream} file - The file to be added (either a PathLike or a ReadStream).
|
|
20
|
+
* @param {string} name - The name to be used for the file in the FormData.
|
|
21
|
+
* @returns {Promise<void>} A Promise that resolves once the file has been added.
|
|
22
|
+
*/
|
|
23
|
+
static addFile(data: FormData, file: PathLikeOrReadStream, name: string): Promise<void>;
|
|
24
|
+
/**
|
|
25
|
+
* Customizes the FormData object based on the provided conversion options.
|
|
26
|
+
*
|
|
27
|
+
* @param {FormData} data - The FormData object to be customized.
|
|
28
|
+
* @param {ConversionOptions} options - The conversion options to apply to the FormData.
|
|
29
|
+
* @returns {Promise<void>} A Promise that resolves once the customization is complete.
|
|
30
|
+
*/
|
|
5
31
|
static customize(data: FormData, options: ConversionOptions): Promise<void>;
|
|
6
32
|
}
|
|
@@ -3,16 +3,26 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ConverterUtils = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const fs_1 = require("fs");
|
|
6
|
-
const
|
|
6
|
+
const common_1 = require("../../common");
|
|
7
|
+
const fs_2 = require("fs");
|
|
8
|
+
/**
|
|
9
|
+
* Utility class for handling common tasks related to conversion.
|
|
10
|
+
*/
|
|
7
11
|
class ConverterUtils {
|
|
8
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Adds page properties to the FormData object based on the provided PageProperties.
|
|
14
|
+
*
|
|
15
|
+
* @param {FormData} data - The FormData object to which page properties will be added.
|
|
16
|
+
* @param {PageProperties} pageProperties - The page properties to be added to the FormData.
|
|
17
|
+
*/
|
|
18
|
+
static addPageProperties(data, pageProperties) {
|
|
9
19
|
if (pageProperties.size) {
|
|
10
|
-
|
|
20
|
+
common_1.GotenbergUtils.assert(pageProperties.size.width >= 1.0 && pageProperties.size.height >= 1.5, "size is smaller than the minimum printing requirements (i.e. 1.0 x 1.5 in)");
|
|
11
21
|
data.append("paperWidth", pageProperties.size.width);
|
|
12
22
|
data.append("paperHeight", pageProperties.size.height);
|
|
13
23
|
}
|
|
14
24
|
if (pageProperties.margins) {
|
|
15
|
-
|
|
25
|
+
common_1.GotenbergUtils.assert(pageProperties.margins.top >= 0 &&
|
|
16
26
|
pageProperties.margins.bottom >= 0 &&
|
|
17
27
|
pageProperties.margins.left >= 0 &&
|
|
18
28
|
pageProperties.margins.left >= 0, "negative margins are not allowed");
|
|
@@ -34,17 +44,46 @@ class ConverterUtils {
|
|
|
34
44
|
data.append("landscape", String(pageProperties.landscape));
|
|
35
45
|
}
|
|
36
46
|
if (pageProperties.scale) {
|
|
37
|
-
|
|
47
|
+
common_1.GotenbergUtils.assert(pageProperties.scale >= 0.1 && pageProperties.scale <= 2.0, "scale is outside of [0.1 - 2] range");
|
|
38
48
|
data.append("scale", pageProperties.scale);
|
|
39
49
|
}
|
|
40
50
|
if (pageProperties.nativePageRanges) {
|
|
41
|
-
|
|
51
|
+
common_1.GotenbergUtils.assert(pageProperties.nativePageRanges.from > 0 &&
|
|
42
52
|
pageProperties.nativePageRanges.to > 0 &&
|
|
43
53
|
pageProperties.nativePageRanges.to >=
|
|
44
54
|
pageProperties.nativePageRanges.from, "page ranges syntax error");
|
|
45
55
|
data.append("nativePageRanges", `${pageProperties.nativePageRanges.from}-${pageProperties.nativePageRanges.to}`);
|
|
46
56
|
}
|
|
47
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* Adds a file to the FormData object.
|
|
60
|
+
*
|
|
61
|
+
* @param {FormData} data - The FormData object to which the file will be added.
|
|
62
|
+
* @param {PathLikeOrReadStream} file - The file to be added (either a PathLike or a ReadStream).
|
|
63
|
+
* @param {string} name - The name to be used for the file in the FormData.
|
|
64
|
+
* @returns {Promise<void>} A Promise that resolves once the file has been added.
|
|
65
|
+
*/
|
|
66
|
+
static addFile(data, file, name) {
|
|
67
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
68
|
+
if (Buffer.isBuffer(file)) {
|
|
69
|
+
data.append("files", file, name);
|
|
70
|
+
}
|
|
71
|
+
else if (file instanceof fs_2.ReadStream) {
|
|
72
|
+
data.append("files", file, name);
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
yield fs_1.promises.access(file, fs_1.constants.R_OK);
|
|
76
|
+
data.append("files", (0, fs_1.createReadStream)(file), name);
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Customizes the FormData object based on the provided conversion options.
|
|
82
|
+
*
|
|
83
|
+
* @param {FormData} data - The FormData object to be customized.
|
|
84
|
+
* @param {ConversionOptions} options - The conversion options to apply to the FormData.
|
|
85
|
+
* @returns {Promise<void>} A Promise that resolves once the customization is complete.
|
|
86
|
+
*/
|
|
48
87
|
static customize(data, options) {
|
|
49
88
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
50
89
|
if (options.pdfFormat) {
|
|
@@ -55,29 +94,17 @@ class ConverterUtils {
|
|
|
55
94
|
}
|
|
56
95
|
if (options.header) {
|
|
57
96
|
const { header } = options;
|
|
58
|
-
|
|
59
|
-
data.append("files", header, "header.html");
|
|
60
|
-
}
|
|
61
|
-
else {
|
|
62
|
-
yield fs_1.promises.access(options.header, fs_1.constants.R_OK);
|
|
63
|
-
data.append("files", (0, fs_1.createReadStream)(options.header), "header.html");
|
|
64
|
-
}
|
|
97
|
+
yield ConverterUtils.addFile(data, header, "header.html");
|
|
65
98
|
}
|
|
66
99
|
if (options.footer) {
|
|
67
100
|
const { footer } = options;
|
|
68
|
-
|
|
69
|
-
data.append("files", footer, "footer.html");
|
|
70
|
-
}
|
|
71
|
-
else {
|
|
72
|
-
yield fs_1.promises.access(options.footer, fs_1.constants.R_OK);
|
|
73
|
-
data.append("files", (0, fs_1.createReadStream)(options.footer), "footer.html");
|
|
74
|
-
}
|
|
101
|
+
yield ConverterUtils.addFile(data, footer, "footer.html");
|
|
75
102
|
}
|
|
76
103
|
if (options.emulatedMediaType) {
|
|
77
104
|
data.append("emulatedMediaType", options.emulatedMediaType);
|
|
78
105
|
}
|
|
79
106
|
if (options.properties) {
|
|
80
|
-
ConverterUtils.
|
|
107
|
+
ConverterUtils.addPageProperties(data, options.properties);
|
|
81
108
|
}
|
|
82
109
|
if (options.waitDelay) {
|
|
83
110
|
data.append("waitDelay", options.waitDelay);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"converter.utils.js","sourceRoot":"","sources":["../../../src/chromium/utils/converter.utils.ts"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"converter.utils.js","sourceRoot":"","sources":["../../../src/chromium/utils/converter.utils.ts"],"names":[],"mappings":";;;;AAAA,2BAAyD;AAOzD,yCAAkE;AAClE,2BAA8B;AAE9B;;GAEG;AACH,MAAa,cAAc;IACvB;;;;;OAKG;IACI,MAAM,CAAC,iBAAiB,CAC3B,IAAc,EACd,cAA8B;QAE9B,IAAI,cAAc,CAAC,IAAI,EAAE,CAAC;YACtB,uBAAc,CAAC,MAAM,CACjB,cAAc,CAAC,IAAI,CAAC,KAAK,IAAI,GAAG,IAAI,cAAc,CAAC,IAAI,CAAC,MAAM,IAAI,GAAG,EACrE,4EAA4E,CAC/E,CAAC;YAE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I,CAAC,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;YAChD,CAAC;YAED,IAAI,OAAO,CAAC,iBAAiB,EAAE,CAAC;gBAC5B,IAAI,CAAC,MAAM,CAAC,mBAAmB,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;YAChE,CAAC;YAED,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC;gBACpB,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;YAChD,CAAC;YAED,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC;gBAC3B,IAAI,CAAC,MAAM,CAAC,kBAAkB,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC;YAC9E,CAAC;YAED,IAAI,OAAO,CAAC,uBAAuB,EAAE,CAAC;gBAClC,IAAI,CAAC,MAAM,CACP,yBAAyB,EACzB,MAAM,CAAC,OAAO,CAAC,uBAAuB,CAAC,CAC1C,CAAC;YACN,CAAC;QACL,CAAC;KAAA;CACJ;AA/JD,wCA+JC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/common/constants.ts"],"names":[],"mappings":";;;AAAA,IAAY,SAIX;AAJD,WAAY,SAAS;
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/common/constants.ts"],"names":[],"mappings":";;;AAAA,IAAY,SAIX;AAJD,WAAY,SAAS;IACjB,8BAAiB,CAAA;IACjB,8BAAiB,CAAA;IACjB,8BAAiB,CAAA;AACrB,CAAC,EAJW,SAAS,yBAAT,SAAS,QAIpB"}
|
|
@@ -1,6 +1,24 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import FormData from "form-data";
|
|
3
|
+
/**
|
|
4
|
+
* Utility class for common tasks related to the Gotenberg service.
|
|
5
|
+
*/
|
|
3
6
|
export declare class GotenbergUtils {
|
|
7
|
+
/**
|
|
8
|
+
* Asserts that a condition is true; otherwise, throws an error with the specified message.
|
|
9
|
+
*
|
|
10
|
+
* @param {boolean} condition - The condition to assert.
|
|
11
|
+
* @param {string} message - The error message to throw if the condition is false.
|
|
12
|
+
* @throws {Error} Throws an error with the specified message if the condition is false.
|
|
13
|
+
*/
|
|
4
14
|
static assert(condition: boolean, message: string): asserts condition;
|
|
15
|
+
/**
|
|
16
|
+
* Performs a POST request to the specified Gotenberg endpoint with the provided FormData.
|
|
17
|
+
*
|
|
18
|
+
* @param {string} endpoint - The Gotenberg endpoint URL.
|
|
19
|
+
* @param {FormData} data - The FormData object to be sent in the POST request.
|
|
20
|
+
* @returns {Promise<Buffer>} A Promise that resolves to the response body as a Buffer.
|
|
21
|
+
* @throws {Error} Throws an error if the HTTP response status is not OK.
|
|
22
|
+
*/
|
|
5
23
|
static fetch(endpoint: string, data: FormData): Promise<Buffer>;
|
|
6
24
|
}
|
|
@@ -3,12 +3,30 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.GotenbergUtils = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const node_fetch_1 = tslib_1.__importDefault(require("node-fetch"));
|
|
6
|
+
/**
|
|
7
|
+
* Utility class for common tasks related to the Gotenberg service.
|
|
8
|
+
*/
|
|
6
9
|
class GotenbergUtils {
|
|
10
|
+
/**
|
|
11
|
+
* Asserts that a condition is true; otherwise, throws an error with the specified message.
|
|
12
|
+
*
|
|
13
|
+
* @param {boolean} condition - The condition to assert.
|
|
14
|
+
* @param {string} message - The error message to throw if the condition is false.
|
|
15
|
+
* @throws {Error} Throws an error with the specified message if the condition is false.
|
|
16
|
+
*/
|
|
7
17
|
static assert(condition, message) {
|
|
8
18
|
if (!condition) {
|
|
9
19
|
throw new Error(message);
|
|
10
20
|
}
|
|
11
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* Performs a POST request to the specified Gotenberg endpoint with the provided FormData.
|
|
24
|
+
*
|
|
25
|
+
* @param {string} endpoint - The Gotenberg endpoint URL.
|
|
26
|
+
* @param {FormData} data - The FormData object to be sent in the POST request.
|
|
27
|
+
* @returns {Promise<Buffer>} A Promise that resolves to the response body as a Buffer.
|
|
28
|
+
* @throws {Error} Throws an error if the HTTP response status is not OK.
|
|
29
|
+
*/
|
|
12
30
|
static fetch(endpoint, data) {
|
|
13
31
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
14
32
|
const response = yield (0, node_fetch_1.default)(endpoint, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gotenberg.utils.js","sourceRoot":"","sources":["../../src/common/gotenberg.utils.ts"],"names":[],"mappings":";;;;AACA,oEAA+B;AAE/B,MAAa,cAAc;
|
|
1
|
+
{"version":3,"file":"gotenberg.utils.js","sourceRoot":"","sources":["../../src/common/gotenberg.utils.ts"],"names":[],"mappings":";;;;AACA,oEAA+B;AAE/B;;GAEG;AACH,MAAa,cAAc;IACvB;;;;;;OAMG;IACI,MAAM,CAAC,MAAM,CAAC,SAAkB,EAAE,OAAe;QACpD,IAAI,CAAC,SAAS,EAAE,CAAC;YACb,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;QAC7B,CAAC;IACL,CAAC;IAED;;;;;;;OAOG;IACI,MAAM,CAAO,KAAK,CAAC,QAAgB,EAAE,IAAc;;YACtD,MAAM,QAAQ,GAAG,MAAM,IAAA,oBAAK,EAAC,QAAQ,EAAE;gBACnC,MAAM,EAAE,MAAM;gBACd,IAAI,EAAE,IAAI;gBACV,OAAO,oBACA,IAAI,CAAC,UAAU,EAAE,CACvB;aACJ,CAAC,CAAC;YAEH,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;gBACf,MAAM,IAAI,KAAK,CAAC,GAAG,QAAQ,CAAC,MAAM,IAAI,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAC;YACjE,CAAC;YAED,OAAO,QAAQ,CAAC,MAAM,EAAE,CAAC;QAC7B,CAAC;KAAA;CACJ;AArCD,wCAqCC"}
|
package/dist/common/index.d.ts
CHANGED
package/dist/common/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":";;;AAAA,yCAAsC;AAA9B,sGAAA,SAAS,OAAA;AACjB,qDAAiD;AAAzC,iHAAA,cAAc,OAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/common/types.ts"],"names":[],"mappings":""}
|
package/dist/gotenberg.d.ts
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Class representing configuration for interacting with Gotenberg service.
|
|
3
|
+
*/
|
|
1
4
|
export declare class Gotenberg {
|
|
5
|
+
/**
|
|
6
|
+
* The Gotenberg service endpoint.
|
|
7
|
+
* Defaults to the value from the environment variable `GOTENBERG_ENDPOINT`, or falls back to the configuration file.
|
|
8
|
+
* @type {string}
|
|
9
|
+
*/
|
|
2
10
|
static endpoint: string;
|
|
3
11
|
}
|
package/dist/gotenberg.js
CHANGED
|
@@ -14,8 +14,16 @@ const dotenvConfig = dotenv.config({ path: path.resolve(envFile) });
|
|
|
14
14
|
if (dotenvConfig.error) {
|
|
15
15
|
dotenv.config({ path: path.resolve(envFileFallback) });
|
|
16
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* Class representing configuration for interacting with Gotenberg service.
|
|
19
|
+
*/
|
|
17
20
|
class Gotenberg {
|
|
18
21
|
}
|
|
19
22
|
exports.Gotenberg = Gotenberg;
|
|
23
|
+
/**
|
|
24
|
+
* The Gotenberg service endpoint.
|
|
25
|
+
* Defaults to the value from the environment variable `GOTENBERG_ENDPOINT`, or falls back to the configuration file.
|
|
26
|
+
* @type {string}
|
|
27
|
+
*/
|
|
20
28
|
Gotenberg.endpoint = process.env.GOTENBERG_ENDPOINT || config_1.default.get("gotenberg.endpoint");
|
|
21
29
|
//# sourceMappingURL=gotenberg.js.map
|
package/dist/gotenberg.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gotenberg.js","sourceRoot":"","sources":["../src/gotenberg.ts"],"names":[],"mappings":";;;;AAAA,OAAO,CAAC,GAAG,CAAC,0BAA0B,GAAG,GAAG,CAAC;AAE7C,uDAAiC;AACjC,mDAA6B;AAC7B,4DAA4B;AAE5B,wEAAwE;AACxE,MAAM,OAAO,GAAG,QAAQ,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;AAC/C,MAAM,eAAe,GAAG,MAAM,CAAC;AAE/B,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"gotenberg.js","sourceRoot":"","sources":["../src/gotenberg.ts"],"names":[],"mappings":";;;;AAAA,OAAO,CAAC,GAAG,CAAC,0BAA0B,GAAG,GAAG,CAAC;AAE7C,uDAAiC;AACjC,mDAA6B;AAC7B,4DAA4B;AAE5B,wEAAwE;AACxE,MAAM,OAAO,GAAG,QAAQ,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;AAC/C,MAAM,eAAe,GAAG,MAAM,CAAC;AAE/B,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,EAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,EAAC,CAAC,CAAC;AAElE,oDAAoD;AACpD,IAAI,YAAY,CAAC,KAAK,EAAE,CAAC;IACrB,MAAM,CAAC,MAAM,CAAC,EAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,EAAC,CAAC,CAAC;AACzD,CAAC;AAED;;GAEG;AACH,MAAa,SAAS;;AAAtB,8BAQC;AAPG;;;;GAIG;AACW,kBAAQ,GAClB,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,gBAAM,CAAC,GAAG,CAAS,oBAAoB,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/libre-office/index.ts"],"names":[],"mappings":";;;AACA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/libre-office/index.ts"],"names":[],"mappings":";;;AACA,iEAA4D;AAApD,sHAAA,gBAAgB,OAAA"}
|
|
@@ -2,81 +2,81 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.LIBRE_OFFICE_EXTENSIONS = void 0;
|
|
4
4
|
exports.LIBRE_OFFICE_EXTENSIONS = [
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"
|
|
5
|
+
"bib",
|
|
6
|
+
"doc",
|
|
7
|
+
"xml",
|
|
8
|
+
"docx",
|
|
9
|
+
"fodt",
|
|
10
|
+
"html",
|
|
11
|
+
"ltx",
|
|
12
|
+
"txt",
|
|
13
|
+
"odt",
|
|
14
|
+
"ott",
|
|
15
|
+
"pdb",
|
|
16
|
+
"pdf",
|
|
17
|
+
"psw",
|
|
18
|
+
"rtf",
|
|
19
|
+
"sdw",
|
|
20
|
+
"stw",
|
|
21
|
+
"sxw",
|
|
22
|
+
"uot",
|
|
23
|
+
"vor",
|
|
24
|
+
"wps",
|
|
25
|
+
"epub",
|
|
26
|
+
"png",
|
|
27
|
+
"bmp",
|
|
28
|
+
"emf",
|
|
29
|
+
"eps",
|
|
30
|
+
"fodg",
|
|
31
|
+
"gif",
|
|
32
|
+
"jpg",
|
|
33
|
+
"met",
|
|
34
|
+
"odd",
|
|
35
|
+
"otg",
|
|
36
|
+
"pbm",
|
|
37
|
+
"pct",
|
|
38
|
+
"pgm",
|
|
39
|
+
"ppm",
|
|
40
|
+
"ras",
|
|
41
|
+
"std",
|
|
42
|
+
"svg",
|
|
43
|
+
"svm",
|
|
44
|
+
"swf",
|
|
45
|
+
"sxd",
|
|
46
|
+
"sxw",
|
|
47
|
+
"tiff",
|
|
48
|
+
"xhtml",
|
|
49
|
+
"xpm",
|
|
50
|
+
"fodp",
|
|
51
|
+
"potm",
|
|
52
|
+
"pot",
|
|
53
|
+
"pptx",
|
|
54
|
+
"pps",
|
|
55
|
+
"ppt",
|
|
56
|
+
"pwp",
|
|
57
|
+
"sda",
|
|
58
|
+
"sdd",
|
|
59
|
+
"sti",
|
|
60
|
+
"sxi",
|
|
61
|
+
"uop",
|
|
62
|
+
"wmf",
|
|
63
|
+
"csv",
|
|
64
|
+
"dbf",
|
|
65
|
+
"dif",
|
|
66
|
+
"fods",
|
|
67
|
+
"ods",
|
|
68
|
+
"ots",
|
|
69
|
+
"pxl",
|
|
70
|
+
"sdc",
|
|
71
|
+
"slk",
|
|
72
|
+
"stc",
|
|
73
|
+
"sxc",
|
|
74
|
+
"uos",
|
|
75
|
+
"xls",
|
|
76
|
+
"xlt",
|
|
77
|
+
"xlsx",
|
|
78
|
+
"tif",
|
|
79
|
+
"jpeg",
|
|
80
|
+
"odp",
|
|
81
81
|
];
|
|
82
82
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/libre-office/utils/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,uBAAuB,GAAG;
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/libre-office/utils/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,uBAAuB,GAAG;IACnC,KAAK;IACL,KAAK;IACL,KAAK;IACL,MAAM;IACN,MAAM;IACN,MAAM;IACN,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,MAAM;IACN,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,MAAM;IACN,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,MAAM;IACN,OAAO;IACP,KAAK;IACL,MAAM;IACN,MAAM;IACN,KAAK;IACL,MAAM;IACN,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,MAAM;IACN,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,MAAM;IACN,KAAK;IACL,MAAM;IACN,KAAK;CACR,CAAC"}
|
|
@@ -1,8 +1,23 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { PathLike } from "fs";
|
|
3
1
|
import FormData from "form-data";
|
|
2
|
+
import { PathLikeOrReadStream } from "../../common";
|
|
4
3
|
import { PageProperties } from "../interfaces/libre-office.types";
|
|
4
|
+
/**
|
|
5
|
+
* Utility class for handling common tasks related to LibreOffice conversions.
|
|
6
|
+
*/
|
|
5
7
|
export declare class LibreOfficeUtils {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Adds files to the FormData object for LibreOffice conversion.
|
|
10
|
+
*
|
|
11
|
+
* @param {PathLikeOrReadStream[]} files - An array of files to be added to the FormData.
|
|
12
|
+
* @param {FormData} data - The FormData object to which files will be added.
|
|
13
|
+
* @throws {Error} Throws an error if the file extension is not supported.
|
|
14
|
+
*/
|
|
15
|
+
static addFiles(files: PathLikeOrReadStream[], data: FormData): Promise<void>;
|
|
16
|
+
/**
|
|
17
|
+
* Adds page properties to the FormData object based on the provided PageProperties.
|
|
18
|
+
*
|
|
19
|
+
* @param {FormData} data - The FormData object to which page properties will be added.
|
|
20
|
+
* @param {PageProperties} pageProperties - The page properties to be added to the FormData.
|
|
21
|
+
*/
|
|
22
|
+
static addPageProperties(data: FormData, pageProperties: PageProperties): void;
|
|
8
23
|
}
|
|
@@ -4,17 +4,43 @@ exports.LibreOfficeUtils = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const fs_1 = require("fs");
|
|
6
6
|
const path_1 = tslib_1.__importDefault(require("path"));
|
|
7
|
+
const file_type_1 = require("file-type");
|
|
7
8
|
const common_1 = require("../../common");
|
|
8
9
|
const constants_1 = require("./constants");
|
|
10
|
+
/**
|
|
11
|
+
* Utility class for handling common tasks related to LibreOffice conversions.
|
|
12
|
+
*/
|
|
9
13
|
class LibreOfficeUtils {
|
|
10
|
-
|
|
14
|
+
/**
|
|
15
|
+
* Adds files to the FormData object for LibreOffice conversion.
|
|
16
|
+
*
|
|
17
|
+
* @param {PathLikeOrReadStream[]} files - An array of files to be added to the FormData.
|
|
18
|
+
* @param {FormData} data - The FormData object to which files will be added.
|
|
19
|
+
* @throws {Error} Throws an error if the file extension is not supported.
|
|
20
|
+
*/
|
|
21
|
+
static addFiles(files, data) {
|
|
11
22
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
12
|
-
for (const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
23
|
+
for (const [key, value] of files.entries()) {
|
|
24
|
+
let file = value;
|
|
25
|
+
let fileInfo;
|
|
26
|
+
if (Buffer.isBuffer(value)) {
|
|
27
|
+
fileInfo = yield (0, file_type_1.fromBuffer)(value);
|
|
28
|
+
}
|
|
29
|
+
else if (value instanceof fs_1.ReadStream) {
|
|
30
|
+
fileInfo = yield (0, file_type_1.fromStream)(value);
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
yield fs_1.promises.access(value, fs_1.constants.R_OK);
|
|
34
|
+
const filename = path_1.default.basename(value.toString());
|
|
35
|
+
fileInfo = { ext: path_1.default.extname(filename).slice(1) };
|
|
36
|
+
file = (0, fs_1.createReadStream)(value);
|
|
37
|
+
}
|
|
38
|
+
if (!fileInfo) {
|
|
39
|
+
throw new Error("File type could not be determined");
|
|
40
|
+
}
|
|
41
|
+
const extension = fileInfo.ext;
|
|
16
42
|
if (constants_1.LIBRE_OFFICE_EXTENSIONS.includes(extension)) {
|
|
17
|
-
data.append(
|
|
43
|
+
data.append("files", file, `${key}.${extension}`);
|
|
18
44
|
}
|
|
19
45
|
else {
|
|
20
46
|
throw new Error(`${extension} is not supported`);
|
|
@@ -22,7 +48,13 @@ class LibreOfficeUtils {
|
|
|
22
48
|
}
|
|
23
49
|
});
|
|
24
50
|
}
|
|
25
|
-
|
|
51
|
+
/**
|
|
52
|
+
* Adds page properties to the FormData object based on the provided PageProperties.
|
|
53
|
+
*
|
|
54
|
+
* @param {FormData} data - The FormData object to which page properties will be added.
|
|
55
|
+
* @param {PageProperties} pageProperties - The page properties to be added to the FormData.
|
|
56
|
+
*/
|
|
57
|
+
static addPageProperties(data, pageProperties) {
|
|
26
58
|
if (pageProperties.landscape) {
|
|
27
59
|
data.append("landscape", String(pageProperties.landscape));
|
|
28
60
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"libre-office.utils.js","sourceRoot":"","sources":["../../../src/libre-office/utils/libre-office.utils.ts"],"names":[],"mappings":";;;;AAAA,2BAAqE;AACrE,wDAAwB;
|
|
1
|
+
{"version":3,"file":"libre-office.utils.js","sourceRoot":"","sources":["../../../src/libre-office/utils/libre-office.utils.ts"],"names":[],"mappings":";;;;AAAA,2BAAqE;AACrE,wDAAwB;AAExB,yCAAiD;AAIjD,yCAAkE;AAClE,2CAAoD;AAGpD;;GAEG;AACH,MAAa,gBAAgB;IACzB;;;;;;OAMG;IACI,MAAM,CAAO,QAAQ,CAAC,KAA6B,EAAE,IAAc;;YACtE,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC;gBACzC,IAAI,IAAI,GAAG,KAAK,CAAC;gBACjB,IAAI,QAAQ,CAAC;gBAEb,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;oBACzB,QAAQ,GAAG,MAAM,IA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