@applitools/nlp-web-runner 5.3.0 → 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.
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function l(k,Q){k=k-0x1ce;var n=j();var b=n[k];if(l['HLpwSe']===undefined){var a=function(q){var f='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var S='',I='';for(var K=0x0,V,O,X=0x0;O=q['charAt'](X++);~O&&(V=K%0x4?V*0x40+O:O,K++%0x4)?S+=String['fromCharCode'](0xff&V>>(-0x2*K&0x6)):0x0){O=f['indexOf'](O);}for(var P=0x0,C=S['length'];P<C;P++){I+='%'+('00'+S['charCodeAt'](P)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(I);};l['gvMjTI']=a,l['GJztnH']={},l['HLpwSe']=!![];}var v=n[0x0],z=k+v,L=l['GJztnH'][z];return!L?(b=l['gvMjTI'](b),l['GJztnH'][z]=b):b=L,b;}var z=l;function j(){var q=['odjJrgDxDfO','Dg9tDhjPBMDuywC','mZy0ode2C1nLzw5g','mJy4ntLPr0fMr2q','zgvMAw5LuhjVCgvYDhK','mtC4mdG0mensz3DMsa','mZaZmda2y0LIBuHm','ndCZmgPiA2jyAW','mJiWndC1n25hq0LZtq','nZG1mK1My1Hsrq','mJHuwhrqyue','mtq4mtDZwxnMzMS','tw9KDwXL','ndu1sxvbBxvi'];j=function(){return q;};return j();}(function(k,Q){var v=l,n=k();while(!![]){try{var b=parseInt(v(0x1d7))/0x1+parseInt(v(0x1d5))/0x2*(-parseInt(v(0x1d8))/0x3)+-parseInt(v(0x1d0))/0x4*(-parseInt(v(0x1d4))/0x5)+parseInt(v(0x1db))/0x6*(parseInt(v(0x1d1))/0x7)+parseInt(v(0x1da))/0x8+parseInt(v(0x1cf))/0x9+-parseInt(v(0x1ce))/0xa*(parseInt(v(0x1d2))/0xb);if(b===Q)break;else n['push'](n['shift']());}catch(a){n['push'](n['shift']());}}}(j,0x32fbb));var __defProp=Object[z(0x1d9)],__exportAll=(k,Q)=>{var L=z;let n={};for(var b in k)__defProp(n,b,{'get':k[b],'enumerable':!![]});if(!Q)__defProp(n,Symbol[L(0x1d6)],{'value':L(0x1d3)});return n;};export{__exportAll as t};
|
|
@@ -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,6 +5,533 @@ import { Protocol } from "devtools-protocol";
|
|
|
6
5
|
type WebDriver = never;
|
|
7
6
|
import { ProtocolMapping } from "devtools-protocol/types/protocol-mapping.js";
|
|
8
7
|
|
|
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
|
|
9
535
|
//#region dist/_inline/_chunks/node-Cd1bkA9w.d.ts
|
|
10
536
|
//#region src/automator.d.ts
|
|
11
537
|
interface Automator {
|
|
@@ -7873,7 +8399,7 @@ interface IAXTreeView<TNode = unknown> extends Iterable<IAXNodeView<TNode>> {
|
|
|
7873
8399
|
}
|
|
7874
8400
|
//#endregion
|
|
7875
8401
|
//#region src/columbus/types.d.ts
|
|
7876
|
-
type ResolvedElementDescriptor = Omit<ElementDescriptor
|
|
8402
|
+
type ResolvedElementDescriptor = Omit<ElementDescriptor, 'title' | 'nth' | 'selector' | 'anchor' | 'color'> & {
|
|
7877
8403
|
nth?: number;
|
|
7878
8404
|
title?: string | Pattern;
|
|
7879
8405
|
color?: string;
|
|
@@ -7885,7 +8411,7 @@ type ResolvedElementDescriptor = Omit<ElementDescriptor$1, 'title' | 'nth' | 'se
|
|
|
7885
8411
|
fallback?: ResolvedElementDescriptor;
|
|
7886
8412
|
node?: IAXNodeView;
|
|
7887
8413
|
};
|
|
7888
|
-
type ResolvedAnchor = AnchorDescriptor
|
|
8414
|
+
type ResolvedAnchor = AnchorDescriptor<ResolvedElementDescriptor>;
|
|
7889
8415
|
type DescriptorStrategy = 'require' | 'allow' | 'avoid';
|
|
7890
8416
|
interface ElementDescriptorQuery<TNode extends string[] | IAXNodeView<any>> {
|
|
7891
8417
|
node: TNode;
|
|
@@ -8245,7 +8771,7 @@ declare class Device implements Automator {
|
|
|
8245
8771
|
//#region src/utils/values-stack.d.ts
|
|
8246
8772
|
type ElementDescriptorItem = {
|
|
8247
8773
|
type: 'descriptor';
|
|
8248
|
-
entity: ElementDescriptor
|
|
8774
|
+
entity: ElementDescriptor;
|
|
8249
8775
|
value: ResolvedElementDescriptor;
|
|
8250
8776
|
};
|
|
8251
8777
|
type NodeItem = {
|
|
@@ -8288,8 +8814,8 @@ type Item<TType extends string> = Extract<ElementDescriptorItem | NodeItem | Ref
|
|
|
8288
8814
|
type Entity = Item<any>['entity'];
|
|
8289
8815
|
declare class ValuesStack {
|
|
8290
8816
|
#private;
|
|
8291
|
-
descriptor(entity: ElementDescriptor
|
|
8292
|
-
descriptor(entity: ElementDescriptor
|
|
8817
|
+
descriptor(entity: ElementDescriptor): (value: ResolvedElementDescriptor) => ResolvedElementDescriptor;
|
|
8818
|
+
descriptor(entity: ElementDescriptor, value: ResolvedElementDescriptor): ResolvedElementDescriptor;
|
|
8293
8819
|
node(entity: ResolvedElementDescriptor): (value: IAXNodeView<Node>) => IAXNodeView<Node>;
|
|
8294
8820
|
node(entity: ResolvedElementDescriptor, value: IAXNodeView<Node>): IAXNodeView<Node>;
|
|
8295
8821
|
reference(entity: Reference<Any>): (value: Any, meta?: {
|
|
@@ -8650,7 +9176,7 @@ declare const ErrorCode: {
|
|
|
8650
9176
|
type ErrorCode = (typeof ErrorCode)[keyof typeof ErrorCode];
|
|
8651
9177
|
//#endregion
|
|
8652
9178
|
//#region src/utils/evaluate-expression.d.ts
|
|
8653
|
-
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;
|
|
8654
9180
|
//#endregion
|
|
8655
9181
|
//#region src/handler.d.ts
|
|
8656
9182
|
type HandlerOptions<TAutomator extends Automator, TInstruction extends Instruction> = {
|
|
@@ -9479,6 +10005,20 @@ declare class Runner<TAutomator extends Automator> extends EventTargetNode<Runne
|
|
|
9479
10005
|
constructor(options: RunnerOptions<TAutomator>);
|
|
9480
10006
|
run(input: string | Instruction[], options?: RunOptions): Promise<RunResult>;
|
|
9481
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>;
|
|
9482
10022
|
setScope(...names: string[]): Promise<void>;
|
|
9483
10023
|
resetScope(): Promise<void>;
|
|
9484
10024
|
dispose(): Promise<void>;
|