@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.
Files changed (208) hide show
  1. package/CHANGELOG.md +9 -1
  2. package/README.md +2 -2
  3. package/bin/browserless.js +47 -18
  4. package/bin/scaffold/README.md +50 -0
  5. package/bin/scaffold/src/hello-world.http.ts +2 -1
  6. package/build/browserless.d.ts +3 -5
  7. package/build/browserless.js +17 -11
  8. package/build/browsers/chrome.cdp.js +1 -1
  9. package/build/browsers/chrome.playwright.js +1 -1
  10. package/build/browsers/index.d.ts +1 -0
  11. package/build/browsers/index.js +4 -1
  12. package/build/data/classes.json +1 -1
  13. package/build/data/selectors.json +1 -1
  14. package/build/exports.d.ts +24 -38
  15. package/build/exports.js +25 -44
  16. package/build/limiter.d.ts +2 -1
  17. package/build/limiter.js +6 -3
  18. package/build/routes/chrome/http/content.post.body.json +8 -8
  19. package/build/routes/chrome/http/content.post.d.ts +2 -1
  20. package/build/routes/chrome/http/content.post.js +3 -2
  21. package/build/routes/chrome/http/download.post.body.json +11 -489
  22. package/build/routes/chrome/http/download.post.d.ts +2 -1
  23. package/build/routes/chrome/http/download.post.js +3 -2
  24. package/build/routes/chrome/http/download.post.query.json +6 -69
  25. package/build/routes/chrome/http/download.post.response.json +0 -1
  26. package/build/routes/chrome/http/function.post.body.json +11 -489
  27. package/build/routes/chrome/http/function.post.d.ts +2 -1
  28. package/build/routes/chrome/http/function.post.js +3 -2
  29. package/build/routes/chrome/http/function.post.query.json +6 -69
  30. package/build/routes/chrome/http/function.post.response.json +0 -1
  31. package/build/routes/chrome/http/json-list.get.d.ts +5 -1
  32. package/build/routes/chrome/http/json-list.get.js +5 -1
  33. package/build/routes/chrome/http/json-list.get.response.json +49 -1
  34. package/build/routes/chrome/http/json-new.put.d.ts +5 -1
  35. package/build/routes/chrome/http/json-new.put.js +5 -1
  36. package/build/routes/chrome/http/json-new.put.response.json +41 -1
  37. package/build/routes/chrome/http/json-protocol.get.d.ts +5 -1
  38. package/build/routes/chrome/http/json-protocol.get.js +5 -1
  39. package/build/routes/chrome/http/json-protocol.get.response.json +3 -1
  40. package/build/routes/chrome/http/json-version.get.d.ts +5 -1
  41. package/build/routes/chrome/http/json-version.get.js +5 -1
  42. package/build/routes/chrome/http/json-version.get.response.json +41 -1
  43. package/build/routes/chrome/http/pdf.post.body.json +153 -9
  44. package/build/routes/chrome/http/pdf.post.d.ts +2 -1
  45. package/build/routes/chrome/http/pdf.post.js +3 -2
  46. package/build/routes/chrome/http/pdf.post.query.json +6 -69
  47. package/build/routes/chrome/http/performance.post.body.json +10 -494
  48. package/build/routes/chrome/http/performance.post.d.ts +2 -1
  49. package/build/routes/chrome/http/performance.post.js +3 -2
  50. package/build/routes/chrome/http/performance.post.query.json +6 -69
  51. package/build/routes/chrome/http/performance.post.response.json +3 -1
  52. package/build/routes/chrome/http/scrape.post.body.json +56 -9
  53. package/build/routes/chrome/http/scrape.post.d.ts +2 -1
  54. package/build/routes/chrome/http/scrape.post.js +3 -2
  55. package/build/routes/chrome/http/scrape.post.response.json +305 -1
  56. package/build/routes/chrome/http/screenshot.post.body.json +99 -9
  57. package/build/routes/chrome/http/screenshot.post.d.ts +2 -1
  58. package/build/routes/chrome/http/screenshot.post.js +3 -2
  59. package/build/routes/chrome/http/screenshot.post.query.json +6 -69
  60. package/build/routes/chrome/ws/browser.d.ts +2 -1
  61. package/build/routes/chrome/ws/browser.js +3 -2
  62. package/build/routes/chrome/ws/browser.query.json +6 -69
  63. package/build/routes/chrome/ws/cdp.d.ts +2 -1
  64. package/build/routes/chrome/ws/cdp.js +3 -2
  65. package/build/routes/chrome/ws/cdp.query.json +6 -69
  66. package/build/routes/chrome/ws/page.d.ts +3 -2
  67. package/build/routes/chrome/ws/page.js +3 -2
  68. package/build/routes/chrome/ws/page.query.json +6 -69
  69. package/build/routes/chrome/ws/playwright.d.ts +1 -0
  70. package/build/routes/chrome/ws/playwright.js +2 -1
  71. package/build/routes/chrome/ws/playwright.query.json +7 -90
  72. package/build/routes/chromium/http/content.post.body.json +8 -8
  73. package/build/routes/chromium/http/download.post.body.json +11 -489
  74. package/build/routes/chromium/http/download.post.query.json +6 -69
  75. package/build/routes/chromium/http/download.post.response.json +0 -1
  76. package/build/routes/chromium/http/function.post.body.json +11 -489
  77. package/build/routes/chromium/http/function.post.query.json +6 -69
  78. package/build/routes/chromium/http/function.post.response.json +0 -1
  79. package/build/routes/chromium/http/json-list.get.response.json +49 -1
  80. package/build/routes/chromium/http/json-new.put.response.json +41 -1
  81. package/build/routes/chromium/http/json-protocol.get.response.json +3 -1
  82. package/build/routes/chromium/http/json-version.get.response.json +41 -1
  83. package/build/routes/chromium/http/pdf.post.body.json +153 -9
  84. package/build/routes/chromium/http/pdf.post.query.json +6 -69
  85. package/build/routes/chromium/http/performance.post.body.json +10 -494
  86. package/build/routes/chromium/http/performance.post.query.json +6 -69
  87. package/build/routes/chromium/http/performance.post.response.json +3 -1
  88. package/build/routes/chromium/http/scrape.post.body.json +56 -9
  89. package/build/routes/chromium/http/scrape.post.response.json +305 -1
  90. package/build/routes/chromium/http/screenshot.post.body.json +99 -9
  91. package/build/routes/chromium/http/screenshot.post.query.json +6 -69
  92. package/build/routes/chromium/ws/browser.query.json +6 -69
  93. package/build/routes/chromium/ws/cdp.query.json +6 -69
  94. package/build/routes/chromium/ws/page.query.json +6 -69
  95. package/build/routes/chromium/ws/playwright.query.json +7 -90
  96. package/build/routes/firefox/ws/playwright.d.ts +2 -1
  97. package/build/routes/firefox/ws/playwright.js +3 -2
  98. package/build/routes/firefox/ws/playwright.query.json +30 -115
  99. package/build/routes/management/http/config.get.d.ts +1 -0
  100. package/build/routes/management/http/config.get.js +2 -1
  101. package/build/routes/management/http/config.get.response.json +104 -1
  102. package/build/routes/management/http/metrics-total.get.d.ts +1 -0
  103. package/build/routes/management/http/metrics-total.get.js +2 -1
  104. package/build/routes/management/http/metrics-total.get.response.json +69 -1
  105. package/build/routes/management/http/metrics.get.d.ts +1 -0
  106. package/build/routes/management/http/metrics.get.js +2 -1
  107. package/build/routes/management/http/metrics.get.response.json +91 -1
  108. package/build/routes/management/http/sessions.get.d.ts +1 -0
  109. package/build/routes/management/http/sessions.get.js +2 -1
  110. package/build/routes/management/http/sessions.get.response.json +232 -1
  111. package/build/routes/management/http/static.get.d.ts +1 -0
  112. package/build/routes/management/http/static.get.js +2 -1
  113. package/build/routes/webkit/ws/playwright.d.ts +2 -1
  114. package/build/routes/webkit/ws/playwright.js +3 -2
  115. package/build/routes/webkit/ws/playwright.query.json +7 -90
  116. package/build/shared/browser.ws.d.ts +2 -1
  117. package/build/shared/browser.ws.js +3 -2
  118. package/build/shared/chromium.playwright.ws.d.ts +2 -1
  119. package/build/shared/chromium.playwright.ws.js +3 -2
  120. package/build/shared/chromium.ws.d.ts +2 -1
  121. package/build/shared/chromium.ws.js +3 -2
  122. package/build/shared/content.http.d.ts +2 -1
  123. package/build/shared/content.http.js +3 -2
  124. package/build/shared/download.http.d.ts +2 -1
  125. package/build/shared/download.http.js +3 -2
  126. package/build/shared/function.http.d.ts +2 -1
  127. package/build/shared/function.http.js +3 -2
  128. package/build/shared/json-list.http.d.ts +2 -1
  129. package/build/shared/json-list.http.js +3 -2
  130. package/build/shared/json-new.http.d.ts +2 -1
  131. package/build/shared/json-new.http.js +3 -2
  132. package/build/shared/json-protocol.http.d.ts +2 -1
  133. package/build/shared/json-protocol.http.js +3 -2
  134. package/build/shared/json-version.http.d.ts +2 -1
  135. package/build/shared/json-version.http.js +3 -2
  136. package/build/shared/page.ws.d.ts +2 -1
  137. package/build/shared/page.ws.js +3 -2
  138. package/build/shared/pdf.http.d.ts +2 -1
  139. package/build/shared/pdf.http.js +3 -2
  140. package/build/shared/performance.http.d.ts +1 -0
  141. package/build/shared/performance.http.js +2 -1
  142. package/build/shared/scrape.http.d.ts +2 -1
  143. package/build/shared/scrape.http.js +3 -2
  144. package/build/shared/screenshot.http.d.ts +1 -0
  145. package/build/shared/screenshot.http.js +2 -1
  146. package/build/types.d.ts +91 -0
  147. package/build/types.js +54 -0
  148. package/build/utils.d.ts +1 -1
  149. package/build/utils.js +11 -6
  150. package/docker/chrome/Dockerfile +0 -2
  151. package/docker/chromium/Dockerfile +1 -4
  152. package/docker/firefox/Dockerfile +1 -4
  153. package/docker/multi/Dockerfile +2 -6
  154. package/docker/webkit/Dockerfile +1 -4
  155. package/package.json +11 -10
  156. package/scripts/build-open-api.js +150 -141
  157. package/scripts/build-schemas.js +3 -2
  158. package/src/browserless.ts +43 -30
  159. package/src/browsers/chrome.cdp.ts +1 -1
  160. package/src/browsers/chrome.playwright.ts +1 -1
  161. package/src/browsers/index.ts +5 -1
  162. package/src/exports.ts +25 -49
  163. package/src/limiter.ts +7 -3
  164. package/src/routes/chrome/http/content.post.ts +7 -2
  165. package/src/routes/chrome/http/download.post.ts +7 -2
  166. package/src/routes/chrome/http/function.post.ts +7 -2
  167. package/src/routes/chrome/http/json-list.get.ts +7 -1
  168. package/src/routes/chrome/http/json-new.put.ts +7 -1
  169. package/src/routes/chrome/http/json-protocol.get.ts +7 -1
  170. package/src/routes/chrome/http/json-version.get.ts +7 -1
  171. package/src/routes/chrome/http/pdf.post.ts +7 -2
  172. package/src/routes/chrome/http/performance.post.ts +7 -2
  173. package/src/routes/chrome/http/scrape.post.ts +7 -2
  174. package/src/routes/chrome/http/screenshot.post.ts +7 -2
  175. package/src/routes/chrome/ws/browser.ts +3 -2
  176. package/src/routes/chrome/ws/cdp.ts +7 -2
  177. package/src/routes/chrome/ws/page.ts +3 -2
  178. package/src/routes/chrome/ws/playwright.ts +6 -1
  179. package/src/routes/firefox/ws/playwright.ts +3 -1
  180. package/src/routes/management/http/config.get.ts +2 -0
  181. package/src/routes/management/http/metrics-total.get.ts +2 -0
  182. package/src/routes/management/http/metrics.get.ts +2 -0
  183. package/src/routes/management/http/sessions.get.ts +2 -0
  184. package/src/routes/management/http/static.get.ts +2 -0
  185. package/src/routes/webkit/ws/playwright.ts +3 -1
  186. package/src/shared/browser.ws.ts +3 -1
  187. package/src/shared/chromium.playwright.ws.ts +3 -1
  188. package/src/shared/chromium.ws.ts +3 -1
  189. package/src/shared/content.http.ts +3 -1
  190. package/src/shared/download.http.ts +3 -1
  191. package/src/shared/function.http.ts +3 -1
  192. package/src/shared/json-list.http.ts +3 -1
  193. package/src/shared/json-new.http.ts +3 -1
  194. package/src/shared/json-protocol.http.ts +3 -1
  195. package/src/shared/json-version.http.ts +3 -1
  196. package/src/shared/page.ws.ts +3 -1
  197. package/src/shared/pdf.http.ts +3 -1
  198. package/src/shared/performance.http.ts +2 -0
  199. package/src/shared/scrape.http.ts +3 -1
  200. package/src/shared/screenshot.http.ts +2 -0
  201. package/src/types.ts +66 -0
  202. package/src/utils.ts +13 -7
  203. package/static/docs/swagger.json +2511 -1520
  204. package/static/docs/swagger.min.json +6697 -0
  205. package/static/function/client.js +323 -323
  206. package/build/exports.core.d.ts +0 -24
  207. package/build/exports.core.js +0 -26
  208. package/src/exports.core.ts +0 -26
