@povio/openapi-codegen-cli 0.16.0 → 0.16.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.
@@ -0,0 +1,27 @@
1
+ export type ObjectLiteral<T = any> = Record<string, T>;
2
+ export type List<A = any> = ReadonlyArray<A>;
3
+ export type Length<L extends List> = L["length"];
4
+ /**
5
+ Represents an array of strings split using a given character or character set.
6
+
7
+ Use-case: Defining the return type of a method like `String.prototype.split`.
8
+
9
+ @example
10
+ ```
11
+ declare function split<S extends string, D extends string>(string: S, separator: D): Split<S, D>;
12
+
13
+ type Item = 'foo' | 'bar' | 'baz' | 'waldo';
14
+ const items = 'foo,bar,baz,waldo';
15
+ let array: Item[];
16
+
17
+ array = split(items, ',');
18
+ ```
19
+
20
+ @category String
21
+ @category Template literal
22
+ */
23
+ export type Split<S extends string, Delimiter extends string> = S extends `${infer Head}${Delimiter}${infer Tail}` ? [Head, ...Split<Tail, Delimiter>] : S extends Delimiter ? [] : [S];
24
+ export type HasNestedPath<Path extends string> = Length<Split<Path, ".">> extends 1 ? false : true;
25
+ export type WithRequired<T, K extends keyof T> = T & {
26
+ [P in K]-?: T[P];
27
+ };
@@ -0,0 +1,47 @@
1
+ import { OpenAPIV3 } from "openapi-types";
2
+ import { OperationAclInfo, ParameterObject } from "./openapi";
3
+ export interface EndpointParameter {
4
+ name: string;
5
+ description?: string;
6
+ type: "Query" | "Body" | "Header" | "Path";
7
+ zodSchema: string;
8
+ parameterObject?: ParameterObject;
9
+ parameterSortingEnumSchemaName?: string;
10
+ bodyObject?: OpenAPIV3.RequestBodyObject;
11
+ }
12
+ interface EndpointError {
13
+ status: number | "default";
14
+ description?: string;
15
+ zodSchema: string;
16
+ }
17
+ export interface AclConditionsPropertyType {
18
+ name: string;
19
+ type?: string;
20
+ zodSchemaName?: string;
21
+ required?: boolean;
22
+ info?: string;
23
+ }
24
+ export type EndpointAclInfo = OperationAclInfo & {
25
+ conditionsTypes?: AclConditionsPropertyType[];
26
+ };
27
+ export interface Endpoint {
28
+ method: OpenAPIV3.HttpMethods;
29
+ path: string;
30
+ operationName: string;
31
+ description?: string;
32
+ summary?: string;
33
+ tags?: string[];
34
+ requestFormat: string;
35
+ responseFormat?: string;
36
+ parameters: Array<EndpointParameter>;
37
+ status?: number;
38
+ response: string;
39
+ responseObject?: OpenAPIV3.ResponseObject;
40
+ responseDescription?: string;
41
+ errors: Array<EndpointError>;
42
+ responseStatusCodes: string[];
43
+ acl?: EndpointAclInfo[];
44
+ mediaUpload?: boolean;
45
+ mediaDownload?: boolean;
46
+ }
47
+ export {};
@@ -0,0 +1,22 @@
1
+ import { OpenAPIV3 } from "openapi-types";
2
+ export type CompositeType = "oneOf" | "anyOf" | "allOf" | "enum" | "array" | "empty-object" | "object" | "record";
3
+ export type SingleType = Exclude<OpenAPIV3.SchemaObject["type"], any[] | undefined>;
4
+ export type PrimitiveType = "string" | "number" | "integer" | "boolean";
5
+ export interface OperationAclInfo {
6
+ action: string;
7
+ subject: string;
8
+ conditions?: Record<string, string>;
9
+ description?: string;
10
+ }
11
+ interface OperationObjectAdditions {
12
+ "x-acl"?: OperationAclInfo[];
13
+ "x-media-upload"?: any;
14
+ "x-media-download"?: any;
15
+ }
16
+ export type OperationObject = OpenAPIV3.OperationObject<OperationObjectAdditions>;
17
+ interface ParameterObjectAdditions {
18
+ "x-enumNames"?: string[];
19
+ }
20
+ export type ParameterObject = OpenAPIV3.ParameterObject & ParameterObjectAdditions;
21
+ export type SortingParameterObject = OpenAPIV3.ParameterObject & Required<Pick<ParameterObjectAdditions, "x-enumNames">>;
22
+ export {};
@@ -0,0 +1,50 @@
1
+ import { GenerateType } from "./generate";
2
+ interface ZodGenerateOptions {
3
+ schemaSuffix: string;
4
+ enumSuffix: string;
5
+ withImplicitRequiredProps?: boolean;
6
+ withDefaultValues?: boolean;
7
+ withDescription?: boolean;
8
+ allReadonly?: boolean;
9
+ strictObjects?: boolean;
10
+ extractEnums?: boolean;
11
+ branded?: boolean;
12
+ replaceOptionalWithNullish?: boolean;
13
+ }
14
+ interface EndpointsGenerateOptions {
15
+ restClientImportPath: string;
16
+ errorHandlingImportPath: string;
17
+ withDeprecatedEndpoints?: boolean;
18
+ removeOperationPrefixEndingWith?: string;
19
+ parseRequestParams?: boolean;
20
+ }
21
+ interface QueriesGenerateOptions {
22
+ queryTypesImportPath: string;
23
+ axiosRequestConfig?: boolean;
24
+ infiniteQueries?: boolean;
25
+ mutationEffects?: boolean;
26
+ checkAcl?: boolean;
27
+ }
28
+ interface GenerateConfig {
29
+ outputFileNameSuffix: string;
30
+ namespaceSuffix: string;
31
+ }
32
+ interface BaseGenerateOptions {
33
+ input: string;
34
+ output: string;
35
+ splitByTags: boolean;
36
+ defaultTag: string;
37
+ excludeTags: string[];
38
+ excludePathRegex: string;
39
+ excludeRedundantZodSchemas: boolean;
40
+ tsNamespaces: boolean;
41
+ importPath: "ts" | "relative" | "absolute";
42
+ configs: Record<GenerateType, GenerateConfig>;
43
+ acl: boolean;
44
+ standalone: boolean;
45
+ baseUrl: string;
46
+ abilityContextImportPath: string;
47
+ abilityContextGenericAppAbilities: boolean;
48
+ }
49
+ export type GenerateOptions = BaseGenerateOptions & ZodGenerateOptions & EndpointsGenerateOptions & QueriesGenerateOptions;
50
+ export {};
@@ -0,0 +1,5 @@
1
+ export type ValidationErrorType = "invalid-schema" | "invalid-operation-id" | "missing-path-parameter" | "not-allowed-inline-enum" | "not-allowed-circular-schema" | "missing-acl-condition-property" | "missing-status-code" | "invalid-status-code" | "multiple-success-status-codes";
2
+ export interface ValidationError {
3
+ type: ValidationErrorType;
4
+ message: string;
5
+ }
package/dist/sh.js CHANGED
@@ -522,7 +522,7 @@ ${cr.join(`
522
522
  `:`
523
523
  `)+m,k=b+1,b=l.indexOf(`
524
524
  `,k)}while(b!==-1);return I+=l.slice(k),I}t(oZe,"stringEncaseCRLFWithFirstIndex");var{stdout:cZe,stderr:lZe}=sZe,vEe=Symbol("GENERATOR"),fM=Symbol("STYLER"),CU=Symbol("IS_EMPTY"),uZe=["ansi","ansi","ansi256","ansi16m"],_M=Object.create(null),m5t=t((l,u={})=>{if(u.level&&!(Number.isInteger(u.level)&&u.level>=0&&u.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let m=cZe?cZe.level:0;l.level=u.level===void 0?m:u.level},"applyOptions"),xEe=class xEe{constructor(u){return fZe(u)}};t(xEe,"Chalk");var Voe=xEe,fZe=t(l=>{let u=t((...m)=>m.join(" "),"chalk");return m5t(u,l),Object.setPrototypeOf(u,EU.prototype),u},"chalkFactory");function EU(l){return fZe(l)}t(EU,"createChalk");Object.setPrototypeOf(EU.prototype,Function.prototype);for(let[l,u]of Object.entries(Yx))_M[l]={get(){let m=Uoe(this,SEe(u.open,u.close,this[fM]),this[CU]);return Object.defineProperty(this,l,{value:m}),m}};_M.visible={get(){let l=Uoe(this,this[fM],!0);return Object.defineProperty(this,"visible",{value:l}),l}};var bEe=t((l,u,m,...b)=>l==="rgb"?u==="ansi16m"?Yx[m].ansi16m(...b):u==="ansi256"?Yx[m].ansi256(Yx.rgbToAnsi256(...b)):Yx[m].ansi(Yx.rgbToAnsi(...b)):l==="hex"?bEe("rgb",u,m,...Yx.hexToRgb(...b)):Yx[m][l](...b),"getModelAnsi"),h5t=["rgb","hex","ansi256"];for(let l of h5t){_M[l]={get(){let{level:m}=this;return function(...b){let k=SEe(bEe(l,uZe[m],"color",...b),Yx.color.close,this[fM]);return Uoe(this,k,this[CU])}}};let u="bg"+l[0].toUpperCase()+l.slice(1);_M[u]={get(){let{level:m}=this;return function(...b){let k=SEe(bEe(l,uZe[m],"bgColor",...b),Yx.bgColor.close,this[fM]);return Uoe(this,k,this[CU])}}}}var g5t=Object.defineProperties(()=>{},{..._M,level:{enumerable:!0,get(){return this[vEe].level},set(l){this[vEe].level=l}}}),SEe=t((l,u,m)=>{let b,k;return m===void 0?(b=l,k=u):(b=m.openAll+l,k=u+m.closeAll),{open:l,close:u,openAll:b,closeAll:k,parent:m}},"createStyler"),Uoe=t((l,u,m)=>{let b=t((...k)=>y5t(b,k.length===1?""+k[0]:k.join(" ")),"builder");return Object.setPrototypeOf(b,g5t),b[vEe]=l,b[fM]=u,b[CU]=m,b},"createBuilder"),y5t=t((l,u)=>{if(l.level<=0||!u)return l[CU]?"":u;let m=l[fM];if(m===void 0)return u;let{openAll:b,closeAll:k}=m;if(u.includes("\x1B"))for(;m!==void 0;)u=aZe(u,m.close,m.open),m=m.parent;let I=u.indexOf(`
525
- `);return I!==-1&&(u=oZe(u,k,b,I)),b+u+k},"applyStyle");Object.defineProperties(EU.prototype,_M);var TYt=EU(),kYt=EU({level:lZe?lZe.level:0});var kA=new Voe;function TEe(l){console.log(l)}t(TEe,"log");function cS(l){console.log(`[INFO] ${l}`)}t(cS,"logInfo");function PU(l){console.log(kA.green(`[SUCCESS] ${l}`))}t(PU,"logSuccess");function WN(l,u){l instanceof Error?console.log(kA.red(`[ERROR] ${u||l.message}`)):console.log(kA.red(`[ERROR] ${l}`))}t(WN,"logError");function Woe(l){console.log(kA.bgYellow(`==== ${l} ====`))}t(Woe,"logBanner");var _Ze=Zm(require("fs"));function pM(){return"0.16.0"}t(pM,"getVersion");var RYt=Zm(dZe());var kEe=Symbol("options_key");function qu(l){return(u,m)=>{var b,k;if(l!=null){let I={...Reflect.getMetadata(kEe,u)||{},[m]:{...l,describe:l.envAlias?`${l.describe||""} [${l.envAlias}]`:l.describe,type:l.type||((k=(b=Reflect.getMetadata("design:type",u,m))==null?void 0:b.name)==null?void 0:k.toLowerCase())}};Reflect.defineMetadata(kEe,I,u)}}}t(qu,"YargOption");function mZe(l){let u=Reflect.getMetadata(kEe,l.prototype);if(!u)throw new Error(`Options for ${l.name} were not defined`);return u}t(mZe,"getYargsOption");function Hoe(l){return async u=>u.options(v5t(l)).middleware(async m=>await b5t(l,m),!0)}t(Hoe,"getBuilder");function v5t(l){return Object.entries(mZe(l)).reduce((u,[m,b])=>(u[m]=Object.fromEntries(Object.entries(b).filter(([k])=>!["envAlias","default"].includes(k))),u),{})}t(v5t,"getYargsOptions");async function b5t(l,u){let m=new l;for(let[b,k]of Object.entries(mZe(l)))m[b]=u[b]??k.default;return m}t(b5t,"loadYargsConfig");var $nt=Zm(dwe());var Wtt={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"},Htt={"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 Zrt=Zm(Gtt());var lT={query:"useQuery",infiniteQuery:"useInfiniteQuery",mutation:"useMutation"},Ztt={bindings:[lT.query,lT.infiniteQuery,lT.mutation],from:"@tanstack/react-query"},yW={pageParamName:"page"},Kce={pageParamName:"page",totalItemsName:"totalItems",limitParamName:"limit"},vW="moduleName";var mwe={"Content-Type":"application/json",Accept:"application/json"},ele="data",hwe="axios",qA="config",AC="AxiosRequestConfig",tle={defaultImport:hwe,bindings:[AC],from:"axios"};var Qtt=t(l=>/^(?:[a-zA-Z_$][a-zA-Z0-9_$]*|[0-9]+)$/.test(l),"isValidPropertyName"),zA=t(l=>l.replace(/^[^a-zA-Z_$]*/g,"").replace(/[^a-zA-Z0-9_$]+(\w)?/g,(u,m)=>(m==null?void 0:m.toUpperCase())??""),"invalidVariableNameCharactersToCamel");function l_(l){return l!=null&&Object.prototype.hasOwnProperty.call(l,"$ref")}t(l_,"isReferenceObject");function Ym(l){return!l_(l)}t(Ym,"isSchemaObject");function rle(l){return l.type==="array"}t(rle,"isArraySchemaObject");function Ytt(l){if(!l.allOf)throw new Error("Function inferRequiredSchema is specialized to handle item with required only in an allOf array.");let[u,m]=l.allOf.reduce((k,I)=>{if(gVt(I)){let R=I.required;k[0].push(...R??[])}else k[1].push(I);return k},[[],[]]),b={properties:u.reduce((k,I)=>(k[I]={},k),{}),type:"object",required:u};return{noRequiredOnlyAllof:m,composedRequiredSchema:b,patchRequiredSchemaInLoop:t((k,I)=>{if(l_(k)){let R=I(k.$ref);R&&b.required.forEach(Z=>{var ce;b.properties[Z]=((ce=R==null?void 0:R.properties)==null?void 0:ce[Z])??{}})}else{let R=k.properties??{};b.required.forEach(Z=>{R[Z]&&(b.properties[Z]=R[Z]??{})})}},"patchRequiredSchemaInLoop")}}t(Ytt,"inferRequiredSchema");var gVt=t(l=>!l_(l)&&!!l.required&&!l.type&&!l.properties&&!(l!=null&&l.allOf)&&!(l!=null&&l.anyOf)&&!l.oneOf,"isBrokenAllOfItem");var i6=Symbol.for("@ts-pattern/matcher"),yVt=Symbol.for("@ts-pattern/isVariadic"),ile="@ts-pattern/anonymous-select-key",gwe=t(l=>!!(l&&typeof l=="object"),"r"),nle=t(l=>l&&!!l[i6],"i"),NC=t((l,u,m)=>{if(nle(l)){let b=l[i6](),{matched:k,selections:I}=b.match(u);return k&&I&&Object.keys(I).forEach(R=>m(R,I[R])),k}if(gwe(l)){if(!gwe(u))return!1;if(Array.isArray(l)){if(!Array.isArray(u))return!1;let b=[],k=[],I=[];for(let R of l.keys()){let Z=l[R];nle(Z)&&Z[yVt]?I.push(Z):I.length?k.push(Z):b.push(Z)}if(I.length){if(I.length>1)throw new Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");if(u.length<b.length+k.length)return!1;let R=u.slice(0,b.length),Z=k.length===0?[]:u.slice(-k.length),ce=u.slice(b.length,k.length===0?1/0:-k.length);return b.every((re,de)=>NC(re,R[de],m))&&k.every((re,de)=>NC(re,Z[de],m))&&(I.length===0||NC(I[0],ce,m))}return l.length===u.length&&l.every((R,Z)=>NC(R,u[Z],m))}return Reflect.ownKeys(l).every(b=>{let k=l[b];return(b in u||nle(I=k)&&I[i6]().matcherType==="optional")&&NC(k,u[b],m);var I})}return Object.is(u,l)},"s"),GA=t(l=>{var u,m,b;return gwe(l)?nle(l)?(u=(m=(b=l[i6]()).getSelectionKeys)==null?void 0:m.call(b))!=null?u:[]:Array.isArray(l)?SW(l,GA):SW(Object.values(l),GA):[]},"o"),SW=t((l,u)=>l.reduce((m,b)=>m.concat(u(b)),[]),"c");function dS(l){return Object.assign(l,{optional:t(()=>vVt(l),"optional"),and:t(u=>Qp(l,u),"and"),or:t(u=>bVt(l,u),"or"),select:t(u=>u===void 0?Xtt(l):Xtt(u,l),"select")})}t(dS,"u");function vVt(l){return dS({[i6]:()=>({match:t(u=>{let m={},b=t((k,I)=>{m[k]=I},"r");return u===void 0?(GA(l).forEach(k=>b(k,void 0)),{matched:!0,selections:m}):{matched:NC(l,u,b),selections:m}},"match"),getSelectionKeys:t(()=>GA(l),"getSelectionKeys"),matcherType:"optional"})})}t(vVt,"h");function Qp(...l){return dS({[i6]:()=>({match:t(u=>{let m={},b=t((k,I)=>{m[k]=I},"r");return{matched:l.every(k=>NC(k,u,b)),selections:m}},"match"),getSelectionKeys:t(()=>SW(l,GA),"getSelectionKeys"),matcherType:"and"})})}t(Qp,"m");function bVt(...l){return dS({[i6]:()=>({match:t(u=>{let m={},b=t((k,I)=>{m[k]=I},"r");return SW(l,GA).forEach(k=>b(k,void 0)),{matched:l.some(k=>NC(k,u,b)),selections:m}},"match"),getSelectionKeys:t(()=>SW(l,GA),"getSelectionKeys"),matcherType:"or"})})}t(bVt,"d");function Af(l){return{[i6]:()=>({match:t(u=>({matched:!!l(u)}),"match")})}}t(Af,"p");function Xtt(...l){let u=typeof l[0]=="string"?l[0]:void 0,m=l.length===2?l[1]:typeof l[0]=="string"?void 0:l[0];return dS({[i6]:()=>({match:t(b=>{let k={[u??ile]:b};return{matched:m===void 0||NC(m,b,(I,R)=>{k[I]=R}),selections:k}},"match"),getSelectionKeys:t(()=>[u??ile].concat(m===void 0?[]:GA(m)),"getSelectionKeys")})})}t(Xtt,"y");function DC(l){return typeof l=="number"}t(DC,"v");function VA(l){return typeof l=="string"}t(VA,"b");function UA(l){return typeof l=="bigint"}t(UA,"w");var nnr=dS(Af(function(l){return!0}));var WA=t(l=>Object.assign(dS(l),{startsWith:t(u=>{return WA(Qp(l,(m=u,Af(b=>VA(b)&&b.startsWith(m)))));var m},"startsWith"),endsWith:t(u=>{return WA(Qp(l,(m=u,Af(b=>VA(b)&&b.endsWith(m)))));var m},"endsWith"),minLength:t(u=>WA(Qp(l,(m=>Af(b=>VA(b)&&b.length>=m))(u))),"minLength"),length:t(u=>WA(Qp(l,(m=>Af(b=>VA(b)&&b.length===m))(u))),"length"),maxLength:t(u=>WA(Qp(l,(m=>Af(b=>VA(b)&&b.length<=m))(u))),"maxLength"),includes:t(u=>{return WA(Qp(l,(m=u,Af(b=>VA(b)&&b.includes(m)))));var m},"includes"),regex:t(u=>{return WA(Qp(l,(m=u,Af(b=>VA(b)&&!!b.match(m)))));var m},"regex")}),"j"),inr=WA(Af(VA)),IC=t(l=>Object.assign(dS(l),{between:t((u,m)=>IC(Qp(l,((b,k)=>Af(I=>DC(I)&&b<=I&&k>=I))(u,m))),"between"),lt:t(u=>IC(Qp(l,(m=>Af(b=>DC(b)&&b<m))(u))),"lt"),gt:t(u=>IC(Qp(l,(m=>Af(b=>DC(b)&&b>m))(u))),"gt"),lte:t(u=>IC(Qp(l,(m=>Af(b=>DC(b)&&b<=m))(u))),"lte"),gte:t(u=>IC(Qp(l,(m=>Af(b=>DC(b)&&b>=m))(u))),"gte"),int:t(()=>IC(Qp(l,Af(u=>DC(u)&&Number.isInteger(u)))),"int"),finite:t(()=>IC(Qp(l,Af(u=>DC(u)&&Number.isFinite(u)))),"finite"),positive:t(()=>IC(Qp(l,Af(u=>DC(u)&&u>0))),"positive"),negative:t(()=>IC(Qp(l,Af(u=>DC(u)&&u<0))),"negative")}),"x"),snr=IC(Af(DC)),HA=t(l=>Object.assign(dS(l),{between:t((u,m)=>HA(Qp(l,((b,k)=>Af(I=>UA(I)&&b<=I&&k>=I))(u,m))),"between"),lt:t(u=>HA(Qp(l,(m=>Af(b=>UA(b)&&b<m))(u))),"lt"),gt:t(u=>HA(Qp(l,(m=>Af(b=>UA(b)&&b>m))(u))),"gt"),lte:t(u=>HA(Qp(l,(m=>Af(b=>UA(b)&&b<=m))(u))),"lte"),gte:t(u=>HA(Qp(l,(m=>Af(b=>UA(b)&&b>=m))(u))),"gte"),positive:t(()=>HA(Qp(l,Af(u=>UA(u)&&u>0))),"positive"),negative:t(()=>HA(Qp(l,Af(u=>UA(u)&&u<0))),"negative")}),"A"),anr=HA(Af(UA)),onr=dS(Af(function(l){return typeof l=="boolean"})),cnr=dS(Af(function(l){return typeof l=="symbol"})),lnr=dS(Af(function(l){return l==null})),unr=dS(Af(function(l){return l!=null}));var Swe=class Swe extends Error{constructor(u){let m;try{m=JSON.stringify(u)}catch{m=u}super(`Pattern matching error: no pattern matches value ${m}`),this.input=void 0,this.input=u}};t(Swe,"W");var ywe=Swe,vwe={matched:!1,value:void 0};function Zy(l){return new bwe(l,vwe)}t(Zy,"z");var bW=class bW{constructor(u,m){this.input=void 0,this.state=void 0,this.input=u,this.state=m}with(...u){if(this.state.matched)return this;let m=u[u.length-1],b=[u[0]],k;u.length===3&&typeof u[1]=="function"?k=u[1]:u.length>2&&b.push(...u.slice(1,u.length-1));let I=!1,R={},Z=t((re,de)=>{I=!0,R[re]=de},"a"),ce=!b.some(re=>NC(re,this.input,Z))||k&&!k(this.input)?vwe:{matched:!0,value:m(I?ile in R?R[ile]:R:this.input,this.input)};return new bW(this.input,ce)}when(u,m){if(this.state.matched)return this;let b=!!u(this.input);return new bW(this.input,b?{matched:!0,value:m(this.input,this.input)}:vwe)}otherwise(u){return this.state.matched?this.state.value:u(this.input)}exhaustive(){if(this.state.matched)return this.state.value;throw new ywe(this.input)}run(){return this.exhaustive()}returnType(){return this}};t(bW,"I");var bwe=bW;var xwe=2,Ktt=["application/octet-stream","multipart/form-data","application/x-www-form-urlencoded","*/*"],ert=["query","header","path"],d8=["get","put","post","delete","options","head","patch","trace"],trt=["string","number","integer","boolean"],xW=["allOf","anyOf","oneOf"];var $_=t(l=>l.charAt(0).toUpperCase()+l.slice(1),"capitalize"),ZA=t(l=>l.charAt(0).toLowerCase()+l.slice(1),"decapitalize"),rrt=t(l=>l.replace(/(-\w)/g,u=>u[1].toUpperCase()),"kebabToCamel"),mg=t(l=>l.replace(/(_\w)/g,u=>u[1].toUpperCase()),"snakeToCamel"),nrt=t(l=>l.replace(/[\W_]+(\w)?/g,(u,m)=>(m==null?void 0:m.toUpperCase())??""),"nonWordCharactersToCamel"),Twe=t((l,u="")=>l.endsWith(u)?l:`${l}${u}`,"suffixIfNeeded"),irt=t((l,u)=>l.replace(new RegExp(`${u}$`),""),"removeSuffix"),SVt=t(l=>{var b;let u=l.reduce((k,I)=>({...k,[I]:(k[I]??0)+1}),{});return(b=Object.entries(u).sort((k,I)=>k[1]===I[1]?I[0].length-k[0].length:I[1]-k[1])[0])==null?void 0:b[0]},"getLongestMostCommon"),kwe=t(l=>{let u=l.map($_).map(srt).map(m=>xVt(m)).flat();return SVt(u)},"getMostCommonAdjacentCombinationSplit"),srt=t(l=>l.split(/(?<![A-Z])(?=[A-Z])/).filter(Boolean),"splitByUppercase"),art=t(l=>srt(l).join(" "),"camelToSpaceSeparated"),xVt=t((l,u=["dto","by","for","of","in","to","and","with"])=>{var b;let m=[];for(let k=0;k<l.length;k++)if(!u.includes(l[k].toLowerCase()))for(let I=k+1;I<=l.length;I++)u.includes((b=l[I-1])==null?void 0:b.toLowerCase())||m.push(l.slice(k,I).join(""));return m},"getAdjacentStringCombinations"),ort=t((l,u)=>{let m=u.replace(/es$|s$/g,""),b=new RegExp(`(${ZA(m)}|${$_(m)})[a-z]*(?=$|[A-Z])`,"g");return l.replace(b,"")},"removeWord");var lrt=t(l=>`#/components/schemas/${l}`,"getSchemaRef"),m8=t(l=>l[1]==="/"?l:"#/"+l.slice(1),"autocorrectRef"),XM=t(l=>m8(l).split("/").at(-1),"getSchemaNameByRef");function Ewe(l){let u=TVt(l).normalize("NFKD").trim().replace(/\s+/g,"_").replace(/--+/g,"-").replace(/-+/g,"_").replace(/[^\w-]+/g,"_");return mg(u)}t(Ewe,"normalizeString");function urt(l){return/^[a-zA-Z]\w*$/.test(l)?l:`"${l}"`}t(urt,"wrapWithQuotesIfNeeded");function frt(l){return typeof l=="string"&&l.startsWith('"')&&l.endsWith('"')?l.slice(1,-1):l}t(frt,"unwrapQuotesIfNeeded");function TVt(l){let u=Number(l[0]);return typeof u=="number"&&!Number.isNaN(u)?"_"+l:l}t(TVt,"prefixStringStartingWithNumberIfNeeded");function Pwe(l){let u=l.replaceAll("_","#");return mg(u.replaceAll("-","_")).replaceAll("#","_")}t(Pwe,"pathParamToVariableName");var OC=t(l=>trt.includes(l),"isPrimitiveType");function _rt(l){return l.replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/([\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F-\u009F\uFFFE\uFFFF])/g,(u,m)=>{let b=m.codePointAt(),k=b.toString(16);return b<=255?`\\x${`00${k}`.slice(-2)}`:`\\u${`0000${k}`.slice(-4)}`}).replace(/\//g,"\\/")}t(_rt,"escapeControlCharacters");function FC(l){return l.includes("application/")&&l.includes("json")||Ktt.includes(l)||l.includes("text/")}t(FC,"isParamMediaTypeAllowed");function TW(l){return l>=200&&l<300}t(TW,"isMainResponseStatus");function sle(l){return!(l>=200&&l<300)}t(sle,"isErrorStatus");function ale(l){return l.startsWith("application/")}t(ale,"isMediaTypeAllowed");var crt=/({\w+})/g,kVt=/[^\w\-]+/g;function prt(l){l=$_(rrt(l.replaceAll("/","-")).replaceAll("-",""));let u=[...l.matchAll(crt)];if(u.length>0){let m=u.sort((b,k)=>b.index-k.index)[u.length-1][0];l=`${l.replace(crt,"")}By${$_(m.slice(1,-1))}`}return l.replace(kVt,"_")}t(prt,"pathToVariableName");var Cwe=/{(\b\w+(?:-\w+)*\b)}/g;function drt(l){let u=l.match(Cwe);return u===null?l.replaceAll(Cwe,":$1"):(u.forEach(m=>{let b=Pwe(m.replaceAll(Cwe,":$1"));l=l.replaceAll(m,b)}),l)}t(drt,"replaceHyphenatedPath");var mrt=t(l=>{let u=l["x-enumNames"],m=Array.isArray(u)&&u.length>0,b=!!l.schema&&Ym(l.schema)&&l.schema.type==="string";return m&&b},"isSortingParameterObject"),h8=t((l,u)=>u.excludePathRegex?new RegExp(u.excludePathRegex).test(l):!1,"isPathExcluded");var Db=t(l=>l.method==="get","isQuery"),YA=t(l=>l.method!=="get"||!!l.mediaDownload,"isMutation"),KM=t((l,u)=>Db(l)&&(u??Object.values(yW)).every(m=>l.parameters.some(b=>b.name===m&&b.type==="Query")),"isInfiniteQuery"),hrt=t((l,u,m)=>{let b=m.reduce((k,I)=>[...k,...QA(l,I,{includeOnlyRequiredParams:!0}).map(R=>R.name)],[]);return QA(l,u,{includeOnlyRequiredParams:!0,excludeBodyParam:!0}).filter(k=>b.includes(k.name)).map(k=>k.name)},"getDestructuredVariables");function XA(l){return nrt(l)}t(XA,"formatTag");function KA(l,u){var b;let m=(b=l.tags)==null?void 0:b[0];return XA(m??u.defaultTag)}t(KA,"getOperationTag");function grt(l,u){return u.excludeTags.some(m=>m.toLowerCase()===l.toLowerCase())}t(grt,"isTagExcluded");var ole={fileName:"acl/app.ability",extension:"ts"},kW="AllAbilities",CW="AppAbilities",cle={fileName:"acl/useAclCheck",extension:"ts"},e3="useAclCheck",Qy={abilityTuple:"AbilityTuple",pureAbility:"PureAbility",forcedSubject:"ForcedSubject",subjectType:"Subject",subject:"subject"},wwe={bindings:[Qy.abilityTuple,Qy.pureAbility,Qy.forcedSubject,Qy.subjectType,Qy.subject],from:"@casl/ability"};var EW="AppRestClient",lle={query:"AppQueryOptions",infiniteQuery:"AppInfiniteQueryOptions",mutation:"AppMutationOptions"},Awe="src/data",Dwe="@/data",g8={appRestClient:"@/util/rest/clients/app-rest-client",queryTypes:"@/types/react-query",errorHandling:"@/util/vendor/error-handling",abilityContext:"@/data/acl/ability.context"},t3={ErrorHandler:"ErrorHandler",SharedErrorHandler:"SharedErrorHandler"},ule={bindings:[t3.ErrorHandler,t3.SharedErrorHandler],from:g8.errorHandling},Iwe="AbilityContext",yrt={bindings:[Iwe],from:g8.abilityContext};var fle={reactQueryTypes:{fileName:"react-query.types",extension:"ts"},restClient:{fileName:"rest-client",extension:"ts"},restInterceptor:{fileName:"rest-interceptor",extension:"ts"}},_le={fileName:"app-rest-client",extension:"ts"},Nwe="QueryModule",ple={fileName:"queryModules",extension:"ts"},vrt={fileName:"queryConfig.context",extension:"tsx"},eL={optionsType:"MutationEffectsOptions",hookName:"useMutationEffects",runFunctionName:"runMutationEffects"},dle={fileName:"useMutationEffects",extension:"ts"},hg={namespace:"ZodUtils",exports:{parse:"parse",sortExp:"sortExp",brand:"brand"}},mle={fileName:"zod.utils",extension:"ts"};var Ib=t((...l)=>[...new Set(l.flat())],"getUniqueArray");var brt=t(l=>`Use${$_(mg(l.operationName))}Ability`,"getAbilityTypeName"),PW=t(l=>`canUse${$_(mg(l.operationName))}`,"getAbilityFunctionName"),Srt=t((l,u)=>`${u.tsNamespaces?`${Np({type:"acl",tag:r3(l,u),options:u})}.`:""}${PW(l)}`,"getImportedAbilityFunctionName"),xrt=t(l=>{var u;return(u=l.acl)==null?void 0:u[0].action},"getAbilityAction"),Trt=t(l=>{var u;return(u=l.acl)==null?void 0:u[0].subject},"getAbilitySubject"),hle=t(l=>{var u;return!!((u=wW(l))!=null&&u.length)},"hasAbilityConditions"),wW=t(l=>{var u;return(u=l.acl)==null?void 0:u[0].conditionsTypes},"getAbilityConditionsTypes"),krt=t(l=>{var u;return(u=l.acl)==null?void 0:u[0].description},"getAbilityDescription"),gle=t(l=>`${$_(l)}${kW}`,"getTagAllAbilitiesName");var Crt="Schema",Ert="Enum",Prt="Body",wrt="Param",Art="Response",Drt="ErrorResponse",AW="z.void()",yle="z.instanceof(Blob)",DW="z.enum",vle="z.string()",tL={bindings:["z"],from:"zod"};function ny(l,u){if(!l)return;let{data:m,onSchema:b}=u;if(l_(l)&&b({type:"reference",schema:l,data:m})===!0)return;let k=l;if(xW.some(I=>I in k&&k[I])){let I=k.allOf??k.anyOf??k.oneOf??[];for(let R of I)(b==null?void 0:b({type:"composite",parentSchema:l,schema:R,data:m}))!==!0&&ny(R,{data:m,onSchema:b})}if(k.properties)for(let[I,R]of Object.entries(k.properties))b({type:"property",parentSchema:l,schema:R,data:m,propertyName:I})!==!0&&ny(R,u);if(k.additionalProperties&&typeof k.additionalProperties=="object"){if(b({type:"additionalProperties",parentSchema:l,schema:k.additionalProperties,data:m})===!0)return;ny(k.additionalProperties,u)}if(k.type==="array"){let I=l.items;if(b({type:"array",parentSchema:l,schema:I,data:m})===!0)return;ny(I,u)}}t(ny,"iterateSchema");var MC=t((l,u)=>Twe($_(Ewe(l)),u),"getZodSchemaName"),IW=t((l,u,m)=>Twe($_(Ewe(l)),`${u}${m}`),"getEnumZodSchemaName"),Yy=t(l=>["z.",`${hg.namespace}.`].every(u=>!l.startsWith(u)),"isNamedZodSchema"),Irt=t(l=>l.startsWith(DW),"isEnumZodSchema"),y8=t((l,u,m)=>u?l:`${m}_${l}`,"getZodSchemaOperationName"),ble=t(l=>mg(`${l}_${Prt}`),"getBodyZodSchemaName"),Nrt=t((l,u)=>mg(`${l}_${u}${wrt}`),"getParamZodSchemaName"),CVt=t(l=>mg(`${l}${Art}`),"getMainResponseZodSchemaName"),EVt=t((l,u)=>mg(`${l}_${u}_${Drt}`),"getErrorResponseZodSchemaName");function Sle({statusCode:l,operationName:u,isUniqueOperationName:m,tag:b}){let k=Number(l),I=y8(u,m,b);return!TW(k)&&l!=="default"&&sle(k)?EVt(I,l):CVt(I)}t(Sle,"getResponseZodSchemaName");function NW(l){return["minimum","exclusiveMinimum","maximum","exclusiveMaximum","minItems","minLength","minProperties","maxItems","maxLength","maxProperties","default","example"].filter(b=>l[b]).reduce((b,k)=>[...b,`${$_(art(k))}: \`${l[k]}\``],[])}t(NW,"getSchemaDescriptions");var OW=t((l,u)=>irt(l,u.schemaSuffix),"getZodSchemaInferedTypeName"),Ort=t((l,u)=>Yy(u)?`${l.options.tsNamespaces?`${Np({type:"models",tag:l.getTagByZodSchemaName(u),options:l.options})}.`:""}${u}`:u,"getImportedZodSchemaName"),v8=t((l,u,m)=>{if(!Yy(u))return u===AW?"void":u;let b=l.getTagByZodSchemaName(u);return`${l.options.tsNamespaces&&b!==m?`${Np({type:"models",tag:b,options:l.options})}.`:""}${OW(u,l.options)}`},"getImportedZodSchemaInferedTypeName");function Frt(l){var u;return l.isEnum?"enum":((u=l.schemaObj)==null?void 0:u.type)??"object"}t(Frt,"getZodSchemaType");function Mrt(l){if(l.schemaObj)return[l.schemaObj.description,...NW(l.schemaObj)].filter(Boolean).join(". ")}t(Mrt,"getZodSchemaDescription");function Lrt(l,u,m){var b;if(l_(u)){let k=l.getZodSchemaNameByRef(u.$ref);return k?v8(l,k,m):void 0}if(rle(u)){if(!l_(u.items))return`${((b=u.items)==null?void 0:b.type)??"unknown"}[]`;let k=l.getZodSchemaNameByRef(u.items.$ref);return k?`${v8(l,k,m)}[]`:void 0}if(xW.some(k=>k in u&&u[k])){let k=u.allOf??u.anyOf??u.oneOf??[];if(k.length>0)return Lrt(l,k[0],m)}return u.type}t(Lrt,"getType");function Rrt(l,u,m){if(!u.schemaObj)return[];let b="[0]",k="[key]",I={},R=t(Z=>{var re;if(Z.type==="reference")return!0;if(Z.type==="composite")return;let ce=[...((re=Z.data)==null?void 0:re.pathSegments)??[]];if(Z.type==="array"?ce.push(b):Z.type==="property"?ce.push(Z.propertyName):Z.type==="additionalProperties"&&ce.push(k),Z.schema&&ce[ce.length-1]!==b){let de=l.resolveObject(Z.schema),ke=[de.description,...NW(de)].filter(Boolean),et=ce.join(".");I[et]&&"type"in Z.schema&&Z.schema.type==="object"||(delete I[et],I[et]={type:Lrt(l,Z.schema,m)??"unknown",description:ke.join(". ")})}return ny(Z.schema,{data:{pathSegments:[...ce]},onSchema:R}),!0},"onSchema");return"allOf"in u.schemaObj&&u.schemaObj.allOf&&u.schemaObj.allOf.forEach(Z=>{if(l_(Z)){let ce=l.resolveObject(Z);ny(ce,{data:{pathSegments:[]},onSchema:R})}}),ny(u.schemaObj,{data:{pathSegments:[]},onSchema:R}),I}t(Rrt,"getZodSchemaPropertyDescriptions");function n3({resolver:l,tag:u,zodSchemas:m=[],zodSchemasAsTypes:b=[]}){let k="models",I=t(ce=>l.getTagByZodSchemaName(ce),"getTag"),R=xle({type:k,tag:u,entities:m,getTag:I,getEntityName:t(ce=>ce,"getEntityName"),options:l.options}),Z=xle({type:k,tag:u,entities:b,getTag:I,getEntityName:t(ce=>OW(ce,l.options),"getEntityName"),options:l.options});return PVt(l.options,R,Z)}t(n3,"getModelsImports");function jrt({tag:l,endpoints:u,options:m}){return xle({type:"endpoints",tag:l,entities:u,getTag:t(b=>r3(b,m),"getTag"),getEntityName:FW,options:m})}t(jrt,"getEndpointsImports");function Brt({tag:l,endpoints:u,options:m}){return xle({type:"acl",tag:l,entities:u,getTag:t(b=>r3(b,m),"getTag"),getEntityName:PW,options:m})}t(Brt,"getAclImports");function $rt({tags:l,entityName:u,getAliasEntityName:m,type:b,options:k}){let I=new Map;return l.forEach(R=>{let Z=`${u}${m?` as ${m(R)}`:""}`;I.has(R)?k.tsNamespaces||I.get(R).bindings.push(Z):I.set(R,{bindings:[k.tsNamespaces?Np({type:b,tag:R,options:k}):Z],from:`${LC(k)}${Tle({type:b,tag:R,includeTagDir:!0,options:k})}`})}),Array.from(I.values())}t($rt,"getEntityImports");function LC(l){let u=Dwe;return l.importPath==="relative"?u="../":l.importPath==="absolute"?u=l.output:new RegExp(`${Awe}`,"g").test(l.output)&&(u=l.output.replace(new RegExp(`.*${Awe}`,"g"),Dwe)),`${u}/`.replace(/\/\//g,"/")}t(LC,"getImportPath");function xle({type:l="models",tag:u,entities:m,getTag:b,getEntityName:k,options:I}){let R=new Map;return m.forEach(Z=>{let ce=b(Z);if(R.has(ce))I.tsNamespaces||R.get(ce).bindings.push(k(Z));else{let re=u===ce;R.set(ce,{bindings:[I.tsNamespaces?Np({type:l,tag:ce,options:I}):k(Z)],from:`${re?"./":LC(I)}${Tle({type:l,tag:ce,includeTagDir:!re,options:I})}`})}}),Array.from(R.values())}t(xle,"getImports");function PVt(l,...u){let m=new Map;return u.forEach(b=>{b.forEach(k=>{m.has(k.from)?l.tsNamespaces||m.get(k.from).bindings.push(...k.bindings):m.set(k.from,k)})}),Array.from(m.values()).map(b=>({...b,bindings:Ib(b.bindings)}))}t(PVt,"mergeImports");function b8({fileName:l,extension:u}){return`${l}.${u}`}t(b8,"getFileNameWithExtension");function Jrt({type:l,tag:u,options:m,includeTagDir:b=!0}){let k=m.configs[l].outputFileNameSuffix;return u?`${b?`${ZA(u)}/`:""}${ZA(u)}.${k}`:k}t(Jrt,"getTagFileNameWithoutExtension");function Tle(...l){return Jrt(...l)}t(Tle,"getTagImportPath");function kle(...l){return`${Jrt(...l)}.ts`}t(kle,"getTagFileName");var Np=t(({type:l,tag:u,options:m})=>`${$_(u)}${m.configs[l].namespaceSuffix}`,"getNamespaceName");function qrt(l){return l.standalone?`${LC(l)}${_le.fileName}`:l.restClientImportPath}t(qrt,"getAppRestClientImportPath");function zrt(l){return l.standalone?`${LC(l)}${fle.reactQueryTypes.fileName}`:l.queryTypesImportPath}t(zrt,"getQueryTypesImportPath");function Vrt(l){return`${LC(l)}${ple.fileName}`}t(Vrt,"getQueryModulesImportPath");function Urt(l){return`${LC(l)}${dle.fileName}`}t(Urt,"getMutationEffectsImportPath");function Wrt(l){return`${LC(l)}${cle.fileName}`}t(Wrt,"getAclCheckImportPath");function Cle(l){return`${LC(l)}${mle.fileName}`}t(Cle,"getZodUtilsImportPath");function Hrt(l){return`${LC(l)}${ole.fileName}`}t(Hrt,"getAppAbilitiesImportPath");function Grt(l){return Zy(l).with("string",()=>"string").with("number",()=>"number").with("integer",()=>"number").with("boolean",()=>"boolean").exhaustive()}t(Grt,"primitiveTypeToTsType");var FW=t(l=>ZA(mg(l.operationName)),"getEndpointName");function Qrt(l,u){return`${u.tsNamespaces?`${Np({type:"endpoints",tag:r3(l,u),options:u})}.`:""}${FW(l)}`}t(Qrt,"getImportedEndpointName");var Yrt=t(l=>l.method!==Zrt.OpenAPIV3.HttpMethods.GET,"requiresBody"),Ele=t(l=>l.parameters.find(u=>u.type==="Body"),"getEndpointBody"),Xrt=t((l,u)=>{let m=Owe(l),b=u.options.axiosRequestConfig;return Object.keys(m).length>0||b},"hasEndpointConfig"),Krt=t(l=>l.path.replace(/:([a-zA-Z0-9_]+)/g,"${$1}"),"getEndpointPath");function r3(l,u){var b;let m=u.splitByTags?(b=l.tags)==null?void 0:b[0]:u.defaultTag;return XA(m??u.defaultTag)}t(r3,"getEndpointTag");function QA(l,u,m){let b=u.parameters.map(k=>{var R,Z,ce,re;let I="string";if(Yy(k.zodSchema))I=v8(l,k.zodSchema);else if((R=k.parameterObject)!=null&&R.schema&&Ym(k.parameterObject.schema)){let de=(ce=(Z=k.parameterObject)==null?void 0:Z.schema)==null?void 0:ce.type;de&&OC(de)&&(I=Grt(de))}return{name:zA(k.name),type:I,paramType:k.type,required:((re=k.parameterObject)==null?void 0:re.required)??!0,parameterObject:k.parameterObject,bodyObject:k.bodyObject}});return m!=null&&m.includeFileParam&&u.mediaUpload&&b.push({name:"file",type:"File",paramType:"Body",required:!0,parameterObject:void 0,bodyObject:void 0}),b.sort((k,I)=>{if(k.required===I.required){let R=["Path","Body","Query","Header"];return R.indexOf(k.paramType)-R.indexOf(I.paramType)}return k.required?-1:1}).filter(k=>(!(m!=null&&m.excludeBodyParam)||k.name!==ele)&&(!(m!=null&&m.excludePageParam)||k.name!==yW.pageParamName)&&(!(m!=null&&m.includeOnlyRequiredParams)||k.required)).map(k=>({...k,name:m!=null&&m.replacePageParam&&k.name===yW.pageParamName?"pageParam":k.name,required:k.required&&(k.paramType==="Path"||!(m!=null&&m.pathParamsRequiredOnly))}))}t(QA,"mapEndpointParamsToFunctionParams");function Owe(l){let u=l.parameters.filter(k=>k.type==="Query").map(k=>{let I=Qtt(k.name)?k.name:`"${k.name}"`,R=zA(k.name);return{...k,name:I,value:R}}),m={};return l.requestFormat!==mwe["Content-Type"]&&(m["Content-Type"]=`'${l.requestFormat}'`),l.responseFormat&&l.responseFormat!==mwe.Accept&&(m.Accept=`'${l.responseFormat}'`),l.parameters.filter(k=>k.type==="Header").forEach(k=>{m[k.name]=zA(k.name)}),{...u.length>0?{params:u}:{},...Object.keys(m).length?{headers:m}:{}}}t(Owe,"getEndpointConfig");function ent(l,u){return u.filter(m=>Db(m)&&m.parameters.filter(b=>{var k;return(k=b.parameterObject)==null?void 0:k.required}).every(b=>l.parameters.some(k=>k.name===b.name))&&m.response===l.response)}t(ent,"getUpdateQueryEndpoints");var Fwe=["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 S8(l,u){let m={};return Object.keys(l).forEach(b=>{u.includes(b)&&(m[b]=l[b])}),m}t(S8,"pick");function Ple(l,...u){if(u.length===0)return l;let m=l;for(let b of u)m=tnt(m,b);return m}t(Ple,"deepMerge");function tnt(l,u){if(u==null)return l;if(l==null)return rL(u);if(Array.isArray(l)&&Array.isArray(u))return[...l,...u];if(MW(l)&&MW(u)){let m={};for(let[b,k]of Object.entries(l))m[b]=rL(k);for(let[b,k]of Object.entries(u)){let I=m[b];k!==void 0&&(k===null?m[b]=k:MW(I)&&MW(k)?m[b]=tnt(I,k):Array.isArray(I)&&Array.isArray(k)?m[b]=[...I,...k]:m[b]=rL(k))}return m}return rL(u)}t(tnt,"mergeTwoValues");function rL(l){if(l==null||typeof l!="object")return l;if(Array.isArray(l))return l.map(u=>rL(u));if(MW(l)){let u={};for(let[m,b]of Object.entries(l))u[m]=rL(b);return u}return l}t(rL,"deepClone");function MW(l){return l!==null&&typeof l=="object"&&!Array.isArray(l)&&Object.prototype.toString.call(l)==="[object Object]"}t(MW,"isPlainObject");function nL(l,u){let m=l.deprecated&&!u.withDeprecatedEndpoints,b=KA(l,u),k=grt(b,u);return m||k}t(nL,"isOperationExcluded");function Mwe({path:l,method:u,operation:m,options:b,tag:k,keepOperationTag:I,keepOperationPrefix:R}){let Z=`${u}${prt(l)}`,ce=m.operationId?zA(m.operationId):Z;if(b.removeOperationPrefixEndingWith&&R)ce=ce.split(b.removeOperationPrefixEndingWith).map((de,ke)=>ke===0?de:$_(de)).join("");else if(b.removeOperationPrefixEndingWith&&!R){let re=new RegExp(`^.*${b.removeOperationPrefixEndingWith}`);ce=ce.replace(re,"")}if(b.tsNamespaces&&!I){let re=ort(ce,k);re===""?ce=u.toLowerCase():Fwe.includes(re)||(ce=re)}return Fwe.includes(ce)?Z:ce}t(Mwe,"getOperationName");function LW({operationsByTag:l,...u}){let{operation:m,options:b}=u,k=b.splitByTags?KA(m,b):b.defaultTag,I=t(R=>{let Z=Mwe({...u,tag:k,keepOperationTag:R});if(l[k].filter(re=>Mwe({...u,operation:re,tag:k,keepOperationTag:R})===Z).length===1)return Z},"operationName");return I()??I(!0)??Mwe({...u,tag:k,keepOperationTag:!0,keepOperationPrefix:!0})}t(LW,"getUniqueOperationName");function rnt(l,u,m){let b=[];for(let k in l.paths){if(h8(k,m))continue;let I=l.paths[k],R=S8(I,d8);for(let Z in R){let ce=R[Z];if(!ce||nL(ce,m))continue;let re=LW({path:k,method:Z,operation:ce,operationsByTag:u,options:m});b.push(re)}}return b}t(rnt,"getUniqueOperationNamesWithoutSplitByTags");function nnt(l,u){let m={};for(let b in l.paths){if(h8(b,u))continue;let k=l.paths[b],I=S8(k,d8);for(let R in I){let Z=I[R];if(!Z||nL(Z,u))continue;let ce=u.splitByTags?KA(Z,u):u.defaultTag;m[ce]||(m[ce]=[]),m[ce].push(Z)}}return m}t(nnt,"getOperationsByTag");function RW(l){return{type:"invalid-schema",message:l}}t(RW,"getInvalidSchemaError");function int(l){return{type:"invalid-operation-id",message:`Operation ${l}`}}t(int,"getInvalidOperationIdError");function snt(l,u){return{type:"missing-path-parameter",message:`Path ${u} is missing [${l.map(({name:m})=>m).join(", ")}]`}}t(snt,"getMissingPathParameterError");function ant(l){return{type:"not-allowed-inline-enum",message:`${l} is missing @IsEnum() and @ApiProperty(enum:, enumName:)`}}t(ant,"getNotAllowedInlineEnumError");function ont(l){return{type:"not-allowed-circular-schema",message:l}}t(ont,"getNotAllowedCircularSchemaError");function cnt(l,u,m){return{type:"missing-acl-condition-property",message:`Condition property ${l} is not found in parameters or body in operation ${Ale(u,m)}`}}t(cnt,"getMissingAclConditionPropertyError");function Lwe(l,u,m){return{type:"missing-status-code",message:`Missing HTTP status code ${wle(l)} in operation ${Ale(u,m)}`}}t(Lwe,"getMissingStatusCodeError");function lnt(l,u,m){return{type:"invalid-status-code",message:`Operation ${Ale(u,m)} expected HTTP status code ${wle(l.expected)} but received ${wle(l.received)}`}}t(lnt,"getInvalidStatusCodeError");function unt(l,u,m){return{type:"multiple-success-status-codes",message:`Operation ${Ale(u,m)} has multiple success HTTP status codes: ${l.map(wle).join(", ")}`}}t(unt,"getMultipleSuccessStatusCodesError");function Ale(l,u){return l.operationId??`${u.method} ${u.path}`}t(Ale,"getOperationDescriptor");function wle(l){return`${l} (${Wtt[l]})`}t(wle,"getStatusCodeDescription");function fnt(l){return l.reduce((u,m)=>({...u,[m.type]:[...u[m.type]??[],m.message]}),{})}t(fnt,"groupByType");function RC({schema:l,meta:u,options:m}){let b=[];Zy(l.type).with("string",()=>b.push(DVt(l))).with("number","integer",()=>b.push(NVt(l))).with("array",()=>b.push(OVt(l))).otherwise(()=>{}),typeof l.description=="string"&&l.description!==""&&m.withDescription&&([`
525
+ `);return I!==-1&&(u=oZe(u,k,b,I)),b+u+k},"applyStyle");Object.defineProperties(EU.prototype,_M);var TYt=EU(),kYt=EU({level:lZe?lZe.level:0});var kA=new Voe;function TEe(l){console.log(l)}t(TEe,"log");function cS(l){console.log(`[INFO] ${l}`)}t(cS,"logInfo");function PU(l){console.log(kA.green(`[SUCCESS] ${l}`))}t(PU,"logSuccess");function WN(l,u){l instanceof Error?console.log(kA.red(`[ERROR] ${u||l.message}`)):console.log(kA.red(`[ERROR] ${l}`))}t(WN,"logError");function Woe(l){console.log(kA.bgYellow(`==== ${l} ====`))}t(Woe,"logBanner");var _Ze=Zm(require("fs"));function pM(){return"0.16.1"}t(pM,"getVersion");var RYt=Zm(dZe());var kEe=Symbol("options_key");function qu(l){return(u,m)=>{var b,k;if(l!=null){let I={...Reflect.getMetadata(kEe,u)||{},[m]:{...l,describe:l.envAlias?`${l.describe||""} [${l.envAlias}]`:l.describe,type:l.type||((k=(b=Reflect.getMetadata("design:type",u,m))==null?void 0:b.name)==null?void 0:k.toLowerCase())}};Reflect.defineMetadata(kEe,I,u)}}}t(qu,"YargOption");function mZe(l){let u=Reflect.getMetadata(kEe,l.prototype);if(!u)throw new Error(`Options for ${l.name} were not defined`);return u}t(mZe,"getYargsOption");function Hoe(l){return async u=>u.options(v5t(l)).middleware(async m=>await b5t(l,m),!0)}t(Hoe,"getBuilder");function v5t(l){return Object.entries(mZe(l)).reduce((u,[m,b])=>(u[m]=Object.fromEntries(Object.entries(b).filter(([k])=>!["envAlias","default"].includes(k))),u),{})}t(v5t,"getYargsOptions");async function b5t(l,u){let m=new l;for(let[b,k]of Object.entries(mZe(l)))m[b]=u[b]??k.default;return m}t(b5t,"loadYargsConfig");var $nt=Zm(dwe());var Wtt={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"},Htt={"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 Zrt=Zm(Gtt());var lT={query:"useQuery",infiniteQuery:"useInfiniteQuery",mutation:"useMutation"},Ztt={bindings:[lT.query,lT.infiniteQuery,lT.mutation],from:"@tanstack/react-query"},yW={pageParamName:"page"},Kce={pageParamName:"page",totalItemsName:"totalItems",limitParamName:"limit"},vW="moduleName";var mwe={"Content-Type":"application/json",Accept:"application/json"},ele="data",hwe="axios",qA="config",AC="AxiosRequestConfig",tle={defaultImport:hwe,bindings:[AC],from:"axios"};var Qtt=t(l=>/^(?:[a-zA-Z_$][a-zA-Z0-9_$]*|[0-9]+)$/.test(l),"isValidPropertyName"),zA=t(l=>l.replace(/^[^a-zA-Z_$]*/g,"").replace(/[^a-zA-Z0-9_$]+(\w)?/g,(u,m)=>(m==null?void 0:m.toUpperCase())??""),"invalidVariableNameCharactersToCamel");function l_(l){return l!=null&&Object.prototype.hasOwnProperty.call(l,"$ref")}t(l_,"isReferenceObject");function Ym(l){return!l_(l)}t(Ym,"isSchemaObject");function rle(l){return l.type==="array"}t(rle,"isArraySchemaObject");function Ytt(l){if(!l.allOf)throw new Error("Function inferRequiredSchema is specialized to handle item with required only in an allOf array.");let[u,m]=l.allOf.reduce((k,I)=>{if(gVt(I)){let R=I.required;k[0].push(...R??[])}else k[1].push(I);return k},[[],[]]),b={properties:u.reduce((k,I)=>(k[I]={},k),{}),type:"object",required:u};return{noRequiredOnlyAllof:m,composedRequiredSchema:b,patchRequiredSchemaInLoop:t((k,I)=>{if(l_(k)){let R=I(k.$ref);R&&b.required.forEach(Z=>{var ce;b.properties[Z]=((ce=R==null?void 0:R.properties)==null?void 0:ce[Z])??{}})}else{let R=k.properties??{};b.required.forEach(Z=>{R[Z]&&(b.properties[Z]=R[Z]??{})})}},"patchRequiredSchemaInLoop")}}t(Ytt,"inferRequiredSchema");var gVt=t(l=>!l_(l)&&!!l.required&&!l.type&&!l.properties&&!(l!=null&&l.allOf)&&!(l!=null&&l.anyOf)&&!l.oneOf,"isBrokenAllOfItem");var i6=Symbol.for("@ts-pattern/matcher"),yVt=Symbol.for("@ts-pattern/isVariadic"),ile="@ts-pattern/anonymous-select-key",gwe=t(l=>!!(l&&typeof l=="object"),"r"),nle=t(l=>l&&!!l[i6],"i"),NC=t((l,u,m)=>{if(nle(l)){let b=l[i6](),{matched:k,selections:I}=b.match(u);return k&&I&&Object.keys(I).forEach(R=>m(R,I[R])),k}if(gwe(l)){if(!gwe(u))return!1;if(Array.isArray(l)){if(!Array.isArray(u))return!1;let b=[],k=[],I=[];for(let R of l.keys()){let Z=l[R];nle(Z)&&Z[yVt]?I.push(Z):I.length?k.push(Z):b.push(Z)}if(I.length){if(I.length>1)throw new Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");if(u.length<b.length+k.length)return!1;let R=u.slice(0,b.length),Z=k.length===0?[]:u.slice(-k.length),ce=u.slice(b.length,k.length===0?1/0:-k.length);return b.every((re,de)=>NC(re,R[de],m))&&k.every((re,de)=>NC(re,Z[de],m))&&(I.length===0||NC(I[0],ce,m))}return l.length===u.length&&l.every((R,Z)=>NC(R,u[Z],m))}return Reflect.ownKeys(l).every(b=>{let k=l[b];return(b in u||nle(I=k)&&I[i6]().matcherType==="optional")&&NC(k,u[b],m);var I})}return Object.is(u,l)},"s"),GA=t(l=>{var u,m,b;return gwe(l)?nle(l)?(u=(m=(b=l[i6]()).getSelectionKeys)==null?void 0:m.call(b))!=null?u:[]:Array.isArray(l)?SW(l,GA):SW(Object.values(l),GA):[]},"o"),SW=t((l,u)=>l.reduce((m,b)=>m.concat(u(b)),[]),"c");function dS(l){return Object.assign(l,{optional:t(()=>vVt(l),"optional"),and:t(u=>Qp(l,u),"and"),or:t(u=>bVt(l,u),"or"),select:t(u=>u===void 0?Xtt(l):Xtt(u,l),"select")})}t(dS,"u");function vVt(l){return dS({[i6]:()=>({match:t(u=>{let m={},b=t((k,I)=>{m[k]=I},"r");return u===void 0?(GA(l).forEach(k=>b(k,void 0)),{matched:!0,selections:m}):{matched:NC(l,u,b),selections:m}},"match"),getSelectionKeys:t(()=>GA(l),"getSelectionKeys"),matcherType:"optional"})})}t(vVt,"h");function Qp(...l){return dS({[i6]:()=>({match:t(u=>{let m={},b=t((k,I)=>{m[k]=I},"r");return{matched:l.every(k=>NC(k,u,b)),selections:m}},"match"),getSelectionKeys:t(()=>SW(l,GA),"getSelectionKeys"),matcherType:"and"})})}t(Qp,"m");function bVt(...l){return dS({[i6]:()=>({match:t(u=>{let m={},b=t((k,I)=>{m[k]=I},"r");return SW(l,GA).forEach(k=>b(k,void 0)),{matched:l.some(k=>NC(k,u,b)),selections:m}},"match"),getSelectionKeys:t(()=>SW(l,GA),"getSelectionKeys"),matcherType:"or"})})}t(bVt,"d");function Af(l){return{[i6]:()=>({match:t(u=>({matched:!!l(u)}),"match")})}}t(Af,"p");function Xtt(...l){let u=typeof l[0]=="string"?l[0]:void 0,m=l.length===2?l[1]:typeof l[0]=="string"?void 0:l[0];return dS({[i6]:()=>({match:t(b=>{let k={[u??ile]:b};return{matched:m===void 0||NC(m,b,(I,R)=>{k[I]=R}),selections:k}},"match"),getSelectionKeys:t(()=>[u??ile].concat(m===void 0?[]:GA(m)),"getSelectionKeys")})})}t(Xtt,"y");function DC(l){return typeof l=="number"}t(DC,"v");function VA(l){return typeof l=="string"}t(VA,"b");function UA(l){return typeof l=="bigint"}t(UA,"w");var nnr=dS(Af(function(l){return!0}));var WA=t(l=>Object.assign(dS(l),{startsWith:t(u=>{return WA(Qp(l,(m=u,Af(b=>VA(b)&&b.startsWith(m)))));var m},"startsWith"),endsWith:t(u=>{return WA(Qp(l,(m=u,Af(b=>VA(b)&&b.endsWith(m)))));var m},"endsWith"),minLength:t(u=>WA(Qp(l,(m=>Af(b=>VA(b)&&b.length>=m))(u))),"minLength"),length:t(u=>WA(Qp(l,(m=>Af(b=>VA(b)&&b.length===m))(u))),"length"),maxLength:t(u=>WA(Qp(l,(m=>Af(b=>VA(b)&&b.length<=m))(u))),"maxLength"),includes:t(u=>{return WA(Qp(l,(m=u,Af(b=>VA(b)&&b.includes(m)))));var m},"includes"),regex:t(u=>{return WA(Qp(l,(m=u,Af(b=>VA(b)&&!!b.match(m)))));var m},"regex")}),"j"),inr=WA(Af(VA)),IC=t(l=>Object.assign(dS(l),{between:t((u,m)=>IC(Qp(l,((b,k)=>Af(I=>DC(I)&&b<=I&&k>=I))(u,m))),"between"),lt:t(u=>IC(Qp(l,(m=>Af(b=>DC(b)&&b<m))(u))),"lt"),gt:t(u=>IC(Qp(l,(m=>Af(b=>DC(b)&&b>m))(u))),"gt"),lte:t(u=>IC(Qp(l,(m=>Af(b=>DC(b)&&b<=m))(u))),"lte"),gte:t(u=>IC(Qp(l,(m=>Af(b=>DC(b)&&b>=m))(u))),"gte"),int:t(()=>IC(Qp(l,Af(u=>DC(u)&&Number.isInteger(u)))),"int"),finite:t(()=>IC(Qp(l,Af(u=>DC(u)&&Number.isFinite(u)))),"finite"),positive:t(()=>IC(Qp(l,Af(u=>DC(u)&&u>0))),"positive"),negative:t(()=>IC(Qp(l,Af(u=>DC(u)&&u<0))),"negative")}),"x"),snr=IC(Af(DC)),HA=t(l=>Object.assign(dS(l),{between:t((u,m)=>HA(Qp(l,((b,k)=>Af(I=>UA(I)&&b<=I&&k>=I))(u,m))),"between"),lt:t(u=>HA(Qp(l,(m=>Af(b=>UA(b)&&b<m))(u))),"lt"),gt:t(u=>HA(Qp(l,(m=>Af(b=>UA(b)&&b>m))(u))),"gt"),lte:t(u=>HA(Qp(l,(m=>Af(b=>UA(b)&&b<=m))(u))),"lte"),gte:t(u=>HA(Qp(l,(m=>Af(b=>UA(b)&&b>=m))(u))),"gte"),positive:t(()=>HA(Qp(l,Af(u=>UA(u)&&u>0))),"positive"),negative:t(()=>HA(Qp(l,Af(u=>UA(u)&&u<0))),"negative")}),"A"),anr=HA(Af(UA)),onr=dS(Af(function(l){return typeof l=="boolean"})),cnr=dS(Af(function(l){return typeof l=="symbol"})),lnr=dS(Af(function(l){return l==null})),unr=dS(Af(function(l){return l!=null}));var Swe=class Swe extends Error{constructor(u){let m;try{m=JSON.stringify(u)}catch{m=u}super(`Pattern matching error: no pattern matches value ${m}`),this.input=void 0,this.input=u}};t(Swe,"W");var ywe=Swe,vwe={matched:!1,value:void 0};function Zy(l){return new bwe(l,vwe)}t(Zy,"z");var bW=class bW{constructor(u,m){this.input=void 0,this.state=void 0,this.input=u,this.state=m}with(...u){if(this.state.matched)return this;let m=u[u.length-1],b=[u[0]],k;u.length===3&&typeof u[1]=="function"?k=u[1]:u.length>2&&b.push(...u.slice(1,u.length-1));let I=!1,R={},Z=t((re,de)=>{I=!0,R[re]=de},"a"),ce=!b.some(re=>NC(re,this.input,Z))||k&&!k(this.input)?vwe:{matched:!0,value:m(I?ile in R?R[ile]:R:this.input,this.input)};return new bW(this.input,ce)}when(u,m){if(this.state.matched)return this;let b=!!u(this.input);return new bW(this.input,b?{matched:!0,value:m(this.input,this.input)}:vwe)}otherwise(u){return this.state.matched?this.state.value:u(this.input)}exhaustive(){if(this.state.matched)return this.state.value;throw new ywe(this.input)}run(){return this.exhaustive()}returnType(){return this}};t(bW,"I");var bwe=bW;var xwe=2,Ktt=["application/octet-stream","multipart/form-data","application/x-www-form-urlencoded","*/*"],ert=["query","header","path"],d8=["get","put","post","delete","options","head","patch","trace"],trt=["string","number","integer","boolean"],xW=["allOf","anyOf","oneOf"];var $_=t(l=>l.charAt(0).toUpperCase()+l.slice(1),"capitalize"),ZA=t(l=>l.charAt(0).toLowerCase()+l.slice(1),"decapitalize"),rrt=t(l=>l.replace(/(-\w)/g,u=>u[1].toUpperCase()),"kebabToCamel"),mg=t(l=>l.replace(/(_\w)/g,u=>u[1].toUpperCase()),"snakeToCamel"),nrt=t(l=>l.replace(/[\W_]+(\w)?/g,(u,m)=>(m==null?void 0:m.toUpperCase())??""),"nonWordCharactersToCamel"),Twe=t((l,u="")=>l.endsWith(u)?l:`${l}${u}`,"suffixIfNeeded"),irt=t((l,u)=>l.replace(new RegExp(`${u}$`),""),"removeSuffix"),SVt=t(l=>{var b;let u=l.reduce((k,I)=>({...k,[I]:(k[I]??0)+1}),{});return(b=Object.entries(u).sort((k,I)=>k[1]===I[1]?I[0].length-k[0].length:I[1]-k[1])[0])==null?void 0:b[0]},"getLongestMostCommon"),kwe=t(l=>{let u=l.map($_).map(srt).map(m=>xVt(m)).flat();return SVt(u)},"getMostCommonAdjacentCombinationSplit"),srt=t(l=>l.split(/(?<![A-Z])(?=[A-Z])/).filter(Boolean),"splitByUppercase"),art=t(l=>srt(l).join(" "),"camelToSpaceSeparated"),xVt=t((l,u=["dto","by","for","of","in","to","and","with"])=>{var b;let m=[];for(let k=0;k<l.length;k++)if(!u.includes(l[k].toLowerCase()))for(let I=k+1;I<=l.length;I++)u.includes((b=l[I-1])==null?void 0:b.toLowerCase())||m.push(l.slice(k,I).join(""));return m},"getAdjacentStringCombinations"),ort=t((l,u)=>{let m=u.replace(/es$|s$/g,""),b=new RegExp(`(${ZA(m)}|${$_(m)})[a-z]*(?=$|[A-Z])`,"g");return l.replace(b,"")},"removeWord");var lrt=t(l=>`#/components/schemas/${l}`,"getSchemaRef"),m8=t(l=>l[1]==="/"?l:"#/"+l.slice(1),"autocorrectRef"),XM=t(l=>m8(l).split("/").at(-1),"getSchemaNameByRef");function Ewe(l){let u=TVt(l).normalize("NFKD").trim().replace(/\s+/g,"_").replace(/--+/g,"-").replace(/-+/g,"_").replace(/[^\w-]+/g,"_");return mg(u)}t(Ewe,"normalizeString");function urt(l){return/^[a-zA-Z]\w*$/.test(l)?l:`"${l}"`}t(urt,"wrapWithQuotesIfNeeded");function frt(l){return typeof l=="string"&&l.startsWith('"')&&l.endsWith('"')?l.slice(1,-1):l}t(frt,"unwrapQuotesIfNeeded");function TVt(l){let u=Number(l[0]);return typeof u=="number"&&!Number.isNaN(u)?"_"+l:l}t(TVt,"prefixStringStartingWithNumberIfNeeded");function Pwe(l){let u=l.replaceAll("_","#");return mg(u.replaceAll("-","_")).replaceAll("#","_")}t(Pwe,"pathParamToVariableName");var OC=t(l=>trt.includes(l),"isPrimitiveType");function _rt(l){return l.replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/([\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F-\u009F\uFFFE\uFFFF])/g,(u,m)=>{let b=m.codePointAt(),k=b.toString(16);return b<=255?`\\x${`00${k}`.slice(-2)}`:`\\u${`0000${k}`.slice(-4)}`}).replace(/\//g,"\\/")}t(_rt,"escapeControlCharacters");function FC(l){return l.includes("application/")&&l.includes("json")||Ktt.includes(l)||l.includes("text/")}t(FC,"isParamMediaTypeAllowed");function TW(l){return l>=200&&l<300}t(TW,"isMainResponseStatus");function sle(l){return!(l>=200&&l<300)}t(sle,"isErrorStatus");function ale(l){return l.startsWith("application/")}t(ale,"isMediaTypeAllowed");var crt=/({\w+})/g,kVt=/[^\w\-]+/g;function prt(l){l=$_(rrt(l.replaceAll("/","-")).replaceAll("-",""));let u=[...l.matchAll(crt)];if(u.length>0){let m=u.sort((b,k)=>b.index-k.index)[u.length-1][0];l=`${l.replace(crt,"")}By${$_(m.slice(1,-1))}`}return l.replace(kVt,"_")}t(prt,"pathToVariableName");var Cwe=/{(\b\w+(?:-\w+)*\b)}/g;function drt(l){let u=l.match(Cwe);return u===null?l.replaceAll(Cwe,":$1"):(u.forEach(m=>{let b=Pwe(m.replaceAll(Cwe,":$1"));l=l.replaceAll(m,b)}),l)}t(drt,"replaceHyphenatedPath");var mrt=t(l=>{let u=l["x-enumNames"],m=Array.isArray(u)&&u.length>0,b=!!l.schema&&Ym(l.schema)&&l.schema.type==="string";return m&&b},"isSortingParameterObject"),h8=t((l,u)=>u.excludePathRegex?new RegExp(u.excludePathRegex).test(l):!1,"isPathExcluded");var Db=t(l=>l.method==="get","isQuery"),YA=t(l=>l.method!=="get"||!!l.mediaDownload,"isMutation"),KM=t((l,u)=>Db(l)&&(u??Object.values(yW)).every(m=>l.parameters.some(b=>b.name===m&&b.type==="Query")),"isInfiniteQuery"),hrt=t((l,u,m)=>{let b=m.reduce((k,I)=>[...k,...QA(l,I,{includeOnlyRequiredParams:!0}).map(R=>R.name)],[]);return QA(l,u,{includeOnlyRequiredParams:!0,excludeBodyParam:!0}).filter(k=>b.includes(k.name)).map(k=>k.name)},"getDestructuredVariables");function XA(l){return nrt(l)}t(XA,"formatTag");function KA(l,u){var b;let m=(b=l.tags)==null?void 0:b[0];return XA(m??u.defaultTag)}t(KA,"getOperationTag");function grt(l,u){return u.excludeTags.some(m=>m.toLowerCase()===l.toLowerCase())}t(grt,"isTagExcluded");var ole={fileName:"acl/app.ability",extension:"ts"},kW="AllAbilities",CW="AppAbilities",cle={fileName:"acl/useAclCheck",extension:"ts"},e3="useAclCheck",Qy={abilityTuple:"AbilityTuple",pureAbility:"PureAbility",forcedSubject:"ForcedSubject",subjectType:"Subject",subject:"subject"},wwe={bindings:[Qy.abilityTuple,Qy.pureAbility,Qy.forcedSubject,Qy.subjectType,Qy.subject],from:"@casl/ability"};var EW="AppRestClient",lle={query:"AppQueryOptions",infiniteQuery:"AppInfiniteQueryOptions",mutation:"AppMutationOptions"},Awe="src/data",Dwe="@/data",g8={appRestClient:"@/util/rest/clients/app-rest-client",queryTypes:"@/types/react-query",errorHandling:"@/util/vendor/error-handling",abilityContext:"@/data/acl/ability.context"},t3={ErrorHandler:"ErrorHandler",SharedErrorHandler:"SharedErrorHandler"},ule={bindings:[t3.ErrorHandler,t3.SharedErrorHandler],from:g8.errorHandling},Iwe="AbilityContext",yrt={bindings:[Iwe],from:g8.abilityContext};var fle={reactQueryTypes:{fileName:"react-query.types",extension:"ts"},restClient:{fileName:"rest-client",extension:"ts"},restInterceptor:{fileName:"rest-interceptor",extension:"ts"}},_le={fileName:"app-rest-client",extension:"ts"},Nwe="QueryModule",ple={fileName:"queryModules",extension:"ts"},vrt={fileName:"queryConfig.context",extension:"tsx"},eL={optionsType:"MutationEffectsOptions",hookName:"useMutationEffects",runFunctionName:"runMutationEffects"},dle={fileName:"useMutationEffects",extension:"ts"},hg={namespace:"ZodUtils",exports:{parse:"parse",sortExp:"sortExp",brand:"brand"}},mle={fileName:"zod.utils",extension:"ts"};var Ib=t((...l)=>[...new Set(l.flat())],"getUniqueArray");var brt=t(l=>`Use${$_(mg(l.operationName))}Ability`,"getAbilityTypeName"),PW=t(l=>`canUse${$_(mg(l.operationName))}`,"getAbilityFunctionName"),Srt=t((l,u)=>`${u.tsNamespaces?`${Np({type:"acl",tag:r3(l,u),options:u})}.`:""}${PW(l)}`,"getImportedAbilityFunctionName"),xrt=t(l=>{var u;return(u=l.acl)==null?void 0:u[0].action},"getAbilityAction"),Trt=t(l=>{var u;return(u=l.acl)==null?void 0:u[0].subject},"getAbilitySubject"),hle=t(l=>{var u;return!!((u=wW(l))!=null&&u.length)},"hasAbilityConditions"),wW=t(l=>{var u;return(u=l.acl)==null?void 0:u[0].conditionsTypes},"getAbilityConditionsTypes"),krt=t(l=>{var u;return(u=l.acl)==null?void 0:u[0].description},"getAbilityDescription"),gle=t(l=>`${$_(l)}${kW}`,"getTagAllAbilitiesName");var Crt="Schema",Ert="Enum",Prt="Body",wrt="Param",Art="Response",Drt="ErrorResponse",AW="z.void()",yle="z.instanceof(Blob)",DW="z.enum",vle="z.string()",tL={bindings:["z"],from:"zod"};function ny(l,u){if(!l)return;let{data:m,onSchema:b}=u;if(l_(l)&&b({type:"reference",schema:l,data:m})===!0)return;let k=l;if(xW.some(I=>I in k&&k[I])){let I=k.allOf??k.anyOf??k.oneOf??[];for(let R of I)(b==null?void 0:b({type:"composite",parentSchema:l,schema:R,data:m}))!==!0&&ny(R,{data:m,onSchema:b})}if(k.properties)for(let[I,R]of Object.entries(k.properties))b({type:"property",parentSchema:l,schema:R,data:m,propertyName:I})!==!0&&ny(R,u);if(k.additionalProperties&&typeof k.additionalProperties=="object"){if(b({type:"additionalProperties",parentSchema:l,schema:k.additionalProperties,data:m})===!0)return;ny(k.additionalProperties,u)}if(k.type==="array"){let I=l.items;if(b({type:"array",parentSchema:l,schema:I,data:m})===!0)return;ny(I,u)}}t(ny,"iterateSchema");var MC=t((l,u)=>Twe($_(Ewe(l)),u),"getZodSchemaName"),IW=t((l,u,m)=>Twe($_(Ewe(l)),`${u}${m}`),"getEnumZodSchemaName"),Yy=t(l=>["z.",`${hg.namespace}.`].every(u=>!l.startsWith(u)),"isNamedZodSchema"),Irt=t(l=>l.startsWith(DW),"isEnumZodSchema"),y8=t((l,u,m)=>u?l:`${m}_${l}`,"getZodSchemaOperationName"),ble=t(l=>mg(`${l}_${Prt}`),"getBodyZodSchemaName"),Nrt=t((l,u)=>mg(`${l}_${u}${wrt}`),"getParamZodSchemaName"),CVt=t(l=>mg(`${l}${Art}`),"getMainResponseZodSchemaName"),EVt=t((l,u)=>mg(`${l}_${u}_${Drt}`),"getErrorResponseZodSchemaName");function Sle({statusCode:l,operationName:u,isUniqueOperationName:m,tag:b}){let k=Number(l),I=y8(u,m,b);return!TW(k)&&l!=="default"&&sle(k)?EVt(I,l):CVt(I)}t(Sle,"getResponseZodSchemaName");function NW(l){return["minimum","exclusiveMinimum","maximum","exclusiveMaximum","minItems","minLength","minProperties","maxItems","maxLength","maxProperties","default","example"].filter(b=>l[b]).reduce((b,k)=>[...b,`${$_(art(k))}: \`${l[k]}\``],[])}t(NW,"getSchemaDescriptions");var OW=t((l,u)=>irt(l,u.schemaSuffix),"getZodSchemaInferedTypeName"),Ort=t((l,u)=>Yy(u)?`${l.options.tsNamespaces?`${Np({type:"models",tag:l.getTagByZodSchemaName(u),options:l.options})}.`:""}${u}`:u,"getImportedZodSchemaName"),v8=t((l,u,m)=>{if(!Yy(u))return u===AW?"void":u;let b=l.getTagByZodSchemaName(u);return`${l.options.tsNamespaces&&b!==m?`${Np({type:"models",tag:b,options:l.options})}.`:""}${OW(u,l.options)}`},"getImportedZodSchemaInferedTypeName");function Frt(l){var u;return l.isEnum?"enum":((u=l.schemaObj)==null?void 0:u.type)??"object"}t(Frt,"getZodSchemaType");function Mrt(l){if(l.schemaObj)return[l.schemaObj.description,...NW(l.schemaObj)].filter(Boolean).join(". ")}t(Mrt,"getZodSchemaDescription");function Lrt(l,u,m){var b;if(l_(u)){let k=l.getZodSchemaNameByRef(u.$ref);return k?v8(l,k,m):void 0}if(rle(u)){if(!l_(u.items))return`${((b=u.items)==null?void 0:b.type)??"unknown"}[]`;let k=l.getZodSchemaNameByRef(u.items.$ref);return k?`${v8(l,k,m)}[]`:void 0}if(xW.some(k=>k in u&&u[k])){let k=u.allOf??u.anyOf??u.oneOf??[];if(k.length>0)return Lrt(l,k[0],m)}return u.type}t(Lrt,"getType");function Rrt(l,u,m){if(!u.schemaObj)return[];let b="[0]",k="[key]",I={},R=t(Z=>{var re;if(Z.type==="reference")return!0;if(Z.type==="composite")return;let ce=[...((re=Z.data)==null?void 0:re.pathSegments)??[]];if(Z.type==="array"?ce.push(b):Z.type==="property"?ce.push(Z.propertyName):Z.type==="additionalProperties"&&ce.push(k),Z.schema&&ce[ce.length-1]!==b){let de=l.resolveObject(Z.schema),ke=[de.description,...NW(de)].filter(Boolean),et=ce.join(".");I[et]&&"type"in Z.schema&&Z.schema.type==="object"||(delete I[et],I[et]={type:Lrt(l,Z.schema,m)??"unknown",description:ke.join(". ")})}return ny(Z.schema,{data:{pathSegments:[...ce]},onSchema:R}),!0},"onSchema");return"allOf"in u.schemaObj&&u.schemaObj.allOf&&u.schemaObj.allOf.forEach(Z=>{if(l_(Z)){let ce=l.resolveObject(Z);ny(ce,{data:{pathSegments:[]},onSchema:R})}}),ny(u.schemaObj,{data:{pathSegments:[]},onSchema:R}),I}t(Rrt,"getZodSchemaPropertyDescriptions");function n3({resolver:l,tag:u,zodSchemas:m=[],zodSchemasAsTypes:b=[]}){let k="models",I=t(ce=>l.getTagByZodSchemaName(ce),"getTag"),R=xle({type:k,tag:u,entities:m,getTag:I,getEntityName:t(ce=>ce,"getEntityName"),options:l.options}),Z=xle({type:k,tag:u,entities:b,getTag:I,getEntityName:t(ce=>OW(ce,l.options),"getEntityName"),options:l.options});return PVt(l.options,R,Z)}t(n3,"getModelsImports");function jrt({tag:l,endpoints:u,options:m}){return xle({type:"endpoints",tag:l,entities:u,getTag:t(b=>r3(b,m),"getTag"),getEntityName:FW,options:m})}t(jrt,"getEndpointsImports");function Brt({tag:l,endpoints:u,options:m}){return xle({type:"acl",tag:l,entities:u,getTag:t(b=>r3(b,m),"getTag"),getEntityName:PW,options:m})}t(Brt,"getAclImports");function $rt({tags:l,entityName:u,getAliasEntityName:m,type:b,options:k}){let I=new Map;return l.forEach(R=>{let Z=`${u}${m?` as ${m(R)}`:""}`;I.has(R)?k.tsNamespaces||I.get(R).bindings.push(Z):I.set(R,{bindings:[k.tsNamespaces?Np({type:b,tag:R,options:k}):Z],from:`${LC(k)}${Tle({type:b,tag:R,includeTagDir:!0,options:k})}`})}),Array.from(I.values())}t($rt,"getEntityImports");function LC(l){let u=Dwe;return l.importPath==="relative"?u="../":l.importPath==="absolute"?u=l.output:new RegExp(`${Awe}`,"g").test(l.output)&&(u=l.output.replace(new RegExp(`.*${Awe}`,"g"),Dwe)),`${u}/`.replace(/\/\//g,"/")}t(LC,"getImportPath");function xle({type:l="models",tag:u,entities:m,getTag:b,getEntityName:k,options:I}){let R=new Map;return m.forEach(Z=>{let ce=b(Z);if(R.has(ce))I.tsNamespaces||R.get(ce).bindings.push(k(Z));else{let re=u===ce;R.set(ce,{bindings:[I.tsNamespaces?Np({type:l,tag:ce,options:I}):k(Z)],from:`${re?"./":LC(I)}${Tle({type:l,tag:ce,includeTagDir:!re,options:I})}`})}}),Array.from(R.values())}t(xle,"getImports");function PVt(l,...u){let m=new Map;return u.forEach(b=>{b.forEach(k=>{m.has(k.from)?l.tsNamespaces||m.get(k.from).bindings.push(...k.bindings):m.set(k.from,k)})}),Array.from(m.values()).map(b=>({...b,bindings:Ib(b.bindings)}))}t(PVt,"mergeImports");function b8({fileName:l,extension:u}){return`${l}.${u}`}t(b8,"getFileNameWithExtension");function Jrt({type:l,tag:u,options:m,includeTagDir:b=!0}){let k=m.configs[l].outputFileNameSuffix;return u?`${b?`${ZA(u)}/`:""}${ZA(u)}.${k}`:k}t(Jrt,"getTagFileNameWithoutExtension");function Tle(...l){return Jrt(...l)}t(Tle,"getTagImportPath");function kle(...l){return`${Jrt(...l)}.ts`}t(kle,"getTagFileName");var Np=t(({type:l,tag:u,options:m})=>`${$_(u)}${m.configs[l].namespaceSuffix}`,"getNamespaceName");function qrt(l){return l.standalone?`${LC(l)}${_le.fileName}`:l.restClientImportPath}t(qrt,"getAppRestClientImportPath");function zrt(l){return l.standalone?`${LC(l)}${fle.reactQueryTypes.fileName}`:l.queryTypesImportPath}t(zrt,"getQueryTypesImportPath");function Vrt(l){return`${LC(l)}${ple.fileName}`}t(Vrt,"getQueryModulesImportPath");function Urt(l){return`${LC(l)}${dle.fileName}`}t(Urt,"getMutationEffectsImportPath");function Wrt(l){return`${LC(l)}${cle.fileName}`}t(Wrt,"getAclCheckImportPath");function Cle(l){return`${LC(l)}${mle.fileName}`}t(Cle,"getZodUtilsImportPath");function Hrt(l){return`${LC(l)}${ole.fileName}`}t(Hrt,"getAppAbilitiesImportPath");function Grt(l){return Zy(l).with("string",()=>"string").with("number",()=>"number").with("integer",()=>"number").with("boolean",()=>"boolean").exhaustive()}t(Grt,"primitiveTypeToTsType");var FW=t(l=>ZA(mg(l.operationName)),"getEndpointName");function Qrt(l,u){return`${u.tsNamespaces?`${Np({type:"endpoints",tag:r3(l,u),options:u})}.`:""}${FW(l)}`}t(Qrt,"getImportedEndpointName");var Yrt=t(l=>l.method!==Zrt.OpenAPIV3.HttpMethods.GET,"requiresBody"),Ele=t(l=>l.parameters.find(u=>u.type==="Body"),"getEndpointBody"),Xrt=t((l,u)=>{let m=Owe(l),b=u.options.axiosRequestConfig;return Object.keys(m).length>0||b},"hasEndpointConfig"),Krt=t(l=>l.path.replace(/:([a-zA-Z0-9_]+)/g,"${$1}"),"getEndpointPath");function r3(l,u){var b;let m=u.splitByTags?(b=l.tags)==null?void 0:b[0]:u.defaultTag;return XA(m??u.defaultTag)}t(r3,"getEndpointTag");function QA(l,u,m){let b=u.parameters.map(k=>{var R,Z,ce,re;let I="string";if(Yy(k.zodSchema))I=v8(l,k.zodSchema);else if((R=k.parameterObject)!=null&&R.schema&&Ym(k.parameterObject.schema)){let de=(ce=(Z=k.parameterObject)==null?void 0:Z.schema)==null?void 0:ce.type;de&&OC(de)&&(I=Grt(de))}return{name:zA(k.name),type:I,paramType:k.type,required:((re=k.parameterObject)==null?void 0:re.required)??!0,parameterObject:k.parameterObject,bodyObject:k.bodyObject}});return m!=null&&m.includeFileParam&&u.mediaUpload&&b.push({name:"file",type:"File",paramType:"Body",required:!0,parameterObject:void 0,bodyObject:void 0}),b.sort((k,I)=>{if(k.required===I.required){let R=["Path","Body","Query","Header"];return R.indexOf(k.paramType)-R.indexOf(I.paramType)}return k.required?-1:1}).filter(k=>(!(m!=null&&m.excludeBodyParam)||k.name!==ele)&&(!(m!=null&&m.excludePageParam)||k.name!==yW.pageParamName)&&(!(m!=null&&m.includeOnlyRequiredParams)||k.required)).map(k=>({...k,name:m!=null&&m.replacePageParam&&k.name===yW.pageParamName?"pageParam":k.name,required:k.required&&(k.paramType==="Path"||!(m!=null&&m.pathParamsRequiredOnly))}))}t(QA,"mapEndpointParamsToFunctionParams");function Owe(l){let u=l.parameters.filter(k=>k.type==="Query").map(k=>{let I=Qtt(k.name)?k.name:`"${k.name}"`,R=zA(k.name);return{...k,name:I,value:R}}),m={};return l.requestFormat!==mwe["Content-Type"]&&(m["Content-Type"]=`'${l.requestFormat}'`),l.responseFormat&&l.responseFormat!==mwe.Accept&&(m.Accept=`'${l.responseFormat}'`),l.parameters.filter(k=>k.type==="Header").forEach(k=>{m[k.name]=zA(k.name)}),{...u.length>0?{params:u}:{},...Object.keys(m).length?{headers:m}:{}}}t(Owe,"getEndpointConfig");function ent(l,u){return u.filter(m=>Db(m)&&m.parameters.filter(b=>{var k;return(k=b.parameterObject)==null?void 0:k.required}).every(b=>l.parameters.some(k=>k.name===b.name))&&m.response===l.response)}t(ent,"getUpdateQueryEndpoints");var Fwe=["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 S8(l,u){let m={};return Object.keys(l).forEach(b=>{u.includes(b)&&(m[b]=l[b])}),m}t(S8,"pick");function Ple(l,...u){if(u.length===0)return l;let m=l;for(let b of u)m=tnt(m,b);return m}t(Ple,"deepMerge");function tnt(l,u){if(u==null)return l;if(l==null)return rL(u);if(Array.isArray(l)&&Array.isArray(u))return[...l,...u];if(MW(l)&&MW(u)){let m={};for(let[b,k]of Object.entries(l))m[b]=rL(k);for(let[b,k]of Object.entries(u)){let I=m[b];k!==void 0&&(k===null?m[b]=k:MW(I)&&MW(k)?m[b]=tnt(I,k):Array.isArray(I)&&Array.isArray(k)?m[b]=[...I,...k]:m[b]=rL(k))}return m}return rL(u)}t(tnt,"mergeTwoValues");function rL(l){if(l==null||typeof l!="object")return l;if(Array.isArray(l))return l.map(u=>rL(u));if(MW(l)){let u={};for(let[m,b]of Object.entries(l))u[m]=rL(b);return u}return l}t(rL,"deepClone");function MW(l){return l!==null&&typeof l=="object"&&!Array.isArray(l)&&Object.prototype.toString.call(l)==="[object Object]"}t(MW,"isPlainObject");function nL(l,u){let m=l.deprecated&&!u.withDeprecatedEndpoints,b=KA(l,u),k=grt(b,u);return m||k}t(nL,"isOperationExcluded");function Mwe({path:l,method:u,operation:m,options:b,tag:k,keepOperationTag:I,keepOperationPrefix:R}){let Z=`${u}${prt(l)}`,ce=m.operationId?zA(m.operationId):Z;if(b.removeOperationPrefixEndingWith&&R)ce=ce.split(b.removeOperationPrefixEndingWith).map((de,ke)=>ke===0?de:$_(de)).join("");else if(b.removeOperationPrefixEndingWith&&!R){let re=new RegExp(`^.*${b.removeOperationPrefixEndingWith}`);ce=ce.replace(re,"")}if(b.tsNamespaces&&!I){let re=ort(ce,k);re===""?ce=u.toLowerCase():Fwe.includes(re)||(ce=re)}return Fwe.includes(ce)?Z:ce}t(Mwe,"getOperationName");function LW({operationsByTag:l,...u}){let{operation:m,options:b}=u,k=b.splitByTags?KA(m,b):b.defaultTag,I=t(R=>{let Z=Mwe({...u,tag:k,keepOperationTag:R});if(l[k].filter(re=>Mwe({...u,operation:re,tag:k,keepOperationTag:R})===Z).length===1)return Z},"operationName");return I()??I(!0)??Mwe({...u,tag:k,keepOperationTag:!0,keepOperationPrefix:!0})}t(LW,"getUniqueOperationName");function rnt(l,u,m){let b=[];for(let k in l.paths){if(h8(k,m))continue;let I=l.paths[k],R=S8(I,d8);for(let Z in R){let ce=R[Z];if(!ce||nL(ce,m))continue;let re=LW({path:k,method:Z,operation:ce,operationsByTag:u,options:m});b.push(re)}}return b}t(rnt,"getUniqueOperationNamesWithoutSplitByTags");function nnt(l,u){let m={};for(let b in l.paths){if(h8(b,u))continue;let k=l.paths[b],I=S8(k,d8);for(let R in I){let Z=I[R];if(!Z||nL(Z,u))continue;let ce=u.splitByTags?KA(Z,u):u.defaultTag;m[ce]||(m[ce]=[]),m[ce].push(Z)}}return m}t(nnt,"getOperationsByTag");function RW(l){return{type:"invalid-schema",message:l}}t(RW,"getInvalidSchemaError");function int(l){return{type:"invalid-operation-id",message:`Operation ${l}`}}t(int,"getInvalidOperationIdError");function snt(l,u){return{type:"missing-path-parameter",message:`Path ${u} is missing [${l.map(({name:m})=>m).join(", ")}]`}}t(snt,"getMissingPathParameterError");function ant(l){return{type:"not-allowed-inline-enum",message:`${l} is missing @IsEnum() and @ApiProperty(enum:, enumName:)`}}t(ant,"getNotAllowedInlineEnumError");function ont(l){return{type:"not-allowed-circular-schema",message:l}}t(ont,"getNotAllowedCircularSchemaError");function cnt(l,u,m){return{type:"missing-acl-condition-property",message:`Condition property ${l} is not found in parameters or body in operation ${Ale(u,m)}`}}t(cnt,"getMissingAclConditionPropertyError");function Lwe(l,u,m){return{type:"missing-status-code",message:`Missing HTTP status code ${wle(l)} in operation ${Ale(u,m)}`}}t(Lwe,"getMissingStatusCodeError");function lnt(l,u,m){return{type:"invalid-status-code",message:`Operation ${Ale(u,m)} expected HTTP status code ${wle(l.expected)} but received ${wle(l.received)}`}}t(lnt,"getInvalidStatusCodeError");function unt(l,u,m){return{type:"multiple-success-status-codes",message:`Operation ${Ale(u,m)} has multiple success HTTP status codes: ${l.map(wle).join(", ")}`}}t(unt,"getMultipleSuccessStatusCodesError");function Ale(l,u){return l.operationId??`${u.method} ${u.path}`}t(Ale,"getOperationDescriptor");function wle(l){return`${l} (${Wtt[l]})`}t(wle,"getStatusCodeDescription");function fnt(l){return l.reduce((u,m)=>({...u,[m.type]:[...u[m.type]??[],m.message]}),{})}t(fnt,"groupByType");function RC({schema:l,meta:u,options:m}){let b=[];Zy(l.type).with("string",()=>b.push(DVt(l))).with("number","integer",()=>b.push(NVt(l))).with("array",()=>b.push(OVt(l))).otherwise(()=>{}),typeof l.description=="string"&&l.description!==""&&m.withDescription&&([`
526
526
  `,"\r",`\r
527
527
  `].some(I=>String.prototype.includes.call(l.description,I))?b.push(`describe(\`${l.description}\`)`):b.push(`describe("${l.description}")`));let k=b.concat(wVt({schema:l,meta:u,options:m}),m.withDefaultValues!==!1?AVt(l):[]).filter(Boolean).join(".");return k?`.${k}`:""}t(RC,"getZodChain");function wVt({schema:l,meta:u,options:m}){return l.nullable&&!(u!=null&&u.isRequired)?"nullish()":l.nullable||m.replaceOptionalWithNullish&&(u!=null&&u.isParentPartial)?"nullable()":u!=null&&u.isRequired?"":m.replaceOptionalWithNullish?"nullish()":"optional()"}t(wVt,"getZodChainablePresence");function AVt(l){return l.default!==void 0?`default(${Zy(l.type).with("number","integer",()=>frt(l.default)).otherwise(()=>JSON.stringify(l.default))})`:""}t(AVt,"getZodChainableDefault");function DVt(l){let u=[];if(l.enum||(l.minLength!==void 0&&u.push(`min(${l.minLength})`),l.maxLength!==void 0&&u.push(`max(${l.maxLength})`)),l.pattern&&u.push(`regex(${IVt(l.pattern)})`),l.format){let m=Zy(l.format).with("email",()=>"email()").with("hostname","uri",()=>"url()").with("uuid",()=>"uuid()").with("date-time",()=>"datetime({ offset: true })").otherwise(()=>"");m&&u.push(m)}return u.join(".")}t(DVt,"getZodChainableStringValidations");function IVt(l){return l.startsWith("/")&&l.endsWith("/")&&(l=l.slice(1,-1)),l=_rt(l),`/${l}/`}t(IVt,"formatPatternIfNeeded");function NVt(l){let u=[];return l.enum?"":(l.type==="integer"&&u.push("int()"),l.minimum!==void 0?l.exclusiveMinimum===!0?u.push(`gt(${l.minimum})`):u.push(`gte(${l.minimum})`):typeof l.exclusiveMinimum=="number"&&u.push(`gt(${l.exclusiveMinimum})`),l.maximum!==void 0?l.exclusiveMaximum===!0?u.push(`lt(${l.maximum})`):u.push(`lte(${l.maximum})`):typeof l.exclusiveMaximum=="number"&&u.push(`lt(${l.exclusiveMaximum})`),l.multipleOf&&u.push(`multipleOf(${l.multipleOf})`),u.join("."))}t(NVt,"getZodChainableNumberValidations");function OVt(l){let u=[];return l.minItems&&u.push(`min(${l.minItems})`),l.maxItems&&u.push(`max(${l.maxItems})`),u.join(".")}t(OVt,"getZodChainableArrayValidations");var FVt={type:"string",format:"date-time"},MVt={type:"string",format:"email"},LVt={type:"object",properties:{start:{type:"string",format:"date-time"},end:{type:"string",format:"date-time"}}},RVt={type:"object",properties:{html:{type:"string"},json:{type:"object"}}},iL=(k=>(k.datetime="datetime",k.email="email",k.dateRange="dateRange",k.textEditor="textEditor",k))(iL||{}),Dle={datetime:FVt,email:MVt,dateRange:LVt,textEditor:RVt};function _nt(){return Object.values(iL).filter(l=>OC(Dle[l].type))}t(_nt,"getPrimitiveBrands");function pnt(){return Object.values(iL).filter(l=>!OC(Dle[l].type))}t(pnt,"getOtherBrands");function sL(l,u){let m=Dle[u];return!(l.type!==m.type||m.format&&l.format!==m.format||!Object.entries(m.properties??{}).every(([k,I])=>{var Z;let R=(Z=l.properties)==null?void 0:Z[k];return R&&R.type===I.type&&R.format===I.format}))}t(sL,"matchesBrand");function Rwe(l,u,m){return m.branded?`${hg.namespace}.${hg.exports.brand}(${l}, "${u}")`:l}t(Rwe,"wrapWithBrand");var x8=t(l=>l.reduce((u,m)=>u+m,0),"sum");function gg(l,u){if(!u)return l;if(l_(u))return l+2;if(Array.isArray(u.type))return u.type.length===1?Nb("oneOf")+gg(l,{...u,type:u.type[0]}):l+Nb("oneOf")+x8(u.type.map(m=>gg(0,{...u,type:m})));if(u.oneOf)return u.oneOf.length===1?Nb("oneOf")+gg(l,u.oneOf[0]):l+Nb("oneOf")+x8(u.oneOf.map(m=>gg(0,m)));if(u.anyOf)return u.anyOf.length===1?Nb("anyOf")+gg(l,u.anyOf[0]):l+Nb("anyOf")+x8(u.anyOf.map(m=>gg(0,m)));if(u.allOf)return u.allOf.length===1?Nb("allOf")+gg(l,u.allOf[0]):l+Nb("allOf")+x8(u.allOf.map(m=>gg(0,m)));if(!u.type)return l;if(OC(u.type))return u.enum?l+dnt(u)+Nb("enum")+x8(u.enum.map(m=>gg(0,m))):l+dnt(u);if(u.type==="array")return u.items?Nb("array")+gg(l,u.items):Nb("array")+gg(l);if(u.type==="object"||u.properties||u.additionalProperties){if(u.properties){let m=Object.values(u.properties);l+=Nb("object")+x8(m.map(b=>gg(0,b)))}else l+=Nb("empty-object");u.additionalProperties&&(typeof u.additionalProperties=="object"?l+=gg(0,u.additionalProperties):l+=gg(1))}return l}t(gg,"getOpenAPISchemaComplexity");function dnt(l){return Zy(l.type).with("string","number","integer","boolean",()=>1).otherwise(()=>0)}t(dnt,"complexityByType");function Nb(l){return Zy(l).with("oneOf",()=>2).with("anyOf",()=>3).with("allOf",()=>2).with("enum","array","empty-object",()=>1).with("object",()=>2).otherwise(()=>0)}t(Nb,"complexityByComposite");var jwe=class jwe{constructor(u,m,b={referencedBy:[]},k){this.schema=u;this.resolver=m;l_(u)&&(this.ref=u.$ref),k&&(this.enumRef=k),this.meta={...b,referencedBy:[...(b==null?void 0:b.referencedBy)??[]]},this.ref&&this.meta.referencedBy.push(this)}code;ref;enumRef;children=[];meta;getCodeString(u,m){var I,R;if(!this.ref&&this.code)return this.code;if(!this.ref)throw new Error("Zod schema is missing both ref and code");let b=(I=this.resolver)==null?void 0:I.getZodSchemaNameByRef(this.ref);if(!b)return this.ref;let k=(R=this.resolver)==null?void 0:R.getTagByZodSchemaName(b);return m!=null&&m.tsNamespaces&&k&&k!==u?`${Np({type:"models",tag:k,options:m})}.${b}`:b}get complexity(){return gg(0,this.schema)}assign(u){return this.code=u,this}inherit(u){return u&&u.children.push(this),this}};t(jwe,"ZodSchema");var jW=jwe;function Wd({schema:l,resolver:u,meta:m,tag:b}){var cr;let k=new jW(l,u,m),I={parent:k.inherit(m==null?void 0:m.parent),referencedBy:[...k.meta.referencedBy]},R={resolver:u,meta:I,tag:b};if(l_(l))return jVt({schema:l,zodSchema:k,resolver:u,meta:I,tag:b});let Z=$Vt({schema:l,zodSchema:k,resolver:u,meta:I,tag:b});if(Z)return Z;let ce=BVt({schema:l,zodSchema:k,resolver:u,meta:I,tag:b});if(ce)return ce;let re=JVt({schema:l,zodSchema:k,resolver:u,meta:I,tag:b});if(re)return re;let de=qVt({schema:l,zodSchema:k,resolver:u,meta:I,tag:b});if(de)return de;let ke=zVt({schema:l,zodSchema:k,resolver:u,meta:I,tag:b});if(ke)return ke;let et=u.options.allReadonly?".readonly()":"";if(rle(l))return l.items?k.assign(`z.array(${Wd({...R,schema:l.items}).getCodeString(b,u.options)}${RC({schema:l.items,meta:{...I,isRequired:!0},options:u.options})})${et}`):k.assign(`z.array(z.any())${et}`);let At=l.type?l.type.toLowerCase():void 0;if(At==="object"||l.properties||l.additionalProperties){let sr=l.required&&l.required.length>0,Bt=u.options.withImplicitRequiredProps?!1:l.properties&&!((cr=l.required)!=null&&cr.length),ar="{}";l.properties&&(ar="{ "+Object.entries(l.properties).map(([ai,eu])=>{var xs;let tf={...I,isRequired:Bt?!0:sr?(xs=l.required)==null?void 0:xs.includes(ai):u.options.withImplicitRequiredProps,name:ai,isParentPartial:Bt},ma=eu;if(l_(eu)&&u&&(ma=u.getSchemaByRef(eu.$ref),!ma))throw new Error(`Schema ${eu.$ref} not found`);let Sr=Wd({...R,schema:eu,meta:tf}).getCodeString(b,u.options)+RC({schema:ma,meta:tf,options:u.options});return Ym(eu)&&_nt().forEach(Fs=>{sL(eu,Fs)&&(Sr=Rwe(Sr,Fs,u.options))}),[ai,Sr]}).map(([ai,eu])=>`${urt(ai)}: ${eu}`).join(", ")+" }");let Zt="";l.additionalProperties&&(Zt=`.catchall(${typeof l.additionalProperties=="object"&&Object.keys(l.additionalProperties).length>0?Wd({...R,schema:l.additionalProperties}).getCodeString(b,u.options)+RC({schema:l.additionalProperties,meta:{...I,isRequired:!0},options:u.options}):"z.any()"})`);let Ai=Bt?".partial()":"",zn=u.options.strictObjects?".strict()":"",vi=`z.object(${ar})${Ai}${zn}${Zt}${et}`;return pnt().forEach(Zo=>{sL(l,Zo)&&(vi=Rwe(vi,Zo,u.options))}),k.assign(vi)}if(At==="any")return k.assign("z.any()");if(!At)return k.assign("z.unknown()");throw new Error(`Unsupported schema type: ${At}`)}t(Wd,"getZodSchema");function jVt({schema:l,zodSchema:u,resolver:m,meta:b,tag:k}){if(!l_(l))return;let I=u.meta.referencedBy.slice(0,-1).map(ce=>ce.ref?m.getZodSchemaNameByRef(ce.ref)??ce.ref:void 0).filter(Boolean),R=m.getZodSchemaNameByRef(l.$ref);if(I.length>1&&I.includes(R))return u.assign(m.getCodeByZodSchemaName(u.ref));let Z=m.getCodeByZodSchemaName(l.$ref);if(!Z){let ce=m.getSchemaByRef(l.$ref);if(!ce)throw new Error(`Schema ${l.$ref} not found`);Z=Wd({schema:ce,resolver:m,meta:b,tag:k}).getCodeString(k,m.options)}return m.getCodeByZodSchemaName(R)||m.setZodSchema(R,Z,k),u}t(jVt,"getReferenceZodSchema");function BVt({schema:l,zodSchema:u,resolver:m,meta:b,tag:k}){var R;if(!Ym(l)||!l.oneOf)return;if(l.oneOf.length===1){let Z=Wd({schema:l.oneOf[0],resolver:m,meta:b,tag:k});return u.assign(Z.getCodeString(k,m.options))}let I=(R=l.oneOf)==null?void 0:R.some(Z=>Ym(Z)&&((Z==null?void 0:Z.allOf)||[]).length>1);if(l.discriminator&&!I){let Z=l.discriminator.propertyName;return u.assign(`
528
528
  z.discriminatedUnion("${Z}", [${l.oneOf.map(ce=>Wd({schema:ce,resolver:m,meta:b,tag:k}).getCodeString(k,m.options)).join(", ")}])
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@povio/openapi-codegen-cli",
3
- "version": "0.16.0",
3
+ "version": "0.16.1",
4
4
  "main": "./dist/index.js",
5
5
  "bin": {
6
6
  "openapi-codegen": "./dist/sh.js"