@povio/openapi-codegen-cli 0.13.3 → 0.13.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/index.js +2 -2
- package/dist/sh.js +39 -39
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -51,10 +51,10 @@ yarn openapi-codegen generate --input http://localhost:3001/docs-json --standalo
|
|
|
51
51
|
--axiosRequestConfig Include Axios request config parameters in query hooks (default: false)
|
|
52
52
|
--infiniteQueries Generate infinite queries for paginated API endpoints (default: false)
|
|
53
53
|
--mutationEffects Add mutation effects options to mutation hooks (default: true)
|
|
54
|
-
--parseRequestParams Add Zod parsing to API endpoints (default:
|
|
54
|
+
--parseRequestParams Add Zod parsing to API endpoints (default: true)
|
|
55
55
|
|
|
56
56
|
--acl Generate ACL related files (default: true)
|
|
57
|
-
--checkAcl Add ACL check to queries (default:
|
|
57
|
+
--checkAcl Add ACL check to queries (default: true)
|
|
58
58
|
|
|
59
59
|
--standalone Generate any missing supporting classes/types, e.g., REST client class, React Query type extensions, etc. (default: false)
|
|
60
60
|
--baseUrl (Requires `--standalone`) Base URL for the REST client; falls back to the OpenAPI spec if not provided
|
package/dist/index.js
CHANGED
|
@@ -69,9 +69,9 @@ Expecting `+gn.join(", ")+", got '"+(this.terminals_[E]||E)+"'":lc="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(fq(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:vi,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 yi||(t=this.source.wrap(t)),this.inlineStack.push(t),t},"push"),pushStackLiteral:o(function(t){this.push(new yi(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 yi)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 yi)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 yi)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 yi?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=vi.RESERVED_WORDS={},r=0,n=e.length;r<n;r++)t[e[r]]=!0})();vi.isValidJavaScriptVariableName=function(e){return!vi.RESERVED_WORDS[e]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(e)};function fq(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(fq,"strictLookup");sc.default=vi;yP.exports=sc.default});var _P=h((ac,bP)=>{"use strict";ac.__esModule=!0;function Zo(e){return e&&e.__esModule?e:{default:e}}o(Zo,"_interopRequireDefault");var dq=P_(),mq=Zo(dq),hq=Zf(),gq=Zo(hq),gd=j_(),yd=L_(),yq=vP(),vq=Zo(yq),Sq=Ya(),bq=Zo(Sq),_q=Vf(),Pq=Zo(_q),Eq=mq.default.create;function SP(){var e=Eq();return e.compile=function(t,r){return yd.compile(t,r,e)},e.precompile=function(t,r){return yd.precompile(t,r,e)},e.AST=gq.default,e.Compiler=yd.Compiler,e.JavaScriptCompiler=vq.default,e.Parser=gd.parser,e.parse=gd.parse,e.parseWithoutProcessing=gd.parseWithoutProcessing,e}o(SP,"create");var Si=SP();Si.create=SP;Pq.default(Si);Si.Visitor=bq.default;Si.default=Si;ac.default=Si;bP.exports=ac.default});var PP=h(cc=>{"use strict";cc.__esModule=!0;cc.print=Aq;cc.PrintVisitor=Y;function $q(e){return e&&e.__esModule?e:{default:e}}o($q,"_interopRequireDefault");var Oq=Ya(),xq=$q(Oq);function Aq(e){return new Y().accept(e)}o(Aq,"print");function Y(){this.padding=0}o(Y,"PrintVisitor");Y.prototype=new xq.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 Qt=h((tB,OP)=>{var uc=_P().default,$P=PP();uc.PrintVisitor=$P.PrintVisitor;uc.print=$P.print;OP.exports=uc;function EP(e,t){var r=require("fs"),n=r.readFileSync(t,"utf8");e.exports=uc.compile(n)}o(EP,"extension");typeof require<"u"&&require.extensions&&(require.extensions[".handlebars"]=EP,require.extensions[".hbs"]=EP)});var P3={};oE(P3,{getGenerateFilesData:()=>_3,getGenerateMetadata:()=>b3});module.exports=sE(P3);var _d=et(Yv());var fo="AppRestClient",Xs={query:"AppQueryOptions",infiniteQuery:"AppInfiniteQueryOptions",mutation:"AppMutationOptions"},ef="src/data",tf="@/data",Yr={appRestClient:{template:"@/util/rest/clients/app-rest-client",monorepoTemplate:"@/clients/app-rest-client"},queryTypes:{template:"@/types/react-query",monorepoTemplate:"@povio/utils/types/react-query"},errorHandling:{template:"@/util/vendor/error-handling",monorepoTemplate:"@povio/utils/vendor/error-handling"},abilityContext:{template:"@/data/acl/ability.context",monorepoTemplate:"@povio/auth/acl/ability.context"}},mr={ErrorHandler:"ErrorHandler",SharedErrorHandler:"SharedErrorHandler"},ea={bindings:[mr.ErrorHandler,mr.SharedErrorHandler],from:Yr.errorHandling.template},rf="AbilityContext",Jv={bindings:[rf],from:Yr.abilityContext.template};var ta={reactQueryTypes:{fileName:"react-query.types",extension:"ts"},restClient:{fileName:"rest-client",extension:"ts"},restInterceptor:{fileName:"rest-interceptor",extension:"ts"}},ra={fileName:"app-rest-client",extension:"ts"},nf="QueryModule",na={fileName:"queryModules",extension:"ts"},Xv={fileName:"queryConfig.context",extension:"tsx"},ti={optionsType:"MutationEffectsOptions",hookName:"useMutationEffects",runFunctionName:"runMutationEffects"},ia={fileName:"useMutationEffects",extension:"ts"},Ot={name:"zod",properties:{sortingString:"sortingString",parse:"parse"}},oa={fileName:"zod",extension:"ts"};var eS="Schema",tS="Enum",rS="Body",nS="Param",iS="Response",oS="ErrorResponse",mo="z.void()",sa="z.instanceof(Blob)",ho="z.enum",aa="z.string()",ri={bindings:["z"],from:"zod"};var go={input:"",output:"output",splitByTags:!0,defaultTag:"Common",excludeTags:[],excludePathRegex:"",excludeRedundantZodSchemas:!0,tsNamespaces:!0,importPath:"ts",configs:{models:{outputFileNameSuffix:"models",namespaceSuffix:"Models"},endpoints:{outputFileNameSuffix:"api",namespaceSuffix:"Api"},queries:{outputFileNameSuffix:"queries",namespaceSuffix:"Queries"},acl:{outputFileNameSuffix:"acl",namespaceSuffix:"Acl"}},acl:!0,checkAcl:!1,standalone:!1,baseUrl:"",abilityContextImportPath:Yr.abilityContext.template,schemaSuffix:eS,enumSuffix:tS,withDefaultValues:!0,extractEnums:!0,branded:!0,replaceOptionalWithNullish:!1,restClientImportPath:Yr.appRestClient.template,errorHandlingImportPath:Yr.errorHandling.template,removeOperationPrefixEndingWith:"Controller_",parseRequestParams:!1,queryTypesImportPath:Yr.queryTypes.template,axiosRequestConfig:!1,infiniteQueries:!1,mutationEffects:!0};var ft={query:"useQuery",infiniteQuery:"useInfiniteQuery",mutation:"useMutation"},sS={bindings:[ft.query,ft.infiniteQuery,ft.mutation],from:"@tanstack/react-query"},yo={pageParamName:"page"},ca={pageParamName:"page",totalItemsName:"totalItems",limitParamName:"limit"},vo="moduleName";var of={"Content-Type":"application/json",Accept:"application/json"},ua="data",sf="axios",hr="config",xt="AxiosRequestConfig",la={defaultImport:sf,bindings:[xt],from:"axios"};var aS=o(e=>/^(?:[a-zA-Z_$][a-zA-Z0-9_$]*|[0-9]+)$/.test(e),"isValidPropertyName"),At=o(e=>e.replace(/^[^a-zA-Z_$]*/g,"").replace(/[^a-zA-Z0-9_$]+(\w)?/g,(t,r)=>(r==null?void 0:r.toUpperCase())??""),"invalidVariableNameCharactersToCamel");function D(e){return e!=null&&Object.prototype.hasOwnProperty.call(e,"$ref")}o(D,"isReferenceObject");function Oe(e){return!D(e)}o(Oe,"isSchemaObject");function pa(e){return e.type==="array"}o(pa,"isArraySchemaObject");function cS(e){if(!e.allOf)throw new Error("Function inferRequiredSchema is specialized to handle item with required only in an allOf array.");let[t,r]=e.allOf.reduce((i,s)=>{if(tC(s)){let a=s.required;i[0].push(...a??[])}else i[1].push(s);return i},[[],[]]),n={properties:t.reduce((i,s)=>(i[s]={},i),{}),type:"object",required:t};return{noRequiredOnlyAllof:r,composedRequiredSchema:n,patchRequiredSchemaInLoop:o((i,s)=>{if(D(i)){let a=s(i.$ref);a&&n.required.forEach(c=>{var u;n.properties[c]=((u=a==null?void 0:a.properties)==null?void 0:u[c])??{}})}else{let a=i.properties??{};n.required.forEach(c=>{a[c]&&(n.properties[c]=a[c]??{})})}},"patchRequiredSchemaInLoop")}}o(cS,"inferRequiredSchema");var tC=o(e=>!D(e)&&!!e.required&&!e.type&&!e.properties&&!(e!=null&&e.allOf)&&!(e!=null&&e.anyOf)&&!e.oneOf,"isBrokenAllOfItem");var Vt=Symbol.for("@ts-pattern/matcher"),rC=Symbol.for("@ts-pattern/isVariadic"),da="@ts-pattern/anonymous-select-key",af=o(e=>!!(e&&typeof e=="object"),"r"),fa=o(e=>e&&!!e[Vt],"i"),Tt=o((e,t,r)=>{if(fa(e)){let n=e[Vt](),{matched:i,selections:s}=n.match(t);return i&&s&&Object.keys(s).forEach(a=>r(a,s[a])),i}if(af(e)){if(!af(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];fa(c)&&c[rC]?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)=>Tt(l,a[f],r))&&i.every((l,f)=>Tt(l,c[f],r))&&(s.length===0||Tt(s[0],u,r))}return e.length===t.length&&e.every((a,c)=>Tt(a,t[c],r))}return Reflect.ownKeys(e).every(n=>{let i=e[n];return(n in t||fa(s=i)&&s[Vt]().matcherType==="optional")&&Tt(i,t[n],r);var s})}return Object.is(t,e)},"s"),br=o(e=>{var t,r,n;return af(e)?fa(e)?(t=(r=(n=e[Vt]()).getSelectionKeys)==null?void 0:r.call(n))!=null?t:[]:Array.isArray(e)?bo(e,br):bo(Object.values(e),br):[]},"o"),bo=o((e,t)=>e.reduce((r,n)=>r.concat(t(n)),[]),"c");function Qe(e){return Object.assign(e,{optional:o(()=>nC(e),"optional"),and:o(t=>z(e,t),"and"),or:o(t=>iC(e,t),"or"),select:o(t=>t===void 0?uS(e):uS(t,e),"select")})}o(Qe,"u");function nC(e){return Qe({[Vt]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return t===void 0?(br(e).forEach(i=>n(i,void 0)),{matched:!0,selections:r}):{matched:Tt(e,t,n),selections:r}},"match"),getSelectionKeys:o(()=>br(e),"getSelectionKeys"),matcherType:"optional"})})}o(nC,"h");function z(...e){return Qe({[Vt]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return{matched:e.every(i=>Tt(i,t,n)),selections:r}},"match"),getSelectionKeys:o(()=>bo(e,br),"getSelectionKeys"),matcherType:"and"})})}o(z,"m");function iC(...e){return Qe({[Vt]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return bo(e,br).forEach(i=>n(i,void 0)),{matched:e.some(i=>Tt(i,t,n)),selections:r}},"match"),getSelectionKeys:o(()=>bo(e,br),"getSelectionKeys"),matcherType:"or"})})}o(iC,"d");function L(e){return{[Vt]:()=>({match:o(t=>({matched:!!e(t)}),"match")})}}o(L,"p");function uS(...e){let t=typeof e[0]=="string"?e[0]:void 0,r=e.length===2?e[1]:typeof e[0]=="string"?void 0:e[0];return Qe({[Vt]:()=>({match:o(n=>{let i={[t??da]:n};return{matched:r===void 0||Tt(r,n,(s,a)=>{i[s]=a}),selections:i}},"match"),getSelectionKeys:o(()=>[t??da].concat(r===void 0?[]:br(r)),"getSelectionKeys")})})}o(uS,"y");function wt(e){return typeof e=="number"}o(wt,"v");function gr(e){return typeof e=="string"}o(gr,"b");function yr(e){return typeof e=="bigint"}o(yr,"w");var G8=Qe(L(function(e){return!0}));var vr=o(e=>Object.assign(Qe(e),{startsWith:o(t=>{return vr(z(e,(r=t,L(n=>gr(n)&&n.startsWith(r)))));var r},"startsWith"),endsWith:o(t=>{return vr(z(e,(r=t,L(n=>gr(n)&&n.endsWith(r)))));var r},"endsWith"),minLength:o(t=>vr(z(e,(r=>L(n=>gr(n)&&n.length>=r))(t))),"minLength"),length:o(t=>vr(z(e,(r=>L(n=>gr(n)&&n.length===r))(t))),"length"),maxLength:o(t=>vr(z(e,(r=>L(n=>gr(n)&&n.length<=r))(t))),"maxLength"),includes:o(t=>{return vr(z(e,(r=t,L(n=>gr(n)&&n.includes(r)))));var r},"includes"),regex:o(t=>{return vr(z(e,(r=t,L(n=>gr(n)&&!!n.match(r)))));var r},"regex")}),"j"),Z8=vr(L(gr)),It=o(e=>Object.assign(Qe(e),{between:o((t,r)=>It(z(e,((n,i)=>L(s=>wt(s)&&n<=s&&i>=s))(t,r))),"between"),lt:o(t=>It(z(e,(r=>L(n=>wt(n)&&n<r))(t))),"lt"),gt:o(t=>It(z(e,(r=>L(n=>wt(n)&&n>r))(t))),"gt"),lte:o(t=>It(z(e,(r=>L(n=>wt(n)&&n<=r))(t))),"lte"),gte:o(t=>It(z(e,(r=>L(n=>wt(n)&&n>=r))(t))),"gte"),int:o(()=>It(z(e,L(t=>wt(t)&&Number.isInteger(t)))),"int"),finite:o(()=>It(z(e,L(t=>wt(t)&&Number.isFinite(t)))),"finite"),positive:o(()=>It(z(e,L(t=>wt(t)&&t>0))),"positive"),negative:o(()=>It(z(e,L(t=>wt(t)&&t<0))),"negative")}),"x"),z8=It(L(wt)),Sr=o(e=>Object.assign(Qe(e),{between:o((t,r)=>Sr(z(e,((n,i)=>L(s=>yr(s)&&n<=s&&i>=s))(t,r))),"between"),lt:o(t=>Sr(z(e,(r=>L(n=>yr(n)&&n<r))(t))),"lt"),gt:o(t=>Sr(z(e,(r=>L(n=>yr(n)&&n>r))(t))),"gt"),lte:o(t=>Sr(z(e,(r=>L(n=>yr(n)&&n<=r))(t))),"lte"),gte:o(t=>Sr(z(e,(r=>L(n=>yr(n)&&n>=r))(t))),"gte"),positive:o(()=>Sr(z(e,L(t=>yr(t)&&t>0))),"positive"),negative:o(()=>Sr(z(e,L(t=>yr(t)&&t<0))),"negative")}),"A"),K8=Sr(L(yr)),Q8=Qe(L(function(e){return typeof e=="boolean"})),W8=Qe(L(function(e){return typeof e=="symbol"})),Y8=Qe(L(function(e){return e==null})),J8=Qe(L(function(e){return e!=null}));var pf=class pf 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(pf,"W");var cf=pf,uf={matched:!1,value:void 0};function Se(e){return new lf(e,uf)}o(Se,"z");var So=class So{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=>Tt(l,this.input,c))||i&&!i(this.input)?uf:{matched:!0,value:r(s?da in a?a[da]:a:this.input,this.input)};return new So(this.input,u)}when(t,r){if(this.state.matched)return this;let n=!!t(this.input);return new So(this.input,n?{matched:!0,value:r(this.input,this.input)}:uf)}otherwise(t){return this.state.matched?this.state.value:t(this.input)}exhaustive(){if(this.state.matched)return this.state.value;throw new cf(this.input)}run(){return this.exhaustive()}returnType(){return this}};o(So,"I");var lf=So;var ff=2,lS=["application/octet-stream","multipart/form-data","application/x-www-form-urlencoded","*/*"],pS=["query","header","path"],Jr=["get","put","post","delete","options","head","patch","trace"],fS=["string","number","integer","boolean"],ni=["allOf","anyOf","oneOf"];var U=o(e=>e.charAt(0).toUpperCase()+e.slice(1),"capitalize"),_r=o(e=>e.charAt(0).toLowerCase()+e.slice(1),"decapitalize"),dS=o(e=>e.replace(/(-\w)/g,t=>t[1].toUpperCase()),"kebabToCamel"),ae=o(e=>e.replace(/(_\w)/g,t=>t[1].toUpperCase()),"snakeToCamel"),mS=o(e=>e.replace(/[\W_]+(\w)?/g,(t,r)=>(r==null?void 0:r.toUpperCase())??""),"nonWordCharactersToCamel"),df=o((e,t="")=>e.endsWith(t)?e:`${e}${t}`,"suffixIfNeeded"),hS=o((e,t)=>e.replace(new RegExp(`${t}$`),""),"removeSuffix"),oC=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"),mf=o(e=>{let t=e.map(U).map(gS).map(r=>sC(r)).flat();return oC(t)},"getMostCommonAdjacentCombinationSplit"),gS=o(e=>e.split(/(?<![A-Z])(?=[A-Z])/).filter(Boolean),"splitByUppercase"),yS=o(e=>gS(e).join(" "),"camelToSpaceSeparated"),sC=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"),vS=o((e,t)=>{let r=t.replace(/es$|s$/g,""),n=new RegExp(`(${_r(r)}|${U(r)})[a-z]*(?=$|[A-Z])`,"g");return e.replace(n,"")},"removeWord");var bS=o(e=>`#/components/schemas/${e}`,"getSchemaRef"),Xr=o(e=>e[1]==="/"?e:"#/"+e.slice(1),"autocorrectRef"),ii=o(e=>Xr(e).split("/").at(-1),"getSchemaNameByRef");function gf(e){let t=aC(e).normalize("NFKD").trim().replace(/\s+/g,"_").replace(/--+/g,"-").replace(/-+/g,"_").replace(/[^\w-]+/g,"_");return ae(t)}o(gf,"normalizeString");function _S(e){return/^[a-zA-Z]\w*$/.test(e)?e:`"${e}"`}o(_S,"wrapWithQuotesIfNeeded");function PS(e){return typeof e=="string"&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}o(PS,"unwrapQuotesIfNeeded");function aC(e){let t=Number(e[0]);return typeof t=="number"&&!Number.isNaN(t)?"_"+e:e}o(aC,"prefixStringStartingWithNumberIfNeeded");function yf(e){let t=e.replaceAll("_","#");return ae(t.replaceAll("-","_")).replaceAll("#","_")}o(yf,"pathParamToVariableName");var Bt=o(e=>fS.includes(e),"isPrimitiveType");function ES(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(ES,"escapeControlCharacters");function We(e){return e.includes("application/")&&e.includes("json")||lS.includes(e)||e.includes("text/")}o(We,"isParamMediaTypeAllowed");function _o(e){return e>=200&&e<300}o(_o,"isMainResponseStatus");function ma(e){return!(e>=200&&e<300)}o(ma,"isErrorStatus");function oi(e){return e.startsWith("application/")}o(oi,"isMediaTypeAllowed");var SS=/({\w+})/g,cC=/[^\w\-]+/g;function $S(e){e=U(dS(e.replaceAll("/","-")).replaceAll("-",""));let t=[...e.matchAll(SS)];if(t.length>0){let r=t.sort((n,i)=>n.index-i.index)[t.length-1][0];e=`${e.replace(SS,"")}By${U(r.slice(1,-1))}`}return e.replace(cC,"_")}o($S,"pathToVariableName");var hf=/{(\b\w+(?:-\w+)*\b)}/g;function OS(e){let t=e.match(hf);return t===null?e.replaceAll(hf,":$1"):(t.forEach(r=>{let n=yf(r.replaceAll(hf,":$1"));e=e.replaceAll(r,n)}),e)}o(OS,"replaceHyphenatedPath");var xS=o(e=>{let t=e["x-enumNames"],r=Array.isArray(t)&&t.length>0,n=!!e.schema&&Oe(e.schema)&&e.schema.type==="string";return r&&n},"isSortingParameterObject"),en=o((e,t)=>t.excludePathRegex?new RegExp(t.excludePathRegex).test(e):!1,"isPathExcluded");function Rt(e){return mS(e)}o(Rt,"formatTag");function Pr(e,t){var n;let r=(n=e.tags)==null?void 0:n[0];return Rt(r??t.defaultTag)}o(Pr,"getOperationTag");function AS(e,t){return t.excludeTags.some(r=>r.toLowerCase()===e.toLowerCase())}o(AS,"isTagExcluded");var ha={fileName:"acl/app.ability",extension:"ts"},Po="AllAbilities",Eo="AppAbilities",ga={fileName:"acl/useAclCheck",extension:"ts"},Er="useAclCheck",xe={abilityTuple:"AbilityTuple",pureAbility:"PureAbility",forcedSubject:"ForcedSubject",subject:"Subject"},vf={bindings:[xe.abilityTuple,xe.pureAbility,xe.forcedSubject,xe.subject],from:"@casl/ability"};var Fe=o((...e)=>[...new Set(e.flat())],"getUniqueArray");function Ae(e,t){if(!e)return;let{data:r,onSchema:n}=t;if(D(e)&&n({type:"reference",schema:e,data:r})===!0)return;let i=e;if(ni.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&&Ae(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&&Ae(a,t);if(i.additionalProperties&&typeof i.additionalProperties=="object"){if(n({type:"additionalProperties",parentSchema:e,schema:i.additionalProperties,data:r})===!0)return;Ae(i.additionalProperties,t)}if(i.type==="array"){let s=e.items;if(n({type:"array",parentSchema:e,schema:s,data:r})===!0)return;Ae(s,t)}}o(Ae,"iterateSchema");var Nt=o((e,t)=>df(U(gf(e)),t),"getZodSchemaName"),$o=o((e,t,r)=>df(U(gf(e)),`${t}${r}`),"getEnumZodSchemaName"),pe=o(e=>!e.startsWith("z."),"isNamedZodSchema"),wS=o(e=>e.startsWith(ho),"isEnumZodSchema"),tn=o((e,t,r)=>t?e:`${r}_${e}`,"getZodSchemaOperationName"),ya=o(e=>ae(`${e}_${rS}`),"getBodyZodSchemaName"),IS=o((e,t)=>ae(`${e}_${t}${nS}`),"getParamZodSchemaName"),uC=o(e=>ae(`${e}${iS}`),"getMainResponseZodSchemaName"),lC=o((e,t)=>ae(`${e}_${t}_${oS}`),"getErrorResponseZodSchemaName");function va({statusCode:e,operationName:t,isUniqueOperationName:r,tag:n}){let i=Number(e),s=tn(t,r,n);return!_o(i)&&e!=="default"&&ma(i)?lC(s,e):uC(s)}o(va,"getResponseZodSchemaName");function Oo(e){return["minimum","exclusiveMinimum","maximum","exclusiveMaximum","minItems","minLength","minProperties","maxItems","maxLength","maxProperties","default","example"].filter(n=>e[n]).reduce((n,i)=>[...n,`${U(yS(i))}: \`${e[i]}\``],[])}o(Oo,"getSchemaDescriptions");var xo=o((e,t)=>hS(e,t.schemaSuffix),"getZodSchemaInferedTypeName"),TS=o((e,t)=>pe(t)?`${e.options.tsNamespaces?`${G({type:"models",tag:e.getTagByZodSchemaName(t),options:e.options})}.`:""}${t}`:t,"getImportedZodSchemaName"),$r=o((e,t,r)=>{if(!pe(t))return t===mo?"void":t;let n=e.getTagByZodSchemaName(t);return`${e.options.tsNamespaces&&n!==r?`${G({type:"models",tag:n,options:e.options})}.`:""}${xo(t,e.options)}`},"getImportedZodSchemaInferedTypeName");function RS(e){var t;return e.isEnum?"enum":((t=e.schemaObj)==null?void 0:t.type)??"object"}o(RS,"getZodSchemaType");function NS(e){if(e.schemaObj)return[e.schemaObj.description,...Oo(e.schemaObj).join(". ")].filter(Boolean)}o(NS,"getZodSchemaDescription");function CS(e,t,r){var n;if(D(t)){let i=e.getZodSchemaNameByRef(t.$ref);return i?$r(e,i,r):void 0}if(pa(t)){if(!D(t.items))return`${((n=t.items)==null?void 0:n.type)??"unknown"}[]`;let i=e.getZodSchemaNameByRef(t.items.$ref);return i?`${$r(e,i,r)}[]`:void 0}if(ni.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 kS(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,...Oo(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 Ae(c.schema,{data:{pathSegments:[...u]},onSchema:a}),!0},"onSchema");return"allOf"in t.schemaObj&&t.schemaObj.allOf&&t.schemaObj.allOf.forEach(c=>{if(D(c)){let u=e.resolveObject(c);Ae(u,{data:{pathSegments:[]},onSchema:a})}}),Ae(t.schemaObj,{data:{pathSegments:[]},onSchema:a}),s}o(kS,"getZodSchemaPropertyDescriptions");function Or({resolver:e,tag:t,zodSchemas:r=[],zodSchemasAsTypes:n=[]}){let i="models",s=o(u=>e.getTagByZodSchemaName(u),"getTag"),a=Sf({type:i,tag:t,entities:r,getTag:s,getEntityName:o(u=>u,"getEntityName"),options:e.options}),c=Sf({type:i,tag:t,entities:n,getTag:s,getEntityName:o(u=>xo(u,e.options),"getEntityName"),options:e.options});return pC(e.options,a,c)}o(Or,"getModelsImports");function jS({tag:e,endpoints:t,options:r}){return Sf({type:"endpoints",tag:e,entities:t,getTag:o(n=>wo(n,r),"getTag"),getEntityName:Ao,options:r})}o(jS,"getEndpointsImports");function qS({tags:e,entityName:t,getAliasEntityName:r,type:n,options:i}){let s=new Map;return e.forEach(a=>{let c=`${t}${r?` as ${r(a)}`:""}`;s.has(a)?i.tsNamespaces||s.get(a).bindings.push(c):s.set(a,{bindings:[i.tsNamespaces?G({type:n,tag:a,options:i}):c],from:`${Ut(i)}${rn({type:n,tag:a,includeTagDir:!0,options:i})}`})}),Array.from(s.values())}o(qS,"getEntityImports");function Ut(e){let t=tf;return e.importPath==="relative"?t="../":e.importPath==="absolute"?t=e.output:new RegExp(`${ef}`,"g").test(e.output)&&(t=e.output.replace(new RegExp(`.*${ef}`,"g"),tf)),`${t}/`.replace(/\/\//g,"/")}o(Ut,"getImportPath");function Sf({type:e="models",tag:t,entities:r,getTag:n,getEntityName:i,options:s}){let a=new Map;return r.forEach(c=>{let u=n(c);if(a.has(u))s.tsNamespaces||a.get(u).bindings.push(i(c));else{let l=t===u;a.set(u,{bindings:[s.tsNamespaces?G({type:e,tag:u,options:s}):i(c)],from:`${l?"./":Ut(s)}${rn({type:e,tag:u,includeTagDir:!l,options:s})}`})}}),Array.from(a.values())}o(Sf,"getImports");function pC(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:Fe(n.bindings)}))}o(pC,"mergeImports");function nn({fileName:e,extension:t}){return`${e}.${t}`}o(nn,"getFileNameWithExtension");function MS({type:e,tag:t,options:r,includeTagDir:n=!0}){let i=r.configs[e].outputFileNameSuffix;return t?`${n?`${_r(t)}/`:""}${_r(t)}.${i}`:i}o(MS,"getTagFileNameWithoutExtension");function rn(...e){return MS(...e)}o(rn,"getTagImportPath");function DS(...e){return`${MS(...e)}.ts`}o(DS,"getTagFileName");var G=o(({type:e,tag:t,options:r})=>`${U(t)}${r.configs[e].namespaceSuffix}`,"getNamespaceName");function LS(e){return e.standalone?`${Ut(e)}${ra.fileName}`:e.restClientImportPath}o(LS,"getAppRestClientImportPath");function FS(e){return e.standalone?`${Ut(e)}${ta.reactQueryTypes.fileName}`:e.queryTypesImportPath}o(FS,"getQueryTypesImportPath");function HS(e){return`${Ut(e)}${na.fileName}`}o(HS,"getQueryModulesImportPath");function VS(e){return`${Ut(e)}${ia.fileName}`}o(VS,"getMutationEffectsImportPath");function BS(e){return`${Ut(e)}${ga.fileName}`}o(BS,"getAclCheckImportPath");function US(e){return`${Ut(e)}${oa.fileName}`}o(US,"getZodExtendedImportPath");function GS(){return`./${ha.fileName}`}o(GS,"getAppAbilitiesImportPath");function Sa(e){return Se(e).with("string",()=>"string").with("number",()=>"number").with("integer",()=>"number").with("boolean",()=>"boolean").exhaustive()}o(Sa,"primitiveTypeToTsType");function si({zodSchemaName:e,schema:t,resolver:r}){let n="void",i;e&&pe(e)?(n=$r(r,e),i=r.getTagByZodSchemaName(e)):t!=null&&t.type&&Bt(t==null?void 0:t.type)&&(n=Sa(t==null?void 0:t.type));let s=n.split(".");return{type:s[s.length-1],...s.length>1?{namespace:s[0]}:{},...i?{importPath:rn({type:"models",tag:i,includeTagDir:!0,options:r.options})}:{}}}o(si,"getTsTypeBase");function on({schema:e,isCircular:t,parentTypes:r,resolver:n}){if(!e)return{metaType:"primitive"};for(let i of ni){let s=e[i];if(s)if(s.length>1){let a=s.map(c=>{let u=n.resolveObject(c);return on({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:ZS({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:fC({schema:e,parentTypes:r,resolver:n})}:{metaType:"primitive"}}o(on,"getSchemaTsMetaType");function ZS({arraySchema:e,parentTypes:t,resolver:r}){let n,i;if(D(e.items)){let u=e.items.$ref;n=r.getZodSchemaNameByRef(u),i=r.getSchemaByRef(u)}else i=e.items;let s=si({zodSchemaName:n,schema:i,resolver:r}),a=zS(s,t),c=on({schema:i,isCircular:a,parentTypes:[...t,s],resolver:r});return{...s,...c}}o(ZS,"getArraySchemaTsType");function fC({schema:e,parentTypes:t,resolver:r}){return Object.entries((e==null?void 0:e.properties)??{}).map(([n,i])=>{var a;let s=((a=e==null?void 0:e.required)==null?void 0:a.includes(n))??!1;if(D(i)){let c=r.getZodSchemaNameByRef(i.$ref),u=r.getSchemaByRef(i.$ref),l=si({zodSchemaName:c,schema:u,resolver:r}),f=zS(l,t),p=on({schema:u,isCircular:f,parentTypes:[...t,l],resolver:r});return{name:n,isRequired:s,...l,...p}}else if(i.type==="array"){let c=ZS({arraySchema:i,parentTypes:t,resolver:r});return{name:n,isRequired:s,type:"array",metaType:"array",arrayType:c}}else if(Bt(i.type))return{name:n,isRequired:s,type:Sa(i.type),metaType:"primitive"};return{name:n,isRequired:s,type:"void",metaType:"primitive"}})}o(fC,"getSchemaTsProperties");function zS(e,t){return t.findIndex(({type:r,namespace:n})=>r===e.type&&n===e.namespace)>-1}o(zS,"getIsCircular");var Ao=o(e=>_r(ae(e.operationName)),"getEndpointName");function KS(e,t){return`${t.tsNamespaces?`${G({type:"endpoints",tag:wo(e,t),options:t})}.`:""}${Ao(e)}`}o(KS,"getImportedEndpointName");var QS=o(e=>e.path.replace(/:([a-zA-Z0-9_]+)/g,"${$1}"),"getEndpointPath");function wo(e,t){var n;let r=t.splitByTags?(n=e.tags)==null?void 0:n[0]:t.defaultTag;return Rt(r??t.defaultTag)}o(wo,"getEndpointTag");function xr(e,t,r){let n=t.parameters.map(i=>{var a,c,u,l;let s="string";if(pe(i.zodSchema))s=$r(e,i.zodSchema);else if((a=i.parameterObject)!=null&&a.schema&&Oe(i.parameterObject.schema)){let f=(u=(c=i.parameterObject)==null?void 0:c.schema)==null?void 0:u.type;f&&Bt(f)&&(s=Sa(f))}return{name:At(i.name),type:s,paramType:i.type,required:((l=i.parameterObject)==null?void 0:l.required)??!0,parameterObject:i.parameterObject,bodyObject:i.bodyObject}});return r!=null&&r.includeFileParam&&t.mediaUpload&&n.push({name:"file",type:"File",paramType:"Body",required:!0,parameterObject:void 0,bodyObject:void 0}),n.sort((i,s)=>{if(i.required===s.required){let a=["Path","Body","Query","Header"];return a.indexOf(i.paramType)-a.indexOf(s.paramType)}return i.required?-1:1}).filter(i=>(!(r!=null&&r.excludeBodyParam)||i.name!==ua)&&(!(r!=null&&r.excludePageParam)||i.name!==yo.pageParamName)&&(!(r!=null&&r.includeOnlyRequiredParams)||i.required)).map(i=>({...i,name:r!=null&&r.replacePageParam&&i.name===yo.pageParamName?"pageParam":i.name}))}o(xr,"mapEndpointParamsToFunctionParams");function WS(e){let t=e.parameters.filter(i=>i.type==="Query").map(i=>{let s=aS(i.name)?i.name:`"${i.name}"`,a=At(i.name);return{...i,name:s,value:a}}),r={};return e.requestFormat!==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]=At(i.name)}),{...t.length>0?{params:t}:{},...Object.keys(r).length?{headers:r}:{}}}o(WS,"getEndpointConfig");function YS(e,t){return t.filter(r=>we(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(YS,"getUpdateQueryEndpoints");var we=o(e=>e.method==="get","isQuery"),Ct=o(e=>e.method!=="get"||!!e.mediaDownload,"isMutation"),ai=o((e,t)=>we(e)&&(t??Object.values(yo)).every(r=>e.parameters.some(n=>n.name===r&&n.type==="Query")),"isInfiniteQuery"),JS=o((e,t,r)=>{let n=r.reduce((i,s)=>[...i,...xr(e,s,{includeOnlyRequiredParams:!0}).map(a=>a.name)],[]);return xr(e,t,{includeOnlyRequiredParams:!0,excludeBodyParam:!0}).filter(i=>n.includes(i.name)).map(i=>i.name)},"getDestructuredVariables");var ba=o((e,t)=>{let r=we(e)&&Ct(e)&&t;return`use${U(ae(e.operationName))}${r?"Mutation":""}`},"getQueryName"),XS=o(e=>`use${U(ae(e.operationName))}Infinite`,"getInfiniteQueryName");var bf=["break","case","catch","class","const","continue","debugger","default","delete","do","else","export","extends","false","finally","for","function","if","import","in","instanceof","new","null","return","super","switch","this","throw","true","try","typeof","var","void","while","with"];function sn(e,t){let r={};return Object.keys(e).forEach(n=>{t.includes(n)&&(r[n]=e[n])}),r}o(sn,"pick");function ci(e,t){let r=e.deprecated&&!t.withDeprecatedEndpoints,n=Pr(e,t),i=AS(n,t);return r||i}o(ci,"isOperationExcluded");function _f({path:e,method:t,operation:r,options:n,tag:i,keepOperationTag:s,keepOperationPrefix:a}){let c=`${t}${$S(e)}`,u=r.operationId?At(r.operationId):c;if(n.removeOperationPrefixEndingWith&&a)u=u.split(n.removeOperationPrefixEndingWith).map((f,p)=>p===0?f:U(f)).join("");else if(n.removeOperationPrefixEndingWith&&!a){let l=new RegExp(`^.*${n.removeOperationPrefixEndingWith}`);u=u.replace(l,"")}if(n.tsNamespaces&&!s){let l=vS(u,i);l===""?u=t.toLowerCase():bf.includes(l)||(u=l)}return bf.includes(u)?c:u}o(_f,"getOperationName");function Io({operationsByTag:e,...t}){let{operation:r,options:n}=t,i=n.splitByTags?Pr(r,n):n.defaultTag,s=o(a=>{let c=_f({...t,tag:i,keepOperationTag:a});if(e[i].filter(l=>_f({...t,operation:l,tag:i,keepOperationTag:a})===c).length===1)return c},"operationName");return s()??s(!0)??_f({...t,tag:i,keepOperationTag:!0,keepOperationPrefix:!0})}o(Io,"getUniqueOperationName");function eb(e,t,r){let n=[];for(let i in e.paths){if(en(i,r))continue;let s=e.paths[i],a=sn(s,Jr);for(let c in a){let u=a[c];if(!u||ci(u,r))continue;let l=Io({path:i,method:c,operation:u,operationsByTag:t,options:r});n.push(l)}}return n}o(eb,"getUniqueOperationNamesWithoutSplitByTags");function tb(e,t){let r={};for(let n in e.paths){if(en(n,t))continue;let i=e.paths[n],s=sn(i,Jr);for(let a in s){let c=s[a];if(!c||ci(c,t))continue;let u=t.splitByTags?Pr(c,t):t.defaultTag;r[u]||(r[u]=[]),r[u].push(c)}}return r}o(tb,"getOperationsByTag");var rb={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 To(e){return{type:"invalid-schema",message:e}}o(To,"getInvalidSchemaError");function nb(e){return{type:"invalid-operation-id",message:`Operation ${e}`}}o(nb,"getInvalidOperationIdError");function ib(e,t){return{type:"missing-path-parameter",message:`Path ${t} is missing [${e.map(({name:r})=>r).join(", ")}]`}}o(ib,"getMissingPathParameterError");function ob(e){return{type:"not-allowed-inline-enum",message:`${e} is missing @IsEnum() and @ApiProperty(enum:, enumName:)`}}o(ob,"getNotAllowedInlineEnumError");function sb(e){return{type:"not-allowed-circular-schema",message:e}}o(sb,"getNotAllowedCircularSchemaError");function ab(e,t,r){return{type:"missing-acl-condition-property",message:`Condition property ${e} is not found in parameters or body in operation ${Pa(t,r)}`}}o(ab,"getMissingAclConditionPropertyError");function Pf(e,t,r){return{type:"missing-status-code",message:`Missing HTTP status code ${_a(e)} in operation ${Pa(t,r)}`}}o(Pf,"getMissingStatusCodeError");function cb(e,t,r){return{type:"invalid-status-code",message:`Operation ${Pa(t,r)} expected HTTP status code ${_a(e.expected)} but received ${_a(e.received)}`}}o(cb,"getInvalidStatusCodeError");function ub(e,t,r){return{type:"multiple-success-status-codes",message:`Operation ${Pa(t,r)} has multiple success HTTP status codes: ${e.map(_a).join(", ")}`}}o(ub,"getMultipleSuccessStatusCodesError");function Pa(e,t){return e.operationId??`${t.method} ${t.path}`}o(Pa,"getOperationDescriptor");function _a(e){return`${e} (${rb[e]})`}o(_a,"getStatusCodeDescription");function kt({schema:e,meta:t,options:r}){let n=[];Se(e.type).with("string",()=>n.push(hC(e,r))).with("number","integer",()=>n.push(yC(e))).with("array",()=>n.push(vC(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 Qt=h((tB,OP)=>{var uc=_P().default,$P=PP();uc.PrintVisitor=$P.PrintVisitor;uc.print=$P.print;OP.exports=uc;function EP(e,t){var r=require("fs"),n=r.readFileSync(t,"utf8");e.exports=uc.compile(n)}o(EP,"extension");typeof require<"u"&&require.extensions&&(require.extensions[".handlebars"]=EP,require.extensions[".hbs"]=EP)});var P3={};oE(P3,{getGenerateFilesData:()=>_3,getGenerateMetadata:()=>b3});module.exports=sE(P3);var _d=et(Yv());var fo="AppRestClient",Xs={query:"AppQueryOptions",infiniteQuery:"AppInfiniteQueryOptions",mutation:"AppMutationOptions"},ef="src/data",tf="@/data",Yr={appRestClient:{template:"@/util/rest/clients/app-rest-client",monorepoTemplate:"@/clients/app-rest-client"},queryTypes:{template:"@/types/react-query",monorepoTemplate:"@povio/utils/types/react-query"},errorHandling:{template:"@/util/vendor/error-handling",monorepoTemplate:"@povio/utils/vendor/error-handling"},abilityContext:{template:"@/data/acl/ability.context",monorepoTemplate:"@povio/auth/acl/ability.context"}},mr={ErrorHandler:"ErrorHandler",SharedErrorHandler:"SharedErrorHandler"},ea={bindings:[mr.ErrorHandler,mr.SharedErrorHandler],from:Yr.errorHandling.template},rf="AbilityContext",Jv={bindings:[rf],from:Yr.abilityContext.template};var ta={reactQueryTypes:{fileName:"react-query.types",extension:"ts"},restClient:{fileName:"rest-client",extension:"ts"},restInterceptor:{fileName:"rest-interceptor",extension:"ts"}},ra={fileName:"app-rest-client",extension:"ts"},nf="QueryModule",na={fileName:"queryModules",extension:"ts"},Xv={fileName:"queryConfig.context",extension:"tsx"},ti={optionsType:"MutationEffectsOptions",hookName:"useMutationEffects",runFunctionName:"runMutationEffects"},ia={fileName:"useMutationEffects",extension:"ts"},Ot={name:"zod",properties:{sortingString:"sortingString",parse:"parse"}},oa={fileName:"zod",extension:"ts"};var eS="Schema",tS="Enum",rS="Body",nS="Param",iS="Response",oS="ErrorResponse",mo="z.void()",sa="z.instanceof(Blob)",ho="z.enum",aa="z.string()",ri={bindings:["z"],from:"zod"};var go={input:"",output:"output",splitByTags:!0,defaultTag:"Common",excludeTags:[],excludePathRegex:"",excludeRedundantZodSchemas:!0,tsNamespaces:!0,importPath:"ts",configs:{models:{outputFileNameSuffix:"models",namespaceSuffix:"Models"},endpoints:{outputFileNameSuffix:"api",namespaceSuffix:"Api"},queries:{outputFileNameSuffix:"queries",namespaceSuffix:"Queries"},acl:{outputFileNameSuffix:"acl",namespaceSuffix:"Acl"}},acl:!0,checkAcl:!0,standalone:!1,baseUrl:"",abilityContextImportPath:Yr.abilityContext.template,schemaSuffix:eS,enumSuffix:tS,withDefaultValues:!0,extractEnums:!0,branded:!0,replaceOptionalWithNullish:!1,restClientImportPath:Yr.appRestClient.template,errorHandlingImportPath:Yr.errorHandling.template,removeOperationPrefixEndingWith:"Controller_",parseRequestParams:!0,queryTypesImportPath:Yr.queryTypes.template,axiosRequestConfig:!1,infiniteQueries:!1,mutationEffects:!0};var ft={query:"useQuery",infiniteQuery:"useInfiniteQuery",mutation:"useMutation"},sS={bindings:[ft.query,ft.infiniteQuery,ft.mutation],from:"@tanstack/react-query"},yo={pageParamName:"page"},ca={pageParamName:"page",totalItemsName:"totalItems",limitParamName:"limit"},vo="moduleName";var of={"Content-Type":"application/json",Accept:"application/json"},ua="data",sf="axios",hr="config",xt="AxiosRequestConfig",la={defaultImport:sf,bindings:[xt],from:"axios"};var aS=o(e=>/^(?:[a-zA-Z_$][a-zA-Z0-9_$]*|[0-9]+)$/.test(e),"isValidPropertyName"),At=o(e=>e.replace(/^[^a-zA-Z_$]*/g,"").replace(/[^a-zA-Z0-9_$]+(\w)?/g,(t,r)=>(r==null?void 0:r.toUpperCase())??""),"invalidVariableNameCharactersToCamel");function D(e){return e!=null&&Object.prototype.hasOwnProperty.call(e,"$ref")}o(D,"isReferenceObject");function Oe(e){return!D(e)}o(Oe,"isSchemaObject");function pa(e){return e.type==="array"}o(pa,"isArraySchemaObject");function cS(e){if(!e.allOf)throw new Error("Function inferRequiredSchema is specialized to handle item with required only in an allOf array.");let[t,r]=e.allOf.reduce((i,s)=>{if(tC(s)){let a=s.required;i[0].push(...a??[])}else i[1].push(s);return i},[[],[]]),n={properties:t.reduce((i,s)=>(i[s]={},i),{}),type:"object",required:t};return{noRequiredOnlyAllof:r,composedRequiredSchema:n,patchRequiredSchemaInLoop:o((i,s)=>{if(D(i)){let a=s(i.$ref);a&&n.required.forEach(c=>{var u;n.properties[c]=((u=a==null?void 0:a.properties)==null?void 0:u[c])??{}})}else{let a=i.properties??{};n.required.forEach(c=>{a[c]&&(n.properties[c]=a[c]??{})})}},"patchRequiredSchemaInLoop")}}o(cS,"inferRequiredSchema");var tC=o(e=>!D(e)&&!!e.required&&!e.type&&!e.properties&&!(e!=null&&e.allOf)&&!(e!=null&&e.anyOf)&&!e.oneOf,"isBrokenAllOfItem");var Vt=Symbol.for("@ts-pattern/matcher"),rC=Symbol.for("@ts-pattern/isVariadic"),da="@ts-pattern/anonymous-select-key",af=o(e=>!!(e&&typeof e=="object"),"r"),fa=o(e=>e&&!!e[Vt],"i"),Tt=o((e,t,r)=>{if(fa(e)){let n=e[Vt](),{matched:i,selections:s}=n.match(t);return i&&s&&Object.keys(s).forEach(a=>r(a,s[a])),i}if(af(e)){if(!af(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];fa(c)&&c[rC]?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)=>Tt(l,a[f],r))&&i.every((l,f)=>Tt(l,c[f],r))&&(s.length===0||Tt(s[0],u,r))}return e.length===t.length&&e.every((a,c)=>Tt(a,t[c],r))}return Reflect.ownKeys(e).every(n=>{let i=e[n];return(n in t||fa(s=i)&&s[Vt]().matcherType==="optional")&&Tt(i,t[n],r);var s})}return Object.is(t,e)},"s"),br=o(e=>{var t,r,n;return af(e)?fa(e)?(t=(r=(n=e[Vt]()).getSelectionKeys)==null?void 0:r.call(n))!=null?t:[]:Array.isArray(e)?bo(e,br):bo(Object.values(e),br):[]},"o"),bo=o((e,t)=>e.reduce((r,n)=>r.concat(t(n)),[]),"c");function Qe(e){return Object.assign(e,{optional:o(()=>nC(e),"optional"),and:o(t=>z(e,t),"and"),or:o(t=>iC(e,t),"or"),select:o(t=>t===void 0?uS(e):uS(t,e),"select")})}o(Qe,"u");function nC(e){return Qe({[Vt]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return t===void 0?(br(e).forEach(i=>n(i,void 0)),{matched:!0,selections:r}):{matched:Tt(e,t,n),selections:r}},"match"),getSelectionKeys:o(()=>br(e),"getSelectionKeys"),matcherType:"optional"})})}o(nC,"h");function z(...e){return Qe({[Vt]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return{matched:e.every(i=>Tt(i,t,n)),selections:r}},"match"),getSelectionKeys:o(()=>bo(e,br),"getSelectionKeys"),matcherType:"and"})})}o(z,"m");function iC(...e){return Qe({[Vt]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return bo(e,br).forEach(i=>n(i,void 0)),{matched:e.some(i=>Tt(i,t,n)),selections:r}},"match"),getSelectionKeys:o(()=>bo(e,br),"getSelectionKeys"),matcherType:"or"})})}o(iC,"d");function L(e){return{[Vt]:()=>({match:o(t=>({matched:!!e(t)}),"match")})}}o(L,"p");function uS(...e){let t=typeof e[0]=="string"?e[0]:void 0,r=e.length===2?e[1]:typeof e[0]=="string"?void 0:e[0];return Qe({[Vt]:()=>({match:o(n=>{let i={[t??da]:n};return{matched:r===void 0||Tt(r,n,(s,a)=>{i[s]=a}),selections:i}},"match"),getSelectionKeys:o(()=>[t??da].concat(r===void 0?[]:br(r)),"getSelectionKeys")})})}o(uS,"y");function wt(e){return typeof e=="number"}o(wt,"v");function gr(e){return typeof e=="string"}o(gr,"b");function yr(e){return typeof e=="bigint"}o(yr,"w");var G8=Qe(L(function(e){return!0}));var vr=o(e=>Object.assign(Qe(e),{startsWith:o(t=>{return vr(z(e,(r=t,L(n=>gr(n)&&n.startsWith(r)))));var r},"startsWith"),endsWith:o(t=>{return vr(z(e,(r=t,L(n=>gr(n)&&n.endsWith(r)))));var r},"endsWith"),minLength:o(t=>vr(z(e,(r=>L(n=>gr(n)&&n.length>=r))(t))),"minLength"),length:o(t=>vr(z(e,(r=>L(n=>gr(n)&&n.length===r))(t))),"length"),maxLength:o(t=>vr(z(e,(r=>L(n=>gr(n)&&n.length<=r))(t))),"maxLength"),includes:o(t=>{return vr(z(e,(r=t,L(n=>gr(n)&&n.includes(r)))));var r},"includes"),regex:o(t=>{return vr(z(e,(r=t,L(n=>gr(n)&&!!n.match(r)))));var r},"regex")}),"j"),Z8=vr(L(gr)),It=o(e=>Object.assign(Qe(e),{between:o((t,r)=>It(z(e,((n,i)=>L(s=>wt(s)&&n<=s&&i>=s))(t,r))),"between"),lt:o(t=>It(z(e,(r=>L(n=>wt(n)&&n<r))(t))),"lt"),gt:o(t=>It(z(e,(r=>L(n=>wt(n)&&n>r))(t))),"gt"),lte:o(t=>It(z(e,(r=>L(n=>wt(n)&&n<=r))(t))),"lte"),gte:o(t=>It(z(e,(r=>L(n=>wt(n)&&n>=r))(t))),"gte"),int:o(()=>It(z(e,L(t=>wt(t)&&Number.isInteger(t)))),"int"),finite:o(()=>It(z(e,L(t=>wt(t)&&Number.isFinite(t)))),"finite"),positive:o(()=>It(z(e,L(t=>wt(t)&&t>0))),"positive"),negative:o(()=>It(z(e,L(t=>wt(t)&&t<0))),"negative")}),"x"),z8=It(L(wt)),Sr=o(e=>Object.assign(Qe(e),{between:o((t,r)=>Sr(z(e,((n,i)=>L(s=>yr(s)&&n<=s&&i>=s))(t,r))),"between"),lt:o(t=>Sr(z(e,(r=>L(n=>yr(n)&&n<r))(t))),"lt"),gt:o(t=>Sr(z(e,(r=>L(n=>yr(n)&&n>r))(t))),"gt"),lte:o(t=>Sr(z(e,(r=>L(n=>yr(n)&&n<=r))(t))),"lte"),gte:o(t=>Sr(z(e,(r=>L(n=>yr(n)&&n>=r))(t))),"gte"),positive:o(()=>Sr(z(e,L(t=>yr(t)&&t>0))),"positive"),negative:o(()=>Sr(z(e,L(t=>yr(t)&&t<0))),"negative")}),"A"),K8=Sr(L(yr)),Q8=Qe(L(function(e){return typeof e=="boolean"})),W8=Qe(L(function(e){return typeof e=="symbol"})),Y8=Qe(L(function(e){return e==null})),J8=Qe(L(function(e){return e!=null}));var pf=class pf 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(pf,"W");var cf=pf,uf={matched:!1,value:void 0};function Se(e){return new lf(e,uf)}o(Se,"z");var So=class So{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=>Tt(l,this.input,c))||i&&!i(this.input)?uf:{matched:!0,value:r(s?da in a?a[da]:a:this.input,this.input)};return new So(this.input,u)}when(t,r){if(this.state.matched)return this;let n=!!t(this.input);return new So(this.input,n?{matched:!0,value:r(this.input,this.input)}:uf)}otherwise(t){return this.state.matched?this.state.value:t(this.input)}exhaustive(){if(this.state.matched)return this.state.value;throw new cf(this.input)}run(){return this.exhaustive()}returnType(){return this}};o(So,"I");var lf=So;var ff=2,lS=["application/octet-stream","multipart/form-data","application/x-www-form-urlencoded","*/*"],pS=["query","header","path"],Jr=["get","put","post","delete","options","head","patch","trace"],fS=["string","number","integer","boolean"],ni=["allOf","anyOf","oneOf"];var U=o(e=>e.charAt(0).toUpperCase()+e.slice(1),"capitalize"),_r=o(e=>e.charAt(0).toLowerCase()+e.slice(1),"decapitalize"),dS=o(e=>e.replace(/(-\w)/g,t=>t[1].toUpperCase()),"kebabToCamel"),ae=o(e=>e.replace(/(_\w)/g,t=>t[1].toUpperCase()),"snakeToCamel"),mS=o(e=>e.replace(/[\W_]+(\w)?/g,(t,r)=>(r==null?void 0:r.toUpperCase())??""),"nonWordCharactersToCamel"),df=o((e,t="")=>e.endsWith(t)?e:`${e}${t}`,"suffixIfNeeded"),hS=o((e,t)=>e.replace(new RegExp(`${t}$`),""),"removeSuffix"),oC=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"),mf=o(e=>{let t=e.map(U).map(gS).map(r=>sC(r)).flat();return oC(t)},"getMostCommonAdjacentCombinationSplit"),gS=o(e=>e.split(/(?<![A-Z])(?=[A-Z])/).filter(Boolean),"splitByUppercase"),yS=o(e=>gS(e).join(" "),"camelToSpaceSeparated"),sC=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"),vS=o((e,t)=>{let r=t.replace(/es$|s$/g,""),n=new RegExp(`(${_r(r)}|${U(r)})[a-z]*(?=$|[A-Z])`,"g");return e.replace(n,"")},"removeWord");var bS=o(e=>`#/components/schemas/${e}`,"getSchemaRef"),Xr=o(e=>e[1]==="/"?e:"#/"+e.slice(1),"autocorrectRef"),ii=o(e=>Xr(e).split("/").at(-1),"getSchemaNameByRef");function gf(e){let t=aC(e).normalize("NFKD").trim().replace(/\s+/g,"_").replace(/--+/g,"-").replace(/-+/g,"_").replace(/[^\w-]+/g,"_");return ae(t)}o(gf,"normalizeString");function _S(e){return/^[a-zA-Z]\w*$/.test(e)?e:`"${e}"`}o(_S,"wrapWithQuotesIfNeeded");function PS(e){return typeof e=="string"&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}o(PS,"unwrapQuotesIfNeeded");function aC(e){let t=Number(e[0]);return typeof t=="number"&&!Number.isNaN(t)?"_"+e:e}o(aC,"prefixStringStartingWithNumberIfNeeded");function yf(e){let t=e.replaceAll("_","#");return ae(t.replaceAll("-","_")).replaceAll("#","_")}o(yf,"pathParamToVariableName");var Bt=o(e=>fS.includes(e),"isPrimitiveType");function ES(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(ES,"escapeControlCharacters");function We(e){return e.includes("application/")&&e.includes("json")||lS.includes(e)||e.includes("text/")}o(We,"isParamMediaTypeAllowed");function _o(e){return e>=200&&e<300}o(_o,"isMainResponseStatus");function ma(e){return!(e>=200&&e<300)}o(ma,"isErrorStatus");function oi(e){return e.startsWith("application/")}o(oi,"isMediaTypeAllowed");var SS=/({\w+})/g,cC=/[^\w\-]+/g;function $S(e){e=U(dS(e.replaceAll("/","-")).replaceAll("-",""));let t=[...e.matchAll(SS)];if(t.length>0){let r=t.sort((n,i)=>n.index-i.index)[t.length-1][0];e=`${e.replace(SS,"")}By${U(r.slice(1,-1))}`}return e.replace(cC,"_")}o($S,"pathToVariableName");var hf=/{(\b\w+(?:-\w+)*\b)}/g;function OS(e){let t=e.match(hf);return t===null?e.replaceAll(hf,":$1"):(t.forEach(r=>{let n=yf(r.replaceAll(hf,":$1"));e=e.replaceAll(r,n)}),e)}o(OS,"replaceHyphenatedPath");var xS=o(e=>{let t=e["x-enumNames"],r=Array.isArray(t)&&t.length>0,n=!!e.schema&&Oe(e.schema)&&e.schema.type==="string";return r&&n},"isSortingParameterObject"),en=o((e,t)=>t.excludePathRegex?new RegExp(t.excludePathRegex).test(e):!1,"isPathExcluded");function Rt(e){return mS(e)}o(Rt,"formatTag");function Pr(e,t){var n;let r=(n=e.tags)==null?void 0:n[0];return Rt(r??t.defaultTag)}o(Pr,"getOperationTag");function AS(e,t){return t.excludeTags.some(r=>r.toLowerCase()===e.toLowerCase())}o(AS,"isTagExcluded");var ha={fileName:"acl/app.ability",extension:"ts"},Po="AllAbilities",Eo="AppAbilities",ga={fileName:"acl/useAclCheck",extension:"ts"},Er="useAclCheck",xe={abilityTuple:"AbilityTuple",pureAbility:"PureAbility",forcedSubject:"ForcedSubject",subject:"Subject"},vf={bindings:[xe.abilityTuple,xe.pureAbility,xe.forcedSubject,xe.subject],from:"@casl/ability"};var Fe=o((...e)=>[...new Set(e.flat())],"getUniqueArray");function Ae(e,t){if(!e)return;let{data:r,onSchema:n}=t;if(D(e)&&n({type:"reference",schema:e,data:r})===!0)return;let i=e;if(ni.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&&Ae(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&&Ae(a,t);if(i.additionalProperties&&typeof i.additionalProperties=="object"){if(n({type:"additionalProperties",parentSchema:e,schema:i.additionalProperties,data:r})===!0)return;Ae(i.additionalProperties,t)}if(i.type==="array"){let s=e.items;if(n({type:"array",parentSchema:e,schema:s,data:r})===!0)return;Ae(s,t)}}o(Ae,"iterateSchema");var Nt=o((e,t)=>df(U(gf(e)),t),"getZodSchemaName"),$o=o((e,t,r)=>df(U(gf(e)),`${t}${r}`),"getEnumZodSchemaName"),pe=o(e=>!e.startsWith("z."),"isNamedZodSchema"),wS=o(e=>e.startsWith(ho),"isEnumZodSchema"),tn=o((e,t,r)=>t?e:`${r}_${e}`,"getZodSchemaOperationName"),ya=o(e=>ae(`${e}_${rS}`),"getBodyZodSchemaName"),IS=o((e,t)=>ae(`${e}_${t}${nS}`),"getParamZodSchemaName"),uC=o(e=>ae(`${e}${iS}`),"getMainResponseZodSchemaName"),lC=o((e,t)=>ae(`${e}_${t}_${oS}`),"getErrorResponseZodSchemaName");function va({statusCode:e,operationName:t,isUniqueOperationName:r,tag:n}){let i=Number(e),s=tn(t,r,n);return!_o(i)&&e!=="default"&&ma(i)?lC(s,e):uC(s)}o(va,"getResponseZodSchemaName");function Oo(e){return["minimum","exclusiveMinimum","maximum","exclusiveMaximum","minItems","minLength","minProperties","maxItems","maxLength","maxProperties","default","example"].filter(n=>e[n]).reduce((n,i)=>[...n,`${U(yS(i))}: \`${e[i]}\``],[])}o(Oo,"getSchemaDescriptions");var xo=o((e,t)=>hS(e,t.schemaSuffix),"getZodSchemaInferedTypeName"),TS=o((e,t)=>pe(t)?`${e.options.tsNamespaces?`${G({type:"models",tag:e.getTagByZodSchemaName(t),options:e.options})}.`:""}${t}`:t,"getImportedZodSchemaName"),$r=o((e,t,r)=>{if(!pe(t))return t===mo?"void":t;let n=e.getTagByZodSchemaName(t);return`${e.options.tsNamespaces&&n!==r?`${G({type:"models",tag:n,options:e.options})}.`:""}${xo(t,e.options)}`},"getImportedZodSchemaInferedTypeName");function RS(e){var t;return e.isEnum?"enum":((t=e.schemaObj)==null?void 0:t.type)??"object"}o(RS,"getZodSchemaType");function NS(e){if(e.schemaObj)return[e.schemaObj.description,...Oo(e.schemaObj).join(". ")].filter(Boolean)}o(NS,"getZodSchemaDescription");function CS(e,t,r){var n;if(D(t)){let i=e.getZodSchemaNameByRef(t.$ref);return i?$r(e,i,r):void 0}if(pa(t)){if(!D(t.items))return`${((n=t.items)==null?void 0:n.type)??"unknown"}[]`;let i=e.getZodSchemaNameByRef(t.items.$ref);return i?`${$r(e,i,r)}[]`:void 0}if(ni.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 kS(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,...Oo(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 Ae(c.schema,{data:{pathSegments:[...u]},onSchema:a}),!0},"onSchema");return"allOf"in t.schemaObj&&t.schemaObj.allOf&&t.schemaObj.allOf.forEach(c=>{if(D(c)){let u=e.resolveObject(c);Ae(u,{data:{pathSegments:[]},onSchema:a})}}),Ae(t.schemaObj,{data:{pathSegments:[]},onSchema:a}),s}o(kS,"getZodSchemaPropertyDescriptions");function Or({resolver:e,tag:t,zodSchemas:r=[],zodSchemasAsTypes:n=[]}){let i="models",s=o(u=>e.getTagByZodSchemaName(u),"getTag"),a=Sf({type:i,tag:t,entities:r,getTag:s,getEntityName:o(u=>u,"getEntityName"),options:e.options}),c=Sf({type:i,tag:t,entities:n,getTag:s,getEntityName:o(u=>xo(u,e.options),"getEntityName"),options:e.options});return pC(e.options,a,c)}o(Or,"getModelsImports");function jS({tag:e,endpoints:t,options:r}){return Sf({type:"endpoints",tag:e,entities:t,getTag:o(n=>wo(n,r),"getTag"),getEntityName:Ao,options:r})}o(jS,"getEndpointsImports");function qS({tags:e,entityName:t,getAliasEntityName:r,type:n,options:i}){let s=new Map;return e.forEach(a=>{let c=`${t}${r?` as ${r(a)}`:""}`;s.has(a)?i.tsNamespaces||s.get(a).bindings.push(c):s.set(a,{bindings:[i.tsNamespaces?G({type:n,tag:a,options:i}):c],from:`${Ut(i)}${rn({type:n,tag:a,includeTagDir:!0,options:i})}`})}),Array.from(s.values())}o(qS,"getEntityImports");function Ut(e){let t=tf;return e.importPath==="relative"?t="../":e.importPath==="absolute"?t=e.output:new RegExp(`${ef}`,"g").test(e.output)&&(t=e.output.replace(new RegExp(`.*${ef}`,"g"),tf)),`${t}/`.replace(/\/\//g,"/")}o(Ut,"getImportPath");function Sf({type:e="models",tag:t,entities:r,getTag:n,getEntityName:i,options:s}){let a=new Map;return r.forEach(c=>{let u=n(c);if(a.has(u))s.tsNamespaces||a.get(u).bindings.push(i(c));else{let l=t===u;a.set(u,{bindings:[s.tsNamespaces?G({type:e,tag:u,options:s}):i(c)],from:`${l?"./":Ut(s)}${rn({type:e,tag:u,includeTagDir:!l,options:s})}`})}}),Array.from(a.values())}o(Sf,"getImports");function pC(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:Fe(n.bindings)}))}o(pC,"mergeImports");function nn({fileName:e,extension:t}){return`${e}.${t}`}o(nn,"getFileNameWithExtension");function MS({type:e,tag:t,options:r,includeTagDir:n=!0}){let i=r.configs[e].outputFileNameSuffix;return t?`${n?`${_r(t)}/`:""}${_r(t)}.${i}`:i}o(MS,"getTagFileNameWithoutExtension");function rn(...e){return MS(...e)}o(rn,"getTagImportPath");function DS(...e){return`${MS(...e)}.ts`}o(DS,"getTagFileName");var G=o(({type:e,tag:t,options:r})=>`${U(t)}${r.configs[e].namespaceSuffix}`,"getNamespaceName");function LS(e){return e.standalone?`${Ut(e)}${ra.fileName}`:e.restClientImportPath}o(LS,"getAppRestClientImportPath");function FS(e){return e.standalone?`${Ut(e)}${ta.reactQueryTypes.fileName}`:e.queryTypesImportPath}o(FS,"getQueryTypesImportPath");function HS(e){return`${Ut(e)}${na.fileName}`}o(HS,"getQueryModulesImportPath");function VS(e){return`${Ut(e)}${ia.fileName}`}o(VS,"getMutationEffectsImportPath");function BS(e){return`${Ut(e)}${ga.fileName}`}o(BS,"getAclCheckImportPath");function US(e){return`${Ut(e)}${oa.fileName}`}o(US,"getZodExtendedImportPath");function GS(){return`./${ha.fileName}`}o(GS,"getAppAbilitiesImportPath");function Sa(e){return Se(e).with("string",()=>"string").with("number",()=>"number").with("integer",()=>"number").with("boolean",()=>"boolean").exhaustive()}o(Sa,"primitiveTypeToTsType");function si({zodSchemaName:e,schema:t,resolver:r}){let n="void",i;e&&pe(e)?(n=$r(r,e),i=r.getTagByZodSchemaName(e)):t!=null&&t.type&&Bt(t==null?void 0:t.type)&&(n=Sa(t==null?void 0:t.type));let s=n.split(".");return{type:s[s.length-1],...s.length>1?{namespace:s[0]}:{},...i?{importPath:rn({type:"models",tag:i,includeTagDir:!0,options:r.options})}:{}}}o(si,"getTsTypeBase");function on({schema:e,isCircular:t,parentTypes:r,resolver:n}){if(!e)return{metaType:"primitive"};for(let i of ni){let s=e[i];if(s)if(s.length>1){let a=s.map(c=>{let u=n.resolveObject(c);return on({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:ZS({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:fC({schema:e,parentTypes:r,resolver:n})}:{metaType:"primitive"}}o(on,"getSchemaTsMetaType");function ZS({arraySchema:e,parentTypes:t,resolver:r}){let n,i;if(D(e.items)){let u=e.items.$ref;n=r.getZodSchemaNameByRef(u),i=r.getSchemaByRef(u)}else i=e.items;let s=si({zodSchemaName:n,schema:i,resolver:r}),a=zS(s,t),c=on({schema:i,isCircular:a,parentTypes:[...t,s],resolver:r});return{...s,...c}}o(ZS,"getArraySchemaTsType");function fC({schema:e,parentTypes:t,resolver:r}){return Object.entries((e==null?void 0:e.properties)??{}).map(([n,i])=>{var a;let s=((a=e==null?void 0:e.required)==null?void 0:a.includes(n))??!1;if(D(i)){let c=r.getZodSchemaNameByRef(i.$ref),u=r.getSchemaByRef(i.$ref),l=si({zodSchemaName:c,schema:u,resolver:r}),f=zS(l,t),p=on({schema:u,isCircular:f,parentTypes:[...t,l],resolver:r});return{name:n,isRequired:s,...l,...p}}else if(i.type==="array"){let c=ZS({arraySchema:i,parentTypes:t,resolver:r});return{name:n,isRequired:s,type:"array",metaType:"array",arrayType:c}}else if(Bt(i.type))return{name:n,isRequired:s,type:Sa(i.type),metaType:"primitive"};return{name:n,isRequired:s,type:"void",metaType:"primitive"}})}o(fC,"getSchemaTsProperties");function zS(e,t){return t.findIndex(({type:r,namespace:n})=>r===e.type&&n===e.namespace)>-1}o(zS,"getIsCircular");var Ao=o(e=>_r(ae(e.operationName)),"getEndpointName");function KS(e,t){return`${t.tsNamespaces?`${G({type:"endpoints",tag:wo(e,t),options:t})}.`:""}${Ao(e)}`}o(KS,"getImportedEndpointName");var QS=o(e=>e.path.replace(/:([a-zA-Z0-9_]+)/g,"${$1}"),"getEndpointPath");function wo(e,t){var n;let r=t.splitByTags?(n=e.tags)==null?void 0:n[0]:t.defaultTag;return Rt(r??t.defaultTag)}o(wo,"getEndpointTag");function xr(e,t,r){let n=t.parameters.map(i=>{var a,c,u,l;let s="string";if(pe(i.zodSchema))s=$r(e,i.zodSchema);else if((a=i.parameterObject)!=null&&a.schema&&Oe(i.parameterObject.schema)){let f=(u=(c=i.parameterObject)==null?void 0:c.schema)==null?void 0:u.type;f&&Bt(f)&&(s=Sa(f))}return{name:At(i.name),type:s,paramType:i.type,required:((l=i.parameterObject)==null?void 0:l.required)??!0,parameterObject:i.parameterObject,bodyObject:i.bodyObject}});return r!=null&&r.includeFileParam&&t.mediaUpload&&n.push({name:"file",type:"File",paramType:"Body",required:!0,parameterObject:void 0,bodyObject:void 0}),n.sort((i,s)=>{if(i.required===s.required){let a=["Path","Body","Query","Header"];return a.indexOf(i.paramType)-a.indexOf(s.paramType)}return i.required?-1:1}).filter(i=>(!(r!=null&&r.excludeBodyParam)||i.name!==ua)&&(!(r!=null&&r.excludePageParam)||i.name!==yo.pageParamName)&&(!(r!=null&&r.includeOnlyRequiredParams)||i.required)).map(i=>({...i,name:r!=null&&r.replacePageParam&&i.name===yo.pageParamName?"pageParam":i.name}))}o(xr,"mapEndpointParamsToFunctionParams");function WS(e){let t=e.parameters.filter(i=>i.type==="Query").map(i=>{let s=aS(i.name)?i.name:`"${i.name}"`,a=At(i.name);return{...i,name:s,value:a}}),r={};return e.requestFormat!==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]=At(i.name)}),{...t.length>0?{params:t}:{},...Object.keys(r).length?{headers:r}:{}}}o(WS,"getEndpointConfig");function YS(e,t){return t.filter(r=>we(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(YS,"getUpdateQueryEndpoints");var we=o(e=>e.method==="get","isQuery"),Ct=o(e=>e.method!=="get"||!!e.mediaDownload,"isMutation"),ai=o((e,t)=>we(e)&&(t??Object.values(yo)).every(r=>e.parameters.some(n=>n.name===r&&n.type==="Query")),"isInfiniteQuery"),JS=o((e,t,r)=>{let n=r.reduce((i,s)=>[...i,...xr(e,s,{includeOnlyRequiredParams:!0}).map(a=>a.name)],[]);return xr(e,t,{includeOnlyRequiredParams:!0,excludeBodyParam:!0}).filter(i=>n.includes(i.name)).map(i=>i.name)},"getDestructuredVariables");var ba=o((e,t)=>{let r=we(e)&&Ct(e)&&t;return`use${U(ae(e.operationName))}${r?"Mutation":""}`},"getQueryName"),XS=o(e=>`use${U(ae(e.operationName))}Infinite`,"getInfiniteQueryName");var bf=["break","case","catch","class","const","continue","debugger","default","delete","do","else","export","extends","false","finally","for","function","if","import","in","instanceof","new","null","return","super","switch","this","throw","true","try","typeof","var","void","while","with"];function sn(e,t){let r={};return Object.keys(e).forEach(n=>{t.includes(n)&&(r[n]=e[n])}),r}o(sn,"pick");function ci(e,t){let r=e.deprecated&&!t.withDeprecatedEndpoints,n=Pr(e,t),i=AS(n,t);return r||i}o(ci,"isOperationExcluded");function _f({path:e,method:t,operation:r,options:n,tag:i,keepOperationTag:s,keepOperationPrefix:a}){let c=`${t}${$S(e)}`,u=r.operationId?At(r.operationId):c;if(n.removeOperationPrefixEndingWith&&a)u=u.split(n.removeOperationPrefixEndingWith).map((f,p)=>p===0?f:U(f)).join("");else if(n.removeOperationPrefixEndingWith&&!a){let l=new RegExp(`^.*${n.removeOperationPrefixEndingWith}`);u=u.replace(l,"")}if(n.tsNamespaces&&!s){let l=vS(u,i);l===""?u=t.toLowerCase():bf.includes(l)||(u=l)}return bf.includes(u)?c:u}o(_f,"getOperationName");function Io({operationsByTag:e,...t}){let{operation:r,options:n}=t,i=n.splitByTags?Pr(r,n):n.defaultTag,s=o(a=>{let c=_f({...t,tag:i,keepOperationTag:a});if(e[i].filter(l=>_f({...t,operation:l,tag:i,keepOperationTag:a})===c).length===1)return c},"operationName");return s()??s(!0)??_f({...t,tag:i,keepOperationTag:!0,keepOperationPrefix:!0})}o(Io,"getUniqueOperationName");function eb(e,t,r){let n=[];for(let i in e.paths){if(en(i,r))continue;let s=e.paths[i],a=sn(s,Jr);for(let c in a){let u=a[c];if(!u||ci(u,r))continue;let l=Io({path:i,method:c,operation:u,operationsByTag:t,options:r});n.push(l)}}return n}o(eb,"getUniqueOperationNamesWithoutSplitByTags");function tb(e,t){let r={};for(let n in e.paths){if(en(n,t))continue;let i=e.paths[n],s=sn(i,Jr);for(let a in s){let c=s[a];if(!c||ci(c,t))continue;let u=t.splitByTags?Pr(c,t):t.defaultTag;r[u]||(r[u]=[]),r[u].push(c)}}return r}o(tb,"getOperationsByTag");var rb={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 To(e){return{type:"invalid-schema",message:e}}o(To,"getInvalidSchemaError");function nb(e){return{type:"invalid-operation-id",message:`Operation ${e}`}}o(nb,"getInvalidOperationIdError");function ib(e,t){return{type:"missing-path-parameter",message:`Path ${t} is missing [${e.map(({name:r})=>r).join(", ")}]`}}o(ib,"getMissingPathParameterError");function ob(e){return{type:"not-allowed-inline-enum",message:`${e} is missing @IsEnum() and @ApiProperty(enum:, enumName:)`}}o(ob,"getNotAllowedInlineEnumError");function sb(e){return{type:"not-allowed-circular-schema",message:e}}o(sb,"getNotAllowedCircularSchemaError");function ab(e,t,r){return{type:"missing-acl-condition-property",message:`Condition property ${e} is not found in parameters or body in operation ${Pa(t,r)}`}}o(ab,"getMissingAclConditionPropertyError");function Pf(e,t,r){return{type:"missing-status-code",message:`Missing HTTP status code ${_a(e)} in operation ${Pa(t,r)}`}}o(Pf,"getMissingStatusCodeError");function cb(e,t,r){return{type:"invalid-status-code",message:`Operation ${Pa(t,r)} expected HTTP status code ${_a(e.expected)} but received ${_a(e.received)}`}}o(cb,"getInvalidStatusCodeError");function ub(e,t,r){return{type:"multiple-success-status-codes",message:`Operation ${Pa(t,r)} has multiple success HTTP status codes: ${e.map(_a).join(", ")}`}}o(ub,"getMultipleSuccessStatusCodesError");function Pa(e,t){return e.operationId??`${t.method} ${t.path}`}o(Pa,"getOperationDescriptor");function _a(e){return`${e} (${rb[e]})`}o(_a,"getStatusCodeDescription");function kt({schema:e,meta:t,options:r}){let n=[];Se(e.type).with("string",()=>n.push(hC(e,r))).with("number","integer",()=>n.push(yC(e))).with("array",()=>n.push(vC(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(dC({schema:e,meta:t,options:r}),r.withDefaultValues!==!1?mC(e):[]).filter(Boolean).join(".");return i?`.${i}`:""}o(kt,"getZodChain");function dC({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(dC,"getZodChainablePresence");function mC(e){return e.default!==void 0?`default(${Se(e.type).with("number","integer",()=>PS(e.default)).otherwise(()=>JSON.stringify(e.default))})`:""}o(mC,"getZodChainableDefault");function hC(e,t){let r=[];if(e.enum||(e.minLength!==void 0&&r.push(`min(${e.minLength})`),e.maxLength!==void 0&&r.push(`max(${e.maxLength})`)),e.pattern&&r.push(`regex(${gC(e.pattern)})`),e.format){let n=Se(e.format).with("email",()=>"email()").with("hostname","uri",()=>"url()").with("uuid",()=>"uuid()").with("date-time",()=>`datetime({ offset: true })${t.branded?".brand('datetime')":""}`).otherwise(()=>"");n&&r.push(n)}return r.join(".")}o(hC,"getZodChainableStringValidations");function gC(e){return e.startsWith("/")&&e.endsWith("/")&&(e=e.slice(1,-1)),e=ES(e),`/${e}/`}o(gC,"formatPatternIfNeeded");function yC(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(yC,"getZodChainableNumberValidations");function vC(e){let t=[];return e.minItems&&t.push(`min(${e.minItems})`),e.maxItems&&t.push(`max(${e.maxItems})`),t.join(".")}o(vC,"getZodChainableArrayValidations");var an=o(e=>e.reduce((t,r)=>t+r,0),"sum");function ce(e,t){if(!t)return e;if(D(t))return e+2;if(Array.isArray(t.type))return t.type.length===1?He("oneOf")+ce(e,{...t,type:t.type[0]}):e+He("oneOf")+an(t.type.map(r=>ce(0,{...t,type:r})));if(t.oneOf)return t.oneOf.length===1?He("oneOf")+ce(e,t.oneOf[0]):e+He("oneOf")+an(t.oneOf.map(r=>ce(0,r)));if(t.anyOf)return t.anyOf.length===1?He("anyOf")+ce(e,t.anyOf[0]):e+He("anyOf")+an(t.anyOf.map(r=>ce(0,r)));if(t.allOf)return t.allOf.length===1?He("allOf")+ce(e,t.allOf[0]):e+He("allOf")+an(t.allOf.map(r=>ce(0,r)));if(!t.type)return e;if(Bt(t.type))return t.enum?e+lb(t)+He("enum")+an(t.enum.map(r=>ce(0,r))):e+lb(t);if(t.type==="array")return t.items?He("array")+ce(e,t.items):He("array")+ce(e);if(t.type==="object"||t.properties||t.additionalProperties){if(t.properties){let r=Object.values(t.properties);e+=He("object")+an(r.map(n=>ce(0,n)))}else e+=He("empty-object");t.additionalProperties&&(typeof t.additionalProperties=="object"?e+=ce(0,t.additionalProperties):e+=ce(1))}return e}o(ce,"getOpenAPISchemaComplexity");function lb(e){return Se(e.type).with("string","number","integer","boolean",()=>1).otherwise(()=>0)}o(lb,"complexityByType");function He(e){return Se(e).with("oneOf",()=>2).with("anyOf",()=>3).with("allOf",()=>2).with("enum","array","empty-object",()=>1).with("object",()=>2).otherwise(()=>0)}o(He,"complexityByComposite");var Ef=class Ef{constructor(t,r,n={referencedBy:[]},i){this.schema=t;this.resolver=r;D(t)&&(this.ref=t.$ref),i&&(this.enumRef=i),this.meta={...n,referencedBy:[...(n==null?void 0:n.referencedBy)??[]]},this.ref&&this.meta.referencedBy.push(this)}code;ref;enumRef;children=[];meta;getCodeString(t,r){var s,a;if(!this.ref&&this.code)return this.code;if(!this.ref)throw new Error("Zod schema is missing both ref and code");let n=(s=this.resolver)==null?void 0:s.getZodSchemaNameByRef(this.ref);if(!n)return this.ref;let i=(a=this.resolver)==null?void 0:a.getTagByZodSchemaName(n);return r!=null&&r.tsNamespaces&&i&&i!==t?`${G({type:"models",tag:i,options:r})}.${n}`:n}get complexity(){return ce(0,this.schema)}assign(t){return this.code=t,this}inherit(t){return t&&t.children.push(this),this}};o(Ef,"ZodSchema");var Ro=Ef;function W({schema:e,resolver:t,meta:r,tag:n}){var g;let i=new Ro(e,t,r),s={parent:i.inherit(r==null?void 0:r.parent),referencedBy:[...i.meta.referencedBy]},a={resolver:t,meta:s,tag:n};if(D(e))return SC({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});let c=_C({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(c)return c;let u=bC({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(u)return u;let l=PC({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(l)return l;let f=EC({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(f)return f;let p=$C({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(p)return p;let d=t.options.allReadonly?".readonly()":"";if(pa(e))return e.items?i.assign(`z.array(${W({...a,schema:e.items}).getCodeString(n,t.options)}${kt({schema:e.items,meta:{...s,isRequired:!0},options:t.options})})${d}`):i.assign(`z.array(z.any())${d}`);let m=e.type?e.type.toLowerCase():void 0;if(m==="object"||e.properties||e.additionalProperties){let y=e.required&&e.required.length>0,v=t.options.withImplicitRequiredProps?!1:e.properties&&!((g=e.required)!=null&&g.length),S="{}";e.properties&&(S="{ "+Object.entries(e.properties).map(([T,R])=>{var re;let K={...s,isRequired:v?!0:y?(re=e.required)==null?void 0:re.includes(T):t.options.withImplicitRequiredProps,name:T,isParentPartial:v},oe=R;if(D(R)&&t&&(oe=t.getSchemaByRef(R.$ref),!oe))throw new Error(`Schema ${R.$ref} not found`);let X=W({...a,schema:R,meta:K}).getCodeString(n,t.options)+kt({schema:oe,meta:K,options:t.options});return[T,X]}).map(([T,R])=>`${_S(T)}: ${R}`).join(", ")+" }");let b="";e.additionalProperties&&(b=`.catchall(${typeof e.additionalProperties=="object"&&Object.keys(e.additionalProperties).length>0?W({...a,schema:e.additionalProperties}).getCodeString(n,t.options)+kt({schema:e.additionalProperties,meta:{...s,isRequired:!0},options:t.options}):"z.any()"})`);let P=v?".partial()":"",E=t.options.strictObjects?".strict()":"";return i.assign(`z.object(${S})${P}${E}${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(W,"getZodSchema");function SC({schema:e,zodSchema:t,resolver:r,meta:n,tag:i}){if(!D(e))return;let s=t.meta.referencedBy.slice(0,-1).map(u=>u.ref?r.getZodSchemaNameByRef(u.ref)??u.ref:void 0).filter(Boolean),a=r.getZodSchemaNameByRef(e.$ref);if(s.length>1&&s.includes(a))return t.assign(r.getCodeByZodSchemaName(t.ref));let c=r.getCodeByZodSchemaName(e.$ref);if(!c){let u=r.getSchemaByRef(e.$ref);if(!u)throw new Error(`Schema ${e.$ref} not found`);c=W({schema:u,resolver:r,meta:n,tag:i}).getCodeString(i,r.options)}return r.getCodeByZodSchemaName(a)||r.setZodSchema(a,c,i),t}o(SC,"getReferenceZodSchema");function bC({schema:e,zodSchema:t,resolver:r,meta:n,tag:i}){var a;if(!Oe(e)||!e.oneOf)return;if(e.oneOf.length===1){let c=W({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=>Oe(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=>W({schema:u,resolver:r,meta:n,tag:i}).getCodeString(i,r.options)).join(", ")}])
|
|
76
76
|
`)}return t.assign(`z.union([${e.oneOf.map(c=>W({schema:c,resolver:r,meta:n,tag:i}).getCodeString(i,r.options)).join(", ")}])`)}o(bC,"getOneOfZodSchema");function _C({schema:e,zodSchema:t,resolver:r,meta:n,tag:i}){if(!(!Oe(e)||!Array.isArray(e.type)))return e.type.length===1?W({schema:{...e,type:e.type[0]},resolver:r,meta:n,tag:i}):t.assign(`z.union([${e.type.map(s=>W({schema:{...e,type:s},resolver:r,meta:n,tag:i}).getCodeString(i,r.options)).join(", ")}])`)}o(_C,"getArrayZodSchema");function PC({schema:e,zodSchema:t,resolver:r,meta:n,tag:i}){if(!Oe(e)||!e.anyOf)return;if(e.anyOf.length===1){let a=W({schema:e.anyOf[0],resolver:r,meta:n,tag:i});return t.assign(a.getCodeString(i,r.options))}let s=e.anyOf.map(a=>W({schema:a,resolver:r,meta:n,tag:i})).map(a=>a.getCodeString(i,r.options)).join(", ");return t.assign(`z.union([${s}])`)}o(PC,"getAnyOfZodSchema");function EC({schema:e,zodSchema:t,resolver:r,meta:n,tag:i}){if(!Oe(e)||!e.allOf)return;if(e.allOf.length===1){let p=W({schema:e.allOf[0],resolver:r,meta:n,tag:i});return t.assign(p.getCodeString(i,r.options))}let{patchRequiredSchemaInLoop:s,noRequiredOnlyAllof:a,composedRequiredSchema:c}=cS(e),u=a.map(p=>{let d=W({schema:p,resolver:r,meta:n,tag:i});return r&&s(p,r.getSchemaByRef.bind(r)),d});c.required.length&&u.push(W({schema:c,resolver:r,meta:n,tag:i}));let l=u.at(0),f=u.slice(1).map(p=>`merge(${p.getCodeString(i,r.options)})`).join(".");return t.assign(`${l.getCodeString(i,r.options)}.${f}`)}o(EC,"getAllOfZodSchema");function $C({schema:e,zodSchema:t,resolver:r,meta:n,tag:i}){if(!Oe(e))return;let s=e.type?e.type.toLowerCase():void 0;if(s&&Bt(s)){if(e.enum){if(s==="string")return OC({schema:e,zodSchema:t,resolver:r,meta:n,tag:i});if(e.enum.some(a=>typeof a=="string"))return t.assign("z.never()");if(e.enum.length===1){let a=e.enum[0];return t.assign(`z.literal(${a===null?"null":a})`)}return t.assign(`z.union([${e.enum.map(a=>`z.literal(${a===null?"null":a})`).join(", ")}])`)}return t.assign(Se(s).with("integer",()=>"z.number()").with("string",()=>Se(e.format).with("binary",()=>sa).otherwise(()=>aa)).otherwise(a=>`z.${a}()`))}}o($C,"getPrimitiveZodSchema");function OC({resolver:e,schema:t,zodSchema:r,meta:n,tag:i}){var l;if(!Oe(t))return;let s=ui(t);if(!e.options.extractEnums)return r.assign(s);let a=e.getEnumZodSchemaDataByCode(s);if(a)return((l=r.meta.parent)==null?void 0:l.ref)===e.getRefByZodSchemaName(a.zodSchemaName)?r.assign(a.code):new Ro({$ref:e.getRefByZodSchemaName(a.zodSchemaName)},e,n).inherit(r).assign(s);let c=e.getExtractedEnumZodSchemaDataByCode(s);if(!c)return r.assign(s);if(!c.zodSchemaName||!c.tag)throw new Error(`Enum zod schema name or tag not resolved for code: ${s}`);let u=e.options.tsNamespaces&&c.tag!==i?`${G({type:"models",tag:c.tag,options:e.options})}.`:"";return r.assign(`${u}${c.zodSchemaName}`)}o(OC,"getEnumZodSchema");function ui(e){var t;return`${ho}([${(t=e.enum)==null?void 0:t.map(r=>r===null?"null":`"${r}"`).join(", ")}])`}o(ui,"getEnumZodSchemaCode");function pb(e){return`${ho}([${e.map(t=>`"${t}"`).join(", ")}])`}o(pb,"getEnumZodSchemaCodeFromEnumNames");function li({schema:e,zodSchema:t,fallbackName:r,resolver:n,tag:i}){var c;let s=t.getCodeString();if((!pe(s)||t.ref===void 0)&&r){if(t.complexity<ff)return s;let u=Nt(r,n.options.schemaSuffix);for(;n.getCodeByZodSchemaName(u);){if((c=n.getZodSchemaNamesByCompositeCode(s))!=null&&c.includes(u))return u;if(n.getCodeByZodSchemaName(u)===u)return u;throw new Error(`Can't uniquely resolve zod schema name: ${u}`)}return n.setZodSchema(u,s,i),n.addZodSchemaForCompositeCode(s,t,u,e),u}let a=n.getCodeByZodSchemaName(s);if(!a&&t.ref&&(a=n.getCodeByZodSchemaName(n.getZodSchemaNameByRef(t.ref))),t.ref&&a)return ce(0,n.getSchemaByRef(t.ref))<ff?n.getCodeByZodSchemaName(s):s;if(t.ref)return n.getZodSchemaNameByRef(t.ref);throw new Error(`Invalid ref: ${t.ref}`)}o(li,"resolveZodSchemaName");function fb({resolver:e,endpoint:t,operation:r}){let n=r["x-acl"];return n==null?void 0:n.map(i=>{let s=Object.keys(i.conditions??{}).reduce((a,c)=>{let u=xC({resolver:e,endpoint:t,acl:n,name:c});return u?[...a,u]:(e.validationErrors.push(ab(c,r,t)),a)},[]);return{...i,conditionsTypes:s}})}o(fb,"getEndpointAcl");function xC({resolver:e,endpoint:t,acl:r,name:n}){var p,d,m,g,y,v,S,b,P,E;let i=(d=(p=r[0])==null?void 0:p.conditions)==null?void 0:d[n];if(!i)return;let s=i.replace(/^\$[^.]*\./,"").split("."),a,c,u,l=0,f=t.parameters.find(({name:_})=>_===s[l]);if(f)c=(m=f.parameterObject)==null?void 0:m.required,a=(g=f.parameterObject)==null?void 0:g.schema,u=`${f.name} ${_r(f.type)} parameter`,l++;else{let _=t.parameters.find(({bodyObject:K})=>!!K),R=Object.keys(((y=_==null?void 0:_.bodyObject)==null?void 0:y.content)??{}).find(We);R&&(a=(b=(S=(v=_==null?void 0:_.bodyObject)==null?void 0:v.content)==null?void 0:S[R])==null?void 0:b.schema,u=`${we(t)?"query":"mutation"} data`)}for(;a&&l<s.length;){let _=e.resolveObject(a);a=(P=Object.entries(_.properties??{}).find(([R])=>R===s[l]))==null?void 0:P[1],c=((E=_.required)==null?void 0:E.includes(s[l]))??!1,l++}if(a)return{name:n,type:D(a)?void 0:a.type,zodSchemaName:D(a)?e.getZodSchemaNameByRef(a.$ref):void 0,required:c,info:u}}o(xC,"getEndpointAclConditionPropertyType");function db({resolver:e,operation:t,operationName:r,isUniqueOperationName:n,tag:i}){var m,g;let s=e.resolveObject(t.requestBody);if(!s)return;let c=Object.keys(s.content??{}).find(We);if(!c)return;let u=(g=(m=s.content)==null?void 0:m[c])==null?void 0:g.schema;if(!u)return;let l=W({schema:u,resolver:e,meta:{isRequired:s.required??!0},tag:i}),f=e.resolveObject(u),p=li({schema:f,zodSchema:l,fallbackName:ya(tn(r,n,i)),resolver:e,tag:i}),d=kt({schema:f,meta:l.meta,options:e.options});return{endpointParameter:{name:ua,type:"Body",description:s.description,zodSchema:p+d,bodyObject:s},requestFormat:c}}o(db,"getEndpointBody");function mb({resolver:e,param:t,operationName:r,isUniqueOperationName:n,tag:i}){let s=e.resolveObject(t);if(!pS.includes(s.in))return;let a={};if(s.content){let m=Object.keys(s.content??{}),g=m.find(We);if(!g)throw new Error(`Unsupported media type for param ${s.name}: ${m.join(", ")}`);let y=s.content[g];if(!y)throw new Error(`No content with media type for param ${s.name}: ${g}`);a=(y==null?void 0:y.schema)??y}else s.schema&&(a=s.schema);e.options.withDescription&&a&&(a.description=(s.description??"").trim());let c=IS(tn(r,n,i),s.name),u;if(xS(s)){let m=$o(c,e.options.enumSuffix,e.options.schemaSuffix),g=pb(s["x-enumNames"]);e.setZodSchema(m,g,i),u=m}let l=W({schema:a,resolver:e,meta:{isRequired:s.in==="path"?!0:s.required??!1},tag:i}),f=e.resolveObject(a),p=kt({schema:f,meta:l.meta,options:e.options}),d=li({schema:f,zodSchema:l.assign(l.getCodeString(i)+p),fallbackName:c,resolver:e,tag:i});return{name:Se(s.in).with("path",()=>yf(s.name)).otherwise(()=>s.name),type:Se(s.in).with("header",()=>"Header").with("query",()=>"Query").with("path",()=>"Path").run(),zodSchema:d,parameterObject:s,parameterSortingEnumSchemaName:u}}o(mb,"getEndpointParameter");function gb(e){var r,n,i,s,a;let t=[];for(let c in e.openApiDoc.paths){if(en(c,e.options))continue;let u=e.openApiDoc.paths[c],l=sn(u,Jr),f=hb(u.parameters??[]);for(let p in l){let d=l[p];if(!d||ci(d,e.options))continue;let m=d.operationId&&d.operationId!==At(d.operationId);d.operationId&&m&&e.validationErrors.push(nb(d.operationId));let g=Object.entries({...f,...hb(d.parameters??[])}).map(([,_])=>_),y=Io({path:c,method:p,operation:d,operationsByTag:e.operationsByTag,options:e.options}),v=e.operationNames.filter(_=>_===y).length<=1,S=Pr(d,e.options),b={method:p,path:OS(c),operationName:y,description:d.description,summary:d.summary,tags:(r=d.tags)==null?void 0:r.map(Rt),requestFormat:"application/json",parameters:[],response:"",errors:[],responseStatusCodes:[],mediaUpload:!!d["x-media-upload"],mediaDownload:!!d["x-media-download"]};if(d.requestBody){let _=db({resolver:e,operation:d,operationName:y,isUniqueOperationName:v,tag:S});_&&(b.parameters.push(_.endpointParameter),b.requestFormat=_.requestFormat)}for(let _ of g){let T=mb({resolver:e,param:_,operationName:y,isUniqueOperationName:v,tag:S});T&&b.parameters.push(T)}let P=AC(b);P.forEach(_=>{b.parameters.push(_)}),P.length>0&&e.validationErrors.push(ib(P,c));for(let _ in d.responses){b.responseStatusCodes.push(_);let T=e.resolveObject(d.responses[_]),K=Object.keys(T.content??{}).find(oi),oe,X;if(K?(b.responseFormat=K,oe=(i=(n=T.content)==null?void 0:n[K])==null?void 0:i.schema):(X=mo,_==="200"&&e.validationErrors.push(cb({received:"200",expected:"204"},d,b))),oe){let re=W({schema:oe,resolver:e,meta:{isRequired:!0},tag:S}),_e=e.resolveObject(oe);X=li({schema:_e,zodSchema:re,fallbackName:re.ref?void 0:va({statusCode:_,operationName:y,isUniqueOperationName:v,tag:S}),resolver:e,tag:S})+kt({schema:_e,meta:re.meta,options:e.options})}if(X){let re=Number(_);_o(re)&&!b.response?(b.response=X,b.responseObject=T,b.responseDescription=T.description):_!=="default"&&ma(re)&&b.errors.push({zodSchema:X,status:re,description:T.description})}}b.response||(b.response=mo);let E=Object.keys(d.responses).map(Number).filter(_o);E.length>1&&e.validationErrors.push(ub(E.map(String),d,b)),b.acl=fb({resolver:e,endpoint:b,operation:d}),(s=d.security)!=null&&s[0].Authorization&&!b.responseStatusCodes.includes("401")&&e.validationErrors.push(Pf("401",d,b)),(a=b.acl)!=null&&a[0]&&!b.responseStatusCodes.includes("403")&&e.validationErrors.push(Pf("403",d,b)),t.push(b)}}return t}o(gb,"getEndpointsFromOpenAPIDoc");function hb(e){return Object.fromEntries((e??[]).map(t=>[D(t)?t.$ref:t.name,t]))}o(hb,"getParameters");function AC(e){return[...e.path.matchAll(/:([a-zA-Z0-9_]+)/g)].map(r=>r[1]).filter(r=>e.parameters.findIndex(({name:n})=>n===r)===-1).map(r=>wC(r))}o(AC,"getMissingPathParameters");function wC(e){return{name:e,type:"Path",zodSchema:aa,parameterObject:{name:e,required:!0,in:"path",schema:{type:"string"}}}}o(wC,"getPathParameterFromName");function yb(e,t){let r=IC(e,t),n=TC(e,r);return{refsDependencyGraph:r,deepDependencyGraph:n}}o(yb,"getOpenAPISchemaDependencyGraph");function IC(e,t){let r={},n={};return e.forEach(i=>RC({schema:t(i),fromRef:i,getSchemaByRef:t,visitedRefs:r,refsDependencyGraph:n})),n}o(IC,"getRefsDependencyGraph");function TC(e,t){let r={},n={},i=o((s,a)=>{n[a].add(s),t[s]&&a!==s&&t[s].forEach(c=>{let u=`${a}__${c}`;r[u]||(r[u]=!0,i(c,a))})},"visit");return e.forEach(s=>{let a=t[s];a&&(n[s]||(n[s]=new Set),a.forEach(c=>i(c,s)))}),n}o(TC,"getDeepRefsDependencyGraph");function RC({schema:e,fromRef:t,getSchemaByRef:r,visitedRefs:n={},refsDependencyGraph:i={}}){let s=o(a=>{if(a.type!=="reference"||!a.data)return;let{schema:c,data:u}=a;if(i[u.fromRef]||(i[u.fromRef]=new Set),i[u.fromRef].add(c.$ref),n[c.$ref])return!0;n[u.fromRef]=!0,Ae(r(c.$ref),{data:{fromRef:c.$ref},onSchema:s})},"onSchema");return Ae(e,{data:{fromRef:t},onSchema:s}),{visitedRefs:n,refsDependencyGraph:i}}o(RC,"getSchemaRefsDependencyGraph");function Ea(e,t,r){let n=[];return Ae(t,{onSchema:o(s=>{s.type==="reference"?n.push(s.schema):D(s.parentSchema)&&(s.type==="property"?e.validationErrors.push(To(`${r} has both reference and properties`)):s.type==="additionalProperties"?e.validationErrors.push(To(`${r} has both reference and additionalProperties`)):s.type==="array"?e.validationErrors.push(To(`${r} is both reference and array schema`)):s.type==="composite"&&e.validationErrors.push(To(`${r} has both reference and composite keyword`)))},"onSchema")}),n}o(Ea,"getSchemaRefObjs");function vb(e,t){return t.map(i=>Xr(i.$ref)).reduce((i,s)=>{let a=e.dependencyGraph.deepDependencyGraph[s];return[...i,s,...Array.from(a??[])]},[])}o(vb,"getDeepSchemaRefObjs");function Sb(e){e.extractedEnumZodSchemaData.forEach(r=>{let n=r.meta.zodSchemaNameSegments.map(s=>s[s.length-1]).filter(Boolean),i=mf(n);if(!i)throw new Error(`No common last segment found for enum: ${r.code}`);r.zodSchemaName=$o(i,e.options.enumSuffix,e.options.schemaSuffix)});let t=0;for(;t<5&&!$f(e);)NC(e,t+2),t++;if($f(e)||e.extractedEnumZodSchemaData.filter(n=>!bb(e,n)).forEach(n=>{n.zodSchemaName=$o(n.meta.zodSchemaNameSegments[0].map(i=>Of(U(i))).join(""),e.options.enumSuffix,e.options.schemaSuffix)}),!$f(e))throw new Error("Failed to resolve unique names for enum zod schemas")}o(Sb,"resolveExtractedEnumZodSchemaNames");function $f(e){return e.extractedEnumZodSchemaData.every(t=>bb(e,t))}o($f,"allExtractedEnumZodSchemaNamesAreUnique");function NC(e,t){e.extractedEnumZodSchemaData.forEach(r=>{let n=e.extractedEnumZodSchemaData.filter(({zodSchemaName:i})=>r.zodSchemaName===i);n.length!==1&&CC(n,t)})}o(NC,"additionalResolveExtractedEnumZodSchemaName");function CC(e,t=2){e.forEach(r=>{let n=r.meta.zodSchemaNameSegments.map(i=>i[i.length-t]).filter(Boolean);if(n.length===1){let i=[Of(U(n[0])),r.zodSchemaName].filter(Boolean).join("");r.zodSchemaName=i}else{let i=mf(n),s=[i?Of(U(i)):"",r.zodSchemaName].filter(Boolean).join("");r.zodSchemaName=s}})}o(CC,"suffixWithPreviousSegmentName");function bb(e,t){return e.extractedEnumZodSchemaData.filter(({zodSchemaName:r})=>t.zodSchemaName===r).length===1}o(bb,"isUnique");function Of(e){return e.replace(/(Dto|DTO|Response|Request)/g,"")}o(Of,"sanitizeName");function _b(e){e.extractedEnumZodSchemaData.forEach(t=>{let r=Fe(t.meta.tags);t.tag=r.length===1?r[0]:e.options.defaultTag})}o(_b,"resolveExtractedEnumZodSchemaTags");function No({schema:e,nameSegments:t=[],includeSelf:r,...n}){r&&Pb({schema:e,nameSegments:t,...n}),Ae(e,{data:{nameSegments:t},onSchema:o(s=>{var c;if(s.type==="reference")return!0;let a=[...((c=s.data)==null?void 0:c.nameSegments)??[]];s.type==="property"&&a.push(s.propertyName),Pb({schema:s.schema,nameSegments:[...a],...n})},"onSchema")})}o(No,"updateExtractedEnumZodSchemaData");function Pb({resolver:e,schema:t,schemaRef:r,schemaInfo:n,tags:i,nameSegments:s=[]}){if(!t||D(t)||!t.enum)return;let a=ui(t),c=e.extractedEnumZodSchemaData.find(u=>u.code===a);c?(c.meta.zodSchemaNameSegments.push(s),c.meta.tags.push(...i),c.meta.schemaRefs.push(...r?[r]:[]),c.meta.schemas.push(...t?[t]:[])):e.extractedEnumZodSchemaData.push({code:a,meta:{zodSchemaNameSegments:[s],tags:[...i],schemaRefs:r?[r]:[],schemas:t?[t]:[]}}),e.validationErrors.push(ob(r?`${ii(r)}.${s[s.length-1]}`:n??s.join(".")))}o(Pb,"handleExtractedEnumZodSchemaDataUpdate");function Eb(e){var n;let t={},r={};return Object.entries(((n=e.openApiDoc.components)==null?void 0:n.schemas)??{}).forEach(([i,s])=>{let a=e.getSchemaDataByName(i);if(e.options.excludeRedundantZodSchemas&&(!a||a.deepRefOperations.length===0&&a.tags.length===0))return;let c=Nt(i,e.options.schemaSuffix);if(t[c])return;let u=e.getTagByZodSchemaName(c),l=e.resolveObject(s);l.enum?r[c]=ui(l):t[c]=W({schema:s,resolver:e,tag:u}).getCodeString(u)}),{zodSchemas:t,enumZodSchemas:r}}o(Eb,"getZodSchemasFromOpenAPIDoc");function $b(e){var r;let t=[];return Object.entries(((r=e.openApiDoc.components)==null?void 0:r.schemas)??{}).forEach(([n,i])=>{let s=Nt(n,e.options.schemaSuffix),a=e.resolveObject(i);!t.find(c=>c.zodSchemaName===s)&&a.enum&&t.push({zodSchemaName:s,code:ui(a)})}),t}o($b,"getEnumZodSchemasFromOpenAPIDoc");var xf=class xf{constructor(t,r){this.openApiDoc=t;this.options=r;this.dependencyGraph=yb(this.schemaRefs,this.getSchemaByRef.bind(this)),this.enumZodSchemas=$b(this),this.operationsByTag=tb(t,r),this.operationNames=eb(t,this.operationsByTag,r),this.initialize()}schemaData=[];zodSchemaData=[];compositeZodSchemaData=[];dependencyGraph;enumZodSchemas=[];extractedEnumZodSchemaData=[];operationsByTag={};operationNames=[];validationErrors=[];get docSchemas(){var t;return((t=this.openApiDoc.components)==null?void 0:t.schemas)??{}}get schemaRefs(){return Object.keys(this.docSchemas).map(bS)}getSchemaByRef(t){return this.docSchemas[ii(t)]}getSchemaDataByName(t){return this.schemaData.find(r=>r.name===t)}getZodSchemaNameByRef(t){var n,i;let r=((n=this.getSchemaDataByRef(Xr(t)))==null?void 0:n.zodSchemaName)??((i=this.extractedEnumZodSchemaData.find(s=>s.zodSchemaName===t))==null?void 0:i.zodSchemaName);if(!r)throw new Error(`Zod schema not found for ref: ${t}`);return r}getRefByZodSchemaName(t){var r;return(r=this.schemaData.find(n=>n.zodSchemaName===t))==null?void 0:r.ref}getTagByZodSchemaName(t){var u,l;if(!this.options.splitByTags)return this.options.defaultTag;let r=this.extractedEnumZodSchemaData.find(f=>f.zodSchemaName===t);if(r)return Rt(r.tag??this.options.defaultTag);let n=this.getRefByZodSchemaName(t),i=n?((u=this.getSchemaDataByRef(n))==null?void 0:u.tags)??[]:[],s=((l=this.zodSchemaData.find(f=>f.zodSchemaName===t))==null?void 0:l.tags)??[],a=Fe(i,s),c=a.length===1?a[0]:this.options.defaultTag;return Rt(c??this.options.defaultTag)}getCodeByZodSchemaName(t){var r;return(r=this.zodSchemaData.find(n=>n.zodSchemaName===t))==null?void 0:r.code}getZodSchemaNamesByCompositeCode(t){var r;return(r=this.compositeZodSchemaData.find(n=>n.code===t))==null?void 0:r.zodSchemas.map(n=>n.zodSchemaName)}setZodSchema(t,r,n){let i=this.zodSchemaData.find(s=>s.zodSchemaName===t);i?(i.code=r,i.tags=(i.tags??[]).concat(n)):this.zodSchemaData.push({zodSchemaName:t,code:r,tags:[n]})}addZodSchemaForCompositeCode(t,r,n,i){let s={zodSchemaName:n,zodSchema:r,schema:i},a=this.compositeZodSchemaData.find(c=>c.code===t);a?a.zodSchemas.push(s):this.compositeZodSchemaData.push({code:t,zodSchemas:[s]})}getCompositeZodSchemaByZodSchemaName(t){var n;let r=this.compositeZodSchemaData.find(i=>i.zodSchemas.some(s=>s.zodSchemaName===t));return(n=r==null?void 0:r.zodSchemas.find(i=>i.zodSchemaName===t))==null?void 0:n.zodSchema}getSchemaByCompositeZodSchemaName(t){var r,n;return(n=(r=this.compositeZodSchemaData.find(i=>i.zodSchemas.some(s=>s.zodSchemaName===t)))==null?void 0:r.zodSchemas.find(i=>i.zodSchemaName===t))==null?void 0:n.schema}getEnumZodSchemaDataByCode(t){return this.enumZodSchemas.find(r=>r.code===t)}getExtractedEnumZodSchemaDataByCode(t){return this.extractedEnumZodSchemaData.find(r=>r.code===t)}getExtractedEnumZodSchemaNamesReferencedBySchemaRef(t){return this.extractedEnumZodSchemaData.reduce((r,{zodSchemaName:n,meta:i})=>(n&&i.schemaRefs.includes(t)&&r.push(n),r),[])}getZodSchemas(){return this.zodSchemaData.reduce((t,{zodSchemaName:r,code:n})=>({...t,[r]:n}),{})}getExtractedEnumZodSchemas(){return this.extractedEnumZodSchemaData.reduce((t,{zodSchemaName:r,code:n})=>r?{...t,[r]:n}:t,{})}resolveObject(t){return D(t)?this.getSchemaByRef(t.$ref):t}isSchemaCircular(t){var r;return(r=this.dependencyGraph.deepDependencyGraph[t])==null?void 0:r.has(t)}getCircularSchemaChain(t,r=t,n=[],i=[]){var s,a;return i.includes(r)?[]:(i.push(r),(s=this.dependencyGraph.refsDependencyGraph[r])!=null&&s.has(t)?[...n,r,t]:Array.from(((a=this.dependencyGraph.refsDependencyGraph[r])==null?void 0:a.values())??[]).map(c=>{let u=this.getCircularSchemaChain(t,c,n,i);return u.length>0?[r,...u]:u}).flat())}getBaseUrl(){var r,n;let t=(n=(r=this.openApiDoc.servers)==null?void 0:r[0])==null?void 0:n.url;return this.options.baseUrl===""&&t?t:this.options.baseUrl}getZodSchemaObj(t){let r=this.getRefByZodSchemaName(t);if(r)return this.getSchemaByRef(r);let n=this.getSchemaByCompositeZodSchemaName(t);if(n)return n;let i=this.getExtractedEnumZodSchemaDataByName(t);if(i)return i.meta.schemas.reduce((s,a)=>({...s,...this.resolveObject(a)}),{})}getSchemaDataByRef(t){return this.schemaData.find(r=>r.ref===t)}getExtractedEnumZodSchemaDataByName(t){return this.extractedEnumZodSchemaData.find(({zodSchemaName:r})=>r===t)}initialize(){var t,r,n,i,s;this.schemaRefs.forEach(a=>{let c=Xr(a),u=ii(c),l=Nt(u,this.options.schemaSuffix);this.schemaData.push({ref:c,name:u,zodSchemaName:l,tags:[],deepRefOperations:[]})});for(let a in this.openApiDoc.paths){if(en(a,this.options))continue;let c=this.openApiDoc.paths[a],u=sn(c,Jr);for(let l in u){let f=u[l];if(!f||ci(f,this.options))continue;let p=Pr(f,this.options),d=Io({path:a,method:l,operation:f,operationsByTag:this.operationsByTag,options:this.options}),m=this.operationNames.filter(S=>S===d).length<=1,g=ae(tn(d,m,p)),y=[];if((t=f.parameters)==null||t.map(S=>{let b=S,P=b.schema,E=`Operation ${f.operationId??a} parameter ${b.name}`;y.push(...Ea(this,P,E)),this.options.extractEnums&&No({resolver:this,schema:P,schemaInfo:E,tags:[p],nameSegments:[g,b.name],includeSelf:!0})}),f.requestBody){let S=this.resolveObject(f.requestBody),P=Object.keys(S.content??{}).find(We);if(P){let E=(n=(r=S.content)==null?void 0:r[P])==null?void 0:n.schema,_=`Operation ${f.operationId} request body`;y.push(...Ea(this,E,_)),this.options.extractEnums&&No({resolver:this,schema:E,schemaInfo:_,tags:[p],nameSegments:[ya(g)]})}}for(let S in f.responses){let b=this.resolveObject(f.responses[S]),E=Object.keys(b.content??{}).find(oi);if(E){let _=(s=(i=b.content)==null?void 0:i[E])==null?void 0:s.schema,T=`Operation ${f.operationId} response body`;y.push(...Ea(this,_,T)),this.options.extractEnums&&No({resolver:this,schema:_,schemaInfo:T,tags:[p],nameSegments:[va({statusCode:S,operationName:d,isUniqueOperationName:m,tag:p})]})}}vb(this,y).forEach(S=>{let b=this.getSchemaDataByRef(S);b&&(b.tags.push(p),b.deepRefOperations.push(f))})}}this.options.extractEnums&&(this.schemaRefs.forEach(a=>{var u;let c=Xr(a);No({resolver:this,schema:this.getSchemaByRef(c),schemaRef:c,tags:((u=this.getSchemaDataByRef(c))==null?void 0:u.tags)??[],nameSegments:[ii(c)]})}),_b(this),this.handleDuplicateEnumZodSchemas(),Sb(this))}handleDuplicateEnumZodSchemas(){let t=this.enumZodSchemas.map(({code:n})=>n),r=this.enumZodSchemas.filter(({code:n})=>t.includes(n));this.schemaData.forEach(n=>{var a,c;let i=(a=r.find(({zodSchemaName:u})=>u===n.zodSchemaName))==null?void 0:a.code;if(!i)return;let s=this.extractedEnumZodSchemaData.find(({code:u})=>u===i);!s||((c=this.getEnumZodSchemaDataByCode(s.code))==null?void 0:c.zodSchemaName)!==n.zodSchemaName||(n.tags.push(...s.meta.tags??[]),s.meta.schemaRefs.forEach(u=>{this.dependencyGraph.refsDependencyGraph[u]||(this.dependencyGraph.refsDependencyGraph[u]=new Set),this.dependencyGraph.refsDependencyGraph[u].add(n.ref),this.dependencyGraph.deepDependencyGraph[u]||(this.dependencyGraph.deepDependencyGraph[u]=new Set),this.dependencyGraph.deepDependencyGraph[u].add(n.ref)}))}),this.extractedEnumZodSchemaData.splice(0,this.extractedEnumZodSchemaData.length,...this.extractedEnumZodSchemaData.filter(({code:n})=>!t.includes(n)))}};o(xf,"SchemaResolver");var $a=xf;function Ob(e){let t=[],r={};function n(i,s){Array.isArray(s)||(s=[]),s.push(i),r[i]=!0,e[i]&&e[i].forEach(a=>{s.includes(a)||r[a]||n(a,s.slice(0))}),t.includes(i)||t.push(i)}return o(n,"visit"),Object.keys(e).forEach(i=>n(i,[])),t}o(Ob,"topologicalSort");function xb(e,t){let r=Object.entries(e),n=r.filter(([i])=>t.includes(i)).sort(([i],[s])=>t.indexOf(i)-t.indexOf(s)).concat(r.filter(([i])=>!t.includes(i)));return Object.fromEntries(n)}o(xb,"sortObjKeysFromArray");function Ab(e,t){let r=Ob(e.dependencyGraph.deepDependencyGraph).map(i=>e.getZodSchemaNameByRef(i));return xb(t,r)}o(Ab,"sortZodSchemasByTopology");function wb(e,t){let r={};return Object.entries(t).forEach(([n,i])=>{let s=e.getRefByZodSchemaName(n);s&&e.isSchemaCircular(s)?(e.validationErrors.push(sb(e.getCircularSchemaChain(s).join(" -> "))),r[Nt(n,e.options.schemaSuffix)]=`z.lazy(() => ${i})`):r[Nt(n,e.options.schemaSuffix)]=i}),r}o(wb,"wrapCircularZodSchemas");function Oa(e,t){let r=new $a(e,t),n=gb(r),i=Eb(r),s={...i.zodSchemas,...r.getZodSchemas(),...i.enumZodSchemas};return s=wb(r,s),s=Ab(r,s),s={...r.getExtractedEnumZodSchemas(),...s},{resolver:r,data:kC({resolver:r,endpoints:n,zodSchemas:s,options:t})}}o(Oa,"getDataFromOpenAPIDoc");function kC({resolver:e,endpoints:t,zodSchemas:r,options:n}){let i=new Map;return n.splitByTags?(t.forEach(s=>{let a=wo(s,n);Ib(a,i).endpoints.push(s)}),Object.entries(r).forEach(([s,a])=>{let c=e.getTagByZodSchemaName(s);c&&(Ib(c,i).zodSchemas[s]=a)}),i):(i.set(n.defaultTag,{endpoints:t,zodSchemas:r}),i)}o(kC,"splitDataByTags");function Ib(e,t){return t.has(e)||t.set(e,{endpoints:[],zodSchemas:{}}),t.get(e)}o(Ib,"getTagElement");async function Tb(e,t){let{resolver:r,data:n}=await Oa(e,t),i=[],s=[];return n.forEach(({endpoints:c,zodSchemas:u},l)=>{Object.keys(u).forEach(f=>{let p=r.getRefByZodSchemaName(f),d=p?r.getSchemaByRef(p):r.getSchemaByCompositeZodSchemaName(f),m=si({zodSchemaName:f,schema:d,resolver:r}),g;d&&(g=on({schema:d,parentTypes:[m],resolver:r})),i.push({...m,metaType:"primitive",...g})}),c.forEach(f=>{let p="queries",d=Rt(l);s.push({name:ba(f),importPath:rn({type:p,tag:d,includeTagDir:!0,options:t}),namespace:t.tsNamespaces?G({type:p,tag:d,options:t}):void 0,isQuery:we(f),isMutation:Ct(f),params:jC({resolver:r,endpoint:f}),response:qC({resolver:r,endpoint:f})})})}),{openApiDoc:e,models:i,queries:s}}o(Tb,"getMetadataFromOpenAPIDoc");function jC({resolver:e,endpoint:t}){return t.parameters.map(r=>{var a,c,u,l;let n;if((a=r.parameterObject)!=null&&a.schema)n=e.resolveObject(r.parameterObject.schema);else if(r.bodyObject){let p=Object.keys(r.bodyObject.content??{}).find(We);p&&(n=e.resolveObject((u=(c=r.bodyObject.content)==null?void 0:c[p])==null?void 0:u.schema))}let i=si({zodSchemaName:r.zodSchema,schema:n,resolver:e}),s;return n&&(s=on({schema:n,parentTypes:[i],resolver:e})),{name:At(r.name),isRequired:((l=r.parameterObject)==null?void 0:l.required)??!0,...i,...s,paramType:r.type}}).sort((r,n)=>{if(r.isRequired===n.isRequired){let i=["Path","Body","Query","Header"];return i.indexOf(r.paramType)-i.indexOf(n.paramType)}return r.isRequired?-1:1}).map(({paramType:r,...n})=>n)}o(jC,"getQueryMetadataParams");function qC({resolver:e,endpoint:t}){var a,c,u,l;let r,n=Object.keys(((a=t.responseObject)==null?void 0:a.content)??{}).find(oi);n&&(r=e.resolveObject((l=(u=(c=t.responseObject)==null?void 0:c.content)==null?void 0:u[n])==null?void 0:l.schema));let i=si({zodSchemaName:t.response,schema:r,resolver:e}),s;return r&&(s=on({schema:r,parentTypes:[i],resolver:e})),{...i,metaType:"primitive",...s}}o(qC,"getQueryMetadataResponse");var Rb=o(e=>`Use${U(ae(e.operationName))}Ability`,"getAbilityTypeName"),Nb=o(e=>`canUse${U(ae(e.operationName))}`,"getAbilityFunctionName"),Cb=o(e=>{var t;return(t=e.acl)==null?void 0:t[0].action},"getAbilityAction"),kb=o(e=>{var t;return(t=e.acl)==null?void 0:t[0].subject},"getAbilitySubject"),xa=o(e=>{var t;return!!((t=Co(e))!=null&&t.length)},"hasAbilityConditions"),Co=o(e=>{var t;return(t=e.acl)==null?void 0:t[0].conditionsTypes},"getAbilityConditionsTypes"),jb=o(e=>{var t;return(t=e.acl)==null?void 0:t[0].description},"getAbilityDescription"),Aa=o(e=>`${U(e)}${Po}`,"getTagAllAbilitiesName");var bd=et(Qt());var vd=et(require("fs")),xP=et(require("path"));function AP(e){return vd.default.readFileSync(xP.default.join(__dirname,`../${e}`),"utf-8")}o(AP,"readFileSync");function Sd(e){let t=`src/generators/templates/${e}.hbs`;return AP(t)}o(Sd,"readHbsTemplateSync");function wP(e){let t=`src/assets/${e}`;return AP(t)}o(wP,"readAssetSync");function Wt({output:e,fileName:t}){return`${e}/${t}`}o(Wt,"getOutputFileName");var Yt=et(Qt());function IP(){wq(),Iq(),Tq(),Rq(),Nq(),Cq(),kq(),jq()}o(IP,"registerAclHbsHelpers");function wq(){Yt.default.registerHelper("abilityTypeName",Rb)}o(wq,"registerAbilityTypeNameHelper");function Iq(){Yt.default.registerHelper("abilityFunctionName",Nb)}o(Iq,"registerAbilityFunctionNameHelper");function Tq(){Yt.default.registerHelper("ablityAction",Cb)}o(Tq,"registerAbilityActionHelper");function Rq(){Yt.default.registerHelper("ablitySubject",kb)}o(Rq,"registerAbilitySubjectHelper");function Nq(){Yt.default.registerHelper("hasAbilityConditions",xa)}o(Nq,"registerHasAbilityConditionsHelper");function Cq(){Yt.default.registerHelper("abilityConditionsTypes",Co)}o(Cq,"registerAbilityConditionsTypesHelper");function kq(){Yt.default.registerHelper("abilityDescription",jb)}o(kq,"registerAbilityDescriptionHelper");function jq(){Yt.default.registerHelper("tagAllAbilitiesName",Aa)}o(jq,"registerTagAllAbilitiesNameHelper");var zo=et(Qt());function TP(){qq(),Mq(),Dq(),Lq()}o(TP,"registerCommonHbsHelpers");function qq(){zo.default.registerHelper("isEqual",(e,t)=>e===t)}o(qq,"registerIsEqualHelper");function Mq(){zo.default.registerHelper("commaSeparated",e=>e.join(", "))}o(Mq,"registerCommaSeparatedListHelper");function Dq(){zo.default.registerHelper("addAsteriskAfterNewLine",e=>e.replace(/\n/g,`
|
|
77
|
-
*`))}o(Dq,"registerAddAsteriskAfterNewLineHelper");function Lq(){zo.default.registerHelper("jsonStringify",e=>JSON.stringify(e,null,2))}o(Lq,"registerJsonStringifyHelper");var Ir=et(Qt());function RP(e){Fq(),Hq(e.options),Uq(e),Vq(),Bq(),Gq(e),Zq()}o(RP,"registerEndpointsHbsHelpers");function Fq(){Ir.default.registerHelper("endpointName",Ao)}o(Fq,"registerEndpointNameHelper");function Hq(e){Ir.default.registerHelper("importedEndpointName",t=>KS(t,e))}o(Hq,"registerImportedEndpointNameHelper");function Vq(){Ir.default.registerHelper("endpointPath",QS)}o(Vq,"registerEndpointPathHelper");function Bq(){Ir.default.registerHelper("endpointBody",e=>e.parameters.find(t=>t.type==="Body"))}o(Bq,"registerEndpointBodyHelper");function Uq(e){Ir.default.registerHelper("endpointParams",(t,r)=>xr(e,t,r.hash))}o(Uq,"registerEndpointParamsHelper");function Gq(e){Ir.default.registerHelper("endpointArgs",(t,r)=>xr(e,t,r.hash).map(n=>n.name).join(", "))}o(Gq,"registerEndpointArgsHelper");function Zq(){Ir.default.registerHelper("endpointParamDescription",e=>{var s,a,c,u,l;let t=[`${e.paramType} parameter`],r=((s=e.parameterObject)==null?void 0:s.description)||((a=e.bodyObject)==null?void 0:a.description);r&&t.push(r);let n,i;if((c=e.parameterObject)!=null&&c.schema&&Oe(e.parameterObject.schema)&&(n=(u=e.parameterObject)==null?void 0:u.schema),(l=e.bodyObject)!=null&&l.content){let p=Object.keys(e.bodyObject.content??{}).find(We);p&&(i=e.bodyObject.content[p],i.schema&&Oe(i.schema)&&(n=i.schema))}if(n){let f=Oo(n);t.push(...f)}return i!=null&&i.example&&t.push(`Example: \`${i.example}\``),t.join(". ")})}o(Zq,"registerEndpointParamDescriptionHelper");var Te=et(Qt());function NP(e){zq(),Kq(),Qq(),Wq(e),Yq(),Jq(e),Xq(e),e3(e),t3(e),r3(e),n3(),i3(),o3(),s3()}o(NP,"registerPartialsHbsHelpers");function zq(){Te.default.registerHelper("genModelJsDocs",(e,t,r)=>Re("model-js-docs")({name:e,zodSchema:t,tag:r}))}o(zq,"registerGenerateModelJsDocsHelper");function Kq(){Te.default.registerHelper("genImport",e=>Re("import")({import:e}))}o(Kq,"registerImportHelper");function Qq(){Te.default.registerHelper("genEndpointParams",(e,t)=>Re("endpoint-params")({endpoint:e,options:t}))}o(Qq,"registerGenerateEndpointParamsHelper");function Wq(e){Te.default.registerHelper("genEndpointConfig",t=>{let r=WS(t),n=e.options.axiosRequestConfig;return Object.keys(r).length===0?n?hr:"":Re("endpoint-config")({endpointConfig:r,hasAxiosRequestConfig:n,hasBlobResponse:t.response===sa,hasFileDownload:t.mediaDownload,axiosRequestConfigName:hr,generateParse:e.options.parseRequestParams})})}o(Wq,"registerGenerateEndpointConfigHelper");function Yq(){Te.default.registerHelper("genEndpointParamParse",(e,t)=>{var r;return Re("endpoint-param-parse")({param:e,paramName:t,isQuery:e.type==="Query",zodExtended:Ot.name,sortingString:Ot.properties.sortingString,parse:Ot.properties.parse,addOptional:!((r=e.parameterObject??e.bodyObject)!=null&&r.required)&&(e.parameterSortingEnumSchemaName||pe(e.zodSchema))})})}o(Yq,"registerGenerateEndpointParamParseHelper");function Jq(e){Te.default.registerHelper("genQueryKeys",t=>t.length===0?"":Re("query-keys")({queryEndpoints:t,queriesModuleName:vo,generateInfiniteQueries:e.options.infiniteQueries}))}o(Jq,"registerGenerateQueryKeysHelper");function Xq(e){Te.default.registerHelper("genQuery",t=>{if(!we(t))return;let r=e.options.axiosRequestConfig,n=e.options.checkAcl&&t.acl;return Re("query-use-query")({endpoint:t,queryHook:ft.query,hasQueryFn:xr(e,t).length>0||r||n,hasQueryFnBody:n,hasAxiosRequestConfig:r,axiosRequestConfigName:hr,axiosRequestConfigType:xt,hasAclCheck:n,aclCheckHook:Er})})}o(Xq,"registerGenerateQueryHelper");function e3(e){Te.default.registerHelper("genMutation",(t,r)=>{if(!Ct(t))return;let n=YS(t,r),i=JS(e,t,n),s=e.options.checkAcl&&t.acl;return Re("query-use-mutation")({endpoint:t,queryHook:ft.mutation,queriesModuleName:vo,hasAxiosRequestConfig:e.options.axiosRequestConfig,hasMutationFnBody:t.mediaUpload||s,axiosRequestConfigName:hr,axiosRequestConfigType:xt,hasMutationEffects:e.options.mutationEffects,mutationEffectsType:ti.optionsType,updateQueryEndpoints:n,destructuredVariables:i,hasAclCheck:s,aclCheckHook:Er})})}o(e3,"registerGenerateMutationHelper");function t3(e){Te.default.registerHelper("genInfiniteQuery",t=>{if(!e.options.infiniteQueries||!ai(t))return;let r=e.options.checkAcl&&t.acl;return Re("query-use-infinite-query")({endpoint:t,infiniteQueryHook:ft.infiniteQuery,hasQueryFnBody:r,pageParamName:ca.pageParamName,totalItemsName:ca.totalItemsName,limitParamName:ca.limitParamName,hasAxiosRequestConfig:e.options.axiosRequestConfig,axiosRequestConfigName:hr,axiosRequestConfigType:xt,hasAclCheck:r,aclCheckHook:Er})})}o(t3,"registerGenerateInfiniteQueryHelper");function r3(e){Te.default.registerHelper("genQueryJsDocs",(t,r)=>Re("query-js-docs")({endpoint:t,query:r.hash.query,mutation:r.hash.mutation,infiniteQuery:r.hash.infiniteQuery,hasMutationEffects:e.options.mutationEffects,mutationEffectsType:ti.optionsType}))}o(r3,"registerGenerateQueryJsDocsHelper");function n3(){Te.default.registerHelper("genCaslAbilityType",e=>Re("casl-ability-type")({endpoint:e,abilityTupleType:xe.abilityTuple}))}o(n3,"registerGenerateCaslAbilityTypeHelper");function i3(){Te.default.registerHelper("genCaslAbilityFunction",e=>Re("casl-ability-function")({endpoint:e}))}o(i3,"registerGenerateCaslAbilityFunctionHelper");function o3(){Te.default.registerHelper("genCaslAbilityQuery",e=>Re("casl-ability-query")({endpoint:e}))}o(o3,"registerGenerateCaslAbilityQueryHelper");function s3(){Te.default.registerHelper("genAclCheckParams",e=>{var i;let t=(i=Co(e))==null?void 0:i.map(s=>s.name),r=e.parameters.map(s=>s.name),n=t==null?void 0:t.every(s=>r.includes(s));return Re("acl-check-params")({endpoint:e,generateAclCheckParams:xa(e)&&n})})}o(s3,"registerGenerateAclCheckParamsHelper");var bi=et(Qt());function CP(){a3(),u3(),l3(),c3(),p3()}o(CP,"registerQueryHbsHelpers");function a3(){bi.default.registerHelper("queryName",(e,t)=>ba(e,t.hash.mutation))}o(a3,"registerQueryNameHelper");function c3(){bi.default.registerHelper("infiniteQueryName",XS)}o(c3,"registerInfiniteQueryNameHelper");function u3(){bi.default.registerHelper("isQuery",we)}o(u3,"registerIsQueryHelper");function l3(){bi.default.registerHelper("isMutation",Ct)}o(l3,"registerIsMutationHelper");function p3(){bi.default.registerHelper("isInfiniteQuery",e=>ai(e))}o(p3,"registerIsInfiniteQueryHelper");var mn=et(Qt());function kP(e){f3(e.options),d3(e),m3(e),h3(),g3(),y3(e)}o(kP,"registerZodHbsHelpers");function f3(e){mn.default.registerHelper("zodInferedType",t=>xo(t,e))}o(f3,"registerInferedTypeHelper");function d3(e){mn.default.registerHelper("importedZodSchemaName",t=>TS(e,t))}o(d3,"registerImportedZodSchemaNameHelper");function m3(e){mn.default.registerHelper("importedZodSchemaInferedType",t=>$r(e,t))}o(m3,"registerImportedZodSchemaInferedTypeHelper");function h3(){mn.default.registerHelper("zodSchemaType",e=>RS(e))}o(h3,"registerZodSchemaTypeHelper");function g3(){mn.default.registerHelper("zodSchemaDescription",e=>NS(e))}o(g3,"registerZodSchemaDescriptionHelper");function y3(e){mn.default.registerHelper("zodSchemaPropertyDescriptions",(t,r)=>kS(e,t,r))}o(y3,"registerZodSchemaPropertyDescriptionsHelper");var jP=et(Qt());function qP(){v3()}o(qP,"registerImportsHbsHelpers");function v3(){jP.default.registerHelper("importNames",(e,t)=>[...t?[t]:[],...e?[`{ ${e.join(", ")} }`]:[]].join(", "))}o(v3,"registerBindingsHelper");function de(e,t){let r=Sd(t);return TP(),qP(),kP(e),RP(e),CP(),IP(),NP(e),bd.default.compile(r)}o(de,"getHbsTemplateDelegate");function Re(e){let t=Sd(`partials/${e}`);return bd.default.compile(t)}o(Re,"getHbsPartialTemplateDelegate");function MP({resolver:e,data:t,tag:r=""}){var l;let n=(l=t.get(r))==null?void 0:l.endpoints.filter(({acl:f})=>f&&f.length>0);if(!n||n.length===0)return;let i=n.some(({acl:f})=>(f==null?void 0:f[0].conditions)&&Object.keys(f[0].conditions).length>0),s={bindings:[xe.abilityTuple,...i?[xe.forcedSubject,xe.subject]:[]],from:vf.from},a=n.reduce((f,p)=>{var m,g;let d=(g=(m=p.acl)==null?void 0:m[0].conditionsTypes)==null?void 0:g.reduce((y,v)=>[...y,...v!=null&&v.zodSchemaName?[v.zodSchemaName]:[]],[]);return[...f,...d??[]]},[]),c=Or({resolver:e,tag:r,zodSchemasAsTypes:Fe(a)});return de(e,"acl")({caslAbilityTupleImport:s,modelsImports:c,includeNamespace:e.options.tsNamespaces,namespace:G({type:"acl",tag:r,options:e.options}),endpoints:n})}o(MP,"generateAcl");function DP(e,t){let r={bindings:[xe.pureAbility,...t.length===0?[xe.subject,xe.abilityTuple]:[]],from:vf.from},n=qS({tags:t,entityName:Po,getAliasEntityName:Aa,type:"acl",options:e.options}),i=t.map(a=>G({type:"acl",tag:a,options:e.options}));return de(e,"app-acl")({caslAbilityTupleImport:r,imports:n,allAbilities:Po,appAbilities:Eo,includeNamespace:e.options.tsNamespaces,tags:t,namespaces:i,abilityTuple:xe.abilityTuple,subject:xe.subject})}o(DP,"generateAppAcl");function LP({resolver:e,data:t,tag:r=""}){var b;let n=(b=t.get(r))==null?void 0:b.endpoints;if(!n||n.length===0)return;let i={bindings:[fo],from:LS(e.options)},s=e.options.axiosRequestConfig,a=s,c={bindings:s?[xt]:[],from:la.from},u=e.options.parseRequestParams,l=n.reduce((P,E)=>[...P,...E.parameters],[]),f=l.filter(P=>!["Path","Header"].includes(P.type)).map(P=>P.parameterSortingEnumSchemaName??P.zodSchema),p=n.map(P=>P.response),d=Fe([...p,...u?f:[]]),m=d.some(P=>!pe(P)),g=e.options.parseRequestParams&&f.length>0,y={bindings:[Ot.name],from:US(e.options)},v=Or({resolver:e,tag:r,zodSchemas:d.filter(pe),zodSchemasAsTypes:Fe(l.map(P=>P.zodSchema).filter(pe))});return de(e,"endpoints")({appRestClientImport:i,hasAxiosImport:a,axiosImport:c,hasZodImport:m,zodImport:ri,hasZodExtendedImport:g,zodExtendedImport:y,modelsImports:v,includeNamespace:e.options.tsNamespaces,namespace:G({type:"endpoints",tag:r,options:e.options}),restClientName:fo,hasAxiosRequestConfig:s,axiosRequestConfigName:hr,axiosRequestConfigType:xt,endpoints:n,generateParse:u})}o(LP,"generateEndpoints");function FP(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(HP(n)).map(i=>e.getZodSchemaNameByRef(i)):[]}o(FP,"getZodSchemaRefs");function HP(e){return e.children.reduce((r,n)=>{let i=n.ref??n.enumRef;return i&&r.add(i),n.children.length>0&&HP(n).forEach(s=>r.add(s)),r},new Set)}o(HP,"getSchemaRefs");function VP({resolver:e,data:t,tag:r=""}){var u;let n=(u=t.get(r))==null?void 0:u.zodSchemas;if(!n||Object.keys(n).length===0)return;let i=Object.keys(n).reduce((l,f)=>[...l,...FP(e,f)],[]).filter(l=>!n[l]),s=Or({resolver:e,tag:r,zodSchemas:i}),a=Object.entries(n).reduce((l,[f,p])=>{let d=e.getRefByZodSchemaName(f);return{...l,[f]:{code:p,isCircular:!!d&&e.isSchemaCircular(d),isEnum:wS(p),schemaObj:e.getZodSchemaObj(f)}}},{});return de(e,"models")({zodImport:ri,modelsImports:s,includeNamespace:e.options.tsNamespaces,namespace:G({type:"models",tag:r,options:e.options}),tag:r,zodSchemasData:a})}o(VP,"generateModels");function BP({resolver:e,data:t,tag:r=""}){var R;let n=(R=t.get(r))==null?void 0:R.endpoints;if(!n||n.length===0)return;let i=e.options.axiosRequestConfig,s=n.some(({mediaUpload:K})=>K),a=i||s,c={defaultImport:s?sf:void 0,bindings:i?[xt]:[],from:la.from},u=n.filter(we),l=u.filter(K=>ai(K)),f=n.filter(Ct),p={bindings:[...u.length>0?[ft.query]:[],...e.options.infiniteQueries&&l.length>0?[ft.infiniteQuery]:[],...f.length>0?[ft.mutation]:[]],from:sS.from},d=e.options.mutationEffects,m={bindings:[nf],from:HS(e.options)},g=d&&f.length>0,y={bindings:[...f.length>0?[ti.optionsType,ti.hookName]:[]],from:VS(e.options)},v=e.options.checkAcl&&n.some(K=>K.acl),S={bindings:[Er],from:BS(e.options)},b={bindings:[...u.length>0?[Xs.query]:[],...e.options.infiniteQueries&&l.length>0?[Xs.infiniteQuery]:[],...f.length>0?[Xs.mutation]:[]],from:FS(e.options)},P=n.reduce((K,oe)=>[...K,...oe.parameters],[]),E=Or({resolver:e,tag:r,zodSchemasAsTypes:Fe(P.map(K=>K.zodSchema).filter(pe))}),_=jS({tag:r,endpoints:n,options:e.options});return de(e,"queries")({hasAxiosImport:a,axiosImport:c,queryImport:p,hasMutationEffects:d,queryModulesImport:m,hasMutationEffectsImport:g,mutationEffectsImport:y,hasAclCheck:v,aclCheckImport:S,queryTypesImport:b,modelsImports:E,endpointsImports:_,includeNamespace:e.options.tsNamespaces,tag:r,namespace:G({type:"queries",tag:r,options:e.options}),queriesModuleName:vo,queryModuleEnum:nf,endpoints:n,queryEndpoints:u})}o(BP,"generateQueries");function UP(e){return de(e,"acl-check")({abilityContextImport:{...Jv,from:e.options.abilityContextImportPath},appAbilitiesImport:{bindings:[Eo],from:GS()},errorHandlingImport:{...ea,from:e.options.errorHandlingImportPath},abilityContext:rf,appAbilities:Eo,errorHandler:mr.ErrorHandler,sharedErrorHandler:mr.SharedErrorHandler,aclCheckHook:Er})}o(UP,"generateAclCheck");function GP(e){return de(e,"app-rest-client")({appRestClientName:fo,baseUrl:e.getBaseUrl()})}o(GP,"generateAppRestClient");function ZP({resolver:e,data:t}){let r=[];return t.forEach((i,s)=>{var c;let a=(c=t.get(s))==null?void 0:c.endpoints;!a||a.length===0||r.push({tag:s,namespace:G({type:"queries",tag:s,options:e.options})})}),de(e,"query-modules")({modules:r})}o(ZP,"generateQueryModules");function zP(e){return de(e,"zod")({zodImport:ri,zodExtension:Ot.name,sortingString:Ot.properties.sortingString,parse:Ot.properties.parse,errorHandler:mr.ErrorHandler,sharedErrorHandler:mr.SharedErrorHandler,errorHandlingImport:{...ea,from:e.options.errorHandlingImportPath}})}o(zP,"generateZod");function KP(e,t){return t.options.acl?[{fileName:Wt({output:t.options.output,fileName:nn(ha)}),content:DP(t,e)},...t.options.checkAcl?[{fileName:Wt({output:t.options.output,fileName:nn(ga)}),content:UP(t)}]:[]]:[]}o(KP,"getAclFiles");function QP(e,t){return t.options.mutationEffects?[...JP([Xv,ia],t),{fileName:Wt({output:t.options.output,fileName:nn(na)}),content:ZP({resolver:t,data:e})}]:[]}o(QP,"getMutationEffectsFiles");function WP(e){return e.options.standalone?[...JP(Object.values(ta),e),{fileName:Wt({output:e.options.output,fileName:nn(ra)}),content:GP(e)}]:[]}o(WP,"getStandaloneFiles");function YP(e,t){if(!Array.from(e.values()).some(({endpoints:i})=>i.some(s=>s.parameters.some(a=>a.parameterSortingEnumSchemaName))))return[];let n=zP(t);return n?[{fileName:Wt({output:t.options.output,fileName:nn(oa)}),content:n}]:[]}o(YP,"getZodExtendedFiles");function JP(e,t){return e.reduce((r,n)=>[...r,S3(n,t)],[])}o(JP,"getAssetFiles");function S3(e,t){let r=nn(e);return{fileName:Wt({output:t.options.output,fileName:r}),content:wP(r)}}o(S3,"getAssetFile");function XP(e,t){let r=t.standalone&&t.importPath==="ts"?"relative":t.importPath,n={...go,...t,importPath:r},{resolver:i,data:s}=Oa(e,n),a=[],c=[],u=["models","endpoints","queries","acl"],l={models:VP,endpoints:LP,queries:BP,acl:MP};return s.forEach((f,p)=>{u.forEach(d=>{let m=l[d]({resolver:i,data:s,tag:p});if(m){let g=Wt({output:n.output,fileName:DS({tag:p,type:d,options:n})});a.push({fileName:g,content:m}),d==="acl"&&c.push(p)}})}),a.push(...KP(c,i),...QP(s,i),...YP(s,i),...WP(i)),a}o(XP,"generateCodeFromOpenAPIDoc");async function b3({input:e,options:t}){let r={...go,...t},n=await _d.default.bundle(e);return await Tb(n,r)}o(b3,"getGenerateMetadata");async function _3({input:e,options:t}){let r={...go,...t},n=await _d.default.bundle(e);return XP(n,r)}o(_3,"getGenerateFilesData");0&&(module.exports={getGenerateFilesData,getGenerateMetadata});
|
|
77
|
+
*`))}o(Dq,"registerAddAsteriskAfterNewLineHelper");function Lq(){zo.default.registerHelper("jsonStringify",e=>JSON.stringify(e,null,2))}o(Lq,"registerJsonStringifyHelper");var Ir=et(Qt());function RP(e){Fq(),Hq(e.options),Uq(e),Vq(),Bq(),Gq(e),Zq()}o(RP,"registerEndpointsHbsHelpers");function Fq(){Ir.default.registerHelper("endpointName",Ao)}o(Fq,"registerEndpointNameHelper");function Hq(e){Ir.default.registerHelper("importedEndpointName",t=>KS(t,e))}o(Hq,"registerImportedEndpointNameHelper");function Vq(){Ir.default.registerHelper("endpointPath",QS)}o(Vq,"registerEndpointPathHelper");function Bq(){Ir.default.registerHelper("endpointBody",e=>e.parameters.find(t=>t.type==="Body"))}o(Bq,"registerEndpointBodyHelper");function Uq(e){Ir.default.registerHelper("endpointParams",(t,r)=>xr(e,t,r.hash))}o(Uq,"registerEndpointParamsHelper");function Gq(e){Ir.default.registerHelper("endpointArgs",(t,r)=>xr(e,t,r.hash).map(n=>n.name).join(", "))}o(Gq,"registerEndpointArgsHelper");function Zq(){Ir.default.registerHelper("endpointParamDescription",e=>{var s,a,c,u,l;let t=[`${e.paramType} parameter`],r=((s=e.parameterObject)==null?void 0:s.description)||((a=e.bodyObject)==null?void 0:a.description);r&&t.push(r);let n,i;if((c=e.parameterObject)!=null&&c.schema&&Oe(e.parameterObject.schema)&&(n=(u=e.parameterObject)==null?void 0:u.schema),(l=e.bodyObject)!=null&&l.content){let p=Object.keys(e.bodyObject.content??{}).find(We);p&&(i=e.bodyObject.content[p],i.schema&&Oe(i.schema)&&(n=i.schema))}if(n){let f=Oo(n);t.push(...f)}return i!=null&&i.example&&t.push(`Example: \`${i.example}\``),t.join(". ")})}o(Zq,"registerEndpointParamDescriptionHelper");var Te=et(Qt());function NP(e){zq(),Kq(),Qq(),Wq(e),Yq(),Jq(e),Xq(e),e3(e),t3(e),r3(e),n3(),i3(),o3(),s3()}o(NP,"registerPartialsHbsHelpers");function zq(){Te.default.registerHelper("genModelJsDocs",(e,t,r)=>Re("model-js-docs")({name:e,zodSchema:t,tag:r}))}o(zq,"registerGenerateModelJsDocsHelper");function Kq(){Te.default.registerHelper("genImport",e=>Re("import")({import:e}))}o(Kq,"registerImportHelper");function Qq(){Te.default.registerHelper("genEndpointParams",(e,t)=>Re("endpoint-params")({endpoint:e,options:t}))}o(Qq,"registerGenerateEndpointParamsHelper");function Wq(e){Te.default.registerHelper("genEndpointConfig",t=>{let r=WS(t),n=e.options.axiosRequestConfig;return Object.keys(r).length===0?n?hr:"":Re("endpoint-config")({endpointConfig:r,hasAxiosRequestConfig:n,hasBlobResponse:t.response===sa,hasFileDownload:t.mediaDownload,axiosRequestConfigName:hr,generateParse:e.options.parseRequestParams})})}o(Wq,"registerGenerateEndpointConfigHelper");function Yq(){Te.default.registerHelper("genEndpointParamParse",(e,t)=>{var r;return Re("endpoint-param-parse")({param:e,paramName:t,isQuery:e.type==="Query",zodExtended:Ot.name,sortingString:Ot.properties.sortingString,parse:Ot.properties.parse,addOptional:!((r=e.parameterObject??e.bodyObject)!=null&&r.required)&&(e.parameterSortingEnumSchemaName||pe(e.zodSchema))})})}o(Yq,"registerGenerateEndpointParamParseHelper");function Jq(e){Te.default.registerHelper("genQueryKeys",t=>t.length===0?"":Re("query-keys")({queryEndpoints:t,queriesModuleName:vo,generateInfiniteQueries:e.options.infiniteQueries}))}o(Jq,"registerGenerateQueryKeysHelper");function Xq(e){Te.default.registerHelper("genQuery",t=>{if(!we(t))return;let r=e.options.axiosRequestConfig,n=e.options.checkAcl&&t.acl;return Re("query-use-query")({endpoint:t,queryHook:ft.query,hasQueryFn:xr(e,t).length>0||r||n,hasQueryFnBody:n,hasAxiosRequestConfig:r,axiosRequestConfigName:hr,axiosRequestConfigType:xt,hasAclCheck:n,aclCheckHook:Er})})}o(Xq,"registerGenerateQueryHelper");function e3(e){Te.default.registerHelper("genMutation",(t,r)=>{if(!Ct(t))return;let n=YS(t,r),i=JS(e,t,n),s=e.options.checkAcl&&t.acl;return Re("query-use-mutation")({endpoint:t,queryHook:ft.mutation,queriesModuleName:vo,hasAxiosRequestConfig:e.options.axiosRequestConfig,hasMutationFnBody:t.mediaUpload||s,axiosRequestConfigName:hr,axiosRequestConfigType:xt,hasMutationEffects:e.options.mutationEffects,mutationEffectsType:ti.optionsType,updateQueryEndpoints:n,destructuredVariables:i,hasAclCheck:s,aclCheckHook:Er})})}o(e3,"registerGenerateMutationHelper");function t3(e){Te.default.registerHelper("genInfiniteQuery",t=>{if(!e.options.infiniteQueries||!ai(t))return;let r=e.options.checkAcl&&t.acl;return Re("query-use-infinite-query")({endpoint:t,infiniteQueryHook:ft.infiniteQuery,hasQueryFnBody:r,pageParamName:ca.pageParamName,totalItemsName:ca.totalItemsName,limitParamName:ca.limitParamName,hasAxiosRequestConfig:e.options.axiosRequestConfig,axiosRequestConfigName:hr,axiosRequestConfigType:xt,hasAclCheck:r,aclCheckHook:Er})})}o(t3,"registerGenerateInfiniteQueryHelper");function r3(e){Te.default.registerHelper("genQueryJsDocs",(t,r)=>Re("query-js-docs")({endpoint:t,query:r.hash.query,mutation:r.hash.mutation,infiniteQuery:r.hash.infiniteQuery,hasMutationEffects:e.options.mutationEffects,mutationEffectsType:ti.optionsType}))}o(r3,"registerGenerateQueryJsDocsHelper");function n3(){Te.default.registerHelper("genCaslAbilityType",e=>Re("casl-ability-type")({endpoint:e,abilityTupleType:xe.abilityTuple}))}o(n3,"registerGenerateCaslAbilityTypeHelper");function i3(){Te.default.registerHelper("genCaslAbilityFunction",e=>Re("casl-ability-function")({endpoint:e}))}o(i3,"registerGenerateCaslAbilityFunctionHelper");function o3(){Te.default.registerHelper("genCaslAbilityQuery",e=>Re("casl-ability-query")({endpoint:e}))}o(o3,"registerGenerateCaslAbilityQueryHelper");function s3(){Te.default.registerHelper("genAclCheckParams",e=>{var i;let t=(i=Co(e))==null?void 0:i.map(s=>s.name),r=e.parameters.map(s=>s.name),n=t==null?void 0:t.every(s=>r.includes(s));return Re("acl-check-params")({endpoint:e,generateAclCheckParams:xa(e)&&n})})}o(s3,"registerGenerateAclCheckParamsHelper");var bi=et(Qt());function CP(){a3(),u3(),l3(),c3(),p3()}o(CP,"registerQueryHbsHelpers");function a3(){bi.default.registerHelper("queryName",(e,t)=>ba(e,t.hash.mutation))}o(a3,"registerQueryNameHelper");function c3(){bi.default.registerHelper("infiniteQueryName",XS)}o(c3,"registerInfiniteQueryNameHelper");function u3(){bi.default.registerHelper("isQuery",we)}o(u3,"registerIsQueryHelper");function l3(){bi.default.registerHelper("isMutation",Ct)}o(l3,"registerIsMutationHelper");function p3(){bi.default.registerHelper("isInfiniteQuery",e=>ai(e))}o(p3,"registerIsInfiniteQueryHelper");var mn=et(Qt());function kP(e){f3(e.options),d3(e),m3(e),h3(),g3(),y3(e)}o(kP,"registerZodHbsHelpers");function f3(e){mn.default.registerHelper("zodInferedType",t=>xo(t,e))}o(f3,"registerInferedTypeHelper");function d3(e){mn.default.registerHelper("importedZodSchemaName",t=>TS(e,t))}o(d3,"registerImportedZodSchemaNameHelper");function m3(e){mn.default.registerHelper("importedZodSchemaInferedType",t=>$r(e,t))}o(m3,"registerImportedZodSchemaInferedTypeHelper");function h3(){mn.default.registerHelper("zodSchemaType",e=>RS(e))}o(h3,"registerZodSchemaTypeHelper");function g3(){mn.default.registerHelper("zodSchemaDescription",e=>NS(e))}o(g3,"registerZodSchemaDescriptionHelper");function y3(e){mn.default.registerHelper("zodSchemaPropertyDescriptions",(t,r)=>kS(e,t,r))}o(y3,"registerZodSchemaPropertyDescriptionsHelper");var jP=et(Qt());function qP(){v3()}o(qP,"registerImportsHbsHelpers");function v3(){jP.default.registerHelper("importNames",(e,t)=>[...t?[t]:[],...e?[`{ ${e.join(", ")} }`]:[]].join(", "))}o(v3,"registerBindingsHelper");function de(e,t){let r=Sd(t);return TP(),qP(),kP(e),RP(e),CP(),IP(),NP(e),bd.default.compile(r)}o(de,"getHbsTemplateDelegate");function Re(e){let t=Sd(`partials/${e}`);return bd.default.compile(t)}o(Re,"getHbsPartialTemplateDelegate");function MP({resolver:e,data:t,tag:r=""}){var l;let n=(l=t.get(r))==null?void 0:l.endpoints.filter(({acl:f})=>f&&f.length>0);if(!n||n.length===0)return;let i=n.some(({acl:f})=>(f==null?void 0:f[0].conditions)&&Object.keys(f[0].conditions).length>0),s={bindings:[xe.abilityTuple,...i?[xe.forcedSubject,xe.subject]:[]],from:vf.from},a=n.reduce((f,p)=>{var m,g;let d=(g=(m=p.acl)==null?void 0:m[0].conditionsTypes)==null?void 0:g.reduce((y,v)=>[...y,...v!=null&&v.zodSchemaName?[v.zodSchemaName]:[]],[]);return[...f,...d??[]]},[]),c=Or({resolver:e,tag:r,zodSchemasAsTypes:Fe(a)});return de(e,"acl")({caslAbilityTupleImport:s,modelsImports:c,includeNamespace:e.options.tsNamespaces,namespace:G({type:"acl",tag:r,options:e.options}),endpoints:n})}o(MP,"generateAcl");function DP(e,t){let r={bindings:[xe.pureAbility,...t.length===0?[xe.subject,xe.abilityTuple]:[]],from:vf.from},n=qS({tags:t,entityName:Po,getAliasEntityName:Aa,type:"acl",options:e.options}),i=t.map(a=>G({type:"acl",tag:a,options:e.options}));return de(e,"app-acl")({caslAbilityTupleImport:r,imports:n,allAbilities:Po,appAbilities:Eo,includeNamespace:e.options.tsNamespaces,tags:t,namespaces:i,abilityTuple:xe.abilityTuple,subject:xe.subject})}o(DP,"generateAppAcl");function LP({resolver:e,data:t,tag:r=""}){var b;let n=(b=t.get(r))==null?void 0:b.endpoints;if(!n||n.length===0)return;let i={bindings:[fo],from:LS(e.options)},s=e.options.axiosRequestConfig,a=s,c={bindings:s?[xt]:[],from:la.from},u=e.options.parseRequestParams,l=n.reduce((P,E)=>[...P,...E.parameters],[]),f=l.filter(P=>!["Path","Header"].includes(P.type)).map(P=>P.parameterSortingEnumSchemaName??P.zodSchema),p=n.map(P=>P.response),d=Fe([...p,...u?f:[]]),m=d.some(P=>!pe(P)),g=e.options.parseRequestParams&&f.length>0,y={bindings:[Ot.name],from:US(e.options)},v=Or({resolver:e,tag:r,zodSchemas:d.filter(pe),zodSchemasAsTypes:Fe(l.map(P=>P.zodSchema).filter(pe))});return de(e,"endpoints")({appRestClientImport:i,hasAxiosImport:a,axiosImport:c,hasZodImport:m,zodImport:ri,hasZodExtendedImport:g,zodExtendedImport:y,modelsImports:v,includeNamespace:e.options.tsNamespaces,namespace:G({type:"endpoints",tag:r,options:e.options}),restClientName:fo,hasAxiosRequestConfig:s,axiosRequestConfigName:hr,axiosRequestConfigType:xt,endpoints:n,generateParse:u})}o(LP,"generateEndpoints");function FP(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(HP(n)).map(i=>e.getZodSchemaNameByRef(i)):[]}o(FP,"getZodSchemaRefs");function HP(e){return e.children.reduce((r,n)=>{let i=n.ref??n.enumRef;return i&&r.add(i),n.children.length>0&&HP(n).forEach(s=>r.add(s)),r},new Set)}o(HP,"getSchemaRefs");function VP({resolver:e,data:t,tag:r=""}){var u;let n=(u=t.get(r))==null?void 0:u.zodSchemas;if(!n||Object.keys(n).length===0)return;let i=Object.keys(n).reduce((l,f)=>[...l,...FP(e,f)],[]).filter(l=>!n[l]),s=Or({resolver:e,tag:r,zodSchemas:i}),a=Object.entries(n).reduce((l,[f,p])=>{let d=e.getRefByZodSchemaName(f);return{...l,[f]:{code:p,isCircular:!!d&&e.isSchemaCircular(d),isEnum:wS(p),schemaObj:e.getZodSchemaObj(f)}}},{});return de(e,"models")({zodImport:ri,modelsImports:s,includeNamespace:e.options.tsNamespaces,namespace:G({type:"models",tag:r,options:e.options}),tag:r,zodSchemasData:a})}o(VP,"generateModels");function BP({resolver:e,data:t,tag:r=""}){var R;let n=(R=t.get(r))==null?void 0:R.endpoints;if(!n||n.length===0)return;let i=e.options.axiosRequestConfig,s=n.some(({mediaUpload:K})=>K),a=i||s,c={defaultImport:s?sf:void 0,bindings:i?[xt]:[],from:la.from},u=n.filter(we),l=u.filter(K=>ai(K)),f=n.filter(Ct),p={bindings:[...u.length>0?[ft.query]:[],...e.options.infiniteQueries&&l.length>0?[ft.infiniteQuery]:[],...f.length>0?[ft.mutation]:[]],from:sS.from},d=e.options.mutationEffects,m={bindings:[nf],from:HS(e.options)},g=d&&f.length>0,y={bindings:[...f.length>0?[ti.optionsType,ti.hookName]:[]],from:VS(e.options)},v=e.options.checkAcl&&n.some(K=>K.acl),S={bindings:[Er],from:BS(e.options)},b={bindings:[...u.length>0?[Xs.query]:[],...e.options.infiniteQueries&&l.length>0?[Xs.infiniteQuery]:[],...f.length>0?[Xs.mutation]:[]],from:FS(e.options)},P=n.reduce((K,oe)=>[...K,...oe.parameters],[]),E=Or({resolver:e,tag:r,zodSchemasAsTypes:Fe(P.map(K=>K.zodSchema).filter(pe))}),_=jS({tag:r,endpoints:n,options:e.options});return de(e,"queries")({hasAxiosImport:a,axiosImport:c,queryImport:p,hasMutationEffects:d,queryModulesImport:m,hasMutationEffectsImport:g,mutationEffectsImport:y,hasAclCheck:v,aclCheckImport:S,queryTypesImport:b,modelsImports:E,endpointsImports:_,includeNamespace:e.options.tsNamespaces,tag:r,namespace:G({type:"queries",tag:r,options:e.options}),queriesModuleName:vo,queryModuleEnum:nf,endpoints:n,queryEndpoints:u})}o(BP,"generateQueries");function UP(e){return de(e,"acl-check")({abilityContextImport:{...Jv,from:e.options.abilityContextImportPath},appAbilitiesImport:{bindings:[Eo],from:GS()},errorHandlingImport:{...ea,from:e.options.errorHandlingImportPath},abilityContext:rf,appAbilities:Eo,errorHandler:mr.ErrorHandler,sharedErrorHandler:mr.SharedErrorHandler,aclCheckHook:Er})}o(UP,"generateAclCheck");function GP(e){return de(e,"app-rest-client")({appRestClientName:fo,baseUrl:e.getBaseUrl()})}o(GP,"generateAppRestClient");function ZP({resolver:e,data:t}){let r=[];return t.forEach((i,s)=>{var c;let a=(c=t.get(s))==null?void 0:c.endpoints;!a||a.length===0||r.push({tag:s,namespace:G({type:"queries",tag:s,options:e.options})})}),de(e,"query-modules")({modules:r})}o(ZP,"generateQueryModules");function zP(e){return de(e,"zod")({zodImport:ri,zodExtension:Ot.name,sortingString:Ot.properties.sortingString,parse:Ot.properties.parse,errorHandler:mr.ErrorHandler,sharedErrorHandler:mr.SharedErrorHandler,errorHandlingImport:{...ea,from:e.options.errorHandlingImportPath}})}o(zP,"generateZod");function KP(e,t){return t.options.acl?[{fileName:Wt({output:t.options.output,fileName:nn(ha)}),content:DP(t,e)},...t.options.checkAcl?[{fileName:Wt({output:t.options.output,fileName:nn(ga)}),content:UP(t)}]:[]]:[]}o(KP,"getAclFiles");function QP(e,t){return t.options.mutationEffects?[...JP([Xv,ia],t),{fileName:Wt({output:t.options.output,fileName:nn(na)}),content:ZP({resolver:t,data:e})}]:[]}o(QP,"getMutationEffectsFiles");function WP(e){return e.options.standalone?[...JP(Object.values(ta),e),{fileName:Wt({output:e.options.output,fileName:nn(ra)}),content:GP(e)}]:[]}o(WP,"getStandaloneFiles");function YP(e,t){return t.options.parseRequestParams?[{fileName:Wt({output:t.options.output,fileName:nn(oa)}),content:zP(t)}]:[]}o(YP,"getZodExtendedFiles");function JP(e,t){return e.reduce((r,n)=>[...r,S3(n,t)],[])}o(JP,"getAssetFiles");function S3(e,t){let r=nn(e);return{fileName:Wt({output:t.options.output,fileName:r}),content:wP(r)}}o(S3,"getAssetFile");function XP(e,t){let r=t.standalone&&t.importPath==="ts"?"relative":t.importPath,n={...go,...t,importPath:r},{resolver:i,data:s}=Oa(e,n),a=[],c=[],u=["models","endpoints","queries","acl"],l={models:VP,endpoints:LP,queries:BP,acl:MP};return s.forEach((f,p)=>{u.forEach(d=>{let m=l[d]({resolver:i,data:s,tag:p});if(m){let g=Wt({output:n.output,fileName:DS({tag:p,type:d,options:n})});a.push({fileName:g,content:m}),d==="acl"&&c.push(p)}})}),a.push(...KP(c,i),...QP(s,i),...YP(s,i),...WP(i)),a}o(XP,"generateCodeFromOpenAPIDoc");async function b3({input:e,options:t}){let r={...go,...t},n=await _d.default.bundle(e);return await Tb(n,r)}o(b3,"getGenerateMetadata");async function _3({input:e,options:t}){let r={...go,...t},n=await _d.default.bundle(e);return XP(n,r)}o(_3,"getGenerateFilesData");0&&(module.exports={getGenerateFilesData,getGenerateMetadata});
|