airbrowser-client 1.7.0 → 1.8.1
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 +3 -2
- package/api.ts +183 -11
- package/dist/api.d.ts +114 -11
- package/dist/api.js +127 -1
- package/dist/esm/api.d.ts +114 -11
- package/dist/esm/api.js +126 -0
- package/docs/BrowserApi.md +52 -0
- package/docs/EmulateRequest.md +1 -1
- package/docs/SelectRequest.md +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
## airbrowser-client@1.
|
|
1
|
+
## airbrowser-client@1.8.1
|
|
2
2
|
|
|
3
3
|
This generator creates TypeScript/JavaScript client that utilizes [axios](https://github.com/axios/axios). The generated Node module can be used in the following environments:
|
|
4
4
|
|
|
@@ -36,7 +36,7 @@ navigate to the folder of your consuming project and run one of the following co
|
|
|
36
36
|
_published:_
|
|
37
37
|
|
|
38
38
|
```
|
|
39
|
-
npm install airbrowser-client@1.
|
|
39
|
+
npm install airbrowser-client@1.8.1 --save
|
|
40
40
|
```
|
|
41
41
|
|
|
42
42
|
_unPublished (not recommended):_
|
|
@@ -62,6 +62,7 @@ Class | Method | HTTP request | Description
|
|
|
62
62
|
*BrowserApi* | [**emulate**](docs/BrowserApi.md#emulate) | **POST** /browser/{browser_id}/emulate | Emulation: set, clear, list_devices
|
|
63
63
|
*BrowserApi* | [**executeScript**](docs/BrowserApi.md#executescript) | **POST** /browser/{browser_id}/execute_script | Execute JavaScript
|
|
64
64
|
*BrowserApi* | [**fillForm**](docs/BrowserApi.md#fillform) | **POST** /browser/{browser_id}/fill_form | Fill multiple form fields
|
|
65
|
+
*BrowserApi* | [**getCdpEndpoint**](docs/BrowserApi.md#getcdpendpoint) | **GET** /browser/{browser_id}/get_cdp_endpoint | Get Chrome DevTools Protocol WebSocket URL for direct CDP access
|
|
65
66
|
*BrowserApi* | [**getContent**](docs/BrowserApi.md#getcontent) | **GET** /browser/{browser_id}/get_content | Get page HTML
|
|
66
67
|
*BrowserApi* | [**getElementData**](docs/BrowserApi.md#getelementdata) | **GET** /browser/{browser_id}/get_element_data | Get element text, attribute, or property
|
|
67
68
|
*BrowserApi* | [**getUrl**](docs/BrowserApi.md#geturl) | **GET** /browser/{browser_id}/get_url | Get current URL
|
package/api.ts
CHANGED
|
@@ -41,12 +41,24 @@ export interface BrowsersRequest {
|
|
|
41
41
|
/**
|
|
42
42
|
* action
|
|
43
43
|
*/
|
|
44
|
-
'action':
|
|
44
|
+
'action': BrowsersRequestActionEnum;
|
|
45
45
|
/**
|
|
46
46
|
* browser_id
|
|
47
47
|
*/
|
|
48
48
|
'browser_id'?: string;
|
|
49
49
|
}
|
|
50
|
+
|
|
51
|
+
export const BrowsersRequestActionEnum = {
|
|
52
|
+
List: 'list',
|
|
53
|
+
Info: 'info',
|
|
54
|
+
CloseAll: 'close_all',
|
|
55
|
+
Kill: 'kill',
|
|
56
|
+
KillAll: 'kill_all',
|
|
57
|
+
Restore: 'restore'
|
|
58
|
+
} as const;
|
|
59
|
+
|
|
60
|
+
export type BrowsersRequestActionEnum = typeof BrowsersRequestActionEnum[keyof typeof BrowsersRequestActionEnum];
|
|
61
|
+
|
|
50
62
|
export interface ClickRequest {
|
|
51
63
|
/**
|
|
52
64
|
* selector
|
|
@@ -69,12 +81,22 @@ export interface ConsoleLogsRequest {
|
|
|
69
81
|
/**
|
|
70
82
|
* action
|
|
71
83
|
*/
|
|
72
|
-
'action':
|
|
84
|
+
'action': ConsoleLogsRequestActionEnum;
|
|
73
85
|
/**
|
|
74
86
|
* limit
|
|
75
87
|
*/
|
|
76
88
|
'limit'?: number;
|
|
77
89
|
}
|
|
90
|
+
|
|
91
|
+
export const ConsoleLogsRequestActionEnum = {
|
|
92
|
+
Get: 'get',
|
|
93
|
+
Clear: 'clear',
|
|
94
|
+
Enable: 'enable',
|
|
95
|
+
Disable: 'disable'
|
|
96
|
+
} as const;
|
|
97
|
+
|
|
98
|
+
export type ConsoleLogsRequestActionEnum = typeof ConsoleLogsRequestActionEnum[keyof typeof ConsoleLogsRequestActionEnum];
|
|
99
|
+
|
|
78
100
|
export interface CreateBrowserRequest {
|
|
79
101
|
/**
|
|
80
102
|
* uc
|
|
@@ -141,17 +163,26 @@ export interface DialogRequest {
|
|
|
141
163
|
/**
|
|
142
164
|
* action
|
|
143
165
|
*/
|
|
144
|
-
'action':
|
|
166
|
+
'action': DialogRequestActionEnum;
|
|
145
167
|
/**
|
|
146
168
|
* text
|
|
147
169
|
*/
|
|
148
170
|
'text'?: string;
|
|
149
171
|
}
|
|
172
|
+
|
|
173
|
+
export const DialogRequestActionEnum = {
|
|
174
|
+
Get: 'get',
|
|
175
|
+
Accept: 'accept',
|
|
176
|
+
Dismiss: 'dismiss'
|
|
177
|
+
} as const;
|
|
178
|
+
|
|
179
|
+
export type DialogRequestActionEnum = typeof DialogRequestActionEnum[keyof typeof DialogRequestActionEnum];
|
|
180
|
+
|
|
150
181
|
export interface EmulateRequest {
|
|
151
182
|
/**
|
|
152
183
|
* action
|
|
153
184
|
*/
|
|
154
|
-
'action'?:
|
|
185
|
+
'action'?: EmulateRequestActionEnum;
|
|
155
186
|
/**
|
|
156
187
|
* device
|
|
157
188
|
*/
|
|
@@ -177,6 +208,15 @@ export interface EmulateRequest {
|
|
|
177
208
|
*/
|
|
178
209
|
'user_agent'?: string;
|
|
179
210
|
}
|
|
211
|
+
|
|
212
|
+
export const EmulateRequestActionEnum = {
|
|
213
|
+
Set: 'set',
|
|
214
|
+
Clear: 'clear',
|
|
215
|
+
ListDevices: 'list_devices'
|
|
216
|
+
} as const;
|
|
217
|
+
|
|
218
|
+
export type EmulateRequestActionEnum = typeof EmulateRequestActionEnum[keyof typeof EmulateRequestActionEnum];
|
|
219
|
+
|
|
180
220
|
export interface ErrorResponse {
|
|
181
221
|
/**
|
|
182
222
|
* Operation success (false)
|
|
@@ -315,13 +355,22 @@ export interface HistoryRequest {
|
|
|
315
355
|
/**
|
|
316
356
|
* action
|
|
317
357
|
*/
|
|
318
|
-
'action':
|
|
358
|
+
'action': HistoryRequestActionEnum;
|
|
319
359
|
}
|
|
360
|
+
|
|
361
|
+
export const HistoryRequestActionEnum = {
|
|
362
|
+
Back: 'back',
|
|
363
|
+
Forward: 'forward',
|
|
364
|
+
Refresh: 'refresh'
|
|
365
|
+
} as const;
|
|
366
|
+
|
|
367
|
+
export type HistoryRequestActionEnum = typeof HistoryRequestActionEnum[keyof typeof HistoryRequestActionEnum];
|
|
368
|
+
|
|
320
369
|
export interface MouseRequest {
|
|
321
370
|
/**
|
|
322
371
|
* action
|
|
323
372
|
*/
|
|
324
|
-
'action':
|
|
373
|
+
'action': MouseRequestActionEnum;
|
|
325
374
|
/**
|
|
326
375
|
* selector
|
|
327
376
|
*/
|
|
@@ -339,6 +388,14 @@ export interface MouseRequest {
|
|
|
339
388
|
*/
|
|
340
389
|
'by'?: string;
|
|
341
390
|
}
|
|
391
|
+
|
|
392
|
+
export const MouseRequestActionEnum = {
|
|
393
|
+
Hover: 'hover',
|
|
394
|
+
Drag: 'drag'
|
|
395
|
+
} as const;
|
|
396
|
+
|
|
397
|
+
export type MouseRequestActionEnum = typeof MouseRequestActionEnum[keyof typeof MouseRequestActionEnum];
|
|
398
|
+
|
|
342
399
|
export interface NavigateBrowserRequest {
|
|
343
400
|
/**
|
|
344
401
|
* url
|
|
@@ -353,22 +410,42 @@ export interface NetworkLogsRequest {
|
|
|
353
410
|
/**
|
|
354
411
|
* action
|
|
355
412
|
*/
|
|
356
|
-
'action':
|
|
413
|
+
'action': NetworkLogsRequestActionEnum;
|
|
357
414
|
/**
|
|
358
415
|
* limit
|
|
359
416
|
*/
|
|
360
417
|
'limit'?: number;
|
|
361
418
|
}
|
|
419
|
+
|
|
420
|
+
export const NetworkLogsRequestActionEnum = {
|
|
421
|
+
Get: 'get',
|
|
422
|
+
Clear: 'clear',
|
|
423
|
+
Enable: 'enable',
|
|
424
|
+
Disable: 'disable'
|
|
425
|
+
} as const;
|
|
426
|
+
|
|
427
|
+
export type NetworkLogsRequestActionEnum = typeof NetworkLogsRequestActionEnum[keyof typeof NetworkLogsRequestActionEnum];
|
|
428
|
+
|
|
362
429
|
export interface PerformanceRequest {
|
|
363
430
|
/**
|
|
364
431
|
* action
|
|
365
432
|
*/
|
|
366
|
-
'action':
|
|
433
|
+
'action': PerformanceRequestActionEnum;
|
|
367
434
|
/**
|
|
368
435
|
* categories
|
|
369
436
|
*/
|
|
370
437
|
'categories'?: string;
|
|
371
438
|
}
|
|
439
|
+
|
|
440
|
+
export const PerformanceRequestActionEnum = {
|
|
441
|
+
StartTrace: 'start_trace',
|
|
442
|
+
StopTrace: 'stop_trace',
|
|
443
|
+
Metrics: 'metrics',
|
|
444
|
+
Analyze: 'analyze'
|
|
445
|
+
} as const;
|
|
446
|
+
|
|
447
|
+
export type PerformanceRequestActionEnum = typeof PerformanceRequestActionEnum[keyof typeof PerformanceRequestActionEnum];
|
|
448
|
+
|
|
372
449
|
export interface PoolScaled {
|
|
373
450
|
/**
|
|
374
451
|
* Operation success
|
|
@@ -519,7 +596,7 @@ export interface SelectRequest {
|
|
|
519
596
|
/**
|
|
520
597
|
* action
|
|
521
598
|
*/
|
|
522
|
-
'action'?:
|
|
599
|
+
'action'?: SelectRequestActionEnum;
|
|
523
600
|
/**
|
|
524
601
|
* value
|
|
525
602
|
*/
|
|
@@ -537,6 +614,14 @@ export interface SelectRequest {
|
|
|
537
614
|
*/
|
|
538
615
|
'by'?: string;
|
|
539
616
|
}
|
|
617
|
+
|
|
618
|
+
export const SelectRequestActionEnum = {
|
|
619
|
+
Select: 'select',
|
|
620
|
+
Options: 'options'
|
|
621
|
+
} as const;
|
|
622
|
+
|
|
623
|
+
export type SelectRequestActionEnum = typeof SelectRequestActionEnum[keyof typeof SelectRequestActionEnum];
|
|
624
|
+
|
|
540
625
|
export interface SnapshotRequest {
|
|
541
626
|
/**
|
|
542
627
|
* snapshot_type
|
|
@@ -547,7 +632,7 @@ export interface TabsRequest {
|
|
|
547
632
|
/**
|
|
548
633
|
* action
|
|
549
634
|
*/
|
|
550
|
-
'action':
|
|
635
|
+
'action': TabsRequestActionEnum;
|
|
551
636
|
/**
|
|
552
637
|
* url
|
|
553
638
|
*/
|
|
@@ -561,6 +646,17 @@ export interface TabsRequest {
|
|
|
561
646
|
*/
|
|
562
647
|
'handle'?: string;
|
|
563
648
|
}
|
|
649
|
+
|
|
650
|
+
export const TabsRequestActionEnum = {
|
|
651
|
+
List: 'list',
|
|
652
|
+
New: 'new',
|
|
653
|
+
Switch: 'switch',
|
|
654
|
+
Close: 'close',
|
|
655
|
+
Current: 'current'
|
|
656
|
+
} as const;
|
|
657
|
+
|
|
658
|
+
export type TabsRequestActionEnum = typeof TabsRequestActionEnum[keyof typeof TabsRequestActionEnum];
|
|
659
|
+
|
|
564
660
|
export interface TakeScreenshotRequest {
|
|
565
661
|
/**
|
|
566
662
|
* full_page
|
|
@@ -607,7 +703,7 @@ export interface WaitElementRequest {
|
|
|
607
703
|
/**
|
|
608
704
|
* until
|
|
609
705
|
*/
|
|
610
|
-
'until':
|
|
706
|
+
'until': WaitElementRequestUntilEnum;
|
|
611
707
|
/**
|
|
612
708
|
* timeout
|
|
613
709
|
*/
|
|
@@ -618,6 +714,14 @@ export interface WaitElementRequest {
|
|
|
618
714
|
'by'?: string;
|
|
619
715
|
}
|
|
620
716
|
|
|
717
|
+
export const WaitElementRequestUntilEnum = {
|
|
718
|
+
Visible: 'visible',
|
|
719
|
+
Hidden: 'hidden'
|
|
720
|
+
} as const;
|
|
721
|
+
|
|
722
|
+
export type WaitElementRequestUntilEnum = typeof WaitElementRequestUntilEnum[keyof typeof WaitElementRequestUntilEnum];
|
|
723
|
+
|
|
724
|
+
|
|
621
725
|
/**
|
|
622
726
|
* BrowserApi - axios parameter creator
|
|
623
727
|
*/
|
|
@@ -1053,6 +1157,40 @@ export const BrowserApiAxiosParamCreator = function (configuration?: Configurati
|
|
|
1053
1157
|
options: localVarRequestOptions,
|
|
1054
1158
|
};
|
|
1055
1159
|
},
|
|
1160
|
+
/**
|
|
1161
|
+
* Returns the WebSocket URL that external tools (Playwright, Puppeteer, etc.) can use to connect directly to Chrome\'s DevTools Protocol for advanced automation like network interception, performance profiling, or custom CDP commands. The returned URL format: ws://host:port/devtools/browser/{guid} Note: The URL uses the container\'s internal address. For external access, ensure the CDP port is exposed and use the appropriate host address.
|
|
1162
|
+
* @summary Get Chrome DevTools Protocol WebSocket URL for direct CDP access
|
|
1163
|
+
* @param {string} browserId
|
|
1164
|
+
* @param {*} [options] Override http request option.
|
|
1165
|
+
* @throws {RequiredError}
|
|
1166
|
+
*/
|
|
1167
|
+
getCdpEndpoint: async (browserId: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
1168
|
+
// verify required parameter 'browserId' is not null or undefined
|
|
1169
|
+
assertParamExists('getCdpEndpoint', 'browserId', browserId)
|
|
1170
|
+
const localVarPath = `/browser/{browser_id}/get_cdp_endpoint`
|
|
1171
|
+
.replace(`{${"browser_id"}}`, encodeURIComponent(String(browserId)));
|
|
1172
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
1173
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
1174
|
+
let baseOptions;
|
|
1175
|
+
if (configuration) {
|
|
1176
|
+
baseOptions = configuration.baseOptions;
|
|
1177
|
+
}
|
|
1178
|
+
|
|
1179
|
+
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
|
|
1180
|
+
const localVarHeaderParameter = {} as any;
|
|
1181
|
+
const localVarQueryParameter = {} as any;
|
|
1182
|
+
|
|
1183
|
+
localVarHeaderParameter['Accept'] = 'application/json';
|
|
1184
|
+
|
|
1185
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
1186
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
1187
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
1188
|
+
|
|
1189
|
+
return {
|
|
1190
|
+
url: toPathString(localVarUrlObj),
|
|
1191
|
+
options: localVarRequestOptions,
|
|
1192
|
+
};
|
|
1193
|
+
},
|
|
1056
1194
|
/**
|
|
1057
1195
|
*
|
|
1058
1196
|
* @summary Get page HTML
|
|
@@ -2116,6 +2254,19 @@ export const BrowserApiFp = function(configuration?: Configuration) {
|
|
|
2116
2254
|
const localVarOperationServerBasePath = operationServerMap['BrowserApi.fillForm']?.[localVarOperationServerIndex]?.url;
|
|
2117
2255
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
2118
2256
|
},
|
|
2257
|
+
/**
|
|
2258
|
+
* Returns the WebSocket URL that external tools (Playwright, Puppeteer, etc.) can use to connect directly to Chrome\'s DevTools Protocol for advanced automation like network interception, performance profiling, or custom CDP commands. The returned URL format: ws://host:port/devtools/browser/{guid} Note: The URL uses the container\'s internal address. For external access, ensure the CDP port is exposed and use the appropriate host address.
|
|
2259
|
+
* @summary Get Chrome DevTools Protocol WebSocket URL for direct CDP access
|
|
2260
|
+
* @param {string} browserId
|
|
2261
|
+
* @param {*} [options] Override http request option.
|
|
2262
|
+
* @throws {RequiredError}
|
|
2263
|
+
*/
|
|
2264
|
+
async getCdpEndpoint(browserId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GenericResponse>> {
|
|
2265
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.getCdpEndpoint(browserId, options);
|
|
2266
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
2267
|
+
const localVarOperationServerBasePath = operationServerMap['BrowserApi.getCdpEndpoint']?.[localVarOperationServerIndex]?.url;
|
|
2268
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
2269
|
+
},
|
|
2119
2270
|
/**
|
|
2120
2271
|
*
|
|
2121
2272
|
* @summary Get page HTML
|
|
@@ -2567,6 +2718,16 @@ export const BrowserApiFactory = function (configuration?: Configuration, basePa
|
|
|
2567
2718
|
fillForm(browserId: string, payload: FillFormRequest, options?: RawAxiosRequestConfig): AxiosPromise<GenericResponse> {
|
|
2568
2719
|
return localVarFp.fillForm(browserId, payload, options).then((request) => request(axios, basePath));
|
|
2569
2720
|
},
|
|
2721
|
+
/**
|
|
2722
|
+
* Returns the WebSocket URL that external tools (Playwright, Puppeteer, etc.) can use to connect directly to Chrome\'s DevTools Protocol for advanced automation like network interception, performance profiling, or custom CDP commands. The returned URL format: ws://host:port/devtools/browser/{guid} Note: The URL uses the container\'s internal address. For external access, ensure the CDP port is exposed and use the appropriate host address.
|
|
2723
|
+
* @summary Get Chrome DevTools Protocol WebSocket URL for direct CDP access
|
|
2724
|
+
* @param {string} browserId
|
|
2725
|
+
* @param {*} [options] Override http request option.
|
|
2726
|
+
* @throws {RequiredError}
|
|
2727
|
+
*/
|
|
2728
|
+
getCdpEndpoint(browserId: string, options?: RawAxiosRequestConfig): AxiosPromise<GenericResponse> {
|
|
2729
|
+
return localVarFp.getCdpEndpoint(browserId, options).then((request) => request(axios, basePath));
|
|
2730
|
+
},
|
|
2570
2731
|
/**
|
|
2571
2732
|
*
|
|
2572
2733
|
* @summary Get page HTML
|
|
@@ -2958,6 +3119,17 @@ export class BrowserApi extends BaseAPI {
|
|
|
2958
3119
|
return BrowserApiFp(this.configuration).fillForm(browserId, payload, options).then((request) => request(this.axios, this.basePath));
|
|
2959
3120
|
}
|
|
2960
3121
|
|
|
3122
|
+
/**
|
|
3123
|
+
* Returns the WebSocket URL that external tools (Playwright, Puppeteer, etc.) can use to connect directly to Chrome\'s DevTools Protocol for advanced automation like network interception, performance profiling, or custom CDP commands. The returned URL format: ws://host:port/devtools/browser/{guid} Note: The URL uses the container\'s internal address. For external access, ensure the CDP port is exposed and use the appropriate host address.
|
|
3124
|
+
* @summary Get Chrome DevTools Protocol WebSocket URL for direct CDP access
|
|
3125
|
+
* @param {string} browserId
|
|
3126
|
+
* @param {*} [options] Override http request option.
|
|
3127
|
+
* @throws {RequiredError}
|
|
3128
|
+
*/
|
|
3129
|
+
public getCdpEndpoint(browserId: string, options?: RawAxiosRequestConfig) {
|
|
3130
|
+
return BrowserApiFp(this.configuration).getCdpEndpoint(browserId, options).then((request) => request(this.axios, this.basePath));
|
|
3131
|
+
}
|
|
3132
|
+
|
|
2961
3133
|
/**
|
|
2962
3134
|
*
|
|
2963
3135
|
* @summary Get page HTML
|
package/dist/api.d.ts
CHANGED
|
@@ -31,12 +31,21 @@ export interface BrowsersRequest {
|
|
|
31
31
|
/**
|
|
32
32
|
* action
|
|
33
33
|
*/
|
|
34
|
-
'action':
|
|
34
|
+
'action': BrowsersRequestActionEnum;
|
|
35
35
|
/**
|
|
36
36
|
* browser_id
|
|
37
37
|
*/
|
|
38
38
|
'browser_id'?: string;
|
|
39
39
|
}
|
|
40
|
+
export declare const BrowsersRequestActionEnum: {
|
|
41
|
+
readonly List: "list";
|
|
42
|
+
readonly Info: "info";
|
|
43
|
+
readonly CloseAll: "close_all";
|
|
44
|
+
readonly Kill: "kill";
|
|
45
|
+
readonly KillAll: "kill_all";
|
|
46
|
+
readonly Restore: "restore";
|
|
47
|
+
};
|
|
48
|
+
export type BrowsersRequestActionEnum = typeof BrowsersRequestActionEnum[keyof typeof BrowsersRequestActionEnum];
|
|
40
49
|
export interface ClickRequest {
|
|
41
50
|
/**
|
|
42
51
|
* selector
|
|
@@ -59,12 +68,19 @@ export interface ConsoleLogsRequest {
|
|
|
59
68
|
/**
|
|
60
69
|
* action
|
|
61
70
|
*/
|
|
62
|
-
'action':
|
|
71
|
+
'action': ConsoleLogsRequestActionEnum;
|
|
63
72
|
/**
|
|
64
73
|
* limit
|
|
65
74
|
*/
|
|
66
75
|
'limit'?: number;
|
|
67
76
|
}
|
|
77
|
+
export declare const ConsoleLogsRequestActionEnum: {
|
|
78
|
+
readonly Get: "get";
|
|
79
|
+
readonly Clear: "clear";
|
|
80
|
+
readonly Enable: "enable";
|
|
81
|
+
readonly Disable: "disable";
|
|
82
|
+
};
|
|
83
|
+
export type ConsoleLogsRequestActionEnum = typeof ConsoleLogsRequestActionEnum[keyof typeof ConsoleLogsRequestActionEnum];
|
|
68
84
|
export interface CreateBrowserRequest {
|
|
69
85
|
/**
|
|
70
86
|
* uc
|
|
@@ -131,17 +147,23 @@ export interface DialogRequest {
|
|
|
131
147
|
/**
|
|
132
148
|
* action
|
|
133
149
|
*/
|
|
134
|
-
'action':
|
|
150
|
+
'action': DialogRequestActionEnum;
|
|
135
151
|
/**
|
|
136
152
|
* text
|
|
137
153
|
*/
|
|
138
154
|
'text'?: string;
|
|
139
155
|
}
|
|
156
|
+
export declare const DialogRequestActionEnum: {
|
|
157
|
+
readonly Get: "get";
|
|
158
|
+
readonly Accept: "accept";
|
|
159
|
+
readonly Dismiss: "dismiss";
|
|
160
|
+
};
|
|
161
|
+
export type DialogRequestActionEnum = typeof DialogRequestActionEnum[keyof typeof DialogRequestActionEnum];
|
|
140
162
|
export interface EmulateRequest {
|
|
141
163
|
/**
|
|
142
164
|
* action
|
|
143
165
|
*/
|
|
144
|
-
'action'?:
|
|
166
|
+
'action'?: EmulateRequestActionEnum;
|
|
145
167
|
/**
|
|
146
168
|
* device
|
|
147
169
|
*/
|
|
@@ -167,6 +189,12 @@ export interface EmulateRequest {
|
|
|
167
189
|
*/
|
|
168
190
|
'user_agent'?: string;
|
|
169
191
|
}
|
|
192
|
+
export declare const EmulateRequestActionEnum: {
|
|
193
|
+
readonly Set: "set";
|
|
194
|
+
readonly Clear: "clear";
|
|
195
|
+
readonly ListDevices: "list_devices";
|
|
196
|
+
};
|
|
197
|
+
export type EmulateRequestActionEnum = typeof EmulateRequestActionEnum[keyof typeof EmulateRequestActionEnum];
|
|
170
198
|
export interface ErrorResponse {
|
|
171
199
|
/**
|
|
172
200
|
* Operation success (false)
|
|
@@ -305,13 +333,19 @@ export interface HistoryRequest {
|
|
|
305
333
|
/**
|
|
306
334
|
* action
|
|
307
335
|
*/
|
|
308
|
-
'action':
|
|
336
|
+
'action': HistoryRequestActionEnum;
|
|
309
337
|
}
|
|
338
|
+
export declare const HistoryRequestActionEnum: {
|
|
339
|
+
readonly Back: "back";
|
|
340
|
+
readonly Forward: "forward";
|
|
341
|
+
readonly Refresh: "refresh";
|
|
342
|
+
};
|
|
343
|
+
export type HistoryRequestActionEnum = typeof HistoryRequestActionEnum[keyof typeof HistoryRequestActionEnum];
|
|
310
344
|
export interface MouseRequest {
|
|
311
345
|
/**
|
|
312
346
|
* action
|
|
313
347
|
*/
|
|
314
|
-
'action':
|
|
348
|
+
'action': MouseRequestActionEnum;
|
|
315
349
|
/**
|
|
316
350
|
* selector
|
|
317
351
|
*/
|
|
@@ -329,6 +363,11 @@ export interface MouseRequest {
|
|
|
329
363
|
*/
|
|
330
364
|
'by'?: string;
|
|
331
365
|
}
|
|
366
|
+
export declare const MouseRequestActionEnum: {
|
|
367
|
+
readonly Hover: "hover";
|
|
368
|
+
readonly Drag: "drag";
|
|
369
|
+
};
|
|
370
|
+
export type MouseRequestActionEnum = typeof MouseRequestActionEnum[keyof typeof MouseRequestActionEnum];
|
|
332
371
|
export interface NavigateBrowserRequest {
|
|
333
372
|
/**
|
|
334
373
|
* url
|
|
@@ -343,22 +382,36 @@ export interface NetworkLogsRequest {
|
|
|
343
382
|
/**
|
|
344
383
|
* action
|
|
345
384
|
*/
|
|
346
|
-
'action':
|
|
385
|
+
'action': NetworkLogsRequestActionEnum;
|
|
347
386
|
/**
|
|
348
387
|
* limit
|
|
349
388
|
*/
|
|
350
389
|
'limit'?: number;
|
|
351
390
|
}
|
|
391
|
+
export declare const NetworkLogsRequestActionEnum: {
|
|
392
|
+
readonly Get: "get";
|
|
393
|
+
readonly Clear: "clear";
|
|
394
|
+
readonly Enable: "enable";
|
|
395
|
+
readonly Disable: "disable";
|
|
396
|
+
};
|
|
397
|
+
export type NetworkLogsRequestActionEnum = typeof NetworkLogsRequestActionEnum[keyof typeof NetworkLogsRequestActionEnum];
|
|
352
398
|
export interface PerformanceRequest {
|
|
353
399
|
/**
|
|
354
400
|
* action
|
|
355
401
|
*/
|
|
356
|
-
'action':
|
|
402
|
+
'action': PerformanceRequestActionEnum;
|
|
357
403
|
/**
|
|
358
404
|
* categories
|
|
359
405
|
*/
|
|
360
406
|
'categories'?: string;
|
|
361
407
|
}
|
|
408
|
+
export declare const PerformanceRequestActionEnum: {
|
|
409
|
+
readonly StartTrace: "start_trace";
|
|
410
|
+
readonly StopTrace: "stop_trace";
|
|
411
|
+
readonly Metrics: "metrics";
|
|
412
|
+
readonly Analyze: "analyze";
|
|
413
|
+
};
|
|
414
|
+
export type PerformanceRequestActionEnum = typeof PerformanceRequestActionEnum[keyof typeof PerformanceRequestActionEnum];
|
|
362
415
|
export interface PoolScaled {
|
|
363
416
|
/**
|
|
364
417
|
* Operation success
|
|
@@ -509,7 +562,7 @@ export interface SelectRequest {
|
|
|
509
562
|
/**
|
|
510
563
|
* action
|
|
511
564
|
*/
|
|
512
|
-
'action'?:
|
|
565
|
+
'action'?: SelectRequestActionEnum;
|
|
513
566
|
/**
|
|
514
567
|
* value
|
|
515
568
|
*/
|
|
@@ -527,6 +580,11 @@ export interface SelectRequest {
|
|
|
527
580
|
*/
|
|
528
581
|
'by'?: string;
|
|
529
582
|
}
|
|
583
|
+
export declare const SelectRequestActionEnum: {
|
|
584
|
+
readonly Select: "select";
|
|
585
|
+
readonly Options: "options";
|
|
586
|
+
};
|
|
587
|
+
export type SelectRequestActionEnum = typeof SelectRequestActionEnum[keyof typeof SelectRequestActionEnum];
|
|
530
588
|
export interface SnapshotRequest {
|
|
531
589
|
/**
|
|
532
590
|
* snapshot_type
|
|
@@ -537,7 +595,7 @@ export interface TabsRequest {
|
|
|
537
595
|
/**
|
|
538
596
|
* action
|
|
539
597
|
*/
|
|
540
|
-
'action':
|
|
598
|
+
'action': TabsRequestActionEnum;
|
|
541
599
|
/**
|
|
542
600
|
* url
|
|
543
601
|
*/
|
|
@@ -551,6 +609,14 @@ export interface TabsRequest {
|
|
|
551
609
|
*/
|
|
552
610
|
'handle'?: string;
|
|
553
611
|
}
|
|
612
|
+
export declare const TabsRequestActionEnum: {
|
|
613
|
+
readonly List: "list";
|
|
614
|
+
readonly New: "new";
|
|
615
|
+
readonly Switch: "switch";
|
|
616
|
+
readonly Close: "close";
|
|
617
|
+
readonly Current: "current";
|
|
618
|
+
};
|
|
619
|
+
export type TabsRequestActionEnum = typeof TabsRequestActionEnum[keyof typeof TabsRequestActionEnum];
|
|
554
620
|
export interface TakeScreenshotRequest {
|
|
555
621
|
/**
|
|
556
622
|
* full_page
|
|
@@ -597,7 +663,7 @@ export interface WaitElementRequest {
|
|
|
597
663
|
/**
|
|
598
664
|
* until
|
|
599
665
|
*/
|
|
600
|
-
'until':
|
|
666
|
+
'until': WaitElementRequestUntilEnum;
|
|
601
667
|
/**
|
|
602
668
|
* timeout
|
|
603
669
|
*/
|
|
@@ -607,6 +673,11 @@ export interface WaitElementRequest {
|
|
|
607
673
|
*/
|
|
608
674
|
'by'?: string;
|
|
609
675
|
}
|
|
676
|
+
export declare const WaitElementRequestUntilEnum: {
|
|
677
|
+
readonly Visible: "visible";
|
|
678
|
+
readonly Hidden: "hidden";
|
|
679
|
+
};
|
|
680
|
+
export type WaitElementRequestUntilEnum = typeof WaitElementRequestUntilEnum[keyof typeof WaitElementRequestUntilEnum];
|
|
610
681
|
/**
|
|
611
682
|
* BrowserApi - axios parameter creator
|
|
612
683
|
*/
|
|
@@ -709,6 +780,14 @@ export declare const BrowserApiAxiosParamCreator: (configuration?: Configuration
|
|
|
709
780
|
* @throws {RequiredError}
|
|
710
781
|
*/
|
|
711
782
|
fillForm: (browserId: string, payload: FillFormRequest, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
|
|
783
|
+
/**
|
|
784
|
+
* Returns the WebSocket URL that external tools (Playwright, Puppeteer, etc.) can use to connect directly to Chrome\'s DevTools Protocol for advanced automation like network interception, performance profiling, or custom CDP commands. The returned URL format: ws://host:port/devtools/browser/{guid} Note: The URL uses the container\'s internal address. For external access, ensure the CDP port is exposed and use the appropriate host address.
|
|
785
|
+
* @summary Get Chrome DevTools Protocol WebSocket URL for direct CDP access
|
|
786
|
+
* @param {string} browserId
|
|
787
|
+
* @param {*} [options] Override http request option.
|
|
788
|
+
* @throws {RequiredError}
|
|
789
|
+
*/
|
|
790
|
+
getCdpEndpoint: (browserId: string, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
|
|
712
791
|
/**
|
|
713
792
|
*
|
|
714
793
|
* @summary Get page HTML
|
|
@@ -1019,6 +1098,14 @@ export declare const BrowserApiFp: (configuration?: Configuration) => {
|
|
|
1019
1098
|
* @throws {RequiredError}
|
|
1020
1099
|
*/
|
|
1021
1100
|
fillForm(browserId: string, payload: FillFormRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GenericResponse>>;
|
|
1101
|
+
/**
|
|
1102
|
+
* Returns the WebSocket URL that external tools (Playwright, Puppeteer, etc.) can use to connect directly to Chrome\'s DevTools Protocol for advanced automation like network interception, performance profiling, or custom CDP commands. The returned URL format: ws://host:port/devtools/browser/{guid} Note: The URL uses the container\'s internal address. For external access, ensure the CDP port is exposed and use the appropriate host address.
|
|
1103
|
+
* @summary Get Chrome DevTools Protocol WebSocket URL for direct CDP access
|
|
1104
|
+
* @param {string} browserId
|
|
1105
|
+
* @param {*} [options] Override http request option.
|
|
1106
|
+
* @throws {RequiredError}
|
|
1107
|
+
*/
|
|
1108
|
+
getCdpEndpoint(browserId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GenericResponse>>;
|
|
1022
1109
|
/**
|
|
1023
1110
|
*
|
|
1024
1111
|
* @summary Get page HTML
|
|
@@ -1329,6 +1416,14 @@ export declare const BrowserApiFactory: (configuration?: Configuration, basePath
|
|
|
1329
1416
|
* @throws {RequiredError}
|
|
1330
1417
|
*/
|
|
1331
1418
|
fillForm(browserId: string, payload: FillFormRequest, options?: RawAxiosRequestConfig): AxiosPromise<GenericResponse>;
|
|
1419
|
+
/**
|
|
1420
|
+
* Returns the WebSocket URL that external tools (Playwright, Puppeteer, etc.) can use to connect directly to Chrome\'s DevTools Protocol for advanced automation like network interception, performance profiling, or custom CDP commands. The returned URL format: ws://host:port/devtools/browser/{guid} Note: The URL uses the container\'s internal address. For external access, ensure the CDP port is exposed and use the appropriate host address.
|
|
1421
|
+
* @summary Get Chrome DevTools Protocol WebSocket URL for direct CDP access
|
|
1422
|
+
* @param {string} browserId
|
|
1423
|
+
* @param {*} [options] Override http request option.
|
|
1424
|
+
* @throws {RequiredError}
|
|
1425
|
+
*/
|
|
1426
|
+
getCdpEndpoint(browserId: string, options?: RawAxiosRequestConfig): AxiosPromise<GenericResponse>;
|
|
1332
1427
|
/**
|
|
1333
1428
|
*
|
|
1334
1429
|
* @summary Get page HTML
|
|
@@ -1639,6 +1734,14 @@ export declare class BrowserApi extends BaseAPI {
|
|
|
1639
1734
|
* @throws {RequiredError}
|
|
1640
1735
|
*/
|
|
1641
1736
|
fillForm(browserId: string, payload: FillFormRequest, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<GenericResponse, any, {}>>;
|
|
1737
|
+
/**
|
|
1738
|
+
* Returns the WebSocket URL that external tools (Playwright, Puppeteer, etc.) can use to connect directly to Chrome\'s DevTools Protocol for advanced automation like network interception, performance profiling, or custom CDP commands. The returned URL format: ws://host:port/devtools/browser/{guid} Note: The URL uses the container\'s internal address. For external access, ensure the CDP port is exposed and use the appropriate host address.
|
|
1739
|
+
* @summary Get Chrome DevTools Protocol WebSocket URL for direct CDP access
|
|
1740
|
+
* @param {string} browserId
|
|
1741
|
+
* @param {*} [options] Override http request option.
|
|
1742
|
+
* @throws {RequiredError}
|
|
1743
|
+
*/
|
|
1744
|
+
getCdpEndpoint(browserId: string, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<GenericResponse, any, {}>>;
|
|
1642
1745
|
/**
|
|
1643
1746
|
*
|
|
1644
1747
|
* @summary Get page HTML
|
package/dist/api.js
CHANGED
|
@@ -22,13 +22,73 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
22
22
|
});
|
|
23
23
|
};
|
|
24
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
-
exports.ProfilesApi = exports.ProfilesApiFactory = exports.ProfilesApiFp = exports.ProfilesApiAxiosParamCreator = exports.PoolApi = exports.PoolApiFactory = exports.PoolApiFp = exports.PoolApiAxiosParamCreator = exports.HealthApi = exports.HealthApiFactory = exports.HealthApiFp = exports.HealthApiAxiosParamCreator = exports.BrowserApi = exports.BrowserApiFactory = exports.BrowserApiFp = exports.BrowserApiAxiosParamCreator = void 0;
|
|
25
|
+
exports.ProfilesApi = exports.ProfilesApiFactory = exports.ProfilesApiFp = exports.ProfilesApiAxiosParamCreator = exports.PoolApi = exports.PoolApiFactory = exports.PoolApiFp = exports.PoolApiAxiosParamCreator = exports.HealthApi = exports.HealthApiFactory = exports.HealthApiFp = exports.HealthApiAxiosParamCreator = exports.BrowserApi = exports.BrowserApiFactory = exports.BrowserApiFp = exports.BrowserApiAxiosParamCreator = exports.WaitElementRequestUntilEnum = exports.TabsRequestActionEnum = exports.SelectRequestActionEnum = exports.PerformanceRequestActionEnum = exports.NetworkLogsRequestActionEnum = exports.MouseRequestActionEnum = exports.HistoryRequestActionEnum = exports.EmulateRequestActionEnum = exports.DialogRequestActionEnum = exports.ConsoleLogsRequestActionEnum = exports.BrowsersRequestActionEnum = void 0;
|
|
26
26
|
const axios_1 = require("axios");
|
|
27
27
|
// Some imports not used depending on template conditions
|
|
28
28
|
// @ts-ignore
|
|
29
29
|
const common_1 = require("./common");
|
|
30
30
|
// @ts-ignore
|
|
31
31
|
const base_1 = require("./base");
|
|
32
|
+
exports.BrowsersRequestActionEnum = {
|
|
33
|
+
List: 'list',
|
|
34
|
+
Info: 'info',
|
|
35
|
+
CloseAll: 'close_all',
|
|
36
|
+
Kill: 'kill',
|
|
37
|
+
KillAll: 'kill_all',
|
|
38
|
+
Restore: 'restore'
|
|
39
|
+
};
|
|
40
|
+
exports.ConsoleLogsRequestActionEnum = {
|
|
41
|
+
Get: 'get',
|
|
42
|
+
Clear: 'clear',
|
|
43
|
+
Enable: 'enable',
|
|
44
|
+
Disable: 'disable'
|
|
45
|
+
};
|
|
46
|
+
exports.DialogRequestActionEnum = {
|
|
47
|
+
Get: 'get',
|
|
48
|
+
Accept: 'accept',
|
|
49
|
+
Dismiss: 'dismiss'
|
|
50
|
+
};
|
|
51
|
+
exports.EmulateRequestActionEnum = {
|
|
52
|
+
Set: 'set',
|
|
53
|
+
Clear: 'clear',
|
|
54
|
+
ListDevices: 'list_devices'
|
|
55
|
+
};
|
|
56
|
+
exports.HistoryRequestActionEnum = {
|
|
57
|
+
Back: 'back',
|
|
58
|
+
Forward: 'forward',
|
|
59
|
+
Refresh: 'refresh'
|
|
60
|
+
};
|
|
61
|
+
exports.MouseRequestActionEnum = {
|
|
62
|
+
Hover: 'hover',
|
|
63
|
+
Drag: 'drag'
|
|
64
|
+
};
|
|
65
|
+
exports.NetworkLogsRequestActionEnum = {
|
|
66
|
+
Get: 'get',
|
|
67
|
+
Clear: 'clear',
|
|
68
|
+
Enable: 'enable',
|
|
69
|
+
Disable: 'disable'
|
|
70
|
+
};
|
|
71
|
+
exports.PerformanceRequestActionEnum = {
|
|
72
|
+
StartTrace: 'start_trace',
|
|
73
|
+
StopTrace: 'stop_trace',
|
|
74
|
+
Metrics: 'metrics',
|
|
75
|
+
Analyze: 'analyze'
|
|
76
|
+
};
|
|
77
|
+
exports.SelectRequestActionEnum = {
|
|
78
|
+
Select: 'select',
|
|
79
|
+
Options: 'options'
|
|
80
|
+
};
|
|
81
|
+
exports.TabsRequestActionEnum = {
|
|
82
|
+
List: 'list',
|
|
83
|
+
New: 'new',
|
|
84
|
+
Switch: 'switch',
|
|
85
|
+
Close: 'close',
|
|
86
|
+
Current: 'current'
|
|
87
|
+
};
|
|
88
|
+
exports.WaitElementRequestUntilEnum = {
|
|
89
|
+
Visible: 'visible',
|
|
90
|
+
Hidden: 'hidden'
|
|
91
|
+
};
|
|
32
92
|
/**
|
|
33
93
|
* BrowserApi - axios parameter creator
|
|
34
94
|
*/
|
|
@@ -417,6 +477,36 @@ const BrowserApiAxiosParamCreator = function (configuration) {
|
|
|
417
477
|
options: localVarRequestOptions,
|
|
418
478
|
};
|
|
419
479
|
}),
|
|
480
|
+
/**
|
|
481
|
+
* Returns the WebSocket URL that external tools (Playwright, Puppeteer, etc.) can use to connect directly to Chrome\'s DevTools Protocol for advanced automation like network interception, performance profiling, or custom CDP commands. The returned URL format: ws://host:port/devtools/browser/{guid} Note: The URL uses the container\'s internal address. For external access, ensure the CDP port is exposed and use the appropriate host address.
|
|
482
|
+
* @summary Get Chrome DevTools Protocol WebSocket URL for direct CDP access
|
|
483
|
+
* @param {string} browserId
|
|
484
|
+
* @param {*} [options] Override http request option.
|
|
485
|
+
* @throws {RequiredError}
|
|
486
|
+
*/
|
|
487
|
+
getCdpEndpoint: (browserId_1, ...args_1) => __awaiter(this, [browserId_1, ...args_1], void 0, function* (browserId, options = {}) {
|
|
488
|
+
// verify required parameter 'browserId' is not null or undefined
|
|
489
|
+
(0, common_1.assertParamExists)('getCdpEndpoint', 'browserId', browserId);
|
|
490
|
+
const localVarPath = `/browser/{browser_id}/get_cdp_endpoint`
|
|
491
|
+
.replace(`{${"browser_id"}}`, encodeURIComponent(String(browserId)));
|
|
492
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
493
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
494
|
+
let baseOptions;
|
|
495
|
+
if (configuration) {
|
|
496
|
+
baseOptions = configuration.baseOptions;
|
|
497
|
+
}
|
|
498
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
499
|
+
const localVarHeaderParameter = {};
|
|
500
|
+
const localVarQueryParameter = {};
|
|
501
|
+
localVarHeaderParameter['Accept'] = 'application/json';
|
|
502
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
503
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
504
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
505
|
+
return {
|
|
506
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
507
|
+
options: localVarRequestOptions,
|
|
508
|
+
};
|
|
509
|
+
}),
|
|
420
510
|
/**
|
|
421
511
|
*
|
|
422
512
|
* @summary Get page HTML
|
|
@@ -1417,6 +1507,22 @@ const BrowserApiFp = function (configuration) {
|
|
|
1417
1507
|
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
1418
1508
|
});
|
|
1419
1509
|
},
|
|
1510
|
+
/**
|
|
1511
|
+
* Returns the WebSocket URL that external tools (Playwright, Puppeteer, etc.) can use to connect directly to Chrome\'s DevTools Protocol for advanced automation like network interception, performance profiling, or custom CDP commands. The returned URL format: ws://host:port/devtools/browser/{guid} Note: The URL uses the container\'s internal address. For external access, ensure the CDP port is exposed and use the appropriate host address.
|
|
1512
|
+
* @summary Get Chrome DevTools Protocol WebSocket URL for direct CDP access
|
|
1513
|
+
* @param {string} browserId
|
|
1514
|
+
* @param {*} [options] Override http request option.
|
|
1515
|
+
* @throws {RequiredError}
|
|
1516
|
+
*/
|
|
1517
|
+
getCdpEndpoint(browserId, options) {
|
|
1518
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1519
|
+
var _a, _b, _c;
|
|
1520
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.getCdpEndpoint(browserId, options);
|
|
1521
|
+
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
1522
|
+
const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['BrowserApi.getCdpEndpoint']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
1523
|
+
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
1524
|
+
});
|
|
1525
|
+
},
|
|
1420
1526
|
/**
|
|
1421
1527
|
*
|
|
1422
1528
|
* @summary Get page HTML
|
|
@@ -1937,6 +2043,16 @@ const BrowserApiFactory = function (configuration, basePath, axios) {
|
|
|
1937
2043
|
fillForm(browserId, payload, options) {
|
|
1938
2044
|
return localVarFp.fillForm(browserId, payload, options).then((request) => request(axios, basePath));
|
|
1939
2045
|
},
|
|
2046
|
+
/**
|
|
2047
|
+
* Returns the WebSocket URL that external tools (Playwright, Puppeteer, etc.) can use to connect directly to Chrome\'s DevTools Protocol for advanced automation like network interception, performance profiling, or custom CDP commands. The returned URL format: ws://host:port/devtools/browser/{guid} Note: The URL uses the container\'s internal address. For external access, ensure the CDP port is exposed and use the appropriate host address.
|
|
2048
|
+
* @summary Get Chrome DevTools Protocol WebSocket URL for direct CDP access
|
|
2049
|
+
* @param {string} browserId
|
|
2050
|
+
* @param {*} [options] Override http request option.
|
|
2051
|
+
* @throws {RequiredError}
|
|
2052
|
+
*/
|
|
2053
|
+
getCdpEndpoint(browserId, options) {
|
|
2054
|
+
return localVarFp.getCdpEndpoint(browserId, options).then((request) => request(axios, basePath));
|
|
2055
|
+
},
|
|
1940
2056
|
/**
|
|
1941
2057
|
*
|
|
1942
2058
|
* @summary Get page HTML
|
|
@@ -2317,6 +2433,16 @@ class BrowserApi extends base_1.BaseAPI {
|
|
|
2317
2433
|
fillForm(browserId, payload, options) {
|
|
2318
2434
|
return (0, exports.BrowserApiFp)(this.configuration).fillForm(browserId, payload, options).then((request) => request(this.axios, this.basePath));
|
|
2319
2435
|
}
|
|
2436
|
+
/**
|
|
2437
|
+
* Returns the WebSocket URL that external tools (Playwright, Puppeteer, etc.) can use to connect directly to Chrome\'s DevTools Protocol for advanced automation like network interception, performance profiling, or custom CDP commands. The returned URL format: ws://host:port/devtools/browser/{guid} Note: The URL uses the container\'s internal address. For external access, ensure the CDP port is exposed and use the appropriate host address.
|
|
2438
|
+
* @summary Get Chrome DevTools Protocol WebSocket URL for direct CDP access
|
|
2439
|
+
* @param {string} browserId
|
|
2440
|
+
* @param {*} [options] Override http request option.
|
|
2441
|
+
* @throws {RequiredError}
|
|
2442
|
+
*/
|
|
2443
|
+
getCdpEndpoint(browserId, options) {
|
|
2444
|
+
return (0, exports.BrowserApiFp)(this.configuration).getCdpEndpoint(browserId, options).then((request) => request(this.axios, this.basePath));
|
|
2445
|
+
}
|
|
2320
2446
|
/**
|
|
2321
2447
|
*
|
|
2322
2448
|
* @summary Get page HTML
|
package/dist/esm/api.d.ts
CHANGED
|
@@ -31,12 +31,21 @@ export interface BrowsersRequest {
|
|
|
31
31
|
/**
|
|
32
32
|
* action
|
|
33
33
|
*/
|
|
34
|
-
'action':
|
|
34
|
+
'action': BrowsersRequestActionEnum;
|
|
35
35
|
/**
|
|
36
36
|
* browser_id
|
|
37
37
|
*/
|
|
38
38
|
'browser_id'?: string;
|
|
39
39
|
}
|
|
40
|
+
export declare const BrowsersRequestActionEnum: {
|
|
41
|
+
readonly List: "list";
|
|
42
|
+
readonly Info: "info";
|
|
43
|
+
readonly CloseAll: "close_all";
|
|
44
|
+
readonly Kill: "kill";
|
|
45
|
+
readonly KillAll: "kill_all";
|
|
46
|
+
readonly Restore: "restore";
|
|
47
|
+
};
|
|
48
|
+
export type BrowsersRequestActionEnum = typeof BrowsersRequestActionEnum[keyof typeof BrowsersRequestActionEnum];
|
|
40
49
|
export interface ClickRequest {
|
|
41
50
|
/**
|
|
42
51
|
* selector
|
|
@@ -59,12 +68,19 @@ export interface ConsoleLogsRequest {
|
|
|
59
68
|
/**
|
|
60
69
|
* action
|
|
61
70
|
*/
|
|
62
|
-
'action':
|
|
71
|
+
'action': ConsoleLogsRequestActionEnum;
|
|
63
72
|
/**
|
|
64
73
|
* limit
|
|
65
74
|
*/
|
|
66
75
|
'limit'?: number;
|
|
67
76
|
}
|
|
77
|
+
export declare const ConsoleLogsRequestActionEnum: {
|
|
78
|
+
readonly Get: "get";
|
|
79
|
+
readonly Clear: "clear";
|
|
80
|
+
readonly Enable: "enable";
|
|
81
|
+
readonly Disable: "disable";
|
|
82
|
+
};
|
|
83
|
+
export type ConsoleLogsRequestActionEnum = typeof ConsoleLogsRequestActionEnum[keyof typeof ConsoleLogsRequestActionEnum];
|
|
68
84
|
export interface CreateBrowserRequest {
|
|
69
85
|
/**
|
|
70
86
|
* uc
|
|
@@ -131,17 +147,23 @@ export interface DialogRequest {
|
|
|
131
147
|
/**
|
|
132
148
|
* action
|
|
133
149
|
*/
|
|
134
|
-
'action':
|
|
150
|
+
'action': DialogRequestActionEnum;
|
|
135
151
|
/**
|
|
136
152
|
* text
|
|
137
153
|
*/
|
|
138
154
|
'text'?: string;
|
|
139
155
|
}
|
|
156
|
+
export declare const DialogRequestActionEnum: {
|
|
157
|
+
readonly Get: "get";
|
|
158
|
+
readonly Accept: "accept";
|
|
159
|
+
readonly Dismiss: "dismiss";
|
|
160
|
+
};
|
|
161
|
+
export type DialogRequestActionEnum = typeof DialogRequestActionEnum[keyof typeof DialogRequestActionEnum];
|
|
140
162
|
export interface EmulateRequest {
|
|
141
163
|
/**
|
|
142
164
|
* action
|
|
143
165
|
*/
|
|
144
|
-
'action'?:
|
|
166
|
+
'action'?: EmulateRequestActionEnum;
|
|
145
167
|
/**
|
|
146
168
|
* device
|
|
147
169
|
*/
|
|
@@ -167,6 +189,12 @@ export interface EmulateRequest {
|
|
|
167
189
|
*/
|
|
168
190
|
'user_agent'?: string;
|
|
169
191
|
}
|
|
192
|
+
export declare const EmulateRequestActionEnum: {
|
|
193
|
+
readonly Set: "set";
|
|
194
|
+
readonly Clear: "clear";
|
|
195
|
+
readonly ListDevices: "list_devices";
|
|
196
|
+
};
|
|
197
|
+
export type EmulateRequestActionEnum = typeof EmulateRequestActionEnum[keyof typeof EmulateRequestActionEnum];
|
|
170
198
|
export interface ErrorResponse {
|
|
171
199
|
/**
|
|
172
200
|
* Operation success (false)
|
|
@@ -305,13 +333,19 @@ export interface HistoryRequest {
|
|
|
305
333
|
/**
|
|
306
334
|
* action
|
|
307
335
|
*/
|
|
308
|
-
'action':
|
|
336
|
+
'action': HistoryRequestActionEnum;
|
|
309
337
|
}
|
|
338
|
+
export declare const HistoryRequestActionEnum: {
|
|
339
|
+
readonly Back: "back";
|
|
340
|
+
readonly Forward: "forward";
|
|
341
|
+
readonly Refresh: "refresh";
|
|
342
|
+
};
|
|
343
|
+
export type HistoryRequestActionEnum = typeof HistoryRequestActionEnum[keyof typeof HistoryRequestActionEnum];
|
|
310
344
|
export interface MouseRequest {
|
|
311
345
|
/**
|
|
312
346
|
* action
|
|
313
347
|
*/
|
|
314
|
-
'action':
|
|
348
|
+
'action': MouseRequestActionEnum;
|
|
315
349
|
/**
|
|
316
350
|
* selector
|
|
317
351
|
*/
|
|
@@ -329,6 +363,11 @@ export interface MouseRequest {
|
|
|
329
363
|
*/
|
|
330
364
|
'by'?: string;
|
|
331
365
|
}
|
|
366
|
+
export declare const MouseRequestActionEnum: {
|
|
367
|
+
readonly Hover: "hover";
|
|
368
|
+
readonly Drag: "drag";
|
|
369
|
+
};
|
|
370
|
+
export type MouseRequestActionEnum = typeof MouseRequestActionEnum[keyof typeof MouseRequestActionEnum];
|
|
332
371
|
export interface NavigateBrowserRequest {
|
|
333
372
|
/**
|
|
334
373
|
* url
|
|
@@ -343,22 +382,36 @@ export interface NetworkLogsRequest {
|
|
|
343
382
|
/**
|
|
344
383
|
* action
|
|
345
384
|
*/
|
|
346
|
-
'action':
|
|
385
|
+
'action': NetworkLogsRequestActionEnum;
|
|
347
386
|
/**
|
|
348
387
|
* limit
|
|
349
388
|
*/
|
|
350
389
|
'limit'?: number;
|
|
351
390
|
}
|
|
391
|
+
export declare const NetworkLogsRequestActionEnum: {
|
|
392
|
+
readonly Get: "get";
|
|
393
|
+
readonly Clear: "clear";
|
|
394
|
+
readonly Enable: "enable";
|
|
395
|
+
readonly Disable: "disable";
|
|
396
|
+
};
|
|
397
|
+
export type NetworkLogsRequestActionEnum = typeof NetworkLogsRequestActionEnum[keyof typeof NetworkLogsRequestActionEnum];
|
|
352
398
|
export interface PerformanceRequest {
|
|
353
399
|
/**
|
|
354
400
|
* action
|
|
355
401
|
*/
|
|
356
|
-
'action':
|
|
402
|
+
'action': PerformanceRequestActionEnum;
|
|
357
403
|
/**
|
|
358
404
|
* categories
|
|
359
405
|
*/
|
|
360
406
|
'categories'?: string;
|
|
361
407
|
}
|
|
408
|
+
export declare const PerformanceRequestActionEnum: {
|
|
409
|
+
readonly StartTrace: "start_trace";
|
|
410
|
+
readonly StopTrace: "stop_trace";
|
|
411
|
+
readonly Metrics: "metrics";
|
|
412
|
+
readonly Analyze: "analyze";
|
|
413
|
+
};
|
|
414
|
+
export type PerformanceRequestActionEnum = typeof PerformanceRequestActionEnum[keyof typeof PerformanceRequestActionEnum];
|
|
362
415
|
export interface PoolScaled {
|
|
363
416
|
/**
|
|
364
417
|
* Operation success
|
|
@@ -509,7 +562,7 @@ export interface SelectRequest {
|
|
|
509
562
|
/**
|
|
510
563
|
* action
|
|
511
564
|
*/
|
|
512
|
-
'action'?:
|
|
565
|
+
'action'?: SelectRequestActionEnum;
|
|
513
566
|
/**
|
|
514
567
|
* value
|
|
515
568
|
*/
|
|
@@ -527,6 +580,11 @@ export interface SelectRequest {
|
|
|
527
580
|
*/
|
|
528
581
|
'by'?: string;
|
|
529
582
|
}
|
|
583
|
+
export declare const SelectRequestActionEnum: {
|
|
584
|
+
readonly Select: "select";
|
|
585
|
+
readonly Options: "options";
|
|
586
|
+
};
|
|
587
|
+
export type SelectRequestActionEnum = typeof SelectRequestActionEnum[keyof typeof SelectRequestActionEnum];
|
|
530
588
|
export interface SnapshotRequest {
|
|
531
589
|
/**
|
|
532
590
|
* snapshot_type
|
|
@@ -537,7 +595,7 @@ export interface TabsRequest {
|
|
|
537
595
|
/**
|
|
538
596
|
* action
|
|
539
597
|
*/
|
|
540
|
-
'action':
|
|
598
|
+
'action': TabsRequestActionEnum;
|
|
541
599
|
/**
|
|
542
600
|
* url
|
|
543
601
|
*/
|
|
@@ -551,6 +609,14 @@ export interface TabsRequest {
|
|
|
551
609
|
*/
|
|
552
610
|
'handle'?: string;
|
|
553
611
|
}
|
|
612
|
+
export declare const TabsRequestActionEnum: {
|
|
613
|
+
readonly List: "list";
|
|
614
|
+
readonly New: "new";
|
|
615
|
+
readonly Switch: "switch";
|
|
616
|
+
readonly Close: "close";
|
|
617
|
+
readonly Current: "current";
|
|
618
|
+
};
|
|
619
|
+
export type TabsRequestActionEnum = typeof TabsRequestActionEnum[keyof typeof TabsRequestActionEnum];
|
|
554
620
|
export interface TakeScreenshotRequest {
|
|
555
621
|
/**
|
|
556
622
|
* full_page
|
|
@@ -597,7 +663,7 @@ export interface WaitElementRequest {
|
|
|
597
663
|
/**
|
|
598
664
|
* until
|
|
599
665
|
*/
|
|
600
|
-
'until':
|
|
666
|
+
'until': WaitElementRequestUntilEnum;
|
|
601
667
|
/**
|
|
602
668
|
* timeout
|
|
603
669
|
*/
|
|
@@ -607,6 +673,11 @@ export interface WaitElementRequest {
|
|
|
607
673
|
*/
|
|
608
674
|
'by'?: string;
|
|
609
675
|
}
|
|
676
|
+
export declare const WaitElementRequestUntilEnum: {
|
|
677
|
+
readonly Visible: "visible";
|
|
678
|
+
readonly Hidden: "hidden";
|
|
679
|
+
};
|
|
680
|
+
export type WaitElementRequestUntilEnum = typeof WaitElementRequestUntilEnum[keyof typeof WaitElementRequestUntilEnum];
|
|
610
681
|
/**
|
|
611
682
|
* BrowserApi - axios parameter creator
|
|
612
683
|
*/
|
|
@@ -709,6 +780,14 @@ export declare const BrowserApiAxiosParamCreator: (configuration?: Configuration
|
|
|
709
780
|
* @throws {RequiredError}
|
|
710
781
|
*/
|
|
711
782
|
fillForm: (browserId: string, payload: FillFormRequest, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
|
|
783
|
+
/**
|
|
784
|
+
* Returns the WebSocket URL that external tools (Playwright, Puppeteer, etc.) can use to connect directly to Chrome\'s DevTools Protocol for advanced automation like network interception, performance profiling, or custom CDP commands. The returned URL format: ws://host:port/devtools/browser/{guid} Note: The URL uses the container\'s internal address. For external access, ensure the CDP port is exposed and use the appropriate host address.
|
|
785
|
+
* @summary Get Chrome DevTools Protocol WebSocket URL for direct CDP access
|
|
786
|
+
* @param {string} browserId
|
|
787
|
+
* @param {*} [options] Override http request option.
|
|
788
|
+
* @throws {RequiredError}
|
|
789
|
+
*/
|
|
790
|
+
getCdpEndpoint: (browserId: string, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
|
|
712
791
|
/**
|
|
713
792
|
*
|
|
714
793
|
* @summary Get page HTML
|
|
@@ -1019,6 +1098,14 @@ export declare const BrowserApiFp: (configuration?: Configuration) => {
|
|
|
1019
1098
|
* @throws {RequiredError}
|
|
1020
1099
|
*/
|
|
1021
1100
|
fillForm(browserId: string, payload: FillFormRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GenericResponse>>;
|
|
1101
|
+
/**
|
|
1102
|
+
* Returns the WebSocket URL that external tools (Playwright, Puppeteer, etc.) can use to connect directly to Chrome\'s DevTools Protocol for advanced automation like network interception, performance profiling, or custom CDP commands. The returned URL format: ws://host:port/devtools/browser/{guid} Note: The URL uses the container\'s internal address. For external access, ensure the CDP port is exposed and use the appropriate host address.
|
|
1103
|
+
* @summary Get Chrome DevTools Protocol WebSocket URL for direct CDP access
|
|
1104
|
+
* @param {string} browserId
|
|
1105
|
+
* @param {*} [options] Override http request option.
|
|
1106
|
+
* @throws {RequiredError}
|
|
1107
|
+
*/
|
|
1108
|
+
getCdpEndpoint(browserId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GenericResponse>>;
|
|
1022
1109
|
/**
|
|
1023
1110
|
*
|
|
1024
1111
|
* @summary Get page HTML
|
|
@@ -1329,6 +1416,14 @@ export declare const BrowserApiFactory: (configuration?: Configuration, basePath
|
|
|
1329
1416
|
* @throws {RequiredError}
|
|
1330
1417
|
*/
|
|
1331
1418
|
fillForm(browserId: string, payload: FillFormRequest, options?: RawAxiosRequestConfig): AxiosPromise<GenericResponse>;
|
|
1419
|
+
/**
|
|
1420
|
+
* Returns the WebSocket URL that external tools (Playwright, Puppeteer, etc.) can use to connect directly to Chrome\'s DevTools Protocol for advanced automation like network interception, performance profiling, or custom CDP commands. The returned URL format: ws://host:port/devtools/browser/{guid} Note: The URL uses the container\'s internal address. For external access, ensure the CDP port is exposed and use the appropriate host address.
|
|
1421
|
+
* @summary Get Chrome DevTools Protocol WebSocket URL for direct CDP access
|
|
1422
|
+
* @param {string} browserId
|
|
1423
|
+
* @param {*} [options] Override http request option.
|
|
1424
|
+
* @throws {RequiredError}
|
|
1425
|
+
*/
|
|
1426
|
+
getCdpEndpoint(browserId: string, options?: RawAxiosRequestConfig): AxiosPromise<GenericResponse>;
|
|
1332
1427
|
/**
|
|
1333
1428
|
*
|
|
1334
1429
|
* @summary Get page HTML
|
|
@@ -1639,6 +1734,14 @@ export declare class BrowserApi extends BaseAPI {
|
|
|
1639
1734
|
* @throws {RequiredError}
|
|
1640
1735
|
*/
|
|
1641
1736
|
fillForm(browserId: string, payload: FillFormRequest, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<GenericResponse, any, {}>>;
|
|
1737
|
+
/**
|
|
1738
|
+
* Returns the WebSocket URL that external tools (Playwright, Puppeteer, etc.) can use to connect directly to Chrome\'s DevTools Protocol for advanced automation like network interception, performance profiling, or custom CDP commands. The returned URL format: ws://host:port/devtools/browser/{guid} Note: The URL uses the container\'s internal address. For external access, ensure the CDP port is exposed and use the appropriate host address.
|
|
1739
|
+
* @summary Get Chrome DevTools Protocol WebSocket URL for direct CDP access
|
|
1740
|
+
* @param {string} browserId
|
|
1741
|
+
* @param {*} [options] Override http request option.
|
|
1742
|
+
* @throws {RequiredError}
|
|
1743
|
+
*/
|
|
1744
|
+
getCdpEndpoint(browserId: string, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<GenericResponse, any, {}>>;
|
|
1642
1745
|
/**
|
|
1643
1746
|
*
|
|
1644
1747
|
* @summary Get page HTML
|
package/dist/esm/api.js
CHANGED
|
@@ -26,6 +26,66 @@ import globalAxios from 'axios';
|
|
|
26
26
|
import { DUMMY_BASE_URL, assertParamExists, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common';
|
|
27
27
|
// @ts-ignore
|
|
28
28
|
import { BASE_PATH, BaseAPI, operationServerMap } from './base';
|
|
29
|
+
export const BrowsersRequestActionEnum = {
|
|
30
|
+
List: 'list',
|
|
31
|
+
Info: 'info',
|
|
32
|
+
CloseAll: 'close_all',
|
|
33
|
+
Kill: 'kill',
|
|
34
|
+
KillAll: 'kill_all',
|
|
35
|
+
Restore: 'restore'
|
|
36
|
+
};
|
|
37
|
+
export const ConsoleLogsRequestActionEnum = {
|
|
38
|
+
Get: 'get',
|
|
39
|
+
Clear: 'clear',
|
|
40
|
+
Enable: 'enable',
|
|
41
|
+
Disable: 'disable'
|
|
42
|
+
};
|
|
43
|
+
export const DialogRequestActionEnum = {
|
|
44
|
+
Get: 'get',
|
|
45
|
+
Accept: 'accept',
|
|
46
|
+
Dismiss: 'dismiss'
|
|
47
|
+
};
|
|
48
|
+
export const EmulateRequestActionEnum = {
|
|
49
|
+
Set: 'set',
|
|
50
|
+
Clear: 'clear',
|
|
51
|
+
ListDevices: 'list_devices'
|
|
52
|
+
};
|
|
53
|
+
export const HistoryRequestActionEnum = {
|
|
54
|
+
Back: 'back',
|
|
55
|
+
Forward: 'forward',
|
|
56
|
+
Refresh: 'refresh'
|
|
57
|
+
};
|
|
58
|
+
export const MouseRequestActionEnum = {
|
|
59
|
+
Hover: 'hover',
|
|
60
|
+
Drag: 'drag'
|
|
61
|
+
};
|
|
62
|
+
export const NetworkLogsRequestActionEnum = {
|
|
63
|
+
Get: 'get',
|
|
64
|
+
Clear: 'clear',
|
|
65
|
+
Enable: 'enable',
|
|
66
|
+
Disable: 'disable'
|
|
67
|
+
};
|
|
68
|
+
export const PerformanceRequestActionEnum = {
|
|
69
|
+
StartTrace: 'start_trace',
|
|
70
|
+
StopTrace: 'stop_trace',
|
|
71
|
+
Metrics: 'metrics',
|
|
72
|
+
Analyze: 'analyze'
|
|
73
|
+
};
|
|
74
|
+
export const SelectRequestActionEnum = {
|
|
75
|
+
Select: 'select',
|
|
76
|
+
Options: 'options'
|
|
77
|
+
};
|
|
78
|
+
export const TabsRequestActionEnum = {
|
|
79
|
+
List: 'list',
|
|
80
|
+
New: 'new',
|
|
81
|
+
Switch: 'switch',
|
|
82
|
+
Close: 'close',
|
|
83
|
+
Current: 'current'
|
|
84
|
+
};
|
|
85
|
+
export const WaitElementRequestUntilEnum = {
|
|
86
|
+
Visible: 'visible',
|
|
87
|
+
Hidden: 'hidden'
|
|
88
|
+
};
|
|
29
89
|
/**
|
|
30
90
|
* BrowserApi - axios parameter creator
|
|
31
91
|
*/
|
|
@@ -414,6 +474,36 @@ export const BrowserApiAxiosParamCreator = function (configuration) {
|
|
|
414
474
|
options: localVarRequestOptions,
|
|
415
475
|
};
|
|
416
476
|
}),
|
|
477
|
+
/**
|
|
478
|
+
* Returns the WebSocket URL that external tools (Playwright, Puppeteer, etc.) can use to connect directly to Chrome\'s DevTools Protocol for advanced automation like network interception, performance profiling, or custom CDP commands. The returned URL format: ws://host:port/devtools/browser/{guid} Note: The URL uses the container\'s internal address. For external access, ensure the CDP port is exposed and use the appropriate host address.
|
|
479
|
+
* @summary Get Chrome DevTools Protocol WebSocket URL for direct CDP access
|
|
480
|
+
* @param {string} browserId
|
|
481
|
+
* @param {*} [options] Override http request option.
|
|
482
|
+
* @throws {RequiredError}
|
|
483
|
+
*/
|
|
484
|
+
getCdpEndpoint: (browserId_1, ...args_1) => __awaiter(this, [browserId_1, ...args_1], void 0, function* (browserId, options = {}) {
|
|
485
|
+
// verify required parameter 'browserId' is not null or undefined
|
|
486
|
+
assertParamExists('getCdpEndpoint', 'browserId', browserId);
|
|
487
|
+
const localVarPath = `/browser/{browser_id}/get_cdp_endpoint`
|
|
488
|
+
.replace(`{${"browser_id"}}`, encodeURIComponent(String(browserId)));
|
|
489
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
490
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
491
|
+
let baseOptions;
|
|
492
|
+
if (configuration) {
|
|
493
|
+
baseOptions = configuration.baseOptions;
|
|
494
|
+
}
|
|
495
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
496
|
+
const localVarHeaderParameter = {};
|
|
497
|
+
const localVarQueryParameter = {};
|
|
498
|
+
localVarHeaderParameter['Accept'] = 'application/json';
|
|
499
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
500
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
501
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
502
|
+
return {
|
|
503
|
+
url: toPathString(localVarUrlObj),
|
|
504
|
+
options: localVarRequestOptions,
|
|
505
|
+
};
|
|
506
|
+
}),
|
|
417
507
|
/**
|
|
418
508
|
*
|
|
419
509
|
* @summary Get page HTML
|
|
@@ -1413,6 +1503,22 @@ export const BrowserApiFp = function (configuration) {
|
|
|
1413
1503
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
1414
1504
|
});
|
|
1415
1505
|
},
|
|
1506
|
+
/**
|
|
1507
|
+
* Returns the WebSocket URL that external tools (Playwright, Puppeteer, etc.) can use to connect directly to Chrome\'s DevTools Protocol for advanced automation like network interception, performance profiling, or custom CDP commands. The returned URL format: ws://host:port/devtools/browser/{guid} Note: The URL uses the container\'s internal address. For external access, ensure the CDP port is exposed and use the appropriate host address.
|
|
1508
|
+
* @summary Get Chrome DevTools Protocol WebSocket URL for direct CDP access
|
|
1509
|
+
* @param {string} browserId
|
|
1510
|
+
* @param {*} [options] Override http request option.
|
|
1511
|
+
* @throws {RequiredError}
|
|
1512
|
+
*/
|
|
1513
|
+
getCdpEndpoint(browserId, options) {
|
|
1514
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1515
|
+
var _a, _b, _c;
|
|
1516
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.getCdpEndpoint(browserId, options);
|
|
1517
|
+
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
1518
|
+
const localVarOperationServerBasePath = (_c = (_b = operationServerMap['BrowserApi.getCdpEndpoint']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
1519
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
1520
|
+
});
|
|
1521
|
+
},
|
|
1416
1522
|
/**
|
|
1417
1523
|
*
|
|
1418
1524
|
* @summary Get page HTML
|
|
@@ -1932,6 +2038,16 @@ export const BrowserApiFactory = function (configuration, basePath, axios) {
|
|
|
1932
2038
|
fillForm(browserId, payload, options) {
|
|
1933
2039
|
return localVarFp.fillForm(browserId, payload, options).then((request) => request(axios, basePath));
|
|
1934
2040
|
},
|
|
2041
|
+
/**
|
|
2042
|
+
* Returns the WebSocket URL that external tools (Playwright, Puppeteer, etc.) can use to connect directly to Chrome\'s DevTools Protocol for advanced automation like network interception, performance profiling, or custom CDP commands. The returned URL format: ws://host:port/devtools/browser/{guid} Note: The URL uses the container\'s internal address. For external access, ensure the CDP port is exposed and use the appropriate host address.
|
|
2043
|
+
* @summary Get Chrome DevTools Protocol WebSocket URL for direct CDP access
|
|
2044
|
+
* @param {string} browserId
|
|
2045
|
+
* @param {*} [options] Override http request option.
|
|
2046
|
+
* @throws {RequiredError}
|
|
2047
|
+
*/
|
|
2048
|
+
getCdpEndpoint(browserId, options) {
|
|
2049
|
+
return localVarFp.getCdpEndpoint(browserId, options).then((request) => request(axios, basePath));
|
|
2050
|
+
},
|
|
1935
2051
|
/**
|
|
1936
2052
|
*
|
|
1937
2053
|
* @summary Get page HTML
|
|
@@ -2311,6 +2427,16 @@ export class BrowserApi extends BaseAPI {
|
|
|
2311
2427
|
fillForm(browserId, payload, options) {
|
|
2312
2428
|
return BrowserApiFp(this.configuration).fillForm(browserId, payload, options).then((request) => request(this.axios, this.basePath));
|
|
2313
2429
|
}
|
|
2430
|
+
/**
|
|
2431
|
+
* Returns the WebSocket URL that external tools (Playwright, Puppeteer, etc.) can use to connect directly to Chrome\'s DevTools Protocol for advanced automation like network interception, performance profiling, or custom CDP commands. The returned URL format: ws://host:port/devtools/browser/{guid} Note: The URL uses the container\'s internal address. For external access, ensure the CDP port is exposed and use the appropriate host address.
|
|
2432
|
+
* @summary Get Chrome DevTools Protocol WebSocket URL for direct CDP access
|
|
2433
|
+
* @param {string} browserId
|
|
2434
|
+
* @param {*} [options] Override http request option.
|
|
2435
|
+
* @throws {RequiredError}
|
|
2436
|
+
*/
|
|
2437
|
+
getCdpEndpoint(browserId, options) {
|
|
2438
|
+
return BrowserApiFp(this.configuration).getCdpEndpoint(browserId, options).then((request) => request(this.axios, this.basePath));
|
|
2439
|
+
}
|
|
2314
2440
|
/**
|
|
2315
2441
|
*
|
|
2316
2442
|
* @summary Get page HTML
|
package/docs/BrowserApi.md
CHANGED
|
@@ -15,6 +15,7 @@ All URIs are relative to */api/v1*
|
|
|
15
15
|
|[**emulate**](#emulate) | **POST** /browser/{browser_id}/emulate | Emulation: set, clear, list_devices|
|
|
16
16
|
|[**executeScript**](#executescript) | **POST** /browser/{browser_id}/execute_script | Execute JavaScript|
|
|
17
17
|
|[**fillForm**](#fillform) | **POST** /browser/{browser_id}/fill_form | Fill multiple form fields|
|
|
18
|
+
|[**getCdpEndpoint**](#getcdpendpoint) | **GET** /browser/{browser_id}/get_cdp_endpoint | Get Chrome DevTools Protocol WebSocket URL for direct CDP access|
|
|
18
19
|
|[**getContent**](#getcontent) | **GET** /browser/{browser_id}/get_content | Get page HTML|
|
|
19
20
|
|[**getElementData**](#getelementdata) | **GET** /browser/{browser_id}/get_element_data | Get element text, attribute, or property|
|
|
20
21
|
|[**getUrl**](#geturl) | **GET** /browser/{browser_id}/get_url | Get current URL|
|
|
@@ -623,6 +624,57 @@ No authorization required
|
|
|
623
624
|
- **Accept**: application/json
|
|
624
625
|
|
|
625
626
|
|
|
627
|
+
### HTTP response details
|
|
628
|
+
| Status code | Description | Response headers |
|
|
629
|
+
|-------------|-------------|------------------|
|
|
630
|
+
|**200** | Success | - |
|
|
631
|
+
|
|
632
|
+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
633
|
+
|
|
634
|
+
# **getCdpEndpoint**
|
|
635
|
+
> GenericResponse getCdpEndpoint()
|
|
636
|
+
|
|
637
|
+
Returns the WebSocket URL that external tools (Playwright, Puppeteer, etc.) can use to connect directly to Chrome\'s DevTools Protocol for advanced automation like network interception, performance profiling, or custom CDP commands. The returned URL format: ws://host:port/devtools/browser/{guid} Note: The URL uses the container\'s internal address. For external access, ensure the CDP port is exposed and use the appropriate host address.
|
|
638
|
+
|
|
639
|
+
### Example
|
|
640
|
+
|
|
641
|
+
```typescript
|
|
642
|
+
import {
|
|
643
|
+
BrowserApi,
|
|
644
|
+
Configuration
|
|
645
|
+
} from 'airbrowser-client';
|
|
646
|
+
|
|
647
|
+
const configuration = new Configuration();
|
|
648
|
+
const apiInstance = new BrowserApi(configuration);
|
|
649
|
+
|
|
650
|
+
let browserId: string; // (default to undefined)
|
|
651
|
+
|
|
652
|
+
const { status, data } = await apiInstance.getCdpEndpoint(
|
|
653
|
+
browserId
|
|
654
|
+
);
|
|
655
|
+
```
|
|
656
|
+
|
|
657
|
+
### Parameters
|
|
658
|
+
|
|
659
|
+
|Name | Type | Description | Notes|
|
|
660
|
+
|------------- | ------------- | ------------- | -------------|
|
|
661
|
+
| **browserId** | [**string**] | | defaults to undefined|
|
|
662
|
+
|
|
663
|
+
|
|
664
|
+
### Return type
|
|
665
|
+
|
|
666
|
+
**GenericResponse**
|
|
667
|
+
|
|
668
|
+
### Authorization
|
|
669
|
+
|
|
670
|
+
No authorization required
|
|
671
|
+
|
|
672
|
+
### HTTP request headers
|
|
673
|
+
|
|
674
|
+
- **Content-Type**: Not defined
|
|
675
|
+
- **Accept**: application/json
|
|
676
|
+
|
|
677
|
+
|
|
626
678
|
### HTTP response details
|
|
627
679
|
| Status code | Description | Response headers |
|
|
628
680
|
|-------------|-------------|------------------|
|
package/docs/EmulateRequest.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
Name | Type | Description | Notes
|
|
7
7
|
------------ | ------------- | ------------- | -------------
|
|
8
|
-
**action** | **string** | action | [optional] [default to
|
|
8
|
+
**action** | **string** | action | [optional] [default to ActionEnum_Set]
|
|
9
9
|
**device** | **string** | device | [optional] [default to undefined]
|
|
10
10
|
**width** | **number** | width | [optional] [default to undefined]
|
|
11
11
|
**height** | **number** | height | [optional] [default to undefined]
|
package/docs/SelectRequest.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
Name | Type | Description | Notes
|
|
7
7
|
------------ | ------------- | ------------- | -------------
|
|
8
8
|
**selector** | **string** | selector | [default to undefined]
|
|
9
|
-
**action** | **string** | action | [optional] [default to
|
|
9
|
+
**action** | **string** | action | [optional] [default to ActionEnum_Select]
|
|
10
10
|
**value** | **string** | value | [optional] [default to undefined]
|
|
11
11
|
**text** | **string** | text | [optional] [default to undefined]
|
|
12
12
|
**index** | **number** | index | [optional] [default to undefined]
|