@milkio/astra 1.0.0-alpha.63 → 1.0.0-alpha.65
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.ts +1 -1
- package/package.json +1 -1
- package/utils/cookbook-dto-checks.ts +193 -126
- package/utils/cookbook-dto-types.ts +11 -3
package/index.ts
CHANGED
|
@@ -53,7 +53,7 @@ export async function createAstra<AstraOptions extends AstraOptionsInit, Generat
|
|
|
53
53
|
const project = cookbookOptions.projects[projectName]
|
|
54
54
|
if (project.type !== 'milkio') continue
|
|
55
55
|
projectStatus.set(projectName, withResolvers())
|
|
56
|
-
let counter =
|
|
56
|
+
let counter = 65
|
|
57
57
|
let timer: Timer | null = setInterval(async () => {
|
|
58
58
|
if (--counter <= 0) {
|
|
59
59
|
clearInterval(timer!)
|
package/package.json
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The content of this file is automatically generated by Typia.
|
|
3
|
-
* It can be edited in the /packages/cookbook-dto/src/* file, and each time you run bun run dev, the generated file will be synced to another location based on the content of the /develop.ts.
|
|
4
|
-
*/
|
|
2
|
+
* The content of this file is automatically generated by Typia.
|
|
3
|
+
* It can be edited in the /packages/cookbook-dto/src/* file, and each time you run bun run dev, the generated file will be synced to another location based on the content of the /develop.ts.
|
|
4
|
+
*/
|
|
5
5
|
|
|
6
|
+
import * as __typia_transform__accessExpressionAsString from "typia/lib/internal/_accessExpressionAsString.js";
|
|
7
|
+
import * as __typia_transform__validateReport from "typia/lib/internal/_validateReport.js";
|
|
8
|
+
import * as __typia_transform__throwTypeGuardError from "typia/lib/internal/_throwTypeGuardError.js";
|
|
6
9
|
import typia from 'typia';
|
|
7
10
|
import type { CookbookActionParams, CookbookOptions, CookbookSubscribeEmits } from './cookbook-dto-types';
|
|
8
11
|
export async function checkCookbookOptions(cookbookTomlParsed: any): Promise<[
|
|
@@ -16,45 +19,45 @@ export async function checkCookbookOptions(cookbookTomlParsed: any): Promise<[
|
|
|
16
19
|
CookbookOptions
|
|
17
20
|
]> {
|
|
18
21
|
const cookbookToml = { ...cookbookTomlParsed };
|
|
19
|
-
const checkResult = (() => { const
|
|
22
|
+
const checkResult = (() => { const _io0 = (input: any, _exceptionable: boolean = true): boolean => "object" === typeof input.projects && null !== input.projects && false === Array.isArray(input.projects) && _io1(input.projects, true && _exceptionable) && ("object" === typeof input.general && null !== input.general && _io3(input.general, true && _exceptionable)) && (2 === Object.keys(input).length || Object.keys(input).every((key: any) => {
|
|
20
23
|
if (["projects", "general"].some((prop: any) => key === prop))
|
|
21
24
|
return true;
|
|
22
25
|
const value = input[key];
|
|
23
26
|
if (undefined === value)
|
|
24
27
|
return true;
|
|
25
28
|
return false;
|
|
26
|
-
})); const
|
|
29
|
+
})); const _io1 = (input: any, _exceptionable: boolean = true): boolean => Object.keys(input).every((key: any) => {
|
|
27
30
|
const value = input[key];
|
|
28
31
|
if (undefined === value)
|
|
29
32
|
return true;
|
|
30
|
-
return "object" === typeof value && null !== value &&
|
|
31
|
-
}); const
|
|
33
|
+
return "object" === typeof value && null !== value && _io2(value, true && _exceptionable);
|
|
34
|
+
}); const _io2 = (input: any, _exceptionable: boolean = true): boolean => ("milkio" === input.type || "other" === input.type) && "number" === typeof input.port && (Array.isArray(input.start) && input.start.every((elem: any, _index1: number) => "string" === typeof elem)) && (Array.isArray(input.build) && input.build.every((elem: any, _index2: number) => "string" === typeof elem)) && (undefined === input.watch || "boolean" === typeof input.watch) && (undefined === input.lazyRoutes || "boolean" === typeof input.lazyRoutes) && (undefined === input.typiaMode || "generation" === input.typiaMode || "bundler" === input.typiaMode) && (undefined === input.significant || Array.isArray(input.significant) && input.significant.every((elem: any, _index3: number) => "string" === typeof elem)) && (undefined === input.insignificant || Array.isArray(input.insignificant) && input.insignificant.every((elem: any, _index4: number) => "string" === typeof elem)) && (4 === Object.keys(input).length || Object.keys(input).every((key: any) => {
|
|
32
35
|
if (["type", "port", "start", "build", "watch", "lazyRoutes", "typiaMode", "significant", "insignificant"].some((prop: any) => key === prop))
|
|
33
36
|
return true;
|
|
34
37
|
const value = input[key];
|
|
35
38
|
if (undefined === value)
|
|
36
39
|
return true;
|
|
37
40
|
return false;
|
|
38
|
-
})); const
|
|
41
|
+
})); const _io3 = (input: any, _exceptionable: boolean = true): boolean => "string" === typeof input.start && "number" === typeof input.cookbookPort && (2 === Object.keys(input).length || Object.keys(input).every((key: any) => {
|
|
39
42
|
if (["start", "cookbookPort"].some((prop: any) => key === prop))
|
|
40
43
|
return true;
|
|
41
44
|
const value = input[key];
|
|
42
45
|
if (undefined === value)
|
|
43
46
|
return true;
|
|
44
47
|
return false;
|
|
45
|
-
})); const
|
|
48
|
+
})); const _vo0 = (input: any, _path: string, _exceptionable: boolean = true): boolean => [("object" === typeof input.projects && null !== input.projects && false === Array.isArray(input.projects) || _report(_exceptionable, {
|
|
46
49
|
path: _path + ".projects",
|
|
47
50
|
expected: "Record<string, __type>",
|
|
48
51
|
value: input.projects
|
|
49
|
-
})) &&
|
|
52
|
+
})) && _vo1(input.projects, _path + ".projects", true && _exceptionable) || _report(_exceptionable, {
|
|
50
53
|
path: _path + ".projects",
|
|
51
54
|
expected: "Record<string, __type>",
|
|
52
55
|
value: input.projects
|
|
53
|
-
}), ("object" === typeof input.general && null !== input.general ||
|
|
56
|
+
}), ("object" === typeof input.general && null !== input.general || _report(_exceptionable, {
|
|
54
57
|
path: _path + ".general",
|
|
55
58
|
expected: "__type.o1",
|
|
56
59
|
value: input.general
|
|
57
|
-
})) &&
|
|
60
|
+
})) && _vo3(input.general, _path + ".general", true && _exceptionable) || _report(_exceptionable, {
|
|
58
61
|
path: _path + ".general",
|
|
59
62
|
expected: "__type.o1",
|
|
60
63
|
value: input.general
|
|
@@ -64,89 +67,89 @@ export async function checkCookbookOptions(cookbookTomlParsed: any): Promise<[
|
|
|
64
67
|
const value = input[key];
|
|
65
68
|
if (undefined === value)
|
|
66
69
|
return true;
|
|
67
|
-
return
|
|
68
|
-
path: _path +
|
|
70
|
+
return _report(_exceptionable, {
|
|
71
|
+
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
69
72
|
expected: "undefined",
|
|
70
73
|
value: value
|
|
71
74
|
});
|
|
72
|
-
}).every((flag: boolean) => flag))].every((flag: boolean) => flag); const
|
|
75
|
+
}).every((flag: boolean) => flag))].every((flag: boolean) => flag); const _vo1 = (input: any, _path: string, _exceptionable: boolean = true): boolean => [false === _exceptionable || Object.keys(input).map((key: any) => {
|
|
73
76
|
const value = input[key];
|
|
74
77
|
if (undefined === value)
|
|
75
78
|
return true;
|
|
76
|
-
return ("object" === typeof value && null !== value ||
|
|
77
|
-
path: _path +
|
|
79
|
+
return ("object" === typeof value && null !== value || _report(_exceptionable, {
|
|
80
|
+
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
78
81
|
expected: "__type",
|
|
79
82
|
value: value
|
|
80
|
-
})) &&
|
|
81
|
-
path: _path +
|
|
83
|
+
})) && _vo2(value, _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key), true && _exceptionable) || _report(_exceptionable, {
|
|
84
|
+
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
82
85
|
expected: "__type",
|
|
83
86
|
value: value
|
|
84
87
|
});
|
|
85
|
-
}).every((flag: boolean) => flag)].every((flag: boolean) => flag); const
|
|
88
|
+
}).every((flag: boolean) => flag)].every((flag: boolean) => flag); const _vo2 = (input: any, _path: string, _exceptionable: boolean = true): boolean => ["milkio" === input.type || "other" === input.type || _report(_exceptionable, {
|
|
86
89
|
path: _path + ".type",
|
|
87
90
|
expected: "(\"milkio\" | \"other\")",
|
|
88
91
|
value: input.type
|
|
89
|
-
}), "number" === typeof input.port ||
|
|
92
|
+
}), "number" === typeof input.port || _report(_exceptionable, {
|
|
90
93
|
path: _path + ".port",
|
|
91
94
|
expected: "number",
|
|
92
95
|
value: input.port
|
|
93
|
-
}), (Array.isArray(input.start) ||
|
|
96
|
+
}), (Array.isArray(input.start) || _report(_exceptionable, {
|
|
94
97
|
path: _path + ".start",
|
|
95
98
|
expected: "Array<string>",
|
|
96
99
|
value: input.start
|
|
97
|
-
})) && input.start.map((elem: any, _index5: number) => "string" === typeof elem ||
|
|
100
|
+
})) && input.start.map((elem: any, _index5: number) => "string" === typeof elem || _report(_exceptionable, {
|
|
98
101
|
path: _path + ".start[" + _index5 + "]",
|
|
99
102
|
expected: "string",
|
|
100
103
|
value: elem
|
|
101
|
-
})).every((flag: boolean) => flag) ||
|
|
104
|
+
})).every((flag: boolean) => flag) || _report(_exceptionable, {
|
|
102
105
|
path: _path + ".start",
|
|
103
106
|
expected: "Array<string>",
|
|
104
107
|
value: input.start
|
|
105
|
-
}), (Array.isArray(input.build) ||
|
|
108
|
+
}), (Array.isArray(input.build) || _report(_exceptionable, {
|
|
106
109
|
path: _path + ".build",
|
|
107
110
|
expected: "Array<string>",
|
|
108
111
|
value: input.build
|
|
109
|
-
})) && input.build.map((elem: any, _index6: number) => "string" === typeof elem ||
|
|
112
|
+
})) && input.build.map((elem: any, _index6: number) => "string" === typeof elem || _report(_exceptionable, {
|
|
110
113
|
path: _path + ".build[" + _index6 + "]",
|
|
111
114
|
expected: "string",
|
|
112
115
|
value: elem
|
|
113
|
-
})).every((flag: boolean) => flag) ||
|
|
116
|
+
})).every((flag: boolean) => flag) || _report(_exceptionable, {
|
|
114
117
|
path: _path + ".build",
|
|
115
118
|
expected: "Array<string>",
|
|
116
119
|
value: input.build
|
|
117
|
-
}), undefined === input.watch || "boolean" === typeof input.watch ||
|
|
120
|
+
}), undefined === input.watch || "boolean" === typeof input.watch || _report(_exceptionable, {
|
|
118
121
|
path: _path + ".watch",
|
|
119
122
|
expected: "(boolean | undefined)",
|
|
120
123
|
value: input.watch
|
|
121
|
-
}), undefined === input.lazyRoutes || "boolean" === typeof input.lazyRoutes ||
|
|
124
|
+
}), undefined === input.lazyRoutes || "boolean" === typeof input.lazyRoutes || _report(_exceptionable, {
|
|
122
125
|
path: _path + ".lazyRoutes",
|
|
123
126
|
expected: "(boolean | undefined)",
|
|
124
127
|
value: input.lazyRoutes
|
|
125
|
-
}), undefined === input.typiaMode || "generation" === input.typiaMode || "bundler" === input.typiaMode ||
|
|
128
|
+
}), undefined === input.typiaMode || "generation" === input.typiaMode || "bundler" === input.typiaMode || _report(_exceptionable, {
|
|
126
129
|
path: _path + ".typiaMode",
|
|
127
130
|
expected: "(\"bundler\" | \"generation\" | undefined)",
|
|
128
131
|
value: input.typiaMode
|
|
129
|
-
}), undefined === input.significant || (Array.isArray(input.significant) ||
|
|
132
|
+
}), undefined === input.significant || (Array.isArray(input.significant) || _report(_exceptionable, {
|
|
130
133
|
path: _path + ".significant",
|
|
131
134
|
expected: "(Array<string> | undefined)",
|
|
132
135
|
value: input.significant
|
|
133
|
-
})) && input.significant.map((elem: any, _index7: number) => "string" === typeof elem ||
|
|
136
|
+
})) && input.significant.map((elem: any, _index7: number) => "string" === typeof elem || _report(_exceptionable, {
|
|
134
137
|
path: _path + ".significant[" + _index7 + "]",
|
|
135
138
|
expected: "string",
|
|
136
139
|
value: elem
|
|
137
|
-
})).every((flag: boolean) => flag) ||
|
|
140
|
+
})).every((flag: boolean) => flag) || _report(_exceptionable, {
|
|
138
141
|
path: _path + ".significant",
|
|
139
142
|
expected: "(Array<string> | undefined)",
|
|
140
143
|
value: input.significant
|
|
141
|
-
}), undefined === input.insignificant || (Array.isArray(input.insignificant) ||
|
|
144
|
+
}), undefined === input.insignificant || (Array.isArray(input.insignificant) || _report(_exceptionable, {
|
|
142
145
|
path: _path + ".insignificant",
|
|
143
146
|
expected: "(Array<string> | undefined)",
|
|
144
147
|
value: input.insignificant
|
|
145
|
-
})) && input.insignificant.map((elem: any, _index8: number) => "string" === typeof elem ||
|
|
148
|
+
})) && input.insignificant.map((elem: any, _index8: number) => "string" === typeof elem || _report(_exceptionable, {
|
|
146
149
|
path: _path + ".insignificant[" + _index8 + "]",
|
|
147
150
|
expected: "string",
|
|
148
151
|
value: elem
|
|
149
|
-
})).every((flag: boolean) => flag) ||
|
|
152
|
+
})).every((flag: boolean) => flag) || _report(_exceptionable, {
|
|
150
153
|
path: _path + ".insignificant",
|
|
151
154
|
expected: "(Array<string> | undefined)",
|
|
152
155
|
value: input.insignificant
|
|
@@ -156,16 +159,16 @@ export async function checkCookbookOptions(cookbookTomlParsed: any): Promise<[
|
|
|
156
159
|
const value = input[key];
|
|
157
160
|
if (undefined === value)
|
|
158
161
|
return true;
|
|
159
|
-
return
|
|
160
|
-
path: _path +
|
|
162
|
+
return _report(_exceptionable, {
|
|
163
|
+
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
161
164
|
expected: "undefined",
|
|
162
165
|
value: value
|
|
163
166
|
});
|
|
164
|
-
}).every((flag: boolean) => flag))].every((flag: boolean) => flag); const
|
|
167
|
+
}).every((flag: boolean) => flag))].every((flag: boolean) => flag); const _vo3 = (input: any, _path: string, _exceptionable: boolean = true): boolean => ["string" === typeof input.start || _report(_exceptionable, {
|
|
165
168
|
path: _path + ".start",
|
|
166
169
|
expected: "string",
|
|
167
170
|
value: input.start
|
|
168
|
-
}), "number" === typeof input.cookbookPort ||
|
|
171
|
+
}), "number" === typeof input.cookbookPort || _report(_exceptionable, {
|
|
169
172
|
path: _path + ".cookbookPort",
|
|
170
173
|
expected: "number",
|
|
171
174
|
value: input.cookbookPort
|
|
@@ -175,34 +178,36 @@ export async function checkCookbookOptions(cookbookTomlParsed: any): Promise<[
|
|
|
175
178
|
const value = input[key];
|
|
176
179
|
if (undefined === value)
|
|
177
180
|
return true;
|
|
178
|
-
return
|
|
179
|
-
path: _path +
|
|
181
|
+
return _report(_exceptionable, {
|
|
182
|
+
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
180
183
|
expected: "undefined",
|
|
181
184
|
value: value
|
|
182
185
|
});
|
|
183
|
-
}).every((flag: boolean) => flag))].every((flag: boolean) => flag); const __is = (input: any, _exceptionable: boolean = true): input is CookbookOptions => "object" === typeof input && null !== input &&
|
|
186
|
+
}).every((flag: boolean) => flag))].every((flag: boolean) => flag); const __is = (input: any, _exceptionable: boolean = true): input is CookbookOptions => "object" === typeof input && null !== input && _io0(input, true); let errors: any; let _report: any; return (input: any): import("typia").IValidation<CookbookOptions> => {
|
|
184
187
|
if (false === __is(input)) {
|
|
185
188
|
errors = [];
|
|
186
|
-
|
|
187
|
-
((input: any, _path: string, _exceptionable: boolean = true) => ("object" === typeof input && null !== input ||
|
|
189
|
+
_report = (__typia_transform__validateReport._validateReport as any)(errors);
|
|
190
|
+
((input: any, _path: string, _exceptionable: boolean = true) => ("object" === typeof input && null !== input || _report(true, {
|
|
188
191
|
path: _path + "",
|
|
189
192
|
expected: "CookbookOptions",
|
|
190
193
|
value: input
|
|
191
|
-
})) &&
|
|
194
|
+
})) && _vo0(input, _path + "", true) || _report(true, {
|
|
192
195
|
path: _path + "",
|
|
193
196
|
expected: "CookbookOptions",
|
|
194
197
|
value: input
|
|
195
198
|
}))(input, "$input", true);
|
|
196
199
|
const success = 0 === errors.length;
|
|
197
|
-
return {
|
|
200
|
+
return success ? {
|
|
201
|
+
success,
|
|
202
|
+
data: input
|
|
203
|
+
} : {
|
|
198
204
|
success,
|
|
199
205
|
errors,
|
|
200
|
-
data:
|
|
206
|
+
data: input
|
|
201
207
|
} as any;
|
|
202
208
|
}
|
|
203
209
|
return {
|
|
204
210
|
success: true,
|
|
205
|
-
errors: [],
|
|
206
211
|
data: input
|
|
207
212
|
} as any;
|
|
208
213
|
}; })()(cookbookTomlParsed);
|
|
@@ -228,99 +233,158 @@ export async function checkCookbookActionParams(resultsRaw: any): Promise<[
|
|
|
228
233
|
let results = { ...resultsRaw };
|
|
229
234
|
if (typeof Bun === 'undefined')
|
|
230
235
|
throw new Error('Bun is not defined');
|
|
231
|
-
const checkResult = (() => { const
|
|
232
|
-
if ("milkio@
|
|
233
|
-
return
|
|
236
|
+
const checkResult = (() => { const _io0 = (input: any): boolean => "milkio@ping" === input.type; const _io1 = (input: any): boolean => "milkio@logger" === input.type && Array.isArray(input.log); const _io2 = (input: any): boolean => "milkio@template" === input.type && "string" === typeof input.name && "string" === typeof input.fsPath && "string" === typeof input.template; const _io3 = (input: any): boolean => "workers@list" === input.type; const _io4 = (input: any): boolean => "workers@get" === input.type && "string" === typeof input.key && "number" === typeof input.index; const _iu0 = (input: any): any => (() => {
|
|
237
|
+
if ("milkio@ping" === input.type)
|
|
238
|
+
return _io0(input);
|
|
239
|
+
else if ("milkio@logger" === input.type)
|
|
240
|
+
return _io1(input);
|
|
234
241
|
else if ("milkio@template" === input.type)
|
|
235
|
-
return
|
|
242
|
+
return _io2(input);
|
|
243
|
+
else if ("workers@list" === input.type)
|
|
244
|
+
return _io3(input);
|
|
245
|
+
else if ("workers@get" === input.type)
|
|
246
|
+
return _io4(input);
|
|
236
247
|
else
|
|
237
248
|
return false;
|
|
238
|
-
})(); const
|
|
249
|
+
})(); const _vo0 = (input: any, _path: string, _exceptionable: boolean = true): boolean => ["milkio@ping" === input.type || _report(_exceptionable, {
|
|
250
|
+
path: _path + ".type",
|
|
251
|
+
expected: "\"milkio@ping\"",
|
|
252
|
+
value: input.type
|
|
253
|
+
})].every((flag: boolean) => flag); const _vo1 = (input: any, _path: string, _exceptionable: boolean = true): boolean => ["milkio@logger" === input.type || _report(_exceptionable, {
|
|
239
254
|
path: _path + ".type",
|
|
240
255
|
expected: "\"milkio@logger\"",
|
|
241
256
|
value: input.type
|
|
242
|
-
}), Array.isArray(input.log) ||
|
|
257
|
+
}), Array.isArray(input.log) || _report(_exceptionable, {
|
|
243
258
|
path: _path + ".log",
|
|
244
259
|
expected: "Array<any>",
|
|
245
260
|
value: input.log
|
|
246
|
-
})].every((flag: boolean) => flag); const
|
|
261
|
+
})].every((flag: boolean) => flag); const _vo2 = (input: any, _path: string, _exceptionable: boolean = true): boolean => ["milkio@template" === input.type || _report(_exceptionable, {
|
|
247
262
|
path: _path + ".type",
|
|
248
263
|
expected: "\"milkio@template\"",
|
|
249
264
|
value: input.type
|
|
250
|
-
}), "string" === typeof input.name ||
|
|
265
|
+
}), "string" === typeof input.name || _report(_exceptionable, {
|
|
251
266
|
path: _path + ".name",
|
|
252
267
|
expected: "string",
|
|
253
268
|
value: input.name
|
|
254
|
-
}), "string" === typeof input.fsPath ||
|
|
269
|
+
}), "string" === typeof input.fsPath || _report(_exceptionable, {
|
|
255
270
|
path: _path + ".fsPath",
|
|
256
271
|
expected: "string",
|
|
257
272
|
value: input.fsPath
|
|
258
|
-
}), "string" === typeof input.template ||
|
|
273
|
+
}), "string" === typeof input.template || _report(_exceptionable, {
|
|
259
274
|
path: _path + ".template",
|
|
260
275
|
expected: "string",
|
|
261
276
|
value: input.template
|
|
262
|
-
})].every((flag: boolean) => flag); const
|
|
263
|
-
|
|
264
|
-
|
|
277
|
+
})].every((flag: boolean) => flag); const _vo3 = (input: any, _path: string, _exceptionable: boolean = true): boolean => ["workers@list" === input.type || _report(_exceptionable, {
|
|
278
|
+
path: _path + ".type",
|
|
279
|
+
expected: "\"workers@list\"",
|
|
280
|
+
value: input.type
|
|
281
|
+
})].every((flag: boolean) => flag); const _vo4 = (input: any, _path: string, _exceptionable: boolean = true): boolean => ["workers@get" === input.type || _report(_exceptionable, {
|
|
282
|
+
path: _path + ".type",
|
|
283
|
+
expected: "\"workers@get\"",
|
|
284
|
+
value: input.type
|
|
285
|
+
}), "string" === typeof input.key || _report(_exceptionable, {
|
|
286
|
+
path: _path + ".key",
|
|
287
|
+
expected: "string",
|
|
288
|
+
value: input.key
|
|
289
|
+
}), "number" === typeof input.index || _report(_exceptionable, {
|
|
290
|
+
path: _path + ".index",
|
|
291
|
+
expected: "number",
|
|
292
|
+
value: input.index
|
|
293
|
+
})].every((flag: boolean) => flag); const _vu0 = (input: any, _path: string, _exceptionable: boolean = true): any => (() => {
|
|
294
|
+
if ("milkio@ping" === input.type)
|
|
295
|
+
return _vo0(input, _path, true && _exceptionable);
|
|
296
|
+
else if ("milkio@logger" === input.type)
|
|
297
|
+
return _vo1(input, _path, true && _exceptionable);
|
|
265
298
|
else if ("milkio@template" === input.type)
|
|
266
|
-
return
|
|
299
|
+
return _vo2(input, _path, true && _exceptionable);
|
|
300
|
+
else if ("workers@list" === input.type)
|
|
301
|
+
return _vo3(input, _path, true && _exceptionable);
|
|
302
|
+
else if ("workers@get" === input.type)
|
|
303
|
+
return _vo4(input, _path, true && _exceptionable);
|
|
267
304
|
else
|
|
268
|
-
return
|
|
305
|
+
return _report(_exceptionable, {
|
|
269
306
|
path: _path,
|
|
270
|
-
expected: "(__type | __type.o1)",
|
|
307
|
+
expected: "(__type | __type.o1 | __type.o2 | __type.o3 | __type.o4)",
|
|
271
308
|
value: input
|
|
272
309
|
});
|
|
273
|
-
})(); const
|
|
310
|
+
})(); const _po0 = (input: any): any => {
|
|
311
|
+
for (const key of Object.keys(input)) {
|
|
312
|
+
if ("type" === key)
|
|
313
|
+
continue;
|
|
314
|
+
delete input[key];
|
|
315
|
+
}
|
|
316
|
+
}; const _po1 = (input: any): any => {
|
|
274
317
|
for (const key of Object.keys(input)) {
|
|
275
318
|
if ("type" === key || "log" === key)
|
|
276
319
|
continue;
|
|
277
320
|
delete input[key];
|
|
278
321
|
}
|
|
279
|
-
}; const
|
|
322
|
+
}; const _po2 = (input: any): any => {
|
|
280
323
|
for (const key of Object.keys(input)) {
|
|
281
324
|
if ("type" === key || "name" === key || "fsPath" === key || "template" === key)
|
|
282
325
|
continue;
|
|
283
326
|
delete input[key];
|
|
284
327
|
}
|
|
285
|
-
}; const
|
|
286
|
-
|
|
287
|
-
|
|
328
|
+
}; const _po3 = (input: any): any => {
|
|
329
|
+
for (const key of Object.keys(input)) {
|
|
330
|
+
if ("type" === key)
|
|
331
|
+
continue;
|
|
332
|
+
delete input[key];
|
|
333
|
+
}
|
|
334
|
+
}; const _po4 = (input: any): any => {
|
|
335
|
+
for (const key of Object.keys(input)) {
|
|
336
|
+
if ("type" === key || "key" === key || "index" === key)
|
|
337
|
+
continue;
|
|
338
|
+
delete input[key];
|
|
339
|
+
}
|
|
340
|
+
}; const _pu0 = (input: any): any => (() => {
|
|
341
|
+
if ("milkio@ping" === input.type)
|
|
342
|
+
return _po0(input);
|
|
343
|
+
else if ("milkio@logger" === input.type)
|
|
344
|
+
return _po1(input);
|
|
288
345
|
else if ("milkio@template" === input.type)
|
|
289
|
-
return
|
|
346
|
+
return _po2(input);
|
|
347
|
+
else if ("workers@list" === input.type)
|
|
348
|
+
return _po3(input);
|
|
349
|
+
else if ("workers@get" === input.type)
|
|
350
|
+
return _po4(input);
|
|
290
351
|
else
|
|
291
|
-
|
|
292
|
-
|
|
352
|
+
__typia_transform__throwTypeGuardError._throwTypeGuardError({
|
|
353
|
+
method: "typia.misc.validatePrune",
|
|
354
|
+
expected: "(__type | __type.o1 | __type.o2 | __type.o3 | __type.o4)",
|
|
293
355
|
value: input
|
|
294
356
|
});
|
|
295
|
-
})(); const __is = (input: any): input is CookbookActionParams => "object" === typeof input && null !== input &&
|
|
357
|
+
})(); const __is = (input: any): input is CookbookActionParams => "object" === typeof input && null !== input && _iu0(input); let errors: any; let _report: any; const __validate = (input: any): import("typia").IValidation<CookbookActionParams> => {
|
|
296
358
|
if (false === __is(input)) {
|
|
297
359
|
errors = [];
|
|
298
|
-
|
|
299
|
-
((input: any, _path: string, _exceptionable: boolean = true) => ("object" === typeof input && null !== input ||
|
|
360
|
+
_report = (__typia_transform__validateReport._validateReport as any)(errors);
|
|
361
|
+
((input: any, _path: string, _exceptionable: boolean = true) => ("object" === typeof input && null !== input || _report(true, {
|
|
300
362
|
path: _path + "",
|
|
301
|
-
expected: "(__type | __type.o1)",
|
|
363
|
+
expected: "(__type | __type.o1 | __type.o2 | __type.o3 | __type.o4)",
|
|
302
364
|
value: input
|
|
303
|
-
})) &&
|
|
365
|
+
})) && _vu0(input, _path + "", true) || _report(true, {
|
|
304
366
|
path: _path + "",
|
|
305
|
-
expected: "(__type | __type.o1)",
|
|
367
|
+
expected: "(__type | __type.o1 | __type.o2 | __type.o3 | __type.o4)",
|
|
306
368
|
value: input
|
|
307
369
|
}))(input, "$input", true);
|
|
308
370
|
const success = 0 === errors.length;
|
|
309
|
-
return {
|
|
371
|
+
return success ? {
|
|
372
|
+
success,
|
|
373
|
+
data: input
|
|
374
|
+
} : {
|
|
310
375
|
success,
|
|
311
376
|
errors,
|
|
312
|
-
data:
|
|
377
|
+
data: input
|
|
313
378
|
} as any;
|
|
314
379
|
}
|
|
315
380
|
return {
|
|
316
381
|
success: true,
|
|
317
|
-
errors: [],
|
|
318
382
|
data: input
|
|
319
383
|
} as any;
|
|
320
384
|
}; const __prune = (input: CookbookActionParams): void => {
|
|
321
385
|
if ("object" === typeof input && null !== input)
|
|
322
|
-
|
|
323
|
-
}; return (input: any): typia.IValidation<CookbookActionParams> => {
|
|
386
|
+
_pu0(input);
|
|
387
|
+
}; return (input: any): import("typia").IValidation<CookbookActionParams> => {
|
|
324
388
|
const result = __validate(input);
|
|
325
389
|
if (result.success)
|
|
326
390
|
__prune(input);
|
|
@@ -346,147 +410,150 @@ export async function checkCookbookSubscribeEmits(results: any): Promise<[
|
|
|
346
410
|
CookbookSubscribeEmits
|
|
347
411
|
]> {
|
|
348
412
|
const typia = await import('typia');
|
|
349
|
-
const checkResult = (() => { const
|
|
413
|
+
const checkResult = (() => { const _io0 = (input: any): boolean => "workers@stdout" === input.type && "string" === typeof input.key && "string" === typeof input.chunk; const _io1 = (input: any): boolean => "workers@state" === input.type && "string" === typeof input.key && ("running" === input.state || "stopped" === input.state) && (null === input.code || "running" === input.code || "kill" === input.code || "number" === typeof input.code); const _io2 = (input: any): boolean => "watcher@change" === input.type && ("rename" === input.event || "change" === input.event) && "string" === typeof input.path; const _io3 = (input: any): boolean => "milkio@logger" === input.type && Array.isArray(input.log); const _iu0 = (input: any): any => (() => {
|
|
350
414
|
if ("workers@stdout" === input.type)
|
|
351
|
-
return
|
|
415
|
+
return _io0(input);
|
|
352
416
|
else if ("workers@state" === input.type)
|
|
353
|
-
return
|
|
417
|
+
return _io1(input);
|
|
354
418
|
else if ("watcher@change" === input.type)
|
|
355
|
-
return
|
|
419
|
+
return _io2(input);
|
|
356
420
|
else if ("milkio@logger" === input.type)
|
|
357
|
-
return
|
|
421
|
+
return _io3(input);
|
|
358
422
|
else
|
|
359
423
|
return false;
|
|
360
|
-
})(); const
|
|
424
|
+
})(); const _vo0 = (input: any, _path: string, _exceptionable: boolean = true): boolean => ["workers@stdout" === input.type || _report(_exceptionable, {
|
|
361
425
|
path: _path + ".type",
|
|
362
426
|
expected: "\"workers@stdout\"",
|
|
363
427
|
value: input.type
|
|
364
|
-
}), "string" === typeof input.key ||
|
|
428
|
+
}), "string" === typeof input.key || _report(_exceptionable, {
|
|
365
429
|
path: _path + ".key",
|
|
366
430
|
expected: "string",
|
|
367
431
|
value: input.key
|
|
368
|
-
}), "string" === typeof input.chunk ||
|
|
432
|
+
}), "string" === typeof input.chunk || _report(_exceptionable, {
|
|
369
433
|
path: _path + ".chunk",
|
|
370
434
|
expected: "string",
|
|
371
435
|
value: input.chunk
|
|
372
|
-
})].every((flag: boolean) => flag); const
|
|
436
|
+
})].every((flag: boolean) => flag); const _vo1 = (input: any, _path: string, _exceptionable: boolean = true): boolean => ["workers@state" === input.type || _report(_exceptionable, {
|
|
373
437
|
path: _path + ".type",
|
|
374
438
|
expected: "\"workers@state\"",
|
|
375
439
|
value: input.type
|
|
376
|
-
}), "string" === typeof input.key ||
|
|
440
|
+
}), "string" === typeof input.key || _report(_exceptionable, {
|
|
377
441
|
path: _path + ".key",
|
|
378
442
|
expected: "string",
|
|
379
443
|
value: input.key
|
|
380
|
-
}), "running" === input.state || "stopped" === input.state ||
|
|
444
|
+
}), "running" === input.state || "stopped" === input.state || _report(_exceptionable, {
|
|
381
445
|
path: _path + ".state",
|
|
382
446
|
expected: "(\"running\" | \"stopped\")",
|
|
383
447
|
value: input.state
|
|
384
|
-
}), null === input.code || "running" === input.code || "kill" === input.code || "number" === typeof input.code ||
|
|
448
|
+
}), null === input.code || "running" === input.code || "kill" === input.code || "number" === typeof input.code || _report(_exceptionable, {
|
|
385
449
|
path: _path + ".code",
|
|
386
450
|
expected: "(\"kill\" | \"running\" | null | number)",
|
|
387
451
|
value: input.code
|
|
388
|
-
})].every((flag: boolean) => flag); const
|
|
452
|
+
})].every((flag: boolean) => flag); const _vo2 = (input: any, _path: string, _exceptionable: boolean = true): boolean => ["watcher@change" === input.type || _report(_exceptionable, {
|
|
389
453
|
path: _path + ".type",
|
|
390
454
|
expected: "\"watcher@change\"",
|
|
391
455
|
value: input.type
|
|
392
|
-
}), "rename" === input.event || "change" === input.event ||
|
|
456
|
+
}), "rename" === input.event || "change" === input.event || _report(_exceptionable, {
|
|
393
457
|
path: _path + ".event",
|
|
394
458
|
expected: "(\"change\" | \"rename\")",
|
|
395
459
|
value: input.event
|
|
396
|
-
}), "string" === typeof input.path ||
|
|
460
|
+
}), "string" === typeof input.path || _report(_exceptionable, {
|
|
397
461
|
path: _path + ".path",
|
|
398
462
|
expected: "string",
|
|
399
463
|
value: input.path
|
|
400
|
-
})].every((flag: boolean) => flag); const
|
|
464
|
+
})].every((flag: boolean) => flag); const _vo3 = (input: any, _path: string, _exceptionable: boolean = true): boolean => ["milkio@logger" === input.type || _report(_exceptionable, {
|
|
401
465
|
path: _path + ".type",
|
|
402
466
|
expected: "\"milkio@logger\"",
|
|
403
467
|
value: input.type
|
|
404
|
-
}), Array.isArray(input.log) ||
|
|
468
|
+
}), Array.isArray(input.log) || _report(_exceptionable, {
|
|
405
469
|
path: _path + ".log",
|
|
406
470
|
expected: "Array<any>",
|
|
407
471
|
value: input.log
|
|
408
|
-
})].every((flag: boolean) => flag); const
|
|
472
|
+
})].every((flag: boolean) => flag); const _vu0 = (input: any, _path: string, _exceptionable: boolean = true): any => (() => {
|
|
409
473
|
if ("workers@stdout" === input.type)
|
|
410
|
-
return
|
|
474
|
+
return _vo0(input, _path, true && _exceptionable);
|
|
411
475
|
else if ("workers@state" === input.type)
|
|
412
|
-
return
|
|
476
|
+
return _vo1(input, _path, true && _exceptionable);
|
|
413
477
|
else if ("watcher@change" === input.type)
|
|
414
|
-
return
|
|
478
|
+
return _vo2(input, _path, true && _exceptionable);
|
|
415
479
|
else if ("milkio@logger" === input.type)
|
|
416
|
-
return
|
|
480
|
+
return _vo3(input, _path, true && _exceptionable);
|
|
417
481
|
else
|
|
418
|
-
return
|
|
482
|
+
return _report(_exceptionable, {
|
|
419
483
|
path: _path,
|
|
420
484
|
expected: "(__type | __type.o1 | __type.o2 | __type.o3)",
|
|
421
485
|
value: input
|
|
422
486
|
});
|
|
423
|
-
})(); const
|
|
487
|
+
})(); const _po0 = (input: any): any => {
|
|
424
488
|
for (const key of Object.keys(input)) {
|
|
425
489
|
if ("type" === key || "key" === key || "chunk" === key)
|
|
426
490
|
continue;
|
|
427
491
|
delete input[key];
|
|
428
492
|
}
|
|
429
|
-
}; const
|
|
493
|
+
}; const _po1 = (input: any): any => {
|
|
430
494
|
for (const key of Object.keys(input)) {
|
|
431
495
|
if ("type" === key || "key" === key || "state" === key || "code" === key)
|
|
432
496
|
continue;
|
|
433
497
|
delete input[key];
|
|
434
498
|
}
|
|
435
|
-
}; const
|
|
499
|
+
}; const _po2 = (input: any): any => {
|
|
436
500
|
for (const key of Object.keys(input)) {
|
|
437
501
|
if ("type" === key || "event" === key || "path" === key)
|
|
438
502
|
continue;
|
|
439
503
|
delete input[key];
|
|
440
504
|
}
|
|
441
|
-
}; const
|
|
505
|
+
}; const _po3 = (input: any): any => {
|
|
442
506
|
for (const key of Object.keys(input)) {
|
|
443
507
|
if ("type" === key || "log" === key)
|
|
444
508
|
continue;
|
|
445
509
|
delete input[key];
|
|
446
510
|
}
|
|
447
|
-
}; const
|
|
511
|
+
}; const _pu0 = (input: any): any => (() => {
|
|
448
512
|
if ("workers@stdout" === input.type)
|
|
449
|
-
return
|
|
513
|
+
return _po0(input);
|
|
450
514
|
else if ("workers@state" === input.type)
|
|
451
|
-
return
|
|
515
|
+
return _po1(input);
|
|
452
516
|
else if ("watcher@change" === input.type)
|
|
453
|
-
return
|
|
517
|
+
return _po2(input);
|
|
454
518
|
else if ("milkio@logger" === input.type)
|
|
455
|
-
return
|
|
519
|
+
return _po3(input);
|
|
456
520
|
else
|
|
457
|
-
|
|
521
|
+
__typia_transform__throwTypeGuardError._throwTypeGuardError({
|
|
522
|
+
method: "typia.misc.validatePrune",
|
|
458
523
|
expected: "(__type | __type.o1 | __type.o2 | __type.o3)",
|
|
459
524
|
value: input
|
|
460
525
|
});
|
|
461
|
-
})(); const __is = (input: any): input is CookbookSubscribeEmits => "object" === typeof input && null !== input &&
|
|
526
|
+
})(); const __is = (input: any): input is CookbookSubscribeEmits => "object" === typeof input && null !== input && _iu0(input); let errors: any; let _report: any; const __validate = (input: any): import("typia").IValidation<CookbookSubscribeEmits> => {
|
|
462
527
|
if (false === __is(input)) {
|
|
463
528
|
errors = [];
|
|
464
|
-
|
|
465
|
-
((input: any, _path: string, _exceptionable: boolean = true) => ("object" === typeof input && null !== input ||
|
|
529
|
+
_report = (__typia_transform__validateReport._validateReport as any)(errors);
|
|
530
|
+
((input: any, _path: string, _exceptionable: boolean = true) => ("object" === typeof input && null !== input || _report(true, {
|
|
466
531
|
path: _path + "",
|
|
467
532
|
expected: "(__type | __type.o1 | __type.o2 | __type.o3)",
|
|
468
533
|
value: input
|
|
469
|
-
})) &&
|
|
534
|
+
})) && _vu0(input, _path + "", true) || _report(true, {
|
|
470
535
|
path: _path + "",
|
|
471
536
|
expected: "(__type | __type.o1 | __type.o2 | __type.o3)",
|
|
472
537
|
value: input
|
|
473
538
|
}))(input, "$input", true);
|
|
474
539
|
const success = 0 === errors.length;
|
|
475
|
-
return {
|
|
540
|
+
return success ? {
|
|
541
|
+
success,
|
|
542
|
+
data: input
|
|
543
|
+
} : {
|
|
476
544
|
success,
|
|
477
545
|
errors,
|
|
478
|
-
data:
|
|
546
|
+
data: input
|
|
479
547
|
} as any;
|
|
480
548
|
}
|
|
481
549
|
return {
|
|
482
550
|
success: true,
|
|
483
|
-
errors: [],
|
|
484
551
|
data: input
|
|
485
552
|
} as any;
|
|
486
553
|
}; const __prune = (input: CookbookSubscribeEmits): void => {
|
|
487
554
|
if ("object" === typeof input && null !== input)
|
|
488
|
-
|
|
489
|
-
}; return (input: any): typia.IValidation<CookbookSubscribeEmits> => {
|
|
555
|
+
_pu0(input);
|
|
556
|
+
}; return (input: any): import("typia").IValidation<CookbookSubscribeEmits> => {
|
|
490
557
|
const result = __validate(input);
|
|
491
558
|
if (result.success)
|
|
492
559
|
__prune(input);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The content of this file is automatically generated by Typia.
|
|
3
|
-
* It can be edited in the /packages/cookbook-dto/src/* file, and each time you run bun run dev, the generated file will be synced to another location based on the content of the /develop.ts.
|
|
4
|
-
*/
|
|
2
|
+
* The content of this file is automatically generated by Typia.
|
|
3
|
+
* It can be edited in the /packages/cookbook-dto/src/* file, and each time you run bun run dev, the generated file will be synced to another location based on the content of the /develop.ts.
|
|
4
|
+
*/
|
|
5
5
|
|
|
6
6
|
export interface CookbookOptions {
|
|
7
7
|
projects: Record<string, {
|
|
@@ -21,6 +21,8 @@ export interface CookbookOptions {
|
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
23
|
export type CookbookActionParams = {
|
|
24
|
+
type: 'milkio@ping';
|
|
25
|
+
} | {
|
|
24
26
|
type: 'milkio@logger';
|
|
25
27
|
log: Array<any>;
|
|
26
28
|
} | {
|
|
@@ -28,6 +30,12 @@ export type CookbookActionParams = {
|
|
|
28
30
|
name: string;
|
|
29
31
|
fsPath: string;
|
|
30
32
|
template: string;
|
|
33
|
+
} | {
|
|
34
|
+
type: 'workers@list';
|
|
35
|
+
} | {
|
|
36
|
+
type: 'workers@get';
|
|
37
|
+
key: string;
|
|
38
|
+
index: number;
|
|
31
39
|
};
|
|
32
40
|
export type CookbookSubscribeEmits = {
|
|
33
41
|
type: 'workers@stdout';
|