@redocly/cli 2.48.0 → 2.49.0
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/lib/chunks/{3M6ARSHY.js → 2U54VUOE.js} +1 -1
- package/lib/chunks/{YQS3OX36.js → 4I2OVMBJ.js} +1 -1
- package/lib/chunks/{GOJNDGZT.js → 4JDAOKRJ.js} +1 -1
- package/lib/chunks/{EB2V4VMP.js → 5JIGUBC3.js} +1 -1
- package/lib/chunks/{FL3CA53Z.js → 5SAFIITS.js} +1 -1
- package/lib/chunks/{G3YJARF7.js → 6KCIFTIG.js} +1 -1
- package/lib/chunks/{PVM7EVWV.js → 6VSHPQXO.js} +1 -1
- package/lib/chunks/{3CR6IHZV.js → 74WJ7S7J.js} +1 -1
- package/lib/chunks/{V3JMSQFP.js → 7R5PBTLG.js} +1 -1
- package/lib/chunks/{U2A6GEAN.js → BT3ELZVX.js} +1 -1
- package/lib/chunks/{ZGMTMVBB.js → C5TR4MMN.js} +1 -1
- package/lib/chunks/{4IA3ZTGK.js → CCR5RYCX.js} +1 -1
- package/lib/chunks/{GA6WYGKY.js → DCN3GSUA.js} +1 -1
- package/lib/chunks/{2GJPOM5H.js → E5I67ZCZ.js} +1 -1
- package/lib/chunks/{MBHFDTYI.js → FUMCRNTK.js} +1 -1
- package/lib/chunks/{5L3FH5WQ.js → GNMJA2V2.js} +1 -1
- package/lib/chunks/{5ZEWVWOC.js → GRJG3TOI.js} +1 -1
- package/lib/chunks/{3X52NOC5.js → HA22GUKQ.js} +1 -1
- package/lib/chunks/HJ36YGCI.js +184 -0
- package/lib/chunks/{HLZCPNF7.js → HL5FOKC4.js} +1 -1
- package/lib/chunks/{GJRJZYC4.js → JBNPGEIJ.js} +1 -1
- package/lib/chunks/{W62VKXGM.js → KHEMMNFU.js} +1 -1
- package/lib/chunks/{DYAVWTVD.js → KK2STV73.js} +1 -1
- package/lib/chunks/{BD5JG7YZ.js → KK77ANZH.js} +1 -1
- package/lib/chunks/{WIZYCYZG.js → M6KLAAY4.js} +1 -1
- package/lib/chunks/{D27SC2KR.js → MHITBEGC.js} +1 -1
- package/lib/chunks/{SPPRUUK3.js → NTPLYWAB.js} +1 -1
- package/lib/chunks/{YJGI7CZ2.js → NUNOXB7Z.js} +1 -1
- package/lib/chunks/{Q5FNL2RM.js → NYLAOZPO.js} +1 -1
- package/lib/chunks/{GHPAE4DZ.js → O4R6BSAS.js} +1 -1
- package/lib/chunks/{VWSPU27A.js → OKITK6EF.js} +1 -1
- package/lib/chunks/{QW5MTOU2.js → OUCZOBEX.js} +1 -1
- package/lib/chunks/{CF5YCHNA.js → QZH7EL26.js} +1 -1
- package/lib/chunks/{XDK4JK3V.js → R4XFBOJU.js} +1 -1
- package/lib/chunks/{Z2AXUXMK.js → RXOEH2LN.js} +1 -1
- package/lib/chunks/{ZVUMPMHU.js → T5EPIBMA.js} +1 -1
- package/lib/chunks/{FVBSRIWC.js → TLQZAJQU.js} +1 -1
- package/lib/chunks/{46OWEERC.js → TSRK76GA.js} +1 -1
- package/lib/chunks/{LUC2DWUK.js → U2H2LXZE.js} +1 -1
- package/lib/chunks/{UDBINQ2S.js → UMQN5HTL.js} +1 -1
- package/lib/chunks/{6O3ZHZZ2.js → V2LJ4UGM.js} +1 -1
- package/lib/chunks/{5L5WOOWA.js → VBPP2WUF.js} +1 -1
- package/lib/chunks/{5EG7SNNU.js → WPGKH5NI.js} +1 -1
- package/lib/chunks/{G2XR6TRU.js → WXVC3KOI.js} +1 -1
- package/lib/chunks/{AJZAID3R.js → YI34NB7D.js} +1 -1
- package/lib/chunks/{E35Q6YJN.js → YOJGIGE3.js} +1 -1
- package/lib/chunks/{5E3L4HJN.js → YP5GHFYE.js} +1 -1
- package/lib/chunks/{S4GQKQ5G.js → YXXYE4G2.js} +1 -1
- package/lib/chunks/{GBRES7WG.js → ZMCRMR2V.js} +2 -2
- package/lib/chunks/{KNPQJVYA.js → ZOUQBK53.js} +1 -1
- package/lib/chunks/{KIQI3UBS.js → ZXKOHMC6.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 +9 -10
- package/package.json +1 -1
- package/lib/chunks/BEOYUN4L.js +0 -184
package/lib/index.js
CHANGED
|
@@ -5,9 +5,9 @@ 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 Ki,c as Ji}from"./chunks/OFAMJNQ6.js";import{a as Li,b as Di,c as lt,d as Mi,e as Rn,f as Qe,g as Jt,h as ki,i as Fi,j as Io,k as Ui,l as Cr,m as Ie,n as _n,o as qi,p as Wi,q as zi,r as Vi,s as Xr,t as To,u as Et,v as Zr}from"./chunks/3CR6IHZV.js";import{a as In,b as Hi,c as Yi}from"./chunks/ZVUMPMHU.js";import{a as Kt,b as z}from"./chunks/3M6ARSHY.js";import{c as jn,d as Gi,f as Bi}from"./chunks/LUC2DWUK.js";import"./chunks/O6PRCLSV.js";import{a as An,b as Er,c as jo,d as Ti,e as Pn,f as Ni,g as $n,h as Jr}from"./chunks/FL3CA53Z.js";import{a as ji,c as vn,d as _o}from"./chunks/P26PQ2RU.js";import"./chunks/RS5PUOTT.js";import{a as ct,b as Ri,c as _i}from"./chunks/PVM7EVWV.js";import{a as Ii}from"./chunks/BXI4SF2U.js";import"./chunks/32XCOMOR.js";import{$ as vi,A as Ei,B as Ci,C as Oi,D as Ee,F as qe,G as fe,H as ee,I as Z,J as at,K as be,L as Ve,M as me,N as Hr,O as g,Q as wr,R as wt,T as xi,U as Ai,W as St,X as Cn,Y as Yr,_ as Kr,a as ui,aa as Sr,b as Dt,c as te,ca as Pi,d as At,da as jt,ea as On,f as fi,fa as xn,g as mi,ga as Ke,h as Sn,i as Ro,j as di,ja as $i,l as Le,la as de,n as ze,o as hi,p as En,q as De,r as gi,s as yi,t as bi,u as br,y as wi,z as Si}from"./chunks/BEOYUN4L.js";import"./chunks/NEWT5A6S.js";import{a as Ye,c as G,e as _t}from"./chunks/RFWIIJFG.js";var Or=G((Tw,Xi)=>{"use strict";var Qf="2.0.0",em=Number.MAX_SAFE_INTEGER||9007199254740991,tm=16,rm=250,nm=["major","premajor","minor","preminor","patch","prepatch","prerelease"];Xi.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:tm,MAX_SAFE_BUILD_LENGTH:rm,MAX_SAFE_INTEGER:em,RELEASE_TYPES:nm,SEMVER_SPEC_VERSION:Qf,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Qr=G((Nw,Zi)=>{"use strict";var om=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};Zi.exports=om});var xr=G((vt,Qi)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:No,MAX_SAFE_BUILD_LENGTH:sm,MAX_LENGTH:im}=Or(),am=Qr();vt=Qi.exports={};var cm=vt.re=[],lm=vt.safeRe=[],j=vt.src=[],pm=vt.safeSrc=[],I=vt.t={},um=0,Lo="[a-zA-Z0-9-]",fm=[["\\s",1],["\\d",im],[Lo,sm]],mm=t=>{for(let[e,r]of fm)t=t.split(`${e}*`).join(`${e}{0,${r}}`).split(`${e}+`).join(`${e}{1,${r}}`);return t},Q=(t,e,r)=>{let n=mm(e),o=um++;am(t,o,e),I[t]=o,j[o]=e,pm[o]=n,cm[o]=new RegExp(e,r?"g":void 0),lm[o]=new RegExp(n,r?"g":void 0)};Q("NUMERICIDENTIFIER","0|[1-9]\\d*");Q("NUMERICIDENTIFIERLOOSE","\\d+");Q("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Lo}*`);Q("MAINVERSION",`(${j[I.NUMERICIDENTIFIER]})\\.(${j[I.NUMERICIDENTIFIER]})\\.(${j[I.NUMERICIDENTIFIER]})`);Q("MAINVERSIONLOOSE",`(${j[I.NUMERICIDENTIFIERLOOSE]})\\.(${j[I.NUMERICIDENTIFIERLOOSE]})\\.(${j[I.NUMERICIDENTIFIERLOOSE]})`);Q("PRERELEASEIDENTIFIER",`(?:${j[I.NONNUMERICIDENTIFIER]}|${j[I.NUMERICIDENTIFIER]})`);Q("PRERELEASEIDENTIFIERLOOSE",`(?:${j[I.NONNUMERICIDENTIFIER]}|${j[I.NUMERICIDENTIFIERLOOSE]})`);Q("PRERELEASE",`(?:-(${j[I.PRERELEASEIDENTIFIER]}(?:\\.${j[I.PRERELEASEIDENTIFIER]})*))`);Q("PRERELEASELOOSE",`(?:-?(${j[I.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${j[I.PRERELEASEIDENTIFIERLOOSE]})*))`);Q("BUILDIDENTIFIER",`${Lo}+`);Q("BUILD",`(?:\\+(${j[I.BUILDIDENTIFIER]}(?:\\.${j[I.BUILDIDENTIFIER]})*))`);Q("FULLPLAIN",`v?${j[I.MAINVERSION]}${j[I.PRERELEASE]}?${j[I.BUILD]}?`);Q("FULL",`^${j[I.FULLPLAIN]}$`);Q("LOOSEPLAIN",`[v=\\s]*${j[I.MAINVERSIONLOOSE]}${j[I.PRERELEASELOOSE]}?${j[I.BUILD]}?`);Q("LOOSE",`^${j[I.LOOSEPLAIN]}$`);Q("GTLT","((?:<|>)?=?)");Q("XRANGEIDENTIFIERLOOSE",`${j[I.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);Q("XRANGEIDENTIFIER",`${j[I.NUMERICIDENTIFIER]}|x|X|\\*`);Q("XRANGEPLAIN",`[v=\\s]*(${j[I.XRANGEIDENTIFIER]})(?:\\.(${j[I.XRANGEIDENTIFIER]})(?:\\.(${j[I.XRANGEIDENTIFIER]})(?:${j[I.PRERELEASE]})?${j[I.BUILD]}?)?)?`);Q("XRANGEPLAINLOOSE",`[v=\\s]*(${j[I.XRANGEIDENTIFIERLOOSE]})(?:\\.(${j[I.XRANGEIDENTIFIERLOOSE]})(?:\\.(${j[I.XRANGEIDENTIFIERLOOSE]})(?:${j[I.PRERELEASELOOSE]})?${j[I.BUILD]}?)?)?`);Q("XRANGE",`^${j[I.GTLT]}\\s*${j[I.XRANGEPLAIN]}$`);Q("XRANGELOOSE",`^${j[I.GTLT]}\\s*${j[I.XRANGEPLAINLOOSE]}$`);Q("COERCEPLAIN",`(^|[^\\d])(\\d{1,${No}})(?:\\.(\\d{1,${No}}))?(?:\\.(\\d{1,${No}}))?`);Q("COERCE",`${j[I.COERCEPLAIN]}(?:$|[^\\d])`);Q("COERCEFULL",j[I.COERCEPLAIN]+`(?:${j[I.PRERELEASE]})?(?:${j[I.BUILD]})?(?:$|[^\\d])`);Q("COERCERTL",j[I.COERCE],!0);Q("COERCERTLFULL",j[I.COERCEFULL],!0);Q("LONETILDE","(?:~>?)");Q("TILDETRIM",`(\\s*)${j[I.LONETILDE]}\\s+`,!0);vt.tildeTrimReplace="$1~";Q("TILDE",`^${j[I.LONETILDE]}${j[I.XRANGEPLAIN]}$`);Q("TILDELOOSE",`^${j[I.LONETILDE]}${j[I.XRANGEPLAINLOOSE]}$`);Q("LONECARET","(?:\\^)");Q("CARETTRIM",`(\\s*)${j[I.LONECARET]}\\s+`,!0);vt.caretTrimReplace="$1^";Q("CARET",`^${j[I.LONECARET]}${j[I.XRANGEPLAIN]}$`);Q("CARETLOOSE",`^${j[I.LONECARET]}${j[I.XRANGEPLAINLOOSE]}$`);Q("COMPARATORLOOSE",`^${j[I.GTLT]}\\s*(${j[I.LOOSEPLAIN]})$|^$`);Q("COMPARATOR",`^${j[I.GTLT]}\\s*(${j[I.FULLPLAIN]})$|^$`);Q("COMPARATORTRIM",`(\\s*)${j[I.GTLT]}\\s*(${j[I.LOOSEPLAIN]}|${j[I.XRANGEPLAIN]})`,!0);vt.comparatorTrimReplace="$1$2$3";Q("HYPHENRANGE",`^\\s*(${j[I.XRANGEPLAIN]})\\s+-\\s+(${j[I.XRANGEPLAIN]})\\s*$`);Q("HYPHENRANGELOOSE",`^\\s*(${j[I.XRANGEPLAINLOOSE]})\\s+-\\s+(${j[I.XRANGEPLAINLOOSE]})\\s*$`);Q("STAR","(<|>)?=?\\s*\\*");Q("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");Q("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Tn=G((Lw,ea)=>{"use strict";var dm=Object.freeze({loose:!0}),hm=Object.freeze({}),gm=t=>t?typeof t!="object"?dm:t:hm;ea.exports=gm});var Do=G((Dw,na)=>{"use strict";var ta=/^[0-9]+$/,ra=(t,e)=>{if(typeof t=="number"&&typeof e=="number")return t===e?0:t<e?-1:1;let r=ta.test(t),n=ta.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t<e?-1:1},ym=(t,e)=>ra(e,t);na.exports={compareIdentifiers:ra,rcompareIdentifiers:ym}});var Me=G((Mw,sa)=>{"use strict";var Nn=Qr(),{MAX_LENGTH:oa,MAX_SAFE_INTEGER:Ln}=Or(),{safeRe:Dn,t:Mn}=xr(),bm=Tn(),{compareIdentifiers:Mo}=Do(),wm=(t,e)=>{let r=e.split(".");if(r.length>t.length)return!1;for(let n=0;n<r.length;n++)if(Mo(t[n],r[n])!==0)return!1;return!0},ko=class t{constructor(e,r){if(r=bm(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>oa)throw new TypeError(`version is longer than ${oa} characters`);Nn("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=e.trim().match(r.loose?Dn[Mn.LOOSE]:Dn[Mn.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>Ln||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Ln||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Ln||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<Ln)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(Nn("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(Nn("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 Mo(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(Nn("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 Mo(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?Dn[Mn.PRERELEASELOOSE]:Dn[Mn.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]),wm(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}};sa.exports=ko});var Mt=G((kw,aa)=>{"use strict";var ia=Me(),Sm=(t,e,r=!1)=>{if(t instanceof ia)return t;try{return new ia(t,e)}catch(n){if(!r)return null;throw n}};aa.exports=Sm});var la=G((Fw,ca)=>{"use strict";var Em=Mt(),Cm=(t,e)=>{let r=Em(t,e);return r?r.version:null};ca.exports=Cm});var ua=G((Uw,pa)=>{"use strict";var Om=Mt(),xm=(t,e)=>{let r=Om(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null};pa.exports=xm});var da=G((qw,ma)=>{"use strict";var fa=Me(),Am=(t,e,r,n,o)=>{typeof r=="string"&&(o=n,n=r,r=void 0);try{return new fa(t instanceof fa?t.version:t,r).inc(e,n,o).version}catch{return null}};ma.exports=Am});var ya=G((Ww,ga)=>{"use strict";var ha=Mt(),vm=(t,e)=>{let r=ha(t,null,!0),n=ha(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"};ga.exports=vm});var wa=G((zw,ba)=>{"use strict";var Pm=Me(),$m=(t,e)=>new Pm(t,e).major;ba.exports=$m});var Ea=G((Vw,Sa)=>{"use strict";var Rm=Me(),_m=(t,e)=>new Rm(t,e).minor;Sa.exports=_m});var Oa=G((Gw,Ca)=>{"use strict";var jm=Me(),Im=(t,e)=>new jm(t,e).patch;Ca.exports=Im});var Aa=G((Bw,xa)=>{"use strict";var Tm=Mt(),Nm=(t,e)=>{let r=Tm(t,e);return r&&r.prerelease.length?r.prerelease:null};xa.exports=Nm});var pt=G((Hw,Pa)=>{"use strict";var va=Me(),Lm=(t,e,r)=>new va(t,r).compare(new va(e,r));Pa.exports=Lm});var Ra=G((Yw,$a)=>{"use strict";var Dm=pt(),Mm=(t,e,r)=>Dm(e,t,r);$a.exports=Mm});var ja=G((Kw,_a)=>{"use strict";var km=pt(),Fm=(t,e)=>km(t,e,!0);_a.exports=Fm});var kn=G((Jw,Ta)=>{"use strict";var Ia=Me(),Um=(t,e,r)=>{let n=new Ia(t,r),o=new Ia(e,r);return n.compare(o)||n.compareBuild(o)};Ta.exports=Um});var La=G((Xw,Na)=>{"use strict";var qm=kn(),Wm=(t,e)=>t.sort((r,n)=>qm(r,n,e));Na.exports=Wm});var Ma=G((Zw,Da)=>{"use strict";var zm=kn(),Vm=(t,e)=>t.sort((r,n)=>zm(n,r,e));Da.exports=Vm});var en=G((Qw,ka)=>{"use strict";var Gm=pt(),Bm=(t,e,r)=>Gm(t,e,r)>0;ka.exports=Bm});var Fn=G((eS,Fa)=>{"use strict";var Hm=pt(),Ym=(t,e,r)=>Hm(t,e,r)<0;Fa.exports=Ym});var Fo=G((tS,Ua)=>{"use strict";var Km=pt(),Jm=(t,e,r)=>Km(t,e,r)===0;Ua.exports=Jm});var Uo=G((rS,qa)=>{"use strict";var Xm=pt(),Zm=(t,e,r)=>Xm(t,e,r)!==0;qa.exports=Zm});var Un=G((nS,Wa)=>{"use strict";var Qm=pt(),ed=(t,e,r)=>Qm(t,e,r)>=0;Wa.exports=ed});var qn=G((oS,za)=>{"use strict";var td=pt(),rd=(t,e,r)=>td(t,e,r)<=0;za.exports=rd});var qo=G((sS,Va)=>{"use strict";var nd=Fo(),od=Uo(),sd=en(),id=Un(),ad=Fn(),cd=qn(),ld=(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 nd(t,r,n);case"!=":return od(t,r,n);case">":return sd(t,r,n);case">=":return id(t,r,n);case"<":return ad(t,r,n);case"<=":return cd(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}};Va.exports=ld});var Ba=G((iS,Ga)=>{"use strict";var pd=Me(),ud=Mt(),{safeRe:Wn,t:zn}=xr(),fd=(t,e)=>{if(t instanceof pd)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?Wn[zn.COERCEFULL]:Wn[zn.COERCE]);else{let c=e.includePrerelease?Wn[zn.COERCERTLFULL]:Wn[zn.COERCERTL],l;for(;(l=c.exec(t))&&(!r||r.index+r[0].length!==t.length);)(!r||l.index+l[0].length!==r.index+r[0].length)&&(r=l),c.lastIndex=l.index+l[1].length+l[2].length;c.lastIndex=-1}if(r===null)return null;let n=r[2],o=r[3]||"0",s=r[4]||"0",i=e.includePrerelease&&r[5]?`-${r[5]}`:"",a=e.includePrerelease&&r[6]?`+${r[6]}`:"";return ud(`${n}.${o}.${s}${i}${a}`,e)};Ga.exports=fd});var Ya=G((aS,Ha)=>{"use strict";var md=Mt(),dd=Or(),hd=Me(),gd=(t,e,r)=>{if(!dd.RELEASE_TYPES.includes(e))return null;let n=yd(t,r);return n&&bd(n,e)},yd=(t,e)=>{let r=t instanceof hd?t.version:t;return md(r,e)},bd=(t,e)=>{if(wd(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()},wd=t=>t.startsWith("pre");Ha.exports=gd});var Ja=G((cS,Ka)=>{"use strict";var Wo=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}};Ka.exports=Wo});var ut=G((lS,ec)=>{"use strict";var Sd=/\s+/g,zo=class t{constructor(e,r){if(r=Cd(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof Vo)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(Sd," "),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=>!Za(o[0])),this.set.length===0)this.set=[n];else if(this.set.length>1){for(let o of this.set)if(o.length===1&&jd(o[0])){this.set=[o];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let r=this.set[e];for(let n=0;n<r.length;n++)n>0&&(this.formatted+=" "),this.formatted+=r[n].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){e=e.replace(_d,"");let n=((this.options.includePrerelease&&$d)|(this.options.loose&&Rd))+":"+e,o=Xa.get(n);if(o)return o;let s=this.options.loose,i=s?Ge[ke.HYPHENRANGELOOSE]:Ge[ke.HYPHENRANGE];e=e.replace(i,Wd(this.options.includePrerelease)),he("hyphen replace",e),e=e.replace(Ge[ke.COMPARATORTRIM],Ad),he("comparator trim",e),e=e.replace(Ge[ke.TILDETRIM],vd),he("tilde trim",e),e=e.replace(Ge[ke.CARETTRIM],Pd),he("caret trim",e);let a=e.split(" ").map(p=>Id(p,this.options)).join(" ").split(/\s+/).map(p=>qd(p,this.options));s&&(a=a.filter(p=>(he("loose invalid filter",p,this.options),!!p.match(Ge[ke.COMPARATORLOOSE])))),he("range list",a);let c=new Map,l=a.map(p=>new Vo(p,this.options));for(let p of l){if(Za(p))return[p];c.set(p.value,p)}c.size>1&&c.has("")&&c.delete("");let u=[...c.values()];return Xa.set(n,u),u}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(n=>Qa(n,r)&&e.set.some(o=>Qa(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 Od(e,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(zd(this.set[r],e,this.options))return!0;return!1}};ec.exports=zo;var Ed=Ja(),Xa=new Ed,Cd=Tn(),Vo=tn(),he=Qr(),Od=Me(),{safeRe:Ge,src:xd,t:ke,comparatorTrimReplace:Ad,tildeTrimReplace:vd,caretTrimReplace:Pd}=xr(),{FLAG_INCLUDE_PRERELEASE:$d,FLAG_LOOSE:Rd}=Or(),_d=new RegExp(xd[ke.BUILD],"g"),Za=t=>t.value==="<0.0.0-0",jd=t=>t.value==="",Qa=(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},Id=(t,e)=>(t=t.replace(Ge[ke.BUILD],""),he("comp",t,e),t=Dd(t,e),he("caret",t),t=Nd(t,e),he("tildes",t),t=kd(t,e),he("xrange",t),t=Ud(t,e),he("stars",t),t),$e=t=>!t||t.toLowerCase()==="x"||t==="*",Td=(t,e,r)=>$e(t)&&!$e(e)||$e(e)&&r&&!$e(r),Nd=(t,e)=>t.trim().split(/\s+/).map(r=>Ld(r,e)).join(" "),Ld=(t,e)=>{let r=e.loose?Ge[ke.TILDELOOSE]:Ge[ke.TILDE],n=e.includePrerelease?"-0":"";return t.replace(r,(o,s,i,a,c)=>{he("tilde",t,o,s,i,a,c);let l;return $e(s)?l="":$e(i)?l=`>=${s}.0.0${n} <${+s+1}.0.0-0`:$e(a)?l=`>=${s}.${i}.0${n} <${s}.${+i+1}.0-0`:c?(he("replaceTilde pr",c),l=`>=${s}.${i}.${a}-${c} <${s}.${+i+1}.0-0`):l=`>=${s}.${i}.${a} <${s}.${+i+1}.0-0`,he("tilde return",l),l})},Dd=(t,e)=>t.trim().split(/\s+/).map(r=>Md(r,e)).join(" "),Md=(t,e)=>{he("caret",t,e);let r=e.loose?Ge[ke.CARETLOOSE]:Ge[ke.CARET],n=e.includePrerelease?"-0":"";return t.replace(r,(o,s,i,a,c)=>{he("caret",t,o,s,i,a,c);let l;return $e(s)?l="":$e(i)?l=`>=${s}.0.0${n} <${+s+1}.0.0-0`:$e(a)?s==="0"?l=`>=${s}.${i}.0${n} <${s}.${+i+1}.0-0`:l=`>=${s}.${i}.0${n} <${+s+1}.0.0-0`:c?(he("replaceCaret pr",c),s==="0"?i==="0"?l=`>=${s}.${i}.${a}-${c} <${s}.${i}.${+a+1}-0`:l=`>=${s}.${i}.${a}-${c} <${s}.${+i+1}.0-0`:l=`>=${s}.${i}.${a}-${c} <${+s+1}.0.0-0`):(he("no pr"),s==="0"?i==="0"?l=`>=${s}.${i}.${a} <${s}.${i}.${+a+1}-0`:l=`>=${s}.${i}.${a} <${s}.${+i+1}.0-0`:l=`>=${s}.${i}.${a} <${+s+1}.0.0-0`),he("caret return",l),l})},kd=(t,e)=>(he("replaceXRanges",t,e),t.split(/\s+/).map(r=>Fd(r,e)).join(" ")),Fd=(t,e)=>{t=t.trim();let r=e.loose?Ge[ke.XRANGELOOSE]:Ge[ke.XRANGE];return t.replace(r,(n,o,s,i,a,c)=>{if(he("xRange",t,n,o,s,i,a,c),Td(s,i,a))return t;let l=$e(s),u=l||$e(i),p=u||$e(a),m=p;return o==="="&&m&&(o=""),c=e.includePrerelease?"-0":"",l?o===">"||o==="<"?n="<0.0.0-0":n="*":o&&m?(u&&(i=0),a=0,o===">"?(o=">=",u?(s=+s+1,i=0,a=0):(i=+i+1,a=0)):o==="<="&&(o="<",u?s=+s+1:i=+i+1),o==="<"&&(c="-0"),n=`${o+s}.${i}.${a}${c}`):u?n=`>=${s}.0.0${c} <${+s+1}.0.0-0`:p&&(n=`>=${s}.${i}.0${c} <${s}.${+i+1}.0-0`),he("xRange return",n),n})},Ud=(t,e)=>(he("replaceStars",t,e),t.trim().replace(Ge[ke.STAR],"")),qd=(t,e)=>(he("replaceGTE0",t,e),t.trim().replace(Ge[e.includePrerelease?ke.GTE0PRE:ke.GTE0],"")),Wd=t=>(e,r,n,o,s,i,a,c,l,u,p,m)=>($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`:m?c=`<=${l}.${u}.${p}-${m}`:t?c=`<${l}.${u}.${+p+1}-0`:c=`<=${c}`,`${r} ${c}`.trim()),zd=(t,e,r)=>{for(let n=0;n<t.length;n++)if(!t[n].test(e))return!1;if(e.prerelease.length&&!r.includePrerelease){for(let n=0;n<t.length;n++)if(he(t[n].semver),t[n].semver!==Vo.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 tn=G((pS,ic)=>{"use strict";var rn=Symbol("SemVer ANY"),Ho=class t{static get ANY(){return rn}constructor(e,r){if(r=tc(r),e instanceof t){if(e.loose===!!r.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),Bo("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===rn?this.value="":this.value=this.operator+this.semver.version,Bo("comp",this)}parse(e){let r=this.options.loose?rc[nc.COMPARATORLOOSE]:rc[nc.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 oc(n[2],this.options.loose):this.semver=rn}toString(){return this.value}test(e){if(Bo("Comparator.test",e,this.options.loose),this.semver===rn||e===rn)return!0;if(typeof e=="string")try{e=new oc(e,this.options)}catch{return!1}return Go(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 sc(e.value,r).test(this.value):e.operator===""?e.value===""?!0:new sc(this.value,r).test(e.semver):(r=tc(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("=")||Go(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||Go(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};ic.exports=Ho;var tc=Tn(),{safeRe:rc,t:nc}=xr(),Go=qo(),Bo=Qr(),oc=Me(),sc=ut()});var nn=G((uS,ac)=>{"use strict";var Vd=ut(),Gd=(t,e,r)=>{try{e=new Vd(e,r)}catch{return!1}return e.test(t)};ac.exports=Gd});var lc=G((fS,cc)=>{"use strict";var Bd=ut(),Hd=(t,e)=>new Bd(t,e).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));cc.exports=Hd});var uc=G((mS,pc)=>{"use strict";var Yd=Me(),Kd=ut(),Jd=(t,e,r)=>{let n=null,o=null,s=null;try{s=new Kd(e,r)}catch{return null}return t.forEach(i=>{s.test(i)&&(!n||o.compare(i)===-1)&&(n=i,o=new Yd(n,r))}),n};pc.exports=Jd});var mc=G((dS,fc)=>{"use strict";var Xd=Me(),Zd=ut(),Qd=(t,e,r)=>{let n=null,o=null,s=null;try{s=new Zd(e,r)}catch{return null}return t.forEach(i=>{s.test(i)&&(!n||o.compare(i)===1)&&(n=i,o=new Xd(n,r))}),n};fc.exports=Qd});var gc=G((hS,hc)=>{"use strict";var Yo=Me(),eh=ut(),dc=en(),th=(t,e)=>{t=new eh(t,e);let r=new Yo("0.0.0");if(t.test(r)||(r=new Yo("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 Yo(i.semver.version);switch(i.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!s||dc(a,s))&&(s=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${i.operator}`)}}),s&&(!r||dc(r,s))&&(r=s)}return r&&t.test(r)?r:null};hc.exports=th});var bc=G((gS,yc)=>{"use strict";var rh=ut(),nh=(t,e)=>{try{return new rh(t,e).range||"*"}catch{return null}};yc.exports=nh});var Vn=G((yS,Cc)=>{"use strict";var oh=Me(),Ec=tn(),{ANY:sh}=Ec,ih=ut(),ah=nn(),wc=en(),Sc=Fn(),ch=qn(),lh=Un(),ph=(t,e,r,n)=>{t=new oh(t,n),e=new ih(e,n);let o,s,i,a,c;switch(r){case">":o=wc,s=ch,i=Sc,a=">",c=">=";break;case"<":o=Sc,s=lh,i=wc,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(ah(t,e,n))return!1;for(let l=0;l<e.set.length;++l){let u=e.set[l],p=null,m=null;if(u.forEach(d=>{d.semver===sh&&(d=new Ec(">=0.0.0")),p=p||d,m=m||d,o(d.semver,p.semver,n)?p=d:i(d.semver,m.semver,n)&&(m=d)}),p.operator===a||p.operator===c||(!m.operator||m.operator===a)&&s(t,m.semver))return!1;if(m.operator===c&&i(t,m.semver))return!1}return!0};Cc.exports=ph});var xc=G((bS,Oc)=>{"use strict";var uh=Vn(),fh=(t,e,r)=>uh(t,e,">",r);Oc.exports=fh});var vc=G((wS,Ac)=>{"use strict";var mh=Vn(),dh=(t,e,r)=>mh(t,e,"<",r);Ac.exports=dh});var Rc=G((SS,$c)=>{"use strict";var Pc=ut(),hh=(t,e,r)=>(t=new Pc(t,r),e=new Pc(e,r),t.intersects(e,r));$c.exports=hh});var jc=G((ES,_c)=>{"use strict";var gh=nn(),yh=pt();_c.exports=(t,e,r)=>{let n=[],o=null,s=null,i=t.sort((u,p)=>yh(u,p,r));for(let u of i)gh(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 Mc=G((CS,Dc)=>{"use strict";var Ic=ut(),Xo=tn(),{ANY:Ko}=Xo,Jo=nn(),Zo=pt(),bh=(t,e,r={})=>{if(t===e)return!0;t=new Ic(t,r),e=new Ic(e,r);let n=!1;e:for(let o of t.set){for(let s of e.set){let i=Sh(o,s,r);if(n=n||i!==null,i)continue e}if(n)return!1}return!0},wh=[new Xo(">=0.0.0-0")],Tc=[new Xo(">=0.0.0")],Sh=(t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===Ko){if(e.length===1&&e[0].semver===Ko)return!0;r.includePrerelease?t=wh:t=Tc}if(e.length===1&&e[0].semver===Ko){if(r.includePrerelease)return!0;e=Tc}let n=new Set,o,s;for(let d of t)d.operator===">"||d.operator===">="?o=Nc(o,d,r):d.operator==="<"||d.operator==="<="?s=Lc(s,d,r):n.add(d.semver);if(n.size>1)return null;let i;if(o&&s){if(i=Zo(o.semver,s.semver,r),i>0)return null;if(i===0&&(o.operator!==">="||s.operator!=="<="))return null}for(let d of n){if(o&&!Jo(d,String(o),r)||s&&!Jo(d,String(s),r))return null;for(let b of e)if(!Jo(d,String(b),r))return!1;return!0}let a,c,l,u,p=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1,m=o&&!r.includePrerelease&&o.semver.prerelease.length?o.semver:!1;p&&p.prerelease.length===1&&s.operator==="<"&&p.prerelease[0]===0&&(p=!1);for(let d of e){if(u=u||d.operator===">"||d.operator===">=",l=l||d.operator==="<"||d.operator==="<=",o){if(m&&d.semver.prerelease&&d.semver.prerelease.length&&d.semver.major===m.major&&d.semver.minor===m.minor&&d.semver.patch===m.patch&&(m=!1),d.operator===">"||d.operator===">="){if(a=Nc(o,d,r),a===d&&a!==o)return!1}else if(o.operator===">="&&!d.test(o.semver))return!1}if(s){if(p&&d.semver.prerelease&&d.semver.prerelease.length&&d.semver.major===p.major&&d.semver.minor===p.minor&&d.semver.patch===p.patch&&(p=!1),d.operator==="<"||d.operator==="<="){if(c=Lc(s,d,r),c===d&&c!==s)return!1}else if(s.operator==="<="&&!d.test(s.semver))return!1}if(!d.operator&&(s||o)&&i!==0)return!1}return!(o&&l&&!s&&i!==0||s&&u&&!o&&i!==0||m||p)},Nc=(t,e,r)=>{if(!t)return e;let n=Zo(t.semver,e.semver,r);return n>0?t:n<0||e.operator===">"&&t.operator===">="?e:t},Lc=(t,e,r)=>{if(!t)return e;let n=Zo(t.semver,e.semver,r);return n<0?t:n>0||e.operator==="<"&&t.operator==="<="?e:t};Dc.exports=bh});var Gn=G((OS,Uc)=>{"use strict";var Qo=xr(),kc=Or(),Eh=Me(),Fc=Do(),Ch=Mt(),Oh=la(),xh=ua(),Ah=da(),vh=ya(),Ph=wa(),$h=Ea(),Rh=Oa(),_h=Aa(),jh=pt(),Ih=Ra(),Th=ja(),Nh=kn(),Lh=La(),Dh=Ma(),Mh=en(),kh=Fn(),Fh=Fo(),Uh=Uo(),qh=Un(),Wh=qn(),zh=qo(),Vh=Ba(),Gh=Ya(),Bh=tn(),Hh=ut(),Yh=nn(),Kh=lc(),Jh=uc(),Xh=mc(),Zh=gc(),Qh=bc(),eg=Vn(),tg=xc(),rg=vc(),ng=Rc(),og=jc(),sg=Mc();Uc.exports={parse:Ch,valid:Oh,clean:xh,inc:Ah,diff:vh,major:Ph,minor:$h,patch:Rh,prerelease:_h,compare:jh,rcompare:Ih,compareLoose:Th,compareBuild:Nh,sort:Lh,rsort:Dh,gt:Mh,lt:kh,eq:Fh,neq:Uh,gte:qh,lte:Wh,cmp:zh,coerce:Vh,truncate:Gh,Comparator:Bh,Range:Hh,satisfies:Yh,toComparators:Kh,maxSatisfying:Jh,minSatisfying:Xh,minVersion:Zh,validRange:Qh,outside:eg,gtr:tg,ltr:rg,intersects:ng,simplifyRange:og,subset:sg,SemVer:Eh,re:Qo.re,src:Qo.src,tokens:Qo.t,SEMVER_SPEC_VERSION:kc.SEMVER_SPEC_VERSION,RELEASE_TYPES:kc.RELEASE_TYPES,compareIdentifiers:Fc.compareIdentifiers,rcompareIdentifiers:Fc.rcompareIdentifiers}});var Wc=G((vS,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 os=G((PS,It)=>{var ts=Ye("fs"),rs=Ye("path"),ag=Ye("os"),cg=Ye("crypto"),lg=Wc(),ns=lg.version,pg=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function ug(t){let e={},r=t.toString();r=r.replace(/\r\n?/mg,`
|
|
8
|
+
import{a as Ki,c as Ji}from"./chunks/OFAMJNQ6.js";import{a as Li,b as Di,c as lt,d as Mi,e as Rn,f as Qe,g as Jt,h as ki,i as Fi,j as Io,k as Ui,l as Cr,m as Ie,n as _n,o as qi,p as Wi,q as zi,r as Vi,s as Xr,t as To,u as Et,v as Zr}from"./chunks/74WJ7S7J.js";import{a as In,b as Hi,c as Yi}from"./chunks/T5EPIBMA.js";import{a as Kt,b as z}from"./chunks/2U54VUOE.js";import{c as jn,d as Gi,f as Bi}from"./chunks/U2H2LXZE.js";import"./chunks/O6PRCLSV.js";import{a as An,b as Er,c as jo,d as Ti,e as Pn,f as Ni,g as $n,h as Jr}from"./chunks/5SAFIITS.js";import{a as ji,c as vn,d as _o}from"./chunks/P26PQ2RU.js";import"./chunks/RS5PUOTT.js";import{a as ct,b as Ri,c as _i}from"./chunks/6VSHPQXO.js";import{a as Ii}from"./chunks/BXI4SF2U.js";import"./chunks/32XCOMOR.js";import{$ as vi,A as Ei,B as Ci,C as Oi,D as Ee,F as qe,G as fe,H as ee,I as Z,J as at,K as be,L as Ve,M as me,N as Hr,O as g,Q as wr,R as wt,T as xi,U as Ai,W as St,X as Cn,Y as Yr,_ as Kr,a as ui,aa as Sr,b as Dt,c as te,ca as Pi,d as At,da as jt,ea as On,f as fi,fa as xn,g as mi,ga as Ke,h as Sn,i as Ro,j as di,ja as $i,l as Le,la as de,n as ze,o as hi,p as En,q as De,r as gi,s as yi,t as bi,u as br,y as wi,z as Si}from"./chunks/HJ36YGCI.js";import"./chunks/NEWT5A6S.js";import{a as Ye,c as G,e as _t}from"./chunks/RFWIIJFG.js";var Or=G((Nw,Xi)=>{"use strict";var Qf="2.0.0",em=Number.MAX_SAFE_INTEGER||9007199254740991,tm=16,rm=250,nm=["major","premajor","minor","preminor","patch","prepatch","prerelease"];Xi.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:tm,MAX_SAFE_BUILD_LENGTH:rm,MAX_SAFE_INTEGER:em,RELEASE_TYPES:nm,SEMVER_SPEC_VERSION:Qf,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Qr=G((Lw,Zi)=>{"use strict";var om=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};Zi.exports=om});var xr=G((vt,Qi)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:No,MAX_SAFE_BUILD_LENGTH:sm,MAX_LENGTH:im}=Or(),am=Qr();vt=Qi.exports={};var cm=vt.re=[],lm=vt.safeRe=[],j=vt.src=[],pm=vt.safeSrc=[],I=vt.t={},um=0,Lo="[a-zA-Z0-9-]",fm=[["\\s",1],["\\d",im],[Lo,sm]],mm=t=>{for(let[e,r]of fm)t=t.split(`${e}*`).join(`${e}{0,${r}}`).split(`${e}+`).join(`${e}{1,${r}}`);return t},Q=(t,e,r)=>{let n=mm(e),o=um++;am(t,o,e),I[t]=o,j[o]=e,pm[o]=n,cm[o]=new RegExp(e,r?"g":void 0),lm[o]=new RegExp(n,r?"g":void 0)};Q("NUMERICIDENTIFIER","0|[1-9]\\d*");Q("NUMERICIDENTIFIERLOOSE","\\d+");Q("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Lo}*`);Q("MAINVERSION",`(${j[I.NUMERICIDENTIFIER]})\\.(${j[I.NUMERICIDENTIFIER]})\\.(${j[I.NUMERICIDENTIFIER]})`);Q("MAINVERSIONLOOSE",`(${j[I.NUMERICIDENTIFIERLOOSE]})\\.(${j[I.NUMERICIDENTIFIERLOOSE]})\\.(${j[I.NUMERICIDENTIFIERLOOSE]})`);Q("PRERELEASEIDENTIFIER",`(?:${j[I.NONNUMERICIDENTIFIER]}|${j[I.NUMERICIDENTIFIER]})`);Q("PRERELEASEIDENTIFIERLOOSE",`(?:${j[I.NONNUMERICIDENTIFIER]}|${j[I.NUMERICIDENTIFIERLOOSE]})`);Q("PRERELEASE",`(?:-(${j[I.PRERELEASEIDENTIFIER]}(?:\\.${j[I.PRERELEASEIDENTIFIER]})*))`);Q("PRERELEASELOOSE",`(?:-?(${j[I.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${j[I.PRERELEASEIDENTIFIERLOOSE]})*))`);Q("BUILDIDENTIFIER",`${Lo}+`);Q("BUILD",`(?:\\+(${j[I.BUILDIDENTIFIER]}(?:\\.${j[I.BUILDIDENTIFIER]})*))`);Q("FULLPLAIN",`v?${j[I.MAINVERSION]}${j[I.PRERELEASE]}?${j[I.BUILD]}?`);Q("FULL",`^${j[I.FULLPLAIN]}$`);Q("LOOSEPLAIN",`[v=\\s]*${j[I.MAINVERSIONLOOSE]}${j[I.PRERELEASELOOSE]}?${j[I.BUILD]}?`);Q("LOOSE",`^${j[I.LOOSEPLAIN]}$`);Q("GTLT","((?:<|>)?=?)");Q("XRANGEIDENTIFIERLOOSE",`${j[I.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);Q("XRANGEIDENTIFIER",`${j[I.NUMERICIDENTIFIER]}|x|X|\\*`);Q("XRANGEPLAIN",`[v=\\s]*(${j[I.XRANGEIDENTIFIER]})(?:\\.(${j[I.XRANGEIDENTIFIER]})(?:\\.(${j[I.XRANGEIDENTIFIER]})(?:${j[I.PRERELEASE]})?${j[I.BUILD]}?)?)?`);Q("XRANGEPLAINLOOSE",`[v=\\s]*(${j[I.XRANGEIDENTIFIERLOOSE]})(?:\\.(${j[I.XRANGEIDENTIFIERLOOSE]})(?:\\.(${j[I.XRANGEIDENTIFIERLOOSE]})(?:${j[I.PRERELEASELOOSE]})?${j[I.BUILD]}?)?)?`);Q("XRANGE",`^${j[I.GTLT]}\\s*${j[I.XRANGEPLAIN]}$`);Q("XRANGELOOSE",`^${j[I.GTLT]}\\s*${j[I.XRANGEPLAINLOOSE]}$`);Q("COERCEPLAIN",`(^|[^\\d])(\\d{1,${No}})(?:\\.(\\d{1,${No}}))?(?:\\.(\\d{1,${No}}))?`);Q("COERCE",`${j[I.COERCEPLAIN]}(?:$|[^\\d])`);Q("COERCEFULL",j[I.COERCEPLAIN]+`(?:${j[I.PRERELEASE]})?(?:${j[I.BUILD]})?(?:$|[^\\d])`);Q("COERCERTL",j[I.COERCE],!0);Q("COERCERTLFULL",j[I.COERCEFULL],!0);Q("LONETILDE","(?:~>?)");Q("TILDETRIM",`(\\s*)${j[I.LONETILDE]}\\s+`,!0);vt.tildeTrimReplace="$1~";Q("TILDE",`^${j[I.LONETILDE]}${j[I.XRANGEPLAIN]}$`);Q("TILDELOOSE",`^${j[I.LONETILDE]}${j[I.XRANGEPLAINLOOSE]}$`);Q("LONECARET","(?:\\^)");Q("CARETTRIM",`(\\s*)${j[I.LONECARET]}\\s+`,!0);vt.caretTrimReplace="$1^";Q("CARET",`^${j[I.LONECARET]}${j[I.XRANGEPLAIN]}$`);Q("CARETLOOSE",`^${j[I.LONECARET]}${j[I.XRANGEPLAINLOOSE]}$`);Q("COMPARATORLOOSE",`^${j[I.GTLT]}\\s*(${j[I.LOOSEPLAIN]})$|^$`);Q("COMPARATOR",`^${j[I.GTLT]}\\s*(${j[I.FULLPLAIN]})$|^$`);Q("COMPARATORTRIM",`(\\s*)${j[I.GTLT]}\\s*(${j[I.LOOSEPLAIN]}|${j[I.XRANGEPLAIN]})`,!0);vt.comparatorTrimReplace="$1$2$3";Q("HYPHENRANGE",`^\\s*(${j[I.XRANGEPLAIN]})\\s+-\\s+(${j[I.XRANGEPLAIN]})\\s*$`);Q("HYPHENRANGELOOSE",`^\\s*(${j[I.XRANGEPLAINLOOSE]})\\s+-\\s+(${j[I.XRANGEPLAINLOOSE]})\\s*$`);Q("STAR","(<|>)?=?\\s*\\*");Q("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");Q("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Tn=G((Dw,ea)=>{"use strict";var dm=Object.freeze({loose:!0}),hm=Object.freeze({}),gm=t=>t?typeof t!="object"?dm:t:hm;ea.exports=gm});var Do=G((Mw,na)=>{"use strict";var ta=/^[0-9]+$/,ra=(t,e)=>{if(typeof t=="number"&&typeof e=="number")return t===e?0:t<e?-1:1;let r=ta.test(t),n=ta.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t<e?-1:1},ym=(t,e)=>ra(e,t);na.exports={compareIdentifiers:ra,rcompareIdentifiers:ym}});var Me=G((kw,sa)=>{"use strict";var Nn=Qr(),{MAX_LENGTH:oa,MAX_SAFE_INTEGER:Ln}=Or(),{safeRe:Dn,t:Mn}=xr(),bm=Tn(),{compareIdentifiers:Mo}=Do(),wm=(t,e)=>{let r=e.split(".");if(r.length>t.length)return!1;for(let n=0;n<r.length;n++)if(Mo(t[n],r[n])!==0)return!1;return!0},ko=class t{constructor(e,r){if(r=bm(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>oa)throw new TypeError(`version is longer than ${oa} characters`);Nn("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=e.trim().match(r.loose?Dn[Mn.LOOSE]:Dn[Mn.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>Ln||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Ln||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Ln||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<Ln)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(Nn("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(Nn("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 Mo(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(Nn("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 Mo(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?Dn[Mn.PRERELEASELOOSE]:Dn[Mn.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]),wm(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}};sa.exports=ko});var Mt=G((Fw,aa)=>{"use strict";var ia=Me(),Sm=(t,e,r=!1)=>{if(t instanceof ia)return t;try{return new ia(t,e)}catch(n){if(!r)return null;throw n}};aa.exports=Sm});var la=G((Uw,ca)=>{"use strict";var Em=Mt(),Cm=(t,e)=>{let r=Em(t,e);return r?r.version:null};ca.exports=Cm});var ua=G((qw,pa)=>{"use strict";var Om=Mt(),xm=(t,e)=>{let r=Om(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null};pa.exports=xm});var da=G((Ww,ma)=>{"use strict";var fa=Me(),Am=(t,e,r,n,o)=>{typeof r=="string"&&(o=n,n=r,r=void 0);try{return new fa(t instanceof fa?t.version:t,r).inc(e,n,o).version}catch{return null}};ma.exports=Am});var ya=G((zw,ga)=>{"use strict";var ha=Mt(),vm=(t,e)=>{let r=ha(t,null,!0),n=ha(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"};ga.exports=vm});var wa=G((Vw,ba)=>{"use strict";var Pm=Me(),$m=(t,e)=>new Pm(t,e).major;ba.exports=$m});var Ea=G((Gw,Sa)=>{"use strict";var Rm=Me(),_m=(t,e)=>new Rm(t,e).minor;Sa.exports=_m});var Oa=G((Bw,Ca)=>{"use strict";var jm=Me(),Im=(t,e)=>new jm(t,e).patch;Ca.exports=Im});var Aa=G((Hw,xa)=>{"use strict";var Tm=Mt(),Nm=(t,e)=>{let r=Tm(t,e);return r&&r.prerelease.length?r.prerelease:null};xa.exports=Nm});var pt=G((Yw,Pa)=>{"use strict";var va=Me(),Lm=(t,e,r)=>new va(t,r).compare(new va(e,r));Pa.exports=Lm});var Ra=G((Kw,$a)=>{"use strict";var Dm=pt(),Mm=(t,e,r)=>Dm(e,t,r);$a.exports=Mm});var ja=G((Jw,_a)=>{"use strict";var km=pt(),Fm=(t,e)=>km(t,e,!0);_a.exports=Fm});var kn=G((Xw,Ta)=>{"use strict";var Ia=Me(),Um=(t,e,r)=>{let n=new Ia(t,r),o=new Ia(e,r);return n.compare(o)||n.compareBuild(o)};Ta.exports=Um});var La=G((Zw,Na)=>{"use strict";var qm=kn(),Wm=(t,e)=>t.sort((r,n)=>qm(r,n,e));Na.exports=Wm});var Ma=G((Qw,Da)=>{"use strict";var zm=kn(),Vm=(t,e)=>t.sort((r,n)=>zm(n,r,e));Da.exports=Vm});var en=G((eS,ka)=>{"use strict";var Gm=pt(),Bm=(t,e,r)=>Gm(t,e,r)>0;ka.exports=Bm});var Fn=G((tS,Fa)=>{"use strict";var Hm=pt(),Ym=(t,e,r)=>Hm(t,e,r)<0;Fa.exports=Ym});var Fo=G((rS,Ua)=>{"use strict";var Km=pt(),Jm=(t,e,r)=>Km(t,e,r)===0;Ua.exports=Jm});var Uo=G((nS,qa)=>{"use strict";var Xm=pt(),Zm=(t,e,r)=>Xm(t,e,r)!==0;qa.exports=Zm});var Un=G((oS,Wa)=>{"use strict";var Qm=pt(),ed=(t,e,r)=>Qm(t,e,r)>=0;Wa.exports=ed});var qn=G((sS,za)=>{"use strict";var td=pt(),rd=(t,e,r)=>td(t,e,r)<=0;za.exports=rd});var qo=G((iS,Va)=>{"use strict";var nd=Fo(),od=Uo(),sd=en(),id=Un(),ad=Fn(),cd=qn(),ld=(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 nd(t,r,n);case"!=":return od(t,r,n);case">":return sd(t,r,n);case">=":return id(t,r,n);case"<":return ad(t,r,n);case"<=":return cd(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}};Va.exports=ld});var Ba=G((aS,Ga)=>{"use strict";var pd=Me(),ud=Mt(),{safeRe:Wn,t:zn}=xr(),fd=(t,e)=>{if(t instanceof pd)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?Wn[zn.COERCEFULL]:Wn[zn.COERCE]);else{let c=e.includePrerelease?Wn[zn.COERCERTLFULL]:Wn[zn.COERCERTL],l;for(;(l=c.exec(t))&&(!r||r.index+r[0].length!==t.length);)(!r||l.index+l[0].length!==r.index+r[0].length)&&(r=l),c.lastIndex=l.index+l[1].length+l[2].length;c.lastIndex=-1}if(r===null)return null;let n=r[2],o=r[3]||"0",s=r[4]||"0",i=e.includePrerelease&&r[5]?`-${r[5]}`:"",a=e.includePrerelease&&r[6]?`+${r[6]}`:"";return ud(`${n}.${o}.${s}${i}${a}`,e)};Ga.exports=fd});var Ya=G((cS,Ha)=>{"use strict";var md=Mt(),dd=Or(),hd=Me(),gd=(t,e,r)=>{if(!dd.RELEASE_TYPES.includes(e))return null;let n=yd(t,r);return n&&bd(n,e)},yd=(t,e)=>{let r=t instanceof hd?t.version:t;return md(r,e)},bd=(t,e)=>{if(wd(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()},wd=t=>t.startsWith("pre");Ha.exports=gd});var Ja=G((lS,Ka)=>{"use strict";var Wo=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}};Ka.exports=Wo});var ut=G((pS,ec)=>{"use strict";var Sd=/\s+/g,zo=class t{constructor(e,r){if(r=Cd(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof Vo)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(Sd," "),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=>!Za(o[0])),this.set.length===0)this.set=[n];else if(this.set.length>1){for(let o of this.set)if(o.length===1&&jd(o[0])){this.set=[o];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let r=this.set[e];for(let n=0;n<r.length;n++)n>0&&(this.formatted+=" "),this.formatted+=r[n].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){e=e.replace(_d,"");let n=((this.options.includePrerelease&&$d)|(this.options.loose&&Rd))+":"+e,o=Xa.get(n);if(o)return o;let s=this.options.loose,i=s?Ge[ke.HYPHENRANGELOOSE]:Ge[ke.HYPHENRANGE];e=e.replace(i,Wd(this.options.includePrerelease)),he("hyphen replace",e),e=e.replace(Ge[ke.COMPARATORTRIM],Ad),he("comparator trim",e),e=e.replace(Ge[ke.TILDETRIM],vd),he("tilde trim",e),e=e.replace(Ge[ke.CARETTRIM],Pd),he("caret trim",e);let a=e.split(" ").map(p=>Id(p,this.options)).join(" ").split(/\s+/).map(p=>qd(p,this.options));s&&(a=a.filter(p=>(he("loose invalid filter",p,this.options),!!p.match(Ge[ke.COMPARATORLOOSE])))),he("range list",a);let c=new Map,l=a.map(p=>new Vo(p,this.options));for(let p of l){if(Za(p))return[p];c.set(p.value,p)}c.size>1&&c.has("")&&c.delete("");let u=[...c.values()];return Xa.set(n,u),u}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(n=>Qa(n,r)&&e.set.some(o=>Qa(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 Od(e,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(zd(this.set[r],e,this.options))return!0;return!1}};ec.exports=zo;var Ed=Ja(),Xa=new Ed,Cd=Tn(),Vo=tn(),he=Qr(),Od=Me(),{safeRe:Ge,src:xd,t:ke,comparatorTrimReplace:Ad,tildeTrimReplace:vd,caretTrimReplace:Pd}=xr(),{FLAG_INCLUDE_PRERELEASE:$d,FLAG_LOOSE:Rd}=Or(),_d=new RegExp(xd[ke.BUILD],"g"),Za=t=>t.value==="<0.0.0-0",jd=t=>t.value==="",Qa=(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},Id=(t,e)=>(t=t.replace(Ge[ke.BUILD],""),he("comp",t,e),t=Dd(t,e),he("caret",t),t=Nd(t,e),he("tildes",t),t=kd(t,e),he("xrange",t),t=Ud(t,e),he("stars",t),t),$e=t=>!t||t.toLowerCase()==="x"||t==="*",Td=(t,e,r)=>$e(t)&&!$e(e)||$e(e)&&r&&!$e(r),Nd=(t,e)=>t.trim().split(/\s+/).map(r=>Ld(r,e)).join(" "),Ld=(t,e)=>{let r=e.loose?Ge[ke.TILDELOOSE]:Ge[ke.TILDE],n=e.includePrerelease?"-0":"";return t.replace(r,(o,s,i,a,c)=>{he("tilde",t,o,s,i,a,c);let l;return $e(s)?l="":$e(i)?l=`>=${s}.0.0${n} <${+s+1}.0.0-0`:$e(a)?l=`>=${s}.${i}.0${n} <${s}.${+i+1}.0-0`:c?(he("replaceTilde pr",c),l=`>=${s}.${i}.${a}-${c} <${s}.${+i+1}.0-0`):l=`>=${s}.${i}.${a} <${s}.${+i+1}.0-0`,he("tilde return",l),l})},Dd=(t,e)=>t.trim().split(/\s+/).map(r=>Md(r,e)).join(" "),Md=(t,e)=>{he("caret",t,e);let r=e.loose?Ge[ke.CARETLOOSE]:Ge[ke.CARET],n=e.includePrerelease?"-0":"";return t.replace(r,(o,s,i,a,c)=>{he("caret",t,o,s,i,a,c);let l;return $e(s)?l="":$e(i)?l=`>=${s}.0.0${n} <${+s+1}.0.0-0`:$e(a)?s==="0"?l=`>=${s}.${i}.0${n} <${s}.${+i+1}.0-0`:l=`>=${s}.${i}.0${n} <${+s+1}.0.0-0`:c?(he("replaceCaret pr",c),s==="0"?i==="0"?l=`>=${s}.${i}.${a}-${c} <${s}.${i}.${+a+1}-0`:l=`>=${s}.${i}.${a}-${c} <${s}.${+i+1}.0-0`:l=`>=${s}.${i}.${a}-${c} <${+s+1}.0.0-0`):(he("no pr"),s==="0"?i==="0"?l=`>=${s}.${i}.${a} <${s}.${i}.${+a+1}-0`:l=`>=${s}.${i}.${a} <${s}.${+i+1}.0-0`:l=`>=${s}.${i}.${a} <${+s+1}.0.0-0`),he("caret return",l),l})},kd=(t,e)=>(he("replaceXRanges",t,e),t.split(/\s+/).map(r=>Fd(r,e)).join(" ")),Fd=(t,e)=>{t=t.trim();let r=e.loose?Ge[ke.XRANGELOOSE]:Ge[ke.XRANGE];return t.replace(r,(n,o,s,i,a,c)=>{if(he("xRange",t,n,o,s,i,a,c),Td(s,i,a))return t;let l=$e(s),u=l||$e(i),p=u||$e(a),m=p;return o==="="&&m&&(o=""),c=e.includePrerelease?"-0":"",l?o===">"||o==="<"?n="<0.0.0-0":n="*":o&&m?(u&&(i=0),a=0,o===">"?(o=">=",u?(s=+s+1,i=0,a=0):(i=+i+1,a=0)):o==="<="&&(o="<",u?s=+s+1:i=+i+1),o==="<"&&(c="-0"),n=`${o+s}.${i}.${a}${c}`):u?n=`>=${s}.0.0${c} <${+s+1}.0.0-0`:p&&(n=`>=${s}.${i}.0${c} <${s}.${+i+1}.0-0`),he("xRange return",n),n})},Ud=(t,e)=>(he("replaceStars",t,e),t.trim().replace(Ge[ke.STAR],"")),qd=(t,e)=>(he("replaceGTE0",t,e),t.trim().replace(Ge[e.includePrerelease?ke.GTE0PRE:ke.GTE0],"")),Wd=t=>(e,r,n,o,s,i,a,c,l,u,p,m)=>($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`:m?c=`<=${l}.${u}.${p}-${m}`:t?c=`<${l}.${u}.${+p+1}-0`:c=`<=${c}`,`${r} ${c}`.trim()),zd=(t,e,r)=>{for(let n=0;n<t.length;n++)if(!t[n].test(e))return!1;if(e.prerelease.length&&!r.includePrerelease){for(let n=0;n<t.length;n++)if(he(t[n].semver),t[n].semver!==Vo.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 tn=G((uS,ic)=>{"use strict";var rn=Symbol("SemVer ANY"),Ho=class t{static get ANY(){return rn}constructor(e,r){if(r=tc(r),e instanceof t){if(e.loose===!!r.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),Bo("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===rn?this.value="":this.value=this.operator+this.semver.version,Bo("comp",this)}parse(e){let r=this.options.loose?rc[nc.COMPARATORLOOSE]:rc[nc.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 oc(n[2],this.options.loose):this.semver=rn}toString(){return this.value}test(e){if(Bo("Comparator.test",e,this.options.loose),this.semver===rn||e===rn)return!0;if(typeof e=="string")try{e=new oc(e,this.options)}catch{return!1}return Go(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 sc(e.value,r).test(this.value):e.operator===""?e.value===""?!0:new sc(this.value,r).test(e.semver):(r=tc(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("=")||Go(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||Go(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};ic.exports=Ho;var tc=Tn(),{safeRe:rc,t:nc}=xr(),Go=qo(),Bo=Qr(),oc=Me(),sc=ut()});var nn=G((fS,ac)=>{"use strict";var Vd=ut(),Gd=(t,e,r)=>{try{e=new Vd(e,r)}catch{return!1}return e.test(t)};ac.exports=Gd});var lc=G((mS,cc)=>{"use strict";var Bd=ut(),Hd=(t,e)=>new Bd(t,e).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));cc.exports=Hd});var uc=G((dS,pc)=>{"use strict";var Yd=Me(),Kd=ut(),Jd=(t,e,r)=>{let n=null,o=null,s=null;try{s=new Kd(e,r)}catch{return null}return t.forEach(i=>{s.test(i)&&(!n||o.compare(i)===-1)&&(n=i,o=new Yd(n,r))}),n};pc.exports=Jd});var mc=G((hS,fc)=>{"use strict";var Xd=Me(),Zd=ut(),Qd=(t,e,r)=>{let n=null,o=null,s=null;try{s=new Zd(e,r)}catch{return null}return t.forEach(i=>{s.test(i)&&(!n||o.compare(i)===1)&&(n=i,o=new Xd(n,r))}),n};fc.exports=Qd});var gc=G((gS,hc)=>{"use strict";var Yo=Me(),eh=ut(),dc=en(),th=(t,e)=>{t=new eh(t,e);let r=new Yo("0.0.0");if(t.test(r)||(r=new Yo("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 Yo(i.semver.version);switch(i.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!s||dc(a,s))&&(s=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${i.operator}`)}}),s&&(!r||dc(r,s))&&(r=s)}return r&&t.test(r)?r:null};hc.exports=th});var bc=G((yS,yc)=>{"use strict";var rh=ut(),nh=(t,e)=>{try{return new rh(t,e).range||"*"}catch{return null}};yc.exports=nh});var Vn=G((bS,Cc)=>{"use strict";var oh=Me(),Ec=tn(),{ANY:sh}=Ec,ih=ut(),ah=nn(),wc=en(),Sc=Fn(),ch=qn(),lh=Un(),ph=(t,e,r,n)=>{t=new oh(t,n),e=new ih(e,n);let o,s,i,a,c;switch(r){case">":o=wc,s=ch,i=Sc,a=">",c=">=";break;case"<":o=Sc,s=lh,i=wc,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(ah(t,e,n))return!1;for(let l=0;l<e.set.length;++l){let u=e.set[l],p=null,m=null;if(u.forEach(d=>{d.semver===sh&&(d=new Ec(">=0.0.0")),p=p||d,m=m||d,o(d.semver,p.semver,n)?p=d:i(d.semver,m.semver,n)&&(m=d)}),p.operator===a||p.operator===c||(!m.operator||m.operator===a)&&s(t,m.semver))return!1;if(m.operator===c&&i(t,m.semver))return!1}return!0};Cc.exports=ph});var xc=G((wS,Oc)=>{"use strict";var uh=Vn(),fh=(t,e,r)=>uh(t,e,">",r);Oc.exports=fh});var vc=G((SS,Ac)=>{"use strict";var mh=Vn(),dh=(t,e,r)=>mh(t,e,"<",r);Ac.exports=dh});var Rc=G((ES,$c)=>{"use strict";var Pc=ut(),hh=(t,e,r)=>(t=new Pc(t,r),e=new Pc(e,r),t.intersects(e,r));$c.exports=hh});var jc=G((CS,_c)=>{"use strict";var gh=nn(),yh=pt();_c.exports=(t,e,r)=>{let n=[],o=null,s=null,i=t.sort((u,p)=>yh(u,p,r));for(let u of i)gh(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 Mc=G((OS,Dc)=>{"use strict";var Ic=ut(),Xo=tn(),{ANY:Ko}=Xo,Jo=nn(),Zo=pt(),bh=(t,e,r={})=>{if(t===e)return!0;t=new Ic(t,r),e=new Ic(e,r);let n=!1;e:for(let o of t.set){for(let s of e.set){let i=Sh(o,s,r);if(n=n||i!==null,i)continue e}if(n)return!1}return!0},wh=[new Xo(">=0.0.0-0")],Tc=[new Xo(">=0.0.0")],Sh=(t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===Ko){if(e.length===1&&e[0].semver===Ko)return!0;r.includePrerelease?t=wh:t=Tc}if(e.length===1&&e[0].semver===Ko){if(r.includePrerelease)return!0;e=Tc}let n=new Set,o,s;for(let d of t)d.operator===">"||d.operator===">="?o=Nc(o,d,r):d.operator==="<"||d.operator==="<="?s=Lc(s,d,r):n.add(d.semver);if(n.size>1)return null;let i;if(o&&s){if(i=Zo(o.semver,s.semver,r),i>0)return null;if(i===0&&(o.operator!==">="||s.operator!=="<="))return null}for(let d of n){if(o&&!Jo(d,String(o),r)||s&&!Jo(d,String(s),r))return null;for(let b of e)if(!Jo(d,String(b),r))return!1;return!0}let a,c,l,u,p=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1,m=o&&!r.includePrerelease&&o.semver.prerelease.length?o.semver:!1;p&&p.prerelease.length===1&&s.operator==="<"&&p.prerelease[0]===0&&(p=!1);for(let d of e){if(u=u||d.operator===">"||d.operator===">=",l=l||d.operator==="<"||d.operator==="<=",o){if(m&&d.semver.prerelease&&d.semver.prerelease.length&&d.semver.major===m.major&&d.semver.minor===m.minor&&d.semver.patch===m.patch&&(m=!1),d.operator===">"||d.operator===">="){if(a=Nc(o,d,r),a===d&&a!==o)return!1}else if(o.operator===">="&&!d.test(o.semver))return!1}if(s){if(p&&d.semver.prerelease&&d.semver.prerelease.length&&d.semver.major===p.major&&d.semver.minor===p.minor&&d.semver.patch===p.patch&&(p=!1),d.operator==="<"||d.operator==="<="){if(c=Lc(s,d,r),c===d&&c!==s)return!1}else if(s.operator==="<="&&!d.test(s.semver))return!1}if(!d.operator&&(s||o)&&i!==0)return!1}return!(o&&l&&!s&&i!==0||s&&u&&!o&&i!==0||m||p)},Nc=(t,e,r)=>{if(!t)return e;let n=Zo(t.semver,e.semver,r);return n>0?t:n<0||e.operator===">"&&t.operator===">="?e:t},Lc=(t,e,r)=>{if(!t)return e;let n=Zo(t.semver,e.semver,r);return n<0?t:n>0||e.operator==="<"&&t.operator==="<="?e:t};Dc.exports=bh});var Gn=G((xS,Uc)=>{"use strict";var Qo=xr(),kc=Or(),Eh=Me(),Fc=Do(),Ch=Mt(),Oh=la(),xh=ua(),Ah=da(),vh=ya(),Ph=wa(),$h=Ea(),Rh=Oa(),_h=Aa(),jh=pt(),Ih=Ra(),Th=ja(),Nh=kn(),Lh=La(),Dh=Ma(),Mh=en(),kh=Fn(),Fh=Fo(),Uh=Uo(),qh=Un(),Wh=qn(),zh=qo(),Vh=Ba(),Gh=Ya(),Bh=tn(),Hh=ut(),Yh=nn(),Kh=lc(),Jh=uc(),Xh=mc(),Zh=gc(),Qh=bc(),eg=Vn(),tg=xc(),rg=vc(),ng=Rc(),og=jc(),sg=Mc();Uc.exports={parse:Ch,valid:Oh,clean:xh,inc:Ah,diff:vh,major:Ph,minor:$h,patch:Rh,prerelease:_h,compare:jh,rcompare:Ih,compareLoose:Th,compareBuild:Nh,sort:Lh,rsort:Dh,gt:Mh,lt:kh,eq:Fh,neq:Uh,gte:qh,lte:Wh,cmp:zh,coerce:Vh,truncate:Gh,Comparator:Bh,Range:Hh,satisfies:Yh,toComparators:Kh,maxSatisfying:Jh,minSatisfying:Xh,minVersion:Zh,validRange:Qh,outside:eg,gtr:tg,ltr:rg,intersects:ng,simplifyRange:og,subset:sg,SemVer:Eh,re:Qo.re,src:Qo.src,tokens:Qo.t,SEMVER_SPEC_VERSION:kc.SEMVER_SPEC_VERSION,RELEASE_TYPES:kc.RELEASE_TYPES,compareIdentifiers:Fc.compareIdentifiers,rcompareIdentifiers:Fc.rcompareIdentifiers}});var Wc=G((PS,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 os=G(($S,It)=>{var ts=Ye("fs"),rs=Ye("path"),ag=Ye("os"),cg=Ye("crypto"),lg=Wc(),ns=lg.version,pg=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function ug(t){let e={},r=t.toString();r=r.replace(/\r\n?/mg,`
|
|
9
9
|
`);let n;for(;(n=pg.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
|
-
`),s=s.replace(/\\r/g,"\r")),e[o]=s}return e}function fg(t){let e=Gc(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=Vc(t).split(","),o=n.length,s;for(let i=0;i<o;i++)try{let a=n[i].trim(),c=hg(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@${ns}][INFO] ${t}`)}function dg(t){console.log(`[dotenv@${ns}][WARN] ${t}`)}function Bn(t){console.log(`[dotenv@${ns}][DEBUG] ${t}`)}function Vc(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 hg(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 Gc(t){let e=null;if(t&&t.path&&t.path.length>0)if(Array.isArray(t.path))for(let r of t.path)ts.existsSync(r)&&(e=r.endsWith(".vault")?r:`${r}.vault`);else e=t.path.endsWith(".vault")?t.path:`${t.path}.vault`;else e=rs.resolve(process.cwd(),".env.vault");return ts.existsSync(e)?e:null}function zc(t){return t[0]==="~"?rs.join(ag.homedir(),t.slice(1)):t}function gg(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 yg(t){let e=rs.resolve(process.cwd(),".env"),r="utf8",n=!!(t&&t.debug);t&&t.encoding?r=t.encoding:n&&Bn("No encoding is specified. UTF-8 is used by default");let o=[e];if(t&&t.path)if(!Array.isArray(t.path))o=[zc(t.path)];else{o=[];for(let c of t.path)o.push(zc(c))}let s,i={};for(let c of o)try{let l=Re.parse(ts.readFileSync(c,{encoding:r}));Re.populate(i,l,t)}catch(l){n&&Bn(`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 bg(t){if(Vc(t).length===0)return Re.configDotenv(t);let e=Gc(t);return e?Re._configVault(t):(dg(`You set DOTENV_KEY but you are missing a .env.vault file at ${e}. Did you forget to build it?`),Re.configDotenv(t))}function wg(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=cg.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 Sg(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&&Bn(o===!0?`"${s}" is already defined and WAS overwritten`:`"${s}" is already defined and was NOT overwritten`)):t[s]=e[s]}var Re={configDotenv:yg,_configVault:gg,_parseVault:fg,config:bg,decrypt:wg,parse:ug,populate:Sg};It.exports.configDotenv=Re.configDotenv;It.exports._configVault=Re._configVault;It.exports._parseVault=Re._parseVault;It.exports.config=Re.config;It.exports.decrypt=Re.decrypt;It.exports.parse=Re.parse;It.exports.populate=Re.populate;It.exports=Re});var Xp=G(Hs=>{"use strict";Hs.parse=ab;Hs.serialize=cb;var tb=Object.prototype.toString,rb=Object.prototype.hasOwnProperty,nb=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,ob=/^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/,sb=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,ib=/^[\u0020-\u003A\u003D-\u007E]*$/;function ab(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||lb,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=Kp(t,s,i),l=Jp(t,i,c),u=t.slice(c,l);if(!rb.call(r,u)){var p=Kp(t,i+1,a),m=Jp(t,a,p);t.charCodeAt(p)===34&&t.charCodeAt(m-1)===34&&(p++,m--);var d=t.slice(p,m);r[u]=ub(d,o)}s=a+1}while(s<n);return r}function Kp(t,e,r){do{var n=t.charCodeAt(e);if(n!==32&&n!==9)return e}while(++e<r);return r}function Jp(t,e,r){for(;e>r;){var n=t.charCodeAt(--e);if(n!==32&&n!==9)return e+1}return r}function cb(t,e,r){var n=r&&r.encode||encodeURIComponent;if(typeof n!="function")throw new TypeError("option encode is invalid");if(!nb.test(t))throw new TypeError("argument name is invalid");var o=n(e);if(!ob.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(!sb.test(r.domain))throw new TypeError("option domain is invalid");s+="; Domain="+r.domain}if(r.path){if(!ib.test(r.path))throw new TypeError("option path is invalid");s+="; Path="+r.path}if(r.expires){var a=r.expires;if(!pb(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 lb(t){return t.indexOf("%")!==-1?decodeURIComponent(t):t}function pb(t){return tb.call(t)==="[object Date]"}function ub(t,e){try{return e(t)}catch{return t}}});var tu=G((
|
|
10
|
+
`),s=s.replace(/\\r/g,"\r")),e[o]=s}return e}function fg(t){let e=Gc(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=Vc(t).split(","),o=n.length,s;for(let i=0;i<o;i++)try{let a=n[i].trim(),c=hg(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@${ns}][INFO] ${t}`)}function dg(t){console.log(`[dotenv@${ns}][WARN] ${t}`)}function Bn(t){console.log(`[dotenv@${ns}][DEBUG] ${t}`)}function Vc(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 hg(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 Gc(t){let e=null;if(t&&t.path&&t.path.length>0)if(Array.isArray(t.path))for(let r of t.path)ts.existsSync(r)&&(e=r.endsWith(".vault")?r:`${r}.vault`);else e=t.path.endsWith(".vault")?t.path:`${t.path}.vault`;else e=rs.resolve(process.cwd(),".env.vault");return ts.existsSync(e)?e:null}function zc(t){return t[0]==="~"?rs.join(ag.homedir(),t.slice(1)):t}function gg(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 yg(t){let e=rs.resolve(process.cwd(),".env"),r="utf8",n=!!(t&&t.debug);t&&t.encoding?r=t.encoding:n&&Bn("No encoding is specified. UTF-8 is used by default");let o=[e];if(t&&t.path)if(!Array.isArray(t.path))o=[zc(t.path)];else{o=[];for(let c of t.path)o.push(zc(c))}let s,i={};for(let c of o)try{let l=Re.parse(ts.readFileSync(c,{encoding:r}));Re.populate(i,l,t)}catch(l){n&&Bn(`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 bg(t){if(Vc(t).length===0)return Re.configDotenv(t);let e=Gc(t);return e?Re._configVault(t):(dg(`You set DOTENV_KEY but you are missing a .env.vault file at ${e}. Did you forget to build it?`),Re.configDotenv(t))}function wg(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=cg.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 Sg(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&&Bn(o===!0?`"${s}" is already defined and WAS overwritten`:`"${s}" is already defined and was NOT overwritten`)):t[s]=e[s]}var Re={configDotenv:yg,_configVault:gg,_parseVault:fg,config:bg,decrypt:wg,parse:ug,populate:Sg};It.exports.configDotenv=Re.configDotenv;It.exports._configVault=Re._configVault;It.exports._parseVault=Re._parseVault;It.exports.config=Re.config;It.exports.decrypt=Re.decrypt;It.exports.parse=Re.parse;It.exports.populate=Re.populate;It.exports=Re});var Xp=G(Hs=>{"use strict";Hs.parse=ab;Hs.serialize=cb;var tb=Object.prototype.toString,rb=Object.prototype.hasOwnProperty,nb=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,ob=/^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/,sb=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,ib=/^[\u0020-\u003A\u003D-\u007E]*$/;function ab(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||lb,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=Kp(t,s,i),l=Jp(t,i,c),u=t.slice(c,l);if(!rb.call(r,u)){var p=Kp(t,i+1,a),m=Jp(t,a,p);t.charCodeAt(p)===34&&t.charCodeAt(m-1)===34&&(p++,m--);var d=t.slice(p,m);r[u]=ub(d,o)}s=a+1}while(s<n);return r}function Kp(t,e,r){do{var n=t.charCodeAt(e);if(n!==32&&n!==9)return e}while(++e<r);return r}function Jp(t,e,r){for(;e>r;){var n=t.charCodeAt(--e);if(n!==32&&n!==9)return e+1}return r}function cb(t,e,r){var n=r&&r.encode||encodeURIComponent;if(typeof n!="function")throw new TypeError("option encode is invalid");if(!nb.test(t))throw new TypeError("argument name is invalid");var o=n(e);if(!ob.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(!sb.test(r.domain))throw new TypeError("option domain is invalid");s+="; Domain="+r.domain}if(r.path){if(!ib.test(r.path))throw new TypeError("option path is invalid");s+="; Path="+r.path}if(r.expires){var a=r.expires;if(!pb(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 lb(t){return t.indexOf("%")!==-1?decodeURIComponent(t):t}function pb(t){return tb.call(t)==="[object Date]"}function ub(t,e){try{return e(t)}catch{return t}}});var tu=G((AA,hn)=>{"use strict";var uo={decodeValues:!0,map:!1,silent:!1};function Ys(t){return typeof t=="string"&&!!t.trim()}function Ks(t,e){var r=t.split(";").filter(Ys),n=r.shift(),o=fb(n),s=o.name,i=o.value;e=e?Object.assign({},uo,e):uo;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 fb(t){var e="",r="",n=t.split("=");return n.length>1?(e=n.shift(),r=n.join("=")):r=t,{name:e,value:r}}function eu(t,e){if(e=e?Object.assign({},uo,e):uo,!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(Ys).reduce(function(o,s){var i=Ks(s,e);return o[i.name]=i,o},n)}else return t.filter(Ys).map(function(o){return Ks(o,e)})}function mb(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}hn.exports=eu;hn.exports.parse=eu;hn.exports.parseString=Ks;hn.exports.splitCookiesString=mb});var qc=_t(Gn(),1);import*as es from"node:process";try{let t=_i?.node;typeof t=="string"&&!qc.satisfies(es.version,t)&&g.warn(`
|
|
11
11
|
\u26A0\uFE0F Warning: failed to satisfy expected node version. Expected: "${t}", Current "${es.version}"
|
|
12
12
|
|
|
13
13
|
`)}catch{}var Xf=_t(os(),1);import*as Zf from"node:path";import{notStrictEqual as Vg,strictEqual as Gg}from"assert";var Eg={right:vg,center:Pg},Cg=0,Hn=1,Og=2,Yn=3,ss=class{constructor(e){var r;this.width=e.width,this.wrap=(r=e.wrap)!==null&&r!==void 0?r:!0,this.rows=[]}span(...e){let r=this.div(...e);r.span=!0}resetOutput(){this.rows=[]}div(...e){if(e.length===0&&this.div(""),this.wrap&&this.shouldApplyLayoutDSL(...e)&&typeof e[0]=="string")return this.applyLayoutDSL(e[0]);let r=e.map(n=>typeof n=="string"?this.colFromString(n):n);return this.rows.push(r),r}shouldApplyLayoutDSL(...e){return e.length===1&&typeof e[0]=="string"&&/[\t\n]/.test(e[0])}applyLayoutDSL(e){let r=e.split(`
|
|
@@ -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(!_r.has(r))throw ye.eject_generator_outcome="unknown-generator",new de(`
|
|
138
138
|
\u274C Unknown generator "${r}". Ejectable generators: ${[..._r].join(", ")}.
|
|
139
|
-
`);let o=Oy(),s=xy(o,r),{GENERATOR_VERSION:i}=await import("./chunks/
|
|
139
|
+
`);let o=Oy(),s=xy(o,r),{GENERATOR_VERSION:i}=await import("./chunks/YXXYE4G2.js"),a=Sy(t.dir??"./generators"),c=s===void 0?oe(a,`${r}.mjs`):oe(a,r,"index.ts"),l=yt(process.cwd(),c)||c;if(t.update){if(s===void 0){let E=Ue(oe(o,"generators",`${r}.mjs`),"utf-8");$y({name:r,asset:E,toolkitVersion:i,assetsDir:o,dir:a,target:c,printedTarget:l})}else Py({name:r,files:s,toolkitVersion:i,assetsDir:o,dir:a,targetDir:oe(a,r)});return}if(Fe(c)&&!t.force)throw ye.eject_generator_outcome="already-exists",new de(`
|
|
140
140
|
\u274C ${l} already exists. Use --update to merge the newer version in, or --force to overwrite.
|
|
141
141
|
`);Ns(pn(c),{recursive:!0});let u=s===void 0?[Ue(oe(o,"generators",`${r}.mjs`),"utf-8")]:s.map(E=>Ue(oe(o,"generators",r,E),"utf-8"));s===void 0?Oe(c,u[0],"utf-8"):s.forEach((E,v)=>{Oe(oe(a,r,E),u[v],"utf-8")});let p=Ql("client-generators",o),m=Ql(`${r}-generator`,o);Ls(a,Ms(a));let d=`./${yt(e.configPath===void 0?process.cwd():Jl(pn(e.configPath)),Jl(c)).split("\\").join("/")}`,b=ks({[Je]:i}),h=u.some(E=>E.includes(`from "${js}"`)||E.includes(`from '${js}'`)),C=vy(e.configPath,r,d),x=s===void 0?l:yt(process.cwd(),oe(a,r))+"/";g.info(`Ejected the "${r}" generator to ${x}.
|
|
142
142
|
`+(b==="added"?`Added ${Je} to devDependencies (the ejected file imports its toolkit) \u2014 run your installer.
|
|
@@ -158,7 +158,7 @@ Reference: ${Cy}
|
|
|
158
158
|
`),ye.eject_generator_outcome="success"};import{spawn as Ry}from"node:child_process";import*as lp from"node:process";var un=t=>t.replace(/[^a-zA-Z0-9 ._\-:\\/@]/g,""),pp=t=>t.replace(/[^a-zA-Z0-9@._-]/g,"");function Ir(){let t=lp.platform==="win32";return{npxExecutableName:t?"npx.cmd":"npx",sanitize:(n,o)=>t&&n?o(n):n||"",shell:t}}var up=async({argv:t})=>{g.info(`
|
|
159
159
|
Launching eject using NPX.
|
|
160
160
|
|
|
161
|
-
`);let{npxExecutableName:e,sanitize:r,shell:n}=Ir(),o=r(t.path,un),s=r(t["project-dir"],un);Ry(e,["-y","@redocly/realm","eject",`${t.type}`,o,`-d=${s}`,t.force?`--force=${t.force}`:""],{stdio:"inherit",shell:n}).on("error",a=>{throw g.info(`Eject launch failed: ${a.message}`),new Error("Eject launch failed.")})};import{writeFileSync as _y}from"node:fs";async function fp({argv:t,config:e,version:r,collectSpecData:n}){let o=t["output-file"]||"auto-generated.arazzo.yaml",s={outputFile:o,descriptionPath:t.descriptionPath,collectSpecData:n,version:r,config:e};try{let{generate:i}=await import("./chunks/
|
|
161
|
+
`);let{npxExecutableName:e,sanitize:r,shell:n}=Ir(),o=r(t.path,un),s=r(t["project-dir"],un);Ry(e,["-y","@redocly/realm","eject",`${t.type}`,o,`-d=${s}`,t.force?`--force=${t.force}`:""],{stdio:"inherit",shell:n}).on("error",a=>{throw g.info(`Eject launch failed: ${a.message}`),new Error("Eject launch failed.")})};import{writeFileSync as _y}from"node:fs";async function fp({argv:t,config:e,version:r,collectSpecData:n}){let o=t["output-file"]||"auto-generated.arazzo.yaml",s={outputFile:o,descriptionPath:t.descriptionPath,collectSpecData:n,version:r,config:e};try{let{generate:i}=await import("./chunks/4JDAOKRJ.js");g.info(me(`
|
|
162
162
|
Generating Arazzo description...
|
|
163
163
|
`));let a=await i(s);_y(o,Oi(a)),g.info(`
|
|
164
164
|
`+Z(`Arazzo description ${ee(o)} successfully generated.`)+`
|
|
@@ -166,7 +166,7 @@ Launching eject using NPX.
|
|
|
166
166
|
\u274C Failed to generate Arazzo description. Check the output file path you provided, or the OpenAPI file content.`)}}import{readFileSync as jy}from"node:fs";import{mkdir as Iy,writeFile as Ty}from"node:fs/promises";import{basename as hp,dirname as Fs,extname as gp,isAbsolute as yp,relative as mp,resolve as pr}from"node:path";var Ny=/^[a-z][a-z0-9+.-]+:/i;function bp(t,e){let{setup:r}=t;if(typeof r!="string")return t;if(Ny.test(r))throw new de(`
|
|
167
167
|
\u274C \`client.setup\` must be a local file path \u2014 remote setup modules are not supported.
|
|
168
168
|
Got: ${r}
|
|
169
|
-
`);return yp(r)?t:{...t,setup:pr(e,r)}}function Ly(t){return`${t.replace(/[\\/]/g,"_")}.client.ts`}function Dy(t){if(t.startsWith("//"))return!1;if(t.startsWith("/"))return!0;try{let e=new URL(t);return e.protocol==="http:"||e.protocol==="https:"}catch{return!1}}async function wp({argv:t,config:e}){let{AUTHORING_HELPER_NAMES:r,generateClient:n,mergeConfig:o}=await import("./chunks/
|
|
169
|
+
`);return yp(r)?t:{...t,setup:pr(e,r)}}function Ly(t){return`${t.replace(/[\\/]/g,"_")}.client.ts`}function Dy(t){if(t.startsWith("//"))return!1;if(t.startsWith("/"))return!0;try{let e=new URL(t);return e.protocol==="http:"||e.protocol==="https:"}catch{return!1}}async function wp({argv:t,config:e}){let{AUTHORING_HELPER_NAMES:r,generateClient:n,mergeConfig:o}=await import("./chunks/YXXYE4G2.js"),s=e.configPath?Fs(e.configPath):process.cwd(),i={serverUrl:t["server-url"],outputMode:t["output-mode"],runtime:t.runtime,importExt:t["import-ext"],goPackage:t["go-package"],argsStyle:t["args-style"],errorMode:t["error-mode"],dateType:t["date-type"],mockData:t["mock-data"],mockSeed:t["mock-seed"],docs:t.docs,generators:t.generator?.map(m=>m.startsWith(".")?pr(m):m),setup:t.setup===void 0?void 0:bp({setup:t.setup},process.cwd()).setup},a=e.resolvedConfig.apis??{},c=Object.keys(a).filter(m=>te(a[m].client)||a[m].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 lt(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 m of l)await My(m,u);let p=te(e.resolvedConfig.client)?e.resolvedConfig.client:{};p.cliOutput!==void 0&&t.api===void 0&&u.composable.length>0&&await ky(p.cliOutput,u)}async function My(t,{config:e,configDir:r,cliFlags:n,outputFlag:o,toolkit:s,seenOutputs:i,composable:a}){let{path:c,alias:l}=t,u=l??hp(c,gp(c)),p=e.forAlias(l),{client:m,clientOutput:d}=p.resolvedConfig,b=bp(te(m)?m:{},r),h=s.mergeConfig(b,n);Fy(h.generators??[],s.helperNames,r);let C=o!==void 0?pr(o):d!==void 0?pr(r,d):pr(r,Ly(u));if(!C.endsWith(".ts"))throw new de(`
|
|
170
170
|
\u274C output must point at a TypeScript file (ending in .ts).
|
|
171
171
|
Got: ${C}
|
|
172
172
|
`);if(i.has(C))throw new de(`
|
|
@@ -182,7 +182,7 @@ Launching eject using NPX.
|
|
|
182
182
|
`)}catch(x){let E=x instanceof Error?x.message:String(x);throw ot.generate_client_error_category=Kl(E),new de(`
|
|
183
183
|
\u274C Failed to generate client for ${u}.
|
|
184
184
|
${E}
|
|
185
|
-
`)}}async function ky(t,{configDir:e,seenOutputs:r,composable:n}){let{renderComposedCliEntry:o}=await import("./chunks/
|
|
185
|
+
`)}}async function ky(t,{configDir:e,seenOutputs:r,composable:n}){let{renderComposedCliEntry:o}=await import("./chunks/KHEMMNFU.js"),s=pr(e,t);if(!s.endsWith(".ts"))throw new de(`
|
|
186
186
|
\u274C client.cliOutput must point at a TypeScript file (ending in .ts).
|
|
187
187
|
Got: ${s}
|
|
188
188
|
`);if(r.has(s))throw new de(`
|
|
@@ -217,7 +217,7 @@ ${s} detected in project's 'package.json'`),o}catch{g.info(`Invalid 'package.jso
|
|
|
217
217
|
`);if(E._compressed=/^(gzip|compress|deflate|br)$/.test(b.headers.get("content-encoding")||""),E.response.content||(E.response.content={size:-1}),E._compressed){let ue=await C.arrayBuffer();E.response.content.size=ue.byteLength}else E.response.content.size=x?Buffer.byteLength(x):-1;let F=x?Buffer.byteLength(x):-1;E.response={headers:dn(b.headers),cookies:nu(b.headers),status:b.status,statusText:b.statusText||"",httpVersion:b.httpVersion?`HTTP/${b.httpVersion}`:"HTTP/1.1",redirectURL:b.headers.location||"",content:{size:E._compressed&&E.response.content.size!==-1?E.response.content.size:Buffer.byteLength(x),mimeType:b.headers.get("content-type")||"",text:x,compression:E._compressed&&E.response.content.size!==-1?E.response.content.size-F:0},bodySize:F,headersSize:$};let{_timestamps:D}=E;E.timings={blocked:Math.max(Gt(D.start,D.socket),.01),dns:-1,connect:Math.max(Gt(D.lookup,D.connect),-1),ssl:D.secureConnect?Math.max(Gt(D.connect,D.secureConnect),-1):-1,send:Gt(D.secureConnect||D.connect,D.sent),wait:Math.max(Gt(D.sent,D.firstByte),0),receive:Gt(D.firstByte,D.received)},E.time=Gt(D.start,D.received);let ne=[],X=E;do{let ue=X._parent;delete X._parent,ue&&ne.unshift(ue),X=ue}while(X);return m.pageref=i||"page_1",ne.forEach(ue=>{ue.pageref=m.pageref}),b.harEntry=m,Array.isArray(s?.log?.entries)&&s.log.entries.push(...ne,m),a&&(ne.forEach(ue=>{a(ue)}),a(m)),b}};function su(t){let e={};for(let r of t){let{executedWorkflows:n,globalTimeoutError:o,ctx:s,secretValues:i}=r;e[r.file]=Bi({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=>gb(i,t.workflowId,e)),o=jn([t]);return{...r,executedSteps:n,status:o.steps.failed>0?"error":o.steps.warnings>0?"warn":"success",totalRequests:o.totalRequests,totalTimeMs:t.totalTimeMs}}function gb(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:yb(o)})),totalTimeMs:n?.response?.time||0,retriesLeft:t.retriesLeft,status:bb(t.checks)}}function yb(t){return t.passed?"success":t.severity==="error"?"error":"warn"}function bb(t){let e=!1;for(let r of t){if(!r.passed&&r.severity==="error")return"error";!r.passed&&r.severity==="warn"&&(e=!0)}return e?"warn":"success"}import*as Dr from"node:fs";import*as au from"node:path";function cu(t={},e){let r={};for(let[n,o]of Object.entries(t))r[n]={clientCert:Xs(o.clientCert,e),clientKey:Xs(o.clientKey,e),caCert:Xs(o.caCert,e)};return r}function Xs(t,e){if(t)try{if(!(t.includes("-----BEGIN")&&t.includes("-----END"))){let n=au.resolve(e,t);return Dr.accessSync(n,Dr.constants.R_OK),Dr.readFileSync(n,"utf-8")}return wb(t)}catch(r){throw new Error(`Failed to read certificate: ${r.message}`)}}function wb(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(`
|
|
218
218
|
`)||"";return`${r}
|
|
219
219
|
${s}
|
|
220
|
-
${o}`}async function pu({argv:t,config:e,version:r,collectSpecData:n}){let o,s;try{let{run:i,conditionallyMaskSecrets:a}=await import("./chunks/GOJNDGZT.js"),c=e.configPath?Cb(e.configPath):process.cwd();t.mtls&&(o=cu(t.mtls,c));let l=Vp(o);t["har-output"]&&(s=Bp({version:r}),l=Js(l,{har:s}));let u=new St({http:{headers:e.resolve?.http?.headers??[],customFetch:l}}),p={files:t.files,input:t.input,server:t.server,workflow:t.workflow,skip:t.skip,verbose:t.verbose,config:e,version:r,collectSpecData:n,severity:t.severity,maxSteps:t["max-steps"],maxFetchTimeout:t["max-fetch-timeout"],executionTimeout:t["execution-timeout"],requestFileLoader:{getFileBody:async C=>{if(!Sb(C))throw new Error(`File ${C} doesn't exist or isn't readable.`);let x=Eb(C);return new File([x],Ob(C))}},envVariables:zp(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 m=performance.now(),d=await i(p);g.printNewLine(),Gp(d,g),g.printNewLine();let b=d.some(C=>C.hasProblems),h=d.some(C=>C.hasWarnings);if(t["json-output"]){let C={files:su(d),status:b?"error":h?"warn":"success",totalTime:performance.now()-m};lu(t["json-output"],Gs(C,2),"utf-8"),g.output(Z(g.indent(`JSON logs saved in ${fe(t["json-output"])}`,2))),g.printNewLine(),g.printNewLine()}if(t["har-output"])for(let C of d){let x=a({value:s,noSecretsMasking:C.ctx.noSecretsMasking,secretsSet:C.ctx.secretsSet||new Set});lu(t["har-output"],Gs(x,2),"utf-8"),g.output(Z(`Har logs saved in ${fe(t["har-output"])}`)),g.printNewLine(),g.printNewLine()}if(b)throw new Error(" Tests exited with error ")}catch(i){throw new de(i?.message??i)}}function fu(t){if(Array.isArray(t)){let e={};for(let r of t)if(r&&typeof r=="string"){let n=uu(r);Object.assign(e,n)}return Object.keys(e).length>0?e:void 0}if(!(!t||typeof t!="string"))return uu(t)}function uu(t){try{let e=JSON.parse(t);if(!te(e))throw new Error("mTLS config must be an object mapping domains to certificate configurations");for(let[r,n]of Object.entries(e)){if(!te(n))throw new Error(`mTLS config for domain "${r}" must be an object`);Zs(n,"clientCert",r,!0),Zs(n,"clientKey",r,!0),Zs(n,"caCert",r,!1)}return e}catch(e){throw e instanceof SyntaxError?new Error(`Invalid JSON for --mtls option: ${e.message}`):e}}function Zs(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 Wb}from"perf_hooks";var $t={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 mo(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 xb(t,e,r=$t){let{thresholds:n,weights:o}=r,s=bt(1-t.parameterCount/(n.maxParamsGood*2)),a=Math.max(t.maxRequestSchemaDepth,t.maxResponseSchemaDepth)/(n.maxDepthGood*2),c=du(t,o.anyOfPenaltyMultiplier)/(n.maxPolymorphismGood*3),l=bt(1-a-c),u=(t.operationDescriptionPresent?1:0)+t.paramsWithDescription+t.schemaPropertiesWithDescription,p=1+t.parameterCount+t.totalSchemaProperties,m=p>0?bt(u/p):1,d=t.totalSchemaProperties>0?bt(t.constraintCount/t.totalSchemaProperties):1,b=(t.requestExamplePresent?1:0)+(t.responseExamplePresent?1:0),h=(t.requestBodyPresent?1:0)+1,C=bt(b/h),x=t.totalErrorResponses>0?bt(t.structuredErrorResponseCount/t.totalErrorResponses):1,E=bt(1-e/(n.maxDependencyDepthGood*2)),v=bt(1-t.ambiguousIdentifierCount/Math.max(n.maxAmbiguousGood+3,1)),O=du(t,o.anyOfPenaltyMultiplier),$=O===0?1:t.hasDiscriminator?bt(1-O/(n.maxPolymorphismGood*4)):bt(1-O/(n.maxPolymorphismGood*2));return{parameterSimplicity:s,schemaSimplicity:l,documentationQuality:m,constraintClarity:d,exampleCoverage:C,errorClarity:x,dependencyClarity:E,identifierClarity:v,polymorphismClarity:$}}function Ab(t,e=$t){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 wu(bt(n)*100)}function hu(t,e,r=$t){let n=new Map;for(let[o,s]of t.operations){let i=e.get(o)??0,a=xb(s,i,r);n.set(o,{agentReadiness:Ab(a,r),subscores:a})}return n}function gu(t,e=$t){return bt(1-t/e.thresholds.maxOperationsForDiscoverability)}function yu(t,e,r=$t){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:wu(mo(n)*(1-o)+s*o)}}function Qs(t,e,r){return t-e+e*r}function du(t,e){return Qs(t.polymorphismCount,t.anyOfCount,e)}function bt(t){return Math.max(0,Math.min(1,t))}function bu(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 wu(t){return Math.round(t*10)/10}function Su(t,e,r){let n=Math.max(1,t);return e/n+r/n}function vb(t,e){return e.totalSchemaProperties>t.totalSchemaProperties?!0:e.totalSchemaProperties<t.totalSchemaProperties?!1:Su(e.totalSchemaProperties,e.schemaPropertiesWithDescription,e.constraintCount)>Su(t.totalSchemaProperties,t.schemaPropertiesWithDescription,t.constraintCount)}var Pb=["enum","const","format","pattern","minimum","maximum","minLength","maxLength","minItems","maxItems","minProperties","maxProperties","multipleOf","exclusiveMinimum","exclusiveMaximum","uniqueItems"];function ei(){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 Ou(t){Object.assign(t,ei())}function xu(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 Pb)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(te(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 Au(t,e,r){return{operations:new Map,currentPath:"",pathLevelParams:[],current:null,walkSchema:t,anyOfPenaltyMultiplier:e,debugOperationId:r,debugLogs:[]}}function $b(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 Rb(t){let{inRequestBody:e,inResponse:r,currentResponseCode:n,errorStructuredCounted:o,maxEffectivePolymorphism:s,...i}=t;return i}function vu(t){return{RequestBody:{enter(){t.current&&(t.current.requestBodyPresent=!0,t.current.inRequestBody=!0)},leave(){t.current&&(t.current.inRequestBody=!1)}},Response:{enter(e,r){let n=t.current;if(!n)return;let o=String(r.key);n.inResponse=!0,n.currentResponseCode=o,n.errorStructuredCounted=!1,Cu(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&&(jb(e)&&(r.inRequestBody&&(r.requestExamplePresent=!0),r.inResponse&&(r.responseExamplePresent=!0)),r.inResponse&&Cu(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);vb(r,o)&&(r.totalSchemaProperties=o.totalSchemaProperties,r.schemaPropertiesWithDescription=o.schemaPropertiesWithDescription,r.constraintCount=o.constraintCount);let s=Qs(o.polymorphismCount,o.anyOfCount,t.anyOfPenaltyMultiplier);s>r.maxEffectivePolymorphism&&(r.maxEffectivePolymorphism=s,r.polymorphismCount=o.polymorphismCount,r.anyOfCount=o.anyOfCount),o.hasDiscriminator&&(r.hasDiscriminator=!0);for(let i of o.refsUsed)r.refsUsed.add(i);if(o.hasPropertyExamples&&(r.inRequestBody&&(r.requestExamplePresent=!0),r.inResponse&&(r.responseExamplePresent=!0)),r.inRequestBody&&(r.maxRequestSchemaDepth=Math.max(r.maxRequestSchemaDepth,o.maxDepth),r.topLevelWritableFieldCount=Math.max(r.topLevelWritableFieldCount,o.writableTopLevelFields)),r.inResponse&&(r.maxResponseSchemaDepth=Math.max(r.maxResponseSchemaDepth,o.maxDepth)),n&&o.debugEntries){let i=r.inRequestBody?"REQUEST BODY":`RESPONSE ${r.currentResponseCode}`;t.debugLogs.push({context:i,entries:o.debugEntries,totalProperties:o.totalSchemaProperties,totalPolymorphism:o.polymorphismCount,totalConstraints:o.constraintCount,maxDepth:o.maxDepth})}}}},Paths:{PathItem:{enter(e,r){t.currentPath=String(r.key),t.pathLevelParams=e.parameters??[]},Operation:{enter(e,r){let n=String(r.key),o=$b(t.currentPath,n,e);t.current=o;let s=_b(t.pathLevelParams,e.parameters??[],r.resolve);for(let i of s.values())o.parameterCount++,i.required&&o.requiredParameterCount++,i.description&&o.paramsWithDescription++,Ib(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,Rb(r)),t.current=null}}}}}}function Pu(t){return{operationCount:t.operations.size,operations:t.operations}}function Eu(t,e){return e(t).node}function _b(t,e,r){let n=new Map;for(let o of t){let s=Eu(o,r);s?.name&&s.in&&n.set(`${s.in}:${s.name}`,s)}for(let o of e){let s=Eu(o,r);s?.name&&s.in&&n.set(`${s.in}:${s.name}`,s)}return n}function jb(t){return t.example!==void 0||fi(t.examples)}function Ib(t){if(t.description)return!1;let e=(t.name??"").toLowerCase();return mu.has(e)}function Cu(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 Tb(t,e){if(!e.startsWith("#/"))return;let r=t;for(let n of e.slice(2).split("/"))r=r?.[gi(n)];return r}function $u({document:t,types:e,resolvedRefMap:r,ctx:n,debugOperationId:o,scoringConstants:s}){let i=s?.weights.anyOfPenaltyMultiplier??$t.weights.anyOfPenaltyMultiplier,a=ei(),c=xu(a),l=Yr([{severity:"warn",ruleId:"score-schema",visitor:c}],e),u=(v,O)=>{Ou(a),O&&(a.debugEntries=[]),Kr({document:{...t,parsed:v},rootType:e.Schema,normalizedVisitors:l,resolvedRefMap:r,ctx:n});let{depth:$,pendingRef:F,debugEntries:D,...ne}=a;return{...ne,refsUsed:[...a.refsUsed],debugEntries:O?a.debugEntries??void 0:void 0}},p=new Map,m=new WeakSet,d={maxDepth:0,polymorphismCount:0,anyOfCount:0,hasDiscriminator:!1,totalSchemaProperties:0,schemaPropertiesWithDescription:0,constraintCount:0,hasPropertyExamples:!1,writableTopLevelFields:0,refsUsed:[]};function b(v,O){return{maxDepth:Math.max(v.maxDepth,O.maxDepth),polymorphismCount:v.polymorphismCount+O.polymorphismCount,anyOfCount:v.anyOfCount+O.anyOfCount,hasDiscriminator:v.hasDiscriminator||O.hasDiscriminator,totalSchemaProperties:v.totalSchemaProperties+O.totalSchemaProperties,schemaPropertiesWithDescription:v.schemaPropertiesWithDescription+O.schemaPropertiesWithDescription,constraintCount:v.constraintCount+O.constraintCount,hasPropertyExamples:v.hasPropertyExamples||O.hasPropertyExamples,writableTopLevelFields:v.writableTopLevelFields+O.writableTopLevelFields,refsUsed:[...v.refsUsed,...O.refsUsed],debugEntries:v.debugEntries||O.debugEntries?[...v.debugEntries??[],...O.debugEntries??[]]:void 0}}let h=(v,O=!1)=>{let $=v,F=De(v)?v.$ref:void 0;if(F){if(!O){let Y=p.get(F);if(Y)return Y}$=Tb(t.parsed,F)??v}if(te($)&&m.has($))return{...d};te($)&&m.add($);let D=$?.oneOf,ne=$?.anyOf,X=Array.isArray(D)&&D.length>1,ue=Array.isArray(ne)&&ne.length>1,R=X||ue,P=Array.isArray($?.allOf)&&$.allOf.length>0,M=$?.discriminator,q=!R&&te(M?.mapping)?Object.values(M.mapping).filter(Y=>typeof Y=="string"&&bi(Y)).map(Y=>({$ref:Y})):null,se=Array.isArray(q)&&q.length>0,re;if(R||P||se){let Y={...$},le=null,Ne=_e=>{le=le?b(le,_e):_e},pe=(_e,it)=>{let U=h(it[0],O);for(let ce=1;ce<it.length;ce++){let ie=h(it[ce],O);ie.totalSchemaProperties>U.totalSchemaProperties&&(U=ie)}return{...U,polymorphismCount:U.polymorphismCount+it.length,anyOfCount:U.anyOfCount+(_e==="anyOf"?it.length:0),hasDiscriminator:U.hasDiscriminator||!!M}};R&&delete Y.discriminator,X&&(delete Y.oneOf,Ne(pe("oneOf",D))),ue&&(delete Y.anyOf,Ne(pe("anyOf",ne)));let Ze=null;if(se){delete Y.discriminator;let _e=h(q[0],O);for(let it=1;it<q.length;it++){let U=h(q[it],O);U.totalSchemaProperties>_e.totalSchemaProperties&&(_e=U)}Ze={..._e,polymorphismCount:_e.polymorphismCount+q.length,hasDiscriminator:!0}}let st=null;if(P){delete Y.allOf,st={...d};for(let _e of $.allOf)st=b(st,h(_e,O));st.polymorphismCount+=$.allOf.length}re=u(Y,O),st&&(re=b(re,st)),le&&(re=b(re,le)),Ze&&(re=b(re,Ze)),F&&(re={...re,refsUsed:[F,...re.refsUsed]})}else re=u(v,O);return te($)&&m.delete($),F&&!O&&p.set(F,re),re},C=Au(h,i,o),x=vu(C),E=Yr([{severity:"warn",ruleId:"score",visitor:x}],e);return Kr({document:t,rootType:e.Root,normalizedVisitors:E,resolvedRefMap:r,ctx:n}),{metrics:Pu(C),debugLogs:C.debugLogs}}function Ru(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=Nb(o,r);n.set(o,s)}return n}function Nb(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 _u(t){let e={agentReadiness:t.agentReadiness,discoverability:Math.round(t.discoverability*100),subscores:t.subscores,rawMetrics:{operationCount:t.rawMetrics.operationCount,operations:Object.fromEntries(Array.from(t.rawMetrics.operations.entries()).map(([r,n])=>{let{refsUsed:o,...s}=n;return[r,s]}))},operationScores:Object.fromEntries(t.operationScores),dependencyDepths:Object.fromEntries(t.dependencyDepths),hotspots:t.hotspots};g.output(JSON.stringify(e,null,2))}function ju(t,e=!1){Lb(t),Db(t),kb(t),e&&Fb(t),Ub(t)}function Iu(t){return t>=80?fe:t>=50?ee:qe}function Tu(t){return Iu(t)(Ee(t.toFixed(1)))}function H(t){g.output(t+`
|
|
220
|
+
${o}`}async function pu({argv:t,config:e,version:r,collectSpecData:n}){let o,s;try{let{run:i,conditionallyMaskSecrets:a}=await import("./chunks/4JDAOKRJ.js"),c=e.configPath?Cb(e.configPath):process.cwd();t.mtls&&(o=cu(t.mtls,c));let l=Vp(o);t["har-output"]&&(s=Bp({version:r}),l=Js(l,{har:s}));let u=new St({http:{headers:e.resolve?.http?.headers??[],customFetch:l}}),p={files:t.files,input:t.input,server:t.server,workflow:t.workflow,skip:t.skip,verbose:t.verbose,config:e,version:r,collectSpecData:n,severity:t.severity,maxSteps:t["max-steps"],maxFetchTimeout:t["max-fetch-timeout"],executionTimeout:t["execution-timeout"],requestFileLoader:{getFileBody:async C=>{if(!Sb(C))throw new Error(`File ${C} doesn't exist or isn't readable.`);let x=Eb(C);return new File([x],Ob(C))}},envVariables:zp(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 m=performance.now(),d=await i(p);g.printNewLine(),Gp(d,g),g.printNewLine();let b=d.some(C=>C.hasProblems),h=d.some(C=>C.hasWarnings);if(t["json-output"]){let C={files:su(d),status:b?"error":h?"warn":"success",totalTime:performance.now()-m};lu(t["json-output"],Gs(C,2),"utf-8"),g.output(Z(g.indent(`JSON logs saved in ${fe(t["json-output"])}`,2))),g.printNewLine(),g.printNewLine()}if(t["har-output"])for(let C of d){let x=a({value:s,noSecretsMasking:C.ctx.noSecretsMasking,secretsSet:C.ctx.secretsSet||new Set});lu(t["har-output"],Gs(x,2),"utf-8"),g.output(Z(`Har logs saved in ${fe(t["har-output"])}`)),g.printNewLine(),g.printNewLine()}if(b)throw new Error(" Tests exited with error ")}catch(i){throw new de(i?.message??i)}}function fu(t){if(Array.isArray(t)){let e={};for(let r of t)if(r&&typeof r=="string"){let n=uu(r);Object.assign(e,n)}return Object.keys(e).length>0?e:void 0}if(!(!t||typeof t!="string"))return uu(t)}function uu(t){try{let e=JSON.parse(t);if(!te(e))throw new Error("mTLS config must be an object mapping domains to certificate configurations");for(let[r,n]of Object.entries(e)){if(!te(n))throw new Error(`mTLS config for domain "${r}" must be an object`);Zs(n,"clientCert",r,!0),Zs(n,"clientKey",r,!0),Zs(n,"caCert",r,!1)}return e}catch(e){throw e instanceof SyntaxError?new Error(`Invalid JSON for --mtls option: ${e.message}`):e}}function Zs(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 Wb}from"perf_hooks";var $t={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 mo(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 xb(t,e,r=$t){let{thresholds:n,weights:o}=r,s=bt(1-t.parameterCount/(n.maxParamsGood*2)),a=Math.max(t.maxRequestSchemaDepth,t.maxResponseSchemaDepth)/(n.maxDepthGood*2),c=du(t,o.anyOfPenaltyMultiplier)/(n.maxPolymorphismGood*3),l=bt(1-a-c),u=(t.operationDescriptionPresent?1:0)+t.paramsWithDescription+t.schemaPropertiesWithDescription,p=1+t.parameterCount+t.totalSchemaProperties,m=p>0?bt(u/p):1,d=t.totalSchemaProperties>0?bt(t.constraintCount/t.totalSchemaProperties):1,b=(t.requestExamplePresent?1:0)+(t.responseExamplePresent?1:0),h=(t.requestBodyPresent?1:0)+1,C=bt(b/h),x=t.totalErrorResponses>0?bt(t.structuredErrorResponseCount/t.totalErrorResponses):1,E=bt(1-e/(n.maxDependencyDepthGood*2)),v=bt(1-t.ambiguousIdentifierCount/Math.max(n.maxAmbiguousGood+3,1)),O=du(t,o.anyOfPenaltyMultiplier),$=O===0?1:t.hasDiscriminator?bt(1-O/(n.maxPolymorphismGood*4)):bt(1-O/(n.maxPolymorphismGood*2));return{parameterSimplicity:s,schemaSimplicity:l,documentationQuality:m,constraintClarity:d,exampleCoverage:C,errorClarity:x,dependencyClarity:E,identifierClarity:v,polymorphismClarity:$}}function Ab(t,e=$t){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 wu(bt(n)*100)}function hu(t,e,r=$t){let n=new Map;for(let[o,s]of t.operations){let i=e.get(o)??0,a=xb(s,i,r);n.set(o,{agentReadiness:Ab(a,r),subscores:a})}return n}function gu(t,e=$t){return bt(1-t/e.thresholds.maxOperationsForDiscoverability)}function yu(t,e,r=$t){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:wu(mo(n)*(1-o)+s*o)}}function Qs(t,e,r){return t-e+e*r}function du(t,e){return Qs(t.polymorphismCount,t.anyOfCount,e)}function bt(t){return Math.max(0,Math.min(1,t))}function bu(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 wu(t){return Math.round(t*10)/10}function Su(t,e,r){let n=Math.max(1,t);return e/n+r/n}function vb(t,e){return e.totalSchemaProperties>t.totalSchemaProperties?!0:e.totalSchemaProperties<t.totalSchemaProperties?!1:Su(e.totalSchemaProperties,e.schemaPropertiesWithDescription,e.constraintCount)>Su(t.totalSchemaProperties,t.schemaPropertiesWithDescription,t.constraintCount)}var Pb=["enum","const","format","pattern","minimum","maximum","minLength","maxLength","minItems","maxItems","minProperties","maxProperties","multipleOf","exclusiveMinimum","exclusiveMaximum","uniqueItems"];function ei(){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 Ou(t){Object.assign(t,ei())}function xu(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 Pb)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(te(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 Au(t,e,r){return{operations:new Map,currentPath:"",pathLevelParams:[],current:null,walkSchema:t,anyOfPenaltyMultiplier:e,debugOperationId:r,debugLogs:[]}}function $b(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 Rb(t){let{inRequestBody:e,inResponse:r,currentResponseCode:n,errorStructuredCounted:o,maxEffectivePolymorphism:s,...i}=t;return i}function vu(t){return{RequestBody:{enter(){t.current&&(t.current.requestBodyPresent=!0,t.current.inRequestBody=!0)},leave(){t.current&&(t.current.inRequestBody=!1)}},Response:{enter(e,r){let n=t.current;if(!n)return;let o=String(r.key);n.inResponse=!0,n.currentResponseCode=o,n.errorStructuredCounted=!1,Cu(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&&(jb(e)&&(r.inRequestBody&&(r.requestExamplePresent=!0),r.inResponse&&(r.responseExamplePresent=!0)),r.inResponse&&Cu(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);vb(r,o)&&(r.totalSchemaProperties=o.totalSchemaProperties,r.schemaPropertiesWithDescription=o.schemaPropertiesWithDescription,r.constraintCount=o.constraintCount);let s=Qs(o.polymorphismCount,o.anyOfCount,t.anyOfPenaltyMultiplier);s>r.maxEffectivePolymorphism&&(r.maxEffectivePolymorphism=s,r.polymorphismCount=o.polymorphismCount,r.anyOfCount=o.anyOfCount),o.hasDiscriminator&&(r.hasDiscriminator=!0);for(let i of o.refsUsed)r.refsUsed.add(i);if(o.hasPropertyExamples&&(r.inRequestBody&&(r.requestExamplePresent=!0),r.inResponse&&(r.responseExamplePresent=!0)),r.inRequestBody&&(r.maxRequestSchemaDepth=Math.max(r.maxRequestSchemaDepth,o.maxDepth),r.topLevelWritableFieldCount=Math.max(r.topLevelWritableFieldCount,o.writableTopLevelFields)),r.inResponse&&(r.maxResponseSchemaDepth=Math.max(r.maxResponseSchemaDepth,o.maxDepth)),n&&o.debugEntries){let i=r.inRequestBody?"REQUEST BODY":`RESPONSE ${r.currentResponseCode}`;t.debugLogs.push({context:i,entries:o.debugEntries,totalProperties:o.totalSchemaProperties,totalPolymorphism:o.polymorphismCount,totalConstraints:o.constraintCount,maxDepth:o.maxDepth})}}}},Paths:{PathItem:{enter(e,r){t.currentPath=String(r.key),t.pathLevelParams=e.parameters??[]},Operation:{enter(e,r){let n=String(r.key),o=$b(t.currentPath,n,e);t.current=o;let s=_b(t.pathLevelParams,e.parameters??[],r.resolve);for(let i of s.values())o.parameterCount++,i.required&&o.requiredParameterCount++,i.description&&o.paramsWithDescription++,Ib(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,Rb(r)),t.current=null}}}}}}function Pu(t){return{operationCount:t.operations.size,operations:t.operations}}function Eu(t,e){return e(t).node}function _b(t,e,r){let n=new Map;for(let o of t){let s=Eu(o,r);s?.name&&s.in&&n.set(`${s.in}:${s.name}`,s)}for(let o of e){let s=Eu(o,r);s?.name&&s.in&&n.set(`${s.in}:${s.name}`,s)}return n}function jb(t){return t.example!==void 0||fi(t.examples)}function Ib(t){if(t.description)return!1;let e=(t.name??"").toLowerCase();return mu.has(e)}function Cu(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 Tb(t,e){if(!e.startsWith("#/"))return;let r=t;for(let n of e.slice(2).split("/"))r=r?.[gi(n)];return r}function $u({document:t,types:e,resolvedRefMap:r,ctx:n,debugOperationId:o,scoringConstants:s}){let i=s?.weights.anyOfPenaltyMultiplier??$t.weights.anyOfPenaltyMultiplier,a=ei(),c=xu(a),l=Yr([{severity:"warn",ruleId:"score-schema",visitor:c}],e),u=(v,O)=>{Ou(a),O&&(a.debugEntries=[]),Kr({document:{...t,parsed:v},rootType:e.Schema,normalizedVisitors:l,resolvedRefMap:r,ctx:n});let{depth:$,pendingRef:F,debugEntries:D,...ne}=a;return{...ne,refsUsed:[...a.refsUsed],debugEntries:O?a.debugEntries??void 0:void 0}},p=new Map,m=new WeakSet,d={maxDepth:0,polymorphismCount:0,anyOfCount:0,hasDiscriminator:!1,totalSchemaProperties:0,schemaPropertiesWithDescription:0,constraintCount:0,hasPropertyExamples:!1,writableTopLevelFields:0,refsUsed:[]};function b(v,O){return{maxDepth:Math.max(v.maxDepth,O.maxDepth),polymorphismCount:v.polymorphismCount+O.polymorphismCount,anyOfCount:v.anyOfCount+O.anyOfCount,hasDiscriminator:v.hasDiscriminator||O.hasDiscriminator,totalSchemaProperties:v.totalSchemaProperties+O.totalSchemaProperties,schemaPropertiesWithDescription:v.schemaPropertiesWithDescription+O.schemaPropertiesWithDescription,constraintCount:v.constraintCount+O.constraintCount,hasPropertyExamples:v.hasPropertyExamples||O.hasPropertyExamples,writableTopLevelFields:v.writableTopLevelFields+O.writableTopLevelFields,refsUsed:[...v.refsUsed,...O.refsUsed],debugEntries:v.debugEntries||O.debugEntries?[...v.debugEntries??[],...O.debugEntries??[]]:void 0}}let h=(v,O=!1)=>{let $=v,F=De(v)?v.$ref:void 0;if(F){if(!O){let Y=p.get(F);if(Y)return Y}$=Tb(t.parsed,F)??v}if(te($)&&m.has($))return{...d};te($)&&m.add($);let D=$?.oneOf,ne=$?.anyOf,X=Array.isArray(D)&&D.length>1,ue=Array.isArray(ne)&&ne.length>1,R=X||ue,P=Array.isArray($?.allOf)&&$.allOf.length>0,M=$?.discriminator,q=!R&&te(M?.mapping)?Object.values(M.mapping).filter(Y=>typeof Y=="string"&&bi(Y)).map(Y=>({$ref:Y})):null,se=Array.isArray(q)&&q.length>0,re;if(R||P||se){let Y={...$},le=null,Ne=_e=>{le=le?b(le,_e):_e},pe=(_e,it)=>{let U=h(it[0],O);for(let ce=1;ce<it.length;ce++){let ie=h(it[ce],O);ie.totalSchemaProperties>U.totalSchemaProperties&&(U=ie)}return{...U,polymorphismCount:U.polymorphismCount+it.length,anyOfCount:U.anyOfCount+(_e==="anyOf"?it.length:0),hasDiscriminator:U.hasDiscriminator||!!M}};R&&delete Y.discriminator,X&&(delete Y.oneOf,Ne(pe("oneOf",D))),ue&&(delete Y.anyOf,Ne(pe("anyOf",ne)));let Ze=null;if(se){delete Y.discriminator;let _e=h(q[0],O);for(let it=1;it<q.length;it++){let U=h(q[it],O);U.totalSchemaProperties>_e.totalSchemaProperties&&(_e=U)}Ze={..._e,polymorphismCount:_e.polymorphismCount+q.length,hasDiscriminator:!0}}let st=null;if(P){delete Y.allOf,st={...d};for(let _e of $.allOf)st=b(st,h(_e,O));st.polymorphismCount+=$.allOf.length}re=u(Y,O),st&&(re=b(re,st)),le&&(re=b(re,le)),Ze&&(re=b(re,Ze)),F&&(re={...re,refsUsed:[F,...re.refsUsed]})}else re=u(v,O);return te($)&&m.delete($),F&&!O&&p.set(F,re),re},C=Au(h,i,o),x=vu(C),E=Yr([{severity:"warn",ruleId:"score",visitor:x}],e);return Kr({document:t,rootType:e.Root,normalizedVisitors:E,resolvedRefMap:r,ctx:n}),{metrics:Pu(C),debugLogs:C.debugLogs}}function Ru(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=Nb(o,r);n.set(o,s)}return n}function Nb(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 _u(t){let e={agentReadiness:t.agentReadiness,discoverability:Math.round(t.discoverability*100),subscores:t.subscores,rawMetrics:{operationCount:t.rawMetrics.operationCount,operations:Object.fromEntries(Array.from(t.rawMetrics.operations.entries()).map(([r,n])=>{let{refsUsed:o,...s}=n;return[r,s]}))},operationScores:Object.fromEntries(t.operationScores),dependencyDepths:Object.fromEntries(t.dependencyDepths),hotspots:t.hotspots};g.output(JSON.stringify(e,null,2))}function ju(t,e=!1){Lb(t),Db(t),kb(t),e&&Fb(t),Ub(t)}function Iu(t){return t>=80?fe:t>=50?ee:qe}function Tu(t){return Iu(t)(Ee(t.toFixed(1)))}function H(t){g.output(t+`
|
|
221
221
|
`)}function Lb(t){H(""),H(Ee(Ve(" Scores"))),H(""),H(` Agent Readiness: ${Tu(t.agentReadiness)}/100`),H("")}function Db(t){H(Ee(Ve(" Subscores"))),H("");let e=t.subscores;Rt("Parameter Simplicity",e.parameterSimplicity),Rt("Schema Simplicity",e.schemaSimplicity),Rt("Documentation Quality",e.documentationQuality),Rt("Constraint Clarity",e.constraintClarity),Rt("Example Coverage",e.exampleCoverage),Rt("Error Clarity",e.errorClarity),Rt("Dependency Clarity",e.dependencyClarity),Rt("Identifier Clarity",e.identifierClarity),Rt("Polymorphism Clarity",e.polymorphismClarity),Rt("Discoverability",t.discoverability),H("")}function Rt(t,e){let r=Math.round(e*100),n=Mb(e);H(` ${t.padEnd(24)} ${n} ${Iu(r)(r+"%")}`)}function Mb(t){let r=Math.round(t*20);return be("["+"\u2588".repeat(r)+"\u2591".repeat(20-r)+"]")}function kb(t){if(H(Ee(Ve(" Raw Metrics Summary"))),H(""),H(` Total operations: ${t.rawMetrics.operationCount}`),t.rawMetrics.operationCount===0){H("");return}let e=[],r=[],n=[],o=[],s=0,i=0,a=0;for(let u of t.rawMetrics.operations.values())e.push(u.parameterCount),r.push(Math.max(u.maxRequestSchemaDepth,u.maxResponseSchemaDepth)),n.push(u.polymorphismCount),o.push(u.totalSchemaProperties),u.requestExamplePresent&&s++,u.responseExamplePresent&&i++,u.operationDescriptionPresent&&a++;let c=t.rawMetrics.operationCount;function l(u,p){let d=(p.reduce((x,E)=>x+E,0)/c).toFixed(1),b=mo(p).toFixed(1),h=Math.min(...p),C=Math.max(...p);H(` ${u.padEnd(26)} avg ${d.padStart(6)} median ${b.padStart(6)} min ${String(h).padStart(5)} max ${String(C).padStart(5)}`)}l("Parameters/operation:",e),l("Schema depth:",r),l("Polymorphism/operation:",n),l("Properties/operation:",o),H(` Operations with request examples: ${s}/${c} (${ti(s,c)})`),H(` Operations with response examples: ${i}/${c} (${ti(i,c)})`),H(` Operations with description: ${a}/${c} (${ti(a,c)})`),H("")}function ti(t,e){return e>0?`${Math.round(t/e*100)}%`:"N/A"}function Fb(t){H(Ee(Ve(" Per-Operation Metrics"))),H("");let e=" "+"Operation".padEnd(50)+"Props".padStart(7)+"Poly".padStart(7)+"Depth".padStart(7)+"Params".padStart(8)+"Constr".padStart(8);H(be(e)),H(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);H(i)}H("")}function Nu(t,e){if(H(""),H(Ee(Ve(` Debug: ${t} schema breakdown`))),H(""),e.length===0){H(ee(` No schemas found for operation "${t}".`)),H(ee(' Make sure the value matches an operationId or "METHOD /path" exactly.')),H("");return}for(let r of e){H(Ee(be(` ${r.context}`))),H(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}`),H(l),c>0&&c<=20)H(` ${a} properties: ${s.propertyNames.join(", ")}`);else if(c>20){let p=s.propertyNames.slice(0,15).join(", ");H(` ${a} properties: ${p}, ... +${c-15} more`)}}H(""),H(` Totals: ${r.totalProperties} properties, ${r.totalPolymorphism} polymorphism items, ${r.totalConstraints} constraints, max depth ${r.maxDepth}`);let o=[...n.entries()].filter(([,s])=>s.totalProps>0).sort(([,s],[,i])=>i.totalProps-s.totalProps).slice(0,10);if(o.length>0){H(""),H(Ee(" Top schemas by property count:"));for(let[s,i]of o)H(` ${s}: ${i.totalProps} properties`)}H("")}}function Ub(t){if(t.hotspots.length===0){H(Ee(Ve(" No hotspot operations found."))),H("");return}H(Ee(Ve(` Top ${t.hotspots.length} Hotspot Operations`))),H("");for(let e of t.hotspots){let r=e.operationId?`${e.method.toUpperCase()} ${e.path} (${e.operationId})`:`${e.method.toUpperCase()} ${e.path}`;H(Ee(` ${r}`)),H(` Agent Readiness: ${Tu(e.agentReadinessScore)}`);for(let n of e.reasons)H(ee(` - ${n}`));H("")}}function Lu(t,e,r,n=$t){let o=[];for(let[s,i]of e){let a=t.operations.get(s);if(!a)continue;let c=qb(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 qb(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 Du({argv:t,config:e,collectSpecData:r}){let[{path:n}]=await lt(t.api?[t.api]:[],e),o=new St(e.resolve),{bundle:s}=await Sr({config:e,ref:n});r?.(s);let i=wt(s.parsed);if(wr(i)!=="oas3")return z(`The score command currently supports only OpenAPI 3.x. Detected: ${i}`);let a=Wb.now(),c=En(e.extendTypes(br(i),i),e),l=await Cn({rootDocument:s,rootType:c.Root,externalRefResolver:o}),u=t["debug-operation-id"],{metrics:p,debugLogs:m}=$u({document:s,types:c,resolvedRefMap:l,ctx:{problems:[],specVersion:i,config:e,visitorsData:{}},debugOperationId:u}),d=Ru(p.operations),b=hu(p,d),h=gu(p.operationCount),{agentReadiness:C}=yu(b,h),x=Lu(p,b,d),E={agentReadiness:C,discoverability:h,subscores:bu(b),rawMetrics:p,hotspots:x,operationScores:b,dependencyDepths:d};zb(E,n,a,t.format,!!t["operation-details"],u?{operationId:u,logs:m}:void 0)}function zb(t,e,r,n,o,s){g.info(`Document: ${at(e)} score:
|
|
222
222
|
`),n==="json"?_u(t):ju(t,o),s&&Nu(s.operationId,s.logs),Qe("score",r,e)}async function Mu(t,e=!1){let r=Er(t,t.resolvedConfig?.residency),n=new Jr,o=await n.getAccessToken(r);if(o)return e&&g.info(`Using existing access token.
|
|
223
223
|
`),o;e&&g.warn(`No valid access token found or refresh token expired. Attempting login...
|
|
@@ -355,13 +355,12 @@ ${at(`${Zr(r)} URL`)}: ${be(e||"No URL yet.")}`;default:{let o=`${ee(`No status
|
|
|
355
355
|
`),await Ao({argv:{organization:o,project:s,pushId:$,wait:!0,domain:c,"max-execution-time":d,"start-time":n,"continue-on-deploy-failures":t["continue-on-deploy-failures"]},config:e,version:ct})),a&&Qe(x,r,`${Le("file",C.length)} uploaded to organization ${o}, project ${s}. Push ID: ${$}.`),E.reportSunsetWarnings(),{pushId:$}}catch(l){xo("\u2717 File upload failed.",l)}}function pw(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 uw(t){let e={};for(let n of t)if(yr.statSync(n).isDirectory()){let o=n;Lf(o,[]).forEach(i=>r(i,o))}else r(n,Yt.dirname(n));function r(n,o){let s=Yt.relative(o,n);e[s]&&g.warn(`File ${e[s]} is overwritten by ${n}
|
|
356
356
|
`),e[s]=n}return Object.entries(e).map(([n,o])=>fw(n,o))}function fw(t,e){return{name:t,path:Yt.resolve(e)}}function Lf(t,e){let r=yr.readdirSync(t);for(let n of r){let o=Yt.join(t,n);yr.statSync(o).isDirectory()?e=Lf(o,e):e.push(o)}return e}var Df=_t(Gn(),1);import{existsSync as mw,writeFileSync as dw,readFileSync as hw,statSync as gw}from"node:fs";import{tmpdir as si}from"node:os";import{join as ii}from"node:path";import*as wn from"node:process";var ai="redocly-cli-version",vo=4,yw=1e3*60*60*12,Mf=wn.env.NODE_ENV==="test"||wn.env.CI||!!wn.env.LAMBDA_TASK_ROOT||wn.env.REDOCLY_SUPPRESS_UPDATE_NOTICE==="true",kf=()=>{if(!Mf)try{let t=hw(ii(si(),ai)).toString();bw(ct,t)&&Sw(ct,t)}catch{return}},bw=(t,e)=>(0,Df.compare)(t,e)<0,ww=async t=>{let e=`http://registry.npmjs.org/${t}/latest`;try{return(await(await Pn(e,{timeout:vn})).json()).version}catch{return}},Ff=()=>{!Cw()||Mf||ww(Ri).then(t=>{if(t){let e=ii(si(),ai);dw(e,t)}}).catch(()=>{})},Sw=(t,e)=>{let r=[`A new version of ${be("Redocly CLI")} (${fe(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=>To(a).length)),o=ee("\u2550".repeat(n+vo)),s=" ".repeat(vo),i=["",s+ee("\u2554"+o+"\u2557"),s+ee("\u2551"+" ".repeat(n+vo)+"\u2551"),r.map(Ew(n,s)).join(`
|
|
357
357
|
`),s+ee("\u2551"+" ".repeat(n+vo)+"\u2551"),s+ee("\u255A"+o+"\u255D"),"",""].join(`
|
|
358
|
-
`);g.info(i)},Ew=(t,e)=>r=>{let n=" ".repeat(t-To(r).length);return`${e}${ee("\u2551")} ${r}${n} ${ee("\u2551")}`},Cw=()=>{try{let t=ii(si(),ai);if(!mw(t))return!0;let e=new Date().getTime(),n=gw(t).mtime.getTime();return e-n>=yw}catch{return!1}};function Uf(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 Vr(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 Ow}from"node:child_process";import*as Br from"node:fs";import{existsSync as xw,writeFileSync as Aw,readFileSync as vw}from"node:fs";import*as Wf from"node:os";import{tmpdir as zf}from"node:os";import{join as Vf}from"node:path";async function qf(t=vn){try{return await Pn(ji,{timeout:t}),!0}catch{return!1}}var Po="***";async function Gf({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:m,generate_client:d,eject_generator:b}){try{if(!e||!await qf(1e3))return;let{_:[C],$0:x,...E}=e,{RedoclyOAuthClient:v}=await import("./chunks/
|
|
359
|
-
`,""),version:ct,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:m?.length?JSON.stringify(m):void 0,generate_client_builtin_generators:d?.generate_client_builtin_generators?.length?JSON.stringify(d.generate_client_builtin_generators):void 0,generate_client_custom_generators_count:d?.generate_client_custom_generators_count,generate_client_toolkit_imports:d?.generate_client_toolkit_imports?.length?JSON.stringify(d.generate_client_toolkit_imports):void 0,generate_client_error_category:d?.generate_client_error_category,generate_client_ejected_generators:d?.generate_client_ejected_generators?.length?JSON.stringify(d.generate_client_ejected_generators):void 0,generate_client_composed_apis_count:d?.generate_client_composed_apis_count,eject_generator_action:b?.eject_generator_action,eject_generator_name:b?.eject_generator_name,eject_generator_outcome:b?.eject_generator_outcome,eject_generator_conflicts:b?.eject_generator_conflicts,eject_generator_from_version:b?.eject_generator_from_version,eject_generator_to_version:b?.eject_generator_to_version}],ue=Ki.mapToCloudEvent({type:"com.redocly.command.ran",source:"urn:redocly:cli",origin:"redocly-cli",env:"production",osPlatform:Wf.platform(),actor:{id:D,object:"user",uri:""},category:"product",data:X}),{otelTelemetry:R}=await import("./chunks/V3JMSQFP.js");R.send(ue)}catch{}}function Bf(t,e){for(let r of t.sourceDescriptions??[])r.type&&e.add(r.type)}function Hf(t,e){for(let r of t.workflows??[]){Gr(r.successActions,e),Gr(r.failureActions,e);for(let n of r.steps??[])Yf(n.successCriteria,e),Gr(n.onSuccess,e),Gr(n.onFailure,e)}Gr(Object.values(t.components?.successActions??{}),e),Gr(Object.values(t.components?.failureActions??{}),e)}function Gr(t,e){for(let r of t??[])Yf(r.criteria,e)}function Yf(t,e){for(let r of t??[]){let n=Pw(r);n&&e.add(n)}}function Pw(t){let e=t.type;return typeof e=="string"?e:e?.type||(t.condition?"simple":void 0)}function Kf(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 $w(t){return Br.existsSync(t)&&Br.statSync(t).isFile()}function Rw(t){return Br.existsSync(t)&&Br.statSync(t).isDirectory()}function ci(t){return t&&(yi(t)?t.split("://")[0]+"://url":$w(t)?t.replace(/.+\.([^.]+)$/,(e,r)=>"file-"+r):Rw(t)?"folder":t)}function li(t,e,r){let n=Array.isArray(e)?e:[e];for(let o of n)t=t.replaceAll(o,r);return t}function Jf(t,e){let r={};for(let[n,o]of Object.entries(t))e.includes(n)?r[n]=Po:te(o)?r[n]=Jf(o,e):r[n]=o;return r}function pi(t,e,r=[]){if(Array.isArray(t))return t.forEach(n=>pi(n,e,r)),r;if(te(t))for(let[n,o]of Object.entries(t))e.includes(n)&&typeof o=="string"?r.push(o):(te(o)||Array.isArray(o))&&pi(o,e,r);return r}function _w(t,e){let r=["organization","o","input","i","clientCert","clientKey","caCert","server","S"],n=e.join(" "),o={};for(let[s,i]of Object.entries(t))if(r.includes(s))o[s]=Po,n=li(n,i,Po);else if(typeof i=="string"){let a=ci(i);o[s]=a,n=li(n,i,a)}else if(Array.isArray(i)){o[s]=i.map(ci);for(let a of i){let c=ci(a);n.includes(a)&&(n=n.replaceAll(a,c))}}else if(te(i)){let a=pi(i,r);for(let c of a)n=li(n,c,Po);o[s]=Jf(i,r)}else o[s]=i;return{arguments:JSON.stringify(o),raw_input:n}}var jw=t=>{if(!(process.env.CI||!t))try{let r=Vf(zf(),_o);Aw(r,t)}catch{}},Iw=()=>{if(!process.env.CI)try{let e=Vf(zf(),_o);return xw(e)?vw(e).toString().trim():void 0}catch{return}};function Se(t){return async e=>{let r=performance.now(),n=2,o,s="unknown",i,a,c,l=new Set,u=new Set,p=new Set,m=({parsed:x,source:E})=>{if(s="unknown",i=void 0,a=void 0,E?.absoluteRef&&Ai(E.absoluteRef)){s="graphql";return}try{s=wt(x)}catch{s="unsupported"}te(x)&&(i=x?.openapi?"openapi":x?.swagger?"swagger":x?.asyncapi?"asyncapi":x?.arazzo?"arazzo":x?.overlay?"overlay":void 0,i&&(a=x[i]),wr(s)==="arazzo1"&&(Kf(x,l),Bf(x,u),Hf(x,p)))},d=new Set,b=new Set,h=new Set,C=x=>{for(let E of x)E.ignored?h.add(E.ruleId):E.severity==="error"?d.add(E.ruleId):E.severity==="warn"&&b.add(E.ruleId)};try{e.config&&!ui(e.config)&&z("Please provide a valid path to the configuration file."),c=await Vi(e,ct),o=c.resolvedConfig.telemetry,n=1,typeof t=="function"&&await t({argv:e,config:c,version:ct,collectSpecData:m,collectResults:C}),n=0}catch(x){x instanceof Kt||(x instanceof de?g.error(x.message+`
|
|
358
|
+
`);g.info(i)},Ew=(t,e)=>r=>{let n=" ".repeat(t-To(r).length);return`${e}${ee("\u2551")} ${r}${n} ${ee("\u2551")}`},Cw=()=>{try{let t=ii(si(),ai);if(!mw(t))return!0;let e=new Date().getTime(),n=gw(t).mtime.getTime();return e-n>=yw}catch{return!1}};function Uf(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 Vr(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 Ow}from"node:child_process";import*as Br from"node:fs";import{existsSync as xw,writeFileSync as Aw,readFileSync as vw}from"node:fs";import*as Wf from"node:os";import{tmpdir as zf}from"node:os";import{join as Vf}from"node:path";async function qf(t=vn){try{return await Pn(ji,{timeout:t}),!0}catch{return!1}}var Po="***";async function Gf({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:m,generate_client:d,eject_generator:b}){try{if(!e||!await qf(1e3))return;let{_:[C],$0:x,...E}=e,{RedoclyOAuthClient:v}=await import("./chunks/KK2STV73.js"),O=new v,$=Er(t,E.residency),F=await O.isAuthorized($),D=Tw();D||(D=`ann_${Ji()}`,Iw(D));let ne=wr(o),X=[{id:C,object:"command",uri:`urn:redocly:cli:command:${C}`,logged_in:F?"yes":"no",command:C,..._w(E,process.argv.slice(2)),node_version:process.version,npm_version:jw(),version:ct,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:m?.length?JSON.stringify(m):void 0,generate_client_builtin_generators:d?.generate_client_builtin_generators?.length?JSON.stringify(d.generate_client_builtin_generators):void 0,generate_client_custom_generators_count:d?.generate_client_custom_generators_count,generate_client_toolkit_imports:d?.generate_client_toolkit_imports?.length?JSON.stringify(d.generate_client_toolkit_imports):void 0,generate_client_error_category:d?.generate_client_error_category,generate_client_ejected_generators:d?.generate_client_ejected_generators?.length?JSON.stringify(d.generate_client_ejected_generators):void 0,generate_client_composed_apis_count:d?.generate_client_composed_apis_count,eject_generator_action:b?.eject_generator_action,eject_generator_name:b?.eject_generator_name,eject_generator_outcome:b?.eject_generator_outcome,eject_generator_conflicts:b?.eject_generator_conflicts,eject_generator_from_version:b?.eject_generator_from_version,eject_generator_to_version:b?.eject_generator_to_version}],ue=Ki.mapToCloudEvent({type:"com.redocly.command.ran",source:"urn:redocly:cli",origin:"redocly-cli",env:"production",osPlatform:Wf.platform(),actor:{id:D,object:"user",uri:""},category:"product",data:X}),{otelTelemetry:R}=await import("./chunks/7R5PBTLG.js");R.send(ue)}catch{}}function Bf(t,e){for(let r of t.sourceDescriptions??[])r.type&&e.add(r.type)}function Hf(t,e){for(let r of t.workflows??[]){Gr(r.successActions,e),Gr(r.failureActions,e);for(let n of r.steps??[])Yf(n.successCriteria,e),Gr(n.onSuccess,e),Gr(n.onFailure,e)}Gr(Object.values(t.components?.successActions??{}),e),Gr(Object.values(t.components?.failureActions??{}),e)}function Gr(t,e){for(let r of t??[])Yf(r.criteria,e)}function Yf(t,e){for(let r of t??[]){let n=Pw(r);n&&e.add(n)}}function Pw(t){let e=t.type;return typeof e=="string"?e:e?.type||(t.condition?"simple":void 0)}function Kf(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 $w(t){return Br.existsSync(t)&&Br.statSync(t).isFile()}function Rw(t){return Br.existsSync(t)&&Br.statSync(t).isDirectory()}function ci(t){return t&&(yi(t)?t.split("://")[0]+"://url":$w(t)?t.replace(/.+\.([^.]+)$/,(e,r)=>"file-"+r):Rw(t)?"folder":t)}function li(t,e,r){let n=Array.isArray(e)?e:[e];for(let o of n)t=t.replaceAll(o,r);return t}function Jf(t,e){let r={};for(let[n,o]of Object.entries(t))e.includes(n)?r[n]=Po:te(o)?r[n]=Jf(o,e):r[n]=o;return r}function pi(t,e,r=[]){if(Array.isArray(t))return t.forEach(n=>pi(n,e,r)),r;if(te(t))for(let[n,o]of Object.entries(t))e.includes(n)&&typeof o=="string"?r.push(o):(te(o)||Array.isArray(o))&&pi(o,e,r);return r}function _w(t,e){let r=["organization","o","input","i","clientCert","clientKey","caCert","server","S"],n=e.join(" "),o={};for(let[s,i]of Object.entries(t))if(r.includes(s))o[s]=Po,n=li(n,i,Po);else if(typeof i=="string"){let a=ci(i);o[s]=a,n=li(n,i,a)}else if(Array.isArray(i)){o[s]=i.map(ci);for(let a of i){let c=ci(a);n.includes(a)&&(n=n.replaceAll(a,c))}}else if(te(i)){let a=pi(i,r);for(let c of a)n=li(n,c,Po);o[s]=Jf(i,r)}else o[s]=i;return{arguments:JSON.stringify(o),raw_input:n}}function jw(){try{return Ow("npm -v",{stdio:["ignore","pipe","ignore"]}).toString().trim()}catch{return"unknown"}}var Iw=t=>{if(!(process.env.CI||!t))try{let r=Vf(zf(),_o);Aw(r,t)}catch{}},Tw=()=>{if(!process.env.CI)try{let e=Vf(zf(),_o);return xw(e)?vw(e).toString().trim():void 0}catch{return}};function Se(t){return async e=>{let r=performance.now(),n=2,o,s="unknown",i,a,c,l=new Set,u=new Set,p=new Set,m=({parsed:x,source:E})=>{if(s="unknown",i=void 0,a=void 0,E?.absoluteRef&&Ai(E.absoluteRef)){s="graphql";return}try{s=wt(x)}catch{s="unsupported"}te(x)&&(i=x?.openapi?"openapi":x?.swagger?"swagger":x?.asyncapi?"asyncapi":x?.arazzo?"arazzo":x?.overlay?"overlay":void 0,i&&(a=x[i]),wr(s)==="arazzo1"&&(Kf(x,l),Bf(x,u),Hf(x,p)))},d=new Set,b=new Set,h=new Set,C=x=>{for(let E of x)E.ignored?h.add(E.ruleId):E.severity==="error"?d.add(E.ruleId):E.severity==="warn"&&b.add(E.ruleId)};try{e.config&&!ui(e.config)&&z("Please provide a valid path to the configuration file."),c=await Vi(e,ct),o=c.resolvedConfig.telemetry,n=1,typeof t=="function"&&await t({argv:e,config:c,version:ct,collectSpecData:m,collectResults:C}),n=0}catch(x){x instanceof Kt||(x instanceof de?g.error(x.message+`
|
|
360
359
|
|
|
361
360
|
`):(g.error(`An unexpected error occurred. This is likely a bug that should be reported.
|
|
362
361
|
`),g.error(x instanceof Error?x.stack||x.message:String(x)),g.error(`
|
|
363
362
|
`)))}finally{if(process.env.REDOCLY_TELEMETRY!=="off"&&o!=="off"){let x=Math.round(performance.now()-r);await Gf({config:c,argv:e,exit_code:n,execution_time:x,spec_version:s,spec_keyword:i,spec_full_version:a,respect_x_security_auth_types:[...l],respect_source_description_types:[...u],respect_criterion_object_types:[...p],lint_rules_with_errors:[...d],lint_rules_with_warnings:[...b],lint_rules_with_ignored_problems:[...h],generate_client:ot,eject_generator:ye})}process.once("beforeExit",()=>{process.exit(n)})}}}Xf.config({path:Zf.resolve(process.cwd(),"./.env")});Ff();zl(ps(process.argv)).version("version","Show version number.",ct).help("help","Show help.").parserConfiguration({"greedy-arrays":!1,"boolean-negation":!1}).command("stats [api]","Show statistics for an API description.",t=>t.env("REDOCLY_CLI_STATS").positional("api",{type:"string"}).option({config:{description:"Path to the config file.",type:"string"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"},format:{description:"Use a specific output format.",choices:["stylish","json","markdown"],default:"stylish"}}),t=>{Se(_f)(t)}).command("score [api]","Score an API description for integration simplicity and agent readiness.",t=>t.env("REDOCLY_CLI_SCORE").positional("api",{type:"string"}).option({config:{description:"Path to the config file.",type:"string"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"},format:{description:"Use a specific output format.",choices:["stylish","json"],default:"stylish"},"operation-details":{description:"Print per-operation metric details.",type:"boolean",default:!1},"debug-operation-id":{description:"Print detailed schema breakdown for a specific operation.",type:"string"}}),t=>{Se(Du)(t)}).command("split [api]","Split an API description into a multi-file structure.",t=>t.env("REDOCLY_CLI_SPLIT").positional("api",{description:"API description file that you want to split",type:"string"}).option({outDir:{description:"Output directory where files will be saved.",required:!0,type:"string"},separator:{description:"File path separator used while splitting.",required:!1,type:"string",default:"_"},config:{description:"Path to the config file.",requiresArg:!0,type:"string"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}).demandOption("api"),t=>{Se(xf)(t)}).command("join [apis...]","Join multiple API descriptions into one [experimental].",t=>t.env("REDOCLY_CLI_JOIN").positional("apis",{array:!0,type:"string",demandOption:!0}).option({"prefix-tags-with-info-prop":{description:"Prefix tags with property value from info object.",requiresArg:!0,type:"string"},"prefix-tags-with-filename":{description:"Prefix tags with property value from file name.",type:"boolean",default:!1},"prefix-components-with-info-prop":{description:"Prefix components with property value from info object.",requiresArg:!0,type:"string"},"without-x-tag-groups":{description:"Skip automated x-tagGroups creation",type:"boolean"},output:{description:"Output file.",alias:"o",type:"string"},config:{description:"Path to the config file.",requiresArg:!0,type:"string"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}),t=>{Se(kp)(t)}).command("push-status [pushId]",!1,t=>t.env("REDOCLY_CLI_PUSH_STATUS").positional("pushId",{description:"Push id.",type:"string",demandOption:!0}).implies("max-execution-time","wait").option({organization:{description:"Name of the organization to push to.",type:"string",alias:"o",required:!0},project:{description:"Name of the project to push to.",type:"string",required:!0,alias:"p"},domain:{description:"Specify a domain.",alias:"d",type:"string",required:!1},wait:{description:"Wait for build to finish.",type:"boolean",default:!1},"max-execution-time":{description:"Maximum execution time in seconds.",type:"number"},"continue-on-deploy-failures":{description:"Command does not fail even if the deployment fails.",type:"boolean",default:!1},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}),t=>{Se(Ao)(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:Uf},author:{description:"Author of the commit.",type:"string",alias:"a",required:!0},message:{description:"Commit message.",type:"string",alias:"m",required:!0},"commit-sha":{description:"Commit SHA.",type:"string",alias:"sha"},"commit-url":{description:"Commit URL.",type:"string",alias:"url"},namespace:{description:"Repository namespace.",type:"string"},repository:{description:"Repository name.",type:"string"},"created-at":{description:"Commit creation date.",type:"string"},domain:{description:"Specify a domain.",alias:"d",type:"string"},config:{description:"Path to the config file.",requiresArg:!0,type:"string"},"default-branch":{type:"string",default:"main"},"max-execution-time":{description:"Maximum execution time in seconds.",type:"number"},"wait-for-deployment":{description:"Wait for build to finish.",type:"boolean",default:!1},verbose:{type:"boolean",default:!1},"continue-on-deploy-failures":{description:"Command does not fail even if the deployment fails.",type:"boolean",default:!1}}),t=>{Se(Nf)(t)}).command("lint [apis...]","Lint an API or Arazzo description.",t=>t.env("REDOCLY_CLI_LINT").positional("apis",{array:!0,type:"string",demandOption:!0}).option({format:{description:"Use a specific output format.",choices:["stylish","codeframe","json","checkstyle","codeclimate","summary","markdown","github-actions","junit"],default:"codeframe"},"max-problems":{requiresArg:!0,description:"Reduce output to a maximum of N problems.",type:"number",default:100},"generate-ignore-file":{description:"Generate an ignore file.",type:"boolean"},"skip-rule":{description:"Ignore certain rules.",array:!0,type:"string"},"skip-preprocessor":{description:"Ignore certain preprocessors.",array:!0,type:"string"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"},config:{description:"Path to the config file.",requiresArg:!0,type:"string"},extends:{description:"Override extends configurations (defaults or config file settings).",requiresArg:!0,array:!0,type:"string"}}),t=>{Se(Li)(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:Di},"skip-preprocessor":{description:"Ignore certain preprocessors.",array:!0,type:"string"},"skip-decorator":{description:"Ignore certain decorators.",array:!0,type:"string"},dereferenced:{alias:"d",type:"boolean",description:"Produce a fully dereferenced bundle."},force:{alias:"f",type:"boolean",description:"Produce bundle output even when errors occur."},config:{description:"Path to the config file.",type:"string"},metafile:{description:"Produce metadata about the bundle",type:"string"},extends:{description:"Override extends configurations (defaults or config file settings).",requiresArg:!0,array:!0,type:"string",hidden:!0},"remove-unused-components":{description:"Remove unused components.",type:"boolean",default:!1},"keep-url-references":{description:"Keep absolute url references.",type:"boolean",alias:"k"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"},"component-renaming-conflicts-severity":{description:"Whether to show warnings or fail on renaming conflicts (defaults to warn).",choices:["warn","error","off"]},"component-names-strategy":{description:"How to name inlined Schema components: 'basename' (default) or 'title' (from each schema's `title`).",choices:["basename","title"],default:"basename"}}).check(e=>{if(e.output&&(!e.apis||e.apis.length===0))throw new Error("At least one inline API must be specified when using --output.");return!0}),t=>{Se(Bl)(t)}).command("check-config","Lint the Redocly configuration file.",async t=>t.env("REDOCLY_CLI_CHECK_CONFIG").option({config:{description:"Path to the config file.",type:"string"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error"],default:"error"}}),t=>{Se()(t)}).command("login","Log in to Redocly.",async t=>t.env("REDOCLY_CLI_LOGIN").options({residency:{description:"Residency of the application. Defaults to `us`.",alias:["r"],type:"string"},config:{description:"Path to the config file.",requiresArg:!0,type:"string"},verbose:{alias:"v",describe:"Apply verbose mode.",type:"boolean"}}),t=>{Se(Vl)(t)}).command("logout","Clear your stored credentials.",t=>t,t=>{Se(Gl)(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:Fp,default:"enterprise"},port:{alias:"p",type:"number",description:"Preview port.",default:4e3,coerce:Vr("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.
|
|
364
|
-
`),Se(Up)(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/Z2AXUXMK.js");Se(e)(t)}).command("translate <locale>","Creates or updates translations.yaml files and fills them with missing built-in translations and translations from the redocly.yaml and sidebars.yaml files.",t=>t.env("REDOCLY_CLI_TRANSLATE").positional("locale",{description:"Locale code to generate translations for, or `all` for all current project locales.",type:"string",demandOption:!0}).options({"project-dir":{alias:"d",type:"string",description:"Specifies the project content directory. The default value is the directory where the command is executed.",default:"."},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}),t=>{Se(jf)(t)}).command("eject <type> [path]","Helper function to eject project elements for customization.",t=>t.env("REDOCLY_CLI_EJECT").positional("type",{description:"Specifies what type of project element to eject. Currently this value must be `component`.",demandOption:!0,choices:["component"]}).positional("path",{description:"Filepath to a component or filepath with glob pattern.",type:"string"}).options({"project-dir":{alias:"d",type:"string",description:"Specifies the project content directory. The default value is the directory where the command is executed.",default:"."},force:{alias:"f",type:"boolean",description:'Skips the "overwrite existing" confirmation when ejecting a component that is already ejected in the destination.'},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}),t=>{Se(up)(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:fu},severity:{describe:"Severity of the check.",type:"string"},"max-steps":{describe:"Maximum number of steps to run (default: 2000).",type:"number",default:2e3,coerce:Vr("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:Vr("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:Vr("execution-timeout",!1)},"no-secrets-masking":{describe:"Do not mask secrets in the output.",type:"boolean",default:!1}}),async t=>{Se(pu)(t)}).command("generate-arazzo <descriptionPath>","Auto-generate arazzo description file from an API description.",t=>t.env("REDOCLY_CLI_GENERATE_ARAZZO").positional("descriptionPath",{describe:"Description file path.",type:"string"}).options({"output-file":{alias:"o",describe:"Output File name.",type:"string",requiresArg:!0}}),async t=>{Se(fp)(t)}).command("generate-client [api]","Generate a TypeScript client from an OpenAPI description [experimental].",t=>t.env("REDOCLY_CLI_GENERATE_CLIENT").positional("api",{describe:"OpenAPI description file path (or alias from redocly.yaml `apis:`).",type:"string"}).options({output:{alias:"o",describe:"Output file path for the generated client (must end in .ts).",type:"string",requiresArg:!0},"server-url":{describe:"Override the server URL inlined into the generated runtime. Defaults to `servers[0].url`.",type:"string",requiresArg:!0},"output-mode":{describe:"How the client is split across files: `single` (default, one file) or `split` (schema types and guards in a sibling `<name>.schemas.ts` the entry re-exports).",choices:["single","split"],requiresArg:!0},runtime:{describe:"Runtime distribution: 'inline' (default) embeds the runtime in the generated file; 'module' writes it as real files in a runtime/ folder beside the client.",choices:["inline","module"],requiresArg:!0},docs:{description:"Also write reference documentation for what this run generates: one Markdown page per selected generator that documents itself (the CLI, and each SDK).",type:"boolean"},"go-package":{description:"Package clause of the `go` generator's output (a valid Go package name). Defaults to `client`.",type:"string",requiresArg:!0},"import-ext":{describe:"Extension in generated relative imports: 'js' (default) suits tsc and bundlers; 'ts' suits runtimes that resolve specifiers literally, like Node's built-in type stripping (node client.ts).",choices:["js","ts"],requiresArg:!0},setup:{describe:"Path to a publisher setup module (a file default-exporting { config, middleware }) that gets included into the generated client \u2014 pre-configure defaults such as the server URL, retries, headers, and middleware, so a published SDK ships with them built in. Works across all output modes.",type:"string",requiresArg:!0},"args-style":{describe:"How operation inputs are passed: `flat` (default) spreads path params as positional arguments followed by `params`/`body`/`headers`; `grouped` bundles every input into a single `args` object (the per-call request `init` stays a separate trailing argument).",choices:["flat","grouped"],requiresArg:!0},"error-mode":{describe:"Error handling: 'throw' (default) throws ApiError on non-2xx; 'result' returns { data, error, response }.",choices:["throw","result"],requiresArg:!0},"date-type":{describe:"How `date-time`/`date` string fields are typed: 'string' (default) keeps the ISO wire shape; 'Date' emits a `Date` (pair with --generator transformers so the runtime value matches).",choices:["string","Date"],requiresArg:!0},"mock-data":{describe:"How the `mock` generator produces data: 'static' (default) inlines deterministic literals (zero-dep); 'faker' emits @faker-js/faker calls for realistic data (install @faker-js/faker as a dev dependency).",choices:["static","faker"],requiresArg:!0},"mock-seed":{describe:"Seed for faker-mode mocks: emits a top-level `faker.seed(<n>)` so generated data is reproducible across runs. Ignored in static mode.",type:"number",requiresArg:!0},generator:{describe:'Generator to run; repeat the flag to run several (default: typescript). Built-in: typescript, zod, tanstack-query, tanstack-query-vue, tanstack-query-svelte, tanstack-query-solid, swr, mock, transformers, cli, python, go, php \u2014 or a path/package specifier for a custom generator. What each one emits is in the "Use the generated client" guide. Example: --generator typescript --generator zod',type:"string",array:!0,requiresArg:!0},config:{describe:"Path to the config file.",type:"string",requiresArg:!0}}),async t=>{Se(wp)(t)}).command("eject-generator [generator]","Vendor a built-in client generator into your repo as an editable file [experimental].",t=>t.positional("generator",{describe:`Built-in generator to eject (${[..._r].join(", ")}).`,type:"string"}).options({config:{description:"Path to the config file.",type:"string"},dir:{describe:"Directory to eject into (default: ./generators).",type:"string",requiresArg:!0},force:{describe:"Overwrite an existing ejected file (discards local edits).",type:"boolean",default:!1},update:{describe:"Three-way merge a newer generator version into your customized copy (pristine \xD7 new \xD7 yours).",type:"boolean",default:!1}}),async t=>{Se(cp)(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:Vr("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/AJZAID3R.js");Se(e)(t)}).command("scorecard-classic [api]","Run quality scorecards with multiple rule levels to validate and maintain API description standards.",t=>t.positional("api",{type:"string"}).option({config:{describe:"Path to the config file.",type:"string"},"project-url":{describe:"URL to the project scorecard configuration.",type:"string"},format:{description:"Use a specific output format.",choices:["stylish","json","checkstyle","junit"],default:"stylish"},"target-level":{describe:"Target level for the scorecard.",type:"string"},verbose:{alias:"v",describe:"Apply verbose mode.",type:"boolean"}}),async t=>{Se(Yu)(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/GJRJZYC4.js");Se(e)(t)}).command("proxy","Capture live HTTP traffic through a reverse proxy into a HAR file, optionally validating it against an OpenAPI description [experimental].",t=>t.env("REDOCLY_CLI_PROXY").option({target:{describe:"Upstream base URL to forward captured requests to.",type:"string",demandOption:!0},port:{describe:"Port the proxy listens on.",type:"number",default:4040},host:{describe:"Host the proxy binds to.",type:"string",default:"127.0.0.1"},har:{describe:"Path to the HAR file where captured traffic is written.",type:"string",demandOption:!0},api:{describe:"OpenAPI description file or folder to validate captured traffic against (live).",type:"string"},"report-format":{describe:"Output format for the validation report printed on shutdown.",alias:"format",choices:["pretty","json","csv","sarif"],default:"pretty"},"match-mode":{describe:"Endpoint matching mode.",choices:["strict-host","basepath"],default:"strict-host"},"ignore-cookies":{describe:"Ignore cookie-based checks.",type:"boolean",default:!1},"ignore-headers":{describe:'Comma-separated header names to skip in undocumented-header checks. A trailing "*" matches by prefix, e.g. "x-consumer-*".',type:"string"},"max-findings":{describe:"Maximum findings shown in pretty output.",type:"number",default:10},rules:{describe:"Comma-separated builtin rules to run.",type:"string"},config:{describe:"Path to the config file.",type:"string"},"lint-config":{describe:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}),async t=>{let{handleProxy:e}=await import("./chunks/2GJPOM5H.js");Se(e)(t)}).completion("completion","Generate autocomplete script for `redocly` command.").demandCommand(1).middleware([kf]).strict().argv;
|
|
363
|
+
`),Se(Up)(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/RXOEH2LN.js");Se(e)(t)}).command("translate <locale>","Creates or updates translations.yaml files and fills them with missing built-in translations and translations from the redocly.yaml and sidebars.yaml files.",t=>t.env("REDOCLY_CLI_TRANSLATE").positional("locale",{description:"Locale code to generate translations for, or `all` for all current project locales.",type:"string",demandOption:!0}).options({"project-dir":{alias:"d",type:"string",description:"Specifies the project content directory. The default value is the directory where the command is executed.",default:"."},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}),t=>{Se(jf)(t)}).command("eject <type> [path]","Helper function to eject project elements for customization.",t=>t.env("REDOCLY_CLI_EJECT").positional("type",{description:"Specifies what type of project element to eject. Currently this value must be `component`.",demandOption:!0,choices:["component"]}).positional("path",{description:"Filepath to a component or filepath with glob pattern.",type:"string"}).options({"project-dir":{alias:"d",type:"string",description:"Specifies the project content directory. The default value is the directory where the command is executed.",default:"."},force:{alias:"f",type:"boolean",description:'Skips the "overwrite existing" confirmation when ejecting a component that is already ejected in the destination.'},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}),t=>{Se(up)(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:fu},severity:{describe:"Severity of the check.",type:"string"},"max-steps":{describe:"Maximum number of steps to run (default: 2000).",type:"number",default:2e3,coerce:Vr("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:Vr("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:Vr("execution-timeout",!1)},"no-secrets-masking":{describe:"Do not mask secrets in the output.",type:"boolean",default:!1}}),async t=>{Se(pu)(t)}).command("generate-arazzo <descriptionPath>","Auto-generate arazzo description file from an API description.",t=>t.env("REDOCLY_CLI_GENERATE_ARAZZO").positional("descriptionPath",{describe:"Description file path.",type:"string"}).options({"output-file":{alias:"o",describe:"Output File name.",type:"string",requiresArg:!0}}),async t=>{Se(fp)(t)}).command("generate-client [api]","Generate a TypeScript client from an OpenAPI description [experimental].",t=>t.env("REDOCLY_CLI_GENERATE_CLIENT").positional("api",{describe:"OpenAPI description file path (or alias from redocly.yaml `apis:`).",type:"string"}).options({output:{alias:"o",describe:"Output file path for the generated client (must end in .ts).",type:"string",requiresArg:!0},"server-url":{describe:"Override the server URL inlined into the generated runtime. Defaults to `servers[0].url`.",type:"string",requiresArg:!0},"output-mode":{describe:"How the client is split across files: `single` (default, one file) or `split` (schema types and guards in a sibling `<name>.schemas.ts` the entry re-exports).",choices:["single","split"],requiresArg:!0},runtime:{describe:"Runtime distribution: 'inline' (default) embeds the runtime in the generated file; 'module' writes it as real files in a runtime/ folder beside the client.",choices:["inline","module"],requiresArg:!0},docs:{description:"Also write reference documentation for what this run generates: one Markdown page per selected generator that documents itself (the CLI, and each SDK).",type:"boolean"},"go-package":{description:"Package clause of the `go` generator's output (a valid Go package name). Defaults to `client`.",type:"string",requiresArg:!0},"import-ext":{describe:"Extension in generated relative imports: 'js' (default) suits tsc and bundlers; 'ts' suits runtimes that resolve specifiers literally, like Node's built-in type stripping (node client.ts).",choices:["js","ts"],requiresArg:!0},setup:{describe:"Path to a publisher setup module (a file default-exporting { config, middleware }) that gets included into the generated client \u2014 pre-configure defaults such as the server URL, retries, headers, and middleware, so a published SDK ships with them built in. Works across all output modes.",type:"string",requiresArg:!0},"args-style":{describe:"How operation inputs are passed: `flat` (default) spreads path params as positional arguments followed by `params`/`body`/`headers`; `grouped` bundles every input into a single `args` object (the per-call request `init` stays a separate trailing argument).",choices:["flat","grouped"],requiresArg:!0},"error-mode":{describe:"Error handling: 'throw' (default) throws ApiError on non-2xx; 'result' returns { data, error, response }.",choices:["throw","result"],requiresArg:!0},"date-type":{describe:"How `date-time`/`date` string fields are typed: 'string' (default) keeps the ISO wire shape; 'Date' emits a `Date` (pair with --generator transformers so the runtime value matches).",choices:["string","Date"],requiresArg:!0},"mock-data":{describe:"How the `mock` generator produces data: 'static' (default) inlines deterministic literals (zero-dep); 'faker' emits @faker-js/faker calls for realistic data (install @faker-js/faker as a dev dependency).",choices:["static","faker"],requiresArg:!0},"mock-seed":{describe:"Seed for faker-mode mocks: emits a top-level `faker.seed(<n>)` so generated data is reproducible across runs. Ignored in static mode.",type:"number",requiresArg:!0},generator:{describe:'Generator to run; repeat the flag to run several (default: typescript). Built-in: typescript, zod, tanstack-query, tanstack-query-vue, tanstack-query-svelte, tanstack-query-solid, swr, mock, transformers, cli, python, go, php \u2014 or a path/package specifier for a custom generator. What each one emits is in the "Use the generated client" guide. Example: --generator typescript --generator zod',type:"string",array:!0,requiresArg:!0},config:{describe:"Path to the config file.",type:"string",requiresArg:!0}}),async t=>{Se(wp)(t)}).command("eject-generator [generator]","Vendor a built-in client generator into your repo as an editable file [experimental].",t=>t.positional("generator",{describe:`Built-in generator to eject (${[..._r].join(", ")}).`,type:"string"}).options({config:{description:"Path to the config file.",type:"string"},dir:{describe:"Directory to eject into (default: ./generators).",type:"string",requiresArg:!0},force:{describe:"Overwrite an existing ejected file (discards local edits).",type:"boolean",default:!1},update:{describe:"Three-way merge a newer generator version into your customized copy (pristine \xD7 new \xD7 yours).",type:"boolean",default:!1}}),async t=>{Se(cp)(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:Vr("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/YI34NB7D.js");Se(e)(t)}).command("scorecard-classic [api]","Run quality scorecards with multiple rule levels to validate and maintain API description standards.",t=>t.positional("api",{type:"string"}).option({config:{describe:"Path to the config file.",type:"string"},"project-url":{describe:"URL to the project scorecard configuration.",type:"string"},format:{description:"Use a specific output format.",choices:["stylish","json","checkstyle","junit"],default:"stylish"},"target-level":{describe:"Target level for the scorecard.",type:"string"},verbose:{alias:"v",describe:"Apply verbose mode.",type:"boolean"}}),async t=>{Se(Yu)(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/JBNPGEIJ.js");Se(e)(t)}).command("proxy","Capture live HTTP traffic through a reverse proxy into a HAR file, optionally validating it against an OpenAPI description [experimental].",t=>t.env("REDOCLY_CLI_PROXY").option({target:{describe:"Upstream base URL to forward captured requests to.",type:"string",demandOption:!0},port:{describe:"Port the proxy listens on.",type:"number",default:4040},host:{describe:"Host the proxy binds to.",type:"string",default:"127.0.0.1"},har:{describe:"Path to the HAR file where captured traffic is written.",type:"string",demandOption:!0},api:{describe:"OpenAPI description file or folder to validate captured traffic against (live).",type:"string"},"report-format":{describe:"Output format for the validation report printed on shutdown.",alias:"format",choices:["pretty","json","csv","sarif"],default:"pretty"},"match-mode":{describe:"Endpoint matching mode.",choices:["strict-host","basepath"],default:"strict-host"},"ignore-cookies":{describe:"Ignore cookie-based checks.",type:"boolean",default:!1},"ignore-headers":{describe:'Comma-separated header names to skip in undocumented-header checks. A trailing "*" matches by prefix, e.g. "x-consumer-*".',type:"string"},"max-findings":{describe:"Maximum findings shown in pretty output.",type:"number",default:10},rules:{describe:"Comma-separated builtin rules to run.",type:"string"},config:{describe:"Path to the config file.",type:"string"},"lint-config":{describe:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}),async t=>{let{handleProxy:e}=await import("./chunks/E5I67ZCZ.js");Se(e)(t)}).completion("completion","Generate autocomplete script for `redocly` command.").demandCommand(1).middleware([kf]).strict().argv;
|
|
365
364
|
/*! Bundled license information:
|
|
366
365
|
|
|
367
366
|
cookie/index.js:
|