@povio/openapi-codegen-cli 0.12.0 → 0.12.1

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/index.js CHANGED
@@ -69,7 +69,7 @@ Expecting `+pn.join(", ")+", got '"+(this.terminals_[$]||$)+"'":nc="Parse error
69
69
  return undefined
70
70
  }
71
71
  `.trim()},"lookupPropertyFunctionVarDeclaration"),blockValue:o(function(t){var r=this.aliasable("container.hooks.blockHelperMissing"),n=[this.contextName(0)];this.setupHelperArgs(t,0,n);var i=this.popStack();n.splice(1,0,i),this.push(this.source.functionCall(r,"call",n))},"blockValue"),ambiguousBlockValue:o(function(){var t=this.aliasable("container.hooks.blockHelperMissing"),r=[this.contextName(0)];this.setupHelperArgs("",0,r,!0),this.flushInline();var n=this.topStack();r.splice(1,0,n),this.pushSource(["if (!",this.lastHelper,") { ",n," = ",this.source.functionCall(t,"call",r),"}"])},"ambiguousBlockValue"),appendContent:o(function(t){this.pendingContent?t=this.pendingContent+t:this.pendingLocation=this.source.currentLocation,this.pendingContent=t},"appendContent"),append:o(function(){if(this.isInline())this.replaceStack(function(r){return[" != null ? ",r,' : ""']}),this.pushSource(this.appendToBuffer(this.popStack()));else{var t=this.popStack();this.pushSource(["if (",t," != null) { ",this.appendToBuffer(t,void 0,!0)," }"]),this.environment.isSimple&&this.pushSource(["else { ",this.appendToBuffer("''",void 0,!0)," }"])}},"append"),appendEscaped:o(function(){this.pushSource(this.appendToBuffer([this.aliasable("container.escapeExpression"),"(",this.popStack(),")"]))},"appendEscaped"),getContext:o(function(t){this.lastContext=t},"getContext"),pushContext:o(function(){this.pushStackLiteral(this.contextName(this.lastContext))},"pushContext"),lookupOnContext:o(function(t,r,n,i){var s=0;!i&&this.options.compat&&!this.lastContext?this.push(this.depthedLookup(t[s++])):this.pushContext(),this.resolvePath("context",t,s,r,n)},"lookupOnContext"),lookupBlockParam:o(function(t,r){this.useBlockParams=!0,this.push(["blockParams[",t[0],"][",t[1],"]"]),this.resolvePath("context",r,1)},"lookupBlockParam"),lookupData:o(function(t,r,n){t?this.pushStackLiteral("container.data(data, "+t+")"):this.pushStackLiteral("data"),this.resolvePath("data",r,0,!0,n)},"lookupData"),resolvePath:o(function(t,r,n,i,s){var a=this;if(this.options.strict||this.options.assumeObjects){this.push(n3(this.options.strict&&s,this,r,n,t));return}for(var c=r.length;n<c;n++)this.replaceStack(function(u){var l=a.nameLookup(u,r[n],t);return i?[" && ",l]:[" != null ? ",l," : ",u]})},"resolvePath"),resolvePossibleLambda:o(function(){this.push([this.aliasable("container.lambda"),"(",this.popStack(),", ",this.contextName(0),")"])},"resolvePossibleLambda"),pushStringParam:o(function(t,r){this.pushContext(),this.pushString(r),r!=="SubExpression"&&(typeof t=="string"?this.pushString(t):this.pushStackLiteral(t))},"pushStringParam"),emptyHash:o(function(t){this.trackIds&&this.push("{}"),this.stringParams&&(this.push("{}"),this.push("{}")),this.pushStackLiteral(t?"undefined":"{}")},"emptyHash"),pushHash:o(function(){this.hash&&this.hashes.push(this.hash),this.hash={values:{},types:[],contexts:[],ids:[]}},"pushHash"),popHash:o(function(){var t=this.hash;this.hash=this.hashes.pop(),this.trackIds&&this.push(this.objectLiteral(t.ids)),this.stringParams&&(this.push(this.objectLiteral(t.contexts)),this.push(this.objectLiteral(t.types))),this.push(this.objectLiteral(t.values))},"popHash"),pushString:o(function(t){this.pushStackLiteral(this.quotedString(t))},"pushString"),pushLiteral:o(function(t){this.pushStackLiteral(t)},"pushLiteral"),pushProgram:o(function(t){t!=null?this.pushStackLiteral(this.programExpression(t)):this.pushStackLiteral(null)},"pushProgram"),registerDecorator:o(function(t,r){var n=this.nameLookup("decorators",r,"decorator"),i=this.setupHelperArgs(r,t);this.decorators.push(["fn = ",this.decorators.functionCall(n,"",["fn","props","container",i])," || fn;"])},"registerDecorator"),invokeHelper:o(function(t,r,n){var i=this.popStack(),s=this.setupHelper(t,r),a=[];n&&a.push(s.name),a.push(i),this.options.strict||a.push(this.aliasable("container.hooks.helperMissing"));var c=["(",this.itemsSeparatedBy(a,"||"),")"],u=this.source.functionCall(c,"call",s.callParams);this.push(u)},"invokeHelper"),itemsSeparatedBy:o(function(t,r){var n=[];n.push(t[0]);for(var i=1;i<t.length;i++)n.push(r,t[i]);return n},"itemsSeparatedBy"),invokeKnownHelper:o(function(t,r){var n=this.setupHelper(t,r);this.push(this.source.functionCall(n.name,"call",n.callParams))},"invokeKnownHelper"),invokeAmbiguous:o(function(t,r){this.useRegister("helper");var n=this.popStack();this.emptyHash();var i=this.setupHelper(0,t,r),s=this.lastHelper=this.nameLookup("helpers",t,"helper"),a=["(","(helper = ",s," || ",n,")"];this.options.strict||(a[0]="(helper = ",a.push(" != null ? helper : ",this.aliasable("container.hooks.helperMissing"))),this.push(["(",a,i.paramsInit?["),(",i.paramsInit]:[],"),","(typeof helper === ",this.aliasable('"function"')," ? ",this.source.functionCall("helper","call",i.callParams)," : helper))"])},"invokeAmbiguous"),invokePartial:o(function(t,r,n){var i=[],s=this.setupParams(r,1,i);t&&(r=this.popStack(),delete s.name),n&&(s.indent=JSON.stringify(n)),s.helpers="helpers",s.partials="partials",s.decorators="container.decorators",t?i.unshift(r):i.unshift(this.nameLookup("partials",r,"partial")),this.options.compat&&(s.depths="depths"),s=this.objectLiteral(s),i.push(s),this.push(this.source.functionCall("container.invokePartial","",i))},"invokePartial"),assignToHash:o(function(t){var r=this.popStack(),n=void 0,i=void 0,s=void 0;this.trackIds&&(s=this.popStack()),this.stringParams&&(i=this.popStack(),n=this.popStack());var a=this.hash;n&&(a.contexts[t]=n),i&&(a.types[t]=i),s&&(a.ids[t]=s),a.values[t]=r},"assignToHash"),pushId:o(function(t,r,n){t==="BlockParam"?this.pushStackLiteral("blockParams["+r[0]+"].path["+r[1]+"]"+(n?" + "+JSON.stringify("."+n):"")):t==="PathExpression"?this.pushString(r):t==="SubExpression"?this.pushStackLiteral("true"):this.pushStackLiteral("null")},"pushId"),compiler:mi,compileChildren:o(function(t,r){for(var n=t.children,i=void 0,s=void 0,a=0,c=n.length;a<c;a++){i=n[a],s=new this.compiler;var u=this.matchExistingProgram(i);if(u==null){this.context.programs.push("");var l=this.context.programs.length;i.index=l,i.name="program"+l,this.context.programs[l]=s.compile(i,r,this.context,!this.precompile),this.context.decorators[l]=s.decorators,this.context.environments[l]=i,this.useDepths=this.useDepths||s.useDepths,this.useBlockParams=this.useBlockParams||s.useBlockParams,i.useDepths=this.useDepths,i.useBlockParams=this.useBlockParams}else i.index=u.index,i.name="program"+u.index,this.useDepths=this.useDepths||u.useDepths,this.useBlockParams=this.useBlockParams||u.useBlockParams}},"compileChildren"),matchExistingProgram:o(function(t){for(var r=0,n=this.context.environments.length;r<n;r++){var i=this.context.environments[r];if(i&&i.equals(t))return i}},"matchExistingProgram"),programExpression:o(function(t){var r=this.environment.children[t],n=[r.index,"data",r.blockParams];return(this.useBlockParams||this.useDepths)&&n.push("blockParams"),this.useDepths&&n.push("depths"),"container.program("+n.join(", ")+")"},"programExpression"),useRegister:o(function(t){this.registers[t]||(this.registers[t]=!0,this.registers.list.push(t))},"useRegister"),push:o(function(t){return t instanceof di||(t=this.source.wrap(t)),this.inlineStack.push(t),t},"push"),pushStackLiteral:o(function(t){this.push(new di(t))},"pushStackLiteral"),pushSource:o(function(t){this.pendingContent&&(this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent),this.pendingLocation)),this.pendingContent=void 0),t&&this.source.push(t)},"pushSource"),replaceStack:o(function(t){var r=["("],n=void 0,i=void 0,s=void 0;if(!this.isInline())throw new cd.default("replaceStack on non-inline");var a=this.popStack(!0);if(a instanceof di)n=[a.value],r=["(",n],s=!0;else{i=!0;var c=this.incrStack();r=["((",this.push(c)," = ",a,")"],n=this.topStack()}var u=t.call(this,n);s||this.popStack(),i&&this.stackSlot--,this.push(r.concat(u,")"))},"replaceStack"),incrStack:o(function(){return this.stackSlot++,this.stackSlot>this.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),this.topStackName()},"incrStack"),topStackName:o(function(){return"stack"+this.stackSlot},"topStackName"),flushInline:o(function(){var t=this.inlineStack;this.inlineStack=[];for(var r=0,n=t.length;r<n;r++){var i=t[r];if(i instanceof di)this.compileStack.push(i);else{var s=this.incrStack();this.pushSource([s," = ",i,";"]),this.compileStack.push(s)}}},"flushInline"),isInline:o(function(){return this.inlineStack.length},"isInline"),popStack:o(function(t){var r=this.isInline(),n=(r?this.inlineStack:this.compileStack).pop();if(!t&&n instanceof di)return n.value;if(!r){if(!this.stackSlot)throw new cd.default("Invalid stack pop");this.stackSlot--}return n},"popStack"),topStack:o(function(){var t=this.isInline()?this.inlineStack:this.compileStack,r=t[t.length-1];return r instanceof di?r.value:r},"topStack"),contextName:o(function(t){return this.useDepths&&t?"depths["+t+"]":"depth"+t},"contextName"),quotedString:o(function(t){return this.source.quotedString(t)},"quotedString"),objectLiteral:o(function(t){return this.source.objectLiteral(t)},"objectLiteral"),aliasable:o(function(t){var r=this.aliases[t];return r?(r.referenceCount++,r):(r=this.aliases[t]=this.source.wrap(t),r.aliasable=!0,r.referenceCount=1,r)},"aliasable"),setupHelper:o(function(t,r,n){var i=[],s=this.setupHelperArgs(r,t,i,n),a=this.nameLookup("helpers",r,"helper"),c=this.aliasable(this.contextName(0)+" != null ? "+this.contextName(0)+" : (container.nullContext || {})");return{params:i,paramsInit:s,name:a,callParams:[c].concat(i)}},"setupHelper"),setupParams:o(function(t,r,n){var i={},s=[],a=[],c=[],u=!n,l=void 0;u&&(n=[]),i.name=this.quotedString(t),i.hash=this.popStack(),this.trackIds&&(i.hashIds=this.popStack()),this.stringParams&&(i.hashTypes=this.popStack(),i.hashContexts=this.popStack());var f=this.popStack(),p=this.popStack();(p||f)&&(i.fn=p||"container.noop",i.inverse=f||"container.noop");for(var d=r;d--;)l=this.popStack(),n[d]=l,this.trackIds&&(c[d]=this.popStack()),this.stringParams&&(a[d]=this.popStack(),s[d]=this.popStack());return u&&(i.args=this.source.generateArray(n)),this.trackIds&&(i.ids=this.source.generateArray(c)),this.stringParams&&(i.types=this.source.generateArray(a),i.contexts=this.source.generateArray(s)),this.options.data&&(i.data="data"),this.useBlockParams&&(i.blockParams="blockParams"),i},"setupParams"),setupHelperArgs:o(function(t,r,n,i){var s=this.setupParams(t,r,n);return s.loc=JSON.stringify(this.source.currentLocation),s=this.objectLiteral(s),i?(this.useRegister("options"),n.push("options"),["options=",s]):n?(n.push(s),""):s},"setupHelperArgs")};(function(){for(var e="break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield await null true false".split(" "),t=mi.RESERVED_WORDS={},r=0,n=e.length;r<n;r++)t[e[r]]=!0})();mi.isValidJavaScriptVariableName=function(e){return!mi.RESERVED_WORDS[e]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(e)};function n3(e,t,r,n,i){var s=t.popStack(),a=r.length;for(e&&a--;n<a;n++)s=t.nameLookup(s,r[n],i);return e?[t.aliasable("container.strict"),"(",s,", ",t.quotedString(r[n]),", ",JSON.stringify(t.source.currentLocation)," )"]:s}o(n3,"strictLookup");Xa.default=mi;uP.exports=Xa.default});var dP=h((ec,fP)=>{"use strict";ec.__esModule=!0;function Vo(e){return e&&e.__esModule?e:{default:e}}o(Vo,"_interopRequireDefault");var i3=m_(),o3=Vo(i3),s3=Lf(),a3=Vo(s3),ud=w_(),ld=R_(),c3=lP(),u3=Vo(c3),l3=Ua(),p3=Vo(l3),f3=jf(),d3=Vo(f3),m3=o3.default.create;function pP(){var e=m3();return e.compile=function(t,r){return ld.compile(t,r,e)},e.precompile=function(t,r){return ld.precompile(t,r,e)},e.AST=a3.default,e.Compiler=ld.Compiler,e.JavaScriptCompiler=u3.default,e.Parser=ud.parser,e.parse=ud.parse,e.parseWithoutProcessing=ud.parseWithoutProcessing,e}o(pP,"create");var hi=pP();hi.create=pP;d3.default(hi);hi.Visitor=p3.default;hi.default=hi;ec.default=hi;fP.exports=ec.default});var mP=h(tc=>{"use strict";tc.__esModule=!0;tc.print=v3;tc.PrintVisitor=W;function h3(e){return e&&e.__esModule?e:{default:e}}o(h3,"_interopRequireDefault");var g3=Ua(),y3=h3(g3);function v3(e){return new W().accept(e)}o(v3,"print");function W(){this.padding=0}o(W,"PrintVisitor");W.prototype=new y3.default;W.prototype.pad=function(e){for(var t="",r=0,n=this.padding;r<n;r++)t+=" ";return t+=e+`
72
- `,t};W.prototype.Program=function(e){var t="",r=e.body,n=void 0,i=void 0;if(e.blockParams){var s="BLOCK PARAMS: [";for(n=0,i=e.blockParams.length;n<i;n++)s+=" "+e.blockParams[n];s+=" ]",t+=this.pad(s)}for(n=0,i=r.length;n<i;n++)t+=this.accept(r[n]);return this.padding--,t};W.prototype.MustacheStatement=function(e){return this.pad("{{ "+this.SubExpression(e)+" }}")};W.prototype.Decorator=function(e){return this.pad("{{ DIRECTIVE "+this.SubExpression(e)+" }}")};W.prototype.BlockStatement=W.prototype.DecoratorBlock=function(e){var t="";return t+=this.pad((e.type==="DecoratorBlock"?"DIRECTIVE ":"")+"BLOCK:"),this.padding++,t+=this.pad(this.SubExpression(e)),e.program&&(t+=this.pad("PROGRAM:"),this.padding++,t+=this.accept(e.program),this.padding--),e.inverse&&(e.program&&this.padding++,t+=this.pad("{{^}}"),this.padding++,t+=this.accept(e.inverse),this.padding--,e.program&&this.padding--),this.padding--,t};W.prototype.PartialStatement=function(e){var t="PARTIAL:"+e.name.original;return e.params[0]&&(t+=" "+this.accept(e.params[0])),e.hash&&(t+=" "+this.accept(e.hash)),this.pad("{{> "+t+" }}")};W.prototype.PartialBlockStatement=function(e){var t="PARTIAL BLOCK:"+e.name.original;return e.params[0]&&(t+=" "+this.accept(e.params[0])),e.hash&&(t+=" "+this.accept(e.hash)),t+=" "+this.pad("PROGRAM:"),this.padding++,t+=this.accept(e.program),this.padding--,this.pad("{{> "+t+" }}")};W.prototype.ContentStatement=function(e){return this.pad("CONTENT[ '"+e.value+"' ]")};W.prototype.CommentStatement=function(e){return this.pad("{{! '"+e.value+"' }}")};W.prototype.SubExpression=function(e){for(var t=e.params,r=[],n=void 0,i=0,s=t.length;i<s;i++)r.push(this.accept(t[i]));return t="["+r.join(", ")+"]",n=e.hash?" "+this.accept(e.hash):"",this.accept(e.path)+" "+t+n};W.prototype.PathExpression=function(e){var t=e.parts.join("/");return(e.data?"@":"")+"PATH:"+t};W.prototype.StringLiteral=function(e){return'"'+e.value+'"'};W.prototype.NumberLiteral=function(e){return"NUMBER{"+e.value+"}"};W.prototype.BooleanLiteral=function(e){return"BOOLEAN{"+e.value+"}"};W.prototype.UndefinedLiteral=function(){return"UNDEFINED"};W.prototype.NullLiteral=function(){return"NULL"};W.prototype.Hash=function(e){for(var t=e.pairs,r=[],n=0,i=t.length;n<i;n++)r.push(this.accept(t[n]));return"HASH{"+r.join(", ")+"}"};W.prototype.HashPair=function(e){return e.key+"="+this.accept(e.value)}});var Kt=h((BV,yP)=>{var rc=dP().default,gP=mP();rc.PrintVisitor=gP.PrintVisitor;rc.print=gP.print;yP.exports=rc;function hP(e,t){var r=require("fs"),n=r.readFileSync(t,"utf8");e.exports=rc.compile(n)}o(hP,"extension");typeof require<"u"&&require.extensions&&(require.extensions[".handlebars"]=hP,require.extensions[".hbs"]=hP)});var fq={};WP(fq,{getGenerateFilesData:()=>pq,getGenerateMetadata:()=>lq});module.exports=YP(fq);var md=Xe(Uv());var uo="AppRestClient",Qs={query:"AppQueryOptions",infiniteQuery:"AppInfiniteQueryOptions",mutation:"AppMutationOptions"},zp="src/data",Kp="@/data",Ws={appRestClient:{template:"@/util/rest/clients/app-rest-client",monorepoTemplate:"@/clients/app-rest-client"},queryTypes:{template:"@/types/react-query",monorepoTemplate:"@povio/utils/types/react-query"},errorHandling:{template:"@/util/vendor/error-handling",monorepoTemplate:"@povio/utils/vendor/error-handling"}},co={ErrorHandler:"ErrorHandler",SharedErrorHandler:"SharedErrorHandler"},Gv={bindings:[co.ErrorHandler,co.SharedErrorHandler],from:"@/util/vendor/error-handling"};var Ys={reactQueryTypes:{fileName:"react-query.types",extension:"ts"},restClient:{fileName:"rest-client",extension:"ts"},restInterceptor:{fileName:"rest-interceptor",extension:"ts"}},Js={fileName:"app-rest-client",extension:"ts"},Qp="QueryModule",Xs={fileName:"queryModules",extension:"ts"},Zv={fileName:"queryConfig.context",extension:"tsx"},Wn={optionsType:"MutationEffectsOptions",hookName:"useMutationEffects",runFunctionName:"runMutationEffects"},ea={fileName:"useMutationEffects",extension:"ts"},Ot={name:"zod",properties:{sortingString:"sortingString",parse:"parse"}},ta={fileName:"zod",extension:"ts"};var zv="Schema",Kv="Enum",Qv="Body",Wv="Param",Yv="Response",Jv="ErrorResponse",lo="z.void()",ra="z.instanceof(Blob)",po="z.enum",na="z.string()",Yn={bindings:["z"],from:"zod"};var fo={input:"",output:"output",splitByTags:!0,defaultTag:"Common",excludeTags:[],excludePathRegex:"",excludeRedundantZodSchemas:!0,tsNamespaces:!0,importPath:"ts",configs:{models:{outputFileNameSuffix:"models",namespaceSuffix:"Models"},endpoints:{outputFileNameSuffix:"api",namespaceSuffix:"Api"},queries:{outputFileNameSuffix:"queries",namespaceSuffix:"Queries"},acl:{outputFileNameSuffix:"acl",namespaceSuffix:"Acl"}},standalone:!1,baseUrl:"",schemaSuffix:zv,enumSuffix:Kv,withDefaultValues:!0,extractEnums:!0,replaceOptionalWithNullish:!1,restClientImportPath:Ws.appRestClient.template,errorHandlingImportPath:Ws.errorHandling.template,removeOperationPrefixEndingWith:"Controller_",parseRequestParams:!1,queryTypesImportPath:Ws.queryTypes.template,axiosRequestConfig:!1,infiniteQueries:!1,mutationEffects:!0};var pt={query:"useQuery",infiniteQuery:"useInfiniteQuery",mutation:"useMutation"},Xv={bindings:[pt.query,pt.infiniteQuery,pt.mutation],from:"@tanstack/react-query"},mo={pageParamName:"page"},ia={pageParamName:"page",totalItemsName:"totalItems",limitParamName:"limit"},ho="moduleName";var Ee=o(e=>e.method==="get","isQuery"),xt=o(e=>e.method!=="get"||!!e.mediaDownload,"isMutation"),Jn=o((e,t)=>Ee(e)&&(t??Object.values(mo)).every(r=>e.parameters.some(n=>n.name===r&&n.type==="Query")),"isInfiniteQuery");var U=o(e=>e.charAt(0).toUpperCase()+e.slice(1),"capitalize"),fr=o(e=>e.charAt(0).toLowerCase()+e.slice(1),"decapitalize"),eS=o(e=>e.replace(/(-\w)/g,t=>t[1].toUpperCase()),"kebabToCamel"),oe=o(e=>e.replace(/(_\w)/g,t=>t[1].toUpperCase()),"snakeToCamel"),tS=o(e=>e.replace(/[\W_]+(\w)?/g,(t,r)=>(r==null?void 0:r.toUpperCase())??""),"nonWordCharactersToCamel"),Wp=o((e,t="")=>e.endsWith(t)?e:`${e}${t}`,"suffixIfNeeded"),rS=o((e,t)=>e.replace(new RegExp(`${t}$`),""),"removeSuffix"),ZN=o(e=>{var n;let t=e.reduce((i,s)=>({...i,[s]:(i[s]??0)+1}),{});return(n=Object.entries(t).sort((i,s)=>i[1]===s[1]?s[0].length-i[0].length:s[1]-i[1])[0])==null?void 0:n[0]},"getLongestMostCommon"),Yp=o(e=>{let t=e.map(U).map(nS).map(r=>zN(r)).flat();return ZN(t)},"getMostCommonAdjacentCombinationSplit"),nS=o(e=>e.split(/(?<![A-Z])(?=[A-Z])/).filter(Boolean),"splitByUppercase"),iS=o(e=>nS(e).join(" "),"camelToSpaceSeparated"),zN=o((e,t=["dto","by","for","of","in","to","and","with"])=>{var n;let r=[];for(let i=0;i<e.length;i++)if(!t.includes(e[i].toLowerCase()))for(let s=i+1;s<=e.length;s++)t.includes((n=e[s-1])==null?void 0:n.toLowerCase())||r.push(e.slice(i,s).join(""));return r},"getAdjacentStringCombinations"),oS=o((e,t)=>{let r=t.replace(/es$|s$/g,""),n=new RegExp(`(${fr(r)}|${U(r)})[a-z]*(?=$|[A-Z])`,"g");return e.replace(n,"")},"removeWord");var oa=o((e,t)=>{let r=Ee(e)&&xt(e)&&t;return`use${U(oe(e.operationName))}${r?"Mutation":""}`},"getQueryName"),sS=o(e=>`use${U(oe(e.operationName))}Infinite`,"getInfiniteQueryName");var Le=o((...e)=>[...new Set(e.flat())],"getUniqueArray");var Jp={"Content-Type":"application/json",Accept:"application/json"},sa="data",Xp="axios",dr="config",wt="AxiosRequestConfig",aa={defaultImport:Xp,bindings:[wt],from:"axios"};var aS=o(e=>/^(?:[a-zA-Z_$][a-zA-Z0-9_$]*|[0-9]+)$/.test(e),"isValidPropertyName"),At=o(e=>e.replace(/^[^a-zA-Z_$]*/g,"").replace(/[^a-zA-Z0-9_$]+(\w)?/g,(t,r)=>(r==null?void 0:r.toUpperCase())??""),"invalidVariableNameCharactersToCamel");function D(e){return e!=null&&Object.prototype.hasOwnProperty.call(e,"$ref")}o(D,"isReferenceObject");function $e(e){return!D(e)}o($e,"isSchemaObject");function ca(e){return e.type==="array"}o(ca,"isArraySchemaObject");function cS(e){if(!e.allOf)throw new Error("Function inferRequiredSchema is specialized to handle item with required only in an allOf array.");let[t,r]=e.allOf.reduce((i,s)=>{if(KN(s)){let a=s.required;i[0].push(...a??[])}else i[1].push(s);return i},[[],[]]),n={properties:t.reduce((i,s)=>(i[s]={},i),{}),type:"object",required:t};return{noRequiredOnlyAllof:r,composedRequiredSchema:n,patchRequiredSchemaInLoop:o((i,s)=>{if(D(i)){let a=s(i.$ref);a&&n.required.forEach(c=>{var u;n.properties[c]=((u=a==null?void 0:a.properties)==null?void 0:u[c])??{}})}else{let a=i.properties??{};n.required.forEach(c=>{a[c]&&(n.properties[c]=a[c]??{})})}},"patchRequiredSchemaInLoop")}}o(cS,"inferRequiredSchema");var KN=o(e=>!D(e)&&!!e.required&&!e.type&&!e.properties&&!(e!=null&&e.allOf)&&!(e!=null&&e.anyOf)&&!e.oneOf,"isBrokenAllOfItem");var Vt=Symbol.for("@ts-pattern/matcher"),QN=Symbol.for("@ts-pattern/isVariadic"),la="@ts-pattern/anonymous-select-key",ef=o(e=>!!(e&&typeof e=="object"),"r"),ua=o(e=>e&&!!e[Vt],"i"),Rt=o((e,t,r)=>{if(ua(e)){let n=e[Vt](),{matched:i,selections:s}=n.match(t);return i&&s&&Object.keys(s).forEach(a=>r(a,s[a])),i}if(ef(e)){if(!ef(t))return!1;if(Array.isArray(e)){if(!Array.isArray(t))return!1;let n=[],i=[],s=[];for(let a of e.keys()){let c=e[a];ua(c)&&c[QN]?s.push(c):s.length?i.push(c):n.push(c)}if(s.length){if(s.length>1)throw new Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");if(t.length<n.length+i.length)return!1;let a=t.slice(0,n.length),c=i.length===0?[]:t.slice(-i.length),u=t.slice(n.length,i.length===0?1/0:-i.length);return n.every((l,f)=>Rt(l,a[f],r))&&i.every((l,f)=>Rt(l,c[f],r))&&(s.length===0||Rt(s[0],u,r))}return e.length===t.length&&e.every((a,c)=>Rt(a,t[c],r))}return Reflect.ownKeys(e).every(n=>{let i=e[n];return(n in t||ua(s=i)&&s[Vt]().matcherType==="optional")&&Rt(i,t[n],r);var s})}return Object.is(t,e)},"s"),vr=o(e=>{var t,r,n;return ef(e)?ua(e)?(t=(r=(n=e[Vt]()).getSelectionKeys)==null?void 0:r.call(n))!=null?t:[]:Array.isArray(e)?yo(e,vr):yo(Object.values(e),vr):[]},"o"),yo=o((e,t)=>e.reduce((r,n)=>r.concat(t(n)),[]),"c");function Ke(e){return Object.assign(e,{optional:o(()=>WN(e),"optional"),and:o(t=>z(e,t),"and"),or:o(t=>YN(e,t),"or"),select:o(t=>t===void 0?uS(e):uS(t,e),"select")})}o(Ke,"u");function WN(e){return Ke({[Vt]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return t===void 0?(vr(e).forEach(i=>n(i,void 0)),{matched:!0,selections:r}):{matched:Rt(e,t,n),selections:r}},"match"),getSelectionKeys:o(()=>vr(e),"getSelectionKeys"),matcherType:"optional"})})}o(WN,"h");function z(...e){return Ke({[Vt]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return{matched:e.every(i=>Rt(i,t,n)),selections:r}},"match"),getSelectionKeys:o(()=>yo(e,vr),"getSelectionKeys"),matcherType:"and"})})}o(z,"m");function YN(...e){return Ke({[Vt]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return yo(e,vr).forEach(i=>n(i,void 0)),{matched:e.some(i=>Rt(i,t,n)),selections:r}},"match"),getSelectionKeys:o(()=>yo(e,vr),"getSelectionKeys"),matcherType:"or"})})}o(YN,"d");function L(e){return{[Vt]:()=>({match:o(t=>({matched:!!e(t)}),"match")})}}o(L,"p");function uS(...e){let t=typeof e[0]=="string"?e[0]:void 0,r=e.length===2?e[1]:typeof e[0]=="string"?void 0:e[0];return Ke({[Vt]:()=>({match:o(n=>{let i={[t??la]:n};return{matched:r===void 0||Rt(r,n,(s,a)=>{i[s]=a}),selections:i}},"match"),getSelectionKeys:o(()=>[t??la].concat(r===void 0?[]:vr(r)),"getSelectionKeys")})})}o(uS,"y");function It(e){return typeof e=="number"}o(It,"v");function mr(e){return typeof e=="string"}o(mr,"b");function hr(e){return typeof e=="bigint"}o(hr,"w");var ZL=Ke(L(function(e){return!0}));var gr=o(e=>Object.assign(Ke(e),{startsWith:o(t=>{return gr(z(e,(r=t,L(n=>mr(n)&&n.startsWith(r)))));var r},"startsWith"),endsWith:o(t=>{return gr(z(e,(r=t,L(n=>mr(n)&&n.endsWith(r)))));var r},"endsWith"),minLength:o(t=>gr(z(e,(r=>L(n=>mr(n)&&n.length>=r))(t))),"minLength"),length:o(t=>gr(z(e,(r=>L(n=>mr(n)&&n.length===r))(t))),"length"),maxLength:o(t=>gr(z(e,(r=>L(n=>mr(n)&&n.length<=r))(t))),"maxLength"),includes:o(t=>{return gr(z(e,(r=t,L(n=>mr(n)&&n.includes(r)))));var r},"includes"),regex:o(t=>{return gr(z(e,(r=t,L(n=>mr(n)&&!!n.match(r)))));var r},"regex")}),"j"),zL=gr(L(mr)),Tt=o(e=>Object.assign(Ke(e),{between:o((t,r)=>Tt(z(e,((n,i)=>L(s=>It(s)&&n<=s&&i>=s))(t,r))),"between"),lt:o(t=>Tt(z(e,(r=>L(n=>It(n)&&n<r))(t))),"lt"),gt:o(t=>Tt(z(e,(r=>L(n=>It(n)&&n>r))(t))),"gt"),lte:o(t=>Tt(z(e,(r=>L(n=>It(n)&&n<=r))(t))),"lte"),gte:o(t=>Tt(z(e,(r=>L(n=>It(n)&&n>=r))(t))),"gte"),int:o(()=>Tt(z(e,L(t=>It(t)&&Number.isInteger(t)))),"int"),finite:o(()=>Tt(z(e,L(t=>It(t)&&Number.isFinite(t)))),"finite"),positive:o(()=>Tt(z(e,L(t=>It(t)&&t>0))),"positive"),negative:o(()=>Tt(z(e,L(t=>It(t)&&t<0))),"negative")}),"x"),KL=Tt(L(It)),yr=o(e=>Object.assign(Ke(e),{between:o((t,r)=>yr(z(e,((n,i)=>L(s=>hr(s)&&n<=s&&i>=s))(t,r))),"between"),lt:o(t=>yr(z(e,(r=>L(n=>hr(n)&&n<r))(t))),"lt"),gt:o(t=>yr(z(e,(r=>L(n=>hr(n)&&n>r))(t))),"gt"),lte:o(t=>yr(z(e,(r=>L(n=>hr(n)&&n<=r))(t))),"lte"),gte:o(t=>yr(z(e,(r=>L(n=>hr(n)&&n>=r))(t))),"gte"),positive:o(()=>yr(z(e,L(t=>hr(t)&&t>0))),"positive"),negative:o(()=>yr(z(e,L(t=>hr(t)&&t<0))),"negative")}),"A"),QL=yr(L(hr)),WL=Ke(L(function(e){return typeof e=="boolean"})),YL=Ke(L(function(e){return typeof e=="symbol"})),JL=Ke(L(function(e){return e==null})),XL=Ke(L(function(e){return e!=null}));var of=class of extends Error{constructor(t){let r;try{r=JSON.stringify(t)}catch{r=t}super(`Pattern matching error: no pattern matches value ${r}`),this.input=void 0,this.input=t}};o(of,"W");var tf=of,rf={matched:!1,value:void 0};function ye(e){return new nf(e,rf)}o(ye,"z");var go=class go{constructor(t,r){this.input=void 0,this.state=void 0,this.input=t,this.state=r}with(...t){if(this.state.matched)return this;let r=t[t.length-1],n=[t[0]],i;t.length===3&&typeof t[1]=="function"?i=t[1]:t.length>2&&n.push(...t.slice(1,t.length-1));let s=!1,a={},c=o((l,f)=>{s=!0,a[l]=f},"a"),u=!n.some(l=>Rt(l,this.input,c))||i&&!i(this.input)?rf:{matched:!0,value:r(s?la in a?a[la]:a:this.input,this.input)};return new go(this.input,u)}when(t,r){if(this.state.matched)return this;let n=!!t(this.input);return new go(this.input,n?{matched:!0,value:r(this.input,this.input)}:rf)}otherwise(t){return this.state.matched?this.state.value:t(this.input)}exhaustive(){if(this.state.matched)return this.state.value;throw new tf(this.input)}run(){return this.exhaustive()}returnType(){return this}};o(go,"I");var nf=go;var sf=2,lS=["application/octet-stream","multipart/form-data","application/x-www-form-urlencoded","*/*"],pS=["query","header","path"],Kr=["get","put","post","delete","options","head","patch","trace"],fS=["string","number","integer","boolean"],Xn=["allOf","anyOf","oneOf"];var mS=o(e=>`#/components/schemas/${e}`,"getSchemaRef"),Qr=o(e=>e[1]==="/"?e:"#/"+e.slice(1),"autocorrectRef"),ei=o(e=>Qr(e).split("/").at(-1),"getSchemaNameByRef");function cf(e){let t=JN(e).normalize("NFKD").trim().replace(/\s+/g,"_").replace(/--+/g,"-").replace(/-+/g,"_").replace(/[^\w-]+/g,"_");return oe(t)}o(cf,"normalizeString");function hS(e){return/^[a-zA-Z]\w*$/.test(e)?e:`"${e}"`}o(hS,"wrapWithQuotesIfNeeded");function gS(e){return typeof e=="string"&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}o(gS,"unwrapQuotesIfNeeded");function JN(e){let t=Number(e[0]);return typeof t=="number"&&!Number.isNaN(t)?"_"+e:e}o(JN,"prefixStringStartingWithNumberIfNeeded");function uf(e){let t=e.replaceAll("_","#");return oe(t.replaceAll("-","_")).replaceAll("#","_")}o(uf,"pathParamToVariableName");var Bt=o(e=>fS.includes(e),"isPrimitiveType");function yS(e){return e.replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/([\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F-\u009F\uFFFE\uFFFF])/g,(t,r)=>{let n=r.codePointAt(),i=n.toString(16);return n<=255?`\\x${`00${i}`.slice(-2)}`:`\\u${`0000${i}`.slice(-4)}`}).replace(/\//g,"\\/")}o(yS,"escapeControlCharacters");function Qe(e){return e.includes("application/")&&e.includes("json")||lS.includes(e)||e.includes("text/")}o(Qe,"isParamMediaTypeAllowed");function vo(e){return e>=200&&e<300}o(vo,"isMainResponseStatus");function pa(e){return!(e>=200&&e<300)}o(pa,"isErrorStatus");function ti(e){return e.startsWith("application/")}o(ti,"isMediaTypeAllowed");var dS=/({\w+})/g,XN=/[^\w\-]+/g;function vS(e){e=U(eS(e.replaceAll("/","-")).replaceAll("-",""));let t=[...e.matchAll(dS)];if(t.length>0){let r=t.sort((n,i)=>n.index-i.index)[t.length-1][0];e=`${e.replace(dS,"")}By${U(r.slice(1,-1))}`}return e.replace(XN,"_")}o(vS,"pathToVariableName");var af=/{(\b\w+(?:-\w+)*\b)}/g;function SS(e){let t=e.match(af);return t===null?e.replaceAll(af,":$1"):(t.forEach(r=>{let n=uf(r.replaceAll(af,":$1"));e=e.replaceAll(r,n)}),e)}o(SS,"replaceHyphenatedPath");var bS=o(e=>{let t=e["x-enumNames"],r=Array.isArray(t)&&t.length>0,n=!!e.schema&&$e(e.schema)&&e.schema.type==="string";return r&&n},"isSortingParameterObject"),Wr=o((e,t)=>t.excludePathRegex?new RegExp(t.excludePathRegex).test(e):!1,"isPathExcluded");function Nt(e){return tS(e)}o(Nt,"formatTag");function Sr(e,t){var n;let r=(n=e.tags)==null?void 0:n[0];return Nt(r??t.defaultTag)}o(Sr,"getOperationTag");function _S(e,t){return t.excludeTags.some(r=>r.toLowerCase()===e.toLowerCase())}o(_S,"isTagExcluded");function Oe(e,t){if(!e)return;let{data:r,onSchema:n}=t;if(D(e)&&n({type:"reference",schema:e,data:r})===!0)return;let i=e;if(Xn.some(s=>s in i&&i[s])){let s=i.allOf??i.anyOf??i.oneOf??[];for(let a of s)(n==null?void 0:n({type:"composite",parentSchema:e,schema:a,data:r}))!==!0&&Oe(a,{data:r,onSchema:n})}if(i.properties)for(let[s,a]of Object.entries(i.properties))n({type:"property",parentSchema:e,schema:a,data:r,propertyName:s})!==!0&&Oe(a,t);if(i.additionalProperties&&typeof i.additionalProperties=="object"){if(n({type:"additionalProperties",parentSchema:e,schema:i.additionalProperties,data:r})===!0)return;Oe(i.additionalProperties,t)}if(i.type==="array"){let s=e.items;if(n({type:"array",parentSchema:e,schema:s,data:r})===!0)return;Oe(s,t)}}o(Oe,"iterateSchema");var Ct=o((e,t)=>Wp(U(cf(e)),t),"getZodSchemaName"),So=o((e,t,r)=>Wp(U(cf(e)),`${t}${r}`),"getEnumZodSchemaName"),ue=o(e=>!e.startsWith("z."),"isNamedZodSchema"),PS=o(e=>e.startsWith(po),"isEnumZodSchema"),Yr=o((e,t,r)=>t?e:`${r}_${e}`,"getZodSchemaOperationName"),fa=o(e=>oe(`${e}_${Qv}`),"getBodyZodSchemaName"),ES=o((e,t)=>oe(`${e}_${t}${Wv}`),"getParamZodSchemaName"),eC=o(e=>oe(`${e}${Yv}`),"getMainResponseZodSchemaName"),tC=o((e,t)=>oe(`${e}_${t}_${Jv}`),"getErrorResponseZodSchemaName");function da({statusCode:e,operationName:t,isUniqueOperationName:r,tag:n}){let i=Number(e),s=Yr(t,r,n);return!vo(i)&&e!=="default"&&pa(i)?tC(s,e):eC(s)}o(da,"getResponseZodSchemaName");function bo(e){return["minimum","exclusiveMinimum","maximum","exclusiveMaximum","minItems","minLength","minProperties","maxItems","maxLength","maxProperties","default","example"].filter(n=>e[n]).reduce((n,i)=>[...n,`${U(iS(i))}: \`${e[i]}\``],[])}o(bo,"getSchemaDescriptions");var _o=o((e,t)=>rS(e,t.schemaSuffix),"getZodSchemaInferedTypeName"),$S=o((e,t)=>ue(t)?`${e.options.tsNamespaces?`${G({type:"models",tag:e.getTagByZodSchemaName(t),options:e.options})}.`:""}${t}`:t,"getImportedZodSchemaName"),br=o((e,t,r)=>{if(!ue(t))return t===lo?"void":t;let n=e.getTagByZodSchemaName(t);return`${e.options.tsNamespaces&&n!==r?`${G({type:"models",tag:n,options:e.options})}.`:""}${_o(t,e.options)}`},"getImportedZodSchemaInferedTypeName");function OS(e){var t;return e.isEnum?"enum":((t=e.schemaObj)==null?void 0:t.type)??"object"}o(OS,"getZodSchemaType");function xS(e){if(e.schemaObj)return[e.schemaObj.description,...bo(e.schemaObj).join(". ")].filter(Boolean)}o(xS,"getZodSchemaDescription");function wS(e,t,r){var n;if(D(t)){let i=e.getZodSchemaNameByRef(t.$ref);return i?br(e,i,r):void 0}if(ca(t)){if(!D(t.items))return`${((n=t.items)==null?void 0:n.type)??"unknown"}[]`;let i=e.getZodSchemaNameByRef(t.items.$ref);return i?`${br(e,i,r)}[]`:void 0}if(Xn.some(i=>i in t&&t[i])){let i=t.allOf??t.anyOf??t.oneOf??[];if(i.length>0)return wS(e,i[0],r)}return t.type}o(wS,"getType");function AS(e,t,r){if(!t.schemaObj)return[];let n="[0]",i="[key]",s={},a=o(c=>{var l;if(c.type==="reference")return!0;if(c.type==="composite")return;let u=[...((l=c.data)==null?void 0:l.pathSegments)??[]];if(c.type==="array"?u.push(n):c.type==="property"?u.push(c.propertyName):c.type==="additionalProperties"&&u.push(i),c.schema&&u[u.length-1]!==n){let f=e.resolveObject(c.schema),p=[f.description,...bo(f)].filter(Boolean),d=u.join(".");s[d]&&"type"in c.schema&&c.schema.type==="object"||(delete s[d],s[d]={type:wS(e,c.schema,r)??"unknown",description:p.join(". ")})}return Oe(c.schema,{data:{pathSegments:[...u]},onSchema:a}),!0},"onSchema");return"allOf"in t.schemaObj&&t.schemaObj.allOf&&t.schemaObj.allOf.forEach(c=>{if(D(c)){let u=e.resolveObject(c);Oe(u,{data:{pathSegments:[]},onSchema:a})}}),Oe(t.schemaObj,{data:{pathSegments:[]},onSchema:a}),s}o(AS,"getZodSchemaPropertyDescriptions");function ma(e){return ye(e).with("string",()=>"string").with("number",()=>"number").with("integer",()=>"number").with("boolean",()=>"boolean").exhaustive()}o(ma,"primitiveTypeToTsType");function ri({zodSchemaName:e,schema:t,resolver:r}){let n="void",i;e&&ue(e)?(n=br(r,e),i=r.getTagByZodSchemaName(e)):t!=null&&t.type&&Bt(t==null?void 0:t.type)&&(n=ma(t==null?void 0:t.type));let s=n.split(".");return{type:s[s.length-1],...s.length>1?{namespace:s[0]}:{},...i?{importPath:Xr({type:"models",tag:i,includeTagDir:!0,options:r.options})}:{}}}o(ri,"getTsTypeBase");function Jr({schema:e,isCircular:t,parentTypes:r,resolver:n}){if(!e)return{metaType:"primitive"};for(let i of Xn){let s=e[i];if(s)if(s.length>1){let a=s.map(c=>{let u=n.resolveObject(c);return Jr({schema:u,parentTypes:r,resolver:n})});return a.every(({metaType:c})=>c==="object")?{metaType:"object",objectProperties:a.reduce((c,{objectProperties:u})=>{let l=u.map(({name:f})=>f);return[...c.filter(({name:f})=>!l.includes(f)),...u]},[])}:{metaType:"composite",[i]:a}}else e=n.resolveObject(s[0])}return e.type==="array"?{metaType:"array",arrayType:IS({arraySchema:e,resolver:n,parentTypes:r})}:(e.type==="object"||e.properties)&&t?{metaType:"object",objectProperties:[],isCircular:!0}:e.type==="object"||e.properties?{metaType:"object",objectProperties:rC({schema:e,parentTypes:r,resolver:n})}:{metaType:"primitive"}}o(Jr,"getSchemaTsMetaType");function IS({arraySchema:e,parentTypes:t,resolver:r}){let n,i;if(D(e.items)){let u=e.items.$ref;n=r.getZodSchemaNameByRef(u),i=r.getSchemaByRef(u)}else i=e.items;let s=ri({zodSchemaName:n,schema:i,resolver:r}),a=TS(s,t),c=Jr({schema:i,isCircular:a,parentTypes:[...t,s],resolver:r});return{...s,...c}}o(IS,"getArraySchemaTsType");function rC({schema:e,parentTypes:t,resolver:r}){return Object.entries((e==null?void 0:e.properties)??{}).map(([n,i])=>{var a;let s=((a=e==null?void 0:e.required)==null?void 0:a.includes(n))??!1;if(D(i)){let c=r.getZodSchemaNameByRef(i.$ref),u=r.getSchemaByRef(i.$ref),l=ri({zodSchemaName:c,schema:u,resolver:r}),f=TS(l,t),p=Jr({schema:u,isCircular:f,parentTypes:[...t,l],resolver:r});return{name:n,isRequired:s,...l,...p}}else if(i.type==="array"){let c=IS({arraySchema:i,parentTypes:t,resolver:r});return{name:n,isRequired:s,type:"array",metaType:"array",arrayType:c}}else if(Bt(i.type))return{name:n,isRequired:s,type:ma(i.type),metaType:"primitive"};return{name:n,isRequired:s,type:"void",metaType:"primitive"}})}o(rC,"getSchemaTsProperties");function TS(e,t){return t.findIndex(({type:r,namespace:n})=>r===e.type&&n===e.namespace)>-1}o(TS,"getIsCircular");var Po=o(e=>fr(oe(e.operationName)),"getEndpointName");function RS(e,t){return`${t.tsNamespaces?`${G({type:"endpoints",tag:Eo(e,t),options:t})}.`:""}${Po(e)}`}o(RS,"getImportedEndpointName");var NS=o(e=>e.path.replace(/:([a-zA-Z0-9_]+)/g,"${$1}"),"getEndpointPath");function Eo(e,t){var n;let r=t.splitByTags?(n=e.tags)==null?void 0:n[0]:t.defaultTag;return Nt(r??t.defaultTag)}o(Eo,"getEndpointTag");function $o(e,t,r){let n=t.parameters.map(i=>{var a,c,u,l;let s="string";if(ue(i.zodSchema))s=br(e,i.zodSchema);else if((a=i.parameterObject)!=null&&a.schema&&$e(i.parameterObject.schema)){let f=(u=(c=i.parameterObject)==null?void 0:c.schema)==null?void 0:u.type;f&&Bt(f)&&(s=ma(f))}return{name:At(i.name),type:s,paramType:i.type,required:((l=i.parameterObject)==null?void 0:l.required)??!0,parameterObject:i.parameterObject,bodyObject:i.bodyObject}});return r!=null&&r.includeFileParam&&t.mediaUpload&&n.push({name:"file",type:"File",paramType:"Body",required:!0,parameterObject:void 0,bodyObject:void 0}),n.sort((i,s)=>{if(i.required===s.required){let a=["Path","Body","Query","Header"];return a.indexOf(i.paramType)-a.indexOf(s.paramType)}return i.required?-1:1}).filter(i=>(!(r!=null&&r.excludeBodyParam)||i.name!==sa)&&(!(r!=null&&r.excludePageParam)||i.name!==mo.pageParamName)&&(!(r!=null&&r.includeOnlyRequiredParams)||i.required)).map(i=>({...i,name:r!=null&&r.replacePageParam&&i.name===mo.pageParamName?"pageParam":i.name}))}o($o,"mapEndpointParamsToFunctionParams");function CS(e){let t=e.parameters.filter(i=>i.type==="Query").map(i=>{let s=aS(i.name)?i.name:`"${i.name}"`,a=At(i.name);return{...i,name:s,value:a}}),r={};return e.requestFormat!==Jp["Content-Type"]&&(r["Content-Type"]=`'${e.requestFormat}'`),e.responseFormat&&e.responseFormat!==Jp.Accept&&(r.Accept=`'${e.responseFormat}'`),e.parameters.filter(i=>i.type==="Header").forEach(i=>{r[i.name]=At(i.name)}),{...t.length>0?{params:t}:{},...Object.keys(r).length?{headers:r}:{}}}o(CS,"getEndpointConfig");function kS(e,t){return t.filter(r=>Ee(r)&&r.parameters.filter(n=>{var i;return(i=n.parameterObject)==null?void 0:i.required}).every(n=>e.parameters.some(i=>i.name===n.name))&&r.response===e.response)}o(kS,"getUpdateQueryEndpoints");function _r({resolver:e,tag:t,zodSchemas:r=[],zodSchemasAsTypes:n=[]}){let i="models",s=o(u=>e.getTagByZodSchemaName(u),"getTag"),a=lf({type:i,tag:t,entities:r,getTag:s,getEntityName:o(u=>u,"getEntityName"),options:e.options}),c=lf({type:i,tag:t,entities:n,getTag:s,getEntityName:o(u=>_o(u,e.options),"getEntityName"),options:e.options});return nC(e.options,a,c)}o(_r,"getModelsImports");function jS({tag:e,endpoints:t,options:r}){return lf({type:"endpoints",tag:e,entities:t,getTag:o(n=>Eo(n,r),"getTag"),getEntityName:Po,options:r})}o(jS,"getEndpointsImports");function qS({tags:e,entityName:t,getAliasEntityName:r,type:n,options:i}){let s=new Map;return e.forEach(a=>{let c=`${t}${r?` as ${r(a)}`:""}`;s.has(a)?i.tsNamespaces||s.get(a).bindings.push(c):s.set(a,{bindings:[i.tsNamespaces?G({type:n,tag:a,options:i}):c],from:`${Pr(i)}${Xr({type:n,tag:a,includeTagDir:!0,options:i})}`})}),Array.from(s.values())}o(qS,"getEntityImports");function Pr(e){let t=Kp;return e.importPath==="relative"?t="../":e.importPath==="absolute"?t=e.output:new RegExp(`${zp}`,"g").test(e.output)&&(t=e.output.replace(new RegExp(`.*${zp}`,"g"),Kp)),`${t}/`.replace(/\/\//g,"/")}o(Pr,"getImportPath");function lf({type:e="models",tag:t,entities:r,getTag:n,getEntityName:i,options:s}){let a=new Map;return r.forEach(c=>{let u=n(c);if(a.has(u))s.tsNamespaces||a.get(u).bindings.push(i(c));else{let l=t===u;a.set(u,{bindings:[s.tsNamespaces?G({type:e,tag:u,options:s}):i(c)],from:`${l?"./":Pr(s)}${Xr({type:e,tag:u,includeTagDir:!l,options:s})}`})}}),Array.from(a.values())}o(lf,"getImports");function nC(e,...t){let r=new Map;return t.forEach(n=>{n.forEach(i=>{r.has(i.from)?e.tsNamespaces||r.get(i.from).bindings.push(...i.bindings):r.set(i.from,i)})}),Array.from(r.values()).map(n=>({...n,bindings:Le(n.bindings)}))}o(nC,"mergeImports");function ni({fileName:e,extension:t}){return`${e}.${t}`}o(ni,"getFileNameWithExtension");function MS({type:e,tag:t,options:r,includeTagDir:n=!0}){let i=r.configs[e].outputFileNameSuffix;return t?`${n?`${fr(t)}/`:""}${fr(t)}.${i}`:i}o(MS,"getTagFileNameWithoutExtension");function Xr(...e){return MS(...e)}o(Xr,"getTagImportPath");function DS(...e){return`${MS(...e)}.ts`}o(DS,"getTagFileName");var G=o(({type:e,tag:t,options:r})=>`${U(t)}${r.configs[e].namespaceSuffix}`,"getNamespaceName");function LS(e){return e.standalone?`${Pr(e)}${Js.fileName}`:e.restClientImportPath}o(LS,"getAppRestClientImportPath");function FS(e){return e.standalone?`${Pr(e)}${Ys.reactQueryTypes.fileName}`:e.queryTypesImportPath}o(FS,"getQueryTypesImportPath");function HS(e){return`${Pr(e)}${Xs.fileName}`}o(HS,"getQueryModulesImportPath");function VS(e){return`${Pr(e)}${ea.fileName}`}o(VS,"getMutationEffectsImportPath");function BS(e){return`${Pr(e)}${ta.fileName}`}o(BS,"getZodExtendedImportPath");var pf=["break","case","catch","class","const","continue","debugger","default","delete","do","else","export","extends","false","finally","for","function","if","import","in","instanceof","new","null","return","super","switch","this","throw","true","try","typeof","var","void","while","with"];function en(e,t){let r={};return Object.keys(e).forEach(n=>{t.includes(n)&&(r[n]=e[n])}),r}o(en,"pick");function ii(e,t){let r=e.deprecated&&!t.withDeprecatedEndpoints,n=Sr(e,t),i=_S(n,t);return r||i}o(ii,"isOperationExcluded");function ff({path:e,method:t,operation:r,options:n,tag:i,keepOperationTag:s,keepOperationPrefix:a}){let c=`${t}${vS(e)}`,u=r.operationId?At(r.operationId):c;if(n.removeOperationPrefixEndingWith&&a)u=u.split(n.removeOperationPrefixEndingWith).map((f,p)=>p===0?f:U(f)).join("");else if(n.removeOperationPrefixEndingWith&&!a){let l=new RegExp(`^.*${n.removeOperationPrefixEndingWith}`);u=u.replace(l,"")}if(n.tsNamespaces&&!s){let l=oS(u,i);pf.includes(l)||(u=l)}return pf.includes(u)?c:u}o(ff,"getOperationName");function Oo({operationsByTag:e,...t}){let{operation:r,options:n}=t,i=n.splitByTags?Sr(r,n):n.defaultTag,s=o(a=>{let c=ff({...t,tag:i,keepOperationTag:a});if(e[i].filter(l=>ff({...t,operation:l,tag:i,keepOperationTag:a})===c).length===1)return c},"operationName");return s()??s(!0)??ff({...t,tag:i,keepOperationTag:!0,keepOperationPrefix:!0})}o(Oo,"getUniqueOperationName");function US(e,t,r){let n=[];for(let i in e.paths){if(Wr(i,r))continue;let s=e.paths[i],a=en(s,Kr);for(let c in a){let u=a[c];if(!u||ii(u,r))continue;let l=Oo({path:i,method:c,operation:u,operationsByTag:t,options:r});n.push(l)}}return n}o(US,"getUniqueOperationNamesWithoutSplitByTags");function GS(e,t){let r={};for(let n in e.paths){if(Wr(n,t))continue;let i=e.paths[n],s=en(i,Kr);for(let a in s){let c=s[a];if(!c||ii(c,t))continue;let u=t.splitByTags?Sr(c,t):t.defaultTag;r[u]||(r[u]=[]),r[u].push(c)}}return r}o(GS,"getOperationsByTag");var ZS={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"};function xo(e){return{type:"invalid-schema",message:e}}o(xo,"getInvalidSchemaError");function zS(e){return{type:"invalid-operation-id",message:`Operation ${e}`}}o(zS,"getInvalidOperationIdError");function KS(e,t){return{type:"missing-path-parameter",message:`Path ${t} is missing [${e.map(({name:r})=>r).join(", ")}]`}}o(KS,"getMissingPathParameterError");function QS(e){return{type:"not-allowed-inline-enum",message:`${e} is missing @IsEnum() and @ApiProperty(enum:, enumName:)`}}o(QS,"getNotAllowedInlineEnumError");function WS(e){return{type:"not-allowed-circular-schema",message:e}}o(WS,"getNotAllowedCircularSchemaError");function YS(e,t,r){return{type:"missing-acl-condition-property",message:`Condition property ${e} is not found in parameters or body in operation ${ga(t,r)}`}}o(YS,"getMissingAclConditionPropertyError");function df(e,t,r){return{type:"missing-status-code",message:`Missing HTTP status code ${ha(e)} in operation ${ga(t,r)}`}}o(df,"getMissingStatusCodeError");function JS(e,t,r){return{type:"invalid-status-code",message:`Operation ${ga(t,r)} expected HTTP status code ${ha(e.expected)} but received ${ha(e.received)}`}}o(JS,"getInvalidStatusCodeError");function XS(e,t,r){return{type:"multiple-success-status-codes",message:`Operation ${ga(t,r)} has multiple success HTTP status codes: ${e.map(ha).join(", ")}`}}o(XS,"getMultipleSuccessStatusCodesError");function ga(e,t){return e.operationId??`${t.method} ${t.path}`}o(ga,"getOperationDescriptor");function ha(e){return`${e} (${ZS[e]})`}o(ha,"getStatusCodeDescription");function kt({schema:e,meta:t,options:r}){let n=[];ye(e.type).with("string",()=>n.push(sC(e))).with("number","integer",()=>n.push(cC(e))).with("array",()=>n.push(uC(e))).otherwise(()=>{}),typeof e.description=="string"&&e.description!==""&&r.withDescription&&([`
72
+ `,t};W.prototype.Program=function(e){var t="",r=e.body,n=void 0,i=void 0;if(e.blockParams){var s="BLOCK PARAMS: [";for(n=0,i=e.blockParams.length;n<i;n++)s+=" "+e.blockParams[n];s+=" ]",t+=this.pad(s)}for(n=0,i=r.length;n<i;n++)t+=this.accept(r[n]);return this.padding--,t};W.prototype.MustacheStatement=function(e){return this.pad("{{ "+this.SubExpression(e)+" }}")};W.prototype.Decorator=function(e){return this.pad("{{ DIRECTIVE "+this.SubExpression(e)+" }}")};W.prototype.BlockStatement=W.prototype.DecoratorBlock=function(e){var t="";return t+=this.pad((e.type==="DecoratorBlock"?"DIRECTIVE ":"")+"BLOCK:"),this.padding++,t+=this.pad(this.SubExpression(e)),e.program&&(t+=this.pad("PROGRAM:"),this.padding++,t+=this.accept(e.program),this.padding--),e.inverse&&(e.program&&this.padding++,t+=this.pad("{{^}}"),this.padding++,t+=this.accept(e.inverse),this.padding--,e.program&&this.padding--),this.padding--,t};W.prototype.PartialStatement=function(e){var t="PARTIAL:"+e.name.original;return e.params[0]&&(t+=" "+this.accept(e.params[0])),e.hash&&(t+=" "+this.accept(e.hash)),this.pad("{{> "+t+" }}")};W.prototype.PartialBlockStatement=function(e){var t="PARTIAL BLOCK:"+e.name.original;return e.params[0]&&(t+=" "+this.accept(e.params[0])),e.hash&&(t+=" "+this.accept(e.hash)),t+=" "+this.pad("PROGRAM:"),this.padding++,t+=this.accept(e.program),this.padding--,this.pad("{{> "+t+" }}")};W.prototype.ContentStatement=function(e){return this.pad("CONTENT[ '"+e.value+"' ]")};W.prototype.CommentStatement=function(e){return this.pad("{{! '"+e.value+"' }}")};W.prototype.SubExpression=function(e){for(var t=e.params,r=[],n=void 0,i=0,s=t.length;i<s;i++)r.push(this.accept(t[i]));return t="["+r.join(", ")+"]",n=e.hash?" "+this.accept(e.hash):"",this.accept(e.path)+" "+t+n};W.prototype.PathExpression=function(e){var t=e.parts.join("/");return(e.data?"@":"")+"PATH:"+t};W.prototype.StringLiteral=function(e){return'"'+e.value+'"'};W.prototype.NumberLiteral=function(e){return"NUMBER{"+e.value+"}"};W.prototype.BooleanLiteral=function(e){return"BOOLEAN{"+e.value+"}"};W.prototype.UndefinedLiteral=function(){return"UNDEFINED"};W.prototype.NullLiteral=function(){return"NULL"};W.prototype.Hash=function(e){for(var t=e.pairs,r=[],n=0,i=t.length;n<i;n++)r.push(this.accept(t[n]));return"HASH{"+r.join(", ")+"}"};W.prototype.HashPair=function(e){return e.key+"="+this.accept(e.value)}});var Kt=h((BV,yP)=>{var rc=dP().default,gP=mP();rc.PrintVisitor=gP.PrintVisitor;rc.print=gP.print;yP.exports=rc;function hP(e,t){var r=require("fs"),n=r.readFileSync(t,"utf8");e.exports=rc.compile(n)}o(hP,"extension");typeof require<"u"&&require.extensions&&(require.extensions[".handlebars"]=hP,require.extensions[".hbs"]=hP)});var fq={};WP(fq,{getGenerateFilesData:()=>pq,getGenerateMetadata:()=>lq});module.exports=YP(fq);var md=Xe(Uv());var uo="AppRestClient",Qs={query:"AppQueryOptions",infiniteQuery:"AppInfiniteQueryOptions",mutation:"AppMutationOptions"},zp="src/data",Kp="@/data",Ws={appRestClient:{template:"@/util/rest/clients/app-rest-client",monorepoTemplate:"@/clients/app-rest-client"},queryTypes:{template:"@/types/react-query",monorepoTemplate:"@povio/utils/types/react-query"},errorHandling:{template:"@/util/vendor/error-handling",monorepoTemplate:"@povio/utils/vendor/error-handling"}},co={ErrorHandler:"ErrorHandler",SharedErrorHandler:"SharedErrorHandler"},Gv={bindings:[co.ErrorHandler,co.SharedErrorHandler],from:"@/util/vendor/error-handling"};var Ys={reactQueryTypes:{fileName:"react-query.types",extension:"ts"},restClient:{fileName:"rest-client",extension:"ts"},restInterceptor:{fileName:"rest-interceptor",extension:"ts"}},Js={fileName:"app-rest-client",extension:"ts"},Qp="QueryModule",Xs={fileName:"queryModules",extension:"ts"},Zv={fileName:"queryConfig.context",extension:"tsx"},Wn={optionsType:"MutationEffectsOptions",hookName:"useMutationEffects",runFunctionName:"runMutationEffects"},ea={fileName:"useMutationEffects",extension:"ts"},Ot={name:"zod",properties:{sortingString:"sortingString",parse:"parse"}},ta={fileName:"zod",extension:"ts"};var zv="Schema",Kv="Enum",Qv="Body",Wv="Param",Yv="Response",Jv="ErrorResponse",lo="z.void()",ra="z.instanceof(Blob)",po="z.enum",na="z.string()",Yn={bindings:["z"],from:"zod"};var fo={input:"",output:"output",splitByTags:!0,defaultTag:"Common",excludeTags:[],excludePathRegex:"",excludeRedundantZodSchemas:!0,tsNamespaces:!0,importPath:"ts",configs:{models:{outputFileNameSuffix:"models",namespaceSuffix:"Models"},endpoints:{outputFileNameSuffix:"api",namespaceSuffix:"Api"},queries:{outputFileNameSuffix:"queries",namespaceSuffix:"Queries"},acl:{outputFileNameSuffix:"acl",namespaceSuffix:"Acl"}},standalone:!1,baseUrl:"",schemaSuffix:zv,enumSuffix:Kv,withDefaultValues:!0,extractEnums:!0,replaceOptionalWithNullish:!1,restClientImportPath:Ws.appRestClient.template,errorHandlingImportPath:Ws.errorHandling.template,removeOperationPrefixEndingWith:"Controller_",parseRequestParams:!1,queryTypesImportPath:Ws.queryTypes.template,axiosRequestConfig:!1,infiniteQueries:!1,mutationEffects:!0};var pt={query:"useQuery",infiniteQuery:"useInfiniteQuery",mutation:"useMutation"},Xv={bindings:[pt.query,pt.infiniteQuery,pt.mutation],from:"@tanstack/react-query"},mo={pageParamName:"page"},ia={pageParamName:"page",totalItemsName:"totalItems",limitParamName:"limit"},ho="moduleName";var Ee=o(e=>e.method==="get","isQuery"),xt=o(e=>e.method!=="get"||!!e.mediaDownload,"isMutation"),Jn=o((e,t)=>Ee(e)&&(t??Object.values(mo)).every(r=>e.parameters.some(n=>n.name===r&&n.type==="Query")),"isInfiniteQuery");var U=o(e=>e.charAt(0).toUpperCase()+e.slice(1),"capitalize"),fr=o(e=>e.charAt(0).toLowerCase()+e.slice(1),"decapitalize"),eS=o(e=>e.replace(/(-\w)/g,t=>t[1].toUpperCase()),"kebabToCamel"),oe=o(e=>e.replace(/(_\w)/g,t=>t[1].toUpperCase()),"snakeToCamel"),tS=o(e=>e.replace(/[\W_]+(\w)?/g,(t,r)=>(r==null?void 0:r.toUpperCase())??""),"nonWordCharactersToCamel"),Wp=o((e,t="")=>e.endsWith(t)?e:`${e}${t}`,"suffixIfNeeded"),rS=o((e,t)=>e.replace(new RegExp(`${t}$`),""),"removeSuffix"),ZN=o(e=>{var n;let t=e.reduce((i,s)=>({...i,[s]:(i[s]??0)+1}),{});return(n=Object.entries(t).sort((i,s)=>i[1]===s[1]?s[0].length-i[0].length:s[1]-i[1])[0])==null?void 0:n[0]},"getLongestMostCommon"),Yp=o(e=>{let t=e.map(U).map(nS).map(r=>zN(r)).flat();return ZN(t)},"getMostCommonAdjacentCombinationSplit"),nS=o(e=>e.split(/(?<![A-Z])(?=[A-Z])/).filter(Boolean),"splitByUppercase"),iS=o(e=>nS(e).join(" "),"camelToSpaceSeparated"),zN=o((e,t=["dto","by","for","of","in","to","and","with"])=>{var n;let r=[];for(let i=0;i<e.length;i++)if(!t.includes(e[i].toLowerCase()))for(let s=i+1;s<=e.length;s++)t.includes((n=e[s-1])==null?void 0:n.toLowerCase())||r.push(e.slice(i,s).join(""));return r},"getAdjacentStringCombinations"),oS=o((e,t)=>{let r=t.replace(/es$|s$/g,""),n=new RegExp(`(${fr(r)}|${U(r)})[a-z]*(?=$|[A-Z])`,"g");return e.replace(n,"")},"removeWord");var oa=o((e,t)=>{let r=Ee(e)&&xt(e)&&t;return`use${U(oe(e.operationName))}${r?"Mutation":""}`},"getQueryName"),sS=o(e=>`use${U(oe(e.operationName))}Infinite`,"getInfiniteQueryName");var Le=o((...e)=>[...new Set(e.flat())],"getUniqueArray");var Jp={"Content-Type":"application/json",Accept:"application/json"},sa="data",Xp="axios",dr="config",wt="AxiosRequestConfig",aa={defaultImport:Xp,bindings:[wt],from:"axios"};var aS=o(e=>/^(?:[a-zA-Z_$][a-zA-Z0-9_$]*|[0-9]+)$/.test(e),"isValidPropertyName"),At=o(e=>e.replace(/^[^a-zA-Z_$]*/g,"").replace(/[^a-zA-Z0-9_$]+(\w)?/g,(t,r)=>(r==null?void 0:r.toUpperCase())??""),"invalidVariableNameCharactersToCamel");function D(e){return e!=null&&Object.prototype.hasOwnProperty.call(e,"$ref")}o(D,"isReferenceObject");function $e(e){return!D(e)}o($e,"isSchemaObject");function ca(e){return e.type==="array"}o(ca,"isArraySchemaObject");function cS(e){if(!e.allOf)throw new Error("Function inferRequiredSchema is specialized to handle item with required only in an allOf array.");let[t,r]=e.allOf.reduce((i,s)=>{if(KN(s)){let a=s.required;i[0].push(...a??[])}else i[1].push(s);return i},[[],[]]),n={properties:t.reduce((i,s)=>(i[s]={},i),{}),type:"object",required:t};return{noRequiredOnlyAllof:r,composedRequiredSchema:n,patchRequiredSchemaInLoop:o((i,s)=>{if(D(i)){let a=s(i.$ref);a&&n.required.forEach(c=>{var u;n.properties[c]=((u=a==null?void 0:a.properties)==null?void 0:u[c])??{}})}else{let a=i.properties??{};n.required.forEach(c=>{a[c]&&(n.properties[c]=a[c]??{})})}},"patchRequiredSchemaInLoop")}}o(cS,"inferRequiredSchema");var KN=o(e=>!D(e)&&!!e.required&&!e.type&&!e.properties&&!(e!=null&&e.allOf)&&!(e!=null&&e.anyOf)&&!e.oneOf,"isBrokenAllOfItem");var Vt=Symbol.for("@ts-pattern/matcher"),QN=Symbol.for("@ts-pattern/isVariadic"),la="@ts-pattern/anonymous-select-key",ef=o(e=>!!(e&&typeof e=="object"),"r"),ua=o(e=>e&&!!e[Vt],"i"),Rt=o((e,t,r)=>{if(ua(e)){let n=e[Vt](),{matched:i,selections:s}=n.match(t);return i&&s&&Object.keys(s).forEach(a=>r(a,s[a])),i}if(ef(e)){if(!ef(t))return!1;if(Array.isArray(e)){if(!Array.isArray(t))return!1;let n=[],i=[],s=[];for(let a of e.keys()){let c=e[a];ua(c)&&c[QN]?s.push(c):s.length?i.push(c):n.push(c)}if(s.length){if(s.length>1)throw new Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");if(t.length<n.length+i.length)return!1;let a=t.slice(0,n.length),c=i.length===0?[]:t.slice(-i.length),u=t.slice(n.length,i.length===0?1/0:-i.length);return n.every((l,f)=>Rt(l,a[f],r))&&i.every((l,f)=>Rt(l,c[f],r))&&(s.length===0||Rt(s[0],u,r))}return e.length===t.length&&e.every((a,c)=>Rt(a,t[c],r))}return Reflect.ownKeys(e).every(n=>{let i=e[n];return(n in t||ua(s=i)&&s[Vt]().matcherType==="optional")&&Rt(i,t[n],r);var s})}return Object.is(t,e)},"s"),vr=o(e=>{var t,r,n;return ef(e)?ua(e)?(t=(r=(n=e[Vt]()).getSelectionKeys)==null?void 0:r.call(n))!=null?t:[]:Array.isArray(e)?yo(e,vr):yo(Object.values(e),vr):[]},"o"),yo=o((e,t)=>e.reduce((r,n)=>r.concat(t(n)),[]),"c");function Ke(e){return Object.assign(e,{optional:o(()=>WN(e),"optional"),and:o(t=>z(e,t),"and"),or:o(t=>YN(e,t),"or"),select:o(t=>t===void 0?uS(e):uS(t,e),"select")})}o(Ke,"u");function WN(e){return Ke({[Vt]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return t===void 0?(vr(e).forEach(i=>n(i,void 0)),{matched:!0,selections:r}):{matched:Rt(e,t,n),selections:r}},"match"),getSelectionKeys:o(()=>vr(e),"getSelectionKeys"),matcherType:"optional"})})}o(WN,"h");function z(...e){return Ke({[Vt]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return{matched:e.every(i=>Rt(i,t,n)),selections:r}},"match"),getSelectionKeys:o(()=>yo(e,vr),"getSelectionKeys"),matcherType:"and"})})}o(z,"m");function YN(...e){return Ke({[Vt]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return yo(e,vr).forEach(i=>n(i,void 0)),{matched:e.some(i=>Rt(i,t,n)),selections:r}},"match"),getSelectionKeys:o(()=>yo(e,vr),"getSelectionKeys"),matcherType:"or"})})}o(YN,"d");function L(e){return{[Vt]:()=>({match:o(t=>({matched:!!e(t)}),"match")})}}o(L,"p");function uS(...e){let t=typeof e[0]=="string"?e[0]:void 0,r=e.length===2?e[1]:typeof e[0]=="string"?void 0:e[0];return Ke({[Vt]:()=>({match:o(n=>{let i={[t??la]:n};return{matched:r===void 0||Rt(r,n,(s,a)=>{i[s]=a}),selections:i}},"match"),getSelectionKeys:o(()=>[t??la].concat(r===void 0?[]:vr(r)),"getSelectionKeys")})})}o(uS,"y");function It(e){return typeof e=="number"}o(It,"v");function mr(e){return typeof e=="string"}o(mr,"b");function hr(e){return typeof e=="bigint"}o(hr,"w");var ZL=Ke(L(function(e){return!0}));var gr=o(e=>Object.assign(Ke(e),{startsWith:o(t=>{return gr(z(e,(r=t,L(n=>mr(n)&&n.startsWith(r)))));var r},"startsWith"),endsWith:o(t=>{return gr(z(e,(r=t,L(n=>mr(n)&&n.endsWith(r)))));var r},"endsWith"),minLength:o(t=>gr(z(e,(r=>L(n=>mr(n)&&n.length>=r))(t))),"minLength"),length:o(t=>gr(z(e,(r=>L(n=>mr(n)&&n.length===r))(t))),"length"),maxLength:o(t=>gr(z(e,(r=>L(n=>mr(n)&&n.length<=r))(t))),"maxLength"),includes:o(t=>{return gr(z(e,(r=t,L(n=>mr(n)&&n.includes(r)))));var r},"includes"),regex:o(t=>{return gr(z(e,(r=t,L(n=>mr(n)&&!!n.match(r)))));var r},"regex")}),"j"),zL=gr(L(mr)),Tt=o(e=>Object.assign(Ke(e),{between:o((t,r)=>Tt(z(e,((n,i)=>L(s=>It(s)&&n<=s&&i>=s))(t,r))),"between"),lt:o(t=>Tt(z(e,(r=>L(n=>It(n)&&n<r))(t))),"lt"),gt:o(t=>Tt(z(e,(r=>L(n=>It(n)&&n>r))(t))),"gt"),lte:o(t=>Tt(z(e,(r=>L(n=>It(n)&&n<=r))(t))),"lte"),gte:o(t=>Tt(z(e,(r=>L(n=>It(n)&&n>=r))(t))),"gte"),int:o(()=>Tt(z(e,L(t=>It(t)&&Number.isInteger(t)))),"int"),finite:o(()=>Tt(z(e,L(t=>It(t)&&Number.isFinite(t)))),"finite"),positive:o(()=>Tt(z(e,L(t=>It(t)&&t>0))),"positive"),negative:o(()=>Tt(z(e,L(t=>It(t)&&t<0))),"negative")}),"x"),KL=Tt(L(It)),yr=o(e=>Object.assign(Ke(e),{between:o((t,r)=>yr(z(e,((n,i)=>L(s=>hr(s)&&n<=s&&i>=s))(t,r))),"between"),lt:o(t=>yr(z(e,(r=>L(n=>hr(n)&&n<r))(t))),"lt"),gt:o(t=>yr(z(e,(r=>L(n=>hr(n)&&n>r))(t))),"gt"),lte:o(t=>yr(z(e,(r=>L(n=>hr(n)&&n<=r))(t))),"lte"),gte:o(t=>yr(z(e,(r=>L(n=>hr(n)&&n>=r))(t))),"gte"),positive:o(()=>yr(z(e,L(t=>hr(t)&&t>0))),"positive"),negative:o(()=>yr(z(e,L(t=>hr(t)&&t<0))),"negative")}),"A"),QL=yr(L(hr)),WL=Ke(L(function(e){return typeof e=="boolean"})),YL=Ke(L(function(e){return typeof e=="symbol"})),JL=Ke(L(function(e){return e==null})),XL=Ke(L(function(e){return e!=null}));var of=class of extends Error{constructor(t){let r;try{r=JSON.stringify(t)}catch{r=t}super(`Pattern matching error: no pattern matches value ${r}`),this.input=void 0,this.input=t}};o(of,"W");var tf=of,rf={matched:!1,value:void 0};function ye(e){return new nf(e,rf)}o(ye,"z");var go=class go{constructor(t,r){this.input=void 0,this.state=void 0,this.input=t,this.state=r}with(...t){if(this.state.matched)return this;let r=t[t.length-1],n=[t[0]],i;t.length===3&&typeof t[1]=="function"?i=t[1]:t.length>2&&n.push(...t.slice(1,t.length-1));let s=!1,a={},c=o((l,f)=>{s=!0,a[l]=f},"a"),u=!n.some(l=>Rt(l,this.input,c))||i&&!i(this.input)?rf:{matched:!0,value:r(s?la in a?a[la]:a:this.input,this.input)};return new go(this.input,u)}when(t,r){if(this.state.matched)return this;let n=!!t(this.input);return new go(this.input,n?{matched:!0,value:r(this.input,this.input)}:rf)}otherwise(t){return this.state.matched?this.state.value:t(this.input)}exhaustive(){if(this.state.matched)return this.state.value;throw new tf(this.input)}run(){return this.exhaustive()}returnType(){return this}};o(go,"I");var nf=go;var sf=2,lS=["application/octet-stream","multipart/form-data","application/x-www-form-urlencoded","*/*"],pS=["query","header","path"],Kr=["get","put","post","delete","options","head","patch","trace"],fS=["string","number","integer","boolean"],Xn=["allOf","anyOf","oneOf"];var mS=o(e=>`#/components/schemas/${e}`,"getSchemaRef"),Qr=o(e=>e[1]==="/"?e:"#/"+e.slice(1),"autocorrectRef"),ei=o(e=>Qr(e).split("/").at(-1),"getSchemaNameByRef");function cf(e){let t=JN(e).normalize("NFKD").trim().replace(/\s+/g,"_").replace(/--+/g,"-").replace(/-+/g,"_").replace(/[^\w-]+/g,"_");return oe(t)}o(cf,"normalizeString");function hS(e){return/^[a-zA-Z]\w*$/.test(e)?e:`"${e}"`}o(hS,"wrapWithQuotesIfNeeded");function gS(e){return typeof e=="string"&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}o(gS,"unwrapQuotesIfNeeded");function JN(e){let t=Number(e[0]);return typeof t=="number"&&!Number.isNaN(t)?"_"+e:e}o(JN,"prefixStringStartingWithNumberIfNeeded");function uf(e){let t=e.replaceAll("_","#");return oe(t.replaceAll("-","_")).replaceAll("#","_")}o(uf,"pathParamToVariableName");var Bt=o(e=>fS.includes(e),"isPrimitiveType");function yS(e){return e.replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/([\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F-\u009F\uFFFE\uFFFF])/g,(t,r)=>{let n=r.codePointAt(),i=n.toString(16);return n<=255?`\\x${`00${i}`.slice(-2)}`:`\\u${`0000${i}`.slice(-4)}`}).replace(/\//g,"\\/")}o(yS,"escapeControlCharacters");function Qe(e){return e.includes("application/")&&e.includes("json")||lS.includes(e)||e.includes("text/")}o(Qe,"isParamMediaTypeAllowed");function vo(e){return e>=200&&e<300}o(vo,"isMainResponseStatus");function pa(e){return!(e>=200&&e<300)}o(pa,"isErrorStatus");function ti(e){return e.startsWith("application/")}o(ti,"isMediaTypeAllowed");var dS=/({\w+})/g,XN=/[^\w\-]+/g;function vS(e){e=U(eS(e.replaceAll("/","-")).replaceAll("-",""));let t=[...e.matchAll(dS)];if(t.length>0){let r=t.sort((n,i)=>n.index-i.index)[t.length-1][0];e=`${e.replace(dS,"")}By${U(r.slice(1,-1))}`}return e.replace(XN,"_")}o(vS,"pathToVariableName");var af=/{(\b\w+(?:-\w+)*\b)}/g;function SS(e){let t=e.match(af);return t===null?e.replaceAll(af,":$1"):(t.forEach(r=>{let n=uf(r.replaceAll(af,":$1"));e=e.replaceAll(r,n)}),e)}o(SS,"replaceHyphenatedPath");var bS=o(e=>{let t=e["x-enumNames"],r=Array.isArray(t)&&t.length>0,n=!!e.schema&&$e(e.schema)&&e.schema.type==="string";return r&&n},"isSortingParameterObject"),Wr=o((e,t)=>t.excludePathRegex?new RegExp(t.excludePathRegex).test(e):!1,"isPathExcluded");function Nt(e){return tS(e)}o(Nt,"formatTag");function Sr(e,t){var n;let r=(n=e.tags)==null?void 0:n[0];return Nt(r??t.defaultTag)}o(Sr,"getOperationTag");function _S(e,t){return t.excludeTags.some(r=>r.toLowerCase()===e.toLowerCase())}o(_S,"isTagExcluded");function Oe(e,t){if(!e)return;let{data:r,onSchema:n}=t;if(D(e)&&n({type:"reference",schema:e,data:r})===!0)return;let i=e;if(Xn.some(s=>s in i&&i[s])){let s=i.allOf??i.anyOf??i.oneOf??[];for(let a of s)(n==null?void 0:n({type:"composite",parentSchema:e,schema:a,data:r}))!==!0&&Oe(a,{data:r,onSchema:n})}if(i.properties)for(let[s,a]of Object.entries(i.properties))n({type:"property",parentSchema:e,schema:a,data:r,propertyName:s})!==!0&&Oe(a,t);if(i.additionalProperties&&typeof i.additionalProperties=="object"){if(n({type:"additionalProperties",parentSchema:e,schema:i.additionalProperties,data:r})===!0)return;Oe(i.additionalProperties,t)}if(i.type==="array"){let s=e.items;if(n({type:"array",parentSchema:e,schema:s,data:r})===!0)return;Oe(s,t)}}o(Oe,"iterateSchema");var Ct=o((e,t)=>Wp(U(cf(e)),t),"getZodSchemaName"),So=o((e,t,r)=>Wp(U(cf(e)),`${t}${r}`),"getEnumZodSchemaName"),ue=o(e=>!e.startsWith("z."),"isNamedZodSchema"),PS=o(e=>e.startsWith(po),"isEnumZodSchema"),Yr=o((e,t,r)=>t?e:`${r}_${e}`,"getZodSchemaOperationName"),fa=o(e=>oe(`${e}_${Qv}`),"getBodyZodSchemaName"),ES=o((e,t)=>oe(`${e}_${t}${Wv}`),"getParamZodSchemaName"),eC=o(e=>oe(`${e}${Yv}`),"getMainResponseZodSchemaName"),tC=o((e,t)=>oe(`${e}_${t}_${Jv}`),"getErrorResponseZodSchemaName");function da({statusCode:e,operationName:t,isUniqueOperationName:r,tag:n}){let i=Number(e),s=Yr(t,r,n);return!vo(i)&&e!=="default"&&pa(i)?tC(s,e):eC(s)}o(da,"getResponseZodSchemaName");function bo(e){return["minimum","exclusiveMinimum","maximum","exclusiveMaximum","minItems","minLength","minProperties","maxItems","maxLength","maxProperties","default","example"].filter(n=>e[n]).reduce((n,i)=>[...n,`${U(iS(i))}: \`${e[i]}\``],[])}o(bo,"getSchemaDescriptions");var _o=o((e,t)=>rS(e,t.schemaSuffix),"getZodSchemaInferedTypeName"),$S=o((e,t)=>ue(t)?`${e.options.tsNamespaces?`${G({type:"models",tag:e.getTagByZodSchemaName(t),options:e.options})}.`:""}${t}`:t,"getImportedZodSchemaName"),br=o((e,t,r)=>{if(!ue(t))return t===lo?"void":t;let n=e.getTagByZodSchemaName(t);return`${e.options.tsNamespaces&&n!==r?`${G({type:"models",tag:n,options:e.options})}.`:""}${_o(t,e.options)}`},"getImportedZodSchemaInferedTypeName");function OS(e){var t;return e.isEnum?"enum":((t=e.schemaObj)==null?void 0:t.type)??"object"}o(OS,"getZodSchemaType");function xS(e){if(e.schemaObj)return[e.schemaObj.description,...bo(e.schemaObj).join(". ")].filter(Boolean)}o(xS,"getZodSchemaDescription");function wS(e,t,r){var n;if(D(t)){let i=e.getZodSchemaNameByRef(t.$ref);return i?br(e,i,r):void 0}if(ca(t)){if(!D(t.items))return`${((n=t.items)==null?void 0:n.type)??"unknown"}[]`;let i=e.getZodSchemaNameByRef(t.items.$ref);return i?`${br(e,i,r)}[]`:void 0}if(Xn.some(i=>i in t&&t[i])){let i=t.allOf??t.anyOf??t.oneOf??[];if(i.length>0)return wS(e,i[0],r)}return t.type}o(wS,"getType");function AS(e,t,r){if(!t.schemaObj)return[];let n="[0]",i="[key]",s={},a=o(c=>{var l;if(c.type==="reference")return!0;if(c.type==="composite")return;let u=[...((l=c.data)==null?void 0:l.pathSegments)??[]];if(c.type==="array"?u.push(n):c.type==="property"?u.push(c.propertyName):c.type==="additionalProperties"&&u.push(i),c.schema&&u[u.length-1]!==n){let f=e.resolveObject(c.schema),p=[f.description,...bo(f)].filter(Boolean),d=u.join(".");s[d]&&"type"in c.schema&&c.schema.type==="object"||(delete s[d],s[d]={type:wS(e,c.schema,r)??"unknown",description:p.join(". ")})}return Oe(c.schema,{data:{pathSegments:[...u]},onSchema:a}),!0},"onSchema");return"allOf"in t.schemaObj&&t.schemaObj.allOf&&t.schemaObj.allOf.forEach(c=>{if(D(c)){let u=e.resolveObject(c);Oe(u,{data:{pathSegments:[]},onSchema:a})}}),Oe(t.schemaObj,{data:{pathSegments:[]},onSchema:a}),s}o(AS,"getZodSchemaPropertyDescriptions");function ma(e){return ye(e).with("string",()=>"string").with("number",()=>"number").with("integer",()=>"number").with("boolean",()=>"boolean").exhaustive()}o(ma,"primitiveTypeToTsType");function ri({zodSchemaName:e,schema:t,resolver:r}){let n="void",i;e&&ue(e)?(n=br(r,e),i=r.getTagByZodSchemaName(e)):t!=null&&t.type&&Bt(t==null?void 0:t.type)&&(n=ma(t==null?void 0:t.type));let s=n.split(".");return{type:s[s.length-1],...s.length>1?{namespace:s[0]}:{},...i?{importPath:Xr({type:"models",tag:i,includeTagDir:!0,options:r.options})}:{}}}o(ri,"getTsTypeBase");function Jr({schema:e,isCircular:t,parentTypes:r,resolver:n}){if(!e)return{metaType:"primitive"};for(let i of Xn){let s=e[i];if(s)if(s.length>1){let a=s.map(c=>{let u=n.resolveObject(c);return Jr({schema:u,parentTypes:r,resolver:n})});return a.every(({metaType:c})=>c==="object")?{metaType:"object",objectProperties:a.reduce((c,{objectProperties:u})=>{let l=u.map(({name:f})=>f);return[...c.filter(({name:f})=>!l.includes(f)),...u]},[])}:{metaType:"composite",[i]:a}}else e=n.resolveObject(s[0])}return e.type==="array"?{metaType:"array",arrayType:IS({arraySchema:e,resolver:n,parentTypes:r})}:(e.type==="object"||e.properties)&&t?{metaType:"object",objectProperties:[],isCircular:!0}:e.type==="object"||e.properties?{metaType:"object",objectProperties:rC({schema:e,parentTypes:r,resolver:n})}:{metaType:"primitive"}}o(Jr,"getSchemaTsMetaType");function IS({arraySchema:e,parentTypes:t,resolver:r}){let n,i;if(D(e.items)){let u=e.items.$ref;n=r.getZodSchemaNameByRef(u),i=r.getSchemaByRef(u)}else i=e.items;let s=ri({zodSchemaName:n,schema:i,resolver:r}),a=TS(s,t),c=Jr({schema:i,isCircular:a,parentTypes:[...t,s],resolver:r});return{...s,...c}}o(IS,"getArraySchemaTsType");function rC({schema:e,parentTypes:t,resolver:r}){return Object.entries((e==null?void 0:e.properties)??{}).map(([n,i])=>{var a;let s=((a=e==null?void 0:e.required)==null?void 0:a.includes(n))??!1;if(D(i)){let c=r.getZodSchemaNameByRef(i.$ref),u=r.getSchemaByRef(i.$ref),l=ri({zodSchemaName:c,schema:u,resolver:r}),f=TS(l,t),p=Jr({schema:u,isCircular:f,parentTypes:[...t,l],resolver:r});return{name:n,isRequired:s,...l,...p}}else if(i.type==="array"){let c=IS({arraySchema:i,parentTypes:t,resolver:r});return{name:n,isRequired:s,type:"array",metaType:"array",arrayType:c}}else if(Bt(i.type))return{name:n,isRequired:s,type:ma(i.type),metaType:"primitive"};return{name:n,isRequired:s,type:"void",metaType:"primitive"}})}o(rC,"getSchemaTsProperties");function TS(e,t){return t.findIndex(({type:r,namespace:n})=>r===e.type&&n===e.namespace)>-1}o(TS,"getIsCircular");var Po=o(e=>fr(oe(e.operationName)),"getEndpointName");function RS(e,t){return`${t.tsNamespaces?`${G({type:"endpoints",tag:Eo(e,t),options:t})}.`:""}${Po(e)}`}o(RS,"getImportedEndpointName");var NS=o(e=>e.path.replace(/:([a-zA-Z0-9_]+)/g,"${$1}"),"getEndpointPath");function Eo(e,t){var n;let r=t.splitByTags?(n=e.tags)==null?void 0:n[0]:t.defaultTag;return Nt(r??t.defaultTag)}o(Eo,"getEndpointTag");function $o(e,t,r){let n=t.parameters.map(i=>{var a,c,u,l;let s="string";if(ue(i.zodSchema))s=br(e,i.zodSchema);else if((a=i.parameterObject)!=null&&a.schema&&$e(i.parameterObject.schema)){let f=(u=(c=i.parameterObject)==null?void 0:c.schema)==null?void 0:u.type;f&&Bt(f)&&(s=ma(f))}return{name:At(i.name),type:s,paramType:i.type,required:((l=i.parameterObject)==null?void 0:l.required)??!0,parameterObject:i.parameterObject,bodyObject:i.bodyObject}});return r!=null&&r.includeFileParam&&t.mediaUpload&&n.push({name:"file",type:"File",paramType:"Body",required:!0,parameterObject:void 0,bodyObject:void 0}),n.sort((i,s)=>{if(i.required===s.required){let a=["Path","Body","Query","Header"];return a.indexOf(i.paramType)-a.indexOf(s.paramType)}return i.required?-1:1}).filter(i=>(!(r!=null&&r.excludeBodyParam)||i.name!==sa)&&(!(r!=null&&r.excludePageParam)||i.name!==mo.pageParamName)&&(!(r!=null&&r.includeOnlyRequiredParams)||i.required)).map(i=>({...i,name:r!=null&&r.replacePageParam&&i.name===mo.pageParamName?"pageParam":i.name}))}o($o,"mapEndpointParamsToFunctionParams");function CS(e){let t=e.parameters.filter(i=>i.type==="Query").map(i=>{let s=aS(i.name)?i.name:`"${i.name}"`,a=At(i.name);return{...i,name:s,value:a}}),r={};return e.requestFormat!==Jp["Content-Type"]&&(r["Content-Type"]=`'${e.requestFormat}'`),e.responseFormat&&e.responseFormat!==Jp.Accept&&(r.Accept=`'${e.responseFormat}'`),e.parameters.filter(i=>i.type==="Header").forEach(i=>{r[i.name]=At(i.name)}),{...t.length>0?{params:t}:{},...Object.keys(r).length?{headers:r}:{}}}o(CS,"getEndpointConfig");function kS(e,t){return t.filter(r=>Ee(r)&&r.parameters.filter(n=>{var i;return(i=n.parameterObject)==null?void 0:i.required}).every(n=>e.parameters.some(i=>i.name===n.name))&&r.response===e.response)}o(kS,"getUpdateQueryEndpoints");function _r({resolver:e,tag:t,zodSchemas:r=[],zodSchemasAsTypes:n=[]}){let i="models",s=o(u=>e.getTagByZodSchemaName(u),"getTag"),a=lf({type:i,tag:t,entities:r,getTag:s,getEntityName:o(u=>u,"getEntityName"),options:e.options}),c=lf({type:i,tag:t,entities:n,getTag:s,getEntityName:o(u=>_o(u,e.options),"getEntityName"),options:e.options});return nC(e.options,a,c)}o(_r,"getModelsImports");function jS({tag:e,endpoints:t,options:r}){return lf({type:"endpoints",tag:e,entities:t,getTag:o(n=>Eo(n,r),"getTag"),getEntityName:Po,options:r})}o(jS,"getEndpointsImports");function qS({tags:e,entityName:t,getAliasEntityName:r,type:n,options:i}){let s=new Map;return e.forEach(a=>{let c=`${t}${r?` as ${r(a)}`:""}`;s.has(a)?i.tsNamespaces||s.get(a).bindings.push(c):s.set(a,{bindings:[i.tsNamespaces?G({type:n,tag:a,options:i}):c],from:`${Pr(i)}${Xr({type:n,tag:a,includeTagDir:!0,options:i})}`})}),Array.from(s.values())}o(qS,"getEntityImports");function Pr(e){let t=Kp;return e.importPath==="relative"?t="../":e.importPath==="absolute"?t=e.output:new RegExp(`${zp}`,"g").test(e.output)&&(t=e.output.replace(new RegExp(`.*${zp}`,"g"),Kp)),`${t}/`.replace(/\/\//g,"/")}o(Pr,"getImportPath");function lf({type:e="models",tag:t,entities:r,getTag:n,getEntityName:i,options:s}){let a=new Map;return r.forEach(c=>{let u=n(c);if(a.has(u))s.tsNamespaces||a.get(u).bindings.push(i(c));else{let l=t===u;a.set(u,{bindings:[s.tsNamespaces?G({type:e,tag:u,options:s}):i(c)],from:`${l?"./":Pr(s)}${Xr({type:e,tag:u,includeTagDir:!l,options:s})}`})}}),Array.from(a.values())}o(lf,"getImports");function nC(e,...t){let r=new Map;return t.forEach(n=>{n.forEach(i=>{r.has(i.from)?e.tsNamespaces||r.get(i.from).bindings.push(...i.bindings):r.set(i.from,i)})}),Array.from(r.values()).map(n=>({...n,bindings:Le(n.bindings)}))}o(nC,"mergeImports");function ni({fileName:e,extension:t}){return`${e}.${t}`}o(ni,"getFileNameWithExtension");function MS({type:e,tag:t,options:r,includeTagDir:n=!0}){let i=r.configs[e].outputFileNameSuffix;return t?`${n?`${fr(t)}/`:""}${fr(t)}.${i}`:i}o(MS,"getTagFileNameWithoutExtension");function Xr(...e){return MS(...e)}o(Xr,"getTagImportPath");function DS(...e){return`${MS(...e)}.ts`}o(DS,"getTagFileName");var G=o(({type:e,tag:t,options:r})=>`${U(t)}${r.configs[e].namespaceSuffix}`,"getNamespaceName");function LS(e){return e.standalone?`${Pr(e)}${Js.fileName}`:e.restClientImportPath}o(LS,"getAppRestClientImportPath");function FS(e){return e.standalone?`${Pr(e)}${Ys.reactQueryTypes.fileName}`:e.queryTypesImportPath}o(FS,"getQueryTypesImportPath");function HS(e){return`${Pr(e)}${Xs.fileName}`}o(HS,"getQueryModulesImportPath");function VS(e){return`${Pr(e)}${ea.fileName}`}o(VS,"getMutationEffectsImportPath");function BS(e){return`${Pr(e)}${ta.fileName}`}o(BS,"getZodExtendedImportPath");var pf=["break","case","catch","class","const","continue","debugger","default","delete","do","else","export","extends","false","finally","for","function","if","import","in","instanceof","new","null","return","super","switch","this","throw","true","try","typeof","var","void","while","with"];function en(e,t){let r={};return Object.keys(e).forEach(n=>{t.includes(n)&&(r[n]=e[n])}),r}o(en,"pick");function ii(e,t){let r=e.deprecated&&!t.withDeprecatedEndpoints,n=Sr(e,t),i=_S(n,t);return r||i}o(ii,"isOperationExcluded");function ff({path:e,method:t,operation:r,options:n,tag:i,keepOperationTag:s,keepOperationPrefix:a}){let c=`${t}${vS(e)}`,u=r.operationId?At(r.operationId):c;if(n.removeOperationPrefixEndingWith&&a)u=u.split(n.removeOperationPrefixEndingWith).map((f,p)=>p===0?f:U(f)).join("");else if(n.removeOperationPrefixEndingWith&&!a){let l=new RegExp(`^.*${n.removeOperationPrefixEndingWith}`);u=u.replace(l,"")}if(n.tsNamespaces&&!s){let l=oS(u,i);l===""?u=t.toLowerCase():pf.includes(l)||(u=l)}return pf.includes(u)?c:u}o(ff,"getOperationName");function Oo({operationsByTag:e,...t}){let{operation:r,options:n}=t,i=n.splitByTags?Sr(r,n):n.defaultTag,s=o(a=>{let c=ff({...t,tag:i,keepOperationTag:a});if(e[i].filter(l=>ff({...t,operation:l,tag:i,keepOperationTag:a})===c).length===1)return c},"operationName");return s()??s(!0)??ff({...t,tag:i,keepOperationTag:!0,keepOperationPrefix:!0})}o(Oo,"getUniqueOperationName");function US(e,t,r){let n=[];for(let i in e.paths){if(Wr(i,r))continue;let s=e.paths[i],a=en(s,Kr);for(let c in a){let u=a[c];if(!u||ii(u,r))continue;let l=Oo({path:i,method:c,operation:u,operationsByTag:t,options:r});n.push(l)}}return n}o(US,"getUniqueOperationNamesWithoutSplitByTags");function GS(e,t){let r={};for(let n in e.paths){if(Wr(n,t))continue;let i=e.paths[n],s=en(i,Kr);for(let a in s){let c=s[a];if(!c||ii(c,t))continue;let u=t.splitByTags?Sr(c,t):t.defaultTag;r[u]||(r[u]=[]),r[u].push(c)}}return r}o(GS,"getOperationsByTag");var ZS={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"};function xo(e){return{type:"invalid-schema",message:e}}o(xo,"getInvalidSchemaError");function zS(e){return{type:"invalid-operation-id",message:`Operation ${e}`}}o(zS,"getInvalidOperationIdError");function KS(e,t){return{type:"missing-path-parameter",message:`Path ${t} is missing [${e.map(({name:r})=>r).join(", ")}]`}}o(KS,"getMissingPathParameterError");function QS(e){return{type:"not-allowed-inline-enum",message:`${e} is missing @IsEnum() and @ApiProperty(enum:, enumName:)`}}o(QS,"getNotAllowedInlineEnumError");function WS(e){return{type:"not-allowed-circular-schema",message:e}}o(WS,"getNotAllowedCircularSchemaError");function YS(e,t,r){return{type:"missing-acl-condition-property",message:`Condition property ${e} is not found in parameters or body in operation ${ga(t,r)}`}}o(YS,"getMissingAclConditionPropertyError");function df(e,t,r){return{type:"missing-status-code",message:`Missing HTTP status code ${ha(e)} in operation ${ga(t,r)}`}}o(df,"getMissingStatusCodeError");function JS(e,t,r){return{type:"invalid-status-code",message:`Operation ${ga(t,r)} expected HTTP status code ${ha(e.expected)} but received ${ha(e.received)}`}}o(JS,"getInvalidStatusCodeError");function XS(e,t,r){return{type:"multiple-success-status-codes",message:`Operation ${ga(t,r)} has multiple success HTTP status codes: ${e.map(ha).join(", ")}`}}o(XS,"getMultipleSuccessStatusCodesError");function ga(e,t){return e.operationId??`${t.method} ${t.path}`}o(ga,"getOperationDescriptor");function ha(e){return`${e} (${ZS[e]})`}o(ha,"getStatusCodeDescription");function kt({schema:e,meta:t,options:r}){let n=[];ye(e.type).with("string",()=>n.push(sC(e))).with("number","integer",()=>n.push(cC(e))).with("array",()=>n.push(uC(e))).otherwise(()=>{}),typeof e.description=="string"&&e.description!==""&&r.withDescription&&([`
73
73
  `,"\r",`\r
74
74
  `].some(s=>String.prototype.includes.call(e.description,s))?n.push(`describe(\`${e.description}\`)`):n.push(`describe("${e.description}")`));let i=n.concat(iC({schema:e,meta:t,options:r}),r.withDefaultValues!==!1?oC(e):[]).filter(Boolean).join(".");return i?`.${i}`:""}o(kt,"getZodChain");function iC({schema:e,meta:t,options:r}){return e.nullable&&!(t!=null&&t.isRequired)?"nullish()":e.nullable||r.replaceOptionalWithNullish&&(t!=null&&t.isParentPartial)?"nullable()":t!=null&&t.isRequired?"":r.replaceOptionalWithNullish?"nullish()":"optional()"}o(iC,"getZodChainablePresence");function oC(e){return e.default!==void 0?`default(${ye(e.type).with("number","integer",()=>gS(e.default)).otherwise(()=>JSON.stringify(e.default))})`:""}o(oC,"getZodChainableDefault");function sC(e){let t=[];if(e.enum||(e.minLength!==void 0&&t.push(`min(${e.minLength})`),e.maxLength!==void 0&&t.push(`max(${e.maxLength})`)),e.pattern&&t.push(`regex(${aC(e.pattern)})`),e.format){let r=ye(e.format).with("email",()=>"email()").with("hostname","uri",()=>"url()").with("uuid",()=>"uuid()").with("date-time",()=>"datetime({ offset: true })").otherwise(()=>"");r&&t.push(r)}return t.join(".")}o(sC,"getZodChainableStringValidations");function aC(e){return e.startsWith("/")&&e.endsWith("/")&&(e=e.slice(1,-1)),e=yS(e),`/${e}/`}o(aC,"formatPatternIfNeeded");function cC(e){let t=[];return e.enum?"":(e.type==="integer"&&t.push("int()"),e.minimum!==void 0?e.exclusiveMinimum===!0?t.push(`gt(${e.minimum})`):t.push(`gte(${e.minimum})`):typeof e.exclusiveMinimum=="number"&&t.push(`gt(${e.exclusiveMinimum})`),e.maximum!==void 0?e.exclusiveMaximum===!0?t.push(`lt(${e.maximum})`):t.push(`lte(${e.maximum})`):typeof e.exclusiveMaximum=="number"&&t.push(`lt(${e.exclusiveMaximum})`),e.multipleOf&&t.push(`multipleOf(${e.multipleOf})`),t.join("."))}o(cC,"getZodChainableNumberValidations");function uC(e){let t=[];return e.minItems&&t.push(`min(${e.minItems})`),e.maxItems&&t.push(`max(${e.maxItems})`),t.join(".")}o(uC,"getZodChainableArrayValidations");var tn=o(e=>e.reduce((t,r)=>t+r,0),"sum");function se(e,t){if(!t)return e;if(D(t))return e+2;if(Array.isArray(t.type))return t.type.length===1?Fe("oneOf")+se(e,{...t,type:t.type[0]}):e+Fe("oneOf")+tn(t.type.map(r=>se(0,{...t,type:r})));if(t.oneOf)return t.oneOf.length===1?Fe("oneOf")+se(e,t.oneOf[0]):e+Fe("oneOf")+tn(t.oneOf.map(r=>se(0,r)));if(t.anyOf)return t.anyOf.length===1?Fe("anyOf")+se(e,t.anyOf[0]):e+Fe("anyOf")+tn(t.anyOf.map(r=>se(0,r)));if(t.allOf)return t.allOf.length===1?Fe("allOf")+se(e,t.allOf[0]):e+Fe("allOf")+tn(t.allOf.map(r=>se(0,r)));if(!t.type)return e;if(Bt(t.type))return t.enum?e+eb(t)+Fe("enum")+tn(t.enum.map(r=>se(0,r))):e+eb(t);if(t.type==="array")return t.items?Fe("array")+se(e,t.items):Fe("array")+se(e);if(t.type==="object"||t.properties||t.additionalProperties){if(t.properties){let r=Object.values(t.properties);e+=Fe("object")+tn(r.map(n=>se(0,n)))}else e+=Fe("empty-object");t.additionalProperties&&(typeof t.additionalProperties=="object"?e+=se(0,t.additionalProperties):e+=se(1))}return e}o(se,"getOpenAPISchemaComplexity");function eb(e){return ye(e.type).with("string","number","integer","boolean",()=>1).otherwise(()=>0)}o(eb,"complexityByType");function Fe(e){return ye(e).with("oneOf",()=>2).with("anyOf",()=>3).with("allOf",()=>2).with("enum","array","empty-object",()=>1).with("object",()=>2).otherwise(()=>0)}o(Fe,"complexityByComposite");var mf=class mf{constructor(t,r,n={referencedBy:[]},i){this.schema=t;this.resolver=r;D(t)&&(this.ref=t.$ref),i&&(this.enumRef=i),this.meta={...n,referencedBy:[...(n==null?void 0:n.referencedBy)??[]]},this.ref&&this.meta.referencedBy.push(this)}code;ref;enumRef;children=[];meta;getCodeString(t,r){var s,a;if(!this.ref&&this.code)return this.code;if(!this.ref)throw new Error("Zod schema is missing both ref and code");let n=(s=this.resolver)==null?void 0:s.getZodSchemaNameByRef(this.ref);if(!n)return this.ref;let i=(a=this.resolver)==null?void 0:a.getTagByZodSchemaName(n);return r!=null&&r.tsNamespaces&&i&&i!==t?`${G({type:"models",tag:i,options:r})}.${n}`:n}get complexity(){return se(0,this.schema)}assign(t){return this.code=t,this}inherit(t){return t&&t.children.push(this),this}};o(mf,"ZodSchema");var wo=mf;function Q({schema:e,resolver:t,meta:r,tag:n}){var g;let i=new wo(e,t,r),s={parent:i.inherit(r==null?void 0:r.parent),referencedBy:[...i.meta.referencedBy]},a={resolver:t,meta:s,tag:n};if(D(e))return lC({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});let c=fC({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(c)return c;let u=pC({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(u)return u;let l=dC({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(l)return l;let f=mC({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(f)return f;let p=hC({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(p)return p;let d=t.options.allReadonly?".readonly()":"";if(ca(e))return e.items?i.assign(`z.array(${Q({...a,schema:e.items}).getCodeString(n,t.options)}${kt({schema:e.items,meta:{...s,isRequired:!0},options:t.options})})${d}`):i.assign(`z.array(z.any())${d}`);let m=e.type?e.type.toLowerCase():void 0;if(m==="object"||e.properties||e.additionalProperties){let y=e.required&&e.required.length>0,v=t.options.withImplicitRequiredProps?!1:e.properties&&!((g=e.required)!=null&&g.length),S="{}";e.properties&&(S="{ "+Object.entries(e.properties).map(([w,N])=>{var te;let je={...s,isRequired:v?!0:y?(te=e.required)==null?void 0:te.includes(w):t.options.withImplicitRequiredProps,name:w,isParentPartial:v},pe=N;if(D(N)&&t&&(pe=t.getSchemaByRef(N.$ref),!pe))throw new Error(`Schema ${N.$ref} not found`);let J=Q({...a,schema:N,meta:je}).getCodeString(n,t.options)+kt({schema:pe,meta:je,options:t.options});return[w,J]}).map(([w,N])=>`${hS(w)}: ${N}`).join(", ")+" }");let b="";e.additionalProperties&&(b=`.catchall(${typeof e.additionalProperties=="object"&&Object.keys(e.additionalProperties).length>0?Q({...a,schema:e.additionalProperties}).getCodeString(n,t.options)+kt({schema:e.additionalProperties,meta:{...s,isRequired:!0},options:t.options}):"z.any()"})`);let P=v?".partial()":"",$=t.options.strictObjects?".strict()":"";return i.assign(`z.object(${S})${P}${$}${b}${d}`)}if(m==="any")return i.assign("z.any()");if(!m)return i.assign("z.unknown()");throw new Error(`Unsupported schema type: ${m}`)}o(Q,"getZodSchema");function lC({schema:e,zodSchema:t,resolver:r,meta:n,tag:i}){if(!D(e))return;let s=t.meta.referencedBy.slice(0,-1).map(u=>u.ref?r.getZodSchemaNameByRef(u.ref)??u.ref:void 0).filter(Boolean),a=r.getZodSchemaNameByRef(e.$ref);if(s.length>1&&s.includes(a))return t.assign(r.getCodeByZodSchemaName(t.ref));let c=r.getCodeByZodSchemaName(e.$ref);if(!c){let u=r.getSchemaByRef(e.$ref);if(!u)throw new Error(`Schema ${e.$ref} not found`);c=Q({schema:u,resolver:r,meta:n,tag:i}).getCodeString(i,r.options)}return r.getCodeByZodSchemaName(a)||r.setZodSchema(a,c,i),t}o(lC,"getReferenceZodSchema");function pC({schema:e,zodSchema:t,resolver:r,meta:n,tag:i}){var a;if(!$e(e)||!e.oneOf)return;if(e.oneOf.length===1){let c=Q({schema:e.oneOf[0],resolver:r,meta:n,tag:i});return t.assign(c.getCodeString(i,r.options))}let s=(a=e.oneOf)==null?void 0:a.some(c=>$e(c)&&((c==null?void 0:c.allOf)||[]).length>1);if(e.discriminator&&!s){let c=e.discriminator.propertyName;return t.assign(`
75
75
  z.discriminatedUnion("${c}", [${e.oneOf.map(u=>Q({schema:u,resolver:r,meta:n,tag:i}).getCodeString(i,r.options)).join(", ")}])
package/dist/sh.js CHANGED
@@ -137,7 +137,7 @@ ${y.join(`
137
137
  `:`
138
138
  `)+r,i=n+1,n=e.indexOf(`
139
139
  `,i)}while(n!==-1);return s+=e.slice(i),s}o(fb,"stringEncaseCRLFWithFirstIndex");var{stdout:pb,stderr:db}=ub,Cf=Symbol("GENERATOR"),mo=Symbol("STYLER"),Cs=Symbol("IS_EMPTY"),hb=["ansi","ansi","ansi256","ansi16m"],go=Object.create(null),B$=o((e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let r=pb?pb.level:0;e.level=t.level===void 0?r:t.level},"applyOptions"),Nf=class Nf{constructor(t){return mb(t)}};o(Nf,"Chalk");var Nc=Nf,mb=o(e=>{let t=o((...r)=>r.join(" "),"chalk");return B$(t,e),Object.setPrototypeOf(t,Ts.prototype),t},"chalkFactory");function Ts(e){return mb(e)}o(Ts,"createChalk");Object.setPrototypeOf(Ts.prototype,Function.prototype);for(let[e,t]of Object.entries(Er))go[e]={get(){let r=jc(this,Rf(t.open,t.close,this[mo]),this[Cs]);return Object.defineProperty(this,e,{value:r}),r}};go.visible={get(){let e=jc(this,this[mo],!0);return Object.defineProperty(this,"visible",{value:e}),e}};var Tf=o((e,t,r,...n)=>e==="rgb"?t==="ansi16m"?Er[r].ansi16m(...n):t==="ansi256"?Er[r].ansi256(Er.rgbToAnsi256(...n)):Er[r].ansi(Er.rgbToAnsi(...n)):e==="hex"?Tf("rgb",t,r,...Er.hexToRgb(...n)):Er[r][e](...n),"getModelAnsi"),V$=["rgb","hex","ansi256"];for(let e of V$){go[e]={get(){let{level:r}=this;return function(...n){let i=Rf(Tf(e,hb[r],"color",...n),Er.color.close,this[mo]);return jc(this,i,this[Cs])}}};let t="bg"+e[0].toUpperCase()+e.slice(1);go[t]={get(){let{level:r}=this;return function(...n){let i=Rf(Tf(e,hb[r],"bgColor",...n),Er.bgColor.close,this[mo]);return jc(this,i,this[Cs])}}}}var U$=Object.defineProperties(()=>{},{...go,level:{enumerable:!0,get(){return this[Cf].level},set(e){this[Cf].level=e}}}),Rf=o((e,t,r)=>{let n,i;return r===void 0?(n=e,i=t):(n=r.openAll+e,i=t+r.closeAll),{open:e,close:t,openAll:n,closeAll:i,parent:r}},"createStyler"),jc=o((e,t,r)=>{let n=o((...i)=>G$(n,i.length===1?""+i[0]:i.join(" ")),"builder");return Object.setPrototypeOf(n,U$),n[Cf]=e,n[mo]=t,n[Cs]=r,n},"createBuilder"),G$=o((e,t)=>{if(e.level<=0||!t)return e[Cs]?"":t;let r=e[mo];if(r===void 0)return t;let{openAll:n,closeAll:i}=r;if(t.includes("\x1B"))for(;r!==void 0;)t=lb(t,r.close,r.open),r=r.parent;let s=t.indexOf(`
140
- `);return s!==-1&&(t=fb(t,i,n,s)),n+t+i},"applyStyle");Object.defineProperties(Ts.prototype,go);var H6=Ts(),B6=Ts({level:db?db.level:0});var Hr=new Nc;function Rs(e,t,r){console.log(r!==void 0&&r!==t?`${Hr.yellow(`${e}:`.padEnd(20))}${Hr.magenta(t)}`:`${`${e}:`.padEnd(20)}${t}`)}o(Rs,"logVariable");function ur(e){console.log(`[INFO] ${e}`)}o(ur,"logInfo");function Cn(e){console.log(Hr.green(`[SUCCESS] ${e}`))}o(Cn,"logSuccess");function Ns(e,t){e instanceof Error?(console.log(Hr.red(`[ERROR] ${t||e.message}`)),process.env.VERBOSE&&console.error(e)):console.log(Hr.red(`[ERROR] ${e}`))}o(Ns,"logError");function Mc(e){console.log(Hr.bgYellow(`==== ${e} ====`))}o(Mc,"logBanner");var gb=mt(require("fs"));function yo(){return"0.12.0"}o(yo,"getVersion");var t7=mt(bb());var jf=Symbol("options_key");function Pe(e){return(t,r)=>{var n,i;if(e!=null){let s={...Reflect.getMetadata(jf,t)||{},[r]:{...e,describe:e.envAlias?`${e.describe||""} [${e.envAlias}]`:e.describe,type:e.type||((i=(n=Reflect.getMetadata("design:type",t,r))==null?void 0:n.name)==null?void 0:i.toLowerCase())}};Reflect.defineMetadata(jf,s,t)}}}o(Pe,"YargOption");function vb(e){let t=Reflect.getMetadata(jf,e.prototype);if(!t)throw new Error(`Options for ${e.name} were not defined`);return t}o(vb,"getYargsOption");function kc(e){return async t=>t.options(z$(e)).middleware(async r=>await Z$(e,r),!0)}o(kc,"getBuilder");function z$(e){return Object.entries(vb(e)).reduce((t,[r,n])=>(t[r]=Object.fromEntries(Object.entries(n).filter(([i])=>!["envAlias","default"].includes(i))),t),{})}o(z$,"getYargsOptions");async function Z$(e,t){let r=new e;for(let[n,i]of Object.entries(vb(e)))r[n]=t[n]??i.default;return r}o(Z$,"loadYargsConfig");var bx=mt(Pm());var WO={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"},KO={"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 jr={query:"useQuery",infiniteQuery:"useInfiniteQuery",mutation:"useMutation"},YO={bindings:[jr.query,jr.infiniteQuery,jr.mutation],from:"@tanstack/react-query"},Pa={pageParamName:"page"},Bu={pageParamName:"page",totalItemsName:"totalItems",limitParamName:"limit"},xa="moduleName";var xm={"Content-Type":"application/json",Accept:"application/json"},Vu="data",$m="axios",Zn="config",Jr="AxiosRequestConfig",Uu={defaultImport:$m,bindings:[Jr],from:"axios"};var QO=o(e=>/^(?:[a-zA-Z_$][a-zA-Z0-9_$]*|[0-9]+)$/.test(e),"isValidPropertyName"),Wn=o(e=>e.replace(/^[^a-zA-Z_$]*/g,"").replace(/[^a-zA-Z0-9_$]+(\w)?/g,(t,r)=>(r==null?void 0:r.toUpperCase())??""),"invalidVariableNameCharactersToCamel");function xe(e){return e!=null&&Object.prototype.hasOwnProperty.call(e,"$ref")}o(xe,"isReferenceObject");function Tt(e){return!xe(e)}o(Tt,"isSchemaObject");function Gu(e){return e.type==="array"}o(Gu,"isArraySchemaObject");function JO(e){if(!e.allOf)throw new Error("Function inferRequiredSchema is specialized to handle item with required only in an allOf array.");let[t,r]=e.allOf.reduce((i,s)=>{if(Bq(s)){let a=s.required;i[0].push(...a??[])}else i[1].push(s);return i},[[],[]]),n={properties:t.reduce((i,s)=>(i[s]={},i),{}),type:"object",required:t};return{noRequiredOnlyAllof:r,composedRequiredSchema:n,patchRequiredSchemaInLoop:o((i,s)=>{if(xe(i)){let a=s(i.$ref);a&&n.required.forEach(c=>{var u;n.properties[c]=((u=a==null?void 0:a.properties)==null?void 0:u[c])??{}})}else{let a=i.properties??{};n.required.forEach(c=>{a[c]&&(n.properties[c]=a[c]??{})})}},"patchRequiredSchemaInLoop")}}o(JO,"inferRequiredSchema");var Bq=o(e=>!xe(e)&&!!e.required&&!e.type&&!e.properties&&!(e!=null&&e.allOf)&&!(e!=null&&e.anyOf)&&!e.oneOf,"isBrokenAllOfItem");var gn=Symbol.for("@ts-pattern/matcher"),Vq=Symbol.for("@ts-pattern/isVariadic"),Zu="@ts-pattern/anonymous-select-key",wm=o(e=>!!(e&&typeof e=="object"),"r"),zu=o(e=>e&&!!e[gn],"i"),tn=o((e,t,r)=>{if(zu(e)){let n=e[gn](),{matched:i,selections:s}=n.match(t);return i&&s&&Object.keys(s).forEach(a=>r(a,s[a])),i}if(wm(e)){if(!wm(t))return!1;if(Array.isArray(e)){if(!Array.isArray(t))return!1;let n=[],i=[],s=[];for(let a of e.keys()){let c=e[a];zu(c)&&c[Vq]?s.push(c):s.length?i.push(c):n.push(c)}if(s.length){if(s.length>1)throw new Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");if(t.length<n.length+i.length)return!1;let a=t.slice(0,n.length),c=i.length===0?[]:t.slice(-i.length),u=t.slice(n.length,i.length===0?1/0:-i.length);return n.every((l,p)=>tn(l,a[p],r))&&i.every((l,p)=>tn(l,c[p],r))&&(s.length===0||tn(s[0],u,r))}return e.length===t.length&&e.every((a,c)=>tn(a,t[c],r))}return Reflect.ownKeys(e).every(n=>{let i=e[n];return(n in t||zu(s=i)&&s[gn]().matcherType==="optional")&&tn(i,t[n],r);var s})}return Object.is(t,e)},"s"),Xn=o(e=>{var t,r,n;return wm(e)?zu(e)?(t=(r=(n=e[gn]()).getSelectionKeys)==null?void 0:r.call(n))!=null?t:[]:Array.isArray(e)?wa(e,Xn):wa(Object.values(e),Xn):[]},"o"),wa=o((e,t)=>e.reduce((r,n)=>r.concat(t(n)),[]),"c");function mr(e){return Object.assign(e,{optional:o(()=>Uq(e),"optional"),and:o(t=>Ve(e,t),"and"),or:o(t=>Gq(e,t),"or"),select:o(t=>t===void 0?XO(e):XO(t,e),"select")})}o(mr,"u");function Uq(e){return mr({[gn]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return t===void 0?(Xn(e).forEach(i=>n(i,void 0)),{matched:!0,selections:r}):{matched:tn(e,t,n),selections:r}},"match"),getSelectionKeys:o(()=>Xn(e),"getSelectionKeys"),matcherType:"optional"})})}o(Uq,"h");function Ve(...e){return mr({[gn]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return{matched:e.every(i=>tn(i,t,n)),selections:r}},"match"),getSelectionKeys:o(()=>wa(e,Xn),"getSelectionKeys"),matcherType:"and"})})}o(Ve,"m");function Gq(...e){return mr({[gn]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return wa(e,Xn).forEach(i=>n(i,void 0)),{matched:e.some(i=>tn(i,t,n)),selections:r}},"match"),getSelectionKeys:o(()=>wa(e,Xn),"getSelectionKeys"),matcherType:"or"})})}o(Gq,"d");function Ee(e){return{[gn]:()=>({match:o(t=>({matched:!!e(t)}),"match")})}}o(Ee,"p");function XO(...e){let t=typeof e[0]=="string"?e[0]:void 0,r=e.length===2?e[1]:typeof e[0]=="string"?void 0:e[0];return mr({[gn]:()=>({match:o(n=>{let i={[t??Zu]:n};return{matched:r===void 0||tn(r,n,(s,a)=>{i[s]=a}),selections:i}},"match"),getSelectionKeys:o(()=>[t??Zu].concat(r===void 0?[]:Xn(r)),"getSelectionKeys")})})}o(XO,"y");function Xr(e){return typeof e=="number"}o(Xr,"v");function Kn(e){return typeof e=="string"}o(Kn,"b");function Yn(e){return typeof e=="bigint"}o(Yn,"w");var vU=mr(Ee(function(e){return!0}));var Qn=o(e=>Object.assign(mr(e),{startsWith:o(t=>{return Qn(Ve(e,(r=t,Ee(n=>Kn(n)&&n.startsWith(r)))));var r},"startsWith"),endsWith:o(t=>{return Qn(Ve(e,(r=t,Ee(n=>Kn(n)&&n.endsWith(r)))));var r},"endsWith"),minLength:o(t=>Qn(Ve(e,(r=>Ee(n=>Kn(n)&&n.length>=r))(t))),"minLength"),length:o(t=>Qn(Ve(e,(r=>Ee(n=>Kn(n)&&n.length===r))(t))),"length"),maxLength:o(t=>Qn(Ve(e,(r=>Ee(n=>Kn(n)&&n.length<=r))(t))),"maxLength"),includes:o(t=>{return Qn(Ve(e,(r=t,Ee(n=>Kn(n)&&n.includes(r)))));var r},"includes"),regex:o(t=>{return Qn(Ve(e,(r=t,Ee(n=>Kn(n)&&!!n.match(r)))));var r},"regex")}),"j"),_U=Qn(Ee(Kn)),en=o(e=>Object.assign(mr(e),{between:o((t,r)=>en(Ve(e,((n,i)=>Ee(s=>Xr(s)&&n<=s&&i>=s))(t,r))),"between"),lt:o(t=>en(Ve(e,(r=>Ee(n=>Xr(n)&&n<r))(t))),"lt"),gt:o(t=>en(Ve(e,(r=>Ee(n=>Xr(n)&&n>r))(t))),"gt"),lte:o(t=>en(Ve(e,(r=>Ee(n=>Xr(n)&&n<=r))(t))),"lte"),gte:o(t=>en(Ve(e,(r=>Ee(n=>Xr(n)&&n>=r))(t))),"gte"),int:o(()=>en(Ve(e,Ee(t=>Xr(t)&&Number.isInteger(t)))),"int"),finite:o(()=>en(Ve(e,Ee(t=>Xr(t)&&Number.isFinite(t)))),"finite"),positive:o(()=>en(Ve(e,Ee(t=>Xr(t)&&t>0))),"positive"),negative:o(()=>en(Ve(e,Ee(t=>Xr(t)&&t<0))),"negative")}),"x"),SU=en(Ee(Xr)),Jn=o(e=>Object.assign(mr(e),{between:o((t,r)=>Jn(Ve(e,((n,i)=>Ee(s=>Yn(s)&&n<=s&&i>=s))(t,r))),"between"),lt:o(t=>Jn(Ve(e,(r=>Ee(n=>Yn(n)&&n<r))(t))),"lt"),gt:o(t=>Jn(Ve(e,(r=>Ee(n=>Yn(n)&&n>r))(t))),"gt"),lte:o(t=>Jn(Ve(e,(r=>Ee(n=>Yn(n)&&n<=r))(t))),"lte"),gte:o(t=>Jn(Ve(e,(r=>Ee(n=>Yn(n)&&n>=r))(t))),"gte"),positive:o(()=>Jn(Ve(e,Ee(t=>Yn(t)&&t>0))),"positive"),negative:o(()=>Jn(Ve(e,Ee(t=>Yn(t)&&t<0))),"negative")}),"A"),EU=Jn(Ee(Yn)),OU=mr(Ee(function(e){return typeof e=="boolean"})),PU=mr(Ee(function(e){return typeof e=="symbol"})),xU=mr(Ee(function(e){return e==null})),$U=mr(Ee(function(e){return e!=null}));var Tm=class Tm extends Error{constructor(t){let r;try{r=JSON.stringify(t)}catch{r=t}super(`Pattern matching error: no pattern matches value ${r}`),this.input=void 0,this.input=t}};o(Tm,"W");var Am=Tm,Im={matched:!1,value:void 0};function Pt(e){return new Cm(e,Im)}o(Pt,"z");var $a=class $a{constructor(t,r){this.input=void 0,this.state=void 0,this.input=t,this.state=r}with(...t){if(this.state.matched)return this;let r=t[t.length-1],n=[t[0]],i;t.length===3&&typeof t[1]=="function"?i=t[1]:t.length>2&&n.push(...t.slice(1,t.length-1));let s=!1,a={},c=o((l,p)=>{s=!0,a[l]=p},"a"),u=!n.some(l=>tn(l,this.input,c))||i&&!i(this.input)?Im:{matched:!0,value:r(s?Zu in a?a[Zu]:a:this.input,this.input)};return new $a(this.input,u)}when(t,r){if(this.state.matched)return this;let n=!!t(this.input);return new $a(this.input,n?{matched:!0,value:r(this.input,this.input)}:Im)}otherwise(t){return this.state.matched?this.state.value:t(this.input)}exhaustive(){if(this.state.matched)return this.state.value;throw new Am(this.input)}run(){return this.exhaustive()}returnType(){return this}};o($a,"I");var Cm=$a;var Rm=2,eP=["application/octet-stream","multipart/form-data","application/x-www-form-urlencoded","*/*"],tP=["query","header","path"],Vi=["get","put","post","delete","options","head","patch","trace"],rP=["string","number","integer","boolean"],Aa=["allOf","anyOf","oneOf"];var Le=o(e=>e.charAt(0).toUpperCase()+e.slice(1),"capitalize"),ei=o(e=>e.charAt(0).toLowerCase()+e.slice(1),"decapitalize"),nP=o(e=>e.replace(/(-\w)/g,t=>t[1].toUpperCase()),"kebabToCamel"),pt=o(e=>e.replace(/(_\w)/g,t=>t[1].toUpperCase()),"snakeToCamel"),iP=o(e=>e.replace(/[\W_]+(\w)?/g,(t,r)=>(r==null?void 0:r.toUpperCase())??""),"nonWordCharactersToCamel"),Nm=o((e,t="")=>e.endsWith(t)?e:`${e}${t}`,"suffixIfNeeded"),oP=o((e,t)=>e.replace(new RegExp(`${t}$`),""),"removeSuffix"),zq=o(e=>{var n;let t=e.reduce((i,s)=>({...i,[s]:(i[s]??0)+1}),{});return(n=Object.entries(t).sort((i,s)=>i[1]===s[1]?s[0].length-i[0].length:s[1]-i[1])[0])==null?void 0:n[0]},"getLongestMostCommon"),jm=o(e=>{let t=e.map(Le).map(sP).map(r=>Zq(r)).flat();return zq(t)},"getMostCommonAdjacentCombinationSplit"),sP=o(e=>e.split(/(?<![A-Z])(?=[A-Z])/).filter(Boolean),"splitByUppercase"),aP=o(e=>sP(e).join(" "),"camelToSpaceSeparated"),Zq=o((e,t=["dto","by","for","of","in","to","and","with"])=>{var n;let r=[];for(let i=0;i<e.length;i++)if(!t.includes(e[i].toLowerCase()))for(let s=i+1;s<=e.length;s++)t.includes((n=e[s-1])==null?void 0:n.toLowerCase())||r.push(e.slice(i,s).join(""));return r},"getAdjacentStringCombinations"),cP=o((e,t)=>{let r=t.replace(/es$|s$/g,""),n=new RegExp(`(${ei(r)}|${Le(r)})[a-z]*(?=$|[A-Z])`,"g");return e.replace(n,"")},"removeWord");var lP=o(e=>`#/components/schemas/${e}`,"getSchemaRef"),Ui=o(e=>e[1]==="/"?e:"#/"+e.slice(1),"autocorrectRef"),rs=o(e=>Ui(e).split("/").at(-1),"getSchemaNameByRef");function km(e){let t=Wq(e).normalize("NFKD").trim().replace(/\s+/g,"_").replace(/--+/g,"-").replace(/-+/g,"_").replace(/[^\w-]+/g,"_");return pt(t)}o(km,"normalizeString");function fP(e){return/^[a-zA-Z]\w*$/.test(e)?e:`"${e}"`}o(fP,"wrapWithQuotesIfNeeded");function pP(e){return typeof e=="string"&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}o(pP,"unwrapQuotesIfNeeded");function Wq(e){let t=Number(e[0]);return typeof t=="number"&&!Number.isNaN(t)?"_"+e:e}o(Wq,"prefixStringStartingWithNumberIfNeeded");function qm(e){let t=e.replaceAll("_","#");return pt(t.replaceAll("-","_")).replaceAll("#","_")}o(qm,"pathParamToVariableName");var Gi=o(e=>rP.includes(e),"isPrimitiveType");function dP(e){return e.replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/([\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F-\u009F\uFFFE\uFFFF])/g,(t,r)=>{let n=r.codePointAt(),i=n.toString(16);return n<=255?`\\x${`00${i}`.slice(-2)}`:`\\u${`0000${i}`.slice(-4)}`}).replace(/\//g,"\\/")}o(dP,"escapeControlCharacters");function rn(e){return e.includes("application/")&&e.includes("json")||eP.includes(e)||e.includes("text/")}o(rn,"isParamMediaTypeAllowed");function Ia(e){return e>=200&&e<300}o(Ia,"isMainResponseStatus");function Wu(e){return!(e>=200&&e<300)}o(Wu,"isErrorStatus");function Ku(e){return e.startsWith("application/")}o(Ku,"isMediaTypeAllowed");var uP=/({\w+})/g,Kq=/[^\w\-]+/g;function hP(e){e=Le(nP(e.replaceAll("/","-")).replaceAll("-",""));let t=[...e.matchAll(uP)];if(t.length>0){let r=t.sort((n,i)=>n.index-i.index)[t.length-1][0];e=`${e.replace(uP,"")}By${Le(r.slice(1,-1))}`}return e.replace(Kq,"_")}o(hP,"pathToVariableName");var Mm=/{(\b\w+(?:-\w+)*\b)}/g;function mP(e){let t=e.match(Mm);return t===null?e.replaceAll(Mm,":$1"):(t.forEach(r=>{let n=qm(r.replaceAll(Mm,":$1"));e=e.replaceAll(r,n)}),e)}o(mP,"replaceHyphenatedPath");var gP=o(e=>{let t=e["x-enumNames"],r=Array.isArray(t)&&t.length>0,n=!!e.schema&&Tt(e.schema)&&e.schema.type==="string";return r&&n},"isSortingParameterObject"),zi=o((e,t)=>t.excludePathRegex?new RegExp(t.excludePathRegex).test(e):!1,"isPathExcluded");var Qt=o(e=>e.method==="get","isQuery"),ti=o(e=>e.method!=="get"||!!e.mediaDownload,"isMutation"),ns=o((e,t)=>Qt(e)&&(t??Object.values(Pa)).every(r=>e.parameters.some(n=>n.name===r&&n.type==="Query")),"isInfiniteQuery");function ri(e){return iP(e)}o(ri,"formatTag");function ni(e,t){var n;let r=(n=e.tags)==null?void 0:n[0];return ri(r??t.defaultTag)}o(ni,"getOperationTag");function yP(e,t){return t.excludeTags.some(r=>r.toLowerCase()===e.toLowerCase())}o(yP,"isTagExcluded");var Jt=o((...e)=>[...new Set(e.flat())],"getUniqueArray");function Rt(e,t){if(!e)return;let{data:r,onSchema:n}=t;if(xe(e)&&n({type:"reference",schema:e,data:r})===!0)return;let i=e;if(Aa.some(s=>s in i&&i[s])){let s=i.allOf??i.anyOf??i.oneOf??[];for(let a of s)(n==null?void 0:n({type:"composite",parentSchema:e,schema:a,data:r}))!==!0&&Rt(a,{data:r,onSchema:n})}if(i.properties)for(let[s,a]of Object.entries(i.properties))n({type:"property",parentSchema:e,schema:a,data:r,propertyName:s})!==!0&&Rt(a,t);if(i.additionalProperties&&typeof i.additionalProperties=="object"){if(n({type:"additionalProperties",parentSchema:e,schema:i.additionalProperties,data:r})===!0)return;Rt(i.additionalProperties,t)}if(i.type==="array"){let s=e.items;if(n({type:"array",parentSchema:e,schema:s,data:r})===!0)return;Rt(s,t)}}o(Rt,"iterateSchema");var nn=o((e,t)=>Nm(Le(km(e)),t),"getZodSchemaName"),Ca=o((e,t,r)=>Nm(Le(km(e)),`${t}${r}`),"getEnumZodSchemaName"),xt=o(e=>!e.startsWith("z."),"isNamedZodSchema"),bP=o(e=>e.startsWith(Is),"isEnumZodSchema"),Zi=o((e,t,r)=>t?e:`${r}_${e}`,"getZodSchemaOperationName"),Yu=o(e=>pt(`${e}_${eb}`),"getBodyZodSchemaName"),vP=o((e,t)=>pt(`${e}_${t}${tb}`),"getParamZodSchemaName"),Yq=o(e=>pt(`${e}${rb}`),"getMainResponseZodSchemaName"),Qq=o((e,t)=>pt(`${e}_${t}_${nb}`),"getErrorResponseZodSchemaName");function Qu({statusCode:e,operationName:t,isUniqueOperationName:r,tag:n}){let i=Number(e),s=Zi(t,r,n);return!Ia(i)&&e!=="default"&&Wu(i)?Qq(s,e):Yq(s)}o(Qu,"getResponseZodSchemaName");function Ta(e){return["minimum","exclusiveMinimum","maximum","exclusiveMaximum","minItems","minLength","minProperties","maxItems","maxLength","maxProperties","default","example"].filter(n=>e[n]).reduce((n,i)=>[...n,`${Le(aP(i))}: \`${e[i]}\``],[])}o(Ta,"getSchemaDescriptions");var Ra=o((e,t)=>oP(e,t.schemaSuffix),"getZodSchemaInferedTypeName"),_P=o((e,t)=>xt(t)?`${e.options.tsNamespaces?`${ze({type:"models",tag:e.getTagByZodSchemaName(t),options:e.options})}.`:""}${t}`:t,"getImportedZodSchemaName"),Wi=o((e,t,r)=>{if(!xt(t))return t===As?"void":t;let n=e.getTagByZodSchemaName(t);return`${e.options.tsNamespaces&&n!==r?`${ze({type:"models",tag:n,options:e.options})}.`:""}${Ra(t,e.options)}`},"getImportedZodSchemaInferedTypeName");function SP(e){var t;return e.isEnum?"enum":((t=e.schemaObj)==null?void 0:t.type)??"object"}o(SP,"getZodSchemaType");function EP(e){if(e.schemaObj)return[e.schemaObj.description,...Ta(e.schemaObj).join(". ")].filter(Boolean)}o(EP,"getZodSchemaDescription");function OP(e,t,r){var n;if(xe(t)){let i=e.getZodSchemaNameByRef(t.$ref);return i?Wi(e,i,r):void 0}if(Gu(t)){if(!xe(t.items))return`${((n=t.items)==null?void 0:n.type)??"unknown"}[]`;let i=e.getZodSchemaNameByRef(t.items.$ref);return i?`${Wi(e,i,r)}[]`:void 0}if(Aa.some(i=>i in t&&t[i])){let i=t.allOf??t.anyOf??t.oneOf??[];if(i.length>0)return OP(e,i[0],r)}return t.type}o(OP,"getType");function PP(e,t,r){if(!t.schemaObj)return[];let n="[0]",i="[key]",s={},a=o(c=>{var l;if(c.type==="reference")return!0;if(c.type==="composite")return;let u=[...((l=c.data)==null?void 0:l.pathSegments)??[]];if(c.type==="array"?u.push(n):c.type==="property"?u.push(c.propertyName):c.type==="additionalProperties"&&u.push(i),c.schema&&u[u.length-1]!==n){let p=e.resolveObject(c.schema),f=[p.description,...Ta(p)].filter(Boolean),d=u.join(".");s[d]&&"type"in c.schema&&c.schema.type==="object"||(delete s[d],s[d]={type:OP(e,c.schema,r)??"unknown",description:f.join(". ")})}return Rt(c.schema,{data:{pathSegments:[...u]},onSchema:a}),!0},"onSchema");return"allOf"in t.schemaObj&&t.schemaObj.allOf&&t.schemaObj.allOf.forEach(c=>{if(xe(c)){let u=e.resolveObject(c);Rt(u,{data:{pathSegments:[]},onSchema:a})}}),Rt(t.schemaObj,{data:{pathSegments:[]},onSchema:a}),s}o(PP,"getZodSchemaPropertyDescriptions");function ii({resolver:e,tag:t,zodSchemas:r=[],zodSchemasAsTypes:n=[]}){let i="models",s=o(u=>e.getTagByZodSchemaName(u),"getTag"),a=Dm({type:i,tag:t,entities:r,getTag:s,getEntityName:o(u=>u,"getEntityName"),options:e.options}),c=Dm({type:i,tag:t,entities:n,getTag:s,getEntityName:o(u=>Ra(u,e.options),"getEntityName"),options:e.options});return Jq(e.options,a,c)}o(ii,"getModelsImports");function xP({tag:e,endpoints:t,options:r}){return Dm({type:"endpoints",tag:e,entities:t,getTag:o(n=>ja(n,r),"getTag"),getEntityName:Na,options:r})}o(xP,"getEndpointsImports");function $P({tags:e,entityName:t,getAliasEntityName:r,type:n,options:i}){let s=new Map;return e.forEach(a=>{let c=`${t}${r?` as ${r(a)}`:""}`;s.has(a)?i.tsNamespaces||s.get(a).bindings.push(c):s.set(a,{bindings:[i.tsNamespaces?ze({type:n,tag:a,options:i}):c],from:`${oi(i)}${Ju({type:n,tag:a,includeTagDir:!0,options:i})}`})}),Array.from(s.values())}o($P,"getEntityImports");function oi(e){let t=wf;return e.importPath==="relative"?t="../":e.importPath==="absolute"?t=e.output:new RegExp(`${$f}`,"g").test(e.output)&&(t=e.output.replace(new RegExp(`.*${$f}`,"g"),wf)),`${t}/`.replace(/\/\//g,"/")}o(oi,"getImportPath");function Dm({type:e="models",tag:t,entities:r,getTag:n,getEntityName:i,options:s}){let a=new Map;return r.forEach(c=>{let u=n(c);if(a.has(u))s.tsNamespaces||a.get(u).bindings.push(i(c));else{let l=t===u;a.set(u,{bindings:[s.tsNamespaces?ze({type:e,tag:u,options:s}):i(c)],from:`${l?"./":oi(s)}${Ju({type:e,tag:u,includeTagDir:!l,options:s})}`})}}),Array.from(a.values())}o(Dm,"getImports");function Jq(e,...t){let r=new Map;return t.forEach(n=>{n.forEach(i=>{r.has(i.from)?e.tsNamespaces||r.get(i.from).bindings.push(...i.bindings):r.set(i.from,i)})}),Array.from(r.values()).map(n=>({...n,bindings:Jt(n.bindings)}))}o(Jq,"mergeImports");function is({fileName:e,extension:t}){return`${e}.${t}`}o(is,"getFileNameWithExtension");function wP({type:e,tag:t,options:r,includeTagDir:n=!0}){let i=r.configs[e].outputFileNameSuffix;return t?`${n?`${ei(t)}/`:""}${ei(t)}.${i}`:i}o(wP,"getTagFileNameWithoutExtension");function Ju(...e){return wP(...e)}o(Ju,"getTagImportPath");function Xu(...e){return`${wP(...e)}.ts`}o(Xu,"getTagFileName");var ze=o(({type:e,tag:t,options:r})=>`${Le(t)}${r.configs[e].namespaceSuffix}`,"getNamespaceName");function AP(e){return e.standalone?`${oi(e)}${xc.fileName}`:e.restClientImportPath}o(AP,"getAppRestClientImportPath");function IP(e){return e.standalone?`${oi(e)}${Pc.reactQueryTypes.fileName}`:e.queryTypesImportPath}o(IP,"getQueryTypesImportPath");function CP(e){return`${oi(e)}${$c.fileName}`}o(CP,"getQueryModulesImportPath");function TP(e){return`${oi(e)}${wc.fileName}`}o(TP,"getMutationEffectsImportPath");function RP(e){return`${oi(e)}${Ac.fileName}`}o(RP,"getZodExtendedImportPath");function NP(e){return Pt(e).with("string",()=>"string").with("number",()=>"number").with("integer",()=>"number").with("boolean",()=>"boolean").exhaustive()}o(NP,"primitiveTypeToTsType");var Na=o(e=>ei(pt(e.operationName)),"getEndpointName");function jP(e,t){return`${t.tsNamespaces?`${ze({type:"endpoints",tag:ja(e,t),options:t})}.`:""}${Na(e)}`}o(jP,"getImportedEndpointName");var MP=o(e=>e.path.replace(/:([a-zA-Z0-9_]+)/g,"${$1}"),"getEndpointPath");function ja(e,t){var n;let r=t.splitByTags?(n=e.tags)==null?void 0:n[0]:t.defaultTag;return ri(r??t.defaultTag)}o(ja,"getEndpointTag");function Ma(e,t,r){let n=t.parameters.map(i=>{var a,c,u,l;let s="string";if(xt(i.zodSchema))s=Wi(e,i.zodSchema);else if((a=i.parameterObject)!=null&&a.schema&&Tt(i.parameterObject.schema)){let p=(u=(c=i.parameterObject)==null?void 0:c.schema)==null?void 0:u.type;p&&Gi(p)&&(s=NP(p))}return{name:Wn(i.name),type:s,paramType:i.type,required:((l=i.parameterObject)==null?void 0:l.required)??!0,parameterObject:i.parameterObject,bodyObject:i.bodyObject}});return r!=null&&r.includeFileParam&&t.mediaUpload&&n.push({name:"file",type:"File",paramType:"Body",required:!0,parameterObject:void 0,bodyObject:void 0}),n.sort((i,s)=>{if(i.required===s.required){let a=["Path","Body","Query","Header"];return a.indexOf(i.paramType)-a.indexOf(s.paramType)}return i.required?-1:1}).filter(i=>(!(r!=null&&r.excludeBodyParam)||i.name!==Vu)&&(!(r!=null&&r.excludePageParam)||i.name!==Pa.pageParamName)&&(!(r!=null&&r.includeOnlyRequiredParams)||i.required)).map(i=>({...i,name:r!=null&&r.replacePageParam&&i.name===Pa.pageParamName?"pageParam":i.name}))}o(Ma,"mapEndpointParamsToFunctionParams");function kP(e){let t=e.parameters.filter(i=>i.type==="Query").map(i=>{let s=QO(i.name)?i.name:`"${i.name}"`,a=Wn(i.name);return{...i,name:s,value:a}}),r={};return e.requestFormat!==xm["Content-Type"]&&(r["Content-Type"]=`'${e.requestFormat}'`),e.responseFormat&&e.responseFormat!==xm.Accept&&(r.Accept=`'${e.responseFormat}'`),e.parameters.filter(i=>i.type==="Header").forEach(i=>{r[i.name]=Wn(i.name)}),{...t.length>0?{params:t}:{},...Object.keys(r).length?{headers:r}:{}}}o(kP,"getEndpointConfig");function qP(e,t){return t.filter(r=>Qt(r)&&r.parameters.filter(n=>{var i;return(i=n.parameterObject)==null?void 0:i.required}).every(n=>e.parameters.some(i=>i.name===n.name))&&r.response===e.response)}o(qP,"getUpdateQueryEndpoints");var Lm=["break","case","catch","class","const","continue","debugger","default","delete","do","else","export","extends","false","finally","for","function","if","import","in","instanceof","new","null","return","super","switch","this","throw","true","try","typeof","var","void","while","with"];function Ki(e,t){let r={};return Object.keys(e).forEach(n=>{t.includes(n)&&(r[n]=e[n])}),r}o(Ki,"pick");function os(e,t){let r=e.deprecated&&!t.withDeprecatedEndpoints,n=ni(e,t),i=yP(n,t);return r||i}o(os,"isOperationExcluded");function Fm({path:e,method:t,operation:r,options:n,tag:i,keepOperationTag:s,keepOperationPrefix:a}){let c=`${t}${hP(e)}`,u=r.operationId?Wn(r.operationId):c;if(n.removeOperationPrefixEndingWith&&a)u=u.split(n.removeOperationPrefixEndingWith).map((p,f)=>f===0?p:Le(p)).join("");else if(n.removeOperationPrefixEndingWith&&!a){let l=new RegExp(`^.*${n.removeOperationPrefixEndingWith}`);u=u.replace(l,"")}if(n.tsNamespaces&&!s){let l=cP(u,i);Lm.includes(l)||(u=l)}return Lm.includes(u)?c:u}o(Fm,"getOperationName");function ka({operationsByTag:e,...t}){let{operation:r,options:n}=t,i=n.splitByTags?ni(r,n):n.defaultTag,s=o(a=>{let c=Fm({...t,tag:i,keepOperationTag:a});if(e[i].filter(l=>Fm({...t,operation:l,tag:i,keepOperationTag:a})===c).length===1)return c},"operationName");return s()??s(!0)??Fm({...t,tag:i,keepOperationTag:!0,keepOperationPrefix:!0})}o(ka,"getUniqueOperationName");function DP(e,t,r){let n=[];for(let i in e.paths){if(zi(i,r))continue;let s=e.paths[i],a=Ki(s,Vi);for(let c in a){let u=a[c];if(!u||os(u,r))continue;let l=ka({path:i,method:c,operation:u,operationsByTag:t,options:r});n.push(l)}}return n}o(DP,"getUniqueOperationNamesWithoutSplitByTags");function LP(e,t){let r={};for(let n in e.paths){if(zi(n,t))continue;let i=e.paths[n],s=Ki(i,Vi);for(let a in s){let c=s[a];if(!c||os(c,t))continue;let u=t.splitByTags?ni(c,t):t.defaultTag;r[u]||(r[u]=[]),r[u].push(c)}}return r}o(LP,"getOperationsByTag");function qa(e){return{type:"invalid-schema",message:e}}o(qa,"getInvalidSchemaError");function FP(e){return{type:"invalid-operation-id",message:`Operation ${e}`}}o(FP,"getInvalidOperationIdError");function HP(e,t){return{type:"missing-path-parameter",message:`Path ${t} is missing [${e.map(({name:r})=>r).join(", ")}]`}}o(HP,"getMissingPathParameterError");function BP(e){return{type:"not-allowed-inline-enum",message:`${e} is missing @IsEnum() and @ApiProperty(enum:, enumName:)`}}o(BP,"getNotAllowedInlineEnumError");function VP(e){return{type:"not-allowed-circular-schema",message:e}}o(VP,"getNotAllowedCircularSchemaError");function UP(e,t,r){return{type:"missing-acl-condition-property",message:`Condition property ${e} is not found in parameters or body in operation ${tl(t,r)}`}}o(UP,"getMissingAclConditionPropertyError");function Hm(e,t,r){return{type:"missing-status-code",message:`Missing HTTP status code ${el(e)} in operation ${tl(t,r)}`}}o(Hm,"getMissingStatusCodeError");function GP(e,t,r){return{type:"invalid-status-code",message:`Operation ${tl(t,r)} expected HTTP status code ${el(e.expected)} but received ${el(e.received)}`}}o(GP,"getInvalidStatusCodeError");function zP(e,t,r){return{type:"multiple-success-status-codes",message:`Operation ${tl(t,r)} has multiple success HTTP status codes: ${e.map(el).join(", ")}`}}o(zP,"getMultipleSuccessStatusCodesError");function tl(e,t){return e.operationId??`${t.method} ${t.path}`}o(tl,"getOperationDescriptor");function el(e){return`${e} (${WO[e]})`}o(el,"getStatusCodeDescription");function ZP(e){return e.reduce((t,r)=>({...t,[r.type]:[...t[r.type]??[],r.message]}),{})}o(ZP,"groupByType");function on({schema:e,meta:t,options:r}){let n=[];Pt(e.type).with("string",()=>n.push(tD(e))).with("number","integer",()=>n.push(nD(e))).with("array",()=>n.push(iD(e))).otherwise(()=>{}),typeof e.description=="string"&&e.description!==""&&r.withDescription&&([`
140
+ `);return s!==-1&&(t=fb(t,i,n,s)),n+t+i},"applyStyle");Object.defineProperties(Ts.prototype,go);var H6=Ts(),B6=Ts({level:db?db.level:0});var Hr=new Nc;function Rs(e,t,r){console.log(r!==void 0&&r!==t?`${Hr.yellow(`${e}:`.padEnd(20))}${Hr.magenta(t)}`:`${`${e}:`.padEnd(20)}${t}`)}o(Rs,"logVariable");function ur(e){console.log(`[INFO] ${e}`)}o(ur,"logInfo");function Cn(e){console.log(Hr.green(`[SUCCESS] ${e}`))}o(Cn,"logSuccess");function Ns(e,t){e instanceof Error?(console.log(Hr.red(`[ERROR] ${t||e.message}`)),process.env.VERBOSE&&console.error(e)):console.log(Hr.red(`[ERROR] ${e}`))}o(Ns,"logError");function Mc(e){console.log(Hr.bgYellow(`==== ${e} ====`))}o(Mc,"logBanner");var gb=mt(require("fs"));function yo(){return"0.12.1"}o(yo,"getVersion");var t7=mt(bb());var jf=Symbol("options_key");function Pe(e){return(t,r)=>{var n,i;if(e!=null){let s={...Reflect.getMetadata(jf,t)||{},[r]:{...e,describe:e.envAlias?`${e.describe||""} [${e.envAlias}]`:e.describe,type:e.type||((i=(n=Reflect.getMetadata("design:type",t,r))==null?void 0:n.name)==null?void 0:i.toLowerCase())}};Reflect.defineMetadata(jf,s,t)}}}o(Pe,"YargOption");function vb(e){let t=Reflect.getMetadata(jf,e.prototype);if(!t)throw new Error(`Options for ${e.name} were not defined`);return t}o(vb,"getYargsOption");function kc(e){return async t=>t.options(z$(e)).middleware(async r=>await Z$(e,r),!0)}o(kc,"getBuilder");function z$(e){return Object.entries(vb(e)).reduce((t,[r,n])=>(t[r]=Object.fromEntries(Object.entries(n).filter(([i])=>!["envAlias","default"].includes(i))),t),{})}o(z$,"getYargsOptions");async function Z$(e,t){let r=new e;for(let[n,i]of Object.entries(vb(e)))r[n]=t[n]??i.default;return r}o(Z$,"loadYargsConfig");var bx=mt(Pm());var WO={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"},KO={"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 jr={query:"useQuery",infiniteQuery:"useInfiniteQuery",mutation:"useMutation"},YO={bindings:[jr.query,jr.infiniteQuery,jr.mutation],from:"@tanstack/react-query"},Pa={pageParamName:"page"},Bu={pageParamName:"page",totalItemsName:"totalItems",limitParamName:"limit"},xa="moduleName";var xm={"Content-Type":"application/json",Accept:"application/json"},Vu="data",$m="axios",Zn="config",Jr="AxiosRequestConfig",Uu={defaultImport:$m,bindings:[Jr],from:"axios"};var QO=o(e=>/^(?:[a-zA-Z_$][a-zA-Z0-9_$]*|[0-9]+)$/.test(e),"isValidPropertyName"),Wn=o(e=>e.replace(/^[^a-zA-Z_$]*/g,"").replace(/[^a-zA-Z0-9_$]+(\w)?/g,(t,r)=>(r==null?void 0:r.toUpperCase())??""),"invalidVariableNameCharactersToCamel");function xe(e){return e!=null&&Object.prototype.hasOwnProperty.call(e,"$ref")}o(xe,"isReferenceObject");function Tt(e){return!xe(e)}o(Tt,"isSchemaObject");function Gu(e){return e.type==="array"}o(Gu,"isArraySchemaObject");function JO(e){if(!e.allOf)throw new Error("Function inferRequiredSchema is specialized to handle item with required only in an allOf array.");let[t,r]=e.allOf.reduce((i,s)=>{if(Bq(s)){let a=s.required;i[0].push(...a??[])}else i[1].push(s);return i},[[],[]]),n={properties:t.reduce((i,s)=>(i[s]={},i),{}),type:"object",required:t};return{noRequiredOnlyAllof:r,composedRequiredSchema:n,patchRequiredSchemaInLoop:o((i,s)=>{if(xe(i)){let a=s(i.$ref);a&&n.required.forEach(c=>{var u;n.properties[c]=((u=a==null?void 0:a.properties)==null?void 0:u[c])??{}})}else{let a=i.properties??{};n.required.forEach(c=>{a[c]&&(n.properties[c]=a[c]??{})})}},"patchRequiredSchemaInLoop")}}o(JO,"inferRequiredSchema");var Bq=o(e=>!xe(e)&&!!e.required&&!e.type&&!e.properties&&!(e!=null&&e.allOf)&&!(e!=null&&e.anyOf)&&!e.oneOf,"isBrokenAllOfItem");var gn=Symbol.for("@ts-pattern/matcher"),Vq=Symbol.for("@ts-pattern/isVariadic"),Zu="@ts-pattern/anonymous-select-key",wm=o(e=>!!(e&&typeof e=="object"),"r"),zu=o(e=>e&&!!e[gn],"i"),tn=o((e,t,r)=>{if(zu(e)){let n=e[gn](),{matched:i,selections:s}=n.match(t);return i&&s&&Object.keys(s).forEach(a=>r(a,s[a])),i}if(wm(e)){if(!wm(t))return!1;if(Array.isArray(e)){if(!Array.isArray(t))return!1;let n=[],i=[],s=[];for(let a of e.keys()){let c=e[a];zu(c)&&c[Vq]?s.push(c):s.length?i.push(c):n.push(c)}if(s.length){if(s.length>1)throw new Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");if(t.length<n.length+i.length)return!1;let a=t.slice(0,n.length),c=i.length===0?[]:t.slice(-i.length),u=t.slice(n.length,i.length===0?1/0:-i.length);return n.every((l,p)=>tn(l,a[p],r))&&i.every((l,p)=>tn(l,c[p],r))&&(s.length===0||tn(s[0],u,r))}return e.length===t.length&&e.every((a,c)=>tn(a,t[c],r))}return Reflect.ownKeys(e).every(n=>{let i=e[n];return(n in t||zu(s=i)&&s[gn]().matcherType==="optional")&&tn(i,t[n],r);var s})}return Object.is(t,e)},"s"),Xn=o(e=>{var t,r,n;return wm(e)?zu(e)?(t=(r=(n=e[gn]()).getSelectionKeys)==null?void 0:r.call(n))!=null?t:[]:Array.isArray(e)?wa(e,Xn):wa(Object.values(e),Xn):[]},"o"),wa=o((e,t)=>e.reduce((r,n)=>r.concat(t(n)),[]),"c");function mr(e){return Object.assign(e,{optional:o(()=>Uq(e),"optional"),and:o(t=>Ve(e,t),"and"),or:o(t=>Gq(e,t),"or"),select:o(t=>t===void 0?XO(e):XO(t,e),"select")})}o(mr,"u");function Uq(e){return mr({[gn]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return t===void 0?(Xn(e).forEach(i=>n(i,void 0)),{matched:!0,selections:r}):{matched:tn(e,t,n),selections:r}},"match"),getSelectionKeys:o(()=>Xn(e),"getSelectionKeys"),matcherType:"optional"})})}o(Uq,"h");function Ve(...e){return mr({[gn]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return{matched:e.every(i=>tn(i,t,n)),selections:r}},"match"),getSelectionKeys:o(()=>wa(e,Xn),"getSelectionKeys"),matcherType:"and"})})}o(Ve,"m");function Gq(...e){return mr({[gn]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return wa(e,Xn).forEach(i=>n(i,void 0)),{matched:e.some(i=>tn(i,t,n)),selections:r}},"match"),getSelectionKeys:o(()=>wa(e,Xn),"getSelectionKeys"),matcherType:"or"})})}o(Gq,"d");function Ee(e){return{[gn]:()=>({match:o(t=>({matched:!!e(t)}),"match")})}}o(Ee,"p");function XO(...e){let t=typeof e[0]=="string"?e[0]:void 0,r=e.length===2?e[1]:typeof e[0]=="string"?void 0:e[0];return mr({[gn]:()=>({match:o(n=>{let i={[t??Zu]:n};return{matched:r===void 0||tn(r,n,(s,a)=>{i[s]=a}),selections:i}},"match"),getSelectionKeys:o(()=>[t??Zu].concat(r===void 0?[]:Xn(r)),"getSelectionKeys")})})}o(XO,"y");function Xr(e){return typeof e=="number"}o(Xr,"v");function Kn(e){return typeof e=="string"}o(Kn,"b");function Yn(e){return typeof e=="bigint"}o(Yn,"w");var vU=mr(Ee(function(e){return!0}));var Qn=o(e=>Object.assign(mr(e),{startsWith:o(t=>{return Qn(Ve(e,(r=t,Ee(n=>Kn(n)&&n.startsWith(r)))));var r},"startsWith"),endsWith:o(t=>{return Qn(Ve(e,(r=t,Ee(n=>Kn(n)&&n.endsWith(r)))));var r},"endsWith"),minLength:o(t=>Qn(Ve(e,(r=>Ee(n=>Kn(n)&&n.length>=r))(t))),"minLength"),length:o(t=>Qn(Ve(e,(r=>Ee(n=>Kn(n)&&n.length===r))(t))),"length"),maxLength:o(t=>Qn(Ve(e,(r=>Ee(n=>Kn(n)&&n.length<=r))(t))),"maxLength"),includes:o(t=>{return Qn(Ve(e,(r=t,Ee(n=>Kn(n)&&n.includes(r)))));var r},"includes"),regex:o(t=>{return Qn(Ve(e,(r=t,Ee(n=>Kn(n)&&!!n.match(r)))));var r},"regex")}),"j"),_U=Qn(Ee(Kn)),en=o(e=>Object.assign(mr(e),{between:o((t,r)=>en(Ve(e,((n,i)=>Ee(s=>Xr(s)&&n<=s&&i>=s))(t,r))),"between"),lt:o(t=>en(Ve(e,(r=>Ee(n=>Xr(n)&&n<r))(t))),"lt"),gt:o(t=>en(Ve(e,(r=>Ee(n=>Xr(n)&&n>r))(t))),"gt"),lte:o(t=>en(Ve(e,(r=>Ee(n=>Xr(n)&&n<=r))(t))),"lte"),gte:o(t=>en(Ve(e,(r=>Ee(n=>Xr(n)&&n>=r))(t))),"gte"),int:o(()=>en(Ve(e,Ee(t=>Xr(t)&&Number.isInteger(t)))),"int"),finite:o(()=>en(Ve(e,Ee(t=>Xr(t)&&Number.isFinite(t)))),"finite"),positive:o(()=>en(Ve(e,Ee(t=>Xr(t)&&t>0))),"positive"),negative:o(()=>en(Ve(e,Ee(t=>Xr(t)&&t<0))),"negative")}),"x"),SU=en(Ee(Xr)),Jn=o(e=>Object.assign(mr(e),{between:o((t,r)=>Jn(Ve(e,((n,i)=>Ee(s=>Yn(s)&&n<=s&&i>=s))(t,r))),"between"),lt:o(t=>Jn(Ve(e,(r=>Ee(n=>Yn(n)&&n<r))(t))),"lt"),gt:o(t=>Jn(Ve(e,(r=>Ee(n=>Yn(n)&&n>r))(t))),"gt"),lte:o(t=>Jn(Ve(e,(r=>Ee(n=>Yn(n)&&n<=r))(t))),"lte"),gte:o(t=>Jn(Ve(e,(r=>Ee(n=>Yn(n)&&n>=r))(t))),"gte"),positive:o(()=>Jn(Ve(e,Ee(t=>Yn(t)&&t>0))),"positive"),negative:o(()=>Jn(Ve(e,Ee(t=>Yn(t)&&t<0))),"negative")}),"A"),EU=Jn(Ee(Yn)),OU=mr(Ee(function(e){return typeof e=="boolean"})),PU=mr(Ee(function(e){return typeof e=="symbol"})),xU=mr(Ee(function(e){return e==null})),$U=mr(Ee(function(e){return e!=null}));var Tm=class Tm extends Error{constructor(t){let r;try{r=JSON.stringify(t)}catch{r=t}super(`Pattern matching error: no pattern matches value ${r}`),this.input=void 0,this.input=t}};o(Tm,"W");var Am=Tm,Im={matched:!1,value:void 0};function Pt(e){return new Cm(e,Im)}o(Pt,"z");var $a=class $a{constructor(t,r){this.input=void 0,this.state=void 0,this.input=t,this.state=r}with(...t){if(this.state.matched)return this;let r=t[t.length-1],n=[t[0]],i;t.length===3&&typeof t[1]=="function"?i=t[1]:t.length>2&&n.push(...t.slice(1,t.length-1));let s=!1,a={},c=o((l,p)=>{s=!0,a[l]=p},"a"),u=!n.some(l=>tn(l,this.input,c))||i&&!i(this.input)?Im:{matched:!0,value:r(s?Zu in a?a[Zu]:a:this.input,this.input)};return new $a(this.input,u)}when(t,r){if(this.state.matched)return this;let n=!!t(this.input);return new $a(this.input,n?{matched:!0,value:r(this.input,this.input)}:Im)}otherwise(t){return this.state.matched?this.state.value:t(this.input)}exhaustive(){if(this.state.matched)return this.state.value;throw new Am(this.input)}run(){return this.exhaustive()}returnType(){return this}};o($a,"I");var Cm=$a;var Rm=2,eP=["application/octet-stream","multipart/form-data","application/x-www-form-urlencoded","*/*"],tP=["query","header","path"],Vi=["get","put","post","delete","options","head","patch","trace"],rP=["string","number","integer","boolean"],Aa=["allOf","anyOf","oneOf"];var Le=o(e=>e.charAt(0).toUpperCase()+e.slice(1),"capitalize"),ei=o(e=>e.charAt(0).toLowerCase()+e.slice(1),"decapitalize"),nP=o(e=>e.replace(/(-\w)/g,t=>t[1].toUpperCase()),"kebabToCamel"),pt=o(e=>e.replace(/(_\w)/g,t=>t[1].toUpperCase()),"snakeToCamel"),iP=o(e=>e.replace(/[\W_]+(\w)?/g,(t,r)=>(r==null?void 0:r.toUpperCase())??""),"nonWordCharactersToCamel"),Nm=o((e,t="")=>e.endsWith(t)?e:`${e}${t}`,"suffixIfNeeded"),oP=o((e,t)=>e.replace(new RegExp(`${t}$`),""),"removeSuffix"),zq=o(e=>{var n;let t=e.reduce((i,s)=>({...i,[s]:(i[s]??0)+1}),{});return(n=Object.entries(t).sort((i,s)=>i[1]===s[1]?s[0].length-i[0].length:s[1]-i[1])[0])==null?void 0:n[0]},"getLongestMostCommon"),jm=o(e=>{let t=e.map(Le).map(sP).map(r=>Zq(r)).flat();return zq(t)},"getMostCommonAdjacentCombinationSplit"),sP=o(e=>e.split(/(?<![A-Z])(?=[A-Z])/).filter(Boolean),"splitByUppercase"),aP=o(e=>sP(e).join(" "),"camelToSpaceSeparated"),Zq=o((e,t=["dto","by","for","of","in","to","and","with"])=>{var n;let r=[];for(let i=0;i<e.length;i++)if(!t.includes(e[i].toLowerCase()))for(let s=i+1;s<=e.length;s++)t.includes((n=e[s-1])==null?void 0:n.toLowerCase())||r.push(e.slice(i,s).join(""));return r},"getAdjacentStringCombinations"),cP=o((e,t)=>{let r=t.replace(/es$|s$/g,""),n=new RegExp(`(${ei(r)}|${Le(r)})[a-z]*(?=$|[A-Z])`,"g");return e.replace(n,"")},"removeWord");var lP=o(e=>`#/components/schemas/${e}`,"getSchemaRef"),Ui=o(e=>e[1]==="/"?e:"#/"+e.slice(1),"autocorrectRef"),rs=o(e=>Ui(e).split("/").at(-1),"getSchemaNameByRef");function km(e){let t=Wq(e).normalize("NFKD").trim().replace(/\s+/g,"_").replace(/--+/g,"-").replace(/-+/g,"_").replace(/[^\w-]+/g,"_");return pt(t)}o(km,"normalizeString");function fP(e){return/^[a-zA-Z]\w*$/.test(e)?e:`"${e}"`}o(fP,"wrapWithQuotesIfNeeded");function pP(e){return typeof e=="string"&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}o(pP,"unwrapQuotesIfNeeded");function Wq(e){let t=Number(e[0]);return typeof t=="number"&&!Number.isNaN(t)?"_"+e:e}o(Wq,"prefixStringStartingWithNumberIfNeeded");function qm(e){let t=e.replaceAll("_","#");return pt(t.replaceAll("-","_")).replaceAll("#","_")}o(qm,"pathParamToVariableName");var Gi=o(e=>rP.includes(e),"isPrimitiveType");function dP(e){return e.replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/([\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F-\u009F\uFFFE\uFFFF])/g,(t,r)=>{let n=r.codePointAt(),i=n.toString(16);return n<=255?`\\x${`00${i}`.slice(-2)}`:`\\u${`0000${i}`.slice(-4)}`}).replace(/\//g,"\\/")}o(dP,"escapeControlCharacters");function rn(e){return e.includes("application/")&&e.includes("json")||eP.includes(e)||e.includes("text/")}o(rn,"isParamMediaTypeAllowed");function Ia(e){return e>=200&&e<300}o(Ia,"isMainResponseStatus");function Wu(e){return!(e>=200&&e<300)}o(Wu,"isErrorStatus");function Ku(e){return e.startsWith("application/")}o(Ku,"isMediaTypeAllowed");var uP=/({\w+})/g,Kq=/[^\w\-]+/g;function hP(e){e=Le(nP(e.replaceAll("/","-")).replaceAll("-",""));let t=[...e.matchAll(uP)];if(t.length>0){let r=t.sort((n,i)=>n.index-i.index)[t.length-1][0];e=`${e.replace(uP,"")}By${Le(r.slice(1,-1))}`}return e.replace(Kq,"_")}o(hP,"pathToVariableName");var Mm=/{(\b\w+(?:-\w+)*\b)}/g;function mP(e){let t=e.match(Mm);return t===null?e.replaceAll(Mm,":$1"):(t.forEach(r=>{let n=qm(r.replaceAll(Mm,":$1"));e=e.replaceAll(r,n)}),e)}o(mP,"replaceHyphenatedPath");var gP=o(e=>{let t=e["x-enumNames"],r=Array.isArray(t)&&t.length>0,n=!!e.schema&&Tt(e.schema)&&e.schema.type==="string";return r&&n},"isSortingParameterObject"),zi=o((e,t)=>t.excludePathRegex?new RegExp(t.excludePathRegex).test(e):!1,"isPathExcluded");var Qt=o(e=>e.method==="get","isQuery"),ti=o(e=>e.method!=="get"||!!e.mediaDownload,"isMutation"),ns=o((e,t)=>Qt(e)&&(t??Object.values(Pa)).every(r=>e.parameters.some(n=>n.name===r&&n.type==="Query")),"isInfiniteQuery");function ri(e){return iP(e)}o(ri,"formatTag");function ni(e,t){var n;let r=(n=e.tags)==null?void 0:n[0];return ri(r??t.defaultTag)}o(ni,"getOperationTag");function yP(e,t){return t.excludeTags.some(r=>r.toLowerCase()===e.toLowerCase())}o(yP,"isTagExcluded");var Jt=o((...e)=>[...new Set(e.flat())],"getUniqueArray");function Rt(e,t){if(!e)return;let{data:r,onSchema:n}=t;if(xe(e)&&n({type:"reference",schema:e,data:r})===!0)return;let i=e;if(Aa.some(s=>s in i&&i[s])){let s=i.allOf??i.anyOf??i.oneOf??[];for(let a of s)(n==null?void 0:n({type:"composite",parentSchema:e,schema:a,data:r}))!==!0&&Rt(a,{data:r,onSchema:n})}if(i.properties)for(let[s,a]of Object.entries(i.properties))n({type:"property",parentSchema:e,schema:a,data:r,propertyName:s})!==!0&&Rt(a,t);if(i.additionalProperties&&typeof i.additionalProperties=="object"){if(n({type:"additionalProperties",parentSchema:e,schema:i.additionalProperties,data:r})===!0)return;Rt(i.additionalProperties,t)}if(i.type==="array"){let s=e.items;if(n({type:"array",parentSchema:e,schema:s,data:r})===!0)return;Rt(s,t)}}o(Rt,"iterateSchema");var nn=o((e,t)=>Nm(Le(km(e)),t),"getZodSchemaName"),Ca=o((e,t,r)=>Nm(Le(km(e)),`${t}${r}`),"getEnumZodSchemaName"),xt=o(e=>!e.startsWith("z."),"isNamedZodSchema"),bP=o(e=>e.startsWith(Is),"isEnumZodSchema"),Zi=o((e,t,r)=>t?e:`${r}_${e}`,"getZodSchemaOperationName"),Yu=o(e=>pt(`${e}_${eb}`),"getBodyZodSchemaName"),vP=o((e,t)=>pt(`${e}_${t}${tb}`),"getParamZodSchemaName"),Yq=o(e=>pt(`${e}${rb}`),"getMainResponseZodSchemaName"),Qq=o((e,t)=>pt(`${e}_${t}_${nb}`),"getErrorResponseZodSchemaName");function Qu({statusCode:e,operationName:t,isUniqueOperationName:r,tag:n}){let i=Number(e),s=Zi(t,r,n);return!Ia(i)&&e!=="default"&&Wu(i)?Qq(s,e):Yq(s)}o(Qu,"getResponseZodSchemaName");function Ta(e){return["minimum","exclusiveMinimum","maximum","exclusiveMaximum","minItems","minLength","minProperties","maxItems","maxLength","maxProperties","default","example"].filter(n=>e[n]).reduce((n,i)=>[...n,`${Le(aP(i))}: \`${e[i]}\``],[])}o(Ta,"getSchemaDescriptions");var Ra=o((e,t)=>oP(e,t.schemaSuffix),"getZodSchemaInferedTypeName"),_P=o((e,t)=>xt(t)?`${e.options.tsNamespaces?`${ze({type:"models",tag:e.getTagByZodSchemaName(t),options:e.options})}.`:""}${t}`:t,"getImportedZodSchemaName"),Wi=o((e,t,r)=>{if(!xt(t))return t===As?"void":t;let n=e.getTagByZodSchemaName(t);return`${e.options.tsNamespaces&&n!==r?`${ze({type:"models",tag:n,options:e.options})}.`:""}${Ra(t,e.options)}`},"getImportedZodSchemaInferedTypeName");function SP(e){var t;return e.isEnum?"enum":((t=e.schemaObj)==null?void 0:t.type)??"object"}o(SP,"getZodSchemaType");function EP(e){if(e.schemaObj)return[e.schemaObj.description,...Ta(e.schemaObj).join(". ")].filter(Boolean)}o(EP,"getZodSchemaDescription");function OP(e,t,r){var n;if(xe(t)){let i=e.getZodSchemaNameByRef(t.$ref);return i?Wi(e,i,r):void 0}if(Gu(t)){if(!xe(t.items))return`${((n=t.items)==null?void 0:n.type)??"unknown"}[]`;let i=e.getZodSchemaNameByRef(t.items.$ref);return i?`${Wi(e,i,r)}[]`:void 0}if(Aa.some(i=>i in t&&t[i])){let i=t.allOf??t.anyOf??t.oneOf??[];if(i.length>0)return OP(e,i[0],r)}return t.type}o(OP,"getType");function PP(e,t,r){if(!t.schemaObj)return[];let n="[0]",i="[key]",s={},a=o(c=>{var l;if(c.type==="reference")return!0;if(c.type==="composite")return;let u=[...((l=c.data)==null?void 0:l.pathSegments)??[]];if(c.type==="array"?u.push(n):c.type==="property"?u.push(c.propertyName):c.type==="additionalProperties"&&u.push(i),c.schema&&u[u.length-1]!==n){let p=e.resolveObject(c.schema),f=[p.description,...Ta(p)].filter(Boolean),d=u.join(".");s[d]&&"type"in c.schema&&c.schema.type==="object"||(delete s[d],s[d]={type:OP(e,c.schema,r)??"unknown",description:f.join(". ")})}return Rt(c.schema,{data:{pathSegments:[...u]},onSchema:a}),!0},"onSchema");return"allOf"in t.schemaObj&&t.schemaObj.allOf&&t.schemaObj.allOf.forEach(c=>{if(xe(c)){let u=e.resolveObject(c);Rt(u,{data:{pathSegments:[]},onSchema:a})}}),Rt(t.schemaObj,{data:{pathSegments:[]},onSchema:a}),s}o(PP,"getZodSchemaPropertyDescriptions");function ii({resolver:e,tag:t,zodSchemas:r=[],zodSchemasAsTypes:n=[]}){let i="models",s=o(u=>e.getTagByZodSchemaName(u),"getTag"),a=Dm({type:i,tag:t,entities:r,getTag:s,getEntityName:o(u=>u,"getEntityName"),options:e.options}),c=Dm({type:i,tag:t,entities:n,getTag:s,getEntityName:o(u=>Ra(u,e.options),"getEntityName"),options:e.options});return Jq(e.options,a,c)}o(ii,"getModelsImports");function xP({tag:e,endpoints:t,options:r}){return Dm({type:"endpoints",tag:e,entities:t,getTag:o(n=>ja(n,r),"getTag"),getEntityName:Na,options:r})}o(xP,"getEndpointsImports");function $P({tags:e,entityName:t,getAliasEntityName:r,type:n,options:i}){let s=new Map;return e.forEach(a=>{let c=`${t}${r?` as ${r(a)}`:""}`;s.has(a)?i.tsNamespaces||s.get(a).bindings.push(c):s.set(a,{bindings:[i.tsNamespaces?ze({type:n,tag:a,options:i}):c],from:`${oi(i)}${Ju({type:n,tag:a,includeTagDir:!0,options:i})}`})}),Array.from(s.values())}o($P,"getEntityImports");function oi(e){let t=wf;return e.importPath==="relative"?t="../":e.importPath==="absolute"?t=e.output:new RegExp(`${$f}`,"g").test(e.output)&&(t=e.output.replace(new RegExp(`.*${$f}`,"g"),wf)),`${t}/`.replace(/\/\//g,"/")}o(oi,"getImportPath");function Dm({type:e="models",tag:t,entities:r,getTag:n,getEntityName:i,options:s}){let a=new Map;return r.forEach(c=>{let u=n(c);if(a.has(u))s.tsNamespaces||a.get(u).bindings.push(i(c));else{let l=t===u;a.set(u,{bindings:[s.tsNamespaces?ze({type:e,tag:u,options:s}):i(c)],from:`${l?"./":oi(s)}${Ju({type:e,tag:u,includeTagDir:!l,options:s})}`})}}),Array.from(a.values())}o(Dm,"getImports");function Jq(e,...t){let r=new Map;return t.forEach(n=>{n.forEach(i=>{r.has(i.from)?e.tsNamespaces||r.get(i.from).bindings.push(...i.bindings):r.set(i.from,i)})}),Array.from(r.values()).map(n=>({...n,bindings:Jt(n.bindings)}))}o(Jq,"mergeImports");function is({fileName:e,extension:t}){return`${e}.${t}`}o(is,"getFileNameWithExtension");function wP({type:e,tag:t,options:r,includeTagDir:n=!0}){let i=r.configs[e].outputFileNameSuffix;return t?`${n?`${ei(t)}/`:""}${ei(t)}.${i}`:i}o(wP,"getTagFileNameWithoutExtension");function Ju(...e){return wP(...e)}o(Ju,"getTagImportPath");function Xu(...e){return`${wP(...e)}.ts`}o(Xu,"getTagFileName");var ze=o(({type:e,tag:t,options:r})=>`${Le(t)}${r.configs[e].namespaceSuffix}`,"getNamespaceName");function AP(e){return e.standalone?`${oi(e)}${xc.fileName}`:e.restClientImportPath}o(AP,"getAppRestClientImportPath");function IP(e){return e.standalone?`${oi(e)}${Pc.reactQueryTypes.fileName}`:e.queryTypesImportPath}o(IP,"getQueryTypesImportPath");function CP(e){return`${oi(e)}${$c.fileName}`}o(CP,"getQueryModulesImportPath");function TP(e){return`${oi(e)}${wc.fileName}`}o(TP,"getMutationEffectsImportPath");function RP(e){return`${oi(e)}${Ac.fileName}`}o(RP,"getZodExtendedImportPath");function NP(e){return Pt(e).with("string",()=>"string").with("number",()=>"number").with("integer",()=>"number").with("boolean",()=>"boolean").exhaustive()}o(NP,"primitiveTypeToTsType");var Na=o(e=>ei(pt(e.operationName)),"getEndpointName");function jP(e,t){return`${t.tsNamespaces?`${ze({type:"endpoints",tag:ja(e,t),options:t})}.`:""}${Na(e)}`}o(jP,"getImportedEndpointName");var MP=o(e=>e.path.replace(/:([a-zA-Z0-9_]+)/g,"${$1}"),"getEndpointPath");function ja(e,t){var n;let r=t.splitByTags?(n=e.tags)==null?void 0:n[0]:t.defaultTag;return ri(r??t.defaultTag)}o(ja,"getEndpointTag");function Ma(e,t,r){let n=t.parameters.map(i=>{var a,c,u,l;let s="string";if(xt(i.zodSchema))s=Wi(e,i.zodSchema);else if((a=i.parameterObject)!=null&&a.schema&&Tt(i.parameterObject.schema)){let p=(u=(c=i.parameterObject)==null?void 0:c.schema)==null?void 0:u.type;p&&Gi(p)&&(s=NP(p))}return{name:Wn(i.name),type:s,paramType:i.type,required:((l=i.parameterObject)==null?void 0:l.required)??!0,parameterObject:i.parameterObject,bodyObject:i.bodyObject}});return r!=null&&r.includeFileParam&&t.mediaUpload&&n.push({name:"file",type:"File",paramType:"Body",required:!0,parameterObject:void 0,bodyObject:void 0}),n.sort((i,s)=>{if(i.required===s.required){let a=["Path","Body","Query","Header"];return a.indexOf(i.paramType)-a.indexOf(s.paramType)}return i.required?-1:1}).filter(i=>(!(r!=null&&r.excludeBodyParam)||i.name!==Vu)&&(!(r!=null&&r.excludePageParam)||i.name!==Pa.pageParamName)&&(!(r!=null&&r.includeOnlyRequiredParams)||i.required)).map(i=>({...i,name:r!=null&&r.replacePageParam&&i.name===Pa.pageParamName?"pageParam":i.name}))}o(Ma,"mapEndpointParamsToFunctionParams");function kP(e){let t=e.parameters.filter(i=>i.type==="Query").map(i=>{let s=QO(i.name)?i.name:`"${i.name}"`,a=Wn(i.name);return{...i,name:s,value:a}}),r={};return e.requestFormat!==xm["Content-Type"]&&(r["Content-Type"]=`'${e.requestFormat}'`),e.responseFormat&&e.responseFormat!==xm.Accept&&(r.Accept=`'${e.responseFormat}'`),e.parameters.filter(i=>i.type==="Header").forEach(i=>{r[i.name]=Wn(i.name)}),{...t.length>0?{params:t}:{},...Object.keys(r).length?{headers:r}:{}}}o(kP,"getEndpointConfig");function qP(e,t){return t.filter(r=>Qt(r)&&r.parameters.filter(n=>{var i;return(i=n.parameterObject)==null?void 0:i.required}).every(n=>e.parameters.some(i=>i.name===n.name))&&r.response===e.response)}o(qP,"getUpdateQueryEndpoints");var Lm=["break","case","catch","class","const","continue","debugger","default","delete","do","else","export","extends","false","finally","for","function","if","import","in","instanceof","new","null","return","super","switch","this","throw","true","try","typeof","var","void","while","with"];function Ki(e,t){let r={};return Object.keys(e).forEach(n=>{t.includes(n)&&(r[n]=e[n])}),r}o(Ki,"pick");function os(e,t){let r=e.deprecated&&!t.withDeprecatedEndpoints,n=ni(e,t),i=yP(n,t);return r||i}o(os,"isOperationExcluded");function Fm({path:e,method:t,operation:r,options:n,tag:i,keepOperationTag:s,keepOperationPrefix:a}){let c=`${t}${hP(e)}`,u=r.operationId?Wn(r.operationId):c;if(n.removeOperationPrefixEndingWith&&a)u=u.split(n.removeOperationPrefixEndingWith).map((p,f)=>f===0?p:Le(p)).join("");else if(n.removeOperationPrefixEndingWith&&!a){let l=new RegExp(`^.*${n.removeOperationPrefixEndingWith}`);u=u.replace(l,"")}if(n.tsNamespaces&&!s){let l=cP(u,i);l===""?u=t.toLowerCase():Lm.includes(l)||(u=l)}return Lm.includes(u)?c:u}o(Fm,"getOperationName");function ka({operationsByTag:e,...t}){let{operation:r,options:n}=t,i=n.splitByTags?ni(r,n):n.defaultTag,s=o(a=>{let c=Fm({...t,tag:i,keepOperationTag:a});if(e[i].filter(l=>Fm({...t,operation:l,tag:i,keepOperationTag:a})===c).length===1)return c},"operationName");return s()??s(!0)??Fm({...t,tag:i,keepOperationTag:!0,keepOperationPrefix:!0})}o(ka,"getUniqueOperationName");function DP(e,t,r){let n=[];for(let i in e.paths){if(zi(i,r))continue;let s=e.paths[i],a=Ki(s,Vi);for(let c in a){let u=a[c];if(!u||os(u,r))continue;let l=ka({path:i,method:c,operation:u,operationsByTag:t,options:r});n.push(l)}}return n}o(DP,"getUniqueOperationNamesWithoutSplitByTags");function LP(e,t){let r={};for(let n in e.paths){if(zi(n,t))continue;let i=e.paths[n],s=Ki(i,Vi);for(let a in s){let c=s[a];if(!c||os(c,t))continue;let u=t.splitByTags?ni(c,t):t.defaultTag;r[u]||(r[u]=[]),r[u].push(c)}}return r}o(LP,"getOperationsByTag");function qa(e){return{type:"invalid-schema",message:e}}o(qa,"getInvalidSchemaError");function FP(e){return{type:"invalid-operation-id",message:`Operation ${e}`}}o(FP,"getInvalidOperationIdError");function HP(e,t){return{type:"missing-path-parameter",message:`Path ${t} is missing [${e.map(({name:r})=>r).join(", ")}]`}}o(HP,"getMissingPathParameterError");function BP(e){return{type:"not-allowed-inline-enum",message:`${e} is missing @IsEnum() and @ApiProperty(enum:, enumName:)`}}o(BP,"getNotAllowedInlineEnumError");function VP(e){return{type:"not-allowed-circular-schema",message:e}}o(VP,"getNotAllowedCircularSchemaError");function UP(e,t,r){return{type:"missing-acl-condition-property",message:`Condition property ${e} is not found in parameters or body in operation ${tl(t,r)}`}}o(UP,"getMissingAclConditionPropertyError");function Hm(e,t,r){return{type:"missing-status-code",message:`Missing HTTP status code ${el(e)} in operation ${tl(t,r)}`}}o(Hm,"getMissingStatusCodeError");function GP(e,t,r){return{type:"invalid-status-code",message:`Operation ${tl(t,r)} expected HTTP status code ${el(e.expected)} but received ${el(e.received)}`}}o(GP,"getInvalidStatusCodeError");function zP(e,t,r){return{type:"multiple-success-status-codes",message:`Operation ${tl(t,r)} has multiple success HTTP status codes: ${e.map(el).join(", ")}`}}o(zP,"getMultipleSuccessStatusCodesError");function tl(e,t){return e.operationId??`${t.method} ${t.path}`}o(tl,"getOperationDescriptor");function el(e){return`${e} (${WO[e]})`}o(el,"getStatusCodeDescription");function ZP(e){return e.reduce((t,r)=>({...t,[r.type]:[...t[r.type]??[],r.message]}),{})}o(ZP,"groupByType");function on({schema:e,meta:t,options:r}){let n=[];Pt(e.type).with("string",()=>n.push(tD(e))).with("number","integer",()=>n.push(nD(e))).with("array",()=>n.push(iD(e))).otherwise(()=>{}),typeof e.description=="string"&&e.description!==""&&r.withDescription&&([`
141
141
  `,"\r",`\r
142
142
  `].some(s=>String.prototype.includes.call(e.description,s))?n.push(`describe(\`${e.description}\`)`):n.push(`describe("${e.description}")`));let i=n.concat(Xq({schema:e,meta:t,options:r}),r.withDefaultValues!==!1?eD(e):[]).filter(Boolean).join(".");return i?`.${i}`:""}o(on,"getZodChain");function Xq({schema:e,meta:t,options:r}){return e.nullable&&!(t!=null&&t.isRequired)?"nullish()":e.nullable||r.replaceOptionalWithNullish&&(t!=null&&t.isParentPartial)?"nullable()":t!=null&&t.isRequired?"":r.replaceOptionalWithNullish?"nullish()":"optional()"}o(Xq,"getZodChainablePresence");function eD(e){return e.default!==void 0?`default(${Pt(e.type).with("number","integer",()=>pP(e.default)).otherwise(()=>JSON.stringify(e.default))})`:""}o(eD,"getZodChainableDefault");function tD(e){let t=[];if(e.enum||(e.minLength!==void 0&&t.push(`min(${e.minLength})`),e.maxLength!==void 0&&t.push(`max(${e.maxLength})`)),e.pattern&&t.push(`regex(${rD(e.pattern)})`),e.format){let r=Pt(e.format).with("email",()=>"email()").with("hostname","uri",()=>"url()").with("uuid",()=>"uuid()").with("date-time",()=>"datetime({ offset: true })").otherwise(()=>"");r&&t.push(r)}return t.join(".")}o(tD,"getZodChainableStringValidations");function rD(e){return e.startsWith("/")&&e.endsWith("/")&&(e=e.slice(1,-1)),e=dP(e),`/${e}/`}o(rD,"formatPatternIfNeeded");function nD(e){let t=[];return e.enum?"":(e.type==="integer"&&t.push("int()"),e.minimum!==void 0?e.exclusiveMinimum===!0?t.push(`gt(${e.minimum})`):t.push(`gte(${e.minimum})`):typeof e.exclusiveMinimum=="number"&&t.push(`gt(${e.exclusiveMinimum})`),e.maximum!==void 0?e.exclusiveMaximum===!0?t.push(`lt(${e.maximum})`):t.push(`lte(${e.maximum})`):typeof e.exclusiveMaximum=="number"&&t.push(`lt(${e.exclusiveMaximum})`),e.multipleOf&&t.push(`multipleOf(${e.multipleOf})`),t.join("."))}o(nD,"getZodChainableNumberValidations");function iD(e){let t=[];return e.minItems&&t.push(`min(${e.minItems})`),e.maxItems&&t.push(`max(${e.maxItems})`),t.join(".")}o(iD,"getZodChainableArrayValidations");var Yi=o(e=>e.reduce((t,r)=>t+r,0),"sum");function dt(e,t){if(!t)return e;if(xe(t))return e+2;if(Array.isArray(t.type))return t.type.length===1?Xt("oneOf")+dt(e,{...t,type:t.type[0]}):e+Xt("oneOf")+Yi(t.type.map(r=>dt(0,{...t,type:r})));if(t.oneOf)return t.oneOf.length===1?Xt("oneOf")+dt(e,t.oneOf[0]):e+Xt("oneOf")+Yi(t.oneOf.map(r=>dt(0,r)));if(t.anyOf)return t.anyOf.length===1?Xt("anyOf")+dt(e,t.anyOf[0]):e+Xt("anyOf")+Yi(t.anyOf.map(r=>dt(0,r)));if(t.allOf)return t.allOf.length===1?Xt("allOf")+dt(e,t.allOf[0]):e+Xt("allOf")+Yi(t.allOf.map(r=>dt(0,r)));if(!t.type)return e;if(Gi(t.type))return t.enum?e+WP(t)+Xt("enum")+Yi(t.enum.map(r=>dt(0,r))):e+WP(t);if(t.type==="array")return t.items?Xt("array")+dt(e,t.items):Xt("array")+dt(e);if(t.type==="object"||t.properties||t.additionalProperties){if(t.properties){let r=Object.values(t.properties);e+=Xt("object")+Yi(r.map(n=>dt(0,n)))}else e+=Xt("empty-object");t.additionalProperties&&(typeof t.additionalProperties=="object"?e+=dt(0,t.additionalProperties):e+=dt(1))}return e}o(dt,"getOpenAPISchemaComplexity");function WP(e){return Pt(e.type).with("string","number","integer","boolean",()=>1).otherwise(()=>0)}o(WP,"complexityByType");function Xt(e){return Pt(e).with("oneOf",()=>2).with("anyOf",()=>3).with("allOf",()=>2).with("enum","array","empty-object",()=>1).with("object",()=>2).otherwise(()=>0)}o(Xt,"complexityByComposite");var Bm=class Bm{constructor(t,r,n={referencedBy:[]},i){this.schema=t;this.resolver=r;xe(t)&&(this.ref=t.$ref),i&&(this.enumRef=i),this.meta={...n,referencedBy:[...(n==null?void 0:n.referencedBy)??[]]},this.ref&&this.meta.referencedBy.push(this)}code;ref;enumRef;children=[];meta;getCodeString(t,r){var s,a;if(!this.ref&&this.code)return this.code;if(!this.ref)throw new Error("Zod schema is missing both ref and code");let n=(s=this.resolver)==null?void 0:s.getZodSchemaNameByRef(this.ref);if(!n)return this.ref;let i=(a=this.resolver)==null?void 0:a.getTagByZodSchemaName(n);return r!=null&&r.tsNamespaces&&i&&i!==t?`${ze({type:"models",tag:i,options:r})}.${n}`:n}get complexity(){return dt(0,this.schema)}assign(t){return this.code=t,this}inherit(t){return t&&t.children.push(this),this}};o(Bm,"ZodSchema");var Da=Bm;function Qe({schema:e,resolver:t,meta:r,tag:n}){var y;let i=new Da(e,t,r),s={parent:i.inherit(r==null?void 0:r.parent),referencedBy:[...i.meta.referencedBy]},a={resolver:t,meta:s,tag:n};if(xe(e))return oD({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});let c=aD({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(c)return c;let u=sD({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(u)return u;let l=cD({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(l)return l;let p=uD({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(p)return p;let f=lD({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(f)return f;let d=t.options.allReadonly?".readonly()":"";if(Gu(e))return e.items?i.assign(`z.array(${Qe({...a,schema:e.items}).getCodeString(n,t.options)}${on({schema:e.items,meta:{...s,isRequired:!0},options:t.options})})${d}`):i.assign(`z.array(z.any())${d}`);let h=e.type?e.type.toLowerCase():void 0;if(h==="object"||e.properties||e.additionalProperties){let b=e.required&&e.required.length>0,g=t.options.withImplicitRequiredProps?!1:e.properties&&!((y=e.required)!=null&&y.length),P="{}";e.properties&&(P="{ "+Object.entries(e.properties).map(([K,X])=>{var M;let Ze={...s,isRequired:g?!0:b?(M=e.required)==null?void 0:M.includes(K):t.options.withImplicitRequiredProps,name:K,isParentPartial:g},Ie=X;if(xe(X)&&t&&(Ie=t.getSchemaByRef(X.$ref),!Ie))throw new Error(`Schema ${X.$ref} not found`);let re=Qe({...a,schema:X,meta:Ze}).getCodeString(n,t.options)+on({schema:Ie,meta:Ze,options:t.options});return[K,re]}).map(([K,X])=>`${fP(K)}: ${X}`).join(", ")+" }");let $="";e.additionalProperties&&($=`.catchall(${typeof e.additionalProperties=="object"&&Object.keys(e.additionalProperties).length>0?Qe({...a,schema:e.additionalProperties}).getCodeString(n,t.options)+on({schema:e.additionalProperties,meta:{...s,isRequired:!0},options:t.options}):"z.any()"})`);let C=g?".partial()":"",T=t.options.strictObjects?".strict()":"";return i.assign(`z.object(${P})${C}${T}${$}${d}`)}if(h==="any")return i.assign("z.any()");if(!h)return i.assign("z.unknown()");throw new Error(`Unsupported schema type: ${h}`)}o(Qe,"getZodSchema");function oD({schema:e,zodSchema:t,resolver:r,meta:n,tag:i}){if(!xe(e))return;let s=t.meta.referencedBy.slice(0,-1).map(u=>u.ref?r.getZodSchemaNameByRef(u.ref)??u.ref:void 0).filter(Boolean),a=r.getZodSchemaNameByRef(e.$ref);if(s.length>1&&s.includes(a))return t.assign(r.getCodeByZodSchemaName(t.ref));let c=r.getCodeByZodSchemaName(e.$ref);if(!c){let u=r.getSchemaByRef(e.$ref);if(!u)throw new Error(`Schema ${e.$ref} not found`);c=Qe({schema:u,resolver:r,meta:n,tag:i}).getCodeString(i,r.options)}return r.getCodeByZodSchemaName(a)||r.setZodSchema(a,c,i),t}o(oD,"getReferenceZodSchema");function sD({schema:e,zodSchema:t,resolver:r,meta:n,tag:i}){var a;if(!Tt(e)||!e.oneOf)return;if(e.oneOf.length===1){let c=Qe({schema:e.oneOf[0],resolver:r,meta:n,tag:i});return t.assign(c.getCodeString(i,r.options))}let s=(a=e.oneOf)==null?void 0:a.some(c=>Tt(c)&&((c==null?void 0:c.allOf)||[]).length>1);if(e.discriminator&&!s){let c=e.discriminator.propertyName;return t.assign(`
143
143
  z.discriminatedUnion("${c}", [${e.oneOf.map(u=>Qe({schema:u,resolver:r,meta:n,tag:i}).getCodeString(i,r.options)).join(", ")}])
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@povio/openapi-codegen-cli",
3
- "version": "0.12.0",
3
+ "version": "0.12.1",
4
4
  "main": "./dist/index.js",
5
5
  "bin": {
6
6
  "openapi-codegen": "./dist/sh.js"