@povio/openapi-codegen-cli 2.0.3-rc.2 → 2.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/sh.js +1 -1
  2. package/package.json +1 -1
package/dist/sh.js CHANGED
@@ -565,7 +565,7 @@ ${ot.join(`
565
565
  `;_e.forEach(ot=>{Lt+=ot}),f.fail(Lt)}},"implications");let oe={};A.conflicts=t(function(Ae,_e){ho("<string|object> [array|string]",[Ae,_e],arguments.length),typeof Ae=="object"?Object.keys(Ae).forEach(Lt=>{A.conflicts(Lt,Ae[Lt])}):(l.global(Ae),oe[Ae]||(oe[Ae]=[]),Array.isArray(_e)?_e.forEach(Lt=>A.conflicts(Ae,Lt)):oe[Ae].push(_e))},"conflicts"),A.getConflicting=()=>oe,A.conflicting=t(function(Ae){Object.keys(Ae).forEach(_e=>{oe[_e]&&oe[_e].forEach(Lt=>{Lt&&Ae[_e]!==void 0&&Ae[Lt]!==void 0&&f.fail(S("Arguments %s and %s are mutually exclusive",_e,Lt))})}),l.getInternalMethods().getParserConfiguration()["strip-dashed"]&&Object.keys(oe).forEach(_e=>{oe[_e].forEach(Lt=>{Lt&&Ae[h.Parser.camelCase(_e)]!==void 0&&Ae[h.Parser.camelCase(Lt)]!==void 0&&f.fail(S("Arguments %s and %s are mutually exclusive",_e,Lt))})})},"conflictingFn"),A.recommendCommands=t(function(Ae,_e){_e=_e.sort((Ht,jr)=>jr.length-Ht.length);let ot=null,tt=1/0;for(let Ht=0,jr;(jr=_e[Ht])!==void 0;Ht++){let Gn=LQe(Ae,jr);Gn<=3&&Gn<tt&&(tt=Gn,ot=jr)}ot&&f.fail(S("Did you mean %s?",ot))},"recommendCommands"),A.reset=t(function(Ae){return j=J6(j,_e=>!Ae[_e]),oe=J6(oe,_e=>!Ae[_e]),A},"reset");let ge=[];return A.freeze=t(function(){ge.push({implied:j,conflicting:oe})},"freeze"),A.unfreeze=t(function(){let Ae=ge.pop();p1(Ae,void 0,h),{implied:j,conflicting:oe}=Ae},"unfreeze"),A}t(BQe,"validation");var nke=[],WV;function HV(l,f,h,S){WV=S;let C={};if(Object.prototype.hasOwnProperty.call(l,"extends")){if(typeof l.extends!="string")return C;let A=/\.json|\..*rc$/.test(l.extends),j=null;if(A)j=z5t(f,l.extends);else try{j=require.resolve(l.extends)}catch{return l}q5t(j),nke.push(j),C=A?JSON.parse(WV.readFileSync(j,"utf8")):require(l.extends),delete l.extends,C=HV(C,WV.path.dirname(j),h,WV)}return nke=[],h?JQe(C,l):Object.assign({},C,l)}t(HV,"applyExtends");function q5t(l){if(nke.indexOf(l)>-1)throw new Up(`Circular extended configurations: '${l}'.`)}t(q5t,"checkForCircularExtends");function z5t(l,f){return WV.path.resolve(l,f)}t(z5t,"getPathToDefaultConfig");function JQe(l,f){let h={};function S(C){return C&&typeof C=="object"&&!Array.isArray(C)}t(S,"isObject"),Object.assign(h,l);for(let C of Object.keys(f))S(f[C])&&S(h[C])?h[C]=JQe(l[C],f[C]):h[C]=f[C];return h}t(JQe,"mergeDeep");var xo=function(l,f,h,S,C){if(S==="m")throw new TypeError("Private method is not writable");if(S==="a"&&!C)throw new TypeError("Private accessor was defined without a setter");if(typeof f=="function"?l!==f||!C:!f.has(l))throw new TypeError("Cannot write private member to an object whose class did not declare it");return S==="a"?C.call(l,h):C?C.value=h:f.set(l,h),h},Zt=function(l,f,h,S){if(h==="a"&&!S)throw new TypeError("Private accessor was defined without a getter");if(typeof f=="function"?l!==f||!S:!f.has(l))throw new TypeError("Cannot read private member from an object whose class did not declare it");return h==="m"?S:h==="a"?S.call(l):S?S.value:f.get(l)},Om,y8,GV,jS,Qb,Kie,q6,v8,ese,BS,tse,JS,Hk,Zb,$S,rse,oR,Dg,Bo,nse,ise,Xb,b8,cR,S8,z6,sse,Bc,x8,T8,C8,il,ase,Gk,sm;function aZe(l){return(f=[],h=l.process.cwd(),S)=>{let C=new dke(f,h,S,l);return Object.defineProperty(C,"argv",{get:t(()=>C.parse(),"get"),enumerable:!0}),C.help(),C.version(),C}}t(aZe,"YargsFactory");var $Qe=Symbol("copyDoubleDash"),qQe=Symbol("copyDoubleDash"),ike=Symbol("deleteFromParserHintObject"),zQe=Symbol("emitWarning"),VQe=Symbol("freeze"),UQe=Symbol("getDollarZero"),k8=Symbol("getParserConfiguration"),WQe=Symbol("getUsageConfiguration"),ske=Symbol("guessLocale"),HQe=Symbol("guessVersion"),GQe=Symbol("parsePositionalNumbers"),ake=Symbol("pkgUp"),V6=Symbol("populateParserHintArray"),lR=Symbol("populateParserHintSingleValueDictionary"),oke=Symbol("populateParserHintArrayDictionary"),cke=Symbol("populateParserHintDictionary"),lke=Symbol("sanitizeKey"),uke=Symbol("setKey"),fke=Symbol("unfreeze"),QQe=Symbol("validateAsync"),ZQe=Symbol("getCommandInstance"),XQe=Symbol("getContext"),YQe=Symbol("getHasOutput"),KQe=Symbol("getLoggerInstance"),eZe=Symbol("getParseContext"),tZe=Symbol("getUsageInstance"),rZe=Symbol("getValidationInstance"),ose=Symbol("hasParseCallback"),nZe=Symbol("isGlobalContext"),E8=Symbol("postProcess"),iZe=Symbol("rebase"),_ke=Symbol("reset"),QV=Symbol("runYargsParserAndExecuteCommands"),pke=Symbol("runValidation"),sZe=Symbol("setHasOutput"),P8=Symbol("kTrackManuallySetKeys"),mke=class mke{constructor(f=[],h,S,C){this.customScriptName=!1,this.parsed=!1,Om.set(this,void 0),y8.set(this,void 0),GV.set(this,{commands:[],fullCommands:[]}),jS.set(this,null),Qb.set(this,null),Kie.set(this,"show-hidden"),q6.set(this,null),v8.set(this,!0),ese.set(this,{}),BS.set(this,!0),tse.set(this,[]),JS.set(this,void 0),Hk.set(this,{}),Zb.set(this,!1),$S.set(this,null),rse.set(this,!0),oR.set(this,void 0),Dg.set(this,""),Bo.set(this,void 0),nse.set(this,void 0),ise.set(this,{}),Xb.set(this,null),b8.set(this,null),cR.set(this,{}),S8.set(this,{}),z6.set(this,void 0),sse.set(this,!1),Bc.set(this,void 0),x8.set(this,!1),T8.set(this,!1),C8.set(this,!1),il.set(this,void 0),ase.set(this,{}),Gk.set(this,null),sm.set(this,void 0),xo(this,Bc,C,"f"),xo(this,z6,f,"f"),xo(this,y8,h,"f"),xo(this,nse,S,"f"),xo(this,JS,new Zie(this),"f"),this.$0=this[UQe](),this[_ke](),xo(this,Om,Zt(this,Om,"f"),"f"),xo(this,il,Zt(this,il,"f"),"f"),xo(this,sm,Zt(this,sm,"f"),"f"),xo(this,Bo,Zt(this,Bo,"f"),"f"),Zt(this,Bo,"f").showHiddenOpt=Zt(this,Kie,"f"),xo(this,oR,this[qQe](),"f")}addHelpOpt(f,h){let S="help";return ho("[string|boolean] [string]",[f,h],arguments.length),Zt(this,$S,"f")&&(this[ike](Zt(this,$S,"f")),xo(this,$S,null,"f")),f===!1&&h===void 0?this:(xo(this,$S,typeof f=="string"?f:S,"f"),this.boolean(Zt(this,$S,"f")),this.describe(Zt(this,$S,"f"),h||Zt(this,il,"f").deferY18nLookup("Show help")),this)}help(f,h){return this.addHelpOpt(f,h)}addShowHiddenOpt(f,h){if(ho("[string|boolean] [string]",[f,h],arguments.length),f===!1&&h===void 0)return this;let S=typeof f=="string"?f:Zt(this,Kie,"f");return this.boolean(S),this.describe(S,h||Zt(this,il,"f").deferY18nLookup("Show hidden options")),Zt(this,Bo,"f").showHiddenOpt=S,this}showHidden(f,h){return this.addShowHiddenOpt(f,h)}alias(f,h){return ho("<object|string|array> [string|array]",[f,h],arguments.length),this[oke](this.alias.bind(this),"alias",f,h),this}array(f){return ho("<array|string>",[f],arguments.length),this[V6]("array",f),this[P8](f),this}boolean(f){return ho("<array|string>",[f],arguments.length),this[V6]("boolean",f),this[P8](f),this}check(f,h){return ho("<function> [boolean]",[f,h],arguments.length),this.middleware((S,C)=>g8(()=>f(S,C.getOptions()),A=>(A?(typeof A=="string"||A instanceof Error)&&Zt(this,il,"f").fail(A.toString(),A):Zt(this,il,"f").fail(Zt(this,Bc,"f").y18n.__("Argument check failed: %s",f.toString())),S),A=>(Zt(this,il,"f").fail(A.message?A.message:A.toString(),A),S)),!1,h),this}choices(f,h){return ho("<object|string|array> [string|array]",[f,h],arguments.length),this[oke](this.choices.bind(this),"choices",f,h),this}coerce(f,h){if(ho("<object|string|array> [function]",[f,h],arguments.length),Array.isArray(f)){if(!h)throw new Up("coerce callback must be provided");for(let S of f)this.coerce(S,h);return this}else if(typeof f=="object"){for(let S of Object.keys(f))this.coerce(S,f[S]);return this}if(!h)throw new Up("coerce callback must be provided");return Zt(this,Bo,"f").key[f]=!0,Zt(this,JS,"f").addCoerceMiddleware((S,C)=>{let A;return Object.prototype.hasOwnProperty.call(S,f)?g8(()=>(A=C.getAliases(),h(S[f])),Z=>{S[f]=Z;let oe=C.getInternalMethods().getParserConfiguration()["strip-aliased"];if(A[f]&&oe!==!0)for(let ge of A[f])S[ge]=Z;return S},Z=>{throw new Up(Z.message)}):S},f),this}conflicts(f,h){return ho("<string|object> [string|array]",[f,h],arguments.length),Zt(this,sm,"f").conflicts(f,h),this}config(f="config",h,S){return ho("[object|string] [string|function] [function]",[f,h,S],arguments.length),typeof f=="object"&&!Array.isArray(f)?(f=HV(f,Zt(this,y8,"f"),this[k8]()["deep-merge-config"]||!1,Zt(this,Bc,"f")),Zt(this,Bo,"f").configObjects=(Zt(this,Bo,"f").configObjects||[]).concat(f),this):(typeof h=="function"&&(S=h,h=void 0),this.describe(f,h||Zt(this,il,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(f)?f:[f]).forEach(C=>{Zt(this,Bo,"f").config[C]=S||!0}),this)}completion(f,h,S){return ho("[string] [string|boolean|function] [function]",[f,h,S],arguments.length),typeof h=="function"&&(S=h,h=void 0),xo(this,Qb,f||Zt(this,Qb,"f")||"completion","f"),!h&&h!==!1&&(h="generate completion script"),this.command(Zt(this,Qb,"f"),h),S&&Zt(this,jS,"f").registerFunction(S),this}command(f,h,S,C,A,j){return ho("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[f,h,S,C,A,j],arguments.length),Zt(this,Om,"f").addHandler(f,h,S,C,A,j),this}commands(f,h,S,C,A,j){return this.command(f,h,S,C,A,j)}commandDir(f,h){ho("<string> [object]",[f,h],arguments.length);let S=Zt(this,nse,"f")||Zt(this,Bc,"f").require;return Zt(this,Om,"f").addDirectory(f,S,Zt(this,Bc,"f").getCallerFile(),h),this}count(f){return ho("<array|string>",[f],arguments.length),this[V6]("count",f),this[P8](f),this}default(f,h,S){return ho("<object|string|array> [*] [string]",[f,h,S],arguments.length),S&&(QCe(f,Zt(this,Bc,"f")),Zt(this,Bo,"f").defaultDescription[f]=S),typeof h=="function"&&(QCe(f,Zt(this,Bc,"f")),Zt(this,Bo,"f").defaultDescription[f]||(Zt(this,Bo,"f").defaultDescription[f]=Zt(this,il,"f").functionDescription(h)),h=h.call()),this[lR](this.default.bind(this),"default",f,h),this}defaults(f,h,S){return this.default(f,h,S)}demandCommand(f=1,h,S,C){return ho("[number] [number|string] [string|null|undefined] [string|null|undefined]",[f,h,S,C],arguments.length),typeof h!="number"&&(S=h,h=1/0),this.global("_",!1),Zt(this,Bo,"f").demandedCommands._={min:f,max:h,minMsg:S,maxMsg:C},this}demand(f,h,S){return Array.isArray(h)?(h.forEach(C=>{p1(S,!0,Zt(this,Bc,"f")),this.demandOption(C,S)}),h=1/0):typeof h!="number"&&(S=h,h=1/0),typeof f=="number"?(p1(S,!0,Zt(this,Bc,"f")),this.demandCommand(f,h,S,S)):Array.isArray(f)?f.forEach(C=>{p1(S,!0,Zt(this,Bc,"f")),this.demandOption(C,S)}):typeof S=="string"?this.demandOption(f,S):(S===!0||typeof S>"u")&&this.demandOption(f),this}demandOption(f,h){return ho("<object|string|array> [string]",[f,h],arguments.length),this[lR](this.demandOption.bind(this),"demandedOptions",f,h),this}deprecateOption(f,h){return ho("<string> [string|boolean]",[f,h],arguments.length),Zt(this,Bo,"f").deprecatedOptions[f]=h,this}describe(f,h){return ho("<object|string|array> [string]",[f,h],arguments.length),this[uke](f,!0),Zt(this,il,"f").describe(f,h),this}detectLocale(f){return ho("<boolean>",[f],arguments.length),xo(this,v8,f,"f"),this}env(f){return ho("[string|boolean]",[f],arguments.length),f===!1?delete Zt(this,Bo,"f").envPrefix:Zt(this,Bo,"f").envPrefix=f||"",this}epilogue(f){return ho("<string>",[f],arguments.length),Zt(this,il,"f").epilog(f),this}epilog(f){return this.epilogue(f)}example(f,h){return ho("<string|array> [string]",[f,h],arguments.length),Array.isArray(f)?f.forEach(S=>this.example(...S)):Zt(this,il,"f").example(f,h),this}exit(f,h){xo(this,Zb,!0,"f"),xo(this,q6,h,"f"),Zt(this,BS,"f")&&Zt(this,Bc,"f").process.exit(f)}exitProcess(f=!0){return ho("[boolean]",[f],arguments.length),xo(this,BS,f,"f"),this}fail(f){if(ho("<function|boolean>",[f],arguments.length),typeof f=="boolean"&&f!==!1)throw new Up("Invalid first argument. Expected function or boolean 'false'");return Zt(this,il,"f").failFn(f),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(f,h){return ho("<array> [function]",[f,h],arguments.length),h?Zt(this,jS,"f").getCompletion(f,h):new Promise((S,C)=>{Zt(this,jS,"f").getCompletion(f,(A,j)=>{A?C(A):S(j)})})}getDemandedOptions(){return ho([],0),Zt(this,Bo,"f").demandedOptions}getDemandedCommands(){return ho([],0),Zt(this,Bo,"f").demandedCommands}getDeprecatedOptions(){return ho([],0),Zt(this,Bo,"f").deprecatedOptions}getDetectLocale(){return Zt(this,v8,"f")}getExitProcess(){return Zt(this,BS,"f")}getGroups(){return Object.assign({},Zt(this,Hk,"f"),Zt(this,S8,"f"))}getHelp(){if(xo(this,Zb,!0,"f"),!Zt(this,il,"f").hasCachedHelpMessage()){if(!this.parsed){let h=this[QV](Zt(this,z6,"f"),void 0,void 0,0,!0);if(Wp(h))return h.then(()=>Zt(this,il,"f").help())}let f=Zt(this,Om,"f").runDefaultBuilderOn(this);if(Wp(f))return f.then(()=>Zt(this,il,"f").help())}return Promise.resolve(Zt(this,il,"f").help())}getOptions(){return Zt(this,Bo,"f")}getStrict(){return Zt(this,x8,"f")}getStrictCommands(){return Zt(this,T8,"f")}getStrictOptions(){return Zt(this,C8,"f")}global(f,h){return ho("<string|array> [boolean]",[f,h],arguments.length),f=[].concat(f),h!==!1?Zt(this,Bo,"f").local=Zt(this,Bo,"f").local.filter(S=>f.indexOf(S)===-1):f.forEach(S=>{Zt(this,Bo,"f").local.includes(S)||Zt(this,Bo,"f").local.push(S)}),this}group(f,h){ho("<string|array> <string>",[f,h],arguments.length);let S=Zt(this,S8,"f")[h]||Zt(this,Hk,"f")[h];Zt(this,S8,"f")[h]&&delete Zt(this,S8,"f")[h];let C={};return Zt(this,Hk,"f")[h]=(S||[]).concat(f).filter(A=>C[A]?!1:C[A]=!0),this}hide(f){return ho("<string>",[f],arguments.length),Zt(this,Bo,"f").hiddenOptions.push(f),this}implies(f,h){return ho("<string|object> [number|string|array]",[f,h],arguments.length),Zt(this,sm,"f").implies(f,h),this}locale(f){return ho("[string]",[f],arguments.length),f===void 0?(this[ske](),Zt(this,Bc,"f").y18n.getLocale()):(xo(this,v8,!1,"f"),Zt(this,Bc,"f").y18n.setLocale(f),this)}middleware(f,h,S){return Zt(this,JS,"f").addMiddleware(f,!!h,S)}nargs(f,h){return ho("<string|object|array> [number]",[f,h],arguments.length),this[lR](this.nargs.bind(this),"narg",f,h),this}normalize(f){return ho("<array|string>",[f],arguments.length),this[V6]("normalize",f),this}number(f){return ho("<array|string>",[f],arguments.length),this[V6]("number",f),this[P8](f),this}option(f,h){if(ho("<string|object> [object]",[f,h],arguments.length),typeof f=="object")Object.keys(f).forEach(S=>{this.options(S,f[S])});else{typeof h!="object"&&(h={}),this[P8](f),Zt(this,Gk,"f")&&(f==="version"||(h==null?void 0:h.alias)==="version")&&this[zQe](['"version" is a reserved word.',"Please do one of the following:",'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)","- Use a different option key","https://yargs.js.org/docs/#api-reference-version"].join(`
566
566
  `),void 0,"versionWarning"),Zt(this,Bo,"f").key[f]=!0,h.alias&&this.alias(f,h.alias);let S=h.deprecate||h.deprecated;S&&this.deprecateOption(f,S);let C=h.demand||h.required||h.require;C&&this.demand(f,C),h.demandOption&&this.demandOption(f,typeof h.demandOption=="string"?h.demandOption:void 0),h.conflicts&&this.conflicts(f,h.conflicts),"default"in h&&this.default(f,h.default),h.implies!==void 0&&this.implies(f,h.implies),h.nargs!==void 0&&this.nargs(f,h.nargs),h.config&&this.config(f,h.configParser),h.normalize&&this.normalize(f),h.choices&&this.choices(f,h.choices),h.coerce&&this.coerce(f,h.coerce),h.group&&this.group(f,h.group),(h.boolean||h.type==="boolean")&&(this.boolean(f),h.alias&&this.boolean(h.alias)),(h.array||h.type==="array")&&(this.array(f),h.alias&&this.array(h.alias)),(h.number||h.type==="number")&&(this.number(f),h.alias&&this.number(h.alias)),(h.string||h.type==="string")&&(this.string(f),h.alias&&this.string(h.alias)),(h.count||h.type==="count")&&this.count(f),typeof h.global=="boolean"&&this.global(f,h.global),h.defaultDescription&&(Zt(this,Bo,"f").defaultDescription[f]=h.defaultDescription),h.skipValidation&&this.skipValidation(f);let A=h.describe||h.description||h.desc,j=Zt(this,il,"f").getDescriptions();(!Object.prototype.hasOwnProperty.call(j,f)||typeof A=="string")&&this.describe(f,A),h.hidden&&this.hide(f),h.requiresArg&&this.requiresArg(f)}return this}options(f,h){return this.option(f,h)}parse(f,h,S){ho("[string|array] [function|boolean|object] [function]",[f,h,S],arguments.length),this[VQe](),typeof f>"u"&&(f=Zt(this,z6,"f")),typeof h=="object"&&(xo(this,b8,h,"f"),h=S),typeof h=="function"&&(xo(this,Xb,h,"f"),h=!1),h||xo(this,z6,f,"f"),Zt(this,Xb,"f")&&xo(this,BS,!1,"f");let C=this[QV](f,!!h),A=this.parsed;return Zt(this,jS,"f").setParsed(this.parsed),Wp(C)?C.then(j=>(Zt(this,Xb,"f")&&Zt(this,Xb,"f").call(this,Zt(this,q6,"f"),j,Zt(this,Dg,"f")),j)).catch(j=>{throw Zt(this,Xb,"f")&&Zt(this,Xb,"f")(j,this.parsed.argv,Zt(this,Dg,"f")),j}).finally(()=>{this[fke](),this.parsed=A}):(Zt(this,Xb,"f")&&Zt(this,Xb,"f").call(this,Zt(this,q6,"f"),C,Zt(this,Dg,"f")),this[fke](),this.parsed=A,C)}parseAsync(f,h,S){let C=this.parse(f,h,S);return Wp(C)?C:Promise.resolve(C)}parseSync(f,h,S){let C=this.parse(f,h,S);if(Wp(C))throw new Up(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return C}parserConfiguration(f){return ho("<object>",[f],arguments.length),xo(this,ise,f,"f"),this}pkgConf(f,h){ho("<string> [string]",[f,h],arguments.length);let S=null,C=this[ake](h||Zt(this,y8,"f"));return C[f]&&typeof C[f]=="object"&&(S=HV(C[f],h||Zt(this,y8,"f"),this[k8]()["deep-merge-config"]||!1,Zt(this,Bc,"f")),Zt(this,Bo,"f").configObjects=(Zt(this,Bo,"f").configObjects||[]).concat(S)),this}positional(f,h){ho("<string> <object>",[f,h],arguments.length);let S=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];h=J6(h,(j,Z)=>j==="type"&&!["string","number","boolean"].includes(Z)?!1:S.includes(j));let C=Zt(this,GV,"f").fullCommands[Zt(this,GV,"f").fullCommands.length-1],A=C?Zt(this,Om,"f").cmdToParseOptions(C):{array:[],alias:{},default:{},demand:{}};return sR(A).forEach(j=>{let Z=A[j];Array.isArray(Z)?Z.indexOf(f)!==-1&&(h[j]=!0):Z[f]&&!(j in h)&&(h[j]=Z[f])}),this.group(f,Zt(this,il,"f").getPositionalGroupName()),this.option(f,h)}recommendCommands(f=!0){return ho("[boolean]",[f],arguments.length),xo(this,sse,f,"f"),this}required(f,h,S){return this.demand(f,h,S)}require(f,h,S){return this.demand(f,h,S)}requiresArg(f){return ho("<array|string|object> [number]",[f],arguments.length),typeof f=="string"&&Zt(this,Bo,"f").narg[f]?this:(this[lR](this.requiresArg.bind(this),"narg",f,NaN),this)}showCompletionScript(f,h){return ho("[string] [string]",[f,h],arguments.length),f=f||this.$0,Zt(this,oR,"f").log(Zt(this,jS,"f").generateCompletionScript(f,h||Zt(this,Qb,"f")||"completion")),this}showHelp(f){if(ho("[string|function]",[f],arguments.length),xo(this,Zb,!0,"f"),!Zt(this,il,"f").hasCachedHelpMessage()){if(!this.parsed){let S=this[QV](Zt(this,z6,"f"),void 0,void 0,0,!0);if(Wp(S))return S.then(()=>{Zt(this,il,"f").showHelp(f)}),this}let h=Zt(this,Om,"f").runDefaultBuilderOn(this);if(Wp(h))return h.then(()=>{Zt(this,il,"f").showHelp(f)}),this}return Zt(this,il,"f").showHelp(f),this}scriptName(f){return this.customScriptName=!0,this.$0=f,this}showHelpOnFail(f,h){return ho("[boolean|string] [string]",[f,h],arguments.length),Zt(this,il,"f").showHelpOnFail(f,h),this}showVersion(f){return ho("[string|function]",[f],arguments.length),Zt(this,il,"f").showVersion(f),this}skipValidation(f){return ho("<array|string>",[f],arguments.length),this[V6]("skipValidation",f),this}strict(f){return ho("[boolean]",[f],arguments.length),xo(this,x8,f!==!1,"f"),this}strictCommands(f){return ho("[boolean]",[f],arguments.length),xo(this,T8,f!==!1,"f"),this}strictOptions(f){return ho("[boolean]",[f],arguments.length),xo(this,C8,f!==!1,"f"),this}string(f){return ho("<array|string>",[f],arguments.length),this[V6]("string",f),this[P8](f),this}terminalWidth(){return ho([],0),Zt(this,Bc,"f").process.stdColumns}updateLocale(f){return this.updateStrings(f)}updateStrings(f){return ho("<object>",[f],arguments.length),xo(this,v8,!1,"f"),Zt(this,Bc,"f").y18n.updateLocale(f),this}usage(f,h,S,C){if(ho("<string|null|undefined> [string|boolean] [function|object] [function]",[f,h,S,C],arguments.length),h!==void 0){if(p1(f,null,Zt(this,Bc,"f")),(f||"").match(/^\$0( |$)/))return this.command(f,h,S,C);throw new Up(".usage() description must start with $0 if being used as alias for .command()")}else return Zt(this,il,"f").usage(f),this}usageConfiguration(f){return ho("<object>",[f],arguments.length),xo(this,ase,f,"f"),this}version(f,h,S){let C="version";if(ho("[boolean|string] [string] [string]",[f,h,S],arguments.length),Zt(this,Gk,"f")&&(this[ike](Zt(this,Gk,"f")),Zt(this,il,"f").version(void 0),xo(this,Gk,null,"f")),arguments.length===0)S=this[HQe](),f=C;else if(arguments.length===1){if(f===!1)return this;S=f,f=C}else arguments.length===2&&(S=h,h=void 0);return xo(this,Gk,typeof f=="string"?f:C,"f"),h=h||Zt(this,il,"f").deferY18nLookup("Show version number"),Zt(this,il,"f").version(S||void 0),this.boolean(Zt(this,Gk,"f")),this.describe(Zt(this,Gk,"f"),h),this}wrap(f){return ho("<number|null|undefined>",[f],arguments.length),Zt(this,il,"f").wrap(f),this}[(Om=new WeakMap,y8=new WeakMap,GV=new WeakMap,jS=new WeakMap,Qb=new WeakMap,Kie=new WeakMap,q6=new WeakMap,v8=new WeakMap,ese=new WeakMap,BS=new WeakMap,tse=new WeakMap,JS=new WeakMap,Hk=new WeakMap,Zb=new WeakMap,$S=new WeakMap,rse=new WeakMap,oR=new WeakMap,Dg=new WeakMap,Bo=new WeakMap,nse=new WeakMap,ise=new WeakMap,Xb=new WeakMap,b8=new WeakMap,cR=new WeakMap,S8=new WeakMap,z6=new WeakMap,sse=new WeakMap,Bc=new WeakMap,x8=new WeakMap,T8=new WeakMap,C8=new WeakMap,il=new WeakMap,ase=new WeakMap,Gk=new WeakMap,sm=new WeakMap,$Qe)](f){if(!f._||!f["--"])return f;f._.push.apply(f._,f["--"]);try{delete f["--"]}catch{}return f}[qQe](){return{log:t((...f)=>{this[ose]()||console.log(...f),xo(this,Zb,!0,"f"),Zt(this,Dg,"f").length&&xo(this,Dg,Zt(this,Dg,"f")+`
567
567
  `,"f"),xo(this,Dg,Zt(this,Dg,"f")+f.join(" "),"f")},"log"),error:t((...f)=>{this[ose]()||console.error(...f),xo(this,Zb,!0,"f"),Zt(this,Dg,"f").length&&xo(this,Dg,Zt(this,Dg,"f")+`
568
- `,"f"),xo(this,Dg,Zt(this,Dg,"f")+f.join(" "),"f")},"error")}}[ike](f){sR(Zt(this,Bo,"f")).forEach(h=>{if((C=>C==="configObjects")(h))return;let S=Zt(this,Bo,"f")[h];Array.isArray(S)?S.includes(f)&&S.splice(S.indexOf(f),1):typeof S=="object"&&delete S[f]}),delete Zt(this,il,"f").getDescriptions()[f]}[zQe](f,h,S){Zt(this,ese,"f")[S]||(Zt(this,Bc,"f").process.emitWarning(f,h),Zt(this,ese,"f")[S]=!0)}[VQe](){Zt(this,tse,"f").push({options:Zt(this,Bo,"f"),configObjects:Zt(this,Bo,"f").configObjects.slice(0),exitProcess:Zt(this,BS,"f"),groups:Zt(this,Hk,"f"),strict:Zt(this,x8,"f"),strictCommands:Zt(this,T8,"f"),strictOptions:Zt(this,C8,"f"),completionCommand:Zt(this,Qb,"f"),output:Zt(this,Dg,"f"),exitError:Zt(this,q6,"f"),hasOutput:Zt(this,Zb,"f"),parsed:this.parsed,parseFn:Zt(this,Xb,"f"),parseContext:Zt(this,b8,"f")}),Zt(this,il,"f").freeze(),Zt(this,sm,"f").freeze(),Zt(this,Om,"f").freeze(),Zt(this,JS,"f").freeze()}[UQe](){let f="",h;return/\b(node|iojs|electron)(\.exe)?$/.test(Zt(this,Bc,"f").process.argv()[0])?h=Zt(this,Bc,"f").process.argv().slice(1,2):h=Zt(this,Bc,"f").process.argv().slice(0,1),f=h.map(S=>{let C=this[iZe](Zt(this,y8,"f"),S);return S.match(/^(\/|([a-zA-Z]:)?\\)/)&&C.length<S.length?C:S}).join(" ").trim(),Zt(this,Bc,"f").getEnv("_")&&Zt(this,Bc,"f").getProcessArgvBin()===Zt(this,Bc,"f").getEnv("_")&&(f=Zt(this,Bc,"f").getEnv("_").replace(`${Zt(this,Bc,"f").path.dirname(Zt(this,Bc,"f").process.execPath())}/`,"")),f}[k8](){return Zt(this,ise,"f")}[WQe](){return Zt(this,ase,"f")}[ske](){if(!Zt(this,v8,"f"))return;let f=Zt(this,Bc,"f").getEnv("LC_ALL")||Zt(this,Bc,"f").getEnv("LC_MESSAGES")||Zt(this,Bc,"f").getEnv("LANG")||Zt(this,Bc,"f").getEnv("LANGUAGE")||"en_US";this.locale(f.replace(/[.:].*/,""))}[HQe](){return this[ake]().version||"unknown"}[GQe](f){let h=f["--"]?f["--"]:f._;for(let S=0,C;(C=h[S])!==void 0;S++)Zt(this,Bc,"f").Parser.looksLikeNumber(C)&&Number.isSafeInteger(Math.floor(parseFloat(`${C}`)))&&(h[S]=Number(C));return f}[ake](f){let h=f||"*";if(Zt(this,cR,"f")[h])return Zt(this,cR,"f")[h];let S={};try{let C=f||Zt(this,Bc,"f").mainFilename;!f&&Zt(this,Bc,"f").path.extname(C)&&(C=Zt(this,Bc,"f").path.dirname(C));let A=Zt(this,Bc,"f").findUp(C,(j,Z)=>{if(Z.includes("package.json"))return"package.json"});p1(A,void 0,Zt(this,Bc,"f")),S=JSON.parse(Zt(this,Bc,"f").readFileSync(A,"utf8"))}catch{}return Zt(this,cR,"f")[h]=S||{},Zt(this,cR,"f")[h]}[V6](f,h){h=[].concat(h),h.forEach(S=>{S=this[lke](S),Zt(this,Bo,"f")[f].push(S)})}[lR](f,h,S,C){this[cke](f,h,S,C,(A,j,Z)=>{Zt(this,Bo,"f")[A][j]=Z})}[oke](f,h,S,C){this[cke](f,h,S,C,(A,j,Z)=>{Zt(this,Bo,"f")[A][j]=(Zt(this,Bo,"f")[A][j]||[]).concat(Z)})}[cke](f,h,S,C,A){if(Array.isArray(S))S.forEach(j=>{f(j,C)});else if((j=>typeof j=="object")(S))for(let j of sR(S))f(j,S[j]);else A(h,this[lke](S),C)}[lke](f){return f==="__proto__"?"___proto___":f}[uke](f,h){return this[lR](this[uke].bind(this),"key",f,h),this}[fke](){var f,h,S,C,A,j,Z,oe,ge,je,Ae,_e;let Lt=Zt(this,tse,"f").pop();p1(Lt,void 0,Zt(this,Bc,"f"));let ot;f=this,h=this,S=this,C=this,A=this,j=this,Z=this,oe=this,ge=this,je=this,Ae=this,_e=this,{options:{set value(tt){xo(f,Bo,tt,"f")}}.value,configObjects:ot,exitProcess:{set value(tt){xo(h,BS,tt,"f")}}.value,groups:{set value(tt){xo(S,Hk,tt,"f")}}.value,output:{set value(tt){xo(C,Dg,tt,"f")}}.value,exitError:{set value(tt){xo(A,q6,tt,"f")}}.value,hasOutput:{set value(tt){xo(j,Zb,tt,"f")}}.value,parsed:this.parsed,strict:{set value(tt){xo(Z,x8,tt,"f")}}.value,strictCommands:{set value(tt){xo(oe,T8,tt,"f")}}.value,strictOptions:{set value(tt){xo(ge,C8,tt,"f")}}.value,completionCommand:{set value(tt){xo(je,Qb,tt,"f")}}.value,parseFn:{set value(tt){xo(Ae,Xb,tt,"f")}}.value,parseContext:{set value(tt){xo(_e,b8,tt,"f")}}.value}=Lt,Zt(this,Bo,"f").configObjects=ot,Zt(this,il,"f").unfreeze(),Zt(this,sm,"f").unfreeze(),Zt(this,Om,"f").unfreeze(),Zt(this,JS,"f").unfreeze()}[QQe](f,h){return g8(h,S=>(f(S),S))}getInternalMethods(){return{getCommandInstance:this[ZQe].bind(this),getContext:this[XQe].bind(this),getHasOutput:this[YQe].bind(this),getLoggerInstance:this[KQe].bind(this),getParseContext:this[eZe].bind(this),getParserConfiguration:this[k8].bind(this),getUsageConfiguration:this[WQe].bind(this),getUsageInstance:this[tZe].bind(this),getValidationInstance:this[rZe].bind(this),hasParseCallback:this[ose].bind(this),isGlobalContext:this[nZe].bind(this),postProcess:this[E8].bind(this),reset:this[_ke].bind(this),runValidation:this[pke].bind(this),runYargsParserAndExecuteCommands:this[QV].bind(this),setHasOutput:this[sZe].bind(this)}}[ZQe](){return Zt(this,Om,"f")}[XQe](){return Zt(this,GV,"f")}[YQe](){return Zt(this,Zb,"f")}[KQe](){return Zt(this,oR,"f")}[eZe](){return Zt(this,b8,"f")||{}}[tZe](){return Zt(this,il,"f")}[rZe](){return Zt(this,sm,"f")}[ose](){return!!Zt(this,Xb,"f")}[nZe](){return Zt(this,rse,"f")}[E8](f,h,S,C){return S||Wp(f)||(h||(f=this[$Qe](f)),(this[k8]()["parse-positional-numbers"]||this[k8]()["parse-positional-numbers"]===void 0)&&(f=this[GQe](f)),C&&(f=h8(f,this,Zt(this,JS,"f").getMiddleware(),!1))),f}[_ke](f={}){xo(this,Bo,Zt(this,Bo,"f")||{},"f");let h={};h.local=Zt(this,Bo,"f").local||[],h.configObjects=Zt(this,Bo,"f").configObjects||[];let S={};h.local.forEach(j=>{S[j]=!0,(f[j]||[]).forEach(Z=>{S[Z]=!0})}),Object.assign(Zt(this,S8,"f"),Object.keys(Zt(this,Hk,"f")).reduce((j,Z)=>{let oe=Zt(this,Hk,"f")[Z].filter(ge=>!(ge in S));return oe.length>0&&(j[Z]=oe),j},{})),xo(this,Hk,{},"f");let C=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],A=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];return C.forEach(j=>{h[j]=(Zt(this,Bo,"f")[j]||[]).filter(Z=>!S[Z])}),A.forEach(j=>{h[j]=J6(Zt(this,Bo,"f")[j],Z=>!S[Z])}),h.envPrefix=Zt(this,Bo,"f").envPrefix,xo(this,Bo,h,"f"),xo(this,il,Zt(this,il,"f")?Zt(this,il,"f").reset(S):OQe(this,Zt(this,Bc,"f")),"f"),xo(this,sm,Zt(this,sm,"f")?Zt(this,sm,"f").reset(S):BQe(this,Zt(this,il,"f"),Zt(this,Bc,"f")),"f"),xo(this,Om,Zt(this,Om,"f")?Zt(this,Om,"f").reset():AQe(Zt(this,il,"f"),Zt(this,sm,"f"),Zt(this,JS,"f"),Zt(this,Bc,"f")),"f"),Zt(this,jS,"f")||xo(this,jS,RQe(this,Zt(this,il,"f"),Zt(this,Om,"f"),Zt(this,Bc,"f")),"f"),Zt(this,JS,"f").reset(),xo(this,Qb,null,"f"),xo(this,Dg,"","f"),xo(this,q6,null,"f"),xo(this,Zb,!1,"f"),this.parsed=!1,this}[iZe](f,h){return Zt(this,Bc,"f").path.relative(f,h)}[QV](f,h,S,C=0,A=!1){let j=!!S||A;f=f||Zt(this,z6,"f"),Zt(this,Bo,"f").__=Zt(this,Bc,"f").y18n.__,Zt(this,Bo,"f").configuration=this[k8]();let Z=!!Zt(this,Bo,"f").configuration["populate--"],oe=Object.assign({},Zt(this,Bo,"f").configuration,{"populate--":!0}),ge=Zt(this,Bc,"f").Parser.detailed(f,Object.assign({},Zt(this,Bo,"f"),{configuration:{"parse-positional-numbers":!1,...oe}})),je=Object.assign(ge.argv,Zt(this,b8,"f")),Ae,_e=ge.aliases,Lt=!1,ot=!1;Object.keys(je).forEach(tt=>{tt===Zt(this,$S,"f")&&je[tt]?Lt=!0:tt===Zt(this,Gk,"f")&&je[tt]&&(ot=!0)}),je.$0=this.$0,this.parsed=ge,C===0&&Zt(this,il,"f").clearCachedHelpMessage();try{if(this[ske](),h)return this[E8](je,Z,!!S,!1);Zt(this,$S,"f")&&[Zt(this,$S,"f")].concat(_e[Zt(this,$S,"f")]||[]).filter($i=>$i.length>1).includes(""+je._[je._.length-1])&&(je._.pop(),Lt=!0),xo(this,rse,!1,"f");let tt=Zt(this,Om,"f").getCommands(),Ht=Zt(this,jS,"f").completionKey in je,jr=Lt||Ht||A;if(je._.length){if(tt.length){let Gn;for(let $i=C||0,is;je._[$i]!==void 0;$i++)if(is=String(je._[$i]),tt.includes(is)&&is!==Zt(this,Qb,"f")){let xi=Zt(this,Om,"f").runCommand(is,this,ge,$i+1,A,Lt||ot||A);return this[E8](xi,Z,!!S,!1)}else if(!Gn&&is!==Zt(this,Qb,"f")){Gn=is;break}!Zt(this,Om,"f").hasDefaultCommand()&&Zt(this,sse,"f")&&Gn&&!jr&&Zt(this,sm,"f").recommendCommands(Gn,tt)}Zt(this,Qb,"f")&&je._.includes(Zt(this,Qb,"f"))&&!Ht&&(Zt(this,BS,"f")&&$6(!0),this.showCompletionScript(),this.exit(0))}if(Zt(this,Om,"f").hasDefaultCommand()&&!jr){let Gn=Zt(this,Om,"f").runCommand(null,this,ge,0,A,Lt||ot||A);return this[E8](Gn,Z,!!S,!1)}if(Ht){Zt(this,BS,"f")&&$6(!0),f=[].concat(f);let Gn=f.slice(f.indexOf(`--${Zt(this,jS,"f").completionKey}`)+1);return Zt(this,jS,"f").getCompletion(Gn,($i,is)=>{if($i)throw new Up($i.message);(is||[]).forEach(xi=>{Zt(this,oR,"f").log(xi)}),this.exit(0)}),this[E8](je,!Z,!!S,!1)}if(Zt(this,Zb,"f")||(Lt?(Zt(this,BS,"f")&&$6(!0),j=!0,this.showHelp("log"),this.exit(0)):ot&&(Zt(this,BS,"f")&&$6(!0),j=!0,Zt(this,il,"f").showVersion("log"),this.exit(0))),!j&&Zt(this,Bo,"f").skipValidation.length>0&&(j=Object.keys(je).some(Gn=>Zt(this,Bo,"f").skipValidation.indexOf(Gn)>=0&&je[Gn]===!0)),!j){if(ge.error)throw new Up(ge.error.message);if(!Ht){let Gn=this[pke](_e,{},ge.error);S||(Ae=h8(je,this,Zt(this,JS,"f").getMiddleware(),!0)),Ae=this[QQe](Gn,Ae??je),Wp(Ae)&&!S&&(Ae=Ae.then(()=>h8(je,this,Zt(this,JS,"f").getMiddleware(),!1)))}}}catch(tt){if(tt instanceof Up)Zt(this,il,"f").fail(tt.message,tt);else throw tt}return this[E8](Ae??je,Z,!!S,!0)}[pke](f,h,S,C){let A={...this.getDemandedOptions()};return j=>{if(S)throw new Up(S.message);Zt(this,sm,"f").nonOptionCount(j),Zt(this,sm,"f").requiredArguments(j,A);let Z=!1;Zt(this,T8,"f")&&(Z=Zt(this,sm,"f").unknownCommands(j)),Zt(this,x8,"f")&&!Z?Zt(this,sm,"f").unknownArguments(j,f,h,!!C):Zt(this,C8,"f")&&Zt(this,sm,"f").unknownArguments(j,f,{},!1,!1),Zt(this,sm,"f").limitedChoices(j),Zt(this,sm,"f").implications(j),Zt(this,sm,"f").conflicting(j)}}[sZe](){xo(this,Zb,!0,"f")}[P8](f){if(typeof f=="string")Zt(this,Bo,"f").key[f]=!0;else for(let h of f)Zt(this,Bo,"f").key[h]=!0}};t(mke,"YargsInstance");var dke=mke;function IQe(l){return!!l&&typeof l.getInternalMethods=="function"}t(IQe,"isYargsInstance");var V5t=aZe(GCe),oZe=V5t;var ZV=require("util");function hke(l){console.log(l)}t(hke,"log");function qS(l){console.log(`[INFO] ${l}`)}t(qS,"logInfo");function XV(l){console.log((0,ZV.styleText)("green",`[SUCCESS] ${l}`))}t(XV,"logSuccess");function w8(l,f){l instanceof Error?console.log((0,ZV.styleText)("red",`[ERROR] ${f||l.message}`)):console.log((0,ZV.styleText)("red",`[ERROR] ${l}`))}t(w8,"logError");function cse(l){console.log((0,ZV.styleText)("bgYellow",`==== ${l} ====`))}t(cse,"logBanner");var cZe=Lh(require("fs"));function uR(){return"2.0.3-rc.2"}t(uR,"getVersion");var VXt=Lh(uZe());var gke=Symbol("options_key");function Gu(l){return(f,h)=>{var S,C;if(l!=null){let A={...Reflect.getMetadata(gke,f),[h]:{...l,describe:l.envAlias?`${l.describe||""} [${l.envAlias}]`:l.describe,type:l.type||((C=(S=Reflect.getMetadata("design:type",f,h))==null?void 0:S.name)==null?void 0:C.toLowerCase())}};Reflect.defineMetadata(gke,A,f)}}}t(Gu,"YargOption");function fZe(l){let f=Reflect.getMetadata(gke,l.prototype);if(!f)throw new Error(`Options for ${l.name} were not defined`);return f}t(fZe,"getYargsOption");function lse(l){return async f=>f.options(U5t(l)).middleware(async h=>await W5t(l,h),!0)}t(lse,"getBuilder");function U5t(l){return Object.entries(fZe(l)).reduce((f,[h,S])=>(f[h]=Object.fromEntries(Object.entries(S).filter(([C])=>!["envAlias","default"].includes(C))),f),{})}t(U5t,"getYargsOptions");async function W5t(l,f){let h=new l;for(let[S,C]of Object.entries(fZe(l)))h[S]=f[S]??C.default;return h}t(W5t,"loadYargsConfig");var eEe=require("util");var _Ze={100:"Continue",101:"Switching Protocols",102:"Processing",103:"Early Hints",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",300:"Ambiguous",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",418:"I Am a Teapot",421:"Misdirected Request",422:"Unprocessable Entity",424:"Failed Dependency",428:"Precondition Required",429:"Too Many Requests",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported"},pZe={"invalid-schema":"Invalid OpenAPI Schemas","invalid-operation-id":"Invalid Operation IDs","missing-path-parameter":"Missing Path Parameters","not-allowed-inline-enum":"Not Allowed Inline Enums","not-allowed-circular-schema":"Not Allowed Circular Schemas","missing-acl-condition-property":"Missing x-acl Condition Properties","missing-status-code":"Missing HTTP Status Codes","invalid-status-code":"Invalid HTTP Status Codes","multiple-success-status-codes":"Multiple Success HTTP Status Codes"};var y_=t(l=>l.charAt(0).toUpperCase()+l.slice(1),"capitalize"),U6=t(l=>l.charAt(0).toLowerCase()+l.slice(1),"decapitalize"),YV=t(l=>l.replace(/(-\w)/g,f=>f[1].toUpperCase()),"kebabToCamel"),fy=t(l=>l.replace(/(_\w)/g,f=>f[1].toUpperCase()),"snakeToCamel"),dZe=t(l=>l.replace(/[\W_]+(\w)?/g,(f,h)=>(h==null?void 0:h.toUpperCase())??""),"nonWordCharactersToCamel"),yke=t((l,f="")=>l.endsWith(f)?l:`${l}${f}`,"suffixIfNeeded"),mZe=t((l,f)=>l.replace(new RegExp(`${f}$`),""),"removeSuffix"),H5t=t(l=>{var S;let f=l.reduce((C,A)=>({...C,[A]:(C[A]??0)+1}),{});return(S=Object.entries(f).toSorted((C,A)=>C[1]===A[1]?A[0].length-C[0].length:A[1]-C[1])[0])==null?void 0:S[0]},"getLongestMostCommon"),vke=t(l=>{let f=l.flatMap(h=>G5t(hZe(y_(h))));return H5t(f)},"getMostCommonAdjacentCombinationSplit"),hZe=t(l=>l.split(/(?<![A-Z])(?=[A-Z])/).filter(Boolean),"splitByUppercase"),use=t(l=>hZe(l).join(" "),"camelToSpaceSeparated"),G5t=t((l,f=["dto","by","for","of","in","to","and","with"])=>{var S;let h=[];for(let C=0;C<l.length;C++)if(!f.includes(l[C].toLowerCase()))for(let A=C+1;A<=l.length;A++)f.includes((S=l[A-1])==null?void 0:S.toLowerCase())||h.push(l.slice(C,A).join(""));return h},"getAdjacentStringCombinations"),gZe=t((l,f)=>{let h=f.replace(/es$|s$/g,""),S=new RegExp(`(${U6(h)}|${y_(h)})[a-z]*(?=$|[A-Z])`,"g");return l.replace(S,"")},"removeWord");function D8(l){return dZe(l)}t(D8,"formatTag");function W6(l,f){var S;let h=(S=l.tags)==null?void 0:S[0];return D8(h??f.defaultTag)}t(W6,"getOperationTag");function yv(l,f){var S;let h=f.splitByTags?(S=l.tags)==null?void 0:S[0]:f.defaultTag;return D8(h??f.defaultTag)}t(yv,"getEndpointTag");function yZe(l,f){return f.excludeTags.some(h=>h.toLowerCase()===l.toLowerCase())}t(yZe,"isTagExcluded");var A8="application/json",bke={"Content-Type":A8,Accept:A8},fse="data",Ske="axios",H6="config",Qk="AxiosRequestConfig",_se={defaultImport:Ske,bindings:[Qk],from:"axios"};var $w=Lh(pse()),xke=2,vZe=["application/octet-stream","multipart/form-data","application/x-www-form-urlencoded","*/*"],bZe=["query","header","path"],I8=[$w.OpenAPIV3.HttpMethods.GET,$w.OpenAPIV3.HttpMethods.PUT,$w.OpenAPIV3.HttpMethods.POST,$w.OpenAPIV3.HttpMethods.DELETE,$w.OpenAPIV3.HttpMethods.OPTIONS,$w.OpenAPIV3.HttpMethods.HEAD,$w.OpenAPIV3.HttpMethods.PATCH,$w.OpenAPIV3.HttpMethods.TRACE],SZe=["string","number","integer","boolean"],KV=["allOf","anyOf","oneOf"];var xZe="Schema",TZe="Enum",CZe="Body",kZe="Param",EZe="Response",PZe="ErrorResponse",eU="z.void()",fR="z.any()",dse="z.instanceof(Blob)",tU="z.enum",wZe="z.int()",DZe="z.number()",mse="z.string()",AZe="z.email()",IZe="z.url()",NZe="z.uuid()",OZe="z.iso.datetime({ offset: true })",Q6={bindings:["z"],from:"zod"};var qw=Symbol.for("@ts-pattern/matcher"),X5t=Symbol.for("@ts-pattern/isVariadic"),gse="@ts-pattern/anonymous-select-key",Tke=t(l=>!!(l&&typeof l=="object"),"r"),hse=t(l=>l&&!!l[qw],"i"),Yk=t((l,f,h)=>{if(hse(l)){let S=l[qw](),{matched:C,selections:A}=S.match(f);return C&&A&&Object.keys(A).forEach(j=>h(j,A[j])),C}if(Tke(l)){if(!Tke(f))return!1;if(Array.isArray(l)){if(!Array.isArray(f))return!1;let S=[],C=[],A=[];for(let j of l.keys()){let Z=l[j];hse(Z)&&Z[X5t]?A.push(Z):A.length?C.push(Z):S.push(Z)}if(A.length){if(A.length>1)throw new Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");if(f.length<S.length+C.length)return!1;let j=f.slice(0,S.length),Z=C.length===0?[]:f.slice(-C.length),oe=f.slice(S.length,C.length===0?1/0:-C.length);return S.every((ge,je)=>Yk(ge,j[je],h))&&C.every((ge,je)=>Yk(ge,Z[je],h))&&(A.length===0||Yk(A[0],oe,h))}return l.length===f.length&&l.every((j,Z)=>Yk(j,f[Z],h))}return Reflect.ownKeys(l).every(S=>{let C=l[S];return(S in f||hse(A=C)&&A[qw]().matcherType==="optional")&&Yk(C,f[S],h);var A})}return Object.is(f,l)},"s"),e4=t(l=>{var f,h,S;return Tke(l)?hse(l)?(f=(h=(S=l[qw]()).getSelectionKeys)==null?void 0:h.call(S))!=null?f:[]:Array.isArray(l)?nU(l,e4):nU(Object.values(l),e4):[]},"o"),nU=t((l,f)=>l.reduce((h,S)=>h.concat(f(S)),[]),"c");function zS(l){return Object.assign(l,{optional:t(()=>Y5t(l),"optional"),and:t(f=>id(l,f),"and"),or:t(f=>K5t(l,f),"or"),select:t(f=>f===void 0?FZe(l):FZe(f,l),"select")})}t(zS,"u");function Y5t(l){return zS({[qw]:()=>({match:t(f=>{let h={},S=t((C,A)=>{h[C]=A},"r");return f===void 0?(e4(l).forEach(C=>S(C,void 0)),{matched:!0,selections:h}):{matched:Yk(l,f,S),selections:h}},"match"),getSelectionKeys:t(()=>e4(l),"getSelectionKeys"),matcherType:"optional"})})}t(Y5t,"h");function id(...l){return zS({[qw]:()=>({match:t(f=>{let h={},S=t((C,A)=>{h[C]=A},"r");return{matched:l.every(C=>Yk(C,f,S)),selections:h}},"match"),getSelectionKeys:t(()=>nU(l,e4),"getSelectionKeys"),matcherType:"and"})})}t(id,"m");function K5t(...l){return zS({[qw]:()=>({match:t(f=>{let h={},S=t((C,A)=>{h[C]=A},"r");return nU(l,e4).forEach(C=>S(C,void 0)),{matched:l.some(C=>Yk(C,f,S)),selections:h}},"match"),getSelectionKeys:t(()=>nU(l,e4),"getSelectionKeys"),matcherType:"or"})})}t(K5t,"d");function Lf(l){return{[qw]:()=>({match:t(f=>({matched:!!l(f)}),"match")})}}t(Lf,"p");function FZe(...l){let f=typeof l[0]=="string"?l[0]:void 0,h=l.length===2?l[1]:typeof l[0]=="string"?void 0:l[0];return zS({[qw]:()=>({match:t(S=>{let C={[f??gse]:S};return{matched:h===void 0||Yk(h,S,(A,j)=>{C[A]=j}),selections:C}},"match"),getSelectionKeys:t(()=>[f??gse].concat(h===void 0?[]:e4(h)),"getSelectionKeys")})})}t(FZe,"y");function Zk(l){return typeof l=="number"}t(Zk,"v");function Z6(l){return typeof l=="string"}t(Z6,"b");function X6(l){return typeof l=="bigint"}t(X6,"w");var nYt=zS(Lf(function(l){return!0}));var Y6=t(l=>Object.assign(zS(l),{startsWith:t(f=>{return Y6(id(l,(h=f,Lf(S=>Z6(S)&&S.startsWith(h)))));var h},"startsWith"),endsWith:t(f=>{return Y6(id(l,(h=f,Lf(S=>Z6(S)&&S.endsWith(h)))));var h},"endsWith"),minLength:t(f=>Y6(id(l,(h=>Lf(S=>Z6(S)&&S.length>=h))(f))),"minLength"),length:t(f=>Y6(id(l,(h=>Lf(S=>Z6(S)&&S.length===h))(f))),"length"),maxLength:t(f=>Y6(id(l,(h=>Lf(S=>Z6(S)&&S.length<=h))(f))),"maxLength"),includes:t(f=>{return Y6(id(l,(h=f,Lf(S=>Z6(S)&&S.includes(h)))));var h},"includes"),regex:t(f=>{return Y6(id(l,(h=f,Lf(S=>Z6(S)&&!!S.match(h)))));var h},"regex")}),"j"),iYt=Y6(Lf(Z6)),Xk=t(l=>Object.assign(zS(l),{between:t((f,h)=>Xk(id(l,((S,C)=>Lf(A=>Zk(A)&&S<=A&&C>=A))(f,h))),"between"),lt:t(f=>Xk(id(l,(h=>Lf(S=>Zk(S)&&S<h))(f))),"lt"),gt:t(f=>Xk(id(l,(h=>Lf(S=>Zk(S)&&S>h))(f))),"gt"),lte:t(f=>Xk(id(l,(h=>Lf(S=>Zk(S)&&S<=h))(f))),"lte"),gte:t(f=>Xk(id(l,(h=>Lf(S=>Zk(S)&&S>=h))(f))),"gte"),int:t(()=>Xk(id(l,Lf(f=>Zk(f)&&Number.isInteger(f)))),"int"),finite:t(()=>Xk(id(l,Lf(f=>Zk(f)&&Number.isFinite(f)))),"finite"),positive:t(()=>Xk(id(l,Lf(f=>Zk(f)&&f>0))),"positive"),negative:t(()=>Xk(id(l,Lf(f=>Zk(f)&&f<0))),"negative")}),"x"),sYt=Xk(Lf(Zk)),K6=t(l=>Object.assign(zS(l),{between:t((f,h)=>K6(id(l,((S,C)=>Lf(A=>X6(A)&&S<=A&&C>=A))(f,h))),"between"),lt:t(f=>K6(id(l,(h=>Lf(S=>X6(S)&&S<h))(f))),"lt"),gt:t(f=>K6(id(l,(h=>Lf(S=>X6(S)&&S>h))(f))),"gt"),lte:t(f=>K6(id(l,(h=>Lf(S=>X6(S)&&S<=h))(f))),"lte"),gte:t(f=>K6(id(l,(h=>Lf(S=>X6(S)&&S>=h))(f))),"gte"),positive:t(()=>K6(id(l,Lf(f=>X6(f)&&f>0))),"positive"),negative:t(()=>K6(id(l,Lf(f=>X6(f)&&f<0))),"negative")}),"A"),aYt=K6(Lf(X6)),oYt=zS(Lf(function(l){return typeof l=="boolean"})),cYt=zS(Lf(function(l){return typeof l=="symbol"})),lYt=zS(Lf(function(l){return l==null})),uYt=zS(Lf(function(l){return l!=null}));var Pke=class Pke extends Error{constructor(f){let h;try{h=JSON.stringify(f)}catch{h=f}super(`Pattern matching error: no pattern matches value ${h}`),this.input=void 0,this.input=f}};t(Pke,"W");var Cke=Pke,kke={matched:!1,value:void 0};function l0(l){return new Eke(l,kke)}t(l0,"z");var rU=class rU{constructor(f,h){this.input=void 0,this.state=void 0,this.input=f,this.state=h}with(...f){if(this.state.matched)return this;let h=f[f.length-1],S=[f[0]],C;f.length===3&&typeof f[1]=="function"?C=f[1]:f.length>2&&S.push(...f.slice(1,f.length-1));let A=!1,j={},Z=t((ge,je)=>{A=!0,j[ge]=je},"a"),oe=!S.some(ge=>Yk(ge,this.input,Z))||C&&!C(this.input)?kke:{matched:!0,value:h(A?gse in j?j[gse]:j:this.input,this.input)};return new rU(this.input,oe)}when(f,h){if(this.state.matched)return this;let S=!!f(this.input);return new rU(this.input,S?{matched:!0,value:h(this.input,this.input)}:kke)}otherwise(f){return this.state.matched?this.state.value:f(this.input)}exhaustive(){if(this.state.matched)return this.state.value;throw new Cke(this.input)}run(){return this.exhaustive()}returnType(){return this}};t(rU,"I");var Eke=rU;function xf(l){return l!=null&&Object.prototype.hasOwnProperty.call(l,"$ref")}t(xf,"isReferenceObject");function _y(l){return!xf(l)}t(_y,"isSchemaObject");function yse(l){return l.type==="array"}t(yse,"isArraySchemaObject");function MZe(l){if(!l.allOf)throw new Error("Function inferRequiredSchema is specialized to handle item with required only in an allOf array.");let[f,h]=l.allOf.reduce((C,A)=>{if(eFt(A)){let j=A.required;C[0].push(...j??[])}else C[1].push(A);return C},[[],[]]),S={properties:f.reduce((C,A)=>(C[A]={},C),{}),type:"object",required:f};return{noRequiredOnlyAllof:h,composedRequiredSchema:S,patchRequiredSchemaInLoop:t((C,A)=>{if(xf(C)){let j=A(C.$ref);j&&S.required.forEach(Z=>{var oe;S.properties[Z]=((oe=j==null?void 0:j.properties)==null?void 0:oe[Z])??{}})}else{let j=C.properties??{};S.required.forEach(Z=>{j[Z]&&(S.properties[Z]=j[Z]??{})})}},"patchRequiredSchemaInLoop")}}t(MZe,"inferRequiredSchema");var eFt=t(l=>!xf(l)&&!!l.required&&!l.type&&!l.properties&&!(l!=null&&l.allOf)&&!(l!=null&&l.anyOf)&&!l.oneOf,"isBrokenAllOfItem");var LZe=t(l=>`#/components/schemas/${l}`,"getSchemaRef"),N8=t(l=>l[1]==="/"?l:"#/"+l.slice(1),"autocorrectRef"),_R=t(l=>N8(l).split("/").at(-1),"getSchemaNameByRef");function Dke(l){let f=tFt(l).normalize("NFKD").trim().replace(/\s+/g,"_").replace(/--+/g,"-").replace(/-+/g,"_").replace(/[^\w-]+/g,"_");return fy(f)}t(Dke,"normalizeString");function Ake(l){return/^[a-zA-Z]\w*$/.test(l)?l:`"${l}"`}t(Ake,"wrapWithQuotesIfNeeded");function jZe(l){return typeof l=="string"&&l.startsWith('"')&&l.endsWith('"')?l.slice(1,-1):l}t(jZe,"unwrapQuotesIfNeeded");function tFt(l){let f=Number(l[0]);return typeof f=="number"&&!Number.isNaN(f)?"_"+l:l}t(tFt,"prefixStringStartingWithNumberIfNeeded");function Ike(l){let f=l.replaceAll("_","#");return fy(f.replaceAll("-","_")).replaceAll("#","_")}t(Ike,"pathParamToVariableName");var O8=t(l=>SZe.includes(l),"isPrimitiveType");function BZe(l){return l.replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/([\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F-\u009F\uFFFE\uFFFF])/g,(f,h)=>{let S=h.codePointAt(),C=S.toString(16);return S<=255?`\\x${`00${C}`.slice(-2)}`:`\\u${`0000${C}`.slice(-4)}`}).replace(/\//g,"\\/")}t(BZe,"escapeControlCharacters");function Kk(l){return l.includes("application/")&&l.includes("json")||vZe.includes(l)||l.includes("text/")}t(Kk,"isParamMediaTypeAllowed");function iU(l){return l>=200&&l<300}t(iU,"isMainResponseStatus");function vse(l){return!(l>=200&&l<300)}t(vse,"isErrorStatus");function bse(l){return l.startsWith("application/")}t(bse,"isMediaTypeAllowed");var RZe=/({\w+})/g,rFt=/[^\w\-]+/g;function JZe(l){l=y_(YV(l.replaceAll("/","-")).replaceAll("-",""));let f=[...l.matchAll(RZe)];if(f.length>0){let h=f.toSorted((S,C)=>S.index-C.index)[f.length-1][0];l=`${l.replace(RZe,"")}By${y_(h.slice(1,-1))}`}return l.replace(rFt,"_")}t(JZe,"pathToVariableName");var wke=/{(\b\w+(?:-\w+)*\b)}/g;function $Ze(l){let f=l.match(wke);return f===null?l.replaceAll(wke,":$1"):(f.forEach(h=>{let S=Ike(h.replaceAll(wke,":$1"));l=l.replaceAll(h,S)}),l)}t($Ze,"replaceHyphenatedPath");var Sse=t(l=>{let f=l["x-enumNames"],h=Array.isArray(f)&&f.length>0,S=!!l.schema&&_y(l.schema)&&l.schema.type==="string";return h&&S},"isSortingParameterObject"),F8=t((l,f)=>f.excludePathRegex?new RegExp(f.excludePathRegex).test(l):!1,"isPathExcluded");function eE({schema:l,meta:f,options:h}){let S=[];l0(l.type).with("string",()=>S.push(sFt(l))).with("number","integer",()=>S.push(oFt(l))).with("array",()=>S.push(cFt(l))).otherwise(()=>{}),typeof l.description=="string"&&l.description!==""&&h.withDescription&&([`
568
+ `,"f"),xo(this,Dg,Zt(this,Dg,"f")+f.join(" "),"f")},"error")}}[ike](f){sR(Zt(this,Bo,"f")).forEach(h=>{if((C=>C==="configObjects")(h))return;let S=Zt(this,Bo,"f")[h];Array.isArray(S)?S.includes(f)&&S.splice(S.indexOf(f),1):typeof S=="object"&&delete S[f]}),delete Zt(this,il,"f").getDescriptions()[f]}[zQe](f,h,S){Zt(this,ese,"f")[S]||(Zt(this,Bc,"f").process.emitWarning(f,h),Zt(this,ese,"f")[S]=!0)}[VQe](){Zt(this,tse,"f").push({options:Zt(this,Bo,"f"),configObjects:Zt(this,Bo,"f").configObjects.slice(0),exitProcess:Zt(this,BS,"f"),groups:Zt(this,Hk,"f"),strict:Zt(this,x8,"f"),strictCommands:Zt(this,T8,"f"),strictOptions:Zt(this,C8,"f"),completionCommand:Zt(this,Qb,"f"),output:Zt(this,Dg,"f"),exitError:Zt(this,q6,"f"),hasOutput:Zt(this,Zb,"f"),parsed:this.parsed,parseFn:Zt(this,Xb,"f"),parseContext:Zt(this,b8,"f")}),Zt(this,il,"f").freeze(),Zt(this,sm,"f").freeze(),Zt(this,Om,"f").freeze(),Zt(this,JS,"f").freeze()}[UQe](){let f="",h;return/\b(node|iojs|electron)(\.exe)?$/.test(Zt(this,Bc,"f").process.argv()[0])?h=Zt(this,Bc,"f").process.argv().slice(1,2):h=Zt(this,Bc,"f").process.argv().slice(0,1),f=h.map(S=>{let C=this[iZe](Zt(this,y8,"f"),S);return S.match(/^(\/|([a-zA-Z]:)?\\)/)&&C.length<S.length?C:S}).join(" ").trim(),Zt(this,Bc,"f").getEnv("_")&&Zt(this,Bc,"f").getProcessArgvBin()===Zt(this,Bc,"f").getEnv("_")&&(f=Zt(this,Bc,"f").getEnv("_").replace(`${Zt(this,Bc,"f").path.dirname(Zt(this,Bc,"f").process.execPath())}/`,"")),f}[k8](){return Zt(this,ise,"f")}[WQe](){return Zt(this,ase,"f")}[ske](){if(!Zt(this,v8,"f"))return;let f=Zt(this,Bc,"f").getEnv("LC_ALL")||Zt(this,Bc,"f").getEnv("LC_MESSAGES")||Zt(this,Bc,"f").getEnv("LANG")||Zt(this,Bc,"f").getEnv("LANGUAGE")||"en_US";this.locale(f.replace(/[.:].*/,""))}[HQe](){return this[ake]().version||"unknown"}[GQe](f){let h=f["--"]?f["--"]:f._;for(let S=0,C;(C=h[S])!==void 0;S++)Zt(this,Bc,"f").Parser.looksLikeNumber(C)&&Number.isSafeInteger(Math.floor(parseFloat(`${C}`)))&&(h[S]=Number(C));return f}[ake](f){let h=f||"*";if(Zt(this,cR,"f")[h])return Zt(this,cR,"f")[h];let S={};try{let C=f||Zt(this,Bc,"f").mainFilename;!f&&Zt(this,Bc,"f").path.extname(C)&&(C=Zt(this,Bc,"f").path.dirname(C));let A=Zt(this,Bc,"f").findUp(C,(j,Z)=>{if(Z.includes("package.json"))return"package.json"});p1(A,void 0,Zt(this,Bc,"f")),S=JSON.parse(Zt(this,Bc,"f").readFileSync(A,"utf8"))}catch{}return Zt(this,cR,"f")[h]=S||{},Zt(this,cR,"f")[h]}[V6](f,h){h=[].concat(h),h.forEach(S=>{S=this[lke](S),Zt(this,Bo,"f")[f].push(S)})}[lR](f,h,S,C){this[cke](f,h,S,C,(A,j,Z)=>{Zt(this,Bo,"f")[A][j]=Z})}[oke](f,h,S,C){this[cke](f,h,S,C,(A,j,Z)=>{Zt(this,Bo,"f")[A][j]=(Zt(this,Bo,"f")[A][j]||[]).concat(Z)})}[cke](f,h,S,C,A){if(Array.isArray(S))S.forEach(j=>{f(j,C)});else if((j=>typeof j=="object")(S))for(let j of sR(S))f(j,S[j]);else A(h,this[lke](S),C)}[lke](f){return f==="__proto__"?"___proto___":f}[uke](f,h){return this[lR](this[uke].bind(this),"key",f,h),this}[fke](){var f,h,S,C,A,j,Z,oe,ge,je,Ae,_e;let Lt=Zt(this,tse,"f").pop();p1(Lt,void 0,Zt(this,Bc,"f"));let ot;f=this,h=this,S=this,C=this,A=this,j=this,Z=this,oe=this,ge=this,je=this,Ae=this,_e=this,{options:{set value(tt){xo(f,Bo,tt,"f")}}.value,configObjects:ot,exitProcess:{set value(tt){xo(h,BS,tt,"f")}}.value,groups:{set value(tt){xo(S,Hk,tt,"f")}}.value,output:{set value(tt){xo(C,Dg,tt,"f")}}.value,exitError:{set value(tt){xo(A,q6,tt,"f")}}.value,hasOutput:{set value(tt){xo(j,Zb,tt,"f")}}.value,parsed:this.parsed,strict:{set value(tt){xo(Z,x8,tt,"f")}}.value,strictCommands:{set value(tt){xo(oe,T8,tt,"f")}}.value,strictOptions:{set value(tt){xo(ge,C8,tt,"f")}}.value,completionCommand:{set value(tt){xo(je,Qb,tt,"f")}}.value,parseFn:{set value(tt){xo(Ae,Xb,tt,"f")}}.value,parseContext:{set value(tt){xo(_e,b8,tt,"f")}}.value}=Lt,Zt(this,Bo,"f").configObjects=ot,Zt(this,il,"f").unfreeze(),Zt(this,sm,"f").unfreeze(),Zt(this,Om,"f").unfreeze(),Zt(this,JS,"f").unfreeze()}[QQe](f,h){return g8(h,S=>(f(S),S))}getInternalMethods(){return{getCommandInstance:this[ZQe].bind(this),getContext:this[XQe].bind(this),getHasOutput:this[YQe].bind(this),getLoggerInstance:this[KQe].bind(this),getParseContext:this[eZe].bind(this),getParserConfiguration:this[k8].bind(this),getUsageConfiguration:this[WQe].bind(this),getUsageInstance:this[tZe].bind(this),getValidationInstance:this[rZe].bind(this),hasParseCallback:this[ose].bind(this),isGlobalContext:this[nZe].bind(this),postProcess:this[E8].bind(this),reset:this[_ke].bind(this),runValidation:this[pke].bind(this),runYargsParserAndExecuteCommands:this[QV].bind(this),setHasOutput:this[sZe].bind(this)}}[ZQe](){return Zt(this,Om,"f")}[XQe](){return Zt(this,GV,"f")}[YQe](){return Zt(this,Zb,"f")}[KQe](){return Zt(this,oR,"f")}[eZe](){return Zt(this,b8,"f")||{}}[tZe](){return Zt(this,il,"f")}[rZe](){return Zt(this,sm,"f")}[ose](){return!!Zt(this,Xb,"f")}[nZe](){return Zt(this,rse,"f")}[E8](f,h,S,C){return S||Wp(f)||(h||(f=this[$Qe](f)),(this[k8]()["parse-positional-numbers"]||this[k8]()["parse-positional-numbers"]===void 0)&&(f=this[GQe](f)),C&&(f=h8(f,this,Zt(this,JS,"f").getMiddleware(),!1))),f}[_ke](f={}){xo(this,Bo,Zt(this,Bo,"f")||{},"f");let h={};h.local=Zt(this,Bo,"f").local||[],h.configObjects=Zt(this,Bo,"f").configObjects||[];let S={};h.local.forEach(j=>{S[j]=!0,(f[j]||[]).forEach(Z=>{S[Z]=!0})}),Object.assign(Zt(this,S8,"f"),Object.keys(Zt(this,Hk,"f")).reduce((j,Z)=>{let oe=Zt(this,Hk,"f")[Z].filter(ge=>!(ge in S));return oe.length>0&&(j[Z]=oe),j},{})),xo(this,Hk,{},"f");let C=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],A=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];return C.forEach(j=>{h[j]=(Zt(this,Bo,"f")[j]||[]).filter(Z=>!S[Z])}),A.forEach(j=>{h[j]=J6(Zt(this,Bo,"f")[j],Z=>!S[Z])}),h.envPrefix=Zt(this,Bo,"f").envPrefix,xo(this,Bo,h,"f"),xo(this,il,Zt(this,il,"f")?Zt(this,il,"f").reset(S):OQe(this,Zt(this,Bc,"f")),"f"),xo(this,sm,Zt(this,sm,"f")?Zt(this,sm,"f").reset(S):BQe(this,Zt(this,il,"f"),Zt(this,Bc,"f")),"f"),xo(this,Om,Zt(this,Om,"f")?Zt(this,Om,"f").reset():AQe(Zt(this,il,"f"),Zt(this,sm,"f"),Zt(this,JS,"f"),Zt(this,Bc,"f")),"f"),Zt(this,jS,"f")||xo(this,jS,RQe(this,Zt(this,il,"f"),Zt(this,Om,"f"),Zt(this,Bc,"f")),"f"),Zt(this,JS,"f").reset(),xo(this,Qb,null,"f"),xo(this,Dg,"","f"),xo(this,q6,null,"f"),xo(this,Zb,!1,"f"),this.parsed=!1,this}[iZe](f,h){return Zt(this,Bc,"f").path.relative(f,h)}[QV](f,h,S,C=0,A=!1){let j=!!S||A;f=f||Zt(this,z6,"f"),Zt(this,Bo,"f").__=Zt(this,Bc,"f").y18n.__,Zt(this,Bo,"f").configuration=this[k8]();let Z=!!Zt(this,Bo,"f").configuration["populate--"],oe=Object.assign({},Zt(this,Bo,"f").configuration,{"populate--":!0}),ge=Zt(this,Bc,"f").Parser.detailed(f,Object.assign({},Zt(this,Bo,"f"),{configuration:{"parse-positional-numbers":!1,...oe}})),je=Object.assign(ge.argv,Zt(this,b8,"f")),Ae,_e=ge.aliases,Lt=!1,ot=!1;Object.keys(je).forEach(tt=>{tt===Zt(this,$S,"f")&&je[tt]?Lt=!0:tt===Zt(this,Gk,"f")&&je[tt]&&(ot=!0)}),je.$0=this.$0,this.parsed=ge,C===0&&Zt(this,il,"f").clearCachedHelpMessage();try{if(this[ske](),h)return this[E8](je,Z,!!S,!1);Zt(this,$S,"f")&&[Zt(this,$S,"f")].concat(_e[Zt(this,$S,"f")]||[]).filter($i=>$i.length>1).includes(""+je._[je._.length-1])&&(je._.pop(),Lt=!0),xo(this,rse,!1,"f");let tt=Zt(this,Om,"f").getCommands(),Ht=Zt(this,jS,"f").completionKey in je,jr=Lt||Ht||A;if(je._.length){if(tt.length){let Gn;for(let $i=C||0,is;je._[$i]!==void 0;$i++)if(is=String(je._[$i]),tt.includes(is)&&is!==Zt(this,Qb,"f")){let xi=Zt(this,Om,"f").runCommand(is,this,ge,$i+1,A,Lt||ot||A);return this[E8](xi,Z,!!S,!1)}else if(!Gn&&is!==Zt(this,Qb,"f")){Gn=is;break}!Zt(this,Om,"f").hasDefaultCommand()&&Zt(this,sse,"f")&&Gn&&!jr&&Zt(this,sm,"f").recommendCommands(Gn,tt)}Zt(this,Qb,"f")&&je._.includes(Zt(this,Qb,"f"))&&!Ht&&(Zt(this,BS,"f")&&$6(!0),this.showCompletionScript(),this.exit(0))}if(Zt(this,Om,"f").hasDefaultCommand()&&!jr){let Gn=Zt(this,Om,"f").runCommand(null,this,ge,0,A,Lt||ot||A);return this[E8](Gn,Z,!!S,!1)}if(Ht){Zt(this,BS,"f")&&$6(!0),f=[].concat(f);let Gn=f.slice(f.indexOf(`--${Zt(this,jS,"f").completionKey}`)+1);return Zt(this,jS,"f").getCompletion(Gn,($i,is)=>{if($i)throw new Up($i.message);(is||[]).forEach(xi=>{Zt(this,oR,"f").log(xi)}),this.exit(0)}),this[E8](je,!Z,!!S,!1)}if(Zt(this,Zb,"f")||(Lt?(Zt(this,BS,"f")&&$6(!0),j=!0,this.showHelp("log"),this.exit(0)):ot&&(Zt(this,BS,"f")&&$6(!0),j=!0,Zt(this,il,"f").showVersion("log"),this.exit(0))),!j&&Zt(this,Bo,"f").skipValidation.length>0&&(j=Object.keys(je).some(Gn=>Zt(this,Bo,"f").skipValidation.indexOf(Gn)>=0&&je[Gn]===!0)),!j){if(ge.error)throw new Up(ge.error.message);if(!Ht){let Gn=this[pke](_e,{},ge.error);S||(Ae=h8(je,this,Zt(this,JS,"f").getMiddleware(),!0)),Ae=this[QQe](Gn,Ae??je),Wp(Ae)&&!S&&(Ae=Ae.then(()=>h8(je,this,Zt(this,JS,"f").getMiddleware(),!1)))}}}catch(tt){if(tt instanceof Up)Zt(this,il,"f").fail(tt.message,tt);else throw tt}return this[E8](Ae??je,Z,!!S,!0)}[pke](f,h,S,C){let A={...this.getDemandedOptions()};return j=>{if(S)throw new Up(S.message);Zt(this,sm,"f").nonOptionCount(j),Zt(this,sm,"f").requiredArguments(j,A);let Z=!1;Zt(this,T8,"f")&&(Z=Zt(this,sm,"f").unknownCommands(j)),Zt(this,x8,"f")&&!Z?Zt(this,sm,"f").unknownArguments(j,f,h,!!C):Zt(this,C8,"f")&&Zt(this,sm,"f").unknownArguments(j,f,{},!1,!1),Zt(this,sm,"f").limitedChoices(j),Zt(this,sm,"f").implications(j),Zt(this,sm,"f").conflicting(j)}}[sZe](){xo(this,Zb,!0,"f")}[P8](f){if(typeof f=="string")Zt(this,Bo,"f").key[f]=!0;else for(let h of f)Zt(this,Bo,"f").key[h]=!0}};t(mke,"YargsInstance");var dke=mke;function IQe(l){return!!l&&typeof l.getInternalMethods=="function"}t(IQe,"isYargsInstance");var V5t=aZe(GCe),oZe=V5t;var ZV=require("util");function hke(l){console.log(l)}t(hke,"log");function qS(l){console.log(`[INFO] ${l}`)}t(qS,"logInfo");function XV(l){console.log((0,ZV.styleText)("green",`[SUCCESS] ${l}`))}t(XV,"logSuccess");function w8(l,f){l instanceof Error?console.log((0,ZV.styleText)("red",`[ERROR] ${f||l.message}`)):console.log((0,ZV.styleText)("red",`[ERROR] ${l}`))}t(w8,"logError");function cse(l){console.log((0,ZV.styleText)("bgYellow",`==== ${l} ====`))}t(cse,"logBanner");var cZe=Lh(require("fs"));function uR(){return"2.0.3"}t(uR,"getVersion");var VXt=Lh(uZe());var gke=Symbol("options_key");function Gu(l){return(f,h)=>{var S,C;if(l!=null){let A={...Reflect.getMetadata(gke,f),[h]:{...l,describe:l.envAlias?`${l.describe||""} [${l.envAlias}]`:l.describe,type:l.type||((C=(S=Reflect.getMetadata("design:type",f,h))==null?void 0:S.name)==null?void 0:C.toLowerCase())}};Reflect.defineMetadata(gke,A,f)}}}t(Gu,"YargOption");function fZe(l){let f=Reflect.getMetadata(gke,l.prototype);if(!f)throw new Error(`Options for ${l.name} were not defined`);return f}t(fZe,"getYargsOption");function lse(l){return async f=>f.options(U5t(l)).middleware(async h=>await W5t(l,h),!0)}t(lse,"getBuilder");function U5t(l){return Object.entries(fZe(l)).reduce((f,[h,S])=>(f[h]=Object.fromEntries(Object.entries(S).filter(([C])=>!["envAlias","default"].includes(C))),f),{})}t(U5t,"getYargsOptions");async function W5t(l,f){let h=new l;for(let[S,C]of Object.entries(fZe(l)))h[S]=f[S]??C.default;return h}t(W5t,"loadYargsConfig");var eEe=require("util");var _Ze={100:"Continue",101:"Switching Protocols",102:"Processing",103:"Early Hints",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",300:"Ambiguous",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",418:"I Am a Teapot",421:"Misdirected Request",422:"Unprocessable Entity",424:"Failed Dependency",428:"Precondition Required",429:"Too Many Requests",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported"},pZe={"invalid-schema":"Invalid OpenAPI Schemas","invalid-operation-id":"Invalid Operation IDs","missing-path-parameter":"Missing Path Parameters","not-allowed-inline-enum":"Not Allowed Inline Enums","not-allowed-circular-schema":"Not Allowed Circular Schemas","missing-acl-condition-property":"Missing x-acl Condition Properties","missing-status-code":"Missing HTTP Status Codes","invalid-status-code":"Invalid HTTP Status Codes","multiple-success-status-codes":"Multiple Success HTTP Status Codes"};var y_=t(l=>l.charAt(0).toUpperCase()+l.slice(1),"capitalize"),U6=t(l=>l.charAt(0).toLowerCase()+l.slice(1),"decapitalize"),YV=t(l=>l.replace(/(-\w)/g,f=>f[1].toUpperCase()),"kebabToCamel"),fy=t(l=>l.replace(/(_\w)/g,f=>f[1].toUpperCase()),"snakeToCamel"),dZe=t(l=>l.replace(/[\W_]+(\w)?/g,(f,h)=>(h==null?void 0:h.toUpperCase())??""),"nonWordCharactersToCamel"),yke=t((l,f="")=>l.endsWith(f)?l:`${l}${f}`,"suffixIfNeeded"),mZe=t((l,f)=>l.replace(new RegExp(`${f}$`),""),"removeSuffix"),H5t=t(l=>{var S;let f=l.reduce((C,A)=>({...C,[A]:(C[A]??0)+1}),{});return(S=Object.entries(f).toSorted((C,A)=>C[1]===A[1]?A[0].length-C[0].length:A[1]-C[1])[0])==null?void 0:S[0]},"getLongestMostCommon"),vke=t(l=>{let f=l.flatMap(h=>G5t(hZe(y_(h))));return H5t(f)},"getMostCommonAdjacentCombinationSplit"),hZe=t(l=>l.split(/(?<![A-Z])(?=[A-Z])/).filter(Boolean),"splitByUppercase"),use=t(l=>hZe(l).join(" "),"camelToSpaceSeparated"),G5t=t((l,f=["dto","by","for","of","in","to","and","with"])=>{var S;let h=[];for(let C=0;C<l.length;C++)if(!f.includes(l[C].toLowerCase()))for(let A=C+1;A<=l.length;A++)f.includes((S=l[A-1])==null?void 0:S.toLowerCase())||h.push(l.slice(C,A).join(""));return h},"getAdjacentStringCombinations"),gZe=t((l,f)=>{let h=f.replace(/es$|s$/g,""),S=new RegExp(`(${U6(h)}|${y_(h)})[a-z]*(?=$|[A-Z])`,"g");return l.replace(S,"")},"removeWord");function D8(l){return dZe(l)}t(D8,"formatTag");function W6(l,f){var S;let h=(S=l.tags)==null?void 0:S[0];return D8(h??f.defaultTag)}t(W6,"getOperationTag");function yv(l,f){var S;let h=f.splitByTags?(S=l.tags)==null?void 0:S[0]:f.defaultTag;return D8(h??f.defaultTag)}t(yv,"getEndpointTag");function yZe(l,f){return f.excludeTags.some(h=>h.toLowerCase()===l.toLowerCase())}t(yZe,"isTagExcluded");var A8="application/json",bke={"Content-Type":A8,Accept:A8},fse="data",Ske="axios",H6="config",Qk="AxiosRequestConfig",_se={defaultImport:Ske,bindings:[Qk],from:"axios"};var $w=Lh(pse()),xke=2,vZe=["application/octet-stream","multipart/form-data","application/x-www-form-urlencoded","*/*"],bZe=["query","header","path"],I8=[$w.OpenAPIV3.HttpMethods.GET,$w.OpenAPIV3.HttpMethods.PUT,$w.OpenAPIV3.HttpMethods.POST,$w.OpenAPIV3.HttpMethods.DELETE,$w.OpenAPIV3.HttpMethods.OPTIONS,$w.OpenAPIV3.HttpMethods.HEAD,$w.OpenAPIV3.HttpMethods.PATCH,$w.OpenAPIV3.HttpMethods.TRACE],SZe=["string","number","integer","boolean"],KV=["allOf","anyOf","oneOf"];var xZe="Schema",TZe="Enum",CZe="Body",kZe="Param",EZe="Response",PZe="ErrorResponse",eU="z.void()",fR="z.any()",dse="z.instanceof(Blob)",tU="z.enum",wZe="z.int()",DZe="z.number()",mse="z.string()",AZe="z.email()",IZe="z.url()",NZe="z.uuid()",OZe="z.iso.datetime({ offset: true })",Q6={bindings:["z"],from:"zod"};var qw=Symbol.for("@ts-pattern/matcher"),X5t=Symbol.for("@ts-pattern/isVariadic"),gse="@ts-pattern/anonymous-select-key",Tke=t(l=>!!(l&&typeof l=="object"),"r"),hse=t(l=>l&&!!l[qw],"i"),Yk=t((l,f,h)=>{if(hse(l)){let S=l[qw](),{matched:C,selections:A}=S.match(f);return C&&A&&Object.keys(A).forEach(j=>h(j,A[j])),C}if(Tke(l)){if(!Tke(f))return!1;if(Array.isArray(l)){if(!Array.isArray(f))return!1;let S=[],C=[],A=[];for(let j of l.keys()){let Z=l[j];hse(Z)&&Z[X5t]?A.push(Z):A.length?C.push(Z):S.push(Z)}if(A.length){if(A.length>1)throw new Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");if(f.length<S.length+C.length)return!1;let j=f.slice(0,S.length),Z=C.length===0?[]:f.slice(-C.length),oe=f.slice(S.length,C.length===0?1/0:-C.length);return S.every((ge,je)=>Yk(ge,j[je],h))&&C.every((ge,je)=>Yk(ge,Z[je],h))&&(A.length===0||Yk(A[0],oe,h))}return l.length===f.length&&l.every((j,Z)=>Yk(j,f[Z],h))}return Reflect.ownKeys(l).every(S=>{let C=l[S];return(S in f||hse(A=C)&&A[qw]().matcherType==="optional")&&Yk(C,f[S],h);var A})}return Object.is(f,l)},"s"),e4=t(l=>{var f,h,S;return Tke(l)?hse(l)?(f=(h=(S=l[qw]()).getSelectionKeys)==null?void 0:h.call(S))!=null?f:[]:Array.isArray(l)?nU(l,e4):nU(Object.values(l),e4):[]},"o"),nU=t((l,f)=>l.reduce((h,S)=>h.concat(f(S)),[]),"c");function zS(l){return Object.assign(l,{optional:t(()=>Y5t(l),"optional"),and:t(f=>id(l,f),"and"),or:t(f=>K5t(l,f),"or"),select:t(f=>f===void 0?FZe(l):FZe(f,l),"select")})}t(zS,"u");function Y5t(l){return zS({[qw]:()=>({match:t(f=>{let h={},S=t((C,A)=>{h[C]=A},"r");return f===void 0?(e4(l).forEach(C=>S(C,void 0)),{matched:!0,selections:h}):{matched:Yk(l,f,S),selections:h}},"match"),getSelectionKeys:t(()=>e4(l),"getSelectionKeys"),matcherType:"optional"})})}t(Y5t,"h");function id(...l){return zS({[qw]:()=>({match:t(f=>{let h={},S=t((C,A)=>{h[C]=A},"r");return{matched:l.every(C=>Yk(C,f,S)),selections:h}},"match"),getSelectionKeys:t(()=>nU(l,e4),"getSelectionKeys"),matcherType:"and"})})}t(id,"m");function K5t(...l){return zS({[qw]:()=>({match:t(f=>{let h={},S=t((C,A)=>{h[C]=A},"r");return nU(l,e4).forEach(C=>S(C,void 0)),{matched:l.some(C=>Yk(C,f,S)),selections:h}},"match"),getSelectionKeys:t(()=>nU(l,e4),"getSelectionKeys"),matcherType:"or"})})}t(K5t,"d");function Lf(l){return{[qw]:()=>({match:t(f=>({matched:!!l(f)}),"match")})}}t(Lf,"p");function FZe(...l){let f=typeof l[0]=="string"?l[0]:void 0,h=l.length===2?l[1]:typeof l[0]=="string"?void 0:l[0];return zS({[qw]:()=>({match:t(S=>{let C={[f??gse]:S};return{matched:h===void 0||Yk(h,S,(A,j)=>{C[A]=j}),selections:C}},"match"),getSelectionKeys:t(()=>[f??gse].concat(h===void 0?[]:e4(h)),"getSelectionKeys")})})}t(FZe,"y");function Zk(l){return typeof l=="number"}t(Zk,"v");function Z6(l){return typeof l=="string"}t(Z6,"b");function X6(l){return typeof l=="bigint"}t(X6,"w");var nYt=zS(Lf(function(l){return!0}));var Y6=t(l=>Object.assign(zS(l),{startsWith:t(f=>{return Y6(id(l,(h=f,Lf(S=>Z6(S)&&S.startsWith(h)))));var h},"startsWith"),endsWith:t(f=>{return Y6(id(l,(h=f,Lf(S=>Z6(S)&&S.endsWith(h)))));var h},"endsWith"),minLength:t(f=>Y6(id(l,(h=>Lf(S=>Z6(S)&&S.length>=h))(f))),"minLength"),length:t(f=>Y6(id(l,(h=>Lf(S=>Z6(S)&&S.length===h))(f))),"length"),maxLength:t(f=>Y6(id(l,(h=>Lf(S=>Z6(S)&&S.length<=h))(f))),"maxLength"),includes:t(f=>{return Y6(id(l,(h=f,Lf(S=>Z6(S)&&S.includes(h)))));var h},"includes"),regex:t(f=>{return Y6(id(l,(h=f,Lf(S=>Z6(S)&&!!S.match(h)))));var h},"regex")}),"j"),iYt=Y6(Lf(Z6)),Xk=t(l=>Object.assign(zS(l),{between:t((f,h)=>Xk(id(l,((S,C)=>Lf(A=>Zk(A)&&S<=A&&C>=A))(f,h))),"between"),lt:t(f=>Xk(id(l,(h=>Lf(S=>Zk(S)&&S<h))(f))),"lt"),gt:t(f=>Xk(id(l,(h=>Lf(S=>Zk(S)&&S>h))(f))),"gt"),lte:t(f=>Xk(id(l,(h=>Lf(S=>Zk(S)&&S<=h))(f))),"lte"),gte:t(f=>Xk(id(l,(h=>Lf(S=>Zk(S)&&S>=h))(f))),"gte"),int:t(()=>Xk(id(l,Lf(f=>Zk(f)&&Number.isInteger(f)))),"int"),finite:t(()=>Xk(id(l,Lf(f=>Zk(f)&&Number.isFinite(f)))),"finite"),positive:t(()=>Xk(id(l,Lf(f=>Zk(f)&&f>0))),"positive"),negative:t(()=>Xk(id(l,Lf(f=>Zk(f)&&f<0))),"negative")}),"x"),sYt=Xk(Lf(Zk)),K6=t(l=>Object.assign(zS(l),{between:t((f,h)=>K6(id(l,((S,C)=>Lf(A=>X6(A)&&S<=A&&C>=A))(f,h))),"between"),lt:t(f=>K6(id(l,(h=>Lf(S=>X6(S)&&S<h))(f))),"lt"),gt:t(f=>K6(id(l,(h=>Lf(S=>X6(S)&&S>h))(f))),"gt"),lte:t(f=>K6(id(l,(h=>Lf(S=>X6(S)&&S<=h))(f))),"lte"),gte:t(f=>K6(id(l,(h=>Lf(S=>X6(S)&&S>=h))(f))),"gte"),positive:t(()=>K6(id(l,Lf(f=>X6(f)&&f>0))),"positive"),negative:t(()=>K6(id(l,Lf(f=>X6(f)&&f<0))),"negative")}),"A"),aYt=K6(Lf(X6)),oYt=zS(Lf(function(l){return typeof l=="boolean"})),cYt=zS(Lf(function(l){return typeof l=="symbol"})),lYt=zS(Lf(function(l){return l==null})),uYt=zS(Lf(function(l){return l!=null}));var Pke=class Pke extends Error{constructor(f){let h;try{h=JSON.stringify(f)}catch{h=f}super(`Pattern matching error: no pattern matches value ${h}`),this.input=void 0,this.input=f}};t(Pke,"W");var Cke=Pke,kke={matched:!1,value:void 0};function l0(l){return new Eke(l,kke)}t(l0,"z");var rU=class rU{constructor(f,h){this.input=void 0,this.state=void 0,this.input=f,this.state=h}with(...f){if(this.state.matched)return this;let h=f[f.length-1],S=[f[0]],C;f.length===3&&typeof f[1]=="function"?C=f[1]:f.length>2&&S.push(...f.slice(1,f.length-1));let A=!1,j={},Z=t((ge,je)=>{A=!0,j[ge]=je},"a"),oe=!S.some(ge=>Yk(ge,this.input,Z))||C&&!C(this.input)?kke:{matched:!0,value:h(A?gse in j?j[gse]:j:this.input,this.input)};return new rU(this.input,oe)}when(f,h){if(this.state.matched)return this;let S=!!f(this.input);return new rU(this.input,S?{matched:!0,value:h(this.input,this.input)}:kke)}otherwise(f){return this.state.matched?this.state.value:f(this.input)}exhaustive(){if(this.state.matched)return this.state.value;throw new Cke(this.input)}run(){return this.exhaustive()}returnType(){return this}};t(rU,"I");var Eke=rU;function xf(l){return l!=null&&Object.prototype.hasOwnProperty.call(l,"$ref")}t(xf,"isReferenceObject");function _y(l){return!xf(l)}t(_y,"isSchemaObject");function yse(l){return l.type==="array"}t(yse,"isArraySchemaObject");function MZe(l){if(!l.allOf)throw new Error("Function inferRequiredSchema is specialized to handle item with required only in an allOf array.");let[f,h]=l.allOf.reduce((C,A)=>{if(eFt(A)){let j=A.required;C[0].push(...j??[])}else C[1].push(A);return C},[[],[]]),S={properties:f.reduce((C,A)=>(C[A]={},C),{}),type:"object",required:f};return{noRequiredOnlyAllof:h,composedRequiredSchema:S,patchRequiredSchemaInLoop:t((C,A)=>{if(xf(C)){let j=A(C.$ref);j&&S.required.forEach(Z=>{var oe;S.properties[Z]=((oe=j==null?void 0:j.properties)==null?void 0:oe[Z])??{}})}else{let j=C.properties??{};S.required.forEach(Z=>{j[Z]&&(S.properties[Z]=j[Z]??{})})}},"patchRequiredSchemaInLoop")}}t(MZe,"inferRequiredSchema");var eFt=t(l=>!xf(l)&&!!l.required&&!l.type&&!l.properties&&!(l!=null&&l.allOf)&&!(l!=null&&l.anyOf)&&!l.oneOf,"isBrokenAllOfItem");var LZe=t(l=>`#/components/schemas/${l}`,"getSchemaRef"),N8=t(l=>l[1]==="/"?l:"#/"+l.slice(1),"autocorrectRef"),_R=t(l=>N8(l).split("/").at(-1),"getSchemaNameByRef");function Dke(l){let f=tFt(l).normalize("NFKD").trim().replace(/\s+/g,"_").replace(/--+/g,"-").replace(/-+/g,"_").replace(/[^\w-]+/g,"_");return fy(f)}t(Dke,"normalizeString");function Ake(l){return/^[a-zA-Z]\w*$/.test(l)?l:`"${l}"`}t(Ake,"wrapWithQuotesIfNeeded");function jZe(l){return typeof l=="string"&&l.startsWith('"')&&l.endsWith('"')?l.slice(1,-1):l}t(jZe,"unwrapQuotesIfNeeded");function tFt(l){let f=Number(l[0]);return typeof f=="number"&&!Number.isNaN(f)?"_"+l:l}t(tFt,"prefixStringStartingWithNumberIfNeeded");function Ike(l){let f=l.replaceAll("_","#");return fy(f.replaceAll("-","_")).replaceAll("#","_")}t(Ike,"pathParamToVariableName");var O8=t(l=>SZe.includes(l),"isPrimitiveType");function BZe(l){return l.replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/([\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F-\u009F\uFFFE\uFFFF])/g,(f,h)=>{let S=h.codePointAt(),C=S.toString(16);return S<=255?`\\x${`00${C}`.slice(-2)}`:`\\u${`0000${C}`.slice(-4)}`}).replace(/\//g,"\\/")}t(BZe,"escapeControlCharacters");function Kk(l){return l.includes("application/")&&l.includes("json")||vZe.includes(l)||l.includes("text/")}t(Kk,"isParamMediaTypeAllowed");function iU(l){return l>=200&&l<300}t(iU,"isMainResponseStatus");function vse(l){return!(l>=200&&l<300)}t(vse,"isErrorStatus");function bse(l){return l.startsWith("application/")}t(bse,"isMediaTypeAllowed");var RZe=/({\w+})/g,rFt=/[^\w\-]+/g;function JZe(l){l=y_(YV(l.replaceAll("/","-")).replaceAll("-",""));let f=[...l.matchAll(RZe)];if(f.length>0){let h=f.toSorted((S,C)=>S.index-C.index)[f.length-1][0];l=`${l.replace(RZe,"")}By${y_(h.slice(1,-1))}`}return l.replace(rFt,"_")}t(JZe,"pathToVariableName");var wke=/{(\b\w+(?:-\w+)*\b)}/g;function $Ze(l){let f=l.match(wke);return f===null?l.replaceAll(wke,":$1"):(f.forEach(h=>{let S=Ike(h.replaceAll(wke,":$1"));l=l.replaceAll(h,S)}),l)}t($Ze,"replaceHyphenatedPath");var Sse=t(l=>{let f=l["x-enumNames"],h=Array.isArray(f)&&f.length>0,S=!!l.schema&&_y(l.schema)&&l.schema.type==="string";return h&&S},"isSortingParameterObject"),F8=t((l,f)=>f.excludePathRegex?new RegExp(f.excludePathRegex).test(l):!1,"isPathExcluded");function eE({schema:l,meta:f,options:h}){let S=[];l0(l.type).with("string",()=>S.push(sFt(l))).with("number","integer",()=>S.push(oFt(l))).with("array",()=>S.push(cFt(l))).otherwise(()=>{}),typeof l.description=="string"&&l.description!==""&&h.withDescription&&([`
569
569
  `,"\r",`\r
570
570
  `].some(A=>String.prototype.includes.call(l.description,A))?S.push(`describe(\`${l.description}\`)`):S.push(`describe("${l.description}")`));let C=S.concat(nFt({schema:l,meta:f,options:h}),h.withDefaultValues!==!1?iFt(l):[]).filter(Boolean).join(".");return C?`.${C}`:""}t(eE,"getZodChain");function nFt({schema:l,meta:f,options:h}){return l.nullable&&!(f!=null&&f.isRequired)?"nullish()":l.nullable||h.replaceOptionalWithNullish&&(f!=null&&f.isParentPartial)?"nullable()":f!=null&&f.isRequired?"":h.replaceOptionalWithNullish?"nullish()":"optional()"}t(nFt,"getZodChainablePresence");function iFt(l){return l.default!==void 0?`default(${l0(l.type).with("number","integer",()=>jZe(l.default)).otherwise(()=>JSON.stringify(l.default))})`:""}t(iFt,"getZodChainableDefault");function sFt(l){let f=[];return l.enum||(l.minLength!==void 0&&f.push(`min(${l.minLength})`),l.maxLength!==void 0&&f.push(`max(${l.maxLength})`)),l.pattern&&f.push(`regex(${aFt(l.pattern)})`),f.join(".")}t(sFt,"getZodChainableStringValidations");function aFt(l){return l.startsWith("/")&&l.endsWith("/")&&(l=l.slice(1,-1)),l=BZe(l),`/${l}/`}t(aFt,"formatPatternIfNeeded");function oFt(l){let f=[];return l.enum?"":(l.minimum!==void 0?l.exclusiveMinimum===!0?f.push(`gt(${l.minimum})`):f.push(`gte(${l.minimum})`):typeof l.exclusiveMinimum=="number"&&f.push(`gt(${l.exclusiveMinimum})`),l.maximum!==void 0?l.exclusiveMaximum===!0?f.push(`lt(${l.maximum})`):f.push(`lte(${l.maximum})`):typeof l.exclusiveMaximum=="number"&&f.push(`lt(${l.exclusiveMaximum})`),l.multipleOf&&f.push(`multipleOf(${l.multipleOf})`),f.join("."))}t(oFt,"getZodChainableNumberValidations");function cFt(l){let f=[];return l.minItems&&f.push(`min(${l.minItems})`),l.maxItems&&f.push(`max(${l.maxItems})`),f.join(".")}t(cFt,"getZodChainableArrayValidations");var R_=t(({type:l,tag:f,options:h})=>`${y_(f)}${h.configs[l].namespaceSuffix}`,"getNamespaceName");function qZe(l,f){let h=l.getRefByZodSchemaName(f);if(h){let C=Array.from(l.dependencyGraph.refsDependencyGraph[h]??[]).map(j=>l.getZodSchemaNameByRef(j)),A=l.getExtractedEnumZodSchemaNamesReferencedBySchemaRef(h);return[...C,...A]}let S=l.getCompositeZodSchemaByZodSchemaName(f);return S?Array.from(xse(S)).map(C=>l.getZodSchemaNameByRef(C)):[]}t(qZe,"getZodSchemaRefs");function xse(l,{skipObjectSchema:f=!1}={}){return l.children.reduce((S,C)=>{let A=C.ref??C.enumRef;return A&&S.add(A),C.children.length>0&&(!f||!_y(C.schema)||C.schema.type!=="object")&&xse(C).forEach(j=>S.add(j)),S},new Set)}t(xse,"getSchemaRefs");var M8=t(l=>l.reduce((f,h)=>f+h,0),"sum");function Ag(l,f){if(!f)return l;if(xf(f))return l+2;if(Array.isArray(f.type))return f.type.length===1?Yb("oneOf")+Ag(l,{...f,type:f.type[0]}):l+Yb("oneOf")+M8(f.type.map(h=>Ag(0,{...f,type:h})));if(f.oneOf)return f.oneOf.length===1?Yb("oneOf")+Ag(l,f.oneOf[0]):l+Yb("oneOf")+M8(f.oneOf.map(h=>Ag(0,h)));if(f.anyOf)return f.anyOf.length===1?Yb("anyOf")+Ag(l,f.anyOf[0]):l+Yb("anyOf")+M8(f.anyOf.map(h=>Ag(0,h)));if(f.allOf)return f.allOf.length===1?Yb("allOf")+Ag(l,f.allOf[0]):l+Yb("allOf")+M8(f.allOf.map(h=>Ag(0,h)));if(!f.type)return l;if(O8(f.type))return f.enum?l+zZe(f)+Yb("enum")+M8(f.enum.map(h=>Ag(0,h))):l+zZe(f);if(f.type==="array")return f.items?Yb("array")+Ag(l,f.items):Yb("array")+Ag(l);if(f.type==="object"||f.properties||f.additionalProperties){if(f.properties){let h=Object.values(f.properties);l+=Yb("object")+M8(h.map(S=>Ag(0,S)))}else l+=Yb("empty-object");f.additionalProperties&&(typeof f.additionalProperties=="object"?l+=Ag(0,f.additionalProperties):l+=Ag(1))}return l}t(Ag,"getOpenAPISchemaComplexity");function zZe(l){return l0(l.type).with("string","number","integer","boolean",()=>1).otherwise(()=>0)}t(zZe,"complexityByType");function Yb(l){return l0(l).with("oneOf",()=>2).with("anyOf",()=>3).with("allOf",()=>2).with("enum","array","empty-object",()=>1).with("object",()=>2).otherwise(()=>0)}t(Yb,"complexityByComposite");var Oke=class Oke{constructor(f,h,S={referencedBy:[]},C){this.schema=f;this.resolver=h;xf(f)&&(this.ref=f.$ref),C&&(this.enumRef=C),this.meta={...S,referencedBy:[...(S==null?void 0:S.referencedBy)??[]]},this.ref&&this.meta.referencedBy.push(this)}code;ref;enumRef;children=[];meta;getCodeString(f,h){var A,j;if(!this.ref&&this.code)return this.code;if(!this.ref)throw new Error("Zod schema is missing both ref and code");let S=(A=this.resolver)==null?void 0:A.getZodSchemaNameByRef(this.ref);if(!S)return this.ref;let C=(j=this.resolver)==null?void 0:j.getTagByZodSchemaName(S);return h!=null&&h.tsNamespaces&&C&&C!==f?`${R_({type:"models",tag:C,options:h})}.${S}`:S}get complexity(){return Ag(0,this.schema)}assign(f){return this.code=f,this}inherit(f){return f&&f.children.push(this),this}};t(Oke,"ZodSchema");var sU=Oke;function Nke(l){var f,h;if(l)return(f=l.parent)!=null&&f.ref?l.parent.ref:Nke((h=l.parent)==null?void 0:h.meta)}t(Nke,"getParentRef");function am({schema:l,resolver:f,meta:h,tag:S}){var ot;let C=new sU(l,f,h),A={parent:C.inherit(h==null?void 0:h.parent),referencedBy:[...C.meta.referencedBy]},j={resolver:f,meta:A,tag:S};if(xf(l))return lFt({schema:l,zodSchema:C,resolver:f,meta:A,tag:S});let Z=fFt({schema:l,zodSchema:C,resolver:f,meta:A,tag:S});if(Z)return Z;let oe=uFt({schema:l,zodSchema:C,resolver:f,meta:A,tag:S});if(oe)return oe;let ge=_Ft({schema:l,zodSchema:C,resolver:f,meta:A,tag:S});if(ge)return ge;let je=pFt({schema:l,zodSchema:C,resolver:f,meta:A,tag:S});if(je)return je;let Ae=dFt({schema:l,zodSchema:C,resolver:f,meta:A,tag:S});if(Ae)return Ae;let _e=f.options.allReadonly?".readonly()":"";if(yse(l))return l.items?C.assign(`z.array(${am({...j,schema:l.items}).getCodeString(S,f.options)}${eE({schema:l.items,meta:{...A,isRequired:!0},options:f.options})})${_e}`):C.assign(`z.array(${fR})${_e}`);let Lt=l.type?l.type.toLowerCase():void 0;if(Lt==="object"||l.properties||l.additionalProperties){let tt=l.required&&l.required.length>0,Ht=f.options.withImplicitRequiredProps?!1:l.properties&&!((ot=l.required)!=null&&ot.length),jr="{}";l.properties&&(jr=`{ ${Object.entries(l.properties).map(([Nn,Wr])=>{var zr;let dl={...A,isRequired:Ht?!0:tt?(zr=l.required)==null?void 0:zr.includes(Nn):f.options.withImplicitRequiredProps,name:Nn,isParentPartial:Ht},pa=Wr;if(xf(Wr)&&f&&(pa=f.getSchemaByRef(Wr.$ref),!pa))throw new Error(`Schema ${Wr.$ref} not found`);let Fa=am({...j,schema:Wr,meta:dl}),Xr=Fa.getCodeString(S,f.options)+eE({schema:pa,meta:dl,options:f.options}),Ps=!1,Us=Nke(h);return Us&&(Ps=[...xf(Wr)?[Wr.$ref]:[],...xse(Fa,{skipObjectSchema:!0})].some($o=>{var gr;return(gr=f.dependencyGraph.deepDependencyGraph[$o])==null?void 0:gr.has(Us)})),[Nn,Xr,Ps]}).map(([Nn,Wr,dl])=>dl?`get ${Ake(Nn)}() { return ${Wr} }`:`${Ake(Nn)}: ${Wr}`).join(", ")} }`);let Gn="";l.additionalProperties&&(Gn=`.catchall(${typeof l.additionalProperties=="object"&&Object.keys(l.additionalProperties).length>0?am({...j,schema:l.additionalProperties}).getCodeString(S,f.options)+eE({schema:l.additionalProperties,meta:{...A,isRequired:!0},options:f.options}):fR})`);let is=`z.object(${jr})${Ht?".partial()":""}${Gn}${_e}`;return C.assign(is)}if(Lt==="any")return C.assign(fR);if(!Lt)return C.assign("z.unknown()");throw new Error(`Unsupported schema type: ${Lt}`)}t(am,"getZodSchema");function lFt({schema:l,zodSchema:f,resolver:h,meta:S,tag:C}){if(!xf(l))return;let A=f.meta.referencedBy.slice(0,-1).map(oe=>oe.ref?h.getZodSchemaNameByRef(oe.ref)??oe.ref:void 0).filter(Boolean),j=h.getZodSchemaNameByRef(l.$ref);if(A.length>1&&A.includes(j))return f.assign(h.getCodeByZodSchemaName(f.ref));let Z=h.getCodeByZodSchemaName(l.$ref);if(!Z){let oe=h.getSchemaByRef(l.$ref);if(!oe)throw new Error(`Schema ${l.$ref} not found`);Z=am({schema:oe,resolver:h,meta:S,tag:C}).getCodeString(C,h.options)}return h.getCodeByZodSchemaName(j)||h.setZodSchema(j,Z,C),f}t(lFt,"getReferenceZodSchema");function uFt({schema:l,zodSchema:f,resolver:h,meta:S,tag:C}){var j;if(!_y(l)||!l.oneOf)return;if(l.oneOf.length===1){let Z=am({schema:l.oneOf[0],resolver:h,meta:S,tag:C});return f.assign(Z.getCodeString(C,h.options))}let A=(j=l.oneOf)==null?void 0:j.some(Z=>_y(Z)&&((Z==null?void 0:Z.allOf)||[]).length>1);if(l.discriminator&&!A){let Z=l.discriminator.propertyName;return f.assign(`
571
571
  z.discriminatedUnion("${Z}", [${l.oneOf.map(oe=>am({schema:oe,resolver:h,meta:S,tag:C}).getCodeString(C,h.options)).join(", ")}])
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@povio/openapi-codegen-cli",
3
- "version": "2.0.3-rc.2",
3
+ "version": "2.0.3",
4
4
  "keywords": [
5
5
  "codegen",
6
6
  "openapi",