@@ -1,4 +1,235 @@
1
1
  {
2
- "type": "string",
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 WebkitPlaywrightRoute extends BrowserWebsocketRoute {
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 WebkitPlaywrightRoute extends BrowserWebsocketRoute {
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/CDPLaunchOptions"
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 CDPExistingBrowser extends BrowserWebsocketRoute {
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 CDPExistingBrowser extends BrowserWebsocketRoute {
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 PlaywrightChromiumRoute extends BrowserWebsocketRoute {
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 PlaywrightChromiumRoute extends BrowserWebsocketRoute {
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 ChromiumCDPRoute extends BrowserWebsocketRoute {
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 ChromiumCDPRoute extends BrowserWebsocketRoute {
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 ContentPostRoute extends BrowserHTTPRoute {
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 ContentPostRoute extends BrowserHTTPRoute {
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 DownloadPost extends BrowserHTTPRoute {
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 DownloadPost extends BrowserHTTPRoute {
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 FunctionPost extends BrowserHTTPRoute {
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 FunctionPost extends BrowserHTTPRoute {
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 GetJSONList extends HTTPRoute {
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 GetJSONList extends HTTPRoute {
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 GetJSONList extends HTTPRoute {
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 GetJSONList extends HTTPRoute {
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 GetJSONVersion extends HTTPRoute {
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 GetJSONVersion extends HTTPRoute {
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 GetJSONVersion extends HTTPRoute {
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 GetJSONVersion extends HTTPRoute {
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 PageWebSocketRoute extends BrowserWebsocketRoute {
8
+ export default class ChromiumPageWebSocketRoute 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 PageWebSocketRoute extends BrowserWebsocketRoute {
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 PDFPost extends BrowserHTTPRoute {
36
+ export default class ChromiumPDFPostRoute extends BrowserHTTPRoute {
37
+ name: string;
37
38
  accepts: contentTypes[];
38
39
  auth: boolean;
39
40
  browser: typeof ChromiumCDP;