@redocly/replay 0.24.0-next.2 → 0.24.0-next.3

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
- import { t as No, b as iu, p as ju, J as Uu, c as Ro, f as Ji, B as Ho, g as j0, h as Ta, k as La, m as Go, l as Vo, n as _o, o as Jo, q as $o, u as Io, A as $i, v as _e } from "./replay-index-B2hxHO71.js";
1
+ import { t as No, b as iu, p as ju, J as Uu, c as Ro, f as Ji, B as Ho, g as j0, h as Ta, k as La, m as Go, l as Vo, n as _o, o as Jo, q as $o, u as Io, A as $i, v as _e } from "./replay-index-CJcnXz6B.js";
2
2
  const {
3
3
  env: x0 = {},
4
4
  argv: Ii = [],
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("./replay-index-DdH9X-06.js"),{env:E0={},argv:Ni=[],platform:So=""}=typeof process>"u"?{}:process,Mo="NO_COLOR"in E0||Ni.includes("--no-color"),jo="FORCE_COLOR"in E0||Ni.includes("--color"),Po=So==="win32",wo=E0.TERM==="dumb",Ko=w.tty&&void 0,To="CI"in E0&&("GITHUB_ACTIONS"in E0||"GITLAB_CI"in E0||"CIRCLECI"in E0),Lo=!Mo&&(jo||Po&&!wo||Ko||To),Ri=(u,a,e,i,r=a.substring(0,u)+i,o=a.substring(u+e.length),n=o.indexOf(e))=>r+(n<0?o:Ri(n,o,e,i)),No=(u,a,e,i,r)=>u<0?e+a+i:e+Ri(u,a,i,r)+i,Ro=(u,a,e=u,i=u.length+1)=>r=>r||!(r===""||r===void 0)?No((""+r).indexOf(a,i),r,u,a,e):"",I=(u,a,e)=>Ro(`\x1B[${u}m`,`\x1B[${a}m`,e),ja={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)},Ho=({useColor:u=Lo}={})=>u?ja:Object.keys(ja).reduce((a,e)=>({...a,[e]:String}),{}),{reset:RU,bold:Uu,dim:Go,italic:HU,underline:Vo,inverse:Hi,hidden:GU,strikethrough:VU,black:_U,red:iu,green:m0,yellow:Yu,blue:Du,magenta:JU,cyan:$U,white:Pa,gray:du,bgBlack:IU,bgRed:q0,bgGreen:OU,bgYellow:WU,bgBlue:qU,bgMagenta:ZU,bgCyan:UU,bgWhite:YU,blackBright:QU,redBright:XU,greenBright:uY,yellowBright:eY,blueBright:aY,magentaBright:iY,cyanBright:rY,whiteBright:nY,bgBlackBright:oY,bgRedBright:tY,bgGreenBright:sY,bgYellowBright:lY,bgBlueBright:EY,bgMagentaBright:DY,bgCyanBright:xY,bgWhiteBright:cY}=Ho(),_o=u=>/\{.*?\}/.test(u);function Hu({value:u,ctx:a,logger:e}){if(!u)return u;if(w.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}):_o(u)?Io(u,a,e):Wo(u,a,e)}function Jo(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 $o(u,a){const e=Object.keys(a),i=Object.values(a);return new Function(...e,`return ${u}`)(...i)}function Io(u,a,e){const i=/\{\$(\{[^{}]*\}|[^{}])*\}/g;let r=u;return r=r.replace(i,(o,n)=>Oo(o,a,e)),r}function Oo(u,a,e){if(!u.includes("$"))return u;if(u.includes("$faker."))return Jo(u,a,e);const i=S0(a)(qo(u));return i!==void 0?i:""}const Wo=(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)(wa(i)):i.replace(/\$\{([^}]+)}/g,(r,o)=>S0(a)(wa(o)))};function qo(u){return u.replace(/\{(.*)\}/,"$1")}function wa(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 w=require("./replay-index-o0B_MaDr.js"),{env:E0={},argv:Ni=[],platform:So=""}=typeof process>"u"?{}:process,Mo="NO_COLOR"in E0||Ni.includes("--no-color"),jo="FORCE_COLOR"in E0||Ni.includes("--color"),Po=So==="win32",wo=E0.TERM==="dumb",Ko=w.tty&&void 0,To="CI"in E0&&("GITHUB_ACTIONS"in E0||"GITLAB_CI"in E0||"CIRCLECI"in E0),Lo=!Mo&&(jo||Po&&!wo||Ko||To),Ri=(u,a,e,i,r=a.substring(0,u)+i,o=a.substring(u+e.length),n=o.indexOf(e))=>r+(n<0?o:Ri(n,o,e,i)),No=(u,a,e,i,r)=>u<0?e+a+i:e+Ri(u,a,i,r)+i,Ro=(u,a,e=u,i=u.length+1)=>r=>r||!(r===""||r===void 0)?No((""+r).indexOf(a,i),r,u,a,e):"",I=(u,a,e)=>Ro(`\x1B[${u}m`,`\x1B[${a}m`,e),ja={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)},Ho=({useColor:u=Lo}={})=>u?ja:Object.keys(ja).reduce((a,e)=>({...a,[e]:String}),{}),{reset:RU,bold:Uu,dim:Go,italic:HU,underline:Vo,inverse:Hi,hidden:GU,strikethrough:VU,black:_U,red:iu,green:m0,yellow:Yu,blue:Du,magenta:JU,cyan:$U,white:Pa,gray:du,bgBlack:IU,bgRed:q0,bgGreen:OU,bgYellow:WU,bgBlue:qU,bgMagenta:ZU,bgCyan:UU,bgWhite:YU,blackBright:QU,redBright:XU,greenBright:uY,yellowBright:eY,blueBright:aY,magentaBright:iY,cyanBright:rY,whiteBright:nY,bgBlackBright:oY,bgRedBright:tY,bgGreenBright:sY,bgYellowBright:lY,bgBlueBright:EY,bgMagentaBright:DY,bgCyanBright:xY,bgWhiteBright:cY}=Ho(),_o=u=>/\{.*?\}/.test(u);function Hu({value:u,ctx:a,logger:e}){if(!u)return u;if(w.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}):_o(u)?Io(u,a,e):Wo(u,a,e)}function Jo(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 $o(u,a){const e=Object.keys(a),i=Object.values(a);return new Function(...e,`return ${u}`)(...i)}function Io(u,a,e){const i=/\{\$(\{[^{}]*\}|[^{}])*\}/g;let r=u;return r=r.replace(i,(o,n)=>Oo(o,a,e)),r}function Oo(u,a,e){if(!u.includes("$"))return u;if(u.includes("$faker."))return Jo(u,a,e);const i=S0(a)(qo(u));return i!==void 0?i:""}const Wo=(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)(wa(i)):i.replace(/\$\{([^}]+)}/g,(r,o)=>S0(a)(wa(o)))};function qo(u){return u.replace(/\{(.*)\}/,"$1")}function wa(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 $o(`ctx${o}`,r)}catch(o){e.error(iu(o.toString()));return}}function Gi(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})):Gi(u[i],a,e)}function Ka(u,a,e){return Gi(u,a,e)||u}function Ta(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 Zo(u){return w.isPlainObject(u)&&"name"in u&&"value"in u&&!("in"in u)}function He(u){return w.isPlainObject(u)&&"in"in u&&typeof u.in=="string"&&["header","query","path","cookie"].includes(u.in)}const Uo=/^image\/(png|jpeg|gif|bmp|webp|svg\+xml)|application\/pdf$/;function Vi(u){return u.startsWith("$file(")&&u.endsWith(")")?u.substring(7,u.length-2):u}const La=async(u,a,e,i,r)=>{const o=w.pathBrowserifyExports.dirname(i),n=w.pathBrowserifyExports.resolve(o,Vi(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(La(a,l,s,i,r)):Array.isArray(s)?s.forEach(E=>{typeof E=="string"&&E.startsWith("$file(")&&E.endsWith(")")?u.push(La(a,l,E,i,r)):a.append(l,E.toString())}):w.isPlainObject(s)?_i(u,a,s,i,r,l):(typeof s=="string"||typeof s=="number"||typeof s=="boolean")&&a.append(l,s.toString())})},Yo=async(u,a,e,i)=>{if(w.isPlainObject(u)){const r=[];_i(r,a,u,e,i),await Promise.all(r)}},Qo=async(u,a)=>{if(typeof u=="string"&&u.startsWith("$file(")&&u.endsWith(")")){const e=w.pathBrowserifyExports.resolve(w.pathBrowserifyExports.dirname(a.options.filePath),Vi(u));return a.options.requestFileLoader.getFileBody(e)}else return u};async function Xo(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=w.pathBrowserifyExports.resolve(a.options.filePath);return await Yo(e,r,o,a),{...u,payload:r}}else{if(i==="application/octet-stream"||typeof i=="string"&&Uo.test(i))return{...u,payload:await Qo(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 u4({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=w.JsonPointerLib.get(u,o),l=Ku({payload:n,context:e,logger:i});s!==void 0&&w.JsonPointerLib.set(u,o,l)}catch{throw new Error(`Invalid JSON Pointer: ${o}`)}}}const e4=["parameters","failureActions","successActions"];function a4(u,a){const{reference:e,value:i}=u;if(!e4.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 w.isPlainObject(r)&&"value"in r&&i?{...r,value:i}:r}function f0(u,a){return"reference"in u?a4(u,a):u}function i4(u){try{return w.parseRuntimeExpression(u)}catch{throw new Error(`Runtime expression is not valid: ${u}`)}}function r4(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=w.JsonPointerLib.get(u,`/${a}`);return typeof i=="string"||Array.isArray(i)||w.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 Ka(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 Ka(u,a,i)}return typeof u=="string"?x4(u)?Zu(u,a,i):D4(u,a,i):w.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 Zu(u,a,e){return typeof u=="string"?n4(u,a,e):w.isPlainObject(u)?Object.entries(u).reduce((i,[r,o])=>(i[r]=o&&Zu(o,a,e),i),{}):Array.isArray(u)?u.map(i=>Zu(i,a,e)):u}function n4(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;i4(u);const i=t4(u,a),r=s4(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 o4(u){return u.replace(/\$([a-zA-Z0-9._-]+)/g,(a,e)=>`$${e.replace(/-/g,"_")}`)}function t4(u,a){const e=r4(u,a);let r=o4(e);if(r.startsWith("{")&&r.endsWith("}")){const l=r.slice(1,-1);!l.trim().startsWith("{")&&!l.trim().startsWith("[")&&(r=l)}const o=E4(r),n=/\.header\.([a-zA-Z0-9._-]+)/g;return o.replace(n,(l,E)=>`.header.${E.toLowerCase()}`)}function s4(u){const a={};for(const[e,i]of Object.entries(u)){const r=e.replace(/-/g,"_");a[r]=Ji(i)}return a}function Ji(u){return Array.isArray(u)?u:w.isPlainObject(u)?l4(u):u}function l4(u){return Object.keys(u).reduce((a,e)=>{const i=e.replace(/-/g,"_");return a[i]=Ji(u[e]),a},{})}function E4(u){return u.replace(/\.(\d+)/g,(a,e,i,r)=>{const o=r[i-1];return/\d/.test(o)?a:`[${e}]`})}function D4(u,a,e){const i=/\{(?:[^{}]|\{[^{}]*\})*\}|\$[^\s{}]+(?:\([^()]*\))*/g;return u.replace(i,r=>{const o=r.trim(),n=Zu(o,a,e);return n!==void 0?n:r})}function x4(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 $i extends Error{}class Ii extends $i{}class Oi extends $i{}async function c4(u){const{descriptionPath:a,externalRefResolver:e,base:i}=u,r=await w.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 d4={title:"[REPLACE WITH API title]",version:"[REPLACE WITH API version]"},we=Symbol("skip");function b0(u){return u<10?"0"+u:u}function m4(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 Wi(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 F4(u){var a=h4(u),e=g4(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 k4(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 C4(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}=k4(a),l=C4(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 h4(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 g4(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 p4(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 Na={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(Na);for(var e=0;e<a.length;e++){let i=a[e],r=Na[i];if(u[i]!==void 0)return r}return null}let Z0={},Pu=[];function v4(){Z0={},Pu=[]}function qi(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 Ra(u){const a=qi(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=w.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),Ra(u)||p4({...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=qi(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=Yi[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=Ra(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 B4(u){return!0}function Zi(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 A4(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 Ha(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 y4(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=Ha(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=Ha(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 f4="qwerty!@#$%^123456";function z4(){return"user@example.com"}function S4(){return"пошта@укр.нет"}function M4(u,a){let e="pa$$word";return u>e.length&&(e+="_",e+=Wi(f4,u-e.length).substring(0,u-e.length)),e}function Ge({min:u,max:a,omitTime:e,omitDate:i}){let r=m4(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 j4(u,a){return Ge({min:u,max:a,omitTime:!1,omitDate:!1})}function P4(u,a){return Ge({min:u,max:a,omitTime:!0,omitDate:!1})}function w4(u,a){return Ge({min:u,max:a,omitTime:!1,omitDate:!0}).slice(1)}function Ui(u,a,e,i,r=!1){if(i&&r)return y4(i);let o=Wi("string",u);return a&&o.length>a&&(o=o.substring(0,a)),o}function K4(){return"192.168.0.1"}function T4(){return"2001:0db8:85a3:0000:0000:8a2e:0370:7334"}function L4(){return"example.com"}function N4(){return"приклад.укр"}function R4(){return"http://example.com"}function H4(){return"../dictionary"}function G4(){return"http://example.com/{endpoint}"}function V4(){return"http://example.com/entity/1"}function _4(){return"/entity/1"}function J4(u,a,e){return F4(e||"id")}function $4(){return"/json/pointer"}function I4(){return"1/relative/json/pointer"}function O4(){return"/regex/"}const W4={email:z4,"idn-email":S4,password:M4,"date-time":j4,date:P4,time:w4,ipv4:K4,ipv6:T4,hostname:L4,"idn-hostname":N4,iri:V4,"iri-reference":_4,uri:R4,"uri-reference":H4,"uri-template":G4,uuid:J4,default:Ui,"json-pointer":$4,"relative-json-pointer":I4,regex:O4};function q4(u,a,e,i){let r=u.format||"default",o=W4[r]||Ui,n=i&&i.propertyName;return o(u.minLength||0,u.maxLength,n,u.pattern,a?.enablePatterns)}var Yi={};const Z4={skipReadOnly:!1,maxSampleDepth:15};function U4(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 w.Builder({ignoreAttributes:!1,format:!0,attributeNamePrefix:"$",textNodeName:"#text",cdataPropName:"#cdata"}).build(u)}function Y4(u,a,e){let i=Object.assign({},Z4,a);v4();let r=wu(u,i,e).value;return i?.format==="xml"?U4(r,u):r}function C0(u,a){Yi[u]=a}C0("array",b4);C0("boolean",B4);C0("integer",Zi);C0("number",Zi);C0("object",A4);C0("string",q4);function Qi(u,a){if(u)try{return Y4(u,{skipReadOnly:!0,skipNonRequired:!1,quiet:!0})}catch(e){a.error(q0(" Error while generating test data from JSON Schema ")+`
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./replay-index-DdH9X-06.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-o0B_MaDr.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-B2hxHO71.js";
2
- import { d as j, a as b, j as d } from "./replay-index-B2hxHO71.js";
1
+ import { e as h, s as x, r as i } from "./replay-index-CJcnXz6B.js";
2
+ import { d as j, a as b, j as d } from "./replay-index-CJcnXz6B.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-DdH9X-06.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.validateApiKey=e.validateApiKey;exports.OAuth2Error=t.OAuth2Error;exports.handleOAuth2Redirect=t.handleOAuth2Redirect;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./replay-index-o0B_MaDr.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.validateApiKey=e.validateApiKey;exports.OAuth2Error=t.OAuth2Error;exports.handleOAuth2Redirect=t.handleOAuth2Redirect;
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 p, S as y, T as m, z as n, C as d, D as T, F as h, G as i, H as u, I as A } from "./replay-index-B2hxHO71.js";
1
+ import { w as s, x as t, E as l, M as r, R as o, y as p, S as y, T as m, z as n, C as d, D as T, F as h, G as i, H as u, I as A } from "./replay-index-CJcnXz6B.js";
2
2
  import { O, h as R } 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.24.0-next.2",
3
+ "version": "0.24.0-next.3",
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.65.0-next.2"
23
+ "@redocly/theme": "0.65.0-next.3"
24
24
  },
25
25
  "dependencies": {
26
26
  "@ai-sdk/anthropic": "3.0.1",
@@ -113,10 +113,6 @@
113
113
  "build": "pnpm run clean && vite build && pnpm run copy-static",
114
114
  "copy-static": "cp src/oauth2-redirect-page/oauth2-redirect.html dist",
115
115
  "preview": "vite preview",
116
- "test": "jest",
117
- "test:update": "jest -u",
118
- "test:watch": "jest --watch",
119
- "test:coverage": "jest --coverage",
120
116
  "ts:check": "tsc --noEmit --skipLibCheck",
121
117
  "watch": "tsc --build --watch",
122
118
  "clean": "rm -rf dist"