@povio/openapi-codegen-cli 0.15.0 → 0.15.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.
Files changed (91) hide show
  1. package/dist/sh.js +1 -1
  2. package/package.json +1 -1
  3. package/dist/test/config.d.ts +0 -3
  4. /package/dist/{src/commands → commands}/check.command.d.ts +0 -0
  5. /package/dist/{src/commands → commands}/check.d.ts +0 -0
  6. /package/dist/{src/commands → commands}/generate.command.d.ts +0 -0
  7. /package/dist/{src/commands → commands}/generate.d.ts +0 -0
  8. /package/dist/{src/generators → generators}/checkOpenAPIDoc.d.ts +0 -0
  9. /package/dist/{src/generators → generators}/const/acl.const.d.ts +0 -0
  10. /package/dist/{src/generators → generators}/const/brands.const.d.ts +0 -0
  11. /package/dist/{src/generators → generators}/const/deps.const.d.ts +0 -0
  12. /package/dist/{src/generators → generators}/const/endpoints.const.d.ts +0 -0
  13. /package/dist/{src/generators → generators}/const/js.const.d.ts +0 -0
  14. /package/dist/{src/generators → generators}/const/openapi.const.d.ts +0 -0
  15. /package/dist/{src/generators → generators}/const/options.const.d.ts +0 -0
  16. /package/dist/{src/generators → generators}/const/queries.const.d.ts +0 -0
  17. /package/dist/{src/generators → generators}/const/validation.const.d.ts +0 -0
  18. /package/dist/{src/generators → generators}/const/zod.const.d.ts +0 -0
  19. /package/dist/{src/generators → generators}/core/SchemaResolver.class.d.ts +0 -0
  20. /package/dist/{src/generators → generators}/core/endpoints/getEndpointAcl.d.ts +0 -0
  21. /package/dist/{src/generators → generators}/core/endpoints/getEndpointBody.d.ts +0 -0
  22. /package/dist/{src/generators → generators}/core/endpoints/getEndpointParameter.d.ts +0 -0
  23. /package/dist/{src/generators → generators}/core/endpoints/getEndpointsFromOpenAPIDoc.d.ts +0 -0
  24. /package/dist/{src/generators → generators}/core/getDataFromOpenAPIDoc.d.ts +0 -0
  25. /package/dist/{src/generators → generators}/core/getMetadataFromOpenAPIDoc.d.ts +0 -0
  26. /package/dist/{src/generators → generators}/core/openapi/getOpenAPISchemaComplexity.d.ts +0 -0
  27. /package/dist/{src/generators → generators}/core/openapi/getOpenAPISchemaDependencyGraph.d.ts +0 -0
  28. /package/dist/{src/generators → generators}/core/openapi/getSchemaRefObjs.d.ts +0 -0
  29. /package/dist/{src/generators → generators}/core/openapi/iterateSchema.d.ts +0 -0
  30. /package/dist/{src/generators → generators}/core/zod/ZodSchema.class.d.ts +0 -0
  31. /package/dist/{src/generators → generators}/core/zod/enumExtraction/resolveExtractedEnumZodSchemaNames.d.ts +0 -0
  32. /package/dist/{src/generators → generators}/core/zod/enumExtraction/resolveExtractedEnumZodSchemaTags.d.ts +0 -0
  33. /package/dist/{src/generators → generators}/core/zod/enumExtraction/updateExtractedEnumZodSchemaData.d.ts +0 -0
  34. /package/dist/{src/generators → generators}/core/zod/getZodChain.d.ts +0 -0
  35. /package/dist/{src/generators → generators}/core/zod/getZodSchema.d.ts +0 -0
  36. /package/dist/{src/generators → generators}/core/zod/getZodSchemaRefs.d.ts +0 -0
  37. /package/dist/{src/generators → generators}/core/zod/getZodSchemasFromOpenAPIDoc.d.ts +0 -0
  38. /package/dist/{src/generators → generators}/core/zod/resolveZodSchemaName.d.ts +0 -0
  39. /package/dist/{src/generators → generators}/core/zod/sortZodSchemasByTopology.d.ts +0 -0
  40. /package/dist/{src/generators → generators}/core/zod/wrapCircularZodSchemas.d.ts +0 -0
  41. /package/dist/{src/generators → generators}/generate/generateAcl.d.ts +0 -0
  42. /package/dist/{src/generators → generators}/generate/generateAclCheck.d.ts +0 -0
  43. /package/dist/{src/generators → generators}/generate/generateAppRestClient.d.ts +0 -0
  44. /package/dist/{src/generators → generators}/generate/generateEndpoints.d.ts +0 -0
  45. /package/dist/{src/generators → generators}/generate/generateModels.d.ts +0 -0
  46. /package/dist/{src/generators → generators}/generate/generateQueries.d.ts +0 -0
  47. /package/dist/{src/generators → generators}/generate/generateQueryModules.d.ts +0 -0
  48. /package/dist/{src/generators → generators}/generate/generateZodUtils.d.ts +0 -0
  49. /package/dist/{src/generators → generators}/generateCodeFromOpenAPIDoc.d.ts +0 -0
  50. /package/dist/{src/generators → generators}/types/config.d.ts +0 -0
  51. /package/dist/{src/generators → generators}/types/generate.d.ts +0 -0
  52. /package/dist/{src/generators → generators}/types/metadata.d.ts +0 -0
  53. /package/dist/{src/generators → generators}/utils/array.utils.d.ts +0 -0
  54. /package/dist/{src/generators → generators}/utils/brand.utils.d.ts +0 -0
  55. /package/dist/{src/generators → generators}/utils/file.utils.d.ts +0 -0
  56. /package/dist/{src/generators → generators}/utils/generate/generate.acl.utils.d.ts +0 -0
  57. /package/dist/{src/generators → generators}/utils/generate/generate.endpoints.utils.d.ts +0 -0
  58. /package/dist/{src/generators → generators}/utils/generate/generate.imports.utils.d.ts +0 -0
  59. /package/dist/{src/generators → generators}/utils/generate/generate.openapi.utils.d.ts +0 -0
  60. /package/dist/{src/generators → generators}/utils/generate/generate.query.utils.d.ts +0 -0
  61. /package/dist/{src/generators → generators}/utils/generate/generate.utils.d.ts +0 -0
  62. /package/dist/{src/generators → generators}/utils/generate/generate.zod.utils.d.ts +0 -0
  63. /package/dist/{src/generators → generators}/utils/generate-files.utils.d.ts +0 -0
  64. /package/dist/{src/generators → generators}/utils/hbs/hbs-template.utils.d.ts +0 -0
  65. /package/dist/{src/generators → generators}/utils/hbs/hbs.acl.utils.d.ts +0 -0
  66. /package/dist/{src/generators → generators}/utils/hbs/hbs.common.utils.d.ts +0 -0
  67. /package/dist/{src/generators → generators}/utils/hbs/hbs.endpoints.utils.d.ts +0 -0
  68. /package/dist/{src/generators → generators}/utils/hbs/hbs.imports.utils.d.ts +0 -0
  69. /package/dist/{src/generators → generators}/utils/hbs/hbs.partials.utils.d.ts +0 -0
  70. /package/dist/{src/generators → generators}/utils/hbs/hbs.query.utils.d.ts +0 -0
  71. /package/dist/{src/generators → generators}/utils/hbs/hbs.zod.utils.d.ts +0 -0
  72. /package/dist/{src/generators → generators}/utils/js.utils.d.ts +0 -0
  73. /package/dist/{src/generators → generators}/utils/math.utils.d.ts +0 -0
  74. /package/dist/{src/generators → generators}/utils/object.utils.d.ts +0 -0
  75. /package/dist/{src/generators → generators}/utils/openapi-schema.utils.d.ts +0 -0
  76. /package/dist/{src/generators → generators}/utils/openapi.utils.d.ts +0 -0
  77. /package/dist/{src/generators → generators}/utils/operation.utils.d.ts +0 -0
  78. /package/dist/{src/generators → generators}/utils/query.utils.d.ts +0 -0
  79. /package/dist/{src/generators → generators}/utils/sort.utils.d.ts +0 -0
  80. /package/dist/{src/generators → generators}/utils/string.utils.d.ts +0 -0
  81. /package/dist/{src/generators → generators}/utils/tag.utils.d.ts +0 -0
  82. /package/dist/{src/generators → generators}/utils/ts.utils.d.ts +0 -0
  83. /package/dist/{src/generators → generators}/utils/validation.utils.d.ts +0 -0
  84. /package/dist/{src/generators → generators}/utils/zod-schema.utils.d.ts +0 -0
  85. /package/dist/{src/helpers → helpers}/chalk.helper.d.ts +0 -0
  86. /package/dist/{src/helpers → helpers}/cli.helper.d.ts +0 -0
  87. /package/dist/{src/helpers → helpers}/config.helper.d.ts +0 -0
  88. /package/dist/{src/helpers → helpers}/version.helper.d.ts +0 -0
  89. /package/dist/{src/helpers → helpers}/yargs.helper.d.ts +0 -0
  90. /package/dist/{src/index.d.ts → index.d.ts} +0 -0
  91. /package/dist/{src/sh.d.ts → sh.d.ts} +0 -0
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(Ob,"stringEncaseCRLFWithFirstIndex");var{stdout:Eb,stderr:Pb}=_b,Uf=Symbol("GENERATOR"),yo=Symbol("STYLER"),Ns=Symbol("IS_EMPTY"),xb=["ansi","ansi","ansi256","ansi16m"],bo=Object.create(null),dw=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=Eb?Eb.level:0;e.level=t.level===void 0?r:t.level},"applyOptions"),Zf=class Zf{constructor(t){return $b(t)}};o(Zf,"Chalk");var Tc=Zf,$b=o(e=>{let t=o((...r)=>r.join(" "),"chalk");return dw(t,e),Object.setPrototypeOf(t,js.prototype),t},"chalkFactory");function js(e){return $b(e)}o(js,"createChalk");Object.setPrototypeOf(js.prototype,Function.prototype);for(let[e,t]of Object.entries(Pr))bo[e]={get(){let r=Rc(this,zf(t.open,t.close,this[yo]),this[Ns]);return Object.defineProperty(this,e,{value:r}),r}};bo.visible={get(){let e=Rc(this,this[yo],!0);return Object.defineProperty(this,"visible",{value:e}),e}};var Gf=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"?Gf("rgb",t,r,...Pr.hexToRgb(...n)):Pr[r][e](...n),"getModelAnsi"),hw=["rgb","hex","ansi256"];for(let e of hw){bo[e]={get(){let{level:r}=this;return function(...n){let i=zf(Gf(e,xb[r],"color",...n),Pr.color.close,this[yo]);return Rc(this,i,this[Ns])}}};let t="bg"+e[0].toUpperCase()+e.slice(1);bo[t]={get(){let{level:r}=this;return function(...n){let i=zf(Gf(e,xb[r],"bgColor",...n),Pr.bgColor.close,this[yo]);return Rc(this,i,this[Ns])}}}}var mw=Object.defineProperties(()=>{},{...bo,level:{enumerable:!0,get(){return this[Uf].level},set(e){this[Uf].level=e}}}),zf=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"),Rc=o((e,t,r)=>{let n=o((...i)=>gw(n,i.length===1?""+i[0]:i.join(" ")),"builder");return Object.setPrototypeOf(n,mw),n[Uf]=e,n[yo]=t,n[Ns]=r,n},"createBuilder"),gw=o((e,t)=>{if(e.level<=0||!t)return e[Ns]?"":t;let r=e[yo];if(r===void 0)return t;let{openAll:n,closeAll:i}=r;if(t.includes("\x1B"))for(;r!==void 0;)t=Sb(t,r.close,r.open),r=r.parent;let s=t.indexOf(`
140
- `);return s!==-1&&(t=Ob(t,i,n,s)),n+t+i},"applyStyle");Object.defineProperties(js.prototype,bo);var h6=js(),m6=js({level:Pb?Pb.level:0});var Cn=new Tc;function Wf(e){console.log(e)}o(Wf,"log");function Ft(e){console.log(`[INFO] ${e}`)}o(Ft,"logInfo");function Ms(e){console.log(Cn.green(`[SUCCESS] ${e}`))}o(Ms,"logSuccess");function xi(e,t){e instanceof Error?console.log(Cn.red(`[ERROR] ${t||e.message}`)):console.log(Cn.red(`[ERROR] ${e}`))}o(xi,"logError");function Nc(e){console.log(Cn.bgYellow(`==== ${e} ====`))}o(Nc,"logBanner");var wb=at(require("fs"));function vo(){return"0.15.0"}o(vo,"getVersion");var A6=at(Ib());var Kf=Symbol("options_key");function be(e){return(t,r)=>{var n,i;if(e!=null){let s={...Reflect.getMetadata(Kf,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(Kf,s,t)}}}o(be,"YargOption");function Cb(e){let t=Reflect.getMetadata(Kf,e.prototype);if(!t)throw new Error(`Options for ${e.name} were not defined`);return t}o(Cb,"getYargsOption");function jc(e){return async t=>t.options(yw(e)).middleware(async r=>await bw(e,r),!0)}o(jc,"getBuilder");function yw(e){return Object.entries(Cb(e)).reduce((t,[r,n])=>(t[r]=Object.fromEntries(Object.entries(n).filter(([i])=>!["envAlias","default"].includes(i))),t),{})}o(yw,"getYargsOptions");async function bw(e,t){let r=new e;for(let[n,i]of Object.entries(Cb(e)))r[n]=t[n]??i.default;return r}o(bw,"loadYargsConfig");var Kx=at(Lm());var oP={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"},sP={"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"},aP={bindings:[kr.query,kr.infiniteQuery,kr.mutation],from:"@tanstack/react-query"},$a={pageParamName:"page"},Fu={pageParamName:"page",totalItemsName:"totalItems",limitParamName:"limit"},wa="moduleName";var Fm={"Content-Type":"application/json",Accept:"application/json"},Hu="data",Hm="axios",Zn="config",Xr="AxiosRequestConfig",Bu={defaultImport:Hm,bindings:[Xr],from:"axios"};var cP=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 $e(e){return e!=null&&Object.prototype.hasOwnProperty.call(e,"$ref")}o($e,"isReferenceObject");function it(e){return!$e(e)}o(it,"isSchemaObject");function Vu(e){return e.type==="array"}o(Vu,"isArraySchemaObject");function uP(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(dD(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($e(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(uP,"inferRequiredSchema");var dD=o(e=>!$e(e)&&!!e.required&&!e.type&&!e.properties&&!(e!=null&&e.allOf)&&!(e!=null&&e.anyOf)&&!e.oneOf,"isBrokenAllOfItem");var bn=Symbol.for("@ts-pattern/matcher"),hD=Symbol.for("@ts-pattern/isVariadic"),Gu="@ts-pattern/anonymous-select-key",Bm=o(e=>!!(e&&typeof e=="object"),"r"),Uu=o(e=>e&&!!e[bn],"i"),rn=o((e,t,r)=>{if(Uu(e)){let n=e[bn](),{matched:i,selections:s}=n.match(t);return i&&s&&Object.keys(s).forEach(a=>r(a,s[a])),i}if(Bm(e)){if(!Bm(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];Uu(c)&&c[hD]?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)=>rn(l,a[p],r))&&i.every((l,p)=>rn(l,c[p],r))&&(s.length===0||rn(s[0],u,r))}return e.length===t.length&&e.every((a,c)=>rn(a,t[c],r))}return Reflect.ownKeys(e).every(n=>{let i=e[n];return(n in t||Uu(s=i)&&s[bn]().matcherType==="optional")&&rn(i,t[n],r);var s})}return Object.is(t,e)},"s"),Xn=o(e=>{var t,r,n;return Bm(e)?Uu(e)?(t=(r=(n=e[bn]()).getSelectionKeys)==null?void 0:r.call(n))!=null?t:[]:Array.isArray(e)?Ia(e,Xn):Ia(Object.values(e),Xn):[]},"o"),Ia=o((e,t)=>e.reduce((r,n)=>r.concat(t(n)),[]),"c");function gr(e){return Object.assign(e,{optional:o(()=>mD(e),"optional"),and:o(t=>Ge(e,t),"and"),or:o(t=>gD(e,t),"or"),select:o(t=>t===void 0?lP(e):lP(t,e),"select")})}o(gr,"u");function mD(e){return gr({[bn]:()=>({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:rn(e,t,n),selections:r}},"match"),getSelectionKeys:o(()=>Xn(e),"getSelectionKeys"),matcherType:"optional"})})}o(mD,"h");function Ge(...e){return gr({[bn]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return{matched:e.every(i=>rn(i,t,n)),selections:r}},"match"),getSelectionKeys:o(()=>Ia(e,Xn),"getSelectionKeys"),matcherType:"and"})})}o(Ge,"m");function gD(...e){return gr({[bn]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return Ia(e,Xn).forEach(i=>n(i,void 0)),{matched:e.some(i=>rn(i,t,n)),selections:r}},"match"),getSelectionKeys:o(()=>Ia(e,Xn),"getSelectionKeys"),matcherType:"or"})})}o(gD,"d");function Pe(e){return{[bn]:()=>({match:o(t=>({matched:!!e(t)}),"match")})}}o(Pe,"p");function lP(...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 gr({[bn]:()=>({match:o(n=>{let i={[t??Gu]:n};return{matched:r===void 0||rn(r,n,(s,a)=>{i[s]=a}),selections:i}},"match"),getSelectionKeys:o(()=>[t??Gu].concat(r===void 0?[]:Xn(r)),"getSelectionKeys")})})}o(lP,"y");function en(e){return typeof e=="number"}o(en,"v");function Kn(e){return typeof e=="string"}o(Kn,"b");function Yn(e){return typeof e=="bigint"}o(Yn,"w");var ZU=gr(Pe(function(e){return!0}));var Qn=o(e=>Object.assign(gr(e),{startsWith:o(t=>{return Qn(Ge(e,(r=t,Pe(n=>Kn(n)&&n.startsWith(r)))));var r},"startsWith"),endsWith:o(t=>{return Qn(Ge(e,(r=t,Pe(n=>Kn(n)&&n.endsWith(r)))));var r},"endsWith"),minLength:o(t=>Qn(Ge(e,(r=>Pe(n=>Kn(n)&&n.length>=r))(t))),"minLength"),length:o(t=>Qn(Ge(e,(r=>Pe(n=>Kn(n)&&n.length===r))(t))),"length"),maxLength:o(t=>Qn(Ge(e,(r=>Pe(n=>Kn(n)&&n.length<=r))(t))),"maxLength"),includes:o(t=>{return Qn(Ge(e,(r=t,Pe(n=>Kn(n)&&n.includes(r)))));var r},"includes"),regex:o(t=>{return Qn(Ge(e,(r=t,Pe(n=>Kn(n)&&!!n.match(r)))));var r},"regex")}),"j"),WU=Qn(Pe(Kn)),tn=o(e=>Object.assign(gr(e),{between:o((t,r)=>tn(Ge(e,((n,i)=>Pe(s=>en(s)&&n<=s&&i>=s))(t,r))),"between"),lt:o(t=>tn(Ge(e,(r=>Pe(n=>en(n)&&n<r))(t))),"lt"),gt:o(t=>tn(Ge(e,(r=>Pe(n=>en(n)&&n>r))(t))),"gt"),lte:o(t=>tn(Ge(e,(r=>Pe(n=>en(n)&&n<=r))(t))),"lte"),gte:o(t=>tn(Ge(e,(r=>Pe(n=>en(n)&&n>=r))(t))),"gte"),int:o(()=>tn(Ge(e,Pe(t=>en(t)&&Number.isInteger(t)))),"int"),finite:o(()=>tn(Ge(e,Pe(t=>en(t)&&Number.isFinite(t)))),"finite"),positive:o(()=>tn(Ge(e,Pe(t=>en(t)&&t>0))),"positive"),negative:o(()=>tn(Ge(e,Pe(t=>en(t)&&t<0))),"negative")}),"x"),KU=tn(Pe(en)),Jn=o(e=>Object.assign(gr(e),{between:o((t,r)=>Jn(Ge(e,((n,i)=>Pe(s=>Yn(s)&&n<=s&&i>=s))(t,r))),"between"),lt:o(t=>Jn(Ge(e,(r=>Pe(n=>Yn(n)&&n<r))(t))),"lt"),gt:o(t=>Jn(Ge(e,(r=>Pe(n=>Yn(n)&&n>r))(t))),"gt"),lte:o(t=>Jn(Ge(e,(r=>Pe(n=>Yn(n)&&n<=r))(t))),"lte"),gte:o(t=>Jn(Ge(e,(r=>Pe(n=>Yn(n)&&n>=r))(t))),"gte"),positive:o(()=>Jn(Ge(e,Pe(t=>Yn(t)&&t>0))),"positive"),negative:o(()=>Jn(Ge(e,Pe(t=>Yn(t)&&t<0))),"negative")}),"A"),YU=Jn(Pe(Yn)),QU=gr(Pe(function(e){return typeof e=="boolean"})),JU=gr(Pe(function(e){return typeof e=="symbol"})),XU=gr(Pe(function(e){return e==null})),eG=gr(Pe(function(e){return e!=null}));var zm=class zm 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(zm,"W");var Vm=zm,Um={matched:!1,value:void 0};function wt(e){return new Gm(e,Um)}o(wt,"z");var Aa=class Aa{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=>rn(l,this.input,c))||i&&!i(this.input)?Um:{matched:!0,value:r(s?Gu in a?a[Gu]:a:this.input,this.input)};return new Aa(this.input,u)}when(t,r){if(this.state.matched)return this;let n=!!t(this.input);return new Aa(this.input,n?{matched:!0,value:r(this.input,this.input)}:Um)}otherwise(t){return this.state.matched?this.state.value:t(this.input)}exhaustive(){if(this.state.matched)return this.state.value;throw new Vm(this.input)}run(){return this.exhaustive()}returnType(){return this}};o(Aa,"I");var Gm=Aa;var Zm=2,fP=["application/octet-stream","multipart/form-data","application/x-www-form-urlencoded","*/*"],pP=["query","header","path"],Zi=["get","put","post","delete","options","head","patch","trace"],dP=["string","number","integer","boolean"],Ca=["allOf","anyOf","oneOf"];var Te=o(e=>e.charAt(0).toUpperCase()+e.slice(1),"capitalize"),ei=o(e=>e.charAt(0).toLowerCase()+e.slice(1),"decapitalize"),hP=o(e=>e.replace(/(-\w)/g,t=>t[1].toUpperCase()),"kebabToCamel"),dt=o(e=>e.replace(/(_\w)/g,t=>t[1].toUpperCase()),"snakeToCamel"),mP=o(e=>e.replace(/[\W_]+(\w)?/g,(t,r)=>(r==null?void 0:r.toUpperCase())??""),"nonWordCharactersToCamel"),Wm=o((e,t="")=>e.endsWith(t)?e:`${e}${t}`,"suffixIfNeeded"),gP=o((e,t)=>e.replace(new RegExp(`${t}$`),""),"removeSuffix"),yD=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"),Km=o(e=>{let t=e.map(Te).map(yP).map(r=>bD(r)).flat();return yD(t)},"getMostCommonAdjacentCombinationSplit"),yP=o(e=>e.split(/(?<![A-Z])(?=[A-Z])/).filter(Boolean),"splitByUppercase"),bP=o(e=>yP(e).join(" "),"camelToSpaceSeparated"),bD=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"),vP=o((e,t)=>{let r=t.replace(/es$|s$/g,""),n=new RegExp(`(${ei(r)}|${Te(r)})[a-z]*(?=$|[A-Z])`,"g");return e.replace(n,"")},"removeWord");var SP=o(e=>`#/components/schemas/${e}`,"getSchemaRef"),Wi=o(e=>e[1]==="/"?e:"#/"+e.slice(1),"autocorrectRef"),is=o(e=>Wi(e).split("/").at(-1),"getSchemaNameByRef");function Qm(e){let t=vD(e).normalize("NFKD").trim().replace(/\s+/g,"_").replace(/--+/g,"-").replace(/-+/g,"_").replace(/[^\w-]+/g,"_");return dt(t)}o(Qm,"normalizeString");function OP(e){return/^[a-zA-Z]\w*$/.test(e)?e:`"${e}"`}o(OP,"wrapWithQuotesIfNeeded");function EP(e){return typeof e=="string"&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}o(EP,"unwrapQuotesIfNeeded");function vD(e){let t=Number(e[0]);return typeof t=="number"&&!Number.isNaN(t)?"_"+e:e}o(vD,"prefixStringStartingWithNumberIfNeeded");function Jm(e){let t=e.replaceAll("_","#");return dt(t.replaceAll("-","_")).replaceAll("#","_")}o(Jm,"pathParamToVariableName");var nn=o(e=>dP.includes(e),"isPrimitiveType");function PP(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(PP,"escapeControlCharacters");function on(e){return e.includes("application/")&&e.includes("json")||fP.includes(e)||e.includes("text/")}o(on,"isParamMediaTypeAllowed");function Ta(e){return e>=200&&e<300}o(Ta,"isMainResponseStatus");function zu(e){return!(e>=200&&e<300)}o(zu,"isErrorStatus");function Zu(e){return e.startsWith("application/")}o(Zu,"isMediaTypeAllowed");var _P=/({\w+})/g,_D=/[^\w\-]+/g;function xP(e){e=Te(hP(e.replaceAll("/","-")).replaceAll("-",""));let t=[...e.matchAll(_P)];if(t.length>0){let r=t.sort((n,i)=>n.index-i.index)[t.length-1][0];e=`${e.replace(_P,"")}By${Te(r.slice(1,-1))}`}return e.replace(_D,"_")}o(xP,"pathToVariableName");var Ym=/{(\b\w+(?:-\w+)*\b)}/g;function $P(e){let t=e.match(Ym);return t===null?e.replaceAll(Ym,":$1"):(t.forEach(r=>{let n=Jm(r.replaceAll(Ym,":$1"));e=e.replaceAll(r,n)}),e)}o($P,"replaceHyphenatedPath");var wP=o(e=>{let t=e["x-enumNames"],r=Array.isArray(t)&&t.length>0,n=!!e.schema&&it(e.schema)&&e.schema.type==="string";return r&&n},"isSortingParameterObject"),Ki=o((e,t)=>t.excludePathRegex?new RegExp(t.excludePathRegex).test(e):!1,"isPathExcluded");var Xt=o(e=>e.method==="get","isQuery"),ri=o(e=>e.method!=="get"||!!e.mediaDownload,"isMutation"),os=o((e,t)=>Xt(e)&&(t??Object.values($a)).every(r=>e.parameters.some(n=>n.name===r&&n.type==="Query")),"isInfiniteQuery"),AP=o((e,t,r)=>{let n=r.reduce((i,s)=>[...i,...ti(e,s,{includeOnlyRequiredParams:!0}).map(a=>a.name)],[]);return ti(e,t,{includeOnlyRequiredParams:!0,excludeBodyParam:!0}).filter(i=>n.includes(i.name)).map(i=>i.name)},"getDestructuredVariables");function ni(e){return mP(e)}o(ni,"formatTag");function ii(e,t){var n;let r=(n=e.tags)==null?void 0:n[0];return ni(r??t.defaultTag)}o(ii,"getOperationTag");function IP(e,t){return t.excludeTags.some(r=>r.toLowerCase()===e.toLowerCase())}o(IP,"isTagExcluded");var Wu={fileName:"acl/app.ability",extension:"ts"},Ra="AllAbilities",Na="AppAbilities",Ku={fileName:"acl/useAclCheck",extension:"ts"},oi="useAclCheck",At={abilityTuple:"AbilityTuple",pureAbility:"PureAbility",forcedSubject:"ForcedSubject",subjectType:"Subject",subject:"subject"},Xm={bindings:[At.abilityTuple,At.pureAbility,At.forcedSubject,At.subjectType,At.subject],from:"@casl/ability"};var ja="AppRestClient",Yu={query:"AppQueryOptions",infiniteQuery:"AppInfiniteQueryOptions",mutation:"AppMutationOptions"},eg="src/data",tg="@/data",yr={appRestClient:{template:"@/util/rest/clients/app-rest-client",monorepoTemplate:"@/clients/app-rest-client"},queryTypes:{template:"@/types/react-query",monorepoTemplate:"@povio/utils/types/react-query"},errorHandling:{template:"@/util/vendor/error-handling",monorepoTemplate:"@povio/utils/utils/vendor/error-handling"},abilityContext:{template:"@/data/acl/ability.context",monorepoTemplate:"@povio/auth/acl/ability.context"}},si={ErrorHandler:"ErrorHandler",SharedErrorHandler:"SharedErrorHandler"},Qu={bindings:[si.ErrorHandler,si.SharedErrorHandler],from:yr.errorHandling.template},rg="AbilityContext",CP={bindings:[rg],from:yr.abilityContext.template};var Ju={reactQueryTypes:{fileName:"react-query.types",extension:"ts"},restClient:{fileName:"rest-client",extension:"ts"},restInterceptor:{fileName:"rest-interceptor",extension:"ts"}},Xu={fileName:"app-rest-client",extension:"ts"},ng="QueryModule",el={fileName:"queryModules",extension:"ts"},TP={fileName:"queryConfig.context",extension:"tsx"},ss={optionsType:"MutationEffectsOptions",hookName:"useMutationEffects",runFunctionName:"runMutationEffects"},tl={fileName:"useMutationEffects",extension:"ts"},ht={namespace:"ZodUtils",exports:{parse:"parse",sortExp:"sortExp",brand:"brand"}},rl={fileName:"zod.utils",extension:"ts"};var er=o((...e)=>[...new Set(e.flat())],"getUniqueArray");var RP=o(e=>`Use${Te(dt(e.operationName))}Ability`,"getAbilityTypeName"),Ma=o(e=>`canUse${Te(dt(e.operationName))}`,"getAbilityFunctionName"),NP=o((e,t)=>`${t.tsNamespaces?`${He({type:"acl",tag:ai(e,t),options:t})}.`:""}${Ma(e)}`,"getImportedAbilityFunctionName"),jP=o(e=>{var t;return(t=e.acl)==null?void 0:t[0].action},"getAbilityAction"),MP=o(e=>{var t;return(t=e.acl)==null?void 0:t[0].subject},"getAbilitySubject"),nl=o(e=>{var t;return!!((t=ka(e))!=null&&t.length)},"hasAbilityConditions"),ka=o(e=>{var t;return(t=e.acl)==null?void 0:t[0].conditionsTypes},"getAbilityConditionsTypes"),kP=o(e=>{var t;return(t=e.acl)==null?void 0:t[0].description},"getAbilityDescription"),il=o(e=>`${Te(e)}${Ra}`,"getTagAllAbilitiesName");var qP="Schema",DP="Enum",LP="Body",FP="Param",HP="Response",BP="ErrorResponse",qa="z.void()",ol="z.instanceof(Blob)",Da="z.enum",sl="z.string()",as={bindings:["z"],from:"zod"};function vt(e,t){if(!e)return;let{data:r,onSchema:n}=t;if($e(e)&&n({type:"reference",schema:e,data:r})===!0)return;let i=e;if(Ca.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&&vt(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&&vt(a,t);if(i.additionalProperties&&typeof i.additionalProperties=="object"){if(n({type:"additionalProperties",parentSchema:e,schema:i.additionalProperties,data:r})===!0)return;vt(i.additionalProperties,t)}if(i.type==="array"){let s=e.items;if(n({type:"array",parentSchema:e,schema:s,data:r})===!0)return;vt(s,t)}}o(vt,"iterateSchema");var sn=o((e,t)=>Wm(Te(Qm(e)),t),"getZodSchemaName"),La=o((e,t,r)=>Wm(Te(Qm(e)),`${t}${r}`),"getEnumZodSchemaName"),It=o(e=>["z.",`${ht.namespace}.`].every(t=>!e.startsWith(t)),"isNamedZodSchema"),VP=o(e=>e.startsWith(Da),"isEnumZodSchema"),Yi=o((e,t,r)=>t?e:`${r}_${e}`,"getZodSchemaOperationName"),al=o(e=>dt(`${e}_${LP}`),"getBodyZodSchemaName"),UP=o((e,t)=>dt(`${e}_${t}${FP}`),"getParamZodSchemaName"),SD=o(e=>dt(`${e}${HP}`),"getMainResponseZodSchemaName"),OD=o((e,t)=>dt(`${e}_${t}_${BP}`),"getErrorResponseZodSchemaName");function cl({statusCode:e,operationName:t,isUniqueOperationName:r,tag:n}){let i=Number(e),s=Yi(t,r,n);return!Ta(i)&&e!=="default"&&zu(i)?OD(s,e):SD(s)}o(cl,"getResponseZodSchemaName");function Fa(e){return["minimum","exclusiveMinimum","maximum","exclusiveMaximum","minItems","minLength","minProperties","maxItems","maxLength","maxProperties","default","example"].filter(n=>e[n]).reduce((n,i)=>[...n,`${Te(bP(i))}: \`${e[i]}\``],[])}o(Fa,"getSchemaDescriptions");var Ha=o((e,t)=>gP(e,t.schemaSuffix),"getZodSchemaInferedTypeName"),GP=o((e,t)=>It(t)?`${e.options.tsNamespaces?`${He({type:"models",tag:e.getTagByZodSchemaName(t),options:e.options})}.`:""}${t}`:t,"getImportedZodSchemaName"),Qi=o((e,t,r)=>{if(!It(t))return t===qa?"void":t;let n=e.getTagByZodSchemaName(t);return`${e.options.tsNamespaces&&n!==r?`${He({type:"models",tag:n,options:e.options})}.`:""}${Ha(t,e.options)}`},"getImportedZodSchemaInferedTypeName");function zP(e){var t;return e.isEnum?"enum":((t=e.schemaObj)==null?void 0:t.type)??"object"}o(zP,"getZodSchemaType");function ZP(e){if(e.schemaObj)return[e.schemaObj.description,...Fa(e.schemaObj)].filter(Boolean).join(". ")}o(ZP,"getZodSchemaDescription");function WP(e,t,r){var n;if($e(t)){let i=e.getZodSchemaNameByRef(t.$ref);return i?Qi(e,i,r):void 0}if(Vu(t)){if(!$e(t.items))return`${((n=t.items)==null?void 0:n.type)??"unknown"}[]`;let i=e.getZodSchemaNameByRef(t.items.$ref);return i?`${Qi(e,i,r)}[]`:void 0}if(Ca.some(i=>i in t&&t[i])){let i=t.allOf??t.anyOf??t.oneOf??[];if(i.length>0)return WP(e,i[0],r)}return t.type}o(WP,"getType");function KP(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,...Fa(p)].filter(Boolean),d=u.join(".");s[d]&&"type"in c.schema&&c.schema.type==="object"||(delete s[d],s[d]={type:WP(e,c.schema,r)??"unknown",description:f.join(". ")})}return vt(c.schema,{data:{pathSegments:[...u]},onSchema:a}),!0},"onSchema");return"allOf"in t.schemaObj&&t.schemaObj.allOf&&t.schemaObj.allOf.forEach(c=>{if($e(c)){let u=e.resolveObject(c);vt(u,{data:{pathSegments:[]},onSchema:a})}}),vt(t.schemaObj,{data:{pathSegments:[]},onSchema:a}),s}o(KP,"getZodSchemaPropertyDescriptions");function ci({resolver:e,tag:t,zodSchemas:r=[],zodSchemasAsTypes:n=[]}){let i="models",s=o(u=>e.getTagByZodSchemaName(u),"getTag"),a=ul({type:i,tag:t,entities:r,getTag:s,getEntityName:o(u=>u,"getEntityName"),options:e.options}),c=ul({type:i,tag:t,entities:n,getTag:s,getEntityName:o(u=>Ha(u,e.options),"getEntityName"),options:e.options});return ED(e.options,a,c)}o(ci,"getModelsImports");function YP({tag:e,endpoints:t,options:r}){return ul({type:"endpoints",tag:e,entities:t,getTag:o(n=>ai(n,r),"getTag"),getEntityName:Ba,options:r})}o(YP,"getEndpointsImports");function QP({tag:e,endpoints:t,options:r}){return ul({type:"acl",tag:e,entities:t,getTag:o(n=>ai(n,r),"getTag"),getEntityName:Ma,options:r})}o(QP,"getAclImports");function JP({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)}${ll({type:n,tag:a,includeTagDir:!0,options:i})}`})}),Array.from(s.values())}o(JP,"getEntityImports");function an(e){let t=tg;return e.importPath==="relative"?t="../":e.importPath==="absolute"?t=e.output:new RegExp(`${eg}`,"g").test(e.output)&&(t=e.output.replace(new RegExp(`.*${eg}`,"g"),tg)),`${t}/`.replace(/\/\//g,"/")}o(an,"getImportPath");function ul({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)}${ll({type:e,tag:u,includeTagDir:!l,options:s})}`})}}),Array.from(a.values())}o(ul,"getImports");function ED(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:er(n.bindings)}))}o(ED,"mergeImports");function Ji({fileName:e,extension:t}){return`${e}.${t}`}o(Ji,"getFileNameWithExtension");function XP({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(XP,"getTagFileNameWithoutExtension");function ll(...e){return XP(...e)}o(ll,"getTagImportPath");function fl(...e){return`${XP(...e)}.ts`}o(fl,"getTagFileName");var He=o(({type:e,tag:t,options:r})=>`${Te(t)}${r.configs[e].namespaceSuffix}`,"getNamespaceName");function ex(e){return e.standalone?`${an(e)}${Xu.fileName}`:e.restClientImportPath}o(ex,"getAppRestClientImportPath");function tx(e){return e.standalone?`${an(e)}${Ju.reactQueryTypes.fileName}`:e.queryTypesImportPath}o(tx,"getQueryTypesImportPath");function rx(e){return`${an(e)}${el.fileName}`}o(rx,"getQueryModulesImportPath");function nx(e){return`${an(e)}${tl.fileName}`}o(nx,"getMutationEffectsImportPath");function ix(e){return`${an(e)}${Ku.fileName}`}o(ix,"getAclCheckImportPath");function pl(e){return`${an(e)}${rl.fileName}`}o(pl,"getZodUtilsImportPath");function ox(e){return`${an(e)}${Wu.fileName}`}o(ox,"getAppAbilitiesImportPath");function sx(e){return wt(e).with("string",()=>"string").with("number",()=>"number").with("integer",()=>"number").with("boolean",()=>"boolean").exhaustive()}o(sx,"primitiveTypeToTsType");var Ba=o(e=>ei(dt(e.operationName)),"getEndpointName");function ax(e,t){return`${t.tsNamespaces?`${He({type:"endpoints",tag:ai(e,t),options:t})}.`:""}${Ba(e)}`}o(ax,"getImportedEndpointName");var cx=o(e=>e.path.replace(/:([a-zA-Z0-9_]+)/g,"${$1}"),"getEndpointPath");function ai(e,t){var n;let r=t.splitByTags?(n=e.tags)==null?void 0:n[0]:t.defaultTag;return ni(r??t.defaultTag)}o(ai,"getEndpointTag");function ti(e,t,r){let n=t.parameters.map(i=>{var a,c,u,l;let s="string";if(It(i.zodSchema))s=Qi(e,i.zodSchema);else if((a=i.parameterObject)!=null&&a.schema&&it(i.parameterObject.schema)){let p=(u=(c=i.parameterObject)==null?void 0:c.schema)==null?void 0:u.type;p&&nn(p)&&(s=sx(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!==Hu)&&(!(r!=null&&r.excludePageParam)||i.name!==$a.pageParamName)&&(!(r!=null&&r.includeOnlyRequiredParams)||i.required)).map(i=>({...i,name:r!=null&&r.replacePageParam&&i.name===$a.pageParamName?"pageParam":i.name,required:i.required&&(i.paramType==="Path"||!(r!=null&&r.pathParamsRequiredOnly))}))}o(ti,"mapEndpointParamsToFunctionParams");function ux(e){let t=e.parameters.filter(i=>i.type==="Query").map(i=>{let s=cP(i.name)?i.name:`"${i.name}"`,a=Wn(i.name);return{...i,name:s,value:a}}),r={};return e.requestFormat!==Fm["Content-Type"]&&(r["Content-Type"]=`'${e.requestFormat}'`),e.responseFormat&&e.responseFormat!==Fm.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(ux,"getEndpointConfig");function lx(e,t){return t.filter(r=>Xt(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(lx,"getUpdateQueryEndpoints");var ig=["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 Xi(e,t){let r={};return Object.keys(e).forEach(n=>{t.includes(n)&&(r[n]=e[n])}),r}o(Xi,"pick");function dl(e,...t){if(t.length===0)return e;let r=e;for(let n of t)r=fx(r,n);return r}o(dl,"deepMerge");function fx(e,t){if(t==null)return e;if(e==null)return cs(t);if(Array.isArray(e)&&Array.isArray(t))return[...e,...t];if(Va(e)&&Va(t)){let r={};for(let[n,i]of Object.entries(e))r[n]=cs(i);for(let[n,i]of Object.entries(t)){let s=r[n];i!==void 0&&(i===null?r[n]=i:Va(s)&&Va(i)?r[n]=fx(s,i):Array.isArray(s)&&Array.isArray(i)?r[n]=[...s,...i]:r[n]=cs(i))}return r}return cs(t)}o(fx,"mergeTwoValues");function cs(e){if(e==null||typeof e!="object")return e;if(Array.isArray(e))return e.map(t=>cs(t));if(Va(e)){let t={};for(let[r,n]of Object.entries(e))t[r]=cs(n);return t}return e}o(cs,"deepClone");function Va(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)&&Object.prototype.toString.call(e)==="[object Object]"}o(Va,"isPlainObject");function us(e,t){let r=e.deprecated&&!t.withDeprecatedEndpoints,n=ii(e,t),i=IP(n,t);return r||i}o(us,"isOperationExcluded");function og({path:e,method:t,operation:r,options:n,tag:i,keepOperationTag:s,keepOperationPrefix:a}){let c=`${t}${xP(e)}`,u=r.operationId?Wn(r.operationId):c;if(n.removeOperationPrefixEndingWith&&a)u=u.split(n.removeOperationPrefixEndingWith).map((p,f)=>f===0?p:Te(p)).join("");else if(n.removeOperationPrefixEndingWith&&!a){let l=new RegExp(`^.*${n.removeOperationPrefixEndingWith}`);u=u.replace(l,"")}if(n.tsNamespaces&&!s){let l=vP(u,i);l===""?u=t.toLowerCase():ig.includes(l)||(u=l)}return ig.includes(u)?c:u}o(og,"getOperationName");function Ua({operationsByTag:e,...t}){let{operation:r,options:n}=t,i=n.splitByTags?ii(r,n):n.defaultTag,s=o(a=>{let c=og({...t,tag:i,keepOperationTag:a});if(e[i].filter(l=>og({...t,operation:l,tag:i,keepOperationTag:a})===c).length===1)return c},"operationName");return s()??s(!0)??og({...t,tag:i,keepOperationTag:!0,keepOperationPrefix:!0})}o(Ua,"getUniqueOperationName");function px(e,t,r){let n=[];for(let i in e.paths){if(Ki(i,r))continue;let s=e.paths[i],a=Xi(s,Zi);for(let c in a){let u=a[c];if(!u||us(u,r))continue;let l=Ua({path:i,method:c,operation:u,operationsByTag:t,options:r});n.push(l)}}return n}o(px,"getUniqueOperationNamesWithoutSplitByTags");function dx(e,t){let r={};for(let n in e.paths){if(Ki(n,t))continue;let i=e.paths[n],s=Xi(i,Zi);for(let a in s){let c=s[a];if(!c||us(c,t))continue;let u=t.splitByTags?ii(c,t):t.defaultTag;r[u]||(r[u]=[]),r[u].push(c)}}return r}o(dx,"getOperationsByTag");function Ga(e){return{type:"invalid-schema",message:e}}o(Ga,"getInvalidSchemaError");function hx(e){return{type:"invalid-operation-id",message:`Operation ${e}`}}o(hx,"getInvalidOperationIdError");function mx(e,t){return{type:"missing-path-parameter",message:`Path ${t} is missing [${e.map(({name:r})=>r).join(", ")}]`}}o(mx,"getMissingPathParameterError");function gx(e){return{type:"not-allowed-inline-enum",message:`${e} is missing @IsEnum() and @ApiProperty(enum:, enumName:)`}}o(gx,"getNotAllowedInlineEnumError");function yx(e){return{type:"not-allowed-circular-schema",message:e}}o(yx,"getNotAllowedCircularSchemaError");function bx(e,t,r){return{type:"missing-acl-condition-property",message:`Condition property ${e} is not found in parameters or body in operation ${ml(t,r)}`}}o(bx,"getMissingAclConditionPropertyError");function sg(e,t,r){return{type:"missing-status-code",message:`Missing HTTP status code ${hl(e)} in operation ${ml(t,r)}`}}o(sg,"getMissingStatusCodeError");function vx(e,t,r){return{type:"invalid-status-code",message:`Operation ${ml(t,r)} expected HTTP status code ${hl(e.expected)} but received ${hl(e.received)}`}}o(vx,"getInvalidStatusCodeError");function _x(e,t,r){return{type:"multiple-success-status-codes",message:`Operation ${ml(t,r)} has multiple success HTTP status codes: ${e.map(hl).join(", ")}`}}o(_x,"getMultipleSuccessStatusCodesError");function ml(e,t){return e.operationId??`${t.method} ${t.path}`}o(ml,"getOperationDescriptor");function hl(e){return`${e} (${oP[e]})`}o(hl,"getStatusCodeDescription");function Sx(e){return e.reduce((t,r)=>({...t,[r.type]:[...t[r.type]??[],r.message]}),{})}o(Sx,"groupByType");function cn({schema:e,meta:t,options:r}){let n=[];wt(e.type).with("string",()=>n.push($D(e))).with("number","integer",()=>n.push(AD(e))).with("array",()=>n.push(ID(e))).otherwise(()=>{}),typeof e.description=="string"&&e.description!==""&&r.withDescription&&([`
140
+ `);return s!==-1&&(t=Ob(t,i,n,s)),n+t+i},"applyStyle");Object.defineProperties(js.prototype,bo);var h6=js(),m6=js({level:Pb?Pb.level:0});var Cn=new Tc;function Wf(e){console.log(e)}o(Wf,"log");function Ft(e){console.log(`[INFO] ${e}`)}o(Ft,"logInfo");function Ms(e){console.log(Cn.green(`[SUCCESS] ${e}`))}o(Ms,"logSuccess");function xi(e,t){e instanceof Error?console.log(Cn.red(`[ERROR] ${t||e.message}`)):console.log(Cn.red(`[ERROR] ${e}`))}o(xi,"logError");function Nc(e){console.log(Cn.bgYellow(`==== ${e} ====`))}o(Nc,"logBanner");var wb=at(require("fs"));function vo(){return"0.15.1"}o(vo,"getVersion");var A6=at(Ib());var Kf=Symbol("options_key");function be(e){return(t,r)=>{var n,i;if(e!=null){let s={...Reflect.getMetadata(Kf,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(Kf,s,t)}}}o(be,"YargOption");function Cb(e){let t=Reflect.getMetadata(Kf,e.prototype);if(!t)throw new Error(`Options for ${e.name} were not defined`);return t}o(Cb,"getYargsOption");function jc(e){return async t=>t.options(yw(e)).middleware(async r=>await bw(e,r),!0)}o(jc,"getBuilder");function yw(e){return Object.entries(Cb(e)).reduce((t,[r,n])=>(t[r]=Object.fromEntries(Object.entries(n).filter(([i])=>!["envAlias","default"].includes(i))),t),{})}o(yw,"getYargsOptions");async function bw(e,t){let r=new e;for(let[n,i]of Object.entries(Cb(e)))r[n]=t[n]??i.default;return r}o(bw,"loadYargsConfig");var Kx=at(Lm());var oP={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"},sP={"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"},aP={bindings:[kr.query,kr.infiniteQuery,kr.mutation],from:"@tanstack/react-query"},$a={pageParamName:"page"},Fu={pageParamName:"page",totalItemsName:"totalItems",limitParamName:"limit"},wa="moduleName";var Fm={"Content-Type":"application/json",Accept:"application/json"},Hu="data",Hm="axios",Zn="config",Xr="AxiosRequestConfig",Bu={defaultImport:Hm,bindings:[Xr],from:"axios"};var cP=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 $e(e){return e!=null&&Object.prototype.hasOwnProperty.call(e,"$ref")}o($e,"isReferenceObject");function it(e){return!$e(e)}o(it,"isSchemaObject");function Vu(e){return e.type==="array"}o(Vu,"isArraySchemaObject");function uP(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(dD(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($e(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(uP,"inferRequiredSchema");var dD=o(e=>!$e(e)&&!!e.required&&!e.type&&!e.properties&&!(e!=null&&e.allOf)&&!(e!=null&&e.anyOf)&&!e.oneOf,"isBrokenAllOfItem");var bn=Symbol.for("@ts-pattern/matcher"),hD=Symbol.for("@ts-pattern/isVariadic"),Gu="@ts-pattern/anonymous-select-key",Bm=o(e=>!!(e&&typeof e=="object"),"r"),Uu=o(e=>e&&!!e[bn],"i"),rn=o((e,t,r)=>{if(Uu(e)){let n=e[bn](),{matched:i,selections:s}=n.match(t);return i&&s&&Object.keys(s).forEach(a=>r(a,s[a])),i}if(Bm(e)){if(!Bm(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];Uu(c)&&c[hD]?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)=>rn(l,a[p],r))&&i.every((l,p)=>rn(l,c[p],r))&&(s.length===0||rn(s[0],u,r))}return e.length===t.length&&e.every((a,c)=>rn(a,t[c],r))}return Reflect.ownKeys(e).every(n=>{let i=e[n];return(n in t||Uu(s=i)&&s[bn]().matcherType==="optional")&&rn(i,t[n],r);var s})}return Object.is(t,e)},"s"),Xn=o(e=>{var t,r,n;return Bm(e)?Uu(e)?(t=(r=(n=e[bn]()).getSelectionKeys)==null?void 0:r.call(n))!=null?t:[]:Array.isArray(e)?Ia(e,Xn):Ia(Object.values(e),Xn):[]},"o"),Ia=o((e,t)=>e.reduce((r,n)=>r.concat(t(n)),[]),"c");function gr(e){return Object.assign(e,{optional:o(()=>mD(e),"optional"),and:o(t=>Ge(e,t),"and"),or:o(t=>gD(e,t),"or"),select:o(t=>t===void 0?lP(e):lP(t,e),"select")})}o(gr,"u");function mD(e){return gr({[bn]:()=>({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:rn(e,t,n),selections:r}},"match"),getSelectionKeys:o(()=>Xn(e),"getSelectionKeys"),matcherType:"optional"})})}o(mD,"h");function Ge(...e){return gr({[bn]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return{matched:e.every(i=>rn(i,t,n)),selections:r}},"match"),getSelectionKeys:o(()=>Ia(e,Xn),"getSelectionKeys"),matcherType:"and"})})}o(Ge,"m");function gD(...e){return gr({[bn]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return Ia(e,Xn).forEach(i=>n(i,void 0)),{matched:e.some(i=>rn(i,t,n)),selections:r}},"match"),getSelectionKeys:o(()=>Ia(e,Xn),"getSelectionKeys"),matcherType:"or"})})}o(gD,"d");function Pe(e){return{[bn]:()=>({match:o(t=>({matched:!!e(t)}),"match")})}}o(Pe,"p");function lP(...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 gr({[bn]:()=>({match:o(n=>{let i={[t??Gu]:n};return{matched:r===void 0||rn(r,n,(s,a)=>{i[s]=a}),selections:i}},"match"),getSelectionKeys:o(()=>[t??Gu].concat(r===void 0?[]:Xn(r)),"getSelectionKeys")})})}o(lP,"y");function en(e){return typeof e=="number"}o(en,"v");function Kn(e){return typeof e=="string"}o(Kn,"b");function Yn(e){return typeof e=="bigint"}o(Yn,"w");var ZU=gr(Pe(function(e){return!0}));var Qn=o(e=>Object.assign(gr(e),{startsWith:o(t=>{return Qn(Ge(e,(r=t,Pe(n=>Kn(n)&&n.startsWith(r)))));var r},"startsWith"),endsWith:o(t=>{return Qn(Ge(e,(r=t,Pe(n=>Kn(n)&&n.endsWith(r)))));var r},"endsWith"),minLength:o(t=>Qn(Ge(e,(r=>Pe(n=>Kn(n)&&n.length>=r))(t))),"minLength"),length:o(t=>Qn(Ge(e,(r=>Pe(n=>Kn(n)&&n.length===r))(t))),"length"),maxLength:o(t=>Qn(Ge(e,(r=>Pe(n=>Kn(n)&&n.length<=r))(t))),"maxLength"),includes:o(t=>{return Qn(Ge(e,(r=t,Pe(n=>Kn(n)&&n.includes(r)))));var r},"includes"),regex:o(t=>{return Qn(Ge(e,(r=t,Pe(n=>Kn(n)&&!!n.match(r)))));var r},"regex")}),"j"),WU=Qn(Pe(Kn)),tn=o(e=>Object.assign(gr(e),{between:o((t,r)=>tn(Ge(e,((n,i)=>Pe(s=>en(s)&&n<=s&&i>=s))(t,r))),"between"),lt:o(t=>tn(Ge(e,(r=>Pe(n=>en(n)&&n<r))(t))),"lt"),gt:o(t=>tn(Ge(e,(r=>Pe(n=>en(n)&&n>r))(t))),"gt"),lte:o(t=>tn(Ge(e,(r=>Pe(n=>en(n)&&n<=r))(t))),"lte"),gte:o(t=>tn(Ge(e,(r=>Pe(n=>en(n)&&n>=r))(t))),"gte"),int:o(()=>tn(Ge(e,Pe(t=>en(t)&&Number.isInteger(t)))),"int"),finite:o(()=>tn(Ge(e,Pe(t=>en(t)&&Number.isFinite(t)))),"finite"),positive:o(()=>tn(Ge(e,Pe(t=>en(t)&&t>0))),"positive"),negative:o(()=>tn(Ge(e,Pe(t=>en(t)&&t<0))),"negative")}),"x"),KU=tn(Pe(en)),Jn=o(e=>Object.assign(gr(e),{between:o((t,r)=>Jn(Ge(e,((n,i)=>Pe(s=>Yn(s)&&n<=s&&i>=s))(t,r))),"between"),lt:o(t=>Jn(Ge(e,(r=>Pe(n=>Yn(n)&&n<r))(t))),"lt"),gt:o(t=>Jn(Ge(e,(r=>Pe(n=>Yn(n)&&n>r))(t))),"gt"),lte:o(t=>Jn(Ge(e,(r=>Pe(n=>Yn(n)&&n<=r))(t))),"lte"),gte:o(t=>Jn(Ge(e,(r=>Pe(n=>Yn(n)&&n>=r))(t))),"gte"),positive:o(()=>Jn(Ge(e,Pe(t=>Yn(t)&&t>0))),"positive"),negative:o(()=>Jn(Ge(e,Pe(t=>Yn(t)&&t<0))),"negative")}),"A"),YU=Jn(Pe(Yn)),QU=gr(Pe(function(e){return typeof e=="boolean"})),JU=gr(Pe(function(e){return typeof e=="symbol"})),XU=gr(Pe(function(e){return e==null})),eG=gr(Pe(function(e){return e!=null}));var zm=class zm 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(zm,"W");var Vm=zm,Um={matched:!1,value:void 0};function wt(e){return new Gm(e,Um)}o(wt,"z");var Aa=class Aa{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=>rn(l,this.input,c))||i&&!i(this.input)?Um:{matched:!0,value:r(s?Gu in a?a[Gu]:a:this.input,this.input)};return new Aa(this.input,u)}when(t,r){if(this.state.matched)return this;let n=!!t(this.input);return new Aa(this.input,n?{matched:!0,value:r(this.input,this.input)}:Um)}otherwise(t){return this.state.matched?this.state.value:t(this.input)}exhaustive(){if(this.state.matched)return this.state.value;throw new Vm(this.input)}run(){return this.exhaustive()}returnType(){return this}};o(Aa,"I");var Gm=Aa;var Zm=2,fP=["application/octet-stream","multipart/form-data","application/x-www-form-urlencoded","*/*"],pP=["query","header","path"],Zi=["get","put","post","delete","options","head","patch","trace"],dP=["string","number","integer","boolean"],Ca=["allOf","anyOf","oneOf"];var Te=o(e=>e.charAt(0).toUpperCase()+e.slice(1),"capitalize"),ei=o(e=>e.charAt(0).toLowerCase()+e.slice(1),"decapitalize"),hP=o(e=>e.replace(/(-\w)/g,t=>t[1].toUpperCase()),"kebabToCamel"),dt=o(e=>e.replace(/(_\w)/g,t=>t[1].toUpperCase()),"snakeToCamel"),mP=o(e=>e.replace(/[\W_]+(\w)?/g,(t,r)=>(r==null?void 0:r.toUpperCase())??""),"nonWordCharactersToCamel"),Wm=o((e,t="")=>e.endsWith(t)?e:`${e}${t}`,"suffixIfNeeded"),gP=o((e,t)=>e.replace(new RegExp(`${t}$`),""),"removeSuffix"),yD=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"),Km=o(e=>{let t=e.map(Te).map(yP).map(r=>bD(r)).flat();return yD(t)},"getMostCommonAdjacentCombinationSplit"),yP=o(e=>e.split(/(?<![A-Z])(?=[A-Z])/).filter(Boolean),"splitByUppercase"),bP=o(e=>yP(e).join(" "),"camelToSpaceSeparated"),bD=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"),vP=o((e,t)=>{let r=t.replace(/es$|s$/g,""),n=new RegExp(`(${ei(r)}|${Te(r)})[a-z]*(?=$|[A-Z])`,"g");return e.replace(n,"")},"removeWord");var SP=o(e=>`#/components/schemas/${e}`,"getSchemaRef"),Wi=o(e=>e[1]==="/"?e:"#/"+e.slice(1),"autocorrectRef"),is=o(e=>Wi(e).split("/").at(-1),"getSchemaNameByRef");function Qm(e){let t=vD(e).normalize("NFKD").trim().replace(/\s+/g,"_").replace(/--+/g,"-").replace(/-+/g,"_").replace(/[^\w-]+/g,"_");return dt(t)}o(Qm,"normalizeString");function OP(e){return/^[a-zA-Z]\w*$/.test(e)?e:`"${e}"`}o(OP,"wrapWithQuotesIfNeeded");function EP(e){return typeof e=="string"&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}o(EP,"unwrapQuotesIfNeeded");function vD(e){let t=Number(e[0]);return typeof t=="number"&&!Number.isNaN(t)?"_"+e:e}o(vD,"prefixStringStartingWithNumberIfNeeded");function Jm(e){let t=e.replaceAll("_","#");return dt(t.replaceAll("-","_")).replaceAll("#","_")}o(Jm,"pathParamToVariableName");var nn=o(e=>dP.includes(e),"isPrimitiveType");function PP(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(PP,"escapeControlCharacters");function on(e){return e.includes("application/")&&e.includes("json")||fP.includes(e)||e.includes("text/")}o(on,"isParamMediaTypeAllowed");function Ta(e){return e>=200&&e<300}o(Ta,"isMainResponseStatus");function zu(e){return!(e>=200&&e<300)}o(zu,"isErrorStatus");function Zu(e){return e.startsWith("application/")}o(Zu,"isMediaTypeAllowed");var _P=/({\w+})/g,_D=/[^\w\-]+/g;function xP(e){e=Te(hP(e.replaceAll("/","-")).replaceAll("-",""));let t=[...e.matchAll(_P)];if(t.length>0){let r=t.sort((n,i)=>n.index-i.index)[t.length-1][0];e=`${e.replace(_P,"")}By${Te(r.slice(1,-1))}`}return e.replace(_D,"_")}o(xP,"pathToVariableName");var Ym=/{(\b\w+(?:-\w+)*\b)}/g;function $P(e){let t=e.match(Ym);return t===null?e.replaceAll(Ym,":$1"):(t.forEach(r=>{let n=Jm(r.replaceAll(Ym,":$1"));e=e.replaceAll(r,n)}),e)}o($P,"replaceHyphenatedPath");var wP=o(e=>{let t=e["x-enumNames"],r=Array.isArray(t)&&t.length>0,n=!!e.schema&&it(e.schema)&&e.schema.type==="string";return r&&n},"isSortingParameterObject"),Ki=o((e,t)=>t.excludePathRegex?new RegExp(t.excludePathRegex).test(e):!1,"isPathExcluded");var Xt=o(e=>e.method==="get","isQuery"),ri=o(e=>e.method!=="get"||!!e.mediaDownload,"isMutation"),os=o((e,t)=>Xt(e)&&(t??Object.values($a)).every(r=>e.parameters.some(n=>n.name===r&&n.type==="Query")),"isInfiniteQuery"),AP=o((e,t,r)=>{let n=r.reduce((i,s)=>[...i,...ti(e,s,{includeOnlyRequiredParams:!0}).map(a=>a.name)],[]);return ti(e,t,{includeOnlyRequiredParams:!0,excludeBodyParam:!0}).filter(i=>n.includes(i.name)).map(i=>i.name)},"getDestructuredVariables");function ni(e){return mP(e)}o(ni,"formatTag");function ii(e,t){var n;let r=(n=e.tags)==null?void 0:n[0];return ni(r??t.defaultTag)}o(ii,"getOperationTag");function IP(e,t){return t.excludeTags.some(r=>r.toLowerCase()===e.toLowerCase())}o(IP,"isTagExcluded");var Wu={fileName:"acl/app.ability",extension:"ts"},Ra="AllAbilities",Na="AppAbilities",Ku={fileName:"acl/useAclCheck",extension:"ts"},oi="useAclCheck",At={abilityTuple:"AbilityTuple",pureAbility:"PureAbility",forcedSubject:"ForcedSubject",subjectType:"Subject",subject:"subject"},Xm={bindings:[At.abilityTuple,At.pureAbility,At.forcedSubject,At.subjectType,At.subject],from:"@casl/ability"};var ja="AppRestClient",Yu={query:"AppQueryOptions",infiniteQuery:"AppInfiniteQueryOptions",mutation:"AppMutationOptions"},eg="src/data",tg="@/data",yr={appRestClient:{template:"@/util/rest/clients/app-rest-client",monorepoTemplate:"@/clients/app-rest-client"},queryTypes:{template:"@/types/react-query",monorepoTemplate:"@povio/utils/types/react-query"},errorHandling:{template:"@/util/vendor/error-handling",monorepoTemplate:"@povio/utils/utils/vendor/error-handling"},abilityContext:{template:"@/data/acl/ability.context",monorepoTemplate:"@povio/auth/acl/ability.context"}},si={ErrorHandler:"ErrorHandler",SharedErrorHandler:"SharedErrorHandler"},Qu={bindings:[si.ErrorHandler,si.SharedErrorHandler],from:yr.errorHandling.template},rg="AbilityContext",CP={bindings:[rg],from:yr.abilityContext.template};var Ju={reactQueryTypes:{fileName:"react-query.types",extension:"ts"},restClient:{fileName:"rest-client",extension:"ts"},restInterceptor:{fileName:"rest-interceptor",extension:"ts"}},Xu={fileName:"app-rest-client",extension:"ts"},ng="QueryModule",el={fileName:"queryModules",extension:"ts"},TP={fileName:"queryConfig.context",extension:"tsx"},ss={optionsType:"MutationEffectsOptions",hookName:"useMutationEffects",runFunctionName:"runMutationEffects"},tl={fileName:"useMutationEffects",extension:"ts"},ht={namespace:"ZodUtils",exports:{parse:"parse",sortExp:"sortExp",brand:"brand"}},rl={fileName:"zod.utils",extension:"ts"};var er=o((...e)=>[...new Set(e.flat())],"getUniqueArray");var RP=o(e=>`Use${Te(dt(e.operationName))}Ability`,"getAbilityTypeName"),Ma=o(e=>`canUse${Te(dt(e.operationName))}`,"getAbilityFunctionName"),NP=o((e,t)=>`${t.tsNamespaces?`${He({type:"acl",tag:ai(e,t),options:t})}.`:""}${Ma(e)}`,"getImportedAbilityFunctionName"),jP=o(e=>{var t;return(t=e.acl)==null?void 0:t[0].action},"getAbilityAction"),MP=o(e=>{var t;return(t=e.acl)==null?void 0:t[0].subject},"getAbilitySubject"),nl=o(e=>{var t;return!!((t=ka(e))!=null&&t.length)},"hasAbilityConditions"),ka=o(e=>{var t;return(t=e.acl)==null?void 0:t[0].conditionsTypes},"getAbilityConditionsTypes"),kP=o(e=>{var t;return(t=e.acl)==null?void 0:t[0].description},"getAbilityDescription"),il=o(e=>`${Te(e)}${Ra}`,"getTagAllAbilitiesName");var qP="Schema",DP="Enum",LP="Body",FP="Param",HP="Response",BP="ErrorResponse",qa="z.void()",ol="z.instanceof(Blob)",Da="z.enum",sl="z.string()",as={bindings:["z"],from:"zod"};function vt(e,t){if(!e)return;let{data:r,onSchema:n}=t;if($e(e)&&n({type:"reference",schema:e,data:r})===!0)return;let i=e;if(Ca.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&&vt(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&&vt(a,t);if(i.additionalProperties&&typeof i.additionalProperties=="object"){if(n({type:"additionalProperties",parentSchema:e,schema:i.additionalProperties,data:r})===!0)return;vt(i.additionalProperties,t)}if(i.type==="array"){let s=e.items;if(n({type:"array",parentSchema:e,schema:s,data:r})===!0)return;vt(s,t)}}o(vt,"iterateSchema");var sn=o((e,t)=>Wm(Te(Qm(e)),t),"getZodSchemaName"),La=o((e,t,r)=>Wm(Te(Qm(e)),`${t}${r}`),"getEnumZodSchemaName"),It=o(e=>["z.",`${ht.namespace}.`].every(t=>!e.startsWith(t)),"isNamedZodSchema"),VP=o(e=>e.startsWith(Da),"isEnumZodSchema"),Yi=o((e,t,r)=>t?e:`${r}_${e}`,"getZodSchemaOperationName"),al=o(e=>dt(`${e}_${LP}`),"getBodyZodSchemaName"),UP=o((e,t)=>dt(`${e}_${t}${FP}`),"getParamZodSchemaName"),SD=o(e=>dt(`${e}${HP}`),"getMainResponseZodSchemaName"),OD=o((e,t)=>dt(`${e}_${t}_${BP}`),"getErrorResponseZodSchemaName");function cl({statusCode:e,operationName:t,isUniqueOperationName:r,tag:n}){let i=Number(e),s=Yi(t,r,n);return!Ta(i)&&e!=="default"&&zu(i)?OD(s,e):SD(s)}o(cl,"getResponseZodSchemaName");function Fa(e){return["minimum","exclusiveMinimum","maximum","exclusiveMaximum","minItems","minLength","minProperties","maxItems","maxLength","maxProperties","default","example"].filter(n=>e[n]).reduce((n,i)=>[...n,`${Te(bP(i))}: \`${e[i]}\``],[])}o(Fa,"getSchemaDescriptions");var Ha=o((e,t)=>gP(e,t.schemaSuffix),"getZodSchemaInferedTypeName"),GP=o((e,t)=>It(t)?`${e.options.tsNamespaces?`${He({type:"models",tag:e.getTagByZodSchemaName(t),options:e.options})}.`:""}${t}`:t,"getImportedZodSchemaName"),Qi=o((e,t,r)=>{if(!It(t))return t===qa?"void":t;let n=e.getTagByZodSchemaName(t);return`${e.options.tsNamespaces&&n!==r?`${He({type:"models",tag:n,options:e.options})}.`:""}${Ha(t,e.options)}`},"getImportedZodSchemaInferedTypeName");function zP(e){var t;return e.isEnum?"enum":((t=e.schemaObj)==null?void 0:t.type)??"object"}o(zP,"getZodSchemaType");function ZP(e){if(e.schemaObj)return[e.schemaObj.description,...Fa(e.schemaObj)].filter(Boolean).join(". ")}o(ZP,"getZodSchemaDescription");function WP(e,t,r){var n;if($e(t)){let i=e.getZodSchemaNameByRef(t.$ref);return i?Qi(e,i,r):void 0}if(Vu(t)){if(!$e(t.items))return`${((n=t.items)==null?void 0:n.type)??"unknown"}[]`;let i=e.getZodSchemaNameByRef(t.items.$ref);return i?`${Qi(e,i,r)}[]`:void 0}if(Ca.some(i=>i in t&&t[i])){let i=t.allOf??t.anyOf??t.oneOf??[];if(i.length>0)return WP(e,i[0],r)}return t.type}o(WP,"getType");function KP(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,...Fa(p)].filter(Boolean),d=u.join(".");s[d]&&"type"in c.schema&&c.schema.type==="object"||(delete s[d],s[d]={type:WP(e,c.schema,r)??"unknown",description:f.join(". ")})}return vt(c.schema,{data:{pathSegments:[...u]},onSchema:a}),!0},"onSchema");return"allOf"in t.schemaObj&&t.schemaObj.allOf&&t.schemaObj.allOf.forEach(c=>{if($e(c)){let u=e.resolveObject(c);vt(u,{data:{pathSegments:[]},onSchema:a})}}),vt(t.schemaObj,{data:{pathSegments:[]},onSchema:a}),s}o(KP,"getZodSchemaPropertyDescriptions");function ci({resolver:e,tag:t,zodSchemas:r=[],zodSchemasAsTypes:n=[]}){let i="models",s=o(u=>e.getTagByZodSchemaName(u),"getTag"),a=ul({type:i,tag:t,entities:r,getTag:s,getEntityName:o(u=>u,"getEntityName"),options:e.options}),c=ul({type:i,tag:t,entities:n,getTag:s,getEntityName:o(u=>Ha(u,e.options),"getEntityName"),options:e.options});return ED(e.options,a,c)}o(ci,"getModelsImports");function YP({tag:e,endpoints:t,options:r}){return ul({type:"endpoints",tag:e,entities:t,getTag:o(n=>ai(n,r),"getTag"),getEntityName:Ba,options:r})}o(YP,"getEndpointsImports");function QP({tag:e,endpoints:t,options:r}){return ul({type:"acl",tag:e,entities:t,getTag:o(n=>ai(n,r),"getTag"),getEntityName:Ma,options:r})}o(QP,"getAclImports");function JP({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)}${ll({type:n,tag:a,includeTagDir:!0,options:i})}`})}),Array.from(s.values())}o(JP,"getEntityImports");function an(e){let t=tg;return e.importPath==="relative"?t="../":e.importPath==="absolute"?t=e.output:new RegExp(`${eg}`,"g").test(e.output)&&(t=e.output.replace(new RegExp(`.*${eg}`,"g"),tg)),`${t}/`.replace(/\/\//g,"/")}o(an,"getImportPath");function ul({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)}${ll({type:e,tag:u,includeTagDir:!l,options:s})}`})}}),Array.from(a.values())}o(ul,"getImports");function ED(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:er(n.bindings)}))}o(ED,"mergeImports");function Ji({fileName:e,extension:t}){return`${e}.${t}`}o(Ji,"getFileNameWithExtension");function XP({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(XP,"getTagFileNameWithoutExtension");function ll(...e){return XP(...e)}o(ll,"getTagImportPath");function fl(...e){return`${XP(...e)}.ts`}o(fl,"getTagFileName");var He=o(({type:e,tag:t,options:r})=>`${Te(t)}${r.configs[e].namespaceSuffix}`,"getNamespaceName");function ex(e){return e.standalone?`${an(e)}${Xu.fileName}`:e.restClientImportPath}o(ex,"getAppRestClientImportPath");function tx(e){return e.standalone?`${an(e)}${Ju.reactQueryTypes.fileName}`:e.queryTypesImportPath}o(tx,"getQueryTypesImportPath");function rx(e){return`${an(e)}${el.fileName}`}o(rx,"getQueryModulesImportPath");function nx(e){return`${an(e)}${tl.fileName}`}o(nx,"getMutationEffectsImportPath");function ix(e){return`${an(e)}${Ku.fileName}`}o(ix,"getAclCheckImportPath");function pl(e){return`${an(e)}${rl.fileName}`}o(pl,"getZodUtilsImportPath");function ox(e){return`${an(e)}${Wu.fileName}`}o(ox,"getAppAbilitiesImportPath");function sx(e){return wt(e).with("string",()=>"string").with("number",()=>"number").with("integer",()=>"number").with("boolean",()=>"boolean").exhaustive()}o(sx,"primitiveTypeToTsType");var Ba=o(e=>ei(dt(e.operationName)),"getEndpointName");function ax(e,t){return`${t.tsNamespaces?`${He({type:"endpoints",tag:ai(e,t),options:t})}.`:""}${Ba(e)}`}o(ax,"getImportedEndpointName");var cx=o(e=>e.path.replace(/:([a-zA-Z0-9_]+)/g,"${$1}"),"getEndpointPath");function ai(e,t){var n;let r=t.splitByTags?(n=e.tags)==null?void 0:n[0]:t.defaultTag;return ni(r??t.defaultTag)}o(ai,"getEndpointTag");function ti(e,t,r){let n=t.parameters.map(i=>{var a,c,u,l;let s="string";if(It(i.zodSchema))s=Qi(e,i.zodSchema);else if((a=i.parameterObject)!=null&&a.schema&&it(i.parameterObject.schema)){let p=(u=(c=i.parameterObject)==null?void 0:c.schema)==null?void 0:u.type;p&&nn(p)&&(s=sx(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!==Hu)&&(!(r!=null&&r.excludePageParam)||i.name!==$a.pageParamName)&&(!(r!=null&&r.includeOnlyRequiredParams)||i.required)).map(i=>({...i,name:r!=null&&r.replacePageParam&&i.name===$a.pageParamName?"pageParam":i.name,required:i.required&&(i.paramType==="Path"||!(r!=null&&r.pathParamsRequiredOnly))}))}o(ti,"mapEndpointParamsToFunctionParams");function ux(e){let t=e.parameters.filter(i=>i.type==="Query").map(i=>{let s=cP(i.name)?i.name:`"${i.name}"`,a=Wn(i.name);return{...i,name:s,value:a}}),r={};return e.requestFormat!==Fm["Content-Type"]&&(r["Content-Type"]=`'${e.requestFormat}'`),e.responseFormat&&e.responseFormat!==Fm.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(ux,"getEndpointConfig");function lx(e,t){return t.filter(r=>Xt(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(lx,"getUpdateQueryEndpoints");var ig=["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 Xi(e,t){let r={};return Object.keys(e).forEach(n=>{t.includes(n)&&(r[n]=e[n])}),r}o(Xi,"pick");function dl(e,...t){if(t.length===0)return e;let r=e;for(let n of t)r=fx(r,n);return r}o(dl,"deepMerge");function fx(e,t){if(t==null)return e;if(e==null)return cs(t);if(Array.isArray(e)&&Array.isArray(t))return[...e,...t];if(Va(e)&&Va(t)){let r={};for(let[n,i]of Object.entries(e))r[n]=cs(i);for(let[n,i]of Object.entries(t)){let s=r[n];i!==void 0&&(i===null?r[n]=i:Va(s)&&Va(i)?r[n]=fx(s,i):Array.isArray(s)&&Array.isArray(i)?r[n]=[...s,...i]:r[n]=cs(i))}return r}return cs(t)}o(fx,"mergeTwoValues");function cs(e){if(e==null||typeof e!="object")return e;if(Array.isArray(e))return e.map(t=>cs(t));if(Va(e)){let t={};for(let[r,n]of Object.entries(e))t[r]=cs(n);return t}return e}o(cs,"deepClone");function Va(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)&&Object.prototype.toString.call(e)==="[object Object]"}o(Va,"isPlainObject");function us(e,t){let r=e.deprecated&&!t.withDeprecatedEndpoints,n=ii(e,t),i=IP(n,t);return r||i}o(us,"isOperationExcluded");function og({path:e,method:t,operation:r,options:n,tag:i,keepOperationTag:s,keepOperationPrefix:a}){let c=`${t}${xP(e)}`,u=r.operationId?Wn(r.operationId):c;if(n.removeOperationPrefixEndingWith&&a)u=u.split(n.removeOperationPrefixEndingWith).map((p,f)=>f===0?p:Te(p)).join("");else if(n.removeOperationPrefixEndingWith&&!a){let l=new RegExp(`^.*${n.removeOperationPrefixEndingWith}`);u=u.replace(l,"")}if(n.tsNamespaces&&!s){let l=vP(u,i);l===""?u=t.toLowerCase():ig.includes(l)||(u=l)}return ig.includes(u)?c:u}o(og,"getOperationName");function Ua({operationsByTag:e,...t}){let{operation:r,options:n}=t,i=n.splitByTags?ii(r,n):n.defaultTag,s=o(a=>{let c=og({...t,tag:i,keepOperationTag:a});if(e[i].filter(l=>og({...t,operation:l,tag:i,keepOperationTag:a})===c).length===1)return c},"operationName");return s()??s(!0)??og({...t,tag:i,keepOperationTag:!0,keepOperationPrefix:!0})}o(Ua,"getUniqueOperationName");function px(e,t,r){let n=[];for(let i in e.paths){if(Ki(i,r))continue;let s=e.paths[i],a=Xi(s,Zi);for(let c in a){let u=a[c];if(!u||us(u,r))continue;let l=Ua({path:i,method:c,operation:u,operationsByTag:t,options:r});n.push(l)}}return n}o(px,"getUniqueOperationNamesWithoutSplitByTags");function dx(e,t){let r={};for(let n in e.paths){if(Ki(n,t))continue;let i=e.paths[n],s=Xi(i,Zi);for(let a in s){let c=s[a];if(!c||us(c,t))continue;let u=t.splitByTags?ii(c,t):t.defaultTag;r[u]||(r[u]=[]),r[u].push(c)}}return r}o(dx,"getOperationsByTag");function Ga(e){return{type:"invalid-schema",message:e}}o(Ga,"getInvalidSchemaError");function hx(e){return{type:"invalid-operation-id",message:`Operation ${e}`}}o(hx,"getInvalidOperationIdError");function mx(e,t){return{type:"missing-path-parameter",message:`Path ${t} is missing [${e.map(({name:r})=>r).join(", ")}]`}}o(mx,"getMissingPathParameterError");function gx(e){return{type:"not-allowed-inline-enum",message:`${e} is missing @IsEnum() and @ApiProperty(enum:, enumName:)`}}o(gx,"getNotAllowedInlineEnumError");function yx(e){return{type:"not-allowed-circular-schema",message:e}}o(yx,"getNotAllowedCircularSchemaError");function bx(e,t,r){return{type:"missing-acl-condition-property",message:`Condition property ${e} is not found in parameters or body in operation ${ml(t,r)}`}}o(bx,"getMissingAclConditionPropertyError");function sg(e,t,r){return{type:"missing-status-code",message:`Missing HTTP status code ${hl(e)} in operation ${ml(t,r)}`}}o(sg,"getMissingStatusCodeError");function vx(e,t,r){return{type:"invalid-status-code",message:`Operation ${ml(t,r)} expected HTTP status code ${hl(e.expected)} but received ${hl(e.received)}`}}o(vx,"getInvalidStatusCodeError");function _x(e,t,r){return{type:"multiple-success-status-codes",message:`Operation ${ml(t,r)} has multiple success HTTP status codes: ${e.map(hl).join(", ")}`}}o(_x,"getMultipleSuccessStatusCodesError");function ml(e,t){return e.operationId??`${t.method} ${t.path}`}o(ml,"getOperationDescriptor");function hl(e){return`${e} (${oP[e]})`}o(hl,"getStatusCodeDescription");function Sx(e){return e.reduce((t,r)=>({...t,[r.type]:[...t[r.type]??[],r.message]}),{})}o(Sx,"groupByType");function cn({schema:e,meta:t,options:r}){let n=[];wt(e.type).with("string",()=>n.push($D(e))).with("number","integer",()=>n.push(AD(e))).with("array",()=>n.push(ID(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(PD({schema:e,meta:t,options:r}),r.withDefaultValues!==!1?xD(e):[]).filter(Boolean).join(".");return i?`.${i}`:""}o(cn,"getZodChain");function PD({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(PD,"getZodChainablePresence");function xD(e){return e.default!==void 0?`default(${wt(e.type).with("number","integer",()=>EP(e.default)).otherwise(()=>JSON.stringify(e.default))})`:""}o(xD,"getZodChainableDefault");function $D(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(${wD(e.pattern)})`),e.format){let r=wt(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($D,"getZodChainableStringValidations");function wD(e){return e.startsWith("/")&&e.endsWith("/")&&(e=e.slice(1,-1)),e=PP(e),`/${e}/`}o(wD,"formatPatternIfNeeded");function AD(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(AD,"getZodChainableNumberValidations");function ID(e){let t=[];return e.minItems&&t.push(`min(${e.minItems})`),e.maxItems&&t.push(`max(${e.maxItems})`),t.join(".")}o(ID,"getZodChainableArrayValidations");var CD={type:"string",format:"date-time"},TD={type:"string",format:"email"},RD={type:"object",properties:{start:{type:"string",format:"date-time"},end:{type:"string",format:"date-time"}}},ND={type:"object",properties:{html:{type:"string"},json:{type:"object"}}},ls=(i=>(i.datetime="datetime",i.email="email",i.dateRange="dateRange",i.textEditor="textEditor",i))(ls||{}),gl={datetime:CD,email:TD,dateRange:RD,textEditor:ND};function Ox(){return Object.values(ls).filter(e=>nn(gl[e].type))}o(Ox,"getPrimitiveBrands");function Ex(){return Object.values(ls).filter(e=>!nn(gl[e].type))}o(Ex,"getOtherBrands");function fs(e,t){let r=gl[t];return!(e.type!==r.type||r.format&&e.format!==r.format||!Object.entries(r.properties??{}).every(([i,s])=>{var c;let a=(c=e.properties)==null?void 0:c[i];return a&&a.type===s.type&&a.format===s.format}))}o(fs,"matchesBrand");function ag(e,t,r){return r.branded?`${ht.namespace}.${ht.exports.brand}(${e}, "${t}")`:e}o(ag,"wrapWithBrand");var eo=o(e=>e.reduce((t,r)=>t+r,0),"sum");function mt(e,t){if(!t)return e;if($e(t))return e+2;if(Array.isArray(t.type))return t.type.length===1?tr("oneOf")+mt(e,{...t,type:t.type[0]}):e+tr("oneOf")+eo(t.type.map(r=>mt(0,{...t,type:r})));if(t.oneOf)return t.oneOf.length===1?tr("oneOf")+mt(e,t.oneOf[0]):e+tr("oneOf")+eo(t.oneOf.map(r=>mt(0,r)));if(t.anyOf)return t.anyOf.length===1?tr("anyOf")+mt(e,t.anyOf[0]):e+tr("anyOf")+eo(t.anyOf.map(r=>mt(0,r)));if(t.allOf)return t.allOf.length===1?tr("allOf")+mt(e,t.allOf[0]):e+tr("allOf")+eo(t.allOf.map(r=>mt(0,r)));if(!t.type)return e;if(nn(t.type))return t.enum?e+Px(t)+tr("enum")+eo(t.enum.map(r=>mt(0,r))):e+Px(t);if(t.type==="array")return t.items?tr("array")+mt(e,t.items):tr("array")+mt(e);if(t.type==="object"||t.properties||t.additionalProperties){if(t.properties){let r=Object.values(t.properties);e+=tr("object")+eo(r.map(n=>mt(0,n)))}else e+=tr("empty-object");t.additionalProperties&&(typeof t.additionalProperties=="object"?e+=mt(0,t.additionalProperties):e+=mt(1))}return e}o(mt,"getOpenAPISchemaComplexity");function Px(e){return wt(e.type).with("string","number","integer","boolean",()=>1).otherwise(()=>0)}o(Px,"complexityByType");function tr(e){return wt(e).with("oneOf",()=>2).with("anyOf",()=>3).with("allOf",()=>2).with("enum","array","empty-object",()=>1).with("object",()=>2).otherwise(()=>0)}o(tr,"complexityByComposite");var cg=class cg{constructor(t,r,n={referencedBy:[]},i){this.schema=t;this.resolver=r;this.children=[];$e(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)}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 mt(0,this.schema)}assign(t){return this.code=t,this}inherit(t){return t&&t.children.push(this),this}};o(cg,"ZodSchema");var za=cg;function Ye({schema:e,resolver:t,meta:r,tag:n}){var y;let i=new za(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($e(e))return jD({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});let c=kD({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(c)return c;let u=MD({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(u)return u;let l=qD({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(l)return l;let p=DD({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(p)return p;let f=LD({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(f)return f;let d=t.options.allReadonly?".readonly()":"";if(Vu(e))return e.items?i.assign(`z.array(${Ye({...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(([re,xe])=>{var R;let we={...s,isRequired:g?!0:b?(R=e.required)==null?void 0:R.includes(re):t.options.withImplicitRequiredProps,name:re,isParentPartial:g},G=xe;if($e(xe)&&t&&(G=t.getSchemaByRef(xe.$ref),!G))throw new Error(`Schema ${xe.$ref} not found`);let j=Ye({...a,schema:xe,meta:we}).getCodeString(n,t.options)+cn({schema:G,meta:we,options:t.options});return it(xe)&&Ox().forEach(k=>{fs(xe,k)&&(j=ag(j,k,t.options))}),[re,j]}).map(([re,xe])=>`${OP(re)}: ${xe}`).join(", ")+" }");let $="";e.additionalProperties&&($=`.catchall(${typeof e.additionalProperties=="object"&&Object.keys(e.additionalProperties).length>0?Ye({...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()":"",w=`z.object(${P})${C}${T}${$}${d}`;return Ex().forEach(te=>{fs(e,te)&&(w=ag(w,te,t.options))}),i.assign(w)}if(h==="any")return i.assign("z.any()");if(!h)return i.assign("z.unknown()");throw new Error(`Unsupported schema type: ${h}`)}o(Ye,"getZodSchema");function jD({schema:e,zodSchema:t,resolver:r,meta:n,tag:i}){if(!$e(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=Ye({schema:u,resolver:r,meta:n,tag:i}).getCodeString(i,r.options)}return r.getCodeByZodSchemaName(a)||r.setZodSchema(a,c,i),t}o(jD,"getReferenceZodSchema");function MD({schema:e,zodSchema:t,resolver:r,meta:n,tag:i}){var a;if(!it(e)||!e.oneOf)return;if(e.oneOf.length===1){let c=Ye({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=>it(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=>Ye({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.15.0",
3
+ "version": "0.15.1",
4
4
  "main": "./dist/index.js",
5
5
  "bin": {
6
6
  "openapi-codegen": "./dist/sh.js"
@@ -1,3 +0,0 @@
1
- import { OpenAPICodegenConfig } from "src/generators/types/config";
2
- export declare const config: OpenAPICodegenConfig;
3
- export default config;
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes