automation_model 1.0.482-dev → 1.0.482

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.
Files changed (77) hide show
  1. package/README.md +133 -0
  2. package/lib/analyze_helper.js.map +1 -1
  3. package/lib/api.d.ts +2 -2
  4. package/lib/api.js +141 -120
  5. package/lib/api.js.map +1 -1
  6. package/lib/auto_page.d.ts +7 -2
  7. package/lib/auto_page.js +283 -29
  8. package/lib/auto_page.js.map +1 -1
  9. package/lib/browser_manager.d.ts +6 -3
  10. package/lib/browser_manager.js +188 -46
  11. package/lib/browser_manager.js.map +1 -1
  12. package/lib/bruno.d.ts +2 -0
  13. package/lib/bruno.js +381 -0
  14. package/lib/bruno.js.map +1 -0
  15. package/lib/check_performance.d.ts +1 -0
  16. package/lib/check_performance.js +57 -0
  17. package/lib/check_performance.js.map +1 -0
  18. package/lib/command_common.d.ts +5 -4
  19. package/lib/command_common.js +131 -20
  20. package/lib/command_common.js.map +1 -1
  21. package/lib/date_time.js.map +1 -1
  22. package/lib/drawRect.js.map +1 -1
  23. package/lib/environment.d.ts +1 -0
  24. package/lib/environment.js +1 -0
  25. package/lib/environment.js.map +1 -1
  26. package/lib/error-messages.d.ts +6 -0
  27. package/lib/error-messages.js +206 -0
  28. package/lib/error-messages.js.map +1 -0
  29. package/lib/file_checker.d.ts +1 -0
  30. package/lib/file_checker.js +172 -0
  31. package/lib/file_checker.js.map +1 -0
  32. package/lib/find_function.js.map +1 -1
  33. package/lib/generation_scripts.d.ts +4 -0
  34. package/lib/generation_scripts.js +2 -0
  35. package/lib/generation_scripts.js.map +1 -0
  36. package/lib/index.d.ts +3 -0
  37. package/lib/index.js +4 -0
  38. package/lib/index.js.map +1 -1
  39. package/lib/init_browser.d.ts +4 -3
  40. package/lib/init_browser.js +160 -83
  41. package/lib/init_browser.js.map +1 -1
  42. package/lib/locate_element.js +16 -14
  43. package/lib/locate_element.js.map +1 -1
  44. package/lib/locator.d.ts +37 -0
  45. package/lib/locator.js +172 -0
  46. package/lib/locator.js.map +1 -1
  47. package/lib/locator_log.d.ts +26 -0
  48. package/lib/locator_log.js +69 -0
  49. package/lib/locator_log.js.map +1 -0
  50. package/lib/network.d.ts +5 -0
  51. package/lib/network.js +494 -0
  52. package/lib/network.js.map +1 -0
  53. package/lib/route.d.ts +83 -0
  54. package/lib/route.js +691 -0
  55. package/lib/route.js.map +1 -0
  56. package/lib/scripts/axe.mini.js +24005 -0
  57. package/lib/snapshot_validation.d.ts +37 -0
  58. package/lib/snapshot_validation.js +357 -0
  59. package/lib/snapshot_validation.js.map +1 -0
  60. package/lib/stable_browser.d.ts +146 -47
  61. package/lib/stable_browser.js +2552 -836
  62. package/lib/stable_browser.js.map +1 -1
  63. package/lib/table.d.ts +15 -0
  64. package/lib/table.js +257 -0
  65. package/lib/table.js.map +1 -0
  66. package/lib/table_analyze.js.map +1 -1
  67. package/lib/table_helper.d.ts +19 -0
  68. package/lib/table_helper.js +130 -0
  69. package/lib/table_helper.js.map +1 -0
  70. package/lib/test_context.d.ts +6 -0
  71. package/lib/test_context.js +5 -0
  72. package/lib/test_context.js.map +1 -1
  73. package/lib/utils.d.ts +39 -2
  74. package/lib/utils.js +792 -13
  75. package/lib/utils.js.map +1 -1
  76. package/package.json +31 -13
  77. package/lib/axe/axe.mini.js +0 -12
