@redocly/openapi-docs 3.25.0-next.4 → 3.25.0-next.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (23) hide show
  1. package/dist/{redocly-openapi-docs.min.AiChatProvider-BtZYXzQL.js → redocly-openapi-docs.min.AiChatProvider-DyqyxfQD.js} +1 -1
  2. package/dist/{redocly-openapi-docs.min.AiChatSqliteDBStorage-CMWIhurV.js → redocly-openapi-docs.min.AiChatSqliteDBStorage-Btm70b2a.js} +1 -1
  3. package/dist/{redocly-openapi-docs.min.AiPanel-CzVBo_SJ.js → redocly-openapi-docs.min.AiPanel-C8snqiT5.js} +17 -17
  4. package/dist/{redocly-openapi-docs.min.FileWatcher-DjTW24VD.js → redocly-openapi-docs.min.FileWatcher-CTBl8Rf-.js} +1 -1
  5. package/dist/{redocly-openapi-docs.min.SemanticSearchService-BdbJAsUF.js → redocly-openapi-docs.min.SemanticSearchService-CkqlO6WP.js} +1 -1
  6. package/dist/{redocly-openapi-docs.min.SqliteDBStorage-DicEB6xf.js → redocly-openapi-docs.min.SqliteDBStorage-CrL1Ye64.js} +1 -1
  7. package/dist/{redocly-openapi-docs.min.TauriFileSystemAdapter-Bzf6nZVE.js → redocly-openapi-docs.min.TauriFileSystemAdapter-Y9bUtY4S.js} +1 -1
  8. package/dist/{redocly-openapi-docs.min.TauriRootStorage-Cg1lmYY7.js → redocly-openapi-docs.min.TauriRootStorage-B5ol7t4s.js} +1 -1
  9. package/dist/{redocly-openapi-docs.min.ai-chat-mappers-BfCwakK5.js → redocly-openapi-docs.min.ai-chat-mappers-DLLPHOmO.js} +1 -1
  10. package/dist/redocly-openapi-docs.min.external-resolver-CBwcWqM9.js +2 -0
  11. package/dist/{redocly-openapi-docs.min.index-U6ORLz-U.js → redocly-openapi-docs.min.index-BrDq2HFN.js} +1 -1
  12. package/dist/{redocly-openapi-docs.min.index-CHKNddXa.js → redocly-openapi-docs.min.index-CEXQXK-m.js} +1 -1
  13. package/dist/{redocly-openapi-docs.min.index-BnxwvVhR.js → redocly-openapi-docs.min.index-CGR2xzEw.js} +1 -1
  14. package/dist/{redocly-openapi-docs.min.index-BXAn8eur.js → redocly-openapi-docs.min.index-Dt-QwDkf.js} +1113 -1113
  15. package/dist/redocly-openapi-docs.min.js +1 -1
  16. package/dist/{redocly-openapi-docs.min.lint-jyJiMT1p.js → redocly-openapi-docs.min.lint-DBvVDQqS.js} +2 -2
  17. package/dist/{redocly-openapi-docs.min.lint-graphql-BLIlXit9.js → redocly-openapi-docs.min.lint-graphql-CVRQfjxQ.js} +1 -1
  18. package/dist/{redocly-openapi-docs.min.respect-run-CTD2qNkS.js → redocly-openapi-docs.min.respect-run-BhGXKGyB.js} +1 -1
  19. package/dist/{redocly-openapi-docs.min.standalone-CS00-kVE.js → redocly-openapi-docs.min.standalone-DweQeOg3.js} +550 -550
  20. package/dist/{redocly-openapi-docs.min.tauri-path-Dw7ZXd_2.js → redocly-openapi-docs.min.tauri-path-DPZWtWAC.js} +1 -1
  21. package/dist/{redocly-openapi-docs.min.useAiChatQueries-BH1oro3k.js → redocly-openapi-docs.min.useAiChatQueries-DNV_5tU7.js} +2 -2
  22. package/package.json +13 -4
  23. package/dist/redocly-openapi-docs.min.external-resolver-DftxHgbt.js +0 -2
