@bloom-perf/yaml-pptr 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,4 @@
1
+ import * as p from 'puppeteer';
2
+ import { SupportedBrowser } from './core/model';
3
+ import { YpLogger } from './core/logger';
4
+ export declare const readYamlAndInterpret: (yamlContent: string, browsers?: { [key in SupportedBrowser]?: p.Browser; }, logger?: YpLogger) => Promise<void>;
@@ -0,0 +1,4 @@
1
+ import * as p from 'puppeteer';
2
+ import { YpLogger } from '../core/logger';
3
+ import { Scenario } from '../core/model';
4
+ export declare const evalScenario: (browser: p.Browser, scenario: Scenario, logger?: YpLogger) => Promise<void[]>;
@@ -0,0 +1,2 @@
1
+ import { RootYaml } from './validator';
2
+ export declare const parseYaml: (yamlContent: string) => RootYaml;
@@ -0,0 +1,19 @@
1
+ import { YpLogger } from '../core/logger';
2
+ import { Scenario } from '../core/model';
3
+ import { RootYaml } from './validator';
4
+ type EnvVarResolve = (arg: string) => string;
5
+ export declare class Resolver {
6
+ private envVarResolve;
7
+ private logger;
8
+ constructor(envVarResolve: EnvVarResolve, logger?: YpLogger);
9
+ resolve(yaml: RootYaml): {
10
+ scenarios: Scenario[];
11
+ };
12
+ private resolveScenario;
13
+ private resolveStep;
14
+ private resolveAction;
15
+ private createNavigateAction;
16
+ private resolveUrlOrEnv;
17
+ private resolveStringOrEnv;
18
+ }
19
+ export {};
@@ -0,0 +1,581 @@
1
+ import * as z from 'zod';
2
+ declare const actionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3
+ type: z.ZodLiteral<"WAIT">;
4
+ milliseconds: z.ZodNumber;
5
+ }, z.core.$strip> | z.ZodObject<{
6
+ type: z.ZodLiteral<"GOTO">;
7
+ url: z.ZodString;
8
+ options: z.ZodOptional<z.ZodObject<{
9
+ timeout: z.ZodOptional<z.ZodNumber>;
10
+ waitUntil: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
11
+ load: "load";
12
+ domcontentloaded: "domcontentloaded";
13
+ networkidle0: "networkidle0";
14
+ networkidle2: "networkidle2";
15
+ }>, z.ZodArray<z.ZodEnum<{
16
+ load: "load";
17
+ domcontentloaded: "domcontentloaded";
18
+ networkidle0: "networkidle0";
19
+ networkidle2: "networkidle2";
20
+ }>>]>>;
21
+ referer: z.ZodOptional<z.ZodString>;
22
+ }, z.core.$strip>>;
23
+ }, z.core.$strip> | z.ZodObject<{
24
+ type: z.ZodLiteral<"CLICK">;
25
+ selector: z.ZodString;
26
+ options: z.ZodOptional<z.ZodObject<{
27
+ button: z.ZodOptional<z.ZodEnum<{
28
+ left: "left";
29
+ right: "right";
30
+ middle: "middle";
31
+ }>>;
32
+ clickCount: z.ZodOptional<z.ZodNumber>;
33
+ delay: z.ZodOptional<z.ZodNumber>;
34
+ }, z.core.$strip>>;
35
+ }, z.core.$strip> | z.ZodObject<{
36
+ type: z.ZodLiteral<"TYPE">;
37
+ selector: z.ZodString;
38
+ text: z.ZodString;
39
+ options: z.ZodOptional<z.ZodObject<{
40
+ delay: z.ZodOptional<z.ZodNumber>;
41
+ }, z.core.$strip>>;
42
+ }, z.core.$strip> | z.ZodObject<{
43
+ type: z.ZodLiteral<"WAIT_FOR_SELECTOR">;
44
+ selector: z.ZodString;
45
+ options: z.ZodOptional<z.ZodObject<{
46
+ visible: z.ZodOptional<z.ZodBoolean>;
47
+ hidden: z.ZodOptional<z.ZodBoolean>;
48
+ timeout: z.ZodOptional<z.ZodNumber>;
49
+ }, z.core.$strip>>;
50
+ }, z.core.$strip> | z.ZodObject<{
51
+ type: z.ZodLiteral<"WAIT_FOR_TIMEOUT">;
52
+ timeout: z.ZodNumber;
53
+ }, z.core.$strip> | z.ZodObject<{
54
+ type: z.ZodLiteral<"PAUSE">;
55
+ }, z.core.$strip> | z.ZodObject<{
56
+ type: z.ZodLiteral<"SCREENSHOT">;
57
+ path: z.ZodString;
58
+ options: z.ZodOptional<z.ZodObject<{
59
+ type: z.ZodOptional<z.ZodEnum<{
60
+ png: "png";
61
+ jpeg: "jpeg";
62
+ }>>;
63
+ quality: z.ZodOptional<z.ZodNumber>;
64
+ fullPage: z.ZodOptional<z.ZodBoolean>;
65
+ clip: z.ZodOptional<z.ZodObject<{
66
+ x: z.ZodNumber;
67
+ y: z.ZodNumber;
68
+ width: z.ZodNumber;
69
+ height: z.ZodNumber;
70
+ }, z.core.$strip>>;
71
+ omitBackground: z.ZodOptional<z.ZodBoolean>;
72
+ encoding: z.ZodOptional<z.ZodEnum<{
73
+ base64: "base64";
74
+ binary: "binary";
75
+ }>>;
76
+ }, z.core.$strip>>;
77
+ }, z.core.$strip> | z.ZodObject<{
78
+ type: z.ZodLiteral<"EVALUATE">;
79
+ script: z.ZodUnion<readonly [z.ZodString, z.ZodFunction<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>]>;
80
+ }, z.core.$strip> | z.ZodObject<{
81
+ type: z.ZodLiteral<"SET_VIEWPORT">;
82
+ width: z.ZodNumber;
83
+ height: z.ZodNumber;
84
+ }, z.core.$strip> | z.ZodObject<{
85
+ type: z.ZodLiteral<"CLOSE">;
86
+ }, z.core.$strip>, ...(z.ZodObject<{
87
+ type: z.ZodLiteral<"WAIT">;
88
+ milliseconds: z.ZodNumber;
89
+ }, z.core.$strip> | z.ZodObject<{
90
+ type: z.ZodLiteral<"GOTO">;
91
+ url: z.ZodString;
92
+ options: z.ZodOptional<z.ZodObject<{
93
+ timeout: z.ZodOptional<z.ZodNumber>;
94
+ waitUntil: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
95
+ load: "load";
96
+ domcontentloaded: "domcontentloaded";
97
+ networkidle0: "networkidle0";
98
+ networkidle2: "networkidle2";
99
+ }>, z.ZodArray<z.ZodEnum<{
100
+ load: "load";
101
+ domcontentloaded: "domcontentloaded";
102
+ networkidle0: "networkidle0";
103
+ networkidle2: "networkidle2";
104
+ }>>]>>;
105
+ referer: z.ZodOptional<z.ZodString>;
106
+ }, z.core.$strip>>;
107
+ }, z.core.$strip> | z.ZodObject<{
108
+ type: z.ZodLiteral<"CLICK">;
109
+ selector: z.ZodString;
110
+ options: z.ZodOptional<z.ZodObject<{
111
+ button: z.ZodOptional<z.ZodEnum<{
112
+ left: "left";
113
+ right: "right";
114
+ middle: "middle";
115
+ }>>;
116
+ clickCount: z.ZodOptional<z.ZodNumber>;
117
+ delay: z.ZodOptional<z.ZodNumber>;
118
+ }, z.core.$strip>>;
119
+ }, z.core.$strip> | z.ZodObject<{
120
+ type: z.ZodLiteral<"TYPE">;
121
+ selector: z.ZodString;
122
+ text: z.ZodString;
123
+ options: z.ZodOptional<z.ZodObject<{
124
+ delay: z.ZodOptional<z.ZodNumber>;
125
+ }, z.core.$strip>>;
126
+ }, z.core.$strip> | z.ZodObject<{
127
+ type: z.ZodLiteral<"WAIT_FOR_SELECTOR">;
128
+ selector: z.ZodString;
129
+ options: z.ZodOptional<z.ZodObject<{
130
+ visible: z.ZodOptional<z.ZodBoolean>;
131
+ hidden: z.ZodOptional<z.ZodBoolean>;
132
+ timeout: z.ZodOptional<z.ZodNumber>;
133
+ }, z.core.$strip>>;
134
+ }, z.core.$strip> | z.ZodObject<{
135
+ type: z.ZodLiteral<"WAIT_FOR_TIMEOUT">;
136
+ timeout: z.ZodNumber;
137
+ }, z.core.$strip> | z.ZodObject<{
138
+ type: z.ZodLiteral<"PAUSE">;
139
+ }, z.core.$strip> | z.ZodObject<{
140
+ type: z.ZodLiteral<"SCREENSHOT">;
141
+ path: z.ZodString;
142
+ options: z.ZodOptional<z.ZodObject<{
143
+ type: z.ZodOptional<z.ZodEnum<{
144
+ png: "png";
145
+ jpeg: "jpeg";
146
+ }>>;
147
+ quality: z.ZodOptional<z.ZodNumber>;
148
+ fullPage: z.ZodOptional<z.ZodBoolean>;
149
+ clip: z.ZodOptional<z.ZodObject<{
150
+ x: z.ZodNumber;
151
+ y: z.ZodNumber;
152
+ width: z.ZodNumber;
153
+ height: z.ZodNumber;
154
+ }, z.core.$strip>>;
155
+ omitBackground: z.ZodOptional<z.ZodBoolean>;
156
+ encoding: z.ZodOptional<z.ZodEnum<{
157
+ base64: "base64";
158
+ binary: "binary";
159
+ }>>;
160
+ }, z.core.$strip>>;
161
+ }, z.core.$strip> | z.ZodObject<{
162
+ type: z.ZodLiteral<"EVALUATE">;
163
+ script: z.ZodUnion<readonly [z.ZodString, z.ZodFunction<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>]>;
164
+ }, z.core.$strip> | z.ZodObject<{
165
+ type: z.ZodLiteral<"SET_VIEWPORT">;
166
+ width: z.ZodNumber;
167
+ height: z.ZodNumber;
168
+ }, z.core.$strip> | z.ZodObject<{
169
+ type: z.ZodLiteral<"CLOSE">;
170
+ }, z.core.$strip>)[]], "type">;
171
+ export type ActionYaml = z.infer<typeof actionSchema>;
172
+ declare const stepSchema: z.ZodUnion<readonly [z.ZodObject<{
173
+ navigate: z.ZodString;
174
+ }, z.core.$strip>, z.ZodLiteral<"waitForever">, z.ZodObject<{
175
+ wait: z.ZodNumber;
176
+ }, z.core.$strip>, z.ZodObject<{
177
+ click: z.ZodString;
178
+ }, z.core.$strip>, z.ZodObject<{
179
+ input: z.ZodObject<{
180
+ selector: z.ZodString;
181
+ text: z.ZodString;
182
+ }, z.core.$strip>;
183
+ }, z.core.$strip>]>;
184
+ export type StepYaml = z.infer<typeof stepSchema>;
185
+ declare const scenarioSchema: z.ZodObject<{
186
+ name: z.ZodOptional<z.ZodString>;
187
+ browser: z.ZodOptional<z.ZodEnum<{
188
+ chrome: "chrome";
189
+ firefox: "firefox";
190
+ }>>;
191
+ run: z.ZodOptional<z.ZodEnum<{
192
+ PARALLEL: "PARALLEL";
193
+ SEQUENTIAL: "SEQUENTIAL";
194
+ }>>;
195
+ initialDelaySeconds: z.ZodOptional<z.ZodNumber>;
196
+ workers: z.ZodOptional<z.ZodNumber>;
197
+ iterations: z.ZodOptional<z.ZodNumber>;
198
+ location: z.ZodOptional<z.ZodString>;
199
+ steps: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
200
+ navigate: z.ZodString;
201
+ }, z.core.$strip>, z.ZodLiteral<"waitForever">, z.ZodObject<{
202
+ wait: z.ZodNumber;
203
+ }, z.core.$strip>, z.ZodObject<{
204
+ click: z.ZodString;
205
+ }, z.core.$strip>, z.ZodObject<{
206
+ input: z.ZodObject<{
207
+ selector: z.ZodString;
208
+ text: z.ZodString;
209
+ }, z.core.$strip>;
210
+ }, z.core.$strip>]>>>;
211
+ actions: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
212
+ type: z.ZodLiteral<"WAIT">;
213
+ milliseconds: z.ZodNumber;
214
+ }, z.core.$strip> | z.ZodObject<{
215
+ type: z.ZodLiteral<"GOTO">;
216
+ url: z.ZodString;
217
+ options: z.ZodOptional<z.ZodObject<{
218
+ timeout: z.ZodOptional<z.ZodNumber>;
219
+ waitUntil: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
220
+ load: "load";
221
+ domcontentloaded: "domcontentloaded";
222
+ networkidle0: "networkidle0";
223
+ networkidle2: "networkidle2";
224
+ }>, z.ZodArray<z.ZodEnum<{
225
+ load: "load";
226
+ domcontentloaded: "domcontentloaded";
227
+ networkidle0: "networkidle0";
228
+ networkidle2: "networkidle2";
229
+ }>>]>>;
230
+ referer: z.ZodOptional<z.ZodString>;
231
+ }, z.core.$strip>>;
232
+ }, z.core.$strip> | z.ZodObject<{
233
+ type: z.ZodLiteral<"CLICK">;
234
+ selector: z.ZodString;
235
+ options: z.ZodOptional<z.ZodObject<{
236
+ button: z.ZodOptional<z.ZodEnum<{
237
+ left: "left";
238
+ right: "right";
239
+ middle: "middle";
240
+ }>>;
241
+ clickCount: z.ZodOptional<z.ZodNumber>;
242
+ delay: z.ZodOptional<z.ZodNumber>;
243
+ }, z.core.$strip>>;
244
+ }, z.core.$strip> | z.ZodObject<{
245
+ type: z.ZodLiteral<"TYPE">;
246
+ selector: z.ZodString;
247
+ text: z.ZodString;
248
+ options: z.ZodOptional<z.ZodObject<{
249
+ delay: z.ZodOptional<z.ZodNumber>;
250
+ }, z.core.$strip>>;
251
+ }, z.core.$strip> | z.ZodObject<{
252
+ type: z.ZodLiteral<"WAIT_FOR_SELECTOR">;
253
+ selector: z.ZodString;
254
+ options: z.ZodOptional<z.ZodObject<{
255
+ visible: z.ZodOptional<z.ZodBoolean>;
256
+ hidden: z.ZodOptional<z.ZodBoolean>;
257
+ timeout: z.ZodOptional<z.ZodNumber>;
258
+ }, z.core.$strip>>;
259
+ }, z.core.$strip> | z.ZodObject<{
260
+ type: z.ZodLiteral<"WAIT_FOR_TIMEOUT">;
261
+ timeout: z.ZodNumber;
262
+ }, z.core.$strip> | z.ZodObject<{
263
+ type: z.ZodLiteral<"PAUSE">;
264
+ }, z.core.$strip> | z.ZodObject<{
265
+ type: z.ZodLiteral<"SCREENSHOT">;
266
+ path: z.ZodString;
267
+ options: z.ZodOptional<z.ZodObject<{
268
+ type: z.ZodOptional<z.ZodEnum<{
269
+ png: "png";
270
+ jpeg: "jpeg";
271
+ }>>;
272
+ quality: z.ZodOptional<z.ZodNumber>;
273
+ fullPage: z.ZodOptional<z.ZodBoolean>;
274
+ clip: z.ZodOptional<z.ZodObject<{
275
+ x: z.ZodNumber;
276
+ y: z.ZodNumber;
277
+ width: z.ZodNumber;
278
+ height: z.ZodNumber;
279
+ }, z.core.$strip>>;
280
+ omitBackground: z.ZodOptional<z.ZodBoolean>;
281
+ encoding: z.ZodOptional<z.ZodEnum<{
282
+ base64: "base64";
283
+ binary: "binary";
284
+ }>>;
285
+ }, z.core.$strip>>;
286
+ }, z.core.$strip> | z.ZodObject<{
287
+ type: z.ZodLiteral<"EVALUATE">;
288
+ script: z.ZodUnion<readonly [z.ZodString, z.ZodFunction<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>]>;
289
+ }, z.core.$strip> | z.ZodObject<{
290
+ type: z.ZodLiteral<"SET_VIEWPORT">;
291
+ width: z.ZodNumber;
292
+ height: z.ZodNumber;
293
+ }, z.core.$strip> | z.ZodObject<{
294
+ type: z.ZodLiteral<"CLOSE">;
295
+ }, z.core.$strip>, ...(z.ZodObject<{
296
+ type: z.ZodLiteral<"WAIT">;
297
+ milliseconds: z.ZodNumber;
298
+ }, z.core.$strip> | z.ZodObject<{
299
+ type: z.ZodLiteral<"GOTO">;
300
+ url: z.ZodString;
301
+ options: z.ZodOptional<z.ZodObject<{
302
+ timeout: z.ZodOptional<z.ZodNumber>;
303
+ waitUntil: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
304
+ load: "load";
305
+ domcontentloaded: "domcontentloaded";
306
+ networkidle0: "networkidle0";
307
+ networkidle2: "networkidle2";
308
+ }>, z.ZodArray<z.ZodEnum<{
309
+ load: "load";
310
+ domcontentloaded: "domcontentloaded";
311
+ networkidle0: "networkidle0";
312
+ networkidle2: "networkidle2";
313
+ }>>]>>;
314
+ referer: z.ZodOptional<z.ZodString>;
315
+ }, z.core.$strip>>;
316
+ }, z.core.$strip> | z.ZodObject<{
317
+ type: z.ZodLiteral<"CLICK">;
318
+ selector: z.ZodString;
319
+ options: z.ZodOptional<z.ZodObject<{
320
+ button: z.ZodOptional<z.ZodEnum<{
321
+ left: "left";
322
+ right: "right";
323
+ middle: "middle";
324
+ }>>;
325
+ clickCount: z.ZodOptional<z.ZodNumber>;
326
+ delay: z.ZodOptional<z.ZodNumber>;
327
+ }, z.core.$strip>>;
328
+ }, z.core.$strip> | z.ZodObject<{
329
+ type: z.ZodLiteral<"TYPE">;
330
+ selector: z.ZodString;
331
+ text: z.ZodString;
332
+ options: z.ZodOptional<z.ZodObject<{
333
+ delay: z.ZodOptional<z.ZodNumber>;
334
+ }, z.core.$strip>>;
335
+ }, z.core.$strip> | z.ZodObject<{
336
+ type: z.ZodLiteral<"WAIT_FOR_SELECTOR">;
337
+ selector: z.ZodString;
338
+ options: z.ZodOptional<z.ZodObject<{
339
+ visible: z.ZodOptional<z.ZodBoolean>;
340
+ hidden: z.ZodOptional<z.ZodBoolean>;
341
+ timeout: z.ZodOptional<z.ZodNumber>;
342
+ }, z.core.$strip>>;
343
+ }, z.core.$strip> | z.ZodObject<{
344
+ type: z.ZodLiteral<"WAIT_FOR_TIMEOUT">;
345
+ timeout: z.ZodNumber;
346
+ }, z.core.$strip> | z.ZodObject<{
347
+ type: z.ZodLiteral<"PAUSE">;
348
+ }, z.core.$strip> | z.ZodObject<{
349
+ type: z.ZodLiteral<"SCREENSHOT">;
350
+ path: z.ZodString;
351
+ options: z.ZodOptional<z.ZodObject<{
352
+ type: z.ZodOptional<z.ZodEnum<{
353
+ png: "png";
354
+ jpeg: "jpeg";
355
+ }>>;
356
+ quality: z.ZodOptional<z.ZodNumber>;
357
+ fullPage: z.ZodOptional<z.ZodBoolean>;
358
+ clip: z.ZodOptional<z.ZodObject<{
359
+ x: z.ZodNumber;
360
+ y: z.ZodNumber;
361
+ width: z.ZodNumber;
362
+ height: z.ZodNumber;
363
+ }, z.core.$strip>>;
364
+ omitBackground: z.ZodOptional<z.ZodBoolean>;
365
+ encoding: z.ZodOptional<z.ZodEnum<{
366
+ base64: "base64";
367
+ binary: "binary";
368
+ }>>;
369
+ }, z.core.$strip>>;
370
+ }, z.core.$strip> | z.ZodObject<{
371
+ type: z.ZodLiteral<"EVALUATE">;
372
+ script: z.ZodUnion<readonly [z.ZodString, z.ZodFunction<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>]>;
373
+ }, z.core.$strip> | z.ZodObject<{
374
+ type: z.ZodLiteral<"SET_VIEWPORT">;
375
+ width: z.ZodNumber;
376
+ height: z.ZodNumber;
377
+ }, z.core.$strip> | z.ZodObject<{
378
+ type: z.ZodLiteral<"CLOSE">;
379
+ }, z.core.$strip>)[]], "type">>>;
380
+ }, z.core.$strip>;
381
+ export type ScenarioYaml = z.infer<typeof scenarioSchema>;
382
+ export declare const rootZod: z.ZodObject<{
383
+ scenarios: z.ZodArray<z.ZodObject<{
384
+ name: z.ZodOptional<z.ZodString>;
385
+ browser: z.ZodOptional<z.ZodEnum<{
386
+ chrome: "chrome";
387
+ firefox: "firefox";
388
+ }>>;
389
+ run: z.ZodOptional<z.ZodEnum<{
390
+ PARALLEL: "PARALLEL";
391
+ SEQUENTIAL: "SEQUENTIAL";
392
+ }>>;
393
+ initialDelaySeconds: z.ZodOptional<z.ZodNumber>;
394
+ workers: z.ZodOptional<z.ZodNumber>;
395
+ iterations: z.ZodOptional<z.ZodNumber>;
396
+ location: z.ZodOptional<z.ZodString>;
397
+ steps: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
398
+ navigate: z.ZodString;
399
+ }, z.core.$strip>, z.ZodLiteral<"waitForever">, z.ZodObject<{
400
+ wait: z.ZodNumber;
401
+ }, z.core.$strip>, z.ZodObject<{
402
+ click: z.ZodString;
403
+ }, z.core.$strip>, z.ZodObject<{
404
+ input: z.ZodObject<{
405
+ selector: z.ZodString;
406
+ text: z.ZodString;
407
+ }, z.core.$strip>;
408
+ }, z.core.$strip>]>>>;
409
+ actions: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
410
+ type: z.ZodLiteral<"WAIT">;
411
+ milliseconds: z.ZodNumber;
412
+ }, z.core.$strip> | z.ZodObject<{
413
+ type: z.ZodLiteral<"GOTO">;
414
+ url: z.ZodString;
415
+ options: z.ZodOptional<z.ZodObject<{
416
+ timeout: z.ZodOptional<z.ZodNumber>;
417
+ waitUntil: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
418
+ load: "load";
419
+ domcontentloaded: "domcontentloaded";
420
+ networkidle0: "networkidle0";
421
+ networkidle2: "networkidle2";
422
+ }>, z.ZodArray<z.ZodEnum<{
423
+ load: "load";
424
+ domcontentloaded: "domcontentloaded";
425
+ networkidle0: "networkidle0";
426
+ networkidle2: "networkidle2";
427
+ }>>]>>;
428
+ referer: z.ZodOptional<z.ZodString>;
429
+ }, z.core.$strip>>;
430
+ }, z.core.$strip> | z.ZodObject<{
431
+ type: z.ZodLiteral<"CLICK">;
432
+ selector: z.ZodString;
433
+ options: z.ZodOptional<z.ZodObject<{
434
+ button: z.ZodOptional<z.ZodEnum<{
435
+ left: "left";
436
+ right: "right";
437
+ middle: "middle";
438
+ }>>;
439
+ clickCount: z.ZodOptional<z.ZodNumber>;
440
+ delay: z.ZodOptional<z.ZodNumber>;
441
+ }, z.core.$strip>>;
442
+ }, z.core.$strip> | z.ZodObject<{
443
+ type: z.ZodLiteral<"TYPE">;
444
+ selector: z.ZodString;
445
+ text: z.ZodString;
446
+ options: z.ZodOptional<z.ZodObject<{
447
+ delay: z.ZodOptional<z.ZodNumber>;
448
+ }, z.core.$strip>>;
449
+ }, z.core.$strip> | z.ZodObject<{
450
+ type: z.ZodLiteral<"WAIT_FOR_SELECTOR">;
451
+ selector: z.ZodString;
452
+ options: z.ZodOptional<z.ZodObject<{
453
+ visible: z.ZodOptional<z.ZodBoolean>;
454
+ hidden: z.ZodOptional<z.ZodBoolean>;
455
+ timeout: z.ZodOptional<z.ZodNumber>;
456
+ }, z.core.$strip>>;
457
+ }, z.core.$strip> | z.ZodObject<{
458
+ type: z.ZodLiteral<"WAIT_FOR_TIMEOUT">;
459
+ timeout: z.ZodNumber;
460
+ }, z.core.$strip> | z.ZodObject<{
461
+ type: z.ZodLiteral<"PAUSE">;
462
+ }, z.core.$strip> | z.ZodObject<{
463
+ type: z.ZodLiteral<"SCREENSHOT">;
464
+ path: z.ZodString;
465
+ options: z.ZodOptional<z.ZodObject<{
466
+ type: z.ZodOptional<z.ZodEnum<{
467
+ png: "png";
468
+ jpeg: "jpeg";
469
+ }>>;
470
+ quality: z.ZodOptional<z.ZodNumber>;
471
+ fullPage: z.ZodOptional<z.ZodBoolean>;
472
+ clip: z.ZodOptional<z.ZodObject<{
473
+ x: z.ZodNumber;
474
+ y: z.ZodNumber;
475
+ width: z.ZodNumber;
476
+ height: z.ZodNumber;
477
+ }, z.core.$strip>>;
478
+ omitBackground: z.ZodOptional<z.ZodBoolean>;
479
+ encoding: z.ZodOptional<z.ZodEnum<{
480
+ base64: "base64";
481
+ binary: "binary";
482
+ }>>;
483
+ }, z.core.$strip>>;
484
+ }, z.core.$strip> | z.ZodObject<{
485
+ type: z.ZodLiteral<"EVALUATE">;
486
+ script: z.ZodUnion<readonly [z.ZodString, z.ZodFunction<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>]>;
487
+ }, z.core.$strip> | z.ZodObject<{
488
+ type: z.ZodLiteral<"SET_VIEWPORT">;
489
+ width: z.ZodNumber;
490
+ height: z.ZodNumber;
491
+ }, z.core.$strip> | z.ZodObject<{
492
+ type: z.ZodLiteral<"CLOSE">;
493
+ }, z.core.$strip>, ...(z.ZodObject<{
494
+ type: z.ZodLiteral<"WAIT">;
495
+ milliseconds: z.ZodNumber;
496
+ }, z.core.$strip> | z.ZodObject<{
497
+ type: z.ZodLiteral<"GOTO">;
498
+ url: z.ZodString;
499
+ options: z.ZodOptional<z.ZodObject<{
500
+ timeout: z.ZodOptional<z.ZodNumber>;
501
+ waitUntil: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
502
+ load: "load";
503
+ domcontentloaded: "domcontentloaded";
504
+ networkidle0: "networkidle0";
505
+ networkidle2: "networkidle2";
506
+ }>, z.ZodArray<z.ZodEnum<{
507
+ load: "load";
508
+ domcontentloaded: "domcontentloaded";
509
+ networkidle0: "networkidle0";
510
+ networkidle2: "networkidle2";
511
+ }>>]>>;
512
+ referer: z.ZodOptional<z.ZodString>;
513
+ }, z.core.$strip>>;
514
+ }, z.core.$strip> | z.ZodObject<{
515
+ type: z.ZodLiteral<"CLICK">;
516
+ selector: z.ZodString;
517
+ options: z.ZodOptional<z.ZodObject<{
518
+ button: z.ZodOptional<z.ZodEnum<{
519
+ left: "left";
520
+ right: "right";
521
+ middle: "middle";
522
+ }>>;
523
+ clickCount: z.ZodOptional<z.ZodNumber>;
524
+ delay: z.ZodOptional<z.ZodNumber>;
525
+ }, z.core.$strip>>;
526
+ }, z.core.$strip> | z.ZodObject<{
527
+ type: z.ZodLiteral<"TYPE">;
528
+ selector: z.ZodString;
529
+ text: z.ZodString;
530
+ options: z.ZodOptional<z.ZodObject<{
531
+ delay: z.ZodOptional<z.ZodNumber>;
532
+ }, z.core.$strip>>;
533
+ }, z.core.$strip> | z.ZodObject<{
534
+ type: z.ZodLiteral<"WAIT_FOR_SELECTOR">;
535
+ selector: z.ZodString;
536
+ options: z.ZodOptional<z.ZodObject<{
537
+ visible: z.ZodOptional<z.ZodBoolean>;
538
+ hidden: z.ZodOptional<z.ZodBoolean>;
539
+ timeout: z.ZodOptional<z.ZodNumber>;
540
+ }, z.core.$strip>>;
541
+ }, z.core.$strip> | z.ZodObject<{
542
+ type: z.ZodLiteral<"WAIT_FOR_TIMEOUT">;
543
+ timeout: z.ZodNumber;
544
+ }, z.core.$strip> | z.ZodObject<{
545
+ type: z.ZodLiteral<"PAUSE">;
546
+ }, z.core.$strip> | z.ZodObject<{
547
+ type: z.ZodLiteral<"SCREENSHOT">;
548
+ path: z.ZodString;
549
+ options: z.ZodOptional<z.ZodObject<{
550
+ type: z.ZodOptional<z.ZodEnum<{
551
+ png: "png";
552
+ jpeg: "jpeg";
553
+ }>>;
554
+ quality: z.ZodOptional<z.ZodNumber>;
555
+ fullPage: z.ZodOptional<z.ZodBoolean>;
556
+ clip: z.ZodOptional<z.ZodObject<{
557
+ x: z.ZodNumber;
558
+ y: z.ZodNumber;
559
+ width: z.ZodNumber;
560
+ height: z.ZodNumber;
561
+ }, z.core.$strip>>;
562
+ omitBackground: z.ZodOptional<z.ZodBoolean>;
563
+ encoding: z.ZodOptional<z.ZodEnum<{
564
+ base64: "base64";
565
+ binary: "binary";
566
+ }>>;
567
+ }, z.core.$strip>>;
568
+ }, z.core.$strip> | z.ZodObject<{
569
+ type: z.ZodLiteral<"EVALUATE">;
570
+ script: z.ZodUnion<readonly [z.ZodString, z.ZodFunction<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>]>;
571
+ }, z.core.$strip> | z.ZodObject<{
572
+ type: z.ZodLiteral<"SET_VIEWPORT">;
573
+ width: z.ZodNumber;
574
+ height: z.ZodNumber;
575
+ }, z.core.$strip> | z.ZodObject<{
576
+ type: z.ZodLiteral<"CLOSE">;
577
+ }, z.core.$strip>)[]], "type">>>;
578
+ }, z.core.$strip>>;
579
+ }, z.core.$strip>;
580
+ export type RootYaml = z.infer<typeof rootZod>;
581
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
package/package.json ADDED
@@ -0,0 +1,58 @@
1
+ {
2
+ "name": "@bloom-perf/yaml-pptr",
3
+ "version": "1.0.1",
4
+ "description": "A library to generate puppeteer browser controls through a YAML api.",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "files": [
9
+ "dist"
10
+ ],
11
+ "devDependencies": {
12
+ "@testdeck/mocha": "0.3.3",
13
+ "@types/chai": "5.2.3",
14
+ "@types/js-yaml": "4.0.9",
15
+ "@types/mocha": "10.0.10",
16
+ "c8": "10.1.3",
17
+ "chai": "6.2.2",
18
+ "cross-env": "10.1.0",
19
+ "esbuild": "0.27.2",
20
+ "esbuild-node-externals": "1.20.1",
21
+ "mocha": "11.7.5",
22
+ "prettier": "3.8.1",
23
+ "puppeteer": "24.36.1",
24
+ "ts-mockito": "2.6.1",
25
+ "ts-node": "10.9.2",
26
+ "tsx": "4.21.0",
27
+ "typescript": "5.9.3"
28
+ },
29
+ "dependencies": {
30
+ "js-yaml": "^4.1.0",
31
+ "zod": "^4.0.0"
32
+ },
33
+ "scripts": {
34
+ "build": "rm -rf dist && node esbuild.js && tsc",
35
+ "test": "mocha --loader ts-node/esm -r ts-node/register test/**/*.spec.ts",
36
+ "test:coverage": "c8 npm run test",
37
+ "example:login": "tsx examples/login-demo/run.ts",
38
+ "example:load": "tsx examples/load-test/run.ts"
39
+ },
40
+ "publishConfig": {
41
+ "access": "public"
42
+ },
43
+ "repository": {
44
+ "type": "git",
45
+ "url": "git+https://github.com/Bloom-Perf/yaml-pptr.git"
46
+ },
47
+ "keywords": [
48
+ "puppeteer",
49
+ "yaml",
50
+ "testing"
51
+ ],
52
+ "author": "Bloom-perf",
53
+ "license": "Apache-2.0",
54
+ "bugs": {
55
+ "url": "https://github.com/Bloom-Perf/yaml-pptr/issues"
56
+ },
57
+ "homepage": "https://github.com/Bloom-Perf/yaml-pptr#readme"
58
+ }