@redocly/cli 2.64.0 → 2.65.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/{ALBI5SPY.js → 2N5733QR.js} +1 -1
- package/lib/chunks/{654FMWX6.js → 2WJNLVFJ.js} +1 -1
- package/lib/chunks/{XYU2LTWU.js → 2XSAJEYO.js} +1 -1
- package/lib/chunks/{UC5EDLXL.js → 472CS7HK.js} +1 -1
- package/lib/chunks/{ULQK2S4O.js → 47H5P7DF.js} +1 -1
- package/lib/chunks/{S3W5GQGC.js → 4BWADBBP.js} +1 -1
- package/lib/chunks/{N4R4236N.js → 4K73EOV3.js} +1 -1
- package/lib/chunks/{VKTRI5YG.js → 5BB2E772.js} +1 -1
- package/lib/chunks/{4EAF6XUQ.js → 5KWYBSEY.js} +1 -1
- package/lib/chunks/{GRTUPOKN.js → 6D4QQEWE.js} +64 -64
- package/lib/chunks/{2MCPXKB6.js → 6D6SERR2.js} +1 -1
- package/lib/chunks/{RWDQI2KD.js → 6TFC2OYQ.js} +1 -1
- package/lib/chunks/{QCOPS234.js → 7BZGNWGO.js} +1 -1
- package/lib/chunks/{M4NCSK7Q.js → 7IN56VMG.js} +1 -1
- package/lib/chunks/{J665DSDI.js → 7Y45I5SU.js} +1 -1
- package/lib/chunks/{2ZIICV4T.js → A55KSVEI.js} +1 -1
- package/lib/chunks/{UQW6CW3M.js → AAMQ6PF3.js} +1 -1
- package/lib/chunks/{WQBSNQXL.js → B6HQPQVF.js} +1 -1
- package/lib/chunks/{L5X7LBV6.js → B6V4SOCA.js} +1 -1
- package/lib/chunks/{GOTKYHFM.js → BAIZWXC6.js} +1 -1
- package/lib/chunks/{6MP4DHWK.js → BWA2MZEG.js} +1 -1
- package/lib/chunks/{BWXAXULF.js → C462YNOX.js} +1 -1
- package/lib/chunks/{TWFZE4OF.js → C6QQGZXT.js} +1 -1
- package/lib/chunks/{LG3SUXEW.js → CBJ23L7Q.js} +1 -1
- package/lib/chunks/{6FADWAOY.js → EIGOI65B.js} +1 -1
- package/lib/chunks/{GKSUZULD.js → FGKVDZSD.js} +1 -1
- package/lib/chunks/{Z4X6WES7.js → FRHR2DRO.js} +1 -1
- package/lib/chunks/H2G6FSDS.js +53 -0
- package/lib/chunks/{7APJVQSB.js → HNEOPZAP.js} +1 -1
- package/lib/chunks/{OS52EARM.js → HQSXMF3M.js} +1 -1
- package/lib/chunks/{FVGFKJ67.js → IFWW4AH6.js} +1 -1
- package/lib/chunks/{2DKR4Z25.js → IJJGUPFL.js} +1 -1
- package/lib/chunks/{WKQJPOYW.js → J7YUB7EL.js} +1 -1
- package/lib/chunks/{UNOXQ62I.js → JIU326EH.js} +2 -2
- package/lib/chunks/{NRWIPPEV.js → JUZHXP62.js} +1 -1
- package/lib/chunks/{RRQJCLNO.js → K6KXLY2V.js} +1 -1
- package/lib/chunks/{CVPT656W.js → KIY6ZQFM.js} +1 -1
- package/lib/chunks/{X6TQQHRM.js → KKAYPMM3.js} +1 -1
- package/lib/chunks/{ONBORCDJ.js → LUYLXWYZ.js} +1 -1
- package/lib/chunks/{CEASD5U3.js → M2DYVAS3.js} +1 -1
- package/lib/chunks/{VWF52WKH.js → ME4RMLPZ.js} +1 -1
- package/lib/chunks/{FXKIC5R3.js → MQWGV2WY.js} +1 -1
- package/lib/chunks/{3CSDNX6S.js → MWJKN6NG.js} +1 -1
- package/lib/chunks/{HYMULX2S.js → N7JGYQGR.js} +1 -1
- package/lib/chunks/{FU7GBMUU.js → O7U2BX37.js} +1 -1
- package/lib/chunks/{XDBFHG7X.js → OD47UYXG.js} +1 -1
- package/lib/chunks/{JQJ5TDVP.js → PBXLYXXR.js} +1 -1
- package/lib/chunks/{MVCGBDOY.js → PO4VK5GM.js} +1 -1
- package/lib/chunks/{TTE4EAVV.js → PUFMOTSK.js} +1 -1
- package/lib/chunks/{SRRHJLPL.js → QJUYBSEZ.js} +1 -1
- package/lib/chunks/{ENIPOAVJ.js → QV24OXH3.js} +2 -2
- package/lib/chunks/{DPNI74SB.js → RR6N3VYB.js} +1 -1
- package/lib/chunks/{M74SGAZK.js → S242M5IF.js} +1 -1
- package/lib/chunks/{ZM3M44Q3.js → SCB6ZITR.js} +1 -1
- package/lib/chunks/{DL4VP2Z4.js → SDQYWQUI.js} +2 -2
- package/lib/chunks/{LMO5V2XF.js → SEKSITHZ.js} +1 -1
- package/lib/chunks/{LCAJ35J6.js → SEYOG575.js} +1 -1
- package/lib/chunks/{B5ZOH4BB.js → SMBH5JAE.js} +1 -1
- package/lib/chunks/{5PR7FNUB.js → T66YKREQ.js} +1 -1
- package/lib/chunks/{BGGUKU7E.js → TYX2MLO5.js} +1 -1
- package/lib/chunks/{I6NMWBVI.js → U2GUGMK3.js} +35 -35
- package/lib/chunks/{AC62H63B.js → UE7IAPIP.js} +1 -1
- package/lib/chunks/{EQTXHL74.js → VAPFU7OM.js} +2 -2
- package/lib/chunks/{OGNRVBTI.js → WDTMN7JE.js} +1 -1
- package/lib/chunks/{HIII45WJ.js → WUOVEP7D.js} +1 -1
- package/lib/chunks/{VMIHLA3H.js → XIQZ6CQT.js} +1 -1
- package/lib/chunks/{GKCVQWOQ.js → YLLKDBIZ.js} +3 -3
- package/lib/chunks/{ZFXOCOU6.js → ZB7MWGMD.js} +1 -1
- package/lib/chunks/{IH3N62Q4.js → ZCLACSBJ.js} +1 -1
- package/lib/chunks/{QWTSCCNH.js → ZGFTDVO4.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 +5 -5
- package/package.json +1 -1
- package/lib/chunks/U4RAHOFK.js +0 -53
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Ejected from @redocly/client-generator@0.7.
|
|
1
|
+
// Ejected from @redocly/client-generator@0.7.2 — the built-in "typescript" generator.
|
|
2
2
|
// This file is yours: edit freely; the generated client stays machine-owned and is
|
|
3
3
|
// rebuilt by `redocly generate-client`. Newer generator versions merge in with
|
|
4
4
|
// `redocly eject-generator typescript --update`.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Ejected from @redocly/client-generator@0.7.
|
|
1
|
+
// Ejected from @redocly/client-generator@0.7.2 — the built-in "typescript" generator.
|
|
2
2
|
// This file is yours: edit freely; the generated client stays machine-owned and is
|
|
3
3
|
// rebuilt by `redocly generate-client`. Newer generator versions merge in with
|
|
4
4
|
// `redocly eject-generator typescript --update`.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Ejected from @redocly/client-generator@0.7.
|
|
1
|
+
// Ejected from @redocly/client-generator@0.7.2 — the built-in "typescript" generator.
|
|
2
2
|
// This file is yours: edit freely; the generated client stays machine-owned and is
|
|
3
3
|
// rebuilt by `redocly generate-client`. Newer generator versions merge in with
|
|
4
4
|
// `redocly eject-generator typescript --update`.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Ejected from @redocly/client-generator@0.7.
|
|
1
|
+
// Ejected from @redocly/client-generator@0.7.2 — the built-in "zod" generator.
|
|
2
2
|
// This file is yours: edit freely; the generated client stays machine-owned and is
|
|
3
3
|
// rebuilt by `redocly generate-client`. Newer generator versions merge in with
|
|
4
4
|
// `redocly eject-generator zod --update`.
|
|
@@ -28,5 +28,5 @@ export const zodGenerator: Generator = ({ model, output, banner }) => {
|
|
|
28
28
|
export default {
|
|
29
29
|
name: 'zod',
|
|
30
30
|
run: zodGenerator,
|
|
31
|
-
requiresGenerator: '^0.7.
|
|
31
|
+
requiresGenerator: '^0.7.2',
|
|
32
32
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Ejected from @redocly/client-generator@0.7.
|
|
1
|
+
// Ejected from @redocly/client-generator@0.7.2 — the built-in "zod" generator.
|
|
2
2
|
// This file is yours: edit freely; the generated client stays machine-owned and is
|
|
3
3
|
// rebuilt by `redocly generate-client`. Newer generator versions merge in with
|
|
4
4
|
// `redocly eject-generator zod --update`.
|
package/lib/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import { dirname as __pathDirname } from 'node:path';
|
|
|
5
5
|
const require = __createRequire(import.meta.url);
|
|
6
6
|
var __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
var __dirname = __pathDirname(__filename);
|
|
8
|
-
import{a as ri,f as te}from"./chunks/U5DIFWGH.js";import{c as ni}from"./chunks/4PTNG4EI.js";import{a as Jt}from"./chunks/ZM3M44Q3.js";import{a as Na,b as si,c as oi}from"./chunks/GHSNC2OX.js";import{a as ai}from"./chunks/RWDQI2KD.js";import{a as Zn}from"./chunks/NRWIPPEV.js";import{a as Ta}from"./chunks/GKXY6U4S.js";import{a as ii,c as Qt,d as Lr,e as ci,g as li}from"./chunks/TZMWTSOQ.js";import{a as Ie,b as ei,c as ti}from"./chunks/L5X7LBV6.js";import{Ba as Qn,O as Wn,R as Hn,Z as Vn,a as Gn,aa as Yt,ba as Bn,c as we,ea as Nt,ia as K,ja as Kt,ka as Yn,l as Pr,oa as Oe,pa as Xt,sa as Kn,u as kn,va as Xn,wa as Jn}from"./chunks/EQTXHL74.js";import"./chunks/NEWT5A6S.js";import{a as ze,c as U,e as Lt}from"./chunks/RFWIIJFG.js";var wt=U((md,ui)=>{"use strict";var Da="2.0.0",qa=Number.MAX_SAFE_INTEGER||9007199254740991,Ma=16,Fa=250,Ua=["major","premajor","minor","preminor","patch","prepatch","prerelease"];ui.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:Ma,MAX_SAFE_BUILD_LENGTH:Fa,MAX_SAFE_INTEGER:qa,RELEASE_TYPES:Ua,SEMVER_SPEC_VERSION:Da,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Tt=U((gd,fi)=>{"use strict";var za=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...r)=>console.error("SEMVER",...r):()=>{};fi.exports=za});var Ot=U((Ge,di)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:Nr,MAX_SAFE_BUILD_LENGTH:Ga,MAX_LENGTH:ka}=wt(),Wa=Tt();Ge=di.exports={};var Ha=Ge.re=[],Va=Ge.safeRe=[],C=Ge.src=[],Ba=Ge.safeSrc=[],x=Ge.t={},Ya=0,Tr="[a-zA-Z0-9-]",Ka=[["\\s",1],["\\d",ka],[Tr,Ga]],Xa=r=>{for(let[e,t]of Ka)r=r.split(`${e}*`).join(`${e}{0,${t}}`).split(`${e}+`).join(`${e}{1,${t}}`);return r},k=(r,e,t)=>{let n=Xa(e),i=Ya++;Wa(r,i,e),x[r]=i,C[i]=e,Ba[i]=n,Ha[i]=new RegExp(e,t?"g":void 0),Va[i]=new RegExp(n,t?"g":void 0)};k("NUMERICIDENTIFIER","0|[1-9]\\d*");k("NUMERICIDENTIFIERLOOSE","\\d+");k("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Tr}*`);k("MAINVERSION",`(${C[x.NUMERICIDENTIFIER]})\\.(${C[x.NUMERICIDENTIFIER]})\\.(${C[x.NUMERICIDENTIFIER]})`);k("MAINVERSIONLOOSE",`(${C[x.NUMERICIDENTIFIERLOOSE]})\\.(${C[x.NUMERICIDENTIFIERLOOSE]})\\.(${C[x.NUMERICIDENTIFIERLOOSE]})`);k("PRERELEASEIDENTIFIER",`(?:${C[x.NONNUMERICIDENTIFIER]}|${C[x.NUMERICIDENTIFIER]})`);k("PRERELEASEIDENTIFIERLOOSE",`(?:${C[x.NONNUMERICIDENTIFIER]}|${C[x.NUMERICIDENTIFIERLOOSE]})`);k("PRERELEASE",`(?:-(${C[x.PRERELEASEIDENTIFIER]}(?:\\.${C[x.PRERELEASEIDENTIFIER]})*))`);k("PRERELEASELOOSE",`(?:-?(${C[x.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${C[x.PRERELEASEIDENTIFIERLOOSE]})*))`);k("BUILDIDENTIFIER",`${Tr}+`);k("BUILD",`(?:\\+(${C[x.BUILDIDENTIFIER]}(?:\\.${C[x.BUILDIDENTIFIER]})*))`);k("FULLPLAIN",`v?${C[x.MAINVERSION]}${C[x.PRERELEASE]}?${C[x.BUILD]}?`);k("FULL",`^${C[x.FULLPLAIN]}$`);k("LOOSEPLAIN",`[v=\\s]*${C[x.MAINVERSIONLOOSE]}${C[x.PRERELEASELOOSE]}?${C[x.BUILD]}?`);k("LOOSE",`^${C[x.LOOSEPLAIN]}$`);k("GTLT","((?:<|>)?=?)");k("XRANGEIDENTIFIERLOOSE",`${C[x.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);k("XRANGEIDENTIFIER",`${C[x.NUMERICIDENTIFIER]}|x|X|\\*`);k("XRANGEPLAIN",`[v=\\s]*(${C[x.XRANGEIDENTIFIER]})(?:\\.(${C[x.XRANGEIDENTIFIER]})(?:\\.(${C[x.XRANGEIDENTIFIER]})(?:${C[x.PRERELEASE]})?${C[x.BUILD]}?)?)?`);k("XRANGEPLAINLOOSE",`[v=\\s]*(${C[x.XRANGEIDENTIFIERLOOSE]})(?:\\.(${C[x.XRANGEIDENTIFIERLOOSE]})(?:\\.(${C[x.XRANGEIDENTIFIERLOOSE]})(?:${C[x.PRERELEASELOOSE]})?${C[x.BUILD]}?)?)?`);k("XRANGE",`^${C[x.GTLT]}\\s*${C[x.XRANGEPLAIN]}$`);k("XRANGELOOSE",`^${C[x.GTLT]}\\s*${C[x.XRANGEPLAINLOOSE]}$`);k("COERCEPLAIN",`(^|[^\\d])(\\d{1,${Nr}})(?:\\.(\\d{1,${Nr}}))?(?:\\.(\\d{1,${Nr}}))?`);k("COERCE",`${C[x.COERCEPLAIN]}(?:$|[^\\d])`);k("COERCEFULL",C[x.COERCEPLAIN]+`(?:${C[x.PRERELEASE]})?(?:${C[x.BUILD]})?(?:$|[^\\d])`);k("COERCERTL",C[x.COERCE],!0);k("COERCERTLFULL",C[x.COERCEFULL],!0);k("LONETILDE","(?:~>?)");k("TILDETRIM",`(\\s*)${C[x.LONETILDE]}\\s+`,!0);Ge.tildeTrimReplace="$1~";k("TILDE",`^${C[x.LONETILDE]}${C[x.XRANGEPLAIN]}$`);k("TILDELOOSE",`^${C[x.LONETILDE]}${C[x.XRANGEPLAINLOOSE]}$`);k("LONECARET","(?:\\^)");k("CARETTRIM",`(\\s*)${C[x.LONECARET]}\\s+`,!0);Ge.caretTrimReplace="$1^";k("CARET",`^${C[x.LONECARET]}${C[x.XRANGEPLAIN]}$`);k("CARETLOOSE",`^${C[x.LONECARET]}${C[x.XRANGEPLAINLOOSE]}$`);k("COMPARATORLOOSE",`^${C[x.GTLT]}\\s*(${C[x.LOOSEPLAIN]})$|^$`);k("COMPARATOR",`^${C[x.GTLT]}\\s*(${C[x.FULLPLAIN]})$|^$`);k("COMPARATORTRIM",`(\\s*)${C[x.GTLT]}\\s*(${C[x.LOOSEPLAIN]}|${C[x.XRANGEPLAIN]})`,!0);Ge.comparatorTrimReplace="$1$2$3";k("HYPHENRANGE",`^\\s*(${C[x.XRANGEPLAIN]})\\s+-\\s+(${C[x.XRANGEPLAIN]})\\s*$`);k("HYPHENRANGELOOSE",`^\\s*(${C[x.XRANGEPLAINLOOSE]})\\s+-\\s+(${C[x.XRANGEPLAINLOOSE]})\\s*$`);k("STAR","(<|>)?=?\\s*\\*");k("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");k("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Zt=U((yd,pi)=>{"use strict";var Ja=Object.freeze({loose:!0}),Qa=Object.freeze({}),Za=r=>r?typeof r!="object"?Ja:r:Qa;pi.exports=Za});var Dr=U((bd,gi)=>{"use strict";var hi=/^[0-9]+$/,mi=(r,e)=>{if(typeof r=="number"&&typeof e=="number")return r===e?0:r<e?-1:1;let t=hi.test(r),n=hi.test(e);return t&&n&&(r=+r,e=+e),r===e?0:t&&!n?-1:n&&!t?1:r<e?-1:1},ec=(r,e)=>mi(e,r);gi.exports={compareIdentifiers:mi,rcompareIdentifiers:ec}});var me=U((Ed,bi)=>{"use strict";var er=Tt(),{MAX_LENGTH:yi,MAX_SAFE_INTEGER:tr}=wt(),{safeRe:rr,t:nr}=Ot(),tc=Zt(),{compareIdentifiers:qr}=Dr(),rc=(r,e)=>{let t=e.split(".");if(t.length>r.length)return!1;for(let n=0;n<t.length;n++)if(qr(r[n],t[n])!==0)return!1;return!0},Mr=class r{constructor(e,t){if(t=tc(t),e instanceof r){if(e.loose===!!t.loose&&e.includePrerelease===!!t.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>yi)throw new TypeError(`version is longer than ${yi} characters`);er("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let n=e.trim().match(t.loose?rr[nr.LOOSE]:rr[nr.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>tr||this.major<0)throw new TypeError("Invalid major version");if(this.minor>tr||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>tr||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){let s=+i;if(s>=0&&s<tr)return s}return i}):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(er("SemVer.compare",this.version,this.options,e),!(e instanceof r)){if(typeof e=="string"&&e===this.version)return 0;e=new r(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof r||(e=new r(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 r||(e=new r(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 t=0;do{let n=this.prerelease[t],i=e.prerelease[t];if(er("prerelease compare",t,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return qr(n,i)}while(++t)}compareBuild(e){e instanceof r||(e=new r(e,this.options));let t=0;do{let n=this.build[t],i=e.build[t];if(er("build compare",t,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return qr(n,i)}while(++t)}inc(e,t,n){if(e.startsWith("pre")){if(!t&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(t){let i=`-${t}`.match(this.options.loose?rr[nr.PRERELEASELOOSE]:rr[nr.PRERELEASE]);if(!i||i[1]!==t)throw new Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,n),this.inc("pre",t,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",t,n),this.inc("pre",t,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 i=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[i];else{let s=this.prerelease.length;for(;--s>=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(t===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(t){let s=[t,i];if(n===!1&&(s=[t]),rc(this.prerelease,t)){let o=this.prerelease[t.split(".").length];isNaN(o)&&(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}};bi.exports=Mr});var Qe=U((wd,wi)=>{"use strict";var Ei=me(),nc=(r,e,t=!1)=>{if(r instanceof Ei)return r;try{return new Ei(r,e)}catch(n){if(!t)return null;throw n}};wi.exports=nc});var Ai=U((Od,Oi)=>{"use strict";var ic=Qe(),sc=(r,e)=>{let t=ic(r,e);return t?t.version:null};Oi.exports=sc});var Si=U((Ad,_i)=>{"use strict";var oc=Qe(),ac=(r,e)=>{let t=oc(r.trim().replace(/^[=v]+/,""),e);return t?t.version:null};_i.exports=ac});var Ri=U((_d,xi)=>{"use strict";var Ci=me(),cc=(r,e,t,n,i)=>{typeof t=="string"&&(i=n,n=t,t=void 0);try{return new Ci(r instanceof Ci?r.version:r,t).inc(e,n,i).version}catch{return null}};xi.exports=cc});var $i=U((Sd,ji)=>{"use strict";var vi=Qe(),lc=(r,e)=>{let t=vi(r,null,!0),n=vi(e,null,!0),i=t.compare(n);if(i===0)return null;let s=i>0,o=s?t:n,c=s?n:t,u=!!o.prerelease.length;if(!!c.prerelease.length&&!u){if(!c.patch&&!c.minor)return"major";if(c.compareMain(o)===0)return c.minor&&!c.patch?"minor":"patch"}let h=u?"pre":"";return t.major!==n.major?h+"major":t.minor!==n.minor?h+"minor":t.patch!==n.patch?h+"patch":"prerelease"};ji.exports=lc});var Pi=U((Cd,Ii)=>{"use strict";var uc=me(),fc=(r,e)=>new uc(r,e).major;Ii.exports=fc});var Ni=U((xd,Li)=>{"use strict";var dc=me(),pc=(r,e)=>new dc(r,e).minor;Li.exports=pc});var Di=U((Rd,Ti)=>{"use strict";var hc=me(),mc=(r,e)=>new hc(r,e).patch;Ti.exports=mc});var Mi=U((vd,qi)=>{"use strict";var gc=Qe(),yc=(r,e)=>{let t=gc(r,e);return t&&t.prerelease.length?t.prerelease:null};qi.exports=yc});var Pe=U((jd,Ui)=>{"use strict";var Fi=me(),bc=(r,e,t)=>new Fi(r,t).compare(new Fi(e,t));Ui.exports=bc});var Gi=U(($d,zi)=>{"use strict";var Ec=Pe(),wc=(r,e,t)=>Ec(e,r,t);zi.exports=wc});var Wi=U((Id,ki)=>{"use strict";var Oc=Pe(),Ac=(r,e)=>Oc(r,e,!0);ki.exports=Ac});var ir=U((Pd,Vi)=>{"use strict";var Hi=me(),_c=(r,e,t)=>{let n=new Hi(r,t),i=new Hi(e,t);return n.compare(i)||n.compareBuild(i)};Vi.exports=_c});var Yi=U((Ld,Bi)=>{"use strict";var Sc=ir(),Cc=(r,e)=>r.sort((t,n)=>Sc(t,n,e));Bi.exports=Cc});var Xi=U((Nd,Ki)=>{"use strict";var xc=ir(),Rc=(r,e)=>r.sort((t,n)=>xc(n,t,e));Ki.exports=Rc});var Dt=U((Td,Ji)=>{"use strict";var vc=Pe(),jc=(r,e,t)=>vc(r,e,t)>0;Ji.exports=jc});var sr=U((Dd,Qi)=>{"use strict";var $c=Pe(),Ic=(r,e,t)=>$c(r,e,t)<0;Qi.exports=Ic});var Fr=U((qd,Zi)=>{"use strict";var Pc=Pe(),Lc=(r,e,t)=>Pc(r,e,t)===0;Zi.exports=Lc});var Ur=U((Md,es)=>{"use strict";var Nc=Pe(),Tc=(r,e,t)=>Nc(r,e,t)!==0;es.exports=Tc});var or=U((Fd,ts)=>{"use strict";var Dc=Pe(),qc=(r,e,t)=>Dc(r,e,t)>=0;ts.exports=qc});var ar=U((Ud,rs)=>{"use strict";var Mc=Pe(),Fc=(r,e,t)=>Mc(r,e,t)<=0;rs.exports=Fc});var zr=U((zd,ns)=>{"use strict";var Uc=Fr(),zc=Ur(),Gc=Dt(),kc=or(),Wc=sr(),Hc=ar(),Vc=(r,e,t,n)=>{switch(e){case"===":return typeof r=="object"&&(r=r.version),typeof t=="object"&&(t=t.version),r===t;case"!==":return typeof r=="object"&&(r=r.version),typeof t=="object"&&(t=t.version),r!==t;case"":case"=":case"==":return Uc(r,t,n);case"!=":return zc(r,t,n);case">":return Gc(r,t,n);case">=":return kc(r,t,n);case"<":return Wc(r,t,n);case"<=":return Hc(r,t,n);default:throw new TypeError(`Invalid operator: ${e}`)}};ns.exports=Vc});var ss=U((Gd,is)=>{"use strict";var Bc=me(),Yc=Qe(),{safeRe:cr,t:lr}=Ot(),Kc=(r,e)=>{if(r instanceof Bc)return r;if(typeof r=="number"&&(r=String(r)),typeof r!="string")return null;e=e||{};let t=null;if(!e.rtl)t=r.match(e.includePrerelease?cr[lr.COERCEFULL]:cr[lr.COERCE]);else{let u=e.includePrerelease?cr[lr.COERCERTLFULL]:cr[lr.COERCERTL],p;for(;(p=u.exec(r))&&(!t||t.index+t[0].length!==r.length);)(!t||p.index+p[0].length!==t.index+t[0].length)&&(t=p),u.lastIndex=p.index+p[1].length+p[2].length;u.lastIndex=-1}if(t===null)return null;let n=t[2],i=t[3]||"0",s=t[4]||"0",o=e.includePrerelease&&t[5]?`-${t[5]}`:"",c=e.includePrerelease&&t[6]?`+${t[6]}`:"";return Yc(`${n}.${i}.${s}${o}${c}`,e)};is.exports=Kc});var as=U((kd,os)=>{"use strict";var Xc=Qe(),Jc=wt(),Qc=me(),Zc=(r,e,t)=>{if(!Jc.RELEASE_TYPES.includes(e))return null;let n=el(r,t);return n&&tl(n,e)},el=(r,e)=>{let t=r instanceof Qc?r.version:r;return Xc(t,e)},tl=(r,e)=>{if(rl(e))return r.version;switch(r.prerelease=[],e){case"major":r.minor=0,r.patch=0;break;case"minor":r.patch=0;break}return r.format()},rl=r=>r.startsWith("pre");os.exports=Zc});var ls=U((Wd,cs)=>{"use strict";var Gr=class{constructor(){this.max=1e3,this.map=new Map}get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let i=this.map.keys().next().value;this.delete(i)}this.map.set(e,t)}return this}};cs.exports=Gr});var Le=U((Hd,ps)=>{"use strict";var nl=/\s+/g,kr=class r{constructor(e,t){if(t=sl(t),e instanceof r)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new r(e.raw,t);if(e instanceof Wr)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(nl," "),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(i=>!fs(i[0])),this.set.length===0)this.set=[n];else if(this.set.length>1){for(let i of this.set)if(i.length===1&&hl(i[0])){this.set=[i];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 t=this.set[e];for(let n=0;n<t.length;n++)n>0&&(this.formatted+=" "),this.formatted+=t[n].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){e=e.replace(pl,"");let n=((this.options.includePrerelease&&fl)|(this.options.loose&&dl))+":"+e,i=us.get(n);if(i)return i;let s=this.options.loose,o=s?Ae[ge.HYPHENRANGELOOSE]:Ae[ge.HYPHENRANGE];e=e.replace(o,Cl(this.options.includePrerelease)),re("hyphen replace",e),e=e.replace(Ae[ge.COMPARATORTRIM],cl),re("comparator trim",e),e=e.replace(Ae[ge.TILDETRIM],ll),re("tilde trim",e),e=e.replace(Ae[ge.CARETTRIM],ul),re("caret trim",e);let c=e.split(" ").map(l=>ml(l,this.options)).join(" ").split(/\s+/).map(l=>Sl(l,this.options));s&&(c=c.filter(l=>(re("loose invalid filter",l,this.options),!!l.match(Ae[ge.COMPARATORLOOSE])))),re("range list",c);let u=new Map,p=c.map(l=>new Wr(l,this.options));for(let l of p){if(fs(l))return[l];u.set(l.value,l)}u.size>1&&u.has("")&&u.delete("");let h=[...u.values()];return us.set(n,h),h}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Range is required");return this.set.some(n=>ds(n,t)&&e.set.some(i=>ds(i,t)&&n.every(s=>i.every(o=>s.intersects(o,t)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new ol(e,this.options)}catch{return!1}for(let t=0;t<this.set.length;t++)if(xl(this.set[t],e,this.options))return!0;return!1}};ps.exports=kr;var il=ls(),us=new il,sl=Zt(),Wr=qt(),re=Tt(),ol=me(),{safeRe:Ae,src:al,t:ge,comparatorTrimReplace:cl,tildeTrimReplace:ll,caretTrimReplace:ul}=Ot(),{FLAG_INCLUDE_PRERELEASE:fl,FLAG_LOOSE:dl}=wt(),pl=new RegExp(al[ge.BUILD],"g"),fs=r=>r.value==="<0.0.0-0",hl=r=>r.value==="",ds=(r,e)=>{let t=!0,n=r.slice(),i=n.pop();for(;t&&n.length;)t=n.every(s=>i.intersects(s,e)),i=n.pop();return t},ml=(r,e)=>(r=r.replace(Ae[ge.BUILD],""),re("comp",r,e),r=El(r,e),re("caret",r),r=yl(r,e),re("tildes",r),r=Ol(r,e),re("xrange",r),r=_l(r,e),re("stars",r),r),de=r=>!r||r.toLowerCase()==="x"||r==="*",gl=(r,e,t)=>de(r)&&!de(e)||de(e)&&t&&!de(t),yl=(r,e)=>r.trim().split(/\s+/).map(t=>bl(t,e)).join(" "),bl=(r,e)=>{let t=e.loose?Ae[ge.TILDELOOSE]:Ae[ge.TILDE],n=e.includePrerelease?"-0":"";return r.replace(t,(i,s,o,c,u)=>{re("tilde",r,i,s,o,c,u);let p;return de(s)?p="":de(o)?p=`>=${s}.0.0${n} <${+s+1}.0.0-0`:de(c)?p=`>=${s}.${o}.0${n} <${s}.${+o+1}.0-0`:u?(re("replaceTilde pr",u),p=`>=${s}.${o}.${c}-${u} <${s}.${+o+1}.0-0`):p=`>=${s}.${o}.${c} <${s}.${+o+1}.0-0`,re("tilde return",p),p})},El=(r,e)=>r.trim().split(/\s+/).map(t=>wl(t,e)).join(" "),wl=(r,e)=>{re("caret",r,e);let t=e.loose?Ae[ge.CARETLOOSE]:Ae[ge.CARET],n=e.includePrerelease?"-0":"";return r.replace(t,(i,s,o,c,u)=>{re("caret",r,i,s,o,c,u);let p;return de(s)?p="":de(o)?p=`>=${s}.0.0${n} <${+s+1}.0.0-0`:de(c)?s==="0"?p=`>=${s}.${o}.0${n} <${s}.${+o+1}.0-0`:p=`>=${s}.${o}.0${n} <${+s+1}.0.0-0`:u?(re("replaceCaret pr",u),s==="0"?o==="0"?p=`>=${s}.${o}.${c}-${u} <${s}.${o}.${+c+1}-0`:p=`>=${s}.${o}.${c}-${u} <${s}.${+o+1}.0-0`:p=`>=${s}.${o}.${c}-${u} <${+s+1}.0.0-0`):(re("no pr"),s==="0"?o==="0"?p=`>=${s}.${o}.${c} <${s}.${o}.${+c+1}-0`:p=`>=${s}.${o}.${c} <${s}.${+o+1}.0-0`:p=`>=${s}.${o}.${c} <${+s+1}.0.0-0`),re("caret return",p),p})},Ol=(r,e)=>(re("replaceXRanges",r,e),r.split(/\s+/).map(t=>Al(t,e)).join(" ")),Al=(r,e)=>{r=r.trim();let t=e.loose?Ae[ge.XRANGELOOSE]:Ae[ge.XRANGE];return r.replace(t,(n,i,s,o,c,u)=>{if(re("xRange",r,n,i,s,o,c,u),gl(s,o,c))return r;let p=de(s),h=p||de(o),l=h||de(c),b=l;return i==="="&&b&&(i=""),u=e.includePrerelease?"-0":"",p?i===">"||i==="<"?n="<0.0.0-0":n="*":i&&b?(h&&(o=0),c=0,i===">"?(i=">=",h?(s=+s+1,o=0,c=0):(o=+o+1,c=0)):i==="<="&&(i="<",h?s=+s+1:o=+o+1),i==="<"&&(u="-0"),n=`${i+s}.${o}.${c}${u}`):h?n=`>=${s}.0.0${u} <${+s+1}.0.0-0`:l&&(n=`>=${s}.${o}.0${u} <${s}.${+o+1}.0-0`),re("xRange return",n),n})},_l=(r,e)=>(re("replaceStars",r,e),r.trim().replace(Ae[ge.STAR],"")),Sl=(r,e)=>(re("replaceGTE0",r,e),r.trim().replace(Ae[e.includePrerelease?ge.GTE0PRE:ge.GTE0],"")),Cl=r=>(e,t,n,i,s,o,c,u,p,h,l,b)=>(de(n)?t="":de(i)?t=`>=${n}.0.0${r?"-0":""}`:de(s)?t=`>=${n}.${i}.0${r?"-0":""}`:o?t=`>=${t}`:t=`>=${t}${r?"-0":""}`,de(p)?u="":de(h)?u=`<${+p+1}.0.0-0`:de(l)?u=`<${p}.${+h+1}.0-0`:b?u=`<=${p}.${h}.${l}-${b}`:r?u=`<${p}.${h}.${+l+1}-0`:u=`<=${u}`,`${t} ${u}`.trim()),xl=(r,e,t)=>{for(let n=0;n<r.length;n++)if(!r[n].test(e))return!1;if(e.prerelease.length&&!t.includePrerelease){for(let n=0;n<r.length;n++)if(re(r[n].semver),r[n].semver!==Wr.ANY&&r[n].semver.prerelease.length>0){let i=r[n].semver;if(i.major===e.major&&i.minor===e.minor&&i.patch===e.patch)return!0}return!1}return!0}});var qt=U((Vd,Es)=>{"use strict";var Mt=Symbol("SemVer ANY"),Br=class r{static get ANY(){return Mt}constructor(e,t){if(t=hs(t),e instanceof r){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),Vr("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===Mt?this.value="":this.value=this.operator+this.semver.version,Vr("comp",this)}parse(e){let t=this.options.loose?ms[gs.COMPARATORLOOSE]:ms[gs.COMPARATOR],n=e.match(t);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 ys(n[2],this.options.loose):this.semver=Mt}toString(){return this.value}test(e){if(Vr("Comparator.test",e,this.options.loose),this.semver===Mt||e===Mt)return!0;if(typeof e=="string")try{e=new ys(e,this.options)}catch{return!1}return Hr(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new bs(e.value,t).test(this.value):e.operator===""?e.value===""?!0:new bs(this.value,t).test(e.semver):(t=hs(t),t.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!t.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("=")||Hr(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||Hr(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};Es.exports=Br;var hs=Zt(),{safeRe:ms,t:gs}=Ot(),Hr=zr(),Vr=Tt(),ys=me(),bs=Le()});var Ft=U((Bd,ws)=>{"use strict";var Rl=Le(),vl=(r,e,t)=>{try{e=new Rl(e,t)}catch{return!1}return e.test(r)};ws.exports=vl});var As=U((Yd,Os)=>{"use strict";var jl=Le(),$l=(r,e)=>new jl(r,e).set.map(t=>t.map(n=>n.value).join(" ").trim().split(" "));Os.exports=$l});var Ss=U((Kd,_s)=>{"use strict";var Il=me(),Pl=Le(),Ll=(r,e,t)=>{let n=null,i=null,s=null;try{s=new Pl(e,t)}catch{return null}return r.forEach(o=>{s.test(o)&&(!n||i.compare(o)===-1)&&(n=o,i=new Il(n,t))}),n};_s.exports=Ll});var xs=U((Xd,Cs)=>{"use strict";var Nl=me(),Tl=Le(),Dl=(r,e,t)=>{let n=null,i=null,s=null;try{s=new Tl(e,t)}catch{return null}return r.forEach(o=>{s.test(o)&&(!n||i.compare(o)===1)&&(n=o,i=new Nl(n,t))}),n};Cs.exports=Dl});var js=U((Jd,vs)=>{"use strict";var Yr=me(),ql=Le(),Rs=Dt(),Ml=(r,e)=>{r=new ql(r,e);let t=new Yr("0.0.0");if(r.test(t)||(t=new Yr("0.0.0-0"),r.test(t)))return t;t=null;for(let n=0;n<r.set.length;++n){let i=r.set[n],s=null;i.forEach(o=>{let c=new Yr(o.semver.version);switch(o.operator){case">":c.prerelease.length===0?c.patch++:c.prerelease.push(0),c.raw=c.format();case"":case">=":(!s||Rs(c,s))&&(s=c);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),s&&(!t||Rs(t,s))&&(t=s)}return t&&r.test(t)?t:null};vs.exports=Ml});var Is=U((Qd,$s)=>{"use strict";var Fl=Le(),Ul=(r,e)=>{try{return new Fl(r,e).range||"*"}catch{return null}};$s.exports=Ul});var ur=U((Zd,Ts)=>{"use strict";var zl=me(),Ns=qt(),{ANY:Gl}=Ns,kl=Le(),Wl=Ft(),Ps=Dt(),Ls=sr(),Hl=ar(),Vl=or(),Bl=(r,e,t,n)=>{r=new zl(r,n),e=new kl(e,n);let i,s,o,c,u;switch(t){case">":i=Ps,s=Hl,o=Ls,c=">",u=">=";break;case"<":i=Ls,s=Vl,o=Ps,c="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Wl(r,e,n))return!1;for(let p=0;p<e.set.length;++p){let h=e.set[p],l=null,b=null;if(h.forEach(g=>{g.semver===Gl&&(g=new Ns(">=0.0.0")),l=l||g,b=b||g,i(g.semver,l.semver,n)?l=g:o(g.semver,b.semver,n)&&(b=g)}),l.operator===c||l.operator===u||(!b.operator||b.operator===c)&&s(r,b.semver))return!1;if(b.operator===u&&o(r,b.semver))return!1}return!0};Ts.exports=Bl});var qs=U((ep,Ds)=>{"use strict";var Yl=ur(),Kl=(r,e,t)=>Yl(r,e,">",t);Ds.exports=Kl});var Fs=U((tp,Ms)=>{"use strict";var Xl=ur(),Jl=(r,e,t)=>Xl(r,e,"<",t);Ms.exports=Jl});var Gs=U((rp,zs)=>{"use strict";var Us=Le(),Ql=(r,e,t)=>(r=new Us(r,t),e=new Us(e,t),r.intersects(e,t));zs.exports=Ql});var Ws=U((np,ks)=>{"use strict";var Zl=Ft(),eu=Pe();ks.exports=(r,e,t)=>{let n=[],i=null,s=null,o=r.sort((h,l)=>eu(h,l,t));for(let h of o)Zl(h,e,t)?(s=h,i||(i=h)):(s&&n.push([i,s]),s=null,i=null);i&&n.push([i,null]);let c=[];for(let[h,l]of n)h===l?c.push(h):!l&&h===o[0]?c.push("*"):l?h===o[0]?c.push(`<=${l}`):c.push(`${h} - ${l}`):c.push(`>=${h}`);let u=c.join(" || "),p=typeof e.raw=="string"?e.raw:String(e);return u.length<p.length?u:e}});var Xs=U((ip,Ks)=>{"use strict";var Hs=Le(),Jr=qt(),{ANY:Kr}=Jr,Xr=Ft(),Qr=Pe(),tu=(r,e,t={})=>{if(r===e)return!0;r=new Hs(r,t),e=new Hs(e,t);let n=!1;e:for(let i of r.set){for(let s of e.set){let o=nu(i,s,t);if(n=n||o!==null,o)continue e}if(n)return!1}return!0},ru=[new Jr(">=0.0.0-0")],Vs=[new Jr(">=0.0.0")],nu=(r,e,t)=>{if(r===e)return!0;if(r.length===1&&r[0].semver===Kr){if(e.length===1&&e[0].semver===Kr)return!0;t.includePrerelease?r=ru:r=Vs}if(e.length===1&&e[0].semver===Kr){if(t.includePrerelease)return!0;e=Vs}let n=new Set,i,s;for(let g of r)g.operator===">"||g.operator===">="?i=Bs(i,g,t):g.operator==="<"||g.operator==="<="?s=Ys(s,g,t):n.add(g.semver);if(n.size>1)return null;let o;if(i&&s){if(o=Qr(i.semver,s.semver,t),o>0)return null;if(o===0&&(i.operator!==">="||s.operator!=="<="))return null}for(let g of n){if(i&&!Xr(g,String(i),t)||s&&!Xr(g,String(s),t))return null;for(let w of e)if(!Xr(g,String(w),t))return!1;return!0}let c,u,p,h,l=s&&!t.includePrerelease&&s.semver.prerelease.length?s.semver:!1,b=i&&!t.includePrerelease&&i.semver.prerelease.length?i.semver:!1;l&&l.prerelease.length===1&&s.operator==="<"&&l.prerelease[0]===0&&(l=!1);for(let g of e){if(h=h||g.operator===">"||g.operator===">=",p=p||g.operator==="<"||g.operator==="<=",i){if(b&&g.semver.prerelease&&g.semver.prerelease.length&&g.semver.major===b.major&&g.semver.minor===b.minor&&g.semver.patch===b.patch&&(b=!1),g.operator===">"||g.operator===">="){if(c=Bs(i,g,t),c===g&&c!==i)return!1}else if(i.operator===">="&&!g.test(i.semver))return!1}if(s){if(l&&g.semver.prerelease&&g.semver.prerelease.length&&g.semver.major===l.major&&g.semver.minor===l.minor&&g.semver.patch===l.patch&&(l=!1),g.operator==="<"||g.operator==="<="){if(u=Ys(s,g,t),u===g&&u!==s)return!1}else if(s.operator==="<="&&!g.test(s.semver))return!1}if(!g.operator&&(s||i)&&o!==0)return!1}return!(i&&p&&!s&&o!==0||s&&h&&!i&&o!==0||b||l)},Bs=(r,e,t)=>{if(!r)return e;let n=Qr(r.semver,e.semver,t);return n>0?r:n<0||e.operator===">"&&r.operator===">="?e:r},Ys=(r,e,t)=>{if(!r)return e;let n=Qr(r.semver,e.semver,t);return n<0?r:n>0||e.operator==="<"&&r.operator==="<="?e:r};Ks.exports=tu});var fr=U((sp,Zs)=>{"use strict";var Zr=Ot(),Js=wt(),iu=me(),Qs=Dr(),su=Qe(),ou=Ai(),au=Si(),cu=Ri(),lu=$i(),uu=Pi(),fu=Ni(),du=Di(),pu=Mi(),hu=Pe(),mu=Gi(),gu=Wi(),yu=ir(),bu=Yi(),Eu=Xi(),wu=Dt(),Ou=sr(),Au=Fr(),_u=Ur(),Su=or(),Cu=ar(),xu=zr(),Ru=ss(),vu=as(),ju=qt(),$u=Le(),Iu=Ft(),Pu=As(),Lu=Ss(),Nu=xs(),Tu=js(),Du=Is(),qu=ur(),Mu=qs(),Fu=Fs(),Uu=Gs(),zu=Ws(),Gu=Xs();Zs.exports={parse:su,valid:ou,clean:au,inc:cu,diff:lu,major:uu,minor:fu,patch:du,prerelease:pu,compare:hu,rcompare:mu,compareLoose:gu,compareBuild:yu,sort:bu,rsort:Eu,gt:wu,lt:Ou,eq:Au,neq:_u,gte:Su,lte:Cu,cmp:xu,coerce:Ru,truncate:vu,Comparator:ju,Range:$u,satisfies:Iu,toComparators:Pu,maxSatisfying:Lu,minSatisfying:Nu,minVersion:Tu,validRange:Du,outside:qu,gtr:Mu,ltr:Fu,intersects:Uu,simplifyRange:zu,subset:Gu,SemVer:iu,re:Zr.re,src:Zr.src,tokens:Zr.t,SEMVER_SPEC_VERSION:Js.SEMVER_SPEC_VERSION,RELEASE_TYPES:Js.RELEASE_TYPES,compareIdentifiers:Qs.compareIdentifiers,rcompareIdentifiers:Qs.rcompareIdentifiers}});var dr=Lt(fr(),1);import*as Ut from"node:process";try{let r=ti?.node;typeof r=="string"&&!dr.satisfies(Ut.version,r)&&K.warn(`
|
|
8
|
+
import{a as ri,f as te}from"./chunks/U5DIFWGH.js";import{c as ni}from"./chunks/4PTNG4EI.js";import{a as Jt}from"./chunks/SCB6ZITR.js";import{a as Na,b as si,c as oi}from"./chunks/GHSNC2OX.js";import{a as ai}from"./chunks/6TFC2OYQ.js";import{a as Zn}from"./chunks/JUZHXP62.js";import{a as Ta}from"./chunks/GKXY6U4S.js";import{a as ii,c as Qt,d as Lr,e as ci,g as li}from"./chunks/TZMWTSOQ.js";import{a as Ie,b as ei,c as ti}from"./chunks/B6V4SOCA.js";import{Ba as Qn,O as Wn,R as Hn,Z as Vn,a as Gn,aa as Yt,ba as Bn,c as we,ea as Nt,ia as K,ja as Kt,ka as Yn,l as Pr,oa as Oe,pa as Xt,sa as Kn,u as kn,va as Xn,wa as Jn}from"./chunks/VAPFU7OM.js";import"./chunks/NEWT5A6S.js";import{a as ze,c as U,e as Lt}from"./chunks/RFWIIJFG.js";var wt=U((md,ui)=>{"use strict";var Da="2.0.0",qa=Number.MAX_SAFE_INTEGER||9007199254740991,Ma=16,Fa=250,Ua=["major","premajor","minor","preminor","patch","prepatch","prerelease"];ui.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:Ma,MAX_SAFE_BUILD_LENGTH:Fa,MAX_SAFE_INTEGER:qa,RELEASE_TYPES:Ua,SEMVER_SPEC_VERSION:Da,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Tt=U((gd,fi)=>{"use strict";var za=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...r)=>console.error("SEMVER",...r):()=>{};fi.exports=za});var Ot=U((Ge,di)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:Nr,MAX_SAFE_BUILD_LENGTH:Ga,MAX_LENGTH:ka}=wt(),Wa=Tt();Ge=di.exports={};var Ha=Ge.re=[],Va=Ge.safeRe=[],C=Ge.src=[],Ba=Ge.safeSrc=[],x=Ge.t={},Ya=0,Tr="[a-zA-Z0-9-]",Ka=[["\\s",1],["\\d",ka],[Tr,Ga]],Xa=r=>{for(let[e,t]of Ka)r=r.split(`${e}*`).join(`${e}{0,${t}}`).split(`${e}+`).join(`${e}{1,${t}}`);return r},k=(r,e,t)=>{let n=Xa(e),i=Ya++;Wa(r,i,e),x[r]=i,C[i]=e,Ba[i]=n,Ha[i]=new RegExp(e,t?"g":void 0),Va[i]=new RegExp(n,t?"g":void 0)};k("NUMERICIDENTIFIER","0|[1-9]\\d*");k("NUMERICIDENTIFIERLOOSE","\\d+");k("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Tr}*`);k("MAINVERSION",`(${C[x.NUMERICIDENTIFIER]})\\.(${C[x.NUMERICIDENTIFIER]})\\.(${C[x.NUMERICIDENTIFIER]})`);k("MAINVERSIONLOOSE",`(${C[x.NUMERICIDENTIFIERLOOSE]})\\.(${C[x.NUMERICIDENTIFIERLOOSE]})\\.(${C[x.NUMERICIDENTIFIERLOOSE]})`);k("PRERELEASEIDENTIFIER",`(?:${C[x.NONNUMERICIDENTIFIER]}|${C[x.NUMERICIDENTIFIER]})`);k("PRERELEASEIDENTIFIERLOOSE",`(?:${C[x.NONNUMERICIDENTIFIER]}|${C[x.NUMERICIDENTIFIERLOOSE]})`);k("PRERELEASE",`(?:-(${C[x.PRERELEASEIDENTIFIER]}(?:\\.${C[x.PRERELEASEIDENTIFIER]})*))`);k("PRERELEASELOOSE",`(?:-?(${C[x.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${C[x.PRERELEASEIDENTIFIERLOOSE]})*))`);k("BUILDIDENTIFIER",`${Tr}+`);k("BUILD",`(?:\\+(${C[x.BUILDIDENTIFIER]}(?:\\.${C[x.BUILDIDENTIFIER]})*))`);k("FULLPLAIN",`v?${C[x.MAINVERSION]}${C[x.PRERELEASE]}?${C[x.BUILD]}?`);k("FULL",`^${C[x.FULLPLAIN]}$`);k("LOOSEPLAIN",`[v=\\s]*${C[x.MAINVERSIONLOOSE]}${C[x.PRERELEASELOOSE]}?${C[x.BUILD]}?`);k("LOOSE",`^${C[x.LOOSEPLAIN]}$`);k("GTLT","((?:<|>)?=?)");k("XRANGEIDENTIFIERLOOSE",`${C[x.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);k("XRANGEIDENTIFIER",`${C[x.NUMERICIDENTIFIER]}|x|X|\\*`);k("XRANGEPLAIN",`[v=\\s]*(${C[x.XRANGEIDENTIFIER]})(?:\\.(${C[x.XRANGEIDENTIFIER]})(?:\\.(${C[x.XRANGEIDENTIFIER]})(?:${C[x.PRERELEASE]})?${C[x.BUILD]}?)?)?`);k("XRANGEPLAINLOOSE",`[v=\\s]*(${C[x.XRANGEIDENTIFIERLOOSE]})(?:\\.(${C[x.XRANGEIDENTIFIERLOOSE]})(?:\\.(${C[x.XRANGEIDENTIFIERLOOSE]})(?:${C[x.PRERELEASELOOSE]})?${C[x.BUILD]}?)?)?`);k("XRANGE",`^${C[x.GTLT]}\\s*${C[x.XRANGEPLAIN]}$`);k("XRANGELOOSE",`^${C[x.GTLT]}\\s*${C[x.XRANGEPLAINLOOSE]}$`);k("COERCEPLAIN",`(^|[^\\d])(\\d{1,${Nr}})(?:\\.(\\d{1,${Nr}}))?(?:\\.(\\d{1,${Nr}}))?`);k("COERCE",`${C[x.COERCEPLAIN]}(?:$|[^\\d])`);k("COERCEFULL",C[x.COERCEPLAIN]+`(?:${C[x.PRERELEASE]})?(?:${C[x.BUILD]})?(?:$|[^\\d])`);k("COERCERTL",C[x.COERCE],!0);k("COERCERTLFULL",C[x.COERCEFULL],!0);k("LONETILDE","(?:~>?)");k("TILDETRIM",`(\\s*)${C[x.LONETILDE]}\\s+`,!0);Ge.tildeTrimReplace="$1~";k("TILDE",`^${C[x.LONETILDE]}${C[x.XRANGEPLAIN]}$`);k("TILDELOOSE",`^${C[x.LONETILDE]}${C[x.XRANGEPLAINLOOSE]}$`);k("LONECARET","(?:\\^)");k("CARETTRIM",`(\\s*)${C[x.LONECARET]}\\s+`,!0);Ge.caretTrimReplace="$1^";k("CARET",`^${C[x.LONECARET]}${C[x.XRANGEPLAIN]}$`);k("CARETLOOSE",`^${C[x.LONECARET]}${C[x.XRANGEPLAINLOOSE]}$`);k("COMPARATORLOOSE",`^${C[x.GTLT]}\\s*(${C[x.LOOSEPLAIN]})$|^$`);k("COMPARATOR",`^${C[x.GTLT]}\\s*(${C[x.FULLPLAIN]})$|^$`);k("COMPARATORTRIM",`(\\s*)${C[x.GTLT]}\\s*(${C[x.LOOSEPLAIN]}|${C[x.XRANGEPLAIN]})`,!0);Ge.comparatorTrimReplace="$1$2$3";k("HYPHENRANGE",`^\\s*(${C[x.XRANGEPLAIN]})\\s+-\\s+(${C[x.XRANGEPLAIN]})\\s*$`);k("HYPHENRANGELOOSE",`^\\s*(${C[x.XRANGEPLAINLOOSE]})\\s+-\\s+(${C[x.XRANGEPLAINLOOSE]})\\s*$`);k("STAR","(<|>)?=?\\s*\\*");k("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");k("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Zt=U((yd,pi)=>{"use strict";var Ja=Object.freeze({loose:!0}),Qa=Object.freeze({}),Za=r=>r?typeof r!="object"?Ja:r:Qa;pi.exports=Za});var Dr=U((bd,gi)=>{"use strict";var hi=/^[0-9]+$/,mi=(r,e)=>{if(typeof r=="number"&&typeof e=="number")return r===e?0:r<e?-1:1;let t=hi.test(r),n=hi.test(e);return t&&n&&(r=+r,e=+e),r===e?0:t&&!n?-1:n&&!t?1:r<e?-1:1},ec=(r,e)=>mi(e,r);gi.exports={compareIdentifiers:mi,rcompareIdentifiers:ec}});var me=U((Ed,bi)=>{"use strict";var er=Tt(),{MAX_LENGTH:yi,MAX_SAFE_INTEGER:tr}=wt(),{safeRe:rr,t:nr}=Ot(),tc=Zt(),{compareIdentifiers:qr}=Dr(),rc=(r,e)=>{let t=e.split(".");if(t.length>r.length)return!1;for(let n=0;n<t.length;n++)if(qr(r[n],t[n])!==0)return!1;return!0},Mr=class r{constructor(e,t){if(t=tc(t),e instanceof r){if(e.loose===!!t.loose&&e.includePrerelease===!!t.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>yi)throw new TypeError(`version is longer than ${yi} characters`);er("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let n=e.trim().match(t.loose?rr[nr.LOOSE]:rr[nr.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>tr||this.major<0)throw new TypeError("Invalid major version");if(this.minor>tr||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>tr||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){let s=+i;if(s>=0&&s<tr)return s}return i}):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(er("SemVer.compare",this.version,this.options,e),!(e instanceof r)){if(typeof e=="string"&&e===this.version)return 0;e=new r(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof r||(e=new r(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 r||(e=new r(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 t=0;do{let n=this.prerelease[t],i=e.prerelease[t];if(er("prerelease compare",t,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return qr(n,i)}while(++t)}compareBuild(e){e instanceof r||(e=new r(e,this.options));let t=0;do{let n=this.build[t],i=e.build[t];if(er("build compare",t,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return qr(n,i)}while(++t)}inc(e,t,n){if(e.startsWith("pre")){if(!t&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(t){let i=`-${t}`.match(this.options.loose?rr[nr.PRERELEASELOOSE]:rr[nr.PRERELEASE]);if(!i||i[1]!==t)throw new Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,n),this.inc("pre",t,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",t,n),this.inc("pre",t,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 i=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[i];else{let s=this.prerelease.length;for(;--s>=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(t===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(t){let s=[t,i];if(n===!1&&(s=[t]),rc(this.prerelease,t)){let o=this.prerelease[t.split(".").length];isNaN(o)&&(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}};bi.exports=Mr});var Qe=U((wd,wi)=>{"use strict";var Ei=me(),nc=(r,e,t=!1)=>{if(r instanceof Ei)return r;try{return new Ei(r,e)}catch(n){if(!t)return null;throw n}};wi.exports=nc});var Ai=U((Od,Oi)=>{"use strict";var ic=Qe(),sc=(r,e)=>{let t=ic(r,e);return t?t.version:null};Oi.exports=sc});var Si=U((Ad,_i)=>{"use strict";var oc=Qe(),ac=(r,e)=>{let t=oc(r.trim().replace(/^[=v]+/,""),e);return t?t.version:null};_i.exports=ac});var Ri=U((_d,xi)=>{"use strict";var Ci=me(),cc=(r,e,t,n,i)=>{typeof t=="string"&&(i=n,n=t,t=void 0);try{return new Ci(r instanceof Ci?r.version:r,t).inc(e,n,i).version}catch{return null}};xi.exports=cc});var $i=U((Sd,ji)=>{"use strict";var vi=Qe(),lc=(r,e)=>{let t=vi(r,null,!0),n=vi(e,null,!0),i=t.compare(n);if(i===0)return null;let s=i>0,o=s?t:n,c=s?n:t,u=!!o.prerelease.length;if(!!c.prerelease.length&&!u){if(!c.patch&&!c.minor)return"major";if(c.compareMain(o)===0)return c.minor&&!c.patch?"minor":"patch"}let h=u?"pre":"";return t.major!==n.major?h+"major":t.minor!==n.minor?h+"minor":t.patch!==n.patch?h+"patch":"prerelease"};ji.exports=lc});var Pi=U((Cd,Ii)=>{"use strict";var uc=me(),fc=(r,e)=>new uc(r,e).major;Ii.exports=fc});var Ni=U((xd,Li)=>{"use strict";var dc=me(),pc=(r,e)=>new dc(r,e).minor;Li.exports=pc});var Di=U((Rd,Ti)=>{"use strict";var hc=me(),mc=(r,e)=>new hc(r,e).patch;Ti.exports=mc});var Mi=U((vd,qi)=>{"use strict";var gc=Qe(),yc=(r,e)=>{let t=gc(r,e);return t&&t.prerelease.length?t.prerelease:null};qi.exports=yc});var Pe=U((jd,Ui)=>{"use strict";var Fi=me(),bc=(r,e,t)=>new Fi(r,t).compare(new Fi(e,t));Ui.exports=bc});var Gi=U(($d,zi)=>{"use strict";var Ec=Pe(),wc=(r,e,t)=>Ec(e,r,t);zi.exports=wc});var Wi=U((Id,ki)=>{"use strict";var Oc=Pe(),Ac=(r,e)=>Oc(r,e,!0);ki.exports=Ac});var ir=U((Pd,Vi)=>{"use strict";var Hi=me(),_c=(r,e,t)=>{let n=new Hi(r,t),i=new Hi(e,t);return n.compare(i)||n.compareBuild(i)};Vi.exports=_c});var Yi=U((Ld,Bi)=>{"use strict";var Sc=ir(),Cc=(r,e)=>r.sort((t,n)=>Sc(t,n,e));Bi.exports=Cc});var Xi=U((Nd,Ki)=>{"use strict";var xc=ir(),Rc=(r,e)=>r.sort((t,n)=>xc(n,t,e));Ki.exports=Rc});var Dt=U((Td,Ji)=>{"use strict";var vc=Pe(),jc=(r,e,t)=>vc(r,e,t)>0;Ji.exports=jc});var sr=U((Dd,Qi)=>{"use strict";var $c=Pe(),Ic=(r,e,t)=>$c(r,e,t)<0;Qi.exports=Ic});var Fr=U((qd,Zi)=>{"use strict";var Pc=Pe(),Lc=(r,e,t)=>Pc(r,e,t)===0;Zi.exports=Lc});var Ur=U((Md,es)=>{"use strict";var Nc=Pe(),Tc=(r,e,t)=>Nc(r,e,t)!==0;es.exports=Tc});var or=U((Fd,ts)=>{"use strict";var Dc=Pe(),qc=(r,e,t)=>Dc(r,e,t)>=0;ts.exports=qc});var ar=U((Ud,rs)=>{"use strict";var Mc=Pe(),Fc=(r,e,t)=>Mc(r,e,t)<=0;rs.exports=Fc});var zr=U((zd,ns)=>{"use strict";var Uc=Fr(),zc=Ur(),Gc=Dt(),kc=or(),Wc=sr(),Hc=ar(),Vc=(r,e,t,n)=>{switch(e){case"===":return typeof r=="object"&&(r=r.version),typeof t=="object"&&(t=t.version),r===t;case"!==":return typeof r=="object"&&(r=r.version),typeof t=="object"&&(t=t.version),r!==t;case"":case"=":case"==":return Uc(r,t,n);case"!=":return zc(r,t,n);case">":return Gc(r,t,n);case">=":return kc(r,t,n);case"<":return Wc(r,t,n);case"<=":return Hc(r,t,n);default:throw new TypeError(`Invalid operator: ${e}`)}};ns.exports=Vc});var ss=U((Gd,is)=>{"use strict";var Bc=me(),Yc=Qe(),{safeRe:cr,t:lr}=Ot(),Kc=(r,e)=>{if(r instanceof Bc)return r;if(typeof r=="number"&&(r=String(r)),typeof r!="string")return null;e=e||{};let t=null;if(!e.rtl)t=r.match(e.includePrerelease?cr[lr.COERCEFULL]:cr[lr.COERCE]);else{let u=e.includePrerelease?cr[lr.COERCERTLFULL]:cr[lr.COERCERTL],p;for(;(p=u.exec(r))&&(!t||t.index+t[0].length!==r.length);)(!t||p.index+p[0].length!==t.index+t[0].length)&&(t=p),u.lastIndex=p.index+p[1].length+p[2].length;u.lastIndex=-1}if(t===null)return null;let n=t[2],i=t[3]||"0",s=t[4]||"0",o=e.includePrerelease&&t[5]?`-${t[5]}`:"",c=e.includePrerelease&&t[6]?`+${t[6]}`:"";return Yc(`${n}.${i}.${s}${o}${c}`,e)};is.exports=Kc});var as=U((kd,os)=>{"use strict";var Xc=Qe(),Jc=wt(),Qc=me(),Zc=(r,e,t)=>{if(!Jc.RELEASE_TYPES.includes(e))return null;let n=el(r,t);return n&&tl(n,e)},el=(r,e)=>{let t=r instanceof Qc?r.version:r;return Xc(t,e)},tl=(r,e)=>{if(rl(e))return r.version;switch(r.prerelease=[],e){case"major":r.minor=0,r.patch=0;break;case"minor":r.patch=0;break}return r.format()},rl=r=>r.startsWith("pre");os.exports=Zc});var ls=U((Wd,cs)=>{"use strict";var Gr=class{constructor(){this.max=1e3,this.map=new Map}get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let i=this.map.keys().next().value;this.delete(i)}this.map.set(e,t)}return this}};cs.exports=Gr});var Le=U((Hd,ps)=>{"use strict";var nl=/\s+/g,kr=class r{constructor(e,t){if(t=sl(t),e instanceof r)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new r(e.raw,t);if(e instanceof Wr)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(nl," "),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(i=>!fs(i[0])),this.set.length===0)this.set=[n];else if(this.set.length>1){for(let i of this.set)if(i.length===1&&hl(i[0])){this.set=[i];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 t=this.set[e];for(let n=0;n<t.length;n++)n>0&&(this.formatted+=" "),this.formatted+=t[n].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){e=e.replace(pl,"");let n=((this.options.includePrerelease&&fl)|(this.options.loose&&dl))+":"+e,i=us.get(n);if(i)return i;let s=this.options.loose,o=s?Ae[ge.HYPHENRANGELOOSE]:Ae[ge.HYPHENRANGE];e=e.replace(o,Cl(this.options.includePrerelease)),re("hyphen replace",e),e=e.replace(Ae[ge.COMPARATORTRIM],cl),re("comparator trim",e),e=e.replace(Ae[ge.TILDETRIM],ll),re("tilde trim",e),e=e.replace(Ae[ge.CARETTRIM],ul),re("caret trim",e);let c=e.split(" ").map(l=>ml(l,this.options)).join(" ").split(/\s+/).map(l=>Sl(l,this.options));s&&(c=c.filter(l=>(re("loose invalid filter",l,this.options),!!l.match(Ae[ge.COMPARATORLOOSE])))),re("range list",c);let u=new Map,p=c.map(l=>new Wr(l,this.options));for(let l of p){if(fs(l))return[l];u.set(l.value,l)}u.size>1&&u.has("")&&u.delete("");let h=[...u.values()];return us.set(n,h),h}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Range is required");return this.set.some(n=>ds(n,t)&&e.set.some(i=>ds(i,t)&&n.every(s=>i.every(o=>s.intersects(o,t)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new ol(e,this.options)}catch{return!1}for(let t=0;t<this.set.length;t++)if(xl(this.set[t],e,this.options))return!0;return!1}};ps.exports=kr;var il=ls(),us=new il,sl=Zt(),Wr=qt(),re=Tt(),ol=me(),{safeRe:Ae,src:al,t:ge,comparatorTrimReplace:cl,tildeTrimReplace:ll,caretTrimReplace:ul}=Ot(),{FLAG_INCLUDE_PRERELEASE:fl,FLAG_LOOSE:dl}=wt(),pl=new RegExp(al[ge.BUILD],"g"),fs=r=>r.value==="<0.0.0-0",hl=r=>r.value==="",ds=(r,e)=>{let t=!0,n=r.slice(),i=n.pop();for(;t&&n.length;)t=n.every(s=>i.intersects(s,e)),i=n.pop();return t},ml=(r,e)=>(r=r.replace(Ae[ge.BUILD],""),re("comp",r,e),r=El(r,e),re("caret",r),r=yl(r,e),re("tildes",r),r=Ol(r,e),re("xrange",r),r=_l(r,e),re("stars",r),r),de=r=>!r||r.toLowerCase()==="x"||r==="*",gl=(r,e,t)=>de(r)&&!de(e)||de(e)&&t&&!de(t),yl=(r,e)=>r.trim().split(/\s+/).map(t=>bl(t,e)).join(" "),bl=(r,e)=>{let t=e.loose?Ae[ge.TILDELOOSE]:Ae[ge.TILDE],n=e.includePrerelease?"-0":"";return r.replace(t,(i,s,o,c,u)=>{re("tilde",r,i,s,o,c,u);let p;return de(s)?p="":de(o)?p=`>=${s}.0.0${n} <${+s+1}.0.0-0`:de(c)?p=`>=${s}.${o}.0${n} <${s}.${+o+1}.0-0`:u?(re("replaceTilde pr",u),p=`>=${s}.${o}.${c}-${u} <${s}.${+o+1}.0-0`):p=`>=${s}.${o}.${c} <${s}.${+o+1}.0-0`,re("tilde return",p),p})},El=(r,e)=>r.trim().split(/\s+/).map(t=>wl(t,e)).join(" "),wl=(r,e)=>{re("caret",r,e);let t=e.loose?Ae[ge.CARETLOOSE]:Ae[ge.CARET],n=e.includePrerelease?"-0":"";return r.replace(t,(i,s,o,c,u)=>{re("caret",r,i,s,o,c,u);let p;return de(s)?p="":de(o)?p=`>=${s}.0.0${n} <${+s+1}.0.0-0`:de(c)?s==="0"?p=`>=${s}.${o}.0${n} <${s}.${+o+1}.0-0`:p=`>=${s}.${o}.0${n} <${+s+1}.0.0-0`:u?(re("replaceCaret pr",u),s==="0"?o==="0"?p=`>=${s}.${o}.${c}-${u} <${s}.${o}.${+c+1}-0`:p=`>=${s}.${o}.${c}-${u} <${s}.${+o+1}.0-0`:p=`>=${s}.${o}.${c}-${u} <${+s+1}.0.0-0`):(re("no pr"),s==="0"?o==="0"?p=`>=${s}.${o}.${c} <${s}.${o}.${+c+1}-0`:p=`>=${s}.${o}.${c} <${s}.${+o+1}.0-0`:p=`>=${s}.${o}.${c} <${+s+1}.0.0-0`),re("caret return",p),p})},Ol=(r,e)=>(re("replaceXRanges",r,e),r.split(/\s+/).map(t=>Al(t,e)).join(" ")),Al=(r,e)=>{r=r.trim();let t=e.loose?Ae[ge.XRANGELOOSE]:Ae[ge.XRANGE];return r.replace(t,(n,i,s,o,c,u)=>{if(re("xRange",r,n,i,s,o,c,u),gl(s,o,c))return r;let p=de(s),h=p||de(o),l=h||de(c),b=l;return i==="="&&b&&(i=""),u=e.includePrerelease?"-0":"",p?i===">"||i==="<"?n="<0.0.0-0":n="*":i&&b?(h&&(o=0),c=0,i===">"?(i=">=",h?(s=+s+1,o=0,c=0):(o=+o+1,c=0)):i==="<="&&(i="<",h?s=+s+1:o=+o+1),i==="<"&&(u="-0"),n=`${i+s}.${o}.${c}${u}`):h?n=`>=${s}.0.0${u} <${+s+1}.0.0-0`:l&&(n=`>=${s}.${o}.0${u} <${s}.${+o+1}.0-0`),re("xRange return",n),n})},_l=(r,e)=>(re("replaceStars",r,e),r.trim().replace(Ae[ge.STAR],"")),Sl=(r,e)=>(re("replaceGTE0",r,e),r.trim().replace(Ae[e.includePrerelease?ge.GTE0PRE:ge.GTE0],"")),Cl=r=>(e,t,n,i,s,o,c,u,p,h,l,b)=>(de(n)?t="":de(i)?t=`>=${n}.0.0${r?"-0":""}`:de(s)?t=`>=${n}.${i}.0${r?"-0":""}`:o?t=`>=${t}`:t=`>=${t}${r?"-0":""}`,de(p)?u="":de(h)?u=`<${+p+1}.0.0-0`:de(l)?u=`<${p}.${+h+1}.0-0`:b?u=`<=${p}.${h}.${l}-${b}`:r?u=`<${p}.${h}.${+l+1}-0`:u=`<=${u}`,`${t} ${u}`.trim()),xl=(r,e,t)=>{for(let n=0;n<r.length;n++)if(!r[n].test(e))return!1;if(e.prerelease.length&&!t.includePrerelease){for(let n=0;n<r.length;n++)if(re(r[n].semver),r[n].semver!==Wr.ANY&&r[n].semver.prerelease.length>0){let i=r[n].semver;if(i.major===e.major&&i.minor===e.minor&&i.patch===e.patch)return!0}return!1}return!0}});var qt=U((Vd,Es)=>{"use strict";var Mt=Symbol("SemVer ANY"),Br=class r{static get ANY(){return Mt}constructor(e,t){if(t=hs(t),e instanceof r){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),Vr("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===Mt?this.value="":this.value=this.operator+this.semver.version,Vr("comp",this)}parse(e){let t=this.options.loose?ms[gs.COMPARATORLOOSE]:ms[gs.COMPARATOR],n=e.match(t);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 ys(n[2],this.options.loose):this.semver=Mt}toString(){return this.value}test(e){if(Vr("Comparator.test",e,this.options.loose),this.semver===Mt||e===Mt)return!0;if(typeof e=="string")try{e=new ys(e,this.options)}catch{return!1}return Hr(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new bs(e.value,t).test(this.value):e.operator===""?e.value===""?!0:new bs(this.value,t).test(e.semver):(t=hs(t),t.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!t.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("=")||Hr(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||Hr(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};Es.exports=Br;var hs=Zt(),{safeRe:ms,t:gs}=Ot(),Hr=zr(),Vr=Tt(),ys=me(),bs=Le()});var Ft=U((Bd,ws)=>{"use strict";var Rl=Le(),vl=(r,e,t)=>{try{e=new Rl(e,t)}catch{return!1}return e.test(r)};ws.exports=vl});var As=U((Yd,Os)=>{"use strict";var jl=Le(),$l=(r,e)=>new jl(r,e).set.map(t=>t.map(n=>n.value).join(" ").trim().split(" "));Os.exports=$l});var Ss=U((Kd,_s)=>{"use strict";var Il=me(),Pl=Le(),Ll=(r,e,t)=>{let n=null,i=null,s=null;try{s=new Pl(e,t)}catch{return null}return r.forEach(o=>{s.test(o)&&(!n||i.compare(o)===-1)&&(n=o,i=new Il(n,t))}),n};_s.exports=Ll});var xs=U((Xd,Cs)=>{"use strict";var Nl=me(),Tl=Le(),Dl=(r,e,t)=>{let n=null,i=null,s=null;try{s=new Tl(e,t)}catch{return null}return r.forEach(o=>{s.test(o)&&(!n||i.compare(o)===1)&&(n=o,i=new Nl(n,t))}),n};Cs.exports=Dl});var js=U((Jd,vs)=>{"use strict";var Yr=me(),ql=Le(),Rs=Dt(),Ml=(r,e)=>{r=new ql(r,e);let t=new Yr("0.0.0");if(r.test(t)||(t=new Yr("0.0.0-0"),r.test(t)))return t;t=null;for(let n=0;n<r.set.length;++n){let i=r.set[n],s=null;i.forEach(o=>{let c=new Yr(o.semver.version);switch(o.operator){case">":c.prerelease.length===0?c.patch++:c.prerelease.push(0),c.raw=c.format();case"":case">=":(!s||Rs(c,s))&&(s=c);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),s&&(!t||Rs(t,s))&&(t=s)}return t&&r.test(t)?t:null};vs.exports=Ml});var Is=U((Qd,$s)=>{"use strict";var Fl=Le(),Ul=(r,e)=>{try{return new Fl(r,e).range||"*"}catch{return null}};$s.exports=Ul});var ur=U((Zd,Ts)=>{"use strict";var zl=me(),Ns=qt(),{ANY:Gl}=Ns,kl=Le(),Wl=Ft(),Ps=Dt(),Ls=sr(),Hl=ar(),Vl=or(),Bl=(r,e,t,n)=>{r=new zl(r,n),e=new kl(e,n);let i,s,o,c,u;switch(t){case">":i=Ps,s=Hl,o=Ls,c=">",u=">=";break;case"<":i=Ls,s=Vl,o=Ps,c="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Wl(r,e,n))return!1;for(let p=0;p<e.set.length;++p){let h=e.set[p],l=null,b=null;if(h.forEach(g=>{g.semver===Gl&&(g=new Ns(">=0.0.0")),l=l||g,b=b||g,i(g.semver,l.semver,n)?l=g:o(g.semver,b.semver,n)&&(b=g)}),l.operator===c||l.operator===u||(!b.operator||b.operator===c)&&s(r,b.semver))return!1;if(b.operator===u&&o(r,b.semver))return!1}return!0};Ts.exports=Bl});var qs=U((ep,Ds)=>{"use strict";var Yl=ur(),Kl=(r,e,t)=>Yl(r,e,">",t);Ds.exports=Kl});var Fs=U((tp,Ms)=>{"use strict";var Xl=ur(),Jl=(r,e,t)=>Xl(r,e,"<",t);Ms.exports=Jl});var Gs=U((rp,zs)=>{"use strict";var Us=Le(),Ql=(r,e,t)=>(r=new Us(r,t),e=new Us(e,t),r.intersects(e,t));zs.exports=Ql});var Ws=U((np,ks)=>{"use strict";var Zl=Ft(),eu=Pe();ks.exports=(r,e,t)=>{let n=[],i=null,s=null,o=r.sort((h,l)=>eu(h,l,t));for(let h of o)Zl(h,e,t)?(s=h,i||(i=h)):(s&&n.push([i,s]),s=null,i=null);i&&n.push([i,null]);let c=[];for(let[h,l]of n)h===l?c.push(h):!l&&h===o[0]?c.push("*"):l?h===o[0]?c.push(`<=${l}`):c.push(`${h} - ${l}`):c.push(`>=${h}`);let u=c.join(" || "),p=typeof e.raw=="string"?e.raw:String(e);return u.length<p.length?u:e}});var Xs=U((ip,Ks)=>{"use strict";var Hs=Le(),Jr=qt(),{ANY:Kr}=Jr,Xr=Ft(),Qr=Pe(),tu=(r,e,t={})=>{if(r===e)return!0;r=new Hs(r,t),e=new Hs(e,t);let n=!1;e:for(let i of r.set){for(let s of e.set){let o=nu(i,s,t);if(n=n||o!==null,o)continue e}if(n)return!1}return!0},ru=[new Jr(">=0.0.0-0")],Vs=[new Jr(">=0.0.0")],nu=(r,e,t)=>{if(r===e)return!0;if(r.length===1&&r[0].semver===Kr){if(e.length===1&&e[0].semver===Kr)return!0;t.includePrerelease?r=ru:r=Vs}if(e.length===1&&e[0].semver===Kr){if(t.includePrerelease)return!0;e=Vs}let n=new Set,i,s;for(let g of r)g.operator===">"||g.operator===">="?i=Bs(i,g,t):g.operator==="<"||g.operator==="<="?s=Ys(s,g,t):n.add(g.semver);if(n.size>1)return null;let o;if(i&&s){if(o=Qr(i.semver,s.semver,t),o>0)return null;if(o===0&&(i.operator!==">="||s.operator!=="<="))return null}for(let g of n){if(i&&!Xr(g,String(i),t)||s&&!Xr(g,String(s),t))return null;for(let w of e)if(!Xr(g,String(w),t))return!1;return!0}let c,u,p,h,l=s&&!t.includePrerelease&&s.semver.prerelease.length?s.semver:!1,b=i&&!t.includePrerelease&&i.semver.prerelease.length?i.semver:!1;l&&l.prerelease.length===1&&s.operator==="<"&&l.prerelease[0]===0&&(l=!1);for(let g of e){if(h=h||g.operator===">"||g.operator===">=",p=p||g.operator==="<"||g.operator==="<=",i){if(b&&g.semver.prerelease&&g.semver.prerelease.length&&g.semver.major===b.major&&g.semver.minor===b.minor&&g.semver.patch===b.patch&&(b=!1),g.operator===">"||g.operator===">="){if(c=Bs(i,g,t),c===g&&c!==i)return!1}else if(i.operator===">="&&!g.test(i.semver))return!1}if(s){if(l&&g.semver.prerelease&&g.semver.prerelease.length&&g.semver.major===l.major&&g.semver.minor===l.minor&&g.semver.patch===l.patch&&(l=!1),g.operator==="<"||g.operator==="<="){if(u=Ys(s,g,t),u===g&&u!==s)return!1}else if(s.operator==="<="&&!g.test(s.semver))return!1}if(!g.operator&&(s||i)&&o!==0)return!1}return!(i&&p&&!s&&o!==0||s&&h&&!i&&o!==0||b||l)},Bs=(r,e,t)=>{if(!r)return e;let n=Qr(r.semver,e.semver,t);return n>0?r:n<0||e.operator===">"&&r.operator===">="?e:r},Ys=(r,e,t)=>{if(!r)return e;let n=Qr(r.semver,e.semver,t);return n<0?r:n>0||e.operator==="<"&&r.operator==="<="?e:r};Ks.exports=tu});var fr=U((sp,Zs)=>{"use strict";var Zr=Ot(),Js=wt(),iu=me(),Qs=Dr(),su=Qe(),ou=Ai(),au=Si(),cu=Ri(),lu=$i(),uu=Pi(),fu=Ni(),du=Di(),pu=Mi(),hu=Pe(),mu=Gi(),gu=Wi(),yu=ir(),bu=Yi(),Eu=Xi(),wu=Dt(),Ou=sr(),Au=Fr(),_u=Ur(),Su=or(),Cu=ar(),xu=zr(),Ru=ss(),vu=as(),ju=qt(),$u=Le(),Iu=Ft(),Pu=As(),Lu=Ss(),Nu=xs(),Tu=js(),Du=Is(),qu=ur(),Mu=qs(),Fu=Fs(),Uu=Gs(),zu=Ws(),Gu=Xs();Zs.exports={parse:su,valid:ou,clean:au,inc:cu,diff:lu,major:uu,minor:fu,patch:du,prerelease:pu,compare:hu,rcompare:mu,compareLoose:gu,compareBuild:yu,sort:bu,rsort:Eu,gt:wu,lt:Ou,eq:Au,neq:_u,gte:Su,lte:Cu,cmp:xu,coerce:Ru,truncate:vu,Comparator:ju,Range:$u,satisfies:Iu,toComparators:Pu,maxSatisfying:Lu,minSatisfying:Nu,minVersion:Tu,validRange:Du,outside:qu,gtr:Mu,ltr:Fu,intersects:Uu,simplifyRange:zu,subset:Gu,SemVer:iu,re:Zr.re,src:Zr.src,tokens:Zr.t,SEMVER_SPEC_VERSION:Js.SEMVER_SPEC_VERSION,RELEASE_TYPES:Js.RELEASE_TYPES,compareIdentifiers:Qs.compareIdentifiers,rcompareIdentifiers:Qs.rcompareIdentifiers}});var dr=Lt(fr(),1);import*as Ut from"node:process";try{let r=ti?.node;typeof r=="string"&&!dr.satisfies(Ut.version,r)&&K.warn(`
|
|
9
9
|
\u26A0\uFE0F Warning: failed to satisfy expected node version. Expected: "${r}", Current "${Ut.version}"
|
|
10
10
|
|
|
11
11
|
`),dr.major(Ut.version)===20&&K.info(Jt([Vn(Bn("Deprecation warning: Node.js 20 support is ending")),"","Node.js 20 reached end-of-life on April 30, 2026.","Future Redocly CLI releases require Node.js 22.12.0 or later.",`You are using Node.js ${Ut.version}.`,"",`Update Node.js: ${Nt("https://nodejs.org/en/download")}`]))}catch{}var Pa=Lt(Na(),1);import*as La from"node:path";import{notStrictEqual as pf,strictEqual as hf}from"assert";var ku={right:Yu,center:Ku},Wu=0,pr=1,Hu=2,hr=3,en=class{constructor(e){var t;this.width=e.width,this.wrap=(t=e.wrap)!==null&&t!==void 0?t:!0,this.rows=[]}span(...e){let t=this.div(...e);t.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 t=e.map(n=>typeof n=="string"?this.colFromString(n):n);return this.rows.push(t),t}shouldApplyLayoutDSL(...e){return e.length===1&&typeof e[0]=="string"&&/[\t\n]/.test(e[0])}applyLayoutDSL(e){let t=e.split(`
|
|
@@ -122,7 +122,7 @@ Eject that one and set the framework in your copy's default export:
|
|
|
122
122
|
# then in generators/tanstack-query/index.ts: run: tanstackQueryGenerator('${n}')
|
|
123
123
|
`);return}if(!Rt.has(t))throw te.eject_generator_outcome="unknown-generator",new Oe(`
|
|
124
124
|
\u274C Unknown generator "${t}". Ejectable generators: ${[...Rt].join(", ")}.
|
|
125
|
-
`);let i=Gf(),s=kf(i,t),{GENERATOR_VERSION:o}=await import("./chunks/
|
|
125
|
+
`);let i=Gf(),s=kf(i,t),{GENERATOR_VERSION:o}=await import("./chunks/A55KSVEI.js"),c=Ff(r.dir??"./generators"),u=s===void 0?H(c,`${t}.mjs`):H(c,t,"index.ts"),p=Fe(process.cwd(),u)||u;if(r.update){if(s===void 0){let A=be(H(i,"generators",`${t}.mjs`),"utf-8");Bf({name:t,asset:A,toolkitVersion:o,assetsDir:i,dir:c,target:u,printedTarget:p})}else Vf({name:t,files:s,toolkitVersion:o,assetsDir:i,dir:c,targetDir:H(c,t)});return}if(ye(u)&&!r.force)throw te.eject_generator_outcome="already-exists",new Oe(`
|
|
126
126
|
\u274C ${p} already exists. Use --update to merge the newer version in, or --force to overwrite.
|
|
127
127
|
`);jn(Vt(u),{recursive:!0});let h=s===void 0?[be(H(i,"generators",`${t}.mjs`),"utf-8")]:s.map(A=>be(H(i,"generators",t,A),"utf-8"));s===void 0?ae(u,h[0],"utf-8"):s.forEach((A,G)=>{ae(H(c,t,A),h[G],"utf-8")});let l=ra("client-generators",i),b=ra(`${t}-generator`,i);$n(c,Pn(c));let g=`./${Fe(e.configPath===void 0?process.cwd():Zo(Vt(e.configPath)),Zo(u)).split("\\").join("/")}`,w=Ln({[Ce]:o}),d=h.some(A=>A.includes(`from "${xn}"`)||A.includes(`from '${xn}'`)),S=Hf(e.configPath,t,g),N=s===void 0?p:Fe(process.cwd(),H(c,t))+"/";K.info(`Ejected the "${t}" generator to ${N}.
|
|
128
128
|
`+(w==="added"?`Added ${Ce} to devDependencies (the ejected file imports its toolkit) \u2014 run your installer.
|
|
@@ -146,13 +146,13 @@ Reference: ${zf}
|
|
|
146
146
|
- ${o.message}`)}if(r["lint-config"]==="off"||n.document===void 0)return n;let i=await Qn({config:n,severity:r["lint-config"]||"warn"}),s=Xn(i);if(Jn(i,{maxProblems:r["max-problems"],totals:s,version:e,command:"check-config"}),nd(s,Ea(r)),s.errors>0)throw new Xt("Config check failed.");return n}function nd(r,e){r.errors>0?K.error(`\u274C Your config has ${r.errors} ${Pr("error",r.errors)}.
|
|
147
147
|
`):r.warnings>0?K.warn(`\u26A0\uFE0F Your config has ${r.warnings} ${Pr("warning",r.warnings)}.
|
|
148
148
|
`):e==="check-config"&&K.info(Yt(`\u2705 Your config is valid.
|
|
149
|
-
`))}import{execSync as id}from"node:child_process";import*as It from"node:fs";import{existsSync as sd,writeFileSync as od,readFileSync as _a}from"node:fs";import*as Sa from"node:os";import{tmpdir as Ca}from"node:os";import{dirname as Aa,join as $r}from"node:path";async function Oa(r=Qt){try{return await vr(ii,{timeout:r}),!0}catch{return!1}}var jr="***";async function xa({config:r,argv:e,exit_code:t,execution_time:n,spec_version:i,spec_keyword:s,spec_full_version:o,respect_x_security_auth_types:c,respect_source_description_types:u,respect_criterion_object_types:p,lint_rules_with_errors:h,lint_rules_with_warnings:l,lint_rules_with_ignored_problems:b,generate_client:g,eject_generator:w,bundle:d}){try{if(!e||!await Oa(1e3))return;let{_:[N],$0:A,...G}=e,{RedoclyOAuthClient:W,getReuniteUrl:xe}=await import("./chunks/
|
|
149
|
+
`))}import{execSync as id}from"node:child_process";import*as It from"node:fs";import{existsSync as sd,writeFileSync as od,readFileSync as _a}from"node:fs";import*as Sa from"node:os";import{tmpdir as Ca}from"node:os";import{dirname as Aa,join as $r}from"node:path";async function Oa(r=Qt){try{return await vr(ii,{timeout:r}),!0}catch{return!1}}var jr="***";async function xa({config:r,argv:e,exit_code:t,execution_time:n,spec_version:i,spec_keyword:s,spec_full_version:o,respect_x_security_auth_types:c,respect_source_description_types:u,respect_criterion_object_types:p,lint_rules_with_errors:h,lint_rules_with_warnings:l,lint_rules_with_ignored_problems:b,generate_client:g,eject_generator:w,bundle:d}){try{if(!e||!await Oa(1e3))return;let{_:[N],$0:A,...G}=e,{RedoclyOAuthClient:W,getReuniteUrl:xe}=await import("./chunks/5KWYBSEY.js"),Ye=new W(Ie),Ke=xe(r,G.residency),Xe=await Ye.isAuthorized(Ke),V=hd();V||(V=`ann_${li()}`,pd(V));let We=Kt(i),$=[{id:N,object:"command",uri:`urn:redocly:cli:command:${N}`,logged_in:Xe?"yes":"no",command:N,...ud(G,process.argv.slice(2)),node_version:process.version,npm_version:dd(),version:Ie,exit_code:t,execution_time:n,metadata:process.env.REDOCLY_CLI_TELEMETRY_METADATA,environment_ci:process.env.CI,environment:process.env.REDOCLY_ENVIRONMENT,has_config:typeof r?.document?.parsed>"u"?"no":"yes",spec_version:i,spec_keyword:s,spec_full_version:o,respect_x_security_auth_types:We==="arazzo1"&&c?.length?JSON.stringify(c):void 0,respect_source_description_types:We==="arazzo1"&&u?.length?JSON.stringify(u):void 0,respect_criterion_object_types:We==="arazzo1"&&p?.length?JSON.stringify(p):void 0,lint_rules_with_errors:h?.length?JSON.stringify(h):void 0,lint_rules_with_warnings:l?.length?JSON.stringify(l):void 0,lint_rules_with_ignored_problems:b?.length?JSON.stringify(b):void 0,generate_client_builtin_generators:g?.generate_client_builtin_generators?.length?JSON.stringify(g.generate_client_builtin_generators):void 0,generate_client_custom_generators_count:g?.generate_client_custom_generators_count,generate_client_toolkit_imports:g?.generate_client_toolkit_imports?.length?JSON.stringify(g.generate_client_toolkit_imports):void 0,generate_client_error_category:g?.generate_client_error_category,generate_client_ejected_generators:g?.generate_client_ejected_generators?.length?JSON.stringify(g.generate_client_ejected_generators):void 0,generate_client_composed_apis_count:g?.generate_client_composed_apis_count,eject_generator_action:w?.eject_generator_action,eject_generator_name:w?.eject_generator_name,eject_generator_outcome:w?.eject_generator_outcome,eject_generator_conflicts:w?.eject_generator_conflicts,eject_generator_from_version:w?.eject_generator_from_version,eject_generator_to_version:w?.eject_generator_to_version,bundle_overlays_count:d?.bundle_overlays_count}],_=ci.mapToCloudEvent({type:"com.redocly.command.ran",source:"urn:redocly:cli",origin:"redocly-cli",env:"production",osPlatform:Sa.platform(),actor:{id:V,object:"user",uri:""},category:"product",data:$}),{otelTelemetry:L}=await import("./chunks/QJUYBSEZ.js");L.send(_)}catch{}}function Ra(r,e){for(let t of r.sourceDescriptions??[])t.type&&e.add(t.type)}function va(r,e){for(let t of r.workflows??[]){$t(t.successActions,e),$t(t.failureActions,e);for(let n of t.steps??[])ja(n.successCriteria,e),$t(n.onSuccess,e),$t(n.onFailure,e)}$t(Object.values(r.components?.successActions??{}),e),$t(Object.values(r.components?.failureActions??{}),e)}function $t(r,e){for(let t of r??[])ja(t.criteria,e)}function ja(r,e){for(let t of r??[]){let n=ad(t);n&&e.add(n)}}function ad(r){let e=r.type;return typeof e=="string"?e:e?.type||(r.condition?"simple":void 0)}function $a(r,e){for(let t of r.workflows??[]){for(let n of t["x-security"]??[]){let i=n.scheme;if(i?.type){let s=i.type==="http"?i.scheme:i.type;s&&e.add(s)}}for(let n of t.steps??[])for(let i of n["x-security"]??[]){let s=i.scheme;if(s?.type){let c=s.type==="http"?s.scheme:s.type;c&&e.add(c)}let o=i.schemeName;o&&e.add(o)}}}function cd(r){return It.existsSync(r)&&It.statSync(r).isFile()}function ld(r){return It.existsSync(r)&&It.statSync(r).isDirectory()}function Mn(r){return r&&(kn(r)?r.split("://")[0]+"://url":cd(r)?r.replace(/.+\.([^.]+)$/,(e,t)=>"file-"+t):ld(r)?"folder":r)}function Fn(r,e,t){let n=Array.isArray(e)?e:[e];for(let i of n)i.length>1&&(r=r.replaceAll(i,t));return r}function Ia(r,e){let t={};for(let[n,i]of Object.entries(r))e.includes(n)?t[n]=jr:we(i)?t[n]=Ia(i,e):t[n]=i;return t}function Un(r,e,t=[]){if(Array.isArray(r))return r.forEach(n=>Un(n,e,t)),t;if(we(r))for(let[n,i]of Object.entries(r))e.includes(n)&&typeof i=="string"?t.push(i):(we(i)||Array.isArray(i))&&Un(i,e,t);return t}function ud(r,e){let t=["organization","o","input","i","author","a","clientCert","clientKey","caCert","server","S"],n=e.join(" "),i={};for(let[s,o]of Object.entries(r))if(t.includes(s))i[s]=jr,n=Fn(n,o,jr);else if(typeof o=="string"){let c=Mn(o);i[s]=c,n=Fn(n,o,c)}else if(Array.isArray(o)){i[s]=o.map(Mn);for(let c of o){let u=Mn(c);n.includes(c)&&(n=n.replaceAll(c,u))}}else if(we(o)){let c=Un(o,t);for(let u of c)n=Fn(n,u,jr);i[s]=Ia(o,t)}else i[s]=o;return{arguments:JSON.stringify(i),raw_input:n}}var fd=process.platform==="win32"?$r(Aa(process.execPath),"node_modules","npm","package.json"):$r(Aa(process.execPath),"..","lib","node_modules","npm","package.json");function dd(){try{return JSON.parse(_a(fd,"utf8")).version}catch{}try{return id("npm -v",{stdio:["ignore","pipe","ignore"]}).toString().trim()}catch{return"unknown"}}var pd=r=>{if(!(process.env.CI||!r))try{let t=$r(Ca(),Lr);od(t,r)}catch{}},hd=()=>{if(!process.env.CI)try{let e=$r(Ca(),Lr);return sd(e)?_a(e).toString().trim():void 0}catch{return}};function J(r,e={}){return async t=>{let n=performance.now(),i=2,s,o="unknown",c,u,p,h=new Set,l=new Set,b=new Set,g=({parsed:A,source:G})=>{if(o="unknown",c=void 0,u=void 0,G?.absoluteRef&&Hn(G.absoluteRef)){o="graphql";return}try{o=Yn(A)}catch{o="unsupported"}we(A)&&(c=A?.openapi?"openapi":A?.swagger?"swagger":A?.asyncapi?"asyncapi":A?.arazzo?"arazzo":A?.overlay?"overlay":void 0,c&&(u=A[c]),Kt(o)==="arazzo1"&&($a(A,h),Ra(A,l),va(A,b)))},w=new Set,d=new Set,S=new Set,N=A=>{for(let G of A)G.ignored?S.add(G.ruleId):G.severity==="error"?w.add(G.ruleId):G.severity==="warn"&&d.add(G.ruleId)};try{if(t.config&&!Gn(t.config))throw new Oe("Please provide a valid path to the configuration file.");p=await wa(t,Ie,e.plugins),s=p.resolvedConfig.telemetry,i=1,typeof r=="function"&&await r({argv:t,config:p,version:Ie,collectSpecData:g,collectResults:N}),i=0}catch(A){A instanceof Xt||(A instanceof Oe?K.error(A.message+`
|
|
150
150
|
|
|
151
151
|
`):(K.error(`An unexpected error occurred. This is likely a bug that should be reported.
|
|
152
152
|
`),K.error(A instanceof Error?A.stack||A.message:String(A)),K.error(`
|
|
153
153
|
`)))}finally{if(process.env.REDOCLY_TELEMETRY!=="off"&&s!=="off"){let A=Math.round(performance.now()-n);await xa({config:p,argv:t,exit_code:i,execution_time:A,spec_version:o,spec_keyword:c,spec_full_version:u,respect_x_security_auth_types:[...h],respect_source_description_types:[...l],respect_criterion_object_types:[...b],lint_rules_with_errors:[...w],lint_rules_with_warnings:[...d],lint_rules_with_ignored_problems:[...S],generate_client:ri,eject_generator:te,bundle:ai})}process.once("beforeExit",()=>{process.exit(i)})}}}Pa.config({path:La.resolve(process.cwd(),"./.env")});ya();Qo(on(process.argv)).version(!1).option("version",{type:"boolean",description:"Show version number.",global:!1}).middleware(r=>{r.version&&r._.length===0&&(K.output(`${Ie}
|
|
154
|
-
`),process.exit(0))},!0).help("help","Show help.").parserConfiguration({"greedy-arrays":!1,"boolean-negation":!1}).command("stats [api]","Show statistics for an API description.",r=>r.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"}}),async r=>{let{handleStats:e}=await import("./chunks/XYU2LTWU.js");J(e)(r)}).command("inspect-node-types <api>","Show the node types of an API description, for writing configurable rules and custom plugins [experimental].",r=>r.env("REDOCLY_CLI_INSPECT_NODE_TYPES").positional("api",{description:"API description file to inspect.",type:"string",demandOption:!0}).option({config:{description:"Path to the config file.",type:"string"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"},pointer:{description:"JSON pointer to a node, optionally prefixed with a file: `#/paths` or `schemas.yaml#/User`.",type:"string",alias:"p"},type:{description:"List only the nodes of this type.",type:"string"},summary:{description:"List the node types used in the description, with counts.",type:"boolean"},parents:{description:"Show the chain of node types leading to the node: down to the node with --pointer, or the distinct chains that reach the type with --type.",type:"boolean"}}).conflicts({pointer:["type","summary"],type:["summary"],summary:["parents"]}).check(e=>{if(e.parents&&!e.pointer&&!e.type)throw new Error("The --parents option requires --pointer or --type.");return!0}),async r=>{let{handleInspectNodeTypes:e}=await import("./chunks/B5ZOH4BB.js");J(e)(r)}).command("score [api]","Score an API description for integration simplicity and agent readiness.",r=>r.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"}}),async r=>{let{handleScore:e}=await import("./chunks/XDBFHG7X.js");J(e)(r)}).command("split [api]","Split an API description into a multi-file structure.",r=>r.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:"_"},"file-name-conflicts-severity":{description:"Severity level for file name conflicts.",choices:["warn","error","off"],default:"warn"},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"),async r=>{let{handleSplit:e}=await import("./chunks/2DKR4Z25.js");J(e)(r)}).command("join [apis...]","Join multiple API descriptions into one [experimental].",r=>r.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"}}),async r=>{let{handleJoin:e}=await import("./chunks/OGNRVBTI.js");J(e)(r)}).command("push-status [pushId]",!1,r=>r.env("REDOCLY_CLI_PUSH_STATUS").positional("pushId",{description:"Push id.",type:"string",demandOption:!0}).implies("max-execution-time","wait").option({organization:{description:"ID of the organization to push to.",type:"string",alias:"o",required:!0},project:{description:"ID of the project to push to.",type:"string",required:!0,alias:"p"},domain:{description:"Specify a domain.",alias:"d",type:"string",required:!1},wait:{description:"Wait for build to finish.",type:"boolean",default:!1},"max-execution-time":{description:"Maximum execution time in seconds.",type:"number"},"continue-on-deploy-failures":{description:"Command does not fail even if the deployment fails.",type:"boolean",default:!1},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}),async r=>{let{handlePushStatus:e}=await import("./chunks/6FADWAOY.js");J(e)(r)}).command("push [files...]","Push documents to Reunite.",r=>r.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:"ID of the organization to push to.",type:"string",alias:"o",required:!0},project:{description:"ID 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:ba},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},replace:{description:"Remove the files under the mount path that are not part of this push.",type:"boolean",default:!1},verbose:{type:"boolean",default:!1},"continue-on-deploy-failures":{description:"Command does not fail even if the deployment fails.",type:"boolean",default:!1}}),async r=>{let{handlePush:e}=await import("./chunks/6MP4DHWK.js");J(e)(r)}).command("recheck [paths..]","Lint Markdown prose and structure from the recheck block in redocly.yaml.",r=>r.env("REDOCLY_CLI_RECHECK").positional("paths",{array:!0,type:"string",describe:"Files or directories to lint. Default: the current directory."}).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:["table","json","sarif","github-actions"],default:"table"},tags:{description:"Run only rules with these tags.",array:!0,type:"string"},rule:{description:"Run only these rules.",alias:"r",array:!0,type:"string"},"skip-rule":{description:"Skip these rules.",array:!0,type:"string"},stats:{description:"Print rule statistics.",alias:"s",type:"boolean"},fix:{description:"Apply fixes to Markdown files.",alias:"f",type:"boolean"},"max-problems":{description:"Maximum number of problems in the report.",type:"number"},summary:{description:"Print a run summary.",choices:["json","text"],type:"string"},"summary-path":{description:"Write the summary to a file.",type:"string"},readability:{description:"Report readability scores instead of linting.",type:"boolean"},"generate-baseline":{description:"Write the baseline file from the current findings.",type:"boolean"},"generate-markdoc-schema":{description:"Generate a Markdoc tag schema from theme modules.",type:"boolean"},from:{description:"Module paths to read Markdoc tags from (with --generate-markdoc-schema).",array:!0,type:"string"},output:{description:"Output file for the generated schema.",type:"string"},check:{description:"Fail if the generated schema differs from --output.",type:"boolean"}}),async r=>{let{handleRecheck:e}=await import("./chunks/GRTUPOKN.js"),{recheckPresetsPlugin:t}=await import("./chunks/WSDNWUOV.js");J(e,{plugins:[t]})(r)}).command("lint [apis...]","Lint an API or Arazzo description.",r=>r.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"}}),async r=>{let{handleLint:e}=await import("./chunks/2MCPXKB6.js");J(e)(r)}).command("bundle [apis...]","Bundle a multi-file API description to a single file.",r=>r.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:Zn},"skip-preprocessor":{description:"Ignore certain preprocessors.",array:!0,type:"string"},"skip-decorator":{description:"Ignore certain decorators.",array:!0,type:"string"},overlay:{description:"Overlay file to apply. Repeat to apply several, in order.",array:!0,type:"string",requiresArg:!0},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}),async r=>{let{handleBundle:e}=await import("./chunks/BWXAXULF.js");J(e)(r)}).command("check-config","Lint the Redocly configuration file.",async r=>r.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"}}),r=>{J()(r)}).command("login","Log in to Redocly.",async r=>r.env("REDOCLY_CLI_LOGIN").options({residency:{description:"Residency of the application. Defaults to `us`.",alias:["r"],type:"string"},config:{description:"Path to the config file.",requiresArg:!0,type:"string"},verbose:{alias:"v",describe:"Apply verbose mode.",type:"boolean"}}),async r=>{let{handleLogin:e}=await import("./chunks/N4R4236N.js");J(e)(r)}).command("logout","Clear your stored credentials.",r=>r,async r=>{let{handleLogout:e}=await import("./chunks/ALBI5SPY.js");J(e)(r)}).command("project","[early access] Work with a Redocly-hosted project.",r=>r.env("REDOCLY_CLI_PROJECT").command("clone <project> [directory]","Clone a Redocly-hosted project as a Git repository.",e=>e.positional("project",{description:"Organization and project slugs or IDs, as `<organization>/<project>`.",type:"string",demandOption:!0}).positional("directory",{description:"Directory to clone into. Defaults to the project.",type:"string"}).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"}}),async e=>{let{handleProjectClone:t}=await import("./chunks/ULQK2S4O.js");J(t)(e)}).command("git-credentials <operation>",!1,e=>e.positional("operation",{description:"Credential helper operation: get, store, or erase.",type:"string",demandOption:!0}),async e=>{let{handleProjectGitCredentials:t}=await import("./chunks/OS52EARM.js");process.stdout.write(await t({operation:e.operation,input:process.stdin,version:Ie}))}).demandCommand(1,"Specify a project subcommand: clone.")).command("preview","Preview Redocly project using one of the product NPM packages.",r=>r.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:ni,default:"enterprise"},port:{alias:"p",type:"number",description:"Preview port.",default:4e3,coerce:st("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"}}),async r=>{process.argv.some(t=>t.startsWith("--source-dir"))&&K.error(`Option --source-dir is deprecated and will be removed soon. Use --project-dir instead.
|
|
155
|
-
`);let{previewProject:e}=await import("./chunks/WQBSNQXL.js");J(e)(r)}).command("build-docs [api]","Produce API documentation as an HTML file",r=>r.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 r=>{let{handlerBuildCommand:e}=await import("./chunks/VWF52WKH.js");J(e)(r)}).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.",r=>r.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"}}),async r=>{let{handleTranslations:e}=await import("./chunks/TWFZE4OF.js");J(e)(r)}).command("eject <type> [path]","Helper function to eject project elements for customization.",r=>r.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"}}),async r=>{let{handleEject:e}=await import("./chunks/CVPT656W.js");J(e)(r)}).command("respect [files...]","Run Arazzo tests.",r=>r.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:pa},severity:{describe:"Severity of the check.",type:"string"},"max-steps":{describe:"Maximum number of steps to run (default: 2000).",type:"number",default:2e3,coerce:st("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:st("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:st("execution-timeout",!1)},"no-secrets-masking":{describe:"Do not mask secrets in the output.",type:"boolean",default:!1}}),async r=>{let{handleRespect:e}=await import("./chunks/ENIPOAVJ.js");J(e)(r)}).command("generate-arazzo <descriptionPath>","Auto-generate arazzo description file from an API description.",r=>r.env("REDOCLY_CLI_GENERATE_ARAZZO").positional("descriptionPath",{describe:"Description file path.",type:"string"}).options({"output-file":{alias:"o",describe:"Output File name.",type:"string",requiresArg:!0},"with-ai":{describe:"Redesign the generated workflows with an AI provider, using the OpenAPI description as context.",type:"boolean",default:!1},"ai-provider":{describe:'AI provider used with --with-ai; runs the "claude", "codex", or "cursor" CLI in non-interactive mode.',choices:["claude","codex","cursor"],default:"claude"},"ai-model":{describe:"Model passed to the selected AI provider (provider-specific default applies).",type:"string"},"ai-concurrency":{describe:"Number of workflows designed in parallel with --with-ai for large descriptions.",type:"number",default:4,coerce:st("ai-concurrency",!0)},"max-workflows":{describe:"Most workflows the AI may design with --with-ai.",type:"number",default:10,coerce:st("max-workflows",!0)}}),async r=>{let{handleGenerateArazzo:e}=await import("./chunks/DL4VP2Z4.js");J(e)(r)}).command("generate-client [api]","Generate a TypeScript client from an OpenAPI description [experimental].",r=>r.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 r=>{let{handleGenerateClient:e}=await import("./chunks/GKCVQWOQ.js");J(e)(r)}).command("eject-generator [generator]","Vendor a built-in client generator into your repo as an editable file [experimental].",r=>r.positional("generator",{describe:`Built-in generator to eject (${[...Rt].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 r=>{J(fa)(r)}).command("generate-spec <traffic>","Infer an OpenAPI description from recorded HTTP traffic, optionally refined with AI [experimental].",r=>r.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:st("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 r=>{let{handleGenerateSpec:e}=await import("./chunks/U4RAHOFK.js");J(e)(r)}).command("introspect-mcp [server-url]","Introspect a running MCP server and record its capabilities in the x-mcp extension of an OpenAPI description [experimental].",r=>r.env("REDOCLY_CLI_INTROSPECT_MCP").positional("server-url",{describe:"URL of the MCP server (Streamable HTTP, with a fallback to the legacy HTTP+SSE transport). Alternative to --command.",type:"string"}).option({command:{describe:'Command that starts a local MCP server to introspect over stdio, for example "npx -y my-mcp-server". Quote arguments that contain spaces. Alternative to a server URL.',type:"string",requiresArg:!0},output:{alias:"o",describe:"OpenAPI description file to create or update.",type:"string",default:"openapi.yaml"},header:{alias:"H",describe:'Header sent with every request to the MCP server, in "Name: value" format. Repeat the option for multiple headers.',array:!0,type:"string"},check:{describe:"Verify the description is up to date with the MCP server instead of writing: report the differences and exit with an error when it is not.",type:"boolean",default:!1},config:{describe:"Path to the config file.",type:"string"}}).check(e=>{if(!!e["server-url"]==!!e.command)throw new Error("Provide either an MCP server URL or --command, not both.");if(e.command&&e.header)throw new Error("The --header option only applies to an MCP server URL.");return!0}),async r=>{let{handleIntrospectMcp:e}=await import("./chunks/HYMULX2S.js");J(e)(r)}).command("scorecard-classic [api]","Run quality scorecards with multiple rule levels to validate and maintain API description standards.",r=>r.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 r=>{let{handleScorecardClassic:e}=await import("./chunks/IH3N62Q4.js");J(e)(r)}).command("drift <traffic>","Detect drift between recorded HTTP traffic and an OpenAPI description [experimental].",r=>r.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"},coverage:{describe:"Print how much of the description the traffic exercised: operations, parameters, schema properties, and response codes.",type:"boolean",default:!1},"coverage-output":{describe:"Write a detailed JSON coverage report (per operation, with covered and missing items) to this file.",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 r=>{let{handleDrift:e}=await import("./chunks/ZFXOCOU6.js");J(e)(r)}).command("proxy","Capture live HTTP traffic through a reverse proxy into a HAR file, optionally validating it against an OpenAPI description [experimental].",r=>r.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 r=>{let{handleProxy:e}=await import("./chunks/Z4X6WES7.js");J(e)(r)}).completion("completion","Generate autocomplete script for `redocly` command.").demandCommand(1).middleware([ga]).strict().argv;
|
|
154
|
+
`),process.exit(0))},!0).help("help","Show help.").parserConfiguration({"greedy-arrays":!1,"boolean-negation":!1}).command("stats [api]","Show statistics for an API description.",r=>r.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"}}),async r=>{let{handleStats:e}=await import("./chunks/2XSAJEYO.js");J(e)(r)}).command("inspect-node-types <api>","Show the node types of an API description, for writing configurable rules and custom plugins [experimental].",r=>r.env("REDOCLY_CLI_INSPECT_NODE_TYPES").positional("api",{description:"API description file to inspect.",type:"string",demandOption:!0}).option({config:{description:"Path to the config file.",type:"string"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"},pointer:{description:"JSON pointer to a node, optionally prefixed with a file: `#/paths` or `schemas.yaml#/User`.",type:"string",alias:"p"},type:{description:"List only the nodes of this type.",type:"string"},summary:{description:"List the node types used in the description, with counts.",type:"boolean"},parents:{description:"Show the chain of node types leading to the node: down to the node with --pointer, or the distinct chains that reach the type with --type.",type:"boolean"}}).conflicts({pointer:["type","summary"],type:["summary"],summary:["parents"]}).check(e=>{if(e.parents&&!e.pointer&&!e.type)throw new Error("The --parents option requires --pointer or --type.");return!0}),async r=>{let{handleInspectNodeTypes:e}=await import("./chunks/SMBH5JAE.js");J(e)(r)}).command("score [api]","Score an API description for integration simplicity and agent readiness.",r=>r.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"}}),async r=>{let{handleScore:e}=await import("./chunks/OD47UYXG.js");J(e)(r)}).command("split [api]","Split an API description into a multi-file structure.",r=>r.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:"_"},"file-name-conflicts-severity":{description:"Severity level for file name conflicts.",choices:["warn","error","off"],default:"warn"},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"),async r=>{let{handleSplit:e}=await import("./chunks/IJJGUPFL.js");J(e)(r)}).command("join [apis...]","Join multiple API descriptions into one [experimental].",r=>r.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"}}),async r=>{let{handleJoin:e}=await import("./chunks/WDTMN7JE.js");J(e)(r)}).command("push-status [pushId]",!1,r=>r.env("REDOCLY_CLI_PUSH_STATUS").positional("pushId",{description:"Push id.",type:"string",demandOption:!0}).implies("max-execution-time","wait").option({organization:{description:"ID of the organization to push to.",type:"string",alias:"o",required:!0},project:{description:"ID of the project to push to.",type:"string",required:!0,alias:"p"},domain:{description:"Specify a domain.",alias:"d",type:"string",required:!1},wait:{description:"Wait for build to finish.",type:"boolean",default:!1},"max-execution-time":{description:"Maximum execution time in seconds.",type:"number"},"continue-on-deploy-failures":{description:"Command does not fail even if the deployment fails.",type:"boolean",default:!1},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}),async r=>{let{handlePushStatus:e}=await import("./chunks/EIGOI65B.js");J(e)(r)}).command("push [files...]","Push documents to Reunite.",r=>r.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:"ID of the organization to push to.",type:"string",alias:"o",required:!0},project:{description:"ID 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:ba},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},replace:{description:"Remove the files under the mount path that are not part of this push.",type:"boolean",default:!1},verbose:{type:"boolean",default:!1},"continue-on-deploy-failures":{description:"Command does not fail even if the deployment fails.",type:"boolean",default:!1}}),async r=>{let{handlePush:e}=await import("./chunks/BWA2MZEG.js");J(e)(r)}).command("recheck [paths..]","Lint Markdown prose and structure from the recheck block in redocly.yaml.",r=>r.env("REDOCLY_CLI_RECHECK").positional("paths",{array:!0,type:"string",describe:"Files or directories to lint. Default: the current directory."}).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:["table","json","sarif","github-actions"],default:"table"},tags:{description:"Run only rules with these tags.",array:!0,type:"string"},rule:{description:"Run only these rules.",alias:"r",array:!0,type:"string"},"skip-rule":{description:"Skip these rules.",array:!0,type:"string"},stats:{description:"Print rule statistics.",alias:"s",type:"boolean"},fix:{description:"Apply fixes to Markdown files.",alias:"f",type:"boolean"},"max-problems":{description:"Maximum number of problems in the report.",type:"number"},summary:{description:"Print a run summary.",choices:["json","text"],type:"string"},"summary-path":{description:"Write the summary to a file.",type:"string"},readability:{description:"Report readability scores instead of linting.",type:"boolean"},"generate-baseline":{description:"Write the baseline file from the current findings.",type:"boolean"},"generate-markdoc-schema":{description:"Generate a Markdoc tag schema from theme modules.",type:"boolean"},from:{description:"Module paths to read Markdoc tags from (with --generate-markdoc-schema).",array:!0,type:"string"},output:{description:"Output file for the generated schema.",type:"string"},check:{description:"Fail if the generated schema differs from --output.",type:"boolean"}}),async r=>{let{handleRecheck:e}=await import("./chunks/6D4QQEWE.js"),{recheckPresetsPlugin:t}=await import("./chunks/WSDNWUOV.js");J(e,{plugins:[t]})(r)}).command("lint [apis...]","Lint an API or Arazzo description.",r=>r.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"}}),async r=>{let{handleLint:e}=await import("./chunks/6D6SERR2.js");J(e)(r)}).command("bundle [apis...]","Bundle a multi-file API description to a single file.",r=>r.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:Zn},"skip-preprocessor":{description:"Ignore certain preprocessors.",array:!0,type:"string"},"skip-decorator":{description:"Ignore certain decorators.",array:!0,type:"string"},overlay:{description:"Overlay file to apply. Repeat to apply several, in order.",array:!0,type:"string",requiresArg:!0},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}),async r=>{let{handleBundle:e}=await import("./chunks/C462YNOX.js");J(e)(r)}).command("check-config","Lint the Redocly configuration file.",async r=>r.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"}}),r=>{J()(r)}).command("login","Log in to Redocly.",async r=>r.env("REDOCLY_CLI_LOGIN").options({residency:{description:"Residency of the application. Defaults to `us`.",alias:["r"],type:"string"},config:{description:"Path to the config file.",requiresArg:!0,type:"string"},verbose:{alias:"v",describe:"Apply verbose mode.",type:"boolean"}}),async r=>{let{handleLogin:e}=await import("./chunks/4K73EOV3.js");J(e)(r)}).command("logout","Clear your stored credentials.",r=>r,async r=>{let{handleLogout:e}=await import("./chunks/2N5733QR.js");J(e)(r)}).command("project","[early access] Work with a Redocly-hosted project.",r=>r.env("REDOCLY_CLI_PROJECT").command("clone <project> [directory]","Clone a Redocly-hosted project as a Git repository.",e=>e.positional("project",{description:"Organization and project slugs or IDs, as `<organization>/<project>`.",type:"string",demandOption:!0}).positional("directory",{description:"Directory to clone into. Defaults to the project.",type:"string"}).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"}}),async e=>{let{handleProjectClone:t}=await import("./chunks/47H5P7DF.js");J(t)(e)}).command("git-credentials <operation>",!1,e=>e.positional("operation",{description:"Credential helper operation: get, store, or erase.",type:"string",demandOption:!0}),async e=>{let{handleProjectGitCredentials:t}=await import("./chunks/HQSXMF3M.js");process.stdout.write(await t({operation:e.operation,input:process.stdin,version:Ie}))}).demandCommand(1,"Specify a project subcommand: clone.")).command("preview","Preview Redocly project using one of the product NPM packages.",r=>r.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:ni,default:"enterprise"},port:{alias:"p",type:"number",description:"Preview port.",default:4e3,coerce:st("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"}}),async r=>{process.argv.some(t=>t.startsWith("--source-dir"))&&K.error(`Option --source-dir is deprecated and will be removed soon. Use --project-dir instead.
|
|
155
|
+
`);let{previewProject:e}=await import("./chunks/B6HQPQVF.js");J(e)(r)}).command("build-docs [api]","Produce API documentation as an HTML file",r=>r.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 r=>{let{handlerBuildCommand:e}=await import("./chunks/ME4RMLPZ.js");J(e)(r)}).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.",r=>r.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"}}),async r=>{let{handleTranslations:e}=await import("./chunks/C6QQGZXT.js");J(e)(r)}).command("eject <type> [path]","Helper function to eject project elements for customization.",r=>r.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"}}),async r=>{let{handleEject:e}=await import("./chunks/KIY6ZQFM.js");J(e)(r)}).command("respect [files...]","Run Arazzo tests.",r=>r.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:pa},severity:{describe:"Severity of the check.",type:"string"},"max-steps":{describe:"Maximum number of steps to run (default: 2000).",type:"number",default:2e3,coerce:st("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:st("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:st("execution-timeout",!1)},"no-secrets-masking":{describe:"Do not mask secrets in the output.",type:"boolean",default:!1}}),async r=>{let{handleRespect:e}=await import("./chunks/QV24OXH3.js");J(e)(r)}).command("generate-arazzo <descriptionPath>","Auto-generate arazzo description file from an API description.",r=>r.env("REDOCLY_CLI_GENERATE_ARAZZO").positional("descriptionPath",{describe:"Description file path.",type:"string"}).options({"output-file":{alias:"o",describe:"Output File name.",type:"string",requiresArg:!0},"with-ai":{describe:"Redesign the generated workflows with an AI provider, using the OpenAPI description as context.",type:"boolean",default:!1},"ai-provider":{describe:'AI provider used with --with-ai; runs the "claude", "codex", or "cursor" CLI in non-interactive mode.',choices:["claude","codex","cursor"],default:"claude"},"ai-model":{describe:"Model passed to the selected AI provider (provider-specific default applies).",type:"string"},"ai-concurrency":{describe:"Number of workflows designed in parallel with --with-ai for large descriptions.",type:"number",default:4,coerce:st("ai-concurrency",!0)},"max-workflows":{describe:"Most workflows the AI may design with --with-ai.",type:"number",default:10,coerce:st("max-workflows",!0)}}),async r=>{let{handleGenerateArazzo:e}=await import("./chunks/SDQYWQUI.js");J(e)(r)}).command("generate-client [api]","Generate a TypeScript client from an OpenAPI description [experimental].",r=>r.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 r=>{let{handleGenerateClient:e}=await import("./chunks/YLLKDBIZ.js");J(e)(r)}).command("eject-generator [generator]","Vendor a built-in client generator into your repo as an editable file [experimental].",r=>r.positional("generator",{describe:`Built-in generator to eject (${[...Rt].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 r=>{J(fa)(r)}).command("generate-spec <traffic>","Infer an OpenAPI description from recorded HTTP traffic, optionally refined with AI [experimental].",r=>r.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"},"openapi-version":{describe:"OpenAPI version of the generated description.",type:"string",choices:["3.1","3.2"],default:"3.2"},"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:st("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 r=>{let{handleGenerateSpec:e}=await import("./chunks/H2G6FSDS.js");J(e)(r)}).command("introspect-mcp [server-url]","Introspect a running MCP server and record its capabilities in the x-mcp extension of an OpenAPI description [experimental].",r=>r.env("REDOCLY_CLI_INTROSPECT_MCP").positional("server-url",{describe:"URL of the MCP server (Streamable HTTP, with a fallback to the legacy HTTP+SSE transport). Alternative to --command.",type:"string"}).option({command:{describe:'Command that starts a local MCP server to introspect over stdio, for example "npx -y my-mcp-server". Quote arguments that contain spaces. Alternative to a server URL.',type:"string",requiresArg:!0},output:{alias:"o",describe:"OpenAPI description file to create or update.",type:"string",default:"openapi.yaml"},header:{alias:"H",describe:'Header sent with every request to the MCP server, in "Name: value" format. Repeat the option for multiple headers.',array:!0,type:"string"},check:{describe:"Verify the description is up to date with the MCP server instead of writing: report the differences and exit with an error when it is not.",type:"boolean",default:!1},config:{describe:"Path to the config file.",type:"string"}}).check(e=>{if(!!e["server-url"]==!!e.command)throw new Error("Provide either an MCP server URL or --command, not both.");if(e.command&&e.header)throw new Error("The --header option only applies to an MCP server URL.");return!0}),async r=>{let{handleIntrospectMcp:e}=await import("./chunks/N7JGYQGR.js");J(e)(r)}).command("scorecard-classic [api]","Run quality scorecards with multiple rule levels to validate and maintain API description standards.",r=>r.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 r=>{let{handleScorecardClassic:e}=await import("./chunks/ZCLACSBJ.js");J(e)(r)}).command("drift <traffic>","Detect drift between recorded HTTP traffic and an OpenAPI description [experimental].",r=>r.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"},coverage:{describe:"Print how much of the description the traffic exercised: operations, parameters, schema properties, and response codes.",type:"boolean",default:!1},"coverage-output":{describe:"Write a detailed JSON coverage report (per operation, with covered and missing items) to this file.",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 r=>{let{handleDrift:e}=await import("./chunks/ZB7MWGMD.js");J(e)(r)}).command("proxy","Capture live HTTP traffic through a reverse proxy into a HAR file, optionally validating it against an OpenAPI description [experimental].",r=>r.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 r=>{let{handleProxy:e}=await import("./chunks/FRHR2DRO.js");J(e)(r)}).completion("completion","Generate autocomplete script for `redocly` command.").demandCommand(1).middleware([ga]).strict().argv;
|
|
156
156
|
/*! Bundled license information:
|
|
157
157
|
|
|
158
158
|
yargs-parser/build/lib/string-utils.js:
|
package/package.json
CHANGED
package/lib/chunks/U4RAHOFK.js
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
-
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
-
import { dirname as __pathDirname } from 'node:path';
|
|
4
|
-
const require = __createRequire(import.meta.url);
|
|
5
|
-
var __filename = __fileURLToPath(import.meta.url);
|
|
6
|
-
var __dirname = __pathDirname(__filename);
|
|
7
|
-
import{a as G}from"./VMIHLA3H.js";import{c as x,d as C,e as fe,h as N,j as I,k as ue,v as _,w as B}from"./AC62H63B.js";import{a as ae,b as Y,c as ce,d as pe}from"./M74SGAZK.js";import{a as ie}from"./64G5RPLP.js";import"./LG3SUXEW.js";import{O as re,P as v,c as g,ia as S,l as O,oa as oe,ta as se}from"./EQTXHL74.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";import{mkdir as jt,writeFile as kt}from"node:fs/promises";import At from"node:path";var Be=/^[a-zA-Z][a-zA-Z0-9]*(?:[_\-.][a-zA-Z0-9]+)*$/,De=/^[0-9a-f-]{8,}$/i,ze=[["uuid",/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i],["date-time",/^\d{4}-\d{2}-\d{2}[Tt]\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:[Zz]|[+-]\d{2}:\d{2})$/],["date",/^\d{4}-\d{2}-\d{2}$/],["email",/^[^\s@]+@[^\s@]+\.[^\s@]+$/],["uri",/^https?:\/\/\S+$/],["ipv4",/^(?:(?:25[0-5]|2[0-4]\d|1?\d?\d)\.){3}(?:25[0-5]|2[0-4]\d|1?\d?\d)$/]],M=new WeakMap;function D(e){return{formats:ze.filter(([,t])=>t.test(e)).map(([t])=>t),values:[e],count:1,overflow:!1}}function q(e,t){if(!e)return t;if(!t)return e;let n={formats:e.formats.filter(r=>t.formats.includes(r)),values:[],count:e.count+t.count,overflow:e.overflow||t.overflow};if(!n.overflow){let r=[...e.values];for(let o of t.values)r.includes(o)||r.push(o);r.length>10?n.overflow=!0:n.values=r}return n}function z(e,t){M.set(e,t)}function H(e){return M.get(e)}function V(e,t){let n=M.get(e);n&&M.set(t,n)}function He(e){return e.length<=30&&!De.test(e)&&Be.test(e)}function K(e,t){return e.formats.length>0?{format:e.formats[0]}:t&&!e.overflow&&e.count>=4&&e.values.length>0&&e.values.length<=5&&e.values.length*2<=e.count&&e.values.every(He)?{enum:[...e.values].sort()}:{}}function $(e){let t=M.get(e);if(t){let n=typeof e.type=="string"?[e.type]:e.type??[];n.includes("string")&&Object.assign(e,K(t,n.length===1))}for(let n of Object.values(e.properties??{}))$(n);e.additionalProperties&&$(e.additionalProperties),e.items&&$(e.items);for(let n of e.oneOf??[])$(n)}function me(e){for(let t of Object.values(e.paths))for(let n of Object.values(t)){for(let r of Object.values(n.requestBody?.content??{}))$(r.schema);for(let r of Object.values(n.responses))for(let o of Object.values(r.content??{}))$(o.schema)}for(let t of Object.values(e.components?.schemas??{}))$(t);return e}var be=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,F=/^\d+$/,Ve=/^[0-9a-hjkmnp-tv-z]{26}$/i,Ue=/^[a-z][a-z0-9]*_(?=[0-9a-z]*\d)[0-9a-z]{10,}$/i,Fe=/^[a-z](?=[a-z0-9]*\d)[a-z0-9]{23,24}$/,X=new Set(ie),Le=new Set(["get","head"]),de="application/x-www-form-urlencoded",le="multipart/form-data";function Ye(e){return e?F.test(e)||be.test(e)||Ve.test(e)||Ue.test(e)||Fe.test(e)?!0:/^[0-9a-f]{16,}$/i.test(e):!1}function Z(e){let t=e.split("/"),n=[],r=new Set;return{template:t.map((s,c)=>{if(!Ye(s))return s;let i=t[c-1],a=i?`${O(i,1)}Id`:"id",p=1;for(;r.has(a);)p+=1,a=i?`${O(i,1)}Id${p}`:`id${p}`;return r.add(a),n.push({name:a,value:s}),`{${a}}`}).join("/")||"/",params:n}}function j(e){if(e===null)return{type:"null"};if(Array.isArray(e)){if(e.length===0)return{type:"array"};let t=e.slice(0,20).map(j);return{type:"array",items:J(t)}}switch(typeof e){case"string":{let t={type:"string"};return z(t,D(e)),t}case"boolean":return{type:"boolean"};case"number":return Number.isInteger(e)?{type:"integer"}:{type:"number"};case"object":{let t=Object.entries(e);if(t.length>0&&(t.every(([c])=>F.test(c))||t.every(([c])=>be.test(c))))return{type:"object",additionalProperties:J(t.map(([,c])=>j(c)))};let n={},r=[];for(let[s,c]of t)n[s]=j(c),r.push(s);let o={type:"object",properties:n};return r.length>0&&(o.required=r),o}default:return{}}}function J(e){if(e.length===0)return{};let[t,...n]=e,r=t;for(let o of n)r=U(r,o);return r}function he(e){return Object.keys(e).length===0}function k(e){return e.additionalProperties?"map":e.type==="object"?"object":e.type==="array"?"array":"scalar"}function W(e){return e.oneOf?e.oneOf.flatMap(W):Array.isArray(e.type)?e.type.map(t=>{if(t==="object"){let r={type:"object"};return e.properties&&(r.properties=e.properties),e.required&&(r.required=e.required),e.additionalProperties&&(r.additionalProperties=e.additionalProperties),r}if(t==="array")return e.items?{type:"array",items:e.items}:{type:"array"};let n={type:t};return t==="string"&&V(e,n),n}):[e]}var Ke=.5,We=3;function Oe(e,t){let n=Object.keys(e.properties??{}),r=Object.keys(t.properties??{});if(n.length===0||r.length===0)return 1;let o=new Set(r),s=n.filter(c=>o.has(c)).length;return s/(n.length+r.length-s)}function Xe(e,t){let n=k(e);if(n!==k(t))return!1;switch(n){case"scalar":return e.type===t.type||e.type==="integer"&&t.type==="number"||e.type==="number"&&t.type==="integer";case"object":return Oe(e,t)>=Ke;default:return!0}}function ve(e,t){switch(k(e)){case"scalar":{if(e.type!==t.type)return{type:"number"};if(e.type==="string"){let n=q(H(e),H(t));if(n){let r={type:"string"};return z(r,n),r}}return e}case"map":return{type:"object",additionalProperties:U(e.additionalProperties??{},t.additionalProperties??{})};case"object":{let n={...e.properties??{}};for(let[c,i]of Object.entries(t.properties??{}))n[c]=n[c]?U(n[c],i):i;let r=new Set(t.required??[]),o=(e.required??[]).filter(c=>r.has(c)),s={type:"object",properties:n};return o.length>0&&(s.required=o),s}case"array":{if(!e.items||!t.items){let n=e.items??t.items;return n?{type:"array",items:n}:{type:"array"}}return{type:"array",items:U(e.items,t.items)}}}}function Ze(e){let t=[...e],n=()=>t.filter(r=>k(r)==="object").length;for(;n()>We;){let r=-1,o=-1,s=-1;for(let c=0;c<t.length;c++)if(k(t[c])==="object")for(let i=c+1;i<t.length;i++){if(k(t[i])!=="object")continue;let a=Oe(t[c],t[i]);a>s&&(s=a,r=c,o=i)}t[r]=ve(t[r],t[o]),t.splice(o,1)}return t}var Qe=["boolean","integer","number","string","null"];function et(e){if(e.length===1)return e[0];let t=[],n=new Set,r;for(let i of e)k(i)==="scalar"&&typeof i.type=="string"?(n.add(i.type),i.type==="string"&&(r=q(r,H(i)))):t.push(i);let o=Qe.filter(i=>n.has(i)),s=i=>{let a={type:i};return(typeof i=="string"?i==="string":i.includes("string"))&&r&&z(a,r),a};if(t.length===0)return o.length===1?s(o[0]):s(o);if(t.length===1&&o.length===1&&o[0]==="null"&&typeof t[0].type=="string")return{...t[0],type:[t[0].type,"null"]};let c=[...t];return o.length===1?c.push(s(o[0])):o.length>1&&c.push(s(o)),{oneOf:c}}function U(e,t){if(he(e)||he(t))return{};let n=W(e);for(let r of W(t)){let o=n.findIndex(s=>Xe(s,r));o===-1?n.push(r):n[o]=ve(n[o],r)}return et(Ze(n))}function tt(e){if(!e)return;let t=e.trim();if(!(!t.startsWith("{")&&!t.startsWith("[")))try{return JSON.parse(t)}catch{return}}function nt(e,t){let n=t?.match(/boundary="?([^";,]+)"?/i)?.[1];if(!n)return;let r={};for(let o of e.split(`--${n}`)){let s=o.match(/^\r?\n([\s\S]*?)\r?\n\r?\n([\s\S]*)\r?\n$/);if(!s)continue;let[,c,i]=s,a=c.match(/\bname="([^"]*)"/i)?.[1];a!==void 0&&(r[a]=/\bfilename="/i.test(c)?{type:"string",format:"binary"}:j(i))}if(Object.keys(r).length!==0)return{type:"object",properties:r,required:Object.keys(r)}}function ge(e){let t=I(e.contentType);if(e.bodyJson!==void 0)return{mime:ue(t)?t:"application/json",schema:j(e.bodyJson)};if(t===de&&e.bodyText){let r={};for(let[o,s]of new URLSearchParams(e.bodyText))r[o]=s;return Object.keys(r).length===0?void 0:{mime:de,schema:j(r)}}if(t===le&&e.bodyText){let r=nt(e.bodyText,e.contentType);return r?{mime:le,schema:r}:void 0}let n=tt(e.bodyText);if(n!==void 0)return{mime:"application/json",schema:j(n)}}function ye(e,t,n){let r=e.get(t);e.set(t,r?J([r,n]):n)}async function we(e){let t=await C(e.trafficPath);if(t.length===0)throw new Error("No traffic files found in the provided traffic path.");let n=_(e.server),r=new Map,o=new Set,s=0,c=a=>{let p=a.request.method.toLowerCase();if(!X.has(p))return;let f=a.request.path||"/";if(n){let u=B(a.request,n);if(u===void 0)return;f=u}else a.request.host&&!fe(a.request.host)&&o.add(`${a.request.protocol}//${a.request.host}`);let{template:m,params:d}=Z(N(f)),P=`${p} ${m}`,h=r.get(P);h||(h={method:p,template:m,pathParams:new Map,queryParams:new Map,requestBodies:new Map,responses:new Map},r.set(P,h));for(let{name:u,value:l}of d){let y=h.pathParams.get(u);h.pathParams.set(u,{numeric:(y?.numeric??!0)&&F.test(l),observations:q(y?.observations,D(l))})}for(let u of new Set(a.request.query.keys())){let l=a.request.query.getAll(u),y=h.queryParams.get(u),T=l.length>0&&l.every(b=>F.test(b)),R=y?.observations;for(let b of l)R=q(R,D(b));h.queryParams.set(u,{numeric:(y?.numeric??!0)&&T,observations:R})}if(!Le.has(p)){let u=ge(a.request);u&&ye(h.requestBodies,u.mime,u.schema)}if(a.response&&a.response.status>=100){let u=String(a.response.status),l=h.responses.get(u);l||(l={bodies:new Map},h.responses.set(u,l)),l.statusText??=a.response.statusText||void 0;let y=ge(a.response);y&&ye(l.bodies,y.mime,y.schema)}};for(let a of t){let p=await G(a,e.format);if(!p){S.warn(`Skipping traffic file with unrecognized format: ${a}
|
|
8
|
-
`);continue}s+=1;for await(let f of p.parse(a))c(f)}if(s===0)throw new Error("No supported traffic files found to generate an OpenAPI description from.");if(r.size===0)throw new Error(n?`No HTTP exchanges in the traffic matched the server "${n}".`:"No HTTP exchanges were observed in the traffic. Cannot generate an OpenAPI description.");let i=n?[n]:Array.from(o).sort();return rt(r,e.title??"Generated API",i)}function Pe(e){return Object.values(e.paths).reduce((t,n)=>t+Object.keys(n).length,0)}function Se(e,t){if(e.numeric)return{type:"integer"};let n={type:"string"};return e.observations&&Object.assign(n,K(e.observations,t)),n}function rt(e,t,n){let r={};for(let o of e.values()){let s=r[o.template]??={},c=[...Array.from(o.pathParams).map(([a,p])=>({name:a,in:"path",required:!0,schema:Se(p,!1)})),...Array.from(o.queryParams).map(([a,p])=>({name:a,in:"query",required:!1,schema:Se(p,!0)}))],i={operationId:ot(o.method,o.template),responses:{}};if(c.length>0&&(i.parameters=c),o.requestBodies.size>0){let a={};for(let[p,f]of o.requestBodies)a[p]={schema:f};i.requestBody={content:a}}if(o.responses.size===0)i.responses.default={description:"Observed response"};else for(let[a,p]of o.responses){let f={description:p.statusText||"Observed response"};if(p.bodies.size>0){let m={};for(let[d,P]of p.bodies)m[d]={schema:P};f.content=m}i.responses[a]=f}s[o.method]=i}return{openapi:"3.2.0",info:{title:t,version:"1.0.0"},...n.length>0?{servers:n.map(o=>({url:o}))}:{},paths:r}}function ot(e,t){let n=t.split("/").filter(Boolean).map(r=>r.replace(/[{}]/g,"")).join("-");return`${e}-${n||"root"}`}function L(e,t){return`${e.toUpperCase()} ${t}`}function Te(e,t){let n;if(e.bodyJson!==void 0)try{n=JSON.stringify(e.bodyJson)}catch{n=void 0}if(n??=e.bodyText,!n)return;let r=n.trim();if(r)return r.length>t?`${r.slice(0,t)}\u2026[truncated]`:r}function $e(e){if(!e)return"";let t=e.bodyJson;return t===void 0?e.bodyText?I(e.contentType)||"text":"":t===null?"null":Array.isArray(t)?`array<${t.length>0?je(t[0]):""}>`:je(t)}function je(e){return g(e)?Object.keys(e).sort().join(","):e===null?"null":typeof e}async function ke(e){let t=e.perGroup??2,n=e.perOperation??4,r=e.maxBodyChars??2e3,o=_(e.server),s=await C(e.trafficPath),c=new Map;for(let a of s){let p=await G(a,e.format);if(p)for await(let f of p.parse(a)){let m=f.request.method.toUpperCase();if(!X.has(m.toLowerCase()))continue;let d=f.request.path||"/";if(o){let ne=B(f.request,o);if(ne===void 0)continue;d=ne}let P=N(d),{template:h}=Z(P),u=f.response&&f.response.status>=100?f.response:void 0,l=u?.status,y=`${$e(f.request)}\u2192${$e(u)}`,T=c.get(L(m,h));T||(T=new Map,c.set(L(m,h),T));let R=`${l??""} ${y}`,b=T.get(R);b||(b=[],T.set(R,b)),!(b.length>=t)&&b.push({method:m,path:P,query:f.request.query.toString(),status:l,requestContentType:f.request.contentType,requestBody:Te(f.request,r),responseContentType:u?.contentType,responseBody:u?Te(u,r):void 0})}}let i=new Map;for(let[a,p]of c){let f=[];for(let m=0;m<t&&f.length<n;m++)for(let d of p.values()){if(f.length>=n)break;d[m]&&f.push(d[m])}i.set(a,f)}return i}var st=`You are an expert API designer. You are given one operation from an OpenAPI 3.2 description that was inferred mechanically from recorded HTTP traffic, the component schemas it references, and a sample of the real recorded HTTP exchanges for that operation. The inferred description is only a hypothesis: types are coarse, every observed property is marked required, and descriptions are missing. Alternative body shapes observed in the traffic appear as "oneOf" variants or type unions. Common string formats (uuid, date-time, date, email, uri, ipv4) and small closed enums are detected conservatively from the observed values.
|
|
9
|
-
|
|
10
|
-
Refine the operation into the most accurate OpenAPI 3.2 definition you can justify from the evidence, while staying conservative:
|
|
11
|
-
- Keep the path template and the HTTP method exactly as given. Do not rename path parameters, do not move parameters to the path item level, and keep every response status code. The result is programmatically checked and rejected otherwise.
|
|
12
|
-
- Keep the operationId unless it is clearly wrong.
|
|
13
|
-
- Narrow property types where the samples clearly support it (formats such as date-time, uuid, email, uri; integer vs number; enums when a field only ever takes a small fixed set of values). Verify the formats and enums already detected against the samples; correct or extend them where justified. The detected formats and enums were derived from the full recorded traffic while you see only a subset of it, so never remove a detected format or enum value merely because the samples do not show it \u2014 correct one only when a sample contradicts it.
|
|
14
|
-
- Relax "required" for properties that are plausibly optional (e.g. absent in some samples, or clearly nullable). Express nullable values as type unions such as ["string", "null"].
|
|
15
|
-
- When a request or response body has alternative shapes \u2014 the baseline shows "oneOf" variants, or the samples show clearly different payloads \u2014 model them explicitly with "oneOf". Name each variant in components/schemas, and add a "discriminator" when a property (such as "type" or "kind") selects the variant.
|
|
16
|
-
- Factor structure shared between variants or schemas with "allOf": extract the common base into components/schemas and compose each variant as "allOf" of the base plus its specific properties.
|
|
17
|
-
- Keep the $ref references to the component schemas you were given. You may refine the definition of a referenced component when the samples justify it, and you may add new components, but never rename an existing component and never reuse a reserved component name listed in the input.
|
|
18
|
-
- Add concise, useful "summary" and "description" fields to the operation, its parameters and important schema properties.
|
|
19
|
-
- Add example values drawn from the real samples where helpful, but never copy values that look like secrets or personal data (tokens, API keys, passwords, session identifiers, email addresses, personal names); use clearly fictional placeholder values instead.
|
|
20
|
-
|
|
21
|
-
Output ONLY a YAML document with this exact top-level structure:
|
|
22
|
-
|
|
23
|
-
paths:
|
|
24
|
-
<the path template exactly as given>:
|
|
25
|
-
<the method>:
|
|
26
|
-
...the refined operation...
|
|
27
|
-
components:
|
|
28
|
-
schemas:
|
|
29
|
-
...only the component schemas you changed or added; omit "components" entirely when there are none...
|
|
30
|
-
|
|
31
|
-
Do not wrap the output in Markdown code fences. Do not add any commentary before or after the document.`;function it(e){return e.length===0?"(no sample exchanges were captured)":e.map((t,n)=>{let r=[],o=t.query?`?${t.query}`:"";return r.push(`### Exchange ${n+1}`),r.push(`${t.method} ${t.path}${o}`),t.requestContentType&&r.push(`Request Content-Type: ${t.requestContentType}`),t.requestBody&&r.push(`Request body: ${t.requestBody}`),t.status!==void 0&&r.push(`Response status: ${t.status}`),t.responseContentType&&r.push(`Response Content-Type: ${t.responseContentType}`),t.responseBody&&r.push(`Response body: ${t.responseBody}`),r.join(`
|
|
32
|
-
`)}).join(`
|
|
33
|
-
|
|
34
|
-
`)}function Ae(e){let t=[];return t.push(`# Operation to refine (inferred from traffic)
|
|
35
|
-
|
|
36
|
-
\`\`\`yaml
|
|
37
|
-
${v({paths:{[e.path]:{[e.method]:e.operation}}})}\`\`\``),Object.keys(e.components).length>0&&t.push(`# Component schemas referenced by this operation (current definitions)
|
|
38
|
-
|
|
39
|
-
\`\`\`yaml
|
|
40
|
-
${v({components:{schemas:e.components}})}\`\`\``),e.reservedComponentNames.length>0&&t.push(`# Reserved component names (used elsewhere in the description; do not redefine or reuse them)
|
|
41
|
-
|
|
42
|
-
${e.reservedComponentNames.join(", ")}`),t.push(`# Recorded HTTP exchanges for this operation
|
|
43
|
-
|
|
44
|
-
${it(e.samples)}`),t.push(`Refine ${e.method.toUpperCase()} ${e.path} as instructed and output only the YAML document.`),{system:st,user:t.join(`
|
|
45
|
-
|
|
46
|
-
`)}}var Re=/^#\/components\/schemas\/(.+)$/;function Q(e,t){if(Array.isArray(e)){for(let n of e)Q(n,t);return}if(g(e)){if(typeof e.$ref=="string"){let n=e.$ref.match(Re);n&&t.add(n[1])}if(g(e.discriminator)&&g(e.discriminator.mapping)){for(let n of Object.values(e.discriminator.mapping))if(typeof n=="string"){let r=n.match(Re);t.add(r?r[1]:n)}}for(let n of Object.values(e))Q(n,t)}}function Je(e,t){let n=new Set,r=[e];for(;r.length>0;){let o=new Set;Q(r.pop(),o);for(let s of o)!n.has(s)&&s in t&&(n.add(s),r.push(t[s]))}return n}function at(e){let t=e.components?.schemas;if(!t)return;let n=Je(e.paths,t);for(let r of Object.keys(t))n.has(r)||delete t[r];Object.keys(t).length===0&&delete e.components}function ct(e,t,n){let r=ae(e),o;try{o=re(r)}catch(f){throw new Error(`the provider did not return valid YAML: ${f instanceof Error?f.message:String(f)}`)}if(!g(o))throw new Error('the response is not a YAML document with a "paths" object');let s=o.paths;if(!g(s))throw new Error('the response is not a YAML document with a "paths" object');let c=s[t];if(!g(c))throw new Error(`the response does not keep the path template "${t}"`);let i=c[n];if(!g(i))throw new Error(`the response does not contain the ${n.toUpperCase()} operation`);let a=o.components,p=g(a)?a.schemas:void 0;return{operation:i,components:g(p)?p:{}}}function pt(e,t){let n=g(t.responses)?t.responses:{};return Object.keys(e.responses).filter(r=>!(r in n))}async function ft(e){let t=e.document.components?.schemas??{},n=Je(e.operation,t),r={};for(let d of n)r[d]=t[d];let o=Object.keys(t).filter(d=>!n.has(d)),{system:s,user:c}=Ae({path:e.path,method:e.method,operation:e.operation,components:r,reservedComponentNames:o,samples:e.samples}),{text:i}=await ce(e.provider,{system:s,user:c,model:e.model}),a=ct(i,e.path,e.method),p=pt(e.operation,a.operation);if(p.length>0)throw new Error(`the response dropped observed response status(es): ${p.join(", ")}`);if(typeof a.operation.operationId!="string")throw new Error("the response dropped the operationId");let f=Object.keys(a.components).filter(d=>o.includes(d));if(f.length>0)throw new Error(`the response redefines reserved component(s): ${f.join(", ")}`);let m={openapi:e.document.openapi,info:e.document.info,paths:{[e.path]:{[e.method]:a.operation}},components:{schemas:{...t,...a.components}}};return await Y(v(m),e.config),a}function ut(e,t,n,r){e.paths[t][n]=r.operation,Object.keys(r.components).length>0&&(e.components??={schemas:{}},Object.assign(e.components.schemas,r.components))}async function Ee(e){let t=structuredClone(e.baseline),n=await se({extends:["spec"]}),r=[];for(let[i,a]of Object.entries(e.baseline.paths))for(let[p,f]of Object.entries(a))r.push({path:i,method:p,operation:f});let s=(await pe({items:r,concurrency:e.concurrency??1,action:"Refining",successNote:"refined",failureNote:"kept the baseline",label:({path:i,method:a})=>`${a.toUpperCase()} ${i}`,run:async({path:i,method:a,operation:p})=>{let f=await ft({provider:e.provider,model:e.model,document:t,path:i,method:a,operation:p,samples:e.samplesByOperation.get(L(a,i))??[],config:n});return ut(t,i,a,f),f}})).filter(i=>i!==null).length;if(s===0)throw new Error(`the ${e.provider} provider did not produce a usable refinement for any operation`);at(t);let c=v(t);return await Y(c,n),{yaml:c,document:t,refined:s,total:r.length}}var mt=2,dt=2,lt=.75,ht=2,Me=new Set(["integer","number"]),qe=new WeakMap;function w(e){let t=qe.get(e);if(t!==void 0)return t;let n;if(e.$ref!==void 0)n=`ref(${e.$ref})`;else if(e.oneOf)n=`oneOf(${e.oneOf.map(w).sort().join("|")})`;else{let o=[`type=${(Array.isArray(e.type)?[...e.type].sort().join(","):e.type)??""}`];if(e.properties){let s=Object.entries(e.properties).map(([c,i])=>`${JSON.stringify(c)}:${w(i)}`).sort().join(",");o.push(`props{${s}}`)}e.additionalProperties&&o.push(`values(${w(e.additionalProperties)})`),e.items&&o.push(`items(${w(e.items)})`),n=o.join(";")}return qe.set(e,n),n}function gt(e){return e.$ref===void 0&&e.type==="object"&&e.oneOf===void 0&&e.additionalProperties===void 0&&Object.keys(e.properties??{}).length>=mt}function xe(e,t){for(let n of t)e.set(n,(e.get(n)??0)+1)}function E(e,t,n){if(e.oneOf){e.oneOf.forEach((s,c)=>E(s,{...t,path:`${t.path}/oneOf/${c}`,fallbackHints:[]},n));return}let r=t.container,o=`${t.path}/`;if(gt(e)){let s=w(e),c=n.get(s);c||(c={keys:[s],schemas:[],merged:{},contexts:new Set,primaryVotes:new Map,fallbackVotes:new Map},n.set(s,c)),c.schemas.push(e),c.contexts.add(`${t.container}#${t.path}`),xe(c.primaryVotes,t.primaryHints),xe(c.fallbackVotes,t.fallbackHints),r=s,o=""}for(let[s,c]of Object.entries(e.properties??{}))E(c,{container:r,path:`${o}${s}`,primaryHints:[s],fallbackHints:[]},n);e.additionalProperties&&E(e.additionalProperties,{container:r,path:`${o}additionalProperties`,primaryHints:t.primaryHints.map(s=>O(s,1)),fallbackHints:t.fallbackHints.map(s=>O(s,1))},n),e.items&&E(e.items,{container:r,path:`${o}items`,primaryHints:t.primaryHints.map(s=>O(s,1)),fallbackHints:t.fallbackHints.map(s=>O(s,1))},n)}function yt(e){return e.split("/").filter(n=>n&&!n.startsWith("{")).at(-1)}function St(e){let t=new Map;for(let[n,r]of Object.entries(e.paths)){let o=yt(n),s=o?O(o,1):void 0;for(let[c,i]of Object.entries(r)){for(let[a,p]of Object.entries(i.requestBody?.content??{}))E(p.schema,{container:`request ${c} ${n} ${a}`,path:"",primaryHints:s?[s]:[],fallbackHints:s?[`${s} request`]:[]},t);for(let[a,p]of Object.entries(i.responses)){let f=Number(a)>=400;for(let[m,d]of Object.entries(p.content??{}))E(d.schema,{container:`response ${c} ${n} ${a} ${m}`,path:"",primaryHints:f?["error"]:s?[s]:[],fallbackHints:f?s?[`${s} error`]:[]:s?[`${s} response`]:[]},t)}}}return t}function Ce(e){return Object.keys(e.properties??{})}function bt(e,t){let n=Ce(e),r=new Set(Ce(t)),o=n.filter(c=>r.has(c)).length,s=n.length+r.size-o;return s===0?0:o/s}function Ne(e){if(e.$ref!==void 0||e.properties||e.additionalProperties||e.items||e.oneOf)return;let t=typeof e.type=="string"?[e.type]:e.type;if(!(!t||t.some(n=>n==="object"||n==="array")))return t}function ee(e){return Object.keys(e).length===0}function Ge(e,t){if(w(e)===w(t)||ee(e)||ee(t))return!0;let n=Ne(e),r=Ne(t);if(n&&r){let s=new Set(n.filter(i=>i!=="null")),c=new Set(r.filter(i=>i!=="null"));return s.size===c.size&&[...s].every(i=>c.has(i))?!0:[...s].every(i=>Me.has(i))&&[...c].every(i=>Me.has(i))}let o=s=>s.type==="array"||s.items!==void 0;return o(e)&&o(t)?!e.items||!t.items||Ge(e.items,t.items):!1}function Ot(e,t){let n=t.merged.properties??{};return Object.entries(e.merged.properties??{}).every(([r,o])=>!(r in n)||Ge(o,n[r]))}function vt(e){let t=[...e];for(;t.length>1;){let n=-1,r=-1,o=0;for(let i=0;i<t.length;i++)for(let a=i+1;a<t.length;a++){let p=bt(t[i].merged,t[a].merged);p>=lt&&p>o&&Ot(t[i],t[a])&&(o=p,n=i,r=a)}if(n===-1)break;let s=t[n],c=t[r];s.keys.push(...c.keys),s.schemas.push(...c.schemas),s.merged=J([s.merged,c.merged]);for(let i of c.contexts)s.contexts.add(i);for(let[i,a]of c.primaryVotes)s.primaryVotes.set(i,(s.primaryVotes.get(i)??0)+a);for(let[i,a]of c.fallbackVotes)s.fallbackVotes.set(i,(s.fallbackVotes.get(i)??0)+a);t.splice(r,1)}return t}function te(e,t){return e<t?-1:e>t?1:0}function wt(e){return e.split(/[^a-zA-Z0-9]+/).filter(Boolean).map(t=>t[0].toUpperCase()+t.slice(1)).join("")}function Ie(e){return[...e.entries()].sort(([t,n],[r,o])=>o-n||te(t,r)).map(([t])=>t)}function Pt(e){let t=[...e].sort((r,o)=>o.contexts.size-r.contexts.size||o.schemas.length-r.schemas.length||te(r.keys[0],o.keys[0])),n=new Set;return t.map(r=>{let o=[...Ie(r.primaryVotes),...Ie(r.fallbackVotes)].map(wt).filter(c=>c.length>0);o.length===0&&o.push("Schema");let s=o.find(c=>!n.has(c));for(let c=2;s===void 0;c++){let i=`${o[0]}${c}`;n.has(i)||(s=i)}return n.add(s),{group:r,name:s}})}function A(e,t,n=!1){if(!n){let o=t.get(w(e));if(o!==void 0)return{$ref:`#/components/schemas/${o}`}}let r={...e};return V(e,r),e.properties&&(r.properties=Object.fromEntries(Object.entries(e.properties).map(([o,s])=>[o,A(s,t)]))),e.additionalProperties&&(r.additionalProperties=A(e.additionalProperties,t)),e.items&&(r.items=A(e.items,t)),e.oneOf&&(r.oneOf=e.oneOf.map(o=>A(o,t))),r}function Tt(e){let t=Object.values(e.properties??{}),n=t.filter(r=>r.type==="array"&&(!r.items||ee(r.items)));return n.length>0&&t.length-n.length<=ht}function $t(e){let t=0,n=0;for(let r of e.primaryVotes.values())t+=r,n=Math.max(n,r);return n*2>t}function _e(e){let t=St(e);for(let i of t.values())i.merged=J(i.schemas);let r=vt([...t.values()]).filter(i=>i.contexts.size>=dt&&($t(i)||!i.schemas.some(Tt)));if(r.length===0)return e;let o=Pt(r),s=new Map;for(let{group:i,name:a}of o)for(let p of i.keys)s.set(p,a);let c={};for(let{group:i,name:a}of[...o].sort((p,f)=>te(p.name,f.name)))c[a]=A(i.merged,s,!0);for(let i of Object.values(e.paths))for(let a of Object.values(i)){for(let p of Object.values(a.requestBody?.content??{}))p.schema=A(p.schema,s);for(let p of Object.values(a.responses))for(let f of Object.values(p.content??{}))f.schema=A(f.schema,s)}return e.components={schemas:c},e}async function Rt(e,t){let n=x(e);await jt(At.dirname(n),{recursive:!0}),await kt(n,t,"utf8")}function Jt(e){let t=Math.round(e/1e3),n=Math.floor(t/60),r=t%60;return n>0?`${n}m ${r}s`:`${r}s`}async function gn({argv:e}){if(e.type!=="openapi")throw new oe(`Unsupported spec type "${e.type}". Only "openapi" is supported.`);let t=Date.now(),n=x(e.traffic),r=e["traffic-format"],o=me(_e(await we({trafficPath:n,format:r,title:e.title,server:e.server})));S.info(`Inferred a baseline OpenAPI description from traffic: ${Pe(o)} operation(s).
|
|
47
|
-
`);let s=v(o);if(e["with-ai"]){let c=e["ai-provider"];S.info(`Refining the description with AI provider "${c}"...
|
|
48
|
-
`),S.warn(`Note: --with-ai sends samples of the recorded traffic (URLs, query strings, request and response bodies) to the selected AI provider. Make sure the traffic contains no secrets or personal data you are not allowed to share.
|
|
49
|
-
`);let i=await ke({trafficPath:n,format:r,server:e.server});try{let a=await Ee({provider:c,model:e["ai-model"],baseline:o,samplesByOperation:i,concurrency:e["ai-concurrency"]});s=a.yaml,S.info(`AI refinement complete: ${a.refined} of ${a.total} operation(s) refined (${c}).
|
|
50
|
-
`)}catch(a){S.warn(`AI refinement failed, falling back to the baseline description: ${a instanceof Error?a.message:String(a)}
|
|
51
|
-
`)}}e.output?(await Rt(e.output,s),S.info(`Written to: ${x(e.output)}
|
|
52
|
-
`)):S.output(s),S.info(`Done in ${Jt(Date.now()-t)}.
|
|
53
|
-
`)}export{gn as handleGenerateSpec};
|