@redocly/cli 2.43.1 → 2.43.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/THIRD_PARTY_NOTICES +1 -1
- package/lib/chunks/{AAX7DTHF.js → 2FI7HSOA.js} +1 -1
- package/lib/chunks/{6AQC6B4M.js → 3HOQ2EH4.js} +1 -1
- package/lib/chunks/{F4I4B6CF.js → 3Q7NWMTP.js} +1 -1
- package/lib/chunks/{F33YUAJB.js → 47NNACMG.js} +236 -147
- package/lib/chunks/{FJ3ZKIJG.js → 6HPPISLY.js} +1 -1
- package/lib/chunks/{4K55AJYG.js → 7COMRSUB.js} +1 -1
- package/lib/chunks/{7LVD3IVI.js → A7L35TO3.js} +1 -1
- package/lib/chunks/{7N32H7AG.js → CHEI2COC.js} +1 -1
- package/lib/chunks/{E4UJ56QF.js → CQMYMPLY.js} +1 -1
- package/lib/chunks/{PQKTPLKO.js → DLYUMFFQ.js} +1 -1
- package/lib/chunks/{DO2OO6JA.js → EK3VLO23.js} +1 -1
- package/lib/chunks/{N2HAOFWU.js → GO4N3KXL.js} +24 -24
- package/lib/chunks/{6PRPGEML.js → HRN4XSXF.js} +1 -1
- package/lib/chunks/{VK2PYQAI.js → K4MGAJAT.js} +1 -1
- package/lib/chunks/{XWDP43JH.js → O2L5BSHC.js} +1 -1
- package/lib/chunks/{EEGSLUAI.js → OJSAINVA.js} +1 -1
- package/lib/chunks/{UN3N7VZE.js → WF2UYHZN.js} +1 -1
- package/lib/chunks/{WSPHAE7F.js → WXI7DHLT.js} +1 -1
- package/lib/chunks/X5UP7OHY.js +8 -0
- package/lib/index.js +7 -7
- package/package.json +1 -1
- package/lib/chunks/WPQEQDS2.js +0 -8
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __pathDirname } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
var __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = __pathDirname(__filename);
|
|
7
|
+
import{a as ce}from"./WZXA5XPB.js";import"./RFWIIJFG.js";function fe(e){return e}async function V(e){return typeof e=="function"?await e():e}function le(e){let t="";for(let n of new TextEncoder().encode(e))t+=String.fromCharCode(n);return btoa(t)}function pe(e,t){return e.kind==="apiKey"?t.auth?.apiKey?.[e.scheme]!==void 0:e.kind==="bearer"?t.auth?.bearer!==void 0:t.auth?.basic!==void 0}async function Q(e,t){let n=e.find(d=>d.every(a=>pe(a,t)))??e[0]??[],o={},r={},s=[];for(let d of n)if(d.kind==="apiKey"){let a=t.auth?.apiKey?.[d.scheme];if(a===void 0)continue;let f=await V(a);d.in==="header"?o[d.name]=f:d.in==="query"?r[d.name]=f:s.push(`${d.name}=${encodeURIComponent(f)}`)}else if(d.kind==="bearer"){let a=t.auth?.bearer;a!==void 0&&(o.Authorization=`Bearer ${await V(a)}`)}else{let a=t.auth?.basic;a!==void 0&&(o.Authorization=`Basic ${le(`${a.username}:${a.password}`)}`)}return s.length>0&&(o.Cookie=s.join("; ")),{headers:o,query:r}}var S=class extends Error{url;status;statusText;body;constructor(t,n,o,r){super(`Request failed with status ${n}`),this.name="ApiError",this.url=t,this.status=n,this.statusText=o,this.body=r}},O=class extends Error{operationId;timeout;attempt;constructor(t,n,o){super(`Request "${t}" timed out after ${n} ms (attempt ${o})`),this.name="TimeoutError",this.operationId=t,this.timeout=n,this.attempt=o}};function j(e){let t=e.reason;return t instanceof Error?t:new DOMException("The operation was aborted.","AbortError")}async function L(e,t){if(t==="void"){if(e.status===204||e.status===205||e.status===304||!(e.headers.get("content-type")??"").toLowerCase().includes("json"))return;let s=await e.text().catch(()=>"");if(s==="")return;try{return JSON.parse(s)}catch{return}}if(e.status===204)return;if(t==="stream")return e.body;if(t==="blob")return e.blob();if(t==="arrayBuffer")return e.arrayBuffer();if(t==="formData")return e.formData();if(t==="text")return e.text();if(t==="json")return e.json();let n=(e.headers.get("content-type")??"").toLowerCase();if(n.includes("json"))return e.json();if(n.startsWith("text/"))return e.text();let o=await e.blob();return o.size>0?o:void 0}async function k(e){return(e.headers.get("content-type")??"").toLowerCase().includes("json")?e.json().catch(()=>{}):e.text().catch(()=>{})}var me=new Set(["GET","HEAD","PUT","DELETE","OPTIONS"]),ye=new Set([408,429,500,502,503,504]);function U(e){return me.has(e.request.method.toUpperCase())||"Idempotency-Key"in e.request.headers||"idempotency-key"in e.request.headers?e.response===void 0||ye.has(e.response.status):!1}function z(e,t,n){if(n){let s=Number(n);if(!Number.isNaN(s))return s*1e3;let d=Date.parse(n);if(!Number.isNaN(d))return Math.max(0,d-Date.now())}let o=e.retryDelay??1e3,r=e.retryStrategy==="fixed"?o:o*Math.pow(2,t-1);return e.jitter===!1?r:Math.random()*r}function $(e,t){return new Promise((n,o)=>{if(t?.aborted){o(j(t));return}let r=()=>{clearTimeout(s),o(j(t))},s=setTimeout(()=>{t&&t.removeEventListener("abort",r),n()},e);t&&t.addEventListener("abort",r,{once:!0})})}function D(e){if(e===void 0)return{};if(e instanceof Headers){let t={};return e.forEach((n,o)=>{t[o]=n}),t}return Array.isArray(e)?Object.fromEntries(e):e}function J(e){return[...e.onRequest||e.onResponse||e.onError?[{onRequest:e.onRequest,onResponse:e.onResponse,onError:e.onError}]:[],...e.middleware??[]]}async function I(e,t,n,o,r,s,d,a="application/json"){let{retry:f,timeout:u,idempotencyKey:i,...c}=o,l={...e.retry,...f},p=u??e.timeout,h=i??e.idempotencyKey,R=typeof e.headers=="function"?await e.headers():e.headers,A={Accept:a,...R,...D(c.headers)},B=(c.method??"GET").toUpperCase();h!==void 0&&h!==!1&&(B==="POST"||B==="PATCH")&&!("Idempotency-Key"in A)&&!("idempotency-key"in A)&&(A["Idempotency-Key"]=typeof h=="string"?h:typeof h=="function"?h():crypto.randomUUID()),typeof e.clientHeader=="string"&&typeof document>"u"&&!("X-Redocly-Client"in A)&&!("x-redocly-client"in A)&&(A["X-Redocly-Client"]=e.clientHeader);let m={url:n,method:c.method??"GET",headers:A,body:r,operation:t},v=J(e);for(let y of v)y.onRequest&&await y.onRequest(m);let C;if(m.body!==void 0){let y=m.body,w=y instanceof Blob||y instanceof ArrayBuffer||ArrayBuffer.isView(y),g=typeof FormData<"u"&&y instanceof FormData,P=y instanceof URLSearchParams;if(g||P||w||typeof y=="string")C=y;else if(s?.multipart===!0){if(!d.serializeMultipart)throw new Error("Multipart capability not wired: cannot serialize the request body");C=d.serializeMultipart(y)}else C=JSON.stringify(y),!("Content-Type"in m.headers)&&!("content-type"in m.headers)&&(m.headers["Content-Type"]=s?.contentType??"application/json")}let q=e.fetch??fetch,E=1+(l.retries??0),T=l.retryOn??U,x=c.signal??void 0,b=0;for(;;){if(b++,x?.aborted)throw j(x);let y=p?x?AbortSignal.any([x,AbortSignal.timeout(p)]):AbortSignal.timeout(p):x,w;try{w=await q(m.url,{...c,signal:y,method:m.method,headers:m.headers,body:C})}catch(g){if(b<E&&!x?.aborted&&await T({attempt:b,request:m,error:g})){await $(z(l,b,null),x);continue}throw p&&!x?.aborted&&g instanceof DOMException&&g.name==="TimeoutError"?new O(t.id,p,b):g}for(let g=v.length-1;g>=0;g--){let P=v[g].onResponse;if(P){let H=await P(w,m);H&&H!==w&&(await w.body?.cancel().catch(()=>{}),w=H)}}if(!w.ok&&b<E&&!x?.aborted&&await T({attempt:b,request:m,response:w})){let g=w.headers.get("retry-after");await w.body?.cancel().catch(()=>{}),await $(z(l,b,g),x);continue}return{response:w,context:m}}}function M(e){return encodeURIComponent(e).replace(/%(3A|2F|3F|23|5B|5D|40|21|24|26|27|28|29|2A|2B|2C|3B|3D)/g,t=>decodeURIComponent(t))}function X(e,t){return e.replace(/\{([^{}]+)\}/g,(n,o)=>{let r=t[o];if(r===void 0)throw new Error(`Missing path parameter "${o}"`);return encodeURIComponent(String(r))})}function Y(e,t,n,o){let r=e.length;for(;r>0&&e.charCodeAt(r-1)===47;)r--;let s=e.slice(0,r)+t;if(!n)return s;let d=new URLSearchParams,a=[];for(let[u,i]of Object.entries(n)){if(i==null)continue;let c=o?.[u];if(!c){if(Array.isArray(i))for(let l of i)l!=null&&d.append(u,String(l));else if(Object(i)===i)for(let[l,p]of Object.entries(i))p!=null&&d.append(`${u}[${l}]`,String(p));else d.append(u,String(i));continue}if(Array.isArray(i)){let l=i.filter(p=>p!=null).map(String);if(c.style==="form"&&c.explode)for(let p of l)c.allowReserved?a.push(`${u}=${M(p)}`):d.append(u,p);else{let p=c.style==="pipeDelimited"?"|":c.style==="spaceDelimited"?"%20":",",h=c.allowReserved?M:encodeURIComponent;a.push(`${encodeURIComponent(u)}=${l.map(h).join(p)}`)}}else if(Object(i)===i)for(let[l,p]of Object.entries(i))p!=null&&(c.allowReserved?a.push(`${u}[${l}]=${M(String(p))}`):d.append(`${u}[${l}]`,String(p)));else c.allowReserved?a.push(`${u}=${M(String(i))}`):d.append(u,String(i))}let f=[d.toString(),...a].filter(Boolean).join("&");return f?`${s}?${f}`:s}function te(e){return e==="text"?"text/*":e==="blob"||e==="arrayBuffer"||e==="stream"||e==="formData"?"*/*":"application/json"}function re(e){return e.responseKind==="void"||e.responseKind==="blob"||e.responseKind==="text"?e.responseKind:"auto"}function he(e,t){let n={},o=new Set;for(let r of e.params??[])r.in==="path"&&(o.add(r.name),n[r.name]=t[r.name]);for(let r of Object.keys(t))if(!(r==="params"||r==="body"||r==="headers"||r==="cookies")&&!o.has(r))throw new TypeError(`Unknown argument "${r}" for operation "${e.id}". Query parameters go under params: { \u2026 } and the request body under body; valid keys are params, body, headers, cookies`+(o.size>0?`, and the path parameters (${[...o].join(", ")}).`:"."));return{path:n,query:t.params,body:t.body,headers:t.headers,cookies:t.cookies}}function we(e){let t;for(let n of e.params??[])n.in!=="query"||!(n.style!==void 0&&n.style!=="form"||n.explode===!1||n.allowReserved===!0)||(t??={},t[n.name]={style:n.style??"form",explode:n.explode??!0,allowReserved:n.allowReserved});return t}function be(e){let t={};for(let[n,o]of Object.entries(e??{}))o!=null&&(t[n]=String(o));return t}async function _(e,t,n,o,r){let{path:s,query:d,body:a,headers:f,cookies:u}=he(t,n),i=t.security?.length&&r.resolveAuth?await r.resolveAuth(t.security,e):{headers:{},query:{}},c=Object.entries(u??{}).filter(([,R])=>R!=null).map(([R,A])=>`${R}=${encodeURIComponent(String(A))}`);c.length>0&&(i.headers.Cookie=[i.headers.Cookie,...c].filter(Boolean).join("; "));let l={...d,...i.query},p=Y(e.serverUrl??"",X(t.path,s),Object.keys(l).length>0?l:void 0,we(t)),h={...o,method:t.method.toUpperCase(),headers:{...i.headers,...be(f),...D(o.headers)}};return{url:p,init:h,body:a}}async function xe(e,t,n,o,r){let s=await _(e,t,n,o,r),d={id:t.id,path:t.path,tags:[...t.tags??[]]},{parseAs:a,...f}=s.init,u=a??re(t),{response:i,context:c}=await I(e,d,s.url,f,s.body,t.body,r,te(u));if(e.errorMode==="result")return i.ok?{data:await L(i,u),error:void 0,response:i}:{data:void 0,error:await k(i),response:i};if(!i.ok){let l=new S(c.url,i.status,i.statusText,await k(i));for(let p of J(e))p.onError&&(l=await p.onError(l,c));throw l}return L(i,u)}function F(e,t){if(!e.paginate)throw new Error(`Pagination capability not wired: cannot iterate operation "${t.id}"`);return e.paginate}function Z(e,t){return t.errorMode!=="result"?e:async(n,o)=>{let r=await e(n,o);if(!r.response.ok){let{response:s}=r;throw new S(s.url,s.status,s.statusText,r.error)}return r.data}}function ee(e,t,n){return async(o={},r={})=>{let s=await _(e,t,o,r,n),{parseAs:d,...a}=s.init,f=d??re(t),u={id:t.id,path:t.path,tags:[...t.tags??[]]},{response:i}=await I(e,u,s.url,a,s.body,t.body,n,te(f));if(!i.ok)throw new S(s.url,i.status,i.statusText,await k(i));return{page:await L(i,f),linkHeader:i.headers.get("link"),url:i.url===""?s.url:i.url}}}function ne(e,t={},n={}){let o=t,r={...o,middleware:[...o.middleware??[]]},s={};for(let[d,a]of Object.entries(e))if(a.responseKind==="sse"){let f=(u={},i={})=>{if(!n.sse)throw new Error(`SSE capability not wired: cannot stream operation "${a.id}"`);let c=n.sse;return(async function*(){let l={id:a.id,path:a.path,tags:[...a.tags??[]]};yield*c(r,l,async()=>{let h=await _(r,a,u,i,n);return{url:h.url,init:h.init,body:h.body}},a.sseDataKind??"text")})()};Object.defineProperty(f,"name",{value:d}),Object.defineProperty(f,"operationId",{value:a.id}),s[d]=f}else{let f=(i={},c={})=>xe(r,a,i,c,n);Object.defineProperty(f,"name",{value:d}),Object.defineProperty(f,"operationId",{value:a.id});let u=a.pagination;s[d]=u===void 0?f:u.style==="link"?Object.assign(f,{pages:(i,c)=>F(n,a).pagesByLink(ee(r,a,n),i,c),items:(i,c)=>F(n,a).itemsByLink(ee(r,a,n),u,i,c)}):Object.assign(f,{pages:(i,c)=>F(n,a).pages(Z(f,r),u,i,c),items:(i,c)=>F(n,a).items(Z(f,r),u,i,c)})}return s.configure=d=>{let{errorMode:a,auth:f,...u}=d;Object.assign(r,u),f&&(r.auth={...r.auth,...f,...f.apiKey?{apiKey:{...r.auth?.apiKey,...f.apiKey}}:{}})},s.use=(...d)=>{r.middleware=[...r.middleware??[],...d]},s.auth={bearer(d){r.auth={...r.auth,bearer:d}},basic(d,a){r.auth={...r.auth,basic:{username:d,password:a}}},apiKey(d,a){r.auth={...r.auth,apiKey:{...r.auth?.apiKey,[d]:a}}}},s}function oe(e){let t=new FormData,n=(o,r)=>{r!=null&&(r instanceof Blob||typeof r=="string"?t.append(o,r):r instanceof Date?t.append(o,r.toISOString()):Object(r)===r?t.append(o,JSON.stringify(r)):t.append(o,String(r)))};for(let[o,r]of Object.entries(e))if(Array.isArray(r))for(let s of r)n(o,s);else n(o,r);return t}function N(e,t){if(t==="")return e;if(!t.startsWith("/"))return;let n=e;for(let o of t.slice(1).split("/")){let r=o.replaceAll("~1","/").replaceAll("~0","~");if(Array.isArray(n)){if(!/^(0|[1-9]\d*)$/.test(r))return;n=n[Number(r)]}else if(Object(n)===n&&r in n)n=n[r];else return}return n}async function*G(e,t,n={},o){if(t.style==="cursor"){let r=n.params?.[t.param];for(;;){let s={...n.params};r!==void 0&&(s[t.param]=r);let d=await e({...n,params:s},o);if(yield d,t.hasMore!==void 0&&N(d,t.hasMore)===!1)return;let a=N(d,t.nextCursor);if(a==null||a==="")return;if(typeof a!="string"&&typeof a!="number")throw new Error(`Pagination cursor at ${t.nextCursor} is not a string or number`);if(a===r)throw new Error("Pagination did not advance: operation returned the same cursor twice");r=a}}else{if(t.style==="link")throw new Error("link-style pagination iterates via pagesByLink");{let r=n.params?.[t.param],s=t.style==="page"?1:0,a=r==null||r===""||Number.isNaN(Number(r))?s:Number(r),f;for(;;){let u=await e({...n,params:{...n.params,[t.param]:a}},o),i=N(u,t.items),c=Array.isArray(i)?JSON.stringify(i):void 0;if(c!==void 0&&c===f)throw new Error("Pagination did not advance: the operation returned the same page twice");if(yield u,!Array.isArray(i)||i.length===0)return;f=c,a+=t.style==="page"?1:i.length}}}}async function*ie(e,t,n,o){for await(let r of G(e,t,n,o)){let s=N(r,t.items);Array.isArray(s)&&(yield*s)}}function ge(e){if(e!==null)for(let t of e.split(/,\s*(?=<)/)){let n=/^\s*<([^>]*)>(.*)$/.exec(t);if(!n)continue;let o=/;\s*rel\s*=\s*"?([^";]+)"?/i.exec(n[2]);if(o&&o[1].split(/\s+/).includes("next"))return n[1]}}async function*W(e,t={},n){let o=t.params,r;for(;;){let{page:s,linkHeader:d,url:a}=await e({...t,params:o},n);yield s;let f=ge(d);if(f===void 0)return;let u=new URL(a,"http://relative.invalid"),i=new URL(f,u).toString();if(i===r||i===u.toString())throw new Error('Pagination did not advance: the Link rel="next" target repeats');r=i;let c={};for(let[l,p]of new URL(i).searchParams){let h=c[l];h===void 0?c[l]=p:Array.isArray(h)?h.push(p):c[l]=[h,p]}o={...t.params,...c}}}async function*ae(e,t,n,o){for await(let r of W(e,n,o)){let s=N(r,t.items);Array.isArray(s)&&(yield*s)}}var Ee=/(?:\r\n|\r|\n){2}/,K=class extends Error{};async function*de(e,t,n,o="text"){let r,s,d=0;for(;;){let{url:a,init:f,body:u}=await n(),{reconnect:i=!0,reconnectDelay:c,...l}=f,p=l.signal??void 0;if(p?.aborted)return;let h={Accept:"text/event-stream",...D(l.headers)},R=r===void 0?h:{...h,"Last-Event-ID":r};try{let{response:m}=await I(e,t,a,{...l,method:l.method??"GET",headers:R,timeout:0},u,void 0,{});if(!m.ok){let T=await k(m);throw new S(a,m.status,m.statusText,T)}d=0;let v=m.body;if(!v)return;let C=v.getReader(),q=new TextDecoder,E="";try{for(;;){let{done:T,value:x}=await C.read();E+=T?q.decode():q.decode(x,{stream:!0});let b;for(;(b=Ee.exec(E))!==null;){let y=E.slice(0,b.index);E=E.slice(b.index+b[0].length);let w=se(y,o);w&&(w.id!==void 0&&(r=w.id),w.retry!==void 0&&(s=w.retry),yield w)}if(T){let y=E.length>0?se(E,o):void 0;y&&(y.id!==void 0&&(r=y.id),y.retry!==void 0&&(s=y.retry),yield y);return}if(E.length>1048576)throw new K("SSE frame exceeded 1048576 characters without a delimiter")}}finally{await C.cancel().catch(()=>{})}}catch(m){if(p?.aborted)return;if(m instanceof S||m instanceof K||!i)throw m}d++;let B=Math.min((s??c??1e3)*Math.pow(2,d-1),3e4);try{await $(Math.random()*B,p)}catch{return}}}function se(e,t){let n,o=[],r,s,d=!1;for(let u of e.split(/\r\n|\n|\r/)){if(u===""||u.startsWith(":"))continue;let i=u.indexOf(":"),c=i===-1?u:u.slice(0,i),l=i===-1?"":u.slice(i+1);l.startsWith(" ")&&(l=l.slice(1)),d=!0,c==="event"?n=l:c==="data"?o.push(l):c==="id"?r=l:c==="retry"&&/^\d+$/.test(l)&&(s=Number(l))}if(!d)return;let a=o.join(`
|
|
8
|
+
`),f=a;if(t==="json"&&a!=="")try{f=JSON.parse(a)}catch(u){throw new K(`Failed to parse SSE event data as JSON: ${u instanceof Error?u.message:String(u)}`)}return{event:n,data:f,id:r,retry:s}}function ue(e,t={}){return{...e?.config,...t,middleware:[...e?.middleware??[],...t.middleware??[]]}}function Se(e,t){return ne(e,t,{serializeMultipart:oe,resolveAuth:Q,sse:de,paginate:{pages:G,items:ie,pagesByLink:W,itemsByLink:ae}})}function Ae(e,t){let n={...e};for(let[o,r]of Object.entries(t))r!==void 0&&(n[o]=r);return n}function nt(e){return e}async function it(e){return(await import("./47NNACMG.js")).generateClient(e)}export{S as ApiError,ce as NotSupportedError,O as TimeoutError,Se as createClient,U as defaultRetryOn,fe as defineClientSetup,nt as defineGenerator,it as generateClient,Ae as mergeConfig,ue as mergeSetup};
|
package/lib/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import { dirname as __pathDirname } from 'node:path';
|
|
|
5
5
|
const require = __createRequire(import.meta.url);
|
|
6
6
|
var __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
var __dirname = __pathDirname(__filename);
|
|
8
|
-
import{a as Ai,c as vi}from"./chunks/OFAMJNQ6.js";import{a as ui,b as fi,c as rt,d as mi,e as gn,f as He,g as Wt,h as di,i as hi,j as yo,k as gi,l as fr,m as Pe,n as yn,o as yi,p as bi,q as Si,r as wi,s as kr,t as bo,u as mt,v as Ur}from"./chunks/UN3N7VZE.js";import{a as Sn,b as Ci,c as xi}from"./chunks/DO2OO6JA.js";import{a as qt,b as W}from"./chunks/FJ3ZKIJG.js";import{a as fn,b as ur,c as go,d as li,e as dn,f as pi,g as hn,h as Fr}from"./chunks/XWDP43JH.js";import{a as ai,c as mn,d as ho}from"./chunks/P26PQ2RU.js";import"./chunks/RS5PUOTT.js";import{a as tt,b as si,c as ii}from"./chunks/7LVD3IVI.js";import{a as ci}from"./chunks/O6MCQRCP.js";import{c as bn,d as Ei,f as Oi}from"./chunks/N2HAOFWU.js";import"./chunks/O6PRCLSV.js";import"./chunks/32XCOMOR.js";import{$ as ri,A as Zs,C as Qs,D as ye,F as Ne,G as pe,H as ee,I as Q,J as et,K as de,L as Fe,M as ue,N as Nr,O as y,Q as lr,R as ut,T as ei,U as ti,W as ft,X as ln,Y as Lr,_ as Mr,a as Ws,aa as pr,b as Rt,c as re,ca as ni,d as yt,da as Ot,ea as pn,f as zs,fa as un,g as Vs,ga as ze,h as an,i as mo,j as Bs,ja as oi,l as Ie,la as Ve,n as Me,o as Gs,p as cn,q as _e,r as Hs,s as Ys,t as Ks,u as cr,y as Js,z as Xs}from"./chunks/PQKTPLKO.js";import"./chunks/NEWT5A6S.js";import{a as We,c as B,e as Pt}from"./chunks/RFWIIJFG.js";var mr=B((Ab,Pi)=>{"use strict";var af="2.0.0",cf=Number.MAX_SAFE_INTEGER||9007199254740991,lf=16,pf=250,uf=["major","premajor","minor","preminor","patch","prepatch","prerelease"];Pi.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:lf,MAX_SAFE_BUILD_LENGTH:pf,MAX_SAFE_INTEGER:cf,RELEASE_TYPES:uf,SEMVER_SPEC_VERSION:af,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var qr=B((vb,Ri)=>{"use strict";var ff=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};Ri.exports=ff});var dr=B((bt,$i)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:So,MAX_SAFE_BUILD_LENGTH:mf,MAX_LENGTH:df}=mr(),hf=qr();bt=$i.exports={};var gf=bt.re=[],yf=bt.safeRe=[],T=bt.src=[],bf=bt.safeSrc=[],j=bt.t={},Sf=0,wo="[a-zA-Z0-9-]",wf=[["\\s",1],["\\d",df],[wo,mf]],Ef=t=>{for(let[e,r]of wf)t=t.split(`${e}*`).join(`${e}{0,${r}}`).split(`${e}+`).join(`${e}{1,${r}}`);return t},Z=(t,e,r)=>{let n=Ef(e),o=Sf++;hf(t,o,e),j[t]=o,T[o]=e,bf[o]=n,gf[o]=new RegExp(e,r?"g":void 0),yf[o]=new RegExp(n,r?"g":void 0)};Z("NUMERICIDENTIFIER","0|[1-9]\\d*");Z("NUMERICIDENTIFIERLOOSE","\\d+");Z("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${wo}*`);Z("MAINVERSION",`(${T[j.NUMERICIDENTIFIER]})\\.(${T[j.NUMERICIDENTIFIER]})\\.(${T[j.NUMERICIDENTIFIER]})`);Z("MAINVERSIONLOOSE",`(${T[j.NUMERICIDENTIFIERLOOSE]})\\.(${T[j.NUMERICIDENTIFIERLOOSE]})\\.(${T[j.NUMERICIDENTIFIERLOOSE]})`);Z("PRERELEASEIDENTIFIER",`(?:${T[j.NONNUMERICIDENTIFIER]}|${T[j.NUMERICIDENTIFIER]})`);Z("PRERELEASEIDENTIFIERLOOSE",`(?:${T[j.NONNUMERICIDENTIFIER]}|${T[j.NUMERICIDENTIFIERLOOSE]})`);Z("PRERELEASE",`(?:-(${T[j.PRERELEASEIDENTIFIER]}(?:\\.${T[j.PRERELEASEIDENTIFIER]})*))`);Z("PRERELEASELOOSE",`(?:-?(${T[j.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${T[j.PRERELEASEIDENTIFIERLOOSE]})*))`);Z("BUILDIDENTIFIER",`${wo}+`);Z("BUILD",`(?:\\+(${T[j.BUILDIDENTIFIER]}(?:\\.${T[j.BUILDIDENTIFIER]})*))`);Z("FULLPLAIN",`v?${T[j.MAINVERSION]}${T[j.PRERELEASE]}?${T[j.BUILD]}?`);Z("FULL",`^${T[j.FULLPLAIN]}$`);Z("LOOSEPLAIN",`[v=\\s]*${T[j.MAINVERSIONLOOSE]}${T[j.PRERELEASELOOSE]}?${T[j.BUILD]}?`);Z("LOOSE",`^${T[j.LOOSEPLAIN]}$`);Z("GTLT","((?:<|>)?=?)");Z("XRANGEIDENTIFIERLOOSE",`${T[j.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);Z("XRANGEIDENTIFIER",`${T[j.NUMERICIDENTIFIER]}|x|X|\\*`);Z("XRANGEPLAIN",`[v=\\s]*(${T[j.XRANGEIDENTIFIER]})(?:\\.(${T[j.XRANGEIDENTIFIER]})(?:\\.(${T[j.XRANGEIDENTIFIER]})(?:${T[j.PRERELEASE]})?${T[j.BUILD]}?)?)?`);Z("XRANGEPLAINLOOSE",`[v=\\s]*(${T[j.XRANGEIDENTIFIERLOOSE]})(?:\\.(${T[j.XRANGEIDENTIFIERLOOSE]})(?:\\.(${T[j.XRANGEIDENTIFIERLOOSE]})(?:${T[j.PRERELEASELOOSE]})?${T[j.BUILD]}?)?)?`);Z("XRANGE",`^${T[j.GTLT]}\\s*${T[j.XRANGEPLAIN]}$`);Z("XRANGELOOSE",`^${T[j.GTLT]}\\s*${T[j.XRANGEPLAINLOOSE]}$`);Z("COERCEPLAIN",`(^|[^\\d])(\\d{1,${So}})(?:\\.(\\d{1,${So}}))?(?:\\.(\\d{1,${So}}))?`);Z("COERCE",`${T[j.COERCEPLAIN]}(?:$|[^\\d])`);Z("COERCEFULL",T[j.COERCEPLAIN]+`(?:${T[j.PRERELEASE]})?(?:${T[j.BUILD]})?(?:$|[^\\d])`);Z("COERCERTL",T[j.COERCE],!0);Z("COERCERTLFULL",T[j.COERCEFULL],!0);Z("LONETILDE","(?:~>?)");Z("TILDETRIM",`(\\s*)${T[j.LONETILDE]}\\s+`,!0);bt.tildeTrimReplace="$1~";Z("TILDE",`^${T[j.LONETILDE]}${T[j.XRANGEPLAIN]}$`);Z("TILDELOOSE",`^${T[j.LONETILDE]}${T[j.XRANGEPLAINLOOSE]}$`);Z("LONECARET","(?:\\^)");Z("CARETTRIM",`(\\s*)${T[j.LONECARET]}\\s+`,!0);bt.caretTrimReplace="$1^";Z("CARET",`^${T[j.LONECARET]}${T[j.XRANGEPLAIN]}$`);Z("CARETLOOSE",`^${T[j.LONECARET]}${T[j.XRANGEPLAINLOOSE]}$`);Z("COMPARATORLOOSE",`^${T[j.GTLT]}\\s*(${T[j.LOOSEPLAIN]})$|^$`);Z("COMPARATOR",`^${T[j.GTLT]}\\s*(${T[j.FULLPLAIN]})$|^$`);Z("COMPARATORTRIM",`(\\s*)${T[j.GTLT]}\\s*(${T[j.LOOSEPLAIN]}|${T[j.XRANGEPLAIN]})`,!0);bt.comparatorTrimReplace="$1$2$3";Z("HYPHENRANGE",`^\\s*(${T[j.XRANGEPLAIN]})\\s+-\\s+(${T[j.XRANGEPLAIN]})\\s*$`);Z("HYPHENRANGELOOSE",`^\\s*(${T[j.XRANGEPLAINLOOSE]})\\s+-\\s+(${T[j.XRANGEPLAINLOOSE]})\\s*$`);Z("STAR","(<|>)?=?\\s*\\*");Z("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");Z("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var wn=B((Pb,Ii)=>{"use strict";var Of=Object.freeze({loose:!0}),Cf=Object.freeze({}),xf=t=>t?typeof t!="object"?Of:t:Cf;Ii.exports=xf});var Eo=B((Rb,ji)=>{"use strict";var _i=/^[0-9]+$/,Ti=(t,e)=>{if(typeof t=="number"&&typeof e=="number")return t===e?0:t<e?-1:1;let r=_i.test(t),n=_i.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t<e?-1:1},Af=(t,e)=>Ti(e,t);ji.exports={compareIdentifiers:Ti,rcompareIdentifiers:Af}});var Te=B(($b,Ni)=>{"use strict";var En=qr(),{MAX_LENGTH:Di,MAX_SAFE_INTEGER:On}=mr(),{safeRe:Cn,t:xn}=dr(),vf=wn(),{compareIdentifiers:Oo}=Eo(),Pf=(t,e)=>{let r=e.split(".");if(r.length>t.length)return!1;for(let n=0;n<r.length;n++)if(Oo(t[n],r[n])!==0)return!1;return!0},Co=class t{constructor(e,r){if(r=vf(r),e instanceof t){if(e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>Di)throw new TypeError(`version is longer than ${Di} characters`);En("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=e.trim().match(r.loose?Cn[xn.LOOSE]:Cn[xn.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>On||this.major<0)throw new TypeError("Invalid major version");if(this.minor>On||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>On||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(o=>{if(/^[0-9]+$/.test(o)){let s=+o;if(s>=0&&s<On)return s}return o}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(En("SemVer.compare",this.version,this.options,e),!(e instanceof t)){if(typeof e=="string"&&e===this.version)return 0;e=new t(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof t||(e=new t(e,this.options)),this.major<e.major?-1:this.major>e.major?1:this.minor<e.minor?-1:this.minor>e.minor?1:this.patch<e.patch?-1:this.patch>e.patch?1:0}comparePre(e){if(e instanceof t||(e=new t(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let r=0;do{let n=this.prerelease[r],o=e.prerelease[r];if(En("prerelease compare",r,n,o),n===void 0&&o===void 0)return 0;if(o===void 0)return 1;if(n===void 0)return-1;if(n===o)continue;return Oo(n,o)}while(++r)}compareBuild(e){e instanceof t||(e=new t(e,this.options));let r=0;do{let n=this.build[r],o=e.build[r];if(En("build compare",r,n,o),n===void 0&&o===void 0)return 0;if(o===void 0)return 1;if(n===void 0)return-1;if(n===o)continue;return Oo(n,o)}while(++r)}inc(e,r,n){if(e.startsWith("pre")){if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(r){let o=`-${r}`.match(this.options.loose?Cn[xn.PRERELEASELOOSE]:Cn[xn.PRERELEASE]);if(!o||o[1]!==r)throw new Error(`invalid identifier: ${r}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let o=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[o];else{let s=this.prerelease.length;for(;--s>=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(o)}}if(r){let s=[r,o];if(n===!1&&(s=[r]),Pf(this.prerelease,r)){let i=this.prerelease[r.split(".").length];isNaN(i)&&(this.prerelease=s)}else this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};Ni.exports=Co});var $t=B((Ib,Mi)=>{"use strict";var Li=Te(),Rf=(t,e,r=!1)=>{if(t instanceof Li)return t;try{return new Li(t,e)}catch(n){if(!r)return null;throw n}};Mi.exports=Rf});var ki=B((_b,Fi)=>{"use strict";var $f=$t(),If=(t,e)=>{let r=$f(t,e);return r?r.version:null};Fi.exports=If});var qi=B((Tb,Ui)=>{"use strict";var _f=$t(),Tf=(t,e)=>{let r=_f(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null};Ui.exports=Tf});var Vi=B((jb,zi)=>{"use strict";var Wi=Te(),jf=(t,e,r,n,o)=>{typeof r=="string"&&(o=n,n=r,r=void 0);try{return new Wi(t instanceof Wi?t.version:t,r).inc(e,n,o).version}catch{return null}};zi.exports=jf});var Hi=B((Db,Gi)=>{"use strict";var Bi=$t(),Df=(t,e)=>{let r=Bi(t,null,!0),n=Bi(e,null,!0),o=r.compare(n);if(o===0)return null;let s=o>0,i=s?r:n,a=s?n:r,c=!!i.prerelease.length;if(!!a.prerelease.length&&!c){if(!a.patch&&!a.minor)return"major";if(a.compareMain(i)===0)return a.minor&&!a.patch?"minor":"patch"}let u=c?"pre":"";return r.major!==n.major?u+"major":r.minor!==n.minor?u+"minor":r.patch!==n.patch?u+"patch":"prerelease"};Gi.exports=Df});var Ki=B((Nb,Yi)=>{"use strict";var Nf=Te(),Lf=(t,e)=>new Nf(t,e).major;Yi.exports=Lf});var Xi=B((Lb,Ji)=>{"use strict";var Mf=Te(),Ff=(t,e)=>new Mf(t,e).minor;Ji.exports=Ff});var Qi=B((Mb,Zi)=>{"use strict";var kf=Te(),Uf=(t,e)=>new kf(t,e).patch;Zi.exports=Uf});var ta=B((Fb,ea)=>{"use strict";var qf=$t(),Wf=(t,e)=>{let r=qf(t,e);return r&&r.prerelease.length?r.prerelease:null};ea.exports=Wf});var nt=B((kb,na)=>{"use strict";var ra=Te(),zf=(t,e,r)=>new ra(t,r).compare(new ra(e,r));na.exports=zf});var sa=B((Ub,oa)=>{"use strict";var Vf=nt(),Bf=(t,e,r)=>Vf(e,t,r);oa.exports=Bf});var aa=B((qb,ia)=>{"use strict";var Gf=nt(),Hf=(t,e)=>Gf(t,e,!0);ia.exports=Hf});var An=B((Wb,la)=>{"use strict";var ca=Te(),Yf=(t,e,r)=>{let n=new ca(t,r),o=new ca(e,r);return n.compare(o)||n.compareBuild(o)};la.exports=Yf});var ua=B((zb,pa)=>{"use strict";var Kf=An(),Jf=(t,e)=>t.sort((r,n)=>Kf(r,n,e));pa.exports=Jf});var ma=B((Vb,fa)=>{"use strict";var Xf=An(),Zf=(t,e)=>t.sort((r,n)=>Xf(n,r,e));fa.exports=Zf});var Wr=B((Bb,da)=>{"use strict";var Qf=nt(),em=(t,e,r)=>Qf(t,e,r)>0;da.exports=em});var vn=B((Gb,ha)=>{"use strict";var tm=nt(),rm=(t,e,r)=>tm(t,e,r)<0;ha.exports=rm});var xo=B((Hb,ga)=>{"use strict";var nm=nt(),om=(t,e,r)=>nm(t,e,r)===0;ga.exports=om});var Ao=B((Yb,ya)=>{"use strict";var sm=nt(),im=(t,e,r)=>sm(t,e,r)!==0;ya.exports=im});var Pn=B((Kb,ba)=>{"use strict";var am=nt(),cm=(t,e,r)=>am(t,e,r)>=0;ba.exports=cm});var Rn=B((Jb,Sa)=>{"use strict";var lm=nt(),pm=(t,e,r)=>lm(t,e,r)<=0;Sa.exports=pm});var vo=B((Xb,wa)=>{"use strict";var um=xo(),fm=Ao(),mm=Wr(),dm=Pn(),hm=vn(),gm=Rn(),ym=(t,e,r,n)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t===r;case"!==":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t!==r;case"":case"=":case"==":return um(t,r,n);case"!=":return fm(t,r,n);case">":return mm(t,r,n);case">=":return dm(t,r,n);case"<":return hm(t,r,n);case"<=":return gm(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}};wa.exports=ym});var Oa=B((Zb,Ea)=>{"use strict";var bm=Te(),Sm=$t(),{safeRe:$n,t:In}=dr(),wm=(t,e)=>{if(t instanceof bm)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let r=null;if(!e.rtl)r=t.match(e.includePrerelease?$n[In.COERCEFULL]:$n[In.COERCE]);else{let c=e.includePrerelease?$n[In.COERCERTLFULL]:$n[In.COERCERTL],p;for(;(p=c.exec(t))&&(!r||r.index+r[0].length!==t.length);)(!r||p.index+p[0].length!==r.index+r[0].length)&&(r=p),c.lastIndex=p.index+p[1].length+p[2].length;c.lastIndex=-1}if(r===null)return null;let n=r[2],o=r[3]||"0",s=r[4]||"0",i=e.includePrerelease&&r[5]?`-${r[5]}`:"",a=e.includePrerelease&&r[6]?`+${r[6]}`:"";return Sm(`${n}.${o}.${s}${i}${a}`,e)};Ea.exports=wm});var xa=B((Qb,Ca)=>{"use strict";var Em=$t(),Om=mr(),Cm=Te(),xm=(t,e,r)=>{if(!Om.RELEASE_TYPES.includes(e))return null;let n=Am(t,r);return n&&vm(n,e)},Am=(t,e)=>{let r=t instanceof Cm?t.version:t;return Em(r,e)},vm=(t,e)=>{if(Pm(e))return t.version;switch(t.prerelease=[],e){case"major":t.minor=0,t.patch=0;break;case"minor":t.patch=0;break}return t.format()},Pm=t=>t.startsWith("pre");Ca.exports=xm});var va=B((eS,Aa)=>{"use strict";var Po=class{constructor(){this.max=1e3,this.map=new Map}get(e){let r=this.map.get(e);if(r!==void 0)return this.map.delete(e),this.map.set(e,r),r}delete(e){return this.map.delete(e)}set(e,r){if(!this.delete(e)&&r!==void 0){if(this.map.size>=this.max){let o=this.map.keys().next().value;this.delete(o)}this.map.set(e,r)}return this}};Aa.exports=Po});var ot=B((tS,Ia)=>{"use strict";var Rm=/\s+/g,Ro=class t{constructor(e,r){if(r=Im(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof $o)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=e.trim().replace(Rm," "),this.set=this.raw.split("||").map(n=>this.parseRange(n.trim())).filter(n=>n.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let n=this.set[0];if(this.set=this.set.filter(o=>!Ra(o[0])),this.set.length===0)this.set=[n];else if(this.set.length>1){for(let o of this.set)if(o.length===1&&km(o[0])){this.set=[o];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let r=this.set[e];for(let n=0;n<r.length;n++)n>0&&(this.formatted+=" "),this.formatted+=r[n].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){e=e.replace(Fm,"");let n=((this.options.includePrerelease&&Lm)|(this.options.loose&&Mm))+":"+e,o=Pa.get(n);if(o)return o;let s=this.options.loose,i=s?ke[je.HYPHENRANGELOOSE]:ke[je.HYPHENRANGE];e=e.replace(i,Jm(this.options.includePrerelease)),fe("hyphen replace",e),e=e.replace(ke[je.COMPARATORTRIM],jm),fe("comparator trim",e),e=e.replace(ke[je.TILDETRIM],Dm),fe("tilde trim",e),e=e.replace(ke[je.CARETTRIM],Nm),fe("caret trim",e);let a=e.split(" ").map(l=>Um(l,this.options)).join(" ").split(/\s+/).map(l=>Km(l,this.options));s&&(a=a.filter(l=>(fe("loose invalid filter",l,this.options),!!l.match(ke[je.COMPARATORLOOSE])))),fe("range list",a);let c=new Map,p=a.map(l=>new $o(l,this.options));for(let l of p){if(Ra(l))return[l];c.set(l.value,l)}c.size>1&&c.has("")&&c.delete("");let u=[...c.values()];return Pa.set(n,u),u}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(n=>$a(n,r)&&e.set.some(o=>$a(o,r)&&n.every(s=>o.every(i=>s.intersects(i,r)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new _m(e,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(Xm(this.set[r],e,this.options))return!0;return!1}};Ia.exports=Ro;var $m=va(),Pa=new $m,Im=wn(),$o=zr(),fe=qr(),_m=Te(),{safeRe:ke,src:Tm,t:je,comparatorTrimReplace:jm,tildeTrimReplace:Dm,caretTrimReplace:Nm}=dr(),{FLAG_INCLUDE_PRERELEASE:Lm,FLAG_LOOSE:Mm}=mr(),Fm=new RegExp(Tm[je.BUILD],"g"),Ra=t=>t.value==="<0.0.0-0",km=t=>t.value==="",$a=(t,e)=>{let r=!0,n=t.slice(),o=n.pop();for(;r&&n.length;)r=n.every(s=>o.intersects(s,e)),o=n.pop();return r},Um=(t,e)=>(t=t.replace(ke[je.BUILD],""),fe("comp",t,e),t=Vm(t,e),fe("caret",t),t=Wm(t,e),fe("tildes",t),t=Gm(t,e),fe("xrange",t),t=Ym(t,e),fe("stars",t),t),Ce=t=>!t||t.toLowerCase()==="x"||t==="*",qm=(t,e,r)=>Ce(t)&&!Ce(e)||Ce(e)&&r&&!Ce(r),Wm=(t,e)=>t.trim().split(/\s+/).map(r=>zm(r,e)).join(" "),zm=(t,e)=>{let r=e.loose?ke[je.TILDELOOSE]:ke[je.TILDE],n=e.includePrerelease?"-0":"";return t.replace(r,(o,s,i,a,c)=>{fe("tilde",t,o,s,i,a,c);let p;return Ce(s)?p="":Ce(i)?p=`>=${s}.0.0${n} <${+s+1}.0.0-0`:Ce(a)?p=`>=${s}.${i}.0${n} <${s}.${+i+1}.0-0`:c?(fe("replaceTilde pr",c),p=`>=${s}.${i}.${a}-${c} <${s}.${+i+1}.0-0`):p=`>=${s}.${i}.${a} <${s}.${+i+1}.0-0`,fe("tilde return",p),p})},Vm=(t,e)=>t.trim().split(/\s+/).map(r=>Bm(r,e)).join(" "),Bm=(t,e)=>{fe("caret",t,e);let r=e.loose?ke[je.CARETLOOSE]:ke[je.CARET],n=e.includePrerelease?"-0":"";return t.replace(r,(o,s,i,a,c)=>{fe("caret",t,o,s,i,a,c);let p;return Ce(s)?p="":Ce(i)?p=`>=${s}.0.0${n} <${+s+1}.0.0-0`:Ce(a)?s==="0"?p=`>=${s}.${i}.0${n} <${s}.${+i+1}.0-0`:p=`>=${s}.${i}.0${n} <${+s+1}.0.0-0`:c?(fe("replaceCaret pr",c),s==="0"?i==="0"?p=`>=${s}.${i}.${a}-${c} <${s}.${i}.${+a+1}-0`:p=`>=${s}.${i}.${a}-${c} <${s}.${+i+1}.0-0`:p=`>=${s}.${i}.${a}-${c} <${+s+1}.0.0-0`):(fe("no pr"),s==="0"?i==="0"?p=`>=${s}.${i}.${a} <${s}.${i}.${+a+1}-0`:p=`>=${s}.${i}.${a} <${s}.${+i+1}.0-0`:p=`>=${s}.${i}.${a} <${+s+1}.0.0-0`),fe("caret return",p),p})},Gm=(t,e)=>(fe("replaceXRanges",t,e),t.split(/\s+/).map(r=>Hm(r,e)).join(" ")),Hm=(t,e)=>{t=t.trim();let r=e.loose?ke[je.XRANGELOOSE]:ke[je.XRANGE];return t.replace(r,(n,o,s,i,a,c)=>{if(fe("xRange",t,n,o,s,i,a,c),qm(s,i,a))return t;let p=Ce(s),u=p||Ce(i),l=u||Ce(a),d=l;return o==="="&&d&&(o=""),c=e.includePrerelease?"-0":"",p?o===">"||o==="<"?n="<0.0.0-0":n="*":o&&d?(u&&(i=0),a=0,o===">"?(o=">=",u?(s=+s+1,i=0,a=0):(i=+i+1,a=0)):o==="<="&&(o="<",u?s=+s+1:i=+i+1),o==="<"&&(c="-0"),n=`${o+s}.${i}.${a}${c}`):u?n=`>=${s}.0.0${c} <${+s+1}.0.0-0`:l&&(n=`>=${s}.${i}.0${c} <${s}.${+i+1}.0-0`),fe("xRange return",n),n})},Ym=(t,e)=>(fe("replaceStars",t,e),t.trim().replace(ke[je.STAR],"")),Km=(t,e)=>(fe("replaceGTE0",t,e),t.trim().replace(ke[e.includePrerelease?je.GTE0PRE:je.GTE0],"")),Jm=t=>(e,r,n,o,s,i,a,c,p,u,l,d)=>(Ce(n)?r="":Ce(o)?r=`>=${n}.0.0${t?"-0":""}`:Ce(s)?r=`>=${n}.${o}.0${t?"-0":""}`:i?r=`>=${r}`:r=`>=${r}${t?"-0":""}`,Ce(p)?c="":Ce(u)?c=`<${+p+1}.0.0-0`:Ce(l)?c=`<${p}.${+u+1}.0-0`:d?c=`<=${p}.${u}.${l}-${d}`:t?c=`<${p}.${u}.${+l+1}-0`:c=`<=${c}`,`${r} ${c}`.trim()),Xm=(t,e,r)=>{for(let n=0;n<t.length;n++)if(!t[n].test(e))return!1;if(e.prerelease.length&&!r.includePrerelease){for(let n=0;n<t.length;n++)if(fe(t[n].semver),t[n].semver!==$o.ANY&&t[n].semver.prerelease.length>0){let o=t[n].semver;if(o.major===e.major&&o.minor===e.minor&&o.patch===e.patch)return!0}return!1}return!0}});var zr=B((rS,La)=>{"use strict";var Vr=Symbol("SemVer ANY"),To=class t{static get ANY(){return Vr}constructor(e,r){if(r=_a(r),e instanceof t){if(e.loose===!!r.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),_o("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===Vr?this.value="":this.value=this.operator+this.semver.version,_o("comp",this)}parse(e){let r=this.options.loose?Ta[ja.COMPARATORLOOSE]:Ta[ja.COMPARATOR],n=e.match(r);if(!n)throw new TypeError(`Invalid comparator: ${e}`);this.operator=n[1]!==void 0?n[1]:"",this.operator==="="&&(this.operator=""),n[2]?this.semver=new Da(n[2],this.options.loose):this.semver=Vr}toString(){return this.value}test(e){if(_o("Comparator.test",e,this.options.loose),this.semver===Vr||e===Vr)return!0;if(typeof e=="string")try{e=new Da(e,this.options)}catch{return!1}return Io(e,this.operator,this.semver,this.options)}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new Na(e.value,r).test(this.value):e.operator===""?e.value===""?!0:new Na(this.value,r).test(e.semver):(r=_a(r),r.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!r.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||Io(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||Io(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};La.exports=To;var _a=wn(),{safeRe:Ta,t:ja}=dr(),Io=vo(),_o=qr(),Da=Te(),Na=ot()});var Br=B((nS,Ma)=>{"use strict";var Zm=ot(),Qm=(t,e,r)=>{try{e=new Zm(e,r)}catch{return!1}return e.test(t)};Ma.exports=Qm});var ka=B((oS,Fa)=>{"use strict";var ed=ot(),td=(t,e)=>new ed(t,e).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));Fa.exports=td});var qa=B((sS,Ua)=>{"use strict";var rd=Te(),nd=ot(),od=(t,e,r)=>{let n=null,o=null,s=null;try{s=new nd(e,r)}catch{return null}return t.forEach(i=>{s.test(i)&&(!n||o.compare(i)===-1)&&(n=i,o=new rd(n,r))}),n};Ua.exports=od});var za=B((iS,Wa)=>{"use strict";var sd=Te(),id=ot(),ad=(t,e,r)=>{let n=null,o=null,s=null;try{s=new id(e,r)}catch{return null}return t.forEach(i=>{s.test(i)&&(!n||o.compare(i)===1)&&(n=i,o=new sd(n,r))}),n};Wa.exports=ad});var Ga=B((aS,Ba)=>{"use strict";var jo=Te(),cd=ot(),Va=Wr(),ld=(t,e)=>{t=new cd(t,e);let r=new jo("0.0.0");if(t.test(r)||(r=new jo("0.0.0-0"),t.test(r)))return r;r=null;for(let n=0;n<t.set.length;++n){let o=t.set[n],s=null;o.forEach(i=>{let a=new jo(i.semver.version);switch(i.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!s||Va(a,s))&&(s=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${i.operator}`)}}),s&&(!r||Va(r,s))&&(r=s)}return r&&t.test(r)?r:null};Ba.exports=ld});var Ya=B((cS,Ha)=>{"use strict";var pd=ot(),ud=(t,e)=>{try{return new pd(t,e).range||"*"}catch{return null}};Ha.exports=ud});var _n=B((lS,Za)=>{"use strict";var fd=Te(),Xa=zr(),{ANY:md}=Xa,dd=ot(),hd=Br(),Ka=Wr(),Ja=vn(),gd=Rn(),yd=Pn(),bd=(t,e,r,n)=>{t=new fd(t,n),e=new dd(e,n);let o,s,i,a,c;switch(r){case">":o=Ka,s=gd,i=Ja,a=">",c=">=";break;case"<":o=Ja,s=yd,i=Ka,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(hd(t,e,n))return!1;for(let p=0;p<e.set.length;++p){let u=e.set[p],l=null,d=null;if(u.forEach(m=>{m.semver===md&&(m=new Xa(">=0.0.0")),l=l||m,d=d||m,o(m.semver,l.semver,n)?l=m:i(m.semver,d.semver,n)&&(d=m)}),l.operator===a||l.operator===c||(!d.operator||d.operator===a)&&s(t,d.semver))return!1;if(d.operator===c&&i(t,d.semver))return!1}return!0};Za.exports=bd});var ec=B((pS,Qa)=>{"use strict";var Sd=_n(),wd=(t,e,r)=>Sd(t,e,">",r);Qa.exports=wd});var rc=B((uS,tc)=>{"use strict";var Ed=_n(),Od=(t,e,r)=>Ed(t,e,"<",r);tc.exports=Od});var sc=B((fS,oc)=>{"use strict";var nc=ot(),Cd=(t,e,r)=>(t=new nc(t,r),e=new nc(e,r),t.intersects(e,r));oc.exports=Cd});var ac=B((mS,ic)=>{"use strict";var xd=Br(),Ad=nt();ic.exports=(t,e,r)=>{let n=[],o=null,s=null,i=t.sort((u,l)=>Ad(u,l,r));for(let u of i)xd(u,e,r)?(s=u,o||(o=u)):(s&&n.push([o,s]),s=null,o=null);o&&n.push([o,null]);let a=[];for(let[u,l]of n)u===l?a.push(u):!l&&u===i[0]?a.push("*"):l?u===i[0]?a.push(`<=${l}`):a.push(`${u} - ${l}`):a.push(`>=${u}`);let c=a.join(" || "),p=typeof e.raw=="string"?e.raw:String(e);return c.length<p.length?c:e}});var mc=B((dS,fc)=>{"use strict";var cc=ot(),Lo=zr(),{ANY:Do}=Lo,No=Br(),Mo=nt(),vd=(t,e,r={})=>{if(t===e)return!0;t=new cc(t,r),e=new cc(e,r);let n=!1;e:for(let o of t.set){for(let s of e.set){let i=Rd(o,s,r);if(n=n||i!==null,i)continue e}if(n)return!1}return!0},Pd=[new Lo(">=0.0.0-0")],lc=[new Lo(">=0.0.0")],Rd=(t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===Do){if(e.length===1&&e[0].semver===Do)return!0;r.includePrerelease?t=Pd:t=lc}if(e.length===1&&e[0].semver===Do){if(r.includePrerelease)return!0;e=lc}let n=new Set,o,s;for(let m of t)m.operator===">"||m.operator===">="?o=pc(o,m,r):m.operator==="<"||m.operator==="<="?s=uc(s,m,r):n.add(m.semver);if(n.size>1)return null;let i;if(o&&s){if(i=Mo(o.semver,s.semver,r),i>0)return null;if(i===0&&(o.operator!==">="||s.operator!=="<="))return null}for(let m of n){if(o&&!No(m,String(o),r)||s&&!No(m,String(s),r))return null;for(let w of e)if(!No(m,String(w),r))return!1;return!0}let a,c,p,u,l=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1,d=o&&!r.includePrerelease&&o.semver.prerelease.length?o.semver:!1;l&&l.prerelease.length===1&&s.operator==="<"&&l.prerelease[0]===0&&(l=!1);for(let m of e){if(u=u||m.operator===">"||m.operator===">=",p=p||m.operator==="<"||m.operator==="<=",o){if(d&&m.semver.prerelease&&m.semver.prerelease.length&&m.semver.major===d.major&&m.semver.minor===d.minor&&m.semver.patch===d.patch&&(d=!1),m.operator===">"||m.operator===">="){if(a=pc(o,m,r),a===m&&a!==o)return!1}else if(o.operator===">="&&!m.test(o.semver))return!1}if(s){if(l&&m.semver.prerelease&&m.semver.prerelease.length&&m.semver.major===l.major&&m.semver.minor===l.minor&&m.semver.patch===l.patch&&(l=!1),m.operator==="<"||m.operator==="<="){if(c=uc(s,m,r),c===m&&c!==s)return!1}else if(s.operator==="<="&&!m.test(s.semver))return!1}if(!m.operator&&(s||o)&&i!==0)return!1}return!(o&&p&&!s&&i!==0||s&&u&&!o&&i!==0||d||l)},pc=(t,e,r)=>{if(!t)return e;let n=Mo(t.semver,e.semver,r);return n>0?t:n<0||e.operator===">"&&t.operator===">="?e:t},uc=(t,e,r)=>{if(!t)return e;let n=Mo(t.semver,e.semver,r);return n<0?t:n>0||e.operator==="<"&&t.operator==="<="?e:t};fc.exports=vd});var ko=B((hS,gc)=>{"use strict";var Fo=dr(),dc=mr(),$d=Te(),hc=Eo(),Id=$t(),_d=ki(),Td=qi(),jd=Vi(),Dd=Hi(),Nd=Ki(),Ld=Xi(),Md=Qi(),Fd=ta(),kd=nt(),Ud=sa(),qd=aa(),Wd=An(),zd=ua(),Vd=ma(),Bd=Wr(),Gd=vn(),Hd=xo(),Yd=Ao(),Kd=Pn(),Jd=Rn(),Xd=vo(),Zd=Oa(),Qd=xa(),eh=zr(),th=ot(),rh=Br(),nh=ka(),oh=qa(),sh=za(),ih=Ga(),ah=Ya(),ch=_n(),lh=ec(),ph=rc(),uh=sc(),fh=ac(),mh=mc();gc.exports={parse:Id,valid:_d,clean:Td,inc:jd,diff:Dd,major:Nd,minor:Ld,patch:Md,prerelease:Fd,compare:kd,rcompare:Ud,compareLoose:qd,compareBuild:Wd,sort:zd,rsort:Vd,gt:Bd,lt:Gd,eq:Hd,neq:Yd,gte:Kd,lte:Jd,cmp:Xd,coerce:Zd,truncate:Qd,Comparator:eh,Range:th,satisfies:rh,toComparators:nh,maxSatisfying:oh,minSatisfying:sh,minVersion:ih,validRange:ah,outside:ch,gtr:lh,ltr:ph,intersects:uh,simplifyRange:fh,subset:mh,SemVer:$d,re:Fo.re,src:Fo.src,tokens:Fo.t,SEMVER_SPEC_VERSION:dc.SEMVER_SPEC_VERSION,RELEASE_TYPES:dc.RELEASE_TYPES,compareIdentifiers:hc.compareIdentifiers,rcompareIdentifiers:hc.rcompareIdentifiers}});var bc=B((bS,dh)=>{dh.exports={name:"dotenv",version:"16.4.7",description:"Loads environment variables from .env file",main:"lib/main.js",types:"lib/main.d.ts",exports:{".":{types:"./lib/main.d.ts",require:"./lib/main.js",default:"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},scripts:{"dts-check":"tsc --project tests/types/tsconfig.json",lint:"standard",pretest:"npm run lint && npm run dts-check",test:"tap run --allow-empty-coverage --disable-coverage --timeout=60000","test:coverage":"tap run --show-full-coverage --timeout=60000 --coverage-report=lcov",prerelease:"npm test",release:"standard-version"},repository:{type:"git",url:"git://github.com/motdotla/dotenv.git"},funding:"https://dotenvx.com",keywords:["dotenv","env",".env","environment","variables","config","settings"],readmeFilename:"README.md",license:"BSD-2-Clause",devDependencies:{"@types/node":"^18.11.3",decache:"^4.6.2",sinon:"^14.0.1",standard:"^17.0.0","standard-version":"^9.5.0",tap:"^19.2.0",typescript:"^4.8.4"},engines:{node:">=12"},browser:{fs:!1}}});var Vo=B((SS,Ct)=>{var qo=We("fs"),Wo=We("path"),hh=We("os"),gh=We("crypto"),yh=bc(),zo=yh.version,bh=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function Sh(t){let e={},r=t.toString();r=r.replace(/\r\n?/mg,`
|
|
8
|
+
import{a as Ai,c as vi}from"./chunks/OFAMJNQ6.js";import{a as ui,b as fi,c as rt,d as mi,e as gn,f as He,g as Wt,h as di,i as hi,j as yo,k as gi,l as fr,m as Pe,n as yn,o as yi,p as bi,q as Si,r as wi,s as kr,t as bo,u as mt,v as Ur}from"./chunks/WF2UYHZN.js";import{a as Sn,b as Ci,c as xi}from"./chunks/EK3VLO23.js";import{a as qt,b as W}from"./chunks/6HPPISLY.js";import{a as fn,b as ur,c as go,d as li,e as dn,f as pi,g as hn,h as Fr}from"./chunks/O2L5BSHC.js";import{a as ai,c as mn,d as ho}from"./chunks/P26PQ2RU.js";import"./chunks/RS5PUOTT.js";import{a as tt,b as si,c as ii}from"./chunks/A7L35TO3.js";import{a as ci}from"./chunks/O6MCQRCP.js";import{c as bn,d as Ei,f as Oi}from"./chunks/GO4N3KXL.js";import"./chunks/O6PRCLSV.js";import"./chunks/32XCOMOR.js";import{$ as ri,A as Zs,C as Qs,D as ye,F as Ne,G as pe,H as ee,I as Q,J as et,K as de,L as Fe,M as ue,N as Nr,O as y,Q as lr,R as ut,T as ei,U as ti,W as ft,X as ln,Y as Lr,_ as Mr,a as Ws,aa as pr,b as Rt,c as re,ca as ni,d as yt,da as Ot,ea as pn,f as zs,fa as un,g as Vs,ga as ze,h as an,i as mo,j as Bs,ja as oi,l as Ie,la as Ve,n as Me,o as Gs,p as cn,q as _e,r as Hs,s as Ys,t as Ks,u as cr,y as Js,z as Xs}from"./chunks/DLYUMFFQ.js";import"./chunks/NEWT5A6S.js";import{a as We,c as B,e as Pt}from"./chunks/RFWIIJFG.js";var mr=B((Ab,Pi)=>{"use strict";var af="2.0.0",cf=Number.MAX_SAFE_INTEGER||9007199254740991,lf=16,pf=250,uf=["major","premajor","minor","preminor","patch","prepatch","prerelease"];Pi.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:lf,MAX_SAFE_BUILD_LENGTH:pf,MAX_SAFE_INTEGER:cf,RELEASE_TYPES:uf,SEMVER_SPEC_VERSION:af,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var qr=B((vb,Ri)=>{"use strict";var ff=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};Ri.exports=ff});var dr=B((bt,$i)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:So,MAX_SAFE_BUILD_LENGTH:mf,MAX_LENGTH:df}=mr(),hf=qr();bt=$i.exports={};var gf=bt.re=[],yf=bt.safeRe=[],T=bt.src=[],bf=bt.safeSrc=[],j=bt.t={},Sf=0,wo="[a-zA-Z0-9-]",wf=[["\\s",1],["\\d",df],[wo,mf]],Ef=t=>{for(let[e,r]of wf)t=t.split(`${e}*`).join(`${e}{0,${r}}`).split(`${e}+`).join(`${e}{1,${r}}`);return t},Z=(t,e,r)=>{let n=Ef(e),o=Sf++;hf(t,o,e),j[t]=o,T[o]=e,bf[o]=n,gf[o]=new RegExp(e,r?"g":void 0),yf[o]=new RegExp(n,r?"g":void 0)};Z("NUMERICIDENTIFIER","0|[1-9]\\d*");Z("NUMERICIDENTIFIERLOOSE","\\d+");Z("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${wo}*`);Z("MAINVERSION",`(${T[j.NUMERICIDENTIFIER]})\\.(${T[j.NUMERICIDENTIFIER]})\\.(${T[j.NUMERICIDENTIFIER]})`);Z("MAINVERSIONLOOSE",`(${T[j.NUMERICIDENTIFIERLOOSE]})\\.(${T[j.NUMERICIDENTIFIERLOOSE]})\\.(${T[j.NUMERICIDENTIFIERLOOSE]})`);Z("PRERELEASEIDENTIFIER",`(?:${T[j.NONNUMERICIDENTIFIER]}|${T[j.NUMERICIDENTIFIER]})`);Z("PRERELEASEIDENTIFIERLOOSE",`(?:${T[j.NONNUMERICIDENTIFIER]}|${T[j.NUMERICIDENTIFIERLOOSE]})`);Z("PRERELEASE",`(?:-(${T[j.PRERELEASEIDENTIFIER]}(?:\\.${T[j.PRERELEASEIDENTIFIER]})*))`);Z("PRERELEASELOOSE",`(?:-?(${T[j.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${T[j.PRERELEASEIDENTIFIERLOOSE]})*))`);Z("BUILDIDENTIFIER",`${wo}+`);Z("BUILD",`(?:\\+(${T[j.BUILDIDENTIFIER]}(?:\\.${T[j.BUILDIDENTIFIER]})*))`);Z("FULLPLAIN",`v?${T[j.MAINVERSION]}${T[j.PRERELEASE]}?${T[j.BUILD]}?`);Z("FULL",`^${T[j.FULLPLAIN]}$`);Z("LOOSEPLAIN",`[v=\\s]*${T[j.MAINVERSIONLOOSE]}${T[j.PRERELEASELOOSE]}?${T[j.BUILD]}?`);Z("LOOSE",`^${T[j.LOOSEPLAIN]}$`);Z("GTLT","((?:<|>)?=?)");Z("XRANGEIDENTIFIERLOOSE",`${T[j.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);Z("XRANGEIDENTIFIER",`${T[j.NUMERICIDENTIFIER]}|x|X|\\*`);Z("XRANGEPLAIN",`[v=\\s]*(${T[j.XRANGEIDENTIFIER]})(?:\\.(${T[j.XRANGEIDENTIFIER]})(?:\\.(${T[j.XRANGEIDENTIFIER]})(?:${T[j.PRERELEASE]})?${T[j.BUILD]}?)?)?`);Z("XRANGEPLAINLOOSE",`[v=\\s]*(${T[j.XRANGEIDENTIFIERLOOSE]})(?:\\.(${T[j.XRANGEIDENTIFIERLOOSE]})(?:\\.(${T[j.XRANGEIDENTIFIERLOOSE]})(?:${T[j.PRERELEASELOOSE]})?${T[j.BUILD]}?)?)?`);Z("XRANGE",`^${T[j.GTLT]}\\s*${T[j.XRANGEPLAIN]}$`);Z("XRANGELOOSE",`^${T[j.GTLT]}\\s*${T[j.XRANGEPLAINLOOSE]}$`);Z("COERCEPLAIN",`(^|[^\\d])(\\d{1,${So}})(?:\\.(\\d{1,${So}}))?(?:\\.(\\d{1,${So}}))?`);Z("COERCE",`${T[j.COERCEPLAIN]}(?:$|[^\\d])`);Z("COERCEFULL",T[j.COERCEPLAIN]+`(?:${T[j.PRERELEASE]})?(?:${T[j.BUILD]})?(?:$|[^\\d])`);Z("COERCERTL",T[j.COERCE],!0);Z("COERCERTLFULL",T[j.COERCEFULL],!0);Z("LONETILDE","(?:~>?)");Z("TILDETRIM",`(\\s*)${T[j.LONETILDE]}\\s+`,!0);bt.tildeTrimReplace="$1~";Z("TILDE",`^${T[j.LONETILDE]}${T[j.XRANGEPLAIN]}$`);Z("TILDELOOSE",`^${T[j.LONETILDE]}${T[j.XRANGEPLAINLOOSE]}$`);Z("LONECARET","(?:\\^)");Z("CARETTRIM",`(\\s*)${T[j.LONECARET]}\\s+`,!0);bt.caretTrimReplace="$1^";Z("CARET",`^${T[j.LONECARET]}${T[j.XRANGEPLAIN]}$`);Z("CARETLOOSE",`^${T[j.LONECARET]}${T[j.XRANGEPLAINLOOSE]}$`);Z("COMPARATORLOOSE",`^${T[j.GTLT]}\\s*(${T[j.LOOSEPLAIN]})$|^$`);Z("COMPARATOR",`^${T[j.GTLT]}\\s*(${T[j.FULLPLAIN]})$|^$`);Z("COMPARATORTRIM",`(\\s*)${T[j.GTLT]}\\s*(${T[j.LOOSEPLAIN]}|${T[j.XRANGEPLAIN]})`,!0);bt.comparatorTrimReplace="$1$2$3";Z("HYPHENRANGE",`^\\s*(${T[j.XRANGEPLAIN]})\\s+-\\s+(${T[j.XRANGEPLAIN]})\\s*$`);Z("HYPHENRANGELOOSE",`^\\s*(${T[j.XRANGEPLAINLOOSE]})\\s+-\\s+(${T[j.XRANGEPLAINLOOSE]})\\s*$`);Z("STAR","(<|>)?=?\\s*\\*");Z("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");Z("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var wn=B((Pb,Ii)=>{"use strict";var Of=Object.freeze({loose:!0}),Cf=Object.freeze({}),xf=t=>t?typeof t!="object"?Of:t:Cf;Ii.exports=xf});var Eo=B((Rb,ji)=>{"use strict";var _i=/^[0-9]+$/,Ti=(t,e)=>{if(typeof t=="number"&&typeof e=="number")return t===e?0:t<e?-1:1;let r=_i.test(t),n=_i.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t<e?-1:1},Af=(t,e)=>Ti(e,t);ji.exports={compareIdentifiers:Ti,rcompareIdentifiers:Af}});var Te=B(($b,Ni)=>{"use strict";var En=qr(),{MAX_LENGTH:Di,MAX_SAFE_INTEGER:On}=mr(),{safeRe:Cn,t:xn}=dr(),vf=wn(),{compareIdentifiers:Oo}=Eo(),Pf=(t,e)=>{let r=e.split(".");if(r.length>t.length)return!1;for(let n=0;n<r.length;n++)if(Oo(t[n],r[n])!==0)return!1;return!0},Co=class t{constructor(e,r){if(r=vf(r),e instanceof t){if(e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>Di)throw new TypeError(`version is longer than ${Di} characters`);En("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=e.trim().match(r.loose?Cn[xn.LOOSE]:Cn[xn.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>On||this.major<0)throw new TypeError("Invalid major version");if(this.minor>On||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>On||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(o=>{if(/^[0-9]+$/.test(o)){let s=+o;if(s>=0&&s<On)return s}return o}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(En("SemVer.compare",this.version,this.options,e),!(e instanceof t)){if(typeof e=="string"&&e===this.version)return 0;e=new t(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof t||(e=new t(e,this.options)),this.major<e.major?-1:this.major>e.major?1:this.minor<e.minor?-1:this.minor>e.minor?1:this.patch<e.patch?-1:this.patch>e.patch?1:0}comparePre(e){if(e instanceof t||(e=new t(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let r=0;do{let n=this.prerelease[r],o=e.prerelease[r];if(En("prerelease compare",r,n,o),n===void 0&&o===void 0)return 0;if(o===void 0)return 1;if(n===void 0)return-1;if(n===o)continue;return Oo(n,o)}while(++r)}compareBuild(e){e instanceof t||(e=new t(e,this.options));let r=0;do{let n=this.build[r],o=e.build[r];if(En("build compare",r,n,o),n===void 0&&o===void 0)return 0;if(o===void 0)return 1;if(n===void 0)return-1;if(n===o)continue;return Oo(n,o)}while(++r)}inc(e,r,n){if(e.startsWith("pre")){if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(r){let o=`-${r}`.match(this.options.loose?Cn[xn.PRERELEASELOOSE]:Cn[xn.PRERELEASE]);if(!o||o[1]!==r)throw new Error(`invalid identifier: ${r}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let o=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[o];else{let s=this.prerelease.length;for(;--s>=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(o)}}if(r){let s=[r,o];if(n===!1&&(s=[r]),Pf(this.prerelease,r)){let i=this.prerelease[r.split(".").length];isNaN(i)&&(this.prerelease=s)}else this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};Ni.exports=Co});var $t=B((Ib,Mi)=>{"use strict";var Li=Te(),Rf=(t,e,r=!1)=>{if(t instanceof Li)return t;try{return new Li(t,e)}catch(n){if(!r)return null;throw n}};Mi.exports=Rf});var ki=B((_b,Fi)=>{"use strict";var $f=$t(),If=(t,e)=>{let r=$f(t,e);return r?r.version:null};Fi.exports=If});var qi=B((Tb,Ui)=>{"use strict";var _f=$t(),Tf=(t,e)=>{let r=_f(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null};Ui.exports=Tf});var Vi=B((jb,zi)=>{"use strict";var Wi=Te(),jf=(t,e,r,n,o)=>{typeof r=="string"&&(o=n,n=r,r=void 0);try{return new Wi(t instanceof Wi?t.version:t,r).inc(e,n,o).version}catch{return null}};zi.exports=jf});var Hi=B((Db,Gi)=>{"use strict";var Bi=$t(),Df=(t,e)=>{let r=Bi(t,null,!0),n=Bi(e,null,!0),o=r.compare(n);if(o===0)return null;let s=o>0,i=s?r:n,a=s?n:r,c=!!i.prerelease.length;if(!!a.prerelease.length&&!c){if(!a.patch&&!a.minor)return"major";if(a.compareMain(i)===0)return a.minor&&!a.patch?"minor":"patch"}let u=c?"pre":"";return r.major!==n.major?u+"major":r.minor!==n.minor?u+"minor":r.patch!==n.patch?u+"patch":"prerelease"};Gi.exports=Df});var Ki=B((Nb,Yi)=>{"use strict";var Nf=Te(),Lf=(t,e)=>new Nf(t,e).major;Yi.exports=Lf});var Xi=B((Lb,Ji)=>{"use strict";var Mf=Te(),Ff=(t,e)=>new Mf(t,e).minor;Ji.exports=Ff});var Qi=B((Mb,Zi)=>{"use strict";var kf=Te(),Uf=(t,e)=>new kf(t,e).patch;Zi.exports=Uf});var ta=B((Fb,ea)=>{"use strict";var qf=$t(),Wf=(t,e)=>{let r=qf(t,e);return r&&r.prerelease.length?r.prerelease:null};ea.exports=Wf});var nt=B((kb,na)=>{"use strict";var ra=Te(),zf=(t,e,r)=>new ra(t,r).compare(new ra(e,r));na.exports=zf});var sa=B((Ub,oa)=>{"use strict";var Vf=nt(),Bf=(t,e,r)=>Vf(e,t,r);oa.exports=Bf});var aa=B((qb,ia)=>{"use strict";var Gf=nt(),Hf=(t,e)=>Gf(t,e,!0);ia.exports=Hf});var An=B((Wb,la)=>{"use strict";var ca=Te(),Yf=(t,e,r)=>{let n=new ca(t,r),o=new ca(e,r);return n.compare(o)||n.compareBuild(o)};la.exports=Yf});var ua=B((zb,pa)=>{"use strict";var Kf=An(),Jf=(t,e)=>t.sort((r,n)=>Kf(r,n,e));pa.exports=Jf});var ma=B((Vb,fa)=>{"use strict";var Xf=An(),Zf=(t,e)=>t.sort((r,n)=>Xf(n,r,e));fa.exports=Zf});var Wr=B((Bb,da)=>{"use strict";var Qf=nt(),em=(t,e,r)=>Qf(t,e,r)>0;da.exports=em});var vn=B((Gb,ha)=>{"use strict";var tm=nt(),rm=(t,e,r)=>tm(t,e,r)<0;ha.exports=rm});var xo=B((Hb,ga)=>{"use strict";var nm=nt(),om=(t,e,r)=>nm(t,e,r)===0;ga.exports=om});var Ao=B((Yb,ya)=>{"use strict";var sm=nt(),im=(t,e,r)=>sm(t,e,r)!==0;ya.exports=im});var Pn=B((Kb,ba)=>{"use strict";var am=nt(),cm=(t,e,r)=>am(t,e,r)>=0;ba.exports=cm});var Rn=B((Jb,Sa)=>{"use strict";var lm=nt(),pm=(t,e,r)=>lm(t,e,r)<=0;Sa.exports=pm});var vo=B((Xb,wa)=>{"use strict";var um=xo(),fm=Ao(),mm=Wr(),dm=Pn(),hm=vn(),gm=Rn(),ym=(t,e,r,n)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t===r;case"!==":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t!==r;case"":case"=":case"==":return um(t,r,n);case"!=":return fm(t,r,n);case">":return mm(t,r,n);case">=":return dm(t,r,n);case"<":return hm(t,r,n);case"<=":return gm(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}};wa.exports=ym});var Oa=B((Zb,Ea)=>{"use strict";var bm=Te(),Sm=$t(),{safeRe:$n,t:In}=dr(),wm=(t,e)=>{if(t instanceof bm)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let r=null;if(!e.rtl)r=t.match(e.includePrerelease?$n[In.COERCEFULL]:$n[In.COERCE]);else{let c=e.includePrerelease?$n[In.COERCERTLFULL]:$n[In.COERCERTL],p;for(;(p=c.exec(t))&&(!r||r.index+r[0].length!==t.length);)(!r||p.index+p[0].length!==r.index+r[0].length)&&(r=p),c.lastIndex=p.index+p[1].length+p[2].length;c.lastIndex=-1}if(r===null)return null;let n=r[2],o=r[3]||"0",s=r[4]||"0",i=e.includePrerelease&&r[5]?`-${r[5]}`:"",a=e.includePrerelease&&r[6]?`+${r[6]}`:"";return Sm(`${n}.${o}.${s}${i}${a}`,e)};Ea.exports=wm});var xa=B((Qb,Ca)=>{"use strict";var Em=$t(),Om=mr(),Cm=Te(),xm=(t,e,r)=>{if(!Om.RELEASE_TYPES.includes(e))return null;let n=Am(t,r);return n&&vm(n,e)},Am=(t,e)=>{let r=t instanceof Cm?t.version:t;return Em(r,e)},vm=(t,e)=>{if(Pm(e))return t.version;switch(t.prerelease=[],e){case"major":t.minor=0,t.patch=0;break;case"minor":t.patch=0;break}return t.format()},Pm=t=>t.startsWith("pre");Ca.exports=xm});var va=B((eS,Aa)=>{"use strict";var Po=class{constructor(){this.max=1e3,this.map=new Map}get(e){let r=this.map.get(e);if(r!==void 0)return this.map.delete(e),this.map.set(e,r),r}delete(e){return this.map.delete(e)}set(e,r){if(!this.delete(e)&&r!==void 0){if(this.map.size>=this.max){let o=this.map.keys().next().value;this.delete(o)}this.map.set(e,r)}return this}};Aa.exports=Po});var ot=B((tS,Ia)=>{"use strict";var Rm=/\s+/g,Ro=class t{constructor(e,r){if(r=Im(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof $o)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=e.trim().replace(Rm," "),this.set=this.raw.split("||").map(n=>this.parseRange(n.trim())).filter(n=>n.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let n=this.set[0];if(this.set=this.set.filter(o=>!Ra(o[0])),this.set.length===0)this.set=[n];else if(this.set.length>1){for(let o of this.set)if(o.length===1&&km(o[0])){this.set=[o];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let r=this.set[e];for(let n=0;n<r.length;n++)n>0&&(this.formatted+=" "),this.formatted+=r[n].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){e=e.replace(Fm,"");let n=((this.options.includePrerelease&&Lm)|(this.options.loose&&Mm))+":"+e,o=Pa.get(n);if(o)return o;let s=this.options.loose,i=s?ke[je.HYPHENRANGELOOSE]:ke[je.HYPHENRANGE];e=e.replace(i,Jm(this.options.includePrerelease)),fe("hyphen replace",e),e=e.replace(ke[je.COMPARATORTRIM],jm),fe("comparator trim",e),e=e.replace(ke[je.TILDETRIM],Dm),fe("tilde trim",e),e=e.replace(ke[je.CARETTRIM],Nm),fe("caret trim",e);let a=e.split(" ").map(l=>Um(l,this.options)).join(" ").split(/\s+/).map(l=>Km(l,this.options));s&&(a=a.filter(l=>(fe("loose invalid filter",l,this.options),!!l.match(ke[je.COMPARATORLOOSE])))),fe("range list",a);let c=new Map,p=a.map(l=>new $o(l,this.options));for(let l of p){if(Ra(l))return[l];c.set(l.value,l)}c.size>1&&c.has("")&&c.delete("");let u=[...c.values()];return Pa.set(n,u),u}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(n=>$a(n,r)&&e.set.some(o=>$a(o,r)&&n.every(s=>o.every(i=>s.intersects(i,r)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new _m(e,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(Xm(this.set[r],e,this.options))return!0;return!1}};Ia.exports=Ro;var $m=va(),Pa=new $m,Im=wn(),$o=zr(),fe=qr(),_m=Te(),{safeRe:ke,src:Tm,t:je,comparatorTrimReplace:jm,tildeTrimReplace:Dm,caretTrimReplace:Nm}=dr(),{FLAG_INCLUDE_PRERELEASE:Lm,FLAG_LOOSE:Mm}=mr(),Fm=new RegExp(Tm[je.BUILD],"g"),Ra=t=>t.value==="<0.0.0-0",km=t=>t.value==="",$a=(t,e)=>{let r=!0,n=t.slice(),o=n.pop();for(;r&&n.length;)r=n.every(s=>o.intersects(s,e)),o=n.pop();return r},Um=(t,e)=>(t=t.replace(ke[je.BUILD],""),fe("comp",t,e),t=Vm(t,e),fe("caret",t),t=Wm(t,e),fe("tildes",t),t=Gm(t,e),fe("xrange",t),t=Ym(t,e),fe("stars",t),t),Ce=t=>!t||t.toLowerCase()==="x"||t==="*",qm=(t,e,r)=>Ce(t)&&!Ce(e)||Ce(e)&&r&&!Ce(r),Wm=(t,e)=>t.trim().split(/\s+/).map(r=>zm(r,e)).join(" "),zm=(t,e)=>{let r=e.loose?ke[je.TILDELOOSE]:ke[je.TILDE],n=e.includePrerelease?"-0":"";return t.replace(r,(o,s,i,a,c)=>{fe("tilde",t,o,s,i,a,c);let p;return Ce(s)?p="":Ce(i)?p=`>=${s}.0.0${n} <${+s+1}.0.0-0`:Ce(a)?p=`>=${s}.${i}.0${n} <${s}.${+i+1}.0-0`:c?(fe("replaceTilde pr",c),p=`>=${s}.${i}.${a}-${c} <${s}.${+i+1}.0-0`):p=`>=${s}.${i}.${a} <${s}.${+i+1}.0-0`,fe("tilde return",p),p})},Vm=(t,e)=>t.trim().split(/\s+/).map(r=>Bm(r,e)).join(" "),Bm=(t,e)=>{fe("caret",t,e);let r=e.loose?ke[je.CARETLOOSE]:ke[je.CARET],n=e.includePrerelease?"-0":"";return t.replace(r,(o,s,i,a,c)=>{fe("caret",t,o,s,i,a,c);let p;return Ce(s)?p="":Ce(i)?p=`>=${s}.0.0${n} <${+s+1}.0.0-0`:Ce(a)?s==="0"?p=`>=${s}.${i}.0${n} <${s}.${+i+1}.0-0`:p=`>=${s}.${i}.0${n} <${+s+1}.0.0-0`:c?(fe("replaceCaret pr",c),s==="0"?i==="0"?p=`>=${s}.${i}.${a}-${c} <${s}.${i}.${+a+1}-0`:p=`>=${s}.${i}.${a}-${c} <${s}.${+i+1}.0-0`:p=`>=${s}.${i}.${a}-${c} <${+s+1}.0.0-0`):(fe("no pr"),s==="0"?i==="0"?p=`>=${s}.${i}.${a} <${s}.${i}.${+a+1}-0`:p=`>=${s}.${i}.${a} <${s}.${+i+1}.0-0`:p=`>=${s}.${i}.${a} <${+s+1}.0.0-0`),fe("caret return",p),p})},Gm=(t,e)=>(fe("replaceXRanges",t,e),t.split(/\s+/).map(r=>Hm(r,e)).join(" ")),Hm=(t,e)=>{t=t.trim();let r=e.loose?ke[je.XRANGELOOSE]:ke[je.XRANGE];return t.replace(r,(n,o,s,i,a,c)=>{if(fe("xRange",t,n,o,s,i,a,c),qm(s,i,a))return t;let p=Ce(s),u=p||Ce(i),l=u||Ce(a),d=l;return o==="="&&d&&(o=""),c=e.includePrerelease?"-0":"",p?o===">"||o==="<"?n="<0.0.0-0":n="*":o&&d?(u&&(i=0),a=0,o===">"?(o=">=",u?(s=+s+1,i=0,a=0):(i=+i+1,a=0)):o==="<="&&(o="<",u?s=+s+1:i=+i+1),o==="<"&&(c="-0"),n=`${o+s}.${i}.${a}${c}`):u?n=`>=${s}.0.0${c} <${+s+1}.0.0-0`:l&&(n=`>=${s}.${i}.0${c} <${s}.${+i+1}.0-0`),fe("xRange return",n),n})},Ym=(t,e)=>(fe("replaceStars",t,e),t.trim().replace(ke[je.STAR],"")),Km=(t,e)=>(fe("replaceGTE0",t,e),t.trim().replace(ke[e.includePrerelease?je.GTE0PRE:je.GTE0],"")),Jm=t=>(e,r,n,o,s,i,a,c,p,u,l,d)=>(Ce(n)?r="":Ce(o)?r=`>=${n}.0.0${t?"-0":""}`:Ce(s)?r=`>=${n}.${o}.0${t?"-0":""}`:i?r=`>=${r}`:r=`>=${r}${t?"-0":""}`,Ce(p)?c="":Ce(u)?c=`<${+p+1}.0.0-0`:Ce(l)?c=`<${p}.${+u+1}.0-0`:d?c=`<=${p}.${u}.${l}-${d}`:t?c=`<${p}.${u}.${+l+1}-0`:c=`<=${c}`,`${r} ${c}`.trim()),Xm=(t,e,r)=>{for(let n=0;n<t.length;n++)if(!t[n].test(e))return!1;if(e.prerelease.length&&!r.includePrerelease){for(let n=0;n<t.length;n++)if(fe(t[n].semver),t[n].semver!==$o.ANY&&t[n].semver.prerelease.length>0){let o=t[n].semver;if(o.major===e.major&&o.minor===e.minor&&o.patch===e.patch)return!0}return!1}return!0}});var zr=B((rS,La)=>{"use strict";var Vr=Symbol("SemVer ANY"),To=class t{static get ANY(){return Vr}constructor(e,r){if(r=_a(r),e instanceof t){if(e.loose===!!r.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),_o("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===Vr?this.value="":this.value=this.operator+this.semver.version,_o("comp",this)}parse(e){let r=this.options.loose?Ta[ja.COMPARATORLOOSE]:Ta[ja.COMPARATOR],n=e.match(r);if(!n)throw new TypeError(`Invalid comparator: ${e}`);this.operator=n[1]!==void 0?n[1]:"",this.operator==="="&&(this.operator=""),n[2]?this.semver=new Da(n[2],this.options.loose):this.semver=Vr}toString(){return this.value}test(e){if(_o("Comparator.test",e,this.options.loose),this.semver===Vr||e===Vr)return!0;if(typeof e=="string")try{e=new Da(e,this.options)}catch{return!1}return Io(e,this.operator,this.semver,this.options)}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new Na(e.value,r).test(this.value):e.operator===""?e.value===""?!0:new Na(this.value,r).test(e.semver):(r=_a(r),r.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!r.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||Io(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||Io(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};La.exports=To;var _a=wn(),{safeRe:Ta,t:ja}=dr(),Io=vo(),_o=qr(),Da=Te(),Na=ot()});var Br=B((nS,Ma)=>{"use strict";var Zm=ot(),Qm=(t,e,r)=>{try{e=new Zm(e,r)}catch{return!1}return e.test(t)};Ma.exports=Qm});var ka=B((oS,Fa)=>{"use strict";var ed=ot(),td=(t,e)=>new ed(t,e).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));Fa.exports=td});var qa=B((sS,Ua)=>{"use strict";var rd=Te(),nd=ot(),od=(t,e,r)=>{let n=null,o=null,s=null;try{s=new nd(e,r)}catch{return null}return t.forEach(i=>{s.test(i)&&(!n||o.compare(i)===-1)&&(n=i,o=new rd(n,r))}),n};Ua.exports=od});var za=B((iS,Wa)=>{"use strict";var sd=Te(),id=ot(),ad=(t,e,r)=>{let n=null,o=null,s=null;try{s=new id(e,r)}catch{return null}return t.forEach(i=>{s.test(i)&&(!n||o.compare(i)===1)&&(n=i,o=new sd(n,r))}),n};Wa.exports=ad});var Ga=B((aS,Ba)=>{"use strict";var jo=Te(),cd=ot(),Va=Wr(),ld=(t,e)=>{t=new cd(t,e);let r=new jo("0.0.0");if(t.test(r)||(r=new jo("0.0.0-0"),t.test(r)))return r;r=null;for(let n=0;n<t.set.length;++n){let o=t.set[n],s=null;o.forEach(i=>{let a=new jo(i.semver.version);switch(i.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!s||Va(a,s))&&(s=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${i.operator}`)}}),s&&(!r||Va(r,s))&&(r=s)}return r&&t.test(r)?r:null};Ba.exports=ld});var Ya=B((cS,Ha)=>{"use strict";var pd=ot(),ud=(t,e)=>{try{return new pd(t,e).range||"*"}catch{return null}};Ha.exports=ud});var _n=B((lS,Za)=>{"use strict";var fd=Te(),Xa=zr(),{ANY:md}=Xa,dd=ot(),hd=Br(),Ka=Wr(),Ja=vn(),gd=Rn(),yd=Pn(),bd=(t,e,r,n)=>{t=new fd(t,n),e=new dd(e,n);let o,s,i,a,c;switch(r){case">":o=Ka,s=gd,i=Ja,a=">",c=">=";break;case"<":o=Ja,s=yd,i=Ka,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(hd(t,e,n))return!1;for(let p=0;p<e.set.length;++p){let u=e.set[p],l=null,d=null;if(u.forEach(m=>{m.semver===md&&(m=new Xa(">=0.0.0")),l=l||m,d=d||m,o(m.semver,l.semver,n)?l=m:i(m.semver,d.semver,n)&&(d=m)}),l.operator===a||l.operator===c||(!d.operator||d.operator===a)&&s(t,d.semver))return!1;if(d.operator===c&&i(t,d.semver))return!1}return!0};Za.exports=bd});var ec=B((pS,Qa)=>{"use strict";var Sd=_n(),wd=(t,e,r)=>Sd(t,e,">",r);Qa.exports=wd});var rc=B((uS,tc)=>{"use strict";var Ed=_n(),Od=(t,e,r)=>Ed(t,e,"<",r);tc.exports=Od});var sc=B((fS,oc)=>{"use strict";var nc=ot(),Cd=(t,e,r)=>(t=new nc(t,r),e=new nc(e,r),t.intersects(e,r));oc.exports=Cd});var ac=B((mS,ic)=>{"use strict";var xd=Br(),Ad=nt();ic.exports=(t,e,r)=>{let n=[],o=null,s=null,i=t.sort((u,l)=>Ad(u,l,r));for(let u of i)xd(u,e,r)?(s=u,o||(o=u)):(s&&n.push([o,s]),s=null,o=null);o&&n.push([o,null]);let a=[];for(let[u,l]of n)u===l?a.push(u):!l&&u===i[0]?a.push("*"):l?u===i[0]?a.push(`<=${l}`):a.push(`${u} - ${l}`):a.push(`>=${u}`);let c=a.join(" || "),p=typeof e.raw=="string"?e.raw:String(e);return c.length<p.length?c:e}});var mc=B((dS,fc)=>{"use strict";var cc=ot(),Lo=zr(),{ANY:Do}=Lo,No=Br(),Mo=nt(),vd=(t,e,r={})=>{if(t===e)return!0;t=new cc(t,r),e=new cc(e,r);let n=!1;e:for(let o of t.set){for(let s of e.set){let i=Rd(o,s,r);if(n=n||i!==null,i)continue e}if(n)return!1}return!0},Pd=[new Lo(">=0.0.0-0")],lc=[new Lo(">=0.0.0")],Rd=(t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===Do){if(e.length===1&&e[0].semver===Do)return!0;r.includePrerelease?t=Pd:t=lc}if(e.length===1&&e[0].semver===Do){if(r.includePrerelease)return!0;e=lc}let n=new Set,o,s;for(let m of t)m.operator===">"||m.operator===">="?o=pc(o,m,r):m.operator==="<"||m.operator==="<="?s=uc(s,m,r):n.add(m.semver);if(n.size>1)return null;let i;if(o&&s){if(i=Mo(o.semver,s.semver,r),i>0)return null;if(i===0&&(o.operator!==">="||s.operator!=="<="))return null}for(let m of n){if(o&&!No(m,String(o),r)||s&&!No(m,String(s),r))return null;for(let w of e)if(!No(m,String(w),r))return!1;return!0}let a,c,p,u,l=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1,d=o&&!r.includePrerelease&&o.semver.prerelease.length?o.semver:!1;l&&l.prerelease.length===1&&s.operator==="<"&&l.prerelease[0]===0&&(l=!1);for(let m of e){if(u=u||m.operator===">"||m.operator===">=",p=p||m.operator==="<"||m.operator==="<=",o){if(d&&m.semver.prerelease&&m.semver.prerelease.length&&m.semver.major===d.major&&m.semver.minor===d.minor&&m.semver.patch===d.patch&&(d=!1),m.operator===">"||m.operator===">="){if(a=pc(o,m,r),a===m&&a!==o)return!1}else if(o.operator===">="&&!m.test(o.semver))return!1}if(s){if(l&&m.semver.prerelease&&m.semver.prerelease.length&&m.semver.major===l.major&&m.semver.minor===l.minor&&m.semver.patch===l.patch&&(l=!1),m.operator==="<"||m.operator==="<="){if(c=uc(s,m,r),c===m&&c!==s)return!1}else if(s.operator==="<="&&!m.test(s.semver))return!1}if(!m.operator&&(s||o)&&i!==0)return!1}return!(o&&p&&!s&&i!==0||s&&u&&!o&&i!==0||d||l)},pc=(t,e,r)=>{if(!t)return e;let n=Mo(t.semver,e.semver,r);return n>0?t:n<0||e.operator===">"&&t.operator===">="?e:t},uc=(t,e,r)=>{if(!t)return e;let n=Mo(t.semver,e.semver,r);return n<0?t:n>0||e.operator==="<"&&t.operator==="<="?e:t};fc.exports=vd});var ko=B((hS,gc)=>{"use strict";var Fo=dr(),dc=mr(),$d=Te(),hc=Eo(),Id=$t(),_d=ki(),Td=qi(),jd=Vi(),Dd=Hi(),Nd=Ki(),Ld=Xi(),Md=Qi(),Fd=ta(),kd=nt(),Ud=sa(),qd=aa(),Wd=An(),zd=ua(),Vd=ma(),Bd=Wr(),Gd=vn(),Hd=xo(),Yd=Ao(),Kd=Pn(),Jd=Rn(),Xd=vo(),Zd=Oa(),Qd=xa(),eh=zr(),th=ot(),rh=Br(),nh=ka(),oh=qa(),sh=za(),ih=Ga(),ah=Ya(),ch=_n(),lh=ec(),ph=rc(),uh=sc(),fh=ac(),mh=mc();gc.exports={parse:Id,valid:_d,clean:Td,inc:jd,diff:Dd,major:Nd,minor:Ld,patch:Md,prerelease:Fd,compare:kd,rcompare:Ud,compareLoose:qd,compareBuild:Wd,sort:zd,rsort:Vd,gt:Bd,lt:Gd,eq:Hd,neq:Yd,gte:Kd,lte:Jd,cmp:Xd,coerce:Zd,truncate:Qd,Comparator:eh,Range:th,satisfies:rh,toComparators:nh,maxSatisfying:oh,minSatisfying:sh,minVersion:ih,validRange:ah,outside:ch,gtr:lh,ltr:ph,intersects:uh,simplifyRange:fh,subset:mh,SemVer:$d,re:Fo.re,src:Fo.src,tokens:Fo.t,SEMVER_SPEC_VERSION:dc.SEMVER_SPEC_VERSION,RELEASE_TYPES:dc.RELEASE_TYPES,compareIdentifiers:hc.compareIdentifiers,rcompareIdentifiers:hc.rcompareIdentifiers}});var bc=B((bS,dh)=>{dh.exports={name:"dotenv",version:"16.4.7",description:"Loads environment variables from .env file",main:"lib/main.js",types:"lib/main.d.ts",exports:{".":{types:"./lib/main.d.ts",require:"./lib/main.js",default:"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},scripts:{"dts-check":"tsc --project tests/types/tsconfig.json",lint:"standard",pretest:"npm run lint && npm run dts-check",test:"tap run --allow-empty-coverage --disable-coverage --timeout=60000","test:coverage":"tap run --show-full-coverage --timeout=60000 --coverage-report=lcov",prerelease:"npm test",release:"standard-version"},repository:{type:"git",url:"git://github.com/motdotla/dotenv.git"},funding:"https://dotenvx.com",keywords:["dotenv","env",".env","environment","variables","config","settings"],readmeFilename:"README.md",license:"BSD-2-Clause",devDependencies:{"@types/node":"^18.11.3",decache:"^4.6.2",sinon:"^14.0.1",standard:"^17.0.0","standard-version":"^9.5.0",tap:"^19.2.0",typescript:"^4.8.4"},engines:{node:">=12"},browser:{fs:!1}}});var Vo=B((SS,Ct)=>{var qo=We("fs"),Wo=We("path"),hh=We("os"),gh=We("crypto"),yh=bc(),zo=yh.version,bh=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function Sh(t){let e={},r=t.toString();r=r.replace(/\r\n?/mg,`
|
|
9
9
|
`);let n;for(;(n=bh.exec(r))!=null;){let o=n[1],s=n[2]||"";s=s.trim();let i=s[0];s=s.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),i==='"'&&(s=s.replace(/\\n/g,`
|
|
10
10
|
`),s=s.replace(/\\r/g,"\r")),e[o]=s}return e}function wh(t){let e=Ec(t),r=xe.configDotenv({path:e});if(!r.parsed){let i=new Error(`MISSING_DATA: Cannot parse ${e} for an unknown reason`);throw i.code="MISSING_DATA",i}let n=wc(t).split(","),o=n.length,s;for(let i=0;i<o;i++)try{let a=n[i].trim(),c=Ch(r,a);s=xe.decrypt(c.ciphertext,c.key);break}catch(a){if(i+1>=o)throw a}return xe.parse(s)}function Eh(t){console.log(`[dotenv@${zo}][INFO] ${t}`)}function Oh(t){console.log(`[dotenv@${zo}][WARN] ${t}`)}function Tn(t){console.log(`[dotenv@${zo}][DEBUG] ${t}`)}function wc(t){return t&&t.DOTENV_KEY&&t.DOTENV_KEY.length>0?t.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:""}function Ch(t,e){let r;try{r=new URL(e)}catch(a){if(a.code==="ERR_INVALID_URL"){let c=new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");throw c.code="INVALID_DOTENV_KEY",c}throw a}let n=r.password;if(!n){let a=new Error("INVALID_DOTENV_KEY: Missing key part");throw a.code="INVALID_DOTENV_KEY",a}let o=r.searchParams.get("environment");if(!o){let a=new Error("INVALID_DOTENV_KEY: Missing environment part");throw a.code="INVALID_DOTENV_KEY",a}let s=`DOTENV_VAULT_${o.toUpperCase()}`,i=t.parsed[s];if(!i){let a=new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${s} in your .env.vault file.`);throw a.code="NOT_FOUND_DOTENV_ENVIRONMENT",a}return{ciphertext:i,key:n}}function Ec(t){let e=null;if(t&&t.path&&t.path.length>0)if(Array.isArray(t.path))for(let r of t.path)qo.existsSync(r)&&(e=r.endsWith(".vault")?r:`${r}.vault`);else e=t.path.endsWith(".vault")?t.path:`${t.path}.vault`;else e=Wo.resolve(process.cwd(),".env.vault");return qo.existsSync(e)?e:null}function Sc(t){return t[0]==="~"?Wo.join(hh.homedir(),t.slice(1)):t}function xh(t){Eh("Loading env from encrypted .env.vault");let e=xe._parseVault(t),r=process.env;return t&&t.processEnv!=null&&(r=t.processEnv),xe.populate(r,e,t),{parsed:e}}function Ah(t){let e=Wo.resolve(process.cwd(),".env"),r="utf8",n=!!(t&&t.debug);t&&t.encoding?r=t.encoding:n&&Tn("No encoding is specified. UTF-8 is used by default");let o=[e];if(t&&t.path)if(!Array.isArray(t.path))o=[Sc(t.path)];else{o=[];for(let c of t.path)o.push(Sc(c))}let s,i={};for(let c of o)try{let p=xe.parse(qo.readFileSync(c,{encoding:r}));xe.populate(i,p,t)}catch(p){n&&Tn(`Failed to load ${c} ${p.message}`),s=p}let a=process.env;return t&&t.processEnv!=null&&(a=t.processEnv),xe.populate(a,i,t),s?{parsed:i,error:s}:{parsed:i}}function vh(t){if(wc(t).length===0)return xe.configDotenv(t);let e=Ec(t);return e?xe._configVault(t):(Oh(`You set DOTENV_KEY but you are missing a .env.vault file at ${e}. Did you forget to build it?`),xe.configDotenv(t))}function Ph(t,e){let r=Buffer.from(e.slice(-64),"hex"),n=Buffer.from(t,"base64"),o=n.subarray(0,12),s=n.subarray(-16);n=n.subarray(12,-16);try{let i=gh.createDecipheriv("aes-256-gcm",r,o);return i.setAuthTag(s),`${i.update(n)}${i.final()}`}catch(i){let a=i instanceof RangeError,c=i.message==="Invalid key length",p=i.message==="Unsupported state or unable to authenticate data";if(a||c){let u=new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw u.code="INVALID_DOTENV_KEY",u}else if(p){let u=new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw u.code="DECRYPTION_FAILED",u}else throw i}}function Rh(t,e,r={}){let n=!!(r&&r.debug),o=!!(r&&r.override);if(typeof e!="object"){let s=new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw s.code="OBJECT_REQUIRED",s}for(let s of Object.keys(e))Object.prototype.hasOwnProperty.call(t,s)?(o===!0&&(t[s]=e[s]),n&&Tn(o===!0?`"${s}" is already defined and WAS overwritten`:`"${s}" is already defined and was NOT overwritten`)):t[s]=e[s]}var xe={configDotenv:Ah,_configVault:xh,_parseVault:wh,config:vh,decrypt:Ph,parse:Sh,populate:Rh};Ct.exports.configDotenv=xe.configDotenv;Ct.exports._configVault=xe._configVault;Ct.exports._parseVault=xe._parseVault;Ct.exports.config=xe.config;Ct.exports.decrypt=xe.decrypt;Ct.exports.parse=xe.parse;Ct.exports.populate=xe.populate;Ct.exports=xe});var sp=B(xs=>{"use strict";xs.parse=Qg;xs.serialize=ey;var Hg=Object.prototype.toString,Yg=Object.prototype.hasOwnProperty,Kg=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,Jg=/^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/,Xg=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,Zg=/^[\u0020-\u003A\u003D-\u007E]*$/;function Qg(t,e){if(typeof t!="string")throw new TypeError("argument str must be a string");var r={},n=t.length;if(n<2)return r;var o=e&&e.decode||ty,s=0,i=0,a=0;do{if(i=t.indexOf("=",s),i===-1)break;if(a=t.indexOf(";",s),a===-1)a=n;else if(i>a){s=t.lastIndexOf(";",i-1)+1;continue}var c=np(t,s,i),p=op(t,i,c),u=t.slice(c,p);if(!Yg.call(r,u)){var l=np(t,i+1,a),d=op(t,a,l);t.charCodeAt(l)===34&&t.charCodeAt(d-1)===34&&(l++,d--);var m=t.slice(l,d);r[u]=ny(m,o)}s=a+1}while(s<n);return r}function np(t,e,r){do{var n=t.charCodeAt(e);if(n!==32&&n!==9)return e}while(++e<r);return r}function op(t,e,r){for(;e>r;){var n=t.charCodeAt(--e);if(n!==32&&n!==9)return e+1}return r}function ey(t,e,r){var n=r&&r.encode||encodeURIComponent;if(typeof n!="function")throw new TypeError("option encode is invalid");if(!Kg.test(t))throw new TypeError("argument name is invalid");var o=n(e);if(!Jg.test(o))throw new TypeError("argument val is invalid");var s=t+"="+o;if(!r)return s;if(r.maxAge!=null){var i=Math.floor(r.maxAge);if(!isFinite(i))throw new TypeError("option maxAge is invalid");s+="; Max-Age="+i}if(r.domain){if(!Xg.test(r.domain))throw new TypeError("option domain is invalid");s+="; Domain="+r.domain}if(r.path){if(!Zg.test(r.path))throw new TypeError("option path is invalid");s+="; Path="+r.path}if(r.expires){var a=r.expires;if(!ry(a)||isNaN(a.valueOf()))throw new TypeError("option expires is invalid");s+="; Expires="+a.toUTCString()}if(r.httpOnly&&(s+="; HttpOnly"),r.secure&&(s+="; Secure"),r.partitioned&&(s+="; Partitioned"),r.priority){var c=typeof r.priority=="string"?r.priority.toLowerCase():r.priority;switch(c){case"low":s+="; Priority=Low";break;case"medium":s+="; Priority=Medium";break;case"high":s+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}}if(r.sameSite){var p=typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite;switch(p){case!0:s+="; SameSite=Strict";break;case"lax":s+="; SameSite=Lax";break;case"strict":s+="; SameSite=Strict";break;case"none":s+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return s}function ty(t){return t.indexOf("%")!==-1?decodeURIComponent(t):t}function ry(t){return Hg.call(t)==="[object Date]"}function ny(t,e){try{return e(t)}catch{return t}}});var lp=B((tx,tn)=>{"use strict";var Jn={decodeValues:!0,map:!1,silent:!1};function As(t){return typeof t=="string"&&!!t.trim()}function vs(t,e){var r=t.split(";").filter(As),n=r.shift(),o=oy(n),s=o.name,i=o.value;e=e?Object.assign({},Jn,e):Jn;try{i=e.decodeValues?decodeURIComponent(i):i}catch(c){console.error("set-cookie-parser encountered an error while decoding a cookie with value '"+i+"'. Set options.decodeValues to false to disable this feature.",c)}var a={name:s,value:i};return r.forEach(function(c){var p=c.split("="),u=p.shift().trimLeft().toLowerCase(),l=p.join("=");u==="expires"?a.expires=new Date(l):u==="max-age"?a.maxAge=parseInt(l,10):u==="secure"?a.secure=!0:u==="httponly"?a.httpOnly=!0:u==="samesite"?a.sameSite=l:u==="partitioned"?a.partitioned=!0:a[u]=l}),a}function oy(t){var e="",r="",n=t.split("=");return n.length>1?(e=n.shift(),r=n.join("=")):r=t,{name:e,value:r}}function cp(t,e){if(e=e?Object.assign({},Jn,e):Jn,!t)return e.map?{}:[];if(t.headers)if(typeof t.headers.getSetCookie=="function")t=t.headers.getSetCookie();else if(t.headers["set-cookie"])t=t.headers["set-cookie"];else{var r=t.headers[Object.keys(t.headers).find(function(o){return o.toLowerCase()==="set-cookie"})];!r&&t.headers.cookie&&!e.silent&&console.warn("Warning: set-cookie-parser appears to have been called on a request object. It is designed to parse Set-Cookie headers from responses, not Cookie headers from requests. Set the option {silent: true} to suppress this warning."),t=r}if(Array.isArray(t)||(t=[t]),e.map){var n={};return t.filter(As).reduce(function(o,s){var i=vs(s,e);return o[i.name]=i,o},n)}else return t.filter(As).map(function(o){return vs(o,e)})}function sy(t){if(Array.isArray(t))return t;if(typeof t!="string")return[];var e=[],r=0,n,o,s,i,a;function c(){for(;r<t.length&&/\s/.test(t.charAt(r));)r+=1;return r<t.length}function p(){return o=t.charAt(r),o!=="="&&o!==";"&&o!==","}for(;r<t.length;){for(n=r,a=!1;c();)if(o=t.charAt(r),o===","){for(s=r,r+=1,c(),i=r;r<t.length&&p();)r+=1;r<t.length&&t.charAt(r)==="="?(a=!0,r=i,e.push(t.substring(n,s)),n=r):r=s+1}else r+=1;(!a||r>=t.length)&&e.push(t.substring(n,t.length))}return e}tn.exports=cp;tn.exports.parse=cp;tn.exports.parseString=vs;tn.exports.splitCookiesString=sy});var yc=Pt(ko(),1);import*as Uo from"node:process";try{let t=ii?.node;typeof t=="string"&&!yc.satisfies(Uo.version,t)&&y.warn(`
|
|
11
11
|
\u26A0\uFE0F Warning: failed to satisfy expected node version. Expected: "${t}", Current "${Uo.version}"
|
|
@@ -87,7 +87,7 @@ ${ee("Errors ignored because of --force")}.
|
|
|
87
87
|
`))}catch(p){yi(p,i)}if(Si(e),!(s.errors===0||t.force))throw new qt("Bundle failed.")}import{spawn as xg}from"node:child_process";import*as Cl from"node:process";var Xr=t=>t.replace(/[^a-zA-Z0-9 ._\-:\\/@]/g,""),xl=t=>t.replace(/[^a-zA-Z0-9@._-]/g,"");function wr(){let t=Cl.platform==="win32";return{npxExecutableName:t?"npx.cmd":"npx",sanitize:(n,o)=>t&&n?o(n):n||"",shell:t}}var Al=async({argv:t})=>{y.info(`
|
|
88
88
|
Launching eject using NPX.
|
|
89
89
|
|
|
90
|
-
`);let{npxExecutableName:e,sanitize:r,shell:n}=wr(),o=r(t.path,Xr),s=r(t["project-dir"],Xr);xg(e,["-y","@redocly/realm","eject",`${t.type}`,o,`-d=${s}`,t.force?`--force=${t.force}`:""],{stdio:"inherit",shell:n}).on("error",a=>{throw y.info(`Eject launch failed: ${a.message}`),new Error("Eject launch failed.")})};import{writeFileSync as Ag}from"node:fs";async function vl({argv:t,config:e,version:r,collectSpecData:n}){let o=t["output-file"]||"auto-generated.arazzo.yaml",s={outputFile:o,descriptionPath:t.descriptionPath,collectSpecData:n,version:r,config:e};try{let{generate:i}=await import("./chunks/
|
|
90
|
+
`);let{npxExecutableName:e,sanitize:r,shell:n}=wr(),o=r(t.path,Xr),s=r(t["project-dir"],Xr);xg(e,["-y","@redocly/realm","eject",`${t.type}`,o,`-d=${s}`,t.force?`--force=${t.force}`:""],{stdio:"inherit",shell:n}).on("error",a=>{throw y.info(`Eject launch failed: ${a.message}`),new Error("Eject launch failed.")})};import{writeFileSync as Ag}from"node:fs";async function vl({argv:t,config:e,version:r,collectSpecData:n}){let o=t["output-file"]||"auto-generated.arazzo.yaml",s={outputFile:o,descriptionPath:t.descriptionPath,collectSpecData:n,version:r,config:e};try{let{generate:i}=await import("./chunks/3HOQ2EH4.js");y.info(ue(`
|
|
91
91
|
Generating Arazzo description...
|
|
92
92
|
`));let a=await i(s);Ag(o,Qs(a)),y.info(`
|
|
93
93
|
`+Q(`Arazzo description ${ee(o)} successfully generated.`)+`
|
|
@@ -95,7 +95,7 @@ Launching eject using NPX.
|
|
|
95
95
|
\u274C Failed to generate Arazzo description. Check the output file path you provided, or the OpenAPI file content.`)}}import{basename as vg,dirname as Pg,extname as Rg,isAbsolute as $g,resolve as Zr}from"node:path";var Ig=/^[a-z][a-z0-9+.-]+:/i;function Pl(t,e){let{setup:r}=t;if(typeof r!="string")return t;if(Ig.test(r))throw new Ve(`
|
|
96
96
|
\u274C \`client.setup\` must be a local file path \u2014 remote setup modules are not supported.
|
|
97
97
|
Got: ${r}
|
|
98
|
-
`);return $g(r)?t:{...t,setup:Zr(e,r)}}function _g(t){return`${t.replace(/[\\/]/g,"_")}.client.ts`}function Tg(t){if(t.startsWith("//"))return!1;if(t.startsWith("/"))return!0;try{let e=new URL(t);return e.protocol==="http:"||e.protocol==="https:"}catch{return!1}}async function Rl({argv:t,config:e}){let{generateClient:r,mergeConfig:n}=await import("./chunks/
|
|
98
|
+
`);return $g(r)?t:{...t,setup:Zr(e,r)}}function _g(t){return`${t.replace(/[\\/]/g,"_")}.client.ts`}function Tg(t){if(t.startsWith("//"))return!1;if(t.startsWith("/"))return!0;try{let e=new URL(t);return e.protocol==="http:"||e.protocol==="https:"}catch{return!1}}async function Rl({argv:t,config:e}){let{generateClient:r,mergeConfig:n}=await import("./chunks/X5UP7OHY.js"),o=e.configPath?Pg(e.configPath):process.cwd(),s={serverUrl:t["server-url"],outputMode:t["output-mode"],runtime:t.runtime,importExt:t["import-ext"],argsStyle:t["args-style"],errorMode:t["error-mode"],dateType:t["date-type"],mockData:t["mock-data"],mockSeed:t["mock-seed"],generators:t.generator?.map(u=>u.startsWith(".")?Zr(u):u),setup:t.setup===void 0?void 0:Pl({setup:t.setup},process.cwd()).setup},i=e.resolvedConfig.apis??{},a=Object.keys(i).filter(u=>re(i[u].client)||i[u].clientOutput!==void 0);if(t.api===void 0){if(t.output)throw new Ve("\n\u274C --output can't target multiple APIs. Set `clientOutput` under each api in redocly.yaml, or pass a single <api>.\n");if(a.length===0)throw new Ve("\n\u274C No API to generate. Add a `client` block or `clientOutput` under an `apis:` entry, or pass <api> (a file/URL or an `apis:` alias).\n")}let c=await rt(t.api===void 0?a:[t.api],e),p=new Set;for(let{path:u,alias:l}of c){let d=l??vg(u,Rg(u)),m=e.forAlias(l),{client:w,clientOutput:h}=m.resolvedConfig,x=Pl(re(w)?w:{},o),P=n(x,s),C=t.output!==void 0?Zr(t.output):h!==void 0?Zr(o,h):Zr(o,_g(d));if(!C.endsWith(".ts"))throw new Ve(`
|
|
99
99
|
\u274C output must point at a TypeScript file (ending in .ts).
|
|
100
100
|
Got: ${C}
|
|
101
101
|
`);if(p.has(C))throw new Ve(`
|
|
@@ -138,7 +138,7 @@ ${s} detected in project's 'package.json'`),o}catch{y.info(`Invalid 'package.jso
|
|
|
138
138
|
`);if(P._compressed=/^(gzip|compress|deflate|br)$/.test(m.headers.get("content-encoding")||""),P.response.content||(P.response.content={size:-1}),P._compressed){let V=await h.arrayBuffer();P.response.content.size=V.byteLength}else P.response.content.size=x?Buffer.byteLength(x):-1;let $=x?Buffer.byteLength(x):-1;P.response={headers:Cs(m.headers),cookies:up(m.headers),status:m.status,statusText:m.statusText||"",httpVersion:m.httpVersion?`HTTP/${m.httpVersion}`:"HTTP/1.1",redirectURL:m.headers.location||"",content:{size:P._compressed&&P.response.content.size!==-1?P.response.content.size:Buffer.byteLength(x),mimeType:m.headers.get("content-type")||"",text:x,compression:P._compressed&&P.response.content.size!==-1?P.response.content.size-$:0},bodySize:$,headersSize:E};let{_timestamps:_}=P;P.timings={blocked:Math.max(Mt(_.start,_.socket),.01),dns:-1,connect:Math.max(Mt(_.lookup,_.connect),-1),ssl:_.secureConnect?Math.max(Mt(_.connect,_.secureConnect),-1):-1,send:Mt(_.secureConnect||_.connect,_.sent),wait:Math.max(Mt(_.sent,_.firstByte),0),receive:Mt(_.firstByte,_.received)},P.time=Mt(_.start,_.received);let J=[],ie=P;do{let V=ie._parent;delete ie._parent,V&&J.unshift(V),ie=V}while(ie);return l.pageref=i||"page_1",J.forEach(V=>{V.pageref=l.pageref}),m.harEntry=l,Array.isArray(s?.log?.entries)&&s.log.entries.push(...J,l),a&&(J.forEach(V=>{a(V)}),a(l)),m}};function mp(t){let e={};for(let r of t){let{executedWorkflows:n,globalTimeoutError:o,ctx:s,secretValues:i}=r;e[r.file]=Oi({value:{totalRequests:r.totalRequests,executedWorkflows:n.map(a=>dp(a)),totalTimeMs:r.totalTimeMs,globalTimeoutError:o,secretValues:i},noSecretsMasking:s.noSecretsMasking,secretsSet:s.secretsSet||new Set})}return e}function dp(t){let{ctx:e,...r}=t,n=t.executedSteps.map(i=>cy(i,t.workflowId,e)),o=bn([t]);return{...r,executedSteps:n,status:o.steps.failed>0?"error":o.steps.warnings>0?"warn":"success",totalRequests:o.totalRequests,totalTimeMs:t.totalTimeMs}}function cy(t,e,r){if("executedSteps"in t)return dp(t);let n=r.$workflows[e].steps[t.stepId];return{type:"step",stepId:t.stepId,workflowId:e,request:{method:n?.request?.method||"",url:t.response?.requestUrl||"",headers:n?.request?.header||{},body:n?.request?.body},response:{statusCode:t.response?.statusCode||0,body:n?.response?.body,headers:t.response?.header||{},time:t.response?.time||0,size:t.response?.responseSize},checks:t.checks.map(o=>({...o,status:ly(o)})),totalTimeMs:n?.response?.time||0,retriesLeft:t.retriesLeft,status:py(t.checks)}}function ly(t){return t.passed?"success":t.severity==="error"?"error":"warn"}function py(t){let e=!1;for(let r of t){if(!r.passed&&r.severity==="error")return"error";!r.passed&&r.severity==="warn"&&(e=!0)}return e?"warn":"success"}import*as xr from"node:fs";import*as hp from"node:path";function gp(t={},e){let r={};for(let[n,o]of Object.entries(t))r[n]={clientCert:Rs(o.clientCert,e),clientKey:Rs(o.clientKey,e),caCert:Rs(o.caCert,e)};return r}function Rs(t,e){if(t)try{if(!(t.includes("-----BEGIN")&&t.includes("-----END"))){let n=hp.resolve(e,t);return xr.accessSync(n,xr.constants.R_OK),xr.readFileSync(n,"utf-8")}return uy(t)}catch(r){throw new Error(`Failed to read certificate: ${r.message}`)}}function uy(t){let e=t.match(/^(-----BEGIN[^-]+-----)\r?\n([A-Za-z0-9+/=\r\n\t ]+)\r?\n(-----END[^-]+-----)/);if(!e)throw new Error("Invalid certificate format");let[,r,n,o]=e,s=n.replace(/\s+/g,"").match(/.{1,64}/g)?.join(`
|
|
139
139
|
`)||"";return`${r}
|
|
140
140
|
${s}
|
|
141
|
-
${o}`}async function bp({argv:t,config:e,version:r,collectSpecData:n}){let o,s;try{let{run:i,conditionallyMaskSecrets:a}=await import("./chunks/6AQC6B4M.js"),c=e.configPath?dy(e.configPath):process.cwd();t.mtls&&(o=gp(t.mtls,c));let p=Ql(o);t["har-output"]&&(s=tp({version:r}),p=Ps(p,{har:s}));let u=new ft({http:{headers:e.resolve?.http?.headers??[],customFetch:p}}),l={files:t.files,input:t.input,server:t.server,workflow:t.workflow,skip:t.skip,verbose:t.verbose,config:e,version:r,collectSpecData:n,severity:t.severity,maxSteps:t["max-steps"],maxFetchTimeout:t["max-fetch-timeout"],executionTimeout:t["execution-timeout"],requestFileLoader:{getFileBody:async x=>{if(!fy(x))throw new Error(`File ${x} doesn't exist or isn't readable.`);let P=my(x);return new File([P],hy(x))}},envVariables:Zl(c)||{},logger:y,fetch:p,externalRefResolver:u,noSecretsMasking:t["no-secrets-masking"]};if(l.skip&&l.workflow)throw new Error("Cannot use both --skip and --workflow flags at the same time.");if(t["har-output"]&&!t["har-output"].endsWith(".har"))throw new Error("File for HAR logs should be in .har format");if(t["json-output"]&&!t["json-output"].endsWith(".json"))throw new Error("File for JSON logs should be in .json format");if(l.files.length>1&&t["har-output"])throw new Error("Currently only a single file can be run with --har-output. Please run a single file at a time.");let d=performance.now(),m=await i(l);y.printNewLine(),ep(m,y),y.printNewLine();let w=m.some(x=>x.hasProblems),h=m.some(x=>x.hasWarnings);if(t["json-output"]){let x={files:mp(m),status:w?"error":h?"warn":"success",totalTime:performance.now()-d};yp(t["json-output"],Es(x,2),"utf-8"),y.output(Q(y.indent(`JSON logs saved in ${pe(t["json-output"])}`,2))),y.printNewLine(),y.printNewLine()}if(t["har-output"])for(let x of m){let P=a({value:s,noSecretsMasking:x.ctx.noSecretsMasking,secretsSet:x.ctx.secretsSet||new Set});yp(t["har-output"],Es(P,2),"utf-8"),y.output(Q(`Har logs saved in ${pe(t["har-output"])}`)),y.printNewLine(),y.printNewLine()}if(w)throw new Error(" Tests exited with error ")}catch(i){throw new Ve(i?.message??i)}}function wp(t){if(Array.isArray(t)){let e={};for(let r of t)if(r&&typeof r=="string"){let n=Sp(r);Object.assign(e,n)}return Object.keys(e).length>0?e:void 0}if(!(!t||typeof t!="string"))return Sp(t)}function Sp(t){try{let e=JSON.parse(t);if(!re(e))throw new Error("mTLS config must be an object mapping domains to certificate configurations");for(let[r,n]of Object.entries(e)){if(!re(n))throw new Error(`mTLS config for domain "${r}" must be an object`);$s(n,"clientCert",r,!0),$s(n,"clientKey",r,!0),$s(n,"caCert",r,!1)}return e}catch(e){throw e instanceof SyntaxError?new Error(`Invalid JSON for --mtls option: ${e.message}`):e}}function $s(t,e,r,n){let o=t[e];if(!o){if(n)throw new Error(`${e} is required for domain "${r}"`);return}if(typeof o!="string")throw new Error(`${e} for domain "${r}" must be a string`)}import{performance as Dy}from"perf_hooks";var wt={thresholds:{maxParamsGood:5,maxDepthGood:4,maxPolymorphismGood:2,maxDependencyDepthGood:3,maxAmbiguousGood:0,maxOperationsForDiscoverability:1e3},weights:{parameterSimplicity:.1,schemaSimplicity:.1,documentationQuality:.18,constraintClarity:.12,exampleCoverage:.18,errorClarity:.12,dependencyClarity:.1,identifierClarity:.05,polymorphismClarity:.05,anyOfPenaltyMultiplier:2,discoverabilityWeight:.1},hotspotLimit:10},Ep=new Set(["id","name","type","value","data","key","status","state","code","result","item","object","resource","entity","input","output","payload","body","content","info"]);function Zn(t){if(t.length===0)return 0;let e=[...t].sort((n,o)=>n-o),r=Math.floor(e.length/2);return e.length%2!==0?e[r]:(e[r-1]+e[r])/2}function gy(t,e,r=wt){let{thresholds:n,weights:o}=r,s=pt(1-t.parameterCount/(n.maxParamsGood*2)),a=Math.max(t.maxRequestSchemaDepth,t.maxResponseSchemaDepth)/(n.maxDepthGood*2),c=Op(t,o.anyOfPenaltyMultiplier)/(n.maxPolymorphismGood*3),p=pt(1-a-c),u=(t.operationDescriptionPresent?1:0)+t.paramsWithDescription+t.schemaPropertiesWithDescription,l=1+t.parameterCount+t.totalSchemaProperties,d=l>0?pt(u/l):1,m=t.totalSchemaProperties>0?pt(t.constraintCount/t.totalSchemaProperties):1,w=(t.requestExamplePresent?1:0)+(t.responseExamplePresent?1:0),h=(t.requestBodyPresent?1:0)+1,x=pt(w/h),P=t.totalErrorResponses>0?pt(t.structuredErrorResponseCount/t.totalErrorResponses):1,C=pt(1-e/(n.maxDependencyDepthGood*2)),A=pt(1-t.ambiguousIdentifierCount/Math.max(n.maxAmbiguousGood+3,1)),E=Op(t,o.anyOfPenaltyMultiplier),$=E===0?1:t.hasDiscriminator?pt(1-E/(n.maxPolymorphismGood*4)):pt(1-E/(n.maxPolymorphismGood*2));return{parameterSimplicity:s,schemaSimplicity:p,documentationQuality:d,constraintClarity:m,exampleCoverage:x,errorClarity:P,dependencyClarity:C,identifierClarity:A,polymorphismClarity:$}}function yy(t,e=wt){let r=e.weights,n=t.parameterSimplicity*r.parameterSimplicity+t.schemaSimplicity*r.schemaSimplicity+t.documentationQuality*r.documentationQuality+t.constraintClarity*r.constraintClarity+t.exampleCoverage*r.exampleCoverage+t.errorClarity*r.errorClarity+t.dependencyClarity*r.dependencyClarity+t.identifierClarity*r.identifierClarity+t.polymorphismClarity*r.polymorphismClarity;return Pp(pt(n)*100)}function Cp(t,e,r=wt){let n=new Map;for(let[o,s]of t.operations){let i=e.get(o)??0,a=gy(s,i,r);n.set(o,{agentReadiness:yy(a,r),subscores:a})}return n}function xp(t,e=wt){return pt(1-t/e.thresholds.maxOperationsForDiscoverability)}function Ap(t,e,r=wt){if(t.size===0)return{agentReadiness:100};let n=[];for(let i of t.values())n.push(i.agentReadiness);let o=r.weights.discoverabilityWeight,s=e*100;return{agentReadiness:Pp(Zn(n)*(1-o)+s*o)}}function Is(t,e,r){return t-e+e*r}function Op(t,e){return Is(t.polymorphismCount,t.anyOfCount,e)}function pt(t){return Math.max(0,Math.min(1,t))}function vp(t){let e=t.size||1,r={parameterSimplicity:0,schemaSimplicity:0,documentationQuality:0,constraintClarity:0,exampleCoverage:0,errorClarity:0,dependencyClarity:0,identifierClarity:0,polymorphismClarity:0};for(let n of t.values())r.parameterSimplicity+=n.subscores.parameterSimplicity,r.schemaSimplicity+=n.subscores.schemaSimplicity,r.documentationQuality+=n.subscores.documentationQuality,r.constraintClarity+=n.subscores.constraintClarity,r.exampleCoverage+=n.subscores.exampleCoverage,r.errorClarity+=n.subscores.errorClarity,r.dependencyClarity+=n.subscores.dependencyClarity,r.identifierClarity+=n.subscores.identifierClarity,r.polymorphismClarity+=n.subscores.polymorphismClarity;return r.parameterSimplicity/=e,r.schemaSimplicity/=e,r.documentationQuality/=e,r.constraintClarity/=e,r.exampleCoverage/=e,r.errorClarity/=e,r.dependencyClarity/=e,r.identifierClarity/=e,r.polymorphismClarity/=e,r}function Pp(t){return Math.round(t*10)/10}function Rp(t,e,r){let n=Math.max(1,t);return e/n+r/n}function by(t,e){return e.totalSchemaProperties>t.totalSchemaProperties?!0:e.totalSchemaProperties<t.totalSchemaProperties?!1:Rp(e.totalSchemaProperties,e.schemaPropertiesWithDescription,e.constraintCount)>Rp(t.totalSchemaProperties,t.schemaPropertiesWithDescription,t.constraintCount)}var Sy=["enum","const","format","pattern","minimum","maximum","minLength","maxLength","minItems","maxItems","minProperties","maxProperties","multipleOf","exclusiveMinimum","exclusiveMaximum","uniqueItems"];function _s(){return{depth:-1,maxDepth:0,polymorphismCount:0,anyOfCount:0,hasDiscriminator:!1,totalSchemaProperties:0,schemaPropertiesWithDescription:0,constraintCount:0,hasPropertyExamples:!1,writableTopLevelFields:0,refsUsed:[],debugEntries:null,pendingRef:null}}function _p(t){Object.assign(t,_s())}function Tp(t){return{ref:{enter(e){typeof e?.$ref=="string"&&(t.refsUsed.push(e.$ref),t.pendingRef=e.$ref)}},Schema:{enter(e,r){t.depth++,t.maxDepth=Math.max(t.maxDepth,t.depth);let n=0;for(let i of Sy)e[i]!==void 0&&(t.constraintCount++,n++);e.discriminator?.propertyName&&(t.hasDiscriminator=!0);let o={};for(let i of["oneOf","anyOf","allOf"]){let a=e[i];Array.isArray(a)&&(t.polymorphismCount+=a.length,i==="anyOf"&&(t.anyOfCount+=a.length),o[i]=a.length)}let s=[];if(re(e.properties)){let i=Object.entries(e.properties);t.totalSchemaProperties+=i.length;for(let[a,c]of i){s.push(a);let p=c&&"$ref"in c&&c.$ref?r.resolve(c)?.node??c:c;p?.description&&t.schemaPropertiesWithDescription++,(p?.example!==void 0||p?.examples)&&(t.hasPropertyExamples=!0),p?.readOnly||t.writableTopLevelFields++}}t.debugEntries!==null&&t.debugEntries.push({ref:t.pendingRef,depth:t.depth,propertyNames:s,polymorphism:Object.keys(o).length>0?o:{},constraintCount:n}),t.pendingRef=null},leave(){t.depth--}}}}function jp(t,e,r){return{operations:new Map,currentPath:"",pathLevelParams:[],current:null,walkSchema:t,anyOfPenaltyMultiplier:e,debugOperationId:r,debugLogs:[]}}function wy(t,e,r){return{path:t,method:e,operationId:r.operationId,operationDescriptionPresent:!!r.description,parameterCount:0,requiredParameterCount:0,paramsWithDescription:0,ambiguousIdentifierCount:0,maxRequestSchemaDepth:0,maxResponseSchemaDepth:0,totalSchemaProperties:0,schemaPropertiesWithDescription:0,constraintCount:0,polymorphismCount:0,anyOfCount:0,hasDiscriminator:!1,topLevelWritableFieldCount:0,requestBodyPresent:!1,requestExamplePresent:!1,responseExamplePresent:!1,structuredErrorResponseCount:0,totalErrorResponses:0,inRequestBody:!1,inResponse:!1,currentResponseCode:"",errorStructuredCounted:!1,maxEffectivePolymorphism:-1,refsUsed:new Set}}function Ey(t){let{inRequestBody:e,inResponse:r,currentResponseCode:n,errorStructuredCounted:o,maxEffectivePolymorphism:s,...i}=t;return i}function Dp(t){return{RequestBody:{enter(){t.current&&(t.current.requestBodyPresent=!0,t.current.inRequestBody=!0)},leave(){t.current&&(t.current.inRequestBody=!1)}},Response:{enter(e,r){let n=t.current;if(!n)return;let o=String(r.key);n.inResponse=!0,n.currentResponseCode=o,n.errorStructuredCounted=!1,Ip(o)&&(n.totalErrorResponses++,!e.content&&e.description&&(n.structuredErrorResponseCount++,n.errorStructuredCounted=!0))},leave(){t.current&&(t.current.inResponse=!1)}},MediaType:{enter(e){let r=t.current;if(r&&(Cy(e)&&(r.inRequestBody&&(r.requestExamplePresent=!0),r.inResponse&&(r.responseExamplePresent=!0)),r.inResponse&&Ip(r.currentResponseCode)&&!r.errorStructuredCounted&&(r.structuredErrorResponseCount++,r.errorStructuredCounted=!0),e.schema)){let n=!!t.debugOperationId&&(r.operationId===t.debugOperationId||`${r.method.toUpperCase()} ${r.path}`===t.debugOperationId),o=t.walkSchema(e.schema,n);by(r,o)&&(r.totalSchemaProperties=o.totalSchemaProperties,r.schemaPropertiesWithDescription=o.schemaPropertiesWithDescription,r.constraintCount=o.constraintCount);let s=Is(o.polymorphismCount,o.anyOfCount,t.anyOfPenaltyMultiplier);s>r.maxEffectivePolymorphism&&(r.maxEffectivePolymorphism=s,r.polymorphismCount=o.polymorphismCount,r.anyOfCount=o.anyOfCount),o.hasDiscriminator&&(r.hasDiscriminator=!0);for(let i of o.refsUsed)r.refsUsed.add(i);if(o.hasPropertyExamples&&(r.inRequestBody&&(r.requestExamplePresent=!0),r.inResponse&&(r.responseExamplePresent=!0)),r.inRequestBody&&(r.maxRequestSchemaDepth=Math.max(r.maxRequestSchemaDepth,o.maxDepth),r.topLevelWritableFieldCount=Math.max(r.topLevelWritableFieldCount,o.writableTopLevelFields)),r.inResponse&&(r.maxResponseSchemaDepth=Math.max(r.maxResponseSchemaDepth,o.maxDepth)),n&&o.debugEntries){let i=r.inRequestBody?"REQUEST BODY":`RESPONSE ${r.currentResponseCode}`;t.debugLogs.push({context:i,entries:o.debugEntries,totalProperties:o.totalSchemaProperties,totalPolymorphism:o.polymorphismCount,totalConstraints:o.constraintCount,maxDepth:o.maxDepth})}}}},Paths:{PathItem:{enter(e,r){t.currentPath=String(r.key),t.pathLevelParams=e.parameters??[]},Operation:{enter(e,r){let n=String(r.key),o=wy(t.currentPath,n,e);t.current=o;let s=Oy(t.pathLevelParams,e.parameters??[],r.resolve);for(let i of s.values())o.parameterCount++,i.required&&o.requiredParameterCount++,i.description&&o.paramsWithDescription++,xy(i)&&o.ambiguousIdentifierCount++},leave(e){let r=t.current;if(!r)return;let n=e.operationId??`${r.method.toUpperCase()} ${r.path}`;t.operations.set(n,Ey(r)),t.current=null}}}}}}function Np(t){return{operationCount:t.operations.size,operations:t.operations}}function $p(t,e){return e(t).node}function Oy(t,e,r){let n=new Map;for(let o of t){let s=$p(o,r);s?.name&&s.in&&n.set(`${s.in}:${s.name}`,s)}for(let o of e){let s=$p(o,r);s?.name&&s.in&&n.set(`${s.in}:${s.name}`,s)}return n}function Cy(t){return t.example!==void 0||zs(t.examples)}function xy(t){if(t.description)return!1;let e=(t.name??"").toLowerCase();return Ep.has(e)}function Ip(t){if(t==="default"||/^4xx$/i.test(t)||/^5xx$/i.test(t))return!0;let e=parseInt(t,10);return e>=400&&e<600}function Ay(t,e){if(!e.startsWith("#/"))return;let r=t;for(let n of e.slice(2).split("/"))r=r?.[Hs(n)];return r}function Lp({document:t,types:e,resolvedRefMap:r,ctx:n,debugOperationId:o,scoringConstants:s}){let i=s?.weights.anyOfPenaltyMultiplier??wt.weights.anyOfPenaltyMultiplier,a=_s(),c=Tp(a),p=Lr([{severity:"warn",ruleId:"score-schema",visitor:c}],e),u=(A,E)=>{_p(a),E&&(a.debugEntries=[]),Mr({document:{...t,parsed:A},rootType:e.Schema,normalizedVisitors:p,resolvedRefMap:r,ctx:n});let{depth:$,pendingRef:_,debugEntries:J,...ie}=a;return{...ie,refsUsed:[...a.refsUsed],debugEntries:E?a.debugEntries??void 0:void 0}},l=new Map,d=new WeakSet,m={maxDepth:0,polymorphismCount:0,anyOfCount:0,hasDiscriminator:!1,totalSchemaProperties:0,schemaPropertiesWithDescription:0,constraintCount:0,hasPropertyExamples:!1,writableTopLevelFields:0,refsUsed:[]};function w(A,E){return{maxDepth:Math.max(A.maxDepth,E.maxDepth),polymorphismCount:A.polymorphismCount+E.polymorphismCount,anyOfCount:A.anyOfCount+E.anyOfCount,hasDiscriminator:A.hasDiscriminator||E.hasDiscriminator,totalSchemaProperties:A.totalSchemaProperties+E.totalSchemaProperties,schemaPropertiesWithDescription:A.schemaPropertiesWithDescription+E.schemaPropertiesWithDescription,constraintCount:A.constraintCount+E.constraintCount,hasPropertyExamples:A.hasPropertyExamples||E.hasPropertyExamples,writableTopLevelFields:A.writableTopLevelFields+E.writableTopLevelFields,refsUsed:[...A.refsUsed,...E.refsUsed],debugEntries:A.debugEntries||E.debugEntries?[...A.debugEntries??[],...E.debugEntries??[]]:void 0}}let h=(A,E=!1)=>{let $=A,_=_e(A)?A.$ref:void 0;if(_){if(!E){let Y=l.get(_);if(Y)return Y}$=Ay(t.parsed,_)??A}if(re($)&&d.has($))return{...m};re($)&&d.add($);let J=$?.oneOf,ie=$?.anyOf,V=Array.isArray(J)&&J.length>1,De=Array.isArray(ie)&&ie.length>1,I=V||De,v=Array.isArray($?.allOf)&&$.allOf.length>0,M=$?.discriminator,U=!I&&re(M?.mapping)?Object.values(M.mapping).filter(Y=>typeof Y=="string"&&Ks(Y)).map(Y=>({$ref:Y})):null,ne=Array.isArray(U)&&U.length>0,te;if(I||v||ne){let Y={...$},ce=null,$e=Ae=>{ce=ce?w(ce,Ae):Ae},le=(Ae,Qe)=>{let k=h(Qe[0],E);for(let ae=1;ae<Qe.length;ae++){let oe=h(Qe[ae],E);oe.totalSchemaProperties>k.totalSchemaProperties&&(k=oe)}return{...k,polymorphismCount:k.polymorphismCount+Qe.length,anyOfCount:k.anyOfCount+(Ae==="anyOf"?Qe.length:0),hasDiscriminator:k.hasDiscriminator||!!M}};I&&delete Y.discriminator,V&&(delete Y.oneOf,$e(le("oneOf",J))),De&&(delete Y.anyOf,$e(le("anyOf",ie)));let Ge=null;if(ne){delete Y.discriminator;let Ae=h(U[0],E);for(let Qe=1;Qe<U.length;Qe++){let k=h(U[Qe],E);k.totalSchemaProperties>Ae.totalSchemaProperties&&(Ae=k)}Ge={...Ae,polymorphismCount:Ae.polymorphismCount+U.length,hasDiscriminator:!0}}let Ze=null;if(v){delete Y.allOf,Ze={...m};for(let Ae of $.allOf)Ze=w(Ze,h(Ae,E));Ze.polymorphismCount+=$.allOf.length}te=u(Y,E),Ze&&(te=w(te,Ze)),ce&&(te=w(te,ce)),Ge&&(te=w(te,Ge)),_&&(te={...te,refsUsed:[_,...te.refsUsed]})}else te=u(A,E);return re($)&&d.delete($),_&&!E&&l.set(_,te),te},x=jp(h,i,o),P=Dp(x),C=Lr([{severity:"warn",ruleId:"score",visitor:P}],e);return Mr({document:t,rootType:e.Root,normalizedVisitors:C,resolvedRefMap:r,ctx:n}),{metrics:Np(x),debugLogs:x.debugLogs}}function Mp(t){let e=new Map;for(let[o,s]of t)for(let i of s.refsUsed){let a=e.get(i);a||(a=new Set,e.set(i,a)),a.add(o)}let r=new Map;for(let o of t.keys())r.set(o,new Set);for(let o of e.values()){if(o.size<2)continue;let s=Array.from(o);for(let i=0;i<s.length;i++)for(let a=i+1;a<s.length;a++)r.get(s[i]).add(s[a]),r.get(s[a]).add(s[i])}let n=new Map;for(let o of t.keys()){let s=vy(o,r);n.set(o,s)}return n}function vy(t,e){let r=new Set([t]),n=[t],o=0;for(;n.length>0;){let s=[];for(let i of n)for(let a of e.get(i)??[])r.has(a)||(r.add(a),s.push(a));s.length>0&&o++,n=s}return o}function Fp(t){let e={agentReadiness:t.agentReadiness,discoverability:Math.round(t.discoverability*100),subscores:t.subscores,rawMetrics:{operationCount:t.rawMetrics.operationCount,operations:Object.fromEntries(Array.from(t.rawMetrics.operations.entries()).map(([r,n])=>{let{refsUsed:o,...s}=n;return[r,s]}))},operationScores:Object.fromEntries(t.operationScores),dependencyDepths:Object.fromEntries(t.dependencyDepths),hotspots:t.hotspots};y.output(JSON.stringify(e,null,2))}function kp(t,e=!1){Py(t),Ry(t),Iy(t),e&&_y(t),Ty(t)}function Up(t){return t>=80?pe:t>=50?ee:Ne}function qp(t){return Up(t)(ye(t.toFixed(1)))}function H(t){y.output(t+`
|
|
141
|
+
${o}`}async function bp({argv:t,config:e,version:r,collectSpecData:n}){let o,s;try{let{run:i,conditionallyMaskSecrets:a}=await import("./chunks/3HOQ2EH4.js"),c=e.configPath?dy(e.configPath):process.cwd();t.mtls&&(o=gp(t.mtls,c));let p=Ql(o);t["har-output"]&&(s=tp({version:r}),p=Ps(p,{har:s}));let u=new ft({http:{headers:e.resolve?.http?.headers??[],customFetch:p}}),l={files:t.files,input:t.input,server:t.server,workflow:t.workflow,skip:t.skip,verbose:t.verbose,config:e,version:r,collectSpecData:n,severity:t.severity,maxSteps:t["max-steps"],maxFetchTimeout:t["max-fetch-timeout"],executionTimeout:t["execution-timeout"],requestFileLoader:{getFileBody:async x=>{if(!fy(x))throw new Error(`File ${x} doesn't exist or isn't readable.`);let P=my(x);return new File([P],hy(x))}},envVariables:Zl(c)||{},logger:y,fetch:p,externalRefResolver:u,noSecretsMasking:t["no-secrets-masking"]};if(l.skip&&l.workflow)throw new Error("Cannot use both --skip and --workflow flags at the same time.");if(t["har-output"]&&!t["har-output"].endsWith(".har"))throw new Error("File for HAR logs should be in .har format");if(t["json-output"]&&!t["json-output"].endsWith(".json"))throw new Error("File for JSON logs should be in .json format");if(l.files.length>1&&t["har-output"])throw new Error("Currently only a single file can be run with --har-output. Please run a single file at a time.");let d=performance.now(),m=await i(l);y.printNewLine(),ep(m,y),y.printNewLine();let w=m.some(x=>x.hasProblems),h=m.some(x=>x.hasWarnings);if(t["json-output"]){let x={files:mp(m),status:w?"error":h?"warn":"success",totalTime:performance.now()-d};yp(t["json-output"],Es(x,2),"utf-8"),y.output(Q(y.indent(`JSON logs saved in ${pe(t["json-output"])}`,2))),y.printNewLine(),y.printNewLine()}if(t["har-output"])for(let x of m){let P=a({value:s,noSecretsMasking:x.ctx.noSecretsMasking,secretsSet:x.ctx.secretsSet||new Set});yp(t["har-output"],Es(P,2),"utf-8"),y.output(Q(`Har logs saved in ${pe(t["har-output"])}`)),y.printNewLine(),y.printNewLine()}if(w)throw new Error(" Tests exited with error ")}catch(i){throw new Ve(i?.message??i)}}function wp(t){if(Array.isArray(t)){let e={};for(let r of t)if(r&&typeof r=="string"){let n=Sp(r);Object.assign(e,n)}return Object.keys(e).length>0?e:void 0}if(!(!t||typeof t!="string"))return Sp(t)}function Sp(t){try{let e=JSON.parse(t);if(!re(e))throw new Error("mTLS config must be an object mapping domains to certificate configurations");for(let[r,n]of Object.entries(e)){if(!re(n))throw new Error(`mTLS config for domain "${r}" must be an object`);$s(n,"clientCert",r,!0),$s(n,"clientKey",r,!0),$s(n,"caCert",r,!1)}return e}catch(e){throw e instanceof SyntaxError?new Error(`Invalid JSON for --mtls option: ${e.message}`):e}}function $s(t,e,r,n){let o=t[e];if(!o){if(n)throw new Error(`${e} is required for domain "${r}"`);return}if(typeof o!="string")throw new Error(`${e} for domain "${r}" must be a string`)}import{performance as Dy}from"perf_hooks";var wt={thresholds:{maxParamsGood:5,maxDepthGood:4,maxPolymorphismGood:2,maxDependencyDepthGood:3,maxAmbiguousGood:0,maxOperationsForDiscoverability:1e3},weights:{parameterSimplicity:.1,schemaSimplicity:.1,documentationQuality:.18,constraintClarity:.12,exampleCoverage:.18,errorClarity:.12,dependencyClarity:.1,identifierClarity:.05,polymorphismClarity:.05,anyOfPenaltyMultiplier:2,discoverabilityWeight:.1},hotspotLimit:10},Ep=new Set(["id","name","type","value","data","key","status","state","code","result","item","object","resource","entity","input","output","payload","body","content","info"]);function Zn(t){if(t.length===0)return 0;let e=[...t].sort((n,o)=>n-o),r=Math.floor(e.length/2);return e.length%2!==0?e[r]:(e[r-1]+e[r])/2}function gy(t,e,r=wt){let{thresholds:n,weights:o}=r,s=pt(1-t.parameterCount/(n.maxParamsGood*2)),a=Math.max(t.maxRequestSchemaDepth,t.maxResponseSchemaDepth)/(n.maxDepthGood*2),c=Op(t,o.anyOfPenaltyMultiplier)/(n.maxPolymorphismGood*3),p=pt(1-a-c),u=(t.operationDescriptionPresent?1:0)+t.paramsWithDescription+t.schemaPropertiesWithDescription,l=1+t.parameterCount+t.totalSchemaProperties,d=l>0?pt(u/l):1,m=t.totalSchemaProperties>0?pt(t.constraintCount/t.totalSchemaProperties):1,w=(t.requestExamplePresent?1:0)+(t.responseExamplePresent?1:0),h=(t.requestBodyPresent?1:0)+1,x=pt(w/h),P=t.totalErrorResponses>0?pt(t.structuredErrorResponseCount/t.totalErrorResponses):1,C=pt(1-e/(n.maxDependencyDepthGood*2)),A=pt(1-t.ambiguousIdentifierCount/Math.max(n.maxAmbiguousGood+3,1)),E=Op(t,o.anyOfPenaltyMultiplier),$=E===0?1:t.hasDiscriminator?pt(1-E/(n.maxPolymorphismGood*4)):pt(1-E/(n.maxPolymorphismGood*2));return{parameterSimplicity:s,schemaSimplicity:p,documentationQuality:d,constraintClarity:m,exampleCoverage:x,errorClarity:P,dependencyClarity:C,identifierClarity:A,polymorphismClarity:$}}function yy(t,e=wt){let r=e.weights,n=t.parameterSimplicity*r.parameterSimplicity+t.schemaSimplicity*r.schemaSimplicity+t.documentationQuality*r.documentationQuality+t.constraintClarity*r.constraintClarity+t.exampleCoverage*r.exampleCoverage+t.errorClarity*r.errorClarity+t.dependencyClarity*r.dependencyClarity+t.identifierClarity*r.identifierClarity+t.polymorphismClarity*r.polymorphismClarity;return Pp(pt(n)*100)}function Cp(t,e,r=wt){let n=new Map;for(let[o,s]of t.operations){let i=e.get(o)??0,a=gy(s,i,r);n.set(o,{agentReadiness:yy(a,r),subscores:a})}return n}function xp(t,e=wt){return pt(1-t/e.thresholds.maxOperationsForDiscoverability)}function Ap(t,e,r=wt){if(t.size===0)return{agentReadiness:100};let n=[];for(let i of t.values())n.push(i.agentReadiness);let o=r.weights.discoverabilityWeight,s=e*100;return{agentReadiness:Pp(Zn(n)*(1-o)+s*o)}}function Is(t,e,r){return t-e+e*r}function Op(t,e){return Is(t.polymorphismCount,t.anyOfCount,e)}function pt(t){return Math.max(0,Math.min(1,t))}function vp(t){let e=t.size||1,r={parameterSimplicity:0,schemaSimplicity:0,documentationQuality:0,constraintClarity:0,exampleCoverage:0,errorClarity:0,dependencyClarity:0,identifierClarity:0,polymorphismClarity:0};for(let n of t.values())r.parameterSimplicity+=n.subscores.parameterSimplicity,r.schemaSimplicity+=n.subscores.schemaSimplicity,r.documentationQuality+=n.subscores.documentationQuality,r.constraintClarity+=n.subscores.constraintClarity,r.exampleCoverage+=n.subscores.exampleCoverage,r.errorClarity+=n.subscores.errorClarity,r.dependencyClarity+=n.subscores.dependencyClarity,r.identifierClarity+=n.subscores.identifierClarity,r.polymorphismClarity+=n.subscores.polymorphismClarity;return r.parameterSimplicity/=e,r.schemaSimplicity/=e,r.documentationQuality/=e,r.constraintClarity/=e,r.exampleCoverage/=e,r.errorClarity/=e,r.dependencyClarity/=e,r.identifierClarity/=e,r.polymorphismClarity/=e,r}function Pp(t){return Math.round(t*10)/10}function Rp(t,e,r){let n=Math.max(1,t);return e/n+r/n}function by(t,e){return e.totalSchemaProperties>t.totalSchemaProperties?!0:e.totalSchemaProperties<t.totalSchemaProperties?!1:Rp(e.totalSchemaProperties,e.schemaPropertiesWithDescription,e.constraintCount)>Rp(t.totalSchemaProperties,t.schemaPropertiesWithDescription,t.constraintCount)}var Sy=["enum","const","format","pattern","minimum","maximum","minLength","maxLength","minItems","maxItems","minProperties","maxProperties","multipleOf","exclusiveMinimum","exclusiveMaximum","uniqueItems"];function _s(){return{depth:-1,maxDepth:0,polymorphismCount:0,anyOfCount:0,hasDiscriminator:!1,totalSchemaProperties:0,schemaPropertiesWithDescription:0,constraintCount:0,hasPropertyExamples:!1,writableTopLevelFields:0,refsUsed:[],debugEntries:null,pendingRef:null}}function _p(t){Object.assign(t,_s())}function Tp(t){return{ref:{enter(e){typeof e?.$ref=="string"&&(t.refsUsed.push(e.$ref),t.pendingRef=e.$ref)}},Schema:{enter(e,r){t.depth++,t.maxDepth=Math.max(t.maxDepth,t.depth);let n=0;for(let i of Sy)e[i]!==void 0&&(t.constraintCount++,n++);e.discriminator?.propertyName&&(t.hasDiscriminator=!0);let o={};for(let i of["oneOf","anyOf","allOf"]){let a=e[i];Array.isArray(a)&&(t.polymorphismCount+=a.length,i==="anyOf"&&(t.anyOfCount+=a.length),o[i]=a.length)}let s=[];if(re(e.properties)){let i=Object.entries(e.properties);t.totalSchemaProperties+=i.length;for(let[a,c]of i){s.push(a);let p=c&&"$ref"in c&&c.$ref?r.resolve(c)?.node??c:c;p?.description&&t.schemaPropertiesWithDescription++,(p?.example!==void 0||p?.examples)&&(t.hasPropertyExamples=!0),p?.readOnly||t.writableTopLevelFields++}}t.debugEntries!==null&&t.debugEntries.push({ref:t.pendingRef,depth:t.depth,propertyNames:s,polymorphism:Object.keys(o).length>0?o:{},constraintCount:n}),t.pendingRef=null},leave(){t.depth--}}}}function jp(t,e,r){return{operations:new Map,currentPath:"",pathLevelParams:[],current:null,walkSchema:t,anyOfPenaltyMultiplier:e,debugOperationId:r,debugLogs:[]}}function wy(t,e,r){return{path:t,method:e,operationId:r.operationId,operationDescriptionPresent:!!r.description,parameterCount:0,requiredParameterCount:0,paramsWithDescription:0,ambiguousIdentifierCount:0,maxRequestSchemaDepth:0,maxResponseSchemaDepth:0,totalSchemaProperties:0,schemaPropertiesWithDescription:0,constraintCount:0,polymorphismCount:0,anyOfCount:0,hasDiscriminator:!1,topLevelWritableFieldCount:0,requestBodyPresent:!1,requestExamplePresent:!1,responseExamplePresent:!1,structuredErrorResponseCount:0,totalErrorResponses:0,inRequestBody:!1,inResponse:!1,currentResponseCode:"",errorStructuredCounted:!1,maxEffectivePolymorphism:-1,refsUsed:new Set}}function Ey(t){let{inRequestBody:e,inResponse:r,currentResponseCode:n,errorStructuredCounted:o,maxEffectivePolymorphism:s,...i}=t;return i}function Dp(t){return{RequestBody:{enter(){t.current&&(t.current.requestBodyPresent=!0,t.current.inRequestBody=!0)},leave(){t.current&&(t.current.inRequestBody=!1)}},Response:{enter(e,r){let n=t.current;if(!n)return;let o=String(r.key);n.inResponse=!0,n.currentResponseCode=o,n.errorStructuredCounted=!1,Ip(o)&&(n.totalErrorResponses++,!e.content&&e.description&&(n.structuredErrorResponseCount++,n.errorStructuredCounted=!0))},leave(){t.current&&(t.current.inResponse=!1)}},MediaType:{enter(e){let r=t.current;if(r&&(Cy(e)&&(r.inRequestBody&&(r.requestExamplePresent=!0),r.inResponse&&(r.responseExamplePresent=!0)),r.inResponse&&Ip(r.currentResponseCode)&&!r.errorStructuredCounted&&(r.structuredErrorResponseCount++,r.errorStructuredCounted=!0),e.schema)){let n=!!t.debugOperationId&&(r.operationId===t.debugOperationId||`${r.method.toUpperCase()} ${r.path}`===t.debugOperationId),o=t.walkSchema(e.schema,n);by(r,o)&&(r.totalSchemaProperties=o.totalSchemaProperties,r.schemaPropertiesWithDescription=o.schemaPropertiesWithDescription,r.constraintCount=o.constraintCount);let s=Is(o.polymorphismCount,o.anyOfCount,t.anyOfPenaltyMultiplier);s>r.maxEffectivePolymorphism&&(r.maxEffectivePolymorphism=s,r.polymorphismCount=o.polymorphismCount,r.anyOfCount=o.anyOfCount),o.hasDiscriminator&&(r.hasDiscriminator=!0);for(let i of o.refsUsed)r.refsUsed.add(i);if(o.hasPropertyExamples&&(r.inRequestBody&&(r.requestExamplePresent=!0),r.inResponse&&(r.responseExamplePresent=!0)),r.inRequestBody&&(r.maxRequestSchemaDepth=Math.max(r.maxRequestSchemaDepth,o.maxDepth),r.topLevelWritableFieldCount=Math.max(r.topLevelWritableFieldCount,o.writableTopLevelFields)),r.inResponse&&(r.maxResponseSchemaDepth=Math.max(r.maxResponseSchemaDepth,o.maxDepth)),n&&o.debugEntries){let i=r.inRequestBody?"REQUEST BODY":`RESPONSE ${r.currentResponseCode}`;t.debugLogs.push({context:i,entries:o.debugEntries,totalProperties:o.totalSchemaProperties,totalPolymorphism:o.polymorphismCount,totalConstraints:o.constraintCount,maxDepth:o.maxDepth})}}}},Paths:{PathItem:{enter(e,r){t.currentPath=String(r.key),t.pathLevelParams=e.parameters??[]},Operation:{enter(e,r){let n=String(r.key),o=wy(t.currentPath,n,e);t.current=o;let s=Oy(t.pathLevelParams,e.parameters??[],r.resolve);for(let i of s.values())o.parameterCount++,i.required&&o.requiredParameterCount++,i.description&&o.paramsWithDescription++,xy(i)&&o.ambiguousIdentifierCount++},leave(e){let r=t.current;if(!r)return;let n=e.operationId??`${r.method.toUpperCase()} ${r.path}`;t.operations.set(n,Ey(r)),t.current=null}}}}}}function Np(t){return{operationCount:t.operations.size,operations:t.operations}}function $p(t,e){return e(t).node}function Oy(t,e,r){let n=new Map;for(let o of t){let s=$p(o,r);s?.name&&s.in&&n.set(`${s.in}:${s.name}`,s)}for(let o of e){let s=$p(o,r);s?.name&&s.in&&n.set(`${s.in}:${s.name}`,s)}return n}function Cy(t){return t.example!==void 0||zs(t.examples)}function xy(t){if(t.description)return!1;let e=(t.name??"").toLowerCase();return Ep.has(e)}function Ip(t){if(t==="default"||/^4xx$/i.test(t)||/^5xx$/i.test(t))return!0;let e=parseInt(t,10);return e>=400&&e<600}function Ay(t,e){if(!e.startsWith("#/"))return;let r=t;for(let n of e.slice(2).split("/"))r=r?.[Hs(n)];return r}function Lp({document:t,types:e,resolvedRefMap:r,ctx:n,debugOperationId:o,scoringConstants:s}){let i=s?.weights.anyOfPenaltyMultiplier??wt.weights.anyOfPenaltyMultiplier,a=_s(),c=Tp(a),p=Lr([{severity:"warn",ruleId:"score-schema",visitor:c}],e),u=(A,E)=>{_p(a),E&&(a.debugEntries=[]),Mr({document:{...t,parsed:A},rootType:e.Schema,normalizedVisitors:p,resolvedRefMap:r,ctx:n});let{depth:$,pendingRef:_,debugEntries:J,...ie}=a;return{...ie,refsUsed:[...a.refsUsed],debugEntries:E?a.debugEntries??void 0:void 0}},l=new Map,d=new WeakSet,m={maxDepth:0,polymorphismCount:0,anyOfCount:0,hasDiscriminator:!1,totalSchemaProperties:0,schemaPropertiesWithDescription:0,constraintCount:0,hasPropertyExamples:!1,writableTopLevelFields:0,refsUsed:[]};function w(A,E){return{maxDepth:Math.max(A.maxDepth,E.maxDepth),polymorphismCount:A.polymorphismCount+E.polymorphismCount,anyOfCount:A.anyOfCount+E.anyOfCount,hasDiscriminator:A.hasDiscriminator||E.hasDiscriminator,totalSchemaProperties:A.totalSchemaProperties+E.totalSchemaProperties,schemaPropertiesWithDescription:A.schemaPropertiesWithDescription+E.schemaPropertiesWithDescription,constraintCount:A.constraintCount+E.constraintCount,hasPropertyExamples:A.hasPropertyExamples||E.hasPropertyExamples,writableTopLevelFields:A.writableTopLevelFields+E.writableTopLevelFields,refsUsed:[...A.refsUsed,...E.refsUsed],debugEntries:A.debugEntries||E.debugEntries?[...A.debugEntries??[],...E.debugEntries??[]]:void 0}}let h=(A,E=!1)=>{let $=A,_=_e(A)?A.$ref:void 0;if(_){if(!E){let Y=l.get(_);if(Y)return Y}$=Ay(t.parsed,_)??A}if(re($)&&d.has($))return{...m};re($)&&d.add($);let J=$?.oneOf,ie=$?.anyOf,V=Array.isArray(J)&&J.length>1,De=Array.isArray(ie)&&ie.length>1,I=V||De,v=Array.isArray($?.allOf)&&$.allOf.length>0,M=$?.discriminator,U=!I&&re(M?.mapping)?Object.values(M.mapping).filter(Y=>typeof Y=="string"&&Ks(Y)).map(Y=>({$ref:Y})):null,ne=Array.isArray(U)&&U.length>0,te;if(I||v||ne){let Y={...$},ce=null,$e=Ae=>{ce=ce?w(ce,Ae):Ae},le=(Ae,Qe)=>{let k=h(Qe[0],E);for(let ae=1;ae<Qe.length;ae++){let oe=h(Qe[ae],E);oe.totalSchemaProperties>k.totalSchemaProperties&&(k=oe)}return{...k,polymorphismCount:k.polymorphismCount+Qe.length,anyOfCount:k.anyOfCount+(Ae==="anyOf"?Qe.length:0),hasDiscriminator:k.hasDiscriminator||!!M}};I&&delete Y.discriminator,V&&(delete Y.oneOf,$e(le("oneOf",J))),De&&(delete Y.anyOf,$e(le("anyOf",ie)));let Ge=null;if(ne){delete Y.discriminator;let Ae=h(U[0],E);for(let Qe=1;Qe<U.length;Qe++){let k=h(U[Qe],E);k.totalSchemaProperties>Ae.totalSchemaProperties&&(Ae=k)}Ge={...Ae,polymorphismCount:Ae.polymorphismCount+U.length,hasDiscriminator:!0}}let Ze=null;if(v){delete Y.allOf,Ze={...m};for(let Ae of $.allOf)Ze=w(Ze,h(Ae,E));Ze.polymorphismCount+=$.allOf.length}te=u(Y,E),Ze&&(te=w(te,Ze)),ce&&(te=w(te,ce)),Ge&&(te=w(te,Ge)),_&&(te={...te,refsUsed:[_,...te.refsUsed]})}else te=u(A,E);return re($)&&d.delete($),_&&!E&&l.set(_,te),te},x=jp(h,i,o),P=Dp(x),C=Lr([{severity:"warn",ruleId:"score",visitor:P}],e);return Mr({document:t,rootType:e.Root,normalizedVisitors:C,resolvedRefMap:r,ctx:n}),{metrics:Np(x),debugLogs:x.debugLogs}}function Mp(t){let e=new Map;for(let[o,s]of t)for(let i of s.refsUsed){let a=e.get(i);a||(a=new Set,e.set(i,a)),a.add(o)}let r=new Map;for(let o of t.keys())r.set(o,new Set);for(let o of e.values()){if(o.size<2)continue;let s=Array.from(o);for(let i=0;i<s.length;i++)for(let a=i+1;a<s.length;a++)r.get(s[i]).add(s[a]),r.get(s[a]).add(s[i])}let n=new Map;for(let o of t.keys()){let s=vy(o,r);n.set(o,s)}return n}function vy(t,e){let r=new Set([t]),n=[t],o=0;for(;n.length>0;){let s=[];for(let i of n)for(let a of e.get(i)??[])r.has(a)||(r.add(a),s.push(a));s.length>0&&o++,n=s}return o}function Fp(t){let e={agentReadiness:t.agentReadiness,discoverability:Math.round(t.discoverability*100),subscores:t.subscores,rawMetrics:{operationCount:t.rawMetrics.operationCount,operations:Object.fromEntries(Array.from(t.rawMetrics.operations.entries()).map(([r,n])=>{let{refsUsed:o,...s}=n;return[r,s]}))},operationScores:Object.fromEntries(t.operationScores),dependencyDepths:Object.fromEntries(t.dependencyDepths),hotspots:t.hotspots};y.output(JSON.stringify(e,null,2))}function kp(t,e=!1){Py(t),Ry(t),Iy(t),e&&_y(t),Ty(t)}function Up(t){return t>=80?pe:t>=50?ee:Ne}function qp(t){return Up(t)(ye(t.toFixed(1)))}function H(t){y.output(t+`
|
|
142
142
|
`)}function Py(t){H(""),H(ye(Fe(" Scores"))),H(""),H(` Agent Readiness: ${qp(t.agentReadiness)}/100`),H("")}function Ry(t){H(ye(Fe(" Subscores"))),H("");let e=t.subscores;Et("Parameter Simplicity",e.parameterSimplicity),Et("Schema Simplicity",e.schemaSimplicity),Et("Documentation Quality",e.documentationQuality),Et("Constraint Clarity",e.constraintClarity),Et("Example Coverage",e.exampleCoverage),Et("Error Clarity",e.errorClarity),Et("Dependency Clarity",e.dependencyClarity),Et("Identifier Clarity",e.identifierClarity),Et("Polymorphism Clarity",e.polymorphismClarity),Et("Discoverability",t.discoverability),H("")}function Et(t,e){let r=Math.round(e*100),n=$y(e);H(` ${t.padEnd(24)} ${n} ${Up(r)(r+"%")}`)}function $y(t){let r=Math.round(t*20);return de("["+"\u2588".repeat(r)+"\u2591".repeat(20-r)+"]")}function Iy(t){if(H(ye(Fe(" Raw Metrics Summary"))),H(""),H(` Total operations: ${t.rawMetrics.operationCount}`),t.rawMetrics.operationCount===0){H("");return}let e=[],r=[],n=[],o=[],s=0,i=0,a=0;for(let u of t.rawMetrics.operations.values())e.push(u.parameterCount),r.push(Math.max(u.maxRequestSchemaDepth,u.maxResponseSchemaDepth)),n.push(u.polymorphismCount),o.push(u.totalSchemaProperties),u.requestExamplePresent&&s++,u.responseExamplePresent&&i++,u.operationDescriptionPresent&&a++;let c=t.rawMetrics.operationCount;function p(u,l){let m=(l.reduce((P,C)=>P+C,0)/c).toFixed(1),w=Zn(l).toFixed(1),h=Math.min(...l),x=Math.max(...l);H(` ${u.padEnd(26)} avg ${m.padStart(6)} median ${w.padStart(6)} min ${String(h).padStart(5)} max ${String(x).padStart(5)}`)}p("Parameters/operation:",e),p("Schema depth:",r),p("Polymorphism/operation:",n),p("Properties/operation:",o),H(` Operations with request examples: ${s}/${c} (${Ts(s,c)})`),H(` Operations with response examples: ${i}/${c} (${Ts(i,c)})`),H(` Operations with description: ${a}/${c} (${Ts(a,c)})`),H("")}function Ts(t,e){return e>0?`${Math.round(t/e*100)}%`:"N/A"}function _y(t){H(ye(Fe(" Per-Operation Metrics"))),H("");let e=" "+"Operation".padEnd(50)+"Props".padStart(7)+"Poly".padStart(7)+"Depth".padStart(7)+"Params".padStart(8)+"Constr".padStart(8);H(de(e)),H(de(" "+"\u2500".repeat(e.length-2)));let r=[...t.rawMetrics.operations.entries()].sort(([,n],[,o])=>o.totalSchemaProperties-n.totalSchemaProperties);for(let[,n]of r){let o=(n.operationId??`${n.method.toUpperCase()} ${n.path}`).slice(0,48),s=Math.max(n.maxRequestSchemaDepth,n.maxResponseSchemaDepth),i=" "+o.padEnd(50)+String(n.totalSchemaProperties).padStart(7)+String(n.polymorphismCount).padStart(7)+String(s).padStart(7)+String(n.parameterCount).padStart(8)+String(n.constraintCount).padStart(8);H(i)}H("")}function Wp(t,e){if(H(""),H(ye(Fe(` Debug: ${t} schema breakdown`))),H(""),e.length===0){H(ee(` No schemas found for operation "${t}".`)),H(ee(' Make sure the value matches an operationId or "METHOD /path" exactly.')),H("");return}for(let r of e){H(ye(de(` ${r.context}`))),H(de(" "+"\u2500".repeat(70)));let n=new Map;for(let s of r.entries){let i=s.ref??`(inline depth ${s.depth})`,a=n.get(i);if(a){a.count++,a.totalProps+=s.propertyNames.length;for(let c of s.propertyNames)a.propNames.includes(c)||a.propNames.push(c)}else n.set(i,{count:1,totalProps:s.propertyNames.length,propNames:[...s.propertyNames]})}for(let s of r.entries){let i=s.ref??"(inline)",a=" ".repeat(Math.min(s.depth,6)),c=s.propertyNames.length,p=` ${a}${i}`;c>0&&(p+=` (${c} properties)`);let u=[];if(s.polymorphism.oneOf&&u.push(`oneOf:${s.polymorphism.oneOf}`),s.polymorphism.anyOf&&u.push(`anyOf:${s.polymorphism.anyOf}`),s.polymorphism.allOf&&u.push(`allOf:${s.polymorphism.allOf}`),u.length>0&&(p+=` [${u.join(", ")}]`),s.constraintCount>0&&(p+=` {${s.constraintCount} constraints}`),H(p),c>0&&c<=20)H(` ${a} properties: ${s.propertyNames.join(", ")}`);else if(c>20){let l=s.propertyNames.slice(0,15).join(", ");H(` ${a} properties: ${l}, ... +${c-15} more`)}}H(""),H(` Totals: ${r.totalProperties} properties, ${r.totalPolymorphism} polymorphism items, ${r.totalConstraints} constraints, max depth ${r.maxDepth}`);let o=[...n.entries()].filter(([,s])=>s.totalProps>0).sort(([,s],[,i])=>i.totalProps-s.totalProps).slice(0,10);if(o.length>0){H(""),H(ye(" Top schemas by property count:"));for(let[s,i]of o)H(` ${s}: ${i.totalProps} properties`)}H("")}}function Ty(t){if(t.hotspots.length===0){H(ye(Fe(" No hotspot operations found."))),H("");return}H(ye(Fe(` Top ${t.hotspots.length} Hotspot Operations`))),H("");for(let e of t.hotspots){let r=e.operationId?`${e.method.toUpperCase()} ${e.path} (${e.operationId})`:`${e.method.toUpperCase()} ${e.path}`;H(ye(` ${r}`)),H(` Agent Readiness: ${qp(e.agentReadinessScore)}`);for(let n of e.reasons)H(ee(` - ${n}`));H("")}}function zp(t,e,r,n=wt){let o=[];for(let[s,i]of e){let a=t.operations.get(s);if(!a)continue;let c=jy(a,r.get(s)??0,n);c.length!==0&&o.push({path:a.path,method:a.method,operationId:a.operationId,agentReadinessScore:i.agentReadiness,reasons:c})}return o.sort((s,i)=>s.reasons.length!==i.reasons.length?i.reasons.length-s.reasons.length:s.agentReadinessScore-i.agentReadinessScore),o.slice(0,n.hotspotLimit)}function jy(t,e,r){let{thresholds:n}=r,o=[];t.parameterCount>n.maxParamsGood&&o.push(`High parameter count (${t.parameterCount})`);let s=Math.max(t.maxRequestSchemaDepth,t.maxResponseSchemaDepth);s>n.maxDepthGood&&o.push(`Deep schema nesting (depth ${s})`),t.anyOfCount>0&&!t.hasDiscriminator?o.push(`Polymorphism (anyOf) without discriminator (${t.anyOfCount} anyOf)`):t.polymorphismCount>n.maxPolymorphismGood&&o.push(`High polymorphism count (${t.polymorphismCount})`);let i=t.requestBodyPresent&&!t.requestExamplePresent,a=!t.responseExamplePresent;return i&&a?o.push("Missing request and response examples"):i?o.push("Missing request body examples"):a&&o.push("Missing response examples"),t.totalErrorResponses>0&&t.structuredErrorResponseCount===0&&o.push("No structured error responses (4xx/5xx)"),t.operationDescriptionPresent||o.push("Missing operation description"),t.parameterCount>0&&t.paramsWithDescription===0&&o.push("No parameter descriptions"),e>n.maxDependencyDepthGood&&o.push(`High dependency depth (${e})`),t.ambiguousIdentifierCount>n.maxAmbiguousGood&&o.push(`Ambiguous identifiers (${t.ambiguousIdentifierCount})`),o}async function Vp({argv:t,config:e,collectSpecData:r}){let[{path:n}]=await rt(t.api?[t.api]:[],e),o=new ft(e.resolve),{bundle:s}=await pr({config:e,ref:n});r?.(s);let i=ut(s.parsed);if(lr(i)!=="oas3")return W(`The score command currently supports only OpenAPI 3.x. Detected: ${i}`);let a=Dy.now(),c=cn(e.extendTypes(cr(i),i),e),p=await ln({rootDocument:s,rootType:c.Root,externalRefResolver:o}),u=t["debug-operation-id"],{metrics:l,debugLogs:d}=Lp({document:s,types:c,resolvedRefMap:p,ctx:{problems:[],specVersion:i,config:e,visitorsData:{}},debugOperationId:u}),m=Mp(l.operations),w=Cp(l,m),h=xp(l.operationCount),{agentReadiness:x}=Ap(w,h),P=zp(l,w,m),C={agentReadiness:x,discoverability:h,subscores:vp(w),rawMetrics:l,hotspots:P,operationScores:w,dependencyDepths:m};Ny(C,n,a,t.format,!!t["operation-details"],u?{operationId:u,logs:d}:void 0)}function Ny(t,e,r,n,o,s){y.info(`Document: ${et(e)} score:
|
|
143
143
|
`),n==="json"?Fp(t):kp(t,o),s&&Wp(s.operationId,s.logs),He("score",r,e)}async function Bp(t,e=!1){let r=ur(t,t.resolvedConfig?.residency),n=new Fr,o=await n.getAccessToken(r);if(o)return e&&y.info(`Using existing access token.
|
|
144
144
|
`),o;e&&y.warn(`No valid access token found or refresh token expired. Attempting login...
|
|
@@ -269,13 +269,13 @@ ${et(`${Ur(r)} URL`)}: ${de(e||"No URL yet.")}`;default:{let o=`${ee(`No status
|
|
|
269
269
|
`),await lo({argv:{organization:o,project:s,pushId:$,wait:!0,domain:c,"max-execution-time":m,"start-time":n,"continue-on-deploy-failures":t["continue-on-deploy-failures"]},config:e,version:tt})),a&&He(P,r,`${Ie("file",x.length)} uploaded to organization ${o}, project ${s}. Push ID: ${$}.`),C.reportSunsetWarnings(),{pushId:$}}catch(p){co("\u2717 File upload failed.",p)}}function rb(t){if(!/^.+\s<[^<>]+>$/.test(t))throw new Error('Invalid author format. Use "Author Name <author@email.com>"');let[r,n]=t.split("<");return{name:r.trim(),email:n.replace(">","").trim()}}function nb(t){let e={};for(let n of t)if(ar.statSync(n).isDirectory()){let o=n;Wu(o,[]).forEach(i=>r(i,o))}else r(n,Ut.dirname(n));function r(n,o){let s=Ut.relative(o,n);e[s]&&y.warn(`File ${e[s]} is overwritten by ${n}
|
|
270
270
|
`),e[s]=n}return Object.entries(e).map(([n,o])=>ob(n,o))}function ob(t,e){return{name:t,path:Ut.resolve(e)}}function Wu(t,e){let r=ar.readdirSync(t);for(let n of r){let o=Ut.join(t,n);ar.statSync(o).isDirectory()?e=Wu(o,e):e.push(o)}return e}var zu=Pt(ko(),1);import{existsSync as sb,writeFileSync as ib,readFileSync as ab,statSync as cb}from"node:fs";import{tmpdir as Ls}from"node:os";import{join as Ms}from"node:path";import*as sn from"node:process";var Fs="redocly-cli-version",po=4,lb=1e3*60*60*12,Vu=sn.env.NODE_ENV==="test"||sn.env.CI||!!sn.env.LAMBDA_TASK_ROOT||sn.env.REDOCLY_SUPPRESS_UPDATE_NOTICE==="true",Bu=()=>{if(!Vu)try{let t=ab(Ms(Ls(),Fs)).toString();pb(tt,t)&&fb(tt,t)}catch{return}},pb=(t,e)=>(0,zu.compare)(t,e)<0,ub=async t=>{let e=`http://registry.npmjs.org/${t}/latest`;try{return(await(await dn(e,{timeout:mn})).json()).version}catch{return}},Gu=()=>{!db()||Vu||ub(si).then(t=>{if(t){let e=Ms(Ls(),Fs);ib(e,t)}}).catch(()=>{})},fb=(t,e)=>{let r=[`A new version of ${de("Redocly CLI")} (${pe(e)}) is available.`,`Update now: \`${de("npm i -g @redocly/cli@latest")}\`.`,"Changelog: https://redocly.com/docs/cli/changelog/"],n=Math.max(...r.map(a=>bo(a).length)),o=ee("\u2550".repeat(n+po)),s=" ".repeat(po),i=["",s+ee("\u2554"+o+"\u2557"),s+ee("\u2551"+" ".repeat(n+po)+"\u2551"),r.map(mb(n,s)).join(`
|
|
271
271
|
`),s+ee("\u2551"+" ".repeat(n+po)+"\u2551"),s+ee("\u255A"+o+"\u255D"),"",""].join(`
|
|
272
|
-
`);y.info(i)},mb=(t,e)=>r=>{let n=" ".repeat(t-bo(r).length);return`${e}${ee("\u2551")} ${r}${n} ${ee("\u2551")}`},db=()=>{try{let t=Ms(Ls(),Fs);if(!sb(t))return!0;let e=new Date().getTime(),n=cb(t).mtime.getTime();return e-n>=lb}catch{return!1}};function Hu(t){if(!t||t==="/")throw new Error("Mount path cannot be empty or root path. Please use --mount-path option with a valid path.");return t}function Tr(t,e=!1){return r=>{let n=Number(r);if(isNaN(n)||n<=0)throw new Error(`${t} must be a positive number`);if(e&&!Number.isInteger(n))throw new Error(`${t} must be a positive integer`);return n}}import{execSync as hb}from"node:child_process";import*as Dr from"node:fs";import{existsSync as gb,writeFileSync as yb,readFileSync as bb}from"node:fs";import*as Ku from"node:os";import{tmpdir as Ju}from"node:os";import{join as Xu}from"node:path";async function Yu(t=mn){try{return await dn(ai,{timeout:t}),!0}catch{return!1}}var uo="***";async function Zu({config:t,argv:e,exit_code:r,execution_time:n,spec_version:o,spec_keyword:s,spec_full_version:i,respect_x_security_auth_types:a,respect_source_description_types:c,respect_criterion_object_types:p}){try{if(!e||!await Yu(1e3))return;let{_:[l],$0:d,...m}=e,{RedoclyOAuthClient:w}=await import("./chunks/
|
|
273
|
-
`,""),version:tt,exit_code:r,execution_time:n,metadata:process.env.REDOCLY_CLI_TELEMETRY_METADATA,environment_ci:process.env.CI,environment:process.env.REDOCLY_ENVIRONMENT,has_config:typeof t?.document?.parsed>"u"?"no":"yes",spec_version:o,spec_keyword:s,spec_full_version:i,respect_x_security_auth_types:A==="arazzo1"&&a?.length?JSON.stringify(a):void 0,respect_source_description_types:A==="arazzo1"&&c?.length?JSON.stringify(c):void 0,respect_criterion_object_types:A==="arazzo1"&&p?.length?JSON.stringify(p):void 0}],$=Ai.mapToCloudEvent({type:"com.redocly.command.ran",source:"urn:redocly:cli",origin:"redocly-cli",env:"production",osPlatform:Ku.platform(),actor:{id:C,object:"user",uri:""},category:"product",data:E}),{otelTelemetry:_}=await import("./chunks/
|
|
272
|
+
`);y.info(i)},mb=(t,e)=>r=>{let n=" ".repeat(t-bo(r).length);return`${e}${ee("\u2551")} ${r}${n} ${ee("\u2551")}`},db=()=>{try{let t=Ms(Ls(),Fs);if(!sb(t))return!0;let e=new Date().getTime(),n=cb(t).mtime.getTime();return e-n>=lb}catch{return!1}};function Hu(t){if(!t||t==="/")throw new Error("Mount path cannot be empty or root path. Please use --mount-path option with a valid path.");return t}function Tr(t,e=!1){return r=>{let n=Number(r);if(isNaN(n)||n<=0)throw new Error(`${t} must be a positive number`);if(e&&!Number.isInteger(n))throw new Error(`${t} must be a positive integer`);return n}}import{execSync as hb}from"node:child_process";import*as Dr from"node:fs";import{existsSync as gb,writeFileSync as yb,readFileSync as bb}from"node:fs";import*as Ku from"node:os";import{tmpdir as Ju}from"node:os";import{join as Xu}from"node:path";async function Yu(t=mn){try{return await dn(ai,{timeout:t}),!0}catch{return!1}}var uo="***";async function Zu({config:t,argv:e,exit_code:r,execution_time:n,spec_version:o,spec_keyword:s,spec_full_version:i,respect_x_security_auth_types:a,respect_source_description_types:c,respect_criterion_object_types:p}){try{if(!e||!await Yu(1e3))return;let{_:[l],$0:d,...m}=e,{RedoclyOAuthClient:w}=await import("./chunks/2FI7HSOA.js"),h=new w,x=ur(t,m.residency),P=await h.isAuthorized(x),C=xb();C||(C=`ann_${vi()}`,Cb(C));let A=lr(o),E=[{id:l,object:"command",uri:`urn:redocly:cli:command:${l}`,logged_in:P?"yes":"no",command:l,...Ob(m,process.argv.slice(2)),node_version:process.version,npm_version:hb("npm -v").toString().replace(`
|
|
273
|
+
`,""),version:tt,exit_code:r,execution_time:n,metadata:process.env.REDOCLY_CLI_TELEMETRY_METADATA,environment_ci:process.env.CI,environment:process.env.REDOCLY_ENVIRONMENT,has_config:typeof t?.document?.parsed>"u"?"no":"yes",spec_version:o,spec_keyword:s,spec_full_version:i,respect_x_security_auth_types:A==="arazzo1"&&a?.length?JSON.stringify(a):void 0,respect_source_description_types:A==="arazzo1"&&c?.length?JSON.stringify(c):void 0,respect_criterion_object_types:A==="arazzo1"&&p?.length?JSON.stringify(p):void 0}],$=Ai.mapToCloudEvent({type:"com.redocly.command.ran",source:"urn:redocly:cli",origin:"redocly-cli",env:"production",osPlatform:Ku.platform(),actor:{id:C,object:"user",uri:""},category:"product",data:E}),{otelTelemetry:_}=await import("./chunks/WXI7DHLT.js");_.send($)}catch{}}function Qu(t,e){for(let r of t.sourceDescriptions??[])r.type&&e.add(r.type)}function ef(t,e){for(let r of t.workflows??[]){jr(r.successActions,e),jr(r.failureActions,e);for(let n of r.steps??[])tf(n.successCriteria,e),jr(n.onSuccess,e),jr(n.onFailure,e)}jr(Object.values(t.components?.successActions??{}),e),jr(Object.values(t.components?.failureActions??{}),e)}function jr(t,e){for(let r of t??[])tf(r.criteria,e)}function tf(t,e){for(let r of t??[]){let n=Sb(r);n&&e.add(n)}}function Sb(t){let e=t.type;return typeof e=="string"?e:e?.type||(t.condition?"simple":void 0)}function rf(t,e){for(let r of t.workflows??[]){for(let n of r["x-security"]??[]){let o=n.scheme;if(o?.type){let s=o.type==="http"?o.scheme:o.type;s&&e.add(s)}}for(let n of r.steps??[])for(let o of n["x-security"]??[]){let s=o.scheme;if(s?.type){let a=s.type==="http"?s.scheme:s.type;a&&e.add(a)}let i=o.schemeName;i&&e.add(i)}}}function wb(t){return Dr.existsSync(t)&&Dr.statSync(t).isFile()}function Eb(t){return Dr.existsSync(t)&&Dr.statSync(t).isDirectory()}function ks(t){return t&&(Ys(t)?t.split("://")[0]+"://url":wb(t)?t.replace(/.+\.([^.]+)$/,(e,r)=>"file-"+r):Eb(t)?"folder":t)}function Us(t,e,r){let n=Array.isArray(e)?e:[e];for(let o of n)t=t.replaceAll(o,r);return t}function nf(t,e){let r={};for(let[n,o]of Object.entries(t))e.includes(n)?r[n]=uo:re(o)?r[n]=nf(o,e):r[n]=o;return r}function qs(t,e,r=[]){if(Array.isArray(t))return t.forEach(n=>qs(n,e,r)),r;if(re(t))for(let[n,o]of Object.entries(t))e.includes(n)&&typeof o=="string"?r.push(o):(re(o)||Array.isArray(o))&&qs(o,e,r);return r}function Ob(t,e){let r=["organization","o","input","i","clientCert","clientKey","caCert","server","S"],n=e.join(" "),o={};for(let[s,i]of Object.entries(t))if(r.includes(s))o[s]=uo,n=Us(n,i,uo);else if(typeof i=="string"){let a=ks(i);o[s]=a,n=Us(n,i,a)}else if(Array.isArray(i)){o[s]=i.map(ks);for(let a of i){let c=ks(a);n.includes(a)&&(n=n.replaceAll(a,c))}}else if(re(i)){let a=qs(i,r);for(let c of a)n=Us(n,c,uo);o[s]=nf(i,r)}else o[s]=i;return{arguments:JSON.stringify(o),raw_input:n}}var Cb=t=>{if(!(process.env.CI||!t))try{let r=Xu(Ju(),ho);yb(r,t)}catch{}},xb=()=>{if(!process.env.CI)try{let e=Xu(Ju(),ho);return gb(e)?bb(e).toString().trim():void 0}catch{return}};function ge(t){return async e=>{let r=performance.now(),n=2,o,s="unknown",i,a,c,p=new Set,u=new Set,l=new Set,d=({parsed:m,source:w})=>{if(s="unknown",i=void 0,a=void 0,w?.absoluteRef&&ti(w.absoluteRef)){s="graphql";return}try{s=ut(m)}catch{s="unsupported"}re(m)&&(i=m?.openapi?"openapi":m?.swagger?"swagger":m?.asyncapi?"asyncapi":m?.arazzo?"arazzo":m?.overlay?"overlay":void 0,i&&(a=m[i]),lr(s)==="arazzo1"&&(rf(m,p),Qu(m,u),ef(m,l)))};try{e.config&&!Ws(e.config)&&W("Please provide a valid path to the configuration file."),c=await wi(e,tt),o=c.resolvedConfig.telemetry,n=1,typeof t=="function"&&await t({argv:e,config:c,version:tt,collectSpecData:d}),n=0}catch(m){m instanceof qt||(m instanceof Ve?y.error(m.message+`
|
|
274
274
|
|
|
275
275
|
`):(y.error(`An unexpected error occurred. This is likely a bug that should be reported.
|
|
276
276
|
`),y.error(m instanceof Error?m.stack||m.message:String(m)),y.error(`
|
|
277
277
|
`)))}finally{if(process.env.REDOCLY_TELEMETRY!=="off"&&o!=="off"){let m=Math.round(performance.now()-r);await Zu({config:c,argv:e,exit_code:n,execution_time:m,spec_version:s,spec_keyword:i,spec_full_version:a,respect_x_security_auth_types:[...p],respect_source_description_types:[...u],respect_criterion_object_types:[...l]})}process.once("beforeExit",()=>{process.exit(n)})}}}of.config({path:sf.resolve(process.cwd(),"./.env")});Gu();Sl(Jo(process.argv)).version("version","Show version number.",tt).help("help","Show help.").parserConfiguration({"greedy-arrays":!1,"boolean-negation":!1}).command("stats [api]","Show statistics for an API description.",t=>t.env("REDOCLY_CLI_STATS").positional("api",{type:"string"}).option({config:{description:"Path to the config file.",type:"string"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"},format:{description:"Use a specific output format.",choices:["stylish","json","markdown"],default:"stylish"}}),t=>{ge(Mu)(t)}).command("score [api]","Score an API description for integration simplicity and agent readiness.",t=>t.env("REDOCLY_CLI_SCORE").positional("api",{type:"string"}).option({config:{description:"Path to the config file.",type:"string"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"},format:{description:"Use a specific output format.",choices:["stylish","json"],default:"stylish"},"operation-details":{description:"Print per-operation metric details.",type:"boolean",default:!1},"debug-operation-id":{description:"Print detailed schema breakdown for a specific operation.",type:"string"}}),t=>{ge(Vp)(t)}).command("split [api]","Split an API description into a multi-file structure.",t=>t.env("REDOCLY_CLI_SPLIT").positional("api",{description:"API description file that you want to split",type:"string"}).option({outDir:{description:"Output directory where files will be saved.",required:!0,type:"string"},separator:{description:"File path separator used while splitting.",required:!1,type:"string",default:"_"},config:{description:"Path to the config file.",requiresArg:!0,type:"string"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}).demandOption("api"),t=>{ge(_u)(t)}).command("join [apis...]","Join multiple API descriptions into one [experimental].",t=>t.env("REDOCLY_CLI_JOIN").positional("apis",{array:!0,type:"string",demandOption:!0}).option({"prefix-tags-with-info-prop":{description:"Prefix tags with property value from info object.",requiresArg:!0,type:"string"},"prefix-tags-with-filename":{description:"Prefix tags with property value from file name.",type:"boolean",default:!1},"prefix-components-with-info-prop":{description:"Prefix components with property value from info object.",requiresArg:!0,type:"string"},"without-x-tag-groups":{description:"Skip automated x-tagGroups creation",type:"boolean"},output:{description:"Output file.",alias:"o",type:"string"},config:{description:"Path to the config file.",requiresArg:!0,type:"string"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}),t=>{ge(Hl)(t)}).command("push-status [pushId]",!1,t=>t.env("REDOCLY_CLI_PUSH_STATUS").positional("pushId",{description:"Push id.",type:"string",demandOption:!0}).implies("max-execution-time","wait").option({organization:{description:"Name of the organization to push to.",type:"string",alias:"o",required:!0},project:{description:"Name of the project to push to.",type:"string",required:!0,alias:"p"},domain:{description:"Specify a domain.",alias:"d",type:"string",required:!1},wait:{description:"Wait for build to finish.",type:"boolean",default:!1},"max-execution-time":{description:"Maximum execution time in seconds.",type:"number"},"continue-on-deploy-failures":{description:"Command does not fail even if the deployment fails.",type:"boolean",default:!1},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}),t=>{ge(lo)(t)}).command("push [files...]","Push documents to Reunite.",t=>t.env("REDOCLY_CLI_PUSH").positional("files",{type:"string",array:!0,demandOption:!0}).option({branch:{description:"Branch name to push to.",type:"string",alias:"b",required:!0},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"},organization:{description:"Name of the organization to push to.",type:"string",alias:"o",required:!0},project:{description:"Name of the project to push to.",type:"string",alias:"p",required:!0},"mount-path":{description:"The path files should be pushed to.",type:"string",alias:"mp",required:!0,coerce:Hu},author:{description:"Author of the commit.",type:"string",alias:"a",required:!0},message:{description:"Commit message.",type:"string",alias:"m",required:!0},"commit-sha":{description:"Commit SHA.",type:"string",alias:"sha"},"commit-url":{description:"Commit URL.",type:"string",alias:"url"},namespace:{description:"Repository namespace.",type:"string"},repository:{description:"Repository name.",type:"string"},"created-at":{description:"Commit creation date.",type:"string"},domain:{description:"Specify a domain.",alias:"d",type:"string"},config:{description:"Path to the config file.",requiresArg:!0,type:"string"},"default-branch":{type:"string",default:"main"},"max-execution-time":{description:"Maximum execution time in seconds.",type:"number"},"wait-for-deployment":{description:"Wait for build to finish.",type:"boolean",default:!1},verbose:{type:"boolean",default:!1},"continue-on-deploy-failures":{description:"Command does not fail even if the deployment fails.",type:"boolean",default:!1}}),t=>{ge(qu)(t)}).command("lint [apis...]","Lint an API or Arazzo description.",t=>t.env("REDOCLY_CLI_LINT").positional("apis",{array:!0,type:"string",demandOption:!0}).option({format:{description:"Use a specific output format.",choices:["stylish","codeframe","json","checkstyle","codeclimate","summary","markdown","github-actions","junit"],default:"codeframe"},"max-problems":{requiresArg:!0,description:"Reduce output to a maximum of N problems.",type:"number",default:100},"generate-ignore-file":{description:"Generate an ignore file.",type:"boolean"},"skip-rule":{description:"Ignore certain rules.",array:!0,type:"string"},"skip-preprocessor":{description:"Ignore certain preprocessors.",array:!0,type:"string"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"},config:{description:"Path to the config file.",requiresArg:!0,type:"string"},extends:{description:"Override extends configurations (defaults or config file settings).",requiresArg:!0,array:!0,type:"string"}}),t=>{ge(ui)(t)}).command("bundle [apis...]","Bundle a multi-file API description to a single file.",t=>t.env("REDOCLY_CLI_BUNDLE").positional("apis",{array:!0,type:"string",demandOption:!0}).options({output:{type:"string",description:"Output file or folder for inline APIs.",alias:"o"},ext:{description:"Bundle file extension.",requiresArg:!0,choices:fi},"skip-preprocessor":{description:"Ignore certain preprocessors.",array:!0,type:"string"},"skip-decorator":{description:"Ignore certain decorators.",array:!0,type:"string"},dereferenced:{alias:"d",type:"boolean",description:"Produce a fully dereferenced bundle."},force:{alias:"f",type:"boolean",description:"Produce bundle output even when errors occur."},config:{description:"Path to the config file.",type:"string"},metafile:{description:"Produce metadata about the bundle",type:"string"},extends:{description:"Override extends configurations (defaults or config file settings).",requiresArg:!0,array:!0,type:"string",hidden:!0},"remove-unused-components":{description:"Remove unused components.",type:"boolean",default:!1},"keep-url-references":{description:"Keep absolute url references.",type:"boolean",alias:"k"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"},"component-renaming-conflicts-severity":{description:"Whether to show warnings or fail on renaming conflicts (defaults to warn).",choices:["warn","error","off"]},"component-names-strategy":{description:"How to name inlined Schema components: 'basename' (default) or 'title' (from each schema's `title`).",choices:["basename","title"],default:"basename"}}).check(e=>{if(e.output&&(!e.apis||e.apis.length===0))throw new Error("At least one inline API must be specified when using --output.");return!0}),t=>{ge(Ol)(t)}).command("check-config","Lint the Redocly configuration file.",async t=>t.env("REDOCLY_CLI_CHECK_CONFIG").option({config:{description:"Path to the config file.",type:"string"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error"],default:"error"}}),t=>{ge()(t)}).command("login","Log in to Redocly.",async t=>t.env("REDOCLY_CLI_LOGIN").options({residency:{description:"Residency of the application. Defaults to `us`.",alias:["r"],type:"string"},config:{description:"Path to the config file.",requiresArg:!0,type:"string"},verbose:{alias:"v",describe:"Apply verbose mode.",type:"boolean"}}),t=>{ge(wl)(t)}).command("logout","Clear your stored credentials.",t=>t,t=>{ge(El)(t)}).command("preview","Preview Redocly project using one of the product NPM packages.",t=>t.env("REDOCLY_CLI_PREVIEW").options({product:{type:"string",choices:["redoc","revel","reef","realm","redoc-revel","redoc-reef","revel-reef"],description:"Product used to launch preview. Default is inferred from project's package.json or 'realm' is used."},plan:{type:"string",choices:Yl,default:"enterprise"},port:{alias:"p",type:"number",description:"Preview port.",default:4e3,coerce:Tr("port",!0)},"project-dir":{alias:["d","source-dir"],type:"string",description:"Specifies the project content directory. The default value is the directory where the command is executed.",default:"."},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}),t=>{process.argv.some(e=>e.startsWith("--source-dir"))&&y.error(`Option --source-dir is deprecated and will be removed soon. Use --project-dir instead.
|
|
278
|
-
`),ge(Kl)(t)}).command("build-docs [api]","Produce API documentation as an HTML file",t=>t.positional("api",{type:"string"}).options({o:{describe:"Output destination file.",alias:"output",type:"string",default:"redoc-static.html"},title:{describe:"Page title.",type:"string"},disableGoogleFont:{describe:"Disable Google fonts.",type:"boolean",default:!1},t:{alias:"template",describe:"Path to handlebars page template, see https://github.com/Redocly/redocly-cli/blob/main/packages/cli/src/commands/build-docs/template.hbs for the example.",type:"string"},templateOptions:{describe:"Additional options to pass to the template. Use dot notation, e.g. templateOptions.metaDescription"},theme:{describe:"Redoc theme.openapi configuration. Use dot notation, e.g. theme.openapi.nativeScrollbars"},config:{describe:"Path to the config file.",type:"string"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}).check(e=>{if(e.theme&&!e.theme?.openapi)throw new Error("Invalid option: theme.openapi not set.");return!0}),async t=>{let{handlerBuildCommand:e}=await import("./chunks/EEGSLUAI.js");ge(e)(t)}).command("translate <locale>","Creates or updates translations.yaml files and fills them with missing built-in translations and translations from the redocly.yaml and sidebars.yaml files.",t=>t.env("REDOCLY_CLI_TRANSLATE").positional("locale",{description:"Locale code to generate translations for, or `all` for all current project locales.",type:"string",demandOption:!0}).options({"project-dir":{alias:"d",type:"string",description:"Specifies the project content directory. The default value is the directory where the command is executed.",default:"."},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}),t=>{ge(Fu)(t)}).command("eject <type> [path]","Helper function to eject project elements for customization.",t=>t.env("REDOCLY_CLI_EJECT").positional("type",{description:"Specifies what type of project element to eject. Currently this value must be `component`.",demandOption:!0,choices:["component"]}).positional("path",{description:"Filepath to a component or filepath with glob pattern.",type:"string"}).options({"project-dir":{alias:"d",type:"string",description:"Specifies the project content directory. The default value is the directory where the command is executed.",default:"."},force:{alias:"f",type:"boolean",description:'Skips the "overwrite existing" confirmation when ejecting a component that is already ejected in the destination.'},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}),t=>{ge(Al)(t)}).command("respect [files...]","Run Arazzo tests.",t=>t.env("REDOCLY_CLI_RESPECT").positional("files",{describe:"Test files or glob pattern.",type:"string",array:!0,default:[]}).options({input:{alias:"i",describe:"Input parameters.",type:"string"},server:{alias:"S",describe:"Server parameters.",type:"string"},workflow:{alias:"w",describe:"Workflow name.",type:"string",array:!0},skip:{alias:"s",describe:"Workflow to skip.",type:"string",array:!0},verbose:{alias:"v",describe:"Apply verbose mode.",type:"boolean"},"har-output":{describe:"Har file output name.",type:"string",alias:"H"},"json-output":{describe:"JSON file output name.",type:"string",alias:"J"},mtls:{describe:'Per-domain mutual TLS certificates configuration as JSON. Format: {"<domain>": {"clientCert": "<path>", "clientKey": "<path>", "caCert": "<path>"}}',type:"string",array:!0,coerce:wp},severity:{describe:"Severity of the check.",type:"string"},"max-steps":{describe:"Maximum number of steps to run (default: 2000).",type:"number",default:2e3,coerce:Tr("max-steps",!0)},"max-fetch-timeout":{describe:"Maximum time to wait for API response per request in milliseconds (default: 40 seconds).",type:"number",default:4e4,coerce:Tr("max-fetch-timeout",!1)},"execution-timeout":{describe:"Maximum time to wait for the Respect execution in milliseconds (default: 1 hour).",type:"number",default:36e5,coerce:Tr("execution-timeout",!1)},"no-secrets-masking":{describe:"Do not mask secrets in the output.",type:"boolean",default:!1}}),async t=>{ge(bp)(t)}).command("generate-arazzo <descriptionPath>","Auto-generate arazzo description file from an API description.",t=>t.env("REDOCLY_CLI_GENERATE_ARAZZO").positional("descriptionPath",{describe:"Description file path.",type:"string"}).options({"output-file":{alias:"o",describe:"Output File name.",type:"string",requiresArg:!0}}),async t=>{ge(vl)(t)}).command("generate-client [api]","Generate a TypeScript client from an OpenAPI description [experimental].",t=>t.env("REDOCLY_CLI_GENERATE_CLIENT").positional("api",{describe:"OpenAPI description file path (or alias from redocly.yaml `apis:`).",type:"string"}).options({output:{alias:"o",describe:"Output file path for the generated client (must end in .ts).",type:"string",requiresArg:!0},"server-url":{describe:"Override the server URL inlined into the generated runtime. Defaults to `servers[0].url`.",type:"string",requiresArg:!0},"output-mode":{describe:"How the client is split across files: `single` (default, one file) or `split` (schema types and guards in a sibling `<name>.schemas.ts` the entry re-exports).",choices:["single","split"],requiresArg:!0},runtime:{describe:"Runtime distribution: 'inline' (default) embeds the runtime in the generated file; 'package' imports it from @redocly/client-generator.",choices:["inline","package"],requiresArg:!0},"import-ext":{describe:"Extension in generated relative imports: 'js' (default) suits tsc and bundlers; 'ts' suits runtimes that resolve specifiers literally, like Node's built-in type stripping (node client.ts).",choices:["js","ts"],requiresArg:!0},setup:{describe:"Path to a publisher setup module (a file default-exporting { config, middleware }) that gets included into the generated client \u2014 pre-configure defaults such as the server URL, retries, headers, and middleware, so a published SDK ships with them built in. Works across all output modes.",type:"string",requiresArg:!0},"args-style":{describe:"How operation inputs are passed: `flat` (default) spreads path params as positional arguments followed by `params`/`body`/`headers`; `grouped` bundles every input into a single `args` object (the per-call request `init` stays a separate trailing argument).",choices:["flat","grouped"],requiresArg:!0},"error-mode":{describe:"Error handling: 'throw' (default) throws ApiError on non-2xx; 'result' returns { data, error, response }.",choices:["throw","result"],requiresArg:!0},"date-type":{describe:"How `date-time`/`date` string fields are typed: 'string' (default) keeps the ISO wire shape; 'Date' emits a `Date` (pair with --generator transformers so the runtime value matches).",choices:["string","Date"],requiresArg:!0},"mock-data":{describe:"How the `mock` generator produces data: 'static' (default) inlines deterministic literals (zero-dep); 'faker' emits @faker-js/faker calls for realistic data (install @faker-js/faker as a dev dependency).",choices:["static","faker"],requiresArg:!0},"mock-seed":{describe:"Seed for faker-mode mocks: emits a top-level `faker.seed(<n>)` so generated data is reproducible across runs. Ignored in static mode.",type:"number",requiresArg:!0},generator:{describe:"Generator to run; repeat the flag to run several (default: sdk). A built-in name (sdk, zod, tanstack-query, swr, transformers, mock) or a custom-generator path/package specifier. Example: --generator sdk --generator zod",type:"string",array:!0,requiresArg:!0},config:{describe:"Path to the config file.",type:"string",requiresArg:!0}}),async t=>{ge(Rl)(t)}).command("generate-spec <traffic>","Infer an OpenAPI description from recorded HTTP traffic, optionally refined with AI [experimental].",t=>t.env("REDOCLY_CLI_GENERATE_SPEC").positional("traffic",{describe:"Path to a traffic log file or folder (HAR, Kong, Nginx/Apache JSON, NDJSON).",type:"string"}).option({type:{describe:"Target API description type.",choices:["openapi"],default:"openapi"},"traffic-format":{describe:"Traffic input format.",choices:["auto","har","kong","nginx-json","apache-json","ndjson"],default:"auto"},server:{describe:"Server URL the traffic was captured against: only requests under it are considered, the rest of their URL becomes the API path, and it becomes the servers URL of the generated description.",type:"string"},title:{describe:"Title for the generated API description.",type:"string"},"with-ai":{describe:"Refine the inferred description with an AI provider to narrow the hypothesis.",type:"boolean",default:!1},"ai-provider":{describe:'AI provider used with --with-ai; runs the "claude", "codex", or "cursor" CLI in non-interactive mode.',choices:["claude","codex","cursor"],default:"claude"},"ai-model":{describe:"Model passed to the selected AI provider (provider-specific default applies).",type:"string"},"ai-concurrency":{describe:"Number of operations refined in parallel with --with-ai.",type:"number",default:4,coerce:Tr("ai-concurrency",!0)},output:{alias:"o",describe:"Write the generated description to this file instead of stdout.",type:"string"},config:{describe:"Path to the config file.",type:"string"}}),async t=>{let{handleGenerateSpec:e}=await import("./chunks/7N32H7AG.js");ge(e)(t)}).command("scorecard-classic [api]","Run quality scorecards with multiple rule levels to validate and maintain API description standards.",t=>t.positional("api",{type:"string"}).option({config:{describe:"Path to the config file.",type:"string"},"project-url":{describe:"URL to the project scorecard configuration.",type:"string"},format:{description:"Use a specific output format.",choices:["stylish","json","checkstyle","junit"],default:"stylish"},"target-level":{describe:"Target level for the scorecard.",type:"string"},verbose:{alias:"v",describe:"Apply verbose mode.",type:"boolean"}}),async t=>{ge(ru)(t)}).command("drift <traffic>","Detect drift between recorded HTTP traffic and an OpenAPI description [experimental].",t=>t.env("REDOCLY_CLI_DRIFT").positional("traffic",{describe:"Path to a traffic log file or folder (HAR, Kong, Nginx/Apache JSON, NDJSON).",type:"string"}).option({api:{describe:"OpenAPI description file or folder to validate against.",type:"string",demandOption:!0},"traffic-format":{describe:"Traffic input format.",choices:["auto","har","kong","nginx-json","apache-json","ndjson"],default:"auto"},"report-format":{describe:"Output format.",alias:"format",choices:["pretty","json","csv","sarif"],default:"pretty"},"match-mode":{describe:"Endpoint matching mode (how requests are located via the description servers). Mutually exclusive with --server.",choices:["strict-host","basepath"],defaultDescription:"strict-host"},"ignore-cookies":{describe:"Ignore cookie-based checks (useful for logs exported without cookies).",type:"boolean",default:!1},"ignore-headers":{describe:'Comma-separated header names to skip in undocumented-header checks. A trailing "*" matches by prefix, e.g. "x-consumer-*".',type:"string"},"max-findings":{describe:"Maximum findings shown in pretty output.",type:"number",default:10},"min-severity":{describe:"Discard findings below this severity from the report.",choices:["info","warning","error"],default:"info"},rules:{describe:"Comma-separated builtin rules to run.",type:"string"},output:{alias:"o",describe:"Write the drift report (in the format selected with --format) to this file instead of stdout.",type:"string"},server:{describe:"Server URL the traffic was captured against: only requests under it are considered, and the rest of their URL is treated as the API path. It replaces the description servers and the remaining path is matched against the description paths directly. Mutually exclusive with --match-mode.",type:"string"},config:{describe:"Path to the config file.",type:"string"},"lint-config":{describe:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}),async t=>{let{handleDrift:e}=await import("./chunks/4K55AJYG.js");ge(e)(t)}).command("proxy","Capture live HTTP traffic through a reverse proxy into a HAR file, optionally validating it against an OpenAPI description [experimental].",t=>t.env("REDOCLY_CLI_PROXY").option({target:{describe:"Upstream base URL to forward captured requests to.",type:"string",demandOption:!0},port:{describe:"Port the proxy listens on.",type:"number",default:4040},host:{describe:"Host the proxy binds to.",type:"string",default:"127.0.0.1"},har:{describe:"Path to the HAR file where captured traffic is written.",type:"string",demandOption:!0},api:{describe:"OpenAPI description file or folder to validate captured traffic against (live).",type:"string"},"report-format":{describe:"Output format for the validation report printed on shutdown.",alias:"format",choices:["pretty","json","csv","sarif"],default:"pretty"},"match-mode":{describe:"Endpoint matching mode.",choices:["strict-host","basepath"],default:"strict-host"},"ignore-cookies":{describe:"Ignore cookie-based checks.",type:"boolean",default:!1},"ignore-headers":{describe:'Comma-separated header names to skip in undocumented-header checks. A trailing "*" matches by prefix, e.g. "x-consumer-*".',type:"string"},"max-findings":{describe:"Maximum findings shown in pretty output.",type:"number",default:10},rules:{describe:"Comma-separated builtin rules to run.",type:"string"},config:{describe:"Path to the config file.",type:"string"},"lint-config":{describe:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}),async t=>{let{handleProxy:e}=await import("./chunks/6PRPGEML.js");ge(e)(t)}).completion("completion","Generate autocomplete script for `redocly` command.").demandCommand(1).middleware([Bu]).strict().argv;
|
|
278
|
+
`),ge(Kl)(t)}).command("build-docs [api]","Produce API documentation as an HTML file",t=>t.positional("api",{type:"string"}).options({o:{describe:"Output destination file.",alias:"output",type:"string",default:"redoc-static.html"},title:{describe:"Page title.",type:"string"},disableGoogleFont:{describe:"Disable Google fonts.",type:"boolean",default:!1},t:{alias:"template",describe:"Path to handlebars page template, see https://github.com/Redocly/redocly-cli/blob/main/packages/cli/src/commands/build-docs/template.hbs for the example.",type:"string"},templateOptions:{describe:"Additional options to pass to the template. Use dot notation, e.g. templateOptions.metaDescription"},theme:{describe:"Redoc theme.openapi configuration. Use dot notation, e.g. theme.openapi.nativeScrollbars"},config:{describe:"Path to the config file.",type:"string"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}).check(e=>{if(e.theme&&!e.theme?.openapi)throw new Error("Invalid option: theme.openapi not set.");return!0}),async t=>{let{handlerBuildCommand:e}=await import("./chunks/OJSAINVA.js");ge(e)(t)}).command("translate <locale>","Creates or updates translations.yaml files and fills them with missing built-in translations and translations from the redocly.yaml and sidebars.yaml files.",t=>t.env("REDOCLY_CLI_TRANSLATE").positional("locale",{description:"Locale code to generate translations for, or `all` for all current project locales.",type:"string",demandOption:!0}).options({"project-dir":{alias:"d",type:"string",description:"Specifies the project content directory. The default value is the directory where the command is executed.",default:"."},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}),t=>{ge(Fu)(t)}).command("eject <type> [path]","Helper function to eject project elements for customization.",t=>t.env("REDOCLY_CLI_EJECT").positional("type",{description:"Specifies what type of project element to eject. Currently this value must be `component`.",demandOption:!0,choices:["component"]}).positional("path",{description:"Filepath to a component or filepath with glob pattern.",type:"string"}).options({"project-dir":{alias:"d",type:"string",description:"Specifies the project content directory. The default value is the directory where the command is executed.",default:"."},force:{alias:"f",type:"boolean",description:'Skips the "overwrite existing" confirmation when ejecting a component that is already ejected in the destination.'},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}),t=>{ge(Al)(t)}).command("respect [files...]","Run Arazzo tests.",t=>t.env("REDOCLY_CLI_RESPECT").positional("files",{describe:"Test files or glob pattern.",type:"string",array:!0,default:[]}).options({input:{alias:"i",describe:"Input parameters.",type:"string"},server:{alias:"S",describe:"Server parameters.",type:"string"},workflow:{alias:"w",describe:"Workflow name.",type:"string",array:!0},skip:{alias:"s",describe:"Workflow to skip.",type:"string",array:!0},verbose:{alias:"v",describe:"Apply verbose mode.",type:"boolean"},"har-output":{describe:"Har file output name.",type:"string",alias:"H"},"json-output":{describe:"JSON file output name.",type:"string",alias:"J"},mtls:{describe:'Per-domain mutual TLS certificates configuration as JSON. Format: {"<domain>": {"clientCert": "<path>", "clientKey": "<path>", "caCert": "<path>"}}',type:"string",array:!0,coerce:wp},severity:{describe:"Severity of the check.",type:"string"},"max-steps":{describe:"Maximum number of steps to run (default: 2000).",type:"number",default:2e3,coerce:Tr("max-steps",!0)},"max-fetch-timeout":{describe:"Maximum time to wait for API response per request in milliseconds (default: 40 seconds).",type:"number",default:4e4,coerce:Tr("max-fetch-timeout",!1)},"execution-timeout":{describe:"Maximum time to wait for the Respect execution in milliseconds (default: 1 hour).",type:"number",default:36e5,coerce:Tr("execution-timeout",!1)},"no-secrets-masking":{describe:"Do not mask secrets in the output.",type:"boolean",default:!1}}),async t=>{ge(bp)(t)}).command("generate-arazzo <descriptionPath>","Auto-generate arazzo description file from an API description.",t=>t.env("REDOCLY_CLI_GENERATE_ARAZZO").positional("descriptionPath",{describe:"Description file path.",type:"string"}).options({"output-file":{alias:"o",describe:"Output File name.",type:"string",requiresArg:!0}}),async t=>{ge(vl)(t)}).command("generate-client [api]","Generate a TypeScript client from an OpenAPI description [experimental].",t=>t.env("REDOCLY_CLI_GENERATE_CLIENT").positional("api",{describe:"OpenAPI description file path (or alias from redocly.yaml `apis:`).",type:"string"}).options({output:{alias:"o",describe:"Output file path for the generated client (must end in .ts).",type:"string",requiresArg:!0},"server-url":{describe:"Override the server URL inlined into the generated runtime. Defaults to `servers[0].url`.",type:"string",requiresArg:!0},"output-mode":{describe:"How the client is split across files: `single` (default, one file) or `split` (schema types and guards in a sibling `<name>.schemas.ts` the entry re-exports).",choices:["single","split"],requiresArg:!0},runtime:{describe:"Runtime distribution: 'inline' (default) embeds the runtime in the generated file; 'package' imports it from @redocly/client-generator.",choices:["inline","package"],requiresArg:!0},"import-ext":{describe:"Extension in generated relative imports: 'js' (default) suits tsc and bundlers; 'ts' suits runtimes that resolve specifiers literally, like Node's built-in type stripping (node client.ts).",choices:["js","ts"],requiresArg:!0},setup:{describe:"Path to a publisher setup module (a file default-exporting { config, middleware }) that gets included into the generated client \u2014 pre-configure defaults such as the server URL, retries, headers, and middleware, so a published SDK ships with them built in. Works across all output modes.",type:"string",requiresArg:!0},"args-style":{describe:"How operation inputs are passed: `flat` (default) spreads path params as positional arguments followed by `params`/`body`/`headers`; `grouped` bundles every input into a single `args` object (the per-call request `init` stays a separate trailing argument).",choices:["flat","grouped"],requiresArg:!0},"error-mode":{describe:"Error handling: 'throw' (default) throws ApiError on non-2xx; 'result' returns { data, error, response }.",choices:["throw","result"],requiresArg:!0},"date-type":{describe:"How `date-time`/`date` string fields are typed: 'string' (default) keeps the ISO wire shape; 'Date' emits a `Date` (pair with --generator transformers so the runtime value matches).",choices:["string","Date"],requiresArg:!0},"mock-data":{describe:"How the `mock` generator produces data: 'static' (default) inlines deterministic literals (zero-dep); 'faker' emits @faker-js/faker calls for realistic data (install @faker-js/faker as a dev dependency).",choices:["static","faker"],requiresArg:!0},"mock-seed":{describe:"Seed for faker-mode mocks: emits a top-level `faker.seed(<n>)` so generated data is reproducible across runs. Ignored in static mode.",type:"number",requiresArg:!0},generator:{describe:"Generator to run; repeat the flag to run several (default: sdk). A built-in name (sdk, zod, tanstack-query, swr, transformers, mock) or a custom-generator path/package specifier. Example: --generator sdk --generator zod",type:"string",array:!0,requiresArg:!0},config:{describe:"Path to the config file.",type:"string",requiresArg:!0}}),async t=>{ge(Rl)(t)}).command("generate-spec <traffic>","Infer an OpenAPI description from recorded HTTP traffic, optionally refined with AI [experimental].",t=>t.env("REDOCLY_CLI_GENERATE_SPEC").positional("traffic",{describe:"Path to a traffic log file or folder (HAR, Kong, Nginx/Apache JSON, NDJSON).",type:"string"}).option({type:{describe:"Target API description type.",choices:["openapi"],default:"openapi"},"traffic-format":{describe:"Traffic input format.",choices:["auto","har","kong","nginx-json","apache-json","ndjson"],default:"auto"},server:{describe:"Server URL the traffic was captured against: only requests under it are considered, the rest of their URL becomes the API path, and it becomes the servers URL of the generated description.",type:"string"},title:{describe:"Title for the generated API description.",type:"string"},"with-ai":{describe:"Refine the inferred description with an AI provider to narrow the hypothesis.",type:"boolean",default:!1},"ai-provider":{describe:'AI provider used with --with-ai; runs the "claude", "codex", or "cursor" CLI in non-interactive mode.',choices:["claude","codex","cursor"],default:"claude"},"ai-model":{describe:"Model passed to the selected AI provider (provider-specific default applies).",type:"string"},"ai-concurrency":{describe:"Number of operations refined in parallel with --with-ai.",type:"number",default:4,coerce:Tr("ai-concurrency",!0)},output:{alias:"o",describe:"Write the generated description to this file instead of stdout.",type:"string"},config:{describe:"Path to the config file.",type:"string"}}),async t=>{let{handleGenerateSpec:e}=await import("./chunks/CHEI2COC.js");ge(e)(t)}).command("scorecard-classic [api]","Run quality scorecards with multiple rule levels to validate and maintain API description standards.",t=>t.positional("api",{type:"string"}).option({config:{describe:"Path to the config file.",type:"string"},"project-url":{describe:"URL to the project scorecard configuration.",type:"string"},format:{description:"Use a specific output format.",choices:["stylish","json","checkstyle","junit"],default:"stylish"},"target-level":{describe:"Target level for the scorecard.",type:"string"},verbose:{alias:"v",describe:"Apply verbose mode.",type:"boolean"}}),async t=>{ge(ru)(t)}).command("drift <traffic>","Detect drift between recorded HTTP traffic and an OpenAPI description [experimental].",t=>t.env("REDOCLY_CLI_DRIFT").positional("traffic",{describe:"Path to a traffic log file or folder (HAR, Kong, Nginx/Apache JSON, NDJSON).",type:"string"}).option({api:{describe:"OpenAPI description file or folder to validate against.",type:"string",demandOption:!0},"traffic-format":{describe:"Traffic input format.",choices:["auto","har","kong","nginx-json","apache-json","ndjson"],default:"auto"},"report-format":{describe:"Output format.",alias:"format",choices:["pretty","json","csv","sarif"],default:"pretty"},"match-mode":{describe:"Endpoint matching mode (how requests are located via the description servers). Mutually exclusive with --server.",choices:["strict-host","basepath"],defaultDescription:"strict-host"},"ignore-cookies":{describe:"Ignore cookie-based checks (useful for logs exported without cookies).",type:"boolean",default:!1},"ignore-headers":{describe:'Comma-separated header names to skip in undocumented-header checks. A trailing "*" matches by prefix, e.g. "x-consumer-*".',type:"string"},"max-findings":{describe:"Maximum findings shown in pretty output.",type:"number",default:10},"min-severity":{describe:"Discard findings below this severity from the report.",choices:["info","warning","error"],default:"info"},rules:{describe:"Comma-separated builtin rules to run.",type:"string"},output:{alias:"o",describe:"Write the drift report (in the format selected with --format) to this file instead of stdout.",type:"string"},server:{describe:"Server URL the traffic was captured against: only requests under it are considered, and the rest of their URL is treated as the API path. It replaces the description servers and the remaining path is matched against the description paths directly. Mutually exclusive with --match-mode.",type:"string"},config:{describe:"Path to the config file.",type:"string"},"lint-config":{describe:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}),async t=>{let{handleDrift:e}=await import("./chunks/7COMRSUB.js");ge(e)(t)}).command("proxy","Capture live HTTP traffic through a reverse proxy into a HAR file, optionally validating it against an OpenAPI description [experimental].",t=>t.env("REDOCLY_CLI_PROXY").option({target:{describe:"Upstream base URL to forward captured requests to.",type:"string",demandOption:!0},port:{describe:"Port the proxy listens on.",type:"number",default:4040},host:{describe:"Host the proxy binds to.",type:"string",default:"127.0.0.1"},har:{describe:"Path to the HAR file where captured traffic is written.",type:"string",demandOption:!0},api:{describe:"OpenAPI description file or folder to validate captured traffic against (live).",type:"string"},"report-format":{describe:"Output format for the validation report printed on shutdown.",alias:"format",choices:["pretty","json","csv","sarif"],default:"pretty"},"match-mode":{describe:"Endpoint matching mode.",choices:["strict-host","basepath"],default:"strict-host"},"ignore-cookies":{describe:"Ignore cookie-based checks.",type:"boolean",default:!1},"ignore-headers":{describe:'Comma-separated header names to skip in undocumented-header checks. A trailing "*" matches by prefix, e.g. "x-consumer-*".',type:"string"},"max-findings":{describe:"Maximum findings shown in pretty output.",type:"number",default:10},rules:{describe:"Comma-separated builtin rules to run.",type:"string"},config:{describe:"Path to the config file.",type:"string"},"lint-config":{describe:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}),async t=>{let{handleProxy:e}=await import("./chunks/HRN4XSXF.js");ge(e)(t)}).completion("completion","Generate autocomplete script for `redocly` command.").demandCommand(1).middleware([Bu]).strict().argv;
|
|
279
279
|
/*! Bundled license information:
|
|
280
280
|
|
|
281
281
|
cookie/index.js:
|