@redocly/replay 0.17.0-next.7 → 0.17.0-next.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  var Ps = Object.defineProperty;
2
2
  var ws = (u, e, a) => e in u ? Ps(u, e, { enumerable: !0, configurable: !0, writable: !0, value: a }) : u[e] = a;
3
3
  var Gu = (u, e, a) => ws(u, typeof e != "symbol" ? e + "" : e, a);
4
- import { b as G1, t as Ks, p as _u, J as k0, i as Oa, a as Ha, r as Ts, c as Ar, m as Ls, s as Ns, d as _1, e as Rs, f as Hs, g as Ia, h as Gs, l as _s, j as Vs, k as $s } from "./replay-index-BsI8FEgB.js";
4
+ import { b as G1, t as Ks, p as _u, J as k0, i as Oa, a as Ha, r as Ts, c as Ar, m as Ls, s as Ns, d as _1, e as Rs, f as Hs, g as Ia, h as Gs, l as _s, j as Vs, k as $s } from "./replay-index-QhD5ghNA.js";
5
5
  async function Js(u) {
6
6
  const { descriptionPath: e, externalRefResolver: a, base: i } = u, r = await G1({
7
7
  base: i,
@@ -77,47 +77,47 @@ const {
77
77
  (e, a) => ({ ...e, [a]: String }),
78
78
  {}
79
79
  ), {
80
- reset: meu,
80
+ reset: keu,
81
81
  bold: h0,
82
82
  dim: al,
83
- italic: Feu,
83
+ italic: heu,
84
84
  underline: il,
85
85
  inverse: O1,
86
- hidden: keu,
87
- strikethrough: heu,
88
- black: peu,
86
+ hidden: peu,
87
+ strikethrough: geu,
88
+ black: Ceu,
89
89
  red: Au,
90
90
  green: J0,
91
91
  yellow: p0,
92
92
  blue: Mu,
93
- magenta: geu,
94
- cyan: Ceu,
93
+ magenta: veu,
94
+ cyan: beu,
95
95
  white: yr,
96
96
  gray: ju,
97
- bgBlack: veu,
97
+ bgBlack: Beu,
98
98
  bgRed: Ta,
99
- bgGreen: beu,
100
- bgYellow: Beu,
101
- bgBlue: Aeu,
102
- bgMagenta: feu,
103
- bgCyan: yeu,
104
- bgWhite: zeu,
105
- blackBright: Seu,
106
- redBright: Meu,
107
- greenBright: jeu,
108
- yellowBright: Peu,
109
- blueBright: weu,
110
- magentaBright: Keu,
111
- cyanBright: Teu,
112
- whiteBright: Leu,
113
- bgBlackBright: Neu,
114
- bgRedBright: Reu,
115
- bgGreenBright: Heu,
116
- bgYellowBright: Geu,
117
- bgBlueBright: _eu,
118
- bgMagentaBright: Veu,
119
- bgCyanBright: $eu,
120
- bgWhiteBright: Jeu
99
+ bgGreen: Aeu,
100
+ bgYellow: feu,
101
+ bgBlue: yeu,
102
+ bgMagenta: zeu,
103
+ bgCyan: Seu,
104
+ bgWhite: Meu,
105
+ blackBright: jeu,
106
+ redBright: Peu,
107
+ greenBright: weu,
108
+ yellowBright: Keu,
109
+ blueBright: Teu,
110
+ magentaBright: Leu,
111
+ cyanBright: Neu,
112
+ whiteBright: Reu,
113
+ bgBlackBright: Heu,
114
+ bgRedBright: Geu,
115
+ bgGreenBright: _eu,
116
+ bgYellowBright: Veu,
117
+ bgBlueBright: $eu,
118
+ bgMagentaBright: Jeu,
119
+ bgCyanBright: Oeu,
120
+ bgWhiteBright: Ieu
121
121
  } = el(), rl = (u) => /\{.*?\}/.test(u);
122
122
  function D0({ value: u, ctx: e, logger: a }) {
123
123
  if (!u)
@@ -16269,7 +16269,7 @@ async function me({ workflowInput: u, ctx: e, fromStepId: a, skipLineSeparator:
16269
16269
  stepId: r,
16270
16270
  startTime: t,
16271
16271
  endTime: C,
16272
- totalTimeMs: Math.ceil(C - t),
16272
+ totalTimeMs: ceu(e.executedSteps),
16273
16273
  executedSteps: e.executedSteps,
16274
16274
  ctx: e,
16275
16275
  globalTimeoutError: F
@@ -16318,12 +16318,22 @@ function Deu(u, e, a) {
16318
16318
  throw new Error(`Unknown source description type ${i.type}`);
16319
16319
  } else return "";
16320
16320
  }
16321
- async function qeu(u) {
16321
+ function xeu(u) {
16322
+ return "type" in u && u.type === "workflow";
16323
+ }
16324
+ function ceu(u) {
16325
+ var a;
16326
+ let e = 0;
16327
+ for (const i of u)
16328
+ xeu(i) ? e += i.totalTimeMs : e += ((a = i.response) == null ? void 0 : a.time) || 0;
16329
+ return e;
16330
+ }
16331
+ async function Ueu(u) {
16322
16332
  const e = { value: 0 }, { files: a, executionTimeout: i, collectSpecData: r } = u;
16323
16333
  i && (E0.reset(), E0.getInstance(i));
16324
16334
  const o = [], n = [];
16325
16335
  for (const s of a) {
16326
- const t = await xeu({
16336
+ const t = await deu({
16327
16337
  options: { ...u, file: s },
16328
16338
  startedAt: performance.now(),
16329
16339
  collectSpecData: r,
@@ -16333,7 +16343,7 @@ async function qeu(u) {
16333
16343
  }
16334
16344
  return n;
16335
16345
  }
16336
- async function xeu({ options: u, startedAt: e, executedStepsCount: a, collectSpecData: i }) {
16346
+ async function deu({ options: u, startedAt: e, executedStepsCount: a, collectSpecData: i }) {
16337
16347
  const r = await seu({ options: u, collectSpecData: i, executedStepsCount: a }), { executedWorkflows: o, ctx: n } = r, s = Ui(o), t = s.workflows.failed > 0, E = s.workflows.warnings > 0, l = o.some((D) => D.globalTimeoutError);
16338
16348
  return (s.steps.failed > 0 || s.steps.warnings > 0 || s.steps.skipped > 0) && jE(o, u.logger), zE({ startedAt: e, workflows: o, options: u }), {
16339
16349
  hasProblems: t,
@@ -16352,5 +16362,5 @@ export {
16352
16362
  Ui as calculateTotals,
16353
16363
  f0 as maskSecrets,
16354
16364
  zl as parseRuntimeExpression,
16355
- qeu as run
16365
+ Ueu as run
16356
16366
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./replay-index-yAz2oPW9.js");async function n(e={}){return typeof e=="object"&&Object.freeze(e),await t.invoke("plugin:dialog|open",{options:e})}exports.open=n;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./replay-index-PXPyKjOk.js");async function n(e={}){return typeof e=="object"&&Object.freeze(e),await t.invoke("plugin:dialog|open",{options:e})}exports.open=n;
@@ -1,4 +1,4 @@
1
- import { v as n } from "./replay-index-BsI8FEgB.js";
1
+ import { v as n } from "./replay-index-QhD5ghNA.js";
2
2
  async function r(e = {}) {
3
3
  return typeof e == "object" && Object.freeze(e), await n("plugin:dialog|open", { options: e });
4
4
  }
@@ -1,4 +1,4 @@
1
- "use strict";var fs=Object.defineProperty;var ys=(u,e,a)=>e in u?fs(u,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):u[e]=a;var _u=(u,e,a)=>ys(u,typeof e!="symbol"?e+"":e,a);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const xu=require("./replay-index-yAz2oPW9.js");async function zs(u){const{descriptionPath:e,externalRefResolver:a,base:i}=u,r=await xu.bundle({base:i,ref:e,config:u.config,dereference:!0,externalRefResolver:a});if(!r)throw new Error(`Could not find source description file '${e}'.`);return r.bundle.parsed}function T1(u){var a;if(typeof u!="object")return;const e=Object.keys(u)[0];return e?(a=u[e])==null?void 0:a.value:void 0}const{env:w0={},argv:L1=[],platform:Ss=""}=typeof process>"u"?{}:process,Ms="NO_COLOR"in w0||L1.includes("--no-color"),js="FORCE_COLOR"in w0||L1.includes("--color"),Ps=Ss==="win32",ws=w0.TERM==="dumb",Ks=xu.tty&&void 0,Ts="CI"in w0&&("GITHUB_ACTIONS"in w0||"GITLAB_CI"in w0||"CIRCLECI"in w0),Ls=!Ms&&(js||Ps&&!ws||Ks||Ts),N1=(u,e,a,i,r=e.substring(0,u)+i,o=e.substring(u+a.length),n=o.indexOf(a))=>r+(n<0?o:N1(n,o,a,i)),Ns=(u,e,a,i,r)=>u<0?a+e+i:a+N1(u,e,i,r)+i,Rs=(u,e,a=u,i=u.length+1)=>r=>r||!(r===""||r===void 0)?Ns((""+r).indexOf(e,i),r,u,e,a):"",hu=(u,e,a)=>Rs(`\x1B[${u}m`,`\x1B[${e}m`,a),Cr={reset:hu(0,0),bold:hu(1,22,"\x1B[22m\x1B[1m"),dim:hu(2,22,"\x1B[22m\x1B[2m"),italic:hu(3,23),underline:hu(4,24),inverse:hu(7,27),hidden:hu(8,28),strikethrough:hu(9,29),black:hu(30,39),red:hu(31,39),green:hu(32,39),yellow:hu(33,39),blue:hu(34,39),magenta:hu(35,39),cyan:hu(36,39),white:hu(37,39),gray:hu(90,39),bgBlack:hu(40,49),bgRed:hu(41,49),bgGreen:hu(42,49),bgYellow:hu(43,49),bgBlue:hu(44,49),bgMagenta:hu(45,49),bgCyan:hu(46,49),bgWhite:hu(47,49),blackBright:hu(90,39),redBright:hu(91,39),greenBright:hu(92,39),yellowBright:hu(93,39),blueBright:hu(94,39),magentaBright:hu(95,39),cyanBright:hu(96,39),whiteBright:hu(97,39),bgBlackBright:hu(100,49),bgRedBright:hu(101,49),bgGreenBright:hu(102,49),bgYellowBright:hu(103,49),bgBlueBright:hu(104,49),bgMagentaBright:hu(105,49),bgCyanBright:hu(106,49),bgWhiteBright:hu(107,49)},Hs=({useColor:u=Ls}={})=>u?Cr:Object.keys(Cr).reduce((e,a)=>({...e,[a]:String}),{}),{reset:Q0u,bold:h0,dim:Gs,italic:X0u,underline:_s,inverse:R1,hidden:ueu,strikethrough:eeu,black:aeu,red:fu,green:$0,yellow:p0,blue:ju,magenta:ieu,cyan:reu,white:vr,gray:Pu,bgBlack:neu,bgRed:Ka,bgGreen:oeu,bgYellow:teu,bgBlue:seu,bgMagenta:leu,bgCyan:Eeu,bgWhite:Deu,blackBright:xeu,redBright:ceu,greenBright:deu,yellowBright:meu,blueBright:Feu,magentaBright:keu,cyanBright:heu,whiteBright:peu,bgBlackBright:geu,bgRedBright:Ceu,bgGreenBright:veu,bgYellowBright:beu,bgBlueBright:Beu,bgMagentaBright:Aeu,bgCyanBright:feu,bgWhiteBright:yeu}=Hs(),Vs=u=>/\{.*?\}/.test(u);function D0({value:u,ctx:e,logger:a}){if(!u)return u;if(typeof u=="object"){for(const i in u)u[i]=D0({value:u[i],ctx:e,logger:a});return u}return typeof u=="number"||typeof u=="boolean"?u:u.toString().startsWith("$faker.")?me({pointer:u.slice(1),ctx:e,logger:a}):Vs(u)?Os(u,e,a):qs(u,e,a)}function $s(u,e,a){const i=u.indexOf("{");if(i!==-1){const o=u.substring(i+1).slice(0,-1),n=me({pointer:o.slice(1),ctx:e,logger:a});return n&&u.replace(/{(.*)}/,n)}else return u}function Js(u,e){const a=Object.keys(e),i=Object.values(e);return new Function(...a,`return ${u}`)(...i)}function Os(u,e,a){const i=/\{\$(\{[^{}]*\}|[^{}])*\}/g;let r=u;return r=r.replace(i,(o,n)=>Is(o,e,a)),r}function Is(u,e,a){if(!u.includes("$"))return u;if(u.includes("$faker."))return $s(u,e,a);const i=xe(e)(Ws(u));return i!==void 0?i:""}const qs=(u,e,a)=>{if(!u)return u;const i=u.toString();if(!i.includes("$"))return u;if(i.startsWith("$file(")&&i.endsWith(")"))return i.slice(7,-2);if(i.startsWith("$sourceDescriptions.")&&i.includes(".workflows.")){const r=i.split("."),o=r[1],n=r[3];if(!o||!n)return;const s=xe(e)("$sourceDescriptions");return s[o]?s[o].workflows.find(t=>t.workflowId===n):void 0}return i&&i.trim().startsWith("faker.")?me({pointer:i,ctx:e,logger:a}):i?xe(e)(br(i)):i.replace(/\$\{([^}]+)}/g,(r,o)=>xe(e)(br(o)))};function Ws(u){return u.replace(/\{(.*)\}/,"$1")}function br(u){return u.replace(/\['(.*?)'\]/g,".$1")}const xe=(u,e="")=>a=>{if(e||(e=a),!a)return u;const[i,...r]=a.split(".");if(!u)throw Error(`Cannot get ${fu(i)} from ${fu(e)}`);if((u==null?void 0:u[i])===void 0){const o=` Undefined ${fu(i)} at ${fu(e)}.`,n=Object.keys(u).length?`Did you mean to use another key? Available keys:
1
+ "use strict";var fs=Object.defineProperty;var ys=(u,e,a)=>e in u?fs(u,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):u[e]=a;var _u=(u,e,a)=>ys(u,typeof e!="symbol"?e+"":e,a);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const xu=require("./replay-index-PXPyKjOk.js");async function zs(u){const{descriptionPath:e,externalRefResolver:a,base:i}=u,r=await xu.bundle({base:i,ref:e,config:u.config,dereference:!0,externalRefResolver:a});if(!r)throw new Error(`Could not find source description file '${e}'.`);return r.bundle.parsed}function T1(u){var a;if(typeof u!="object")return;const e=Object.keys(u)[0];return e?(a=u[e])==null?void 0:a.value:void 0}const{env:w0={},argv:L1=[],platform:Ss=""}=typeof process>"u"?{}:process,Ms="NO_COLOR"in w0||L1.includes("--no-color"),js="FORCE_COLOR"in w0||L1.includes("--color"),Ps=Ss==="win32",ws=w0.TERM==="dumb",Ks=xu.tty&&void 0,Ts="CI"in w0&&("GITHUB_ACTIONS"in w0||"GITLAB_CI"in w0||"CIRCLECI"in w0),Ls=!Ms&&(js||Ps&&!ws||Ks||Ts),N1=(u,e,a,i,r=e.substring(0,u)+i,o=e.substring(u+a.length),n=o.indexOf(a))=>r+(n<0?o:N1(n,o,a,i)),Ns=(u,e,a,i,r)=>u<0?a+e+i:a+N1(u,e,i,r)+i,Rs=(u,e,a=u,i=u.length+1)=>r=>r||!(r===""||r===void 0)?Ns((""+r).indexOf(e,i),r,u,e,a):"",hu=(u,e,a)=>Rs(`\x1B[${u}m`,`\x1B[${e}m`,a),Cr={reset:hu(0,0),bold:hu(1,22,"\x1B[22m\x1B[1m"),dim:hu(2,22,"\x1B[22m\x1B[2m"),italic:hu(3,23),underline:hu(4,24),inverse:hu(7,27),hidden:hu(8,28),strikethrough:hu(9,29),black:hu(30,39),red:hu(31,39),green:hu(32,39),yellow:hu(33,39),blue:hu(34,39),magenta:hu(35,39),cyan:hu(36,39),white:hu(37,39),gray:hu(90,39),bgBlack:hu(40,49),bgRed:hu(41,49),bgGreen:hu(42,49),bgYellow:hu(43,49),bgBlue:hu(44,49),bgMagenta:hu(45,49),bgCyan:hu(46,49),bgWhite:hu(47,49),blackBright:hu(90,39),redBright:hu(91,39),greenBright:hu(92,39),yellowBright:hu(93,39),blueBright:hu(94,39),magentaBright:hu(95,39),cyanBright:hu(96,39),whiteBright:hu(97,39),bgBlackBright:hu(100,49),bgRedBright:hu(101,49),bgGreenBright:hu(102,49),bgYellowBright:hu(103,49),bgBlueBright:hu(104,49),bgMagentaBright:hu(105,49),bgCyanBright:hu(106,49),bgWhiteBright:hu(107,49)},Hs=({useColor:u=Ls}={})=>u?Cr:Object.keys(Cr).reduce((e,a)=>({...e,[a]:String}),{}),{reset:ueu,bold:h0,dim:Gs,italic:eeu,underline:_s,inverse:R1,hidden:aeu,strikethrough:ieu,black:reu,red:fu,green:$0,yellow:p0,blue:ju,magenta:neu,cyan:oeu,white:vr,gray:Pu,bgBlack:teu,bgRed:Ka,bgGreen:seu,bgYellow:leu,bgBlue:Eeu,bgMagenta:Deu,bgCyan:xeu,bgWhite:ceu,blackBright:deu,redBright:meu,greenBright:Feu,yellowBright:keu,blueBright:heu,magentaBright:peu,cyanBright:geu,whiteBright:Ceu,bgBlackBright:veu,bgRedBright:beu,bgGreenBright:Beu,bgYellowBright:Aeu,bgBlueBright:feu,bgMagentaBright:yeu,bgCyanBright:zeu,bgWhiteBright:Seu}=Hs(),Vs=u=>/\{.*?\}/.test(u);function D0({value:u,ctx:e,logger:a}){if(!u)return u;if(typeof u=="object"){for(const i in u)u[i]=D0({value:u[i],ctx:e,logger:a});return u}return typeof u=="number"||typeof u=="boolean"?u:u.toString().startsWith("$faker.")?me({pointer:u.slice(1),ctx:e,logger:a}):Vs(u)?Os(u,e,a):qs(u,e,a)}function $s(u,e,a){const i=u.indexOf("{");if(i!==-1){const o=u.substring(i+1).slice(0,-1),n=me({pointer:o.slice(1),ctx:e,logger:a});return n&&u.replace(/{(.*)}/,n)}else return u}function Js(u,e){const a=Object.keys(e),i=Object.values(e);return new Function(...a,`return ${u}`)(...i)}function Os(u,e,a){const i=/\{\$(\{[^{}]*\}|[^{}])*\}/g;let r=u;return r=r.replace(i,(o,n)=>Is(o,e,a)),r}function Is(u,e,a){if(!u.includes("$"))return u;if(u.includes("$faker."))return $s(u,e,a);const i=xe(e)(Ws(u));return i!==void 0?i:""}const qs=(u,e,a)=>{if(!u)return u;const i=u.toString();if(!i.includes("$"))return u;if(i.startsWith("$file(")&&i.endsWith(")"))return i.slice(7,-2);if(i.startsWith("$sourceDescriptions.")&&i.includes(".workflows.")){const r=i.split("."),o=r[1],n=r[3];if(!o||!n)return;const s=xe(e)("$sourceDescriptions");return s[o]?s[o].workflows.find(t=>t.workflowId===n):void 0}return i&&i.trim().startsWith("faker.")?me({pointer:i,ctx:e,logger:a}):i?xe(e)(br(i)):i.replace(/\$\{([^}]+)}/g,(r,o)=>xe(e)(br(o)))};function Ws(u){return u.replace(/\{(.*)\}/,"$1")}function br(u){return u.replace(/\['(.*?)'\]/g,".$1")}const xe=(u,e="")=>a=>{if(e||(e=a),!a)return u;const[i,...r]=a.split(".");if(!u)throw Error(`Cannot get ${fu(i)} from ${fu(e)}`);if((u==null?void 0:u[i])===void 0){const o=` Undefined ${fu(i)} at ${fu(e)}.`,n=Object.keys(u).length?`Did you mean to use another key? Available keys:
2
2
  ${Object.keys(u).join(", ")}.
3
3
  `:"",s=`${o} ${n}`;throw Error(s)}return xe(u[i],e)(r.join("."))};function me({pointer:u,ctx:e,logger:a}){const i=u.split("."),r={ctx:{faker:e.$faker}};try{const o=i.map(n=>n.trim()).map((n,s)=>n.endsWith(")")?`${s==0?"":"."}${n}`:`["${n}"]`).join("");return Js(`ctx${o}`,r)}catch(o){a.error(fu(o.toString()));return}}function H1(u,e,a){if(typeof u=="string"&&u)return D0({value:u,ctx:e,logger:a});if(!(typeof u=="string"||typeof u=="number"||typeof u=="boolean"||typeof u>"u"||u instanceof Blob||u===null))for(const i in u)typeof u[i]=="string"?u[i]&&(u[i]=D0({value:u[i],ctx:e,logger:a})):H1(u[i],e,a)}function Br(u,e,a){return H1(u,e,a)||u}function Ar(u,e){if(!u)return;const a={};for(const i in e)a[`{${i}}`]=String(e[i]);return u.split(/(\{[a-zA-Z0-9_.-]+\}+)/g).map(i=>a[i]?a[i]:i).join("")}function Us(u){return typeof u=="object"&&u!==null&&"name"in u&&"value"in u&&!("in"in u)}function $i(u){return typeof u=="object"&&u!==null&&"in"in u&&["header","query","path","cookie"].includes(u.in)}const Zs=/^image\/(png|jpeg|gif|bmp|webp|svg\+xml)|application\/pdf$/;function G1(u){return u.startsWith("$file(")&&u.endsWith(")")?u.substring(7,u.length-2):u}const fr=async(u,e,a,i,r)=>{const o=xu.pathBrowserifyExports.dirname(i),n=xu.pathBrowserifyExports.resolve(o,G1(a));u.append(e,await r.options.requestFileLoader.getFileBody(n))},_1=(u,e,a,i,r,o)=>{Object.entries(a).forEach(([n,s])=>{const t=o?`${o}[${n}]`:n;typeof s=="string"&&s.startsWith("$file(")&&s.endsWith(")")?u.push(fr(e,t,s,i,r)):Array.isArray(s)?s.forEach(E=>{typeof E=="string"&&E.startsWith("$file(")&&E.endsWith(")")?u.push(fr(e,t,E,i,r)):e.append(t,E.toString())}):typeof s=="object"&&s!==null?_1(u,e,s,i,r,t):(typeof s=="string"||typeof s=="number"||typeof s=="boolean")&&e.append(t,s.toString())})},Ys=async(u,e,a,i)=>{if(u&&typeof u=="object"&&!Array.isArray(u)){const r=[];_1(r,e,u,a,i),await Promise.all(r)}},Qs=async(u,e)=>{if(typeof u=="string"&&u.startsWith("$file(")&&u.endsWith(")")){const a=xu.pathBrowserifyExports.resolve(xu.pathBrowserifyExports.dirname(e.options.filePath),G1(u));return e.options.requestFileLoader.getFileBody(a)}else return u};async function Xs(u,e){if(!u)return{payload:void 0,contentType:void 0,encoding:void 0,replacements:void 0};const{payload:a,contentType:i}=u;if(i==="multipart/form-data"){const r=new FormData,o=xu.pathBrowserifyExports.resolve(e.options.filePath);return await Ys(a,r,o,e),{...u,payload:r}}else{if(i==="application/octet-stream"||typeof i=="string"&&Zs.test(i))return{...u,payload:await Qs(a,e),contentType:"application/octet-stream"};if(i==="application/x-www-form-urlencoded"&&typeof a=="string")return{...u,payload:Object.fromEntries(new URLSearchParams(a).entries()),contentType:"application/x-www-form-urlencoded"}}return u}function ul(u,e){function a(){this.constructor=u}a.prototype=e.prototype,u.prototype=new a}function Fe(u,e,a,i){this.message=u,this.expected=e,this.found=a,this.location=i,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Fe)}ul(Fe,Error);Fe.buildMessage=function(u,e,a){var i={literal:function(l){return'"'+o(l.text)+'"'},class:function(l){var D=l.parts.map(function(x){return Array.isArray(x)?n(x[0])+"-"+n(x[1]):n(x)});return"["+(l.inverted?"^":"")+D+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(l){return l.description},not:function(l){return"not "+s(l.expected)}};function r(l){return l.charCodeAt(0).toString(16).toUpperCase()}function o(l){return l.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(D){return"\\x0"+r(D)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(D){return"\\x"+r(D)})}function n(l){return l.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(D){return"\\x0"+r(D)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(D){return"\\x"+r(D)})}function s(l){return i[l.type](l)}function t(l){var D=l.map(s),x,c;if(D.sort(),D.length>0){for(x=1,c=1;x<D.length;x++)D[x-1]!==D[x]&&(D[c]=D[x],c++);D.length=c}switch(D.length){case 1:return D[0];case 2:return D[0]+" or "+D[1];default:return D.slice(0,-1).join(", ")+", or "+D[D.length-1]}}function E(l){return l?'"'+o(l)+'"':"end of input"}return"Expected "+t(u)+" but "+E(e)+" found."};function el(u,e){e=e!==void 0?e:{};var a={},i={Start:xr},r=xr,o="&&",n="||",s="!",t="==",E="!=",l="<=",D="<",x=">=",c=">",p="{",F="}",C="$url",d="$method",m="$statusCode",g="$request.",b="$response.",h="$inputs.",k="$steps.",v="$workflows.",y="$sourceDescriptions.",M="$components.",T="$components.parameters.",R="$outputs.",N=".",K="outputs.",O="header.",I="query.",iu="path.",eu="body",nu="#",ou="/",U="~",H="0",W="1",V="[",B="]",S='"',G="'",X="true",au="false",w="null",z="undefined",f=/^[!-.0-9A-Z_a-z]/,L=/^[a-zA-Z]/,_=/^[a-zA-Z0-9_\-]/,Z=/^[!#$%&'*+\-.\^_`|~a-zA-Z0-9\-]/,ru=/^[1-9]/,su=/^[0-9]/,Fu=/^[^"]/,du=/^[^']/,ku=/^[ \t\r\n]/,Eu=mu("&&",!1),Y=mu("||",!1),Q=mu("!",!1),tu=mu("==",!1),Du=mu("!=",!1),Ru=mu("<=",!1),Xu=mu("<",!1),I0=mu(">=",!1),he=mu(">",!1),q0=mu("{",!1),pe=mu("}",!1),z4=mu("$url",!1),S4=mu("$method",!1),M4=mu("$statusCode",!1),j4=mu("$request.",!1),P4=mu("$response.",!1),w4=mu("$inputs.",!1),K4=mu("$steps.",!1),T4=mu("$workflows.",!1),L4=mu("$sourceDescriptions.",!1),N4=mu("$components.",!1),R4=mu("$components.parameters.",!1),H4=mu("$outputs.",!1),W0=mu(".",!1),er=mu("outputs.",!1),G4=mu("header.",!1),_4=mu("query.",!1),V4=mu("path.",!1),$4=mu("body",!1),J4=mu("#",!1),O4=mu("/",!1),I4=u0([["!","."],["0","9"],["A","Z"],"_",["a","z"]],!1,!1),q4=mu("~",!1),ar=mu("0",!1),W4=mu("1",!1),U4=u0([["a","z"],["A","Z"]],!1,!1),ir=u0([["a","z"],["A","Z"],["0","9"],"_","-"],!1,!1),rr=u0(["!","#","$","%","&","'","*","+","-",".","^","_","`","|","~",["a","z"],["A","Z"],["0","9"],"-"],!1,!1),Z4=mu("[",!1),Y4=mu("]",!1),Q4=u0([["1","9"]],!1,!1),ge=u0([["0","9"]],!1,!1),nr=mu('"',!1),or=u0(['"'],!0,!1),tr=mu("'",!1),sr=u0(["'"],!0,!1),X4=mu("true",!1),us=mu("false",!1),es=mu("null",!1),as=mu("undefined",!1),lr=u0([" "," ","\r",`
4
4
  `],!1,!1),P=0,Ce=[{line:1,column:1}],ve=[],be;if("startRule"in e){if(!(e.startRule in i))throw new Error(`Can't start parsing from rule "`+e.startRule+'".');r=i[e.startRule]}function mu(A,j){return{type:"literal",text:A,ignoreCase:j}}function u0(A,j,$){return{type:"class",parts:A,inverted:j,ignoreCase:$}}function is(){return{type:"end"}}function Er(A){var j=Ce[A],$;if(j)return j;for($=A-1;!Ce[$];)$--;for(j=Ce[$],j={line:j.line,column:j.column};$<A;)u.charCodeAt($)===10?(j.line++,j.column=1):j.column++,$++;return Ce[A]=j,j}var rs=typeof e.filename=="string"&&e.filename.length>0;function Dr(A,j){var $={};rs&&($.filename=e.filename);var J=Er(A);$.start={offset:A,line:J.line,column:J.column};var uu=Er(j);return $.end={offset:j,line:uu.line,column:uu.column},$}function ns(){ve.push({pos:P,variants:[]})}function Bu(A){var j=ve[ve.length-1];P<j.pos||(P>j.pos&&(j.pos=P,j.variants=[]),j.variants.push(A))}function os(A,j,$){return new Fe(Fe.buildMessage(A,j,$),A,j,$)}function ts(){var A=ve[0],j=A.pos;return os(A.variants,j<u.length?u.charAt(j):null,j<u.length?Dr(j,j+1):Dr(j,j))}function xr(){var A;return A=cr(),A}function cr(){var A,j,$,J,uu,lu,vu,bu;if(A=P,j=Qa(),j!==a){for($=[],J=P,uu=Hu(),lu=dr(),lu!==a?(vu=Hu(),bu=Qa(),bu!==a?(uu=[uu,lu,vu,bu],J=uu):(P=J,J=a)):(P=J,J=a);J!==a;)$.push(J),J=P,uu=Hu(),lu=dr(),lu!==a?(vu=Hu(),bu=Qa(),bu!==a?(uu=[uu,lu,vu,bu],J=uu):(P=J,J=a)):(P=J,J=a);j=[j,$],A=j}else P=A,A=a;return A}function dr(){var A,j=function($){Bu($)};return j(Eu),u.substr(P,2)===o?(A=o,P+=2):A=a,A===a&&(j(Y),u.substr(P,2)===n?(A=n,P+=2):A=a,A===a&&(j(Q),u.charCodeAt(P)===33?(A=s,P++):A=a)),A}function mr(){var A,j=function($){Bu($)};return j(tu),u.substr(P,2)===t?(A=t,P+=2):A=a,A===a&&(j(Du),u.substr(P,2)===E?(A=E,P+=2):A=a,A===a&&(j(Ru),u.substr(P,2)===l?(A=l,P+=2):A=a,A===a&&(j(Xu),u.charCodeAt(P)===60?(A=D,P++):A=a,A===a&&(j(I0),u.substr(P,2)===x?(A=x,P+=2):A=a,A===a&&(j(he),u.charCodeAt(P)===62?(A=c,P++):A=a))))),A}function Qa(){var A,j,$,J,uu,lu,vu,bu;if(A=P,j=Xa(),j===a&&(j=Be(),j===a&&(j=ii())),j!==a){for($=Hu(),J=[],uu=P,lu=mr(),lu!==a?(vu=Hu(),bu=Xa(),bu===a&&(bu=Be(),bu===a&&(bu=ii())),bu!==a?(lu=[lu,vu,bu],uu=lu):(P=uu,uu=a)):(P=uu,uu=a);uu!==a;)J.push(uu),uu=P,lu=mr(),lu!==a?(vu=Hu(),bu=Xa(),bu===a&&(bu=Be(),bu===a&&(bu=ii())),bu!==a?(lu=[lu,vu,bu],uu=lu):(P=uu,uu=a)):(P=uu,uu=a);j=[j,$,J],A=j}else P=A,A=a;return A}function Xa(){var A,j,$,J,uu,lu,vu=function(bu){Bu(bu)};return A=P,vu(q0),u.charCodeAt(P)===123?(j=p,P++):j=a,j!==a?($=Hu(),J=Be(),J!==a?(uu=Hu(),vu(pe),u.charCodeAt(P)===125?(lu=F,P++):lu=a,lu!==a?(j=[j,$,J,uu,lu],A=j):(P=A,A=a)):(P=A,A=a)):(P=A,A=a),A===a&&(A=P,vu(q0),u.charCodeAt(P)===123?(j=p,P++):j=a,j!==a?($=Hu(),J=cr(),J!==a?(uu=Hu(),vu(pe),u.charCodeAt(P)===125?(lu=F,P++):lu=a,lu!==a?(j=[j,$,J,uu,lu],A=j):(P=A,A=a)):(P=A,A=a)):(P=A,A=a)),A}function Be(){var A,j,$,J=function(uu){Bu(uu)};return J(z4),u.substr(P,4)===C?(A=C,P+=4):A=a,A===a&&(J(S4),u.substr(P,7)===d?(A=d,P+=7):A=a,A===a&&(J(M4),u.substr(P,11)===m?(A=m,P+=11):A=a,A===a&&(A=P,J(j4),u.substr(P,9)===g?(j=g,P+=9):j=a,j!==a?($=Fr(),$!==a?(j=[j,$],A=j):(P=A,A=a)):(P=A,A=a),A===a&&(A=P,J(P4),u.substr(P,10)===b?(j=b,P+=10):j=a,j!==a?($=Fr(),$!==a?(j=[j,$],A=j):(P=A,A=a)):(P=A,A=a),A===a&&(A=P,J(w4),u.substr(P,8)===h?(j=h,P+=8):j=a,j!==a?($=g0(),$!==a?(j=[j,$],A=j):(P=A,A=a)):(P=A,A=a),A===a&&(A=ss(),A===a&&(A=P,J(K4),u.substr(P,7)===k?(j=k,P+=7):j=a,j!==a?($=ls(),$!==a?(j=[j,$],A=j):(P=A,A=a)):(P=A,A=a),A===a&&(A=P,J(T4),u.substr(P,11)===v?(j=v,P+=11):j=a,j!==a?($=Es(),$!==a?(j=[j,$],A=j):(P=A,A=a)):(P=A,A=a),A===a&&(A=P,J(L4),u.substr(P,20)===y?(j=y,P+=20):j=a,j!==a?($=g0(),$!==a?(j=[j,$],A=j):(P=A,A=a)):(P=A,A=a),A===a&&(A=P,J(N4),u.substr(P,12)===M?(j=M,P+=12):j=a,j!==a?($=g0(),$!==a?(j=[j,$],A=j):(P=A,A=a)):(P=A,A=a),A===a&&(A=P,J(R4),u.substr(P,23)===T?(j=T,P+=23):j=a,j!==a?($=g0(),$!==a?(j=[j,$],A=j):(P=A,A=a)):(P=A,A=a)))))))))))),A}function ss(){var A,j,$,J,uu,lu=function(vu){Bu(vu)};return A=P,lu(H4),u.substr(P,9)===R?(j=R,P+=9):j=a,j!==a?($=P,J=g0(),J!==a?(uu=ei(),uu===a&&(uu=null),J=[J,uu],$=J):(P=$,$=a),$===a&&($=ui()),$!==a?(j=[j,$],A=j):(P=A,A=a)):(P=A,A=a),A}function ls(){var A,j,$,J,uu,lu,vu=function(bu){Bu(bu)};return A=P,j=T0(),j!==a?(vu(W0),u.charCodeAt(P)===46?($=N,P++):$=a,$!==a?(J=P,vu(er),u.substr(P,8)===K?(uu=K,P+=8):uu=a,uu!==a?(lu=ui(),lu!==a?(uu=[uu,lu],J=uu):(P=J,J=a)):(P=J,J=a),J===a&&(J=g0()),J!==a?(j=[j,$,J],A=j):(P=A,A=a)):(P=A,A=a)):(P=A,A=a),A}function Es(){var A,j,$,J,uu,lu,vu=function(bu){Bu(bu)};return A=P,j=T0(),j!==a?(vu(W0),u.charCodeAt(P)===46?($=N,P++):$=a,$!==a?(J=P,vu(er),u.substr(P,8)===K?(uu=K,P+=8):uu=a,uu!==a?(lu=ui(),lu!==a?(uu=[uu,lu],J=uu):(P=J,J=a)):(P=J,J=a),J===a&&(J=g0()),J!==a?(j=[j,$,J],A=j):(P=A,A=a)):(P=A,A=a)):(P=A,A=a),A}function ui(){var A,j,$;return A=P,j=T0(),j!==a?($=ei(),$!==a?(j=[j,$],A=j):(P=A,A=a)):(P=A,A=a),A}function g0(){var A,j,$,J,uu,lu,vu,bu=function(As){Bu(As)};if(A=P,j=T0(),j!==a){for($=[],J=P,bu(W0),u.charCodeAt(P)===46?(uu=N,P++):uu=a,uu!==a?(lu=Hu(),vu=T0(),vu!==a?(uu=[uu,lu,vu],J=uu):(P=J,J=a)):(P=J,J=a);J!==a;)$.push(J),J=P,bu(W0),u.charCodeAt(P)===46?(uu=N,P++):uu=a,uu!==a?(lu=Hu(),vu=T0(),vu!==a?(uu=[uu,lu,vu],J=uu):(P=J,J=a)):(P=J,J=a);j=[j,$],A=j}else P=A,A=a;return A}function T0(){var A;return A=ai(),A===a&&(A=gr()),A}function Fr(){var A;return A=Ds(),A===a&&(A=xs(),A===a&&(A=cs(),A===a&&(A=ds()))),A}function Ds(){var A,j,$,J=function(uu){Bu(uu)};return A=P,J(G4),u.substr(P,7)===O?(j=O,P+=7):j=a,j!==a?($=ms(),$!==a?(j=[j,$],A=j):(P=A,A=a)):(P=A,A=a),A}function xs(){var A,j,$,J=function(uu){Bu(uu)};return A=P,J(_4),u.substr(P,6)===I?(j=I,P+=6):j=a,j!==a?($=ai(),$!==a?(j=[j,$],A=j):(P=A,A=a)):(P=A,A=a),A}function cs(){var A,j,$,J=function(uu){Bu(uu)};return A=P,J(V4),u.substr(P,5)===iu?(j=iu,P+=5):j=a,j!==a?($=ai(),$!==a?(j=[j,$],A=j):(P=A,A=a)):(P=A,A=a),A}function ds(){var A,j,$,J=function(uu){Bu(uu)};return A=P,J($4),u.substr(P,4)===eu?(j=eu,P+=4):j=a,j!==a?($=ei(),$===a&&($=null),j=[j,$],A=j):(P=A,A=a),A}function ei(){var A,j,$,J,uu=function(lu){Bu(lu)};if(A=P,uu(J4),u.charCodeAt(P)===35?(j=nu,P++):j=a,j!==a){for($=[],J=kr();J!==a;)$.push(J),J=kr();j=[j,$],A=j}else P=A,A=a;return A}function kr(){var A,j,$,J,uu=function(lu){Bu(lu)};if(A=P,uu(O4),u.charCodeAt(P)===47?(j=ou,P++):j=a,j!==a){for($=[],J=hr(),J===a&&(J=pr());J!==a;)$.push(J),J=hr(),J===a&&(J=pr());j=[j,$],A=j}else P=A,A=a;return A}function hr(){var A,j=function($){Bu($)};return j(I4),f.test(u.charAt(P))?(A=u.charAt(P),P++):A=a,A}function pr(){var A,j,$,J=function(uu){Bu(uu)};return A=P,J(q4),u.charCodeAt(P)===126?(j=U,P++):j=a,j!==a?(J(ar),u.charCodeAt(P)===48?($=H,P++):$=a,$===a&&(J(W4),u.charCodeAt(P)===49?($=W,P++):$=a),$!==a?(j=[j,$],A=j):(P=A,A=a)):(P=A,A=a),A}function ai(){var A,j,$,J,uu=function(lu){Bu(lu)};if(A=P,uu(U4),L.test(u.charAt(P))?(j=u.charAt(P),P++):j=a,j!==a){for($=[],uu(ir),_.test(u.charAt(P))?(J=u.charAt(P),P++):J=a;J!==a;)$.push(J),uu(ir),_.test(u.charAt(P))?(J=u.charAt(P),P++):J=a;j=[j,$],A=j}else P=A,A=a;return A}function ms(){var A,j,$=function(J){Bu(J)};if(A=[],$(rr),Z.test(u.charAt(P))?(j=u.charAt(P),P++):j=a,j!==a)for(;j!==a;)A.push(j),$(rr),Z.test(u.charAt(P))?(j=u.charAt(P),P++):j=a;else A=a;return A}function ii(){var A;return A=Fs(),A===a&&(A=gr(),A===a&&(A=ps(),A===a&&(A=vs(),A===a&&(A=bs(),A===a&&(A=Bs()))))),A}function Fs(){var A,j,$,J,uu=function(lu){Bu(lu)};return A=P,uu(Z4),u.charCodeAt(P)===91?(j=V,P++):j=a,j!==a?($=Hu(),uu(Y4),u.charCodeAt(P)===93?(J=B,P++):J=a,J!==a?(j=[j,$,J],A=j):(P=A,A=a)):(P=A,A=a),A}function gr(){var A,j,$,J,uu,lu=function(vu){Bu(vu)};return A=P,j=ks(),j!==a?($=P,lu(W0),u.charCodeAt(P)===46?(J=N,P++):J=a,J!==a?(uu=hs(),uu!==a?(J=[J,uu],$=J):(P=$,$=a)):(P=$,$=a),$===a&&($=null),j=[j,$],A=j):(P=A,A=a),A}function ks(){var A,j,$,J,uu=function(lu){Bu(lu)};if(uu(ar),u.charCodeAt(P)===48?(A=H,P++):A=a,A===a)if(A=P,uu(Q4),ru.test(u.charAt(P))?(j=u.charAt(P),P++):j=a,j!==a){for($=[],uu(ge),su.test(u.charAt(P))?(J=u.charAt(P),P++):J=a;J!==a;)$.push(J),uu(ge),su.test(u.charAt(P))?(J=u.charAt(P),P++):J=a;j=[j,$],A=j}else P=A,A=a;return A}function hs(){var A,j,$=function(J){Bu(J)};if(A=[],$(ge),su.test(u.charAt(P))?(j=u.charAt(P),P++):j=a,j!==a)for(;j!==a;)A.push(j),$(ge),su.test(u.charAt(P))?(j=u.charAt(P),P++):j=a;else A=a;return A}function ps(){var A;return A=gs(),A===a&&(A=Cs()),A}function gs(){var A,j,$,J,uu=function(lu){Bu(lu)};if(A=P,uu(nr),u.charCodeAt(P)===34?(j=S,P++):j=a,j!==a){for($=[],uu(or),Fu.test(u.charAt(P))?(J=u.charAt(P),P++):J=a;J!==a;)$.push(J),uu(or),Fu.test(u.charAt(P))?(J=u.charAt(P),P++):J=a;uu(nr),u.charCodeAt(P)===34?(J=S,P++):J=a,J!==a?(j=[j,$,J],A=j):(P=A,A=a)}else P=A,A=a;return A}function Cs(){var A,j,$,J,uu=function(lu){Bu(lu)};if(A=P,uu(tr),u.charCodeAt(P)===39?(j=G,P++):j=a,j!==a){for($=[],uu(sr),du.test(u.charAt(P))?(J=u.charAt(P),P++):J=a;J!==a;)$.push(J),uu(sr),du.test(u.charAt(P))?(J=u.charAt(P),P++):J=a;uu(tr),u.charCodeAt(P)===39?(J=G,P++):J=a,J!==a?(j=[j,$,J],A=j):(P=A,A=a)}else P=A,A=a;return A}function vs(){var A,j=function($){Bu($)};return j(X4),u.substr(P,4)===X?(A=X,P+=4):A=a,A===a&&(j(us),u.substr(P,5)===au?(A=au,P+=5):A=a),A}function bs(){var A,j=function($){Bu($)};return j(es),u.substr(P,4)===w?(A=w,P+=4):A=a,A}function Bs(){var A,j=function($){Bu($)};return j(as),u.substr(P,9)===z?(A=z,P+=9):A=a,A}function Hu(){var A,j,$=function(J){Bu(J)};for(A=[],$(lr),ku.test(u.charAt(P))?(j=u.charAt(P),P++):j=a;j!==a;)A.push(j),$(lr),ku.test(u.charAt(P))?(j=u.charAt(P),P++):j=a;return A}if(ns(),be=r(),be!==a&&P===u.length)return be;throw be!==a&&P<u.length&&Bu(is()),ts()}function al(u){try{return $1(u)}catch{throw new Error(`Runtime expression is not valid: ${u}`)}}function il(u,e){const a=[{pattern:/\$response\.body#\/([\w/]+)/g,ctxFunction:(r,o)=>{var n;return U0((n=e.$response)==null?void 0:n.body,o,r)}},{pattern:/\$request\.body#\/([\w/]+)/g,ctxFunction:(r,o)=>{var n;return U0((n=e.$request)==null?void 0:n.body,o,r)}},{pattern:/\$outputs\.([\w-]+)#\/([\w/]+)/g,ctxFunction:(r,o,n)=>{var s;return U0((s=e.$outputs)==null?void 0:s[o],n,r)}},{pattern:/\$workflows\.([\w-]+)\.outputs\.([\w-]+)#\/([\w/]+)/g,ctxFunction:(r,o,n,s)=>{var t,E,l;return U0((l=(E=(t=e.$workflows)==null?void 0:t[o])==null?void 0:E.outputs)==null?void 0:l[n],s,r)}},{pattern:/\$steps\.([\w-]+)\.outputs\.([\w-]+)#\/([\w/]+)/g,ctxFunction:(r,o,n,s)=>{var t,E,l;return U0((l=(E=(t=e.$steps)==null?void 0:t[o])==null?void 0:E.outputs)==null?void 0:l[n],s,r)}}];let i=u;for(const{pattern:r,ctxFunction:o}of a)i=i.replaceAll(r,o);return i}function U0(u,e,a){if(u)try{const i=xu.JsonPointer.get(u,`/${e}`);return typeof i=="string"||Array.isArray(i)||typeof i=="object"?JSON.stringify(i):i!==void 0?i:a}catch{return a}return a}function Qu({payload:u,context:e,contentType:a,logger:i}){if(a!=null&&a.includes("application/octet-stream"))return Br(u,e,i);if(a!=null&&a.includes("multipart/form-data")){if(u instanceof FormData){const r=new FormData;for(const[o,n]of u.entries())if(n instanceof File)r.append(o,n);else{const s=Qu({payload:n,context:e,logger:i});r.append(o,s)}return r}return Br(u,e,i)}return typeof u=="string"?Dl(u)?K0(u,e,i):El(u,e,i):xu.isPlainObject(u)?Object.entries(u).reduce((r,[o,n])=>(r[o]=Qu({payload:n,context:e,logger:i}),r),{}):Array.isArray(u)?u.map(r=>Qu({payload:r,context:e,logger:i})):u}function K0(u,e,a){return typeof u=="string"?rl(u,e,a):xu.isPlainObject(u)?Object.entries(u).reduce((i,[r,o])=>(i[r]=o&&K0(o,e,a),i),{}):Array.isArray(u)?u.map(i=>K0(i,e,a)):u}function rl(u,e,a){if(/^\$faker\.[a-zA-Z0-9._-]+(\([^\\)]*\))?$/.test(u))return me({pointer:u.slice(1),ctx:e,logger:a});if(u.includes("$faker.")){const o=/\$faker\.[a-zA-Z0-9._-]+(\([^\\)]*\))?/g;u=u.replace(o,n=>me({pointer:n.slice(1),ctx:e,logger:a})).replace(/{(.*?)}/g,"$1")}if(!u.includes("$")&&!/[=<>]/.test(u))return u;al(u);const i=ol(u,e),r=tl(e);try{return new Function(...Object.keys(r),`return ${i};`)(...Object.values(r))}catch{throw new Error(`Error in resolving runtime expression '${u}'.
@@ -123,4 +123,4 @@ Received:
123
123
  Retrying step ${ju(n)} (${eu-i+1}/${eu})
124
124
  `),{stepResult:await _i({step:u,ctx:e,workflowId:a,retriesLeft:i-1,executedStepsCount:y}),retriesLeft:i}}else{if(T==="end")return{shouldEnd:!0};if(T==="goto"){if(!K&&!I)throw new Error("Either workflowId or stepId must be provided in goto action");(K||I)&&jn({stepId:n,actionName:M.name,kind:v,logger:e.options.logger});const iu=await de({workflowInput:K||o,ctx:O,fromStepId:I,skipLineSeparator:!0,invocationContext:`Goto from step ${n}`,executedStepsCount:y});return e.executedSteps.push(iu),{shouldEnd:!0}}}break}}if(v==="failure")return{shouldEnd:!0}}}function Va(u){if(u){if(typeof u=="string")return u.includes(",")?u.split(",").map(e=>e.trim()):[u];if(Array.isArray(u)){const e=[];for(const a of u)a.includes(",")?e.push(...a.split(",").map(i=>i.trim())):e.push(a);return e}}}async function O0u({options:u,collectSpecData:e,executedStepsCount:a}){const i={...u,filePath:u.file,metadata:{...u}},r=await k4({filePath:u.file,collectSpecData:e,version:u==null?void 0:u.version,logger:u.logger,externalRefResolver:u==null?void 0:u.externalRefResolver,skipLint:u==null?void 0:u.skipLint});return await I0u({testDescription:r,options:i,executedStepsCount:a})}async function I0u({testDescription:u,options:e,executedStepsCount:a}){var E;const i=new vE({fetch:e.fetch}),r=await p4(u,e,i),o=Va(e.workflow),n=Va(e.skip),s=LX({workflows:r.workflows,workflowsToRun:o,workflowsToSkip:n,logger:r.options.logger}),t=[];for(const l of s){r.executedSteps=[],(E=l.dependsOn)!=null&&E.length&&await q0u({workflow:l,ctx:r,config:e.config,executedStepsCount:a});const D=await de({workflowInput:l.workflowId,ctx:r,executedStepsCount:a});t.push(D)}return{ctx:r,executedWorkflows:t}}async function de({workflowInput:u,ctx:e,fromStepId:a,skipLineSeparator:i,parentStepId:r,invocationContext:o,executedStepsCount:n}){var d;const{logger:s}=e.options,t=performance.now(),E=xu.pathBrowserifyExports.basename(e.options.filePath),l=typeof u=="string"?e.workflows.find(m=>m.workflowId===u):u;if(!l)throw new Error(`
125
125
  ${ju("Workflow")} ${u} ${ju("not found")}
126
- `);const D=l.inputs;if(D){const m=e.$workflows[l.workflowId].inputs;e.$workflows[l.workflowId].inputs=h4({inputs:m,workflowInputSchema:D,env:e.options.envVariables})}const x=l.workflowId;a||nE({fileName:E,workflowName:x,skipLineSeparator:i,logger:s});const c=a?l.steps.findIndex(m=>m.stepId===a):0,p=l.steps.slice(c);e.$steps={};for(const m of p)try{const g=await _i({step:m,ctx:e,workflowId:x,executedStepsCount:n});if(g!=null&&g.shouldEnd)break}catch(g){const b={name:Mu.UNEXPECTED_ERROR,message:g.message,passed:!1,severity:e.severity.UNEXPECTED_ERROR};m.checks.push(b),e.executedSteps.push(m)}const F=l.steps.some(m=>{var g;return(g=m.checks)==null?void 0:g.some(b=>!b.passed&&b.name==Mu.GLOBAL_TIMEOUT_ERROR)});if(l.outputs&&x&&!F){e.$outputs||(e.$outputs={}),e.$outputs[x]||(e.$outputs[x]={});const m=Za({ctx:{...e,$inputs:{...e.$inputs||{},...((d=e.$workflows[x])==null?void 0:d.inputs)||{}}},workflowId:x}),g={};for(const b of Object.keys(l.outputs))try{g[b]=Qu({payload:l.outputs[b],context:m,logger:e.options.logger})}catch(h){throw new Error(`Failed to resolve output "${b}" in workflow "${x}": ${h.message}`)}e.$outputs[x]=g,e.$workflows[x].outputs=g}l.time=Math.ceil(performance.now()-t),s.printNewLine();const C=performance.now();return{type:"workflow",invocationContext:o,workflowId:x,stepId:r,startTime:t,endTime:C,totalTimeMs:Math.ceil(C-t),executedSteps:e.executedSteps,ctx:e,globalTimeoutError:F}}async function q0u({workflow:u,ctx:e,config:a,executedStepsCount:i}){var s;if(!((s=u.dependsOn)!=null&&s.length))return;const r=await Promise.all(u.dependsOn.map(async t=>{const E=D0({value:t,ctx:e,logger:e.options.logger}),l=await Vi(t,E,e,a);return oE(u.workflowId,e.options.logger),de({workflowInput:E,ctx:l,skipLineSeparator:!0,executedStepsCount:i})}));if($a(r).steps.failed>0)throw new Error("Dependent workflows has failed steps")}async function Vi(u,e,a,i){const r=u&&u.startsWith("$sourceDescriptions.")&&u.split(".")[1],o=r&&a.$sourceDescriptions[r];return o?await p4(o,{...a.options,filePath:W0u(r,a.sourceDescriptions,a.options),workflow:[e.workflowId],skip:void 0,config:i},a.apiClient):{...a,executedSteps:[]}}function W0u(u,e,a){const i=e&&e.find(({name:r})=>r===u);if(i){if(i.type==="openapi")return i.url;if(i.type==="arazzo")return xu.pathBrowserifyExports.resolve(xu.pathBrowserifyExports.dirname(a.filePath),i.url);throw new Error(`Unknown source description type ${i.type}`)}else return""}async function U0u(u){const e={value:0},{files:a,executionTimeout:i,collectSpecData:r}=u;i&&(E0.reset(),E0.getInstance(i));const o=[],n=[];for(const s of a){const t=await Z0u({options:{...u,file:s},startedAt:performance.now(),collectSpecData:r,executedStepsCount:e});o.push(t.hasProblems),n.push(t)}return n}async function Z0u({options:u,startedAt:e,executedStepsCount:a,collectSpecData:i}){const r=await O0u({options:u,collectSpecData:i,executedStepsCount:a}),{executedWorkflows:o,ctx:n}=r,s=$a(o),t=s.workflows.failed>0,E=s.workflows.warnings>0,l=o.some(D=>D.globalTimeoutError);return(s.steps.failed>0||s.steps.warnings>0||s.steps.skipped>0)&&dE(o,u.logger),DE({startedAt:e,workflows:o,options:u}),{hasProblems:t,hasWarnings:E,file:u.file,executedWorkflows:o,options:u,ctx:n,totalTimeMs:performance.now()-e,totalRequests:s.totalRequests,globalTimeoutError:l}}exports.RESET_ESCAPE_CODE=Ku;exports.calculateTotals=$a;exports.maskSecrets=F0;exports.parseRuntimeExpression=$1;exports.run=U0u;
126
+ `);const D=l.inputs;if(D){const m=e.$workflows[l.workflowId].inputs;e.$workflows[l.workflowId].inputs=h4({inputs:m,workflowInputSchema:D,env:e.options.envVariables})}const x=l.workflowId;a||nE({fileName:E,workflowName:x,skipLineSeparator:i,logger:s});const c=a?l.steps.findIndex(m=>m.stepId===a):0,p=l.steps.slice(c);e.$steps={};for(const m of p)try{const g=await _i({step:m,ctx:e,workflowId:x,executedStepsCount:n});if(g!=null&&g.shouldEnd)break}catch(g){const b={name:Mu.UNEXPECTED_ERROR,message:g.message,passed:!1,severity:e.severity.UNEXPECTED_ERROR};m.checks.push(b),e.executedSteps.push(m)}const F=l.steps.some(m=>{var g;return(g=m.checks)==null?void 0:g.some(b=>!b.passed&&b.name==Mu.GLOBAL_TIMEOUT_ERROR)});if(l.outputs&&x&&!F){e.$outputs||(e.$outputs={}),e.$outputs[x]||(e.$outputs[x]={});const m=Za({ctx:{...e,$inputs:{...e.$inputs||{},...((d=e.$workflows[x])==null?void 0:d.inputs)||{}}},workflowId:x}),g={};for(const b of Object.keys(l.outputs))try{g[b]=Qu({payload:l.outputs[b],context:m,logger:e.options.logger})}catch(h){throw new Error(`Failed to resolve output "${b}" in workflow "${x}": ${h.message}`)}e.$outputs[x]=g,e.$workflows[x].outputs=g}l.time=Math.ceil(performance.now()-t),s.printNewLine();const C=performance.now();return{type:"workflow",invocationContext:o,workflowId:x,stepId:r,startTime:t,endTime:C,totalTimeMs:Z0u(e.executedSteps),executedSteps:e.executedSteps,ctx:e,globalTimeoutError:F}}async function q0u({workflow:u,ctx:e,config:a,executedStepsCount:i}){var s;if(!((s=u.dependsOn)!=null&&s.length))return;const r=await Promise.all(u.dependsOn.map(async t=>{const E=D0({value:t,ctx:e,logger:e.options.logger}),l=await Vi(t,E,e,a);return oE(u.workflowId,e.options.logger),de({workflowInput:E,ctx:l,skipLineSeparator:!0,executedStepsCount:i})}));if($a(r).steps.failed>0)throw new Error("Dependent workflows has failed steps")}async function Vi(u,e,a,i){const r=u&&u.startsWith("$sourceDescriptions.")&&u.split(".")[1],o=r&&a.$sourceDescriptions[r];return o?await p4(o,{...a.options,filePath:W0u(r,a.sourceDescriptions,a.options),workflow:[e.workflowId],skip:void 0,config:i},a.apiClient):{...a,executedSteps:[]}}function W0u(u,e,a){const i=e&&e.find(({name:r})=>r===u);if(i){if(i.type==="openapi")return i.url;if(i.type==="arazzo")return xu.pathBrowserifyExports.resolve(xu.pathBrowserifyExports.dirname(a.filePath),i.url);throw new Error(`Unknown source description type ${i.type}`)}else return""}function U0u(u){return"type"in u&&u.type==="workflow"}function Z0u(u){var a;let e=0;for(const i of u)U0u(i)?e+=i.totalTimeMs:e+=((a=i.response)==null?void 0:a.time)||0;return e}async function Y0u(u){const e={value:0},{files:a,executionTimeout:i,collectSpecData:r}=u;i&&(E0.reset(),E0.getInstance(i));const o=[],n=[];for(const s of a){const t=await Q0u({options:{...u,file:s},startedAt:performance.now(),collectSpecData:r,executedStepsCount:e});o.push(t.hasProblems),n.push(t)}return n}async function Q0u({options:u,startedAt:e,executedStepsCount:a,collectSpecData:i}){const r=await O0u({options:u,collectSpecData:i,executedStepsCount:a}),{executedWorkflows:o,ctx:n}=r,s=$a(o),t=s.workflows.failed>0,E=s.workflows.warnings>0,l=o.some(D=>D.globalTimeoutError);return(s.steps.failed>0||s.steps.warnings>0||s.steps.skipped>0)&&dE(o,u.logger),DE({startedAt:e,workflows:o,options:u}),{hasProblems:t,hasWarnings:E,file:u.file,executedWorkflows:o,options:u,ctx:n,totalTimeMs:performance.now()-e,totalRequests:s.totalRequests,globalTimeoutError:l}}exports.RESET_ESCAPE_CODE=Ku;exports.calculateTotals=$a;exports.maskSecrets=F0;exports.parseRuntimeExpression=$1;exports.run=Y0u;