@redocly/cli 2.45.0 → 2.46.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,7 +4,7 @@ Third-party software bundled in @redocly/cli
4
4
  (MPL-2.0 OR Apache-2.0)
5
5
 
6
6
  Packages:
7
- dompurify@3.4.12 — copyright owner or entity authorized by
7
+ dompurify@3.4.13 — copyright owner or entity authorized by
8
8
 
9
9
  License text:
10
10
 
@@ -650,7 +650,7 @@ Packages:
650
650
  @redocly/cli-otel@0.3.5 — Copyright 2025 Redocly Inc, all rights reserved.
651
651
  @redocly/config@0.22.0 — Copyright 2024 Redocly Inc.
652
652
  @redocly/config@0.53.1 — Copyright 2024 Redocly Inc.
653
- @redocly/openapi-core@1.34.18
653
+ @redocly/openapi-core@1.34.19
654
654
  agent-base@7.1.4 — Copyright (c) 2013 Nathan Rajlich <nathan@tootallnate.net>
655
655
  ajv-formats@3.0.1 — Copyright (c) 2020 Evgeny Poberezkin
656
656
  ajv@8.20.0 — Copyright (c) 2015-2021 Evgeny Poberezkin
@@ -678,7 +678,7 @@ Packages:
678
678
  https-proxy-agent@7.0.6 — Copyright (c) 2013 Nathan Rajlich <nathan@tootallnate.net>
679
679
  js-levenshtein@1.1.6 — Copyright (c) 2017 Gustaf Andersson
680
680
  js-tokens@4.0.0 — Copyright (c) 2014, 2015, 2016, 2017, 2018 Simon Lydell
681
- js-yaml@4.3.0 — Copyright (C) 2011-2015 by Vitaly Puzrin
681
+ js-yaml@4.3.1 — Copyright (C) 2011-2015 by Vitaly Puzrin
682
682
  js-yaml@5.2.2 — Copyright (C) 2011-2015 by Vitaly Puzrin
683
683
  json-pointer@0.6.2 — Copyright (c) 2016 Manuel Stofer
684
684
  json-schema-traverse@1.0.0 — Copyright (c) 2017 Evgeny Poberezkin
package/bin/cli.js CHANGED
@@ -1,3 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import '../lib/index.js';
3
+ import nodeModule from 'node:module';
4
+
5
+ // Reusing V8's on-disk code cache cuts about 40ms off startup. Available from Node 22.8.
6
+ nodeModule.enableCompileCache?.();
7
+
8
+ // Imported dynamically so the cache is enabled before the bundle is compiled.
9
+ await import('../lib/index.js');
@@ -5,4 +5,4 @@ const require = __createRequire(import.meta.url);
5
5
  var __filename = __fileURLToPath(import.meta.url);
6
6
  var __dirname = __pathDirname(__filename);
