@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,120 +1,9 @@
|
|
|
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": {
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
"$ref": "#/definitions/CDPLaunchOptions"
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
"type": "string"
|
|
16
|
-
}
|
|
17
|
-
]
|
|
18
|
-
},
|
|
19
|
-
"record": {
|
|
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
|
-
"type": "boolean"
|
|
22
|
-
},
|
|
23
|
-
"timeout": {
|
|
24
|
-
"description": "Override the system-level timeout for this request.\nAccepts a value in milliseconds.",
|
|
25
|
-
"type": "number"
|
|
26
|
-
},
|
|
27
|
-
"token": {
|
|
28
|
-
"description": "The authorization token",
|
|
29
|
-
"type": "string"
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
"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
|
-
"BrowserServerOptions": {
|
|
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.",
|
|
6
|
+
"additionalProperties": false,
|
|
118
7
|
"type": "object",
|
|
119
8
|
"properties": {
|
|
120
9
|
"args": {
|
|
@@ -174,10 +63,36 @@
|
|
|
174
63
|
},
|
|
175
64
|
"tracesDir": {
|
|
176
65
|
"type": "string"
|
|
66
|
+
},
|
|
67
|
+
"firefoxUserPrefs": {
|
|
68
|
+
"type": "object",
|
|
69
|
+
"additionalProperties": {
|
|
70
|
+
"type": [
|
|
71
|
+
"string",
|
|
72
|
+
"number",
|
|
73
|
+
"boolean"
|
|
74
|
+
]
|
|
75
|
+
}
|
|
177
76
|
}
|
|
178
|
-
}
|
|
179
|
-
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
"blockAds": {
|
|
80
|
+
"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.",
|
|
81
|
+
"type": "boolean"
|
|
82
|
+
},
|
|
83
|
+
"record": {
|
|
84
|
+
"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.",
|
|
85
|
+
"type": "boolean"
|
|
86
|
+
},
|
|
87
|
+
"timeout": {
|
|
88
|
+
"description": "Override the system-level timeout for this request.\nAccepts a value in milliseconds.",
|
|
89
|
+
"type": "number"
|
|
90
|
+
},
|
|
91
|
+
"token": {
|
|
92
|
+
"description": "The authorization token",
|
|
93
|
+
"type": "string"
|
|
180
94
|
}
|
|
181
95
|
},
|
|
96
|
+
"additionalProperties": false,
|
|
182
97
|
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
183
98
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { APITags, HTTPManagementRoutes, HTTPRoute, Methods, contentTypes, jsonResponse, } from '@browserless.io/browserless';
|
|
1
|
+
import { APITags, BrowserlessRoutes, HTTPManagementRoutes, HTTPRoute, Methods, contentTypes, jsonResponse, } from '@browserless.io/browserless';
|
|
2
2
|
export default class ConfigGetRoute extends HTTPRoute {
|
|
3
|
+
name = BrowserlessRoutes.ConfigGetRoute;
|
|
3
4
|
accepts = [contentTypes.any];
|
|
4
5
|
auth = true;
|
|
5
6
|
browser = null;
|
|
@@ -1,4 +1,107 @@
|
|
|
1
1
|
{
|
|
2
|
-
"type": "
|
|
2
|
+
"type": "object",
|
|
3
|
+
"properties": {
|
|
4
|
+
"allowCORS": {
|
|
5
|
+
"type": "boolean"
|
|
6
|
+
},
|
|
7
|
+
"allowFileProtocol": {
|
|
8
|
+
"type": "boolean"
|
|
9
|
+
},
|
|
10
|
+
"allowGetCalls": {
|
|
11
|
+
"type": "boolean"
|
|
12
|
+
},
|
|
13
|
+
"concurrent": {
|
|
14
|
+
"type": "number"
|
|
15
|
+
},
|
|
16
|
+
"data": {
|
|
17
|
+
"type": "string"
|
|
18
|
+
},
|
|
19
|
+
"debug": {
|
|
20
|
+
"type": "string"
|
|
21
|
+
},
|
|
22
|
+
"errorAlertURL": {
|
|
23
|
+
"type": [
|
|
24
|
+
"null",
|
|
25
|
+
"string"
|
|
26
|
+
]
|
|
27
|
+
},
|
|
28
|
+
"healthFailureURL": {
|
|
29
|
+
"type": [
|
|
30
|
+
"null",
|
|
31
|
+
"string"
|
|
32
|
+
]
|
|
33
|
+
},
|
|
34
|
+
"host": {
|
|
35
|
+
"type": "string"
|
|
36
|
+
},
|
|
37
|
+
"maxCPU": {
|
|
38
|
+
"type": "number"
|
|
39
|
+
},
|
|
40
|
+
"maxMemory": {
|
|
41
|
+
"type": "number"
|
|
42
|
+
},
|
|
43
|
+
"metricsJSONPath": {
|
|
44
|
+
"type": "string"
|
|
45
|
+
},
|
|
46
|
+
"port": {
|
|
47
|
+
"type": "number"
|
|
48
|
+
},
|
|
49
|
+
"queued": {
|
|
50
|
+
"type": "number"
|
|
51
|
+
},
|
|
52
|
+
"queuedAlertURL": {
|
|
53
|
+
"type": [
|
|
54
|
+
"null",
|
|
55
|
+
"string"
|
|
56
|
+
]
|
|
57
|
+
},
|
|
58
|
+
"rejectAlertURL": {
|
|
59
|
+
"type": [
|
|
60
|
+
"null",
|
|
61
|
+
"string"
|
|
62
|
+
]
|
|
63
|
+
},
|
|
64
|
+
"retries": {
|
|
65
|
+
"type": "number"
|
|
66
|
+
},
|
|
67
|
+
"timeout": {
|
|
68
|
+
"type": "number"
|
|
69
|
+
},
|
|
70
|
+
"timeoutAlertURL": {
|
|
71
|
+
"type": [
|
|
72
|
+
"null",
|
|
73
|
+
"string"
|
|
74
|
+
]
|
|
75
|
+
},
|
|
76
|
+
"token": {
|
|
77
|
+
"type": [
|
|
78
|
+
"null",
|
|
79
|
+
"string"
|
|
80
|
+
]
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
"additionalProperties": false,
|
|
84
|
+
"required": [
|
|
85
|
+
"allowCORS",
|
|
86
|
+
"allowFileProtocol",
|
|
87
|
+
"allowGetCalls",
|
|
88
|
+
"concurrent",
|
|
89
|
+
"data",
|
|
90
|
+
"debug",
|
|
91
|
+
"errorAlertURL",
|
|
92
|
+
"healthFailureURL",
|
|
93
|
+
"host",
|
|
94
|
+
"maxCPU",
|
|
95
|
+
"maxMemory",
|
|
96
|
+
"metricsJSONPath",
|
|
97
|
+
"port",
|
|
98
|
+
"queued",
|
|
99
|
+
"queuedAlertURL",
|
|
100
|
+
"rejectAlertURL",
|
|
101
|
+
"retries",
|
|
102
|
+
"timeout",
|
|
103
|
+
"timeoutAlertURL",
|
|
104
|
+
"token"
|
|
105
|
+
],
|
|
3
106
|
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
4
107
|
}
|
|
@@ -3,6 +3,7 @@ import { APITags, HTTPManagementRoutes, HTTPRoute, IBrowserlessMetricTotals, Met
|
|
|
3
3
|
import { ServerResponse } from 'http';
|
|
4
4
|
export type ResponseSchema = IBrowserlessMetricTotals;
|
|
5
5
|
export default class MetricsTotalGetRoute extends HTTPRoute {
|
|
6
|
+
name: string;
|
|
6
7
|
accepts: contentTypes[];
|
|
7
8
|
auth: boolean;
|
|
8
9
|
browser: null;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { APITags, HTTPManagementRoutes, HTTPRoute, Methods, contentTypes, writeResponse, } from '@browserless.io/browserless';
|
|
1
|
+
import { APITags, BrowserlessRoutes, HTTPManagementRoutes, HTTPRoute, Methods, contentTypes, writeResponse, } from '@browserless.io/browserless';
|
|
2
2
|
const fiveMinuteIntervalsInAMonth = 8640;
|
|
3
3
|
export default class MetricsTotalGetRoute extends HTTPRoute {
|
|
4
|
+
name = BrowserlessRoutes.MetricsTotalGetRoute;
|
|
4
5
|
accepts = [contentTypes.any];
|
|
5
6
|
auth = true;
|
|
6
7
|
browser = null;
|
|
@@ -1,4 +1,72 @@
|
|
|
1
1
|
{
|
|
2
|
-
"type": "
|
|
2
|
+
"type": "object",
|
|
3
|
+
"properties": {
|
|
4
|
+
"error": {
|
|
5
|
+
"type": "number"
|
|
6
|
+
},
|
|
7
|
+
"estimatedMonthlyUnits": {
|
|
8
|
+
"type": "number"
|
|
9
|
+
},
|
|
10
|
+
"maxConcurrent": {
|
|
11
|
+
"type": "number"
|
|
12
|
+
},
|
|
13
|
+
"maxTime": {
|
|
14
|
+
"type": "number"
|
|
15
|
+
},
|
|
16
|
+
"meanTime": {
|
|
17
|
+
"type": "number"
|
|
18
|
+
},
|
|
19
|
+
"minTime": {
|
|
20
|
+
"type": "number"
|
|
21
|
+
},
|
|
22
|
+
"minutesOfMetricsAvailable": {
|
|
23
|
+
"type": "number"
|
|
24
|
+
},
|
|
25
|
+
"queued": {
|
|
26
|
+
"type": "number"
|
|
27
|
+
},
|
|
28
|
+
"rejected": {
|
|
29
|
+
"type": "number"
|
|
30
|
+
},
|
|
31
|
+
"sessionTimes": {
|
|
32
|
+
"type": "array",
|
|
33
|
+
"items": {
|
|
34
|
+
"type": "number"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"successful": {
|
|
38
|
+
"type": "number"
|
|
39
|
+
},
|
|
40
|
+
"timedout": {
|
|
41
|
+
"type": "number"
|
|
42
|
+
},
|
|
43
|
+
"totalTime": {
|
|
44
|
+
"type": "number"
|
|
45
|
+
},
|
|
46
|
+
"unhealthy": {
|
|
47
|
+
"type": "number"
|
|
48
|
+
},
|
|
49
|
+
"units": {
|
|
50
|
+
"type": "number"
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"additionalProperties": false,
|
|
54
|
+
"required": [
|
|
55
|
+
"error",
|
|
56
|
+
"estimatedMonthlyUnits",
|
|
57
|
+
"maxConcurrent",
|
|
58
|
+
"maxTime",
|
|
59
|
+
"meanTime",
|
|
60
|
+
"minTime",
|
|
61
|
+
"minutesOfMetricsAvailable",
|
|
62
|
+
"queued",
|
|
63
|
+
"rejected",
|
|
64
|
+
"sessionTimes",
|
|
65
|
+
"successful",
|
|
66
|
+
"timedout",
|
|
67
|
+
"totalTime",
|
|
68
|
+
"unhealthy",
|
|
69
|
+
"units"
|
|
70
|
+
],
|
|
3
71
|
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
4
72
|
}
|
|
@@ -3,6 +3,7 @@ import { APITags, HTTPManagementRoutes, HTTPRoute, IBrowserlessStats, Methods, R
|
|
|
3
3
|
import { ServerResponse } from 'http';
|
|
4
4
|
export type ResponseSchema = Array<IBrowserlessStats>;
|
|
5
5
|
export default class MetricsGetRoute extends HTTPRoute {
|
|
6
|
+
name: string;
|
|
6
7
|
accepts: contentTypes[];
|
|
7
8
|
auth: boolean;
|
|
8
9
|
browser: null;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { APITags, HTTPManagementRoutes, HTTPRoute, Methods, contentTypes, writeResponse, } from '@browserless.io/browserless';
|
|
1
|
+
import { APITags, BrowserlessRoutes, HTTPManagementRoutes, HTTPRoute, Methods, contentTypes, writeResponse, } from '@browserless.io/browserless';
|
|
2
2
|
export default class MetricsGetRoute extends HTTPRoute {
|
|
3
|
+
name = BrowserlessRoutes.MetricsGetRoute;
|
|
3
4
|
accepts = [contentTypes.any];
|
|
4
5
|
auth = true;
|
|
5
6
|
browser = null;
|
|
@@ -1,4 +1,94 @@
|
|
|
1
1
|
{
|
|
2
|
-
"type": "
|
|
2
|
+
"type": "array",
|
|
3
|
+
"items": {
|
|
4
|
+
"$ref": "#/definitions/IBrowserlessStats"
|
|
5
|
+
},
|
|
6
|
+
"definitions": {
|
|
7
|
+
"IBrowserlessStats": {
|
|
8
|
+
"type": "object",
|
|
9
|
+
"properties": {
|
|
10
|
+
"cpu": {
|
|
11
|
+
"type": [
|
|
12
|
+
"null",
|
|
13
|
+
"number"
|
|
14
|
+
]
|
|
15
|
+
},
|
|
16
|
+
"date": {
|
|
17
|
+
"type": "number"
|
|
18
|
+
},
|
|
19
|
+
"error": {
|
|
20
|
+
"type": "number"
|
|
21
|
+
},
|
|
22
|
+
"maxConcurrent": {
|
|
23
|
+
"type": "number"
|
|
24
|
+
},
|
|
25
|
+
"maxTime": {
|
|
26
|
+
"type": "number"
|
|
27
|
+
},
|
|
28
|
+
"meanTime": {
|
|
29
|
+
"type": "number"
|
|
30
|
+
},
|
|
31
|
+
"memory": {
|
|
32
|
+
"type": [
|
|
33
|
+
"null",
|
|
34
|
+
"number"
|
|
35
|
+
]
|
|
36
|
+
},
|
|
37
|
+
"minTime": {
|
|
38
|
+
"type": "number"
|
|
39
|
+
},
|
|
40
|
+
"queued": {
|
|
41
|
+
"type": "number"
|
|
42
|
+
},
|
|
43
|
+
"rejected": {
|
|
44
|
+
"type": "number"
|
|
45
|
+
},
|
|
46
|
+
"sessionTimes": {
|
|
47
|
+
"type": "array",
|
|
48
|
+
"items": {
|
|
49
|
+
"type": "number"
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
"successful": {
|
|
53
|
+
"type": "number"
|
|
54
|
+
},
|
|
55
|
+
"timedout": {
|
|
56
|
+
"type": "number"
|
|
57
|
+
},
|
|
58
|
+
"totalTime": {
|
|
59
|
+
"type": "number"
|
|
60
|
+
},
|
|
61
|
+
"unauthorized": {
|
|
62
|
+
"type": "number"
|
|
63
|
+
},
|
|
64
|
+
"unhealthy": {
|
|
65
|
+
"type": "number"
|
|
66
|
+
},
|
|
67
|
+
"units": {
|
|
68
|
+
"type": "number"
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"additionalProperties": false,
|
|
72
|
+
"required": [
|
|
73
|
+
"cpu",
|
|
74
|
+
"date",
|
|
75
|
+
"error",
|
|
76
|
+
"maxConcurrent",
|
|
77
|
+
"maxTime",
|
|
78
|
+
"meanTime",
|
|
79
|
+
"memory",
|
|
80
|
+
"minTime",
|
|
81
|
+
"queued",
|
|
82
|
+
"rejected",
|
|
83
|
+
"sessionTimes",
|
|
84
|
+
"successful",
|
|
85
|
+
"timedout",
|
|
86
|
+
"totalTime",
|
|
87
|
+
"unauthorized",
|
|
88
|
+
"unhealthy",
|
|
89
|
+
"units"
|
|
90
|
+
]
|
|
91
|
+
}
|
|
92
|
+
},
|
|
3
93
|
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
4
94
|
}
|
|
@@ -3,6 +3,7 @@ import { APITags, BrowserlessSessionJSON, HTTPManagementRoutes, HTTPRoute, Metho
|
|
|
3
3
|
import { ServerResponse } from 'http';
|
|
4
4
|
export type ResponseSchema = BrowserlessSessionJSON[];
|
|
5
5
|
export default class SessionsGetRoute extends HTTPRoute {
|
|
6
|
+
name: string;
|
|
6
7
|
accepts: contentTypes[];
|
|
7
8
|
auth: boolean;
|
|
8
9
|
browser: null;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { APITags, HTTPManagementRoutes, HTTPRoute, Methods, contentTypes, jsonResponse, } from '@browserless.io/browserless';
|
|
1
|
+
import { APITags, BrowserlessRoutes, HTTPManagementRoutes, HTTPRoute, Methods, contentTypes, jsonResponse, } from '@browserless.io/browserless';
|
|
2
2
|
export default class SessionsGetRoute extends HTTPRoute {
|
|
3
|
+
name = BrowserlessRoutes.SessionsGetRoute;
|
|
3
4
|
accepts = [contentTypes.any];
|
|
4
5
|
auth = true;
|
|
5
6
|
browser = null;
|