@povio/openapi-codegen-cli 0.11.0 → 0.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/sh.js CHANGED
@@ -137,7 +137,7 @@ ${y.join(`
137
137
  `:`
138
138
  `)+r,i=n+1,n=e.indexOf(`
139
139
  `,i)}while(n!==-1);return s+=e.slice(i),s}o(fb,"stringEncaseCRLFWithFirstIndex");var{stdout:pb,stderr:db}=ub,Cf=Symbol("GENERATOR"),mo=Symbol("STYLER"),Cs=Symbol("IS_EMPTY"),hb=["ansi","ansi","ansi256","ansi16m"],go=Object.create(null),V$=o((e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let r=pb?pb.level:0;e.level=t.level===void 0?r:t.level},"applyOptions"),Nf=class Nf{constructor(t){return mb(t)}};o(Nf,"Chalk");var Nc=Nf,mb=o(e=>{let t=o((...r)=>r.join(" "),"chalk");return V$(t,e),Object.setPrototypeOf(t,Ts.prototype),t},"chalkFactory");function Ts(e){return mb(e)}o(Ts,"createChalk");Object.setPrototypeOf(Ts.prototype,Function.prototype);for(let[e,t]of Object.entries(Er))go[e]={get(){let r=jc(this,Rf(t.open,t.close,this[mo]),this[Cs]);return Object.defineProperty(this,e,{value:r}),r}};go.visible={get(){let e=jc(this,this[mo],!0);return Object.defineProperty(this,"visible",{value:e}),e}};var Tf=o((e,t,r,...n)=>e==="rgb"?t==="ansi16m"?Er[r].ansi16m(...n):t==="ansi256"?Er[r].ansi256(Er.rgbToAnsi256(...n)):Er[r].ansi(Er.rgbToAnsi(...n)):e==="hex"?Tf("rgb",t,r,...Er.hexToRgb(...n)):Er[r][e](...n),"getModelAnsi"),U$=["rgb","hex","ansi256"];for(let e of U$){go[e]={get(){let{level:r}=this;return function(...n){let i=Rf(Tf(e,hb[r],"color",...n),Er.color.close,this[mo]);return jc(this,i,this[Cs])}}};let t="bg"+e[0].toUpperCase()+e.slice(1);go[t]={get(){let{level:r}=this;return function(...n){let i=Rf(Tf(e,hb[r],"bgColor",...n),Er.bgColor.close,this[mo]);return jc(this,i,this[Cs])}}}}var G$=Object.defineProperties(()=>{},{...go,level:{enumerable:!0,get(){return this[Cf].level},set(e){this[Cf].level=e}}}),Rf=o((e,t,r)=>{let n,i;return r===void 0?(n=e,i=t):(n=r.openAll+e,i=t+r.closeAll),{open:e,close:t,openAll:n,closeAll:i,parent:r}},"createStyler"),jc=o((e,t,r)=>{let n=o((...i)=>z$(n,i.length===1?""+i[0]:i.join(" ")),"builder");return Object.setPrototypeOf(n,G$),n[Cf]=e,n[mo]=t,n[Cs]=r,n},"createBuilder"),z$=o((e,t)=>{if(e.level<=0||!t)return e[Cs]?"":t;let r=e[mo];if(r===void 0)return t;let{openAll:n,closeAll:i}=r;if(t.includes("\x1B"))for(;r!==void 0;)t=lb(t,r.close,r.open),r=r.parent;let s=t.indexOf(`
140
- `);return s!==-1&&(t=fb(t,i,n,s)),n+t+i},"applyStyle");Object.defineProperties(Ts.prototype,go);var B6=Ts(),V6=Ts({level:db?db.level:0});var Hr=new Nc;function Rs(e,t,r){console.log(r!==void 0&&r!==t?`${Hr.yellow(`${e}:`.padEnd(20))}${Hr.magenta(t)}`:`${`${e}:`.padEnd(20)}${t}`)}o(Rs,"logVariable");function ur(e){console.log(`[INFO] ${e}`)}o(ur,"logInfo");function Cn(e){console.log(Hr.green(`[SUCCESS] ${e}`))}o(Cn,"logSuccess");function Ns(e,t){e instanceof Error?(console.log(Hr.red(`[ERROR] ${t||e.message}`)),process.env.VERBOSE&&console.error(e)):console.log(Hr.red(`[ERROR] ${e}`))}o(Ns,"logError");function Mc(e){console.log(Hr.bgYellow(`==== ${e} ====`))}o(Mc,"logBanner");var gb=mt(require("fs"));function yo(){return"0.11.0"}o(yo,"getVersion");var r7=mt(bb());var jf=Symbol("options_key");function Pe(e){return(t,r)=>{var n,i;if(e!=null){let s={...Reflect.getMetadata(jf,t)||{},[r]:{...e,describe:e.envAlias?`${e.describe||""} [${e.envAlias}]`:e.describe,type:e.type||((i=(n=Reflect.getMetadata("design:type",t,r))==null?void 0:n.name)==null?void 0:i.toLowerCase())}};Reflect.defineMetadata(jf,s,t)}}}o(Pe,"YargOption");function vb(e){let t=Reflect.getMetadata(jf,e.prototype);if(!t)throw new Error(`Options for ${e.name} were not defined`);return t}o(vb,"getYargsOption");function kc(e){return async t=>t.options(Z$(e)).middleware(async r=>await W$(e,r),!0)}o(kc,"getBuilder");function Z$(e){return Object.entries(vb(e)).reduce((t,[r,n])=>(t[r]=Object.fromEntries(Object.entries(n).filter(([i])=>!["envAlias","default"].includes(i))),t),{})}o(Z$,"getYargsOptions");async function W$(e,t){let r=new e;for(let[n,i]of Object.entries(vb(e)))r[n]=t[n]??i.default;return r}o(W$,"loadYargsConfig");var vx=mt(Pm());var WO={100:"Continue",101:"Switching Protocols",102:"Processing",103:"Early Hints",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",300:"Ambiguous",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",418:"I Am a Teapot",421:"Misdirected Request",422:"Unprocessable Entity",424:"Failed Dependency",428:"Precondition Required",429:"Too Many Requests",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported"},KO={"invalid-schema":"Invalid OpenAPI Schemas","invalid-operation-id":"Invalid Operation IDs","missing-path-parameter":"Missing Path Parameters","not-allowed-inline-enum":"Not Allowed Inline Enums","not-allowed-circular-schema":"Not Allowed Circular Schemas","missing-acl-condition-property":"Missing x-acl Condition Properties","missing-status-code":"Missing HTTP Status Codes","invalid-status-code":"Invalid HTTP Status Codes","multiple-success-status-codes":"Multiple Success HTTP Status Codes"};var jr={query:"useQuery",infiniteQuery:"useInfiniteQuery",mutation:"useMutation"},YO={bindings:[jr.query,jr.infiniteQuery,jr.mutation],from:"@tanstack/react-query"},Pa={pageParamName:"page"},Bu={pageParamName:"page",totalItemsName:"totalItems",limitParamName:"limit"},xa="moduleName";var xm={"Content-Type":"application/json",Accept:"application/json"},Vu="data",$m="axios",Zn="config",Jr="AxiosRequestConfig",Uu={defaultImport:$m,bindings:[Jr],from:"axios"};var QO=o(e=>/^(?:[a-zA-Z_$][a-zA-Z0-9_$]*|[0-9]+)$/.test(e),"isValidPropertyName"),Wn=o(e=>e.replace(/^[^a-zA-Z_$]*/g,"").replace(/[^a-zA-Z0-9_$]+(\w)?/g,(t,r)=>(r==null?void 0:r.toUpperCase())??""),"invalidVariableNameCharactersToCamel");function xe(e){return e!=null&&Object.prototype.hasOwnProperty.call(e,"$ref")}o(xe,"isReferenceObject");function Ct(e){return!xe(e)}o(Ct,"isSchemaObject");function Gu(e){return e.type==="array"}o(Gu,"isArraySchemaObject");function JO(e){if(!e.allOf)throw new Error("Function inferRequiredSchema is specialized to handle item with required only in an allOf array.");let[t,r]=e.allOf.reduce((i,s)=>{if(Vq(s)){let a=s.required;i[0].push(...a??[])}else i[1].push(s);return i},[[],[]]),n={properties:t.reduce((i,s)=>(i[s]={},i),{}),type:"object",required:t};return{noRequiredOnlyAllof:r,composedRequiredSchema:n,patchRequiredSchemaInLoop:o((i,s)=>{if(xe(i)){let a=s(i.$ref);a&&n.required.forEach(c=>{var u;n.properties[c]=((u=a==null?void 0:a.properties)==null?void 0:u[c])??{}})}else{let a=i.properties??{};n.required.forEach(c=>{a[c]&&(n.properties[c]=a[c]??{})})}},"patchRequiredSchemaInLoop")}}o(JO,"inferRequiredSchema");var Vq=o(e=>!xe(e)&&!!e.required&&!e.type&&!e.properties&&!(e!=null&&e.allOf)&&!(e!=null&&e.anyOf)&&!e.oneOf,"isBrokenAllOfItem");var gn=Symbol.for("@ts-pattern/matcher"),Uq=Symbol.for("@ts-pattern/isVariadic"),Zu="@ts-pattern/anonymous-select-key",wm=o(e=>!!(e&&typeof e=="object"),"r"),zu=o(e=>e&&!!e[gn],"i"),tn=o((e,t,r)=>{if(zu(e)){let n=e[gn](),{matched:i,selections:s}=n.match(t);return i&&s&&Object.keys(s).forEach(a=>r(a,s[a])),i}if(wm(e)){if(!wm(t))return!1;if(Array.isArray(e)){if(!Array.isArray(t))return!1;let n=[],i=[],s=[];for(let a of e.keys()){let c=e[a];zu(c)&&c[Uq]?s.push(c):s.length?i.push(c):n.push(c)}if(s.length){if(s.length>1)throw new Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");if(t.length<n.length+i.length)return!1;let a=t.slice(0,n.length),c=i.length===0?[]:t.slice(-i.length),u=t.slice(n.length,i.length===0?1/0:-i.length);return n.every((l,p)=>tn(l,a[p],r))&&i.every((l,p)=>tn(l,c[p],r))&&(s.length===0||tn(s[0],u,r))}return e.length===t.length&&e.every((a,c)=>tn(a,t[c],r))}return Reflect.ownKeys(e).every(n=>{let i=e[n];return(n in t||zu(s=i)&&s[gn]().matcherType==="optional")&&tn(i,t[n],r);var s})}return Object.is(t,e)},"s"),Xn=o(e=>{var t,r,n;return wm(e)?zu(e)?(t=(r=(n=e[gn]()).getSelectionKeys)==null?void 0:r.call(n))!=null?t:[]:Array.isArray(e)?wa(e,Xn):wa(Object.values(e),Xn):[]},"o"),wa=o((e,t)=>e.reduce((r,n)=>r.concat(t(n)),[]),"c");function mr(e){return Object.assign(e,{optional:o(()=>Gq(e),"optional"),and:o(t=>Ve(e,t),"and"),or:o(t=>zq(e,t),"or"),select:o(t=>t===void 0?XO(e):XO(t,e),"select")})}o(mr,"u");function Gq(e){return mr({[gn]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return t===void 0?(Xn(e).forEach(i=>n(i,void 0)),{matched:!0,selections:r}):{matched:tn(e,t,n),selections:r}},"match"),getSelectionKeys:o(()=>Xn(e),"getSelectionKeys"),matcherType:"optional"})})}o(Gq,"h");function Ve(...e){return mr({[gn]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return{matched:e.every(i=>tn(i,t,n)),selections:r}},"match"),getSelectionKeys:o(()=>wa(e,Xn),"getSelectionKeys"),matcherType:"and"})})}o(Ve,"m");function zq(...e){return mr({[gn]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return wa(e,Xn).forEach(i=>n(i,void 0)),{matched:e.some(i=>tn(i,t,n)),selections:r}},"match"),getSelectionKeys:o(()=>wa(e,Xn),"getSelectionKeys"),matcherType:"or"})})}o(zq,"d");function Ee(e){return{[gn]:()=>({match:o(t=>({matched:!!e(t)}),"match")})}}o(Ee,"p");function XO(...e){let t=typeof e[0]=="string"?e[0]:void 0,r=e.length===2?e[1]:typeof e[0]=="string"?void 0:e[0];return mr({[gn]:()=>({match:o(n=>{let i={[t??Zu]:n};return{matched:r===void 0||tn(r,n,(s,a)=>{i[s]=a}),selections:i}},"match"),getSelectionKeys:o(()=>[t??Zu].concat(r===void 0?[]:Xn(r)),"getSelectionKeys")})})}o(XO,"y");function Xr(e){return typeof e=="number"}o(Xr,"v");function Kn(e){return typeof e=="string"}o(Kn,"b");function Yn(e){return typeof e=="bigint"}o(Yn,"w");var _U=mr(Ee(function(e){return!0}));var Qn=o(e=>Object.assign(mr(e),{startsWith:o(t=>{return Qn(Ve(e,(r=t,Ee(n=>Kn(n)&&n.startsWith(r)))));var r},"startsWith"),endsWith:o(t=>{return Qn(Ve(e,(r=t,Ee(n=>Kn(n)&&n.endsWith(r)))));var r},"endsWith"),minLength:o(t=>Qn(Ve(e,(r=>Ee(n=>Kn(n)&&n.length>=r))(t))),"minLength"),length:o(t=>Qn(Ve(e,(r=>Ee(n=>Kn(n)&&n.length===r))(t))),"length"),maxLength:o(t=>Qn(Ve(e,(r=>Ee(n=>Kn(n)&&n.length<=r))(t))),"maxLength"),includes:o(t=>{return Qn(Ve(e,(r=t,Ee(n=>Kn(n)&&n.includes(r)))));var r},"includes"),regex:o(t=>{return Qn(Ve(e,(r=t,Ee(n=>Kn(n)&&!!n.match(r)))));var r},"regex")}),"j"),SU=Qn(Ee(Kn)),en=o(e=>Object.assign(mr(e),{between:o((t,r)=>en(Ve(e,((n,i)=>Ee(s=>Xr(s)&&n<=s&&i>=s))(t,r))),"between"),lt:o(t=>en(Ve(e,(r=>Ee(n=>Xr(n)&&n<r))(t))),"lt"),gt:o(t=>en(Ve(e,(r=>Ee(n=>Xr(n)&&n>r))(t))),"gt"),lte:o(t=>en(Ve(e,(r=>Ee(n=>Xr(n)&&n<=r))(t))),"lte"),gte:o(t=>en(Ve(e,(r=>Ee(n=>Xr(n)&&n>=r))(t))),"gte"),int:o(()=>en(Ve(e,Ee(t=>Xr(t)&&Number.isInteger(t)))),"int"),finite:o(()=>en(Ve(e,Ee(t=>Xr(t)&&Number.isFinite(t)))),"finite"),positive:o(()=>en(Ve(e,Ee(t=>Xr(t)&&t>0))),"positive"),negative:o(()=>en(Ve(e,Ee(t=>Xr(t)&&t<0))),"negative")}),"x"),EU=en(Ee(Xr)),Jn=o(e=>Object.assign(mr(e),{between:o((t,r)=>Jn(Ve(e,((n,i)=>Ee(s=>Yn(s)&&n<=s&&i>=s))(t,r))),"between"),lt:o(t=>Jn(Ve(e,(r=>Ee(n=>Yn(n)&&n<r))(t))),"lt"),gt:o(t=>Jn(Ve(e,(r=>Ee(n=>Yn(n)&&n>r))(t))),"gt"),lte:o(t=>Jn(Ve(e,(r=>Ee(n=>Yn(n)&&n<=r))(t))),"lte"),gte:o(t=>Jn(Ve(e,(r=>Ee(n=>Yn(n)&&n>=r))(t))),"gte"),positive:o(()=>Jn(Ve(e,Ee(t=>Yn(t)&&t>0))),"positive"),negative:o(()=>Jn(Ve(e,Ee(t=>Yn(t)&&t<0))),"negative")}),"A"),OU=Jn(Ee(Yn)),PU=mr(Ee(function(e){return typeof e=="boolean"})),xU=mr(Ee(function(e){return typeof e=="symbol"})),$U=mr(Ee(function(e){return e==null})),wU=mr(Ee(function(e){return e!=null}));var Tm=class Tm extends Error{constructor(t){let r;try{r=JSON.stringify(t)}catch{r=t}super(`Pattern matching error: no pattern matches value ${r}`),this.input=void 0,this.input=t}};o(Tm,"W");var Am=Tm,Im={matched:!1,value:void 0};function Pt(e){return new Cm(e,Im)}o(Pt,"z");var $a=class $a{constructor(t,r){this.input=void 0,this.state=void 0,this.input=t,this.state=r}with(...t){if(this.state.matched)return this;let r=t[t.length-1],n=[t[0]],i;t.length===3&&typeof t[1]=="function"?i=t[1]:t.length>2&&n.push(...t.slice(1,t.length-1));let s=!1,a={},c=o((l,p)=>{s=!0,a[l]=p},"a"),u=!n.some(l=>tn(l,this.input,c))||i&&!i(this.input)?Im:{matched:!0,value:r(s?Zu in a?a[Zu]:a:this.input,this.input)};return new $a(this.input,u)}when(t,r){if(this.state.matched)return this;let n=!!t(this.input);return new $a(this.input,n?{matched:!0,value:r(this.input,this.input)}:Im)}otherwise(t){return this.state.matched?this.state.value:t(this.input)}exhaustive(){if(this.state.matched)return this.state.value;throw new Am(this.input)}run(){return this.exhaustive()}returnType(){return this}};o($a,"I");var Cm=$a;var Rm=2,eP=["application/octet-stream","multipart/form-data","application/x-www-form-urlencoded","*/*"],tP=["query","header","path"],Vi=["get","put","post","delete","options","head","patch","trace"],rP=["string","number","integer","boolean"],Aa=["allOf","anyOf","oneOf"];var Le=o(e=>e.charAt(0).toUpperCase()+e.slice(1),"capitalize"),ei=o(e=>e.charAt(0).toLowerCase()+e.slice(1),"decapitalize"),nP=o(e=>e.replace(/(-\w)/g,t=>t[1].toUpperCase()),"kebabToCamel"),pt=o(e=>e.replace(/(_\w)/g,t=>t[1].toUpperCase()),"snakeToCamel"),iP=o(e=>e.replace(/[\W_]+(\w)?/g,(t,r)=>(r==null?void 0:r.toUpperCase())??""),"nonWordCharactersToCamel"),Nm=o((e,t="")=>e.endsWith(t)?e:`${e}${t}`,"suffixIfNeeded"),oP=o((e,t)=>e.replace(new RegExp(`${t}$`),""),"removeSuffix"),Zq=o(e=>{var n;let t=e.reduce((i,s)=>({...i,[s]:(i[s]??0)+1}),{});return(n=Object.entries(t).sort((i,s)=>i[1]===s[1]?s[0].length-i[0].length:s[1]-i[1])[0])==null?void 0:n[0]},"getLongestMostCommon"),jm=o(e=>{let t=e.map(Le).map(sP).map(r=>Wq(r)).flat();return Zq(t)},"getMostCommonAdjacentCombinationSplit"),sP=o(e=>e.split(/(?<![A-Z])(?=[A-Z])/).filter(Boolean),"splitByUppercase"),aP=o(e=>sP(e).join(" "),"camelToSpaceSeparated"),Wq=o((e,t=["dto","by","for","of","in","to","and","with"])=>{var n;let r=[];for(let i=0;i<e.length;i++)if(!t.includes(e[i].toLowerCase()))for(let s=i+1;s<=e.length;s++)t.includes((n=e[s-1])==null?void 0:n.toLowerCase())||r.push(e.slice(i,s).join(""));return r},"getAdjacentStringCombinations"),cP=o((e,t)=>{let r=t.replace(/es$|s$/g,""),n=new RegExp(`(${ei(r)}|${Le(r)})[a-z]*(?=$|[A-Z])`,"g");return e.replace(n,"")},"removeWord"),uP=o(e=>e!==void 0,"isString");var fP=o(e=>`#/components/schemas/${e}`,"getSchemaRef"),Ui=o(e=>e[1]==="/"?e:"#/"+e.slice(1),"autocorrectRef"),rs=o(e=>Ui(e).split("/").at(-1),"getSchemaNameByRef");function km(e){let t=Kq(e).normalize("NFKD").trim().replace(/\s+/g,"_").replace(/--+/g,"-").replace(/-+/g,"_").replace(/[^\w-]+/g,"_");return pt(t)}o(km,"normalizeString");function pP(e){return/^[a-zA-Z]\w*$/.test(e)?e:`"${e}"`}o(pP,"wrapWithQuotesIfNeeded");function dP(e){return typeof e=="string"&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}o(dP,"unwrapQuotesIfNeeded");function Kq(e){let t=Number(e[0]);return typeof t=="number"&&!Number.isNaN(t)?"_"+e:e}o(Kq,"prefixStringStartingWithNumberIfNeeded");function qm(e){let t=e.replaceAll("_","#");return pt(t.replaceAll("-","_")).replaceAll("#","_")}o(qm,"pathParamToVariableName");var Gi=o(e=>rP.includes(e),"isPrimitiveType");function hP(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(hP,"escapeControlCharacters");function rn(e){return e.includes("application/")&&e.includes("json")||eP.includes(e)||e.includes("text/")}o(rn,"isParamMediaTypeAllowed");function Ia(e){return e>=200&&e<300}o(Ia,"isMainResponseStatus");function Wu(e){return!(e>=200&&e<300)}o(Wu,"isErrorStatus");function Ku(e){return e.startsWith("application/")}o(Ku,"isMediaTypeAllowed");var lP=/({\w+})/g,Yq=/[^\w\-]+/g;function mP(e){e=Le(nP(e.replaceAll("/","-")).replaceAll("-",""));let t=[...e.matchAll(lP)];if(t.length>0){let r=t.sort((n,i)=>n.index-i.index)[t.length-1][0];e=`${e.replace(lP,"")}By${Le(r.slice(1,-1))}`}return e.replace(Yq,"_")}o(mP,"pathToVariableName");var Mm=/{(\b\w+(?:-\w+)*\b)}/g;function gP(e){let t=e.match(Mm);return t===null?e.replaceAll(Mm,":$1"):(t.forEach(r=>{let n=qm(r.replaceAll(Mm,":$1"));e=e.replaceAll(r,n)}),e)}o(gP,"replaceHyphenatedPath");var yP=o(e=>{let t=e["x-enumNames"],r=Array.isArray(t)&&t.length>0,n=!!e.schema&&Ct(e.schema)&&e.schema.type==="string";return r&&n},"isSortingParameterObject"),zi=o((e,t)=>t.excludePathRegex?new RegExp(t.excludePathRegex).test(e):!1,"isPathExcluded");var Qt=o(e=>e.method==="get","isQuery"),ti=o(e=>e.method!=="get"||!!e.mediaDownload,"isMutation"),ns=o((e,t)=>Qt(e)&&(t??Object.values(Pa)).every(r=>e.parameters.some(n=>n.name===r&&n.type==="Query")),"isInfiniteQuery");function ri(e){return iP(e)}o(ri,"formatTag");function ni(e,t){var n;let r=(n=e.tags)==null?void 0:n[0];return ri(r??t.defaultTag)}o(ni,"getOperationTag");function bP(e,t){return t.excludeTags.some(r=>r.toLowerCase()===e.toLowerCase())}o(bP,"isTagExcluded");var Jt=o((...e)=>[...new Set(e.flat())],"getUniqueArray");function Tt(e,t){if(!e)return;let{data:r,onSchema:n}=t;if(xe(e)&&n({type:"reference",schema:e,data:r})===!0)return;let i=e;if(Aa.some(s=>s in i&&i[s])){let s=i.allOf??i.anyOf??i.oneOf??[];for(let a of s)(n==null?void 0:n({type:"composite",parentSchema:e,schema:a,data:r}))!==!0&&Tt(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&&Tt(a,t);if(i.additionalProperties&&typeof i.additionalProperties=="object"){if(n({type:"additionalProperties",parentSchema:e,schema:i.additionalProperties,data:r})===!0)return;Tt(i.additionalProperties,t)}if(i.type==="array"){let s=e.items;if(n({type:"array",parentSchema:e,schema:s,data:r})===!0)return;Tt(s,t)}}o(Tt,"iterateSchema");var nn=o((e,t)=>Nm(Le(km(e)),t),"getZodSchemaName"),Ca=o((e,t,r)=>Nm(Le(km(e)),`${t}${r}`),"getEnumZodSchemaName"),Ht=o(e=>!e.startsWith("z."),"isNamedZodSchema"),vP=o(e=>e.startsWith(Is),"isEnumZodSchema"),Zi=o((e,t,r)=>t?e:`${r}_${e}`,"getZodSchemaOperationName"),Yu=o(e=>pt(`${e}_${eb}`),"getBodyZodSchemaName"),_P=o((e,t)=>pt(`${e}_${t}${tb}`),"getParamZodSchemaName"),Qq=o(e=>pt(`${e}${rb}`),"getMainResponseZodSchemaName"),Jq=o((e,t)=>pt(`${e}_${t}_${nb}`),"getErrorResponseZodSchemaName");function Qu({statusCode:e,operationName:t,isUniqueOperationName:r,tag:n}){let i=Number(e),s=Zi(t,r,n);return!Ia(i)&&e!=="default"&&Wu(i)?Jq(s,e):Qq(s)}o(Qu,"getResponseZodSchemaName");function Ta(e){return["minimum","exclusiveMinimum","maximum","exclusiveMaximum","minItems","minLength","minProperties","maxItems","maxLength","maxProperties","default","example"].filter(n=>e[n]).reduce((n,i)=>[...n,`${Le(aP(i))}: \`${e[i]}\``],[])}o(Ta,"getSchemaDescriptions");var Ra=o((e,t)=>oP(e,t.schemaSuffix),"getZodSchemaInferedTypeName"),SP=o((e,t)=>Ht(t)?`${e.options.tsNamespaces?`${Ge({type:"models",tag:e.getTagByZodSchemaName(t),options:e.options})}.`:""}${t}`:t,"getImportedZodSchemaName"),Wi=o((e,t,r)=>{if(!Ht(t))return t===As?"void":t;let n=e.getTagByZodSchemaName(t);return`${e.options.tsNamespaces&&n!==r?`${Ge({type:"models",tag:n,options:e.options})}.`:""}${Ra(t,e.options)}`},"getImportedZodSchemaInferedTypeName");function EP(e){var t;return e.isEnum?"enum":((t=e.schemaObj)==null?void 0:t.type)??"object"}o(EP,"getZodSchemaType");function OP(e){if(e.schemaObj)return[e.schemaObj.description,...Ta(e.schemaObj).join(". ")].filter(Boolean)}o(OP,"getZodSchemaDescription");function PP(e,t,r){var n;if(xe(t)){let i=e.getZodSchemaNameByRef(t.$ref);return i?Wi(e,i,r):void 0}if(Gu(t)){if(!xe(t.items))return`${((n=t.items)==null?void 0:n.type)??"unknown"}[]`;let i=e.getZodSchemaNameByRef(t.items.$ref);return i?`${Wi(e,i,r)}[]`:void 0}if(Aa.some(i=>i in t&&t[i])){let i=t.allOf??t.anyOf??t.oneOf??[];if(i.length>0)return PP(e,i[0],r)}return t.type}o(PP,"getType");function xP(e,t,r){if(!t.schemaObj)return[];let n="[0]",i="[key]",s={},a=o(c=>{var l;if(c.type==="reference")return!0;if(c.type==="composite")return;let u=[...((l=c.data)==null?void 0:l.pathSegments)??[]];if(c.type==="array"?u.push(n):c.type==="property"?u.push(c.propertyName):c.type==="additionalProperties"&&u.push(i),c.schema&&u[u.length-1]!==n){let p=e.resolveObject(c.schema),f=[p.description,...Ta(p)].filter(Boolean),d=u.join(".");s[d]&&"type"in c.schema&&c.schema.type==="object"||(delete s[d],s[d]={type:PP(e,c.schema,r)??"unknown",description:f.join(". ")})}return Tt(c.schema,{data:{pathSegments:[...u]},onSchema:a}),!0},"onSchema");return"allOf"in t.schemaObj&&t.schemaObj.allOf&&t.schemaObj.allOf.forEach(c=>{if(xe(c)){let u=e.resolveObject(c);Tt(u,{data:{pathSegments:[]},onSchema:a})}}),Tt(t.schemaObj,{data:{pathSegments:[]},onSchema:a}),s}o(xP,"getZodSchemaPropertyDescriptions");function ii({resolver:e,tag:t,zodSchemas:r=[],zodSchemasAsTypes:n=[]}){let i="models",s=o(u=>e.getTagByZodSchemaName(u),"getTag"),a=Dm({type:i,tag:t,entities:r,getTag:s,getEntityName:o(u=>u,"getEntityName"),options:e.options}),c=Dm({type:i,tag:t,entities:n,getTag:s,getEntityName:o(u=>Ra(u,e.options),"getEntityName"),options:e.options});return Xq(e.options,a,c)}o(ii,"getModelsImports");function $P({tag:e,endpoints:t,options:r}){return Dm({type:"endpoints",tag:e,entities:t,getTag:o(n=>ja(n,r),"getTag"),getEntityName:Na,options:r})}o($P,"getEndpointsImports");function wP({tags:e,entityName:t,getAliasEntityName:r,type:n,options:i}){let s=new Map;return e.forEach(a=>{let c=`${t}${r?` as ${r(a)}`:""}`;s.has(a)?i.tsNamespaces||s.get(a).bindings.push(c):s.set(a,{bindings:[i.tsNamespaces?Ge({type:n,tag:a,options:i}):c],from:`${oi(i)}${Ju({type:n,tag:a,includeTagDir:!0,options:i})}`})}),Array.from(s.values())}o(wP,"getEntityImports");function oi(e){let t=wf;return e.importPath==="relative"?t="../":e.importPath==="absolute"?t=e.output:new RegExp(`${$f}`,"g").test(e.output)&&(t=e.output.replace(new RegExp(`.*${$f}`,"g"),wf)),`${t}/`.replace(/\/\//g,"/")}o(oi,"getImportPath");function Dm({type:e="models",tag:t,entities:r,getTag:n,getEntityName:i,options:s}){let a=new Map;return r.forEach(c=>{let u=n(c);if(a.has(u))s.tsNamespaces||a.get(u).bindings.push(i(c));else{let l=t===u;a.set(u,{bindings:[s.tsNamespaces?Ge({type:e,tag:u,options:s}):i(c)],from:`${l?"./":oi(s)}${Ju({type:e,tag:u,includeTagDir:!l,options:s})}`})}}),Array.from(a.values())}o(Dm,"getImports");function Xq(e,...t){let r=new Map;return t.forEach(n=>{n.forEach(i=>{r.has(i.from)?e.tsNamespaces||r.get(i.from).bindings.push(...i.bindings):r.set(i.from,i)})}),Array.from(r.values()).map(n=>({...n,bindings:Jt(n.bindings)}))}o(Xq,"mergeImports");function is({fileName:e,extension:t}){return`${e}.${t}`}o(is,"getFileNameWithExtension");function AP({type:e,tag:t,options:r,includeTagDir:n=!0}){let i=r.configs[e].outputFileNameSuffix;return t?`${n?`${ei(t)}/`:""}${ei(t)}.${i}`:i}o(AP,"getTagFileNameWithoutExtension");function Ju(...e){return AP(...e)}o(Ju,"getTagImportPath");function Xu(...e){return`${AP(...e)}.ts`}o(Xu,"getTagFileName");var Ge=o(({type:e,tag:t,options:r})=>`${Le(t)}${r.configs[e].namespaceSuffix}`,"getNamespaceName");function IP(e){return e.standalone?`${oi(e)}${xc.fileName}`:e.restClientImportPath}o(IP,"getAppRestClientImportPath");function CP(e){return e.standalone?`${oi(e)}${Pc.reactQueryTypes.fileName}`:e.queryTypesImportPath}o(CP,"getQueryTypesImportPath");function TP(e){return`${oi(e)}${$c.fileName}`}o(TP,"getQueryModulesImportPath");function RP(e){return`${oi(e)}${wc.fileName}`}o(RP,"getMutationEffectsImportPath");function NP(e){return`${oi(e)}${Ac.fileName}`}o(NP,"getZodExtendedImportPath");function jP(e){return Pt(e).with("string",()=>"string").with("number",()=>"number").with("integer",()=>"number").with("boolean",()=>"boolean").exhaustive()}o(jP,"primitiveTypeToTsType");var Na=o(e=>ei(pt(e.operationName)),"getEndpointName");function MP(e,t){return`${t.tsNamespaces?`${Ge({type:"endpoints",tag:ja(e,t),options:t})}.`:""}${Na(e)}`}o(MP,"getImportedEndpointName");var kP=o(e=>e.path.replace(/:([a-zA-Z0-9_]+)/g,"${$1}"),"getEndpointPath");function ja(e,t){var n;let r=t.splitByTags?(n=e.tags)==null?void 0:n[0]:t.defaultTag;return ri(r??t.defaultTag)}o(ja,"getEndpointTag");function Ma(e,t,r){let n=t.parameters.map(i=>{var a,c,u,l;let s="string";if(Ht(i.zodSchema))s=Wi(e,i.zodSchema);else if((a=i.parameterObject)!=null&&a.schema&&Ct(i.parameterObject.schema)){let p=(u=(c=i.parameterObject)==null?void 0:c.schema)==null?void 0:u.type;p&&Gi(p)&&(s=jP(p))}return{name:Wn(i.name),type:s,paramType:i.type,required:((l=i.parameterObject)==null?void 0:l.required)??!0,parameterObject:i.parameterObject,bodyObject:i.bodyObject}});return r!=null&&r.includeFileParam&&t.mediaUpload&&n.push({name:"file",type:"File",paramType:"Body",required:!0,parameterObject:void 0,bodyObject:void 0}),n.sort((i,s)=>{if(i.required===s.required){let a=["Path","Body","Query","Header"];return a.indexOf(i.paramType)-a.indexOf(s.paramType)}return i.required?-1:1}).filter(i=>(!(r!=null&&r.excludeBodyParam)||i.name!==Vu)&&(!(r!=null&&r.excludePageParam)||i.name!==Pa.pageParamName)&&(!(r!=null&&r.includeOnlyRequiredParams)||i.required)).map(i=>({...i,name:r!=null&&r.replacePageParam&&i.name===Pa.pageParamName?"pageParam":i.name}))}o(Ma,"mapEndpointParamsToFunctionParams");function qP(e){let t=e.parameters.filter(i=>i.type==="Query").map(i=>{let s=QO(i.name)?i.name:`"${i.name}"`,a=Wn(i.name);return{...i,name:s,value:a}}),r={};return e.requestFormat!==xm["Content-Type"]&&(r["Content-Type"]=`'${e.requestFormat}'`),e.responseFormat&&e.responseFormat!==xm.Accept&&(r.Accept=`'${e.responseFormat}'`),e.parameters.filter(i=>i.type==="Header").forEach(i=>{r[i.name]=Wn(i.name)}),{...t.length>0?{params:t}:{},...Object.keys(r).length?{headers:r}:{}}}o(qP,"getEndpointConfig");function DP(e,t){return t.filter(r=>Qt(r)&&r.parameters.filter(n=>{var i;return(i=n.parameterObject)==null?void 0:i.required}).every(n=>e.parameters.some(i=>i.name===n.name))&&r.response===e.response)}o(DP,"getUpdateQueryEndpoints");var Lm=["break","case","catch","class","const","continue","debugger","default","delete","do","else","export","extends","false","finally","for","function","if","import","in","instanceof","new","null","return","super","switch","this","throw","true","try","typeof","var","void","while","with"];function Ki(e,t){let r={};return Object.keys(e).forEach(n=>{t.includes(n)&&(r[n]=e[n])}),r}o(Ki,"pick");function os(e,t){let r=e.deprecated&&!t.withDeprecatedEndpoints,n=ni(e,t),i=bP(n,t);return r||i}o(os,"isOperationExcluded");function Fm({path:e,method:t,operation:r,options:n,tag:i,keepOperationTag:s,keepOperationPrefix:a}){let c=`${t}${mP(e)}`,u=r.operationId?Wn(r.operationId):c;if(n.removeOperationPrefixEndingWith&&a)u=u.split(n.removeOperationPrefixEndingWith).map((p,f)=>f===0?p:Le(p)).join("");else if(n.removeOperationPrefixEndingWith&&!a){let l=new RegExp(`^.*${n.removeOperationPrefixEndingWith}`);u=u.replace(l,"")}if(n.tsNamespaces&&!s){let l=cP(u,i);Lm.includes(l)||(u=l)}return Lm.includes(u)?c:u}o(Fm,"getOperationName");function ka({operationsByTag:e,...t}){let{operation:r,options:n}=t,i=n.splitByTags?ni(r,n):n.defaultTag,s=o(a=>{let c=Fm({...t,tag:i,keepOperationTag:a});if(e[i].filter(l=>Fm({...t,operation:l,tag:i,keepOperationTag:a})===c).length===1)return c},"operationName");return s()??s(!0)??Fm({...t,tag:i,keepOperationTag:!0,keepOperationPrefix:!0})}o(ka,"getUniqueOperationName");function LP(e,t,r){let n=[];for(let i in e.paths){if(zi(i,r))continue;let s=e.paths[i],a=Ki(s,Vi);for(let c in a){let u=a[c];if(!u||os(u,r))continue;let l=ka({path:i,method:c,operation:u,operationsByTag:t,options:r});n.push(l)}}return n}o(LP,"getUniqueOperationNamesWithoutSplitByTags");function FP(e,t){let r={};for(let n in e.paths){if(zi(n,t))continue;let i=e.paths[n],s=Ki(i,Vi);for(let a in s){let c=s[a];if(!c||os(c,t))continue;let u=t.splitByTags?ni(c,t):t.defaultTag;r[u]||(r[u]=[]),r[u].push(c)}}return r}o(FP,"getOperationsByTag");function qa(e){return{type:"invalid-schema",message:e}}o(qa,"getInvalidSchemaError");function HP(e){return{type:"invalid-operation-id",message:`Operation ${e}`}}o(HP,"getInvalidOperationIdError");function BP(e,t){return{type:"missing-path-parameter",message:`Path ${t} is missing [${e.map(({name:r})=>r).join(", ")}]`}}o(BP,"getMissingPathParameterError");function VP(e){return{type:"not-allowed-inline-enum",message:`${e} is missing @IsEnum() and @ApiProperty(enum:, enumName:)`}}o(VP,"getNotAllowedInlineEnumError");function UP(e){return{type:"not-allowed-circular-schema",message:e}}o(UP,"getNotAllowedCircularSchemaError");function GP(e,t,r){return{type:"missing-acl-condition-property",message:`Condition property ${e} is not found in parameters or body in operation ${tl(t,r)}`}}o(GP,"getMissingAclConditionPropertyError");function Hm(e,t,r){return{type:"missing-status-code",message:`Missing HTTP status code ${el(e)} in operation ${tl(t,r)}`}}o(Hm,"getMissingStatusCodeError");function zP(e,t,r){return{type:"invalid-status-code",message:`Operation ${tl(t,r)} expected HTTP status code ${el(e.expected)} but received ${el(e.received)}`}}o(zP,"getInvalidStatusCodeError");function ZP(e,t,r){return{type:"multiple-success-status-codes",message:`Operation ${tl(t,r)} has multiple success HTTP status codes: ${e.map(el).join(", ")}`}}o(ZP,"getMultipleSuccessStatusCodesError");function tl(e,t){return e.operationId??`${t.method} ${t.path}`}o(tl,"getOperationDescriptor");function el(e){return`${e} (${WO[e]})`}o(el,"getStatusCodeDescription");function WP(e){return e.reduce((t,r)=>({...t,[r.type]:[...t[r.type]??[],r.message]}),{})}o(WP,"groupByType");function on({schema:e,meta:t,options:r}){let n=[];Pt(e.type).with("string",()=>n.push(rD(e))).with("number","integer",()=>n.push(iD(e))).with("array",()=>n.push(oD(e))).otherwise(()=>{}),typeof e.description=="string"&&e.description!==""&&r.withDescription&&([`
140
+ `);return s!==-1&&(t=fb(t,i,n,s)),n+t+i},"applyStyle");Object.defineProperties(Ts.prototype,go);var B6=Ts(),V6=Ts({level:db?db.level:0});var Hr=new Nc;function Rs(e,t,r){console.log(r!==void 0&&r!==t?`${Hr.yellow(`${e}:`.padEnd(20))}${Hr.magenta(t)}`:`${`${e}:`.padEnd(20)}${t}`)}o(Rs,"logVariable");function ur(e){console.log(`[INFO] ${e}`)}o(ur,"logInfo");function Cn(e){console.log(Hr.green(`[SUCCESS] ${e}`))}o(Cn,"logSuccess");function Ns(e,t){e instanceof Error?(console.log(Hr.red(`[ERROR] ${t||e.message}`)),process.env.VERBOSE&&console.error(e)):console.log(Hr.red(`[ERROR] ${e}`))}o(Ns,"logError");function Mc(e){console.log(Hr.bgYellow(`==== ${e} ====`))}o(Mc,"logBanner");var gb=mt(require("fs"));function yo(){return"0.11.1"}o(yo,"getVersion");var r7=mt(bb());var jf=Symbol("options_key");function Pe(e){return(t,r)=>{var n,i;if(e!=null){let s={...Reflect.getMetadata(jf,t)||{},[r]:{...e,describe:e.envAlias?`${e.describe||""} [${e.envAlias}]`:e.describe,type:e.type||((i=(n=Reflect.getMetadata("design:type",t,r))==null?void 0:n.name)==null?void 0:i.toLowerCase())}};Reflect.defineMetadata(jf,s,t)}}}o(Pe,"YargOption");function vb(e){let t=Reflect.getMetadata(jf,e.prototype);if(!t)throw new Error(`Options for ${e.name} were not defined`);return t}o(vb,"getYargsOption");function kc(e){return async t=>t.options(Z$(e)).middleware(async r=>await W$(e,r),!0)}o(kc,"getBuilder");function Z$(e){return Object.entries(vb(e)).reduce((t,[r,n])=>(t[r]=Object.fromEntries(Object.entries(n).filter(([i])=>!["envAlias","default"].includes(i))),t),{})}o(Z$,"getYargsOptions");async function W$(e,t){let r=new e;for(let[n,i]of Object.entries(vb(e)))r[n]=t[n]??i.default;return r}o(W$,"loadYargsConfig");var vx=mt(Pm());var WO={100:"Continue",101:"Switching Protocols",102:"Processing",103:"Early Hints",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",300:"Ambiguous",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",418:"I Am a Teapot",421:"Misdirected Request",422:"Unprocessable Entity",424:"Failed Dependency",428:"Precondition Required",429:"Too Many Requests",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported"},KO={"invalid-schema":"Invalid OpenAPI Schemas","invalid-operation-id":"Invalid Operation IDs","missing-path-parameter":"Missing Path Parameters","not-allowed-inline-enum":"Not Allowed Inline Enums","not-allowed-circular-schema":"Not Allowed Circular Schemas","missing-acl-condition-property":"Missing x-acl Condition Properties","missing-status-code":"Missing HTTP Status Codes","invalid-status-code":"Invalid HTTP Status Codes","multiple-success-status-codes":"Multiple Success HTTP Status Codes"};var jr={query:"useQuery",infiniteQuery:"useInfiniteQuery",mutation:"useMutation"},YO={bindings:[jr.query,jr.infiniteQuery,jr.mutation],from:"@tanstack/react-query"},Pa={pageParamName:"page"},Bu={pageParamName:"page",totalItemsName:"totalItems",limitParamName:"limit"},xa="moduleName";var xm={"Content-Type":"application/json",Accept:"application/json"},Vu="data",$m="axios",Zn="config",Jr="AxiosRequestConfig",Uu={defaultImport:$m,bindings:[Jr],from:"axios"};var QO=o(e=>/^(?:[a-zA-Z_$][a-zA-Z0-9_$]*|[0-9]+)$/.test(e),"isValidPropertyName"),Wn=o(e=>e.replace(/^[^a-zA-Z_$]*/g,"").replace(/[^a-zA-Z0-9_$]+(\w)?/g,(t,r)=>(r==null?void 0:r.toUpperCase())??""),"invalidVariableNameCharactersToCamel");function xe(e){return e!=null&&Object.prototype.hasOwnProperty.call(e,"$ref")}o(xe,"isReferenceObject");function Ct(e){return!xe(e)}o(Ct,"isSchemaObject");function Gu(e){return e.type==="array"}o(Gu,"isArraySchemaObject");function JO(e){if(!e.allOf)throw new Error("Function inferRequiredSchema is specialized to handle item with required only in an allOf array.");let[t,r]=e.allOf.reduce((i,s)=>{if(Vq(s)){let a=s.required;i[0].push(...a??[])}else i[1].push(s);return i},[[],[]]),n={properties:t.reduce((i,s)=>(i[s]={},i),{}),type:"object",required:t};return{noRequiredOnlyAllof:r,composedRequiredSchema:n,patchRequiredSchemaInLoop:o((i,s)=>{if(xe(i)){let a=s(i.$ref);a&&n.required.forEach(c=>{var u;n.properties[c]=((u=a==null?void 0:a.properties)==null?void 0:u[c])??{}})}else{let a=i.properties??{};n.required.forEach(c=>{a[c]&&(n.properties[c]=a[c]??{})})}},"patchRequiredSchemaInLoop")}}o(JO,"inferRequiredSchema");var Vq=o(e=>!xe(e)&&!!e.required&&!e.type&&!e.properties&&!(e!=null&&e.allOf)&&!(e!=null&&e.anyOf)&&!e.oneOf,"isBrokenAllOfItem");var gn=Symbol.for("@ts-pattern/matcher"),Uq=Symbol.for("@ts-pattern/isVariadic"),Zu="@ts-pattern/anonymous-select-key",wm=o(e=>!!(e&&typeof e=="object"),"r"),zu=o(e=>e&&!!e[gn],"i"),tn=o((e,t,r)=>{if(zu(e)){let n=e[gn](),{matched:i,selections:s}=n.match(t);return i&&s&&Object.keys(s).forEach(a=>r(a,s[a])),i}if(wm(e)){if(!wm(t))return!1;if(Array.isArray(e)){if(!Array.isArray(t))return!1;let n=[],i=[],s=[];for(let a of e.keys()){let c=e[a];zu(c)&&c[Uq]?s.push(c):s.length?i.push(c):n.push(c)}if(s.length){if(s.length>1)throw new Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");if(t.length<n.length+i.length)return!1;let a=t.slice(0,n.length),c=i.length===0?[]:t.slice(-i.length),u=t.slice(n.length,i.length===0?1/0:-i.length);return n.every((l,p)=>tn(l,a[p],r))&&i.every((l,p)=>tn(l,c[p],r))&&(s.length===0||tn(s[0],u,r))}return e.length===t.length&&e.every((a,c)=>tn(a,t[c],r))}return Reflect.ownKeys(e).every(n=>{let i=e[n];return(n in t||zu(s=i)&&s[gn]().matcherType==="optional")&&tn(i,t[n],r);var s})}return Object.is(t,e)},"s"),Xn=o(e=>{var t,r,n;return wm(e)?zu(e)?(t=(r=(n=e[gn]()).getSelectionKeys)==null?void 0:r.call(n))!=null?t:[]:Array.isArray(e)?wa(e,Xn):wa(Object.values(e),Xn):[]},"o"),wa=o((e,t)=>e.reduce((r,n)=>r.concat(t(n)),[]),"c");function mr(e){return Object.assign(e,{optional:o(()=>Gq(e),"optional"),and:o(t=>Ve(e,t),"and"),or:o(t=>zq(e,t),"or"),select:o(t=>t===void 0?XO(e):XO(t,e),"select")})}o(mr,"u");function Gq(e){return mr({[gn]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return t===void 0?(Xn(e).forEach(i=>n(i,void 0)),{matched:!0,selections:r}):{matched:tn(e,t,n),selections:r}},"match"),getSelectionKeys:o(()=>Xn(e),"getSelectionKeys"),matcherType:"optional"})})}o(Gq,"h");function Ve(...e){return mr({[gn]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return{matched:e.every(i=>tn(i,t,n)),selections:r}},"match"),getSelectionKeys:o(()=>wa(e,Xn),"getSelectionKeys"),matcherType:"and"})})}o(Ve,"m");function zq(...e){return mr({[gn]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return wa(e,Xn).forEach(i=>n(i,void 0)),{matched:e.some(i=>tn(i,t,n)),selections:r}},"match"),getSelectionKeys:o(()=>wa(e,Xn),"getSelectionKeys"),matcherType:"or"})})}o(zq,"d");function Ee(e){return{[gn]:()=>({match:o(t=>({matched:!!e(t)}),"match")})}}o(Ee,"p");function XO(...e){let t=typeof e[0]=="string"?e[0]:void 0,r=e.length===2?e[1]:typeof e[0]=="string"?void 0:e[0];return mr({[gn]:()=>({match:o(n=>{let i={[t??Zu]:n};return{matched:r===void 0||tn(r,n,(s,a)=>{i[s]=a}),selections:i}},"match"),getSelectionKeys:o(()=>[t??Zu].concat(r===void 0?[]:Xn(r)),"getSelectionKeys")})})}o(XO,"y");function Xr(e){return typeof e=="number"}o(Xr,"v");function Kn(e){return typeof e=="string"}o(Kn,"b");function Yn(e){return typeof e=="bigint"}o(Yn,"w");var _U=mr(Ee(function(e){return!0}));var Qn=o(e=>Object.assign(mr(e),{startsWith:o(t=>{return Qn(Ve(e,(r=t,Ee(n=>Kn(n)&&n.startsWith(r)))));var r},"startsWith"),endsWith:o(t=>{return Qn(Ve(e,(r=t,Ee(n=>Kn(n)&&n.endsWith(r)))));var r},"endsWith"),minLength:o(t=>Qn(Ve(e,(r=>Ee(n=>Kn(n)&&n.length>=r))(t))),"minLength"),length:o(t=>Qn(Ve(e,(r=>Ee(n=>Kn(n)&&n.length===r))(t))),"length"),maxLength:o(t=>Qn(Ve(e,(r=>Ee(n=>Kn(n)&&n.length<=r))(t))),"maxLength"),includes:o(t=>{return Qn(Ve(e,(r=t,Ee(n=>Kn(n)&&n.includes(r)))));var r},"includes"),regex:o(t=>{return Qn(Ve(e,(r=t,Ee(n=>Kn(n)&&!!n.match(r)))));var r},"regex")}),"j"),SU=Qn(Ee(Kn)),en=o(e=>Object.assign(mr(e),{between:o((t,r)=>en(Ve(e,((n,i)=>Ee(s=>Xr(s)&&n<=s&&i>=s))(t,r))),"between"),lt:o(t=>en(Ve(e,(r=>Ee(n=>Xr(n)&&n<r))(t))),"lt"),gt:o(t=>en(Ve(e,(r=>Ee(n=>Xr(n)&&n>r))(t))),"gt"),lte:o(t=>en(Ve(e,(r=>Ee(n=>Xr(n)&&n<=r))(t))),"lte"),gte:o(t=>en(Ve(e,(r=>Ee(n=>Xr(n)&&n>=r))(t))),"gte"),int:o(()=>en(Ve(e,Ee(t=>Xr(t)&&Number.isInteger(t)))),"int"),finite:o(()=>en(Ve(e,Ee(t=>Xr(t)&&Number.isFinite(t)))),"finite"),positive:o(()=>en(Ve(e,Ee(t=>Xr(t)&&t>0))),"positive"),negative:o(()=>en(Ve(e,Ee(t=>Xr(t)&&t<0))),"negative")}),"x"),EU=en(Ee(Xr)),Jn=o(e=>Object.assign(mr(e),{between:o((t,r)=>Jn(Ve(e,((n,i)=>Ee(s=>Yn(s)&&n<=s&&i>=s))(t,r))),"between"),lt:o(t=>Jn(Ve(e,(r=>Ee(n=>Yn(n)&&n<r))(t))),"lt"),gt:o(t=>Jn(Ve(e,(r=>Ee(n=>Yn(n)&&n>r))(t))),"gt"),lte:o(t=>Jn(Ve(e,(r=>Ee(n=>Yn(n)&&n<=r))(t))),"lte"),gte:o(t=>Jn(Ve(e,(r=>Ee(n=>Yn(n)&&n>=r))(t))),"gte"),positive:o(()=>Jn(Ve(e,Ee(t=>Yn(t)&&t>0))),"positive"),negative:o(()=>Jn(Ve(e,Ee(t=>Yn(t)&&t<0))),"negative")}),"A"),OU=Jn(Ee(Yn)),PU=mr(Ee(function(e){return typeof e=="boolean"})),xU=mr(Ee(function(e){return typeof e=="symbol"})),$U=mr(Ee(function(e){return e==null})),wU=mr(Ee(function(e){return e!=null}));var Tm=class Tm extends Error{constructor(t){let r;try{r=JSON.stringify(t)}catch{r=t}super(`Pattern matching error: no pattern matches value ${r}`),this.input=void 0,this.input=t}};o(Tm,"W");var Am=Tm,Im={matched:!1,value:void 0};function Pt(e){return new Cm(e,Im)}o(Pt,"z");var $a=class $a{constructor(t,r){this.input=void 0,this.state=void 0,this.input=t,this.state=r}with(...t){if(this.state.matched)return this;let r=t[t.length-1],n=[t[0]],i;t.length===3&&typeof t[1]=="function"?i=t[1]:t.length>2&&n.push(...t.slice(1,t.length-1));let s=!1,a={},c=o((l,p)=>{s=!0,a[l]=p},"a"),u=!n.some(l=>tn(l,this.input,c))||i&&!i(this.input)?Im:{matched:!0,value:r(s?Zu in a?a[Zu]:a:this.input,this.input)};return new $a(this.input,u)}when(t,r){if(this.state.matched)return this;let n=!!t(this.input);return new $a(this.input,n?{matched:!0,value:r(this.input,this.input)}:Im)}otherwise(t){return this.state.matched?this.state.value:t(this.input)}exhaustive(){if(this.state.matched)return this.state.value;throw new Am(this.input)}run(){return this.exhaustive()}returnType(){return this}};o($a,"I");var Cm=$a;var Rm=2,eP=["application/octet-stream","multipart/form-data","application/x-www-form-urlencoded","*/*"],tP=["query","header","path"],Vi=["get","put","post","delete","options","head","patch","trace"],rP=["string","number","integer","boolean"],Aa=["allOf","anyOf","oneOf"];var Le=o(e=>e.charAt(0).toUpperCase()+e.slice(1),"capitalize"),ei=o(e=>e.charAt(0).toLowerCase()+e.slice(1),"decapitalize"),nP=o(e=>e.replace(/(-\w)/g,t=>t[1].toUpperCase()),"kebabToCamel"),pt=o(e=>e.replace(/(_\w)/g,t=>t[1].toUpperCase()),"snakeToCamel"),iP=o(e=>e.replace(/[\W_]+(\w)?/g,(t,r)=>(r==null?void 0:r.toUpperCase())??""),"nonWordCharactersToCamel"),Nm=o((e,t="")=>e.endsWith(t)?e:`${e}${t}`,"suffixIfNeeded"),oP=o((e,t)=>e.replace(new RegExp(`${t}$`),""),"removeSuffix"),Zq=o(e=>{var n;let t=e.reduce((i,s)=>({...i,[s]:(i[s]??0)+1}),{});return(n=Object.entries(t).sort((i,s)=>i[1]===s[1]?s[0].length-i[0].length:s[1]-i[1])[0])==null?void 0:n[0]},"getLongestMostCommon"),jm=o(e=>{let t=e.map(Le).map(sP).map(r=>Wq(r)).flat();return Zq(t)},"getMostCommonAdjacentCombinationSplit"),sP=o(e=>e.split(/(?<![A-Z])(?=[A-Z])/).filter(Boolean),"splitByUppercase"),aP=o(e=>sP(e).join(" "),"camelToSpaceSeparated"),Wq=o((e,t=["dto","by","for","of","in","to","and","with"])=>{var n;let r=[];for(let i=0;i<e.length;i++)if(!t.includes(e[i].toLowerCase()))for(let s=i+1;s<=e.length;s++)t.includes((n=e[s-1])==null?void 0:n.toLowerCase())||r.push(e.slice(i,s).join(""));return r},"getAdjacentStringCombinations"),cP=o((e,t)=>{let r=t.replace(/es$|s$/g,""),n=new RegExp(`(${ei(r)}|${Le(r)})[a-z]*(?=$|[A-Z])`,"g");return e.replace(n,"")},"removeWord"),uP=o(e=>e!==void 0,"isString");var fP=o(e=>`#/components/schemas/${e}`,"getSchemaRef"),Ui=o(e=>e[1]==="/"?e:"#/"+e.slice(1),"autocorrectRef"),rs=o(e=>Ui(e).split("/").at(-1),"getSchemaNameByRef");function km(e){let t=Kq(e).normalize("NFKD").trim().replace(/\s+/g,"_").replace(/--+/g,"-").replace(/-+/g,"_").replace(/[^\w-]+/g,"_");return pt(t)}o(km,"normalizeString");function pP(e){return/^[a-zA-Z]\w*$/.test(e)?e:`"${e}"`}o(pP,"wrapWithQuotesIfNeeded");function dP(e){return typeof e=="string"&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}o(dP,"unwrapQuotesIfNeeded");function Kq(e){let t=Number(e[0]);return typeof t=="number"&&!Number.isNaN(t)?"_"+e:e}o(Kq,"prefixStringStartingWithNumberIfNeeded");function qm(e){let t=e.replaceAll("_","#");return pt(t.replaceAll("-","_")).replaceAll("#","_")}o(qm,"pathParamToVariableName");var Gi=o(e=>rP.includes(e),"isPrimitiveType");function hP(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(hP,"escapeControlCharacters");function rn(e){return e.includes("application/")&&e.includes("json")||eP.includes(e)||e.includes("text/")}o(rn,"isParamMediaTypeAllowed");function Ia(e){return e>=200&&e<300}o(Ia,"isMainResponseStatus");function Wu(e){return!(e>=200&&e<300)}o(Wu,"isErrorStatus");function Ku(e){return e.startsWith("application/")}o(Ku,"isMediaTypeAllowed");var lP=/({\w+})/g,Yq=/[^\w\-]+/g;function mP(e){e=Le(nP(e.replaceAll("/","-")).replaceAll("-",""));let t=[...e.matchAll(lP)];if(t.length>0){let r=t.sort((n,i)=>n.index-i.index)[t.length-1][0];e=`${e.replace(lP,"")}By${Le(r.slice(1,-1))}`}return e.replace(Yq,"_")}o(mP,"pathToVariableName");var Mm=/{(\b\w+(?:-\w+)*\b)}/g;function gP(e){let t=e.match(Mm);return t===null?e.replaceAll(Mm,":$1"):(t.forEach(r=>{let n=qm(r.replaceAll(Mm,":$1"));e=e.replaceAll(r,n)}),e)}o(gP,"replaceHyphenatedPath");var yP=o(e=>{let t=e["x-enumNames"],r=Array.isArray(t)&&t.length>0,n=!!e.schema&&Ct(e.schema)&&e.schema.type==="string";return r&&n},"isSortingParameterObject"),zi=o((e,t)=>t.excludePathRegex?new RegExp(t.excludePathRegex).test(e):!1,"isPathExcluded");var Qt=o(e=>e.method==="get","isQuery"),ti=o(e=>e.method!=="get"||!!e.mediaDownload,"isMutation"),ns=o((e,t)=>Qt(e)&&(t??Object.values(Pa)).every(r=>e.parameters.some(n=>n.name===r&&n.type==="Query")),"isInfiniteQuery");function ri(e){return iP(e)}o(ri,"formatTag");function ni(e,t){var n;let r=(n=e.tags)==null?void 0:n[0];return ri(r??t.defaultTag)}o(ni,"getOperationTag");function bP(e,t){return t.excludeTags.some(r=>r.toLowerCase()===e.toLowerCase())}o(bP,"isTagExcluded");var Jt=o((...e)=>[...new Set(e.flat())],"getUniqueArray");function Tt(e,t){if(!e)return;let{data:r,onSchema:n}=t;if(xe(e)&&n({type:"reference",schema:e,data:r})===!0)return;let i=e;if(Aa.some(s=>s in i&&i[s])){let s=i.allOf??i.anyOf??i.oneOf??[];for(let a of s)(n==null?void 0:n({type:"composite",parentSchema:e,schema:a,data:r}))!==!0&&Tt(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&&Tt(a,t);if(i.additionalProperties&&typeof i.additionalProperties=="object"){if(n({type:"additionalProperties",parentSchema:e,schema:i.additionalProperties,data:r})===!0)return;Tt(i.additionalProperties,t)}if(i.type==="array"){let s=e.items;if(n({type:"array",parentSchema:e,schema:s,data:r})===!0)return;Tt(s,t)}}o(Tt,"iterateSchema");var nn=o((e,t)=>Nm(Le(km(e)),t),"getZodSchemaName"),Ca=o((e,t,r)=>Nm(Le(km(e)),`${t}${r}`),"getEnumZodSchemaName"),Ht=o(e=>!e.startsWith("z."),"isNamedZodSchema"),vP=o(e=>e.startsWith(Is),"isEnumZodSchema"),Zi=o((e,t,r)=>t?e:`${r}_${e}`,"getZodSchemaOperationName"),Yu=o(e=>pt(`${e}_${eb}`),"getBodyZodSchemaName"),_P=o((e,t)=>pt(`${e}_${t}${tb}`),"getParamZodSchemaName"),Qq=o(e=>pt(`${e}${rb}`),"getMainResponseZodSchemaName"),Jq=o((e,t)=>pt(`${e}_${t}_${nb}`),"getErrorResponseZodSchemaName");function Qu({statusCode:e,operationName:t,isUniqueOperationName:r,tag:n}){let i=Number(e),s=Zi(t,r,n);return!Ia(i)&&e!=="default"&&Wu(i)?Jq(s,e):Qq(s)}o(Qu,"getResponseZodSchemaName");function Ta(e){return["minimum","exclusiveMinimum","maximum","exclusiveMaximum","minItems","minLength","minProperties","maxItems","maxLength","maxProperties","default","example"].filter(n=>e[n]).reduce((n,i)=>[...n,`${Le(aP(i))}: \`${e[i]}\``],[])}o(Ta,"getSchemaDescriptions");var Ra=o((e,t)=>oP(e,t.schemaSuffix),"getZodSchemaInferedTypeName"),SP=o((e,t)=>Ht(t)?`${e.options.tsNamespaces?`${Ge({type:"models",tag:e.getTagByZodSchemaName(t),options:e.options})}.`:""}${t}`:t,"getImportedZodSchemaName"),Wi=o((e,t,r)=>{if(!Ht(t))return t===As?"void":t;let n=e.getTagByZodSchemaName(t);return`${e.options.tsNamespaces&&n!==r?`${Ge({type:"models",tag:n,options:e.options})}.`:""}${Ra(t,e.options)}`},"getImportedZodSchemaInferedTypeName");function EP(e){var t;return e.isEnum?"enum":((t=e.schemaObj)==null?void 0:t.type)??"object"}o(EP,"getZodSchemaType");function OP(e){if(e.schemaObj)return[e.schemaObj.description,...Ta(e.schemaObj).join(". ")].filter(Boolean)}o(OP,"getZodSchemaDescription");function PP(e,t,r){var n;if(xe(t)){let i=e.getZodSchemaNameByRef(t.$ref);return i?Wi(e,i,r):void 0}if(Gu(t)){if(!xe(t.items))return`${((n=t.items)==null?void 0:n.type)??"unknown"}[]`;let i=e.getZodSchemaNameByRef(t.items.$ref);return i?`${Wi(e,i,r)}[]`:void 0}if(Aa.some(i=>i in t&&t[i])){let i=t.allOf??t.anyOf??t.oneOf??[];if(i.length>0)return PP(e,i[0],r)}return t.type}o(PP,"getType");function xP(e,t,r){if(!t.schemaObj)return[];let n="[0]",i="[key]",s={},a=o(c=>{var l;if(c.type==="reference")return!0;if(c.type==="composite")return;let u=[...((l=c.data)==null?void 0:l.pathSegments)??[]];if(c.type==="array"?u.push(n):c.type==="property"?u.push(c.propertyName):c.type==="additionalProperties"&&u.push(i),c.schema&&u[u.length-1]!==n){let p=e.resolveObject(c.schema),f=[p.description,...Ta(p)].filter(Boolean),d=u.join(".");s[d]&&"type"in c.schema&&c.schema.type==="object"||(delete s[d],s[d]={type:PP(e,c.schema,r)??"unknown",description:f.join(". ")})}return Tt(c.schema,{data:{pathSegments:[...u]},onSchema:a}),!0},"onSchema");return"allOf"in t.schemaObj&&t.schemaObj.allOf&&t.schemaObj.allOf.forEach(c=>{if(xe(c)){let u=e.resolveObject(c);Tt(u,{data:{pathSegments:[]},onSchema:a})}}),Tt(t.schemaObj,{data:{pathSegments:[]},onSchema:a}),s}o(xP,"getZodSchemaPropertyDescriptions");function ii({resolver:e,tag:t,zodSchemas:r=[],zodSchemasAsTypes:n=[]}){let i="models",s=o(u=>e.getTagByZodSchemaName(u),"getTag"),a=Dm({type:i,tag:t,entities:r,getTag:s,getEntityName:o(u=>u,"getEntityName"),options:e.options}),c=Dm({type:i,tag:t,entities:n,getTag:s,getEntityName:o(u=>Ra(u,e.options),"getEntityName"),options:e.options});return Xq(e.options,a,c)}o(ii,"getModelsImports");function $P({tag:e,endpoints:t,options:r}){return Dm({type:"endpoints",tag:e,entities:t,getTag:o(n=>ja(n,r),"getTag"),getEntityName:Na,options:r})}o($P,"getEndpointsImports");function wP({tags:e,entityName:t,getAliasEntityName:r,type:n,options:i}){let s=new Map;return e.forEach(a=>{let c=`${t}${r?` as ${r(a)}`:""}`;s.has(a)?i.tsNamespaces||s.get(a).bindings.push(c):s.set(a,{bindings:[i.tsNamespaces?Ge({type:n,tag:a,options:i}):c],from:`${oi(i)}${Ju({type:n,tag:a,includeTagDir:!0,options:i})}`})}),Array.from(s.values())}o(wP,"getEntityImports");function oi(e){let t=wf;return e.importPath==="relative"?t="../":e.importPath==="absolute"?t=e.output:new RegExp(`${$f}`,"g").test(e.output)&&(t=e.output.replace(new RegExp(`.*${$f}`,"g"),wf)),`${t}/`.replace(/\/\//g,"/")}o(oi,"getImportPath");function Dm({type:e="models",tag:t,entities:r,getTag:n,getEntityName:i,options:s}){let a=new Map;return r.forEach(c=>{let u=n(c);if(a.has(u))s.tsNamespaces||a.get(u).bindings.push(i(c));else{let l=t===u;a.set(u,{bindings:[s.tsNamespaces?Ge({type:e,tag:u,options:s}):i(c)],from:`${l?"./":oi(s)}${Ju({type:e,tag:u,includeTagDir:!l,options:s})}`})}}),Array.from(a.values())}o(Dm,"getImports");function Xq(e,...t){let r=new Map;return t.forEach(n=>{n.forEach(i=>{r.has(i.from)?e.tsNamespaces||r.get(i.from).bindings.push(...i.bindings):r.set(i.from,i)})}),Array.from(r.values()).map(n=>({...n,bindings:Jt(n.bindings)}))}o(Xq,"mergeImports");function is({fileName:e,extension:t}){return`${e}.${t}`}o(is,"getFileNameWithExtension");function AP({type:e,tag:t,options:r,includeTagDir:n=!0}){let i=r.configs[e].outputFileNameSuffix;return t?`${n?`${ei(t)}/`:""}${ei(t)}.${i}`:i}o(AP,"getTagFileNameWithoutExtension");function Ju(...e){return AP(...e)}o(Ju,"getTagImportPath");function Xu(...e){return`${AP(...e)}.ts`}o(Xu,"getTagFileName");var Ge=o(({type:e,tag:t,options:r})=>`${Le(t)}${r.configs[e].namespaceSuffix}`,"getNamespaceName");function IP(e){return e.standalone?`${oi(e)}${xc.fileName}`:e.restClientImportPath}o(IP,"getAppRestClientImportPath");function CP(e){return e.standalone?`${oi(e)}${Pc.reactQueryTypes.fileName}`:e.queryTypesImportPath}o(CP,"getQueryTypesImportPath");function TP(e){return`${oi(e)}${$c.fileName}`}o(TP,"getQueryModulesImportPath");function RP(e){return`${oi(e)}${wc.fileName}`}o(RP,"getMutationEffectsImportPath");function NP(e){return`${oi(e)}${Ac.fileName}`}o(NP,"getZodExtendedImportPath");function jP(e){return Pt(e).with("string",()=>"string").with("number",()=>"number").with("integer",()=>"number").with("boolean",()=>"boolean").exhaustive()}o(jP,"primitiveTypeToTsType");var Na=o(e=>ei(pt(e.operationName)),"getEndpointName");function MP(e,t){return`${t.tsNamespaces?`${Ge({type:"endpoints",tag:ja(e,t),options:t})}.`:""}${Na(e)}`}o(MP,"getImportedEndpointName");var kP=o(e=>e.path.replace(/:([a-zA-Z0-9_]+)/g,"${$1}"),"getEndpointPath");function ja(e,t){var n;let r=t.splitByTags?(n=e.tags)==null?void 0:n[0]:t.defaultTag;return ri(r??t.defaultTag)}o(ja,"getEndpointTag");function Ma(e,t,r){let n=t.parameters.map(i=>{var a,c,u,l;let s="string";if(Ht(i.zodSchema))s=Wi(e,i.zodSchema);else if((a=i.parameterObject)!=null&&a.schema&&Ct(i.parameterObject.schema)){let p=(u=(c=i.parameterObject)==null?void 0:c.schema)==null?void 0:u.type;p&&Gi(p)&&(s=jP(p))}return{name:Wn(i.name),type:s,paramType:i.type,required:((l=i.parameterObject)==null?void 0:l.required)??!0,parameterObject:i.parameterObject,bodyObject:i.bodyObject}});return r!=null&&r.includeFileParam&&t.mediaUpload&&n.push({name:"file",type:"File",paramType:"Body",required:!0,parameterObject:void 0,bodyObject:void 0}),n.sort((i,s)=>{if(i.required===s.required){let a=["Path","Body","Query","Header"];return a.indexOf(i.paramType)-a.indexOf(s.paramType)}return i.required?-1:1}).filter(i=>(!(r!=null&&r.excludeBodyParam)||i.name!==Vu)&&(!(r!=null&&r.excludePageParam)||i.name!==Pa.pageParamName)&&(!(r!=null&&r.includeOnlyRequiredParams)||i.required)).map(i=>({...i,name:r!=null&&r.replacePageParam&&i.name===Pa.pageParamName?"pageParam":i.name}))}o(Ma,"mapEndpointParamsToFunctionParams");function qP(e){let t=e.parameters.filter(i=>i.type==="Query").map(i=>{let s=QO(i.name)?i.name:`"${i.name}"`,a=Wn(i.name);return{...i,name:s,value:a}}),r={};return e.requestFormat!==xm["Content-Type"]&&(r["Content-Type"]=`'${e.requestFormat}'`),e.responseFormat&&e.responseFormat!==xm.Accept&&(r.Accept=`'${e.responseFormat}'`),e.parameters.filter(i=>i.type==="Header").forEach(i=>{r[i.name]=Wn(i.name)}),{...t.length>0?{params:t}:{},...Object.keys(r).length?{headers:r}:{}}}o(qP,"getEndpointConfig");function DP(e,t){return t.filter(r=>Qt(r)&&r.parameters.filter(n=>{var i;return(i=n.parameterObject)==null?void 0:i.required}).every(n=>e.parameters.some(i=>i.name===n.name))&&r.response===e.response)}o(DP,"getUpdateQueryEndpoints");var Lm=["break","case","catch","class","const","continue","debugger","default","delete","do","else","export","extends","false","finally","for","function","if","import","in","instanceof","new","null","return","super","switch","this","throw","true","try","typeof","var","void","while","with"];function Ki(e,t){let r={};return Object.keys(e).forEach(n=>{t.includes(n)&&(r[n]=e[n])}),r}o(Ki,"pick");function os(e,t){let r=e.deprecated&&!t.withDeprecatedEndpoints,n=ni(e,t),i=bP(n,t);return r||i}o(os,"isOperationExcluded");function Fm({path:e,method:t,operation:r,options:n,tag:i,keepOperationTag:s,keepOperationPrefix:a}){let c=`${t}${mP(e)}`,u=r.operationId?Wn(r.operationId):c;if(n.removeOperationPrefixEndingWith&&a)u=u.split(n.removeOperationPrefixEndingWith).map((p,f)=>f===0?p:Le(p)).join("");else if(n.removeOperationPrefixEndingWith&&!a){let l=new RegExp(`^.*${n.removeOperationPrefixEndingWith}`);u=u.replace(l,"")}if(n.tsNamespaces&&!s){let l=cP(u,i);Lm.includes(l)||(u=l)}return Lm.includes(u)?c:u}o(Fm,"getOperationName");function ka({operationsByTag:e,...t}){let{operation:r,options:n}=t,i=n.splitByTags?ni(r,n):n.defaultTag,s=o(a=>{let c=Fm({...t,tag:i,keepOperationTag:a});if(e[i].filter(l=>Fm({...t,operation:l,tag:i,keepOperationTag:a})===c).length===1)return c},"operationName");return s()??s(!0)??Fm({...t,tag:i,keepOperationTag:!0,keepOperationPrefix:!0})}o(ka,"getUniqueOperationName");function LP(e,t,r){let n=[];for(let i in e.paths){if(zi(i,r))continue;let s=e.paths[i],a=Ki(s,Vi);for(let c in a){let u=a[c];if(!u||os(u,r))continue;let l=ka({path:i,method:c,operation:u,operationsByTag:t,options:r});n.push(l)}}return n}o(LP,"getUniqueOperationNamesWithoutSplitByTags");function FP(e,t){let r={};for(let n in e.paths){if(zi(n,t))continue;let i=e.paths[n],s=Ki(i,Vi);for(let a in s){let c=s[a];if(!c||os(c,t))continue;let u=t.splitByTags?ni(c,t):t.defaultTag;r[u]||(r[u]=[]),r[u].push(c)}}return r}o(FP,"getOperationsByTag");function qa(e){return{type:"invalid-schema",message:e}}o(qa,"getInvalidSchemaError");function HP(e){return{type:"invalid-operation-id",message:`Operation ${e}`}}o(HP,"getInvalidOperationIdError");function BP(e,t){return{type:"missing-path-parameter",message:`Path ${t} is missing [${e.map(({name:r})=>r).join(", ")}]`}}o(BP,"getMissingPathParameterError");function VP(e){return{type:"not-allowed-inline-enum",message:`${e} is missing @IsEnum() and @ApiProperty(enum:, enumName:)`}}o(VP,"getNotAllowedInlineEnumError");function UP(e){return{type:"not-allowed-circular-schema",message:e}}o(UP,"getNotAllowedCircularSchemaError");function GP(e,t,r){return{type:"missing-acl-condition-property",message:`Condition property ${e} is not found in parameters or body in operation ${tl(t,r)}`}}o(GP,"getMissingAclConditionPropertyError");function Hm(e,t,r){return{type:"missing-status-code",message:`Missing HTTP status code ${el(e)} in operation ${tl(t,r)}`}}o(Hm,"getMissingStatusCodeError");function zP(e,t,r){return{type:"invalid-status-code",message:`Operation ${tl(t,r)} expected HTTP status code ${el(e.expected)} but received ${el(e.received)}`}}o(zP,"getInvalidStatusCodeError");function ZP(e,t,r){return{type:"multiple-success-status-codes",message:`Operation ${tl(t,r)} has multiple success HTTP status codes: ${e.map(el).join(", ")}`}}o(ZP,"getMultipleSuccessStatusCodesError");function tl(e,t){return e.operationId??`${t.method} ${t.path}`}o(tl,"getOperationDescriptor");function el(e){return`${e} (${WO[e]})`}o(el,"getStatusCodeDescription");function WP(e){return e.reduce((t,r)=>({...t,[r.type]:[...t[r.type]??[],r.message]}),{})}o(WP,"groupByType");function on({schema:e,meta:t,options:r}){let n=[];Pt(e.type).with("string",()=>n.push(rD(e))).with("number","integer",()=>n.push(iD(e))).with("array",()=>n.push(oD(e))).otherwise(()=>{}),typeof e.description=="string"&&e.description!==""&&r.withDescription&&([`
141
141
  `,"\r",`\r
142
142
  `].some(s=>String.prototype.includes.call(e.description,s))?n.push(`describe(\`${e.description}\`)`):n.push(`describe("${e.description}")`));let i=n.concat(eD({schema:e,meta:t,options:r}),r.withDefaultValues!==!1?tD(e):[]).filter(Boolean).join(".");return i?`.${i}`:""}o(on,"getZodChain");function eD({schema:e,meta:t,options:r}){return e.nullable&&!(t!=null&&t.isRequired)?"nullish()":e.nullable||r.replaceOptionalWithNullish&&(t!=null&&t.isParentPartial)?"nullable()":t!=null&&t.isRequired?"":r.replaceOptionalWithNullish?"nullish()":"optional()"}o(eD,"getZodChainablePresence");function tD(e){return e.default!==void 0?`default(${Pt(e.type).with("number","integer",()=>dP(e.default)).otherwise(()=>JSON.stringify(e.default))})`:""}o(tD,"getZodChainableDefault");function rD(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(${nD(e.pattern)})`),e.format){let r=Pt(e.format).with("email",()=>"email()").with("hostname","uri",()=>"url()").with("uuid",()=>"uuid()").with("date-time",()=>"datetime({ offset: true })").otherwise(()=>"");r&&t.push(r)}return t.join(".")}o(rD,"getZodChainableStringValidations");function nD(e){return e.startsWith("/")&&e.endsWith("/")&&(e=e.slice(1,-1)),e=hP(e),`/${e}/`}o(nD,"formatPatternIfNeeded");function iD(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(iD,"getZodChainableNumberValidations");function oD(e){let t=[];return e.minItems&&t.push(`min(${e.minItems})`),e.maxItems&&t.push(`max(${e.maxItems})`),t.join(".")}o(oD,"getZodChainableArrayValidations");var Yi=o(e=>e.reduce((t,r)=>t+r,0),"sum");function dt(e,t){if(!t)return e;if(xe(t))return e+2;if(Array.isArray(t.type))return t.type.length===1?Xt("oneOf")+dt(e,{...t,type:t.type[0]}):e+Xt("oneOf")+Yi(t.type.map(r=>dt(0,{...t,type:r})));if(t.oneOf)return t.oneOf.length===1?Xt("oneOf")+dt(e,t.oneOf[0]):e+Xt("oneOf")+Yi(t.oneOf.map(r=>dt(0,r)));if(t.anyOf)return t.anyOf.length===1?Xt("anyOf")+dt(e,t.anyOf[0]):e+Xt("anyOf")+Yi(t.anyOf.map(r=>dt(0,r)));if(t.allOf)return t.allOf.length===1?Xt("allOf")+dt(e,t.allOf[0]):e+Xt("allOf")+Yi(t.allOf.map(r=>dt(0,r)));if(!t.type)return e;if(Gi(t.type))return t.enum?e+KP(t)+Xt("enum")+Yi(t.enum.map(r=>dt(0,r))):e+KP(t);if(t.type==="array")return t.items?Xt("array")+dt(e,t.items):Xt("array")+dt(e);if(t.type==="object"||t.properties||t.additionalProperties){if(t.properties){let r=Object.values(t.properties);e+=Xt("object")+Yi(r.map(n=>dt(0,n)))}else e+=Xt("empty-object");t.additionalProperties&&(typeof t.additionalProperties=="object"?e+=dt(0,t.additionalProperties):e+=dt(1))}return e}o(dt,"getOpenAPISchemaComplexity");function KP(e){return Pt(e.type).with("string","number","integer","boolean",()=>1).otherwise(()=>0)}o(KP,"complexityByType");function Xt(e){return Pt(e).with("oneOf",()=>2).with("anyOf",()=>3).with("allOf",()=>2).with("enum","array","empty-object",()=>1).with("object",()=>2).otherwise(()=>0)}o(Xt,"complexityByComposite");var Bm=class Bm{constructor(t,r,n={referencedBy:[]},i){this.schema=t;this.resolver=r;xe(t)&&(this.ref=t.$ref),i&&(this.enumRef=i),this.meta={...n,referencedBy:[...(n==null?void 0:n.referencedBy)??[]]},this.ref&&this.meta.referencedBy.push(this)}code;ref;enumRef;children=[];meta;getCodeString(t,r){var s,a;if(!this.ref&&this.code)return this.code;if(!this.ref)throw new Error("Zod schema is missing both ref and code");let n=(s=this.resolver)==null?void 0:s.getZodSchemaNameByRef(this.ref);if(!n)return this.ref;let i=(a=this.resolver)==null?void 0:a.getTagByZodSchemaName(n);return r!=null&&r.tsNamespaces&&i&&i!==t?`${Ge({type:"models",tag:i,options:r})}.${n}`:n}get complexity(){return dt(0,this.schema)}assign(t){return this.code=t,this}inherit(t){return t&&t.children.push(this),this}};o(Bm,"ZodSchema");var Da=Bm;function Qe({schema:e,resolver:t,meta:r,tag:n}){var y;let i=new Da(e,t,r),s={parent:i.inherit(r==null?void 0:r.parent),referencedBy:[...i.meta.referencedBy]},a={resolver:t,meta:s,tag:n};if(xe(e))return sD({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});let c=cD({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(c)return c;let u=aD({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(u)return u;let l=uD({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(l)return l;let p=lD({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(p)return p;let f=fD({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(f)return f;let d=t.options.allReadonly?".readonly()":"";if(Gu(e))return e.items?i.assign(`z.array(${Qe({...a,schema:e.items}).getCodeString(n,t.options)}${on({schema:e.items,meta:{...s,isRequired:!0},options:t.options})})${d}`):i.assign(`z.array(z.any())${d}`);let h=e.type?e.type.toLowerCase():void 0;if(h==="object"||e.properties||e.additionalProperties){let b=e.required&&e.required.length>0,g=t.options.withImplicitRequiredProps?!1:e.properties&&!((y=e.required)!=null&&y.length),P="{}";e.properties&&(P="{ "+Object.entries(e.properties).map(([K,X])=>{var M;let Ze={...s,isRequired:g?!0:b?(M=e.required)==null?void 0:M.includes(K):t.options.withImplicitRequiredProps,name:K,isParentPartial:g},Ie=X;if(xe(X)&&t&&(Ie=t.getSchemaByRef(X.$ref),!Ie))throw new Error(`Schema ${X.$ref} not found`);let re=Qe({...a,schema:X,meta:Ze}).getCodeString(n,t.options)+on({schema:Ie,meta:Ze,options:t.options});return[K,re]}).map(([K,X])=>`${pP(K)}: ${X}`).join(", ")+" }");let $="";e.additionalProperties&&($=`.catchall(${typeof e.additionalProperties=="object"&&Object.keys(e.additionalProperties).length>0?Qe({...a,schema:e.additionalProperties}).getCodeString(n,t.options)+on({schema:e.additionalProperties,meta:{...s,isRequired:!0},options:t.options}):"z.any()"})`);let T=g?".partial()":"",C=t.options.strictObjects?".strict()":"";return i.assign(`z.object(${P})${T}${C}${$}${d}`)}if(h==="any")return i.assign("z.any()");if(!h)return i.assign("z.unknown()");throw new Error(`Unsupported schema type: ${h}`)}o(Qe,"getZodSchema");function sD({schema:e,zodSchema:t,resolver:r,meta:n,tag:i}){if(!xe(e))return;let s=t.meta.referencedBy.slice(0,-1).map(u=>u.ref?r.getZodSchemaNameByRef(u.ref)??u.ref:void 0).filter(Boolean),a=r.getZodSchemaNameByRef(e.$ref);if(s.length>1&&s.includes(a))return t.assign(r.getCodeByZodSchemaName(t.ref));let c=r.getCodeByZodSchemaName(e.$ref);if(!c){let u=r.getSchemaByRef(e.$ref);if(!u)throw new Error(`Schema ${e.$ref} not found`);c=Qe({schema:u,resolver:r,meta:n,tag:i}).getCodeString(i,r.options)}return r.getCodeByZodSchemaName(a)||r.setZodSchema(a,c,i),t}o(sD,"getReferenceZodSchema");function aD({schema:e,zodSchema:t,resolver:r,meta:n,tag:i}){var a;if(!Ct(e)||!e.oneOf)return;if(e.oneOf.length===1){let c=Qe({schema:e.oneOf[0],resolver:r,meta:n,tag:i});return t.assign(c.getCodeString(i,r.options))}let s=(a=e.oneOf)==null?void 0:a.some(c=>Ct(c)&&((c==null?void 0:c.allOf)||[]).length>1);if(e.discriminator&&!s){let c=e.discriminator.propertyName;return t.assign(`
143
143
  z.discriminatedUnion("${c}", [${e.oneOf.map(u=>Qe({schema:u,resolver:r,meta:n,tag:i}).getCodeString(i,r.options)).join(", ")}])
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@povio/openapi-codegen-cli",
3
- "version": "0.11.0",
3
+ "version": "0.11.1",
4
4
  "main": "./dist/index.js",
5
5
  "bin": {
6
6
  "openapi-codegen": "./dist/sh.js"
@@ -1,6 +1,6 @@
1
1
  import { createContext, use, useMemo } from "react";
2
2
 
3
- export namespace QueryConfig {
3
+ export namespace OpenApiQueryConfig {
4
4
  interface Type {
5
5
  preferUpdate?: boolean;
6
6
  }
@@ -1,7 +1,7 @@
1
1
  import { QueryKey, useQueryClient } from "@tanstack/react-query";
2
2
  import { useCallback } from "react";
3
3
 
4
- import { QueryConfig } from "./queryConfig.context";
4
+ import { OpenApiQueryConfig } from "./queryConfig.context";
5
5
  import { QueryModule } from "./queryModules";
6
6
 
7
7
  export interface MutationEffectsOptions {
@@ -17,7 +17,7 @@ export interface UseMutationEffectsOptions {
17
17
 
18
18
  export function useMutationEffects({ currentModule }: UseMutationEffectsOptions) {
19
19
  const queryClient = useQueryClient();
20
- const config = QueryConfig.useConfig();
20
+ const config = OpenApiQueryConfig.useConfig();
21
21
 
22
22
  const runMutationEffects = useCallback(
23
23
  async <TData>(data: TData, options: MutationEffectsOptions = {}, updateKeys?: QueryKey[]) => {