@mearl/client 2.1.0 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/actionTimeouts.js +7 -11
- package/dist/commands.d.ts +890 -4
- package/dist/commands.js +9 -5
- package/dist/generated-browser-action-protocol.d.ts +677 -0
- package/dist/generated-browser-action-protocol.js +144 -0
- package/dist/index.d.ts +41 -486
- package/dist/index.js +1 -16
- package/package.json +3 -3
package/dist/commands.js
CHANGED
|
@@ -5,7 +5,7 @@ export const COMMANDS = [
|
|
|
5
5
|
description: '获取最近的网络请求(mtop 或普通 xhr/fetch)',
|
|
6
6
|
params: [
|
|
7
7
|
{ name: 'tabId', type: 'number', description: '目标标签页 ID,从 tab_list 获取' },
|
|
8
|
-
{ name: 'count', type: 'number', description: '返回条数,默认
|
|
8
|
+
{ name: 'count', type: 'number', description: '返回条数,默认 10' },
|
|
9
9
|
{
|
|
10
10
|
name: 'source',
|
|
11
11
|
type: '"mtop" | "requests"',
|
|
@@ -61,7 +61,11 @@ export const COMMANDS = [
|
|
|
61
61
|
description: '获取 API 接口 schema(出入参定义)',
|
|
62
62
|
params: [
|
|
63
63
|
{ name: 'api', type: 'string', required: true, description: 'API 名称' },
|
|
64
|
-
{
|
|
64
|
+
{
|
|
65
|
+
name: 'fields',
|
|
66
|
+
type: '("schema" | "hsf")[]',
|
|
67
|
+
description: '指定返回内容;不填时返回全部可用内容',
|
|
68
|
+
},
|
|
65
69
|
],
|
|
66
70
|
examples: [`get_api_schema --payload '{"api":"mtop.trade.order.detail"}'`],
|
|
67
71
|
},
|
|
@@ -184,7 +188,7 @@ export const COMMANDS = [
|
|
|
184
188
|
},
|
|
185
189
|
{
|
|
186
190
|
name: 'browser_release',
|
|
187
|
-
description: '
|
|
191
|
+
description: '按用户明确要求释放调试控制和会话级临时效果(含设备/时区模拟),保留浏览器和全部标签页;不用于普通任务收尾',
|
|
188
192
|
examples: ['browser_release', 'browser_release --browser chrome-a'],
|
|
189
193
|
},
|
|
190
194
|
{
|
|
@@ -658,7 +662,7 @@ export const COMMANDS = [
|
|
|
658
662
|
// ── 移动端模拟 ────────────────────────────────────────────────────────────
|
|
659
663
|
{
|
|
660
664
|
name: 'set_device_emulation',
|
|
661
|
-
description: '把目标 tab 切换为移动端模拟(视口/UA/触摸),等价 DevTools 设备工具栏,作用域 per-tab',
|
|
665
|
+
description: '把目标 tab 切换为移动端模拟(视口/UA/触摸),等价 DevTools 设备工具栏,作用域 per-tab;需保持调试控制才持续生效',
|
|
662
666
|
params: [
|
|
663
667
|
{ name: 'enabled', type: 'boolean', required: true, description: 'true=启用,false=清除' },
|
|
664
668
|
{
|
|
@@ -799,4 +803,4 @@ export const COMMANDS = [
|
|
|
799
803
|
],
|
|
800
804
|
},
|
|
801
805
|
];
|
|
802
|
-
export const COMMAND_MAP = new Map(COMMANDS.map(
|
|
806
|
+
export const COMMAND_MAP = new Map(COMMANDS.map(command => [command.name, command]));
|
|
@@ -0,0 +1,677 @@
|
|
|
1
|
+
export interface GetRequestsParams {
|
|
2
|
+
tabId?: number;
|
|
3
|
+
count?: number;
|
|
4
|
+
filter?: string;
|
|
5
|
+
since?: number;
|
|
6
|
+
includeBody?: boolean;
|
|
7
|
+
includeHeaders?: boolean;
|
|
8
|
+
maxBodySize?: number;
|
|
9
|
+
fields?: string[];
|
|
10
|
+
keysOnly?: boolean;
|
|
11
|
+
applyHiddenFilter?: boolean;
|
|
12
|
+
source?: 'mtop' | 'requests';
|
|
13
|
+
}
|
|
14
|
+
export interface GetLogsParams {
|
|
15
|
+
tabId?: number;
|
|
16
|
+
level?: 'log' | 'warn' | 'error' | 'info' | 'all';
|
|
17
|
+
since?: number;
|
|
18
|
+
limit?: number;
|
|
19
|
+
filter?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface GetEventsParams {
|
|
22
|
+
tabId?: number;
|
|
23
|
+
source?: 'rum' | 'aplus' | 'arms' | 'all';
|
|
24
|
+
event_type?: string;
|
|
25
|
+
filter?: string;
|
|
26
|
+
since?: number;
|
|
27
|
+
limit?: number;
|
|
28
|
+
includeRaw?: boolean;
|
|
29
|
+
}
|
|
30
|
+
export interface SetMockParams {
|
|
31
|
+
tabId?: number;
|
|
32
|
+
apiName: string;
|
|
33
|
+
mockData?: unknown;
|
|
34
|
+
fields?: Array<{
|
|
35
|
+
path: string;
|
|
36
|
+
value: unknown;
|
|
37
|
+
}>;
|
|
38
|
+
enabled?: boolean;
|
|
39
|
+
duration?: number;
|
|
40
|
+
conditions?: Record<string, unknown>;
|
|
41
|
+
}
|
|
42
|
+
export interface GetMocksParams {
|
|
43
|
+
tabId?: number;
|
|
44
|
+
apiName?: string;
|
|
45
|
+
}
|
|
46
|
+
export interface GetApiSchemaParams {
|
|
47
|
+
api: string;
|
|
48
|
+
version?: string;
|
|
49
|
+
fields?: Array<'schema' | 'hsf'>;
|
|
50
|
+
}
|
|
51
|
+
export interface SendRequestParams {
|
|
52
|
+
url: string;
|
|
53
|
+
method?: string;
|
|
54
|
+
headers?: Record<string, string>;
|
|
55
|
+
params?: Record<string, string>;
|
|
56
|
+
body?: unknown;
|
|
57
|
+
withCookies?: boolean;
|
|
58
|
+
cookieDomain?: string;
|
|
59
|
+
responseType?: 'json' | 'text' | 'auto';
|
|
60
|
+
timeout?: number;
|
|
61
|
+
}
|
|
62
|
+
export interface SendMtopRequestParams {
|
|
63
|
+
api: string;
|
|
64
|
+
data?: unknown;
|
|
65
|
+
version?: string;
|
|
66
|
+
method?: string;
|
|
67
|
+
appKey?: string;
|
|
68
|
+
env?: string;
|
|
69
|
+
timeout?: number;
|
|
70
|
+
}
|
|
71
|
+
export interface TdbankAccountParams {
|
|
72
|
+
operation?: 'current' | 'list' | 'switch' | 'borrow';
|
|
73
|
+
pageIndex?: number;
|
|
74
|
+
refresh?: boolean;
|
|
75
|
+
query?: string;
|
|
76
|
+
accountId?: string | number;
|
|
77
|
+
havanaId?: string | number;
|
|
78
|
+
site?: string | number;
|
|
79
|
+
tabId?: number;
|
|
80
|
+
}
|
|
81
|
+
export type BrowserStatus = 'connected' | 'running_disconnected' | 'stopped';
|
|
82
|
+
export interface BrowserInfoBase {
|
|
83
|
+
browserId: string;
|
|
84
|
+
name: string;
|
|
85
|
+
status: BrowserStatus;
|
|
86
|
+
extensionVersion?: string;
|
|
87
|
+
nativeHostVersion?: string;
|
|
88
|
+
transport?: 'extension' | 'cdp';
|
|
89
|
+
}
|
|
90
|
+
export interface RegularBrowserInfo extends BrowserInfoBase {
|
|
91
|
+
type: 'regular';
|
|
92
|
+
status: 'connected';
|
|
93
|
+
}
|
|
94
|
+
export interface ManagedBrowserAccount {
|
|
95
|
+
accountId?: string;
|
|
96
|
+
loginId?: string;
|
|
97
|
+
nickname: string;
|
|
98
|
+
}
|
|
99
|
+
export interface ManagedBrowserInfo extends BrowserInfoBase {
|
|
100
|
+
type: 'managed';
|
|
101
|
+
headless: boolean;
|
|
102
|
+
persistent: boolean;
|
|
103
|
+
cdpPort: number;
|
|
104
|
+
createdAt: string;
|
|
105
|
+
account?: ManagedBrowserAccount;
|
|
106
|
+
copiedCookies?: {
|
|
107
|
+
domains: string[];
|
|
108
|
+
count: number;
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
export type BrowserInfo = RegularBrowserInfo | ManagedBrowserInfo;
|
|
112
|
+
export interface BrowserListResult {
|
|
113
|
+
count: number;
|
|
114
|
+
connectedCount: number;
|
|
115
|
+
defaultBrowserId: string | null;
|
|
116
|
+
browsers: BrowserInfo[];
|
|
117
|
+
}
|
|
118
|
+
export interface SelectBrowserParams {
|
|
119
|
+
browser?: string;
|
|
120
|
+
}
|
|
121
|
+
export interface SelectBrowserResult {
|
|
122
|
+
selected: {
|
|
123
|
+
browserId: string;
|
|
124
|
+
name: string;
|
|
125
|
+
} | null;
|
|
126
|
+
note?: string;
|
|
127
|
+
}
|
|
128
|
+
export interface BrowserReleaseFailure {
|
|
129
|
+
tabId: number;
|
|
130
|
+
stage: string;
|
|
131
|
+
error: string;
|
|
132
|
+
}
|
|
133
|
+
export interface BrowserReleaseResult {
|
|
134
|
+
released: boolean;
|
|
135
|
+
hadActiveControl: boolean;
|
|
136
|
+
transports: Array<'extension' | 'cdp'>;
|
|
137
|
+
affectedTabIds: number[];
|
|
138
|
+
failures?: BrowserReleaseFailure[];
|
|
139
|
+
}
|
|
140
|
+
export interface BrowserLaunchParams {
|
|
141
|
+
name: string;
|
|
142
|
+
headless?: boolean;
|
|
143
|
+
userAgentMode?: 'default' | 'desktop';
|
|
144
|
+
persistent?: boolean;
|
|
145
|
+
executablePath?: string;
|
|
146
|
+
url?: string;
|
|
147
|
+
accountId?: string | number;
|
|
148
|
+
havanaId?: string | number;
|
|
149
|
+
site?: string | number;
|
|
150
|
+
query?: string;
|
|
151
|
+
tabId?: number;
|
|
152
|
+
copyCookieDomains?: string[];
|
|
153
|
+
}
|
|
154
|
+
export interface BrowserCloseParams {
|
|
155
|
+
browser: string;
|
|
156
|
+
deleteProfile?: boolean;
|
|
157
|
+
}
|
|
158
|
+
export interface SetRuleParams {
|
|
159
|
+
actionType: 'redirect' | 'block' | 'allow' | 'upgradeScheme' | 'modifyHeaders';
|
|
160
|
+
filter: string;
|
|
161
|
+
redirectUrl?: string;
|
|
162
|
+
requestHeaders?: Array<{
|
|
163
|
+
header: string;
|
|
164
|
+
operation: 'set' | 'append' | 'remove';
|
|
165
|
+
value?: string;
|
|
166
|
+
}>;
|
|
167
|
+
responseHeaders?: Array<{
|
|
168
|
+
header: string;
|
|
169
|
+
operation: 'set' | 'append' | 'remove';
|
|
170
|
+
value?: string;
|
|
171
|
+
}>;
|
|
172
|
+
initiatorDomains?: string;
|
|
173
|
+
resourceTypes?: string[];
|
|
174
|
+
priority?: number;
|
|
175
|
+
description?: string;
|
|
176
|
+
}
|
|
177
|
+
export interface RulesResult {
|
|
178
|
+
enabled: boolean;
|
|
179
|
+
rules: Array<Record<string, unknown>>;
|
|
180
|
+
}
|
|
181
|
+
export interface PageScreenshotParams {
|
|
182
|
+
tabId?: number;
|
|
183
|
+
selector?: string;
|
|
184
|
+
format?: 'png' | 'jpeg';
|
|
185
|
+
quality?: number;
|
|
186
|
+
}
|
|
187
|
+
export interface PageSelectedElementParams {
|
|
188
|
+
tabId?: number;
|
|
189
|
+
includeOuterHTML?: boolean;
|
|
190
|
+
includeScreenshot?: boolean;
|
|
191
|
+
}
|
|
192
|
+
export type BrowserDevicePresetName = 'iphone-15-pro' | 'iphone-se' | 'pixel-8' | 'ipad-mini' | 'galaxy-s23';
|
|
193
|
+
export interface BrowserEmulationOptions {
|
|
194
|
+
preset?: BrowserDevicePresetName;
|
|
195
|
+
width?: number;
|
|
196
|
+
height?: number;
|
|
197
|
+
deviceScaleFactor?: number;
|
|
198
|
+
mobile?: boolean;
|
|
199
|
+
userAgent?: string;
|
|
200
|
+
orientation?: 'portrait' | 'landscape';
|
|
201
|
+
touch?: boolean;
|
|
202
|
+
}
|
|
203
|
+
export interface TabOpenParams {
|
|
204
|
+
url: string;
|
|
205
|
+
active?: boolean;
|
|
206
|
+
closeExisting?: boolean;
|
|
207
|
+
reuse?: 'never' | 'prefer' | 'require';
|
|
208
|
+
match?: {
|
|
209
|
+
urlPattern?: string;
|
|
210
|
+
ignoreSearch?: boolean;
|
|
211
|
+
ignoreHash?: boolean;
|
|
212
|
+
onMultiple?: 'error' | 'first';
|
|
213
|
+
};
|
|
214
|
+
restoreFocusOnClose?: boolean;
|
|
215
|
+
emulation?: BrowserEmulationOptions;
|
|
216
|
+
group?: string;
|
|
217
|
+
}
|
|
218
|
+
export interface TabCloseParams {
|
|
219
|
+
tabId: number;
|
|
220
|
+
}
|
|
221
|
+
export interface PageObservationWaitOptions {
|
|
222
|
+
quietMs?: number;
|
|
223
|
+
firstChangeTimeoutMs?: number;
|
|
224
|
+
timeoutMs?: number;
|
|
225
|
+
navigationGraceMs?: number;
|
|
226
|
+
navigationTimeoutMs?: number;
|
|
227
|
+
networkIdleMs?: number;
|
|
228
|
+
contentReadyAfterMs?: number;
|
|
229
|
+
}
|
|
230
|
+
export interface PageClickParams {
|
|
231
|
+
tabId?: number;
|
|
232
|
+
selector?: string;
|
|
233
|
+
text?: string;
|
|
234
|
+
point?: {
|
|
235
|
+
x: number;
|
|
236
|
+
y: number;
|
|
237
|
+
};
|
|
238
|
+
role?: string;
|
|
239
|
+
exact?: boolean;
|
|
240
|
+
scope?: string;
|
|
241
|
+
clickMode?: 'auto' | 'dom' | 'mouse' | 'touch';
|
|
242
|
+
observe?: PageObservationWaitOptions | false;
|
|
243
|
+
}
|
|
244
|
+
export interface PageTypeParams {
|
|
245
|
+
tabId?: number;
|
|
246
|
+
selector: string;
|
|
247
|
+
text: string;
|
|
248
|
+
clearFirst?: boolean;
|
|
249
|
+
observe?: PageObservationWaitOptions | false;
|
|
250
|
+
}
|
|
251
|
+
export interface PageScrollParams {
|
|
252
|
+
tabId?: number;
|
|
253
|
+
direction: 'up' | 'down' | 'top' | 'bottom';
|
|
254
|
+
distance?: number;
|
|
255
|
+
selector?: string;
|
|
256
|
+
containerPolicy?: 'self' | 'nearest';
|
|
257
|
+
observe?: PageObservationWaitOptions | false;
|
|
258
|
+
}
|
|
259
|
+
export interface PageHoverParams {
|
|
260
|
+
tabId?: number;
|
|
261
|
+
selector: string;
|
|
262
|
+
observe?: PageObservationWaitOptions | false;
|
|
263
|
+
}
|
|
264
|
+
export interface PageEvalParams {
|
|
265
|
+
tabId?: number;
|
|
266
|
+
expression: string;
|
|
267
|
+
frameId?: string;
|
|
268
|
+
awaitPromise?: boolean;
|
|
269
|
+
observe?: PageObservationWaitOptions;
|
|
270
|
+
}
|
|
271
|
+
export interface PageSnapshotQuery {
|
|
272
|
+
text?: string;
|
|
273
|
+
role?: string;
|
|
274
|
+
exact?: boolean;
|
|
275
|
+
}
|
|
276
|
+
export interface PageSnapshotParams {
|
|
277
|
+
tabId?: number;
|
|
278
|
+
depth?: number;
|
|
279
|
+
maxChars?: number;
|
|
280
|
+
maxNodes?: number;
|
|
281
|
+
rootSelector?: string;
|
|
282
|
+
rootRef?: string;
|
|
283
|
+
ancestorDepth?: number;
|
|
284
|
+
query?: PageSnapshotQuery;
|
|
285
|
+
mode?: 'full' | 'interactive' | 'viewport';
|
|
286
|
+
}
|
|
287
|
+
export interface PagePressParams {
|
|
288
|
+
tabId?: number;
|
|
289
|
+
key: string;
|
|
290
|
+
modifiers?: string[];
|
|
291
|
+
observe?: PageObservationWaitOptions | false;
|
|
292
|
+
}
|
|
293
|
+
export interface PageWaitParams {
|
|
294
|
+
tabId?: number;
|
|
295
|
+
time?: number;
|
|
296
|
+
selector?: string;
|
|
297
|
+
condition?: string;
|
|
298
|
+
timeout?: number;
|
|
299
|
+
interval?: number;
|
|
300
|
+
}
|
|
301
|
+
export interface PageNavigateParams {
|
|
302
|
+
tabId?: number;
|
|
303
|
+
url?: string;
|
|
304
|
+
refresh?: boolean;
|
|
305
|
+
history?: 'back' | 'forward';
|
|
306
|
+
}
|
|
307
|
+
export interface PageUploadParams {
|
|
308
|
+
tabId?: number;
|
|
309
|
+
selector: string;
|
|
310
|
+
filePaths: string[];
|
|
311
|
+
observe?: PageObservationWaitOptions | false;
|
|
312
|
+
}
|
|
313
|
+
export interface PageFramesParams {
|
|
314
|
+
tabId?: number;
|
|
315
|
+
}
|
|
316
|
+
export interface SetDeviceEmulationParams extends BrowserEmulationOptions {
|
|
317
|
+
tabId?: number;
|
|
318
|
+
enabled: boolean;
|
|
319
|
+
reload?: boolean;
|
|
320
|
+
}
|
|
321
|
+
export interface SetTimezoneParams {
|
|
322
|
+
tabId?: number;
|
|
323
|
+
timezone: string;
|
|
324
|
+
}
|
|
325
|
+
export interface SetTimezoneResult {
|
|
326
|
+
enabled: boolean;
|
|
327
|
+
timezone: string | null;
|
|
328
|
+
}
|
|
329
|
+
export interface GetCookieParams {
|
|
330
|
+
tabId?: number;
|
|
331
|
+
name: string;
|
|
332
|
+
domain?: string;
|
|
333
|
+
path?: string;
|
|
334
|
+
}
|
|
335
|
+
export interface GetCookieResult {
|
|
336
|
+
tabId?: number;
|
|
337
|
+
url: string;
|
|
338
|
+
name: string;
|
|
339
|
+
found: boolean;
|
|
340
|
+
value?: string;
|
|
341
|
+
domain?: string;
|
|
342
|
+
path?: string;
|
|
343
|
+
}
|
|
344
|
+
export interface SetCookieParams {
|
|
345
|
+
tabId?: number;
|
|
346
|
+
name: string;
|
|
347
|
+
value: string;
|
|
348
|
+
domain?: string;
|
|
349
|
+
path?: string;
|
|
350
|
+
reload?: boolean;
|
|
351
|
+
}
|
|
352
|
+
export interface SetCookieResult {
|
|
353
|
+
tabId?: number;
|
|
354
|
+
url: string;
|
|
355
|
+
name: string;
|
|
356
|
+
domain: string;
|
|
357
|
+
path: string;
|
|
358
|
+
reloaded: boolean;
|
|
359
|
+
}
|
|
360
|
+
export interface GetUserInfoParams {
|
|
361
|
+
detail?: boolean;
|
|
362
|
+
}
|
|
363
|
+
export interface RecordParams {
|
|
364
|
+
tabId?: number;
|
|
365
|
+
}
|
|
366
|
+
export interface RequestDomainPermissionParams {
|
|
367
|
+
domain: string;
|
|
368
|
+
}
|
|
369
|
+
export type RunActionName = Exclude<ExtensionBrowserAction, 'run_actions' | 'browser_release'>;
|
|
370
|
+
export interface ActionStep {
|
|
371
|
+
action: RunActionName;
|
|
372
|
+
data?: Record<string, unknown>;
|
|
373
|
+
}
|
|
374
|
+
export interface RunActionsParams {
|
|
375
|
+
actions: ActionStep[];
|
|
376
|
+
tabId: number;
|
|
377
|
+
}
|
|
378
|
+
export interface BrowserActionMap {
|
|
379
|
+
get_requests: {
|
|
380
|
+
request: GetRequestsParams;
|
|
381
|
+
response: unknown;
|
|
382
|
+
};
|
|
383
|
+
get_logs: {
|
|
384
|
+
request: GetLogsParams;
|
|
385
|
+
response: unknown;
|
|
386
|
+
};
|
|
387
|
+
get_events: {
|
|
388
|
+
request: GetEventsParams;
|
|
389
|
+
response: unknown;
|
|
390
|
+
};
|
|
391
|
+
get_api_schema: {
|
|
392
|
+
request: GetApiSchemaParams;
|
|
393
|
+
response: unknown;
|
|
394
|
+
};
|
|
395
|
+
set_mock: {
|
|
396
|
+
request: SetMockParams;
|
|
397
|
+
response: unknown;
|
|
398
|
+
};
|
|
399
|
+
get_mocks: {
|
|
400
|
+
request: GetMocksParams;
|
|
401
|
+
response: unknown;
|
|
402
|
+
};
|
|
403
|
+
set_rule: {
|
|
404
|
+
request: SetRuleParams;
|
|
405
|
+
response: unknown;
|
|
406
|
+
};
|
|
407
|
+
get_rules: {
|
|
408
|
+
request: undefined;
|
|
409
|
+
response: RulesResult;
|
|
410
|
+
};
|
|
411
|
+
send_request: {
|
|
412
|
+
request: SendRequestParams;
|
|
413
|
+
response: unknown;
|
|
414
|
+
};
|
|
415
|
+
send_mtop_request: {
|
|
416
|
+
request: SendMtopRequestParams;
|
|
417
|
+
response: unknown;
|
|
418
|
+
};
|
|
419
|
+
tdbank_account: {
|
|
420
|
+
request: TdbankAccountParams;
|
|
421
|
+
response: unknown;
|
|
422
|
+
};
|
|
423
|
+
browser_list: {
|
|
424
|
+
request: undefined;
|
|
425
|
+
response: BrowserListResult;
|
|
426
|
+
};
|
|
427
|
+
browser_select_browser: {
|
|
428
|
+
request: SelectBrowserParams;
|
|
429
|
+
response: SelectBrowserResult;
|
|
430
|
+
};
|
|
431
|
+
browser_release: {
|
|
432
|
+
request: undefined;
|
|
433
|
+
response: BrowserReleaseResult;
|
|
434
|
+
};
|
|
435
|
+
browser_launch: {
|
|
436
|
+
request: BrowserLaunchParams;
|
|
437
|
+
response: unknown;
|
|
438
|
+
};
|
|
439
|
+
browser_close: {
|
|
440
|
+
request: BrowserCloseParams;
|
|
441
|
+
response: unknown;
|
|
442
|
+
};
|
|
443
|
+
page_screenshot: {
|
|
444
|
+
request: PageScreenshotParams;
|
|
445
|
+
response: unknown;
|
|
446
|
+
};
|
|
447
|
+
page_selected_element: {
|
|
448
|
+
request: PageSelectedElementParams;
|
|
449
|
+
response: unknown;
|
|
450
|
+
};
|
|
451
|
+
tab_open: {
|
|
452
|
+
request: TabOpenParams;
|
|
453
|
+
response: unknown;
|
|
454
|
+
};
|
|
455
|
+
tab_close: {
|
|
456
|
+
request: TabCloseParams;
|
|
457
|
+
response: unknown;
|
|
458
|
+
};
|
|
459
|
+
tab_list: {
|
|
460
|
+
request: undefined;
|
|
461
|
+
response: unknown;
|
|
462
|
+
};
|
|
463
|
+
page_click: {
|
|
464
|
+
request: PageClickParams;
|
|
465
|
+
response: unknown;
|
|
466
|
+
};
|
|
467
|
+
page_type: {
|
|
468
|
+
request: PageTypeParams;
|
|
469
|
+
response: unknown;
|
|
470
|
+
};
|
|
471
|
+
page_scroll: {
|
|
472
|
+
request: PageScrollParams;
|
|
473
|
+
response: unknown;
|
|
474
|
+
};
|
|
475
|
+
page_hover: {
|
|
476
|
+
request: PageHoverParams;
|
|
477
|
+
response: unknown;
|
|
478
|
+
};
|
|
479
|
+
page_eval: {
|
|
480
|
+
request: PageEvalParams;
|
|
481
|
+
response: unknown;
|
|
482
|
+
};
|
|
483
|
+
page_snapshot: {
|
|
484
|
+
request: PageSnapshotParams;
|
|
485
|
+
response: unknown;
|
|
486
|
+
};
|
|
487
|
+
page_press: {
|
|
488
|
+
request: PagePressParams;
|
|
489
|
+
response: unknown;
|
|
490
|
+
};
|
|
491
|
+
page_wait: {
|
|
492
|
+
request: PageWaitParams;
|
|
493
|
+
response: unknown;
|
|
494
|
+
};
|
|
495
|
+
page_navigate: {
|
|
496
|
+
request: PageNavigateParams;
|
|
497
|
+
response: unknown;
|
|
498
|
+
};
|
|
499
|
+
page_upload: {
|
|
500
|
+
request: PageUploadParams;
|
|
501
|
+
response: unknown;
|
|
502
|
+
};
|
|
503
|
+
page_frames: {
|
|
504
|
+
request: PageFramesParams;
|
|
505
|
+
response: unknown;
|
|
506
|
+
};
|
|
507
|
+
set_device_emulation: {
|
|
508
|
+
request: SetDeviceEmulationParams;
|
|
509
|
+
response: unknown;
|
|
510
|
+
};
|
|
511
|
+
set_timezone: {
|
|
512
|
+
request: SetTimezoneParams;
|
|
513
|
+
response: SetTimezoneResult;
|
|
514
|
+
};
|
|
515
|
+
get_cookie: {
|
|
516
|
+
request: GetCookieParams;
|
|
517
|
+
response: GetCookieResult;
|
|
518
|
+
};
|
|
519
|
+
set_cookie: {
|
|
520
|
+
request: SetCookieParams;
|
|
521
|
+
response: SetCookieResult;
|
|
522
|
+
};
|
|
523
|
+
record_start: {
|
|
524
|
+
request: RecordParams;
|
|
525
|
+
response: unknown;
|
|
526
|
+
};
|
|
527
|
+
record_stop: {
|
|
528
|
+
request: RecordParams;
|
|
529
|
+
response: unknown;
|
|
530
|
+
};
|
|
531
|
+
request_domain_permission: {
|
|
532
|
+
request: RequestDomainPermissionParams;
|
|
533
|
+
response: unknown;
|
|
534
|
+
};
|
|
535
|
+
get_user_info: {
|
|
536
|
+
request: GetUserInfoParams;
|
|
537
|
+
response: unknown;
|
|
538
|
+
};
|
|
539
|
+
run_actions: {
|
|
540
|
+
request: RunActionsParams;
|
|
541
|
+
response: unknown;
|
|
542
|
+
};
|
|
543
|
+
}
|
|
544
|
+
export type BrowserAction = keyof BrowserActionMap;
|
|
545
|
+
export type BrowserActionRequest<A extends BrowserAction> = BrowserActionMap[A]['request'];
|
|
546
|
+
export type BrowserActionResponse<A extends BrowserAction> = BrowserActionMap[A]['response'];
|
|
547
|
+
export type BrowserCommandAction = Exclude<BrowserAction, 'browser_select_browser'>;
|
|
548
|
+
export type ExtensionBrowserAction = Exclude<BrowserCommandAction, 'browser_list' | 'browser_launch' | 'browser_close'>;
|
|
549
|
+
export declare const PAGE_ACT_ACTIONS: readonly ["page_click", "page_type", "page_hover", "page_scroll", "page_press", "page_upload", "page_eval"];
|
|
550
|
+
export type PageActAction = (typeof PAGE_ACT_ACTIONS)[number];
|
|
551
|
+
export declare const BROWSER_ACTIONS: {
|
|
552
|
+
readonly get_requests: true;
|
|
553
|
+
readonly get_logs: true;
|
|
554
|
+
readonly get_events: true;
|
|
555
|
+
readonly get_api_schema: true;
|
|
556
|
+
readonly set_mock: true;
|
|
557
|
+
readonly get_mocks: true;
|
|
558
|
+
readonly set_rule: true;
|
|
559
|
+
readonly get_rules: true;
|
|
560
|
+
readonly send_request: true;
|
|
561
|
+
readonly send_mtop_request: true;
|
|
562
|
+
readonly tdbank_account: true;
|
|
563
|
+
readonly browser_list: true;
|
|
564
|
+
readonly browser_select_browser: true;
|
|
565
|
+
readonly browser_release: true;
|
|
566
|
+
readonly browser_launch: true;
|
|
567
|
+
readonly browser_close: true;
|
|
568
|
+
readonly page_screenshot: true;
|
|
569
|
+
readonly page_selected_element: true;
|
|
570
|
+
readonly tab_open: true;
|
|
571
|
+
readonly tab_close: true;
|
|
572
|
+
readonly tab_list: true;
|
|
573
|
+
readonly page_click: true;
|
|
574
|
+
readonly page_type: true;
|
|
575
|
+
readonly page_scroll: true;
|
|
576
|
+
readonly page_hover: true;
|
|
577
|
+
readonly page_eval: true;
|
|
578
|
+
readonly page_snapshot: true;
|
|
579
|
+
readonly page_press: true;
|
|
580
|
+
readonly page_wait: true;
|
|
581
|
+
readonly page_navigate: true;
|
|
582
|
+
readonly page_upload: true;
|
|
583
|
+
readonly page_frames: true;
|
|
584
|
+
readonly set_device_emulation: true;
|
|
585
|
+
readonly set_timezone: true;
|
|
586
|
+
readonly get_cookie: true;
|
|
587
|
+
readonly set_cookie: true;
|
|
588
|
+
readonly record_start: true;
|
|
589
|
+
readonly record_stop: true;
|
|
590
|
+
readonly request_domain_permission: true;
|
|
591
|
+
readonly get_user_info: true;
|
|
592
|
+
readonly run_actions: true;
|
|
593
|
+
};
|
|
594
|
+
export declare const BROWSER_COMMAND_ACTIONS: {
|
|
595
|
+
readonly get_requests: true;
|
|
596
|
+
readonly get_logs: true;
|
|
597
|
+
readonly get_events: true;
|
|
598
|
+
readonly get_api_schema: true;
|
|
599
|
+
readonly set_mock: true;
|
|
600
|
+
readonly get_mocks: true;
|
|
601
|
+
readonly set_rule: true;
|
|
602
|
+
readonly get_rules: true;
|
|
603
|
+
readonly send_request: true;
|
|
604
|
+
readonly send_mtop_request: true;
|
|
605
|
+
readonly tdbank_account: true;
|
|
606
|
+
readonly browser_list: true;
|
|
607
|
+
readonly browser_release: true;
|
|
608
|
+
readonly browser_launch: true;
|
|
609
|
+
readonly browser_close: true;
|
|
610
|
+
readonly page_screenshot: true;
|
|
611
|
+
readonly page_selected_element: true;
|
|
612
|
+
readonly tab_open: true;
|
|
613
|
+
readonly tab_close: true;
|
|
614
|
+
readonly tab_list: true;
|
|
615
|
+
readonly page_click: true;
|
|
616
|
+
readonly page_type: true;
|
|
617
|
+
readonly page_scroll: true;
|
|
618
|
+
readonly page_hover: true;
|
|
619
|
+
readonly page_eval: true;
|
|
620
|
+
readonly page_snapshot: true;
|
|
621
|
+
readonly page_press: true;
|
|
622
|
+
readonly page_wait: true;
|
|
623
|
+
readonly page_navigate: true;
|
|
624
|
+
readonly page_upload: true;
|
|
625
|
+
readonly page_frames: true;
|
|
626
|
+
readonly set_device_emulation: true;
|
|
627
|
+
readonly set_timezone: true;
|
|
628
|
+
readonly get_cookie: true;
|
|
629
|
+
readonly set_cookie: true;
|
|
630
|
+
readonly record_start: true;
|
|
631
|
+
readonly record_stop: true;
|
|
632
|
+
readonly request_domain_permission: true;
|
|
633
|
+
readonly get_user_info: true;
|
|
634
|
+
readonly run_actions: true;
|
|
635
|
+
};
|
|
636
|
+
export declare const EXTENSION_BROWSER_ACTIONS: {
|
|
637
|
+
readonly get_requests: true;
|
|
638
|
+
readonly get_logs: true;
|
|
639
|
+
readonly get_events: true;
|
|
640
|
+
readonly get_api_schema: true;
|
|
641
|
+
readonly set_mock: true;
|
|
642
|
+
readonly get_mocks: true;
|
|
643
|
+
readonly set_rule: true;
|
|
644
|
+
readonly get_rules: true;
|
|
645
|
+
readonly send_request: true;
|
|
646
|
+
readonly send_mtop_request: true;
|
|
647
|
+
readonly tdbank_account: true;
|
|
648
|
+
readonly browser_release: true;
|
|
649
|
+
readonly page_screenshot: true;
|
|
650
|
+
readonly page_selected_element: true;
|
|
651
|
+
readonly tab_open: true;
|
|
652
|
+
readonly tab_close: true;
|
|
653
|
+
readonly tab_list: true;
|
|
654
|
+
readonly page_click: true;
|
|
655
|
+
readonly page_type: true;
|
|
656
|
+
readonly page_scroll: true;
|
|
657
|
+
readonly page_hover: true;
|
|
658
|
+
readonly page_eval: true;
|
|
659
|
+
readonly page_snapshot: true;
|
|
660
|
+
readonly page_press: true;
|
|
661
|
+
readonly page_wait: true;
|
|
662
|
+
readonly page_navigate: true;
|
|
663
|
+
readonly page_upload: true;
|
|
664
|
+
readonly page_frames: true;
|
|
665
|
+
readonly set_device_emulation: true;
|
|
666
|
+
readonly set_timezone: true;
|
|
667
|
+
readonly get_cookie: true;
|
|
668
|
+
readonly set_cookie: true;
|
|
669
|
+
readonly record_start: true;
|
|
670
|
+
readonly record_stop: true;
|
|
671
|
+
readonly request_domain_permission: true;
|
|
672
|
+
readonly get_user_info: true;
|
|
673
|
+
readonly run_actions: true;
|
|
674
|
+
};
|
|
675
|
+
export declare function isBrowserAction(value: unknown): value is BrowserAction;
|
|
676
|
+
export declare function isBrowserCommandAction(value: unknown): value is BrowserCommandAction;
|
|
677
|
+
export declare function isExtensionBrowserAction(value: unknown): value is ExtensionBrowserAction;
|