@povio/openapi-codegen-cli 2.0.8 → 2.0.9

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.
@@ -44,7 +44,8 @@ class RestClient {
44
44
  try {
45
45
  const { rawResponse, ...config } = requestConfig;
46
46
  const res = await this.client(config);
47
- const resData = requestInfo.resSchema.parse(res.data);
47
+ const responseData = res.status === 204 && res.data === "" ? void 0 : res.data;
48
+ const resData = requestInfo.resSchema.parse(responseData);
48
49
  return rawResponse ? { ...res, data: resData } : resData;
49
50
  } catch (error) {
50
51
  if (error instanceof z.ZodError) {
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((Ut,Rr)=>Rr.length-Ut.length);let ot=null,tt=1/0;for(let Ut=0,Rr;(Rr=_e[Ut])!==void 0;Ut++){let Bn=RQe(Ae,Rr);Bn<=3&&Bn<tt&&(tt=Bn,ot=Rr)}ot&&f.fail(S("Did you mean %s?",ot))},"recommendCommands"),A.reset=t(function(Ae){return j=V6(j,_e=>!Ae[_e]),oe=V6(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();_1(Ae,void 0,h),{implied:j,conflicting:oe}=Ae},"unfreeze"),A}t(jQe,"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=W5t(f,l.extends);else try{j=require.resolve(l.extends)}catch{return l}U5t(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?BQe(C,l):Object.assign({},C,l)}t(HV,"applyExtends");function U5t(l){if(nke.indexOf(l)>-1)throw new Up(`Circular extended configurations: '${l}'.`)}t(U5t,"checkForCircularExtends");function W5t(l,f){return WV.path.resolve(l,f)}t(W5t,"getPathToDefaultConfig");function BQe(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]=BQe(l[C],f[C]):h[C]=f[C];return h}t(BQe,"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)},Fm,b8,GV,BS,Qb,nse,W6,S8,ise,JS,sse,$S,Hk,Zb,qS,ase,cR,Ig,Bo,ose,cse,Xb,x8,lR,T8,H6,lse,Jc,C8,k8,E8,il,use,Gk,sm;function sZe(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(sZe,"YargsFactory");var JQe=Symbol("copyDoubleDash"),$Qe=Symbol("copyDoubleDash"),ike=Symbol("deleteFromParserHintObject"),qQe=Symbol("emitWarning"),zQe=Symbol("freeze"),VQe=Symbol("getDollarZero"),P8=Symbol("getParserConfiguration"),UQe=Symbol("getUsageConfiguration"),ske=Symbol("guessLocale"),WQe=Symbol("guessVersion"),HQe=Symbol("parsePositionalNumbers"),ake=Symbol("pkgUp"),G6=Symbol("populateParserHintArray"),uR=Symbol("populateParserHintSingleValueDictionary"),oke=Symbol("populateParserHintArrayDictionary"),cke=Symbol("populateParserHintDictionary"),lke=Symbol("sanitizeKey"),uke=Symbol("setKey"),fke=Symbol("unfreeze"),GQe=Symbol("validateAsync"),QQe=Symbol("getCommandInstance"),ZQe=Symbol("getContext"),XQe=Symbol("getHasOutput"),YQe=Symbol("getLoggerInstance"),KQe=Symbol("getParseContext"),eZe=Symbol("getUsageInstance"),tZe=Symbol("getValidationInstance"),fse=Symbol("hasParseCallback"),rZe=Symbol("isGlobalContext"),w8=Symbol("postProcess"),nZe=Symbol("rebase"),_ke=Symbol("reset"),QV=Symbol("runYargsParserAndExecuteCommands"),pke=Symbol("runValidation"),iZe=Symbol("setHasOutput"),D8=Symbol("kTrackManuallySetKeys"),mke=class mke{constructor(f=[],h,S,C){this.customScriptName=!1,this.parsed=!1,Fm.set(this,void 0),b8.set(this,void 0),GV.set(this,{commands:[],fullCommands:[]}),BS.set(this,null),Qb.set(this,null),nse.set(this,"show-hidden"),W6.set(this,null),S8.set(this,!0),ise.set(this,{}),JS.set(this,!0),sse.set(this,[]),$S.set(this,void 0),Hk.set(this,{}),Zb.set(this,!1),qS.set(this,null),ase.set(this,!0),cR.set(this,void 0),Ig.set(this,""),Bo.set(this,void 0),ose.set(this,void 0),cse.set(this,{}),Xb.set(this,null),x8.set(this,null),lR.set(this,{}),T8.set(this,{}),H6.set(this,void 0),lse.set(this,!1),Jc.set(this,void 0),C8.set(this,!1),k8.set(this,!1),E8.set(this,!1),il.set(this,void 0),use.set(this,{}),Gk.set(this,null),sm.set(this,void 0),xo(this,Jc,C,"f"),xo(this,H6,f,"f"),xo(this,b8,h,"f"),xo(this,ose,S,"f"),xo(this,$S,new ese(this),"f"),this.$0=this[VQe](),this[_ke](),xo(this,Fm,Zt(this,Fm,"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,nse,"f"),xo(this,cR,this[$Qe](),"f")}addHelpOpt(f,h){let S="help";return ho("[string|boolean] [string]",[f,h],arguments.length),Zt(this,qS,"f")&&(this[ike](Zt(this,qS,"f")),xo(this,qS,null,"f")),f===!1&&h===void 0?this:(xo(this,qS,typeof f=="string"?f:S,"f"),this.boolean(Zt(this,qS,"f")),this.describe(Zt(this,qS,"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,nse,"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[G6]("array",f),this[D8](f),this}boolean(f){return ho("<array|string>",[f],arguments.length),this[G6]("boolean",f),this[D8](f),this}check(f,h){return ho("<function> [boolean]",[f,h],arguments.length),this.middleware((S,C)=>v8(()=>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,Jc,"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,$S,"f").addCoerceMiddleware((S,C)=>{let A;return Object.prototype.hasOwnProperty.call(S,f)?v8(()=>(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,b8,"f"),this[P8]()["deep-merge-config"]||!1,Zt(this,Jc,"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,BS,"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,Fm,"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,ose,"f")||Zt(this,Jc,"f").require;return Zt(this,Fm,"f").addDirectory(f,S,Zt(this,Jc,"f").getCallerFile(),h),this}count(f){return ho("<array|string>",[f],arguments.length),this[G6]("count",f),this[D8](f),this}default(f,h,S){return ho("<object|string|array> [*] [string]",[f,h,S],arguments.length),S&&(QCe(f,Zt(this,Jc,"f")),Zt(this,Bo,"f").defaultDescription[f]=S),typeof h=="function"&&(QCe(f,Zt(this,Jc,"f")),Zt(this,Bo,"f").defaultDescription[f]||(Zt(this,Bo,"f").defaultDescription[f]=Zt(this,il,"f").functionDescription(h)),h=h.call()),this[uR](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=>{_1(S,!0,Zt(this,Jc,"f")),this.demandOption(C,S)}),h=1/0):typeof h!="number"&&(S=h,h=1/0),typeof f=="number"?(_1(S,!0,Zt(this,Jc,"f")),this.demandCommand(f,h,S,S)):Array.isArray(f)?f.forEach(C=>{_1(S,!0,Zt(this,Jc,"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[uR](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,S8,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,W6,h,"f"),Zt(this,JS,"f")&&Zt(this,Jc,"f").process.exit(f)}exitProcess(f=!0){return ho("[boolean]",[f],arguments.length),xo(this,JS,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,BS,"f").getCompletion(f,h):new Promise((S,C)=>{Zt(this,BS,"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,S8,"f")}getExitProcess(){return Zt(this,JS,"f")}getGroups(){return Object.assign({},Zt(this,Hk,"f"),Zt(this,T8,"f"))}getHelp(){if(xo(this,Zb,!0,"f"),!Zt(this,il,"f").hasCachedHelpMessage()){if(!this.parsed){let h=this[QV](Zt(this,H6,"f"),void 0,void 0,0,!0);if(Wp(h))return h.then(()=>Zt(this,il,"f").help())}let f=Zt(this,Fm,"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,C8,"f")}getStrictCommands(){return Zt(this,k8,"f")}getStrictOptions(){return Zt(this,E8,"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,T8,"f")[h]||Zt(this,Hk,"f")[h];Zt(this,T8,"f")[h]&&delete Zt(this,T8,"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,Jc,"f").y18n.getLocale()):(xo(this,S8,!1,"f"),Zt(this,Jc,"f").y18n.setLocale(f),this)}middleware(f,h,S){return Zt(this,$S,"f").addMiddleware(f,!!h,S)}nargs(f,h){return ho("<string|object|array> [number]",[f,h],arguments.length),this[uR](this.nargs.bind(this),"narg",f,h),this}normalize(f){return ho("<array|string>",[f],arguments.length),this[G6]("normalize",f),this}number(f){return ho("<array|string>",[f],arguments.length),this[G6]("number",f),this[D8](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[D8](f),Zt(this,Gk,"f")&&(f==="version"||(h==null?void 0:h.alias)==="version")&&this[qQe](['"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[zQe](),typeof f>"u"&&(f=Zt(this,H6,"f")),typeof h=="object"&&(xo(this,x8,h,"f"),h=S),typeof h=="function"&&(xo(this,Xb,h,"f"),h=!1),h||xo(this,H6,f,"f"),Zt(this,Xb,"f")&&xo(this,JS,!1,"f");let C=this[QV](f,!!h),A=this.parsed;return Zt(this,BS,"f").setParsed(this.parsed),Wp(C)?C.then(j=>(Zt(this,Xb,"f")&&Zt(this,Xb,"f").call(this,Zt(this,W6,"f"),j,Zt(this,Ig,"f")),j)).catch(j=>{throw Zt(this,Xb,"f")&&Zt(this,Xb,"f")(j,this.parsed.argv,Zt(this,Ig,"f")),j}).finally(()=>{this[fke](),this.parsed=A}):(Zt(this,Xb,"f")&&Zt(this,Xb,"f").call(this,Zt(this,W6,"f"),C,Zt(this,Ig,"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,cse,f,"f"),this}pkgConf(f,h){ho("<string> [string]",[f,h],arguments.length);let S=null,C=this[ake](h||Zt(this,b8,"f"));return C[f]&&typeof C[f]=="object"&&(S=HV(C[f],h||Zt(this,b8,"f"),this[P8]()["deep-merge-config"]||!1,Zt(this,Jc,"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=V6(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,Fm,"f").cmdToParseOptions(C):{array:[],alias:{},default:{},demand:{}};return aR(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,lse,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[uR](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,cR,"f").log(Zt(this,BS,"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,H6,"f"),void 0,void 0,0,!0);if(Wp(S))return S.then(()=>{Zt(this,il,"f").showHelp(f)}),this}let h=Zt(this,Fm,"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[G6]("skipValidation",f),this}strict(f){return ho("[boolean]",[f],arguments.length),xo(this,C8,f!==!1,"f"),this}strictCommands(f){return ho("[boolean]",[f],arguments.length),xo(this,k8,f!==!1,"f"),this}strictOptions(f){return ho("[boolean]",[f],arguments.length),xo(this,E8,f!==!1,"f"),this}string(f){return ho("<array|string>",[f],arguments.length),this[G6]("string",f),this[D8](f),this}terminalWidth(){return ho([],0),Zt(this,Jc,"f").process.stdColumns}updateLocale(f){return this.updateStrings(f)}updateStrings(f){return ho("<object>",[f],arguments.length),xo(this,S8,!1,"f"),Zt(this,Jc,"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(_1(f,null,Zt(this,Jc,"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,use,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[WQe](),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}[(Fm=new WeakMap,b8=new WeakMap,GV=new WeakMap,BS=new WeakMap,Qb=new WeakMap,nse=new WeakMap,W6=new WeakMap,S8=new WeakMap,ise=new WeakMap,JS=new WeakMap,sse=new WeakMap,$S=new WeakMap,Hk=new WeakMap,Zb=new WeakMap,qS=new WeakMap,ase=new WeakMap,cR=new WeakMap,Ig=new WeakMap,Bo=new WeakMap,ose=new WeakMap,cse=new WeakMap,Xb=new WeakMap,x8=new WeakMap,lR=new WeakMap,T8=new WeakMap,H6=new WeakMap,lse=new WeakMap,Jc=new WeakMap,C8=new WeakMap,k8=new WeakMap,E8=new WeakMap,il=new WeakMap,use=new WeakMap,Gk=new WeakMap,sm=new WeakMap,JQe)](f){if(!f._||!f["--"])return f;f._.push.apply(f._,f["--"]);try{delete f["--"]}catch{}return f}[$Qe](){return{log:t((...f)=>{this[fse]()||console.log(...f),xo(this,Zb,!0,"f"),Zt(this,Ig,"f").length&&xo(this,Ig,Zt(this,Ig,"f")+`
567
567
  `,"f"),xo(this,Ig,Zt(this,Ig,"f")+f.join(" "),"f")},"log"),error:t((...f)=>{this[fse]()||console.error(...f),xo(this,Zb,!0,"f"),Zt(this,Ig,"f").length&&xo(this,Ig,Zt(this,Ig,"f")+`
568
- `,"f"),xo(this,Ig,Zt(this,Ig,"f")+f.join(" "),"f")},"error")}}[ike](f){aR(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]}[qQe](f,h,S){Zt(this,ise,"f")[S]||(Zt(this,Jc,"f").process.emitWarning(f,h),Zt(this,ise,"f")[S]=!0)}[zQe](){Zt(this,sse,"f").push({options:Zt(this,Bo,"f"),configObjects:Zt(this,Bo,"f").configObjects.slice(0),exitProcess:Zt(this,JS,"f"),groups:Zt(this,Hk,"f"),strict:Zt(this,C8,"f"),strictCommands:Zt(this,k8,"f"),strictOptions:Zt(this,E8,"f"),completionCommand:Zt(this,Qb,"f"),output:Zt(this,Ig,"f"),exitError:Zt(this,W6,"f"),hasOutput:Zt(this,Zb,"f"),parsed:this.parsed,parseFn:Zt(this,Xb,"f"),parseContext:Zt(this,x8,"f")}),Zt(this,il,"f").freeze(),Zt(this,sm,"f").freeze(),Zt(this,Fm,"f").freeze(),Zt(this,$S,"f").freeze()}[VQe](){let f="",h;return/\b(node|iojs|electron)(\.exe)?$/.test(Zt(this,Jc,"f").process.argv()[0])?h=Zt(this,Jc,"f").process.argv().slice(1,2):h=Zt(this,Jc,"f").process.argv().slice(0,1),f=h.map(S=>{let C=this[nZe](Zt(this,b8,"f"),S);return S.match(/^(\/|([a-zA-Z]:)?\\)/)&&C.length<S.length?C:S}).join(" ").trim(),Zt(this,Jc,"f").getEnv("_")&&Zt(this,Jc,"f").getProcessArgvBin()===Zt(this,Jc,"f").getEnv("_")&&(f=Zt(this,Jc,"f").getEnv("_").replace(`${Zt(this,Jc,"f").path.dirname(Zt(this,Jc,"f").process.execPath())}/`,"")),f}[P8](){return Zt(this,cse,"f")}[UQe](){return Zt(this,use,"f")}[ske](){if(!Zt(this,S8,"f"))return;let f=Zt(this,Jc,"f").getEnv("LC_ALL")||Zt(this,Jc,"f").getEnv("LC_MESSAGES")||Zt(this,Jc,"f").getEnv("LANG")||Zt(this,Jc,"f").getEnv("LANGUAGE")||"en_US";this.locale(f.replace(/[.:].*/,""))}[WQe](){return this[ake]().version||"unknown"}[HQe](f){let h=f["--"]?f["--"]:f._;for(let S=0,C;(C=h[S])!==void 0;S++)Zt(this,Jc,"f").Parser.looksLikeNumber(C)&&Number.isSafeInteger(Math.floor(parseFloat(`${C}`)))&&(h[S]=Number(C));return f}[ake](f){let h=f||"*";if(Zt(this,lR,"f")[h])return Zt(this,lR,"f")[h];let S={};try{let C=f||Zt(this,Jc,"f").mainFilename;!f&&Zt(this,Jc,"f").path.extname(C)&&(C=Zt(this,Jc,"f").path.dirname(C));let A=Zt(this,Jc,"f").findUp(C,(j,Z)=>{if(Z.includes("package.json"))return"package.json"});_1(A,void 0,Zt(this,Jc,"f")),S=JSON.parse(Zt(this,Jc,"f").readFileSync(A,"utf8"))}catch{}return Zt(this,lR,"f")[h]=S||{},Zt(this,lR,"f")[h]}[G6](f,h){h=[].concat(h),h.forEach(S=>{S=this[lke](S),Zt(this,Bo,"f")[f].push(S)})}[uR](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 aR(S))f(j,S[j]);else A(h,this[lke](S),C)}[lke](f){return f==="__proto__"?"___proto___":f}[uke](f,h){return this[uR](this[uke].bind(this),"key",f,h),this}[fke](){var f,h,S,C,A,j,Z,oe,ge,Re,Ae,_e;let Lt=Zt(this,sse,"f").pop();_1(Lt,void 0,Zt(this,Jc,"f"));let ot;f=this,h=this,S=this,C=this,A=this,j=this,Z=this,oe=this,ge=this,Re=this,Ae=this,_e=this,{options:{set value(tt){xo(f,Bo,tt,"f")}}.value,configObjects:ot,exitProcess:{set value(tt){xo(h,JS,tt,"f")}}.value,groups:{set value(tt){xo(S,Hk,tt,"f")}}.value,output:{set value(tt){xo(C,Ig,tt,"f")}}.value,exitError:{set value(tt){xo(A,W6,tt,"f")}}.value,hasOutput:{set value(tt){xo(j,Zb,tt,"f")}}.value,parsed:this.parsed,strict:{set value(tt){xo(Z,C8,tt,"f")}}.value,strictCommands:{set value(tt){xo(oe,k8,tt,"f")}}.value,strictOptions:{set value(tt){xo(ge,E8,tt,"f")}}.value,completionCommand:{set value(tt){xo(Re,Qb,tt,"f")}}.value,parseFn:{set value(tt){xo(Ae,Xb,tt,"f")}}.value,parseContext:{set value(tt){xo(_e,x8,tt,"f")}}.value}=Lt,Zt(this,Bo,"f").configObjects=ot,Zt(this,il,"f").unfreeze(),Zt(this,sm,"f").unfreeze(),Zt(this,Fm,"f").unfreeze(),Zt(this,$S,"f").unfreeze()}[GQe](f,h){return v8(h,S=>(f(S),S))}getInternalMethods(){return{getCommandInstance:this[QQe].bind(this),getContext:this[ZQe].bind(this),getHasOutput:this[XQe].bind(this),getLoggerInstance:this[YQe].bind(this),getParseContext:this[KQe].bind(this),getParserConfiguration:this[P8].bind(this),getUsageConfiguration:this[UQe].bind(this),getUsageInstance:this[eZe].bind(this),getValidationInstance:this[tZe].bind(this),hasParseCallback:this[fse].bind(this),isGlobalContext:this[rZe].bind(this),postProcess:this[w8].bind(this),reset:this[_ke].bind(this),runValidation:this[pke].bind(this),runYargsParserAndExecuteCommands:this[QV].bind(this),setHasOutput:this[iZe].bind(this)}}[QQe](){return Zt(this,Fm,"f")}[ZQe](){return Zt(this,GV,"f")}[XQe](){return Zt(this,Zb,"f")}[YQe](){return Zt(this,cR,"f")}[KQe](){return Zt(this,x8,"f")||{}}[eZe](){return Zt(this,il,"f")}[tZe](){return Zt(this,sm,"f")}[fse](){return!!Zt(this,Xb,"f")}[rZe](){return Zt(this,ase,"f")}[w8](f,h,S,C){return S||Wp(f)||(h||(f=this[JQe](f)),(this[P8]()["parse-positional-numbers"]||this[P8]()["parse-positional-numbers"]===void 0)&&(f=this[HQe](f)),C&&(f=y8(f,this,Zt(this,$S,"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,T8,"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]=V6(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):NQe(this,Zt(this,Jc,"f")),"f"),xo(this,sm,Zt(this,sm,"f")?Zt(this,sm,"f").reset(S):jQe(this,Zt(this,il,"f"),Zt(this,Jc,"f")),"f"),xo(this,Fm,Zt(this,Fm,"f")?Zt(this,Fm,"f").reset():DQe(Zt(this,il,"f"),Zt(this,sm,"f"),Zt(this,$S,"f"),Zt(this,Jc,"f")),"f"),Zt(this,BS,"f")||xo(this,BS,MQe(this,Zt(this,il,"f"),Zt(this,Fm,"f"),Zt(this,Jc,"f")),"f"),Zt(this,$S,"f").reset(),xo(this,Qb,null,"f"),xo(this,Ig,"","f"),xo(this,W6,null,"f"),xo(this,Zb,!1,"f"),this.parsed=!1,this}[nZe](f,h){return Zt(this,Jc,"f").path.relative(f,h)}[QV](f,h,S,C=0,A=!1){let j=!!S||A;f=f||Zt(this,H6,"f"),Zt(this,Bo,"f").__=Zt(this,Jc,"f").y18n.__,Zt(this,Bo,"f").configuration=this[P8]();let Z=!!Zt(this,Bo,"f").configuration["populate--"],oe=Object.assign({},Zt(this,Bo,"f").configuration,{"populate--":!0}),ge=Zt(this,Jc,"f").Parser.detailed(f,Object.assign({},Zt(this,Bo,"f"),{configuration:{"parse-positional-numbers":!1,...oe}})),Re=Object.assign(ge.argv,Zt(this,x8,"f")),Ae,_e=ge.aliases,Lt=!1,ot=!1;Object.keys(Re).forEach(tt=>{tt===Zt(this,qS,"f")&&Re[tt]?Lt=!0:tt===Zt(this,Gk,"f")&&Re[tt]&&(ot=!0)}),Re.$0=this.$0,this.parsed=ge,C===0&&Zt(this,il,"f").clearCachedHelpMessage();try{if(this[ske](),h)return this[w8](Re,Z,!!S,!1);Zt(this,qS,"f")&&[Zt(this,qS,"f")].concat(_e[Zt(this,qS,"f")]||[]).filter(Ji=>Ji.length>1).includes(""+Re._[Re._.length-1])&&(Re._.pop(),Lt=!0),xo(this,ase,!1,"f");let tt=Zt(this,Fm,"f").getCommands(),Ut=Zt(this,BS,"f").completionKey in Re,Rr=Lt||Ut||A;if(Re._.length){if(tt.length){let Bn;for(let Ji=C||0,is;Re._[Ji]!==void 0;Ji++)if(is=String(Re._[Ji]),tt.includes(is)&&is!==Zt(this,Qb,"f")){let qi=Zt(this,Fm,"f").runCommand(is,this,ge,Ji+1,A,Lt||ot||A);return this[w8](qi,Z,!!S,!1)}else if(!Bn&&is!==Zt(this,Qb,"f")){Bn=is;break}!Zt(this,Fm,"f").hasDefaultCommand()&&Zt(this,lse,"f")&&Bn&&!Rr&&Zt(this,sm,"f").recommendCommands(Bn,tt)}Zt(this,Qb,"f")&&Re._.includes(Zt(this,Qb,"f"))&&!Ut&&(Zt(this,JS,"f")&&U6(!0),this.showCompletionScript(),this.exit(0))}if(Zt(this,Fm,"f").hasDefaultCommand()&&!Rr){let Bn=Zt(this,Fm,"f").runCommand(null,this,ge,0,A,Lt||ot||A);return this[w8](Bn,Z,!!S,!1)}if(Ut){Zt(this,JS,"f")&&U6(!0),f=[].concat(f);let Bn=f.slice(f.indexOf(`--${Zt(this,BS,"f").completionKey}`)+1);return Zt(this,BS,"f").getCompletion(Bn,(Ji,is)=>{if(Ji)throw new Up(Ji.message);(is||[]).forEach(qi=>{Zt(this,cR,"f").log(qi)}),this.exit(0)}),this[w8](Re,!Z,!!S,!1)}if(Zt(this,Zb,"f")||(Lt?(Zt(this,JS,"f")&&U6(!0),j=!0,this.showHelp("log"),this.exit(0)):ot&&(Zt(this,JS,"f")&&U6(!0),j=!0,Zt(this,il,"f").showVersion("log"),this.exit(0))),!j&&Zt(this,Bo,"f").skipValidation.length>0&&(j=Object.keys(Re).some(Bn=>Zt(this,Bo,"f").skipValidation.indexOf(Bn)>=0&&Re[Bn]===!0)),!j){if(ge.error)throw new Up(ge.error.message);if(!Ut){let Bn=this[pke](_e,{},ge.error);S||(Ae=y8(Re,this,Zt(this,$S,"f").getMiddleware(),!0)),Ae=this[GQe](Bn,Ae??Re),Wp(Ae)&&!S&&(Ae=Ae.then(()=>y8(Re,this,Zt(this,$S,"f").getMiddleware(),!1)))}}}catch(tt){if(tt instanceof Up)Zt(this,il,"f").fail(tt.message,tt);else throw tt}return this[w8](Ae??Re,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,k8,"f")&&(Z=Zt(this,sm,"f").unknownCommands(j)),Zt(this,C8,"f")&&!Z?Zt(this,sm,"f").unknownArguments(j,f,h,!!C):Zt(this,E8,"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)}}[iZe](){xo(this,Zb,!0,"f")}[D8](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 AQe(l){return!!l&&typeof l.getInternalMethods=="function"}t(AQe,"isYargsInstance");var H5t=sZe(GCe),aZe=H5t;var ZV=require("util");function hke(l){console.log(l)}t(hke,"log");function zS(l){console.log(`[INFO] ${l}`)}t(zS,"logInfo");function XV(l){console.log((0,ZV.styleText)("green",`[SUCCESS] ${l}`))}t(XV,"logSuccess");function A8(l,f){l instanceof Error?console.log((0,ZV.styleText)("red",`[ERROR] ${f||l.message}`)):console.log((0,ZV.styleText)("red",`[ERROR] ${l}`))}t(A8,"logError");function _se(l){console.log((0,ZV.styleText)("bgYellow",`==== ${l} ====`))}t(_se,"logBanner");var oZe=Bh(require("fs"));function fR(){return"2.0.8"}t(fR,"getVersion");var ZXt=Bh(lZe());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 uZe(l){let f=Reflect.getMetadata(gke,l.prototype);if(!f)throw new Error(`Options for ${l.name} were not defined`);return f}t(uZe,"getYargsOption");function pse(l){return async f=>f.options(G5t(l)).middleware(async h=>await Q5t(l,h),!0)}t(pse,"getBuilder");function G5t(l){return Object.entries(uZe(l)).reduce((f,[h,S])=>(f[h]=Object.fromEntries(Object.entries(S).filter(([C])=>!["envAlias","default"].includes(C))),f),{})}t(G5t,"getYargsOptions");async function Q5t(l,f){let h=new l;for(let[S,C]of Object.entries(uZe(l)))h[S]=f[S]??C.default;return h}t(Q5t,"loadYargsConfig");var Kke=require("util");var fZe={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"},_Ze={"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"),Q6=t(l=>l.charAt(0).toLowerCase()+l.slice(1),"decapitalize"),YV=t(l=>l.replace(/(-\w)/g,f=>f[1].toUpperCase()),"kebabToCamel"),py=t(l=>l.replace(/(_\w)/g,f=>f[1].toUpperCase()),"snakeToCamel"),pZe=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"),dZe=t((l,f)=>l.replace(new RegExp(`${f}$`),""),"removeSuffix"),Z5t=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=>X5t(mZe(y_(h))));return Z5t(f)},"getMostCommonAdjacentCombinationSplit"),mZe=t(l=>l.split(/(?<![A-Z])(?=[A-Z])/).filter(Boolean),"splitByUppercase"),dse=t(l=>mZe(l).join(" "),"camelToSpaceSeparated"),X5t=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"),hZe=t((l,f)=>{let h=f.replace(/es$|s$/g,""),S=new RegExp(`(${Q6(h)}|${y_(h)})[a-z]*(?=$|[A-Z])`,"g");return l.replace(S,"")},"removeWord");function I8(l){return pZe(l)}t(I8,"formatTag");function Z6(l,f){var S;let h=(S=l.tags)==null?void 0:S[0];return I8(h??f.defaultTag)}t(Z6,"getOperationTag");function yv(l,f){var S;let h=f.splitByTags?(S=l.tags)==null?void 0:S[0]:f.defaultTag;return I8(h??f.defaultTag)}t(yv,"getEndpointTag");function gZe(l,f){return f.excludeTags.some(h=>h.toLowerCase()===l.toLowerCase())}t(gZe,"isTagExcluded");var N8="application/json",bke={"Content-Type":N8,Accept:N8},mse="data",Ske="axios",X6="config",Qk="AxiosRequestConfig",hse={defaultImport:Ske,bindings:[Qk],from:"axios"};var zw=Bh(gse()),xke=2,yZe=["application/octet-stream","multipart/form-data","application/x-www-form-urlencoded","*/*"],vZe=["query","header","path"],O8=[zw.OpenAPIV3.HttpMethods.GET,zw.OpenAPIV3.HttpMethods.PUT,zw.OpenAPIV3.HttpMethods.POST,zw.OpenAPIV3.HttpMethods.DELETE,zw.OpenAPIV3.HttpMethods.OPTIONS,zw.OpenAPIV3.HttpMethods.HEAD,zw.OpenAPIV3.HttpMethods.PATCH,zw.OpenAPIV3.HttpMethods.TRACE],bZe=["string","number","integer","boolean"],KV=["allOf","anyOf","oneOf"];var SZe="Schema",xZe="Enum",TZe="Body",CZe="Param",kZe="Response",EZe="ErrorResponse",eU="z.void()",_R="z.any()",yse="z.instanceof(Blob)",tU="z.enum",PZe="z.int()",wZe="z.number()",vse="z.string()",DZe="z.email()",AZe="z.url()",IZe="z.uuid()",NZe="z.iso.datetime({ offset: true })",K6={bindings:["z"],from:"zod"};var Vw=Symbol.for("@ts-pattern/matcher"),eFt=Symbol.for("@ts-pattern/isVariadic"),Sse="@ts-pattern/anonymous-select-key",Tke=t(l=>!!(l&&typeof l=="object"),"r"),bse=t(l=>l&&!!l[Vw],"i"),Yk=t((l,f,h)=>{if(bse(l)){let S=l[Vw](),{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];bse(Z)&&Z[eFt]?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,Re)=>Yk(ge,j[Re],h))&&C.every((ge,Re)=>Yk(ge,Z[Re],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||bse(A=C)&&A[Vw]().matcherType==="optional")&&Yk(C,f[S],h);var A})}return Object.is(f,l)},"o"),i4=t(l=>{var f,h,S;return Tke(l)?bse(l)?(f=(h=(S=l[Vw]()).getSelectionKeys)==null?void 0:h.call(S))!=null?f:[]:Array.isArray(l)?nU(l,i4):nU(Object.values(l),i4):[]},"s"),nU=t((l,f)=>l.reduce((h,S)=>h.concat(f(S)),[]),"c");function Yb(l){return Object.assign(l,{optional:t(()=>tFt(l),"optional"),and:t(f=>id(l,f),"and"),or:t(f=>rFt(l,f),"or"),select:t(f=>f===void 0?OZe(l):OZe(f,l),"select")})}t(Yb,"a");function tFt(l){return Yb({[Vw]:()=>({match:t(f=>{let h={},S=t((C,A)=>{h[C]=A},"r");return f===void 0?(i4(l).forEach(C=>S(C,void 0)),{matched:!0,selections:h}):{matched:Yk(l,f,S),selections:h}},"match"),getSelectionKeys:t(()=>i4(l),"getSelectionKeys"),matcherType:"optional"})})}t(tFt,"h");function id(...l){return Yb({[Vw]:()=>({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,i4),"getSelectionKeys"),matcherType:"and"})})}t(id,"d");function rFt(...l){return Yb({[Vw]:()=>({match:t(f=>{let h={},S=t((C,A)=>{h[C]=A},"r");return nU(l,i4).forEach(C=>S(C,void 0)),{matched:l.some(C=>Yk(C,f,S)),selections:h}},"match"),getSelectionKeys:t(()=>nU(l,i4),"getSelectionKeys"),matcherType:"or"})})}t(rFt,"y");function xf(l){return{[Vw]:()=>({match:t(f=>({matched:!!l(f)}),"match")})}}t(xf,"p");function OZe(...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 Yb({[Vw]:()=>({match:t(S=>{let C={[f??Sse]:S};return{matched:h===void 0||Yk(h,S,(A,j)=>{C[A]=j}),selections:C}},"match"),getSelectionKeys:t(()=>[f??Sse].concat(h===void 0?[]:i4(h)),"getSelectionKeys")})})}t(OZe,"v");function FZe(l){return!0}t(FZe,"b");function Zk(l){return typeof l=="number"}t(Zk,"w");function e4(l){return typeof l=="string"}t(e4,"S");function t4(l){return typeof l=="bigint"}t(t4,"j");var lYt=Yb(xf(FZe)),uYt=Yb(xf(FZe));var r4=t(l=>Object.assign(Yb(l),{startsWith:t(f=>{return r4(id(l,(h=f,xf(S=>e4(S)&&S.startsWith(h)))));var h},"startsWith"),endsWith:t(f=>{return r4(id(l,(h=f,xf(S=>e4(S)&&S.endsWith(h)))));var h},"endsWith"),minLength:t(f=>r4(id(l,(h=>xf(S=>e4(S)&&S.length>=h))(f))),"minLength"),length:t(f=>r4(id(l,(h=>xf(S=>e4(S)&&S.length===h))(f))),"length"),maxLength:t(f=>r4(id(l,(h=>xf(S=>e4(S)&&S.length<=h))(f))),"maxLength"),includes:t(f=>{return r4(id(l,(h=f,xf(S=>e4(S)&&S.includes(h)))));var h},"includes"),regex:t(f=>{return r4(id(l,(h=f,xf(S=>e4(S)&&!!S.match(h)))));var h},"regex")}),"x"),fYt=r4(xf(e4)),Xk=t(l=>Object.assign(Yb(l),{between:t((f,h)=>Xk(id(l,((S,C)=>xf(A=>Zk(A)&&S<=A&&C>=A))(f,h))),"between"),lt:t(f=>Xk(id(l,(h=>xf(S=>Zk(S)&&S<h))(f))),"lt"),gt:t(f=>Xk(id(l,(h=>xf(S=>Zk(S)&&S>h))(f))),"gt"),lte:t(f=>Xk(id(l,(h=>xf(S=>Zk(S)&&S<=h))(f))),"lte"),gte:t(f=>Xk(id(l,(h=>xf(S=>Zk(S)&&S>=h))(f))),"gte"),int:t(()=>Xk(id(l,xf(f=>Zk(f)&&Number.isInteger(f)))),"int"),finite:t(()=>Xk(id(l,xf(f=>Zk(f)&&Number.isFinite(f)))),"finite"),positive:t(()=>Xk(id(l,xf(f=>Zk(f)&&f>0))),"positive"),negative:t(()=>Xk(id(l,xf(f=>Zk(f)&&f<0))),"negative")}),"N"),_Yt=Xk(xf(Zk)),n4=t(l=>Object.assign(Yb(l),{between:t((f,h)=>n4(id(l,((S,C)=>xf(A=>t4(A)&&S<=A&&C>=A))(f,h))),"between"),lt:t(f=>n4(id(l,(h=>xf(S=>t4(S)&&S<h))(f))),"lt"),gt:t(f=>n4(id(l,(h=>xf(S=>t4(S)&&S>h))(f))),"gt"),lte:t(f=>n4(id(l,(h=>xf(S=>t4(S)&&S<=h))(f))),"lte"),gte:t(f=>n4(id(l,(h=>xf(S=>t4(S)&&S>=h))(f))),"gte"),positive:t(()=>n4(id(l,xf(f=>t4(f)&&f>0))),"positive"),negative:t(()=>n4(id(l,xf(f=>t4(f)&&f<0))),"negative")}),"k"),pYt=n4(xf(t4)),dYt=Yb(xf(function(l){return typeof l=="boolean"})),mYt=Yb(xf(function(l){return typeof l=="symbol"})),hYt=Yb(xf(function(l){return l==null})),gYt=Yb(xf(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,"I");var Cke=Pke,kke={matched:!1,value:void 0};function p1(l){return new Eke(l,kke)}t(p1,"M");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,Re)=>{A=!0,j[ge]=Re},"u"),oe=!S.some(ge=>Yk(ge,this.input,Z))||C&&!C(this.input)?kke:{matched:!0,value:h(A?Sse in j?j[Sse]: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(f=nFt){return this.state.matched?this.state.value:f(this.input)}run(){return this.exhaustive()}returnType(){return this}narrow(){return this}};t(rU,"R");var Eke=rU;function nFt(l){throw new Cke(l)}t(nFt,"F");function Tf(l){return l!=null&&Object.prototype.hasOwnProperty.call(l,"$ref")}t(Tf,"isReferenceObject");function Jh(l){return!Tf(l)}t(Jh,"isSchemaObject");function xse(l){return l.type==="array"}t(xse,"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(iFt(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(Tf(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 iFt=t(l=>!Tf(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"),F8=t(l=>l[1]==="/"?l:"#/"+l.slice(1),"autocorrectRef"),pR=t(l=>F8(l).split("/").at(-1),"getSchemaNameByRef");function Dke(l){let f=sFt(l).normalize("NFKD").trim().replace(/\s+/g,"_").replace(/--+/g,"-").replace(/-+/g,"_").replace(/[^\w-]+/g,"_");return py(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 sFt(l){let f=Number(l[0]);return typeof f=="number"&&!Number.isNaN(f)?"_"+l:l}t(sFt,"prefixStringStartingWithNumberIfNeeded");function Ike(l){let f=l.replaceAll("_","#");return py(f.replaceAll("-","_")).replaceAll("#","_")}t(Ike,"pathParamToVariableName");var M8=t(l=>bZe.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")||yZe.includes(l)||l.includes("text/")}t(Kk,"isParamMediaTypeAllowed");function iU(l){return l>=200&&l<300}t(iU,"isMainResponseStatus");function sU(l){return!(l>=200&&l<300)}t(sU,"isErrorStatus");function Tse(l){return l.startsWith("application/")}t(Tse,"isMediaTypeAllowed");var RZe=/({\w+})/g,aFt=/[^\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(aFt,"_")}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 Cse=t(l=>{let f=l["x-enumNames"],h=Array.isArray(f)&&f.length>0,S=!!l.schema&&Jh(l.schema)&&l.schema.type==="string";return h&&S},"isSortingParameterObject"),R8=t((l,f)=>f.excludePathRegex?new RegExp(f.excludePathRegex).test(l):!1,"isPathExcluded");function eE({schema:l,meta:f,options:h}){let S=[];p1(l.type).with("string",()=>S.push(lFt(l))).with("number","integer",()=>S.push(fFt(l))).with("array",()=>S.push(_Ft(l))).otherwise(()=>{}),typeof l.description=="string"&&l.description!==""&&h.withDescription&&([`
568
+ `,"f"),xo(this,Ig,Zt(this,Ig,"f")+f.join(" "),"f")},"error")}}[ike](f){aR(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]}[qQe](f,h,S){Zt(this,ise,"f")[S]||(Zt(this,Jc,"f").process.emitWarning(f,h),Zt(this,ise,"f")[S]=!0)}[zQe](){Zt(this,sse,"f").push({options:Zt(this,Bo,"f"),configObjects:Zt(this,Bo,"f").configObjects.slice(0),exitProcess:Zt(this,JS,"f"),groups:Zt(this,Hk,"f"),strict:Zt(this,C8,"f"),strictCommands:Zt(this,k8,"f"),strictOptions:Zt(this,E8,"f"),completionCommand:Zt(this,Qb,"f"),output:Zt(this,Ig,"f"),exitError:Zt(this,W6,"f"),hasOutput:Zt(this,Zb,"f"),parsed:this.parsed,parseFn:Zt(this,Xb,"f"),parseContext:Zt(this,x8,"f")}),Zt(this,il,"f").freeze(),Zt(this,sm,"f").freeze(),Zt(this,Fm,"f").freeze(),Zt(this,$S,"f").freeze()}[VQe](){let f="",h;return/\b(node|iojs|electron)(\.exe)?$/.test(Zt(this,Jc,"f").process.argv()[0])?h=Zt(this,Jc,"f").process.argv().slice(1,2):h=Zt(this,Jc,"f").process.argv().slice(0,1),f=h.map(S=>{let C=this[nZe](Zt(this,b8,"f"),S);return S.match(/^(\/|([a-zA-Z]:)?\\)/)&&C.length<S.length?C:S}).join(" ").trim(),Zt(this,Jc,"f").getEnv("_")&&Zt(this,Jc,"f").getProcessArgvBin()===Zt(this,Jc,"f").getEnv("_")&&(f=Zt(this,Jc,"f").getEnv("_").replace(`${Zt(this,Jc,"f").path.dirname(Zt(this,Jc,"f").process.execPath())}/`,"")),f}[P8](){return Zt(this,cse,"f")}[UQe](){return Zt(this,use,"f")}[ske](){if(!Zt(this,S8,"f"))return;let f=Zt(this,Jc,"f").getEnv("LC_ALL")||Zt(this,Jc,"f").getEnv("LC_MESSAGES")||Zt(this,Jc,"f").getEnv("LANG")||Zt(this,Jc,"f").getEnv("LANGUAGE")||"en_US";this.locale(f.replace(/[.:].*/,""))}[WQe](){return this[ake]().version||"unknown"}[HQe](f){let h=f["--"]?f["--"]:f._;for(let S=0,C;(C=h[S])!==void 0;S++)Zt(this,Jc,"f").Parser.looksLikeNumber(C)&&Number.isSafeInteger(Math.floor(parseFloat(`${C}`)))&&(h[S]=Number(C));return f}[ake](f){let h=f||"*";if(Zt(this,lR,"f")[h])return Zt(this,lR,"f")[h];let S={};try{let C=f||Zt(this,Jc,"f").mainFilename;!f&&Zt(this,Jc,"f").path.extname(C)&&(C=Zt(this,Jc,"f").path.dirname(C));let A=Zt(this,Jc,"f").findUp(C,(j,Z)=>{if(Z.includes("package.json"))return"package.json"});_1(A,void 0,Zt(this,Jc,"f")),S=JSON.parse(Zt(this,Jc,"f").readFileSync(A,"utf8"))}catch{}return Zt(this,lR,"f")[h]=S||{},Zt(this,lR,"f")[h]}[G6](f,h){h=[].concat(h),h.forEach(S=>{S=this[lke](S),Zt(this,Bo,"f")[f].push(S)})}[uR](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 aR(S))f(j,S[j]);else A(h,this[lke](S),C)}[lke](f){return f==="__proto__"?"___proto___":f}[uke](f,h){return this[uR](this[uke].bind(this),"key",f,h),this}[fke](){var f,h,S,C,A,j,Z,oe,ge,Re,Ae,_e;let Lt=Zt(this,sse,"f").pop();_1(Lt,void 0,Zt(this,Jc,"f"));let ot;f=this,h=this,S=this,C=this,A=this,j=this,Z=this,oe=this,ge=this,Re=this,Ae=this,_e=this,{options:{set value(tt){xo(f,Bo,tt,"f")}}.value,configObjects:ot,exitProcess:{set value(tt){xo(h,JS,tt,"f")}}.value,groups:{set value(tt){xo(S,Hk,tt,"f")}}.value,output:{set value(tt){xo(C,Ig,tt,"f")}}.value,exitError:{set value(tt){xo(A,W6,tt,"f")}}.value,hasOutput:{set value(tt){xo(j,Zb,tt,"f")}}.value,parsed:this.parsed,strict:{set value(tt){xo(Z,C8,tt,"f")}}.value,strictCommands:{set value(tt){xo(oe,k8,tt,"f")}}.value,strictOptions:{set value(tt){xo(ge,E8,tt,"f")}}.value,completionCommand:{set value(tt){xo(Re,Qb,tt,"f")}}.value,parseFn:{set value(tt){xo(Ae,Xb,tt,"f")}}.value,parseContext:{set value(tt){xo(_e,x8,tt,"f")}}.value}=Lt,Zt(this,Bo,"f").configObjects=ot,Zt(this,il,"f").unfreeze(),Zt(this,sm,"f").unfreeze(),Zt(this,Fm,"f").unfreeze(),Zt(this,$S,"f").unfreeze()}[GQe](f,h){return v8(h,S=>(f(S),S))}getInternalMethods(){return{getCommandInstance:this[QQe].bind(this),getContext:this[ZQe].bind(this),getHasOutput:this[XQe].bind(this),getLoggerInstance:this[YQe].bind(this),getParseContext:this[KQe].bind(this),getParserConfiguration:this[P8].bind(this),getUsageConfiguration:this[UQe].bind(this),getUsageInstance:this[eZe].bind(this),getValidationInstance:this[tZe].bind(this),hasParseCallback:this[fse].bind(this),isGlobalContext:this[rZe].bind(this),postProcess:this[w8].bind(this),reset:this[_ke].bind(this),runValidation:this[pke].bind(this),runYargsParserAndExecuteCommands:this[QV].bind(this),setHasOutput:this[iZe].bind(this)}}[QQe](){return Zt(this,Fm,"f")}[ZQe](){return Zt(this,GV,"f")}[XQe](){return Zt(this,Zb,"f")}[YQe](){return Zt(this,cR,"f")}[KQe](){return Zt(this,x8,"f")||{}}[eZe](){return Zt(this,il,"f")}[tZe](){return Zt(this,sm,"f")}[fse](){return!!Zt(this,Xb,"f")}[rZe](){return Zt(this,ase,"f")}[w8](f,h,S,C){return S||Wp(f)||(h||(f=this[JQe](f)),(this[P8]()["parse-positional-numbers"]||this[P8]()["parse-positional-numbers"]===void 0)&&(f=this[HQe](f)),C&&(f=y8(f,this,Zt(this,$S,"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,T8,"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]=V6(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):NQe(this,Zt(this,Jc,"f")),"f"),xo(this,sm,Zt(this,sm,"f")?Zt(this,sm,"f").reset(S):jQe(this,Zt(this,il,"f"),Zt(this,Jc,"f")),"f"),xo(this,Fm,Zt(this,Fm,"f")?Zt(this,Fm,"f").reset():DQe(Zt(this,il,"f"),Zt(this,sm,"f"),Zt(this,$S,"f"),Zt(this,Jc,"f")),"f"),Zt(this,BS,"f")||xo(this,BS,MQe(this,Zt(this,il,"f"),Zt(this,Fm,"f"),Zt(this,Jc,"f")),"f"),Zt(this,$S,"f").reset(),xo(this,Qb,null,"f"),xo(this,Ig,"","f"),xo(this,W6,null,"f"),xo(this,Zb,!1,"f"),this.parsed=!1,this}[nZe](f,h){return Zt(this,Jc,"f").path.relative(f,h)}[QV](f,h,S,C=0,A=!1){let j=!!S||A;f=f||Zt(this,H6,"f"),Zt(this,Bo,"f").__=Zt(this,Jc,"f").y18n.__,Zt(this,Bo,"f").configuration=this[P8]();let Z=!!Zt(this,Bo,"f").configuration["populate--"],oe=Object.assign({},Zt(this,Bo,"f").configuration,{"populate--":!0}),ge=Zt(this,Jc,"f").Parser.detailed(f,Object.assign({},Zt(this,Bo,"f"),{configuration:{"parse-positional-numbers":!1,...oe}})),Re=Object.assign(ge.argv,Zt(this,x8,"f")),Ae,_e=ge.aliases,Lt=!1,ot=!1;Object.keys(Re).forEach(tt=>{tt===Zt(this,qS,"f")&&Re[tt]?Lt=!0:tt===Zt(this,Gk,"f")&&Re[tt]&&(ot=!0)}),Re.$0=this.$0,this.parsed=ge,C===0&&Zt(this,il,"f").clearCachedHelpMessage();try{if(this[ske](),h)return this[w8](Re,Z,!!S,!1);Zt(this,qS,"f")&&[Zt(this,qS,"f")].concat(_e[Zt(this,qS,"f")]||[]).filter(Ji=>Ji.length>1).includes(""+Re._[Re._.length-1])&&(Re._.pop(),Lt=!0),xo(this,ase,!1,"f");let tt=Zt(this,Fm,"f").getCommands(),Ut=Zt(this,BS,"f").completionKey in Re,Rr=Lt||Ut||A;if(Re._.length){if(tt.length){let Bn;for(let Ji=C||0,is;Re._[Ji]!==void 0;Ji++)if(is=String(Re._[Ji]),tt.includes(is)&&is!==Zt(this,Qb,"f")){let qi=Zt(this,Fm,"f").runCommand(is,this,ge,Ji+1,A,Lt||ot||A);return this[w8](qi,Z,!!S,!1)}else if(!Bn&&is!==Zt(this,Qb,"f")){Bn=is;break}!Zt(this,Fm,"f").hasDefaultCommand()&&Zt(this,lse,"f")&&Bn&&!Rr&&Zt(this,sm,"f").recommendCommands(Bn,tt)}Zt(this,Qb,"f")&&Re._.includes(Zt(this,Qb,"f"))&&!Ut&&(Zt(this,JS,"f")&&U6(!0),this.showCompletionScript(),this.exit(0))}if(Zt(this,Fm,"f").hasDefaultCommand()&&!Rr){let Bn=Zt(this,Fm,"f").runCommand(null,this,ge,0,A,Lt||ot||A);return this[w8](Bn,Z,!!S,!1)}if(Ut){Zt(this,JS,"f")&&U6(!0),f=[].concat(f);let Bn=f.slice(f.indexOf(`--${Zt(this,BS,"f").completionKey}`)+1);return Zt(this,BS,"f").getCompletion(Bn,(Ji,is)=>{if(Ji)throw new Up(Ji.message);(is||[]).forEach(qi=>{Zt(this,cR,"f").log(qi)}),this.exit(0)}),this[w8](Re,!Z,!!S,!1)}if(Zt(this,Zb,"f")||(Lt?(Zt(this,JS,"f")&&U6(!0),j=!0,this.showHelp("log"),this.exit(0)):ot&&(Zt(this,JS,"f")&&U6(!0),j=!0,Zt(this,il,"f").showVersion("log"),this.exit(0))),!j&&Zt(this,Bo,"f").skipValidation.length>0&&(j=Object.keys(Re).some(Bn=>Zt(this,Bo,"f").skipValidation.indexOf(Bn)>=0&&Re[Bn]===!0)),!j){if(ge.error)throw new Up(ge.error.message);if(!Ut){let Bn=this[pke](_e,{},ge.error);S||(Ae=y8(Re,this,Zt(this,$S,"f").getMiddleware(),!0)),Ae=this[GQe](Bn,Ae??Re),Wp(Ae)&&!S&&(Ae=Ae.then(()=>y8(Re,this,Zt(this,$S,"f").getMiddleware(),!1)))}}}catch(tt){if(tt instanceof Up)Zt(this,il,"f").fail(tt.message,tt);else throw tt}return this[w8](Ae??Re,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,k8,"f")&&(Z=Zt(this,sm,"f").unknownCommands(j)),Zt(this,C8,"f")&&!Z?Zt(this,sm,"f").unknownArguments(j,f,h,!!C):Zt(this,E8,"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)}}[iZe](){xo(this,Zb,!0,"f")}[D8](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 AQe(l){return!!l&&typeof l.getInternalMethods=="function"}t(AQe,"isYargsInstance");var H5t=sZe(GCe),aZe=H5t;var ZV=require("util");function hke(l){console.log(l)}t(hke,"log");function zS(l){console.log(`[INFO] ${l}`)}t(zS,"logInfo");function XV(l){console.log((0,ZV.styleText)("green",`[SUCCESS] ${l}`))}t(XV,"logSuccess");function A8(l,f){l instanceof Error?console.log((0,ZV.styleText)("red",`[ERROR] ${f||l.message}`)):console.log((0,ZV.styleText)("red",`[ERROR] ${l}`))}t(A8,"logError");function _se(l){console.log((0,ZV.styleText)("bgYellow",`==== ${l} ====`))}t(_se,"logBanner");var oZe=Bh(require("fs"));function fR(){return"2.0.9"}t(fR,"getVersion");var ZXt=Bh(lZe());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 uZe(l){let f=Reflect.getMetadata(gke,l.prototype);if(!f)throw new Error(`Options for ${l.name} were not defined`);return f}t(uZe,"getYargsOption");function pse(l){return async f=>f.options(G5t(l)).middleware(async h=>await Q5t(l,h),!0)}t(pse,"getBuilder");function G5t(l){return Object.entries(uZe(l)).reduce((f,[h,S])=>(f[h]=Object.fromEntries(Object.entries(S).filter(([C])=>!["envAlias","default"].includes(C))),f),{})}t(G5t,"getYargsOptions");async function Q5t(l,f){let h=new l;for(let[S,C]of Object.entries(uZe(l)))h[S]=f[S]??C.default;return h}t(Q5t,"loadYargsConfig");var Kke=require("util");var fZe={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"},_Ze={"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"),Q6=t(l=>l.charAt(0).toLowerCase()+l.slice(1),"decapitalize"),YV=t(l=>l.replace(/(-\w)/g,f=>f[1].toUpperCase()),"kebabToCamel"),py=t(l=>l.replace(/(_\w)/g,f=>f[1].toUpperCase()),"snakeToCamel"),pZe=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"),dZe=t((l,f)=>l.replace(new RegExp(`${f}$`),""),"removeSuffix"),Z5t=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=>X5t(mZe(y_(h))));return Z5t(f)},"getMostCommonAdjacentCombinationSplit"),mZe=t(l=>l.split(/(?<![A-Z])(?=[A-Z])/).filter(Boolean),"splitByUppercase"),dse=t(l=>mZe(l).join(" "),"camelToSpaceSeparated"),X5t=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"),hZe=t((l,f)=>{let h=f.replace(/es$|s$/g,""),S=new RegExp(`(${Q6(h)}|${y_(h)})[a-z]*(?=$|[A-Z])`,"g");return l.replace(S,"")},"removeWord");function I8(l){return pZe(l)}t(I8,"formatTag");function Z6(l,f){var S;let h=(S=l.tags)==null?void 0:S[0];return I8(h??f.defaultTag)}t(Z6,"getOperationTag");function yv(l,f){var S;let h=f.splitByTags?(S=l.tags)==null?void 0:S[0]:f.defaultTag;return I8(h??f.defaultTag)}t(yv,"getEndpointTag");function gZe(l,f){return f.excludeTags.some(h=>h.toLowerCase()===l.toLowerCase())}t(gZe,"isTagExcluded");var N8="application/json",bke={"Content-Type":N8,Accept:N8},mse="data",Ske="axios",X6="config",Qk="AxiosRequestConfig",hse={defaultImport:Ske,bindings:[Qk],from:"axios"};var zw=Bh(gse()),xke=2,yZe=["application/octet-stream","multipart/form-data","application/x-www-form-urlencoded","*/*"],vZe=["query","header","path"],O8=[zw.OpenAPIV3.HttpMethods.GET,zw.OpenAPIV3.HttpMethods.PUT,zw.OpenAPIV3.HttpMethods.POST,zw.OpenAPIV3.HttpMethods.DELETE,zw.OpenAPIV3.HttpMethods.OPTIONS,zw.OpenAPIV3.HttpMethods.HEAD,zw.OpenAPIV3.HttpMethods.PATCH,zw.OpenAPIV3.HttpMethods.TRACE],bZe=["string","number","integer","boolean"],KV=["allOf","anyOf","oneOf"];var SZe="Schema",xZe="Enum",TZe="Body",CZe="Param",kZe="Response",EZe="ErrorResponse",eU="z.void()",_R="z.any()",yse="z.instanceof(Blob)",tU="z.enum",PZe="z.int()",wZe="z.number()",vse="z.string()",DZe="z.email()",AZe="z.url()",IZe="z.uuid()",NZe="z.iso.datetime({ offset: true })",K6={bindings:["z"],from:"zod"};var Vw=Symbol.for("@ts-pattern/matcher"),eFt=Symbol.for("@ts-pattern/isVariadic"),Sse="@ts-pattern/anonymous-select-key",Tke=t(l=>!!(l&&typeof l=="object"),"r"),bse=t(l=>l&&!!l[Vw],"i"),Yk=t((l,f,h)=>{if(bse(l)){let S=l[Vw](),{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];bse(Z)&&Z[eFt]?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,Re)=>Yk(ge,j[Re],h))&&C.every((ge,Re)=>Yk(ge,Z[Re],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||bse(A=C)&&A[Vw]().matcherType==="optional")&&Yk(C,f[S],h);var A})}return Object.is(f,l)},"o"),i4=t(l=>{var f,h,S;return Tke(l)?bse(l)?(f=(h=(S=l[Vw]()).getSelectionKeys)==null?void 0:h.call(S))!=null?f:[]:Array.isArray(l)?nU(l,i4):nU(Object.values(l),i4):[]},"s"),nU=t((l,f)=>l.reduce((h,S)=>h.concat(f(S)),[]),"c");function Yb(l){return Object.assign(l,{optional:t(()=>tFt(l),"optional"),and:t(f=>id(l,f),"and"),or:t(f=>rFt(l,f),"or"),select:t(f=>f===void 0?OZe(l):OZe(f,l),"select")})}t(Yb,"a");function tFt(l){return Yb({[Vw]:()=>({match:t(f=>{let h={},S=t((C,A)=>{h[C]=A},"r");return f===void 0?(i4(l).forEach(C=>S(C,void 0)),{matched:!0,selections:h}):{matched:Yk(l,f,S),selections:h}},"match"),getSelectionKeys:t(()=>i4(l),"getSelectionKeys"),matcherType:"optional"})})}t(tFt,"h");function id(...l){return Yb({[Vw]:()=>({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,i4),"getSelectionKeys"),matcherType:"and"})})}t(id,"d");function rFt(...l){return Yb({[Vw]:()=>({match:t(f=>{let h={},S=t((C,A)=>{h[C]=A},"r");return nU(l,i4).forEach(C=>S(C,void 0)),{matched:l.some(C=>Yk(C,f,S)),selections:h}},"match"),getSelectionKeys:t(()=>nU(l,i4),"getSelectionKeys"),matcherType:"or"})})}t(rFt,"y");function xf(l){return{[Vw]:()=>({match:t(f=>({matched:!!l(f)}),"match")})}}t(xf,"p");function OZe(...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 Yb({[Vw]:()=>({match:t(S=>{let C={[f??Sse]:S};return{matched:h===void 0||Yk(h,S,(A,j)=>{C[A]=j}),selections:C}},"match"),getSelectionKeys:t(()=>[f??Sse].concat(h===void 0?[]:i4(h)),"getSelectionKeys")})})}t(OZe,"v");function FZe(l){return!0}t(FZe,"b");function Zk(l){return typeof l=="number"}t(Zk,"w");function e4(l){return typeof l=="string"}t(e4,"S");function t4(l){return typeof l=="bigint"}t(t4,"j");var lYt=Yb(xf(FZe)),uYt=Yb(xf(FZe));var r4=t(l=>Object.assign(Yb(l),{startsWith:t(f=>{return r4(id(l,(h=f,xf(S=>e4(S)&&S.startsWith(h)))));var h},"startsWith"),endsWith:t(f=>{return r4(id(l,(h=f,xf(S=>e4(S)&&S.endsWith(h)))));var h},"endsWith"),minLength:t(f=>r4(id(l,(h=>xf(S=>e4(S)&&S.length>=h))(f))),"minLength"),length:t(f=>r4(id(l,(h=>xf(S=>e4(S)&&S.length===h))(f))),"length"),maxLength:t(f=>r4(id(l,(h=>xf(S=>e4(S)&&S.length<=h))(f))),"maxLength"),includes:t(f=>{return r4(id(l,(h=f,xf(S=>e4(S)&&S.includes(h)))));var h},"includes"),regex:t(f=>{return r4(id(l,(h=f,xf(S=>e4(S)&&!!S.match(h)))));var h},"regex")}),"x"),fYt=r4(xf(e4)),Xk=t(l=>Object.assign(Yb(l),{between:t((f,h)=>Xk(id(l,((S,C)=>xf(A=>Zk(A)&&S<=A&&C>=A))(f,h))),"between"),lt:t(f=>Xk(id(l,(h=>xf(S=>Zk(S)&&S<h))(f))),"lt"),gt:t(f=>Xk(id(l,(h=>xf(S=>Zk(S)&&S>h))(f))),"gt"),lte:t(f=>Xk(id(l,(h=>xf(S=>Zk(S)&&S<=h))(f))),"lte"),gte:t(f=>Xk(id(l,(h=>xf(S=>Zk(S)&&S>=h))(f))),"gte"),int:t(()=>Xk(id(l,xf(f=>Zk(f)&&Number.isInteger(f)))),"int"),finite:t(()=>Xk(id(l,xf(f=>Zk(f)&&Number.isFinite(f)))),"finite"),positive:t(()=>Xk(id(l,xf(f=>Zk(f)&&f>0))),"positive"),negative:t(()=>Xk(id(l,xf(f=>Zk(f)&&f<0))),"negative")}),"N"),_Yt=Xk(xf(Zk)),n4=t(l=>Object.assign(Yb(l),{between:t((f,h)=>n4(id(l,((S,C)=>xf(A=>t4(A)&&S<=A&&C>=A))(f,h))),"between"),lt:t(f=>n4(id(l,(h=>xf(S=>t4(S)&&S<h))(f))),"lt"),gt:t(f=>n4(id(l,(h=>xf(S=>t4(S)&&S>h))(f))),"gt"),lte:t(f=>n4(id(l,(h=>xf(S=>t4(S)&&S<=h))(f))),"lte"),gte:t(f=>n4(id(l,(h=>xf(S=>t4(S)&&S>=h))(f))),"gte"),positive:t(()=>n4(id(l,xf(f=>t4(f)&&f>0))),"positive"),negative:t(()=>n4(id(l,xf(f=>t4(f)&&f<0))),"negative")}),"k"),pYt=n4(xf(t4)),dYt=Yb(xf(function(l){return typeof l=="boolean"})),mYt=Yb(xf(function(l){return typeof l=="symbol"})),hYt=Yb(xf(function(l){return l==null})),gYt=Yb(xf(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,"I");var Cke=Pke,kke={matched:!1,value:void 0};function p1(l){return new Eke(l,kke)}t(p1,"M");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,Re)=>{A=!0,j[ge]=Re},"u"),oe=!S.some(ge=>Yk(ge,this.input,Z))||C&&!C(this.input)?kke:{matched:!0,value:h(A?Sse in j?j[Sse]: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(f=nFt){return this.state.matched?this.state.value:f(this.input)}run(){return this.exhaustive()}returnType(){return this}narrow(){return this}};t(rU,"R");var Eke=rU;function nFt(l){throw new Cke(l)}t(nFt,"F");function Tf(l){return l!=null&&Object.prototype.hasOwnProperty.call(l,"$ref")}t(Tf,"isReferenceObject");function Jh(l){return!Tf(l)}t(Jh,"isSchemaObject");function xse(l){return l.type==="array"}t(xse,"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(iFt(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(Tf(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 iFt=t(l=>!Tf(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"),F8=t(l=>l[1]==="/"?l:"#/"+l.slice(1),"autocorrectRef"),pR=t(l=>F8(l).split("/").at(-1),"getSchemaNameByRef");function Dke(l){let f=sFt(l).normalize("NFKD").trim().replace(/\s+/g,"_").replace(/--+/g,"-").replace(/-+/g,"_").replace(/[^\w-]+/g,"_");return py(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 sFt(l){let f=Number(l[0]);return typeof f=="number"&&!Number.isNaN(f)?"_"+l:l}t(sFt,"prefixStringStartingWithNumberIfNeeded");function Ike(l){let f=l.replaceAll("_","#");return py(f.replaceAll("-","_")).replaceAll("#","_")}t(Ike,"pathParamToVariableName");var M8=t(l=>bZe.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")||yZe.includes(l)||l.includes("text/")}t(Kk,"isParamMediaTypeAllowed");function iU(l){return l>=200&&l<300}t(iU,"isMainResponseStatus");function sU(l){return!(l>=200&&l<300)}t(sU,"isErrorStatus");function Tse(l){return l.startsWith("application/")}t(Tse,"isMediaTypeAllowed");var RZe=/({\w+})/g,aFt=/[^\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(aFt,"_")}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 Cse=t(l=>{let f=l["x-enumNames"],h=Array.isArray(f)&&f.length>0,S=!!l.schema&&Jh(l.schema)&&l.schema.type==="string";return h&&S},"isSortingParameterObject"),R8=t((l,f)=>f.excludePathRegex?new RegExp(f.excludePathRegex).test(l):!1,"isPathExcluded");function eE({schema:l,meta:f,options:h}){let S=[];p1(l.type).with("string",()=>S.push(lFt(l))).with("number","integer",()=>S.push(fFt(l))).with("array",()=>S.push(_Ft(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(oFt({schema:l,meta:f,options:h}),h.withDefaultValues!==!1?cFt(l):[]).filter(Boolean).join(".");return C?`.${C}`:""}t(eE,"getZodChain");function oFt({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(oFt,"getZodChainablePresence");function cFt(l){return l.default!==void 0?`default(${p1(l.type).with("number","integer",()=>jZe(l.default)).otherwise(()=>JSON.stringify(l.default))})`:""}t(cFt,"getZodChainableDefault");function lFt(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(${uFt(l.pattern)})`),f.join(".")}t(lFt,"getZodChainableStringValidations");function uFt(l){return l.startsWith("/")&&l.endsWith("/")&&(l=l.slice(1,-1)),l=BZe(l),`/${l}/`}t(uFt,"formatPatternIfNeeded");function fFt(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(fFt,"getZodChainableNumberValidations");function _Ft(l){let f=[];return l.minItems&&f.push(`min(${l.minItems})`),l.maxItems&&f.push(`max(${l.maxItems})`),f.join(".")}t(_Ft,"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(kse(S)).map(C=>l.getZodSchemaNameByRef(C)):[]}t(qZe,"getZodSchemaRefs");function kse(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||!Jh(C.schema)||C.schema.type!=="object")&&kse(C).forEach(j=>S.add(j)),S},new Set)}t(kse,"getSchemaRefs");var L8=t(l=>l.reduce((f,h)=>f+h,0),"sum");function Ng(l,f){if(!f)return l;if(Tf(f))return l+2;if(Array.isArray(f.type))return f.type.length===1?Kb("oneOf")+Ng(l,{...f,type:f.type[0]}):l+Kb("oneOf")+L8(f.type.map(h=>Ng(0,{...f,type:h})));if(f.oneOf)return f.oneOf.length===1?Kb("oneOf")+Ng(l,f.oneOf[0]):l+Kb("oneOf")+L8(f.oneOf.map(h=>Ng(0,h)));if(f.anyOf)return f.anyOf.length===1?Kb("anyOf")+Ng(l,f.anyOf[0]):l+Kb("anyOf")+L8(f.anyOf.map(h=>Ng(0,h)));if(f.allOf)return f.allOf.length===1?Kb("allOf")+Ng(l,f.allOf[0]):l+Kb("allOf")+L8(f.allOf.map(h=>Ng(0,h)));if(!f.type)return l;if(M8(f.type))return f.enum?l+zZe(f)+Kb("enum")+L8(f.enum.map(h=>Ng(0,h))):l+zZe(f);if(f.type==="array")return f.items?Kb("array")+Ng(l,f.items):Kb("array")+Ng(l);if(f.type==="object"||f.properties||f.additionalProperties){if(f.properties){let h=Object.values(f.properties);l+=Kb("object")+L8(h.map(S=>Ng(0,S)))}else l+=Kb("empty-object");f.additionalProperties&&(typeof f.additionalProperties=="object"?l+=Ng(0,f.additionalProperties):l+=Ng(1))}return l}t(Ng,"getOpenAPISchemaComplexity");function zZe(l){return p1(l.type).with("string","number","integer","boolean",()=>1).otherwise(()=>0)}t(zZe,"complexityByType");function Kb(l){return p1(l).with("oneOf",()=>2).with("anyOf",()=>3).with("allOf",()=>2).with("enum","array","empty-object",()=>1).with("object",()=>2).otherwise(()=>0)}t(Kb,"complexityByComposite");var Oke=class Oke{constructor(f,h,S={referencedBy:[]},C){this.schema=f;this.resolver=h;Tf(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 Ng(0,this.schema)}assign(f){return this.code=f,this}inherit(f){return f&&f.children.push(this),this}};t(Oke,"ZodSchema");var aU=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 aU(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(Tf(l))return pFt({schema:l,zodSchema:C,resolver:f,meta:A,tag:S});let Z=mFt({schema:l,zodSchema:C,resolver:f,meta:A,tag:S});if(Z)return Z;let oe=dFt({schema:l,zodSchema:C,resolver:f,meta:A,tag:S});if(oe)return oe;let ge=hFt({schema:l,zodSchema:C,resolver:f,meta:A,tag:S});if(ge)return ge;let Re=gFt({schema:l,zodSchema:C,resolver:f,meta:A,tag:S});if(Re)return Re;let Ae=yFt({schema:l,zodSchema:C,resolver:f,meta:A,tag:S});if(Ae)return Ae;let _e=f.options.allReadonly?".readonly()":"";if(xse(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(${_R})${_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,Ut=f.options.withImplicitRequiredProps?!1:l.properties&&!((ot=l.required)!=null&&ot.length),Rr="{}";l.properties&&(Rr=`{ ${Object.entries(l.properties).map(([mn,Ar])=>{var Jr;let xl={...A,isRequired:Ut?!0:tt?(Jr=l.required)==null?void 0:Jr.includes(mn):f.options.withImplicitRequiredProps,name:mn,isParentPartial:Ut},da=Ar;if(Tf(Ar)&&f&&(da=f.getSchemaByRef(Ar.$ref),!da))throw new Error(`Schema ${Ar.$ref} not found`);let La=am({...j,schema:Ar,meta:xl}),Xr=La.getCodeString(S,f.options)+eE({schema:da,meta:xl,options:f.options}),gs=!1,Fs=Nke(h);return Fs&&(gs=[...Tf(Ar)?[Ar.$ref]:[],...kse(La,{skipObjectSchema:!0})].some($o=>{var gr;return(gr=f.dependencyGraph.deepDependencyGraph[$o])==null?void 0:gr.has(Fs)})),[mn,Xr,gs]}).map(([mn,Ar,xl])=>xl?`get ${Ake(mn)}() { return ${Ar} }`:`${Ake(mn)}: ${Ar}`).join(", ")} }`);let Bn="";l.additionalProperties&&(Bn=`.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}):_R})`);let is=`z.object(${Rr})${Ut?".partial()":""}${Bn}${_e}`;return C.assign(is)}if(Lt==="any")return C.assign(_R);if(Lt==="null")return C.assign("z.null()");if(!Lt)return C.assign("z.unknown()");throw new Error(`Unsupported schema type: ${Lt}`)}t(am,"getZodSchema");function pFt({schema:l,zodSchema:f,resolver:h,meta:S,tag:C}){if(!Tf(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(pFt,"getReferenceZodSchema");function dFt({schema:l,zodSchema:f,resolver:h,meta:S,tag:C}){var j;if(!Jh(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=>Jh(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.8",
3
+ "version": "2.0.9",
4
4
  "keywords": [
5
5
  "codegen",
6
6
  "openapi",