@povio/openapi-codegen-cli 0.5.5 → 0.5.6
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 +1 -0
- package/dist/commands/generate.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/sh.js +17 -17
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -42,6 +42,7 @@ yarn openapi-codegen generate --input http://localhost:3001/docs-json --standalo
|
|
|
42
42
|
--verbose Show log messages during execution
|
|
43
43
|
--standalone Add any missing classes or types—e.g., REST client class, React Query type extensions, etc. (default: false)
|
|
44
44
|
--baseUrl (Standalone mode only) Base URL for the REST client; falls back to the one defined in the OpenAPI spec
|
|
45
|
+
--replaceOptionalWithNullish Replace all `.optional()` zod chains wtih `.nullish()`
|
|
45
46
|
```
|
|
46
47
|
|
|
47
48
|
#### Check command (checks if OpenAPI spec is compliant)
|
|
@@ -3,5 +3,5 @@ export type GenerateParams = {
|
|
|
3
3
|
excludeTags: string;
|
|
4
4
|
prettier: boolean;
|
|
5
5
|
verbose: boolean;
|
|
6
|
-
} & Pick<GenerateOptions, "input" | "output" | "includeNamespaces" | "splitByTags" | "defaultTag" | "removeOperationPrefixEndingWith" | "importPath" | "extractEnums" | "standalone" | "baseUrl">;
|
|
6
|
+
} & Pick<GenerateOptions, "input" | "output" | "includeNamespaces" | "splitByTags" | "defaultTag" | "removeOperationPrefixEndingWith" | "importPath" | "extractEnums" | "standalone" | "baseUrl" | "replaceOptionalWithNullish">;
|
|
7
7
|
export declare function generate({ input, excludeTags, prettier, verbose, ...params }: GenerateParams): Promise<void>;
|
package/dist/index.js
CHANGED
|
@@ -71,7 +71,7 @@ Expecting `+nn.join(", ")+", got '"+(this.terminals_[P]||P)+"'":ka="Parse error
|
|
|
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(h3(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:ti,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 ei||(t=this.source.wrap(t)),this.inlineStack.push(t),t},"push"),pushStackLiteral:o(function(t){this.push(new ei(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 Df.default("replaceStack on non-inline");var a=this.popStack(!0);if(a instanceof ei)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 ei)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 ei)return n.value;if(!r){if(!this.stackSlot)throw new Df.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 ei?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=ti.RESERVED_WORDS={},r=0,n=e.length;r<n;r++)t[e[r]]=!0})();ti.isValidJavaScriptVariableName=function(e){return!ti.RESERVED_WORDS[e]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(e)};function h3(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(h3,"strictLookup");wa.default=ti;A_.exports=wa.default});var R_=h((Aa,k_)=>{"use strict";Aa.__esModule=!0;function _o(e){return e&&e.__esModule?e:{default:e}}o(_o,"_interopRequireDefault");var g3=CS(),y3=_o(g3),v3=hf(),b3=_o(v3),Lf=GS(),Ff=YS(),S3=I_(),_3=_o(S3),P3=va(),$3=_o(P3),O3=pf(),E3=_o(O3),x3=y3.default.create;function T_(){var e=x3();return e.compile=function(t,r){return Ff.compile(t,r,e)},e.precompile=function(t,r){return Ff.precompile(t,r,e)},e.AST=b3.default,e.Compiler=Ff.Compiler,e.JavaScriptCompiler=_3.default,e.Parser=Lf.parser,e.parse=Lf.parse,e.parseWithoutProcessing=Lf.parseWithoutProcessing,e}o(T_,"create");var ri=T_();ri.create=T_;E3.default(ri);ri.Visitor=$3.default;ri.default=ri;Aa.default=ri;k_.exports=Aa.default});var C_=h(Ia=>{"use strict";Ia.__esModule=!0;Ia.print=T3;Ia.PrintVisitor=J;function w3(e){return e&&e.__esModule?e:{default:e}}o(w3,"_interopRequireDefault");var A3=va(),I3=w3(A3);function T3(e){return new J().accept(e)}o(T3,"print");function J(){this.padding=0}o(J,"PrintVisitor");J.prototype=new I3.default;J.prototype.pad=function(e){for(var t="",r=0,n=this.padding;r<n;r++)t+=" ";return t+=e+`
|
|
72
72
|
`,t};J.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};J.prototype.MustacheStatement=function(e){return this.pad("{{ "+this.SubExpression(e)+" }}")};J.prototype.Decorator=function(e){return this.pad("{{ DIRECTIVE "+this.SubExpression(e)+" }}")};J.prototype.BlockStatement=J.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};J.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+" }}")};J.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+" }}")};J.prototype.ContentStatement=function(e){return this.pad("CONTENT[ '"+e.value+"' ]")};J.prototype.CommentStatement=function(e){return this.pad("{{! '"+e.value+"' }}")};J.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};J.prototype.PathExpression=function(e){var t=e.parts.join("/");return(e.data?"@":"")+"PATH:"+t};J.prototype.StringLiteral=function(e){return'"'+e.value+'"'};J.prototype.NumberLiteral=function(e){return"NUMBER{"+e.value+"}"};J.prototype.BooleanLiteral=function(e){return"BOOLEAN{"+e.value+"}"};J.prototype.UndefinedLiteral=function(){return"UNDEFINED"};J.prototype.NullLiteral=function(){return"NULL"};J.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(", ")+"}"};J.prototype.HashPair=function(e){return e.key+"="+this.accept(e.value)}});var _r=h((bV,q_)=>{var Ta=R_().default,j_=C_();Ta.PrintVisitor=j_.PrintVisitor;Ta.print=j_.print;q_.exports=Ta;function N_(e,t){var r=require("fs"),n=r.readFileSync(t,"utf8");e.exports=Ta.compile(n)}o(N_,"extension");typeof require<"u"&&require.extensions&&(require.extensions[".handlebars"]=N_,require.extensions[".hbs"]=N_)});var gj={};a2(gj,{getGenerateFilesData:()=>hj,getGenerateMetadata:()=>mj});module.exports=c2(gj);var zf=lt(_v());var Pv="Schema",$v="Enum",Ov="Body",Ev="Param",xv="Response",wv="ErrorResponse",Ki="z.void()",Is="z.enum",Ts={bindings:["z"],from:"zod"};var Wi={input:"input.yaml",output:"output",splitByTags:!0,defaultTag:"Common",excludeTags:[],includeNamespaces:!0,importPath:"ts",extractEnums:!0,configs:{models:{outputFileNameSuffix:"models",namespaceSuffix:"Models"},endpoints:{outputFileNameSuffix:"api",namespaceSuffix:"Api"},queries:{outputFileNameSuffix:"queries",namespaceSuffix:"Queries"},acl:{outputFileNameSuffix:"acl",namespaceSuffix:"Acl"}},standalone:!1,baseUrl:"",schemaSuffix:Pv,enumSuffix:$v,withDefaultValues:!0,additionalPropertiesDefaultValue:!1,removeOperationPrefixEndingWith:"Controller_"};var Z=o(e=>e.charAt(0).toUpperCase()+e.slice(1),"capitalize"),ur=o(e=>e.charAt(0).toLowerCase()+e.slice(1),"decapitalize"),Av=o(e=>e.replace(/(-\w)/g,t=>t[1].toUpperCase()),"kebabToCamel"),ue=o(e=>e.replace(/(_\w)/g,t=>t[1].toUpperCase()),"snakeToCamel"),Iv=o(e=>e.replace(/[\W_]+(\w)?/g,(t,r)=>(r==null?void 0:r.toUpperCase())??""),"nonWordCharactersToCamel"),_p=o((e,t="")=>e.endsWith(t)?e:`${e}${t}`,"suffixIfNeeded"),Tv=o((e,t)=>e.replace(new RegExp(`${t}$`),""),"removeSuffix"),nR=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"),Pp=o(e=>{let t=e.map(Z).map(kv).map(r=>iR(r)).flat();return nR(t)},"getMostCommonAdjacentCombinationSplit"),kv=o(e=>e.split(/(?<![A-Z])(?=[A-Z])/).filter(Boolean),"splitByUppercase"),Rv=o(e=>kv(e).join(" "),"camelToSpaceSeparated"),iR=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"),Cv=o((e,t)=>{let r=t.replace(/es$|s$/g,""),n=new RegExp(`(${ur(r)}|${Z(r)})[a-z]*(?=$|[A-Z])`,"g");return e.replace(n,"")},"removeWord");var ks=o(e=>`use${Z(ue(e.operationName))}`,"getQueryName");var Yi="AppRestClient",$p={query:"AppQueryOptions",mutation:"AppMutationOptions"},Op="src/data",Ep="@/data",Nv="@/util/rest/clients/app-rest-client",jv="@/types/react-query";var Rs={reactQueryTypes:{fileName:"react-query.types",extension:"ts"},restClient:{fileName:"rest-client",extension:"ts"},restInterceptor:{fileName:"rest-interceptor",extension:"ts"}},Cs={fileName:"app-rest-client",extension:"ts"};var Ne=o((...e)=>[...new Set(e.flat())],"getUniqueArray");var xp={"Content-Type":"application/json",Accept:"application/json"},qv="data";var Mv=o(e=>/^(?:[a-zA-Z_$][a-zA-Z0-9_$]*|[0-9]+)$/.test(e),"isValidPropertyName"),_t=o(e=>e.replace(/^[^a-zA-Z_$]*/g,"").replace(/[^a-zA-Z0-9_$]+(\w)?/g,(t,r)=>(r==null?void 0:r.toUpperCase())??""),"invalidVariableNameCharactersToCamel");var Dt=Symbol.for("@ts-pattern/matcher"),oR=Symbol.for("@ts-pattern/isVariadic"),js="@ts-pattern/anonymous-select-key",wp=o(e=>!!(e&&typeof e=="object"),"r"),Ns=o(e=>e&&!!e[Dt],"i"),Ot=o((e,t,r)=>{if(Ns(e)){let n=e[Dt](),{matched:i,selections:s}=n.match(t);return i&&s&&Object.keys(s).forEach(a=>r(a,s[a])),i}if(wp(e)){if(!wp(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];Ns(c)&&c[oR]?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)=>Ot(l,a[f],r))&&i.every((l,f)=>Ot(l,c[f],r))&&(s.length===0||Ot(s[0],u,r))}return e.length===t.length&&e.every((a,c)=>Ot(a,t[c],r))}return Reflect.ownKeys(e).every(n=>{let i=e[n];return(n in t||Ns(s=i)&&s[Dt]().matcherType==="optional")&&Ot(i,t[n],r);var s})}return Object.is(t,e)},"s"),mr=o(e=>{var t,r,n;return wp(e)?Ns(e)?(t=(r=(n=e[Dt]()).getSelectionKeys)==null?void 0:r.call(n))!=null?t:[]:Array.isArray(e)?Qi(e,mr):Qi(Object.values(e),mr):[]},"o"),Qi=o((e,t)=>e.reduce((r,n)=>r.concat(t(n)),[]),"c");function Ue(e){return Object.assign(e,{optional:o(()=>sR(e),"optional"),and:o(t=>z(e,t),"and"),or:o(t=>aR(e,t),"or"),select:o(t=>t===void 0?Dv(e):Dv(t,e),"select")})}o(Ue,"u");function sR(e){return Ue({[Dt]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return t===void 0?(mr(e).forEach(i=>n(i,void 0)),{matched:!0,selections:r}):{matched:Ot(e,t,n),selections:r}},"match"),getSelectionKeys:o(()=>mr(e),"getSelectionKeys"),matcherType:"optional"})})}o(sR,"h");function z(...e){return Ue({[Dt]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return{matched:e.every(i=>Ot(i,t,n)),selections:r}},"match"),getSelectionKeys:o(()=>Qi(e,mr),"getSelectionKeys"),matcherType:"and"})})}o(z,"m");function aR(...e){return Ue({[Dt]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return Qi(e,mr).forEach(i=>n(i,void 0)),{matched:e.some(i=>Ot(i,t,n)),selections:r}},"match"),getSelectionKeys:o(()=>Qi(e,mr),"getSelectionKeys"),matcherType:"or"})})}o(aR,"d");function D(e){return{[Dt]:()=>({match:o(t=>({matched:!!e(t)}),"match")})}}o(D,"p");function Dv(...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 Ue({[Dt]:()=>({match:o(n=>{let i={[t??js]:n};return{matched:r===void 0||Ot(r,n,(s,a)=>{i[s]=a}),selections:i}},"match"),getSelectionKeys:o(()=>[t??js].concat(r===void 0?[]:mr(r)),"getSelectionKeys")})})}o(Dv,"y");function Pt(e){return typeof e=="number"}o(Pt,"v");function lr(e){return typeof e=="string"}o(lr,"b");function pr(e){return typeof e=="bigint"}o(pr,"w");var H8=Ue(D(function(e){return!0}));var fr=o(e=>Object.assign(Ue(e),{startsWith:o(t=>{return fr(z(e,(r=t,D(n=>lr(n)&&n.startsWith(r)))));var r},"startsWith"),endsWith:o(t=>{return fr(z(e,(r=t,D(n=>lr(n)&&n.endsWith(r)))));var r},"endsWith"),minLength:o(t=>fr(z(e,(r=>D(n=>lr(n)&&n.length>=r))(t))),"minLength"),length:o(t=>fr(z(e,(r=>D(n=>lr(n)&&n.length===r))(t))),"length"),maxLength:o(t=>fr(z(e,(r=>D(n=>lr(n)&&n.length<=r))(t))),"maxLength"),includes:o(t=>{return fr(z(e,(r=t,D(n=>lr(n)&&n.includes(r)))));var r},"includes"),regex:o(t=>{return fr(z(e,(r=t,D(n=>lr(n)&&!!n.match(r)))));var r},"regex")}),"j"),B8=fr(D(lr)),$t=o(e=>Object.assign(Ue(e),{between:o((t,r)=>$t(z(e,((n,i)=>D(s=>Pt(s)&&n<=s&&i>=s))(t,r))),"between"),lt:o(t=>$t(z(e,(r=>D(n=>Pt(n)&&n<r))(t))),"lt"),gt:o(t=>$t(z(e,(r=>D(n=>Pt(n)&&n>r))(t))),"gt"),lte:o(t=>$t(z(e,(r=>D(n=>Pt(n)&&n<=r))(t))),"lte"),gte:o(t=>$t(z(e,(r=>D(n=>Pt(n)&&n>=r))(t))),"gte"),int:o(()=>$t(z(e,D(t=>Pt(t)&&Number.isInteger(t)))),"int"),finite:o(()=>$t(z(e,D(t=>Pt(t)&&Number.isFinite(t)))),"finite"),positive:o(()=>$t(z(e,D(t=>Pt(t)&&t>0))),"positive"),negative:o(()=>$t(z(e,D(t=>Pt(t)&&t<0))),"negative")}),"x"),U8=$t(D(Pt)),dr=o(e=>Object.assign(Ue(e),{between:o((t,r)=>dr(z(e,((n,i)=>D(s=>pr(s)&&n<=s&&i>=s))(t,r))),"between"),lt:o(t=>dr(z(e,(r=>D(n=>pr(n)&&n<r))(t))),"lt"),gt:o(t=>dr(z(e,(r=>D(n=>pr(n)&&n>r))(t))),"gt"),lte:o(t=>dr(z(e,(r=>D(n=>pr(n)&&n<=r))(t))),"lte"),gte:o(t=>dr(z(e,(r=>D(n=>pr(n)&&n>=r))(t))),"gte"),positive:o(()=>dr(z(e,D(t=>pr(t)&&t>0))),"positive"),negative:o(()=>dr(z(e,D(t=>pr(t)&&t<0))),"negative")}),"A"),z8=dr(D(pr)),G8=Ue(D(function(e){return typeof e=="boolean"})),Z8=Ue(D(function(e){return typeof e=="symbol"})),K8=Ue(D(function(e){return e==null})),W8=Ue(D(function(e){return e!=null}));var kp=class kp 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(kp,"W");var Ap=kp,Ip={matched:!1,value:void 0};function ge(e){return new Tp(e,Ip)}o(ge,"z");var Ji=class Ji{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=>Ot(l,this.input,c))||i&&!i(this.input)?Ip:{matched:!0,value:r(s?js in a?a[js]:a:this.input,this.input)};return new Ji(this.input,u)}when(t,r){if(this.state.matched)return this;let n=!!t(this.input);return new Ji(this.input,n?{matched:!0,value:r(this.input,this.input)}:Ip)}otherwise(t){return this.state.matched?this.state.value:t(this.input)}exhaustive(){if(this.state.matched)return this.state.value;throw new Ap(this.input)}run(){return this.exhaustive()}returnType(){return this}};o(Ji,"I");var Tp=Ji;var Rp=["break","case","catch","class","const","continue","debugger","default","delete","do","else","export","extends","false","finally","for","function","if","import","in","instanceof","new","null","return","super","switch","this","throw","true","try","typeof","var","void","while","with"];var Cp=2,Lv=["application/octet-stream","multipart/form-data","application/x-www-form-urlencoded","*/*"],Fv=["query","header","path"],hr=["get","put","post","delete","options","head","patch","trace"],Vv=["string","number","integer","boolean"],Bn=["allOf","anyOf","oneOf"];function gr(e,t){let r={};return Object.keys(e).forEach(n=>{t.includes(n)&&(r[n]=e[n])}),r}o(gr,"pick");function Et(e){return Iv(e)}o(Et,"formatTag");function Ur(e,t){var n;let r=(n=e.tags)==null?void 0:n[0];return Et(r??t.defaultTag)}o(Ur,"getOperationTag");function Hv(e,t){let r={};for(let n in e.paths){let i=e.paths[n],s=gr(i,hr);for(let a in s){let c=s[a];if(!c||c.deprecated&&!t.withDeprecatedEndpoints)continue;let u=t.splitByTags?Ur(c,t):t.defaultTag;r[u]||(r[u]=[]),r[u].push(c)}}return r}o(Hv,"getOperationsByTag");var Uv=o(e=>`#/components/schemas/${e}`,"getSchemaRef"),zr=o(e=>e[1]==="/"?e:"#/"+e.slice(1),"autocorrectRef"),Un=o(e=>zr(e).split("/").at(-1),"getSchemaNameByRef");function M(e){return e!=null&&Object.prototype.hasOwnProperty.call(e,"$ref")}o(M,"isReferenceObject");function qp(e){let t=cR(e).normalize("NFKD").trim().replace(/\s+/g,"_").replace(/--+/g,"-").replace(/-+/g,"_").replace(/[^\w-]+/g,"_");return ue(t)}o(qp,"normalizeString");function zv(e){return/^[a-zA-Z]\w*$/.test(e)?e:`"${e}"`}o(zv,"wrapWithQuotesIfNeeded");function Gv(e){return typeof e=="string"&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}o(Gv,"unwrapQuotesIfNeeded");function cR(e){let t=Number(e[0]);return typeof t=="number"&&!Number.isNaN(t)?"_"+e:e}o(cR,"prefixStringStartingWithNumberIfNeeded");function Mp(e){let t=e.replaceAll("_","#");return ue(t.replaceAll("-","_")).replaceAll("#","_")}o(Mp,"pathParamToVariableName");var Lt=o(e=>Vv.includes(e),"isPrimitiveType");function Zv(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(Zv,"escapeControlCharacters");function ze(e){return e.includes("application/")&&e.includes("json")||Lv.includes(e)||e.includes("text/")}o(ze,"isParamMediaTypeAllowed");function qs(e){return e>=200&&e<300}o(qs,"isMainResponseStatus");function Ms(e){return!(e>=200&&e<300)}o(Ms,"isErrorStatus");function zn(e){return e==="application/json"}o(zn,"isMediaTypeAllowed");function Np({path:e,method:t,operation:r,options:n,tag:i,keepOperationTag:s,keepOperationPrefix:a}){let c=`${t}${lR(e)}`,u=r.operationId?_t(r.operationId):c;if(n.removeOperationPrefixEndingWith&&a)u=u.split(n.removeOperationPrefixEndingWith).map((f,p)=>p===0?f:Z(f)).join("");else if(n.removeOperationPrefixEndingWith&&!a){let l=new RegExp(`^.*${n.removeOperationPrefixEndingWith}`);u=u.replace(l,"")}if(n.includeNamespaces&&!s){let l=Cv(u,i);Rp.includes(l)||(u=l)}return Rp.includes(u)?c:u}o(Np,"getOperationName");function Xi({operationsByTag:e,...t}){let{operation:r,options:n}=t,i=n.splitByTags?Ur(r,n):n.defaultTag,s=o(a=>{let c=Np({...t,tag:i,keepOperationTag:a});if(e[i].filter(l=>Np({...t,operation:l,tag:i,keepOperationTag:a})===c).length===1)return c},"operationName");return s()??s(!0)??Np({...t,tag:i,keepOperationTag:!0,keepOperationPrefix:!0})}o(Xi,"getUniqueOperationName");function Kv(e,t,r){let n=[];for(let i in e.paths){let s=e.paths[i],a=gr(s,hr);for(let c in a){let u=a[c];if(!u||u.deprecated&&!r.withDeprecatedEndpoints)continue;let l=Xi({path:i,method:c,operation:u,operationsByTag:t,options:r});n.push(l)}}return n}o(Kv,"getUniqueOperationNamesWithoutSplitByTags");var Bv=/({\w+})/g,uR=/[^\w\-]+/g;function lR(e){e=Z(Av(e.replaceAll("/","-")).replaceAll("-",""));let t=[...e.matchAll(Bv)];if(t.length>0){let r=t.sort((n,i)=>n.index-i.index)[t.length-1][0];e=`${e.replace(Bv,"")}By${Z(r.slice(1,-1))}`}return e.replace(uR,"_")}o(lR,"pathToVariableName");var jp=/{(\b\w+(?:-\w+)*\b)}/g;function Wv(e){let t=e.match(jp);return t===null?e.replaceAll(jp,":$1"):(t.forEach(r=>{let n=Mp(r.replaceAll(jp,":$1"));e=e.replaceAll(r,n)}),e)}o(Wv,"replaceHyphenatedPath");function je(e){return!M(e)}o(je,"isSchemaObject");function Ds(e){return e.type==="array"}o(Ds,"isArraySchemaObject");function Yv(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(pR(s)){let a=s.required;i[0].push(...a??[])}else i[1].push(s);return i},[[],[]]),n={properties:t.reduce((i,s)=>(i[s]={},i),{}),type:"object",required:t};return{noRequiredOnlyAllof:r,composedRequiredSchema:n,patchRequiredSchemaInLoop:o((i,s)=>{if(M(i)){let a=s(i.$ref);a&&n.required.forEach(c=>{var u;n.properties[c]=((u=a==null?void 0:a.properties)==null?void 0:u[c])??{}})}else{let a=i.properties??{};n.required.forEach(c=>{a[c]&&(n.properties[c]=a[c]??{})})}},"patchRequiredSchemaInLoop")}}o(Yv,"inferRequiredSchema");var pR=o(e=>!M(e)&&!!e.required&&!e.type&&!e.properties&&!(e!=null&&e.allOf)&&!(e!=null&&e.anyOf)&&!e.oneOf,"isBrokenAllOfItem");var Ft=o((e,t)=>_p(Z(qp(e)),t),"getZodSchemaName"),Dp=o((e,t,r)=>_p(Z(qp(e)),`${t}${r}`),"getEnumZodSchemaName"),$e=o(e=>!e.startsWith("z."),"isNamedZodSchema"),Jv=o(e=>e.startsWith(Is),"isEnumZodSchema"),Gr=o((e,t,r)=>t?e:`${r}_${e}`,"getZodSchemaOperationName"),Ls=o(e=>ue(`${e}_${Ov}`),"getBodyZodSchemaName"),Qv=o((e,t)=>ue(`${e}_${t}${Ev}`),"getParamZodSchemaName"),fR=o(e=>ue(`${e}${xv}`),"getMainResponseZodSchemaName"),dR=o((e,t)=>ue(`${e}_${t}_${wv}`),"getErrorResponseZodSchemaName");function Fs({statusCode:e,operationName:t,isUniqueOperationName:r,tag:n}){let i=Number(e),s=Gr(t,r,n);return!qs(i)&&e!=="default"&&Ms(i)?dR(s,e):fR(s)}o(Fs,"getResponseZodSchemaName");function eo(e){return["minimum","exclusiveMinimum","maximum","exclusiveMaximum","minItems","minLength","minProperties","maxItems","maxLength","maxProperties","default","example"].filter(n=>e[n]).reduce((n,i)=>[...n,`${Z(Rv(i))}: \`${e[i]}\``],[])}o(eo,"getSchemaDescriptions");function Oe(e,t){if(!e)return;let{data:r,onSchema:n}=t;if(M(e)&&n({type:"reference",schema:e,data:r})===!0)return;let i=e;if(Bn.some(s=>s in i&&i[s])){let s=i.allOf??i.anyOf??i.oneOf??[];for(let a of s)(n==null?void 0:n({type:"composite",parentSchema:e,schema:a,data:r}))!==!0&&Oe(a,{data:r,onSchema:n})}if(i.properties)for(let[s,a]of Object.entries(i.properties))n({type:"property",parentSchema:e,schema:a,data:r,propertyName:s})!==!0&&Oe(a,t);if(i.additionalProperties)for(let[s,a]of Object.entries(i.additionalProperties))!(a instanceof Object)||n({type:"additionalProperty",parentSchema:e,schema:a,data:r,propertyName:s})===!0||Oe(a,t);if(i.type==="array"){let s=e.items;if(n({type:"array",parentSchema:e,schema:s,data:r})===!0)return;Oe(s,t)}}o(Oe,"iterateSchema");var to=o((e,t)=>Tv(e,t.schemaSuffix),"getZodSchemaInferedTypeName"),Xv=o((e,t)=>$e(t)?`${e.options.includeNamespaces?`${K({type:"models",tag:e.getTagByZodSchemaName(t),options:e.options})}.`:""}${t}`:t,"getImportedZodSchemaName"),yr=o((e,t,r)=>{if(!$e(t))return t===Ki?"void":t;let n=e.getTagByZodSchemaName(t);return`${e.options.includeNamespaces&&n!==r?`${K({type:"models",tag:n,options:e.options})}.`:""}${to(t,e.options)}`},"getImportedZodSchemaInferedTypeName");function eb(e){var t;return e.isEnum?"enum":((t=e.schemaObj)==null?void 0:t.type)??"object"}o(eb,"getZodSchemaType");function tb(e){if(e.schemaObj)return[e.schemaObj.description,...eo(e.schemaObj).join(". ")].filter(Boolean)}o(tb,"getZodSchemaDescription");function rb(e,t,r){var n;if(M(t)){let i=e.getZodSchemaNameByRef(t.$ref);return i?yr(e,i,r):void 0}if(Ds(t)){if(!M(t.items))return`${((n=t.items)==null?void 0:n.type)??"unknown"}[]`;let i=e.getZodSchemaNameByRef(t.items.$ref);return i?`${yr(e,i,r)}[]`:void 0}if(Bn.some(i=>i in t&&t[i])){let i=t.allOf??t.anyOf??t.oneOf??[];if(i.length>0)return rb(e,i[0],r)}return t.type}o(rb,"getType");function nb(e,t,r){if(!t.schemaObj)return[];let n="[0]",i={},s=o(a=>{var u;if(a.type==="reference")return!0;if(a.type==="composite")return;let c=[...((u=a.data)==null?void 0:u.pathSegments)??[]];if(a.type==="array"?c.push(n):(a.type==="property"||a.type==="additionalProperty")&&c.push(a.propertyName),a.schema&&c[c.length-1]!==n){let l=e.resolveObject(a.schema),f=[l.description,...eo(l)].filter(Boolean),p=c.join(".");i[p]&&"type"in a.schema&&a.schema.type==="object"||(delete i[p],i[p]={type:rb(e,a.schema,r)??"unknown",description:f.join(". ")})}return Oe(a.schema,{data:{pathSegments:[...c]},onSchema:s}),!0},"onSchema");return"allOf"in t.schemaObj&&t.schemaObj.allOf&&t.schemaObj.allOf.forEach(a=>{if(M(a)){let c=e.resolveObject(a);Oe(c,{data:{pathSegments:[]},onSchema:s})}}),Oe(t.schemaObj,{data:{pathSegments:[]},onSchema:s}),i}o(nb,"getZodSchemaPropertyDescriptions");function Vs(e){return ge(e).with("string",()=>"string").with("number",()=>"number").with("integer",()=>"number").with("boolean",()=>"boolean").exhaustive()}o(Vs,"primitiveTypeToTsType");function Gn({zodSchemaName:e,schema:t,resolver:r}){let n="void",i;e&&$e(e)?(n=yr(r,e),i=r.getTagByZodSchemaName(e)):t!=null&&t.type&&Lt(t==null?void 0:t.type)&&(n=Vs(t==null?void 0:t.type));let s=n.split(".");return{type:s[s.length-1],...s.length>1?{namespace:s[0]}:{},...i?{importPath:Kr({type:"models",tag:i,includeTagDir:!0,options:r.options})}:{}}}o(Gn,"getTsTypeBase");function Zr({schema:e,isCircular:t,parentTypes:r,resolver:n}){if(!e)return{metaType:"primitive"};for(let i of Bn){let s=e[i];if(s)if(s.length>1){let a=s.map(c=>{let u=n.resolveObject(c);return Zr({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:ib({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:mR({schema:e,parentTypes:r,resolver:n})}:{metaType:"primitive"}}o(Zr,"getSchemaTsMetaType");function ib({arraySchema:e,parentTypes:t,resolver:r}){let n,i;if(M(e.items)){let u=e.items.$ref;n=r.getZodSchemaNameByRef(u),i=r.getSchemaByRef(u)}else i=e.items;let s=Gn({zodSchemaName:n,schema:i,resolver:r}),a=ob(s,t),c=Zr({schema:i,isCircular:a,parentTypes:[...t,s],resolver:r});return{...s,...c}}o(ib,"getArraySchemaTsType");function mR({schema:e,parentTypes:t,resolver:r}){return Object.entries((e==null?void 0:e.properties)??{}).map(([n,i])=>{var a;let s=((a=e==null?void 0:e.required)==null?void 0:a.includes(n))??!1;if(M(i)){let c=r.getZodSchemaNameByRef(i.$ref),u=r.getSchemaByRef(i.$ref),l=Gn({zodSchemaName:c,schema:u,resolver:r}),f=ob(l,t),p=Zr({schema:u,isCircular:f,parentTypes:[...t,l],resolver:r});return{name:n,isRequired:s,...l,...p}}else if(i.type==="array"){let c=ib({arraySchema:i,parentTypes:t,resolver:r});return{name:n,isRequired:s,type:"array",metaType:"array",arrayType:c}}else if(Lt(i.type))return{name:n,isRequired:s,type:Vs(i.type),metaType:"primitive"};return{name:n,isRequired:s,type:"void",metaType:"primitive"}})}o(mR,"getSchemaTsProperties");function ob(e,t){return t.findIndex(({type:r,namespace:n})=>r===e.type&&n===e.namespace)>-1}o(ob,"getIsCircular");var ro=o(e=>ur(ue(e.operationName)),"getEndpointName");function sb(e,t){return`${t.includeNamespaces?`${K({type:"endpoints",tag:no(e,t),options:t})}.`:""}${ro(e)}`}o(sb,"getImportedEndpointName");var ab=o(e=>e.path.replace(/:([a-zA-Z0-9_]+)/g,"${$1}"),"getEndpointPath");function no(e,t){var n;let r=t.splitByTags?(n=e.tags)==null?void 0:n[0]:t.defaultTag;return Et(r??t.defaultTag)}o(no,"getEndpointTag");function Lp(e,t){return t.parameters.map(r=>{var i,s,a,c;let n="string";if($e(r.zodSchema))n=yr(e,r.zodSchema);else if((i=r.parameterObject)!=null&&i.schema&&je(r.parameterObject.schema)){let u=(a=(s=r.parameterObject)==null?void 0:s.schema)==null?void 0:a.type;u&&Lt(u)&&(n=Vs(u))}return{name:_t(r.name),type:n,paramType:r.type,required:((c=r.parameterObject)==null?void 0:c.required)??!0,parameterObject:r.parameterObject,bodyObject:r.bodyObject}}).sort((r,n)=>{if(r.required===n.required){let i=["Path","Body","Query","Header"];return i.indexOf(r.paramType)-i.indexOf(n.paramType)}return r.required?-1:1})}o(Lp,"mapEndpointParamsToFunctionParams");function cb(e){let t=e.parameters.filter(i=>i.type==="Query").map(i=>{let s=Mv(i.name)?i.name:`"${i.name}"`,a=_t(i.name);return{...i,name:s,value:a}}),r={};return e.requestFormat!==xp["Content-Type"]&&(r["Content-Type"]=`'${e.requestFormat}'`),e.responseFormat&&e.responseFormat!==xp.Accept&&(r.Accept=`'${e.responseFormat}'`),e.parameters.filter(i=>i.type==="Header").forEach(i=>{r[i.name]=_t(i.name)}),{...t.length>0?{params:t}:{},...Object.keys(r).length?{headers:r}:{}}}o(cb,"getEndpointConfig");function vr({resolver:e,tag:t,zodSchemas:r=[],zodSchemasAsTypes:n=[]}){let i="models",s=o(u=>e.getTagByZodSchemaName(u),"getTag"),a=Fp({type:i,tag:t,entities:r,getTag:s,getEntityName:o(u=>u,"getEntityName"),options:e.options}),c=Fp({type:i,tag:t,entities:n,getTag:s,getEntityName:o(u=>to(u,e.options),"getEntityName"),options:e.options});return hR(e.options,a,c)}o(vr,"getModelsImports");function ub({tag:e,endpoints:t,options:r}){return Fp({type:"endpoints",tag:e,entities:t,getTag:o(n=>no(n,r),"getTag"),getEntityName:ro,options:r})}o(ub,"getEndpointsImports");function lb({tags:e,entityName:t,getAliasEntityName:r,options:n}){let i=new Map;return e.forEach(s=>{let a=`${t}${r?` as ${r(s)}`:""}`;i.has(s)?n.includeNamespaces||i.get(s).bindings.push(a):i.set(s,{bindings:[n.includeNamespaces?K({type:"acl",tag:s,options:n}):a],from:`${io(n)}${Kr({type:"acl",tag:s,includeTagDir:!0,options:n})}`})}),Array.from(i.values())}o(lb,"getAclImports");function io(e){let t=Ep;return e.importPath==="relative"?t="../":e.importPath==="absolute"?t=e.output:new RegExp(`${Op}`,"g").test(e.output)&&(t=e.output.replace(new RegExp(`.*${Op}`,"g"),Ep)),`${t}/`.replace(/\/\//g,"/")}o(io,"getImportPath");function Fp({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.includeNamespaces||a.get(u).bindings.push(i(c));else{let l=t===u;a.set(u,{bindings:[s.includeNamespaces?K({type:e,tag:u,options:s}):i(c)],from:`${l?"./":io(s)}${Kr({type:e,tag:u,includeTagDir:!l,options:s})}`})}}),Array.from(a.values())}o(Fp,"getImports");function hR(e,...t){let r=new Map;return t.forEach(n=>{n.forEach(i=>{r.has(i.from)?e.includeNamespaces||r.get(i.from).bindings.push(...i.bindings):r.set(i.from,i)})}),Array.from(r.values()).map(n=>({...n,bindings:Ne(n.bindings)}))}o(hR,"mergeImports");function Hs({fileName:e,extension:t}){return`${e}.${t}`}o(Hs,"getFileNameWithExtension");function pb({type:e,tag:t,options:r,includeTagDir:n=!0}){let i=r.configs[e].outputFileNameSuffix;return t?`${n?`${ur(t)}/`:""}${ur(t)}.${i}`:i}o(pb,"getTagFileNameWithoutExtension");function Kr(...e){return pb(...e)}o(Kr,"getTagImportPath");function fb(...e){return`${pb(...e)}.ts`}o(fb,"getTagFileName");var K=o(({type:e,tag:t,options:r})=>`${Z(t)}${r.configs[e].namespaceSuffix}`,"getNamespaceName");function db(e){return e.standalone?`${io(e)}${Cs.fileName}`:Nv}o(db,"getAppRestClientImportPath");function mb(e){return e.standalone?`${io(e)}${Rs.reactQueryTypes.fileName}`:jv}o(mb,"getQueryTypesImportPath");var xt=o(e=>e.method==="get","isQuery"),Bs=o(e=>e.method!=="get","isMutation");function Us(e){return{type:"invalid-schema",message:e}}o(Us,"getInvalidSchemaError");function hb(e){return{type:"invalid-operation-id",message:`Operation ${e}`}}o(hb,"getInvalidOperationIdError");function gb(e,t){return{type:"missing-path-parameter",message:`Path ${t} is missing [${e.map(({name:r})=>r).join(", ")}]`}}o(gb,"getMissingPathParameterError");function yb(e){return{type:"not-allowed-inline-enum",message:e}}o(yb,"getNotAllowedInlineEnumError");function vb(e){return{type:"not-allowed-circular-schema",message:e}}o(vb,"getNotAllowedCircularSchemaError");function bb(e,t,r){return{type:"missing-acl-condition-property",message:`Condition property ${e} is not found in parameters or body in operation ${Sb(t,r)}`}}o(bb,"getMissingAclConditionPropertyError");function Vp(e,t,r){return{type:"missing-status-code",message:`Missing status code ${e} in operation ${Sb(t,r)}`}}o(Vp,"getMissingStatusCodeError");function Sb(e,t){return e.operationId??`${t.method} ${t.path}`}o(Sb,"getOperationDescriptor");function wt({schema:e,meta:t,options:r}){let n=[];ge(e.type).with("string",()=>n.push(vR(e))).with("number","integer",()=>n.push(SR(e))).with("array",()=>n.push(_R(e))).otherwise(()=>{}),typeof e.description=="string"&&e.description!==""&&r.withDescription&&([`
|
|
73
73
|
`,"\r",`\r
|
|
74
|
-
`].some(s=>String.prototype.includes.call(e.description,s))?n.push(`describe(\`${e.description}\`)`):n.push(`describe("${e.description}")`));let i=n.concat(gR(e,t),r.withDefaultValues!==!1?yR(e):[]).filter(Boolean).join(".");return i?`.${i}`:""}o(wt,"getZodChain");function gR(e,t){return e.nullable&&!(t!=null&&t.isRequired)?"nullish()":e.nullable?"nullable()":t!=null&&t.isRequired?"":"optional()"}o(gR,"getZodChainablePresence");function yR(e){return e.default!==void 0?`default(${ge(e.type).with("number","integer",()=>Gv(e.default)).otherwise(()=>JSON.stringify(e.default))})`:""}o(yR,"getZodChainableDefault");function vR(e){let t=[];if(e.enum||(e.minLength!==void 0&&t.push(`min(${e.minLength})`),e.maxLength!==void 0&&t.push(`max(${e.maxLength})`)),e.pattern&&t.push(`regex(${bR(e.pattern)})`),e.format){let r=ge(e.format).with("email",()=>"email()").with("hostname","uri",()=>"url()").with("uuid",()=>"uuid()").with("date-time",()=>"datetime({ offset: true })").otherwise(()=>"");r&&t.push(r)}return t.join(".")}o(vR,"getZodChainableStringValidations");function bR(e){return e.startsWith("/")&&e.endsWith("/")&&(e=e.slice(1,-1)),e=Zv(e),`/${e}/`}o(bR,"formatPatternIfNeeded");function SR(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(SR,"getZodChainableNumberValidations");function _R(e){let t=[];return e.minItems&&t.push(`min(${e.minItems})`),e.maxItems&&t.push(`max(${e.maxItems})`),t.join(".")}o(_R,"getZodChainableArrayValidations");var Wr=o(e=>e.reduce((t,r)=>t+r,0),"sum");function ie(e,t){if(!t)return e;if(M(t))return e+2;if(Array.isArray(t.type))return t.type.length===1?Ee("oneOf")+ie(e,{...t,type:t.type[0]}):e+Ee("oneOf")+Wr(t.type.map(r=>ie(0,{...t,type:r})));if(t.oneOf)return t.oneOf.length===1?Ee("oneOf")+ie(e,t.oneOf[0]):e+Ee("oneOf")+Wr(t.oneOf.map(r=>ie(0,r)));if(t.anyOf)return t.anyOf.length===1?Ee("anyOf")+ie(e,t.anyOf[0]):e+Ee("anyOf")+Wr(t.anyOf.map(r=>ie(0,r)));if(t.allOf)return t.allOf.length===1?Ee("allOf")+ie(e,t.allOf[0]):e+Ee("allOf")+Wr(t.allOf.map(r=>ie(0,r)));if(!t.type)return e;if(Lt(t.type))return t.enum?e+_b(t)+Ee("enum")+Wr(t.enum.map(r=>ie(0,r))):e+_b(t);if(t.type==="array")return t.items?Ee("array")+ie(e,t.items):Ee("array")+ie(e);if(t.type==="object"||t.properties||t.additionalProperties){if(t.additionalProperties)return t.additionalProperties===!0?Ee("record")+ie(e):Ee("record")+ie(e,t.additionalProperties);if(t.properties){let r=Object.values(t.properties);return e+Ee("object")+Wr(r.map(n=>ie(0,n)))}return Ee("empty-object")+ie(e)}return e}o(ie,"getOpenAPISchemaComplexity");function _b(e){return ge(e.type).with("string","number","integer","boolean",()=>1).otherwise(()=>0)}o(_b,"complexityByType");function Ee(e){return ge(e).with("oneOf",()=>2).with("anyOf",()=>3).with("allOf",()=>2).with("enum","array","record","empty-object",()=>1).with("object",()=>2).otherwise(()=>0)}o(Ee,"complexityByComposite");var Hp=class Hp{constructor(t,r,n={referencedBy:[]},i){this.schema=t;this.resolver=r;M(t)&&(this.ref=t.$ref),i&&(this.enumRef=i),this.meta={...n,referencedBy:[...(n==null?void 0:n.referencedBy)??[]]},this.ref&&this.meta.referencedBy.push(this)}code;ref;enumRef;children=[];meta;getCodeString(t,r){var s,a;if(!this.ref&&this.code)return this.code;if(!this.ref)throw new Error("Zod schema is missing both ref and code");let n=(s=this.resolver)==null?void 0:s.getZodSchemaNameByRef(this.ref);if(!n)return this.ref;let i=(a=this.resolver)==null?void 0:a.getTagByZodSchemaName(n);return r!=null&&r.includeNamespaces&&i&&i!==t?`${K({type:"models",tag:i,options:r})}.${n}`:n}get complexity(){return ie(0,this.schema)}assign(t){return this.code=t,this}inherit(t){return t&&t.children.push(this),this}};o(Hp,"ZodSchema");var oo=Hp;function Y({schema:e,resolver:t,meta:r,tag:n}){var g;let i=new oo(e,t,r),s={parent:i.inherit(r==null?void 0:r.parent),referencedBy:[...i.meta.referencedBy]},a={resolver:t,meta:s,tag:n};if(M(e))return PR({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});let c=OR({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(c)return c;let u=$R({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(u)return u;let l=ER({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(l)return l;let f=xR({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(f)return f;let p=wR({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(p)return p;let d=t.options.allReadonly?".readonly()":"";if(Ds(e))return e.items?i.assign(`z.array(${Y({...a,schema:e.items}).getCodeString(n,t.options)}${wt({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=t.options.additionalPropertiesDefaultValue!==void 0?t.options.additionalPropertiesDefaultValue:!0,b=(e.additionalProperties===null||e.additionalProperties===void 0?y:e.additionalProperties)===!1?"":".passthrough()";if(typeof e.additionalProperties=="object"&&Object.keys(e.additionalProperties).length>0)return i.assign(`z.record(${Y({...a,schema:e.additionalProperties}).getCodeString(n,t.options)+wt({schema:e.additionalProperties,meta:{...s,isRequired:!0},options:t.options})})`);let S=e.required&&e.required.length>0,O=t.options.withImplicitRequiredProps?!1:!((g=e.required)!=null&&g.length),P="{}";e.properties&&(P="{ "+Object.entries(e.properties).map(([se,Q])=>{var Gt;let G={...s,isRequired:O?!0:S?(Gt=e.required)==null?void 0:Gt.includes(se):t.options.withImplicitRequiredProps,name:se},ve=Q;if(M(Q)&&t&&(ve=t.getSchemaByRef(Q.$ref),!ve))throw new Error(`Schema ${Q.$ref} not found`);let be=Y({...a,schema:Q,meta:G}).getCodeString(n,t.options)+wt({schema:ve,meta:G,options:t.options});return[se,be]}).map(([se,Q])=>`${zv(se)}: ${Q}`).join(", ")+" }");let _=O?".partial()":"",V=t.options.strictObjects?".strict()":"";return i.assign(`z.object(${P})${_}${V}${b}${d}`)}if(!m)return i.assign("z.unknown()");throw new Error(`Unsupported schema type: ${m}`)}o(Y,"getZodSchema");function PR({schema:e,zodSchema:t,resolver:r,meta:n,tag:i}){if(!M(e))return;let s=t.meta.referencedBy.slice(0,-1).map(u=>u.ref?r.getZodSchemaNameByRef(u.ref)??u.ref:void 0).filter(Boolean),a=r.getZodSchemaNameByRef(e.$ref);if(s.length>1&&s.includes(a))return t.assign(r.getCodeByZodSchemaName(t.ref));let c=r.getCodeByZodSchemaName(e.$ref);if(!c){let u=r.getSchemaByRef(e.$ref);if(!u)throw new Error(`Schema ${e.$ref} not found`);c=Y({schema:u,resolver:r,meta:n,tag:i}).getCodeString(i,r.options)}return r.getCodeByZodSchemaName(a)||r.setZodSchema(a,c,i),t}o(PR,"getReferenceZodSchema");function $R({schema:e,zodSchema:t,resolver:r,meta:n,tag:i}){var a;if(!je(e)||!e.oneOf)return;if(e.oneOf.length===1){let c=Y({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=>je(c)&&((c==null?void 0:c.allOf)||[]).length>1);if(e.discriminator&&!s){let c=e.discriminator.propertyName;return t.assign(`
|
|
74
|
+
`].some(s=>String.prototype.includes.call(e.description,s))?n.push(`describe(\`${e.description}\`)`):n.push(`describe("${e.description}")`));let i=n.concat(gR({schema:e,meta:t,options:r}),r.withDefaultValues!==!1?yR(e):[]).filter(Boolean).join(".");return i?`.${i}`:""}o(wt,"getZodChain");function gR({schema:e,meta:t,options:r}){return e.nullable&&!(t!=null&&t.isRequired)?"nullish()":e.nullable?"nullable()":t!=null&&t.isRequired?"":r.replaceOptionalWithNullish?"nullish()":"optional()"}o(gR,"getZodChainablePresence");function yR(e){return e.default!==void 0?`default(${ge(e.type).with("number","integer",()=>Gv(e.default)).otherwise(()=>JSON.stringify(e.default))})`:""}o(yR,"getZodChainableDefault");function vR(e){let t=[];if(e.enum||(e.minLength!==void 0&&t.push(`min(${e.minLength})`),e.maxLength!==void 0&&t.push(`max(${e.maxLength})`)),e.pattern&&t.push(`regex(${bR(e.pattern)})`),e.format){let r=ge(e.format).with("email",()=>"email()").with("hostname","uri",()=>"url()").with("uuid",()=>"uuid()").with("date-time",()=>"datetime({ offset: true })").otherwise(()=>"");r&&t.push(r)}return t.join(".")}o(vR,"getZodChainableStringValidations");function bR(e){return e.startsWith("/")&&e.endsWith("/")&&(e=e.slice(1,-1)),e=Zv(e),`/${e}/`}o(bR,"formatPatternIfNeeded");function SR(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(SR,"getZodChainableNumberValidations");function _R(e){let t=[];return e.minItems&&t.push(`min(${e.minItems})`),e.maxItems&&t.push(`max(${e.maxItems})`),t.join(".")}o(_R,"getZodChainableArrayValidations");var Wr=o(e=>e.reduce((t,r)=>t+r,0),"sum");function ie(e,t){if(!t)return e;if(M(t))return e+2;if(Array.isArray(t.type))return t.type.length===1?Ee("oneOf")+ie(e,{...t,type:t.type[0]}):e+Ee("oneOf")+Wr(t.type.map(r=>ie(0,{...t,type:r})));if(t.oneOf)return t.oneOf.length===1?Ee("oneOf")+ie(e,t.oneOf[0]):e+Ee("oneOf")+Wr(t.oneOf.map(r=>ie(0,r)));if(t.anyOf)return t.anyOf.length===1?Ee("anyOf")+ie(e,t.anyOf[0]):e+Ee("anyOf")+Wr(t.anyOf.map(r=>ie(0,r)));if(t.allOf)return t.allOf.length===1?Ee("allOf")+ie(e,t.allOf[0]):e+Ee("allOf")+Wr(t.allOf.map(r=>ie(0,r)));if(!t.type)return e;if(Lt(t.type))return t.enum?e+_b(t)+Ee("enum")+Wr(t.enum.map(r=>ie(0,r))):e+_b(t);if(t.type==="array")return t.items?Ee("array")+ie(e,t.items):Ee("array")+ie(e);if(t.type==="object"||t.properties||t.additionalProperties){if(t.additionalProperties)return t.additionalProperties===!0?Ee("record")+ie(e):Ee("record")+ie(e,t.additionalProperties);if(t.properties){let r=Object.values(t.properties);return e+Ee("object")+Wr(r.map(n=>ie(0,n)))}return Ee("empty-object")+ie(e)}return e}o(ie,"getOpenAPISchemaComplexity");function _b(e){return ge(e.type).with("string","number","integer","boolean",()=>1).otherwise(()=>0)}o(_b,"complexityByType");function Ee(e){return ge(e).with("oneOf",()=>2).with("anyOf",()=>3).with("allOf",()=>2).with("enum","array","record","empty-object",()=>1).with("object",()=>2).otherwise(()=>0)}o(Ee,"complexityByComposite");var Hp=class Hp{constructor(t,r,n={referencedBy:[]},i){this.schema=t;this.resolver=r;M(t)&&(this.ref=t.$ref),i&&(this.enumRef=i),this.meta={...n,referencedBy:[...(n==null?void 0:n.referencedBy)??[]]},this.ref&&this.meta.referencedBy.push(this)}code;ref;enumRef;children=[];meta;getCodeString(t,r){var s,a;if(!this.ref&&this.code)return this.code;if(!this.ref)throw new Error("Zod schema is missing both ref and code");let n=(s=this.resolver)==null?void 0:s.getZodSchemaNameByRef(this.ref);if(!n)return this.ref;let i=(a=this.resolver)==null?void 0:a.getTagByZodSchemaName(n);return r!=null&&r.includeNamespaces&&i&&i!==t?`${K({type:"models",tag:i,options:r})}.${n}`:n}get complexity(){return ie(0,this.schema)}assign(t){return this.code=t,this}inherit(t){return t&&t.children.push(this),this}};o(Hp,"ZodSchema");var oo=Hp;function Y({schema:e,resolver:t,meta:r,tag:n}){var g;let i=new oo(e,t,r),s={parent:i.inherit(r==null?void 0:r.parent),referencedBy:[...i.meta.referencedBy]},a={resolver:t,meta:s,tag:n};if(M(e))return PR({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});let c=OR({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(c)return c;let u=$R({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(u)return u;let l=ER({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(l)return l;let f=xR({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(f)return f;let p=wR({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(p)return p;let d=t.options.allReadonly?".readonly()":"";if(Ds(e))return e.items?i.assign(`z.array(${Y({...a,schema:e.items}).getCodeString(n,t.options)}${wt({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=t.options.additionalPropertiesDefaultValue!==void 0?t.options.additionalPropertiesDefaultValue:!0,b=(e.additionalProperties===null||e.additionalProperties===void 0?y:e.additionalProperties)===!1?"":".passthrough()";if(typeof e.additionalProperties=="object"&&Object.keys(e.additionalProperties).length>0)return i.assign(`z.record(${Y({...a,schema:e.additionalProperties}).getCodeString(n,t.options)+wt({schema:e.additionalProperties,meta:{...s,isRequired:!0},options:t.options})})`);let S=e.required&&e.required.length>0,O=t.options.withImplicitRequiredProps?!1:!((g=e.required)!=null&&g.length),P="{}";e.properties&&(P="{ "+Object.entries(e.properties).map(([se,Q])=>{var Gt;let G={...s,isRequired:O?!0:S?(Gt=e.required)==null?void 0:Gt.includes(se):t.options.withImplicitRequiredProps,name:se},ve=Q;if(M(Q)&&t&&(ve=t.getSchemaByRef(Q.$ref),!ve))throw new Error(`Schema ${Q.$ref} not found`);let be=Y({...a,schema:Q,meta:G}).getCodeString(n,t.options)+wt({schema:ve,meta:G,options:t.options});return[se,be]}).map(([se,Q])=>`${zv(se)}: ${Q}`).join(", ")+" }");let _=O?".partial()":"",V=t.options.strictObjects?".strict()":"";return i.assign(`z.object(${P})${_}${V}${b}${d}`)}if(!m)return i.assign("z.unknown()");throw new Error(`Unsupported schema type: ${m}`)}o(Y,"getZodSchema");function PR({schema:e,zodSchema:t,resolver:r,meta:n,tag:i}){if(!M(e))return;let s=t.meta.referencedBy.slice(0,-1).map(u=>u.ref?r.getZodSchemaNameByRef(u.ref)??u.ref:void 0).filter(Boolean),a=r.getZodSchemaNameByRef(e.$ref);if(s.length>1&&s.includes(a))return t.assign(r.getCodeByZodSchemaName(t.ref));let c=r.getCodeByZodSchemaName(e.$ref);if(!c){let u=r.getSchemaByRef(e.$ref);if(!u)throw new Error(`Schema ${e.$ref} not found`);c=Y({schema:u,resolver:r,meta:n,tag:i}).getCodeString(i,r.options)}return r.getCodeByZodSchemaName(a)||r.setZodSchema(a,c,i),t}o(PR,"getReferenceZodSchema");function $R({schema:e,zodSchema:t,resolver:r,meta:n,tag:i}){var a;if(!je(e)||!e.oneOf)return;if(e.oneOf.length===1){let c=Y({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=>je(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=>Y({schema:u,resolver:r,meta:n,tag:i}).getCodeString(i,r.options)).join(", ")}])
|
|
76
76
|
`)}return t.assign(`z.union([${e.oneOf.map(c=>Y({schema:c,resolver:r,meta:n,tag:i}).getCodeString(i,r.options)).join(", ")}])`)}o($R,"getOneOfZodSchema");function OR({schema:e,zodSchema:t,resolver:r,meta:n,tag:i}){if(!(!je(e)||!Array.isArray(e.type)))return e.type.length===1?Y({schema:{...e,type:e.type[0]},resolver:r,meta:n,tag:i}):t.assign(`z.union([${e.type.map(s=>Y({schema:{...e,type:s},resolver:r,meta:n,tag:i}).getCodeString(i,r.options)).join(", ")}])`)}o(OR,"getArrayZodSchema");function ER({schema:e,zodSchema:t,resolver:r,meta:n,tag:i}){if(!je(e)||!e.anyOf)return;if(e.anyOf.length===1){let a=Y({schema:e.anyOf[0],resolver:r,meta:n,tag:i});return t.assign(a.getCodeString(i,r.options))}let s=e.anyOf.map(a=>Y({schema:a,resolver:r,meta:n,tag:i})).map(a=>a.getCodeString(i,r.options)).join(", ");return t.assign(`z.union([${s}])`)}o(ER,"getAnyOfZodSchema");function xR({schema:e,zodSchema:t,resolver:r,meta:n,tag:i}){if(!je(e)||!e.allOf)return;if(e.allOf.length===1){let p=Y({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}=Yv(e),u=a.map(p=>{let d=Y({schema:p,resolver:r,meta:n,tag:i});return r&&s(p,r.getSchemaByRef.bind(r)),d});c.required.length&&u.push(Y({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(xR,"getAllOfZodSchema");function wR({schema:e,zodSchema:t,resolver:r,meta:n,tag:i}){if(!je(e))return;let s=e.type?e.type.toLowerCase():void 0;if(s&&Lt(s)){if(e.enum){if(s==="string")return AR({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(ge(s).with("integer",()=>"z.number()").with("string",()=>ge(e.format).with("binary",()=>"z.instanceof(File)").otherwise(()=>"z.string()")).otherwise(a=>`z.${a}()`))}}o(wR,"getPrimitiveZodSchema");function AR({resolver:e,schema:t,zodSchema:r,meta:n,tag:i}){if(!je(t))return;let s=Bp(t),a=e.getEnumZodSchemaDataByCode(s);if(!e.options.extractEnums||!a)return r.assign(s);if(!a.zodSchemaName||!a.tag)throw new Error(`Enum zod schema name or tag not resolved for code: ${s}`);let c=e.options.includeNamespaces&&a.tag!==i?`${K({type:"models",tag:a.tag,options:e.options})}.`:"";return new oo(t,e,n,a.zodSchemaName).inherit(r),r.assign(`${c}${a.zodSchemaName}`)}o(AR,"getEnumZodSchema");function Bp(e){var t;return`${Is}([${(t=e.enum)==null?void 0:t.map(r=>r===null?"null":`"${r}"`).join(", ")}])`}o(Bp,"getEnumZodSchemaCode");function Zn({schema:e,zodSchema:t,fallbackName:r,resolver:n,tag:i}){var c;let s=t.getCodeString();if((!$e(s)||t.ref===void 0)&&r){if(t.complexity<Cp)return s;let u=Ft(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 ie(0,n.getSchemaByRef(t.ref))<Cp?n.getCodeByZodSchemaName(s):s;throw new Error(`Invalid ref: ${t.ref}`)}o(Zn,"resolveZodSchemaName");function Pb({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=IR({resolver:e,endpoint:t,acl:n,name:c});return u?[...a,u]:(e.validationErrors.push(bb(c,r,t)),a)},[]);return{...i,conditionsTypes:s}})}o(Pb,"getEndpointAcl");function IR({resolver:e,endpoint:t,acl:r,name:n}){var p,d,m,g,y,v,b,S,O,P;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} ${ur(f.type)} parameter`,l++;else{let _=t.parameters.find(({bodyObject:se})=>!!se),q=Object.keys(((y=_==null?void 0:_.bodyObject)==null?void 0:y.content)??{}).find(ze);q&&(a=(S=(b=(v=_==null?void 0:_.bodyObject)==null?void 0:v.content)==null?void 0:b[q])==null?void 0:S.schema,u=`${xt(t)?"query":"mutation"} data`)}for(;a&&l<s.length;){let _=e.resolveObject(a);a=(O=Object.entries(_.properties??{}).find(([q])=>q===s[l]))==null?void 0:O[1],c=((P=_.required)==null?void 0:P.includes(s[l]))??!1,l++}if(a)return{name:n,type:M(a)?void 0:a.type,zodSchemaName:M(a)?e.getZodSchemaNameByRef(a.$ref):void 0,required:c,info:u}}o(IR,"getEndpointAclConditionPropertyType");function $b({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(ze);if(!c)return;let u=(g=(m=s.content)==null?void 0:m[c])==null?void 0:g.schema;if(!u)return;let l=Y({schema:u,resolver:e,meta:{isRequired:s.required??!0},tag:i}),f=e.resolveObject(u),p=Zn({schema:f,zodSchema:l,fallbackName:Ls(Gr(r,n,i)),resolver:e,tag:i}),d=wt({schema:f,meta:l.meta,options:e.options});return{endpointParameter:{name:qv,type:"Body",description:s.description,zodSchema:p+d,bodyObject:s},requestFormat:c}}o($b,"getEndpointBody");function Ob({resolver:e,param:t,operationName:r,isUniqueOperationName:n,tag:i}){let s=e.resolveObject(t);if(!Fv.includes(s.in))return;let a={};if(s.content){let p=Object.keys(s.content??{}),d=p.find(ze);if(!d)throw new Error(`Unsupported media type for param ${s.name}: ${p.join(", ")}`);let m=s.content[d];if(!m)throw new Error(`No content with media type for param ${s.name}: ${d}`);a=(m==null?void 0:m.schema)??m}else s.schema&&(a=s.schema);e.options.withDescription&&a&&(a.description=(s.description??"").trim());let c=Y({schema:a,resolver:e,meta:{isRequired:s.in==="path"?!0:s.required??!1},tag:i}),u=e.resolveObject(a),l=wt({schema:u,meta:c.meta,options:e.options}),f=Zn({schema:u,zodSchema:c.assign(c.getCodeString(i)+l),fallbackName:Qv(Gr(r,n,i),s.name),resolver:e,tag:i});return{name:ge(s.in).with("path",()=>Mp(s.name)).otherwise(()=>s.name),type:ge(s.in).with("header",()=>"Header").with("query",()=>"Query").with("path",()=>"Path").run(),zodSchema:f,parameterObject:s}}o(Ob,"getEndpointParameter");function xb(e){var r,n,i,s,a;let t=[];for(let c in e.openApiDoc.paths){let u=e.openApiDoc.paths[c],l=gr(u,hr),f=Eb(u.parameters??[]);for(let p in l){let d=l[p];if(!d||d.deprecated&&!e.options.withDeprecatedEndpoints)continue;let m=d.operationId&&d.operationId!==_t(d.operationId);d.operationId&&m&&e.validationErrors.push(hb(d.operationId));let g=Object.entries({...f,...Eb(d.parameters??[])}).map(([,P])=>P),y=Xi({path:c,method:p,operation:d,operationsByTag:e.operationsByTag,options:e.options}),v=e.operationNames.filter(P=>P===y).length<=1,b=Ur(d,e.options),S={method:p,path:Wv(c),operationName:y,description:d.description,summary:d.summary,tags:(r=d.tags)==null?void 0:r.map(Et),requestFormat:"application/json",parameters:[],response:"",errors:[],responseStatusCodes:[]};if(d.requestBody){let P=$b({resolver:e,operation:d,operationName:y,isUniqueOperationName:v,tag:b});P&&(S.parameters.push(P.endpointParameter),S.requestFormat=P.requestFormat)}for(let P of g){let _=Ob({resolver:e,param:P,operationName:y,isUniqueOperationName:v,tag:b});_&&S.parameters.push(_)}let O=TR(S);O.forEach(P=>{S.parameters.push(P)}),O.length>0&&e.validationErrors.push(gb(O,c));for(let P in d.responses){S.responseStatusCodes.push(P);let _=e.resolveObject(d.responses[P]),q=Object.keys(_.content??{}).find(zn),se,Q;if(q?(S.responseFormat=q,se=(i=(n=_.content)==null?void 0:n[q])==null?void 0:i.schema):Q=Ki,se){let G=Y({schema:se,resolver:e,meta:{isRequired:!0},tag:b}),ve=e.resolveObject(se);Q=Zn({schema:ve,zodSchema:G,fallbackName:G.ref?void 0:Fs({statusCode:P,operationName:y,isUniqueOperationName:v,tag:b}),resolver:e,tag:b})+wt({schema:ve,meta:G.meta,options:e.options})}if(Q){let G=Number(P);qs(G)?(S.response=Q,S.responseObject=_,S.responseDescription=_.description):P!=="default"&&Ms(G)&&S.errors.push({zodSchema:Q,status:G,description:_.description})}}S.response||(S.response=Ki),S.acl=Pb({resolver:e,endpoint:S,operation:d}),(s=d.security)!=null&&s[0].Authorization&&!S.responseStatusCodes.includes("401")&&e.validationErrors.push(Vp("401",d,S)),(a=S.acl)!=null&&a[0]&&!S.responseStatusCodes.includes("403")&&e.validationErrors.push(Vp("403",d,S)),t.push(S)}}return t}o(xb,"getEndpointsFromOpenAPIDoc");function Eb(e){return Object.fromEntries((e??[]).map(t=>[M(t)?t.$ref:t.name,t]))}o(Eb,"getParameters");function TR(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=>kR(r))}o(TR,"getMissingPathParameters");function kR(e){return{name:e,type:"Path",zodSchema:"z.string()",parameterObject:{name:e,required:!0,in:"path",schema:{type:"string"}}}}o(kR,"getPathParameterFromName");function wb(e,t){let r=RR(e,t),n=CR(e,r);return{refsDependencyGraph:r,deepDependencyGraph:n}}o(wb,"getOpenAPISchemaDependencyGraph");function RR(e,t){let r={},n={};return e.forEach(i=>NR({schema:t(i),fromRef:i,getSchemaByRef:t,visitedRefs:r,refsDependencyGraph:n})),n}o(RR,"getRefsDependencyGraph");function CR(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(CR,"getDeepRefsDependencyGraph");function NR({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,Oe(r(c.$ref),{data:{fromRef:c.$ref},onSchema:s})},"onSchema");return Oe(e,{data:{fromRef:t},onSchema:s}),{visitedRefs:n,refsDependencyGraph:i}}o(NR,"getSchemaRefsDependencyGraph");function zs(e,t,r){let n=[];return Oe(t,{onSchema:o(s=>{s.type==="reference"?n.push(s.schema):M(s.parentSchema)&&(s.type==="property"||s.type==="additionalProperty"?e.validationErrors.push(Us(`${r} has both reference and properties`)):s.type==="array"?e.validationErrors.push(Us(`${r} is both reference and array schema`)):s.type==="composite"&&e.validationErrors.push(Us(`${r} has both reference and composite keyword`)))},"onSchema")}),n}o(zs,"getSchemaRefObjs");function Ab(e,t){return t.map(i=>zr(i.$ref)).reduce((i,s)=>{let a=e.dependencyGraph.deepDependencyGraph[s];return[...i,s,...Array.from(a??[])]},[])}o(Ab,"getDeepSchemaRefObjs");function so({schema:e,nameSegments:t=[],includeSelf:r,...n}){r&&Ib({schema:e,nameSegments:t,...n}),Oe(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"||s.type==="additionalProperty")&&a.push(s.propertyName),Ib({schema:s.schema,nameSegments:[...a],...n})},"onSchema")})}o(so,"updateEnumZodSchemaData");function Ib({resolver:e,schema:t,schemaRef:r,schemaInfo:n,tags:i,nameSegments:s=[]}){if(!t||M(t)||!t.enum)return;let a=Bp(t),c=e.enumZodSchemaData.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.enumZodSchemaData.push({code:a,meta:{zodSchemaNameSegments:[s],tags:[...i],schemaRefs:r?[r]:[],schemas:t?[t]:[]}}),e.validationErrors.push(yb(r?`schema ${Un(r)} property ${s[s.length-1]}`:n??s.join("->")))}o(Ib,"handleEnumZodSchemaDataUpdate");function Tb(e){e.enumZodSchemaData.forEach(r=>{let n=r.meta.zodSchemaNameSegments.map(s=>s[s.length-1]).filter(Boolean),i=Pp(n);if(!i)throw new Error(`No common last segment found for enum: ${r.code}`);r.zodSchemaName=Dp(i,e.options.enumSuffix,e.options.schemaSuffix)});let t=0;for(;t<5&&!Up(e);)jR(e,t+2),t++;if(Up(e)||e.enumZodSchemaData.filter(n=>!Rb(e,n)).forEach(n=>{n.zodSchemaName=Dp(n.meta.zodSchemaNameSegments[0].map(i=>zp(Z(i))).join(""),e.options.enumSuffix,e.options.schemaSuffix)}),!Up(e))throw new Error("Failed to resolve unique names for enum zod schemas")}o(Tb,"resolveEnumZodSchemaNames");function Up(e){return e.enumZodSchemaData.every(t=>Rb(e,t))}o(Up,"allEnumZodSchemaNamesAreUnique");function jR(e,t){e.enumZodSchemaData.forEach(r=>{let n=e.enumZodSchemaData.filter(({zodSchemaName:i})=>r.zodSchemaName===i);n.length!==1&&qR(n,t)})}o(jR,"additionalResolveEnumZodSchemaName");function qR(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=[zp(Z(n[0])),r.zodSchemaName].filter(Boolean).join("");r.zodSchemaName=i}else{let i=Pp(n),s=[i?zp(Z(i)):"",r.zodSchemaName].filter(Boolean).join("");r.zodSchemaName=s}})}o(qR,"suffixWithPreviousSegmentName");function kb(e){e.enumZodSchemaData.forEach(t=>{let r=Ne(t.meta.tags);t.tag=r.length===1?r[0]:e.options.defaultTag})}o(kb,"resolveEnumZodSchemaTags");function Rb(e,t){return e.enumZodSchemaData.filter(({zodSchemaName:r})=>t.zodSchemaName===r).length===1}o(Rb,"isUnique");function zp(e){return e.replace(/(Dto|DTO|Response|Request)/g,"")}o(zp,"sanitizeName");var Gp=class Gp{constructor(t,r){this.openApiDoc=t;this.options=r;this.dependencyGraph=wb(this.schemaRefs,this.getSchemaByRef.bind(this)),this.operationsByTag=Hv(t,r),this.operationNames=Kv(t,this.operationsByTag,r),this.initialize()}schemaData=[];zodSchemaData=[];compositeZodSchemaData=[];enumZodSchemaData=[];dependencyGraph;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(Uv)}getSchemaByRef(t){return this.docSchemas[Un(t)]}getSchemaDataByRef(t){return this.schemaData.find(r=>r.ref===t)}getZodSchemaNameByRef(t){var n,i;let r=((n=this.getSchemaDataByRef(zr(t)))==null?void 0:n.zodSchemaName)??((i=this.enumZodSchemaData.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.enumZodSchemaData.find(f=>f.zodSchemaName===t);if(r)return Et(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=Ne(i,s),c=a.length===1?a[0]:this.options.defaultTag;return Et(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.enumZodSchemaData.find(r=>r.code===t)}getEnumZodSchemaDataByName(t){return this.enumZodSchemaData.find(({zodSchemaName:r})=>r===t)}getEnumZodSchemaNamesReferencedBySchemaRef(t){return this.enumZodSchemaData.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}),{})}getEnumZodSchemas(){return this.enumZodSchemaData.reduce((t,{zodSchemaName:r,code:n})=>r?{...t,[r]:n}:t,{})}resolveObject(t){return M(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=[]){var i,s;return(i=this.dependencyGraph.refsDependencyGraph[r])!=null&&i.has(t)?[...n,r,t]:Array.from(((s=this.dependencyGraph.refsDependencyGraph[r])==null?void 0:s.values())??[]).map(a=>{let c=this.getCircularSchemaChain(t,a,n);return c.length>0?[r,...c]:c}).flat()}getBaseUrl(){var r;let t=(r=this.openApiDoc.servers)==null?void 0:r[0].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.getEnumZodSchemaDataByName(t);if(i)return i.meta.schemas.reduce((s,a)=>({...s,...this.resolveObject(a)}),{})}initialize(){var t,r,n,i,s;this.schemaRefs.forEach(a=>{let c=zr(a),u=Un(c),l=Ft(u,this.options.schemaSuffix);this.schemaData.push({ref:c,name:u,zodSchemaName:l,tags:[]})});for(let a in this.openApiDoc.paths){let c=this.openApiDoc.paths[a],u=gr(c,hr);for(let l in u){let f=u[l];if(!f||f.deprecated&&!this.options.withDeprecatedEndpoints)continue;let p=Ur(f,this.options),d=Xi({path:a,method:l,operation:f,operationsByTag:this.operationsByTag,options:this.options}),m=this.operationNames.filter(b=>b===d).length<=1,g=ue(Gr(d,m,p)),y=[];if((t=f.parameters)==null||t.map(b=>{let S=b,O=S.schema,P=`operation ${f.operationId??a} parameter ${S.name}`;y.push(...zs(this,O,P)),this.options.extractEnums&&so({resolver:this,schema:O,schemaInfo:P,tags:[p],nameSegments:[g,S.name],includeSelf:!0})}),f.requestBody){let b=this.resolveObject(f.requestBody),O=Object.keys(b.content??{}).find(ze);if(O){let P=(n=(r=b.content)==null?void 0:r[O])==null?void 0:n.schema,_=`operation ${f.operationId} request body`;y.push(...zs(this,P,_)),this.options.extractEnums&&so({resolver:this,schema:P,schemaInfo:_,tags:[p],nameSegments:[Ls(g)]})}}for(let b in f.responses){let S=this.resolveObject(f.responses[b]),P=Object.keys(S.content??{}).find(zn);if(P){let _=(s=(i=S.content)==null?void 0:i[P])==null?void 0:s.schema,V=`operation ${f.operationId} response body`;y.push(...zs(this,_,V)),this.options.extractEnums&&so({resolver:this,schema:_,schemaInfo:V,tags:[p],nameSegments:[Fs({statusCode:b,operationName:d,isUniqueOperationName:m,tag:p})]})}}Ab(this,y).forEach(b=>{let S=this.getSchemaDataByRef(b);S&&S.tags.push(p)})}}this.options.extractEnums&&(this.schemaRefs.forEach(a=>{var u;let c=zr(a);so({resolver:this,schema:this.getSchemaByRef(c),schemaRef:c,tags:((u=this.getSchemaDataByRef(c))==null?void 0:u.tags)??[],nameSegments:[Un(c)]})}),Tb(this),kb(this))}};o(Gp,"SchemaResolver");var Gs=Gp;function Cb(e){var r;let t={};return Object.entries(((r=e.openApiDoc.components)==null?void 0:r.schemas)??{}).forEach(([n,i])=>{let s=Ft(n,e.options.schemaSuffix);if(!t[s]){let a=e.getTagByZodSchemaName(s);t[s]=Y({schema:i,resolver:e,tag:a}).getCodeString(a)}}),t}o(Cb,"getZodSchemasFromOpenAPIDoc");function Nb(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(Nb,"topologicalSort");function jb(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(jb,"sortObjKeysFromArray");function qb(e,t){let r=Nb(e.dependencyGraph.deepDependencyGraph).map(i=>e.getZodSchemaNameByRef(i));return jb(t,r)}o(qb,"sortZodSchemasByTopology");function Mb(e,t){let r={};return Object.entries(t).forEach(([n,i])=>{let s=e.getRefByZodSchemaName(n);s&&e.isSchemaCircular(s)?(e.validationErrors.push(vb(e.getCircularSchemaChain(s).join(" -> "))),r[Ft(n,e.options.schemaSuffix)]=`z.lazy(() => ${i})`):r[Ft(n,e.options.schemaSuffix)]=i}),r}o(Mb,"wrapCircularZodSchemas");function Zs(e,t){let r=new Gs(e,t),n=xb(r),s={...Cb(r),...r.getZodSchemas()};return s=Mb(r,s),s=qb(r,s),s={...r.getEnumZodSchemas(),...s},{resolver:r,data:MR({resolver:r,endpoints:n,zodSchemas:s,options:t})}}o(Zs,"getDataFromOpenAPIDoc");function MR({resolver:e,endpoints:t,zodSchemas:r,options:n}){let i=new Map;return n.splitByTags?(t.forEach(s=>{let a=no(s,n);Db(a,i).endpoints.push(s)}),Object.entries(r).forEach(([s,a])=>{let c=e.getTagByZodSchemaName(s);c&&(Db(c,i).zodSchemas[s]=a)}),i):(i.set(n.defaultTag,{endpoints:t,zodSchemas:r}),i)}o(MR,"splitDataByTags");function Db(e,t){return t.has(e)||t.set(e,{endpoints:[],zodSchemas:{}}),t.get(e)}o(Db,"getTagElement");async function Lb(e,t){let{resolver:r,data:n}=await Zs(e,t),i=[],s=[];return n.forEach(({endpoints:c,zodSchemas:u},l)=>{var d;((d=t.excludeTags)==null?void 0:d.findIndex(m=>m.toLowerCase()===l.toLowerCase()))===-1&&(Object.keys(u).forEach(m=>{let g=r.getRefByZodSchemaName(m),y=g?r.getSchemaByRef(g):r.getSchemaByCompositeZodSchemaName(m),v=Gn({zodSchemaName:m,schema:y,resolver:r}),b;y&&(b=Zr({schema:y,parentTypes:[v],resolver:r})),i.push({...v,metaType:"primitive",...b})}),c.forEach(m=>{let g="queries",y=Et(l);s.push({name:ks(m),importPath:Kr({type:g,tag:y,includeTagDir:!0,options:t}),namespace:t.includeNamespaces?K({type:g,tag:y,options:t}):void 0,isQuery:xt(m),isMutation:Bs(m),params:DR({resolver:r,endpoint:m}),response:LR({resolver:r,endpoint:m})})}))}),{openApiDoc:e,models:i,queries:s}}o(Lb,"getMetadataFromOpenAPIDoc");function DR({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(ze);p&&(n=e.resolveObject((u=(c=r.bodyObject.content)==null?void 0:c[p])==null?void 0:u.schema))}let i=Gn({zodSchemaName:r.zodSchema,schema:n,resolver:e}),s;return n&&(s=Zr({schema:n,parentTypes:[i],resolver:e})),{name:_t(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(DR,"getQueryMetadataParams");function LR({resolver:e,endpoint:t}){var a,c,u,l;let r,n=Object.keys(((a=t.responseObject)==null?void 0:a.content)??{}).find(zn);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=Gn({zodSchemaName:t.response,schema:r,resolver:e}),s;return r&&(s=Zr({schema:r,parentTypes:[i],resolver:e})),{...i,metaType:"primitive",...s}}o(LR,"getQueryMetadataResponse");var Fb={fileName:"acl/app.ability",extension:"ts"},ao="AllAbilities",st={abilityTuple:"AbilityTuple",pureAbility:"PureAbility",forcedSubject:"ForcedSubject",subject:"subject"},Zp={bindings:[st.abilityTuple,st.pureAbility,st.forcedSubject,st.subject],from:"@casl/ability"};var Vb=o(e=>`Use${Z(ue(e.operationName))}Ability`,"getAbilityTypeName"),Hb=o(e=>`canUse${Z(ue(e.operationName))}`,"getAbilityFunctionName"),Bb=o(e=>{var t;return(t=e.acl)==null?void 0:t[0].action},"getAbilityAction"),Ub=o(e=>{var t;return(t=e.acl)==null?void 0:t[0].subject},"getAbilitySubject"),zb=o(e=>{var t;return!!((t=Kp(e))!=null&&t.length)},"hasAbilityConditions"),Kp=o(e=>{var t;return(t=e.acl)==null?void 0:t[0].conditionsTypes},"getAbilityConditionsTypes"),Gb=o(e=>{var t;return(t=e.acl)==null?void 0:t[0].description},"getAbilityDescription"),Ks=o(e=>`${Z(e)}${ao}`,"getTagAllAbilitiesName");var Uf=lt(_r());var Vf=lt(require("fs")),M_=lt(require("path"));function D_(e){return Vf.default.readFileSync(M_.default.join(__dirname,`../${e}`),"utf-8")}o(D_,"readFileSync");function Hf(e){let t=`src/generators/templates/${e}.hbs`;return D_(t)}o(Hf,"readHbsTemplateSync");function L_(e){let t=`src/assets/${e}`;return D_(t)}o(L_,"readAssetSync");function Po({output:e,fileName:t}){return`${e}/${t}`}o(Po,"getOutputFileName");var zt=lt(_r());function F_(){k3(),R3(),C3(),N3(),j3(),q3(),M3(),D3()}o(F_,"registerAclHbsHelpers");function k3(){zt.default.registerHelper("abilityTypeName",Vb)}o(k3,"registerAbilityTypeNameHelper");function R3(){zt.default.registerHelper("abilityFunctionName",Hb)}o(R3,"registerAbilityFunctionNameHelper");function C3(){zt.default.registerHelper("ablityAction",Bb)}o(C3,"registerAbilityActionHelper");function N3(){zt.default.registerHelper("ablitySubject",Ub)}o(N3,"registerAbilitySubjectHelper");function j3(){zt.default.registerHelper("hasAbilityConditions",zb)}o(j3,"registerHasAbilityConditionsHelper");function q3(){zt.default.registerHelper("abilityConditionsTypes",Kp)}o(q3,"registerAbilityConditionsTypesHelper");function M3(){zt.default.registerHelper("abilityDescription",Gb)}o(M3,"registerAbilityDescriptionHelper");function D3(){zt.default.registerHelper("tagAllAbilitiesName",Ks)}o(D3,"registerTagAllAbilitiesNameHelper");var $o=lt(_r());function V_(){L3(),F3(),V3(),H3()}o(V_,"registerCommonHbsHelpers");function L3(){$o.default.registerHelper("isEqual",(e,t)=>e===t)}o(L3,"registerIsEqualHelper");function F3(){$o.default.registerHelper("commaSeparated",e=>e.join(", "))}o(F3,"registerCommaSeparatedListHelper");function V3(){$o.default.registerHelper("addAsteriskAfterNewLine",e=>e.replace(/\n/g,`
|
|
77
77
|
*`))}o(V3,"registerAddAsteriskAfterNewLineHelper");function H3(){$o.default.registerHelper("jsonStringify",e=>JSON.stringify(e,null,2))}o(H3,"registerJsonStringifyHelper");var Pr=lt(_r());function H_(e){B3(),U3(e.options),Z3(e),z3(),G3(),K3(e),W3()}o(H_,"registerEndpointsHbsHelpers");function B3(){Pr.default.registerHelper("endpointName",ro)}o(B3,"registerEndpointNameHelper");function U3(e){Pr.default.registerHelper("importedEndpointName",t=>sb(t,e))}o(U3,"registerImportedEndpointNameHelper");function z3(){Pr.default.registerHelper("endpointPath",ab)}o(z3,"registerEndpointPathHelper");function G3(){Pr.default.registerHelper("endpointBody",e=>e.parameters.find(t=>t.type==="Body"))}o(G3,"registerEndpointBodyHelper");function Z3(e){Pr.default.registerHelper("endpointParams",t=>Lp(e,t))}o(Z3,"registerEndpointParamsHelper");function K3(e){Pr.default.registerHelper("endpointArgs",t=>Lp(e,t).map(r=>r.name).join(", "))}o(K3,"registerEndpointArgsHelper");function W3(){Pr.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&&je(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(ze);p&&(i=e.bodyObject.content[p],i.schema&&je(i.schema)&&(n=i.schema))}if(n){let f=eo(n);t.push(...f)}return i!=null&&i.example&&t.push(`Example: \`${i.example}\``),t.join(". ")})}o(W3,"registerEndpointParamDescriptionHelper");var kt=lt(_r());var Tt={query:"useQuery",mutation:"useMutation",queryClient:"useQueryClient"},B_={bindings:[Tt.query,Tt.mutation,Tt.queryClient],from:"@tanstack/react-query"};function U_(){Y3(),J3(),Q3(),X3(),ej(),tj(),rj(),nj(),ij()}o(U_,"registerPartialsHbsHelpers");function Y3(){kt.default.registerHelper("genModelJsDocs",(e,t,r)=>Rt("model-js-docs")({name:e,zodSchema:t,tag:r}))}o(Y3,"registerGenerateModelJsDocsHelper");function J3(){kt.default.registerHelper("genImport",e=>Rt("import")({import:e}))}o(J3,"registerImportHelper");function Q3(){kt.default.registerHelper("genEndpointParams",e=>Rt("endpoint-params")({endpoint:e}))}o(Q3,"registerGenerateEndpointParamsHelper");function X3(){kt.default.registerHelper("genEndpointConfig",e=>{let t=cb(e);return Object.keys(t).length===0?"":Rt("endpoint-config")({endpointConfig:t})})}o(X3,"registerGenerateEndpointConfigHelper");function ej(){kt.default.registerHelper("genQueryKeys",(e,t)=>e.length===0?"":Rt("query-keys")({queryEndpoints:e,namespace:t}))}o(ej,"registerGenerateQueryKeysHelper");function tj(){kt.default.registerHelper("genQuery",(e,t)=>{let r,n;return xt(e)?(r="query-use-query",n=Tt.query):(r="query-use-mutation",n=Tt.mutation),Rt(r)({endpoint:e,queryEndpoints:t,queryHook:n})})}o(tj,"registerGenerateQueryHelper");function rj(){kt.default.registerHelper("genQueryJsDocs",e=>Rt("query-js-docs")({endpoint:e}))}o(rj,"registerGenerateQueryJsDocsHelper");function nj(){kt.default.registerHelper("genCaslAbilityType",e=>Rt("casl-ability-type")({endpoint:e,abilityTupleType:st.abilityTuple}))}o(nj,"registerGenerateCaslAbilityTypeHelper");function ij(){kt.default.registerHelper("genCaslAbilityFunction",e=>Rt("casl-ability-function")({endpoint:e}))}o(ij,"registerGenerateCaslAbilityFunctionHelper");var Bf=lt(_r());function z_(){oj(),sj()}o(z_,"registerQueryHbsHelpers");function oj(){Bf.default.registerHelper("queryName",ks)}o(oj,"registerQueryNameHelper");function sj(){Bf.default.registerHelper("isQuery",xt)}o(sj,"registerIsQueryHelper");var rn=lt(_r());function G_(e){aj(e.options),cj(e),uj(e),lj(),pj(),fj(e)}o(G_,"registerZodHbsHelpers");function aj(e){rn.default.registerHelper("zodInferedType",t=>to(t,e))}o(aj,"registerInferedTypeHelper");function cj(e){rn.default.registerHelper("importedZodSchemaName",t=>Xv(e,t))}o(cj,"registerImportedZodSchemaNameHelper");function uj(e){rn.default.registerHelper("importedZodSchemaInferedType",t=>yr(e,t))}o(uj,"registerImportedZodSchemaInferedTypeHelper");function lj(){rn.default.registerHelper("zodSchemaType",e=>eb(e))}o(lj,"registerZodSchemaTypeHelper");function pj(){rn.default.registerHelper("zodSchemaDescription",e=>tb(e))}o(pj,"registerZodSchemaDescriptionHelper");function fj(e){rn.default.registerHelper("zodSchemaPropertyDescriptions",(t,r)=>nb(e,t,r))}o(fj,"registerZodSchemaPropertyDescriptionsHelper");function ct(e,t){let r=Hf(t);return V_(),G_(e),H_(e),z_(),F_(),U_(),Uf.default.compile(r)}o(ct,"getHbsTemplateDelegate");function Rt(e){let t=Hf(`partials/${e}`);return Uf.default.compile(t)}o(Rt,"getHbsPartialTemplateDelegate");function Z_({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={...Zp,bindings:[st.abilityTuple,...i?[st.forcedSubject,st.subject]:[]]},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=vr({resolver:e,tag:r,zodSchemasAsTypes:Ne(a)});return ct(e,"acl")({caslAbilityTupleImport:s,modelsImports:c,includeNamespace:e.options.includeNamespaces,namespace:K({type:"acl",tag:r,options:e.options}),endpoints:n})}o(Z_,"generateAcl");function K_(e,t){if(!t||t.length===0)return;let r={...Zp,bindings:[st.pureAbility]},n=lb({tags:t,entityName:ao,getAliasEntityName:Ks,options:e.options}),i=t.map(a=>K({type:"acl",tag:a,options:e.options}));return ct(e,"app-acl")({caslAbilityTupleImport:r,imports:n,allAbilities:ao,includeNamespace:e.options.includeNamespaces,tags:t,namespaces:i})}o(K_,"generateAppAcl");function W_({resolver:e,data:t,tag:r=""}){var f;let n=(f=t.get(r))==null?void 0:f.endpoints;if(!n||n.length===0)return;let i={bindings:[Yi],from:db(e.options)},s=n.map(p=>p.response),a=s.some(p=>!$e(p)),c=n.reduce((p,d)=>[...p,...d.parameters],[]),u=vr({resolver:e,tag:r,zodSchemas:Ne(s.filter($e)),zodSchemasAsTypes:Ne(c.map(p=>p.zodSchema).filter($e))});return ct(e,"endpoints")({appRestClientImport:i,hasZodImport:a,zodImport:Ts,modelsImports:u,includeNamespace:e.options.includeNamespaces,namespace:K({type:"endpoints",tag:r,options:e.options}),restClientName:Yi,endpoints:n})}o(W_,"generateEndpoints");function Y_(e,t){let r=e.getRefByZodSchemaName(t);if(r){let i=Array.from(e.dependencyGraph.refsDependencyGraph[r]??[]).map(a=>e.getZodSchemaNameByRef(a)),s=e.getEnumZodSchemaNamesReferencedBySchemaRef(r);return[...i,...s]}let n=e.getCompositeZodSchemaByZodSchemaName(t);return n?Array.from(J_(n)).map(i=>e.getZodSchemaNameByRef(i)):[]}o(Y_,"getZodSchemaRefs");function J_(e){return e.children.reduce((r,n)=>{let i=n.ref??n.enumRef;return i&&r.add(i),n.children.length>0&&J_(n).forEach(s=>r.add(s)),r},new Set)}o(J_,"getSchemaRefs");function Q_({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,...Y_(e,f)],[]).filter(l=>!n[l]),s=vr({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:Jv(p),schemaObj:e.getZodSchemaObj(f)}}},{});return ct(e,"models")({zodImport:Ts,modelsImports:s,includeNamespace:e.options.includeNamespaces,namespace:K({type:"models",tag:r,options:e.options}),tag:r,zodSchemasData:a})}o(Q_,"generateModels");function X_({resolver:e,data:t,tag:r=""}){var d;let n=(d=t.get(r))==null?void 0:d.endpoints;if(!n||n.length===0)return;let i=n.filter(xt),s=n.filter(Bs),a={...B_,bindings:[...i.length>0?[Tt.query]:[],...s.length>0?[Tt.mutation]:[],...i.length>0&&s.length>0?[Tt.queryClient]:[]]},c={bindings:[...i.length>0?[$p.query]:[],...s.length>0?[$p.mutation]:[]],from:mb(e.options)},u=n.reduce((m,g)=>[...m,...g.parameters],[]),l=vr({resolver:e,tag:r,zodSchemasAsTypes:Ne(u.map(m=>m.zodSchema).filter($e))}),f=ub({tag:r,endpoints:n,options:e.options});return ct(e,"queries")({queryImport:a,queryTypesImport:c,modelsImports:l,endpointsImports:f,includeNamespace:e.options.includeNamespaces,namespace:K({type:"queries",tag:r,options:e.options}),endpoints:n,queryEndpoints:i})}o(X_,"generateQueries");function e2(e){return ct(e,"app-rest-client")({appRestClientName:Yi,baseUrl:e.getBaseUrl()})}o(e2,"generateAppRestClient");function t2(e,t){let r=t.standalone&&t.importPath==="ts"?"relative":t.importPath,n={...Wi,...t,importPath:r},{resolver:i,data:s}=Zs(e,n),a=[],c=[],u=["models","endpoints","queries","acl"],l={models:Q_,endpoints:W_,queries:X_,acl:Z_};s.forEach((p,d)=>{n.excludeTags.find(g=>g.toLowerCase()===d.toLowerCase())||u.forEach(g=>{let y=l[g]({resolver:i,data:s,tag:d});if(y){let v=Po({output:n.output,fileName:fb({tag:d,type:g,options:n})});a.push({fileName:v,content:y}),g==="acl"&&c.push(d)}})});let f=K_(i,c);if(f){let p=Po({output:n.output,fileName:Hs(Fb)});a.push({fileName:p,content:f})}return n.standalone&&a.push(...dj(i)),a}o(t2,"generateCodeFromOpenAPIDoc");function dj(e){let t=[];return Object.values(Rs).forEach(r=>{let n=Hs(r);t.push({fileName:Po({output:e.options.output,fileName:n}),content:L_(n)})}),t.push({fileName:Po({output:e.options.output,fileName:Hs(Cs)}),content:e2(e)}),t}o(dj,"getStandaloneFiles");async function mj({input:e,options:t}){let r={...Wi,...t},n=await zf.default.bundle(e);return await Lb(n,r)}o(mj,"getGenerateMetadata");async function hj({input:e,options:t}){let r={...Wi,...t},n=await zf.default.bundle(e);return t2(n,r)}o(hj,"getGenerateFilesData");0&&(module.exports={getGenerateFilesData,getGenerateMetadata});
|