@redocly/replay 0.29.0-next.9 → 0.29.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{replay-AiChatProvider-DAWT4hAb.js → replay-AiChatProvider-BRnZ3wFV.js} +2 -2
- package/dist/{replay-AiChatProvider-BDqzEpdu.js → replay-AiChatProvider-BZVskloQ.js} +8 -8
- package/dist/{replay-AiChatSqliteDBStorage-Dkz4d7Rx.js → replay-AiChatSqliteDBStorage-D-OSPwkJ.js} +1 -1
- package/dist/{replay-AiChatSqliteDBStorage-BJ0kltvn.js → replay-AiChatSqliteDBStorage-Ditvzorg.js} +1 -1
- package/dist/{replay-AiPanel-CkVIJhGF.js → replay-AiPanel-CoeevBXl.js} +2 -3
- package/dist/{replay-AiPanel-C5wMkLIc.js → replay-AiPanel-CxcQiAtp.js} +6 -7
- package/dist/{replay-FileWatcher-D3FVyQbX.js → replay-FileWatcher-BFxdt7pW.js} +2 -2
- package/dist/{replay-FileWatcher-DW7u83d1.js → replay-FileWatcher-CT1GjrWt.js} +1 -1
- package/dist/{replay-SemanticSearchService-DgroPziI.js → replay-SemanticSearchService-CAmU7U_y.js} +1 -1
- package/dist/{replay-SemanticSearchService-DAt35B37.js → replay-SemanticSearchService-DTzvCAEY.js} +1 -1
- package/dist/{replay-SqliteDBStorage-BG22uvLP.js → replay-SqliteDBStorage-B7cctBN4.js} +1 -1
- package/dist/{replay-SqliteDBStorage-CXZGasJG.js → replay-SqliteDBStorage-GDF8VnpW.js} +1 -1
- package/dist/{replay-TauriFileSystemAdapter-BY888O_1.js → replay-TauriFileSystemAdapter-Bedrv_1E.js} +1 -1
- package/dist/{replay-TauriFileSystemAdapter-CGGDSxKe.js → replay-TauriFileSystemAdapter-CQ68d1Rb.js} +1 -1
- package/dist/{replay-TauriRootStorage-CnLeXsev.js → replay-TauriRootStorage-BDHfRxBb.js} +1 -1
- package/dist/{replay-TauriRootStorage-DaKRlo3-.js → replay-TauriRootStorage-DWs71c6J.js} +2 -2
- package/dist/{replay-agent-loop-D1h5J-uE.js → replay-agent-loop-B9Ku1GMV.js} +1 -1
- package/dist/{replay-agent-loop-CzPV4LI2.js → replay-agent-loop-DZFx7mbI.js} +3 -4
- package/dist/{replay-ai-chat-mappers-BlVOCvVt.js → replay-ai-chat-mappers-DVWjxhhO.js} +1 -1
- package/dist/{replay-ai-chat-mappers-DsLIxLaN.js → replay-ai-chat-mappers-Dm3VfVbf.js} +1 -1
- package/dist/{replay-create-model-KIUQ2An5.js → replay-create-model-EqVbPv70.js} +3 -3
- package/dist/{replay-create-model-_BaJNmZq.js → replay-create-model-jiStWNur.js} +3 -3
- package/dist/{replay-db-DoLsw4tF.js → replay-db-Cfh97P75.js} +1 -1
- package/dist/{replay-db-CroFZCLK.js → replay-db-G0nB5gsK.js} +1 -1
- package/dist/{replay-external-resolver-DUzbkx07.js → replay-external-resolver-C4lPwG0y.js} +2 -2
- package/dist/{replay-external-resolver-BwZvmuC9.js → replay-external-resolver-CZt2-zxn.js} +1 -1
- package/dist/{replay-index-zmQXrIpO.js → replay-index-0tBOBdqi.js} +1 -1
- package/dist/replay-index-B-s3dkqs.js +4 -0
- package/dist/{replay-index-VCzOY16S.js → replay-index-B0ZnzCe0.js} +22385 -21825
- package/dist/{replay-index-AuXMzqmR.js → replay-index-B8FrKhrK.js} +1 -1
- package/dist/{replay-index-DjHbio61.js → replay-index-BsW8ar_B.js} +1 -1
- package/dist/{replay-index-BBDKuDcc.js → replay-index-C63_26_M.js} +1 -1
- package/dist/{replay-index-B8puA2u2.js → replay-index-CZdITmUC.js} +1 -1
- package/dist/{replay-index-zSldZ9CB.js → replay-index-CoTPFQOh.js} +1 -1
- package/dist/{replay-index-B1cRNYAB.js → replay-index-CydD_1AG.js} +1 -1
- package/dist/{replay-index-54ROnLOe.js → replay-index-DHpZ_Le1.js} +1249 -1194
- package/dist/{replay-index-SX6LT-jT.js → replay-index-NXYTGvpg.js} +5 -5
- package/dist/{replay-index-BI0q2SFK.js → replay-index-RAwADWgR.js} +1 -1
- package/dist/{replay-lint-C8g-xqrP.js → replay-lint-4jQiEXbI.js} +55 -55
- package/dist/{replay-lint-graphql-CZBwQl0k.js → replay-lint-graphql-AKeELyXP.js} +1 -1
- package/dist/{replay-lint-graphql-Bpd88C9w.js → replay-lint-graphql-D2aLmlID.js} +2 -2
- package/dist/{replay-lint-YAy8-Dtq.js → replay-lint-r3bg254e.js} +3635 -3635
- package/dist/{replay-periodic-revalidation-BzoE_vj1.js → replay-periodic-revalidation-BRgz4X4a.js} +1 -1
- package/dist/{replay-periodic-revalidation-CNYI9Ked.js → replay-periodic-revalidation-BgBN4Mbs.js} +1 -1
- package/dist/replay-resolve-DAJqvo5v.js +47 -0
- package/dist/{replay-resolve-DrE6Bsmy.js → replay-resolve-VJqotAvd.js} +1008 -1000
- package/dist/{replay-respect-run-tWrs79VV.js → replay-respect-run-DH5fR2k2.js} +1 -1
- package/dist/{replay-respect-run-DIYJQvbB.js → replay-respect-run-DSgF-V0V.js} +3 -3
- package/dist/{replay-tauri-path-Duj7dsaA.js → replay-tauri-path-BIdG-8R5.js} +1 -1
- package/dist/{replay-tauri-path-6SQ7odaf.js → replay-tauri-path-BuBah8TT.js} +2 -2
- package/dist/{replay-useAiChatQueries-__VXRF5i.js → replay-useAiChatQueries-BB_Ztjxo.js} +3 -3
- package/dist/{replay-useAiChatQueries-B1XeG3iY.js → replay-useAiChatQueries-D1isJXlL.js} +8 -9
- package/dist/{replay-validate-key-BGMRyGdn.js → replay-validate-key-BeE2055s.js} +1 -1
- package/dist/{replay-validate-key-Dl8sa_9N.js → replay-validate-key-BksJSjZL.js} +2 -2
- package/dist/replay.cjs +1 -1
- package/dist/replay.d.ts +6 -1
- package/dist/replay.js +1 -1
- package/package.json +4 -4
- package/dist/replay-index-Cj1-cwJH.js +0 -4
- package/dist/replay-resolve-jATjJR5l.js +0 -47
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("./replay-index-54ROnLOe.js"),$e=require("./replay-resolve-jATjJR5l.js"),de=require("./replay-lint-C8g-xqrP.js");function Rn(e){return f.isPlainObject(e)&&"name"in e&&"value"in e&&!("in"in e)}function xa(e){return f.isPlainObject(e)&&"in"in e&&typeof e.in=="string"&&["header","query","path","cookie"].includes(e.in)}const Pn=/^image\/(png|jpeg|gif|bmp|webp|svg\+xml)|application\/pdf$/;function Hr(e){return e.startsWith("$file(")&&e.endsWith(")")?e.substring(7,e.length-2):e}const Fa=async(e,a,r,t,n)=>{const i=f.pathBrowserifyExports.dirname(t),o=f.pathBrowserifyExports.resolve(i,Hr(r));e.append(a,await n.options.requestFileLoader.getFileBody(o))},xr=(e,a,r,t,n,i)=>{Object.entries(r).forEach(([o,s])=>{const l=i?`${i}[${o}]`:o;typeof s=="string"&&s.startsWith("$file(")&&s.endsWith(")")?e.push(Fa(a,l,s,t,n)):Array.isArray(s)?s.forEach(u=>{typeof u=="string"&&u.startsWith("$file(")&&u.endsWith(")")?e.push(Fa(a,l,u,t,n)):a.append(l,u.toString())}):f.isPlainObject(s)?xr(e,a,s,t,n,l):(typeof s=="string"||typeof s=="number"||typeof s=="boolean")&&a.append(l,s.toString())})},Ln=async(e,a,r,t)=>{if(f.isPlainObject(e)){const n=[];xr(n,a,e,r,t),await Promise.all(n)}},En=async(e,a)=>{if(typeof e=="string"&&e.startsWith("$file(")&&e.endsWith(")")){const r=f.pathBrowserifyExports.resolve(f.pathBrowserifyExports.dirname(a.options.filePath),Hr(e));return a.options.requestFileLoader.getFileBody(r)}else return e};async function Dn(e,a){if(!e)return{payload:void 0,contentType:void 0,encoding:void 0,replacements:void 0};const{payload:r,contentType:t}=e;if(t==="multipart/form-data"){const n=new FormData,i=f.pathBrowserifyExports.resolve(a.options.filePath);return await Ln(r,n,i,a),{...e,payload:n}}else{if(t==="application/octet-stream"||typeof t=="string"&&Pn.test(t))return{...e,payload:await En(r,a),contentType:"application/octet-stream"};if(t==="application/x-www-form-urlencoded"&&typeof r=="string")return{...e,payload:Object.fromEntries(new URLSearchParams(r).entries()),contentType:"application/x-www-form-urlencoded"}}return e}function Nn({payload:e,replacements:a,expressionContext:r,logger:t}){for(const n of a){const{target:i,value:o}=n;if(typeof i!="string")throw new Error(`Invalid JSON Pointer: ${i}`);try{const s=f.JsonPointerLib.get(e,i),l=f.evaluateRuntimeExpressionPayload({payload:o,context:r,logger:t});s!==void 0&&f.JsonPointerLib.set(e,i,l)}catch{throw new Error(`Invalid JSON Pointer: ${i}`)}}}const Hn=["parameters","failureActions","successActions"];function xn(e,a){const{reference:r,value:t}=e;if(!Hn.some(i=>r.includes(`$components.${i}`)))throw new Error("Invalid reference: available components are $components.parameters, $components.failureActions, or $components.successActions");const n=f.getValueFromContext({value:r,ctx:a,logger:a.options.logger});return f.isPlainObject(n)&&"value"in n&&t?{...n,value:t}:n}function Ke(e,a){return"reference"in e?xn(e,a):e}const V={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 Wr extends Error{}class Gr extends Wr{}class Ir extends Wr{}async function Wn(e){const{descriptionPath:a,externalRefResolver:r,base:t}=e,n=await de.bundle({base:t,ref:a,config:e.config,dereference:!0,externalRefResolver:r});if(!n)throw new Error(`Could not find source description file '${a}'.`);return n.bundle.parsed}const Gn={title:"[REPLACE WITH API title]",version:"[REPLACE WITH API version]"},Ma=Symbol("skip");function We(e){return e<10?"0"+e:e}function In(e,a,r,t){var n=r?"":e.getUTCFullYear()+"-"+We(e.getUTCMonth()+1)+"-"+We(e.getUTCDate());return a||(n+="T"+We(e.getUTCHours())+":"+We(e.getUTCMinutes())+":"+We(e.getUTCSeconds())+"Z"),n}function Fr(e,a){return a>e.length?e.repeat(Math.trunc(a/e.length)+1).substring(0,a):e}function na(...e){const a=r=>r&&typeof r=="object";return e.reduce((r,t)=>(Object.keys(t||{}).forEach(n=>{const i=r[n],o=t[n];a(i)&&a(o)?r[n]=na(i,o):r[n]=o}),r),Array.isArray(e[e.length-1])?[]:{})}function Fn(e){var a=Jn(e),r=$n(a,a,a,a),t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,n=>{var i=r()*16%16|0;return(n=="x"?i:i&3|8).toString(16)});return t}function ca(e){return{value:e==="object"?{}:e==="array"?[]:void 0}}function ke(e,a){a&&e.pop()}function On(e){return{name:e?.xml?.name||"",prefix:e?.xml?.prefix||"",namespace:e?.xml?.namespace||null,attribute:e?.xml?.attribute??!1,wrapped:e?.xml?.wrapped??!1}}function Kn(e){const a=e?.xml;return a?.nodeType?a.nodeType:a?.attribute===!0?"attribute":a?.wrapped===!0&&e?.type==="array"?"element":e?.$ref||e?.$dynamicRef||e?.type==="array"||e?.oneOf||e?.anyOf||e?.allOf?"none":"element"}function ta(e,a={},r={}){const{value:t}=e,{propertyName:n}=r,{name:i,prefix:o,namespace:s}=On(a),l=Kn(a);let u=i||n?`${o?o+":":""}${i||n}`:null,c=typeof t=="object"?Array.isArray(t)?[...t]:{...t}:t;switch(l){case"attribute":u&&(u=`$${u}`);break;case"text":u="#text";break;case"cdata":u="#cdata";break;case"none":a.type==="array"?(u=null,a.example!==void 0&&(u=a.items?.xml?.name||u)):u=null;break;default:a.type==="array"&&Array.isArray(c)&&(c={[u]:[...c]});break}return s&&l!=="text"&&l!=="cdata"&&l!=="none"&&(typeof c=="object"?c[`$xmlns${o?":"+o:""}`]=s:c={[`$xmlns${o?":"+o:""}`]:s,"#text":c}),{propertyName:u,value:c}}function Jn(e){var a=0;if(e.length==0)return a;for(var r=0;r<e.length;r++){var t=e.charCodeAt(r);a=(a<<5)-a+t,a=a&a}return a}function $n(e,a,r,t){return function(){e|=0,a|=0,r|=0,t|=0;var n=e-(a<<27|a>>>5)|0;return e=a^(r<<17|r>>>15),a=r+t|0,r=t+n|0,t=e+n|0,(t>>>0)/4294967296}}function zn(e,a,r,t,n){let i=he(e,r,t);const o=[];for(let s of a){const{type:l,readOnly:u,writeOnly:c,value:d}=he({type:i.type,...s},r,t,{...n,isAllOfChild:!0});i.type&&l&&l!==i.type&&(console.warn("allOf: schemas with different types can't be merged"),i.type=l),i.type=i.type||l,i.readOnly=i.readOnly||u,i.writeOnly=i.writeOnly||c,d!=null&&o.push(d)}if(i.type==="object"){i.value=na(i.value||{},...o.filter(s=>typeof s=="object"));for(const s in i.value)i.value[s]===Ma&&delete i.value[s];return i}else{i.type==="array"&&(r.quiet||console.warn('OpenAPI Sampler: found allOf with "array" type. Result may be incorrect'));const s=o[o.length-1];return i.value=s??i.value,i}}const Oa={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 Ue(e){if(e.type!==void 0)return Array.isArray(e.type)?e.type.length===0?null:e.type[0]:e.type;const a=Object.keys(Oa);for(var r=0;r<a.length;r++){let t=a[r],n=Oa[t];if(e[t]!==void 0)return n}return null}let aa={},ce=[];function jn(){aa={},ce=[]}function Or(e){let a;return e.const!==void 0?a=e.const:e.examples!==void 0&&e.examples.length?a=e.examples[0]:e.enum!==void 0&&e.enum.length?a=e.enum[0]:e.default!==void 0&&(a=e.default),a}function Ka(e){const a=Or(e);if(a!==void 0)return{value:a,readOnly:e.readOnly,writeOnly:e.writeOnly,type:null}}function he(e,a,r,t){if(t){if(ce.includes(e))return ca(Ue(e));ce.push(e)}if(t&&t.depth>a.maxSampleDepth)return ke(ce,t),ca(Ue(e));if(e.$ref){if(!r)throw new Error("Your schema contains $ref. You must provide full specification in the third parameter.");let s=decodeURIComponent(e.$ref);s.startsWith("#")&&(s=s.substring(1));const l=f.JsonPointerLib.get(r,s);let u;if(aa[s]!==!0){aa[s]=!0;const c=he(l,a,r,t);if(a.format==="xml"){const d=s.split("/").pop(),h={...t,propertyName:t?.propertyName||d},{propertyName:p,value:b}=ta(c,l,h);u={...c,value:{[p||"root"]:b}}}else u=c;aa[s]=!1}else{const c=Ue(l);u=ca(c)}return ke(ce,t),u}if(e.example!==void 0)return ke(ce,t),{value:e.example,readOnly:e.readOnly,writeOnly:e.writeOnly,type:e.type};if(e.allOf!==void 0)return ke(ce,t),Ka(e)||zn({...e,allOf:void 0},e.allOf,a,r,t);if(e.oneOf&&e.oneOf.length){e.anyOf&&(a.quiet||console.warn("oneOf and anyOf are not supported on the same level. Skipping anyOf")),ke(ce,t);const s=Object.assign({readOnly:e.readOnly,writeOnly:e.writeOnly},e.oneOf[0]);return o(e,s)}if(e.anyOf&&e.anyOf.length){ke(ce,t);const s=Object.assign({readOnly:e.readOnly,writeOnly:e.writeOnly},e.anyOf[0]);return o(e,s)}if(e.if&&e.then){ke(ce,t);const{if:s,then:l,...u}=e;return he(na(u,s,l),a,r,t)}let n=Or(e),i=null;if(n===void 0){n=null,i=e.type,Array.isArray(i)&&e.type.length>0&&(i=e.type[0]),i||(i=Ue(e));let s=$r[i];s&&(n=s(e,a,r,t))}return ke(ce,t),{value:n,readOnly:e.readOnly,writeOnly:e.writeOnly,type:i};function o(s,l){const u=Ka(s);if(u!==void 0)return u;const c=he({...s,oneOf:void 0,anyOf:void 0},a,r,t),d=he(l,a,r,t);if(typeof c.value=="object"&&typeof d.value=="object"){const h=na(c.value,d.value);return{...d,value:h}}return d}}function Vn(e,a={},r,t){const n=t&&t.depth||1;let i=Math.min(e.maxItems!=null?e.maxItems:1/0,e.minItems||1);const o=e.prefixItems||e.items||e.contains;Array.isArray(o)&&(i=Math.max(i,o.length));let s=u=>Array.isArray(o)?o[u]||{}:o||{},l=[];if(!o)return l;for(let u=0;u<i;u++){let c=s(u),{value:d}=he(c,a,r,{depth:n+1});if(a?.format==="xml"){const{value:h,propertyName:p}=ta({value:d},c,t);p?(l?.[p]||(l={...l,[p]:[]}),l[p].push(h)):l={...l,...h}}else l.push(d)}if(a?.format==="xml"&&n===1){const{value:u,propertyName:c}=ta({value:null},e,t);c&&(u?l=Array.isArray(l)?{[c]:{...u,...l.map(d=>({"#text":{...d}}))}}:{[c]:{...l,...u}}:l={[c]:l})}return l}function Un(e){return!0}function Kr(e){let a=0;if(e.type==="number"&&(e.format==="float"||e.format==="double")&&(a=.1),typeof e.exclusiveMinimum=="boolean"||typeof e.exclusiveMaximum=="boolean"){if(Number.isFinite(e.maximum)&&Number.isFinite(e.minimum))return a=e.exclusiveMinimum?Math.floor(e.minimum)+1:e.minimum,(e.exclusiveMaximum&&a>=e.maximum||!e.exclusiveMaximum&&a>e.maximum)&&(a=(e.maximum+e.minimum)/2),a;if(Number.isFinite(e.minimum))return e.exclusiveMinimum?Math.floor(e.minimum)+1:e.minimum;if(Number.isFinite(e.maximum))return e.exclusiveMaximum?e.maximum>0?0:Math.floor(e.maximum)-1:e.maximum>0?0:e.maximum}else{if(Number.isFinite(e.minimum))return e.minimum;Number.isFinite(e.exclusiveMinimum)?(a=Math.floor(e.exclusiveMinimum)+1,a===e.exclusiveMaximum&&(a=(a+Math.floor(e.exclusiveMaximum)-1)/2)):Number.isFinite(e.exclusiveMaximum)?a=Math.floor(e.exclusiveMaximum)-1:Number.isFinite(e.maximum)&&(a=e.maximum)}return a}function Yn(e,a={},r,t){let n={};const i=t&&t.depth||1;if(e&&typeof e.properties=="object"){const o=Array.isArray(e.required)?e.required:[],s={};for(const l of o)s[l]=!0;Object.keys(e.properties).forEach(l=>{if(a.skipNonRequired&&!s.hasOwnProperty(l))return;const u=he(e.properties[l],a,r,{propertyName:l,depth:i+1});if(a.skipReadOnly&&u.readOnly){t?.isAllOfChild&&(n[l]=Ma);return}if(a.skipWriteOnly&&u.writeOnly){t?.isAllOfChild&&(n[l]=Ma);return}if(a?.format==="xml"){const{propertyName:c,value:d}=ta(u,e.properties[l],{propertyName:l});c?n[c]=d:d!==null&&typeof d=="object"&&(n={...n,...d})}else n[l]=u.value})}if(e&&typeof e.additionalProperties=="object"){const o=e.additionalProperties["x-additionalPropertiesName"]||"property";n[`${String(o)}1`]=he(e.additionalProperties,a,r,{depth:i+1}).value,n[`${String(o)}2`]=he(e.additionalProperties,a,r,{depth:i+1}).value}if(e&&typeof e.properties=="object"&&e.maxProperties!==void 0&&Object.keys(n).length>e.maxProperties){const o={};let s=0;(Array.isArray(e.required)?e.required:[]).forEach(u=>{n[u]!==void 0&&(o[u]=n[u],s++)}),Object.keys(n).forEach(u=>{s<e.maxProperties&&!o.hasOwnProperty(u)&&(o[u]=n[u],s++)}),n=o}return n}function ze(e,a){return e}function Ja(e,a,r){let t=1;if(e)switch(e){case"?":{t=0;break}case"*":{t=ze(0);break}case"+":{t=ze(1);break}default:throw new Error("Unknown quantifier symbol provided.")}else a!=null&&r!=null?t=ze(parseInt(a)):a!=null&&r==null&&(t=parseInt(a));return t}function _n(e){let a=!1;e instanceof RegExp&&(a=e.flags.includes("i"),e=e.toString(),e=e.match(/\/(.+?)\//)?.[1]??""),e=e.replace(/^(\^)?(.*?)(\$)?$/,"$2");let r,t,n;const i=/([.A-Za-z0-9])(?:\{(\d+)(?:\,(\d+)|)\}|(\?|\*|\+))(?![^[]*]|[^{]*})/;let o=e.match(i);for(;o!=null;){const d=o[2],h=o[3],p=o[4];n=Ja(p,d,h),e=e.slice(0,o.index)+o[1].repeat(n)+e.slice(o.index+o[0].length),o=e.match(i)}const s=/(\d-\d|\w-\w|\d|\w|[-!@#$&()`.+,/"])/,l=/\[(\^|)(-|)(.+?)\](?:\{(\d+)(?:\,(\d+)|)\}|(\?|\*|\+)|)/;for(o=e.match(l);o!=null;){const d=o[1]==="^",h=o[2]==="-",p=o[4],b=o[5],w=o[6],A=[];let P=o[3],S=P.match(s);for(h&&A.push(45);S!=null;){if(S[0].indexOf("-")===-1)a&&isNaN(Number(S[0]))?(A.push(S[0].toUpperCase().charCodeAt(0)),A.push(S[0].toLowerCase().charCodeAt(0))):A.push(S[0].charCodeAt(0));else{const y=S[0].split("-").map(m=>m.charCodeAt(0));if(r=y[0],t=y[1],r>t)throw new Error("Character range provided is out of order.");for(let m=r;m<=t;m++)if(a&&isNaN(Number(String.fromCharCode(m)))){const k=String.fromCharCode(m);A.push(k.toUpperCase().charCodeAt(0)),A.push(k.toLowerCase().charCodeAt(0))}else A.push(m)}P=P.substring(S[0].length),S=P.match(s)}if(n=Ja(w,p,b),d){let y=-1;for(let m=48;m<=57;m++){if(y=A.indexOf(m),y>-1){A.splice(y,1);continue}A.push(m)}for(let m=65;m<=90;m++){if(y=A.indexOf(m),y>-1){A.splice(y,1);continue}A.push(m)}for(let m=97;m<=122;m++){if(y=A.indexOf(m),y>-1){A.splice(y,1);continue}A.push(m)}}const E=Array.from({length:n},()=>String.fromCharCode(A[ze(0)])).join("");e=e.slice(0,o.index)+E+e.slice(o.index+o[0].length),o=e.match(l)}const u=/(.)\{(\d+)\,(\d+)\}/;for(o=e.match(u);o!=null;){if(r=parseInt(o[2]),t=parseInt(o[3]),r>t)throw new Error("Numbers out of order in {} quantifier.");n=ze(r),e=e.slice(0,o.index)+o[1].repeat(n)+e.slice(o.index+o[0].length),o=e.match(u)}const c=/(.)\{(\d+)\}/;for(o=e.match(c);o!=null;)n=parseInt(o[2]),e=e.slice(0,o.index)+o[1].repeat(n)+e.slice(o.index+o[0].length),o=e.match(c);return e}const qn="qwerty!@#$%^123456";function Zn(){return"user@example.com"}function Xn(){return"пошта@укр.нет"}function Qn(e,a){let r="pa$$word";return e>r.length&&(r+="_",r+=Fr(qn,e-r.length).substring(0,e-r.length)),r}function Wa({min:e,max:a,omitTime:r,omitDate:t}){let n=In(new Date("2019-08-24T14:15:22.123Z"),r,t);return n.length<e&&console.warn(`Using minLength = ${e} is incorrect with format "date-time"`),a&&n.length>a&&console.warn(`Using maxLength = ${a} is incorrect with format "date-time"`),n}function et(e,a){return Wa({min:e,max:a,omitTime:!1,omitDate:!1})}function at(e,a){return Wa({min:e,max:a,omitTime:!0,omitDate:!1})}function rt(e,a){return Wa({min:e,max:a,omitTime:!1,omitDate:!0}).slice(1)}function Jr(e,a,r,t,n=!1){if(t&&n)return _n(t);let i=Fr("string",e);return a&&i.length>a&&(i=i.substring(0,a)),i}function nt(){return"192.168.0.1"}function tt(){return"2001:0db8:85a3:0000:0000:8a2e:0370:7334"}function it(){return"example.com"}function ot(){return"приклад.укр"}function st(){return"http://example.com"}function lt(){return"../dictionary"}function ut(){return"http://example.com/{endpoint}"}function ct(){return"http://example.com/entity/1"}function dt(){return"/entity/1"}function ht(e,a,r){return Fn(r||"id")}function mt(){return"/json/pointer"}function pt(){return"1/relative/json/pointer"}function ft(){return"/regex/"}const yt={email:Zn,"idn-email":Xn,password:Qn,"date-time":et,date:at,time:rt,ipv4:nt,ipv6:tt,hostname:it,"idn-hostname":ot,iri:ct,"iri-reference":dt,uri:st,"uri-reference":lt,"uri-template":ut,uuid:ht,default:Jr,"json-pointer":mt,"relative-json-pointer":pt,regex:ft};function gt(e,a,r,t){let n=e.format||"default",i=yt[n]||Jr,o=t&&t.propertyName;return i(e.minLength||0,e.maxLength,o,e.pattern,a?.enablePatterns)}var $r={};const bt={skipReadOnly:!1,maxSampleDepth:15};function kt(e,a){if(!e)throw new Error("Unknown format output for building XML.");return(Array.isArray(e)||Object.keys(e).length>1)&&(e={[a?.xml?.name||"root"]:e}),new f.Builder({ignoreAttributes:!1,format:!0,attributeNamePrefix:"$",textNodeName:"#text",cdataPropName:"#cdata"}).build(e)}function Ct(e,a,r){let t=Object.assign({},bt,a);jn();let n=he(e,t,r).value;return t?.format==="xml"?kt(n,e):n}function De(e,a){$r[e]=a}De("array",Vn);De("boolean",Un);De("integer",Kr);De("number",Kr);De("object",Yn);De("string",gt);function zr(e,a){if(e)try{return Ct(e,{skipReadOnly:!0,skipNonRequired:!1,quiet:!0})}catch(r){a.error(f.bgRed(" Error while generating test data from JSON Schema ")+`
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("./replay-index-DHpZ_Le1.js"),$e=require("./replay-resolve-DAJqvo5v.js"),de=require("./replay-lint-4jQiEXbI.js");function Rn(e){return f.isPlainObject(e)&&"name"in e&&"value"in e&&!("in"in e)}function xa(e){return f.isPlainObject(e)&&"in"in e&&typeof e.in=="string"&&["header","query","path","cookie"].includes(e.in)}const Pn=/^image\/(png|jpeg|gif|bmp|webp|svg\+xml)|application\/pdf$/;function Hr(e){return e.startsWith("$file(")&&e.endsWith(")")?e.substring(7,e.length-2):e}const Fa=async(e,a,r,t,n)=>{const i=f.pathBrowserifyExports.dirname(t),o=f.pathBrowserifyExports.resolve(i,Hr(r));e.append(a,await n.options.requestFileLoader.getFileBody(o))},xr=(e,a,r,t,n,i)=>{Object.entries(r).forEach(([o,s])=>{const l=i?`${i}[${o}]`:o;typeof s=="string"&&s.startsWith("$file(")&&s.endsWith(")")?e.push(Fa(a,l,s,t,n)):Array.isArray(s)?s.forEach(u=>{typeof u=="string"&&u.startsWith("$file(")&&u.endsWith(")")?e.push(Fa(a,l,u,t,n)):a.append(l,u.toString())}):f.isPlainObject(s)?xr(e,a,s,t,n,l):(typeof s=="string"||typeof s=="number"||typeof s=="boolean")&&a.append(l,s.toString())})},Ln=async(e,a,r,t)=>{if(f.isPlainObject(e)){const n=[];xr(n,a,e,r,t),await Promise.all(n)}},En=async(e,a)=>{if(typeof e=="string"&&e.startsWith("$file(")&&e.endsWith(")")){const r=f.pathBrowserifyExports.resolve(f.pathBrowserifyExports.dirname(a.options.filePath),Hr(e));return a.options.requestFileLoader.getFileBody(r)}else return e};async function Dn(e,a){if(!e)return{payload:void 0,contentType:void 0,encoding:void 0,replacements:void 0};const{payload:r,contentType:t}=e;if(t==="multipart/form-data"){const n=new FormData,i=f.pathBrowserifyExports.resolve(a.options.filePath);return await Ln(r,n,i,a),{...e,payload:n}}else{if(t==="application/octet-stream"||typeof t=="string"&&Pn.test(t))return{...e,payload:await En(r,a),contentType:"application/octet-stream"};if(t==="application/x-www-form-urlencoded"&&typeof r=="string")return{...e,payload:Object.fromEntries(new URLSearchParams(r).entries()),contentType:"application/x-www-form-urlencoded"}}return e}function Nn({payload:e,replacements:a,expressionContext:r,logger:t}){for(const n of a){const{target:i,value:o}=n;if(typeof i!="string")throw new Error(`Invalid JSON Pointer: ${i}`);try{const s=f.JsonPointerLib.get(e,i),l=f.evaluateRuntimeExpressionPayload({payload:o,context:r,logger:t});s!==void 0&&f.JsonPointerLib.set(e,i,l)}catch{throw new Error(`Invalid JSON Pointer: ${i}`)}}}const Hn=["parameters","failureActions","successActions"];function xn(e,a){const{reference:r,value:t}=e;if(!Hn.some(i=>r.includes(`$components.${i}`)))throw new Error("Invalid reference: available components are $components.parameters, $components.failureActions, or $components.successActions");const n=f.getValueFromContext({value:r,ctx:a,logger:a.options.logger});return f.isPlainObject(n)&&"value"in n&&t?{...n,value:t}:n}function Ke(e,a){return"reference"in e?xn(e,a):e}const V={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 Wr extends Error{}class Gr extends Wr{}class Ir extends Wr{}async function Wn(e){const{descriptionPath:a,externalRefResolver:r,base:t}=e,n=await de.bundle({base:t,ref:a,config:e.config,dereference:!0,externalRefResolver:r});if(!n)throw new Error(`Could not find source description file '${a}'.`);return n.bundle.parsed}const Gn={title:"[REPLACE WITH API title]",version:"[REPLACE WITH API version]"},Ma=Symbol("skip");function We(e){return e<10?"0"+e:e}function In(e,a,r,t){var n=r?"":e.getUTCFullYear()+"-"+We(e.getUTCMonth()+1)+"-"+We(e.getUTCDate());return a||(n+="T"+We(e.getUTCHours())+":"+We(e.getUTCMinutes())+":"+We(e.getUTCSeconds())+"Z"),n}function Fr(e,a){return a>e.length?e.repeat(Math.trunc(a/e.length)+1).substring(0,a):e}function na(...e){const a=r=>r&&typeof r=="object";return e.reduce((r,t)=>(Object.keys(t||{}).forEach(n=>{const i=r[n],o=t[n];a(i)&&a(o)?r[n]=na(i,o):r[n]=o}),r),Array.isArray(e[e.length-1])?[]:{})}function Fn(e){var a=Jn(e),r=$n(a,a,a,a),t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,n=>{var i=r()*16%16|0;return(n=="x"?i:i&3|8).toString(16)});return t}function ca(e){return{value:e==="object"?{}:e==="array"?[]:void 0}}function ke(e,a){a&&e.pop()}function On(e){return{name:e?.xml?.name||"",prefix:e?.xml?.prefix||"",namespace:e?.xml?.namespace||null,attribute:e?.xml?.attribute??!1,wrapped:e?.xml?.wrapped??!1}}function Kn(e){const a=e?.xml;return a?.nodeType?a.nodeType:a?.attribute===!0?"attribute":a?.wrapped===!0&&e?.type==="array"?"element":e?.$ref||e?.$dynamicRef||e?.type==="array"||e?.oneOf||e?.anyOf||e?.allOf?"none":"element"}function ta(e,a={},r={}){const{value:t}=e,{propertyName:n}=r,{name:i,prefix:o,namespace:s}=On(a),l=Kn(a);let u=i||n?`${o?o+":":""}${i||n}`:null,c=typeof t=="object"?Array.isArray(t)?[...t]:{...t}:t;switch(l){case"attribute":u&&(u=`$${u}`);break;case"text":u="#text";break;case"cdata":u="#cdata";break;case"none":a.type==="array"?(u=null,a.example!==void 0&&(u=a.items?.xml?.name||u)):u=null;break;default:a.type==="array"&&Array.isArray(c)&&(c={[u]:[...c]});break}return s&&l!=="text"&&l!=="cdata"&&l!=="none"&&(typeof c=="object"?c[`$xmlns${o?":"+o:""}`]=s:c={[`$xmlns${o?":"+o:""}`]:s,"#text":c}),{propertyName:u,value:c}}function Jn(e){var a=0;if(e.length==0)return a;for(var r=0;r<e.length;r++){var t=e.charCodeAt(r);a=(a<<5)-a+t,a=a&a}return a}function $n(e,a,r,t){return function(){e|=0,a|=0,r|=0,t|=0;var n=e-(a<<27|a>>>5)|0;return e=a^(r<<17|r>>>15),a=r+t|0,r=t+n|0,t=e+n|0,(t>>>0)/4294967296}}function zn(e,a,r,t,n){let i=he(e,r,t);const o=[];for(let s of a){const{type:l,readOnly:u,writeOnly:c,value:d}=he({type:i.type,...s},r,t,{...n,isAllOfChild:!0});i.type&&l&&l!==i.type&&(console.warn("allOf: schemas with different types can't be merged"),i.type=l),i.type=i.type||l,i.readOnly=i.readOnly||u,i.writeOnly=i.writeOnly||c,d!=null&&o.push(d)}if(i.type==="object"){i.value=na(i.value||{},...o.filter(s=>typeof s=="object"));for(const s in i.value)i.value[s]===Ma&&delete i.value[s];return i}else{i.type==="array"&&(r.quiet||console.warn('OpenAPI Sampler: found allOf with "array" type. Result may be incorrect'));const s=o[o.length-1];return i.value=s??i.value,i}}const Oa={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 Ue(e){if(e.type!==void 0)return Array.isArray(e.type)?e.type.length===0?null:e.type[0]:e.type;const a=Object.keys(Oa);for(var r=0;r<a.length;r++){let t=a[r],n=Oa[t];if(e[t]!==void 0)return n}return null}let aa={},ce=[];function jn(){aa={},ce=[]}function Or(e){let a;return e.const!==void 0?a=e.const:e.examples!==void 0&&e.examples.length?a=e.examples[0]:e.enum!==void 0&&e.enum.length?a=e.enum[0]:e.default!==void 0&&(a=e.default),a}function Ka(e){const a=Or(e);if(a!==void 0)return{value:a,readOnly:e.readOnly,writeOnly:e.writeOnly,type:null}}function he(e,a,r,t){if(t){if(ce.includes(e))return ca(Ue(e));ce.push(e)}if(t&&t.depth>a.maxSampleDepth)return ke(ce,t),ca(Ue(e));if(e.$ref){if(!r)throw new Error("Your schema contains $ref. You must provide full specification in the third parameter.");let s=decodeURIComponent(e.$ref);s.startsWith("#")&&(s=s.substring(1));const l=f.JsonPointerLib.get(r,s);let u;if(aa[s]!==!0){aa[s]=!0;const c=he(l,a,r,t);if(a.format==="xml"){const d=s.split("/").pop(),h={...t,propertyName:t?.propertyName||d},{propertyName:p,value:b}=ta(c,l,h);u={...c,value:{[p||"root"]:b}}}else u=c;aa[s]=!1}else{const c=Ue(l);u=ca(c)}return ke(ce,t),u}if(e.example!==void 0)return ke(ce,t),{value:e.example,readOnly:e.readOnly,writeOnly:e.writeOnly,type:e.type};if(e.allOf!==void 0)return ke(ce,t),Ka(e)||zn({...e,allOf:void 0},e.allOf,a,r,t);if(e.oneOf&&e.oneOf.length){e.anyOf&&(a.quiet||console.warn("oneOf and anyOf are not supported on the same level. Skipping anyOf")),ke(ce,t);const s=Object.assign({readOnly:e.readOnly,writeOnly:e.writeOnly},e.oneOf[0]);return o(e,s)}if(e.anyOf&&e.anyOf.length){ke(ce,t);const s=Object.assign({readOnly:e.readOnly,writeOnly:e.writeOnly},e.anyOf[0]);return o(e,s)}if(e.if&&e.then){ke(ce,t);const{if:s,then:l,...u}=e;return he(na(u,s,l),a,r,t)}let n=Or(e),i=null;if(n===void 0){n=null,i=e.type,Array.isArray(i)&&e.type.length>0&&(i=e.type[0]),i||(i=Ue(e));let s=$r[i];s&&(n=s(e,a,r,t))}return ke(ce,t),{value:n,readOnly:e.readOnly,writeOnly:e.writeOnly,type:i};function o(s,l){const u=Ka(s);if(u!==void 0)return u;const c=he({...s,oneOf:void 0,anyOf:void 0},a,r,t),d=he(l,a,r,t);if(typeof c.value=="object"&&typeof d.value=="object"){const h=na(c.value,d.value);return{...d,value:h}}return d}}function Vn(e,a={},r,t){const n=t&&t.depth||1;let i=Math.min(e.maxItems!=null?e.maxItems:1/0,e.minItems||1);const o=e.prefixItems||e.items||e.contains;Array.isArray(o)&&(i=Math.max(i,o.length));let s=u=>Array.isArray(o)?o[u]||{}:o||{},l=[];if(!o)return l;for(let u=0;u<i;u++){let c=s(u),{value:d}=he(c,a,r,{depth:n+1});if(a?.format==="xml"){const{value:h,propertyName:p}=ta({value:d},c,t);p?(l?.[p]||(l={...l,[p]:[]}),l[p].push(h)):l={...l,...h}}else l.push(d)}if(a?.format==="xml"&&n===1){const{value:u,propertyName:c}=ta({value:null},e,t);c&&(u?l=Array.isArray(l)?{[c]:{...u,...l.map(d=>({"#text":{...d}}))}}:{[c]:{...l,...u}}:l={[c]:l})}return l}function Un(e){return!0}function Kr(e){let a=0;if(e.type==="number"&&(e.format==="float"||e.format==="double")&&(a=.1),typeof e.exclusiveMinimum=="boolean"||typeof e.exclusiveMaximum=="boolean"){if(Number.isFinite(e.maximum)&&Number.isFinite(e.minimum))return a=e.exclusiveMinimum?Math.floor(e.minimum)+1:e.minimum,(e.exclusiveMaximum&&a>=e.maximum||!e.exclusiveMaximum&&a>e.maximum)&&(a=(e.maximum+e.minimum)/2),a;if(Number.isFinite(e.minimum))return e.exclusiveMinimum?Math.floor(e.minimum)+1:e.minimum;if(Number.isFinite(e.maximum))return e.exclusiveMaximum?e.maximum>0?0:Math.floor(e.maximum)-1:e.maximum>0?0:e.maximum}else{if(Number.isFinite(e.minimum))return e.minimum;Number.isFinite(e.exclusiveMinimum)?(a=Math.floor(e.exclusiveMinimum)+1,a===e.exclusiveMaximum&&(a=(a+Math.floor(e.exclusiveMaximum)-1)/2)):Number.isFinite(e.exclusiveMaximum)?a=Math.floor(e.exclusiveMaximum)-1:Number.isFinite(e.maximum)&&(a=e.maximum)}return a}function Yn(e,a={},r,t){let n={};const i=t&&t.depth||1;if(e&&typeof e.properties=="object"){const o=Array.isArray(e.required)?e.required:[],s={};for(const l of o)s[l]=!0;Object.keys(e.properties).forEach(l=>{if(a.skipNonRequired&&!s.hasOwnProperty(l))return;const u=he(e.properties[l],a,r,{propertyName:l,depth:i+1});if(a.skipReadOnly&&u.readOnly){t?.isAllOfChild&&(n[l]=Ma);return}if(a.skipWriteOnly&&u.writeOnly){t?.isAllOfChild&&(n[l]=Ma);return}if(a?.format==="xml"){const{propertyName:c,value:d}=ta(u,e.properties[l],{propertyName:l});c?n[c]=d:d!==null&&typeof d=="object"&&(n={...n,...d})}else n[l]=u.value})}if(e&&typeof e.additionalProperties=="object"){const o=e.additionalProperties["x-additionalPropertiesName"]||"property";n[`${String(o)}1`]=he(e.additionalProperties,a,r,{depth:i+1}).value,n[`${String(o)}2`]=he(e.additionalProperties,a,r,{depth:i+1}).value}if(e&&typeof e.properties=="object"&&e.maxProperties!==void 0&&Object.keys(n).length>e.maxProperties){const o={};let s=0;(Array.isArray(e.required)?e.required:[]).forEach(u=>{n[u]!==void 0&&(o[u]=n[u],s++)}),Object.keys(n).forEach(u=>{s<e.maxProperties&&!o.hasOwnProperty(u)&&(o[u]=n[u],s++)}),n=o}return n}function ze(e,a){return e}function Ja(e,a,r){let t=1;if(e)switch(e){case"?":{t=0;break}case"*":{t=ze(0);break}case"+":{t=ze(1);break}default:throw new Error("Unknown quantifier symbol provided.")}else a!=null&&r!=null?t=ze(parseInt(a)):a!=null&&r==null&&(t=parseInt(a));return t}function _n(e){let a=!1;e instanceof RegExp&&(a=e.flags.includes("i"),e=e.toString(),e=e.match(/\/(.+?)\//)?.[1]??""),e=e.replace(/^(\^)?(.*?)(\$)?$/,"$2");let r,t,n;const i=/([.A-Za-z0-9])(?:\{(\d+)(?:\,(\d+)|)\}|(\?|\*|\+))(?![^[]*]|[^{]*})/;let o=e.match(i);for(;o!=null;){const d=o[2],h=o[3],p=o[4];n=Ja(p,d,h),e=e.slice(0,o.index)+o[1].repeat(n)+e.slice(o.index+o[0].length),o=e.match(i)}const s=/(\d-\d|\w-\w|\d|\w|[-!@#$&()`.+,/"])/,l=/\[(\^|)(-|)(.+?)\](?:\{(\d+)(?:\,(\d+)|)\}|(\?|\*|\+)|)/;for(o=e.match(l);o!=null;){const d=o[1]==="^",h=o[2]==="-",p=o[4],b=o[5],w=o[6],A=[];let P=o[3],S=P.match(s);for(h&&A.push(45);S!=null;){if(S[0].indexOf("-")===-1)a&&isNaN(Number(S[0]))?(A.push(S[0].toUpperCase().charCodeAt(0)),A.push(S[0].toLowerCase().charCodeAt(0))):A.push(S[0].charCodeAt(0));else{const y=S[0].split("-").map(m=>m.charCodeAt(0));if(r=y[0],t=y[1],r>t)throw new Error("Character range provided is out of order.");for(let m=r;m<=t;m++)if(a&&isNaN(Number(String.fromCharCode(m)))){const k=String.fromCharCode(m);A.push(k.toUpperCase().charCodeAt(0)),A.push(k.toLowerCase().charCodeAt(0))}else A.push(m)}P=P.substring(S[0].length),S=P.match(s)}if(n=Ja(w,p,b),d){let y=-1;for(let m=48;m<=57;m++){if(y=A.indexOf(m),y>-1){A.splice(y,1);continue}A.push(m)}for(let m=65;m<=90;m++){if(y=A.indexOf(m),y>-1){A.splice(y,1);continue}A.push(m)}for(let m=97;m<=122;m++){if(y=A.indexOf(m),y>-1){A.splice(y,1);continue}A.push(m)}}const E=Array.from({length:n},()=>String.fromCharCode(A[ze(0)])).join("");e=e.slice(0,o.index)+E+e.slice(o.index+o[0].length),o=e.match(l)}const u=/(.)\{(\d+)\,(\d+)\}/;for(o=e.match(u);o!=null;){if(r=parseInt(o[2]),t=parseInt(o[3]),r>t)throw new Error("Numbers out of order in {} quantifier.");n=ze(r),e=e.slice(0,o.index)+o[1].repeat(n)+e.slice(o.index+o[0].length),o=e.match(u)}const c=/(.)\{(\d+)\}/;for(o=e.match(c);o!=null;)n=parseInt(o[2]),e=e.slice(0,o.index)+o[1].repeat(n)+e.slice(o.index+o[0].length),o=e.match(c);return e}const qn="qwerty!@#$%^123456";function Zn(){return"user@example.com"}function Xn(){return"пошта@укр.нет"}function Qn(e,a){let r="pa$$word";return e>r.length&&(r+="_",r+=Fr(qn,e-r.length).substring(0,e-r.length)),r}function Wa({min:e,max:a,omitTime:r,omitDate:t}){let n=In(new Date("2019-08-24T14:15:22.123Z"),r,t);return n.length<e&&console.warn(`Using minLength = ${e} is incorrect with format "date-time"`),a&&n.length>a&&console.warn(`Using maxLength = ${a} is incorrect with format "date-time"`),n}function et(e,a){return Wa({min:e,max:a,omitTime:!1,omitDate:!1})}function at(e,a){return Wa({min:e,max:a,omitTime:!0,omitDate:!1})}function rt(e,a){return Wa({min:e,max:a,omitTime:!1,omitDate:!0}).slice(1)}function Jr(e,a,r,t,n=!1){if(t&&n)return _n(t);let i=Fr("string",e);return a&&i.length>a&&(i=i.substring(0,a)),i}function nt(){return"192.168.0.1"}function tt(){return"2001:0db8:85a3:0000:0000:8a2e:0370:7334"}function it(){return"example.com"}function ot(){return"приклад.укр"}function st(){return"http://example.com"}function lt(){return"../dictionary"}function ut(){return"http://example.com/{endpoint}"}function ct(){return"http://example.com/entity/1"}function dt(){return"/entity/1"}function ht(e,a,r){return Fn(r||"id")}function mt(){return"/json/pointer"}function pt(){return"1/relative/json/pointer"}function ft(){return"/regex/"}const yt={email:Zn,"idn-email":Xn,password:Qn,"date-time":et,date:at,time:rt,ipv4:nt,ipv6:tt,hostname:it,"idn-hostname":ot,iri:ct,"iri-reference":dt,uri:st,"uri-reference":lt,"uri-template":ut,uuid:ht,default:Jr,"json-pointer":mt,"relative-json-pointer":pt,regex:ft};function gt(e,a,r,t){let n=e.format||"default",i=yt[n]||Jr,o=t&&t.propertyName;return i(e.minLength||0,e.maxLength,o,e.pattern,a?.enablePatterns)}var $r={};const bt={skipReadOnly:!1,maxSampleDepth:15};function kt(e,a){if(!e)throw new Error("Unknown format output for building XML.");return(Array.isArray(e)||Object.keys(e).length>1)&&(e={[a?.xml?.name||"root"]:e}),new f.Builder({ignoreAttributes:!1,format:!0,attributeNamePrefix:"$",textNodeName:"#text",cdataPropName:"#cdata"}).build(e)}function Ct(e,a,r){let t=Object.assign({},bt,a);jn();let n=he(e,t,r).value;return t?.format==="xml"?kt(n,e):n}function De(e,a){$r[e]=a}De("array",Vn);De("boolean",Un);De("integer",Kr);De("number",Kr);De("object",Yn);De("string",gt);function zr(e,a){if(e)try{return Ct(e,{skipReadOnly:!0,skipNonRequired:!1,quiet:!0})}catch(r){a.error(f.bgRed(" Error while generating test data from JSON Schema ")+`
|
|
2
2
|
`+r);return}}function St(e,a){if(e?.example)return e.example;if(f.isPlainObject(e?.examples))return jr(e.examples);if(e?.schema)return zr(e.schema,a)}function jr(e){if(f.isPlainObject(e)){const a=Object.keys(e)[0];return a?e[a]?.value:void 0}else return}function vt(e,a){const r=e?.requestBody?.content||{},[t,n]=Object.entries(r)[0]||[],i=n?.example||jr(n?.examples)||zr(n?.schema,a),o=wt(e);return{parameters:At([...$a(e.pathParameters,a),...$a(e.parameters,a)]).filter(({value:l})=>l),contentTypeParameters:[...t?[{name:"content-type",in:"header",value:t}]:[],...o?[{name:"accept",in:"header",value:o}]:[]],requestBody:i,contentType:t}}function wt(e){return e?.responses?Array.from(new Set(Object.values(e.responses).flatMap(a=>f.isPlainObject(a)&&"content"in a?Object.keys(a.content||{}):[]))).join(", "):void 0}function $a(e,a){return(e||[]).filter(r=>r?.required===!0).map(r=>{if(xa(r))return{name:r.name,in:r.in,value:St(r,a),...r.allowReserved&&{allowReserved:r.allowReserved}}}).filter(r=>r!==void 0)}function At(e){const a={};for(const r of e)xa(r)&&(a[(r.name+":"+r.in).toLowerCase()]=r);return Object.values(a)}function Tt(e,a){const{$sourceDescriptions:r,sourceDescriptions:t}=a;let n,i;if(e.includes("$sourceDescriptions.")){const[,c,d]=e.split(".");n=c,i=d}else e.includes(".")?[n,i]=e.split("."):(i=e,n=Mt(i,r,t));const o=Object.keys(r);if(!r[n])throw new Error(`Unknown description name ${f.red(n)} at ${f.red(e)}. Available descriptions: ${o.join(", ")}.`);const s=r[n],l=s?.components?.securitySchemes,u=s.servers;for(const[c,d]of Object.entries(r[n].paths)){if(!d)return;for(const[h,p]of Object.entries(d))if(p.operationId===i)return{servers:d.servers||u,...p,pathParameters:p.parameters||[],path:c,method:h,descriptionName:n,securitySchemes:l}}throw new Error(`Unknown operationId ${f.red(i)} at ${f.red(e)}.`)}function Mt(e,a,r=[]){const t=r.filter(({type:n,name:i})=>n==="openapi"&&Object.values(a[i]?.paths||{}).some(o=>Object.values(o||{}).some(s=>s?.operationId===e))).map(({name:n})=>n);if(t.length===0)throw new Error(`Unknown operationId ${f.red(e)}. No openapi source description defines it.`);if(t.length>1)throw new Error(`The operationId ${f.red(e)} is defined in several source descriptions: ${t.join(", ")}. Use ${f.red(`$sourceDescriptions.<name>.${e}`)} to pick one.`);return t[0]}function Bt(e,a){const{$sourceDescriptions:r,sourceDescriptions:t}=a,[n,i]=e.split("#");if(!t)throw new Error("Missing described sourceDescriptions");const o=t.find(w=>{if(["openapi","arazzo"].includes(w.type)){if(n.includes("$sourceDescriptions.")){const[,A]=n.split(".");return w.name===A}return"url"in w&&w.url===n}return!1})?.name;if(!o)throw new Error(`Unknown operationPath ${f.red(e)}. API description ${f.red(n)} is not listed in 'sourceDescriptions' workflow section.`);const s=r[o]||{},l=s?.components?.securitySchemes,[u,c,d]=f.JsonPointerLib.parse(i);if(u!=="paths")throw new Error(`Invalid fragment identifier: ${i} at operationPath ${f.red(e)}.`);const{servers:h}=s,p=f.JsonPointerLib.get(s,i)||{},b=f.JsonPointerLib.get(s,f.JsonPointerLib.compile(["paths",c]))||{};return{servers:b.servers||h,...p,pathParameters:b.parameters||[],path:c,method:d,descriptionName:o,securitySchemes:l}}function Rt(e,a){if(!e.operationId&&!e.operationPath)return;const{$sourceDescriptions:r,sourceDescriptions:t}=a,{operationId:n,operationPath:i}=e;return n?Tt(n,{$sourceDescriptions:r,sourceDescriptions:t}):i?Bt(i,{$sourceDescriptions:r,sourceDescriptions:t}):void 0}function Pt({statusCode:e,contentType:a,descriptionResponses:r}){return r?(r[e]||r.default)?.content?.[a]?.schema:void 0}function Lt(e,a){if(!a)return;const t=a.requestBody?.content;return t&&t[e]?.schema||void 0}function Vr({ctx:e,security:a,operation:r}){const{scheme:t,schemeName:n}=a;if(t)return a.scheme;if(n){if(typeof n=="string"&&n.startsWith("$sourceDescriptions.")){const[i,o,s]=n.split("."),u=(o&&e.$sourceDescriptions[o])?.components?.securitySchemes;return s&&u?u[s]:void 0}return r?.securitySchemes?.[n]}}var Ye={exports:{}},za;function Et(){return za||(za=1,(function(e,a){Object.defineProperty(a,"__esModule",{value:!0}),a.outdent=void 0;function r(){}function t(){return typeof WeakMap<"u"?new WeakMap:n()}function n(){return{add:r,delete:r,get:r,set:r,has:function(S){return!1}}}var i=Object.prototype.hasOwnProperty,o=function(S,E){return i.call(S,E)};function s(S,E){for(var y in E)o(E,y)&&(S[y]=E[y]);return S}var l=/^[ \t]*(?:\r\n|\r|\n)/,u=/(?:\r\n|\r|\n)[ \t]*$/,c=/^(?:[\r\n]|$)/,d=/(?:\r\n|\r|\n)([ \t]*)(?:[^ \t\r\n]|$)/,h=/^[ \t]*[\r\n][ \t\r\n]*$/;function p(S,E,y){var m=0,k=S[0].match(d);k&&(m=k[1].length);var M="(\\r\\n|\\r|\\n).{0,"+m+"}",T=new RegExp(M,"g");E&&(S=S.slice(1));var R=y.newline,N=y.trimLeadingNewline,G=y.trimTrailingNewline,x=typeof R=="string",I=S.length,O=S.map(function(U,_){return U=U.replace(T,"$1"),_===0&&N&&(U=U.replace(l,"")),_===I-1&&G&&(U=U.replace(u,"")),x&&(U=U.replace(/\r\n|\n|\r/g,function(q){return R})),U});return O}function b(S,E){for(var y="",m=0,k=S.length;m<k;m++)y+=S[m],m<k-1&&(y+=E[m]);return y}function w(S){return o(S,"raw")&&o(S,"length")}function A(S){var E=t(),y=t();function m(M){for(var T=[],R=1;R<arguments.length;R++)T[R-1]=arguments[R];if(w(M)){var N=M,G=(T[0]===m||T[0]===P)&&h.test(N[0])&&c.test(N[1]),x=G?y:E,I=x.get(N);if(I||(I=p(N,G,S),x.set(N,I)),T.length===0)return I[0];var O=b(I,G?T.slice(1):T);return O}else return A(s(s({},S),M||{}))}var k=s(m,{string:function(M){return p([M],!1,S)[0]}});return k}var P=A({trimLeadingNewline:!0,trimTrailingNewline:!0});a.outdent=P,a.default=P;try{e.exports=P,Object.defineProperty(P,"__esModule",{value:!0}),P.default=P,P.outdent=P}catch{}})(Ye,Ye.exports)),Ye.exports}var Ba=Et();function Dt(e){return!$e.isBrowser&&process.env.NODE_ENV==="test"?"<test>ms":`${Math.ceil(performance.now()-e)}ms`}function sa(e){const a=e.length;let r=0,t=0,n=0,i=0,o=0,s=0,l=0;const u=new Set;let c=0;const d=new Set,h=new Set;for(const p of e){const b=Ur(p.executedSteps);let w=!1;for(const A of b){if(i++,A.retriesLeft&&A.retriesLeft!==0)continue;n++;let P=!1;for(const S of A.checks)if(t++,!S.passed)switch(S.severity){case"warn":o++,u.add(p.workflowId),h.add(p.workflowId+":"+A.stepId);break;case"off":s++,d.add(p.workflowId+":"+A.stepId);break;default:r++,P=!0}P&&(c++,w=!0)}w&&l++}return{workflows:{passed:a-l,failed:l,warnings:u.size,skipped:0,total:a},steps:{passed:n-c,failed:c,warnings:h.size,skipped:d.size,total:n},checks:{passed:t-r,failed:r,warnings:o,skipped:s,total:t},totalRequests:i}}function Ur(e){return e.flatMap(a=>"executedSteps"in a?Ur(a.executedSteps):[a])}function Nt(e){try{return JSON.parse(e),!0}catch{return!1}}function Ht(e,a){const r=e.endsWith("/")?e.slice(0,-1):e,t=a.startsWith("/")?a.slice(1):a;return`${r}/${t}`}const ja=50;function Yr({testNameToDisplay:e,checks:a,verboseLogs:r,verboseResponseLogs:t,logger:n}){const i=a.every(({passed:o})=>o);n.output(` ${i?f.green("✓"):f.red("✗")} ${f.blue(e)}`),r&&(n.output(`${ee}
|
|
3
3
|
`+(Va({logs:r,logger:n})||"")),n.printNewLine()),t&&(n.output(`${ee}
|
|
4
4
|
`+(Va({logs:t,type:"response",logger:n})||"")),n.printNewLine()),n.printNewLine();for(const o of a)n.output(`${j(xt(o,o.severity),4)}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a7 as Y, a6 as ce, bs as Ne, bt as Me, bu as Va, bv as Yn, bw as ua, bx as x, by as Fe, bz as q, bA as Z, bB as Be, bC as Re, bD as Zr, bE as _n, V as Xa, W as qn, bF as Zn, bG as Qa, X as Ua, bH as Xn, bI as ca, bJ as Wa, bK as er } from "./replay-index-
|
|
2
|
-
import { c as Ze } from "./replay-resolve-
|
|
3
|
-
import {
|
|
1
|
+
import { a7 as Y, a6 as ce, bs as Ne, bt as Me, bu as Va, bv as Yn, bw as ua, bx as x, by as Fe, bz as q, bA as Z, bB as Be, bC as Re, bD as Zr, bE as _n, V as Xa, W as qn, bF as Zn, bG as Qa, X as Ua, bH as Xn, bI as ca, bJ as Wa, bK as er } from "./replay-index-B0ZnzCe0.js";
|
|
2
|
+
import { c as Ze } from "./replay-resolve-VJqotAvd.js";
|
|
3
|
+
import { E as Xr, a7 as ar, c as Qn, a0 as et, X as at, Q as rt, ac as Qr, ad as nt } from "./replay-lint-r3bg254e.js";
|
|
4
4
|
function tt(e) {
|
|
5
5
|
return Y(e) && "name" in e && "value" in e && !("in" in e);
|
|
6
6
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./replay-index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./replay-index-DHpZ_Le1.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 { k as h, s as x, l as i } from "./replay-index-
|
|
2
|
-
import { n as j, o as b, j as k } from "./replay-index-
|
|
1
|
+
import { k as h, s as x, l as i } from "./replay-index-B0ZnzCe0.js";
|
|
2
|
+
import { n as j, o as b, j as k } from "./replay-index-B0ZnzCe0.js";
|
|
3
3
|
async function u(a, e) {
|
|
4
4
|
const t = x(), l = await i(a), c = await i(e), o = l.replace(new RegExp(`^${t}+`), "").split(t).filter(Boolean), s = c.replace(new RegExp(`^${t}+`), "").split(t).filter(Boolean), m = Math.min(o.length, s.length);
|
|
5
5
|
let r = 0;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const Ce=require("react"),a=require("./replay-index-
|
|
1
|
+
"use strict";const Ce=require("react"),a=require("./replay-index-DHpZ_Le1.js"),m=require("./replay-db-Cfh97P75.js"),r=require("./replay-create-model-jiStWNur.js"),C=require("./replay-SemanticSearchService-DTzvCAEY.js"),Oe=require("@tanstack/react-query"),j={path:"pathParameters",query:"queryParameters",header:"headers",cookie:"cookies"},ft={run_request:{approveLabel:"Run",denyLabel:"Skip"},update_step:{approveLabel:"Apply",denyLabel:"Dismiss"},update_security:{approveLabel:"Apply",denyLabel:"Dismiss"}},mt={set_active_environment:{approveLabel:"Switch",denyLabel:"Cancel"},add_environment:{approveLabel:"Add",denyLabel:"Cancel"},upsert_input:{approveLabel:"Set",denyLabel:"Cancel"},upsert_server:{approveLabel:"Set",denyLabel:"Cancel"},remove_input:{approveLabel:"Remove",denyLabel:"Cancel"},remove_server:{approveLabel:"Remove",denyLabel:"Cancel"},create_collection:{approveLabel:"Create",denyLabel:"Cancel"},create_workflow:{approveLabel:"Create",denyLabel:"Cancel"},create_step:{approveLabel:"Create",denyLabel:"Cancel"},move_step:{approveLabel:"Move",denyLabel:"Cancel"},delete_collection:{approveLabel:"Delete",denyLabel:"Cancel"},delete_workflow:{approveLabel:"Delete",denyLabel:"Cancel"},delete_step:{approveLabel:"Delete",denyLabel:"Cancel"},save_tab_to_collection:{approveLabel:"Save",denyLabel:"Cancel"}},ht={CHAT:"chat",HISTORY:"history"},yt="report_status",It="run_workflow",W={WEB_SEARCH:"web_search"};function wt(e){switch(e.provider){case a.AI_PROVIDERS.GEMINI:return{[W.WEB_SEARCH]:r.google.tools.googleSearch({})};case a.AI_PROVIDERS.OPENAI:return{[W.WEB_SEARCH]:r.openai.tools.webSearch({})};case a.AI_PROVIDERS.ANTHROPIC:return{[W.WEB_SEARCH]:r.anthropic.tools.webFetch_20250910()};case a.REUNITE_AI_PROVIDER:return{[W.WEB_SEARCH]:{type:"provider",id:"reunite.web_search",name:"web_search",args:{}}};default:return{}}}const gt=["info","workflows","sourceDescriptions"];function bt(e){const t=[];return e.collectionId&&t.push(`Collection ID: ${e.collectionId}`),e.collection?.info?.title&&t.push(`Title: ${e.collection.info.title}`),e.collection?.info?.summary&&t.push(`Summary: ${e.collection.info.summary}`),e.collection?.info?.description&&t.push(`Description: ${e.collection.info.description}`),m.buildMessageFromArray(t,`
|
|
2
2
|
`)}function vt(e){const t=[];if(e.collection?.workflows?.length){t.push("Workflows:");for(const o of e.collection.workflows)t.push(` workflowId=${o.workflowId} ${o.summary??""}`)}return m.buildMessageFromArray(t,`
|
|
3
3
|
`)}function Tt(e){const t=[];if(e.collection?.sourceDescriptions?.length){t.push("Source descriptions:");for(const o of e.collection.sourceDescriptions)t.push(` name=${o.name} url=${o.url}`)}return m.buildMessageFromArray(t,`
|
|
4
4
|
`)}function St(e,t){const o=["Current tab (collection)"];for(const n of t)switch(n){case"info":o.push(bt(e));break;case"workflows":o.push(vt(e));break;case"sourceDescriptions":o.push(Tt(e));break}return m.buildMessageFromArray(o,`
|
|
@@ -143,7 +143,7 @@ Duplicates of earlier statuses and statuses reported back-to-back with no action
|
|
|
143
143
|
|
|
144
144
|
`)].filter(n=>n!=null&&n.length>0).join(`
|
|
145
145
|
|
|
146
|
-
`)}const as="You already ran this exact search earlier in this conversation. If nothing has changed since then, reuse those results instead of repeating. If you expect different results (for example after an edit), do not just repeat the same search - change the query, the type, or the filters, or read the current state another way.",cs=10;function ls(e){const t=[e.type,_(e.query),_(e.apiId),_(e.operationId),_(e.path),_(e.method)?.toLowerCase(),_(e.collectionId),_(e.workflowId),_(e.stepId)];return t.every(o=>o==null)?null:JSON.stringify([...t,ds(e),us(e)])}function ds(e){return typeof e?.count=="number"?e.count:cs}function us(e){return Array.isArray(e?.include)?[...new Set(e.include)].sort():[]}function _(e){if(typeof e!="string")return null;const t=_e(e);return t===""?null:t}const ps=[Re({key:ls,warn:as})],Ze={name:"search",definition:Xr,guards:ps,createExecutor:e=>es(e.store)},fs="Update security (x-security) for one or more Replay steps.\n\n**What it does**\n- Applies atomic add/update/remove changes to step security entries.\n- `add` UPSERTS by scheme identity: an existing entry with the same `schemeId` (or same `type` when `schemeId` is omitted) - including the auto-seeded entry created when the step was linked to its operation - is updated in place, never duplicated. Repeated identical wiring converges.\n- The result echoes each affected step's resulting security in `resultingState`; confirm from it, do NOT re-read tabs after mutation.\n- Empty security list falls back to No Auth.\n\n**Targeting**\n- Saved step: `collectionId` + `workflowId` + `stepId`.\n- Multi-step batch: set `changes[].stepId` per change (top-level `stepId` is the default and may be empty); wire a whole chain in ONE call.\n- Unsaved draft tab on focus: all three ids empty strings, no per-change stepId.\n\n**Choosing the type (match the OpenAPI scheme)**\n- http bearer -> `JWT` (`data.token`). A plain bearer token is NOT OAuth 2.0.\n- http basic -> `Basic Auth`, http digest -> `Digest Auth` (`data.username`, `data.password`).\n- apiKey -> `API key` (`data.name`, `data.key`, `data.location`); keep `data.key`'s `$inputs.<name>` segment identical to `data.name`.\n- oauth2 (grant-based flows only) -> `OAuth 2.0`; `data.grantType` is REQUIRED with flow values (`accessToken`, `clientId`, ...): `clientCredentials`, `clientCredentialsWithJwtAssertion`, `authorizationCode`, `authorizationCodeWithPkce`, `implicit`, `password`.\n- openIdConnect -> `OpenID Connect` (`data.openIdConnectUrl` plus OAuth2 fields).\n- `add` with a `schemeId` existing under a different type is rejected; use `update` at that index only to intentionally change a type.\n\n**Change shapes**\n- add/update: `{ action, stepId?, index?, type, schemeId?, data? }`; pass `schemeId` whenever known (it is the upsert identity), `index` is required for update.\n- remove: `{ action: \"remove\", stepId?, index }`.",ms=["clientCredentials","clientCredentialsWithJwtAssertion","authorizationCode","authorizationCodeWithPkce","implicit","password"],hs={grantType:r.enumType(ms).optional().describe("OAuth2 grant type."),clientId:r.stringType().optional(),clientSecret:r.stringType().optional(),tokenUrl:r.stringType().optional(),authorizationUrl:r.stringType().optional(),callbackUrl:r.stringType().optional(),accessToken:r.stringType().optional(),username:r.stringType().optional().describe("For password grant type."),password:r.stringType().optional().describe("For password grant type.")},ys=r.objectType({username:r.stringType().optional(),password:r.stringType().optional()}).strict(),Is=r.objectType({username:r.stringType().optional(),password:r.stringType().optional()}).strict(),ws=r.objectType({token:r.stringType().optional()}).strict(),gs=r.objectType({location:r.enumType(["header","query","cookie"]).optional(),name:r.stringType().optional().describe("Must match the OpenAPI security scheme `name` (header/query/cookie parameter name). Not the scheme component ref id (e.g. UserCookie)."),key:r.stringType().optional().describe("Secret value or `$inputs.<name>` / `{$inputs.<name>}`. The `<name>` segment must be identical to `data.name` (OpenAPI apiKey `name`, e.g. accessToken). Wrong example: `data.name` accessToken but key `$inputs.UserCookie` (UserCookie is the securitySchemes ref, not the cookie name).")}).strict(),et=r.objectType({...hs}).strict(),bs=et.extend({openIdConnectUrl:r.stringType().optional(),userInfoUrl:r.stringType().optional()}).strict(),tt=r.stringType().optional().describe("Target step id for this change. Overrides the top-level stepId; use to batch changes for several steps of the same workflow in one call."),N=Io.extend({action:r.enumType(["add","update"]),schemeId:r.stringType().optional(),stepId:tt}),vs=r.discriminatedUnionType("type",[N.extend({type:r.literalType(a.SecurityTypes.BasicAuth),data:ys.optional()}).strict(),N.extend({type:r.literalType(a.SecurityTypes.DigestAuth),data:Is.optional()}).strict(),N.extend({type:r.literalType(a.SecurityTypes.JWT),data:ws.optional()}).strict(),N.extend({type:r.literalType(a.SecurityTypes.APIKey),data:gs.optional()}).strict(),N.extend({type:r.literalType(a.SecurityTypes.OAuth2),data:et.optional()}).strict(),N.extend({type:r.literalType(a.SecurityTypes.OpenIDConnect),data:bs.optional()}).strict()]),Ts=oe.extend({action:r.literalType("remove"),index:r.numberType().int().min(0).describe("0-based position of the entry in the step's current security list; every index in one call refers to that same list. Position, not schemeId, identifies the entry - a step can list the same scheme more than once."),stepId:tt}).strict(),Ss=r.unionType([vs,Ts]),ks=r.objectType({collectionId:r.stringType().describe("Saved step: collection id. Unsaved draft tab on focus: empty string (with empty workflowId and stepId)."),workflowId:r.stringType().describe("Saved step: workflow id. Unsaved draft tab: empty string (with empty collectionId and stepId)."),stepId:r.stringType().describe("Saved step: step id (default target for changes without their own stepId; may be empty when every change sets one). Unsaved draft tab: empty string (with empty collectionId and workflowId)."),changes:r.arrayType(Ss).min(1).describe("List of security changes to apply.")}).strict().superRefine((e,t)=>{const o=e.collectionId.trim(),n=e.workflowId.trim(),s=e.stepId.trim(),i=e.changes.map(p=>p.stepId?.trim()),c=i.every(Boolean),d=i.some(Boolean);!(o&&n&&(s||c))&&!(!o&&!n&&!s&&!d)&&t.addIssue({code:r.ZodIssueCode.custom,message:"Provide collectionId and workflowId plus a stepId for every change (top-level or per-change), or all empty ids for the focused unsaved request tab.",path:["collectionId"]})}),As=$e,Cs={description:fs,inputSchema:ks,outputSchema:As,needsApproval:()=>!0},k={ADD:"add",UPDATE:"update",REMOVE:"remove"};function w(e,t){return{status:e,...t!==void 0&&{summary:t}}}function ot(e){if(!e||typeof e!="object"||!("meta"in e))return{};const{meta:t}=e;if(!t||typeof t!="object")return{};const o="totalChanges"in t&&typeof t.totalChanges=="number"?t.totalChanges:void 0,n="approvedChanges"in t&&typeof t.approvedChanges=="number"?t.approvedChanges:void 0;return{totalChanges:o,approvedChanges:n}}function nt(e,t){return!Number.isInteger(t.index)||t.index<0||t.index>=e.length?{ok:!1,message:`Index ${t.index} out of bounds. Step has ${e.length} security entries.`}:{ok:!0,entry:e[t.index]}}const Os=new Set(["grantType","openIdConnectUrl","userInfoUrl"]);function Es(e){return e.type===a.SecurityTypes.OAuth2||e.type===a.SecurityTypes.OpenIDConnect}function be(e,t){const o=e;for(const[n,s]of Object.entries(t))s!==void 0&&n in o&&(o[n]=s)}function ve(e,t){const o=Object.entries(t);for(const[i,c]of o)i==="grantType"&&typeof c=="string"&&a.GRANT_TYPE_MAP[c]&&(e.grantType=a.GRANT_TYPE_MAP[c]);const n=e[e.grantType],s=new Set(Object.keys(a.OAUTH2_SECURITY[e.grantType]));for(const[i,c]of o)i!=="grantType"&&c!==void 0&&s.has(i)&&(n[i]=c)}function rt(e){return e.securityType===a.SecurityTypes.NoAuth?null:e[e.securityType]?.schemeName??null}function _s(e,t){!t||e.securityType===a.SecurityTypes.NoAuth||(e.securitySchemeId=t,e[e.securityType].schemeName=t)}function Q(e,t){if(e.securityType=t.type,_s(e,t.schemeId),!t.data)return e;switch(t.type){case a.SecurityTypes.BasicAuth:case a.SecurityTypes.DigestAuth:case a.SecurityTypes.JWT:be(e[t.type],t.data);break;case a.SecurityTypes.APIKey:{const{location:o,...n}=t.data;be(e[a.SecurityTypes.APIKey],n),o&&(e[a.SecurityTypes.APIKey].location=a.getAPIKeyLocation(o));break}case a.SecurityTypes.OAuth2:ve(e[a.SecurityTypes.OAuth2],t.data);break;case a.SecurityTypes.OpenIDConnect:{const{openIdConnectUrl:o,userInfoUrl:n,...s}=t.data;ve(e[a.SecurityTypes.OpenIDConnect],s),o!==void 0&&(e[a.SecurityTypes.OpenIDConnect].openIdConnectUrl=o),n!==void 0&&(e[a.SecurityTypes.OpenIDConnect].userInfoUrl=n);break}}return e}function Rs(e,t){return t.schemeId?e.findIndex(o=>o.securitySchemeId===t.schemeId||rt(o)===t.schemeId):e.findIndex(o=>o.securityType===t.type)}function xs(e){return e.data?Object.entries(e.data).some(([t,o])=>o!==void 0&&!Os.has(t)):!1}function $s(e){return e.schemeId?`${e.type} (scheme '${e.schemeId}')`:e.type}function Te(e,t,o,n){return e.has(t)?{ok:!1,message:`The security entry at index ${o} is targeted by both a mutation and a remove${n}; issue only one action for it.`}:null}function Ps(e,t,o){let n=e;const s=[],i=t.filter(l=>l.action!==k.REMOVE),c=t.filter(l=>l.action===k.REMOVE),d=new Set;for(const l of c){const u=nt(e,l);if(!u.ok)return{ok:!1,message:u.message};d.add(u.entry)}for(const l of i){if(l.action===k.ADD){const f=n.length===1&&n[0].securityType===a.SecurityTypes.NoAuth,h=f?-1:Rs(n,l);if(h>=0){const I=n[h],b=Te(d,I,h,o);if(b)return b;if(I.securityType!==l.type)return{ok:!1,message:`Scheme '${l.schemeId}' already exists${o} as ${I.securityType}, not ${l.type}. Match the documented scheme type (plain http/bearer -> JWT with data.token; OAuth 2.0 only for grant-based flows), or use action "update" at index ${h} to intentionally change the type.`};n=[...n],n[h]=Q(structuredClone(I),l),s.push(w("applied",`Updated existing ${$s(l)} in place (index: ${h})${o}`));continue}if(Es(l)&&xs(l)&&!l.data?.grantType)return{ok:!1,message:`grantType is required when adding ${l.type} security with flow values${o}. For a plain http/bearer token use type "${a.SecurityTypes.JWT}" with data.token instead.`};const g=Q(a.getEmptySingleSecurity(),l);n=f?[g]:[...n,g],s.push(w("applied",`Added ${l.type} security (index: ${n.length-1})${o}`));continue}if(l.index===void 0)return{ok:!1,message:"index is required for update action."};if(l.index>=n.length)return{ok:!1,message:`Index ${l.index} out of bounds. Step has ${n.length} security entries.`};const u=n[l.index],p=Te(d,u,l.index,o);if(p)return p;if(u.securitySchemeId){const f=rt(u);if(l.schemeId&&f!==l.schemeId)return{ok:!1,message:`schemeId mismatch at index ${l.index}. Expected ${f??"none"}.`}}n=[...n],n[l.index]=Q(structuredClone(u),l),s.push(w("applied",`Updated ${l.type} at index ${l.index}${o}`))}if(d.size>0){const l=n.filter(p=>!d.has(p)),u=n.length-l.length;n=l;for(let p=0;p<u;p++)s.push(w("applied"))}return n.length===0&&(n=[a.getEmptySingleSecurity()]),{ok:!0,security:n,applied:s}}function qs(e){return async t=>{const{changes:o,collectionId:n,workflowId:s,stepId:i}=t,c=ot(t),d=i.trim(),l=new Map;for(const h of o){const g=h.stepId?.trim()||d,I=l.get(g);I?I.push(h):l.set(g,[h])}const u=[],p=[];for(const[h,g]of l){const I=He(e,n,s,h);if(!I.ok)return y(I.message,I.details);const{readStep:b,updateStep:T}=I.value,v=h||I.value.step.stepId,q=l.size>1?` for step '${v}'`:"",M=Array.from(b().security),R=Ps(M,g,q);if(!R.ok)return y(R.message);u.push(...R.applied),p.push({updateStep:T,security:R.security,label:v})}for(const h of p)h.updateStep(g=>({...g,security:h.security}));const f=p.map(h=>`stepId=${h.label}
|
|
146
|
+
`)}const as="You already ran this exact search earlier in this conversation. If nothing has changed since then, reuse those results instead of repeating. If you expect different results (for example after an edit), do not just repeat the same search - change the query, the type, or the filters, or read the current state another way.",cs=10;function ls(e){const t=[e.type,_(e.query),_(e.apiId),_(e.operationId),_(e.path),_(e.method)?.toLowerCase(),_(e.collectionId),_(e.workflowId),_(e.stepId)];return t.every(o=>o==null)?null:JSON.stringify([...t,ds(e),us(e)])}function ds(e){return typeof e?.count=="number"?e.count:cs}function us(e){return Array.isArray(e?.include)?[...new Set(e.include)].sort():[]}function _(e){if(typeof e!="string")return null;const t=_e(e);return t===""?null:t}const ps=[Re({key:ls,warn:as})],Ze={name:"search",definition:Xr,guards:ps,createExecutor:e=>es(e.store)},fs="Update security (x-security) for one or more Replay steps.\n\n**What it does**\n- Applies atomic add/update/remove changes to step security entries.\n- `add` UPSERTS by scheme identity: an existing entry with the same `schemeId` (or same `type` when `schemeId` is omitted) - including the auto-seeded entry created when the step was linked to its operation - is updated in place, never duplicated. Repeated identical wiring converges.\n- The result echoes each affected step's resulting security in `resultingState`; confirm from it, do NOT re-read tabs after mutation.\n- Empty security list falls back to No Auth.\n\n**Targeting**\n- Saved step: `collectionId` + `workflowId` + `stepId`.\n- Multi-step batch: set `changes[].stepId` per change (top-level `stepId` is the default and may be empty); wire a whole chain in ONE call.\n- Unsaved draft tab on focus: all three ids empty strings, no per-change stepId.\n\n**Choosing the type (match the OpenAPI scheme)**\n- http bearer -> `JWT` (`data.token`). A plain bearer token is NOT OAuth 2.0.\n- http basic -> `Basic Auth`, http digest -> `Digest Auth` (`data.username`, `data.password`).\n- apiKey -> `API key` (`data.name`, `data.key`, `data.location`); keep `data.key`'s `$inputs.<name>` segment identical to `data.name`.\n- oauth2 (grant-based flows only) -> `OAuth 2.0`; `data.grantType` is REQUIRED with flow values (`accessToken`, `clientId`, ...): `clientCredentials`, `clientCredentialsWithJwtAssertion`, `authorizationCode`, `authorizationCodeWithPkce`, `implicit`, `password`.\n- openIdConnect -> `OpenID Connect` (`data.openIdConnectUrl` plus OAuth2 fields).\n- `add` with a `schemeId` existing under a different type is rejected; use `update` at that index only to intentionally change a type.\n\n**Change shapes**\n- add/update: `{ action, stepId?, index?, type, schemeId?, data? }`; pass `schemeId` whenever known (it is the upsert identity), `index` is required for update.\n- remove: `{ action: \"remove\", stepId?, index }`.",ms=["clientCredentials","clientCredentialsWithJwtAssertion","authorizationCode","authorizationCodeWithPkce","implicit","password"],hs={grantType:r.enumType(ms).optional().describe("OAuth2 grant type."),clientId:r.stringType().optional(),clientSecret:r.stringType().optional(),tokenUrl:r.stringType().optional(),authorizationUrl:r.stringType().optional(),callbackUrl:r.stringType().optional(),accessToken:r.stringType().optional(),username:r.stringType().optional().describe("For password grant type."),password:r.stringType().optional().describe("For password grant type.")},ys=r.objectType({username:r.stringType().optional(),password:r.stringType().optional()}).strict(),Is=r.objectType({username:r.stringType().optional(),password:r.stringType().optional()}).strict(),ws=r.objectType({token:r.stringType().optional()}).strict(),gs=r.objectType({location:r.enumType(["header","query","cookie"]).optional(),name:r.stringType().optional().describe("Must match the OpenAPI security scheme `name` (header/query/cookie parameter name). Not the scheme component ref id (e.g. UserCookie)."),key:r.stringType().optional().describe("Secret value or `$inputs.<name>` / `{$inputs.<name>}`. The `<name>` segment must be identical to `data.name` (OpenAPI apiKey `name`, e.g. accessToken). Wrong example: `data.name` accessToken but key `$inputs.UserCookie` (UserCookie is the securitySchemes ref, not the cookie name).")}).strict(),et=r.objectType({...hs}).strict(),bs=et.extend({openIdConnectUrl:r.stringType().optional(),userInfoUrl:r.stringType().optional()}).strict(),tt=r.stringType().optional().describe("Target step id for this change. Overrides the top-level stepId; use to batch changes for several steps of the same workflow in one call."),N=Io.extend({action:r.enumType(["add","update"]),schemeId:r.stringType().optional(),stepId:tt}),vs=r.discriminatedUnionType("type",[N.extend({type:r.literalType(a.SecurityTypes.BasicAuth),data:ys.optional()}).strict(),N.extend({type:r.literalType(a.SecurityTypes.DigestAuth),data:Is.optional()}).strict(),N.extend({type:r.literalType(a.SecurityTypes.JWT),data:ws.optional()}).strict(),N.extend({type:r.literalType(a.SecurityTypes.APIKey),data:gs.optional()}).strict(),N.extend({type:r.literalType(a.SecurityTypes.OAuth2),data:et.optional()}).strict(),N.extend({type:r.literalType(a.SecurityTypes.OpenIDConnect),data:bs.optional()}).strict()]),Ts=oe.extend({action:r.literalType("remove"),index:r.numberType().int().min(0).describe("0-based position of the entry in the step's current security list; every index in one call refers to that same list. Position, not schemeId, identifies the entry - a step can list the same scheme more than once."),stepId:tt}).strict(),Ss=r.unionType([vs,Ts]),ks=r.objectType({collectionId:r.stringType().describe("Saved step: collection id. Unsaved draft tab on focus: empty string (with empty workflowId and stepId)."),workflowId:r.stringType().describe("Saved step: workflow id. Unsaved draft tab: empty string (with empty collectionId and stepId)."),stepId:r.stringType().describe("Saved step: step id (default target for changes without their own stepId; may be empty when every change sets one). Unsaved draft tab: empty string (with empty collectionId and workflowId)."),changes:r.arrayType(Ss).min(1).describe("List of security changes to apply.")}).strict().superRefine((e,t)=>{const o=e.collectionId.trim(),n=e.workflowId.trim(),s=e.stepId.trim(),i=e.changes.map(p=>p.stepId?.trim()),c=i.every(Boolean),d=i.some(Boolean);!(o&&n&&(s||c))&&!(!o&&!n&&!s&&!d)&&t.addIssue({code:r.ZodIssueCode.custom,message:"Provide collectionId and workflowId plus a stepId for every change (top-level or per-change), or all empty ids for the focused unsaved request tab.",path:["collectionId"]})}),As=$e,Cs={description:fs,inputSchema:ks,outputSchema:As,needsApproval:()=>!0},k={ADD:"add",UPDATE:"update",REMOVE:"remove"};function w(e,t){return{status:e,...t!==void 0&&{summary:t}}}function ot(e){if(!e||typeof e!="object"||!("meta"in e))return{};const{meta:t}=e;if(!t||typeof t!="object")return{};const o="totalChanges"in t&&typeof t.totalChanges=="number"?t.totalChanges:void 0,n="approvedChanges"in t&&typeof t.approvedChanges=="number"?t.approvedChanges:void 0;return{totalChanges:o,approvedChanges:n}}function nt(e,t){return!Number.isInteger(t.index)||t.index<0||t.index>=e.length?{ok:!1,message:`Index ${t.index} out of bounds. Step has ${e.length} security entries.`}:{ok:!0,entry:e[t.index]}}const Os=new Set(["grantType","openIdConnectUrl","userInfoUrl"]);function Es(e){return e.type===a.SecurityTypes.OAuth2||e.type===a.SecurityTypes.OpenIDConnect}function be(e,t){const o=e;for(const[n,s]of Object.entries(t))s!==void 0&&n in o&&(o[n]=s)}function ve(e,t){const o=Object.entries(t);for(const[i,c]of o)i==="grantType"&&typeof c=="string"&&a.GRANT_TYPE_MAP[c]&&(e.grantType=a.GRANT_TYPE_MAP[c]);const n=e[e.grantType],s=new Set(Object.keys(a.OAUTH2_SECURITY[e.grantType]));for(const[i,c]of o)i!=="grantType"&&c!==void 0&&s.has(i)&&(n[i]=c)}function rt(e){return e.securityType===a.SecurityTypes.NoAuth?null:e[e.securityType]?.schemeName??null}function _s(e,t){!t||e.securityType===a.SecurityTypes.NoAuth||(e.securitySchemeId=t,e[e.securityType].schemeName=t)}function Q(e,t){if(e.securityType=t.type,_s(e,t.schemeId),!t.data)return e;switch(t.type){case a.SecurityTypes.BasicAuth:case a.SecurityTypes.DigestAuth:case a.SecurityTypes.JWT:be(e[t.type],t.data);break;case a.SecurityTypes.APIKey:{const{location:o,...n}=t.data;be(e[a.SecurityTypes.APIKey],n),o&&(e[a.SecurityTypes.APIKey].location=a.getAPIKeyLocation(o));break}case a.SecurityTypes.OAuth2:ve(e[a.SecurityTypes.OAuth2],t.data);break;case a.SecurityTypes.OpenIDConnect:{const{openIdConnectUrl:o,userInfoUrl:n,...s}=t.data;ve(e[a.SecurityTypes.OpenIDConnect],s),o!==void 0&&(e[a.SecurityTypes.OpenIDConnect].openIdConnectUrl=o),n!==void 0&&(e[a.SecurityTypes.OpenIDConnect].userInfoUrl=n);break}}return e}function Rs(e,t){return t.schemeId?e.findIndex(o=>o.securitySchemeId===t.schemeId||rt(o)===t.schemeId):e.findIndex(o=>o.securityType===t.type)}function xs(e){return e.data?Object.entries(e.data).some(([t,o])=>o!==void 0&&!Os.has(t)):!1}function $s(e){return e.schemeId?`${e.type} (scheme '${e.schemeId}')`:e.type}function Te(e,t,o,n){return e.has(t)?{ok:!1,message:`The security entry at index ${o} is targeted by both a mutation and a remove${n}; issue only one action for it.`}:null}function Ps(e,t,o){let n=[...e];const s=[],i=t.filter(l=>l.action!==k.REMOVE),c=t.filter(l=>l.action===k.REMOVE),d=new Set;for(const l of c){const u=nt(e,l);if(!u.ok)return{ok:!1,message:u.message};d.add(u.entry)}for(const l of i){if(l.action===k.ADD){const f=n.length===1&&n[0].securityType===a.SecurityTypes.NoAuth,h=f?-1:Rs(n,l);if(h>=0){const I=n[h],b=Te(d,I,h,o);if(b)return b;if(I.securityType!==l.type)return{ok:!1,message:`Scheme '${l.schemeId}' already exists${o} as ${I.securityType}, not ${l.type}. Match the documented scheme type (plain http/bearer -> JWT with data.token; OAuth 2.0 only for grant-based flows), or use action "update" at index ${h} to intentionally change the type.`};n[h]=Q(structuredClone(I),l),s.push(w("applied",`Updated existing ${$s(l)} in place (index: ${h})${o}`));continue}if(Es(l)&&xs(l)&&!l.data?.grantType)return{ok:!1,message:`grantType is required when adding ${l.type} security with flow values${o}. For a plain http/bearer token use type "${a.SecurityTypes.JWT}" with data.token instead.`};const g=Q(a.getEmptySingleSecurity(),l);f?n=[g]:n.push(g),s.push(w("applied",`Added ${l.type} security (index: ${n.length-1})${o}`));continue}if(l.index===void 0)return{ok:!1,message:"index is required for update action."};if(l.index>=n.length)return{ok:!1,message:`Index ${l.index} out of bounds. Step has ${n.length} security entries.`};const u=n[l.index],p=Te(d,u,l.index,o);if(p)return p;if(u.securitySchemeId){const f=rt(u);if(l.schemeId&&f!==l.schemeId)return{ok:!1,message:`schemeId mismatch at index ${l.index}. Expected ${f??"none"}.`}}n[l.index]=Q(structuredClone(u),l),s.push(w("applied",`Updated ${l.type} at index ${l.index}${o}`))}if(d.size>0){const l=n.filter(p=>!d.has(p)),u=n.length-l.length;n=l;for(let p=0;p<u;p++)s.push(w("applied"))}return n.length===0&&(n=[a.getEmptySingleSecurity()]),{ok:!0,security:n,applied:s}}function qs(e){return async t=>{const{changes:o,collectionId:n,workflowId:s,stepId:i}=t,c=ot(t),d=i.trim(),l=new Map;for(const h of o){const g=h.stepId?.trim()||d,I=l.get(g);I?I.push(h):l.set(g,[h])}const u=[],p=[];for(const[h,g]of l){const I=He(e,n,s,h);if(!I.ok)return y(I.message,I.details);const{readStep:b,updateStep:T}=I.value,v=h||I.value.step.stepId,q=l.size>1?` for step '${v}'`:"",M=Array.from(b().security),R=Ps(M,g,q);if(!R.ok)return y(R.message);u.push(...R.applied),p.push({updateStep:T,security:R.security,label:v})}for(const h of p)h.updateStep(g=>({...g,security:h.security}));const f=p.map(h=>`stepId=${h.label}
|
|
147
147
|
${m.buildSecuritySection(h.security)}`).join(`
|
|
148
148
|
|
|
149
149
|
`);return{isError:!1,data:{totalChanges:c.totalChanges??o.length,approvedChanges:c.approvedChanges??o.length,applied:u,resultingState:f}}}}const st={name:"update_security",definition:Cs,createExecutor:e=>qs(e.store)},Ns=`Update an existing Replay step with atomic changes.
|
|
@@ -212,4 +212,4 @@ You must use the provider web search tool to gather information. You cannot acce
|
|
|
212
212
|
- Include source URLs for all claims that are material to the parent agent's next steps.
|
|
213
213
|
- Clearly distinguish between verified findings, inferred conclusions, and information that could not be verified.
|
|
214
214
|
- When sources conflict, report the conflict and cite the competing sources rather than selecting a winner without evidence.
|
|
215
|
-
`,ci=m.prompt(m.section("role",ii),m.section("output",ai));function li(){return[m.createSystemMessage(ci)]}function di(e){const t=wt(e),o=r.createModel(e);return async(n,s)=>{try{return{isError:!1,data:{message:await r.streamText({model:o,system:li(),prompt:ui(n),tools:t,toolChoice:"required",stopWhen:r.hasToolCall("web_search"),
|
|
215
|
+
`,ci=m.prompt(m.section("role",ii),m.section("output",ai));function li(){return[m.createSystemMessage(ci)]}function di(e){const t=wt(e),o=r.createModel(e);return async(n,s)=>{try{return{isError:!1,data:{message:await r.streamText({model:o,system:li(),prompt:ui(n),tools:t,toolChoice:"required",stopWhen:r.hasToolCall("web_search"),abortSignal:s.abortSignal}).text}}}catch(i){return{isError:!0,error:{message:i.message}}}}}function ui(e){return m.buildMessageFromArray(["[URL]",e.url," ","[TASK]",e.task])}const at={name:"web_search",definition:si,createExecutor:e=>di(e.model)},ct=[Ke,Je,Xe,Qe,Ze,st,it,Pe,Me,Le,at,Ue];function pi(e){return ct.some(t=>t.name===e)}function fi(e,t){for(const o of ct)e.register(fo(o,t[o.name]))}function lt(e){const t=e.startsWith("tool-")?e.slice(5):e;return pi(t)?t:void 0}function dt(e,t){return`${e}::${t}`}function J(e){return typeof e=="object"&&e!==null&&"type"in e&&typeof e.type=="string"&&e.type.startsWith("tool-")&&"toolCallId"in e}function X(e){return e.state==="approval-requested"&&e.approval?.id!=null}function ut(e){return e.state==="output-denied"?!0:e.state==="output-available"&&e.approval!=null}function pt(e){return e.parts.some(t=>J(t)&&X(t))}function mi(e){return e.some(pt)}function hi(e){return e.map(t=>pt(t)?{...t,parts:t.parts.map(yi)}:t)}function yi(e){return!J(e)||!X(e)?e:{...e,state:"output-denied",approval:{id:e.approval.id,approved:!1}}}function Ii(e){const t=[],o=[];let n=0;const s={},i=()=>{o.length!==0&&(t.push({kind:"reasoning-block",key:`reasoning-${n++}`,items:[...o]}),o.length=0)},c=d=>{const l=d.trim();if(l.length===0)return;const u=o[o.length-1];u?.kind==="action"&&u.text===l||o.push({kind:"action",text:l})};for(let d=0;d<e.length;d++){const l=e[d];if(l.type==="step-start")continue;if(l.type==="text"){i();const p=l.text??"";p.length>0&&t.push({kind:"text",text:p,key:`text-${d}`,workflowRunHistoryIds:Object.fromEntries(Object.entries(s).map(([f,h])=>[f,[...h]]))});continue}if(!J(l))continue;const u=lt(l.type);if(u===It){const p=gi(l);if(p){const f=dt(p.collectionId,p.workflowId),h=s[f]??=[];h.includes(p.historyId)||h.push(p.historyId)}}if(u===yt){const p=bi(l.input);p&&c(p);continue}if(X(l)||ut(l)){i(),t.push({kind:"tool",part:l,key:`tool-${d}`});continue}}return i(),t}const wi=r.objectType({isError:r.literalType(!1),data:r.objectType({collectionId:r.stringType().min(1),workflowId:r.stringType().min(1),historyId:r.stringType().min(1)})});function gi(e){if(e.state!=="output-available")return;const t=wi.safeParse(e.output);return t.success?t.data.data:void 0}function bi(e){if(e==null||typeof e!="object")return;const t=e.message;if(typeof t!="string")return;const o=t.trim();return o.length>0?o:void 0}function vi(e){return e.filter(t=>t.type==="text").map(t=>t.text??"").join("")}function Ti(e){return Oe.useQuery({queryKey:a.aiChatKeys.detail(e??""),queryFn:async()=>e?await a.AiChatServiceFactory.getInstance().findOne(e)??null:null,enabled:!!e})}function Si(e){return Oe.useInfiniteQuery({queryKey:a.aiChatKeys.infiniteHistory(e),initialPageParam:0,queryFn:async({pageParam:t})=>a.AiChatServiceFactory.getInstance().findRecentChatsPage({offset:t,limit:e}),getNextPageParam:t=>t.hasMore?t.nextOffset:void 0})}exports.AI_TAB=ht;exports.AiConversationContext=xe;exports.CHANGE_ACTION=k;exports.LOCATION_TO_FIELD=j;exports.TOOL_APPROVAL_ACTION_BUTTON_LABELS=mt;exports.TOOL_APPROVAL_BUTTON_LABELS=ft;exports.denyPendingApprovals=hi;exports.getApiMetadataBlueprint=Ue;exports.getContentItems=Ii;exports.getCurrentTabBlueprint=Pe;exports.getMessageTextContent=vi;exports.hasPendingApprovalMessage=mi;exports.isApprovalRequested=X;exports.isApprovalSettled=ut;exports.isToolApprovalPart=J;exports.manageCollectionBlueprint=Me;exports.manageEnvironmentBlueprint=Le;exports.openOrFocusOperationEditorTab=Ve;exports.openTabBlueprint=Ke;exports.operationListItemToCollectionOperation=Ge;exports.parseToolName=lt;exports.registerBuiltInTools=fi;exports.reportStatusBlueprint=Je;exports.resolveOperation=Ye;exports.resolveRemovalTarget=nt;exports.resolveStepOrDraftData=ze;exports.runRequestBlueprint=Xe;exports.runWorkflowBlueprint=Qe;exports.searchBlueprint=Ze;exports.updateSecurityBlueprint=st;exports.updateStepBlueprint=it;exports.useAiChat=Ti;exports.useAiConversationContext=ho;exports.useInfiniteChatHistory=Si;exports.webSearchBlueprint=at;exports.workflowRunKey=dt;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useContext as zt, createContext as Ht } from "react";
|
|
2
|
-
import { R as Gt, A as be, aR as se, aS as Vt, aT as Kt, aU as Jt, ac as x, a as ue, aH as Y, aV as pt, aW as Oe, aG as Ae, aX as ft, aY as pe, aZ as ee, c as b, a_ as Qt, an as G, al as V, a$ as mt, b0 as fe, am as Ee, b1 as Xt, b2 as Zt, b3 as eo, b4 as to, b5 as oo, b6 as no, b7 as ro, af as K, b8 as so, ag as te, aa as ao, b9 as io, ba as co, bb as ht, bc as It, bd as lo, be as wt, bf as yt, bg as uo, ai as J, bh as po, ab as vt, bi as $e, aB as gt, bj as fo, bk as mo, bl as Me, F as k, bm as Fe, bn as ho, bo as Be, bp as Io, bq as wo, br as yo, a9 as bt, a8 as kt } from "./replay-index-
|
|
3
|
-
import { b as C, f as St, a as Tt, c as Ct, d as me, e as Ot, i as je, h as xe, R as z, j as vo, k as go, p as bo, s as Ye, l as ko } from "./replay-db-
|
|
4
|
-
import { b as So, o as To, d as Co, e as p, u as he, f as i, h as R, j as E, n as A, k as j, m as I, q as T, r as _e, t as oe, v as Ie, Z as H, w as Oo, x as ze, c as Ao, s as Eo, y as $o } from "./replay-create-model-
|
|
5
|
-
import { g as xo, e as He, a as _o, b as Ro, c as Ge, d as Po, f as qo } from "./replay-SemanticSearchService-
|
|
2
|
+
import { R as Gt, A as be, aR as se, aS as Vt, aT as Kt, aU as Jt, ac as x, a as ue, aH as Y, aV as pt, aW as Oe, aG as Ae, aX as ft, aY as pe, aZ as ee, c as b, a_ as Qt, an as G, al as V, a$ as mt, b0 as fe, am as Ee, b1 as Xt, b2 as Zt, b3 as eo, b4 as to, b5 as oo, b6 as no, b7 as ro, af as K, b8 as so, ag as te, aa as ao, b9 as io, ba as co, bb as ht, bc as It, bd as lo, be as wt, bf as yt, bg as uo, ai as J, bh as po, ab as vt, bi as $e, aB as gt, bj as fo, bk as mo, bl as Me, F as k, bm as Fe, bn as ho, bo as Be, bp as Io, bq as wo, br as yo, a9 as bt, a8 as kt } from "./replay-index-B0ZnzCe0.js";
|
|
3
|
+
import { b as C, f as St, a as Tt, c as Ct, d as me, e as Ot, i as je, h as xe, R as z, j as vo, k as go, p as bo, s as Ye, l as ko } from "./replay-db-G0nB5gsK.js";
|
|
4
|
+
import { b as So, o as To, d as Co, e as p, u as he, f as i, h as R, j as E, n as A, k as j, m as I, q as T, r as _e, t as oe, v as Ie, Z as H, w as Oo, x as ze, c as Ao, s as Eo, y as $o } from "./replay-create-model-EqVbPv70.js";
|
|
5
|
+
import { g as xo, e as He, a as _o, b as Ro, c as Ge, d as Po, f as qo } from "./replay-SemanticSearchService-CAmU7U_y.js";
|
|
6
6
|
import { useInfiniteQuery as No, useQuery as Uo } from "@tanstack/react-query";
|
|
7
7
|
const ae = {
|
|
8
8
|
path: "pathParameters",
|
|
@@ -3030,7 +3030,7 @@ function ct(e, t, o, n) {
|
|
|
3030
3030
|
} : null;
|
|
3031
3031
|
}
|
|
3032
3032
|
function fi(e, t, o) {
|
|
3033
|
-
let n = e;
|
|
3033
|
+
let n = [...e];
|
|
3034
3034
|
const r = [], s = t.filter(
|
|
3035
3035
|
(c) => c.action !== _.REMOVE
|
|
3036
3036
|
), a = t.filter(
|
|
@@ -3052,7 +3052,7 @@ function fi(e, t, o) {
|
|
|
3052
3052
|
ok: !1,
|
|
3053
3053
|
message: `Scheme '${c.schemeId}' already exists${o} as ${w.securityType}, not ${c.type}. Match the documented scheme type (plain http/bearer -> JWT with data.token; OAuth 2.0 only for grant-based flows), or use action "update" at index ${m} to intentionally change the type.`
|
|
3054
3054
|
};
|
|
3055
|
-
n
|
|
3055
|
+
n[m] = ke(
|
|
3056
3056
|
structuredClone(w),
|
|
3057
3057
|
c
|
|
3058
3058
|
), r.push(
|
|
@@ -3069,7 +3069,7 @@ function fi(e, t, o) {
|
|
|
3069
3069
|
message: `grantType is required when adding ${c.type} security with flow values${o}. For a plain http/bearer token use type "${k.JWT}" with data.token instead.`
|
|
3070
3070
|
};
|
|
3071
3071
|
const v = ke(Fe(), c);
|
|
3072
|
-
n =
|
|
3072
|
+
f ? n = [v] : n.push(v), r.push(
|
|
3073
3073
|
y(
|
|
3074
3074
|
"applied",
|
|
3075
3075
|
`Added ${c.type} security (index: ${n.length - 1})${o}`
|
|
@@ -3094,7 +3094,7 @@ function fi(e, t, o) {
|
|
|
3094
3094
|
message: `schemeId mismatch at index ${c.index}. Expected ${f ?? "none"}.`
|
|
3095
3095
|
};
|
|
3096
3096
|
}
|
|
3097
|
-
n
|
|
3097
|
+
n[c.index] = ke(structuredClone(d), c), r.push(
|
|
3098
3098
|
y("applied", `Updated ${c.type} at index ${c.index}${o}`)
|
|
3099
3099
|
);
|
|
3100
3100
|
}
|
|
@@ -3576,7 +3576,6 @@ function Hi(e) {
|
|
|
3576
3576
|
tools: t,
|
|
3577
3577
|
toolChoice: "required",
|
|
3578
3578
|
stopWhen: $o("web_search"),
|
|
3579
|
-
temperature: 0,
|
|
3580
3579
|
abortSignal: r.abortSignal
|
|
3581
3580
|
}).text
|
|
3582
3581
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./replay-create-model-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./replay-create-model-jiStWNur.js"),n=require("./replay-index-DHpZ_Le1.js"),l=require("./replay-defaults-DVvOnvnR.js");async function s(t,a,o,i){try{const e=r.createModel({provider:t,modelId:o,apiKey:a});return await r.generateText({model:e,prompt:l.VALIDATION_PROMPT,maxOutputTokens:n.MAX_OUTPUT_TOKENS_FOR_VALIDATION,abortSignal:i?.abortSignal}),{valid:!0}}catch(e){if(e instanceof Error&&e.name==="AbortError")throw e;return{valid:!1,error:e instanceof Error&&e.message.length>0?e.message:"Validation failed. Please try again."}}}exports.validateApiKey=s;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as i, g as n } from "./replay-create-model-
|
|
2
|
-
import { M as s } from "./replay-index-
|
|
1
|
+
import { c as i, g as n } from "./replay-create-model-EqVbPv70.js";
|
|
2
|
+
import { M as s } from "./replay-index-B0ZnzCe0.js";
|
|
3
3
|
import { V as l } from "./replay-defaults-CzR6jw9a.js";
|
|
4
4
|
async function g(a, e, t, o) {
|
|
5
5
|
try {
|
package/dist/replay.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./replay-index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./replay-index-DHpZ_Le1.js"),t=require("./replay-oauth2-redirect-handler-BfZRvm6l.js");exports.AI_PROVIDERS=e.AI_PROVIDERS;exports.AiPanelContext=e.AiPanelContext;exports.EmbeddedReplay=e.EmbeddedReplay;exports.Modal=e.Modal;exports.REUNITE_AI_PROVIDER=e.REUNITE_AI_PROVIDER;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.createResource=e.createResource;exports.getCurrentTheme=e.getCurrentTheme;exports.loadAgentLoop=e.loadAgentLoop;exports.makeProviderRecord=e.makeProviderRecord;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.d.ts
CHANGED
|
@@ -83,6 +83,9 @@ export declare type ApiEntry = {
|
|
|
83
83
|
kind: 'openapi';
|
|
84
84
|
definition: {
|
|
85
85
|
document: OpenAPIDefinition;
|
|
86
|
+
graphql?: {
|
|
87
|
+
sdl: string;
|
|
88
|
+
};
|
|
86
89
|
};
|
|
87
90
|
operation?: OperationEntry;
|
|
88
91
|
};
|
|
@@ -135,7 +138,8 @@ declare type ClientCredentialsOAuthFlowsObject = {
|
|
|
135
138
|
scopes: Record<string, string>;
|
|
136
139
|
};
|
|
137
140
|
|
|
138
|
-
|
|
141
|
+
/** Replay gives `operationId` only when it resolves the operation of a step. */
|
|
142
|
+
declare type ConvertOperationFunction = (path: string, method: string, openAPI: any, operationId?: string) => OpenAPIOperation_2 | undefined;
|
|
139
143
|
|
|
140
144
|
/**
|
|
141
145
|
* Canonical URI for Replay telemetry `data[]` items.
|
|
@@ -206,6 +210,7 @@ declare type InputSettings = {
|
|
|
206
210
|
HTTPSnippet?: any;
|
|
207
211
|
getOperationUrl?: GetOperationURLFunction;
|
|
208
212
|
onRequestReset?: () => void;
|
|
213
|
+
onRequestSent?: (isSuccess: boolean) => void;
|
|
209
214
|
telemetry?: TelemetryConfig;
|
|
210
215
|
hideOtherSecuritySchemes?: boolean;
|
|
211
216
|
layout?: ReplayLayout;
|
package/dist/replay.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as s, ax as r, bQ as t, bR as l, R as o, bS as b, bT as R, N as d, bU as m, bV as p, O as n, bW as y, bX as A, bY as T, bZ as i, aw as u, av as O, b_ as h, b$ as E } from "./replay-index-
|
|
1
|
+
import { A as s, ax as r, bQ as t, bR as l, R as o, bS as b, bT as R, N as d, bU as m, bV as p, O as n, bW as y, bX as A, bY as T, bZ as i, aw as u, av as O, b_ as h, b$ as E } from "./replay-index-B0ZnzCe0.js";
|
|
2
2
|
import { O as C, h as I } from "./replay-oauth2-redirect-handler-Bq6bpZMm.js";
|
|
3
3
|
export {
|
|
4
4
|
s as AI_PROVIDERS,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redocly/replay",
|
|
3
|
-
"version": "0.29.
|
|
3
|
+
"version": "0.29.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/replay.cjs",
|
|
6
6
|
"module": "./dist/replay.js",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {
|
|
19
|
-
"@redocly/theme": "0.70.
|
|
19
|
+
"@redocly/theme": "0.70.1",
|
|
20
20
|
"@tanstack/react-query": "5.62.3",
|
|
21
21
|
"react": "^19.2.7",
|
|
22
22
|
"react-dom": "^19.2.7",
|
|
@@ -51,9 +51,9 @@
|
|
|
51
51
|
"@lezer/highlight": "^1.1.6",
|
|
52
52
|
"@noble/hashes": "^1.8.0",
|
|
53
53
|
"@opentelemetry/api": "1.9.1",
|
|
54
|
-
"@redocly/openapi-core": "2.
|
|
54
|
+
"@redocly/openapi-core": "2.62.1",
|
|
55
55
|
"@redocly/replay-asyncapi-sdk": "0.0.1",
|
|
56
|
-
"@redocly/respect-core": "2.
|
|
56
|
+
"@redocly/respect-core": "2.62.1",
|
|
57
57
|
"@redocly/vscode-json-languageservice": "^3.4.9",
|
|
58
58
|
"@redocly/tooling-test-utils": "0.0.0",
|
|
59
59
|
"@tauri-apps/api": "2.4.1",
|