chromiumly 3.0.1 → 3.2.0
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 +43 -2
- package/dist/chromium/converters/html.converter.d.ts +4 -2
- package/dist/chromium/converters/html.converter.js +5 -3
- package/dist/chromium/converters/html.converter.js.map +1 -1
- package/dist/chromium/converters/markdown.converter.d.ts +4 -2
- package/dist/chromium/converters/markdown.converter.js +5 -3
- package/dist/chromium/converters/markdown.converter.js.map +1 -1
- package/dist/chromium/converters/url.converter.d.ts +4 -2
- package/dist/chromium/converters/url.converter.js +5 -3
- package/dist/chromium/converters/url.converter.js.map +1 -1
- package/dist/chromium/interfaces/converter.types.d.ts +10 -0
- package/dist/chromium/interfaces/screenshot.types.d.ts +3 -0
- package/dist/chromium/screenshots/html.screenshot.js +1 -1
- package/dist/chromium/screenshots/html.screenshot.js.map +1 -1
- package/dist/chromium/screenshots/markdown.screenshot.js +1 -1
- package/dist/chromium/screenshots/markdown.screenshot.js.map +1 -1
- package/dist/chromium/screenshots/url.screenshot.js +1 -1
- package/dist/chromium/screenshots/url.screenshot.js.map +1 -1
- package/dist/chromium/utils/converter.utils.js +3 -0
- package/dist/chromium/utils/converter.utils.js.map +1 -1
- package/dist/chromium/utils/screenshot.utils.js +9 -0
- package/dist/chromium/utils/screenshot.utils.js.map +1 -1
- package/dist/common/gotenberg.utils.d.ts +3 -1
- package/dist/common/gotenberg.utils.js +10 -2
- package/dist/common/gotenberg.utils.js.map +1 -1
- package/dist/gotenberg.d.ts +12 -3
- package/dist/gotenberg.js +28 -7
- package/dist/gotenberg.js.map +1 -1
- package/dist/libre-office/interfaces/libre-office.types.d.ts +1 -0
- package/dist/libre-office/libre-office.js +1 -1
- package/dist/libre-office/libre-office.js.map +1 -1
- package/dist/libre-office/utils/libre-office.utils.js +3 -0
- package/dist/libre-office/utils/libre-office.utils.js.map +1 -1
- package/dist/main.config.d.ts +10 -0
- package/dist/main.config.js +10 -0
- package/dist/main.config.js.map +1 -1
- package/dist/pdf-engines/pdf-engines.js +4 -4
- package/dist/pdf-engines/pdf-engines.js.map +1 -1
- package/package.json +6 -6
- package/src/chromium/converters/html.converter.ts +14 -5
- package/src/chromium/converters/markdown.converter.ts +14 -5
- package/src/chromium/converters/url.converter.ts +14 -5
- package/src/chromium/interfaces/converter.types.ts +11 -0
- package/src/chromium/interfaces/screenshot.types.ts +3 -0
- package/src/chromium/screenshots/html.screenshot.ts +7 -2
- package/src/chromium/screenshots/markdown.screenshot.ts +7 -2
- package/src/chromium/screenshots/url.screenshot.ts +7 -2
- package/src/chromium/utils/converter.utils.ts +4 -0
- package/src/chromium/utils/screenshot.utils.ts +12 -0
- package/src/chromium/utils/tests/converter.utils.test.ts +33 -0
- package/src/chromium/utils/tests/screenshot.utils.test.ts +56 -2
- package/src/common/gotenberg.utils.ts +15 -4
- package/src/common/tests/gotenberg.utils.test.ts +20 -3
- package/src/gotenberg.ts +29 -5
- package/src/libre-office/interfaces/libre-office.types.ts +1 -0
- package/src/libre-office/libre-office.ts +6 -1
- package/src/libre-office/utils/libre-office.utils.ts +7 -0
- package/src/libre-office/utils/tests/libre-office.utils.test.ts +15 -0
- package/src/main.config.ts +14 -0
- package/src/pdf-engines/pdf-engines.ts +24 -4
package/dist/main.config.d.ts
CHANGED
|
@@ -32,6 +32,16 @@ export declare class Chromiumly {
|
|
|
32
32
|
* @type {string}
|
|
33
33
|
*/
|
|
34
34
|
static readonly GOTENBERG_ENDPOINT: string;
|
|
35
|
+
/**
|
|
36
|
+
* The username for basic authentication with the Gotenberg service.
|
|
37
|
+
* @type {string | undefined}
|
|
38
|
+
*/
|
|
39
|
+
static readonly GOTENBERG_API_BASIC_AUTH_USERNAME: string | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* The password for basic authentication with the Gotenberg service.
|
|
42
|
+
* @type {string | undefined}
|
|
43
|
+
*/
|
|
44
|
+
static readonly GOTENBERG_API_BASIC_AUTH_PASSWORD: string | undefined;
|
|
35
45
|
/**
|
|
36
46
|
* The path for Chromium-related conversions.
|
|
37
47
|
* @type {string}
|
package/dist/main.config.js
CHANGED
|
@@ -41,6 +41,16 @@ exports.Chromiumly = Chromiumly;
|
|
|
41
41
|
* @type {string}
|
|
42
42
|
*/
|
|
43
43
|
Chromiumly.GOTENBERG_ENDPOINT = gotenberg_1.Gotenberg.endpoint;
|
|
44
|
+
/**
|
|
45
|
+
* The username for basic authentication with the Gotenberg service.
|
|
46
|
+
* @type {string | undefined}
|
|
47
|
+
*/
|
|
48
|
+
Chromiumly.GOTENBERG_API_BASIC_AUTH_USERNAME = gotenberg_1.Gotenberg.username;
|
|
49
|
+
/**
|
|
50
|
+
* The password for basic authentication with the Gotenberg service.
|
|
51
|
+
* @type {string | undefined}
|
|
52
|
+
*/
|
|
53
|
+
Chromiumly.GOTENBERG_API_BASIC_AUTH_PASSWORD = gotenberg_1.Gotenberg.password;
|
|
44
54
|
/**
|
|
45
55
|
* The path for Chromium-related conversions.
|
|
46
56
|
* @type {string}
|
package/dist/main.config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.config.js","sourceRoot":"","sources":["../src/main.config.ts"],"names":[],"mappings":";;;AAAA,2CAAwC;AAExC;;;GAGG;AACH,IAAY,aAIX;AAJD,WAAY,aAAa;IACrB,4BAAW,CAAA;IACX,8BAAa,CAAA;IACb,sCAAqB,CAAA;AACzB,CAAC,EAJW,aAAa,6BAAb,aAAa,QAIxB;AAED;;;GAGG;AACH,IAAK,cAIJ;AAJD,WAAK,cAAc;IACf,iCAAe,CAAA;IACf,iDAA+B,CAAA;IAC/B,mDAAiC,CAAA;AACrC,CAAC,EAJI,cAAc,KAAd,cAAc,QAIlB;AAED;;;GAGG;AACH,IAAK,gBAEJ;AAFD,WAAK,gBAAgB;IACjB,uCAAmB,CAAA;AACvB,CAAC,EAFI,gBAAgB,KAAhB,gBAAgB,QAEpB;AAED;;GAEG;AACH,MAAa,UAAU;;AAAvB,
|
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cAAc,CAAC,cAAc;CAC/C,CAAC;AAEF;;;GAGG;AACoB,8BAAmB,GAAG;IACzC,OAAO,EAAE,gBAAgB,CAAC,OAAO;CACpC,CAAC"}
|
|
@@ -29,7 +29,7 @@ class PDFEngines {
|
|
|
29
29
|
metadata
|
|
30
30
|
});
|
|
31
31
|
const endpoint = `${main_config_1.Chromiumly.GOTENBERG_ENDPOINT}/${main_config_1.Chromiumly.PDF_ENGINES_PATH}/${main_config_1.Chromiumly.PDF_ENGINE_ROUTES.merge}`;
|
|
32
|
-
return common_1.GotenbergUtils.fetch(endpoint, data);
|
|
32
|
+
return common_1.GotenbergUtils.fetch(endpoint, data, main_config_1.Chromiumly.GOTENBERG_API_BASIC_AUTH_USERNAME, main_config_1.Chromiumly.GOTENBERG_API_BASIC_AUTH_PASSWORD);
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
35
|
/**
|
|
@@ -50,7 +50,7 @@ class PDFEngines {
|
|
|
50
50
|
pdfUA
|
|
51
51
|
});
|
|
52
52
|
const endpoint = `${main_config_1.Chromiumly.GOTENBERG_ENDPOINT}/${main_config_1.Chromiumly.LIBRE_OFFICE_PATH}/${main_config_1.Chromiumly.LIBRE_OFFICE_ROUTES.convert}`;
|
|
53
|
-
return common_1.GotenbergUtils.fetch(endpoint, data);
|
|
53
|
+
return common_1.GotenbergUtils.fetch(endpoint, data, main_config_1.Chromiumly.GOTENBERG_API_BASIC_AUTH_USERNAME, main_config_1.Chromiumly.GOTENBERG_API_BASIC_AUTH_PASSWORD);
|
|
54
54
|
});
|
|
55
55
|
}
|
|
56
56
|
/**
|
|
@@ -64,7 +64,7 @@ class PDFEngines {
|
|
|
64
64
|
const data = new form_data_1.default();
|
|
65
65
|
yield pdf_engines_utils_1.PDFEnginesUtils.addFiles(files, data);
|
|
66
66
|
const endpoint = `${main_config_1.Chromiumly.GOTENBERG_ENDPOINT}/${main_config_1.Chromiumly.PDF_ENGINES_PATH}/${main_config_1.Chromiumly.PDF_ENGINE_ROUTES.readMetadata}`;
|
|
67
|
-
return common_1.GotenbergUtils.fetch(endpoint, data);
|
|
67
|
+
return common_1.GotenbergUtils.fetch(endpoint, data, main_config_1.Chromiumly.GOTENBERG_API_BASIC_AUTH_USERNAME, main_config_1.Chromiumly.GOTENBERG_API_BASIC_AUTH_PASSWORD);
|
|
68
68
|
});
|
|
69
69
|
}
|
|
70
70
|
/**
|
|
@@ -80,7 +80,7 @@ class PDFEngines {
|
|
|
80
80
|
data.append('metadata', JSON.stringify(metadata));
|
|
81
81
|
yield pdf_engines_utils_1.PDFEnginesUtils.addFiles(files, data);
|
|
82
82
|
const endpoint = `${main_config_1.Chromiumly.GOTENBERG_ENDPOINT}/${main_config_1.Chromiumly.PDF_ENGINES_PATH}/${main_config_1.Chromiumly.PDF_ENGINE_ROUTES.writeMetadata}`;
|
|
83
|
-
return common_1.GotenbergUtils.fetch(endpoint, data);
|
|
83
|
+
return common_1.GotenbergUtils.fetch(endpoint, data, main_config_1.Chromiumly.GOTENBERG_API_BASIC_AUTH_USERNAME, main_config_1.Chromiumly.GOTENBERG_API_BASIC_AUTH_PASSWORD);
|
|
84
84
|
});
|
|
85
85
|
}
|
|
86
86
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pdf-engines.js","sourceRoot":"","sources":["../../src/pdf-engines/pdf-engines.ts"],"names":[],"mappings":";;;;AAAA,2BAA8B;AAC9B,wDAAwB;AAExB,kEAAiC;AAEjC,gDAA4C;AAC5C,sCAKmB;AACnB,iEAA4D;AAE5D;;GAEG;AACH,MAAa,UAAU;IACnB;;;;;;OAMG;IACI,MAAM,CAAO,KAAK;qEAAC,EACtB,KAAK,EACL,IAAI,EACJ,KAAK,EACL,QAAQ,EAMX;YACG,MAAM,IAAI,GAAG,IAAI,mBAAQ,EAAE,CAAC;YAC5B,MAAM,mCAAe,CAAC,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;YAC5C,MAAM,mCAAe,CAAC,SAAS,CAAC,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AAC,iBAAiB,CAAC,aAAa,EAAE,CAAC;YAEjI,OAAO,uBAAc,CAAC,KAAK,CACvB,QAAQ,EACR,IAAI,EACJ,wBAAU,CAAC,iCAAiC,EAC5C,wBAAU,CAAC,iCAAiC,CAC/C,CAAC;QACN,CAAC;KAAA;IAED;;;;;;OAMG;IACI,MAAM,CAAO,QAAQ,CACxB,QAAgB,EAChB,MAAc;;YAEd,MAAM,aAAa,GAAG,cAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,eAAe,CAAC,CAAC;YACnE,MAAM,aAAQ,CAAC,KAAK,CAAC,cAAI,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;YACvE,MAAM,aAAQ,CAAC,SAAS,CAAC,cAAI,CAAC,OAAO,CAAC,aAAa,EAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,CAAC;QAC5E,CAAC;KAAA;CACJ;AA1ID,gCA0IC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "chromiumly",
|
|
3
|
-
"version": "3.0
|
|
3
|
+
"version": "3.2.0",
|
|
4
4
|
"description": "A lightweight Typescript library that interacts with Gotenberg's different modules to convert a variety of document formats to PDF files.",
|
|
5
5
|
"main": "dist/main.js",
|
|
6
6
|
"types": "dist/main.d.ts",
|
|
@@ -50,10 +50,10 @@
|
|
|
50
50
|
"@types/dotenv": "8.2.0",
|
|
51
51
|
"@types/form-data": "2.5.0",
|
|
52
52
|
"@types/jest": "29.5.12",
|
|
53
|
-
"@types/node": "20.12.
|
|
53
|
+
"@types/node": "20.12.7",
|
|
54
54
|
"@types/node-fetch": "2.6.11",
|
|
55
|
-
"@typescript-eslint/eslint-plugin": "7.
|
|
56
|
-
"@typescript-eslint/parser": "7.
|
|
55
|
+
"@typescript-eslint/eslint-plugin": "7.7.1",
|
|
56
|
+
"@typescript-eslint/parser": "7.7.1",
|
|
57
57
|
"commitizen": "4.3.0",
|
|
58
58
|
"eslint": "8.57.0",
|
|
59
59
|
"eslint-config-prettier": "^9.1.0",
|
|
@@ -63,11 +63,11 @@
|
|
|
63
63
|
"jest-junit": "16.0.0",
|
|
64
64
|
"lint-staged": "^15.2.2",
|
|
65
65
|
"prettier": "3.2.5",
|
|
66
|
-
"release-it": "17.
|
|
66
|
+
"release-it": "17.2.1",
|
|
67
67
|
"ts-jest": "29.1.2",
|
|
68
68
|
"ts-node": "10.9.2",
|
|
69
69
|
"tslib": "2.6.2",
|
|
70
|
-
"typescript": "5.4.
|
|
70
|
+
"typescript": "5.4.5"
|
|
71
71
|
},
|
|
72
72
|
"dependencies": {
|
|
73
73
|
"config": "3.3.11",
|
|
@@ -6,10 +6,10 @@ import {
|
|
|
6
6
|
PathLikeOrReadStream,
|
|
7
7
|
PdfFormat
|
|
8
8
|
} from '../../common';
|
|
9
|
-
import { PageProperties } from '../interfaces/converter.types';
|
|
9
|
+
import { Cookie, PageProperties } from '../interfaces/converter.types';
|
|
10
10
|
import { ConverterUtils } from '../utils/converter.utils';
|
|
11
11
|
import { Converter } from './converter';
|
|
12
|
-
import { ChromiumRoute } from '../../main.config';
|
|
12
|
+
import { ChromiumRoute, Chromiumly } from '../../main.config';
|
|
13
13
|
import { EmulatedMediaType } from '../interfaces/common.types';
|
|
14
14
|
|
|
15
15
|
/**
|
|
@@ -46,6 +46,7 @@ export class HtmlConverter extends Converter {
|
|
|
46
46
|
* @param {boolean} [options.failOnConsoleExceptions] - Whether to fail on console exceptions during conversion.
|
|
47
47
|
* @param {boolean} [options.skipNetworkIdleEvent] - Whether to skip network idle event.
|
|
48
48
|
* @param {Metadata} options.metadata - Metadata to be written.
|
|
49
|
+
* @param {Cookie[]} options.cookies - Cookies to be written.
|
|
49
50
|
* @returns {Promise<Buffer>} A Promise resolving to the converted PDF content as a Buffer.
|
|
50
51
|
*/
|
|
51
52
|
async convert({
|
|
@@ -64,7 +65,8 @@ export class HtmlConverter extends Converter {
|
|
|
64
65
|
failOnHttpStatusCodes,
|
|
65
66
|
failOnConsoleExceptions,
|
|
66
67
|
skipNetworkIdleEvent,
|
|
67
|
-
metadata
|
|
68
|
+
metadata,
|
|
69
|
+
cookies
|
|
68
70
|
}: {
|
|
69
71
|
html: PathLikeOrReadStream;
|
|
70
72
|
assets?: { file: PathLikeOrReadStream; name: string }[];
|
|
@@ -90,6 +92,7 @@ export class HtmlConverter extends Converter {
|
|
|
90
92
|
failOnConsoleExceptions?: boolean;
|
|
91
93
|
skipNetworkIdleEvent?: boolean;
|
|
92
94
|
metadata?: Metadata;
|
|
95
|
+
cookies?: Cookie[];
|
|
93
96
|
}): Promise<Buffer> {
|
|
94
97
|
const data = new FormData();
|
|
95
98
|
|
|
@@ -117,9 +120,15 @@ export class HtmlConverter extends Converter {
|
|
|
117
120
|
failOnHttpStatusCodes,
|
|
118
121
|
failOnConsoleExceptions,
|
|
119
122
|
skipNetworkIdleEvent,
|
|
120
|
-
metadata
|
|
123
|
+
metadata,
|
|
124
|
+
cookies
|
|
121
125
|
});
|
|
122
126
|
|
|
123
|
-
return GotenbergUtils.fetch(
|
|
127
|
+
return GotenbergUtils.fetch(
|
|
128
|
+
this.endpoint,
|
|
129
|
+
data,
|
|
130
|
+
Chromiumly.GOTENBERG_API_BASIC_AUTH_USERNAME,
|
|
131
|
+
Chromiumly.GOTENBERG_API_BASIC_AUTH_PASSWORD
|
|
132
|
+
);
|
|
124
133
|
}
|
|
125
134
|
}
|
|
@@ -6,10 +6,10 @@ import {
|
|
|
6
6
|
PathLikeOrReadStream,
|
|
7
7
|
Metadata
|
|
8
8
|
} from '../../common';
|
|
9
|
-
import { PageProperties } from '../interfaces/converter.types';
|
|
9
|
+
import { Cookie, PageProperties } from '../interfaces/converter.types';
|
|
10
10
|
import { ConverterUtils } from '../utils/converter.utils';
|
|
11
11
|
import { Converter } from './converter';
|
|
12
|
-
import { ChromiumRoute } from '../../main.config';
|
|
12
|
+
import { ChromiumRoute, Chromiumly } from '../../main.config';
|
|
13
13
|
import { EmulatedMediaType } from '../interfaces/common.types';
|
|
14
14
|
|
|
15
15
|
/**
|
|
@@ -47,6 +47,7 @@ export class MarkdownConverter extends Converter {
|
|
|
47
47
|
* @param {boolean} [options.failOnConsoleExceptions] - Whether to fail on console exceptions during conversion.
|
|
48
48
|
* @param {boolean} [options.skipNetworkIdleEvent] - Whether to skip network idle event.
|
|
49
49
|
* @param {Metadata} options.metadata - Metadata to be written.
|
|
50
|
+
* @param {Cookie[]} options.cookies - Cookies to be written.
|
|
50
51
|
* @returns {Promise<Buffer>} A Promise resolving to the converted PDF content as a Buffer.
|
|
51
52
|
*/
|
|
52
53
|
async convert({
|
|
@@ -65,7 +66,8 @@ export class MarkdownConverter extends Converter {
|
|
|
65
66
|
failOnHttpStatusCodes,
|
|
66
67
|
failOnConsoleExceptions,
|
|
67
68
|
skipNetworkIdleEvent,
|
|
68
|
-
metadata
|
|
69
|
+
metadata,
|
|
70
|
+
cookies
|
|
69
71
|
}: {
|
|
70
72
|
html: PathLikeOrReadStream;
|
|
71
73
|
markdown: PathLikeOrReadStream;
|
|
@@ -91,6 +93,7 @@ export class MarkdownConverter extends Converter {
|
|
|
91
93
|
failOnConsoleExceptions?: boolean;
|
|
92
94
|
skipNetworkIdleEvent?: boolean;
|
|
93
95
|
metadata?: Metadata;
|
|
96
|
+
cookies?: Cookie[];
|
|
94
97
|
}): Promise<Buffer> {
|
|
95
98
|
const data = new FormData();
|
|
96
99
|
|
|
@@ -112,9 +115,15 @@ export class MarkdownConverter extends Converter {
|
|
|
112
115
|
failOnHttpStatusCodes,
|
|
113
116
|
failOnConsoleExceptions,
|
|
114
117
|
skipNetworkIdleEvent,
|
|
115
|
-
metadata
|
|
118
|
+
metadata,
|
|
119
|
+
cookies
|
|
116
120
|
});
|
|
117
121
|
|
|
118
|
-
return GotenbergUtils.fetch(
|
|
122
|
+
return GotenbergUtils.fetch(
|
|
123
|
+
this.endpoint,
|
|
124
|
+
data,
|
|
125
|
+
Chromiumly.GOTENBERG_API_BASIC_AUTH_USERNAME,
|
|
126
|
+
Chromiumly.GOTENBERG_API_BASIC_AUTH_PASSWORD
|
|
127
|
+
);
|
|
119
128
|
}
|
|
120
129
|
}
|
|
@@ -6,10 +6,10 @@ import {
|
|
|
6
6
|
PathLikeOrReadStream,
|
|
7
7
|
Metadata
|
|
8
8
|
} from '../../common';
|
|
9
|
-
import { PageProperties } from '../interfaces/converter.types';
|
|
9
|
+
import { Cookie, PageProperties } from '../interfaces/converter.types';
|
|
10
10
|
import { ConverterUtils } from '../utils/converter.utils';
|
|
11
11
|
import { Converter } from './converter';
|
|
12
|
-
import { ChromiumRoute } from '../../main.config';
|
|
12
|
+
import { ChromiumRoute, Chromiumly } from '../../main.config';
|
|
13
13
|
import { EmulatedMediaType } from '../interfaces/common.types';
|
|
14
14
|
|
|
15
15
|
/**
|
|
@@ -46,6 +46,7 @@ export class UrlConverter extends Converter {
|
|
|
46
46
|
* @param {boolean} [options.failOnConsoleExceptions] - Whether to fail on console exceptions during conversion.
|
|
47
47
|
* @param {boolean} [options.skipNetworkIdleEvent] - Whether to skip network idle event.
|
|
48
48
|
* @param {Metadata} options.metadata - Metadata to be written.
|
|
49
|
+
* @param {Cookie[]} options.cookies - Cookies to be written.
|
|
49
50
|
* @returns {Promise<Buffer>} A Promise resolving to the converted PDF content as a Buffer.
|
|
50
51
|
*/
|
|
51
52
|
async convert({
|
|
@@ -63,7 +64,8 @@ export class UrlConverter extends Converter {
|
|
|
63
64
|
failOnHttpStatusCodes,
|
|
64
65
|
failOnConsoleExceptions,
|
|
65
66
|
skipNetworkIdleEvent,
|
|
66
|
-
metadata
|
|
67
|
+
metadata,
|
|
68
|
+
cookies
|
|
67
69
|
}: {
|
|
68
70
|
url: string;
|
|
69
71
|
header?: PathLikeOrReadStream;
|
|
@@ -88,6 +90,7 @@ export class UrlConverter extends Converter {
|
|
|
88
90
|
failOnConsoleExceptions?: boolean;
|
|
89
91
|
skipNetworkIdleEvent?: boolean;
|
|
90
92
|
metadata?: Metadata;
|
|
93
|
+
cookies?: Cookie[];
|
|
91
94
|
}): Promise<Buffer> {
|
|
92
95
|
const _url = new URL(url);
|
|
93
96
|
const data = new FormData();
|
|
@@ -108,9 +111,15 @@ export class UrlConverter extends Converter {
|
|
|
108
111
|
failOnHttpStatusCodes,
|
|
109
112
|
failOnConsoleExceptions,
|
|
110
113
|
skipNetworkIdleEvent,
|
|
111
|
-
metadata
|
|
114
|
+
metadata,
|
|
115
|
+
cookies
|
|
112
116
|
});
|
|
113
117
|
|
|
114
|
-
return GotenbergUtils.fetch(
|
|
118
|
+
return GotenbergUtils.fetch(
|
|
119
|
+
this.endpoint,
|
|
120
|
+
data,
|
|
121
|
+
Chromiumly.GOTENBERG_API_BASIC_AUTH_USERNAME,
|
|
122
|
+
Chromiumly.GOTENBERG_API_BASIC_AUTH_PASSWORD
|
|
123
|
+
);
|
|
115
124
|
}
|
|
116
125
|
}
|
|
@@ -25,10 +25,21 @@ export type PageProperties = {
|
|
|
25
25
|
nativePageRanges?: { from: number; to: number }; // Page ranges to print
|
|
26
26
|
};
|
|
27
27
|
|
|
28
|
+
export type Cookie = {
|
|
29
|
+
name: string;
|
|
30
|
+
value: string;
|
|
31
|
+
domain: string;
|
|
32
|
+
path?: string;
|
|
33
|
+
secure?: boolean;
|
|
34
|
+
httpOnly?: boolean;
|
|
35
|
+
sameSite?: 'Strict' | 'Lax' | 'None';
|
|
36
|
+
};
|
|
37
|
+
|
|
28
38
|
export type ConversionOptions = ChromiumOptions & {
|
|
29
39
|
properties?: PageProperties;
|
|
30
40
|
pdfFormat?: PdfFormat;
|
|
31
41
|
pdfUA?: boolean; // Enable PDF for Universal Access for optimal accessibility (default false)
|
|
32
42
|
userAgent?: string;
|
|
33
43
|
metadata?: Metadata;
|
|
44
|
+
cookies?: Cookie[];
|
|
34
45
|
};
|
|
@@ -4,6 +4,9 @@ export type ImageProperties = {
|
|
|
4
4
|
format: 'png' | 'jpeg' | 'webp'; //The image compression format, either "png", "jpeg" or "webp".
|
|
5
5
|
quality?: number; // The compression quality from range 0 to 100 (jpeg only).
|
|
6
6
|
omitBackground?: boolean; // Hide the default white background and allow generating screenshots with transparency.
|
|
7
|
+
width?: number; // The device screen width in pixels (default 800).
|
|
8
|
+
height?: number; // The device screen height in pixels (default 600).
|
|
9
|
+
clip?: boolean; // Define whether to clip the screenshot according to the device dimensions (default false).
|
|
7
10
|
};
|
|
8
11
|
|
|
9
12
|
export type ScreenshotOptions = ChromiumOptions & {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import FormData from 'form-data';
|
|
2
2
|
|
|
3
3
|
import { GotenbergUtils, PathLikeOrReadStream } from '../../common';
|
|
4
|
-
import { ChromiumRoute } from '../../main.config';
|
|
4
|
+
import { ChromiumRoute, Chromiumly } from '../../main.config';
|
|
5
5
|
import { EmulatedMediaType } from '../interfaces/common.types';
|
|
6
6
|
import { ScreenshotUtils } from '../utils/screenshot.utils';
|
|
7
7
|
import { Screenshot } from './screenshot';
|
|
@@ -95,6 +95,11 @@ export class HtmlScreenshot extends Screenshot {
|
|
|
95
95
|
optimizeForSpeed
|
|
96
96
|
});
|
|
97
97
|
|
|
98
|
-
return GotenbergUtils.fetch(
|
|
98
|
+
return GotenbergUtils.fetch(
|
|
99
|
+
this.endpoint,
|
|
100
|
+
data,
|
|
101
|
+
Chromiumly.GOTENBERG_API_BASIC_AUTH_USERNAME,
|
|
102
|
+
Chromiumly.GOTENBERG_API_BASIC_AUTH_PASSWORD
|
|
103
|
+
);
|
|
99
104
|
}
|
|
100
105
|
}
|
|
@@ -4,7 +4,7 @@ import { GotenbergUtils, PathLikeOrReadStream } from '../../common';
|
|
|
4
4
|
import { ImageProperties } from '../interfaces/screenshot.types';
|
|
5
5
|
import { ScreenshotUtils } from '../utils/screenshot.utils';
|
|
6
6
|
import { Screenshot } from './screenshot';
|
|
7
|
-
import { ChromiumRoute } from '../../main.config';
|
|
7
|
+
import { ChromiumRoute, Chromiumly } from '../../main.config';
|
|
8
8
|
import { EmulatedMediaType } from '../interfaces/common.types';
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -90,6 +90,11 @@ export class MarkdownScreenshot extends Screenshot {
|
|
|
90
90
|
optimizeForSpeed
|
|
91
91
|
});
|
|
92
92
|
|
|
93
|
-
return GotenbergUtils.fetch(
|
|
93
|
+
return GotenbergUtils.fetch(
|
|
94
|
+
this.endpoint,
|
|
95
|
+
data,
|
|
96
|
+
Chromiumly.GOTENBERG_API_BASIC_AUTH_USERNAME,
|
|
97
|
+
Chromiumly.GOTENBERG_API_BASIC_AUTH_PASSWORD
|
|
98
|
+
);
|
|
94
99
|
}
|
|
95
100
|
}
|
|
@@ -4,7 +4,7 @@ import { GotenbergUtils, PathLikeOrReadStream } from '../../common';
|
|
|
4
4
|
import { ImageProperties } from '../interfaces/screenshot.types';
|
|
5
5
|
import { ScreenshotUtils } from '../utils/screenshot.utils';
|
|
6
6
|
import { Screenshot } from './screenshot';
|
|
7
|
-
import { ChromiumRoute } from '../../main.config';
|
|
7
|
+
import { ChromiumRoute, Chromiumly } from '../../main.config';
|
|
8
8
|
import { EmulatedMediaType } from '../interfaces/common.types';
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -86,6 +86,11 @@ export class UrlScreenshot extends Screenshot {
|
|
|
86
86
|
optimizeForSpeed
|
|
87
87
|
});
|
|
88
88
|
|
|
89
|
-
return GotenbergUtils.fetch(
|
|
89
|
+
return GotenbergUtils.fetch(
|
|
90
|
+
this.endpoint,
|
|
91
|
+
data,
|
|
92
|
+
Chromiumly.GOTENBERG_API_BASIC_AUTH_USERNAME,
|
|
93
|
+
Chromiumly.GOTENBERG_API_BASIC_AUTH_PASSWORD
|
|
94
|
+
);
|
|
90
95
|
}
|
|
91
96
|
}
|
|
@@ -41,6 +41,18 @@ export class ScreenshotUtils {
|
|
|
41
41
|
String(imageProperties.omitBackground)
|
|
42
42
|
);
|
|
43
43
|
}
|
|
44
|
+
|
|
45
|
+
if (imageProperties.width) {
|
|
46
|
+
data.append('width', imageProperties.width);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (imageProperties.height) {
|
|
50
|
+
data.append('height', imageProperties.height);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (imageProperties.clip) {
|
|
54
|
+
data.append('clip', String(imageProperties.clip));
|
|
55
|
+
}
|
|
44
56
|
}
|
|
45
57
|
|
|
46
58
|
/**
|
|
@@ -364,6 +364,39 @@ describe('GotenbergUtils', () => {
|
|
|
364
364
|
});
|
|
365
365
|
});
|
|
366
366
|
|
|
367
|
+
describe('when cookies parameter is passed', () => {
|
|
368
|
+
it('should append cookies', async () => {
|
|
369
|
+
await ConverterUtils.customize(data, {
|
|
370
|
+
cookies: [
|
|
371
|
+
{
|
|
372
|
+
name: 'sample_id',
|
|
373
|
+
value: 'sample_value',
|
|
374
|
+
domain: 'example.com',
|
|
375
|
+
path: '/',
|
|
376
|
+
secure: true,
|
|
377
|
+
httpOnly: true,
|
|
378
|
+
sameSite: 'Strict'
|
|
379
|
+
}
|
|
380
|
+
]
|
|
381
|
+
});
|
|
382
|
+
expect(mockFormDataAppend).toHaveBeenCalledTimes(1);
|
|
383
|
+
expect(data.append).toHaveBeenCalledWith(
|
|
384
|
+
'cookies',
|
|
385
|
+
JSON.stringify([
|
|
386
|
+
{
|
|
387
|
+
name: 'sample_id',
|
|
388
|
+
value: 'sample_value',
|
|
389
|
+
domain: 'example.com',
|
|
390
|
+
path: '/',
|
|
391
|
+
secure: true,
|
|
392
|
+
httpOnly: true,
|
|
393
|
+
sameSite: 'Strict'
|
|
394
|
+
}
|
|
395
|
+
])
|
|
396
|
+
);
|
|
397
|
+
});
|
|
398
|
+
});
|
|
399
|
+
|
|
367
400
|
describe('when all options are passed', () => {
|
|
368
401
|
it('should append all options', async () => {
|
|
369
402
|
await ConverterUtils.customize(data, {
|
|
@@ -42,8 +42,8 @@ describe('GotenbergUtils', () => {
|
|
|
42
42
|
});
|
|
43
43
|
|
|
44
44
|
describe('Image quality', () => {
|
|
45
|
-
describe('when
|
|
46
|
-
it('should append
|
|
45
|
+
describe('when quality parameter is set', () => {
|
|
46
|
+
it('should append quality to data', () => {
|
|
47
47
|
ScreenshotUtils.addImageProperties(data, {
|
|
48
48
|
format: 'jpeg',
|
|
49
49
|
quality: 50
|
|
@@ -58,6 +58,60 @@ describe('GotenbergUtils', () => {
|
|
|
58
58
|
});
|
|
59
59
|
});
|
|
60
60
|
});
|
|
61
|
+
|
|
62
|
+
describe('Image width', () => {
|
|
63
|
+
describe('when width parameter is set', () => {
|
|
64
|
+
it('should append width to data', () => {
|
|
65
|
+
ScreenshotUtils.addImageProperties(data, {
|
|
66
|
+
format: 'jpeg',
|
|
67
|
+
width: 800
|
|
68
|
+
});
|
|
69
|
+
expect(mockFormDataAppend).toHaveBeenCalledTimes(2);
|
|
70
|
+
expect(data.append).toHaveBeenCalledWith('format', 'jpeg');
|
|
71
|
+
expect(data.append).toHaveBeenNthCalledWith(
|
|
72
|
+
2,
|
|
73
|
+
'width',
|
|
74
|
+
800
|
|
75
|
+
);
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
describe('Image height', () => {
|
|
81
|
+
describe('when height parameter is set', () => {
|
|
82
|
+
it('should append height to data', () => {
|
|
83
|
+
ScreenshotUtils.addImageProperties(data, {
|
|
84
|
+
format: 'jpeg',
|
|
85
|
+
height: 600
|
|
86
|
+
});
|
|
87
|
+
expect(mockFormDataAppend).toHaveBeenCalledTimes(2);
|
|
88
|
+
expect(data.append).toHaveBeenCalledWith('format', 'jpeg');
|
|
89
|
+
expect(data.append).toHaveBeenNthCalledWith(
|
|
90
|
+
2,
|
|
91
|
+
'height',
|
|
92
|
+
600
|
|
93
|
+
);
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
describe('Image clip', () => {
|
|
99
|
+
describe('when clip parameter is set', () => {
|
|
100
|
+
it('should append clip to data', () => {
|
|
101
|
+
ScreenshotUtils.addImageProperties(data, {
|
|
102
|
+
format: 'png',
|
|
103
|
+
clip: true
|
|
104
|
+
});
|
|
105
|
+
expect(mockFormDataAppend).toHaveBeenCalledTimes(2);
|
|
106
|
+
expect(data.append).toHaveBeenCalledWith('format', 'png');
|
|
107
|
+
expect(data.append).toHaveBeenNthCalledWith(
|
|
108
|
+
2,
|
|
109
|
+
'clip',
|
|
110
|
+
'true'
|
|
111
|
+
);
|
|
112
|
+
});
|
|
113
|
+
});
|
|
114
|
+
});
|
|
61
115
|
});
|
|
62
116
|
|
|
63
117
|
describe('customize', () => {
|
|
@@ -27,20 +27,31 @@ export class GotenbergUtils {
|
|
|
27
27
|
* Performs a POST request to the specified Gotenberg endpoint with the provided FormData.
|
|
28
28
|
*
|
|
29
29
|
* @param {string} endpoint - The Gotenberg endpoint URL.
|
|
30
|
+
* @param {string} username - The username for basic authentication.
|
|
31
|
+
* @param {string} password - The password for basic authentication.
|
|
30
32
|
* @param {FormData} data - The FormData object to be sent in the POST request.
|
|
31
33
|
* @returns {Promise<Buffer>} A Promise that resolves to the response body as a Buffer.
|
|
32
34
|
* @throws {Error} Throws an error if the HTTP response status is not OK.
|
|
33
35
|
*/
|
|
34
36
|
public static async fetch(
|
|
35
37
|
endpoint: string,
|
|
36
|
-
data: FormData
|
|
38
|
+
data: FormData,
|
|
39
|
+
username?: string,
|
|
40
|
+
password?: string
|
|
37
41
|
): Promise<Buffer> {
|
|
42
|
+
const headers: Record<string, string> = { ...data.getHeaders() };
|
|
43
|
+
|
|
44
|
+
if (username && password) {
|
|
45
|
+
const authHeader =
|
|
46
|
+
'Basic ' +
|
|
47
|
+
Buffer.from(username + ':' + password).toString('base64');
|
|
48
|
+
headers['Authorization'] = authHeader;
|
|
49
|
+
}
|
|
50
|
+
|
|
38
51
|
const response = await fetch(endpoint, {
|
|
39
52
|
method: 'post',
|
|
40
53
|
body: data,
|
|
41
|
-
headers
|
|
42
|
-
...data.getHeaders()
|
|
43
|
-
}
|
|
54
|
+
headers
|
|
44
55
|
});
|
|
45
56
|
|
|
46
57
|
if (!response.ok) {
|
|
@@ -39,11 +39,18 @@ describe('GotenbergUtils', () => {
|
|
|
39
39
|
const mockFetch = fetch as jest.MockedFunction<typeof fetch>;
|
|
40
40
|
const data = new FormData();
|
|
41
41
|
const endpoint = 'http://localhost:3000/forms/chromium/convert/html';
|
|
42
|
+
const basicAuthUsername = 'username';
|
|
43
|
+
const basicAuthPassword = 'pass';
|
|
42
44
|
|
|
43
45
|
describe('when fetch request succeeds', () => {
|
|
44
46
|
it('should return a buffer', async () => {
|
|
45
47
|
mockFetch.mockResolvedValueOnce(new Response('content'));
|
|
46
|
-
const response = await GotenbergUtils.fetch(
|
|
48
|
+
const response = await GotenbergUtils.fetch(
|
|
49
|
+
endpoint,
|
|
50
|
+
data,
|
|
51
|
+
basicAuthUsername,
|
|
52
|
+
basicAuthPassword
|
|
53
|
+
);
|
|
47
54
|
await expect(response).toEqual(Buffer.from('content'));
|
|
48
55
|
});
|
|
49
56
|
});
|
|
@@ -57,7 +64,12 @@ describe('GotenbergUtils', () => {
|
|
|
57
64
|
new FetchError(errorMessage)
|
|
58
65
|
);
|
|
59
66
|
await expect(() =>
|
|
60
|
-
GotenbergUtils.fetch(
|
|
67
|
+
GotenbergUtils.fetch(
|
|
68
|
+
endpoint,
|
|
69
|
+
data,
|
|
70
|
+
basicAuthUsername,
|
|
71
|
+
basicAuthPassword
|
|
72
|
+
)
|
|
61
73
|
).rejects.toThrow(errorMessage);
|
|
62
74
|
});
|
|
63
75
|
});
|
|
@@ -74,7 +86,12 @@ describe('GotenbergUtils', () => {
|
|
|
74
86
|
)
|
|
75
87
|
);
|
|
76
88
|
await expect(() =>
|
|
77
|
-
GotenbergUtils.fetch(
|
|
89
|
+
GotenbergUtils.fetch(
|
|
90
|
+
endpoint,
|
|
91
|
+
data,
|
|
92
|
+
basicAuthUsername,
|
|
93
|
+
basicAuthPassword
|
|
94
|
+
)
|
|
78
95
|
).rejects.toThrow('500 Internal server error');
|
|
79
96
|
});
|
|
80
97
|
});
|