@browserless.io/browserless 2.3.0-beta-1 → 2.3.0-beta-2
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 +2 -2
- package/bin/browserless.js +47 -18
- package/bin/scaffold/README.md +50 -0
- package/bin/scaffold/src/hello-world.http.ts +2 -1
- package/build/browserless.d.ts +3 -5
- package/build/browserless.js +17 -11
- package/build/browsers/chrome.cdp.js +1 -1
- package/build/browsers/chrome.playwright.js +1 -1
- package/build/browsers/index.d.ts +1 -0
- package/build/browsers/index.js +4 -1
- package/build/data/classes.json +1 -1
- package/build/data/selectors.json +1 -1
- package/build/exports.d.ts +24 -38
- package/build/exports.js +25 -44
- package/build/limiter.d.ts +2 -1
- package/build/limiter.js +6 -3
- package/build/routes/chrome/http/content.post.body.json +8 -8
- package/build/routes/chrome/http/content.post.d.ts +2 -1
- package/build/routes/chrome/http/content.post.js +3 -2
- package/build/routes/chrome/http/download.post.body.json +11 -489
- package/build/routes/chrome/http/download.post.d.ts +2 -1
- package/build/routes/chrome/http/download.post.js +3 -2
- package/build/routes/chrome/http/download.post.query.json +6 -69
- package/build/routes/chrome/http/download.post.response.json +0 -1
- package/build/routes/chrome/http/function.post.body.json +11 -489
- package/build/routes/chrome/http/function.post.d.ts +2 -1
- package/build/routes/chrome/http/function.post.js +3 -2
- package/build/routes/chrome/http/function.post.query.json +6 -69
- package/build/routes/chrome/http/function.post.response.json +0 -1
- package/build/routes/chrome/http/json-list.get.d.ts +5 -1
- package/build/routes/chrome/http/json-list.get.js +5 -1
- package/build/routes/chrome/http/json-list.get.response.json +49 -1
- package/build/routes/chrome/http/json-new.put.d.ts +5 -1
- package/build/routes/chrome/http/json-new.put.js +5 -1
- package/build/routes/chrome/http/json-new.put.response.json +41 -1
- package/build/routes/chrome/http/json-protocol.get.d.ts +5 -1
- package/build/routes/chrome/http/json-protocol.get.js +5 -1
- package/build/routes/chrome/http/json-protocol.get.response.json +3 -1
- package/build/routes/chrome/http/json-version.get.d.ts +5 -1
- package/build/routes/chrome/http/json-version.get.js +5 -1
- package/build/routes/chrome/http/json-version.get.response.json +41 -1
- package/build/routes/chrome/http/pdf.post.body.json +153 -9
- package/build/routes/chrome/http/pdf.post.d.ts +2 -1
- package/build/routes/chrome/http/pdf.post.js +3 -2
- package/build/routes/chrome/http/pdf.post.query.json +6 -69
- package/build/routes/chrome/http/performance.post.body.json +10 -494
- package/build/routes/chrome/http/performance.post.d.ts +2 -1
- package/build/routes/chrome/http/performance.post.js +3 -2
- package/build/routes/chrome/http/performance.post.query.json +6 -69
- package/build/routes/chrome/http/performance.post.response.json +3 -1
- package/build/routes/chrome/http/scrape.post.body.json +56 -9
- package/build/routes/chrome/http/scrape.post.d.ts +2 -1
- package/build/routes/chrome/http/scrape.post.js +3 -2
- package/build/routes/chrome/http/scrape.post.response.json +305 -1
- package/build/routes/chrome/http/screenshot.post.body.json +99 -9
- package/build/routes/chrome/http/screenshot.post.d.ts +2 -1
- package/build/routes/chrome/http/screenshot.post.js +3 -2
- package/build/routes/chrome/http/screenshot.post.query.json +6 -69
- package/build/routes/chrome/ws/browser.d.ts +2 -1
- package/build/routes/chrome/ws/browser.js +3 -2
- package/build/routes/chrome/ws/browser.query.json +6 -69
- package/build/routes/chrome/ws/cdp.d.ts +2 -1
- package/build/routes/chrome/ws/cdp.js +3 -2
- package/build/routes/chrome/ws/cdp.query.json +6 -69
- package/build/routes/chrome/ws/page.d.ts +3 -2
- package/build/routes/chrome/ws/page.js +3 -2
- package/build/routes/chrome/ws/page.query.json +6 -69
- package/build/routes/chrome/ws/playwright.d.ts +1 -0
- package/build/routes/chrome/ws/playwright.js +2 -1
- package/build/routes/chrome/ws/playwright.query.json +7 -90
- package/build/routes/chromium/http/content.post.body.json +8 -8
- package/build/routes/chromium/http/download.post.body.json +11 -489
- package/build/routes/chromium/http/download.post.query.json +6 -69
- package/build/routes/chromium/http/download.post.response.json +0 -1
- package/build/routes/chromium/http/function.post.body.json +11 -489
- package/build/routes/chromium/http/function.post.query.json +6 -69
- package/build/routes/chromium/http/function.post.response.json +0 -1
- package/build/routes/chromium/http/json-list.get.response.json +49 -1
- package/build/routes/chromium/http/json-new.put.response.json +41 -1
- package/build/routes/chromium/http/json-protocol.get.response.json +3 -1
- package/build/routes/chromium/http/json-version.get.response.json +41 -1
- package/build/routes/chromium/http/pdf.post.body.json +153 -9
- package/build/routes/chromium/http/pdf.post.query.json +6 -69
- package/build/routes/chromium/http/performance.post.body.json +10 -494
- package/build/routes/chromium/http/performance.post.query.json +6 -69
- package/build/routes/chromium/http/performance.post.response.json +3 -1
- package/build/routes/chromium/http/scrape.post.body.json +56 -9
- package/build/routes/chromium/http/scrape.post.response.json +305 -1
- package/build/routes/chromium/http/screenshot.post.body.json +99 -9
- package/build/routes/chromium/http/screenshot.post.query.json +6 -69
- package/build/routes/chromium/ws/browser.query.json +6 -69
- package/build/routes/chromium/ws/cdp.query.json +6 -69
- package/build/routes/chromium/ws/page.query.json +6 -69
- package/build/routes/chromium/ws/playwright.query.json +7 -90
- package/build/routes/firefox/ws/playwright.d.ts +2 -1
- package/build/routes/firefox/ws/playwright.js +3 -2
- package/build/routes/firefox/ws/playwright.query.json +30 -115
- package/build/routes/management/http/config.get.d.ts +1 -0
- package/build/routes/management/http/config.get.js +2 -1
- package/build/routes/management/http/config.get.response.json +104 -1
- package/build/routes/management/http/metrics-total.get.d.ts +1 -0
- package/build/routes/management/http/metrics-total.get.js +2 -1
- package/build/routes/management/http/metrics-total.get.response.json +69 -1
- package/build/routes/management/http/metrics.get.d.ts +1 -0
- package/build/routes/management/http/metrics.get.js +2 -1
- package/build/routes/management/http/metrics.get.response.json +91 -1
- package/build/routes/management/http/sessions.get.d.ts +1 -0
- package/build/routes/management/http/sessions.get.js +2 -1
- package/build/routes/management/http/sessions.get.response.json +232 -1
- package/build/routes/management/http/static.get.d.ts +1 -0
- package/build/routes/management/http/static.get.js +2 -1
- package/build/routes/webkit/ws/playwright.d.ts +2 -1
- package/build/routes/webkit/ws/playwright.js +3 -2
- package/build/routes/webkit/ws/playwright.query.json +7 -90
- package/build/shared/browser.ws.d.ts +2 -1
- package/build/shared/browser.ws.js +3 -2
- package/build/shared/chromium.playwright.ws.d.ts +2 -1
- package/build/shared/chromium.playwright.ws.js +3 -2
- package/build/shared/chromium.ws.d.ts +2 -1
- package/build/shared/chromium.ws.js +3 -2
- package/build/shared/content.http.d.ts +2 -1
- package/build/shared/content.http.js +3 -2
- package/build/shared/download.http.d.ts +2 -1
- package/build/shared/download.http.js +3 -2
- package/build/shared/function.http.d.ts +2 -1
- package/build/shared/function.http.js +3 -2
- package/build/shared/json-list.http.d.ts +2 -1
- package/build/shared/json-list.http.js +3 -2
- package/build/shared/json-new.http.d.ts +2 -1
- package/build/shared/json-new.http.js +3 -2
- package/build/shared/json-protocol.http.d.ts +2 -1
- package/build/shared/json-protocol.http.js +3 -2
- package/build/shared/json-version.http.d.ts +2 -1
- package/build/shared/json-version.http.js +3 -2
- package/build/shared/page.ws.d.ts +2 -1
- package/build/shared/page.ws.js +3 -2
- package/build/shared/pdf.http.d.ts +2 -1
- package/build/shared/pdf.http.js +3 -2
- package/build/shared/performance.http.d.ts +1 -0
- package/build/shared/performance.http.js +2 -1
- package/build/shared/scrape.http.d.ts +2 -1
- package/build/shared/scrape.http.js +3 -2
- package/build/shared/screenshot.http.d.ts +1 -0
- package/build/shared/screenshot.http.js +2 -1
- package/build/types.d.ts +91 -0
- package/build/types.js +54 -0
- package/build/utils.d.ts +1 -1
- package/build/utils.js +11 -6
- package/docker/chrome/Dockerfile +0 -2
- package/docker/chromium/Dockerfile +1 -4
- package/docker/firefox/Dockerfile +1 -4
- package/docker/multi/Dockerfile +2 -6
- package/docker/webkit/Dockerfile +1 -4
- package/package.json +11 -10
- package/scripts/build-open-api.js +150 -141
- package/scripts/build-schemas.js +3 -2
- package/src/browserless.ts +43 -30
- package/src/browsers/chrome.cdp.ts +1 -1
- package/src/browsers/chrome.playwright.ts +1 -1
- package/src/browsers/index.ts +5 -1
- package/src/exports.ts +25 -49
- package/src/limiter.ts +7 -3
- package/src/routes/chrome/http/content.post.ts +7 -2
- package/src/routes/chrome/http/download.post.ts +7 -2
- package/src/routes/chrome/http/function.post.ts +7 -2
- package/src/routes/chrome/http/json-list.get.ts +7 -1
- package/src/routes/chrome/http/json-new.put.ts +7 -1
- package/src/routes/chrome/http/json-protocol.get.ts +7 -1
- package/src/routes/chrome/http/json-version.get.ts +7 -1
- package/src/routes/chrome/http/pdf.post.ts +7 -2
- package/src/routes/chrome/http/performance.post.ts +7 -2
- package/src/routes/chrome/http/scrape.post.ts +7 -2
- package/src/routes/chrome/http/screenshot.post.ts +7 -2
- package/src/routes/chrome/ws/browser.ts +3 -2
- package/src/routes/chrome/ws/cdp.ts +7 -2
- package/src/routes/chrome/ws/page.ts +3 -2
- package/src/routes/chrome/ws/playwright.ts +6 -1
- package/src/routes/firefox/ws/playwright.ts +3 -1
- package/src/routes/management/http/config.get.ts +2 -0
- package/src/routes/management/http/metrics-total.get.ts +2 -0
- package/src/routes/management/http/metrics.get.ts +2 -0
- package/src/routes/management/http/sessions.get.ts +2 -0
- package/src/routes/management/http/static.get.ts +2 -0
- package/src/routes/webkit/ws/playwright.ts +3 -1
- package/src/shared/browser.ws.ts +3 -1
- package/src/shared/chromium.playwright.ws.ts +3 -1
- package/src/shared/chromium.ws.ts +3 -1
- package/src/shared/content.http.ts +3 -1
- package/src/shared/download.http.ts +3 -1
- package/src/shared/function.http.ts +3 -1
- package/src/shared/json-list.http.ts +3 -1
- package/src/shared/json-new.http.ts +3 -1
- package/src/shared/json-protocol.http.ts +3 -1
- package/src/shared/json-version.http.ts +3 -1
- package/src/shared/page.ws.ts +3 -1
- package/src/shared/pdf.http.ts +3 -1
- package/src/shared/performance.http.ts +2 -0
- package/src/shared/scrape.http.ts +3 -1
- package/src/shared/screenshot.http.ts +2 -0
- package/src/types.ts +66 -0
- package/src/utils.ts +13 -7
- package/static/docs/swagger.json +2511 -1520
- package/static/docs/swagger.min.json +6697 -0
- package/static/function/client.js +323 -323
- package/build/exports.core.d.ts +0 -24
- package/build/exports.core.js +0 -26
- package/src/exports.core.ts +0 -26
|
@@ -1,4 +1,52 @@
|
|
|
1
1
|
{
|
|
2
|
-
"type": "
|
|
2
|
+
"type": "array",
|
|
3
|
+
"items": {
|
|
4
|
+
"$ref": "#/definitions/CDPJSONPayload"
|
|
5
|
+
},
|
|
6
|
+
"definitions": {
|
|
7
|
+
"CDPJSONPayload": {
|
|
8
|
+
"type": "object",
|
|
9
|
+
"properties": {
|
|
10
|
+
"description": {
|
|
11
|
+
"description": "The description of the target. Generally the page's title.",
|
|
12
|
+
"type": "string"
|
|
13
|
+
},
|
|
14
|
+
"devtoolsFrontendUrl": {
|
|
15
|
+
"description": "The fully-qualified URL of the Devtools inspector app.",
|
|
16
|
+
"type": "string"
|
|
17
|
+
},
|
|
18
|
+
"id": {
|
|
19
|
+
"description": "A Unique Id for the underlying target.",
|
|
20
|
+
"type": "string"
|
|
21
|
+
},
|
|
22
|
+
"title": {
|
|
23
|
+
"description": "The title of the target. For pages this is the page's title.",
|
|
24
|
+
"type": "string"
|
|
25
|
+
},
|
|
26
|
+
"type": {
|
|
27
|
+
"description": "The type of target, generally \"page\" or \"background_page\".",
|
|
28
|
+
"type": "string"
|
|
29
|
+
},
|
|
30
|
+
"url": {
|
|
31
|
+
"description": "The current URL the target is consuming or visiting.",
|
|
32
|
+
"type": "string"
|
|
33
|
+
},
|
|
34
|
+
"webSocketDebuggerUrl": {
|
|
35
|
+
"description": "The target or page's WebSocket Debugger URL. Primarily used for legacy\nlibraries to connect and inspect or remote automate this target.",
|
|
36
|
+
"type": "string"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"additionalProperties": false,
|
|
40
|
+
"required": [
|
|
41
|
+
"description",
|
|
42
|
+
"devtoolsFrontendUrl",
|
|
43
|
+
"id",
|
|
44
|
+
"title",
|
|
45
|
+
"type",
|
|
46
|
+
"url",
|
|
47
|
+
"webSocketDebuggerUrl"
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
},
|
|
3
51
|
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
4
52
|
}
|
|
@@ -1 +1,5 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { ResponseSchema } from '../../../shared/json-new.http.js';
|
|
2
|
+
import { default as ChromiumJSONNewPutRoute } from '../../../shared/json-new.http.js';
|
|
3
|
+
export default class ChromeJSONNewPutRoute extends ChromiumJSONNewPutRoute {
|
|
4
|
+
name: string;
|
|
5
|
+
}
|
|
@@ -1 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { BrowserlessRoutes } from '@browserless.io/browserless';
|
|
2
|
+
import { default as ChromiumJSONNewPutRoute } from '../../../shared/json-new.http.js';
|
|
3
|
+
export default class ChromeJSONNewPutRoute extends ChromiumJSONNewPutRoute {
|
|
4
|
+
name = BrowserlessRoutes.ChromeJSONNewPutRoute;
|
|
5
|
+
}
|
|
@@ -1,4 +1,44 @@
|
|
|
1
1
|
{
|
|
2
|
-
"type": "
|
|
2
|
+
"type": "object",
|
|
3
|
+
"properties": {
|
|
4
|
+
"description": {
|
|
5
|
+
"description": "The description of the target. Generally the page's title.",
|
|
6
|
+
"type": "string"
|
|
7
|
+
},
|
|
8
|
+
"devtoolsFrontendUrl": {
|
|
9
|
+
"description": "The fully-qualified URL of the Devtools inspector app.",
|
|
10
|
+
"type": "string"
|
|
11
|
+
},
|
|
12
|
+
"id": {
|
|
13
|
+
"description": "A Unique Id for the underlying target.",
|
|
14
|
+
"type": "string"
|
|
15
|
+
},
|
|
16
|
+
"title": {
|
|
17
|
+
"description": "The title of the target. For pages this is the page's title.",
|
|
18
|
+
"type": "string"
|
|
19
|
+
},
|
|
20
|
+
"type": {
|
|
21
|
+
"description": "The type of target, generally \"page\" or \"background_page\".",
|
|
22
|
+
"type": "string"
|
|
23
|
+
},
|
|
24
|
+
"url": {
|
|
25
|
+
"description": "The current URL the target is consuming or visiting.",
|
|
26
|
+
"type": "string"
|
|
27
|
+
},
|
|
28
|
+
"webSocketDebuggerUrl": {
|
|
29
|
+
"description": "The target or page's WebSocket Debugger URL. Primarily used for legacy\nlibraries to connect and inspect or remote automate this target.",
|
|
30
|
+
"type": "string"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"additionalProperties": false,
|
|
34
|
+
"required": [
|
|
35
|
+
"description",
|
|
36
|
+
"devtoolsFrontendUrl",
|
|
37
|
+
"id",
|
|
38
|
+
"title",
|
|
39
|
+
"type",
|
|
40
|
+
"url",
|
|
41
|
+
"webSocketDebuggerUrl"
|
|
42
|
+
],
|
|
3
43
|
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
4
44
|
}
|
|
@@ -1 +1,5 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { ResponseSchema } from '../../../shared/json-protocol.http.js';
|
|
2
|
+
import { default as ChromiumJSONProtocolGetRoute } from '../../../shared/json-protocol.http.js';
|
|
3
|
+
export default class ChromeJSONProtocolGetRoute extends ChromiumJSONProtocolGetRoute {
|
|
4
|
+
name: string;
|
|
5
|
+
}
|
|
@@ -1 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { BrowserlessRoutes } from '@browserless.io/browserless';
|
|
2
|
+
import { default as ChromiumJSONProtocolGetRoute } from '../../../shared/json-protocol.http.js';
|
|
3
|
+
export default class ChromeJSONProtocolGetRoute extends ChromiumJSONProtocolGetRoute {
|
|
4
|
+
name = BrowserlessRoutes.ChromeJSONProtocolGetRoute;
|
|
5
|
+
}
|
|
@@ -1 +1,5 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { ResponseSchema } from '../../../shared/json-version.http.js';
|
|
2
|
+
import { default as ChromiumJSONVersionGetRoute } from '../../../shared/json-version.http.js';
|
|
3
|
+
export default class ChromeJSONVersionGetRoute extends ChromiumJSONVersionGetRoute {
|
|
4
|
+
name: string;
|
|
5
|
+
}
|
|
@@ -1 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { BrowserlessRoutes } from '@browserless.io/browserless';
|
|
2
|
+
import { default as ChromiumJSONVersionGetRoute } from '../../../shared/json-version.http.js';
|
|
3
|
+
export default class ChromeJSONVersionGetRoute extends ChromiumJSONVersionGetRoute {
|
|
4
|
+
name = BrowserlessRoutes.ChromeJSONVersionGetRoute;
|
|
5
|
+
}
|
|
@@ -1,4 +1,44 @@
|
|
|
1
1
|
{
|
|
2
|
-
"type": "
|
|
2
|
+
"type": "object",
|
|
3
|
+
"properties": {
|
|
4
|
+
"description": {
|
|
5
|
+
"description": "The description of the target. Generally the page's title.",
|
|
6
|
+
"type": "string"
|
|
7
|
+
},
|
|
8
|
+
"devtoolsFrontendUrl": {
|
|
9
|
+
"description": "The fully-qualified URL of the Devtools inspector app.",
|
|
10
|
+
"type": "string"
|
|
11
|
+
},
|
|
12
|
+
"id": {
|
|
13
|
+
"description": "A Unique Id for the underlying target.",
|
|
14
|
+
"type": "string"
|
|
15
|
+
},
|
|
16
|
+
"title": {
|
|
17
|
+
"description": "The title of the target. For pages this is the page's title.",
|
|
18
|
+
"type": "string"
|
|
19
|
+
},
|
|
20
|
+
"type": {
|
|
21
|
+
"description": "The type of target, generally \"page\" or \"background_page\".",
|
|
22
|
+
"type": "string"
|
|
23
|
+
},
|
|
24
|
+
"url": {
|
|
25
|
+
"description": "The current URL the target is consuming or visiting.",
|
|
26
|
+
"type": "string"
|
|
27
|
+
},
|
|
28
|
+
"webSocketDebuggerUrl": {
|
|
29
|
+
"description": "The target or page's WebSocket Debugger URL. Primarily used for legacy\nlibraries to connect and inspect or remote automate this target.",
|
|
30
|
+
"type": "string"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"additionalProperties": false,
|
|
34
|
+
"required": [
|
|
35
|
+
"description",
|
|
36
|
+
"devtoolsFrontendUrl",
|
|
37
|
+
"id",
|
|
38
|
+
"title",
|
|
39
|
+
"type",
|
|
40
|
+
"url",
|
|
41
|
+
"webSocketDebuggerUrl"
|
|
42
|
+
],
|
|
3
43
|
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
4
44
|
}
|
|
@@ -20,6 +20,9 @@
|
|
|
20
20
|
"description": "When bestAttempt is set to true, browserless attempt to proceed\nwhen \"awaited\" events fail or timeout. This includes things like\ngoto, waitForSelector, and more.",
|
|
21
21
|
"type": "boolean"
|
|
22
22
|
},
|
|
23
|
+
"blockModals": {
|
|
24
|
+
"type": "boolean"
|
|
25
|
+
},
|
|
23
26
|
"cookies": {
|
|
24
27
|
"type": "array",
|
|
25
28
|
"items": {
|
|
@@ -35,6 +38,9 @@
|
|
|
35
38
|
"html": {
|
|
36
39
|
"type": "string"
|
|
37
40
|
},
|
|
41
|
+
"options": {
|
|
42
|
+
"$ref": "#/definitions/PDFOptions"
|
|
43
|
+
},
|
|
38
44
|
"rejectRequestPattern": {
|
|
39
45
|
"type": "array",
|
|
40
46
|
"items": {
|
|
@@ -92,7 +98,6 @@
|
|
|
92
98
|
"$ref": "#/definitions/Record<string,string>"
|
|
93
99
|
},
|
|
94
100
|
"setJavaScriptEnabled": {
|
|
95
|
-
"description": "Whether or not to allow JavaScript to run on the page.",
|
|
96
101
|
"type": "boolean"
|
|
97
102
|
},
|
|
98
103
|
"url": {
|
|
@@ -355,6 +360,145 @@
|
|
|
355
360
|
],
|
|
356
361
|
"type": "string"
|
|
357
362
|
},
|
|
363
|
+
"PDFOptions": {
|
|
364
|
+
"description": "Valid options to configure PDF generation via {@link Page.pdf}.",
|
|
365
|
+
"type": "object",
|
|
366
|
+
"properties": {
|
|
367
|
+
"scale": {
|
|
368
|
+
"description": "Scales the rendering of the web page. Amount must be between `0.1` and `2`.",
|
|
369
|
+
"type": "number"
|
|
370
|
+
},
|
|
371
|
+
"displayHeaderFooter": {
|
|
372
|
+
"description": "Whether to show the header and footer.",
|
|
373
|
+
"type": "boolean"
|
|
374
|
+
},
|
|
375
|
+
"headerTemplate": {
|
|
376
|
+
"description": "HTML template for the print header. Should be valid HTML with the following\nclasses used to inject values into them:\n\n- `date` formatted print date\n\n- `title` document title\n\n- `url` document location\n\n- `pageNumber` current page number\n\n- `totalPages` total pages in the document",
|
|
377
|
+
"type": "string"
|
|
378
|
+
},
|
|
379
|
+
"footerTemplate": {
|
|
380
|
+
"description": "HTML template for the print footer. Has the same constraints and support\nfor special classes as {@link PDFOptionsPDFOptions.headerTemplate}.",
|
|
381
|
+
"type": "string"
|
|
382
|
+
},
|
|
383
|
+
"printBackground": {
|
|
384
|
+
"description": "Set to `true` to print background graphics.",
|
|
385
|
+
"type": "boolean"
|
|
386
|
+
},
|
|
387
|
+
"landscape": {
|
|
388
|
+
"description": "Whether to print in landscape orientation.",
|
|
389
|
+
"type": "boolean"
|
|
390
|
+
},
|
|
391
|
+
"pageRanges": {
|
|
392
|
+
"description": "Paper ranges to print, e.g. `1-5, 8, 11-13`.",
|
|
393
|
+
"type": "string"
|
|
394
|
+
},
|
|
395
|
+
"format": {
|
|
396
|
+
"description": "All the valid paper format types when printing a PDF.",
|
|
397
|
+
"enum": [
|
|
398
|
+
"A0",
|
|
399
|
+
"A1",
|
|
400
|
+
"A2",
|
|
401
|
+
"A3",
|
|
402
|
+
"A4",
|
|
403
|
+
"A5",
|
|
404
|
+
"A6",
|
|
405
|
+
"LEDGER",
|
|
406
|
+
"LEGAL",
|
|
407
|
+
"LETTER",
|
|
408
|
+
"Ledger",
|
|
409
|
+
"Legal",
|
|
410
|
+
"Letter",
|
|
411
|
+
"TABLOID",
|
|
412
|
+
"Tabloid",
|
|
413
|
+
"a0",
|
|
414
|
+
"a1",
|
|
415
|
+
"a2",
|
|
416
|
+
"a3",
|
|
417
|
+
"a4",
|
|
418
|
+
"a5",
|
|
419
|
+
"a6",
|
|
420
|
+
"ledger",
|
|
421
|
+
"legal",
|
|
422
|
+
"letter",
|
|
423
|
+
"tabloid"
|
|
424
|
+
],
|
|
425
|
+
"type": "string"
|
|
426
|
+
},
|
|
427
|
+
"width": {
|
|
428
|
+
"description": "Sets the width of paper. You can pass in a number or a string with a unit.",
|
|
429
|
+
"type": [
|
|
430
|
+
"string",
|
|
431
|
+
"number"
|
|
432
|
+
]
|
|
433
|
+
},
|
|
434
|
+
"height": {
|
|
435
|
+
"description": "Sets the height of paper. You can pass in a number or a string with a unit.",
|
|
436
|
+
"type": [
|
|
437
|
+
"string",
|
|
438
|
+
"number"
|
|
439
|
+
]
|
|
440
|
+
},
|
|
441
|
+
"preferCSSPageSize": {
|
|
442
|
+
"description": "Give any CSS `@page` size declared in the page priority over what is\ndeclared in the `width` or `height` or `format` option.",
|
|
443
|
+
"type": "boolean"
|
|
444
|
+
},
|
|
445
|
+
"margin": {
|
|
446
|
+
"description": "Set the PDF margins.",
|
|
447
|
+
"$ref": "#/definitions/PDFMargin"
|
|
448
|
+
},
|
|
449
|
+
"path": {
|
|
450
|
+
"description": "The path to save the file to.",
|
|
451
|
+
"type": "string"
|
|
452
|
+
},
|
|
453
|
+
"omitBackground": {
|
|
454
|
+
"description": "Hides default white background and allows generating pdfs with transparency.",
|
|
455
|
+
"type": "boolean"
|
|
456
|
+
},
|
|
457
|
+
"tagged": {
|
|
458
|
+
"description": "Generate tagged (accessible) PDF.",
|
|
459
|
+
"type": "boolean"
|
|
460
|
+
},
|
|
461
|
+
"outline": {
|
|
462
|
+
"description": "Generate document outline.",
|
|
463
|
+
"type": "boolean"
|
|
464
|
+
},
|
|
465
|
+
"timeout": {
|
|
466
|
+
"description": "Timeout in milliseconds. Pass `0` to disable timeout.",
|
|
467
|
+
"type": "number"
|
|
468
|
+
}
|
|
469
|
+
},
|
|
470
|
+
"additionalProperties": false
|
|
471
|
+
},
|
|
472
|
+
"PDFMargin": {
|
|
473
|
+
"type": "object",
|
|
474
|
+
"properties": {
|
|
475
|
+
"top": {
|
|
476
|
+
"type": [
|
|
477
|
+
"string",
|
|
478
|
+
"number"
|
|
479
|
+
]
|
|
480
|
+
},
|
|
481
|
+
"bottom": {
|
|
482
|
+
"type": [
|
|
483
|
+
"string",
|
|
484
|
+
"number"
|
|
485
|
+
]
|
|
486
|
+
},
|
|
487
|
+
"left": {
|
|
488
|
+
"type": [
|
|
489
|
+
"string",
|
|
490
|
+
"number"
|
|
491
|
+
]
|
|
492
|
+
},
|
|
493
|
+
"right": {
|
|
494
|
+
"type": [
|
|
495
|
+
"string",
|
|
496
|
+
"number"
|
|
497
|
+
]
|
|
498
|
+
}
|
|
499
|
+
},
|
|
500
|
+
"additionalProperties": false
|
|
501
|
+
},
|
|
358
502
|
"Partial<ResponseForRequest>": {
|
|
359
503
|
"type": "object",
|
|
360
504
|
"properties": {
|
|
@@ -394,14 +538,14 @@
|
|
|
394
538
|
"length": {
|
|
395
539
|
"type": "number"
|
|
396
540
|
},
|
|
397
|
-
"__@toStringTag@
|
|
541
|
+
"__@toStringTag@86180": {
|
|
398
542
|
"type": "string",
|
|
399
543
|
"const": "Uint8Array"
|
|
400
544
|
}
|
|
401
545
|
},
|
|
402
546
|
"required": [
|
|
403
547
|
"BYTES_PER_ELEMENT",
|
|
404
|
-
"__@toStringTag@
|
|
548
|
+
"__@toStringTag@86180",
|
|
405
549
|
"buffer",
|
|
406
550
|
"byteLength",
|
|
407
551
|
"byteOffset",
|
|
@@ -436,13 +580,13 @@
|
|
|
436
580
|
"byteLength": {
|
|
437
581
|
"type": "number"
|
|
438
582
|
},
|
|
439
|
-
"__@toStringTag@
|
|
583
|
+
"__@toStringTag@86180": {
|
|
440
584
|
"type": "string"
|
|
441
585
|
}
|
|
442
586
|
},
|
|
443
587
|
"additionalProperties": false,
|
|
444
588
|
"required": [
|
|
445
|
-
"__@toStringTag@
|
|
589
|
+
"__@toStringTag@86180",
|
|
446
590
|
"byteLength"
|
|
447
591
|
]
|
|
448
592
|
},
|
|
@@ -452,18 +596,18 @@
|
|
|
452
596
|
"byteLength": {
|
|
453
597
|
"type": "number"
|
|
454
598
|
},
|
|
455
|
-
"__@species@
|
|
599
|
+
"__@species@86281": {
|
|
456
600
|
"$ref": "#/definitions/SharedArrayBuffer"
|
|
457
601
|
},
|
|
458
|
-
"__@toStringTag@
|
|
602
|
+
"__@toStringTag@86180": {
|
|
459
603
|
"type": "string",
|
|
460
604
|
"const": "SharedArrayBuffer"
|
|
461
605
|
}
|
|
462
606
|
},
|
|
463
607
|
"additionalProperties": false,
|
|
464
608
|
"required": [
|
|
465
|
-
"__@species@
|
|
466
|
-
"__@toStringTag@
|
|
609
|
+
"__@species@86281",
|
|
610
|
+
"__@toStringTag@86180",
|
|
467
611
|
"byteLength"
|
|
468
612
|
]
|
|
469
613
|
},
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BodySchema, default as PDF, QuerySchema, ResponseSchema } from '../../../shared/pdf.http.js';
|
|
2
2
|
import { ChromeCDP, HTTPRoutes } from '@browserless.io/browserless';
|
|
3
|
-
export default class
|
|
3
|
+
export default class ChromePDFPostRoute extends PDF {
|
|
4
|
+
name: string;
|
|
4
5
|
browser: typeof ChromeCDP;
|
|
5
6
|
path: HTTPRoutes[];
|
|
6
7
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { default as PDF, } from '../../../shared/pdf.http.js';
|
|
2
|
-
import { ChromeCDP, HTTPRoutes } from '@browserless.io/browserless';
|
|
3
|
-
export default class
|
|
2
|
+
import { BrowserlessRoutes, ChromeCDP, HTTPRoutes, } from '@browserless.io/browserless';
|
|
3
|
+
export default class ChromePDFPostRoute extends PDF {
|
|
4
|
+
name = BrowserlessRoutes.ChromePDFPostRoute;
|
|
4
5
|
browser = ChromeCDP;
|
|
5
6
|
path = [HTTPRoutes.chromePdf];
|
|
6
7
|
}
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
-
"additionalProperties": false,
|
|
3
2
|
"type": "object",
|
|
4
3
|
"properties": {
|
|
5
|
-
"blockAds": {
|
|
6
|
-
"description": "Whether or nor to load ad-blocking extensions for the session.\nThis currently uses uBlock Origin and may cause certain sites\nto not load properly.",
|
|
7
|
-
"type": "boolean"
|
|
8
|
-
},
|
|
9
4
|
"launch": {
|
|
5
|
+
"description": "Launch options, which can be either an object\nof puppeteer.launch options or playwright.launchServer\noptions, depending on the API. Must be either JSON\nobject, or a base64-encoded JSON object.",
|
|
10
6
|
"anyOf": [
|
|
11
7
|
{
|
|
12
8
|
"$ref": "#/definitions/CDPLaunchOptions"
|
|
@@ -16,6 +12,10 @@
|
|
|
16
12
|
}
|
|
17
13
|
]
|
|
18
14
|
},
|
|
15
|
+
"blockAds": {
|
|
16
|
+
"description": "Whether or nor to load ad-blocking extensions for the session.\nThis currently uses uBlock Origin and may cause certain sites\nto not load properly.",
|
|
17
|
+
"type": "boolean"
|
|
18
|
+
},
|
|
19
19
|
"record": {
|
|
20
20
|
"description": "Whether or nor to record the session. The browser will run\nin \"head-full\" mode, and recording is started and closed\nvia the embedded browserless API. Please refer to the \"Recording\"\nsection in the live documentation site for more details.",
|
|
21
21
|
"type": "boolean"
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
"type": "string"
|
|
30
30
|
}
|
|
31
31
|
},
|
|
32
|
+
"additionalProperties": false,
|
|
32
33
|
"definitions": {
|
|
33
34
|
"CDPLaunchOptions": {
|
|
34
35
|
"type": "object",
|
|
@@ -113,70 +114,6 @@
|
|
|
113
114
|
}
|
|
114
115
|
},
|
|
115
116
|
"additionalProperties": false
|
|
116
|
-
},
|
|
117
|
-
"BrowserServerOptions": {
|
|
118
|
-
"type": "object",
|
|
119
|
-
"properties": {
|
|
120
|
-
"args": {
|
|
121
|
-
"type": "array",
|
|
122
|
-
"items": {
|
|
123
|
-
"type": "string"
|
|
124
|
-
}
|
|
125
|
-
},
|
|
126
|
-
"chromiumSandbox": {
|
|
127
|
-
"type": "boolean"
|
|
128
|
-
},
|
|
129
|
-
"devtools": {
|
|
130
|
-
"type": "boolean"
|
|
131
|
-
},
|
|
132
|
-
"downloadsPath": {
|
|
133
|
-
"type": "string"
|
|
134
|
-
},
|
|
135
|
-
"headless": {
|
|
136
|
-
"type": "boolean"
|
|
137
|
-
},
|
|
138
|
-
"ignoreDefaultArgs": {
|
|
139
|
-
"anyOf": [
|
|
140
|
-
{
|
|
141
|
-
"type": "array",
|
|
142
|
-
"items": {
|
|
143
|
-
"type": "string"
|
|
144
|
-
}
|
|
145
|
-
},
|
|
146
|
-
{
|
|
147
|
-
"type": "boolean"
|
|
148
|
-
}
|
|
149
|
-
]
|
|
150
|
-
},
|
|
151
|
-
"proxy": {
|
|
152
|
-
"type": "object",
|
|
153
|
-
"properties": {
|
|
154
|
-
"bypass": {
|
|
155
|
-
"type": "string"
|
|
156
|
-
},
|
|
157
|
-
"password": {
|
|
158
|
-
"type": "string"
|
|
159
|
-
},
|
|
160
|
-
"server": {
|
|
161
|
-
"type": "string"
|
|
162
|
-
},
|
|
163
|
-
"username": {
|
|
164
|
-
"type": "string"
|
|
165
|
-
}
|
|
166
|
-
},
|
|
167
|
-
"additionalProperties": false,
|
|
168
|
-
"required": [
|
|
169
|
-
"server"
|
|
170
|
-
]
|
|
171
|
-
},
|
|
172
|
-
"timeout": {
|
|
173
|
-
"type": "number"
|
|
174
|
-
},
|
|
175
|
-
"tracesDir": {
|
|
176
|
-
"type": "string"
|
|
177
|
-
}
|
|
178
|
-
},
|
|
179
|
-
"additionalProperties": false
|
|
180
117
|
}
|
|
181
118
|
},
|
|
182
119
|
"$schema": "http://json-schema.org/draft-07/schema#"
|