@@ -39,15 +39,15 @@ type ResultsT = Awaited<ReturnType<typeof cookbook['api']['action']>>;
3939export const validateResults = async ( results : any ) => { _validate ( ( ( input : any ) : typia . IValidation < TSONEncode < ExecuteResultSuccess < ResultsT > | ExecuteResultFail > > => {
4040 const errors = [ ] as any [ ] ;
4141 const __is = ( input : any ) : input is TSONEncode < ExecuteResultSuccess < ResultsT > | ExecuteResultFail > => {
42- const $io0 = ( input : any ) : boolean => "string" === typeof input . executeId && false === input . success && ( "object" === typeof input . fail && null !== input . fail && $io1 ( input . fail ) ) ;
43- const $io1 = ( input : any ) : boolean => ( "NETWORK_ERROR" === input . code || "INTERNAL_SERVER_ERROR" === input . code || "NOT_FOUND" === input . code || "NOT_ALLOW_METHOD" === input . code || "TYPE_SAFE_ERROR" === input . code || "BUSINESS_FAIL" === input . code ) && " string" === typeof input . message && ( null !== input . data && ( undefined === input . data || "string" === typeof input . data || " object" === typeof input . data && null !== input . data && $io2 ( input . data ) ) ) ;
44- const $io2 = ( input : any ) : boolean => "string " === typeof input . path && "string" === typeof input . expected && "string" === typeof input . value ;
45- const $io3 = ( input : any ) : boolean => "string" === typeof input . executeId && true === input . success && true ;
42+ const $io0 = ( input : any ) : boolean => "string" === typeof input . executeId && true === input . success && true ;
43+ const $io1 = ( input : any ) : boolean => " string" === typeof input . executeId && false === input . success && ( " object" === typeof input . fail && null !== input . fail && $io2 ( input . fail ) ) ;
44+ const $io2 = ( input : any ) : boolean => ( "NETWORK_ERROR " === input . code || "INTERNAL_SERVER_ERROR" === input . code || "NOT_FOUND" === input . code || "NOT_ALLOW_METHOD" === input . code || "TYPE_SAFE_ERROR" === input . code || "BUSINESS_FAIL" === input . code ) && "string" === typeof input . message && ( null !== input . data && ( undefined === input . data || "string" === typeof input . data || "object" === typeof input . data && null !== input . data && $io3 ( input . data ) ) ) ;
45+ const $io3 = ( input : any ) : boolean => "string" === typeof input . path && "string" === typeof input . expected && "string" === typeof input . value ;
4646 const $iu0 = ( input : any ) : any => ( ( ) => {
47- if ( false === input . success )
47+ if ( true === input . success )
4848 return $io0 ( input ) ;
49- else if ( true === input . success )
50- return $io3 ( input ) ;
49+ else if ( false === input . success )
50+ return $io1 ( input ) ;
5151 else
5252 return false ;
5353 } ) ( ) ;
@@ -60,20 +60,29 @@ export const validateResults = async (results: any) => { _validate(((input: any)
6060 path : _path + ".executeId" ,
6161 expected : "string" ,
6262 value : input . executeId
63+ } ) , true === input . success || $report ( _exceptionable , {
64+ path : _path + ".success" ,
65+ expected : "true" ,
66+ value : input . success
67+ } ) , true ] . every ( ( flag : boolean ) => flag ) ;
68+ const $vo1 = ( input : any , _path : string , _exceptionable : boolean = true ) : boolean => [ "string" === typeof input . executeId || $report ( _exceptionable , {
69+ path : _path + ".executeId" ,
70+ expected : "string" ,
71+ value : input . executeId
6372 } ) , false === input . success || $report ( _exceptionable , {
6473 path : _path + ".success" ,
6574 expected : "false" ,
6675 value : input . success
6776 } ) , ( "object" === typeof input . fail && null !== input . fail || $report ( _exceptionable , {
6877 path : _path + ".fail" ,
69- expected : "RecursiveObjectXToString<Fail<\"NETWORK_ERROR\" | \"INTERNAL_SERVER_ERROR\" | \"NOT_FOUND\" | \"NOT_ALLOW_METHOD\" | \"TYPE_SAFE_ERROR\" | \"BUSINESS_FAIL\">, bigint | RegExp | Date | URL | Uint8Array | ArrayBuffer>" ,
78+ expected : "RecursiveObjectXToString<Fail<\"NETWORK_ERROR\" | \"INTERNAL_SERVER_ERROR\" | \"NOT_FOUND\" | \"NOT_ALLOW_METHOD\" | \"TYPE_SAFE_ERROR\" | \"BUSINESS_FAIL\">, bigint | RegExp | URL | Date | Uint8Array | ArrayBuffer>" ,
7079 value : input . fail
71- } ) ) && $vo1 ( input . fail , _path + ".fail" , true && _exceptionable ) || $report ( _exceptionable , {
80+ } ) ) && $vo2 ( input . fail , _path + ".fail" , true && _exceptionable ) || $report ( _exceptionable , {
7281 path : _path + ".fail" ,
73- expected : "RecursiveObjectXToString<Fail<\"NETWORK_ERROR\" | \"INTERNAL_SERVER_ERROR\" | \"NOT_FOUND\" | \"NOT_ALLOW_METHOD\" | \"TYPE_SAFE_ERROR\" | \"BUSINESS_FAIL\">, bigint | RegExp | Date | URL | Uint8Array | ArrayBuffer>" ,
82+ expected : "RecursiveObjectXToString<Fail<\"NETWORK_ERROR\" | \"INTERNAL_SERVER_ERROR\" | \"NOT_FOUND\" | \"NOT_ALLOW_METHOD\" | \"TYPE_SAFE_ERROR\" | \"BUSINESS_FAIL\">, bigint | RegExp | URL | Date | Uint8Array | ArrayBuffer>" ,
7483 value : input . fail
7584 } ) ] . every ( ( flag : boolean ) => flag ) ;
76- const $vo1 = ( input : any , _path : string , _exceptionable : boolean = true ) : boolean => [ "NETWORK_ERROR" === input . code || "INTERNAL_SERVER_ERROR" === input . code || "NOT_FOUND" === input . code || "NOT_ALLOW_METHOD" === input . code || "TYPE_SAFE_ERROR" === input . code || "BUSINESS_FAIL" === input . code || $report ( _exceptionable , {
85+ const $vo2 = ( input : any , _path : string , _exceptionable : boolean = true ) : boolean => [ "NETWORK_ERROR" === input . code || "INTERNAL_SERVER_ERROR" === input . code || "NOT_FOUND" === input . code || "NOT_ALLOW_METHOD" === input . code || "TYPE_SAFE_ERROR" === input . code || "BUSINESS_FAIL" === input . code || $report ( _exceptionable , {
7786 path : _path + ".code" ,
7887 expected : "(\"BUSINESS_FAIL\" | \"INTERNAL_SERVER_ERROR\" | \"NETWORK_ERROR\" | \"NOT_ALLOW_METHOD\" | \"NOT_FOUND\" | \"TYPE_SAFE_ERROR\")" ,
7988 value : input . code
@@ -89,12 +98,12 @@ export const validateResults = async (results: any) => { _validate(((input: any)
8998 path : _path + ".data" ,
9099 expected : "(__type | string | undefined)" ,
91100 value : input . data
92- } ) ) && $vo2 ( input . data , _path + ".data" , true && _exceptionable ) || $report ( _exceptionable , {
101+ } ) ) && $vo3 ( input . data , _path + ".data" , true && _exceptionable ) || $report ( _exceptionable , {
93102 path : _path + ".data" ,
94103 expected : "(__type | string | undefined)" ,
95104 value : input . data
96105 } ) ) ] . every ( ( flag : boolean ) => flag ) ;
97- const $vo2 = ( input : any , _path : string , _exceptionable : boolean = true ) : boolean => [ "string" === typeof input . path || $report ( _exceptionable , {
106+ const $vo3 = ( input : any , _path : string , _exceptionable : boolean = true ) : boolean => [ "string" === typeof input . path || $report ( _exceptionable , {
98107 path : _path + ".path" ,
99108 expected : "string" ,
100109 value : input . path
@@ -107,34 +116,25 @@ export const validateResults = async (results: any) => { _validate(((input: any)
107116 expected : "string" ,
108117 value : input . value
109118 } ) ] . every ( ( flag : boolean ) => flag ) ;
110- const $vo3 = ( input : any , _path : string , _exceptionable : boolean = true ) : boolean => [ "string" === typeof input . executeId || $report ( _exceptionable , {
111- path : _path + ".executeId" ,
112- expected : "string" ,
113- value : input . executeId
114- } ) , true === input . success || $report ( _exceptionable , {
115- path : _path + ".success" ,
116- expected : "true" ,
117- value : input . success
118- } ) , true ] . every ( ( flag : boolean ) => flag ) ;
119119 const $vu0 = ( input : any , _path : string , _exceptionable : boolean = true ) : any => ( ( ) => {
120- if ( false === input . success )
120+ if ( true === input . success )
121121 return $vo0 ( input , _path , true && _exceptionable ) ;
122- else if ( true === input . success )
123- return $vo3 ( input , _path , true && _exceptionable ) ;
122+ else if ( false === input . success )
123+ return $vo1 ( input , _path , true && _exceptionable ) ;
124124 else
125125 return $report ( _exceptionable , {
126126 path : _path ,
127- expected : "(RecursiveObjectXToString<ExecuteResultFail , bigint | RegExp | Date | URL | Uint8Array | ArrayBuffer> | RecursiveObjectXToString<ExecuteResultSuccess<any> , bigint | RegExp | Date | URL | Uint8Array | ArrayBuffer>)" ,
127+ expected : "(RecursiveObjectXToString<ExecuteResultSuccess<any> , bigint | RegExp | URL | Date | Uint8Array | ArrayBuffer> | RecursiveObjectXToString<ExecuteResultFail , bigint | RegExp | URL | Date | Uint8Array | ArrayBuffer>)" ,
128128 value : input
129129 } ) ;
130130 } ) ( ) ;
131131 return ( "object" === typeof input && null !== input || $report ( true , {
132132 path : _path + "" ,
133- expected : "(RecursiveObjectXToString<ExecuteResultFail, bigint | RegExp | Date | URL | Uint8Array | ArrayBuffer> | RecursiveObjectXToString<ExecuteResultSuccess<any>, bigint | RegExp | Date | URL | Uint8Array | ArrayBuffer>)" ,
133+ expected : "(RecursiveObjectXToString<ExecuteResultFail, bigint | RegExp | URL | Date | Uint8Array | ArrayBuffer> | RecursiveObjectXToString<ExecuteResultSuccess<any>, bigint | RegExp | URL | Date | Uint8Array | ArrayBuffer>)" ,
134134 value : input
135135 } ) ) && $vu0 ( input , _path + "" , true ) || $report ( true , {
136136 path : _path + "" ,
137- expected : "(RecursiveObjectXToString<ExecuteResultFail, bigint | RegExp | Date | URL | Uint8Array | ArrayBuffer> | RecursiveObjectXToString<ExecuteResultSuccess<any>, bigint | RegExp | Date | URL | Uint8Array | ArrayBuffer>)" ,
137+ expected : "(RecursiveObjectXToString<ExecuteResultFail, bigint | RegExp | URL | Date | Uint8Array | ArrayBuffer> | RecursiveObjectXToString<ExecuteResultSuccess<any>, bigint | RegExp | URL | Date | Uint8Array | ArrayBuffer>)" ,
138138 value : input
139139 } ) ;
140140 } ) ( input , "$input" , true ) ;
@@ -146,14 +146,15 @@ export const validateResults = async (results: any) => { _validate(((input: any)
146146 data : success ? input : undefined
147147 } as any ;
148148} ) ( results ) ) ; return ( ( input : TSONEncode < ExecuteResultSuccess < ResultsT > | ExecuteResultFail > ) : string => {
149- const $io0 = ( input : any ) : boolean => "string" === typeof input . executeId && false === input . success && ( "object" === typeof input . fail && null !== input . fail && $io1 ( input . fail ) ) ;
150- const $io1 = ( input : any ) : boolean => ( "NETWORK_ERROR" === input . code || "INTERNAL_SERVER_ERROR" === input . code || "NOT_FOUND" === input . code || "NOT_ALLOW_METHOD" === input . code || "TYPE_SAFE_ERROR" === input . code || "BUSINESS_FAIL" === input . code ) && " string" === typeof input . message && ( null !== input . data && ( undefined === input . data || "string" === typeof input . data || " object" === typeof input . data && null !== input . data && $io2 ( input . data ) ) ) ;
151- const $io2 = ( input : any ) : boolean => "string " === typeof input . path && "string" === typeof input . expected && "string" === typeof input . value ;
152- const $io3 = ( input : any ) : boolean => "string" === typeof input . executeId && true === input . success && true ;
149+ const $io0 = ( input : any ) : boolean => "string" === typeof input . executeId && true === input . success && true ;
150+ const $io1 = ( input : any ) : boolean => " string" === typeof input . executeId && false === input . success && ( " object" === typeof input . fail && null !== input . fail && $io2 ( input . fail ) ) ;
151+ const $io2 = ( input : any ) : boolean => ( "NETWORK_ERROR " === input . code || "INTERNAL_SERVER_ERROR" === input . code || "NOT_FOUND" === input . code || "NOT_ALLOW_METHOD" === input . code || "TYPE_SAFE_ERROR" === input . code || "BUSINESS_FAIL" === input . code ) && "string" === typeof input . message && ( null !== input . data && ( undefined === input . data || "string" === typeof input . data || "object" === typeof input . data && null !== input . data && $io3 ( input . data ) ) ) ;
152+ const $io3 = ( input : any ) : boolean => "string" === typeof input . path && "string" === typeof input . expected && "string" === typeof input . value ;
153153 const $string = ( typia . json . stringify as any ) . string ;
154154 const $throws = ( typia . json . stringify as any ) . throws ;
155- const $so0 = ( input : any ) : any => `{"executeId":${ $string ( input . executeId ) } ,"success":${ input . success } ,"fail":${ $so1 ( input . fail ) } }` ;
156- const $so1 = ( input : any ) : any => `{${ undefined === input . data ? "" : `"data":${ undefined !== input . data ? ( ( ) => {
155+ const $so0 = ( input : any ) : any => `{${ undefined === input . data || "function" === typeof input . data ? "" : `"data":${ undefined !== input . data ? JSON . stringify ( input . data ) : undefined } ,` } "executeId":${ $string ( input . executeId ) } ,"success":${ input . success } }` ;
156+ const $so1 = ( input : any ) : any => `{"executeId":${ $string ( input . executeId ) } ,"success":${ input . success } ,"fail":${ $so2 ( input . fail ) } }` ;
157+ const $so2 = ( input : any ) : any => `{${ undefined === input . data ? "" : `"data":${ undefined !== input . data ? ( ( ) => {
157158 if ( "string" === typeof input . data )
158159 return $string ( input . data ) ;
159160 if ( "object" === typeof input . data && null !== input . data )
@@ -172,15 +173,14 @@ export const validateResults = async (results: any) => { _validate(((input: any)
172173 value : input . code
173174 } ) ;
174175 } ) ( ) } ,"message":${ $string ( input . message ) } }`;
175- const $so3 = ( input : any ) : any => `{${ undefined === input . data || "function" === typeof input . data ? "" : `"data":${ undefined !== input . data ? JSON . stringify ( input . data ) : undefined } ,` } "executeId":${ $string ( input . executeId ) } ,"success":${ input . success } }` ;
176176 const $su0 = ( input : any ) : any => ( ( ) => {
177- if ( false === input . success )
177+ if ( true === input . success )
178178 return $so0 ( input ) ;
179- else if ( true === input . success )
180- return $so3 ( input ) ;
179+ else if ( false === input . success )
180+ return $so1 ( input ) ;
181181 else
182182 $throws ( {
183- expected : "(RecursiveObjectXToString<ExecuteResultFail , bigint | RegExp | Date | URL | Uint8Array | ArrayBuffer> | RecursiveObjectXToString<ExecuteResultSuccess<any> , bigint | RegExp | Date | URL | Uint8Array | ArrayBuffer>)" ,
183+ expected : "(RecursiveObjectXToString<ExecuteResultSuccess<any> , bigint | RegExp | URL | Date | Uint8Array | ArrayBuffer> | RecursiveObjectXToString<ExecuteResultFail , bigint | RegExp | URL | Date | Uint8Array | ArrayBuffer>)" ,
184184 value : input
185185 } ) ;
186186 } ) ( ) ;
0 commit comments