chromiumly 4.2.3 → 4.3.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 +47 -6
- package/dist/chromium/converters/html.converter.d.ts +2 -1
- package/dist/chromium/converters/html.converter.js +3 -1
- package/dist/chromium/converters/html.converter.js.map +1 -1
- package/dist/chromium/converters/markdown.converter.d.ts +2 -1
- package/dist/chromium/converters/markdown.converter.js +3 -1
- package/dist/chromium/converters/markdown.converter.js.map +1 -1
- package/dist/chromium/converters/url.converter.d.ts +2 -1
- package/dist/chromium/converters/url.converter.js +3 -1
- package/dist/chromium/converters/url.converter.js.map +1 -1
- package/dist/chromium/interfaces/common.types.d.ts +5 -0
- package/dist/chromium/interfaces/converter.types.d.ts +6 -6
- package/dist/chromium/screenshots/html.screenshot.d.ts +2 -1
- package/dist/chromium/screenshots/html.screenshot.js +3 -1
- package/dist/chromium/screenshots/html.screenshot.js.map +1 -1
- package/dist/chromium/screenshots/markdown.screenshot.d.ts +2 -1
- package/dist/chromium/screenshots/markdown.screenshot.js +3 -1
- package/dist/chromium/screenshots/markdown.screenshot.js.map +1 -1
- package/dist/chromium/screenshots/url.screenshot.d.ts +2 -1
- package/dist/chromium/screenshots/url.screenshot.js +3 -1
- package/dist/chromium/screenshots/url.screenshot.js.map +1 -1
- package/dist/chromium/utils/converter.utils.d.ts +7 -0
- package/dist/chromium/utils/converter.utils.js +58 -12
- package/dist/chromium/utils/converter.utils.js.map +1 -1
- package/dist/chromium/utils/screenshot.utils.js +3 -0
- package/dist/chromium/utils/screenshot.utils.js.map +1 -1
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -250,14 +250,14 @@ file will look like.
|
|
|
250
250
|
type PageProperties = {
|
|
251
251
|
singlePage?: boolean; // Print the entire content in one single page (default false)
|
|
252
252
|
size?: {
|
|
253
|
-
width: number; // Paper width
|
|
254
|
-
height: number; //Paper height
|
|
253
|
+
width: number | string; // Paper width (number in inches or string with units: 72pt, 96px, 1in, 25.4mm, 2.54cm, 6pc, default 8.5)
|
|
254
|
+
height: number | string; // Paper height (number in inches or string with units: 72pt, 96px, 1in, 25.4mm, 2.54cm, 6pc, default 11)
|
|
255
255
|
};
|
|
256
256
|
margins?: {
|
|
257
|
-
top: number; // Top margin
|
|
258
|
-
bottom: number; // Bottom margin
|
|
259
|
-
left: number; // Left margin
|
|
260
|
-
right: number; // Right margin
|
|
257
|
+
top: number | string; // Top margin (number in inches or string with units: 72pt, 96px, 1in, 25.4mm, 2.54cm, 6pc, default 0.39)
|
|
258
|
+
bottom: number | string; // Bottom margin (number in inches or string with units: 72pt, 96px, 1in, 25.4mm, 2.54cm, 6pc, default 0.39)
|
|
259
|
+
left: number | string; // Left margin (number in inches or string with units: 72pt, 96px, 1in, 25.4mm, 2.54cm, 6pc, default 0.39)
|
|
260
|
+
right: number | string; // Right margin (number in inches or string with units: 72pt, 96px, 1in, 25.4mm, 2.54cm, 6pc, default 0.39)
|
|
261
261
|
};
|
|
262
262
|
preferCssPageSize?: boolean; // Define whether to prefer page size as defined by CSS (default false)
|
|
263
263
|
printBackground?: boolean; // Print the background graphics (default false)
|
|
@@ -268,6 +268,41 @@ type PageProperties = {
|
|
|
268
268
|
};
|
|
269
269
|
```
|
|
270
270
|
|
|
271
|
+
**Page Size and Margins Units**
|
|
272
|
+
|
|
273
|
+
Both `size` and `margins` properties support two formats:
|
|
274
|
+
|
|
275
|
+
1. **Numeric values** (in inches): For backward compatibility, you can continue using numbers which represent inches.
|
|
276
|
+
2. **String values with units**: You can now specify explicit units using the following formats:
|
|
277
|
+
- `pt` (points): e.g., `"72pt"`
|
|
278
|
+
- `px` (pixels): e.g., `"96px"`
|
|
279
|
+
- `in` (inches): e.g., `"1in"`
|
|
280
|
+
- `mm` (millimeters): e.g., `"25.4mm"`
|
|
281
|
+
- `cm` (centimeters): e.g., `"2.54cm"`
|
|
282
|
+
- `pc` (picas): e.g., `"6pc"`
|
|
283
|
+
|
|
284
|
+
**Examples:**
|
|
285
|
+
|
|
286
|
+
```typescript
|
|
287
|
+
// Using numeric values (inches)
|
|
288
|
+
properties: {
|
|
289
|
+
size: { width: 8.5, height: 11 },
|
|
290
|
+
margins: { top: 0.5, bottom: 0.5, left: 1, right: 1 }
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
// Using string values with units
|
|
294
|
+
properties: {
|
|
295
|
+
size: { width: "210mm", height: "297mm" }, // A4 size
|
|
296
|
+
margins: { top: "1cm", bottom: "1cm", left: "2cm", right: "2cm" }
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
// Mixing numeric and string values
|
|
300
|
+
properties: {
|
|
301
|
+
size: { width: 8.5, height: "11in" },
|
|
302
|
+
margins: { top: "10mm", bottom: 0.5, left: "72pt", right: 1 }
|
|
303
|
+
}
|
|
304
|
+
```
|
|
305
|
+
|
|
271
306
|
In addition to the `PageProperties` customization options, the `convert()` method also accepts a set of parameters to further enhance the versatility of the conversion process. Here's an overview of the full list of parameters:
|
|
272
307
|
|
|
273
308
|
```typescript
|
|
@@ -279,6 +314,7 @@ type ConversionOptions = {
|
|
|
279
314
|
header?: PathLikeOrReadStream; // Specify a custom header for the PDF
|
|
280
315
|
footer?: PathLikeOrReadStream; // Specify a custom footer for the PDF
|
|
281
316
|
emulatedMediaType?: EmulatedMediaType; // Specify the emulated media type for conversion
|
|
317
|
+
emulatedMediaFeatures?: EmulatedMediaFeature[]; // Override CSS media features (e.g., prefers-color-scheme). Default: None.
|
|
282
318
|
waitDelay?: string; // Duration (e.g., '5s') to wait when loading an HTML document before conversion
|
|
283
319
|
waitForExpression?: string; // JavaScript expression to wait before converting an HTML document into PDF
|
|
284
320
|
waitForSelector?: string; // CSS selector to wait for before converting an HTML document into PDF until it matches a node
|
|
@@ -322,6 +358,7 @@ type ScreenshotOptions = {
|
|
|
322
358
|
header?: PathLikeOrReadStream;
|
|
323
359
|
footer?: PathLikeOrReadStream;
|
|
324
360
|
emulatedMediaType?: EmulatedMediaType;
|
|
361
|
+
emulatedMediaFeatures?: EmulatedMediaFeature[]; // Override CSS media features (e.g., prefers-color-scheme). Default: None.
|
|
325
362
|
waitDelay?: string; // Duration (e.g, '5s') to wait when loading an HTML document before convertion.
|
|
326
363
|
waitForExpression?: string; // JavaScript's expression to wait before converting an HTML document into PDF until it returns true.
|
|
327
364
|
waitForSelector?: string; // CSS selector to wait for before converting an HTML document into PDF until it matches a node.
|
|
@@ -558,6 +595,10 @@ async function run() {
|
|
|
558
595
|
},
|
|
559
596
|
},
|
|
560
597
|
emulatedMediaType: "screen",
|
|
598
|
+
emulatedMediaFeatures: [
|
|
599
|
+
{ name: "prefers-color-scheme", value: "dark" },
|
|
600
|
+
{ name: "prefers-reduced-motion", value: "reduce" },
|
|
601
|
+
],
|
|
561
602
|
failOnHttpStatusCodes: [404],
|
|
562
603
|
failOnConsoleExceptions: true,
|
|
563
604
|
skipNetworkIdleEvent: false,
|
|
@@ -23,6 +23,7 @@ export declare class HtmlConverter extends Converter {
|
|
|
23
23
|
* @param {PdfFormat} [options.pdfFormat] - PDF format options.
|
|
24
24
|
* @param {boolean} [options.pdfUA] - Indicates whether to generate PDF/UA compliant output.
|
|
25
25
|
* @param {EmulatedMediaType} [options.emulatedMediaType] - Emulated media type for the conversion.
|
|
26
|
+
* @param {EmulatedMediaFeature[]} [options.emulatedMediaFeatures] - Override CSS media features (e.g. prefers-color-scheme).
|
|
26
27
|
* @param {string} [options.waitDelay] - Delay before the conversion process starts.
|
|
27
28
|
* @param {string} [options.waitForExpression] - JavaScript expression to wait for before completing the conversion.
|
|
28
29
|
* @param {string} [options.waitForSelector] - CSS selector to wait for before completing the conversion.
|
|
@@ -41,5 +42,5 @@ export declare class HtmlConverter extends Converter {
|
|
|
41
42
|
* @param {Split} [options.split] - Split the PDF into multiple files.
|
|
42
43
|
* @returns {Promise<Buffer>} A Promise resolving to the converted PDF content as a buffer
|
|
43
44
|
*/
|
|
44
|
-
convert({ html, assets, header, footer, properties, pdfFormat, pdfUA, emulatedMediaType, waitDelay, waitForExpression, waitForSelector, userAgent, extraHttpHeaders, failOnHttpStatusCodes, failOnConsoleExceptions, failOnResourceHttpStatusCodes, ignoreResourceHttpStatusDomains, failOnResourceLoadingFailed, skipNetworkIdleEvent, generateDocumentOutline, metadata, cookies, downloadFrom, split, userPassword, ownerPassword, embeds }: HtmlConversionOptions): Promise<Buffer>;
|
|
45
|
+
convert({ html, assets, header, footer, properties, pdfFormat, pdfUA, emulatedMediaType, emulatedMediaFeatures, waitDelay, waitForExpression, waitForSelector, userAgent, extraHttpHeaders, failOnHttpStatusCodes, failOnConsoleExceptions, failOnResourceHttpStatusCodes, ignoreResourceHttpStatusDomains, failOnResourceLoadingFailed, skipNetworkIdleEvent, generateDocumentOutline, metadata, cookies, downloadFrom, split, userPassword, ownerPassword, embeds }: HtmlConversionOptions): Promise<Buffer>;
|
|
45
46
|
}
|
|
@@ -30,6 +30,7 @@ class HtmlConverter extends converter_1.Converter {
|
|
|
30
30
|
* @param {PdfFormat} [options.pdfFormat] - PDF format options.
|
|
31
31
|
* @param {boolean} [options.pdfUA] - Indicates whether to generate PDF/UA compliant output.
|
|
32
32
|
* @param {EmulatedMediaType} [options.emulatedMediaType] - Emulated media type for the conversion.
|
|
33
|
+
* @param {EmulatedMediaFeature[]} [options.emulatedMediaFeatures] - Override CSS media features (e.g. prefers-color-scheme).
|
|
33
34
|
* @param {string} [options.waitDelay] - Delay before the conversion process starts.
|
|
34
35
|
* @param {string} [options.waitForExpression] - JavaScript expression to wait for before completing the conversion.
|
|
35
36
|
* @param {string} [options.waitForSelector] - CSS selector to wait for before completing the conversion.
|
|
@@ -48,7 +49,7 @@ class HtmlConverter extends converter_1.Converter {
|
|
|
48
49
|
* @param {Split} [options.split] - Split the PDF into multiple files.
|
|
49
50
|
* @returns {Promise<Buffer>} A Promise resolving to the converted PDF content as a buffer
|
|
50
51
|
*/
|
|
51
|
-
async convert({ html, assets, header, footer, properties, pdfFormat, pdfUA, emulatedMediaType, waitDelay, waitForExpression, waitForSelector, userAgent, extraHttpHeaders, failOnHttpStatusCodes, failOnConsoleExceptions, failOnResourceHttpStatusCodes, ignoreResourceHttpStatusDomains, failOnResourceLoadingFailed, skipNetworkIdleEvent, generateDocumentOutline, metadata, cookies, downloadFrom, split, userPassword, ownerPassword, embeds }) {
|
|
52
|
+
async convert({ html, assets, header, footer, properties, pdfFormat, pdfUA, emulatedMediaType, emulatedMediaFeatures, waitDelay, waitForExpression, waitForSelector, userAgent, extraHttpHeaders, failOnHttpStatusCodes, failOnConsoleExceptions, failOnResourceHttpStatusCodes, ignoreResourceHttpStatusDomains, failOnResourceLoadingFailed, skipNetworkIdleEvent, generateDocumentOutline, metadata, cookies, downloadFrom, split, userPassword, ownerPassword, embeds }) {
|
|
52
53
|
const data = new FormData();
|
|
53
54
|
await common_1.GotenbergUtils.addFile(data, html, 'index.html');
|
|
54
55
|
if (assets?.length) {
|
|
@@ -61,6 +62,7 @@ class HtmlConverter extends converter_1.Converter {
|
|
|
61
62
|
pdfFormat,
|
|
62
63
|
pdfUA,
|
|
63
64
|
emulatedMediaType,
|
|
65
|
+
emulatedMediaFeatures,
|
|
64
66
|
waitDelay,
|
|
65
67
|
waitForExpression,
|
|
66
68
|
waitForSelector,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html.converter.js","sourceRoot":"","sources":["../../../src/chromium/converters/html.converter.ts"],"names":[],"mappings":";;;AAAA,yCAA8C;AAE9C,8DAA0D;AAC1D,2CAAwC;AACxC,mDAA8D;AAE9D;;;;;GAKG;AACH,MAAa,aAAc,SAAQ,qBAAS;IACxC;;;OAGG;IACH;QACI,KAAK,CAAC,2BAAa,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC;IAED
|
|
1
|
+
{"version":3,"file":"html.converter.js","sourceRoot":"","sources":["../../../src/chromium/converters/html.converter.ts"],"names":[],"mappings":";;;AAAA,yCAA8C;AAE9C,8DAA0D;AAC1D,2CAAwC;AACxC,mDAA8D;AAE9D;;;;;G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AQ;YACR,OAAO;YACP,YAAY;YACZ,KAAK;YACL,YAAY;YACZ,aAAa;YACb,MAAM;SACT,CAAC,CAAC;QAEH,OAAO,uBAAc,CAAC,KAAK,CACvB,IAAI,CAAC,QAAQ,EACb,IAAI,EACJ,wBAAU,CAAC,gCAAgC,EAAE,EAC7C,wBAAU,CAAC,gCAAgC,EAAE,EAC7C,wBAAU,CAAC,oBAAoB,EAAE,CACpC,CAAC;IACN,CAAC;CACJ;AAtHD,sCAsHC"}
|
|
@@ -24,6 +24,7 @@ export declare class MarkdownConverter extends Converter {
|
|
|
24
24
|
* @param {PdfFormat} [options.pdfFormat] - PDF format options.
|
|
25
25
|
* @param {boolean} [options.pdfUA] - Indicates whether to generate PDF/UA compliant output.
|
|
26
26
|
* @param {EmulatedMediaType} [options.emulatedMediaType] - Emulated media type for the conversion.
|
|
27
|
+
* @param {EmulatedMediaFeature[]} [options.emulatedMediaFeatures] - Override CSS media features (e.g. prefers-color-scheme).
|
|
27
28
|
* @param {string} [options.waitDelay] - Delay before the conversion process starts.
|
|
28
29
|
* @param {string} [options.waitForExpression] - JavaScript expression to wait for before completing the conversion.
|
|
29
30
|
* @param {string} [options.waitForSelector] - CSS selector to wait for before completing the conversion.
|
|
@@ -42,5 +43,5 @@ export declare class MarkdownConverter extends Converter {
|
|
|
42
43
|
* @param {Split} [options.split] - Split the PDF into multiple files.
|
|
43
44
|
* @returns {Promise<Buffer>} A Promise resolving to the converted PDF content as a buffer
|
|
44
45
|
*/
|
|
45
|
-
convert({ html, markdown, header, footer, properties, pdfFormat, pdfUA, emulatedMediaType, waitDelay, waitForExpression, waitForSelector, userAgent, extraHttpHeaders, failOnHttpStatusCodes, failOnConsoleExceptions, failOnResourceHttpStatusCodes, ignoreResourceHttpStatusDomains, failOnResourceLoadingFailed, skipNetworkIdleEvent, generateDocumentOutline, metadata, cookies, downloadFrom, split, userPassword, ownerPassword, embeds }: MarkdownConversionOptions): Promise<Buffer>;
|
|
46
|
+
convert({ html, markdown, header, footer, properties, pdfFormat, pdfUA, emulatedMediaType, emulatedMediaFeatures, waitDelay, waitForExpression, waitForSelector, userAgent, extraHttpHeaders, failOnHttpStatusCodes, failOnConsoleExceptions, failOnResourceHttpStatusCodes, ignoreResourceHttpStatusDomains, failOnResourceLoadingFailed, skipNetworkIdleEvent, generateDocumentOutline, metadata, cookies, downloadFrom, split, userPassword, ownerPassword, embeds }: MarkdownConversionOptions): Promise<Buffer>;
|
|
46
47
|
}
|
|
@@ -31,6 +31,7 @@ class MarkdownConverter extends converter_1.Converter {
|
|
|
31
31
|
* @param {PdfFormat} [options.pdfFormat] - PDF format options.
|
|
32
32
|
* @param {boolean} [options.pdfUA] - Indicates whether to generate PDF/UA compliant output.
|
|
33
33
|
* @param {EmulatedMediaType} [options.emulatedMediaType] - Emulated media type for the conversion.
|
|
34
|
+
* @param {EmulatedMediaFeature[]} [options.emulatedMediaFeatures] - Override CSS media features (e.g. prefers-color-scheme).
|
|
34
35
|
* @param {string} [options.waitDelay] - Delay before the conversion process starts.
|
|
35
36
|
* @param {string} [options.waitForExpression] - JavaScript expression to wait for before completing the conversion.
|
|
36
37
|
* @param {string} [options.waitForSelector] - CSS selector to wait for before completing the conversion.
|
|
@@ -49,7 +50,7 @@ class MarkdownConverter extends converter_1.Converter {
|
|
|
49
50
|
* @param {Split} [options.split] - Split the PDF into multiple files.
|
|
50
51
|
* @returns {Promise<Buffer>} A Promise resolving to the converted PDF content as a buffer
|
|
51
52
|
*/
|
|
52
|
-
async convert({ html, markdown, header, footer, properties, pdfFormat, pdfUA, emulatedMediaType, waitDelay, waitForExpression, waitForSelector, userAgent, extraHttpHeaders, failOnHttpStatusCodes, failOnConsoleExceptions, failOnResourceHttpStatusCodes, ignoreResourceHttpStatusDomains, failOnResourceLoadingFailed, skipNetworkIdleEvent, generateDocumentOutline, metadata, cookies, downloadFrom, split, userPassword, ownerPassword, embeds }) {
|
|
53
|
+
async convert({ html, markdown, header, footer, properties, pdfFormat, pdfUA, emulatedMediaType, emulatedMediaFeatures, waitDelay, waitForExpression, waitForSelector, userAgent, extraHttpHeaders, failOnHttpStatusCodes, failOnConsoleExceptions, failOnResourceHttpStatusCodes, ignoreResourceHttpStatusDomains, failOnResourceLoadingFailed, skipNetworkIdleEvent, generateDocumentOutline, metadata, cookies, downloadFrom, split, userPassword, ownerPassword, embeds }) {
|
|
53
54
|
const data = new FormData();
|
|
54
55
|
await common_1.GotenbergUtils.addFile(data, html, 'index.html');
|
|
55
56
|
await common_1.GotenbergUtils.addFile(data, markdown, 'file.md');
|
|
@@ -60,6 +61,7 @@ class MarkdownConverter extends converter_1.Converter {
|
|
|
60
61
|
pdfFormat,
|
|
61
62
|
pdfUA,
|
|
62
63
|
emulatedMediaType,
|
|
64
|
+
emulatedMediaFeatures,
|
|
63
65
|
waitDelay,
|
|
64
66
|
waitForExpression,
|
|
65
67
|
waitForSelector,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markdown.converter.js","sourceRoot":"","sources":["../../../src/chromium/converters/markdown.converter.ts"],"names":[],"mappings":";;;AAAA,yCAA8C;AAE9C,8DAA0D;AAC1D,2CAAwC;AACxC,mDAA8D;AAE9D;;;;;GAKG;AACH,MAAa,iBAAkB,SAAQ,qBAAS;IAC5C;;;OAGG;IACH;QACI,KAAK,CAAC,2BAAa,CAAC,QAAQ,CAAC,CAAC;IAClC,CAAC;IAED
|
|
1
|
+
{"version":3,"file":"markdown.converter.js","sourceRoot":"","sources":["../../../src/chromium/converters/markdown.converter.ts"],"names":[],"mappings":";;;AAAA,yCAA8C;AAE9C,8DAA0D;AAC1D,2CAAwC;AACxC,mDAA8D;AAE9D;;;;;GAKG;AACH,MAAa,iBAAkB,SAAQ,qBAAS;IAC5C;;;OAGG;IACH;QACI,KAAK,CAAC,2BAAa,CAAC,QAAQ,CAAC,CAAC;IAClC,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8BG;IACH,KAAK,CAAC,OAAO,CAAC,EACV,IAA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|
* @param {PdfFormat} [options.pdfFormat] - PDF format options.
|
|
24
24
|
* @param {boolean} [options.pdfUA] - Indicates whether to generate PDF/UA compliant output.
|
|
25
25
|
* @param {EmulatedMediaType} [options.emulatedMediaType] - Emulated media type for the conversion.
|
|
26
|
+
* @param {EmulatedMediaFeature[]} [options.emulatedMediaFeatures] - Override CSS media features (e.g. prefers-color-scheme).
|
|
26
27
|
* @param {string} [options.waitDelay] - Delay before the conversion process starts.
|
|
27
28
|
* @param {string} [options.waitForExpression] - JavaScript expression to wait for before completing the conversion.
|
|
28
29
|
* @param {string} [options.waitForSelector] - CSS selector to wait for before completing the conversion.
|
|
@@ -41,5 +42,5 @@ export declare class UrlConverter extends Converter {
|
|
|
41
42
|
* @param {Split} [options.split] - Split the PDF into multiple files.
|
|
42
43
|
* @returns {Promise<Buffer>} A Promise resolving to the converted PDF content as a buffer
|
|
43
44
|
*/
|
|
44
|
-
convert({ url, header, footer, properties, pdfFormat, pdfUA, emulatedMediaType, waitDelay, waitForExpression, waitForSelector, userAgent, extraHttpHeaders, failOnHttpStatusCodes, failOnResourceHttpStatusCodes, ignoreResourceHttpStatusDomains, failOnResourceLoadingFailed, failOnConsoleExceptions, skipNetworkIdleEvent, metadata, cookies, downloadFrom, generateDocumentOutline, split, userPassword, ownerPassword, embeds }: UrlConversionOptions): Promise<Buffer>;
|
|
45
|
+
convert({ url, header, footer, properties, pdfFormat, pdfUA, emulatedMediaType, emulatedMediaFeatures, waitDelay, waitForExpression, waitForSelector, userAgent, extraHttpHeaders, failOnHttpStatusCodes, failOnResourceHttpStatusCodes, ignoreResourceHttpStatusDomains, failOnResourceLoadingFailed, failOnConsoleExceptions, skipNetworkIdleEvent, metadata, cookies, downloadFrom, generateDocumentOutline, split, userPassword, ownerPassword, embeds }: UrlConversionOptions): Promise<Buffer>;
|
|
45
46
|
}
|
|
@@ -31,6 +31,7 @@ class UrlConverter extends converter_1.Converter {
|
|
|
31
31
|
* @param {PdfFormat} [options.pdfFormat] - PDF format options.
|
|
32
32
|
* @param {boolean} [options.pdfUA] - Indicates whether to generate PDF/UA compliant output.
|
|
33
33
|
* @param {EmulatedMediaType} [options.emulatedMediaType] - Emulated media type for the conversion.
|
|
34
|
+
* @param {EmulatedMediaFeature[]} [options.emulatedMediaFeatures] - Override CSS media features (e.g. prefers-color-scheme).
|
|
34
35
|
* @param {string} [options.waitDelay] - Delay before the conversion process starts.
|
|
35
36
|
* @param {string} [options.waitForExpression] - JavaScript expression to wait for before completing the conversion.
|
|
36
37
|
* @param {string} [options.waitForSelector] - CSS selector to wait for before completing the conversion.
|
|
@@ -49,7 +50,7 @@ class UrlConverter extends converter_1.Converter {
|
|
|
49
50
|
* @param {Split} [options.split] - Split the PDF into multiple files.
|
|
50
51
|
* @returns {Promise<Buffer>} A Promise resolving to the converted PDF content as a buffer
|
|
51
52
|
*/
|
|
52
|
-
async convert({ url, header, footer, properties, pdfFormat, pdfUA, emulatedMediaType, waitDelay, waitForExpression, waitForSelector, userAgent, extraHttpHeaders, failOnHttpStatusCodes, failOnResourceHttpStatusCodes, ignoreResourceHttpStatusDomains, failOnResourceLoadingFailed, failOnConsoleExceptions, skipNetworkIdleEvent, metadata, cookies, downloadFrom, generateDocumentOutline, split, userPassword, ownerPassword, embeds }) {
|
|
53
|
+
async convert({ url, header, footer, properties, pdfFormat, pdfUA, emulatedMediaType, emulatedMediaFeatures, waitDelay, waitForExpression, waitForSelector, userAgent, extraHttpHeaders, failOnHttpStatusCodes, failOnResourceHttpStatusCodes, ignoreResourceHttpStatusDomains, failOnResourceLoadingFailed, failOnConsoleExceptions, skipNetworkIdleEvent, metadata, cookies, downloadFrom, generateDocumentOutline, split, userPassword, ownerPassword, embeds }) {
|
|
53
54
|
const _url = new url_1.URL(url);
|
|
54
55
|
const data = new FormData();
|
|
55
56
|
data.append('url', _url.href);
|
|
@@ -60,6 +61,7 @@ class UrlConverter extends converter_1.Converter {
|
|
|
60
61
|
pdfFormat,
|
|
61
62
|
pdfUA,
|
|
62
63
|
emulatedMediaType,
|
|
64
|
+
emulatedMediaFeatures,
|
|
63
65
|
waitDelay,
|
|
64
66
|
waitForExpression,
|
|
65
67
|
waitForSelector,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"url.converter.js","sourceRoot":"","sources":["../../../src/chromium/converters/url.converter.ts"],"names":[],"mappings":";;;AAAA,6BAA0B;AAE1B,yCAA8C;AAE9C,8DAA0D;AAC1D,2CAAwC;AACxC,mDAA8D;AAE9D;;;;;GAKG;AACH,MAAa,YAAa,SAAQ,qBAAS;IACvC;;;OAGG;IACH;QACI,KAAK,CAAC,2BAAa,CAAC,GAAG,CAAC,CAAC;IAC7B,CAAC;IAED
|
|
1
|
+
{"version":3,"file":"url.converter.js","sourceRoot":"","sources":["../../../src/chromium/converters/url.converter.ts"],"names":[],"mappings":";;;AAAA,6BAA0B;AAE1B,yCAA8C;AAE9C,8DAA0D;AAC1D,2CAAwC;AACxC,mDAA8D;AAE9D;;;;;GAKG;AACH,MAAa,YAAa,SAAQ,qBAAS;IACvC;;;OAGG;IACH;QACI,KAAK,CAAC,2BAAa,CAAC,GAAG,CAAC,CAAC;IAC7B,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;IACH,KAAK,CAAC,OAAO,CAAC,EACV,GAAG,EACH,MAAM,EACN,MAAM,EACN,UAAU,EACV,SAAS,EACT,KAAK,EACL,iBAAiB,EACjB,qBAAqB,EACrB,SAAS,EACT,iBAAiB,EACjB,eAAe,EACf,SAAS,EACT,gBAAgB,EAChB,qBAAqB,EACrB,6BAA6B,EAC7B,+BAA+B,EAC/B,2BAA2B,EAC3B,uBAAuB,EACvB,oBAAoB,EACpB,QAAQ,EACR,OAAO,EACP,YAAY,EACZ,uBAAuB,EACvB,KAAK,EACL,YAAY,EACZ,aAAa,EACb,MAAM,EACa;QACnB,MAAM,IAAI,GAAG,IAAI,SAAG,CAAC,GAAG,CAAC,CAAC;QAC1B,MAAM,IAAI,GAAG,IAAI,QAAQ,EAAE,CAAC;QAE5B,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;QAE9B,MAAM,gCAAc,CAAC,SAAS,CAAC,IAAI,EAAE;YACjC,MAAM;YACN,MAAM;YACN,UAAU;YACV,SAAS;YACT,KAAK;YACL,iBAAiB;YACjB,qBAAqB;YACrB,SAAS;YACT,iBAAiB;YACjB,eAAe;YACf,SAAS;YACT,gBAAgB;YAChB,qBAAqB;YACrB,uBAAuB;YACvB,oBAAoB;YACpB,QAAQ;YACR,OAAO;YACP,YAAY;YACZ,6BAA6B;YAC7B,+BAA+B;YAC/B,2BAA2B;YAC3B,uBAAuB;YACvB,KAAK;YACL,YAAY;YACZ,aAAa;YACb,MAAM;SACT,CAAC,CAAC;QAEH,OAAO,uBAAc,CAAC,KAAK,CACvB,IAAI,CAAC,QAAQ,EACb,IAAI,EACJ,wBAAU,CAAC,gCAAgC,EAAE,EAC7C,wBAAU,CAAC,gCAAgC,EAAE,EAC7C,wBAAU,CAAC,oBAAoB,EAAE,CACpC,CAAC;IACN,CAAC;CACJ;AA9GD,oCA8GC"}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { PathLikeOrReadStream } from '../../common';
|
|
2
2
|
import { DownloadFrom } from '../../common/types';
|
|
3
3
|
export type EmulatedMediaType = 'screen' | 'print';
|
|
4
|
+
export type EmulatedMediaFeature = {
|
|
5
|
+
name: string;
|
|
6
|
+
value: string;
|
|
7
|
+
};
|
|
4
8
|
export type Cookie = {
|
|
5
9
|
name: string;
|
|
6
10
|
value: string;
|
|
@@ -14,6 +18,7 @@ export type ChromiumOptions = {
|
|
|
14
18
|
header?: PathLikeOrReadStream;
|
|
15
19
|
footer?: PathLikeOrReadStream;
|
|
16
20
|
emulatedMediaType?: EmulatedMediaType;
|
|
21
|
+
emulatedMediaFeatures?: EmulatedMediaFeature[];
|
|
17
22
|
waitDelay?: string;
|
|
18
23
|
waitForExpression?: string;
|
|
19
24
|
waitForSelector?: string;
|
|
@@ -2,14 +2,14 @@ import { Metadata, PathLikeOrReadStream, PdfFormat } from '../../common';
|
|
|
2
2
|
import { Split } from '../../common/types';
|
|
3
3
|
import { ChromiumOptions, Cookie } from './common.types';
|
|
4
4
|
type PageSize = {
|
|
5
|
-
width: number;
|
|
6
|
-
height: number;
|
|
5
|
+
width: number | string;
|
|
6
|
+
height: number | string;
|
|
7
7
|
};
|
|
8
8
|
type PageMargins = {
|
|
9
|
-
top: number;
|
|
10
|
-
bottom: number;
|
|
11
|
-
left: number;
|
|
12
|
-
right: number;
|
|
9
|
+
top: number | string;
|
|
10
|
+
bottom: number | string;
|
|
11
|
+
left: number | string;
|
|
12
|
+
right: number | string;
|
|
13
13
|
};
|
|
14
14
|
export type PageProperties = {
|
|
15
15
|
singlePage?: boolean;
|
|
@@ -19,6 +19,7 @@ export declare class HtmlScreenshot extends Screenshot {
|
|
|
19
19
|
* @param {PathLikeOrReadStream} options.html - PathLike or ReadStream of the HTML content to be screenshoted.
|
|
20
20
|
* @param {ImageProperties} [options.properties] - Image properties for the screenshot.
|
|
21
21
|
* @param {EmulatedMediaType} [options.emulatedMediaType] - Emulated media type for the screenshot.
|
|
22
|
+
* @param {EmulatedMediaFeature[]} [options.emulatedMediaFeatures] - Override CSS media features (e.g. prefers-color-scheme).
|
|
22
23
|
* @param {string} [options.waitDelay] - Delay before the screenshot process starts.
|
|
23
24
|
* @param {string} [options.waitForExpression] - JavaScript expression to wait for before completing the screenshot.
|
|
24
25
|
* @param {string} [options.waitForSelector] - CSS selector to wait for before completing the screenshot.
|
|
@@ -34,5 +35,5 @@ export declare class HtmlScreenshot extends Screenshot {
|
|
|
34
35
|
* @param {boolean} [options.generateDocumentOutline] - Whether to generate document outline.
|
|
35
36
|
* @returns {Promise<Buffer>} A Promise resolving to the image buffer.
|
|
36
37
|
*/
|
|
37
|
-
capture({ html, properties, emulatedMediaType, waitDelay, waitForExpression, waitForSelector, extraHttpHeaders, failOnConsoleExceptions, failOnHttpStatusCodes, failOnResourceHttpStatusCodes, ignoreResourceHttpStatusDomains, failOnResourceLoadingFailed, skipNetworkIdleEvent, optimizeForSpeed, downloadFrom, generateDocumentOutline, userPassword, ownerPassword, embeds }: HtmlScreenshotOptions): Promise<Buffer>;
|
|
38
|
+
capture({ html, properties, emulatedMediaType, emulatedMediaFeatures, waitDelay, waitForExpression, waitForSelector, extraHttpHeaders, failOnConsoleExceptions, failOnHttpStatusCodes, failOnResourceHttpStatusCodes, ignoreResourceHttpStatusDomains, failOnResourceLoadingFailed, skipNetworkIdleEvent, optimizeForSpeed, downloadFrom, generateDocumentOutline, userPassword, ownerPassword, embeds }: HtmlScreenshotOptions): Promise<Buffer>;
|
|
38
39
|
}
|
|
@@ -26,6 +26,7 @@ class HtmlScreenshot extends screenshot_1.Screenshot {
|
|
|
26
26
|
* @param {PathLikeOrReadStream} options.html - PathLike or ReadStream of the HTML content to be screenshoted.
|
|
27
27
|
* @param {ImageProperties} [options.properties] - Image properties for the screenshot.
|
|
28
28
|
* @param {EmulatedMediaType} [options.emulatedMediaType] - Emulated media type for the screenshot.
|
|
29
|
+
* @param {EmulatedMediaFeature[]} [options.emulatedMediaFeatures] - Override CSS media features (e.g. prefers-color-scheme).
|
|
29
30
|
* @param {string} [options.waitDelay] - Delay before the screenshot process starts.
|
|
30
31
|
* @param {string} [options.waitForExpression] - JavaScript expression to wait for before completing the screenshot.
|
|
31
32
|
* @param {string} [options.waitForSelector] - CSS selector to wait for before completing the screenshot.
|
|
@@ -41,12 +42,13 @@ class HtmlScreenshot extends screenshot_1.Screenshot {
|
|
|
41
42
|
* @param {boolean} [options.generateDocumentOutline] - Whether to generate document outline.
|
|
42
43
|
* @returns {Promise<Buffer>} A Promise resolving to the image buffer.
|
|
43
44
|
*/
|
|
44
|
-
async capture({ html, properties, emulatedMediaType, waitDelay, waitForExpression, waitForSelector, extraHttpHeaders, failOnConsoleExceptions, failOnHttpStatusCodes, failOnResourceHttpStatusCodes, ignoreResourceHttpStatusDomains, failOnResourceLoadingFailed, skipNetworkIdleEvent, optimizeForSpeed, downloadFrom, generateDocumentOutline, userPassword, ownerPassword, embeds }) {
|
|
45
|
+
async capture({ html, properties, emulatedMediaType, emulatedMediaFeatures, waitDelay, waitForExpression, waitForSelector, extraHttpHeaders, failOnConsoleExceptions, failOnHttpStatusCodes, failOnResourceHttpStatusCodes, ignoreResourceHttpStatusDomains, failOnResourceLoadingFailed, skipNetworkIdleEvent, optimizeForSpeed, downloadFrom, generateDocumentOutline, userPassword, ownerPassword, embeds }) {
|
|
45
46
|
const data = new FormData();
|
|
46
47
|
await common_1.GotenbergUtils.addFile(data, html, 'index.html');
|
|
47
48
|
await screenshot_utils_1.ScreenshotUtils.customize(data, {
|
|
48
49
|
properties,
|
|
49
50
|
emulatedMediaType,
|
|
51
|
+
emulatedMediaFeatures,
|
|
50
52
|
waitDelay,
|
|
51
53
|
waitForExpression,
|
|
52
54
|
waitForSelector,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html.screenshot.js","sourceRoot":"","sources":["../../../src/chromium/screenshots/html.screenshot.ts"],"names":[],"mappings":";;;AAAA,yCAA8C;AAC9C,mDAA8D;AAC9D,gEAA4D;AAC5D,6CAA0C;AAG1C;;;;;GAKG;AACH,MAAa,cAAe,SAAQ,uBAAU;IAC1C;;;OAGG;IACH;QACI,KAAK,CAAC,2BAAa,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC;IAED
|
|
1
|
+
{"version":3,"file":"html.screenshot.js","sourceRoot":"","sources":["../../../src/chromium/screenshots/html.screenshot.ts"],"names":[],"mappings":";;;AAAA,yCAA8C;AAC9C,mDAA8D;AAC9D,gEAA4D;AAC5D,6CAA0C;AAG1C;;;;;GAKG;AACH,MAAa,cAAe,SAAQ,uBAAU;IAC1C;;;OAGG;IACH;QACI,KAAK,CAAC,2BAAa,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,KAAK,CAAC,OAAO,CAAC,EACV,IAAI,EACJ,UAAU,EACV,iBAAiB,EACjB,qBAAqB,EACrB,SAAS,EACT,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,uBAAuB,EACvB,qBAAqB,EACrB,6BAA6B,EAC7B,+BAA+B,EAC/B,2BAA2B,EAC3B,oBAAoB,EACpB,gBAAgB,EAChB,YAAY,EACZ,uBAAuB,EACvB,YAAY,EACZ,aAAa,EACb,MAAM,EACc;QACpB,MAAM,IAAI,GAAG,IAAI,QAAQ,EAAE,CAAC;QAE5B,MAAM,uBAAc,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,YAAY,CAAC,CAAC;QAEvD,MAAM,kCAAe,CAAC,SAAS,CAAC,IAAI,EAAE;YAClC,UAAU;YACV,iBAAiB;YACjB,qBAAqB;YACrB,SAAS;YACT,iBAAiB;YACjB,eAAe;YACf,gBAAgB;YAChB,qBAAqB;YACrB,uBAAuB;YACvB,6BAA6B;YAC7B,+BAA+B;YAC/B,2BAA2B;YAC3B,oBAAoB;YACpB,gBAAgB;YAChB,YAAY;YACZ,uBAAuB;YACvB,YAAY;YACZ,aAAa;YACb,MAAM;SACT,CAAC,CAAC;QAEH,OAAO,uBAAc,CAAC,KAAK,CACvB,IAAI,CAAC,QAAQ,EACb,IAAI,EACJ,wBAAU,CAAC,gCAAgC,EAAE,EAC7C,wBAAU,CAAC,gCAAgC,EAAE,EAC7C,wBAAU,CAAC,oBAAoB,EAAE,CACpC,CAAC;IACN,CAAC;CACJ;AAxFD,wCAwFC"}
|
|
@@ -20,6 +20,7 @@ export declare class MarkdownScreenshot extends Screenshot {
|
|
|
20
20
|
* @param {PathLikeOrReadStream} options.markdown - PathLike or ReadStream of the Markdown content to be screenshoted.
|
|
21
21
|
* @param {ImageProperties} [options.properties] - Image properties for the screenshot.
|
|
22
22
|
* @param {EmulatedMediaType} [options.emulatedMediaType] - Emulated media type for the screenshot.
|
|
23
|
+
* @param {EmulatedMediaFeature[]} [options.emulatedMediaFeatures] - Override CSS media features (e.g. prefers-color-scheme).
|
|
23
24
|
* @param {string} [options.waitDelay] - Delay before the screenshot process starts.
|
|
24
25
|
* @param {string} [options.waitForExpression] - JavaScript expression to wait for before completing the screenshot.
|
|
25
26
|
* @param {string} [options.waitForSelector] - CSS selector to wait for before completing the screenshot.
|
|
@@ -35,5 +36,5 @@ export declare class MarkdownScreenshot extends Screenshot {
|
|
|
35
36
|
* @param {boolean} [options.generateDocumentOutline] - Whether to generate document outline.
|
|
36
37
|
* @returns {Promise<Buffer>} A Promise resolving to the image buffer.
|
|
37
38
|
*/
|
|
38
|
-
capture({ html, markdown, properties, emulatedMediaType, waitDelay, waitForExpression, waitForSelector, extraHttpHeaders, failOnHttpStatusCodes, failOnConsoleExceptions, skipNetworkIdleEvent, optimizeForSpeed, downloadFrom, failOnResourceHttpStatusCodes, ignoreResourceHttpStatusDomains, failOnResourceLoadingFailed, generateDocumentOutline, userPassword, ownerPassword, embeds }: MarkdownScreenshotOptions): Promise<Buffer>;
|
|
39
|
+
capture({ html, markdown, properties, emulatedMediaType, emulatedMediaFeatures, waitDelay, waitForExpression, waitForSelector, extraHttpHeaders, failOnHttpStatusCodes, failOnConsoleExceptions, skipNetworkIdleEvent, optimizeForSpeed, downloadFrom, failOnResourceHttpStatusCodes, ignoreResourceHttpStatusDomains, failOnResourceLoadingFailed, generateDocumentOutline, userPassword, ownerPassword, embeds }: MarkdownScreenshotOptions): Promise<Buffer>;
|
|
39
40
|
}
|
|
@@ -27,6 +27,7 @@ class MarkdownScreenshot extends screenshot_1.Screenshot {
|
|
|
27
27
|
* @param {PathLikeOrReadStream} options.markdown - PathLike or ReadStream of the Markdown content to be screenshoted.
|
|
28
28
|
* @param {ImageProperties} [options.properties] - Image properties for the screenshot.
|
|
29
29
|
* @param {EmulatedMediaType} [options.emulatedMediaType] - Emulated media type for the screenshot.
|
|
30
|
+
* @param {EmulatedMediaFeature[]} [options.emulatedMediaFeatures] - Override CSS media features (e.g. prefers-color-scheme).
|
|
30
31
|
* @param {string} [options.waitDelay] - Delay before the screenshot process starts.
|
|
31
32
|
* @param {string} [options.waitForExpression] - JavaScript expression to wait for before completing the screenshot.
|
|
32
33
|
* @param {string} [options.waitForSelector] - CSS selector to wait for before completing the screenshot.
|
|
@@ -42,13 +43,14 @@ class MarkdownScreenshot extends screenshot_1.Screenshot {
|
|
|
42
43
|
* @param {boolean} [options.generateDocumentOutline] - Whether to generate document outline.
|
|
43
44
|
* @returns {Promise<Buffer>} A Promise resolving to the image buffer.
|
|
44
45
|
*/
|
|
45
|
-
async capture({ html, markdown, properties, emulatedMediaType, waitDelay, waitForExpression, waitForSelector, extraHttpHeaders, failOnHttpStatusCodes, failOnConsoleExceptions, skipNetworkIdleEvent, optimizeForSpeed, downloadFrom, failOnResourceHttpStatusCodes, ignoreResourceHttpStatusDomains, failOnResourceLoadingFailed, generateDocumentOutline, userPassword, ownerPassword, embeds }) {
|
|
46
|
+
async capture({ html, markdown, properties, emulatedMediaType, emulatedMediaFeatures, waitDelay, waitForExpression, waitForSelector, extraHttpHeaders, failOnHttpStatusCodes, failOnConsoleExceptions, skipNetworkIdleEvent, optimizeForSpeed, downloadFrom, failOnResourceHttpStatusCodes, ignoreResourceHttpStatusDomains, failOnResourceLoadingFailed, generateDocumentOutline, userPassword, ownerPassword, embeds }) {
|
|
46
47
|
const data = new FormData();
|
|
47
48
|
await common_1.GotenbergUtils.addFile(data, html, 'index.html');
|
|
48
49
|
await common_1.GotenbergUtils.addFile(data, markdown, 'file.md');
|
|
49
50
|
await screenshot_utils_1.ScreenshotUtils.customize(data, {
|
|
50
51
|
properties,
|
|
51
52
|
emulatedMediaType,
|
|
53
|
+
emulatedMediaFeatures,
|
|
52
54
|
waitDelay,
|
|
53
55
|
waitForExpression,
|
|
54
56
|
waitForSelector,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markdown.screenshot.js","sourceRoot":"","sources":["../../../src/chromium/screenshots/markdown.screenshot.ts"],"names":[],"mappings":";;;AAAA,yCAA8C;AAE9C,gEAA4D;AAC5D,6CAA0C;AAC1C,mDAA8D;AAE9D;;;;;GAKG;AACH,MAAa,kBAAmB,SAAQ,uBAAU;IAC9C;;;OAGG;IACH;QACI,KAAK,CAAC,2BAAa,CAAC,QAAQ,CAAC,CAAC;IAClC,CAAC;IAED
|
|
1
|
+
{"version":3,"file":"markdown.screenshot.js","sourceRoot":"","sources":["../../../src/chromium/screenshots/markdown.screenshot.ts"],"names":[],"mappings":";;;AAAA,yCAA8C;AAE9C,gEAA4D;AAC5D,6CAA0C;AAC1C,mDAA8D;AAE9D;;;;;GAKG;AACH,MAAa,kBAAmB,SAAQ,uBAAU;IAC9C;;;OAGG;IACH;QACI,KAAK,CAAC,2BAAa,CAAC,QAAQ,CAAC,CAAC;IAClC,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,KAAK,CAAC,OAAO,CAAC,EACV,IAAI,EACJ,QAAQ,EACR,UAAU,EACV,iBAAiB,EACjB,qBAAqB,EACrB,SAAS,EACT,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,EACpB,gBAAgB,EAChB,YAAY,EACZ,6BAA6B,EAC7B,+BAA+B,EAC/B,2BAA2B,EAC3B,uBAAuB,EACvB,YAAY,EACZ,aAAa,EACb,MAAM,EACkB;QACxB,MAAM,IAAI,GAAG,IAAI,QAAQ,EAAE,CAAC;QAE5B,MAAM,uBAAc,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,YAAY,CAAC,CAAC;QAEvD,MAAM,uBAAc,CAAC,OAAO,CAAC,IAAI,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC;QAExD,MAAM,kCAAe,CAAC,SAAS,CAAC,IAAI,EAAE;YAClC,UAAU;YACV,iBAAiB;YACjB,qBAAqB;YACrB,SAAS;YACT,iBAAiB;YACjB,eAAe;YACf,gBAAgB;YAChB,qBAAqB;YACrB,uBAAuB;YACvB,6BAA6B;YAC7B,+BAA+B;YAC/B,2BAA2B;YAC3B,oBAAoB;YACpB,gBAAgB;YAChB,YAAY;YACZ,uBAAuB;YACvB,YAAY;YACZ,aAAa;YACb,MAAM;SACT,CAAC,CAAC;QAEH,OAAO,uBAAc,CAAC,KAAK,CACvB,IAAI,CAAC,QAAQ,EACb,IAAI,EACJ,wBAAU,CAAC,gCAAgC,EAAE,EAC7C,wBAAU,CAAC,gCAAgC,EAAE,EAC7C,wBAAU,CAAC,oBAAoB,EAAE,CACpC,CAAC;IACN,CAAC;CACJ;AA5FD,gDA4FC"}
|
|
@@ -19,6 +19,7 @@ export declare class UrlScreenshot extends Screenshot {
|
|
|
19
19
|
* @param {string} options.url - The URL of the content to be screenshoted
|
|
20
20
|
* @param {ImageProperties} [options.properties] - Image properties for the screenshot.
|
|
21
21
|
* @param {EmulatedMediaType} [options.emulatedMediaType] - Emulated media type for the screenshot.
|
|
22
|
+
* @param {EmulatedMediaFeature[]} [options.emulatedMediaFeatures] - Override CSS media features (e.g. prefers-color-scheme).
|
|
22
23
|
* @param {string} [options.waitDelay] - Delay before the screenshot process starts.
|
|
23
24
|
* @param {string} [options.waitForExpression] - JavaScript expression to wait for before completing the screenshot.
|
|
24
25
|
* @param {string} [options.waitForSelector] - CSS selector to wait for before completing the screenshot.
|
|
@@ -34,5 +35,5 @@ export declare class UrlScreenshot extends Screenshot {
|
|
|
34
35
|
* @param {boolean} [options.generateDocumentOutline] - Whether to generate document outline.
|
|
35
36
|
* @returns {Promise<Buffer>} A Promise resolving to the image buffer.
|
|
36
37
|
*/
|
|
37
|
-
capture({ url, properties, emulatedMediaType, waitDelay, waitForExpression, waitForSelector, extraHttpHeaders, failOnHttpStatusCodes, failOnConsoleExceptions, failOnResourceHttpStatusCodes, ignoreResourceHttpStatusDomains, failOnResourceLoadingFailed, skipNetworkIdleEvent, optimizeForSpeed, cookies, generateDocumentOutline, userPassword, ownerPassword, embeds }: UrlScreenshotOptions): Promise<Buffer>;
|
|
38
|
+
capture({ url, properties, emulatedMediaType, emulatedMediaFeatures, waitDelay, waitForExpression, waitForSelector, extraHttpHeaders, failOnHttpStatusCodes, failOnConsoleExceptions, failOnResourceHttpStatusCodes, ignoreResourceHttpStatusDomains, failOnResourceLoadingFailed, skipNetworkIdleEvent, optimizeForSpeed, cookies, generateDocumentOutline, userPassword, ownerPassword, embeds }: UrlScreenshotOptions): Promise<Buffer>;
|
|
38
39
|
}
|
|
@@ -27,6 +27,7 @@ class UrlScreenshot extends screenshot_1.Screenshot {
|
|
|
27
27
|
* @param {string} options.url - The URL of the content to be screenshoted
|
|
28
28
|
* @param {ImageProperties} [options.properties] - Image properties for the screenshot.
|
|
29
29
|
* @param {EmulatedMediaType} [options.emulatedMediaType] - Emulated media type for the screenshot.
|
|
30
|
+
* @param {EmulatedMediaFeature[]} [options.emulatedMediaFeatures] - Override CSS media features (e.g. prefers-color-scheme).
|
|
30
31
|
* @param {string} [options.waitDelay] - Delay before the screenshot process starts.
|
|
31
32
|
* @param {string} [options.waitForExpression] - JavaScript expression to wait for before completing the screenshot.
|
|
32
33
|
* @param {string} [options.waitForSelector] - CSS selector to wait for before completing the screenshot.
|
|
@@ -42,13 +43,14 @@ class UrlScreenshot extends screenshot_1.Screenshot {
|
|
|
42
43
|
* @param {boolean} [options.generateDocumentOutline] - Whether to generate document outline.
|
|
43
44
|
* @returns {Promise<Buffer>} A Promise resolving to the image buffer.
|
|
44
45
|
*/
|
|
45
|
-
async capture({ url, properties, emulatedMediaType, waitDelay, waitForExpression, waitForSelector, extraHttpHeaders, failOnHttpStatusCodes, failOnConsoleExceptions, failOnResourceHttpStatusCodes, ignoreResourceHttpStatusDomains, failOnResourceLoadingFailed, skipNetworkIdleEvent, optimizeForSpeed, cookies, generateDocumentOutline, userPassword, ownerPassword, embeds }) {
|
|
46
|
+
async capture({ url, properties, emulatedMediaType, emulatedMediaFeatures, waitDelay, waitForExpression, waitForSelector, extraHttpHeaders, failOnHttpStatusCodes, failOnConsoleExceptions, failOnResourceHttpStatusCodes, ignoreResourceHttpStatusDomains, failOnResourceLoadingFailed, skipNetworkIdleEvent, optimizeForSpeed, cookies, generateDocumentOutline, userPassword, ownerPassword, embeds }) {
|
|
46
47
|
const _url = new url_1.URL(url);
|
|
47
48
|
const data = new FormData();
|
|
48
49
|
data.append('url', _url.href);
|
|
49
50
|
await screenshot_utils_1.ScreenshotUtils.customize(data, {
|
|
50
51
|
properties,
|
|
51
52
|
emulatedMediaType,
|
|
53
|
+
emulatedMediaFeatures,
|
|
52
54
|
waitDelay,
|
|
53
55
|
waitForExpression,
|
|
54
56
|
waitForSelector,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"url.screenshot.js","sourceRoot":"","sources":["../../../src/chromium/screenshots/url.screenshot.ts"],"names":[],"mappings":";;;AAAA,6BAA0B;AAE1B,yCAA8C;AAE9C,gEAA4D;AAC5D,6CAA0C;AAC1C,mDAA8D;AAE9D;;;;;GAKG;AACH,MAAa,aAAc,SAAQ,uBAAU;IACzC;;;OAGG;IACH;QACI,KAAK,CAAC,2BAAa,CAAC,GAAG,CAAC,CAAC;IAC7B,CAAC;IAED
|
|
1
|
+
{"version":3,"file":"url.screenshot.js","sourceRoot":"","sources":["../../../src/chromium/screenshots/url.screenshot.ts"],"names":[],"mappings":";;;AAAA,6BAA0B;AAE1B,yCAA8C;AAE9C,gEAA4D;AAC5D,6CAA0C;AAC1C,mDAA8D;AAE9D;;;;;GAKG;AACH,MAAa,aAAc,SAAQ,uBAAU;IACzC;;;OAGG;IACH;QACI,KAAK,CAAC,2BAAa,CAAC,GAAG,CAAC,CAAC;IAC7B,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,KAAK,CAAC,OAAO,CAAC,EACV,GAAG,EACH,UAAU,EACV,iBAAiB,EACjB,qBAAqB,EACrB,SAAS,EACT,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,qBAAqB,EACrB,uBAAuB,EACvB,6BAA6B,EAC7B,+BAA+B,EAC/B,2BAA2B,EAC3B,oBAAoB,EACpB,gBAAgB,EAChB,OAAO,EACP,uBAAuB,EACvB,YAAY,EACZ,aAAa,EACb,MAAM,EACa;QACnB,MAAM,IAAI,GAAG,IAAI,SAAG,CAAC,GAAG,CAAC,CAAC;QAC1B,MAAM,IAAI,GAAG,IAAI,QAAQ,EAAE,CAAC;QAE5B,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;QAE9B,MAAM,kCAAe,CAAC,SAAS,CAAC,IAAI,EAAE;YAClC,UAAU;YACV,iBAAiB;YACjB,qBAAqB;YACrB,SAAS;YACT,iBAAiB;YACjB,eAAe;YACf,gBAAgB;YAChB,qBAAqB;YACrB,uBAAuB;YACvB,6BAA6B;YAC7B,+BAA+B;YAC/B,2BAA2B;YAC3B,oBAAoB;YACpB,gBAAgB;YAChB,OAAO;YACP,uBAAuB;YACvB,YAAY;YACZ,aAAa;YACb,MAAM;SACT,CAAC,CAAC;QAEH,OAAO,uBAAc,CAAC,KAAK,CACvB,IAAI,CAAC,QAAQ,EACb,IAAI,EACJ,wBAAU,CAAC,gCAAgC,EAAE,EAC7C,wBAAU,CAAC,gCAAgC,EAAE,EAC7C,wBAAU,CAAC,oBAAoB,EAAE,CACpC,CAAC;IACN,CAAC;CACJ;AAzFD,sCAyFC"}
|
|
@@ -4,6 +4,13 @@ import { PathLikeOrReadStream } from '../../common';
|
|
|
4
4
|
* Utility class for handling common tasks related to conversion.
|
|
5
5
|
*/
|
|
6
6
|
export declare class ConverterUtils {
|
|
7
|
+
/**
|
|
8
|
+
* Validates if a value is a valid unit string (e.g., "72pt", "1in", "25.4mm").
|
|
9
|
+
*
|
|
10
|
+
* @param {string} value - The value to validate.
|
|
11
|
+
* @returns {boolean} True if the value matches the expected unit format.
|
|
12
|
+
*/
|
|
13
|
+
private static isValidUnitString;
|
|
7
14
|
/**
|
|
8
15
|
* Adds page properties to the FormData object based on the provided PageProperties.
|
|
9
16
|
*
|
|
@@ -12,6 +12,15 @@ const common_1 = require("../../common");
|
|
|
12
12
|
* Utility class for handling common tasks related to conversion.
|
|
13
13
|
*/
|
|
14
14
|
class ConverterUtils {
|
|
15
|
+
/**
|
|
16
|
+
* Validates if a value is a valid unit string (e.g., "72pt", "1in", "25.4mm").
|
|
17
|
+
*
|
|
18
|
+
* @param {string} value - The value to validate.
|
|
19
|
+
* @returns {boolean} True if the value matches the expected unit format.
|
|
20
|
+
*/
|
|
21
|
+
static isValidUnitString(value) {
|
|
22
|
+
return /^\d+(\.\d+)?(pt|px|in|mm|cm|pc)$/.test(value);
|
|
23
|
+
}
|
|
15
24
|
/**
|
|
16
25
|
* Adds page properties to the FormData object based on the provided PageProperties.
|
|
17
26
|
*
|
|
@@ -23,20 +32,54 @@ class ConverterUtils {
|
|
|
23
32
|
data.append('singlePage', String(pageProperties.singlePage));
|
|
24
33
|
}
|
|
25
34
|
if (pageProperties.size) {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
35
|
+
const { width, height } = pageProperties.size;
|
|
36
|
+
// Validate based on type
|
|
37
|
+
if (typeof width === 'number') {
|
|
38
|
+
common_1.GotenbergUtils.assert(width >= 1.0, 'width is smaller than the minimum printing requirement (1.0 in)');
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
common_1.GotenbergUtils.assert(ConverterUtils.isValidUnitString(width), 'width must be a valid unit string (e.g., "72pt", "96px", "1in", "25.4mm", "2.54cm", "6pc")');
|
|
42
|
+
}
|
|
43
|
+
if (typeof height === 'number') {
|
|
44
|
+
common_1.GotenbergUtils.assert(height >= 1.5, 'height is smaller than the minimum printing requirement (1.5 in)');
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
common_1.GotenbergUtils.assert(ConverterUtils.isValidUnitString(height), 'height must be a valid unit string (e.g., "72pt", "96px", "1in", "25.4mm", "2.54cm", "6pc")');
|
|
48
|
+
}
|
|
49
|
+
data.append('paperWidth', width);
|
|
50
|
+
data.append('paperHeight', height);
|
|
30
51
|
}
|
|
31
52
|
if (pageProperties.margins) {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
53
|
+
const { top, bottom, left, right } = pageProperties.margins;
|
|
54
|
+
// Validate each margin based on type
|
|
55
|
+
if (typeof top === 'number') {
|
|
56
|
+
common_1.GotenbergUtils.assert(top >= 0, 'marginTop cannot be negative');
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
common_1.GotenbergUtils.assert(ConverterUtils.isValidUnitString(top), 'marginTop must be a valid unit string (e.g., "72pt", "96px", "1in", "25.4mm", "2.54cm", "6pc")');
|
|
60
|
+
}
|
|
61
|
+
if (typeof bottom === 'number') {
|
|
62
|
+
common_1.GotenbergUtils.assert(bottom >= 0, 'marginBottom cannot be negative');
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
common_1.GotenbergUtils.assert(ConverterUtils.isValidUnitString(bottom), 'marginBottom must be a valid unit string (e.g., "72pt", "96px", "1in", "25.4mm", "2.54cm", "6pc")');
|
|
66
|
+
}
|
|
67
|
+
if (typeof left === 'number') {
|
|
68
|
+
common_1.GotenbergUtils.assert(left >= 0, 'marginLeft cannot be negative');
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
common_1.GotenbergUtils.assert(ConverterUtils.isValidUnitString(left), 'marginLeft must be a valid unit string (e.g., "72pt", "96px", "1in", "25.4mm", "2.54cm", "6pc")');
|
|
72
|
+
}
|
|
73
|
+
if (typeof right === 'number') {
|
|
74
|
+
common_1.GotenbergUtils.assert(right >= 0, 'marginRight cannot be negative');
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
common_1.GotenbergUtils.assert(ConverterUtils.isValidUnitString(right), 'marginRight must be a valid unit string (e.g., "72pt", "96px", "1in", "25.4mm", "2.54cm", "6pc")');
|
|
78
|
+
}
|
|
79
|
+
data.append('marginTop', top);
|
|
80
|
+
data.append('marginBottom', bottom);
|
|
81
|
+
data.append('marginLeft', left);
|
|
82
|
+
data.append('marginRight', right);
|
|
40
83
|
}
|
|
41
84
|
if (pageProperties.preferCssPageSize) {
|
|
42
85
|
data.append('preferCssPageSize', String(pageProperties.preferCssPageSize));
|
|
@@ -113,6 +156,9 @@ class ConverterUtils {
|
|
|
113
156
|
if (options.emulatedMediaType) {
|
|
114
157
|
data.append('emulatedMediaType', options.emulatedMediaType);
|
|
115
158
|
}
|
|
159
|
+
if (options.emulatedMediaFeatures?.length) {
|
|
160
|
+
data.append('emulatedMediaFeatures', JSON.stringify(options.emulatedMediaFeatures));
|
|
161
|
+
}
|
|
116
162
|
if (options.properties) {
|
|
117
163
|
ConverterUtils.addPageProperties(data, options.properties);
|
|
118
164
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"converter.utils.js","sourceRoot":"","sources":["../../../src/chromium/utils/converter.utils.ts"],"names":[],"mappings":";;;;;;AAAA,2BAAiE;AACjE,gDAAwB;AACxB,qDAA6C;AAM7C,yCAAoE;AAEpE;;GAEG;AACH,MAAa,cAAc;IACvB;;;;;OAKG;IACI,MAAM,CAAC,iBAAiB,CAC3B,IAAc,EACd,cAA8B;QAE9B,IAAI,cAAc,CAAC,UAAU,EAAE,CAAC;YAC5B,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,CAAC;QACjE,CAAC;QAED,IAAI,cAAc,CAAC,IAAI,EAAE,CAAC;YACtB,
|
|
1
|
+
{"version":3,"file":"converter.utils.js","sourceRoot":"","sources":["../../../src/chromium/utils/converter.utils.ts"],"names":[],"mappings":";;;;;;AAAA,2BAAiE;AACjE,gDAAwB;AACxB,qDAA6C;AAM7C,yCAAoE;AAEpE;;GAEG;AACH,MAAa,cAAc;IACvB;;;;;OAKG;IACK,MAAM,CAAC,iBAA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AK,OAAO,EAC9B,8CAA8C,CACjD,CAAC;gBACF,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;YAC3D,CAAC;QACL,CAAC;QAED,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC;YACvB,IAAI,CAAC,MAAM,CAAC,cAAc,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;QACtD,CAAC;QAED,IAAI,OAAO,CAAC,aAAa,EAAE,CAAC;YACxB,IAAI,CAAC,MAAM,CAAC,eAAe,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;QACxD,CAAC;QAED,IAAI,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC9C,MAAM,cAAc,CAAC,qBAAqB,CACtC,OAAO,CAAC,MAAM,EACd,IAAI,EACJ,QAAQ,CACX,CAAC;QACN,CAAC;IACL,CAAC;CACJ;AA/VD,wCA+VC"}
|
|
@@ -75,6 +75,9 @@ class ScreenshotUtils {
|
|
|
75
75
|
if (options.emulatedMediaType) {
|
|
76
76
|
data.append('emulatedMediaType', options.emulatedMediaType);
|
|
77
77
|
}
|
|
78
|
+
if (options.emulatedMediaFeatures?.length) {
|
|
79
|
+
data.append('emulatedMediaFeatures', JSON.stringify(options.emulatedMediaFeatures));
|
|
80
|
+
}
|
|
78
81
|
if (options.properties) {
|
|
79
82
|
ScreenshotUtils.addImageProperties(data, options.properties);
|
|
80
83
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"screenshot.utils.js","sourceRoot":"","sources":["../../../src/chromium/utils/screenshot.utils.ts"],"names":[],"mappings":";;;;;;AAAA,2BAAiE;AACjE,gDAAwB;AACxB,qDAA6C;AAO7C,yCAAoE;AAEpE;;GAEG;AACH,MAAa,eAAe;IACxB;;;;;OAKG;IACI,MAAM,CAAC,kBAAkB,CAC5B,IAAc,EACd,e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M,EACd,IAAI,EACJ,QAAQ,CACX,CAAC;QACN,CAAC;IACL,CAAC;CACJ;
|
|
1
|
+
{"version":3,"file":"screenshot.utils.js","sourceRoot":"","sources":["../../../src/chromium/utils/screenshot.utils.ts"],"names":[],"mappings":";;;;;;AAAA,2BAAiE;AACjE,gDAAwB;AACxB,qDAA6C;AAO7C,yCAAoE;AAEpE;;GAEG;AACH,MAAa,eAAe;IACxB;;;;;OAKG;IACI,MAAM,CAAC,kBAAkB,CAC5B,IAAc,EACd,eAAgC;QAEhC,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;QAE9C,IAAI,eAAe,CAAC,OAAO,EAAE,CAAC;YAC1B,uBAAc,CAAC,MAAM,CACjB,eAAe,CAAC,MAAM,KAAK,MAAM,EACjC,+DAA+D,CAClE,CAAC;YACF,uBAAc,CAAC,MAAM,CACjB,eAAe,CAAC,OAAO,IAAI,CAAC,IAAI,eAAe,CAAC,OAAO,IAAI,GAAG,EAC9D,wEAAwE,CAC3E,CAAC;YAEF,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,eAAe,CAAC,OAAO,CAAC,CAAC;QACpD,CAAC;QAED,IAAI,eAAe,CAAC,cAAc,EAAE,CAAC;YACjC,IAAI,CAAC,MAAM,CACP,gBAAgB,EAChB,MAAM,CAAC,eAAe,CAAC,cAAc,CAAC,CACzC,CAAC;QACN,CAAC;QAED,IAAI,eAAe,CAAC,KAAK,EAAE,CAAC;YACxB,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,eAAe,CAAC,KAAK,CAAC,CAAC;QAChD,CAAC;QAED,IAAI,eAAe,CAAC,MAAM,EAAE,CAAC;YACzB,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;QAClD,CAAC;QAED,IAAI,eAAe,CAAC,IAAI,EAAE,CAAC;YACvB,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,eA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,CAAC,MAAM,CACP,yBAAyB,EACzB,MAAM,CAAC,OAAO,CAAC,uBAAuB,CAAC,CAC1C,CAAC;QACN,CAAC;QAED,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC;YACvB,IAAI,CAAC,MAAM,CAAC,cAAc,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;QACtD,CAAC;QAED,IAAI,OAAO,CAAC,aAAa,EAAE,CAAC;YACxB,IAAI,CAAC,MAAM,CAAC,eAAe,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;QACxD,CAAC;QAED,IAAI,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC9C,MAAM,eAAe,CAAC,qBAAqB,CACvC,OAAO,CAAC,MAAM,EACd,IAAI,EACJ,QAAQ,CACX,CAAC;QACN,CAAC;IACL,CAAC;CACJ;AAzMD,0CAyMC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "chromiumly",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.3.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",
|
|
@@ -45,18 +45,18 @@
|
|
|
45
45
|
}
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@babel/core": "7.
|
|
48
|
+
"@babel/core": "7.29.0",
|
|
49
49
|
"@babel/preset-typescript": "7.28.5",
|
|
50
50
|
"@commitlint/cli": "^20.0.0",
|
|
51
51
|
"@commitlint/config-conventional": "^20.0.0",
|
|
52
52
|
"@commitlint/cz-commitlint": "^20.0.0",
|
|
53
|
-
"@release-it/conventional-changelog": "10.0.
|
|
53
|
+
"@release-it/conventional-changelog": "10.0.5",
|
|
54
54
|
"@types/config": "3.3.5",
|
|
55
55
|
"@types/dotenv": "8.2.3",
|
|
56
56
|
"@types/jest": "30.0.0",
|
|
57
|
-
"@types/node": "24.10.
|
|
58
|
-
"@typescript-eslint/eslint-plugin": "8.
|
|
59
|
-
"@typescript-eslint/parser": "8.
|
|
57
|
+
"@types/node": "24.10.13",
|
|
58
|
+
"@typescript-eslint/eslint-plugin": "8.56.0",
|
|
59
|
+
"@typescript-eslint/parser": "8.56.0",
|
|
60
60
|
"commitizen": "4.3.1",
|
|
61
61
|
"eslint": "8.57.0",
|
|
62
62
|
"eslint-config-prettier": "^10.0.0",
|