@@ -1 +1 @@
1
- import{G as ht,S as N,H as ut,J as O,K as B,L as ft,c as F,z as pt,M as dt,N as mt,P as vt}from"./redocly-openapi-docs.min.index-BXAn8eur.js";import{p as G}from"./redocly-openapi-docs.min.promise-map-limit-Db_42GvV.js";import{TauriFileSystemAdapter as H}from"./redocly-openapi-docs.min.TauriFileSystemAdapter-Bzf6nZVE.js";import{d as wt,w as k}from"./redocly-openapi-docs.min.standalone-CS00-kVE.js";var R={exports:{}},X;function yt(){return X||(X=1,(function(n){var t=Object.prototype.hasOwnProperty,e="~";function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(e=!1));function c(s,o,l){this.fn=s,this.context=o,this.once=l||!1}function a(s,o,l,y,g){if(typeof l!="function")throw new TypeError("The listener must be a function");var m=new c(l,y||s,g),w=e?e+o:o;return s._events[w]?s._events[w].fn?s._events[w]=[s._events[w],m]:s._events[w].push(m):(s._events[w]=m,s._eventsCount++),s}function f(s,o){--s._eventsCount===0?s._events=new i:delete s._events[o]}function h(){this._events=new i,this._eventsCount=0}h.prototype.eventNames=function(){var s=[],o,l;if(this._eventsCount===0)return s;for(l in o=this._events)t.call(o,l)&&s.push(e?l.slice(1):l);return Object.getOwnPropertySymbols?s.concat(Object.getOwnPropertySymbols(o)):s},h.prototype.listeners=function(s){var o=e?e+s:s,l=this._events[o];if(!l)return[];if(l.fn)return[l.fn];for(var y=0,g=l.length,m=new Array(g);y<g;y++)m[y]=l[y].fn;return m},h.prototype.listenerCount=function(s){var o=e?e+s:s,l=this._events[o];return l?l.fn?1:l.length:0},h.prototype.emit=function(s,o,l,y,g,m){var w=e?e+s:s;if(!this._events[w])return!1;var u=this._events[w],S=arguments.length,P,v;if(u.fn){switch(u.once&&this.removeListener(s,u.fn,void 0,!0),S){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,o),!0;case 3:return u.fn.call(u.context,o,l),!0;case 4:return u.fn.call(u.context,o,l,y),!0;case 5:return u.fn.call(u.context,o,l,y,g),!0;case 6:return u.fn.call(u.context,o,l,y,g,m),!0}for(v=1,P=new Array(S-1);v<S;v++)P[v-1]=arguments[v];u.fn.apply(u.context,P)}else{var lt=u.length,I;for(v=0;v<lt;v++)switch(u[v].once&&this.removeListener(s,u[v].fn,void 0,!0),S){case 1:u[v].fn.call(u[v].context);break;case 2:u[v].fn.call(u[v].context,o);break;case 3:u[v].fn.call(u[v].context,o,l);break;case 4:u[v].fn.call(u[v].context,o,l,y);break;default:if(!P)for(I=1,P=new Array(S-1);I<S;I++)P[I-1]=arguments[I];u[v].fn.apply(u[v].context,P)}}return!0},h.prototype.on=function(s,o,l){return a(this,s,o,l,!1)},h.prototype.once=function(s,o,l){return a(this,s,o,l,!0)},h.prototype.removeListener=function(s,o,l,y){var g=e?e+s:s;if(!this._events[g])return this;if(!o)return f(this,g),this;var m=this._events[g];if(m.fn)m.fn===o&&(!y||m.once)&&(!l||m.context===l)&&f(this,g);else{for(var w=0,u=[],S=m.length;w<S;w++)(m[w].fn!==o||y&&!m[w].once||l&&m[w].context!==l)&&u.push(m[w]);u.length?this._events[g]=u.length===1?u[0]:u:f(this,g)}return this},h.prototype.removeAllListeners=function(s){var o;return s?(o=e?e+s:s,this._events[o]&&f(this,o)):(this._events=new i,this._eventsCount=0),this},h.prototype.off=h.prototype.removeListener,h.prototype.addListener=h.prototype.on,h.prefixed=e,h.EventEmitter=h,n.exports=h})(R)),R.exports}var gt=yt();const bt=wt(gt);class Z extends Error{constructor(t){super(t),this.name="TimeoutError"}}let Et=class extends Error{constructor(n){super(),this.name="AbortError",this.message=n}};const tt=n=>globalThis.DOMException===void 0?new Et(n):new DOMException(n),et=n=>{const t=n.reason===void 0?tt("This operation was aborted."):n.reason;return t instanceof Error?t:tt(t)};function St(n,t,e,i){let c;const a=new Promise((f,h)=>{if(typeof t!="number"||Math.sign(t)!==1)throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${t}\``);if(t===Number.POSITIVE_INFINITY){f(n);return}if(i={customTimers:{setTimeout,clearTimeout},...i},i.signal){const{signal:s}=i;s.aborted&&h(et(s)),s.addEventListener("abort",()=>{h(et(s))})}c=i.customTimers.setTimeout.call(void 0,()=>{const s=`Promise timed out after ${t} milliseconds`,o=e instanceof Error?e:new Z(s);typeof n.cancel=="function"&&n.cancel(),h(o)},t),(async()=>{try{f(await n)}catch(s){h(s)}finally{i.customTimers.clearTimeout.call(void 0,c)}})()});return a.clear=()=>{clearTimeout(c),c=void 0},a}function _t(n,t,e){let i=0,c=n.length;for(;c>0;){const a=Math.trunc(c/2);let f=i+a;e(n[f],t)<=0?(i=++f,c-=a+1):c=a}return i}var x=function(n,t,e,i){if(e==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?n!==t||!i:!t.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?i:e==="a"?i.call(n):i?i.value:t.get(n)},C;class Ct{constructor(){C.set(this,[])}enqueue(t,e){e={priority:0,...e};const i={priority:e.priority,run:t};if(this.size&&x(this,C,"f")[this.size-1].priority>=e.priority){x(this,C,"f").push(i);return}const c=_t(x(this,C,"f"),i,(a,f)=>f.priority-a.priority);x(this,C,"f").splice(c,0,i)}dequeue(){return x(this,C,"f").shift()?.run}filter(t){return x(this,C,"f").filter(e=>e.priority===t.priority).map(e=>e.run)}get size(){return x(this,C,"f").length}}C=new WeakMap;var p=function(n,t,e,i,c){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!c)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?n!==t||!c:!t.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?c.call(n,e):c?c.value=e:t.set(n,e),e},r=function(n,t,e,i){if(e==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?n!==t||!i:!t.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?i:e==="a"?i.call(n):i?i.value:t.get(n)},d,L,M,T,D,W,$,_,z,b,q,E,j,A,K,it,st,rt,nt,at,Y,Q,J,U,ot,V;class ct extends Error{}class Tt extends bt{constructor(t){var e,i,c,a;if(super(),d.add(this),L.set(this,void 0),M.set(this,void 0),T.set(this,0),D.set(this,void 0),W.set(this,void 0),$.set(this,0),_.set(this,void 0),z.set(this,void 0),b.set(this,void 0),q.set(this,void 0),E.set(this,0),j.set(this,void 0),A.set(this,void 0),K.set(this,void 0),Object.defineProperty(this,"timeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),t={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:Ct,...t},!(typeof t.intervalCap=="number"&&t.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${(i=(e=t.intervalCap)===null||e===void 0?void 0:e.toString())!==null&&i!==void 0?i:""}\` (${typeof t.intervalCap})`);if(t.interval===void 0||!(Number.isFinite(t.interval)&&t.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${(a=(c=t.interval)===null||c===void 0?void 0:c.toString())!==null&&a!==void 0?a:""}\` (${typeof t.interval})`);p(this,L,t.carryoverConcurrencyCount,"f"),p(this,M,t.intervalCap===Number.POSITIVE_INFINITY||t.interval===0,"f"),p(this,D,t.intervalCap,"f"),p(this,W,t.interval,"f"),p(this,b,new t.queueClass,"f"),p(this,q,t.queueClass,"f"),this.concurrency=t.concurrency,this.timeout=t.timeout,p(this,K,t.throwOnTimeout===!0,"f"),p(this,A,t.autoStart===!1,"f")}get concurrency(){return r(this,j,"f")}set concurrency(t){if(!(typeof t=="number"&&t>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${t}\` (${typeof t})`);p(this,j,t,"f"),r(this,d,"m",U).call(this)}async add(t,e={}){return e={timeout:this.timeout,throwOnTimeout:r(this,K,"f"),...e},new Promise((i,c)=>{r(this,b,"f").enqueue(async()=>{var a,f,h;p(this,E,(f=r(this,E,"f"),f++,f),"f"),p(this,T,(h=r(this,T,"f"),h++,h),"f");try{if(!((a=e.signal)===null||a===void 0)&&a.aborted)throw new ct("The task was aborted.");let s=t({signal:e.signal});e.timeout&&(s=St(Promise.resolve(s),e.timeout)),e.signal&&(s=Promise.race([s,r(this,d,"m",ot).call(this,e.signal)]));const o=await s;i(o),this.emit("completed",o)}catch(s){if(s instanceof Z&&!e.throwOnTimeout){i();return}c(s),this.emit("error",s)}finally{r(this,d,"m",rt).call(this)}},e),this.emit("add"),r(this,d,"m",Y).call(this)})}async addAll(t,e){return Promise.all(t.map(async i=>this.add(i,e)))}start(){return r(this,A,"f")?(p(this,A,!1,"f"),r(this,d,"m",U).call(this),this):this}pause(){p(this,A,!0,"f")}clear(){p(this,b,new(r(this,q,"f")),"f")}async onEmpty(){r(this,b,"f").size!==0&&await r(this,d,"m",V).call(this,"empty")}async onSizeLessThan(t){r(this,b,"f").size<t||await r(this,d,"m",V).call(this,"next",()=>r(this,b,"f").size<t)}async onIdle(){r(this,E,"f")===0&&r(this,b,"f").size===0||await r(this,d,"m",V).call(this,"idle")}get size(){return r(this,b,"f").size}sizeBy(t){return r(this,b,"f").filter(t).length}get pending(){return r(this,E,"f")}get isPaused(){return r(this,A,"f")}}L=new WeakMap,M=new WeakMap,T=new WeakMap,D=new WeakMap,W=new WeakMap,$=new WeakMap,_=new WeakMap,z=new WeakMap,b=new WeakMap,q=new WeakMap,E=new WeakMap,j=new WeakMap,A=new WeakMap,K=new WeakMap,d=new WeakSet,it=function(){return r(this,M,"f")||r(this,T,"f")<r(this,D,"f")},st=function(){return r(this,E,"f")<r(this,j,"f")},rt=function(){var n;p(this,E,(n=r(this,E,"f"),n--,n),"f"),r(this,d,"m",Y).call(this),this.emit("next")},nt=function(){r(this,d,"m",J).call(this),r(this,d,"m",Q).call(this),p(this,z,void 0,"f")},at=function(){const n=Date.now();if(r(this,_,"f")===void 0){const t=r(this,$,"f")-n;if(t<0)p(this,T,r(this,L,"f")?r(this,E,"f"):0,"f");else return r(this,z,"f")===void 0&&p(this,z,setTimeout(()=>{r(this,d,"m",nt).call(this)},t),"f"),!0}return!1},Y=function(){if(r(this,b,"f").size===0)return r(this,_,"f")&&clearInterval(r(this,_,"f")),p(this,_,void 0,"f"),this.emit("empty"),r(this,E,"f")===0&&this.emit("idle"),!1;if(!r(this,A,"f")){const n=!r(this,d,"a",at);if(r(this,d,"a",it)&&r(this,d,"a",st)){const t=r(this,b,"f").dequeue();return t?(this.emit("active"),t(),n&&r(this,d,"m",Q).call(this),!0):!1}}return!1},Q=function(){r(this,M,"f")||r(this,_,"f")!==void 0||(p(this,_,setInterval(()=>{r(this,d,"m",J).call(this)},r(this,W,"f")),"f"),p(this,$,Date.now()+r(this,W,"f"),"f"))},J=function(){r(this,T,"f")===0&&r(this,E,"f")===0&&r(this,_,"f")&&(clearInterval(r(this,_,"f")),p(this,_,void 0,"f")),p(this,T,r(this,L,"f")?r(this,E,"f"):0,"f"),r(this,d,"m",U).call(this)},U=function(){for(;r(this,d,"m",Y).call(this););},ot=async function(n){return new Promise((t,e)=>{n.addEventListener("abort",()=>{e(new ct("The task was aborted."))},{once:!0})})},V=async function(n,t){return new Promise(e=>{const i=()=>{t&&!t()||(this.off(n,i),e())};this.on(n,i)})};class At{constructor(t){this.apisStorage=t}apisStorage;data=new Map;loading=new Set;pQueue=new Tt({concurrency:20});async get(t){return this.data.has(t)?this.data.get(t)??null:(await this.loadAndParse(t),this.data.get(t)??null)}async load(t,e=!1){this.data.has(t)&&!e||await this.loadAndParse(t,e)}async loadAndParse(t,e=!1){if(this.loading.has(t)){await this.pQueue.add(()=>this.get(t));return}e&&this.data.delete(t),this.loading.add(t),await this.pQueue.add(async()=>{const i=ht(t)?N.WEB:N.FS,c=i===N.WEB?t:await this.apisStorage.getAbsolutePath(t);try{const{definition:a,fileDependencies:f}=await ut(c);if(!a){this.data.set(t,null),await O(t);return}const h=this.apisStorage.parse({uri:t,type:i,content:a});this.data.set(t,{...h,fileDependencies:f}),await O(t)}catch(a){if(this.data.set(t,null),a instanceof Error&&(a.message.includes("Unsupported specification")||a.message.includes("File not found"))){await O(t);return}console.info("Error loading api "+t,a),await B(t,a);return}}),this.loading.delete(t)}get size(){return this.data.size}delete(t){this.data.delete(t)}getAll(){return Array.from(this.data.values()).filter(t=>t!==null)}clear(){this.data.clear(),this.loading.clear()}}class Pt extends ft{apiLoader;constructor(t,e,i){const c=new H(t.systemFilesDir),a=new H(t.userFilesDir);super(c,a,t,!0,!1,e,i),this.apiLoader=new At(this.apisStorage),this.setupWriteListeners(a)}setupWriteListeners(t){t.on("write-start",e=>{this.addWatchExcludedId(e)}),t.on("write-end",e=>{this.removeWatchExcludedId(e)})}async read(){const t=this.telemetry?.startSpan("com.redocly.storage.read",[F("storageOperation","read","storage")],void 0),e=this.telemetry?.startSpan("com.redocly.storage.loadUserState",[F("storageOperation","loadUserState","storage")],t?.parentCtx),[i,c,a]=await Promise.all([this.activeEnvironmentIdStorage.read(),this.tabsStateStorage.read(),this.environmentsStorage.read()]);e?.setAttribute("status","completed"),e?.setAttribute("environmentCount",a.length),e?.setStatus(k.OK),e?.end();const{apiFiles:f,collectionFiles:h}=await this.detectProjectFiles(t);await this.loadAndParseApis(f,t);const s=(await this.loadAndParseCollections(h,t)).filter(l=>l!==null);this.collectionsStorage.setItemIds(s.map(l=>l.id));const o=this.apiLoader.getAll();return this.apisStorage.setItemIds(o.map(l=>l.id)),t?.setAttribute("status","completed"),t?.setStatus(k.OK),t?.end(),{project:this.project,activeEnvironmentId:i,tabsState:c,environments:a,apis:o,collections:s,configFileError:this.getEnvironmentsConfigError()}}async detectProjectFiles(t){const e=this.telemetry?.startSpan("com.redocly.storage.detectFiles",[F("storageOperation","detectFiles","storage")],t?.parentCtx),{api_files:i,collection_files:c}=await pt("fs_scan",{dir:this.project.userFilesDir});return e?.setAttribute("status","completed"),e?.setAttribute("filesCount",i.length+c.length),e?.setAttribute("apiFilesCount",i.length),e?.setAttribute("collectionFilesCount",c.length),e?.setStatus(k.OK),e?.end(),{apiFiles:i,collectionFiles:c}}readEnviroments(){return this.environmentsStorage.read()}deleteApiFromCache(t){this.apiLoader.delete(t)}async loadAndParseApis(t,e,i=!1){const c=this.telemetry?.startSpan("com.redocly.storage.parseApis",[{...F("storageOperation","parseApis","storage"),apisCount:t.length}],e?.parentCtx),a=await G(t,20,async f=>{try{return await this.apiLoader.load(f.relative_path,i),this.apiLoader.get(f.relative_path)}catch(h){return console.info(`Error parsing YAML/JSON file ${f.absolute_path}:`,h),await B(f.relative_path,h),null}});return c?.setAttribute("status","completed"),c?.setAttribute("parsedApisCount",this.apiLoader.size),c?.setStatus(k.OK),c?.end(),a}async loadAndParseCollections(t,e){const i=this.telemetry?.startSpan("com.redocly.storage.parseCollections",[{...F("storageOperation","parseCollections","storage"),collectionsCount:t.length}],e?.parentCtx),c=await G(t,20,async a=>{try{const f=await this.userFilesStorage.get(a.relative_path);if(!f)return null;const h=dt.load(f);if(typeof h!="object"||h===null||typeof h.arazzo!="string")return await O(a.relative_path),null;const s=[];await Promise.all(h.sourceDescriptions?.map(async y=>{const g=y.type,m=y.url,w=!g||g==="openapi",u=await mt({projectPath:this.project.userFilesDir,apiUrl:m,collectionId:a.relative_path});if(w){const S=await this.apiLoader.get(u);S&&s.push(S)}}));const o=await vt.join(this.project.userFilesDir,a.relative_path),l=await this.collectionsStorage.parse({uri:a.relative_path,type:N.FS,content:h,fileDependencies:new Set([o])},s);return await O(a.relative_path),l}catch(f){return console.info(`Error parsing Arazzo file ${a.relative_path}:`,f),await B(a.relative_path,f),null}});return i?.setAttribute("status","completed"),i?.setAttribute("parsedCollectionsCount",c.length),i?.setStatus(k.OK),i?.end(),c}}export{Pt as TauriRootStorage};
1
+ import{G as ht,S as N,H as ut,J as O,K as B,L as ft,c as F,z as pt,M as dt,N as mt,P as vt}from"./redocly-openapi-docs.min.index-Dt-QwDkf.js";import{p as G}from"./redocly-openapi-docs.min.promise-map-limit-Db_42GvV.js";import{TauriFileSystemAdapter as H}from"./redocly-openapi-docs.min.TauriFileSystemAdapter-Y9bUtY4S.js";import{d as wt,w as k}from"./redocly-openapi-docs.min.standalone-DweQeOg3.js";var R={exports:{}},X;function yt(){return X||(X=1,(function(n){var t=Object.prototype.hasOwnProperty,e="~";function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(e=!1));function c(s,o,l){this.fn=s,this.context=o,this.once=l||!1}function a(s,o,l,y,g){if(typeof l!="function")throw new TypeError("The listener must be a function");var m=new c(l,y||s,g),w=e?e+o:o;return s._events[w]?s._events[w].fn?s._events[w]=[s._events[w],m]:s._events[w].push(m):(s._events[w]=m,s._eventsCount++),s}function f(s,o){--s._eventsCount===0?s._events=new i:delete s._events[o]}function h(){this._events=new i,this._eventsCount=0}h.prototype.eventNames=function(){var s=[],o,l;if(this._eventsCount===0)return s;for(l in o=this._events)t.call(o,l)&&s.push(e?l.slice(1):l);return Object.getOwnPropertySymbols?s.concat(Object.getOwnPropertySymbols(o)):s},h.prototype.listeners=function(s){var o=e?e+s:s,l=this._events[o];if(!l)return[];if(l.fn)return[l.fn];for(var y=0,g=l.length,m=new Array(g);y<g;y++)m[y]=l[y].fn;return m},h.prototype.listenerCount=function(s){var o=e?e+s:s,l=this._events[o];return l?l.fn?1:l.length:0},h.prototype.emit=function(s,o,l,y,g,m){var w=e?e+s:s;if(!this._events[w])return!1;var u=this._events[w],S=arguments.length,P,v;if(u.fn){switch(u.once&&this.removeListener(s,u.fn,void 0,!0),S){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,o),!0;case 3:return u.fn.call(u.context,o,l),!0;case 4:return u.fn.call(u.context,o,l,y),!0;case 5:return u.fn.call(u.context,o,l,y,g),!0;case 6:return u.fn.call(u.context,o,l,y,g,m),!0}for(v=1,P=new Array(S-1);v<S;v++)P[v-1]=arguments[v];u.fn.apply(u.context,P)}else{var lt=u.length,I;for(v=0;v<lt;v++)switch(u[v].once&&this.removeListener(s,u[v].fn,void 0,!0),S){case 1:u[v].fn.call(u[v].context);break;case 2:u[v].fn.call(u[v].context,o);break;case 3:u[v].fn.call(u[v].context,o,l);break;case 4:u[v].fn.call(u[v].context,o,l,y);break;default:if(!P)for(I=1,P=new Array(S-1);I<S;I++)P[I-1]=arguments[I];u[v].fn.apply(u[v].context,P)}}return!0},h.prototype.on=function(s,o,l){return a(this,s,o,l,!1)},h.prototype.once=function(s,o,l){return a(this,s,o,l,!0)},h.prototype.removeListener=function(s,o,l,y){var g=e?e+s:s;if(!this._events[g])return this;if(!o)return f(this,g),this;var m=this._events[g];if(m.fn)m.fn===o&&(!y||m.once)&&(!l||m.context===l)&&f(this,g);else{for(var w=0,u=[],S=m.length;w<S;w++)(m[w].fn!==o||y&&!m[w].once||l&&m[w].context!==l)&&u.push(m[w]);u.length?this._events[g]=u.length===1?u[0]:u:f(this,g)}return this},h.prototype.removeAllListeners=function(s){var o;return s?(o=e?e+s:s,this._events[o]&&f(this,o)):(this._events=new i,this._eventsCount=0),this},h.prototype.off=h.prototype.removeListener,h.prototype.addListener=h.prototype.on,h.prefixed=e,h.EventEmitter=h,n.exports=h})(R)),R.exports}var gt=yt();const bt=wt(gt);class Z extends Error{constructor(t){super(t),this.name="TimeoutError"}}let Et=class extends Error{constructor(n){super(),this.name="AbortError",this.message=n}};const tt=n=>globalThis.DOMException===void 0?new Et(n):new DOMException(n),et=n=>{const t=n.reason===void 0?tt("This operation was aborted."):n.reason;return t instanceof Error?t:tt(t)};function St(n,t,e,i){let c;const a=new Promise((f,h)=>{if(typeof t!="number"||Math.sign(t)!==1)throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${t}\``);if(t===Number.POSITIVE_INFINITY){f(n);return}if(i={customTimers:{setTimeout,clearTimeout},...i},i.signal){const{signal:s}=i;s.aborted&&h(et(s)),s.addEventListener("abort",()=>{h(et(s))})}c=i.customTimers.setTimeout.call(void 0,()=>{const s=`Promise timed out after ${t} milliseconds`,o=e instanceof Error?e:new Z(s);typeof n.cancel=="function"&&n.cancel(),h(o)},t),(async()=>{try{f(await n)}catch(s){h(s)}finally{i.customTimers.clearTimeout.call(void 0,c)}})()});return a.clear=()=>{clearTimeout(c),c=void 0},a}function _t(n,t,e){let i=0,c=n.length;for(;c>0;){const a=Math.trunc(c/2);let f=i+a;e(n[f],t)<=0?(i=++f,c-=a+1):c=a}return i}var x=function(n,t,e,i){if(e==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?n!==t||!i:!t.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?i:e==="a"?i.call(n):i?i.value:t.get(n)},C;class Ct{constructor(){C.set(this,[])}enqueue(t,e){e={priority:0,...e};const i={priority:e.priority,run:t};if(this.size&&x(this,C,"f")[this.size-1].priority>=e.priority){x(this,C,"f").push(i);return}const c=_t(x(this,C,"f"),i,(a,f)=>f.priority-a.priority);x(this,C,"f").splice(c,0,i)}dequeue(){return x(this,C,"f").shift()?.run}filter(t){return x(this,C,"f").filter(e=>e.priority===t.priority).map(e=>e.run)}get size(){return x(this,C,"f").length}}C=new WeakMap;var p=function(n,t,e,i,c){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!c)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?n!==t||!c:!t.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?c.call(n,e):c?c.value=e:t.set(n,e),e},r=function(n,t,e,i){if(e==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?n!==t||!i:!t.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?i:e==="a"?i.call(n):i?i.value:t.get(n)},d,L,M,T,D,W,$,_,z,b,q,E,j,A,K,it,st,rt,nt,at,Y,Q,J,U,ot,V;class ct extends Error{}class Tt extends bt{constructor(t){var e,i,c,a;if(super(),d.add(this),L.set(this,void 0),M.set(this,void 0),T.set(this,0),D.set(this,void 0),W.set(this,void 0),$.set(this,0),_.set(this,void 0),z.set(this,void 0),b.set(this,void 0),q.set(this,void 0),E.set(this,0),j.set(this,void 0),A.set(this,void 0),K.set(this,void 0),Object.defineProperty(this,"timeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),t={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:Ct,...t},!(typeof t.intervalCap=="number"&&t.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${(i=(e=t.intervalCap)===null||e===void 0?void 0:e.toString())!==null&&i!==void 0?i:""}\` (${typeof t.intervalCap})`);if(t.interval===void 0||!(Number.isFinite(t.interval)&&t.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${(a=(c=t.interval)===null||c===void 0?void 0:c.toString())!==null&&a!==void 0?a:""}\` (${typeof t.interval})`);p(this,L,t.carryoverConcurrencyCount,"f"),p(this,M,t.intervalCap===Number.POSITIVE_INFINITY||t.interval===0,"f"),p(this,D,t.intervalCap,"f"),p(this,W,t.interval,"f"),p(this,b,new t.queueClass,"f"),p(this,q,t.queueClass,"f"),this.concurrency=t.concurrency,this.timeout=t.timeout,p(this,K,t.throwOnTimeout===!0,"f"),p(this,A,t.autoStart===!1,"f")}get concurrency(){return r(this,j,"f")}set concurrency(t){if(!(typeof t=="number"&&t>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${t}\` (${typeof t})`);p(this,j,t,"f"),r(this,d,"m",U).call(this)}async add(t,e={}){return e={timeout:this.timeout,throwOnTimeout:r(this,K,"f"),...e},new Promise((i,c)=>{r(this,b,"f").enqueue(async()=>{var a,f,h;p(this,E,(f=r(this,E,"f"),f++,f),"f"),p(this,T,(h=r(this,T,"f"),h++,h),"f");try{if(!((a=e.signal)===null||a===void 0)&&a.aborted)throw new ct("The task was aborted.");let s=t({signal:e.signal});e.timeout&&(s=St(Promise.resolve(s),e.timeout)),e.signal&&(s=Promise.race([s,r(this,d,"m",ot).call(this,e.signal)]));const o=await s;i(o),this.emit("completed",o)}catch(s){if(s instanceof Z&&!e.throwOnTimeout){i();return}c(s),this.emit("error",s)}finally{r(this,d,"m",rt).call(this)}},e),this.emit("add"),r(this,d,"m",Y).call(this)})}async addAll(t,e){return Promise.all(t.map(async i=>this.add(i,e)))}start(){return r(this,A,"f")?(p(this,A,!1,"f"),r(this,d,"m",U).call(this),this):this}pause(){p(this,A,!0,"f")}clear(){p(this,b,new(r(this,q,"f")),"f")}async onEmpty(){r(this,b,"f").size!==0&&await r(this,d,"m",V).call(this,"empty")}async onSizeLessThan(t){r(this,b,"f").size<t||await r(this,d,"m",V).call(this,"next",()=>r(this,b,"f").size<t)}async onIdle(){r(this,E,"f")===0&&r(this,b,"f").size===0||await r(this,d,"m",V).call(this,"idle")}get size(){return r(this,b,"f").size}sizeBy(t){return r(this,b,"f").filter(t).length}get pending(){return r(this,E,"f")}get isPaused(){return r(this,A,"f")}}L=new WeakMap,M=new WeakMap,T=new WeakMap,D=new WeakMap,W=new WeakMap,$=new WeakMap,_=new WeakMap,z=new WeakMap,b=new WeakMap,q=new WeakMap,E=new WeakMap,j=new WeakMap,A=new WeakMap,K=new WeakMap,d=new WeakSet,it=function(){return r(this,M,"f")||r(this,T,"f")<r(this,D,"f")},st=function(){return r(this,E,"f")<r(this,j,"f")},rt=function(){var n;p(this,E,(n=r(this,E,"f"),n--,n),"f"),r(this,d,"m",Y).call(this),this.emit("next")},nt=function(){r(this,d,"m",J).call(this),r(this,d,"m",Q).call(this),p(this,z,void 0,"f")},at=function(){const n=Date.now();if(r(this,_,"f")===void 0){const t=r(this,$,"f")-n;if(t<0)p(this,T,r(this,L,"f")?r(this,E,"f"):0,"f");else return r(this,z,"f")===void 0&&p(this,z,setTimeout(()=>{r(this,d,"m",nt).call(this)},t),"f"),!0}return!1},Y=function(){if(r(this,b,"f").size===0)return r(this,_,"f")&&clearInterval(r(this,_,"f")),p(this,_,void 0,"f"),this.emit("empty"),r(this,E,"f")===0&&this.emit("idle"),!1;if(!r(this,A,"f")){const n=!r(this,d,"a",at);if(r(this,d,"a",it)&&r(this,d,"a",st)){const t=r(this,b,"f").dequeue();return t?(this.emit("active"),t(),n&&r(this,d,"m",Q).call(this),!0):!1}}return!1},Q=function(){r(this,M,"f")||r(this,_,"f")!==void 0||(p(this,_,setInterval(()=>{r(this,d,"m",J).call(this)},r(this,W,"f")),"f"),p(this,$,Date.now()+r(this,W,"f"),"f"))},J=function(){r(this,T,"f")===0&&r(this,E,"f")===0&&r(this,_,"f")&&(clearInterval(r(this,_,"f")),p(this,_,void 0,"f")),p(this,T,r(this,L,"f")?r(this,E,"f"):0,"f"),r(this,d,"m",U).call(this)},U=function(){for(;r(this,d,"m",Y).call(this););},ot=async function(n){return new Promise((t,e)=>{n.addEventListener("abort",()=>{e(new ct("The task was aborted."))},{once:!0})})},V=async function(n,t){return new Promise(e=>{const i=()=>{t&&!t()||(this.off(n,i),e())};this.on(n,i)})};class At{constructor(t){this.apisStorage=t}apisStorage;data=new Map;loading=new Set;pQueue=new Tt({concurrency:20});async get(t){return this.data.has(t)?this.data.get(t)??null:(await this.loadAndParse(t),this.data.get(t)??null)}async load(t,e=!1){this.data.has(t)&&!e||await this.loadAndParse(t,e)}async loadAndParse(t,e=!1){if(this.loading.has(t)){await this.pQueue.add(()=>this.get(t));return}e&&this.data.delete(t),this.loading.add(t),await this.pQueue.add(async()=>{const i=ht(t)?N.WEB:N.FS,c=i===N.WEB?t:await this.apisStorage.getAbsolutePath(t);try{const{definition:a,fileDependencies:f}=await ut(c);if(!a){this.data.set(t,null),await O(t);return}const h=this.apisStorage.parse({uri:t,type:i,content:a});this.data.set(t,{...h,fileDependencies:f}),await O(t)}catch(a){if(this.data.set(t,null),a instanceof Error&&(a.message.includes("Unsupported specification")||a.message.includes("File not found"))){await O(t);return}console.info("Error loading api "+t,a),await B(t,a);return}}),this.loading.delete(t)}get size(){return this.data.size}delete(t){this.data.delete(t)}getAll(){return Array.from(this.data.values()).filter(t=>t!==null)}clear(){this.data.clear(),this.loading.clear()}}class Pt extends ft{apiLoader;constructor(t,e,i){const c=new H(t.systemFilesDir),a=new H(t.userFilesDir);super(c,a,t,!0,!1,e,i),this.apiLoader=new At(this.apisStorage),this.setupWriteListeners(a)}setupWriteListeners(t){t.on("write-start",e=>{this.addWatchExcludedId(e)}),t.on("write-end",e=>{this.removeWatchExcludedId(e)})}async read(){const t=this.telemetry?.startSpan("com.redocly.storage.read",[F("storageOperation","read","storage")],void 0),e=this.telemetry?.startSpan("com.redocly.storage.loadUserState",[F("storageOperation","loadUserState","storage")],t?.parentCtx),[i,c,a]=await Promise.all([this.activeEnvironmentIdStorage.read(),this.tabsStateStorage.read(),this.environmentsStorage.read()]);e?.setAttribute("status","completed"),e?.setAttribute("environmentCount",a.length),e?.setStatus(k.OK),e?.end();const{apiFiles:f,collectionFiles:h}=await this.detectProjectFiles(t);await this.loadAndParseApis(f,t);const s=(await this.loadAndParseCollections(h,t)).filter(l=>l!==null);this.collectionsStorage.setItemIds(s.map(l=>l.id));const o=this.apiLoader.getAll();return this.apisStorage.setItemIds(o.map(l=>l.id)),t?.setAttribute("status","completed"),t?.setStatus(k.OK),t?.end(),{project:this.project,activeEnvironmentId:i,tabsState:c,environments:a,apis:o,collections:s,configFileError:this.getEnvironmentsConfigError()}}async detectProjectFiles(t){const e=this.telemetry?.startSpan("com.redocly.storage.detectFiles",[F("storageOperation","detectFiles","storage")],t?.parentCtx),{api_files:i,collection_files:c}=await pt("fs_scan",{dir:this.project.userFilesDir});return e?.setAttribute("status","completed"),e?.setAttribute("filesCount",i.length+c.length),e?.setAttribute("apiFilesCount",i.length),e?.setAttribute("collectionFilesCount",c.length),e?.setStatus(k.OK),e?.end(),{apiFiles:i,collectionFiles:c}}readEnviroments(){return this.environmentsStorage.read()}deleteApiFromCache(t){this.apiLoader.delete(t)}async loadAndParseApis(t,e,i=!1){const c=this.telemetry?.startSpan("com.redocly.storage.parseApis",[{...F("storageOperation","parseApis","storage"),apisCount:t.length}],e?.parentCtx),a=await G(t,20,async f=>{try{return await this.apiLoader.load(f.relative_path,i),this.apiLoader.get(f.relative_path)}catch(h){return console.info(`Error parsing YAML/JSON file ${f.absolute_path}:`,h),await B(f.relative_path,h),null}});return c?.setAttribute("status","completed"),c?.setAttribute("parsedApisCount",this.apiLoader.size),c?.setStatus(k.OK),c?.end(),a}async loadAndParseCollections(t,e){const i=this.telemetry?.startSpan("com.redocly.storage.parseCollections",[{...F("storageOperation","parseCollections","storage"),collectionsCount:t.length}],e?.parentCtx),c=await G(t,20,async a=>{try{const f=await this.userFilesStorage.get(a.relative_path);if(!f)return null;const h=dt.load(f);if(typeof h!="object"||h===null||typeof h.arazzo!="string")return await O(a.relative_path),null;const s=[];await Promise.all(h.sourceDescriptions?.map(async y=>{const g=y.type,m=y.url,w=!g||g==="openapi",u=await mt({projectPath:this.project.userFilesDir,apiUrl:m,collectionId:a.relative_path});if(w){const S=await this.apiLoader.get(u);S&&s.push(S)}}));const o=await vt.join(this.project.userFilesDir,a.relative_path),l=await this.collectionsStorage.parse({uri:a.relative_path,type:N.FS,content:h,fileDependencies:new Set([o])},s);return await O(a.relative_path),l}catch(f){return console.info(`Error parsing Arazzo file ${a.relative_path}:`,f),await B(a.relative_path,f),null}});return i?.setAttribute("status","completed"),i?.setAttribute("parsedCollectionsCount",c.length),i?.setStatus(k.OK),i?.end(),c}}export{Pt as TauriRootStorage};
@@ -1 +1 @@
1
- import{A as i}from"./redocly-openapi-docs.min.standalone-CS00-kVE.js";import{R as u,a5 as n}from"./redocly-openapi-docs.min.index-BXAn8eur.js";function m(){return`aichat_${i()}`}function l(){return`aimsg_${i()}`}function c(){return`aimpt_${i()}`}function f(t){return{id:t.id,title:t.title??void 0,modelConfig:t.modelConfig,messages:t.messages.map(p),createdAt:new Date(t.createdAt),updatedAt:new Date(t.updatedAt)}}function p(t){return{id:t.uiId,role:t.role,metadata:t.metadata,parts:t.parts.map(g)}}function g(t){return t.self}function I(t){const a=t.id;return{id:a,title:t.title,modelConfig:t.modelConfig,messages:t.messages.map((e,r)=>d(a,r,e))}}function d(t,a,e,r=l()){return{id:r,uiId:e.id,role:e.role,metadata:e.metadata,aiChatId:t,indexWithinInsertBatch:a,parts:e.parts.map((o,s)=>C(r,s,o))}}function C(t,a,e){return{id:c(),text:e.type==="text"?e.text:null,index:a,self:e,aiMessageId:t}}function h(t){return{id:t.id,title:t.title,modelConfig:v(t.model),messages:t.messages.map(A)}}function v(t){switch(t.provider){case n.OPENAI:case n.ANTHROPIC:case n.GEMINI:return{provider:t.provider,modelId:t.modelId};case u:return{provider:t.provider,baseUrl:t.baseUrl};default:throw new Error("Cannot create model config")}}function A(t){return{...t,parts:t.parts.filter(a=>a.type!=="file")}}export{I as a,h as b,f as c,d,m as g};
1
+ import{A as i}from"./redocly-openapi-docs.min.standalone-DweQeOg3.js";import{R as u,a5 as n}from"./redocly-openapi-docs.min.index-Dt-QwDkf.js";function m(){return`aichat_${i()}`}function l(){return`aimsg_${i()}`}function c(){return`aimpt_${i()}`}function f(t){return{id:t.id,title:t.title??void 0,modelConfig:t.modelConfig,messages:t.messages.map(p),createdAt:new Date(t.createdAt),updatedAt:new Date(t.updatedAt)}}function p(t){return{id:t.uiId,role:t.role,metadata:t.metadata,parts:t.parts.map(g)}}function g(t){return t.self}function I(t){const a=t.id;return{id:a,title:t.title,modelConfig:t.modelConfig,messages:t.messages.map((e,r)=>d(a,r,e))}}function d(t,a,e,r=l()){return{id:r,uiId:e.id,role:e.role,metadata:e.metadata,aiChatId:t,indexWithinInsertBatch:a,parts:e.parts.map((o,s)=>C(r,s,o))}}function C(t,a,e){return{id:c(),text:e.type==="text"?e.text:null,index:a,self:e,aiMessageId:t}}function h(t){return{id:t.id,title:t.title,modelConfig:v(t.model),messages:t.messages.map(A)}}function v(t){switch(t.provider){case n.OPENAI:case n.ANTHROPIC:case n.GEMINI:return{provider:t.provider,modelId:t.modelId};case u:return{provider:t.provider,baseUrl:t.baseUrl};default:throw new Error("Cannot create model config")}}function A(t){return{...t,parts:t.parts.filter(a=>a.type!=="file")}}export{I as a,h as b,f as c,d,m as g};
@@ -0,0 +1,2 @@
1
+ import{b3 as r,aj as n,aW as i,aT as c,aV as l}from"./redocly-openapi-docs.min.index-Dt-QwDkf.js";import{aE as f,al as s,bg as d,a$ as o}from"./redocly-openapi-docs.min.standalone-DweQeOg3.js";class w extends f{constructor(){super()}resolveExternalRef(e,a){return r(a)?a:e&&r(e)?new URL(a,e).href:e?s.resolve(s.dirname(e),a):a}async loadExternalRef(e){if(r(e)){const{body:a,mimeType:t}=await d(e,{...this.config.http,customFetch:n});return new o(e,a,t)}else{if(!await i(e))throw new Error(`File not found at ${e}.`);try{throw await c(e),new Error(`Expected a file but received a folder at ${e}.`)}catch(t){if(t instanceof Error&&t.message.includes("Expected a file but received a folder"))throw t}const a=await l(e);return new o(e,a.replace(/\r\n/g,`
2
+ `))}}}export{w as ExternalResolver};
@@ -1 +1 @@
1
- import{p as T,l as u,aB as E,aC as I,aD as k,aE as w,aF as A,aG as C,aH as v,aI as j,aJ as b,aK as q}from"./redocly-openapi-docs.min.standalone-CS00-kVE.js";import{aL as J,aM as Y,aN as W,aO as X,aP as H,aQ as K,aR as Q,aS as Z,aT as ee,aU as se,aV as ae,aW as te,aX as ne,aY as re,aZ as oe,a_ as ie,a$ as ce,b0 as le,b1 as me,b2 as ue,b3 as pe,b4 as ye,b5 as fe,b6 as de,b7 as ge,b8 as he,b9 as ve,ba as Ee,bb as be,bc as xe,bd as Se,be as Re,bf as Oe,bg as Te,bh as Ie,bi as ke,bj as we,bk as Ae,bl as Ce,bm as je,bn as De,bo as Pe}from"./redocly-openapi-docs.min.standalone-CS00-kVE.js";import{g as D,t as P,A as Ne,c as x,l as S,S as Fe,R as _e,C as Le}from"./redocly-openapi-docs.min.lint-jyJiMT1p.js";import{a as $e,b as ze,d as Ge,e as Ue,f as Ve,h as Me,i as Be,j as qe,k as Je,m as Ye,n as We,o as Xe,p as He,q as Ke,r as Qe,s as Ze,u as es,v as ss,w as as,x as ts,y as ns,z as rs,B as os,s as is,D as cs}from"./redocly-openapi-docs.min.lint-jyJiMT1p.js";function ls(e){return(T.extname(e)===".yaml"||T.extname(e)===".yml")&&!1}function ms(e){return u(e)&&!E(e)}async function us(e){return new Promise(a=>setTimeout(a,e))}const R="type",N=["api-description","api-operation","data-schema"];function F(e,a){const{ctx:s}=D("EntityFileDefault",a),{ctx:t,discriminatorResolver:n}=D("EntityFile",e);return{entityTypes:{...s,...t,EntityFileArray:{properties:{},items:r=>{if(u(r)){const c=r[R];if(!c)return"Entity";const i=n?.(r,c);if(i&&typeof i=="string")return i}return"Entity"}}},discriminatorResolver:n}}function o(e,a){if(I(a.parent))return;const s=a.key.toString(),t=e.counts??={};t[s]=(t[s]??0)+1}function O(e){for(const n of Object.values(e))n.items&&(n.total=n.items.size);const{xExtensions:a}=e,s=a.counts??{},t=Object.keys(s).sort();a.total=t.length,a.counts=Object.fromEntries(t.map(n=>[n,s[n]]))}const ps=e=>({SpecExtension:{enter(a,s){o(e.xExtensions,s)}},XCodeSampleList:{enter(a,s){o(e.xExtensions,s)}},ExamplesMap:{enter(a,s){s.key.toString()==="x-examples"&&o(e.xExtensions,s)}},EnumDescriptions:{enter(a,s){o(e.xExtensions,s)}},TagGroups:{enter(a,s){o(e.xExtensions,s)}},Logo:{enter(a,s){o(e.xExtensions,s)}},XServerList:{enter(a,s){o(e.xExtensions,s)}},XUsePkce:{enter(a,s){o(e.xExtensions,s)}},Operation:{enter(a,s){s.key.toString()==="x-query"&&o(e.xExtensions,s)}},ExternalDocs:{leave(){e.externalDocs.total++}},ref:{enter(a){e.refs.items.add(a.$ref)}},Tag:{leave(a){e.tags.items.add(a.name)}},Link:{leave(a){e.links.items.add(a.operationId)}},WebhooksMap:{enter(a,s){s.key.toString()==="x-webhooks"&&o(e.xExtensions,s)},Operation:{leave(a){if(e.webhooks.total++,a.tags)for(const s of a.tags)e.tags.items.add(s)}}},Paths:{PathItem:{leave(){e.pathItems.total++},Operation:{leave(a){if(e.operations.total++,a.tags)for(const s of a.tags)e.tags.items.add(s)}},Parameter:{leave(a){e.parameters.items.add(a.name)}}}},NamedSchemas:{Schema:{leave(){e.schemas.total++}}},Root:{leave(){O(e)}}}),ys=e=>({SpecExtension:{enter(a,s){o(e.xExtensions,s)}},ExternalDocs:{leave(){e.externalDocs.total++}},ref:{enter(a){e.refs.items.add(a.$ref)}},Tag:{leave(a){e.tags.items.add(a.name)}},ChannelMap:{Channel:{leave(){e.channels.total++},Operation:{leave(a){if(e.operations.total++,a.tags)for(const s of a.tags)e.tags.items.add(s)}},Parameter:{leave(a,{key:s}){e.parameters.items.add(s.toString())}}}},NamedSchemas:{Schema:{leave(){e.schemas.total++}}},Root:{leave(){O(e)}}}),fs=e=>({SpecExtension:{enter(a,s){o(e.xExtensions,s)}},ExternalDocs:{leave(){e.externalDocs.total++}},ref:{enter(a){e.refs.items.add(a.$ref)}},Tag:{leave(a){e.tags.items.add(a.name)}},NamedChannels:{Channel:{leave(){e.channels.total++},Parameter:{leave(a,{key:s}){e.parameters.items.add(s.toString())}}}},NamedOperations:{Operation:{leave(a){if(e.operations.total++,a.tags)for(const s of a.tags)e.tags.items.add(s)}}},NamedSchemas:{Schema:{leave(){e.schemas.total++}}},Root:{leave(){O(e)}}}),ds=/^[a-z0-9]+(?:-[a-z0-9]+)*$/,_=2,L=150,gs=()=>({any(e,{report:a,location:s}){if(u(e)&&"key"in e){const t=e.key;if(typeof t!="string"){a({message:"Entity `key` must be a string.",location:s.child(["key"])});return}t.length<_&&a({message:`Entity 'key' must be at least ${_} characters long.`,location:s.child(["key"])}),t.length>L&&a({message:`Entity 'key' must not exceed ${L} characters.`,location:s.child(["key"])}),ds.test(t)||a({message:"Entity `key` must contain only lowercase letters, numbers, and hyphens, and cannot start or end with a hyphen.",location:s.child(["key"])})}}});function $(e,a){const s=a.split("-").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join("")+e;return Object.values(P).includes(s)?s:e}function hs(e,a){const s={};for(const[t,n]of Object.entries(a))if(z(t,n)){if(n.severity==="off")continue;s[t]={...xs(e,t,n)}}else s[t]=n;return s}function vs(e){const a={},s={};for(const[t,n]of Object.entries(e))if(z(t,n)){const r=n;bs(r)?a[t]=r:s[t]=r}else s[t]=n;return{entityRules:a,apiRules:s}}function Es(e,a,s){if(!u(s.parsed)||!u(s.parsed.components))return null;const t=s.parsed.components,n="schemas"in t?t.schemas:void 0;if(!n||!(e in n))return null;const r=n[e];try{const c=JSON.parse(a);if(k(r,c))return r}catch{return null}return null}function z(e,a){return e.startsWith("rule/")&&u(a)}function bs(e){return Object.values(P).some(a=>e.subject.type===a)}function xs(e,a,s){const t=$(s.subject.type,e),n=s.where?.map(r=>({...r,subject:{...r.subject,type:$(r.subject.type,e)}}));return{assertionId:a,subject:{...s.subject,type:t},assertions:s.assertions,...n&&{where:n},...s.message&&{message:s.message},...s.severity&&{severity:s.severity}}}async function G(e){const{document:a,entitySchema:s,entityDefaultSchema:t,severity:n,externalRefResolver:r=new v,assertionConfig:c={}}=e,i={problems:[],specVersion:"entity",visitorsData:{}},{entityTypes:p,discriminatorResolver:y}=F(s,t),l=w(p);let m=l.Entity;if(Array.isArray(a.parsed))m=l.EntityFileArray;else if(u(a.parsed)){const g=a.parsed[R];if(!g)m=l.Entity;else{const h=y?.(a.parsed,g);h&&typeof h=="string"&&l[h]&&(m=l[h])}}const f=Ne(c),d=Array.isArray(f)?f.map(g=>({severity:n||"error",ruleId:"entity assertions",visitor:g})):[{severity:n||"error",ruleId:"entity assertions",visitor:f}],V=[{severity:n||"error",ruleId:"entity struct",visitor:Fe()},{severity:n||"error",ruleId:"entity no-unresolved-refs",visitor:q()},{severity:n||"error",ruleId:"entity key-valid",visitor:gs()},...d],M=A(V,l),B=await C({rootDocument:a,rootType:m,externalRefResolver:r});return j({document:a,rootType:m,normalizedVisitors:M,resolvedRefMap:B,ctx:i}),i.problems}async function Ss(e,a,s){if(!a.rules)throw new Error(`Scorecard level "${a.name}" has no rules defined.`);const t=new v,n=b(JSON.stringify(e,null,2),"entity"),r=n.parsed[R],c=hs(r||"unknown",a.rules),{entityRules:i,apiRules:p}=vs(c),y=await G({document:n,entitySchema:Le,entityDefaultSchema:_e,externalRefResolver:t,assertionConfig:i});if(N.includes(e.type)){if(Object.keys(p).length===0)return y;if(!s)throw new Error(`Document is required for entity type "${e.type}". Provide the source API document to lint API rules.`);if(e.type==="data-schema"&&e.metadata?.schema){Object.values(p).forEach(d=>{if(u(d)&&u(d.subject)&&d.subject.type!=="Schema")throw new Error(`API rules for "data-schema" entity must target Schema subject, but found "${d.subject.type}".`)});const m=Es(e.title,e.metadata.schema,s);if(!m)throw new Error(`Schema "${e.title}" not found in the document. Ensure the schema exists in components.schemas.`);const f=await U({schema:m,schemaKey:e.title,config:await x({rules:p}),specType:e.metadata.specType,sourceDocument:s,externalRefResolver:t});return[...y,...f]}const l=await S({document:s,externalRefResolver:t,config:await x({rules:p})});return[...y,...l]}else if(!E(p))throw new Error(`API rules are not supported for entity type "${e.type}". Only ${N.join(", ")} support API rules.`);return y}async function U(e){const{schema:a,schemaKey:s,config:t,sourceDocument:n,specType:r,externalRefResolver:c=new v(t.resolve)}=e,i=n.parsed,p=i[r],y=i.info,l=b(JSON.stringify({[r]:p,info:y,components:{schemas:{[s]:a}}},null,2),n?.source.absoluteRef||`schema:${s}`);return(await S({document:l,config:t,externalRefResolver:c})).filter(m=>m.location.some(f=>f.pointer?.includes(`/components/schemas/${s}`)))}class Rs extends Error{}export{J as Arazzo1Types,Y as Arazzo1_1Types,W as AsyncApi2Types,X as AsyncApi3Types,v as BaseResolver,H as CONFIG_BUNDLER_VISITOR_ID,K as CONFIG_FILE_NAME,Q as Config,$e as ConfigTypes,ze as ConfigValidationError,Z as DEFAULT_CONFIG,ee as DEFAULT_PROJECT_PLUGIN_PATHS,Rs as HandledError,se as IGNORE_BANNER,ae as IGNORE_FILE,te as Oas2Types,ne as Oas3Types,re as Oas3_1Types,oe as Oas3_2Types,ie as OpenRpcTypes,ce as Overlay1Types,le as PLUGINS_COLLECTOR_VISITOR_ID,me as ResolveError,ue as Source,ys as StatsAsync2,fs as StatsAsync3,ps as StatsOAS,pe as YamlParseError,Ge as bundle,ye as bundleDocument,Ue as bundleFromString,Ve as clearPluginsCache,x as createConfig,Me as createConfigTypes,F as createEntityTypes,k as dequal,fe as detectSpec,ls as doesYamlFileExist,de as escapePointerFragment,Be as findConfig,qe as formatProblems,Je as getAstNodeByPointer,Ye as getCodeframe,ge as getDir,We as getLineColLocation,he as getMajorSpecVersion,Xe as getPluginCacheVersion,He as getTotals,ve as getTypes,Ee as isAbsoluteUrl,be as isBrowser,E as isEmptyObject,xe as isGraphqlRef,Se as isMappingRef,Ke as isNotEmptyArray,ms as isNotEmptyObject,u as isPlainObject,I as isRef,Re as isString,Oe as isSupportedExtension,Te as isTruthy,Qe as keysOf,Ze as lint,es as lintConfig,S as lintDocument,G as lintEntityFile,Ss as lintEntityWithScorecardLevel,ss as lintFromString,U as lintSchema,as as loadConfig,ts as loadIgnoreConfig,ns as logger,b as makeDocumentFromString,Ie as mapTypeToComponent,w as normalizeTypes,A as normalizeVisitors,ke as parseYaml,us as pause,rs as pluralize,we as readFileFromUrl,Ae as regexFromString,C as resolveDocument,Ce as resolvePath,os as resolvePlugins,je as slash,De as stringifyYaml,Pe as unescapePointerFragment,is as validate,j as walkDocument,cs as xmlEscape};
1
+ import{p as T,l as u,ay as E,az as I,aA as k,aB as w,aC as A,aD as C,aE as v,aF as j,aG as b,aH as q}from"./redocly-openapi-docs.min.standalone-DweQeOg3.js";import{aI as J,aJ as Y,aK as W,aL as X,aM as H,aN as K,aO as Q,aP as Z,aQ as ee,aR as se,aS as ae,aT as te,aU as ne,aV as re,aW as oe,aX as ie,aY as ce,aZ as le,a_ as me,a$ as ue,b0 as pe,b1 as ye,b2 as fe,b3 as de,b4 as ge,b5 as he,b6 as ve,b7 as Ee,b8 as be,b9 as xe,ba as Se,bb as Re,bc as Oe,bd as Te,be as Ie,bf as ke,bg as we,bh as Ae,bi as Ce,bj as je,bk as De,bl as Pe}from"./redocly-openapi-docs.min.standalone-DweQeOg3.js";import{g as D,t as P,A as Ne,c as x,l as S,S as Fe,R as _e,C as Le}from"./redocly-openapi-docs.min.lint-DBvVDQqS.js";import{a as $e,b as ze,d as Ge,e as Ue,f as Ve,h as Me,i as Be,j as qe,k as Je,m as Ye,n as We,o as Xe,p as He,q as Ke,r as Qe,s as Ze,u as es,v as ss,w as as,x as ts,y as ns,z as rs,B as os,s as is,D as cs}from"./redocly-openapi-docs.min.lint-DBvVDQqS.js";function ls(e){return(T.extname(e)===".yaml"||T.extname(e)===".yml")&&!1}function ms(e){return u(e)&&!E(e)}async function us(e){return new Promise(a=>setTimeout(a,e))}const R="type",N=["api-description","api-operation","data-schema"];function F(e,a){const{ctx:s}=D("EntityFileDefault",a),{ctx:t,discriminatorResolver:n}=D("EntityFile",e);return{entityTypes:{...s,...t,EntityFileArray:{properties:{},items:r=>{if(u(r)){const c=r[R];if(!c)return"Entity";const i=n?.(r,c);if(i&&typeof i=="string")return i}return"Entity"}}},discriminatorResolver:n}}function o(e,a){if(I(a.parent))return;const s=a.key.toString(),t=e.counts??={};t[s]=(t[s]??0)+1}function O(e){for(const n of Object.values(e))n.items&&(n.total=n.items.size);const{xExtensions:a}=e,s=a.counts??{},t=Object.keys(s).sort();a.total=t.length,a.counts=Object.fromEntries(t.map(n=>[n,s[n]]))}const ps=e=>({SpecExtension:{enter(a,s){o(e.xExtensions,s)}},XCodeSampleList:{enter(a,s){o(e.xExtensions,s)}},ExamplesMap:{enter(a,s){s.key.toString()==="x-examples"&&o(e.xExtensions,s)}},EnumDescriptions:{enter(a,s){o(e.xExtensions,s)}},TagGroups:{enter(a,s){o(e.xExtensions,s)}},Logo:{enter(a,s){o(e.xExtensions,s)}},XServerList:{enter(a,s){o(e.xExtensions,s)}},XUsePkce:{enter(a,s){o(e.xExtensions,s)}},Operation:{enter(a,s){s.key.toString()==="x-query"&&o(e.xExtensions,s)}},ExternalDocs:{leave(){e.externalDocs.total++}},ref:{enter(a){e.refs.items.add(a.$ref)}},Tag:{leave(a){e.tags.items.add(a.name)}},Link:{leave(a){e.links.items.add(a.operationId)}},WebhooksMap:{enter(a,s){s.key.toString()==="x-webhooks"&&o(e.xExtensions,s)},Operation:{leave(a){if(e.webhooks.total++,a.tags)for(const s of a.tags)e.tags.items.add(s)}}},Paths:{PathItem:{leave(){e.pathItems.total++},Operation:{leave(a){if(e.operations.total++,a.tags)for(const s of a.tags)e.tags.items.add(s)}},Parameter:{leave(a){e.parameters.items.add(a.name)}}}},NamedSchemas:{Schema:{leave(){e.schemas.total++}}},Root:{leave(){O(e)}}}),ys=e=>({SpecExtension:{enter(a,s){o(e.xExtensions,s)}},ExternalDocs:{leave(){e.externalDocs.total++}},ref:{enter(a){e.refs.items.add(a.$ref)}},Tag:{leave(a){e.tags.items.add(a.name)}},ChannelMap:{Channel:{leave(){e.channels.total++},Operation:{leave(a){if(e.operations.total++,a.tags)for(const s of a.tags)e.tags.items.add(s)}},Parameter:{leave(a,{key:s}){e.parameters.items.add(s.toString())}}}},NamedSchemas:{Schema:{leave(){e.schemas.total++}}},Root:{leave(){O(e)}}}),fs=e=>({SpecExtension:{enter(a,s){o(e.xExtensions,s)}},ExternalDocs:{leave(){e.externalDocs.total++}},ref:{enter(a){e.refs.items.add(a.$ref)}},Tag:{leave(a){e.tags.items.add(a.name)}},NamedChannels:{Channel:{leave(){e.channels.total++},Parameter:{leave(a,{key:s}){e.parameters.items.add(s.toString())}}}},NamedOperations:{Operation:{leave(a){if(e.operations.total++,a.tags)for(const s of a.tags)e.tags.items.add(s)}}},NamedSchemas:{Schema:{leave(){e.schemas.total++}}},Root:{leave(){O(e)}}}),ds=/^[a-z0-9]+(?:-[a-z0-9]+)*$/,_=2,L=150,gs=()=>({any(e,{report:a,location:s}){if(u(e)&&"key"in e){const t=e.key;if(typeof t!="string"){a({message:"Entity `key` must be a string.",location:s.child(["key"])});return}t.length<_&&a({message:`Entity 'key' must be at least ${_} characters long.`,location:s.child(["key"])}),t.length>L&&a({message:`Entity 'key' must not exceed ${L} characters.`,location:s.child(["key"])}),ds.test(t)||a({message:"Entity `key` must contain only lowercase letters, numbers, and hyphens, and cannot start or end with a hyphen.",location:s.child(["key"])})}}});function $(e,a){const s=a.split("-").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join("")+e;return Object.values(P).includes(s)?s:e}function hs(e,a){const s={};for(const[t,n]of Object.entries(a))if(z(t,n)){if(n.severity==="off")continue;s[t]={...xs(e,t,n)}}else s[t]=n;return s}function vs(e){const a={},s={};for(const[t,n]of Object.entries(e))if(z(t,n)){const r=n;bs(r)?a[t]=r:s[t]=r}else s[t]=n;return{entityRules:a,apiRules:s}}function Es(e,a,s){if(!u(s.parsed)||!u(s.parsed.components))return null;const t=s.parsed.components,n="schemas"in t?t.schemas:void 0;if(!n||!(e in n))return null;const r=n[e];try{const c=JSON.parse(a);if(k(r,c))return r}catch{return null}return null}function z(e,a){return e.startsWith("rule/")&&u(a)}function bs(e){return Object.values(P).some(a=>e.subject.type===a)}function xs(e,a,s){const t=$(s.subject.type,e),n=s.where?.map(r=>({...r,subject:{...r.subject,type:$(r.subject.type,e)}}));return{assertionId:a,subject:{...s.subject,type:t},assertions:s.assertions,...n&&{where:n},...s.message&&{message:s.message},...s.severity&&{severity:s.severity}}}async function G(e){const{document:a,entitySchema:s,entityDefaultSchema:t,severity:n,externalRefResolver:r=new v,assertionConfig:c={}}=e,i={problems:[],specVersion:"entity",visitorsData:{}},{entityTypes:p,discriminatorResolver:y}=F(s,t),l=w(p);let m=l.Entity;if(Array.isArray(a.parsed))m=l.EntityFileArray;else if(u(a.parsed)){const g=a.parsed[R];if(!g)m=l.Entity;else{const h=y?.(a.parsed,g);h&&typeof h=="string"&&l[h]&&(m=l[h])}}const f=Ne(c),d=Array.isArray(f)?f.map(g=>({severity:n||"error",ruleId:"entity assertions",visitor:g})):[{severity:n||"error",ruleId:"entity assertions",visitor:f}],V=[{severity:n||"error",ruleId:"entity struct",visitor:Fe()},{severity:n||"error",ruleId:"entity no-unresolved-refs",visitor:q()},{severity:n||"error",ruleId:"entity key-valid",visitor:gs()},...d],M=A(V,l),B=await C({rootDocument:a,rootType:m,externalRefResolver:r});return j({document:a,rootType:m,normalizedVisitors:M,resolvedRefMap:B,ctx:i}),i.problems}async function Ss(e,a,s){if(!a.rules)throw new Error(`Scorecard level "${a.name}" has no rules defined.`);const t=new v,n=b(JSON.stringify(e,null,2),"entity"),r=n.parsed[R],c=hs(r||"unknown",a.rules),{entityRules:i,apiRules:p}=vs(c),y=await G({document:n,entitySchema:Le,entityDefaultSchema:_e,externalRefResolver:t,assertionConfig:i});if(N.includes(e.type)){if(Object.keys(p).length===0)return y;if(!s)throw new Error(`Document is required for entity type "${e.type}". Provide the source API document to lint API rules.`);if(e.type==="data-schema"&&e.metadata?.schema){Object.values(p).forEach(d=>{if(u(d)&&u(d.subject)&&d.subject.type!=="Schema")throw new Error(`API rules for "data-schema" entity must target Schema subject, but found "${d.subject.type}".`)});const m=Es(e.title,e.metadata.schema,s);if(!m)throw new Error(`Schema "${e.title}" not found in the document. Ensure the schema exists in components.schemas.`);const f=await U({schema:m,schemaKey:e.title,config:await x({rules:p}),specType:e.metadata.specType,sourceDocument:s,externalRefResolver:t});return[...y,...f]}const l=await S({document:s,externalRefResolver:t,config:await x({rules:p})});return[...y,...l]}else if(!E(p))throw new Error(`API rules are not supported for entity type "${e.type}". Only ${N.join(", ")} support API rules.`);return y}async function U(e){const{schema:a,schemaKey:s,config:t,sourceDocument:n,specType:r,externalRefResolver:c=new v(t.resolve)}=e,i=n.parsed,p=i[r],y=i.info,l=b(JSON.stringify({[r]:p,info:y,components:{schemas:{[s]:a}}},null,2),n?.source.absoluteRef||`schema:${s}`);return(await S({document:l,config:t,externalRefResolver:c})).filter(m=>m.location.some(f=>f.pointer?.includes(`/components/schemas/${s}`)))}class Rs extends Error{}export{J as Arazzo1Types,Y as Arazzo1_1Types,W as AsyncApi2Types,X as AsyncApi3Types,v as BaseResolver,H as CONFIG_BUNDLER_VISITOR_ID,K as CONFIG_FILE_NAME,Q as Config,$e as ConfigTypes,ze as ConfigValidationError,Z as DEFAULT_CONFIG,ee as DEFAULT_PROJECT_PLUGIN_PATHS,Rs as HandledError,se as IGNORE_BANNER,ae as IGNORE_FILE,te as Oas2Types,ne as Oas3Types,re as Oas3_1Types,oe as Oas3_2Types,ie as OpenRpcTypes,ce as Overlay1Types,le as PLUGINS_COLLECTOR_VISITOR_ID,me as ResolveError,ue as Source,ys as StatsAsync2,fs as StatsAsync3,ps as StatsOAS,pe as YamlParseError,Ge as bundle,ye as bundleDocument,Ue as bundleFromString,Ve as clearPluginsCache,x as createConfig,Me as createConfigTypes,F as createEntityTypes,k as dequal,fe as detectSpec,ls as doesYamlFileExist,de as escapePointerFragment,Be as findConfig,qe as formatProblems,Je as getAstNodeByPointer,Ye as getCodeframe,ge as getDir,We as getLineColLocation,he as getMajorSpecVersion,Xe as getPluginCacheVersion,He as getTotals,ve as getTypes,Ee as isAbsoluteUrl,be as isBrowser,E as isEmptyObject,xe as isGraphqlRef,Se as isMappingRef,Ke as isNotEmptyArray,ms as isNotEmptyObject,u as isPlainObject,I as isRef,Re as isString,Oe as isSupportedExtension,Te as isTruthy,Qe as keysOf,Ze as lint,es as lintConfig,S as lintDocument,G as lintEntityFile,Ss as lintEntityWithScorecardLevel,ss as lintFromString,U as lintSchema,as as loadConfig,ts as loadIgnoreConfig,ns as logger,b as makeDocumentFromString,Ie as mapTypeToComponent,w as normalizeTypes,A as normalizeVisitors,ke as parseYaml,us as pause,rs as pluralize,we as readFileFromUrl,Ae as regexFromString,C as resolveDocument,Ce as resolvePath,os as resolvePlugins,je as slash,De as stringifyYaml,Pe as unescapePointerFragment,is as validate,j as walkDocument,cs as xmlEscape};
@@ -1 +1 @@
1
- import{z as n}from"./redocly-openapi-docs.min.index-BXAn8eur.js";async function t(o={}){return typeof o=="object"&&Object.freeze(o),await n("plugin:dialog|open",{options:o})}export{t as open};
1
+ import{z as n}from"./redocly-openapi-docs.min.index-Dt-QwDkf.js";async function t(o={}){return typeof o=="object"&&Object.freeze(o),await n("plugin:dialog|open",{options:o})}export{t as open};
@@ -1 +1 @@
1
- import{g as c}from"./redocly-openapi-docs.min.SemanticSearchService-BdbJAsUF.js";import{S as u,e as S,a as m,b as h}from"./redocly-openapi-docs.min.SemanticSearchService-BdbJAsUF.js";import{r}from"./redocly-openapi-docs.min.standalone-CS00-kVE.js";function f(){const[s,a]=r.useState(!1),[n,t]=r.useState(null);return{search:r.useCallback(async(o,i=10)=>{a(!0),t(null);try{return await c().search(o,i)}catch(e){const l=e instanceof Error?e:new Error(String(e));return t(l),[]}finally{a(!1)}},[]),isSearching:s,error:n}}export{u as SemanticSearchService,S as extractAllDocuments,m as extractApiDocuments,h as extractCollectionDocuments,c as getSemanticSearchService,f as useSemanticSearch};
1
+ import{g as c}from"./redocly-openapi-docs.min.SemanticSearchService-CkqlO6WP.js";import{S as u,e as S,a as m,b as h}from"./redocly-openapi-docs.min.SemanticSearchService-CkqlO6WP.js";import{r}from"./redocly-openapi-docs.min.standalone-DweQeOg3.js";function f(){const[s,a]=r.useState(!1),[n,t]=r.useState(null);return{search:r.useCallback(async(o,i=10)=>{a(!0),t(null);try{return await c().search(o,i)}catch(e){const l=e instanceof Error?e:new Error(String(e));return t(l),[]}finally{a(!1)}},[]),isSearching:s,error:n}}export{u as SemanticSearchService,S as extractAllDocuments,m as extractApiDocuments,h as extractCollectionDocuments,c as getSemanticSearchService,f as useSemanticSearch};