7
7
  import{a as fe}from"./WZXA5XPB.js";import"./RFWIIJFG.js";function ce(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 c=await V(a);d.in==="header"?o[d.name]=c:d.in==="query"?r[d.name]=c:s.push(`${d.name}=${encodeURIComponent(c)}`)}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 P(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 _(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:c,timeout:f,idempotencyKey:u,...i}=o,l={...e.retry,...c},p=f??e.timeout,m=u??e.idempotencyKey,E=typeof e.headers=="function"?await e.headers():e.headers,A={Accept:a,...E,...D(i.headers)},B=(i.method??"GET").toUpperCase();m!==void 0&&m!==!1&&(B==="POST"||B==="PATCH")&&!("Idempotency-Key"in A)&&!("idempotency-key"in A)&&(A["Idempotency-Key"]=typeof m=="string"?m:typeof m=="function"?m():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 y={url:n,method:i.method??"GET",headers:A,body:r,operation:t},T=_(e);for(let h of T)h.onRequest&&await h.onRequest(y);let R;if(y.body!==void 0){let h=y.body,w=h instanceof Blob||h instanceof ArrayBuffer||ArrayBuffer.isView(h),g=typeof FormData<"u"&&h instanceof FormData,L=h instanceof URLSearchParams;if(g||L||w||typeof h=="string")R=h;else if(s?.multipart===!0){if(!d.serializeMultipart)throw new Error("Multipart capability not wired: cannot serialize the request body");R=d.serializeMultipart(h)}else R=JSON.stringify(h),!("Content-Type"in y.headers)&&!("content-type"in y.headers)&&(y.headers["Content-Type"]=s?.contentType??"application/json")}let q=e.fetch??fetch,v=1+(l.retries??0),C=l.retryOn??U,x=i.signal??void 0,b=0;for(;;){if(b++,x?.aborted)throw j(x);let h=p?x?AbortSignal.any([x,AbortSignal.timeout(p)]):AbortSignal.timeout(p):x,w;try{w=await q(y.url,{...i,signal:h,method:y.method,headers:y.headers,body:R})}catch(g){if(b<v&&!x?.aborted&&await C({attempt:b,request:y,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=T.length-1;g>=0;g--){let L=T[g].onResponse;if(L){let H=await L(w,y);H&&H!==w&&(await w.body?.cancel().catch(()=>{}),w=H)}}if(!w.ok&&b<v&&!x?.aborted&&await C({attempt:b,request:y,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:y}}}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[f,u]of Object.entries(n)){if(u==null)continue;let i=o?.[f];if(!i){if(Array.isArray(u))for(let l of u)l!=null&&d.append(f,String(l));else if(Object(u)===u)for(let[l,p]of Object.entries(u))p!=null&&d.append(`${f}[${l}]`,String(p));else d.append(f,String(u));continue}if(Array.isArray(u)){let l=u.filter(p=>p!=null).map(String);if(i.style==="form"&&i.explode)for(let p of l)i.allowReserved?a.push(`${f}=${M(p)}`):d.append(f,p);else{let p=i.style==="pipeDelimited"?"|":i.style==="spaceDelimited"?"%20":",",m=i.allowReserved?M:encodeURIComponent;a.push(`${encodeURIComponent(f)}=${l.map(m).join(p)}`)}}else if(Object(u)===u)for(let[l,p]of Object.entries(u))p!=null&&(i.allowReserved?a.push(`${f}[${l}]=${M(String(p))}`):d.append(`${f}[${l}]`,String(p)));else i.allowReserved?a.push(`${f}=${M(String(u))}`):d.append(f,String(u))}let c=[d.toString(),...a].filter(Boolean).join("&");return c?`${s}?${c}`: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 J(e,t,n,o,r){let{path:s,query:d,body:a,headers:c,cookies:f}=he(t,n),u=t.security?.length&&r.resolveAuth?await r.resolveAuth(t.security,e):{headers:{},query:{}},i=Object.entries(f??{}).filter(([,E])=>E!=null).map(([E,A])=>`${E}=${encodeURIComponent(String(A))}`);i.length>0&&(u.headers.Cookie=[u.headers.Cookie,...i].filter(Boolean).join("; "));let l={...d,...u.query},p=Y(e.serverUrl??"",X(t.path,s),Object.keys(l).length>0?l:void 0,we(t)),m={...o,method:t.method.toUpperCase(),headers:{...u.headers,...be(c),...D(o.headers)}};return{url:p,init:m,body:a}}function xe(e,t){if(e!==null){if(t==="number"){if(e.trim()==="")return;let n=Number(e);return Number.isFinite(n)?n:void 0}if(t==="boolean"){let n=e.trim().toLowerCase();return n==="true"?!0:n==="false"?!1:void 0}return e}}function ge(e,t){let n={};for(let o of t??[]){let r=xe(e.headers.get(o.name),o.type);r!==void 0&&(n[o.key]=r)}return n}async function Ee(e,t,n,o,r){let s=await J(e,t,n,o,r),d={id:t.id,path:t.path,tags:[...t.tags??[]]},{parseAs:a,envelope:c,...f}=s.init,u=a??re(t),{response:i,context:l}=await I(e,d,s.url,f,s.body,t.body,r,te(u));if(e.errorMode==="result")return i.ok?{data:await P(i,u),error:void 0,response:i}:{data:void 0,error:await k(i),response:i};if(!i.ok){let m=new S(l.url,i.status,i.statusText,await k(i));for(let E of _(e))E.onError&&(m=await E.onError(m,l));throw m}let p=await P(i,u);return c===!0?{data:p,headers:ge(i,t.responseHeaders),response:i}:p}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){let n=(o,r)=>{if(!r||r.envelope===void 0)return e(o,r);let{envelope:s,...d}=r;return e(o,d)};return t.errorMode!=="result"?n:async(o,r)=>{let s=await n(o,r);if(!s.response.ok){let{response:d}=s;throw new S(d.url,d.status,d.statusText,s.error)}return s.data}}function ee(e,t,n){return async(o={},r={})=>{let s=await J(e,t,o,r,n),{parseAs:d,envelope:a,...c}=s.init,f=d??re(t),u={id:t.id,path:t.path,tags:[...t.tags??[]]},{response:i}=await I(e,u,s.url,c,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 P(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 c=(f={},u={})=>{if(!n.sse)throw new Error(`SSE capability not wired: cannot stream operation "${a.id}"`);let i=n.sse;return(async function*(){let l={id:a.id,path:a.path,tags:[...a.tags??[]]};yield*i(r,l,async()=>{let m=await J(r,a,f,u,n);return{url:m.url,init:m.init,body:m.body}},a.sseDataKind??"text")})()};Object.defineProperty(c,"name",{value:d}),Object.defineProperty(c,"operationId",{value:a.id}),s[d]=c}else{let c=(u={},i={})=>Ee(r,a,u,i,n);Object.defineProperty(c,"name",{value:d}),Object.defineProperty(c,"operationId",{value:a.id});let f=a.pagination;s[d]=f===void 0?c:f.style==="link"?Object.assign(c,{pages:(u,i)=>F(n,a).pagesByLink(ee(r,a,n),u,i),items:(u,i)=>F(n,a).itemsByLink(ee(r,a,n),f,u,i)}):Object.assign(c,{pages:(u,i)=>F(n,a).pages(Z(c,r),f,u,i),items:(u,i)=>F(n,a).items(Z(c,r),f,u,i)})}return s.configure=d=>{let{errorMode:a,auth:c,...f}=d;Object.assign(r,f),c&&(r.auth={...r.auth,...c,...c.apiKey?{apiKey:{...r.auth?.apiKey,...c.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),c;for(;;){let f=await e({...n,params:{...n.params,[t.param]:a}},o),u=N(f,t.items),i=Array.isArray(u)?JSON.stringify(u):void 0;if(i!==void 0&&i===c)throw new Error("Pagination did not advance: the operation returned the same page twice");if(yield f,!Array.isArray(u)||u.length===0)return;c=i,a+=t.style==="page"?1:u.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 ve(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 c=ve(d);if(c===void 0)return;let f=new URL(a,"http://relative.invalid"),u=new URL(c,f).toString();if(u===r||u===f.toString())throw new Error('Pagination did not advance: the Link rel="next" target repeats');r=u;let i={};for(let[l,p]of new URL(u).searchParams){let m=i[l];m===void 0?i[l]=p:Array.isArray(m)?m.push(p):i[l]=[m,p]}o={...t.params,...i}}}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 Se=/(?:\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:c,body:f}=await n(),{reconnect:u=!0,reconnectDelay:i,...l}=c,p=l.signal??void 0;if(p?.aborted)return;let m={Accept:"text/event-stream",...D(l.headers)},E=r===void 0?m:{...m,"Last-Event-ID":r};try{let{response:y}=await I(e,t,a,{...l,method:l.method??"GET",headers:E,timeout:0},f,void 0,{});if(!y.ok){let C=await k(y);throw new S(a,y.status,y.statusText,C)}d=0;let T=y.body;if(!T)return;let R=T.getReader(),q=new TextDecoder,v="";try{for(;;){let{done:C,value:x}=await R.read();v+=C?q.decode():q.decode(x,{stream:!0});let b;for(;(b=Se.exec(v))!==null;){let h=v.slice(0,b.index);v=v.slice(b.index+b[0].length);let w=se(h,o);w&&(w.id!==void 0&&(r=w.id),w.retry!==void 0&&(s=w.retry),yield w)}if(C){let h=v.length>0?se(v,o):void 0;h&&(h.id!==void 0&&(r=h.id),h.retry!==void 0&&(s=h.retry),yield h);return}if(v.length>1048576)throw new K("SSE frame exceeded 1048576 characters without a delimiter")}}finally{await R.cancel().catch(()=>{})}}catch(y){if(p?.aborted)return;if(y instanceof S||y instanceof K||!u)throw y}d++;let B=Math.min((s??i??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 f of e.split(/\r\n|\n|\r/)){if(f===""||f.startsWith(":"))continue;let u=f.indexOf(":"),i=u===-1?f:f.slice(0,u),l=u===-1?"":f.slice(u+1);l.startsWith(" ")&&(l=l.slice(1)),d=!0,i==="event"?n=l:i==="data"?o.push(l):i==="id"?r=l:i==="retry"&&/^\d+$/.test(l)&&(s=Number(l))}if(!d)return;let a=o.join(`
8
- `),c=a;if(t==="json"&&a!=="")try{c=JSON.parse(a)}catch(f){throw new K(`Failed to parse SSE event data as JSON: ${f instanceof Error?f.message:String(f)}`)}return{event:n,data:c,id:r,retry:s}}function ue(e,t={}){return{...e?.config,...t,middleware:[...e?.middleware??[],...t.middleware??[]]}}function Ae(e,t){return ne(e,t,{serializeMultipart:oe,resolveAuth:Q,sse:de,paginate:{pages:G,items:ie,pagesByLink:W,itemsByLink:ae}})}function Re(e,t){let n={...e};for(let[o,r]of Object.entries(t))r!==void 0&&(n[o]=r);return n}function it(e){return e}async function st(e){return(await import("./3OW7APQC.js")).generateClient(e)}export{S as ApiError,fe as NotSupportedError,O as TimeoutError,Ae as createClient,U as defaultRetryOn,ce as defineClientSetup,it as defineGenerator,st as generateClient,Re as mergeConfig,ue as mergeSetup};
8
+ `),c=a;if(t==="json"&&a!=="")try{c=JSON.parse(a)}catch(f){throw new K(`Failed to parse SSE event data as JSON: ${f instanceof Error?f.message:String(f)}`)}return{event:n,data:c,id:r,retry:s}}function ue(e,t={}){return{...e?.config,...t,middleware:[...e?.middleware??[],...t.middleware??[]]}}function Ae(e,t){return ne(e,t,{serializeMultipart:oe,resolveAuth:Q,sse:de,paginate:{pages:G,items:ie,pagesByLink:W,itemsByLink:ae}})}function Re(e,t){let n={...e};for(let[o,r]of Object.entries(t))r!==void 0&&(n[o]=r);return n}function it(e){return e}async function st(e){return(await import("./KOGLVETP.js")).generateClient(e)}export{S as ApiError,fe as NotSupportedError,O as TimeoutError,Ae as createClient,U as defaultRetryOn,ce as defineClientSetup,it as defineGenerator,st as generateClient,Re as mergeConfig,ue as mergeSetup};
@@ -4,7 +4,7 @@ import { dirname as __pathDirname } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  var __filename = __fileURLToPath(import.meta.url);
6
6
  var __dirname = __pathDirname(__filename);
7
- import{a as x}from"./NM5PRB4J.js";import{a as v,b as y,c as R,d as u}from"./ZXRXP4OZ.js";import{c as f,d as w}from"./FDWT2URT.js";import{a as g,b as m}from"./IMOI6ZFO.js";import{O as a}from"./SSUYHPMB.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";import{mkdir as A,writeFile as C}from"node:fs/promises";import S from"node:path";async function F(e){let i=await w(e.trafficPath);if(i.length===0)throw new Error("No traffic files found in the provided traffic path.");let t=y.create({openApiIndex:e.openApiIndex,matchMode:e.matchMode,ignoreCookies:e.ignoreCookies,ignoreHeaders:e.ignoreHeaders,previewFindingsLimit:e.previewFindingsLimit,activeRules:e.activeRules,server:e.server,minSeverity:e.minSeverity}),r=0,o=0;for(let n of i){let s=await x(n,e.format);if(!s){a.warn(`Skipping traffic file with unrecognized format: ${n}
7
+ import{a as x}from"./GCKQFE6S.js";import{a as v,b as y,c as R,d as u}from"./S4YMP7WS.js";import{c as f,d as w}from"./LLREHKJO.js";import{a as g,b as m}from"./7KOLBOQ5.js";import{O as a}from"./CN6PFMVJ.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";import{mkdir as A,writeFile as C}from"node:fs/promises";import S from"node:path";async function F(e){let i=await w(e.trafficPath);if(i.length===0)throw new Error("No traffic files found in the provided traffic path.");let t=y.create({openApiIndex:e.openApiIndex,matchMode:e.matchMode,ignoreCookies:e.ignoreCookies,ignoreHeaders:e.ignoreHeaders,previewFindingsLimit:e.previewFindingsLimit,activeRules:e.activeRules,server:e.server,minSeverity:e.minSeverity}),r=0,o=0;for(let n of i){let s=await x(n,e.format);if(!s){a.warn(`Skipping traffic file with unrecognized format: ${n}
8
8
  `);continue}r+=1;for await(let c of s.parse(n))await t.process({...c,index:o}),o+=1}if(r===0)throw new Error("No supported traffic files found. In auto mode, files must match built-in traffic parser signatures.");if(o===0)throw new Error("No HTTP exchanges were parsed from the provided traffic files.");return t.finalize()}var E=!!process.stdout.isTTY&&process.env.NO_COLOR===void 0;function T(e){let i=new Set;for(let t of e.operationsByMethod.values())for(let r of t)for(let o of r.servers)i.add(o.rawUrl);return Array.from(i).sort()}function I(e,i,t){let r=e.totalExchanges-e.skippedExchanges;if(r===0&&e.skippedExchanges>0){a.warn(`All ${e.skippedExchanges} exchange(s) were outside the --server "${t}" and were skipped. Check that the server matches the traffic URLs.
9
9
  `);return}if(e.documentedExchanges>0||r===0)return;let o=T(i),n=t?`Check that the --server "${t}" matches the traffic URLs and that the description paths align with the remainder.`:e.hostCompatibleExchanges===r?`The traffic hosts are compatible with the description servers (${o.join(", ")}), so the endpoints are likely undocumented; if they should be documented, check that the description base paths and paths align with the traffic URLs, or use --server to declare the server the traffic was captured against.`:`Check that the traffic host and base path match the description servers (${o.join(", ")}), or use --server to declare the server the traffic was captured against.`;a.warn(`None of the ${r} validated exchange(s) matched a documented operation. ${n}
10
10
  `)}async function $(e,i){let t=f(e);await A(S.dirname(t),{recursive:!0}),await C(t,i,"utf8")}async function q({argv:e,config:i}){let t=f(e.traffic),r=e["traffic-format"],o=e.rules?u(e.rules):void 0,n=e["ignore-headers"]?u(e["ignore-headers"]):void 0,s=e.server;if(s&&e["match-mode"])return m("The --server and --match-mode options are mutually exclusive: --match-mode controls how requests are located via the description servers, while --server replaces the description servers with the one the traffic was captured against.");let c=e["match-mode"]??"strict-host",d=f(e.api),p=await R(d,i);if(p.loadedOperations===0)return m(`No OpenAPI operations were loaded from: ${d}`);let{runId:k,summary:h,findings:O}=await F({trafficPath:t,format:r,matchMode:c,ignoreCookies:e["ignore-cookies"],ignoreHeaders:n,previewFindingsLimit:e["max-findings"],activeRules:o,openApiIndex:p,server:s,minSeverity:e["min-severity"]});I(h,p,s);let l=v({runId:k,summary:h,findings:O,meta:{specSource:d,trafficPath:t,format:r,matchMode:c,server:s}},{format:e["report-format"],color:E&&e["report-format"]==="pretty"&&!e.output,maxFindings:e["max-findings"]});if(e.output?(await $(e.output,l),a.info(`Drift report written to: ${f(e.output)}
@@ -4,4 +4,4 @@ import { dirname as __pathDirname } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  var __filename = __fileURLToPath(import.meta.url);
6
6
  var __dirname = __pathDirname(__filename);
7
- import{la as e}from"./SSUYHPMB.js";var t=class extends Error{};function o(r){throw new e(r)}export{t as a,o as b};
7
+ import{la as e}from"./CN6PFMVJ.js";var t=class extends Error{};function o(r){throw new e(r)}export{t as a,o as b};
@@ -4,7 +4,7 @@ import { dirname as __pathDirname } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  var __filename = __fileURLToPath(import.meta.url);
6
6
  var __dirname = __pathDirname(__filename);
7
- import{a as T,b as O,c as A,d as E}from"./ZXRXP4OZ.js";import{c as m,k as C,r as $}from"./FDWT2URT.js";import{a as R,b as y}from"./IMOI6ZFO.js";import{a as q}from"./BXI4SF2U.js";import{O as u,c as H}from"./SSUYHPMB.js";import"./NEWT5A6S.js";import{e as z}from"./RFWIIJFG.js";import{createReadStream as F,createWriteStream as k,existsSync as V}from"node:fs";import{appendFile as N,mkdir as j,rm as _,writeFile as W}from"node:fs/promises";import B from"node:path";import{createInterface as G}from"node:readline";var w=class{outputPath;entriesPath;creatorVersion;writeChain=Promise.resolve();directoryEnsured=!1;started=!1;count=0;constructor(t,r){this.outputPath=B.resolve(process.cwd(),t),this.entriesPath=`${this.outputPath}.entries.tmp`,this.creatorVersion=r}get entryCount(){return this.count}add(t){let r=`${JSON.stringify(t)}
7
+ import{a as T,b as O,c as A,d as E}from"./S4YMP7WS.js";import{c as m,k as C,r as $}from"./LLREHKJO.js";import{a as R,b as y}from"./7KOLBOQ5.js";import{a as q}from"./BXI4SF2U.js";import{O as u,c as H}from"./CN6PFMVJ.js";import"./NEWT5A6S.js";import{e as z}from"./RFWIIJFG.js";import{createReadStream as F,createWriteStream as k,existsSync as V}from"node:fs";import{appendFile as N,mkdir as j,rm as _,writeFile as W}from"node:fs/promises";import B from"node:path";import{createInterface as G}from"node:readline";var w=class{outputPath;entriesPath;creatorVersion;writeChain=Promise.resolve();directoryEnsured=!1;started=!1;count=0;constructor(t,r){this.outputPath=B.resolve(process.cwd(),t),this.entriesPath=`${this.outputPath}.entries.tmp`,this.creatorVersion=r}get entryCount(){return this.count}add(t){let r=`${JSON.stringify(t)}
8
8
  `,n=this.writeChain.catch(()=>{}).then(()=>this.append(r)).then(()=>{this.count+=1});return this.writeChain=n.catch(()=>{}),n}async finalize(){await this.writeChain.catch(()=>{}),await this.ensureDirectory(),await this.writeDocument(),await _(this.entriesPath,{force:!0})}async append(t){if(await this.ensureDirectory(),!this.started){await W(this.entriesPath,t,"utf8"),this.started=!0;return}await N(this.entriesPath,t,"utf8")}async ensureDirectory(){this.directoryEnsured||(await j(B.dirname(this.outputPath),{recursive:!0}),this.directoryEnsured=!0)}async writeDocument(){let t=k(this.outputPath,{encoding:"utf8"}),r=n=>new Promise((o,s)=>{t.write(n,i=>i?s(i):o())});try{let n=JSON.stringify({name:"redocly-cli proxy",version:this.creatorVersion});await r(`{
9
9
  "log": {
10
10
  "version": "1.2",
@@ -4,4 +4,4 @@ import { dirname as __pathDirname } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  var __filename = __fileURLToPath(import.meta.url);
6
6
  var __dirname = __pathDirname(__filename);
7
- var e={name:"@redocly/cli",version:"2.45.0",description:"",license:"MIT",bin:{redocly:"bin/cli.js",openapi:"bin/cli.js"},type:"module",engines:{node:">=22.12.0 || >=20.19.0 <21.0.0",npm:">=10"},engineStrict:!0,scripts:{build:"node ./scripts/build.mjs","prepare:publish-dir":"node ./scripts/prepare-publish-dir.mjs","clean:publish-dir":`node -e "require('fs').rmSync('.publish', {recursive:true, force:true})"`},publishConfig:{directory:".publish"},repository:{type:"git",url:"https://github.com/Redocly/redocly-cli.git"},homepage:"https://github.com/Redocly/redocly-cli",keywords:["linter","OpenAPI","Swagger","OpenAPI linter","Swagger linter","AsyncAPI linter","Arazzo linter","oas"],contributors:["Roman Hotsiy <roman@redocly.com> (https://redocly.com/)"],devDependencies:{"@opentelemetry/exporter-trace-otlp-http":"0.219.0","@opentelemetry/resources":"2.8.0","@opentelemetry/sdk-trace-node":"2.8.0","@opentelemetry/semantic-conventions":"1.41.1","@redocly/cli-otel":"0.3.5","@redocly/client-generator":"0.3.3","@redocly/openapi-core":"2.45.0","@redocly/respect-core":"2.45.0","@types/cookie":"0.6.0","@types/har-format":"^1.2.16","@types/react":"^17.0.0 || ^18.2.21 || ^19.2.16","@types/react-dom":"^17.0.0 || ^18.2.7 || ^19.2.3","@types/semver":"^7.5.0","@types/set-cookie-parser":"2.4.10","@types/yargs":"17.0.32",colorette:"^1.2.0",cookie:"^0.7.2",dotenv:"16.4.7",esbuild:"^0.28.0",glob:"^13.0.5",handlebars:"^4.7.9","https-proxy-agent":"^7.0.5",react:"^17.0.0 || ^18.2.0 || ^19.2.7","react-dom":"^17.0.0 || ^18.2.0 || ^19.2.7",redoc:"2.5.3",semver:"^7.5.2","set-cookie-parser":"^2.3.5","styled-components":"6.4.2",typescript:"6.0.2",ulid:"^3.0.1",undici:"^6.28.0",yargs:"17.0.1"}};var{version:s,name:i,engines:c}=e,n=e.devDependencies.redoc,p="sha384-xiEssMQFSpSfLbzRZCGfxxIM5QDb2DTrU6vyoZdp2sV1L6pmOMy6MpTtUoLbpC96";export{s as a,i as b,c,n as d,p as e};
7
+ var e={name:"@redocly/cli",version:"2.46.1",description:"",license:"MIT",bin:{redocly:"bin/cli.js",openapi:"bin/cli.js"},type:"module",engines:{node:">=22.12.0 || >=20.19.0 <21.0.0",npm:">=10"},engineStrict:!0,scripts:{build:"node ./scripts/build.mjs","prepare:publish-dir":"node ./scripts/prepare-publish-dir.mjs","clean:publish-dir":`node -e "require('fs').rmSync('.publish', {recursive:true, force:true})"`},publishConfig:{directory:".publish"},repository:{type:"git",url:"https://github.com/Redocly/redocly-cli.git"},homepage:"https://github.com/Redocly/redocly-cli",keywords:["linter","OpenAPI","Swagger","OpenAPI linter","Swagger linter","AsyncAPI linter","Arazzo linter","oas"],contributors:["Roman Hotsiy <roman@redocly.com> (https://redocly.com/)"],devDependencies:{"@opentelemetry/exporter-trace-otlp-http":"0.219.0","@opentelemetry/resources":"2.8.0","@opentelemetry/sdk-trace-node":"2.8.0","@opentelemetry/semantic-conventions":"1.41.1","@redocly/cli-otel":"0.3.5","@redocly/client-generator":"0.3.6","@redocly/openapi-core":"2.46.1","@redocly/respect-core":"2.46.1","@types/cookie":"0.6.0","@types/har-format":"^1.2.16","@types/react":"^17.0.0 || ^18.2.21 || ^19.2.16","@types/react-dom":"^17.0.0 || ^18.2.7 || ^19.2.3","@types/semver":"^7.5.0","@types/set-cookie-parser":"2.4.10","@types/yargs":"17.0.32",colorette:"^1.2.0",cookie:"^0.7.2",dotenv:"16.4.7",esbuild:"^0.28.0",glob:"^13.0.5",handlebars:"^4.7.9","https-proxy-agent":"^7.0.5",react:"^17.0.0 || ^18.2.0 || ^19.2.7","react-dom":"^17.0.0 || ^18.2.0 || ^19.2.7",redoc:"2.5.3",semver:"^7.5.2","set-cookie-parser":"^2.3.5","styled-components":"6.4.2",typescript:"6.0.2",ulid:"^3.0.1",undici:"^6.28.0",yargs:"17.0.1"}};var{version:s,name:i,engines:c}=e,n=e.devDependencies.redoc,p="sha384-xiEssMQFSpSfLbzRZCGfxxIM5QDb2DTrU6vyoZdp2sV1L6pmOMy6MpTtUoLbpC96";export{s as a,i as b,c,n as d,p as e};