@redocly/replay 0.18.0-next.9 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{replay-index-Dj0sSumI.js → replay-index-0zz4VlUA.js} +836 -813
- package/dist/{replay-index-N_eL-dHw.js → replay-index-BExnbqCh.js} +16916 -16398
- package/dist/replay-index-BKd-FZP1.js +32 -0
- package/dist/{replay-index-rXYeAbfS.js → replay-index-D8W7AKLe.js} +1 -1
- package/dist/{replay-index-LEZH_IKS.js → replay-index-Didccr8B.js} +1 -1
- package/dist/{replay-index-DbkmBvb2.js → replay-index-wIVtujmr.js} +860 -860
- package/dist/replay-tauri-path-BQI68Xj2.js +22 -0
- package/dist/replay-tauri-path-CW1Z9Bsc.js +1 -0
- package/dist/replay.cjs +1 -1
- package/dist/replay.js +1 -1
- package/package.json +5 -5
- package/dist/replay-index-DCEA3jne.js +0 -32
- package/dist/replay-tauri-path-CPOjT7PX.js +0 -1
- package/dist/replay-tauri-path-CypZ5tQ3.js +0 -21
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { b as Gt, a as U, p as Y, c as
|
|
2
|
-
async function
|
|
1
|
+
import { b as Gt, a as U, p as Y, c as Io, f as ke, g as cr, h as Do, k as rr, l as Lo, y as fr, m as X, n as Re, o as Zt, q as No, t as ur, u as Yt, v as we, R as Ze, w as jo, x as Wo, C as V, z as Dt, A as qo, B as Uo, S as es, U as rs, D as J, E as zo, F as Bo, G as xo, H as Mo, I as Vo, J as Ko, K as Ho, L as Jo, M as Xo, N as Lt, O as Qo, P as Nt, Q as Go, T as Zo } from "./replay-index-BExnbqCh.js";
|
|
2
|
+
async function Yo(r) {
|
|
3
3
|
const { descriptionPath: t, externalRefResolver: e, base: n } = r, a = await Gt({
|
|
4
4
|
base: n,
|
|
5
5
|
ref: t,
|
|
@@ -17,7 +17,7 @@ function ts(r) {
|
|
|
17
17
|
const t = Object.keys(r)[0];
|
|
18
18
|
return t ? r[t]?.value : void 0;
|
|
19
19
|
}
|
|
20
|
-
const
|
|
20
|
+
const ei = (r) => /\{.*?\}/.test(r);
|
|
21
21
|
function fe({ value: r, ctx: t, logger: e }) {
|
|
22
22
|
if (!r)
|
|
23
23
|
return r;
|
|
@@ -26,9 +26,9 @@ function fe({ value: r, ctx: t, logger: e }) {
|
|
|
26
26
|
r[n] = fe({ value: r[n], ctx: t, logger: e });
|
|
27
27
|
return r;
|
|
28
28
|
}
|
|
29
|
-
return typeof r == "number" || typeof r == "boolean" ? r : r.toString().startsWith("$faker.") ? ze({ pointer: r.slice(1), ctx: t, logger: e }) :
|
|
29
|
+
return typeof r == "number" || typeof r == "boolean" ? r : r.toString().startsWith("$faker.") ? ze({ pointer: r.slice(1), ctx: t, logger: e }) : ei(r) ? si(r, t, e) : oi(r, t, e);
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function ri(r, t, e) {
|
|
32
32
|
const n = r.indexOf("{");
|
|
33
33
|
if (n !== -1) {
|
|
34
34
|
const c = r.substring(n + 1).slice(0, -1), f = ze({ pointer: c.slice(1), ctx: t, logger: e });
|
|
@@ -36,24 +36,24 @@ function ei(r, t, e) {
|
|
|
36
36
|
} else
|
|
37
37
|
return r;
|
|
38
38
|
}
|
|
39
|
-
function
|
|
39
|
+
function ti(r, t) {
|
|
40
40
|
const e = Object.keys(t), n = Object.values(t);
|
|
41
41
|
return new Function(...e, `return ${r}`)(...n);
|
|
42
42
|
}
|
|
43
|
-
function
|
|
43
|
+
function si(r, t, e) {
|
|
44
44
|
const n = /\{\$(\{[^{}]*\}|[^{}])*\}/g;
|
|
45
45
|
let a = r;
|
|
46
|
-
return a = a.replace(n, (c, f) =>
|
|
46
|
+
return a = a.replace(n, (c, f) => ni(c, t, e)), a;
|
|
47
47
|
}
|
|
48
|
-
function
|
|
48
|
+
function ni(r, t, e) {
|
|
49
49
|
if (!r.includes("$"))
|
|
50
50
|
return r;
|
|
51
51
|
if (r.includes("$faker."))
|
|
52
|
-
return
|
|
53
|
-
const n = qe(t)(
|
|
52
|
+
return ri(r, t, e);
|
|
53
|
+
const n = qe(t)(ii(r));
|
|
54
54
|
return n !== void 0 ? n : "";
|
|
55
55
|
}
|
|
56
|
-
const
|
|
56
|
+
const oi = (r, t, e) => {
|
|
57
57
|
if (!r)
|
|
58
58
|
return r;
|
|
59
59
|
const n = r.toString();
|
|
@@ -70,7 +70,7 @@ const ni = (r, t, e) => {
|
|
|
70
70
|
}
|
|
71
71
|
return n && n.trim().startsWith("faker.") ? ze({ pointer: n, ctx: t, logger: e }) : n ? qe(t)(jt(n)) : n.replace(/\$\{([^}]+)}/g, (a, c) => qe(t)(jt(c)));
|
|
72
72
|
};
|
|
73
|
-
function
|
|
73
|
+
function ii(r) {
|
|
74
74
|
return r.replace(/\{(.*)\}/, "$1");
|
|
75
75
|
}
|
|
76
76
|
function jt(r) {
|
|
@@ -98,7 +98,7 @@ function ze({ pointer: r, ctx: t, logger: e }) {
|
|
|
98
98
|
// if goes second and so on - must be prepended by '.', like ["escaped-field"].func()
|
|
99
99
|
f.endsWith(")") ? `${l == 0 ? "" : "."}${f}` : `["${f}"]`
|
|
100
100
|
)).join("");
|
|
101
|
-
return
|
|
101
|
+
return ti(`ctx${c}`, a);
|
|
102
102
|
} catch (c) {
|
|
103
103
|
e.error(U(c.toString()));
|
|
104
104
|
return;
|
|
@@ -122,13 +122,13 @@ function qt(r, t) {
|
|
|
122
122
|
e[`{${n}}`] = String(t[n]);
|
|
123
123
|
return r.split(/(\{[a-zA-Z0-9_.-]+\}+)/g).map((n) => e[n] ? e[n] : n).join("");
|
|
124
124
|
}
|
|
125
|
-
function
|
|
125
|
+
function ai(r) {
|
|
126
126
|
return typeof r == "object" && r !== null && "name" in r && "value" in r && !("in" in r);
|
|
127
127
|
}
|
|
128
128
|
function Mr(r) {
|
|
129
129
|
return typeof r == "object" && r !== null && "in" in r && ["header", "query", "path", "cookie"].includes(r.in);
|
|
130
130
|
}
|
|
131
|
-
const
|
|
131
|
+
const ci = /^image\/(png|jpeg|gif|bmp|webp|svg\+xml)|application\/pdf$/;
|
|
132
132
|
function ns(r) {
|
|
133
133
|
return r.startsWith("$file(") && r.endsWith(")") ? r.substring(7, r.length - 2) : r;
|
|
134
134
|
}
|
|
@@ -142,19 +142,19 @@ const Ut = async (r, t, e, n, a) => {
|
|
|
142
142
|
typeof d == "string" && d.startsWith("$file(") && d.endsWith(")") ? r.push(Ut(t, h, d, n, a)) : t.append(h, d.toString());
|
|
143
143
|
}) : typeof l == "object" && l !== null ? os(r, t, l, n, a, h) : (typeof l == "string" || typeof l == "number" || typeof l == "boolean") && t.append(h, l.toString());
|
|
144
144
|
});
|
|
145
|
-
},
|
|
145
|
+
}, fi = async (r, t, e, n) => {
|
|
146
146
|
if (r && typeof r == "object" && !Array.isArray(r)) {
|
|
147
147
|
const a = [];
|
|
148
148
|
os(a, t, r, e, n), await Promise.all(a);
|
|
149
149
|
}
|
|
150
|
-
},
|
|
150
|
+
}, ui = async (r, t) => {
|
|
151
151
|
if (typeof r == "string" && r.startsWith("$file(") && r.endsWith(")")) {
|
|
152
152
|
const e = Y.resolve(Y.dirname(t.options.filePath), ns(r));
|
|
153
153
|
return t.options.requestFileLoader.getFileBody(e);
|
|
154
154
|
} else
|
|
155
155
|
return r;
|
|
156
156
|
};
|
|
157
|
-
async function
|
|
157
|
+
async function li(r, t) {
|
|
158
158
|
if (!r)
|
|
159
159
|
return {
|
|
160
160
|
payload: void 0,
|
|
@@ -165,15 +165,15 @@ async function ui(r, t) {
|
|
|
165
165
|
const { payload: e, contentType: n } = r;
|
|
166
166
|
if (n === "multipart/form-data") {
|
|
167
167
|
const a = new FormData(), c = Y.resolve(t.options.filePath);
|
|
168
|
-
return await
|
|
168
|
+
return await fi(e, a, c, t), {
|
|
169
169
|
...r,
|
|
170
170
|
payload: a
|
|
171
171
|
};
|
|
172
172
|
} else {
|
|
173
|
-
if (n === "application/octet-stream" || typeof n == "string" &&
|
|
173
|
+
if (n === "application/octet-stream" || typeof n == "string" && ci.test(n))
|
|
174
174
|
return {
|
|
175
175
|
...r,
|
|
176
|
-
payload: await
|
|
176
|
+
payload: await ui(e, t),
|
|
177
177
|
contentType: "application/octet-stream"
|
|
178
178
|
};
|
|
179
179
|
if (n === "application/x-www-form-urlencoded" && typeof e == "string")
|
|
@@ -185,14 +185,14 @@ async function ui(r, t) {
|
|
|
185
185
|
}
|
|
186
186
|
return r;
|
|
187
187
|
}
|
|
188
|
-
function
|
|
188
|
+
function pi(r) {
|
|
189
189
|
try {
|
|
190
|
-
return
|
|
190
|
+
return Io(r);
|
|
191
191
|
} catch {
|
|
192
192
|
throw new Error(`Runtime expression is not valid: ${r}`);
|
|
193
193
|
}
|
|
194
194
|
}
|
|
195
|
-
function
|
|
195
|
+
function di(r, t) {
|
|
196
196
|
const e = [
|
|
197
197
|
{
|
|
198
198
|
pattern: /\$response\.body#\/([\w/]+)/g,
|
|
@@ -223,7 +223,7 @@ function pi(r, t) {
|
|
|
223
223
|
function Ne(r, t, e) {
|
|
224
224
|
if (r)
|
|
225
225
|
try {
|
|
226
|
-
const n =
|
|
226
|
+
const n = ke.get(r, `/${t}`);
|
|
227
227
|
return typeof n == "string" || Array.isArray(n) || typeof n == "object" ? JSON.stringify(n) : n !== void 0 ? n : e;
|
|
228
228
|
} catch {
|
|
229
229
|
return e;
|
|
@@ -251,12 +251,12 @@ function oe({ payload: r, context: t, contentType: e, logger: n }) {
|
|
|
251
251
|
}
|
|
252
252
|
return Wt(r, t, n);
|
|
253
253
|
}
|
|
254
|
-
return typeof r == "string" ?
|
|
254
|
+
return typeof r == "string" ? Ei(r) ? Se(r, t, n) : vi(r, t, n) : cr(r) ? Object.entries(r).reduce((a, [c, f]) => (a[c] = oe({ payload: f, context: t, logger: n }), a), {}) : Array.isArray(r) ? r.map((a) => oe({ payload: a, context: t, logger: n })) : r;
|
|
255
255
|
}
|
|
256
256
|
function Se(r, t, e) {
|
|
257
|
-
return typeof r == "string" ?
|
|
257
|
+
return typeof r == "string" ? hi(r, t, e) : cr(r) ? Object.entries(r).reduce((n, [a, c]) => (n[a] = c && Se(c, t, e), n), {}) : Array.isArray(r) ? r.map((n) => Se(n, t, e)) : r;
|
|
258
258
|
}
|
|
259
|
-
function
|
|
259
|
+
function hi(r, t, e) {
|
|
260
260
|
if (/^\$faker\.[a-zA-Z0-9._-]+(\([^\\)]*\))?$/.test(r))
|
|
261
261
|
return ze({ pointer: r.slice(1), ctx: t, logger: e });
|
|
262
262
|
if (r.includes("$faker.")) {
|
|
@@ -265,8 +265,8 @@ function di(r, t, e) {
|
|
|
265
265
|
}
|
|
266
266
|
if (!r.includes("$") && !/[=<>]/.test(r))
|
|
267
267
|
return r;
|
|
268
|
-
|
|
269
|
-
const n =
|
|
268
|
+
pi(r);
|
|
269
|
+
const n = mi(r, t), a = $i(t);
|
|
270
270
|
try {
|
|
271
271
|
return new Function(...Object.keys(a), `return ${n};`)(...Object.values(a));
|
|
272
272
|
} catch {
|
|
@@ -274,14 +274,14 @@ function di(r, t, e) {
|
|
|
274
274
|
This could be because the expression references a value from a previous failed step, or is trying to reference a variable that hasn't been set.`);
|
|
275
275
|
}
|
|
276
276
|
}
|
|
277
|
-
function
|
|
277
|
+
function gi(r) {
|
|
278
278
|
return r.replace(/\$([a-zA-Z0-9._-]+)/g, (t, e) => `$${e.replace(/-/g, "_")}`);
|
|
279
279
|
}
|
|
280
|
-
function
|
|
281
|
-
const e =
|
|
280
|
+
function mi(r, t) {
|
|
281
|
+
const e = di(r, t), a = gi(e).replace(/{(.*?)}/g, "$1"), c = wi(a), f = /\.header\.([a-zA-Z0-9._-]+)/g;
|
|
282
282
|
return c.replace(f, (h, d) => `.header.${d.toLowerCase()}`);
|
|
283
283
|
}
|
|
284
|
-
function
|
|
284
|
+
function $i(r) {
|
|
285
285
|
const t = {};
|
|
286
286
|
for (const [e, n] of Object.entries(r)) {
|
|
287
287
|
const a = e.replace(/-/g, "_");
|
|
@@ -290,28 +290,28 @@ function mi(r) {
|
|
|
290
290
|
return t;
|
|
291
291
|
}
|
|
292
292
|
function is(r) {
|
|
293
|
-
return Array.isArray(r) ? r : typeof r == "object" && r !== null ?
|
|
293
|
+
return Array.isArray(r) ? r : typeof r == "object" && r !== null ? yi(r) : r;
|
|
294
294
|
}
|
|
295
|
-
function
|
|
295
|
+
function yi(r) {
|
|
296
296
|
return Object.keys(r).reduce((t, e) => {
|
|
297
297
|
const n = e.replace(/-/g, "_");
|
|
298
298
|
return t[n] = is(r[e]), t;
|
|
299
299
|
}, {});
|
|
300
300
|
}
|
|
301
|
-
function
|
|
301
|
+
function wi(r) {
|
|
302
302
|
return r.replace(/\.(\d+)/g, (t, e, n, a) => {
|
|
303
303
|
const c = a[n - 1];
|
|
304
304
|
return /\d/.test(c) ? t : `[${e}]`;
|
|
305
305
|
});
|
|
306
306
|
}
|
|
307
|
-
function
|
|
307
|
+
function vi(r, t, e) {
|
|
308
308
|
const n = /\{(?:[^{}]|\{[^{}]*\})*\}|\$[^\s{}]+(?:\([^()]*\))*/g;
|
|
309
309
|
return r.replace(n, (a) => {
|
|
310
310
|
const c = a.trim(), f = Se(c, t, e);
|
|
311
311
|
return f !== void 0 ? f : a;
|
|
312
312
|
});
|
|
313
313
|
}
|
|
314
|
-
function
|
|
314
|
+
function Ei(r) {
|
|
315
315
|
return /^\$[^\s{}]+(\([^)]*\))?$|^\{[^{}]*\}$/.test(r.trim());
|
|
316
316
|
}
|
|
317
317
|
function ki({ payload: r, replacements: t, expressionContext: e, logger: n }) {
|
|
@@ -320,21 +320,21 @@ function ki({ payload: r, replacements: t, expressionContext: e, logger: n }) {
|
|
|
320
320
|
if (typeof c != "string")
|
|
321
321
|
throw new Error(`Invalid JSON Pointer: ${c}`);
|
|
322
322
|
try {
|
|
323
|
-
const l =
|
|
323
|
+
const l = ke.get(r, c), h = oe({
|
|
324
324
|
payload: f,
|
|
325
325
|
context: e,
|
|
326
326
|
logger: n
|
|
327
327
|
});
|
|
328
|
-
l !== void 0 &&
|
|
328
|
+
l !== void 0 && ke.set(r, c, h);
|
|
329
329
|
} catch {
|
|
330
330
|
throw new Error(`Invalid JSON Pointer: ${c}`);
|
|
331
331
|
}
|
|
332
332
|
}
|
|
333
333
|
}
|
|
334
|
-
const
|
|
335
|
-
function
|
|
334
|
+
const Si = ["parameters", "failureActions", "successActions"];
|
|
335
|
+
function bi(r, t) {
|
|
336
336
|
const { reference: e, value: n } = r;
|
|
337
|
-
if (!
|
|
337
|
+
if (!Si.some((c) => e.includes(`$components.${c}`)))
|
|
338
338
|
throw new Error("Invalid reference: available components are $components.parameters, $components.failureActions, or $components.successActions");
|
|
339
339
|
const a = fe({ value: e, ctx: t, logger: t.options.logger });
|
|
340
340
|
return "value" in a && n ? {
|
|
@@ -343,12 +343,12 @@ function Si(r, t) {
|
|
|
343
343
|
} : a;
|
|
344
344
|
}
|
|
345
345
|
function We(r, t) {
|
|
346
|
-
return "reference" in r ?
|
|
346
|
+
return "reference" in r ? bi(r, t) : r;
|
|
347
347
|
}
|
|
348
348
|
function Ci(r, t) {
|
|
349
|
-
const e = r?.requestBody?.content || {}, [n, a] = Object.entries(e)[0] || [], c = a?.example || ts(a?.examples) || as(a?.schema, t), f =
|
|
349
|
+
const e = r?.requestBody?.content || {}, [n, a] = Object.entries(e)[0] || [], c = a?.example || ts(a?.examples) || as(a?.schema, t), f = Ai(r);
|
|
350
350
|
return {
|
|
351
|
-
parameters:
|
|
351
|
+
parameters: Ri([
|
|
352
352
|
...zt(r.pathParameters, t),
|
|
353
353
|
...zt(r.parameters, t)
|
|
354
354
|
]).filter(({ value: h }) => h),
|
|
@@ -360,7 +360,7 @@ function Ci(r, t) {
|
|
|
360
360
|
contentType: n
|
|
361
361
|
};
|
|
362
362
|
}
|
|
363
|
-
function
|
|
363
|
+
function Ai(r) {
|
|
364
364
|
return r?.responses ? Array.from(new Set(Object.values(r.responses).flatMap((t) => cr(t) && "content" in t ? Object.keys(t.content || {}) : []))).join(", ") : void 0;
|
|
365
365
|
}
|
|
366
366
|
function zt(r, t) {
|
|
@@ -369,17 +369,17 @@ function zt(r, t) {
|
|
|
369
369
|
return {
|
|
370
370
|
name: e.name,
|
|
371
371
|
in: e.in,
|
|
372
|
-
value:
|
|
372
|
+
value: Di(e, t)
|
|
373
373
|
};
|
|
374
374
|
}).filter((e) => e !== void 0);
|
|
375
375
|
}
|
|
376
|
-
function
|
|
376
|
+
function Ri(r) {
|
|
377
377
|
const t = {};
|
|
378
378
|
for (const e of r)
|
|
379
379
|
Mr(e) && (t[(e.name + ":" + e.in).toLowerCase()] = e);
|
|
380
380
|
return Object.values(t);
|
|
381
381
|
}
|
|
382
|
-
function
|
|
382
|
+
function Oi(r, t) {
|
|
383
383
|
let e, n;
|
|
384
384
|
if (r.includes("$sourceDescriptions.")) {
|
|
385
385
|
const [, h, d] = r.split(".");
|
|
@@ -392,21 +392,21 @@ function Ri(r, t) {
|
|
|
392
392
|
for (const [h, d] of Object.entries(t[e].paths)) {
|
|
393
393
|
if (!d)
|
|
394
394
|
return;
|
|
395
|
-
for (const [
|
|
396
|
-
if (
|
|
395
|
+
for (const [m, y] of Object.entries(d))
|
|
396
|
+
if (y.operationId === n)
|
|
397
397
|
return {
|
|
398
398
|
servers: d.servers || l,
|
|
399
|
-
...
|
|
400
|
-
pathParameters:
|
|
399
|
+
...y,
|
|
400
|
+
pathParameters: y.parameters || [],
|
|
401
401
|
path: h,
|
|
402
|
-
method:
|
|
402
|
+
method: m,
|
|
403
403
|
descriptionName: e,
|
|
404
404
|
securitySchemes: f
|
|
405
405
|
};
|
|
406
406
|
}
|
|
407
407
|
throw new Error(`Unknown operationId ${U(n)} at ${U(r)}.`);
|
|
408
408
|
}
|
|
409
|
-
function
|
|
409
|
+
function Ti(r, t) {
|
|
410
410
|
const { $sourceDescriptions: e, sourceDescriptions: n } = t, [a, c] = r.split("#");
|
|
411
411
|
if (!n)
|
|
412
412
|
throw new Error("Missing described sourceDescriptions");
|
|
@@ -422,29 +422,29 @@ function Oi(r, t) {
|
|
|
422
422
|
})?.name;
|
|
423
423
|
if (!f)
|
|
424
424
|
throw new Error(`Unknown operationPath ${U(r)}. API description ${U(a)} is not listed in 'sourceDescriptions' workflow section.`);
|
|
425
|
-
const l = e[f] || {}, h = l?.components?.securitySchemes, [d,
|
|
425
|
+
const l = e[f] || {}, h = l?.components?.securitySchemes, [d, m, y] = ke.parse(c);
|
|
426
426
|
if (d !== "paths")
|
|
427
427
|
throw new Error(`Invalid fragment identifier: ${c} at operationPath ${U(r)}.`);
|
|
428
|
-
const { servers:
|
|
428
|
+
const { servers: E } = l, S = ke.get(l, c) || {}, N = ke.get(l, ke.compile(["paths", m])) || {};
|
|
429
429
|
return {
|
|
430
|
-
servers:
|
|
430
|
+
servers: N.servers || E,
|
|
431
431
|
// use servers from path level if exists
|
|
432
|
-
...
|
|
432
|
+
...S,
|
|
433
433
|
// operation level servers override path level or global servers
|
|
434
|
-
pathParameters:
|
|
435
|
-
path:
|
|
436
|
-
method:
|
|
434
|
+
pathParameters: N.parameters || [],
|
|
435
|
+
path: m,
|
|
436
|
+
method: y,
|
|
437
437
|
descriptionName: f,
|
|
438
438
|
securitySchemes: h
|
|
439
439
|
};
|
|
440
440
|
}
|
|
441
|
-
function
|
|
441
|
+
function Pi(r, t) {
|
|
442
442
|
if (!r.operationId && !r.operationPath)
|
|
443
443
|
return;
|
|
444
444
|
const { $sourceDescriptions: e, sourceDescriptions: n } = t, { operationId: a, operationPath: c } = r;
|
|
445
|
-
return a ?
|
|
445
|
+
return a ? Oi(a, e) : c ? Ti(c, { $sourceDescriptions: e, sourceDescriptions: n }) : void 0;
|
|
446
446
|
}
|
|
447
|
-
function
|
|
447
|
+
function _i({ statusCode: r, contentType: t, descriptionResponses: e }) {
|
|
448
448
|
return e ? (e[r] || e.default)?.content?.[t]?.schema : void 0;
|
|
449
449
|
}
|
|
450
450
|
function Fi(r, t) {
|
|
@@ -453,21 +453,21 @@ function Fi(r, t) {
|
|
|
453
453
|
const n = t.requestBody?.content;
|
|
454
454
|
return n && n[r]?.schema || void 0;
|
|
455
455
|
}
|
|
456
|
-
const
|
|
456
|
+
const Ii = {
|
|
457
457
|
title: "[REPLACE WITH API title]",
|
|
458
458
|
version: "[REPLACE WITH API version]"
|
|
459
459
|
};
|
|
460
460
|
function as(r, t) {
|
|
461
461
|
if (r)
|
|
462
462
|
try {
|
|
463
|
-
return
|
|
463
|
+
return Do(r, { skipReadOnly: !0, skipNonRequired: !1, quiet: !0 });
|
|
464
464
|
} catch (e) {
|
|
465
465
|
t.error(rr(" Error while generating test data from JSON Schema ") + `
|
|
466
466
|
` + e);
|
|
467
467
|
return;
|
|
468
468
|
}
|
|
469
469
|
}
|
|
470
|
-
function
|
|
470
|
+
function Di(r, t) {
|
|
471
471
|
if (r?.example)
|
|
472
472
|
return r.example;
|
|
473
473
|
if (r?.examples)
|
|
@@ -475,39 +475,39 @@ function Ii(r, t) {
|
|
|
475
475
|
if (r?.schema)
|
|
476
476
|
return as(r.schema, t);
|
|
477
477
|
}
|
|
478
|
-
function
|
|
478
|
+
function Li(r) {
|
|
479
479
|
return r == null ? !0 : r.constructor.name === "FormData" || r instanceof Blob && r.size > 0 ? !1 : typeof r == "object" ? Object.keys(r).length === 0 : typeof r == "string" || Array.isArray(r) ? r.length === 0 : !1;
|
|
480
480
|
}
|
|
481
|
-
function
|
|
482
|
-
return !
|
|
481
|
+
function Ni(r) {
|
|
482
|
+
return !Lo && process.env.NODE_ENV === "test" ? "<test>ms" : `${Math.ceil(performance.now() - r)}ms`;
|
|
483
483
|
}
|
|
484
484
|
function Vr(r) {
|
|
485
485
|
const t = r.length;
|
|
486
486
|
let e = 0, n = 0, a = 0, c = 0, f = 0, l = 0, h = 0;
|
|
487
487
|
const d = /* @__PURE__ */ new Set();
|
|
488
|
-
let
|
|
489
|
-
const
|
|
490
|
-
for (const
|
|
491
|
-
const
|
|
488
|
+
let m = 0;
|
|
489
|
+
const y = /* @__PURE__ */ new Set(), E = /* @__PURE__ */ new Set();
|
|
490
|
+
for (const S of r) {
|
|
491
|
+
const N = cs(S.executedSteps);
|
|
492
492
|
let T = !1;
|
|
493
|
-
for (const L of
|
|
493
|
+
for (const L of N) {
|
|
494
494
|
if (c++, L.retriesLeft && L.retriesLeft !== 0)
|
|
495
495
|
continue;
|
|
496
496
|
a++;
|
|
497
|
-
let
|
|
498
|
-
for (const
|
|
499
|
-
if (n++, !
|
|
500
|
-
switch (
|
|
497
|
+
let W = !1;
|
|
498
|
+
for (const D of L.checks)
|
|
499
|
+
if (n++, !D.passed)
|
|
500
|
+
switch (D.severity) {
|
|
501
501
|
case "warn":
|
|
502
|
-
f++, d.add(
|
|
502
|
+
f++, d.add(S.workflowId), E.add(S.workflowId + ":" + L.stepId);
|
|
503
503
|
break;
|
|
504
504
|
case "off":
|
|
505
|
-
l++,
|
|
505
|
+
l++, y.add(S.workflowId + ":" + L.stepId);
|
|
506
506
|
break;
|
|
507
507
|
default:
|
|
508
|
-
e++,
|
|
508
|
+
e++, W = !0;
|
|
509
509
|
}
|
|
510
|
-
|
|
510
|
+
W && (m++, T = !0);
|
|
511
511
|
}
|
|
512
512
|
T && h++;
|
|
513
513
|
}
|
|
@@ -520,10 +520,10 @@ function Vr(r) {
|
|
|
520
520
|
total: t
|
|
521
521
|
},
|
|
522
522
|
steps: {
|
|
523
|
-
passed: a -
|
|
524
|
-
failed:
|
|
525
|
-
warnings:
|
|
526
|
-
skipped:
|
|
523
|
+
passed: a - m,
|
|
524
|
+
failed: m,
|
|
525
|
+
warnings: E.size,
|
|
526
|
+
skipped: y.size,
|
|
527
527
|
total: a
|
|
528
528
|
},
|
|
529
529
|
checks: {
|
|
@@ -539,21 +539,21 @@ function Vr(r) {
|
|
|
539
539
|
function cs(r) {
|
|
540
540
|
return r.flatMap((t) => "executedSteps" in t ? cs(t.executedSteps) : [t]);
|
|
541
541
|
}
|
|
542
|
-
function
|
|
542
|
+
function ji({ startedAt: r, workflows: t, options: e }) {
|
|
543
543
|
const { logger: n } = e, a = Y.basename(e?.file || ""), c = ar(e?.workflow) || [], f = ar(e?.skip) || [];
|
|
544
|
-
let l = c && c.length ? t.filter(({ workflowId:
|
|
545
|
-
l = f && f.length ? l.filter(({ workflowId:
|
|
546
|
-
const h = Vr(l), d =
|
|
547
|
-
n.printNewLine(), n.output(
|
|
544
|
+
let l = c && c.length ? t.filter(({ workflowId: m }) => c.includes(m)) : t;
|
|
545
|
+
l = f && f.length ? l.filter(({ workflowId: m }) => !f.includes(m)) : l;
|
|
546
|
+
const h = Vr(l), d = Ni(r);
|
|
547
|
+
n.printNewLine(), n.output(No`
|
|
548
548
|
${fr(X(`Summary for ${Re(a)}`, 2))}
|
|
549
549
|
${X("", 2)}
|
|
550
|
-
${X(
|
|
550
|
+
${X(Wi("Workflows:", h.workflows), 2)}
|
|
551
551
|
${X(Bt("Steps:", h.steps), 2)}
|
|
552
552
|
${X(Bt("Checks:", h.checks), 2)}
|
|
553
553
|
${X(Zt(`Time: ${d}`), 2)}
|
|
554
554
|
`), n.printNewLine(), n.printNewLine();
|
|
555
555
|
}
|
|
556
|
-
function
|
|
556
|
+
function Wi(r, t) {
|
|
557
557
|
return ur(r) + (t.passed ? ` ${Yt(t.passed + " passed")},` : "") + (t.failed ? ` ${U(t.failed + " failed")},` : "") + ` ${t.total} total`;
|
|
558
558
|
}
|
|
559
559
|
function Bt(r, t) {
|
|
@@ -569,7 +569,7 @@ const xt = {
|
|
|
569
569
|
NETWORK_ERROR: "error",
|
|
570
570
|
UNEXPECTED_ERROR: "error"
|
|
571
571
|
};
|
|
572
|
-
function
|
|
572
|
+
function qi(r) {
|
|
573
573
|
if (!r)
|
|
574
574
|
return xt;
|
|
575
575
|
const t = Kr(r);
|
|
@@ -585,7 +585,7 @@ function Wi(r) {
|
|
|
585
585
|
function fs(r) {
|
|
586
586
|
return r.flatMap((t) => "executedSteps" in t ? fs(t.executedSteps) : [t]);
|
|
587
587
|
}
|
|
588
|
-
function
|
|
588
|
+
function Ui(r, t) {
|
|
589
589
|
t.output(`${Ze}
|
|
590
590
|
${X(U("Failed tests info:"), 2)}
|
|
591
591
|
`);
|
|
@@ -593,20 +593,20 @@ ${X(U("Failed tests info:"), 2)}
|
|
|
593
593
|
const n = fs(e.executedSteps);
|
|
594
594
|
if (n.some((c) => c.checks.some((f) => !f.passed) && (!c.retriesLeft || c.retriesLeft === 0))) {
|
|
595
595
|
t.output(`${Ze}
|
|
596
|
-
${X(we("Workflow name:"), 2)} ${
|
|
596
|
+
${X(we("Workflow name:"), 2)} ${jo(e.workflowId)}${Ze}
|
|
597
597
|
`);
|
|
598
598
|
for (const c of n) {
|
|
599
599
|
const f = c.checks.filter((l) => !l.passed);
|
|
600
600
|
if (f.length && !(c.retriesLeft && c.retriesLeft !== 0)) {
|
|
601
601
|
t.printNewLine(), t.output(X(`${Re("stepId - ")}`, 4) + (c?.stepId ? U(c.stepId) : U(c?.operationId || c?.operationPath || "")));
|
|
602
602
|
for (const l in f) {
|
|
603
|
-
const { name: h, message: d, severity:
|
|
603
|
+
const { name: h, message: d, severity: m } = f[l], E = [
|
|
604
604
|
V.UNEXPECTED_ERROR,
|
|
605
605
|
V.GLOBAL_TIMEOUT_ERROR,
|
|
606
606
|
V.MAX_STEPS_REACHED_ERROR
|
|
607
|
-
].includes(h) ? X(`Reason: ${d}`, 4) : X(`${
|
|
607
|
+
].includes(h) ? X(`Reason: ${d}`, 4) : X(`${Wo(d)}${Ze}
|
|
608
608
|
`, 6);
|
|
609
|
-
t.printNewLine(),
|
|
609
|
+
t.printNewLine(), m === "error" ? t.output(X(`${U("✗")} ${we(h.toLowerCase())}`, 4)) : m === "off" ? t.output(X(`${we("○")} ${we(h.toLowerCase())} ${we("(skipped)")}`, 4)) : t.output(X(`${fr("⚠")} ${we(h.toLowerCase())}`, 4)), t.printNewLine(), t.output(`${E}`);
|
|
610
610
|
}
|
|
611
611
|
}
|
|
612
612
|
}
|
|
@@ -641,14 +641,14 @@ function Wr(r, t = /* @__PURE__ */ new WeakMap()) {
|
|
|
641
641
|
Object.prototype.hasOwnProperty.call(r, n) && (e[n] = Wr(r[n], t));
|
|
642
642
|
return e;
|
|
643
643
|
}
|
|
644
|
-
const
|
|
644
|
+
const zi = [
|
|
645
645
|
"token",
|
|
646
646
|
"access_token",
|
|
647
647
|
"id_token",
|
|
648
648
|
"password",
|
|
649
649
|
"client_secret"
|
|
650
650
|
];
|
|
651
|
-
function
|
|
651
|
+
function Bi(r, t) {
|
|
652
652
|
const e = (f, l) => f.replace(l, "*".repeat(8));
|
|
653
653
|
if (typeof r == "string") {
|
|
654
654
|
let f = r;
|
|
@@ -667,7 +667,7 @@ function zi(r, t) {
|
|
|
667
667
|
};
|
|
668
668
|
return c(n), n;
|
|
669
669
|
}
|
|
670
|
-
function Mt(r, t =
|
|
670
|
+
function Mt(r, t = zi) {
|
|
671
671
|
const e = [];
|
|
672
672
|
if (!r || typeof r != "object")
|
|
673
673
|
return e;
|
|
@@ -692,18 +692,30 @@ function Mt(r, t = Ui) {
|
|
|
692
692
|
return n(r), e;
|
|
693
693
|
}
|
|
694
694
|
function ge({ value: r, noSecretsMasking: t, secretsSet: e }) {
|
|
695
|
-
return t ? r :
|
|
695
|
+
return t ? r : Bi(r, e);
|
|
696
|
+
}
|
|
697
|
+
function us({ ctx: r, security: t, operation: e }) {
|
|
698
|
+
const { scheme: n, schemeName: a } = t;
|
|
699
|
+
if (n)
|
|
700
|
+
return t.scheme;
|
|
701
|
+
if (a) {
|
|
702
|
+
if (typeof a == "string" && a.startsWith("$sourceDescriptions.")) {
|
|
703
|
+
const [c, f, l] = a.split("."), d = (f && r.$sourceDescriptions[f])?.components?.securitySchemes;
|
|
704
|
+
return l && d ? d[l] : void 0;
|
|
705
|
+
}
|
|
706
|
+
return e?.securitySchemes?.[a];
|
|
707
|
+
}
|
|
696
708
|
}
|
|
697
|
-
function
|
|
709
|
+
function xi(r) {
|
|
698
710
|
const t = r.replace("Digest ", "").split(",").map((a) => a.trim());
|
|
699
711
|
return Object.fromEntries(["realm", "nonce", "opaque", "qop", "algorithm", "cnonce", "nc"].map((a) => [
|
|
700
712
|
a,
|
|
701
713
|
t.find((c) => c.startsWith(`${a}=`))?.split("=")[1]?.replace(/"/g, "")
|
|
702
714
|
]));
|
|
703
715
|
}
|
|
704
|
-
const
|
|
705
|
-
function
|
|
706
|
-
const
|
|
716
|
+
const ls = "MD5", ps = "00000001";
|
|
717
|
+
function Mi({ username: r, password: t, nonce: e, realm: n, cnonce: a, algorithm: c = ls, qop: f, nc: l = ps, opaque: h, uri: d, method: m, bodyContent: y = "" }) {
|
|
718
|
+
const E = {
|
|
707
719
|
username: r,
|
|
708
720
|
password: t,
|
|
709
721
|
realm: n,
|
|
@@ -711,16 +723,16 @@ function xi({ username: r, password: t, nonce: e, realm: n, cnonce: a, algorithm
|
|
|
711
723
|
qop: f,
|
|
712
724
|
opaque: h,
|
|
713
725
|
uri: d,
|
|
714
|
-
method:
|
|
715
|
-
},
|
|
716
|
-
if (
|
|
717
|
-
throw new Error(`Missing required digest auth parameters: ${
|
|
718
|
-
const
|
|
719
|
-
...
|
|
726
|
+
method: m
|
|
727
|
+
}, S = Object.entries(E).filter(([L, W]) => !W).map(([L]) => L);
|
|
728
|
+
if (S.length > 0)
|
|
729
|
+
throw new Error(`Missing required digest auth parameters: ${S.join(", ")}`);
|
|
730
|
+
const N = Vi({
|
|
731
|
+
...E,
|
|
720
732
|
cnonce: a,
|
|
721
733
|
algorithm: c,
|
|
722
734
|
nc: l,
|
|
723
|
-
bodyContent:
|
|
735
|
+
bodyContent: y
|
|
724
736
|
}), T = [
|
|
725
737
|
`username="${r}"`,
|
|
726
738
|
`realm="${n}"`,
|
|
@@ -729,24 +741,24 @@ function xi({ username: r, password: t, nonce: e, realm: n, cnonce: a, algorithm
|
|
|
729
741
|
`qop=${f}`,
|
|
730
742
|
`nc=${l}`,
|
|
731
743
|
`cnonce="${a}"`,
|
|
732
|
-
`response="${
|
|
744
|
+
`response="${N}"`,
|
|
733
745
|
`algorithm=${c}`
|
|
734
746
|
];
|
|
735
747
|
return h && T.push(`opaque="${h}"`), `Digest ${T.join(", ")}`;
|
|
736
748
|
}
|
|
737
|
-
function
|
|
738
|
-
const { username: t, password: e, realm: n, nonce: a, cnonce: c, algorithm: f =
|
|
739
|
-
return me(f)(`${
|
|
749
|
+
function Vi(r) {
|
|
750
|
+
const { username: t, password: e, realm: n, nonce: a, cnonce: c, algorithm: f = ls, qop: l, nc: h = ps, uri: d, method: m, bodyContent: y } = r, E = f.endsWith("-sess") ? me(f)(me(f)(`${t}:${n}:${e}`) + `:${a}:${c}`) : me(f)(`${t}:${n}:${e}`), S = l.includes("auth-int") ? me(f)(`${m}:${d}:${me(f)(y)}`) : me(f)(`${m}:${d}`);
|
|
751
|
+
return me(f)(`${E}:${a}:${h}:${c}:${l}:${S}`);
|
|
740
752
|
}
|
|
741
753
|
function me(r) {
|
|
742
754
|
switch (r.replace("-sess", "").toUpperCase()) {
|
|
743
755
|
case "SHA-256":
|
|
744
|
-
return (e) => Dt(
|
|
756
|
+
return (e) => Dt(Uo(e));
|
|
745
757
|
default:
|
|
746
|
-
return (e) => Dt(
|
|
758
|
+
return (e) => Dt(qo(e));
|
|
747
759
|
}
|
|
748
760
|
}
|
|
749
|
-
function
|
|
761
|
+
function Ki(r) {
|
|
750
762
|
return [
|
|
751
763
|
"application/octet-stream",
|
|
752
764
|
"application/pdf",
|
|
@@ -774,13 +786,13 @@ function Vi(r) {
|
|
|
774
786
|
function je(r) {
|
|
775
787
|
return /^application\/([a-z.-]+\+)?json$/.test(r);
|
|
776
788
|
}
|
|
777
|
-
function
|
|
789
|
+
function Hi(r) {
|
|
778
790
|
return /^application\/([a-z.-]+\+)?xml$/.test(r);
|
|
779
791
|
}
|
|
780
|
-
function
|
|
792
|
+
function Ji(r) {
|
|
781
793
|
return r.endsWith("/") ? r.slice(0, -1) : r;
|
|
782
794
|
}
|
|
783
|
-
class
|
|
795
|
+
class Xi {
|
|
784
796
|
constructor(t) {
|
|
785
797
|
this.initVerboseLogs = ({ headerParams: e, host: n, path: a, method: c, body: f }) => {
|
|
786
798
|
this.verboseLogs = Nr({
|
|
@@ -811,186 +823,190 @@ class Ji {
|
|
|
811
823
|
}, this.getVerboseResponseLogs = () => this.verboseResponseLogs, this.clearVerboseResponseLogs = () => {
|
|
812
824
|
this.verboseResponseLogs = void 0;
|
|
813
825
|
}, this.fetchResult = async ({ ctx: e, step: n, requestData: a, workflowId: c }) => {
|
|
814
|
-
const { serverUrl: f, path: l, method: h, parameters: d, requestBody:
|
|
826
|
+
const { serverUrl: f, path: l, method: h, parameters: d, requestBody: m, openapiOperation: y } = a;
|
|
815
827
|
if (!f?.url)
|
|
816
828
|
throw e.options.logger.error(rr(" No server url provided ")), new Error("No server url provided");
|
|
817
|
-
const
|
|
818
|
-
for (const
|
|
819
|
-
switch (
|
|
829
|
+
const E = {}, S = new URLSearchParams(), N = {}, T = {};
|
|
830
|
+
for (const O of d)
|
|
831
|
+
switch (O.in) {
|
|
820
832
|
case "header":
|
|
821
|
-
|
|
833
|
+
E[O.name.toLowerCase()] = String(O.value);
|
|
822
834
|
break;
|
|
823
835
|
case "query":
|
|
824
|
-
|
|
836
|
+
S.set(O.name, String(O.value));
|
|
825
837
|
break;
|
|
826
838
|
case "path":
|
|
827
|
-
|
|
839
|
+
N[O.name] = String(O.value);
|
|
828
840
|
break;
|
|
829
841
|
case "cookie":
|
|
830
|
-
T[
|
|
842
|
+
T[O.name] = String(O.value);
|
|
831
843
|
break;
|
|
832
844
|
}
|
|
833
|
-
typeof
|
|
834
|
-
const
|
|
835
|
-
|
|
845
|
+
typeof m == "object" && !E["content-type"] && (E["content-type"] = "application/json"), Object.keys(T).length && (E.cookie = Object.entries(T).map(([O, Z]) => `${O}=${Z}`).join("; "));
|
|
846
|
+
const W = `${qt(l, N) || ""}${S.toString() ? "?" + S.toString() : ""}`, D = qt(f.url, N) || "", P = `${Ji(D)}${W}`;
|
|
847
|
+
P.startsWith("/") && e.options.logger.error(rr(` Wrong url: ${Zt(P)} `) + ` Did you forget to provide a correct "serverUrl"?
|
|
836
848
|
`);
|
|
837
|
-
const b =
|
|
838
|
-
|
|
849
|
+
const b = E["content-type"] || "";
|
|
850
|
+
m && !b && e.options.logger.error(rr(" Incorrect request ") + ` Please provide a correct "content-type" header or specify the "content-type" field in the test case itself.
|
|
839
851
|
`);
|
|
840
852
|
let A;
|
|
841
853
|
if (b === "application/x-www-form-urlencoded")
|
|
842
|
-
A = new URLSearchParams(
|
|
854
|
+
A = new URLSearchParams(m).toString();
|
|
843
855
|
else if (je(b || ""))
|
|
844
|
-
A = JSON.stringify(
|
|
845
|
-
else if (
|
|
846
|
-
A =
|
|
856
|
+
A = JSON.stringify(m);
|
|
857
|
+
else if (Hi(b))
|
|
858
|
+
A = m;
|
|
847
859
|
else if (b.includes("multipart/form-data"))
|
|
848
|
-
A =
|
|
860
|
+
A = m, delete E["content-type"];
|
|
849
861
|
else if (b === "application/octet-stream") {
|
|
850
|
-
if (A =
|
|
851
|
-
const
|
|
852
|
-
|
|
862
|
+
if (A = m, m instanceof File) {
|
|
863
|
+
const O = m.name;
|
|
864
|
+
E["content-disposition"] = `attachment; filename=${O}`;
|
|
853
865
|
}
|
|
854
866
|
} else
|
|
855
|
-
A =
|
|
867
|
+
A = m;
|
|
856
868
|
const K = ge({
|
|
857
|
-
value:
|
|
869
|
+
value: E,
|
|
858
870
|
noSecretsMasking: e.noSecretsMasking,
|
|
859
871
|
secretsSet: e.secretsSet
|
|
860
872
|
});
|
|
861
|
-
let
|
|
873
|
+
let F;
|
|
862
874
|
if (A instanceof FormData) {
|
|
863
|
-
const
|
|
875
|
+
const O = new FormData();
|
|
864
876
|
for (const [Z, le] of A.entries())
|
|
865
877
|
if (le instanceof File)
|
|
866
|
-
|
|
878
|
+
O.append(Z, le);
|
|
867
879
|
else {
|
|
868
|
-
const
|
|
880
|
+
const Fe = ge({
|
|
869
881
|
value: le,
|
|
870
882
|
noSecretsMasking: e.noSecretsMasking,
|
|
871
883
|
secretsSet: e.secretsSet
|
|
872
884
|
});
|
|
873
|
-
|
|
885
|
+
O.append(Z, Fe);
|
|
874
886
|
}
|
|
875
|
-
|
|
876
|
-
} else je(b) && A ?
|
|
887
|
+
F = O;
|
|
888
|
+
} else je(b) && A ? F = ge({
|
|
877
889
|
value: JSON.parse(A),
|
|
878
890
|
noSecretsMasking: e.noSecretsMasking,
|
|
879
891
|
secretsSet: e.secretsSet
|
|
880
|
-
}) :
|
|
881
|
-
const
|
|
882
|
-
value:
|
|
892
|
+
}) : F = A;
|
|
893
|
+
const j = ge({
|
|
894
|
+
value: W,
|
|
883
895
|
noSecretsMasking: e.noSecretsMasking,
|
|
884
896
|
secretsSet: e.secretsSet
|
|
885
897
|
});
|
|
886
898
|
this.initVerboseLogs({
|
|
887
899
|
headerParams: K,
|
|
888
|
-
host:
|
|
900
|
+
host: D,
|
|
889
901
|
method: h.toUpperCase(),
|
|
890
|
-
path:
|
|
891
|
-
body:
|
|
902
|
+
path: j || "",
|
|
903
|
+
body: F
|
|
892
904
|
});
|
|
893
905
|
const z = e.options.fetch, x = performance.now();
|
|
894
906
|
let I, B, H;
|
|
895
907
|
const ee = {
|
|
896
908
|
method: h.toUpperCase(),
|
|
897
|
-
headers:
|
|
898
|
-
...!
|
|
909
|
+
headers: E,
|
|
910
|
+
...!Li(m) && {
|
|
899
911
|
body: A
|
|
900
912
|
},
|
|
901
913
|
redirect: "follow",
|
|
902
914
|
signal: AbortSignal.timeout(e.options.maxFetchTimeout),
|
|
903
915
|
// Required for application/octet-stream content type requests
|
|
904
|
-
...
|
|
916
|
+
...E["content-type"] === "application/octet-stream" && {
|
|
905
917
|
duplex: "half"
|
|
906
918
|
}
|
|
907
919
|
}, ne = [
|
|
908
|
-
...e.workflows.find((
|
|
920
|
+
...e.workflows.find((O) => O.workflowId === c)?.["x-security"] || [],
|
|
909
921
|
...n["x-security"] || []
|
|
910
|
-
].reverse().find((
|
|
911
|
-
const Z =
|
|
922
|
+
].reverse().find((O) => {
|
|
923
|
+
const Z = us({
|
|
924
|
+
ctx: e,
|
|
925
|
+
security: O,
|
|
926
|
+
operation: y
|
|
927
|
+
});
|
|
912
928
|
return Z?.type === "http" && Z?.scheme === "digest";
|
|
913
929
|
});
|
|
914
930
|
if (ne) {
|
|
915
|
-
const
|
|
916
|
-
if (
|
|
931
|
+
const O = await z(P, ee), Z = await O.text(), le = O.headers.get("www-authenticate");
|
|
932
|
+
if (O.status !== 401)
|
|
917
933
|
throw this.initVerboseResponseLogs({
|
|
918
934
|
body: Z,
|
|
919
935
|
method: h,
|
|
920
936
|
host: f.url,
|
|
921
|
-
path:
|
|
922
|
-
statusCode:
|
|
937
|
+
path: W || "",
|
|
938
|
+
statusCode: O.status,
|
|
923
939
|
responseTime: 0,
|
|
924
940
|
responseSize: void 0
|
|
925
|
-
}), new es(`Digest auth failed, expected 401 status code, but received ${
|
|
941
|
+
}), new es(`Digest auth failed, expected 401 status code, but received ${O.status} in the first response`);
|
|
926
942
|
if (!le)
|
|
927
943
|
throw this.initVerboseResponseLogs({
|
|
928
944
|
body: Z,
|
|
929
945
|
method: h,
|
|
930
946
|
host: f.url,
|
|
931
|
-
path:
|
|
932
|
-
statusCode:
|
|
947
|
+
path: W || "",
|
|
948
|
+
statusCode: O.status,
|
|
933
949
|
responseTime: 0,
|
|
934
950
|
responseSize: void 0
|
|
935
951
|
}), new rs("Digest auth failed, no www-authenticate header received in the first response");
|
|
936
|
-
const { realm:
|
|
952
|
+
const { realm: Fe, nonce: hr, opaque: gr, qop: mr, algorithm: $r, cnonce: yr, nc: wr } = xi(le), { username: vr, password: Er } = ne.values, kr = new URL(P).pathname + new URL(P).search, Sr = Mi({
|
|
937
953
|
username: vr,
|
|
938
|
-
password:
|
|
939
|
-
realm:
|
|
954
|
+
password: Er,
|
|
955
|
+
realm: Fe,
|
|
940
956
|
nonce: hr,
|
|
941
957
|
opaque: gr,
|
|
942
958
|
qop: mr,
|
|
943
959
|
algorithm: $r,
|
|
944
960
|
cnonce: yr,
|
|
945
961
|
nc: wr,
|
|
946
|
-
uri:
|
|
962
|
+
uri: kr,
|
|
947
963
|
method: h.toUpperCase(),
|
|
948
964
|
bodyContent: JSON.stringify(A) || ""
|
|
949
965
|
}), Ie = {
|
|
950
|
-
...
|
|
966
|
+
...E,
|
|
951
967
|
authorization: Sr
|
|
952
|
-
},
|
|
953
|
-
|
|
968
|
+
}, Ce = e.$workflows[c].steps[n.stepId]?.request;
|
|
969
|
+
Ce && (Ce.header = Ie), this.updateVerboseLogs({
|
|
954
970
|
headerParams: ge({
|
|
955
971
|
value: Ie,
|
|
956
972
|
noSecretsMasking: e.noSecretsMasking,
|
|
957
973
|
secretsSet: e.secretsSet
|
|
958
974
|
})
|
|
959
|
-
}), I = await z(
|
|
975
|
+
}), I = await z(P, {
|
|
960
976
|
...ee,
|
|
961
977
|
headers: Ie
|
|
962
978
|
}), H = Math.ceil(performance.now() - x);
|
|
963
979
|
} else
|
|
964
|
-
I = await z(
|
|
980
|
+
I = await z(P, ee), H = Math.ceil(performance.now() - x);
|
|
965
981
|
if (!I)
|
|
966
982
|
throw new Error("Failed to fetch, no result received");
|
|
967
983
|
const [re] = I.headers.get("content-type")?.split(";") || [
|
|
968
984
|
"application/json"
|
|
969
985
|
];
|
|
970
|
-
|
|
971
|
-
const ue = B ? B instanceof ArrayBuffer ? B : je(re) ? JSON.parse(B) : B : {}, pr =
|
|
986
|
+
Ki(re) ? B = await I.arrayBuffer() : B = await I.text();
|
|
987
|
+
const ue = B ? B instanceof ArrayBuffer ? B : je(re) ? JSON.parse(B) : B : {}, pr = _i({
|
|
972
988
|
statusCode: I.status,
|
|
973
989
|
contentType: re,
|
|
974
|
-
descriptionResponses:
|
|
990
|
+
descriptionResponses: y?.responses
|
|
975
991
|
});
|
|
976
992
|
Be(e, pr, ue);
|
|
977
993
|
const dr = Mt(ue);
|
|
978
|
-
for (const
|
|
979
|
-
e.secretsSet.add(
|
|
994
|
+
for (const O of dr)
|
|
995
|
+
e.secretsSet.add(O);
|
|
980
996
|
const Me = je(re) ? ge({
|
|
981
997
|
value: ue,
|
|
982
998
|
noSecretsMasking: e.noSecretsMasking,
|
|
983
999
|
secretsSet: e.secretsSet
|
|
984
1000
|
}) : ue, Ve = Object.fromEntries(I.headers?.entries() || []), Ke = Mt(Ve);
|
|
985
|
-
for (const
|
|
986
|
-
e.secretsSet.add(
|
|
1001
|
+
for (const O of Ke)
|
|
1002
|
+
e.secretsSet.add(O);
|
|
987
1003
|
let ie;
|
|
988
|
-
const
|
|
989
|
-
return
|
|
1004
|
+
const _e = I.headers.get("content-length");
|
|
1005
|
+
return _e && !isNaN(+_e) ? ie = +_e : B instanceof ArrayBuffer ? ie = B.byteLength : typeof B == "string" ? ie = new TextEncoder().encode(B).length : ie = void 0, this.initVerboseResponseLogs({
|
|
990
1006
|
body: je(re) ? JSON.stringify(Me) : Me,
|
|
991
1007
|
method: h,
|
|
992
1008
|
host: f.url,
|
|
993
|
-
path:
|
|
1009
|
+
path: W || "",
|
|
994
1010
|
statusCode: I.status,
|
|
995
1011
|
responseTime: H,
|
|
996
1012
|
headerParams: ge({
|
|
@@ -1005,13 +1021,13 @@ class Ji {
|
|
|
1005
1021
|
time: H,
|
|
1006
1022
|
header: Object.fromEntries(I.headers?.entries() || []),
|
|
1007
1023
|
contentType: re,
|
|
1008
|
-
requestUrl:
|
|
1024
|
+
requestUrl: P,
|
|
1009
1025
|
responseSize: ie
|
|
1010
1026
|
};
|
|
1011
1027
|
}, this.fetch = t.fetch || fetch;
|
|
1012
1028
|
}
|
|
1013
1029
|
}
|
|
1014
|
-
function
|
|
1030
|
+
function Qi() {
|
|
1015
1031
|
return {
|
|
1016
1032
|
address: {
|
|
1017
1033
|
city: () => J.address.city(),
|
|
@@ -1067,7 +1083,7 @@ function Vt(r) {
|
|
|
1067
1083
|
function Kt(r, t) {
|
|
1068
1084
|
if (!t || Object.keys(t).length === 0)
|
|
1069
1085
|
return {};
|
|
1070
|
-
const e = new
|
|
1086
|
+
const e = new zo({
|
|
1071
1087
|
useDefaults: !0,
|
|
1072
1088
|
removeAdditional: "all",
|
|
1073
1089
|
coerceTypes: !0,
|
|
@@ -1077,52 +1093,53 @@ function Kt(r, t) {
|
|
|
1077
1093
|
const n = e.compile(t), a = { ...r };
|
|
1078
1094
|
return n(a), a;
|
|
1079
1095
|
}
|
|
1080
|
-
function
|
|
1096
|
+
function Gi(r, t) {
|
|
1081
1097
|
return /\.(yaml|yml|json)$/i.test(r) && !!t.arazzo;
|
|
1082
1098
|
}
|
|
1083
|
-
async function
|
|
1099
|
+
async function ds(r) {
|
|
1084
1100
|
const { filePath: t, base: e, externalRefResolver: n, collectSpecData: a, version: c, skipLint: f = !1 } = r;
|
|
1085
1101
|
let l = [];
|
|
1086
1102
|
const h = Y.basename(t);
|
|
1087
1103
|
if (!h)
|
|
1088
1104
|
throw new Error("Invalid file name");
|
|
1089
|
-
const d = await
|
|
1105
|
+
const d = await Bo({
|
|
1090
1106
|
extends: ["recommended-strict"],
|
|
1091
1107
|
arazzo1Rules: {
|
|
1092
1108
|
"no-criteria-xpath": "error",
|
|
1093
1109
|
"respect-supported-versions": "warn",
|
|
1094
1110
|
"no-x-security-scheme-name-without-openapi": "error",
|
|
1095
1111
|
"x-security-scheme-required-values": "error",
|
|
1096
|
-
"
|
|
1112
|
+
"x-security-scheme-name-reference": "error",
|
|
1113
|
+
"no-x-security-both-scheme-and-scheme-name": "error"
|
|
1097
1114
|
}
|
|
1098
1115
|
});
|
|
1099
|
-
if (!f && (l = await
|
|
1116
|
+
if (!f && (l = await xo({
|
|
1100
1117
|
ref: t,
|
|
1101
1118
|
config: d,
|
|
1102
1119
|
externalRefResolver: n
|
|
1103
1120
|
}), l.length)) {
|
|
1104
|
-
const
|
|
1105
|
-
|
|
1106
|
-
totals:
|
|
1121
|
+
const E = Mo(l);
|
|
1122
|
+
Vo(l, {
|
|
1123
|
+
totals: E,
|
|
1107
1124
|
version: c
|
|
1108
|
-
}),
|
|
1125
|
+
}), Ko(E, r.logger);
|
|
1109
1126
|
}
|
|
1110
|
-
const
|
|
1127
|
+
const m = await Gt({
|
|
1111
1128
|
base: e,
|
|
1112
1129
|
ref: t,
|
|
1113
1130
|
config: d,
|
|
1114
1131
|
dereference: !0,
|
|
1115
1132
|
externalRefResolver: n
|
|
1116
1133
|
});
|
|
1117
|
-
if (!
|
|
1134
|
+
if (!m)
|
|
1118
1135
|
throw new Error(`Could not find source description file '${h}'.`);
|
|
1119
|
-
if (!
|
|
1136
|
+
if (!Gi(h, m.bundle.parsed))
|
|
1120
1137
|
throw new Error(`No test files found. File ${h} does not follows naming pattern "*.[yaml | yml | json]" or have not valid "Arazzo" description.`);
|
|
1121
|
-
if (a?.(
|
|
1138
|
+
if (a?.(m.bundle.parsed || {}), l.filter((E) => E.severity === "error").length)
|
|
1122
1139
|
throw new Error(`${U("Found errors in Arazzo description")} ${ur(h)}`);
|
|
1123
|
-
return
|
|
1140
|
+
return m.bundle.parsed || {};
|
|
1124
1141
|
}
|
|
1125
|
-
function
|
|
1142
|
+
function Zi(r, t) {
|
|
1126
1143
|
let e = r;
|
|
1127
1144
|
for (const n of t)
|
|
1128
1145
|
if (e && e[n] !== void 0)
|
|
@@ -1131,55 +1148,55 @@ function Gi(r, t) {
|
|
|
1131
1148
|
return;
|
|
1132
1149
|
return e;
|
|
1133
1150
|
}
|
|
1134
|
-
function
|
|
1151
|
+
function Yi(r) {
|
|
1135
1152
|
const t = {};
|
|
1136
1153
|
for (const e of r)
|
|
1137
1154
|
t[e.stepId] = {};
|
|
1138
1155
|
return t;
|
|
1139
1156
|
}
|
|
1140
|
-
function
|
|
1157
|
+
function ea({ workflows: r, inputs: t, env: e = {} }) {
|
|
1141
1158
|
const n = {};
|
|
1142
1159
|
for (const a of r) {
|
|
1143
|
-
const c = a.inputs, f =
|
|
1160
|
+
const c = a.inputs, f = hs({ inputs: t, workflowInputSchema: c, env: e });
|
|
1144
1161
|
n[a.workflowId] = {
|
|
1145
|
-
steps:
|
|
1162
|
+
steps: Yi(a.steps || []),
|
|
1146
1163
|
inputs: c ? f : void 0,
|
|
1147
1164
|
outputs: a.outputs
|
|
1148
1165
|
};
|
|
1149
1166
|
}
|
|
1150
1167
|
return n;
|
|
1151
1168
|
}
|
|
1152
|
-
function
|
|
1169
|
+
function hs({ inputs: r, workflowInputSchema: t, env: e }) {
|
|
1153
1170
|
let n = {}, a = {};
|
|
1154
1171
|
return t && (n = Kt(r, t)), t?.properties?.env && (a = Kt(e || {}, t.properties.env)), Object.keys(a).length > 0 ? { ...n, env: a } : n;
|
|
1155
1172
|
}
|
|
1156
|
-
const
|
|
1157
|
-
async function
|
|
1173
|
+
const ra = Qi();
|
|
1174
|
+
async function gs(r, t, e) {
|
|
1158
1175
|
const n = r?.sourceDescriptions, a = {};
|
|
1159
1176
|
n && await Promise.all(n.map(async (f) => {
|
|
1160
1177
|
if (f.type === "openapi") {
|
|
1161
|
-
const l = await
|
|
1178
|
+
const l = await Yo({
|
|
1162
1179
|
descriptionPath: f.url,
|
|
1163
1180
|
config: t.config,
|
|
1164
1181
|
base: t.filePath,
|
|
1165
1182
|
externalRefResolver: t?.externalRefResolver
|
|
1166
|
-
}), { paths: h, servers: d, info:
|
|
1183
|
+
}), { paths: h, servers: d, info: m, security: y, components: E } = l;
|
|
1167
1184
|
a[f.name] = {
|
|
1168
1185
|
paths: h,
|
|
1169
1186
|
servers: d,
|
|
1170
|
-
info:
|
|
1171
|
-
security:
|
|
1172
|
-
components:
|
|
1187
|
+
info: m,
|
|
1188
|
+
security: y,
|
|
1189
|
+
components: E
|
|
1173
1190
|
};
|
|
1174
1191
|
} else if (f.type === "arazzo") {
|
|
1175
|
-
const { url: l, name: h } = f, d = Y.resolve(Y.dirname(t.filePath), l),
|
|
1192
|
+
const { url: l, name: h } = f, d = Y.resolve(Y.dirname(t.filePath), l), m = await ds({
|
|
1176
1193
|
filePath: d,
|
|
1177
1194
|
version: t?.version,
|
|
1178
1195
|
logger: t.logger,
|
|
1179
1196
|
externalRefResolver: t?.externalRefResolver,
|
|
1180
1197
|
skipLint: t?.skipLint
|
|
1181
1198
|
});
|
|
1182
|
-
a[h] =
|
|
1199
|
+
a[h] = m;
|
|
1183
1200
|
}
|
|
1184
1201
|
}));
|
|
1185
1202
|
for (const f of r.workflows || [])
|
|
@@ -1189,9 +1206,9 @@ async function hs(r, t, e) {
|
|
|
1189
1206
|
$response: void 0,
|
|
1190
1207
|
$request: void 0,
|
|
1191
1208
|
$inputs: { env: {} },
|
|
1192
|
-
$faker:
|
|
1209
|
+
$faker: ra,
|
|
1193
1210
|
$sourceDescriptions: a,
|
|
1194
|
-
$workflows:
|
|
1211
|
+
$workflows: ea({
|
|
1195
1212
|
workflows: r.workflows || [],
|
|
1196
1213
|
inputs: Kr(t?.input),
|
|
1197
1214
|
env: t.envVariables || {}
|
|
@@ -1203,12 +1220,12 @@ async function hs(r, t, e) {
|
|
|
1203
1220
|
workflows: r.workflows || [],
|
|
1204
1221
|
options: t,
|
|
1205
1222
|
testDescription: r,
|
|
1206
|
-
info: r.info ||
|
|
1223
|
+
info: r.info || Ii,
|
|
1207
1224
|
arazzo: r.arazzo || "",
|
|
1208
1225
|
sourceDescriptions: r.sourceDescriptions || [],
|
|
1209
1226
|
noSecretsMasking: t.noSecretsMasking || !1,
|
|
1210
1227
|
secretsSet: /* @__PURE__ */ new Set(),
|
|
1211
|
-
severity:
|
|
1228
|
+
severity: qi(t.severity),
|
|
1212
1229
|
apiClient: e
|
|
1213
1230
|
};
|
|
1214
1231
|
for (const f of r.workflows || [])
|
|
@@ -1218,22 +1235,22 @@ async function hs(r, t, e) {
|
|
|
1218
1235
|
function Be(r, t, e, n = []) {
|
|
1219
1236
|
if (!t || !e)
|
|
1220
1237
|
return;
|
|
1221
|
-
const a =
|
|
1238
|
+
const a = Zi(e, n);
|
|
1222
1239
|
t.format === "password" && a && r.secretsSet.add(a), t.properties && Object.entries(t.properties).forEach(([c, f]) => {
|
|
1223
1240
|
const l = [...n, c];
|
|
1224
1241
|
Be(r, f, e, l);
|
|
1225
1242
|
});
|
|
1226
1243
|
}
|
|
1227
|
-
function
|
|
1244
|
+
function ta({ workflows: r, workflowsToRun: t, workflowsToSkip: e, logger: n }) {
|
|
1228
1245
|
let a = [];
|
|
1229
|
-
return t && t.length ? a =
|
|
1246
|
+
return t && t.length ? a = na(r, t, n) : e && e.length ? a = sa(r, e, n) : a = r, a;
|
|
1230
1247
|
}
|
|
1231
|
-
function
|
|
1248
|
+
function sa(r, t, e) {
|
|
1232
1249
|
const n = r.filter((a) => !t.includes(a.workflowId));
|
|
1233
1250
|
return n.length ? (e.output(`${fr(`Following workflows are skipped: ${t.join(", ")}`)}`), e.printNewLine(), n) : (e.output(`${U("All workflows are skipped")}`), e.printNewLine(), []);
|
|
1234
1251
|
}
|
|
1235
|
-
function
|
|
1236
|
-
const n =
|
|
1252
|
+
function na(r, t, e) {
|
|
1253
|
+
const n = oa(r, t);
|
|
1237
1254
|
if (!n.length)
|
|
1238
1255
|
throw new Error(`Following workflows don't exist: ${t.join(", ")}`);
|
|
1239
1256
|
if (n.length === t.length)
|
|
@@ -1243,13 +1260,13 @@ function sa(r, t, e) {
|
|
|
1243
1260
|
return e.output(`Following workflows don't exist: ${a.join(", ")}`), n;
|
|
1244
1261
|
}
|
|
1245
1262
|
}
|
|
1246
|
-
function
|
|
1263
|
+
function oa(r, t) {
|
|
1247
1264
|
return r.filter((e) => t.includes(e.workflowId));
|
|
1248
1265
|
}
|
|
1249
|
-
function
|
|
1266
|
+
function ms(r) {
|
|
1250
1267
|
return r.type === "regex";
|
|
1251
1268
|
}
|
|
1252
|
-
function
|
|
1269
|
+
function $s(r) {
|
|
1253
1270
|
const t = r?.type;
|
|
1254
1271
|
return t === "jsonpath" || typeof t == "object" && t?.type === "jsonpath";
|
|
1255
1272
|
}
|
|
@@ -1266,16 +1283,16 @@ const Ht = [
|
|
|
1266
1283
|
"$sourceDescriptions",
|
|
1267
1284
|
"$components"
|
|
1268
1285
|
];
|
|
1269
|
-
function
|
|
1286
|
+
function ia(r) {
|
|
1270
1287
|
r.forEach((t) => {
|
|
1271
1288
|
const { condition: e } = t;
|
|
1272
|
-
if (
|
|
1289
|
+
if (ms(t)) {
|
|
1273
1290
|
const { context: n } = t, a = /\$[a-zA-Z_]\w*/g, c = n.match(a);
|
|
1274
1291
|
if (!c)
|
|
1275
1292
|
throw new Error(`"${n}" does not contain any valid context.`);
|
|
1276
1293
|
if (c.filter((l) => !Ht.includes(l)).length)
|
|
1277
1294
|
throw new Error(`Success criteria context "${n}" is not allowed.`);
|
|
1278
|
-
} else if (
|
|
1295
|
+
} else if ($s(t)) {
|
|
1279
1296
|
if (!t.context)
|
|
1280
1297
|
throw new Error("jsonpath success criteria context is required.");
|
|
1281
1298
|
if (!t.condition)
|
|
@@ -1305,13 +1322,13 @@ function lr({ ctx: r, workflowId: t, step: e }) {
|
|
|
1305
1322
|
$components: r.$components,
|
|
1306
1323
|
$faker: r.$faker
|
|
1307
1324
|
};
|
|
1308
|
-
const n = r.$workflows[t].steps[e.stepId].request, a = n?.path, c = n?.query, f = n?.body || {}, l = n?.header, h = n?.method, d = e.response?.statusCode,
|
|
1325
|
+
const n = r.$workflows[t].steps[e.stepId].request, a = n?.path, c = n?.query, f = n?.body || {}, l = n?.header, h = n?.method, d = e.response?.statusCode, m = e.response?.header || {}, y = e.response?.body || {};
|
|
1309
1326
|
return {
|
|
1310
1327
|
$statusCode: d,
|
|
1311
1328
|
$method: h,
|
|
1312
1329
|
$response: {
|
|
1313
|
-
header:
|
|
1314
|
-
body:
|
|
1330
|
+
header: m,
|
|
1331
|
+
body: y,
|
|
1315
1332
|
path: a,
|
|
1316
1333
|
query: c
|
|
1317
1334
|
},
|
|
@@ -1331,7 +1348,7 @@ function lr({ ctx: r, workflowId: t, step: e }) {
|
|
|
1331
1348
|
$faker: r.$faker
|
|
1332
1349
|
};
|
|
1333
1350
|
}
|
|
1334
|
-
function
|
|
1351
|
+
function aa(r, t) {
|
|
1335
1352
|
function e() {
|
|
1336
1353
|
this.constructor = r;
|
|
1337
1354
|
}
|
|
@@ -1341,7 +1358,7 @@ function Oe(r, t, e, n) {
|
|
|
1341
1358
|
var a = Error.call(this, r);
|
|
1342
1359
|
return Object.setPrototypeOf && Object.setPrototypeOf(a, Oe.prototype), a.expected = t, a.found = e, a.location = n, a.name = "SyntaxError", a;
|
|
1343
1360
|
}
|
|
1344
|
-
|
|
1361
|
+
aa(Oe, Error);
|
|
1345
1362
|
function jr(r, t, e) {
|
|
1346
1363
|
return e = e || " ", r.length > t ? r : (t -= r.length, e += e.repeat(t), r + e.slice(0, t));
|
|
1347
1364
|
}
|
|
@@ -1356,12 +1373,12 @@ Oe.prototype.format = function(r) {
|
|
|
1356
1373
|
}
|
|
1357
1374
|
var a = this.location.start, c = this.location.source && typeof this.location.source.offset == "function" ? this.location.source.offset(a) : a, f = this.location.source + ":" + c.line + ":" + c.column;
|
|
1358
1375
|
if (e) {
|
|
1359
|
-
var l = this.location.end, h = jr("", c.line.toString().length, " "), d = e[a.line - 1],
|
|
1376
|
+
var l = this.location.end, h = jr("", c.line.toString().length, " "), d = e[a.line - 1], m = a.line === l.line ? l.column : d.length + 1, y = m - a.column || 1;
|
|
1360
1377
|
t += `
|
|
1361
1378
|
--> ` + f + `
|
|
1362
1379
|
` + h + ` |
|
|
1363
1380
|
` + c.line + " | " + d + `
|
|
1364
|
-
` + h + " | " + jr("", a.column - 1, " ") + jr("",
|
|
1381
|
+
` + h + " | " + jr("", a.column - 1, " ") + jr("", y, "^");
|
|
1365
1382
|
} else
|
|
1366
1383
|
t += `
|
|
1367
1384
|
at ` + f;
|
|
@@ -1374,10 +1391,10 @@ Oe.buildMessage = function(r, t) {
|
|
|
1374
1391
|
return '"' + a(d.text) + '"';
|
|
1375
1392
|
},
|
|
1376
1393
|
class: function(d) {
|
|
1377
|
-
var
|
|
1378
|
-
return Array.isArray(
|
|
1394
|
+
var m = d.parts.map(function(y) {
|
|
1395
|
+
return Array.isArray(y) ? c(y[0]) + "-" + c(y[1]) : c(y);
|
|
1379
1396
|
});
|
|
1380
|
-
return "[" + (d.inverted ? "^" : "") +
|
|
1397
|
+
return "[" + (d.inverted ? "^" : "") + m.join("") + "]";
|
|
1381
1398
|
},
|
|
1382
1399
|
any: function() {
|
|
1383
1400
|
return "any character";
|
|
@@ -1393,36 +1410,36 @@ Oe.buildMessage = function(r, t) {
|
|
|
1393
1410
|
return d.charCodeAt(0).toString(16).toUpperCase();
|
|
1394
1411
|
}
|
|
1395
1412
|
function a(d) {
|
|
1396
|
-
return d.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/\0/g, "\\0").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/[\x00-\x0F]/g, function(
|
|
1397
|
-
return "\\x0" + n(
|
|
1398
|
-
}).replace(/[\x10-\x1F\x7F-\x9F]/g, function(
|
|
1399
|
-
return "\\x" + n(
|
|
1413
|
+
return d.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/\0/g, "\\0").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/[\x00-\x0F]/g, function(m) {
|
|
1414
|
+
return "\\x0" + n(m);
|
|
1415
|
+
}).replace(/[\x10-\x1F\x7F-\x9F]/g, function(m) {
|
|
1416
|
+
return "\\x" + n(m);
|
|
1400
1417
|
});
|
|
1401
1418
|
}
|
|
1402
1419
|
function c(d) {
|
|
1403
|
-
return d.replace(/\\/g, "\\\\").replace(/\]/g, "\\]").replace(/\^/g, "\\^").replace(/-/g, "\\-").replace(/\0/g, "\\0").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/[\x00-\x0F]/g, function(
|
|
1404
|
-
return "\\x0" + n(
|
|
1405
|
-
}).replace(/[\x10-\x1F\x7F-\x9F]/g, function(
|
|
1406
|
-
return "\\x" + n(
|
|
1420
|
+
return d.replace(/\\/g, "\\\\").replace(/\]/g, "\\]").replace(/\^/g, "\\^").replace(/-/g, "\\-").replace(/\0/g, "\\0").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/[\x00-\x0F]/g, function(m) {
|
|
1421
|
+
return "\\x0" + n(m);
|
|
1422
|
+
}).replace(/[\x10-\x1F\x7F-\x9F]/g, function(m) {
|
|
1423
|
+
return "\\x" + n(m);
|
|
1407
1424
|
});
|
|
1408
1425
|
}
|
|
1409
1426
|
function f(d) {
|
|
1410
1427
|
return e[d.type](d);
|
|
1411
1428
|
}
|
|
1412
1429
|
function l(d) {
|
|
1413
|
-
var
|
|
1414
|
-
if (
|
|
1415
|
-
for (
|
|
1416
|
-
|
|
1417
|
-
|
|
1430
|
+
var m = d.map(f), y, E;
|
|
1431
|
+
if (m.sort(), m.length > 0) {
|
|
1432
|
+
for (y = 1, E = 1; y < m.length; y++)
|
|
1433
|
+
m[y - 1] !== m[y] && (m[E] = m[y], E++);
|
|
1434
|
+
m.length = E;
|
|
1418
1435
|
}
|
|
1419
|
-
switch (
|
|
1436
|
+
switch (m.length) {
|
|
1420
1437
|
case 1:
|
|
1421
|
-
return
|
|
1438
|
+
return m[0];
|
|
1422
1439
|
case 2:
|
|
1423
|
-
return
|
|
1440
|
+
return m[0] + " or " + m[1];
|
|
1424
1441
|
default:
|
|
1425
|
-
return
|
|
1442
|
+
return m.slice(0, -1).join(", ") + ", or " + m[m.length - 1];
|
|
1426
1443
|
}
|
|
1427
1444
|
}
|
|
1428
1445
|
function h(d) {
|
|
@@ -1430,42 +1447,42 @@ Oe.buildMessage = function(r, t) {
|
|
|
1430
1447
|
}
|
|
1431
1448
|
return "Expected " + l(r) + " but " + h(t) + " found.";
|
|
1432
1449
|
};
|
|
1433
|
-
function
|
|
1450
|
+
function ca(r, t) {
|
|
1434
1451
|
t = t !== void 0 ? t : {};
|
|
1435
|
-
var e = {}, n = t.grammarSource, a = { jsonpath_query: Rr }, c = Rr, f = "$", l = ".", h = "..", d = "[",
|
|
1436
|
-
`], "\r", " "], !1, !1),
|
|
1452
|
+
var e = {}, n = t.grammarSource, a = { jsonpath_query: Rr }, c = Rr, f = "$", l = ".", h = "..", d = "[", m = ",", y = "]", E = "*", S = ":", N = "?", T = '"', L = "'", W = "0", D = "-", P = "||", b = "\\", A = "u", K = "&&", F = "d", j = "(", z = ")", x = "!", I = "==", B = "!=", H = "<=", ee = ">=", he = "-0", ne = "true", re = "false", ue = "null", pr = "@", dr = "e", Me = /^[\t-\n\r ]/, Ve = /^[A-Z_a-z\x80-\uD7FF\uE000-\uFFFF]/, Ke = /^[\uD800-\uDBFF]/, ie = /^[\uDC00-\uDFFF]/, _e = /^[0-9]/, O = /^[1-9]/, Z = /^[ -!#-&(-[\]-\uD7FF\uE000-\uFFFF]/, le = /^[\/\\bfnrt]/, Fe = /^[A-CE-F]/i, hr = /^[0-7]/, gr = /^[8-9]/, mr = /^[A-B]/i, $r = /^[C-F]/i, yr = /^[A-F]/i, wr = /^[<>]/, vr = /^[0-9_a-z]/, Er = /^[+\-]/, kr = /^[a-z]/, Sr = _("$", !1), Ie = M([[" ", `
|
|
1453
|
+
`], "\r", " "], !1, !1), Ce = _(".", !1), Ls = _("..", !1), br = _("[", !1), He = _(",", !1), Cr = _("]", !1), Ns = _("*", !1), js = M([["A", "Z"], "_", ["a", "z"], ["", ""], ["", ""]], !1, !1), Jr = M([["\uD800", "\uDBFF"]], !1, !1), Xr = M([["\uDC00", "\uDFFF"]], !1, !1), Qr = _(":", !1), Ws = _("?", !1), qs = M([["0", "9"]], !1, !1), Je = _('"', !1), Xe = _("'", !1), Us = _("0", !1), zs = _("-", !1), Bs = M([["1", "9"]], !1, !1), Gr = _("||", !1), xs = M([[" ", "!"], ["#", "&"], ["(", "["], ["]", ""], ["", ""]], !1, !1), Zr = _("\\", !1), Ms = M(["/", "\\", "b", "f", "n", "r", "t"], !1, !1), Yr = _("u", !1), et = _("&&", !1), Vs = M([["A", "C"], ["E", "F"]], !1, !0), Ar = _("D", !0), Ks = M([["0", "7"]], !1, !1), Hs = M([["8", "9"]], !1, !1), Js = M([["A", "B"]], !1, !0), Xs = M([["C", "F"]], !1, !0), rt = _("(", !1), tt = _(")", !1), Qs = M([["A", "F"]], !1, !0), Gs = _("!", !1), Zs = _("==", !1), Ys = _("!=", !1), en = _("<=", !1), rn = _(">=", !1), tn = M(["<", ">"], !1, !1), sn = _("-0", !1), nn = _("true", !1), on = _("false", !1), an = _("null", !1), cn = _("@", !1), fn = M([["0", "9"], "_", ["a", "z"]], !1, !1), un = _("e", !0), ln = M(["+", "-"], !1, !1), pn = M([["a", "z"]], !1, !1), dn = function(s) {
|
|
1437
1454
|
return {
|
|
1438
1455
|
type: "JsonPathQuery",
|
|
1439
1456
|
segments: s
|
|
1440
1457
|
};
|
|
1441
1458
|
}, st = function(s) {
|
|
1442
1459
|
return s;
|
|
1443
|
-
}, dn = function(s) {
|
|
1444
|
-
return s;
|
|
1445
1460
|
}, hn = function(s) {
|
|
1446
|
-
return
|
|
1461
|
+
return s;
|
|
1447
1462
|
}, gn = function(s) {
|
|
1463
|
+
return { type: "ChildSegment", node: s };
|
|
1464
|
+
}, mn = function(s) {
|
|
1448
1465
|
return { type: "DescendantSegment", node: s };
|
|
1449
1466
|
}, nt = function(s, o) {
|
|
1450
1467
|
return o;
|
|
1451
|
-
},
|
|
1468
|
+
}, $n = function(s, o) {
|
|
1452
1469
|
return [s, ...o];
|
|
1453
|
-
},
|
|
1470
|
+
}, yn = function(s) {
|
|
1454
1471
|
return {
|
|
1455
1472
|
type: "BracketedSelection",
|
|
1456
1473
|
selectors: s
|
|
1457
1474
|
};
|
|
1458
|
-
},
|
|
1475
|
+
}, wn = function() {
|
|
1459
1476
|
return { type: "WildcardSelector" };
|
|
1460
|
-
}, wn = function(s) {
|
|
1461
|
-
return { type: "MemberNameShorthand", value: s };
|
|
1462
1477
|
}, vn = function(s) {
|
|
1478
|
+
return { type: "MemberNameShorthand", value: s };
|
|
1479
|
+
}, En = function(s) {
|
|
1463
1480
|
return { type: "NameSelector", value: s };
|
|
1464
1481
|
}, kn = function(s, o, u) {
|
|
1465
1482
|
return u;
|
|
1466
|
-
},
|
|
1483
|
+
}, Sn = function(s, o, u) {
|
|
1467
1484
|
return { start: s, end: o, step: u };
|
|
1468
|
-
},
|
|
1485
|
+
}, bn = function(s) {
|
|
1469
1486
|
return {
|
|
1470
1487
|
type: "SliceSelector",
|
|
1471
1488
|
start: s.start === "" ? null : Number.parseInt(s.start.trim(), 10),
|
|
@@ -1474,17 +1491,17 @@ function aa(r, t) {
|
|
|
1474
1491
|
};
|
|
1475
1492
|
}, Cn = function(s) {
|
|
1476
1493
|
return { type: "IndexSelector", value: Number.parseInt(s, 10) };
|
|
1477
|
-
}, bn = function(s) {
|
|
1478
|
-
return { type: "FilterSelector", value: s };
|
|
1479
1494
|
}, An = function(s) {
|
|
1480
|
-
return s;
|
|
1495
|
+
return { type: "FilterSelector", value: s };
|
|
1481
1496
|
}, Rn = function(s) {
|
|
1482
1497
|
return s;
|
|
1483
1498
|
}, On = function(s) {
|
|
1499
|
+
return s;
|
|
1500
|
+
}, Tn = function(s) {
|
|
1484
1501
|
return s.join("");
|
|
1485
|
-
},
|
|
1502
|
+
}, Pn = function() {
|
|
1486
1503
|
return '"';
|
|
1487
|
-
},
|
|
1504
|
+
}, _n = function(s) {
|
|
1488
1505
|
switch (s) {
|
|
1489
1506
|
case "b":
|
|
1490
1507
|
return "\b";
|
|
@@ -1506,7 +1523,7 @@ function aa(r, t) {
|
|
|
1506
1523
|
}
|
|
1507
1524
|
}, Fn = function() {
|
|
1508
1525
|
return "'";
|
|
1509
|
-
},
|
|
1526
|
+
}, In = function(s) {
|
|
1510
1527
|
switch (s) {
|
|
1511
1528
|
case "b":
|
|
1512
1529
|
return "\b";
|
|
@@ -1528,7 +1545,7 @@ function aa(r, t) {
|
|
|
1528
1545
|
}
|
|
1529
1546
|
}, ot = function(s, o) {
|
|
1530
1547
|
return o;
|
|
1531
|
-
},
|
|
1548
|
+
}, Dn = function(s, o) {
|
|
1532
1549
|
return o.length === 0 ? s : {
|
|
1533
1550
|
type: "LogicalOrExpr",
|
|
1534
1551
|
left: s,
|
|
@@ -1540,9 +1557,9 @@ function aa(r, t) {
|
|
|
1540
1557
|
};
|
|
1541
1558
|
}, it = function(s, o) {
|
|
1542
1559
|
return o;
|
|
1543
|
-
},
|
|
1560
|
+
}, Ln = function(s, o) {
|
|
1544
1561
|
return [s, ...o];
|
|
1545
|
-
},
|
|
1562
|
+
}, Nn = function(s) {
|
|
1546
1563
|
return s.length === 1 ? s[0] : {
|
|
1547
1564
|
type: "LogicalAndExpr",
|
|
1548
1565
|
left: s[0],
|
|
@@ -1552,25 +1569,25 @@ function aa(r, t) {
|
|
|
1552
1569
|
right: u
|
|
1553
1570
|
}), s[1])
|
|
1554
1571
|
};
|
|
1555
|
-
},
|
|
1556
|
-
return String.fromCharCode(Number.parseInt(
|
|
1557
|
-
},
|
|
1572
|
+
}, jn = function() {
|
|
1573
|
+
return String.fromCharCode(Number.parseInt(no(), 16));
|
|
1574
|
+
}, Wn = function(s, o) {
|
|
1558
1575
|
return String.fromCharCode(Number.parseInt(s, 16)) + String.fromCharCode(Number.parseInt(o, 16));
|
|
1559
|
-
},
|
|
1576
|
+
}, qn = function(s) {
|
|
1560
1577
|
return s;
|
|
1561
|
-
},
|
|
1578
|
+
}, Un = function(s, o) {
|
|
1562
1579
|
return s !== null ? {
|
|
1563
1580
|
type: "LogicalNotExpr",
|
|
1564
1581
|
expression: o
|
|
1565
1582
|
} : o;
|
|
1566
|
-
},
|
|
1583
|
+
}, zn = function(s, o, u) {
|
|
1567
1584
|
return {
|
|
1568
1585
|
type: "ComparisonExpr",
|
|
1569
1586
|
left: s,
|
|
1570
1587
|
op: o,
|
|
1571
1588
|
right: u
|
|
1572
1589
|
};
|
|
1573
|
-
},
|
|
1590
|
+
}, Bn = function(s, o) {
|
|
1574
1591
|
return s !== null ? {
|
|
1575
1592
|
type: "LogicalNotExpr",
|
|
1576
1593
|
expression: {
|
|
@@ -1581,63 +1598,63 @@ function aa(r, t) {
|
|
|
1581
1598
|
type: "TestExpr",
|
|
1582
1599
|
expression: o
|
|
1583
1600
|
};
|
|
1584
|
-
},
|
|
1601
|
+
}, xn = function(s) {
|
|
1585
1602
|
return { type: "FilterQuery", value: s };
|
|
1586
1603
|
}, at = function(s, o, u) {
|
|
1587
1604
|
return u;
|
|
1588
|
-
},
|
|
1605
|
+
}, Mn = function(s, o, u) {
|
|
1589
1606
|
return [o, ...u];
|
|
1590
|
-
},
|
|
1607
|
+
}, Vn = function(s, o) {
|
|
1591
1608
|
return {
|
|
1592
1609
|
type: "FunctionExpr",
|
|
1593
1610
|
name: s,
|
|
1594
1611
|
arguments: o
|
|
1595
1612
|
};
|
|
1596
|
-
}, Vn = function(s) {
|
|
1597
|
-
return { type: "Literal", value: s };
|
|
1598
1613
|
}, Kn = function(s) {
|
|
1599
|
-
return { type: "
|
|
1614
|
+
return { type: "Literal", value: s };
|
|
1600
1615
|
}, Hn = function(s) {
|
|
1616
|
+
return { type: "RelQuery", segments: s };
|
|
1617
|
+
}, Jn = function(s) {
|
|
1601
1618
|
return Number(s);
|
|
1602
|
-
}, Jn = function() {
|
|
1603
|
-
return !0;
|
|
1604
1619
|
}, Xn = function() {
|
|
1605
|
-
return !
|
|
1620
|
+
return !0;
|
|
1606
1621
|
}, Qn = function() {
|
|
1622
|
+
return !1;
|
|
1623
|
+
}, Gn = function() {
|
|
1607
1624
|
return null;
|
|
1608
|
-
}, Gn = function(s) {
|
|
1609
|
-
return { type: "RelSingularQuery", segments: s };
|
|
1610
1625
|
}, Zn = function(s) {
|
|
1626
|
+
return { type: "RelSingularQuery", segments: s };
|
|
1627
|
+
}, Yn = function(s) {
|
|
1611
1628
|
return { type: "AbsSingularQuery", segments: s };
|
|
1612
1629
|
}, ct = function(s) {
|
|
1613
1630
|
return {
|
|
1614
1631
|
type: "SingularQuerySegment",
|
|
1615
1632
|
node: s
|
|
1616
1633
|
};
|
|
1617
|
-
}, Yn = function(s) {
|
|
1618
|
-
return s;
|
|
1619
1634
|
}, eo = function(s) {
|
|
1620
1635
|
return s;
|
|
1621
1636
|
}, ro = function(s) {
|
|
1622
1637
|
return s;
|
|
1623
1638
|
}, to = function(s) {
|
|
1639
|
+
return s;
|
|
1640
|
+
}, so = function(s) {
|
|
1624
1641
|
return { type: "IndexSelector", selector: s };
|
|
1625
|
-
}, i = t.peg$currPos | 0,
|
|
1642
|
+
}, i = t.peg$currPos | 0, k = i, Ae = [{ line: 1, column: 1 }], te = i, Qe = t.peg$maxFailExpected || [], v = t.peg$silentFails | 0, De;
|
|
1626
1643
|
if (t.startRule) {
|
|
1627
1644
|
if (!(t.startRule in a))
|
|
1628
1645
|
throw new Error(`Can't start parsing from rule "` + t.startRule + '".');
|
|
1629
1646
|
c = a[t.startRule];
|
|
1630
1647
|
}
|
|
1631
|
-
function
|
|
1632
|
-
return r.substring(
|
|
1648
|
+
function no() {
|
|
1649
|
+
return r.substring(k, i);
|
|
1633
1650
|
}
|
|
1634
|
-
function
|
|
1651
|
+
function _(s, o) {
|
|
1635
1652
|
return { type: "literal", text: s, ignoreCase: o };
|
|
1636
1653
|
}
|
|
1637
1654
|
function M(s, o, u) {
|
|
1638
1655
|
return { type: "class", parts: s, inverted: o, ignoreCase: u };
|
|
1639
1656
|
}
|
|
1640
|
-
function
|
|
1657
|
+
function oo() {
|
|
1641
1658
|
return { type: "end" };
|
|
1642
1659
|
}
|
|
1643
1660
|
function ft(s) {
|
|
@@ -1657,7 +1674,7 @@ function aa(r, t) {
|
|
|
1657
1674
|
return Ae[s] = o, o;
|
|
1658
1675
|
}
|
|
1659
1676
|
function ut(s, o, u) {
|
|
1660
|
-
var p = ft(s),
|
|
1677
|
+
var p = ft(s), g = ft(o), $ = {
|
|
1661
1678
|
source: n,
|
|
1662
1679
|
start: {
|
|
1663
1680
|
offset: s,
|
|
@@ -1666,8 +1683,8 @@ function aa(r, t) {
|
|
|
1666
1683
|
},
|
|
1667
1684
|
end: {
|
|
1668
1685
|
offset: o,
|
|
1669
|
-
line:
|
|
1670
|
-
column:
|
|
1686
|
+
line: g.line,
|
|
1687
|
+
column: g.column
|
|
1671
1688
|
}
|
|
1672
1689
|
};
|
|
1673
1690
|
return $;
|
|
@@ -1675,12 +1692,12 @@ function aa(r, t) {
|
|
|
1675
1692
|
function w(s) {
|
|
1676
1693
|
i < te || (i > te && (te = i, Qe = []), Qe.push(s));
|
|
1677
1694
|
}
|
|
1678
|
-
function
|
|
1695
|
+
function io(s, o, u) {
|
|
1679
1696
|
return new Oe(Oe.buildMessage(s, o), s, o, u);
|
|
1680
1697
|
}
|
|
1681
1698
|
function Rr() {
|
|
1682
1699
|
var s, o, u;
|
|
1683
|
-
return s = i, o = lt(), o !== e ? (u = pt(),
|
|
1700
|
+
return s = i, o = lt(), o !== e ? (u = pt(), k = s, s = dn(u)) : (i = s, s = e), s;
|
|
1684
1701
|
}
|
|
1685
1702
|
function lt() {
|
|
1686
1703
|
var s;
|
|
@@ -1688,11 +1705,11 @@ function aa(r, t) {
|
|
|
1688
1705
|
}
|
|
1689
1706
|
function pt() {
|
|
1690
1707
|
var s, o, u;
|
|
1691
|
-
for (s = [], o = i,
|
|
1692
|
-
s.push(o), o = i,
|
|
1708
|
+
for (s = [], o = i, R(), u = dt(), u !== e ? (k = o, o = st(u)) : (i = o, o = e); o !== e; )
|
|
1709
|
+
s.push(o), o = i, R(), u = dt(), u !== e ? (k = o, o = st(u)) : (i = o, o = e);
|
|
1693
1710
|
return s;
|
|
1694
1711
|
}
|
|
1695
|
-
function
|
|
1712
|
+
function R() {
|
|
1696
1713
|
var s, o;
|
|
1697
1714
|
for (s = [], o = ht(); o !== e; )
|
|
1698
1715
|
s.push(o), o = ht();
|
|
@@ -1700,55 +1717,55 @@ function aa(r, t) {
|
|
|
1700
1717
|
}
|
|
1701
1718
|
function dt() {
|
|
1702
1719
|
var s;
|
|
1703
|
-
return s =
|
|
1720
|
+
return s = ao(), s === e && (s = co()), s;
|
|
1704
1721
|
}
|
|
1705
1722
|
function ht() {
|
|
1706
1723
|
var s;
|
|
1707
1724
|
return s = r.charAt(i), Me.test(s) ? i++ : (s = e, v === 0 && w(Ie)), s;
|
|
1708
1725
|
}
|
|
1709
|
-
function
|
|
1726
|
+
function ao() {
|
|
1710
1727
|
var s, o, u, p;
|
|
1711
|
-
return s = i, o = gt(), o === e && (o = i, r.charCodeAt(i) === 46 ? (u = l, i++) : (u = e, v === 0 && w(
|
|
1728
|
+
return s = i, o = gt(), o === e && (o = i, r.charCodeAt(i) === 46 ? (u = l, i++) : (u = e, v === 0 && w(Ce)), u !== e ? (p = Or(), p === e && (p = Tr()), p !== e ? (k = o, o = hn(p)) : (i = o, o = e)) : (i = o, o = e)), o !== e && (k = s, o = gn(o)), s = o, s;
|
|
1712
1729
|
}
|
|
1713
|
-
function
|
|
1730
|
+
function co() {
|
|
1714
1731
|
var s, o, u;
|
|
1715
|
-
return s = i, r.substr(i, 2) === h ? (o = h, i += 2) : (o = e, v === 0 && w(
|
|
1732
|
+
return s = i, r.substr(i, 2) === h ? (o = h, i += 2) : (o = e, v === 0 && w(Ls)), o !== e ? (u = gt(), u === e && (u = Or(), u === e && (u = Tr())), u !== e ? (k = s, s = mn(u)) : (i = s, s = e)) : (i = s, s = e), s;
|
|
1716
1733
|
}
|
|
1717
1734
|
function gt() {
|
|
1718
|
-
var s, o, u, p,
|
|
1719
|
-
if (s = i, r.charCodeAt(i) === 91 ? (o = d, i++) : (o = e, v === 0 && w(
|
|
1720
|
-
if (u = i,
|
|
1721
|
-
for (
|
|
1722
|
-
|
|
1723
|
-
|
|
1735
|
+
var s, o, u, p, g, $, C, q;
|
|
1736
|
+
if (s = i, r.charCodeAt(i) === 91 ? (o = d, i++) : (o = e, v === 0 && w(br)), o !== e) {
|
|
1737
|
+
if (u = i, R(), p = Pr(), p !== e) {
|
|
1738
|
+
for (g = [], $ = i, R(), r.charCodeAt(i) === 44 ? (C = m, i++) : (C = e, v === 0 && w(He)), C !== e ? (R(), q = Pr(), q !== e ? (k = $, $ = nt(p, q)) : (i = $, $ = e)) : (i = $, $ = e); $ !== e; )
|
|
1739
|
+
g.push($), $ = i, R(), r.charCodeAt(i) === 44 ? (C = m, i++) : (C = e, v === 0 && w(He)), C !== e ? (R(), q = Pr(), q !== e ? (k = $, $ = nt(p, q)) : (i = $, $ = e)) : (i = $, $ = e);
|
|
1740
|
+
k = u, u = $n(p, g);
|
|
1724
1741
|
} else
|
|
1725
1742
|
i = u, u = e;
|
|
1726
|
-
u !== e ? (
|
|
1743
|
+
u !== e ? (R(), r.charCodeAt(i) === 93 ? (p = y, i++) : (p = e, v === 0 && w(Cr)), p !== e ? (k = s, s = yn(u)) : (i = s, s = e)) : (i = s, s = e);
|
|
1727
1744
|
} else
|
|
1728
1745
|
i = s, s = e;
|
|
1729
1746
|
return s;
|
|
1730
1747
|
}
|
|
1731
1748
|
function Or() {
|
|
1732
1749
|
var s, o;
|
|
1733
|
-
return s = i, r.charCodeAt(i) === 42 ? (o =
|
|
1750
|
+
return s = i, r.charCodeAt(i) === 42 ? (o = E, i++) : (o = e, v === 0 && w(Ns)), o !== e && (k = s, o = wn()), s = o, s;
|
|
1734
1751
|
}
|
|
1735
1752
|
function Tr() {
|
|
1736
|
-
var s, o, u, p,
|
|
1753
|
+
var s, o, u, p, g, $;
|
|
1737
1754
|
if (s = i, o = i, u = i, p = mt(), p !== e) {
|
|
1738
|
-
for (
|
|
1739
|
-
|
|
1740
|
-
p = [p,
|
|
1755
|
+
for (g = [], $ = $t(); $ !== e; )
|
|
1756
|
+
g.push($), $ = $t();
|
|
1757
|
+
p = [p, g], u = p;
|
|
1741
1758
|
} else
|
|
1742
1759
|
i = u, u = e;
|
|
1743
|
-
return u !== e ? o = r.substring(o, i) : o = u, o !== e && (
|
|
1760
|
+
return u !== e ? o = r.substring(o, i) : o = u, o !== e && (k = s, o = vn(o)), s = o, s;
|
|
1744
1761
|
}
|
|
1745
1762
|
function Pr() {
|
|
1746
1763
|
var s;
|
|
1747
|
-
return s = yt(), s === e && (s = Or(), s === e && (s =
|
|
1764
|
+
return s = yt(), s === e && (s = Or(), s === e && (s = fo(), s === e && (s = wt(), s === e && (s = uo())))), s;
|
|
1748
1765
|
}
|
|
1749
1766
|
function mt() {
|
|
1750
1767
|
var s, o, u;
|
|
1751
|
-
return s = r.charAt(i), Ve.test(s) ? i++ : (s = e, v === 0 && w(
|
|
1768
|
+
return s = r.charAt(i), Ve.test(s) ? i++ : (s = e, v === 0 && w(js)), s === e && (s = i, o = r.charAt(i), Ke.test(o) ? i++ : (o = e, v === 0 && w(Jr)), o !== e ? (u = r.charAt(i), ie.test(u) ? i++ : (u = e, v === 0 && w(Xr)), u !== e ? (o = [o, u], s = o) : (i = s, s = e)) : (i = s, s = e)), s;
|
|
1752
1769
|
}
|
|
1753
1770
|
function $t() {
|
|
1754
1771
|
var s;
|
|
@@ -1756,193 +1773,193 @@ function aa(r, t) {
|
|
|
1756
1773
|
}
|
|
1757
1774
|
function yt() {
|
|
1758
1775
|
var s, o;
|
|
1759
|
-
return s = i, o = vt(), o !== e && (
|
|
1776
|
+
return s = i, o = vt(), o !== e && (k = s, o = En(o)), s = o, s;
|
|
1760
1777
|
}
|
|
1761
|
-
function
|
|
1762
|
-
var s, o, u, p,
|
|
1763
|
-
return s = i, o = i, u = i, p = i,
|
|
1778
|
+
function fo() {
|
|
1779
|
+
var s, o, u, p, g, $, C, q, G;
|
|
1780
|
+
return s = i, o = i, u = i, p = i, g = Le(), g !== e ? ($ = R(), g = [g, $], p = g) : (i = p, p = e), p === e && (p = null), u = r.substring(u, i), r.charCodeAt(i) === 58 ? (p = S, i++) : (p = e, v === 0 && w(Qr)), p !== e ? (g = R(), $ = i, C = i, q = Le(), q !== e ? (G = R(), q = [q, G], C = q) : (i = C, C = e), C === e && (C = null), $ = r.substring($, i), C = i, r.charCodeAt(i) === 58 ? (q = S, i++) : (q = e, v === 0 && w(Qr)), q !== e ? (G = i, R(), Le(), G = r.substring(G, i), k = C, C = kn(u, $, G)) : (i = C, C = e), C === e && (C = null), k = o, o = Sn(u, $, C)) : (i = o, o = e), o !== e && (k = s, o = bn(o)), s = o, s;
|
|
1764
1781
|
}
|
|
1765
1782
|
function wt() {
|
|
1766
1783
|
var s, o, u;
|
|
1767
|
-
return s = i, o = i, u = Le(), u !== e ? o = r.substring(o, i) : o = u, o !== e && (
|
|
1784
|
+
return s = i, o = i, u = Le(), u !== e ? o = r.substring(o, i) : o = u, o !== e && (k = s, o = Cn(o)), s = o, s;
|
|
1768
1785
|
}
|
|
1769
|
-
function
|
|
1786
|
+
function uo() {
|
|
1770
1787
|
var s, o, u;
|
|
1771
|
-
return s = i, r.charCodeAt(i) === 63 ? (o =
|
|
1788
|
+
return s = i, r.charCodeAt(i) === 63 ? (o = N, i++) : (o = e, v === 0 && w(Ws)), o !== e ? (R(), u = _r(), u !== e ? (k = s, s = An(u)) : (i = s, s = e)) : (i = s, s = e), s;
|
|
1772
1789
|
}
|
|
1773
1790
|
function ae() {
|
|
1774
1791
|
var s;
|
|
1775
|
-
return s = r.charAt(i),
|
|
1792
|
+
return s = r.charAt(i), _e.test(s) ? i++ : (s = e, v === 0 && w(qs)), s;
|
|
1776
1793
|
}
|
|
1777
1794
|
function vt() {
|
|
1778
|
-
var s, o, u, p,
|
|
1795
|
+
var s, o, u, p, g;
|
|
1779
1796
|
if (s = i, o = i, r.charCodeAt(i) === 34 ? (u = T, i++) : (u = e, v === 0 && w(Je)), u !== e) {
|
|
1780
|
-
for (p = [],
|
|
1781
|
-
p.push(
|
|
1782
|
-
r.charCodeAt(i) === 34 ? (
|
|
1797
|
+
for (p = [], g = Et(); g !== e; )
|
|
1798
|
+
p.push(g), g = Et();
|
|
1799
|
+
r.charCodeAt(i) === 34 ? (g = T, i++) : (g = e, v === 0 && w(Je)), g !== e ? (k = o, o = Rn(p)) : (i = o, o = e);
|
|
1783
1800
|
} else
|
|
1784
1801
|
i = o, o = e;
|
|
1785
1802
|
if (o === e)
|
|
1786
1803
|
if (o = i, r.charCodeAt(i) === 39 ? (u = L, i++) : (u = e, v === 0 && w(Xe)), u !== e) {
|
|
1787
|
-
for (p = [],
|
|
1788
|
-
p.push(
|
|
1789
|
-
r.charCodeAt(i) === 39 ? (
|
|
1804
|
+
for (p = [], g = kt(); g !== e; )
|
|
1805
|
+
p.push(g), g = kt();
|
|
1806
|
+
r.charCodeAt(i) === 39 ? (g = L, i++) : (g = e, v === 0 && w(Xe)), g !== e ? (k = o, o = On(p)) : (i = o, o = e);
|
|
1790
1807
|
} else
|
|
1791
1808
|
i = o, o = e;
|
|
1792
|
-
return o !== e && (
|
|
1809
|
+
return o !== e && (k = s, o = Tn(o)), s = o, s;
|
|
1793
1810
|
}
|
|
1794
1811
|
function Le() {
|
|
1795
|
-
var s, o, u, p,
|
|
1796
|
-
if (r.charCodeAt(i) === 48 ? (s =
|
|
1797
|
-
if (s = i, r.charCodeAt(i) === 45 ? (o =
|
|
1798
|
-
for (p = [],
|
|
1799
|
-
p.push(
|
|
1812
|
+
var s, o, u, p, g;
|
|
1813
|
+
if (r.charCodeAt(i) === 48 ? (s = W, i++) : (s = e, v === 0 && w(Us)), s === e)
|
|
1814
|
+
if (s = i, r.charCodeAt(i) === 45 ? (o = D, i++) : (o = e, v === 0 && w(zs)), o === e && (o = null), u = lo(), u !== e) {
|
|
1815
|
+
for (p = [], g = ae(); g !== e; )
|
|
1816
|
+
p.push(g), g = ae();
|
|
1800
1817
|
o = [o, u, p], s = o;
|
|
1801
1818
|
} else
|
|
1802
1819
|
i = s, s = e;
|
|
1803
1820
|
return s;
|
|
1804
1821
|
}
|
|
1805
|
-
function
|
|
1822
|
+
function Et() {
|
|
1806
1823
|
var s, o, u;
|
|
1807
|
-
return s = i, o = St(), o !== e ? s = r.substring(s, i) : s = o, s === e && (r.charCodeAt(i) === 39 ? (s = L, i++) : (s = e, v === 0 && w(Xe)), s === e && (s = i, o = Ge(), o !== e ? (r.charCodeAt(i) === 34 ? (u = T, i++) : (u = e, v === 0 && w(Je)), u !== e ? (
|
|
1824
|
+
return s = i, o = St(), o !== e ? s = r.substring(s, i) : s = o, s === e && (r.charCodeAt(i) === 39 ? (s = L, i++) : (s = e, v === 0 && w(Xe)), s === e && (s = i, o = Ge(), o !== e ? (r.charCodeAt(i) === 34 ? (u = T, i++) : (u = e, v === 0 && w(Je)), u !== e ? (k = s, s = Pn()) : (i = s, s = e)) : (i = s, s = e), s === e && (s = i, o = Ge(), o !== e ? (u = bt(), u !== e ? (k = s, s = _n(u)) : (i = s, s = e)) : (i = s, s = e)))), s;
|
|
1808
1825
|
}
|
|
1809
|
-
function
|
|
1826
|
+
function kt() {
|
|
1810
1827
|
var s, o, u;
|
|
1811
|
-
return s = i, o = St(), o !== e ? s = r.substring(s, i) : s = o, s === e && (r.charCodeAt(i) === 34 ? (s = T, i++) : (s = e, v === 0 && w(Je)), s === e && (s = i, o = Ge(), o !== e ? (r.charCodeAt(i) === 39 ? (u = L, i++) : (u = e, v === 0 && w(Xe)), u !== e ? (
|
|
1828
|
+
return s = i, o = St(), o !== e ? s = r.substring(s, i) : s = o, s === e && (r.charCodeAt(i) === 34 ? (s = T, i++) : (s = e, v === 0 && w(Je)), s === e && (s = i, o = Ge(), o !== e ? (r.charCodeAt(i) === 39 ? (u = L, i++) : (u = e, v === 0 && w(Xe)), u !== e ? (k = s, s = Fn()) : (i = s, s = e)) : (i = s, s = e), s === e && (s = i, o = Ge(), o !== e ? (u = bt(), u !== e ? (k = s, s = In(u)) : (i = s, s = e)) : (i = s, s = e)))), s;
|
|
1812
1829
|
}
|
|
1813
|
-
function
|
|
1830
|
+
function lo() {
|
|
1814
1831
|
var s;
|
|
1815
|
-
return s = r.charAt(i),
|
|
1832
|
+
return s = r.charAt(i), O.test(s) ? i++ : (s = e, v === 0 && w(Bs)), s;
|
|
1816
1833
|
}
|
|
1817
|
-
function
|
|
1818
|
-
var s, o, u, p,
|
|
1819
|
-
if (s = i, o =
|
|
1820
|
-
for (u = [], p = i,
|
|
1821
|
-
u.push(p), p = i,
|
|
1822
|
-
|
|
1834
|
+
function _r() {
|
|
1835
|
+
var s, o, u, p, g, $;
|
|
1836
|
+
if (s = i, o = Fr(), o !== e) {
|
|
1837
|
+
for (u = [], p = i, R(), r.substr(i, 2) === P ? (g = P, i += 2) : (g = e, v === 0 && w(Gr)), g !== e ? (R(), $ = Fr(), $ !== e ? (k = p, p = ot(o, $)) : (i = p, p = e)) : (i = p, p = e); p !== e; )
|
|
1838
|
+
u.push(p), p = i, R(), r.substr(i, 2) === P ? (g = P, i += 2) : (g = e, v === 0 && w(Gr)), g !== e ? (R(), $ = Fr(), $ !== e ? (k = p, p = ot(o, $)) : (i = p, p = e)) : (i = p, p = e);
|
|
1839
|
+
k = s, s = Dn(o, u);
|
|
1823
1840
|
} else
|
|
1824
1841
|
i = s, s = e;
|
|
1825
1842
|
return s;
|
|
1826
1843
|
}
|
|
1827
1844
|
function St() {
|
|
1828
1845
|
var s, o, u;
|
|
1829
|
-
return s = r.charAt(i), Z.test(s) ? i++ : (s = e, v === 0 && w(
|
|
1846
|
+
return s = r.charAt(i), Z.test(s) ? i++ : (s = e, v === 0 && w(xs)), s === e && (s = i, o = r.charAt(i), Ke.test(o) ? i++ : (o = e, v === 0 && w(Jr)), o !== e ? (u = r.charAt(i), ie.test(u) ? i++ : (u = e, v === 0 && w(Xr)), u !== e ? (o = [o, u], s = o) : (i = s, s = e)) : (i = s, s = e)), s;
|
|
1830
1847
|
}
|
|
1831
1848
|
function Ge() {
|
|
1832
1849
|
var s;
|
|
1833
1850
|
return r.charCodeAt(i) === 92 ? (s = b, i++) : (s = e, v === 0 && w(Zr)), s;
|
|
1834
1851
|
}
|
|
1835
|
-
function
|
|
1852
|
+
function bt() {
|
|
1836
1853
|
var s, o, u;
|
|
1837
|
-
return s = r.charAt(i), le.test(s) ? i++ : (s = e, v === 0 && w(
|
|
1854
|
+
return s = r.charAt(i), le.test(s) ? i++ : (s = e, v === 0 && w(Ms)), s === e && (s = i, r.charCodeAt(i) === 117 ? (o = A, i++) : (o = e, v === 0 && w(Yr)), o !== e ? (u = po(), u !== e ? (o = [o, u], s = o) : (i = s, s = e)) : (i = s, s = e)), s;
|
|
1838
1855
|
}
|
|
1839
|
-
function
|
|
1840
|
-
var s, o, u, p,
|
|
1856
|
+
function Fr() {
|
|
1857
|
+
var s, o, u, p, g, $, C;
|
|
1841
1858
|
if (s = i, o = i, u = Ir(), u !== e) {
|
|
1842
|
-
for (p = [],
|
|
1843
|
-
p.push(
|
|
1844
|
-
|
|
1859
|
+
for (p = [], g = i, R(), r.substr(i, 2) === K ? ($ = K, i += 2) : ($ = e, v === 0 && w(et)), $ !== e ? (R(), C = Ir(), C !== e ? (k = g, g = it(u, C)) : (i = g, g = e)) : (i = g, g = e); g !== e; )
|
|
1860
|
+
p.push(g), g = i, R(), r.substr(i, 2) === K ? ($ = K, i += 2) : ($ = e, v === 0 && w(et)), $ !== e ? (R(), C = Ir(), C !== e ? (k = g, g = it(u, C)) : (i = g, g = e)) : (i = g, g = e);
|
|
1861
|
+
k = o, o = Ln(u, p);
|
|
1845
1862
|
} else
|
|
1846
1863
|
i = o, o = e;
|
|
1847
|
-
return o !== e && (
|
|
1864
|
+
return o !== e && (k = s, o = Nn(o)), s = o, s;
|
|
1848
1865
|
}
|
|
1849
|
-
function
|
|
1850
|
-
var s, o, u, p,
|
|
1851
|
-
return s = i, o = i, u =
|
|
1866
|
+
function po() {
|
|
1867
|
+
var s, o, u, p, g, $, C;
|
|
1868
|
+
return s = i, o = i, u = ho(), u !== e && (k = o, u = jn()), o = u, o === e && (o = i, u = i, p = go(), p !== e ? u = r.substring(u, i) : u = p, u !== e ? (r.charCodeAt(i) === 92 ? (p = b, i++) : (p = e, v === 0 && w(Zr)), p !== e ? (r.charCodeAt(i) === 117 ? (g = A, i++) : (g = e, v === 0 && w(Yr)), g !== e ? ($ = i, C = mo(), C !== e ? $ = r.substring($, i) : $ = C, $ !== e ? (k = o, o = Wn(u, $)) : (i = o, o = e)) : (i = o, o = e)) : (i = o, o = e)) : (i = o, o = e)), o !== e && (k = s, o = qn(o)), s = o, s;
|
|
1852
1869
|
}
|
|
1853
1870
|
function Ir() {
|
|
1854
1871
|
var s;
|
|
1855
|
-
return s =
|
|
1872
|
+
return s = $o(), s === e && (s = yo(), s === e && (s = wo())), s;
|
|
1856
1873
|
}
|
|
1857
|
-
function
|
|
1858
|
-
var s, o, u, p,
|
|
1859
|
-
if (s = i, o = ae(), o === e && (o = r.charAt(i),
|
|
1860
|
-
for (u = i, p = [],
|
|
1861
|
-
p.push(
|
|
1874
|
+
function ho() {
|
|
1875
|
+
var s, o, u, p, g, $;
|
|
1876
|
+
if (s = i, o = ae(), o === e && (o = r.charAt(i), Fe.test(o) ? i++ : (o = e, v === 0 && w(Vs))), o !== e) {
|
|
1877
|
+
for (u = i, p = [], g = pe(); g !== e; )
|
|
1878
|
+
p.push(g), p.length >= 3 ? g = e : g = pe();
|
|
1862
1879
|
p.length < 3 ? (i = u, u = e) : u = p, u !== e ? (o = [o, u], s = o) : (i = s, s = e);
|
|
1863
1880
|
} else
|
|
1864
1881
|
i = s, s = e;
|
|
1865
1882
|
if (s === e)
|
|
1866
|
-
if (s = i, o = r.charAt(i), o.toLowerCase() ===
|
|
1867
|
-
if (u = r.charAt(i), hr.test(u) ? i++ : (u = e, v === 0 && w(
|
|
1868
|
-
for (p = i,
|
|
1869
|
-
|
|
1870
|
-
|
|
1883
|
+
if (s = i, o = r.charAt(i), o.toLowerCase() === F ? i++ : (o = e, v === 0 && w(Ar)), o !== e)
|
|
1884
|
+
if (u = r.charAt(i), hr.test(u) ? i++ : (u = e, v === 0 && w(Ks)), u !== e) {
|
|
1885
|
+
for (p = i, g = [], $ = pe(); $ !== e; )
|
|
1886
|
+
g.push($), g.length >= 2 ? $ = e : $ = pe();
|
|
1887
|
+
g.length < 2 ? (i = p, p = e) : p = g, p !== e ? (o = [o, u, p], s = o) : (i = s, s = e);
|
|
1871
1888
|
} else
|
|
1872
1889
|
i = s, s = e;
|
|
1873
1890
|
else
|
|
1874
1891
|
i = s, s = e;
|
|
1875
1892
|
return s;
|
|
1876
1893
|
}
|
|
1877
|
-
function
|
|
1878
|
-
var s, o, u, p,
|
|
1879
|
-
if (s = i, o = r.charAt(i), o.toLowerCase() ===
|
|
1880
|
-
if (u = r.charAt(i), gr.test(u) ? i++ : (u = e, v === 0 && w(
|
|
1881
|
-
for (p = i,
|
|
1882
|
-
|
|
1883
|
-
|
|
1894
|
+
function go() {
|
|
1895
|
+
var s, o, u, p, g, $;
|
|
1896
|
+
if (s = i, o = r.charAt(i), o.toLowerCase() === F ? i++ : (o = e, v === 0 && w(Ar)), o !== e)
|
|
1897
|
+
if (u = r.charAt(i), gr.test(u) ? i++ : (u = e, v === 0 && w(Hs)), u === e && (u = r.charAt(i), mr.test(u) ? i++ : (u = e, v === 0 && w(Js))), u !== e) {
|
|
1898
|
+
for (p = i, g = [], $ = pe(); $ !== e; )
|
|
1899
|
+
g.push($), g.length >= 2 ? $ = e : $ = pe();
|
|
1900
|
+
g.length < 2 ? (i = p, p = e) : p = g, p !== e ? (o = [o, u, p], s = o) : (i = s, s = e);
|
|
1884
1901
|
} else
|
|
1885
1902
|
i = s, s = e;
|
|
1886
1903
|
else
|
|
1887
1904
|
i = s, s = e;
|
|
1888
1905
|
return s;
|
|
1889
1906
|
}
|
|
1890
|
-
function
|
|
1891
|
-
var s, o, u, p,
|
|
1892
|
-
if (s = i, o = r.charAt(i), o.toLowerCase() ===
|
|
1893
|
-
if (u = r.charAt(i), $r.test(u) ? i++ : (u = e, v === 0 && w(
|
|
1894
|
-
for (p = i,
|
|
1895
|
-
|
|
1896
|
-
|
|
1907
|
+
function mo() {
|
|
1908
|
+
var s, o, u, p, g, $;
|
|
1909
|
+
if (s = i, o = r.charAt(i), o.toLowerCase() === F ? i++ : (o = e, v === 0 && w(Ar)), o !== e)
|
|
1910
|
+
if (u = r.charAt(i), $r.test(u) ? i++ : (u = e, v === 0 && w(Xs)), u !== e) {
|
|
1911
|
+
for (p = i, g = [], $ = pe(); $ !== e; )
|
|
1912
|
+
g.push($), g.length >= 2 ? $ = e : $ = pe();
|
|
1913
|
+
g.length < 2 ? (i = p, p = e) : p = g, p !== e ? (o = [o, u, p], s = o) : (i = s, s = e);
|
|
1897
1914
|
} else
|
|
1898
1915
|
i = s, s = e;
|
|
1899
1916
|
else
|
|
1900
1917
|
i = s, s = e;
|
|
1901
1918
|
return s;
|
|
1902
1919
|
}
|
|
1903
|
-
function mo() {
|
|
1904
|
-
var s, o, u, p, m, $;
|
|
1905
|
-
return s = i, o = i, u = bt(), u !== e ? (p = O(), u = [u, p], o = u) : (i = o, o = e), o === e && (o = null), r.charCodeAt(i) === 40 ? (u = W, i++) : (u = e, v === 0 && w(rt)), u !== e ? (p = O(), m = Fr(), m !== e ? (O(), r.charCodeAt(i) === 41 ? ($ = z, i++) : ($ = e, v === 0 && w(tt)), $ !== e ? (E = s, s = qn(o, m)) : (i = s, s = e)) : (i = s, s = e)) : (i = s, s = e), s;
|
|
1906
|
-
}
|
|
1907
1920
|
function $o() {
|
|
1908
|
-
var s, o, u, p
|
|
1909
|
-
return s = i, o =
|
|
1921
|
+
var s, o, u, p, g, $;
|
|
1922
|
+
return s = i, o = i, u = Ct(), u !== e ? (p = R(), u = [u, p], o = u) : (i = o, o = e), o === e && (o = null), r.charCodeAt(i) === 40 ? (u = j, i++) : (u = e, v === 0 && w(rt)), u !== e ? (p = R(), g = _r(), g !== e ? (R(), r.charCodeAt(i) === 41 ? ($ = z, i++) : ($ = e, v === 0 && w(tt)), $ !== e ? (k = s, s = Un(o, g)) : (i = s, s = e)) : (i = s, s = e)) : (i = s, s = e), s;
|
|
1910
1923
|
}
|
|
1911
1924
|
function yo() {
|
|
1912
1925
|
var s, o, u, p;
|
|
1913
|
-
return s = i, o =
|
|
1926
|
+
return s = i, o = At(), o !== e ? (R(), u = vo(), u !== e ? (R(), p = At(), p !== e ? (k = s, s = zn(o, u, p)) : (i = s, s = e)) : (i = s, s = e)) : (i = s, s = e), s;
|
|
1927
|
+
}
|
|
1928
|
+
function wo() {
|
|
1929
|
+
var s, o, u, p;
|
|
1930
|
+
return s = i, o = i, u = Ct(), u !== e ? (p = R(), u = [u, p], o = u) : (i = o, o = e), o === e && (o = null), u = Rt(), u === e && (u = Dr()), u !== e ? (k = s, s = Bn(o, u)) : (i = s, s = e), s;
|
|
1914
1931
|
}
|
|
1915
1932
|
function pe() {
|
|
1916
1933
|
var s;
|
|
1917
|
-
return s = ae(), s === e && (s = r.charAt(i), yr.test(s) ? i++ : (s = e, v === 0 && w(
|
|
1934
|
+
return s = ae(), s === e && (s = r.charAt(i), yr.test(s) ? i++ : (s = e, v === 0 && w(Qs))), s;
|
|
1918
1935
|
}
|
|
1919
|
-
function
|
|
1936
|
+
function Ct() {
|
|
1920
1937
|
var s;
|
|
1921
|
-
return r.charCodeAt(i) === 33 ? (s = x, i++) : (s = e, v === 0 && w(
|
|
1938
|
+
return r.charCodeAt(i) === 33 ? (s = x, i++) : (s = e, v === 0 && w(Gs)), s;
|
|
1922
1939
|
}
|
|
1923
1940
|
function At() {
|
|
1924
1941
|
var s;
|
|
1925
|
-
return s = Ot(), s === e && (s =
|
|
1942
|
+
return s = Ot(), s === e && (s = Eo(), s === e && (s = Dr())), s;
|
|
1926
1943
|
}
|
|
1927
|
-
function
|
|
1944
|
+
function vo() {
|
|
1928
1945
|
var s;
|
|
1929
|
-
return r.substr(i, 2) === I ? (s = I, i += 2) : (s = e, v === 0 && w(
|
|
1946
|
+
return r.substr(i, 2) === I ? (s = I, i += 2) : (s = e, v === 0 && w(Zs)), s === e && (r.substr(i, 2) === B ? (s = B, i += 2) : (s = e, v === 0 && w(Ys)), s === e && (r.substr(i, 2) === H ? (s = H, i += 2) : (s = e, v === 0 && w(en)), s === e && (r.substr(i, 2) === ee ? (s = ee, i += 2) : (s = e, v === 0 && w(rn)), s === e && (s = r.charAt(i), wr.test(s) ? i++ : (s = e, v === 0 && w(tn)))))), s;
|
|
1930
1947
|
}
|
|
1931
1948
|
function Rt() {
|
|
1932
1949
|
var s, o;
|
|
1933
|
-
return s = i, o = ko(), o === e && (o = Rr()), o !== e && (
|
|
1950
|
+
return s = i, o = ko(), o === e && (o = Rr()), o !== e && (k = s, o = xn(o)), s = o, s;
|
|
1934
1951
|
}
|
|
1935
1952
|
function Dr() {
|
|
1936
|
-
var s, o, u, p,
|
|
1937
|
-
if (s = i, o =
|
|
1938
|
-
if (r.charCodeAt(i) === 40 ? (u =
|
|
1939
|
-
if (
|
|
1940
|
-
for ($ = [],
|
|
1941
|
-
$.push(
|
|
1942
|
-
|
|
1953
|
+
var s, o, u, p, g, $, C, q, G;
|
|
1954
|
+
if (s = i, o = So(), o !== e)
|
|
1955
|
+
if (r.charCodeAt(i) === 40 ? (u = j, i++) : (u = e, v === 0 && w(rt)), u !== e) {
|
|
1956
|
+
if (R(), p = i, g = Lr(), g !== e) {
|
|
1957
|
+
for ($ = [], C = i, R(), r.charCodeAt(i) === 44 ? (q = m, i++) : (q = e, v === 0 && w(He)), q !== e ? (R(), G = Lr(), G !== e ? (k = C, C = at(o, g, G)) : (i = C, C = e)) : (i = C, C = e); C !== e; )
|
|
1958
|
+
$.push(C), C = i, R(), r.charCodeAt(i) === 44 ? (q = m, i++) : (q = e, v === 0 && w(He)), q !== e ? (R(), G = Lr(), G !== e ? (k = C, C = at(o, g, G)) : (i = C, C = e)) : (i = C, C = e);
|
|
1959
|
+
k = p, p = Mn(o, g, $);
|
|
1943
1960
|
} else
|
|
1944
1961
|
i = p, p = e;
|
|
1945
|
-
p === e && (p = null),
|
|
1962
|
+
p === e && (p = null), g = R(), r.charCodeAt(i) === 41 ? ($ = z, i++) : ($ = e, v === 0 && w(tt)), $ !== e ? (k = s, s = Vn(o, p)) : (i = s, s = e);
|
|
1946
1963
|
} else
|
|
1947
1964
|
i = s, s = e;
|
|
1948
1965
|
else
|
|
@@ -1951,21 +1968,21 @@ function aa(r, t) {
|
|
|
1951
1968
|
}
|
|
1952
1969
|
function Ot() {
|
|
1953
1970
|
var s, o;
|
|
1954
|
-
return s = i, o =
|
|
1971
|
+
return s = i, o = bo(), o === e && (o = vt(), o === e && (o = Co(), o === e && (o = Ao(), o === e && (o = Ro())))), o !== e && (k = s, o = Kn(o)), s = o, s;
|
|
1955
1972
|
}
|
|
1956
|
-
function
|
|
1973
|
+
function Eo() {
|
|
1957
1974
|
var s;
|
|
1958
|
-
return s =
|
|
1975
|
+
return s = Oo(), s === e && (s = To()), s;
|
|
1959
1976
|
}
|
|
1960
1977
|
function ko() {
|
|
1961
1978
|
var s, o, u;
|
|
1962
|
-
return s = i, o = Tt(), o !== e ? (u = pt(), u !== e ? (
|
|
1979
|
+
return s = i, o = Tt(), o !== e ? (u = pt(), u !== e ? (k = s, s = Hn(u)) : (i = s, s = e)) : (i = s, s = e), s;
|
|
1963
1980
|
}
|
|
1964
|
-
function
|
|
1965
|
-
var s, o, u, p,
|
|
1981
|
+
function So() {
|
|
1982
|
+
var s, o, u, p, g;
|
|
1966
1983
|
if (s = i, o = i, u = Fo(), u !== e) {
|
|
1967
|
-
for (p = [],
|
|
1968
|
-
p.push(
|
|
1984
|
+
for (p = [], g = Pt(); g !== e; )
|
|
1985
|
+
p.push(g), g = Pt();
|
|
1969
1986
|
u = [u, p], o = u;
|
|
1970
1987
|
} else
|
|
1971
1988
|
i = o, o = e;
|
|
@@ -1973,43 +1990,43 @@ function aa(r, t) {
|
|
|
1973
1990
|
}
|
|
1974
1991
|
function Lr() {
|
|
1975
1992
|
var s;
|
|
1976
|
-
return s = Ot(), s === e && (s = Rt(), s === e && (s = Dr(), s === e && (s =
|
|
1993
|
+
return s = Ot(), s === e && (s = Rt(), s === e && (s = Dr(), s === e && (s = _r()))), s;
|
|
1977
1994
|
}
|
|
1978
|
-
function
|
|
1979
|
-
var s, o, u, p,
|
|
1980
|
-
return s = i, o = i, u = i, p = Le(), p === e && (r.substr(i, 2) === he ? (p = he, i += 2) : (p = e, v === 0 && w(
|
|
1995
|
+
function bo() {
|
|
1996
|
+
var s, o, u, p, g, $;
|
|
1997
|
+
return s = i, o = i, u = i, p = Le(), p === e && (r.substr(i, 2) === he ? (p = he, i += 2) : (p = e, v === 0 && w(sn))), p !== e ? (g = Po(), g === e && (g = null), $ = _o(), $ === e && ($ = null), p = [p, g, $], u = p) : (i = u, u = e), u !== e ? o = r.substring(o, i) : o = u, o !== e && (k = s, o = Jn(o)), s = o, s;
|
|
1981
1998
|
}
|
|
1982
1999
|
function Co() {
|
|
1983
2000
|
var s, o;
|
|
1984
|
-
return s = i, r.substr(i, 4) === ne ? (o = ne, i += 4) : (o = e, v === 0 && w(
|
|
1985
|
-
}
|
|
1986
|
-
function bo() {
|
|
1987
|
-
var s, o;
|
|
1988
|
-
return s = i, r.substr(i, 5) === re ? (o = re, i += 5) : (o = e, v === 0 && w(nn)), o !== e && (E = s, o = Xn()), s = o, s;
|
|
2001
|
+
return s = i, r.substr(i, 4) === ne ? (o = ne, i += 4) : (o = e, v === 0 && w(nn)), o !== e && (k = s, o = Xn()), s = o, s;
|
|
1989
2002
|
}
|
|
1990
2003
|
function Ao() {
|
|
1991
2004
|
var s, o;
|
|
1992
|
-
return s = i, r.substr(i,
|
|
2005
|
+
return s = i, r.substr(i, 5) === re ? (o = re, i += 5) : (o = e, v === 0 && w(on)), o !== e && (k = s, o = Qn()), s = o, s;
|
|
1993
2006
|
}
|
|
1994
2007
|
function Ro() {
|
|
1995
|
-
var s, o
|
|
1996
|
-
return s = i,
|
|
2008
|
+
var s, o;
|
|
2009
|
+
return s = i, r.substr(i, 4) === ue ? (o = ue, i += 4) : (o = e, v === 0 && w(an)), o !== e && (k = s, o = Gn()), s = o, s;
|
|
1997
2010
|
}
|
|
1998
2011
|
function Oo() {
|
|
1999
2012
|
var s, o, u;
|
|
2000
|
-
return s = i, o =
|
|
2013
|
+
return s = i, o = Tt(), o !== e ? (u = _t(), k = s, s = Zn(u)) : (i = s, s = e), s;
|
|
2014
|
+
}
|
|
2015
|
+
function To() {
|
|
2016
|
+
var s, o, u;
|
|
2017
|
+
return s = i, o = lt(), o !== e ? (u = _t(), k = s, s = Yn(u)) : (i = s, s = e), s;
|
|
2001
2018
|
}
|
|
2002
2019
|
function Tt() {
|
|
2003
2020
|
var s;
|
|
2004
|
-
return r.charCodeAt(i) === 64 ? (s = pr, i++) : (s = e, v === 0 && w(
|
|
2021
|
+
return r.charCodeAt(i) === 64 ? (s = pr, i++) : (s = e, v === 0 && w(cn)), s;
|
|
2005
2022
|
}
|
|
2006
2023
|
function Pt() {
|
|
2007
2024
|
var s;
|
|
2008
|
-
return s = r.charAt(i), vr.test(s) ? i++ : (s = e, v === 0 && w(
|
|
2025
|
+
return s = r.charAt(i), vr.test(s) ? i++ : (s = e, v === 0 && w(fn)), s;
|
|
2009
2026
|
}
|
|
2010
|
-
function
|
|
2027
|
+
function Po() {
|
|
2011
2028
|
var s, o, u, p;
|
|
2012
|
-
if (s = i, r.charCodeAt(i) === 46 ? (o = l, i++) : (o = e, v === 0 && w(
|
|
2029
|
+
if (s = i, r.charCodeAt(i) === 46 ? (o = l, i++) : (o = e, v === 0 && w(Ce)), o !== e) {
|
|
2013
2030
|
if (u = [], p = ae(), p !== e)
|
|
2014
2031
|
for (; p !== e; )
|
|
2015
2032
|
u.push(p), p = ae();
|
|
@@ -2020,12 +2037,12 @@ function aa(r, t) {
|
|
|
2020
2037
|
i = s, s = e;
|
|
2021
2038
|
return s;
|
|
2022
2039
|
}
|
|
2023
|
-
function
|
|
2024
|
-
var s, o, u, p,
|
|
2025
|
-
if (s = i, o = r.charAt(i), o.toLowerCase() === dr ? i++ : (o = e, v === 0 && w(
|
|
2026
|
-
if (u = r.charAt(i),
|
|
2027
|
-
for (;
|
|
2028
|
-
p.push(
|
|
2040
|
+
function _o() {
|
|
2041
|
+
var s, o, u, p, g;
|
|
2042
|
+
if (s = i, o = r.charAt(i), o.toLowerCase() === dr ? i++ : (o = e, v === 0 && w(un)), o !== e) {
|
|
2043
|
+
if (u = r.charAt(i), Er.test(u) ? i++ : (u = e, v === 0 && w(ln)), u === e && (u = null), p = [], g = ae(), g !== e)
|
|
2044
|
+
for (; g !== e; )
|
|
2045
|
+
p.push(g), g = ae();
|
|
2029
2046
|
else
|
|
2030
2047
|
p = e;
|
|
2031
2048
|
p !== e ? (o = [o, u, p], s = o) : (i = s, s = e);
|
|
@@ -2033,23 +2050,23 @@ function aa(r, t) {
|
|
|
2033
2050
|
i = s, s = e;
|
|
2034
2051
|
return s;
|
|
2035
2052
|
}
|
|
2036
|
-
function
|
|
2053
|
+
function _t() {
|
|
2037
2054
|
var s, o, u, p;
|
|
2038
|
-
for (s = i, o = [], u = i,
|
|
2039
|
-
o.push(u), u = i,
|
|
2040
|
-
return
|
|
2055
|
+
for (s = i, o = [], u = i, R(), p = Ft(), p === e && (p = It()), p !== e ? (k = u, u = ct(p)) : (i = u, u = e); u !== e; )
|
|
2056
|
+
o.push(u), u = i, R(), p = Ft(), p === e && (p = It()), p !== e ? (k = u, u = ct(p)) : (i = u, u = e);
|
|
2057
|
+
return k = s, o = eo(o), s = o, s;
|
|
2041
2058
|
}
|
|
2042
2059
|
function Fo() {
|
|
2043
2060
|
var s;
|
|
2044
|
-
return s = r.charAt(i),
|
|
2061
|
+
return s = r.charAt(i), kr.test(s) ? i++ : (s = e, v === 0 && w(pn)), s;
|
|
2045
2062
|
}
|
|
2046
|
-
function
|
|
2063
|
+
function Ft() {
|
|
2047
2064
|
var s, o, u, p;
|
|
2048
|
-
return s = i, r.charCodeAt(i) === 91 ? (o = d, i++) : (o = e, v === 0 && w(
|
|
2065
|
+
return s = i, r.charCodeAt(i) === 91 ? (o = d, i++) : (o = e, v === 0 && w(br)), o !== e ? (u = yt(), u !== e ? (r.charCodeAt(i) === 93 ? (p = y, i++) : (p = e, v === 0 && w(Cr)), p !== e ? (k = s, s = ro(u)) : (i = s, s = e)) : (i = s, s = e)) : (i = s, s = e), s === e && (s = i, r.charCodeAt(i) === 46 ? (o = l, i++) : (o = e, v === 0 && w(Ce)), o !== e ? (u = Tr(), u !== e ? (k = s, s = to(u)) : (i = s, s = e)) : (i = s, s = e)), s;
|
|
2049
2066
|
}
|
|
2050
2067
|
function It() {
|
|
2051
2068
|
var s, o, u, p;
|
|
2052
|
-
return s = i, r.charCodeAt(i) === 91 ? (o = d, i++) : (o = e, v === 0 && w(
|
|
2069
|
+
return s = i, r.charCodeAt(i) === 91 ? (o = d, i++) : (o = e, v === 0 && w(br)), o !== e ? (u = wt(), u !== e ? (r.charCodeAt(i) === 93 ? (p = y, i++) : (p = e, v === 0 && w(Cr)), p !== e ? (k = s, s = so(u)) : (i = s, s = e)) : (i = s, s = e)) : (i = s, s = e), s;
|
|
2053
2070
|
}
|
|
2054
2071
|
if (De = c(), t.peg$library)
|
|
2055
2072
|
return (
|
|
@@ -2064,12 +2081,12 @@ function aa(r, t) {
|
|
|
2064
2081
|
);
|
|
2065
2082
|
if (De !== e && i === r.length)
|
|
2066
2083
|
return De;
|
|
2067
|
-
throw De !== e && i < r.length && w(
|
|
2084
|
+
throw De !== e && i < r.length && w(oo()), io(Qe, te < r.length ? r.charAt(te) : null, te < r.length ? ut(te, te + 1) : ut(te, te));
|
|
2068
2085
|
}
|
|
2069
|
-
function
|
|
2070
|
-
return
|
|
2086
|
+
function fa(r) {
|
|
2087
|
+
return ca(r);
|
|
2071
2088
|
}
|
|
2072
|
-
class
|
|
2089
|
+
class ua {
|
|
2073
2090
|
head = null;
|
|
2074
2091
|
tail = null;
|
|
2075
2092
|
size = 0;
|
|
@@ -2090,21 +2107,21 @@ function xe(r) {
|
|
|
2090
2107
|
const t = Object.getPrototypeOf(r);
|
|
2091
2108
|
return t === null || t === Object.prototype;
|
|
2092
2109
|
}
|
|
2093
|
-
const tr = (r) => Array.isArray(r.value), nr = (r) => xe(r.value),
|
|
2110
|
+
const tr = (r) => Array.isArray(r.value), nr = (r) => xe(r.value), ys = /* @__PURE__ */ new WeakSet(), Q = (r) => typeof r == "object" && r !== null && ys.has(r), la = (r) => {
|
|
2094
2111
|
switch (typeof r) {
|
|
2095
2112
|
case "string":
|
|
2096
2113
|
case "number":
|
|
2097
2114
|
case "boolean":
|
|
2098
2115
|
return !0;
|
|
2099
2116
|
case "object":
|
|
2100
|
-
return r === null || xe(r) ||
|
|
2117
|
+
return r === null || xe(r) || ws(r);
|
|
2101
2118
|
default:
|
|
2102
2119
|
return !1;
|
|
2103
2120
|
}
|
|
2104
|
-
},
|
|
2121
|
+
}, ws = (r) => Array.isArray(r) && !Q(r), vs = () => {
|
|
2105
2122
|
const r = [];
|
|
2106
|
-
return
|
|
2107
|
-
}, Pe = Symbol("Nothing"),
|
|
2123
|
+
return ys.add(r), r;
|
|
2124
|
+
}, Pe = Symbol("Nothing"), pa = {
|
|
2108
2125
|
declaration: function(t, e) {
|
|
2109
2126
|
return Q(e) ? e.length : 0;
|
|
2110
2127
|
},
|
|
@@ -2113,7 +2130,7 @@ const tr = (r) => Array.isArray(r.value), nr = (r) => xe(r.value), $s = /* @__PU
|
|
|
2113
2130
|
returnType: "ValueType"
|
|
2114
2131
|
}
|
|
2115
2132
|
};
|
|
2116
|
-
function
|
|
2133
|
+
function da(r) {
|
|
2117
2134
|
let t = 0;
|
|
2118
2135
|
for (let e = 0; e < r.length; e++) {
|
|
2119
2136
|
const n = r.charCodeAt(e);
|
|
@@ -2121,23 +2138,23 @@ function pa(r) {
|
|
|
2121
2138
|
}
|
|
2122
2139
|
return t;
|
|
2123
2140
|
}
|
|
2124
|
-
const
|
|
2141
|
+
const ha = {
|
|
2125
2142
|
declaration: function(t, e) {
|
|
2126
|
-
return typeof e == "string" ?
|
|
2143
|
+
return typeof e == "string" ? da(e) : Array.isArray(e) ? e.length : xe(e) ? Object.keys(e).length : Pe;
|
|
2127
2144
|
},
|
|
2128
2145
|
definition: {
|
|
2129
2146
|
parameters: ["ValueType"],
|
|
2130
2147
|
returnType: "ValueType"
|
|
2131
2148
|
}
|
|
2132
2149
|
};
|
|
2133
|
-
function
|
|
2150
|
+
function Es(r) {
|
|
2134
2151
|
return r === 92;
|
|
2135
2152
|
}
|
|
2136
|
-
function
|
|
2153
|
+
function ga(r, t) {
|
|
2137
2154
|
let e = !1, n = t;
|
|
2138
2155
|
for (; n < r.length; ) {
|
|
2139
2156
|
const a = r.charCodeAt(n);
|
|
2140
|
-
if (n++,
|
|
2157
|
+
if (n++, Es(a)) {
|
|
2141
2158
|
e = !0;
|
|
2142
2159
|
continue;
|
|
2143
2160
|
}
|
|
@@ -2149,11 +2166,11 @@ function ha(r, t) {
|
|
|
2149
2166
|
}
|
|
2150
2167
|
return n;
|
|
2151
2168
|
}
|
|
2152
|
-
function
|
|
2169
|
+
function ma(r) {
|
|
2153
2170
|
let t = r;
|
|
2154
2171
|
for (let e = 0; e < r.length; e++) {
|
|
2155
2172
|
const n = r.charCodeAt(e);
|
|
2156
|
-
|
|
2173
|
+
Es(n) ? e++ : n === 91 ? e = ga(r, e) : n === 46 && (t = `${r.slice(0, e)}[^
|
|
2157
2174
|
\r]${r.slice(e + 1)}`);
|
|
2158
2175
|
}
|
|
2159
2176
|
return t;
|
|
@@ -2163,13 +2180,13 @@ function ks({ cache: r }, t) {
|
|
|
2163
2180
|
if (r.has("regexps") || r.set("regexps", e), Object.hasOwn(e, t))
|
|
2164
2181
|
return e[t];
|
|
2165
2182
|
try {
|
|
2166
|
-
const n = RegExp(
|
|
2183
|
+
const n = RegExp(ma(t), "u");
|
|
2167
2184
|
return e[t] = n, n;
|
|
2168
2185
|
} catch {
|
|
2169
2186
|
return e[t] = null, null;
|
|
2170
2187
|
}
|
|
2171
2188
|
}
|
|
2172
|
-
const
|
|
2189
|
+
const $a = {
|
|
2173
2190
|
declaration: function(t, e, n) {
|
|
2174
2191
|
return typeof e != "string" || typeof n != "string" ? !1 : ks(t, `^${n}$`)?.test(e) === !0;
|
|
2175
2192
|
},
|
|
@@ -2177,7 +2194,7 @@ const ma = {
|
|
|
2177
2194
|
parameters: ["ValueType", "ValueType"],
|
|
2178
2195
|
returnType: "LogicalType"
|
|
2179
2196
|
}
|
|
2180
|
-
},
|
|
2197
|
+
}, ya = {
|
|
2181
2198
|
declaration: function(t, e, n) {
|
|
2182
2199
|
return typeof e != "string" || typeof n != "string" ? !1 : ks(t, n)?.test(e) === !0;
|
|
2183
2200
|
},
|
|
@@ -2185,7 +2202,7 @@ const ma = {
|
|
|
2185
2202
|
parameters: ["ValueType", "ValueType"],
|
|
2186
2203
|
returnType: "LogicalType"
|
|
2187
2204
|
}
|
|
2188
|
-
},
|
|
2205
|
+
}, wa = {
|
|
2189
2206
|
declaration: function(t, e) {
|
|
2190
2207
|
return e.length === 1 ? e[0] : Pe;
|
|
2191
2208
|
},
|
|
@@ -2195,12 +2212,12 @@ const ma = {
|
|
|
2195
2212
|
}
|
|
2196
2213
|
}, qr = [];
|
|
2197
2214
|
function se(r, t) {
|
|
2198
|
-
return r === qr ? qr : typeof t == "number" ? [...r, t] : [...r,
|
|
2215
|
+
return r === qr ? qr : typeof t == "number" ? [...r, t] : [...r, Sa(t)];
|
|
2199
2216
|
}
|
|
2200
|
-
function
|
|
2217
|
+
function va(r) {
|
|
2201
2218
|
return r ? [] : qr;
|
|
2202
2219
|
}
|
|
2203
|
-
const
|
|
2220
|
+
const Ea = (
|
|
2204
2221
|
// biome-ignore lint/suspicious/noControlCharactersInRegex: we need control characters to escape Unicode characters
|
|
2205
2222
|
/[\u0000-\u001f'\\]/g
|
|
2206
2223
|
);
|
|
@@ -2225,10 +2242,10 @@ function ka(r) {
|
|
|
2225
2242
|
return `\\u${t.toString(16).padStart(4, "0")}`;
|
|
2226
2243
|
}
|
|
2227
2244
|
}
|
|
2228
|
-
function
|
|
2229
|
-
return r.replace(
|
|
2245
|
+
function Sa(r) {
|
|
2246
|
+
return r.replace(Ea, ka);
|
|
2230
2247
|
}
|
|
2231
|
-
function
|
|
2248
|
+
function be(r) {
|
|
2232
2249
|
throw new TypeError(
|
|
2233
2250
|
// biome-ignore lint/complexity/useLiteralKeys: type exhaustiveness
|
|
2234
2251
|
`Unexpected node type: ${r.type}`
|
|
@@ -2237,7 +2254,7 @@ function Ce(r) {
|
|
|
2237
2254
|
function de(r) {
|
|
2238
2255
|
throw new TypeError(`Unexpected comparison operator: ${r}`);
|
|
2239
2256
|
}
|
|
2240
|
-
function
|
|
2257
|
+
function Ss(r, t) {
|
|
2241
2258
|
throw new Error(t);
|
|
2242
2259
|
}
|
|
2243
2260
|
function sr(r) {
|
|
@@ -2247,7 +2264,7 @@ function sr(r) {
|
|
|
2247
2264
|
return "null";
|
|
2248
2265
|
if (Q(r))
|
|
2249
2266
|
return "NodeList";
|
|
2250
|
-
if (
|
|
2267
|
+
if (ws(r))
|
|
2251
2268
|
return "array";
|
|
2252
2269
|
if (xe(r))
|
|
2253
2270
|
return "object";
|
|
@@ -2264,7 +2281,7 @@ function sr(r) {
|
|
|
2264
2281
|
throw new TypeError(`Unknown type: ${r}`);
|
|
2265
2282
|
}
|
|
2266
2283
|
}
|
|
2267
|
-
function
|
|
2284
|
+
function ba(r, t) {
|
|
2268
2285
|
if (r.length !== t.length)
|
|
2269
2286
|
return !1;
|
|
2270
2287
|
for (let e = 0; e < r.length; e++)
|
|
@@ -2294,12 +2311,12 @@ function Te(r, t) {
|
|
|
2294
2311
|
return Ca(r, t);
|
|
2295
2312
|
case "array":
|
|
2296
2313
|
case "NodeList":
|
|
2297
|
-
return
|
|
2314
|
+
return ba(r, t);
|
|
2298
2315
|
default:
|
|
2299
2316
|
return !1;
|
|
2300
2317
|
}
|
|
2301
2318
|
}
|
|
2302
|
-
function
|
|
2319
|
+
function bs(r, t, e) {
|
|
2303
2320
|
switch (e) {
|
|
2304
2321
|
case "==":
|
|
2305
2322
|
case ">=":
|
|
@@ -2311,7 +2328,7 @@ function Ss(r, t, e) {
|
|
|
2311
2328
|
case ">":
|
|
2312
2329
|
return !1;
|
|
2313
2330
|
case "!=":
|
|
2314
|
-
return !
|
|
2331
|
+
return !bs(r, t, "==");
|
|
2315
2332
|
default:
|
|
2316
2333
|
de(e);
|
|
2317
2334
|
}
|
|
@@ -2333,7 +2350,7 @@ function Cs(r, t, e) {
|
|
|
2333
2350
|
de(e);
|
|
2334
2351
|
}
|
|
2335
2352
|
}
|
|
2336
|
-
function
|
|
2353
|
+
function As(r, t, e) {
|
|
2337
2354
|
switch (e) {
|
|
2338
2355
|
case "==":
|
|
2339
2356
|
case "<=":
|
|
@@ -2345,7 +2362,7 @@ function bs(r, t, e) {
|
|
|
2345
2362
|
case ">":
|
|
2346
2363
|
return !1;
|
|
2347
2364
|
case "!=":
|
|
2348
|
-
return !
|
|
2365
|
+
return !As(r, t, "==");
|
|
2349
2366
|
default:
|
|
2350
2367
|
de(e);
|
|
2351
2368
|
}
|
|
@@ -2368,7 +2385,7 @@ function ve(r, t, e) {
|
|
|
2368
2385
|
de(e);
|
|
2369
2386
|
}
|
|
2370
2387
|
}
|
|
2371
|
-
function
|
|
2388
|
+
function Aa(r, t, e) {
|
|
2372
2389
|
switch (e) {
|
|
2373
2390
|
case "==":
|
|
2374
2391
|
case "<=":
|
|
@@ -2385,7 +2402,7 @@ function ba(r, t, e) {
|
|
|
2385
2402
|
de(e);
|
|
2386
2403
|
}
|
|
2387
2404
|
}
|
|
2388
|
-
function
|
|
2405
|
+
function Rs(r, t, e) {
|
|
2389
2406
|
switch (e) {
|
|
2390
2407
|
case "==":
|
|
2391
2408
|
case "<=":
|
|
@@ -2396,7 +2413,7 @@ function As(r, t, e) {
|
|
|
2396
2413
|
case ">":
|
|
2397
2414
|
return !1;
|
|
2398
2415
|
case "!=":
|
|
2399
|
-
return !
|
|
2416
|
+
return !Rs(r, t, "==");
|
|
2400
2417
|
default:
|
|
2401
2418
|
de(e);
|
|
2402
2419
|
}
|
|
@@ -2423,7 +2440,7 @@ function $e(r, t, e) {
|
|
|
2423
2440
|
de(e);
|
|
2424
2441
|
}
|
|
2425
2442
|
}
|
|
2426
|
-
function
|
|
2443
|
+
function Ra(r, t, e) {
|
|
2427
2444
|
switch (e) {
|
|
2428
2445
|
case "==":
|
|
2429
2446
|
case "<":
|
|
@@ -2440,30 +2457,30 @@ function Aa(r, t, e) {
|
|
|
2440
2457
|
de(e);
|
|
2441
2458
|
}
|
|
2442
2459
|
}
|
|
2443
|
-
function
|
|
2460
|
+
function Oa(r, t, e) {
|
|
2444
2461
|
const n = Q(r) && r.length === 1 ? r[0] : r, a = sr(n), c = Q(t) && t.length === 1 ? t[0] : t;
|
|
2445
2462
|
switch (a) {
|
|
2446
2463
|
case "string":
|
|
2447
|
-
return
|
|
2464
|
+
return Ra(n, c, e);
|
|
2448
2465
|
case "number":
|
|
2449
2466
|
return ve(n, c, e);
|
|
2450
2467
|
case "boolean":
|
|
2451
2468
|
case "null":
|
|
2452
|
-
return
|
|
2469
|
+
return Rs(n, c, e);
|
|
2453
2470
|
case "object":
|
|
2454
|
-
return
|
|
2471
|
+
return Aa(n, c, e);
|
|
2455
2472
|
case "array":
|
|
2456
|
-
return Ss(n, c, e);
|
|
2457
|
-
case "Nothing":
|
|
2458
2473
|
return bs(n, c, e);
|
|
2474
|
+
case "Nothing":
|
|
2475
|
+
return As(n, c, e);
|
|
2459
2476
|
case "NodeList":
|
|
2460
2477
|
return Cs(n, c, e);
|
|
2461
2478
|
default:
|
|
2462
|
-
|
|
2479
|
+
Ss(a, "Unknown type");
|
|
2463
2480
|
}
|
|
2464
2481
|
}
|
|
2465
|
-
function
|
|
2466
|
-
const n =
|
|
2482
|
+
function Os(r, t, e) {
|
|
2483
|
+
const n = vs();
|
|
2467
2484
|
switch (e.value.type) {
|
|
2468
2485
|
case "RelQuery":
|
|
2469
2486
|
ir(r, t.root, t.value, e.value, (a) => {
|
|
@@ -2476,54 +2493,54 @@ function Rs(r, t, e) {
|
|
|
2476
2493
|
});
|
|
2477
2494
|
break;
|
|
2478
2495
|
default:
|
|
2479
|
-
|
|
2496
|
+
be(e.value);
|
|
2480
2497
|
}
|
|
2481
2498
|
return n;
|
|
2482
2499
|
}
|
|
2483
|
-
function
|
|
2500
|
+
function Ta(r, t, e) {
|
|
2484
2501
|
switch (e.expression.type) {
|
|
2485
2502
|
case "FilterQuery":
|
|
2486
|
-
return
|
|
2503
|
+
return Os(r, t, e.expression).length > 0;
|
|
2487
2504
|
case "FunctionExpr":
|
|
2488
2505
|
return Hr(r, t, e.expression) === !0;
|
|
2489
2506
|
default:
|
|
2490
|
-
|
|
2507
|
+
be(e.expression);
|
|
2491
2508
|
}
|
|
2492
2509
|
}
|
|
2493
|
-
function
|
|
2510
|
+
function Ee(r, t, e) {
|
|
2494
2511
|
switch (e.type) {
|
|
2495
2512
|
case "LogicalNotExpr":
|
|
2496
|
-
return !
|
|
2513
|
+
return !Ee(r, t, e.expression);
|
|
2497
2514
|
case "LogicalAndExpr":
|
|
2498
|
-
return
|
|
2515
|
+
return Ee(r, t, e.left) && Ee(r, t, e.right);
|
|
2499
2516
|
case "LogicalOrExpr":
|
|
2500
|
-
return
|
|
2517
|
+
return Ee(r, t, e.left) || Ee(r, t, e.right);
|
|
2501
2518
|
case "TestExpr":
|
|
2502
|
-
return
|
|
2519
|
+
return Ta(r, t, e);
|
|
2503
2520
|
case "ComparisonExpr":
|
|
2504
|
-
return
|
|
2521
|
+
return Ts(r, t, e);
|
|
2505
2522
|
default:
|
|
2506
|
-
|
|
2523
|
+
be(e);
|
|
2507
2524
|
}
|
|
2508
2525
|
}
|
|
2509
|
-
function
|
|
2526
|
+
function Pa(r, t, e) {
|
|
2510
2527
|
switch (e.type) {
|
|
2511
2528
|
case "FunctionExpr":
|
|
2512
2529
|
return Hr(r, t, e);
|
|
2513
2530
|
case "FilterQuery":
|
|
2514
|
-
return
|
|
2531
|
+
return Os(r, t, e);
|
|
2515
2532
|
case "LogicalNotExpr":
|
|
2516
2533
|
case "LogicalAndExpr":
|
|
2517
2534
|
case "LogicalOrExpr":
|
|
2518
2535
|
case "TestExpr":
|
|
2519
|
-
return
|
|
2536
|
+
return Ee(r, t, e);
|
|
2520
2537
|
case "Literal":
|
|
2521
2538
|
return e.value;
|
|
2522
2539
|
default:
|
|
2523
|
-
|
|
2540
|
+
be(e);
|
|
2524
2541
|
}
|
|
2525
2542
|
}
|
|
2526
|
-
function
|
|
2543
|
+
function _a(r) {
|
|
2527
2544
|
return Q(r) ? r.length === 1 ? r[0] : Pe : r;
|
|
2528
2545
|
}
|
|
2529
2546
|
function Hr(r, t, e) {
|
|
@@ -2534,12 +2551,12 @@ function Hr(r, t, e) {
|
|
|
2534
2551
|
return !1;
|
|
2535
2552
|
const a = [];
|
|
2536
2553
|
for (let c = 0; c < e.arguments.length; c++) {
|
|
2537
|
-
const f =
|
|
2554
|
+
const f = Pa(r, t, e.arguments[c]), l = n.definition.parameters[c];
|
|
2538
2555
|
switch (l) {
|
|
2539
2556
|
case "ValueType":
|
|
2540
|
-
if (!Q(f) && !
|
|
2557
|
+
if (!Q(f) && !la(f))
|
|
2541
2558
|
return !1;
|
|
2542
|
-
a.push(
|
|
2559
|
+
a.push(_a(f));
|
|
2543
2560
|
break;
|
|
2544
2561
|
case "NodesType":
|
|
2545
2562
|
if (!Q(f))
|
|
@@ -2555,7 +2572,7 @@ function Hr(r, t, e) {
|
|
|
2555
2572
|
return !1;
|
|
2556
2573
|
break;
|
|
2557
2574
|
default:
|
|
2558
|
-
|
|
2575
|
+
Ss(l, "Unknown function argument type");
|
|
2559
2576
|
}
|
|
2560
2577
|
}
|
|
2561
2578
|
return n.declaration(
|
|
@@ -2575,7 +2592,7 @@ function Jt(r, t, e) {
|
|
|
2575
2592
|
const n = e.type === "RelSingularQuery" ? t.value : t.root;
|
|
2576
2593
|
if (e.segments.length === 0)
|
|
2577
2594
|
return n;
|
|
2578
|
-
const a =
|
|
2595
|
+
const a = vs();
|
|
2579
2596
|
return ir(r, t.root, n, e, (c) => {
|
|
2580
2597
|
a.push(c);
|
|
2581
2598
|
}), a;
|
|
@@ -2583,18 +2600,18 @@ function Jt(r, t, e) {
|
|
|
2583
2600
|
case "FunctionExpr":
|
|
2584
2601
|
return Hr(r, t, e);
|
|
2585
2602
|
default:
|
|
2586
|
-
|
|
2603
|
+
be(e);
|
|
2587
2604
|
}
|
|
2588
2605
|
}
|
|
2589
|
-
function
|
|
2606
|
+
function Ts(r, t, e) {
|
|
2590
2607
|
const n = Jt(r, t, e.left), a = Jt(r, t, e.right);
|
|
2591
|
-
return
|
|
2608
|
+
return Oa(n, a, e.op);
|
|
2592
2609
|
}
|
|
2593
|
-
function
|
|
2610
|
+
function Ps(r, t, e) {
|
|
2594
2611
|
if (e.value.type === "ComparisonExpr") {
|
|
2595
|
-
if (!
|
|
2612
|
+
if (!Ts(r, t, e.value))
|
|
2596
2613
|
return;
|
|
2597
|
-
} else if (!
|
|
2614
|
+
} else if (!Ee(r, t, e.value))
|
|
2598
2615
|
return;
|
|
2599
2616
|
r.stack.push({
|
|
2600
2617
|
root: t.root,
|
|
@@ -2603,11 +2620,11 @@ function Ts(r, t, e) {
|
|
|
2603
2620
|
index: t.index + 1
|
|
2604
2621
|
});
|
|
2605
2622
|
}
|
|
2606
|
-
function
|
|
2623
|
+
function Ia(r, t) {
|
|
2607
2624
|
return r < 0 ? t + r : r;
|
|
2608
2625
|
}
|
|
2609
|
-
function
|
|
2610
|
-
const n =
|
|
2626
|
+
function _s(r, t, e) {
|
|
2627
|
+
const n = Ia(e.value, t.value.length);
|
|
2611
2628
|
n >= 0 && n < t.value.length && r.stack.push({
|
|
2612
2629
|
root: t.root,
|
|
2613
2630
|
path: se(t.path, n),
|
|
@@ -2626,7 +2643,7 @@ function Fs(r, { root: t, path: e, value: n, index: a }, c) {
|
|
|
2626
2643
|
function or(r, t) {
|
|
2627
2644
|
return r >= 0 ? r : t + r;
|
|
2628
2645
|
}
|
|
2629
|
-
function
|
|
2646
|
+
function Da(r, t, e, n) {
|
|
2630
2647
|
const a = or(r, n), c = or(t, n);
|
|
2631
2648
|
if (e >= 0) {
|
|
2632
2649
|
const h = Math.min(Math.max(a, 0), n), d = Math.min(Math.max(c, 0), n);
|
|
@@ -2635,29 +2652,29 @@ function Ia(r, t, e, n) {
|
|
|
2635
2652
|
const f = Math.min(Math.max(a, -1), n - 1);
|
|
2636
2653
|
return [Math.min(Math.max(c, -1), n - 1), f];
|
|
2637
2654
|
}
|
|
2638
|
-
function
|
|
2639
|
-
const f = c.step ?? 1, l = f >= 0 ? 0 : n.length - 1, h = f >= 0 ? n.length : -n.length - 1, d = c.start === null ? l : or(c.start, n.length),
|
|
2655
|
+
function La(r, { root: t, path: e, value: n, index: a }, c) {
|
|
2656
|
+
const f = c.step ?? 1, l = f >= 0 ? 0 : n.length - 1, h = f >= 0 ? n.length : -n.length - 1, d = c.start === null ? l : or(c.start, n.length), m = c.end === null ? h : or(c.end, n.length), [y, E] = Da(d, m, f, n.length);
|
|
2640
2657
|
if (f > 0) {
|
|
2641
|
-
let
|
|
2642
|
-
for (;
|
|
2658
|
+
let S = y;
|
|
2659
|
+
for (; S < E; )
|
|
2643
2660
|
r.stack.push({
|
|
2644
2661
|
root: t,
|
|
2645
|
-
path: se(e,
|
|
2646
|
-
value: n[
|
|
2662
|
+
path: se(e, S),
|
|
2663
|
+
value: n[S],
|
|
2647
2664
|
index: a + 1
|
|
2648
|
-
}),
|
|
2665
|
+
}), S += f;
|
|
2649
2666
|
} else if (f < 0) {
|
|
2650
|
-
let
|
|
2651
|
-
for (;
|
|
2667
|
+
let S = E;
|
|
2668
|
+
for (; y < S; )
|
|
2652
2669
|
r.stack.push({
|
|
2653
2670
|
root: t,
|
|
2654
|
-
path: se(e,
|
|
2655
|
-
value: n[
|
|
2671
|
+
path: se(e, S),
|
|
2672
|
+
value: n[S],
|
|
2656
2673
|
index: a + 1
|
|
2657
|
-
}),
|
|
2674
|
+
}), S += f;
|
|
2658
2675
|
}
|
|
2659
2676
|
}
|
|
2660
|
-
function
|
|
2677
|
+
function Is(r, { root: t, path: e, value: n, index: a }) {
|
|
2661
2678
|
if (Array.isArray(n))
|
|
2662
2679
|
for (let c = 0; c < n.length; c++)
|
|
2663
2680
|
r.stack.push({
|
|
@@ -2675,49 +2692,49 @@ function _s(r, { root: t, path: e, value: n, index: a }) {
|
|
|
2675
2692
|
index: a + 1
|
|
2676
2693
|
});
|
|
2677
2694
|
}
|
|
2678
|
-
function
|
|
2695
|
+
function Na(r, t, e) {
|
|
2679
2696
|
for (const n of e.selectors)
|
|
2680
2697
|
switch (n.type) {
|
|
2681
2698
|
case "NameSelector":
|
|
2682
2699
|
nr(t) && Fs(r, t, n);
|
|
2683
2700
|
break;
|
|
2684
2701
|
case "SliceSelector":
|
|
2685
|
-
tr(t) &&
|
|
2702
|
+
tr(t) && La(r, t, n);
|
|
2686
2703
|
break;
|
|
2687
2704
|
case "IndexSelector": {
|
|
2688
|
-
tr(t) &&
|
|
2705
|
+
tr(t) && _s(r, t, n);
|
|
2689
2706
|
break;
|
|
2690
2707
|
}
|
|
2691
2708
|
case "WildcardSelector":
|
|
2692
|
-
|
|
2709
|
+
Is(r, t);
|
|
2693
2710
|
break;
|
|
2694
2711
|
case "FilterSelector": {
|
|
2695
|
-
tr(t) ?
|
|
2712
|
+
tr(t) ? ja(r, t, n) : nr(t) && Wa(r, t, n);
|
|
2696
2713
|
break;
|
|
2697
2714
|
}
|
|
2698
2715
|
default:
|
|
2699
|
-
|
|
2716
|
+
be(n);
|
|
2700
2717
|
}
|
|
2701
2718
|
}
|
|
2702
|
-
function
|
|
2719
|
+
function ja(r, { root: t, path: e, value: n, index: a }, c) {
|
|
2703
2720
|
for (let f = 0; f < n.length; f++)
|
|
2704
|
-
|
|
2721
|
+
Ps(r, {
|
|
2705
2722
|
root: t,
|
|
2706
2723
|
path: se(e, f),
|
|
2707
2724
|
value: n[f],
|
|
2708
2725
|
index: a
|
|
2709
2726
|
}, c);
|
|
2710
2727
|
}
|
|
2711
|
-
function
|
|
2728
|
+
function Wa(r, { root: t, path: e, value: n, index: a }, c) {
|
|
2712
2729
|
for (const f of Object.keys(n))
|
|
2713
|
-
|
|
2730
|
+
Ps(r, {
|
|
2714
2731
|
root: t,
|
|
2715
2732
|
path: se(e, f),
|
|
2716
2733
|
value: n[f],
|
|
2717
2734
|
index: a
|
|
2718
2735
|
}, c);
|
|
2719
2736
|
}
|
|
2720
|
-
function
|
|
2737
|
+
function qa(r, { root: t, path: e, value: n, index: a }, c) {
|
|
2721
2738
|
Object.hasOwn(n, c.value) && r.stack.push({
|
|
2722
2739
|
root: t,
|
|
2723
2740
|
path: se(e, c.value),
|
|
@@ -2725,30 +2742,30 @@ function Wa(r, { root: t, path: e, value: n, index: a }, c) {
|
|
|
2725
2742
|
index: a + 1
|
|
2726
2743
|
});
|
|
2727
2744
|
}
|
|
2728
|
-
function
|
|
2745
|
+
function Ua(r, t, e) {
|
|
2729
2746
|
switch (e.type) {
|
|
2730
2747
|
case "BracketedSelection":
|
|
2731
|
-
return
|
|
2748
|
+
return Na(r, t, e);
|
|
2732
2749
|
case "WildcardSelector":
|
|
2733
|
-
return
|
|
2750
|
+
return Is(r, t);
|
|
2734
2751
|
case "MemberNameShorthand":
|
|
2735
|
-
nr(t) &&
|
|
2752
|
+
nr(t) && qa(r, t, e);
|
|
2736
2753
|
break;
|
|
2737
2754
|
case "NameSelector":
|
|
2738
2755
|
nr(t) && Fs(r, t, e);
|
|
2739
2756
|
break;
|
|
2740
2757
|
case "IndexSelector":
|
|
2741
|
-
tr(t) &&
|
|
2758
|
+
tr(t) && _s(r, t, e);
|
|
2742
2759
|
break;
|
|
2743
2760
|
default:
|
|
2744
|
-
|
|
2761
|
+
be(e);
|
|
2745
2762
|
}
|
|
2746
2763
|
}
|
|
2747
2764
|
function ir(r, t, e, n, a) {
|
|
2748
|
-
const c = new
|
|
2765
|
+
const c = new ua();
|
|
2749
2766
|
c.push({
|
|
2750
2767
|
root: t,
|
|
2751
|
-
path:
|
|
2768
|
+
path: va(r.capturePaths),
|
|
2752
2769
|
value: e,
|
|
2753
2770
|
index: 0
|
|
2754
2771
|
});
|
|
@@ -2765,65 +2782,65 @@ function ir(r, t, e, n, a) {
|
|
|
2765
2782
|
a(l.value, l.path);
|
|
2766
2783
|
continue;
|
|
2767
2784
|
}
|
|
2768
|
-
const { path: h, value: d, index:
|
|
2769
|
-
if (
|
|
2785
|
+
const { path: h, value: d, index: m } = l, y = n.segments[m];
|
|
2786
|
+
if (Ua(f, l, y.node), y.type === "DescendantSegment") {
|
|
2770
2787
|
if (Array.isArray(d))
|
|
2771
|
-
for (let
|
|
2788
|
+
for (let E = 0; E < d.length; E++)
|
|
2772
2789
|
c.push({
|
|
2773
2790
|
root: t,
|
|
2774
|
-
path: se(h,
|
|
2775
|
-
value: d[
|
|
2776
|
-
index:
|
|
2791
|
+
path: se(h, E),
|
|
2792
|
+
value: d[E],
|
|
2793
|
+
index: m
|
|
2777
2794
|
});
|
|
2778
2795
|
else if (d !== null && typeof d == "object")
|
|
2779
|
-
for (const
|
|
2796
|
+
for (const E of Object.keys(d))
|
|
2780
2797
|
c.push({
|
|
2781
2798
|
root: t,
|
|
2782
|
-
path: se(h,
|
|
2783
|
-
value: d[
|
|
2784
|
-
index:
|
|
2799
|
+
path: se(h, E),
|
|
2800
|
+
value: d[E],
|
|
2801
|
+
index: m
|
|
2785
2802
|
});
|
|
2786
2803
|
}
|
|
2787
2804
|
}
|
|
2788
2805
|
}
|
|
2789
|
-
function
|
|
2806
|
+
function za(r, t, e, n) {
|
|
2790
2807
|
const a = {
|
|
2791
2808
|
cache: /* @__PURE__ */ new Map(),
|
|
2792
2809
|
capturePaths: e.capturePaths,
|
|
2793
2810
|
functions: {
|
|
2794
|
-
count:
|
|
2795
|
-
search:
|
|
2796
|
-
value:
|
|
2797
|
-
match:
|
|
2798
|
-
length:
|
|
2811
|
+
count: pa,
|
|
2812
|
+
search: ya,
|
|
2813
|
+
value: wa,
|
|
2814
|
+
match: $a,
|
|
2815
|
+
length: ha
|
|
2799
2816
|
},
|
|
2800
2817
|
regexp: "i-regexp"
|
|
2801
2818
|
};
|
|
2802
|
-
ir(a, r, r,
|
|
2819
|
+
ir(a, r, r, fa(t), n);
|
|
2803
2820
|
}
|
|
2804
2821
|
function Ur(r, t) {
|
|
2805
2822
|
const e = [];
|
|
2806
|
-
return
|
|
2823
|
+
return za(r, t, { capturePaths: !1 }, (n) => {
|
|
2807
2824
|
e.push(n);
|
|
2808
2825
|
}), e;
|
|
2809
2826
|
}
|
|
2810
|
-
function
|
|
2827
|
+
function Ba(r, t) {
|
|
2811
2828
|
try {
|
|
2812
|
-
const e =
|
|
2829
|
+
const e = xa(r, t);
|
|
2813
2830
|
return !!new Function(`return ${e};`)();
|
|
2814
2831
|
} catch {
|
|
2815
2832
|
return !1;
|
|
2816
2833
|
}
|
|
2817
2834
|
}
|
|
2818
|
-
function
|
|
2835
|
+
function xa(r, t) {
|
|
2819
2836
|
const e = [];
|
|
2820
2837
|
let n = 0, a = "";
|
|
2821
2838
|
for (; n < r.length; )
|
|
2822
2839
|
if (r[n] === "$") {
|
|
2823
2840
|
a.length > 0 && (e.push(a), a = "");
|
|
2824
|
-
const c = n, f =
|
|
2841
|
+
const c = n, f = Ma(r, n);
|
|
2825
2842
|
if (f.length > 1) {
|
|
2826
|
-
const l =
|
|
2843
|
+
const l = Va(f, t);
|
|
2827
2844
|
e.push(l);
|
|
2828
2845
|
}
|
|
2829
2846
|
n = c + f.length;
|
|
@@ -2831,7 +2848,7 @@ function Ba(r, t) {
|
|
|
2831
2848
|
a += r[n], n++;
|
|
2832
2849
|
return a.length > 0 && e.push(a), e.join("");
|
|
2833
2850
|
}
|
|
2834
|
-
function
|
|
2851
|
+
function Ma(r, t) {
|
|
2835
2852
|
let e = "$", n = 0, a = !1, c = "", f = !1, l = 0, h = t + 1;
|
|
2836
2853
|
for (; h < r.length; ) {
|
|
2837
2854
|
const d = r[h];
|
|
@@ -2861,41 +2878,41 @@ function xa(r, t) {
|
|
|
2861
2878
|
}
|
|
2862
2879
|
return e;
|
|
2863
2880
|
}
|
|
2864
|
-
function
|
|
2881
|
+
function Va(r, t) {
|
|
2865
2882
|
if (r.endsWith(".length")) {
|
|
2866
2883
|
const a = r.slice(0, -7), c = zr(a), l = Ur(t, c)[0] ?? null;
|
|
2867
2884
|
return Array.isArray(l) ? String(l.length) : "0";
|
|
2868
2885
|
}
|
|
2869
2886
|
if (r.includes("[?(") && r.includes(")]"))
|
|
2870
|
-
return
|
|
2887
|
+
return Ka(r, t);
|
|
2871
2888
|
const e = zr(r), n = Ur(t, e);
|
|
2872
2889
|
return JSON.stringify(n[0]);
|
|
2873
2890
|
}
|
|
2874
|
-
function
|
|
2891
|
+
function Ka(r, t) {
|
|
2875
2892
|
const e = r.match(/\[\?\((.*)\)\]/);
|
|
2876
2893
|
if (!e)
|
|
2877
2894
|
return "false";
|
|
2878
2895
|
const n = e[1], a = r.substring(0, r.indexOf("[?(")), c = zr(a), f = Ur(t, c), l = Array.isArray(f) ? f.flat() : f;
|
|
2879
2896
|
if (!Array.isArray(l))
|
|
2880
2897
|
return "false";
|
|
2881
|
-
const h = l.filter((
|
|
2882
|
-
const
|
|
2898
|
+
const h = l.filter((m) => {
|
|
2899
|
+
const y = Ha(n, m);
|
|
2883
2900
|
try {
|
|
2884
|
-
return !!new Function("item", `return ${
|
|
2901
|
+
return !!new Function("item", `return ${y};`)(m);
|
|
2885
2902
|
} catch {
|
|
2886
2903
|
return !1;
|
|
2887
2904
|
}
|
|
2888
2905
|
}), d = r.substring(r.indexOf(")]") + 2);
|
|
2889
2906
|
if (d.startsWith(".")) {
|
|
2890
|
-
const
|
|
2891
|
-
if (
|
|
2892
|
-
const
|
|
2893
|
-
return JSON.stringify(
|
|
2907
|
+
const m = d.match(/\.([a-zA-Z0-9_-]+)/);
|
|
2908
|
+
if (m) {
|
|
2909
|
+
const y = m[1].replace(/-/g, "_"), E = h.map((S) => S[y]);
|
|
2910
|
+
return JSON.stringify(E);
|
|
2894
2911
|
}
|
|
2895
2912
|
}
|
|
2896
2913
|
return h.length > 0 ? JSON.stringify(h) : "false";
|
|
2897
2914
|
}
|
|
2898
|
-
function
|
|
2915
|
+
function Ha(r, t) {
|
|
2899
2916
|
let e = r;
|
|
2900
2917
|
return e = e.replace(/@\.([a-zA-Z0-9_-]+)\.match\(([^)]+)\)/g, (n, a, c) => {
|
|
2901
2918
|
const f = a.replace(/-/g, "_"), l = t[f];
|
|
@@ -2917,8 +2934,8 @@ function Ka(r, t) {
|
|
|
2917
2934
|
function zr(r) {
|
|
2918
2935
|
return r.replace(/\.([a-zA-Z0-9_-]+)/g, (t, e) => "." + e.replace(/-/g, "_"));
|
|
2919
2936
|
}
|
|
2920
|
-
function
|
|
2921
|
-
|
|
2937
|
+
function Ds({ workflowId: r, step: t, criteria: e = [], ctx: n }) {
|
|
2938
|
+
ia(e);
|
|
2922
2939
|
const a = [];
|
|
2923
2940
|
if (!r)
|
|
2924
2941
|
return a.push({
|
|
@@ -2935,23 +2952,23 @@ function Is({ workflowId: r, step: t, criteria: e = [], ctx: n }) {
|
|
|
2935
2952
|
return e.forEach((f) => {
|
|
2936
2953
|
const { condition: l } = f;
|
|
2937
2954
|
try {
|
|
2938
|
-
if (
|
|
2955
|
+
if (ms(f)) {
|
|
2939
2956
|
const h = l.match(/^\/(.*)\/([gimsuy]*)$/);
|
|
2940
|
-
let d,
|
|
2941
|
-
h ? (d = h[1],
|
|
2942
|
-
const { context:
|
|
2957
|
+
let d, m;
|
|
2958
|
+
h ? (d = h[1], m = h[2]) : (d = l, m = "");
|
|
2959
|
+
const { context: y } = f, E = new RegExp(d, m);
|
|
2943
2960
|
a.push({
|
|
2944
2961
|
name: V.SUCCESS_CRITERIA_CHECK,
|
|
2945
|
-
passed:
|
|
2962
|
+
passed: E.test(Se(y, c, n.options.logger)),
|
|
2946
2963
|
message: `Checking regex criteria: ${JSON.stringify(f)}`,
|
|
2947
2964
|
severity: n.severity.SUCCESS_CRITERIA_CHECK,
|
|
2948
2965
|
condition: l
|
|
2949
2966
|
});
|
|
2950
|
-
} else if (
|
|
2967
|
+
} else if ($s(f)) {
|
|
2951
2968
|
const { context: h } = f, d = Se(h, c, n.options.logger);
|
|
2952
2969
|
a.push({
|
|
2953
2970
|
name: V.SUCCESS_CRITERIA_CHECK,
|
|
2954
|
-
passed:
|
|
2971
|
+
passed: Ba(l, d),
|
|
2955
2972
|
message: `Checking jsonpath criteria: ${l}`,
|
|
2956
2973
|
severity: n.severity.SUCCESS_CRITERIA_CHECK,
|
|
2957
2974
|
condition: l
|
|
@@ -2975,7 +2992,7 @@ function Is({ workflowId: r, step: t, criteria: e = [], ctx: n }) {
|
|
|
2975
2992
|
}
|
|
2976
2993
|
}), a;
|
|
2977
2994
|
}
|
|
2978
|
-
async function
|
|
2995
|
+
async function Ja({ ctx: r, workflowId: t, step: e, requestData: n }) {
|
|
2979
2996
|
e.checks = [];
|
|
2980
2997
|
const a = {
|
|
2981
2998
|
successCriteriaCheck: !0,
|
|
@@ -3006,7 +3023,7 @@ async function Ha({ ctx: r, workflowId: t, step: e, requestData: n }) {
|
|
|
3006
3023
|
}
|
|
3007
3024
|
const c = r.$workflows[t].steps[e.stepId].request;
|
|
3008
3025
|
if (e.request = c, e.verboseLog = r.apiClient.getVerboseResponseLogs(), e.successCriteria) {
|
|
3009
|
-
const h =
|
|
3026
|
+
const h = Ds({
|
|
3010
3027
|
workflowId: t,
|
|
3011
3028
|
step: e,
|
|
3012
3029
|
criteria: e.successCriteria,
|
|
@@ -3019,7 +3036,7 @@ async function Ha({ ctx: r, workflowId: t, step: e, requestData: n }) {
|
|
|
3019
3036
|
});
|
|
3020
3037
|
a.successCriteriaCheck = h.every((d) => d.passed || ["off", "warn"].includes(d.severity)), e.checks.push(...h);
|
|
3021
3038
|
}
|
|
3022
|
-
const f =
|
|
3039
|
+
const f = Ho({
|
|
3023
3040
|
stepCallCtx: {
|
|
3024
3041
|
$response: e.response,
|
|
3025
3042
|
$inputs: r.$workflows[t].inputs
|
|
@@ -3054,10 +3071,10 @@ async function Ha({ ctx: r, workflowId: t, step: e, requestData: n }) {
|
|
|
3054
3071
|
response: e.response
|
|
3055
3072
|
}, a;
|
|
3056
3073
|
}
|
|
3057
|
-
function
|
|
3074
|
+
function Xa(r = 0) {
|
|
3058
3075
|
return new Promise((t) => setTimeout(t, r * 1e3));
|
|
3059
3076
|
}
|
|
3060
|
-
function
|
|
3077
|
+
function Qa({ ctx: r, descriptionName: t, openapiOperation: e, xOperation: n }) {
|
|
3061
3078
|
if (!t && n?.url)
|
|
3062
3079
|
return { url: n?.url };
|
|
3063
3080
|
if (r.options?.server && t) {
|
|
@@ -3104,26 +3121,26 @@ function Ye(r) {
|
|
|
3104
3121
|
})).filter(({ value: t }) => !!t)
|
|
3105
3122
|
};
|
|
3106
3123
|
}
|
|
3107
|
-
function
|
|
3108
|
-
if (
|
|
3124
|
+
function Ga(r, t) {
|
|
3125
|
+
if (ec(r))
|
|
3109
3126
|
return {
|
|
3110
3127
|
in: r.scheme.in,
|
|
3111
3128
|
name: r.scheme.name,
|
|
3112
3129
|
value: r.values.apiKey
|
|
3113
3130
|
};
|
|
3114
|
-
if (
|
|
3131
|
+
if (rc(r)) {
|
|
3115
3132
|
const { username: e, password: n } = r.values, a = btoa(`${e}:${n}`);
|
|
3116
3133
|
return t.secretsSet.add(a), er(`Basic ${a}`);
|
|
3117
3134
|
}
|
|
3118
|
-
if (
|
|
3135
|
+
if (tc(r)) {
|
|
3119
3136
|
const { token: e } = r.values;
|
|
3120
3137
|
return t.secretsSet.add(e), er(`Bearer ${e}`);
|
|
3121
3138
|
}
|
|
3122
|
-
if (
|
|
3139
|
+
if (Ya(r)) {
|
|
3123
3140
|
const { accessToken: e } = r.values;
|
|
3124
3141
|
return t.secretsSet.add(e), er(`Bearer ${e}`);
|
|
3125
3142
|
}
|
|
3126
|
-
if (
|
|
3143
|
+
if (Za(r)) {
|
|
3127
3144
|
const { accessToken: e } = r.values;
|
|
3128
3145
|
return t.secretsSet.add(e), er(`Bearer ${e}`);
|
|
3129
3146
|
}
|
|
@@ -3135,22 +3152,22 @@ function er(r, t) {
|
|
|
3135
3152
|
value: r
|
|
3136
3153
|
};
|
|
3137
3154
|
}
|
|
3138
|
-
function
|
|
3155
|
+
function Za(r) {
|
|
3139
3156
|
return r.scheme.type === "oauth2";
|
|
3140
3157
|
}
|
|
3141
|
-
function
|
|
3158
|
+
function Ya(r) {
|
|
3142
3159
|
return r.scheme.type === "openIdConnect";
|
|
3143
3160
|
}
|
|
3144
|
-
function
|
|
3161
|
+
function ec(r) {
|
|
3145
3162
|
return r.scheme.type === "apiKey";
|
|
3146
3163
|
}
|
|
3147
|
-
function
|
|
3164
|
+
function rc(r) {
|
|
3148
3165
|
return r.scheme.type === "http" && r.scheme.scheme === "basic";
|
|
3149
3166
|
}
|
|
3150
|
-
function
|
|
3167
|
+
function tc(r) {
|
|
3151
3168
|
return r.scheme.type === "http" && r.scheme.scheme === "bearer";
|
|
3152
3169
|
}
|
|
3153
|
-
const
|
|
3170
|
+
const sc = {
|
|
3154
3171
|
apiKey: ["apiKey"],
|
|
3155
3172
|
basic: ["username", "password"],
|
|
3156
3173
|
digest: ["username", "password"],
|
|
@@ -3159,8 +3176,8 @@ const tc = {
|
|
|
3159
3176
|
openIdConnect: ["accessToken"],
|
|
3160
3177
|
mutualTLS: []
|
|
3161
3178
|
};
|
|
3162
|
-
function
|
|
3163
|
-
const e = r.type === "http" ? r.scheme : r.type, n =
|
|
3179
|
+
function nc({ scheme: r, values: t }) {
|
|
3180
|
+
const e = r.type === "http" ? r.scheme : r.type, n = sc[e];
|
|
3164
3181
|
if (!n)
|
|
3165
3182
|
throw new Error(`Unsupported security scheme type: ${e}`);
|
|
3166
3183
|
for (const a of n)
|
|
@@ -3168,71 +3185,75 @@ function sc({ scheme: r, values: t }) {
|
|
|
3168
3185
|
throw new Error(`Missing required value \`${a}\` for ${e} security scheme`);
|
|
3169
3186
|
return { scheme: r, values: t };
|
|
3170
3187
|
}
|
|
3171
|
-
function
|
|
3188
|
+
function oc({ ctx: r, runtimeContext: t, step: e, operation: n, workflowLevelXSecurityParameters: a }) {
|
|
3172
3189
|
const c = e["x-security"], l = [...a || [], ...c || []], h = [];
|
|
3173
3190
|
for (const d of l) {
|
|
3174
|
-
const
|
|
3175
|
-
|
|
3191
|
+
const m = us({
|
|
3192
|
+
ctx: r,
|
|
3193
|
+
security: d,
|
|
3194
|
+
operation: n
|
|
3195
|
+
});
|
|
3196
|
+
if ("schemeName" in d && !m)
|
|
3176
3197
|
throw new Error(`Security scheme "${d.schemeName}" not found`);
|
|
3177
|
-
if (!
|
|
3198
|
+
if (!m)
|
|
3178
3199
|
continue;
|
|
3179
|
-
const
|
|
3200
|
+
const y = Object.fromEntries(Object.entries(d?.values ?? {}).map(([N, T]) => {
|
|
3180
3201
|
const L = oe({
|
|
3181
3202
|
payload: T,
|
|
3182
3203
|
context: t,
|
|
3183
3204
|
logger: r.options.logger
|
|
3184
3205
|
});
|
|
3185
|
-
return d.values && (d.values[
|
|
3186
|
-
})),
|
|
3187
|
-
|
|
3206
|
+
return d.values && (d.values[N] = L), [N, L];
|
|
3207
|
+
})), E = nc({ scheme: m, values: y }), S = Ga(E, r);
|
|
3208
|
+
S && h.push(S);
|
|
3188
3209
|
}
|
|
3189
3210
|
return h;
|
|
3190
3211
|
}
|
|
3191
|
-
async function
|
|
3192
|
-
const { stepId: n, operationId: a, operationPath: c, "x-operation": f } = t, l = r.workflows.find((x) => x.workflowId === e), h = l && l.parameters || [], d = f ? void 0 :
|
|
3212
|
+
async function ic(r, t, e) {
|
|
3213
|
+
const { stepId: n, operationId: a, operationPath: c, "x-operation": f } = t, l = r.workflows.find((x) => x.workflowId === e), h = l && l.parameters || [], d = f ? void 0 : Pi({
|
|
3193
3214
|
operationId: a,
|
|
3194
3215
|
operationPath: c
|
|
3195
3216
|
}, r);
|
|
3196
|
-
let
|
|
3197
|
-
const
|
|
3217
|
+
let m = "", y;
|
|
3218
|
+
const E = Qa({
|
|
3198
3219
|
ctx: r,
|
|
3199
3220
|
descriptionName: d?.descriptionName,
|
|
3200
3221
|
openapiOperation: d,
|
|
3201
3222
|
xOperation: f
|
|
3202
3223
|
});
|
|
3203
3224
|
if (f)
|
|
3204
|
-
|
|
3225
|
+
y = f.method;
|
|
3205
3226
|
else if (d)
|
|
3206
|
-
|
|
3227
|
+
m = d?.path, y = d?.method;
|
|
3207
3228
|
else
|
|
3208
3229
|
throw new Error("No operation found");
|
|
3209
|
-
if (!
|
|
3230
|
+
if (!E && !m.includes("http"))
|
|
3210
3231
|
throw new Error("No servers found in API description");
|
|
3211
|
-
if (!
|
|
3232
|
+
if (!y)
|
|
3212
3233
|
throw new Error('"method" is required to make a request');
|
|
3213
|
-
const
|
|
3214
|
-
payload:
|
|
3234
|
+
const S = d && Ci(d, r.options.logger), {
|
|
3235
|
+
payload: N,
|
|
3215
3236
|
// encoding: stepRequestBodyEncoding,
|
|
3216
3237
|
contentType: T,
|
|
3217
3238
|
replacements: L
|
|
3218
|
-
} = await
|
|
3239
|
+
} = await li(t.requestBody, r), W = N || S?.requestBody, D = T || S?.contentType, P = Xt(
|
|
3219
3240
|
// order is important here, the last one wins
|
|
3220
|
-
typeof
|
|
3221
|
-
|
|
3222
|
-
|
|
3241
|
+
typeof W == "object" ? [{ in: "header", name: "content-type", value: "application/json" }] : [],
|
|
3242
|
+
E?.parameters || [],
|
|
3243
|
+
S?.contentTypeParameters || [],
|
|
3223
3244
|
// if step.parameters is defined, we do not auto-populate parameters from the openapi operation
|
|
3224
|
-
t.parameters ? [] :
|
|
3245
|
+
t.parameters ? [] : S?.parameters || [],
|
|
3225
3246
|
Qt(h, r),
|
|
3226
3247
|
T ? [{ in: "header", name: "content-type", value: T }] : [],
|
|
3227
3248
|
Qt(t.parameters || [], r)
|
|
3228
3249
|
);
|
|
3229
|
-
r.$steps[n] || (r.$steps[n] = {}), r.$workflows[e].steps[n] || (r.$workflows[e].steps[n] = {}),
|
|
3230
|
-
body:
|
|
3231
|
-
header: ye(
|
|
3232
|
-
path: ye(
|
|
3233
|
-
query: ye(
|
|
3234
|
-
url:
|
|
3235
|
-
method:
|
|
3250
|
+
r.$steps[n] || (r.$steps[n] = {}), r.$workflows[e].steps[n] || (r.$workflows[e].steps[n] = {}), y?.toLowerCase() === "x-query" && (y = "query"), r.$workflows[e].steps[n].request = {
|
|
3251
|
+
body: W,
|
|
3252
|
+
header: ye(P, "header"),
|
|
3253
|
+
path: ye(P, "path"),
|
|
3254
|
+
query: ye(P, "query"),
|
|
3255
|
+
url: E?.url && m ? `${E?.url}${m}` : E?.url,
|
|
3256
|
+
method: y
|
|
3236
3257
|
};
|
|
3237
3258
|
const b = {
|
|
3238
3259
|
...r,
|
|
@@ -3244,13 +3265,13 @@ async function oc(r, t, e) {
|
|
|
3244
3265
|
ctx: b,
|
|
3245
3266
|
workflowId: e,
|
|
3246
3267
|
step: t
|
|
3247
|
-
}), K = l?.["x-security"] || [],
|
|
3268
|
+
}), K = l?.["x-security"] || [], F = oc({
|
|
3248
3269
|
ctx: b,
|
|
3249
3270
|
runtimeContext: A,
|
|
3250
3271
|
step: t,
|
|
3251
3272
|
operation: d,
|
|
3252
3273
|
workflowLevelXSecurityParameters: K
|
|
3253
|
-
}),
|
|
3274
|
+
}), j = Xt(P, F).map((x) => ({
|
|
3254
3275
|
...x,
|
|
3255
3276
|
value: oe({
|
|
3256
3277
|
payload: x.value,
|
|
@@ -3260,12 +3281,12 @@ async function oc(r, t, e) {
|
|
|
3260
3281
|
}));
|
|
3261
3282
|
for (const x of d?.parameters || []) {
|
|
3262
3283
|
const { schema: I, name: B } = x;
|
|
3263
|
-
Be(r, I, ye(
|
|
3284
|
+
Be(r, I, ye(P, x.in), [B]);
|
|
3264
3285
|
}
|
|
3265
3286
|
const z = oe({
|
|
3266
|
-
payload:
|
|
3287
|
+
payload: W,
|
|
3267
3288
|
context: A,
|
|
3268
|
-
contentType:
|
|
3289
|
+
contentType: D,
|
|
3269
3290
|
logger: r.options.logger
|
|
3270
3291
|
});
|
|
3271
3292
|
if (L && typeof z == "object" && ki({
|
|
@@ -3273,22 +3294,22 @@ async function oc(r, t, e) {
|
|
|
3273
3294
|
replacements: L,
|
|
3274
3295
|
expressionContext: A,
|
|
3275
3296
|
logger: r.options.logger
|
|
3276
|
-
}),
|
|
3277
|
-
const x = Fi(
|
|
3278
|
-
typeof
|
|
3297
|
+
}), D && d?.requestBody) {
|
|
3298
|
+
const x = Fi(D, d);
|
|
3299
|
+
typeof W == "object" && Be(r, x, W);
|
|
3279
3300
|
}
|
|
3280
3301
|
return r.$workflows[e].steps[n].request = {
|
|
3281
3302
|
body: z,
|
|
3282
|
-
header: ye(
|
|
3283
|
-
path: ye(
|
|
3284
|
-
query: ye(
|
|
3285
|
-
url:
|
|
3286
|
-
method:
|
|
3303
|
+
header: ye(j, "header"),
|
|
3304
|
+
path: ye(j, "path"),
|
|
3305
|
+
query: ye(j, "query"),
|
|
3306
|
+
url: E?.url && m ? `${E?.url}${m}` : E?.url,
|
|
3307
|
+
method: y
|
|
3287
3308
|
}, {
|
|
3288
|
-
serverUrl:
|
|
3289
|
-
path:
|
|
3290
|
-
method:
|
|
3291
|
-
parameters:
|
|
3309
|
+
serverUrl: E,
|
|
3310
|
+
path: m,
|
|
3311
|
+
method: y,
|
|
3312
|
+
parameters: ac(j),
|
|
3292
3313
|
requestBody: z,
|
|
3293
3314
|
openapiOperation: d
|
|
3294
3315
|
};
|
|
@@ -3310,7 +3331,7 @@ function Qt(r, t) {
|
|
|
3310
3331
|
return n;
|
|
3311
3332
|
}).filter((e) => e !== void 0);
|
|
3312
3333
|
}
|
|
3313
|
-
function
|
|
3334
|
+
function ac(r) {
|
|
3314
3335
|
const t = [];
|
|
3315
3336
|
for (const e of r)
|
|
3316
3337
|
if (e.in === "header" && e.name.toLowerCase() === "cookie") {
|
|
@@ -3339,22 +3360,22 @@ class ce {
|
|
|
3339
3360
|
}
|
|
3340
3361
|
async function Br({ step: r, ctx: t, workflowId: e, retriesLeft: n, executedStepsCount: a }) {
|
|
3341
3362
|
r = { ...r }, r.retriesLeft = n;
|
|
3342
|
-
const c = t.workflows.find((b) => b.workflowId === e), { stepId: f, onFailure: l, onSuccess: h, workflowId: d, parameters:
|
|
3363
|
+
const c = t.workflows.find((b) => b.workflowId === e), { stepId: f, onFailure: l, onSuccess: h, workflowId: d, parameters: m } = r, y = (l || c?.failureActions || []).map((b) => We(b, t)), E = (h || c?.successActions || []).map((b) => We(b, t)), S = m?.map((b) => We(b, t));
|
|
3343
3364
|
if (d) {
|
|
3344
|
-
const b = t.workflows.find((
|
|
3365
|
+
const b = t.workflows.find((j) => j.workflowId === d) || fe({ value: d, ctx: t, logger: t.options.logger });
|
|
3345
3366
|
if (!b) {
|
|
3346
|
-
const
|
|
3367
|
+
const j = {
|
|
3347
3368
|
name: V.UNEXPECTED_ERROR,
|
|
3348
3369
|
message: `Workflow ${U(d)} not found.`,
|
|
3349
3370
|
passed: !1,
|
|
3350
3371
|
severity: t.severity.UNEXPECTED_ERROR
|
|
3351
3372
|
};
|
|
3352
|
-
r.checks.push(
|
|
3373
|
+
r.checks.push(j);
|
|
3353
3374
|
return;
|
|
3354
3375
|
}
|
|
3355
3376
|
const A = await xr(d, b, t, t.options.config);
|
|
3356
|
-
if (
|
|
3357
|
-
const
|
|
3377
|
+
if (S && S.length) {
|
|
3378
|
+
const j = S.filter(ai).reduce((z, x) => {
|
|
3358
3379
|
const I = {
|
|
3359
3380
|
...t,
|
|
3360
3381
|
$inputs: {
|
|
@@ -3370,10 +3391,10 @@ async function Br({ step: r, ctx: t, workflowId: e, retriesLeft: n, executedStep
|
|
|
3370
3391
|
}, {});
|
|
3371
3392
|
A.$workflows[b.workflowId].inputs = {
|
|
3372
3393
|
...A.$workflows[b.workflowId].inputs,
|
|
3373
|
-
...
|
|
3394
|
+
...j
|
|
3374
3395
|
};
|
|
3375
3396
|
}
|
|
3376
|
-
|
|
3397
|
+
Jo(f, t.options.logger);
|
|
3377
3398
|
const K = await Ue({
|
|
3378
3399
|
workflowInput: b,
|
|
3379
3400
|
ctx: A,
|
|
@@ -3383,30 +3404,30 @@ async function Br({ step: r, ctx: t, workflowId: e, retriesLeft: n, executedStep
|
|
|
3383
3404
|
executedStepsCount: a
|
|
3384
3405
|
});
|
|
3385
3406
|
t.executedSteps.push(K);
|
|
3386
|
-
const
|
|
3407
|
+
const F = {};
|
|
3387
3408
|
if (r?.outputs) {
|
|
3388
3409
|
try {
|
|
3389
|
-
for (const [
|
|
3390
|
-
|
|
3410
|
+
for (const [j, z] of Object.entries(r.outputs))
|
|
3411
|
+
F[j] = oe({
|
|
3391
3412
|
payload: z,
|
|
3392
3413
|
context: {
|
|
3393
3414
|
$outputs: A.$outputs?.[b.workflowId] || {}
|
|
3394
3415
|
},
|
|
3395
3416
|
logger: t.options.logger
|
|
3396
3417
|
});
|
|
3397
|
-
} catch (
|
|
3418
|
+
} catch (j) {
|
|
3398
3419
|
const z = {
|
|
3399
3420
|
name: V.UNEXPECTED_ERROR,
|
|
3400
|
-
message:
|
|
3421
|
+
message: j.message,
|
|
3401
3422
|
passed: !1,
|
|
3402
3423
|
severity: t.severity.UNEXPECTED_ERROR
|
|
3403
3424
|
};
|
|
3404
3425
|
r.checks.push(z);
|
|
3405
3426
|
}
|
|
3406
3427
|
t.$steps[f] = {
|
|
3407
|
-
outputs:
|
|
3428
|
+
outputs: F
|
|
3408
3429
|
}, c?.workflowId && (t.$workflows[c.workflowId].steps[f] = {
|
|
3409
|
-
outputs:
|
|
3430
|
+
outputs: F,
|
|
3410
3431
|
request: void 0,
|
|
3411
3432
|
response: void 0
|
|
3412
3433
|
});
|
|
@@ -3427,23 +3448,23 @@ async function Br({ step: r, ctx: t, workflowId: e, retriesLeft: n, executedStep
|
|
|
3427
3448
|
passed: !1,
|
|
3428
3449
|
severity: t.severity.GLOBAL_TIMEOUT_ERROR
|
|
3429
3450
|
}), { shouldEnd: !0 };
|
|
3430
|
-
if (
|
|
3431
|
-
const b =
|
|
3451
|
+
if (S && S.length) {
|
|
3452
|
+
const b = S.find((A) => !("in" in We(A, t)));
|
|
3432
3453
|
if (b)
|
|
3433
3454
|
throw new Error(`Parameter "in" is required for ${f} step parameter ${b.name}`);
|
|
3434
3455
|
}
|
|
3435
|
-
let
|
|
3456
|
+
let N = !1, T;
|
|
3436
3457
|
try {
|
|
3437
3458
|
if (!e)
|
|
3438
3459
|
throw new Error("Workflow name is required to run a step");
|
|
3439
|
-
T = await
|
|
3440
|
-
const b = await
|
|
3460
|
+
T = await ic(t, r, e);
|
|
3461
|
+
const b = await Ja({
|
|
3441
3462
|
ctx: t,
|
|
3442
3463
|
workflowId: e,
|
|
3443
3464
|
step: r,
|
|
3444
3465
|
requestData: T
|
|
3445
3466
|
});
|
|
3446
|
-
|
|
3467
|
+
N = Object.values(b).every((A) => A);
|
|
3447
3468
|
} catch (b) {
|
|
3448
3469
|
r.verboseLog = t.apiClient.getVerboseResponseLogs();
|
|
3449
3470
|
const A = {
|
|
@@ -3454,41 +3475,41 @@ async function Br({ step: r, ctx: t, workflowId: e, retriesLeft: n, executedStep
|
|
|
3454
3475
|
};
|
|
3455
3476
|
r.checks.push(A);
|
|
3456
3477
|
}
|
|
3457
|
-
const L = t.options.verbose ? t.apiClient.getVerboseLogs() : void 0,
|
|
3458
|
-
if (
|
|
3459
|
-
testNameToDisplay: `${T?.method.toUpperCase()} ${Lt(
|
|
3478
|
+
const L = t.options.verbose ? t.apiClient.getVerboseLogs() : void 0, W = t.options.verbose ? t.apiClient.getVerboseResponseLogs() : void 0, D = T?.path || T?.serverUrl?.url;
|
|
3479
|
+
if (D ? Xo({
|
|
3480
|
+
testNameToDisplay: `${T?.method.toUpperCase()} ${Lt(D)}${r.stepId ? ` ${Re("- step")} ${Lt(ur(r.stepId))}` : ""}`,
|
|
3460
3481
|
checks: r.checks,
|
|
3461
3482
|
verboseLogs: L,
|
|
3462
|
-
verboseResponseLogs:
|
|
3483
|
+
verboseResponseLogs: W,
|
|
3463
3484
|
logger: t.options.logger
|
|
3464
|
-
}) :
|
|
3465
|
-
const b = await
|
|
3485
|
+
}) : Qo(r, t.options.logger), !N) {
|
|
3486
|
+
const b = await P(y, "failure", a);
|
|
3466
3487
|
if (b?.retriesLeft && b.retriesLeft > 0)
|
|
3467
3488
|
return b.stepResult;
|
|
3468
3489
|
if (b?.shouldEnd)
|
|
3469
3490
|
return { shouldEnd: !0 };
|
|
3470
3491
|
}
|
|
3471
|
-
if (
|
|
3492
|
+
if (E.length && N && (await P(E, "success", a))?.shouldEnd)
|
|
3472
3493
|
return { shouldEnd: !0 };
|
|
3473
|
-
async function
|
|
3474
|
-
for (const
|
|
3475
|
-
const { type:
|
|
3476
|
-
if (
|
|
3477
|
-
throw new Error(`Cannot use both workflowId: ${
|
|
3478
|
-
if (
|
|
3494
|
+
async function P(b = [], A, K) {
|
|
3495
|
+
for (const F of b) {
|
|
3496
|
+
const { type: j, criteria: z } = F;
|
|
3497
|
+
if (F.workflowId && F.stepId)
|
|
3498
|
+
throw new Error(`Cannot use both workflowId: ${F.workflowId} and stepId: ${F.stepId} in ${F.type} action`);
|
|
3499
|
+
if (Ds({
|
|
3479
3500
|
workflowId: e,
|
|
3480
3501
|
step: r,
|
|
3481
3502
|
criteria: z,
|
|
3482
3503
|
ctx: t
|
|
3483
3504
|
}).every((I) => I.passed)) {
|
|
3484
|
-
const I =
|
|
3485
|
-
if (
|
|
3486
|
-
const { retryAfter: ee, retryLimit: he = 0 } =
|
|
3505
|
+
const I = F.workflowId ? fe({ value: F.workflowId, ctx: t, logger: t.options.logger }) : void 0, B = F.workflowId ? await xr(F.workflowId, I, t, t.options.config) : { ...t, executedSteps: [] }, H = F.stepId ? F.stepId : void 0;
|
|
3506
|
+
if (j === "retry") {
|
|
3507
|
+
const { retryAfter: ee, retryLimit: he = 0 } = F;
|
|
3487
3508
|
if (n = n ?? he, r.retriesLeft = n, n === 0)
|
|
3488
3509
|
return { retriesLeft: 0, shouldEnd: !1 };
|
|
3489
|
-
if (ee && await
|
|
3510
|
+
if (ee && await Xa(ee), (I || H) && Nt({
|
|
3490
3511
|
stepId: f,
|
|
3491
|
-
actionName:
|
|
3512
|
+
actionName: F.name,
|
|
3492
3513
|
kind: A,
|
|
3493
3514
|
logger: t.options.logger
|
|
3494
3515
|
}), I) {
|
|
@@ -3497,7 +3518,8 @@ async function Br({ step: r, ctx: t, workflowId: e, retriesLeft: n, executedStep
|
|
|
3497
3518
|
ctx: B,
|
|
3498
3519
|
skipLineSeparator: !0,
|
|
3499
3520
|
invocationContext: `Retry action for step ${f}`,
|
|
3500
|
-
executedStepsCount: K
|
|
3521
|
+
executedStepsCount: K,
|
|
3522
|
+
retriesLeft: n - 1
|
|
3501
3523
|
});
|
|
3502
3524
|
t.executedSteps.push(ne);
|
|
3503
3525
|
} else if (H) {
|
|
@@ -3524,14 +3546,14 @@ async function Br({ step: r, ctx: t, workflowId: e, retriesLeft: n, executedStep
|
|
|
3524
3546
|
retriesLeft: n
|
|
3525
3547
|
};
|
|
3526
3548
|
} else {
|
|
3527
|
-
if (
|
|
3549
|
+
if (j === "end")
|
|
3528
3550
|
return { shouldEnd: !0 };
|
|
3529
|
-
if (
|
|
3551
|
+
if (j === "goto") {
|
|
3530
3552
|
if (!I && !H)
|
|
3531
3553
|
throw new Error("Either workflowId or stepId must be provided in goto action");
|
|
3532
3554
|
(I || H) && Nt({
|
|
3533
3555
|
stepId: f,
|
|
3534
|
-
actionName:
|
|
3556
|
+
actionName: F.name,
|
|
3535
3557
|
kind: A,
|
|
3536
3558
|
logger: t.options.logger
|
|
3537
3559
|
});
|
|
@@ -3565,12 +3587,12 @@ function ar(r) {
|
|
|
3565
3587
|
}
|
|
3566
3588
|
}
|
|
3567
3589
|
}
|
|
3568
|
-
async function
|
|
3590
|
+
async function cc({ options: r, collectSpecData: t, executedStepsCount: e }) {
|
|
3569
3591
|
const n = {
|
|
3570
3592
|
...r,
|
|
3571
3593
|
filePath: r.file,
|
|
3572
3594
|
metadata: { ...r }
|
|
3573
|
-
}, a = await
|
|
3595
|
+
}, a = await ds({
|
|
3574
3596
|
filePath: r.file,
|
|
3575
3597
|
collectSpecData: t,
|
|
3576
3598
|
version: r?.version,
|
|
@@ -3578,115 +3600,116 @@ async function ac({ options: r, collectSpecData: t, executedStepsCount: e }) {
|
|
|
3578
3600
|
externalRefResolver: r?.externalRefResolver,
|
|
3579
3601
|
skipLint: r?.skipLint
|
|
3580
3602
|
});
|
|
3581
|
-
return await
|
|
3603
|
+
return await fc({
|
|
3582
3604
|
testDescription: a,
|
|
3583
3605
|
options: n,
|
|
3584
3606
|
executedStepsCount: e
|
|
3585
3607
|
});
|
|
3586
3608
|
}
|
|
3587
|
-
async function
|
|
3588
|
-
const n = new
|
|
3609
|
+
async function fc({ testDescription: r, options: t, executedStepsCount: e }) {
|
|
3610
|
+
const n = new Xi({
|
|
3589
3611
|
fetch: t.fetch
|
|
3590
|
-
}), a = await
|
|
3612
|
+
}), a = await gs(r, t, n), c = ar(t.workflow), f = ar(t.skip), l = ta({
|
|
3591
3613
|
workflows: a.workflows,
|
|
3592
3614
|
workflowsToRun: c,
|
|
3593
3615
|
workflowsToSkip: f,
|
|
3594
3616
|
logger: a.options.logger
|
|
3595
3617
|
}), h = [];
|
|
3596
3618
|
for (const d of l) {
|
|
3597
|
-
a.executedSteps = [], d.dependsOn?.length && await
|
|
3598
|
-
const
|
|
3619
|
+
a.executedSteps = [], d.dependsOn?.length && await uc({ workflow: d, ctx: a, config: t.config, executedStepsCount: e });
|
|
3620
|
+
const m = await Ue({
|
|
3599
3621
|
workflowInput: d.workflowId,
|
|
3600
3622
|
ctx: a,
|
|
3601
3623
|
executedStepsCount: e
|
|
3602
3624
|
});
|
|
3603
|
-
h.push(
|
|
3625
|
+
h.push(m);
|
|
3604
3626
|
}
|
|
3605
3627
|
return { ctx: a, executedWorkflows: h };
|
|
3606
3628
|
}
|
|
3607
|
-
async function Ue({ workflowInput: r, ctx: t, fromStepId: e, skipLineSeparator: n, parentStepId: a, invocationContext: c, executedStepsCount: f }) {
|
|
3608
|
-
const { logger:
|
|
3609
|
-
if (!
|
|
3629
|
+
async function Ue({ workflowInput: r, ctx: t, fromStepId: e, skipLineSeparator: n, parentStepId: a, invocationContext: c, executedStepsCount: f, retriesLeft: l }) {
|
|
3630
|
+
const { logger: h } = t.options, d = performance.now(), m = Y.basename(t.options.filePath), y = typeof r == "string" ? t.workflows.find((D) => D.workflowId === r) : r;
|
|
3631
|
+
if (!y)
|
|
3610
3632
|
throw new Error(`
|
|
3611
3633
|
${Re("Workflow")} ${r} ${Re("not found")}
|
|
3612
3634
|
`);
|
|
3613
|
-
const
|
|
3614
|
-
if (
|
|
3615
|
-
const
|
|
3616
|
-
t.$workflows[
|
|
3617
|
-
inputs:
|
|
3618
|
-
workflowInputSchema:
|
|
3635
|
+
const E = y.inputs;
|
|
3636
|
+
if (E) {
|
|
3637
|
+
const D = t.$workflows[y.workflowId].inputs;
|
|
3638
|
+
t.$workflows[y.workflowId].inputs = hs({
|
|
3639
|
+
inputs: D,
|
|
3640
|
+
workflowInputSchema: E,
|
|
3619
3641
|
env: t.options.envVariables
|
|
3620
3642
|
});
|
|
3621
3643
|
}
|
|
3622
|
-
const
|
|
3623
|
-
e ||
|
|
3624
|
-
fileName:
|
|
3625
|
-
workflowName:
|
|
3644
|
+
const S = y.workflowId;
|
|
3645
|
+
e || Zo({
|
|
3646
|
+
fileName: m,
|
|
3647
|
+
workflowName: S,
|
|
3626
3648
|
skipLineSeparator: n,
|
|
3627
|
-
logger:
|
|
3649
|
+
logger: h
|
|
3628
3650
|
});
|
|
3629
|
-
const
|
|
3651
|
+
const N = e ? y.steps.findIndex((D) => D.stepId === e) : 0, T = y.steps.slice(N);
|
|
3630
3652
|
t.$steps = {};
|
|
3631
|
-
for (const
|
|
3653
|
+
for (const D of T)
|
|
3632
3654
|
try {
|
|
3633
3655
|
if ((await Br({
|
|
3634
|
-
step:
|
|
3656
|
+
step: D,
|
|
3635
3657
|
ctx: t,
|
|
3636
|
-
workflowId:
|
|
3637
|
-
executedStepsCount: f
|
|
3658
|
+
workflowId: S,
|
|
3659
|
+
executedStepsCount: f,
|
|
3660
|
+
retriesLeft: l
|
|
3638
3661
|
}))?.shouldEnd)
|
|
3639
3662
|
break;
|
|
3640
|
-
} catch (
|
|
3641
|
-
const
|
|
3663
|
+
} catch (P) {
|
|
3664
|
+
const b = {
|
|
3642
3665
|
name: V.UNEXPECTED_ERROR,
|
|
3643
|
-
message:
|
|
3666
|
+
message: P.message,
|
|
3644
3667
|
passed: !1,
|
|
3645
3668
|
severity: t.severity.UNEXPECTED_ERROR
|
|
3646
3669
|
};
|
|
3647
|
-
|
|
3670
|
+
D.checks.push(b), t.executedSteps.push(D);
|
|
3648
3671
|
}
|
|
3649
|
-
const
|
|
3650
|
-
if (
|
|
3651
|
-
t.$outputs || (t.$outputs = {}), t.$outputs[
|
|
3652
|
-
const
|
|
3672
|
+
const L = y.steps.some((D) => D.checks?.some((P) => !P.passed && P.name == V.GLOBAL_TIMEOUT_ERROR));
|
|
3673
|
+
if (y.outputs && S && !L) {
|
|
3674
|
+
t.$outputs || (t.$outputs = {}), t.$outputs[S] || (t.$outputs[S] = {});
|
|
3675
|
+
const D = lr({
|
|
3653
3676
|
ctx: {
|
|
3654
3677
|
...t,
|
|
3655
3678
|
$inputs: {
|
|
3656
3679
|
...t.$inputs || {},
|
|
3657
|
-
...t.$workflows[
|
|
3680
|
+
...t.$workflows[S]?.inputs || {}
|
|
3658
3681
|
}
|
|
3659
3682
|
},
|
|
3660
|
-
workflowId:
|
|
3661
|
-
}),
|
|
3662
|
-
for (const
|
|
3683
|
+
workflowId: S
|
|
3684
|
+
}), P = {};
|
|
3685
|
+
for (const b of Object.keys(y.outputs))
|
|
3663
3686
|
try {
|
|
3664
|
-
|
|
3665
|
-
payload:
|
|
3666
|
-
context:
|
|
3687
|
+
P[b] = oe({
|
|
3688
|
+
payload: y.outputs[b],
|
|
3689
|
+
context: D,
|
|
3667
3690
|
logger: t.options.logger
|
|
3668
3691
|
});
|
|
3669
|
-
} catch (
|
|
3670
|
-
throw new Error(`Failed to resolve output "${
|
|
3692
|
+
} catch (A) {
|
|
3693
|
+
throw new Error(`Failed to resolve output "${b}" in workflow "${S}": ${A.message}`);
|
|
3671
3694
|
}
|
|
3672
|
-
t.$outputs[
|
|
3695
|
+
t.$outputs[S] = P, t.$workflows[S].outputs = P;
|
|
3673
3696
|
}
|
|
3674
|
-
|
|
3675
|
-
const
|
|
3697
|
+
y.time = Math.ceil(performance.now() - d), h.printNewLine();
|
|
3698
|
+
const W = performance.now();
|
|
3676
3699
|
return {
|
|
3677
3700
|
type: "workflow",
|
|
3678
3701
|
invocationContext: c,
|
|
3679
|
-
workflowId:
|
|
3702
|
+
workflowId: S,
|
|
3680
3703
|
stepId: a,
|
|
3681
|
-
startTime:
|
|
3682
|
-
endTime:
|
|
3683
|
-
totalTimeMs:
|
|
3704
|
+
startTime: d,
|
|
3705
|
+
endTime: W,
|
|
3706
|
+
totalTimeMs: dc(t.executedSteps),
|
|
3684
3707
|
executedSteps: t.executedSteps,
|
|
3685
3708
|
ctx: t,
|
|
3686
|
-
globalTimeoutError:
|
|
3709
|
+
globalTimeoutError: L
|
|
3687
3710
|
};
|
|
3688
3711
|
}
|
|
3689
|
-
async function
|
|
3712
|
+
async function uc({ workflow: r, ctx: t, config: e, executedStepsCount: n }) {
|
|
3690
3713
|
if (!r.dependsOn?.length)
|
|
3691
3714
|
return;
|
|
3692
3715
|
const a = await Promise.all(r.dependsOn.map(async (l) => {
|
|
@@ -3695,7 +3718,7 @@ async function fc({ workflow: r, ctx: t, config: e, executedStepsCount: n }) {
|
|
|
3695
3718
|
ctx: t,
|
|
3696
3719
|
logger: t.options.logger
|
|
3697
3720
|
}), d = await xr(l, h, t, e);
|
|
3698
|
-
return
|
|
3721
|
+
return Go(r.workflowId, t.options.logger), Ue({
|
|
3699
3722
|
workflowInput: h,
|
|
3700
3723
|
ctx: d,
|
|
3701
3724
|
skipLineSeparator: !0,
|
|
@@ -3707,9 +3730,9 @@ async function fc({ workflow: r, ctx: t, config: e, executedStepsCount: n }) {
|
|
|
3707
3730
|
}
|
|
3708
3731
|
async function xr(r, t, e, n) {
|
|
3709
3732
|
const a = r && r.startsWith("$sourceDescriptions.") && r.split(".")[1], c = a && e.$sourceDescriptions[a];
|
|
3710
|
-
return c ? await
|
|
3733
|
+
return c ? await gs(c, {
|
|
3711
3734
|
...e.options,
|
|
3712
|
-
filePath:
|
|
3735
|
+
filePath: lc(a, e.sourceDescriptions, e.options),
|
|
3713
3736
|
workflow: [t.workflowId],
|
|
3714
3737
|
skip: void 0,
|
|
3715
3738
|
config: n
|
|
@@ -3718,7 +3741,7 @@ async function xr(r, t, e, n) {
|
|
|
3718
3741
|
executedSteps: []
|
|
3719
3742
|
};
|
|
3720
3743
|
}
|
|
3721
|
-
function
|
|
3744
|
+
function lc(r, t, e) {
|
|
3722
3745
|
const n = t && t.find(({ name: a }) => a === r);
|
|
3723
3746
|
if (n) {
|
|
3724
3747
|
if (n.type === "openapi")
|
|
@@ -3728,21 +3751,21 @@ function uc(r, t, e) {
|
|
|
3728
3751
|
throw new Error(`Unknown source description type ${n.type}`);
|
|
3729
3752
|
} else return "";
|
|
3730
3753
|
}
|
|
3731
|
-
function
|
|
3754
|
+
function pc(r) {
|
|
3732
3755
|
return "type" in r && r.type === "workflow";
|
|
3733
3756
|
}
|
|
3734
|
-
function
|
|
3757
|
+
function dc(r) {
|
|
3735
3758
|
let t = 0;
|
|
3736
3759
|
for (const e of r)
|
|
3737
|
-
|
|
3760
|
+
pc(e) ? t += e.totalTimeMs : t += e.response?.time || 0;
|
|
3738
3761
|
return t;
|
|
3739
3762
|
}
|
|
3740
|
-
async function
|
|
3763
|
+
async function mc(r) {
|
|
3741
3764
|
const t = { value: 0 }, { files: e, executionTimeout: n, collectSpecData: a } = r;
|
|
3742
3765
|
n && (ce.reset(), ce.getInstance(n));
|
|
3743
3766
|
const c = [], f = [];
|
|
3744
3767
|
for (const l of e) {
|
|
3745
|
-
const h = await
|
|
3768
|
+
const h = await hc({
|
|
3746
3769
|
options: { ...r, file: l },
|
|
3747
3770
|
startedAt: performance.now(),
|
|
3748
3771
|
collectSpecData: a,
|
|
@@ -3752,9 +3775,9 @@ async function gc(r) {
|
|
|
3752
3775
|
}
|
|
3753
3776
|
return f;
|
|
3754
3777
|
}
|
|
3755
|
-
async function
|
|
3756
|
-
const a = await
|
|
3757
|
-
return (l.steps.failed > 0 || l.steps.warnings > 0 || l.steps.skipped > 0) &&
|
|
3778
|
+
async function hc({ options: r, startedAt: t, executedStepsCount: e, collectSpecData: n }) {
|
|
3779
|
+
const a = await cc({ options: r, collectSpecData: n, executedStepsCount: e }), { executedWorkflows: c, ctx: f } = a, l = Vr(c), h = l.workflows.failed > 0, d = l.workflows.warnings > 0, m = c.some((y) => y.globalTimeoutError);
|
|
3780
|
+
return (l.steps.failed > 0 || l.steps.warnings > 0 || l.steps.skipped > 0) && Ui(c, r.logger), ji({ startedAt: t, workflows: c, options: r }), {
|
|
3758
3781
|
hasProblems: h,
|
|
3759
3782
|
hasWarnings: d,
|
|
3760
3783
|
file: r.file,
|
|
@@ -3763,7 +3786,7 @@ async function dc({ options: r, startedAt: t, executedStepsCount: e, collectSpec
|
|
|
3763
3786
|
ctx: f,
|
|
3764
3787
|
totalTimeMs: performance.now() - t,
|
|
3765
3788
|
totalRequests: l.totalRequests,
|
|
3766
|
-
globalTimeoutError:
|
|
3789
|
+
globalTimeoutError: m,
|
|
3767
3790
|
...f.noSecretsMasking && { secretValues: Array.from(f.secretsSet) || [] }
|
|
3768
3791
|
};
|
|
3769
3792
|
}
|
|
@@ -3771,7 +3794,7 @@ export {
|
|
|
3771
3794
|
Ze as RESET_ESCAPE_CODE,
|
|
3772
3795
|
Vr as calculateTotals,
|
|
3773
3796
|
ge as conditionallyMaskSecrets,
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
|
|
3797
|
+
Bi as maskSecrets,
|
|
3798
|
+
Io as parseRuntimeExpression,
|
|
3799
|
+
mc as run
|
|
3777
3800
|
};
|