@povio/openapi-codegen-cli 0.13.8 → 0.13.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/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(vb,"stringEncaseCRLFWithFirstIndex");var{stdout:_b,stderr:Sb}=yb,Hf=Symbol("GENERATOR"),_o=Symbol("STYLER"),Ns=Symbol("IS_EMPTY"),Eb=["ansi","ansi","ansi256","ansi16m"],So=Object.create(null),X2=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=_b?_b.level:0;e.level=t.level===void 0?r:t.level},"applyOptions"),Uf=class Uf{constructor(t){return Ob(t)}};o(Uf,"Chalk");var Lc=Uf,Ob=o(e=>{let t=o((...r)=>r.join(" "),"chalk");return X2(t,e),Object.setPrototypeOf(t,js.prototype),t},"chalkFactory");function js(e){return Ob(e)}o(js,"createChalk");Object.setPrototypeOf(js.prototype,Function.prototype);for(let[e,t]of Object.entries(Pr))So[e]={get(){let r=Fc(this,Vf(t.open,t.close,this[_o]),this[Ns]);return Object.defineProperty(this,e,{value:r}),r}};So.visible={get(){let e=Fc(this,this[_o],!0);return Object.defineProperty(this,"visible",{value:e}),e}};var Bf=o((e,t,r,...n)=>e==="rgb"?t==="ansi16m"?Pr[r].ansi16m(...n):t==="ansi256"?Pr[r].ansi256(Pr.rgbToAnsi256(...n)):Pr[r].ansi(Pr.rgbToAnsi(...n)):e==="hex"?Bf("rgb",t,r,...Pr.hexToRgb(...n)):Pr[r][e](...n),"getModelAnsi"),ew=["rgb","hex","ansi256"];for(let e of ew){So[e]={get(){let{level:r}=this;return function(...n){let i=Vf(Bf(e,Eb[r],"color",...n),Pr.color.close,this[_o]);return Fc(this,i,this[Ns])}}};let t="bg"+e[0].toUpperCase()+e.slice(1);So[t]={get(){let{level:r}=this;return function(...n){let i=Vf(Bf(e,Eb[r],"bgColor",...n),Pr.bgColor.close,this[_o]);return Fc(this,i,this[Ns])}}}}var tw=Object.defineProperties(()=>{},{...So,level:{enumerable:!0,get(){return this[Hf].level},set(e){this[Hf].level=e}}}),Vf=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"),Fc=o((e,t,r)=>{let n=o((...i)=>rw(n,i.length===1?""+i[0]:i.join(" ")),"builder");return Object.setPrototypeOf(n,tw),n[Hf]=e,n[_o]=t,n[Ns]=r,n},"createBuilder"),rw=o((e,t)=>{if(e.level<=0||!t)return e[Ns]?"":t;let r=e[_o];if(r===void 0)return t;let{openAll:n,closeAll:i}=r;if(t.includes("\x1B"))for(;r!==void 0;)t=bb(t,r.close,r.open),r=r.parent;let s=t.indexOf(`
|
|
140
|
-
`);return s!==-1&&(t=vb(t,i,n,s)),n+t+i},"applyStyle");Object.defineProperties(js.prototype,So);var eH=js(),tH=js({level:Sb?Sb.level:0});var Vr=new Lc;function Ms(e,t,r){console.log(r!==void 0&&r!==t?`${Vr.yellow(`${e}:`.padEnd(20))}${Vr.magenta(t)}`:`${`${e}:`.padEnd(20)}${t}`)}o(Ms,"logVariable");function fr(e){console.log(`[INFO] ${e}`)}o(fr,"logInfo");function Rn(e){console.log(Vr.green(`[SUCCESS] ${e}`))}o(Rn,"logSuccess");function ks(e,t){e instanceof Error?(console.log(Vr.red(`[ERROR] ${t||e.message}`)),process.env.VERBOSE&&console.error(e)):console.log(Vr.red(`[ERROR] ${e}`))}o(ks,"logError");function Hc(e){console.log(Vr.bgYellow(`==== ${e} ====`))}o(Hc,"logBanner");var Pb=mt(require("fs"));function Eo(){return"0.13.8"}o(Eo,"getVersion");var hH=mt($b());var Gf=Symbol("options_key");function Ee(e){return(t,r)=>{var n,i;if(e!=null){let s={...Reflect.getMetadata(Gf,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(Gf,s,t)}}}o(Ee,"YargOption");function wb(e){let t=Reflect.getMetadata(Gf,e.prototype);if(!t)throw new Error(`Options for ${e.name} were not defined`);return t}o(wb,"getYargsOption");function Bc(e){return async t=>t.options(nw(e)).middleware(async r=>await iw(e,r),!0)}o(Bc,"getBuilder");function nw(e){return Object.entries(wb(e)).reduce((t,[r,n])=>(t[r]=Object.fromEntries(Object.entries(n).filter(([i])=>!["envAlias","default"].includes(i))),t),{})}o(nw,"getYargsOptions");async function iw(e,t){let r=new e;for(let[n,i]of Object.entries(wb(e)))r[n]=t[n]??i.default;return r}o(iw,"loadYargsConfig");var Mx=mt(Mm());var rP={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"},nP={"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 kr={query:"useQuery",infiniteQuery:"useInfiniteQuery",mutation:"useMutation"},iP={bindings:[kr.query,kr.infiniteQuery,kr.mutation],from:"@tanstack/react-query"},wa={pageParamName:"page"},Wu={pageParamName:"page",totalItemsName:"totalItems",limitParamName:"limit"},Aa="moduleName";var km={"Content-Type":"application/json",Accept:"application/json"},Ku="data",qm="axios",Kn="config",en="AxiosRequestConfig",Yu={defaultImport:qm,bindings:[en],from:"axios"};var oP=o(e=>/^(?:[a-zA-Z_$][a-zA-Z0-9_$]*|[0-9]+)$/.test(e),"isValidPropertyName"),Yn=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 we(e){return e!=null&&Object.prototype.hasOwnProperty.call(e,"$ref")}o(we,"isReferenceObject");function Nt(e){return!we(e)}o(Nt,"isSchemaObject");function Qu(e){return e.type==="array"}o(Qu,"isArraySchemaObject");function sP(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(Xq(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(we(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(sP,"inferRequiredSchema");var Xq=o(e=>!we(e)&&!!e.required&&!e.type&&!e.properties&&!(e!=null&&e.allOf)&&!(e!=null&&e.anyOf)&&!e.oneOf,"isBrokenAllOfItem");var vn=Symbol.for("@ts-pattern/matcher"),eD=Symbol.for("@ts-pattern/isVariadic"),Xu="@ts-pattern/anonymous-select-key",Dm=o(e=>!!(e&&typeof e=="object"),"r"),Ju=o(e=>e&&!!e[vn],"i"),nn=o((e,t,r)=>{if(Ju(e)){let n=e[vn](),{matched:i,selections:s}=n.match(t);return i&&s&&Object.keys(s).forEach(a=>r(a,s[a])),i}if(Dm(e)){if(!Dm(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];Ju(c)&&c[eD]?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)=>nn(l,a[p],r))&&i.every((l,p)=>nn(l,c[p],r))&&(s.length===0||nn(s[0],u,r))}return e.length===t.length&&e.every((a,c)=>nn(a,t[c],r))}return Reflect.ownKeys(e).every(n=>{let i=e[n];return(n in t||Ju(s=i)&&s[vn]().matcherType==="optional")&&nn(i,t[n],r);var s})}return Object.is(t,e)},"s"),ti=o(e=>{var t,r,n;return Dm(e)?Ju(e)?(t=(r=(n=e[vn]()).getSelectionKeys)==null?void 0:r.call(n))!=null?t:[]:Array.isArray(e)?Ca(e,ti):Ca(Object.values(e),ti):[]},"o"),Ca=o((e,t)=>e.reduce((r,n)=>r.concat(t(n)),[]),"c");function yr(e){return Object.assign(e,{optional:o(()=>tD(e),"optional"),and:o(t=>Ge(e,t),"and"),or:o(t=>rD(e,t),"or"),select:o(t=>t===void 0?aP(e):aP(t,e),"select")})}o(yr,"u");function tD(e){return yr({[vn]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return t===void 0?(ti(e).forEach(i=>n(i,void 0)),{matched:!0,selections:r}):{matched:nn(e,t,n),selections:r}},"match"),getSelectionKeys:o(()=>ti(e),"getSelectionKeys"),matcherType:"optional"})})}o(tD,"h");function Ge(...e){return yr({[vn]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return{matched:e.every(i=>nn(i,t,n)),selections:r}},"match"),getSelectionKeys:o(()=>Ca(e,ti),"getSelectionKeys"),matcherType:"and"})})}o(Ge,"m");function rD(...e){return yr({[vn]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return Ca(e,ti).forEach(i=>n(i,void 0)),{matched:e.some(i=>nn(i,t,n)),selections:r}},"match"),getSelectionKeys:o(()=>Ca(e,ti),"getSelectionKeys"),matcherType:"or"})})}o(rD,"d");function xe(e){return{[vn]:()=>({match:o(t=>({matched:!!e(t)}),"match")})}}o(xe,"p");function aP(...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 yr({[vn]:()=>({match:o(n=>{let i={[t??Xu]:n};return{matched:r===void 0||nn(r,n,(s,a)=>{i[s]=a}),selections:i}},"match"),getSelectionKeys:o(()=>[t??Xu].concat(r===void 0?[]:ti(r)),"getSelectionKeys")})})}o(aP,"y");function tn(e){return typeof e=="number"}o(tn,"v");function Qn(e){return typeof e=="string"}o(Qn,"b");function Jn(e){return typeof e=="bigint"}o(Jn,"w");var RU=yr(xe(function(e){return!0}));var Xn=o(e=>Object.assign(yr(e),{startsWith:o(t=>{return Xn(Ge(e,(r=t,xe(n=>Qn(n)&&n.startsWith(r)))));var r},"startsWith"),endsWith:o(t=>{return Xn(Ge(e,(r=t,xe(n=>Qn(n)&&n.endsWith(r)))));var r},"endsWith"),minLength:o(t=>Xn(Ge(e,(r=>xe(n=>Qn(n)&&n.length>=r))(t))),"minLength"),length:o(t=>Xn(Ge(e,(r=>xe(n=>Qn(n)&&n.length===r))(t))),"length"),maxLength:o(t=>Xn(Ge(e,(r=>xe(n=>Qn(n)&&n.length<=r))(t))),"maxLength"),includes:o(t=>{return Xn(Ge(e,(r=t,xe(n=>Qn(n)&&n.includes(r)))));var r},"includes"),regex:o(t=>{return Xn(Ge(e,(r=t,xe(n=>Qn(n)&&!!n.match(r)))));var r},"regex")}),"j"),NU=Xn(xe(Qn)),rn=o(e=>Object.assign(yr(e),{between:o((t,r)=>rn(Ge(e,((n,i)=>xe(s=>tn(s)&&n<=s&&i>=s))(t,r))),"between"),lt:o(t=>rn(Ge(e,(r=>xe(n=>tn(n)&&n<r))(t))),"lt"),gt:o(t=>rn(Ge(e,(r=>xe(n=>tn(n)&&n>r))(t))),"gt"),lte:o(t=>rn(Ge(e,(r=>xe(n=>tn(n)&&n<=r))(t))),"lte"),gte:o(t=>rn(Ge(e,(r=>xe(n=>tn(n)&&n>=r))(t))),"gte"),int:o(()=>rn(Ge(e,xe(t=>tn(t)&&Number.isInteger(t)))),"int"),finite:o(()=>rn(Ge(e,xe(t=>tn(t)&&Number.isFinite(t)))),"finite"),positive:o(()=>rn(Ge(e,xe(t=>tn(t)&&t>0))),"positive"),negative:o(()=>rn(Ge(e,xe(t=>tn(t)&&t<0))),"negative")}),"x"),jU=rn(xe(tn)),ei=o(e=>Object.assign(yr(e),{between:o((t,r)=>ei(Ge(e,((n,i)=>xe(s=>Jn(s)&&n<=s&&i>=s))(t,r))),"between"),lt:o(t=>ei(Ge(e,(r=>xe(n=>Jn(n)&&n<r))(t))),"lt"),gt:o(t=>ei(Ge(e,(r=>xe(n=>Jn(n)&&n>r))(t))),"gt"),lte:o(t=>ei(Ge(e,(r=>xe(n=>Jn(n)&&n<=r))(t))),"lte"),gte:o(t=>ei(Ge(e,(r=>xe(n=>Jn(n)&&n>=r))(t))),"gte"),positive:o(()=>ei(Ge(e,xe(t=>Jn(t)&&t>0))),"positive"),negative:o(()=>ei(Ge(e,xe(t=>Jn(t)&&t<0))),"negative")}),"A"),MU=ei(xe(Jn)),kU=yr(xe(function(e){return typeof e=="boolean"})),qU=yr(xe(function(e){return typeof e=="symbol"})),DU=yr(xe(function(e){return e==null})),LU=yr(xe(function(e){return e!=null}));var Bm=class Bm 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(Bm,"W");var Lm=Bm,Fm={matched:!1,value:void 0};function $t(e){return new Hm(e,Fm)}o($t,"z");var Ia=class Ia{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=>nn(l,this.input,c))||i&&!i(this.input)?Fm:{matched:!0,value:r(s?Xu in a?a[Xu]:a:this.input,this.input)};return new Ia(this.input,u)}when(t,r){if(this.state.matched)return this;let n=!!t(this.input);return new Ia(this.input,n?{matched:!0,value:r(this.input,this.input)}:Fm)}otherwise(t){return this.state.matched?this.state.value:t(this.input)}exhaustive(){if(this.state.matched)return this.state.value;throw new Lm(this.input)}run(){return this.exhaustive()}returnType(){return this}};o(Ia,"I");var Hm=Ia;var Vm=2,cP=["application/octet-stream","multipart/form-data","application/x-www-form-urlencoded","*/*"],uP=["query","header","path"],Zi=["get","put","post","delete","options","head","patch","trace"],lP=["string","number","integer","boolean"],Ta=["allOf","anyOf","oneOf"];var Fe=o(e=>e.charAt(0).toUpperCase()+e.slice(1),"capitalize"),ri=o(e=>e.charAt(0).toLowerCase()+e.slice(1),"decapitalize"),fP=o(e=>e.replace(/(-\w)/g,t=>t[1].toUpperCase()),"kebabToCamel"),pt=o(e=>e.replace(/(_\w)/g,t=>t[1].toUpperCase()),"snakeToCamel"),pP=o(e=>e.replace(/[\W_]+(\w)?/g,(t,r)=>(r==null?void 0:r.toUpperCase())??""),"nonWordCharactersToCamel"),Um=o((e,t="")=>e.endsWith(t)?e:`${e}${t}`,"suffixIfNeeded"),dP=o((e,t)=>e.replace(new RegExp(`${t}$`),""),"removeSuffix"),nD=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"),Gm=o(e=>{let t=e.map(Fe).map(hP).map(r=>iD(r)).flat();return nD(t)},"getMostCommonAdjacentCombinationSplit"),hP=o(e=>e.split(/(?<![A-Z])(?=[A-Z])/).filter(Boolean),"splitByUppercase"),mP=o(e=>hP(e).join(" "),"camelToSpaceSeparated"),iD=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"),gP=o((e,t)=>{let r=t.replace(/es$|s$/g,""),n=new RegExp(`(${ri(r)}|${Fe(r)})[a-z]*(?=$|[A-Z])`,"g");return e.replace(n,"")},"removeWord");var bP=o(e=>`#/components/schemas/${e}`,"getSchemaRef"),Wi=o(e=>e[1]==="/"?e:"#/"+e.slice(1),"autocorrectRef"),as=o(e=>Wi(e).split("/").at(-1),"getSchemaNameByRef");function Zm(e){let t=oD(e).normalize("NFKD").trim().replace(/\s+/g,"_").replace(/--+/g,"-").replace(/-+/g,"_").replace(/[^\w-]+/g,"_");return pt(t)}o(Zm,"normalizeString");function vP(e){return/^[a-zA-Z]\w*$/.test(e)?e:`"${e}"`}o(vP,"wrapWithQuotesIfNeeded");function _P(e){return typeof e=="string"&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}o(_P,"unwrapQuotesIfNeeded");function oD(e){let t=Number(e[0]);return typeof t=="number"&&!Number.isNaN(t)?"_"+e:e}o(oD,"prefixStringStartingWithNumberIfNeeded");function Wm(e){let t=e.replaceAll("_","#");return pt(t.replaceAll("-","_")).replaceAll("#","_")}o(Wm,"pathParamToVariableName");var Ki=o(e=>lP.includes(e),"isPrimitiveType");function SP(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(SP,"escapeControlCharacters");function on(e){return e.includes("application/")&&e.includes("json")||cP.includes(e)||e.includes("text/")}o(on,"isParamMediaTypeAllowed");function Ra(e){return e>=200&&e<300}o(Ra,"isMainResponseStatus");function el(e){return!(e>=200&&e<300)}o(el,"isErrorStatus");function tl(e){return e.startsWith("application/")}o(tl,"isMediaTypeAllowed");var yP=/({\w+})/g,sD=/[^\w\-]+/g;function EP(e){e=Fe(fP(e.replaceAll("/","-")).replaceAll("-",""));let t=[...e.matchAll(yP)];if(t.length>0){let r=t.sort((n,i)=>n.index-i.index)[t.length-1][0];e=`${e.replace(yP,"")}By${Fe(r.slice(1,-1))}`}return e.replace(sD,"_")}o(EP,"pathToVariableName");var zm=/{(\b\w+(?:-\w+)*\b)}/g;function OP(e){let t=e.match(zm);return t===null?e.replaceAll(zm,":$1"):(t.forEach(r=>{let n=Wm(r.replaceAll(zm,":$1"));e=e.replaceAll(r,n)}),e)}o(OP,"replaceHyphenatedPath");var PP=o(e=>{let t=e["x-enumNames"],r=Array.isArray(t)&&t.length>0,n=!!e.schema&&Nt(e.schema)&&e.schema.type==="string";return r&&n},"isSortingParameterObject"),Yi=o((e,t)=>t.excludePathRegex?new RegExp(t.excludePathRegex).test(e):!1,"isPathExcluded");var Jt=o(e=>e.method==="get","isQuery"),ii=o(e=>e.method!=="get"||!!e.mediaDownload,"isMutation"),cs=o((e,t)=>Jt(e)&&(t??Object.values(wa)).every(r=>e.parameters.some(n=>n.name===r&&n.type==="Query")),"isInfiniteQuery"),xP=o((e,t,r)=>{let n=r.reduce((i,s)=>[...i,...ni(e,s,{includeOnlyRequiredParams:!0}).map(a=>a.name)],[]);return ni(e,t,{includeOnlyRequiredParams:!0,excludeBodyParam:!0}).filter(i=>n.includes(i.name)).map(i=>i.name)},"getDestructuredVariables");function oi(e){return pP(e)}o(oi,"formatTag");function si(e,t){var n;let r=(n=e.tags)==null?void 0:n[0];return oi(r??t.defaultTag)}o(si,"getOperationTag");function $P(e,t){return t.excludeTags.some(r=>r.toLowerCase()===e.toLowerCase())}o($P,"isTagExcluded");var rl={fileName:"acl/app.ability",extension:"ts"},Na="AllAbilities",ja="AppAbilities",nl={fileName:"acl/useAclCheck",extension:"ts"},ai="useAclCheck",bt={abilityTuple:"AbilityTuple",pureAbility:"PureAbility",forcedSubject:"ForcedSubject",subject:"Subject"},Ma={bindings:[bt.abilityTuple,bt.pureAbility,bt.forcedSubject,bt.subject],from:"@casl/ability"};var Xt=o((...e)=>[...new Set(e.flat())],"getUniqueArray");var wP=o(e=>`Use${Fe(pt(e.operationName))}Ability`,"getAbilityTypeName"),ka=o(e=>`canUse${Fe(pt(e.operationName))}`,"getAbilityFunctionName"),AP=o((e,t)=>`${t.tsNamespaces?`${He({type:"acl",tag:ci(e,t),options:t})}.`:""}${ka(e)}`,"getImportedAbilityFunctionName"),IP=o(e=>{var t;return(t=e.acl)==null?void 0:t[0].action},"getAbilityAction"),CP=o(e=>{var t;return(t=e.acl)==null?void 0:t[0].subject},"getAbilitySubject"),il=o(e=>{var t;return!!((t=qa(e))!=null&&t.length)},"hasAbilityConditions"),qa=o(e=>{var t;return(t=e.acl)==null?void 0:t[0].conditionsTypes},"getAbilityConditionsTypes"),TP=o(e=>{var t;return(t=e.acl)==null?void 0:t[0].description},"getAbilityDescription"),ol=o(e=>`${Fe(e)}${Na}`,"getTagAllAbilitiesName");function jt(e,t){if(!e)return;let{data:r,onSchema:n}=t;if(we(e)&&n({type:"reference",schema:e,data:r})===!0)return;let i=e;if(Ta.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&&jt(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&&jt(a,t);if(i.additionalProperties&&typeof i.additionalProperties=="object"){if(n({type:"additionalProperties",parentSchema:e,schema:i.additionalProperties,data:r})===!0)return;jt(i.additionalProperties,t)}if(i.type==="array"){let s=e.items;if(n({type:"array",parentSchema:e,schema:s,data:r})===!0)return;jt(s,t)}}o(jt,"iterateSchema");var sn=o((e,t)=>Um(Fe(Zm(e)),t),"getZodSchemaName"),Da=o((e,t,r)=>Um(Fe(Zm(e)),`${t}${r}`),"getEnumZodSchemaName"),wt=o(e=>!e.startsWith("z."),"isNamedZodSchema"),RP=o(e=>e.startsWith(Rs),"isEnumZodSchema"),Qi=o((e,t,r)=>t?e:`${r}_${e}`,"getZodSchemaOperationName"),sl=o(e=>pt(`${e}_${cb}`),"getBodyZodSchemaName"),NP=o((e,t)=>pt(`${e}_${t}${ub}`),"getParamZodSchemaName"),aD=o(e=>pt(`${e}${lb}`),"getMainResponseZodSchemaName"),cD=o((e,t)=>pt(`${e}_${t}_${fb}`),"getErrorResponseZodSchemaName");function al({statusCode:e,operationName:t,isUniqueOperationName:r,tag:n}){let i=Number(e),s=Qi(t,r,n);return!Ra(i)&&e!=="default"&&el(i)?cD(s,e):aD(s)}o(al,"getResponseZodSchemaName");function La(e){return["minimum","exclusiveMinimum","maximum","exclusiveMaximum","minItems","minLength","minProperties","maxItems","maxLength","maxProperties","default","example"].filter(n=>e[n]).reduce((n,i)=>[...n,`${Fe(mP(i))}: \`${e[i]}\``],[])}o(La,"getSchemaDescriptions");var Fa=o((e,t)=>dP(e,t.schemaSuffix),"getZodSchemaInferedTypeName"),jP=o((e,t)=>wt(t)?`${e.options.tsNamespaces?`${He({type:"models",tag:e.getTagByZodSchemaName(t),options:e.options})}.`:""}${t}`:t,"getImportedZodSchemaName"),Ji=o((e,t,r)=>{if(!wt(t))return t===Ts?"void":t;let n=e.getTagByZodSchemaName(t);return`${e.options.tsNamespaces&&n!==r?`${He({type:"models",tag:n,options:e.options})}.`:""}${Fa(t,e.options)}`},"getImportedZodSchemaInferedTypeName");function MP(e){var t;return e.isEnum?"enum":((t=e.schemaObj)==null?void 0:t.type)??"object"}o(MP,"getZodSchemaType");function kP(e){if(e.schemaObj)return[e.schemaObj.description,...La(e.schemaObj).join(". ")].filter(Boolean)}o(kP,"getZodSchemaDescription");function qP(e,t,r){var n;if(we(t)){let i=e.getZodSchemaNameByRef(t.$ref);return i?Ji(e,i,r):void 0}if(Qu(t)){if(!we(t.items))return`${((n=t.items)==null?void 0:n.type)??"unknown"}[]`;let i=e.getZodSchemaNameByRef(t.items.$ref);return i?`${Ji(e,i,r)}[]`:void 0}if(Ta.some(i=>i in t&&t[i])){let i=t.allOf??t.anyOf??t.oneOf??[];if(i.length>0)return qP(e,i[0],r)}return t.type}o(qP,"getType");function DP(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,...La(p)].filter(Boolean),d=u.join(".");s[d]&&"type"in c.schema&&c.schema.type==="object"||(delete s[d],s[d]={type:qP(e,c.schema,r)??"unknown",description:f.join(". ")})}return jt(c.schema,{data:{pathSegments:[...u]},onSchema:a}),!0},"onSchema");return"allOf"in t.schemaObj&&t.schemaObj.allOf&&t.schemaObj.allOf.forEach(c=>{if(we(c)){let u=e.resolveObject(c);jt(u,{data:{pathSegments:[]},onSchema:a})}}),jt(t.schemaObj,{data:{pathSegments:[]},onSchema:a}),s}o(DP,"getZodSchemaPropertyDescriptions");function ui({resolver:e,tag:t,zodSchemas:r=[],zodSchemasAsTypes:n=[]}){let i="models",s=o(u=>e.getTagByZodSchemaName(u),"getTag"),a=cl({type:i,tag:t,entities:r,getTag:s,getEntityName:o(u=>u,"getEntityName"),options:e.options}),c=cl({type:i,tag:t,entities:n,getTag:s,getEntityName:o(u=>Fa(u,e.options),"getEntityName"),options:e.options});return uD(e.options,a,c)}o(ui,"getModelsImports");function LP({tag:e,endpoints:t,options:r}){return cl({type:"endpoints",tag:e,entities:t,getTag:o(n=>ci(n,r),"getTag"),getEntityName:Ha,options:r})}o(LP,"getEndpointsImports");function FP({tag:e,endpoints:t,options:r}){return cl({type:"acl",tag:e,entities:t,getTag:o(n=>ci(n,r),"getTag"),getEntityName:ka,options:r})}o(FP,"getAclImports");function HP({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?He({type:n,tag:a,options:i}):c],from:`${an(i)}${ul({type:n,tag:a,includeTagDir:!0,options:i})}`})}),Array.from(s.values())}o(HP,"getEntityImports");function an(e){let t=qf;return e.importPath==="relative"?t="../":e.importPath==="absolute"?t=e.output:new RegExp(`${kf}`,"g").test(e.output)&&(t=e.output.replace(new RegExp(`.*${kf}`,"g"),qf)),`${t}/`.replace(/\/\//g,"/")}o(an,"getImportPath");function cl({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?He({type:e,tag:u,options:s}):i(c)],from:`${l?"./":an(s)}${ul({type:e,tag:u,includeTagDir:!l,options:s})}`})}}),Array.from(a.values())}o(cl,"getImports");function uD(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:Xt(n.bindings)}))}o(uD,"mergeImports");function Xi({fileName:e,extension:t}){return`${e}.${t}`}o(Xi,"getFileNameWithExtension");function BP({type:e,tag:t,options:r,includeTagDir:n=!0}){let i=r.configs[e].outputFileNameSuffix;return t?`${n?`${ri(t)}/`:""}${ri(t)}.${i}`:i}o(BP,"getTagFileNameWithoutExtension");function ul(...e){return BP(...e)}o(ul,"getTagImportPath");function ll(...e){return`${BP(...e)}.ts`}o(ll,"getTagFileName");var He=o(({type:e,tag:t,options:r})=>`${Fe(t)}${r.configs[e].namespaceSuffix}`,"getNamespaceName");function VP(e){return e.standalone?`${an(e)}${Tc.fileName}`:e.restClientImportPath}o(VP,"getAppRestClientImportPath");function UP(e){return e.standalone?`${an(e)}${Cc.reactQueryTypes.fileName}`:e.queryTypesImportPath}o(UP,"getQueryTypesImportPath");function GP(e){return`${an(e)}${Rc.fileName}`}o(GP,"getQueryModulesImportPath");function zP(e){return`${an(e)}${Nc.fileName}`}o(zP,"getMutationEffectsImportPath");function ZP(e){return`${an(e)}${nl.fileName}`}o(ZP,"getAclCheckImportPath");function WP(e){return`${an(e)}${jc.fileName}`}o(WP,"getZodExtendedImportPath");function KP(e){return`${an(e)}${rl.fileName}`}o(KP,"getAppAbilitiesImportPath");function YP(e){return $t(e).with("string",()=>"string").with("number",()=>"number").with("integer",()=>"number").with("boolean",()=>"boolean").exhaustive()}o(YP,"primitiveTypeToTsType");var Ha=o(e=>ri(pt(e.operationName)),"getEndpointName");function QP(e,t){return`${t.tsNamespaces?`${He({type:"endpoints",tag:ci(e,t),options:t})}.`:""}${Ha(e)}`}o(QP,"getImportedEndpointName");var JP=o(e=>e.path.replace(/:([a-zA-Z0-9_]+)/g,"${$1}"),"getEndpointPath");function ci(e,t){var n;let r=t.splitByTags?(n=e.tags)==null?void 0:n[0]:t.defaultTag;return oi(r??t.defaultTag)}o(ci,"getEndpointTag");function ni(e,t,r){let n=t.parameters.map(i=>{var a,c,u,l;let s="string";if(wt(i.zodSchema))s=Ji(e,i.zodSchema);else if((a=i.parameterObject)!=null&&a.schema&&Nt(i.parameterObject.schema)){let p=(u=(c=i.parameterObject)==null?void 0:c.schema)==null?void 0:u.type;p&&Ki(p)&&(s=YP(p))}return{name:Yn(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!==Ku)&&(!(r!=null&&r.excludePageParam)||i.name!==wa.pageParamName)&&(!(r!=null&&r.includeOnlyRequiredParams)||i.required)).map(i=>({...i,name:r!=null&&r.replacePageParam&&i.name===wa.pageParamName?"pageParam":i.name}))}o(ni,"mapEndpointParamsToFunctionParams");function XP(e){let t=e.parameters.filter(i=>i.type==="Query").map(i=>{let s=oP(i.name)?i.name:`"${i.name}"`,a=Yn(i.name);return{...i,name:s,value:a}}),r={};return e.requestFormat!==km["Content-Type"]&&(r["Content-Type"]=`'${e.requestFormat}'`),e.responseFormat&&e.responseFormat!==km.Accept&&(r.Accept=`'${e.responseFormat}'`),e.parameters.filter(i=>i.type==="Header").forEach(i=>{r[i.name]=Yn(i.name)}),{...t.length>0?{params:t}:{},...Object.keys(r).length?{headers:r}:{}}}o(XP,"getEndpointConfig");function ex(e,t){return t.filter(r=>Jt(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(ex,"getUpdateQueryEndpoints");var Km=["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 eo(e,t){let r={};return Object.keys(e).forEach(n=>{t.includes(n)&&(r[n]=e[n])}),r}o(eo,"pick");function us(e,t){let r=e.deprecated&&!t.withDeprecatedEndpoints,n=si(e,t),i=$P(n,t);return r||i}o(us,"isOperationExcluded");function Ym({path:e,method:t,operation:r,options:n,tag:i,keepOperationTag:s,keepOperationPrefix:a}){let c=`${t}${EP(e)}`,u=r.operationId?Yn(r.operationId):c;if(n.removeOperationPrefixEndingWith&&a)u=u.split(n.removeOperationPrefixEndingWith).map((p,f)=>f===0?p:Fe(p)).join("");else if(n.removeOperationPrefixEndingWith&&!a){let l=new RegExp(`^.*${n.removeOperationPrefixEndingWith}`);u=u.replace(l,"")}if(n.tsNamespaces&&!s){let l=gP(u,i);l===""?u=t.toLowerCase():Km.includes(l)||(u=l)}return Km.includes(u)?c:u}o(Ym,"getOperationName");function Ba({operationsByTag:e,...t}){let{operation:r,options:n}=t,i=n.splitByTags?si(r,n):n.defaultTag,s=o(a=>{let c=Ym({...t,tag:i,keepOperationTag:a});if(e[i].filter(l=>Ym({...t,operation:l,tag:i,keepOperationTag:a})===c).length===1)return c},"operationName");return s()??s(!0)??Ym({...t,tag:i,keepOperationTag:!0,keepOperationPrefix:!0})}o(Ba,"getUniqueOperationName");function tx(e,t,r){let n=[];for(let i in e.paths){if(Yi(i,r))continue;let s=e.paths[i],a=eo(s,Zi);for(let c in a){let u=a[c];if(!u||us(u,r))continue;let l=Ba({path:i,method:c,operation:u,operationsByTag:t,options:r});n.push(l)}}return n}o(tx,"getUniqueOperationNamesWithoutSplitByTags");function rx(e,t){let r={};for(let n in e.paths){if(Yi(n,t))continue;let i=e.paths[n],s=eo(i,Zi);for(let a in s){let c=s[a];if(!c||us(c,t))continue;let u=t.splitByTags?si(c,t):t.defaultTag;r[u]||(r[u]=[]),r[u].push(c)}}return r}o(rx,"getOperationsByTag");function Va(e){return{type:"invalid-schema",message:e}}o(Va,"getInvalidSchemaError");function nx(e){return{type:"invalid-operation-id",message:`Operation ${e}`}}o(nx,"getInvalidOperationIdError");function ix(e,t){return{type:"missing-path-parameter",message:`Path ${t} is missing [${e.map(({name:r})=>r).join(", ")}]`}}o(ix,"getMissingPathParameterError");function ox(e){return{type:"not-allowed-inline-enum",message:`${e} is missing @IsEnum() and @ApiProperty(enum:, enumName:)`}}o(ox,"getNotAllowedInlineEnumError");function sx(e){return{type:"not-allowed-circular-schema",message:e}}o(sx,"getNotAllowedCircularSchemaError");function ax(e,t,r){return{type:"missing-acl-condition-property",message:`Condition property ${e} is not found in parameters or body in operation ${pl(t,r)}`}}o(ax,"getMissingAclConditionPropertyError");function Qm(e,t,r){return{type:"missing-status-code",message:`Missing HTTP status code ${fl(e)} in operation ${pl(t,r)}`}}o(Qm,"getMissingStatusCodeError");function cx(e,t,r){return{type:"invalid-status-code",message:`Operation ${pl(t,r)} expected HTTP status code ${fl(e.expected)} but received ${fl(e.received)}`}}o(cx,"getInvalidStatusCodeError");function ux(e,t,r){return{type:"multiple-success-status-codes",message:`Operation ${pl(t,r)} has multiple success HTTP status codes: ${e.map(fl).join(", ")}`}}o(ux,"getMultipleSuccessStatusCodesError");function pl(e,t){return e.operationId??`${t.method} ${t.path}`}o(pl,"getOperationDescriptor");function fl(e){return`${e} (${rP[e]})`}o(fl,"getStatusCodeDescription");function lx(e){return e.reduce((t,r)=>({...t,[r.type]:[...t[r.type]??[],r.message]}),{})}o(lx,"groupByType");function cn({schema:e,meta:t,options:r}){let n=[];$t(e.type).with("string",()=>n.push(pD(e,r))).with("number","integer",()=>n.push(hD(e))).with("array",()=>n.push(mD(e))).otherwise(()=>{}),typeof e.description=="string"&&e.description!==""&&r.withDescription&&([`
|
|
140
|
+
`);return s!==-1&&(t=vb(t,i,n,s)),n+t+i},"applyStyle");Object.defineProperties(js.prototype,So);var eH=js(),tH=js({level:Sb?Sb.level:0});var Vr=new Lc;function Ms(e,t,r){console.log(r!==void 0&&r!==t?`${Vr.yellow(`${e}:`.padEnd(20))}${Vr.magenta(t)}`:`${`${e}:`.padEnd(20)}${t}`)}o(Ms,"logVariable");function fr(e){console.log(`[INFO] ${e}`)}o(fr,"logInfo");function Rn(e){console.log(Vr.green(`[SUCCESS] ${e}`))}o(Rn,"logSuccess");function ks(e,t){e instanceof Error?(console.log(Vr.red(`[ERROR] ${t||e.message}`)),process.env.VERBOSE&&console.error(e)):console.log(Vr.red(`[ERROR] ${e}`))}o(ks,"logError");function Hc(e){console.log(Vr.bgYellow(`==== ${e} ====`))}o(Hc,"logBanner");var Pb=mt(require("fs"));function Eo(){return"0.13.9"}o(Eo,"getVersion");var hH=mt($b());var Gf=Symbol("options_key");function Ee(e){return(t,r)=>{var n,i;if(e!=null){let s={...Reflect.getMetadata(Gf,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(Gf,s,t)}}}o(Ee,"YargOption");function wb(e){let t=Reflect.getMetadata(Gf,e.prototype);if(!t)throw new Error(`Options for ${e.name} were not defined`);return t}o(wb,"getYargsOption");function Bc(e){return async t=>t.options(nw(e)).middleware(async r=>await iw(e,r),!0)}o(Bc,"getBuilder");function nw(e){return Object.entries(wb(e)).reduce((t,[r,n])=>(t[r]=Object.fromEntries(Object.entries(n).filter(([i])=>!["envAlias","default"].includes(i))),t),{})}o(nw,"getYargsOptions");async function iw(e,t){let r=new e;for(let[n,i]of Object.entries(wb(e)))r[n]=t[n]??i.default;return r}o(iw,"loadYargsConfig");var Mx=mt(Mm());var rP={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"},nP={"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 kr={query:"useQuery",infiniteQuery:"useInfiniteQuery",mutation:"useMutation"},iP={bindings:[kr.query,kr.infiniteQuery,kr.mutation],from:"@tanstack/react-query"},wa={pageParamName:"page"},Wu={pageParamName:"page",totalItemsName:"totalItems",limitParamName:"limit"},Aa="moduleName";var km={"Content-Type":"application/json",Accept:"application/json"},Ku="data",qm="axios",Kn="config",en="AxiosRequestConfig",Yu={defaultImport:qm,bindings:[en],from:"axios"};var oP=o(e=>/^(?:[a-zA-Z_$][a-zA-Z0-9_$]*|[0-9]+)$/.test(e),"isValidPropertyName"),Yn=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 we(e){return e!=null&&Object.prototype.hasOwnProperty.call(e,"$ref")}o(we,"isReferenceObject");function Nt(e){return!we(e)}o(Nt,"isSchemaObject");function Qu(e){return e.type==="array"}o(Qu,"isArraySchemaObject");function sP(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(Xq(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(we(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(sP,"inferRequiredSchema");var Xq=o(e=>!we(e)&&!!e.required&&!e.type&&!e.properties&&!(e!=null&&e.allOf)&&!(e!=null&&e.anyOf)&&!e.oneOf,"isBrokenAllOfItem");var vn=Symbol.for("@ts-pattern/matcher"),eD=Symbol.for("@ts-pattern/isVariadic"),Xu="@ts-pattern/anonymous-select-key",Dm=o(e=>!!(e&&typeof e=="object"),"r"),Ju=o(e=>e&&!!e[vn],"i"),nn=o((e,t,r)=>{if(Ju(e)){let n=e[vn](),{matched:i,selections:s}=n.match(t);return i&&s&&Object.keys(s).forEach(a=>r(a,s[a])),i}if(Dm(e)){if(!Dm(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];Ju(c)&&c[eD]?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)=>nn(l,a[p],r))&&i.every((l,p)=>nn(l,c[p],r))&&(s.length===0||nn(s[0],u,r))}return e.length===t.length&&e.every((a,c)=>nn(a,t[c],r))}return Reflect.ownKeys(e).every(n=>{let i=e[n];return(n in t||Ju(s=i)&&s[vn]().matcherType==="optional")&&nn(i,t[n],r);var s})}return Object.is(t,e)},"s"),ti=o(e=>{var t,r,n;return Dm(e)?Ju(e)?(t=(r=(n=e[vn]()).getSelectionKeys)==null?void 0:r.call(n))!=null?t:[]:Array.isArray(e)?Ca(e,ti):Ca(Object.values(e),ti):[]},"o"),Ca=o((e,t)=>e.reduce((r,n)=>r.concat(t(n)),[]),"c");function yr(e){return Object.assign(e,{optional:o(()=>tD(e),"optional"),and:o(t=>Ge(e,t),"and"),or:o(t=>rD(e,t),"or"),select:o(t=>t===void 0?aP(e):aP(t,e),"select")})}o(yr,"u");function tD(e){return yr({[vn]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return t===void 0?(ti(e).forEach(i=>n(i,void 0)),{matched:!0,selections:r}):{matched:nn(e,t,n),selections:r}},"match"),getSelectionKeys:o(()=>ti(e),"getSelectionKeys"),matcherType:"optional"})})}o(tD,"h");function Ge(...e){return yr({[vn]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return{matched:e.every(i=>nn(i,t,n)),selections:r}},"match"),getSelectionKeys:o(()=>Ca(e,ti),"getSelectionKeys"),matcherType:"and"})})}o(Ge,"m");function rD(...e){return yr({[vn]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return Ca(e,ti).forEach(i=>n(i,void 0)),{matched:e.some(i=>nn(i,t,n)),selections:r}},"match"),getSelectionKeys:o(()=>Ca(e,ti),"getSelectionKeys"),matcherType:"or"})})}o(rD,"d");function xe(e){return{[vn]:()=>({match:o(t=>({matched:!!e(t)}),"match")})}}o(xe,"p");function aP(...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 yr({[vn]:()=>({match:o(n=>{let i={[t??Xu]:n};return{matched:r===void 0||nn(r,n,(s,a)=>{i[s]=a}),selections:i}},"match"),getSelectionKeys:o(()=>[t??Xu].concat(r===void 0?[]:ti(r)),"getSelectionKeys")})})}o(aP,"y");function tn(e){return typeof e=="number"}o(tn,"v");function Qn(e){return typeof e=="string"}o(Qn,"b");function Jn(e){return typeof e=="bigint"}o(Jn,"w");var RU=yr(xe(function(e){return!0}));var Xn=o(e=>Object.assign(yr(e),{startsWith:o(t=>{return Xn(Ge(e,(r=t,xe(n=>Qn(n)&&n.startsWith(r)))));var r},"startsWith"),endsWith:o(t=>{return Xn(Ge(e,(r=t,xe(n=>Qn(n)&&n.endsWith(r)))));var r},"endsWith"),minLength:o(t=>Xn(Ge(e,(r=>xe(n=>Qn(n)&&n.length>=r))(t))),"minLength"),length:o(t=>Xn(Ge(e,(r=>xe(n=>Qn(n)&&n.length===r))(t))),"length"),maxLength:o(t=>Xn(Ge(e,(r=>xe(n=>Qn(n)&&n.length<=r))(t))),"maxLength"),includes:o(t=>{return Xn(Ge(e,(r=t,xe(n=>Qn(n)&&n.includes(r)))));var r},"includes"),regex:o(t=>{return Xn(Ge(e,(r=t,xe(n=>Qn(n)&&!!n.match(r)))));var r},"regex")}),"j"),NU=Xn(xe(Qn)),rn=o(e=>Object.assign(yr(e),{between:o((t,r)=>rn(Ge(e,((n,i)=>xe(s=>tn(s)&&n<=s&&i>=s))(t,r))),"between"),lt:o(t=>rn(Ge(e,(r=>xe(n=>tn(n)&&n<r))(t))),"lt"),gt:o(t=>rn(Ge(e,(r=>xe(n=>tn(n)&&n>r))(t))),"gt"),lte:o(t=>rn(Ge(e,(r=>xe(n=>tn(n)&&n<=r))(t))),"lte"),gte:o(t=>rn(Ge(e,(r=>xe(n=>tn(n)&&n>=r))(t))),"gte"),int:o(()=>rn(Ge(e,xe(t=>tn(t)&&Number.isInteger(t)))),"int"),finite:o(()=>rn(Ge(e,xe(t=>tn(t)&&Number.isFinite(t)))),"finite"),positive:o(()=>rn(Ge(e,xe(t=>tn(t)&&t>0))),"positive"),negative:o(()=>rn(Ge(e,xe(t=>tn(t)&&t<0))),"negative")}),"x"),jU=rn(xe(tn)),ei=o(e=>Object.assign(yr(e),{between:o((t,r)=>ei(Ge(e,((n,i)=>xe(s=>Jn(s)&&n<=s&&i>=s))(t,r))),"between"),lt:o(t=>ei(Ge(e,(r=>xe(n=>Jn(n)&&n<r))(t))),"lt"),gt:o(t=>ei(Ge(e,(r=>xe(n=>Jn(n)&&n>r))(t))),"gt"),lte:o(t=>ei(Ge(e,(r=>xe(n=>Jn(n)&&n<=r))(t))),"lte"),gte:o(t=>ei(Ge(e,(r=>xe(n=>Jn(n)&&n>=r))(t))),"gte"),positive:o(()=>ei(Ge(e,xe(t=>Jn(t)&&t>0))),"positive"),negative:o(()=>ei(Ge(e,xe(t=>Jn(t)&&t<0))),"negative")}),"A"),MU=ei(xe(Jn)),kU=yr(xe(function(e){return typeof e=="boolean"})),qU=yr(xe(function(e){return typeof e=="symbol"})),DU=yr(xe(function(e){return e==null})),LU=yr(xe(function(e){return e!=null}));var Bm=class Bm 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(Bm,"W");var Lm=Bm,Fm={matched:!1,value:void 0};function $t(e){return new Hm(e,Fm)}o($t,"z");var Ia=class Ia{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=>nn(l,this.input,c))||i&&!i(this.input)?Fm:{matched:!0,value:r(s?Xu in a?a[Xu]:a:this.input,this.input)};return new Ia(this.input,u)}when(t,r){if(this.state.matched)return this;let n=!!t(this.input);return new Ia(this.input,n?{matched:!0,value:r(this.input,this.input)}:Fm)}otherwise(t){return this.state.matched?this.state.value:t(this.input)}exhaustive(){if(this.state.matched)return this.state.value;throw new Lm(this.input)}run(){return this.exhaustive()}returnType(){return this}};o(Ia,"I");var Hm=Ia;var Vm=2,cP=["application/octet-stream","multipart/form-data","application/x-www-form-urlencoded","*/*"],uP=["query","header","path"],Zi=["get","put","post","delete","options","head","patch","trace"],lP=["string","number","integer","boolean"],Ta=["allOf","anyOf","oneOf"];var Fe=o(e=>e.charAt(0).toUpperCase()+e.slice(1),"capitalize"),ri=o(e=>e.charAt(0).toLowerCase()+e.slice(1),"decapitalize"),fP=o(e=>e.replace(/(-\w)/g,t=>t[1].toUpperCase()),"kebabToCamel"),pt=o(e=>e.replace(/(_\w)/g,t=>t[1].toUpperCase()),"snakeToCamel"),pP=o(e=>e.replace(/[\W_]+(\w)?/g,(t,r)=>(r==null?void 0:r.toUpperCase())??""),"nonWordCharactersToCamel"),Um=o((e,t="")=>e.endsWith(t)?e:`${e}${t}`,"suffixIfNeeded"),dP=o((e,t)=>e.replace(new RegExp(`${t}$`),""),"removeSuffix"),nD=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"),Gm=o(e=>{let t=e.map(Fe).map(hP).map(r=>iD(r)).flat();return nD(t)},"getMostCommonAdjacentCombinationSplit"),hP=o(e=>e.split(/(?<![A-Z])(?=[A-Z])/).filter(Boolean),"splitByUppercase"),mP=o(e=>hP(e).join(" "),"camelToSpaceSeparated"),iD=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"),gP=o((e,t)=>{let r=t.replace(/es$|s$/g,""),n=new RegExp(`(${ri(r)}|${Fe(r)})[a-z]*(?=$|[A-Z])`,"g");return e.replace(n,"")},"removeWord");var bP=o(e=>`#/components/schemas/${e}`,"getSchemaRef"),Wi=o(e=>e[1]==="/"?e:"#/"+e.slice(1),"autocorrectRef"),as=o(e=>Wi(e).split("/").at(-1),"getSchemaNameByRef");function Zm(e){let t=oD(e).normalize("NFKD").trim().replace(/\s+/g,"_").replace(/--+/g,"-").replace(/-+/g,"_").replace(/[^\w-]+/g,"_");return pt(t)}o(Zm,"normalizeString");function vP(e){return/^[a-zA-Z]\w*$/.test(e)?e:`"${e}"`}o(vP,"wrapWithQuotesIfNeeded");function _P(e){return typeof e=="string"&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}o(_P,"unwrapQuotesIfNeeded");function oD(e){let t=Number(e[0]);return typeof t=="number"&&!Number.isNaN(t)?"_"+e:e}o(oD,"prefixStringStartingWithNumberIfNeeded");function Wm(e){let t=e.replaceAll("_","#");return pt(t.replaceAll("-","_")).replaceAll("#","_")}o(Wm,"pathParamToVariableName");var Ki=o(e=>lP.includes(e),"isPrimitiveType");function SP(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(SP,"escapeControlCharacters");function on(e){return e.includes("application/")&&e.includes("json")||cP.includes(e)||e.includes("text/")}o(on,"isParamMediaTypeAllowed");function Ra(e){return e>=200&&e<300}o(Ra,"isMainResponseStatus");function el(e){return!(e>=200&&e<300)}o(el,"isErrorStatus");function tl(e){return e.startsWith("application/")}o(tl,"isMediaTypeAllowed");var yP=/({\w+})/g,sD=/[^\w\-]+/g;function EP(e){e=Fe(fP(e.replaceAll("/","-")).replaceAll("-",""));let t=[...e.matchAll(yP)];if(t.length>0){let r=t.sort((n,i)=>n.index-i.index)[t.length-1][0];e=`${e.replace(yP,"")}By${Fe(r.slice(1,-1))}`}return e.replace(sD,"_")}o(EP,"pathToVariableName");var zm=/{(\b\w+(?:-\w+)*\b)}/g;function OP(e){let t=e.match(zm);return t===null?e.replaceAll(zm,":$1"):(t.forEach(r=>{let n=Wm(r.replaceAll(zm,":$1"));e=e.replaceAll(r,n)}),e)}o(OP,"replaceHyphenatedPath");var PP=o(e=>{let t=e["x-enumNames"],r=Array.isArray(t)&&t.length>0,n=!!e.schema&&Nt(e.schema)&&e.schema.type==="string";return r&&n},"isSortingParameterObject"),Yi=o((e,t)=>t.excludePathRegex?new RegExp(t.excludePathRegex).test(e):!1,"isPathExcluded");var Jt=o(e=>e.method==="get","isQuery"),ii=o(e=>e.method!=="get"||!!e.mediaDownload,"isMutation"),cs=o((e,t)=>Jt(e)&&(t??Object.values(wa)).every(r=>e.parameters.some(n=>n.name===r&&n.type==="Query")),"isInfiniteQuery"),xP=o((e,t,r)=>{let n=r.reduce((i,s)=>[...i,...ni(e,s,{includeOnlyRequiredParams:!0}).map(a=>a.name)],[]);return ni(e,t,{includeOnlyRequiredParams:!0,excludeBodyParam:!0}).filter(i=>n.includes(i.name)).map(i=>i.name)},"getDestructuredVariables");function oi(e){return pP(e)}o(oi,"formatTag");function si(e,t){var n;let r=(n=e.tags)==null?void 0:n[0];return oi(r??t.defaultTag)}o(si,"getOperationTag");function $P(e,t){return t.excludeTags.some(r=>r.toLowerCase()===e.toLowerCase())}o($P,"isTagExcluded");var rl={fileName:"acl/app.ability",extension:"ts"},Na="AllAbilities",ja="AppAbilities",nl={fileName:"acl/useAclCheck",extension:"ts"},ai="useAclCheck",bt={abilityTuple:"AbilityTuple",pureAbility:"PureAbility",forcedSubject:"ForcedSubject",subject:"Subject"},Ma={bindings:[bt.abilityTuple,bt.pureAbility,bt.forcedSubject,bt.subject],from:"@casl/ability"};var Xt=o((...e)=>[...new Set(e.flat())],"getUniqueArray");var wP=o(e=>`Use${Fe(pt(e.operationName))}Ability`,"getAbilityTypeName"),ka=o(e=>`canUse${Fe(pt(e.operationName))}`,"getAbilityFunctionName"),AP=o((e,t)=>`${t.tsNamespaces?`${He({type:"acl",tag:ci(e,t),options:t})}.`:""}${ka(e)}`,"getImportedAbilityFunctionName"),IP=o(e=>{var t;return(t=e.acl)==null?void 0:t[0].action},"getAbilityAction"),CP=o(e=>{var t;return(t=e.acl)==null?void 0:t[0].subject},"getAbilitySubject"),il=o(e=>{var t;return!!((t=qa(e))!=null&&t.length)},"hasAbilityConditions"),qa=o(e=>{var t;return(t=e.acl)==null?void 0:t[0].conditionsTypes},"getAbilityConditionsTypes"),TP=o(e=>{var t;return(t=e.acl)==null?void 0:t[0].description},"getAbilityDescription"),ol=o(e=>`${Fe(e)}${Na}`,"getTagAllAbilitiesName");function jt(e,t){if(!e)return;let{data:r,onSchema:n}=t;if(we(e)&&n({type:"reference",schema:e,data:r})===!0)return;let i=e;if(Ta.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&&jt(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&&jt(a,t);if(i.additionalProperties&&typeof i.additionalProperties=="object"){if(n({type:"additionalProperties",parentSchema:e,schema:i.additionalProperties,data:r})===!0)return;jt(i.additionalProperties,t)}if(i.type==="array"){let s=e.items;if(n({type:"array",parentSchema:e,schema:s,data:r})===!0)return;jt(s,t)}}o(jt,"iterateSchema");var sn=o((e,t)=>Um(Fe(Zm(e)),t),"getZodSchemaName"),Da=o((e,t,r)=>Um(Fe(Zm(e)),`${t}${r}`),"getEnumZodSchemaName"),wt=o(e=>!e.startsWith("z."),"isNamedZodSchema"),RP=o(e=>e.startsWith(Rs),"isEnumZodSchema"),Qi=o((e,t,r)=>t?e:`${r}_${e}`,"getZodSchemaOperationName"),sl=o(e=>pt(`${e}_${cb}`),"getBodyZodSchemaName"),NP=o((e,t)=>pt(`${e}_${t}${ub}`),"getParamZodSchemaName"),aD=o(e=>pt(`${e}${lb}`),"getMainResponseZodSchemaName"),cD=o((e,t)=>pt(`${e}_${t}_${fb}`),"getErrorResponseZodSchemaName");function al({statusCode:e,operationName:t,isUniqueOperationName:r,tag:n}){let i=Number(e),s=Qi(t,r,n);return!Ra(i)&&e!=="default"&&el(i)?cD(s,e):aD(s)}o(al,"getResponseZodSchemaName");function La(e){return["minimum","exclusiveMinimum","maximum","exclusiveMaximum","minItems","minLength","minProperties","maxItems","maxLength","maxProperties","default","example"].filter(n=>e[n]).reduce((n,i)=>[...n,`${Fe(mP(i))}: \`${e[i]}\``],[])}o(La,"getSchemaDescriptions");var Fa=o((e,t)=>dP(e,t.schemaSuffix),"getZodSchemaInferedTypeName"),jP=o((e,t)=>wt(t)?`${e.options.tsNamespaces?`${He({type:"models",tag:e.getTagByZodSchemaName(t),options:e.options})}.`:""}${t}`:t,"getImportedZodSchemaName"),Ji=o((e,t,r)=>{if(!wt(t))return t===Ts?"void":t;let n=e.getTagByZodSchemaName(t);return`${e.options.tsNamespaces&&n!==r?`${He({type:"models",tag:n,options:e.options})}.`:""}${Fa(t,e.options)}`},"getImportedZodSchemaInferedTypeName");function MP(e){var t;return e.isEnum?"enum":((t=e.schemaObj)==null?void 0:t.type)??"object"}o(MP,"getZodSchemaType");function kP(e){if(e.schemaObj)return[e.schemaObj.description,...La(e.schemaObj).join(". ")].filter(Boolean)}o(kP,"getZodSchemaDescription");function qP(e,t,r){var n;if(we(t)){let i=e.getZodSchemaNameByRef(t.$ref);return i?Ji(e,i,r):void 0}if(Qu(t)){if(!we(t.items))return`${((n=t.items)==null?void 0:n.type)??"unknown"}[]`;let i=e.getZodSchemaNameByRef(t.items.$ref);return i?`${Ji(e,i,r)}[]`:void 0}if(Ta.some(i=>i in t&&t[i])){let i=t.allOf??t.anyOf??t.oneOf??[];if(i.length>0)return qP(e,i[0],r)}return t.type}o(qP,"getType");function DP(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,...La(p)].filter(Boolean),d=u.join(".");s[d]&&"type"in c.schema&&c.schema.type==="object"||(delete s[d],s[d]={type:qP(e,c.schema,r)??"unknown",description:f.join(". ")})}return jt(c.schema,{data:{pathSegments:[...u]},onSchema:a}),!0},"onSchema");return"allOf"in t.schemaObj&&t.schemaObj.allOf&&t.schemaObj.allOf.forEach(c=>{if(we(c)){let u=e.resolveObject(c);jt(u,{data:{pathSegments:[]},onSchema:a})}}),jt(t.schemaObj,{data:{pathSegments:[]},onSchema:a}),s}o(DP,"getZodSchemaPropertyDescriptions");function ui({resolver:e,tag:t,zodSchemas:r=[],zodSchemasAsTypes:n=[]}){let i="models",s=o(u=>e.getTagByZodSchemaName(u),"getTag"),a=cl({type:i,tag:t,entities:r,getTag:s,getEntityName:o(u=>u,"getEntityName"),options:e.options}),c=cl({type:i,tag:t,entities:n,getTag:s,getEntityName:o(u=>Fa(u,e.options),"getEntityName"),options:e.options});return uD(e.options,a,c)}o(ui,"getModelsImports");function LP({tag:e,endpoints:t,options:r}){return cl({type:"endpoints",tag:e,entities:t,getTag:o(n=>ci(n,r),"getTag"),getEntityName:Ha,options:r})}o(LP,"getEndpointsImports");function FP({tag:e,endpoints:t,options:r}){return cl({type:"acl",tag:e,entities:t,getTag:o(n=>ci(n,r),"getTag"),getEntityName:ka,options:r})}o(FP,"getAclImports");function HP({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?He({type:n,tag:a,options:i}):c],from:`${an(i)}${ul({type:n,tag:a,includeTagDir:!0,options:i})}`})}),Array.from(s.values())}o(HP,"getEntityImports");function an(e){let t=qf;return e.importPath==="relative"?t="../":e.importPath==="absolute"?t=e.output:new RegExp(`${kf}`,"g").test(e.output)&&(t=e.output.replace(new RegExp(`.*${kf}`,"g"),qf)),`${t}/`.replace(/\/\//g,"/")}o(an,"getImportPath");function cl({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?He({type:e,tag:u,options:s}):i(c)],from:`${l?"./":an(s)}${ul({type:e,tag:u,includeTagDir:!l,options:s})}`})}}),Array.from(a.values())}o(cl,"getImports");function uD(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:Xt(n.bindings)}))}o(uD,"mergeImports");function Xi({fileName:e,extension:t}){return`${e}.${t}`}o(Xi,"getFileNameWithExtension");function BP({type:e,tag:t,options:r,includeTagDir:n=!0}){let i=r.configs[e].outputFileNameSuffix;return t?`${n?`${ri(t)}/`:""}${ri(t)}.${i}`:i}o(BP,"getTagFileNameWithoutExtension");function ul(...e){return BP(...e)}o(ul,"getTagImportPath");function ll(...e){return`${BP(...e)}.ts`}o(ll,"getTagFileName");var He=o(({type:e,tag:t,options:r})=>`${Fe(t)}${r.configs[e].namespaceSuffix}`,"getNamespaceName");function VP(e){return e.standalone?`${an(e)}${Tc.fileName}`:e.restClientImportPath}o(VP,"getAppRestClientImportPath");function UP(e){return e.standalone?`${an(e)}${Cc.reactQueryTypes.fileName}`:e.queryTypesImportPath}o(UP,"getQueryTypesImportPath");function GP(e){return`${an(e)}${Rc.fileName}`}o(GP,"getQueryModulesImportPath");function zP(e){return`${an(e)}${Nc.fileName}`}o(zP,"getMutationEffectsImportPath");function ZP(e){return`${an(e)}${nl.fileName}`}o(ZP,"getAclCheckImportPath");function WP(e){return`${an(e)}${jc.fileName}`}o(WP,"getZodExtendedImportPath");function KP(e){return`${an(e)}${rl.fileName}`}o(KP,"getAppAbilitiesImportPath");function YP(e){return $t(e).with("string",()=>"string").with("number",()=>"number").with("integer",()=>"number").with("boolean",()=>"boolean").exhaustive()}o(YP,"primitiveTypeToTsType");var Ha=o(e=>ri(pt(e.operationName)),"getEndpointName");function QP(e,t){return`${t.tsNamespaces?`${He({type:"endpoints",tag:ci(e,t),options:t})}.`:""}${Ha(e)}`}o(QP,"getImportedEndpointName");var JP=o(e=>e.path.replace(/:([a-zA-Z0-9_]+)/g,"${$1}"),"getEndpointPath");function ci(e,t){var n;let r=t.splitByTags?(n=e.tags)==null?void 0:n[0]:t.defaultTag;return oi(r??t.defaultTag)}o(ci,"getEndpointTag");function ni(e,t,r){let n=t.parameters.map(i=>{var a,c,u,l;let s="string";if(wt(i.zodSchema))s=Ji(e,i.zodSchema);else if((a=i.parameterObject)!=null&&a.schema&&Nt(i.parameterObject.schema)){let p=(u=(c=i.parameterObject)==null?void 0:c.schema)==null?void 0:u.type;p&&Ki(p)&&(s=YP(p))}return{name:Yn(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!==Ku)&&(!(r!=null&&r.excludePageParam)||i.name!==wa.pageParamName)&&(!(r!=null&&r.includeOnlyRequiredParams)||i.required)).map(i=>({...i,name:r!=null&&r.replacePageParam&&i.name===wa.pageParamName?"pageParam":i.name}))}o(ni,"mapEndpointParamsToFunctionParams");function XP(e){let t=e.parameters.filter(i=>i.type==="Query").map(i=>{let s=oP(i.name)?i.name:`"${i.name}"`,a=Yn(i.name);return{...i,name:s,value:a}}),r={};return e.requestFormat!==km["Content-Type"]&&(r["Content-Type"]=`'${e.requestFormat}'`),e.responseFormat&&e.responseFormat!==km.Accept&&(r.Accept=`'${e.responseFormat}'`),e.parameters.filter(i=>i.type==="Header").forEach(i=>{r[i.name]=Yn(i.name)}),{...t.length>0?{params:t}:{},...Object.keys(r).length?{headers:r}:{}}}o(XP,"getEndpointConfig");function ex(e,t){return t.filter(r=>Jt(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(ex,"getUpdateQueryEndpoints");var Km=["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 eo(e,t){let r={};return Object.keys(e).forEach(n=>{t.includes(n)&&(r[n]=e[n])}),r}o(eo,"pick");function us(e,t){let r=e.deprecated&&!t.withDeprecatedEndpoints,n=si(e,t),i=$P(n,t);return r||i}o(us,"isOperationExcluded");function Ym({path:e,method:t,operation:r,options:n,tag:i,keepOperationTag:s,keepOperationPrefix:a}){let c=`${t}${EP(e)}`,u=r.operationId?Yn(r.operationId):c;if(n.removeOperationPrefixEndingWith&&a)u=u.split(n.removeOperationPrefixEndingWith).map((p,f)=>f===0?p:Fe(p)).join("");else if(n.removeOperationPrefixEndingWith&&!a){let l=new RegExp(`^.*${n.removeOperationPrefixEndingWith}`);u=u.replace(l,"")}if(n.tsNamespaces&&!s){let l=gP(u,i);l===""?u=t.toLowerCase():Km.includes(l)||(u=l)}return Km.includes(u)?c:u}o(Ym,"getOperationName");function Ba({operationsByTag:e,...t}){let{operation:r,options:n}=t,i=n.splitByTags?si(r,n):n.defaultTag,s=o(a=>{let c=Ym({...t,tag:i,keepOperationTag:a});if(e[i].filter(l=>Ym({...t,operation:l,tag:i,keepOperationTag:a})===c).length===1)return c},"operationName");return s()??s(!0)??Ym({...t,tag:i,keepOperationTag:!0,keepOperationPrefix:!0})}o(Ba,"getUniqueOperationName");function tx(e,t,r){let n=[];for(let i in e.paths){if(Yi(i,r))continue;let s=e.paths[i],a=eo(s,Zi);for(let c in a){let u=a[c];if(!u||us(u,r))continue;let l=Ba({path:i,method:c,operation:u,operationsByTag:t,options:r});n.push(l)}}return n}o(tx,"getUniqueOperationNamesWithoutSplitByTags");function rx(e,t){let r={};for(let n in e.paths){if(Yi(n,t))continue;let i=e.paths[n],s=eo(i,Zi);for(let a in s){let c=s[a];if(!c||us(c,t))continue;let u=t.splitByTags?si(c,t):t.defaultTag;r[u]||(r[u]=[]),r[u].push(c)}}return r}o(rx,"getOperationsByTag");function Va(e){return{type:"invalid-schema",message:e}}o(Va,"getInvalidSchemaError");function nx(e){return{type:"invalid-operation-id",message:`Operation ${e}`}}o(nx,"getInvalidOperationIdError");function ix(e,t){return{type:"missing-path-parameter",message:`Path ${t} is missing [${e.map(({name:r})=>r).join(", ")}]`}}o(ix,"getMissingPathParameterError");function ox(e){return{type:"not-allowed-inline-enum",message:`${e} is missing @IsEnum() and @ApiProperty(enum:, enumName:)`}}o(ox,"getNotAllowedInlineEnumError");function sx(e){return{type:"not-allowed-circular-schema",message:e}}o(sx,"getNotAllowedCircularSchemaError");function ax(e,t,r){return{type:"missing-acl-condition-property",message:`Condition property ${e} is not found in parameters or body in operation ${pl(t,r)}`}}o(ax,"getMissingAclConditionPropertyError");function Qm(e,t,r){return{type:"missing-status-code",message:`Missing HTTP status code ${fl(e)} in operation ${pl(t,r)}`}}o(Qm,"getMissingStatusCodeError");function cx(e,t,r){return{type:"invalid-status-code",message:`Operation ${pl(t,r)} expected HTTP status code ${fl(e.expected)} but received ${fl(e.received)}`}}o(cx,"getInvalidStatusCodeError");function ux(e,t,r){return{type:"multiple-success-status-codes",message:`Operation ${pl(t,r)} has multiple success HTTP status codes: ${e.map(fl).join(", ")}`}}o(ux,"getMultipleSuccessStatusCodesError");function pl(e,t){return e.operationId??`${t.method} ${t.path}`}o(pl,"getOperationDescriptor");function fl(e){return`${e} (${rP[e]})`}o(fl,"getStatusCodeDescription");function lx(e){return e.reduce((t,r)=>({...t,[r.type]:[...t[r.type]??[],r.message]}),{})}o(lx,"groupByType");function cn({schema:e,meta:t,options:r}){let n=[];$t(e.type).with("string",()=>n.push(pD(e,r))).with("number","integer",()=>n.push(hD(e))).with("array",()=>n.push(mD(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(lD({schema:e,meta:t,options:r}),r.withDefaultValues!==!1?fD(e):[]).filter(Boolean).join(".");return i?`.${i}`:""}o(cn,"getZodChain");function lD({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(lD,"getZodChainablePresence");function fD(e){return e.default!==void 0?`default(${$t(e.type).with("number","integer",()=>_P(e.default)).otherwise(()=>JSON.stringify(e.default))})`:""}o(fD,"getZodChainableDefault");function pD(e,t){let r=[];if(e.enum||(e.minLength!==void 0&&r.push(`min(${e.minLength})`),e.maxLength!==void 0&&r.push(`max(${e.maxLength})`)),e.pattern&&r.push(`regex(${dD(e.pattern)})`),e.format){let n=$t(e.format).with("email",()=>"email()").with("hostname","uri",()=>"url()").with("uuid",()=>"uuid()").with("date-time",()=>`datetime({ offset: true })${t.branded?".brand('datetime')":""}`).otherwise(()=>"");n&&r.push(n)}return r.join(".")}o(pD,"getZodChainableStringValidations");function dD(e){return e.startsWith("/")&&e.endsWith("/")&&(e=e.slice(1,-1)),e=SP(e),`/${e}/`}o(dD,"formatPatternIfNeeded");function hD(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(hD,"getZodChainableNumberValidations");function mD(e){let t=[];return e.minItems&&t.push(`min(${e.minItems})`),e.maxItems&&t.push(`max(${e.maxItems})`),t.join(".")}o(mD,"getZodChainableArrayValidations");var to=o(e=>e.reduce((t,r)=>t+r,0),"sum");function dt(e,t){if(!t)return e;if(we(t))return e+2;if(Array.isArray(t.type))return t.type.length===1?er("oneOf")+dt(e,{...t,type:t.type[0]}):e+er("oneOf")+to(t.type.map(r=>dt(0,{...t,type:r})));if(t.oneOf)return t.oneOf.length===1?er("oneOf")+dt(e,t.oneOf[0]):e+er("oneOf")+to(t.oneOf.map(r=>dt(0,r)));if(t.anyOf)return t.anyOf.length===1?er("anyOf")+dt(e,t.anyOf[0]):e+er("anyOf")+to(t.anyOf.map(r=>dt(0,r)));if(t.allOf)return t.allOf.length===1?er("allOf")+dt(e,t.allOf[0]):e+er("allOf")+to(t.allOf.map(r=>dt(0,r)));if(!t.type)return e;if(Ki(t.type))return t.enum?e+fx(t)+er("enum")+to(t.enum.map(r=>dt(0,r))):e+fx(t);if(t.type==="array")return t.items?er("array")+dt(e,t.items):er("array")+dt(e);if(t.type==="object"||t.properties||t.additionalProperties){if(t.properties){let r=Object.values(t.properties);e+=er("object")+to(r.map(n=>dt(0,n)))}else e+=er("empty-object");t.additionalProperties&&(typeof t.additionalProperties=="object"?e+=dt(0,t.additionalProperties):e+=dt(1))}return e}o(dt,"getOpenAPISchemaComplexity");function fx(e){return $t(e.type).with("string","number","integer","boolean",()=>1).otherwise(()=>0)}o(fx,"complexityByType");function er(e){return $t(e).with("oneOf",()=>2).with("anyOf",()=>3).with("allOf",()=>2).with("enum","array","empty-object",()=>1).with("object",()=>2).otherwise(()=>0)}o(er,"complexityByComposite");var Jm=class Jm{constructor(t,r,n={referencedBy:[]},i){this.schema=t;this.resolver=r;we(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?`${He({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(Jm,"ZodSchema");var Ua=Jm;function Qe({schema:e,resolver:t,meta:r,tag:n}){var y;let i=new Ua(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(we(e))return gD({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});let c=bD({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(c)return c;let u=yD({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(u)return u;let l=vD({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(l)return l;let p=_D({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(p)return p;let f=SD({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(f)return f;let d=t.options.allReadonly?".readonly()":"";if(Qu(e))return e.items?i.assign(`z.array(${Qe({...a,schema:e.items}).getCodeString(n,t.options)}${cn({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(([te,X])=>{var j;let ze={...s,isRequired:g?!0:b?(j=e.required)==null?void 0:j.includes(te):t.options.withImplicitRequiredProps,name:te,isParentPartial:g},$e=X;if(we(X)&&t&&($e=t.getSchemaByRef(X.$ref),!$e))throw new Error(`Schema ${X.$ref} not found`);let G=Qe({...a,schema:X,meta:ze}).getCodeString(n,t.options)+cn({schema:$e,meta:ze,options:t.options});return[te,G]}).map(([te,X])=>`${vP(te)}: ${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)+cn({schema:e.additionalProperties,meta:{...s,isRequired:!0},options:t.options}):"z.any()"})`);let C=g?".partial()":"",T=t.options.strictObjects?".strict()":"";return i.assign(`z.object(${P})${C}${T}${$}${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 gD({schema:e,zodSchema:t,resolver:r,meta:n,tag:i}){if(!we(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(gD,"getReferenceZodSchema");function yD({schema:e,zodSchema:t,resolver:r,meta:n,tag:i}){var a;if(!Nt(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=>Nt(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 +1 @@
|
|
|
1
|
-
{{zodExtended}}.{{parse}}({{#if param.parameterSortingEnumSchemaName}}{{zodExtended}}.{{sortingString}}({{importedZodSchemaName param.parameterSortingEnumSchemaName}}){{#if addOptional}}.optional(){{/if}}{{else}}{{importedZodSchemaName param.zodSchema}}{{#if addOptional}}.optional(){{/if}}{{/if}}, {{paramName}}{{#if isQuery}}, { type: "query", name: "{{paramName}}" }{{/if}})
|
|
1
|
+
{{zodExtended}}.{{parse}}({{#if param.parameterSortingEnumSchemaName}}{{zodExtended}}.{{sortingString}}({{{importedZodSchemaName param.parameterSortingEnumSchemaName}}}){{#if addOptional}}.optional(){{/if}}{{else}}{{{importedZodSchemaName param.zodSchema}}}{{#if addOptional}}.optional(){{/if}}{{/if}}, {{paramName}}{{#if isQuery}}, { type: "query", name: "{{paramName}}" }{{/if}})
|