@browserless.io/browserless 2.3.0-beta-1 → 2.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/CHANGELOG.md +9 -1
- 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,235 @@
|
|
|
1
1
|
{
|
|
2
|
-
"type": "
|
|
2
|
+
"type": "array",
|
|
3
|
+
"items": {
|
|
4
|
+
"$ref": "#/definitions/BrowserlessSessionJSON"
|
|
5
|
+
},
|
|
6
|
+
"definitions": {
|
|
7
|
+
"BrowserlessSessionJSON": {
|
|
8
|
+
"type": "object",
|
|
9
|
+
"properties": {
|
|
10
|
+
"browser": {
|
|
11
|
+
"type": "string"
|
|
12
|
+
},
|
|
13
|
+
"browserId": {
|
|
14
|
+
"type": "string"
|
|
15
|
+
},
|
|
16
|
+
"id": {
|
|
17
|
+
"type": [
|
|
18
|
+
"null",
|
|
19
|
+
"string"
|
|
20
|
+
]
|
|
21
|
+
},
|
|
22
|
+
"initialConnectURL": {
|
|
23
|
+
"type": "string"
|
|
24
|
+
},
|
|
25
|
+
"killURL": {
|
|
26
|
+
"type": [
|
|
27
|
+
"null",
|
|
28
|
+
"string"
|
|
29
|
+
]
|
|
30
|
+
},
|
|
31
|
+
"launchOptions": {
|
|
32
|
+
"anyOf": [
|
|
33
|
+
{
|
|
34
|
+
"$ref": "#/definitions/CDPLaunchOptions"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"$ref": "#/definitions/BrowserServerOptions"
|
|
38
|
+
}
|
|
39
|
+
]
|
|
40
|
+
},
|
|
41
|
+
"numbConnected": {
|
|
42
|
+
"type": "number"
|
|
43
|
+
},
|
|
44
|
+
"routePath": {
|
|
45
|
+
"anyOf": [
|
|
46
|
+
{
|
|
47
|
+
"type": "array",
|
|
48
|
+
"items": {
|
|
49
|
+
"type": "string"
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"type": "string"
|
|
54
|
+
}
|
|
55
|
+
]
|
|
56
|
+
},
|
|
57
|
+
"startedOn": {
|
|
58
|
+
"type": "number"
|
|
59
|
+
},
|
|
60
|
+
"timeAliveMs": {
|
|
61
|
+
"type": "number"
|
|
62
|
+
},
|
|
63
|
+
"userDataDir": {
|
|
64
|
+
"type": [
|
|
65
|
+
"null",
|
|
66
|
+
"string"
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"additionalProperties": false,
|
|
71
|
+
"required": [
|
|
72
|
+
"browser",
|
|
73
|
+
"browserId",
|
|
74
|
+
"id",
|
|
75
|
+
"initialConnectURL",
|
|
76
|
+
"killURL",
|
|
77
|
+
"launchOptions",
|
|
78
|
+
"numbConnected",
|
|
79
|
+
"routePath",
|
|
80
|
+
"startedOn",
|
|
81
|
+
"timeAliveMs",
|
|
82
|
+
"userDataDir"
|
|
83
|
+
]
|
|
84
|
+
},
|
|
85
|
+
"CDPLaunchOptions": {
|
|
86
|
+
"type": "object",
|
|
87
|
+
"properties": {
|
|
88
|
+
"args": {
|
|
89
|
+
"type": "array",
|
|
90
|
+
"items": {
|
|
91
|
+
"type": "string"
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
"defaultViewport": {
|
|
95
|
+
"type": "object",
|
|
96
|
+
"properties": {
|
|
97
|
+
"deviceScaleFactor": {
|
|
98
|
+
"type": "number"
|
|
99
|
+
},
|
|
100
|
+
"hasTouch": {
|
|
101
|
+
"type": "boolean"
|
|
102
|
+
},
|
|
103
|
+
"height": {
|
|
104
|
+
"type": "number"
|
|
105
|
+
},
|
|
106
|
+
"isLandscape": {
|
|
107
|
+
"type": "boolean"
|
|
108
|
+
},
|
|
109
|
+
"isMobile": {
|
|
110
|
+
"type": "boolean"
|
|
111
|
+
},
|
|
112
|
+
"width": {
|
|
113
|
+
"type": "number"
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
"additionalProperties": false,
|
|
117
|
+
"required": [
|
|
118
|
+
"height",
|
|
119
|
+
"width"
|
|
120
|
+
]
|
|
121
|
+
},
|
|
122
|
+
"devtools": {
|
|
123
|
+
"type": "boolean"
|
|
124
|
+
},
|
|
125
|
+
"dumpio": {
|
|
126
|
+
"type": "boolean"
|
|
127
|
+
},
|
|
128
|
+
"headless": {
|
|
129
|
+
"enum": [
|
|
130
|
+
false,
|
|
131
|
+
"shell",
|
|
132
|
+
true
|
|
133
|
+
]
|
|
134
|
+
},
|
|
135
|
+
"ignoreDefaultArgs": {
|
|
136
|
+
"anyOf": [
|
|
137
|
+
{
|
|
138
|
+
"type": "array",
|
|
139
|
+
"items": {
|
|
140
|
+
"type": "string"
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
"type": "boolean"
|
|
145
|
+
}
|
|
146
|
+
]
|
|
147
|
+
},
|
|
148
|
+
"ignoreHTTPSErrors": {
|
|
149
|
+
"type": "boolean"
|
|
150
|
+
},
|
|
151
|
+
"slowMo": {
|
|
152
|
+
"type": "number"
|
|
153
|
+
},
|
|
154
|
+
"stealth": {
|
|
155
|
+
"type": "boolean"
|
|
156
|
+
},
|
|
157
|
+
"timeout": {
|
|
158
|
+
"type": "number"
|
|
159
|
+
},
|
|
160
|
+
"userDataDir": {
|
|
161
|
+
"type": "string"
|
|
162
|
+
},
|
|
163
|
+
"waitForInitialPage": {
|
|
164
|
+
"type": "boolean"
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
"additionalProperties": false
|
|
168
|
+
},
|
|
169
|
+
"BrowserServerOptions": {
|
|
170
|
+
"type": "object",
|
|
171
|
+
"properties": {
|
|
172
|
+
"args": {
|
|
173
|
+
"type": "array",
|
|
174
|
+
"items": {
|
|
175
|
+
"type": "string"
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
"chromiumSandbox": {
|
|
179
|
+
"type": "boolean"
|
|
180
|
+
},
|
|
181
|
+
"devtools": {
|
|
182
|
+
"type": "boolean"
|
|
183
|
+
},
|
|
184
|
+
"downloadsPath": {
|
|
185
|
+
"type": "string"
|
|
186
|
+
},
|
|
187
|
+
"headless": {
|
|
188
|
+
"type": "boolean"
|
|
189
|
+
},
|
|
190
|
+
"ignoreDefaultArgs": {
|
|
191
|
+
"anyOf": [
|
|
192
|
+
{
|
|
193
|
+
"type": "array",
|
|
194
|
+
"items": {
|
|
195
|
+
"type": "string"
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
"type": "boolean"
|
|
200
|
+
}
|
|
201
|
+
]
|
|
202
|
+
},
|
|
203
|
+
"proxy": {
|
|
204
|
+
"type": "object",
|
|
205
|
+
"properties": {
|
|
206
|
+
"bypass": {
|
|
207
|
+
"type": "string"
|
|
208
|
+
},
|
|
209
|
+
"password": {
|
|
210
|
+
"type": "string"
|
|
211
|
+
},
|
|
212
|
+
"server": {
|
|
213
|
+
"type": "string"
|
|
214
|
+
},
|
|
215
|
+
"username": {
|
|
216
|
+
"type": "string"
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
"additionalProperties": false,
|
|
220
|
+
"required": [
|
|
221
|
+
"server"
|
|
222
|
+
]
|
|
223
|
+
},
|
|
224
|
+
"timeout": {
|
|
225
|
+
"type": "number"
|
|
226
|
+
},
|
|
227
|
+
"tracesDir": {
|
|
228
|
+
"type": "string"
|
|
229
|
+
}
|
|
230
|
+
},
|
|
231
|
+
"additionalProperties": false
|
|
232
|
+
}
|
|
233
|
+
},
|
|
3
234
|
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
4
235
|
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { APITags, HTTPManagementRoutes, HTTPRoute, Methods, Request, contentTypes } from '@browserless.io/browserless';
|
|
3
3
|
import { ServerResponse } from 'http';
|
|
4
4
|
export default class StaticGetRoute extends HTTPRoute {
|
|
5
|
+
name: string;
|
|
5
6
|
accepts: contentTypes[];
|
|
6
7
|
auth: boolean;
|
|
7
8
|
browser: null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { APITags, HTTPManagementRoutes, HTTPRoute, Methods, NotFound, contentTypes, fileExists, mimeTypes, } from '@browserless.io/browserless';
|
|
1
|
+
import { APITags, BrowserlessRoutes, HTTPManagementRoutes, HTTPRoute, Methods, NotFound, contentTypes, fileExists, mimeTypes, } from '@browserless.io/browserless';
|
|
2
2
|
import { createReadStream } from 'fs';
|
|
3
3
|
import path from 'path';
|
|
4
4
|
const pathMap = new Map();
|
|
@@ -19,6 +19,7 @@ const streamFile = (debug, res, file, contentType) => new Promise((resolve, reje
|
|
|
19
19
|
.pipe(res);
|
|
20
20
|
});
|
|
21
21
|
export default class StaticGetRoute extends HTTPRoute {
|
|
22
|
+
name = BrowserlessRoutes.StaticGetRoute;
|
|
22
23
|
accepts = [contentTypes.any];
|
|
23
24
|
auth = false;
|
|
24
25
|
browser = null;
|
|
@@ -5,7 +5,8 @@ import { Duplex } from 'stream';
|
|
|
5
5
|
export interface QuerySchema extends SystemQueryParameters {
|
|
6
6
|
launch?: BrowserServerOptions | string;
|
|
7
7
|
}
|
|
8
|
-
export default class
|
|
8
|
+
export default class WebKitPlaywrightWebSocketRoute extends BrowserWebsocketRoute {
|
|
9
|
+
name: string;
|
|
9
10
|
auth: boolean;
|
|
10
11
|
browser: typeof WebkitPlaywright;
|
|
11
12
|
concurrency: boolean;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { APITags, BadRequest, BrowserWebsocketRoute, WebkitPlaywright, WebsocketRoutes, } from '@browserless.io/browserless';
|
|
2
|
-
export default class
|
|
1
|
+
import { APITags, BadRequest, BrowserWebsocketRoute, BrowserlessRoutes, WebkitPlaywright, WebsocketRoutes, } from '@browserless.io/browserless';
|
|
2
|
+
export default class WebKitPlaywrightWebSocketRoute extends BrowserWebsocketRoute {
|
|
3
|
+
name = BrowserlessRoutes.WebKitPlaywrightWebSocketRoute;
|
|
3
4
|
auth = true;
|
|
4
5
|
browser = WebkitPlaywright;
|
|
5
6
|
concurrency = true;
|
|
@@ -1,21 +1,21 @@
|
|
|
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
|
-
"$ref": "#/definitions/
|
|
8
|
+
"$ref": "#/definitions/BrowserServerOptions"
|
|
13
9
|
},
|
|
14
10
|
{
|
|
15
11
|
"type": "string"
|
|
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,91 +29,8 @@
|
|
|
29
29
|
"type": "string"
|
|
30
30
|
}
|
|
31
31
|
},
|
|
32
|
+
"additionalProperties": false,
|
|
32
33
|
"definitions": {
|
|
33
|
-
"CDPLaunchOptions": {
|
|
34
|
-
"type": "object",
|
|
35
|
-
"properties": {
|
|
36
|
-
"args": {
|
|
37
|
-
"type": "array",
|
|
38
|
-
"items": {
|
|
39
|
-
"type": "string"
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
"defaultViewport": {
|
|
43
|
-
"type": "object",
|
|
44
|
-
"properties": {
|
|
45
|
-
"deviceScaleFactor": {
|
|
46
|
-
"type": "number"
|
|
47
|
-
},
|
|
48
|
-
"hasTouch": {
|
|
49
|
-
"type": "boolean"
|
|
50
|
-
},
|
|
51
|
-
"height": {
|
|
52
|
-
"type": "number"
|
|
53
|
-
},
|
|
54
|
-
"isLandscape": {
|
|
55
|
-
"type": "boolean"
|
|
56
|
-
},
|
|
57
|
-
"isMobile": {
|
|
58
|
-
"type": "boolean"
|
|
59
|
-
},
|
|
60
|
-
"width": {
|
|
61
|
-
"type": "number"
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
"additionalProperties": false,
|
|
65
|
-
"required": [
|
|
66
|
-
"height",
|
|
67
|
-
"width"
|
|
68
|
-
]
|
|
69
|
-
},
|
|
70
|
-
"devtools": {
|
|
71
|
-
"type": "boolean"
|
|
72
|
-
},
|
|
73
|
-
"dumpio": {
|
|
74
|
-
"type": "boolean"
|
|
75
|
-
},
|
|
76
|
-
"headless": {
|
|
77
|
-
"enum": [
|
|
78
|
-
false,
|
|
79
|
-
"shell",
|
|
80
|
-
true
|
|
81
|
-
]
|
|
82
|
-
},
|
|
83
|
-
"ignoreDefaultArgs": {
|
|
84
|
-
"anyOf": [
|
|
85
|
-
{
|
|
86
|
-
"type": "array",
|
|
87
|
-
"items": {
|
|
88
|
-
"type": "string"
|
|
89
|
-
}
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
"type": "boolean"
|
|
93
|
-
}
|
|
94
|
-
]
|
|
95
|
-
},
|
|
96
|
-
"ignoreHTTPSErrors": {
|
|
97
|
-
"type": "boolean"
|
|
98
|
-
},
|
|
99
|
-
"slowMo": {
|
|
100
|
-
"type": "number"
|
|
101
|
-
},
|
|
102
|
-
"stealth": {
|
|
103
|
-
"type": "boolean"
|
|
104
|
-
},
|
|
105
|
-
"timeout": {
|
|
106
|
-
"type": "number"
|
|
107
|
-
},
|
|
108
|
-
"userDataDir": {
|
|
109
|
-
"type": "string"
|
|
110
|
-
},
|
|
111
|
-
"waitForInitialPage": {
|
|
112
|
-
"type": "boolean"
|
|
113
|
-
}
|
|
114
|
-
},
|
|
115
|
-
"additionalProperties": false
|
|
116
|
-
},
|
|
117
34
|
"BrowserServerOptions": {
|
|
118
35
|
"type": "object",
|
|
119
36
|
"properties": {
|
|
@@ -5,7 +5,8 @@ import { Duplex } from 'stream';
|
|
|
5
5
|
export interface QuerySchema extends SystemQueryParameters {
|
|
6
6
|
launch?: CDPLaunchOptions | string;
|
|
7
7
|
}
|
|
8
|
-
export default class
|
|
8
|
+
export default class ChromiumBrowserWebSocketRoute extends BrowserWebsocketRoute {
|
|
9
|
+
name: string;
|
|
9
10
|
auth: boolean;
|
|
10
11
|
browser: typeof ChromiumCDP;
|
|
11
12
|
concurrency: boolean;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { APITags, BrowserWebsocketRoute, ChromiumCDP, WebsocketRoutes, dedent, } from '@browserless.io/browserless';
|
|
2
|
-
export default class
|
|
1
|
+
import { APITags, BrowserWebsocketRoute, BrowserlessRoutes, ChromiumCDP, WebsocketRoutes, dedent, } from '@browserless.io/browserless';
|
|
2
|
+
export default class ChromiumBrowserWebSocketRoute extends BrowserWebsocketRoute {
|
|
3
|
+
name = BrowserlessRoutes.ChromiumBrowserWebSocketRoute;
|
|
3
4
|
auth = true;
|
|
4
5
|
browser = ChromiumCDP;
|
|
5
6
|
concurrency = true;
|
|
@@ -5,7 +5,8 @@ import { Duplex } from 'stream';
|
|
|
5
5
|
export interface QuerySchema extends SystemQueryParameters {
|
|
6
6
|
launch?: BrowserServerOptions | string;
|
|
7
7
|
}
|
|
8
|
-
export default class
|
|
8
|
+
export default class ChromiumPlaywrightWebSocketRoute extends BrowserWebsocketRoute {
|
|
9
|
+
name: string;
|
|
9
10
|
auth: boolean;
|
|
10
11
|
browser: typeof ChromiumPlaywright;
|
|
11
12
|
concurrency: boolean;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { APITags, BadRequest, BrowserWebsocketRoute, ChromiumPlaywright, WebsocketRoutes, } from '@browserless.io/browserless';
|
|
2
|
-
export default class
|
|
1
|
+
import { APITags, BadRequest, BrowserWebsocketRoute, BrowserlessRoutes, ChromiumPlaywright, WebsocketRoutes, } from '@browserless.io/browserless';
|
|
2
|
+
export default class ChromiumPlaywrightWebSocketRoute extends BrowserWebsocketRoute {
|
|
3
|
+
name = BrowserlessRoutes.ChromiumPlaywrightWebSocketRoute;
|
|
3
4
|
auth = true;
|
|
4
5
|
browser = ChromiumPlaywright;
|
|
5
6
|
concurrency = true;
|
|
@@ -5,7 +5,8 @@ import { Duplex } from 'stream';
|
|
|
5
5
|
export interface QuerySchema extends SystemQueryParameters {
|
|
6
6
|
launch?: CDPLaunchOptions | string;
|
|
7
7
|
}
|
|
8
|
-
export default class
|
|
8
|
+
export default class ChromiumCDPWebSocketRoute extends BrowserWebsocketRoute {
|
|
9
|
+
name: string;
|
|
9
10
|
auth: boolean;
|
|
10
11
|
browser: typeof ChromiumCDP;
|
|
11
12
|
concurrency: boolean;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { APITags, BrowserWebsocketRoute, ChromiumCDP, WebsocketRoutes, } from '@browserless.io/browserless';
|
|
2
|
-
export default class
|
|
1
|
+
import { APITags, BrowserWebsocketRoute, BrowserlessRoutes, ChromiumCDP, WebsocketRoutes, } from '@browserless.io/browserless';
|
|
2
|
+
export default class ChromiumCDPWebSocketRoute extends BrowserWebsocketRoute {
|
|
3
|
+
name = BrowserlessRoutes.ChromiumCDPWebSocketRoute;
|
|
3
4
|
auth = true;
|
|
4
5
|
browser = ChromiumCDP;
|
|
5
6
|
concurrency = true;
|
|
@@ -32,7 +32,8 @@ export type ResponseSchema = string;
|
|
|
32
32
|
export type QuerySchema = SystemQueryParameters & {
|
|
33
33
|
launch?: CDPLaunchOptions | string;
|
|
34
34
|
};
|
|
35
|
-
export default class
|
|
35
|
+
export default class ChromiumContentPostRoute extends BrowserHTTPRoute {
|
|
36
|
+
name: string;
|
|
36
37
|
accepts: contentTypes[];
|
|
37
38
|
auth: boolean;
|
|
38
39
|
browser: typeof ChromiumCDP;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { APITags, BadRequest, BrowserHTTPRoute, ChromiumCDP, HTTPRoutes, Methods, bestAttemptCatch, contentTypes, noop, sleep, waitForEvent as waitForEvt, waitForFunction as waitForFn, writeResponse, } from '@browserless.io/browserless';
|
|
2
|
-
export default class
|
|
1
|
+
import { APITags, BadRequest, BrowserHTTPRoute, BrowserlessRoutes, ChromiumCDP, HTTPRoutes, Methods, bestAttemptCatch, contentTypes, noop, sleep, waitForEvent as waitForEvt, waitForFunction as waitForFn, writeResponse, } from '@browserless.io/browserless';
|
|
2
|
+
export default class ChromiumContentPostRoute extends BrowserHTTPRoute {
|
|
3
|
+
name = BrowserlessRoutes.ChromiumContentPostRoute;
|
|
3
4
|
accepts = [contentTypes.json];
|
|
4
5
|
auth = true;
|
|
5
6
|
browser = ChromiumCDP;
|
|
@@ -14,7 +14,8 @@ export interface QuerySchema extends SystemQueryParameters {
|
|
|
14
14
|
* themselves, so there isn't a static response type for this API.
|
|
15
15
|
*/
|
|
16
16
|
export type ResponseSchema = unknown;
|
|
17
|
-
export default class
|
|
17
|
+
export default class ChromiumDownloadPostRoute extends BrowserHTTPRoute {
|
|
18
|
+
name: string;
|
|
18
19
|
accepts: contentTypes[];
|
|
19
20
|
auth: boolean;
|
|
20
21
|
browser: typeof ChromiumCDP;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { APITags, BrowserHTTPRoute, ChromiumCDP, HTTPRoutes, Methods, NotFound, contentTypes, dedent, id, mimeTypes, once, sleep, } from '@browserless.io/browserless';
|
|
1
|
+
import { APITags, BrowserHTTPRoute, BrowserlessRoutes, ChromiumCDP, HTTPRoutes, Methods, NotFound, contentTypes, dedent, id, mimeTypes, once, sleep, } from '@browserless.io/browserless';
|
|
2
2
|
import { mkdir, readdir } from 'fs/promises';
|
|
3
3
|
import { createReadStream } from 'fs';
|
|
4
4
|
import { deleteAsync } from 'del';
|
|
5
5
|
import functionHandler from './utils/function/handler.js';
|
|
6
6
|
import path from 'path';
|
|
7
|
-
export default class
|
|
7
|
+
export default class ChromiumDownloadPostRoute extends BrowserHTTPRoute {
|
|
8
|
+
name = BrowserlessRoutes.ChromiumDownloadPostRoute;
|
|
8
9
|
accepts = [contentTypes.json, contentTypes.javascript];
|
|
9
10
|
auth = true;
|
|
10
11
|
browser = ChromiumCDP;
|
|
@@ -16,7 +16,8 @@ export interface QuerySchema extends SystemQueryParameters {
|
|
|
16
16
|
* by type (HTML data is "text/html", Objects are "application/json")
|
|
17
17
|
*/
|
|
18
18
|
export type ResponseSchema = unknown;
|
|
19
|
-
export default class
|
|
19
|
+
export default class ChromiumFunctionPostRoute extends BrowserHTTPRoute {
|
|
20
|
+
name: string;
|
|
20
21
|
accepts: contentTypes[];
|
|
21
22
|
auth: boolean;
|
|
22
23
|
browser: typeof ChromiumCDP;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { APITags, BadRequest, BrowserHTTPRoute, ChromiumCDP, HTTPRoutes, Methods, contentTypes, dedent, writeResponse, } from '@browserless.io/browserless';
|
|
1
|
+
import { APITags, BadRequest, BrowserHTTPRoute, BrowserlessRoutes, ChromiumCDP, HTTPRoutes, Methods, contentTypes, dedent, writeResponse, } from '@browserless.io/browserless';
|
|
2
2
|
import Stream from 'stream';
|
|
3
3
|
import { fileTypeFromBuffer } from 'file-type';
|
|
4
4
|
import functionHandler from './utils/function/handler.js';
|
|
5
|
-
export default class
|
|
5
|
+
export default class ChromiumFunctionPostRoute extends BrowserHTTPRoute {
|
|
6
|
+
name = BrowserlessRoutes.ChromiumFunctionPostRoute;
|
|
6
7
|
accepts = [contentTypes.json, contentTypes.javascript];
|
|
7
8
|
auth = true;
|
|
8
9
|
browser = ChromiumCDP;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { APITags, CDPJSONPayload, HTTPRoute, HTTPRoutes, Methods, Request, Response, contentTypes } from '@browserless.io/browserless';
|
|
2
2
|
export type ResponseSchema = Array<CDPJSONPayload>;
|
|
3
|
-
export default class
|
|
3
|
+
export default class ChromiumJSONListGetRoute extends HTTPRoute {
|
|
4
|
+
name: string;
|
|
4
5
|
accepts: contentTypes[];
|
|
5
6
|
auth: boolean;
|
|
6
7
|
browser: null;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { APITags, HTTPRoute, HTTPRoutes, Methods, contentTypes, dedent, jsonResponse, } from '@browserless.io/browserless';
|
|
2
|
-
export default class
|
|
1
|
+
import { APITags, BrowserlessRoutes, HTTPRoute, HTTPRoutes, Methods, contentTypes, dedent, jsonResponse, } from '@browserless.io/browserless';
|
|
2
|
+
export default class ChromiumJSONListGetRoute extends HTTPRoute {
|
|
3
|
+
name = BrowserlessRoutes.ChromiumJSONListGetRoute;
|
|
3
4
|
accepts = [contentTypes.any];
|
|
4
5
|
auth = true;
|
|
5
6
|
browser = null;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { APITags, CDPJSONPayload, HTTPRoute, HTTPRoutes, Methods, Request, Response, contentTypes } from '@browserless.io/browserless';
|
|
2
2
|
export type ResponseSchema = CDPJSONPayload;
|
|
3
|
-
export default class
|
|
3
|
+
export default class ChromiumJSONNewPutRoute extends HTTPRoute {
|
|
4
|
+
name: string;
|
|
4
5
|
accepts: contentTypes[];
|
|
5
6
|
auth: boolean;
|
|
6
7
|
browser: null;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { APITags, HTTPRoute, HTTPRoutes, Methods, contentTypes, dedent, jsonResponse, pageID, } from '@browserless.io/browserless';
|
|
1
|
+
import { APITags, BrowserlessRoutes, HTTPRoute, HTTPRoutes, Methods, contentTypes, dedent, jsonResponse, pageID, } from '@browserless.io/browserless';
|
|
2
2
|
import path from 'path';
|
|
3
|
-
export default class
|
|
3
|
+
export default class ChromiumJSONNewPutRoute extends HTTPRoute {
|
|
4
|
+
name = BrowserlessRoutes.ChromiumJSONNewPutRoute;
|
|
4
5
|
accepts = [contentTypes.any];
|
|
5
6
|
auth = true;
|
|
6
7
|
browser = null;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { APITags, HTTPRoute, HTTPRoutes, Methods, Request, Response, contentTypes } from '@browserless.io/browserless';
|
|
2
2
|
export type ResponseSchema = object;
|
|
3
|
-
export default class
|
|
3
|
+
export default class ChromiumJSONProtocolGetRoute extends HTTPRoute {
|
|
4
4
|
private cachedProtocol;
|
|
5
|
+
name: string;
|
|
5
6
|
accepts: contentTypes[];
|
|
6
7
|
auth: boolean;
|
|
7
8
|
browser: null;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { APITags, HTTPRoute, HTTPRoutes, Methods, contentTypes, jsonResponse, } from '@browserless.io/browserless';
|
|
2
|
-
export default class
|
|
1
|
+
import { APITags, BrowserlessRoutes, HTTPRoute, HTTPRoutes, Methods, contentTypes, jsonResponse, } from '@browserless.io/browserless';
|
|
2
|
+
export default class ChromiumJSONProtocolGetRoute extends HTTPRoute {
|
|
3
3
|
cachedProtocol;
|
|
4
|
+
name = BrowserlessRoutes.ChromiumJSONProtocolGetRoute;
|
|
4
5
|
accepts = [contentTypes.any];
|
|
5
6
|
auth = true;
|
|
6
7
|
browser = null;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { APITags, BrowserManager, HTTPRoute, HTTPRoutes, Methods, Request, Response, UnwrapPromise, contentTypes } from '@browserless.io/browserless';
|
|
2
2
|
export type ResponseSchema = UnwrapPromise<ReturnType<BrowserManager['getVersionJSON']>>;
|
|
3
|
-
export default class
|
|
3
|
+
export default class ChromiumJSONVersionGetRoute extends HTTPRoute {
|
|
4
4
|
private cachedJSON;
|
|
5
|
+
name: string;
|
|
5
6
|
accepts: contentTypes[];
|
|
6
7
|
auth: boolean;
|
|
7
8
|
browser: null;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { APITags, HTTPRoute, HTTPRoutes, Methods, contentTypes, jsonResponse, writeResponse, } from '@browserless.io/browserless';
|
|
2
|
-
export default class
|
|
1
|
+
import { APITags, BrowserlessRoutes, HTTPRoute, HTTPRoutes, Methods, contentTypes, jsonResponse, writeResponse, } from '@browserless.io/browserless';
|
|
2
|
+
export default class ChromiumJSONVersionGetRoute extends HTTPRoute {
|
|
3
3
|
cachedJSON;
|
|
4
|
+
name = BrowserlessRoutes.ChromiumJSONVersionGetRoute;
|
|
4
5
|
accepts = [contentTypes.any];
|
|
5
6
|
auth = true;
|
|
6
7
|
browser = null;
|
|
@@ -5,7 +5,8 @@ import { Duplex } from 'stream';
|
|
|
5
5
|
export interface QuerySchema extends SystemQueryParameters {
|
|
6
6
|
launch?: CDPLaunchOptions | string;
|
|
7
7
|
}
|
|
8
|
-
export default class
|
|
8
|
+
export default class ChromiumPageWebSocketRoute extends BrowserWebsocketRoute {
|
|
9
|
+
name: string;
|
|
9
10
|
auth: boolean;
|
|
10
11
|
browser: typeof ChromiumCDP;
|
|
11
12
|
concurrency: boolean;
|
package/build/shared/page.ws.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { APITags, BrowserWebsocketRoute, ChromiumCDP, WebsocketRoutes, dedent, } from '@browserless.io/browserless';
|
|
2
|
-
export default class
|
|
1
|
+
import { APITags, BrowserWebsocketRoute, BrowserlessRoutes, ChromiumCDP, WebsocketRoutes, dedent, } from '@browserless.io/browserless';
|
|
2
|
+
export default class ChromiumPageWebSocketRoute extends BrowserWebsocketRoute {
|
|
3
|
+
name = BrowserlessRoutes.ChromiumPageWebSocketRoute;
|
|
3
4
|
auth = true;
|
|
4
5
|
browser = ChromiumCDP;
|
|
5
6
|
concurrency = false;
|
|
@@ -33,7 +33,8 @@ export interface QuerySchema extends SystemQueryParameters {
|
|
|
33
33
|
* Responds with an application/pdf content-type and a binary PDF
|
|
34
34
|
*/
|
|
35
35
|
export type ResponseSchema = string;
|
|
36
|
-
export default class
|
|
36
|
+
export default class ChromiumPDFPostRoute extends BrowserHTTPRoute {
|
|
37
|
+
name: string;
|
|
37
38
|
accepts: contentTypes[];
|
|
38
39
|
auth: boolean;
|
|
39
40
|
browser: typeof ChromiumCDP;
|