@unotest/dsl 0.5.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/CHANGELOG.md +15 -0
- package/EXTENSIONS.md +121 -0
- package/LICENSE +21 -0
- package/README.md +51 -0
- package/dist/chunk-4PFHLTL7.js +1 -0
- package/dist/functional-expression-BC_QljY1.d.ts +98 -0
- package/dist/index.d.ts +588 -0
- package/dist/index.js +1 -0
- package/dist/validator/index.d.ts +110 -0
- package/dist/validator/index.js +1 -0
- package/package.json +59 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,588 @@
|
|
|
1
|
+
import { V as Value, S as Statement, E as Expression, T as Token, F as FunctionalExpression, B as BlockStatement } from './functional-expression-BC_QljY1.js';
|
|
2
|
+
export { a as TokenType } from './functional-expression-BC_QljY1.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* DSL code builders — canonical source of truth for generating DSL text.
|
|
6
|
+
*
|
|
7
|
+
* Any layer that needs to produce DSL code strings (MCP, GuidanceAnalyzer, etc.)
|
|
8
|
+
* MUST use these builders. Implementing ad-hoc string templates outside this file
|
|
9
|
+
* violates the Shared DSL/Runner Contract (runner-first rule).
|
|
10
|
+
*
|
|
11
|
+
* All function names MUST match primitives registered in
|
|
12
|
+
* libs/ast-blockly/src/validator/contracts/function-contract-registry.ts.
|
|
13
|
+
* Do NOT introduce new names here — follow the 6-step checklist in the architecture plan first.
|
|
14
|
+
*/
|
|
15
|
+
declare function buildClickDsl(selector: string, index?: number, description?: string): string;
|
|
16
|
+
declare function buildFillDsl(selector: string, value: string, index?: number, description?: string): string;
|
|
17
|
+
declare function buildTypeTextDsl(selector: string, text: string, description?: string): string;
|
|
18
|
+
/**
|
|
19
|
+
* Navigate to a URL using the `open` primitive (registered in ast-blockly as OPEN_FUNCTION_CONTRACT).
|
|
20
|
+
* The legacy name `buildNavigateDsl` is kept as an alias for callers that use the 'navigate' ActionType.
|
|
21
|
+
*/
|
|
22
|
+
declare function buildOpenDsl(url: string, pageId?: string, description?: string): string;
|
|
23
|
+
/** @alias buildOpenDsl — kept for callers that reference the 'navigate' ActionType name. */
|
|
24
|
+
declare const buildNavigateDsl: typeof buildOpenDsl;
|
|
25
|
+
/**
|
|
26
|
+
* Assert element visibility using `elementVisibilityAssert` (ELEMENT_VISIBILITY_ASSERT_FUNCTION_CONTRACT).
|
|
27
|
+
* Operation "VISIBLE" is one of the registered VISIBILITY_OPS enum values.
|
|
28
|
+
*/
|
|
29
|
+
declare function buildAssertVisibleDsl(selector: string, description?: string): string;
|
|
30
|
+
/**
|
|
31
|
+
* Assert URL contains a substring using `urlAssert` (URL_ASSERT_FUNCTION_CONTRACT).
|
|
32
|
+
* Operation "CONTAINS" is one of the registered STRING_ASSERT_OPS enum values.
|
|
33
|
+
*/
|
|
34
|
+
declare function buildAssertUrlContainsDsl(url: string, description?: string): string;
|
|
35
|
+
declare function buildAssertPageReadyDsl(description?: string): string;
|
|
36
|
+
declare function buildAssertAuthenticatedDsl(description?: string): string;
|
|
37
|
+
declare function buildAssertTableNotEmptyDsl(selector: string, description?: string): string;
|
|
38
|
+
declare function buildAssertListNotEmptyDsl(selector: string, description?: string): string;
|
|
39
|
+
declare function buildAssertNoVisibleErrorDsl(description?: string): string;
|
|
40
|
+
declare function buildAssertSectionTitleDsl(title: string, description?: string): string;
|
|
41
|
+
declare function buildAssertToastVisibleDsl(message: string, description?: string): string;
|
|
42
|
+
declare function buildAssertDialogOpenDsl(title: string, description?: string): string;
|
|
43
|
+
declare function buildAssertRouteIsDsl(path: string, description?: string): string;
|
|
44
|
+
declare function buildSelectComboboxValueDsl(selector: string, value: string, description?: string): string;
|
|
45
|
+
declare function buildLoginAsDsl(username: string, password: string, description?: string): string;
|
|
46
|
+
declare function buildOpenMenuItemDsl(label: string, description?: string): string;
|
|
47
|
+
declare function buildOpenTabDsl(label: string, description?: string): string;
|
|
48
|
+
declare function buildCloseDialogDsl(button: string, description?: string): string;
|
|
49
|
+
declare function buildFillFormDsl(fields: Record<string, string>, description?: string): string;
|
|
50
|
+
declare function buildSaveFormDsl(button: string, description?: string): string;
|
|
51
|
+
declare function buildWaitForDsl(selector: string, description?: string, timeoutMs?: number): string;
|
|
52
|
+
declare function buildWaitForTextDsl(selector: string, text: string, description?: string, timeoutMs?: number): string;
|
|
53
|
+
declare function buildWaitForHiddenDsl(selector: string, description?: string, timeoutMs?: number): string;
|
|
54
|
+
declare function buildWaitForURLDsl(pattern: string, description?: string, timeoutMs?: number): string;
|
|
55
|
+
declare function buildWaitForNavigationDsl(description?: string, timeoutMs?: number): string;
|
|
56
|
+
declare function buildAssertInputValueDsl(selector: string, expected: string, description?: string, operation?: 'IS' | 'CONTAINS'): string;
|
|
57
|
+
declare function buildScrollIntoViewDsl(selector: string, description?: string): string;
|
|
58
|
+
declare function buildScrollToBottomDsl(selector: string, description?: string): string;
|
|
59
|
+
declare function buildScrollToTopDsl(selector: string, description?: string): string;
|
|
60
|
+
declare function buildForceClickDsl(selector: string, description?: string): string;
|
|
61
|
+
declare function buildDragAndDropDsl(fromSelector: string, toSelector: string, description?: string): string;
|
|
62
|
+
declare function buildClipboardPasteDsl(selector: string, text: string, description?: string): string;
|
|
63
|
+
declare function buildKeypressDsl(key: string, selector?: string, description?: string): string;
|
|
64
|
+
declare function buildSwitchToFrameDsl(selector: string, description?: string): string;
|
|
65
|
+
declare function buildSwitchToMainFrameDsl(description?: string): string;
|
|
66
|
+
declare function buildAssertNotVisibleDsl(selector: string, description?: string): string;
|
|
67
|
+
declare function buildAssertTextContainsDsl(selector: string, text: string, description?: string): string;
|
|
68
|
+
declare function buildAssertTextEqualsDsl(selector: string, text: string, description?: string): string;
|
|
69
|
+
declare function buildAssertUrlEqualsDsl(url: string, description?: string): string;
|
|
70
|
+
declare function buildAssertCountEqualsDsl(selector: string, count: number, description?: string): string;
|
|
71
|
+
declare function buildFlowDsl(testId: string, title: string): string;
|
|
72
|
+
|
|
73
|
+
declare class ArrayValue implements Value {
|
|
74
|
+
private readonly elements;
|
|
75
|
+
constructor(sizeOrElements: number | Value[] | ArrayValue);
|
|
76
|
+
get(index: number): Value;
|
|
77
|
+
set(index: number, value: Value): void;
|
|
78
|
+
asNumber(): number;
|
|
79
|
+
clone(): ArrayValue;
|
|
80
|
+
asString(): string;
|
|
81
|
+
toString(): string;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
interface Func {
|
|
85
|
+
execute(...args: Value[]): Value;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
declare class Functions {
|
|
89
|
+
private static readonly functions;
|
|
90
|
+
static isExists(key: string): boolean;
|
|
91
|
+
static get(key: string): Func;
|
|
92
|
+
static set(name: string, value: Func): void;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
declare class NumberValue implements Value {
|
|
96
|
+
static ZERO: NumberValue;
|
|
97
|
+
readonly value: number;
|
|
98
|
+
constructor(value: number | boolean);
|
|
99
|
+
clone(): Value;
|
|
100
|
+
asNumber(): number;
|
|
101
|
+
asString(): string;
|
|
102
|
+
toString(): string;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
declare class ObjectValue implements Value {
|
|
106
|
+
private readonly properties;
|
|
107
|
+
constructor(properties?: Map<string, Value>);
|
|
108
|
+
get(key: string): Value | undefined;
|
|
109
|
+
set(key: string, value: Value): void;
|
|
110
|
+
asNumber(): number;
|
|
111
|
+
asString(): string;
|
|
112
|
+
clone(): Value;
|
|
113
|
+
getProperties(): Map<string, Value>;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/** ECMA-262 5.1 RegularExpressionLiteral runtime value. Holds the
|
|
117
|
+
* pattern source + flag-string the lexer captured.
|
|
118
|
+
*
|
|
119
|
+
* The native `RegExp` object is intentionally NOT constructed here —
|
|
120
|
+
* the literal stays serializable (JSON-safe `{source, flags}`) so
|
|
121
|
+
* consumers can ship it across boundaries (JSONL run-artifacts, WS
|
|
122
|
+
* messages, IPC) without losing fidelity. Native `RegExp` should be
|
|
123
|
+
* reconstructed only at the boundary that actually needs it (e.g.
|
|
124
|
+
* the Playwright adapter on the web side).
|
|
125
|
+
*
|
|
126
|
+
* Flag validation runs at construction time so every downstream
|
|
127
|
+
* layer can trust that `flags` is a subset of ES5's `gim` with no
|
|
128
|
+
* duplicates. Post-ES5 flags (`s u y d v`) are rejected with a
|
|
129
|
+
* message naming the spec they came from — guards against the LLM
|
|
130
|
+
* reflex to write `/x/u` from Playwright doc-copy. */
|
|
131
|
+
declare class RegExpValue implements Value {
|
|
132
|
+
readonly source: string;
|
|
133
|
+
readonly flags: string;
|
|
134
|
+
constructor(source: string, flags: string);
|
|
135
|
+
clone(): Value;
|
|
136
|
+
asNumber(): number;
|
|
137
|
+
asString(): string;
|
|
138
|
+
toString(): string;
|
|
139
|
+
}
|
|
140
|
+
declare class RegExpFlagError extends Error {
|
|
141
|
+
constructor(message: string);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
declare class StringValue implements Value {
|
|
145
|
+
private readonly value;
|
|
146
|
+
constructor(value: string);
|
|
147
|
+
clone(): Value;
|
|
148
|
+
asNumber(): number;
|
|
149
|
+
asString(): string;
|
|
150
|
+
toString(): string;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
declare class UserDefineFunction implements Func {
|
|
154
|
+
private readonly argNames;
|
|
155
|
+
private readonly body;
|
|
156
|
+
constructor(argNames: string[], body: Statement);
|
|
157
|
+
getArgsCount(): number;
|
|
158
|
+
getArgsName(index: number): string;
|
|
159
|
+
execute(...args: Value[]): Value;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
declare class Variables {
|
|
163
|
+
private static stack;
|
|
164
|
+
private static variables;
|
|
165
|
+
static push(): void;
|
|
166
|
+
static pop(): void;
|
|
167
|
+
static isExists(key: string): boolean;
|
|
168
|
+
static get(key: string): Value;
|
|
169
|
+
static set(name: string, value: Value): void;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
declare class ArrayAccessExpression implements Expression {
|
|
173
|
+
private readonly variable;
|
|
174
|
+
private readonly indexes;
|
|
175
|
+
readonly token: Token;
|
|
176
|
+
constructor(variable: string, indexes: Expression[], token: Token);
|
|
177
|
+
eval(): Value;
|
|
178
|
+
lastIndex(): number;
|
|
179
|
+
index(index: number): number;
|
|
180
|
+
getArray(): ArrayValue;
|
|
181
|
+
private consumeArray;
|
|
182
|
+
toString(): string;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
declare class ArrayAssignmentStatement implements Statement {
|
|
186
|
+
private readonly array;
|
|
187
|
+
private readonly expression;
|
|
188
|
+
readonly token: Token;
|
|
189
|
+
constructor(array: ArrayAccessExpression, expression: Expression, token: Token);
|
|
190
|
+
execute(): void;
|
|
191
|
+
toString(): string;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
declare class ArrayExpression implements Expression {
|
|
195
|
+
readonly elements: Expression[];
|
|
196
|
+
readonly token: Token;
|
|
197
|
+
constructor(argument: Expression[], token: Token);
|
|
198
|
+
eval(): Value;
|
|
199
|
+
toString(): string;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
declare class AssignmentStatement implements Statement {
|
|
203
|
+
variable: string;
|
|
204
|
+
expression: Expression;
|
|
205
|
+
readonly token: Token;
|
|
206
|
+
constructor(variable: string, expression: Expression, token: Token);
|
|
207
|
+
execute(): void;
|
|
208
|
+
toString(): string;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
declare class BinaryExpression implements Expression {
|
|
212
|
+
readonly expr1: Expression;
|
|
213
|
+
readonly expr2: Expression;
|
|
214
|
+
readonly operation: string;
|
|
215
|
+
readonly token: Token;
|
|
216
|
+
constructor(operator: string, expr1: Expression, expr2: Expression, token: Token);
|
|
217
|
+
eval(): Value;
|
|
218
|
+
toString(): string;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
declare class BreakStatement extends Error implements Statement {
|
|
222
|
+
readonly token: Token;
|
|
223
|
+
constructor(token: Token);
|
|
224
|
+
execute(): void;
|
|
225
|
+
toString(): string;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
declare enum Operator {
|
|
229
|
+
PLUS = "+",
|
|
230
|
+
MINUS = "-",
|
|
231
|
+
MULTIPLY = "*",
|
|
232
|
+
DIVIDE = "/",
|
|
233
|
+
EQ = "==",
|
|
234
|
+
NEQ = "!=",
|
|
235
|
+
LT = "<",
|
|
236
|
+
LTE = "<=",
|
|
237
|
+
GT = ">",
|
|
238
|
+
GTE = ">=",
|
|
239
|
+
AND = "&&",
|
|
240
|
+
OR = "||"
|
|
241
|
+
}
|
|
242
|
+
declare function getOperatorName(value: Operator): string;
|
|
243
|
+
declare class ConditionalExpression implements Expression {
|
|
244
|
+
readonly expr1: Expression;
|
|
245
|
+
readonly expr2: Expression;
|
|
246
|
+
readonly operation: Operator;
|
|
247
|
+
readonly token: Token;
|
|
248
|
+
constructor(operator: Operator, expr1: Expression, expr2: Expression, token: Token);
|
|
249
|
+
eval(): Value;
|
|
250
|
+
toString(): string;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
declare class ContinueStatement extends Error implements Statement {
|
|
254
|
+
readonly token: Token;
|
|
255
|
+
constructor(token: Token);
|
|
256
|
+
execute(): void;
|
|
257
|
+
toString(): string;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
declare class DoWhileStatement implements Statement {
|
|
261
|
+
readonly condition: Expression;
|
|
262
|
+
readonly statement: Statement;
|
|
263
|
+
readonly token: Token;
|
|
264
|
+
constructor(expression: Expression, statement: Statement, token: Token);
|
|
265
|
+
execute(): void;
|
|
266
|
+
toString(): string;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
declare class ForStatement implements Statement {
|
|
270
|
+
readonly initialization: Statement;
|
|
271
|
+
readonly termination: Expression;
|
|
272
|
+
readonly increment: Statement;
|
|
273
|
+
readonly block: Statement;
|
|
274
|
+
readonly token: Token;
|
|
275
|
+
constructor(initialization: Statement, termination: Expression, increment: Statement, block: Statement, token: Token);
|
|
276
|
+
execute(): void;
|
|
277
|
+
toString(): string;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
declare class FunctionDefineStatement implements Statement {
|
|
281
|
+
readonly name: string;
|
|
282
|
+
readonly argNames: string[];
|
|
283
|
+
readonly body: Statement;
|
|
284
|
+
readonly token: Token;
|
|
285
|
+
constructor(name: string, argNames: string[], body: Statement, token: Token);
|
|
286
|
+
execute(): void;
|
|
287
|
+
toString(): string;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* Web extension: method-call chain — `receiver.name(args)`.
|
|
292
|
+
*
|
|
293
|
+
* Desugars semantically to `name(receiver, ...args)`: the executor evaluates the
|
|
294
|
+
* receiver and passes its value as the first argument to the registry function
|
|
295
|
+
* named `name`. Chain composes via nested MemberCallExpression — e.g.
|
|
296
|
+
*
|
|
297
|
+
* getByRole('row').filter({hasText: 'X'}).click()
|
|
298
|
+
*
|
|
299
|
+
* parses to MCE { receiver: MCE { receiver: FE 'getByRole', name: 'filter', ... },
|
|
300
|
+
* name: 'click', args: [] }.
|
|
301
|
+
*
|
|
302
|
+
* The in-process `eval()` method is not used by our `AstExecutor` (which walks
|
|
303
|
+
* the AST via registry calls); kept as a stub to satisfy the `Expression`
|
|
304
|
+
* interface inherited from the vendor parser baseline.
|
|
305
|
+
*
|
|
306
|
+
* See vendor/dsl/EXTENSIONS.md for the parser-extension rationale.
|
|
307
|
+
*/
|
|
308
|
+
declare class MemberCallExpression implements Expression {
|
|
309
|
+
readonly receiver: Expression;
|
|
310
|
+
readonly name: string;
|
|
311
|
+
readonly arguments: Expression[];
|
|
312
|
+
readonly token: Token;
|
|
313
|
+
constructor(receiver: Expression, name: string, args: Expression[], token: Token);
|
|
314
|
+
eval(): Value;
|
|
315
|
+
toString(): string;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
type CallableExpression = FunctionalExpression | MemberCallExpression;
|
|
319
|
+
declare class FunctionStatement implements Statement {
|
|
320
|
+
functionalExpression: CallableExpression;
|
|
321
|
+
readonly token: Token;
|
|
322
|
+
constructor(func: CallableExpression, token: Token);
|
|
323
|
+
execute(): void;
|
|
324
|
+
toString(): string;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
declare class IfStatement implements Statement {
|
|
328
|
+
readonly expression: Expression;
|
|
329
|
+
readonly ifStatement: Statement;
|
|
330
|
+
readonly elseStatement: Statement | null;
|
|
331
|
+
readonly token: Token;
|
|
332
|
+
constructor(expression: Expression, ifStatement: Statement, elseStatement: Statement | null, token: Token);
|
|
333
|
+
execute(): void;
|
|
334
|
+
toString(): string;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
declare class VariableExpression implements Expression {
|
|
338
|
+
readonly name: string;
|
|
339
|
+
readonly token: Token;
|
|
340
|
+
constructor(name: string, token: Token);
|
|
341
|
+
eval(): Value;
|
|
342
|
+
getName(): string;
|
|
343
|
+
toString(): string;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
declare enum IncrementType {
|
|
347
|
+
PREFIX_INCREMENT = 0,// ++i
|
|
348
|
+
PREFIX_DECREMENT = 1,// --i
|
|
349
|
+
POSTFIX_INCREMENT = 2,// i++
|
|
350
|
+
POSTFIX_DECREMENT = 3
|
|
351
|
+
}
|
|
352
|
+
declare class IncrementExpression implements Expression {
|
|
353
|
+
readonly variable: VariableExpression;
|
|
354
|
+
readonly type: IncrementType;
|
|
355
|
+
readonly token: Token;
|
|
356
|
+
constructor(variable: VariableExpression, type: IncrementType, token: Token);
|
|
357
|
+
eval(): Value;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
declare class IncrementStatement implements Statement {
|
|
361
|
+
readonly expression: IncrementExpression;
|
|
362
|
+
readonly token: Token;
|
|
363
|
+
constructor(expression: IncrementExpression, token: Token);
|
|
364
|
+
execute(): void;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
declare class MetaBlockStatement implements Statement {
|
|
368
|
+
readonly name: string;
|
|
369
|
+
readonly argNames: string[];
|
|
370
|
+
readonly body: Statement;
|
|
371
|
+
readonly token: Token;
|
|
372
|
+
constructor(name: string, argNames: string[], body: Statement, token: Token);
|
|
373
|
+
execute(): void;
|
|
374
|
+
toString(): string;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
declare class ObjectExpression implements Expression {
|
|
378
|
+
readonly properties: Map<string, Expression>;
|
|
379
|
+
readonly token: Token;
|
|
380
|
+
constructor(properties: Map<string, Expression> | undefined, token: Token);
|
|
381
|
+
eval(): Value;
|
|
382
|
+
toString(): string;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
declare class PrintStatement implements Statement {
|
|
386
|
+
readonly expression: Expression;
|
|
387
|
+
readonly token: Token;
|
|
388
|
+
constructor(expression: Expression, token: Token);
|
|
389
|
+
execute(): void;
|
|
390
|
+
toString(): string;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
/**
|
|
394
|
+
* Web extension #4: bare property access — `receiver.name` (no parens).
|
|
395
|
+
*
|
|
396
|
+
* Read a field from a DSL object or array value. The receiver must evaluate
|
|
397
|
+
* to an object-like value at runtime; primitives / locators / function-call
|
|
398
|
+
* results throw a typed error in `AstExecutor.evalPropertyAccess`.
|
|
399
|
+
*
|
|
400
|
+
* Chain composes naturally:
|
|
401
|
+
* obj.foo.bar → PAE { receiver: PAE { receiver: VE 'obj', name: 'foo' }, name: 'bar' }
|
|
402
|
+
* row.email → PAE { receiver: VE 'row', name: 'email' }
|
|
403
|
+
* row.email[0] → ArrayAccessExpression with PAE-chain on the LHS
|
|
404
|
+
*
|
|
405
|
+
* Sandbox boundary preserved: DSL scope contains only DslValues we put there
|
|
406
|
+
* (ObjectValue / ArrayValue / primitives). There is no `process`, `window`,
|
|
407
|
+
* `require`, etc. to reach via property access. ObjectValue.get(key) does a
|
|
408
|
+
* Map lookup — JS prototype chain is NOT traversed.
|
|
409
|
+
*
|
|
410
|
+
* Method calls (`a.b(args)`) — see MemberCallExpression. The parser routes
|
|
411
|
+
* `DOT IDENT LPAREN` to MemberCallExpression and `DOT IDENT (not LPAREN)` to
|
|
412
|
+
* PropertyAccessExpression.
|
|
413
|
+
*
|
|
414
|
+
* The in-process `eval()` is not used by our `AstExecutor`; kept as a stub
|
|
415
|
+
* to satisfy the `Expression` interface inherited from the vendor parser.
|
|
416
|
+
*
|
|
417
|
+
* See vendor/dsl/EXTENSIONS.md.
|
|
418
|
+
*/
|
|
419
|
+
declare class PropertyAccessExpression implements Expression {
|
|
420
|
+
readonly receiver: Expression;
|
|
421
|
+
readonly name: string;
|
|
422
|
+
readonly token: Token;
|
|
423
|
+
constructor(receiver: Expression, name: string, token: Token);
|
|
424
|
+
eval(): Value;
|
|
425
|
+
toString(): string;
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
/** AST node for an ECMA-262 5.1 RegularExpressionLiteral. The eval'd
|
|
429
|
+
* value is a {@link RegExpValue} — see that class for the rationale
|
|
430
|
+
* on staying JSON-serializable instead of constructing `RegExp`
|
|
431
|
+
* eagerly. */
|
|
432
|
+
declare class RegExpExpression implements Expression {
|
|
433
|
+
readonly token: Token;
|
|
434
|
+
readonly source: string;
|
|
435
|
+
readonly flags: string;
|
|
436
|
+
private readonly value;
|
|
437
|
+
constructor(source: string, flags: string, token: Token);
|
|
438
|
+
eval(): Value;
|
|
439
|
+
toString(): string;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
declare class ReturnStatement extends Error implements Statement {
|
|
443
|
+
private readonly expression;
|
|
444
|
+
private result?;
|
|
445
|
+
readonly token: Token;
|
|
446
|
+
constructor(expression: Expression, token: Token);
|
|
447
|
+
getResult(): Value;
|
|
448
|
+
execute(): void;
|
|
449
|
+
toString(): string;
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
declare class UnaryExpression implements Expression {
|
|
453
|
+
private readonly expr1;
|
|
454
|
+
private readonly operation;
|
|
455
|
+
readonly token: Token;
|
|
456
|
+
constructor(operator: string, expr1: Expression, token: Token);
|
|
457
|
+
eval(): Value;
|
|
458
|
+
toString(): string;
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
declare class ValueExpression implements Expression {
|
|
462
|
+
readonly value: Value;
|
|
463
|
+
readonly token: Token;
|
|
464
|
+
constructor(value: string, token: Token);
|
|
465
|
+
eval(): Value;
|
|
466
|
+
toString(): string;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
interface VarDeclarator {
|
|
470
|
+
name: string;
|
|
471
|
+
init: Expression | null;
|
|
472
|
+
}
|
|
473
|
+
declare class VarStatement implements Statement {
|
|
474
|
+
declarators: VarDeclarator[];
|
|
475
|
+
readonly token: Token;
|
|
476
|
+
constructor(declarators: VarDeclarator[], token: Token);
|
|
477
|
+
execute(): void;
|
|
478
|
+
toString(): string;
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
declare class WhileStatement implements Statement {
|
|
482
|
+
readonly condition: Expression;
|
|
483
|
+
readonly statement: Statement;
|
|
484
|
+
readonly token: Token;
|
|
485
|
+
constructor(expression: Expression, statement: Statement, token: Token);
|
|
486
|
+
execute(): void;
|
|
487
|
+
toString(): string;
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
declare class Lexer {
|
|
491
|
+
private OPERATOR_CHARS;
|
|
492
|
+
private readonly OPERATORS;
|
|
493
|
+
private input;
|
|
494
|
+
private readonly length;
|
|
495
|
+
private tokens;
|
|
496
|
+
private pos;
|
|
497
|
+
private column;
|
|
498
|
+
private line;
|
|
499
|
+
constructor(input: string);
|
|
500
|
+
tokenize(): Token[];
|
|
501
|
+
/** ECMA-262 5.1 InputElementRegExp vs InputElementDiv goal
|
|
502
|
+
* selection — the same `/` opens a RegularExpressionLiteral after
|
|
503
|
+
* some tokens and a DivPunctuator after others. The decision
|
|
504
|
+
* depends solely on the type of the previous lexed token; this
|
|
505
|
+
* mirrors what V8/SpiderMonkey/Acorn do.
|
|
506
|
+
*
|
|
507
|
+
* Returns true when a regex literal would be syntactically valid
|
|
508
|
+
* at the current position. Falls through to tokenizeOperator()
|
|
509
|
+
* otherwise (which handles divide / `//` comment / `/*` comment).
|
|
510
|
+
*
|
|
511
|
+
* Comment dispatch is double-guarded: the `//` and `/*` checks in
|
|
512
|
+
* tokenizeOperator() run for both regex- and divide-context, so a
|
|
513
|
+
* `//` after a value-position token (e.g. `f(// comment`) is
|
|
514
|
+
* correctly treated as a comment. We explicitly short-circuit
|
|
515
|
+
* here to keep the regex tokenizer from grabbing the `//`. */
|
|
516
|
+
private regexContextAllowed;
|
|
517
|
+
/** ECMA-262 5.1 §7.8.5 RegularExpressionLiteral tokenizer.
|
|
518
|
+
*
|
|
519
|
+
* Body grammar:
|
|
520
|
+
* / RegExpFirstChar RegExpChar* / IdentifierPart*
|
|
521
|
+
*
|
|
522
|
+
* Inside the body:
|
|
523
|
+
* - `\` introduces a backslash sequence: read the next char
|
|
524
|
+
* (any SourceCharacter except LineTerminator) verbatim.
|
|
525
|
+
* - `[` opens a character class — inside the class `/` does NOT
|
|
526
|
+
* close the literal; `]` ends the class.
|
|
527
|
+
* - LineTerminator inside body → error (per spec).
|
|
528
|
+
*
|
|
529
|
+
* Flag validation (subset of `gim`, no duplicates, no post-ES5)
|
|
530
|
+
* is delegated to RegExpValue ctor at parse time — keeps the
|
|
531
|
+
* lexer dumb and the error class single-source. */
|
|
532
|
+
private tokenizeRegex;
|
|
533
|
+
private next;
|
|
534
|
+
private peek;
|
|
535
|
+
private peekGroup;
|
|
536
|
+
private addToken;
|
|
537
|
+
private tokenizeNumber;
|
|
538
|
+
private consumeWord;
|
|
539
|
+
private tokenizeMetaWord;
|
|
540
|
+
private tokenizeWord;
|
|
541
|
+
private tokenizeText;
|
|
542
|
+
private tokenizeRawText;
|
|
543
|
+
private tokenizeComment;
|
|
544
|
+
private tokenizeMultilineComment;
|
|
545
|
+
private tokenizeOperator;
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
declare class Parser {
|
|
549
|
+
private EOF;
|
|
550
|
+
private readonly tokens;
|
|
551
|
+
private pos;
|
|
552
|
+
private readonly size;
|
|
553
|
+
constructor(tokens: Token[]);
|
|
554
|
+
parse(): BlockStatement;
|
|
555
|
+
private statementOrBlock;
|
|
556
|
+
private blockMetaBlock;
|
|
557
|
+
private metaBlock;
|
|
558
|
+
private block;
|
|
559
|
+
private statement;
|
|
560
|
+
private static readonly RESERVED_WORDS;
|
|
561
|
+
private varStatement;
|
|
562
|
+
private assignmentStatement;
|
|
563
|
+
private ifElse;
|
|
564
|
+
private doWhileStatement;
|
|
565
|
+
private whileStatement;
|
|
566
|
+
private forStatement;
|
|
567
|
+
private functionDefine;
|
|
568
|
+
private functionExpression;
|
|
569
|
+
private elementExpression;
|
|
570
|
+
private arrayExpression;
|
|
571
|
+
private objectExpression;
|
|
572
|
+
private expression;
|
|
573
|
+
private logicalOr;
|
|
574
|
+
private logicalAnd;
|
|
575
|
+
private equality;
|
|
576
|
+
private conditional;
|
|
577
|
+
private additive;
|
|
578
|
+
private multiplicate;
|
|
579
|
+
private unary;
|
|
580
|
+
private primary;
|
|
581
|
+
private callWithPostfix;
|
|
582
|
+
private consume;
|
|
583
|
+
private match;
|
|
584
|
+
private lookMatch;
|
|
585
|
+
private get;
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
export { ArrayAccessExpression, ArrayAssignmentStatement, ArrayExpression, ArrayValue, AssignmentStatement, BinaryExpression, BlockStatement, BreakStatement, type CallableExpression, ConditionalExpression, ContinueStatement, DoWhileStatement, Expression, ForStatement, type Func, FunctionDefineStatement, FunctionStatement, FunctionalExpression, Functions, IfStatement, IncrementExpression, IncrementStatement, IncrementType, Lexer, MemberCallExpression, MetaBlockStatement, NumberValue, ObjectExpression, ObjectValue, Operator, Parser, PrintStatement, PropertyAccessExpression, RegExpExpression, RegExpFlagError, RegExpValue, ReturnStatement, Statement, StringValue, Token, UnaryExpression, UserDefineFunction, Value, ValueExpression, type VarDeclarator, VarStatement, VariableExpression, Variables, WhileStatement, buildAssertAuthenticatedDsl, buildAssertCountEqualsDsl, buildAssertDialogOpenDsl, buildAssertInputValueDsl, buildAssertListNotEmptyDsl, buildAssertNoVisibleErrorDsl, buildAssertNotVisibleDsl, buildAssertPageReadyDsl, buildAssertRouteIsDsl, buildAssertSectionTitleDsl, buildAssertTableNotEmptyDsl, buildAssertTextContainsDsl, buildAssertTextEqualsDsl, buildAssertToastVisibleDsl, buildAssertUrlContainsDsl, buildAssertUrlEqualsDsl, buildAssertVisibleDsl, buildClickDsl, buildClipboardPasteDsl, buildCloseDialogDsl, buildDragAndDropDsl, buildFillDsl, buildFillFormDsl, buildFlowDsl, buildForceClickDsl, buildKeypressDsl, buildLoginAsDsl, buildNavigateDsl, buildOpenDsl, buildOpenMenuItemDsl, buildOpenTabDsl, buildSaveFormDsl, buildScrollIntoViewDsl, buildScrollToBottomDsl, buildScrollToTopDsl, buildSelectComboboxValueDsl, buildSwitchToFrameDsl, buildSwitchToMainFrameDsl, buildTypeTextDsl, buildWaitForDsl, buildWaitForHiddenDsl, buildWaitForNavigationDsl, buildWaitForTextDsl, buildWaitForURLDsl, getOperatorName };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(_0xcb6ac9,_0xd454b3){var _0x1565d8={_0x2b83cc:0x19e,_0x2758ac:0x19d,_0x40cb50:0x1a2,_0x18b62:0x1a0,_0x49a268:0x19b},_0x5be606=_0x25a1,_0x416e9a=_0xcb6ac9();while(!![]){try{var _0x3dbbdc=parseInt(_0x5be606(_0x1565d8._0x2b83cc))/0x1*(-parseInt(_0x5be606(_0x1565d8._0x2758ac))/0x2)+parseInt(_0x5be606(0x1a1))/0x3*(-parseInt(_0x5be606(0x1a3))/0x4)+parseInt(_0x5be606(_0x1565d8._0x40cb50))/0x5+parseInt(_0x5be606(0x19f))/0x6+-parseInt(_0x5be606(_0x1565d8._0x18b62))/0x7*(parseInt(_0x5be606(0x19c))/0x8)+-parseInt(_0x5be606(0x1a4))/0x9+parseInt(_0x5be606(_0x1565d8._0x49a268))/0xa;if(_0x3dbbdc===_0xd454b3)break;else _0x416e9a['push'](_0x416e9a['shift']());}catch(_0x100d03){_0x416e9a['push'](_0x416e9a['shift']());}}}(_0x2552,0x76d07));import{ArrayAccessExpression,ArrayAssignmentStatement,ArrayExpression,ArrayValue,AssignmentStatement,BinaryExpression,BlockStatement,BreakStatement,ConditionalExpression,ContinueStatement,DoWhileStatement,ForStatement,FunctionDefineStatement,FunctionStatement,FunctionalExpression,Functions,IfStatement,IncrementExpression,IncrementStatement,IncrementType,Lexer,MemberCallExpression,MetaBlockStatement,NumberValue,ObjectExpression,ObjectValue,Operator,Parser,PrintStatement,PropertyAccessExpression,RegExpExpression,RegExpFlagError,RegExpValue,ReturnStatement,StringValue,Token,TokenType,UnaryExpression,UserDefineFunction,ValueExpression,VarStatement,VariableExpression,Variables,WhileStatement,buildAssertAuthenticatedDsl,buildAssertCountEqualsDsl,buildAssertDialogOpenDsl,buildAssertInputValueDsl,buildAssertListNotEmptyDsl,buildAssertNoVisibleErrorDsl,buildAssertNotVisibleDsl,buildAssertPageReadyDsl,buildAssertRouteIsDsl,buildAssertSectionTitleDsl,buildAssertTableNotEmptyDsl,buildAssertTextContainsDsl,buildAssertTextEqualsDsl,buildAssertToastVisibleDsl,buildAssertUrlContainsDsl,buildAssertUrlEqualsDsl,buildAssertVisibleDsl,buildClickDsl,buildClipboardPasteDsl,buildCloseDialogDsl,buildDragAndDropDsl,buildFillDsl,buildFillFormDsl,buildFlowDsl,buildForceClickDsl,buildKeypressDsl,buildLoginAsDsl,buildNavigateDsl,buildOpenDsl,buildOpenMenuItemDsl,buildOpenTabDsl,buildSaveFormDsl,buildScrollIntoViewDsl,buildScrollToBottomDsl,buildScrollToTopDsl,buildSelectComboboxValueDsl,buildSwitchToFrameDsl,buildSwitchToMainFrameDsl,buildTypeTextDsl,buildWaitForDsl,buildWaitForHiddenDsl,buildWaitForNavigationDsl,buildWaitForTextDsl,buildWaitForURLDsl,getOperatorName}from'./chunk-4PFHLTL7.js';function _0x25a1(_0x25cf27,_0x1c6baa){_0x25cf27=_0x25cf27-0x19b;var _0x2552a8=_0x2552();var _0x25a1cf=_0x2552a8[_0x25cf27];if(_0x25a1['woKVvl']===undefined){var _0x5a54a9=function(_0x40b545){var _0x2f1d8b='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x28fa4a='',_0x3ae983='';for(var _0x10a184=0x0,_0x487e8c,_0x473824,_0xf5ca76=0x0;_0x473824=_0x40b545['charAt'](_0xf5ca76++);~_0x473824&&(_0x487e8c=_0x10a184%0x4?_0x487e8c*0x40+_0x473824:_0x473824,_0x10a184++%0x4)?_0x28fa4a+=String['fromCharCode'](0xff&_0x487e8c>>(-0x2*_0x10a184&0x6)):0x0){_0x473824=_0x2f1d8b['indexOf'](_0x473824);}for(var _0xcb627d=0x0,_0x36f7ed=_0x28fa4a['length'];_0xcb627d<_0x36f7ed;_0xcb627d++){_0x3ae983+='%'+('00'+_0x28fa4a['charCodeAt'](_0xcb627d)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x3ae983);};_0x25a1['zTdtlQ']=_0x5a54a9,_0x25a1['qEgeMV']={},_0x25a1['woKVvl']=!![];}var _0xc8c90=_0x2552a8[0x0],_0x210817=_0x25cf27+_0xc8c90,_0x443519=_0x25a1['qEgeMV'][_0x210817];return!_0x443519?(_0x25a1cf=_0x25a1['zTdtlQ'](_0x25a1cf),_0x25a1['qEgeMV'][_0x210817]=_0x25a1cf):_0x25a1cf=_0x443519,_0x25a1cf;}export{ArrayAccessExpression,ArrayAssignmentStatement,ArrayExpression,ArrayValue,AssignmentStatement,BinaryExpression,BlockStatement,BreakStatement,ConditionalExpression,ContinueStatement,DoWhileStatement,ForStatement,FunctionDefineStatement,FunctionStatement,FunctionalExpression,Functions,IfStatement,IncrementExpression,IncrementStatement,IncrementType,Lexer,MemberCallExpression,MetaBlockStatement,NumberValue,ObjectExpression,ObjectValue,Operator,Parser,PrintStatement,PropertyAccessExpression,RegExpExpression,RegExpFlagError,RegExpValue,ReturnStatement,StringValue,Token,TokenType,UnaryExpression,UserDefineFunction,ValueExpression,VarStatement,VariableExpression,Variables,WhileStatement,buildAssertAuthenticatedDsl,buildAssertCountEqualsDsl,buildAssertDialogOpenDsl,buildAssertInputValueDsl,buildAssertListNotEmptyDsl,buildAssertNoVisibleErrorDsl,buildAssertNotVisibleDsl,buildAssertPageReadyDsl,buildAssertRouteIsDsl,buildAssertSectionTitleDsl,buildAssertTableNotEmptyDsl,buildAssertTextContainsDsl,buildAssertTextEqualsDsl,buildAssertToastVisibleDsl,buildAssertUrlContainsDsl,buildAssertUrlEqualsDsl,buildAssertVisibleDsl,buildClickDsl,buildClipboardPasteDsl,buildCloseDialogDsl,buildDragAndDropDsl,buildFillDsl,buildFillFormDsl,buildFlowDsl,buildForceClickDsl,buildKeypressDsl,buildLoginAsDsl,buildNavigateDsl,buildOpenDsl,buildOpenMenuItemDsl,buildOpenTabDsl,buildSaveFormDsl,buildScrollIntoViewDsl,buildScrollToBottomDsl,buildScrollToTopDsl,buildSelectComboboxValueDsl,buildSwitchToFrameDsl,buildSwitchToMainFrameDsl,buildTypeTextDsl,buildWaitForDsl,buildWaitForHiddenDsl,buildWaitForNavigationDsl,buildWaitForTextDsl,buildWaitForURLDsl,getOperatorName};function _0x2552(){var _0x3142b5=['mJmWotCYDvfvCvn1','mJDND0rQse4','mJuZmtK1nxLMteHdva','mJGXnZG0DxDlufDc','nJqYnJiYnuvNC2vssG','mJqWnJiYntbqrhHMyM0','mtyWru1hBxvg','nte2whruA3bK','mZq4mMLLEuvNAW','mJG4mJe3mKzotw51Dq'];_0x2552=function(){return _0x3142b5;};return _0x2552();}
|