Skip to content

Commit c0a3753

Browse files
committed
🧊 fix: the issue of the client type not updating on windows
1 parent cb9cd74 commit c0a3753

File tree

8 files changed

+63
-62
lines changed

8 files changed

+63
-62
lines changed

generated/api-schema.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,29 @@
33
*/
44

55
// api
6-
import type * as test from '../src/apps/test'
7-
import type * as foo from '../src/apps/foo'
86
import type * as cookbook from '../src/apps/cookbook'
7+
import type * as foo from '../src/apps/foo'
8+
import type * as test from '../src/apps/test'
99

1010
import _apiValidator from './products/api-validator.ts'
1111

1212
export default {
1313
apiValidator: _apiValidator,
1414
apiMethodsSchema: {
15-
'test': () => ({ module: import('../src/apps/test') }),
16-
'foo': () => ({ module: import('../src/apps/foo') }),
1715
'cookbook': () => ({ module: import('../src/apps/cookbook') }),
16+
'foo': () => ({ module: import('../src/apps/foo') }),
17+
'test': () => ({ module: import('../src/apps/test') }),
1818

1919
},
2020
apiMethodsTypeSchema: {
21-
'test': undefined as unknown as typeof test,
22-
'foo': undefined as unknown as typeof foo,
2321
'cookbook': undefined as unknown as typeof cookbook,
22+
'foo': undefined as unknown as typeof foo,
23+
'test': undefined as unknown as typeof test,
2424

2525
},
2626
apiTestsSchema: {
27-
'test': () => ({ module: import('../src/apps/test') }),
2827
'foo': () => ({ module: import('../src/apps/foo') }),
28+
'test': () => ({ module: import('../src/apps/test') }),
2929

3030
},
3131
}

generated/cookbook.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"cookbook":{"test":{"title":"test","desc":"\ntest","params":"Params","cases":[{"name":"Basic","handler":"\t\t\tconst result = await test.execute({ params: { foo: '123' } });\n\t\t\tif (!result.success) return test.reject(`The result was not success`);\n\t\t\tconsole.log(result);"},{"name":"Basic","handler":"\t\t\tconst result = await test.execute({ params: { foo: '123' } });\n\t\t\tif (!result.success) return test.reject(`The result was not success`);\n\t\t\tconsole.log(result);"},{"name":"Basic","handler":"\t\t\tconst result = await test.execute({ params: { foo: '123' } });\n\t\t\tif (!result.success) return test.reject(`The result was not success`);\n\t\t\tconsole.log(result);"},{"name":"Basic","handler":"\t\t\tconst result = await test.execute({ params: { foo: '123' } });\n\t\t\tif (!result.success) return test.reject(`The result was not success`);\n\t\t\tconsole.log(result);"},{"name":"Basic","handler":"\t\t\tconst result = await test.execute({ params: { foo: '123' } });\n\t\t\tif (!result.success) return test.reject(`The result was not success`);\n\t\t\tconsole.log(result);"}]},"foo":{"params":"{ sad: string }","cases":[{"name":"Basic","handler":"\t\t\tconst { stream, getResult } = await test.executeStream({\n\t\t\t\tparams: { sad: 'UWU' }\n\t\t\t})\n\t\t\tconst xxx = getResult()\n\n\t\t\tfor await (const chunk of stream) {\n\t\t\t\tconsole.log('foo', chunk);\n\t\t\t}"}]},"cookbook":{"params":"string & typia.tags.MinLength<3> & typia.tags.MaxLength<16>","cases":[]}},"readme":"# 你好世界\n\nHello world\n\n```sh\n世界你好 # enenen\n```\n\n","indexes":{"(root)":["test","foo","cookbook"]},"folderIndexes":{"(root)":[]},"generatedAt":"t!Date:2024-06-17T07:01:40.064Z"}
1+
{"cookbook":{"cookbook":{"params":"string & typia.tags.MinLength<3> & typia.tags.MaxLength<16>","cases":[]},"foo":{"params":"{ sad: string }","cases":[{"name":"Basic","handler":"\t\t\tconst { stream, getResult } = await test.executeStream({\n\t\t\t\tparams: { sad: 'UWU' }\n\t\t\t})\n\t\t\tconst xxx = getResult()\n\n\t\t\tfor await (const chunk of stream) {\n\t\t\t\tconsole.log('foo', chunk);\n\t\t\t}"}]},"test":{"title":"test","desc":"\ntest","params":"Params","cases":[{"name":"Basic","handler":"\t\t\tconst result = await test.execute({ params: { foo: '123' } });\n\t\t\tif (!result.success) return test.reject(`The result was not success`);\n\t\t\tconsole.log(result);"},{"name":"Basic","handler":"\t\t\tconst result = await test.execute({ params: { foo: '123' } });\n\t\t\tif (!result.success) return test.reject(`The result was not success`);\n\t\t\tconsole.log(result);"},{"name":"Basic","handler":"\t\t\tconst result = await test.execute({ params: { foo: '123' } });\n\t\t\tif (!result.success) return test.reject(`The result was not success`);\n\t\t\tconsole.log(result);"},{"name":"Basic","handler":"\t\t\tconst result = await test.execute({ params: { foo: '123' } });\n\t\t\tif (!result.success) return test.reject(`The result was not success`);\n\t\t\tconsole.log(result);"},{"name":"Basic","handler":"\t\t\tconst result = await test.execute({ params: { foo: '123' } });\n\t\t\tif (!result.success) return test.reject(`The result was not success`);\n\t\t\tconsole.log(result);"}]}},"readme":"# 你好世界\n\nHello world\n\n```sh\n世界你好 # enenen\n```\n\n","indexes":{"(root)":["cookbook","foo","test"]},"folderIndexes":{"(root)":[]},"generatedAt":"t!Date:2024-06-29T10:14:21.229Z"}

generated/products/api-validator.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
* ⚠️This file is generated and modifications will be overwritten
33
*/
44
export default {
5-
generatedAt: 1718607698253,
5+
generatedAt: 1719656060437,
66
validate: {
7-
'test': () => import('./apps/test.ts'),
8-
'foo': () => import('./apps/foo.ts'),
97
'cookbook': () => import('./apps/cookbook.ts'),
8+
'foo': () => import('./apps/foo.ts'),
9+
'test': () => import('./apps/test.ts'),
1010
},
1111
};

generated/products/apps/cookbook.ts

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,15 @@ type ResultsT = Awaited<ReturnType<typeof cookbook['api']['action']>>;
3939
export 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

Comments
 (0)