@povio/openapi-codegen-cli 1.2.7 → 1.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -69,7 +69,7 @@ Expecting `+Dt.join(", ")+", got '"+(this.terminals_[P]||P)+"'":cs="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(Y3(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:Ci,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 Hd.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 Hd.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=Ci.RESERVED_WORDS={},r=0,n=e.length;r<n;r++)t[e[r]]=!0})();Ci.isValidJavaScriptVariableName=function(e){return!Ci.RESERVED_WORDS[e]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(e)};function Y3(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(Y3,"strictLookup");Oc.default=Ci;XE.exports=Oc.default});var nP=h(($c,rP)=>{"use strict";$c.__esModule=!0;function ss(e){return e&&e.__esModule?e:{default:e}}o(ss,"_interopRequireDefault");var J3=iE(),X3=ss(J3),eq=Sd(),tq=ss(eq),Vd=yE(),Bd=_E(),rq=eP(),nq=ss(rq),iq=hc(),oq=ss(iq),sq=md(),aq=ss(sq),cq=X3.default.create;function tP(){var e=cq();return e.compile=function(t,r){return Bd.compile(t,r,e)},e.precompile=function(t,r){return Bd.precompile(t,r,e)},e.AST=tq.default,e.Compiler=Bd.Compiler,e.JavaScriptCompiler=nq.default,e.Parser=Vd.parser,e.parse=Vd.parse,e.parseWithoutProcessing=Vd.parseWithoutProcessing,e}o(tP,"create");var Ri=tP();Ri.create=tP;aq.default(Ri);Ri.Visitor=oq.default;Ri.default=Ri;$c.default=Ri;rP.exports=$c.default});var iP=h(xc=>{"use strict";xc.__esModule=!0;xc.print=fq;xc.PrintVisitor=ee;function uq(e){return e&&e.__esModule?e:{default:e}}o(uq,"_interopRequireDefault");var lq=hc(),pq=uq(lq);function fq(e){return new ee().accept(e)}o(fq,"print");function ee(){this.padding=0}o(ee,"PrintVisitor");ee.prototype=new pq.default;ee.prototype.pad=function(e){for(var t="",r=0,n=this.padding;r<n;r++)t+=" ";return t+=e+`
|
|
72
|
-
`,t};ee.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};ee.prototype.MustacheStatement=function(e){return this.pad("{{ "+this.SubExpression(e)+" }}")};ee.prototype.Decorator=function(e){return this.pad("{{ DIRECTIVE "+this.SubExpression(e)+" }}")};ee.prototype.BlockStatement=ee.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};ee.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+" }}")};ee.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+" }}")};ee.prototype.ContentStatement=function(e){return this.pad("CONTENT[ '"+e.value+"' ]")};ee.prototype.CommentStatement=function(e){return this.pad("{{! '"+e.value+"' }}")};ee.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};ee.prototype.PathExpression=function(e){var t=e.parts.join("/");return(e.data?"@":"")+"PATH:"+t};ee.prototype.StringLiteral=function(e){return'"'+e.value+'"'};ee.prototype.NumberLiteral=function(e){return"NUMBER{"+e.value+"}"};ee.prototype.BooleanLiteral=function(e){return"BOOLEAN{"+e.value+"}"};ee.prototype.UndefinedLiteral=function(){return"UNDEFINED"};ee.prototype.NullLiteral=function(){return"NULL"};ee.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(", ")+"}"};ee.prototype.HashPair=function(e){return e.key+"="+this.accept(e.value)}});var er=h((l9,aP)=>{var Ac=nP().default,sP=iP();Ac.PrintVisitor=sP.PrintVisitor;Ac.print=sP.print;aP.exports=Ac;function oP(e,t){var r=require("fs"),n=r.readFileSync(t,"utf8");e.exports=Ac.compile(n)}o(oP,"extension");typeof require<"u"&&require.extensions&&(require.extensions[".handlebars"]=oP,require.extensions[".hbs"]=oP)});var mM={};BP(mM,{getGenerateFilesData:()=>dM,getGenerateMetadata:()=>fM});module.exports=GP(mM);var Kd=Re($v());var xv="Schema",Av="Enum",wv="Body",Iv="Param",Tv="Response",Cv="ErrorResponse",Ao="z.void()",li="z.any()",ma="z.instanceof(Blob)",wo="z.enum",Rv="z.int()",Nv="z.number()",ha="z.string()",kv="z.email()",jv="z.url()",qv="z.uuid()",Mv="z.iso.datetime({ offset: true })",vr={bindings:["z"],from:"zod"};var vf={input:"http://localhost:4000/docs-json/",output:"output",splitByTags:!0,defaultTag:"Common",excludeTags:[],excludePathRegex:"",excludeRedundantZodSchemas:!0,tsNamespaces:!0,tsPath:"@/data",importPath:"ts",configs:{models:{outputFileNameSuffix:"models",namespaceSuffix:"Models"},endpoints:{outputFileNameSuffix:"api",namespaceSuffix:"Api"},queries:{outputFileNameSuffix:"queries",namespaceSuffix:"Queries"},acl:{outputFileNameSuffix:"acl",namespaceSuffix:"Acl"},configs:{outputFileNameSuffix:"configs",namespaceSuffix:"Configs"}},standalone:!1,baseUrl:"",schemaSuffix:xv,enumSuffix:Av,withDefaultValues:!0,extractEnums:!0,replaceOptionalWithNullish:!1,restClientImportPath:"@/util/rest/clients/app-rest-client",errorHandlingImportPath:"@/util/vendor/error-handling",removeOperationPrefixEndingWith:"Controller_",parseRequestParams:!0,queryTypesImportPath:"@/types/react-query",axiosRequestConfig:!1,mutationEffects:!0,infiniteQueries:!1,infiniteQueryParamNames:{page:"page"},infiniteQueryResponseParamNames:{page:"page",totalItems:"totalItems",limit:"limit"},acl:!0,checkAcl:!0,abilityContextImportPath:"@/data/acl/ability.context",abilityContextGenericAppAbilities:!1,builderConfigs:!1,filterParamName:"filter",dataResponseParamNames:["data","items"],dynamicInputsImportPath:"@povio/ui",dynamicColumnsImportPath:"@povio/ui"};var B=o(e=>e.charAt(0).toUpperCase()+e.slice(1),"capitalize"),br=o(e=>e.charAt(0).toLowerCase()+e.slice(1),"decapitalize"),Io=o(e=>e.replace(/(-\w)/g,t=>t[1].toUpperCase()),"kebabToCamel"),me=o(e=>e.replace(/(_\w)/g,t=>t[1].toUpperCase()),"snakeToCamel"),Dv=o(e=>e.replace(/[\W_]+(\w)?/g,(t,r)=>(r==null?void 0:r.toUpperCase())??""),"nonWordCharactersToCamel"),bf=o((e,t="")=>e.endsWith(t)?e:`${e}${t}`,"suffixIfNeeded"),Lv=o((e,t)=>e.replace(new RegExp(`${t}$`),""),"removeSuffix"),LN=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"),_f=o(e=>{let t=e.map(B).map(Fv).map(r=>FN(r)).flat();return LN(t)},"getMostCommonAdjacentCombinationSplit"),Fv=o(e=>e.split(/(?<![A-Z])(?=[A-Z])/).filter(Boolean),"splitByUppercase"),ga=o(e=>Fv(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"),Hv=o((e,t)=>{let r=t.replace(/es$|s$/g,""),n=new RegExp(`(${br(r)}|${B(r)})[a-z]*(?=$|[A-Z])`,"g");return e.replace(n,"")},"removeWord");var V=o(({type:e,tag:t,options:r})=>`${B(t)}${r.configs[e].namespaceSuffix}`,"getNamespaceName");var Gt=Re(ya());var Sa=o(e=>e.method===Gt.OpenAPIV3.HttpMethods.GET,"isGetEndpoint"),Ef=o((e,t)=>Sa(e)&&Object.values(t.infiniteQueryParamNames).every(r=>e.parameters.some(n=>n.name===r&&n.type==="Query")),"isPaginatedGetEndpoint"),Vv=o((e,t)=>e.method===Gt.OpenAPIV3.HttpMethods.GET&&!pi(e.pathSegments.at(-1))&&Ef(e,t),"isReadAllEndpoint"),Bv=o((e,t)=>e.method===Gt.OpenAPIV3.HttpMethods.GET&&Pf(e,t),"isReadEndpoint"),Gv=o((e,t)=>e.method===Gt.OpenAPIV3.HttpMethods.POST&&Wv(e,t),"isCreateEndpoint"),Uv=o((e,t)=>[Gt.OpenAPIV3.HttpMethods.PUT,Gt.OpenAPIV3.HttpMethods.PATCH].includes(e.method)&&Pf(e,t),"isUpdateEndpoint"),Zv=o((e,t)=>e.method===Gt.OpenAPIV3.HttpMethods.DELETE&&Pf(e,t),"isDeleteEndpoint"),zv=o((e,t)=>e.method===Gt.OpenAPIV3.HttpMethods.DELETE&&Wv(e,t),"isBulkDeleteEndpoint"),Kv=o(e=>e.split("/").filter(Boolean),"getPathSegments"),pi=o(e=>e==null?void 0:e.startsWith(":"),"isPathSegmentParam"),Qv=o((e,t)=>t.pathSegments.every((r,n)=>pi(r)&&pi(e.pathSegments[n])||r===e.pathSegments[n]),"hasMatchingPath"),Wv=o((e,t)=>e.pathSegments.length===t.pathSegments.length&&Qv(e,t),"hasMatchingPathWithoutTrailingParam"),Pf=o((e,t)=>e.pathSegments.length-1===t.pathSegments.length&&pi(e.pathSegments.at(-1))&&Qv(e,t),"hasMatchingPathWithTrailingParam");var kb=Re(ya());var on="application/json",Of={"Content-Type":on,Accept:on},va="data",$f="axios",Er="config",At="AxiosRequestConfig",ba={defaultImport:$f,bindings:[At],from:"axios"};var Yv=o(e=>/^(?:[a-zA-Z_$][a-zA-Z0-9_$]*|[0-9]+)$/.test(e),"isValidPropertyName"),wt=o(e=>e.replace(/^[^a-zA-Z_$]*/g,"").replace(/[^a-zA-Z0-9_$]+(\w)?/g,(t,r)=>(r==null?void 0:r.toUpperCase())??""),"invalidVariableNameCharactersToCamel");function L(e){return e!=null&&Object.prototype.hasOwnProperty.call(e,"$ref")}o(L,"isReferenceObject");function he(e){return!L(e)}o(he,"isSchemaObject");function _a(e){return e.type==="array"}o(_a,"isArraySchemaObject");function Jv(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(BN(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(L(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(Jv,"inferRequiredSchema");var BN=o(e=>!L(e)&&!!e.required&&!e.type&&!e.properties&&!(e!=null&&e.allOf)&&!(e!=null&&e.anyOf)&&!e.oneOf,"isBrokenAllOfItem");var Ut=Symbol.for("@ts-pattern/matcher"),GN=Symbol.for("@ts-pattern/isVariadic"),Pa="@ts-pattern/anonymous-select-key",xf=o(e=>!!(e&&typeof e=="object"),"r"),Ea=o(e=>e&&!!e[Ut],"i"),Ct=o((e,t,r)=>{if(Ea(e)){let n=e[Ut](),{matched:i,selections:s}=n.match(t);return i&&s&&Object.keys(s).forEach(a=>r(a,s[a])),i}if(xf(e)){if(!xf(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];Ea(c)&&c[GN]?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)=>Ct(l,a[f],r))&&i.every((l,f)=>Ct(l,c[f],r))&&(s.length===0||Ct(s[0],u,r))}return e.length===t.length&&e.every((a,c)=>Ct(a,t[c],r))}return Reflect.ownKeys(e).every(n=>{let i=e[n];return(n in t||Ea(s=i)&&s[Ut]().matcherType==="optional")&&Ct(i,t[n],r);var s})}return Object.is(t,e)},"s"),Ar=o(e=>{var t,r,n;return xf(e)?Ea(e)?(t=(r=(n=e[Ut]()).getSelectionKeys)==null?void 0:r.call(n))!=null?t:[]:Array.isArray(e)?Co(e,Ar):Co(Object.values(e),Ar):[]},"o"),Co=o((e,t)=>e.reduce((r,n)=>r.concat(t(n)),[]),"c");function Je(e){return Object.assign(e,{optional:o(()=>UN(e),"optional"),and:o(t=>W(e,t),"and"),or:o(t=>ZN(e,t),"or"),select:o(t=>t===void 0?Xv(e):Xv(t,e),"select")})}o(Je,"u");function UN(e){return Je({[Ut]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return t===void 0?(Ar(e).forEach(i=>n(i,void 0)),{matched:!0,selections:r}):{matched:Ct(e,t,n),selections:r}},"match"),getSelectionKeys:o(()=>Ar(e),"getSelectionKeys"),matcherType:"optional"})})}o(UN,"h");function W(...e){return Je({[Ut]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return{matched:e.every(i=>Ct(i,t,n)),selections:r}},"match"),getSelectionKeys:o(()=>Co(e,Ar),"getSelectionKeys"),matcherType:"and"})})}o(W,"m");function ZN(...e){return Je({[Ut]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return Co(e,Ar).forEach(i=>n(i,void 0)),{matched:e.some(i=>Ct(i,t,n)),selections:r}},"match"),getSelectionKeys:o(()=>Co(e,Ar),"getSelectionKeys"),matcherType:"or"})})}o(ZN,"d");function H(e){return{[Ut]:()=>({match:o(t=>({matched:!!e(t)}),"match")})}}o(H,"p");function Xv(...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 Je({[Ut]:()=>({match:o(n=>{let i={[t??Pa]:n};return{matched:r===void 0||Ct(r,n,(s,a)=>{i[s]=a}),selections:i}},"match"),getSelectionKeys:o(()=>[t??Pa].concat(r===void 0?[]:Ar(r)),"getSelectionKeys")})})}o(Xv,"y");function It(e){return typeof e=="number"}o(It,"v");function Pr(e){return typeof e=="string"}o(Pr,"b");function Or(e){return typeof e=="bigint"}o(Or,"w");var V5=Je(H(function(e){return!0}));var $r=o(e=>Object.assign(Je(e),{startsWith:o(t=>{return $r(W(e,(r=t,H(n=>Pr(n)&&n.startsWith(r)))));var r},"startsWith"),endsWith:o(t=>{return $r(W(e,(r=t,H(n=>Pr(n)&&n.endsWith(r)))));var r},"endsWith"),minLength:o(t=>$r(W(e,(r=>H(n=>Pr(n)&&n.length>=r))(t))),"minLength"),length:o(t=>$r(W(e,(r=>H(n=>Pr(n)&&n.length===r))(t))),"length"),maxLength:o(t=>$r(W(e,(r=>H(n=>Pr(n)&&n.length<=r))(t))),"maxLength"),includes:o(t=>{return $r(W(e,(r=t,H(n=>Pr(n)&&n.includes(r)))));var r},"includes"),regex:o(t=>{return $r(W(e,(r=t,H(n=>Pr(n)&&!!n.match(r)))));var r},"regex")}),"j"),B5=$r(H(Pr)),Tt=o(e=>Object.assign(Je(e),{between:o((t,r)=>Tt(W(e,((n,i)=>H(s=>It(s)&&n<=s&&i>=s))(t,r))),"between"),lt:o(t=>Tt(W(e,(r=>H(n=>It(n)&&n<r))(t))),"lt"),gt:o(t=>Tt(W(e,(r=>H(n=>It(n)&&n>r))(t))),"gt"),lte:o(t=>Tt(W(e,(r=>H(n=>It(n)&&n<=r))(t))),"lte"),gte:o(t=>Tt(W(e,(r=>H(n=>It(n)&&n>=r))(t))),"gte"),int:o(()=>Tt(W(e,H(t=>It(t)&&Number.isInteger(t)))),"int"),finite:o(()=>Tt(W(e,H(t=>It(t)&&Number.isFinite(t)))),"finite"),positive:o(()=>Tt(W(e,H(t=>It(t)&&t>0))),"positive"),negative:o(()=>Tt(W(e,H(t=>It(t)&&t<0))),"negative")}),"x"),G5=Tt(H(It)),xr=o(e=>Object.assign(Je(e),{between:o((t,r)=>xr(W(e,((n,i)=>H(s=>Or(s)&&n<=s&&i>=s))(t,r))),"between"),lt:o(t=>xr(W(e,(r=>H(n=>Or(n)&&n<r))(t))),"lt"),gt:o(t=>xr(W(e,(r=>H(n=>Or(n)&&n>r))(t))),"gt"),lte:o(t=>xr(W(e,(r=>H(n=>Or(n)&&n<=r))(t))),"lte"),gte:o(t=>xr(W(e,(r=>H(n=>Or(n)&&n>=r))(t))),"gte"),positive:o(()=>xr(W(e,H(t=>Or(t)&&t>0))),"positive"),negative:o(()=>xr(W(e,H(t=>Or(t)&&t<0))),"negative")}),"A"),U5=xr(H(Or)),Z5=Je(H(function(e){return typeof e=="boolean"})),z5=Je(H(function(e){return typeof e=="symbol"})),K5=Je(H(function(e){return e==null})),Q5=Je(H(function(e){return e!=null}));var Tf=class Tf 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(Tf,"W");var Af=Tf,wf={matched:!1,value:void 0};function $e(e){return new If(e,wf)}o($e,"z");var To=class To{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=>Ct(l,this.input,c))||i&&!i(this.input)?wf:{matched:!0,value:r(s?Pa in a?a[Pa]:a:this.input,this.input)};return new To(this.input,u)}when(t,r){if(this.state.matched)return this;let n=!!t(this.input);return new To(this.input,n?{matched:!0,value:r(this.input,this.input)}:wf)}otherwise(t){return this.state.matched?this.state.value:t(this.input)}exhaustive(){if(this.state.matched)return this.state.value;throw new Af(this.input)}run(){return this.exhaustive()}returnType(){return this}};o(To,"I");var If=To;var Zt=Re(ya()),Cf=2,eb=["application/octet-stream","multipart/form-data","application/x-www-form-urlencoded","*/*"],tb=["query","header","path"],sn=[Zt.OpenAPIV3.HttpMethods.GET,Zt.OpenAPIV3.HttpMethods.PUT,Zt.OpenAPIV3.HttpMethods.POST,Zt.OpenAPIV3.HttpMethods.DELETE,Zt.OpenAPIV3.HttpMethods.OPTIONS,Zt.OpenAPIV3.HttpMethods.HEAD,Zt.OpenAPIV3.HttpMethods.PATCH,Zt.OpenAPIV3.HttpMethods.TRACE],rb=["string","number","integer","boolean"],fi=["allOf","anyOf","oneOf"];var ib=o(e=>`#/components/schemas/${e}`,"getSchemaRef"),an=o(e=>e[1]==="/"?e:"#/"+e.slice(1),"autocorrectRef"),di=o(e=>an(e).split("/").at(-1),"getSchemaNameByRef");function Nf(e){let t=zN(e).normalize("NFKD").trim().replace(/\s+/g,"_").replace(/--+/g,"-").replace(/-+/g,"_").replace(/[^\w-]+/g,"_");return me(t)}o(Nf,"normalizeString");function kf(e){return/^[a-zA-Z]\w*$/.test(e)?e:`"${e}"`}o(kf,"wrapWithQuotesIfNeeded");function ob(e){return typeof e=="string"&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}o(ob,"unwrapQuotesIfNeeded");function zN(e){let t=Number(e[0]);return typeof t=="number"&&!Number.isNaN(t)?"_"+e:e}o(zN,"prefixStringStartingWithNumberIfNeeded");function jf(e){let t=e.replaceAll("_","#");return me(t.replaceAll("-","_")).replaceAll("#","_")}o(jf,"pathParamToVariableName");var zt=o(e=>rb.includes(e),"isPrimitiveType");function sb(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(sb,"escapeControlCharacters");function Xe(e){return e.includes("application/")&&e.includes("json")||eb.includes(e)||e.includes("text/")}o(Xe,"isParamMediaTypeAllowed");function Ro(e){return e>=200&&e<300}o(Ro,"isMainResponseStatus");function Oa(e){return!(e>=200&&e<300)}o(Oa,"isErrorStatus");function mi(e){return e.startsWith("application/")}o(mi,"isMediaTypeAllowed");var nb=/({\w+})/g,KN=/[^\w\-]+/g;function ab(e){e=B(Io(e.replaceAll("/","-")).replaceAll("-",""));let t=[...e.matchAll(nb)];if(t.length>0){let r=t.sort((n,i)=>n.index-i.index)[t.length-1][0];e=`${e.replace(nb,"")}By${B(r.slice(1,-1))}`}return e.replace(KN,"_")}o(ab,"pathToVariableName");var Rf=/{(\b\w+(?:-\w+)*\b)}/g;function cb(e){let t=e.match(Rf);return t===null?e.replaceAll(Rf,":$1"):(t.forEach(r=>{let n=jf(r.replaceAll(Rf,":$1"));e=e.replaceAll(r,n)}),e)}o(cb,"replaceHyphenatedPath");var $a=o(e=>{let t=e["x-enumNames"],r=Array.isArray(t)&&t.length>0,n=!!e.schema&&he(e.schema)&&e.schema.type==="string";return r&&n},"isSortingParameterObject"),cn=o((e,t)=>t.excludePathRegex?new RegExp(t.excludePathRegex).test(e):!1,"isPathExcluded");function Kt(e){return Dv(e)}o(Kt,"formatTag");function wr(e,t){var n;let r=(n=e.tags)==null?void 0:n[0];return Kt(r??t.defaultTag)}o(wr,"getOperationTag");function De(e,t){var n;let r=t.splitByTags?(n=e.tags)==null?void 0:n[0]:t.defaultTag;return Kt(r??t.defaultTag)}o(De,"getEndpointTag");function ub(e,t){return t.excludeTags.some(r=>r.toLowerCase()===e.toLowerCase())}o(ub,"isTagExcluded");var xa={fileName:"acl/app.ability",extension:"ts"},No="AppAbilities",Aa={fileName:"acl/useAclCheck",extension:"ts"},Ir="useAclCheck",ge={abilityTuple:"AbilityTuple",pureAbility:"PureAbility",forcedSubject:"ForcedSubject",subjectType:"Subject",subject:"subject"},qf={bindings:[ge.abilityTuple,ge.pureAbility,ge.forcedSubject,ge.subjectType,ge.subject],from:"@casl/ability"};var ko="AppRestClient",wa={query:"AppQueryOptions",infiniteQuery:"AppInfiniteQueryOptions",mutation:"AppMutationOptions"},Mf="src/data",Tr={ErrorHandler:"ErrorHandler",SharedErrorHandler:"SharedErrorHandler"},Ia={bindings:[Tr.ErrorHandler,Tr.SharedErrorHandler]},Df="AbilityContext",lb={bindings:[Df]},jo={dynamicInputs:"dynamicInputs",dynamicColumns:"dynamicColumns"};var Ta={reactQueryTypes:{fileName:"react-query.types",extension:"ts"},restClient:{fileName:"rest-client",extension:"ts"},restInterceptor:{fileName:"rest-interceptor",extension:"ts"}},Ca={fileName:"app-rest-client",extension:"ts"},Lf="QueryModule",Ra={fileName:"queryModules",extension:"ts"},pb={fileName:"queryConfig.context",extension:"tsx"},hi={optionsType:"MutationEffectsOptions",hookName:"useMutationEffects",runFunctionName:"runMutationEffects"},Na={fileName:"useMutationEffects",extension:"ts"},et={namespace:"ZodExtended",exports:{parse:"parse",sortExp:"sortExp"}},ka={fileName:"zod.extended",extension:"ts"};var Ve=o((...e)=>[...new Set(e.flat())],"getUniqueArray");var qo=o(e=>`canUse${B(me(e.operationName))}`,"getAbilityFunctionName"),ja=o((e,t)=>`${t.tsNamespaces?`${V({type:"acl",tag:De(e,t),options:t})}.`:""}${qo(e)}`,"getImportedAbilityFunctionName"),Ff=o(e=>{var t;return(t=e.acl)==null?void 0:t[0].action},"getAbilityAction"),Hf=o(e=>{var t;return(t=e.acl)==null?void 0:t[0].subject},"getAbilitySubject"),Mo=o(e=>{var t;return!!((t=gi(e))!=null&&t.length)},"hasAbilityConditions"),gi=o(e=>{var t,r;return(r=(t=e.acl)==null?void 0:t[0].conditionsTypes)==null?void 0:r.sort((n,i)=>n.name.localeCompare(i.name))},"getAbilityConditionsTypes"),fb=o(e=>{var t;return(t=e.acl)==null?void 0:t[0].description},"getAbilityDescription"),Vf=o(e=>{var n;let t=Hf(e),r=[`"${t??""}"`];return Mo(e)&&r.push(`ForcedSubject<"${t}"> & { ${(n=gi(e))==null?void 0:n.map(i=>`${i.name}${i.required?"":"?"}: ${i.type??""}${i.zodSchemaName??""},`).join(" ")} }`),r},"getAbilitySubjectTypes");function Bf({resolver:e,data:t,tag:r}){var c;let n=(c=t.get(r))==null?void 0:c.endpoints.filter(({acl:u})=>u&&u.length>0);if(!n||n.length===0)return;let i=n.some(({acl:u})=>(u==null?void 0:u[0].conditions)&&Object.keys(u[0].conditions).length>0),s=n.reduce((u,l)=>{var p,d;let f=(d=(p=l.acl)==null?void 0:p[0].conditionsTypes)==null?void 0:d.reduce((m,g)=>[...m,...g!=null&&g.zodSchemaName?[g.zodSchemaName]:[]],[]);return[...u,...f??[]]},[]),a=Rt({resolver:e,tag:r,zodSchemasAsTypes:Ve(s)});return{endpoints:n,hasAdditionalAbilityImports:i,modelsImports:a}}o(Bf,"getAclData");var db=o(({resolver:e,data:t})=>{let r=new Map,n=[],i=!1;t.forEach((c,u)=>{let l=Bf({resolver:e,data:t,tag:u});if(!l)return;let{modelsImports:f,hasAdditionalAbilityImports:p,endpoints:d}=l;n.push(f),i=i||p,d.forEach(m=>{let g=Ff(m);g&&r.set(g,new Set([...r.get(g)??[],...Vf(m)]))})});let s=Do(e.options,...n);return{appAbilitiesType:r.size>0?Object.fromEntries(Array.from(r.entries()).map(([c,u])=>[c,Array.from(u)])):void 0,modelsImports:s,hasAdditionalAbilityImports:i}},"getAppAbilitiesType");function Te(e,t){if(!e)return;let{data:r,onSchema:n}=t;if(L(e)&&n({type:"reference",schema:e,data:r})===!0)return;let i=e;if(fi.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&&Te(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&&Te(a,t);if(i.additionalProperties&&typeof i.additionalProperties=="object"){if(n({type:"additionalProperties",parentSchema:e,schema:i.additionalProperties,data:r})===!0)return;Te(i.additionalProperties,t)}if(i.type==="array"){let s=e.items;if(n({type:"array",parentSchema:e,schema:s,data:r})===!0)return;Te(s,t)}}o(Te,"iterateSchema");var un=o((e,t)=>bf(B(Nf(e)),t),"getZodSchemaName"),Lo=o((e,t,r)=>bf(B(Nf(e)),`${t}${r}`),"getEnumZodSchemaName"),ne=o(e=>["z.",`${et.namespace}.`].every(t=>!e.startsWith(t)),"isNamedZodSchema"),mb=o(e=>e.startsWith(wo),"isEnumZodSchema"),ln=o((e,t,r)=>t?e:`${r}_${e}`,"getZodSchemaOperationName"),qa=o(e=>me(`${e}_${wv}`),"getBodyZodSchemaName"),hb=o((e,t)=>me(`${e}_${t}${Iv}`),"getParamZodSchemaName"),QN=o(e=>me(`${e}${Tv}`),"getMainResponseZodSchemaName"),WN=o((e,t)=>me(`${e}_${t}_${Cv}`),"getErrorResponseZodSchemaName");function Ma({statusCode:e,operationName:t,isUniqueOperationName:r,tag:n}){let i=Number(e),s=ln(t,r,n);return!Ro(i)&&e!=="default"&&Oa(i)?WN(s,e):QN(s)}o(Ma,"getResponseZodSchemaName");function Fo(e){return["minimum","exclusiveMinimum","maximum","exclusiveMaximum","minItems","minLength","minProperties","maxItems","maxLength","maxProperties","default","example"].filter(n=>e[n]).reduce((n,i)=>[...n,`${B(ga(i))}: \`${e[i]}\``],[])}o(Fo,"getSchemaDescriptions");var Ho=o((e,t)=>Lv(e,t.schemaSuffix),"getZodSchemaInferedTypeName"),pn=o((e,t)=>ne(t)?`${e.options.tsNamespaces?`${V({type:"models",tag:e.getTagByZodSchemaName(t),options:e.options})}.`:""}${t}`:t,"getImportedZodSchemaName"),Cr=o((e,t,r)=>{if(!ne(t))return t===Ao?"void":t;let n=e.getTagByZodSchemaName(t);return`${e.options.tsNamespaces&&n!==r?`${V({type:"models",tag:n,options:e.options})}.`:""}${Ho(t,e.options)}`},"getImportedZodSchemaInferedTypeName");function gb(e){var t;return e.isEnum?"enum":((t=e.schemaObj)==null?void 0:t.type)??"object"}o(gb,"getZodSchemaType");function yb(e){if(e.schemaObj)return[e.schemaObj.description,...Fo(e.schemaObj)].filter(Boolean).join(". ")}o(yb,"getZodSchemaDescription");function Sb(e,t,r){var n;if(L(t)){let i=e.getZodSchemaNameByRef(t.$ref);return i?Cr(e,i,r):void 0}if(_a(t)){if(!L(t.items))return`${((n=t.items)==null?void 0:n.type)??"unknown"}[]`;let i=e.getZodSchemaNameByRef(t.items.$ref);return i?`${Cr(e,i,r)}[]`:void 0}if(fi.some(i=>i in t&&t[i])){let i=t.allOf??t.anyOf??t.oneOf??[];if(i.length>0)return Sb(e,i[0],r)}return t.type}o(Sb,"getType");function vb(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,...Fo(f)].filter(Boolean),d=u.join(".");s[d]&&"type"in c.schema&&c.schema.type==="object"||(delete s[d],s[d]={type:Sb(e,c.schema,r)??"unknown",description:p.join(". ")})}return Te(c.schema,{data:{pathSegments:[...u]},onSchema:a}),!0},"onSchema");return"allOf"in t.schemaObj&&t.schemaObj.allOf&&t.schemaObj.allOf.forEach(c=>{if(L(c)){let u=e.resolveObject(c);Te(u,{data:{pathSegments:[]},onSchema:a})}}),Te(t.schemaObj,{data:{pathSegments:[]},onSchema:a}),s}o(vb,"getZodSchemaPropertyDescriptions");function Rt({resolver:e,tag:t,zodSchemas:r=[],zodSchemasAsTypes:n=[]}){let i="models",s=o(u=>e.getTagByZodSchemaName(u),"getTag"),a=yi({type:i,tag:t,entities:r,getTag:s,getEntityName:o(u=>u,"getEntityName"),options:e.options}),c=yi({type:i,tag:t,entities:n,getTag:s,getEntityName:o(u=>Ho(u,e.options),"getEntityName"),options:e.options});return Do(e.options,a,c)}o(Rt,"getModelsImports");function bb({tag:e,endpoints:t,options:r}){return yi({type:"endpoints",tag:e,entities:t,getTag:o(n=>De(n,r),"getTag"),getEntityName:Vo,options:r})}o(bb,"getEndpointsImports");function _b({tag:e,endpoints:t,options:r}){return yi({type:"queries",tag:e,entities:t,getTag:o(n=>De(n,r),"getTag"),getEntityName:fn,options:r})}o(_b,"getQueriesImports");function Eb({tag:e,endpoints:t,options:r}){return yi({type:"queries",tag:e,entities:t,getTag:o(n=>De(n,r),"getTag"),getEntityName:Bo,options:r})}o(Eb,"getInfiniteQueriesImports");function Da({tag:e,endpoints:t,options:r}){return yi({type:"acl",tag:e,entities:t,getTag:o(n=>De(n,r),"getTag"),getEntityName:qo,options:r})}o(Da,"getAclImports");function Qt(e){let t=e.tsPath;return e.importPath==="relative"?t="../":e.importPath==="absolute"?t=e.output:new RegExp(`${Mf}`,"g").test(e.output)&&(t=e.output.replace(new RegExp(`.*${Mf}`,"g"),e.tsPath)),`${t}/`.replace(/\/\//g,"/")}o(Qt,"getImportPath");function yi({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?V({type:e,tag:u,options:s}):i(c)],from:`${l?"./":Qt(s)}${Si({type:e,tag:u,includeTagDir:!l,options:s})}`})}}),Array.from(a.values())}o(yi,"getImports");function Do(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:Ve(n.bindings)}))}o(Do,"mergeImports");function dn({fileName:e,extension:t}){return`${e}.${t}`}o(dn,"getFileNameWithExtension");function Pb({type:e,tag:t,options:r,includeTagDir:n=!0}){let i=r.configs[e].outputFileNameSuffix;return t?`${n?`${br(t)}/`:""}${br(t)}.${i}`:i}o(Pb,"getTagFileNameWithoutExtension");function Si(...e){return Pb(...e)}o(Si,"getTagImportPath");function Ob(...e){return`${Pb(...e)}.ts`}o(Ob,"getTagFileName");function $b(e){return e.standalone?`${Qt(e)}${Ca.fileName}`:e.restClientImportPath}o($b,"getAppRestClientImportPath");function xb(e){return e.standalone?`${Qt(e)}${Ta.reactQueryTypes.fileName}`:e.queryTypesImportPath}o(xb,"getQueryTypesImportPath");function Ab(e){return`${Qt(e)}${Ra.fileName}`}o(Ab,"getQueryModulesImportPath");function wb(e){return`${Qt(e)}${Na.fileName}`}o(wb,"getMutationEffectsImportPath");function Ib(e){return`${Qt(e)}${Aa.fileName}`}o(Ib,"getAclCheckImportPath");function Tb(e){return`${Qt(e)}${ka.fileName}`}o(Tb,"getZodExtendedImportPath");function Cb(e){return`${Qt(e)}${xa.fileName}`}o(Cb,"getAppAbilitiesImportPath");function La(e){return $e(e).with("string",()=>"string").with("number",()=>"number").with("integer",()=>"number").with("boolean",()=>"boolean").exhaustive()}o(La,"primitiveTypeToTsType");function vi({zodSchemaName:e,schema:t,resolver:r}){let n="void",i;e&&ne(e)?(n=Cr(r,e),i=r.getTagByZodSchemaName(e)):t!=null&&t.type&&zt(t==null?void 0:t.type)&&(n=La(t==null?void 0:t.type));let s=n.split(".");return{type:s[s.length-1],...s.length>1?{namespace:s[0]}:{},...i?{importPath:Si({type:"models",tag:i,includeTagDir:!0,options:r.options})}:{}}}o(vi,"getTsTypeBase");function mn({schema:e,isCircular:t,parentTypes:r,resolver:n}){if(!e)return{metaType:"primitive"};for(let i of fi){let s=e[i];if(s)if(s.length>1){let a=s.map(c=>{let u=n.resolveObject(c);return mn({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:Rb({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:YN({schema:e,parentTypes:r,resolver:n})}:{metaType:"primitive"}}o(mn,"getSchemaTsMetaType");function Rb({arraySchema:e,parentTypes:t,resolver:r}){let n,i;if(L(e.items)){let u=e.items.$ref;n=r.getZodSchemaNameByRef(u),i=r.getSchemaByRef(u)}else i=e.items;let s=vi({zodSchemaName:n,schema:i,resolver:r}),a=Nb(s,t),c=mn({schema:i,isCircular:a,parentTypes:[...t,s],resolver:r});return{...s,...c}}o(Rb,"getArraySchemaTsType");function YN({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(L(i)){let c=r.getZodSchemaNameByRef(i.$ref),u=r.getSchemaByRef(i.$ref),l=vi({zodSchemaName:c,schema:u,resolver:r}),f=Nb(l,t),p=mn({schema:u,isCircular:f,parentTypes:[...t,l],resolver:r});return{name:n,isRequired:s,...l,...p}}else if(i.type==="array"){let c=Rb({arraySchema:i,parentTypes:t,resolver:r});return{name:n,isRequired:s,type:"array",metaType:"array",arrayType:c}}else if(zt(i.type))return{name:n,isRequired:s,type:La(i.type),metaType:"primitive"};return{name:n,isRequired:s,type:"void",metaType:"primitive"}})}o(YN,"getSchemaTsProperties");function Nb(e,t){return t.findIndex(({type:r,namespace:n})=>r===e.type&&n===e.namespace)>-1}o(Nb,"getIsCircular");var Vo=o(e=>br(me(e.operationName)),"getEndpointName");function jb(e,t){return`${t.tsNamespaces?`${V({type:"endpoints",tag:De(e,t),options:t})}.`:""}${Vo(e)}`}o(jb,"getImportedEndpointName");var qb=o(e=>e.method!==kb.OpenAPIV3.HttpMethods.GET,"requiresBody"),Rr=o(e=>e.parameters.find(t=>t.type==="Body"),"getEndpointBody"),Mb=o((e,t)=>{let r=Gf(e),n=t.options.axiosRequestConfig;return Object.keys(r).length>0||n},"hasEndpointConfig"),Db=o(e=>e.path.replace(/:([a-zA-Z0-9_]+)/g,"${$1}"),"getEndpointPath");function Nr(e,t,r){let n=t.parameters.map(i=>{var a,c,u,l;let s="string";if(ne(i.zodSchema))s=Cr(e,i.zodSchema);else if((a=i.parameterObject)!=null&&a.schema&&he(i.parameterObject.schema)){let f=(u=(c=i.parameterObject)==null?void 0:c.schema)==null?void 0:u.type;f&&zt(f)&&(s=La(f))}return{name:wt(i.name),type:s,paramType:i.type,required:((l=i.parameterObject)==null?void 0:l.required)??!0,parameterObject:i.parameterObject,bodyObject:i.bodyObject}});return r!=null&&r.includeFileParam&&t.mediaUpload&&n.push({name:"file",type:"File",paramType:"Body",required:!0,parameterObject:void 0,bodyObject:void 0}),n.sort((i,s)=>{if(i.required===s.required){let a=["Path","Body","Query","Header"];return a.indexOf(i.paramType)-a.indexOf(s.paramType)}return i.required?-1:1}).filter(i=>(!(r!=null&&r.excludeBodyParam)||i.name!==va)&&(!(r!=null&&r.excludePageParam)||i.name!==e.options.infiniteQueryParamNames.page)&&(!(r!=null&&r.includeOnlyRequiredParams)||i.required)).map(i=>({...i,name:r!=null&&r.replacePageParam&&i.name===e.options.infiniteQueryParamNames.page?"pageParam":i.name,required:i.required&&(i.paramType==="Path"||!(r!=null&&r.pathParamsRequiredOnly))}))}o(Nr,"mapEndpointParamsToFunctionParams");function Gf(e){let t=e.parameters.filter(i=>i.type==="Query").map(i=>{let s=Yv(i.name)?i.name:`"${i.name}"`,a=wt(i.name);return{...i,name:s,value:a}}),r={};return e.requestFormat!==Of["Content-Type"]&&(r["Content-Type"]=`'${e.requestFormat}'`),e.responseFormat&&e.responseFormat!==Of.Accept&&(r.Accept=`'${e.responseFormat}'`),e.parameters.filter(i=>i.type==="Header").forEach(i=>{r[i.name]=wt(i.name)}),{...t.length>0?{params:t}:{},...Object.keys(r).length?{headers:r}:{}}}o(Gf,"getEndpointConfig");function Lb(e,t){return t.filter(r=>Le(r)&&r.parameters.filter(n=>{var i;return(i=n.parameterObject)==null?void 0:i.required}).every(n=>e.parameters.some(i=>i.name===n.name))&&r.response===e.response)}o(Lb,"getUpdateQueryEndpoints");var Le=o(e=>Sa(e),"isQuery"),Nt=o(e=>!Sa(e)||!!e.mediaDownload,"isMutation"),bi=o((e,t)=>Ef(e,t),"isInfiniteQuery"),Fb=o((e,t,r)=>{let n=r.reduce((i,s)=>[...i,...Nr(e,s,{includeOnlyRequiredParams:!0}).map(a=>a.name)],[]);return Nr(e,t,{includeOnlyRequiredParams:!0,excludeBodyParam:!0}).filter(i=>n.includes(i.name)).map(i=>i.name)},"getDestructuredVariables");var fn=o((e,t)=>{let r=Le(e)&&Nt(e)&&t;return`use${B(me(e.operationName))}${r?"Mutation":""}`},"getQueryName"),Bo=o(e=>`use${B(me(e.operationName))}Infinite`,"getInfiniteQueryName"),hn=o((e,t)=>`${t.tsNamespaces?`${V({type:"queries",tag:De(e,t),options:t})}.`:""}${fn(e)}`,"getImportedQueryName"),Hb=o((e,t)=>`${t.tsNamespaces?`${V({type:"queries",tag:De(e,t),options:t})}.`:""}${Bo(e)}`,"getImportedInfiniteQueryName");function kt({schema:e,meta:t,options:r}){let n=[];$e(e.type).with("string",()=>n.push(ek(e))).with("number","integer",()=>n.push(rk(e))).with("array",()=>n.push(nk(e))).otherwise(()=>{}),typeof e.description=="string"&&e.description!==""&&r.withDescription&&([`
|
|
72
|
+
`,t};ee.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};ee.prototype.MustacheStatement=function(e){return this.pad("{{ "+this.SubExpression(e)+" }}")};ee.prototype.Decorator=function(e){return this.pad("{{ DIRECTIVE "+this.SubExpression(e)+" }}")};ee.prototype.BlockStatement=ee.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};ee.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+" }}")};ee.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+" }}")};ee.prototype.ContentStatement=function(e){return this.pad("CONTENT[ '"+e.value+"' ]")};ee.prototype.CommentStatement=function(e){return this.pad("{{! '"+e.value+"' }}")};ee.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};ee.prototype.PathExpression=function(e){var t=e.parts.join("/");return(e.data?"@":"")+"PATH:"+t};ee.prototype.StringLiteral=function(e){return'"'+e.value+'"'};ee.prototype.NumberLiteral=function(e){return"NUMBER{"+e.value+"}"};ee.prototype.BooleanLiteral=function(e){return"BOOLEAN{"+e.value+"}"};ee.prototype.UndefinedLiteral=function(){return"UNDEFINED"};ee.prototype.NullLiteral=function(){return"NULL"};ee.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(", ")+"}"};ee.prototype.HashPair=function(e){return e.key+"="+this.accept(e.value)}});var er=h((l9,aP)=>{var Ac=nP().default,sP=iP();Ac.PrintVisitor=sP.PrintVisitor;Ac.print=sP.print;aP.exports=Ac;function oP(e,t){var r=require("fs"),n=r.readFileSync(t,"utf8");e.exports=Ac.compile(n)}o(oP,"extension");typeof require<"u"&&require.extensions&&(require.extensions[".handlebars"]=oP,require.extensions[".hbs"]=oP)});var mM={};BP(mM,{getGenerateFilesData:()=>dM,getGenerateMetadata:()=>fM});module.exports=GP(mM);var Kd=Re($v());var xv="Schema",Av="Enum",wv="Body",Iv="Param",Tv="Response",Cv="ErrorResponse",Ao="z.void()",li="z.any()",ma="z.instanceof(Blob)",wo="z.enum",Rv="z.int()",Nv="z.number()",ha="z.string()",kv="z.email()",jv="z.url()",qv="z.uuid()",Mv="z.iso.datetime({ offset: true })",vr={bindings:["z"],from:"zod"};var vf={input:"http://localhost:4000/docs-json/",output:"output",splitByTags:!0,defaultTag:"Common",excludeTags:[],excludePathRegex:"",excludeRedundantZodSchemas:!0,tsNamespaces:!0,tsPath:"@/data",importPath:"ts",configs:{models:{outputFileNameSuffix:"models",namespaceSuffix:"Models"},endpoints:{outputFileNameSuffix:"api",namespaceSuffix:"Api"},queries:{outputFileNameSuffix:"queries",namespaceSuffix:"Queries"},acl:{outputFileNameSuffix:"acl",namespaceSuffix:"Acl"},configs:{outputFileNameSuffix:"configs",namespaceSuffix:"Configs"}},standalone:!1,baseUrl:"",schemaSuffix:xv,enumSuffix:Av,withDefaultValues:!0,extractEnums:!0,replaceOptionalWithNullish:!1,restClientImportPath:"@/util/rest/clients/app-rest-client",errorHandlingImportPath:"@/util/vendor/error-handling",removeOperationPrefixEndingWith:"Controller_",parseRequestParams:!0,queryTypesImportPath:"@/types/react-query",axiosRequestConfig:!1,mutationEffects:!0,infiniteQueries:!1,infiniteQueryParamNames:{page:"page"},infiniteQueryResponseParamNames:{page:"page",totalItems:"totalItems",limit:"limit"},acl:!0,checkAcl:!0,abilityContextImportPath:"@/data/acl/ability.context",abilityContextGenericAppAbilities:!1,builderConfigs:!1,filterParamName:"filter",dataResponseParamNames:["data","items"],dynamicInputsImportPath:"@povio/ui",dynamicColumnsImportPath:"@povio/ui"};var B=o(e=>e.charAt(0).toUpperCase()+e.slice(1),"capitalize"),br=o(e=>e.charAt(0).toLowerCase()+e.slice(1),"decapitalize"),Io=o(e=>e.replace(/(-\w)/g,t=>t[1].toUpperCase()),"kebabToCamel"),me=o(e=>e.replace(/(_\w)/g,t=>t[1].toUpperCase()),"snakeToCamel"),Dv=o(e=>e.replace(/[\W_]+(\w)?/g,(t,r)=>(r==null?void 0:r.toUpperCase())??""),"nonWordCharactersToCamel"),bf=o((e,t="")=>e.endsWith(t)?e:`${e}${t}`,"suffixIfNeeded"),Lv=o((e,t)=>e.replace(new RegExp(`${t}$`),""),"removeSuffix"),LN=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"),_f=o(e=>{let t=e.map(B).map(Fv).map(r=>FN(r)).flat();return LN(t)},"getMostCommonAdjacentCombinationSplit"),Fv=o(e=>e.split(/(?<![A-Z])(?=[A-Z])/).filter(Boolean),"splitByUppercase"),ga=o(e=>Fv(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"),Hv=o((e,t)=>{let r=t.replace(/es$|s$/g,""),n=new RegExp(`(${br(r)}|${B(r)})[a-z]*(?=$|[A-Z])`,"g");return e.replace(n,"")},"removeWord");var V=o(({type:e,tag:t,options:r})=>`${B(t)}${r.configs[e].namespaceSuffix}`,"getNamespaceName");var Gt=Re(ya());var Sa=o(e=>e.method===Gt.OpenAPIV3.HttpMethods.GET,"isGetEndpoint"),Ef=o((e,t)=>Sa(e)&&Object.values(t.infiniteQueryParamNames).every(r=>e.parameters.some(n=>n.name===r&&n.type==="Query")),"isPaginatedGetEndpoint"),Vv=o((e,t)=>e.method===Gt.OpenAPIV3.HttpMethods.GET&&!pi(e.pathSegments.at(-1))&&Ef(e,t),"isReadAllEndpoint"),Bv=o((e,t)=>e.method===Gt.OpenAPIV3.HttpMethods.GET&&Pf(e,t),"isReadEndpoint"),Gv=o((e,t)=>e.method===Gt.OpenAPIV3.HttpMethods.POST&&Wv(e,t),"isCreateEndpoint"),Uv=o((e,t)=>[Gt.OpenAPIV3.HttpMethods.PUT,Gt.OpenAPIV3.HttpMethods.PATCH].includes(e.method)&&Pf(e,t),"isUpdateEndpoint"),Zv=o((e,t)=>e.method===Gt.OpenAPIV3.HttpMethods.DELETE&&Pf(e,t),"isDeleteEndpoint"),zv=o((e,t)=>e.method===Gt.OpenAPIV3.HttpMethods.DELETE&&Wv(e,t),"isBulkDeleteEndpoint"),Kv=o(e=>e.split("/").filter(Boolean),"getPathSegments"),pi=o(e=>e==null?void 0:e.startsWith(":"),"isPathSegmentParam"),Qv=o((e,t)=>t.pathSegments.every((r,n)=>pi(r)&&pi(e.pathSegments[n])||r===e.pathSegments[n]),"hasMatchingPath"),Wv=o((e,t)=>e.pathSegments.length===t.pathSegments.length&&Qv(e,t),"hasMatchingPathWithoutTrailingParam"),Pf=o((e,t)=>e.pathSegments.length-1===t.pathSegments.length&&pi(e.pathSegments.at(-1))&&Qv(e,t),"hasMatchingPathWithTrailingParam");var kb=Re(ya());var on="application/json",Of={"Content-Type":on,Accept:on},va="data",$f="axios",Er="config",At="AxiosRequestConfig",ba={defaultImport:$f,bindings:[At],from:"axios"};var Yv=o(e=>/^(?:[a-zA-Z_$][a-zA-Z0-9_$]*|[0-9]+)$/.test(e),"isValidPropertyName"),wt=o(e=>e.replace(/^[^a-zA-Z_$]*/g,"").replace(/[^a-zA-Z0-9_$]+(\w)?/g,(t,r)=>(r==null?void 0:r.toUpperCase())??""),"invalidVariableNameCharactersToCamel");function L(e){return e!=null&&Object.prototype.hasOwnProperty.call(e,"$ref")}o(L,"isReferenceObject");function he(e){return!L(e)}o(he,"isSchemaObject");function _a(e){return e.type==="array"}o(_a,"isArraySchemaObject");function Jv(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(BN(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(L(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(Jv,"inferRequiredSchema");var BN=o(e=>!L(e)&&!!e.required&&!e.type&&!e.properties&&!(e!=null&&e.allOf)&&!(e!=null&&e.anyOf)&&!e.oneOf,"isBrokenAllOfItem");var Ut=Symbol.for("@ts-pattern/matcher"),GN=Symbol.for("@ts-pattern/isVariadic"),Pa="@ts-pattern/anonymous-select-key",xf=o(e=>!!(e&&typeof e=="object"),"r"),Ea=o(e=>e&&!!e[Ut],"i"),Ct=o((e,t,r)=>{if(Ea(e)){let n=e[Ut](),{matched:i,selections:s}=n.match(t);return i&&s&&Object.keys(s).forEach(a=>r(a,s[a])),i}if(xf(e)){if(!xf(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];Ea(c)&&c[GN]?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)=>Ct(l,a[f],r))&&i.every((l,f)=>Ct(l,c[f],r))&&(s.length===0||Ct(s[0],u,r))}return e.length===t.length&&e.every((a,c)=>Ct(a,t[c],r))}return Reflect.ownKeys(e).every(n=>{let i=e[n];return(n in t||Ea(s=i)&&s[Ut]().matcherType==="optional")&&Ct(i,t[n],r);var s})}return Object.is(t,e)},"s"),Ar=o(e=>{var t,r,n;return xf(e)?Ea(e)?(t=(r=(n=e[Ut]()).getSelectionKeys)==null?void 0:r.call(n))!=null?t:[]:Array.isArray(e)?Co(e,Ar):Co(Object.values(e),Ar):[]},"o"),Co=o((e,t)=>e.reduce((r,n)=>r.concat(t(n)),[]),"c");function Je(e){return Object.assign(e,{optional:o(()=>UN(e),"optional"),and:o(t=>W(e,t),"and"),or:o(t=>ZN(e,t),"or"),select:o(t=>t===void 0?Xv(e):Xv(t,e),"select")})}o(Je,"u");function UN(e){return Je({[Ut]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return t===void 0?(Ar(e).forEach(i=>n(i,void 0)),{matched:!0,selections:r}):{matched:Ct(e,t,n),selections:r}},"match"),getSelectionKeys:o(()=>Ar(e),"getSelectionKeys"),matcherType:"optional"})})}o(UN,"h");function W(...e){return Je({[Ut]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return{matched:e.every(i=>Ct(i,t,n)),selections:r}},"match"),getSelectionKeys:o(()=>Co(e,Ar),"getSelectionKeys"),matcherType:"and"})})}o(W,"m");function ZN(...e){return Je({[Ut]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return Co(e,Ar).forEach(i=>n(i,void 0)),{matched:e.some(i=>Ct(i,t,n)),selections:r}},"match"),getSelectionKeys:o(()=>Co(e,Ar),"getSelectionKeys"),matcherType:"or"})})}o(ZN,"d");function H(e){return{[Ut]:()=>({match:o(t=>({matched:!!e(t)}),"match")})}}o(H,"p");function Xv(...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 Je({[Ut]:()=>({match:o(n=>{let i={[t??Pa]:n};return{matched:r===void 0||Ct(r,n,(s,a)=>{i[s]=a}),selections:i}},"match"),getSelectionKeys:o(()=>[t??Pa].concat(r===void 0?[]:Ar(r)),"getSelectionKeys")})})}o(Xv,"y");function It(e){return typeof e=="number"}o(It,"v");function Pr(e){return typeof e=="string"}o(Pr,"b");function Or(e){return typeof e=="bigint"}o(Or,"w");var V5=Je(H(function(e){return!0}));var $r=o(e=>Object.assign(Je(e),{startsWith:o(t=>{return $r(W(e,(r=t,H(n=>Pr(n)&&n.startsWith(r)))));var r},"startsWith"),endsWith:o(t=>{return $r(W(e,(r=t,H(n=>Pr(n)&&n.endsWith(r)))));var r},"endsWith"),minLength:o(t=>$r(W(e,(r=>H(n=>Pr(n)&&n.length>=r))(t))),"minLength"),length:o(t=>$r(W(e,(r=>H(n=>Pr(n)&&n.length===r))(t))),"length"),maxLength:o(t=>$r(W(e,(r=>H(n=>Pr(n)&&n.length<=r))(t))),"maxLength"),includes:o(t=>{return $r(W(e,(r=t,H(n=>Pr(n)&&n.includes(r)))));var r},"includes"),regex:o(t=>{return $r(W(e,(r=t,H(n=>Pr(n)&&!!n.match(r)))));var r},"regex")}),"j"),B5=$r(H(Pr)),Tt=o(e=>Object.assign(Je(e),{between:o((t,r)=>Tt(W(e,((n,i)=>H(s=>It(s)&&n<=s&&i>=s))(t,r))),"between"),lt:o(t=>Tt(W(e,(r=>H(n=>It(n)&&n<r))(t))),"lt"),gt:o(t=>Tt(W(e,(r=>H(n=>It(n)&&n>r))(t))),"gt"),lte:o(t=>Tt(W(e,(r=>H(n=>It(n)&&n<=r))(t))),"lte"),gte:o(t=>Tt(W(e,(r=>H(n=>It(n)&&n>=r))(t))),"gte"),int:o(()=>Tt(W(e,H(t=>It(t)&&Number.isInteger(t)))),"int"),finite:o(()=>Tt(W(e,H(t=>It(t)&&Number.isFinite(t)))),"finite"),positive:o(()=>Tt(W(e,H(t=>It(t)&&t>0))),"positive"),negative:o(()=>Tt(W(e,H(t=>It(t)&&t<0))),"negative")}),"x"),G5=Tt(H(It)),xr=o(e=>Object.assign(Je(e),{between:o((t,r)=>xr(W(e,((n,i)=>H(s=>Or(s)&&n<=s&&i>=s))(t,r))),"between"),lt:o(t=>xr(W(e,(r=>H(n=>Or(n)&&n<r))(t))),"lt"),gt:o(t=>xr(W(e,(r=>H(n=>Or(n)&&n>r))(t))),"gt"),lte:o(t=>xr(W(e,(r=>H(n=>Or(n)&&n<=r))(t))),"lte"),gte:o(t=>xr(W(e,(r=>H(n=>Or(n)&&n>=r))(t))),"gte"),positive:o(()=>xr(W(e,H(t=>Or(t)&&t>0))),"positive"),negative:o(()=>xr(W(e,H(t=>Or(t)&&t<0))),"negative")}),"A"),U5=xr(H(Or)),Z5=Je(H(function(e){return typeof e=="boolean"})),z5=Je(H(function(e){return typeof e=="symbol"})),K5=Je(H(function(e){return e==null})),Q5=Je(H(function(e){return e!=null}));var Tf=class Tf 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(Tf,"W");var Af=Tf,wf={matched:!1,value:void 0};function $e(e){return new If(e,wf)}o($e,"z");var To=class To{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=>Ct(l,this.input,c))||i&&!i(this.input)?wf:{matched:!0,value:r(s?Pa in a?a[Pa]:a:this.input,this.input)};return new To(this.input,u)}when(t,r){if(this.state.matched)return this;let n=!!t(this.input);return new To(this.input,n?{matched:!0,value:r(this.input,this.input)}:wf)}otherwise(t){return this.state.matched?this.state.value:t(this.input)}exhaustive(){if(this.state.matched)return this.state.value;throw new Af(this.input)}run(){return this.exhaustive()}returnType(){return this}};o(To,"I");var If=To;var Zt=Re(ya()),Cf=2,eb=["application/octet-stream","multipart/form-data","application/x-www-form-urlencoded","*/*"],tb=["query","header","path"],sn=[Zt.OpenAPIV3.HttpMethods.GET,Zt.OpenAPIV3.HttpMethods.PUT,Zt.OpenAPIV3.HttpMethods.POST,Zt.OpenAPIV3.HttpMethods.DELETE,Zt.OpenAPIV3.HttpMethods.OPTIONS,Zt.OpenAPIV3.HttpMethods.HEAD,Zt.OpenAPIV3.HttpMethods.PATCH,Zt.OpenAPIV3.HttpMethods.TRACE],rb=["string","number","integer","boolean"],fi=["allOf","anyOf","oneOf"];var ib=o(e=>`#/components/schemas/${e}`,"getSchemaRef"),an=o(e=>e[1]==="/"?e:"#/"+e.slice(1),"autocorrectRef"),di=o(e=>an(e).split("/").at(-1),"getSchemaNameByRef");function Nf(e){let t=zN(e).normalize("NFKD").trim().replace(/\s+/g,"_").replace(/--+/g,"-").replace(/-+/g,"_").replace(/[^\w-]+/g,"_");return me(t)}o(Nf,"normalizeString");function kf(e){return/^[a-zA-Z]\w*$/.test(e)?e:`"${e}"`}o(kf,"wrapWithQuotesIfNeeded");function ob(e){return typeof e=="string"&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}o(ob,"unwrapQuotesIfNeeded");function zN(e){let t=Number(e[0]);return typeof t=="number"&&!Number.isNaN(t)?"_"+e:e}o(zN,"prefixStringStartingWithNumberIfNeeded");function jf(e){let t=e.replaceAll("_","#");return me(t.replaceAll("-","_")).replaceAll("#","_")}o(jf,"pathParamToVariableName");var zt=o(e=>rb.includes(e),"isPrimitiveType");function sb(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(sb,"escapeControlCharacters");function Xe(e){return e.includes("application/")&&e.includes("json")||eb.includes(e)||e.includes("text/")}o(Xe,"isParamMediaTypeAllowed");function Ro(e){return e>=200&&e<300}o(Ro,"isMainResponseStatus");function Oa(e){return!(e>=200&&e<300)}o(Oa,"isErrorStatus");function mi(e){return e.startsWith("application/")}o(mi,"isMediaTypeAllowed");var nb=/({\w+})/g,KN=/[^\w\-]+/g;function ab(e){e=B(Io(e.replaceAll("/","-")).replaceAll("-",""));let t=[...e.matchAll(nb)];if(t.length>0){let r=t.sort((n,i)=>n.index-i.index)[t.length-1][0];e=`${e.replace(nb,"")}By${B(r.slice(1,-1))}`}return e.replace(KN,"_")}o(ab,"pathToVariableName");var Rf=/{(\b\w+(?:-\w+)*\b)}/g;function cb(e){let t=e.match(Rf);return t===null?e.replaceAll(Rf,":$1"):(t.forEach(r=>{let n=jf(r.replaceAll(Rf,":$1"));e=e.replaceAll(r,n)}),e)}o(cb,"replaceHyphenatedPath");var $a=o(e=>{let t=e["x-enumNames"],r=Array.isArray(t)&&t.length>0,n=!!e.schema&&he(e.schema)&&e.schema.type==="string";return r&&n},"isSortingParameterObject"),cn=o((e,t)=>t.excludePathRegex?new RegExp(t.excludePathRegex).test(e):!1,"isPathExcluded");function Kt(e){return Dv(e)}o(Kt,"formatTag");function wr(e,t){var n;let r=(n=e.tags)==null?void 0:n[0];return Kt(r??t.defaultTag)}o(wr,"getOperationTag");function De(e,t){var n;let r=t.splitByTags?(n=e.tags)==null?void 0:n[0]:t.defaultTag;return Kt(r??t.defaultTag)}o(De,"getEndpointTag");function ub(e,t){return t.excludeTags.some(r=>r.toLowerCase()===e.toLowerCase())}o(ub,"isTagExcluded");var xa={fileName:"acl/app.ability",extension:"ts"},No="AppAbilities",Aa={fileName:"acl/useAclCheck",extension:"ts"},Ir="useAclCheck",ge={abilityTuple:"AbilityTuple",pureAbility:"PureAbility",forcedSubject:"ForcedSubject",subjectType:"Subject",subject:"subject"},qf={bindings:[ge.abilityTuple,ge.pureAbility,ge.forcedSubject,ge.subjectType,ge.subject],from:"@casl/ability"};var ko="AppRestClient",wa={query:"AppQueryOptions",infiniteQuery:"AppInfiniteQueryOptions",mutation:"AppMutationOptions"},Mf="src/data",Tr={ErrorHandler:"ErrorHandler",SharedErrorHandler:"SharedErrorHandler"},Ia={bindings:[Tr.ErrorHandler,Tr.SharedErrorHandler]},Df="AbilityContext",lb={bindings:[Df]},jo={dynamicInputs:"dynamicInputs",dynamicColumns:"dynamicColumns"};var Ta={reactQueryTypes:{fileName:"react-query.types",extension:"ts"},restClient:{fileName:"rest-client",extension:"ts"},restInterceptor:{fileName:"rest-interceptor",extension:"ts"}},Ca={fileName:"app-rest-client",extension:"ts"},Lf="QueryModule",Ra={fileName:"queryModules",extension:"ts"},pb={fileName:"queryConfig.context",extension:"tsx"},hi={optionsType:"MutationEffectsOptions",hookName:"useMutationEffects",runFunctionName:"runMutationEffects"},Na={fileName:"useMutationEffects",extension:"ts"},et={namespace:"ZodExtended",exports:{parse:"parse",sortExp:"sortExp"}},ka={fileName:"zod.extended",extension:"ts"};var Ve=o((...e)=>[...new Set(e.flat())],"getUniqueArray");var qo=o(e=>`canUse${B(me(e.operationName))}`,"getAbilityFunctionName"),ja=o((e,t)=>`${t.tsNamespaces?`${V({type:"acl",tag:De(e,t),options:t})}.`:""}${qo(e)}`,"getImportedAbilityFunctionName"),Ff=o(e=>{var t;return(t=e.acl)==null?void 0:t[0].action},"getAbilityAction"),Hf=o(e=>{var t;return(t=e.acl)==null?void 0:t[0].subject},"getAbilitySubject"),Mo=o(e=>{var t;return!!((t=gi(e))!=null&&t.length)},"hasAbilityConditions"),gi=o(e=>{var t,r;return(r=(t=e.acl)==null?void 0:t[0].conditionsTypes)==null?void 0:r.sort((n,i)=>n.name.localeCompare(i.name))},"getAbilityConditionsTypes"),fb=o(e=>{var t;return(t=e.acl)==null?void 0:t[0].description},"getAbilityDescription"),Vf=o(e=>{var n;let t=Hf(e),r=[`"${t??""}"`];return Mo(e)&&r.push(`ForcedSubject<"${t}"> & { ${(n=gi(e))==null?void 0:n.map(i=>`${i.name}${i.required?"":"?"}: ${i.type??""}${i.zodSchemaName??""},`).join(" ")} }`),r},"getAbilitySubjectTypes");function Bf({resolver:e,data:t,tag:r}){var c;let n=(c=t.get(r))==null?void 0:c.endpoints.filter(({acl:u})=>u&&u.length>0);if(!n||n.length===0)return;let i=n.some(({acl:u})=>(u==null?void 0:u[0].conditions)&&Object.keys(u[0].conditions).length>0),s=n.reduce((u,l)=>{var p,d;let f=(d=(p=l.acl)==null?void 0:p[0].conditionsTypes)==null?void 0:d.reduce((m,g)=>[...m,...g!=null&&g.zodSchemaName?[g.zodSchemaName]:[]],[]);return[...u,...f??[]]},[]),a=Rt({resolver:e,tag:r,zodSchemasAsTypes:Ve(s)});return{endpoints:n,hasAdditionalAbilityImports:i,modelsImports:a}}o(Bf,"getAclData");var db=o(({resolver:e,data:t})=>{let r=new Map,n=[],i=!1;t.forEach((c,u)=>{let l=Bf({resolver:e,data:t,tag:u});if(!l)return;let{modelsImports:f,hasAdditionalAbilityImports:p,endpoints:d}=l;n.push(f),i=i||p,d.forEach(m=>{let g=Ff(m);g&&r.set(g,new Set([...r.get(g)??[],...Vf(m)]))})});let s=Do(e.options,...n);return{appAbilitiesType:r.size>0?Object.fromEntries(Array.from(r.entries()).map(([c,u])=>[c,Array.from(u)])):void 0,modelsImports:s,hasAdditionalAbilityImports:i}},"getAppAbilitiesType");function Te(e,t){if(!e)return;let{data:r,onSchema:n}=t;if(L(e)&&n({type:"reference",schema:e,data:r})===!0)return;let i=e;if(fi.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&&Te(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&&Te(a,t);if(i.additionalProperties&&typeof i.additionalProperties=="object"){if(n({type:"additionalProperties",parentSchema:e,schema:i.additionalProperties,data:r})===!0)return;Te(i.additionalProperties,t)}if(i.type==="array"){let s=e.items;if(n({type:"array",parentSchema:e,schema:s,data:r})===!0)return;Te(s,t)}}o(Te,"iterateSchema");var un=o((e,t)=>bf(B(Nf(e)),t),"getZodSchemaName"),Lo=o((e,t,r)=>bf(B(Nf(e)),`${t}${r}`),"getEnumZodSchemaName"),ne=o(e=>["z.",`${et.namespace}.`].every(t=>!e.startsWith(t)),"isNamedZodSchema"),mb=o(e=>e.startsWith(wo),"isEnumZodSchema"),ln=o((e,t,r)=>t?e:`${r}_${e}`,"getZodSchemaOperationName"),qa=o(e=>me(`${e}_${wv}`),"getBodyZodSchemaName"),hb=o((e,t)=>me(`${e}_${t}${Iv}`),"getParamZodSchemaName"),QN=o(e=>me(`${e}${Tv}`),"getMainResponseZodSchemaName"),WN=o((e,t)=>me(`${e}_${t}_${Cv}`),"getErrorResponseZodSchemaName");function Ma({statusCode:e,operationName:t,isUniqueOperationName:r,tag:n}){let i=Number(e),s=ln(t,r,n);return!Ro(i)&&e!=="default"&&Oa(i)?WN(s,e):QN(s)}o(Ma,"getResponseZodSchemaName");function Fo(e){return["minimum","exclusiveMinimum","maximum","exclusiveMaximum","minItems","minLength","minProperties","maxItems","maxLength","maxProperties","default","example"].filter(n=>e[n]).reduce((n,i)=>[...n,`${B(ga(i))}: \`${e[i]}\``],[])}o(Fo,"getSchemaDescriptions");var Ho=o((e,t)=>Lv(e,t.schemaSuffix),"getZodSchemaInferedTypeName"),pn=o((e,t)=>ne(t)?`${e.options.tsNamespaces?`${V({type:"models",tag:e.getTagByZodSchemaName(t),options:e.options})}.`:""}${t}`:t,"getImportedZodSchemaName"),Cr=o((e,t,r)=>{if(!ne(t))return t===Ao?"void":t;let n=e.getTagByZodSchemaName(t);return`${e.options.tsNamespaces&&n!==r?`${V({type:"models",tag:n,options:e.options})}.`:""}${Ho(t,e.options)}`},"getImportedZodSchemaInferedTypeName");function gb(e){var t;return e.isEnum?"enum":((t=e.schemaObj)==null?void 0:t.type)??"object"}o(gb,"getZodSchemaType");function yb(e){if(e.schemaObj)return[e.schemaObj.description,...Fo(e.schemaObj)].filter(Boolean).join(". ")}o(yb,"getZodSchemaDescription");function Sb(e,t,r){var n;if(L(t)){let i=e.getZodSchemaNameByRef(t.$ref);return i?Cr(e,i,r):void 0}if(_a(t)){if(!L(t.items))return`${((n=t.items)==null?void 0:n.type)??"unknown"}[]`;let i=e.getZodSchemaNameByRef(t.items.$ref);return i?`${Cr(e,i,r)}[]`:void 0}if(fi.some(i=>i in t&&t[i])){let i=t.allOf??t.anyOf??t.oneOf??[];if(i.length>0)return Sb(e,i[0],r)}return t.type}o(Sb,"getType");function vb(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,...Fo(f)].filter(Boolean),d=u.join(".");s[d]&&"type"in c.schema&&c.schema.type==="object"||(delete s[d],s[d]={type:Sb(e,c.schema,r)??"unknown",description:p.join(". ")})}return Te(c.schema,{data:{pathSegments:[...u]},onSchema:a}),!0},"onSchema");return"allOf"in t.schemaObj&&t.schemaObj.allOf&&t.schemaObj.allOf.forEach(c=>{if(L(c)){let u=e.resolveObject(c);Te(u,{data:{pathSegments:[]},onSchema:a})}}),Te(t.schemaObj,{data:{pathSegments:[]},onSchema:a}),s}o(vb,"getZodSchemaPropertyDescriptions");function Rt({resolver:e,tag:t,zodSchemas:r=[],zodSchemasAsTypes:n=[]}){let i="models",s=o(u=>e.getTagByZodSchemaName(u),"getTag"),a=yi({type:i,tag:t,entities:r,getTag:s,getEntityName:o(u=>u,"getEntityName"),options:e.options}),c=yi({type:i,tag:t,entities:n,getTag:s,getEntityName:o(u=>Ho(u,e.options),"getEntityName"),options:e.options});return Do(e.options,a,c)}o(Rt,"getModelsImports");function bb({tag:e,endpoints:t,options:r}){return yi({type:"endpoints",tag:e,entities:t,getTag:o(n=>De(n,r),"getTag"),getEntityName:Vo,options:r})}o(bb,"getEndpointsImports");function _b({tag:e,endpoints:t,options:r}){return yi({type:"queries",tag:e,entities:t,getTag:o(n=>De(n,r),"getTag"),getEntityName:fn,options:r})}o(_b,"getQueriesImports");function Eb({tag:e,endpoints:t,options:r}){return yi({type:"queries",tag:e,entities:t,getTag:o(n=>De(n,r),"getTag"),getEntityName:Bo,options:r})}o(Eb,"getInfiniteQueriesImports");function Da({tag:e,endpoints:t,options:r}){return yi({type:"acl",tag:e,entities:t,getTag:o(n=>De(n,r),"getTag"),getEntityName:qo,options:r})}o(Da,"getAclImports");function Qt(e){let t=e.tsPath;return e.importPath==="relative"?t="../":e.importPath==="absolute"?t=e.output:new RegExp(`${Mf}`,"g").test(e.output)&&(t=e.output.replace(new RegExp(`.*${Mf}`,"g"),e.tsPath)),`${t}/`.replace(/\/\//g,"/")}o(Qt,"getImportPath");function yi({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?V({type:e,tag:u,options:s}):i(c)],from:`${l?"./":Qt(s)}${Si({type:e,tag:u,includeTagDir:!l,options:s})}`})}}),Array.from(a.values())}o(yi,"getImports");function Do(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:Ve(n.bindings)}))}o(Do,"mergeImports");function dn({fileName:e,extension:t}){return`${e}.${t}`}o(dn,"getFileNameWithExtension");function Pb({type:e,tag:t,options:r,includeTagDir:n=!0}){let i=r.configs[e].outputFileNameSuffix;return t?`${n?`${br(t)}/`:""}${br(t)}.${i}`:i}o(Pb,"getTagFileNameWithoutExtension");function Si(...e){return Pb(...e)}o(Si,"getTagImportPath");function Ob(...e){return`${Pb(...e)}.ts`}o(Ob,"getTagFileName");function $b(e){return e.standalone?`${Qt(e)}${Ca.fileName}`:e.restClientImportPath}o($b,"getAppRestClientImportPath");function xb(e){return e.standalone?`${Qt(e)}${Ta.reactQueryTypes.fileName}`:e.queryTypesImportPath}o(xb,"getQueryTypesImportPath");function Ab(e){return`${Qt(e)}${Ra.fileName}`}o(Ab,"getQueryModulesImportPath");function wb(e){return`${Qt(e)}${Na.fileName}`}o(wb,"getMutationEffectsImportPath");function Ib(e){return`${Qt(e)}${Aa.fileName}`}o(Ib,"getAclCheckImportPath");function Tb(e){return`${Qt(e)}${ka.fileName}`}o(Tb,"getZodExtendedImportPath");function Cb(e){return`${Qt(e)}${xa.fileName}`}o(Cb,"getAppAbilitiesImportPath");function La(e){return $e(e).with("string",()=>"string").with("number",()=>"number").with("integer",()=>"number").with("boolean",()=>"boolean").exhaustive()}o(La,"primitiveTypeToTsType");function vi({zodSchemaName:e,schema:t,resolver:r}){let n="void",i;e&&ne(e)?(n=Cr(r,e),i=r.getTagByZodSchemaName(e)):t!=null&&t.type&&zt(t==null?void 0:t.type)&&(n=La(t==null?void 0:t.type));let s=n.split(".");return{type:s[s.length-1],...s.length>1?{namespace:s[0]}:{},...i?{importPath:Si({type:"models",tag:i,includeTagDir:!0,options:r.options})}:{}}}o(vi,"getTsTypeBase");function mn({schema:e,isCircular:t,parentTypes:r,resolver:n}){if(!e)return{metaType:"primitive"};for(let i of fi){let s=e[i];if(s)if(s.length>1){let a=s.map(c=>{let u=n.resolveObject(c);return mn({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:Rb({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:YN({schema:e,parentTypes:r,resolver:n})}:{metaType:"primitive"}}o(mn,"getSchemaTsMetaType");function Rb({arraySchema:e,parentTypes:t,resolver:r}){let n,i;if(L(e.items)){let u=e.items.$ref;n=r.getZodSchemaNameByRef(u),i=r.getSchemaByRef(u)}else i=e.items;let s=vi({zodSchemaName:n,schema:i,resolver:r}),a=Nb(s,t),c=mn({schema:i,isCircular:a,parentTypes:[...t,s],resolver:r});return{...s,...c}}o(Rb,"getArraySchemaTsType");function YN({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(L(i)){let c=r.getZodSchemaNameByRef(i.$ref),u=r.getSchemaByRef(i.$ref),l=vi({zodSchemaName:c,schema:u,resolver:r}),f=Nb(l,t),p=mn({schema:u,isCircular:f,parentTypes:[...t,l],resolver:r});return{name:n,isRequired:s,...l,...p}}else if(i.type==="array"){let c=Rb({arraySchema:i,parentTypes:t,resolver:r});return{name:n,isRequired:s,type:"array",metaType:"array",arrayType:c}}else if(zt(i.type))return{name:n,isRequired:s,type:La(i.type),metaType:"primitive"};return{name:n,isRequired:s,type:"void",metaType:"primitive"}})}o(YN,"getSchemaTsProperties");function Nb(e,t){return t.findIndex(({type:r,namespace:n})=>r===e.type&&n===e.namespace)>-1}o(Nb,"getIsCircular");var Vo=o(e=>br(me(e.operationName)),"getEndpointName");function jb(e,t){return`${t.tsNamespaces?`${V({type:"endpoints",tag:De(e,t),options:t})}.`:""}${Vo(e)}`}o(jb,"getImportedEndpointName");var qb=o(e=>e.method!==kb.OpenAPIV3.HttpMethods.GET,"requiresBody"),Rr=o(e=>e.parameters.find(t=>t.type==="Body"),"getEndpointBody"),Mb=o((e,t)=>{let r=Gf(e),n=t.options.axiosRequestConfig;return Object.keys(r).length>0||n},"hasEndpointConfig"),Db=o(e=>e.path.replace(/:([a-zA-Z0-9_]+)/g,"${$1}"),"getEndpointPath");function Nr(e,t,r){let n=t.parameters.map(i=>{var a,c,u,l;let s="string";if(ne(i.zodSchema))s=Cr(e,i.zodSchema);else if((a=i.parameterObject)!=null&&a.schema&&he(i.parameterObject.schema)){let f=(u=(c=i.parameterObject)==null?void 0:c.schema)==null?void 0:u.type;f&&zt(f)&&(s=La(f))}return{name:wt(i.name),type:s,paramType:i.type,required:((l=i.parameterObject)==null?void 0:l.required)??!0,parameterObject:i.parameterObject,bodyObject:i.bodyObject}});return r!=null&&r.includeFileParam&&t.mediaUpload&&n.push({name:"file",type:"File",paramType:"Body",required:!1,parameterObject:void 0,bodyObject:void 0}),n.sort((i,s)=>{if(i.required===s.required){let a=["Path","Body","Query","Header"];return a.indexOf(i.paramType)-a.indexOf(s.paramType)}return i.required?-1:1}).filter(i=>(!(r!=null&&r.excludeBodyParam)||i.name!==va)&&(!(r!=null&&r.excludePageParam)||i.name!==e.options.infiniteQueryParamNames.page)&&(!(r!=null&&r.includeOnlyRequiredParams)||i.required)).map(i=>({...i,name:r!=null&&r.replacePageParam&&i.name===e.options.infiniteQueryParamNames.page?"pageParam":i.name,required:i.required&&(i.paramType==="Path"||!(r!=null&&r.pathParamsRequiredOnly))}))}o(Nr,"mapEndpointParamsToFunctionParams");function Gf(e){let t=e.parameters.filter(i=>i.type==="Query").map(i=>{let s=Yv(i.name)?i.name:`"${i.name}"`,a=wt(i.name);return{...i,name:s,value:a}}),r={};return e.requestFormat!==Of["Content-Type"]&&(r["Content-Type"]=`'${e.requestFormat}'`),e.responseFormat&&e.responseFormat!==Of.Accept&&(r.Accept=`'${e.responseFormat}'`),e.parameters.filter(i=>i.type==="Header").forEach(i=>{r[i.name]=wt(i.name)}),{...t.length>0?{params:t}:{},...Object.keys(r).length?{headers:r}:{}}}o(Gf,"getEndpointConfig");function Lb(e,t){return t.filter(r=>Le(r)&&r.parameters.filter(n=>{var i;return(i=n.parameterObject)==null?void 0:i.required}).every(n=>e.parameters.some(i=>i.name===n.name))&&r.response===e.response)}o(Lb,"getUpdateQueryEndpoints");var Le=o(e=>Sa(e),"isQuery"),Nt=o(e=>!Sa(e)||!!e.mediaDownload,"isMutation"),bi=o((e,t)=>Ef(e,t),"isInfiniteQuery"),Fb=o((e,t,r)=>{let n=r.reduce((i,s)=>[...i,...Nr(e,s,{includeOnlyRequiredParams:!0}).map(a=>a.name)],[]);return Nr(e,t,{includeOnlyRequiredParams:!0,excludeBodyParam:!0}).filter(i=>n.includes(i.name)).map(i=>i.name)},"getDestructuredVariables");var fn=o((e,t)=>{let r=Le(e)&&Nt(e)&&t;return`use${B(me(e.operationName))}${r?"Mutation":""}`},"getQueryName"),Bo=o(e=>`use${B(me(e.operationName))}Infinite`,"getInfiniteQueryName"),hn=o((e,t)=>`${t.tsNamespaces?`${V({type:"queries",tag:De(e,t),options:t})}.`:""}${fn(e)}`,"getImportedQueryName"),Hb=o((e,t)=>`${t.tsNamespaces?`${V({type:"queries",tag:De(e,t),options:t})}.`:""}${Bo(e)}`,"getImportedInfiniteQueryName");function kt({schema:e,meta:t,options:r}){let n=[];$e(e.type).with("string",()=>n.push(ek(e))).with("number","integer",()=>n.push(rk(e))).with("array",()=>n.push(nk(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(JN({schema:e,meta:t,options:r}),r.withDefaultValues!==!1?XN(e):[]).filter(Boolean).join(".");return i?`.${i}`:""}o(kt,"getZodChain");function JN({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(JN,"getZodChainablePresence");function XN(e){return e.default!==void 0?`default(${$e(e.type).with("number","integer",()=>ob(e.default)).otherwise(()=>JSON.stringify(e.default))})`:""}o(XN,"getZodChainableDefault");function ek(e){let t=[];return 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(${tk(e.pattern)})`),t.join(".")}o(ek,"getZodChainableStringValidations");function tk(e){return e.startsWith("/")&&e.endsWith("/")&&(e=e.slice(1,-1)),e=sb(e),`/${e}/`}o(tk,"formatPatternIfNeeded");function rk(e){let t=[];return e.enum?"":(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(rk,"getZodChainableNumberValidations");function nk(e){let t=[];return e.minItems&&t.push(`min(${e.minItems})`),e.maxItems&&t.push(`max(${e.maxItems})`),t.join(".")}o(nk,"getZodChainableArrayValidations");var gn=o(e=>e.reduce((t,r)=>t+r,0),"sum");function le(e,t){if(!t)return e;if(L(t))return e+2;if(Array.isArray(t.type))return t.type.length===1?Be("oneOf")+le(e,{...t,type:t.type[0]}):e+Be("oneOf")+gn(t.type.map(r=>le(0,{...t,type:r})));if(t.oneOf)return t.oneOf.length===1?Be("oneOf")+le(e,t.oneOf[0]):e+Be("oneOf")+gn(t.oneOf.map(r=>le(0,r)));if(t.anyOf)return t.anyOf.length===1?Be("anyOf")+le(e,t.anyOf[0]):e+Be("anyOf")+gn(t.anyOf.map(r=>le(0,r)));if(t.allOf)return t.allOf.length===1?Be("allOf")+le(e,t.allOf[0]):e+Be("allOf")+gn(t.allOf.map(r=>le(0,r)));if(!t.type)return e;if(zt(t.type))return t.enum?e+Vb(t)+Be("enum")+gn(t.enum.map(r=>le(0,r))):e+Vb(t);if(t.type==="array")return t.items?Be("array")+le(e,t.items):Be("array")+le(e);if(t.type==="object"||t.properties||t.additionalProperties){if(t.properties){let r=Object.values(t.properties);e+=Be("object")+gn(r.map(n=>le(0,n)))}else e+=Be("empty-object");t.additionalProperties&&(typeof t.additionalProperties=="object"?e+=le(0,t.additionalProperties):e+=le(1))}return e}o(le,"getOpenAPISchemaComplexity");function Vb(e){return $e(e.type).with("string","number","integer","boolean",()=>1).otherwise(()=>0)}o(Vb,"complexityByType");function Be(e){return $e(e).with("oneOf",()=>2).with("anyOf",()=>3).with("allOf",()=>2).with("enum","array","empty-object",()=>1).with("object",()=>2).otherwise(()=>0)}o(Be,"complexityByComposite");var Zf=class Zf{constructor(t,r,n={referencedBy:[]},i){this.schema=t;this.resolver=r;L(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?`${V({type:"models",tag:i,options:r})}.${n}`:n}get complexity(){return le(0,this.schema)}assign(t){return this.code=t,this}inherit(t){return t&&t.children.push(this),this}};o(Zf,"ZodSchema");var Go=Zf;function Uf(e){var t,r;if(e)return(t=e.parent)!=null&&t.ref?e.parent.ref:Uf((r=e.parent)==null?void 0:r.meta)}o(Uf,"getParentRef");function Bb(e,t){let r=e.getRefByZodSchemaName(t);if(r){let i=Array.from(e.dependencyGraph.refsDependencyGraph[r]??[]).map(a=>e.getZodSchemaNameByRef(a)),s=e.getExtractedEnumZodSchemaNamesReferencedBySchemaRef(r);return[...i,...s]}let n=e.getCompositeZodSchemaByZodSchemaName(t);return n?Array.from(Fa(n)).map(i=>e.getZodSchemaNameByRef(i)):[]}o(Bb,"getZodSchemaRefs");function Fa(e,{skipObjectSchema:t=!1}={}){return e.children.reduce((n,i)=>{let s=i.ref??i.enumRef;return s&&n.add(s),i.children.length>0&&(!t||!he(i.schema)||i.schema.type!=="object")&&Fa(i).forEach(a=>n.add(a)),n},new Set)}o(Fa,"getSchemaRefs");function X({schema:e,resolver:t,meta:r,tag:n}){var g;let i=new Go(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(L(e))return ik({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});let c=sk({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(c)return c;let u=ok({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(u)return u;let l=ak({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(l)return l;let f=ck({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(f)return f;let p=uk({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(p)return p;let d=t.options.allReadonly?".readonly()":"";if(_a(e))return e.items?i.assign(`z.array(${X({...a,schema:e.items}).getCodeString(n,t.options)}${kt({schema:e.items,meta:{...s,isRequired:!0},options:t.options})})${d}`):i.assign(`z.array(${li})${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,S=t.options.withImplicitRequiredProps?!1:e.properties&&!((g=e.required)!=null&&g.length),v="{}";e.properties&&(v=`{ ${Object.entries(e.properties).map(([w,I])=>{var Dt;let Y={...s,isRequired:S?!0:y?(Dt=e.required)==null?void 0:Dt.includes(w):t.options.withImplicitRequiredProps,name:w,isParentPartial:S},Q=I;if(L(I)&&t&&(Q=t.getSchemaByRef(I.$ref),!Q))throw new Error(`Schema ${I.$ref} not found`);let j=X({...a,schema:I,meta:Y}),A=j.getCodeString(n,t.options)+kt({schema:Q,meta:Y,options:t.options}),ce=!1,Mt=Uf(r);return Mt&&(ce=[...L(I)?[I.$ref]:[],...Fa(j,{skipObjectSchema:!0})].some(Ze=>{var Qd;return(Qd=t.dependencyGraph.deepDependencyGraph[Ze])==null?void 0:Qd.has(Mt)})),[w,A,ce]}).map(([w,I,Y])=>Y?`get ${kf(w)}() { return ${I} }`:`${kf(w)}: ${I}`).join(", ")} }`);let b="";e.additionalProperties&&(b=`.catchall(${typeof e.additionalProperties=="object"&&Object.keys(e.additionalProperties).length>0?X({...a,schema:e.additionalProperties}).getCodeString(n,t.options)+kt({schema:e.additionalProperties,meta:{...s,isRequired:!0},options:t.options}):li})`);let P=`z.object(${v})${S?".partial()":""}${b}${d}`;return i.assign(P)}if(m==="any")return i.assign(li);if(!m)return i.assign("z.unknown()");throw new Error(`Unsupported schema type: ${m}`)}o(X,"getZodSchema");function ik({schema:e,zodSchema:t,resolver:r,meta:n,tag:i}){if(!L(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=X({schema:u,resolver:r,meta:n,tag:i}).getCodeString(i,r.options)}return r.getCodeByZodSchemaName(a)||r.setZodSchema(a,c,i),t}o(ik,"getReferenceZodSchema");function ok({schema:e,zodSchema:t,resolver:r,meta:n,tag:i}){var a;if(!he(e)||!e.oneOf)return;if(e.oneOf.length===1){let c=X({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=>he(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=>X({schema:u,resolver:r,meta:n,tag:i}).getCodeString(i,r.options)).join(", ")}])
|