@povio/openapi-codegen-cli 0.6.3 → 0.6.4
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 +1 -1
- package/dist/sh.js +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -69,7 +69,7 @@ Expecting `+nn.join(", ")+", got '"+(this.terminals_[P]||P)+"'":Ma="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($3(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:ri,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 ti||(t=this.source.wrap(t)),this.inlineStack.push(t),t},"push"),pushStackLiteral:o(function(t){this.push(new ti(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 Uf.default("replaceStack on non-inline");var a=this.popStack(!0);if(a instanceof ti)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 ti)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 ti)return n.value;if(!r){if(!this.stackSlot)throw new Uf.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 ti?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=ri.RESERVED_WORDS={},r=0,n=e.length;r<n;r++)t[e[r]]=!0})();ri.isValidJavaScriptVariableName=function(e){return!ri.RESERVED_WORDS[e]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(e)};function $3(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($3,"strictLookup");ka.default=ri;M_.exports=ka.default});var V_=h((Ca,F_)=>{"use strict";Ca.__esModule=!0;function Eo(e){return e&&e.__esModule?e:{default:e}}o(Eo,"_interopRequireDefault");var E3=Hb(),O3=Eo(E3),x3=_f(),w3=Eo(x3),Zf=t_(),Gf=o_(),A3=D_(),I3=Eo(A3),T3=Ea(),R3=Eo(T3),N3=yf(),k3=Eo(N3),C3=O3.default.create;function L_(){var e=C3();return e.compile=function(t,r){return Gf.compile(t,r,e)},e.precompile=function(t,r){return Gf.precompile(t,r,e)},e.AST=w3.default,e.Compiler=Gf.Compiler,e.JavaScriptCompiler=I3.default,e.Parser=Zf.parser,e.parse=Zf.parse,e.parseWithoutProcessing=Zf.parseWithoutProcessing,e}o(L_,"create");var ni=L_();ni.create=L_;k3.default(ni);ni.Visitor=R3.default;ni.default=ni;Ca.default=ni;F_.exports=Ca.default});var H_=h(ja=>{"use strict";ja.__esModule=!0;ja.print=D3;ja.PrintVisitor=Y;function j3(e){return e&&e.__esModule?e:{default:e}}o(j3,"_interopRequireDefault");var q3=Ea(),M3=j3(q3);function D3(e){return new Y().accept(e)}o(D3,"print");function Y(){this.padding=0}o(Y,"PrintVisitor");Y.prototype=new M3.default;Y.prototype.pad=function(e){for(var t="",r=0,n=this.padding;r<n;r++)t+=" ";return t+=e+`
|
|
72
|
-
`,t};Y.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};Y.prototype.MustacheStatement=function(e){return this.pad("{{ "+this.SubExpression(e)+" }}")};Y.prototype.Decorator=function(e){return this.pad("{{ DIRECTIVE "+this.SubExpression(e)+" }}")};Y.prototype.BlockStatement=Y.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};Y.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+" }}")};Y.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+" }}")};Y.prototype.ContentStatement=function(e){return this.pad("CONTENT[ '"+e.value+"' ]")};Y.prototype.CommentStatement=function(e){return this.pad("{{! '"+e.value+"' }}")};Y.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};Y.prototype.PathExpression=function(e){var t=e.parts.join("/");return(e.data?"@":"")+"PATH:"+t};Y.prototype.StringLiteral=function(e){return'"'+e.value+'"'};Y.prototype.NumberLiteral=function(e){return"NUMBER{"+e.value+"}"};Y.prototype.BooleanLiteral=function(e){return"BOOLEAN{"+e.value+"}"};Y.prototype.UndefinedLiteral=function(){return"UNDEFINED"};Y.prototype.NullLiteral=function(){return"NULL"};Y.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(", ")+"}"};Y.prototype.HashPair=function(e){return e.key+"="+this.accept(e.value)}});var br=h((qV,Z_)=>{var qa=V_().default,U_=H_();qa.PrintVisitor=U_.PrintVisitor;qa.print=U_.print;Z_.exports=qa;function B_(e,t){var r=require("fs"),n=r.readFileSync(t,"utf8");e.exports=qa.compile(n)}o(B_,"extension");typeof require<"u"&&require.extensions&&(require.extensions[".handlebars"]=B_,require.extensions[".hbs"]=B_)});var wj={};h2(wj,{getGenerateFilesData:()=>xj,getGenerateMetadata:()=>Oj});module.exports=g2(wj);var Qf=mt(xv());var wv="Schema",Av="Enum",Iv="Body",Tv="Param",Rv="Response",Nv="ErrorResponse",Qi="z.void()",ks="z.enum",Cs={bindings:["z"],from:"zod"};var Yi={input:"input.yaml",output:"output",splitByTags:!0,defaultTag:"Common",excludeTags:[],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:wv,enumSuffix:Av,withDefaultValues:!0,extractEnums:!0,removeOperationPrefixEndingWith:"Controller_",infiniteQueries:!0};var Z=o(e=>e.charAt(0).toUpperCase()+e.slice(1),"capitalize"),cr=o(e=>e.charAt(0).toLowerCase()+e.slice(1),"decapitalize"),kv=o(e=>e.replace(/(-\w)/g,t=>t[1].toUpperCase()),"kebabToCamel"),ie=o(e=>e.replace(/(_\w)/g,t=>t[1].toUpperCase()),"snakeToCamel"),Cv=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"),jv=o((e,t)=>e.replace(new RegExp(`${t}$`),""),"removeSuffix"),pN=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"),Ap=o(e=>{let t=e.map(Z).map(qv).map(r=>fN(r)).flat();return pN(t)},"getMostCommonAdjacentCombinationSplit"),qv=o(e=>e.split(/(?<![A-Z])(?=[A-Z])/).filter(Boolean),"splitByUppercase"),Mv=o(e=>qv(e).join(" "),"camelToSpaceSeparated"),fN=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"),Dv=o((e,t)=>{let r=t.replace(/es$|s$/g,""),n=new RegExp(`(${cr(r)}|${Z(r)})[a-z]*(?=$|[A-Z])`,"g");return e.replace(n,"")},"removeWord");var js=o(e=>`use${Z(ie(e.operationName))}`,"getQueryName"),Lv=o(e=>`use${Z(ie(e.operationName))}Infinite`,"getInfiniteQueryName");var Ji="AppRestClient",qs={query:"AppQueryOptions",infiniteQuery:"AppInfiniteQueryOptions",mutation:"AppMutationOptions"},Ip="src/data",Tp="@/data",Fv="@/util/rest/clients/app-rest-client",Vv="@/types/react-query";var Ms={reactQueryTypes:{fileName:"react-query.types",extension:"ts"},restClient:{fileName:"rest-client",extension:"ts"},restInterceptor:{fileName:"rest-interceptor",extension:"ts"}},Ds={fileName:"app-rest-client",extension:"ts"};var ke=o((...e)=>[...new Set(e.flat())],"getUniqueArray");var Rp={"Content-Type":"application/json",Accept:"application/json"},Hv="data";var Bv=o(e=>/^(?:[a-zA-Z_$][a-zA-Z0-9_$]*|[0-9]+)$/.test(e),"isValidPropertyName"),Ot=o(e=>e.replace(/^[^a-zA-Z_$]*/g,"").replace(/[^a-zA-Z0-9_$]+(\w)?/g,(t,r)=>(r==null?void 0:r.toUpperCase())??""),"invalidVariableNameCharactersToCamel");var Lt=Symbol.for("@ts-pattern/matcher"),dN=Symbol.for("@ts-pattern/isVariadic"),Fs="@ts-pattern/anonymous-select-key",Np=o(e=>!!(e&&typeof e=="object"),"r"),Ls=o(e=>e&&!!e[Lt],"i"),At=o((e,t,r)=>{if(Ls(e)){let n=e[Lt](),{matched:i,selections:s}=n.match(t);return i&&s&&Object.keys(s).forEach(a=>r(a,s[a])),i}if(Np(e)){if(!Np(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];Ls(c)&&c[dN]?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)=>At(l,a[f],r))&&i.every((l,f)=>At(l,c[f],r))&&(s.length===0||At(s[0],u,r))}return e.length===t.length&&e.every((a,c)=>At(a,t[c],r))}return Reflect.ownKeys(e).every(n=>{let i=e[n];return(n in t||Ls(s=i)&&s[Lt]().matcherType==="optional")&&At(i,t[n],r);var s})}return Object.is(t,e)},"s"),dr=o(e=>{var t,r,n;return Np(e)?Ls(e)?(t=(r=(n=e[Lt]()).getSelectionKeys)==null?void 0:r.call(n))!=null?t:[]:Array.isArray(e)?eo(e,dr):eo(Object.values(e),dr):[]},"o"),eo=o((e,t)=>e.reduce((r,n)=>r.concat(t(n)),[]),"c");function Ze(e){return Object.assign(e,{optional:o(()=>mN(e),"optional"),and:o(t=>G(e,t),"and"),or:o(t=>hN(e,t),"or"),select:o(t=>t===void 0?Uv(e):Uv(t,e),"select")})}o(Ze,"u");function mN(e){return Ze({[Lt]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return t===void 0?(dr(e).forEach(i=>n(i,void 0)),{matched:!0,selections:r}):{matched:At(e,t,n),selections:r}},"match"),getSelectionKeys:o(()=>dr(e),"getSelectionKeys"),matcherType:"optional"})})}o(mN,"h");function G(...e){return Ze({[Lt]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return{matched:e.every(i=>At(i,t,n)),selections:r}},"match"),getSelectionKeys:o(()=>eo(e,dr),"getSelectionKeys"),matcherType:"and"})})}o(G,"m");function hN(...e){return Ze({[Lt]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return eo(e,dr).forEach(i=>n(i,void 0)),{matched:e.some(i=>At(i,t,n)),selections:r}},"match"),getSelectionKeys:o(()=>eo(e,dr),"getSelectionKeys"),matcherType:"or"})})}o(hN,"d");function D(e){return{[Lt]:()=>({match:o(t=>({matched:!!e(t)}),"match")})}}o(D,"p");function Uv(...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 Ze({[Lt]:()=>({match:o(n=>{let i={[t??Fs]:n};return{matched:r===void 0||At(r,n,(s,a)=>{i[s]=a}),selections:i}},"match"),getSelectionKeys:o(()=>[t??Fs].concat(r===void 0?[]:dr(r)),"getSelectionKeys")})})}o(Uv,"y");function xt(e){return typeof e=="number"}o(xt,"v");function ur(e){return typeof e=="string"}o(ur,"b");function lr(e){return typeof e=="bigint"}o(lr,"w");var X8=Ze(D(function(e){return!0}));var pr=o(e=>Object.assign(Ze(e),{startsWith:o(t=>{return pr(G(e,(r=t,D(n=>ur(n)&&n.startsWith(r)))));var r},"startsWith"),endsWith:o(t=>{return pr(G(e,(r=t,D(n=>ur(n)&&n.endsWith(r)))));var r},"endsWith"),minLength:o(t=>pr(G(e,(r=>D(n=>ur(n)&&n.length>=r))(t))),"minLength"),length:o(t=>pr(G(e,(r=>D(n=>ur(n)&&n.length===r))(t))),"length"),maxLength:o(t=>pr(G(e,(r=>D(n=>ur(n)&&n.length<=r))(t))),"maxLength"),includes:o(t=>{return pr(G(e,(r=t,D(n=>ur(n)&&n.includes(r)))));var r},"includes"),regex:o(t=>{return pr(G(e,(r=t,D(n=>ur(n)&&!!n.match(r)))));var r},"regex")}),"j"),eL=pr(D(ur)),wt=o(e=>Object.assign(Ze(e),{between:o((t,r)=>wt(G(e,((n,i)=>D(s=>xt(s)&&n<=s&&i>=s))(t,r))),"between"),lt:o(t=>wt(G(e,(r=>D(n=>xt(n)&&n<r))(t))),"lt"),gt:o(t=>wt(G(e,(r=>D(n=>xt(n)&&n>r))(t))),"gt"),lte:o(t=>wt(G(e,(r=>D(n=>xt(n)&&n<=r))(t))),"lte"),gte:o(t=>wt(G(e,(r=>D(n=>xt(n)&&n>=r))(t))),"gte"),int:o(()=>wt(G(e,D(t=>xt(t)&&Number.isInteger(t)))),"int"),finite:o(()=>wt(G(e,D(t=>xt(t)&&Number.isFinite(t)))),"finite"),positive:o(()=>wt(G(e,D(t=>xt(t)&&t>0))),"positive"),negative:o(()=>wt(G(e,D(t=>xt(t)&&t<0))),"negative")}),"x"),tL=wt(D(xt)),fr=o(e=>Object.assign(Ze(e),{between:o((t,r)=>fr(G(e,((n,i)=>D(s=>lr(s)&&n<=s&&i>=s))(t,r))),"between"),lt:o(t=>fr(G(e,(r=>D(n=>lr(n)&&n<r))(t))),"lt"),gt:o(t=>fr(G(e,(r=>D(n=>lr(n)&&n>r))(t))),"gt"),lte:o(t=>fr(G(e,(r=>D(n=>lr(n)&&n<=r))(t))),"lte"),gte:o(t=>fr(G(e,(r=>D(n=>lr(n)&&n>=r))(t))),"gte"),positive:o(()=>fr(G(e,D(t=>lr(t)&&t>0))),"positive"),negative:o(()=>fr(G(e,D(t=>lr(t)&&t<0))),"negative")}),"A"),rL=fr(D(lr)),nL=Ze(D(function(e){return typeof e=="boolean"})),iL=Ze(D(function(e){return typeof e=="symbol"})),oL=Ze(D(function(e){return e==null})),sL=Ze(D(function(e){return e!=null}));var qp=class qp 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(qp,"W");var kp=qp,Cp={matched:!1,value:void 0};function he(e){return new jp(e,Cp)}o(he,"z");var Xi=class Xi{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=>At(l,this.input,c))||i&&!i(this.input)?Cp:{matched:!0,value:r(s?Fs in a?a[Fs]:a:this.input,this.input)};return new Xi(this.input,u)}when(t,r){if(this.state.matched)return this;let n=!!t(this.input);return new Xi(this.input,n?{matched:!0,value:r(this.input,this.input)}:Cp)}otherwise(t){return this.state.matched?this.state.value:t(this.input)}exhaustive(){if(this.state.matched)return this.state.value;throw new kp(this.input)}run(){return this.exhaustive()}returnType(){return this}};o(Xi,"I");var jp=Xi;var Mp=["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"];var Dp=2,Zv=["application/octet-stream","multipart/form-data","application/x-www-form-urlencoded","*/*"],Gv=["query","header","path"],mr=["get","put","post","delete","options","head","patch","trace"],zv=["string","number","integer","boolean"],Bn=["allOf","anyOf","oneOf"];function hr(e,t){let r={};return Object.keys(e).forEach(n=>{t.includes(n)&&(r[n]=e[n])}),r}o(hr,"pick");function It(e){return Cv(e)}o(It,"formatTag");function Br(e,t){var n;let r=(n=e.tags)==null?void 0:n[0];return It(r??t.defaultTag)}o(Br,"getOperationTag");function Kv(e,t){let r={};for(let n in e.paths){let i=e.paths[n],s=hr(i,mr);for(let a in s){let c=s[a];if(!c||c.deprecated&&!t.withDeprecatedEndpoints)continue;let u=t.splitByTags?Br(c,t):t.defaultTag;r[u]||(r[u]=[]),r[u].push(c)}}return r}o(Kv,"getOperationsByTag");var Qv=o(e=>`#/components/schemas/${e}`,"getSchemaRef"),Ur=o(e=>e[1]==="/"?e:"#/"+e.slice(1),"autocorrectRef"),Un=o(e=>Ur(e).split("/").at(-1),"getSchemaNameByRef");function M(e){return e!=null&&Object.prototype.hasOwnProperty.call(e,"$ref")}o(M,"isReferenceObject");function Vp(e){let t=gN(e).normalize("NFKD").trim().replace(/\s+/g,"_").replace(/--+/g,"-").replace(/-+/g,"_").replace(/[^\w-]+/g,"_");return ie(t)}o(Vp,"normalizeString");function Yv(e){return/^[a-zA-Z]\w*$/.test(e)?e:`"${e}"`}o(Yv,"wrapWithQuotesIfNeeded");function Jv(e){return typeof e=="string"&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}o(Jv,"unwrapQuotesIfNeeded");function gN(e){let t=Number(e[0]);return typeof t=="number"&&!Number.isNaN(t)?"_"+e:e}o(gN,"prefixStringStartingWithNumberIfNeeded");function Hp(e){let t=e.replaceAll("_","#");return ie(t.replaceAll("-","_")).replaceAll("#","_")}o(Hp,"pathParamToVariableName");var Ft=o(e=>zv.includes(e),"isPrimitiveType");function Xv(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(Xv,"escapeControlCharacters");function Ge(e){return e.includes("application/")&&e.includes("json")||Zv.includes(e)||e.includes("text/")}o(Ge,"isParamMediaTypeAllowed");function Vs(e){return e>=200&&e<300}o(Vs,"isMainResponseStatus");function Hs(e){return!(e>=200&&e<300)}o(Hs,"isErrorStatus");function Zn(e){return e==="application/json"}o(Zn,"isMediaTypeAllowed");function Lp({path:e,method:t,operation:r,options:n,tag:i,keepOperationTag:s,keepOperationPrefix:a}){let c=`${t}${vN(e)}`,u=r.operationId?Ot(r.operationId):c;if(n.removeOperationPrefixEndingWith&&a)u=u.split(n.removeOperationPrefixEndingWith).map((f,p)=>p===0?f:Z(f)).join("");else if(n.removeOperationPrefixEndingWith&&!a){let l=new RegExp(`^.*${n.removeOperationPrefixEndingWith}`);u=u.replace(l,"")}if(n.tsNamespaces&&!s){let l=Dv(u,i);Mp.includes(l)||(u=l)}return Mp.includes(u)?c:u}o(Lp,"getOperationName");function to({operationsByTag:e,...t}){let{operation:r,options:n}=t,i=n.splitByTags?Br(r,n):n.defaultTag,s=o(a=>{let c=Lp({...t,tag:i,keepOperationTag:a});if(e[i].filter(l=>Lp({...t,operation:l,tag:i,keepOperationTag:a})===c).length===1)return c},"operationName");return s()??s(!0)??Lp({...t,tag:i,keepOperationTag:!0,keepOperationPrefix:!0})}o(to,"getUniqueOperationName");function eS(e,t,r){let n=[];for(let i in e.paths){let s=e.paths[i],a=hr(s,mr);for(let c in a){let u=a[c];if(!u||u.deprecated&&!r.withDeprecatedEndpoints)continue;let l=to({path:i,method:c,operation:u,operationsByTag:t,options:r});n.push(l)}}return n}o(eS,"getUniqueOperationNamesWithoutSplitByTags");var Wv=/({\w+})/g,yN=/[^\w\-]+/g;function vN(e){e=Z(kv(e.replaceAll("/","-")).replaceAll("-",""));let t=[...e.matchAll(Wv)];if(t.length>0){let r=t.sort((n,i)=>n.index-i.index)[t.length-1][0];e=`${e.replace(Wv,"")}By${Z(r.slice(1,-1))}`}return e.replace(yN,"_")}o(vN,"pathToVariableName");var Fp=/{(\b\w+(?:-\w+)*\b)}/g;function tS(e){let t=e.match(Fp);return t===null?e.replaceAll(Fp,":$1"):(t.forEach(r=>{let n=Hp(r.replaceAll(Fp,":$1"));e=e.replaceAll(r,n)}),e)}o(tS,"replaceHyphenatedPath");function Ce(e){return!M(e)}o(Ce,"isSchemaObject");function Bs(e){return e.type==="array"}o(Bs,"isArraySchemaObject");function rS(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(SN(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(M(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(rS,"inferRequiredSchema");var SN=o(e=>!M(e)&&!!e.required&&!e.type&&!e.properties&&!(e!=null&&e.allOf)&&!(e!=null&&e.anyOf)&&!e.oneOf,"isBrokenAllOfItem");var Tt=o((e,t)=>wp(Z(Vp(e)),t),"getZodSchemaName"),Bp=o((e,t,r)=>wp(Z(Vp(e)),`${t}${r}`),"getEnumZodSchemaName"),be=o(e=>!e.startsWith("z."),"isNamedZodSchema"),nS=o(e=>e.startsWith(ks),"isEnumZodSchema"),Zr=o((e,t,r)=>t?e:`${r}_${e}`,"getZodSchemaOperationName"),Us=o(e=>ie(`${e}_${Iv}`),"getBodyZodSchemaName"),iS=o((e,t)=>ie(`${e}_${t}${Tv}`),"getParamZodSchemaName"),bN=o(e=>ie(`${e}${Rv}`),"getMainResponseZodSchemaName"),_N=o((e,t)=>ie(`${e}_${t}_${Nv}`),"getErrorResponseZodSchemaName");function Zs({statusCode:e,operationName:t,isUniqueOperationName:r,tag:n}){let i=Number(e),s=Zr(t,r,n);return!Vs(i)&&e!=="default"&&Hs(i)?_N(s,e):bN(s)}o(Zs,"getResponseZodSchemaName");function ro(e){return["minimum","exclusiveMinimum","maximum","exclusiveMaximum","minItems","minLength","minProperties","maxItems","maxLength","maxProperties","default","example"].filter(n=>e[n]).reduce((n,i)=>[...n,`${Z(Mv(i))}: \`${e[i]}\``],[])}o(ro,"getSchemaDescriptions");function _e(e,t){if(!e)return;let{data:r,onSchema:n}=t;if(M(e)&&n({type:"reference",schema:e,data:r})===!0)return;let i=e;if(Bn.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&&_e(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&&_e(a,t);if(i.additionalProperties&&typeof i.additionalProperties=="object"){if(n({type:"additionalProperties",parentSchema:e,schema:i.additionalProperties,data:r})===!0)return;_e(i.additionalProperties,t)}if(i.type==="array"){let s=e.items;if(n({type:"array",parentSchema:e,schema:s,data:r})===!0)return;_e(s,t)}}o(_e,"iterateSchema");var no=o((e,t)=>jv(e,t.schemaSuffix),"getZodSchemaInferedTypeName"),oS=o((e,t)=>be(t)?`${e.options.tsNamespaces?`${z({type:"models",tag:e.getTagByZodSchemaName(t),options:e.options})}.`:""}${t}`:t,"getImportedZodSchemaName"),gr=o((e,t,r)=>{if(!be(t))return t===Qi?"void":t;let n=e.getTagByZodSchemaName(t);return`${e.options.tsNamespaces&&n!==r?`${z({type:"models",tag:n,options:e.options})}.`:""}${no(t,e.options)}`},"getImportedZodSchemaInferedTypeName");function sS(e){var t;return e.isEnum?"enum":((t=e.schemaObj)==null?void 0:t.type)??"object"}o(sS,"getZodSchemaType");function aS(e){if(e.schemaObj)return[e.schemaObj.description,...ro(e.schemaObj).join(". ")].filter(Boolean)}o(aS,"getZodSchemaDescription");function cS(e,t,r){var n;if(M(t)){let i=e.getZodSchemaNameByRef(t.$ref);return i?gr(e,i,r):void 0}if(Bs(t)){if(!M(t.items))return`${((n=t.items)==null?void 0:n.type)??"unknown"}[]`;let i=e.getZodSchemaNameByRef(t.items.$ref);return i?`${gr(e,i,r)}[]`:void 0}if(Bn.some(i=>i in t&&t[i])){let i=t.allOf??t.anyOf??t.oneOf??[];if(i.length>0)return cS(e,i[0],r)}return t.type}o(cS,"getType");function uS(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,...ro(f)].filter(Boolean),d=u.join(".");s[d]&&"type"in c.schema&&c.schema.type==="object"||(delete s[d],s[d]={type:cS(e,c.schema,r)??"unknown",description:p.join(". ")})}return _e(c.schema,{data:{pathSegments:[...u]},onSchema:a}),!0},"onSchema");return"allOf"in t.schemaObj&&t.schemaObj.allOf&&t.schemaObj.allOf.forEach(c=>{if(M(c)){let u=e.resolveObject(c);_e(u,{data:{pathSegments:[]},onSchema:a})}}),_e(t.schemaObj,{data:{pathSegments:[]},onSchema:a}),s}o(uS,"getZodSchemaPropertyDescriptions");function Gs(e){return he(e).with("string",()=>"string").with("number",()=>"number").with("integer",()=>"number").with("boolean",()=>"boolean").exhaustive()}o(Gs,"primitiveTypeToTsType");function Gn({zodSchemaName:e,schema:t,resolver:r}){let n="void",i;e&&be(e)?(n=gr(r,e),i=r.getTagByZodSchemaName(e)):t!=null&&t.type&&Ft(t==null?void 0:t.type)&&(n=Gs(t==null?void 0:t.type));let s=n.split(".");return{type:s[s.length-1],...s.length>1?{namespace:s[0]}:{},...i?{importPath:zr({type:"models",tag:i,includeTagDir:!0,options:r.options})}:{}}}o(Gn,"getTsTypeBase");function Gr({schema:e,isCircular:t,parentTypes:r,resolver:n}){if(!e)return{metaType:"primitive"};for(let i of Bn){let s=e[i];if(s)if(s.length>1){let a=s.map(c=>{let u=n.resolveObject(c);return Gr({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:lS({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:PN({schema:e,parentTypes:r,resolver:n})}:{metaType:"primitive"}}o(Gr,"getSchemaTsMetaType");function lS({arraySchema:e,parentTypes:t,resolver:r}){let n,i;if(M(e.items)){let u=e.items.$ref;n=r.getZodSchemaNameByRef(u),i=r.getSchemaByRef(u)}else i=e.items;let s=Gn({zodSchemaName:n,schema:i,resolver:r}),a=pS(s,t),c=Gr({schema:i,isCircular:a,parentTypes:[...t,s],resolver:r});return{...s,...c}}o(lS,"getArraySchemaTsType");function PN({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(M(i)){let c=r.getZodSchemaNameByRef(i.$ref),u=r.getSchemaByRef(i.$ref),l=Gn({zodSchemaName:c,schema:u,resolver:r}),f=pS(l,t),p=Gr({schema:u,isCircular:f,parentTypes:[...t,l],resolver:r});return{name:n,isRequired:s,...l,...p}}else if(i.type==="array"){let c=lS({arraySchema:i,parentTypes:t,resolver:r});return{name:n,isRequired:s,type:"array",metaType:"array",arrayType:c}}else if(Ft(i.type))return{name:n,isRequired:s,type:Gs(i.type),metaType:"primitive"};return{name:n,isRequired:s,type:"void",metaType:"primitive"}})}o(PN,"getSchemaTsProperties");function pS(e,t){return t.findIndex(({type:r,namespace:n})=>r===e.type&&n===e.namespace)>-1}o(pS,"getIsCircular");var je={query:"useQuery",infiniteQuery:"useInfiniteQuery",mutation:"useMutation",queryClient:"useQueryClient"},fS={bindings:[je.query,je.infiniteQuery,je.mutation,je.queryClient],from:"@tanstack/react-query"},Kr={pageParamName:"page"},zs={pageParamName:"page",totalItemsName:"totalItems",limitParamName:"limit"};var io=o(e=>cr(ie(e.operationName)),"getEndpointName");function dS(e,t){return`${t.tsNamespaces?`${z({type:"endpoints",tag:oo(e,t),options:t})}.`:""}${io(e)}`}o(dS,"getImportedEndpointName");var mS=o(e=>e.path.replace(/:([a-zA-Z0-9_]+)/g,"${$1}"),"getEndpointPath");function oo(e,t){var n;let r=t.splitByTags?(n=e.tags)==null?void 0:n[0]:t.defaultTag;return It(r??t.defaultTag)}o(oo,"getEndpointTag");function Up(e,t,r){return t.parameters.map(n=>{var s,a,c,u;let i="string";if(be(n.zodSchema))i=gr(e,n.zodSchema);else if((s=n.parameterObject)!=null&&s.schema&&Ce(n.parameterObject.schema)){let l=(c=(a=n.parameterObject)==null?void 0:a.schema)==null?void 0:c.type;l&&Ft(l)&&(i=Gs(l))}return{name:Ot(n.name),type:i,paramType:n.type,required:((u=n.parameterObject)==null?void 0:u.required)??!0,parameterObject:n.parameterObject,bodyObject:n.bodyObject}}).sort((n,i)=>{if(n.required===i.required){let s=["Path","Body","Query","Header"];return s.indexOf(n.paramType)-s.indexOf(i.paramType)}return n.required?-1:1}).filter(n=>r!=="removePageParam"||n.name!==Kr.pageParamName).map(n=>({...n,name:r==="replacePageParam"&&n.name===Kr.pageParamName?"pageParam":n.name}))}o(Up,"mapEndpointParamsToFunctionParams");function hS(e){let t=e.parameters.filter(i=>i.type==="Query").map(i=>{let s=Bv(i.name)?i.name:`"${i.name}"`,a=Ot(i.name);return{...i,name:s,value:a}}),r={};return e.requestFormat!==Rp["Content-Type"]&&(r["Content-Type"]=`'${e.requestFormat}'`),e.responseFormat&&e.responseFormat!==Rp.Accept&&(r.Accept=`'${e.responseFormat}'`),e.parameters.filter(i=>i.type==="Header").forEach(i=>{r[i.name]=Ot(i.name)}),{...t.length>0?{params:t}:{},...Object.keys(r).length?{headers:r}:{}}}o(hS,"getEndpointConfig");function yr({resolver:e,tag:t,zodSchemas:r=[],zodSchemasAsTypes:n=[]}){let i="models",s=o(u=>e.getTagByZodSchemaName(u),"getTag"),a=Zp({type:i,tag:t,entities:r,getTag:s,getEntityName:o(u=>u,"getEntityName"),options:e.options}),c=Zp({type:i,tag:t,entities:n,getTag:s,getEntityName:o(u=>no(u,e.options),"getEntityName"),options:e.options});return $N(e.options,a,c)}o(yr,"getModelsImports");function gS({tag:e,endpoints:t,options:r}){return Zp({type:"endpoints",tag:e,entities:t,getTag:o(n=>oo(n,r),"getTag"),getEntityName:io,options:r})}o(gS,"getEndpointsImports");function yS({tags:e,entityName:t,getAliasEntityName:r,options:n}){let i=new Map;return e.forEach(s=>{let a=`${t}${r?` as ${r(s)}`:""}`;i.has(s)?n.tsNamespaces||i.get(s).bindings.push(a):i.set(s,{bindings:[n.tsNamespaces?z({type:"acl",tag:s,options:n}):a],from:`${so(n)}${zr({type:"acl",tag:s,includeTagDir:!0,options:n})}`})}),Array.from(i.values())}o(yS,"getAclImports");function so(e){let t=Tp;return e.importPath==="relative"?t="../":e.importPath==="absolute"?t=e.output:new RegExp(`${Ip}`,"g").test(e.output)&&(t=e.output.replace(new RegExp(`.*${Ip}`,"g"),Tp)),`${t}/`.replace(/\/\//g,"/")}o(so,"getImportPath");function Zp({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?z({type:e,tag:u,options:s}):i(c)],from:`${l?"./":so(s)}${zr({type:e,tag:u,includeTagDir:!l,options:s})}`})}}),Array.from(a.values())}o(Zp,"getImports");function $N(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:ke(n.bindings)}))}o($N,"mergeImports");function Ks({fileName:e,extension:t}){return`${e}.${t}`}o(Ks,"getFileNameWithExtension");function vS({type:e,tag:t,options:r,includeTagDir:n=!0}){let i=r.configs[e].outputFileNameSuffix;return t?`${n?`${cr(t)}/`:""}${cr(t)}.${i}`:i}o(vS,"getTagFileNameWithoutExtension");function zr(...e){return vS(...e)}o(zr,"getTagImportPath");function SS(...e){return`${vS(...e)}.ts`}o(SS,"getTagFileName");var z=o(({type:e,tag:t,options:r})=>`${Z(t)}${r.configs[e].namespaceSuffix}`,"getNamespaceName");function bS(e){return e.standalone?`${so(e)}${Ds.fileName}`:Fv}o(bS,"getAppRestClientImportPath");function _S(e){return e.standalone?`${so(e)}${Ms.reactQueryTypes.fileName}`:Vv}o(_S,"getQueryTypesImportPath");var at=o(e=>e.method==="get","isQuery"),Ws=o(e=>e.method!=="get","isMutation"),Qs=o((e,t)=>at(e)&&t.every(r=>e.parameters.some(n=>n.name===r&&n.type==="Query")),"isInfiniteQuery");var PS={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 ao(e){return{type:"invalid-schema",message:e}}o(ao,"getInvalidSchemaError");function $S(e){return{type:"invalid-operation-id",message:`Operation ${e}`}}o($S,"getInvalidOperationIdError");function ES(e,t){return{type:"missing-path-parameter",message:`Path ${t} is missing [${e.map(({name:r})=>r).join(", ")}]`}}o(ES,"getMissingPathParameterError");function OS(e){return{type:"not-allowed-inline-enum",message:e}}o(OS,"getNotAllowedInlineEnumError");function xS(e){return{type:"not-allowed-circular-schema",message:e}}o(xS,"getNotAllowedCircularSchemaError");function wS(e,t,r){return{type:"missing-acl-condition-property",message:`Condition property ${e} is not found in parameters or body in operation ${Kp(t,r)}`}}o(wS,"getMissingAclConditionPropertyError");function zp(e,t,r){return{type:"missing-status-code",message:`Missing status code ${Gp(e)} in operation ${Kp(t,r)}`}}o(zp,"getMissingStatusCodeError");function AS(e,t,r){return{type:"invalid-status-code",message:`Operation ${Kp(t,r)} expected HTTP status code ${Gp(e.expected)} but received ${Gp(e.received)}`}}o(AS,"getInvalidStatusCodeError");function Kp(e,t){return e.operationId??`${t.method} ${t.path}`}o(Kp,"getOperationDescriptor");function Gp(e){return`${e} (${PS[e]})`}o(Gp,"getStatusCodeDescription");function Rt({schema:e,meta:t,options:r}){let n=[];he(e.type).with("string",()=>n.push(xN(e))).with("number","integer",()=>n.push(AN(e))).with("array",()=>n.push(IN(e))).otherwise(()=>{}),typeof e.description=="string"&&e.description!==""&&r.withDescription&&([`
|
|
72
|
+
`,t};Y.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};Y.prototype.MustacheStatement=function(e){return this.pad("{{ "+this.SubExpression(e)+" }}")};Y.prototype.Decorator=function(e){return this.pad("{{ DIRECTIVE "+this.SubExpression(e)+" }}")};Y.prototype.BlockStatement=Y.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};Y.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+" }}")};Y.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+" }}")};Y.prototype.ContentStatement=function(e){return this.pad("CONTENT[ '"+e.value+"' ]")};Y.prototype.CommentStatement=function(e){return this.pad("{{! '"+e.value+"' }}")};Y.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};Y.prototype.PathExpression=function(e){var t=e.parts.join("/");return(e.data?"@":"")+"PATH:"+t};Y.prototype.StringLiteral=function(e){return'"'+e.value+'"'};Y.prototype.NumberLiteral=function(e){return"NUMBER{"+e.value+"}"};Y.prototype.BooleanLiteral=function(e){return"BOOLEAN{"+e.value+"}"};Y.prototype.UndefinedLiteral=function(){return"UNDEFINED"};Y.prototype.NullLiteral=function(){return"NULL"};Y.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(", ")+"}"};Y.prototype.HashPair=function(e){return e.key+"="+this.accept(e.value)}});var br=h((qV,Z_)=>{var qa=V_().default,U_=H_();qa.PrintVisitor=U_.PrintVisitor;qa.print=U_.print;Z_.exports=qa;function B_(e,t){var r=require("fs"),n=r.readFileSync(t,"utf8");e.exports=qa.compile(n)}o(B_,"extension");typeof require<"u"&&require.extensions&&(require.extensions[".handlebars"]=B_,require.extensions[".hbs"]=B_)});var wj={};h2(wj,{getGenerateFilesData:()=>xj,getGenerateMetadata:()=>Oj});module.exports=g2(wj);var Qf=mt(xv());var wv="Schema",Av="Enum",Iv="Body",Tv="Param",Rv="Response",Nv="ErrorResponse",Qi="z.void()",ks="z.enum",Cs={bindings:["z"],from:"zod"};var Yi={input:"input.yaml",output:"output",splitByTags:!0,defaultTag:"Common",excludeTags:[],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:wv,enumSuffix:Av,withDefaultValues:!0,extractEnums:!0,removeOperationPrefixEndingWith:"Controller_",infiniteQueries:!0};var Z=o(e=>e.charAt(0).toUpperCase()+e.slice(1),"capitalize"),cr=o(e=>e.charAt(0).toLowerCase()+e.slice(1),"decapitalize"),kv=o(e=>e.replace(/(-\w)/g,t=>t[1].toUpperCase()),"kebabToCamel"),ie=o(e=>e.replace(/(_\w)/g,t=>t[1].toUpperCase()),"snakeToCamel"),Cv=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"),jv=o((e,t)=>e.replace(new RegExp(`${t}$`),""),"removeSuffix"),pN=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"),Ap=o(e=>{let t=e.map(Z).map(qv).map(r=>fN(r)).flat();return pN(t)},"getMostCommonAdjacentCombinationSplit"),qv=o(e=>e.split(/(?<![A-Z])(?=[A-Z])/).filter(Boolean),"splitByUppercase"),Mv=o(e=>qv(e).join(" "),"camelToSpaceSeparated"),fN=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"),Dv=o((e,t)=>{let r=t.replace(/es$|s$/g,""),n=new RegExp(`(${cr(r)}|${Z(r)})[a-z]*(?=$|[A-Z])`,"g");return e.replace(n,"")},"removeWord");var js=o(e=>`use${Z(ie(e.operationName))}`,"getQueryName"),Lv=o(e=>`use${Z(ie(e.operationName))}Infinite`,"getInfiniteQueryName");var Ji="AppRestClient",qs={query:"AppQueryOptions",infiniteQuery:"AppInfiniteQueryOptions",mutation:"AppMutationOptions"},Ip="src/data",Tp="@/data",Fv="@/util/rest/clients/app-rest-client",Vv="@/types/react-query";var Ms={reactQueryTypes:{fileName:"react-query.types",extension:"ts"},restClient:{fileName:"rest-client",extension:"ts"},restInterceptor:{fileName:"rest-interceptor",extension:"ts"}},Ds={fileName:"app-rest-client",extension:"ts"};var ke=o((...e)=>[...new Set(e.flat())],"getUniqueArray");var Rp={"Content-Type":"application/json",Accept:"application/json"},Hv="data";var Bv=o(e=>/^(?:[a-zA-Z_$][a-zA-Z0-9_$]*|[0-9]+)$/.test(e),"isValidPropertyName"),Ot=o(e=>e.replace(/^[^a-zA-Z_$]*/g,"").replace(/[^a-zA-Z0-9_$]+(\w)?/g,(t,r)=>(r==null?void 0:r.toUpperCase())??""),"invalidVariableNameCharactersToCamel");var Lt=Symbol.for("@ts-pattern/matcher"),dN=Symbol.for("@ts-pattern/isVariadic"),Fs="@ts-pattern/anonymous-select-key",Np=o(e=>!!(e&&typeof e=="object"),"r"),Ls=o(e=>e&&!!e[Lt],"i"),At=o((e,t,r)=>{if(Ls(e)){let n=e[Lt](),{matched:i,selections:s}=n.match(t);return i&&s&&Object.keys(s).forEach(a=>r(a,s[a])),i}if(Np(e)){if(!Np(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];Ls(c)&&c[dN]?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)=>At(l,a[f],r))&&i.every((l,f)=>At(l,c[f],r))&&(s.length===0||At(s[0],u,r))}return e.length===t.length&&e.every((a,c)=>At(a,t[c],r))}return Reflect.ownKeys(e).every(n=>{let i=e[n];return(n in t||Ls(s=i)&&s[Lt]().matcherType==="optional")&&At(i,t[n],r);var s})}return Object.is(t,e)},"s"),dr=o(e=>{var t,r,n;return Np(e)?Ls(e)?(t=(r=(n=e[Lt]()).getSelectionKeys)==null?void 0:r.call(n))!=null?t:[]:Array.isArray(e)?eo(e,dr):eo(Object.values(e),dr):[]},"o"),eo=o((e,t)=>e.reduce((r,n)=>r.concat(t(n)),[]),"c");function Ze(e){return Object.assign(e,{optional:o(()=>mN(e),"optional"),and:o(t=>G(e,t),"and"),or:o(t=>hN(e,t),"or"),select:o(t=>t===void 0?Uv(e):Uv(t,e),"select")})}o(Ze,"u");function mN(e){return Ze({[Lt]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return t===void 0?(dr(e).forEach(i=>n(i,void 0)),{matched:!0,selections:r}):{matched:At(e,t,n),selections:r}},"match"),getSelectionKeys:o(()=>dr(e),"getSelectionKeys"),matcherType:"optional"})})}o(mN,"h");function G(...e){return Ze({[Lt]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return{matched:e.every(i=>At(i,t,n)),selections:r}},"match"),getSelectionKeys:o(()=>eo(e,dr),"getSelectionKeys"),matcherType:"and"})})}o(G,"m");function hN(...e){return Ze({[Lt]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return eo(e,dr).forEach(i=>n(i,void 0)),{matched:e.some(i=>At(i,t,n)),selections:r}},"match"),getSelectionKeys:o(()=>eo(e,dr),"getSelectionKeys"),matcherType:"or"})})}o(hN,"d");function D(e){return{[Lt]:()=>({match:o(t=>({matched:!!e(t)}),"match")})}}o(D,"p");function Uv(...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 Ze({[Lt]:()=>({match:o(n=>{let i={[t??Fs]:n};return{matched:r===void 0||At(r,n,(s,a)=>{i[s]=a}),selections:i}},"match"),getSelectionKeys:o(()=>[t??Fs].concat(r===void 0?[]:dr(r)),"getSelectionKeys")})})}o(Uv,"y");function xt(e){return typeof e=="number"}o(xt,"v");function ur(e){return typeof e=="string"}o(ur,"b");function lr(e){return typeof e=="bigint"}o(lr,"w");var X8=Ze(D(function(e){return!0}));var pr=o(e=>Object.assign(Ze(e),{startsWith:o(t=>{return pr(G(e,(r=t,D(n=>ur(n)&&n.startsWith(r)))));var r},"startsWith"),endsWith:o(t=>{return pr(G(e,(r=t,D(n=>ur(n)&&n.endsWith(r)))));var r},"endsWith"),minLength:o(t=>pr(G(e,(r=>D(n=>ur(n)&&n.length>=r))(t))),"minLength"),length:o(t=>pr(G(e,(r=>D(n=>ur(n)&&n.length===r))(t))),"length"),maxLength:o(t=>pr(G(e,(r=>D(n=>ur(n)&&n.length<=r))(t))),"maxLength"),includes:o(t=>{return pr(G(e,(r=t,D(n=>ur(n)&&n.includes(r)))));var r},"includes"),regex:o(t=>{return pr(G(e,(r=t,D(n=>ur(n)&&!!n.match(r)))));var r},"regex")}),"j"),eL=pr(D(ur)),wt=o(e=>Object.assign(Ze(e),{between:o((t,r)=>wt(G(e,((n,i)=>D(s=>xt(s)&&n<=s&&i>=s))(t,r))),"between"),lt:o(t=>wt(G(e,(r=>D(n=>xt(n)&&n<r))(t))),"lt"),gt:o(t=>wt(G(e,(r=>D(n=>xt(n)&&n>r))(t))),"gt"),lte:o(t=>wt(G(e,(r=>D(n=>xt(n)&&n<=r))(t))),"lte"),gte:o(t=>wt(G(e,(r=>D(n=>xt(n)&&n>=r))(t))),"gte"),int:o(()=>wt(G(e,D(t=>xt(t)&&Number.isInteger(t)))),"int"),finite:o(()=>wt(G(e,D(t=>xt(t)&&Number.isFinite(t)))),"finite"),positive:o(()=>wt(G(e,D(t=>xt(t)&&t>0))),"positive"),negative:o(()=>wt(G(e,D(t=>xt(t)&&t<0))),"negative")}),"x"),tL=wt(D(xt)),fr=o(e=>Object.assign(Ze(e),{between:o((t,r)=>fr(G(e,((n,i)=>D(s=>lr(s)&&n<=s&&i>=s))(t,r))),"between"),lt:o(t=>fr(G(e,(r=>D(n=>lr(n)&&n<r))(t))),"lt"),gt:o(t=>fr(G(e,(r=>D(n=>lr(n)&&n>r))(t))),"gt"),lte:o(t=>fr(G(e,(r=>D(n=>lr(n)&&n<=r))(t))),"lte"),gte:o(t=>fr(G(e,(r=>D(n=>lr(n)&&n>=r))(t))),"gte"),positive:o(()=>fr(G(e,D(t=>lr(t)&&t>0))),"positive"),negative:o(()=>fr(G(e,D(t=>lr(t)&&t<0))),"negative")}),"A"),rL=fr(D(lr)),nL=Ze(D(function(e){return typeof e=="boolean"})),iL=Ze(D(function(e){return typeof e=="symbol"})),oL=Ze(D(function(e){return e==null})),sL=Ze(D(function(e){return e!=null}));var qp=class qp 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(qp,"W");var kp=qp,Cp={matched:!1,value:void 0};function he(e){return new jp(e,Cp)}o(he,"z");var Xi=class Xi{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=>At(l,this.input,c))||i&&!i(this.input)?Cp:{matched:!0,value:r(s?Fs in a?a[Fs]:a:this.input,this.input)};return new Xi(this.input,u)}when(t,r){if(this.state.matched)return this;let n=!!t(this.input);return new Xi(this.input,n?{matched:!0,value:r(this.input,this.input)}:Cp)}otherwise(t){return this.state.matched?this.state.value:t(this.input)}exhaustive(){if(this.state.matched)return this.state.value;throw new kp(this.input)}run(){return this.exhaustive()}returnType(){return this}};o(Xi,"I");var jp=Xi;var Mp=["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"];var Dp=2,Zv=["application/octet-stream","multipart/form-data","application/x-www-form-urlencoded","*/*"],Gv=["query","header","path"],mr=["get","put","post","delete","options","head","patch","trace"],zv=["string","number","integer","boolean"],Bn=["allOf","anyOf","oneOf"];function hr(e,t){let r={};return Object.keys(e).forEach(n=>{t.includes(n)&&(r[n]=e[n])}),r}o(hr,"pick");function It(e){return Cv(e)}o(It,"formatTag");function Br(e,t){var n;let r=(n=e.tags)==null?void 0:n[0];return It(r??t.defaultTag)}o(Br,"getOperationTag");function Kv(e,t){let r={};for(let n in e.paths){let i=e.paths[n],s=hr(i,mr);for(let a in s){let c=s[a];if(!c||c.deprecated&&!t.withDeprecatedEndpoints)continue;let u=t.splitByTags?Br(c,t):t.defaultTag;r[u]||(r[u]=[]),r[u].push(c)}}return r}o(Kv,"getOperationsByTag");var Qv=o(e=>`#/components/schemas/${e}`,"getSchemaRef"),Ur=o(e=>e[1]==="/"?e:"#/"+e.slice(1),"autocorrectRef"),Un=o(e=>Ur(e).split("/").at(-1),"getSchemaNameByRef");function M(e){return e!=null&&Object.prototype.hasOwnProperty.call(e,"$ref")}o(M,"isReferenceObject");function Vp(e){let t=gN(e).normalize("NFKD").trim().replace(/\s+/g,"_").replace(/--+/g,"-").replace(/-+/g,"_").replace(/[^\w-]+/g,"_");return ie(t)}o(Vp,"normalizeString");function Yv(e){return/^[a-zA-Z]\w*$/.test(e)?e:`"${e}"`}o(Yv,"wrapWithQuotesIfNeeded");function Jv(e){return typeof e=="string"&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}o(Jv,"unwrapQuotesIfNeeded");function gN(e){let t=Number(e[0]);return typeof t=="number"&&!Number.isNaN(t)?"_"+e:e}o(gN,"prefixStringStartingWithNumberIfNeeded");function Hp(e){let t=e.replaceAll("_","#");return ie(t.replaceAll("-","_")).replaceAll("#","_")}o(Hp,"pathParamToVariableName");var Ft=o(e=>zv.includes(e),"isPrimitiveType");function Xv(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(Xv,"escapeControlCharacters");function Ge(e){return e.includes("application/")&&e.includes("json")||Zv.includes(e)||e.includes("text/")}o(Ge,"isParamMediaTypeAllowed");function Vs(e){return e>=200&&e<300}o(Vs,"isMainResponseStatus");function Hs(e){return!(e>=200&&e<300)}o(Hs,"isErrorStatus");function Zn(e){return e==="application/json"}o(Zn,"isMediaTypeAllowed");function Lp({path:e,method:t,operation:r,options:n,tag:i,keepOperationTag:s,keepOperationPrefix:a}){let c=`${t}${vN(e)}`,u=r.operationId?Ot(r.operationId):c;if(n.removeOperationPrefixEndingWith&&a)u=u.split(n.removeOperationPrefixEndingWith).map((f,p)=>p===0?f:Z(f)).join("");else if(n.removeOperationPrefixEndingWith&&!a){let l=new RegExp(`^.*${n.removeOperationPrefixEndingWith}`);u=u.replace(l,"")}if(n.tsNamespaces&&!s){let l=Dv(u,i);Mp.includes(l)||(u=l)}return Mp.includes(u)?c:u}o(Lp,"getOperationName");function to({operationsByTag:e,...t}){let{operation:r,options:n}=t,i=n.splitByTags?Br(r,n):n.defaultTag,s=o(a=>{let c=Lp({...t,tag:i,keepOperationTag:a});if(e[i].filter(l=>Lp({...t,operation:l,tag:i,keepOperationTag:a})===c).length===1)return c},"operationName");return s()??s(!0)??Lp({...t,tag:i,keepOperationTag:!0,keepOperationPrefix:!0})}o(to,"getUniqueOperationName");function eS(e,t,r){let n=[];for(let i in e.paths){let s=e.paths[i],a=hr(s,mr);for(let c in a){let u=a[c];if(!u||u.deprecated&&!r.withDeprecatedEndpoints)continue;let l=to({path:i,method:c,operation:u,operationsByTag:t,options:r});n.push(l)}}return n}o(eS,"getUniqueOperationNamesWithoutSplitByTags");var Wv=/({\w+})/g,yN=/[^\w\-]+/g;function vN(e){e=Z(kv(e.replaceAll("/","-")).replaceAll("-",""));let t=[...e.matchAll(Wv)];if(t.length>0){let r=t.sort((n,i)=>n.index-i.index)[t.length-1][0];e=`${e.replace(Wv,"")}By${Z(r.slice(1,-1))}`}return e.replace(yN,"_")}o(vN,"pathToVariableName");var Fp=/{(\b\w+(?:-\w+)*\b)}/g;function tS(e){let t=e.match(Fp);return t===null?e.replaceAll(Fp,":$1"):(t.forEach(r=>{let n=Hp(r.replaceAll(Fp,":$1"));e=e.replaceAll(r,n)}),e)}o(tS,"replaceHyphenatedPath");function Ce(e){return!M(e)}o(Ce,"isSchemaObject");function Bs(e){return e.type==="array"}o(Bs,"isArraySchemaObject");function rS(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(SN(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(M(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(rS,"inferRequiredSchema");var SN=o(e=>!M(e)&&!!e.required&&!e.type&&!e.properties&&!(e!=null&&e.allOf)&&!(e!=null&&e.anyOf)&&!e.oneOf,"isBrokenAllOfItem");var Tt=o((e,t)=>wp(Z(Vp(e)),t),"getZodSchemaName"),Bp=o((e,t,r)=>wp(Z(Vp(e)),`${t}${r}`),"getEnumZodSchemaName"),be=o(e=>!e.startsWith("z."),"isNamedZodSchema"),nS=o(e=>e.startsWith(ks),"isEnumZodSchema"),Zr=o((e,t,r)=>t?e:`${r}_${e}`,"getZodSchemaOperationName"),Us=o(e=>ie(`${e}_${Iv}`),"getBodyZodSchemaName"),iS=o((e,t)=>ie(`${e}_${t}${Tv}`),"getParamZodSchemaName"),bN=o(e=>ie(`${e}${Rv}`),"getMainResponseZodSchemaName"),_N=o((e,t)=>ie(`${e}_${t}_${Nv}`),"getErrorResponseZodSchemaName");function Zs({statusCode:e,operationName:t,isUniqueOperationName:r,tag:n}){let i=Number(e),s=Zr(t,r,n);return!Vs(i)&&e!=="default"&&Hs(i)?_N(s,e):bN(s)}o(Zs,"getResponseZodSchemaName");function ro(e){return["minimum","exclusiveMinimum","maximum","exclusiveMaximum","minItems","minLength","minProperties","maxItems","maxLength","maxProperties","default","example"].filter(n=>e[n]).reduce((n,i)=>[...n,`${Z(Mv(i))}: \`${e[i]}\``],[])}o(ro,"getSchemaDescriptions");function _e(e,t){if(!e)return;let{data:r,onSchema:n}=t;if(M(e)&&n({type:"reference",schema:e,data:r})===!0)return;let i=e;if(Bn.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&&_e(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&&_e(a,t);if(i.additionalProperties&&typeof i.additionalProperties=="object"){if(n({type:"additionalProperties",parentSchema:e,schema:i.additionalProperties,data:r})===!0)return;_e(i.additionalProperties,t)}if(i.type==="array"){let s=e.items;if(n({type:"array",parentSchema:e,schema:s,data:r})===!0)return;_e(s,t)}}o(_e,"iterateSchema");var no=o((e,t)=>jv(e,t.schemaSuffix),"getZodSchemaInferedTypeName"),oS=o((e,t)=>be(t)?`${e.options.tsNamespaces?`${z({type:"models",tag:e.getTagByZodSchemaName(t),options:e.options})}.`:""}${t}`:t,"getImportedZodSchemaName"),gr=o((e,t,r)=>{if(!be(t))return t===Qi?"void":t;let n=e.getTagByZodSchemaName(t);return`${e.options.tsNamespaces&&n!==r?`${z({type:"models",tag:n,options:e.options})}.`:""}${no(t,e.options)}`},"getImportedZodSchemaInferedTypeName");function sS(e){var t;return e.isEnum?"enum":((t=e.schemaObj)==null?void 0:t.type)??"object"}o(sS,"getZodSchemaType");function aS(e){if(e.schemaObj)return[e.schemaObj.description,...ro(e.schemaObj).join(". ")].filter(Boolean)}o(aS,"getZodSchemaDescription");function cS(e,t,r){var n;if(M(t)){let i=e.getZodSchemaNameByRef(t.$ref);return i?gr(e,i,r):void 0}if(Bs(t)){if(!M(t.items))return`${((n=t.items)==null?void 0:n.type)??"unknown"}[]`;let i=e.getZodSchemaNameByRef(t.items.$ref);return i?`${gr(e,i,r)}[]`:void 0}if(Bn.some(i=>i in t&&t[i])){let i=t.allOf??t.anyOf??t.oneOf??[];if(i.length>0)return cS(e,i[0],r)}return t.type}o(cS,"getType");function uS(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,...ro(f)].filter(Boolean),d=u.join(".");s[d]&&"type"in c.schema&&c.schema.type==="object"||(delete s[d],s[d]={type:cS(e,c.schema,r)??"unknown",description:p.join(". ")})}return _e(c.schema,{data:{pathSegments:[...u]},onSchema:a}),!0},"onSchema");return"allOf"in t.schemaObj&&t.schemaObj.allOf&&t.schemaObj.allOf.forEach(c=>{if(M(c)){let u=e.resolveObject(c);_e(u,{data:{pathSegments:[]},onSchema:a})}}),_e(t.schemaObj,{data:{pathSegments:[]},onSchema:a}),s}o(uS,"getZodSchemaPropertyDescriptions");function Gs(e){return he(e).with("string",()=>"string").with("number",()=>"number").with("integer",()=>"number").with("boolean",()=>"boolean").exhaustive()}o(Gs,"primitiveTypeToTsType");function Gn({zodSchemaName:e,schema:t,resolver:r}){let n="void",i;e&&be(e)?(n=gr(r,e),i=r.getTagByZodSchemaName(e)):t!=null&&t.type&&Ft(t==null?void 0:t.type)&&(n=Gs(t==null?void 0:t.type));let s=n.split(".");return{type:s[s.length-1],...s.length>1?{namespace:s[0]}:{},...i?{importPath:zr({type:"models",tag:i,includeTagDir:!0,options:r.options})}:{}}}o(Gn,"getTsTypeBase");function Gr({schema:e,isCircular:t,parentTypes:r,resolver:n}){if(!e)return{metaType:"primitive"};for(let i of Bn){let s=e[i];if(s)if(s.length>1){let a=s.map(c=>{let u=n.resolveObject(c);return Gr({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:lS({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:PN({schema:e,parentTypes:r,resolver:n})}:{metaType:"primitive"}}o(Gr,"getSchemaTsMetaType");function lS({arraySchema:e,parentTypes:t,resolver:r}){let n,i;if(M(e.items)){let u=e.items.$ref;n=r.getZodSchemaNameByRef(u),i=r.getSchemaByRef(u)}else i=e.items;let s=Gn({zodSchemaName:n,schema:i,resolver:r}),a=pS(s,t),c=Gr({schema:i,isCircular:a,parentTypes:[...t,s],resolver:r});return{...s,...c}}o(lS,"getArraySchemaTsType");function PN({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(M(i)){let c=r.getZodSchemaNameByRef(i.$ref),u=r.getSchemaByRef(i.$ref),l=Gn({zodSchemaName:c,schema:u,resolver:r}),f=pS(l,t),p=Gr({schema:u,isCircular:f,parentTypes:[...t,l],resolver:r});return{name:n,isRequired:s,...l,...p}}else if(i.type==="array"){let c=lS({arraySchema:i,parentTypes:t,resolver:r});return{name:n,isRequired:s,type:"array",metaType:"array",arrayType:c}}else if(Ft(i.type))return{name:n,isRequired:s,type:Gs(i.type),metaType:"primitive"};return{name:n,isRequired:s,type:"void",metaType:"primitive"}})}o(PN,"getSchemaTsProperties");function pS(e,t){return t.findIndex(({type:r,namespace:n})=>r===e.type&&n===e.namespace)>-1}o(pS,"getIsCircular");var je={query:"useQuery",infiniteQuery:"useInfiniteQuery",mutation:"useMutation",queryClient:"useQueryClient"},fS={bindings:[je.query,je.infiniteQuery,je.mutation,je.queryClient],from:"@tanstack/react-query"},Kr={pageParamName:"page"},zs={pageParamName:"page",totalItemsName:"totalItems",limitParamName:"limit"};var io=o(e=>cr(ie(e.operationName)),"getEndpointName");function dS(e,t){return`${t.tsNamespaces?`${z({type:"endpoints",tag:oo(e,t),options:t})}.`:""}${io(e)}`}o(dS,"getImportedEndpointName");var mS=o(e=>e.path.replace(/:([a-zA-Z0-9_]+)/g,"${$1}"),"getEndpointPath");function oo(e,t){var n;let r=t.splitByTags?(n=e.tags)==null?void 0:n[0]:t.defaultTag;return It(r??t.defaultTag)}o(oo,"getEndpointTag");function Up(e,t,r){return t.parameters.map(n=>{var s,a,c,u;let i="string";if(be(n.zodSchema))i=gr(e,n.zodSchema);else if((s=n.parameterObject)!=null&&s.schema&&Ce(n.parameterObject.schema)){let l=(c=(a=n.parameterObject)==null?void 0:a.schema)==null?void 0:c.type;l&&Ft(l)&&(i=Gs(l))}return{name:Ot(n.name),type:i,paramType:n.type,required:((u=n.parameterObject)==null?void 0:u.required)??!0,parameterObject:n.parameterObject,bodyObject:n.bodyObject}}).sort((n,i)=>{if(n.required===i.required){let s=["Path","Body","Query","Header"];return s.indexOf(n.paramType)-s.indexOf(i.paramType)}return n.required?-1:1}).filter(n=>r!=="removePageParam"||n.name!==Kr.pageParamName).map(n=>({...n,name:r==="replacePageParam"&&n.name===Kr.pageParamName?"pageParam":n.name}))}o(Up,"mapEndpointParamsToFunctionParams");function hS(e){let t=e.parameters.filter(i=>i.type==="Query").map(i=>{let s=Bv(i.name)?i.name:`"${i.name}"`,a=Ot(i.name);return{...i,name:s,value:a}}),r={};return e.requestFormat!==Rp["Content-Type"]&&(r["Content-Type"]=`'${e.requestFormat}'`),e.responseFormat&&e.responseFormat!==Rp.Accept&&(r.Accept=`'${e.responseFormat}'`),e.parameters.filter(i=>i.type==="Header").forEach(i=>{r[i.name]=Ot(i.name)}),{...t.length>0?{params:t}:{},...Object.keys(r).length?{headers:r}:{}}}o(hS,"getEndpointConfig");function yr({resolver:e,tag:t,zodSchemas:r=[],zodSchemasAsTypes:n=[]}){let i="models",s=o(u=>e.getTagByZodSchemaName(u),"getTag"),a=Zp({type:i,tag:t,entities:r,getTag:s,getEntityName:o(u=>u,"getEntityName"),options:e.options}),c=Zp({type:i,tag:t,entities:n,getTag:s,getEntityName:o(u=>no(u,e.options),"getEntityName"),options:e.options});return $N(e.options,a,c)}o(yr,"getModelsImports");function gS({tag:e,endpoints:t,options:r}){return Zp({type:"endpoints",tag:e,entities:t,getTag:o(n=>oo(n,r),"getTag"),getEntityName:io,options:r})}o(gS,"getEndpointsImports");function yS({tags:e,entityName:t,getAliasEntityName:r,options:n}){let i=new Map;return e.forEach(s=>{let a=`${t}${r?` as ${r(s)}`:""}`;i.has(s)?n.tsNamespaces||i.get(s).bindings.push(a):i.set(s,{bindings:[n.tsNamespaces?z({type:"acl",tag:s,options:n}):a],from:`${so(n)}${zr({type:"acl",tag:s,includeTagDir:!0,options:n})}`})}),Array.from(i.values())}o(yS,"getAclImports");function so(e){let t=Tp;return e.importPath==="relative"?t="../":e.importPath==="absolute"?t=e.output:new RegExp(`${Ip}`,"g").test(e.output)&&(t=e.output.replace(new RegExp(`.*${Ip}`,"g"),Tp)),`${t}/`.replace(/\/\//g,"/")}o(so,"getImportPath");function Zp({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?z({type:e,tag:u,options:s}):i(c)],from:`${l?"./":so(s)}${zr({type:e,tag:u,includeTagDir:!l,options:s})}`})}}),Array.from(a.values())}o(Zp,"getImports");function $N(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:ke(n.bindings)}))}o($N,"mergeImports");function Ks({fileName:e,extension:t}){return`${e}.${t}`}o(Ks,"getFileNameWithExtension");function vS({type:e,tag:t,options:r,includeTagDir:n=!0}){let i=r.configs[e].outputFileNameSuffix;return t?`${n?`${cr(t)}/`:""}${cr(t)}.${i}`:i}o(vS,"getTagFileNameWithoutExtension");function zr(...e){return vS(...e)}o(zr,"getTagImportPath");function SS(...e){return`${vS(...e)}.ts`}o(SS,"getTagFileName");var z=o(({type:e,tag:t,options:r})=>`${Z(t)}${r.configs[e].namespaceSuffix}`,"getNamespaceName");function bS(e){return e.standalone?`${so(e)}${Ds.fileName}`:Fv}o(bS,"getAppRestClientImportPath");function _S(e){return e.standalone?`${so(e)}${Ms.reactQueryTypes.fileName}`:Vv}o(_S,"getQueryTypesImportPath");var at=o(e=>e.method==="get","isQuery"),Ws=o(e=>e.method!=="get","isMutation"),Qs=o((e,t)=>at(e)&&t.every(r=>e.parameters.some(n=>n.name===r&&n.type==="Query")),"isInfiniteQuery");var PS={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 ao(e){return{type:"invalid-schema",message:e}}o(ao,"getInvalidSchemaError");function $S(e){return{type:"invalid-operation-id",message:`Operation ${e}`}}o($S,"getInvalidOperationIdError");function ES(e,t){return{type:"missing-path-parameter",message:`Path ${t} is missing [${e.map(({name:r})=>r).join(", ")}]`}}o(ES,"getMissingPathParameterError");function OS(e){return{type:"not-allowed-inline-enum",message:e}}o(OS,"getNotAllowedInlineEnumError");function xS(e){return{type:"not-allowed-circular-schema",message:e}}o(xS,"getNotAllowedCircularSchemaError");function wS(e,t,r){return{type:"missing-acl-condition-property",message:`Condition property ${e} is not found in parameters or body in operation ${Kp(t,r)}`}}o(wS,"getMissingAclConditionPropertyError");function zp(e,t,r){return{type:"missing-status-code",message:`Missing HTTP status code ${Gp(e)} in operation ${Kp(t,r)}`}}o(zp,"getMissingStatusCodeError");function AS(e,t,r){return{type:"invalid-status-code",message:`Operation ${Kp(t,r)} expected HTTP status code ${Gp(e.expected)} but received ${Gp(e.received)}`}}o(AS,"getInvalidStatusCodeError");function Kp(e,t){return e.operationId??`${t.method} ${t.path}`}o(Kp,"getOperationDescriptor");function Gp(e){return`${e} (${PS[e]})`}o(Gp,"getStatusCodeDescription");function Rt({schema:e,meta:t,options:r}){let n=[];he(e.type).with("string",()=>n.push(xN(e))).with("number","integer",()=>n.push(AN(e))).with("array",()=>n.push(IN(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(EN({schema:e,meta:t,options:r}),r.withDefaultValues!==!1?ON(e):[]).filter(Boolean).join(".");return i?`.${i}`:""}o(Rt,"getZodChain");function EN({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(EN,"getZodChainablePresence");function ON(e){return e.default!==void 0?`default(${he(e.type).with("number","integer",()=>Jv(e.default)).otherwise(()=>JSON.stringify(e.default))})`:""}o(ON,"getZodChainableDefault");function xN(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(${wN(e.pattern)})`),e.format){let r=he(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(xN,"getZodChainableStringValidations");function wN(e){return e.startsWith("/")&&e.endsWith("/")&&(e=e.slice(1,-1)),e=Xv(e),`/${e}/`}o(wN,"formatPatternIfNeeded");function AN(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(AN,"getZodChainableNumberValidations");function IN(e){let t=[];return e.minItems&&t.push(`min(${e.minItems})`),e.maxItems&&t.push(`max(${e.maxItems})`),t.join(".")}o(IN,"getZodChainableArrayValidations");var Wr=o(e=>e.reduce((t,r)=>t+r,0),"sum");function oe(e,t){if(!t)return e;if(M(t))return e+2;if(Array.isArray(t.type))return t.type.length===1?qe("oneOf")+oe(e,{...t,type:t.type[0]}):e+qe("oneOf")+Wr(t.type.map(r=>oe(0,{...t,type:r})));if(t.oneOf)return t.oneOf.length===1?qe("oneOf")+oe(e,t.oneOf[0]):e+qe("oneOf")+Wr(t.oneOf.map(r=>oe(0,r)));if(t.anyOf)return t.anyOf.length===1?qe("anyOf")+oe(e,t.anyOf[0]):e+qe("anyOf")+Wr(t.anyOf.map(r=>oe(0,r)));if(t.allOf)return t.allOf.length===1?qe("allOf")+oe(e,t.allOf[0]):e+qe("allOf")+Wr(t.allOf.map(r=>oe(0,r)));if(!t.type)return e;if(Ft(t.type))return t.enum?e+IS(t)+qe("enum")+Wr(t.enum.map(r=>oe(0,r))):e+IS(t);if(t.type==="array")return t.items?qe("array")+oe(e,t.items):qe("array")+oe(e);if(t.type==="object"||t.properties||t.additionalProperties){if(t.properties){let r=Object.values(t.properties);e+=qe("object")+Wr(r.map(n=>oe(0,n)))}else e+=qe("empty-object");t.additionalProperties&&(typeof t.additionalProperties=="object"?e+=oe(0,t.additionalProperties):e+=oe(1))}return e}o(oe,"getOpenAPISchemaComplexity");function IS(e){return he(e.type).with("string","number","integer","boolean",()=>1).otherwise(()=>0)}o(IS,"complexityByType");function qe(e){return he(e).with("oneOf",()=>2).with("anyOf",()=>3).with("allOf",()=>2).with("enum","array","empty-object",()=>1).with("object",()=>2).otherwise(()=>0)}o(qe,"complexityByComposite");var Wp=class Wp{constructor(t,r,n={referencedBy:[]},i){this.schema=t;this.resolver=r;M(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?`${z({type:"models",tag:i,options:r})}.${n}`:n}get complexity(){return oe(0,this.schema)}assign(t){return this.code=t,this}inherit(t){return t&&t.children.push(this),this}};o(Wp,"ZodSchema");var co=Wp;function Q({schema:e,resolver:t,meta:r,tag:n}){var g;let i=new co(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(M(e))return TN({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});let c=NN({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(c)return c;let u=RN({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(u)return u;let l=kN({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(l)return l;let f=CN({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(f)return f;let p=jN({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(p)return p;let d=t.options.allReadonly?".readonly()":"";if(Bs(e))return e.items?i.assign(`z.array(${Q({...a,schema:e.items}).getCodeString(n,t.options)}${Rt({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(([L,T])=>{var Ee;let $e={...s,isRequired:v?!0:y?(Ee=e.required)==null?void 0:Ee.includes(L):t.options.withImplicitRequiredProps,name:L,isParentPartial:v},se=T;if(M(T)&&t&&(se=t.getSchemaByRef(T.$ref),!se))throw new Error(`Schema ${T.$ref} not found`);let K=Q({...a,schema:T,meta:$e}).getCodeString(n,t.options)+Rt({schema:se,meta:$e,options:t.options});return[L,K]}).map(([L,T])=>`${Yv(L)}: ${T}`).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)+Rt({schema:e.additionalProperties,meta:{...s,isRequired:!0},options:t.options}):"z.any()"})`);let O=v?".partial()":"",P=t.options.strictObjects?".strict()":"";return i.assign(`z.object(${S})${O}${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 TN({schema:e,zodSchema:t,resolver:r,meta:n,tag:i}){if(!M(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(TN,"getReferenceZodSchema");function RN({schema:e,zodSchema:t,resolver:r,meta:n,tag:i}){var a;if(!Ce(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=>Ce(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(Dy,"stringEncaseCRLFWithFirstIndex");var{stdout:Ly,stderr:Fy}=My,sf=Symbol("GENERATOR"),oo=Symbol("STYLER"),ds=Symbol("IS_EMPTY"),Vy=["ansi","ansi","ansi256","ansi16m"],so=Object.create(null),aw=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=Ly?Ly.level:0;e.level=t.level===void 0?r:t.level},"applyOptions"),uf=class uf{constructor(t){return By(t)}};o(uf,"Chalk");var ac=uf,By=o(e=>{let t=o((...r)=>r.join(" "),"chalk");return aw(t,e),Object.setPrototypeOf(t,hs.prototype),t},"chalkFactory");function hs(e){return By(e)}o(hs,"createChalk");Object.setPrototypeOf(hs.prototype,Function.prototype);for(let[e,t]of Object.entries(br))so[e]={get(){let r=cc(this,cf(t.open,t.close,this[oo]),this[ds]);return Object.defineProperty(this,e,{value:r}),r}};so.visible={get(){let e=cc(this,this[oo],!0);return Object.defineProperty(this,"visible",{value:e}),e}};var af=o((e,t,r,...n)=>e==="rgb"?t==="ansi16m"?br[r].ansi16m(...n):t==="ansi256"?br[r].ansi256(br.rgbToAnsi256(...n)):br[r].ansi(br.rgbToAnsi(...n)):e==="hex"?af("rgb",t,r,...br.hexToRgb(...n)):br[r][e](...n),"getModelAnsi"),cw=["rgb","hex","ansi256"];for(let e of cw){so[e]={get(){let{level:r}=this;return function(...n){let i=cf(af(e,Vy[r],"color",...n),br.color.close,this[oo]);return cc(this,i,this[ds])}}};let t="bg"+e[0].toUpperCase()+e.slice(1);so[t]={get(){let{level:r}=this;return function(...n){let i=cf(af(e,Vy[r],"bgColor",...n),br.bgColor.close,this[oo]);return cc(this,i,this[ds])}}}}var uw=Object.defineProperties(()=>{},{...so,level:{enumerable:!0,get(){return this[sf].level},set(e){this[sf].level=e}}}),cf=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"),cc=o((e,t,r)=>{let n=o((...i)=>lw(n,i.length===1?""+i[0]:i.join(" ")),"builder");return Object.setPrototypeOf(n,uw),n[sf]=e,n[oo]=t,n[ds]=r,n},"createBuilder"),lw=o((e,t)=>{if(e.level<=0||!t)return e[ds]?"":t;let r=e[oo];if(r===void 0)return t;let{openAll:n,closeAll:i}=r;if(t.includes("\x1B"))for(;r!==void 0;)t=qy(t,r.close,r.open),r=r.parent;let s=t.indexOf(`
|
|
140
|
-
`);return s!==-1&&(t=Dy(t,i,n,s)),n+t+i},"applyStyle");Object.defineProperties(hs.prototype,so);var KF=hs(),YF=hs({level:Fy?Fy.level:0});var Dr=new ac;function ms(e,t,r){console.log(r!==void 0&&r!==t?`${Dr.yellow(`${e}:`.padEnd(20))}${Dr.magenta(t)}`:`${`${e}:`.padEnd(20)}${t}`)}o(ms,"logVariable");function ir(e){console.log(`[INFO] ${e}`)}o(ir,"logInfo");function On(e){console.log(Dr.green(`[SUCCESS] ${e}`))}o(On,"logSuccess");function gs(e,t){e instanceof Error?(console.log(Dr.red(`[ERROR] ${t||e.message}`)),process.env.VERBOSE&&console.error(e)):console.log(Dr.red(`[ERROR] ${e}`))}o(gs,"logError");function uc(e){console.log(Dr.bgYellow(`==== ${e} ====`))}o(uc,"logBanner");var Hy=yt(require("fs"));function ao(){return"0.6.3"}o(ao,"getVersion");var u6=yt(zy());var lf=Symbol("options_key");function Ge(e){return(t,r)=>{var n,i;if(e!=null){let s={...Reflect.getMetadata(lf,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(lf,s,t)}}}o(Ge,"YargOption");function Gy(e){let t=Reflect.getMetadata(lf,e.prototype);if(!t)throw new Error(`Options for ${e.name} were not defined`);return t}o(Gy,"getYargsOption");function lc(e){return async t=>t.options(fw(e)).middleware(async r=>await pw(e,r),!0)}o(lc,"getBuilder");function fw(e){return Object.entries(Gy(e)).reduce((t,[r,n])=>(t[r]=Object.fromEntries(Object.entries(n).filter(([i])=>!["envAlias","default"].includes(i))),t),{})}o(fw,"getYargsOptions");async function pw(e,t){let r=new e;for(let[n,i]of Object.entries(Gy(e)))r[n]=t[n]??i.default;return r}o(pw,"loadYargsConfig");var GE=yt(em());var SO="Schema",PO="Enum",OO="Body",EO="Param",$O="Response",wO="ErrorResponse",aa="z.void()",gu="z.enum",yu={bindings:["z"],from:"zod"};var bu={input:"input.yaml",output:"output",splitByTags:!0,defaultTag:"Common",excludeTags:[],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:SO,enumSuffix:PO,withDefaultValues:!0,extractEnums:!0,removeOperationPrefixEndingWith:"Controller_",infiniteQueries:!0};var xO={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"},AO={"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"};var tm={"Content-Type":"application/json",Accept:"application/json"},IO="data";var CO=o(e=>/^(?:[a-zA-Z_$][a-zA-Z0-9_$]*|[0-9]+)$/.test(e),"isValidPropertyName"),Fn=o(e=>e.replace(/^[^a-zA-Z_$]*/g,"").replace(/[^a-zA-Z0-9_$]+(\w)?/g,(t,r)=>(r==null?void 0:r.toUpperCase())??""),"invalidVariableNameCharactersToCamel");var ln=Symbol.for("@ts-pattern/matcher"),aq=Symbol.for("@ts-pattern/isVariadic"),_u="@ts-pattern/anonymous-select-key",rm=o(e=>!!(e&&typeof e=="object"),"r"),vu=o(e=>e&&!!e[ln],"i"),Qr=o((e,t,r)=>{if(vu(e)){let n=e[ln](),{matched:i,selections:s}=n.match(t);return i&&s&&Object.keys(s).forEach(a=>r(a,s[a])),i}if(rm(e)){if(!rm(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];vu(c)&&c[aq]?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)=>Qr(l,a[p],r))&&i.every((l,p)=>Qr(l,c[p],r))&&(s.length===0||Qr(s[0],u,r))}return e.length===t.length&&e.every((a,c)=>Qr(a,t[c],r))}return Reflect.ownKeys(e).every(n=>{let i=e[n];return(n in t||vu(s=i)&&s[ln]().matcherType==="optional")&&Qr(i,t[n],r);var s})}return Object.is(t,e)},"s"),zn=o(e=>{var t,r,n;return rm(e)?vu(e)?(t=(r=(n=e[ln]()).getSelectionKeys)==null?void 0:r.call(n))!=null?t:[]:Array.isArray(e)?ua(e,zn):ua(Object.values(e),zn):[]},"o"),ua=o((e,t)=>e.reduce((r,n)=>r.concat(t(n)),[]),"c");function fr(e){return Object.assign(e,{optional:o(()=>cq(e),"optional"),and:o(t=>Le(e,t),"and"),or:o(t=>uq(e,t),"or"),select:o(t=>t===void 0?TO(e):TO(t,e),"select")})}o(fr,"u");function cq(e){return fr({[ln]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return t===void 0?(zn(e).forEach(i=>n(i,void 0)),{matched:!0,selections:r}):{matched:Qr(e,t,n),selections:r}},"match"),getSelectionKeys:o(()=>zn(e),"getSelectionKeys"),matcherType:"optional"})})}o(cq,"h");function Le(...e){return fr({[ln]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return{matched:e.every(i=>Qr(i,t,n)),selections:r}},"match"),getSelectionKeys:o(()=>ua(e,zn),"getSelectionKeys"),matcherType:"and"})})}o(Le,"m");function uq(...e){return fr({[ln]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return ua(e,zn).forEach(i=>n(i,void 0)),{matched:e.some(i=>Qr(i,t,n)),selections:r}},"match"),getSelectionKeys:o(()=>ua(e,zn),"getSelectionKeys"),matcherType:"or"})})}o(uq,"d");function Pe(e){return{[ln]:()=>({match:o(t=>({matched:!!e(t)}),"match")})}}o(Pe,"p");function TO(...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 fr({[ln]:()=>({match:o(n=>{let i={[t??_u]:n};return{matched:r===void 0||Qr(r,n,(s,a)=>{i[s]=a}),selections:i}},"match"),getSelectionKeys:o(()=>[t??_u].concat(r===void 0?[]:zn(r)),"getSelectionKeys")})})}o(TO,"y");function Kr(e){return typeof e=="number"}o(Kr,"v");function Vn(e){return typeof e=="string"}o(Vn,"b");function Bn(e){return typeof e=="bigint"}o(Bn,"w");var I9=fr(Pe(function(e){return!0}));var Hn=o(e=>Object.assign(fr(e),{startsWith:o(t=>{return Hn(Le(e,(r=t,Pe(n=>Vn(n)&&n.startsWith(r)))));var r},"startsWith"),endsWith:o(t=>{return Hn(Le(e,(r=t,Pe(n=>Vn(n)&&n.endsWith(r)))));var r},"endsWith"),minLength:o(t=>Hn(Le(e,(r=>Pe(n=>Vn(n)&&n.length>=r))(t))),"minLength"),length:o(t=>Hn(Le(e,(r=>Pe(n=>Vn(n)&&n.length===r))(t))),"length"),maxLength:o(t=>Hn(Le(e,(r=>Pe(n=>Vn(n)&&n.length<=r))(t))),"maxLength"),includes:o(t=>{return Hn(Le(e,(r=t,Pe(n=>Vn(n)&&n.includes(r)))));var r},"includes"),regex:o(t=>{return Hn(Le(e,(r=t,Pe(n=>Vn(n)&&!!n.match(r)))));var r},"regex")}),"j"),C9=Hn(Pe(Vn)),Yr=o(e=>Object.assign(fr(e),{between:o((t,r)=>Yr(Le(e,((n,i)=>Pe(s=>Kr(s)&&n<=s&&i>=s))(t,r))),"between"),lt:o(t=>Yr(Le(e,(r=>Pe(n=>Kr(n)&&n<r))(t))),"lt"),gt:o(t=>Yr(Le(e,(r=>Pe(n=>Kr(n)&&n>r))(t))),"gt"),lte:o(t=>Yr(Le(e,(r=>Pe(n=>Kr(n)&&n<=r))(t))),"lte"),gte:o(t=>Yr(Le(e,(r=>Pe(n=>Kr(n)&&n>=r))(t))),"gte"),int:o(()=>Yr(Le(e,Pe(t=>Kr(t)&&Number.isInteger(t)))),"int"),finite:o(()=>Yr(Le(e,Pe(t=>Kr(t)&&Number.isFinite(t)))),"finite"),positive:o(()=>Yr(Le(e,Pe(t=>Kr(t)&&t>0))),"positive"),negative:o(()=>Yr(Le(e,Pe(t=>Kr(t)&&t<0))),"negative")}),"x"),T9=Yr(Pe(Kr)),Un=o(e=>Object.assign(fr(e),{between:o((t,r)=>Un(Le(e,((n,i)=>Pe(s=>Bn(s)&&n<=s&&i>=s))(t,r))),"between"),lt:o(t=>Un(Le(e,(r=>Pe(n=>Bn(n)&&n<r))(t))),"lt"),gt:o(t=>Un(Le(e,(r=>Pe(n=>Bn(n)&&n>r))(t))),"gt"),lte:o(t=>Un(Le(e,(r=>Pe(n=>Bn(n)&&n<=r))(t))),"lte"),gte:o(t=>Un(Le(e,(r=>Pe(n=>Bn(n)&&n>=r))(t))),"gte"),positive:o(()=>Un(Le(e,Pe(t=>Bn(t)&&t>0))),"positive"),negative:o(()=>Un(Le(e,Pe(t=>Bn(t)&&t<0))),"negative")}),"A"),j9=Un(Pe(Bn)),R9=fr(Pe(function(e){return typeof e=="boolean"})),N9=fr(Pe(function(e){return typeof e=="symbol"})),k9=fr(Pe(function(e){return e==null})),M9=fr(Pe(function(e){return e!=null}));var sm=class sm 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(sm,"W");var nm=sm,im={matched:!1,value:void 0};function Ot(e){return new om(e,im)}o(Ot,"z");var ca=class ca{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=>Qr(l,this.input,c))||i&&!i(this.input)?im:{matched:!0,value:r(s?_u in a?a[_u]:a:this.input,this.input)};return new ca(this.input,u)}when(t,r){if(this.state.matched)return this;let n=!!t(this.input);return new ca(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 nm(this.input)}run(){return this.exhaustive()}returnType(){return this}};o(ca,"I");var om=ca;var am=["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"];var cm=2,jO=["application/octet-stream","multipart/form-data","application/x-www-form-urlencoded","*/*"],RO=["query","header","path"],Gn=["get","put","post","delete","options","head","patch","trace"],NO=["string","number","integer","boolean"],la=["allOf","anyOf","oneOf"];function Zn(e,t){let r={};return Object.keys(e).forEach(n=>{t.includes(n)&&(r[n]=e[n])}),r}o(Zn,"pick");var Fe=o(e=>e.charAt(0).toUpperCase()+e.slice(1),"capitalize"),Wn=o(e=>e.charAt(0).toLowerCase()+e.slice(1),"decapitalize"),kO=o(e=>e.replace(/(-\w)/g,t=>t[1].toUpperCase()),"kebabToCamel"),lt=o(e=>e.replace(/(_\w)/g,t=>t[1].toUpperCase()),"snakeToCamel"),MO=o(e=>e.replace(/[\W_]+(\w)?/g,(t,r)=>(r==null?void 0:r.toUpperCase())??""),"nonWordCharactersToCamel"),um=o((e,t="")=>e.endsWith(t)?e:`${e}${t}`,"suffixIfNeeded"),qO=o((e,t)=>e.replace(new RegExp(`${t}$`),""),"removeSuffix"),lq=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"),lm=o(e=>{let t=e.map(Fe).map(DO).map(r=>fq(r)).flat();return lq(t)},"getMostCommonAdjacentCombinationSplit"),DO=o(e=>e.split(/(?<![A-Z])(?=[A-Z])/).filter(Boolean),"splitByUppercase"),LO=o(e=>DO(e).join(" "),"camelToSpaceSeparated"),fq=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"),FO=o((e,t)=>{let r=t.replace(/es$|s$/g,""),n=new RegExp(`(${Wn(r)}|${Fe(r)})[a-z]*(?=$|[A-Z])`,"g");return e.replace(n,"")},"removeWord");function Kn(e){return MO(e)}o(Kn,"formatTag");function Mi(e,t){var n;let r=(n=e.tags)==null?void 0:n[0];return Kn(r??t.defaultTag)}o(Mi,"getOperationTag");function VO(e,t){let r={};for(let n in e.paths){let i=e.paths[n],s=Zn(i,Gn);for(let a in s){let c=s[a];if(!c||c.deprecated&&!t.withDeprecatedEndpoints)continue;let u=t.splitByTags?Mi(c,t):t.defaultTag;r[u]||(r[u]=[]),r[u].push(c)}}return r}o(VO,"getOperationsByTag");var HO=o(e=>`#/components/schemas/${e}`,"getSchemaRef"),qi=o(e=>e[1]==="/"?e:"#/"+e.slice(1),"autocorrectRef"),Zo=o(e=>qi(e).split("/").at(-1),"getSchemaNameByRef");function Oe(e){return e!=null&&Object.prototype.hasOwnProperty.call(e,"$ref")}o(Oe,"isReferenceObject");function dm(e){let t=pq(e).normalize("NFKD").trim().replace(/\s+/g,"_").replace(/--+/g,"-").replace(/-+/g,"_").replace(/[^\w-]+/g,"_");return lt(t)}o(dm,"normalizeString");function UO(e){return/^[a-zA-Z]\w*$/.test(e)?e:`"${e}"`}o(UO,"wrapWithQuotesIfNeeded");function zO(e){return typeof e=="string"&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}o(zO,"unwrapQuotesIfNeeded");function pq(e){let t=Number(e[0]);return typeof t=="number"&&!Number.isNaN(t)?"_"+e:e}o(pq,"prefixStringStartingWithNumberIfNeeded");function hm(e){let t=e.replaceAll("_","#");return lt(t.replaceAll("-","_")).replaceAll("#","_")}o(hm,"pathParamToVariableName");var Di=o(e=>NO.includes(e),"isPrimitiveType");function GO(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(GO,"escapeControlCharacters");function Jr(e){return e.includes("application/")&&e.includes("json")||jO.includes(e)||e.includes("text/")}o(Jr,"isParamMediaTypeAllowed");function Su(e){return e>=200&&e<300}o(Su,"isMainResponseStatus");function Pu(e){return!(e>=200&&e<300)}o(Pu,"isErrorStatus");function Ou(e){return e==="application/json"}o(Ou,"isMediaTypeAllowed");function fm({path:e,method:t,operation:r,options:n,tag:i,keepOperationTag:s,keepOperationPrefix:a}){let c=`${t}${hq(e)}`,u=r.operationId?Fn(r.operationId):c;if(n.removeOperationPrefixEndingWith&&a)u=u.split(n.removeOperationPrefixEndingWith).map((p,f)=>f===0?p:Fe(p)).join("");else if(n.removeOperationPrefixEndingWith&&!a){let l=new RegExp(`^.*${n.removeOperationPrefixEndingWith}`);u=u.replace(l,"")}if(n.tsNamespaces&&!s){let l=FO(u,i);am.includes(l)||(u=l)}return am.includes(u)?c:u}o(fm,"getOperationName");function fa({operationsByTag:e,...t}){let{operation:r,options:n}=t,i=n.splitByTags?Mi(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(fa,"getUniqueOperationName");function ZO(e,t,r){let n=[];for(let i in e.paths){let s=e.paths[i],a=Zn(s,Gn);for(let c in a){let u=a[c];if(!u||u.deprecated&&!r.withDeprecatedEndpoints)continue;let l=fa({path:i,method:c,operation:u,operationsByTag:t,options:r});n.push(l)}}return n}o(ZO,"getUniqueOperationNamesWithoutSplitByTags");var BO=/({\w+})/g,dq=/[^\w\-]+/g;function hq(e){e=Fe(kO(e.replaceAll("/","-")).replaceAll("-",""));let t=[...e.matchAll(BO)];if(t.length>0){let r=t.sort((n,i)=>n.index-i.index)[t.length-1][0];e=`${e.replace(BO,"")}By${Fe(r.slice(1,-1))}`}return e.replace(dq,"_")}o(hq,"pathToVariableName");var pm=/{(\b\w+(?:-\w+)*\b)}/g;function WO(e){let t=e.match(pm);return t===null?e.replaceAll(pm,":$1"):(t.forEach(r=>{let n=hm(r.replaceAll(pm,":$1"));e=e.replaceAll(r,n)}),e)}o(WO,"replaceHyphenatedPath");function zt(e){return!Oe(e)}o(zt,"isSchemaObject");function Eu(e){return e.type==="array"}o(Eu,"isArraySchemaObject");function KO(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(mq(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(Oe(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(KO,"inferRequiredSchema");var mq=o(e=>!Oe(e)&&!!e.required&&!e.type&&!e.properties&&!(e!=null&&e.allOf)&&!(e!=null&&e.anyOf)&&!e.oneOf,"isBrokenAllOfItem");var pa="AppRestClient",$u={query:"AppQueryOptions",infiniteQuery:"AppInfiniteQueryOptions",mutation:"AppMutationOptions"},mm="src/data",gm="@/data",YO="@/util/rest/clients/app-rest-client",QO="@/types/react-query";var wu={reactQueryTypes:{fileName:"react-query.types",extension:"ts"},restClient:{fileName:"rest-client",extension:"ts"},restInterceptor:{fileName:"rest-interceptor",extension:"ts"}},xu={fileName:"app-rest-client",extension:"ts"};var Gt=o((...e)=>[...new Set(e.flat())],"getUniqueArray");var Xr=o((e,t)=>um(Fe(dm(e)),t),"getZodSchemaName"),ym=o((e,t,r)=>um(Fe(dm(e)),`${t}${r}`),"getEnumZodSchemaName"),Dt=o(e=>!e.startsWith("z."),"isNamedZodSchema"),JO=o(e=>e.startsWith(gu),"isEnumZodSchema"),Li=o((e,t,r)=>t?e:`${r}_${e}`,"getZodSchemaOperationName"),Au=o(e=>lt(`${e}_${OO}`),"getBodyZodSchemaName"),XO=o((e,t)=>lt(`${e}_${t}${EO}`),"getParamZodSchemaName"),gq=o(e=>lt(`${e}${$O}`),"getMainResponseZodSchemaName"),yq=o((e,t)=>lt(`${e}_${t}_${wO}`),"getErrorResponseZodSchemaName");function Iu({statusCode:e,operationName:t,isUniqueOperationName:r,tag:n}){let i=Number(e),s=Li(t,r,n);return!Su(i)&&e!=="default"&&Pu(i)?yq(s,e):gq(s)}o(Iu,"getResponseZodSchemaName");function da(e){return["minimum","exclusiveMinimum","maximum","exclusiveMaximum","minItems","minLength","minProperties","maxItems","maxLength","maxProperties","default","example"].filter(n=>e[n]).reduce((n,i)=>[...n,`${Fe(LO(i))}: \`${e[i]}\``],[])}o(da,"getSchemaDescriptions");function It(e,t){if(!e)return;let{data:r,onSchema:n}=t;if(Oe(e)&&n({type:"reference",schema:e,data:r})===!0)return;let i=e;if(la.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&&It(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&&It(a,t);if(i.additionalProperties&&typeof i.additionalProperties=="object"){if(n({type:"additionalProperties",parentSchema:e,schema:i.additionalProperties,data:r})===!0)return;It(i.additionalProperties,t)}if(i.type==="array"){let s=e.items;if(n({type:"array",parentSchema:e,schema:s,data:r})===!0)return;It(s,t)}}o(It,"iterateSchema");var ha=o((e,t)=>qO(e,t.schemaSuffix),"getZodSchemaInferedTypeName"),eE=o((e,t)=>Dt(t)?`${e.options.tsNamespaces?`${et({type:"models",tag:e.getTagByZodSchemaName(t),options:e.options})}.`:""}${t}`:t,"getImportedZodSchemaName"),Fi=o((e,t,r)=>{if(!Dt(t))return t===aa?"void":t;let n=e.getTagByZodSchemaName(t);return`${e.options.tsNamespaces&&n!==r?`${et({type:"models",tag:n,options:e.options})}.`:""}${ha(t,e.options)}`},"getImportedZodSchemaInferedTypeName");function tE(e){var t;return e.isEnum?"enum":((t=e.schemaObj)==null?void 0:t.type)??"object"}o(tE,"getZodSchemaType");function rE(e){if(e.schemaObj)return[e.schemaObj.description,...da(e.schemaObj).join(". ")].filter(Boolean)}o(rE,"getZodSchemaDescription");function nE(e,t,r){var n;if(Oe(t)){let i=e.getZodSchemaNameByRef(t.$ref);return i?Fi(e,i,r):void 0}if(Eu(t)){if(!Oe(t.items))return`${((n=t.items)==null?void 0:n.type)??"unknown"}[]`;let i=e.getZodSchemaNameByRef(t.items.$ref);return i?`${Fi(e,i,r)}[]`:void 0}if(la.some(i=>i in t&&t[i])){let i=t.allOf??t.anyOf??t.oneOf??[];if(i.length>0)return nE(e,i[0],r)}return t.type}o(nE,"getType");function iE(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,...da(p)].filter(Boolean),d=u.join(".");s[d]&&"type"in c.schema&&c.schema.type==="object"||(delete s[d],s[d]={type:nE(e,c.schema,r)??"unknown",description:f.join(". ")})}return It(c.schema,{data:{pathSegments:[...u]},onSchema:a}),!0},"onSchema");return"allOf"in t.schemaObj&&t.schemaObj.allOf&&t.schemaObj.allOf.forEach(c=>{if(Oe(c)){let u=e.resolveObject(c);It(u,{data:{pathSegments:[]},onSchema:a})}}),It(t.schemaObj,{data:{pathSegments:[]},onSchema:a}),s}o(iE,"getZodSchemaPropertyDescriptions");function Yn({resolver:e,tag:t,zodSchemas:r=[],zodSchemasAsTypes:n=[]}){let i="models",s=o(u=>e.getTagByZodSchemaName(u),"getTag"),a=bm({type:i,tag:t,entities:r,getTag:s,getEntityName:o(u=>u,"getEntityName"),options:e.options}),c=bm({type:i,tag:t,entities:n,getTag:s,getEntityName:o(u=>ha(u,e.options),"getEntityName"),options:e.options});return bq(e.options,a,c)}o(Yn,"getModelsImports");function oE({tag:e,endpoints:t,options:r}){return bm({type:"endpoints",tag:e,entities:t,getTag:o(n=>ya(n,r),"getTag"),getEntityName:ga,options:r})}o(oE,"getEndpointsImports");function sE({tags:e,entityName:t,getAliasEntityName:r,options:n}){let i=new Map;return e.forEach(s=>{let a=`${t}${r?` as ${r(s)}`:""}`;i.has(s)?n.tsNamespaces||i.get(s).bindings.push(a):i.set(s,{bindings:[n.tsNamespaces?et({type:"acl",tag:s,options:n}):a],from:`${ma(n)}${Cu({type:"acl",tag:s,includeTagDir:!0,options:n})}`})}),Array.from(i.values())}o(sE,"getAclImports");function ma(e){let t=gm;return e.importPath==="relative"?t="../":e.importPath==="absolute"?t=e.output:new RegExp(`${mm}`,"g").test(e.output)&&(t=e.output.replace(new RegExp(`.*${mm}`,"g"),gm)),`${t}/`.replace(/\/\//g,"/")}o(ma,"getImportPath");function bm({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?et({type:e,tag:u,options:s}):i(c)],from:`${l?"./":ma(s)}${Cu({type:e,tag:u,includeTagDir:!l,options:s})}`})}}),Array.from(a.values())}o(bm,"getImports");function bq(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:Gt(n.bindings)}))}o(bq,"mergeImports");function Tu({fileName:e,extension:t}){return`${e}.${t}`}o(Tu,"getFileNameWithExtension");function aE({type:e,tag:t,options:r,includeTagDir:n=!0}){let i=r.configs[e].outputFileNameSuffix;return t?`${n?`${Wn(t)}/`:""}${Wn(t)}.${i}`:i}o(aE,"getTagFileNameWithoutExtension");function Cu(...e){return aE(...e)}o(Cu,"getTagImportPath");function ju(...e){return`${aE(...e)}.ts`}o(ju,"getTagFileName");var et=o(({type:e,tag:t,options:r})=>`${Fe(t)}${r.configs[e].namespaceSuffix}`,"getNamespaceName");function cE(e){return e.standalone?`${ma(e)}${xu.fileName}`:YO}o(cE,"getAppRestClientImportPath");function uE(e){return e.standalone?`${ma(e)}${wu.reactQueryTypes.fileName}`:QO}o(uE,"getQueryTypesImportPath");function lE(e){return Ot(e).with("string",()=>"string").with("number",()=>"number").with("integer",()=>"number").with("boolean",()=>"boolean").exhaustive()}o(lE,"primitiveTypeToTsType");var Zt={query:"useQuery",infiniteQuery:"useInfiniteQuery",mutation:"useMutation",queryClient:"useQueryClient"},fE={bindings:[Zt.query,Zt.infiniteQuery,Zt.mutation,Zt.queryClient],from:"@tanstack/react-query"},Vi={pageParamName:"page"},Ru={pageParamName:"page",totalItemsName:"totalItems",limitParamName:"limit"};var ga=o(e=>Wn(lt(e.operationName)),"getEndpointName");function pE(e,t){return`${t.tsNamespaces?`${et({type:"endpoints",tag:ya(e,t),options:t})}.`:""}${ga(e)}`}o(pE,"getImportedEndpointName");var dE=o(e=>e.path.replace(/:([a-zA-Z0-9_]+)/g,"${$1}"),"getEndpointPath");function ya(e,t){var n;let r=t.splitByTags?(n=e.tags)==null?void 0:n[0]:t.defaultTag;return Kn(r??t.defaultTag)}o(ya,"getEndpointTag");function vm(e,t,r){return t.parameters.map(n=>{var s,a,c,u;let i="string";if(Dt(n.zodSchema))i=Fi(e,n.zodSchema);else if((s=n.parameterObject)!=null&&s.schema&&zt(n.parameterObject.schema)){let l=(c=(a=n.parameterObject)==null?void 0:a.schema)==null?void 0:c.type;l&&Di(l)&&(i=lE(l))}return{name:Fn(n.name),type:i,paramType:n.type,required:((u=n.parameterObject)==null?void 0:u.required)??!0,parameterObject:n.parameterObject,bodyObject:n.bodyObject}}).sort((n,i)=>{if(n.required===i.required){let s=["Path","Body","Query","Header"];return s.indexOf(n.paramType)-s.indexOf(i.paramType)}return n.required?-1:1}).filter(n=>r!=="removePageParam"||n.name!==Vi.pageParamName).map(n=>({...n,name:r==="replacePageParam"&&n.name===Vi.pageParamName?"pageParam":n.name}))}o(vm,"mapEndpointParamsToFunctionParams");function hE(e){let t=e.parameters.filter(i=>i.type==="Query").map(i=>{let s=CO(i.name)?i.name:`"${i.name}"`,a=Fn(i.name);return{...i,name:s,value:a}}),r={};return e.requestFormat!==tm["Content-Type"]&&(r["Content-Type"]=`'${e.requestFormat}'`),e.responseFormat&&e.responseFormat!==tm.Accept&&(r.Accept=`'${e.responseFormat}'`),e.parameters.filter(i=>i.type==="Header").forEach(i=>{r[i.name]=Fn(i.name)}),{...t.length>0?{params:t}:{},...Object.keys(r).length?{headers:r}:{}}}o(hE,"getEndpointConfig");function ba(e){return{type:"invalid-schema",message:e}}o(ba,"getInvalidSchemaError");function mE(e){return{type:"invalid-operation-id",message:`Operation ${e}`}}o(mE,"getInvalidOperationIdError");function gE(e,t){return{type:"missing-path-parameter",message:`Path ${t} is missing [${e.map(({name:r})=>r).join(", ")}]`}}o(gE,"getMissingPathParameterError");function yE(e){return{type:"not-allowed-inline-enum",message:e}}o(yE,"getNotAllowedInlineEnumError");function bE(e){return{type:"not-allowed-circular-schema",message:e}}o(bE,"getNotAllowedCircularSchemaError");function vE(e,t,r){return{type:"missing-acl-condition-property",message:`Condition property ${e} is not found in parameters or body in operation ${Pm(t,r)}`}}o(vE,"getMissingAclConditionPropertyError");function Sm(e,t,r){return{type:"missing-status-code",message:`Missing status code ${_m(e)} in operation ${Pm(t,r)}`}}o(Sm,"getMissingStatusCodeError");function _E(e,t,r){return{type:"invalid-status-code",message:`Operation ${Pm(t,r)} expected HTTP status code ${_m(e.expected)} but received ${_m(e.received)}`}}o(_E,"getInvalidStatusCodeError");function Pm(e,t){return e.operationId??`${t.method} ${t.path}`}o(Pm,"getOperationDescriptor");function _m(e){return`${e} (${xO[e]})`}o(_m,"getStatusCodeDescription");function SE(e){return e.reduce((t,r)=>({...t,[r.type]:[...t[r.type]??[],r.message]}),{})}o(SE,"groupByType");function en({schema:e,meta:t,options:r}){let n=[];Ot(e.type).with("string",()=>n.push(Sq(e))).with("number","integer",()=>n.push(Oq(e))).with("array",()=>n.push(Eq(e))).otherwise(()=>{}),typeof e.description=="string"&&e.description!==""&&r.withDescription&&([`
|
|
140
|
+
`);return s!==-1&&(t=Dy(t,i,n,s)),n+t+i},"applyStyle");Object.defineProperties(hs.prototype,so);var KF=hs(),YF=hs({level:Fy?Fy.level:0});var Dr=new ac;function ms(e,t,r){console.log(r!==void 0&&r!==t?`${Dr.yellow(`${e}:`.padEnd(20))}${Dr.magenta(t)}`:`${`${e}:`.padEnd(20)}${t}`)}o(ms,"logVariable");function ir(e){console.log(`[INFO] ${e}`)}o(ir,"logInfo");function On(e){console.log(Dr.green(`[SUCCESS] ${e}`))}o(On,"logSuccess");function gs(e,t){e instanceof Error?(console.log(Dr.red(`[ERROR] ${t||e.message}`)),process.env.VERBOSE&&console.error(e)):console.log(Dr.red(`[ERROR] ${e}`))}o(gs,"logError");function uc(e){console.log(Dr.bgYellow(`==== ${e} ====`))}o(uc,"logBanner");var Hy=yt(require("fs"));function ao(){return"0.6.4"}o(ao,"getVersion");var u6=yt(zy());var lf=Symbol("options_key");function Ge(e){return(t,r)=>{var n,i;if(e!=null){let s={...Reflect.getMetadata(lf,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(lf,s,t)}}}o(Ge,"YargOption");function Gy(e){let t=Reflect.getMetadata(lf,e.prototype);if(!t)throw new Error(`Options for ${e.name} were not defined`);return t}o(Gy,"getYargsOption");function lc(e){return async t=>t.options(fw(e)).middleware(async r=>await pw(e,r),!0)}o(lc,"getBuilder");function fw(e){return Object.entries(Gy(e)).reduce((t,[r,n])=>(t[r]=Object.fromEntries(Object.entries(n).filter(([i])=>!["envAlias","default"].includes(i))),t),{})}o(fw,"getYargsOptions");async function pw(e,t){let r=new e;for(let[n,i]of Object.entries(Gy(e)))r[n]=t[n]??i.default;return r}o(pw,"loadYargsConfig");var GE=yt(em());var SO="Schema",PO="Enum",OO="Body",EO="Param",$O="Response",wO="ErrorResponse",aa="z.void()",gu="z.enum",yu={bindings:["z"],from:"zod"};var bu={input:"input.yaml",output:"output",splitByTags:!0,defaultTag:"Common",excludeTags:[],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:SO,enumSuffix:PO,withDefaultValues:!0,extractEnums:!0,removeOperationPrefixEndingWith:"Controller_",infiniteQueries:!0};var xO={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"},AO={"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"};var tm={"Content-Type":"application/json",Accept:"application/json"},IO="data";var CO=o(e=>/^(?:[a-zA-Z_$][a-zA-Z0-9_$]*|[0-9]+)$/.test(e),"isValidPropertyName"),Fn=o(e=>e.replace(/^[^a-zA-Z_$]*/g,"").replace(/[^a-zA-Z0-9_$]+(\w)?/g,(t,r)=>(r==null?void 0:r.toUpperCase())??""),"invalidVariableNameCharactersToCamel");var ln=Symbol.for("@ts-pattern/matcher"),aq=Symbol.for("@ts-pattern/isVariadic"),_u="@ts-pattern/anonymous-select-key",rm=o(e=>!!(e&&typeof e=="object"),"r"),vu=o(e=>e&&!!e[ln],"i"),Qr=o((e,t,r)=>{if(vu(e)){let n=e[ln](),{matched:i,selections:s}=n.match(t);return i&&s&&Object.keys(s).forEach(a=>r(a,s[a])),i}if(rm(e)){if(!rm(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];vu(c)&&c[aq]?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)=>Qr(l,a[p],r))&&i.every((l,p)=>Qr(l,c[p],r))&&(s.length===0||Qr(s[0],u,r))}return e.length===t.length&&e.every((a,c)=>Qr(a,t[c],r))}return Reflect.ownKeys(e).every(n=>{let i=e[n];return(n in t||vu(s=i)&&s[ln]().matcherType==="optional")&&Qr(i,t[n],r);var s})}return Object.is(t,e)},"s"),zn=o(e=>{var t,r,n;return rm(e)?vu(e)?(t=(r=(n=e[ln]()).getSelectionKeys)==null?void 0:r.call(n))!=null?t:[]:Array.isArray(e)?ua(e,zn):ua(Object.values(e),zn):[]},"o"),ua=o((e,t)=>e.reduce((r,n)=>r.concat(t(n)),[]),"c");function fr(e){return Object.assign(e,{optional:o(()=>cq(e),"optional"),and:o(t=>Le(e,t),"and"),or:o(t=>uq(e,t),"or"),select:o(t=>t===void 0?TO(e):TO(t,e),"select")})}o(fr,"u");function cq(e){return fr({[ln]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return t===void 0?(zn(e).forEach(i=>n(i,void 0)),{matched:!0,selections:r}):{matched:Qr(e,t,n),selections:r}},"match"),getSelectionKeys:o(()=>zn(e),"getSelectionKeys"),matcherType:"optional"})})}o(cq,"h");function Le(...e){return fr({[ln]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return{matched:e.every(i=>Qr(i,t,n)),selections:r}},"match"),getSelectionKeys:o(()=>ua(e,zn),"getSelectionKeys"),matcherType:"and"})})}o(Le,"m");function uq(...e){return fr({[ln]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return ua(e,zn).forEach(i=>n(i,void 0)),{matched:e.some(i=>Qr(i,t,n)),selections:r}},"match"),getSelectionKeys:o(()=>ua(e,zn),"getSelectionKeys"),matcherType:"or"})})}o(uq,"d");function Pe(e){return{[ln]:()=>({match:o(t=>({matched:!!e(t)}),"match")})}}o(Pe,"p");function TO(...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 fr({[ln]:()=>({match:o(n=>{let i={[t??_u]:n};return{matched:r===void 0||Qr(r,n,(s,a)=>{i[s]=a}),selections:i}},"match"),getSelectionKeys:o(()=>[t??_u].concat(r===void 0?[]:zn(r)),"getSelectionKeys")})})}o(TO,"y");function Kr(e){return typeof e=="number"}o(Kr,"v");function Vn(e){return typeof e=="string"}o(Vn,"b");function Bn(e){return typeof e=="bigint"}o(Bn,"w");var I9=fr(Pe(function(e){return!0}));var Hn=o(e=>Object.assign(fr(e),{startsWith:o(t=>{return Hn(Le(e,(r=t,Pe(n=>Vn(n)&&n.startsWith(r)))));var r},"startsWith"),endsWith:o(t=>{return Hn(Le(e,(r=t,Pe(n=>Vn(n)&&n.endsWith(r)))));var r},"endsWith"),minLength:o(t=>Hn(Le(e,(r=>Pe(n=>Vn(n)&&n.length>=r))(t))),"minLength"),length:o(t=>Hn(Le(e,(r=>Pe(n=>Vn(n)&&n.length===r))(t))),"length"),maxLength:o(t=>Hn(Le(e,(r=>Pe(n=>Vn(n)&&n.length<=r))(t))),"maxLength"),includes:o(t=>{return Hn(Le(e,(r=t,Pe(n=>Vn(n)&&n.includes(r)))));var r},"includes"),regex:o(t=>{return Hn(Le(e,(r=t,Pe(n=>Vn(n)&&!!n.match(r)))));var r},"regex")}),"j"),C9=Hn(Pe(Vn)),Yr=o(e=>Object.assign(fr(e),{between:o((t,r)=>Yr(Le(e,((n,i)=>Pe(s=>Kr(s)&&n<=s&&i>=s))(t,r))),"between"),lt:o(t=>Yr(Le(e,(r=>Pe(n=>Kr(n)&&n<r))(t))),"lt"),gt:o(t=>Yr(Le(e,(r=>Pe(n=>Kr(n)&&n>r))(t))),"gt"),lte:o(t=>Yr(Le(e,(r=>Pe(n=>Kr(n)&&n<=r))(t))),"lte"),gte:o(t=>Yr(Le(e,(r=>Pe(n=>Kr(n)&&n>=r))(t))),"gte"),int:o(()=>Yr(Le(e,Pe(t=>Kr(t)&&Number.isInteger(t)))),"int"),finite:o(()=>Yr(Le(e,Pe(t=>Kr(t)&&Number.isFinite(t)))),"finite"),positive:o(()=>Yr(Le(e,Pe(t=>Kr(t)&&t>0))),"positive"),negative:o(()=>Yr(Le(e,Pe(t=>Kr(t)&&t<0))),"negative")}),"x"),T9=Yr(Pe(Kr)),Un=o(e=>Object.assign(fr(e),{between:o((t,r)=>Un(Le(e,((n,i)=>Pe(s=>Bn(s)&&n<=s&&i>=s))(t,r))),"between"),lt:o(t=>Un(Le(e,(r=>Pe(n=>Bn(n)&&n<r))(t))),"lt"),gt:o(t=>Un(Le(e,(r=>Pe(n=>Bn(n)&&n>r))(t))),"gt"),lte:o(t=>Un(Le(e,(r=>Pe(n=>Bn(n)&&n<=r))(t))),"lte"),gte:o(t=>Un(Le(e,(r=>Pe(n=>Bn(n)&&n>=r))(t))),"gte"),positive:o(()=>Un(Le(e,Pe(t=>Bn(t)&&t>0))),"positive"),negative:o(()=>Un(Le(e,Pe(t=>Bn(t)&&t<0))),"negative")}),"A"),j9=Un(Pe(Bn)),R9=fr(Pe(function(e){return typeof e=="boolean"})),N9=fr(Pe(function(e){return typeof e=="symbol"})),k9=fr(Pe(function(e){return e==null})),M9=fr(Pe(function(e){return e!=null}));var sm=class sm 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(sm,"W");var nm=sm,im={matched:!1,value:void 0};function Ot(e){return new om(e,im)}o(Ot,"z");var ca=class ca{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=>Qr(l,this.input,c))||i&&!i(this.input)?im:{matched:!0,value:r(s?_u in a?a[_u]:a:this.input,this.input)};return new ca(this.input,u)}when(t,r){if(this.state.matched)return this;let n=!!t(this.input);return new ca(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 nm(this.input)}run(){return this.exhaustive()}returnType(){return this}};o(ca,"I");var om=ca;var am=["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"];var cm=2,jO=["application/octet-stream","multipart/form-data","application/x-www-form-urlencoded","*/*"],RO=["query","header","path"],Gn=["get","put","post","delete","options","head","patch","trace"],NO=["string","number","integer","boolean"],la=["allOf","anyOf","oneOf"];function Zn(e,t){let r={};return Object.keys(e).forEach(n=>{t.includes(n)&&(r[n]=e[n])}),r}o(Zn,"pick");var Fe=o(e=>e.charAt(0).toUpperCase()+e.slice(1),"capitalize"),Wn=o(e=>e.charAt(0).toLowerCase()+e.slice(1),"decapitalize"),kO=o(e=>e.replace(/(-\w)/g,t=>t[1].toUpperCase()),"kebabToCamel"),lt=o(e=>e.replace(/(_\w)/g,t=>t[1].toUpperCase()),"snakeToCamel"),MO=o(e=>e.replace(/[\W_]+(\w)?/g,(t,r)=>(r==null?void 0:r.toUpperCase())??""),"nonWordCharactersToCamel"),um=o((e,t="")=>e.endsWith(t)?e:`${e}${t}`,"suffixIfNeeded"),qO=o((e,t)=>e.replace(new RegExp(`${t}$`),""),"removeSuffix"),lq=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"),lm=o(e=>{let t=e.map(Fe).map(DO).map(r=>fq(r)).flat();return lq(t)},"getMostCommonAdjacentCombinationSplit"),DO=o(e=>e.split(/(?<![A-Z])(?=[A-Z])/).filter(Boolean),"splitByUppercase"),LO=o(e=>DO(e).join(" "),"camelToSpaceSeparated"),fq=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"),FO=o((e,t)=>{let r=t.replace(/es$|s$/g,""),n=new RegExp(`(${Wn(r)}|${Fe(r)})[a-z]*(?=$|[A-Z])`,"g");return e.replace(n,"")},"removeWord");function Kn(e){return MO(e)}o(Kn,"formatTag");function Mi(e,t){var n;let r=(n=e.tags)==null?void 0:n[0];return Kn(r??t.defaultTag)}o(Mi,"getOperationTag");function VO(e,t){let r={};for(let n in e.paths){let i=e.paths[n],s=Zn(i,Gn);for(let a in s){let c=s[a];if(!c||c.deprecated&&!t.withDeprecatedEndpoints)continue;let u=t.splitByTags?Mi(c,t):t.defaultTag;r[u]||(r[u]=[]),r[u].push(c)}}return r}o(VO,"getOperationsByTag");var HO=o(e=>`#/components/schemas/${e}`,"getSchemaRef"),qi=o(e=>e[1]==="/"?e:"#/"+e.slice(1),"autocorrectRef"),Zo=o(e=>qi(e).split("/").at(-1),"getSchemaNameByRef");function Oe(e){return e!=null&&Object.prototype.hasOwnProperty.call(e,"$ref")}o(Oe,"isReferenceObject");function dm(e){let t=pq(e).normalize("NFKD").trim().replace(/\s+/g,"_").replace(/--+/g,"-").replace(/-+/g,"_").replace(/[^\w-]+/g,"_");return lt(t)}o(dm,"normalizeString");function UO(e){return/^[a-zA-Z]\w*$/.test(e)?e:`"${e}"`}o(UO,"wrapWithQuotesIfNeeded");function zO(e){return typeof e=="string"&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}o(zO,"unwrapQuotesIfNeeded");function pq(e){let t=Number(e[0]);return typeof t=="number"&&!Number.isNaN(t)?"_"+e:e}o(pq,"prefixStringStartingWithNumberIfNeeded");function hm(e){let t=e.replaceAll("_","#");return lt(t.replaceAll("-","_")).replaceAll("#","_")}o(hm,"pathParamToVariableName");var Di=o(e=>NO.includes(e),"isPrimitiveType");function GO(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(GO,"escapeControlCharacters");function Jr(e){return e.includes("application/")&&e.includes("json")||jO.includes(e)||e.includes("text/")}o(Jr,"isParamMediaTypeAllowed");function Su(e){return e>=200&&e<300}o(Su,"isMainResponseStatus");function Pu(e){return!(e>=200&&e<300)}o(Pu,"isErrorStatus");function Ou(e){return e==="application/json"}o(Ou,"isMediaTypeAllowed");function fm({path:e,method:t,operation:r,options:n,tag:i,keepOperationTag:s,keepOperationPrefix:a}){let c=`${t}${hq(e)}`,u=r.operationId?Fn(r.operationId):c;if(n.removeOperationPrefixEndingWith&&a)u=u.split(n.removeOperationPrefixEndingWith).map((p,f)=>f===0?p:Fe(p)).join("");else if(n.removeOperationPrefixEndingWith&&!a){let l=new RegExp(`^.*${n.removeOperationPrefixEndingWith}`);u=u.replace(l,"")}if(n.tsNamespaces&&!s){let l=FO(u,i);am.includes(l)||(u=l)}return am.includes(u)?c:u}o(fm,"getOperationName");function fa({operationsByTag:e,...t}){let{operation:r,options:n}=t,i=n.splitByTags?Mi(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(fa,"getUniqueOperationName");function ZO(e,t,r){let n=[];for(let i in e.paths){let s=e.paths[i],a=Zn(s,Gn);for(let c in a){let u=a[c];if(!u||u.deprecated&&!r.withDeprecatedEndpoints)continue;let l=fa({path:i,method:c,operation:u,operationsByTag:t,options:r});n.push(l)}}return n}o(ZO,"getUniqueOperationNamesWithoutSplitByTags");var BO=/({\w+})/g,dq=/[^\w\-]+/g;function hq(e){e=Fe(kO(e.replaceAll("/","-")).replaceAll("-",""));let t=[...e.matchAll(BO)];if(t.length>0){let r=t.sort((n,i)=>n.index-i.index)[t.length-1][0];e=`${e.replace(BO,"")}By${Fe(r.slice(1,-1))}`}return e.replace(dq,"_")}o(hq,"pathToVariableName");var pm=/{(\b\w+(?:-\w+)*\b)}/g;function WO(e){let t=e.match(pm);return t===null?e.replaceAll(pm,":$1"):(t.forEach(r=>{let n=hm(r.replaceAll(pm,":$1"));e=e.replaceAll(r,n)}),e)}o(WO,"replaceHyphenatedPath");function zt(e){return!Oe(e)}o(zt,"isSchemaObject");function Eu(e){return e.type==="array"}o(Eu,"isArraySchemaObject");function KO(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(mq(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(Oe(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(KO,"inferRequiredSchema");var mq=o(e=>!Oe(e)&&!!e.required&&!e.type&&!e.properties&&!(e!=null&&e.allOf)&&!(e!=null&&e.anyOf)&&!e.oneOf,"isBrokenAllOfItem");var pa="AppRestClient",$u={query:"AppQueryOptions",infiniteQuery:"AppInfiniteQueryOptions",mutation:"AppMutationOptions"},mm="src/data",gm="@/data",YO="@/util/rest/clients/app-rest-client",QO="@/types/react-query";var wu={reactQueryTypes:{fileName:"react-query.types",extension:"ts"},restClient:{fileName:"rest-client",extension:"ts"},restInterceptor:{fileName:"rest-interceptor",extension:"ts"}},xu={fileName:"app-rest-client",extension:"ts"};var Gt=o((...e)=>[...new Set(e.flat())],"getUniqueArray");var Xr=o((e,t)=>um(Fe(dm(e)),t),"getZodSchemaName"),ym=o((e,t,r)=>um(Fe(dm(e)),`${t}${r}`),"getEnumZodSchemaName"),Dt=o(e=>!e.startsWith("z."),"isNamedZodSchema"),JO=o(e=>e.startsWith(gu),"isEnumZodSchema"),Li=o((e,t,r)=>t?e:`${r}_${e}`,"getZodSchemaOperationName"),Au=o(e=>lt(`${e}_${OO}`),"getBodyZodSchemaName"),XO=o((e,t)=>lt(`${e}_${t}${EO}`),"getParamZodSchemaName"),gq=o(e=>lt(`${e}${$O}`),"getMainResponseZodSchemaName"),yq=o((e,t)=>lt(`${e}_${t}_${wO}`),"getErrorResponseZodSchemaName");function Iu({statusCode:e,operationName:t,isUniqueOperationName:r,tag:n}){let i=Number(e),s=Li(t,r,n);return!Su(i)&&e!=="default"&&Pu(i)?yq(s,e):gq(s)}o(Iu,"getResponseZodSchemaName");function da(e){return["minimum","exclusiveMinimum","maximum","exclusiveMaximum","minItems","minLength","minProperties","maxItems","maxLength","maxProperties","default","example"].filter(n=>e[n]).reduce((n,i)=>[...n,`${Fe(LO(i))}: \`${e[i]}\``],[])}o(da,"getSchemaDescriptions");function It(e,t){if(!e)return;let{data:r,onSchema:n}=t;if(Oe(e)&&n({type:"reference",schema:e,data:r})===!0)return;let i=e;if(la.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&&It(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&&It(a,t);if(i.additionalProperties&&typeof i.additionalProperties=="object"){if(n({type:"additionalProperties",parentSchema:e,schema:i.additionalProperties,data:r})===!0)return;It(i.additionalProperties,t)}if(i.type==="array"){let s=e.items;if(n({type:"array",parentSchema:e,schema:s,data:r})===!0)return;It(s,t)}}o(It,"iterateSchema");var ha=o((e,t)=>qO(e,t.schemaSuffix),"getZodSchemaInferedTypeName"),eE=o((e,t)=>Dt(t)?`${e.options.tsNamespaces?`${et({type:"models",tag:e.getTagByZodSchemaName(t),options:e.options})}.`:""}${t}`:t,"getImportedZodSchemaName"),Fi=o((e,t,r)=>{if(!Dt(t))return t===aa?"void":t;let n=e.getTagByZodSchemaName(t);return`${e.options.tsNamespaces&&n!==r?`${et({type:"models",tag:n,options:e.options})}.`:""}${ha(t,e.options)}`},"getImportedZodSchemaInferedTypeName");function tE(e){var t;return e.isEnum?"enum":((t=e.schemaObj)==null?void 0:t.type)??"object"}o(tE,"getZodSchemaType");function rE(e){if(e.schemaObj)return[e.schemaObj.description,...da(e.schemaObj).join(". ")].filter(Boolean)}o(rE,"getZodSchemaDescription");function nE(e,t,r){var n;if(Oe(t)){let i=e.getZodSchemaNameByRef(t.$ref);return i?Fi(e,i,r):void 0}if(Eu(t)){if(!Oe(t.items))return`${((n=t.items)==null?void 0:n.type)??"unknown"}[]`;let i=e.getZodSchemaNameByRef(t.items.$ref);return i?`${Fi(e,i,r)}[]`:void 0}if(la.some(i=>i in t&&t[i])){let i=t.allOf??t.anyOf??t.oneOf??[];if(i.length>0)return nE(e,i[0],r)}return t.type}o(nE,"getType");function iE(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,...da(p)].filter(Boolean),d=u.join(".");s[d]&&"type"in c.schema&&c.schema.type==="object"||(delete s[d],s[d]={type:nE(e,c.schema,r)??"unknown",description:f.join(". ")})}return It(c.schema,{data:{pathSegments:[...u]},onSchema:a}),!0},"onSchema");return"allOf"in t.schemaObj&&t.schemaObj.allOf&&t.schemaObj.allOf.forEach(c=>{if(Oe(c)){let u=e.resolveObject(c);It(u,{data:{pathSegments:[]},onSchema:a})}}),It(t.schemaObj,{data:{pathSegments:[]},onSchema:a}),s}o(iE,"getZodSchemaPropertyDescriptions");function Yn({resolver:e,tag:t,zodSchemas:r=[],zodSchemasAsTypes:n=[]}){let i="models",s=o(u=>e.getTagByZodSchemaName(u),"getTag"),a=bm({type:i,tag:t,entities:r,getTag:s,getEntityName:o(u=>u,"getEntityName"),options:e.options}),c=bm({type:i,tag:t,entities:n,getTag:s,getEntityName:o(u=>ha(u,e.options),"getEntityName"),options:e.options});return bq(e.options,a,c)}o(Yn,"getModelsImports");function oE({tag:e,endpoints:t,options:r}){return bm({type:"endpoints",tag:e,entities:t,getTag:o(n=>ya(n,r),"getTag"),getEntityName:ga,options:r})}o(oE,"getEndpointsImports");function sE({tags:e,entityName:t,getAliasEntityName:r,options:n}){let i=new Map;return e.forEach(s=>{let a=`${t}${r?` as ${r(s)}`:""}`;i.has(s)?n.tsNamespaces||i.get(s).bindings.push(a):i.set(s,{bindings:[n.tsNamespaces?et({type:"acl",tag:s,options:n}):a],from:`${ma(n)}${Cu({type:"acl",tag:s,includeTagDir:!0,options:n})}`})}),Array.from(i.values())}o(sE,"getAclImports");function ma(e){let t=gm;return e.importPath==="relative"?t="../":e.importPath==="absolute"?t=e.output:new RegExp(`${mm}`,"g").test(e.output)&&(t=e.output.replace(new RegExp(`.*${mm}`,"g"),gm)),`${t}/`.replace(/\/\//g,"/")}o(ma,"getImportPath");function bm({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?et({type:e,tag:u,options:s}):i(c)],from:`${l?"./":ma(s)}${Cu({type:e,tag:u,includeTagDir:!l,options:s})}`})}}),Array.from(a.values())}o(bm,"getImports");function bq(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:Gt(n.bindings)}))}o(bq,"mergeImports");function Tu({fileName:e,extension:t}){return`${e}.${t}`}o(Tu,"getFileNameWithExtension");function aE({type:e,tag:t,options:r,includeTagDir:n=!0}){let i=r.configs[e].outputFileNameSuffix;return t?`${n?`${Wn(t)}/`:""}${Wn(t)}.${i}`:i}o(aE,"getTagFileNameWithoutExtension");function Cu(...e){return aE(...e)}o(Cu,"getTagImportPath");function ju(...e){return`${aE(...e)}.ts`}o(ju,"getTagFileName");var et=o(({type:e,tag:t,options:r})=>`${Fe(t)}${r.configs[e].namespaceSuffix}`,"getNamespaceName");function cE(e){return e.standalone?`${ma(e)}${xu.fileName}`:YO}o(cE,"getAppRestClientImportPath");function uE(e){return e.standalone?`${ma(e)}${wu.reactQueryTypes.fileName}`:QO}o(uE,"getQueryTypesImportPath");function lE(e){return Ot(e).with("string",()=>"string").with("number",()=>"number").with("integer",()=>"number").with("boolean",()=>"boolean").exhaustive()}o(lE,"primitiveTypeToTsType");var Zt={query:"useQuery",infiniteQuery:"useInfiniteQuery",mutation:"useMutation",queryClient:"useQueryClient"},fE={bindings:[Zt.query,Zt.infiniteQuery,Zt.mutation,Zt.queryClient],from:"@tanstack/react-query"},Vi={pageParamName:"page"},Ru={pageParamName:"page",totalItemsName:"totalItems",limitParamName:"limit"};var ga=o(e=>Wn(lt(e.operationName)),"getEndpointName");function pE(e,t){return`${t.tsNamespaces?`${et({type:"endpoints",tag:ya(e,t),options:t})}.`:""}${ga(e)}`}o(pE,"getImportedEndpointName");var dE=o(e=>e.path.replace(/:([a-zA-Z0-9_]+)/g,"${$1}"),"getEndpointPath");function ya(e,t){var n;let r=t.splitByTags?(n=e.tags)==null?void 0:n[0]:t.defaultTag;return Kn(r??t.defaultTag)}o(ya,"getEndpointTag");function vm(e,t,r){return t.parameters.map(n=>{var s,a,c,u;let i="string";if(Dt(n.zodSchema))i=Fi(e,n.zodSchema);else if((s=n.parameterObject)!=null&&s.schema&&zt(n.parameterObject.schema)){let l=(c=(a=n.parameterObject)==null?void 0:a.schema)==null?void 0:c.type;l&&Di(l)&&(i=lE(l))}return{name:Fn(n.name),type:i,paramType:n.type,required:((u=n.parameterObject)==null?void 0:u.required)??!0,parameterObject:n.parameterObject,bodyObject:n.bodyObject}}).sort((n,i)=>{if(n.required===i.required){let s=["Path","Body","Query","Header"];return s.indexOf(n.paramType)-s.indexOf(i.paramType)}return n.required?-1:1}).filter(n=>r!=="removePageParam"||n.name!==Vi.pageParamName).map(n=>({...n,name:r==="replacePageParam"&&n.name===Vi.pageParamName?"pageParam":n.name}))}o(vm,"mapEndpointParamsToFunctionParams");function hE(e){let t=e.parameters.filter(i=>i.type==="Query").map(i=>{let s=CO(i.name)?i.name:`"${i.name}"`,a=Fn(i.name);return{...i,name:s,value:a}}),r={};return e.requestFormat!==tm["Content-Type"]&&(r["Content-Type"]=`'${e.requestFormat}'`),e.responseFormat&&e.responseFormat!==tm.Accept&&(r.Accept=`'${e.responseFormat}'`),e.parameters.filter(i=>i.type==="Header").forEach(i=>{r[i.name]=Fn(i.name)}),{...t.length>0?{params:t}:{},...Object.keys(r).length?{headers:r}:{}}}o(hE,"getEndpointConfig");function ba(e){return{type:"invalid-schema",message:e}}o(ba,"getInvalidSchemaError");function mE(e){return{type:"invalid-operation-id",message:`Operation ${e}`}}o(mE,"getInvalidOperationIdError");function gE(e,t){return{type:"missing-path-parameter",message:`Path ${t} is missing [${e.map(({name:r})=>r).join(", ")}]`}}o(gE,"getMissingPathParameterError");function yE(e){return{type:"not-allowed-inline-enum",message:e}}o(yE,"getNotAllowedInlineEnumError");function bE(e){return{type:"not-allowed-circular-schema",message:e}}o(bE,"getNotAllowedCircularSchemaError");function vE(e,t,r){return{type:"missing-acl-condition-property",message:`Condition property ${e} is not found in parameters or body in operation ${Pm(t,r)}`}}o(vE,"getMissingAclConditionPropertyError");function Sm(e,t,r){return{type:"missing-status-code",message:`Missing HTTP status code ${_m(e)} in operation ${Pm(t,r)}`}}o(Sm,"getMissingStatusCodeError");function _E(e,t,r){return{type:"invalid-status-code",message:`Operation ${Pm(t,r)} expected HTTP status code ${_m(e.expected)} but received ${_m(e.received)}`}}o(_E,"getInvalidStatusCodeError");function Pm(e,t){return e.operationId??`${t.method} ${t.path}`}o(Pm,"getOperationDescriptor");function _m(e){return`${e} (${xO[e]})`}o(_m,"getStatusCodeDescription");function SE(e){return e.reduce((t,r)=>({...t,[r.type]:[...t[r.type]??[],r.message]}),{})}o(SE,"groupByType");function en({schema:e,meta:t,options:r}){let n=[];Ot(e.type).with("string",()=>n.push(Sq(e))).with("number","integer",()=>n.push(Oq(e))).with("array",()=>n.push(Eq(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(vq({schema:e,meta:t,options:r}),r.withDefaultValues!==!1?_q(e):[]).filter(Boolean).join(".");return i?`.${i}`:""}o(en,"getZodChain");function vq({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(vq,"getZodChainablePresence");function _q(e){return e.default!==void 0?`default(${Ot(e.type).with("number","integer",()=>zO(e.default)).otherwise(()=>JSON.stringify(e.default))})`:""}o(_q,"getZodChainableDefault");function Sq(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(${Pq(e.pattern)})`),e.format){let r=Ot(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(Sq,"getZodChainableStringValidations");function Pq(e){return e.startsWith("/")&&e.endsWith("/")&&(e=e.slice(1,-1)),e=GO(e),`/${e}/`}o(Pq,"formatPatternIfNeeded");function Oq(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(Oq,"getZodChainableNumberValidations");function Eq(e){let t=[];return e.minItems&&t.push(`min(${e.minItems})`),e.maxItems&&t.push(`max(${e.maxItems})`),t.join(".")}o(Eq,"getZodChainableArrayValidations");var Bi=o(e=>e.reduce((t,r)=>t+r,0),"sum");function ft(e,t){if(!t)return e;if(Oe(t))return e+2;if(Array.isArray(t.type))return t.type.length===1?Wt("oneOf")+ft(e,{...t,type:t.type[0]}):e+Wt("oneOf")+Bi(t.type.map(r=>ft(0,{...t,type:r})));if(t.oneOf)return t.oneOf.length===1?Wt("oneOf")+ft(e,t.oneOf[0]):e+Wt("oneOf")+Bi(t.oneOf.map(r=>ft(0,r)));if(t.anyOf)return t.anyOf.length===1?Wt("anyOf")+ft(e,t.anyOf[0]):e+Wt("anyOf")+Bi(t.anyOf.map(r=>ft(0,r)));if(t.allOf)return t.allOf.length===1?Wt("allOf")+ft(e,t.allOf[0]):e+Wt("allOf")+Bi(t.allOf.map(r=>ft(0,r)));if(!t.type)return e;if(Di(t.type))return t.enum?e+PE(t)+Wt("enum")+Bi(t.enum.map(r=>ft(0,r))):e+PE(t);if(t.type==="array")return t.items?Wt("array")+ft(e,t.items):Wt("array")+ft(e);if(t.type==="object"||t.properties||t.additionalProperties){if(t.properties){let r=Object.values(t.properties);e+=Wt("object")+Bi(r.map(n=>ft(0,n)))}else e+=Wt("empty-object");t.additionalProperties&&(typeof t.additionalProperties=="object"?e+=ft(0,t.additionalProperties):e+=ft(1))}return e}o(ft,"getOpenAPISchemaComplexity");function PE(e){return Ot(e.type).with("string","number","integer","boolean",()=>1).otherwise(()=>0)}o(PE,"complexityByType");function Wt(e){return Ot(e).with("oneOf",()=>2).with("anyOf",()=>3).with("allOf",()=>2).with("enum","array","empty-object",()=>1).with("object",()=>2).otherwise(()=>0)}o(Wt,"complexityByComposite");var Om=class Om{constructor(t,r,n={referencedBy:[]},i){this.schema=t;this.resolver=r;Oe(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?`${et({type:"models",tag:i,options:r})}.${n}`:n}get complexity(){return ft(0,this.schema)}assign(t){return this.code=t,this}inherit(t){return t&&t.children.push(this),this}};o(Om,"ZodSchema");var va=Om;function We({schema:e,resolver:t,meta:r,tag:n}){var y;let i=new va(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(Oe(e))return $q({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});let c=xq({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(c)return c;let u=wq({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(u)return u;let l=Aq({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(l)return l;let p=Iq({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(p)return p;let f=Cq({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(f)return f;let d=t.options.allReadonly?".readonly()":"";if(Eu(e))return e.items?i.assign(`z.array(${We({...a,schema:e.items}).getCodeString(n,t.options)}${en({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),E="{}";e.properties&&(E="{ "+Object.entries(e.properties).map(([ae,J])=>{var k;let Ve={...s,isRequired:g?!0:b?(k=e.required)==null?void 0:k.includes(ae):t.options.withImplicitRequiredProps,name:ae,isParentPartial:g},$e=J;if(Oe(J)&&t&&($e=t.getSchemaByRef(J.$ref),!$e))throw new Error(`Schema ${J.$ref} not found`);let X=We({...a,schema:J,meta:Ve}).getCodeString(n,t.options)+en({schema:$e,meta:Ve,options:t.options});return[ae,X]}).map(([ae,J])=>`${UO(ae)}: ${J}`).join(", ")+" }");let w="";e.additionalProperties&&(w=`.catchall(${typeof e.additionalProperties=="object"&&Object.keys(e.additionalProperties).length>0?We({...a,schema:e.additionalProperties}).getCodeString(n,t.options)+en({schema:e.additionalProperties,meta:{...s,isRequired:!0},options:t.options}):"z.any()"})`);let T=g?".partial()":"",I=t.options.strictObjects?".strict()":"";return i.assign(`z.object(${E})${T}${I}${w}${d}`)}if(h==="any")return i.assign("z.any()");if(!h)return i.assign("z.unknown()");throw new Error(`Unsupported schema type: ${h}`)}o(We,"getZodSchema");function $q({schema:e,zodSchema:t,resolver:r,meta:n,tag:i}){if(!Oe(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=We({schema:u,resolver:r,meta:n,tag:i}).getCodeString(i,r.options)}return r.getCodeByZodSchemaName(a)||r.setZodSchema(a,c,i),t}o($q,"getReferenceZodSchema");function wq({schema:e,zodSchema:t,resolver:r,meta:n,tag:i}){var a;if(!zt(e)||!e.oneOf)return;if(e.oneOf.length===1){let c=We({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=>zt(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=>We({schema:u,resolver:r,meta:n,tag:i}).getCodeString(i,r.options)).join(", ")}])
|