@redocly/replay 0.23.0-next.3 → 0.23.0-next.5

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,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("./replay-index-BIn_L-wL.js"),{env:l0={},argv:Hi=[],platform:Mo=""}=typeof process>"u"?{}:process,jo="NO_COLOR"in l0||Hi.includes("--no-color"),Po="FORCE_COLOR"in l0||Hi.includes("--color"),wo=Mo==="win32",Ko=l0.TERM==="dumb",To=T.tty&&void 0,Lo="CI"in l0&&("GITHUB_ACTIONS"in l0||"GITLAB_CI"in l0||"CIRCLECI"in l0),No=!jo&&(Po||wo&&!Ko||To||Lo),Gi=(u,a,e,i,r=a.substring(0,u)+i,o=a.substring(u+e.length),n=o.indexOf(e))=>r+(n<0?o:Gi(n,o,e,i)),Ro=(u,a,e,i,r)=>u<0?e+a+i:e+Gi(u,a,i,r)+i,Ho=(u,a,e=u,i=u.length+1)=>r=>r||!(r===""||r===void 0)?Ro((""+r).indexOf(a,i),r,u,a,e):"",I=(u,a,e)=>Ho(`\x1B[${u}m`,`\x1B[${a}m`,e),wa={reset:I(0,0),bold:I(1,22,"\x1B[22m\x1B[1m"),dim:I(2,22,"\x1B[22m\x1B[2m"),italic:I(3,23),underline:I(4,24),inverse:I(7,27),hidden:I(8,28),strikethrough:I(9,29),black:I(30,39),red:I(31,39),green:I(32,39),yellow:I(33,39),blue:I(34,39),magenta:I(35,39),cyan:I(36,39),white:I(37,39),gray:I(90,39),bgBlack:I(40,49),bgRed:I(41,49),bgGreen:I(42,49),bgYellow:I(43,49),bgBlue:I(44,49),bgMagenta:I(45,49),bgCyan:I(46,49),bgWhite:I(47,49),blackBright:I(90,39),redBright:I(91,39),greenBright:I(92,39),yellowBright:I(93,39),blueBright:I(94,39),magentaBright:I(95,39),cyanBright:I(96,39),whiteBright:I(97,39),bgBlackBright:I(100,49),bgRedBright:I(101,49),bgGreenBright:I(102,49),bgYellowBright:I(103,49),bgBlueBright:I(104,49),bgMagentaBright:I(105,49),bgCyanBright:I(106,49),bgWhiteBright:I(107,49)},Go=({useColor:u=No}={})=>u?wa:Object.keys(wa).reduce((a,e)=>({...a,[e]:String}),{}),{reset:HU,bold:Zu,dim:Vo,italic:GU,underline:_o,inverse:Vi,hidden:VU,strikethrough:_U,black:JU,red:iu,green:m0,yellow:Uu,blue:Du,magenta:$U,cyan:IU,white:Ka,gray:du,bgBlack:OU,bgRed:q0,bgGreen:WU,bgYellow:qU,bgBlue:ZU,bgMagenta:UU,bgCyan:YU,bgWhite:QU,blackBright:XU,redBright:uY,greenBright:eY,yellowBright:aY,blueBright:iY,magentaBright:rY,cyanBright:nY,whiteBright:oY,bgBlackBright:tY,bgRedBright:sY,bgGreenBright:lY,bgYellowBright:EY,bgBlueBright:DY,bgMagentaBright:xY,bgCyanBright:cY,bgWhiteBright:dY}=Go(),Jo=u=>/\{.*?\}/.test(u);function Hu({value:u,ctx:a,logger:e}){if(!u)return u;if(T.isPlainObject(u)){const i={};for(const r in u)i[r]=Hu({value:u[r],ctx:a,logger:e});return i}else if(Array.isArray(u))return u.map(i=>Hu({value:i,ctx:a,logger:e}));return typeof u!="string"?u:u.startsWith("$faker.")?P0({pointer:u.slice(1),ctx:a,logger:e}):Jo(u)?Oo(u,a,e):qo(u,a,e)}function $o(u,a,e){const i=u.indexOf("{");if(i!==-1){const o=u.substring(i+1).slice(0,-1),n=P0({pointer:o.slice(1),ctx:a,logger:e});return n&&u.replace(/{(.*)}/,n)}else return u}function Io(u,a){const e=Object.keys(a),i=Object.values(a);return new Function(...e,`return ${u}`)(...i)}function Oo(u,a,e){const i=/\{\$(\{[^{}]*\}|[^{}])*\}/g;let r=u;return r=r.replace(i,(o,n)=>Wo(o,a,e)),r}function Wo(u,a,e){if(!u.includes("$"))return u;if(u.includes("$faker."))return $o(u,a,e);const i=S0(a)(Zo(u));return i!==void 0?i:""}const qo=(u,a,e)=>{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=S0(a)("$sourceDescriptions");return s[o]?s[o].workflows.find(l=>l.workflowId===n):void 0}return i&&i.trim().startsWith("faker.")?P0({pointer:i,ctx:a,logger:e}):i?S0(a)(Ta(i)):i.replace(/\$\{([^}]+)}/g,(r,o)=>S0(a)(Ta(o)))};function Zo(u){return u.replace(/\{(.*)\}/,"$1")}function Ta(u){return u.replace(/\['(.*?)'\]/g,".$1")}const S0=(u,a="")=>e=>{if(a||(a=e),!e)return u;const[i,...r]=e.split(".");if(!u)throw Error(`Cannot get ${iu(i)} from ${iu(a)}`);if(u?.[i]===void 0){const o=` Undefined ${iu(i)} at ${iu(a)}.`,n=Object.keys(u).length?`Did you mean to use another key? Available keys:
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("./replay-index-nJ_B4GmS.js"),{env:l0={},argv:Hi=[],platform:Mo=""}=typeof process>"u"?{}:process,jo="NO_COLOR"in l0||Hi.includes("--no-color"),Po="FORCE_COLOR"in l0||Hi.includes("--color"),wo=Mo==="win32",Ko=l0.TERM==="dumb",To=T.tty&&void 0,Lo="CI"in l0&&("GITHUB_ACTIONS"in l0||"GITLAB_CI"in l0||"CIRCLECI"in l0),No=!jo&&(Po||wo&&!Ko||To||Lo),Gi=(u,a,e,i,r=a.substring(0,u)+i,o=a.substring(u+e.length),n=o.indexOf(e))=>r+(n<0?o:Gi(n,o,e,i)),Ro=(u,a,e,i,r)=>u<0?e+a+i:e+Gi(u,a,i,r)+i,Ho=(u,a,e=u,i=u.length+1)=>r=>r||!(r===""||r===void 0)?Ro((""+r).indexOf(a,i),r,u,a,e):"",I=(u,a,e)=>Ho(`\x1B[${u}m`,`\x1B[${a}m`,e),wa={reset:I(0,0),bold:I(1,22,"\x1B[22m\x1B[1m"),dim:I(2,22,"\x1B[22m\x1B[2m"),italic:I(3,23),underline:I(4,24),inverse:I(7,27),hidden:I(8,28),strikethrough:I(9,29),black:I(30,39),red:I(31,39),green:I(32,39),yellow:I(33,39),blue:I(34,39),magenta:I(35,39),cyan:I(36,39),white:I(37,39),gray:I(90,39),bgBlack:I(40,49),bgRed:I(41,49),bgGreen:I(42,49),bgYellow:I(43,49),bgBlue:I(44,49),bgMagenta:I(45,49),bgCyan:I(46,49),bgWhite:I(47,49),blackBright:I(90,39),redBright:I(91,39),greenBright:I(92,39),yellowBright:I(93,39),blueBright:I(94,39),magentaBright:I(95,39),cyanBright:I(96,39),whiteBright:I(97,39),bgBlackBright:I(100,49),bgRedBright:I(101,49),bgGreenBright:I(102,49),bgYellowBright:I(103,49),bgBlueBright:I(104,49),bgMagentaBright:I(105,49),bgCyanBright:I(106,49),bgWhiteBright:I(107,49)},Go=({useColor:u=No}={})=>u?wa:Object.keys(wa).reduce((a,e)=>({...a,[e]:String}),{}),{reset:HU,bold:Zu,dim:Vo,italic:GU,underline:_o,inverse:Vi,hidden:VU,strikethrough:_U,black:JU,red:iu,green:m0,yellow:Uu,blue:Du,magenta:$U,cyan:IU,white:Ka,gray:du,bgBlack:OU,bgRed:q0,bgGreen:WU,bgYellow:qU,bgBlue:ZU,bgMagenta:UU,bgCyan:YU,bgWhite:QU,blackBright:XU,redBright:uY,greenBright:eY,yellowBright:aY,blueBright:iY,magentaBright:rY,cyanBright:nY,whiteBright:oY,bgBlackBright:tY,bgRedBright:sY,bgGreenBright:lY,bgYellowBright:EY,bgBlueBright:DY,bgMagentaBright:xY,bgCyanBright:cY,bgWhiteBright:dY}=Go(),Jo=u=>/\{.*?\}/.test(u);function Hu({value:u,ctx:a,logger:e}){if(!u)return u;if(T.isPlainObject(u)){const i={};for(const r in u)i[r]=Hu({value:u[r],ctx:a,logger:e});return i}else if(Array.isArray(u))return u.map(i=>Hu({value:i,ctx:a,logger:e}));return typeof u!="string"?u:u.startsWith("$faker.")?P0({pointer:u.slice(1),ctx:a,logger:e}):Jo(u)?Oo(u,a,e):qo(u,a,e)}function $o(u,a,e){const i=u.indexOf("{");if(i!==-1){const o=u.substring(i+1).slice(0,-1),n=P0({pointer:o.slice(1),ctx:a,logger:e});return n&&u.replace(/{(.*)}/,n)}else return u}function Io(u,a){const e=Object.keys(a),i=Object.values(a);return new Function(...e,`return ${u}`)(...i)}function Oo(u,a,e){const i=/\{\$(\{[^{}]*\}|[^{}])*\}/g;let r=u;return r=r.replace(i,(o,n)=>Wo(o,a,e)),r}function Wo(u,a,e){if(!u.includes("$"))return u;if(u.includes("$faker."))return $o(u,a,e);const i=S0(a)(Zo(u));return i!==void 0?i:""}const qo=(u,a,e)=>{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=S0(a)("$sourceDescriptions");return s[o]?s[o].workflows.find(l=>l.workflowId===n):void 0}return i&&i.trim().startsWith("faker.")?P0({pointer:i,ctx:a,logger:e}):i?S0(a)(Ta(i)):i.replace(/\$\{([^}]+)}/g,(r,o)=>S0(a)(Ta(o)))};function Zo(u){return u.replace(/\{(.*)\}/,"$1")}function Ta(u){return u.replace(/\['(.*?)'\]/g,".$1")}const S0=(u,a="")=>e=>{if(a||(a=e),!e)return u;const[i,...r]=e.split(".");if(!u)throw Error(`Cannot get ${iu(i)} from ${iu(a)}`);if(u?.[i]===void 0){const o=` Undefined ${iu(i)} at ${iu(a)}.`,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 S0(u[i],a)(r.join("."))};function P0({pointer:u,ctx:a,logger:e}){const i=u.split("."),r={ctx:{faker:a.$faker}};try{const o=i.map(n=>n.trim()).map((n,s)=>n.endsWith(")")?`${s==0?"":"."}${n}`:`["${n}"]`).join("");return Io(`ctx${o}`,r)}catch(o){e.error(iu(o.toString()));return}}function _i(u,a,e){if(typeof u=="string"&&u)return Hu({value:u,ctx:a,logger:e});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]=Hu({value:u[i],ctx:a,logger:e})):_i(u[i],a,e)}function La(u,a,e){return _i(u,a,e)||u}function Na(u,a){if(!u)return;const e={};for(const i in a)e[`{${i}}`]=String(a[i]);return u.split(/(\{[a-zA-Z0-9_.-]+\}+)/g).map(i=>e[i]?e[i]:i).join("")}function Uo(u){return T.isPlainObject(u)&&"name"in u&&"value"in u&&!("in"in u)}function Ve(u){return T.isPlainObject(u)&&"in"in u&&typeof u.in=="string"&&["header","query","path","cookie"].includes(u.in)}const Yo=/^image\/(png|jpeg|gif|bmp|webp|svg\+xml)|application\/pdf$/;function Ji(u){return u.startsWith("$file(")&&u.endsWith(")")?u.substring(7,u.length-2):u}const Ra=async(u,a,e,i,r)=>{const o=T.pathBrowserifyExports.dirname(i),n=T.pathBrowserifyExports.resolve(o,Ji(e));u.append(a,await r.options.requestFileLoader.getFileBody(n))},$i=(u,a,e,i,r,o)=>{Object.entries(e).forEach(([n,s])=>{const l=o?`${o}[${n}]`:n;typeof s=="string"&&s.startsWith("$file(")&&s.endsWith(")")?u.push(Ra(a,l,s,i,r)):Array.isArray(s)?s.forEach(E=>{typeof E=="string"&&E.startsWith("$file(")&&E.endsWith(")")?u.push(Ra(a,l,E,i,r)):a.append(l,E.toString())}):T.isPlainObject(s)?$i(u,a,s,i,r,l):(typeof s=="string"||typeof s=="number"||typeof s=="boolean")&&a.append(l,s.toString())})},Qo=async(u,a,e,i)=>{if(T.isPlainObject(u)){const r=[];$i(r,a,u,e,i),await Promise.all(r)}},Xo=async(u,a)=>{if(typeof u=="string"&&u.startsWith("$file(")&&u.endsWith(")")){const e=T.pathBrowserifyExports.resolve(T.pathBrowserifyExports.dirname(a.options.filePath),Ji(u));return a.options.requestFileLoader.getFileBody(e)}else return u};async function u4(u,a){if(!u)return{payload:void 0,contentType:void 0,encoding:void 0,replacements:void 0};const{payload:e,contentType:i}=u;if(i==="multipart/form-data"){const r=new FormData,o=T.pathBrowserifyExports.resolve(a.options.filePath);return await Qo(e,r,o,a),{...u,payload:r}}else{if(i==="application/octet-stream"||typeof i=="string"&&Yo.test(i))return{...u,payload:await Xo(e,a),contentType:"application/octet-stream"};if(i==="application/x-www-form-urlencoded"&&typeof e=="string")return{...u,payload:Object.fromEntries(new URLSearchParams(e).entries()),contentType:"application/x-www-form-urlencoded"}}return u}function e4({payload:u,replacements:a,expressionContext:e,logger:i}){for(const r of a){const{target:o,value:n}=r;if(typeof o!="string")throw new Error(`Invalid JSON Pointer: ${o}`);try{const s=T.JsonPointerLib.get(u,o),l=Ku({payload:n,context:e,logger:i});s!==void 0&&T.JsonPointerLib.set(u,o,l)}catch{throw new Error(`Invalid JSON Pointer: ${o}`)}}}const a4=["parameters","failureActions","successActions"];function i4(u,a){const{reference:e,value:i}=u;if(!a4.some(o=>e.includes(`$components.${o}`)))throw new Error("Invalid reference: available components are $components.parameters, $components.failureActions, or $components.successActions");const r=Hu({value:e,ctx:a,logger:a.options.logger});return T.isPlainObject(r)&&"value"in r&&i?{...r,value:i}:r}function f0(u,a){return"reference"in u?i4(u,a):u}function r4(u){try{return T.parseRuntimeExpression(u)}catch{throw new Error(`Runtime expression is not valid: ${u}`)}}function n4(u,a){const e=[{pattern:/\$response\.body#\/([\w/-]+)/g,ctxFunction:(r,o)=>v0(a.$response?.body,o,r)},{pattern:/\$request\.body#\/([\w/-]+)/g,ctxFunction:(r,o)=>v0(a.$request?.body,o,r)},{pattern:/\$outputs\.([\w-]+)#\/([\w/-]+)/g,ctxFunction:(r,o,n)=>v0(a.$outputs?.[o],n,r)},{pattern:/\$workflows\.([\w-]+)\.outputs\.([\w-]+)#\/([\w/-]+)/g,ctxFunction:(r,o,n,s)=>v0(a.$workflows?.[o]?.outputs?.[n],s,r)},{pattern:/\$steps\.([\w-]+)\.outputs\.([\w-]+)#\/([\w/-]+)/g,ctxFunction:(r,o,n,s)=>v0(a.$steps?.[o]?.outputs?.[n],s,r)}];let i=u;for(const{pattern:r,ctxFunction:o}of e)i=i.replaceAll(r,o);return i}function v0(u,a,e){if(u)try{const i=T.JsonPointerLib.get(u,`/${a}`);return typeof i=="string"||Array.isArray(i)||T.isPlainObject(i)?JSON.stringify(i):i!==void 0?i:e}catch{return e}return e}function Ku({payload:u,context:a,contentType:e,logger:i}){if(e?.includes("application/octet-stream"))return La(u,a,i);if(e?.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=Ku({payload:n,context:a,logger:i});r.append(o,s)}return r}return La(u,a,i)}return typeof u=="string"?c4(u)?E0(u,a,i):x4(u,a,i):T.isPlainObject(u)?Object.entries(u).reduce((r,[o,n])=>(r[o]=Ku({payload:n,context:a,logger:i}),r),{}):Array.isArray(u)?u.map(r=>Ku({payload:r,context:a,logger:i})):u}function E0(u,a,e){return typeof u=="string"?o4(u,a,e):T.isPlainObject(u)?Object.entries(u).reduce((i,[r,o])=>(i[r]=o&&E0(o,a,e),i),{}):Array.isArray(u)?u.map(i=>E0(i,a,e)):u}function o4(u,a,e){if(/^\$faker\.[a-zA-Z0-9._-]+(\([^\\)]*\))?$/.test(u))return P0({pointer:u.slice(1),ctx:a,logger:e});if(u.includes("$faker.")){const o=/\$faker\.[a-zA-Z0-9._-]+(\([^\\)]*\))?/g;u=u.replace(o,n=>P0({pointer:n.slice(1),ctx:a,logger:e})).replace(/{(.*?)}/g,"$1")}if(!u.includes("$")&&!/[=<>]/.test(u))return u;r4(u);const i=s4(u,a),r=l4(a);try{return new Function(...Object.keys(r),`return ${i};`)(...Object.values(r))}catch{throw new Error(`Error in resolving runtime expression '${u}'.
4
4
  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.`)}}function t4(u){return u.replace(/\$([a-zA-Z0-9._-]+)/g,(a,e)=>`$${e.replace(/-/g,"_")}`)}function s4(u,a){const e=n4(u,a);let r=t4(e);if(r.startsWith("{")&&r.endsWith("}")){const l=r.slice(1,-1);!l.trim().startsWith("{")&&!l.trim().startsWith("[")&&(r=l)}const o=D4(r),n=/\.header\.([a-zA-Z0-9._-]+)/g;return o.replace(n,(l,E)=>`.header.${E.toLowerCase()}`)}function l4(u){const a={};for(const[e,i]of Object.entries(u)){const r=e.replace(/-/g,"_");a[r]=Ii(i)}return a}function Ii(u){return Array.isArray(u)?u:T.isPlainObject(u)?E4(u):u}function E4(u){return Object.keys(u).reduce((a,e)=>{const i=e.replace(/-/g,"_");return a[i]=Ii(u[e]),a},{})}function D4(u){return u.replace(/\.(\d+)/g,(a,e,i,r)=>{const o=r[i-1];return/\d/.test(o)?a:`[${e}]`})}function x4(u,a,e){const i=/\{(?:[^{}]|\{[^{}]*\})*\}|\$[^\s{}]+(?:\([^()]*\))*/g;return u.replace(i,r=>{const o=r.trim(),n=E0(o,a,e);return n!==void 0?n:r})}function c4(u){return/^\$[^\s{}]+(\([^)]*\))?$|^\{[^{}]*\}$/.test(u.trim())}const su={SUCCESS_CRITERIA_CHECK:"success criteria check",STATUS_CODE_CHECK:"status code check",SCHEMA_CHECK:"schema check",CONTENT_TYPE_CHECK:"content-type check",GLOBAL_TIMEOUT_ERROR:"global timeout error",MAX_STEPS_REACHED_ERROR:"maximum steps reached",NETWORK_ERROR:"failed network request",UNEXPECTED_ERROR:"unexpected error"};class Oi extends Error{}class Wi extends Oi{}class qi extends Oi{}async function d4(u){const{descriptionPath:a,externalRefResolver:e,base:i}=u,r=await T.bundle({base:i,ref:a,config:u.config,dereference:!0,externalRefResolver:e});if(!r)throw new Error(`Could not find source description file '${a}'.`);return r.bundle.parsed}const m4={title:"[REPLACE WITH API title]",version:"[REPLACE WITH API version]"},we=Symbol("skip");function b0(u){return u<10?"0"+u:u}function F4(u,a,e,i){var r=e?"":u.getUTCFullYear()+"-"+b0(u.getUTCMonth()+1)+"-"+b0(u.getUTCDate());return a||(r+="T"+b0(u.getUTCHours())+":"+b0(u.getUTCMinutes())+":"+b0(u.getUTCSeconds())+"Z"),r}function Zi(u,a){return a>u.length?u.repeat(Math.trunc(a/u.length)+1).substring(0,a):u}function X0(...u){const a=e=>e&&typeof e=="object";return u.reduce((e,i)=>(Object.keys(i||{}).forEach(r=>{const o=e[r],n=i[r];a(o)&&a(n)?e[r]=X0(o,n):e[r]=n}),e),Array.isArray(u[u.length-1])?[]:{})}function k4(u){var a=g4(u),e=p4(a,a,a,a),i="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,r=>{var o=e()*16%16|0;return(r=="x"?o:o&3|8).toString(16)});return i}function Ce(u){return{value:u==="object"?{}:u==="array"?[]:void 0}}function Ou(u,a){a&&u.pop()}function C4(u){return{name:u?.xml?.name||"",prefix:u?.xml?.prefix||"",namespace:u?.xml?.namespace||null,attribute:u?.xml?.attribute??!1,wrapped:u?.xml?.wrapped??!1}}function h4(u){const a=u?.xml;return a?.nodeType?a.nodeType:a?.attribute===!0?"attribute":a?.wrapped===!0&&u?.type==="array"?"element":u?.$ref||u?.$dynamicRef||u?.type==="array"||u?.oneOf||u?.anyOf||u?.allOf?"none":"element"}function ue(u,a={},e={}){const{value:i}=u,{propertyName:r}=e,{name:o,prefix:n,namespace:s}=C4(a),l=h4(a);let E=o||r?`${n?n+":":""}${o||r}`:null,D=typeof i=="object"?Array.isArray(i)?[...i]:{...i}:i;switch(l){case"attribute":E&&(E=`$${E}`);break;case"text":E="#text";break;case"cdata":E="#cdata";break;case"none":a.type==="array"?(E=null,a.example!==void 0&&(E=a.items?.xml?.name||E)):E=null;break;default:a.type==="array"&&Array.isArray(D)&&(D={[E]:[...D]});break}return s&&l!=="text"&&l!=="cdata"&&l!=="none"&&(typeof D=="object"?D[`$xmlns${n?":"+n:""}`]=s:D={[`$xmlns${n?":"+n:""}`]:s,"#text":D}),{propertyName:E,value:D}}function g4(u){var a=0;if(u.length==0)return a;for(var e=0;e<u.length;e++){var i=u.charCodeAt(e);a=(a<<5)-a+i,a=a&a}return a}function p4(u,a,e,i){return function(){u|=0,a|=0,e|=0,i|=0;var r=u-(a<<27|a>>>5)|0;return u=a^(e<<17|e>>>15),a=e+i|0,e=i+r|0,i=u+r|0,(i>>>0)/4294967296}}function v4(u,a,e,i,r){let o=wu(u,e,i);const n=[];for(let s of a){const{type:l,readOnly:E,writeOnly:D,value:d}=wu({type:o.type,...s},e,i,{...r,isAllOfChild:!0});o.type&&l&&l!==o.type&&(console.warn("allOf: schemas with different types can't be merged"),o.type=l),o.type=o.type||l,o.readOnly=o.readOnly||E,o.writeOnly=o.writeOnly||D,d!=null&&n.push(d)}if(o.type==="object"){o.value=X0(o.value||{},...n.filter(s=>typeof s=="object"));for(const s in o.value)o.value[s]===we&&delete o.value[s];return o}else{o.type==="array"&&(e.quiet||console.warn('OpenAPI Sampler: found allOf with "array" type. Result may be incorrect'));const s=n[n.length-1];return o.value=s??o.value,o}}const Ha={multipleOf:"number",maximum:"number",exclusiveMaximum:"number",minimum:"number",exclusiveMinimum:"number",maxLength:"string",minLength:"string",pattern:"string",items:"array",maxItems:"array",minItems:"array",uniqueItems:"array",additionalItems:"array",maxProperties:"object",minProperties:"object",required:"object",additionalProperties:"object",properties:"object",patternProperties:"object",dependencies:"object"};function H0(u){if(u.type!==void 0)return Array.isArray(u.type)?u.type.length===0?null:u.type[0]:u.type;const a=Object.keys(Ha);for(var e=0;e<a.length;e++){let i=a[e],r=Ha[i];if(u[i]!==void 0)return r}return null}let Z0={},Pu=[];function b4(){Z0={},Pu=[]}function Ui(u){let a;return u.const!==void 0?a=u.const:u.examples!==void 0&&u.examples.length?a=u.examples[0]:u.enum!==void 0&&u.enum.length?a=u.enum[0]:u.default!==void 0&&(a=u.default),a}function Ga(u){const a=Ui(u);if(a!==void 0)return{value:a,readOnly:u.readOnly,writeOnly:u.writeOnly,type:null}}function wu(u,a,e,i){if(i){if(Pu.includes(u))return Ce(H0(u));Pu.push(u)}if(i&&i.depth>a.maxSampleDepth)return Ou(Pu,i),Ce(H0(u));if(u.$ref){if(!e)throw new Error("Your schema contains $ref. You must provide full specification in the third parameter.");let s=decodeURIComponent(u.$ref);s.startsWith("#")&&(s=s.substring(1));const l=T.JsonPointerLib.get(e,s);let E;if(Z0[s]!==!0){Z0[s]=!0;const D=wu(l,a,e,i);if(a.format==="xml"){const d=s.split("/").pop(),F={...i,propertyName:i?.propertyName||d},{propertyName:k,value:b}=ue(D,l,F);E={...D,value:{[k||"root"]:b}}}else E=D;Z0[s]=!1}else{const D=H0(l);E=Ce(D)}return Ou(Pu,i),E}if(u.example!==void 0)return Ou(Pu,i),{value:u.example,readOnly:u.readOnly,writeOnly:u.writeOnly,type:u.type};if(u.allOf!==void 0)return Ou(Pu,i),Ga(u)||v4({...u,allOf:void 0},u.allOf,a,e,i);if(u.oneOf&&u.oneOf.length){u.anyOf&&(a.quiet||console.warn("oneOf and anyOf are not supported on the same level. Skipping anyOf")),Ou(Pu,i);const s=Object.assign({readOnly:u.readOnly,writeOnly:u.writeOnly},u.oneOf[0]);return n(u,s)}if(u.anyOf&&u.anyOf.length){Ou(Pu,i);const s=Object.assign({readOnly:u.readOnly,writeOnly:u.writeOnly},u.anyOf[0]);return n(u,s)}if(u.if&&u.then){Ou(Pu,i);const{if:s,then:l,...E}=u;return wu(X0(E,s,l),a,e,i)}let r=Ui(u),o=null;if(r===void 0){r=null,o=u.type,Array.isArray(o)&&u.type.length>0&&(o=u.type[0]),o||(o=H0(u));let s=Xi[o];s&&(r=s(u,a,e,i))}return Ou(Pu,i),{value:r,readOnly:u.readOnly,writeOnly:u.writeOnly,type:o};function n(s,l){const E=Ga(s);if(E!==void 0)return E;const D=wu({...s,oneOf:void 0,anyOf:void 0},a,e,i),d=wu(l,a,e,i);if(typeof D.value=="object"&&typeof d.value=="object"){const F=X0(D.value,d.value);return{...d,value:F}}return d}}function B4(u,a={},e,i){const r=i&&i.depth||1;let o=Math.min(u.maxItems!=null?u.maxItems:1/0,u.minItems||1);const n=u.prefixItems||u.items||u.contains;Array.isArray(n)&&(o=Math.max(o,n.length));let s=E=>Array.isArray(n)?n[E]||{}:n||{},l=[];if(!n)return l;for(let E=0;E<o;E++){let D=s(E),{value:d}=wu(D,a,e,{depth:r+1});if(a?.format==="xml"){const{value:F,propertyName:k}=ue({value:d},D,i);k?(l?.[k]||(l={...l,[k]:[]}),l[k].push(F)):l={...l,...F}}else l.push(d)}if(a?.format==="xml"&&r===1){const{value:E,propertyName:D}=ue({value:null},u,i);D&&(E?l=Array.isArray(l)?{[D]:{...E,...l.map(d=>({"#text":{...d}}))}}:{[D]:{...l,...E}}:l={[D]:l})}return l}function A4(u){return!0}function Yi(u){let a=0;if(u.type==="number"&&(u.format==="float"||u.format==="double")&&(a=.1),typeof u.exclusiveMinimum=="boolean"||typeof u.exclusiveMaximum=="boolean"){if(u.maximum&&u.minimum)return a=u.exclusiveMinimum?Math.floor(u.minimum)+1:u.minimum,(u.exclusiveMaximum&&a>=u.maximum||!u.exclusiveMaximum&&a>u.maximum)&&(a=(u.maximum+u.minimum)/2),a;if(u.minimum)return u.exclusiveMinimum?Math.floor(u.minimum)+1:u.minimum;if(u.maximum)return u.exclusiveMaximum?u.maximum>0?0:Math.floor(u.maximum)-1:u.maximum>0?0:u.maximum}else{if(u.minimum)return u.minimum;u.exclusiveMinimum?(a=Math.floor(u.exclusiveMinimum)+1,a===u.exclusiveMaximum&&(a=(a+Math.floor(u.exclusiveMaximum)-1)/2)):u.exclusiveMaximum?a=Math.floor(u.exclusiveMaximum)-1:u.maximum&&(a=u.maximum)}return a}function y4(u,a={},e,i){let r={};const o=i&&i.depth||1;if(u&&typeof u.properties=="object"){const n=Array.isArray(u.required)?u.required:[],s={};for(const l of n)s[l]=!0;Object.keys(u.properties).forEach(l=>{if(a.skipNonRequired&&!s.hasOwnProperty(l))return;const E=wu(u.properties[l],a,e,{propertyName:l,depth:o+1});if(a.skipReadOnly&&E.readOnly){i?.isAllOfChild&&(r[l]=we);return}if(a.skipWriteOnly&&E.writeOnly){i?.isAllOfChild&&(r[l]=we);return}if(a?.format==="xml"){const{propertyName:D,value:d}=ue(E,u.properties[l],{propertyName:l});D?r[D]=d:d!==null&&typeof d=="object"&&(r={...r,...d})}else r[l]=E.value})}if(u&&typeof u.additionalProperties=="object"){const n=u.additionalProperties["x-additionalPropertiesName"]||"property";r[`${String(n)}1`]=wu(u.additionalProperties,a,e,{depth:o+1}).value,r[`${String(n)}2`]=wu(u.additionalProperties,a,e,{depth:o+1}).value}if(u&&typeof u.properties=="object"&&u.maxProperties!==void 0&&Object.keys(r).length>u.maxProperties){const n={};let s=0;(Array.isArray(u.required)?u.required:[]).forEach(E=>{r[E]!==void 0&&(n[E]=r[E],s++)}),Object.keys(r).forEach(E=>{s<u.maxProperties&&!n.hasOwnProperty(E)&&(n[E]=r[E],s++)}),r=n}return r}function M0(u,a){return u}function Va(u,a,e){let i=1;if(u)switch(u){case"?":{i=0;break}case"*":{i=M0(0);break}case"+":{i=M0(1);break}default:throw new Error("Unknown quantifier symbol provided.")}else a!=null&&e!=null?i=M0(parseInt(a)):a!=null&&e==null&&(i=parseInt(a));return i}function f4(u){let a=!1;u instanceof RegExp&&(a=u.flags.includes("i"),u=u.toString(),u=u.match(/\/(.+?)\//)?.[1]??""),u=u.replace(/^(\^)?(.*?)(\$)?$/,"$2");let e,i,r;const o=/([.A-Za-z0-9])(?:\{(\d+)(?:\,(\d+)|)\}|(\?|\*|\+))(?![^[]*]|[^{]*})/;let n=u.match(o);for(;n!=null;){const d=n[2],F=n[3],k=n[4];r=Va(k,d,F),u=u.slice(0,n.index)+n[1].repeat(r)+u.slice(n.index+n[0].length),n=u.match(o)}const s=/(\d-\d|\w-\w|\d|\w|[-!@#$&()`.+,/"])/,l=/\[(\^|)(-|)(.+?)\](?:\{(\d+)(?:\,(\d+)|)\}|(\?|\*|\+)|)/;for(n=u.match(l);n!=null;){const d=n[1]==="^",F=n[2]==="-",k=n[4],b=n[5],y=n[6],M=[];let J=n[3],N=J.match(s);for(F&&M.push(45);N!=null;){if(N[0].indexOf("-")===-1)a&&isNaN(Number(N[0]))?(M.push(N[0].toUpperCase().charCodeAt(0)),M.push(N[0].toLowerCase().charCodeAt(0))):M.push(N[0].charCodeAt(0));else{const p=N[0].split("-").map(h=>h.charCodeAt(0));if(e=p[0],i=p[1],e>i)throw new Error("Character range provided is out of order.");for(let h=e;h<=i;h++)if(a&&isNaN(Number(String.fromCharCode(h)))){const B=String.fromCharCode(h);M.push(B.toUpperCase().charCodeAt(0)),M.push(B.toLowerCase().charCodeAt(0))}else M.push(h)}J=J.substring(N[0].length),N=J.match(s)}if(r=Va(y,k,b),d){let p=-1;for(let h=48;h<=57;h++){if(p=M.indexOf(h),p>-1){M.splice(p,1);continue}M.push(h)}for(let h=65;h<=90;h++){if(p=M.indexOf(h),p>-1){M.splice(p,1);continue}M.push(h)}for(let h=97;h<=122;h++){if(p=M.indexOf(h),p>-1){M.splice(p,1);continue}M.push(h)}}const $=Array.from({length:r},()=>String.fromCharCode(M[M0(0)])).join("");u=u.slice(0,n.index)+$+u.slice(n.index+n[0].length),n=u.match(l)}const E=/(.)\{(\d+)\,(\d+)\}/;for(n=u.match(E);n!=null;){if(e=parseInt(n[2]),i=parseInt(n[3]),e>i)throw new Error("Numbers out of order in {} quantifier.");r=M0(e),u=u.slice(0,n.index)+n[1].repeat(r)+u.slice(n.index+n[0].length),n=u.match(E)}const D=/(.)\{(\d+)\}/;for(n=u.match(D);n!=null;)r=parseInt(n[2]),u=u.slice(0,n.index)+n[1].repeat(r)+u.slice(n.index+n[0].length),n=u.match(D);return u}const z4="qwerty!@#$%^123456";function S4(){return"user@example.com"}function M4(){return"пошта@укр.нет"}function j4(u,a){let e="pa$$word";return u>e.length&&(e+="_",e+=Zi(z4,u-e.length).substring(0,u-e.length)),e}function _e({min:u,max:a,omitTime:e,omitDate:i}){let r=F4(new Date("2019-08-24T14:15:22.123Z"),e,i);return r.length<u&&console.warn(`Using minLength = ${u} is incorrect with format "date-time"`),a&&r.length>a&&console.warn(`Using maxLength = ${a} is incorrect with format "date-time"`),r}function P4(u,a){return _e({min:u,max:a,omitTime:!1,omitDate:!1})}function w4(u,a){return _e({min:u,max:a,omitTime:!0,omitDate:!1})}function K4(u,a){return _e({min:u,max:a,omitTime:!1,omitDate:!0}).slice(1)}function Qi(u,a,e,i,r=!1){if(i&&r)return f4(i);let o=Zi("string",u);return a&&o.length>a&&(o=o.substring(0,a)),o}function T4(){return"192.168.0.1"}function L4(){return"2001:0db8:85a3:0000:0000:8a2e:0370:7334"}function N4(){return"example.com"}function R4(){return"приклад.укр"}function H4(){return"http://example.com"}function G4(){return"../dictionary"}function V4(){return"http://example.com/{endpoint}"}function _4(){return"http://example.com/entity/1"}function J4(){return"/entity/1"}function $4(u,a,e){return k4(e||"id")}function I4(){return"/json/pointer"}function O4(){return"1/relative/json/pointer"}function W4(){return"/regex/"}const q4={email:S4,"idn-email":M4,password:j4,"date-time":P4,date:w4,time:K4,ipv4:T4,ipv6:L4,hostname:N4,"idn-hostname":R4,iri:_4,"iri-reference":J4,uri:H4,"uri-reference":G4,"uri-template":V4,uuid:$4,default:Qi,"json-pointer":I4,"relative-json-pointer":O4,regex:W4};function Z4(u,a,e,i){let r=u.format||"default",o=q4[r]||Qi,n=i&&i.propertyName;return o(u.minLength||0,u.maxLength,n,u.pattern,a?.enablePatterns)}var Xi={};const U4={skipReadOnly:!1,maxSampleDepth:15};function Y4(u,a){if(!u)throw new Error("Unknown format output for building XML.");return(Array.isArray(u)||Object.keys(u).length>1)&&(u={[a?.xml?.name||"root"]:u}),new T.Builder({ignoreAttributes:!1,format:!0,attributeNamePrefix:"$",textNodeName:"#text",cdataPropName:"#cdata"}).build(u)}function Q4(u,a,e){let i=Object.assign({},U4,a);b4();let r=wu(u,i,e).value;return i?.format==="xml"?Y4(r,u):r}function C0(u,a){Xi[u]=a}C0("array",B4);C0("boolean",A4);C0("integer",Yi);C0("number",Yi);C0("object",y4);C0("string",Z4);function ur(u,a){if(u)try{return Q4(u,{skipReadOnly:!0,skipNonRequired:!1,quiet:!0})}catch(e){a.error(q0(" Error while generating test data from JSON Schema ")+`
@@ -1,4 +1,4 @@
1
- import { t as Ro, b as ou, p as ju, J as Uu, c as Ho, f as Ii, B as Go, g as j0, h as Na, k as Ra, m as Vo, l as _o, n as Jo, o as $o, q as Io, u as Oo, A as Oi, v as $e } from "./replay-index-BZey8T6L.js";
1
+ import { t as Ro, b as ou, p as ju, J as Uu, c as Ho, f as Ii, B as Go, g as j0, h as Na, k as Ra, m as Vo, l as _o, n as Jo, o as $o, q as Io, u as Oo, A as Oi, v as $e } from "./replay-index-_Pe87QOg.js";
2
2
  const {
3
3
  env: D0 = {},
4
4
  argv: Wi = [],
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./replay-index-BIn_L-wL.js");async function u(r,n){const t=e.sep(),l=await e.resolve(r),c=await e.resolve(n),a=l.replace(new RegExp(`^${t}+`),"").split(t).filter(Boolean),i=c.replace(new RegExp(`^${t}+`),"").split(t).filter(Boolean),m=Math.min(a.length,i.length);let s=0;for(let o=0;o<m&&a[o]===i[o];o++)s++;const p=a.slice(s).map(()=>".."),f=i.slice(s);return[...p,...f].join(t)}async function g(r){const n=await e.extname(r);return n?`.${n}`:""}exports.dirname=e.dirname;exports.isAbsolute=e.isAbsolute;exports.join=e.join;exports.resolve=e.resolve;exports.extname=g;exports.relative=u;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./replay-index-nJ_B4GmS.js");async function u(r,n){const t=e.sep(),l=await e.resolve(r),c=await e.resolve(n),a=l.replace(new RegExp(`^${t}+`),"").split(t).filter(Boolean),i=c.replace(new RegExp(`^${t}+`),"").split(t).filter(Boolean),m=Math.min(a.length,i.length);let s=0;for(let o=0;o<m&&a[o]===i[o];o++)s++;const p=a.slice(s).map(()=>".."),f=i.slice(s);return[...p,...f].join(t)}async function g(r){const n=await e.extname(r);return n?`.${n}`:""}exports.dirname=e.dirname;exports.isAbsolute=e.isAbsolute;exports.join=e.join;exports.resolve=e.resolve;exports.extname=g;exports.relative=u;
@@ -1,5 +1,5 @@
1
- import { e as h, s as x, r as i } from "./replay-index-BZey8T6L.js";
2
- import { d as j, a as b, j as d } from "./replay-index-BZey8T6L.js";
1
+ import { e as h, s as x, r as i } from "./replay-index-_Pe87QOg.js";
2
+ import { d as j, a as b, j as d } from "./replay-index-_Pe87QOg.js";
3
3
  async function u(n, e) {
4
4
  const t = x(), l = await i(n), c = await i(e), o = l.replace(new RegExp(`^${t}+`), "").split(t).filter(Boolean), r = c.replace(new RegExp(`^${t}+`), "").split(t).filter(Boolean), m = Math.min(o.length, r.length);
5
5
  let s = 0;
package/dist/replay.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./replay-index-BIn_L-wL.js"),t=require("./replay-oauth2-redirect-handler-Bqw5UUvl.js");exports.AgentLoop=e.AgentLoop;exports.AiPanelContext=e.AiPanelContext;exports.EmbeddedReplay=e.EmbeddedReplay;exports.Modal=e.Modal;exports.Replay=e.Replay;exports.ReplayOverlay=e.ReplayOverlay;Object.defineProperty(exports,"SpanStatusCode",{enumerable:!0,get:()=>e.SpanStatusCode});exports.TelemetryClient=e.TelemetryClient;exports.applyThemeToDOM=e.applyThemeToDOM;exports.getCurrentTheme=e.getCurrentTheme;exports.resolveTheme=e.resolveTheme;exports.useAiPanel=e.useAiPanel;exports.useTelemetry=e.useTelemetry;exports.useTelemetryClient=e.useTelemetryClient;exports.OAuth2Error=t.OAuth2Error;exports.handleOAuth2Redirect=t.handleOAuth2Redirect;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./replay-index-nJ_B4GmS.js"),t=require("./replay-oauth2-redirect-handler-Bqw5UUvl.js");exports.AgentLoop=e.AgentLoop;exports.AiPanelContext=e.AiPanelContext;exports.EmbeddedReplay=e.EmbeddedReplay;exports.Modal=e.Modal;exports.Replay=e.Replay;exports.ReplayOverlay=e.ReplayOverlay;Object.defineProperty(exports,"SpanStatusCode",{enumerable:!0,get:()=>e.SpanStatusCode});exports.TelemetryClient=e.TelemetryClient;exports.applyThemeToDOM=e.applyThemeToDOM;exports.getCurrentTheme=e.getCurrentTheme;exports.resolveTheme=e.resolveTheme;exports.useAiPanel=e.useAiPanel;exports.useTelemetry=e.useTelemetry;exports.useTelemetryClient=e.useTelemetryClient;exports.OAuth2Error=t.OAuth2Error;exports.handleOAuth2Redirect=t.handleOAuth2Redirect;
package/dist/replay.d.ts CHANGED
@@ -19,20 +19,25 @@ export declare class AgentLoop {
19
19
  private readonly toolLoopAgent;
20
20
  private readonly maxHistoryMessages;
21
21
  private readonly maxHistoryChars;
22
+ private readonly maxSteps;
22
23
  private readonly context;
23
24
  private readonly systemInstructions;
25
+ private readonly model;
24
26
  private tools;
25
27
  constructor(config: AgentRuntimeConfig);
26
28
  getAgent(): ToolLoopAgent<never, ReplayToolSet, never>;
27
29
  addContext(context: SystemModelMessage[]): void;
28
30
  registerTools(tools: ReplayToolSet): void;
31
+ generateTitle(prompt: string, abortSignal?: AbortSignal): Promise<string>;
29
32
  private prepareMessages;
30
33
  private preparePrompt;
31
34
  }
32
35
 
33
36
  declare type AgentRuntimeConfig = {
37
+ activeConversationId: string;
34
38
  model: Model;
35
39
  tools: ReplayToolSet;
40
+ sendEvent: AiChatTelemetrySendEvent;
36
41
  maxSteps?: number;
37
42
  maxOutputTokens?: ToolLoopAgentConfig['maxOutputTokens'];
38
43
  maxRetries?: ToolLoopAgentConfig['maxRetries'];
@@ -42,6 +47,8 @@ declare type AgentRuntimeConfig = {
42
47
  maxHistoryChars?: number;
43
48
  };
44
49
 
50
+ declare type AiChatTelemetrySendEvent = <T extends AsyncApiReplay.EventType>(event: T, data: AsyncApiReplay.GetEventData<T>) => void;
51
+
45
52
  export declare const AiPanelContext: Context<AiPanelContextValue>;
46
53
 
47
54
  export declare type AiPanelContextValue = {
@@ -102,12 +109,14 @@ declare type ConvertOperationFunction = (path: string, method: string, openAPI:
102
109
 
103
110
  declare const definitions: {
104
111
  open_tab: Tool< {
105
- action: "focus_tab" | "open_operation" | "open_collection" | "open_workflow" | "open_step" | "open_workflow_run";
112
+ action: "focus_tab" | "open_operation" | "open_collection" | "open_workflow" | "open_step" | "open_workflow_run" | "open_new_request";
106
113
  tabIndex?: number | undefined;
107
- collectionId?: string | undefined;
108
114
  workflowId?: string | undefined;
109
115
  stepId?: string | undefined;
110
116
  operationId?: string | undefined;
117
+ collectionId?: string | undefined;
118
+ requestUrl?: string | undefined;
119
+ requestMethod?: string | undefined;
111
120
  }, {
112
121
  error: {
113
122
  message: string;
@@ -117,18 +126,18 @@ declare const definitions: {
117
126
  data?: undefined;
118
127
  } | {
119
128
  data: {
120
- tabId: string;
121
129
  outcome: "focused" | "opened";
122
130
  activeTabIndex: number;
131
+ tabId: string;
123
132
  tabType: TabDataType;
124
133
  };
125
134
  isError: false;
126
135
  error?: undefined;
127
136
  }>;
128
137
  run_request: Tool< {
129
- collectionId: string;
130
138
  workflowId: string;
131
139
  stepId: string;
140
+ collectionId: string;
132
141
  }, {
133
142
  error: {
134
143
  message: string;
@@ -142,15 +151,15 @@ declare const definitions: {
142
151
  url?: string | undefined;
143
152
  status?: number | undefined;
144
153
  size?: number | undefined;
154
+ duration?: number | undefined;
145
155
  headers?: [string, string][] | undefined;
146
156
  cookies?: [string, string][] | undefined;
147
- duration?: number | undefined;
148
157
  };
149
158
  isError: false;
150
159
  error?: undefined;
151
160
  }>;
152
161
  get_current_tab: Tool< {
153
- sections: ("security" | "result" | "info" | "workflows" | "sourceDescriptions" | "inputs" | "steps" | "parameters" | "outputs" | "successCriteria" | "requestBody" | "response" | "severity")[];
162
+ sections: ("security" | "result" | "info" | "workflows" | "sourceDescriptions" | "inputs" | "steps" | "parameters" | "outputs" | "successCriteria" | "requestBody" | "severity" | "response")[];
154
163
  }, {
155
164
  error: {
156
165
  message: string;
@@ -169,57 +178,173 @@ declare const definitions: {
169
178
  path?: string | undefined;
170
179
  type?: "workflow" | "collection" | "step" | "api" | "api_operation" | undefined;
171
180
  method?: string | undefined;
172
- collectionId?: string | undefined;
181
+ query?: string | undefined;
182
+ apiId?: string | undefined;
173
183
  workflowId?: string | undefined;
174
184
  stepId?: string | undefined;
175
- apiId?: string | undefined;
176
185
  operationId?: string | undefined;
177
- query?: string | undefined;
186
+ collectionId?: string | undefined;
178
187
  }, unknown>;
179
- update_step: Tool< {
180
- collectionId: string;
188
+ update_security: Tool< {
181
189
  workflowId: string;
182
190
  stepId: string;
183
- body?: {
184
- content: string;
185
- contentType?: string | undefined;
191
+ collectionId: string;
192
+ changes: ({
193
+ type: import("../../../../types/security").SecurityTypes.BasicAuth;
194
+ action: "add" | "update";
195
+ approved: boolean;
196
+ data?: {
197
+ password?: string | undefined;
198
+ username?: string | undefined;
186
199
  } | undefined;
187
- security?: ({
188
- values: Record<string, unknown>;
189
- schemeName: string;
200
+ index?: number | undefined;
201
+ schemeId?: string | undefined;
190
202
  } | {
191
- values: Record<string, unknown>;
192
- scheme: {
193
- type: "http";
194
- scheme: "basic" | "digest" | "bearer";
195
- bearerFormat?: string | undefined;
203
+ type: import("../../../../types/security").SecurityTypes.DigestAuth;
204
+ action: "add" | "update";
205
+ approved: boolean;
206
+ data?: {
207
+ password?: string | undefined;
208
+ username?: string | undefined;
209
+ } | undefined;
210
+ index?: number | undefined;
211
+ schemeId?: string | undefined;
196
212
  } | {
197
- type: "apiKey";
198
- name: string;
199
- in: "header" | "query" | "cookie";
213
+ type: import("../../../../types/security").SecurityTypes.JWT;
214
+ action: "add" | "update";
215
+ approved: boolean;
216
+ data?: {
217
+ token?: string | undefined;
218
+ } | undefined;
219
+ index?: number | undefined;
220
+ schemeId?: string | undefined;
221
+ } | {
222
+ type: import("../../../../types/security").SecurityTypes.APIKey;
223
+ action: "add" | "update";
224
+ approved: boolean;
225
+ data?: {
226
+ key?: string | undefined;
227
+ name?: string | undefined;
228
+ location?: "header" | "query" | "cookie" | undefined;
229
+ } | undefined;
230
+ index?: number | undefined;
231
+ schemeId?: string | undefined;
200
232
  } | {
201
- type: "oauth2";
202
- flows: Record<string, unknown>;
233
+ type: import("../../../../types/security").SecurityTypes.OAuth2;
234
+ action: "add" | "update";
235
+ approved: boolean;
236
+ data?: {
237
+ password?: string | undefined;
238
+ username?: string | undefined;
239
+ clientId?: string | undefined;
240
+ clientSecret?: string | undefined;
241
+ grantType?: "password" | "implicit" | "clientCredentials" | "authorizationCode" | "clientCredentialsWithJwtAssertion" | "authorizationCodeWithPkce" | undefined;
242
+ tokenUrl?: string | undefined;
243
+ accessToken?: string | undefined;
244
+ authorizationUrl?: string | undefined;
245
+ callbackUrl?: string | undefined;
246
+ } | undefined;
247
+ index?: number | undefined;
248
+ schemeId?: string | undefined;
203
249
  } | {
204
- type: "openIdConnect";
205
- flows?: Record<string, unknown> | undefined;
250
+ type: import("../../../../types/security").SecurityTypes.OpenIDConnect;
251
+ action: "add" | "update";
252
+ approved: boolean;
253
+ data?: {
254
+ password?: string | undefined;
255
+ username?: string | undefined;
256
+ clientId?: string | undefined;
257
+ clientSecret?: string | undefined;
206
258
  openIdConnectUrl?: string | undefined;
259
+ grantType?: "password" | "implicit" | "clientCredentials" | "authorizationCode" | "clientCredentialsWithJwtAssertion" | "authorizationCodeWithPkce" | undefined;
260
+ tokenUrl?: string | undefined;
261
+ accessToken?: string | undefined;
262
+ authorizationUrl?: string | undefined;
263
+ callbackUrl?: string | undefined;
264
+ userInfoUrl?: string | undefined;
265
+ } | undefined;
266
+ index?: number | undefined;
267
+ schemeId?: string | undefined;
268
+ } | {
269
+ action: "remove";
270
+ approved: boolean;
271
+ index: number;
272
+ })[];
273
+ }, {
274
+ error: {
275
+ message: string;
276
+ details?: unknown;
207
277
  };
208
- })[] | undefined;
209
- description?: string | undefined;
210
- url?: string | undefined;
211
- method?: string | undefined;
212
- parameters?: {
278
+ isError: true;
279
+ data?: undefined;
280
+ } | {
281
+ data: {
282
+ changedCount: number;
283
+ };
284
+ isError: false;
285
+ error?: undefined;
286
+ }>;
287
+ update_step: Tool< {
288
+ workflowId: string;
289
+ stepId: string;
290
+ collectionId: string;
291
+ changes: ({
292
+ data: string;
293
+ field: "url";
294
+ action: "add" | "remove" | "update";
295
+ approved: boolean;
296
+ id?: string | undefined;
297
+ } | {
298
+ data: string;
299
+ field: "description";
300
+ action: "add" | "remove" | "update";
301
+ approved: boolean;
302
+ id?: string | undefined;
303
+ } | {
304
+ data: "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS";
305
+ field: "method";
306
+ action: "add" | "remove" | "update";
307
+ approved: boolean;
308
+ id?: string | undefined;
309
+ } | {
310
+ field: "parameters";
311
+ action: "add" | "remove" | "update";
312
+ approved: boolean;
313
+ data?: {
213
314
  name: string;
214
315
  in: "header" | "path" | "query" | "cookie";
215
316
  value: string;
216
- }[] | undefined;
217
- outputs?: Record<string, string> | undefined;
218
- successCriteria?: {
317
+ } | undefined;
318
+ id?: string | undefined;
319
+ } | {
320
+ field: "outputs";
321
+ action: "add" | "remove" | "update";
322
+ approved: boolean;
323
+ data?: {
324
+ name: string;
325
+ expression: string;
326
+ } | undefined;
327
+ id?: string | undefined;
328
+ } | {
329
+ field: "successCriteria";
330
+ action: "add" | "remove" | "update";
331
+ approved: boolean;
332
+ data?: {
219
333
  condition: string;
220
- type?: "simple" | "regex" | "jsonpath" | "xpath" | undefined;
334
+ type?: "regex" | "simple" | "jsonpath" | "xpath" | undefined;
221
335
  context?: string | undefined;
222
- }[] | undefined;
336
+ } | undefined;
337
+ id?: string | undefined;
338
+ } | {
339
+ data: {
340
+ content: string;
341
+ contentType?: string | undefined;
342
+ };
343
+ field: "body";
344
+ action: "add" | "remove" | "update";
345
+ approved: boolean;
346
+ id?: string | undefined;
347
+ })[];
223
348
  }, {
224
349
  error: {
225
350
  message: string;
@@ -234,6 +359,126 @@ declare const definitions: {
234
359
  isError: false;
235
360
  error?: undefined;
236
361
  }>;
362
+ manage_collection: Tool< {
363
+ title: string;
364
+ action: "create_collection";
365
+ } | {
366
+ collectionId: string;
367
+ action: "delete_collection";
368
+ } | {
369
+ name: string;
370
+ collectionId: string;
371
+ action: "create_workflow";
372
+ } | {
373
+ workflowId: string;
374
+ collectionId: string;
375
+ action: "delete_workflow";
376
+ } | {
377
+ workflowId: string;
378
+ collectionId: string;
379
+ action: "create_step";
380
+ operation?: {
381
+ path: string;
382
+ method: string;
383
+ apiId: string;
384
+ operationId?: string | undefined;
385
+ } | undefined;
386
+ xOperation?: {
387
+ url: string;
388
+ method: string;
389
+ } | undefined;
390
+ stepName?: string | undefined;
391
+ } | {
392
+ workflowId: string;
393
+ stepId: string;
394
+ collectionId: string;
395
+ action: "delete_step";
396
+ } | {
397
+ action: "save_tab_to_collection";
398
+ targetCollectionId: string;
399
+ targetWorkflowId: string;
400
+ newStepName: string;
401
+ }, {
402
+ error: {
403
+ message: string;
404
+ details?: unknown;
405
+ };
406
+ isError: true;
407
+ data?: undefined;
408
+ } | {
409
+ data: {
410
+ summary: string;
411
+ workflowId?: string | undefined;
412
+ stepId?: string | undefined;
413
+ collectionId?: string | undefined;
414
+ };
415
+ isError: false;
416
+ error?: undefined;
417
+ }>;
418
+ manage_environment: Tool< {
419
+ action: "get_environments";
420
+ } | {
421
+ action: "get_active_environment";
422
+ } | {
423
+ action: "get_inputs";
424
+ environment?: string | undefined;
425
+ } | {
426
+ action: "get_input";
427
+ inputName: string;
428
+ environment?: string | undefined;
429
+ } | {
430
+ name: string;
431
+ value: string;
432
+ action: "upsert_input";
433
+ isSecret?: boolean | undefined;
434
+ environment?: string | undefined;
435
+ } | {
436
+ action: "remove_input";
437
+ inputName: string;
438
+ environment?: string | undefined;
439
+ } | {
440
+ value: string;
441
+ apiId: string;
442
+ action: "upsert_server";
443
+ variables?: {
444
+ name: string;
445
+ value: string;
446
+ }[] | undefined;
447
+ environment?: string | undefined;
448
+ } | {
449
+ apiId: string;
450
+ action: "remove_server";
451
+ environment?: string | undefined;
452
+ } | {
453
+ environment: string;
454
+ action: "set_active_environment";
455
+ }, {
456
+ error: {
457
+ message: string;
458
+ details?: unknown;
459
+ };
460
+ isError: true;
461
+ data?: undefined;
462
+ } | {
463
+ data: {
464
+ summary: string;
465
+ input?: {
466
+ name: string;
467
+ value: string;
468
+ isSecret: boolean;
469
+ } | undefined;
470
+ apiId?: string | undefined;
471
+ inputs?: {
472
+ name: string;
473
+ value: string;
474
+ isSecret: boolean;
475
+ }[] | undefined;
476
+ environment?: string | undefined;
477
+ environmentNames?: string[] | undefined;
478
+ };
479
+ isError: false;
480
+ error?: undefined;
481
+ }>;
237
482
  };
238
483
 
239
484
  export declare function EmbeddedReplay(props: ReplayAppProps): JSX.Element;
package/dist/replay.js CHANGED
@@ -1,4 +1,4 @@
1
- import { w as s, x as t, E as l, M as r, R as o, y as m, S as n, T as p, z as y, C as T, D as d, F as h, G as u, H as C } from "./replay-index-BZey8T6L.js";
1
+ import { w as s, x as t, E as l, M as r, R as o, y as m, S as n, T as p, z as y, C as T, D as d, F as h, G as u, H as C } from "./replay-index-_Pe87QOg.js";
2
2
  import { O as A, h as O } from "./replay-oauth2-redirect-handler-CqKZB3aV.js";
3
3
  export {
4
4
  s as AgentLoop,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redocly/replay",
3
- "version": "0.23.0-next.3",
3
+ "version": "0.23.0-next.5",
4
4
  "type": "module",
5
5
  "main": "./dist/replay.cjs",
6
6
  "module": "./dist/replay.js",
@@ -20,7 +20,7 @@
20
20
  "react-dom": "^19.2.4",
21
21
  "react-router-dom": "^6.30.3",
22
22
  "styled-components": "^5.3.11",
23
- "@redocly/theme": "0.64.0-next.3"
23
+ "@redocly/theme": "0.64.0-next.5"
24
24
  },
25
25
  "dependencies": {
26
26
  "@ai-sdk/google": "3.0.1",
@@ -46,7 +46,7 @@
46
46
  "@lezer/highlight": "^1.1.6",
47
47
  "@noble/hashes": "^1.8.0",
48
48
  "@opentelemetry/api": "1.9.0",
49
- "@redocly/hookstate-core": "^4.2.1",
49
+ "@redocly/hookstate-core": "4.2.2",
50
50
  "@redocly/hookstate-devtools": "^4.2.0",
51
51
  "@redocly/openapi-core": "2.25.2",
52
52
  "@redocly/respect-core": "2.25.2",