@bctrl/sdk 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -29
- package/dist/bctrl.d.ts +22 -36
- package/dist/bctrl.js +40 -75
- package/dist/errors.d.ts +49 -43
- package/dist/errors.js +83 -120
- package/dist/files.d.ts +31 -0
- package/dist/files.js +97 -0
- package/dist/http.d.ts +18 -0
- package/dist/http.js +135 -0
- package/dist/index.d.ts +9 -12
- package/dist/index.js +7 -23
- package/dist/invocations.d.ts +86 -0
- package/dist/invocations.js +159 -0
- package/dist/pagination.d.ts +2 -0
- package/dist/pagination.js +13 -0
- package/dist/runs.d.ts +40 -0
- package/dist/runs.js +105 -0
- package/dist/runtimes.d.ts +69 -0
- package/dist/runtimes.js +202 -0
- package/dist/spaces.d.ts +40 -0
- package/dist/spaces.js +96 -0
- package/dist/types.d.ts +413 -0
- package/dist/types.js +1 -0
- package/dist/utils.d.ts +4 -0
- package/dist/utils.js +27 -0
- package/dist/version.js +2 -2
- package/package.json +4 -21
- package/dist/agents/browser-use/index.d.ts +0 -1
- package/dist/agents/browser-use/index.js +0 -9
- package/dist/agents/browser-use/namespace.d.ts +0 -39
- package/dist/agents/browser-use/namespace.js +0 -93
- package/dist/agents/index.d.ts +0 -2
- package/dist/agents/index.js +0 -17
- package/dist/agents/stagehand/core.d.ts +0 -93
- package/dist/agents/stagehand/core.js +0 -144
- package/dist/agents/stagehand/index.d.ts +0 -3
- package/dist/agents/stagehand/index.js +0 -24
- package/dist/agents/stagehand/namespace.d.ts +0 -51
- package/dist/agents/stagehand/namespace.js +0 -65
- package/dist/ai-credentials/client.d.ts +0 -12
- package/dist/ai-credentials/client.js +0 -70
- package/dist/ai-credentials/index.d.ts +0 -1
- package/dist/ai-credentials/index.js +0 -1
- package/dist/base/event-binding.d.ts +0 -7
- package/dist/base/event-binding.js +0 -23
- package/dist/base/types.d.ts +0 -109
- package/dist/base/types.js +0 -4
- package/dist/browser-extensions/client.d.ts +0 -15
- package/dist/browser-extensions/client.js +0 -72
- package/dist/browser-extensions/index.d.ts +0 -2
- package/dist/browser-extensions/index.js +0 -1
- package/dist/browser-profiles/client.d.ts +0 -11
- package/dist/browser-profiles/client.js +0 -63
- package/dist/browser-profiles/index.d.ts +0 -1
- package/dist/browser-profiles/index.js +0 -1
- package/dist/captcha/index.d.ts +0 -1
- package/dist/captcha/index.js +0 -1
- package/dist/captcha/namespace.d.ts +0 -34
- package/dist/captcha/namespace.js +0 -41
- package/dist/client/index.d.ts +0 -1
- package/dist/client/index.js +0 -1
- package/dist/client/rpc.d.ts +0 -83
- package/dist/client/rpc.js +0 -354
- package/dist/config.d.ts +0 -5
- package/dist/config.js +0 -28
- package/dist/constants/browser.d.ts +0 -2
- package/dist/constants/browser.js +0 -1
- package/dist/contracts/agent-tools.d.ts +0 -45
- package/dist/contracts/agent-tools.js +0 -31
- package/dist/contracts/automation.d.ts +0 -265
- package/dist/contracts/automation.js +0 -109
- package/dist/contracts/browser-management.d.ts +0 -179
- package/dist/contracts/browser-management.js +0 -95
- package/dist/contracts/browser-use.d.ts +0 -136
- package/dist/contracts/browser-use.js +0 -93
- package/dist/contracts/captcha.d.ts +0 -114
- package/dist/contracts/captcha.js +0 -40
- package/dist/contracts/desktop.d.ts +0 -223
- package/dist/contracts/desktop.js +0 -121
- package/dist/contracts/drivers/playwright.d.ts +0 -2008
- package/dist/contracts/drivers/playwright.js +0 -2033
- package/dist/contracts/drivers/puppeteer.d.ts +0 -1221
- package/dist/contracts/drivers/puppeteer.js +0 -941
- package/dist/contracts/drivers/selenium.d.ts +0 -156
- package/dist/contracts/drivers/selenium.js +0 -61
- package/dist/contracts/drivers/stagehand.d.ts +0 -155
- package/dist/contracts/drivers/stagehand.js +0 -7
- package/dist/contracts/extensions.d.ts +0 -13
- package/dist/contracts/extensions.js +0 -9
- package/dist/contracts/index.d.ts +0 -13
- package/dist/contracts/index.js +0 -13
- package/dist/contracts/public-api.d.ts +0 -360
- package/dist/contracts/public-api.js +0 -17
- package/dist/contracts/runtime.d.ts +0 -81
- package/dist/contracts/runtime.js +0 -16
- package/dist/contracts/stagehand.d.ts +0 -253
- package/dist/contracts/stagehand.js +0 -145
- package/dist/contracts/storage.d.ts +0 -51
- package/dist/contracts/storage.js +0 -56
- package/dist/contracts/vault.d.ts +0 -119
- package/dist/contracts/vault.js +0 -112
- package/dist/contracts/version.d.ts +0 -3
- package/dist/contracts/version.js +0 -16
- package/dist/desktop.d.ts +0 -2
- package/dist/desktop.js +0 -3
- package/dist/drivers/desktop/index.d.ts +0 -65
- package/dist/drivers/desktop/index.js +0 -68
- package/dist/drivers/desktop/session.d.ts +0 -313
- package/dist/drivers/desktop/session.js +0 -432
- package/dist/drivers/playwright/event-emitter.d.ts +0 -160
- package/dist/drivers/playwright/event-emitter.js +0 -297
- package/dist/drivers/playwright/generated/api-request-context.d.ts +0 -137
- package/dist/drivers/playwright/generated/api-request-context.js +0 -154
- package/dist/drivers/playwright/generated/api-response.d.ts +0 -119
- package/dist/drivers/playwright/generated/api-response.js +0 -123
- package/dist/drivers/playwright/generated/browser-context.d.ts +0 -284
- package/dist/drivers/playwright/generated/browser-context.js +0 -458
- package/dist/drivers/playwright/generated/browser.d.ts +0 -120
- package/dist/drivers/playwright/generated/browser.js +0 -151
- package/dist/drivers/playwright/generated/clock.d.ts +0 -80
- package/dist/drivers/playwright/generated/clock.js +0 -94
- package/dist/drivers/playwright/generated/console-message.d.ts +0 -94
- package/dist/drivers/playwright/generated/console-message.js +0 -89
- package/dist/drivers/playwright/generated/coverage.d.ts +0 -57
- package/dist/drivers/playwright/generated/coverage.js +0 -66
- package/dist/drivers/playwright/generated/dialog.d.ts +0 -79
- package/dist/drivers/playwright/generated/dialog.js +0 -80
- package/dist/drivers/playwright/generated/element-handle.d.ts +0 -399
- package/dist/drivers/playwright/generated/element-handle.js +0 -501
- package/dist/drivers/playwright/generated/frame-locator.d.ts +0 -34
- package/dist/drivers/playwright/generated/frame-locator.js +0 -63
- package/dist/drivers/playwright/generated/frame.d.ts +0 -557
- package/dist/drivers/playwright/generated/frame.js +0 -634
- package/dist/drivers/playwright/generated/js-handle.d.ts +0 -72
- package/dist/drivers/playwright/generated/js-handle.js +0 -92
- package/dist/drivers/playwright/generated/keyboard.d.ts +0 -103
- package/dist/drivers/playwright/generated/keyboard.js +0 -113
- package/dist/drivers/playwright/generated/locator.d.ts +0 -795
- package/dist/drivers/playwright/generated/locator.js +0 -974
- package/dist/drivers/playwright/generated/mouse.d.ts +0 -97
- package/dist/drivers/playwright/generated/mouse.js +0 -109
- package/dist/drivers/playwright/generated/page.d.ts +0 -762
- package/dist/drivers/playwright/generated/page.js +0 -988
- package/dist/drivers/playwright/generated/touchscreen.d.ts +0 -34
- package/dist/drivers/playwright/generated/touchscreen.js +0 -37
- package/dist/drivers/playwright/generated/tracing.d.ts +0 -78
- package/dist/drivers/playwright/generated/tracing.js +0 -80
- package/dist/drivers/playwright/generated/worker.d.ts +0 -53
- package/dist/drivers/playwright/generated/worker.js +0 -59
- package/dist/drivers/playwright/index.d.ts +0 -19
- package/dist/drivers/playwright/index.js +0 -20
- package/dist/drivers/playwright/remote-base.d.ts +0 -62
- package/dist/drivers/playwright/remote-base.js +0 -86
- package/dist/drivers/playwright/types.d.ts +0 -148
- package/dist/drivers/playwright/types.js +0 -8
- package/dist/drivers/puppeteer/errors.d.ts +0 -50
- package/dist/drivers/puppeteer/errors.js +0 -71
- package/dist/drivers/puppeteer/event-emitter.d.ts +0 -145
- package/dist/drivers/puppeteer/event-emitter.js +0 -259
- package/dist/drivers/puppeteer/generated/accessibility.d.ts +0 -77
- package/dist/drivers/puppeteer/generated/accessibility.js +0 -74
- package/dist/drivers/puppeteer/generated/browser-context.d.ts +0 -116
- package/dist/drivers/puppeteer/generated/browser-context.js +0 -168
- package/dist/drivers/puppeteer/generated/browser.d.ts +0 -169
- package/dist/drivers/puppeteer/generated/browser.js +0 -246
- package/dist/drivers/puppeteer/generated/console-message.d.ts +0 -54
- package/dist/drivers/puppeteer/generated/console-message.js +0 -69
- package/dist/drivers/puppeteer/generated/coverage.d.ts +0 -49
- package/dist/drivers/puppeteer/generated/coverage.js +0 -57
- package/dist/drivers/puppeteer/generated/dialog.d.ts +0 -46
- package/dist/drivers/puppeteer/generated/dialog.js +0 -60
- package/dist/drivers/puppeteer/generated/element-handle.d.ts +0 -261
- package/dist/drivers/puppeteer/generated/element-handle.js +0 -341
- package/dist/drivers/puppeteer/generated/file-chooser.d.ts +0 -34
- package/dist/drivers/puppeteer/generated/file-chooser.js +0 -43
- package/dist/drivers/puppeteer/generated/frame.d.ts +0 -221
- package/dist/drivers/puppeteer/generated/frame.js +0 -302
- package/dist/drivers/puppeteer/generated/http-request.d.ts +0 -195
- package/dist/drivers/puppeteer/generated/http-request.js +0 -243
- package/dist/drivers/puppeteer/generated/http-response.d.ts +0 -142
- package/dist/drivers/puppeteer/generated/http-response.js +0 -169
- package/dist/drivers/puppeteer/generated/js-handle.d.ts +0 -104
- package/dist/drivers/puppeteer/generated/js-handle.js +0 -125
- package/dist/drivers/puppeteer/generated/keyboard.d.ts +0 -79
- package/dist/drivers/puppeteer/generated/keyboard.js +0 -89
- package/dist/drivers/puppeteer/generated/locator.d.ts +0 -141
- package/dist/drivers/puppeteer/generated/locator.js +0 -164
- package/dist/drivers/puppeteer/generated/mouse.d.ts +0 -74
- package/dist/drivers/puppeteer/generated/mouse.js +0 -94
- package/dist/drivers/puppeteer/generated/page.d.ts +0 -604
- package/dist/drivers/puppeteer/generated/page.js +0 -776
- package/dist/drivers/puppeteer/generated/target.d.ts +0 -105
- package/dist/drivers/puppeteer/generated/target.js +0 -123
- package/dist/drivers/puppeteer/generated/touchscreen.d.ts +0 -87
- package/dist/drivers/puppeteer/generated/touchscreen.js +0 -103
- package/dist/drivers/puppeteer/generated/tracing.d.ts +0 -38
- package/dist/drivers/puppeteer/generated/tracing.js +0 -43
- package/dist/drivers/puppeteer/generated/web-worker.d.ts +0 -63
- package/dist/drivers/puppeteer/generated/web-worker.js +0 -73
- package/dist/drivers/puppeteer/index.d.ts +0 -21
- package/dist/drivers/puppeteer/index.js +0 -23
- package/dist/drivers/puppeteer/remote-base.d.ts +0 -57
- package/dist/drivers/puppeteer/remote-base.js +0 -79
- package/dist/drivers/puppeteer/types.d.ts +0 -178
- package/dist/drivers/puppeteer/types.js +0 -8
- package/dist/drivers/selenium/driver.d.ts +0 -28
- package/dist/drivers/selenium/driver.js +0 -169
- package/dist/drivers/selenium/element.d.ts +0 -34
- package/dist/drivers/selenium/element.js +0 -73
- package/dist/drivers/selenium/index.d.ts +0 -3
- package/dist/drivers/selenium/index.js +0 -5
- package/dist/drivers/selenium/types.d.ts +0 -2
- package/dist/drivers/selenium/types.js +0 -12
- package/dist/drivers/stagehand/generated/context.d.ts +0 -127
- package/dist/drivers/stagehand/generated/context.js +0 -153
- package/dist/drivers/stagehand/generated/locator.d.ts +0 -324
- package/dist/drivers/stagehand/generated/locator.js +0 -368
- package/dist/drivers/stagehand/generated/page.d.ts +0 -377
- package/dist/drivers/stagehand/generated/page.js +0 -439
- package/dist/drivers/stagehand/generated/response.d.ts +0 -197
- package/dist/drivers/stagehand/generated/response.js +0 -232
- package/dist/drivers/stagehand/index.d.ts +0 -5
- package/dist/drivers/stagehand/index.js +0 -8
- package/dist/drivers/stagehand/types.d.ts +0 -1
- package/dist/drivers/stagehand/types.js +0 -7
- package/dist/extensions/client.d.ts +0 -47
- package/dist/extensions/client.js +0 -154
- package/dist/extensions/index.d.ts +0 -1
- package/dist/extensions/index.js +0 -1
- package/dist/internal/dev-client.d.ts +0 -5
- package/dist/internal/dev-client.js +0 -9
- package/dist/internal/rpc-targets.d.ts +0 -17
- package/dist/internal/rpc-targets.js +0 -58
- package/dist/internal/serialization.d.ts +0 -32
- package/dist/internal/serialization.js +0 -42
- package/dist/internal/transport.d.ts +0 -24
- package/dist/internal/transport.js +0 -29
- package/dist/playwright.d.ts +0 -1
- package/dist/playwright.js +0 -2
- package/dist/puppeteer.d.ts +0 -1
- package/dist/puppeteer.js +0 -2
- package/dist/selenium.d.ts +0 -1
- package/dist/selenium.js +0 -2
- package/dist/stagehand.d.ts +0 -1
- package/dist/stagehand.js +0 -2
- package/dist/storage/client.d.ts +0 -151
- package/dist/storage/client.js +0 -329
- package/dist/storage/index.d.ts +0 -2
- package/dist/storage/index.js +0 -4
- package/dist/telemetry.d.ts +0 -18
- package/dist/telemetry.js +0 -93
- package/dist/updates/client.d.ts +0 -8
- package/dist/updates/client.js +0 -128
- package/dist/updates/index.d.ts +0 -1
- package/dist/updates/index.js +0 -1
- package/dist/utils/http.d.ts +0 -39
- package/dist/utils/http.js +0 -88
- package/dist/utils/index.d.ts +0 -4
- package/dist/utils/index.js +0 -4
- package/dist/utils/logger.d.ts +0 -27
- package/dist/utils/logger.js +0 -74
- package/dist/utils/schema.d.ts +0 -17
- package/dist/utils/schema.js +0 -31
- package/dist/utils/url.d.ts +0 -5
- package/dist/utils/url.js +0 -7
- package/dist/vault/client.d.ts +0 -43
- package/dist/vault/client.js +0 -123
- package/dist/vault/index.d.ts +0 -1
- package/dist/vault/index.js +0 -1
- package/dist/workspaces/browser-runtime.d.ts +0 -251
- package/dist/workspaces/browser-runtime.js +0 -1025
- package/dist/workspaces/client.d.ts +0 -48
- package/dist/workspaces/client.js +0 -222
- package/dist/workspaces/index.d.ts +0 -2
- package/dist/workspaces/index.js +0 -2
- package/dist/workspaces/runtime-event-pump.d.ts +0 -65
- package/dist/workspaces/runtime-event-pump.js +0 -716
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* AUTO-GENERATED FILE - DO NOT EDIT
|
|
3
|
-
*
|
|
4
|
-
* Generated from: packages/automation-spec/src/drivers/playwright/methods/
|
|
5
|
-
* Run `pnpm generate:playwright` to regenerate.
|
|
6
|
-
*/
|
|
7
|
-
import type { SimpleRpcSender } from '../../../internal/transport.js';
|
|
8
|
-
import { RemoteBase } from '../remote-base.js';
|
|
9
|
-
/**
|
|
10
|
-
* Serialized API response data sent over RPC.
|
|
11
|
-
*/
|
|
12
|
-
export interface SerializedAPIResponse {
|
|
13
|
-
/** Unique identifier for this response (for body fetching) */
|
|
14
|
-
id: string;
|
|
15
|
-
/** Response URL */
|
|
16
|
-
url: string;
|
|
17
|
-
/** HTTP status code */
|
|
18
|
-
status: number;
|
|
19
|
-
/** HTTP status text */
|
|
20
|
-
statusText: string;
|
|
21
|
-
/** Whether status is 200-299 */
|
|
22
|
-
ok: boolean;
|
|
23
|
-
/** Response headers (lowercase keys) */
|
|
24
|
-
headers: Record<string, string>;
|
|
25
|
-
/** Response headers array (original case) */
|
|
26
|
-
headersArray: Array<{
|
|
27
|
-
name: string;
|
|
28
|
-
value: string;
|
|
29
|
-
}>;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* RemotePlaywrightAPIResponse - Remote Playwright APIResponse API over RPC.
|
|
33
|
-
*
|
|
34
|
-
* @see https://playwright.dev/docs/api/class-apiresponse
|
|
35
|
-
*/
|
|
36
|
-
export declare class RemotePlaywrightAPIResponse extends RemoteBase {
|
|
37
|
-
private readonly _url;
|
|
38
|
-
private readonly _status;
|
|
39
|
-
private readonly _statusText;
|
|
40
|
-
private readonly _ok;
|
|
41
|
-
private readonly _headers;
|
|
42
|
-
private readonly _headersArray;
|
|
43
|
-
constructor(sendRpc: SimpleRpcSender, data: SerializedAPIResponse);
|
|
44
|
-
/**
|
|
45
|
-
* Returns the buffer with response body.
|
|
46
|
-
*
|
|
47
|
-
* @see https://playwright.dev/docs/api/class-apiresponse#api-response-body
|
|
48
|
-
*/
|
|
49
|
-
body(): Promise<Buffer>;
|
|
50
|
-
/**
|
|
51
|
-
* Contains the URL of the response.
|
|
52
|
-
*
|
|
53
|
-
* @see https://playwright.dev/docs/api/class-apiresponse#api-response-url
|
|
54
|
-
*/
|
|
55
|
-
url(): string;
|
|
56
|
-
/**
|
|
57
|
-
* Contains the status code of the response (e.g., 200 for a success).
|
|
58
|
-
*
|
|
59
|
-
* @see https://playwright.dev/docs/api/class-apiresponse#api-response-status
|
|
60
|
-
*/
|
|
61
|
-
status(): number;
|
|
62
|
-
/**
|
|
63
|
-
* Contains the status text of the response (e.g., "OK" for a success).
|
|
64
|
-
*
|
|
65
|
-
* @see https://playwright.dev/docs/api/class-apiresponse#api-response-status-text
|
|
66
|
-
*/
|
|
67
|
-
statusText(): string;
|
|
68
|
-
/**
|
|
69
|
-
* Contains a boolean stating whether the response was successful (status in the range 200-299) or not.
|
|
70
|
-
*
|
|
71
|
-
* @see https://playwright.dev/docs/api/class-apiresponse#api-response-ok
|
|
72
|
-
*/
|
|
73
|
-
ok(): boolean;
|
|
74
|
-
/**
|
|
75
|
-
* An object with all the response HTTP headers associated with this response.
|
|
76
|
-
*
|
|
77
|
-
* @remarks
|
|
78
|
-
* Header names are lower-cased.
|
|
79
|
-
*
|
|
80
|
-
* @see https://playwright.dev/docs/api/class-apiresponse#api-response-headers
|
|
81
|
-
*/
|
|
82
|
-
headers(): Record<string, string>;
|
|
83
|
-
/**
|
|
84
|
-
* An array with all the response HTTP headers associated with this response.
|
|
85
|
-
*
|
|
86
|
-
* @remarks
|
|
87
|
-
* Header names are NOT lower-cased. Headers with multiple entries, such as Set-Cookie, appear in the array multiple times.
|
|
88
|
-
*
|
|
89
|
-
* @see https://playwright.dev/docs/api/class-apiresponse#api-response-headers-array
|
|
90
|
-
*/
|
|
91
|
-
headersArray(): Array<{
|
|
92
|
-
name: string;
|
|
93
|
-
value: string;
|
|
94
|
-
}>;
|
|
95
|
-
/**
|
|
96
|
-
* Returns the text representation of response body.
|
|
97
|
-
*
|
|
98
|
-
* @see https://playwright.dev/docs/api/class-apiresponse#api-response-text
|
|
99
|
-
*/
|
|
100
|
-
text(): Promise<string>;
|
|
101
|
-
/**
|
|
102
|
-
* Returns the JSON representation of response body.
|
|
103
|
-
*
|
|
104
|
-
* @remarks
|
|
105
|
-
* This method will throw if the response body is not parsable via JSON.parse.
|
|
106
|
-
*
|
|
107
|
-
* @see https://playwright.dev/docs/api/class-apiresponse#api-response-json
|
|
108
|
-
*/
|
|
109
|
-
json(): Promise<unknown>;
|
|
110
|
-
/**
|
|
111
|
-
* Disposes the body of this response.
|
|
112
|
-
*
|
|
113
|
-
* @remarks
|
|
114
|
-
* If not called, the body will stay in memory until the context closes.
|
|
115
|
-
*
|
|
116
|
-
* @see https://playwright.dev/docs/api/class-apiresponse#api-response-dispose
|
|
117
|
-
*/
|
|
118
|
-
dispose(): Promise<void>;
|
|
119
|
-
}
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* AUTO-GENERATED FILE - DO NOT EDIT
|
|
3
|
-
*
|
|
4
|
-
* Generated from: packages/automation-spec/src/drivers/playwright/methods/
|
|
5
|
-
* Run `pnpm generate:playwright` to regenerate.
|
|
6
|
-
*/
|
|
7
|
-
import { RemoteBase } from '../remote-base.js';
|
|
8
|
-
/**
|
|
9
|
-
* RemotePlaywrightAPIResponse - Remote Playwright APIResponse API over RPC.
|
|
10
|
-
*
|
|
11
|
-
* @see https://playwright.dev/docs/api/class-apiresponse
|
|
12
|
-
*/
|
|
13
|
-
export class RemotePlaywrightAPIResponse extends RemoteBase {
|
|
14
|
-
_url;
|
|
15
|
-
_status;
|
|
16
|
-
_statusText;
|
|
17
|
-
_ok;
|
|
18
|
-
_headers;
|
|
19
|
-
_headersArray;
|
|
20
|
-
constructor(sendRpc, data) {
|
|
21
|
-
super(data.id, sendRpc);
|
|
22
|
-
this._url = data.url;
|
|
23
|
-
this._status = data.status;
|
|
24
|
-
this._statusText = data.statusText;
|
|
25
|
-
this._ok = data.ok;
|
|
26
|
-
this._headers = data.headers;
|
|
27
|
-
this._headersArray = data.headersArray;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Returns the buffer with response body.
|
|
31
|
-
*
|
|
32
|
-
* @see https://playwright.dev/docs/api/class-apiresponse#api-response-body
|
|
33
|
-
*/
|
|
34
|
-
async body() {
|
|
35
|
-
const base64 = await this.rpc('apiResponse.body', [this.id]);
|
|
36
|
-
return Buffer.from(base64, 'base64');
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Contains the URL of the response.
|
|
40
|
-
*
|
|
41
|
-
* @see https://playwright.dev/docs/api/class-apiresponse#api-response-url
|
|
42
|
-
*/
|
|
43
|
-
url() {
|
|
44
|
-
return this._url;
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Contains the status code of the response (e.g., 200 for a success).
|
|
48
|
-
*
|
|
49
|
-
* @see https://playwright.dev/docs/api/class-apiresponse#api-response-status
|
|
50
|
-
*/
|
|
51
|
-
status() {
|
|
52
|
-
return this._status;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Contains the status text of the response (e.g., "OK" for a success).
|
|
56
|
-
*
|
|
57
|
-
* @see https://playwright.dev/docs/api/class-apiresponse#api-response-status-text
|
|
58
|
-
*/
|
|
59
|
-
statusText() {
|
|
60
|
-
return this._statusText;
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Contains a boolean stating whether the response was successful (status in the range 200-299) or not.
|
|
64
|
-
*
|
|
65
|
-
* @see https://playwright.dev/docs/api/class-apiresponse#api-response-ok
|
|
66
|
-
*/
|
|
67
|
-
ok() {
|
|
68
|
-
return this._ok;
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* An object with all the response HTTP headers associated with this response.
|
|
72
|
-
*
|
|
73
|
-
* @remarks
|
|
74
|
-
* Header names are lower-cased.
|
|
75
|
-
*
|
|
76
|
-
* @see https://playwright.dev/docs/api/class-apiresponse#api-response-headers
|
|
77
|
-
*/
|
|
78
|
-
headers() {
|
|
79
|
-
return this._headers;
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* An array with all the response HTTP headers associated with this response.
|
|
83
|
-
*
|
|
84
|
-
* @remarks
|
|
85
|
-
* Header names are NOT lower-cased. Headers with multiple entries, such as Set-Cookie, appear in the array multiple times.
|
|
86
|
-
*
|
|
87
|
-
* @see https://playwright.dev/docs/api/class-apiresponse#api-response-headers-array
|
|
88
|
-
*/
|
|
89
|
-
headersArray() {
|
|
90
|
-
return this._headersArray;
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* Returns the text representation of response body.
|
|
94
|
-
*
|
|
95
|
-
* @see https://playwright.dev/docs/api/class-apiresponse#api-response-text
|
|
96
|
-
*/
|
|
97
|
-
async text() {
|
|
98
|
-
return this.rpc('apiResponse.text', [this.id]);
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* Returns the JSON representation of response body.
|
|
102
|
-
*
|
|
103
|
-
* @remarks
|
|
104
|
-
* This method will throw if the response body is not parsable via JSON.parse.
|
|
105
|
-
*
|
|
106
|
-
* @see https://playwright.dev/docs/api/class-apiresponse#api-response-json
|
|
107
|
-
*/
|
|
108
|
-
async json() {
|
|
109
|
-
return this.rpc('apiResponse.json', [this.id]);
|
|
110
|
-
}
|
|
111
|
-
/**
|
|
112
|
-
* Disposes the body of this response.
|
|
113
|
-
*
|
|
114
|
-
* @remarks
|
|
115
|
-
* If not called, the body will stay in memory until the context closes.
|
|
116
|
-
*
|
|
117
|
-
* @see https://playwright.dev/docs/api/class-apiresponse#api-response-dispose
|
|
118
|
-
*/
|
|
119
|
-
async dispose() {
|
|
120
|
-
await this.rpc('apiResponse.dispose', [this.id]);
|
|
121
|
-
this.markClosed();
|
|
122
|
-
}
|
|
123
|
-
}
|
|
@@ -1,284 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* AUTO-GENERATED FILE - DO NOT EDIT
|
|
3
|
-
*
|
|
4
|
-
* Generated from: packages/automation-spec/src/drivers/playwright/methods/
|
|
5
|
-
* Run `pnpm generate:playwright` to regenerate.
|
|
6
|
-
*/
|
|
7
|
-
import type { HasHandleId, SimpleRpcSender } from '../../../internal/transport.js';
|
|
8
|
-
import type { PlaywrightClearCookiesOptions, PlaywrightCookie, PlaywrightGeolocation, PlaywrightGrantPermissionsOptions, PlaywrightHttpCredentials, PlaywrightPermission, PlaywrightRouteFromHAROptions, PlaywrightRouteOptions, PlaywrightStorageState, PlaywrightUnrouteAllOptions, PlaywrightWaitForEventOptions } from '../types.js';
|
|
9
|
-
import { RemoteBase } from '../remote-base.js';
|
|
10
|
-
import { RemotePlaywrightClock } from './clock.js';
|
|
11
|
-
import { RemotePlaywrightTracing } from './tracing.js';
|
|
12
|
-
import { RemotePlaywrightAPIRequestContext } from './api-request-context.js';
|
|
13
|
-
import type { RemotePlaywrightPage } from './page.js';
|
|
14
|
-
import type { RemotePlaywrightBrowser } from './browser.js';
|
|
15
|
-
/**
|
|
16
|
-
* RemotePlaywrightBrowserContext - Remote Playwright BrowserContext API over RPC.
|
|
17
|
-
*
|
|
18
|
-
* @see https://playwright.dev/docs/api/class-browsercontext
|
|
19
|
-
*/
|
|
20
|
-
export declare class RemotePlaywrightBrowserContext extends RemoteBase {
|
|
21
|
-
constructor(id: string, sendRpc: SimpleRpcSender, createPage: (id: string) => RemotePlaywrightPage, browserRef: RemotePlaywrightBrowser | null);
|
|
22
|
-
private _browser;
|
|
23
|
-
private _defaultTimeout;
|
|
24
|
-
private _defaultNavigationTimeout;
|
|
25
|
-
private _listeners;
|
|
26
|
-
private _clock;
|
|
27
|
-
private _request;
|
|
28
|
-
private _tracing;
|
|
29
|
-
private createPage;
|
|
30
|
-
private notifyFirstListener;
|
|
31
|
-
private notifyNoListeners;
|
|
32
|
-
/**
|
|
33
|
-
* Returns the browser this context belongs to.
|
|
34
|
-
* @see https://playwright.dev/docs/api/class-browsercontext#browser-context-browser
|
|
35
|
-
*/
|
|
36
|
-
browser(): RemotePlaywrightBrowser | null;
|
|
37
|
-
/**
|
|
38
|
-
* Playwright Clock API for mocking time.
|
|
39
|
-
* @see https://playwright.dev/docs/api/class-clock
|
|
40
|
-
*/
|
|
41
|
-
get clock(): RemotePlaywrightClock;
|
|
42
|
-
/**
|
|
43
|
-
* API testing helper associated with this context.
|
|
44
|
-
* @see https://playwright.dev/docs/api/class-browsercontext#browser-context-request
|
|
45
|
-
*/
|
|
46
|
-
get request(): RemotePlaywrightAPIRequestContext;
|
|
47
|
-
/**
|
|
48
|
-
* Tracing helper for recording execution traces.
|
|
49
|
-
* @see https://playwright.dev/docs/api/class-browsercontext#browser-context-tracing
|
|
50
|
-
*/
|
|
51
|
-
get tracing(): RemotePlaywrightTracing;
|
|
52
|
-
/**
|
|
53
|
-
* Sets the default maximum navigation timeout.
|
|
54
|
-
* @see https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-navigation-timeout
|
|
55
|
-
*/
|
|
56
|
-
setDefaultNavigationTimeout(timeout: number): Promise<void>;
|
|
57
|
-
/**
|
|
58
|
-
* Sets the default maximum time for all methods accepting timeout option.
|
|
59
|
-
* @see https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout
|
|
60
|
-
*/
|
|
61
|
-
setDefaultTimeout(timeout: number): Promise<void>;
|
|
62
|
-
on(event: string, handler: (event: unknown) => void): this;
|
|
63
|
-
once(event: string, handler: (event: unknown) => void): this;
|
|
64
|
-
off(event: string, handler?: (event: unknown) => void): this;
|
|
65
|
-
addListener(event: string, handler: (event: unknown) => void): this;
|
|
66
|
-
removeListener(event: string, handler: (event: unknown) => void): this;
|
|
67
|
-
listenerCount(event: string): number;
|
|
68
|
-
emit(event: string, payload: unknown): boolean;
|
|
69
|
-
/**
|
|
70
|
-
* Removes all listeners for the specified event, or all events if no event is specified.
|
|
71
|
-
* @see https://playwright.dev/docs/api/class-browsercontext#browser-context-remove-all-listeners
|
|
72
|
-
*/
|
|
73
|
-
removeAllListeners(event?: string): this;
|
|
74
|
-
/**
|
|
75
|
-
* Returns all open pages in the context.
|
|
76
|
-
*
|
|
77
|
-
* @see https://playwright.dev/docs/api/class-browsercontext#browser-context-pages
|
|
78
|
-
*/
|
|
79
|
-
pages(): Promise<RemotePlaywrightPage[]>;
|
|
80
|
-
/**
|
|
81
|
-
* Returns all service workers in the context.
|
|
82
|
-
*
|
|
83
|
-
* @remarks
|
|
84
|
-
* Service workers are only available on Chromium-based browsers.
|
|
85
|
-
*
|
|
86
|
-
* @see https://playwright.dev/docs/api/class-browsercontext#browser-context-service-workers
|
|
87
|
-
*/
|
|
88
|
-
serviceWorkers(): Promise<Array<{
|
|
89
|
-
url: string;
|
|
90
|
-
workerId: string;
|
|
91
|
-
}>>;
|
|
92
|
-
/**
|
|
93
|
-
* Creates a new page in the browser context.
|
|
94
|
-
*
|
|
95
|
-
* @see https://playwright.dev/docs/api/class-browsercontext#browser-context-new-page
|
|
96
|
-
*/
|
|
97
|
-
newPage(): Promise<RemotePlaywrightPage>;
|
|
98
|
-
/**
|
|
99
|
-
* Returns the newly created CDP session attached to the given page.
|
|
100
|
-
* @param page - Target page to create CDP session for.
|
|
101
|
-
*
|
|
102
|
-
* @remarks
|
|
103
|
-
* CDP Sessions are only supported on Chromium-based browsers.
|
|
104
|
-
*
|
|
105
|
-
* @see https://playwright.dev/docs/api/class-browsercontext#browser-context-new-cdp-session
|
|
106
|
-
*/
|
|
107
|
-
newCDPSession(page: HasHandleId): Promise<{
|
|
108
|
-
sessionId: string;
|
|
109
|
-
}>;
|
|
110
|
-
/**
|
|
111
|
-
* Adds cookies into this browser context. All pages within this context will have these cookies installed.
|
|
112
|
-
*
|
|
113
|
-
* @see https://playwright.dev/docs/api/class-browsercontext#browser-context-add-cookies
|
|
114
|
-
*/
|
|
115
|
-
addCookies(cookies: PlaywrightCookie[]): Promise<void>;
|
|
116
|
-
/**
|
|
117
|
-
* Returns cookies for the specified URLs, or all cookies if no URLs are specified.
|
|
118
|
-
*
|
|
119
|
-
* @see https://playwright.dev/docs/api/class-browsercontext#browser-context-cookies
|
|
120
|
-
*/
|
|
121
|
-
cookies(urls?: string | string[]): Promise<PlaywrightCookie[]>;
|
|
122
|
-
/**
|
|
123
|
-
* Removes cookies from context. Accepts optional filter to remove specific cookies.
|
|
124
|
-
*
|
|
125
|
-
* @remarks
|
|
126
|
-
* If no options are provided, removes all cookies from the context.
|
|
127
|
-
*
|
|
128
|
-
* @see https://playwright.dev/docs/api/class-browsercontext#browser-context-clear-cookies
|
|
129
|
-
*/
|
|
130
|
-
clearCookies(options?: PlaywrightClearCookiesOptions): Promise<void>;
|
|
131
|
-
/**
|
|
132
|
-
* Grants specified permissions to the browser context.
|
|
133
|
-
*
|
|
134
|
-
* @remarks
|
|
135
|
-
* Only grants corresponding permissions to the given origin if specified.
|
|
136
|
-
*
|
|
137
|
-
* @see https://playwright.dev/docs/api/class-browsercontext#browser-context-grant-permissions
|
|
138
|
-
*/
|
|
139
|
-
grantPermissions(permissions: PlaywrightPermission[], options?: PlaywrightGrantPermissionsOptions): Promise<void>;
|
|
140
|
-
/**
|
|
141
|
-
* Clears all permission overrides for the browser context.
|
|
142
|
-
*
|
|
143
|
-
* @see https://playwright.dev/docs/api/class-browsercontext#browser-context-clear-permissions
|
|
144
|
-
*/
|
|
145
|
-
clearPermissions(): Promise<void>;
|
|
146
|
-
/**
|
|
147
|
-
* Adds a script which would be evaluated in one of the following scenarios: whenever a page is created in the context or navigated.
|
|
148
|
-
*
|
|
149
|
-
* @remarks
|
|
150
|
-
* The script is evaluated before any page script. Use when you want to inject JavaScript before the page loads.
|
|
151
|
-
*
|
|
152
|
-
* @see https://playwright.dev/docs/api/class-browsercontext#browser-context-add-init-script
|
|
153
|
-
*/
|
|
154
|
-
addInitScript(script: Function | string | {
|
|
155
|
-
path?: string;
|
|
156
|
-
content?: string;
|
|
157
|
-
}, arg?: unknown): Promise<void>;
|
|
158
|
-
/**
|
|
159
|
-
* Adds a function called name on the window object of every frame in every page in the context.
|
|
160
|
-
*
|
|
161
|
-
* @remarks
|
|
162
|
-
* When called, the function executes callback and returns a Promise which resolves to the return value of callback. The first argument of the callback function contains information about the caller.
|
|
163
|
-
*
|
|
164
|
-
* @see https://playwright.dev/docs/api/class-browsercontext#browser-context-expose-binding
|
|
165
|
-
*/
|
|
166
|
-
exposeBinding(name: string, callback: Function, options?: {
|
|
167
|
-
handle?: boolean;
|
|
168
|
-
}): Promise<void>;
|
|
169
|
-
/**
|
|
170
|
-
* Routing provides the capability to modify network requests that are made by any page in the browser context.
|
|
171
|
-
*
|
|
172
|
-
* @remarks
|
|
173
|
-
* Once routing is enabled, every request matching the url pattern will stall unless it is continued, fulfilled, or aborted.
|
|
174
|
-
*
|
|
175
|
-
* @see https://playwright.dev/docs/api/class-browsercontext#browser-context-route
|
|
176
|
-
*/
|
|
177
|
-
route(url: string | RegExp | ((url: URL) => boolean), handler: Function, options?: PlaywrightRouteOptions): Promise<void>;
|
|
178
|
-
/**
|
|
179
|
-
* If specified, network requests that are made in the context will be served from the HAR file.
|
|
180
|
-
* @param har - Path to a HAR file with recorded network data.
|
|
181
|
-
*
|
|
182
|
-
* @remarks
|
|
183
|
-
* Read more about Replaying from HAR.
|
|
184
|
-
*
|
|
185
|
-
* @see https://playwright.dev/docs/api/class-browsercontext#browser-context-route-from-har
|
|
186
|
-
*/
|
|
187
|
-
routeFromHAR(har: string, options?: PlaywrightRouteFromHAROptions): Promise<void>;
|
|
188
|
-
/**
|
|
189
|
-
* Removes a route created with browserContext.route(). When handler is not specified, removes all routes for the url.
|
|
190
|
-
*
|
|
191
|
-
* @see https://playwright.dev/docs/api/class-browsercontext#browser-context-unroute
|
|
192
|
-
*/
|
|
193
|
-
unroute(url: string | RegExp | ((url: URL) => boolean), handler?: Function): Promise<void>;
|
|
194
|
-
/**
|
|
195
|
-
* Removes all routes created with browserContext.route() and browserContext.routeFromHAR().
|
|
196
|
-
*
|
|
197
|
-
* @see https://playwright.dev/docs/api/class-browsercontext#browser-context-unroute-all
|
|
198
|
-
*/
|
|
199
|
-
unrouteAll(options?: PlaywrightUnrouteAllOptions): Promise<void>;
|
|
200
|
-
/**
|
|
201
|
-
* Sets extra HTTP headers that will be sent with every request in the context.
|
|
202
|
-
*
|
|
203
|
-
* @remarks
|
|
204
|
-
* These headers are merged with page-specific extra HTTP headers set with page.setExtraHTTPHeaders(). If page overrides a particular header, page-specific header value will be used instead of the browser context header value.
|
|
205
|
-
*
|
|
206
|
-
* @see https://playwright.dev/docs/api/class-browsercontext#browser-context-set-extra-http-headers
|
|
207
|
-
*/
|
|
208
|
-
setExtraHTTPHeaders(headers: Record<string, string>): Promise<void>;
|
|
209
|
-
/**
|
|
210
|
-
* Sets HTTP credentials for HTTP authentication.
|
|
211
|
-
*
|
|
212
|
-
* @remarks
|
|
213
|
-
* Deprecated: Browsers may cache credentials after successful authentication. Create a new browser context instead.
|
|
214
|
-
*
|
|
215
|
-
* @see https://playwright.dev/docs/api/class-browsercontext#browser-context-set-http-credentials
|
|
216
|
-
*/
|
|
217
|
-
setHTTPCredentials(httpCredentials: PlaywrightHttpCredentials | null): Promise<void>;
|
|
218
|
-
/**
|
|
219
|
-
* Sets whether to emulate network being offline for the browser context.
|
|
220
|
-
*
|
|
221
|
-
* @see https://playwright.dev/docs/api/class-browsercontext#browser-context-set-offline
|
|
222
|
-
*/
|
|
223
|
-
setOffline(offline: boolean): Promise<void>;
|
|
224
|
-
/**
|
|
225
|
-
* Sets the contexts geolocation. Passing null clears geolocation.
|
|
226
|
-
*
|
|
227
|
-
* @remarks
|
|
228
|
-
* Requires the geolocation permission to be granted.
|
|
229
|
-
*
|
|
230
|
-
* @see https://playwright.dev/docs/api/class-browsercontext#browser-context-set-geolocation
|
|
231
|
-
*/
|
|
232
|
-
setGeolocation(geolocation: PlaywrightGeolocation | null): Promise<void>;
|
|
233
|
-
/**
|
|
234
|
-
* Returns storage state for this browser context.
|
|
235
|
-
*
|
|
236
|
-
* @remarks
|
|
237
|
-
* Contains current cookies and local storage snapshot.
|
|
238
|
-
*
|
|
239
|
-
* @see https://playwright.dev/docs/api/class-browsercontext#browser-context-storage-state
|
|
240
|
-
*/
|
|
241
|
-
storageState(options?: {
|
|
242
|
-
path?: string;
|
|
243
|
-
}): Promise<PlaywrightStorageState>;
|
|
244
|
-
/**
|
|
245
|
-
* Waits for event to fire and passes its value into the predicate function.
|
|
246
|
-
*
|
|
247
|
-
* @remarks
|
|
248
|
-
* Returns when the predicate returns truthy value. Will throw an error if the context closes before the event is fired.
|
|
249
|
-
*
|
|
250
|
-
* @see https://playwright.dev/docs/api/class-browsercontext#browser-context-wait-for-event
|
|
251
|
-
*/
|
|
252
|
-
waitForEvent<T = unknown>(event: string, optionsOrPredicate?: PlaywrightWaitForEventOptions | ((event: unknown) => boolean)): Promise<T>;
|
|
253
|
-
/**
|
|
254
|
-
* Allows modifying WebSocket connections made by pages in the context.
|
|
255
|
-
* @param url - URL pattern to match WebSocket connections.
|
|
256
|
-
* @param handler - Handler function to route the WebSocket.
|
|
257
|
-
*
|
|
258
|
-
* @remarks
|
|
259
|
-
* Only WebSockets created after this method was called will be routed. It is recommended to call this method before creating any pages.
|
|
260
|
-
*
|
|
261
|
-
* @see https://playwright.dev/docs/api/class-browsercontext#browser-context-route-web-socket
|
|
262
|
-
*/
|
|
263
|
-
routeWebSocket(url: string | RegExp | ((url: URL) => boolean), handler: Function): Promise<void>;
|
|
264
|
-
/**
|
|
265
|
-
* Closes the browser context. All the pages that belong to the browser context will be closed.
|
|
266
|
-
*
|
|
267
|
-
* @remarks
|
|
268
|
-
* The default browser context cannot be closed.
|
|
269
|
-
*
|
|
270
|
-
* @see https://playwright.dev/docs/api/class-browsercontext#browser-context-close
|
|
271
|
-
*/
|
|
272
|
-
close(options?: {
|
|
273
|
-
reason?: string;
|
|
274
|
-
}): Promise<void>;
|
|
275
|
-
/**
|
|
276
|
-
* Returns all background pages in the context.
|
|
277
|
-
*
|
|
278
|
-
* @remarks
|
|
279
|
-
* Deprecated. Background pages are only supported on Chromium-based browsers.
|
|
280
|
-
*
|
|
281
|
-
* @see https://playwright.dev/docs/api/class-browsercontext#browser-context-background-pages
|
|
282
|
-
*/
|
|
283
|
-
backgroundPages(): Promise<RemotePlaywrightPage[]>;
|
|
284
|
-
}
|