@povio/openapi-codegen-cli 2.0.8-rc.4 → 2.0.8-rc.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/sh.js +1 -1
- package/package.json +1 -1
- package/src/assets/useMutationEffects.ts +31 -31
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,jr)=>jr.length-Ut.length);let ot=null,tt=1/0;for(let Ut=0,jr;(jr=_e[Ut])!==void 0;Ut++){let Un=RQe(Ae,jr);Un<=3&&Un<tt&&(tt=Un,ot=jr)}ot&&f.fail(S("Did you mean %s?",ot))},"recommendCommands"),A.reset=t(function(Ae){return j=q6(j,_e=>!Ae[_e]),oe=q6(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=U5t(f,l.extends);else try{j=require.resolve(l.extends)}catch{return l}V5t(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 V5t(l){if(nke.indexOf(l)>-1)throw new Up(`Circular extended configurations: '${l}'.`)}t(V5t,"checkForCircularExtends");function U5t(l,f){return WV.path.resolve(l,f)}t(U5t,"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)},Om,v8,GV,BS,Qb,rse,V6,b8,nse,JS,ise,$S,Hk,Zb,qS,sse,cR,Ag,Bo,ase,ose,Xb,S8,lR,x8,U6,cse,Bc,T8,C8,k8,il,lse,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"),E8=Symbol("getParserConfiguration"),UQe=Symbol("getUsageConfiguration"),ske=Symbol("guessLocale"),WQe=Symbol("guessVersion"),HQe=Symbol("parsePositionalNumbers"),ake=Symbol("pkgUp"),W6=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"),use=Symbol("hasParseCallback"),rZe=Symbol("isGlobalContext"),P8=Symbol("postProcess"),nZe=Symbol("rebase"),_ke=Symbol("reset"),QV=Symbol("runYargsParserAndExecuteCommands"),pke=Symbol("runValidation"),iZe=Symbol("setHasOutput"),w8=Symbol("kTrackManuallySetKeys"),mke=class mke{constructor(f=[],h,S,C){this.customScriptName=!1,this.parsed=!1,Om.set(this,void 0),v8.set(this,void 0),GV.set(this,{commands:[],fullCommands:[]}),BS.set(this,null),Qb.set(this,null),rse.set(this,"show-hidden"),V6.set(this,null),b8.set(this,!0),nse.set(this,{}),JS.set(this,!0),ise.set(this,[]),$S.set(this,void 0),Hk.set(this,{}),Zb.set(this,!1),qS.set(this,null),sse.set(this,!0),cR.set(this,void 0),Ag.set(this,""),Bo.set(this,void 0),ase.set(this,void 0),ose.set(this,{}),Xb.set(this,null),S8.set(this,null),lR.set(this,{}),x8.set(this,{}),U6.set(this,void 0),cse.set(this,!1),Bc.set(this,void 0),T8.set(this,!1),C8.set(this,!1),k8.set(this,!1),il.set(this,void 0),lse.set(this,{}),Gk.set(this,null),sm.set(this,void 0),xo(this,Bc,C,"f"),xo(this,U6,f,"f"),xo(this,v8,h,"f"),xo(this,ase,S,"f"),xo(this,$S,new Kie(this),"f"),this.$0=this[VQe](),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,rse,"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,rse,"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[W6]("array",f),this[w8](f),this}boolean(f){return ho("<array|string>",[f],arguments.length),this[W6]("boolean",f),this[w8](f),this}check(f,h){return ho("<function> [boolean]",[f,h],arguments.length),this.middleware((S,C)=>y8(()=>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,$S,"f").addCoerceMiddleware((S,C)=>{let A;return Object.prototype.hasOwnProperty.call(S,f)?y8(()=>(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,v8,"f"),this[E8]()["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,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,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,ase,"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[W6]("count",f),this[w8](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[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,Bc,"f")),this.demandOption(C,S)}),h=1/0):typeof h!="number"&&(S=h,h=1/0),typeof f=="number"?(_1(S,!0,Zt(this,Bc,"f")),this.demandCommand(f,h,S,S)):Array.isArray(f)?f.forEach(C=>{_1(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[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,b8,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,V6,h,"f"),Zt(this,JS,"f")&&Zt(this,Bc,"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,b8,"f")}getExitProcess(){return Zt(this,JS,"f")}getGroups(){return Object.assign({},Zt(this,Hk,"f"),Zt(this,x8,"f"))}getHelp(){if(xo(this,Zb,!0,"f"),!Zt(this,il,"f").hasCachedHelpMessage()){if(!this.parsed){let h=this[QV](Zt(this,U6,"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,T8,"f")}getStrictCommands(){return Zt(this,C8,"f")}getStrictOptions(){return Zt(this,k8,"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,x8,"f")[h]||Zt(this,Hk,"f")[h];Zt(this,x8,"f")[h]&&delete Zt(this,x8,"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,b8,!1,"f"),Zt(this,Bc,"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[W6]("normalize",f),this}number(f){return ho("<array|string>",[f],arguments.length),this[W6]("number",f),this[w8](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[w8](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,U6,"f")),typeof h=="object"&&(xo(this,S8,h,"f"),h=S),typeof h=="function"&&(xo(this,Xb,h,"f"),h=!1),h||xo(this,U6,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,V6,"f"),j,Zt(this,Ag,"f")),j)).catch(j=>{throw Zt(this,Xb,"f")&&Zt(this,Xb,"f")(j,this.parsed.argv,Zt(this,Ag,"f")),j}).finally(()=>{this[fke](),this.parsed=A}):(Zt(this,Xb,"f")&&Zt(this,Xb,"f").call(this,Zt(this,V6,"f"),C,Zt(this,Ag,"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,ose,f,"f"),this}pkgConf(f,h){ho("<string> [string]",[f,h],arguments.length);let S=null,C=this[ake](h||Zt(this,v8,"f"));return C[f]&&typeof C[f]=="object"&&(S=HV(C[f],h||Zt(this,v8,"f"),this[E8]()["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=q6(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 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,cse,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,U6,"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[W6]("skipValidation",f),this}strict(f){return ho("[boolean]",[f],arguments.length),xo(this,T8,f!==!1,"f"),this}strictCommands(f){return ho("[boolean]",[f],arguments.length),xo(this,C8,f!==!1,"f"),this}strictOptions(f){return ho("[boolean]",[f],arguments.length),xo(this,k8,f!==!1,"f"),this}string(f){return ho("<array|string>",[f],arguments.length),this[W6]("string",f),this[w8](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,b8,!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(_1(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,lse,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}[(Om=new WeakMap,v8=new WeakMap,GV=new WeakMap,BS=new WeakMap,Qb=new WeakMap,rse=new WeakMap,V6=new WeakMap,b8=new WeakMap,nse=new WeakMap,JS=new WeakMap,ise=new WeakMap,$S=new WeakMap,Hk=new WeakMap,Zb=new WeakMap,qS=new WeakMap,sse=new WeakMap,cR=new WeakMap,Ag=new WeakMap,Bo=new WeakMap,ase=new WeakMap,ose=new WeakMap,Xb=new WeakMap,S8=new WeakMap,lR=new WeakMap,x8=new WeakMap,U6=new WeakMap,cse=new WeakMap,Bc=new WeakMap,T8=new WeakMap,C8=new WeakMap,k8=new WeakMap,il=new WeakMap,lse=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[use]()||console.log(...f),xo(this,Zb,!0,"f"),Zt(this,Ag,"f").length&&xo(this,Ag,Zt(this,Ag,"f")+`
|
|
567
567
|
`,"f"),xo(this,Ag,Zt(this,Ag,"f")+f.join(" "),"f")},"log"),error:t((...f)=>{this[use]()||console.error(...f),xo(this,Zb,!0,"f"),Zt(this,Ag,"f").length&&xo(this,Ag,Zt(this,Ag,"f")+`
|
|
568
|
-
`,"f"),xo(this,Ag,Zt(this,Ag,"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,nse,"f")[S]||(Zt(this,Bc,"f").process.emitWarning(f,h),Zt(this,nse,"f")[S]=!0)}[zQe](){Zt(this,ise,"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,T8,"f"),strictCommands:Zt(this,C8,"f"),strictOptions:Zt(this,k8,"f"),completionCommand:Zt(this,Qb,"f"),output:Zt(this,Ag,"f"),exitError:Zt(this,V6,"f"),hasOutput:Zt(this,Zb,"f"),parsed:this.parsed,parseFn:Zt(this,Xb,"f"),parseContext:Zt(this,S8,"f")}),Zt(this,il,"f").freeze(),Zt(this,sm,"f").freeze(),Zt(this,Om,"f").freeze(),Zt(this,$S,"f").freeze()}[VQe](){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[nZe](Zt(this,v8,"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}[E8](){return Zt(this,ose,"f")}[UQe](){return Zt(this,lse,"f")}[ske](){if(!Zt(this,b8,"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(/[.:].*/,""))}[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,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,lR,"f")[h])return Zt(this,lR,"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"});_1(A,void 0,Zt(this,Bc,"f")),S=JSON.parse(Zt(this,Bc,"f").readFileSync(A,"utf8"))}catch{}return Zt(this,lR,"f")[h]=S||{},Zt(this,lR,"f")[h]}[W6](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,je,Ae,_e;let Lt=Zt(this,ise,"f").pop();_1(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,JS,tt,"f")}}.value,groups:{set value(tt){xo(S,Hk,tt,"f")}}.value,output:{set value(tt){xo(C,Ag,tt,"f")}}.value,exitError:{set value(tt){xo(A,V6,tt,"f")}}.value,hasOutput:{set value(tt){xo(j,Zb,tt,"f")}}.value,parsed:this.parsed,strict:{set value(tt){xo(Z,T8,tt,"f")}}.value,strictCommands:{set value(tt){xo(oe,C8,tt,"f")}}.value,strictOptions:{set value(tt){xo(ge,k8,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,S8,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,$S,"f").unfreeze()}[GQe](f,h){return y8(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[E8].bind(this),getUsageConfiguration:this[UQe].bind(this),getUsageInstance:this[eZe].bind(this),getValidationInstance:this[tZe].bind(this),hasParseCallback:this[use].bind(this),isGlobalContext:this[rZe].bind(this),postProcess:this[P8].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,Om,"f")}[ZQe](){return Zt(this,GV,"f")}[XQe](){return Zt(this,Zb,"f")}[YQe](){return Zt(this,cR,"f")}[KQe](){return Zt(this,S8,"f")||{}}[eZe](){return Zt(this,il,"f")}[tZe](){return Zt(this,sm,"f")}[use](){return!!Zt(this,Xb,"f")}[rZe](){return Zt(this,sse,"f")}[P8](f,h,S,C){return S||Wp(f)||(h||(f=this[JQe](f)),(this[E8]()["parse-positional-numbers"]||this[E8]()["parse-positional-numbers"]===void 0)&&(f=this[HQe](f)),C&&(f=g8(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,x8,"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]=q6(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,Bc,"f")),"f"),xo(this,sm,Zt(this,sm,"f")?Zt(this,sm,"f").reset(S):jQe(this,Zt(this,il,"f"),Zt(this,Bc,"f")),"f"),xo(this,Om,Zt(this,Om,"f")?Zt(this,Om,"f").reset():DQe(Zt(this,il,"f"),Zt(this,sm,"f"),Zt(this,$S,"f"),Zt(this,Bc,"f")),"f"),Zt(this,BS,"f")||xo(this,BS,MQe(this,Zt(this,il,"f"),Zt(this,Om,"f"),Zt(this,Bc,"f")),"f"),Zt(this,$S,"f").reset(),xo(this,Qb,null,"f"),xo(this,Ag,"","f"),xo(this,V6,null,"f"),xo(this,Zb,!1,"f"),this.parsed=!1,this}[nZe](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,U6,"f"),Zt(this,Bo,"f").__=Zt(this,Bc,"f").y18n.__,Zt(this,Bo,"f").configuration=this[E8]();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,S8,"f")),Ae,_e=ge.aliases,Lt=!1,ot=!1;Object.keys(je).forEach(tt=>{tt===Zt(this,qS,"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[P8](je,Z,!!S,!1);Zt(this,qS,"f")&&[Zt(this,qS,"f")].concat(_e[Zt(this,qS,"f")]||[]).filter($i=>$i.length>1).includes(""+je._[je._.length-1])&&(je._.pop(),Lt=!0),xo(this,sse,!1,"f");let tt=Zt(this,Om,"f").getCommands(),Ut=Zt(this,BS,"f").completionKey in je,jr=Lt||Ut||A;if(je._.length){if(tt.length){let Un;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[P8](xi,Z,!!S,!1)}else if(!Un&&is!==Zt(this,Qb,"f")){Un=is;break}!Zt(this,Om,"f").hasDefaultCommand()&&Zt(this,cse,"f")&&Un&&!jr&&Zt(this,sm,"f").recommendCommands(Un,tt)}Zt(this,Qb,"f")&&je._.includes(Zt(this,Qb,"f"))&&!Ut&&(Zt(this,JS,"f")&&z6(!0),this.showCompletionScript(),this.exit(0))}if(Zt(this,Om,"f").hasDefaultCommand()&&!jr){let Un=Zt(this,Om,"f").runCommand(null,this,ge,0,A,Lt||ot||A);return this[P8](Un,Z,!!S,!1)}if(Ut){Zt(this,JS,"f")&&z6(!0),f=[].concat(f);let Un=f.slice(f.indexOf(`--${Zt(this,BS,"f").completionKey}`)+1);return Zt(this,BS,"f").getCompletion(Un,($i,is)=>{if($i)throw new Up($i.message);(is||[]).forEach(xi=>{Zt(this,cR,"f").log(xi)}),this.exit(0)}),this[P8](je,!Z,!!S,!1)}if(Zt(this,Zb,"f")||(Lt?(Zt(this,JS,"f")&&z6(!0),j=!0,this.showHelp("log"),this.exit(0)):ot&&(Zt(this,JS,"f")&&z6(!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(Un=>Zt(this,Bo,"f").skipValidation.indexOf(Un)>=0&&je[Un]===!0)),!j){if(ge.error)throw new Up(ge.error.message);if(!Ut){let Un=this[pke](_e,{},ge.error);S||(Ae=g8(je,this,Zt(this,$S,"f").getMiddleware(),!0)),Ae=this[GQe](Un,Ae??je),Wp(Ae)&&!S&&(Ae=Ae.then(()=>g8(je,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[P8](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,C8,"f")&&(Z=Zt(this,sm,"f").unknownCommands(j)),Zt(this,T8,"f")&&!Z?Zt(this,sm,"f").unknownArguments(j,f,h,!!C):Zt(this,k8,"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")}[w8](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 W5t=sZe(GCe),aZe=W5t;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 D8(l,f){l instanceof Error?console.log((0,ZV.styleText)("red",`[ERROR] ${f||l.message}`)):console.log((0,ZV.styleText)("red",`[ERROR] ${l}`))}t(D8,"logError");function fse(l){console.log((0,ZV.styleText)("bgYellow",`==== ${l} ====`))}t(fse,"logBanner");var oZe=jh(require("fs"));function fR(){return"2.0.8-rc.4"}t(fR,"getVersion");var HXt=jh(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 _se(l){return async f=>f.options(H5t(l)).middleware(async h=>await G5t(l,h),!0)}t(_se,"getBuilder");function H5t(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(H5t,"getYargsOptions");async function G5t(l,f){let h=new l;for(let[S,C]of Object.entries(uZe(l)))h[S]=f[S]??C.default;return h}t(G5t,"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"),H6=t(l=>l.charAt(0).toLowerCase()+l.slice(1),"decapitalize"),YV=t(l=>l.replace(/(-\w)/g,f=>f[1].toUpperCase()),"kebabToCamel"),_y=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"),Q5t=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=>Z5t(mZe(y_(h))));return Q5t(f)},"getMostCommonAdjacentCombinationSplit"),mZe=t(l=>l.split(/(?<![A-Z])(?=[A-Z])/).filter(Boolean),"splitByUppercase"),pse=t(l=>mZe(l).join(" "),"camelToSpaceSeparated"),Z5t=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(`(${H6(h)}|${y_(h)})[a-z]*(?=$|[A-Z])`,"g");return l.replace(S,"")},"removeWord");function A8(l){return pZe(l)}t(A8,"formatTag");function G6(l,f){var S;let h=(S=l.tags)==null?void 0:S[0];return A8(h??f.defaultTag)}t(G6,"getOperationTag");function yv(l,f){var S;let h=f.splitByTags?(S=l.tags)==null?void 0:S[0]:f.defaultTag;return A8(h??f.defaultTag)}t(yv,"getEndpointTag");function gZe(l,f){return f.excludeTags.some(h=>h.toLowerCase()===l.toLowerCase())}t(gZe,"isTagExcluded");var I8="application/json",bke={"Content-Type":I8,Accept:I8},dse="data",Ske="axios",Q6="config",Qk="AxiosRequestConfig",mse={defaultImport:Ske,bindings:[Qk],from:"axios"};var zw=jh(hse()),xke=2,yZe=["application/octet-stream","multipart/form-data","application/x-www-form-urlencoded","*/*"],vZe=["query","header","path"],N8=[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()",gse="z.instanceof(Blob)",tU="z.enum",PZe="z.int()",wZe="z.number()",yse="z.string()",DZe="z.email()",AZe="z.url()",IZe="z.uuid()",NZe="z.iso.datetime({ offset: true })",X6={bindings:["z"],from:"zod"};var Vw=Symbol.for("@ts-pattern/matcher"),K5t=Symbol.for("@ts-pattern/isVariadic"),bse="@ts-pattern/anonymous-select-key",Tke=t(l=>!!(l&&typeof l=="object"),"r"),vse=t(l=>l&&!!l[Vw],"i"),Yk=t((l,f,h)=>{if(vse(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];vse(Z)&&Z[K5t]?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||vse(A=C)&&A[Vw]().matcherType==="optional")&&Yk(C,f[S],h);var A})}return Object.is(f,l)},"o"),r4=t(l=>{var f,h,S;return Tke(l)?vse(l)?(f=(h=(S=l[Vw]()).getSelectionKeys)==null?void 0:h.call(S))!=null?f:[]:Array.isArray(l)?nU(l,r4):nU(Object.values(l),r4):[]},"s"),nU=t((l,f)=>l.reduce((h,S)=>h.concat(f(S)),[]),"c");function Yb(l){return Object.assign(l,{optional:t(()=>eFt(l),"optional"),and:t(f=>id(l,f),"and"),or:t(f=>tFt(l,f),"or"),select:t(f=>f===void 0?OZe(l):OZe(f,l),"select")})}t(Yb,"a");function eFt(l){return Yb({[Vw]:()=>({match:t(f=>{let h={},S=t((C,A)=>{h[C]=A},"r");return f===void 0?(r4(l).forEach(C=>S(C,void 0)),{matched:!0,selections:h}):{matched:Yk(l,f,S),selections:h}},"match"),getSelectionKeys:t(()=>r4(l),"getSelectionKeys"),matcherType:"optional"})})}t(eFt,"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,r4),"getSelectionKeys"),matcherType:"and"})})}t(id,"d");function tFt(...l){return Yb({[Vw]:()=>({match:t(f=>{let h={},S=t((C,A)=>{h[C]=A},"r");return nU(l,r4).forEach(C=>S(C,void 0)),{matched:l.some(C=>Yk(C,f,S)),selections:h}},"match"),getSelectionKeys:t(()=>nU(l,r4),"getSelectionKeys"),matcherType:"or"})})}t(tFt,"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??bse]:S};return{matched:h===void 0||Yk(h,S,(A,j)=>{C[A]=j}),selections:C}},"match"),getSelectionKeys:t(()=>[f??bse].concat(h===void 0?[]:r4(h)),"getSelectionKeys")})})}t(OZe,"v");function FZe(l){return!0}t(FZe,"b");function Zk(l){return typeof l=="number"}t(Zk,"w");function Y6(l){return typeof l=="string"}t(Y6,"S");function K6(l){return typeof l=="bigint"}t(K6,"j");var aYt=Yb(xf(FZe)),oYt=Yb(xf(FZe));var e4=t(l=>Object.assign(Yb(l),{startsWith:t(f=>{return e4(id(l,(h=f,xf(S=>Y6(S)&&S.startsWith(h)))));var h},"startsWith"),endsWith:t(f=>{return e4(id(l,(h=f,xf(S=>Y6(S)&&S.endsWith(h)))));var h},"endsWith"),minLength:t(f=>e4(id(l,(h=>xf(S=>Y6(S)&&S.length>=h))(f))),"minLength"),length:t(f=>e4(id(l,(h=>xf(S=>Y6(S)&&S.length===h))(f))),"length"),maxLength:t(f=>e4(id(l,(h=>xf(S=>Y6(S)&&S.length<=h))(f))),"maxLength"),includes:t(f=>{return e4(id(l,(h=f,xf(S=>Y6(S)&&S.includes(h)))));var h},"includes"),regex:t(f=>{return e4(id(l,(h=f,xf(S=>Y6(S)&&!!S.match(h)))));var h},"regex")}),"x"),cYt=e4(xf(Y6)),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"),lYt=Xk(xf(Zk)),t4=t(l=>Object.assign(Yb(l),{between:t((f,h)=>t4(id(l,((S,C)=>xf(A=>K6(A)&&S<=A&&C>=A))(f,h))),"between"),lt:t(f=>t4(id(l,(h=>xf(S=>K6(S)&&S<h))(f))),"lt"),gt:t(f=>t4(id(l,(h=>xf(S=>K6(S)&&S>h))(f))),"gt"),lte:t(f=>t4(id(l,(h=>xf(S=>K6(S)&&S<=h))(f))),"lte"),gte:t(f=>t4(id(l,(h=>xf(S=>K6(S)&&S>=h))(f))),"gte"),positive:t(()=>t4(id(l,xf(f=>K6(f)&&f>0))),"positive"),negative:t(()=>t4(id(l,xf(f=>K6(f)&&f<0))),"negative")}),"k"),uYt=t4(xf(K6)),fYt=Yb(xf(function(l){return typeof l=="boolean"})),_Yt=Yb(xf(function(l){return typeof l=="symbol"})),pYt=Yb(xf(function(l){return l==null})),dYt=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,je)=>{A=!0,j[ge]=je},"u"),oe=!S.some(ge=>Yk(ge,this.input,Z))||C&&!C(this.input)?kke:{matched:!0,value:h(A?bse in j?j[bse]: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=rFt){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 rFt(l){throw new Cke(l)}t(rFt,"F");function Tf(l){return l!=null&&Object.prototype.hasOwnProperty.call(l,"$ref")}t(Tf,"isReferenceObject");function py(l){return!Tf(l)}t(py,"isSchemaObject");function Sse(l){return l.type==="array"}t(Sse,"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(nFt(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 nFt=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"),O8=t(l=>l[1]==="/"?l:"#/"+l.slice(1),"autocorrectRef"),pR=t(l=>O8(l).split("/").at(-1),"getSchemaNameByRef");function Dke(l){let f=iFt(l).normalize("NFKD").trim().replace(/\s+/g,"_").replace(/--+/g,"-").replace(/-+/g,"_").replace(/[^\w-]+/g,"_");return _y(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 iFt(l){let f=Number(l[0]);return typeof f=="number"&&!Number.isNaN(f)?"_"+l:l}t(iFt,"prefixStringStartingWithNumberIfNeeded");function Ike(l){let f=l.replaceAll("_","#");return _y(f.replaceAll("-","_")).replaceAll("#","_")}t(Ike,"pathParamToVariableName");var F8=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 xse(l){return!(l>=200&&l<300)}t(xse,"isErrorStatus");function Tse(l){return l.startsWith("application/")}t(Tse,"isMediaTypeAllowed");var RZe=/({\w+})/g,sFt=/[^\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(sFt,"_")}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&&py(l.schema)&&l.schema.type==="string";return h&&S},"isSortingParameterObject"),M8=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(cFt(l))).with("number","integer",()=>S.push(uFt(l))).with("array",()=>S.push(fFt(l))).otherwise(()=>{}),typeof l.description=="string"&&l.description!==""&&h.withDescription&&([`
|
|
568
|
+
`,"f"),xo(this,Ag,Zt(this,Ag,"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,nse,"f")[S]||(Zt(this,Bc,"f").process.emitWarning(f,h),Zt(this,nse,"f")[S]=!0)}[zQe](){Zt(this,ise,"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,T8,"f"),strictCommands:Zt(this,C8,"f"),strictOptions:Zt(this,k8,"f"),completionCommand:Zt(this,Qb,"f"),output:Zt(this,Ag,"f"),exitError:Zt(this,V6,"f"),hasOutput:Zt(this,Zb,"f"),parsed:this.parsed,parseFn:Zt(this,Xb,"f"),parseContext:Zt(this,S8,"f")}),Zt(this,il,"f").freeze(),Zt(this,sm,"f").freeze(),Zt(this,Om,"f").freeze(),Zt(this,$S,"f").freeze()}[VQe](){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[nZe](Zt(this,v8,"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}[E8](){return Zt(this,ose,"f")}[UQe](){return Zt(this,lse,"f")}[ske](){if(!Zt(this,b8,"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(/[.:].*/,""))}[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,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,lR,"f")[h])return Zt(this,lR,"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"});_1(A,void 0,Zt(this,Bc,"f")),S=JSON.parse(Zt(this,Bc,"f").readFileSync(A,"utf8"))}catch{}return Zt(this,lR,"f")[h]=S||{},Zt(this,lR,"f")[h]}[W6](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,je,Ae,_e;let Lt=Zt(this,ise,"f").pop();_1(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,JS,tt,"f")}}.value,groups:{set value(tt){xo(S,Hk,tt,"f")}}.value,output:{set value(tt){xo(C,Ag,tt,"f")}}.value,exitError:{set value(tt){xo(A,V6,tt,"f")}}.value,hasOutput:{set value(tt){xo(j,Zb,tt,"f")}}.value,parsed:this.parsed,strict:{set value(tt){xo(Z,T8,tt,"f")}}.value,strictCommands:{set value(tt){xo(oe,C8,tt,"f")}}.value,strictOptions:{set value(tt){xo(ge,k8,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,S8,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,$S,"f").unfreeze()}[GQe](f,h){return y8(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[E8].bind(this),getUsageConfiguration:this[UQe].bind(this),getUsageInstance:this[eZe].bind(this),getValidationInstance:this[tZe].bind(this),hasParseCallback:this[use].bind(this),isGlobalContext:this[rZe].bind(this),postProcess:this[P8].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,Om,"f")}[ZQe](){return Zt(this,GV,"f")}[XQe](){return Zt(this,Zb,"f")}[YQe](){return Zt(this,cR,"f")}[KQe](){return Zt(this,S8,"f")||{}}[eZe](){return Zt(this,il,"f")}[tZe](){return Zt(this,sm,"f")}[use](){return!!Zt(this,Xb,"f")}[rZe](){return Zt(this,sse,"f")}[P8](f,h,S,C){return S||Wp(f)||(h||(f=this[JQe](f)),(this[E8]()["parse-positional-numbers"]||this[E8]()["parse-positional-numbers"]===void 0)&&(f=this[HQe](f)),C&&(f=g8(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,x8,"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]=q6(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,Bc,"f")),"f"),xo(this,sm,Zt(this,sm,"f")?Zt(this,sm,"f").reset(S):jQe(this,Zt(this,il,"f"),Zt(this,Bc,"f")),"f"),xo(this,Om,Zt(this,Om,"f")?Zt(this,Om,"f").reset():DQe(Zt(this,il,"f"),Zt(this,sm,"f"),Zt(this,$S,"f"),Zt(this,Bc,"f")),"f"),Zt(this,BS,"f")||xo(this,BS,MQe(this,Zt(this,il,"f"),Zt(this,Om,"f"),Zt(this,Bc,"f")),"f"),Zt(this,$S,"f").reset(),xo(this,Qb,null,"f"),xo(this,Ag,"","f"),xo(this,V6,null,"f"),xo(this,Zb,!1,"f"),this.parsed=!1,this}[nZe](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,U6,"f"),Zt(this,Bo,"f").__=Zt(this,Bc,"f").y18n.__,Zt(this,Bo,"f").configuration=this[E8]();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,S8,"f")),Ae,_e=ge.aliases,Lt=!1,ot=!1;Object.keys(je).forEach(tt=>{tt===Zt(this,qS,"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[P8](je,Z,!!S,!1);Zt(this,qS,"f")&&[Zt(this,qS,"f")].concat(_e[Zt(this,qS,"f")]||[]).filter($i=>$i.length>1).includes(""+je._[je._.length-1])&&(je._.pop(),Lt=!0),xo(this,sse,!1,"f");let tt=Zt(this,Om,"f").getCommands(),Ut=Zt(this,BS,"f").completionKey in je,jr=Lt||Ut||A;if(je._.length){if(tt.length){let Un;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[P8](xi,Z,!!S,!1)}else if(!Un&&is!==Zt(this,Qb,"f")){Un=is;break}!Zt(this,Om,"f").hasDefaultCommand()&&Zt(this,cse,"f")&&Un&&!jr&&Zt(this,sm,"f").recommendCommands(Un,tt)}Zt(this,Qb,"f")&&je._.includes(Zt(this,Qb,"f"))&&!Ut&&(Zt(this,JS,"f")&&z6(!0),this.showCompletionScript(),this.exit(0))}if(Zt(this,Om,"f").hasDefaultCommand()&&!jr){let Un=Zt(this,Om,"f").runCommand(null,this,ge,0,A,Lt||ot||A);return this[P8](Un,Z,!!S,!1)}if(Ut){Zt(this,JS,"f")&&z6(!0),f=[].concat(f);let Un=f.slice(f.indexOf(`--${Zt(this,BS,"f").completionKey}`)+1);return Zt(this,BS,"f").getCompletion(Un,($i,is)=>{if($i)throw new Up($i.message);(is||[]).forEach(xi=>{Zt(this,cR,"f").log(xi)}),this.exit(0)}),this[P8](je,!Z,!!S,!1)}if(Zt(this,Zb,"f")||(Lt?(Zt(this,JS,"f")&&z6(!0),j=!0,this.showHelp("log"),this.exit(0)):ot&&(Zt(this,JS,"f")&&z6(!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(Un=>Zt(this,Bo,"f").skipValidation.indexOf(Un)>=0&&je[Un]===!0)),!j){if(ge.error)throw new Up(ge.error.message);if(!Ut){let Un=this[pke](_e,{},ge.error);S||(Ae=g8(je,this,Zt(this,$S,"f").getMiddleware(),!0)),Ae=this[GQe](Un,Ae??je),Wp(Ae)&&!S&&(Ae=Ae.then(()=>g8(je,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[P8](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,C8,"f")&&(Z=Zt(this,sm,"f").unknownCommands(j)),Zt(this,T8,"f")&&!Z?Zt(this,sm,"f").unknownArguments(j,f,h,!!C):Zt(this,k8,"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")}[w8](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 W5t=sZe(GCe),aZe=W5t;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 D8(l,f){l instanceof Error?console.log((0,ZV.styleText)("red",`[ERROR] ${f||l.message}`)):console.log((0,ZV.styleText)("red",`[ERROR] ${l}`))}t(D8,"logError");function fse(l){console.log((0,ZV.styleText)("bgYellow",`==== ${l} ====`))}t(fse,"logBanner");var oZe=jh(require("fs"));function fR(){return"2.0.8-rc.5"}t(fR,"getVersion");var HXt=jh(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 _se(l){return async f=>f.options(H5t(l)).middleware(async h=>await G5t(l,h),!0)}t(_se,"getBuilder");function H5t(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(H5t,"getYargsOptions");async function G5t(l,f){let h=new l;for(let[S,C]of Object.entries(uZe(l)))h[S]=f[S]??C.default;return h}t(G5t,"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"),H6=t(l=>l.charAt(0).toLowerCase()+l.slice(1),"decapitalize"),YV=t(l=>l.replace(/(-\w)/g,f=>f[1].toUpperCase()),"kebabToCamel"),_y=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"),Q5t=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=>Z5t(mZe(y_(h))));return Q5t(f)},"getMostCommonAdjacentCombinationSplit"),mZe=t(l=>l.split(/(?<![A-Z])(?=[A-Z])/).filter(Boolean),"splitByUppercase"),pse=t(l=>mZe(l).join(" "),"camelToSpaceSeparated"),Z5t=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(`(${H6(h)}|${y_(h)})[a-z]*(?=$|[A-Z])`,"g");return l.replace(S,"")},"removeWord");function A8(l){return pZe(l)}t(A8,"formatTag");function G6(l,f){var S;let h=(S=l.tags)==null?void 0:S[0];return A8(h??f.defaultTag)}t(G6,"getOperationTag");function yv(l,f){var S;let h=f.splitByTags?(S=l.tags)==null?void 0:S[0]:f.defaultTag;return A8(h??f.defaultTag)}t(yv,"getEndpointTag");function gZe(l,f){return f.excludeTags.some(h=>h.toLowerCase()===l.toLowerCase())}t(gZe,"isTagExcluded");var I8="application/json",bke={"Content-Type":I8,Accept:I8},dse="data",Ske="axios",Q6="config",Qk="AxiosRequestConfig",mse={defaultImport:Ske,bindings:[Qk],from:"axios"};var zw=jh(hse()),xke=2,yZe=["application/octet-stream","multipart/form-data","application/x-www-form-urlencoded","*/*"],vZe=["query","header","path"],N8=[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()",gse="z.instanceof(Blob)",tU="z.enum",PZe="z.int()",wZe="z.number()",yse="z.string()",DZe="z.email()",AZe="z.url()",IZe="z.uuid()",NZe="z.iso.datetime({ offset: true })",X6={bindings:["z"],from:"zod"};var Vw=Symbol.for("@ts-pattern/matcher"),K5t=Symbol.for("@ts-pattern/isVariadic"),bse="@ts-pattern/anonymous-select-key",Tke=t(l=>!!(l&&typeof l=="object"),"r"),vse=t(l=>l&&!!l[Vw],"i"),Yk=t((l,f,h)=>{if(vse(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];vse(Z)&&Z[K5t]?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||vse(A=C)&&A[Vw]().matcherType==="optional")&&Yk(C,f[S],h);var A})}return Object.is(f,l)},"o"),r4=t(l=>{var f,h,S;return Tke(l)?vse(l)?(f=(h=(S=l[Vw]()).getSelectionKeys)==null?void 0:h.call(S))!=null?f:[]:Array.isArray(l)?nU(l,r4):nU(Object.values(l),r4):[]},"s"),nU=t((l,f)=>l.reduce((h,S)=>h.concat(f(S)),[]),"c");function Yb(l){return Object.assign(l,{optional:t(()=>eFt(l),"optional"),and:t(f=>id(l,f),"and"),or:t(f=>tFt(l,f),"or"),select:t(f=>f===void 0?OZe(l):OZe(f,l),"select")})}t(Yb,"a");function eFt(l){return Yb({[Vw]:()=>({match:t(f=>{let h={},S=t((C,A)=>{h[C]=A},"r");return f===void 0?(r4(l).forEach(C=>S(C,void 0)),{matched:!0,selections:h}):{matched:Yk(l,f,S),selections:h}},"match"),getSelectionKeys:t(()=>r4(l),"getSelectionKeys"),matcherType:"optional"})})}t(eFt,"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,r4),"getSelectionKeys"),matcherType:"and"})})}t(id,"d");function tFt(...l){return Yb({[Vw]:()=>({match:t(f=>{let h={},S=t((C,A)=>{h[C]=A},"r");return nU(l,r4).forEach(C=>S(C,void 0)),{matched:l.some(C=>Yk(C,f,S)),selections:h}},"match"),getSelectionKeys:t(()=>nU(l,r4),"getSelectionKeys"),matcherType:"or"})})}t(tFt,"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??bse]:S};return{matched:h===void 0||Yk(h,S,(A,j)=>{C[A]=j}),selections:C}},"match"),getSelectionKeys:t(()=>[f??bse].concat(h===void 0?[]:r4(h)),"getSelectionKeys")})})}t(OZe,"v");function FZe(l){return!0}t(FZe,"b");function Zk(l){return typeof l=="number"}t(Zk,"w");function Y6(l){return typeof l=="string"}t(Y6,"S");function K6(l){return typeof l=="bigint"}t(K6,"j");var aYt=Yb(xf(FZe)),oYt=Yb(xf(FZe));var e4=t(l=>Object.assign(Yb(l),{startsWith:t(f=>{return e4(id(l,(h=f,xf(S=>Y6(S)&&S.startsWith(h)))));var h},"startsWith"),endsWith:t(f=>{return e4(id(l,(h=f,xf(S=>Y6(S)&&S.endsWith(h)))));var h},"endsWith"),minLength:t(f=>e4(id(l,(h=>xf(S=>Y6(S)&&S.length>=h))(f))),"minLength"),length:t(f=>e4(id(l,(h=>xf(S=>Y6(S)&&S.length===h))(f))),"length"),maxLength:t(f=>e4(id(l,(h=>xf(S=>Y6(S)&&S.length<=h))(f))),"maxLength"),includes:t(f=>{return e4(id(l,(h=f,xf(S=>Y6(S)&&S.includes(h)))));var h},"includes"),regex:t(f=>{return e4(id(l,(h=f,xf(S=>Y6(S)&&!!S.match(h)))));var h},"regex")}),"x"),cYt=e4(xf(Y6)),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"),lYt=Xk(xf(Zk)),t4=t(l=>Object.assign(Yb(l),{between:t((f,h)=>t4(id(l,((S,C)=>xf(A=>K6(A)&&S<=A&&C>=A))(f,h))),"between"),lt:t(f=>t4(id(l,(h=>xf(S=>K6(S)&&S<h))(f))),"lt"),gt:t(f=>t4(id(l,(h=>xf(S=>K6(S)&&S>h))(f))),"gt"),lte:t(f=>t4(id(l,(h=>xf(S=>K6(S)&&S<=h))(f))),"lte"),gte:t(f=>t4(id(l,(h=>xf(S=>K6(S)&&S>=h))(f))),"gte"),positive:t(()=>t4(id(l,xf(f=>K6(f)&&f>0))),"positive"),negative:t(()=>t4(id(l,xf(f=>K6(f)&&f<0))),"negative")}),"k"),uYt=t4(xf(K6)),fYt=Yb(xf(function(l){return typeof l=="boolean"})),_Yt=Yb(xf(function(l){return typeof l=="symbol"})),pYt=Yb(xf(function(l){return l==null})),dYt=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,je)=>{A=!0,j[ge]=je},"u"),oe=!S.some(ge=>Yk(ge,this.input,Z))||C&&!C(this.input)?kke:{matched:!0,value:h(A?bse in j?j[bse]: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=rFt){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 rFt(l){throw new Cke(l)}t(rFt,"F");function Tf(l){return l!=null&&Object.prototype.hasOwnProperty.call(l,"$ref")}t(Tf,"isReferenceObject");function py(l){return!Tf(l)}t(py,"isSchemaObject");function Sse(l){return l.type==="array"}t(Sse,"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(nFt(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 nFt=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"),O8=t(l=>l[1]==="/"?l:"#/"+l.slice(1),"autocorrectRef"),pR=t(l=>O8(l).split("/").at(-1),"getSchemaNameByRef");function Dke(l){let f=iFt(l).normalize("NFKD").trim().replace(/\s+/g,"_").replace(/--+/g,"-").replace(/-+/g,"_").replace(/[^\w-]+/g,"_");return _y(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 iFt(l){let f=Number(l[0]);return typeof f=="number"&&!Number.isNaN(f)?"_"+l:l}t(iFt,"prefixStringStartingWithNumberIfNeeded");function Ike(l){let f=l.replaceAll("_","#");return _y(f.replaceAll("-","_")).replaceAll("#","_")}t(Ike,"pathParamToVariableName");var F8=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 xse(l){return!(l>=200&&l<300)}t(xse,"isErrorStatus");function Tse(l){return l.startsWith("application/")}t(Tse,"isMediaTypeAllowed");var RZe=/({\w+})/g,sFt=/[^\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(sFt,"_")}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&&py(l.schema)&&l.schema.type==="string";return h&&S},"isSortingParameterObject"),M8=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(cFt(l))).with("number","integer",()=>S.push(uFt(l))).with("array",()=>S.push(fFt(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(aFt({schema:l,meta:f,options:h}),h.withDefaultValues!==!1?oFt(l):[]).filter(Boolean).join(".");return C?`.${C}`:""}t(eE,"getZodChain");function aFt({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(aFt,"getZodChainablePresence");function oFt(l){return l.default!==void 0?`default(${p1(l.type).with("number","integer",()=>jZe(l.default)).otherwise(()=>JSON.stringify(l.default))})`:""}t(oFt,"getZodChainableDefault");function cFt(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(${lFt(l.pattern)})`),f.join(".")}t(cFt,"getZodChainableStringValidations");function lFt(l){return l.startsWith("/")&&l.endsWith("/")&&(l=l.slice(1,-1)),l=BZe(l),`/${l}/`}t(lFt,"formatPatternIfNeeded");function uFt(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(uFt,"getZodChainableNumberValidations");function fFt(l){let f=[];return l.minItems&&f.push(`min(${l.minItems})`),l.maxItems&&f.push(`max(${l.maxItems})`),f.join(".")}t(fFt,"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||!py(C.schema)||C.schema.type!=="object")&&kse(C).forEach(j=>S.add(j)),S},new Set)}t(kse,"getSchemaRefs");var R8=t(l=>l.reduce((f,h)=>f+h,0),"sum");function Ig(l,f){if(!f)return l;if(Tf(f))return l+2;if(Array.isArray(f.type))return f.type.length===1?Kb("oneOf")+Ig(l,{...f,type:f.type[0]}):l+Kb("oneOf")+R8(f.type.map(h=>Ig(0,{...f,type:h})));if(f.oneOf)return f.oneOf.length===1?Kb("oneOf")+Ig(l,f.oneOf[0]):l+Kb("oneOf")+R8(f.oneOf.map(h=>Ig(0,h)));if(f.anyOf)return f.anyOf.length===1?Kb("anyOf")+Ig(l,f.anyOf[0]):l+Kb("anyOf")+R8(f.anyOf.map(h=>Ig(0,h)));if(f.allOf)return f.allOf.length===1?Kb("allOf")+Ig(l,f.allOf[0]):l+Kb("allOf")+R8(f.allOf.map(h=>Ig(0,h)));if(!f.type)return l;if(F8(f.type))return f.enum?l+zZe(f)+Kb("enum")+R8(f.enum.map(h=>Ig(0,h))):l+zZe(f);if(f.type==="array")return f.items?Kb("array")+Ig(l,f.items):Kb("array")+Ig(l);if(f.type==="object"||f.properties||f.additionalProperties){if(f.properties){let h=Object.values(f.properties);l+=Kb("object")+R8(h.map(S=>Ig(0,S)))}else l+=Kb("empty-object");f.additionalProperties&&(typeof f.additionalProperties=="object"?l+=Ig(0,f.additionalProperties):l+=Ig(1))}return l}t(Ig,"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 Ig(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(Tf(l))return _Ft({schema:l,zodSchema:C,resolver:f,meta:A,tag:S});let Z=dFt({schema:l,zodSchema:C,resolver:f,meta:A,tag:S});if(Z)return Z;let oe=pFt({schema:l,zodSchema:C,resolver:f,meta:A,tag:S});if(oe)return oe;let ge=mFt({schema:l,zodSchema:C,resolver:f,meta:A,tag:S});if(ge)return ge;let je=hFt({schema:l,zodSchema:C,resolver:f,meta:A,tag:S});if(je)return je;let Ae=gFt({schema:l,zodSchema:C,resolver:f,meta:A,tag:S});if(Ae)return Ae;let _e=f.options.allReadonly?".readonly()":"";if(Sse(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),jr="{}";l.properties&&(jr=`{ ${Object.entries(l.properties).map(([Tn,Wr])=>{var zr;let dl={...A,isRequired:Ut?!0:tt?(zr=l.required)==null?void 0:zr.includes(Tn):f.options.withImplicitRequiredProps,name:Tn,isParentPartial:Ut},pa=Wr;if(Tf(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=[...Tf(Wr)?[Wr.$ref]:[],...kse(Fa,{skipObjectSchema:!0})].some($o=>{var gr;return(gr=f.dependencyGraph.deepDependencyGraph[$o])==null?void 0:gr.has(Us)})),[Tn,Xr,Ps]}).map(([Tn,Wr,dl])=>dl?`get ${Ake(Tn)}() { return ${Wr} }`:`${Ake(Tn)}: ${Wr}`).join(", ")} }`);let Un="";l.additionalProperties&&(Un=`.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(${jr})${Ut?".partial()":""}${Un}${_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 _Ft({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(_Ft,"getReferenceZodSchema");function pFt({schema:l,zodSchema:f,resolver:h,meta:S,tag:C}){var j;if(!py(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=>py(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,7 +1,6 @@
|
|
|
1
1
|
import { useCallback, useEffect } from "react";
|
|
2
2
|
|
|
3
3
|
import { QueryKey, useQueryClient } from "@tanstack/react-query";
|
|
4
|
-
|
|
5
4
|
import { OpenApiQueryConfig, QueryModule, InvalidationMap } from "../lib/config/queryConfig.context";
|
|
6
5
|
import { broadcastQueryInvalidation, setupCrossTabListener } from "./useCrossTabQueryInvalidation";
|
|
7
6
|
|
|
@@ -28,43 +27,37 @@ export function useMutationEffects({ currentModule }: UseMutationEffectsProps) {
|
|
|
28
27
|
}, [queryClient, config.crossTabInvalidation]);
|
|
29
28
|
|
|
30
29
|
const runMutationEffects = useCallback(
|
|
31
|
-
async <TData, TVariables>(
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
updateKeys?: QueryKey[],
|
|
36
|
-
) => {
|
|
37
|
-
const {
|
|
38
|
-
invalidateCurrentModule = true,
|
|
39
|
-
invalidateModules,
|
|
40
|
-
invalidateKeys,
|
|
41
|
-
preferUpdate,
|
|
42
|
-
invalidationMap,
|
|
43
|
-
} = options;
|
|
44
|
-
const shouldUpdate = preferUpdate || (preferUpdate === undefined && config.preferUpdate);
|
|
45
|
-
const shouldInvalidateCurrentModule =
|
|
46
|
-
invalidateCurrentModule || (invalidateCurrentModule === undefined && config.invalidateCurrentModule);
|
|
30
|
+
async <TData, TVariables>(data: TData, variables: TVariables, options: MutationEffectsOptions = {}, updateKeys?: QueryKey[]) => {
|
|
31
|
+
const { invalidateCurrentModule, invalidateModules, invalidateKeys, preferUpdate } = options;
|
|
32
|
+
const shouldUpdate = preferUpdate ?? config.preferUpdate ?? false;
|
|
33
|
+
const shouldInvalidateCurrentModule = invalidateCurrentModule ?? config.invalidateCurrentModule ?? true;
|
|
47
34
|
|
|
48
35
|
const isQueryKeyEqual = (keyA: QueryKey, keyB: QueryKey) =>
|
|
49
36
|
keyA.length === keyB.length && keyA.every((item, index) => item === keyB[index]);
|
|
37
|
+
const isQueryKeyPrefix = (queryKey: QueryKey, prefixKey: QueryKey) =>
|
|
38
|
+
prefixKey.length <= queryKey.length && prefixKey.every((item, index) => item === queryKey[index]);
|
|
39
|
+
const mappedInvalidationKeys = config.invalidationMap?.[currentModule]?.(data, variables);
|
|
50
40
|
|
|
51
|
-
const
|
|
41
|
+
const shouldInvalidateQuery = (queryKey: QueryKey) => {
|
|
42
|
+
const isUpdateKey = updateKeys?.some((key) => isQueryKeyEqual(queryKey, key));
|
|
43
|
+
if (shouldUpdate && isUpdateKey) {
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
52
46
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
47
|
+
const isCurrentModule = shouldInvalidateCurrentModule && queryKey[0] === currentModule;
|
|
48
|
+
const isInvalidateModule = !!invalidateModules && invalidateModules.some((module) => queryKey[0] === module);
|
|
49
|
+
const isInvalidateKey = !!invalidateKeys && invalidateKeys.some((key) => isQueryKeyPrefix(queryKey, key));
|
|
50
|
+
const isMappedKey =
|
|
51
|
+
!!mappedInvalidationKeys && mappedInvalidationKeys.some((key) => isQueryKeyPrefix(queryKey, key));
|
|
59
52
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
const isInvalidateKey = !!invalidateKeys && invalidateKeys.some((key) => isQueryKeyEqual(queryKey, key));
|
|
53
|
+
return isCurrentModule || isInvalidateModule || isInvalidateKey || isMappedKey;
|
|
54
|
+
};
|
|
63
55
|
|
|
64
|
-
|
|
65
|
-
const isMappedKey = !!map && map.some((key) => isQueryKeyEqual(queryKey, key));
|
|
56
|
+
const invalidatedQueryKeys: QueryKey[] = [];
|
|
66
57
|
|
|
67
|
-
|
|
58
|
+
queryClient.invalidateQueries({
|
|
59
|
+
predicate: ({ queryKey }) => {
|
|
60
|
+
const shouldInvalidate = shouldInvalidateQuery(queryKey);
|
|
68
61
|
|
|
69
62
|
if (shouldInvalidate && config.crossTabInvalidation) {
|
|
70
63
|
invalidatedQueryKeys.push([...queryKey]);
|
|
@@ -82,7 +75,14 @@ export function useMutationEffects({ currentModule }: UseMutationEffectsProps) {
|
|
|
82
75
|
updateKeys.map((queryKey) => queryClient.setQueryData(queryKey, data));
|
|
83
76
|
}
|
|
84
77
|
},
|
|
85
|
-
[
|
|
78
|
+
[
|
|
79
|
+
queryClient,
|
|
80
|
+
currentModule,
|
|
81
|
+
config.preferUpdate,
|
|
82
|
+
config.invalidateCurrentModule,
|
|
83
|
+
config.invalidationMap,
|
|
84
|
+
config.crossTabInvalidation,
|
|
85
|
+
],
|
|
86
86
|
);
|
|
87
87
|
|
|
88
88
|
return { runMutationEffects };
|