@applitools/nlp-web-runner 5.2.2 → 5.4.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/dist/_inline/_chunks/rolldown-runtime-D7D4PA-g.js +1 -1
- package/dist/_inline/_externals/nlp-runner.externals.json +0 -1
- package/dist/_inline/assets/{extract-ax-tree-CoBL9ja1.js → extract-ax-tree-DYEbctJp.js} +1 -1
- package/dist/_inline/assets/{extract-pdf-ax-tree-3Y3LHj7T.js → extract-pdf-ax-tree-CxF87TEH.js} +1 -1
- package/dist/_inline/assets/{index-DwFhv7rA.html → index-C5rB_Uzy.html} +5937 -4680
- package/dist/_inline/assets/{recorder-eqjB4Xxs.js → recorder-BLcQX8wr.js} +2 -2
- package/dist/_inline/nlp-runner/web/index.d.ts +558 -54
- package/dist/_inline/nlp-runner/web/index.js +1 -1
- package/package.json +2 -3
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { AbsolutePosition, Action, AnchorDescriptor, AnchorDescriptor as AnchorDescriptor$1, Any, ChromeElementDescriptor, CloseAction, Condition, ContentType, ControlType, DropPreinstructionsControlFlow, ElementDescriptor, ElementDescriptor as ElementDescriptor$1, ElementScrollDirection, EntriesOperation, Extractor, FileHandle, Generator as Generator$1, IfControlFlow, InitializeScopeControlFlow, Instruction, InterpolatedString, JSExpression, JSExpressionReference, KeysOperation, NumberExpression, OTP, Operand, Operation, Pattern, Primitive, RandomValue, Reference, RelativePosition, SetPreinstructionsControlFlow, SizeOperation, StructuralType, Structure, TryControlFlow, ValuesOperation } from "@applitools/nlp-parser";
|
|
2
1
|
import { Dispatcher, WebSocket } from "undici";
|
|
3
2
|
import { Readable } from "node:stream";
|
|
4
3
|
import { Har } from "chrome-har";
|
|
@@ -6,10 +5,537 @@ import { Protocol } from "devtools-protocol";
|
|
|
6
5
|
type WebDriver = never;
|
|
7
6
|
import { ProtocolMapping } from "devtools-protocol/types/protocol-mapping.js";
|
|
8
7
|
|
|
9
|
-
//#region dist/
|
|
8
|
+
//#region ../parser/dist/types.d.ts
|
|
9
|
+
type SetPreinstructionsControlFlow = {
|
|
10
|
+
type: 'set preinstructions';
|
|
11
|
+
instructions: Instruction[];
|
|
12
|
+
};
|
|
13
|
+
type DropPreinstructionsControlFlow = {
|
|
14
|
+
type: 'drop preinstructions';
|
|
15
|
+
};
|
|
16
|
+
type TryControlFlow = {
|
|
17
|
+
type: 'try';
|
|
18
|
+
instructions: Instruction[];
|
|
19
|
+
};
|
|
20
|
+
type InitializeScopeControlFlow = {
|
|
21
|
+
type: 'initialize scope';
|
|
22
|
+
name: string;
|
|
23
|
+
parameters?: {
|
|
24
|
+
name: string;
|
|
25
|
+
value: AnyExpression;
|
|
26
|
+
secret: boolean;
|
|
27
|
+
}[];
|
|
28
|
+
options?: {
|
|
29
|
+
navigation?: 'all';
|
|
30
|
+
assertions?: 'visual' | 'nonvisual' | 'all';
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
type IfControlFlow = {
|
|
34
|
+
type: 'if';
|
|
35
|
+
condition: Condition;
|
|
36
|
+
then?: Instruction[];
|
|
37
|
+
otherwise?: Instruction[];
|
|
38
|
+
};
|
|
39
|
+
type ControlFlow = SetPreinstructionsControlFlow | DropPreinstructionsControlFlow | TryControlFlow | InitializeScopeControlFlow | IfControlFlow;
|
|
40
|
+
type EmptyAction = {
|
|
41
|
+
type: 'empty';
|
|
42
|
+
};
|
|
43
|
+
type CommentAction = {
|
|
44
|
+
type: 'comment';
|
|
45
|
+
text: string;
|
|
46
|
+
};
|
|
47
|
+
type SetVariableAction = {
|
|
48
|
+
type: 'set variable';
|
|
49
|
+
destruction?: boolean;
|
|
50
|
+
names: {
|
|
51
|
+
name: string;
|
|
52
|
+
secret?: boolean;
|
|
53
|
+
}[];
|
|
54
|
+
data: {
|
|
55
|
+
value: AnyExpression | Extractor<ElementDescriptor, any> | Generator$1;
|
|
56
|
+
secret?: boolean;
|
|
57
|
+
};
|
|
58
|
+
scope?: 'public' | 'internal';
|
|
59
|
+
};
|
|
60
|
+
type SetValueAction = {
|
|
61
|
+
type: 'set value';
|
|
62
|
+
value: StringExpression | NumberExpression | Generator$1 | FileHandle;
|
|
63
|
+
element: ElementDescriptor;
|
|
64
|
+
};
|
|
65
|
+
type FetchAction = {
|
|
66
|
+
type: 'fetch';
|
|
67
|
+
url: StringExpression;
|
|
68
|
+
method?: 'get' | 'post' | 'put' | 'patch' | 'delete' | 'head' | 'trace' | 'options' | 'connect';
|
|
69
|
+
auth?: {
|
|
70
|
+
type: 'basic';
|
|
71
|
+
username: StringExpression;
|
|
72
|
+
password: StringExpression;
|
|
73
|
+
};
|
|
74
|
+
headers?: {
|
|
75
|
+
name: StringExpression;
|
|
76
|
+
value: StringExpression;
|
|
77
|
+
secret: boolean;
|
|
78
|
+
}[];
|
|
79
|
+
cookies?: {
|
|
80
|
+
name: StringExpression;
|
|
81
|
+
value: StringExpression;
|
|
82
|
+
secret: boolean;
|
|
83
|
+
}[];
|
|
84
|
+
body?: {
|
|
85
|
+
type?: 'json' | 'xml' | 'base64';
|
|
86
|
+
data: AnyExpression;
|
|
87
|
+
};
|
|
88
|
+
statuses?: number[] | '*';
|
|
89
|
+
};
|
|
90
|
+
type AssertAction = {
|
|
91
|
+
type: 'assert';
|
|
92
|
+
condition: Condition;
|
|
93
|
+
timeout?: NumberExpression;
|
|
94
|
+
};
|
|
95
|
+
type EvaluateAction = {
|
|
96
|
+
type: 'evaluate';
|
|
97
|
+
js: JSExpression;
|
|
98
|
+
};
|
|
99
|
+
type FocusAction = {
|
|
100
|
+
type: 'focus';
|
|
101
|
+
element: ElementDescriptor;
|
|
102
|
+
};
|
|
103
|
+
type CheckAction = {
|
|
104
|
+
type: 'check';
|
|
105
|
+
value: boolean;
|
|
106
|
+
element: ElementDescriptor;
|
|
107
|
+
};
|
|
108
|
+
type ClearAction = {
|
|
109
|
+
type: 'clear';
|
|
110
|
+
element?: ElementDescriptor;
|
|
111
|
+
};
|
|
112
|
+
type EraseAction = {
|
|
113
|
+
type: 'erase';
|
|
114
|
+
size: NumberExpression;
|
|
115
|
+
element?: ElementDescriptor;
|
|
116
|
+
};
|
|
117
|
+
type TypeAction = {
|
|
118
|
+
type: 'type';
|
|
119
|
+
value: AnyExpression | Extractor<ElementDescriptor, any> | Generator$1;
|
|
120
|
+
secret?: boolean;
|
|
121
|
+
element?: ElementDescriptor | ChromeElementDescriptor;
|
|
122
|
+
};
|
|
123
|
+
type SearchAction = {
|
|
124
|
+
type: 'search';
|
|
125
|
+
value: StringExpression;
|
|
126
|
+
element?: ElementDescriptor;
|
|
127
|
+
};
|
|
128
|
+
type HitKeyAction = {
|
|
129
|
+
type: 'hit key';
|
|
130
|
+
keys: Key[];
|
|
131
|
+
times?: NumberExpression;
|
|
132
|
+
};
|
|
133
|
+
type ClickElementAction = {
|
|
134
|
+
type: 'click';
|
|
135
|
+
keys?: Key[];
|
|
136
|
+
element: ElementDescriptor;
|
|
137
|
+
button?: 'left' | 'right';
|
|
138
|
+
times?: number;
|
|
139
|
+
};
|
|
140
|
+
type ClickChromeElementAction = {
|
|
141
|
+
type: 'click';
|
|
142
|
+
element: ChromeElementDescriptor;
|
|
143
|
+
};
|
|
144
|
+
type HoverAction = {
|
|
145
|
+
type: 'hover';
|
|
146
|
+
element: ElementDescriptor;
|
|
147
|
+
};
|
|
148
|
+
type ScrollByDistanceAction = {
|
|
149
|
+
type: 'scroll';
|
|
150
|
+
distance?: NumberExpression;
|
|
151
|
+
direction?: Direction;
|
|
152
|
+
times?: NumberExpression;
|
|
153
|
+
};
|
|
154
|
+
type ScrollByFractionAction = {
|
|
155
|
+
type: 'scroll';
|
|
156
|
+
fraction: NumberExpression;
|
|
157
|
+
element?: ElementDescriptor | ViewportDescriptor;
|
|
158
|
+
direction?: Direction;
|
|
159
|
+
times?: NumberExpression;
|
|
160
|
+
};
|
|
161
|
+
type ScrollToPositionAction = {
|
|
162
|
+
type: 'scroll';
|
|
163
|
+
position: AbsolutePosition;
|
|
164
|
+
element?: ElementDescriptor | ViewportDescriptor;
|
|
165
|
+
times?: NumberExpression;
|
|
166
|
+
};
|
|
167
|
+
type ScrollToElementAction = {
|
|
168
|
+
type: 'scroll';
|
|
169
|
+
element: ElementDescriptor;
|
|
170
|
+
};
|
|
171
|
+
type ScrollTheElementAction = {
|
|
172
|
+
type: 'scroll';
|
|
173
|
+
element: ElementDescriptor;
|
|
174
|
+
direction?: Direction;
|
|
175
|
+
distance: NumberExpression;
|
|
176
|
+
times?: NumberExpression;
|
|
177
|
+
};
|
|
178
|
+
type AlertAction = {
|
|
179
|
+
type: 'alert';
|
|
180
|
+
value: boolean;
|
|
181
|
+
condition?: ElementCondition;
|
|
182
|
+
};
|
|
183
|
+
type NavigatePdfAction = {
|
|
184
|
+
type: 'navigate pdf';
|
|
185
|
+
page: NumberExpression;
|
|
186
|
+
};
|
|
187
|
+
type NavigateToUrlAction = {
|
|
188
|
+
type: 'navigate';
|
|
189
|
+
url: StringExpression;
|
|
190
|
+
relative?: boolean;
|
|
191
|
+
statuses?: number[] | '*';
|
|
192
|
+
};
|
|
193
|
+
type NavigateThroughHistoryAction = {
|
|
194
|
+
type: 'navigate';
|
|
195
|
+
direction: HistoryDirection;
|
|
196
|
+
times?: NumberExpression;
|
|
197
|
+
};
|
|
198
|
+
type GoAction = {
|
|
199
|
+
type: 'go';
|
|
200
|
+
target: StringExpression;
|
|
201
|
+
};
|
|
202
|
+
type RefreshAction = {
|
|
203
|
+
type: 'refresh';
|
|
204
|
+
value?: 'hard' | 'soft';
|
|
205
|
+
};
|
|
206
|
+
type CreateTargetAction = {
|
|
207
|
+
type: 'create target';
|
|
208
|
+
url?: StringExpression;
|
|
209
|
+
};
|
|
210
|
+
type CloseTargetAction = {
|
|
211
|
+
type: 'close target';
|
|
212
|
+
};
|
|
213
|
+
type CloseAction = {
|
|
214
|
+
type: 'close';
|
|
215
|
+
element: ElementDescriptor;
|
|
216
|
+
};
|
|
217
|
+
type SwitchTargetByIndexAction = {
|
|
218
|
+
type: 'switch target';
|
|
219
|
+
index: NumberExpression;
|
|
220
|
+
};
|
|
221
|
+
type SwitchTargetByTitleAction = {
|
|
222
|
+
type: 'switch target';
|
|
223
|
+
title: StringExpression;
|
|
224
|
+
};
|
|
225
|
+
type SwitchTargetByPositionAction = {
|
|
226
|
+
type: 'switch target';
|
|
227
|
+
position: SequentialRelativePosition;
|
|
228
|
+
};
|
|
229
|
+
type WaitAction = {
|
|
230
|
+
type: 'wait';
|
|
231
|
+
timeout?: NumberExpression;
|
|
232
|
+
condition?: Condition;
|
|
233
|
+
};
|
|
234
|
+
type FindAction = {
|
|
235
|
+
type: 'find';
|
|
236
|
+
element: ElementDescriptor;
|
|
237
|
+
};
|
|
238
|
+
type VisualCheckAction = {
|
|
239
|
+
type: 'visual check';
|
|
240
|
+
};
|
|
241
|
+
type IntentAction = {
|
|
242
|
+
type: 'intent';
|
|
243
|
+
description: string;
|
|
244
|
+
};
|
|
245
|
+
type Action<TType extends string> = Extract<EmptyAction | CommentAction | SetVariableAction | SetValueAction | FetchAction | AssertAction | EvaluateAction | FocusAction | CheckAction | ClearAction | EraseAction | TypeAction | HitKeyAction | SearchAction | ClickElementAction | ClickChromeElementAction | HoverAction | ScrollByDistanceAction | ScrollByFractionAction | ScrollToPositionAction | ScrollToElementAction | ScrollTheElementAction | AlertAction | NavigateToUrlAction | NavigateThroughHistoryAction | NavigatePdfAction | RefreshAction | CreateTargetAction | CloseTargetAction | CloseAction | SwitchTargetByIndexAction | SwitchTargetByTitleAction | SwitchTargetByPositionAction | WaitAction | GoAction | FindAction | VisualCheckAction | IntentAction, {
|
|
246
|
+
type: TType;
|
|
247
|
+
}>;
|
|
248
|
+
type Instruction = Action<any> | ControlFlow;
|
|
249
|
+
type Primitive<TPrimitiveName extends string> = TPrimitiveName extends 'null' ? null : TPrimitiveName extends 'boolean' ? boolean : TPrimitiveName extends 'number' ? number : TPrimitiveName extends 'string' ? string : TPrimitiveName extends 'any' ? Any : unknown;
|
|
250
|
+
type PrimitiveName<TPrimitive = Any> = TPrimitive extends null ? 'null' : TPrimitive extends boolean ? 'boolean' : TPrimitive extends number ? 'number' : TPrimitive extends string ? 'string' : TPrimitive extends Any ? 'any' : never;
|
|
251
|
+
type Reference<TType> = {
|
|
252
|
+
isRef: true;
|
|
253
|
+
name: string;
|
|
254
|
+
modifiers?: ({
|
|
255
|
+
get: number | StringExpression;
|
|
256
|
+
} | {
|
|
257
|
+
match: Pattern;
|
|
258
|
+
})[];
|
|
259
|
+
type?: PrimitiveName<TType>;
|
|
260
|
+
scope?: 'public' | 'internal';
|
|
261
|
+
};
|
|
262
|
+
type JSExpressionReference<TType> = {
|
|
263
|
+
isJSExpressionRef: true;
|
|
264
|
+
expression: JSExpression;
|
|
265
|
+
type?: PrimitiveName<TType>;
|
|
266
|
+
};
|
|
267
|
+
type InterpolatedString = {
|
|
268
|
+
isInterpolatedString: true;
|
|
269
|
+
chunks: (string | Reference<string> | JSExpressionReference<string>)[];
|
|
270
|
+
};
|
|
271
|
+
type JSExpression = {
|
|
272
|
+
isJSExpression: true;
|
|
273
|
+
chunks: (string | Reference<Any>)[];
|
|
274
|
+
};
|
|
275
|
+
type Structure = ArrayStructure | RecordStructure;
|
|
276
|
+
type ArrayStructure = {
|
|
277
|
+
isStructure: true;
|
|
278
|
+
type: 'array';
|
|
279
|
+
items: AnyExpression[];
|
|
280
|
+
};
|
|
281
|
+
type RecordStructure = {
|
|
282
|
+
isStructure: true;
|
|
283
|
+
type: 'record';
|
|
284
|
+
items: {
|
|
285
|
+
key: StringExpression;
|
|
286
|
+
value: AnyExpression;
|
|
287
|
+
}[];
|
|
288
|
+
};
|
|
289
|
+
type Pattern = {
|
|
290
|
+
isPattern: true;
|
|
291
|
+
flags?: string;
|
|
292
|
+
} & ({
|
|
293
|
+
pattern: string;
|
|
294
|
+
} | {
|
|
295
|
+
name: PatternName;
|
|
296
|
+
});
|
|
297
|
+
type PatternName = 'number' | 'price' | 'percentage' | 'date' | 'time' | 'code';
|
|
298
|
+
type Extractor<TValue, TType extends Primitive<any>> = {
|
|
299
|
+
isExtractor: true;
|
|
300
|
+
value: TValue;
|
|
301
|
+
type: PrimitiveName<TType> | 'color' | 'background-color' | 'foreground-color';
|
|
302
|
+
};
|
|
303
|
+
type OTP = {
|
|
304
|
+
isOTP: true;
|
|
305
|
+
user: StringExpression;
|
|
306
|
+
};
|
|
307
|
+
type RandomValue<TType extends Primitive<any> = any> = {
|
|
308
|
+
isRandomValue: true;
|
|
309
|
+
description?: StringExpression;
|
|
310
|
+
type?: PrimitiveName<TType>;
|
|
311
|
+
properties?: string[];
|
|
312
|
+
};
|
|
313
|
+
type Generator$1 = OTP | RandomValue;
|
|
314
|
+
type FileHandle = {
|
|
315
|
+
isFileHandle: true;
|
|
316
|
+
filename: StringExpression;
|
|
317
|
+
};
|
|
318
|
+
type NumberExpression = number | NumberOperation | Reference<number> | JSExpressionReference<number>;
|
|
319
|
+
type StringExpression = string | InterpolatedString | Reference<string> | JSExpressionReference<string>;
|
|
320
|
+
type Any = null | boolean | number | string | {
|
|
321
|
+
[key: string]: Any;
|
|
322
|
+
} | Any[];
|
|
323
|
+
type AnyExpression = null | boolean | number | NumberOperation | string | InterpolatedString | Structure | Reference<Any> | JSExpressionReference<Any>;
|
|
324
|
+
type Condition = {
|
|
325
|
+
isCondition: true;
|
|
326
|
+
operation: ConditionOperation;
|
|
327
|
+
};
|
|
328
|
+
type Operation = ConditionOperation | ExpressionOperation;
|
|
329
|
+
type ExpressionOperation = SizeOperation | KeysOperation | ValuesOperation | EntriesOperation | NumberOperation;
|
|
330
|
+
type NumberOperation = AddOperation | SubOperation | MulOperation | DivOperation;
|
|
331
|
+
type ConditionOperation = ParensOperation | IgnoreCaseOperation | MatchCaseOperation | NotOperation | OrOperation | AndOperation | ComparisonOperation | ValidateOperation | MatchOperation | IncludesOnlyOperation | IncludesOperation | StartsWithOperation | EndsWithOperation | VisibleOperation | ClickableOperation | EnabledOperation | HoveredOperation | CheckedOperation | PopulatedOperation;
|
|
332
|
+
type Operand = {
|
|
333
|
+
isOperand: true;
|
|
334
|
+
value: AnyExpression | ElementDescriptor | Extractor<ElementDescriptor, any> | DialogDescriptor | ExpressionOperation;
|
|
335
|
+
};
|
|
336
|
+
type ParensOperation = {
|
|
337
|
+
operator: 'parens';
|
|
338
|
+
operands: [ConditionOperation];
|
|
339
|
+
};
|
|
340
|
+
type NotOperation = {
|
|
341
|
+
operator: 'not';
|
|
342
|
+
operands: [ConditionOperation];
|
|
343
|
+
};
|
|
344
|
+
type IgnoreCaseOperation = {
|
|
345
|
+
operator: 'ignore case';
|
|
346
|
+
operands: [ConditionOperation];
|
|
347
|
+
};
|
|
348
|
+
type MatchCaseOperation = {
|
|
349
|
+
operator: 'match case';
|
|
350
|
+
operands: [ConditionOperation];
|
|
351
|
+
};
|
|
352
|
+
type SizeOperation = {
|
|
353
|
+
operator: 'size';
|
|
354
|
+
operands: [Operand];
|
|
355
|
+
};
|
|
356
|
+
type KeysOperation = {
|
|
357
|
+
operator: 'keys';
|
|
358
|
+
operands: [Operand];
|
|
359
|
+
};
|
|
360
|
+
type ValuesOperation = {
|
|
361
|
+
operator: 'values';
|
|
362
|
+
operands: [Operand];
|
|
363
|
+
};
|
|
364
|
+
type EntriesOperation = {
|
|
365
|
+
operator: 'entries';
|
|
366
|
+
operands: [Operand];
|
|
367
|
+
};
|
|
368
|
+
type AddOperation = {
|
|
369
|
+
operator: 'add';
|
|
370
|
+
operands: [Operand, Operand];
|
|
371
|
+
};
|
|
372
|
+
type SubOperation = {
|
|
373
|
+
operator: 'sub';
|
|
374
|
+
operands: [Operand, Operand];
|
|
375
|
+
};
|
|
376
|
+
type MulOperation = {
|
|
377
|
+
operator: 'mul';
|
|
378
|
+
operands: [Operand, Operand];
|
|
379
|
+
};
|
|
380
|
+
type DivOperation = {
|
|
381
|
+
operator: 'div';
|
|
382
|
+
operands: [Operand, Operand];
|
|
383
|
+
};
|
|
384
|
+
type OrOperation = {
|
|
385
|
+
operator: 'or';
|
|
386
|
+
operands: [ConditionOperation, ConditionOperation];
|
|
387
|
+
};
|
|
388
|
+
type AndOperation = {
|
|
389
|
+
operator: 'and';
|
|
390
|
+
operands: [ConditionOperation, ConditionOperation];
|
|
391
|
+
};
|
|
392
|
+
type ComparisonOperation = EqOperation | LtOperation | GtOperation | LteOperation | GteOperation;
|
|
393
|
+
type EqOperation = {
|
|
394
|
+
operator: 'eq';
|
|
395
|
+
operands: [Operand, Operand];
|
|
396
|
+
};
|
|
397
|
+
type LtOperation = {
|
|
398
|
+
operator: 'lt';
|
|
399
|
+
operands: [Operand, Operand];
|
|
400
|
+
};
|
|
401
|
+
type GtOperation = {
|
|
402
|
+
operator: 'gt';
|
|
403
|
+
operands: [Operand, Operand];
|
|
404
|
+
};
|
|
405
|
+
type LteOperation = {
|
|
406
|
+
operator: 'lte';
|
|
407
|
+
operands: [Operand, Operand];
|
|
408
|
+
};
|
|
409
|
+
type GteOperation = {
|
|
410
|
+
operator: 'gte';
|
|
411
|
+
operands: [Operand, Operand];
|
|
412
|
+
};
|
|
413
|
+
type ValidateOperation = {
|
|
414
|
+
operator: 'validate';
|
|
415
|
+
operands: [Operand, `${'lower' | 'upper' | 'pascal' | 'camel' | 'snake' | 'kebab'}case` | 'capitalized' | 'numeric' | 'alphanumeric'];
|
|
416
|
+
};
|
|
417
|
+
type MatchOperation = {
|
|
418
|
+
operator: 'match';
|
|
419
|
+
operands: [Operand, Pattern];
|
|
420
|
+
};
|
|
421
|
+
type IncludesOnlyOperation = {
|
|
422
|
+
operator: 'includes only';
|
|
423
|
+
operands: [Operand, Operand, ...Operand[]];
|
|
424
|
+
};
|
|
425
|
+
type IncludesOperation = {
|
|
426
|
+
operator: 'includes';
|
|
427
|
+
operands: [Operand, Operand];
|
|
428
|
+
};
|
|
429
|
+
type StartsWithOperation = {
|
|
430
|
+
operator: 'starts with';
|
|
431
|
+
operands: [Operand, Operand];
|
|
432
|
+
};
|
|
433
|
+
type EndsWithOperation = {
|
|
434
|
+
operator: 'ends with';
|
|
435
|
+
operands: [Operand, Operand];
|
|
436
|
+
};
|
|
437
|
+
type VisibleOperation = {
|
|
438
|
+
operator: 'visible';
|
|
439
|
+
operands: [Operand];
|
|
440
|
+
};
|
|
441
|
+
type ClickableOperation = {
|
|
442
|
+
operator: 'clickable';
|
|
443
|
+
operands: [Operand];
|
|
444
|
+
};
|
|
445
|
+
type EnabledOperation = {
|
|
446
|
+
operator: 'enabled';
|
|
447
|
+
operands: [Operand];
|
|
448
|
+
};
|
|
449
|
+
type HoveredOperation = {
|
|
450
|
+
operator: 'hovered';
|
|
451
|
+
operands: [Operand];
|
|
452
|
+
};
|
|
453
|
+
type CheckedOperation = {
|
|
454
|
+
operator: 'checked';
|
|
455
|
+
operands: [Operand, boolean];
|
|
456
|
+
};
|
|
457
|
+
type PopulatedOperation = {
|
|
458
|
+
operator: 'populated';
|
|
459
|
+
operands: [Operand];
|
|
460
|
+
};
|
|
461
|
+
type ElementScrollDirection = 'horizontal' | 'vertical' | 'both';
|
|
462
|
+
type ElementDescriptor = {
|
|
463
|
+
nth?: NumberExpression;
|
|
464
|
+
type?: ElementType | ElementType[];
|
|
465
|
+
title?: StringExpression | Pattern;
|
|
466
|
+
orderDirection?: 'forward' | 'backward';
|
|
467
|
+
state?: {
|
|
468
|
+
focused?: boolean;
|
|
469
|
+
active?: boolean;
|
|
470
|
+
};
|
|
471
|
+
color?: StringExpression;
|
|
472
|
+
superlative?: Superlative;
|
|
473
|
+
selector?: Selector$1;
|
|
474
|
+
hints?: {
|
|
475
|
+
type?: ElementType | ElementType[];
|
|
476
|
+
scrollable?: ElementScrollDirection;
|
|
477
|
+
role?: 'close' | 'submit' | 'cancel';
|
|
478
|
+
};
|
|
479
|
+
avoid?: ElementDescriptorAvoid | ElementDescriptorAvoid[];
|
|
480
|
+
anchor?: AnchorDescriptor | AnchorDescriptor[];
|
|
481
|
+
secret?: boolean;
|
|
482
|
+
fallback?: ElementDescriptor;
|
|
483
|
+
vocabulary?: Record<string, string>[];
|
|
484
|
+
};
|
|
485
|
+
type ElementDescriptorAvoid = {
|
|
486
|
+
type?: ElementType | ElementType[];
|
|
487
|
+
ancestor?: {
|
|
488
|
+
type?: ElementType | ElementType[];
|
|
489
|
+
minScore?: number;
|
|
490
|
+
};
|
|
491
|
+
};
|
|
492
|
+
type Selector$1 = {
|
|
493
|
+
type: 'css' | 'xpath';
|
|
494
|
+
selector: StringExpression;
|
|
495
|
+
};
|
|
496
|
+
type AnchorDescriptor<TElement = ElementDescriptor> = RelativeAnchorDescriptor<TElement> | AbsoluteAnchorDescriptor<TElement>;
|
|
497
|
+
type RelativeAnchorDescriptor<TElement = ElementDescriptor> = {
|
|
498
|
+
position: RelativePosition | RelativePosition[];
|
|
499
|
+
element: TElement;
|
|
500
|
+
};
|
|
501
|
+
type AbsoluteAnchorDescriptor<TElement = ElementDescriptor> = {
|
|
502
|
+
position: AbsolutePosition | AbsolutePosition[];
|
|
503
|
+
element?: TElement | ViewportDescriptor;
|
|
504
|
+
};
|
|
505
|
+
type DialogDescriptor = {
|
|
506
|
+
isDialogDescriptor: true;
|
|
507
|
+
};
|
|
508
|
+
type ChromeElementDescriptor = {
|
|
509
|
+
isChromeElementDescriptor: true;
|
|
510
|
+
title: 'refresh' | 'back' | 'forward' | 'url';
|
|
511
|
+
};
|
|
512
|
+
type ViewportDescriptor = {
|
|
513
|
+
isViewportDescriptor: true;
|
|
514
|
+
};
|
|
515
|
+
type CharacterKey = 'Backquote' | 'Digit1' | 'Digit2' | 'Digit3' | 'Digit4' | 'Digit5' | 'Digit6' | 'Digit7' | 'Digit8' | 'Digit9' | 'Digit0' | 'Minus' | 'Equal' | 'Backslash' | 'KeyQ' | 'KeyW' | 'KeyE' | 'KeyR' | 'KeyT' | 'KeyY' | 'KeyU' | 'KeyI' | 'KeyO' | 'KeyP' | 'BracketLeft' | 'BracketRight' | 'KeyA' | 'KeyS' | 'KeyD' | 'KeyF' | 'KeyG' | 'KeyH' | 'KeyJ' | 'KeyK' | 'KeyL' | 'Semicolon' | 'Quote' | 'KeyZ' | 'KeyX' | 'KeyC' | 'KeyV' | 'KeyB' | 'KeyN' | 'KeyM' | 'Comma' | 'Period' | 'Slash';
|
|
516
|
+
type ArrowKey = 'ArrowUp' | 'ArrowDown' | 'ArrowLeft' | 'ArrowRight';
|
|
517
|
+
type ControlKey = 'Escape' | 'F1' | 'F2' | 'F3' | 'F4' | 'F5' | 'F6' | 'F7' | 'F8' | 'F9' | 'F10' | 'F11' | 'F12' | 'Backspace' | 'Tab' | 'CapsLock' | 'Enter' | 'ShiftLeft' | 'ShiftRight' | 'ControlLeft' | 'MetaLeft' | 'AltLeft' | 'Space' | 'AltRight' | 'AltGraph' | 'MetaRight' | 'ControlRight' | 'Delete' | 'Home' | 'End' | 'PageUp' | 'PageDown' | 'Insert';
|
|
518
|
+
type Key = ControlKey | ArrowKey | CharacterKey;
|
|
519
|
+
type ElementCondition = {
|
|
520
|
+
type: ConditionType;
|
|
521
|
+
element?: ElementDescriptor;
|
|
522
|
+
};
|
|
523
|
+
type ConditionType = 'exists' | 'not-exists' | 'visible' | 'not-visible' | 'clickable';
|
|
524
|
+
type ElementType = StructuralType | ControlType | ContentType;
|
|
525
|
+
type StructuralType = 'app' | 'host' | 'ad' | 'header' | 'footer' | 'sidebar' | 'popup' | 'tooltip' | 'modal' | 'scrollable' | 'form' | 'fieldset' | 'menu' | 'menuitem' | 'hamburger' | 'list' | 'listitem' | 'heading' | 'table' | 'table-cell' | 'table-head-cell' | 'table-row' | 'table-dom-row' | 'table-leaf-row' | 'table-head-row' | 'table-column' | 'table-leaf-column' | 'table-stub-column' | 'card' | 'pdfpage';
|
|
526
|
+
type ControlType = 'checkboxgroup' | 'checkbox' | 'radiogroup' | 'radio' | 'textbox' | 'combobox' | 'listbox' | 'option' | 'datepicker' | 'timepicker' | 'datetimepicker' | 'colorpicker' | 'filepicker' | 'slider' | 'inputbox' | 'selectbox' | 'valuebox' | 'button' | 'color';
|
|
527
|
+
type ContentType = 'text' | 'link' | 'label' | 'logo' | 'image' | 'icon' | 'video' | 'paragraph';
|
|
528
|
+
type HistoryDirection = 'back' | 'forward';
|
|
529
|
+
type SequentialRelativePosition = 'next' | 'previous';
|
|
530
|
+
type Direction = 'up' | 'down' | 'left' | 'right';
|
|
531
|
+
type Superlative = 'smallest' | 'largest' | 'widest' | 'narrowest' | 'tallest' | 'shortest' | 'leftmost' | 'rightmost' | 'topmost' | 'bottommost';
|
|
532
|
+
type AbsolutePosition = 'inside' | 'center' | 'top' | 'bottom' | 'left' | 'right' | 'topleft' | 'topright' | 'bottomleft' | 'bottomright';
|
|
533
|
+
type RelativePosition = 'near' | 'above' | 'below' | 'leftof' | 'rightof' | 'aboveleftof' | 'aboverightof' | 'belowleftof' | 'belowrightof';
|
|
534
|
+
//#endregion
|
|
535
|
+
//#region dist/_inline/_chunks/node-Cd1bkA9w.d.ts
|
|
10
536
|
//#region src/automator.d.ts
|
|
11
537
|
interface Automator {
|
|
12
|
-
readonly type: 'web' | '
|
|
538
|
+
readonly type: 'web' | 'mobile';
|
|
13
539
|
readonly blocked: boolean;
|
|
14
540
|
captureScreenshot(): Promise<string>;
|
|
15
541
|
stabilize(stage: 'basic' | 'strict' | 'paranoid', options?: {
|
|
@@ -240,7 +766,7 @@ declare class Rectangle {
|
|
|
240
766
|
//#region src/patterns.d.ts
|
|
241
767
|
type Match = (text: string) => string | null;
|
|
242
768
|
//#endregion
|
|
243
|
-
//#region dist/_inline/_chunks/script-
|
|
769
|
+
//#region dist/_inline/_chunks/script-6O13rCLT.d.ts
|
|
244
770
|
//#region src/port.d.ts
|
|
245
771
|
interface PortMessageEvent<TName extends string = string, TPayload = unknown> extends Event {
|
|
246
772
|
readonly name: TName;
|
|
@@ -1131,7 +1657,7 @@ declare class Target extends EventTargetNode<TargetEventMap> {
|
|
|
1131
1657
|
}: TargetOptions);
|
|
1132
1658
|
frames(): Generator<Frame, void, unknown>;
|
|
1133
1659
|
targets(): Generator<Target, void, unknown>;
|
|
1134
|
-
wait(event: 'stable' | 'initialized' | 'windowResolved' | 'navigated' | 'pendingRequests' | 'dialogOpened', {
|
|
1660
|
+
wait(event: 'stable' | 'attached' | 'initialized' | 'windowResolved' | 'navigated' | 'pendingRequests' | 'dialogOpened', {
|
|
1135
1661
|
signal
|
|
1136
1662
|
}?: {
|
|
1137
1663
|
signal?: AbortSignal;
|
|
@@ -7702,7 +8228,8 @@ interface AXOption {
|
|
|
7702
8228
|
}
|
|
7703
8229
|
interface AXState {
|
|
7704
8230
|
disabled?: boolean;
|
|
7705
|
-
|
|
8231
|
+
/** Not a hit target (e.g. `pointer-events: none` on web, `isUserInteractionEnabled == false` on iOS). Absent means interactable. */
|
|
8232
|
+
inert?: boolean;
|
|
7706
8233
|
focused?: boolean;
|
|
7707
8234
|
checked?: boolean;
|
|
7708
8235
|
}
|
|
@@ -7872,7 +8399,7 @@ interface IAXTreeView<TNode = unknown> extends Iterable<IAXNodeView<TNode>> {
|
|
|
7872
8399
|
}
|
|
7873
8400
|
//#endregion
|
|
7874
8401
|
//#region src/columbus/types.d.ts
|
|
7875
|
-
type ResolvedElementDescriptor = Omit<ElementDescriptor
|
|
8402
|
+
type ResolvedElementDescriptor = Omit<ElementDescriptor, 'title' | 'nth' | 'selector' | 'anchor' | 'color'> & {
|
|
7876
8403
|
nth?: number;
|
|
7877
8404
|
title?: string | Pattern;
|
|
7878
8405
|
color?: string;
|
|
@@ -7884,7 +8411,7 @@ type ResolvedElementDescriptor = Omit<ElementDescriptor$1, 'title' | 'nth' | 'se
|
|
|
7884
8411
|
fallback?: ResolvedElementDescriptor;
|
|
7885
8412
|
node?: IAXNodeView;
|
|
7886
8413
|
};
|
|
7887
|
-
type ResolvedAnchor = AnchorDescriptor
|
|
8414
|
+
type ResolvedAnchor = AnchorDescriptor<ResolvedElementDescriptor>;
|
|
7888
8415
|
type DescriptorStrategy = 'require' | 'allow' | 'avoid';
|
|
7889
8416
|
interface ElementDescriptorQuery<TNode extends string[] | IAXNodeView<any>> {
|
|
7890
8417
|
node: TNode;
|
|
@@ -8227,7 +8754,7 @@ type DeviceOptions = {
|
|
|
8227
8754
|
connection: Connection$2;
|
|
8228
8755
|
};
|
|
8229
8756
|
declare class Device implements Automator {
|
|
8230
|
-
readonly type = "
|
|
8757
|
+
readonly type = "mobile";
|
|
8231
8758
|
readonly connection: Connection$2;
|
|
8232
8759
|
readonly blocked = false;
|
|
8233
8760
|
constructor({
|
|
@@ -8244,7 +8771,7 @@ declare class Device implements Automator {
|
|
|
8244
8771
|
//#region src/utils/values-stack.d.ts
|
|
8245
8772
|
type ElementDescriptorItem = {
|
|
8246
8773
|
type: 'descriptor';
|
|
8247
|
-
entity: ElementDescriptor
|
|
8774
|
+
entity: ElementDescriptor;
|
|
8248
8775
|
value: ResolvedElementDescriptor;
|
|
8249
8776
|
};
|
|
8250
8777
|
type NodeItem = {
|
|
@@ -8287,8 +8814,8 @@ type Item<TType extends string> = Extract<ElementDescriptorItem | NodeItem | Ref
|
|
|
8287
8814
|
type Entity = Item<any>['entity'];
|
|
8288
8815
|
declare class ValuesStack {
|
|
8289
8816
|
#private;
|
|
8290
|
-
descriptor(entity: ElementDescriptor
|
|
8291
|
-
descriptor(entity: ElementDescriptor
|
|
8817
|
+
descriptor(entity: ElementDescriptor): (value: ResolvedElementDescriptor) => ResolvedElementDescriptor;
|
|
8818
|
+
descriptor(entity: ElementDescriptor, value: ResolvedElementDescriptor): ResolvedElementDescriptor;
|
|
8292
8819
|
node(entity: ResolvedElementDescriptor): (value: IAXNodeView<Node>) => IAXNodeView<Node>;
|
|
8293
8820
|
node(entity: ResolvedElementDescriptor, value: IAXNodeView<Node>): IAXNodeView<Node>;
|
|
8294
8821
|
reference(entity: Reference<Any>): (value: Any, meta?: {
|
|
@@ -8649,7 +9176,7 @@ declare const ErrorCode: {
|
|
|
8649
9176
|
type ErrorCode = (typeof ErrorCode)[keyof typeof ErrorCode];
|
|
8650
9177
|
//#endregion
|
|
8651
9178
|
//#region src/utils/evaluate-expression.d.ts
|
|
8652
|
-
type EvaluatedExpression<TValue> = TValue extends Extractor<ElementDescriptor
|
|
9179
|
+
type EvaluatedExpression<TValue> = TValue extends Extractor<ElementDescriptor, infer TResult extends Any> ? TResult : TValue extends NumberExpression ? number : TValue extends SizeOperation ? number : TValue extends KeysOperation ? string[] : TValue extends ValuesOperation | EntriesOperation ? Any[] : TValue extends Condition ? boolean : TValue extends OTP ? string : TValue extends RandomValue<string> ? string | string[] : TValue extends RandomValue<number> ? number : TValue extends Reference<infer TType extends Any> ? TType : TValue extends JSExpressionReference<infer TType extends Any> ? TType : TValue extends InterpolatedString ? string : TValue extends JSExpression ? string : TValue extends Structure ? Record<string, any> | any[] : TValue extends FileHandle ? string : TValue extends Pattern ? RegExp | Match : TValue extends ChromeElementDescriptor ? ChromeElementDescriptor : TValue extends ElementDescriptor ? ResolvedElementDescriptor : TValue;
|
|
8653
9180
|
//#endregion
|
|
8654
9181
|
//#region src/handler.d.ts
|
|
8655
9182
|
type HandlerOptions<TAutomator extends Automator, TInstruction extends Instruction> = {
|
|
@@ -8749,7 +9276,7 @@ declare abstract class Handler$1<TAutomator extends Automator, TInstruction exte
|
|
|
8749
9276
|
evaluate<TValue>(value: TValue): Promise<EvaluatedExpression<TValue>>;
|
|
8750
9277
|
element(descriptor: ResolvedElementDescriptor): Promise<{
|
|
8751
9278
|
web: IAXNodeView<WebNode> | null;
|
|
8752
|
-
|
|
9279
|
+
mobile: IAXNodeView<IOSNode> | null;
|
|
8753
9280
|
}[TAutomator["type"]]>;
|
|
8754
9281
|
capture(): Promise<Capture | undefined>;
|
|
8755
9282
|
before(): Promise<void>;
|
|
@@ -9316,44 +9843,7 @@ declare const handlers: {
|
|
|
9316
9843
|
try: typeof TryHandler;
|
|
9317
9844
|
if: typeof IfHandler;
|
|
9318
9845
|
};
|
|
9319
|
-
|
|
9320
|
-
check: typeof CheckHandler;
|
|
9321
|
-
click: typeof ClickHandler;
|
|
9322
|
-
find: typeof FindHandler;
|
|
9323
|
-
focus: typeof FocusHandler;
|
|
9324
|
-
scroll: typeof ScrollHandler;
|
|
9325
|
-
type: typeof TypeHandler;
|
|
9326
|
-
assert: typeof AssertHandler;
|
|
9327
|
-
wait: typeof WaitHandler;
|
|
9328
|
-
empty: typeof EmptyHandler;
|
|
9329
|
-
comment: typeof EmptyHandler;
|
|
9330
|
-
fetch: typeof FetchHandler;
|
|
9331
|
-
'set variable': typeof SetVariableHandler;
|
|
9332
|
-
'visual check': typeof VisualCheckHandler;
|
|
9333
|
-
intent: typeof IntentHandler;
|
|
9334
|
-
'set preinstructions': typeof DefinePreinstructionsHandler;
|
|
9335
|
-
'drop preinstructions': typeof DefinePreinstructionsHandler;
|
|
9336
|
-
'initialize scope': typeof InitializeScopeHandler;
|
|
9337
|
-
try: typeof TryHandler;
|
|
9338
|
-
if: typeof IfHandler;
|
|
9339
|
-
"set value": never;
|
|
9340
|
-
evaluate: never;
|
|
9341
|
-
clear: never;
|
|
9342
|
-
erase: never;
|
|
9343
|
-
"hit key": never;
|
|
9344
|
-
search: never;
|
|
9345
|
-
hover: never;
|
|
9346
|
-
alert: never;
|
|
9347
|
-
navigate: never;
|
|
9348
|
-
"navigate pdf": never;
|
|
9349
|
-
refresh: never;
|
|
9350
|
-
"create target": never;
|
|
9351
|
-
"close target": never;
|
|
9352
|
-
close: never;
|
|
9353
|
-
"switch target": never;
|
|
9354
|
-
go: never;
|
|
9355
|
-
};
|
|
9356
|
-
android: {
|
|
9846
|
+
mobile: {
|
|
9357
9847
|
check: typeof CheckHandler;
|
|
9358
9848
|
click: typeof ClickHandler;
|
|
9359
9849
|
find: typeof FindHandler;
|
|
@@ -9515,6 +10005,20 @@ declare class Runner<TAutomator extends Automator> extends EventTargetNode<Runne
|
|
|
9515
10005
|
constructor(options: RunnerOptions<TAutomator>);
|
|
9516
10006
|
run(input: string | Instruction[], options?: RunOptions): Promise<RunResult>;
|
|
9517
10007
|
handle<TInstruction extends Instruction>(instruction: TInstruction, options?: RunOptions): Promise<HandlerResult<TAutomator, TInstruction>>;
|
|
10008
|
+
/**
|
|
10009
|
+
* Locates an element on the page and returns its node, or `null` when nothing matches.
|
|
10010
|
+
*
|
|
10011
|
+
* Accepts either a natural-language element descriptor string (e.g. `"the red submit button below the form"`)
|
|
10012
|
+
* or a structured {@link ElementDescriptor} object. Unlike {@link run}/{@link handle}, this is a pure query:
|
|
10013
|
+
* it stabilizes the page, resolves the descriptor, and runs Columbus element finding, but does not run
|
|
10014
|
+
* preinstructions, capture screenshots, or update the active element.
|
|
10015
|
+
*
|
|
10016
|
+
* Web-oriented: the returned node is a `WebNode`, consistent with `RunnerContext.activeElement`.
|
|
10017
|
+
*/
|
|
10018
|
+
find(descriptor: string | ElementDescriptor, options?: {
|
|
10019
|
+
timeout?: number;
|
|
10020
|
+
signal?: AbortSignal;
|
|
10021
|
+
}): Promise<WebNode | null>;
|
|
9518
10022
|
setScope(...names: string[]): Promise<void>;
|
|
9519
10023
|
resetScope(): Promise<void>;
|
|
9520
10024
|
dispose(): Promise<void>;
|
|
@@ -9576,7 +10080,7 @@ type SubinstructionExecutionStartedDetails = {
|
|
|
9576
10080
|
};
|
|
9577
10081
|
};
|
|
9578
10082
|
type StepMetrics = {
|
|
9579
|
-
platform?: 'web' | '
|
|
10083
|
+
platform?: 'web' | 'mobile';
|
|
9580
10084
|
stabilizeMs?: number;
|
|
9581
10085
|
handleMs?: number;
|
|
9582
10086
|
findStrategy?: 'columbus' | 'selector';
|
|
@@ -9664,7 +10168,7 @@ type FindNodeOptions = {
|
|
|
9664
10168
|
};
|
|
9665
10169
|
type FindNodeResult<TAutomator extends Automator> = {
|
|
9666
10170
|
web: IAXNodeView<WebNode> | null;
|
|
9667
|
-
|
|
10171
|
+
mobile: IAXNodeView<IOSNode$1> | null;
|
|
9668
10172
|
}[TAutomator['type']];
|
|
9669
10173
|
declare class AXOps<TAutomator extends Automator = Automator> {
|
|
9670
10174
|
#private;
|