@redocly/cli 2.51.0 → 2.51.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.
Files changed (97) hide show
  1. package/THIRD_PARTY_NOTICES +1 -1
  2. package/lib/chunks/{7ZC3TNBP.js → 25O4YORJ.js} +1 -1
  3. package/lib/chunks/{OKMAGS7N.js → 2UDYQ5CZ.js} +1 -1
  4. package/lib/chunks/{QPW3IML7.js → 3A5KYQ7N.js} +1 -1
  5. package/lib/chunks/{KBGRTZ3S.js → 4PIDMMUD.js} +1 -1
  6. package/lib/chunks/{FVKTV62N.js → 5BMLOFU4.js} +1 -1
  7. package/lib/chunks/{BFGFT7E3.js → 67BLI5YQ.js} +1 -1
  8. package/lib/chunks/{WPSBZRFR.js → 6PX2QTPF.js} +1 -1
  9. package/lib/chunks/{KF7NA4HQ.js → 6UH63WWT.js} +1 -1
  10. package/lib/chunks/{45LW7ZJ2.js → 6ZHC3PYG.js} +1 -1
  11. package/lib/chunks/{FJAJ4RIU.js → 7SSQGR7O.js} +1 -1
  12. package/lib/chunks/{YEK532UO.js → AH3V6J6B.js} +1 -1
  13. package/lib/chunks/{KNLINRO4.js → BGIV3YYM.js} +1 -1
  14. package/lib/chunks/{AQT2EJZS.js → BJDVYUKU.js} +1 -1
  15. package/lib/chunks/{62X4OKFV.js → CGINWISC.js} +1 -1
  16. package/lib/chunks/{65LLBIQA.js → CXRHOXPI.js} +1 -1
  17. package/lib/chunks/{ULV3D265.js → ECZA233J.js} +1 -1
  18. package/lib/chunks/{2L3Z5JZA.js → EE3PGFTZ.js} +1 -1
  19. package/lib/chunks/{77VEOG4O.js → K2X43E7U.js} +1 -1
  20. package/lib/chunks/{QKWUIMTP.js → K732KQHY.js} +1 -1
  21. package/lib/chunks/{NIH6ZKB3.js → KQJOSAUI.js} +1 -1
  22. package/lib/chunks/{SQYP47H6.js → KXYI4EET.js} +1 -1
  23. package/lib/chunks/{P37B4DI4.js → LAFBWLA7.js} +1 -1
  24. package/lib/chunks/{3XSOTIDJ.js → LE7OKNLO.js} +1 -1
  25. package/lib/chunks/{4PT55VGO.js → LWB43R4X.js} +1 -1
  26. package/lib/chunks/{2WUJ57QA.js → NYFYWKQQ.js} +1 -1
  27. package/lib/chunks/{NGC5R7OH.js → OEBWRENF.js} +1 -1
  28. package/lib/chunks/{OOLLHPWT.js → OIVSGFXK.js} +1 -1
  29. package/lib/chunks/{MSRZMIR7.js → OKRLSOE5.js} +1 -1
  30. package/lib/chunks/{V4SBON7Y.js → RBHN62FF.js} +1 -1
  31. package/lib/chunks/RXUHCIFX.js +97 -0
  32. package/lib/chunks/{MXZKXUIJ.js → SKB7KFUK.js} +1 -1
  33. package/lib/chunks/{XOZ4UMDG.js → SXKUE52F.js} +1 -1
  34. package/lib/chunks/{NAGDQV7J.js → TVJE32GA.js} +1 -1
  35. package/lib/chunks/{X3MZMREJ.js → VRWULG7P.js} +1 -1
  36. package/lib/chunks/{XWZNQKXF.js → VZCENZBY.js} +1 -1
  37. package/lib/chunks/{73NWWLM3.js → WHTCOU4Z.js} +1 -1
  38. package/lib/chunks/{L4GUU6OS.js → WSOCDFHJ.js} +1 -1
  39. package/lib/chunks/{MONT6PMR.js → XMYTYWHZ.js} +1 -1
  40. package/lib/chunks/{46OWJR6X.js → Y2G2CYSF.js} +1 -1
  41. package/lib/chunks/{U6E22USS.js → Y4BUDNR4.js} +1 -1
  42. package/lib/chunks/{HMPJ7TN6.js → ZYLX724C.js} +1 -1
  43. package/lib/eject-assets/generators/cli/docs.ts +1 -1
  44. package/lib/eject-assets/generators/cli/engine-source.ts +1 -1
  45. package/lib/eject-assets/generators/cli/index.ts +2 -2
  46. package/lib/eject-assets/generators/cli/render.ts +1 -1
  47. package/lib/eject-assets/generators/go/client.ts +1 -1
  48. package/lib/eject-assets/generators/go/descriptor.ts +1 -1
  49. package/lib/eject-assets/generators/go/index.ts +2 -2
  50. package/lib/eject-assets/generators/go/models.ts +1 -1
  51. package/lib/eject-assets/generators/go/naming.ts +1 -1
  52. package/lib/eject-assets/generators/go/operations.ts +1 -1
  53. package/lib/eject-assets/generators/go/pagination.ts +1 -1
  54. package/lib/eject-assets/generators/go/types.ts +1 -1
  55. package/lib/eject-assets/generators/mock/faker.ts +1 -1
  56. package/lib/eject-assets/generators/mock/index.ts +2 -2
  57. package/lib/eject-assets/generators/mock/render.ts +1 -1
  58. package/lib/eject-assets/generators/mock/sample.ts +1 -1
  59. package/lib/eject-assets/generators/mock/values.ts +1 -1
  60. package/lib/eject-assets/generators/php/client.ts +1 -1
  61. package/lib/eject-assets/generators/php/descriptor.ts +1 -1
  62. package/lib/eject-assets/generators/php/index.ts +2 -2
  63. package/lib/eject-assets/generators/php/models.ts +1 -1
  64. package/lib/eject-assets/generators/php/naming.ts +1 -1
  65. package/lib/eject-assets/generators/php/operations.ts +1 -1
  66. package/lib/eject-assets/generators/php/pagination.ts +1 -1
  67. package/lib/eject-assets/generators/php/types.ts +1 -1
  68. package/lib/eject-assets/generators/python/client.ts +1 -1
  69. package/lib/eject-assets/generators/python/descriptor.ts +1 -1
  70. package/lib/eject-assets/generators/python/index.ts +2 -2
  71. package/lib/eject-assets/generators/python/models.ts +1 -1
  72. package/lib/eject-assets/generators/python/naming.ts +1 -1
  73. package/lib/eject-assets/generators/python/operations.ts +1 -1
  74. package/lib/eject-assets/generators/python/pagination.ts +1 -1
  75. package/lib/eject-assets/generators/python/types.ts +1 -1
  76. package/lib/eject-assets/generators/swr/index.ts +2 -2
  77. package/lib/eject-assets/generators/swr/render.ts +1 -1
  78. package/lib/eject-assets/generators/tanstack-query/index.ts +2 -2
  79. package/lib/eject-assets/generators/tanstack-query/render.ts +1 -1
  80. package/lib/eject-assets/generators/transformers/index.ts +2 -2
  81. package/lib/eject-assets/generators/transformers/render.ts +1 -1
  82. package/lib/eject-assets/generators/typescript/banner.ts +1 -1
  83. package/lib/eject-assets/generators/typescript/client.ts +1 -1
  84. package/lib/eject-assets/generators/typescript/descriptor.ts +1 -1
  85. package/lib/eject-assets/generators/typescript/index.ts +2 -2
  86. package/lib/eject-assets/generators/typescript/inline-runtime.ts +1 -1
  87. package/lib/eject-assets/generators/typescript/operation-signature.ts +1 -1
  88. package/lib/eject-assets/generators/typescript/operation-types.ts +1 -1
  89. package/lib/eject-assets/generators/typescript/operations.ts +1 -1
  90. package/lib/eject-assets/generators/typescript/response-headers.ts +1 -1
  91. package/lib/eject-assets/generators/typescript/type-guards.ts +1 -1
  92. package/lib/eject-assets/generators/typescript/types.ts +1 -1
  93. package/lib/eject-assets/generators/zod/index.ts +2 -2
  94. package/lib/eject-assets/generators/zod/schemas.ts +1 -1
  95. package/lib/index.js +8 -8
  96. package/package.json +1 -1
  97. package/lib/chunks/ESNPHQEK.js +0 -93
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 la,c as pa}from"./chunks/OFAMJNQ6.js";import{a as Yi,b as Ki,c as pt,d as Ji,e as Dn,f as Qe,g as Qt,h as Xi,i as Zi,j as Ho,k as Qi,l as vr,m as je,n as Nn,o as ea,p as ta,q as ra,r as na,s as rn,t as Yo,u as Ot,v as nn}from"./chunks/NSKVRJLY.js";import{a as Ln,b as Mn,c as Fn,d as Un,e as oa,f as sa,g as Pr,h as ia}from"./chunks/N5SXQI4I.js";import{a as Zt,b as G}from"./chunks/CA4BPC77.js";import{c as qn,d as aa,f as ca}from"./chunks/ESNPHQEK.js";import"./chunks/O6PRCLSV.js";import{a as In,b as Cr,c as Bo,d as Bi,e as Tn,f as Hi,g as kn,h as tn}from"./chunks/HMPJ7TN6.js";import{a as Gi,c as jn,d as Vo}from"./chunks/P26PQ2RU.js";import"./chunks/RS5PUOTT.js";import{a as lt,b as Wi,c as zi}from"./chunks/65LLBIQA.js";import{a as Vi}from"./chunks/BXI4SF2U.js";import"./chunks/32XCOMOR.js";import{$ as Ui,A as Li,B as Mt,C as at,E as Mi,F as Fi,H as St,I as Pn,K as Ee,M as qe,N as me,O as te,P as Q,Q as ct,R as we,S as Ge,T as fe,U as Zr,V as g,W as Ar,X as Et,Y as Qr,_ as en,a as Pi,aa as xr,b as Lt,c as I,ca as $n,d as vt,da as jt,ea as Rn,f as $i,fa as _n,g as Ri,ga as Ke,h as Cn,i as Go,j as _i,ja as qi,l as De,la as de,n as ze,o as Ii,p as vn,q as Ne,r as ji,s as Ti,t as ki,u as Or,y as Di,z as Ni}from"./chunks/OZMIIHFH.js";import"./chunks/NEWT5A6S.js";import{a as Ye,c as B,e as It}from"./chunks/RFWIIJFG.js";var $r=B((gS,ua)=>{"use strict";var wm="2.0.0",bm=Number.MAX_SAFE_INTEGER||9007199254740991,Sm=16,Em=250,Om=["major","premajor","minor","preminor","patch","prepatch","prerelease"];ua.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:Sm,MAX_SAFE_BUILD_LENGTH:Em,MAX_SAFE_INTEGER:bm,RELEASE_TYPES:Om,SEMVER_SPEC_VERSION:wm,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var on=B((yS,fa)=>{"use strict";var Am=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};fa.exports=Am});var Rr=B((Pt,ma)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:Ko,MAX_SAFE_BUILD_LENGTH:xm,MAX_LENGTH:Cm}=$r(),vm=on();Pt=ma.exports={};var Pm=Pt.re=[],$m=Pt.safeRe=[],j=Pt.src=[],Rm=Pt.safeSrc=[],T=Pt.t={},_m=0,Jo="[a-zA-Z0-9-]",Im=[["\\s",1],["\\d",Cm],[Jo,xm]],jm=t=>{for(let[e,r]of Im)t=t.split(`${e}*`).join(`${e}{0,${r}}`).split(`${e}+`).join(`${e}{1,${r}}`);return t},ee=(t,e,r)=>{let n=jm(e),o=_m++;vm(t,o,e),T[t]=o,j[o]=e,Rm[o]=n,Pm[o]=new RegExp(e,r?"g":void 0),$m[o]=new RegExp(n,r?"g":void 0)};ee("NUMERICIDENTIFIER","0|[1-9]\\d*");ee("NUMERICIDENTIFIERLOOSE","\\d+");ee("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Jo}*`);ee("MAINVERSION",`(${j[T.NUMERICIDENTIFIER]})\\.(${j[T.NUMERICIDENTIFIER]})\\.(${j[T.NUMERICIDENTIFIER]})`);ee("MAINVERSIONLOOSE",`(${j[T.NUMERICIDENTIFIERLOOSE]})\\.(${j[T.NUMERICIDENTIFIERLOOSE]})\\.(${j[T.NUMERICIDENTIFIERLOOSE]})`);ee("PRERELEASEIDENTIFIER",`(?:${j[T.NONNUMERICIDENTIFIER]}|${j[T.NUMERICIDENTIFIER]})`);ee("PRERELEASEIDENTIFIERLOOSE",`(?:${j[T.NONNUMERICIDENTIFIER]}|${j[T.NUMERICIDENTIFIERLOOSE]})`);ee("PRERELEASE",`(?:-(${j[T.PRERELEASEIDENTIFIER]}(?:\\.${j[T.PRERELEASEIDENTIFIER]})*))`);ee("PRERELEASELOOSE",`(?:-?(${j[T.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${j[T.PRERELEASEIDENTIFIERLOOSE]})*))`);ee("BUILDIDENTIFIER",`${Jo}+`);ee("BUILD",`(?:\\+(${j[T.BUILDIDENTIFIER]}(?:\\.${j[T.BUILDIDENTIFIER]})*))`);ee("FULLPLAIN",`v?${j[T.MAINVERSION]}${j[T.PRERELEASE]}?${j[T.BUILD]}?`);ee("FULL",`^${j[T.FULLPLAIN]}$`);ee("LOOSEPLAIN",`[v=\\s]*${j[T.MAINVERSIONLOOSE]}${j[T.PRERELEASELOOSE]}?${j[T.BUILD]}?`);ee("LOOSE",`^${j[T.LOOSEPLAIN]}$`);ee("GTLT","((?:<|>)?=?)");ee("XRANGEIDENTIFIERLOOSE",`${j[T.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);ee("XRANGEIDENTIFIER",`${j[T.NUMERICIDENTIFIER]}|x|X|\\*`);ee("XRANGEPLAIN",`[v=\\s]*(${j[T.XRANGEIDENTIFIER]})(?:\\.(${j[T.XRANGEIDENTIFIER]})(?:\\.(${j[T.XRANGEIDENTIFIER]})(?:${j[T.PRERELEASE]})?${j[T.BUILD]}?)?)?`);ee("XRANGEPLAINLOOSE",`[v=\\s]*(${j[T.XRANGEIDENTIFIERLOOSE]})(?:\\.(${j[T.XRANGEIDENTIFIERLOOSE]})(?:\\.(${j[T.XRANGEIDENTIFIERLOOSE]})(?:${j[T.PRERELEASELOOSE]})?${j[T.BUILD]}?)?)?`);ee("XRANGE",`^${j[T.GTLT]}\\s*${j[T.XRANGEPLAIN]}$`);ee("XRANGELOOSE",`^${j[T.GTLT]}\\s*${j[T.XRANGEPLAINLOOSE]}$`);ee("COERCEPLAIN",`(^|[^\\d])(\\d{1,${Ko}})(?:\\.(\\d{1,${Ko}}))?(?:\\.(\\d{1,${Ko}}))?`);ee("COERCE",`${j[T.COERCEPLAIN]}(?:$|[^\\d])`);ee("COERCEFULL",j[T.COERCEPLAIN]+`(?:${j[T.PRERELEASE]})?(?:${j[T.BUILD]})?(?:$|[^\\d])`);ee("COERCERTL",j[T.COERCE],!0);ee("COERCERTLFULL",j[T.COERCEFULL],!0);ee("LONETILDE","(?:~>?)");ee("TILDETRIM",`(\\s*)${j[T.LONETILDE]}\\s+`,!0);Pt.tildeTrimReplace="$1~";ee("TILDE",`^${j[T.LONETILDE]}${j[T.XRANGEPLAIN]}$`);ee("TILDELOOSE",`^${j[T.LONETILDE]}${j[T.XRANGEPLAINLOOSE]}$`);ee("LONECARET","(?:\\^)");ee("CARETTRIM",`(\\s*)${j[T.LONECARET]}\\s+`,!0);Pt.caretTrimReplace="$1^";ee("CARET",`^${j[T.LONECARET]}${j[T.XRANGEPLAIN]}$`);ee("CARETLOOSE",`^${j[T.LONECARET]}${j[T.XRANGEPLAINLOOSE]}$`);ee("COMPARATORLOOSE",`^${j[T.GTLT]}\\s*(${j[T.LOOSEPLAIN]})$|^$`);ee("COMPARATOR",`^${j[T.GTLT]}\\s*(${j[T.FULLPLAIN]})$|^$`);ee("COMPARATORTRIM",`(\\s*)${j[T.GTLT]}\\s*(${j[T.LOOSEPLAIN]}|${j[T.XRANGEPLAIN]})`,!0);Pt.comparatorTrimReplace="$1$2$3";ee("HYPHENRANGE",`^\\s*(${j[T.XRANGEPLAIN]})\\s+-\\s+(${j[T.XRANGEPLAIN]})\\s*$`);ee("HYPHENRANGELOOSE",`^\\s*(${j[T.XRANGEPLAINLOOSE]})\\s+-\\s+(${j[T.XRANGEPLAINLOOSE]})\\s*$`);ee("STAR","(<|>)?=?\\s*\\*");ee("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");ee("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Wn=B((wS,da)=>{"use strict";var Tm=Object.freeze({loose:!0}),km=Object.freeze({}),Dm=t=>t?typeof t!="object"?Tm:t:km;da.exports=Dm});var Xo=B((bS,ya)=>{"use strict";var ha=/^[0-9]+$/,ga=(t,e)=>{if(typeof t=="number"&&typeof e=="number")return t===e?0:t<e?-1:1;let r=ha.test(t),n=ha.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t<e?-1:1},Nm=(t,e)=>ga(e,t);ya.exports={compareIdentifiers:ga,rcompareIdentifiers:Nm}});var Le=B((SS,ba)=>{"use strict";var zn=on(),{MAX_LENGTH:wa,MAX_SAFE_INTEGER:Gn}=$r(),{safeRe:Vn,t:Bn}=Rr(),Lm=Wn(),{compareIdentifiers:Zo}=Xo(),Mm=(t,e)=>{let r=e.split(".");if(r.length>t.length)return!1;for(let n=0;n<r.length;n++)if(Zo(t[n],r[n])!==0)return!1;return!0},Qo=class t{constructor(e,r){if(r=Lm(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>wa)throw new TypeError(`version is longer than ${wa} characters`);zn("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=e.trim().match(r.loose?Vn[Bn.LOOSE]:Vn[Bn.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>Gn||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Gn||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Gn||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<Gn)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(zn("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(zn("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 Zo(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(zn("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 Zo(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?Vn[Bn.PRERELEASELOOSE]:Vn[Bn.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]),Mm(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}};ba.exports=Qo});var Ft=B((ES,Ea)=>{"use strict";var Sa=Le(),Fm=(t,e,r=!1)=>{if(t instanceof Sa)return t;try{return new Sa(t,e)}catch(n){if(!r)return null;throw n}};Ea.exports=Fm});var Aa=B((OS,Oa)=>{"use strict";var Um=Ft(),qm=(t,e)=>{let r=Um(t,e);return r?r.version:null};Oa.exports=qm});var Ca=B((AS,xa)=>{"use strict";var Wm=Ft(),zm=(t,e)=>{let r=Wm(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null};xa.exports=zm});var $a=B((xS,Pa)=>{"use strict";var va=Le(),Gm=(t,e,r,n,o)=>{typeof r=="string"&&(o=n,n=r,r=void 0);try{return new va(t instanceof va?t.version:t,r).inc(e,n,o).version}catch{return null}};Pa.exports=Gm});var Ia=B((CS,_a)=>{"use strict";var Ra=Ft(),Vm=(t,e)=>{let r=Ra(t,null,!0),n=Ra(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"};_a.exports=Vm});var Ta=B((vS,ja)=>{"use strict";var Bm=Le(),Hm=(t,e)=>new Bm(t,e).major;ja.exports=Hm});var Da=B((PS,ka)=>{"use strict";var Ym=Le(),Km=(t,e)=>new Ym(t,e).minor;ka.exports=Km});var La=B(($S,Na)=>{"use strict";var Jm=Le(),Xm=(t,e)=>new Jm(t,e).patch;Na.exports=Xm});var Fa=B((RS,Ma)=>{"use strict";var Zm=Ft(),Qm=(t,e)=>{let r=Zm(t,e);return r&&r.prerelease.length?r.prerelease:null};Ma.exports=Qm});var ut=B((_S,qa)=>{"use strict";var Ua=Le(),ed=(t,e,r)=>new Ua(t,r).compare(new Ua(e,r));qa.exports=ed});var za=B((IS,Wa)=>{"use strict";var td=ut(),rd=(t,e,r)=>td(e,t,r);Wa.exports=rd});var Va=B((jS,Ga)=>{"use strict";var nd=ut(),od=(t,e)=>nd(t,e,!0);Ga.exports=od});var Hn=B((TS,Ha)=>{"use strict";var Ba=Le(),sd=(t,e,r)=>{let n=new Ba(t,r),o=new Ba(e,r);return n.compare(o)||n.compareBuild(o)};Ha.exports=sd});var Ka=B((kS,Ya)=>{"use strict";var id=Hn(),ad=(t,e)=>t.sort((r,n)=>id(r,n,e));Ya.exports=ad});var Xa=B((DS,Ja)=>{"use strict";var cd=Hn(),ld=(t,e)=>t.sort((r,n)=>cd(n,r,e));Ja.exports=ld});var sn=B((NS,Za)=>{"use strict";var pd=ut(),ud=(t,e,r)=>pd(t,e,r)>0;Za.exports=ud});var Yn=B((LS,Qa)=>{"use strict";var fd=ut(),md=(t,e,r)=>fd(t,e,r)<0;Qa.exports=md});var es=B((MS,ec)=>{"use strict";var dd=ut(),hd=(t,e,r)=>dd(t,e,r)===0;ec.exports=hd});var ts=B((FS,tc)=>{"use strict";var gd=ut(),yd=(t,e,r)=>gd(t,e,r)!==0;tc.exports=yd});var Kn=B((US,rc)=>{"use strict";var wd=ut(),bd=(t,e,r)=>wd(t,e,r)>=0;rc.exports=bd});var Jn=B((qS,nc)=>{"use strict";var Sd=ut(),Ed=(t,e,r)=>Sd(t,e,r)<=0;nc.exports=Ed});var rs=B((WS,oc)=>{"use strict";var Od=es(),Ad=ts(),xd=sn(),Cd=Kn(),vd=Yn(),Pd=Jn(),$d=(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 Od(t,r,n);case"!=":return Ad(t,r,n);case">":return xd(t,r,n);case">=":return Cd(t,r,n);case"<":return vd(t,r,n);case"<=":return Pd(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}};oc.exports=$d});var ic=B((zS,sc)=>{"use strict";var Rd=Le(),_d=Ft(),{safeRe:Xn,t:Zn}=Rr(),Id=(t,e)=>{if(t instanceof Rd)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?Xn[Zn.COERCEFULL]:Xn[Zn.COERCE]);else{let c=e.includePrerelease?Xn[Zn.COERCERTLFULL]:Xn[Zn.COERCERTL],l;for(;(l=c.exec(t))&&(!r||r.index+r[0].length!==t.length);)(!r||l.index+l[0].length!==r.index+r[0].length)&&(r=l),c.lastIndex=l.index+l[1].length+l[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 _d(`${n}.${o}.${s}${i}${a}`,e)};sc.exports=Id});var cc=B((GS,ac)=>{"use strict";var jd=Ft(),Td=$r(),kd=Le(),Dd=(t,e,r)=>{if(!Td.RELEASE_TYPES.includes(e))return null;let n=Nd(t,r);return n&&Ld(n,e)},Nd=(t,e)=>{let r=t instanceof kd?t.version:t;return jd(r,e)},Ld=(t,e)=>{if(Md(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()},Md=t=>t.startsWith("pre");ac.exports=Dd});var pc=B((VS,lc)=>{"use strict";var ns=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}};lc.exports=ns});var ft=B((BS,dc)=>{"use strict";var Fd=/\s+/g,os=class t{constructor(e,r){if(r=qd(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof ss)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(Fd," "),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=>!fc(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&&Jd(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(Kd,"");let n=((this.options.includePrerelease&&Hd)|(this.options.loose&&Yd))+":"+e,o=uc.get(n);if(o)return o;let s=this.options.loose,i=s?Ve[Me.HYPHENRANGELOOSE]:Ve[Me.HYPHENRANGE];e=e.replace(i,ah(this.options.includePrerelease)),he("hyphen replace",e),e=e.replace(Ve[Me.COMPARATORTRIM],Gd),he("comparator trim",e),e=e.replace(Ve[Me.TILDETRIM],Vd),he("tilde trim",e),e=e.replace(Ve[Me.CARETTRIM],Bd),he("caret trim",e);let a=e.split(" ").map(p=>Xd(p,this.options)).join(" ").split(/\s+/).map(p=>ih(p,this.options));s&&(a=a.filter(p=>(he("loose invalid filter",p,this.options),!!p.match(Ve[Me.COMPARATORLOOSE])))),he("range list",a);let c=new Map,l=a.map(p=>new ss(p,this.options));for(let p of l){if(fc(p))return[p];c.set(p.value,p)}c.size>1&&c.has("")&&c.delete("");let u=[...c.values()];return uc.set(n,u),u}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(n=>mc(n,r)&&e.set.some(o=>mc(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 Wd(e,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(ch(this.set[r],e,this.options))return!0;return!1}};dc.exports=os;var Ud=pc(),uc=new Ud,qd=Wn(),ss=an(),he=on(),Wd=Le(),{safeRe:Ve,src:zd,t:Me,comparatorTrimReplace:Gd,tildeTrimReplace:Vd,caretTrimReplace:Bd}=Rr(),{FLAG_INCLUDE_PRERELEASE:Hd,FLAG_LOOSE:Yd}=$r(),Kd=new RegExp(zd[Me.BUILD],"g"),fc=t=>t.value==="<0.0.0-0",Jd=t=>t.value==="",mc=(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},Xd=(t,e)=>(t=t.replace(Ve[Me.BUILD],""),he("comp",t,e),t=th(t,e),he("caret",t),t=Qd(t,e),he("tildes",t),t=nh(t,e),he("xrange",t),t=sh(t,e),he("stars",t),t),$e=t=>!t||t.toLowerCase()==="x"||t==="*",Zd=(t,e,r)=>$e(t)&&!$e(e)||$e(e)&&r&&!$e(r),Qd=(t,e)=>t.trim().split(/\s+/).map(r=>eh(r,e)).join(" "),eh=(t,e)=>{let r=e.loose?Ve[Me.TILDELOOSE]:Ve[Me.TILDE],n=e.includePrerelease?"-0":"";return t.replace(r,(o,s,i,a,c)=>{he("tilde",t,o,s,i,a,c);let l;return $e(s)?l="":$e(i)?l=`>=${s}.0.0${n} <${+s+1}.0.0-0`:$e(a)?l=`>=${s}.${i}.0${n} <${s}.${+i+1}.0-0`:c?(he("replaceTilde pr",c),l=`>=${s}.${i}.${a}-${c} <${s}.${+i+1}.0-0`):l=`>=${s}.${i}.${a} <${s}.${+i+1}.0-0`,he("tilde return",l),l})},th=(t,e)=>t.trim().split(/\s+/).map(r=>rh(r,e)).join(" "),rh=(t,e)=>{he("caret",t,e);let r=e.loose?Ve[Me.CARETLOOSE]:Ve[Me.CARET],n=e.includePrerelease?"-0":"";return t.replace(r,(o,s,i,a,c)=>{he("caret",t,o,s,i,a,c);let l;return $e(s)?l="":$e(i)?l=`>=${s}.0.0${n} <${+s+1}.0.0-0`:$e(a)?s==="0"?l=`>=${s}.${i}.0${n} <${s}.${+i+1}.0-0`:l=`>=${s}.${i}.0${n} <${+s+1}.0.0-0`:c?(he("replaceCaret pr",c),s==="0"?i==="0"?l=`>=${s}.${i}.${a}-${c} <${s}.${i}.${+a+1}-0`:l=`>=${s}.${i}.${a}-${c} <${s}.${+i+1}.0-0`:l=`>=${s}.${i}.${a}-${c} <${+s+1}.0.0-0`):(he("no pr"),s==="0"?i==="0"?l=`>=${s}.${i}.${a} <${s}.${i}.${+a+1}-0`:l=`>=${s}.${i}.${a} <${s}.${+i+1}.0-0`:l=`>=${s}.${i}.${a} <${+s+1}.0.0-0`),he("caret return",l),l})},nh=(t,e)=>(he("replaceXRanges",t,e),t.split(/\s+/).map(r=>oh(r,e)).join(" ")),oh=(t,e)=>{t=t.trim();let r=e.loose?Ve[Me.XRANGELOOSE]:Ve[Me.XRANGE];return t.replace(r,(n,o,s,i,a,c)=>{if(he("xRange",t,n,o,s,i,a,c),Zd(s,i,a))return t;let l=$e(s),u=l||$e(i),p=u||$e(a),f=p;return o==="="&&f&&(o=""),c=e.includePrerelease?"-0":"",l?o===">"||o==="<"?n="<0.0.0-0":n="*":o&&f?(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`:p&&(n=`>=${s}.${i}.0${c} <${s}.${+i+1}.0-0`),he("xRange return",n),n})},sh=(t,e)=>(he("replaceStars",t,e),t.trim().replace(Ve[Me.STAR],"")),ih=(t,e)=>(he("replaceGTE0",t,e),t.trim().replace(Ve[e.includePrerelease?Me.GTE0PRE:Me.GTE0],"")),ah=t=>(e,r,n,o,s,i,a,c,l,u,p,f)=>($e(n)?r="":$e(o)?r=`>=${n}.0.0${t?"-0":""}`:$e(s)?r=`>=${n}.${o}.0${t?"-0":""}`:i?r=`>=${r}`:r=`>=${r}${t?"-0":""}`,$e(l)?c="":$e(u)?c=`<${+l+1}.0.0-0`:$e(p)?c=`<${l}.${+u+1}.0-0`:f?c=`<=${l}.${u}.${p}-${f}`:t?c=`<${l}.${u}.${+p+1}-0`:c=`<=${c}`,`${r} ${c}`.trim()),ch=(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(he(t[n].semver),t[n].semver!==ss.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 an=B((HS,Sc)=>{"use strict";var cn=Symbol("SemVer ANY"),cs=class t{static get ANY(){return cn}constructor(e,r){if(r=hc(r),e instanceof t){if(e.loose===!!r.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),as("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===cn?this.value="":this.value=this.operator+this.semver.version,as("comp",this)}parse(e){let r=this.options.loose?gc[yc.COMPARATORLOOSE]:gc[yc.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 wc(n[2],this.options.loose):this.semver=cn}toString(){return this.value}test(e){if(as("Comparator.test",e,this.options.loose),this.semver===cn||e===cn)return!0;if(typeof e=="string")try{e=new wc(e,this.options)}catch{return!1}return is(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 bc(e.value,r).test(this.value):e.operator===""?e.value===""?!0:new bc(this.value,r).test(e.semver):(r=hc(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("=")||is(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||is(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};Sc.exports=cs;var hc=Wn(),{safeRe:gc,t:yc}=Rr(),is=rs(),as=on(),wc=Le(),bc=ft()});var ln=B((YS,Ec)=>{"use strict";var lh=ft(),ph=(t,e,r)=>{try{e=new lh(e,r)}catch{return!1}return e.test(t)};Ec.exports=ph});var Ac=B((KS,Oc)=>{"use strict";var uh=ft(),fh=(t,e)=>new uh(t,e).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));Oc.exports=fh});var Cc=B((JS,xc)=>{"use strict";var mh=Le(),dh=ft(),hh=(t,e,r)=>{let n=null,o=null,s=null;try{s=new dh(e,r)}catch{return null}return t.forEach(i=>{s.test(i)&&(!n||o.compare(i)===-1)&&(n=i,o=new mh(n,r))}),n};xc.exports=hh});var Pc=B((XS,vc)=>{"use strict";var gh=Le(),yh=ft(),wh=(t,e,r)=>{let n=null,o=null,s=null;try{s=new yh(e,r)}catch{return null}return t.forEach(i=>{s.test(i)&&(!n||o.compare(i)===1)&&(n=i,o=new gh(n,r))}),n};vc.exports=wh});var _c=B((ZS,Rc)=>{"use strict";var ls=Le(),bh=ft(),$c=sn(),Sh=(t,e)=>{t=new bh(t,e);let r=new ls("0.0.0");if(t.test(r)||(r=new ls("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 ls(i.semver.version);switch(i.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!s||$c(a,s))&&(s=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${i.operator}`)}}),s&&(!r||$c(r,s))&&(r=s)}return r&&t.test(r)?r:null};Rc.exports=Sh});var jc=B((QS,Ic)=>{"use strict";var Eh=ft(),Oh=(t,e)=>{try{return new Eh(t,e).range||"*"}catch{return null}};Ic.exports=Oh});var Qn=B((eE,Nc)=>{"use strict";var Ah=Le(),Dc=an(),{ANY:xh}=Dc,Ch=ft(),vh=ln(),Tc=sn(),kc=Yn(),Ph=Jn(),$h=Kn(),Rh=(t,e,r,n)=>{t=new Ah(t,n),e=new Ch(e,n);let o,s,i,a,c;switch(r){case">":o=Tc,s=Ph,i=kc,a=">",c=">=";break;case"<":o=kc,s=$h,i=Tc,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(vh(t,e,n))return!1;for(let l=0;l<e.set.length;++l){let u=e.set[l],p=null,f=null;if(u.forEach(d=>{d.semver===xh&&(d=new Dc(">=0.0.0")),p=p||d,f=f||d,o(d.semver,p.semver,n)?p=d:i(d.semver,f.semver,n)&&(f=d)}),p.operator===a||p.operator===c||(!f.operator||f.operator===a)&&s(t,f.semver))return!1;if(f.operator===c&&i(t,f.semver))return!1}return!0};Nc.exports=Rh});var Mc=B((tE,Lc)=>{"use strict";var _h=Qn(),Ih=(t,e,r)=>_h(t,e,">",r);Lc.exports=Ih});var Uc=B((rE,Fc)=>{"use strict";var jh=Qn(),Th=(t,e,r)=>jh(t,e,"<",r);Fc.exports=Th});var zc=B((nE,Wc)=>{"use strict";var qc=ft(),kh=(t,e,r)=>(t=new qc(t,r),e=new qc(e,r),t.intersects(e,r));Wc.exports=kh});var Vc=B((oE,Gc)=>{"use strict";var Dh=ln(),Nh=ut();Gc.exports=(t,e,r)=>{let n=[],o=null,s=null,i=t.sort((u,p)=>Nh(u,p,r));for(let u of i)Dh(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,p]of n)u===p?a.push(u):!p&&u===i[0]?a.push("*"):p?u===i[0]?a.push(`<=${p}`):a.push(`${u} - ${p}`):a.push(`>=${u}`);let c=a.join(" || "),l=typeof e.raw=="string"?e.raw:String(e);return c.length<l.length?c:e}});var Xc=B((sE,Jc)=>{"use strict";var Bc=ft(),fs=an(),{ANY:ps}=fs,us=ln(),ms=ut(),Lh=(t,e,r={})=>{if(t===e)return!0;t=new Bc(t,r),e=new Bc(e,r);let n=!1;e:for(let o of t.set){for(let s of e.set){let i=Fh(o,s,r);if(n=n||i!==null,i)continue e}if(n)return!1}return!0},Mh=[new fs(">=0.0.0-0")],Hc=[new fs(">=0.0.0")],Fh=(t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===ps){if(e.length===1&&e[0].semver===ps)return!0;r.includePrerelease?t=Mh:t=Hc}if(e.length===1&&e[0].semver===ps){if(r.includePrerelease)return!0;e=Hc}let n=new Set,o,s;for(let d of t)d.operator===">"||d.operator===">="?o=Yc(o,d,r):d.operator==="<"||d.operator==="<="?s=Kc(s,d,r):n.add(d.semver);if(n.size>1)return null;let i;if(o&&s){if(i=ms(o.semver,s.semver,r),i>0)return null;if(i===0&&(o.operator!==">="||s.operator!=="<="))return null}for(let d of n){if(o&&!us(d,String(o),r)||s&&!us(d,String(s),r))return null;for(let w of e)if(!us(d,String(w),r))return!1;return!0}let a,c,l,u,p=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1,f=o&&!r.includePrerelease&&o.semver.prerelease.length?o.semver:!1;p&&p.prerelease.length===1&&s.operator==="<"&&p.prerelease[0]===0&&(p=!1);for(let d of e){if(u=u||d.operator===">"||d.operator===">=",l=l||d.operator==="<"||d.operator==="<=",o){if(f&&d.semver.prerelease&&d.semver.prerelease.length&&d.semver.major===f.major&&d.semver.minor===f.minor&&d.semver.patch===f.patch&&(f=!1),d.operator===">"||d.operator===">="){if(a=Yc(o,d,r),a===d&&a!==o)return!1}else if(o.operator===">="&&!d.test(o.semver))return!1}if(s){if(p&&d.semver.prerelease&&d.semver.prerelease.length&&d.semver.major===p.major&&d.semver.minor===p.minor&&d.semver.patch===p.patch&&(p=!1),d.operator==="<"||d.operator==="<="){if(c=Kc(s,d,r),c===d&&c!==s)return!1}else if(s.operator==="<="&&!d.test(s.semver))return!1}if(!d.operator&&(s||o)&&i!==0)return!1}return!(o&&l&&!s&&i!==0||s&&u&&!o&&i!==0||f||p)},Yc=(t,e,r)=>{if(!t)return e;let n=ms(t.semver,e.semver,r);return n>0?t:n<0||e.operator===">"&&t.operator===">="?e:t},Kc=(t,e,r)=>{if(!t)return e;let n=ms(t.semver,e.semver,r);return n<0?t:n>0||e.operator==="<"&&t.operator==="<="?e:t};Jc.exports=Lh});var eo=B((iE,el)=>{"use strict";var ds=Rr(),Zc=$r(),Uh=Le(),Qc=Xo(),qh=Ft(),Wh=Aa(),zh=Ca(),Gh=$a(),Vh=Ia(),Bh=Ta(),Hh=Da(),Yh=La(),Kh=Fa(),Jh=ut(),Xh=za(),Zh=Va(),Qh=Hn(),eg=Ka(),tg=Xa(),rg=sn(),ng=Yn(),og=es(),sg=ts(),ig=Kn(),ag=Jn(),cg=rs(),lg=ic(),pg=cc(),ug=an(),fg=ft(),mg=ln(),dg=Ac(),hg=Cc(),gg=Pc(),yg=_c(),wg=jc(),bg=Qn(),Sg=Mc(),Eg=Uc(),Og=zc(),Ag=Vc(),xg=Xc();el.exports={parse:qh,valid:Wh,clean:zh,inc:Gh,diff:Vh,major:Bh,minor:Hh,patch:Yh,prerelease:Kh,compare:Jh,rcompare:Xh,compareLoose:Zh,compareBuild:Qh,sort:eg,rsort:tg,gt:rg,lt:ng,eq:og,neq:sg,gte:ig,lte:ag,cmp:cg,coerce:lg,truncate:pg,Comparator:ug,Range:fg,satisfies:mg,toComparators:dg,maxSatisfying:hg,minSatisfying:gg,minVersion:yg,validRange:wg,outside:bg,gtr:Sg,ltr:Eg,intersects:Og,simplifyRange:Ag,subset:xg,SemVer:Uh,re:ds.re,src:ds.src,tokens:ds.t,SEMVER_SPEC_VERSION:Zc.SEMVER_SPEC_VERSION,RELEASE_TYPES:Zc.RELEASE_TYPES,compareIdentifiers:Qc.compareIdentifiers,rcompareIdentifiers:Qc.rcompareIdentifiers}});var rl=B((lE,Cg)=>{Cg.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 bs=B((pE,Tt)=>{var gs=Ye("fs"),ys=Ye("path"),vg=Ye("os"),Pg=Ye("crypto"),$g=rl(),ws=$g.version,Rg=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function _g(t){let e={},r=t.toString();r=r.replace(/\r\n?/mg,`
8
+ import{a as la,c as pa}from"./chunks/OFAMJNQ6.js";import{a as Yi,b as Ki,c as pt,d as Ji,e as Dn,f as Qe,g as Qt,h as Xi,i as Zi,j as Ho,k as Qi,l as vr,m as je,n as Nn,o as ea,p as ta,q as ra,r as na,s as rn,t as Yo,u as Ot,v as nn}from"./chunks/NSKVRJLY.js";import{a as Ln,b as Mn,c as Fn,d as Un,e as oa,f as sa,g as Pr,h as ia}from"./chunks/N5SXQI4I.js";import{a as Zt,b as G}from"./chunks/CA4BPC77.js";import{c as qn,d as aa,f as ca}from"./chunks/RXUHCIFX.js";import"./chunks/O6PRCLSV.js";import{a as In,b as Cr,c as Bo,d as Bi,e as Tn,f as Hi,g as kn,h as tn}from"./chunks/ZYLX724C.js";import{a as Gi,c as jn,d as Vo}from"./chunks/P26PQ2RU.js";import"./chunks/RS5PUOTT.js";import{a as lt,b as Wi,c as zi}from"./chunks/CXRHOXPI.js";import{a as Vi}from"./chunks/BXI4SF2U.js";import"./chunks/32XCOMOR.js";import{$ as Ui,A as Li,B as Mt,C as at,E as Mi,F as Fi,H as St,I as Pn,K as Ee,M as qe,N as me,O as te,P as Q,Q as ct,R as we,S as Ge,T as fe,U as Zr,V as g,W as Ar,X as Et,Y as Qr,_ as en,a as Pi,aa as xr,b as Lt,c as I,ca as $n,d as vt,da as jt,ea as Rn,f as $i,fa as _n,g as Ri,ga as Ke,h as Cn,i as Go,j as _i,ja as qi,l as De,la as de,n as ze,o as Ii,p as vn,q as Ne,r as ji,s as Ti,t as ki,u as Or,y as Di,z as Ni}from"./chunks/OZMIIHFH.js";import"./chunks/NEWT5A6S.js";import{a as Ye,c as B,e as It}from"./chunks/RFWIIJFG.js";var $r=B((gS,ua)=>{"use strict";var wm="2.0.0",bm=Number.MAX_SAFE_INTEGER||9007199254740991,Sm=16,Em=250,Om=["major","premajor","minor","preminor","patch","prepatch","prerelease"];ua.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:Sm,MAX_SAFE_BUILD_LENGTH:Em,MAX_SAFE_INTEGER:bm,RELEASE_TYPES:Om,SEMVER_SPEC_VERSION:wm,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var on=B((yS,fa)=>{"use strict";var Am=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};fa.exports=Am});var Rr=B((Pt,ma)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:Ko,MAX_SAFE_BUILD_LENGTH:xm,MAX_LENGTH:Cm}=$r(),vm=on();Pt=ma.exports={};var Pm=Pt.re=[],$m=Pt.safeRe=[],j=Pt.src=[],Rm=Pt.safeSrc=[],T=Pt.t={},_m=0,Jo="[a-zA-Z0-9-]",Im=[["\\s",1],["\\d",Cm],[Jo,xm]],jm=t=>{for(let[e,r]of Im)t=t.split(`${e}*`).join(`${e}{0,${r}}`).split(`${e}+`).join(`${e}{1,${r}}`);return t},ee=(t,e,r)=>{let n=jm(e),o=_m++;vm(t,o,e),T[t]=o,j[o]=e,Rm[o]=n,Pm[o]=new RegExp(e,r?"g":void 0),$m[o]=new RegExp(n,r?"g":void 0)};ee("NUMERICIDENTIFIER","0|[1-9]\\d*");ee("NUMERICIDENTIFIERLOOSE","\\d+");ee("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Jo}*`);ee("MAINVERSION",`(${j[T.NUMERICIDENTIFIER]})\\.(${j[T.NUMERICIDENTIFIER]})\\.(${j[T.NUMERICIDENTIFIER]})`);ee("MAINVERSIONLOOSE",`(${j[T.NUMERICIDENTIFIERLOOSE]})\\.(${j[T.NUMERICIDENTIFIERLOOSE]})\\.(${j[T.NUMERICIDENTIFIERLOOSE]})`);ee("PRERELEASEIDENTIFIER",`(?:${j[T.NONNUMERICIDENTIFIER]}|${j[T.NUMERICIDENTIFIER]})`);ee("PRERELEASEIDENTIFIERLOOSE",`(?:${j[T.NONNUMERICIDENTIFIER]}|${j[T.NUMERICIDENTIFIERLOOSE]})`);ee("PRERELEASE",`(?:-(${j[T.PRERELEASEIDENTIFIER]}(?:\\.${j[T.PRERELEASEIDENTIFIER]})*))`);ee("PRERELEASELOOSE",`(?:-?(${j[T.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${j[T.PRERELEASEIDENTIFIERLOOSE]})*))`);ee("BUILDIDENTIFIER",`${Jo}+`);ee("BUILD",`(?:\\+(${j[T.BUILDIDENTIFIER]}(?:\\.${j[T.BUILDIDENTIFIER]})*))`);ee("FULLPLAIN",`v?${j[T.MAINVERSION]}${j[T.PRERELEASE]}?${j[T.BUILD]}?`);ee("FULL",`^${j[T.FULLPLAIN]}$`);ee("LOOSEPLAIN",`[v=\\s]*${j[T.MAINVERSIONLOOSE]}${j[T.PRERELEASELOOSE]}?${j[T.BUILD]}?`);ee("LOOSE",`^${j[T.LOOSEPLAIN]}$`);ee("GTLT","((?:<|>)?=?)");ee("XRANGEIDENTIFIERLOOSE",`${j[T.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);ee("XRANGEIDENTIFIER",`${j[T.NUMERICIDENTIFIER]}|x|X|\\*`);ee("XRANGEPLAIN",`[v=\\s]*(${j[T.XRANGEIDENTIFIER]})(?:\\.(${j[T.XRANGEIDENTIFIER]})(?:\\.(${j[T.XRANGEIDENTIFIER]})(?:${j[T.PRERELEASE]})?${j[T.BUILD]}?)?)?`);ee("XRANGEPLAINLOOSE",`[v=\\s]*(${j[T.XRANGEIDENTIFIERLOOSE]})(?:\\.(${j[T.XRANGEIDENTIFIERLOOSE]})(?:\\.(${j[T.XRANGEIDENTIFIERLOOSE]})(?:${j[T.PRERELEASELOOSE]})?${j[T.BUILD]}?)?)?`);ee("XRANGE",`^${j[T.GTLT]}\\s*${j[T.XRANGEPLAIN]}$`);ee("XRANGELOOSE",`^${j[T.GTLT]}\\s*${j[T.XRANGEPLAINLOOSE]}$`);ee("COERCEPLAIN",`(^|[^\\d])(\\d{1,${Ko}})(?:\\.(\\d{1,${Ko}}))?(?:\\.(\\d{1,${Ko}}))?`);ee("COERCE",`${j[T.COERCEPLAIN]}(?:$|[^\\d])`);ee("COERCEFULL",j[T.COERCEPLAIN]+`(?:${j[T.PRERELEASE]})?(?:${j[T.BUILD]})?(?:$|[^\\d])`);ee("COERCERTL",j[T.COERCE],!0);ee("COERCERTLFULL",j[T.COERCEFULL],!0);ee("LONETILDE","(?:~>?)");ee("TILDETRIM",`(\\s*)${j[T.LONETILDE]}\\s+`,!0);Pt.tildeTrimReplace="$1~";ee("TILDE",`^${j[T.LONETILDE]}${j[T.XRANGEPLAIN]}$`);ee("TILDELOOSE",`^${j[T.LONETILDE]}${j[T.XRANGEPLAINLOOSE]}$`);ee("LONECARET","(?:\\^)");ee("CARETTRIM",`(\\s*)${j[T.LONECARET]}\\s+`,!0);Pt.caretTrimReplace="$1^";ee("CARET",`^${j[T.LONECARET]}${j[T.XRANGEPLAIN]}$`);ee("CARETLOOSE",`^${j[T.LONECARET]}${j[T.XRANGEPLAINLOOSE]}$`);ee("COMPARATORLOOSE",`^${j[T.GTLT]}\\s*(${j[T.LOOSEPLAIN]})$|^$`);ee("COMPARATOR",`^${j[T.GTLT]}\\s*(${j[T.FULLPLAIN]})$|^$`);ee("COMPARATORTRIM",`(\\s*)${j[T.GTLT]}\\s*(${j[T.LOOSEPLAIN]}|${j[T.XRANGEPLAIN]})`,!0);Pt.comparatorTrimReplace="$1$2$3";ee("HYPHENRANGE",`^\\s*(${j[T.XRANGEPLAIN]})\\s+-\\s+(${j[T.XRANGEPLAIN]})\\s*$`);ee("HYPHENRANGELOOSE",`^\\s*(${j[T.XRANGEPLAINLOOSE]})\\s+-\\s+(${j[T.XRANGEPLAINLOOSE]})\\s*$`);ee("STAR","(<|>)?=?\\s*\\*");ee("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");ee("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Wn=B((wS,da)=>{"use strict";var Tm=Object.freeze({loose:!0}),km=Object.freeze({}),Dm=t=>t?typeof t!="object"?Tm:t:km;da.exports=Dm});var Xo=B((bS,ya)=>{"use strict";var ha=/^[0-9]+$/,ga=(t,e)=>{if(typeof t=="number"&&typeof e=="number")return t===e?0:t<e?-1:1;let r=ha.test(t),n=ha.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t<e?-1:1},Nm=(t,e)=>ga(e,t);ya.exports={compareIdentifiers:ga,rcompareIdentifiers:Nm}});var Le=B((SS,ba)=>{"use strict";var zn=on(),{MAX_LENGTH:wa,MAX_SAFE_INTEGER:Gn}=$r(),{safeRe:Vn,t:Bn}=Rr(),Lm=Wn(),{compareIdentifiers:Zo}=Xo(),Mm=(t,e)=>{let r=e.split(".");if(r.length>t.length)return!1;for(let n=0;n<r.length;n++)if(Zo(t[n],r[n])!==0)return!1;return!0},Qo=class t{constructor(e,r){if(r=Lm(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>wa)throw new TypeError(`version is longer than ${wa} characters`);zn("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=e.trim().match(r.loose?Vn[Bn.LOOSE]:Vn[Bn.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>Gn||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Gn||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Gn||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<Gn)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(zn("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(zn("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 Zo(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(zn("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 Zo(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?Vn[Bn.PRERELEASELOOSE]:Vn[Bn.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]),Mm(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}};ba.exports=Qo});var Ft=B((ES,Ea)=>{"use strict";var Sa=Le(),Fm=(t,e,r=!1)=>{if(t instanceof Sa)return t;try{return new Sa(t,e)}catch(n){if(!r)return null;throw n}};Ea.exports=Fm});var Aa=B((OS,Oa)=>{"use strict";var Um=Ft(),qm=(t,e)=>{let r=Um(t,e);return r?r.version:null};Oa.exports=qm});var Ca=B((AS,xa)=>{"use strict";var Wm=Ft(),zm=(t,e)=>{let r=Wm(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null};xa.exports=zm});var $a=B((xS,Pa)=>{"use strict";var va=Le(),Gm=(t,e,r,n,o)=>{typeof r=="string"&&(o=n,n=r,r=void 0);try{return new va(t instanceof va?t.version:t,r).inc(e,n,o).version}catch{return null}};Pa.exports=Gm});var Ia=B((CS,_a)=>{"use strict";var Ra=Ft(),Vm=(t,e)=>{let r=Ra(t,null,!0),n=Ra(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"};_a.exports=Vm});var Ta=B((vS,ja)=>{"use strict";var Bm=Le(),Hm=(t,e)=>new Bm(t,e).major;ja.exports=Hm});var Da=B((PS,ka)=>{"use strict";var Ym=Le(),Km=(t,e)=>new Ym(t,e).minor;ka.exports=Km});var La=B(($S,Na)=>{"use strict";var Jm=Le(),Xm=(t,e)=>new Jm(t,e).patch;Na.exports=Xm});var Fa=B((RS,Ma)=>{"use strict";var Zm=Ft(),Qm=(t,e)=>{let r=Zm(t,e);return r&&r.prerelease.length?r.prerelease:null};Ma.exports=Qm});var ut=B((_S,qa)=>{"use strict";var Ua=Le(),ed=(t,e,r)=>new Ua(t,r).compare(new Ua(e,r));qa.exports=ed});var za=B((IS,Wa)=>{"use strict";var td=ut(),rd=(t,e,r)=>td(e,t,r);Wa.exports=rd});var Va=B((jS,Ga)=>{"use strict";var nd=ut(),od=(t,e)=>nd(t,e,!0);Ga.exports=od});var Hn=B((TS,Ha)=>{"use strict";var Ba=Le(),sd=(t,e,r)=>{let n=new Ba(t,r),o=new Ba(e,r);return n.compare(o)||n.compareBuild(o)};Ha.exports=sd});var Ka=B((kS,Ya)=>{"use strict";var id=Hn(),ad=(t,e)=>t.sort((r,n)=>id(r,n,e));Ya.exports=ad});var Xa=B((DS,Ja)=>{"use strict";var cd=Hn(),ld=(t,e)=>t.sort((r,n)=>cd(n,r,e));Ja.exports=ld});var sn=B((NS,Za)=>{"use strict";var pd=ut(),ud=(t,e,r)=>pd(t,e,r)>0;Za.exports=ud});var Yn=B((LS,Qa)=>{"use strict";var fd=ut(),md=(t,e,r)=>fd(t,e,r)<0;Qa.exports=md});var es=B((MS,ec)=>{"use strict";var dd=ut(),hd=(t,e,r)=>dd(t,e,r)===0;ec.exports=hd});var ts=B((FS,tc)=>{"use strict";var gd=ut(),yd=(t,e,r)=>gd(t,e,r)!==0;tc.exports=yd});var Kn=B((US,rc)=>{"use strict";var wd=ut(),bd=(t,e,r)=>wd(t,e,r)>=0;rc.exports=bd});var Jn=B((qS,nc)=>{"use strict";var Sd=ut(),Ed=(t,e,r)=>Sd(t,e,r)<=0;nc.exports=Ed});var rs=B((WS,oc)=>{"use strict";var Od=es(),Ad=ts(),xd=sn(),Cd=Kn(),vd=Yn(),Pd=Jn(),$d=(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 Od(t,r,n);case"!=":return Ad(t,r,n);case">":return xd(t,r,n);case">=":return Cd(t,r,n);case"<":return vd(t,r,n);case"<=":return Pd(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}};oc.exports=$d});var ic=B((zS,sc)=>{"use strict";var Rd=Le(),_d=Ft(),{safeRe:Xn,t:Zn}=Rr(),Id=(t,e)=>{if(t instanceof Rd)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?Xn[Zn.COERCEFULL]:Xn[Zn.COERCE]);else{let c=e.includePrerelease?Xn[Zn.COERCERTLFULL]:Xn[Zn.COERCERTL],l;for(;(l=c.exec(t))&&(!r||r.index+r[0].length!==t.length);)(!r||l.index+l[0].length!==r.index+r[0].length)&&(r=l),c.lastIndex=l.index+l[1].length+l[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 _d(`${n}.${o}.${s}${i}${a}`,e)};sc.exports=Id});var cc=B((GS,ac)=>{"use strict";var jd=Ft(),Td=$r(),kd=Le(),Dd=(t,e,r)=>{if(!Td.RELEASE_TYPES.includes(e))return null;let n=Nd(t,r);return n&&Ld(n,e)},Nd=(t,e)=>{let r=t instanceof kd?t.version:t;return jd(r,e)},Ld=(t,e)=>{if(Md(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()},Md=t=>t.startsWith("pre");ac.exports=Dd});var pc=B((VS,lc)=>{"use strict";var ns=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}};lc.exports=ns});var ft=B((BS,dc)=>{"use strict";var Fd=/\s+/g,os=class t{constructor(e,r){if(r=qd(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof ss)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(Fd," "),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=>!fc(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&&Jd(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(Kd,"");let n=((this.options.includePrerelease&&Hd)|(this.options.loose&&Yd))+":"+e,o=uc.get(n);if(o)return o;let s=this.options.loose,i=s?Ve[Me.HYPHENRANGELOOSE]:Ve[Me.HYPHENRANGE];e=e.replace(i,ah(this.options.includePrerelease)),he("hyphen replace",e),e=e.replace(Ve[Me.COMPARATORTRIM],Gd),he("comparator trim",e),e=e.replace(Ve[Me.TILDETRIM],Vd),he("tilde trim",e),e=e.replace(Ve[Me.CARETTRIM],Bd),he("caret trim",e);let a=e.split(" ").map(p=>Xd(p,this.options)).join(" ").split(/\s+/).map(p=>ih(p,this.options));s&&(a=a.filter(p=>(he("loose invalid filter",p,this.options),!!p.match(Ve[Me.COMPARATORLOOSE])))),he("range list",a);let c=new Map,l=a.map(p=>new ss(p,this.options));for(let p of l){if(fc(p))return[p];c.set(p.value,p)}c.size>1&&c.has("")&&c.delete("");let u=[...c.values()];return uc.set(n,u),u}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(n=>mc(n,r)&&e.set.some(o=>mc(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 Wd(e,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(ch(this.set[r],e,this.options))return!0;return!1}};dc.exports=os;var Ud=pc(),uc=new Ud,qd=Wn(),ss=an(),he=on(),Wd=Le(),{safeRe:Ve,src:zd,t:Me,comparatorTrimReplace:Gd,tildeTrimReplace:Vd,caretTrimReplace:Bd}=Rr(),{FLAG_INCLUDE_PRERELEASE:Hd,FLAG_LOOSE:Yd}=$r(),Kd=new RegExp(zd[Me.BUILD],"g"),fc=t=>t.value==="<0.0.0-0",Jd=t=>t.value==="",mc=(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},Xd=(t,e)=>(t=t.replace(Ve[Me.BUILD],""),he("comp",t,e),t=th(t,e),he("caret",t),t=Qd(t,e),he("tildes",t),t=nh(t,e),he("xrange",t),t=sh(t,e),he("stars",t),t),$e=t=>!t||t.toLowerCase()==="x"||t==="*",Zd=(t,e,r)=>$e(t)&&!$e(e)||$e(e)&&r&&!$e(r),Qd=(t,e)=>t.trim().split(/\s+/).map(r=>eh(r,e)).join(" "),eh=(t,e)=>{let r=e.loose?Ve[Me.TILDELOOSE]:Ve[Me.TILDE],n=e.includePrerelease?"-0":"";return t.replace(r,(o,s,i,a,c)=>{he("tilde",t,o,s,i,a,c);let l;return $e(s)?l="":$e(i)?l=`>=${s}.0.0${n} <${+s+1}.0.0-0`:$e(a)?l=`>=${s}.${i}.0${n} <${s}.${+i+1}.0-0`:c?(he("replaceTilde pr",c),l=`>=${s}.${i}.${a}-${c} <${s}.${+i+1}.0-0`):l=`>=${s}.${i}.${a} <${s}.${+i+1}.0-0`,he("tilde return",l),l})},th=(t,e)=>t.trim().split(/\s+/).map(r=>rh(r,e)).join(" "),rh=(t,e)=>{he("caret",t,e);let r=e.loose?Ve[Me.CARETLOOSE]:Ve[Me.CARET],n=e.includePrerelease?"-0":"";return t.replace(r,(o,s,i,a,c)=>{he("caret",t,o,s,i,a,c);let l;return $e(s)?l="":$e(i)?l=`>=${s}.0.0${n} <${+s+1}.0.0-0`:$e(a)?s==="0"?l=`>=${s}.${i}.0${n} <${s}.${+i+1}.0-0`:l=`>=${s}.${i}.0${n} <${+s+1}.0.0-0`:c?(he("replaceCaret pr",c),s==="0"?i==="0"?l=`>=${s}.${i}.${a}-${c} <${s}.${i}.${+a+1}-0`:l=`>=${s}.${i}.${a}-${c} <${s}.${+i+1}.0-0`:l=`>=${s}.${i}.${a}-${c} <${+s+1}.0.0-0`):(he("no pr"),s==="0"?i==="0"?l=`>=${s}.${i}.${a} <${s}.${i}.${+a+1}-0`:l=`>=${s}.${i}.${a} <${s}.${+i+1}.0-0`:l=`>=${s}.${i}.${a} <${+s+1}.0.0-0`),he("caret return",l),l})},nh=(t,e)=>(he("replaceXRanges",t,e),t.split(/\s+/).map(r=>oh(r,e)).join(" ")),oh=(t,e)=>{t=t.trim();let r=e.loose?Ve[Me.XRANGELOOSE]:Ve[Me.XRANGE];return t.replace(r,(n,o,s,i,a,c)=>{if(he("xRange",t,n,o,s,i,a,c),Zd(s,i,a))return t;let l=$e(s),u=l||$e(i),p=u||$e(a),f=p;return o==="="&&f&&(o=""),c=e.includePrerelease?"-0":"",l?o===">"||o==="<"?n="<0.0.0-0":n="*":o&&f?(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`:p&&(n=`>=${s}.${i}.0${c} <${s}.${+i+1}.0-0`),he("xRange return",n),n})},sh=(t,e)=>(he("replaceStars",t,e),t.trim().replace(Ve[Me.STAR],"")),ih=(t,e)=>(he("replaceGTE0",t,e),t.trim().replace(Ve[e.includePrerelease?Me.GTE0PRE:Me.GTE0],"")),ah=t=>(e,r,n,o,s,i,a,c,l,u,p,f)=>($e(n)?r="":$e(o)?r=`>=${n}.0.0${t?"-0":""}`:$e(s)?r=`>=${n}.${o}.0${t?"-0":""}`:i?r=`>=${r}`:r=`>=${r}${t?"-0":""}`,$e(l)?c="":$e(u)?c=`<${+l+1}.0.0-0`:$e(p)?c=`<${l}.${+u+1}.0-0`:f?c=`<=${l}.${u}.${p}-${f}`:t?c=`<${l}.${u}.${+p+1}-0`:c=`<=${c}`,`${r} ${c}`.trim()),ch=(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(he(t[n].semver),t[n].semver!==ss.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 an=B((HS,Sc)=>{"use strict";var cn=Symbol("SemVer ANY"),cs=class t{static get ANY(){return cn}constructor(e,r){if(r=hc(r),e instanceof t){if(e.loose===!!r.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),as("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===cn?this.value="":this.value=this.operator+this.semver.version,as("comp",this)}parse(e){let r=this.options.loose?gc[yc.COMPARATORLOOSE]:gc[yc.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 wc(n[2],this.options.loose):this.semver=cn}toString(){return this.value}test(e){if(as("Comparator.test",e,this.options.loose),this.semver===cn||e===cn)return!0;if(typeof e=="string")try{e=new wc(e,this.options)}catch{return!1}return is(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 bc(e.value,r).test(this.value):e.operator===""?e.value===""?!0:new bc(this.value,r).test(e.semver):(r=hc(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("=")||is(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||is(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};Sc.exports=cs;var hc=Wn(),{safeRe:gc,t:yc}=Rr(),is=rs(),as=on(),wc=Le(),bc=ft()});var ln=B((YS,Ec)=>{"use strict";var lh=ft(),ph=(t,e,r)=>{try{e=new lh(e,r)}catch{return!1}return e.test(t)};Ec.exports=ph});var Ac=B((KS,Oc)=>{"use strict";var uh=ft(),fh=(t,e)=>new uh(t,e).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));Oc.exports=fh});var Cc=B((JS,xc)=>{"use strict";var mh=Le(),dh=ft(),hh=(t,e,r)=>{let n=null,o=null,s=null;try{s=new dh(e,r)}catch{return null}return t.forEach(i=>{s.test(i)&&(!n||o.compare(i)===-1)&&(n=i,o=new mh(n,r))}),n};xc.exports=hh});var Pc=B((XS,vc)=>{"use strict";var gh=Le(),yh=ft(),wh=(t,e,r)=>{let n=null,o=null,s=null;try{s=new yh(e,r)}catch{return null}return t.forEach(i=>{s.test(i)&&(!n||o.compare(i)===1)&&(n=i,o=new gh(n,r))}),n};vc.exports=wh});var _c=B((ZS,Rc)=>{"use strict";var ls=Le(),bh=ft(),$c=sn(),Sh=(t,e)=>{t=new bh(t,e);let r=new ls("0.0.0");if(t.test(r)||(r=new ls("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 ls(i.semver.version);switch(i.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!s||$c(a,s))&&(s=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${i.operator}`)}}),s&&(!r||$c(r,s))&&(r=s)}return r&&t.test(r)?r:null};Rc.exports=Sh});var jc=B((QS,Ic)=>{"use strict";var Eh=ft(),Oh=(t,e)=>{try{return new Eh(t,e).range||"*"}catch{return null}};Ic.exports=Oh});var Qn=B((eE,Nc)=>{"use strict";var Ah=Le(),Dc=an(),{ANY:xh}=Dc,Ch=ft(),vh=ln(),Tc=sn(),kc=Yn(),Ph=Jn(),$h=Kn(),Rh=(t,e,r,n)=>{t=new Ah(t,n),e=new Ch(e,n);let o,s,i,a,c;switch(r){case">":o=Tc,s=Ph,i=kc,a=">",c=">=";break;case"<":o=kc,s=$h,i=Tc,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(vh(t,e,n))return!1;for(let l=0;l<e.set.length;++l){let u=e.set[l],p=null,f=null;if(u.forEach(d=>{d.semver===xh&&(d=new Dc(">=0.0.0")),p=p||d,f=f||d,o(d.semver,p.semver,n)?p=d:i(d.semver,f.semver,n)&&(f=d)}),p.operator===a||p.operator===c||(!f.operator||f.operator===a)&&s(t,f.semver))return!1;if(f.operator===c&&i(t,f.semver))return!1}return!0};Nc.exports=Rh});var Mc=B((tE,Lc)=>{"use strict";var _h=Qn(),Ih=(t,e,r)=>_h(t,e,">",r);Lc.exports=Ih});var Uc=B((rE,Fc)=>{"use strict";var jh=Qn(),Th=(t,e,r)=>jh(t,e,"<",r);Fc.exports=Th});var zc=B((nE,Wc)=>{"use strict";var qc=ft(),kh=(t,e,r)=>(t=new qc(t,r),e=new qc(e,r),t.intersects(e,r));Wc.exports=kh});var Vc=B((oE,Gc)=>{"use strict";var Dh=ln(),Nh=ut();Gc.exports=(t,e,r)=>{let n=[],o=null,s=null,i=t.sort((u,p)=>Nh(u,p,r));for(let u of i)Dh(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,p]of n)u===p?a.push(u):!p&&u===i[0]?a.push("*"):p?u===i[0]?a.push(`<=${p}`):a.push(`${u} - ${p}`):a.push(`>=${u}`);let c=a.join(" || "),l=typeof e.raw=="string"?e.raw:String(e);return c.length<l.length?c:e}});var Xc=B((sE,Jc)=>{"use strict";var Bc=ft(),fs=an(),{ANY:ps}=fs,us=ln(),ms=ut(),Lh=(t,e,r={})=>{if(t===e)return!0;t=new Bc(t,r),e=new Bc(e,r);let n=!1;e:for(let o of t.set){for(let s of e.set){let i=Fh(o,s,r);if(n=n||i!==null,i)continue e}if(n)return!1}return!0},Mh=[new fs(">=0.0.0-0")],Hc=[new fs(">=0.0.0")],Fh=(t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===ps){if(e.length===1&&e[0].semver===ps)return!0;r.includePrerelease?t=Mh:t=Hc}if(e.length===1&&e[0].semver===ps){if(r.includePrerelease)return!0;e=Hc}let n=new Set,o,s;for(let d of t)d.operator===">"||d.operator===">="?o=Yc(o,d,r):d.operator==="<"||d.operator==="<="?s=Kc(s,d,r):n.add(d.semver);if(n.size>1)return null;let i;if(o&&s){if(i=ms(o.semver,s.semver,r),i>0)return null;if(i===0&&(o.operator!==">="||s.operator!=="<="))return null}for(let d of n){if(o&&!us(d,String(o),r)||s&&!us(d,String(s),r))return null;for(let w of e)if(!us(d,String(w),r))return!1;return!0}let a,c,l,u,p=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1,f=o&&!r.includePrerelease&&o.semver.prerelease.length?o.semver:!1;p&&p.prerelease.length===1&&s.operator==="<"&&p.prerelease[0]===0&&(p=!1);for(let d of e){if(u=u||d.operator===">"||d.operator===">=",l=l||d.operator==="<"||d.operator==="<=",o){if(f&&d.semver.prerelease&&d.semver.prerelease.length&&d.semver.major===f.major&&d.semver.minor===f.minor&&d.semver.patch===f.patch&&(f=!1),d.operator===">"||d.operator===">="){if(a=Yc(o,d,r),a===d&&a!==o)return!1}else if(o.operator===">="&&!d.test(o.semver))return!1}if(s){if(p&&d.semver.prerelease&&d.semver.prerelease.length&&d.semver.major===p.major&&d.semver.minor===p.minor&&d.semver.patch===p.patch&&(p=!1),d.operator==="<"||d.operator==="<="){if(c=Kc(s,d,r),c===d&&c!==s)return!1}else if(s.operator==="<="&&!d.test(s.semver))return!1}if(!d.operator&&(s||o)&&i!==0)return!1}return!(o&&l&&!s&&i!==0||s&&u&&!o&&i!==0||f||p)},Yc=(t,e,r)=>{if(!t)return e;let n=ms(t.semver,e.semver,r);return n>0?t:n<0||e.operator===">"&&t.operator===">="?e:t},Kc=(t,e,r)=>{if(!t)return e;let n=ms(t.semver,e.semver,r);return n<0?t:n>0||e.operator==="<"&&t.operator==="<="?e:t};Jc.exports=Lh});var eo=B((iE,el)=>{"use strict";var ds=Rr(),Zc=$r(),Uh=Le(),Qc=Xo(),qh=Ft(),Wh=Aa(),zh=Ca(),Gh=$a(),Vh=Ia(),Bh=Ta(),Hh=Da(),Yh=La(),Kh=Fa(),Jh=ut(),Xh=za(),Zh=Va(),Qh=Hn(),eg=Ka(),tg=Xa(),rg=sn(),ng=Yn(),og=es(),sg=ts(),ig=Kn(),ag=Jn(),cg=rs(),lg=ic(),pg=cc(),ug=an(),fg=ft(),mg=ln(),dg=Ac(),hg=Cc(),gg=Pc(),yg=_c(),wg=jc(),bg=Qn(),Sg=Mc(),Eg=Uc(),Og=zc(),Ag=Vc(),xg=Xc();el.exports={parse:qh,valid:Wh,clean:zh,inc:Gh,diff:Vh,major:Bh,minor:Hh,patch:Yh,prerelease:Kh,compare:Jh,rcompare:Xh,compareLoose:Zh,compareBuild:Qh,sort:eg,rsort:tg,gt:rg,lt:ng,eq:og,neq:sg,gte:ig,lte:ag,cmp:cg,coerce:lg,truncate:pg,Comparator:ug,Range:fg,satisfies:mg,toComparators:dg,maxSatisfying:hg,minSatisfying:gg,minVersion:yg,validRange:wg,outside:bg,gtr:Sg,ltr:Eg,intersects:Og,simplifyRange:Ag,subset:xg,SemVer:Uh,re:ds.re,src:ds.src,tokens:ds.t,SEMVER_SPEC_VERSION:Zc.SEMVER_SPEC_VERSION,RELEASE_TYPES:Zc.RELEASE_TYPES,compareIdentifiers:Qc.compareIdentifiers,rcompareIdentifiers:Qc.rcompareIdentifiers}});var rl=B((lE,Cg)=>{Cg.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 bs=B((pE,Tt)=>{var gs=Ye("fs"),ys=Ye("path"),vg=Ye("os"),Pg=Ye("crypto"),$g=rl(),ws=$g.version,Rg=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function _g(t){let e={},r=t.toString();r=r.replace(/\r\n?/mg,`
9
9
  `);let n;for(;(n=Rg.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 Ig(t){let e=sl(t),r=Re.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=ol(t).split(","),o=n.length,s;for(let i=0;i<o;i++)try{let a=n[i].trim(),c=kg(r,a);s=Re.decrypt(c.ciphertext,c.key);break}catch(a){if(i+1>=o)throw a}return Re.parse(s)}function jg(t){console.log(`[dotenv@${ws}][INFO] ${t}`)}function Tg(t){console.log(`[dotenv@${ws}][WARN] ${t}`)}function to(t){console.log(`[dotenv@${ws}][DEBUG] ${t}`)}function ol(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 kg(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 sl(t){let e=null;if(t&&t.path&&t.path.length>0)if(Array.isArray(t.path))for(let r of t.path)gs.existsSync(r)&&(e=r.endsWith(".vault")?r:`${r}.vault`);else e=t.path.endsWith(".vault")?t.path:`${t.path}.vault`;else e=ys.resolve(process.cwd(),".env.vault");return gs.existsSync(e)?e:null}function nl(t){return t[0]==="~"?ys.join(vg.homedir(),t.slice(1)):t}function Dg(t){jg("Loading env from encrypted .env.vault");let e=Re._parseVault(t),r=process.env;return t&&t.processEnv!=null&&(r=t.processEnv),Re.populate(r,e,t),{parsed:e}}function Ng(t){let e=ys.resolve(process.cwd(),".env"),r="utf8",n=!!(t&&t.debug);t&&t.encoding?r=t.encoding:n&&to("No encoding is specified. UTF-8 is used by default");let o=[e];if(t&&t.path)if(!Array.isArray(t.path))o=[nl(t.path)];else{o=[];for(let c of t.path)o.push(nl(c))}let s,i={};for(let c of o)try{let l=Re.parse(gs.readFileSync(c,{encoding:r}));Re.populate(i,l,t)}catch(l){n&&to(`Failed to load ${c} ${l.message}`),s=l}let a=process.env;return t&&t.processEnv!=null&&(a=t.processEnv),Re.populate(a,i,t),s?{parsed:i,error:s}:{parsed:i}}function Lg(t){if(ol(t).length===0)return Re.configDotenv(t);let e=sl(t);return e?Re._configVault(t):(Tg(`You set DOTENV_KEY but you are missing a .env.vault file at ${e}. Did you forget to build it?`),Re.configDotenv(t))}function Mg(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=Pg.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",l=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(l){let u=new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw u.code="DECRYPTION_FAILED",u}else throw i}}function Fg(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&&to(o===!0?`"${s}" is already defined and WAS overwritten`:`"${s}" is already defined and was NOT overwritten`)):t[s]=e[s]}var Re={configDotenv:Ng,_configVault:Dg,_parseVault:Ig,config:Lg,decrypt:Mg,parse:_g,populate:Fg};Tt.exports.configDotenv=Re.configDotenv;Tt.exports._configVault=Re._configVault;Tt.exports._parseVault=Re._parseVault;Tt.exports.config=Re.config;Tt.exports.decrypt=Re.decrypt;Tt.exports.parse=Re.parse;Tt.exports.populate=Re.populate;Tt.exports=Re});var gu=B(li=>{"use strict";li.parse=zw;li.serialize=Gw;var Lw=Object.prototype.toString,Mw=Object.prototype.hasOwnProperty,Fw=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,Uw=/^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/,qw=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,Ww=/^[\u0020-\u003A\u003D-\u007E]*$/;function zw(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||Vw,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=du(t,s,i),l=hu(t,i,c),u=t.slice(c,l);if(!Mw.call(r,u)){var p=du(t,i+1,a),f=hu(t,a,p);t.charCodeAt(p)===34&&t.charCodeAt(f-1)===34&&(p++,f--);var d=t.slice(p,f);r[u]=Hw(d,o)}s=a+1}while(s<n);return r}function du(t,e,r){do{var n=t.charCodeAt(e);if(n!==32&&n!==9)return e}while(++e<r);return r}function hu(t,e,r){for(;e>r;){var n=t.charCodeAt(--e);if(n!==32&&n!==9)return e+1}return r}function Gw(t,e,r){var n=r&&r.encode||encodeURIComponent;if(typeof n!="function")throw new TypeError("option encode is invalid");if(!Fw.test(t))throw new TypeError("argument name is invalid");var o=n(e);if(!Uw.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(!qw.test(r.domain))throw new TypeError("option domain is invalid");s+="; Domain="+r.domain}if(r.path){if(!Ww.test(r.path))throw new TypeError("option path is invalid");s+="; Path="+r.path}if(r.expires){var a=r.expires;if(!Bw(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 l=typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite;switch(l){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 Vw(t){return t.indexOf("%")!==-1?decodeURIComponent(t):t}function Bw(t){return Lw.call(t)==="[object Date]"}function Hw(t,e){try{return e(t)}catch{return t}}});var Su=B((Rv,Sn)=>{"use strict";var Po={decodeValues:!0,map:!1,silent:!1};function pi(t){return typeof t=="string"&&!!t.trim()}function ui(t,e){var r=t.split(";").filter(pi),n=r.shift(),o=Yw(n),s=o.name,i=o.value;e=e?Object.assign({},Po,e):Po;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 l=c.split("="),u=l.shift().trimLeft().toLowerCase(),p=l.join("=");u==="expires"?a.expires=new Date(p):u==="max-age"?a.maxAge=parseInt(p,10):u==="secure"?a.secure=!0:u==="httponly"?a.httpOnly=!0:u==="samesite"?a.sameSite=p:u==="partitioned"?a.partitioned=!0:a[u]=p}),a}function Yw(t){var e="",r="",n=t.split("=");return n.length>1?(e=n.shift(),r=n.join("=")):r=t,{name:e,value:r}}function bu(t,e){if(e=e?Object.assign({},Po,e):Po,!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(pi).reduce(function(o,s){var i=ui(s,e);return o[i.name]=i,o},n)}else return t.filter(pi).map(function(o){return ui(o,e)})}function Kw(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 l(){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&&l();)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}Sn.exports=bu;Sn.exports.parse=bu;Sn.exports.parseString=ui;Sn.exports.splitCookiesString=Kw});var tl=It(eo(),1);import*as hs from"node:process";try{let t=zi?.node;typeof t=="string"&&!tl.satisfies(hs.version,t)&&g.warn(`
11
11
  \u26A0\uFE0F Warning: failed to satisfy expected node version. Expected: "${t}", Current "${hs.version}"
@@ -136,7 +136,7 @@ Eject that one and set the framework in your copy's default export:
136
136
  # then in generators/tanstack-query/index.ts: run: tanstackQueryGenerator('${n}')
137
137
  `);return}if(!Dr.has(r))throw ye.eject_generator_outcome="unknown-generator",new de(`
138
138
  \u274C Unknown generator "${r}". Ejectable generators: ${[...Dr].join(", ")}.
139
- `);let o=Wy(),s=zy(o,r),{GENERATOR_VERSION:i}=await import("./chunks/QKWUIMTP.js"),a=Fy(t.dir??"./generators"),c=s===void 0?oe(a,`${r}.mjs`):oe(a,r,"index.ts"),l=wt(process.cwd(),c)||c;if(t.update){if(s===void 0){let E=Ue(oe(o,"generators",`${r}.mjs`),"utf-8");Hy({name:r,asset:E,toolkitVersion:i,assetsDir:o,dir:a,target:c,printedTarget:l})}else By({name:r,files:s,toolkitVersion:i,assetsDir:o,dir:a,targetDir:oe(a,r)});return}if(Fe(c)&&!t.force)throw ye.eject_generator_outcome="already-exists",new de(`
139
+ `);let o=Wy(),s=zy(o,r),{GENERATOR_VERSION:i}=await import("./chunks/K732KQHY.js"),a=Fy(t.dir??"./generators"),c=s===void 0?oe(a,`${r}.mjs`):oe(a,r,"index.ts"),l=wt(process.cwd(),c)||c;if(t.update){if(s===void 0){let E=Ue(oe(o,"generators",`${r}.mjs`),"utf-8");Hy({name:r,asset:E,toolkitVersion:i,assetsDir:o,dir:a,target:c,printedTarget:l})}else By({name:r,files:s,toolkitVersion:i,assetsDir:o,dir:a,targetDir:oe(a,r)});return}if(Fe(c)&&!t.force)throw ye.eject_generator_outcome="already-exists",new de(`
140
140
  \u274C ${l} already exists. Use --update to merge the newer version in, or --force to overwrite.
141
141
  `);Ks(hn(c),{recursive:!0});let u=s===void 0?[Ue(oe(o,"generators",`${r}.mjs`),"utf-8")]:s.map(E=>Ue(oe(o,"generators",r,E),"utf-8"));s===void 0?Ae(c,u[0],"utf-8"):s.forEach((E,v)=>{Ae(oe(a,r,E),u[v],"utf-8")});let p=mp("client-generators",o),f=mp(`${r}-generator`,o);Js(a,Zs(a));let d=`./${wt(e.configPath===void 0?process.cwd():pp(hn(e.configPath)),pp(c)).split("\\").join("/")}`,w=Qs({[Je]:i}),h=u.some(E=>E.includes(`from "${Bs}"`)||E.includes(`from '${Bs}'`)),O=Vy(e.configPath,r,d),x=s===void 0?l:wt(process.cwd(),oe(a,r))+"/";g.info(`Ejected the "${r}" generator to ${x}.
142
142
  `+(w==="added"?`Added ${Je} to devDependencies (the ejected file imports its toolkit) \u2014 run your installer.
@@ -260,7 +260,7 @@ Run the generated workflows against the live API:
260
260
 
261
261
  npx @redocly/cli@latest respect ${e}${n}
262
262
 
263
- `+o}async function Ip({argv:t,config:e,version:r,collectSpecData:n}){let o=t["output-file"]||"auto-generated.arazzo.yaml",s,i=c=>{s=c.parsed,n?.(c)},a={outputFile:o,descriptionPath:t.descriptionPath,collectSpecData:i,version:r,config:e};try{let{generate:c}=await import("./chunks/KF7NA4HQ.js");g.info(fe(`
263
+ `+o}async function Ip({argv:t,config:e,version:r,collectSpecData:n}){let o=t["output-file"]||"auto-generated.arazzo.yaml",s,i=c=>{s=c.parsed,n?.(c)},a={outputFile:o,descriptionPath:t.descriptionPath,collectSpecData:i,version:r,config:e};try{let{generate:c}=await import("./chunks/6UH63WWT.js");g.info(fe(`
264
264
  Generating Arazzo description...
265
265
  `));let l=await c(a),u=at(l);if(t["with-ai"]){let p=t["ai-provider"];g.info(fe(`
266
266
  Designing workflows with AI provider "${p}"...
@@ -273,7 +273,7 @@ Run the generated workflows against the live API:
273
273
  \u274C Failed to generate Arazzo description. Check the output file path you provided, or the OpenAPI file content.`)}}import{readFileSync as mw}from"node:fs";import{mkdir as dw,writeFile as hw}from"node:fs/promises";import{basename as kp,dirname as ti,extname as Dp,isAbsolute as Np,relative as jp,resolve as dr}from"node:path";var gw=/^[a-z][a-z0-9+.-]+:/i;function Lp(t,e){let{setup:r}=t;if(typeof r!="string")return t;if(gw.test(r))throw new de(`
274
274
  \u274C \`client.setup\` must be a local file path \u2014 remote setup modules are not supported.
275
275
  Got: ${r}
276
- `);return Np(r)?t:{...t,setup:dr(e,r)}}function yw(t){return`${t.replace(/[\\/]/g,"_")}.client.ts`}function ww(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 Mp({argv:t,config:e}){let{AUTHORING_HELPER_NAMES:r,generateClient:n,mergeConfig:o}=await import("./chunks/QKWUIMTP.js"),s=e.configPath?ti(e.configPath):process.cwd(),i={serverUrl:t["server-url"],outputMode:t["output-mode"],runtime:t.runtime,importExt:t["import-ext"],goPackage:t["go-package"],argsStyle:t["args-style"],errorMode:t["error-mode"],dateType:t["date-type"],mockData:t["mock-data"],mockSeed:t["mock-seed"],docs:t.docs,generators:t.generator?.map(f=>f.startsWith(".")?dr(f):f),setup:t.setup===void 0?void 0:Lp({setup:t.setup},process.cwd()).setup},a=e.resolvedConfig.apis??{},c=Object.keys(a).filter(f=>I(a[f].client)||a[f].clientOutput!==void 0);if(t.api===void 0){if(t.output)throw new de("\n\u274C --output can't target multiple APIs. Set `clientOutput` under each api in redocly.yaml, or pass a single <api>.\n");if(c.length===0)throw new de("\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 l=await pt(t.api===void 0?c:[t.api],e),u={config:e,configDir:s,cliFlags:i,outputFlag:t.output,toolkit:{generateClient:n,mergeConfig:o,helperNames:r},seenOutputs:new Set,composable:[]};for(let f of l)await bw(f,u);let p=I(e.resolvedConfig.client)?e.resolvedConfig.client:{};p.cliOutput!==void 0&&t.api===void 0&&u.composable.length>0&&await Sw(p.cliOutput,u)}async function bw(t,{config:e,configDir:r,cliFlags:n,outputFlag:o,toolkit:s,seenOutputs:i,composable:a}){let{path:c,alias:l}=t,u=l??kp(c,Dp(c)),p=e.forAlias(l),{client:f,clientOutput:d}=p.resolvedConfig,w=Lp(I(f)?f:{},r),h=s.mergeConfig(w,n);Ew(h.generators??[],s.helperNames,r);let O=o!==void 0?dr(o):d!==void 0?dr(r,d):dr(r,yw(u));if(!O.endsWith(".ts"))throw new de(`
276
+ `);return Np(r)?t:{...t,setup:dr(e,r)}}function yw(t){return`${t.replace(/[\\/]/g,"_")}.client.ts`}function ww(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 Mp({argv:t,config:e}){let{AUTHORING_HELPER_NAMES:r,generateClient:n,mergeConfig:o}=await import("./chunks/K732KQHY.js"),s=e.configPath?ti(e.configPath):process.cwd(),i={serverUrl:t["server-url"],outputMode:t["output-mode"],runtime:t.runtime,importExt:t["import-ext"],goPackage:t["go-package"],argsStyle:t["args-style"],errorMode:t["error-mode"],dateType:t["date-type"],mockData:t["mock-data"],mockSeed:t["mock-seed"],docs:t.docs,generators:t.generator?.map(f=>f.startsWith(".")?dr(f):f),setup:t.setup===void 0?void 0:Lp({setup:t.setup},process.cwd()).setup},a=e.resolvedConfig.apis??{},c=Object.keys(a).filter(f=>I(a[f].client)||a[f].clientOutput!==void 0);if(t.api===void 0){if(t.output)throw new de("\n\u274C --output can't target multiple APIs. Set `clientOutput` under each api in redocly.yaml, or pass a single <api>.\n");if(c.length===0)throw new de("\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 l=await pt(t.api===void 0?c:[t.api],e),u={config:e,configDir:s,cliFlags:i,outputFlag:t.output,toolkit:{generateClient:n,mergeConfig:o,helperNames:r},seenOutputs:new Set,composable:[]};for(let f of l)await bw(f,u);let p=I(e.resolvedConfig.client)?e.resolvedConfig.client:{};p.cliOutput!==void 0&&t.api===void 0&&u.composable.length>0&&await Sw(p.cliOutput,u)}async function bw(t,{config:e,configDir:r,cliFlags:n,outputFlag:o,toolkit:s,seenOutputs:i,composable:a}){let{path:c,alias:l}=t,u=l??kp(c,Dp(c)),p=e.forAlias(l),{client:f,clientOutput:d}=p.resolvedConfig,w=Lp(I(f)?f:{},r),h=s.mergeConfig(w,n);Ew(h.generators??[],s.helperNames,r);let O=o!==void 0?dr(o):d!==void 0?dr(r,d):dr(r,yw(u));if(!O.endsWith(".ts"))throw new de(`
277
277
  \u274C output must point at a TypeScript file (ending in .ts).
278
278
  Got: ${O}
279
279
  `);if(i.has(O))throw new de(`
@@ -289,7 +289,7 @@ Run the generated workflows against the live API:
289
289
  `)}catch(x){let E=x instanceof Error?x.message:String(x);throw ot.generate_client_error_category=lp(E),new de(`
290
290
  \u274C Failed to generate client for ${u}.
291
291
  ${E}
292
- `)}}async function Sw(t,{configDir:e,seenOutputs:r,composable:n}){let{renderComposedCliEntry:o}=await import("./chunks/QPW3IML7.js"),s=dr(e,t);if(!s.endsWith(".ts"))throw new de(`
292
+ `)}}async function Sw(t,{configDir:e,seenOutputs:r,composable:n}){let{renderComposedCliEntry:o}=await import("./chunks/3A5KYQ7N.js"),s=dr(e,t);if(!s.endsWith(".ts"))throw new de(`
293
293
  \u274C client.cliOutput must point at a TypeScript file (ending in .ts).
294
294
  Got: ${s}
295
295
  `);if(r.has(s))throw new de(`
@@ -324,7 +324,7 @@ ${s} detected in project's 'package.json'`),o}catch{g.info(`Invalid 'package.jso
324
324
  `);if(E._compressed=/^(gzip|compress|deflate|br)$/.test(w.headers.get("content-encoding")||""),E.response.content||(E.response.content={size:-1}),E._compressed){let ue=await O.arrayBuffer();E.response.content.size=ue.byteLength}else E.response.content.size=x?Buffer.byteLength(x):-1;let U=x?Buffer.byteLength(x):-1;E.response={headers:bn(w.headers),cookies:Ou(w.headers),status:w.status,statusText:w.statusText||"",httpVersion:w.httpVersion?`HTTP/${w.httpVersion}`:"HTTP/1.1",redirectURL:w.headers.location||"",content:{size:E._compressed&&E.response.content.size!==-1?E.response.content.size:Buffer.byteLength(x),mimeType:w.headers.get("content-type")||"",text:x,compression:E._compressed&&E.response.content.size!==-1?E.response.content.size-U:0},bodySize:U,headersSize:$};let{_timestamps:L}=E;E.timings={blocked:Math.max(Ht(L.start,L.socket),.01),dns:-1,connect:Math.max(Ht(L.lookup,L.connect),-1),ssl:L.secureConnect?Math.max(Ht(L.connect,L.secureConnect),-1):-1,send:Ht(L.secureConnect||L.connect,L.sent),wait:Math.max(Ht(L.sent,L.firstByte),0),receive:Ht(L.firstByte,L.received)},E.time=Ht(L.start,L.received);let ne=[],Z=E;do{let ue=Z._parent;delete Z._parent,ue&&ne.unshift(ue),Z=ue}while(Z);return f.pageref=i||"page_1",ne.forEach(ue=>{ue.pageref=f.pageref}),w.harEntry=f,Array.isArray(s?.log?.entries)&&s.log.entries.push(...ne,f),a&&(ne.forEach(ue=>{a(ue)}),a(f)),w}};function xu(t){let e={};for(let r of t){let{executedWorkflows:n,globalTimeoutError:o,ctx:s,secretValues:i}=r;e[r.file]=ca({value:{totalRequests:r.totalRequests,executedWorkflows:n.map(a=>Cu(a)),totalTimeMs:r.totalTimeMs,globalTimeoutError:o,secretValues:i},noSecretsMasking:s.noSecretsMasking,secretsSet:s.secretsSet||new Set})}return e}function Cu(t){let{ctx:e,...r}=t,n=t.executedSteps.map(i=>Zw(i,t.workflowId,e)),o=qn([t]);return{...r,executedSteps:n,status:o.steps.failed>0?"error":o.steps.warnings>0?"warn":"success",totalRequests:o.totalRequests,totalTimeMs:t.totalTimeMs}}function Zw(t,e,r){if("executedSteps"in t)return Cu(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:Qw(o)})),totalTimeMs:n?.response?.time||0,retriesLeft:t.retriesLeft,status:eb(t.checks)}}function Qw(t){return t.passed?"success":t.severity==="error"?"error":"warn"}function eb(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 Wr from"node:fs";import*as vu from"node:path";function Pu(t={},e){let r={};for(let[n,o]of Object.entries(t))r[n]={clientCert:mi(o.clientCert,e),clientKey:mi(o.clientKey,e),caCert:mi(o.caCert,e)};return r}function mi(t,e){if(t)try{if(!(t.includes("-----BEGIN")&&t.includes("-----END"))){let n=vu.resolve(e,t);return Wr.accessSync(n,Wr.constants.R_OK),Wr.readFileSync(n,"utf-8")}return tb(t)}catch(r){throw new Error(`Failed to read certificate: ${r.message}`)}}function tb(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(`
325
325
  `)||"";return`${r}
326
326
  ${s}
327
- ${o}`}async function Ru({argv:t,config:e,version:r,collectSpecData:n}){let o,s;try{let{run:i,conditionallyMaskSecrets:a}=await import("./chunks/KF7NA4HQ.js"),c=e.configPath?ob(e.configPath):process.cwd();t.mtls&&(o=Pu(t.mtls,c));let l=lu(o);t["har-output"]&&(s=uu({version:r}),l=fi(l,{har:s}));let u=new St({http:{headers:e.resolve?.http?.headers??[],customFetch:l}}),p={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 O=>{if(!rb(O))throw new Error(`File ${O} doesn't exist or isn't readable.`);let x=nb(O);return new File([x],sb(O))}},envVariables:cu(c)||{},logger:g,fetch:l,externalRefResolver:u,noSecretsMasking:t["no-secrets-masking"]};if(p.skip&&p.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(p.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 f=performance.now(),d=await i(p);g.printNewLine(),pu(d,g),g.printNewLine();let w=d.some(O=>O.hasProblems),h=d.some(O=>O.hasWarnings);if(t["json-output"]){let O={files:xu(d),status:w?"error":h?"warn":"success",totalTime:performance.now()-f};$u(t["json-output"],ai(O,2),"utf-8"),g.output(Q(g.indent(`JSON logs saved in ${me(t["json-output"])}`,2))),g.printNewLine(),g.printNewLine()}if(t["har-output"])for(let O of d){let x=a({value:s,noSecretsMasking:O.ctx.noSecretsMasking,secretsSet:O.ctx.secretsSet||new Set});$u(t["har-output"],ai(x,2),"utf-8"),g.output(Q(`Har logs saved in ${me(t["har-output"])}`)),g.printNewLine(),g.printNewLine()}if(w)throw new Error(" Tests exited with error ")}catch(i){throw new de(i?.message??i)}}function Iu(t){if(Array.isArray(t)){let e={};for(let r of t)if(r&&typeof r=="string"){let n=_u(r);Object.assign(e,n)}return Object.keys(e).length>0?e:void 0}if(!(!t||typeof t!="string"))return _u(t)}function _u(t){try{let e=JSON.parse(t);if(!I(e))throw new Error("mTLS config must be an object mapping domains to certificate configurations");for(let[r,n]of Object.entries(e)){if(!I(n))throw new Error(`mTLS config for domain "${r}" must be an object`);di(n,"clientCert",r,!0),di(n,"clientKey",r,!0),di(n,"caCert",r,!1)}return e}catch(e){throw e instanceof SyntaxError?new Error(`Invalid JSON for --mtls option: ${e.message}`):e}}function di(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 xb}from"perf_hooks";var Rt={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},ju=new Set(["id","name","type","value","data","key","status","state","code","result","item","object","resource","entity","input","output","payload","body","content","info"]);function Ro(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 ib(t,e,r=Rt){let{thresholds:n,weights:o}=r,s=bt(1-t.parameterCount/(n.maxParamsGood*2)),a=Math.max(t.maxRequestSchemaDepth,t.maxResponseSchemaDepth)/(n.maxDepthGood*2),c=Tu(t,o.anyOfPenaltyMultiplier)/(n.maxPolymorphismGood*3),l=bt(1-a-c),u=(t.operationDescriptionPresent?1:0)+t.paramsWithDescription+t.schemaPropertiesWithDescription,p=1+t.parameterCount+t.totalSchemaProperties,f=p>0?bt(u/p):1,d=t.totalSchemaProperties>0?bt(t.constraintCount/t.totalSchemaProperties):1,w=(t.requestExamplePresent?1:0)+(t.responseExamplePresent?1:0),h=(t.requestBodyPresent?1:0)+1,O=bt(w/h),x=t.totalErrorResponses>0?bt(t.structuredErrorResponseCount/t.totalErrorResponses):1,E=bt(1-e/(n.maxDependencyDepthGood*2)),v=bt(1-t.ambiguousIdentifierCount/Math.max(n.maxAmbiguousGood+3,1)),A=Tu(t,o.anyOfPenaltyMultiplier),$=A===0?1:t.hasDiscriminator?bt(1-A/(n.maxPolymorphismGood*4)):bt(1-A/(n.maxPolymorphismGood*2));return{parameterSimplicity:s,schemaSimplicity:l,documentationQuality:f,constraintClarity:d,exampleCoverage:O,errorClarity:x,dependencyClarity:E,identifierClarity:v,polymorphismClarity:$}}function ab(t,e=Rt){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 Mu(bt(n)*100)}function ku(t,e,r=Rt){let n=new Map;for(let[o,s]of t.operations){let i=e.get(o)??0,a=ib(s,i,r);n.set(o,{agentReadiness:ab(a,r),subscores:a})}return n}function Du(t,e=Rt){return bt(1-t/e.thresholds.maxOperationsForDiscoverability)}function Nu(t,e,r=Rt){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:Mu(Ro(n)*(1-o)+s*o)}}function hi(t,e,r){return t-e+e*r}function Tu(t,e){return hi(t.polymorphismCount,t.anyOfCount,e)}function bt(t){return Math.max(0,Math.min(1,t))}function Lu(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 Mu(t){return Math.round(t*10)/10}function Fu(t,e,r){let n=Math.max(1,t);return e/n+r/n}function cb(t,e){return e.totalSchemaProperties>t.totalSchemaProperties?!0:e.totalSchemaProperties<t.totalSchemaProperties?!1:Fu(e.totalSchemaProperties,e.schemaPropertiesWithDescription,e.constraintCount)>Fu(t.totalSchemaProperties,t.schemaPropertiesWithDescription,t.constraintCount)}var lb=["enum","const","format","pattern","minimum","maximum","minLength","maxLength","minItems","maxItems","minProperties","maxProperties","multipleOf","exclusiveMinimum","exclusiveMaximum","uniqueItems"];function gi(){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 Wu(t){Object.assign(t,gi())}function zu(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 lb)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(I(e.properties)){let i=Object.entries(e.properties);t.totalSchemaProperties+=i.length;for(let[a,c]of i){s.push(a);let l=c&&"$ref"in c&&c.$ref?r.resolve(c)?.node??c:c;l?.description&&t.schemaPropertiesWithDescription++,(l?.example!==void 0||l?.examples)&&(t.hasPropertyExamples=!0),l?.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 Gu(t,e,r){return{operations:new Map,currentPath:"",pathLevelParams:[],current:null,walkSchema:t,anyOfPenaltyMultiplier:e,debugOperationId:r,debugLogs:[]}}function pb(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 ub(t){let{inRequestBody:e,inResponse:r,currentResponseCode:n,errorStructuredCounted:o,maxEffectivePolymorphism:s,...i}=t;return i}function Vu(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,qu(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&&(mb(e)&&(r.inRequestBody&&(r.requestExamplePresent=!0),r.inResponse&&(r.responseExamplePresent=!0)),r.inResponse&&qu(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);cb(r,o)&&(r.totalSchemaProperties=o.totalSchemaProperties,r.schemaPropertiesWithDescription=o.schemaPropertiesWithDescription,r.constraintCount=o.constraintCount);let s=hi(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=pb(t.currentPath,n,e);t.current=o;let s=fb(t.pathLevelParams,e.parameters??[],r.resolve);for(let i of s.values())o.parameterCount++,i.required&&o.requiredParameterCount++,i.description&&o.paramsWithDescription++,db(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,ub(r)),t.current=null}}}}}}function Bu(t){return{operationCount:t.operations.size,operations:t.operations}}function Uu(t,e){return e(t).node}function fb(t,e,r){let n=new Map;for(let o of t){let s=Uu(o,r);s?.name&&s.in&&n.set(`${s.in}:${s.name}`,s)}for(let o of e){let s=Uu(o,r);s?.name&&s.in&&n.set(`${s.in}:${s.name}`,s)}return n}function mb(t){return t.example!==void 0||$i(t.examples)}function db(t){if(t.description)return!1;let e=(t.name??"").toLowerCase();return ju.has(e)}function qu(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 hb(t,e){if(!e.startsWith("#/"))return;let r=t;for(let n of e.slice(2).split("/"))r=r?.[ji(n)];return r}function Hu({document:t,types:e,resolvedRefMap:r,ctx:n,debugOperationId:o,scoringConstants:s}){let i=s?.weights.anyOfPenaltyMultiplier??Rt.weights.anyOfPenaltyMultiplier,a=gi(),c=zu(a),l=Qr([{severity:"warn",ruleId:"score-schema",visitor:c}],e),u=(v,A)=>{Wu(a),A&&(a.debugEntries=[]),en({document:{...t,parsed:v},rootType:e.Schema,normalizedVisitors:l,resolvedRefMap:r,ctx:n});let{depth:$,pendingRef:U,debugEntries:L,...ne}=a;return{...ne,refsUsed:[...a.refsUsed],debugEntries:A?a.debugEntries??void 0:void 0}},p=new Map,f=new WeakSet,d={maxDepth:0,polymorphismCount:0,anyOfCount:0,hasDiscriminator:!1,totalSchemaProperties:0,schemaPropertiesWithDescription:0,constraintCount:0,hasPropertyExamples:!1,writableTopLevelFields:0,refsUsed:[]};function w(v,A){return{maxDepth:Math.max(v.maxDepth,A.maxDepth),polymorphismCount:v.polymorphismCount+A.polymorphismCount,anyOfCount:v.anyOfCount+A.anyOfCount,hasDiscriminator:v.hasDiscriminator||A.hasDiscriminator,totalSchemaProperties:v.totalSchemaProperties+A.totalSchemaProperties,schemaPropertiesWithDescription:v.schemaPropertiesWithDescription+A.schemaPropertiesWithDescription,constraintCount:v.constraintCount+A.constraintCount,hasPropertyExamples:v.hasPropertyExamples||A.hasPropertyExamples,writableTopLevelFields:v.writableTopLevelFields+A.writableTopLevelFields,refsUsed:[...v.refsUsed,...A.refsUsed],debugEntries:v.debugEntries||A.debugEntries?[...v.debugEntries??[],...A.debugEntries??[]]:void 0}}let h=(v,A=!1)=>{let $=v,U=Ne(v)?v.$ref:void 0;if(U){if(!A){let K=p.get(U);if(K)return K}$=hb(t.parsed,U)??v}if(I($)&&f.has($))return{...d};I($)&&f.add($);let L=$?.oneOf,ne=$?.anyOf,Z=Array.isArray(L)&&L.length>1,ue=Array.isArray(ne)&&ne.length>1,R=Z||ue,P=Array.isArray($?.allOf)&&$.allOf.length>0,M=$?.discriminator,W=!R&&I(M?.mapping)?Object.values(M.mapping).filter(K=>typeof K=="string"&&ki(K)).map(K=>({$ref:K})):null,se=Array.isArray(W)&&W.length>0,re;if(R||P||se){let K={...$},le=null,ke=_e=>{le=le?w(le,_e):_e},pe=(_e,it)=>{let q=h(it[0],A);for(let ce=1;ce<it.length;ce++){let ie=h(it[ce],A);ie.totalSchemaProperties>q.totalSchemaProperties&&(q=ie)}return{...q,polymorphismCount:q.polymorphismCount+it.length,anyOfCount:q.anyOfCount+(_e==="anyOf"?it.length:0),hasDiscriminator:q.hasDiscriminator||!!M}};R&&delete K.discriminator,Z&&(delete K.oneOf,ke(pe("oneOf",L))),ue&&(delete K.anyOf,ke(pe("anyOf",ne)));let Ze=null;if(se){delete K.discriminator;let _e=h(W[0],A);for(let it=1;it<W.length;it++){let q=h(W[it],A);q.totalSchemaProperties>_e.totalSchemaProperties&&(_e=q)}Ze={..._e,polymorphismCount:_e.polymorphismCount+W.length,hasDiscriminator:!0}}let st=null;if(P){delete K.allOf,st={...d};for(let _e of $.allOf)st=w(st,h(_e,A));st.polymorphismCount+=$.allOf.length}re=u(K,A),st&&(re=w(re,st)),le&&(re=w(re,le)),Ze&&(re=w(re,Ze)),U&&(re={...re,refsUsed:[U,...re.refsUsed]})}else re=u(v,A);return I($)&&f.delete($),U&&!A&&p.set(U,re),re},O=Gu(h,i,o),x=Vu(O),E=Qr([{severity:"warn",ruleId:"score",visitor:x}],e);return en({document:t,rootType:e.Root,normalizedVisitors:E,resolvedRefMap:r,ctx:n}),{metrics:Bu(O),debugLogs:O.debugLogs}}function Yu(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=gb(o,r);n.set(o,s)}return n}function gb(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 Ku(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};g.output(JSON.stringify(e,null,2))}function Ju(t,e=!1){yb(t),wb(t),Sb(t),e&&Eb(t),Ob(t)}function Xu(t){return t>=80?me:t>=50?te:qe}function Zu(t){return Xu(t)(Ee(t.toFixed(1)))}function Y(t){g.output(t+`
327
+ ${o}`}async function Ru({argv:t,config:e,version:r,collectSpecData:n}){let o,s;try{let{run:i,conditionallyMaskSecrets:a}=await import("./chunks/6UH63WWT.js"),c=e.configPath?ob(e.configPath):process.cwd();t.mtls&&(o=Pu(t.mtls,c));let l=lu(o);t["har-output"]&&(s=uu({version:r}),l=fi(l,{har:s}));let u=new St({http:{headers:e.resolve?.http?.headers??[],customFetch:l}}),p={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 O=>{if(!rb(O))throw new Error(`File ${O} doesn't exist or isn't readable.`);let x=nb(O);return new File([x],sb(O))}},envVariables:cu(c)||{},logger:g,fetch:l,externalRefResolver:u,noSecretsMasking:t["no-secrets-masking"]};if(p.skip&&p.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(p.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 f=performance.now(),d=await i(p);g.printNewLine(),pu(d,g),g.printNewLine();let w=d.some(O=>O.hasProblems),h=d.some(O=>O.hasWarnings);if(t["json-output"]){let O={files:xu(d),status:w?"error":h?"warn":"success",totalTime:performance.now()-f};$u(t["json-output"],ai(O,2),"utf-8"),g.output(Q(g.indent(`JSON logs saved in ${me(t["json-output"])}`,2))),g.printNewLine(),g.printNewLine()}if(t["har-output"])for(let O of d){let x=a({value:s,noSecretsMasking:O.ctx.noSecretsMasking,secretsSet:O.ctx.secretsSet||new Set});$u(t["har-output"],ai(x,2),"utf-8"),g.output(Q(`Har logs saved in ${me(t["har-output"])}`)),g.printNewLine(),g.printNewLine()}if(w)throw new Error(" Tests exited with error ")}catch(i){throw new de(i?.message??i)}}function Iu(t){if(Array.isArray(t)){let e={};for(let r of t)if(r&&typeof r=="string"){let n=_u(r);Object.assign(e,n)}return Object.keys(e).length>0?e:void 0}if(!(!t||typeof t!="string"))return _u(t)}function _u(t){try{let e=JSON.parse(t);if(!I(e))throw new Error("mTLS config must be an object mapping domains to certificate configurations");for(let[r,n]of Object.entries(e)){if(!I(n))throw new Error(`mTLS config for domain "${r}" must be an object`);di(n,"clientCert",r,!0),di(n,"clientKey",r,!0),di(n,"caCert",r,!1)}return e}catch(e){throw e instanceof SyntaxError?new Error(`Invalid JSON for --mtls option: ${e.message}`):e}}function di(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 xb}from"perf_hooks";var Rt={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},ju=new Set(["id","name","type","value","data","key","status","state","code","result","item","object","resource","entity","input","output","payload","body","content","info"]);function Ro(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 ib(t,e,r=Rt){let{thresholds:n,weights:o}=r,s=bt(1-t.parameterCount/(n.maxParamsGood*2)),a=Math.max(t.maxRequestSchemaDepth,t.maxResponseSchemaDepth)/(n.maxDepthGood*2),c=Tu(t,o.anyOfPenaltyMultiplier)/(n.maxPolymorphismGood*3),l=bt(1-a-c),u=(t.operationDescriptionPresent?1:0)+t.paramsWithDescription+t.schemaPropertiesWithDescription,p=1+t.parameterCount+t.totalSchemaProperties,f=p>0?bt(u/p):1,d=t.totalSchemaProperties>0?bt(t.constraintCount/t.totalSchemaProperties):1,w=(t.requestExamplePresent?1:0)+(t.responseExamplePresent?1:0),h=(t.requestBodyPresent?1:0)+1,O=bt(w/h),x=t.totalErrorResponses>0?bt(t.structuredErrorResponseCount/t.totalErrorResponses):1,E=bt(1-e/(n.maxDependencyDepthGood*2)),v=bt(1-t.ambiguousIdentifierCount/Math.max(n.maxAmbiguousGood+3,1)),A=Tu(t,o.anyOfPenaltyMultiplier),$=A===0?1:t.hasDiscriminator?bt(1-A/(n.maxPolymorphismGood*4)):bt(1-A/(n.maxPolymorphismGood*2));return{parameterSimplicity:s,schemaSimplicity:l,documentationQuality:f,constraintClarity:d,exampleCoverage:O,errorClarity:x,dependencyClarity:E,identifierClarity:v,polymorphismClarity:$}}function ab(t,e=Rt){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 Mu(bt(n)*100)}function ku(t,e,r=Rt){let n=new Map;for(let[o,s]of t.operations){let i=e.get(o)??0,a=ib(s,i,r);n.set(o,{agentReadiness:ab(a,r),subscores:a})}return n}function Du(t,e=Rt){return bt(1-t/e.thresholds.maxOperationsForDiscoverability)}function Nu(t,e,r=Rt){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:Mu(Ro(n)*(1-o)+s*o)}}function hi(t,e,r){return t-e+e*r}function Tu(t,e){return hi(t.polymorphismCount,t.anyOfCount,e)}function bt(t){return Math.max(0,Math.min(1,t))}function Lu(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 Mu(t){return Math.round(t*10)/10}function Fu(t,e,r){let n=Math.max(1,t);return e/n+r/n}function cb(t,e){return e.totalSchemaProperties>t.totalSchemaProperties?!0:e.totalSchemaProperties<t.totalSchemaProperties?!1:Fu(e.totalSchemaProperties,e.schemaPropertiesWithDescription,e.constraintCount)>Fu(t.totalSchemaProperties,t.schemaPropertiesWithDescription,t.constraintCount)}var lb=["enum","const","format","pattern","minimum","maximum","minLength","maxLength","minItems","maxItems","minProperties","maxProperties","multipleOf","exclusiveMinimum","exclusiveMaximum","uniqueItems"];function gi(){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 Wu(t){Object.assign(t,gi())}function zu(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 lb)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(I(e.properties)){let i=Object.entries(e.properties);t.totalSchemaProperties+=i.length;for(let[a,c]of i){s.push(a);let l=c&&"$ref"in c&&c.$ref?r.resolve(c)?.node??c:c;l?.description&&t.schemaPropertiesWithDescription++,(l?.example!==void 0||l?.examples)&&(t.hasPropertyExamples=!0),l?.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 Gu(t,e,r){return{operations:new Map,currentPath:"",pathLevelParams:[],current:null,walkSchema:t,anyOfPenaltyMultiplier:e,debugOperationId:r,debugLogs:[]}}function pb(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 ub(t){let{inRequestBody:e,inResponse:r,currentResponseCode:n,errorStructuredCounted:o,maxEffectivePolymorphism:s,...i}=t;return i}function Vu(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,qu(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&&(mb(e)&&(r.inRequestBody&&(r.requestExamplePresent=!0),r.inResponse&&(r.responseExamplePresent=!0)),r.inResponse&&qu(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);cb(r,o)&&(r.totalSchemaProperties=o.totalSchemaProperties,r.schemaPropertiesWithDescription=o.schemaPropertiesWithDescription,r.constraintCount=o.constraintCount);let s=hi(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=pb(t.currentPath,n,e);t.current=o;let s=fb(t.pathLevelParams,e.parameters??[],r.resolve);for(let i of s.values())o.parameterCount++,i.required&&o.requiredParameterCount++,i.description&&o.paramsWithDescription++,db(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,ub(r)),t.current=null}}}}}}function Bu(t){return{operationCount:t.operations.size,operations:t.operations}}function Uu(t,e){return e(t).node}function fb(t,e,r){let n=new Map;for(let o of t){let s=Uu(o,r);s?.name&&s.in&&n.set(`${s.in}:${s.name}`,s)}for(let o of e){let s=Uu(o,r);s?.name&&s.in&&n.set(`${s.in}:${s.name}`,s)}return n}function mb(t){return t.example!==void 0||$i(t.examples)}function db(t){if(t.description)return!1;let e=(t.name??"").toLowerCase();return ju.has(e)}function qu(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 hb(t,e){if(!e.startsWith("#/"))return;let r=t;for(let n of e.slice(2).split("/"))r=r?.[ji(n)];return r}function Hu({document:t,types:e,resolvedRefMap:r,ctx:n,debugOperationId:o,scoringConstants:s}){let i=s?.weights.anyOfPenaltyMultiplier??Rt.weights.anyOfPenaltyMultiplier,a=gi(),c=zu(a),l=Qr([{severity:"warn",ruleId:"score-schema",visitor:c}],e),u=(v,A)=>{Wu(a),A&&(a.debugEntries=[]),en({document:{...t,parsed:v},rootType:e.Schema,normalizedVisitors:l,resolvedRefMap:r,ctx:n});let{depth:$,pendingRef:U,debugEntries:L,...ne}=a;return{...ne,refsUsed:[...a.refsUsed],debugEntries:A?a.debugEntries??void 0:void 0}},p=new Map,f=new WeakSet,d={maxDepth:0,polymorphismCount:0,anyOfCount:0,hasDiscriminator:!1,totalSchemaProperties:0,schemaPropertiesWithDescription:0,constraintCount:0,hasPropertyExamples:!1,writableTopLevelFields:0,refsUsed:[]};function w(v,A){return{maxDepth:Math.max(v.maxDepth,A.maxDepth),polymorphismCount:v.polymorphismCount+A.polymorphismCount,anyOfCount:v.anyOfCount+A.anyOfCount,hasDiscriminator:v.hasDiscriminator||A.hasDiscriminator,totalSchemaProperties:v.totalSchemaProperties+A.totalSchemaProperties,schemaPropertiesWithDescription:v.schemaPropertiesWithDescription+A.schemaPropertiesWithDescription,constraintCount:v.constraintCount+A.constraintCount,hasPropertyExamples:v.hasPropertyExamples||A.hasPropertyExamples,writableTopLevelFields:v.writableTopLevelFields+A.writableTopLevelFields,refsUsed:[...v.refsUsed,...A.refsUsed],debugEntries:v.debugEntries||A.debugEntries?[...v.debugEntries??[],...A.debugEntries??[]]:void 0}}let h=(v,A=!1)=>{let $=v,U=Ne(v)?v.$ref:void 0;if(U){if(!A){let K=p.get(U);if(K)return K}$=hb(t.parsed,U)??v}if(I($)&&f.has($))return{...d};I($)&&f.add($);let L=$?.oneOf,ne=$?.anyOf,Z=Array.isArray(L)&&L.length>1,ue=Array.isArray(ne)&&ne.length>1,R=Z||ue,P=Array.isArray($?.allOf)&&$.allOf.length>0,M=$?.discriminator,W=!R&&I(M?.mapping)?Object.values(M.mapping).filter(K=>typeof K=="string"&&ki(K)).map(K=>({$ref:K})):null,se=Array.isArray(W)&&W.length>0,re;if(R||P||se){let K={...$},le=null,ke=_e=>{le=le?w(le,_e):_e},pe=(_e,it)=>{let q=h(it[0],A);for(let ce=1;ce<it.length;ce++){let ie=h(it[ce],A);ie.totalSchemaProperties>q.totalSchemaProperties&&(q=ie)}return{...q,polymorphismCount:q.polymorphismCount+it.length,anyOfCount:q.anyOfCount+(_e==="anyOf"?it.length:0),hasDiscriminator:q.hasDiscriminator||!!M}};R&&delete K.discriminator,Z&&(delete K.oneOf,ke(pe("oneOf",L))),ue&&(delete K.anyOf,ke(pe("anyOf",ne)));let Ze=null;if(se){delete K.discriminator;let _e=h(W[0],A);for(let it=1;it<W.length;it++){let q=h(W[it],A);q.totalSchemaProperties>_e.totalSchemaProperties&&(_e=q)}Ze={..._e,polymorphismCount:_e.polymorphismCount+W.length,hasDiscriminator:!0}}let st=null;if(P){delete K.allOf,st={...d};for(let _e of $.allOf)st=w(st,h(_e,A));st.polymorphismCount+=$.allOf.length}re=u(K,A),st&&(re=w(re,st)),le&&(re=w(re,le)),Ze&&(re=w(re,Ze)),U&&(re={...re,refsUsed:[U,...re.refsUsed]})}else re=u(v,A);return I($)&&f.delete($),U&&!A&&p.set(U,re),re},O=Gu(h,i,o),x=Vu(O),E=Qr([{severity:"warn",ruleId:"score",visitor:x}],e);return en({document:t,rootType:e.Root,normalizedVisitors:E,resolvedRefMap:r,ctx:n}),{metrics:Bu(O),debugLogs:O.debugLogs}}function Yu(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=gb(o,r);n.set(o,s)}return n}function gb(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 Ku(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};g.output(JSON.stringify(e,null,2))}function Ju(t,e=!1){yb(t),wb(t),Sb(t),e&&Eb(t),Ob(t)}function Xu(t){return t>=80?me:t>=50?te:qe}function Zu(t){return Xu(t)(Ee(t.toFixed(1)))}function Y(t){g.output(t+`
328
328
  `)}function yb(t){Y(""),Y(Ee(Ge(" Scores"))),Y(""),Y(` Agent Readiness: ${Zu(t.agentReadiness)}/100`),Y("")}function wb(t){Y(Ee(Ge(" Subscores"))),Y("");let e=t.subscores;_t("Parameter Simplicity",e.parameterSimplicity),_t("Schema Simplicity",e.schemaSimplicity),_t("Documentation Quality",e.documentationQuality),_t("Constraint Clarity",e.constraintClarity),_t("Example Coverage",e.exampleCoverage),_t("Error Clarity",e.errorClarity),_t("Dependency Clarity",e.dependencyClarity),_t("Identifier Clarity",e.identifierClarity),_t("Polymorphism Clarity",e.polymorphismClarity),_t("Discoverability",t.discoverability),Y("")}function _t(t,e){let r=Math.round(e*100),n=bb(e);Y(` ${t.padEnd(24)} ${n} ${Xu(r)(r+"%")}`)}function bb(t){let r=Math.round(t*20);return we("["+"\u2588".repeat(r)+"\u2591".repeat(20-r)+"]")}function Sb(t){if(Y(Ee(Ge(" Raw Metrics Summary"))),Y(""),Y(` Total operations: ${t.rawMetrics.operationCount}`),t.rawMetrics.operationCount===0){Y("");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 l(u,p){let d=(p.reduce((x,E)=>x+E,0)/c).toFixed(1),w=Ro(p).toFixed(1),h=Math.min(...p),O=Math.max(...p);Y(` ${u.padEnd(26)} avg ${d.padStart(6)} median ${w.padStart(6)} min ${String(h).padStart(5)} max ${String(O).padStart(5)}`)}l("Parameters/operation:",e),l("Schema depth:",r),l("Polymorphism/operation:",n),l("Properties/operation:",o),Y(` Operations with request examples: ${s}/${c} (${yi(s,c)})`),Y(` Operations with response examples: ${i}/${c} (${yi(i,c)})`),Y(` Operations with description: ${a}/${c} (${yi(a,c)})`),Y("")}function yi(t,e){return e>0?`${Math.round(t/e*100)}%`:"N/A"}function Eb(t){Y(Ee(Ge(" Per-Operation Metrics"))),Y("");let e=" "+"Operation".padEnd(50)+"Props".padStart(7)+"Poly".padStart(7)+"Depth".padStart(7)+"Params".padStart(8)+"Constr".padStart(8);Y(we(e)),Y(we(" "+"\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);Y(i)}Y("")}function Qu(t,e){if(Y(""),Y(Ee(Ge(` Debug: ${t} schema breakdown`))),Y(""),e.length===0){Y(te(` No schemas found for operation "${t}".`)),Y(te(' Make sure the value matches an operationId or "METHOD /path" exactly.')),Y("");return}for(let r of e){Y(Ee(we(` ${r.context}`))),Y(we(" "+"\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,l=` ${a}${i}`;c>0&&(l+=` (${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&&(l+=` [${u.join(", ")}]`),s.constraintCount>0&&(l+=` {${s.constraintCount} constraints}`),Y(l),c>0&&c<=20)Y(` ${a} properties: ${s.propertyNames.join(", ")}`);else if(c>20){let p=s.propertyNames.slice(0,15).join(", ");Y(` ${a} properties: ${p}, ... +${c-15} more`)}}Y(""),Y(` 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){Y(""),Y(Ee(" Top schemas by property count:"));for(let[s,i]of o)Y(` ${s}: ${i.totalProps} properties`)}Y("")}}function Ob(t){if(t.hotspots.length===0){Y(Ee(Ge(" No hotspot operations found."))),Y("");return}Y(Ee(Ge(` Top ${t.hotspots.length} Hotspot Operations`))),Y("");for(let e of t.hotspots){let r=e.operationId?`${e.method.toUpperCase()} ${e.path} (${e.operationId})`:`${e.method.toUpperCase()} ${e.path}`;Y(Ee(` ${r}`)),Y(` Agent Readiness: ${Zu(e.agentReadinessScore)}`);for(let n of e.reasons)Y(te(` - ${n}`));Y("")}}function ef(t,e,r,n=Rt){let o=[];for(let[s,i]of e){let a=t.operations.get(s);if(!a)continue;let c=Ab(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 Ab(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 tf({argv:t,config:e,collectSpecData:r}){let[{path:n}]=await pt(t.api?[t.api]:[],e),o=new St(e.resolve),{bundle:s}=await xr({config:e,ref:n});r?.(s);let i=Et(s.parsed);if(Ar(i)!=="oas3")return G(`The score command currently supports only OpenAPI 3.x. Detected: ${i}`);let a=xb.now(),c=vn(e.extendTypes(Or(i),i),e),l=await Pn({rootDocument:s,rootType:c.Root,externalRefResolver:o}),u=t["debug-operation-id"],{metrics:p,debugLogs:f}=Hu({document:s,types:c,resolvedRefMap:l,ctx:{problems:[],specVersion:i,config:e,visitorsData:{}},debugOperationId:u}),d=Yu(p.operations),w=ku(p,d),h=Du(p.operationCount),{agentReadiness:O}=Nu(w,h),x=ef(p,w,d),E={agentReadiness:O,discoverability:h,subscores:Lu(w),rawMetrics:p,hotspots:x,operationScores:w,dependencyDepths:d};Cb(E,n,a,t.format,!!t["operation-details"],u?{operationId:u,logs:f}:void 0)}function Cb(t,e,r,n,o,s){g.info(`Document: ${ct(e)} score:
329
329
  `),n==="json"?Ku(t):Ju(t,o),s&&Qu(s.operationId,s.logs),Qe("score",r,e)}async function rf(t,e=!1){let r=Cr(t,t.resolvedConfig?.residency),n=new tn,o=await n.getAccessToken(r);if(o)return e&&g.info(`Using existing access token.
330
330
  `),o;e&&g.warn(`No valid access token found or refresh token expired. Attempting login...
@@ -462,12 +462,12 @@ ${ct(`${nn(r)} URL`)}: ${we(e||"No URL yet.")}`;default:{let o=`${te(`No status
462
462
  `),await Uo({argv:{organization:o,project:s,pushId:$,wait:!0,domain:c,"max-execution-time":d,"start-time":n,"continue-on-deploy-failures":t["continue-on-deploy-failures"]},config:e,version:lt})),a&&Qe(x,r,`${De("file",O.length)} uploaded to organization ${o}, project ${s}. Push ID: ${$}.`),E.reportSunsetWarnings(),{pushId:$}}catch(l){Fo("\u2717 File upload failed.",l)}}function Bb(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 Hb(t){let e={};for(let n of t)if(Er.statSync(n).isDirectory()){let o=n;em(o,[]).forEach(i=>r(i,o))}else r(n,Jt.dirname(n));function r(n,o){let s=Jt.relative(o,n);e[s]&&g.warn(`File ${e[s]} is overwritten by ${n}
463
463
  `),e[s]=n}return Object.entries(e).map(([n,o])=>Yb(n,o))}function Yb(t,e){return{name:t,path:Jt.resolve(e)}}function em(t,e){let r=Er.readdirSync(t);for(let n of r){let o=Jt.join(t,n);Er.statSync(o).isDirectory()?e=em(o,e):e.push(o)}return e}var tm=It(eo(),1);import{existsSync as Kb,writeFileSync as Jb,readFileSync as Xb,statSync as Zb}from"node:fs";import{tmpdir as Ei}from"node:os";import{join as Oi}from"node:path";import*as xn from"node:process";var Ai="redocly-cli-version",qo=4,Qb=1e3*60*60*12,rm=xn.env.NODE_ENV==="test"||xn.env.CI||!!xn.env.LAMBDA_TASK_ROOT||xn.env.REDOCLY_SUPPRESS_UPDATE_NOTICE==="true",nm=()=>{if(!rm)try{let t=Xb(Oi(Ei(),Ai)).toString();eS(lt,t)&&rS(lt,t)}catch{return}},eS=(t,e)=>(0,tm.compare)(t,e)<0,tS=async t=>{let e=`http://registry.npmjs.org/${t}/latest`;try{return(await(await Tn(e,{timeout:jn})).json()).version}catch{return}},om=()=>{!oS()||rm||tS(Wi).then(t=>{if(t){let e=Oi(Ei(),Ai);Jb(e,t)}}).catch(()=>{})},rS=(t,e)=>{let r=[`A new version of ${we("Redocly CLI")} (${me(e)}) is available.`,`Update now: \`${we("npm i -g @redocly/cli@latest")}\`.`,"Changelog: https://redocly.com/docs/cli/changelog/"],n=Math.max(...r.map(a=>Yo(a).length)),o=te("\u2550".repeat(n+qo)),s=" ".repeat(qo),i=["",s+te("\u2554"+o+"\u2557"),s+te("\u2551"+" ".repeat(n+qo)+"\u2551"),r.map(nS(n,s)).join(`
464
464
  `),s+te("\u2551"+" ".repeat(n+qo)+"\u2551"),s+te("\u255A"+o+"\u255D"),"",""].join(`
465
- `);g.info(i)},nS=(t,e)=>r=>{let n=" ".repeat(t-Yo(r).length);return`${e}${te("\u2551")} ${r}${n} ${te("\u2551")}`},oS=()=>{try{let t=Oi(Ei(),Ai);if(!Kb(t))return!0;let e=new Date().getTime(),n=Zb(t).mtime.getTime();return e-n>=Qb}catch{return!1}};function sm(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 Xt(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 sS}from"node:child_process";import*as Xr from"node:fs";import{existsSync as iS,writeFileSync as aS,readFileSync as cS}from"node:fs";import*as am from"node:os";import{tmpdir as cm}from"node:os";import{join as lm}from"node:path";async function im(t=jn){try{return await Tn(Gi,{timeout:t}),!0}catch{return!1}}var Wo="***";async function pm({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:l,lint_rules_with_errors:u,lint_rules_with_warnings:p,lint_rules_with_ignored_problems:f,generate_client:d,eject_generator:w}){try{if(!e||!await im(1e3))return;let{_:[O],$0:x,...E}=e,{RedoclyOAuthClient:v}=await import("./chunks/WPSBZRFR.js"),A=new v,$=Cr(t,E.residency),U=await A.isAuthorized($),L=hS();L||(L=`ann_${pa()}`,dS(L));let ne=Ar(o),Z=[{id:O,object:"command",uri:`urn:redocly:cli:command:${O}`,logged_in:U?"yes":"no",command:O,...fS(E,process.argv.slice(2)),node_version:process.version,npm_version:mS(),version:lt,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:ne==="arazzo1"&&a?.length?JSON.stringify(a):void 0,respect_source_description_types:ne==="arazzo1"&&c?.length?JSON.stringify(c):void 0,respect_criterion_object_types:ne==="arazzo1"&&l?.length?JSON.stringify(l):void 0,lint_rules_with_errors:u?.length?JSON.stringify(u):void 0,lint_rules_with_warnings:p?.length?JSON.stringify(p):void 0,lint_rules_with_ignored_problems:f?.length?JSON.stringify(f):void 0,generate_client_builtin_generators:d?.generate_client_builtin_generators?.length?JSON.stringify(d.generate_client_builtin_generators):void 0,generate_client_custom_generators_count:d?.generate_client_custom_generators_count,generate_client_toolkit_imports:d?.generate_client_toolkit_imports?.length?JSON.stringify(d.generate_client_toolkit_imports):void 0,generate_client_error_category:d?.generate_client_error_category,generate_client_ejected_generators:d?.generate_client_ejected_generators?.length?JSON.stringify(d.generate_client_ejected_generators):void 0,generate_client_composed_apis_count:d?.generate_client_composed_apis_count,eject_generator_action:w?.eject_generator_action,eject_generator_name:w?.eject_generator_name,eject_generator_outcome:w?.eject_generator_outcome,eject_generator_conflicts:w?.eject_generator_conflicts,eject_generator_from_version:w?.eject_generator_from_version,eject_generator_to_version:w?.eject_generator_to_version}],ue=la.mapToCloudEvent({type:"com.redocly.command.ran",source:"urn:redocly:cli",origin:"redocly-cli",env:"production",osPlatform:am.platform(),actor:{id:L,object:"user",uri:""},category:"product",data:Z}),{otelTelemetry:R}=await import("./chunks/MXZKXUIJ.js");R.send(ue)}catch{}}function um(t,e){for(let r of t.sourceDescriptions??[])r.type&&e.add(r.type)}function fm(t,e){for(let r of t.workflows??[]){Jr(r.successActions,e),Jr(r.failureActions,e);for(let n of r.steps??[])mm(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??[])mm(r.criteria,e)}function mm(t,e){for(let r of t??[]){let n=lS(r);n&&e.add(n)}}function lS(t){let e=t.type;return typeof e=="string"?e:e?.type||(t.condition?"simple":void 0)}function dm(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 pS(t){return Xr.existsSync(t)&&Xr.statSync(t).isFile()}function uS(t){return Xr.existsSync(t)&&Xr.statSync(t).isDirectory()}function xi(t){return t&&(Ti(t)?t.split("://")[0]+"://url":pS(t)?t.replace(/.+\.([^.]+)$/,(e,r)=>"file-"+r):uS(t)?"folder":t)}function Ci(t,e,r){let n=Array.isArray(e)?e:[e];for(let o of n)o.length>1&&(t=t.replaceAll(o,r));return t}function hm(t,e){let r={};for(let[n,o]of Object.entries(t))e.includes(n)?r[n]=Wo:I(o)?r[n]=hm(o,e):r[n]=o;return r}function vi(t,e,r=[]){if(Array.isArray(t))return t.forEach(n=>vi(n,e,r)),r;if(I(t))for(let[n,o]of Object.entries(t))e.includes(n)&&typeof o=="string"?r.push(o):(I(o)||Array.isArray(o))&&vi(o,e,r);return r}function fS(t,e){let r=["organization","o","input","i","author","a","clientCert","clientKey","caCert","server","S"],n=e.join(" "),o={};for(let[s,i]of Object.entries(t))if(r.includes(s))o[s]=Wo,n=Ci(n,i,Wo);else if(typeof i=="string"){let a=xi(i);o[s]=a,n=Ci(n,i,a)}else if(Array.isArray(i)){o[s]=i.map(xi);for(let a of i){let c=xi(a);n.includes(a)&&(n=n.replaceAll(a,c))}}else if(I(i)){let a=vi(i,r);for(let c of a)n=Ci(n,c,Wo);o[s]=hm(i,r)}else o[s]=i;return{arguments:JSON.stringify(o),raw_input:n}}function mS(){try{return sS("npm -v",{stdio:["ignore","pipe","ignore"]}).toString().trim()}catch{return"unknown"}}var dS=t=>{if(!(process.env.CI||!t))try{let r=lm(cm(),Vo);aS(r,t)}catch{}},hS=()=>{if(!process.env.CI)try{let e=lm(cm(),Vo);return iS(e)?cS(e).toString().trim():void 0}catch{return}};function Se(t){return async e=>{let r=performance.now(),n=2,o,s="unknown",i,a,c,l=new Set,u=new Set,p=new Set,f=({parsed:x,source:E})=>{if(s="unknown",i=void 0,a=void 0,E?.absoluteRef&&Mi(E.absoluteRef)){s="graphql";return}try{s=Et(x)}catch{s="unsupported"}I(x)&&(i=x?.openapi?"openapi":x?.swagger?"swagger":x?.asyncapi?"asyncapi":x?.arazzo?"arazzo":x?.overlay?"overlay":void 0,i&&(a=x[i]),Ar(s)==="arazzo1"&&(dm(x,l),um(x,u),fm(x,p)))},d=new Set,w=new Set,h=new Set,O=x=>{for(let E of x)E.ignored?h.add(E.ruleId):E.severity==="error"?d.add(E.ruleId):E.severity==="warn"&&w.add(E.ruleId)};try{e.config&&!Pi(e.config)&&G("Please provide a valid path to the configuration file."),c=await na(e,lt),o=c.resolvedConfig.telemetry,n=1,typeof t=="function"&&await t({argv:e,config:c,version:lt,collectSpecData:f,collectResults:O}),n=0}catch(x){x instanceof Zt||(x instanceof de?g.error(x.message+`
465
+ `);g.info(i)},nS=(t,e)=>r=>{let n=" ".repeat(t-Yo(r).length);return`${e}${te("\u2551")} ${r}${n} ${te("\u2551")}`},oS=()=>{try{let t=Oi(Ei(),Ai);if(!Kb(t))return!0;let e=new Date().getTime(),n=Zb(t).mtime.getTime();return e-n>=Qb}catch{return!1}};function sm(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 Xt(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 sS}from"node:child_process";import*as Xr from"node:fs";import{existsSync as iS,writeFileSync as aS,readFileSync as cS}from"node:fs";import*as am from"node:os";import{tmpdir as cm}from"node:os";import{join as lm}from"node:path";async function im(t=jn){try{return await Tn(Gi,{timeout:t}),!0}catch{return!1}}var Wo="***";async function pm({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:l,lint_rules_with_errors:u,lint_rules_with_warnings:p,lint_rules_with_ignored_problems:f,generate_client:d,eject_generator:w}){try{if(!e||!await im(1e3))return;let{_:[O],$0:x,...E}=e,{RedoclyOAuthClient:v}=await import("./chunks/6PX2QTPF.js"),A=new v,$=Cr(t,E.residency),U=await A.isAuthorized($),L=hS();L||(L=`ann_${pa()}`,dS(L));let ne=Ar(o),Z=[{id:O,object:"command",uri:`urn:redocly:cli:command:${O}`,logged_in:U?"yes":"no",command:O,...fS(E,process.argv.slice(2)),node_version:process.version,npm_version:mS(),version:lt,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:ne==="arazzo1"&&a?.length?JSON.stringify(a):void 0,respect_source_description_types:ne==="arazzo1"&&c?.length?JSON.stringify(c):void 0,respect_criterion_object_types:ne==="arazzo1"&&l?.length?JSON.stringify(l):void 0,lint_rules_with_errors:u?.length?JSON.stringify(u):void 0,lint_rules_with_warnings:p?.length?JSON.stringify(p):void 0,lint_rules_with_ignored_problems:f?.length?JSON.stringify(f):void 0,generate_client_builtin_generators:d?.generate_client_builtin_generators?.length?JSON.stringify(d.generate_client_builtin_generators):void 0,generate_client_custom_generators_count:d?.generate_client_custom_generators_count,generate_client_toolkit_imports:d?.generate_client_toolkit_imports?.length?JSON.stringify(d.generate_client_toolkit_imports):void 0,generate_client_error_category:d?.generate_client_error_category,generate_client_ejected_generators:d?.generate_client_ejected_generators?.length?JSON.stringify(d.generate_client_ejected_generators):void 0,generate_client_composed_apis_count:d?.generate_client_composed_apis_count,eject_generator_action:w?.eject_generator_action,eject_generator_name:w?.eject_generator_name,eject_generator_outcome:w?.eject_generator_outcome,eject_generator_conflicts:w?.eject_generator_conflicts,eject_generator_from_version:w?.eject_generator_from_version,eject_generator_to_version:w?.eject_generator_to_version}],ue=la.mapToCloudEvent({type:"com.redocly.command.ran",source:"urn:redocly:cli",origin:"redocly-cli",env:"production",osPlatform:am.platform(),actor:{id:L,object:"user",uri:""},category:"product",data:Z}),{otelTelemetry:R}=await import("./chunks/SKB7KFUK.js");R.send(ue)}catch{}}function um(t,e){for(let r of t.sourceDescriptions??[])r.type&&e.add(r.type)}function fm(t,e){for(let r of t.workflows??[]){Jr(r.successActions,e),Jr(r.failureActions,e);for(let n of r.steps??[])mm(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??[])mm(r.criteria,e)}function mm(t,e){for(let r of t??[]){let n=lS(r);n&&e.add(n)}}function lS(t){let e=t.type;return typeof e=="string"?e:e?.type||(t.condition?"simple":void 0)}function dm(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 pS(t){return Xr.existsSync(t)&&Xr.statSync(t).isFile()}function uS(t){return Xr.existsSync(t)&&Xr.statSync(t).isDirectory()}function xi(t){return t&&(Ti(t)?t.split("://")[0]+"://url":pS(t)?t.replace(/.+\.([^.]+)$/,(e,r)=>"file-"+r):uS(t)?"folder":t)}function Ci(t,e,r){let n=Array.isArray(e)?e:[e];for(let o of n)o.length>1&&(t=t.replaceAll(o,r));return t}function hm(t,e){let r={};for(let[n,o]of Object.entries(t))e.includes(n)?r[n]=Wo:I(o)?r[n]=hm(o,e):r[n]=o;return r}function vi(t,e,r=[]){if(Array.isArray(t))return t.forEach(n=>vi(n,e,r)),r;if(I(t))for(let[n,o]of Object.entries(t))e.includes(n)&&typeof o=="string"?r.push(o):(I(o)||Array.isArray(o))&&vi(o,e,r);return r}function fS(t,e){let r=["organization","o","input","i","author","a","clientCert","clientKey","caCert","server","S"],n=e.join(" "),o={};for(let[s,i]of Object.entries(t))if(r.includes(s))o[s]=Wo,n=Ci(n,i,Wo);else if(typeof i=="string"){let a=xi(i);o[s]=a,n=Ci(n,i,a)}else if(Array.isArray(i)){o[s]=i.map(xi);for(let a of i){let c=xi(a);n.includes(a)&&(n=n.replaceAll(a,c))}}else if(I(i)){let a=vi(i,r);for(let c of a)n=Ci(n,c,Wo);o[s]=hm(i,r)}else o[s]=i;return{arguments:JSON.stringify(o),raw_input:n}}function mS(){try{return sS("npm -v",{stdio:["ignore","pipe","ignore"]}).toString().trim()}catch{return"unknown"}}var dS=t=>{if(!(process.env.CI||!t))try{let r=lm(cm(),Vo);aS(r,t)}catch{}},hS=()=>{if(!process.env.CI)try{let e=lm(cm(),Vo);return iS(e)?cS(e).toString().trim():void 0}catch{return}};function Se(t){return async e=>{let r=performance.now(),n=2,o,s="unknown",i,a,c,l=new Set,u=new Set,p=new Set,f=({parsed:x,source:E})=>{if(s="unknown",i=void 0,a=void 0,E?.absoluteRef&&Mi(E.absoluteRef)){s="graphql";return}try{s=Et(x)}catch{s="unsupported"}I(x)&&(i=x?.openapi?"openapi":x?.swagger?"swagger":x?.asyncapi?"asyncapi":x?.arazzo?"arazzo":x?.overlay?"overlay":void 0,i&&(a=x[i]),Ar(s)==="arazzo1"&&(dm(x,l),um(x,u),fm(x,p)))},d=new Set,w=new Set,h=new Set,O=x=>{for(let E of x)E.ignored?h.add(E.ruleId):E.severity==="error"?d.add(E.ruleId):E.severity==="warn"&&w.add(E.ruleId)};try{e.config&&!Pi(e.config)&&G("Please provide a valid path to the configuration file."),c=await na(e,lt),o=c.resolvedConfig.telemetry,n=1,typeof t=="function"&&await t({argv:e,config:c,version:lt,collectSpecData:f,collectResults:O}),n=0}catch(x){x instanceof Zt||(x instanceof de?g.error(x.message+`
466
466
 
467
467
  `):(g.error(`An unexpected error occurred. This is likely a bug that should be reported.
468
468
  `),g.error(x instanceof Error?x.stack||x.message:String(x)),g.error(`
469
469
  `)))}finally{if(process.env.REDOCLY_TELEMETRY!=="off"&&o!=="off"){let x=Math.round(performance.now()-r);await pm({config:c,argv:e,exit_code:n,execution_time:x,spec_version:s,spec_keyword:i,spec_full_version:a,respect_x_security_auth_types:[...l],respect_source_description_types:[...u],respect_criterion_object_types:[...p],lint_rules_with_errors:[...d],lint_rules_with_warnings:[...w],lint_rules_with_ignored_problems:[...h],generate_client:ot,eject_generator:ye})}process.once("beforeExit",()=>{process.exit(n)})}}}gm.config({path:ym.resolve(process.cwd(),"./.env")});om();np(Cs(process.argv)).version("version","Show version number.",lt).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=>{Se(Kf)(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=>{Se(tf)(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=>{Se(zf)(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=>{Se(nu)(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=>{Se(Uo)(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:sm},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=>{Se(Qf)(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=>{Se(Yi)(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:Ki},"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=>{Se(ip)(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=>{Se()(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=>{Se(op)(t)}).command("logout","Clear your stored credentials.",t=>t,t=>{Se(sp)(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:ou,default:"enterprise"},port:{alias:"p",type:"number",description:"Preview port.",default:4e3,coerce:Xt("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"))&&g.error(`Option --source-dir is deprecated and will be removed soon. Use --project-dir instead.
470
- `),Se(su)(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/OKMAGS7N.js");Se(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=>{Se(Jf)(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=>{Se(Cp)(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:Iu},severity:{describe:"Severity of the check.",type:"string"},"max-steps":{describe:"Maximum number of steps to run (default: 2000).",type:"number",default:2e3,coerce:Xt("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:Xt("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:Xt("execution-timeout",!1)},"no-secrets-masking":{describe:"Do not mask secrets in the output.",type:"boolean",default:!1}}),async t=>{Se(Ru)(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},"with-ai":{describe:"Redesign the generated workflows with an AI provider, using the OpenAPI description as context.",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 workflows designed in parallel with --with-ai for large descriptions.",type:"number",default:4,coerce:Xt("ai-concurrency",!0)},"max-workflows":{describe:"Most workflows the AI may design with --with-ai.",type:"number",default:10,coerce:Xt("max-workflows",!0)}}),async t=>{Se(Ip)(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; 'module' writes it as real files in a runtime/ folder beside the client.",choices:["inline","module"],requiresArg:!0},docs:{description:"Also write reference documentation for what this run generates: one Markdown page per selected generator that documents itself (the CLI, and each SDK).",type:"boolean"},"go-package":{description:"Package clause of the `go` generator's output (a valid Go package name). Defaults to `client`.",type:"string",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: typescript). Built-in: typescript, zod, tanstack-query, tanstack-query-vue, tanstack-query-svelte, tanstack-query-solid, swr, mock, transformers, cli, python, go, php \u2014 or a path/package specifier for a custom generator. What each one emits is in the "Use the generated client" guide. Example: --generator typescript --generator zod',type:"string",array:!0,requiresArg:!0},config:{describe:"Path to the config file.",type:"string",requiresArg:!0}}),async t=>{Se(Mp)(t)}).command("eject-generator [generator]","Vendor a built-in client generator into your repo as an editable file [experimental].",t=>t.positional("generator",{describe:`Built-in generator to eject (${[...Dr].join(", ")}).`,type:"string"}).options({config:{description:"Path to the config file.",type:"string"},dir:{describe:"Directory to eject into (default: ./generators).",type:"string",requiresArg:!0},force:{describe:"Overwrite an existing ejected file (discards local edits).",type:"boolean",default:!1},update:{describe:"Three-way merge a newer generator version into your customized copy (pristine \xD7 new \xD7 yours).",type:"boolean",default:!1}}),async t=>{Se(Op)(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:Xt("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/TMULAWFD.js");Se(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=>{Se(df)(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/2OHNINBQ.js");Se(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/IPFRJMV6.js");Se(e)(t)}).completion("completion","Generate autocomplete script for `redocly` command.").demandCommand(1).middleware([nm]).strict().argv;
470
+ `),Se(su)(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/2UDYQ5CZ.js");Se(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=>{Se(Jf)(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=>{Se(Cp)(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:Iu},severity:{describe:"Severity of the check.",type:"string"},"max-steps":{describe:"Maximum number of steps to run (default: 2000).",type:"number",default:2e3,coerce:Xt("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:Xt("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:Xt("execution-timeout",!1)},"no-secrets-masking":{describe:"Do not mask secrets in the output.",type:"boolean",default:!1}}),async t=>{Se(Ru)(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},"with-ai":{describe:"Redesign the generated workflows with an AI provider, using the OpenAPI description as context.",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 workflows designed in parallel with --with-ai for large descriptions.",type:"number",default:4,coerce:Xt("ai-concurrency",!0)},"max-workflows":{describe:"Most workflows the AI may design with --with-ai.",type:"number",default:10,coerce:Xt("max-workflows",!0)}}),async t=>{Se(Ip)(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; 'module' writes it as real files in a runtime/ folder beside the client.",choices:["inline","module"],requiresArg:!0},docs:{description:"Also write reference documentation for what this run generates: one Markdown page per selected generator that documents itself (the CLI, and each SDK).",type:"boolean"},"go-package":{description:"Package clause of the `go` generator's output (a valid Go package name). Defaults to `client`.",type:"string",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: typescript). Built-in: typescript, zod, tanstack-query, tanstack-query-vue, tanstack-query-svelte, tanstack-query-solid, swr, mock, transformers, cli, python, go, php \u2014 or a path/package specifier for a custom generator. What each one emits is in the "Use the generated client" guide. Example: --generator typescript --generator zod',type:"string",array:!0,requiresArg:!0},config:{describe:"Path to the config file.",type:"string",requiresArg:!0}}),async t=>{Se(Mp)(t)}).command("eject-generator [generator]","Vendor a built-in client generator into your repo as an editable file [experimental].",t=>t.positional("generator",{describe:`Built-in generator to eject (${[...Dr].join(", ")}).`,type:"string"}).options({config:{description:"Path to the config file.",type:"string"},dir:{describe:"Directory to eject into (default: ./generators).",type:"string",requiresArg:!0},force:{describe:"Overwrite an existing ejected file (discards local edits).",type:"boolean",default:!1},update:{describe:"Three-way merge a newer generator version into your customized copy (pristine \xD7 new \xD7 yours).",type:"boolean",default:!1}}),async t=>{Se(Op)(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:Xt("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/TMULAWFD.js");Se(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=>{Se(df)(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/2OHNINBQ.js");Se(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/IPFRJMV6.js");Se(e)(t)}).completion("completion","Generate autocomplete script for `redocly` command.").demandCommand(1).middleware([nm]).strict().argv;
471
471
  /*! Bundled license information:
472
472
 
473
473
  cookie/index.js:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redocly/cli",
3
- "version": "2.51.0",
3
+ "version": "2.51.1",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "type": "module",