package/lib/network.js ADDED
@@ -0,0 +1,494 @@
1
+ import path from "path";
2
+ import fs from "fs";
3
+ import { _stepNameToTemplate } from "./route.js";
4
+ import crypto from "crypto";
5
+ import { tmpdir } from "os";
6
+ import createDebug from "debug";
7
+ const debug = createDebug("automation_model:network");
8
+ class SaveQueue {
9
+ queue = [];
10
+ isProcessing = false;
11
+ maxRetries = 3;
12
+ async enqueueSave(current) {
13
+ this.queue.push({ current, retryCount: 0 });
14
+ if (!this.isProcessing) {
15
+ await this.processQueue();
16
+ }
17
+ }
18
+ async processQueue() {
19
+ this.isProcessing = true;
20
+ while (this.queue.length > 0) {
21
+ const item = this.queue.shift();
22
+ try {
23
+ await this.saveSafely(item.current);
24
+ }
25
+ catch (error) {
26
+ console.error(`Save failed for ${item.current ? "current" : "previous"} step:`, error);
27
+ // Retry logic
28
+ if (item.retryCount < this.maxRetries) {
29
+ item.retryCount++;
30
+ this.queue.unshift(item); // Put it back at the front
31
+ await new Promise((resolve) => setTimeout(resolve, 100 * item.retryCount)); // Exponential backoff
32
+ }
33
+ }
34
+ }
35
+ this.isProcessing = false;
36
+ }
37
+ async saveSafely(current) {
38
+ const stepHash = current ? executionState.currentStepHash : executionState.previousStepHash;
39
+ if (!stepHash)
40
+ return;
41
+ const file = path.join(detailedNetworkFolder, `${stepHash}.json`);
42
+ const entries = current
43
+ ? Array.from(executionState.liveRequestsMap.values())
44
+ : Array.from(executionState.liveRequestsMapPrevious.values());
45
+ // Ensure all entries are JSON-serializable
46
+ const validEntries = entries.filter((entry) => {
47
+ try {
48
+ JSON.stringify(entry);
49
+ return true;
50
+ }
51
+ catch {
52
+ console.warn(`Skipping non-serializable entry: ${entry.requestId}`);
53
+ return false;
54
+ }
55
+ });
56
+ const jsonString = JSON.stringify(validEntries, null, 2);
57
+ await fs.promises.writeFile(file, jsonString, "utf8");
58
+ }
59
+ }
60
+ function _getNetworkFile(world = null, web = null, context = null) {
61
+ let networkFile = null;
62
+ if (world && world.reportFolder) {
63
+ networkFile = path.join(world.reportFolder, "network.json");
64
+ }
65
+ else if (web.reportFolder) {
66
+ networkFile = path.join(web.reportFolder, "network.json");
67
+ }
68
+ else if (context && context.reportFolder) {
69
+ networkFile = path.join(context.reportFolder, "network.json");
70
+ }
71
+ else {
72
+ networkFile = "network.json";
73
+ }
74
+ return networkFile;
75
+ }
76
+ function registerDownloadEvent(page, world, context) {
77
+ if (page) {
78
+ let downloadPath = "./downloads";
79
+ if (world && world.downloadsPath) {
80
+ downloadPath = world.downloadsPath;
81
+ }
82
+ else if (context && context.downloadsPath) {
83
+ downloadPath = context.downloadsPath;
84
+ }
85
+ if (!fs.existsSync(downloadPath)) {
86
+ try {
87
+ fs.mkdirSync(downloadPath);
88
+ }
89
+ catch (e) {
90
+ // ignore
91
+ }
92
+ }
93
+ page.on("download", async (download) => {
94
+ const suggestedFilename = download.suggestedFilename(); // Get the original file name
95
+ const filePath = `${downloadPath}/${suggestedFilename}`;
96
+ // Save the download with the original name
97
+ await download.saveAs(filePath);
98
+ console.log(`Downloaded file saved as: ${filePath}`);
99
+ });
100
+ }
101
+ }
102
+ function registerNetworkEvents(world, web, context, page) {
103
+ // Map to hold request start times and IDs
104
+ const networkFile = _getNetworkFile(world, web, context);
105
+ function saveNetworkData() {
106
+ if (context && context.networkData) {
107
+ try {
108
+ fs.writeFileSync(networkFile, JSON.stringify(context.networkData, null, 2), "utf8");
109
+ }
110
+ catch (error) {
111
+ console.error("Error saving network data:", error);
112
+ }
113
+ }
114
+ }
115
+ if (!context) {
116
+ console.error("No context found to register network events");
117
+ return;
118
+ }
119
+ const requestTimes = new Map();
120
+ let requestIdCounter = 0;
121
+ if (page) {
122
+ if (!context.networkData) {
123
+ context.networkData = [];
124
+ const networkData = context.networkData;
125
+ // Event listener for when a request is made
126
+ page.on("request", (request) => {
127
+ try {
128
+ // console.log("Request started:", request.url());
129
+ const requestId = requestIdCounter++;
130
+ request.requestId = requestId; // Assign a unique ID to the request
131
+ handleRequest(request, context);
132
+ const startTime = Date.now();
133
+ requestTimes.set(requestId, startTime);
134
+ // Initialize data for this request
135
+ networkData.push({
136
+ requestId,
137
+ requestStart: startTime,
138
+ requestUrl: request.url(),
139
+ method: request.method(),
140
+ status: "Pending",
141
+ responseTime: null,
142
+ responseReceived: null,
143
+ responseEnd: null,
144
+ size: null,
145
+ });
146
+ saveNetworkData();
147
+ }
148
+ catch (error) {
149
+ // console.error("Error handling request:", error);
150
+ }
151
+ });
152
+ // Event listener for when a response is received
153
+ page.on("response", async (response) => {
154
+ try {
155
+ const request = response.request();
156
+ const requestId = request.requestId;
157
+ const receivedTime = Date.now();
158
+ // await handleRequestFinishedOrFailed(request, false);
159
+ // Find the corresponding data object
160
+ const data = networkData.find((item) => item.requestId === requestId);
161
+ if (data) {
162
+ data.status = response.status();
163
+ data.responseReceived = receivedTime;
164
+ saveNetworkData();
165
+ }
166
+ else {
167
+ // console.error("No data found for request ID", requestId);
168
+ }
169
+ }
170
+ catch (error) {
171
+ // console.error("Error handling response:", error);
172
+ }
173
+ });
174
+ // Event listener for when a request is finished
175
+ page.on("requestfinished", async (request) => {
176
+ try {
177
+ const requestId = request.requestId;
178
+ const endTime = Date.now();
179
+ const startTime = requestTimes.get(requestId);
180
+ await handleRequestFinishedOrFailed(request, false, context);
181
+ const response = await request.response();
182
+ const timing = request.timing();
183
+ // Find the corresponding data object
184
+ const data = networkData.find((item) => item.requestId === requestId);
185
+ if (data) {
186
+ data.responseEnd = endTime;
187
+ data.responseTime = endTime - startTime;
188
+ // Get response size
189
+ try {
190
+ let size = 0;
191
+ if (responseHasBody(response)) {
192
+ const buf = await response.body();
193
+ size = buf?.length ?? 0;
194
+ }
195
+ data.size = size;
196
+ }
197
+ catch {
198
+ data.size = 0;
199
+ }
200
+ const type = request.resourceType();
201
+ /*
202
+ domainLookupStart: 80.655,
203
+ domainLookupEnd: 80.668,
204
+ connectStart: 80.668,
205
+ secureConnectionStart: 106.688,
206
+ connectEnd: 129.69,
207
+ requestStart: 129.81,
208
+ responseStart: 187.006,
209
+ responseEnd: 188.209
210
+ */
211
+ data.type = type;
212
+ data.domainLookupStart = timing.domainLookupStart;
213
+ data.domainLookupEnd = timing.domainLookupEnd;
214
+ data.connectStart = timing.connectStart;
215
+ data.secureConnectionStart = timing.secureConnectionStart;
216
+ data.connectEnd = timing.connectEnd;
217
+ data.requestStart = timing.requestStart;
218
+ data.responseStart = timing.responseStart;
219
+ data.responseEnd = timing.responseEnd;
220
+ saveNetworkData();
221
+ if (world && world.attach) {
222
+ world.attach(JSON.stringify(data), { mediaType: "application/json+network" });
223
+ }
224
+ }
225
+ else {
226
+ // console.error("No data found for request ID", requestId);
227
+ }
228
+ }
229
+ catch (error) {
230
+ // console.error("Error handling request finished:", error);
231
+ }
232
+ });
233
+ // Event listener for when a request fails
234
+ page.on("requestfailed", async (request) => {
235
+ try {
236
+ const requestId = request.requestId;
237
+ const endTime = Date.now();
238
+ const startTime = requestTimes.get(requestId);
239
+ await handleRequestFinishedOrFailed(request, true, context);
240
+ try {
241
+ const res = await request.response();
242
+ const statusCode = res ? res.status() : request.failure().errorText;
243
+ // Find the corresponding data object
244
+ const data = networkData.find((item) => item.requestId === requestId);
245
+ if (data) {
246
+ data.responseEnd = endTime;
247
+ data.responseTime = endTime - startTime;
248
+ data.status = statusCode;
249
+ data.size = 0;
250
+ saveNetworkData();
251
+ if (world && world.attach) {
252
+ world.attach(JSON.stringify(data), { mediaType: "application/json+network" });
253
+ }
254
+ }
255
+ else {
256
+ // console.error("No data found for request ID", requestId);
257
+ }
258
+ }
259
+ catch (error) {
260
+ // ignore
261
+ }
262
+ }
263
+ catch (error) {
264
+ // console.error("Error handling request failed:", error);
265
+ }
266
+ });
267
+ }
268
+ }
269
+ else {
270
+ console.error("No page found to register network events");
271
+ }
272
+ }
273
+ async function appendEntryToStepFile(stepHash, entry) {
274
+ if (!stepHash)
275
+ return;
276
+ const debug = createDebug("network:appendEntryToStepFile");
277
+ const file = path.join(detailedNetworkFolder, `${stepHash}.json`);
278
+ debug("appending to step file:", file);
279
+ let data = [];
280
+ try {
281
+ /* read if it already exists */
282
+ const txt = await fs.promises.readFile(file, "utf8");
283
+ data = JSON.parse(txt);
284
+ }
285
+ catch {
286
+ /* ignore – file does not exist or cannot be parsed */
287
+ }
288
+ data.push(entry);
289
+ try {
290
+ debug("writing to step file:", file);
291
+ await fs.promises.writeFile(file, JSON.stringify(data, null, 2), "utf8");
292
+ }
293
+ catch (error) {
294
+ debug("Error writing to step file:", error);
295
+ }
296
+ }
297
+ const detailedNetworkFolder = path.join(tmpdir(), "blinq_network_events");
298
+ let outOfStep = true;
299
+ let timeoutId = null;
300
+ const executionState = {
301
+ currentStepHash: null,
302
+ previousStepHash: null,
303
+ liveRequestsMap: new Map(),
304
+ liveRequestsMapPrevious: new Map(),
305
+ };
306
+ const storeDetailedNetworkData = (context) => context && context.STORE_DETAILED_NETWORK_DATA === true;
307
+ export function networkBeforeStep(stepName, context) {
308
+ if (timeoutId) {
309
+ clearTimeout(timeoutId);
310
+ timeoutId = null;
311
+ }
312
+ outOfStep = false;
313
+ if (!storeDetailedNetworkData(context)) {
314
+ return;
315
+ }
316
+ // check if the folder exists, if not create it
317
+ if (!fs.existsSync(detailedNetworkFolder)) {
318
+ fs.mkdirSync(detailedNetworkFolder, { recursive: true });
319
+ }
320
+ // const stepHash = stepNameToHash(stepName);
321
+ let stepHash = "";
322
+ executionState.liveRequestsMapPrevious = executionState.liveRequestsMap;
323
+ executionState.liveRequestsMap = new Map();
324
+ stepHash = stepNameToHash(stepName);
325
+ executionState.previousStepHash = executionState.currentStepHash; // ➊ NEW
326
+ executionState.currentStepHash = stepHash;
327
+ // check if the file exists, if exists delete it
328
+ const networkFile = path.join(detailedNetworkFolder, `${stepHash}.json`);
329
+ try {
330
+ fs.rmSync(path.join(networkFile), { force: true });
331
+ }
332
+ catch (err) {
333
+ // Ignore error if file does not exist
334
+ }
335
+ }
336
+ const saveQueue = new SaveQueue();
337
+ async function saveMap(current) {
338
+ await saveQueue.enqueueSave(current);
339
+ }
340
+ export async function networkAfterStep(stepName, context) {
341
+ if (!storeDetailedNetworkData(context)) {
342
+ return;
343
+ }
344
+ //await new Promise((r) => setTimeout(r, 1000));
345
+ await saveMap(true);
346
+ /* reset for next step */
347
+ //executionState.previousStepHash = executionState.currentStepHash; // ➋ NEW
348
+ //executionState.liveRequestsMap.clear();
349
+ outOfStep = true;
350
+ // set a timer of 60 seconds to the outOfStep, after that it will be set to false so no network collection will happen
351
+ timeoutId = setTimeout(() => {
352
+ outOfStep = false;
353
+ context.STORE_DETAILED_NETWORK_DATA = false;
354
+ }, 60000);
355
+ }
356
+ function stepNameToHash(stepName) {
357
+ const templateName = _stepNameToTemplate(stepName);
358
+ // create hash from the template name
359
+ return crypto.createHash("sha256").update(templateName).digest("hex");
360
+ }
361
+ function handleRequest(request, context) {
362
+ const debug = createDebug("automation_model:network:handleRequest");
363
+ if (!storeDetailedNetworkData(context))
364
+ return;
365
+ const entry = {
366
+ requestId: request.requestId,
367
+ url: request.url(),
368
+ method: request.method(),
369
+ headers: request.headers(),
370
+ postData: request.postData(),
371
+ requestTimestamp: Date.now(),
372
+ stepHash: executionState.currentStepHash,
373
+ };
374
+ executionState.liveRequestsMap.set(request, entry);
375
+ debug("Request to", request.url(), "with", request.requestId, "added to current step map at", Date.now());
376
+ }
377
+ async function handleRequestFinishedOrFailed(request, failed, context) {
378
+ const debug = createDebug("automation_model:network:handleRequestFinishedOrFailed");
379
+ if (!storeDetailedNetworkData(context))
380
+ return;
381
+ const requestId = request.requestId;
382
+ debug("Request id in handleRequestFinishedOrFailed:", requestId, "at", Date.now());
383
+ // const response = await request.response(); // This may be null if the request failed
384
+ let entry = executionState.liveRequestsMap.get(request);
385
+ debug("Request entry found in current map:", entry?.requestId || false);
386
+ if (!entry) {
387
+ // check if the request is in the previous step's map
388
+ entry = executionState.liveRequestsMapPrevious.get(request);
389
+ debug("Request entry found in previous map:", entry?.requestId || false);
390
+ if (!entry) {
391
+ debug("No entry, creating fallback! for url:", request.url());
392
+ entry = {
393
+ requestId: request.requestId,
394
+ url: request.url(),
395
+ method: request.method?.() ?? "GET",
396
+ headers: request.headers?.() ?? {},
397
+ postData: request.postData?.() ?? undefined,
398
+ stepHash: executionState.previousStepHash ?? "unknown",
399
+ requestTimestamp: Date.now(),
400
+ };
401
+ }
402
+ }
403
+ // Remove the request from the live requests map
404
+ let respData;
405
+ // executionState.liveRequestsMap.delete(request);
406
+ if (failed) {
407
+ // Handle failed request
408
+ respData = {
409
+ status: null,
410
+ headers: {},
411
+ url: request.url(),
412
+ timestamp: Date.now(),
413
+ body: null,
414
+ contentType: null,
415
+ error: "Request failed",
416
+ };
417
+ }
418
+ else {
419
+ const response = await request.response();
420
+ const headers = response?.headers?.() || {};
421
+ let contentType = headers["content-type"] || null;
422
+ let body = null;
423
+ try {
424
+ if (responseHasBody(response)) {
425
+ if (contentType && contentType.includes("application/json")) {
426
+ body = JSON.parse(await response.text());
427
+ }
428
+ else if ((contentType && contentType.includes("text")) ||
429
+ (contentType && contentType.includes("application/csv"))) {
430
+ body = await response.text();
431
+ if (contentType.includes("application/csv"))
432
+ contentType = "text/csv";
433
+ }
434
+ else {
435
+ // If you want binary, you could read it here—but only when responseHasBody(response) is true
436
+ // const buffer = await response.body();
437
+ // body = buffer.toString("base64");
438
+ }
439
+ }
440
+ else {
441
+ // For redirects / no-body statuses, it's useful to keep redirect info
442
+ // e.g., include Location header if present
443
+ // body stays null
444
+ }
445
+ }
446
+ catch (err) {
447
+ console.error("Error reading response body:", err);
448
+ body = await response.text();
449
+ }
450
+ respData = {
451
+ status: response.status(),
452
+ headers,
453
+ url: response.url(),
454
+ timestamp: Date.now(),
455
+ body,
456
+ contentType,
457
+ };
458
+ }
459
+ if (executionState.liveRequestsMap.has(request)) {
460
+ /* “normal” path – keep it in the buffer */
461
+ entry.response = respData;
462
+ if (outOfStep && executionState.currentStepHash) {
463
+ await saveMap(true);
464
+ }
465
+ }
466
+ else {
467
+ if (executionState.liveRequestsMapPrevious.has(request)) {
468
+ entry.response = respData;
469
+ await saveMap(false);
470
+ }
471
+ else {
472
+ /* orphan response – append directly to the previous step file */
473
+ entry.response = respData;
474
+ await appendEntryToStepFile(entry.stepHash, entry); // ➍ NEW
475
+ }
476
+ }
477
+ entry.response = respData;
478
+ return;
479
+ }
480
+ function responseHasBody(response) {
481
+ if (!response)
482
+ return false;
483
+ const s = response.status?.() ?? 0;
484
+ // RFC 7231: 1xx, 204, 205, 304 have no body. Playwright: 3xx (redirect) body is unavailable.
485
+ if ((s >= 100 && s < 200) || s === 204 || s === 205 || s === 304 || (s >= 300 && s < 400))
486
+ return false;
487
+ // HEAD responses have no body by definition
488
+ const method = response.request?.().method?.() ?? "GET";
489
+ if (method === "HEAD")
490
+ return false;
491
+ return true;
492
+ }
493
+ export { registerNetworkEvents, registerDownloadEvent };
494
+ //# sourceMappingURL=network.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"network.js","sourceRoot":"","sources":["../../src/network.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC;AAC5B,OAAO,WAAW,MAAM,OAAO,CAAC;AAChC,MAAM,KAAK,GAAG,WAAW,CAAC,0BAA0B,CAAC,CAAC;AAEtD,MAAM,SAAS;IACL,KAAK,GAAoD,EAAE,CAAC;IAC5D,YAAY,GAAG,KAAK,CAAC;IACZ,UAAU,GAAG,CAAC,CAAC;IAEzB,KAAK,CAAC,WAAW,CAAC,OAAgB;QACvC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC,EAAE,CAAC,CAAC;QAC5C,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;YACvB,MAAM,IAAI,CAAC,YAAY,EAAE,CAAC;QAC5B,CAAC;IACH,CAAC;IAEO,KAAK,CAAC,YAAY;QACxB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QAEzB,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC7B,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,EAAG,CAAC;YAEjC,IAAI,CAAC;gBACH,MAAM,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACtC,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,OAAO,CAAC,KAAK,C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CAAC;IACxD,IAAI,MAAM,KAAK,MAAM;QAAE,OAAO,KAAK,CAAC;IACpC,OAAO,IAAI,CAAC;AACd,CAAC;AAED,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,CAAC"}
package/lib/route.d.ts ADDED
@@ -0,0 +1,83 @@
1
+ export interface Route {
2
+ template: string;
3
+ routes: RouteItem[];
4
+ }
5
+ export interface RouteItem {
6
+ filters: {
7
+ path: string;
8
+ queryParams: Record<string, string> | null;
9
+ method: string | null;
10
+ };
11
+ actions: Action[];
12
+ mandatory: boolean;
13
+ timeout: number;
14
+ }
15
+ interface StubAction {
16
+ type: "stub_request";
17
+ config: {
18
+ path?: string;
19
+ statusCode?: number;
20
+ contentType?: string;
21
+ body?: string;
22
+ };
23
+ }
24
+ interface JSONModifyAction {
25
+ type: "json_modify";
26
+ config: {
27
+ path: string;
28
+ modifyValue: any;
29
+ };
30
+ }
31
+ interface JSONWholeModifyAction {
32
+ type: "json_whole_modify";
33
+ config: any;
34
+ }
35
+ interface TextModifyAction {
36
+ type: "change_text";
37
+ config: string;
38
+ }
39
+ interface JSONVerifyAction {
40
+ type: "assert_json";
41
+ config: {
42
+ path: string;
43
+ expectedValue: any;
44
+ };
45
+ }
46
+ interface JSONWholeVerifyAction {
47
+ type: "assert_whole_json";
48
+ config: {
49
+ contains: string;
50
+ } | {
51
+ equals: string;
52
+ };
53
+ }
54
+ interface TextVerifyAction {
55
+ type: "assert_text";
56
+ config: {
57
+ contains: string;
58
+ } | {
59
+ equals: string;
60
+ };
61
+ }
62
+ interface StatusCodeModifyAction {
63
+ type: "status_code_change";
64
+ config: number;
65
+ }
66
+ interface StatusCodeVerifyAction {
67
+ type: "status_code_verification";
68
+ config: number;
69
+ }
70
+ interface AbortAction {
71
+ type: "abort_request";
72
+ config: {
73
+ errorCode: string;
74
+ };
75
+ }
76
+ export type Action = AbortAction | StatusCodeVerifyAction | StatusCodeModifyAction | TextVerifyAction | TextModifyAction | JSONModifyAction | JSONWholeModifyAction | JSONVerifyAction | JSONWholeVerifyAction | StubAction;
77
+ export declare function pathFilter(savedPath: string, actualPath: string): boolean;
78
+ export declare function queryParamsFilter(savedQueryParams: Record<string, string> | null, actualQueryParams: URLSearchParams): boolean;
79
+ export declare function methodFilter(savedMethod: string | null, actualMethod: string): boolean;
80
+ export declare function registerBeforeStepRoutes(context: any, stepName: string, world: any): Promise<void>;
81
+ export declare function registerAfterStepRoutes(context: any, world: any): Promise<any>;
82
+ export declare function _stepNameToTemplate(stepName: string): string;
83
+ export {};