@redocly/cli 2.54.1 → 2.54.2

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 (107) hide show
  1. package/THIRD_PARTY_NOTICES +1 -1
  2. package/lib/chunks/{Q7ARG2G6.js → 26SMEC4W.js} +1 -1
  3. package/lib/chunks/{23QBFBKB.js → 32ZHA42N.js} +1 -1
  4. package/lib/chunks/{2MBZI3W3.js → 3UYF5CLP.js} +1 -1
  5. package/lib/chunks/{4G34OIRT.js → 42DSSM4F.js} +1 -1
  6. package/lib/chunks/{2NS7AGPD.js → 42HL7XQH.js} +1 -1
  7. package/lib/chunks/{AM6FT7EB.js → 4UWA75AV.js} +1 -1
  8. package/lib/chunks/{BYIMEGON.js → 5H5SOEIM.js} +1 -1
  9. package/lib/chunks/{UWNBPAWG.js → 5KKTVK6L.js} +1 -1
  10. package/lib/chunks/{J7GIHRZA.js → 73UEREUT.js} +1 -1
  11. package/lib/chunks/{XFRPQNF6.js → 7GJ7DF3O.js} +1 -1
  12. package/lib/chunks/{5KMAESVG.js → 7X6ZJPG4.js} +1 -1
  13. package/lib/chunks/{KZMFETIJ.js → AQQVMAUF.js} +1 -1
  14. package/lib/chunks/{S4H3MC5R.js → AWIBN2J5.js} +1 -1
  15. package/lib/chunks/{LLGJ3YMR.js → BR3C2ZRO.js} +1 -1
  16. package/lib/chunks/{UAEEHSSK.js → BV72RZCF.js} +2 -2
  17. package/lib/chunks/{IPVLUS43.js → CGBDHCS4.js} +1 -1
  18. package/lib/chunks/{H4XURXR7.js → CUB5GMHZ.js} +1 -1
  19. package/lib/chunks/{SAJRBHEI.js → CWYADEAF.js} +1 -1
  20. package/lib/chunks/{IZ2TZVJD.js → EPBAZUU2.js} +1 -1
  21. package/lib/chunks/{ZDNSHHXT.js → F645HTKX.js} +1 -1
  22. package/lib/chunks/{QZBHV7SD.js → FSTHNUTZ.js} +1 -1
  23. package/lib/chunks/{W6X4HEU3.js → G5RGUPPT.js} +1 -1
  24. package/lib/chunks/{XRZ5NMQ5.js → G66T7F2A.js} +1 -1
  25. package/lib/chunks/{Y6E4JAM3.js → HITQPK62.js} +1 -1
  26. package/lib/chunks/{ALXOGCUM.js → HNVJYHEV.js} +1 -1
  27. package/lib/chunks/{KEF4233Y.js → HR7ZTPFZ.js} +1 -1
  28. package/lib/chunks/{SZKF6VFY.js → ICLFVPDF.js} +1 -1
  29. package/lib/chunks/{CI4NGJ3I.js → ITRAFA2I.js} +1 -1
  30. package/lib/chunks/{ENDHNS6Y.js → IWS3O2SM.js} +1 -1
  31. package/lib/chunks/{YDSFHQXH.js → KVPIWPOL.js} +1 -1
  32. package/lib/chunks/{RW2ESAIF.js → L2EEGRZN.js} +41 -41
  33. package/lib/chunks/{LT2PEIAT.js → LW5V3SVS.js} +1 -1
  34. package/lib/chunks/{KW7NKDOX.js → LY6HM2BD.js} +1 -1
  35. package/lib/chunks/{IW2J6X26.js → LZRNA4HH.js} +1 -1
  36. package/lib/chunks/{C27G2ZXO.js → M5WLF4GV.js} +1 -1
  37. package/lib/chunks/{4JE7GYQB.js → NSK6GPZU.js} +1 -1
  38. package/lib/chunks/{UYHX7364.js → QHPWFCD2.js} +1 -1
  39. package/lib/chunks/{ZDQDZTQ7.js → RAYH3MG6.js} +1 -1
  40. package/lib/chunks/{3RDMQ5CQ.js → RBL3UMVK.js} +1 -1
  41. package/lib/chunks/{JH4AUZLH.js → RSOM77DA.js} +1 -1
  42. package/lib/chunks/{2TLIBL23.js → SJCEHWE2.js} +1 -1
  43. package/lib/chunks/{FUCJM4CG.js → SOTTFVAK.js} +1 -1
  44. package/lib/chunks/{FIIFOPJG.js → SZH6RAZB.js} +1 -1
  45. package/lib/chunks/{3BJIJBSJ.js → T3U6D4C3.js} +1 -1
  46. package/lib/chunks/{FTDJMTRX.js → UR72TK6I.js} +1 -1
  47. package/lib/chunks/{ZBK7SJHM.js → UUIZXPYS.js} +1 -1
  48. package/lib/chunks/{AHGQ4BNI.js → VQVISWBJ.js} +1 -1
  49. package/lib/chunks/{CKJYJBJ6.js → VUQEVFSD.js} +1 -1
  50. package/lib/chunks/{VTKYS75A.js → WCMZCZST.js} +1 -1
  51. package/lib/chunks/{L24E6ZRY.js → YOV4L7V6.js} +1 -1
  52. package/lib/chunks/{MZCEUZSS.js → ZIP2B7BB.js} +1 -1
  53. package/lib/chunks/{RVQFQGGH.js → ZRACBTMS.js} +1 -1
  54. package/lib/eject-assets/generators/cli/docs.ts +1 -1
  55. package/lib/eject-assets/generators/cli/engine-source.ts +1 -1
  56. package/lib/eject-assets/generators/cli/index.ts +2 -2
  57. package/lib/eject-assets/generators/cli/render.ts +1 -1
  58. package/lib/eject-assets/generators/go/client.ts +1 -1
  59. package/lib/eject-assets/generators/go/descriptor.ts +1 -1
  60. package/lib/eject-assets/generators/go/index.ts +2 -2
  61. package/lib/eject-assets/generators/go/models.ts +1 -1
  62. package/lib/eject-assets/generators/go/naming.ts +1 -1
  63. package/lib/eject-assets/generators/go/operations.ts +1 -1
  64. package/lib/eject-assets/generators/go/pagination.ts +1 -1
  65. package/lib/eject-assets/generators/go/types.ts +1 -1
  66. package/lib/eject-assets/generators/mock/faker.ts +1 -1
  67. package/lib/eject-assets/generators/mock/index.ts +2 -2
  68. package/lib/eject-assets/generators/mock/render.ts +1 -1
  69. package/lib/eject-assets/generators/mock/sample.ts +1 -1
  70. package/lib/eject-assets/generators/mock/values.ts +1 -1
  71. package/lib/eject-assets/generators/php/client.ts +1 -1
  72. package/lib/eject-assets/generators/php/descriptor.ts +1 -1
  73. package/lib/eject-assets/generators/php/index.ts +2 -2
  74. package/lib/eject-assets/generators/php/models.ts +1 -1
  75. package/lib/eject-assets/generators/php/naming.ts +1 -1
  76. package/lib/eject-assets/generators/php/operations.ts +1 -1
  77. package/lib/eject-assets/generators/php/pagination.ts +1 -1
  78. package/lib/eject-assets/generators/php/types.ts +1 -1
  79. package/lib/eject-assets/generators/python/client.ts +1 -1
  80. package/lib/eject-assets/generators/python/descriptor.ts +1 -1
  81. package/lib/eject-assets/generators/python/index.ts +2 -2
  82. package/lib/eject-assets/generators/python/models.ts +1 -1
  83. package/lib/eject-assets/generators/python/naming.ts +1 -1
  84. package/lib/eject-assets/generators/python/operations.ts +1 -1
  85. package/lib/eject-assets/generators/python/pagination.ts +1 -1
  86. package/lib/eject-assets/generators/python/types.ts +1 -1
  87. package/lib/eject-assets/generators/swr/index.ts +2 -2
  88. package/lib/eject-assets/generators/swr/render.ts +1 -1
  89. package/lib/eject-assets/generators/tanstack-query/index.ts +2 -2
  90. package/lib/eject-assets/generators/tanstack-query/render.ts +1 -1
  91. package/lib/eject-assets/generators/transformers/index.ts +2 -2
  92. package/lib/eject-assets/generators/transformers/render.ts +1 -1
  93. package/lib/eject-assets/generators/typescript/banner.ts +1 -1
  94. package/lib/eject-assets/generators/typescript/client.ts +1 -1
  95. package/lib/eject-assets/generators/typescript/descriptor.ts +1 -1
  96. package/lib/eject-assets/generators/typescript/index.ts +2 -2
  97. package/lib/eject-assets/generators/typescript/inline-runtime.ts +1 -1
  98. package/lib/eject-assets/generators/typescript/operation-signature.ts +1 -1
  99. package/lib/eject-assets/generators/typescript/operation-types.ts +1 -1
  100. package/lib/eject-assets/generators/typescript/operations.ts +1 -1
  101. package/lib/eject-assets/generators/typescript/response-headers.ts +1 -1
  102. package/lib/eject-assets/generators/typescript/type-guards.ts +1 -1
  103. package/lib/eject-assets/generators/typescript/types.ts +1 -1
  104. package/lib/eject-assets/generators/zod/index.ts +2 -2
  105. package/lib/eject-assets/generators/zod/schemas.ts +1 -1
  106. package/lib/index.js +9 -9
  107. package/package.json +1 -1
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 Fi}from"./chunks/2TLIBL23.js";import{a as En,b as On,c as xn,d as Ni,e as Er,f as Di}from"./chunks/XRZ5NMQ5.js";import{a as Ti,b as ki}from"./chunks/ALXOGCUM.js";import{a as xi,b as Ai,c as rt,e as Ci,f as Tt,g as Ht,h as vi,i as Pi,j as Po,k as Ri,l as br,m as _e,n as Sn,o as _i,p as $i,q as Ii,r as ji,s as Br,u as Sr}from"./chunks/H4XURXR7.js";import{a as Ro}from"./chunks/BXI4SF2U.js";import{a as qi,c as Cn,d as _o,e as Wi,g as Ui}from"./chunks/TZMWTSOQ.js";import{a as dt,b as Ei,c as Oi}from"./chunks/ZDNSHHXT.js";import{c as An,d as Li,f as Mi}from"./chunks/L24E6ZRY.js";import"./chunks/7IULUVWX.js";import{A as hi,B as gi,C as It,D as et,F as yi,G as wi,I as ut,J as gr,M as tt,O as mt,P as xe,Q as ge,R as te,S as hn,T as At,U as jt,V as ye,W as gn,X as A,Y as yr,Z as Be,_ as Vt,a as ci,aa as Bt,b as _t,ba as bi,c as I,ca as wr,d as bt,ea as Si,f as li,g as pi,ga as yn,h as dn,ha as wn,i as vo,l as fi,na as q,o as Ve,oa as bn,q as hr,r as je,s as ui,t as Vr,u as mi,v as $t,z as di}from"./chunks/RW2ESAIF.js";import"./chunks/NEWT5A6S.js";import{a as We,c as V,e as wt}from"./chunks/RFWIIJFG.js";var Or=V((wb,zi)=>{"use strict";var Du="2.0.0",Lu=Number.MAX_SAFE_INTEGER||9007199254740991,Mu=16,Fu=250,qu=["major","premajor","minor","preminor","patch","prepatch","prerelease"];zi.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:Mu,MAX_SAFE_BUILD_LENGTH:Fu,MAX_SAFE_INTEGER:Lu,RELEASE_TYPES:qu,SEMVER_SPEC_VERSION:Du,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Hr=V((bb,Gi)=>{"use strict";var Wu=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};Gi.exports=Wu});var xr=V((St,Vi)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:$o,MAX_SAFE_BUILD_LENGTH:Uu,MAX_LENGTH:zu}=Or(),Gu=Hr();St=Vi.exports={};var Vu=St.re=[],Bu=St.safeRe=[],j=St.src=[],Hu=St.safeSrc=[],T=St.t={},Yu=0,Io="[a-zA-Z0-9-]",Ku=[["\\s",1],["\\d",zu],[Io,Uu]],Ju=t=>{for(let[e,r]of Ku)t=t.split(`${e}*`).join(`${e}{0,${r}}`).split(`${e}+`).join(`${e}{1,${r}}`);return t},Z=(t,e,r)=>{let n=Ju(e),o=Yu++;Gu(t,o,e),T[t]=o,j[o]=e,Hu[o]=n,Vu[o]=new RegExp(e,r?"g":void 0),Bu[o]=new RegExp(n,r?"g":void 0)};Z("NUMERICIDENTIFIER","0|[1-9]\\d*");Z("NUMERICIDENTIFIERLOOSE","\\d+");Z("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Io}*`);Z("MAINVERSION",`(${j[T.NUMERICIDENTIFIER]})\\.(${j[T.NUMERICIDENTIFIER]})\\.(${j[T.NUMERICIDENTIFIER]})`);Z("MAINVERSIONLOOSE",`(${j[T.NUMERICIDENTIFIERLOOSE]})\\.(${j[T.NUMERICIDENTIFIERLOOSE]})\\.(${j[T.NUMERICIDENTIFIERLOOSE]})`);Z("PRERELEASEIDENTIFIER",`(?:${j[T.NONNUMERICIDENTIFIER]}|${j[T.NUMERICIDENTIFIER]})`);Z("PRERELEASEIDENTIFIERLOOSE",`(?:${j[T.NONNUMERICIDENTIFIER]}|${j[T.NUMERICIDENTIFIERLOOSE]})`);Z("PRERELEASE",`(?:-(${j[T.PRERELEASEIDENTIFIER]}(?:\\.${j[T.PRERELEASEIDENTIFIER]})*))`);Z("PRERELEASELOOSE",`(?:-?(${j[T.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${j[T.PRERELEASEIDENTIFIERLOOSE]})*))`);Z("BUILDIDENTIFIER",`${Io}+`);Z("BUILD",`(?:\\+(${j[T.BUILDIDENTIFIER]}(?:\\.${j[T.BUILDIDENTIFIER]})*))`);Z("FULLPLAIN",`v?${j[T.MAINVERSION]}${j[T.PRERELEASE]}?${j[T.BUILD]}?`);Z("FULL",`^${j[T.FULLPLAIN]}$`);Z("LOOSEPLAIN",`[v=\\s]*${j[T.MAINVERSIONLOOSE]}${j[T.PRERELEASELOOSE]}?${j[T.BUILD]}?`);Z("LOOSE",`^${j[T.LOOSEPLAIN]}$`);Z("GTLT","((?:<|>)?=?)");Z("XRANGEIDENTIFIERLOOSE",`${j[T.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);Z("XRANGEIDENTIFIER",`${j[T.NUMERICIDENTIFIER]}|x|X|\\*`);Z("XRANGEPLAIN",`[v=\\s]*(${j[T.XRANGEIDENTIFIER]})(?:\\.(${j[T.XRANGEIDENTIFIER]})(?:\\.(${j[T.XRANGEIDENTIFIER]})(?:${j[T.PRERELEASE]})?${j[T.BUILD]}?)?)?`);Z("XRANGEPLAINLOOSE",`[v=\\s]*(${j[T.XRANGEIDENTIFIERLOOSE]})(?:\\.(${j[T.XRANGEIDENTIFIERLOOSE]})(?:\\.(${j[T.XRANGEIDENTIFIERLOOSE]})(?:${j[T.PRERELEASELOOSE]})?${j[T.BUILD]}?)?)?`);Z("XRANGE",`^${j[T.GTLT]}\\s*${j[T.XRANGEPLAIN]}$`);Z("XRANGELOOSE",`^${j[T.GTLT]}\\s*${j[T.XRANGEPLAINLOOSE]}$`);Z("COERCEPLAIN",`(^|[^\\d])(\\d{1,${$o}})(?:\\.(\\d{1,${$o}}))?(?:\\.(\\d{1,${$o}}))?`);Z("COERCE",`${j[T.COERCEPLAIN]}(?:$|[^\\d])`);Z("COERCEFULL",j[T.COERCEPLAIN]+`(?:${j[T.PRERELEASE]})?(?:${j[T.BUILD]})?(?:$|[^\\d])`);Z("COERCERTL",j[T.COERCE],!0);Z("COERCERTLFULL",j[T.COERCEFULL],!0);Z("LONETILDE","(?:~>?)");Z("TILDETRIM",`(\\s*)${j[T.LONETILDE]}\\s+`,!0);St.tildeTrimReplace="$1~";Z("TILDE",`^${j[T.LONETILDE]}${j[T.XRANGEPLAIN]}$`);Z("TILDELOOSE",`^${j[T.LONETILDE]}${j[T.XRANGEPLAINLOOSE]}$`);Z("LONECARET","(?:\\^)");Z("CARETTRIM",`(\\s*)${j[T.LONECARET]}\\s+`,!0);St.caretTrimReplace="$1^";Z("CARET",`^${j[T.LONECARET]}${j[T.XRANGEPLAIN]}$`);Z("CARETLOOSE",`^${j[T.LONECARET]}${j[T.XRANGEPLAINLOOSE]}$`);Z("COMPARATORLOOSE",`^${j[T.GTLT]}\\s*(${j[T.LOOSEPLAIN]})$|^$`);Z("COMPARATOR",`^${j[T.GTLT]}\\s*(${j[T.FULLPLAIN]})$|^$`);Z("COMPARATORTRIM",`(\\s*)${j[T.GTLT]}\\s*(${j[T.LOOSEPLAIN]}|${j[T.XRANGEPLAIN]})`,!0);St.comparatorTrimReplace="$1$2$3";Z("HYPHENRANGE",`^\\s*(${j[T.XRANGEPLAIN]})\\s+-\\s+(${j[T.XRANGEPLAIN]})\\s*$`);Z("HYPHENRANGELOOSE",`^\\s*(${j[T.XRANGEPLAINLOOSE]})\\s+-\\s+(${j[T.XRANGEPLAINLOOSE]})\\s*$`);Z("STAR","(<|>)?=?\\s*\\*");Z("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");Z("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var vn=V((Sb,Bi)=>{"use strict";var Xu=Object.freeze({loose:!0}),Qu=Object.freeze({}),Zu=t=>t?typeof t!="object"?Xu:t:Qu;Bi.exports=Zu});var jo=V((Eb,Ki)=>{"use strict";var Hi=/^[0-9]+$/,Yi=(t,e)=>{if(typeof t=="number"&&typeof e=="number")return t===e?0:t<e?-1:1;let r=Hi.test(t),n=Hi.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t<e?-1:1},em=(t,e)=>Yi(e,t);Ki.exports={compareIdentifiers:Yi,rcompareIdentifiers:em}});var Te=V((Ob,Xi)=>{"use strict";var Pn=Hr(),{MAX_LENGTH:Ji,MAX_SAFE_INTEGER:Rn}=Or(),{safeRe:_n,t:$n}=xr(),tm=vn(),{compareIdentifiers:To}=jo(),rm=(t,e)=>{let r=e.split(".");if(r.length>t.length)return!1;for(let n=0;n<r.length;n++)if(To(t[n],r[n])!==0)return!1;return!0},ko=class t{constructor(e,r){if(r=tm(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>Ji)throw new TypeError(`version is longer than ${Ji} characters`);Pn("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=e.trim().match(r.loose?_n[$n.LOOSE]:_n[$n.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>Rn||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Rn||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Rn||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<Rn)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(Pn("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(Pn("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 To(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(Pn("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 To(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?_n[$n.PRERELEASELOOSE]:_n[$n.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]),rm(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}};Xi.exports=ko});var kt=V((xb,Zi)=>{"use strict";var Qi=Te(),nm=(t,e,r=!1)=>{if(t instanceof Qi)return t;try{return new Qi(t,e)}catch(n){if(!r)return null;throw n}};Zi.exports=nm});var ta=V((Ab,ea)=>{"use strict";var om=kt(),sm=(t,e)=>{let r=om(t,e);return r?r.version:null};ea.exports=sm});var na=V((Cb,ra)=>{"use strict";var im=kt(),am=(t,e)=>{let r=im(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null};ra.exports=am});var ia=V((vb,sa)=>{"use strict";var oa=Te(),cm=(t,e,r,n,o)=>{typeof r=="string"&&(o=n,n=r,r=void 0);try{return new oa(t instanceof oa?t.version:t,r).inc(e,n,o).version}catch{return null}};sa.exports=cm});var la=V((Pb,ca)=>{"use strict";var aa=kt(),lm=(t,e)=>{let r=aa(t,null,!0),n=aa(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 p=c?"pre":"";return r.major!==n.major?p+"major":r.minor!==n.minor?p+"minor":r.patch!==n.patch?p+"patch":"prerelease"};ca.exports=lm});var fa=V((Rb,pa)=>{"use strict";var pm=Te(),fm=(t,e)=>new pm(t,e).major;pa.exports=fm});var ma=V((_b,ua)=>{"use strict";var um=Te(),mm=(t,e)=>new um(t,e).minor;ua.exports=mm});var ha=V(($b,da)=>{"use strict";var dm=Te(),hm=(t,e)=>new dm(t,e).patch;da.exports=hm});var ya=V((Ib,ga)=>{"use strict";var gm=kt(),ym=(t,e)=>{let r=gm(t,e);return r&&r.prerelease.length?r.prerelease:null};ga.exports=ym});var nt=V((jb,ba)=>{"use strict";var wa=Te(),wm=(t,e,r)=>new wa(t,r).compare(new wa(e,r));ba.exports=wm});var Ea=V((Tb,Sa)=>{"use strict";var bm=nt(),Sm=(t,e,r)=>bm(e,t,r);Sa.exports=Sm});var xa=V((kb,Oa)=>{"use strict";var Em=nt(),Om=(t,e)=>Em(t,e,!0);Oa.exports=Om});var In=V((Nb,Ca)=>{"use strict";var Aa=Te(),xm=(t,e,r)=>{let n=new Aa(t,r),o=new Aa(e,r);return n.compare(o)||n.compareBuild(o)};Ca.exports=xm});var Pa=V((Db,va)=>{"use strict";var Am=In(),Cm=(t,e)=>t.sort((r,n)=>Am(r,n,e));va.exports=Cm});var _a=V((Lb,Ra)=>{"use strict";var vm=In(),Pm=(t,e)=>t.sort((r,n)=>vm(n,r,e));Ra.exports=Pm});var Yr=V((Mb,$a)=>{"use strict";var Rm=nt(),_m=(t,e,r)=>Rm(t,e,r)>0;$a.exports=_m});var jn=V((Fb,Ia)=>{"use strict";var $m=nt(),Im=(t,e,r)=>$m(t,e,r)<0;Ia.exports=Im});var No=V((qb,ja)=>{"use strict";var jm=nt(),Tm=(t,e,r)=>jm(t,e,r)===0;ja.exports=Tm});var Do=V((Wb,Ta)=>{"use strict";var km=nt(),Nm=(t,e,r)=>km(t,e,r)!==0;Ta.exports=Nm});var Tn=V((Ub,ka)=>{"use strict";var Dm=nt(),Lm=(t,e,r)=>Dm(t,e,r)>=0;ka.exports=Lm});var kn=V((zb,Na)=>{"use strict";var Mm=nt(),Fm=(t,e,r)=>Mm(t,e,r)<=0;Na.exports=Fm});var Lo=V((Gb,Da)=>{"use strict";var qm=No(),Wm=Do(),Um=Yr(),zm=Tn(),Gm=jn(),Vm=kn(),Bm=(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 qm(t,r,n);case"!=":return Wm(t,r,n);case">":return Um(t,r,n);case">=":return zm(t,r,n);case"<":return Gm(t,r,n);case"<=":return Vm(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}};Da.exports=Bm});var Ma=V((Vb,La)=>{"use strict";var Hm=Te(),Ym=kt(),{safeRe:Nn,t:Dn}=xr(),Km=(t,e)=>{if(t instanceof Hm)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?Nn[Dn.COERCEFULL]:Nn[Dn.COERCE]);else{let c=e.includePrerelease?Nn[Dn.COERCERTLFULL]:Nn[Dn.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 Ym(`${n}.${o}.${s}${i}${a}`,e)};La.exports=Km});var qa=V((Bb,Fa)=>{"use strict";var Jm=kt(),Xm=Or(),Qm=Te(),Zm=(t,e,r)=>{if(!Xm.RELEASE_TYPES.includes(e))return null;let n=ed(t,r);return n&&td(n,e)},ed=(t,e)=>{let r=t instanceof Qm?t.version:t;return Jm(r,e)},td=(t,e)=>{if(rd(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()},rd=t=>t.startsWith("pre");Fa.exports=Zm});var Ua=V((Hb,Wa)=>{"use strict";var Mo=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}};Wa.exports=Mo});var ot=V((Yb,Ba)=>{"use strict";var nd=/\s+/g,Fo=class t{constructor(e,r){if(r=sd(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof qo)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(nd," "),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=>!Ga(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&&dd(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(md,"");let n=((this.options.includePrerelease&&fd)|(this.options.loose&&ud))+":"+e,o=za.get(n);if(o)return o;let s=this.options.loose,i=s?Me[ke.HYPHENRANGELOOSE]:Me[ke.HYPHENRANGE];e=e.replace(i,Cd(this.options.includePrerelease)),ue("hyphen replace",e),e=e.replace(Me[ke.COMPARATORTRIM],cd),ue("comparator trim",e),e=e.replace(Me[ke.TILDETRIM],ld),ue("tilde trim",e),e=e.replace(Me[ke.CARETTRIM],pd),ue("caret trim",e);let a=e.split(" ").map(f=>hd(f,this.options)).join(" ").split(/\s+/).map(f=>Ad(f,this.options));s&&(a=a.filter(f=>(ue("loose invalid filter",f,this.options),!!f.match(Me[ke.COMPARATORLOOSE])))),ue("range list",a);let c=new Map,l=a.map(f=>new qo(f,this.options));for(let f of l){if(Ga(f))return[f];c.set(f.value,f)}c.size>1&&c.has("")&&c.delete("");let p=[...c.values()];return za.set(n,p),p}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(n=>Va(n,r)&&e.set.some(o=>Va(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 id(e,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(vd(this.set[r],e,this.options))return!0;return!1}};Ba.exports=Fo;var od=Ua(),za=new od,sd=vn(),qo=Kr(),ue=Hr(),id=Te(),{safeRe:Me,src:ad,t:ke,comparatorTrimReplace:cd,tildeTrimReplace:ld,caretTrimReplace:pd}=xr(),{FLAG_INCLUDE_PRERELEASE:fd,FLAG_LOOSE:ud}=Or(),md=new RegExp(ad[ke.BUILD],"g"),Ga=t=>t.value==="<0.0.0-0",dd=t=>t.value==="",Va=(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},hd=(t,e)=>(t=t.replace(Me[ke.BUILD],""),ue("comp",t,e),t=bd(t,e),ue("caret",t),t=yd(t,e),ue("tildes",t),t=Ed(t,e),ue("xrange",t),t=xd(t,e),ue("stars",t),t),Ce=t=>!t||t.toLowerCase()==="x"||t==="*",gd=(t,e,r)=>Ce(t)&&!Ce(e)||Ce(e)&&r&&!Ce(r),yd=(t,e)=>t.trim().split(/\s+/).map(r=>wd(r,e)).join(" "),wd=(t,e)=>{let r=e.loose?Me[ke.TILDELOOSE]:Me[ke.TILDE],n=e.includePrerelease?"-0":"";return t.replace(r,(o,s,i,a,c)=>{ue("tilde",t,o,s,i,a,c);let l;return Ce(s)?l="":Ce(i)?l=`>=${s}.0.0${n} <${+s+1}.0.0-0`:Ce(a)?l=`>=${s}.${i}.0${n} <${s}.${+i+1}.0-0`:c?(ue("replaceTilde pr",c),l=`>=${s}.${i}.${a}-${c} <${s}.${+i+1}.0-0`):l=`>=${s}.${i}.${a} <${s}.${+i+1}.0-0`,ue("tilde return",l),l})},bd=(t,e)=>t.trim().split(/\s+/).map(r=>Sd(r,e)).join(" "),Sd=(t,e)=>{ue("caret",t,e);let r=e.loose?Me[ke.CARETLOOSE]:Me[ke.CARET],n=e.includePrerelease?"-0":"";return t.replace(r,(o,s,i,a,c)=>{ue("caret",t,o,s,i,a,c);let l;return Ce(s)?l="":Ce(i)?l=`>=${s}.0.0${n} <${+s+1}.0.0-0`:Ce(a)?s==="0"?l=`>=${s}.${i}.0${n} <${s}.${+i+1}.0-0`:l=`>=${s}.${i}.0${n} <${+s+1}.0.0-0`:c?(ue("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`):(ue("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`),ue("caret return",l),l})},Ed=(t,e)=>(ue("replaceXRanges",t,e),t.split(/\s+/).map(r=>Od(r,e)).join(" ")),Od=(t,e)=>{t=t.trim();let r=e.loose?Me[ke.XRANGELOOSE]:Me[ke.XRANGE];return t.replace(r,(n,o,s,i,a,c)=>{if(ue("xRange",t,n,o,s,i,a,c),gd(s,i,a))return t;let l=Ce(s),p=l||Ce(i),f=p||Ce(a),m=f;return o==="="&&m&&(o=""),c=e.includePrerelease?"-0":"",l?o===">"||o==="<"?n="<0.0.0-0":n="*":o&&m?(p&&(i=0),a=0,o===">"?(o=">=",p?(s=+s+1,i=0,a=0):(i=+i+1,a=0)):o==="<="&&(o="<",p?s=+s+1:i=+i+1),o==="<"&&(c="-0"),n=`${o+s}.${i}.${a}${c}`):p?n=`>=${s}.0.0${c} <${+s+1}.0.0-0`:f&&(n=`>=${s}.${i}.0${c} <${s}.${+i+1}.0-0`),ue("xRange return",n),n})},xd=(t,e)=>(ue("replaceStars",t,e),t.trim().replace(Me[ke.STAR],"")),Ad=(t,e)=>(ue("replaceGTE0",t,e),t.trim().replace(Me[e.includePrerelease?ke.GTE0PRE:ke.GTE0],"")),Cd=t=>(e,r,n,o,s,i,a,c,l,p,f,m)=>(Ce(n)?r="":Ce(o)?r=`>=${n}.0.0${t?"-0":""}`:Ce(s)?r=`>=${n}.${o}.0${t?"-0":""}`:i?r=`>=${r}`:r=`>=${r}${t?"-0":""}`,Ce(l)?c="":Ce(p)?c=`<${+l+1}.0.0-0`:Ce(f)?c=`<${l}.${+p+1}.0-0`:m?c=`<=${l}.${p}.${f}-${m}`:t?c=`<${l}.${p}.${+f+1}-0`:c=`<=${c}`,`${r} ${c}`.trim()),vd=(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(ue(t[n].semver),t[n].semver!==qo.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 Kr=V((Kb,Qa)=>{"use strict";var Jr=Symbol("SemVer ANY"),zo=class t{static get ANY(){return Jr}constructor(e,r){if(r=Ha(r),e instanceof t){if(e.loose===!!r.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),Uo("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===Jr?this.value="":this.value=this.operator+this.semver.version,Uo("comp",this)}parse(e){let r=this.options.loose?Ya[Ka.COMPARATORLOOSE]:Ya[Ka.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 Ja(n[2],this.options.loose):this.semver=Jr}toString(){return this.value}test(e){if(Uo("Comparator.test",e,this.options.loose),this.semver===Jr||e===Jr)return!0;if(typeof e=="string")try{e=new Ja(e,this.options)}catch{return!1}return Wo(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 Xa(e.value,r).test(this.value):e.operator===""?e.value===""?!0:new Xa(this.value,r).test(e.semver):(r=Ha(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("=")||Wo(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||Wo(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};Qa.exports=zo;var Ha=vn(),{safeRe:Ya,t:Ka}=xr(),Wo=Lo(),Uo=Hr(),Ja=Te(),Xa=ot()});var Xr=V((Jb,Za)=>{"use strict";var Pd=ot(),Rd=(t,e,r)=>{try{e=new Pd(e,r)}catch{return!1}return e.test(t)};Za.exports=Rd});var tc=V((Xb,ec)=>{"use strict";var _d=ot(),$d=(t,e)=>new _d(t,e).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));ec.exports=$d});var nc=V((Qb,rc)=>{"use strict";var Id=Te(),jd=ot(),Td=(t,e,r)=>{let n=null,o=null,s=null;try{s=new jd(e,r)}catch{return null}return t.forEach(i=>{s.test(i)&&(!n||o.compare(i)===-1)&&(n=i,o=new Id(n,r))}),n};rc.exports=Td});var sc=V((Zb,oc)=>{"use strict";var kd=Te(),Nd=ot(),Dd=(t,e,r)=>{let n=null,o=null,s=null;try{s=new Nd(e,r)}catch{return null}return t.forEach(i=>{s.test(i)&&(!n||o.compare(i)===1)&&(n=i,o=new kd(n,r))}),n};oc.exports=Dd});var cc=V((eS,ac)=>{"use strict";var Go=Te(),Ld=ot(),ic=Yr(),Md=(t,e)=>{t=new Ld(t,e);let r=new Go("0.0.0");if(t.test(r)||(r=new Go("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 Go(i.semver.version);switch(i.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!s||ic(a,s))&&(s=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${i.operator}`)}}),s&&(!r||ic(r,s))&&(r=s)}return r&&t.test(r)?r:null};ac.exports=Md});var pc=V((tS,lc)=>{"use strict";var Fd=ot(),qd=(t,e)=>{try{return new Fd(t,e).range||"*"}catch{return null}};lc.exports=qd});var Ln=V((rS,dc)=>{"use strict";var Wd=Te(),mc=Kr(),{ANY:Ud}=mc,zd=ot(),Gd=Xr(),fc=Yr(),uc=jn(),Vd=kn(),Bd=Tn(),Hd=(t,e,r,n)=>{t=new Wd(t,n),e=new zd(e,n);let o,s,i,a,c;switch(r){case">":o=fc,s=Vd,i=uc,a=">",c=">=";break;case"<":o=uc,s=Bd,i=fc,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Gd(t,e,n))return!1;for(let l=0;l<e.set.length;++l){let p=e.set[l],f=null,m=null;if(p.forEach(d=>{d.semver===Ud&&(d=new mc(">=0.0.0")),f=f||d,m=m||d,o(d.semver,f.semver,n)?f=d:i(d.semver,m.semver,n)&&(m=d)}),f.operator===a||f.operator===c||(!m.operator||m.operator===a)&&s(t,m.semver))return!1;if(m.operator===c&&i(t,m.semver))return!1}return!0};dc.exports=Hd});var gc=V((nS,hc)=>{"use strict";var Yd=Ln(),Kd=(t,e,r)=>Yd(t,e,">",r);hc.exports=Kd});var wc=V((oS,yc)=>{"use strict";var Jd=Ln(),Xd=(t,e,r)=>Jd(t,e,"<",r);yc.exports=Xd});var Ec=V((sS,Sc)=>{"use strict";var bc=ot(),Qd=(t,e,r)=>(t=new bc(t,r),e=new bc(e,r),t.intersects(e,r));Sc.exports=Qd});var xc=V((iS,Oc)=>{"use strict";var Zd=Xr(),eh=nt();Oc.exports=(t,e,r)=>{let n=[],o=null,s=null,i=t.sort((p,f)=>eh(p,f,r));for(let p of i)Zd(p,e,r)?(s=p,o||(o=p)):(s&&n.push([o,s]),s=null,o=null);o&&n.push([o,null]);let a=[];for(let[p,f]of n)p===f?a.push(p):!f&&p===i[0]?a.push("*"):f?p===i[0]?a.push(`<=${f}`):a.push(`${p} - ${f}`):a.push(`>=${p}`);let c=a.join(" || "),l=typeof e.raw=="string"?e.raw:String(e);return c.length<l.length?c:e}});var _c=V((aS,Rc)=>{"use strict";var Ac=ot(),Ho=Kr(),{ANY:Vo}=Ho,Bo=Xr(),Yo=nt(),th=(t,e,r={})=>{if(t===e)return!0;t=new Ac(t,r),e=new Ac(e,r);let n=!1;e:for(let o of t.set){for(let s of e.set){let i=nh(o,s,r);if(n=n||i!==null,i)continue e}if(n)return!1}return!0},rh=[new Ho(">=0.0.0-0")],Cc=[new Ho(">=0.0.0")],nh=(t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===Vo){if(e.length===1&&e[0].semver===Vo)return!0;r.includePrerelease?t=rh:t=Cc}if(e.length===1&&e[0].semver===Vo){if(r.includePrerelease)return!0;e=Cc}let n=new Set,o,s;for(let d of t)d.operator===">"||d.operator===">="?o=vc(o,d,r):d.operator==="<"||d.operator==="<="?s=Pc(s,d,r):n.add(d.semver);if(n.size>1)return null;let i;if(o&&s){if(i=Yo(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&&!Bo(d,String(o),r)||s&&!Bo(d,String(s),r))return null;for(let y of e)if(!Bo(d,String(y),r))return!1;return!0}let a,c,l,p,f=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1,m=o&&!r.includePrerelease&&o.semver.prerelease.length?o.semver:!1;f&&f.prerelease.length===1&&s.operator==="<"&&f.prerelease[0]===0&&(f=!1);for(let d of e){if(p=p||d.operator===">"||d.operator===">=",l=l||d.operator==="<"||d.operator==="<=",o){if(m&&d.semver.prerelease&&d.semver.prerelease.length&&d.semver.major===m.major&&d.semver.minor===m.minor&&d.semver.patch===m.patch&&(m=!1),d.operator===">"||d.operator===">="){if(a=vc(o,d,r),a===d&&a!==o)return!1}else if(o.operator===">="&&!d.test(o.semver))return!1}if(s){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(c=Pc(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&&p&&!o&&i!==0||m||f)},vc=(t,e,r)=>{if(!t)return e;let n=Yo(t.semver,e.semver,r);return n>0?t:n<0||e.operator===">"&&t.operator===">="?e:t},Pc=(t,e,r)=>{if(!t)return e;let n=Yo(t.semver,e.semver,r);return n<0?t:n>0||e.operator==="<"&&t.operator==="<="?e:t};Rc.exports=th});var Mn=V((cS,jc)=>{"use strict";var Ko=xr(),$c=Or(),oh=Te(),Ic=jo(),sh=kt(),ih=ta(),ah=na(),ch=ia(),lh=la(),ph=fa(),fh=ma(),uh=ha(),mh=ya(),dh=nt(),hh=Ea(),gh=xa(),yh=In(),wh=Pa(),bh=_a(),Sh=Yr(),Eh=jn(),Oh=No(),xh=Do(),Ah=Tn(),Ch=kn(),vh=Lo(),Ph=Ma(),Rh=qa(),_h=Kr(),$h=ot(),Ih=Xr(),jh=tc(),Th=nc(),kh=sc(),Nh=cc(),Dh=pc(),Lh=Ln(),Mh=gc(),Fh=wc(),qh=Ec(),Wh=xc(),Uh=_c();jc.exports={parse:sh,valid:ih,clean:ah,inc:ch,diff:lh,major:ph,minor:fh,patch:uh,prerelease:mh,compare:dh,rcompare:hh,compareLoose:gh,compareBuild:yh,sort:wh,rsort:bh,gt:Sh,lt:Eh,eq:Oh,neq:xh,gte:Ah,lte:Ch,cmp:vh,coerce:Ph,truncate:Rh,Comparator:_h,Range:$h,satisfies:Ih,toComparators:jh,maxSatisfying:Th,minSatisfying:kh,minVersion:Nh,validRange:Dh,outside:Lh,gtr:Mh,ltr:Fh,intersects:qh,simplifyRange:Wh,subset:Uh,SemVer:oh,re:Ko.re,src:Ko.src,tokens:Ko.t,SEMVER_SPEC_VERSION:$c.SEMVER_SPEC_VERSION,RELEASE_TYPES:$c.RELEASE_TYPES,compareIdentifiers:Ic.compareIdentifiers,rcompareIdentifiers:Ic.rcompareIdentifiers}});var kc=V((fS,zh)=>{zh.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 es=V((uS,Ct)=>{var Xo=We("fs"),Qo=We("path"),Gh=We("os"),Vh=We("crypto"),Bh=kc(),Zo=Bh.version,Hh=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function Yh(t){let e={},r=t.toString();r=r.replace(/\r\n?/mg,`
8
+ import{a as Fi}from"./chunks/SJCEHWE2.js";import{a as En,b as On,c as xn,d as Ni,e as Er,f as Di}from"./chunks/G66T7F2A.js";import{a as Ti,b as ki}from"./chunks/HNVJYHEV.js";import{a as xi,b as Ai,c as rt,e as Ci,f as Tt,g as Ht,h as vi,i as Pi,j as Po,k as Ri,l as br,m as _e,n as Sn,o as _i,p as $i,q as Ii,r as ji,s as Br,u as Sr}from"./chunks/CUB5GMHZ.js";import{a as Ro}from"./chunks/BXI4SF2U.js";import{a as qi,c as Cn,d as _o,e as Wi,g as Ui}from"./chunks/TZMWTSOQ.js";import{a as dt,b as Ei,c as Oi}from"./chunks/F645HTKX.js";import{c as An,d as Li,f as Mi}from"./chunks/YOV4L7V6.js";import"./chunks/7IULUVWX.js";import{A as hi,B as gi,C as It,D as et,F as yi,G as wi,I as ut,J as gr,M as tt,O as mt,P as xe,Q as ge,R as te,S as hn,T as At,U as jt,V as ye,W as gn,X as A,Y as yr,Z as Be,_ as Vt,a as ci,aa as Bt,b as _t,ba as bi,c as I,ca as wr,d as bt,ea as Si,f as li,g as pi,ga as yn,h as dn,ha as wn,i as vo,l as fi,na as q,o as Ve,oa as bn,q as hr,r as je,s as ui,t as Vr,u as mi,v as $t,z as di}from"./chunks/L2EEGRZN.js";import"./chunks/NEWT5A6S.js";import{a as We,c as V,e as wt}from"./chunks/RFWIIJFG.js";var Or=V((wb,zi)=>{"use strict";var Du="2.0.0",Lu=Number.MAX_SAFE_INTEGER||9007199254740991,Mu=16,Fu=250,qu=["major","premajor","minor","preminor","patch","prepatch","prerelease"];zi.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:Mu,MAX_SAFE_BUILD_LENGTH:Fu,MAX_SAFE_INTEGER:Lu,RELEASE_TYPES:qu,SEMVER_SPEC_VERSION:Du,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Hr=V((bb,Gi)=>{"use strict";var Wu=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};Gi.exports=Wu});var xr=V((St,Vi)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:$o,MAX_SAFE_BUILD_LENGTH:Uu,MAX_LENGTH:zu}=Or(),Gu=Hr();St=Vi.exports={};var Vu=St.re=[],Bu=St.safeRe=[],j=St.src=[],Hu=St.safeSrc=[],T=St.t={},Yu=0,Io="[a-zA-Z0-9-]",Ku=[["\\s",1],["\\d",zu],[Io,Uu]],Ju=t=>{for(let[e,r]of Ku)t=t.split(`${e}*`).join(`${e}{0,${r}}`).split(`${e}+`).join(`${e}{1,${r}}`);return t},Z=(t,e,r)=>{let n=Ju(e),o=Yu++;Gu(t,o,e),T[t]=o,j[o]=e,Hu[o]=n,Vu[o]=new RegExp(e,r?"g":void 0),Bu[o]=new RegExp(n,r?"g":void 0)};Z("NUMERICIDENTIFIER","0|[1-9]\\d*");Z("NUMERICIDENTIFIERLOOSE","\\d+");Z("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Io}*`);Z("MAINVERSION",`(${j[T.NUMERICIDENTIFIER]})\\.(${j[T.NUMERICIDENTIFIER]})\\.(${j[T.NUMERICIDENTIFIER]})`);Z("MAINVERSIONLOOSE",`(${j[T.NUMERICIDENTIFIERLOOSE]})\\.(${j[T.NUMERICIDENTIFIERLOOSE]})\\.(${j[T.NUMERICIDENTIFIERLOOSE]})`);Z("PRERELEASEIDENTIFIER",`(?:${j[T.NONNUMERICIDENTIFIER]}|${j[T.NUMERICIDENTIFIER]})`);Z("PRERELEASEIDENTIFIERLOOSE",`(?:${j[T.NONNUMERICIDENTIFIER]}|${j[T.NUMERICIDENTIFIERLOOSE]})`);Z("PRERELEASE",`(?:-(${j[T.PRERELEASEIDENTIFIER]}(?:\\.${j[T.PRERELEASEIDENTIFIER]})*))`);Z("PRERELEASELOOSE",`(?:-?(${j[T.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${j[T.PRERELEASEIDENTIFIERLOOSE]})*))`);Z("BUILDIDENTIFIER",`${Io}+`);Z("BUILD",`(?:\\+(${j[T.BUILDIDENTIFIER]}(?:\\.${j[T.BUILDIDENTIFIER]})*))`);Z("FULLPLAIN",`v?${j[T.MAINVERSION]}${j[T.PRERELEASE]}?${j[T.BUILD]}?`);Z("FULL",`^${j[T.FULLPLAIN]}$`);Z("LOOSEPLAIN",`[v=\\s]*${j[T.MAINVERSIONLOOSE]}${j[T.PRERELEASELOOSE]}?${j[T.BUILD]}?`);Z("LOOSE",`^${j[T.LOOSEPLAIN]}$`);Z("GTLT","((?:<|>)?=?)");Z("XRANGEIDENTIFIERLOOSE",`${j[T.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);Z("XRANGEIDENTIFIER",`${j[T.NUMERICIDENTIFIER]}|x|X|\\*`);Z("XRANGEPLAIN",`[v=\\s]*(${j[T.XRANGEIDENTIFIER]})(?:\\.(${j[T.XRANGEIDENTIFIER]})(?:\\.(${j[T.XRANGEIDENTIFIER]})(?:${j[T.PRERELEASE]})?${j[T.BUILD]}?)?)?`);Z("XRANGEPLAINLOOSE",`[v=\\s]*(${j[T.XRANGEIDENTIFIERLOOSE]})(?:\\.(${j[T.XRANGEIDENTIFIERLOOSE]})(?:\\.(${j[T.XRANGEIDENTIFIERLOOSE]})(?:${j[T.PRERELEASELOOSE]})?${j[T.BUILD]}?)?)?`);Z("XRANGE",`^${j[T.GTLT]}\\s*${j[T.XRANGEPLAIN]}$`);Z("XRANGELOOSE",`^${j[T.GTLT]}\\s*${j[T.XRANGEPLAINLOOSE]}$`);Z("COERCEPLAIN",`(^|[^\\d])(\\d{1,${$o}})(?:\\.(\\d{1,${$o}}))?(?:\\.(\\d{1,${$o}}))?`);Z("COERCE",`${j[T.COERCEPLAIN]}(?:$|[^\\d])`);Z("COERCEFULL",j[T.COERCEPLAIN]+`(?:${j[T.PRERELEASE]})?(?:${j[T.BUILD]})?(?:$|[^\\d])`);Z("COERCERTL",j[T.COERCE],!0);Z("COERCERTLFULL",j[T.COERCEFULL],!0);Z("LONETILDE","(?:~>?)");Z("TILDETRIM",`(\\s*)${j[T.LONETILDE]}\\s+`,!0);St.tildeTrimReplace="$1~";Z("TILDE",`^${j[T.LONETILDE]}${j[T.XRANGEPLAIN]}$`);Z("TILDELOOSE",`^${j[T.LONETILDE]}${j[T.XRANGEPLAINLOOSE]}$`);Z("LONECARET","(?:\\^)");Z("CARETTRIM",`(\\s*)${j[T.LONECARET]}\\s+`,!0);St.caretTrimReplace="$1^";Z("CARET",`^${j[T.LONECARET]}${j[T.XRANGEPLAIN]}$`);Z("CARETLOOSE",`^${j[T.LONECARET]}${j[T.XRANGEPLAINLOOSE]}$`);Z("COMPARATORLOOSE",`^${j[T.GTLT]}\\s*(${j[T.LOOSEPLAIN]})$|^$`);Z("COMPARATOR",`^${j[T.GTLT]}\\s*(${j[T.FULLPLAIN]})$|^$`);Z("COMPARATORTRIM",`(\\s*)${j[T.GTLT]}\\s*(${j[T.LOOSEPLAIN]}|${j[T.XRANGEPLAIN]})`,!0);St.comparatorTrimReplace="$1$2$3";Z("HYPHENRANGE",`^\\s*(${j[T.XRANGEPLAIN]})\\s+-\\s+(${j[T.XRANGEPLAIN]})\\s*$`);Z("HYPHENRANGELOOSE",`^\\s*(${j[T.XRANGEPLAINLOOSE]})\\s+-\\s+(${j[T.XRANGEPLAINLOOSE]})\\s*$`);Z("STAR","(<|>)?=?\\s*\\*");Z("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");Z("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var vn=V((Sb,Bi)=>{"use strict";var Xu=Object.freeze({loose:!0}),Qu=Object.freeze({}),Zu=t=>t?typeof t!="object"?Xu:t:Qu;Bi.exports=Zu});var jo=V((Eb,Ki)=>{"use strict";var Hi=/^[0-9]+$/,Yi=(t,e)=>{if(typeof t=="number"&&typeof e=="number")return t===e?0:t<e?-1:1;let r=Hi.test(t),n=Hi.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t<e?-1:1},em=(t,e)=>Yi(e,t);Ki.exports={compareIdentifiers:Yi,rcompareIdentifiers:em}});var Te=V((Ob,Xi)=>{"use strict";var Pn=Hr(),{MAX_LENGTH:Ji,MAX_SAFE_INTEGER:Rn}=Or(),{safeRe:_n,t:$n}=xr(),tm=vn(),{compareIdentifiers:To}=jo(),rm=(t,e)=>{let r=e.split(".");if(r.length>t.length)return!1;for(let n=0;n<r.length;n++)if(To(t[n],r[n])!==0)return!1;return!0},ko=class t{constructor(e,r){if(r=tm(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>Ji)throw new TypeError(`version is longer than ${Ji} characters`);Pn("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=e.trim().match(r.loose?_n[$n.LOOSE]:_n[$n.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>Rn||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Rn||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Rn||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<Rn)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(Pn("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(Pn("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 To(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(Pn("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 To(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?_n[$n.PRERELEASELOOSE]:_n[$n.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]),rm(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}};Xi.exports=ko});var kt=V((xb,Zi)=>{"use strict";var Qi=Te(),nm=(t,e,r=!1)=>{if(t instanceof Qi)return t;try{return new Qi(t,e)}catch(n){if(!r)return null;throw n}};Zi.exports=nm});var ta=V((Ab,ea)=>{"use strict";var om=kt(),sm=(t,e)=>{let r=om(t,e);return r?r.version:null};ea.exports=sm});var na=V((Cb,ra)=>{"use strict";var im=kt(),am=(t,e)=>{let r=im(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null};ra.exports=am});var ia=V((vb,sa)=>{"use strict";var oa=Te(),cm=(t,e,r,n,o)=>{typeof r=="string"&&(o=n,n=r,r=void 0);try{return new oa(t instanceof oa?t.version:t,r).inc(e,n,o).version}catch{return null}};sa.exports=cm});var la=V((Pb,ca)=>{"use strict";var aa=kt(),lm=(t,e)=>{let r=aa(t,null,!0),n=aa(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 p=c?"pre":"";return r.major!==n.major?p+"major":r.minor!==n.minor?p+"minor":r.patch!==n.patch?p+"patch":"prerelease"};ca.exports=lm});var fa=V((Rb,pa)=>{"use strict";var pm=Te(),fm=(t,e)=>new pm(t,e).major;pa.exports=fm});var ma=V((_b,ua)=>{"use strict";var um=Te(),mm=(t,e)=>new um(t,e).minor;ua.exports=mm});var ha=V(($b,da)=>{"use strict";var dm=Te(),hm=(t,e)=>new dm(t,e).patch;da.exports=hm});var ya=V((Ib,ga)=>{"use strict";var gm=kt(),ym=(t,e)=>{let r=gm(t,e);return r&&r.prerelease.length?r.prerelease:null};ga.exports=ym});var nt=V((jb,ba)=>{"use strict";var wa=Te(),wm=(t,e,r)=>new wa(t,r).compare(new wa(e,r));ba.exports=wm});var Ea=V((Tb,Sa)=>{"use strict";var bm=nt(),Sm=(t,e,r)=>bm(e,t,r);Sa.exports=Sm});var xa=V((kb,Oa)=>{"use strict";var Em=nt(),Om=(t,e)=>Em(t,e,!0);Oa.exports=Om});var In=V((Nb,Ca)=>{"use strict";var Aa=Te(),xm=(t,e,r)=>{let n=new Aa(t,r),o=new Aa(e,r);return n.compare(o)||n.compareBuild(o)};Ca.exports=xm});var Pa=V((Db,va)=>{"use strict";var Am=In(),Cm=(t,e)=>t.sort((r,n)=>Am(r,n,e));va.exports=Cm});var _a=V((Lb,Ra)=>{"use strict";var vm=In(),Pm=(t,e)=>t.sort((r,n)=>vm(n,r,e));Ra.exports=Pm});var Yr=V((Mb,$a)=>{"use strict";var Rm=nt(),_m=(t,e,r)=>Rm(t,e,r)>0;$a.exports=_m});var jn=V((Fb,Ia)=>{"use strict";var $m=nt(),Im=(t,e,r)=>$m(t,e,r)<0;Ia.exports=Im});var No=V((qb,ja)=>{"use strict";var jm=nt(),Tm=(t,e,r)=>jm(t,e,r)===0;ja.exports=Tm});var Do=V((Wb,Ta)=>{"use strict";var km=nt(),Nm=(t,e,r)=>km(t,e,r)!==0;Ta.exports=Nm});var Tn=V((Ub,ka)=>{"use strict";var Dm=nt(),Lm=(t,e,r)=>Dm(t,e,r)>=0;ka.exports=Lm});var kn=V((zb,Na)=>{"use strict";var Mm=nt(),Fm=(t,e,r)=>Mm(t,e,r)<=0;Na.exports=Fm});var Lo=V((Gb,Da)=>{"use strict";var qm=No(),Wm=Do(),Um=Yr(),zm=Tn(),Gm=jn(),Vm=kn(),Bm=(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 qm(t,r,n);case"!=":return Wm(t,r,n);case">":return Um(t,r,n);case">=":return zm(t,r,n);case"<":return Gm(t,r,n);case"<=":return Vm(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}};Da.exports=Bm});var Ma=V((Vb,La)=>{"use strict";var Hm=Te(),Ym=kt(),{safeRe:Nn,t:Dn}=xr(),Km=(t,e)=>{if(t instanceof Hm)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?Nn[Dn.COERCEFULL]:Nn[Dn.COERCE]);else{let c=e.includePrerelease?Nn[Dn.COERCERTLFULL]:Nn[Dn.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 Ym(`${n}.${o}.${s}${i}${a}`,e)};La.exports=Km});var qa=V((Bb,Fa)=>{"use strict";var Jm=kt(),Xm=Or(),Qm=Te(),Zm=(t,e,r)=>{if(!Xm.RELEASE_TYPES.includes(e))return null;let n=ed(t,r);return n&&td(n,e)},ed=(t,e)=>{let r=t instanceof Qm?t.version:t;return Jm(r,e)},td=(t,e)=>{if(rd(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()},rd=t=>t.startsWith("pre");Fa.exports=Zm});var Ua=V((Hb,Wa)=>{"use strict";var Mo=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}};Wa.exports=Mo});var ot=V((Yb,Ba)=>{"use strict";var nd=/\s+/g,Fo=class t{constructor(e,r){if(r=sd(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof qo)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(nd," "),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=>!Ga(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&&dd(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(md,"");let n=((this.options.includePrerelease&&fd)|(this.options.loose&&ud))+":"+e,o=za.get(n);if(o)return o;let s=this.options.loose,i=s?Me[ke.HYPHENRANGELOOSE]:Me[ke.HYPHENRANGE];e=e.replace(i,Cd(this.options.includePrerelease)),ue("hyphen replace",e),e=e.replace(Me[ke.COMPARATORTRIM],cd),ue("comparator trim",e),e=e.replace(Me[ke.TILDETRIM],ld),ue("tilde trim",e),e=e.replace(Me[ke.CARETTRIM],pd),ue("caret trim",e);let a=e.split(" ").map(f=>hd(f,this.options)).join(" ").split(/\s+/).map(f=>Ad(f,this.options));s&&(a=a.filter(f=>(ue("loose invalid filter",f,this.options),!!f.match(Me[ke.COMPARATORLOOSE])))),ue("range list",a);let c=new Map,l=a.map(f=>new qo(f,this.options));for(let f of l){if(Ga(f))return[f];c.set(f.value,f)}c.size>1&&c.has("")&&c.delete("");let p=[...c.values()];return za.set(n,p),p}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(n=>Va(n,r)&&e.set.some(o=>Va(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 id(e,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(vd(this.set[r],e,this.options))return!0;return!1}};Ba.exports=Fo;var od=Ua(),za=new od,sd=vn(),qo=Kr(),ue=Hr(),id=Te(),{safeRe:Me,src:ad,t:ke,comparatorTrimReplace:cd,tildeTrimReplace:ld,caretTrimReplace:pd}=xr(),{FLAG_INCLUDE_PRERELEASE:fd,FLAG_LOOSE:ud}=Or(),md=new RegExp(ad[ke.BUILD],"g"),Ga=t=>t.value==="<0.0.0-0",dd=t=>t.value==="",Va=(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},hd=(t,e)=>(t=t.replace(Me[ke.BUILD],""),ue("comp",t,e),t=bd(t,e),ue("caret",t),t=yd(t,e),ue("tildes",t),t=Ed(t,e),ue("xrange",t),t=xd(t,e),ue("stars",t),t),Ce=t=>!t||t.toLowerCase()==="x"||t==="*",gd=(t,e,r)=>Ce(t)&&!Ce(e)||Ce(e)&&r&&!Ce(r),yd=(t,e)=>t.trim().split(/\s+/).map(r=>wd(r,e)).join(" "),wd=(t,e)=>{let r=e.loose?Me[ke.TILDELOOSE]:Me[ke.TILDE],n=e.includePrerelease?"-0":"";return t.replace(r,(o,s,i,a,c)=>{ue("tilde",t,o,s,i,a,c);let l;return Ce(s)?l="":Ce(i)?l=`>=${s}.0.0${n} <${+s+1}.0.0-0`:Ce(a)?l=`>=${s}.${i}.0${n} <${s}.${+i+1}.0-0`:c?(ue("replaceTilde pr",c),l=`>=${s}.${i}.${a}-${c} <${s}.${+i+1}.0-0`):l=`>=${s}.${i}.${a} <${s}.${+i+1}.0-0`,ue("tilde return",l),l})},bd=(t,e)=>t.trim().split(/\s+/).map(r=>Sd(r,e)).join(" "),Sd=(t,e)=>{ue("caret",t,e);let r=e.loose?Me[ke.CARETLOOSE]:Me[ke.CARET],n=e.includePrerelease?"-0":"";return t.replace(r,(o,s,i,a,c)=>{ue("caret",t,o,s,i,a,c);let l;return Ce(s)?l="":Ce(i)?l=`>=${s}.0.0${n} <${+s+1}.0.0-0`:Ce(a)?s==="0"?l=`>=${s}.${i}.0${n} <${s}.${+i+1}.0-0`:l=`>=${s}.${i}.0${n} <${+s+1}.0.0-0`:c?(ue("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`):(ue("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`),ue("caret return",l),l})},Ed=(t,e)=>(ue("replaceXRanges",t,e),t.split(/\s+/).map(r=>Od(r,e)).join(" ")),Od=(t,e)=>{t=t.trim();let r=e.loose?Me[ke.XRANGELOOSE]:Me[ke.XRANGE];return t.replace(r,(n,o,s,i,a,c)=>{if(ue("xRange",t,n,o,s,i,a,c),gd(s,i,a))return t;let l=Ce(s),p=l||Ce(i),f=p||Ce(a),m=f;return o==="="&&m&&(o=""),c=e.includePrerelease?"-0":"",l?o===">"||o==="<"?n="<0.0.0-0":n="*":o&&m?(p&&(i=0),a=0,o===">"?(o=">=",p?(s=+s+1,i=0,a=0):(i=+i+1,a=0)):o==="<="&&(o="<",p?s=+s+1:i=+i+1),o==="<"&&(c="-0"),n=`${o+s}.${i}.${a}${c}`):p?n=`>=${s}.0.0${c} <${+s+1}.0.0-0`:f&&(n=`>=${s}.${i}.0${c} <${s}.${+i+1}.0-0`),ue("xRange return",n),n})},xd=(t,e)=>(ue("replaceStars",t,e),t.trim().replace(Me[ke.STAR],"")),Ad=(t,e)=>(ue("replaceGTE0",t,e),t.trim().replace(Me[e.includePrerelease?ke.GTE0PRE:ke.GTE0],"")),Cd=t=>(e,r,n,o,s,i,a,c,l,p,f,m)=>(Ce(n)?r="":Ce(o)?r=`>=${n}.0.0${t?"-0":""}`:Ce(s)?r=`>=${n}.${o}.0${t?"-0":""}`:i?r=`>=${r}`:r=`>=${r}${t?"-0":""}`,Ce(l)?c="":Ce(p)?c=`<${+l+1}.0.0-0`:Ce(f)?c=`<${l}.${+p+1}.0-0`:m?c=`<=${l}.${p}.${f}-${m}`:t?c=`<${l}.${p}.${+f+1}-0`:c=`<=${c}`,`${r} ${c}`.trim()),vd=(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(ue(t[n].semver),t[n].semver!==qo.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 Kr=V((Kb,Qa)=>{"use strict";var Jr=Symbol("SemVer ANY"),zo=class t{static get ANY(){return Jr}constructor(e,r){if(r=Ha(r),e instanceof t){if(e.loose===!!r.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),Uo("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===Jr?this.value="":this.value=this.operator+this.semver.version,Uo("comp",this)}parse(e){let r=this.options.loose?Ya[Ka.COMPARATORLOOSE]:Ya[Ka.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 Ja(n[2],this.options.loose):this.semver=Jr}toString(){return this.value}test(e){if(Uo("Comparator.test",e,this.options.loose),this.semver===Jr||e===Jr)return!0;if(typeof e=="string")try{e=new Ja(e,this.options)}catch{return!1}return Wo(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 Xa(e.value,r).test(this.value):e.operator===""?e.value===""?!0:new Xa(this.value,r).test(e.semver):(r=Ha(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("=")||Wo(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||Wo(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};Qa.exports=zo;var Ha=vn(),{safeRe:Ya,t:Ka}=xr(),Wo=Lo(),Uo=Hr(),Ja=Te(),Xa=ot()});var Xr=V((Jb,Za)=>{"use strict";var Pd=ot(),Rd=(t,e,r)=>{try{e=new Pd(e,r)}catch{return!1}return e.test(t)};Za.exports=Rd});var tc=V((Xb,ec)=>{"use strict";var _d=ot(),$d=(t,e)=>new _d(t,e).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));ec.exports=$d});var nc=V((Qb,rc)=>{"use strict";var Id=Te(),jd=ot(),Td=(t,e,r)=>{let n=null,o=null,s=null;try{s=new jd(e,r)}catch{return null}return t.forEach(i=>{s.test(i)&&(!n||o.compare(i)===-1)&&(n=i,o=new Id(n,r))}),n};rc.exports=Td});var sc=V((Zb,oc)=>{"use strict";var kd=Te(),Nd=ot(),Dd=(t,e,r)=>{let n=null,o=null,s=null;try{s=new Nd(e,r)}catch{return null}return t.forEach(i=>{s.test(i)&&(!n||o.compare(i)===1)&&(n=i,o=new kd(n,r))}),n};oc.exports=Dd});var cc=V((eS,ac)=>{"use strict";var Go=Te(),Ld=ot(),ic=Yr(),Md=(t,e)=>{t=new Ld(t,e);let r=new Go("0.0.0");if(t.test(r)||(r=new Go("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 Go(i.semver.version);switch(i.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!s||ic(a,s))&&(s=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${i.operator}`)}}),s&&(!r||ic(r,s))&&(r=s)}return r&&t.test(r)?r:null};ac.exports=Md});var pc=V((tS,lc)=>{"use strict";var Fd=ot(),qd=(t,e)=>{try{return new Fd(t,e).range||"*"}catch{return null}};lc.exports=qd});var Ln=V((rS,dc)=>{"use strict";var Wd=Te(),mc=Kr(),{ANY:Ud}=mc,zd=ot(),Gd=Xr(),fc=Yr(),uc=jn(),Vd=kn(),Bd=Tn(),Hd=(t,e,r,n)=>{t=new Wd(t,n),e=new zd(e,n);let o,s,i,a,c;switch(r){case">":o=fc,s=Vd,i=uc,a=">",c=">=";break;case"<":o=uc,s=Bd,i=fc,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Gd(t,e,n))return!1;for(let l=0;l<e.set.length;++l){let p=e.set[l],f=null,m=null;if(p.forEach(d=>{d.semver===Ud&&(d=new mc(">=0.0.0")),f=f||d,m=m||d,o(d.semver,f.semver,n)?f=d:i(d.semver,m.semver,n)&&(m=d)}),f.operator===a||f.operator===c||(!m.operator||m.operator===a)&&s(t,m.semver))return!1;if(m.operator===c&&i(t,m.semver))return!1}return!0};dc.exports=Hd});var gc=V((nS,hc)=>{"use strict";var Yd=Ln(),Kd=(t,e,r)=>Yd(t,e,">",r);hc.exports=Kd});var wc=V((oS,yc)=>{"use strict";var Jd=Ln(),Xd=(t,e,r)=>Jd(t,e,"<",r);yc.exports=Xd});var Ec=V((sS,Sc)=>{"use strict";var bc=ot(),Qd=(t,e,r)=>(t=new bc(t,r),e=new bc(e,r),t.intersects(e,r));Sc.exports=Qd});var xc=V((iS,Oc)=>{"use strict";var Zd=Xr(),eh=nt();Oc.exports=(t,e,r)=>{let n=[],o=null,s=null,i=t.sort((p,f)=>eh(p,f,r));for(let p of i)Zd(p,e,r)?(s=p,o||(o=p)):(s&&n.push([o,s]),s=null,o=null);o&&n.push([o,null]);let a=[];for(let[p,f]of n)p===f?a.push(p):!f&&p===i[0]?a.push("*"):f?p===i[0]?a.push(`<=${f}`):a.push(`${p} - ${f}`):a.push(`>=${p}`);let c=a.join(" || "),l=typeof e.raw=="string"?e.raw:String(e);return c.length<l.length?c:e}});var _c=V((aS,Rc)=>{"use strict";var Ac=ot(),Ho=Kr(),{ANY:Vo}=Ho,Bo=Xr(),Yo=nt(),th=(t,e,r={})=>{if(t===e)return!0;t=new Ac(t,r),e=new Ac(e,r);let n=!1;e:for(let o of t.set){for(let s of e.set){let i=nh(o,s,r);if(n=n||i!==null,i)continue e}if(n)return!1}return!0},rh=[new Ho(">=0.0.0-0")],Cc=[new Ho(">=0.0.0")],nh=(t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===Vo){if(e.length===1&&e[0].semver===Vo)return!0;r.includePrerelease?t=rh:t=Cc}if(e.length===1&&e[0].semver===Vo){if(r.includePrerelease)return!0;e=Cc}let n=new Set,o,s;for(let d of t)d.operator===">"||d.operator===">="?o=vc(o,d,r):d.operator==="<"||d.operator==="<="?s=Pc(s,d,r):n.add(d.semver);if(n.size>1)return null;let i;if(o&&s){if(i=Yo(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&&!Bo(d,String(o),r)||s&&!Bo(d,String(s),r))return null;for(let y of e)if(!Bo(d,String(y),r))return!1;return!0}let a,c,l,p,f=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1,m=o&&!r.includePrerelease&&o.semver.prerelease.length?o.semver:!1;f&&f.prerelease.length===1&&s.operator==="<"&&f.prerelease[0]===0&&(f=!1);for(let d of e){if(p=p||d.operator===">"||d.operator===">=",l=l||d.operator==="<"||d.operator==="<=",o){if(m&&d.semver.prerelease&&d.semver.prerelease.length&&d.semver.major===m.major&&d.semver.minor===m.minor&&d.semver.patch===m.patch&&(m=!1),d.operator===">"||d.operator===">="){if(a=vc(o,d,r),a===d&&a!==o)return!1}else if(o.operator===">="&&!d.test(o.semver))return!1}if(s){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(c=Pc(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&&p&&!o&&i!==0||m||f)},vc=(t,e,r)=>{if(!t)return e;let n=Yo(t.semver,e.semver,r);return n>0?t:n<0||e.operator===">"&&t.operator===">="?e:t},Pc=(t,e,r)=>{if(!t)return e;let n=Yo(t.semver,e.semver,r);return n<0?t:n>0||e.operator==="<"&&t.operator==="<="?e:t};Rc.exports=th});var Mn=V((cS,jc)=>{"use strict";var Ko=xr(),$c=Or(),oh=Te(),Ic=jo(),sh=kt(),ih=ta(),ah=na(),ch=ia(),lh=la(),ph=fa(),fh=ma(),uh=ha(),mh=ya(),dh=nt(),hh=Ea(),gh=xa(),yh=In(),wh=Pa(),bh=_a(),Sh=Yr(),Eh=jn(),Oh=No(),xh=Do(),Ah=Tn(),Ch=kn(),vh=Lo(),Ph=Ma(),Rh=qa(),_h=Kr(),$h=ot(),Ih=Xr(),jh=tc(),Th=nc(),kh=sc(),Nh=cc(),Dh=pc(),Lh=Ln(),Mh=gc(),Fh=wc(),qh=Ec(),Wh=xc(),Uh=_c();jc.exports={parse:sh,valid:ih,clean:ah,inc:ch,diff:lh,major:ph,minor:fh,patch:uh,prerelease:mh,compare:dh,rcompare:hh,compareLoose:gh,compareBuild:yh,sort:wh,rsort:bh,gt:Sh,lt:Eh,eq:Oh,neq:xh,gte:Ah,lte:Ch,cmp:vh,coerce:Ph,truncate:Rh,Comparator:_h,Range:$h,satisfies:Ih,toComparators:jh,maxSatisfying:Th,minSatisfying:kh,minVersion:Nh,validRange:Dh,outside:Lh,gtr:Mh,ltr:Fh,intersects:qh,simplifyRange:Wh,subset:Uh,SemVer:oh,re:Ko.re,src:Ko.src,tokens:Ko.t,SEMVER_SPEC_VERSION:$c.SEMVER_SPEC_VERSION,RELEASE_TYPES:$c.RELEASE_TYPES,compareIdentifiers:Ic.compareIdentifiers,rcompareIdentifiers:Ic.rcompareIdentifiers}});var kc=V((fS,zh)=>{zh.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 es=V((uS,Ct)=>{var Xo=We("fs"),Qo=We("path"),Gh=We("os"),Vh=We("crypto"),Bh=kc(),Zo=Bh.version,Hh=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function Yh(t){let e={},r=t.toString();r=r.replace(/\r\n?/mg,`
9
9
  `);let n;for(;(n=Hh.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 Kh(t){let e=Lc(t),r=ve.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=Dc(t).split(","),o=n.length,s;for(let i=0;i<o;i++)try{let a=n[i].trim(),c=Qh(r,a);s=ve.decrypt(c.ciphertext,c.key);break}catch(a){if(i+1>=o)throw a}return ve.parse(s)}function Jh(t){console.log(`[dotenv@${Zo}][INFO] ${t}`)}function Xh(t){console.log(`[dotenv@${Zo}][WARN] ${t}`)}function Fn(t){console.log(`[dotenv@${Zo}][DEBUG] ${t}`)}function Dc(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 Qh(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 Lc(t){let e=null;if(t&&t.path&&t.path.length>0)if(Array.isArray(t.path))for(let r of t.path)Xo.existsSync(r)&&(e=r.endsWith(".vault")?r:`${r}.vault`);else e=t.path.endsWith(".vault")?t.path:`${t.path}.vault`;else e=Qo.resolve(process.cwd(),".env.vault");return Xo.existsSync(e)?e:null}function Nc(t){return t[0]==="~"?Qo.join(Gh.homedir(),t.slice(1)):t}function Zh(t){Jh("Loading env from encrypted .env.vault");let e=ve._parseVault(t),r=process.env;return t&&t.processEnv!=null&&(r=t.processEnv),ve.populate(r,e,t),{parsed:e}}function eg(t){let e=Qo.resolve(process.cwd(),".env"),r="utf8",n=!!(t&&t.debug);t&&t.encoding?r=t.encoding:n&&Fn("No encoding is specified. UTF-8 is used by default");let o=[e];if(t&&t.path)if(!Array.isArray(t.path))o=[Nc(t.path)];else{o=[];for(let c of t.path)o.push(Nc(c))}let s,i={};for(let c of o)try{let l=ve.parse(Xo.readFileSync(c,{encoding:r}));ve.populate(i,l,t)}catch(l){n&&Fn(`Failed to load ${c} ${l.message}`),s=l}let a=process.env;return t&&t.processEnv!=null&&(a=t.processEnv),ve.populate(a,i,t),s?{parsed:i,error:s}:{parsed:i}}function tg(t){if(Dc(t).length===0)return ve.configDotenv(t);let e=Lc(t);return e?ve._configVault(t):(Xh(`You set DOTENV_KEY but you are missing a .env.vault file at ${e}. Did you forget to build it?`),ve.configDotenv(t))}function rg(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=Vh.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 p=new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw p.code="INVALID_DOTENV_KEY",p}else if(l){let p=new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw p.code="DECRYPTION_FAILED",p}else throw i}}function ng(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&&Fn(o===!0?`"${s}" is already defined and WAS overwritten`:`"${s}" is already defined and was NOT overwritten`)):t[s]=e[s]}var ve={configDotenv:eg,_configVault:Zh,_parseVault:Kh,config:tg,decrypt:rg,parse:Yh,populate:ng};Ct.exports.configDotenv=ve.configDotenv;Ct.exports._configVault=ve._configVault;Ct.exports._parseVault=ve._parseVault;Ct.exports.config=ve.config;Ct.exports.decrypt=ve.decrypt;Ct.exports.parse=ve.parse;Ct.exports.populate=ve.populate;Ct.exports=ve});var Jp=V(Bs=>{"use strict";Bs.parse=uw;Bs.serialize=mw;var iw=Object.prototype.toString,aw=Object.prototype.hasOwnProperty,cw=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,lw=/^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/,pw=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,fw=/^[\u0020-\u003A\u003D-\u007E]*$/;function uw(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||dw,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=Yp(t,s,i),l=Kp(t,i,c),p=t.slice(c,l);if(!aw.call(r,p)){var f=Yp(t,i+1,a),m=Kp(t,a,f);t.charCodeAt(f)===34&&t.charCodeAt(m-1)===34&&(f++,m--);var d=t.slice(f,m);r[p]=gw(d,o)}s=a+1}while(s<n);return r}function Yp(t,e,r){do{var n=t.charCodeAt(e);if(n!==32&&n!==9)return e}while(++e<r);return r}function Kp(t,e,r){for(;e>r;){var n=t.charCodeAt(--e);if(n!==32&&n!==9)return e+1}return r}function mw(t,e,r){var n=r&&r.encode||encodeURIComponent;if(typeof n!="function")throw new TypeError("option encode is invalid");if(!cw.test(t))throw new TypeError("argument name is invalid");var o=n(e);if(!lw.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(!pw.test(r.domain))throw new TypeError("option domain is invalid");s+="; Domain="+r.domain}if(r.path){if(!fw.test(r.path))throw new TypeError("option path is invalid");s+="; Path="+r.path}if(r.expires){var a=r.expires;if(!hw(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 dw(t){return t.indexOf("%")!==-1?decodeURIComponent(t):t}function hw(t){return iw.call(t)==="[object Date]"}function gw(t,e){try{return e(t)}catch{return t}}});var ef=V((OC,pn)=>{"use strict";var po={decodeValues:!0,map:!1,silent:!1};function Hs(t){return typeof t=="string"&&!!t.trim()}function Ys(t,e){var r=t.split(";").filter(Hs),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("="),p=l.shift().trimLeft().toLowerCase(),f=l.join("=");p==="expires"?a.expires=new Date(f):p==="max-age"?a.maxAge=parseInt(f,10):p==="secure"?a.secure=!0:p==="httponly"?a.httpOnly=!0:p==="samesite"?a.sameSite=f:p==="partitioned"?a.partitioned=!0:a[p]=f}),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 Zp(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(Hs).reduce(function(o,s){var i=Ys(s,e);return o[i.name]=i,o},n)}else return t.filter(Hs).map(function(o){return Ys(o,e)})}function ww(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}pn.exports=Zp;pn.exports.parse=Zp;pn.exports.parseString=Ys;pn.exports.splitCookiesString=ww});var Tc=wt(Mn(),1);import*as Jo from"node:process";try{let t=Oi?.node;typeof t=="string"&&!Tc.satisfies(Jo.version,t)&&A.warn(`
11
11
  \u26A0\uFE0F Warning: failed to satisfy expected node version. Expected: "${t}", Current "${Jo.version}"
@@ -131,7 +131,7 @@ Eject that one and set the framework in your copy's default export:
131
131
  # then in generators/tanstack-query/index.ts: run: tanstackQueryGenerator('${n}')
132
132
  `);return}if(!_r.has(r))throw de.eject_generator_outcome="unknown-generator",new q(`
133
133
  \u274C Unknown generator "${r}". Ejectable generators: ${[..._r].join(", ")}.
134
- `);let o=iy(),s=ay(o,r),{GENERATOR_VERSION:i}=await import("./chunks/4JE7GYQB.js"),a=ny(t.dir??"./generators"),c=s===void 0?re(a,`${r}.mjs`):re(a,r,"index.ts"),l=pt(process.cwd(),c)||c;if(t.update){if(s===void 0){let E=De(re(o,"generators",`${r}.mjs`),"utf-8");fy({name:r,asset:E,toolkitVersion:i,assetsDir:o,dir:a,target:c,printedTarget:l})}else py({name:r,files:s,toolkitVersion:i,assetsDir:o,dir:a,targetDir:re(a,r)});return}if(Ne(c)&&!t.force)throw de.eject_generator_outcome="already-exists",new q(`
134
+ `);let o=iy(),s=ay(o,r),{GENERATOR_VERSION:i}=await import("./chunks/NSK6GPZU.js"),a=ny(t.dir??"./generators"),c=s===void 0?re(a,`${r}.mjs`):re(a,r,"index.ts"),l=pt(process.cwd(),c)||c;if(t.update){if(s===void 0){let E=De(re(o,"generators",`${r}.mjs`),"utf-8");fy({name:r,asset:E,toolkitVersion:i,assetsDir:o,dir:a,target:c,printedTarget:l})}else py({name:r,files:s,toolkitVersion:i,assetsDir:o,dir:a,targetDir:re(a,r)});return}if(Ne(c)&&!t.force)throw de.eject_generator_outcome="already-exists",new q(`
135
135
  \u274C ${l} already exists. Use --update to merge the newer version in, or --force to overwrite.
136
136
  `);$s(nn(c),{recursive:!0});let p=s===void 0?[De(re(o,"generators",`${r}.mjs`),"utf-8")]:s.map(E=>De(re(o,"generators",r,E),"utf-8"));s===void 0?be(c,p[0],"utf-8"):s.forEach((E,v)=>{be(re(a,r,E),p[v],"utf-8")});let f=zl("client-generators",o),m=zl(`${r}-generator`,o);Is(a,Ts(a));let d=`./${pt(e.configPath===void 0?process.cwd():ql(nn(e.configPath)),ql(c)).split("\\").join("/")}`,y=ks({[Ue]:i}),h=p.some(E=>E.includes(`from "${Ps}"`)||E.includes(`from '${Ps}'`)),S=ly(e.configPath,r,d),O=s===void 0?l:pt(process.cwd(),re(a,r))+"/";A.info(`Ejected the "${r}" generator to ${O}.
137
137
  `+(y==="added"?`Added ${Ue} to devDependencies (the ejected file imports its toolkit) \u2014 run your installer.
@@ -255,7 +255,7 @@ Run the generated workflows against the live API:
255
255
 
256
256
  npx @redocly/cli@latest respect ${e}${n}
257
257
 
258
- `+o}async function ap({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/ZDQDZTQ7.js");A.info(ye(`
258
+ `+o}async function ap({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/RAYH3MG6.js");A.info(ye(`
259
259
  Generating Arazzo description...
260
260
  `));let l=await c(a),p=et(l);if(t["with-ai"]){let f=t["ai-provider"];A.info(ye(`
261
261
  Designing workflows with AI provider "${f}"...
@@ -268,7 +268,7 @@ Run the generated workflows against the live API:
268
268
  \u274C Failed to generate Arazzo description. Check the output file path you provided, or the OpenAPI file content.`)}}import{readFileSync as Iy}from"node:fs";import{mkdir as jy,writeFile as Ty}from"node:fs/promises";import{basename as pp,dirname as Ds,extname as fp,isAbsolute as up,relative as cp,resolve as cr}from"node:path";var ky=/^[a-z][a-z0-9+.-]+:/i;function mp(t,e){let{setup:r}=t;if(typeof r!="string")return t;if(ky.test(r))throw new q(`
269
269
  \u274C \`client.setup\` must be a local file path \u2014 remote setup modules are not supported.
270
270
  Got: ${r}
271
- `);return up(r)?t:{...t,setup:cr(e,r)}}function Ny(t){return`${t.replace(/[\\/]/g,"_")}.client.ts`}function Dy(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 dp({argv:t,config:e}){let{AUTHORING_HELPER_NAMES:r,generateClient:n,mergeConfig:o}=await import("./chunks/4JE7GYQB.js"),s=e.configPath?Ds(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(m=>m.startsWith(".")?cr(m):m),setup:t.setup===void 0?void 0:mp({setup:t.setup},process.cwd()).setup},a=e.resolvedConfig.apis??{},c=Object.keys(a).filter(m=>I(a[m].client)||a[m].clientOutput!==void 0);if(t.api===void 0){if(t.output)throw new q("\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 q("\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 rt(t.api===void 0?c:[t.api],e),p={config:e,configDir:s,cliFlags:i,outputFlag:t.output,toolkit:{generateClient:n,mergeConfig:o,helperNames:r},seenOutputs:new Set,composable:[]};for(let m of l)await Ly(m,p);let f=I(e.resolvedConfig.client)?e.resolvedConfig.client:{};f.cliOutput!==void 0&&t.api===void 0&&p.composable.length>0&&await My(f.cliOutput,p)}async function Ly(t,{config:e,configDir:r,cliFlags:n,outputFlag:o,toolkit:s,seenOutputs:i,composable:a}){let{path:c,alias:l}=t,p=l??pp(c,fp(c)),f=e.forAlias(l),{client:m,clientOutput:d}=f.resolvedConfig,y=mp(I(m)?m:{},r),h=s.mergeConfig(y,n);Fy(h.generators??[],s.helperNames,r);let S=o!==void 0?cr(o):d!==void 0?cr(r,d):cr(r,Ny(p));if(!S.endsWith(".ts"))throw new q(`
271
+ `);return up(r)?t:{...t,setup:cr(e,r)}}function Ny(t){return`${t.replace(/[\\/]/g,"_")}.client.ts`}function Dy(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 dp({argv:t,config:e}){let{AUTHORING_HELPER_NAMES:r,generateClient:n,mergeConfig:o}=await import("./chunks/NSK6GPZU.js"),s=e.configPath?Ds(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(m=>m.startsWith(".")?cr(m):m),setup:t.setup===void 0?void 0:mp({setup:t.setup},process.cwd()).setup},a=e.resolvedConfig.apis??{},c=Object.keys(a).filter(m=>I(a[m].client)||a[m].clientOutput!==void 0);if(t.api===void 0){if(t.output)throw new q("\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 q("\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 rt(t.api===void 0?c:[t.api],e),p={config:e,configDir:s,cliFlags:i,outputFlag:t.output,toolkit:{generateClient:n,mergeConfig:o,helperNames:r},seenOutputs:new Set,composable:[]};for(let m of l)await Ly(m,p);let f=I(e.resolvedConfig.client)?e.resolvedConfig.client:{};f.cliOutput!==void 0&&t.api===void 0&&p.composable.length>0&&await My(f.cliOutput,p)}async function Ly(t,{config:e,configDir:r,cliFlags:n,outputFlag:o,toolkit:s,seenOutputs:i,composable:a}){let{path:c,alias:l}=t,p=l??pp(c,fp(c)),f=e.forAlias(l),{client:m,clientOutput:d}=f.resolvedConfig,y=mp(I(m)?m:{},r),h=s.mergeConfig(y,n);Fy(h.generators??[],s.helperNames,r);let S=o!==void 0?cr(o):d!==void 0?cr(r,d):cr(r,Ny(p));if(!S.endsWith(".ts"))throw new q(`
272
272
  \u274C output must point at a TypeScript file (ending in .ts).
273
273
  Got: ${S}
274
274
  `);if(i.has(S))throw new q(`
@@ -284,7 +284,7 @@ Run the generated workflows against the live API:
284
284
  `)}catch(O){let E=O instanceof Error?O.message:String(O);throw Xe.generate_client_error_category=Fl(E),new q(`
285
285
  \u274C Failed to generate client for ${p}.
286
286
  ${E}
287
- `)}}async function My(t,{configDir:e,seenOutputs:r,composable:n}){let{renderComposedCliEntry:o}=await import("./chunks/ENDHNS6Y.js"),s=cr(e,t);if(!s.endsWith(".ts"))throw new q(`
287
+ `)}}async function My(t,{configDir:e,seenOutputs:r,composable:n}){let{renderComposedCliEntry:o}=await import("./chunks/IWS3O2SM.js"),s=cr(e,t);if(!s.endsWith(".ts"))throw new q(`
288
288
  \u274C client.cliOutput must point at a TypeScript file (ending in .ts).
289
289
  Got: ${s}
290
290
  `);if(r.has(s))throw new q(`
@@ -326,7 +326,7 @@ ${s} detected in project's 'package.json'`),o}catch{A.info(`Invalid 'package.jso
326
326
  `);if(E._compressed=/^(gzip|compress|deflate|br)$/.test(y.headers.get("content-encoding")||""),E.response.content||(E.response.content={size:-1}),E._compressed){let pe=await S.arrayBuffer();E.response.content.size=pe.byteLength}else E.response.content.size=O?Buffer.byteLength(O):-1;let J=O?Buffer.byteLength(O):-1;E.response={headers:ln(y.headers),cookies:rf(y.headers),status:y.status,statusText:y.statusText||"",httpVersion:y.httpVersion?`HTTP/${y.httpVersion}`:"HTTP/1.1",redirectURL:y.headers.location||"",content:{size:E._compressed&&E.response.content.size!==-1?E.response.content.size:Buffer.byteLength(O),mimeType:y.headers.get("content-type")||"",text:O,compression:E._compressed&&E.response.content.size!==-1?E.response.content.size-J:0},bodySize:J,headersSize:$};let{_timestamps:z}=E;E.timings={blocked:Math.max(Ut(z.start,z.socket),.01),dns:-1,connect:Math.max(Ut(z.lookup,z.connect),-1),ssl:z.secureConnect?Math.max(Ut(z.connect,z.secureConnect),-1):-1,send:Ut(z.secureConnect||z.connect,z.sent),wait:Math.max(Ut(z.sent,z.firstByte),0),receive:Ut(z.firstByte,z.received)},E.time=Ut(z.start,z.received);let ae=[],Q=E;do{let pe=Q._parent;delete Q._parent,pe&&ae.unshift(pe),Q=pe}while(Q);return m.pageref=i||"page_1",ae.forEach(pe=>{pe.pageref=m.pageref}),y.harEntry=m,Array.isArray(s?.log?.entries)&&s.log.entries.push(...ae,m),a&&(ae.forEach(pe=>{a(pe)}),a(m)),y}};function of(t){let e={};for(let r of t){let{executedWorkflows:n,globalTimeoutError:o,ctx:s,secretValues:i}=r;e[r.file]=Mi({value:{totalRequests:r.totalRequests,executedWorkflows:n.map(a=>sf(a)),totalTimeMs:r.totalTimeMs,globalTimeoutError:o,secretValues:i},noSecretsMasking:s.noSecretsMasking,secretsSet:s.secretsSet||new Set})}return e}function sf(t){let{ctx:e,...r}=t,n=t.executedSteps.map(i=>Ew(i,t.workflowId,e)),o=An([t]);return{...r,executedSteps:n,status:o.steps.failed>0?"error":o.steps.warnings>0?"warn":"success",totalRequests:o.totalRequests,totalTimeMs:t.totalTimeMs}}function Ew(t,e,r){if("executedSteps"in t)return sf(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:Ow(o)})),totalTimeMs:n?.response?.time||0,retriesLeft:t.retriesLeft,status:xw(t.checks)}}function Ow(t){return t.passed?"success":t.severity==="error"?"error":"warn"}function xw(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 Dr from"node:fs";import*as af from"node:path";function cf(t={},e){let r={};for(let[n,o]of Object.entries(t))r[n]={clientCert:Js(o.clientCert,e),clientKey:Js(o.clientKey,e),caCert:Js(o.caCert,e)};return r}function Js(t,e){if(t)try{if(!(t.includes("-----BEGIN")&&t.includes("-----END"))){let n=af.resolve(e,t);return Dr.accessSync(n,Dr.constants.R_OK),Dr.readFileSync(n,"utf-8")}return Aw(t)}catch(r){throw new Error(`Failed to read certificate: ${r.message}`)}}function Aw(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(`
327
327
  `)||"";return`${r}
328
328
  ${s}
329
- ${o}`}async function pf({argv:t,config:e,version:r,collectSpecData:n}){let o,s;try{let{run:i,conditionallyMaskSecrets:a}=await import("./chunks/ZDQDZTQ7.js"),c=e.configPath?Pw(e.configPath):process.cwd();t.mtls&&(o=cf(t.mtls,c));let l=zp(o);t["har-output"]&&(s=Vp({version:r}),l=Ks(l,{har:s}));let p=new ut({http:{headers:e.resolve?.http?.headers??[],customFetch:l}}),f={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 S=>{if(!Cw(S))throw new Error(`File ${S} doesn't exist or isn't readable.`);let O=vw(S);return new File([O],Rw(S))}},envVariables:Up(c)||{},logger:A,fetch:l,externalRefResolver:p,noSecretsMasking:t["no-secrets-masking"]};if(f.skip&&f.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(f.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 m=performance.now(),d=await i(f);A.printNewLine(),Gp(d,A),A.printNewLine();let y=d.some(S=>S.hasProblems),h=d.some(S=>S.hasWarnings);if(t["json-output"]){let S={files:of(d),status:y?"error":h?"warn":"success",totalTime:performance.now()-m};lf(t["json-output"],Gs(S,2),"utf-8"),A.output(te(A.indent(`JSON logs saved in ${xe(t["json-output"])}`,2))),A.printNewLine(),A.printNewLine()}if(t["har-output"])for(let S of d){let O=a({value:s,noSecretsMasking:S.ctx.noSecretsMasking,secretsSet:S.ctx.secretsSet||new Set});lf(t["har-output"],Gs(O,2),"utf-8"),A.output(te(`Har logs saved in ${xe(t["har-output"])}`)),A.printNewLine(),A.printNewLine()}if(y)throw new Error(" Tests exited with error ")}catch(i){throw new q(i?.message??i)}}function uf(t){if(Array.isArray(t)){let e={};for(let r of t)if(r&&typeof r=="string"){let n=ff(r);Object.assign(e,n)}return Object.keys(e).length>0?e:void 0}if(!(!t||typeof t!="string"))return ff(t)}function ff(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`);Xs(n,"clientCert",r,!0),Xs(n,"clientKey",r,!0),Xs(n,"caCert",r,!1)}return e}catch(e){throw e instanceof SyntaxError?new Error(`Invalid JSON for --mtls option: ${e.message}`):e}}function Xs(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 Hw}from"perf_hooks";var Ot={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},mf=new Set(["id","name","type","value","data","key","status","state","code","result","item","object","resource","entity","input","output","payload","body","content","info"]);function uo(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 _w(t,e,r=Ot){let{thresholds:n,weights:o}=r,s=ft(1-t.parameterCount/(n.maxParamsGood*2)),a=Math.max(t.maxRequestSchemaDepth,t.maxResponseSchemaDepth)/(n.maxDepthGood*2),c=df(t,o.anyOfPenaltyMultiplier)/(n.maxPolymorphismGood*3),l=ft(1-a-c),p=(t.operationDescriptionPresent?1:0)+t.paramsWithDescription+t.schemaPropertiesWithDescription,f=1+t.parameterCount+t.totalSchemaProperties,m=f>0?ft(p/f):1,d=t.totalSchemaProperties>0?ft(t.constraintCount/t.totalSchemaProperties):1,y=(t.requestExamplePresent?1:0)+(t.responseExamplePresent?1:0),h=(t.requestBodyPresent?1:0)+1,S=ft(y/h),O=t.totalErrorResponses>0?ft(t.structuredErrorResponseCount/t.totalErrorResponses):1,E=ft(1-e/(n.maxDependencyDepthGood*2)),v=ft(1-t.ambiguousIdentifierCount/Math.max(n.maxAmbiguousGood+3,1)),C=df(t,o.anyOfPenaltyMultiplier),$=C===0?1:t.hasDiscriminator?ft(1-C/(n.maxPolymorphismGood*4)):ft(1-C/(n.maxPolymorphismGood*2));return{parameterSimplicity:s,schemaSimplicity:l,documentationQuality:m,constraintClarity:d,exampleCoverage:S,errorClarity:O,dependencyClarity:E,identifierClarity:v,polymorphismClarity:$}}function $w(t,e=Ot){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 bf(ft(n)*100)}function hf(t,e,r=Ot){let n=new Map;for(let[o,s]of t.operations){let i=e.get(o)??0,a=_w(s,i,r);n.set(o,{agentReadiness:$w(a,r),subscores:a})}return n}function gf(t,e=Ot){return ft(1-t/e.thresholds.maxOperationsForDiscoverability)}function yf(t,e,r=Ot){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:bf(uo(n)*(1-o)+s*o)}}function Qs(t,e,r){return t-e+e*r}function df(t,e){return Qs(t.polymorphismCount,t.anyOfCount,e)}function ft(t){return Math.max(0,Math.min(1,t))}function wf(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 bf(t){return Math.round(t*10)/10}function Sf(t,e,r){let n=Math.max(1,t);return e/n+r/n}function Iw(t,e){return e.totalSchemaProperties>t.totalSchemaProperties?!0:e.totalSchemaProperties<t.totalSchemaProperties?!1:Sf(e.totalSchemaProperties,e.schemaPropertiesWithDescription,e.constraintCount)>Sf(t.totalSchemaProperties,t.schemaPropertiesWithDescription,t.constraintCount)}var jw=["enum","const","format","pattern","minimum","maximum","minLength","maxLength","minItems","maxItems","minProperties","maxProperties","multipleOf","exclusiveMinimum","exclusiveMaximum","uniqueItems"];function Zs(){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 xf(t){Object.assign(t,Zs())}function Af(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 jw)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 Cf(t,e,r){return{operations:new Map,currentPath:"",pathLevelParams:[],current:null,walkSchema:t,anyOfPenaltyMultiplier:e,debugOperationId:r,debugLogs:[]}}function Tw(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 kw(t){let{inRequestBody:e,inResponse:r,currentResponseCode:n,errorStructuredCounted:o,maxEffectivePolymorphism:s,...i}=t;return i}function vf(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,Of(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&&(Dw(e)&&(r.inRequestBody&&(r.requestExamplePresent=!0),r.inResponse&&(r.responseExamplePresent=!0)),r.inResponse&&Of(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);Iw(r,o)&&(r.totalSchemaProperties=o.totalSchemaProperties,r.schemaPropertiesWithDescription=o.schemaPropertiesWithDescription,r.constraintCount=o.constraintCount);let s=Qs(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=Tw(t.currentPath,n,e);t.current=o;let s=Nw(t.pathLevelParams,e.parameters??[],r.resolve);for(let i of s.values())o.parameterCount++,i.required&&o.requiredParameterCount++,i.description&&o.paramsWithDescription++,Lw(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,kw(r)),t.current=null}}}}}}function Pf(t){return{operationCount:t.operations.size,operations:t.operations}}function Ef(t,e){return e(t).node}function Nw(t,e,r){let n=new Map;for(let o of t){let s=Ef(o,r);s?.name&&s.in&&n.set(`${s.in}:${s.name}`,s)}for(let o of e){let s=Ef(o,r);s?.name&&s.in&&n.set(`${s.in}:${s.name}`,s)}return n}function Dw(t){return t.example!==void 0||li(t.examples)}function Lw(t){if(t.description)return!1;let e=(t.name??"").toLowerCase();return mf.has(e)}function Of(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 Mw(t,e){if(!e.startsWith("#/"))return;let r=t;for(let n of e.slice(2).split("/"))r=r?.[ui(n)];return r}function Rf({document:t,types:e,resolvedRefMap:r,ctx:n,debugOperationId:o,scoringConstants:s}){let i=s?.weights.anyOfPenaltyMultiplier??Ot.weights.anyOfPenaltyMultiplier,a=Zs(),c=Af(a),l=Vt([{severity:"warn",ruleId:"score-schema",visitor:c}],e),p=(v,C)=>{xf(a),C&&(a.debugEntries=[]),Bt({document:{...t,parsed:v},rootType:e.Schema,normalizedVisitors:l,resolvedRefMap:r,ctx:n});let{depth:$,pendingRef:J,debugEntries:z,...ae}=a;return{...ae,refsUsed:[...a.refsUsed],debugEntries:C?a.debugEntries??void 0:void 0}},f=new Map,m=new WeakSet,d={maxDepth:0,polymorphismCount:0,anyOfCount:0,hasDiscriminator:!1,totalSchemaProperties:0,schemaPropertiesWithDescription:0,constraintCount:0,hasPropertyExamples:!1,writableTopLevelFields:0,refsUsed:[]};function y(v,C){return{maxDepth:Math.max(v.maxDepth,C.maxDepth),polymorphismCount:v.polymorphismCount+C.polymorphismCount,anyOfCount:v.anyOfCount+C.anyOfCount,hasDiscriminator:v.hasDiscriminator||C.hasDiscriminator,totalSchemaProperties:v.totalSchemaProperties+C.totalSchemaProperties,schemaPropertiesWithDescription:v.schemaPropertiesWithDescription+C.schemaPropertiesWithDescription,constraintCount:v.constraintCount+C.constraintCount,hasPropertyExamples:v.hasPropertyExamples||C.hasPropertyExamples,writableTopLevelFields:v.writableTopLevelFields+C.writableTopLevelFields,refsUsed:[...v.refsUsed,...C.refsUsed],debugEntries:v.debugEntries||C.debugEntries?[...v.debugEntries??[],...C.debugEntries??[]]:void 0}}let h=(v,C=!1)=>{let $=v,J=je(v)?v.$ref:void 0;if(J){if(!C){let Y=f.get(J);if(Y)return Y}$=Mw(t.parsed,J)??v}if(I($)&&m.has($))return{...d};I($)&&m.add($);let z=$?.oneOf,ae=$?.anyOf,Q=Array.isArray(z)&&z.length>1,pe=Array.isArray(ae)&&ae.length>1,R=Q||pe,P=Array.isArray($?.allOf)&&$.allOf.length>0,L=$?.discriminator,W=!R&&I(L?.mapping)?Object.values(L.mapping).filter(Y=>typeof Y=="string"&&mi(Y)).map(Y=>({$ref:Y})):null,ne=Array.isArray(W)&&W.length>0,ee;if(R||P||ne){let Y={...$},ce=null,Ie=Pe=>{ce=ce?y(ce,Pe):Pe},le=(Pe,Ze)=>{let F=h(Ze[0],C);for(let ie=1;ie<Ze.length;ie++){let oe=h(Ze[ie],C);oe.totalSchemaProperties>F.totalSchemaProperties&&(F=oe)}return{...F,polymorphismCount:F.polymorphismCount+Ze.length,anyOfCount:F.anyOfCount+(Pe==="anyOf"?Ze.length:0),hasDiscriminator:F.hasDiscriminator||!!L}};R&&delete Y.discriminator,Q&&(delete Y.oneOf,Ie(le("oneOf",z))),pe&&(delete Y.anyOf,Ie(le("anyOf",ae)));let Ge=null;if(ne){delete Y.discriminator;let Pe=h(W[0],C);for(let Ze=1;Ze<W.length;Ze++){let F=h(W[Ze],C);F.totalSchemaProperties>Pe.totalSchemaProperties&&(Pe=F)}Ge={...Pe,polymorphismCount:Pe.polymorphismCount+W.length,hasDiscriminator:!0}}let Qe=null;if(P){delete Y.allOf,Qe={...d};for(let Pe of $.allOf)Qe=y(Qe,h(Pe,C));Qe.polymorphismCount+=$.allOf.length}ee=p(Y,C),Qe&&(ee=y(ee,Qe)),ce&&(ee=y(ee,ce)),Ge&&(ee=y(ee,Ge)),J&&(ee={...ee,refsUsed:[J,...ee.refsUsed]})}else ee=p(v,C);return I($)&&m.delete($),J&&!C&&f.set(J,ee),ee},S=Cf(h,i,o),O=vf(S),E=Vt([{severity:"warn",ruleId:"score",visitor:O}],e);return Bt({document:t,rootType:e.Root,normalizedVisitors:E,resolvedRefMap:r,ctx:n}),{metrics:Pf(S),debugLogs:S.debugLogs}}function _f(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=Fw(o,r);n.set(o,s)}return n}function Fw(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 $f(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};A.output(JSON.stringify(e,null,2))}function If(t,e=!1){qw(t),Ww(t),zw(t),e&&Gw(t),Vw(t)}function jf(t){return t>=80?xe:t>=50?ge:mt}function Tf(t){return jf(t)(tt(t.toFixed(1)))}function H(t){A.output(t+`
329
+ ${o}`}async function pf({argv:t,config:e,version:r,collectSpecData:n}){let o,s;try{let{run:i,conditionallyMaskSecrets:a}=await import("./chunks/RAYH3MG6.js"),c=e.configPath?Pw(e.configPath):process.cwd();t.mtls&&(o=cf(t.mtls,c));let l=zp(o);t["har-output"]&&(s=Vp({version:r}),l=Ks(l,{har:s}));let p=new ut({http:{headers:e.resolve?.http?.headers??[],customFetch:l}}),f={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 S=>{if(!Cw(S))throw new Error(`File ${S} doesn't exist or isn't readable.`);let O=vw(S);return new File([O],Rw(S))}},envVariables:Up(c)||{},logger:A,fetch:l,externalRefResolver:p,noSecretsMasking:t["no-secrets-masking"]};if(f.skip&&f.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(f.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 m=performance.now(),d=await i(f);A.printNewLine(),Gp(d,A),A.printNewLine();let y=d.some(S=>S.hasProblems),h=d.some(S=>S.hasWarnings);if(t["json-output"]){let S={files:of(d),status:y?"error":h?"warn":"success",totalTime:performance.now()-m};lf(t["json-output"],Gs(S,2),"utf-8"),A.output(te(A.indent(`JSON logs saved in ${xe(t["json-output"])}`,2))),A.printNewLine(),A.printNewLine()}if(t["har-output"])for(let S of d){let O=a({value:s,noSecretsMasking:S.ctx.noSecretsMasking,secretsSet:S.ctx.secretsSet||new Set});lf(t["har-output"],Gs(O,2),"utf-8"),A.output(te(`Har logs saved in ${xe(t["har-output"])}`)),A.printNewLine(),A.printNewLine()}if(y)throw new Error(" Tests exited with error ")}catch(i){throw new q(i?.message??i)}}function uf(t){if(Array.isArray(t)){let e={};for(let r of t)if(r&&typeof r=="string"){let n=ff(r);Object.assign(e,n)}return Object.keys(e).length>0?e:void 0}if(!(!t||typeof t!="string"))return ff(t)}function ff(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`);Xs(n,"clientCert",r,!0),Xs(n,"clientKey",r,!0),Xs(n,"caCert",r,!1)}return e}catch(e){throw e instanceof SyntaxError?new Error(`Invalid JSON for --mtls option: ${e.message}`):e}}function Xs(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 Hw}from"perf_hooks";var Ot={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},mf=new Set(["id","name","type","value","data","key","status","state","code","result","item","object","resource","entity","input","output","payload","body","content","info"]);function uo(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 _w(t,e,r=Ot){let{thresholds:n,weights:o}=r,s=ft(1-t.parameterCount/(n.maxParamsGood*2)),a=Math.max(t.maxRequestSchemaDepth,t.maxResponseSchemaDepth)/(n.maxDepthGood*2),c=df(t,o.anyOfPenaltyMultiplier)/(n.maxPolymorphismGood*3),l=ft(1-a-c),p=(t.operationDescriptionPresent?1:0)+t.paramsWithDescription+t.schemaPropertiesWithDescription,f=1+t.parameterCount+t.totalSchemaProperties,m=f>0?ft(p/f):1,d=t.totalSchemaProperties>0?ft(t.constraintCount/t.totalSchemaProperties):1,y=(t.requestExamplePresent?1:0)+(t.responseExamplePresent?1:0),h=(t.requestBodyPresent?1:0)+1,S=ft(y/h),O=t.totalErrorResponses>0?ft(t.structuredErrorResponseCount/t.totalErrorResponses):1,E=ft(1-e/(n.maxDependencyDepthGood*2)),v=ft(1-t.ambiguousIdentifierCount/Math.max(n.maxAmbiguousGood+3,1)),C=df(t,o.anyOfPenaltyMultiplier),$=C===0?1:t.hasDiscriminator?ft(1-C/(n.maxPolymorphismGood*4)):ft(1-C/(n.maxPolymorphismGood*2));return{parameterSimplicity:s,schemaSimplicity:l,documentationQuality:m,constraintClarity:d,exampleCoverage:S,errorClarity:O,dependencyClarity:E,identifierClarity:v,polymorphismClarity:$}}function $w(t,e=Ot){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 bf(ft(n)*100)}function hf(t,e,r=Ot){let n=new Map;for(let[o,s]of t.operations){let i=e.get(o)??0,a=_w(s,i,r);n.set(o,{agentReadiness:$w(a,r),subscores:a})}return n}function gf(t,e=Ot){return ft(1-t/e.thresholds.maxOperationsForDiscoverability)}function yf(t,e,r=Ot){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:bf(uo(n)*(1-o)+s*o)}}function Qs(t,e,r){return t-e+e*r}function df(t,e){return Qs(t.polymorphismCount,t.anyOfCount,e)}function ft(t){return Math.max(0,Math.min(1,t))}function wf(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 bf(t){return Math.round(t*10)/10}function Sf(t,e,r){let n=Math.max(1,t);return e/n+r/n}function Iw(t,e){return e.totalSchemaProperties>t.totalSchemaProperties?!0:e.totalSchemaProperties<t.totalSchemaProperties?!1:Sf(e.totalSchemaProperties,e.schemaPropertiesWithDescription,e.constraintCount)>Sf(t.totalSchemaProperties,t.schemaPropertiesWithDescription,t.constraintCount)}var jw=["enum","const","format","pattern","minimum","maximum","minLength","maxLength","minItems","maxItems","minProperties","maxProperties","multipleOf","exclusiveMinimum","exclusiveMaximum","uniqueItems"];function Zs(){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 xf(t){Object.assign(t,Zs())}function Af(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 jw)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 Cf(t,e,r){return{operations:new Map,currentPath:"",pathLevelParams:[],current:null,walkSchema:t,anyOfPenaltyMultiplier:e,debugOperationId:r,debugLogs:[]}}function Tw(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 kw(t){let{inRequestBody:e,inResponse:r,currentResponseCode:n,errorStructuredCounted:o,maxEffectivePolymorphism:s,...i}=t;return i}function vf(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,Of(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&&(Dw(e)&&(r.inRequestBody&&(r.requestExamplePresent=!0),r.inResponse&&(r.responseExamplePresent=!0)),r.inResponse&&Of(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);Iw(r,o)&&(r.totalSchemaProperties=o.totalSchemaProperties,r.schemaPropertiesWithDescription=o.schemaPropertiesWithDescription,r.constraintCount=o.constraintCount);let s=Qs(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=Tw(t.currentPath,n,e);t.current=o;let s=Nw(t.pathLevelParams,e.parameters??[],r.resolve);for(let i of s.values())o.parameterCount++,i.required&&o.requiredParameterCount++,i.description&&o.paramsWithDescription++,Lw(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,kw(r)),t.current=null}}}}}}function Pf(t){return{operationCount:t.operations.size,operations:t.operations}}function Ef(t,e){return e(t).node}function Nw(t,e,r){let n=new Map;for(let o of t){let s=Ef(o,r);s?.name&&s.in&&n.set(`${s.in}:${s.name}`,s)}for(let o of e){let s=Ef(o,r);s?.name&&s.in&&n.set(`${s.in}:${s.name}`,s)}return n}function Dw(t){return t.example!==void 0||li(t.examples)}function Lw(t){if(t.description)return!1;let e=(t.name??"").toLowerCase();return mf.has(e)}function Of(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 Mw(t,e){if(!e.startsWith("#/"))return;let r=t;for(let n of e.slice(2).split("/"))r=r?.[ui(n)];return r}function Rf({document:t,types:e,resolvedRefMap:r,ctx:n,debugOperationId:o,scoringConstants:s}){let i=s?.weights.anyOfPenaltyMultiplier??Ot.weights.anyOfPenaltyMultiplier,a=Zs(),c=Af(a),l=Vt([{severity:"warn",ruleId:"score-schema",visitor:c}],e),p=(v,C)=>{xf(a),C&&(a.debugEntries=[]),Bt({document:{...t,parsed:v},rootType:e.Schema,normalizedVisitors:l,resolvedRefMap:r,ctx:n});let{depth:$,pendingRef:J,debugEntries:z,...ae}=a;return{...ae,refsUsed:[...a.refsUsed],debugEntries:C?a.debugEntries??void 0:void 0}},f=new Map,m=new WeakSet,d={maxDepth:0,polymorphismCount:0,anyOfCount:0,hasDiscriminator:!1,totalSchemaProperties:0,schemaPropertiesWithDescription:0,constraintCount:0,hasPropertyExamples:!1,writableTopLevelFields:0,refsUsed:[]};function y(v,C){return{maxDepth:Math.max(v.maxDepth,C.maxDepth),polymorphismCount:v.polymorphismCount+C.polymorphismCount,anyOfCount:v.anyOfCount+C.anyOfCount,hasDiscriminator:v.hasDiscriminator||C.hasDiscriminator,totalSchemaProperties:v.totalSchemaProperties+C.totalSchemaProperties,schemaPropertiesWithDescription:v.schemaPropertiesWithDescription+C.schemaPropertiesWithDescription,constraintCount:v.constraintCount+C.constraintCount,hasPropertyExamples:v.hasPropertyExamples||C.hasPropertyExamples,writableTopLevelFields:v.writableTopLevelFields+C.writableTopLevelFields,refsUsed:[...v.refsUsed,...C.refsUsed],debugEntries:v.debugEntries||C.debugEntries?[...v.debugEntries??[],...C.debugEntries??[]]:void 0}}let h=(v,C=!1)=>{let $=v,J=je(v)?v.$ref:void 0;if(J){if(!C){let Y=f.get(J);if(Y)return Y}$=Mw(t.parsed,J)??v}if(I($)&&m.has($))return{...d};I($)&&m.add($);let z=$?.oneOf,ae=$?.anyOf,Q=Array.isArray(z)&&z.length>1,pe=Array.isArray(ae)&&ae.length>1,R=Q||pe,P=Array.isArray($?.allOf)&&$.allOf.length>0,L=$?.discriminator,W=!R&&I(L?.mapping)?Object.values(L.mapping).filter(Y=>typeof Y=="string"&&mi(Y)).map(Y=>({$ref:Y})):null,ne=Array.isArray(W)&&W.length>0,ee;if(R||P||ne){let Y={...$},ce=null,Ie=Pe=>{ce=ce?y(ce,Pe):Pe},le=(Pe,Ze)=>{let F=h(Ze[0],C);for(let ie=1;ie<Ze.length;ie++){let oe=h(Ze[ie],C);oe.totalSchemaProperties>F.totalSchemaProperties&&(F=oe)}return{...F,polymorphismCount:F.polymorphismCount+Ze.length,anyOfCount:F.anyOfCount+(Pe==="anyOf"?Ze.length:0),hasDiscriminator:F.hasDiscriminator||!!L}};R&&delete Y.discriminator,Q&&(delete Y.oneOf,Ie(le("oneOf",z))),pe&&(delete Y.anyOf,Ie(le("anyOf",ae)));let Ge=null;if(ne){delete Y.discriminator;let Pe=h(W[0],C);for(let Ze=1;Ze<W.length;Ze++){let F=h(W[Ze],C);F.totalSchemaProperties>Pe.totalSchemaProperties&&(Pe=F)}Ge={...Pe,polymorphismCount:Pe.polymorphismCount+W.length,hasDiscriminator:!0}}let Qe=null;if(P){delete Y.allOf,Qe={...d};for(let Pe of $.allOf)Qe=y(Qe,h(Pe,C));Qe.polymorphismCount+=$.allOf.length}ee=p(Y,C),Qe&&(ee=y(ee,Qe)),ce&&(ee=y(ee,ce)),Ge&&(ee=y(ee,Ge)),J&&(ee={...ee,refsUsed:[J,...ee.refsUsed]})}else ee=p(v,C);return I($)&&m.delete($),J&&!C&&f.set(J,ee),ee},S=Cf(h,i,o),O=vf(S),E=Vt([{severity:"warn",ruleId:"score",visitor:O}],e);return Bt({document:t,rootType:e.Root,normalizedVisitors:E,resolvedRefMap:r,ctx:n}),{metrics:Pf(S),debugLogs:S.debugLogs}}function _f(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=Fw(o,r);n.set(o,s)}return n}function Fw(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 $f(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};A.output(JSON.stringify(e,null,2))}function If(t,e=!1){qw(t),Ww(t),zw(t),e&&Gw(t),Vw(t)}function jf(t){return t>=80?xe:t>=50?ge:mt}function Tf(t){return jf(t)(tt(t.toFixed(1)))}function H(t){A.output(t+`
330
330
  `)}function qw(t){H(""),H(tt(jt(" Scores"))),H(""),H(` Agent Readiness: ${Tf(t.agentReadiness)}/100`),H("")}function Ww(t){H(tt(jt(" Subscores"))),H("");let e=t.subscores;xt("Parameter Simplicity",e.parameterSimplicity),xt("Schema Simplicity",e.schemaSimplicity),xt("Documentation Quality",e.documentationQuality),xt("Constraint Clarity",e.constraintClarity),xt("Example Coverage",e.exampleCoverage),xt("Error Clarity",e.errorClarity),xt("Dependency Clarity",e.dependencyClarity),xt("Identifier Clarity",e.identifierClarity),xt("Polymorphism Clarity",e.polymorphismClarity),xt("Discoverability",t.discoverability),H("")}function xt(t,e){let r=Math.round(e*100),n=Uw(e);H(` ${t.padEnd(24)} ${n} ${jf(r)(r+"%")}`)}function Uw(t){let r=Math.round(t*20);return At("["+"\u2588".repeat(r)+"\u2591".repeat(20-r)+"]")}function zw(t){if(H(tt(jt(" Raw Metrics Summary"))),H(""),H(` Total operations: ${t.rawMetrics.operationCount}`),t.rawMetrics.operationCount===0){H("");return}let e=[],r=[],n=[],o=[],s=0,i=0,a=0;for(let p of t.rawMetrics.operations.values())e.push(p.parameterCount),r.push(Math.max(p.maxRequestSchemaDepth,p.maxResponseSchemaDepth)),n.push(p.polymorphismCount),o.push(p.totalSchemaProperties),p.requestExamplePresent&&s++,p.responseExamplePresent&&i++,p.operationDescriptionPresent&&a++;let c=t.rawMetrics.operationCount;function l(p,f){let d=(f.reduce((O,E)=>O+E,0)/c).toFixed(1),y=uo(f).toFixed(1),h=Math.min(...f),S=Math.max(...f);H(` ${p.padEnd(26)} avg ${d.padStart(6)} median ${y.padStart(6)} min ${String(h).padStart(5)} max ${String(S).padStart(5)}`)}l("Parameters/operation:",e),l("Schema depth:",r),l("Polymorphism/operation:",n),l("Properties/operation:",o),H(` Operations with request examples: ${s}/${c} (${ei(s,c)})`),H(` Operations with response examples: ${i}/${c} (${ei(i,c)})`),H(` Operations with description: ${a}/${c} (${ei(a,c)})`),H("")}function ei(t,e){return e>0?`${Math.round(t/e*100)}%`:"N/A"}function Gw(t){H(tt(jt(" Per-Operation Metrics"))),H("");let e=" "+"Operation".padEnd(50)+"Props".padStart(7)+"Poly".padStart(7)+"Depth".padStart(7)+"Params".padStart(8)+"Constr".padStart(8);H(At(e)),H(At(" "+"\u2500".repeat(e.length-2)));let r=[...t.rawMetrics.operations.entries()].sort(([,n],[,o])=>o.totalSchemaProperties-n.totalSchemaProperties);for(let[,n]of r){let o=(n.operationId??`${n.method.toUpperCase()} ${n.path}`).slice(0,48),s=Math.max(n.maxRequestSchemaDepth,n.maxResponseSchemaDepth),i=" "+o.padEnd(50)+String(n.totalSchemaProperties).padStart(7)+String(n.polymorphismCount).padStart(7)+String(s).padStart(7)+String(n.parameterCount).padStart(8)+String(n.constraintCount).padStart(8);H(i)}H("")}function kf(t,e){if(H(""),H(tt(jt(` Debug: ${t} schema breakdown`))),H(""),e.length===0){H(ge(` No schemas found for operation "${t}".`)),H(ge(' Make sure the value matches an operationId or "METHOD /path" exactly.')),H("");return}for(let r of e){H(tt(At(` ${r.context}`))),H(At(" "+"\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 p=[];if(s.polymorphism.oneOf&&p.push(`oneOf:${s.polymorphism.oneOf}`),s.polymorphism.anyOf&&p.push(`anyOf:${s.polymorphism.anyOf}`),s.polymorphism.allOf&&p.push(`allOf:${s.polymorphism.allOf}`),p.length>0&&(l+=` [${p.join(", ")}]`),s.constraintCount>0&&(l+=` {${s.constraintCount} constraints}`),H(l),c>0&&c<=20)H(` ${a} properties: ${s.propertyNames.join(", ")}`);else if(c>20){let f=s.propertyNames.slice(0,15).join(", ");H(` ${a} properties: ${f}, ... +${c-15} more`)}}H(""),H(` Totals: ${r.totalProperties} properties, ${r.totalPolymorphism} polymorphism items, ${r.totalConstraints} constraints, max depth ${r.maxDepth}`);let o=[...n.entries()].filter(([,s])=>s.totalProps>0).sort(([,s],[,i])=>i.totalProps-s.totalProps).slice(0,10);if(o.length>0){H(""),H(tt(" Top schemas by property count:"));for(let[s,i]of o)H(` ${s}: ${i.totalProps} properties`)}H("")}}function Vw(t){if(t.hotspots.length===0){H(tt(jt(" No hotspot operations found."))),H("");return}H(tt(jt(` Top ${t.hotspots.length} Hotspot Operations`))),H("");for(let e of t.hotspots){let r=e.operationId?`${e.method.toUpperCase()} ${e.path} (${e.operationId})`:`${e.method.toUpperCase()} ${e.path}`;H(tt(` ${r}`)),H(` Agent Readiness: ${Tf(e.agentReadinessScore)}`);for(let n of e.reasons)H(ge(` - ${n}`));H("")}}function Nf(t,e,r,n=Ot){let o=[];for(let[s,i]of e){let a=t.operations.get(s);if(!a)continue;let c=Bw(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 Bw(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 Df({argv:t,config:e,collectSpecData:r}){let[{path:n}]=await rt(t.api?[t.api]:[],e),o=new ut(e.resolve),{bundle:s}=await wr({config:e,ref:n});r?.(s);let i=Be(s.parsed);if(yr(i)!=="oas3")throw new q(`The score command currently supports only OpenAPI 3.x. Detected: ${i}`);let a=Hw.now(),c=hr(e.extendTypes($t(i),i),e),l=await gr({rootDocument:s,rootType:c.Root,externalRefResolver:o}),p=t["debug-operation-id"],{metrics:f,debugLogs:m}=Rf({document:s,types:c,resolvedRefMap:l,ctx:{problems:[],specVersion:i,config:e,visitorsData:{}},debugOperationId:p}),d=_f(f.operations),y=hf(f,d),h=gf(f.operationCount),{agentReadiness:S}=yf(y,h),O=Nf(f,y,d),E={agentReadiness:S,discoverability:h,subscores:wf(y),rawMetrics:f,hotspots:O,operationScores:y,dependencyDepths:d};Yw(E,n,a,t.format,!!t["operation-details"],p?{operationId:p,logs:m}:void 0)}function Yw(t,e,r,n,o,s){A.info(`Document: ${hn(e)} score:
331
331
  `),n==="json"?$f(t):If(t,o),s&&kf(s.operationId,s.logs),Tt("score",r,e)}import*as pu from"node:fs";import{performance as Kw}from"perf_hooks";import*as Zf from"node:fs";import*as yo from"node:path";import*as Lf from"node:path";function ze(t,e,r={}){Tr(t,o=>{if(je(o)&&kr(o.$ref))n(o,"$ref");else if(I(o.discriminator)&&I(o.discriminator.mapping)){let{mapping:s}=o.discriminator;for(let i of Object.keys(s)){let a=s[i];typeof a=="string"&&kr(a)&&n(o.discriminator.mapping,i)}}});function n(o,s){let i=o[s].split("/"),a=i.pop(),c=i[2],l=r[c];if(!l||!l[a])return;let p=Ve(Lf.relative(e,l[a].filename));p.startsWith(".")||(p="./"+p),o[s]=p}}import*as ti from"node:path";import*as Mf from"node:path";function fr(t,e,r){return Mf.join(t,e)+`.${r}`}var Ff=["schemas","messages","securitySchemes","parameters","correlationIds","messageTraits","operationTraits","serverBindings","channelBindings","operationBindings","messageBindings"];var qf=["schemas","messages","securitySchemes","servers","serverVariables","parameters","replies","replyAddresses","correlationIds","messageTraits","operationTraits","tags","externalDocs","serverBindings","channelBindings","operationBindings","messageBindings"];function mo(t,e){return(e==="async2"?Ff:qf).filter(n=>n in t)}function Wf({asyncapi:t,asyncapiDir:e,componentsFiles:r,ext:n,specVersion:o}){let s=t.components;if(!s)return;let i=ti.join(e,Se),a=mo(s,o);for(let c of a){let l=ti.join(i,c);for(let p of Object.keys(s[c]||{})){let f=fr(l,p,n),m=[];c==="schemas"&&(m=(s[c]?.[p]?.allOf||[]).map(({$ref:d})=>d).filter(dn)),r[c]=r[c]||{},r[c][p]={inherits:m,filename:f}}}}import*as zf from"node:fs";import*as Mr from"node:path";import*as fn from"node:path";function yt(t,e,r){let n=fn.resolve(t),o=fn.resolve(e);if(o!==n&&!o.startsWith(n+fn.sep))throw new q(`Refusing to write "${r}" outside the output directory.`)}import*as ur from"node:fs";import*as Uf from"node:path";function mr(t,e,r){if(!ur.existsSync(t)||!ur.statSync(t).isDirectory())return;let n=ur.readdirSync(t);for(let o of n){let s=Uf.join(t,o);ur.statSync(s).isDirectory()?mr(s,e,r):e(s,t,r)}}function Lr(t,e,r){if(!wi(t))return;let n=br(t);ze(n,e,r),_e(n,t)}function Gf({channels:t,asyncapiDir:e,outDir:r,componentsFiles:n,pathSeparator:o,ext:s}){let i={};if(!t)return i;zf.mkdirSync(r,{recursive:!0});for(let a of Object.keys(t)){let c=`${Mr.join(r,Ht(a,o))}.${s}`,l=t[a];je(l)||(yt(e,c,a),i[a]=c,ze(l,Mr.dirname(c),n),_e(l,c),t[a]={$ref:Ve(Mr.relative(e,c))},mr(r,Lr,n))}return i}import*as Kf from"node:fs";import*as Wr from"node:path";import*as Vf from"node:fs";function Fr(t){return t!=="securitySchemes"}function ho(t,e){Fr(e)&&Vf.mkdirSync(t,{recursive:!0})}import*as Bf from"node:fs";function go(t,e){return Bf.existsSync(t)&&!_t(br(t),e)}import*as Hf from"node:path";function qr(t,e,r){if(!(!I(t)&&!Array.isArray(t))){if(Array.isArray(t)){for(let n of t)qr(n,e,r);return}for(let n of Object.keys(t)){let o=t[n];if(n==="$ref"&&typeof o=="string"&&o.startsWith("#/channels/")){let s=o.slice(11),i=s.indexOf("/"),a=i===-1?s:s.slice(0,i),c=i===-1?"":s.slice(i),l=r[a];if(l){let p=Ve(Hf.relative(e,l));t[n]=c?`${p}#${c}`:p}}else qr(o,e,r)}}}function Yf(t,e){let r=t.components;r&&(bt(r[e])&&delete r[e],bt(r)&&delete t.components)}function Jf({asyncapi:t,asyncapiDir:e,componentsFiles:r,channelsFiles:n,ext:o,specVersion:s}){let i=t.components;if(i){let l=function(p){let f=Wr.join(a,p);ho(f,p);for(let m of Object.keys(i?.[p]||{})){let d=fr(f,m,o);yt(e,d,m);let y=i?.[p]?.[m];ze(y,Wr.dirname(d),r),qr(y,Wr.dirname(d),n),go(d,y)?A.warn(`warning: conflict for ${m} - file already exists with different content: ${te(d)} ... Skip.
332
332
  `):_e(y,d),delete i?.[p]?.[m]}Yf(t,p)},a=Wr.join(e,Se);Kf.mkdirSync(a,{recursive:!0}),mo(i,s).forEach(l)}}import*as Xf from"node:fs";import*as dr from"node:path";function Qf({operations:t,asyncapiDir:e,outDir:r,componentsFiles:n,channelsFiles:o,pathSeparator:s,ext:i}){if(t){Xf.mkdirSync(r,{recursive:!0});for(let a of Object.keys(t)){let c=`${dr.join(r,Ht(a,s))}.${i}`,l=t[a];je(l)||(yt(e,c,a),ze(l,dr.dirname(c),n),qr(l,dr.dirname(c),o),_e(l,c),t[a]={$ref:Ve(dr.relative(e,c))},mr(r,Lr,n))}}}function eu({asyncapi:t,asyncapiDir:e,pathSeparator:r,ext:n,specVersion:o}){Zf.mkdirSync(e,{recursive:!0});let s={};Wf({asyncapi:t,asyncapiDir:e,componentsFiles:s,ext:n,specVersion:o});let i=t.channels,a=i?Gf({channels:i,asyncapiDir:e,outDir:yo.join(e,bp),componentsFiles:s,pathSeparator:r,ext:n}):{};Jf({asyncapi:t,asyncapiDir:e,componentsFiles:s,channelsFiles:a,ext:n,specVersion:o}),o==="async3"&&t.operations&&Qf({operations:t.operations,asyncapiDir:e,outDir:yo.join(e,Sp),componentsFiles:s,channelsFiles:a,pathSeparator:r,ext:n}),ze(t,e,s),_e(t,yo.join(e,`asyncapi.${n}`))}import*as cu from"node:fs";import*as Eo from"node:path";import*as iu from"node:fs";import*as Ur from"node:path";import*as wo from"node:path";function tu(t){return wo.basename(t,wo.extname(t))}function ru(t){return t?Di.filter(e=>Fr(e)&&Object.keys(t).includes(e)):[]}function nu(t,e,r,n,o){let s=[];r==="schemas"&&(s=(t?.[r]?.[n]?.allOf||[]).map(({$ref:i})=>i).filter(dn)),e[r]=e[r]||{},e[r][n]={inherits:s,filename:o}}import*as bo from"node:path";function ou(t,e,r,n){if(!t.discriminator)return;let o=`#/${Se}/schemas/${e}`,s={};for(let[l,{inherits:p,filename:f}]of Object.entries(n))if(p.indexOf(o)>-1){let m=Ve(bo.relative(bo.dirname(r),f));s[l]=m.startsWith(".")?m:"./"+m}if(bt(s))return;let i=t.properties[t.discriminator.propertyName],a=i&&i.enum,c=t.discriminator.mapping=t.discriminator.mapping||{};for(let l of Object.keys(s))a&&!a.includes(l)||(c[l]&&c[l]!==s[l]&&A.warn(`warning: explicit mapping overlaps with local mapping entry ${mt(l)} at ${te(r)}. Please check it.`),c[l]=s[l])}function su(t,e){t.components&&bt(t.components[e])&&delete t.components[e],bt(t.components)&&delete t.components}function au(t,e,r,n){let{components:o}=t;if(o){let a=function(l){let p=Ur.join(s,l);for(let f of Object.keys(o?.[l]||{})){let m=fr(p,f,n);yt(e,m,f),nu(o,r,l,f,m)}},c=function(l){let p=Ur.join(s,l);ho(p,l);for(let f of Object.keys(o?.[l]||{})){let m=fr(p,f,n),d=o?.[l]?.[f];ze(d,Ur.dirname(m),r),ou(d,tu(m),m,r.schemas||{}),go(m,d)?A.warn(`warning: conflict for ${f} - file already exists with different content: ${te(m)} ... Skip.
@@ -348,12 +348,12 @@ ${o}`}async function pf({argv:t,config:e,version:r,collectSpecData:n}){let o,s;t
348
348
  `),n){case"stylish":du(t);break;case"json":uu(t);break;case"markdown":mu(t);break}Tt("stats",r,e)}function gu(t){let e={refs:{metric:"\u{1F697} References",total:0,color:"red",items:new Set},externalDocs:{metric:"\u{1F4E6} External Documents",total:0,color:"magenta"},schemas:{metric:"\u{1F4C8} Schemas",total:0,color:"white"},parameters:{metric:"\u{1F449} Parameters",total:0,color:"yellow",items:new Set},links:{metric:"\u{1F517} Links",total:0,color:"cyan",items:new Set},pathItems:{metric:"\u{1F500} Path Items",total:0,color:"green"},webhooks:{metric:"\u{1F3A3} Webhooks",total:0,color:"green"},operations:{metric:"\u{1F477} Operations",total:0,color:"yellow"},tags:{metric:"\u{1F516} Tags",total:0,color:"white",items:new Set},xExtensions:{metric:"\u{1F9E9} Vendor Extensions",total:0,color:"cyan",counts:{}}},r={refs:{metric:"\u{1F697} References",total:0,color:"red",items:new Set},externalDocs:{metric:"\u{1F4E6} External Documents",total:0,color:"magenta"},schemas:{metric:"\u{1F4C8} Schemas",total:0,color:"white"},parameters:{metric:"\u{1F449} Parameters",total:0,color:"yellow",items:new Set},channels:{metric:"\u{1F4E1} Channels",total:0,color:"green"},operations:{metric:"\u{1F477} Operations",total:0,color:"yellow"},tags:{metric:"\u{1F516} Tags",total:0,color:"white",items:new Set},xExtensions:{metric:"\u{1F9E9} Vendor Extensions",total:0,color:"cyan",counts:{}}},n,o;switch(t){case"async2":o=r,n=hi(o);break;case"async3":o=r,n=gi(o);break;case"oas2":case"oas3_0":case"oas3_1":case"oas3_2":o=e,n=di(o);break;default:throw new q(`Unsupported spec version: ${t}.`)}return{statsVisitor:n,statsAccumulator:o}}async function yu({argv:t,config:e,collectSpecData:r}){let[{path:n}]=await rt(t.api?[t.api]:[],e),o=new ut(e.resolve),{bundle:s}=await wr({config:e,ref:n});r?.(s);let i=Be(s.parsed),a=hr(e.extendTypes($t(i),i),e),{statsVisitor:c,statsAccumulator:l}=gu(i),p=Jw.now(),f={problems:[],specVersion:i,config:e,visitorsData:{}},m=await gr({rootDocument:s,rootType:a.Root,externalRefResolver:o}),d=Vt([{severity:"warn",ruleId:"stats",visitor:c}],a);Bt({document:s,rootType:a.Root,normalizedVisitors:d,resolvedRefMap:m,ctx:f}),hu(l,n,p,t.format)}import{spawn as Xw}from"node:child_process";var wu=async({argv:t})=>{A.info(`
349
349
  Launching translate using NPX.
350
350
 
351
- `);let{npxExecutableName:e,sanitize:r,shell:n}=Ir(),o=r(t["project-dir"],on),s=r(t.locale,ep);Xw(e,["-y","@redocly/realm","translate",s,`-d=${o}`],{stdio:"inherit",shell:n}).on("error",a=>{throw A.info(`Translate launch failed: ${a.message}`),new Error("Translate launch failed.")})};var bu=wt(Mn(),1);import{existsSync as Qw,writeFileSync as Zw,readFileSync as eb,statSync as tb}from"node:fs";import{tmpdir as ri}from"node:os";import{join as ni}from"node:path";import*as mn from"node:process";var Oo=wt(Ro(),1);var xo=async(t,{timeout:e,...r}={})=>{let n=cn(),o=n&&!lo(t),s,i=e?{connect:{timeout:e}}:{};return o?s=new Oo.ProxyAgent({uri:n,...i}):e&&(s=new Oo.Agent(i)),await fetch(t,{signal:e?AbortSignal.timeout(e):void 0,...r,dispatcher:s})};var oi="redocly-cli-version",rb=1e3*60*60*12,Su=mn.env.NODE_ENV==="test"||mn.env.CI||!!mn.env.LAMBDA_TASK_ROOT||mn.env.REDOCLY_SUPPRESS_UPDATE_NOTICE==="true",Eu=()=>{if(!Su)try{let t=eb(ni(ri(),oi)).toString();nb(dt,t)&&sb(dt,t)}catch{return}},nb=(t,e)=>(0,bu.compare)(t,e)<0,ob=async t=>{let e=`http://registry.npmjs.org/${t}/latest`;try{return(await(await xo(e,{timeout:Cn})).json()).version}catch{return}},Ou=()=>{!ib()||Su||ob(Ei).then(t=>{if(t){let e=ni(ri(),oi);Zw(e,t)}}).catch(()=>{})},sb=(t,e)=>{A.info(Fi([`A new version of ${At("Redocly CLI")} (${xe(e)}) is available.`,`Update now: \`${At("npm i -g @redocly/cli@latest")}\`.`,"Changelog: https://redocly.com/docs/cli/changelog/"]))},ib=()=>{try{let t=ni(ri(),oi);if(!Qw(t))return!0;let e=new Date().getTime(),n=tb(t).mtime.getTime();return e-n>=rb}catch{return!1}};function xu(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 Gt(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 ab}from"node:child_process";import*as Gr from"node:fs";import{existsSync as cb,writeFileSync as lb,readFileSync as pb}from"node:fs";import*as Cu from"node:os";import{tmpdir as vu}from"node:os";import{join as Pu}from"node:path";async function Au(t=Cn){try{return await xo(qi,{timeout:t}),!0}catch{return!1}}var Ao="***";async function Ru({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:p,lint_rules_with_warnings:f,lint_rules_with_ignored_problems:m,generate_client:d,eject_generator:y}){try{if(!e||!await Au(1e3))return;let{_:[S],$0:O,...E}=e,{RedoclyOAuthClient:v,getReuniteUrl:C}=await import("./chunks/ZBK7SJHM.js"),$=new v(dt),J=C(t,E.residency),z=await $.isAuthorized(J),ae=yb();ae||(ae=`ann_${Ui()}`,gb(ae));let Q=yr(o),pe=[{id:S,object:"command",uri:`urn:redocly:cli:command:${S}`,logged_in:z?"yes":"no",command:S,...db(E,process.argv.slice(2)),node_version:process.version,npm_version:hb(),version:dt,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:Q==="arazzo1"&&a?.length?JSON.stringify(a):void 0,respect_source_description_types:Q==="arazzo1"&&c?.length?JSON.stringify(c):void 0,respect_criterion_object_types:Q==="arazzo1"&&l?.length?JSON.stringify(l):void 0,lint_rules_with_errors:p?.length?JSON.stringify(p):void 0,lint_rules_with_warnings:f?.length?JSON.stringify(f):void 0,lint_rules_with_ignored_problems:m?.length?JSON.stringify(m):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:y?.eject_generator_action,eject_generator_name:y?.eject_generator_name,eject_generator_outcome:y?.eject_generator_outcome,eject_generator_conflicts:y?.eject_generator_conflicts,eject_generator_from_version:y?.eject_generator_from_version,eject_generator_to_version:y?.eject_generator_to_version}],R=Wi.mapToCloudEvent({type:"com.redocly.command.ran",source:"urn:redocly:cli",origin:"redocly-cli",env:"production",osPlatform:Cu.platform(),actor:{id:ae,object:"user",uri:""},category:"product",data:pe}),{otelTelemetry:P}=await import("./chunks/SAJRBHEI.js");P.send(R)}catch{}}function _u(t,e){for(let r of t.sourceDescriptions??[])r.type&&e.add(r.type)}function $u(t,e){for(let r of t.workflows??[]){zr(r.successActions,e),zr(r.failureActions,e);for(let n of r.steps??[])Iu(n.successCriteria,e),zr(n.onSuccess,e),zr(n.onFailure,e)}zr(Object.values(t.components?.successActions??{}),e),zr(Object.values(t.components?.failureActions??{}),e)}function zr(t,e){for(let r of t??[])Iu(r.criteria,e)}function Iu(t,e){for(let r of t??[]){let n=fb(r);n&&e.add(n)}}function fb(t){let e=t.type;return typeof e=="string"?e:e?.type||(t.condition?"simple":void 0)}function ju(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 ub(t){return Gr.existsSync(t)&&Gr.statSync(t).isFile()}function mb(t){return Gr.existsSync(t)&&Gr.statSync(t).isDirectory()}function si(t){return t&&(Vr(t)?t.split("://")[0]+"://url":ub(t)?t.replace(/.+\.([^.]+)$/,(e,r)=>"file-"+r):mb(t)?"folder":t)}function ii(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 Tu(t,e){let r={};for(let[n,o]of Object.entries(t))e.includes(n)?r[n]=Ao:I(o)?r[n]=Tu(o,e):r[n]=o;return r}function ai(t,e,r=[]){if(Array.isArray(t))return t.forEach(n=>ai(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))&&ai(o,e,r);return r}function db(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]=Ao,n=ii(n,i,Ao);else if(typeof i=="string"){let a=si(i);o[s]=a,n=ii(n,i,a)}else if(Array.isArray(i)){o[s]=i.map(si);for(let a of i){let c=si(a);n.includes(a)&&(n=n.replaceAll(a,c))}}else if(I(i)){let a=ai(i,r);for(let c of a)n=ii(n,c,Ao);o[s]=Tu(i,r)}else o[s]=i;return{arguments:JSON.stringify(o),raw_input:n}}function hb(){try{return ab("npm -v",{stdio:["ignore","pipe","ignore"]}).toString().trim()}catch{return"unknown"}}var gb=t=>{if(!(process.env.CI||!t))try{let r=Pu(vu(),_o);lb(r,t)}catch{}},yb=()=>{if(!process.env.CI)try{let e=Pu(vu(),_o);return cb(e)?pb(e).toString().trim():void 0}catch{return}};function fe(t){return async e=>{let r=performance.now(),n=2,o,s="unknown",i,a,c,l=new Set,p=new Set,f=new Set,m=({parsed:O,source:E})=>{if(s="unknown",i=void 0,a=void 0,E?.absoluteRef&&yi(E.absoluteRef)){s="graphql";return}try{s=Be(O)}catch{s="unsupported"}I(O)&&(i=O?.openapi?"openapi":O?.swagger?"swagger":O?.asyncapi?"asyncapi":O?.arazzo?"arazzo":O?.overlay?"overlay":void 0,i&&(a=O[i]),yr(s)==="arazzo1"&&(ju(O,l),_u(O,p),$u(O,f)))},d=new Set,y=new Set,h=new Set,S=O=>{for(let E of O)E.ignored?h.add(E.ruleId):E.severity==="error"?d.add(E.ruleId):E.severity==="warn"&&y.add(E.ruleId)};try{if(e.config&&!ci(e.config))throw new q("Please provide a valid path to the configuration file.");c=await ji(e,dt),o=c.resolvedConfig.telemetry,n=1,typeof t=="function"&&await t({argv:e,config:c,version:dt,collectSpecData:m,collectResults:S}),n=0}catch(O){O instanceof bn||(O instanceof q?A.error(O.message+`
351
+ `);let{npxExecutableName:e,sanitize:r,shell:n}=Ir(),o=r(t["project-dir"],on),s=r(t.locale,ep);Xw(e,["-y","@redocly/realm","translate",s,`-d=${o}`],{stdio:"inherit",shell:n}).on("error",a=>{throw A.info(`Translate launch failed: ${a.message}`),new Error("Translate launch failed.")})};var bu=wt(Mn(),1);import{existsSync as Qw,writeFileSync as Zw,readFileSync as eb,statSync as tb}from"node:fs";import{tmpdir as ri}from"node:os";import{join as ni}from"node:path";import*as mn from"node:process";var Oo=wt(Ro(),1);var xo=async(t,{timeout:e,...r}={})=>{let n=cn(),o=n&&!lo(t),s,i=e?{connect:{timeout:e}}:{};return o?s=new Oo.ProxyAgent({uri:n,...i}):e&&(s=new Oo.Agent(i)),await fetch(t,{signal:e?AbortSignal.timeout(e):void 0,...r,dispatcher:s})};var oi="redocly-cli-version",rb=1e3*60*60*12,Su=mn.env.NODE_ENV==="test"||mn.env.CI||!!mn.env.LAMBDA_TASK_ROOT||mn.env.REDOCLY_SUPPRESS_UPDATE_NOTICE==="true",Eu=()=>{if(!Su)try{let t=eb(ni(ri(),oi)).toString();nb(dt,t)&&sb(dt,t)}catch{return}},nb=(t,e)=>(0,bu.compare)(t,e)<0,ob=async t=>{let e=`http://registry.npmjs.org/${t}/latest`;try{return(await(await xo(e,{timeout:Cn})).json()).version}catch{return}},Ou=()=>{!ib()||Su||ob(Ei).then(t=>{if(t){let e=ni(ri(),oi);Zw(e,t)}}).catch(()=>{})},sb=(t,e)=>{A.info(Fi([`A new version of ${At("Redocly CLI")} (${xe(e)}) is available.`,`Update now: \`${At("npm i -g @redocly/cli@latest")}\`.`,"Changelog: https://redocly.com/docs/cli/changelog/"]))},ib=()=>{try{let t=ni(ri(),oi);if(!Qw(t))return!0;let e=new Date().getTime(),n=tb(t).mtime.getTime();return e-n>=rb}catch{return!1}};function xu(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 Gt(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 ab}from"node:child_process";import*as Gr from"node:fs";import{existsSync as cb,writeFileSync as lb,readFileSync as pb}from"node:fs";import*as Cu from"node:os";import{tmpdir as vu}from"node:os";import{join as Pu}from"node:path";async function Au(t=Cn){try{return await xo(qi,{timeout:t}),!0}catch{return!1}}var Ao="***";async function Ru({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:p,lint_rules_with_warnings:f,lint_rules_with_ignored_problems:m,generate_client:d,eject_generator:y}){try{if(!e||!await Au(1e3))return;let{_:[S],$0:O,...E}=e,{RedoclyOAuthClient:v,getReuniteUrl:C}=await import("./chunks/UUIZXPYS.js"),$=new v(dt),J=C(t,E.residency),z=await $.isAuthorized(J),ae=yb();ae||(ae=`ann_${Ui()}`,gb(ae));let Q=yr(o),pe=[{id:S,object:"command",uri:`urn:redocly:cli:command:${S}`,logged_in:z?"yes":"no",command:S,...db(E,process.argv.slice(2)),node_version:process.version,npm_version:hb(),version:dt,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:Q==="arazzo1"&&a?.length?JSON.stringify(a):void 0,respect_source_description_types:Q==="arazzo1"&&c?.length?JSON.stringify(c):void 0,respect_criterion_object_types:Q==="arazzo1"&&l?.length?JSON.stringify(l):void 0,lint_rules_with_errors:p?.length?JSON.stringify(p):void 0,lint_rules_with_warnings:f?.length?JSON.stringify(f):void 0,lint_rules_with_ignored_problems:m?.length?JSON.stringify(m):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:y?.eject_generator_action,eject_generator_name:y?.eject_generator_name,eject_generator_outcome:y?.eject_generator_outcome,eject_generator_conflicts:y?.eject_generator_conflicts,eject_generator_from_version:y?.eject_generator_from_version,eject_generator_to_version:y?.eject_generator_to_version}],R=Wi.mapToCloudEvent({type:"com.redocly.command.ran",source:"urn:redocly:cli",origin:"redocly-cli",env:"production",osPlatform:Cu.platform(),actor:{id:ae,object:"user",uri:""},category:"product",data:pe}),{otelTelemetry:P}=await import("./chunks/CWYADEAF.js");P.send(R)}catch{}}function _u(t,e){for(let r of t.sourceDescriptions??[])r.type&&e.add(r.type)}function $u(t,e){for(let r of t.workflows??[]){zr(r.successActions,e),zr(r.failureActions,e);for(let n of r.steps??[])Iu(n.successCriteria,e),zr(n.onSuccess,e),zr(n.onFailure,e)}zr(Object.values(t.components?.successActions??{}),e),zr(Object.values(t.components?.failureActions??{}),e)}function zr(t,e){for(let r of t??[])Iu(r.criteria,e)}function Iu(t,e){for(let r of t??[]){let n=fb(r);n&&e.add(n)}}function fb(t){let e=t.type;return typeof e=="string"?e:e?.type||(t.condition?"simple":void 0)}function ju(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 ub(t){return Gr.existsSync(t)&&Gr.statSync(t).isFile()}function mb(t){return Gr.existsSync(t)&&Gr.statSync(t).isDirectory()}function si(t){return t&&(Vr(t)?t.split("://")[0]+"://url":ub(t)?t.replace(/.+\.([^.]+)$/,(e,r)=>"file-"+r):mb(t)?"folder":t)}function ii(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 Tu(t,e){let r={};for(let[n,o]of Object.entries(t))e.includes(n)?r[n]=Ao:I(o)?r[n]=Tu(o,e):r[n]=o;return r}function ai(t,e,r=[]){if(Array.isArray(t))return t.forEach(n=>ai(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))&&ai(o,e,r);return r}function db(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]=Ao,n=ii(n,i,Ao);else if(typeof i=="string"){let a=si(i);o[s]=a,n=ii(n,i,a)}else if(Array.isArray(i)){o[s]=i.map(si);for(let a of i){let c=si(a);n.includes(a)&&(n=n.replaceAll(a,c))}}else if(I(i)){let a=ai(i,r);for(let c of a)n=ii(n,c,Ao);o[s]=Tu(i,r)}else o[s]=i;return{arguments:JSON.stringify(o),raw_input:n}}function hb(){try{return ab("npm -v",{stdio:["ignore","pipe","ignore"]}).toString().trim()}catch{return"unknown"}}var gb=t=>{if(!(process.env.CI||!t))try{let r=Pu(vu(),_o);lb(r,t)}catch{}},yb=()=>{if(!process.env.CI)try{let e=Pu(vu(),_o);return cb(e)?pb(e).toString().trim():void 0}catch{return}};function fe(t){return async e=>{let r=performance.now(),n=2,o,s="unknown",i,a,c,l=new Set,p=new Set,f=new Set,m=({parsed:O,source:E})=>{if(s="unknown",i=void 0,a=void 0,E?.absoluteRef&&yi(E.absoluteRef)){s="graphql";return}try{s=Be(O)}catch{s="unsupported"}I(O)&&(i=O?.openapi?"openapi":O?.swagger?"swagger":O?.asyncapi?"asyncapi":O?.arazzo?"arazzo":O?.overlay?"overlay":void 0,i&&(a=O[i]),yr(s)==="arazzo1"&&(ju(O,l),_u(O,p),$u(O,f)))},d=new Set,y=new Set,h=new Set,S=O=>{for(let E of O)E.ignored?h.add(E.ruleId):E.severity==="error"?d.add(E.ruleId):E.severity==="warn"&&y.add(E.ruleId)};try{if(e.config&&!ci(e.config))throw new q("Please provide a valid path to the configuration file.");c=await ji(e,dt),o=c.resolvedConfig.telemetry,n=1,typeof t=="function"&&await t({argv:e,config:c,version:dt,collectSpecData:m,collectResults:S}),n=0}catch(O){O instanceof bn||(O instanceof q?A.error(O.message+`
352
352
 
353
353
  `):(A.error(`An unexpected error occurred. This is likely a bug that should be reported.
354
354
  `),A.error(O instanceof Error?O.stack||O.message:String(O)),A.error(`
355
- `)))}finally{if(process.env.REDOCLY_TELEMETRY!=="off"&&o!=="off"){let O=Math.round(performance.now()-r);await Ru({config:c,argv:e,exit_code:n,execution_time:O,spec_version:s,spec_keyword:i,spec_full_version:a,respect_x_security_auth_types:[...l],respect_source_description_types:[...p],respect_criterion_object_types:[...f],lint_rules_with_errors:[...d],lint_rules_with_warnings:[...y],lint_rules_with_ignored_problems:[...h],generate_client:Xe,eject_generator:de})}process.once("beforeExit",()=>{process.exit(n)})}}}ku.config({path:Nu.resolve(process.cwd(),"./.env")});Ou();Nl(is(process.argv)).version("version","Show version number.",dt).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=>{fe(yu)(t)}).command("inspect-node-types <api>","Show the node types of an API description, for writing configurable rules and custom plugins [experimental].",t=>t.env("REDOCLY_CLI_INSPECT_NODE_TYPES").positional("api",{description:"API description file to inspect.",type:"string",demandOption:!0}).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"},pointer:{description:"JSON pointer to a node, optionally prefixed with a file: `#/paths` or `schemas.yaml#/User`.",type:"string",alias:"p"},type:{description:"List only the nodes of this type.",type:"string"},summary:{description:"List the node types used in the description, with counts.",type:"boolean"},parents:{description:"Show the chain of node types leading to the node: down to the node with --pointer, or the distinct chains that reach the type with --type.",type:"boolean"}}).conflicts({pointer:["type","summary"],type:["summary"],summary:["parents"]}).check(e=>{if(e.parents&&!e.pointer&&!e.type)throw new Error("The --parents option requires --pointer or --type.");return!0}),t=>{fe(wp)(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=>{fe(Df)(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=>{fe(fu)(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=>{fe(Lp)(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"}}),async t=>{let{handlePushStatus:e}=await import("./chunks/QZBHV7SD.js");fe(e)(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:xu},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}}),async t=>{let{handlePush:e}=await import("./chunks/3RDMQ5CQ.js");fe(e)(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=>{fe(xi)(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:Ai},"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=>{fe(Dl)(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=>{fe()(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"}}),async t=>{let{handleLogin:e}=await import("./chunks/VTKYS75A.js");fe(e)(t)}).command("logout","Clear your stored credentials.",t=>t,async t=>{let{handleLogout:e}=await import("./chunks/2MBZI3W3.js");fe(e)(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:Mp,default:"enterprise"},port:{alias:"p",type:"number",description:"Preview port.",default:4e3,coerce:Gt("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"))&&A.error(`Option --source-dir is deprecated and will be removed soon. Use --project-dir instead.
356
- `),fe(Fp)(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/SZKF6VFY.js");fe(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=>{fe(wu)(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=>{fe(tp)(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:uf},severity:{describe:"Severity of the check.",type:"string"},"max-steps":{describe:"Maximum number of steps to run (default: 2000).",type:"number",default:2e3,coerce:Gt("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:Gt("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:Gt("execution-timeout",!1)},"no-secrets-masking":{describe:"Do not mask secrets in the output.",type:"boolean",default:!1}}),async t=>{fe(pf)(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:Gt("ai-concurrency",!0)},"max-workflows":{describe:"Most workflows the AI may design with --with-ai.",type:"number",default:10,coerce:Gt("max-workflows",!0)}}),async t=>{fe(ap)(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=>{fe(dp)(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 (${[..._r].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=>{fe(Ql)(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:Gt("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/CI4NGJ3I.js");fe(e)(t)}).command("introspect-mcp [server-url]","Introspect a running MCP server and record its capabilities in the x-mcp extension of an OpenAPI description [experimental].",t=>t.env("REDOCLY_CLI_INTROSPECT_MCP").positional("server-url",{describe:"URL of the MCP server (Streamable HTTP, with a fallback to the legacy HTTP+SSE transport). Alternative to --command.",type:"string"}).option({command:{describe:'Command that starts a local MCP server to introspect over stdio, for example "npx -y my-mcp-server". Quote arguments that contain spaces. Alternative to a server URL.',type:"string",requiresArg:!0},output:{alias:"o",describe:"OpenAPI description file to create or update.",type:"string",default:"openapi.yaml"},header:{alias:"H",describe:'Header sent with every request to the MCP server, in "Name: value" format. Repeat the option for multiple headers.',array:!0,type:"string"},check:{describe:"Verify the description is up to date with the MCP server instead of writing: report the differences and exit with an error when it is not.",type:"boolean",default:!1},config:{describe:"Path to the config file.",type:"string"}}).check(e=>{if(!!e["server-url"]==!!e.command)throw new Error("Provide either an MCP server URL or --command, not both.");if(e.command&&e.header)throw new Error("The --header option only applies to an MCP server URL.");return!0}),async t=>{let{handleIntrospectMcp:e}=await import("./chunks/IW2J6X26.js");fe(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=>{let{handleScorecardClassic:e}=await import("./chunks/LLGJ3YMR.js");fe(e)(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/YDSFHQXH.js");fe(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/KEF4233Y.js");fe(e)(t)}).completion("completion","Generate autocomplete script for `redocly` command.").demandCommand(1).middleware([Eu]).strict().argv;
355
+ `)))}finally{if(process.env.REDOCLY_TELEMETRY!=="off"&&o!=="off"){let O=Math.round(performance.now()-r);await Ru({config:c,argv:e,exit_code:n,execution_time:O,spec_version:s,spec_keyword:i,spec_full_version:a,respect_x_security_auth_types:[...l],respect_source_description_types:[...p],respect_criterion_object_types:[...f],lint_rules_with_errors:[...d],lint_rules_with_warnings:[...y],lint_rules_with_ignored_problems:[...h],generate_client:Xe,eject_generator:de})}process.once("beforeExit",()=>{process.exit(n)})}}}ku.config({path:Nu.resolve(process.cwd(),"./.env")});Ou();Nl(is(process.argv)).version("version","Show version number.",dt).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=>{fe(yu)(t)}).command("inspect-node-types <api>","Show the node types of an API description, for writing configurable rules and custom plugins [experimental].",t=>t.env("REDOCLY_CLI_INSPECT_NODE_TYPES").positional("api",{description:"API description file to inspect.",type:"string",demandOption:!0}).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"},pointer:{description:"JSON pointer to a node, optionally prefixed with a file: `#/paths` or `schemas.yaml#/User`.",type:"string",alias:"p"},type:{description:"List only the nodes of this type.",type:"string"},summary:{description:"List the node types used in the description, with counts.",type:"boolean"},parents:{description:"Show the chain of node types leading to the node: down to the node with --pointer, or the distinct chains that reach the type with --type.",type:"boolean"}}).conflicts({pointer:["type","summary"],type:["summary"],summary:["parents"]}).check(e=>{if(e.parents&&!e.pointer&&!e.type)throw new Error("The --parents option requires --pointer or --type.");return!0}),t=>{fe(wp)(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=>{fe(Df)(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=>{fe(fu)(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=>{fe(Lp)(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"}}),async t=>{let{handlePushStatus:e}=await import("./chunks/FSTHNUTZ.js");fe(e)(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:xu},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}}),async t=>{let{handlePush:e}=await import("./chunks/RBL3UMVK.js");fe(e)(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=>{fe(xi)(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:Ai},"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=>{fe(Dl)(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=>{fe()(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"}}),async t=>{let{handleLogin:e}=await import("./chunks/WCMZCZST.js");fe(e)(t)}).command("logout","Clear your stored credentials.",t=>t,async t=>{let{handleLogout:e}=await import("./chunks/3UYF5CLP.js");fe(e)(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:Mp,default:"enterprise"},port:{alias:"p",type:"number",description:"Preview port.",default:4e3,coerce:Gt("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"))&&A.error(`Option --source-dir is deprecated and will be removed soon. Use --project-dir instead.
356
+ `),fe(Fp)(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/ICLFVPDF.js");fe(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=>{fe(wu)(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=>{fe(tp)(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:uf},severity:{describe:"Severity of the check.",type:"string"},"max-steps":{describe:"Maximum number of steps to run (default: 2000).",type:"number",default:2e3,coerce:Gt("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:Gt("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:Gt("execution-timeout",!1)},"no-secrets-masking":{describe:"Do not mask secrets in the output.",type:"boolean",default:!1}}),async t=>{fe(pf)(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:Gt("ai-concurrency",!0)},"max-workflows":{describe:"Most workflows the AI may design with --with-ai.",type:"number",default:10,coerce:Gt("max-workflows",!0)}}),async t=>{fe(ap)(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=>{fe(dp)(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 (${[..._r].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=>{fe(Ql)(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:Gt("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/ITRAFA2I.js");fe(e)(t)}).command("introspect-mcp [server-url]","Introspect a running MCP server and record its capabilities in the x-mcp extension of an OpenAPI description [experimental].",t=>t.env("REDOCLY_CLI_INTROSPECT_MCP").positional("server-url",{describe:"URL of the MCP server (Streamable HTTP, with a fallback to the legacy HTTP+SSE transport). Alternative to --command.",type:"string"}).option({command:{describe:'Command that starts a local MCP server to introspect over stdio, for example "npx -y my-mcp-server". Quote arguments that contain spaces. Alternative to a server URL.',type:"string",requiresArg:!0},output:{alias:"o",describe:"OpenAPI description file to create or update.",type:"string",default:"openapi.yaml"},header:{alias:"H",describe:'Header sent with every request to the MCP server, in "Name: value" format. Repeat the option for multiple headers.',array:!0,type:"string"},check:{describe:"Verify the description is up to date with the MCP server instead of writing: report the differences and exit with an error when it is not.",type:"boolean",default:!1},config:{describe:"Path to the config file.",type:"string"}}).check(e=>{if(!!e["server-url"]==!!e.command)throw new Error("Provide either an MCP server URL or --command, not both.");if(e.command&&e.header)throw new Error("The --header option only applies to an MCP server URL.");return!0}),async t=>{let{handleIntrospectMcp:e}=await import("./chunks/LZRNA4HH.js");fe(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=>{let{handleScorecardClassic:e}=await import("./chunks/BR3C2ZRO.js");fe(e)(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/KVPIWPOL.js");fe(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/HR7ZTPFZ.js");fe(e)(t)}).completion("completion","Generate autocomplete script for `redocly` command.").demandCommand(1).middleware([Eu]).strict().argv;
357
357
  /*! Bundled license information:
358
358
 
359
359
  cookie/index.js: