@redocly/cli 2.52.0 → 2.52.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/THIRD_PARTY_NOTICES +2 -2
- package/lib/chunks/{QNFSWXWM.js → 43FMQGIC.js} +1 -1
- package/lib/chunks/{LJ53IMLM.js → 4XWI7J57.js} +352 -339
- package/lib/chunks/{OMNGRJM6.js → ANMFTH7J.js} +1 -1
- package/lib/chunks/{U7Z4MLK3.js → AOOXKVZ6.js} +1 -1
- package/lib/chunks/{FPLER37P.js → BWQB4GUQ.js} +1 -1
- package/lib/chunks/{UKWZHJSE.js → DDB52L66.js} +1 -1
- package/lib/chunks/{WPCGRKTH.js → E44UEWCI.js} +1 -1
- package/lib/chunks/{BOUAXXEO.js → F7TVQGKE.js} +1 -1
- package/lib/chunks/{JQW53OZ2.js → GCM2GVOB.js} +1 -1
- package/lib/chunks/{RZMAAWKX.js → GNCL6OYK.js} +1 -1
- package/lib/chunks/{CD6HJQ7Z.js → IBTEY2L5.js} +1 -1
- package/lib/chunks/{2LDFGQ7M.js → KMCWK6TG.js} +1 -1
- package/lib/chunks/{GZNSV6XB.js → KTY2NT6E.js} +1 -1
- package/lib/chunks/{O6PRCLSV.js → KXHIHQWX.js} +6 -6
- package/lib/chunks/{SVJJMDUS.js → M7QRMIWR.js} +1 -1
- package/lib/chunks/{NY4C4KO6.js → MTD74D7D.js} +1 -1
- package/lib/chunks/{35R6GCFO.js → N2CTYNAN.js} +1 -1
- package/lib/chunks/{7AUMFZDC.js → NOI562GM.js} +1 -1
- package/lib/chunks/{EI27DJLF.js → OTGTOSNW.js} +1 -1
- package/lib/chunks/{RCG4MSAO.js → P3CVK7VZ.js} +1 -1
- package/lib/chunks/{BXFJJ63W.js → T5KTLVAZ.js} +1 -1
- package/lib/chunks/{XAKGO2KF.js → TWYMGTRR.js} +1 -1
- package/lib/chunks/{TR2ZE2NA.js → U3LG2XZJ.js} +1 -1
- package/lib/chunks/{SGNOWOE7.js → WNOJ33NP.js} +1 -1
- package/lib/chunks/{UXC4J2II.js → WNU6CBDY.js} +1 -1
- package/lib/chunks/{QTYASRSS.js → X4ZTHKYE.js} +1 -1
- package/lib/chunks/{X6NXBBZT.js → YDCOQ3IQ.js} +1 -1
- package/lib/chunks/{E23GS6YK.js → YMON5AYA.js} +1 -1
- package/lib/chunks/{P5GXYHU7.js → YVY7OG3K.js} +1 -1
- package/lib/chunks/{N6O32QAI.js → Z56NVT3C.js} +1 -1
- package/lib/chunks/{QB32BX35.js → ZAZG6Z4J.js} +1 -1
- package/lib/chunks/{BQFGD55Z.js → ZGSX24WO.js} +1 -1
- package/lib/chunks/{TPYGW72X.js → ZQYHXXTF.js} +1 -1
- package/lib/chunks/{AQFM7XGG.js → ZXPLB4LA.js} +1 -1
- package/lib/eject-assets/generators/cli/docs.ts +1 -1
- package/lib/eject-assets/generators/cli/engine-source.ts +1 -1
- package/lib/eject-assets/generators/cli/index.ts +2 -2
- package/lib/eject-assets/generators/cli/render.ts +1 -1
- package/lib/eject-assets/generators/go/client.ts +1 -1
- package/lib/eject-assets/generators/go/descriptor.ts +1 -1
- package/lib/eject-assets/generators/go/index.ts +2 -2
- package/lib/eject-assets/generators/go/models.ts +1 -1
- package/lib/eject-assets/generators/go/naming.ts +1 -1
- package/lib/eject-assets/generators/go/operations.ts +1 -1
- package/lib/eject-assets/generators/go/pagination.ts +1 -1
- package/lib/eject-assets/generators/go/types.ts +1 -1
- package/lib/eject-assets/generators/mock/faker.ts +1 -1
- package/lib/eject-assets/generators/mock/index.ts +2 -2
- package/lib/eject-assets/generators/mock/render.ts +1 -1
- package/lib/eject-assets/generators/mock/sample.ts +1 -1
- package/lib/eject-assets/generators/mock/values.ts +1 -1
- package/lib/eject-assets/generators/php/client.ts +1 -1
- package/lib/eject-assets/generators/php/descriptor.ts +1 -1
- package/lib/eject-assets/generators/php/index.ts +2 -2
- package/lib/eject-assets/generators/php/models.ts +1 -1
- package/lib/eject-assets/generators/php/naming.ts +1 -1
- package/lib/eject-assets/generators/php/operations.ts +1 -1
- package/lib/eject-assets/generators/php/pagination.ts +1 -1
- package/lib/eject-assets/generators/php/types.ts +1 -1
- package/lib/eject-assets/generators/python/client.ts +1 -1
- package/lib/eject-assets/generators/python/descriptor.ts +1 -1
- package/lib/eject-assets/generators/python/index.ts +2 -2
- package/lib/eject-assets/generators/python/models.ts +1 -1
- package/lib/eject-assets/generators/python/naming.ts +1 -1
- package/lib/eject-assets/generators/python/operations.ts +1 -1
- package/lib/eject-assets/generators/python/pagination.ts +1 -1
- package/lib/eject-assets/generators/python/types.ts +1 -1
- package/lib/eject-assets/generators/swr/index.ts +2 -2
- package/lib/eject-assets/generators/swr/render.ts +1 -1
- package/lib/eject-assets/generators/tanstack-query/index.ts +2 -2
- package/lib/eject-assets/generators/tanstack-query/render.ts +1 -1
- package/lib/eject-assets/generators/transformers/index.ts +2 -2
- package/lib/eject-assets/generators/transformers/render.ts +1 -1
- package/lib/eject-assets/generators/typescript/banner.ts +1 -1
- package/lib/eject-assets/generators/typescript/client.ts +1 -1
- package/lib/eject-assets/generators/typescript/descriptor.ts +1 -1
- package/lib/eject-assets/generators/typescript/index.ts +2 -2
- package/lib/eject-assets/generators/typescript/inline-runtime.ts +1 -1
- package/lib/eject-assets/generators/typescript/operation-signature.ts +1 -1
- package/lib/eject-assets/generators/typescript/operation-types.ts +1 -1
- package/lib/eject-assets/generators/typescript/operations.ts +1 -1
- package/lib/eject-assets/generators/typescript/response-headers.ts +1 -1
- package/lib/eject-assets/generators/typescript/type-guards.ts +1 -1
- package/lib/eject-assets/generators/typescript/types.ts +1 -1
- package/lib/eject-assets/generators/zod/index.ts +2 -2
- package/lib/eject-assets/generators/zod/schemas.ts +1 -1
- package/lib/index.js +8 -8
- 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 Ji,b as Xi,c as Je,d as Zi,e as Nn,f as rt,g as rr,h as Qi,i as ea,j as Yo,k as ta,l as _r,m as je,n as Ln,o as ra,p as na,q as oa,r as sa,s as sn,t as Ko,u as At,v as an}from"./chunks/SEECFWS6.js";import{a as Mn,b as Fn,c as Un,d as qn,e as ia,f as aa,g as Ir,h as ca}from"./chunks/O3T4DGBI.js";import{a as tr,b as G}from"./chunks/AGENG2WT.js";import{c as Wn,d as la,f as pa}from"./chunks/CD6HJQ7Z.js";import"./chunks/O6PRCLSV.js";import{a as ua,c as fa}from"./chunks/OFAMJNQ6.js";import{a as jn,b as Rr,c as Ho,d as Yi,e as kn,f as Ki,g as Dn,h as on}from"./chunks/UXC4J2II.js";import"./chunks/RS5PUOTT.js";import{a as Hi}from"./chunks/BXI4SF2U.js";import"./chunks/32XCOMOR.js";import{a as Bi,c as Tn,d as Bo}from"./chunks/P26PQ2RU.js";import{a as ft,b as Gi,c as Vi}from"./chunks/P5GXYHU7.js";import{$ as er,A as Fi,B as Ft,C as pt,E as Ui,F as qi,H as et,I as vr,L as Ee,N as qe,O as me,P as te,Q,R as ut,S as be,T as Ge,U as fe,V as nn,W as g,X as Pr,Y as tt,Z as Qt,a as _i,aa as Wi,b as Lt,ba as $r,c as I,d as vt,da as Rn,ea as jt,f as Ii,fa as _n,g as ji,ga as In,h as $n,ha as Ke,i as Vo,j as Ti,ka as zi,l as De,ma as de,n as ze,o as ki,p as Cr,q as Ne,r as Di,s as rn,t as Ni,u as Mt,y as Li,z as Mi}from"./chunks/MJSI4VHA.js";import"./chunks/NEWT5A6S.js";import{a as Ye,c as B,e as It}from"./chunks/RFWIIJFG.js";var jr=B((PS,ma)=>{"use strict";var xm="2.0.0",Cm=Number.MAX_SAFE_INTEGER||9007199254740991,vm=16,Pm=250,$m=["major","premajor","minor","preminor","patch","prepatch","prerelease"];ma.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:vm,MAX_SAFE_BUILD_LENGTH:Pm,MAX_SAFE_INTEGER:Cm,RELEASE_TYPES:$m,SEMVER_SPEC_VERSION:xm,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var cn=B(($S,da)=>{"use strict";var Rm=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};da.exports=Rm});var Tr=B((Pt,ha)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:Jo,MAX_SAFE_BUILD_LENGTH:_m,MAX_LENGTH:Im}=jr(),jm=cn();Pt=ha.exports={};var Tm=Pt.re=[],km=Pt.safeRe=[],j=Pt.src=[],Dm=Pt.safeSrc=[],T=Pt.t={},Nm=0,Xo="[a-zA-Z0-9-]",Lm=[["\\s",1],["\\d",Im],[Xo,_m]],Mm=t=>{for(let[e,r]of Lm)t=t.split(`${e}*`).join(`${e}{0,${r}}`).split(`${e}+`).join(`${e}{1,${r}}`);return t},ee=(t,e,r)=>{let n=Mm(e),o=Nm++;jm(t,o,e),T[t]=o,j[o]=e,Dm[o]=n,Tm[o]=new RegExp(e,r?"g":void 0),km[o]=new RegExp(n,r?"g":void 0)};ee("NUMERICIDENTIFIER","0|[1-9]\\d*");ee("NUMERICIDENTIFIERLOOSE","\\d+");ee("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Xo}*`);ee("MAINVERSION",`(${j[T.NUMERICIDENTIFIER]})\\.(${j[T.NUMERICIDENTIFIER]})\\.(${j[T.NUMERICIDENTIFIER]})`);ee("MAINVERSIONLOOSE",`(${j[T.NUMERICIDENTIFIERLOOSE]})\\.(${j[T.NUMERICIDENTIFIERLOOSE]})\\.(${j[T.NUMERICIDENTIFIERLOOSE]})`);ee("PRERELEASEIDENTIFIER",`(?:${j[T.NONNUMERICIDENTIFIER]}|${j[T.NUMERICIDENTIFIER]})`);ee("PRERELEASEIDENTIFIERLOOSE",`(?:${j[T.NONNUMERICIDENTIFIER]}|${j[T.NUMERICIDENTIFIERLOOSE]})`);ee("PRERELEASE",`(?:-(${j[T.PRERELEASEIDENTIFIER]}(?:\\.${j[T.PRERELEASEIDENTIFIER]})*))`);ee("PRERELEASELOOSE",`(?:-?(${j[T.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${j[T.PRERELEASEIDENTIFIERLOOSE]})*))`);ee("BUILDIDENTIFIER",`${Xo}+`);ee("BUILD",`(?:\\+(${j[T.BUILDIDENTIFIER]}(?:\\.${j[T.BUILDIDENTIFIER]})*))`);ee("FULLPLAIN",`v?${j[T.MAINVERSION]}${j[T.PRERELEASE]}?${j[T.BUILD]}?`);ee("FULL",`^${j[T.FULLPLAIN]}$`);ee("LOOSEPLAIN",`[v=\\s]*${j[T.MAINVERSIONLOOSE]}${j[T.PRERELEASELOOSE]}?${j[T.BUILD]}?`);ee("LOOSE",`^${j[T.LOOSEPLAIN]}$`);ee("GTLT","((?:<|>)?=?)");ee("XRANGEIDENTIFIERLOOSE",`${j[T.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);ee("XRANGEIDENTIFIER",`${j[T.NUMERICIDENTIFIER]}|x|X|\\*`);ee("XRANGEPLAIN",`[v=\\s]*(${j[T.XRANGEIDENTIFIER]})(?:\\.(${j[T.XRANGEIDENTIFIER]})(?:\\.(${j[T.XRANGEIDENTIFIER]})(?:${j[T.PRERELEASE]})?${j[T.BUILD]}?)?)?`);ee("XRANGEPLAINLOOSE",`[v=\\s]*(${j[T.XRANGEIDENTIFIERLOOSE]})(?:\\.(${j[T.XRANGEIDENTIFIERLOOSE]})(?:\\.(${j[T.XRANGEIDENTIFIERLOOSE]})(?:${j[T.PRERELEASELOOSE]})?${j[T.BUILD]}?)?)?`);ee("XRANGE",`^${j[T.GTLT]}\\s*${j[T.XRANGEPLAIN]}$`);ee("XRANGELOOSE",`^${j[T.GTLT]}\\s*${j[T.XRANGEPLAINLOOSE]}$`);ee("COERCEPLAIN",`(^|[^\\d])(\\d{1,${Jo}})(?:\\.(\\d{1,${Jo}}))?(?:\\.(\\d{1,${Jo}}))?`);ee("COERCE",`${j[T.COERCEPLAIN]}(?:$|[^\\d])`);ee("COERCEFULL",j[T.COERCEPLAIN]+`(?:${j[T.PRERELEASE]})?(?:${j[T.BUILD]})?(?:$|[^\\d])`);ee("COERCERTL",j[T.COERCE],!0);ee("COERCERTLFULL",j[T.COERCEFULL],!0);ee("LONETILDE","(?:~>?)");ee("TILDETRIM",`(\\s*)${j[T.LONETILDE]}\\s+`,!0);Pt.tildeTrimReplace="$1~";ee("TILDE",`^${j[T.LONETILDE]}${j[T.XRANGEPLAIN]}$`);ee("TILDELOOSE",`^${j[T.LONETILDE]}${j[T.XRANGEPLAINLOOSE]}$`);ee("LONECARET","(?:\\^)");ee("CARETTRIM",`(\\s*)${j[T.LONECARET]}\\s+`,!0);Pt.caretTrimReplace="$1^";ee("CARET",`^${j[T.LONECARET]}${j[T.XRANGEPLAIN]}$`);ee("CARETLOOSE",`^${j[T.LONECARET]}${j[T.XRANGEPLAINLOOSE]}$`);ee("COMPARATORLOOSE",`^${j[T.GTLT]}\\s*(${j[T.LOOSEPLAIN]})$|^$`);ee("COMPARATOR",`^${j[T.GTLT]}\\s*(${j[T.FULLPLAIN]})$|^$`);ee("COMPARATORTRIM",`(\\s*)${j[T.GTLT]}\\s*(${j[T.LOOSEPLAIN]}|${j[T.XRANGEPLAIN]})`,!0);Pt.comparatorTrimReplace="$1$2$3";ee("HYPHENRANGE",`^\\s*(${j[T.XRANGEPLAIN]})\\s+-\\s+(${j[T.XRANGEPLAIN]})\\s*$`);ee("HYPHENRANGELOOSE",`^\\s*(${j[T.XRANGEPLAINLOOSE]})\\s+-\\s+(${j[T.XRANGEPLAINLOOSE]})\\s*$`);ee("STAR","(<|>)?=?\\s*\\*");ee("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");ee("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var zn=B((RS,ga)=>{"use strict";var Fm=Object.freeze({loose:!0}),Um=Object.freeze({}),qm=t=>t?typeof t!="object"?Fm:t:Um;ga.exports=qm});var Zo=B((_S,ba)=>{"use strict";var ya=/^[0-9]+$/,wa=(t,e)=>{if(typeof t=="number"&&typeof e=="number")return t===e?0:t<e?-1:1;let r=ya.test(t),n=ya.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t<e?-1:1},Wm=(t,e)=>wa(e,t);ba.exports={compareIdentifiers:wa,rcompareIdentifiers:Wm}});var Le=B((IS,Ea)=>{"use strict";var Gn=cn(),{MAX_LENGTH:Sa,MAX_SAFE_INTEGER:Vn}=jr(),{safeRe:Bn,t:Hn}=Tr(),zm=zn(),{compareIdentifiers:Qo}=Zo(),Gm=(t,e)=>{let r=e.split(".");if(r.length>t.length)return!1;for(let n=0;n<r.length;n++)if(Qo(t[n],r[n])!==0)return!1;return!0},es=class t{constructor(e,r){if(r=zm(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>Sa)throw new TypeError(`version is longer than ${Sa} characters`);Gn("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=e.trim().match(r.loose?Bn[Hn.LOOSE]:Bn[Hn.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>Vn||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Vn||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Vn||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<Vn)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(Gn("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(Gn("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 Qo(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(Gn("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 Qo(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?Bn[Hn.PRERELEASELOOSE]:Bn[Hn.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]),Gm(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}};Ea.exports=es});var Ut=B((jS,Oa)=>{"use strict";var Aa=Le(),Vm=(t,e,r=!1)=>{if(t instanceof Aa)return t;try{return new Aa(t,e)}catch(n){if(!r)return null;throw n}};Oa.exports=Vm});var Ca=B((TS,xa)=>{"use strict";var Bm=Ut(),Hm=(t,e)=>{let r=Bm(t,e);return r?r.version:null};xa.exports=Hm});var Pa=B((kS,va)=>{"use strict";var Ym=Ut(),Km=(t,e)=>{let r=Ym(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null};va.exports=Km});var _a=B((DS,Ra)=>{"use strict";var $a=Le(),Jm=(t,e,r,n,o)=>{typeof r=="string"&&(o=n,n=r,r=void 0);try{return new $a(t instanceof $a?t.version:t,r).inc(e,n,o).version}catch{return null}};Ra.exports=Jm});var Ta=B((NS,ja)=>{"use strict";var Ia=Ut(),Xm=(t,e)=>{let r=Ia(t,null,!0),n=Ia(e,null,!0),o=r.compare(n);if(o===0)return null;let s=o>0,i=s?r:n,a=s?n:r,c=!!i.prerelease.length;if(!!a.prerelease.length&&!c){if(!a.patch&&!a.minor)return"major";if(a.compareMain(i)===0)return a.minor&&!a.patch?"minor":"patch"}let u=c?"pre":"";return r.major!==n.major?u+"major":r.minor!==n.minor?u+"minor":r.patch!==n.patch?u+"patch":"prerelease"};ja.exports=Xm});var Da=B((LS,ka)=>{"use strict";var Zm=Le(),Qm=(t,e)=>new Zm(t,e).major;ka.exports=Qm});var La=B((MS,Na)=>{"use strict";var ed=Le(),td=(t,e)=>new ed(t,e).minor;Na.exports=td});var Fa=B((FS,Ma)=>{"use strict";var rd=Le(),nd=(t,e)=>new rd(t,e).patch;Ma.exports=nd});var qa=B((US,Ua)=>{"use strict";var od=Ut(),sd=(t,e)=>{let r=od(t,e);return r&&r.prerelease.length?r.prerelease:null};Ua.exports=sd});var mt=B((qS,za)=>{"use strict";var Wa=Le(),id=(t,e,r)=>new Wa(t,r).compare(new Wa(e,r));za.exports=id});var Va=B((WS,Ga)=>{"use strict";var ad=mt(),cd=(t,e,r)=>ad(e,t,r);Ga.exports=cd});var Ha=B((zS,Ba)=>{"use strict";var ld=mt(),pd=(t,e)=>ld(t,e,!0);Ba.exports=pd});var Yn=B((GS,Ka)=>{"use strict";var Ya=Le(),ud=(t,e,r)=>{let n=new Ya(t,r),o=new Ya(e,r);return n.compare(o)||n.compareBuild(o)};Ka.exports=ud});var Xa=B((VS,Ja)=>{"use strict";var fd=Yn(),md=(t,e)=>t.sort((r,n)=>fd(r,n,e));Ja.exports=md});var Qa=B((BS,Za)=>{"use strict";var dd=Yn(),hd=(t,e)=>t.sort((r,n)=>dd(n,r,e));Za.exports=hd});var ln=B((HS,ec)=>{"use strict";var gd=mt(),yd=(t,e,r)=>gd(t,e,r)>0;ec.exports=yd});var Kn=B((YS,tc)=>{"use strict";var wd=mt(),bd=(t,e,r)=>wd(t,e,r)<0;tc.exports=bd});var ts=B((KS,rc)=>{"use strict";var Sd=mt(),Ed=(t,e,r)=>Sd(t,e,r)===0;rc.exports=Ed});var rs=B((JS,nc)=>{"use strict";var Ad=mt(),Od=(t,e,r)=>Ad(t,e,r)!==0;nc.exports=Od});var Jn=B((XS,oc)=>{"use strict";var xd=mt(),Cd=(t,e,r)=>xd(t,e,r)>=0;oc.exports=Cd});var Xn=B((ZS,sc)=>{"use strict";var vd=mt(),Pd=(t,e,r)=>vd(t,e,r)<=0;sc.exports=Pd});var ns=B((QS,ic)=>{"use strict";var $d=ts(),Rd=rs(),_d=ln(),Id=Jn(),jd=Kn(),Td=Xn(),kd=(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 $d(t,r,n);case"!=":return Rd(t,r,n);case">":return _d(t,r,n);case">=":return Id(t,r,n);case"<":return jd(t,r,n);case"<=":return Td(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}};ic.exports=kd});var cc=B((eE,ac)=>{"use strict";var Dd=Le(),Nd=Ut(),{safeRe:Zn,t:Qn}=Tr(),Ld=(t,e)=>{if(t instanceof Dd)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?Zn[Qn.COERCEFULL]:Zn[Qn.COERCE]);else{let c=e.includePrerelease?Zn[Qn.COERCERTLFULL]:Zn[Qn.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 Nd(`${n}.${o}.${s}${i}${a}`,e)};ac.exports=Ld});var pc=B((tE,lc)=>{"use strict";var Md=Ut(),Fd=jr(),Ud=Le(),qd=(t,e,r)=>{if(!Fd.RELEASE_TYPES.includes(e))return null;let n=Wd(t,r);return n&&zd(n,e)},Wd=(t,e)=>{let r=t instanceof Ud?t.version:t;return Md(r,e)},zd=(t,e)=>{if(Gd(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()},Gd=t=>t.startsWith("pre");lc.exports=qd});var fc=B((rE,uc)=>{"use strict";var os=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}};uc.exports=os});var dt=B((nE,gc)=>{"use strict";var Vd=/\s+/g,ss=class t{constructor(e,r){if(r=Hd(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof is)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(Vd," "),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=>!dc(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&&rh(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(th,"");let n=((this.options.includePrerelease&&Qd)|(this.options.loose&&eh))+":"+e,o=mc.get(n);if(o)return o;let s=this.options.loose,i=s?Ve[Me.HYPHENRANGELOOSE]:Ve[Me.HYPHENRANGE];e=e.replace(i,mh(this.options.includePrerelease)),ge("hyphen replace",e),e=e.replace(Ve[Me.COMPARATORTRIM],Jd),ge("comparator trim",e),e=e.replace(Ve[Me.TILDETRIM],Xd),ge("tilde trim",e),e=e.replace(Ve[Me.CARETTRIM],Zd),ge("caret trim",e);let a=e.split(" ").map(p=>nh(p,this.options)).join(" ").split(/\s+/).map(p=>fh(p,this.options));s&&(a=a.filter(p=>(ge("loose invalid filter",p,this.options),!!p.match(Ve[Me.COMPARATORLOOSE])))),ge("range list",a);let c=new Map,l=a.map(p=>new is(p,this.options));for(let p of l){if(dc(p))return[p];c.set(p.value,p)}c.size>1&&c.has("")&&c.delete("");let u=[...c.values()];return mc.set(n,u),u}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(n=>hc(n,r)&&e.set.some(o=>hc(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 Yd(e,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(dh(this.set[r],e,this.options))return!0;return!1}};gc.exports=ss;var Bd=fc(),mc=new Bd,Hd=zn(),is=pn(),ge=cn(),Yd=Le(),{safeRe:Ve,src:Kd,t:Me,comparatorTrimReplace:Jd,tildeTrimReplace:Xd,caretTrimReplace:Zd}=Tr(),{FLAG_INCLUDE_PRERELEASE:Qd,FLAG_LOOSE:eh}=jr(),th=new RegExp(Kd[Me.BUILD],"g"),dc=t=>t.value==="<0.0.0-0",rh=t=>t.value==="",hc=(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},nh=(t,e)=>(t=t.replace(Ve[Me.BUILD],""),ge("comp",t,e),t=ah(t,e),ge("caret",t),t=sh(t,e),ge("tildes",t),t=lh(t,e),ge("xrange",t),t=uh(t,e),ge("stars",t),t),$e=t=>!t||t.toLowerCase()==="x"||t==="*",oh=(t,e,r)=>$e(t)&&!$e(e)||$e(e)&&r&&!$e(r),sh=(t,e)=>t.trim().split(/\s+/).map(r=>ih(r,e)).join(" "),ih=(t,e)=>{let r=e.loose?Ve[Me.TILDELOOSE]:Ve[Me.TILDE],n=e.includePrerelease?"-0":"";return t.replace(r,(o,s,i,a,c)=>{ge("tilde",t,o,s,i,a,c);let l;return $e(s)?l="":$e(i)?l=`>=${s}.0.0${n} <${+s+1}.0.0-0`:$e(a)?l=`>=${s}.${i}.0${n} <${s}.${+i+1}.0-0`:c?(ge("replaceTilde pr",c),l=`>=${s}.${i}.${a}-${c} <${s}.${+i+1}.0-0`):l=`>=${s}.${i}.${a} <${s}.${+i+1}.0-0`,ge("tilde return",l),l})},ah=(t,e)=>t.trim().split(/\s+/).map(r=>ch(r,e)).join(" "),ch=(t,e)=>{ge("caret",t,e);let r=e.loose?Ve[Me.CARETLOOSE]:Ve[Me.CARET],n=e.includePrerelease?"-0":"";return t.replace(r,(o,s,i,a,c)=>{ge("caret",t,o,s,i,a,c);let l;return $e(s)?l="":$e(i)?l=`>=${s}.0.0${n} <${+s+1}.0.0-0`:$e(a)?s==="0"?l=`>=${s}.${i}.0${n} <${s}.${+i+1}.0-0`:l=`>=${s}.${i}.0${n} <${+s+1}.0.0-0`:c?(ge("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`):(ge("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`),ge("caret return",l),l})},lh=(t,e)=>(ge("replaceXRanges",t,e),t.split(/\s+/).map(r=>ph(r,e)).join(" ")),ph=(t,e)=>{t=t.trim();let r=e.loose?Ve[Me.XRANGELOOSE]:Ve[Me.XRANGE];return t.replace(r,(n,o,s,i,a,c)=>{if(ge("xRange",t,n,o,s,i,a,c),oh(s,i,a))return t;let l=$e(s),u=l||$e(i),p=u||$e(a),f=p;return o==="="&&f&&(o=""),c=e.includePrerelease?"-0":"",l?o===">"||o==="<"?n="<0.0.0-0":n="*":o&&f?(u&&(i=0),a=0,o===">"?(o=">=",u?(s=+s+1,i=0,a=0):(i=+i+1,a=0)):o==="<="&&(o="<",u?s=+s+1:i=+i+1),o==="<"&&(c="-0"),n=`${o+s}.${i}.${a}${c}`):u?n=`>=${s}.0.0${c} <${+s+1}.0.0-0`:p&&(n=`>=${s}.${i}.0${c} <${s}.${+i+1}.0-0`),ge("xRange return",n),n})},uh=(t,e)=>(ge("replaceStars",t,e),t.trim().replace(Ve[Me.STAR],"")),fh=(t,e)=>(ge("replaceGTE0",t,e),t.trim().replace(Ve[e.includePrerelease?Me.GTE0PRE:Me.GTE0],"")),mh=t=>(e,r,n,o,s,i,a,c,l,u,p,f)=>($e(n)?r="":$e(o)?r=`>=${n}.0.0${t?"-0":""}`:$e(s)?r=`>=${n}.${o}.0${t?"-0":""}`:i?r=`>=${r}`:r=`>=${r}${t?"-0":""}`,$e(l)?c="":$e(u)?c=`<${+l+1}.0.0-0`:$e(p)?c=`<${l}.${+u+1}.0-0`:f?c=`<=${l}.${u}.${p}-${f}`:t?c=`<${l}.${u}.${+p+1}-0`:c=`<=${c}`,`${r} ${c}`.trim()),dh=(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(ge(t[n].semver),t[n].semver!==is.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 pn=B((oE,Ac)=>{"use strict";var un=Symbol("SemVer ANY"),ls=class t{static get ANY(){return un}constructor(e,r){if(r=yc(r),e instanceof t){if(e.loose===!!r.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),cs("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===un?this.value="":this.value=this.operator+this.semver.version,cs("comp",this)}parse(e){let r=this.options.loose?wc[bc.COMPARATORLOOSE]:wc[bc.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 Sc(n[2],this.options.loose):this.semver=un}toString(){return this.value}test(e){if(cs("Comparator.test",e,this.options.loose),this.semver===un||e===un)return!0;if(typeof e=="string")try{e=new Sc(e,this.options)}catch{return!1}return as(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 Ec(e.value,r).test(this.value):e.operator===""?e.value===""?!0:new Ec(this.value,r).test(e.semver):(r=yc(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("=")||as(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||as(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};Ac.exports=ls;var yc=zn(),{safeRe:wc,t:bc}=Tr(),as=ns(),cs=cn(),Sc=Le(),Ec=dt()});var fn=B((sE,Oc)=>{"use strict";var hh=dt(),gh=(t,e,r)=>{try{e=new hh(e,r)}catch{return!1}return e.test(t)};Oc.exports=gh});var Cc=B((iE,xc)=>{"use strict";var yh=dt(),wh=(t,e)=>new yh(t,e).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));xc.exports=wh});var Pc=B((aE,vc)=>{"use strict";var bh=Le(),Sh=dt(),Eh=(t,e,r)=>{let n=null,o=null,s=null;try{s=new Sh(e,r)}catch{return null}return t.forEach(i=>{s.test(i)&&(!n||o.compare(i)===-1)&&(n=i,o=new bh(n,r))}),n};vc.exports=Eh});var Rc=B((cE,$c)=>{"use strict";var Ah=Le(),Oh=dt(),xh=(t,e,r)=>{let n=null,o=null,s=null;try{s=new Oh(e,r)}catch{return null}return t.forEach(i=>{s.test(i)&&(!n||o.compare(i)===1)&&(n=i,o=new Ah(n,r))}),n};$c.exports=xh});var jc=B((lE,Ic)=>{"use strict";var ps=Le(),Ch=dt(),_c=ln(),vh=(t,e)=>{t=new Ch(t,e);let r=new ps("0.0.0");if(t.test(r)||(r=new ps("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 ps(i.semver.version);switch(i.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!s||_c(a,s))&&(s=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${i.operator}`)}}),s&&(!r||_c(r,s))&&(r=s)}return r&&t.test(r)?r:null};Ic.exports=vh});var kc=B((pE,Tc)=>{"use strict";var Ph=dt(),$h=(t,e)=>{try{return new Ph(t,e).range||"*"}catch{return null}};Tc.exports=$h});var eo=B((uE,Mc)=>{"use strict";var Rh=Le(),Lc=pn(),{ANY:_h}=Lc,Ih=dt(),jh=fn(),Dc=ln(),Nc=Kn(),Th=Xn(),kh=Jn(),Dh=(t,e,r,n)=>{t=new Rh(t,n),e=new Ih(e,n);let o,s,i,a,c;switch(r){case">":o=Dc,s=Th,i=Nc,a=">",c=">=";break;case"<":o=Nc,s=kh,i=Dc,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(jh(t,e,n))return!1;for(let l=0;l<e.set.length;++l){let u=e.set[l],p=null,f=null;if(u.forEach(h=>{h.semver===_h&&(h=new Lc(">=0.0.0")),p=p||h,f=f||h,o(h.semver,p.semver,n)?p=h:i(h.semver,f.semver,n)&&(f=h)}),p.operator===a||p.operator===c||(!f.operator||f.operator===a)&&s(t,f.semver))return!1;if(f.operator===c&&i(t,f.semver))return!1}return!0};Mc.exports=Dh});var Uc=B((fE,Fc)=>{"use strict";var Nh=eo(),Lh=(t,e,r)=>Nh(t,e,">",r);Fc.exports=Lh});var Wc=B((mE,qc)=>{"use strict";var Mh=eo(),Fh=(t,e,r)=>Mh(t,e,"<",r);qc.exports=Fh});var Vc=B((dE,Gc)=>{"use strict";var zc=dt(),Uh=(t,e,r)=>(t=new zc(t,r),e=new zc(e,r),t.intersects(e,r));Gc.exports=Uh});var Hc=B((hE,Bc)=>{"use strict";var qh=fn(),Wh=mt();Bc.exports=(t,e,r)=>{let n=[],o=null,s=null,i=t.sort((u,p)=>Wh(u,p,r));for(let u of i)qh(u,e,r)?(s=u,o||(o=u)):(s&&n.push([o,s]),s=null,o=null);o&&n.push([o,null]);let a=[];for(let[u,p]of n)u===p?a.push(u):!p&&u===i[0]?a.push("*"):p?u===i[0]?a.push(`<=${p}`):a.push(`${u} - ${p}`):a.push(`>=${u}`);let c=a.join(" || "),l=typeof e.raw=="string"?e.raw:String(e);return c.length<l.length?c:e}});var Qc=B((gE,Zc)=>{"use strict";var Yc=dt(),ms=pn(),{ANY:us}=ms,fs=fn(),ds=mt(),zh=(t,e,r={})=>{if(t===e)return!0;t=new Yc(t,r),e=new Yc(e,r);let n=!1;e:for(let o of t.set){for(let s of e.set){let i=Vh(o,s,r);if(n=n||i!==null,i)continue e}if(n)return!1}return!0},Gh=[new ms(">=0.0.0-0")],Kc=[new ms(">=0.0.0")],Vh=(t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===us){if(e.length===1&&e[0].semver===us)return!0;r.includePrerelease?t=Gh:t=Kc}if(e.length===1&&e[0].semver===us){if(r.includePrerelease)return!0;e=Kc}let n=new Set,o,s;for(let h of t)h.operator===">"||h.operator===">="?o=Jc(o,h,r):h.operator==="<"||h.operator==="<="?s=Xc(s,h,r):n.add(h.semver);if(n.size>1)return null;let i;if(o&&s){if(i=ds(o.semver,s.semver,r),i>0)return null;if(i===0&&(o.operator!==">="||s.operator!=="<="))return null}for(let h of n){if(o&&!fs(h,String(o),r)||s&&!fs(h,String(s),r))return null;for(let y of e)if(!fs(h,String(y),r))return!1;return!0}let a,c,l,u,p=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1,f=o&&!r.includePrerelease&&o.semver.prerelease.length?o.semver:!1;p&&p.prerelease.length===1&&s.operator==="<"&&p.prerelease[0]===0&&(p=!1);for(let h of e){if(u=u||h.operator===">"||h.operator===">=",l=l||h.operator==="<"||h.operator==="<=",o){if(f&&h.semver.prerelease&&h.semver.prerelease.length&&h.semver.major===f.major&&h.semver.minor===f.minor&&h.semver.patch===f.patch&&(f=!1),h.operator===">"||h.operator===">="){if(a=Jc(o,h,r),a===h&&a!==o)return!1}else if(o.operator===">="&&!h.test(o.semver))return!1}if(s){if(p&&h.semver.prerelease&&h.semver.prerelease.length&&h.semver.major===p.major&&h.semver.minor===p.minor&&h.semver.patch===p.patch&&(p=!1),h.operator==="<"||h.operator==="<="){if(c=Xc(s,h,r),c===h&&c!==s)return!1}else if(s.operator==="<="&&!h.test(s.semver))return!1}if(!h.operator&&(s||o)&&i!==0)return!1}return!(o&&l&&!s&&i!==0||s&&u&&!o&&i!==0||f||p)},Jc=(t,e,r)=>{if(!t)return e;let n=ds(t.semver,e.semver,r);return n>0?t:n<0||e.operator===">"&&t.operator===">="?e:t},Xc=(t,e,r)=>{if(!t)return e;let n=ds(t.semver,e.semver,r);return n<0?t:n>0||e.operator==="<"&&t.operator==="<="?e:t};Zc.exports=zh});var to=B((yE,rl)=>{"use strict";var hs=Tr(),el=jr(),Bh=Le(),tl=Zo(),Hh=Ut(),Yh=Ca(),Kh=Pa(),Jh=_a(),Xh=Ta(),Zh=Da(),Qh=La(),eg=Fa(),tg=qa(),rg=mt(),ng=Va(),og=Ha(),sg=Yn(),ig=Xa(),ag=Qa(),cg=ln(),lg=Kn(),pg=ts(),ug=rs(),fg=Jn(),mg=Xn(),dg=ns(),hg=cc(),gg=pc(),yg=pn(),wg=dt(),bg=fn(),Sg=Cc(),Eg=Pc(),Ag=Rc(),Og=jc(),xg=kc(),Cg=eo(),vg=Uc(),Pg=Wc(),$g=Vc(),Rg=Hc(),_g=Qc();rl.exports={parse:Hh,valid:Yh,clean:Kh,inc:Jh,diff:Xh,major:Zh,minor:Qh,patch:eg,prerelease:tg,compare:rg,rcompare:ng,compareLoose:og,compareBuild:sg,sort:ig,rsort:ag,gt:cg,lt:lg,eq:pg,neq:ug,gte:fg,lte:mg,cmp:dg,coerce:hg,truncate:gg,Comparator:yg,Range:wg,satisfies:bg,toComparators:Sg,maxSatisfying:Eg,minSatisfying:Ag,minVersion:Og,validRange:xg,outside:Cg,gtr:vg,ltr:Pg,intersects:$g,simplifyRange:Rg,subset:_g,SemVer:Bh,re:hs.re,src:hs.src,tokens:hs.t,SEMVER_SPEC_VERSION:el.SEMVER_SPEC_VERSION,RELEASE_TYPES:el.RELEASE_TYPES,compareIdentifiers:tl.compareIdentifiers,rcompareIdentifiers:tl.rcompareIdentifiers}});var ol=B((SE,Ig)=>{Ig.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 Ss=B((EE,Tt)=>{var ys=Ye("fs"),ws=Ye("path"),jg=Ye("os"),Tg=Ye("crypto"),kg=ol(),bs=kg.version,Dg=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function Ng(t){let e={},r=t.toString();r=r.replace(/\r\n?/mg,`
|
|
8
|
+
import{a as Ji,b as Xi,c as Je,d as Zi,e as Nn,f as rt,g as rr,h as Qi,i as ea,j as Yo,k as ta,l as _r,m as je,n as Ln,o as ra,p as na,q as oa,r as sa,s as sn,t as Ko,u as At,v as an}from"./chunks/SEECFWS6.js";import{a as Mn,b as Fn,c as Un,d as qn,e as ia,f as aa,g as Ir,h as ca}from"./chunks/O3T4DGBI.js";import{a as tr,b as G}from"./chunks/AGENG2WT.js";import{c as Wn,d as la,f as pa}from"./chunks/IBTEY2L5.js";import"./chunks/KXHIHQWX.js";import{a as ua,c as fa}from"./chunks/OFAMJNQ6.js";import{a as jn,b as Rr,c as Ho,d as Yi,e as kn,f as Ki,g as Dn,h as on}from"./chunks/WNU6CBDY.js";import"./chunks/RS5PUOTT.js";import{a as Hi}from"./chunks/BXI4SF2U.js";import"./chunks/32XCOMOR.js";import{a as Bi,c as Tn,d as Bo}from"./chunks/P26PQ2RU.js";import{a as ft,b as Gi,c as Vi}from"./chunks/YVY7OG3K.js";import{$ as er,A as Fi,B as Ft,C as pt,E as Ui,F as qi,H as et,I as vr,L as Ee,N as qe,O as me,P as te,Q,R as ut,S as be,T as Ge,U as fe,V as nn,W as g,X as Pr,Y as tt,Z as Qt,a as _i,aa as Wi,b as Lt,ba as $r,c as I,d as vt,da as Rn,ea as jt,f as Ii,fa as _n,g as ji,ga as In,h as $n,ha as Ke,i as Vo,j as Ti,ka as zi,l as De,ma as de,n as ze,o as ki,p as Cr,q as Ne,r as Di,s as rn,t as Ni,u as Mt,y as Li,z as Mi}from"./chunks/MJSI4VHA.js";import"./chunks/NEWT5A6S.js";import{a as Ye,c as B,e as It}from"./chunks/RFWIIJFG.js";var jr=B((PS,ma)=>{"use strict";var xm="2.0.0",Cm=Number.MAX_SAFE_INTEGER||9007199254740991,vm=16,Pm=250,$m=["major","premajor","minor","preminor","patch","prepatch","prerelease"];ma.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:vm,MAX_SAFE_BUILD_LENGTH:Pm,MAX_SAFE_INTEGER:Cm,RELEASE_TYPES:$m,SEMVER_SPEC_VERSION:xm,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var cn=B(($S,da)=>{"use strict";var Rm=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};da.exports=Rm});var Tr=B((Pt,ha)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:Jo,MAX_SAFE_BUILD_LENGTH:_m,MAX_LENGTH:Im}=jr(),jm=cn();Pt=ha.exports={};var Tm=Pt.re=[],km=Pt.safeRe=[],j=Pt.src=[],Dm=Pt.safeSrc=[],T=Pt.t={},Nm=0,Xo="[a-zA-Z0-9-]",Lm=[["\\s",1],["\\d",Im],[Xo,_m]],Mm=t=>{for(let[e,r]of Lm)t=t.split(`${e}*`).join(`${e}{0,${r}}`).split(`${e}+`).join(`${e}{1,${r}}`);return t},ee=(t,e,r)=>{let n=Mm(e),o=Nm++;jm(t,o,e),T[t]=o,j[o]=e,Dm[o]=n,Tm[o]=new RegExp(e,r?"g":void 0),km[o]=new RegExp(n,r?"g":void 0)};ee("NUMERICIDENTIFIER","0|[1-9]\\d*");ee("NUMERICIDENTIFIERLOOSE","\\d+");ee("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Xo}*`);ee("MAINVERSION",`(${j[T.NUMERICIDENTIFIER]})\\.(${j[T.NUMERICIDENTIFIER]})\\.(${j[T.NUMERICIDENTIFIER]})`);ee("MAINVERSIONLOOSE",`(${j[T.NUMERICIDENTIFIERLOOSE]})\\.(${j[T.NUMERICIDENTIFIERLOOSE]})\\.(${j[T.NUMERICIDENTIFIERLOOSE]})`);ee("PRERELEASEIDENTIFIER",`(?:${j[T.NONNUMERICIDENTIFIER]}|${j[T.NUMERICIDENTIFIER]})`);ee("PRERELEASEIDENTIFIERLOOSE",`(?:${j[T.NONNUMERICIDENTIFIER]}|${j[T.NUMERICIDENTIFIERLOOSE]})`);ee("PRERELEASE",`(?:-(${j[T.PRERELEASEIDENTIFIER]}(?:\\.${j[T.PRERELEASEIDENTIFIER]})*))`);ee("PRERELEASELOOSE",`(?:-?(${j[T.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${j[T.PRERELEASEIDENTIFIERLOOSE]})*))`);ee("BUILDIDENTIFIER",`${Xo}+`);ee("BUILD",`(?:\\+(${j[T.BUILDIDENTIFIER]}(?:\\.${j[T.BUILDIDENTIFIER]})*))`);ee("FULLPLAIN",`v?${j[T.MAINVERSION]}${j[T.PRERELEASE]}?${j[T.BUILD]}?`);ee("FULL",`^${j[T.FULLPLAIN]}$`);ee("LOOSEPLAIN",`[v=\\s]*${j[T.MAINVERSIONLOOSE]}${j[T.PRERELEASELOOSE]}?${j[T.BUILD]}?`);ee("LOOSE",`^${j[T.LOOSEPLAIN]}$`);ee("GTLT","((?:<|>)?=?)");ee("XRANGEIDENTIFIERLOOSE",`${j[T.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);ee("XRANGEIDENTIFIER",`${j[T.NUMERICIDENTIFIER]}|x|X|\\*`);ee("XRANGEPLAIN",`[v=\\s]*(${j[T.XRANGEIDENTIFIER]})(?:\\.(${j[T.XRANGEIDENTIFIER]})(?:\\.(${j[T.XRANGEIDENTIFIER]})(?:${j[T.PRERELEASE]})?${j[T.BUILD]}?)?)?`);ee("XRANGEPLAINLOOSE",`[v=\\s]*(${j[T.XRANGEIDENTIFIERLOOSE]})(?:\\.(${j[T.XRANGEIDENTIFIERLOOSE]})(?:\\.(${j[T.XRANGEIDENTIFIERLOOSE]})(?:${j[T.PRERELEASELOOSE]})?${j[T.BUILD]}?)?)?`);ee("XRANGE",`^${j[T.GTLT]}\\s*${j[T.XRANGEPLAIN]}$`);ee("XRANGELOOSE",`^${j[T.GTLT]}\\s*${j[T.XRANGEPLAINLOOSE]}$`);ee("COERCEPLAIN",`(^|[^\\d])(\\d{1,${Jo}})(?:\\.(\\d{1,${Jo}}))?(?:\\.(\\d{1,${Jo}}))?`);ee("COERCE",`${j[T.COERCEPLAIN]}(?:$|[^\\d])`);ee("COERCEFULL",j[T.COERCEPLAIN]+`(?:${j[T.PRERELEASE]})?(?:${j[T.BUILD]})?(?:$|[^\\d])`);ee("COERCERTL",j[T.COERCE],!0);ee("COERCERTLFULL",j[T.COERCEFULL],!0);ee("LONETILDE","(?:~>?)");ee("TILDETRIM",`(\\s*)${j[T.LONETILDE]}\\s+`,!0);Pt.tildeTrimReplace="$1~";ee("TILDE",`^${j[T.LONETILDE]}${j[T.XRANGEPLAIN]}$`);ee("TILDELOOSE",`^${j[T.LONETILDE]}${j[T.XRANGEPLAINLOOSE]}$`);ee("LONECARET","(?:\\^)");ee("CARETTRIM",`(\\s*)${j[T.LONECARET]}\\s+`,!0);Pt.caretTrimReplace="$1^";ee("CARET",`^${j[T.LONECARET]}${j[T.XRANGEPLAIN]}$`);ee("CARETLOOSE",`^${j[T.LONECARET]}${j[T.XRANGEPLAINLOOSE]}$`);ee("COMPARATORLOOSE",`^${j[T.GTLT]}\\s*(${j[T.LOOSEPLAIN]})$|^$`);ee("COMPARATOR",`^${j[T.GTLT]}\\s*(${j[T.FULLPLAIN]})$|^$`);ee("COMPARATORTRIM",`(\\s*)${j[T.GTLT]}\\s*(${j[T.LOOSEPLAIN]}|${j[T.XRANGEPLAIN]})`,!0);Pt.comparatorTrimReplace="$1$2$3";ee("HYPHENRANGE",`^\\s*(${j[T.XRANGEPLAIN]})\\s+-\\s+(${j[T.XRANGEPLAIN]})\\s*$`);ee("HYPHENRANGELOOSE",`^\\s*(${j[T.XRANGEPLAINLOOSE]})\\s+-\\s+(${j[T.XRANGEPLAINLOOSE]})\\s*$`);ee("STAR","(<|>)?=?\\s*\\*");ee("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");ee("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var zn=B((RS,ga)=>{"use strict";var Fm=Object.freeze({loose:!0}),Um=Object.freeze({}),qm=t=>t?typeof t!="object"?Fm:t:Um;ga.exports=qm});var Zo=B((_S,ba)=>{"use strict";var ya=/^[0-9]+$/,wa=(t,e)=>{if(typeof t=="number"&&typeof e=="number")return t===e?0:t<e?-1:1;let r=ya.test(t),n=ya.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t<e?-1:1},Wm=(t,e)=>wa(e,t);ba.exports={compareIdentifiers:wa,rcompareIdentifiers:Wm}});var Le=B((IS,Ea)=>{"use strict";var Gn=cn(),{MAX_LENGTH:Sa,MAX_SAFE_INTEGER:Vn}=jr(),{safeRe:Bn,t:Hn}=Tr(),zm=zn(),{compareIdentifiers:Qo}=Zo(),Gm=(t,e)=>{let r=e.split(".");if(r.length>t.length)return!1;for(let n=0;n<r.length;n++)if(Qo(t[n],r[n])!==0)return!1;return!0},es=class t{constructor(e,r){if(r=zm(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>Sa)throw new TypeError(`version is longer than ${Sa} characters`);Gn("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=e.trim().match(r.loose?Bn[Hn.LOOSE]:Bn[Hn.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>Vn||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Vn||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Vn||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<Vn)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(Gn("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(Gn("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 Qo(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(Gn("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 Qo(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?Bn[Hn.PRERELEASELOOSE]:Bn[Hn.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]),Gm(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}};Ea.exports=es});var Ut=B((jS,Oa)=>{"use strict";var Aa=Le(),Vm=(t,e,r=!1)=>{if(t instanceof Aa)return t;try{return new Aa(t,e)}catch(n){if(!r)return null;throw n}};Oa.exports=Vm});var Ca=B((TS,xa)=>{"use strict";var Bm=Ut(),Hm=(t,e)=>{let r=Bm(t,e);return r?r.version:null};xa.exports=Hm});var Pa=B((kS,va)=>{"use strict";var Ym=Ut(),Km=(t,e)=>{let r=Ym(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null};va.exports=Km});var _a=B((DS,Ra)=>{"use strict";var $a=Le(),Jm=(t,e,r,n,o)=>{typeof r=="string"&&(o=n,n=r,r=void 0);try{return new $a(t instanceof $a?t.version:t,r).inc(e,n,o).version}catch{return null}};Ra.exports=Jm});var Ta=B((NS,ja)=>{"use strict";var Ia=Ut(),Xm=(t,e)=>{let r=Ia(t,null,!0),n=Ia(e,null,!0),o=r.compare(n);if(o===0)return null;let s=o>0,i=s?r:n,a=s?n:r,c=!!i.prerelease.length;if(!!a.prerelease.length&&!c){if(!a.patch&&!a.minor)return"major";if(a.compareMain(i)===0)return a.minor&&!a.patch?"minor":"patch"}let u=c?"pre":"";return r.major!==n.major?u+"major":r.minor!==n.minor?u+"minor":r.patch!==n.patch?u+"patch":"prerelease"};ja.exports=Xm});var Da=B((LS,ka)=>{"use strict";var Zm=Le(),Qm=(t,e)=>new Zm(t,e).major;ka.exports=Qm});var La=B((MS,Na)=>{"use strict";var ed=Le(),td=(t,e)=>new ed(t,e).minor;Na.exports=td});var Fa=B((FS,Ma)=>{"use strict";var rd=Le(),nd=(t,e)=>new rd(t,e).patch;Ma.exports=nd});var qa=B((US,Ua)=>{"use strict";var od=Ut(),sd=(t,e)=>{let r=od(t,e);return r&&r.prerelease.length?r.prerelease:null};Ua.exports=sd});var mt=B((qS,za)=>{"use strict";var Wa=Le(),id=(t,e,r)=>new Wa(t,r).compare(new Wa(e,r));za.exports=id});var Va=B((WS,Ga)=>{"use strict";var ad=mt(),cd=(t,e,r)=>ad(e,t,r);Ga.exports=cd});var Ha=B((zS,Ba)=>{"use strict";var ld=mt(),pd=(t,e)=>ld(t,e,!0);Ba.exports=pd});var Yn=B((GS,Ka)=>{"use strict";var Ya=Le(),ud=(t,e,r)=>{let n=new Ya(t,r),o=new Ya(e,r);return n.compare(o)||n.compareBuild(o)};Ka.exports=ud});var Xa=B((VS,Ja)=>{"use strict";var fd=Yn(),md=(t,e)=>t.sort((r,n)=>fd(r,n,e));Ja.exports=md});var Qa=B((BS,Za)=>{"use strict";var dd=Yn(),hd=(t,e)=>t.sort((r,n)=>dd(n,r,e));Za.exports=hd});var ln=B((HS,ec)=>{"use strict";var gd=mt(),yd=(t,e,r)=>gd(t,e,r)>0;ec.exports=yd});var Kn=B((YS,tc)=>{"use strict";var wd=mt(),bd=(t,e,r)=>wd(t,e,r)<0;tc.exports=bd});var ts=B((KS,rc)=>{"use strict";var Sd=mt(),Ed=(t,e,r)=>Sd(t,e,r)===0;rc.exports=Ed});var rs=B((JS,nc)=>{"use strict";var Ad=mt(),Od=(t,e,r)=>Ad(t,e,r)!==0;nc.exports=Od});var Jn=B((XS,oc)=>{"use strict";var xd=mt(),Cd=(t,e,r)=>xd(t,e,r)>=0;oc.exports=Cd});var Xn=B((ZS,sc)=>{"use strict";var vd=mt(),Pd=(t,e,r)=>vd(t,e,r)<=0;sc.exports=Pd});var ns=B((QS,ic)=>{"use strict";var $d=ts(),Rd=rs(),_d=ln(),Id=Jn(),jd=Kn(),Td=Xn(),kd=(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 $d(t,r,n);case"!=":return Rd(t,r,n);case">":return _d(t,r,n);case">=":return Id(t,r,n);case"<":return jd(t,r,n);case"<=":return Td(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}};ic.exports=kd});var cc=B((eE,ac)=>{"use strict";var Dd=Le(),Nd=Ut(),{safeRe:Zn,t:Qn}=Tr(),Ld=(t,e)=>{if(t instanceof Dd)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?Zn[Qn.COERCEFULL]:Zn[Qn.COERCE]);else{let c=e.includePrerelease?Zn[Qn.COERCERTLFULL]:Zn[Qn.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 Nd(`${n}.${o}.${s}${i}${a}`,e)};ac.exports=Ld});var pc=B((tE,lc)=>{"use strict";var Md=Ut(),Fd=jr(),Ud=Le(),qd=(t,e,r)=>{if(!Fd.RELEASE_TYPES.includes(e))return null;let n=Wd(t,r);return n&&zd(n,e)},Wd=(t,e)=>{let r=t instanceof Ud?t.version:t;return Md(r,e)},zd=(t,e)=>{if(Gd(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()},Gd=t=>t.startsWith("pre");lc.exports=qd});var fc=B((rE,uc)=>{"use strict";var os=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}};uc.exports=os});var dt=B((nE,gc)=>{"use strict";var Vd=/\s+/g,ss=class t{constructor(e,r){if(r=Hd(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof is)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(Vd," "),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=>!dc(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&&rh(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(th,"");let n=((this.options.includePrerelease&&Qd)|(this.options.loose&&eh))+":"+e,o=mc.get(n);if(o)return o;let s=this.options.loose,i=s?Ve[Me.HYPHENRANGELOOSE]:Ve[Me.HYPHENRANGE];e=e.replace(i,mh(this.options.includePrerelease)),ge("hyphen replace",e),e=e.replace(Ve[Me.COMPARATORTRIM],Jd),ge("comparator trim",e),e=e.replace(Ve[Me.TILDETRIM],Xd),ge("tilde trim",e),e=e.replace(Ve[Me.CARETTRIM],Zd),ge("caret trim",e);let a=e.split(" ").map(p=>nh(p,this.options)).join(" ").split(/\s+/).map(p=>fh(p,this.options));s&&(a=a.filter(p=>(ge("loose invalid filter",p,this.options),!!p.match(Ve[Me.COMPARATORLOOSE])))),ge("range list",a);let c=new Map,l=a.map(p=>new is(p,this.options));for(let p of l){if(dc(p))return[p];c.set(p.value,p)}c.size>1&&c.has("")&&c.delete("");let u=[...c.values()];return mc.set(n,u),u}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(n=>hc(n,r)&&e.set.some(o=>hc(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 Yd(e,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(dh(this.set[r],e,this.options))return!0;return!1}};gc.exports=ss;var Bd=fc(),mc=new Bd,Hd=zn(),is=pn(),ge=cn(),Yd=Le(),{safeRe:Ve,src:Kd,t:Me,comparatorTrimReplace:Jd,tildeTrimReplace:Xd,caretTrimReplace:Zd}=Tr(),{FLAG_INCLUDE_PRERELEASE:Qd,FLAG_LOOSE:eh}=jr(),th=new RegExp(Kd[Me.BUILD],"g"),dc=t=>t.value==="<0.0.0-0",rh=t=>t.value==="",hc=(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},nh=(t,e)=>(t=t.replace(Ve[Me.BUILD],""),ge("comp",t,e),t=ah(t,e),ge("caret",t),t=sh(t,e),ge("tildes",t),t=lh(t,e),ge("xrange",t),t=uh(t,e),ge("stars",t),t),$e=t=>!t||t.toLowerCase()==="x"||t==="*",oh=(t,e,r)=>$e(t)&&!$e(e)||$e(e)&&r&&!$e(r),sh=(t,e)=>t.trim().split(/\s+/).map(r=>ih(r,e)).join(" "),ih=(t,e)=>{let r=e.loose?Ve[Me.TILDELOOSE]:Ve[Me.TILDE],n=e.includePrerelease?"-0":"";return t.replace(r,(o,s,i,a,c)=>{ge("tilde",t,o,s,i,a,c);let l;return $e(s)?l="":$e(i)?l=`>=${s}.0.0${n} <${+s+1}.0.0-0`:$e(a)?l=`>=${s}.${i}.0${n} <${s}.${+i+1}.0-0`:c?(ge("replaceTilde pr",c),l=`>=${s}.${i}.${a}-${c} <${s}.${+i+1}.0-0`):l=`>=${s}.${i}.${a} <${s}.${+i+1}.0-0`,ge("tilde return",l),l})},ah=(t,e)=>t.trim().split(/\s+/).map(r=>ch(r,e)).join(" "),ch=(t,e)=>{ge("caret",t,e);let r=e.loose?Ve[Me.CARETLOOSE]:Ve[Me.CARET],n=e.includePrerelease?"-0":"";return t.replace(r,(o,s,i,a,c)=>{ge("caret",t,o,s,i,a,c);let l;return $e(s)?l="":$e(i)?l=`>=${s}.0.0${n} <${+s+1}.0.0-0`:$e(a)?s==="0"?l=`>=${s}.${i}.0${n} <${s}.${+i+1}.0-0`:l=`>=${s}.${i}.0${n} <${+s+1}.0.0-0`:c?(ge("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`):(ge("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`),ge("caret return",l),l})},lh=(t,e)=>(ge("replaceXRanges",t,e),t.split(/\s+/).map(r=>ph(r,e)).join(" ")),ph=(t,e)=>{t=t.trim();let r=e.loose?Ve[Me.XRANGELOOSE]:Ve[Me.XRANGE];return t.replace(r,(n,o,s,i,a,c)=>{if(ge("xRange",t,n,o,s,i,a,c),oh(s,i,a))return t;let l=$e(s),u=l||$e(i),p=u||$e(a),f=p;return o==="="&&f&&(o=""),c=e.includePrerelease?"-0":"",l?o===">"||o==="<"?n="<0.0.0-0":n="*":o&&f?(u&&(i=0),a=0,o===">"?(o=">=",u?(s=+s+1,i=0,a=0):(i=+i+1,a=0)):o==="<="&&(o="<",u?s=+s+1:i=+i+1),o==="<"&&(c="-0"),n=`${o+s}.${i}.${a}${c}`):u?n=`>=${s}.0.0${c} <${+s+1}.0.0-0`:p&&(n=`>=${s}.${i}.0${c} <${s}.${+i+1}.0-0`),ge("xRange return",n),n})},uh=(t,e)=>(ge("replaceStars",t,e),t.trim().replace(Ve[Me.STAR],"")),fh=(t,e)=>(ge("replaceGTE0",t,e),t.trim().replace(Ve[e.includePrerelease?Me.GTE0PRE:Me.GTE0],"")),mh=t=>(e,r,n,o,s,i,a,c,l,u,p,f)=>($e(n)?r="":$e(o)?r=`>=${n}.0.0${t?"-0":""}`:$e(s)?r=`>=${n}.${o}.0${t?"-0":""}`:i?r=`>=${r}`:r=`>=${r}${t?"-0":""}`,$e(l)?c="":$e(u)?c=`<${+l+1}.0.0-0`:$e(p)?c=`<${l}.${+u+1}.0-0`:f?c=`<=${l}.${u}.${p}-${f}`:t?c=`<${l}.${u}.${+p+1}-0`:c=`<=${c}`,`${r} ${c}`.trim()),dh=(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(ge(t[n].semver),t[n].semver!==is.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 pn=B((oE,Ac)=>{"use strict";var un=Symbol("SemVer ANY"),ls=class t{static get ANY(){return un}constructor(e,r){if(r=yc(r),e instanceof t){if(e.loose===!!r.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),cs("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===un?this.value="":this.value=this.operator+this.semver.version,cs("comp",this)}parse(e){let r=this.options.loose?wc[bc.COMPARATORLOOSE]:wc[bc.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 Sc(n[2],this.options.loose):this.semver=un}toString(){return this.value}test(e){if(cs("Comparator.test",e,this.options.loose),this.semver===un||e===un)return!0;if(typeof e=="string")try{e=new Sc(e,this.options)}catch{return!1}return as(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 Ec(e.value,r).test(this.value):e.operator===""?e.value===""?!0:new Ec(this.value,r).test(e.semver):(r=yc(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("=")||as(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||as(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};Ac.exports=ls;var yc=zn(),{safeRe:wc,t:bc}=Tr(),as=ns(),cs=cn(),Sc=Le(),Ec=dt()});var fn=B((sE,Oc)=>{"use strict";var hh=dt(),gh=(t,e,r)=>{try{e=new hh(e,r)}catch{return!1}return e.test(t)};Oc.exports=gh});var Cc=B((iE,xc)=>{"use strict";var yh=dt(),wh=(t,e)=>new yh(t,e).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));xc.exports=wh});var Pc=B((aE,vc)=>{"use strict";var bh=Le(),Sh=dt(),Eh=(t,e,r)=>{let n=null,o=null,s=null;try{s=new Sh(e,r)}catch{return null}return t.forEach(i=>{s.test(i)&&(!n||o.compare(i)===-1)&&(n=i,o=new bh(n,r))}),n};vc.exports=Eh});var Rc=B((cE,$c)=>{"use strict";var Ah=Le(),Oh=dt(),xh=(t,e,r)=>{let n=null,o=null,s=null;try{s=new Oh(e,r)}catch{return null}return t.forEach(i=>{s.test(i)&&(!n||o.compare(i)===1)&&(n=i,o=new Ah(n,r))}),n};$c.exports=xh});var jc=B((lE,Ic)=>{"use strict";var ps=Le(),Ch=dt(),_c=ln(),vh=(t,e)=>{t=new Ch(t,e);let r=new ps("0.0.0");if(t.test(r)||(r=new ps("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 ps(i.semver.version);switch(i.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!s||_c(a,s))&&(s=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${i.operator}`)}}),s&&(!r||_c(r,s))&&(r=s)}return r&&t.test(r)?r:null};Ic.exports=vh});var kc=B((pE,Tc)=>{"use strict";var Ph=dt(),$h=(t,e)=>{try{return new Ph(t,e).range||"*"}catch{return null}};Tc.exports=$h});var eo=B((uE,Mc)=>{"use strict";var Rh=Le(),Lc=pn(),{ANY:_h}=Lc,Ih=dt(),jh=fn(),Dc=ln(),Nc=Kn(),Th=Xn(),kh=Jn(),Dh=(t,e,r,n)=>{t=new Rh(t,n),e=new Ih(e,n);let o,s,i,a,c;switch(r){case">":o=Dc,s=Th,i=Nc,a=">",c=">=";break;case"<":o=Nc,s=kh,i=Dc,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(jh(t,e,n))return!1;for(let l=0;l<e.set.length;++l){let u=e.set[l],p=null,f=null;if(u.forEach(h=>{h.semver===_h&&(h=new Lc(">=0.0.0")),p=p||h,f=f||h,o(h.semver,p.semver,n)?p=h:i(h.semver,f.semver,n)&&(f=h)}),p.operator===a||p.operator===c||(!f.operator||f.operator===a)&&s(t,f.semver))return!1;if(f.operator===c&&i(t,f.semver))return!1}return!0};Mc.exports=Dh});var Uc=B((fE,Fc)=>{"use strict";var Nh=eo(),Lh=(t,e,r)=>Nh(t,e,">",r);Fc.exports=Lh});var Wc=B((mE,qc)=>{"use strict";var Mh=eo(),Fh=(t,e,r)=>Mh(t,e,"<",r);qc.exports=Fh});var Vc=B((dE,Gc)=>{"use strict";var zc=dt(),Uh=(t,e,r)=>(t=new zc(t,r),e=new zc(e,r),t.intersects(e,r));Gc.exports=Uh});var Hc=B((hE,Bc)=>{"use strict";var qh=fn(),Wh=mt();Bc.exports=(t,e,r)=>{let n=[],o=null,s=null,i=t.sort((u,p)=>Wh(u,p,r));for(let u of i)qh(u,e,r)?(s=u,o||(o=u)):(s&&n.push([o,s]),s=null,o=null);o&&n.push([o,null]);let a=[];for(let[u,p]of n)u===p?a.push(u):!p&&u===i[0]?a.push("*"):p?u===i[0]?a.push(`<=${p}`):a.push(`${u} - ${p}`):a.push(`>=${u}`);let c=a.join(" || "),l=typeof e.raw=="string"?e.raw:String(e);return c.length<l.length?c:e}});var Qc=B((gE,Zc)=>{"use strict";var Yc=dt(),ms=pn(),{ANY:us}=ms,fs=fn(),ds=mt(),zh=(t,e,r={})=>{if(t===e)return!0;t=new Yc(t,r),e=new Yc(e,r);let n=!1;e:for(let o of t.set){for(let s of e.set){let i=Vh(o,s,r);if(n=n||i!==null,i)continue e}if(n)return!1}return!0},Gh=[new ms(">=0.0.0-0")],Kc=[new ms(">=0.0.0")],Vh=(t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===us){if(e.length===1&&e[0].semver===us)return!0;r.includePrerelease?t=Gh:t=Kc}if(e.length===1&&e[0].semver===us){if(r.includePrerelease)return!0;e=Kc}let n=new Set,o,s;for(let h of t)h.operator===">"||h.operator===">="?o=Jc(o,h,r):h.operator==="<"||h.operator==="<="?s=Xc(s,h,r):n.add(h.semver);if(n.size>1)return null;let i;if(o&&s){if(i=ds(o.semver,s.semver,r),i>0)return null;if(i===0&&(o.operator!==">="||s.operator!=="<="))return null}for(let h of n){if(o&&!fs(h,String(o),r)||s&&!fs(h,String(s),r))return null;for(let y of e)if(!fs(h,String(y),r))return!1;return!0}let a,c,l,u,p=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1,f=o&&!r.includePrerelease&&o.semver.prerelease.length?o.semver:!1;p&&p.prerelease.length===1&&s.operator==="<"&&p.prerelease[0]===0&&(p=!1);for(let h of e){if(u=u||h.operator===">"||h.operator===">=",l=l||h.operator==="<"||h.operator==="<=",o){if(f&&h.semver.prerelease&&h.semver.prerelease.length&&h.semver.major===f.major&&h.semver.minor===f.minor&&h.semver.patch===f.patch&&(f=!1),h.operator===">"||h.operator===">="){if(a=Jc(o,h,r),a===h&&a!==o)return!1}else if(o.operator===">="&&!h.test(o.semver))return!1}if(s){if(p&&h.semver.prerelease&&h.semver.prerelease.length&&h.semver.major===p.major&&h.semver.minor===p.minor&&h.semver.patch===p.patch&&(p=!1),h.operator==="<"||h.operator==="<="){if(c=Xc(s,h,r),c===h&&c!==s)return!1}else if(s.operator==="<="&&!h.test(s.semver))return!1}if(!h.operator&&(s||o)&&i!==0)return!1}return!(o&&l&&!s&&i!==0||s&&u&&!o&&i!==0||f||p)},Jc=(t,e,r)=>{if(!t)return e;let n=ds(t.semver,e.semver,r);return n>0?t:n<0||e.operator===">"&&t.operator===">="?e:t},Xc=(t,e,r)=>{if(!t)return e;let n=ds(t.semver,e.semver,r);return n<0?t:n>0||e.operator==="<"&&t.operator==="<="?e:t};Zc.exports=zh});var to=B((yE,rl)=>{"use strict";var hs=Tr(),el=jr(),Bh=Le(),tl=Zo(),Hh=Ut(),Yh=Ca(),Kh=Pa(),Jh=_a(),Xh=Ta(),Zh=Da(),Qh=La(),eg=Fa(),tg=qa(),rg=mt(),ng=Va(),og=Ha(),sg=Yn(),ig=Xa(),ag=Qa(),cg=ln(),lg=Kn(),pg=ts(),ug=rs(),fg=Jn(),mg=Xn(),dg=ns(),hg=cc(),gg=pc(),yg=pn(),wg=dt(),bg=fn(),Sg=Cc(),Eg=Pc(),Ag=Rc(),Og=jc(),xg=kc(),Cg=eo(),vg=Uc(),Pg=Wc(),$g=Vc(),Rg=Hc(),_g=Qc();rl.exports={parse:Hh,valid:Yh,clean:Kh,inc:Jh,diff:Xh,major:Zh,minor:Qh,patch:eg,prerelease:tg,compare:rg,rcompare:ng,compareLoose:og,compareBuild:sg,sort:ig,rsort:ag,gt:cg,lt:lg,eq:pg,neq:ug,gte:fg,lte:mg,cmp:dg,coerce:hg,truncate:gg,Comparator:yg,Range:wg,satisfies:bg,toComparators:Sg,maxSatisfying:Eg,minSatisfying:Ag,minVersion:Og,validRange:xg,outside:Cg,gtr:vg,ltr:Pg,intersects:$g,simplifyRange:Rg,subset:_g,SemVer:Bh,re:hs.re,src:hs.src,tokens:hs.t,SEMVER_SPEC_VERSION:el.SEMVER_SPEC_VERSION,RELEASE_TYPES:el.RELEASE_TYPES,compareIdentifiers:tl.compareIdentifiers,rcompareIdentifiers:tl.rcompareIdentifiers}});var ol=B((SE,Ig)=>{Ig.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 Ss=B((EE,Tt)=>{var ys=Ye("fs"),ws=Ye("path"),jg=Ye("os"),Tg=Ye("crypto"),kg=ol(),bs=kg.version,Dg=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function Ng(t){let e={},r=t.toString();r=r.replace(/\r\n?/mg,`
|
|
9
9
|
`);let n;for(;(n=Dg.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 Lg(t){let e=al(t),r=Re.configDotenv({path:e});if(!r.parsed){let i=new Error(`MISSING_DATA: Cannot parse ${e} for an unknown reason`);throw i.code="MISSING_DATA",i}let n=il(t).split(","),o=n.length,s;for(let i=0;i<o;i++)try{let a=n[i].trim(),c=Ug(r,a);s=Re.decrypt(c.ciphertext,c.key);break}catch(a){if(i+1>=o)throw a}return Re.parse(s)}function Mg(t){console.log(`[dotenv@${bs}][INFO] ${t}`)}function Fg(t){console.log(`[dotenv@${bs}][WARN] ${t}`)}function ro(t){console.log(`[dotenv@${bs}][DEBUG] ${t}`)}function il(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 Ug(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 al(t){let e=null;if(t&&t.path&&t.path.length>0)if(Array.isArray(t.path))for(let r of t.path)ys.existsSync(r)&&(e=r.endsWith(".vault")?r:`${r}.vault`);else e=t.path.endsWith(".vault")?t.path:`${t.path}.vault`;else e=ws.resolve(process.cwd(),".env.vault");return ys.existsSync(e)?e:null}function sl(t){return t[0]==="~"?ws.join(jg.homedir(),t.slice(1)):t}function qg(t){Mg("Loading env from encrypted .env.vault");let e=Re._parseVault(t),r=process.env;return t&&t.processEnv!=null&&(r=t.processEnv),Re.populate(r,e,t),{parsed:e}}function Wg(t){let e=ws.resolve(process.cwd(),".env"),r="utf8",n=!!(t&&t.debug);t&&t.encoding?r=t.encoding:n&&ro("No encoding is specified. UTF-8 is used by default");let o=[e];if(t&&t.path)if(!Array.isArray(t.path))o=[sl(t.path)];else{o=[];for(let c of t.path)o.push(sl(c))}let s,i={};for(let c of o)try{let l=Re.parse(ys.readFileSync(c,{encoding:r}));Re.populate(i,l,t)}catch(l){n&&ro(`Failed to load ${c} ${l.message}`),s=l}let a=process.env;return t&&t.processEnv!=null&&(a=t.processEnv),Re.populate(a,i,t),s?{parsed:i,error:s}:{parsed:i}}function zg(t){if(il(t).length===0)return Re.configDotenv(t);let e=al(t);return e?Re._configVault(t):(Fg(`You set DOTENV_KEY but you are missing a .env.vault file at ${e}. Did you forget to build it?`),Re.configDotenv(t))}function Gg(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=Tg.createDecipheriv("aes-256-gcm",r,o);return i.setAuthTag(s),`${i.update(n)}${i.final()}`}catch(i){let a=i instanceof RangeError,c=i.message==="Invalid key length",l=i.message==="Unsupported state or unable to authenticate data";if(a||c){let u=new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw u.code="INVALID_DOTENV_KEY",u}else if(l){let u=new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw u.code="DECRYPTION_FAILED",u}else throw i}}function Vg(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&&ro(o===!0?`"${s}" is already defined and WAS overwritten`:`"${s}" is already defined and was NOT overwritten`)):t[s]=e[s]}var Re={configDotenv:Wg,_configVault:qg,_parseVault:Lg,config:zg,decrypt:Gg,parse:Ng,populate:Vg};Tt.exports.configDotenv=Re.configDotenv;Tt.exports._configVault=Re._configVault;Tt.exports._parseVault=Re._parseVault;Tt.exports.config=Re.config;Tt.exports.decrypt=Re.decrypt;Tt.exports.parse=Re.parse;Tt.exports.populate=Re.populate;Tt.exports=Re});var Au=B(fi=>{"use strict";fi.parse=eb;fi.serialize=tb;var Yw=Object.prototype.toString,Kw=Object.prototype.hasOwnProperty,Jw=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,Xw=/^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/,Zw=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,Qw=/^[\u0020-\u003A\u003D-\u007E]*$/;function eb(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||rb,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=Su(t,s,i),l=Eu(t,i,c),u=t.slice(c,l);if(!Kw.call(r,u)){var p=Su(t,i+1,a),f=Eu(t,a,p);t.charCodeAt(p)===34&&t.charCodeAt(f-1)===34&&(p++,f--);var h=t.slice(p,f);r[u]=ob(h,o)}s=a+1}while(s<n);return r}function Su(t,e,r){do{var n=t.charCodeAt(e);if(n!==32&&n!==9)return e}while(++e<r);return r}function Eu(t,e,r){for(;e>r;){var n=t.charCodeAt(--e);if(n!==32&&n!==9)return e+1}return r}function tb(t,e,r){var n=r&&r.encode||encodeURIComponent;if(typeof n!="function")throw new TypeError("option encode is invalid");if(!Jw.test(t))throw new TypeError("argument name is invalid");var o=n(e);if(!Xw.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(!Zw.test(r.domain))throw new TypeError("option domain is invalid");s+="; Domain="+r.domain}if(r.path){if(!Qw.test(r.path))throw new TypeError("option path is invalid");s+="; Path="+r.path}if(r.expires){var a=r.expires;if(!nb(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 rb(t){return t.indexOf("%")!==-1?decodeURIComponent(t):t}function nb(t){return Yw.call(t)==="[object Date]"}function ob(t,e){try{return e(t)}catch{return t}}});var vu=B((Vv,On)=>{"use strict";var $o={decodeValues:!0,map:!1,silent:!1};function mi(t){return typeof t=="string"&&!!t.trim()}function di(t,e){var r=t.split(";").filter(mi),n=r.shift(),o=sb(n),s=o.name,i=o.value;e=e?Object.assign({},$o,e):$o;try{i=e.decodeValues?decodeURIComponent(i):i}catch(c){console.error("set-cookie-parser encountered an error while decoding a cookie with value '"+i+"'. Set options.decodeValues to false to disable this feature.",c)}var a={name:s,value:i};return r.forEach(function(c){var l=c.split("="),u=l.shift().trimLeft().toLowerCase(),p=l.join("=");u==="expires"?a.expires=new Date(p):u==="max-age"?a.maxAge=parseInt(p,10):u==="secure"?a.secure=!0:u==="httponly"?a.httpOnly=!0:u==="samesite"?a.sameSite=p:u==="partitioned"?a.partitioned=!0:a[u]=p}),a}function sb(t){var e="",r="",n=t.split("=");return n.length>1?(e=n.shift(),r=n.join("=")):r=t,{name:e,value:r}}function Cu(t,e){if(e=e?Object.assign({},$o,e):$o,!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(mi).reduce(function(o,s){var i=di(s,e);return o[i.name]=i,o},n)}else return t.filter(mi).map(function(o){return di(o,e)})}function ib(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}On.exports=Cu;On.exports.parse=Cu;On.exports.parseString=di;On.exports.splitCookiesString=ib});var nl=It(to(),1);import*as gs from"node:process";try{let t=Vi?.node;typeof t=="string"&&!nl.satisfies(gs.version,t)&&g.warn(`
|
|
11
11
|
\u26A0\uFE0F Warning: failed to satisfy expected node version. Expected: "${t}", Current "${gs.version}"
|
|
@@ -136,7 +136,7 @@ Eject that one and set the framework in your copy's default export:
|
|
|
136
136
|
# then in generators/tanstack-query/index.ts: run: tanstackQueryGenerator('${n}')
|
|
137
137
|
`);return}if(!Fr.has(r))throw we.eject_generator_outcome="unknown-generator",new de(`
|
|
138
138
|
\u274C Unknown generator "${r}". Ejectable generators: ${[...Fr].join(", ")}.
|
|
139
|
-
`);let o=Yy(),s=Ky(o,r),{GENERATOR_VERSION:i}=await import("./chunks/
|
|
139
|
+
`);let o=Yy(),s=Ky(o,r),{GENERATOR_VERSION:i}=await import("./chunks/MTD74D7D.js"),a=Vy(t.dir??"./generators"),c=s===void 0?oe(a,`${r}.mjs`):oe(a,r,"index.ts"),l=St(process.cwd(),c)||c;if(t.update){if(s===void 0){let S=Ue(oe(o,"generators",`${r}.mjs`),"utf-8");Qy({name:r,asset:S,toolkitVersion:i,assetsDir:o,dir:a,target:c,printedTarget:l})}else Zy({name:r,files:s,toolkitVersion:i,assetsDir:o,dir:a,targetDir:oe(a,r)});return}if(Fe(c)&&!t.force)throw we.eject_generator_outcome="already-exists",new de(`
|
|
140
140
|
\u274C ${l} already exists. Use --update to merge the newer version in, or --force to overwrite.
|
|
141
141
|
`);Js(wn(c),{recursive:!0});let u=s===void 0?[Ue(oe(o,"generators",`${r}.mjs`),"utf-8")]:s.map(S=>Ue(oe(o,"generators",r,S),"utf-8"));s===void 0?Oe(c,u[0],"utf-8"):s.forEach((S,v)=>{Oe(oe(a,r,S),u[v],"utf-8")});let p=hp("client-generators",o),f=hp(`${r}-generator`,o);Xs(a,Qs(a));let h=`./${St(e.configPath===void 0?process.cwd():fp(wn(e.configPath)),fp(c)).split("\\").join("/")}`,y=ei({[Xe]:i}),d=u.some(S=>S.includes(`from "${Hs}"`)||S.includes(`from '${Hs}'`)),A=Xy(e.configPath,r,h),O=s===void 0?l:St(process.cwd(),oe(a,r))+"/";g.info(`Ejected the "${r}" generator to ${O}.
|
|
142
142
|
`+(y==="added"?`Added ${Xe} to devDependencies (the ejected file imports its toolkit) \u2014 run your installer.
|
|
@@ -260,7 +260,7 @@ Run the generated workflows against the live API:
|
|
|
260
260
|
|
|
261
261
|
npx @redocly/cli@latest respect ${e}${n}
|
|
262
262
|
|
|
263
|
-
`+o}async function Tp({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/
|
|
263
|
+
`+o}async function Tp({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/ANMFTH7J.js");g.info(fe(`
|
|
264
264
|
Generating Arazzo description...
|
|
265
265
|
`));let l=await c(a),u=pt(l);if(t["with-ai"]){let p=t["ai-provider"];g.info(fe(`
|
|
266
266
|
Designing workflows with AI provider "${p}"...
|
|
@@ -273,7 +273,7 @@ Run the generated workflows against the live API:
|
|
|
273
273
|
\u274C Failed to generate Arazzo description. Check the output file path you provided, or the OpenAPI file content.`)}}import{readFileSync as bw}from"node:fs";import{mkdir as Sw,writeFile as Ew}from"node:fs/promises";import{basename as Np,dirname as ri,extname as Lp,isAbsolute as Mp,relative as kp,resolve as yr}from"node:path";var Aw=/^[a-z][a-z0-9+.-]+:/i;function Fp(t,e){let{setup:r}=t;if(typeof r!="string")return t;if(Aw.test(r))throw new de(`
|
|
274
274
|
\u274C \`client.setup\` must be a local file path \u2014 remote setup modules are not supported.
|
|
275
275
|
Got: ${r}
|
|
276
|
-
`);return Mp(r)?t:{...t,setup:yr(e,r)}}function Ow(t){return`${t.replace(/[\\/]/g,"_")}.client.ts`}function xw(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 Up({argv:t,config:e}){let{AUTHORING_HELPER_NAMES:r,generateClient:n,mergeConfig:o}=await import("./chunks/
|
|
276
|
+
`);return Mp(r)?t:{...t,setup:yr(e,r)}}function Ow(t){return`${t.replace(/[\\/]/g,"_")}.client.ts`}function xw(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 Up({argv:t,config:e}){let{AUTHORING_HELPER_NAMES:r,generateClient:n,mergeConfig:o}=await import("./chunks/MTD74D7D.js"),s=e.configPath?ri(e.configPath):process.cwd(),i={serverUrl:t["server-url"],outputMode:t["output-mode"],runtime:t.runtime,importExt:t["import-ext"],goPackage:t["go-package"],argsStyle:t["args-style"],errorMode:t["error-mode"],dateType:t["date-type"],mockData:t["mock-data"],mockSeed:t["mock-seed"],docs:t.docs,generators:t.generator?.map(f=>f.startsWith(".")?yr(f):f),setup:t.setup===void 0?void 0:Fp({setup:t.setup},process.cwd()).setup},a=e.resolvedConfig.apis??{},c=Object.keys(a).filter(f=>I(a[f].client)||a[f].clientOutput!==void 0);if(t.api===void 0){if(t.output)throw new de("\n\u274C --output can't target multiple APIs. Set `clientOutput` under each api in redocly.yaml, or pass a single <api>.\n");if(c.length===0)throw new de("\n\u274C No API to generate. Add a `client` block or `clientOutput` under an `apis:` entry, or pass <api> (a file/URL or an `apis:` alias).\n")}let l=await Je(t.api===void 0?c:[t.api],e),u={config:e,configDir:s,cliFlags:i,outputFlag:t.output,toolkit:{generateClient:n,mergeConfig:o,helperNames:r},seenOutputs:new Set,composable:[]};for(let f of l)await Cw(f,u);let p=I(e.resolvedConfig.client)?e.resolvedConfig.client:{};p.cliOutput!==void 0&&t.api===void 0&&u.composable.length>0&&await vw(p.cliOutput,u)}async function Cw(t,{config:e,configDir:r,cliFlags:n,outputFlag:o,toolkit:s,seenOutputs:i,composable:a}){let{path:c,alias:l}=t,u=l??Np(c,Lp(c)),p=e.forAlias(l),{client:f,clientOutput:h}=p.resolvedConfig,y=Fp(I(f)?f:{},r),d=s.mergeConfig(y,n);Pw(d.generators??[],s.helperNames,r);let A=o!==void 0?yr(o):h!==void 0?yr(r,h):yr(r,Ow(u));if(!A.endsWith(".ts"))throw new de(`
|
|
277
277
|
\u274C output must point at a TypeScript file (ending in .ts).
|
|
278
278
|
Got: ${A}
|
|
279
279
|
`);if(i.has(A))throw new de(`
|
|
@@ -289,7 +289,7 @@ Run the generated workflows against the live API:
|
|
|
289
289
|
`)}catch(O){let S=O instanceof Error?O.message:String(O);throw at.generate_client_error_category=up(S),new de(`
|
|
290
290
|
\u274C Failed to generate client for ${u}.
|
|
291
291
|
${S}
|
|
292
|
-
`)}}async function vw(t,{configDir:e,seenOutputs:r,composable:n}){let{renderComposedCliEntry:o}=await import("./chunks/
|
|
292
|
+
`)}}async function vw(t,{configDir:e,seenOutputs:r,composable:n}){let{renderComposedCliEntry:o}=await import("./chunks/Z56NVT3C.js"),s=yr(e,t);if(!s.endsWith(".ts"))throw new de(`
|
|
293
293
|
\u274C client.cliOutput must point at a TypeScript file (ending in .ts).
|
|
294
294
|
Got: ${s}
|
|
295
295
|
`);if(r.has(s))throw new de(`
|
|
@@ -331,7 +331,7 @@ ${s} detected in project's 'package.json'`),o}catch{g.info(`Invalid 'package.jso
|
|
|
331
331
|
`);if(S._compressed=/^(gzip|compress|deflate|br)$/.test(y.headers.get("content-encoding")||""),S.response.content||(S.response.content={size:-1}),S._compressed){let ue=await A.arrayBuffer();S.response.content.size=ue.byteLength}else S.response.content.size=O?Buffer.byteLength(O):-1;let U=O?Buffer.byteLength(O):-1;S.response={headers:An(y.headers),cookies:$u(y.headers),status:y.status,statusText:y.statusText||"",httpVersion:y.httpVersion?`HTTP/${y.httpVersion}`:"HTTP/1.1",redirectURL:y.headers.location||"",content:{size:S._compressed&&S.response.content.size!==-1?S.response.content.size:Buffer.byteLength(O),mimeType:y.headers.get("content-type")||"",text:O,compression:S._compressed&&S.response.content.size!==-1?S.response.content.size-U:0},bodySize:U,headersSize:$};let{_timestamps:L}=S;S.timings={blocked:Math.max(Yt(L.start,L.socket),.01),dns:-1,connect:Math.max(Yt(L.lookup,L.connect),-1),ssl:L.secureConnect?Math.max(Yt(L.connect,L.secureConnect),-1):-1,send:Yt(L.secureConnect||L.connect,L.sent),wait:Math.max(Yt(L.sent,L.firstByte),0),receive:Yt(L.firstByte,L.received)},S.time=Yt(L.start,L.received);let ne=[],Z=S;do{let ue=Z._parent;delete Z._parent,ue&&ne.unshift(ue),Z=ue}while(Z);return f.pageref=i||"page_1",ne.forEach(ue=>{ue.pageref=f.pageref}),y.harEntry=f,Array.isArray(s?.log?.entries)&&s.log.entries.push(...ne,f),a&&(ne.forEach(ue=>{a(ue)}),a(f)),y}};function _u(t){let e={};for(let r of t){let{executedWorkflows:n,globalTimeoutError:o,ctx:s,secretValues:i}=r;e[r.file]=pa({value:{totalRequests:r.totalRequests,executedWorkflows:n.map(a=>Iu(a)),totalTimeMs:r.totalTimeMs,globalTimeoutError:o,secretValues:i},noSecretsMasking:s.noSecretsMasking,secretsSet:s.secretsSet||new Set})}return e}function Iu(t){let{ctx:e,...r}=t,n=t.executedSteps.map(i=>lb(i,t.workflowId,e)),o=Wn([t]);return{...r,executedSteps:n,status:o.steps.failed>0?"error":o.steps.warnings>0?"warn":"success",totalRequests:o.totalRequests,totalTimeMs:t.totalTimeMs}}function lb(t,e,r){if("executedSteps"in t)return Iu(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:pb(o)})),totalTimeMs:n?.response?.time||0,retriesLeft:t.retriesLeft,status:ub(t.checks)}}function pb(t){return t.passed?"success":t.severity==="error"?"error":"warn"}function ub(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 Br from"node:fs";import*as ju from"node:path";function Tu(t={},e){let r={};for(let[n,o]of Object.entries(t))r[n]={clientCert:gi(o.clientCert,e),clientKey:gi(o.clientKey,e),caCert:gi(o.caCert,e)};return r}function gi(t,e){if(t)try{if(!(t.includes("-----BEGIN")&&t.includes("-----END"))){let n=ju.resolve(e,t);return Br.accessSync(n,Br.constants.R_OK),Br.readFileSync(n,"utf-8")}return fb(t)}catch(r){throw new Error(`Failed to read certificate: ${r.message}`)}}function fb(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(`
|
|
332
332
|
`)||"";return`${r}
|
|
333
333
|
${s}
|
|
334
|
-
${o}`}async function Du({argv:t,config:e,version:r,collectSpecData:n}){let o,s;try{let{run:i,conditionallyMaskSecrets:a}=await import("./chunks/OMNGRJM6.js"),c=e.configPath?hb(e.configPath):process.cwd();t.mtls&&(o=Tu(t.mtls,c));let l=hu(o);t["har-output"]&&(s=yu({version:r}),l=hi(l,{har:s}));let u=new et({http:{headers:e.resolve?.http?.headers??[],customFetch:l}}),p={files:t.files,input:t.input,server:t.server,workflow:t.workflow,skip:t.skip,verbose:t.verbose,config:e,version:r,collectSpecData:n,severity:t.severity,maxSteps:t["max-steps"],maxFetchTimeout:t["max-fetch-timeout"],executionTimeout:t["execution-timeout"],requestFileLoader:{getFileBody:async A=>{if(!mb(A))throw new Error(`File ${A} doesn't exist or isn't readable.`);let O=db(A);return new File([O],gb(A))}},envVariables:du(c)||{},logger:g,fetch:l,externalRefResolver:u,noSecretsMasking:t["no-secrets-masking"]};if(p.skip&&p.workflow)throw new Error("Cannot use both --skip and --workflow flags at the same time.");if(t["har-output"]&&!t["har-output"].endsWith(".har"))throw new Error("File for HAR logs should be in .har format");if(t["json-output"]&&!t["json-output"].endsWith(".json"))throw new Error("File for JSON logs should be in .json format");if(p.files.length>1&&t["har-output"])throw new Error("Currently only a single file can be run with --har-output. Please run a single file at a time.");let f=performance.now(),h=await i(p);g.printNewLine(),gu(h,g),g.printNewLine();let y=h.some(A=>A.hasProblems),d=h.some(A=>A.hasWarnings);if(t["json-output"]){let A={files:_u(h),status:y?"error":d?"warn":"success",totalTime:performance.now()-f};ku(t["json-output"],pi(A,2),"utf-8"),g.output(Q(g.indent(`JSON logs saved in ${me(t["json-output"])}`,2))),g.printNewLine(),g.printNewLine()}if(t["har-output"])for(let A of h){let O=a({value:s,noSecretsMasking:A.ctx.noSecretsMasking,secretsSet:A.ctx.secretsSet||new Set});ku(t["har-output"],pi(O,2),"utf-8"),g.output(Q(`Har logs saved in ${me(t["har-output"])}`)),g.printNewLine(),g.printNewLine()}if(y)throw new Error(" Tests exited with error ")}catch(i){throw new de(i?.message??i)}}function Lu(t){if(Array.isArray(t)){let e={};for(let r of t)if(r&&typeof r=="string"){let n=Nu(r);Object.assign(e,n)}return Object.keys(e).length>0?e:void 0}if(!(!t||typeof t!="string"))return Nu(t)}function Nu(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`);yi(n,"clientCert",r,!0),yi(n,"clientKey",r,!0),yi(n,"caCert",r,!1)}return e}catch(e){throw e instanceof SyntaxError?new Error(`Invalid JSON for --mtls option: ${e.message}`):e}}function yi(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 Db}from"perf_hooks";var Rt={thresholds:{maxParamsGood:5,maxDepthGood:4,maxPolymorphismGood:2,maxDependencyDepthGood:3,maxAmbiguousGood:0,maxOperationsForDiscoverability:1e3},weights:{parameterSimplicity:.1,schemaSimplicity:.1,documentationQuality:.18,constraintClarity:.12,exampleCoverage:.18,errorClarity:.12,dependencyClarity:.1,identifierClarity:.05,polymorphismClarity:.05,anyOfPenaltyMultiplier:2,discoverabilityWeight:.1},hotspotLimit:10},Mu=new Set(["id","name","type","value","data","key","status","state","code","result","item","object","resource","entity","input","output","payload","body","content","info"]);function _o(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 yb(t,e,r=Rt){let{thresholds:n,weights:o}=r,s=Et(1-t.parameterCount/(n.maxParamsGood*2)),a=Math.max(t.maxRequestSchemaDepth,t.maxResponseSchemaDepth)/(n.maxDepthGood*2),c=Fu(t,o.anyOfPenaltyMultiplier)/(n.maxPolymorphismGood*3),l=Et(1-a-c),u=(t.operationDescriptionPresent?1:0)+t.paramsWithDescription+t.schemaPropertiesWithDescription,p=1+t.parameterCount+t.totalSchemaProperties,f=p>0?Et(u/p):1,h=t.totalSchemaProperties>0?Et(t.constraintCount/t.totalSchemaProperties):1,y=(t.requestExamplePresent?1:0)+(t.responseExamplePresent?1:0),d=(t.requestBodyPresent?1:0)+1,A=Et(y/d),O=t.totalErrorResponses>0?Et(t.structuredErrorResponseCount/t.totalErrorResponses):1,S=Et(1-e/(n.maxDependencyDepthGood*2)),v=Et(1-t.ambiguousIdentifierCount/Math.max(n.maxAmbiguousGood+3,1)),x=Fu(t,o.anyOfPenaltyMultiplier),$=x===0?1:t.hasDiscriminator?Et(1-x/(n.maxPolymorphismGood*4)):Et(1-x/(n.maxPolymorphismGood*2));return{parameterSimplicity:s,schemaSimplicity:l,documentationQuality:f,constraintClarity:h,exampleCoverage:A,errorClarity:O,dependencyClarity:S,identifierClarity:v,polymorphismClarity:$}}function wb(t,e=Rt){let r=e.weights,n=t.parameterSimplicity*r.parameterSimplicity+t.schemaSimplicity*r.schemaSimplicity+t.documentationQuality*r.documentationQuality+t.constraintClarity*r.constraintClarity+t.exampleCoverage*r.exampleCoverage+t.errorClarity*r.errorClarity+t.dependencyClarity*r.dependencyClarity+t.identifierClarity*r.identifierClarity+t.polymorphismClarity*r.polymorphismClarity;return Gu(Et(n)*100)}function Uu(t,e,r=Rt){let n=new Map;for(let[o,s]of t.operations){let i=e.get(o)??0,a=yb(s,i,r);n.set(o,{agentReadiness:wb(a,r),subscores:a})}return n}function qu(t,e=Rt){return Et(1-t/e.thresholds.maxOperationsForDiscoverability)}function Wu(t,e,r=Rt){if(t.size===0)return{agentReadiness:100};let n=[];for(let i of t.values())n.push(i.agentReadiness);let o=r.weights.discoverabilityWeight,s=e*100;return{agentReadiness:Gu(_o(n)*(1-o)+s*o)}}function wi(t,e,r){return t-e+e*r}function Fu(t,e){return wi(t.polymorphismCount,t.anyOfCount,e)}function Et(t){return Math.max(0,Math.min(1,t))}function zu(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 Gu(t){return Math.round(t*10)/10}function Vu(t,e,r){let n=Math.max(1,t);return e/n+r/n}function bb(t,e){return e.totalSchemaProperties>t.totalSchemaProperties?!0:e.totalSchemaProperties<t.totalSchemaProperties?!1:Vu(e.totalSchemaProperties,e.schemaPropertiesWithDescription,e.constraintCount)>Vu(t.totalSchemaProperties,t.schemaPropertiesWithDescription,t.constraintCount)}var Sb=["enum","const","format","pattern","minimum","maximum","minLength","maxLength","minItems","maxItems","minProperties","maxProperties","multipleOf","exclusiveMinimum","exclusiveMaximum","uniqueItems"];function bi(){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 Yu(t){Object.assign(t,bi())}function Ku(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 Sb)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 Ju(t,e,r){return{operations:new Map,currentPath:"",pathLevelParams:[],current:null,walkSchema:t,anyOfPenaltyMultiplier:e,debugOperationId:r,debugLogs:[]}}function Eb(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 Ab(t){let{inRequestBody:e,inResponse:r,currentResponseCode:n,errorStructuredCounted:o,maxEffectivePolymorphism:s,...i}=t;return i}function Xu(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,Hu(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&&(xb(e)&&(r.inRequestBody&&(r.requestExamplePresent=!0),r.inResponse&&(r.responseExamplePresent=!0)),r.inResponse&&Hu(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);bb(r,o)&&(r.totalSchemaProperties=o.totalSchemaProperties,r.schemaPropertiesWithDescription=o.schemaPropertiesWithDescription,r.constraintCount=o.constraintCount);let s=wi(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=Eb(t.currentPath,n,e);t.current=o;let s=Ob(t.pathLevelParams,e.parameters??[],r.resolve);for(let i of s.values())o.parameterCount++,i.required&&o.requiredParameterCount++,i.description&&o.paramsWithDescription++,Cb(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,Ab(r)),t.current=null}}}}}}function Zu(t){return{operationCount:t.operations.size,operations:t.operations}}function Bu(t,e){return e(t).node}function Ob(t,e,r){let n=new Map;for(let o of t){let s=Bu(o,r);s?.name&&s.in&&n.set(`${s.in}:${s.name}`,s)}for(let o of e){let s=Bu(o,r);s?.name&&s.in&&n.set(`${s.in}:${s.name}`,s)}return n}function xb(t){return t.example!==void 0||Ii(t.examples)}function Cb(t){if(t.description)return!1;let e=(t.name??"").toLowerCase();return Mu.has(e)}function Hu(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 vb(t,e){if(!e.startsWith("#/"))return;let r=t;for(let n of e.slice(2).split("/"))r=r?.[Di(n)];return r}function Qu({document:t,types:e,resolvedRefMap:r,ctx:n,debugOperationId:o,scoringConstants:s}){let i=s?.weights.anyOfPenaltyMultiplier??Rt.weights.anyOfPenaltyMultiplier,a=bi(),c=Ku(a),l=Qt([{severity:"warn",ruleId:"score-schema",visitor:c}],e),u=(v,x)=>{Yu(a),x&&(a.debugEntries=[]),er({document:{...t,parsed:v},rootType:e.Schema,normalizedVisitors:l,resolvedRefMap:r,ctx:n});let{depth:$,pendingRef:U,debugEntries:L,...ne}=a;return{...ne,refsUsed:[...a.refsUsed],debugEntries:x?a.debugEntries??void 0:void 0}},p=new Map,f=new WeakSet,h={maxDepth:0,polymorphismCount:0,anyOfCount:0,hasDiscriminator:!1,totalSchemaProperties:0,schemaPropertiesWithDescription:0,constraintCount:0,hasPropertyExamples:!1,writableTopLevelFields:0,refsUsed:[]};function y(v,x){return{maxDepth:Math.max(v.maxDepth,x.maxDepth),polymorphismCount:v.polymorphismCount+x.polymorphismCount,anyOfCount:v.anyOfCount+x.anyOfCount,hasDiscriminator:v.hasDiscriminator||x.hasDiscriminator,totalSchemaProperties:v.totalSchemaProperties+x.totalSchemaProperties,schemaPropertiesWithDescription:v.schemaPropertiesWithDescription+x.schemaPropertiesWithDescription,constraintCount:v.constraintCount+x.constraintCount,hasPropertyExamples:v.hasPropertyExamples||x.hasPropertyExamples,writableTopLevelFields:v.writableTopLevelFields+x.writableTopLevelFields,refsUsed:[...v.refsUsed,...x.refsUsed],debugEntries:v.debugEntries||x.debugEntries?[...v.debugEntries??[],...x.debugEntries??[]]:void 0}}let d=(v,x=!1)=>{let $=v,U=Ne(v)?v.$ref:void 0;if(U){if(!x){let K=p.get(U);if(K)return K}$=vb(t.parsed,U)??v}if(I($)&&f.has($))return{...h};I($)&&f.add($);let L=$?.oneOf,ne=$?.anyOf,Z=Array.isArray(L)&&L.length>1,ue=Array.isArray(ne)&&ne.length>1,R=Z||ue,P=Array.isArray($?.allOf)&&$.allOf.length>0,M=$?.discriminator,W=!R&&I(M?.mapping)?Object.values(M.mapping).filter(K=>typeof K=="string"&&Ni(K)).map(K=>({$ref:K})):null,se=Array.isArray(W)&&W.length>0,re;if(R||P||se){let K={...$},le=null,ke=_e=>{le=le?y(le,_e):_e},pe=(_e,lt)=>{let q=d(lt[0],x);for(let ce=1;ce<lt.length;ce++){let ie=d(lt[ce],x);ie.totalSchemaProperties>q.totalSchemaProperties&&(q=ie)}return{...q,polymorphismCount:q.polymorphismCount+lt.length,anyOfCount:q.anyOfCount+(_e==="anyOf"?lt.length:0),hasDiscriminator:q.hasDiscriminator||!!M}};R&&delete K.discriminator,Z&&(delete K.oneOf,ke(pe("oneOf",L))),ue&&(delete K.anyOf,ke(pe("anyOf",ne)));let Qe=null;if(se){delete K.discriminator;let _e=d(W[0],x);for(let lt=1;lt<W.length;lt++){let q=d(W[lt],x);q.totalSchemaProperties>_e.totalSchemaProperties&&(_e=q)}Qe={..._e,polymorphismCount:_e.polymorphismCount+W.length,hasDiscriminator:!0}}let ct=null;if(P){delete K.allOf,ct={...h};for(let _e of $.allOf)ct=y(ct,d(_e,x));ct.polymorphismCount+=$.allOf.length}re=u(K,x),ct&&(re=y(re,ct)),le&&(re=y(re,le)),Qe&&(re=y(re,Qe)),U&&(re={...re,refsUsed:[U,...re.refsUsed]})}else re=u(v,x);return I($)&&f.delete($),U&&!x&&p.set(U,re),re},A=Ju(d,i,o),O=Xu(A),S=Qt([{severity:"warn",ruleId:"score",visitor:O}],e);return er({document:t,rootType:e.Root,normalizedVisitors:S,resolvedRefMap:r,ctx:n}),{metrics:Zu(A),debugLogs:A.debugLogs}}function ef(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=Pb(o,r);n.set(o,s)}return n}function Pb(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 tf(t){let e={agentReadiness:t.agentReadiness,discoverability:Math.round(t.discoverability*100),subscores:t.subscores,rawMetrics:{operationCount:t.rawMetrics.operationCount,operations:Object.fromEntries(Array.from(t.rawMetrics.operations.entries()).map(([r,n])=>{let{refsUsed:o,...s}=n;return[r,s]}))},operationScores:Object.fromEntries(t.operationScores),dependencyDepths:Object.fromEntries(t.dependencyDepths),hotspots:t.hotspots};g.output(JSON.stringify(e,null,2))}function rf(t,e=!1){$b(t),Rb(t),Ib(t),e&&jb(t),Tb(t)}function nf(t){return t>=80?me:t>=50?te:qe}function of(t){return nf(t)(Ee(t.toFixed(1)))}function Y(t){g.output(t+`
|
|
334
|
+
${o}`}async function Du({argv:t,config:e,version:r,collectSpecData:n}){let o,s;try{let{run:i,conditionallyMaskSecrets:a}=await import("./chunks/ANMFTH7J.js"),c=e.configPath?hb(e.configPath):process.cwd();t.mtls&&(o=Tu(t.mtls,c));let l=hu(o);t["har-output"]&&(s=yu({version:r}),l=hi(l,{har:s}));let u=new et({http:{headers:e.resolve?.http?.headers??[],customFetch:l}}),p={files:t.files,input:t.input,server:t.server,workflow:t.workflow,skip:t.skip,verbose:t.verbose,config:e,version:r,collectSpecData:n,severity:t.severity,maxSteps:t["max-steps"],maxFetchTimeout:t["max-fetch-timeout"],executionTimeout:t["execution-timeout"],requestFileLoader:{getFileBody:async A=>{if(!mb(A))throw new Error(`File ${A} doesn't exist or isn't readable.`);let O=db(A);return new File([O],gb(A))}},envVariables:du(c)||{},logger:g,fetch:l,externalRefResolver:u,noSecretsMasking:t["no-secrets-masking"]};if(p.skip&&p.workflow)throw new Error("Cannot use both --skip and --workflow flags at the same time.");if(t["har-output"]&&!t["har-output"].endsWith(".har"))throw new Error("File for HAR logs should be in .har format");if(t["json-output"]&&!t["json-output"].endsWith(".json"))throw new Error("File for JSON logs should be in .json format");if(p.files.length>1&&t["har-output"])throw new Error("Currently only a single file can be run with --har-output. Please run a single file at a time.");let f=performance.now(),h=await i(p);g.printNewLine(),gu(h,g),g.printNewLine();let y=h.some(A=>A.hasProblems),d=h.some(A=>A.hasWarnings);if(t["json-output"]){let A={files:_u(h),status:y?"error":d?"warn":"success",totalTime:performance.now()-f};ku(t["json-output"],pi(A,2),"utf-8"),g.output(Q(g.indent(`JSON logs saved in ${me(t["json-output"])}`,2))),g.printNewLine(),g.printNewLine()}if(t["har-output"])for(let A of h){let O=a({value:s,noSecretsMasking:A.ctx.noSecretsMasking,secretsSet:A.ctx.secretsSet||new Set});ku(t["har-output"],pi(O,2),"utf-8"),g.output(Q(`Har logs saved in ${me(t["har-output"])}`)),g.printNewLine(),g.printNewLine()}if(y)throw new Error(" Tests exited with error ")}catch(i){throw new de(i?.message??i)}}function Lu(t){if(Array.isArray(t)){let e={};for(let r of t)if(r&&typeof r=="string"){let n=Nu(r);Object.assign(e,n)}return Object.keys(e).length>0?e:void 0}if(!(!t||typeof t!="string"))return Nu(t)}function Nu(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`);yi(n,"clientCert",r,!0),yi(n,"clientKey",r,!0),yi(n,"caCert",r,!1)}return e}catch(e){throw e instanceof SyntaxError?new Error(`Invalid JSON for --mtls option: ${e.message}`):e}}function yi(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 Db}from"perf_hooks";var Rt={thresholds:{maxParamsGood:5,maxDepthGood:4,maxPolymorphismGood:2,maxDependencyDepthGood:3,maxAmbiguousGood:0,maxOperationsForDiscoverability:1e3},weights:{parameterSimplicity:.1,schemaSimplicity:.1,documentationQuality:.18,constraintClarity:.12,exampleCoverage:.18,errorClarity:.12,dependencyClarity:.1,identifierClarity:.05,polymorphismClarity:.05,anyOfPenaltyMultiplier:2,discoverabilityWeight:.1},hotspotLimit:10},Mu=new Set(["id","name","type","value","data","key","status","state","code","result","item","object","resource","entity","input","output","payload","body","content","info"]);function _o(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 yb(t,e,r=Rt){let{thresholds:n,weights:o}=r,s=Et(1-t.parameterCount/(n.maxParamsGood*2)),a=Math.max(t.maxRequestSchemaDepth,t.maxResponseSchemaDepth)/(n.maxDepthGood*2),c=Fu(t,o.anyOfPenaltyMultiplier)/(n.maxPolymorphismGood*3),l=Et(1-a-c),u=(t.operationDescriptionPresent?1:0)+t.paramsWithDescription+t.schemaPropertiesWithDescription,p=1+t.parameterCount+t.totalSchemaProperties,f=p>0?Et(u/p):1,h=t.totalSchemaProperties>0?Et(t.constraintCount/t.totalSchemaProperties):1,y=(t.requestExamplePresent?1:0)+(t.responseExamplePresent?1:0),d=(t.requestBodyPresent?1:0)+1,A=Et(y/d),O=t.totalErrorResponses>0?Et(t.structuredErrorResponseCount/t.totalErrorResponses):1,S=Et(1-e/(n.maxDependencyDepthGood*2)),v=Et(1-t.ambiguousIdentifierCount/Math.max(n.maxAmbiguousGood+3,1)),x=Fu(t,o.anyOfPenaltyMultiplier),$=x===0?1:t.hasDiscriminator?Et(1-x/(n.maxPolymorphismGood*4)):Et(1-x/(n.maxPolymorphismGood*2));return{parameterSimplicity:s,schemaSimplicity:l,documentationQuality:f,constraintClarity:h,exampleCoverage:A,errorClarity:O,dependencyClarity:S,identifierClarity:v,polymorphismClarity:$}}function wb(t,e=Rt){let r=e.weights,n=t.parameterSimplicity*r.parameterSimplicity+t.schemaSimplicity*r.schemaSimplicity+t.documentationQuality*r.documentationQuality+t.constraintClarity*r.constraintClarity+t.exampleCoverage*r.exampleCoverage+t.errorClarity*r.errorClarity+t.dependencyClarity*r.dependencyClarity+t.identifierClarity*r.identifierClarity+t.polymorphismClarity*r.polymorphismClarity;return Gu(Et(n)*100)}function Uu(t,e,r=Rt){let n=new Map;for(let[o,s]of t.operations){let i=e.get(o)??0,a=yb(s,i,r);n.set(o,{agentReadiness:wb(a,r),subscores:a})}return n}function qu(t,e=Rt){return Et(1-t/e.thresholds.maxOperationsForDiscoverability)}function Wu(t,e,r=Rt){if(t.size===0)return{agentReadiness:100};let n=[];for(let i of t.values())n.push(i.agentReadiness);let o=r.weights.discoverabilityWeight,s=e*100;return{agentReadiness:Gu(_o(n)*(1-o)+s*o)}}function wi(t,e,r){return t-e+e*r}function Fu(t,e){return wi(t.polymorphismCount,t.anyOfCount,e)}function Et(t){return Math.max(0,Math.min(1,t))}function zu(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 Gu(t){return Math.round(t*10)/10}function Vu(t,e,r){let n=Math.max(1,t);return e/n+r/n}function bb(t,e){return e.totalSchemaProperties>t.totalSchemaProperties?!0:e.totalSchemaProperties<t.totalSchemaProperties?!1:Vu(e.totalSchemaProperties,e.schemaPropertiesWithDescription,e.constraintCount)>Vu(t.totalSchemaProperties,t.schemaPropertiesWithDescription,t.constraintCount)}var Sb=["enum","const","format","pattern","minimum","maximum","minLength","maxLength","minItems","maxItems","minProperties","maxProperties","multipleOf","exclusiveMinimum","exclusiveMaximum","uniqueItems"];function bi(){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 Yu(t){Object.assign(t,bi())}function Ku(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 Sb)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 Ju(t,e,r){return{operations:new Map,currentPath:"",pathLevelParams:[],current:null,walkSchema:t,anyOfPenaltyMultiplier:e,debugOperationId:r,debugLogs:[]}}function Eb(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 Ab(t){let{inRequestBody:e,inResponse:r,currentResponseCode:n,errorStructuredCounted:o,maxEffectivePolymorphism:s,...i}=t;return i}function Xu(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,Hu(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&&(xb(e)&&(r.inRequestBody&&(r.requestExamplePresent=!0),r.inResponse&&(r.responseExamplePresent=!0)),r.inResponse&&Hu(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);bb(r,o)&&(r.totalSchemaProperties=o.totalSchemaProperties,r.schemaPropertiesWithDescription=o.schemaPropertiesWithDescription,r.constraintCount=o.constraintCount);let s=wi(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=Eb(t.currentPath,n,e);t.current=o;let s=Ob(t.pathLevelParams,e.parameters??[],r.resolve);for(let i of s.values())o.parameterCount++,i.required&&o.requiredParameterCount++,i.description&&o.paramsWithDescription++,Cb(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,Ab(r)),t.current=null}}}}}}function Zu(t){return{operationCount:t.operations.size,operations:t.operations}}function Bu(t,e){return e(t).node}function Ob(t,e,r){let n=new Map;for(let o of t){let s=Bu(o,r);s?.name&&s.in&&n.set(`${s.in}:${s.name}`,s)}for(let o of e){let s=Bu(o,r);s?.name&&s.in&&n.set(`${s.in}:${s.name}`,s)}return n}function xb(t){return t.example!==void 0||Ii(t.examples)}function Cb(t){if(t.description)return!1;let e=(t.name??"").toLowerCase();return Mu.has(e)}function Hu(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 vb(t,e){if(!e.startsWith("#/"))return;let r=t;for(let n of e.slice(2).split("/"))r=r?.[Di(n)];return r}function Qu({document:t,types:e,resolvedRefMap:r,ctx:n,debugOperationId:o,scoringConstants:s}){let i=s?.weights.anyOfPenaltyMultiplier??Rt.weights.anyOfPenaltyMultiplier,a=bi(),c=Ku(a),l=Qt([{severity:"warn",ruleId:"score-schema",visitor:c}],e),u=(v,x)=>{Yu(a),x&&(a.debugEntries=[]),er({document:{...t,parsed:v},rootType:e.Schema,normalizedVisitors:l,resolvedRefMap:r,ctx:n});let{depth:$,pendingRef:U,debugEntries:L,...ne}=a;return{...ne,refsUsed:[...a.refsUsed],debugEntries:x?a.debugEntries??void 0:void 0}},p=new Map,f=new WeakSet,h={maxDepth:0,polymorphismCount:0,anyOfCount:0,hasDiscriminator:!1,totalSchemaProperties:0,schemaPropertiesWithDescription:0,constraintCount:0,hasPropertyExamples:!1,writableTopLevelFields:0,refsUsed:[]};function y(v,x){return{maxDepth:Math.max(v.maxDepth,x.maxDepth),polymorphismCount:v.polymorphismCount+x.polymorphismCount,anyOfCount:v.anyOfCount+x.anyOfCount,hasDiscriminator:v.hasDiscriminator||x.hasDiscriminator,totalSchemaProperties:v.totalSchemaProperties+x.totalSchemaProperties,schemaPropertiesWithDescription:v.schemaPropertiesWithDescription+x.schemaPropertiesWithDescription,constraintCount:v.constraintCount+x.constraintCount,hasPropertyExamples:v.hasPropertyExamples||x.hasPropertyExamples,writableTopLevelFields:v.writableTopLevelFields+x.writableTopLevelFields,refsUsed:[...v.refsUsed,...x.refsUsed],debugEntries:v.debugEntries||x.debugEntries?[...v.debugEntries??[],...x.debugEntries??[]]:void 0}}let d=(v,x=!1)=>{let $=v,U=Ne(v)?v.$ref:void 0;if(U){if(!x){let K=p.get(U);if(K)return K}$=vb(t.parsed,U)??v}if(I($)&&f.has($))return{...h};I($)&&f.add($);let L=$?.oneOf,ne=$?.anyOf,Z=Array.isArray(L)&&L.length>1,ue=Array.isArray(ne)&&ne.length>1,R=Z||ue,P=Array.isArray($?.allOf)&&$.allOf.length>0,M=$?.discriminator,W=!R&&I(M?.mapping)?Object.values(M.mapping).filter(K=>typeof K=="string"&&Ni(K)).map(K=>({$ref:K})):null,se=Array.isArray(W)&&W.length>0,re;if(R||P||se){let K={...$},le=null,ke=_e=>{le=le?y(le,_e):_e},pe=(_e,lt)=>{let q=d(lt[0],x);for(let ce=1;ce<lt.length;ce++){let ie=d(lt[ce],x);ie.totalSchemaProperties>q.totalSchemaProperties&&(q=ie)}return{...q,polymorphismCount:q.polymorphismCount+lt.length,anyOfCount:q.anyOfCount+(_e==="anyOf"?lt.length:0),hasDiscriminator:q.hasDiscriminator||!!M}};R&&delete K.discriminator,Z&&(delete K.oneOf,ke(pe("oneOf",L))),ue&&(delete K.anyOf,ke(pe("anyOf",ne)));let Qe=null;if(se){delete K.discriminator;let _e=d(W[0],x);for(let lt=1;lt<W.length;lt++){let q=d(W[lt],x);q.totalSchemaProperties>_e.totalSchemaProperties&&(_e=q)}Qe={..._e,polymorphismCount:_e.polymorphismCount+W.length,hasDiscriminator:!0}}let ct=null;if(P){delete K.allOf,ct={...h};for(let _e of $.allOf)ct=y(ct,d(_e,x));ct.polymorphismCount+=$.allOf.length}re=u(K,x),ct&&(re=y(re,ct)),le&&(re=y(re,le)),Qe&&(re=y(re,Qe)),U&&(re={...re,refsUsed:[U,...re.refsUsed]})}else re=u(v,x);return I($)&&f.delete($),U&&!x&&p.set(U,re),re},A=Ju(d,i,o),O=Xu(A),S=Qt([{severity:"warn",ruleId:"score",visitor:O}],e);return er({document:t,rootType:e.Root,normalizedVisitors:S,resolvedRefMap:r,ctx:n}),{metrics:Zu(A),debugLogs:A.debugLogs}}function ef(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=Pb(o,r);n.set(o,s)}return n}function Pb(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 tf(t){let e={agentReadiness:t.agentReadiness,discoverability:Math.round(t.discoverability*100),subscores:t.subscores,rawMetrics:{operationCount:t.rawMetrics.operationCount,operations:Object.fromEntries(Array.from(t.rawMetrics.operations.entries()).map(([r,n])=>{let{refsUsed:o,...s}=n;return[r,s]}))},operationScores:Object.fromEntries(t.operationScores),dependencyDepths:Object.fromEntries(t.dependencyDepths),hotspots:t.hotspots};g.output(JSON.stringify(e,null,2))}function rf(t,e=!1){$b(t),Rb(t),Ib(t),e&&jb(t),Tb(t)}function nf(t){return t>=80?me:t>=50?te:qe}function of(t){return nf(t)(Ee(t.toFixed(1)))}function Y(t){g.output(t+`
|
|
335
335
|
`)}function $b(t){Y(""),Y(Ee(Ge(" Scores"))),Y(""),Y(` Agent Readiness: ${of(t.agentReadiness)}/100`),Y("")}function Rb(t){Y(Ee(Ge(" Subscores"))),Y("");let e=t.subscores;_t("Parameter Simplicity",e.parameterSimplicity),_t("Schema Simplicity",e.schemaSimplicity),_t("Documentation Quality",e.documentationQuality),_t("Constraint Clarity",e.constraintClarity),_t("Example Coverage",e.exampleCoverage),_t("Error Clarity",e.errorClarity),_t("Dependency Clarity",e.dependencyClarity),_t("Identifier Clarity",e.identifierClarity),_t("Polymorphism Clarity",e.polymorphismClarity),_t("Discoverability",t.discoverability),Y("")}function _t(t,e){let r=Math.round(e*100),n=_b(e);Y(` ${t.padEnd(24)} ${n} ${nf(r)(r+"%")}`)}function _b(t){let r=Math.round(t*20);return be("["+"\u2588".repeat(r)+"\u2591".repeat(20-r)+"]")}function Ib(t){if(Y(Ee(Ge(" Raw Metrics Summary"))),Y(""),Y(` Total operations: ${t.rawMetrics.operationCount}`),t.rawMetrics.operationCount===0){Y("");return}let e=[],r=[],n=[],o=[],s=0,i=0,a=0;for(let u of t.rawMetrics.operations.values())e.push(u.parameterCount),r.push(Math.max(u.maxRequestSchemaDepth,u.maxResponseSchemaDepth)),n.push(u.polymorphismCount),o.push(u.totalSchemaProperties),u.requestExamplePresent&&s++,u.responseExamplePresent&&i++,u.operationDescriptionPresent&&a++;let c=t.rawMetrics.operationCount;function l(u,p){let h=(p.reduce((O,S)=>O+S,0)/c).toFixed(1),y=_o(p).toFixed(1),d=Math.min(...p),A=Math.max(...p);Y(` ${u.padEnd(26)} avg ${h.padStart(6)} median ${y.padStart(6)} min ${String(d).padStart(5)} max ${String(A).padStart(5)}`)}l("Parameters/operation:",e),l("Schema depth:",r),l("Polymorphism/operation:",n),l("Properties/operation:",o),Y(` Operations with request examples: ${s}/${c} (${Si(s,c)})`),Y(` Operations with response examples: ${i}/${c} (${Si(i,c)})`),Y(` Operations with description: ${a}/${c} (${Si(a,c)})`),Y("")}function Si(t,e){return e>0?`${Math.round(t/e*100)}%`:"N/A"}function jb(t){Y(Ee(Ge(" Per-Operation Metrics"))),Y("");let e=" "+"Operation".padEnd(50)+"Props".padStart(7)+"Poly".padStart(7)+"Depth".padStart(7)+"Params".padStart(8)+"Constr".padStart(8);Y(be(e)),Y(be(" "+"\u2500".repeat(e.length-2)));let r=[...t.rawMetrics.operations.entries()].sort(([,n],[,o])=>o.totalSchemaProperties-n.totalSchemaProperties);for(let[,n]of r){let o=(n.operationId??`${n.method.toUpperCase()} ${n.path}`).slice(0,48),s=Math.max(n.maxRequestSchemaDepth,n.maxResponseSchemaDepth),i=" "+o.padEnd(50)+String(n.totalSchemaProperties).padStart(7)+String(n.polymorphismCount).padStart(7)+String(s).padStart(7)+String(n.parameterCount).padStart(8)+String(n.constraintCount).padStart(8);Y(i)}Y("")}function sf(t,e){if(Y(""),Y(Ee(Ge(` Debug: ${t} schema breakdown`))),Y(""),e.length===0){Y(te(` No schemas found for operation "${t}".`)),Y(te(' Make sure the value matches an operationId or "METHOD /path" exactly.')),Y("");return}for(let r of e){Y(Ee(be(` ${r.context}`))),Y(be(" "+"\u2500".repeat(70)));let n=new Map;for(let s of r.entries){let i=s.ref??`(inline depth ${s.depth})`,a=n.get(i);if(a){a.count++,a.totalProps+=s.propertyNames.length;for(let c of s.propertyNames)a.propNames.includes(c)||a.propNames.push(c)}else n.set(i,{count:1,totalProps:s.propertyNames.length,propNames:[...s.propertyNames]})}for(let s of r.entries){let i=s.ref??"(inline)",a=" ".repeat(Math.min(s.depth,6)),c=s.propertyNames.length,l=` ${a}${i}`;c>0&&(l+=` (${c} properties)`);let u=[];if(s.polymorphism.oneOf&&u.push(`oneOf:${s.polymorphism.oneOf}`),s.polymorphism.anyOf&&u.push(`anyOf:${s.polymorphism.anyOf}`),s.polymorphism.allOf&&u.push(`allOf:${s.polymorphism.allOf}`),u.length>0&&(l+=` [${u.join(", ")}]`),s.constraintCount>0&&(l+=` {${s.constraintCount} constraints}`),Y(l),c>0&&c<=20)Y(` ${a} properties: ${s.propertyNames.join(", ")}`);else if(c>20){let p=s.propertyNames.slice(0,15).join(", ");Y(` ${a} properties: ${p}, ... +${c-15} more`)}}Y(""),Y(` Totals: ${r.totalProperties} properties, ${r.totalPolymorphism} polymorphism items, ${r.totalConstraints} constraints, max depth ${r.maxDepth}`);let o=[...n.entries()].filter(([,s])=>s.totalProps>0).sort(([,s],[,i])=>i.totalProps-s.totalProps).slice(0,10);if(o.length>0){Y(""),Y(Ee(" Top schemas by property count:"));for(let[s,i]of o)Y(` ${s}: ${i.totalProps} properties`)}Y("")}}function Tb(t){if(t.hotspots.length===0){Y(Ee(Ge(" No hotspot operations found."))),Y("");return}Y(Ee(Ge(` Top ${t.hotspots.length} Hotspot Operations`))),Y("");for(let e of t.hotspots){let r=e.operationId?`${e.method.toUpperCase()} ${e.path} (${e.operationId})`:`${e.method.toUpperCase()} ${e.path}`;Y(Ee(` ${r}`)),Y(` Agent Readiness: ${of(e.agentReadinessScore)}`);for(let n of e.reasons)Y(te(` - ${n}`));Y("")}}function af(t,e,r,n=Rt){let o=[];for(let[s,i]of e){let a=t.operations.get(s);if(!a)continue;let c=kb(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 kb(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 cf({argv:t,config:e,collectSpecData:r}){let[{path:n}]=await Je(t.api?[t.api]:[],e),o=new et(e.resolve),{bundle:s}=await $r({config:e,ref:n});r?.(s);let i=tt(s.parsed);if(Pr(i)!=="oas3")return G(`The score command currently supports only OpenAPI 3.x. Detected: ${i}`);let a=Db.now(),c=Cr(e.extendTypes(Mt(i),i),e),l=await vr({rootDocument:s,rootType:c.Root,externalRefResolver:o}),u=t["debug-operation-id"],{metrics:p,debugLogs:f}=Qu({document:s,types:c,resolvedRefMap:l,ctx:{problems:[],specVersion:i,config:e,visitorsData:{}},debugOperationId:u}),h=ef(p.operations),y=Uu(p,h),d=qu(p.operationCount),{agentReadiness:A}=Wu(y,d),O=af(p,y,h),S={agentReadiness:A,discoverability:d,subscores:zu(y),rawMetrics:p,hotspots:O,operationScores:y,dependencyDepths:h};Nb(S,n,a,t.format,!!t["operation-details"],u?{operationId:u,logs:f}:void 0)}function Nb(t,e,r,n,o,s){g.info(`Document: ${ut(e)} score:
|
|
336
336
|
`),n==="json"?tf(t):rf(t,o),s&&sf(s.operationId,s.logs),rt("score",r,e)}async function lf(t,e=!1){let r=Rr(t,t.resolvedConfig?.residency),n=new on,o=await n.getAccessToken(r);if(o)return e&&g.info(`Using existing access token.
|
|
337
337
|
`),o;e&&g.warn(`No valid access token found or refresh token expired. Attempting login...
|
|
@@ -469,12 +469,12 @@ ${ut(`${an(r)} URL`)}: ${be(e||"No URL yet.")}`;default:{let o=`${te(`No status
|
|
|
469
469
|
`),await qo({argv:{organization:o,project:s,pushId:$,wait:!0,domain:c,"max-execution-time":h,"start-time":n,"continue-on-deploy-failures":t["continue-on-deploy-failures"]},config:e,version:ft})),a&&rt(O,r,`${De("file",A.length)} uploaded to organization ${o}, project ${s}. Push ID: ${$}.`),S.reportSunsetWarnings(),{pushId:$}}catch(l){Uo("\u2717 File upload failed.",l)}}function nS(t){if(!/^.+\s<[^<>]+>$/.test(t))throw new Error('Invalid author format. Use "Author Name <author@email.com>"');let[r,n]=t.split("<");return{name:r.trim(),email:n.replace(">","").trim()}}function oS(t){let e={};for(let n of t)if(xr.statSync(n).isDirectory()){let o=n;im(o,[]).forEach(i=>r(i,o))}else r(n,Xt.dirname(n));function r(n,o){let s=Xt.relative(o,n);e[s]&&g.warn(`File ${e[s]} is overwritten by ${n}
|
|
470
470
|
`),e[s]=n}return Object.entries(e).map(([n,o])=>sS(n,o))}function sS(t,e){return{name:t,path:Xt.resolve(e)}}function im(t,e){let r=xr.readdirSync(t);for(let n of r){let o=Xt.join(t,n);xr.statSync(o).isDirectory()?e=im(o,e):e.push(o)}return e}var am=It(to(),1);import{existsSync as iS,writeFileSync as aS,readFileSync as cS,statSync as lS}from"node:fs";import{tmpdir as xi}from"node:os";import{join as Ci}from"node:path";import*as Pn from"node:process";var vi="redocly-cli-version",Wo=4,pS=1e3*60*60*12,cm=Pn.env.NODE_ENV==="test"||Pn.env.CI||!!Pn.env.LAMBDA_TASK_ROOT||Pn.env.REDOCLY_SUPPRESS_UPDATE_NOTICE==="true",lm=()=>{if(!cm)try{let t=cS(Ci(xi(),vi)).toString();uS(ft,t)&&mS(ft,t)}catch{return}},uS=(t,e)=>(0,am.compare)(t,e)<0,fS=async t=>{let e=`http://registry.npmjs.org/${t}/latest`;try{return(await(await kn(e,{timeout:Tn})).json()).version}catch{return}},pm=()=>{!hS()||cm||fS(Gi).then(t=>{if(t){let e=Ci(xi(),vi);aS(e,t)}}).catch(()=>{})},mS=(t,e)=>{let r=[`A new version of ${be("Redocly CLI")} (${me(e)}) is available.`,`Update now: \`${be("npm i -g @redocly/cli@latest")}\`.`,"Changelog: https://redocly.com/docs/cli/changelog/"],n=Math.max(...r.map(a=>Ko(a).length)),o=te("\u2550".repeat(n+Wo)),s=" ".repeat(Wo),i=["",s+te("\u2554"+o+"\u2557"),s+te("\u2551"+" ".repeat(n+Wo)+"\u2551"),r.map(dS(n,s)).join(`
|
|
471
471
|
`),s+te("\u2551"+" ".repeat(n+Wo)+"\u2551"),s+te("\u255A"+o+"\u255D"),"",""].join(`
|
|
472
|
-
`);g.info(i)},dS=(t,e)=>r=>{let n=" ".repeat(t-Ko(r).length);return`${e}${te("\u2551")} ${r}${n} ${te("\u2551")}`},hS=()=>{try{let t=Ci(xi(),vi);if(!iS(t))return!0;let e=new Date().getTime(),n=lS(t).mtime.getTime();return e-n>=pS}catch{return!1}};function um(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 Zt(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 gS}from"node:child_process";import*as tn from"node:fs";import{existsSync as yS,writeFileSync as wS,readFileSync as bS}from"node:fs";import*as mm from"node:os";import{tmpdir as dm}from"node:os";import{join as hm}from"node:path";async function fm(t=Tn){try{return await kn(Bi,{timeout:t}),!0}catch{return!1}}var zo="***";async function gm({config:t,argv:e,exit_code:r,execution_time:n,spec_version:o,spec_keyword:s,spec_full_version:i,respect_x_security_auth_types:a,respect_source_description_types:c,respect_criterion_object_types:l,lint_rules_with_errors:u,lint_rules_with_warnings:p,lint_rules_with_ignored_problems:f,generate_client:h,eject_generator:y}){try{if(!e||!await fm(1e3))return;let{_:[A],$0:O,...S}=e,{RedoclyOAuthClient:v}=await import("./chunks/
|
|
472
|
+
`);g.info(i)},dS=(t,e)=>r=>{let n=" ".repeat(t-Ko(r).length);return`${e}${te("\u2551")} ${r}${n} ${te("\u2551")}`},hS=()=>{try{let t=Ci(xi(),vi);if(!iS(t))return!0;let e=new Date().getTime(),n=lS(t).mtime.getTime();return e-n>=pS}catch{return!1}};function um(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 Zt(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 gS}from"node:child_process";import*as tn from"node:fs";import{existsSync as yS,writeFileSync as wS,readFileSync as bS}from"node:fs";import*as mm from"node:os";import{tmpdir as dm}from"node:os";import{join as hm}from"node:path";async function fm(t=Tn){try{return await kn(Bi,{timeout:t}),!0}catch{return!1}}var zo="***";async function gm({config:t,argv:e,exit_code:r,execution_time:n,spec_version:o,spec_keyword:s,spec_full_version:i,respect_x_security_auth_types:a,respect_source_description_types:c,respect_criterion_object_types:l,lint_rules_with_errors:u,lint_rules_with_warnings:p,lint_rules_with_ignored_problems:f,generate_client:h,eject_generator:y}){try{if(!e||!await fm(1e3))return;let{_:[A],$0:O,...S}=e,{RedoclyOAuthClient:v}=await import("./chunks/GCM2GVOB.js"),x=new v,$=Rr(t,S.residency),U=await x.isAuthorized($),L=vS();L||(L=`ann_${fa()}`,CS(L));let ne=Pr(o),Z=[{id:A,object:"command",uri:`urn:redocly:cli:command:${A}`,logged_in:U?"yes":"no",command:A,...OS(S,process.argv.slice(2)),node_version:process.version,npm_version:xS(),version:ft,exit_code:r,execution_time:n,metadata:process.env.REDOCLY_CLI_TELEMETRY_METADATA,environment_ci:process.env.CI,environment:process.env.REDOCLY_ENVIRONMENT,has_config:typeof t?.document?.parsed>"u"?"no":"yes",spec_version:o,spec_keyword:s,spec_full_version:i,respect_x_security_auth_types:ne==="arazzo1"&&a?.length?JSON.stringify(a):void 0,respect_source_description_types:ne==="arazzo1"&&c?.length?JSON.stringify(c):void 0,respect_criterion_object_types:ne==="arazzo1"&&l?.length?JSON.stringify(l):void 0,lint_rules_with_errors:u?.length?JSON.stringify(u):void 0,lint_rules_with_warnings:p?.length?JSON.stringify(p):void 0,lint_rules_with_ignored_problems:f?.length?JSON.stringify(f):void 0,generate_client_builtin_generators:h?.generate_client_builtin_generators?.length?JSON.stringify(h.generate_client_builtin_generators):void 0,generate_client_custom_generators_count:h?.generate_client_custom_generators_count,generate_client_toolkit_imports:h?.generate_client_toolkit_imports?.length?JSON.stringify(h.generate_client_toolkit_imports):void 0,generate_client_error_category:h?.generate_client_error_category,generate_client_ejected_generators:h?.generate_client_ejected_generators?.length?JSON.stringify(h.generate_client_ejected_generators):void 0,generate_client_composed_apis_count:h?.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}],ue=ua.mapToCloudEvent({type:"com.redocly.command.ran",source:"urn:redocly:cli",origin:"redocly-cli",env:"production",osPlatform:mm.platform(),actor:{id:L,object:"user",uri:""},category:"product",data:Z}),{otelTelemetry:R}=await import("./chunks/ZGSX24WO.js");R.send(ue)}catch{}}function ym(t,e){for(let r of t.sourceDescriptions??[])r.type&&e.add(r.type)}function wm(t,e){for(let r of t.workflows??[]){en(r.successActions,e),en(r.failureActions,e);for(let n of r.steps??[])bm(n.successCriteria,e),en(n.onSuccess,e),en(n.onFailure,e)}en(Object.values(t.components?.successActions??{}),e),en(Object.values(t.components?.failureActions??{}),e)}function en(t,e){for(let r of t??[])bm(r.criteria,e)}function bm(t,e){for(let r of t??[]){let n=SS(r);n&&e.add(n)}}function SS(t){let e=t.type;return typeof e=="string"?e:e?.type||(t.condition?"simple":void 0)}function Sm(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 ES(t){return tn.existsSync(t)&&tn.statSync(t).isFile()}function AS(t){return tn.existsSync(t)&&tn.statSync(t).isDirectory()}function Pi(t){return t&&(rn(t)?t.split("://")[0]+"://url":ES(t)?t.replace(/.+\.([^.]+)$/,(e,r)=>"file-"+r):AS(t)?"folder":t)}function $i(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 Em(t,e){let r={};for(let[n,o]of Object.entries(t))e.includes(n)?r[n]=zo:I(o)?r[n]=Em(o,e):r[n]=o;return r}function Ri(t,e,r=[]){if(Array.isArray(t))return t.forEach(n=>Ri(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))&&Ri(o,e,r);return r}function OS(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]=zo,n=$i(n,i,zo);else if(typeof i=="string"){let a=Pi(i);o[s]=a,n=$i(n,i,a)}else if(Array.isArray(i)){o[s]=i.map(Pi);for(let a of i){let c=Pi(a);n.includes(a)&&(n=n.replaceAll(a,c))}}else if(I(i)){let a=Ri(i,r);for(let c of a)n=$i(n,c,zo);o[s]=Em(i,r)}else o[s]=i;return{arguments:JSON.stringify(o),raw_input:n}}function xS(){try{return gS("npm -v",{stdio:["ignore","pipe","ignore"]}).toString().trim()}catch{return"unknown"}}var CS=t=>{if(!(process.env.CI||!t))try{let r=hm(dm(),Bo);wS(r,t)}catch{}},vS=()=>{if(!process.env.CI)try{let e=hm(dm(),Bo);return yS(e)?bS(e).toString().trim():void 0}catch{return}};function he(t){return async e=>{let r=performance.now(),n=2,o,s="unknown",i,a,c,l=new Set,u=new Set,p=new Set,f=({parsed:O,source:S})=>{if(s="unknown",i=void 0,a=void 0,S?.absoluteRef&&Ui(S.absoluteRef)){s="graphql";return}try{s=tt(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]),Pr(s)==="arazzo1"&&(Sm(O,l),ym(O,u),wm(O,p)))},h=new Set,y=new Set,d=new Set,A=O=>{for(let S of O)S.ignored?d.add(S.ruleId):S.severity==="error"?h.add(S.ruleId):S.severity==="warn"&&y.add(S.ruleId)};try{e.config&&!_i(e.config)&&G("Please provide a valid path to the configuration file."),c=await sa(e,ft),o=c.resolvedConfig.telemetry,n=1,typeof t=="function"&&await t({argv:e,config:c,version:ft,collectSpecData:f,collectResults:A}),n=0}catch(O){O instanceof tr||(O instanceof de?g.error(O.message+`
|
|
473
473
|
|
|
474
474
|
`):(g.error(`An unexpected error occurred. This is likely a bug that should be reported.
|
|
475
475
|
`),g.error(O instanceof Error?O.stack||O.message:String(O)),g.error(`
|
|
476
476
|
`)))}finally{if(process.env.REDOCLY_TELEMETRY!=="off"&&o!=="off"){let O=Math.round(performance.now()-r);await gm({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:[...u],respect_criterion_object_types:[...p],lint_rules_with_errors:[...h],lint_rules_with_warnings:[...y],lint_rules_with_ignored_problems:[...d],generate_client:at,eject_generator:we})}process.once("beforeExit",()=>{process.exit(n)})}}}Am.config({path:Om.resolve(process.cwd(),"./.env")});pm();sp(vs(process.argv)).version("version","Show version number.",ft).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=>{he(tm)(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=>{he(Gp)(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=>{he(cf)(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=>{he(Kf)(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=>{he(lu)(t)}).command("push-status [pushId]",!1,t=>t.env("REDOCLY_CLI_PUSH_STATUS").positional("pushId",{description:"Push id.",type:"string",demandOption:!0}).implies("max-execution-time","wait").option({organization:{description:"Name of the organization to push to.",type:"string",alias:"o",required:!0},project:{description:"Name of the project to push to.",type:"string",required:!0,alias:"p"},domain:{description:"Specify a domain.",alias:"d",type:"string",required:!1},wait:{description:"Wait for build to finish.",type:"boolean",default:!1},"max-execution-time":{description:"Maximum execution time in seconds.",type:"number"},"continue-on-deploy-failures":{description:"Command does not fail even if the deployment fails.",type:"boolean",default:!1},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}),t=>{he(qo)(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:um},author:{description:"Author of the commit.",type:"string",alias:"a",required:!0},message:{description:"Commit message.",type:"string",alias:"m",required:!0},"commit-sha":{description:"Commit SHA.",type:"string",alias:"sha"},"commit-url":{description:"Commit URL.",type:"string",alias:"url"},namespace:{description:"Repository namespace.",type:"string"},repository:{description:"Repository name.",type:"string"},"created-at":{description:"Commit creation date.",type:"string"},domain:{description:"Specify a domain.",alias:"d",type:"string"},config:{description:"Path to the config file.",requiresArg:!0,type:"string"},"default-branch":{type:"string",default:"main"},"max-execution-time":{description:"Maximum execution time in seconds.",type:"number"},"wait-for-deployment":{description:"Wait for build to finish.",type:"boolean",default:!1},verbose:{type:"boolean",default:!1},"continue-on-deploy-failures":{description:"Command does not fail even if the deployment fails.",type:"boolean",default:!1}}),t=>{he(sm)(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=>{he(Ji)(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:Xi},"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=>{he(cp)(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=>{he()(t)}).command("login","Log in to Redocly.",async t=>t.env("REDOCLY_CLI_LOGIN").options({residency:{description:"Residency of the application. Defaults to `us`.",alias:["r"],type:"string"},config:{description:"Path to the config file.",requiresArg:!0,type:"string"},verbose:{alias:"v",describe:"Apply verbose mode.",type:"boolean"}}),t=>{he(ip)(t)}).command("logout","Clear your stored credentials.",t=>t,t=>{he(ap)(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:pu,default:"enterprise"},port:{alias:"p",type:"number",description:"Preview port.",default:4e3,coerce:Zt("port",!0)},"project-dir":{alias:["d","source-dir"],type:"string",description:"Specifies the project content directory. The default value is the directory where the command is executed.",default:"."},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}),t=>{process.argv.some(e=>e.startsWith("--source-dir"))&&g.error(`Option --source-dir is deprecated and will be removed soon. Use --project-dir instead.
|
|
477
|
-
`),he(uu)(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/LJ53IMLM.js");he(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=>{he(rm)(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=>{he(Pp)(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:Lu},severity:{describe:"Severity of the check.",type:"string"},"max-steps":{describe:"Maximum number of steps to run (default: 2000).",type:"number",default:2e3,coerce:Zt("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:Zt("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:Zt("execution-timeout",!1)},"no-secrets-masking":{describe:"Do not mask secrets in the output.",type:"boolean",default:!1}}),async t=>{he(Du)(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:Zt("ai-concurrency",!0)},"max-workflows":{describe:"Most workflows the AI may design with --with-ai.",type:"number",default:10,coerce:Zt("max-workflows",!0)}}),async t=>{he(Tp)(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=>{he(Up)(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 (${[...Fr].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=>{he(xp)(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:Zt("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/B4BGW6LX.js");he(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/XMISXGL7.js");he(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=>{he(Sf)(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/NIDDLLHO.js");he(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/BT6KOTWJ.js");he(e)(t)}).completion("completion","Generate autocomplete script for `redocly` command.").demandCommand(1).middleware([lm]).strict().argv;
|
|
477
|
+
`),he(uu)(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/4XWI7J57.js");he(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=>{he(rm)(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=>{he(Pp)(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:Lu},severity:{describe:"Severity of the check.",type:"string"},"max-steps":{describe:"Maximum number of steps to run (default: 2000).",type:"number",default:2e3,coerce:Zt("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:Zt("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:Zt("execution-timeout",!1)},"no-secrets-masking":{describe:"Do not mask secrets in the output.",type:"boolean",default:!1}}),async t=>{he(Du)(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:Zt("ai-concurrency",!0)},"max-workflows":{describe:"Most workflows the AI may design with --with-ai.",type:"number",default:10,coerce:Zt("max-workflows",!0)}}),async t=>{he(Tp)(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=>{he(Up)(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 (${[...Fr].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=>{he(xp)(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:Zt("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/B4BGW6LX.js");he(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/XMISXGL7.js");he(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=>{he(Sf)(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/NIDDLLHO.js");he(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/BT6KOTWJ.js");he(e)(t)}).completion("completion","Generate autocomplete script for `redocly` command.").demandCommand(1).middleware([lm]).strict().argv;
|
|
478
478
|
/*! Bundled license information:
|
|
479
479
|
|
|
480
480
|
cookie/index.js:
|