lhcb-ntuple-wizard 2.0.2 → 2.0.3
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/dist/components/DttNameInput.d.ts +2 -2
- package/dist/components/DttNameInput.js +3 -2
- package/dist/components/RequestRow.d.ts +2 -2
- package/dist/components/RequestRow.js +2 -2
- package/dist/components/modals/UploadDttConfigModal.js +6 -17
- package/dist/models/yamlFile.d.ts +14 -0
- package/dist/models/yamlFile.js +15 -14
- package/dist/pages/RequestPage.d.ts +10 -0
- package/dist/pages/RequestPage.js +27 -31
- package/dist/utils/utils.d.ts +7 -11
- package/dist/utils/utils.js +474 -476
- package/package.json +1 -1
- package/dist/models/blobFile.d.ts +0 -12
- package/dist/models/blobFile.js +0 -1
package/dist/utils/utils.js
CHANGED
|
@@ -23,518 +23,509 @@ const parseInput = (decay, input) => {
|
|
|
23
23
|
versions: decay.lines[`${stream}/${line}`],
|
|
24
24
|
};
|
|
25
25
|
};
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
emails.push(defaults.inform[0]);
|
|
30
|
-
}
|
|
31
|
-
rows.forEach((row) => {
|
|
32
|
-
if (!row.dtt?.config.name)
|
|
33
|
-
return;
|
|
34
|
-
const dttName = row.dtt.config.name.split("/")[1];
|
|
35
|
-
Object.entries(config).forEach(([key, jobConfig]) => {
|
|
36
|
-
if (key === "defaults")
|
|
37
|
-
return;
|
|
38
|
-
const job = jobConfig;
|
|
39
|
-
if (!job.options)
|
|
40
|
-
return;
|
|
41
|
-
if (job.options.some((opt) => opt.split(".")[0] === dttName)) {
|
|
42
|
-
row.paths.push(job.input.bk_query);
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
});
|
|
46
|
-
};
|
|
47
|
-
/**
|
|
48
|
-
* Parses a set of production configuration files to DttConfigs and returns the corresponding rows and emails.
|
|
49
|
-
* @param files The files to parse
|
|
50
|
-
* @param metadata The metadata to use for parsing
|
|
51
|
-
* @returns The parsed rows and emails
|
|
52
|
-
*/
|
|
53
|
-
export const parseProductionFiles = async (files, metadata) => {
|
|
54
|
-
const rows = [];
|
|
55
|
-
const emails = [];
|
|
56
|
-
const errors = {};
|
|
57
|
-
const warnings = {};
|
|
58
|
-
const sorted = [...files].sort((a, b) => (a.name === "info.yaml" ? 1 : b.name === "info.yaml" ? -1 : 0));
|
|
59
|
-
for (let i = 0; i < sorted.length; i++) {
|
|
60
|
-
const file = sorted[i];
|
|
61
|
-
const blob = file.blob ?? file;
|
|
62
|
-
const text = await blob.text();
|
|
63
|
-
let rawConfig;
|
|
64
|
-
try {
|
|
65
|
-
rawConfig = yaml.load(text, { schema: yaml.JSON_SCHEMA });
|
|
66
|
-
}
|
|
67
|
-
catch (e) {
|
|
68
|
-
console.error(`YAML file '${file.name}' is invalid:`, e);
|
|
69
|
-
errors[file.name] = "YAML file is invalid";
|
|
26
|
+
const addBkPathsToRows = (infoYaml, rows) => {
|
|
27
|
+
for (const row of rows) {
|
|
28
|
+
if (!row.dtt?.config.name) {
|
|
70
29
|
continue;
|
|
71
30
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
return true;
|
|
77
|
-
return "object" === typeof value && null !== value && _iu0(value);
|
|
78
|
-
}); const _io1 = input => "string" === typeof input.application && "string" === typeof input.wg && (Array.isArray(input.inform) && input.inform.every(elem => "string" === typeof elem)) && "boolean" === typeof input.automatically_configure && "string" === typeof input.output; const _io2 = input => Array.isArray(input.options) && input.options.every(elem => "string" === typeof elem) && ("object" === typeof input.input && null !== input.input && _io3(input.input)) && (undefined === input.root_in_tes || "string" === typeof input.root_in_tes); const _io3 = input => "string" === typeof input.bk_query; const _iu0 = input => (() => {
|
|
79
|
-
if (undefined !== input.application)
|
|
80
|
-
return _io1(input);
|
|
81
|
-
else if (undefined !== input.options)
|
|
82
|
-
return _io2(input);
|
|
83
|
-
else
|
|
84
|
-
return false;
|
|
85
|
-
})(); const _vo0 = (input, _path, _exceptionable = true) => [false === _exceptionable || Object.keys(input).map(key => {
|
|
86
|
-
const value = input[key];
|
|
87
|
-
if (undefined === value)
|
|
88
|
-
return true;
|
|
89
|
-
return ("object" === typeof value && null !== value || _report(_exceptionable, {
|
|
90
|
-
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
91
|
-
expected: "(BlobFileDefaults | JobConfig)",
|
|
92
|
-
value: value
|
|
93
|
-
})) && _vu0(value, _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key), true && _exceptionable) || _report(_exceptionable, {
|
|
94
|
-
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
95
|
-
expected: "(BlobFileDefaults | JobConfig)",
|
|
96
|
-
value: value
|
|
97
|
-
});
|
|
98
|
-
}).every(flag => flag)].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => ["string" === typeof input.application || _report(_exceptionable, {
|
|
99
|
-
path: _path + ".application",
|
|
100
|
-
expected: "string",
|
|
101
|
-
value: input.application
|
|
102
|
-
}), "string" === typeof input.wg || _report(_exceptionable, {
|
|
103
|
-
path: _path + ".wg",
|
|
104
|
-
expected: "string",
|
|
105
|
-
value: input.wg
|
|
106
|
-
}), (Array.isArray(input.inform) || _report(_exceptionable, {
|
|
107
|
-
path: _path + ".inform",
|
|
108
|
-
expected: "Array<string>",
|
|
109
|
-
value: input.inform
|
|
110
|
-
})) && input.inform.map((elem, _index3) => "string" === typeof elem || _report(_exceptionable, {
|
|
111
|
-
path: _path + ".inform[" + _index3 + "]",
|
|
112
|
-
expected: "string",
|
|
113
|
-
value: elem
|
|
114
|
-
})).every(flag => flag) || _report(_exceptionable, {
|
|
115
|
-
path: _path + ".inform",
|
|
116
|
-
expected: "Array<string>",
|
|
117
|
-
value: input.inform
|
|
118
|
-
}), "boolean" === typeof input.automatically_configure || _report(_exceptionable, {
|
|
119
|
-
path: _path + ".automatically_configure",
|
|
120
|
-
expected: "boolean",
|
|
121
|
-
value: input.automatically_configure
|
|
122
|
-
}), "string" === typeof input.output || _report(_exceptionable, {
|
|
123
|
-
path: _path + ".output",
|
|
124
|
-
expected: "string",
|
|
125
|
-
value: input.output
|
|
126
|
-
})].every(flag => flag); const _vo2 = (input, _path, _exceptionable = true) => [(Array.isArray(input.options) || _report(_exceptionable, {
|
|
127
|
-
path: _path + ".options",
|
|
128
|
-
expected: "Array<string>",
|
|
129
|
-
value: input.options
|
|
130
|
-
})) && input.options.map((elem, _index4) => "string" === typeof elem || _report(_exceptionable, {
|
|
131
|
-
path: _path + ".options[" + _index4 + "]",
|
|
132
|
-
expected: "string",
|
|
133
|
-
value: elem
|
|
134
|
-
})).every(flag => flag) || _report(_exceptionable, {
|
|
135
|
-
path: _path + ".options",
|
|
136
|
-
expected: "Array<string>",
|
|
137
|
-
value: input.options
|
|
138
|
-
}), ("object" === typeof input.input && null !== input.input || _report(_exceptionable, {
|
|
139
|
-
path: _path + ".input",
|
|
140
|
-
expected: "__type",
|
|
141
|
-
value: input.input
|
|
142
|
-
})) && _vo3(input.input, _path + ".input", true && _exceptionable) || _report(_exceptionable, {
|
|
143
|
-
path: _path + ".input",
|
|
144
|
-
expected: "__type",
|
|
145
|
-
value: input.input
|
|
146
|
-
}), undefined === input.root_in_tes || "string" === typeof input.root_in_tes || _report(_exceptionable, {
|
|
147
|
-
path: _path + ".root_in_tes",
|
|
148
|
-
expected: "(string | undefined)",
|
|
149
|
-
value: input.root_in_tes
|
|
150
|
-
})].every(flag => flag); const _vo3 = (input, _path, _exceptionable = true) => ["string" === typeof input.bk_query || _report(_exceptionable, {
|
|
151
|
-
path: _path + ".bk_query",
|
|
152
|
-
expected: "string",
|
|
153
|
-
value: input.bk_query
|
|
154
|
-
})].every(flag => flag); const _vu0 = (input, _path, _exceptionable = true) => (() => {
|
|
155
|
-
if (undefined !== input.application)
|
|
156
|
-
return _vo1(input, _path, true && _exceptionable);
|
|
157
|
-
else if (undefined !== input.options)
|
|
158
|
-
return _vo2(input, _path, true && _exceptionable);
|
|
159
|
-
else
|
|
160
|
-
return _report(_exceptionable, {
|
|
161
|
-
path: _path,
|
|
162
|
-
expected: "(BlobFileDefaults | JobConfig)",
|
|
163
|
-
value: input
|
|
164
|
-
});
|
|
165
|
-
})(); const __is = input => "object" === typeof input && null !== input && false === Array.isArray(input) && _io0(input); let errors; let _report; return input => {
|
|
166
|
-
if (false === __is(input)) {
|
|
167
|
-
errors = [];
|
|
168
|
-
_report = __typia_transform__validateReport._validateReport(errors);
|
|
169
|
-
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || _report(true, {
|
|
170
|
-
path: _path + "",
|
|
171
|
-
expected: "InfoYamlType",
|
|
172
|
-
value: input
|
|
173
|
-
})) && _vo0(input, _path + "", true) || _report(true, {
|
|
174
|
-
path: _path + "",
|
|
175
|
-
expected: "InfoYamlType",
|
|
176
|
-
value: input
|
|
177
|
-
}))(input, "$input", true);
|
|
178
|
-
const success = 0 === errors.length;
|
|
179
|
-
return success ? {
|
|
180
|
-
success,
|
|
181
|
-
data: input
|
|
182
|
-
} : {
|
|
183
|
-
success,
|
|
184
|
-
errors,
|
|
185
|
-
data: input
|
|
186
|
-
};
|
|
187
|
-
}
|
|
188
|
-
return {
|
|
189
|
-
success: true,
|
|
190
|
-
data: input
|
|
191
|
-
};
|
|
192
|
-
}; })()(rawConfig);
|
|
193
|
-
if (validationResult.success) {
|
|
194
|
-
applyInfoYaml(validationResult.data, rows, emails);
|
|
31
|
+
const dttName = row.dtt.config.name.split("/")[1];
|
|
32
|
+
for (const [key, jobConfig] of Object.entries(infoYaml)) {
|
|
33
|
+
if (key === "defaults") {
|
|
34
|
+
continue;
|
|
195
35
|
}
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
errors[file.name] =
|
|
200
|
-
`Invalid info.yaml config at: ${validationResult.errors.map((e) => e.path).join(", ")}`;
|
|
36
|
+
const job = jobConfig;
|
|
37
|
+
if (job.options.some((option) => option.split(".")[0] === dttName)) {
|
|
38
|
+
row.paths.push(job.input.bk_query);
|
|
201
39
|
}
|
|
202
|
-
continue;
|
|
203
40
|
}
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
return
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
async function parseYamlFile(file) {
|
|
44
|
+
const text = await file.text();
|
|
45
|
+
try {
|
|
46
|
+
return yaml.load(text, { schema: yaml.JSON_SCHEMA });
|
|
47
|
+
}
|
|
48
|
+
catch (e) {
|
|
49
|
+
console.error(`YAML file '${file.name}' is invalid:`, e);
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
async function parseInfoYamlFile(file) {
|
|
54
|
+
const rawConfig = await parseYamlFile(file);
|
|
55
|
+
if (!rawConfig) {
|
|
56
|
+
return "'info.yaml' is not a valid yaml file";
|
|
57
|
+
}
|
|
58
|
+
const validationResult = (() => { const _io0 = input => "object" === typeof input.defaults && null !== input.defaults && _io1(input.defaults) && Object.keys(input).every(key => {
|
|
59
|
+
if (["defaults"].some(prop => key === prop))
|
|
60
|
+
return true;
|
|
61
|
+
const value = input[key];
|
|
62
|
+
if (undefined === value)
|
|
63
|
+
return true;
|
|
64
|
+
return undefined === value || "object" === typeof value && null !== value && _io2(value);
|
|
65
|
+
}); const _io1 = input => "string" === typeof input.application && "string" === typeof input.wg && (Array.isArray(input.inform) && input.inform.every(elem => "string" === typeof elem)) && "boolean" === typeof input.automatically_configure && "string" === typeof input.output; const _io2 = input => Array.isArray(input.options) && input.options.every(elem => "string" === typeof elem) && ("object" === typeof input.input && null !== input.input && _io3(input.input)) && (undefined === input.root_in_tes || "string" === typeof input.root_in_tes); const _io3 = input => "string" === typeof input.bk_query; const _vo0 = (input, _path, _exceptionable = true) => [("object" === typeof input.defaults && null !== input.defaults || _report(_exceptionable, {
|
|
66
|
+
path: _path + ".defaults",
|
|
67
|
+
expected: "InfoYamlDefaults",
|
|
68
|
+
value: input.defaults
|
|
69
|
+
})) && _vo1(input.defaults, _path + ".defaults", true && _exceptionable) || _report(_exceptionable, {
|
|
70
|
+
path: _path + ".defaults",
|
|
71
|
+
expected: "InfoYamlDefaults",
|
|
72
|
+
value: input.defaults
|
|
73
|
+
}), false === _exceptionable || Object.keys(input).map(key => {
|
|
74
|
+
if (["defaults"].some(prop => key === prop))
|
|
231
75
|
return true;
|
|
232
|
-
const arrayPredicators = [
|
|
233
|
-
[
|
|
234
|
-
top => "string" === typeof top,
|
|
235
|
-
entire => entire.map((elem, _index16) => "string" === typeof elem || _report(_exceptionable, {
|
|
236
|
-
path: _path + "[" + _index16 + "]",
|
|
237
|
-
expected: "string",
|
|
238
|
-
value: elem
|
|
239
|
-
})).every(flag => flag)
|
|
240
|
-
],
|
|
241
|
-
[
|
|
242
|
-
top => "number" === typeof top,
|
|
243
|
-
entire => entire.map((elem, _index17) => "number" === typeof elem || _report(_exceptionable, {
|
|
244
|
-
path: _path + "[" + _index17 + "]",
|
|
245
|
-
expected: "number",
|
|
246
|
-
value: elem
|
|
247
|
-
})).every(flag => flag)
|
|
248
|
-
]
|
|
249
|
-
];
|
|
250
|
-
const passed = arrayPredicators.filter(pred => pred[0](top));
|
|
251
|
-
if (1 === passed.length)
|
|
252
|
-
return passed[0][1](array);
|
|
253
|
-
else if (1 < passed.length)
|
|
254
|
-
for (const pred of passed)
|
|
255
|
-
if (array.every(value => true === pred[0](value)))
|
|
256
|
-
return pred[1](array);
|
|
257
|
-
return _report(_exceptionable, {
|
|
258
|
-
path: _path,
|
|
259
|
-
expected: "(Array<string> | Array<number>)",
|
|
260
|
-
value: input
|
|
261
|
-
});
|
|
262
|
-
}; const _io0 = input => "object" === typeof input.branches && null !== input.branches && false === Array.isArray(input.branches) && _io1(input.branches) && (undefined === input.descriptorTemplate || "string" === typeof input.descriptorTemplate) && ("object" === typeof input.groups && null !== input.groups && false === Array.isArray(input.groups) && _io7(input.groups)) && (undefined === input.inputs || Array.isArray(input.inputs) && input.inputs.every(elem => "string" === typeof elem)) && (undefined === input.name || "string" === typeof input.name) && (Array.isArray(input.tools) && input.tools.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && _io3(elem))); const _io1 = input => Object.keys(input).every(key => {
|
|
263
76
|
const value = input[key];
|
|
264
77
|
if (undefined === value)
|
|
265
78
|
return true;
|
|
266
|
-
return "object" === typeof value && null !== value
|
|
267
|
-
|
|
79
|
+
return undefined === value || ("object" === typeof value && null !== value || _report(_exceptionable, {
|
|
80
|
+
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
81
|
+
expected: "(JobConfig | undefined)",
|
|
82
|
+
value: value
|
|
83
|
+
})) && _vo2(value, _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key), true && _exceptionable) || _report(_exceptionable, {
|
|
84
|
+
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
85
|
+
expected: "(JobConfig | undefined)",
|
|
86
|
+
value: value
|
|
87
|
+
});
|
|
88
|
+
}).every(flag => flag)].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => ["string" === typeof input.application || _report(_exceptionable, {
|
|
89
|
+
path: _path + ".application",
|
|
90
|
+
expected: "string",
|
|
91
|
+
value: input.application
|
|
92
|
+
}), "string" === typeof input.wg || _report(_exceptionable, {
|
|
93
|
+
path: _path + ".wg",
|
|
94
|
+
expected: "string",
|
|
95
|
+
value: input.wg
|
|
96
|
+
}), (Array.isArray(input.inform) || _report(_exceptionable, {
|
|
97
|
+
path: _path + ".inform",
|
|
98
|
+
expected: "Array<string>",
|
|
99
|
+
value: input.inform
|
|
100
|
+
})) && input.inform.map((elem, _index3) => "string" === typeof elem || _report(_exceptionable, {
|
|
101
|
+
path: _path + ".inform[" + _index3 + "]",
|
|
102
|
+
expected: "string",
|
|
103
|
+
value: elem
|
|
104
|
+
})).every(flag => flag) || _report(_exceptionable, {
|
|
105
|
+
path: _path + ".inform",
|
|
106
|
+
expected: "Array<string>",
|
|
107
|
+
value: input.inform
|
|
108
|
+
}), "boolean" === typeof input.automatically_configure || _report(_exceptionable, {
|
|
109
|
+
path: _path + ".automatically_configure",
|
|
110
|
+
expected: "boolean",
|
|
111
|
+
value: input.automatically_configure
|
|
112
|
+
}), "string" === typeof input.output || _report(_exceptionable, {
|
|
113
|
+
path: _path + ".output",
|
|
114
|
+
expected: "string",
|
|
115
|
+
value: input.output
|
|
116
|
+
})].every(flag => flag); const _vo2 = (input, _path, _exceptionable = true) => [(Array.isArray(input.options) || _report(_exceptionable, {
|
|
117
|
+
path: _path + ".options",
|
|
118
|
+
expected: "Array<string>",
|
|
119
|
+
value: input.options
|
|
120
|
+
})) && input.options.map((elem, _index4) => "string" === typeof elem || _report(_exceptionable, {
|
|
121
|
+
path: _path + ".options[" + _index4 + "]",
|
|
122
|
+
expected: "string",
|
|
123
|
+
value: elem
|
|
124
|
+
})).every(flag => flag) || _report(_exceptionable, {
|
|
125
|
+
path: _path + ".options",
|
|
126
|
+
expected: "Array<string>",
|
|
127
|
+
value: input.options
|
|
128
|
+
}), ("object" === typeof input.input && null !== input.input || _report(_exceptionable, {
|
|
129
|
+
path: _path + ".input",
|
|
130
|
+
expected: "__type",
|
|
131
|
+
value: input.input
|
|
132
|
+
})) && _vo3(input.input, _path + ".input", true && _exceptionable) || _report(_exceptionable, {
|
|
133
|
+
path: _path + ".input",
|
|
134
|
+
expected: "__type",
|
|
135
|
+
value: input.input
|
|
136
|
+
}), undefined === input.root_in_tes || "string" === typeof input.root_in_tes || _report(_exceptionable, {
|
|
137
|
+
path: _path + ".root_in_tes",
|
|
138
|
+
expected: "(string | undefined)",
|
|
139
|
+
value: input.root_in_tes
|
|
140
|
+
})].every(flag => flag); const _vo3 = (input, _path, _exceptionable = true) => ["string" === typeof input.bk_query || _report(_exceptionable, {
|
|
141
|
+
path: _path + ".bk_query",
|
|
142
|
+
expected: "string",
|
|
143
|
+
value: input.bk_query
|
|
144
|
+
})].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
|
|
145
|
+
if (false === __is(input)) {
|
|
146
|
+
errors = [];
|
|
147
|
+
_report = __typia_transform__validateReport._validateReport(errors);
|
|
148
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
|
|
149
|
+
path: _path + "",
|
|
150
|
+
expected: "InfoYaml",
|
|
151
|
+
value: input
|
|
152
|
+
})) && _vo0(input, _path + "", true) || _report(true, {
|
|
153
|
+
path: _path + "",
|
|
154
|
+
expected: "InfoYaml",
|
|
155
|
+
value: input
|
|
156
|
+
}))(input, "$input", true);
|
|
157
|
+
const success = 0 === errors.length;
|
|
158
|
+
return success ? {
|
|
159
|
+
success,
|
|
160
|
+
data: input
|
|
161
|
+
} : {
|
|
162
|
+
success,
|
|
163
|
+
errors,
|
|
164
|
+
data: input
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
return {
|
|
168
|
+
success: true,
|
|
169
|
+
data: input
|
|
170
|
+
};
|
|
171
|
+
}; })()(rawConfig);
|
|
172
|
+
if (!validationResult.success) {
|
|
173
|
+
return "'info.yaml' does not have the expected structure";
|
|
174
|
+
}
|
|
175
|
+
return validationResult.data;
|
|
176
|
+
}
|
|
177
|
+
async function parseDttConfigFile(file) {
|
|
178
|
+
const rawConfig = await parseYamlFile(file);
|
|
179
|
+
if (!rawConfig) {
|
|
180
|
+
return `'${file.name}' is not a valid yaml file`;
|
|
181
|
+
}
|
|
182
|
+
const validationResult = (() => { const _ip0 = input => {
|
|
183
|
+
const array = input;
|
|
184
|
+
const top = input[0];
|
|
185
|
+
if (0 === input.length)
|
|
186
|
+
return true;
|
|
187
|
+
const arrayPredicators = [
|
|
188
|
+
[
|
|
189
|
+
top => "string" === typeof top,
|
|
190
|
+
entire => entire.every(elem => "string" === typeof elem)
|
|
191
|
+
],
|
|
192
|
+
[
|
|
193
|
+
top => "number" === typeof top,
|
|
194
|
+
entire => entire.every(elem => "number" === typeof elem)
|
|
195
|
+
]
|
|
196
|
+
];
|
|
197
|
+
const passed = arrayPredicators.filter(pred => pred[0](top));
|
|
198
|
+
if (1 === passed.length)
|
|
199
|
+
return passed[0][1](array);
|
|
200
|
+
else if (1 < passed.length)
|
|
201
|
+
for (const pred of passed)
|
|
202
|
+
if (array.every(value => true === pred[0](value)))
|
|
203
|
+
return pred[1](array);
|
|
204
|
+
return false;
|
|
205
|
+
}; const _vp1 = (input, _path, _exceptionable = true) => {
|
|
206
|
+
const array = input;
|
|
207
|
+
const top = input[0];
|
|
208
|
+
if (0 === input.length)
|
|
209
|
+
return true;
|
|
210
|
+
const arrayPredicators = [
|
|
211
|
+
[
|
|
212
|
+
top => "string" === typeof top,
|
|
213
|
+
entire => entire.map((elem, _index16) => "string" === typeof elem || _report(_exceptionable, {
|
|
214
|
+
path: _path + "[" + _index16 + "]",
|
|
215
|
+
expected: "string",
|
|
216
|
+
value: elem
|
|
217
|
+
})).every(flag => flag)
|
|
218
|
+
],
|
|
219
|
+
[
|
|
220
|
+
top => "number" === typeof top,
|
|
221
|
+
entire => entire.map((elem, _index17) => "number" === typeof elem || _report(_exceptionable, {
|
|
222
|
+
path: _path + "[" + _index17 + "]",
|
|
223
|
+
expected: "number",
|
|
224
|
+
value: elem
|
|
225
|
+
})).every(flag => flag)
|
|
226
|
+
]
|
|
227
|
+
];
|
|
228
|
+
const passed = arrayPredicators.filter(pred => pred[0](top));
|
|
229
|
+
if (1 === passed.length)
|
|
230
|
+
return passed[0][1](array);
|
|
231
|
+
else if (1 < passed.length)
|
|
232
|
+
for (const pred of passed)
|
|
233
|
+
if (array.every(value => true === pred[0](value)))
|
|
234
|
+
return pred[1](array);
|
|
235
|
+
return _report(_exceptionable, {
|
|
236
|
+
path: _path,
|
|
237
|
+
expected: "(Array<string> | Array<number>)",
|
|
238
|
+
value: input
|
|
239
|
+
});
|
|
240
|
+
}; const _io0 = input => "object" === typeof input.branches && null !== input.branches && false === Array.isArray(input.branches) && _io1(input.branches) && (undefined === input.descriptorTemplate || "string" === typeof input.descriptorTemplate) && ("object" === typeof input.groups && null !== input.groups && false === Array.isArray(input.groups) && _io7(input.groups)) && (undefined === input.inputs || Array.isArray(input.inputs) && input.inputs.every(elem => "string" === typeof elem)) && (undefined === input.name || "string" === typeof input.name) && (Array.isArray(input.tools) && input.tools.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && _io3(elem))); const _io1 = input => Object.keys(input).every(key => {
|
|
241
|
+
const value = input[key];
|
|
242
|
+
if (undefined === value)
|
|
243
|
+
return true;
|
|
244
|
+
return "object" === typeof value && null !== value && _io2(value);
|
|
245
|
+
}); const _io2 = input => "string" === typeof input.particle && (Array.isArray(input.tools) && input.tools.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && _io3(elem))); const _io3 = input => Object.keys(input).every(key => {
|
|
246
|
+
const value = input[key];
|
|
247
|
+
if (undefined === value)
|
|
248
|
+
return true;
|
|
249
|
+
return "object" === typeof value && null !== value && false === Array.isArray(value) && _io4(value);
|
|
250
|
+
}); const _io4 = input => Object.keys(input).every(key => {
|
|
251
|
+
const value = input[key];
|
|
252
|
+
if (undefined === value)
|
|
253
|
+
return true;
|
|
254
|
+
return null !== value && undefined !== value && ("string" === typeof value || "number" === typeof value || "boolean" === typeof value || (Array.isArray(value) && (_ip0(value) || false) || "object" === typeof value && null !== value && false === Array.isArray(value) && _iu0(value)));
|
|
255
|
+
}); const _io5 = input => Object.keys(input).every(key => {
|
|
256
|
+
const value = input[key];
|
|
257
|
+
if (undefined === value)
|
|
258
|
+
return true;
|
|
259
|
+
return "string" === typeof value;
|
|
260
|
+
}); const _io6 = input => Object.keys(input).every(key => {
|
|
261
|
+
const value = input[key];
|
|
262
|
+
if (undefined === value)
|
|
263
|
+
return true;
|
|
264
|
+
return Array.isArray(value) && value.every(elem => "string" === typeof elem);
|
|
265
|
+
}); const _io7 = input => Object.keys(input).every(key => {
|
|
266
|
+
const value = input[key];
|
|
267
|
+
if (undefined === value)
|
|
268
|
+
return true;
|
|
269
|
+
return "object" === typeof value && null !== value && _io8(value);
|
|
270
|
+
}); const _io8 = input => Array.isArray(input.particles) && input.particles.every(elem => "string" === typeof elem) && (Array.isArray(input.tools) && input.tools.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && _io3(elem))); const _iu0 = input => (() => {
|
|
271
|
+
if (_io6(input))
|
|
272
|
+
return _io6(input);
|
|
273
|
+
if (_io5(input))
|
|
274
|
+
return _io5(input);
|
|
275
|
+
return false;
|
|
276
|
+
})(); const _vo0 = (input, _path, _exceptionable = true) => [("object" === typeof input.branches && null !== input.branches && false === Array.isArray(input.branches) || _report(_exceptionable, {
|
|
277
|
+
path: _path + ".branches",
|
|
278
|
+
expected: "__type",
|
|
279
|
+
value: input.branches
|
|
280
|
+
})) && _vo1(input.branches, _path + ".branches", true && _exceptionable) || _report(_exceptionable, {
|
|
281
|
+
path: _path + ".branches",
|
|
282
|
+
expected: "__type",
|
|
283
|
+
value: input.branches
|
|
284
|
+
}), undefined === input.descriptorTemplate || "string" === typeof input.descriptorTemplate || _report(_exceptionable, {
|
|
285
|
+
path: _path + ".descriptorTemplate",
|
|
286
|
+
expected: "(string | undefined)",
|
|
287
|
+
value: input.descriptorTemplate
|
|
288
|
+
}), ("object" === typeof input.groups && null !== input.groups && false === Array.isArray(input.groups) || _report(_exceptionable, {
|
|
289
|
+
path: _path + ".groups",
|
|
290
|
+
expected: "__type.o4",
|
|
291
|
+
value: input.groups
|
|
292
|
+
})) && _vo7(input.groups, _path + ".groups", true && _exceptionable) || _report(_exceptionable, {
|
|
293
|
+
path: _path + ".groups",
|
|
294
|
+
expected: "__type.o4",
|
|
295
|
+
value: input.groups
|
|
296
|
+
}), undefined === input.inputs || (Array.isArray(input.inputs) || _report(_exceptionable, {
|
|
297
|
+
path: _path + ".inputs",
|
|
298
|
+
expected: "(Array<string> | undefined)",
|
|
299
|
+
value: input.inputs
|
|
300
|
+
})) && input.inputs.map((elem, _index11) => "string" === typeof elem || _report(_exceptionable, {
|
|
301
|
+
path: _path + ".inputs[" + _index11 + "]",
|
|
302
|
+
expected: "string",
|
|
303
|
+
value: elem
|
|
304
|
+
})).every(flag => flag) || _report(_exceptionable, {
|
|
305
|
+
path: _path + ".inputs",
|
|
306
|
+
expected: "(Array<string> | undefined)",
|
|
307
|
+
value: input.inputs
|
|
308
|
+
}), undefined === input.name || "string" === typeof input.name || _report(_exceptionable, {
|
|
309
|
+
path: _path + ".name",
|
|
310
|
+
expected: "(string | undefined)",
|
|
311
|
+
value: input.name
|
|
312
|
+
}), (Array.isArray(input.tools) || _report(_exceptionable, {
|
|
313
|
+
path: _path + ".tools",
|
|
314
|
+
expected: "Array<SavedToolConfig>",
|
|
315
|
+
value: input.tools
|
|
316
|
+
})) && input.tools.map((elem, _index12) => ("object" === typeof elem && null !== elem && false === Array.isArray(elem) || _report(_exceptionable, {
|
|
317
|
+
path: _path + ".tools[" + _index12 + "]",
|
|
318
|
+
expected: "SavedToolConfig",
|
|
319
|
+
value: elem
|
|
320
|
+
})) && _vo3(elem, _path + ".tools[" + _index12 + "]", true && _exceptionable) || _report(_exceptionable, {
|
|
321
|
+
path: _path + ".tools[" + _index12 + "]",
|
|
322
|
+
expected: "SavedToolConfig",
|
|
323
|
+
value: elem
|
|
324
|
+
})).every(flag => flag) || _report(_exceptionable, {
|
|
325
|
+
path: _path + ".tools",
|
|
326
|
+
expected: "Array<SavedToolConfig>",
|
|
327
|
+
value: input.tools
|
|
328
|
+
})].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => [false === _exceptionable || Object.keys(input).map(key => {
|
|
268
329
|
const value = input[key];
|
|
269
330
|
if (undefined === value)
|
|
270
331
|
return true;
|
|
271
|
-
return "object" === typeof value && null !== value
|
|
272
|
-
|
|
332
|
+
return ("object" === typeof value && null !== value || _report(_exceptionable, {
|
|
333
|
+
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
334
|
+
expected: "SavedBranchConfig",
|
|
335
|
+
value: value
|
|
336
|
+
})) && _vo2(value, _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key), true && _exceptionable) || _report(_exceptionable, {
|
|
337
|
+
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
338
|
+
expected: "SavedBranchConfig",
|
|
339
|
+
value: value
|
|
340
|
+
});
|
|
341
|
+
}).every(flag => flag)].every(flag => flag); const _vo2 = (input, _path, _exceptionable = true) => ["string" === typeof input.particle || _report(_exceptionable, {
|
|
342
|
+
path: _path + ".particle",
|
|
343
|
+
expected: "string",
|
|
344
|
+
value: input.particle
|
|
345
|
+
}), (Array.isArray(input.tools) || _report(_exceptionable, {
|
|
346
|
+
path: _path + ".tools",
|
|
347
|
+
expected: "Array<SavedToolConfig>",
|
|
348
|
+
value: input.tools
|
|
349
|
+
})) && input.tools.map((elem, _index13) => ("object" === typeof elem && null !== elem && false === Array.isArray(elem) || _report(_exceptionable, {
|
|
350
|
+
path: _path + ".tools[" + _index13 + "]",
|
|
351
|
+
expected: "SavedToolConfig",
|
|
352
|
+
value: elem
|
|
353
|
+
})) && _vo3(elem, _path + ".tools[" + _index13 + "]", true && _exceptionable) || _report(_exceptionable, {
|
|
354
|
+
path: _path + ".tools[" + _index13 + "]",
|
|
355
|
+
expected: "SavedToolConfig",
|
|
356
|
+
value: elem
|
|
357
|
+
})).every(flag => flag) || _report(_exceptionable, {
|
|
358
|
+
path: _path + ".tools",
|
|
359
|
+
expected: "Array<SavedToolConfig>",
|
|
360
|
+
value: input.tools
|
|
361
|
+
})].every(flag => flag); const _vo3 = (input, _path, _exceptionable = true) => [false === _exceptionable || Object.keys(input).map(key => {
|
|
273
362
|
const value = input[key];
|
|
274
363
|
if (undefined === value)
|
|
275
364
|
return true;
|
|
276
|
-
return
|
|
277
|
-
|
|
365
|
+
return ("object" === typeof value && null !== value && false === Array.isArray(value) || _report(_exceptionable, {
|
|
366
|
+
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
367
|
+
expected: "__type.o1",
|
|
368
|
+
value: value
|
|
369
|
+
})) && _vo4(value, _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key), true && _exceptionable) || _report(_exceptionable, {
|
|
370
|
+
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
371
|
+
expected: "__type.o1",
|
|
372
|
+
value: value
|
|
373
|
+
});
|
|
374
|
+
}).every(flag => flag)].every(flag => flag); const _vo4 = (input, _path, _exceptionable = true) => [false === _exceptionable || Object.keys(input).map(key => {
|
|
278
375
|
const value = input[key];
|
|
279
376
|
if (undefined === value)
|
|
280
377
|
return true;
|
|
281
|
-
return
|
|
282
|
-
|
|
378
|
+
return (null !== value || _report(_exceptionable, {
|
|
379
|
+
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
380
|
+
expected: "(Array<number> | Array<string> | __type.o2 | __type.o3 | boolean | number | string)",
|
|
381
|
+
value: value
|
|
382
|
+
})) && (undefined !== value || _report(_exceptionable, {
|
|
383
|
+
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
384
|
+
expected: "(Array<number> | Array<string> | __type.o2 | __type.o3 | boolean | number | string)",
|
|
385
|
+
value: value
|
|
386
|
+
})) && ("string" === typeof value || "number" === typeof value || "boolean" === typeof value || (Array.isArray(value) && (_vp1(value, _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key), true && _exceptionable) || _report(_exceptionable, {
|
|
387
|
+
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
388
|
+
expected: "Array<string> | Array<number>",
|
|
389
|
+
value: value
|
|
390
|
+
})) || "object" === typeof value && null !== value && false === Array.isArray(value) && _vu0(value, _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key), true && _exceptionable) || _report(_exceptionable, {
|
|
391
|
+
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
392
|
+
expected: "(Array<number> | Array<string> | __type.o2 | __type.o3 | boolean | number | string)",
|
|
393
|
+
value: value
|
|
394
|
+
})) || _report(_exceptionable, {
|
|
395
|
+
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
396
|
+
expected: "(Array<number> | Array<string> | __type.o2 | __type.o3 | boolean | number | string)",
|
|
397
|
+
value: value
|
|
398
|
+
}));
|
|
399
|
+
}).every(flag => flag)].every(flag => flag); const _vo5 = (input, _path, _exceptionable = true) => [false === _exceptionable || Object.keys(input).map(key => {
|
|
283
400
|
const value = input[key];
|
|
284
401
|
if (undefined === value)
|
|
285
402
|
return true;
|
|
286
|
-
return
|
|
287
|
-
|
|
403
|
+
return "string" === typeof value || _report(_exceptionable, {
|
|
404
|
+
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
405
|
+
expected: "string",
|
|
406
|
+
value: value
|
|
407
|
+
});
|
|
408
|
+
}).every(flag => flag)].every(flag => flag); const _vo6 = (input, _path, _exceptionable = true) => [false === _exceptionable || Object.keys(input).map(key => {
|
|
288
409
|
const value = input[key];
|
|
289
410
|
if (undefined === value)
|
|
290
411
|
return true;
|
|
291
|
-
return
|
|
292
|
-
|
|
293
|
-
if (_io6(input))
|
|
294
|
-
return _io6(input);
|
|
295
|
-
if (_io5(input))
|
|
296
|
-
return _io5(input);
|
|
297
|
-
return false;
|
|
298
|
-
})(); const _vo0 = (input, _path, _exceptionable = true) => [("object" === typeof input.branches && null !== input.branches && false === Array.isArray(input.branches) || _report(_exceptionable, {
|
|
299
|
-
path: _path + ".branches",
|
|
300
|
-
expected: "__type",
|
|
301
|
-
value: input.branches
|
|
302
|
-
})) && _vo1(input.branches, _path + ".branches", true && _exceptionable) || _report(_exceptionable, {
|
|
303
|
-
path: _path + ".branches",
|
|
304
|
-
expected: "__type",
|
|
305
|
-
value: input.branches
|
|
306
|
-
}), undefined === input.descriptorTemplate || "string" === typeof input.descriptorTemplate || _report(_exceptionable, {
|
|
307
|
-
path: _path + ".descriptorTemplate",
|
|
308
|
-
expected: "(string | undefined)",
|
|
309
|
-
value: input.descriptorTemplate
|
|
310
|
-
}), ("object" === typeof input.groups && null !== input.groups && false === Array.isArray(input.groups) || _report(_exceptionable, {
|
|
311
|
-
path: _path + ".groups",
|
|
312
|
-
expected: "__type.o4",
|
|
313
|
-
value: input.groups
|
|
314
|
-
})) && _vo7(input.groups, _path + ".groups", true && _exceptionable) || _report(_exceptionable, {
|
|
315
|
-
path: _path + ".groups",
|
|
316
|
-
expected: "__type.o4",
|
|
317
|
-
value: input.groups
|
|
318
|
-
}), undefined === input.inputs || (Array.isArray(input.inputs) || _report(_exceptionable, {
|
|
319
|
-
path: _path + ".inputs",
|
|
320
|
-
expected: "(Array<string> | undefined)",
|
|
321
|
-
value: input.inputs
|
|
322
|
-
})) && input.inputs.map((elem, _index11) => "string" === typeof elem || _report(_exceptionable, {
|
|
323
|
-
path: _path + ".inputs[" + _index11 + "]",
|
|
324
|
-
expected: "string",
|
|
325
|
-
value: elem
|
|
326
|
-
})).every(flag => flag) || _report(_exceptionable, {
|
|
327
|
-
path: _path + ".inputs",
|
|
328
|
-
expected: "(Array<string> | undefined)",
|
|
329
|
-
value: input.inputs
|
|
330
|
-
}), undefined === input.name || "string" === typeof input.name || _report(_exceptionable, {
|
|
331
|
-
path: _path + ".name",
|
|
332
|
-
expected: "(string | undefined)",
|
|
333
|
-
value: input.name
|
|
334
|
-
}), (Array.isArray(input.tools) || _report(_exceptionable, {
|
|
335
|
-
path: _path + ".tools",
|
|
336
|
-
expected: "Array<SavedToolConfig>",
|
|
337
|
-
value: input.tools
|
|
338
|
-
})) && input.tools.map((elem, _index12) => ("object" === typeof elem && null !== elem && false === Array.isArray(elem) || _report(_exceptionable, {
|
|
339
|
-
path: _path + ".tools[" + _index12 + "]",
|
|
340
|
-
expected: "SavedToolConfig",
|
|
341
|
-
value: elem
|
|
342
|
-
})) && _vo3(elem, _path + ".tools[" + _index12 + "]", true && _exceptionable) || _report(_exceptionable, {
|
|
343
|
-
path: _path + ".tools[" + _index12 + "]",
|
|
344
|
-
expected: "SavedToolConfig",
|
|
345
|
-
value: elem
|
|
346
|
-
})).every(flag => flag) || _report(_exceptionable, {
|
|
347
|
-
path: _path + ".tools",
|
|
348
|
-
expected: "Array<SavedToolConfig>",
|
|
349
|
-
value: input.tools
|
|
350
|
-
})].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => [false === _exceptionable || Object.keys(input).map(key => {
|
|
351
|
-
const value = input[key];
|
|
352
|
-
if (undefined === value)
|
|
353
|
-
return true;
|
|
354
|
-
return ("object" === typeof value && null !== value || _report(_exceptionable, {
|
|
355
|
-
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
356
|
-
expected: "SavedBranchConfig",
|
|
357
|
-
value: value
|
|
358
|
-
})) && _vo2(value, _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key), true && _exceptionable) || _report(_exceptionable, {
|
|
359
|
-
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
360
|
-
expected: "SavedBranchConfig",
|
|
361
|
-
value: value
|
|
362
|
-
});
|
|
363
|
-
}).every(flag => flag)].every(flag => flag); const _vo2 = (input, _path, _exceptionable = true) => ["string" === typeof input.particle || _report(_exceptionable, {
|
|
364
|
-
path: _path + ".particle",
|
|
365
|
-
expected: "string",
|
|
366
|
-
value: input.particle
|
|
367
|
-
}), (Array.isArray(input.tools) || _report(_exceptionable, {
|
|
368
|
-
path: _path + ".tools",
|
|
369
|
-
expected: "Array<SavedToolConfig>",
|
|
370
|
-
value: input.tools
|
|
371
|
-
})) && input.tools.map((elem, _index13) => ("object" === typeof elem && null !== elem && false === Array.isArray(elem) || _report(_exceptionable, {
|
|
372
|
-
path: _path + ".tools[" + _index13 + "]",
|
|
373
|
-
expected: "SavedToolConfig",
|
|
374
|
-
value: elem
|
|
375
|
-
})) && _vo3(elem, _path + ".tools[" + _index13 + "]", true && _exceptionable) || _report(_exceptionable, {
|
|
376
|
-
path: _path + ".tools[" + _index13 + "]",
|
|
377
|
-
expected: "SavedToolConfig",
|
|
378
|
-
value: elem
|
|
379
|
-
})).every(flag => flag) || _report(_exceptionable, {
|
|
380
|
-
path: _path + ".tools",
|
|
381
|
-
expected: "Array<SavedToolConfig>",
|
|
382
|
-
value: input.tools
|
|
383
|
-
})].every(flag => flag); const _vo3 = (input, _path, _exceptionable = true) => [false === _exceptionable || Object.keys(input).map(key => {
|
|
384
|
-
const value = input[key];
|
|
385
|
-
if (undefined === value)
|
|
386
|
-
return true;
|
|
387
|
-
return ("object" === typeof value && null !== value && false === Array.isArray(value) || _report(_exceptionable, {
|
|
388
|
-
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
389
|
-
expected: "__type.o1",
|
|
390
|
-
value: value
|
|
391
|
-
})) && _vo4(value, _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key), true && _exceptionable) || _report(_exceptionable, {
|
|
392
|
-
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
393
|
-
expected: "__type.o1",
|
|
394
|
-
value: value
|
|
395
|
-
});
|
|
396
|
-
}).every(flag => flag)].every(flag => flag); const _vo4 = (input, _path, _exceptionable = true) => [false === _exceptionable || Object.keys(input).map(key => {
|
|
397
|
-
const value = input[key];
|
|
398
|
-
if (undefined === value)
|
|
399
|
-
return true;
|
|
400
|
-
return (null !== value || _report(_exceptionable, {
|
|
401
|
-
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
402
|
-
expected: "(Array<number> | Array<string> | __type.o2 | __type.o3 | boolean | number | string)",
|
|
403
|
-
value: value
|
|
404
|
-
})) && (undefined !== value || _report(_exceptionable, {
|
|
405
|
-
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
406
|
-
expected: "(Array<number> | Array<string> | __type.o2 | __type.o3 | boolean | number | string)",
|
|
407
|
-
value: value
|
|
408
|
-
})) && ("string" === typeof value || "number" === typeof value || "boolean" === typeof value || (Array.isArray(value) && (_vp1(value, _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key), true && _exceptionable) || _report(_exceptionable, {
|
|
409
|
-
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
410
|
-
expected: "Array<string> | Array<number>",
|
|
411
|
-
value: value
|
|
412
|
-
})) || "object" === typeof value && null !== value && false === Array.isArray(value) && _vu0(value, _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key), true && _exceptionable) || _report(_exceptionable, {
|
|
413
|
-
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
414
|
-
expected: "(Array<number> | Array<string> | __type.o2 | __type.o3 | boolean | number | string)",
|
|
415
|
-
value: value
|
|
416
|
-
})) || _report(_exceptionable, {
|
|
417
|
-
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
418
|
-
expected: "(Array<number> | Array<string> | __type.o2 | __type.o3 | boolean | number | string)",
|
|
419
|
-
value: value
|
|
420
|
-
}));
|
|
421
|
-
}).every(flag => flag)].every(flag => flag); const _vo5 = (input, _path, _exceptionable = true) => [false === _exceptionable || Object.keys(input).map(key => {
|
|
422
|
-
const value = input[key];
|
|
423
|
-
if (undefined === value)
|
|
424
|
-
return true;
|
|
425
|
-
return "string" === typeof value || _report(_exceptionable, {
|
|
426
|
-
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
427
|
-
expected: "string",
|
|
428
|
-
value: value
|
|
429
|
-
});
|
|
430
|
-
}).every(flag => flag)].every(flag => flag); const _vo6 = (input, _path, _exceptionable = true) => [false === _exceptionable || Object.keys(input).map(key => {
|
|
431
|
-
const value = input[key];
|
|
432
|
-
if (undefined === value)
|
|
433
|
-
return true;
|
|
434
|
-
return (Array.isArray(value) || _report(_exceptionable, {
|
|
435
|
-
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
436
|
-
expected: "Array<string>",
|
|
437
|
-
value: value
|
|
438
|
-
})) && value.map((elem, _index18) => "string" === typeof elem || _report(_exceptionable, {
|
|
439
|
-
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key) + "[" + _index18 + "]",
|
|
440
|
-
expected: "string",
|
|
441
|
-
value: elem
|
|
442
|
-
})).every(flag => flag) || _report(_exceptionable, {
|
|
443
|
-
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
444
|
-
expected: "Array<string>",
|
|
445
|
-
value: value
|
|
446
|
-
});
|
|
447
|
-
}).every(flag => flag)].every(flag => flag); const _vo7 = (input, _path, _exceptionable = true) => [false === _exceptionable || Object.keys(input).map(key => {
|
|
448
|
-
const value = input[key];
|
|
449
|
-
if (undefined === value)
|
|
450
|
-
return true;
|
|
451
|
-
return ("object" === typeof value && null !== value || _report(_exceptionable, {
|
|
452
|
-
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
453
|
-
expected: "SavedGroupConfig",
|
|
454
|
-
value: value
|
|
455
|
-
})) && _vo8(value, _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key), true && _exceptionable) || _report(_exceptionable, {
|
|
456
|
-
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
457
|
-
expected: "SavedGroupConfig",
|
|
458
|
-
value: value
|
|
459
|
-
});
|
|
460
|
-
}).every(flag => flag)].every(flag => flag); const _vo8 = (input, _path, _exceptionable = true) => [(Array.isArray(input.particles) || _report(_exceptionable, {
|
|
461
|
-
path: _path + ".particles",
|
|
412
|
+
return (Array.isArray(value) || _report(_exceptionable, {
|
|
413
|
+
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
462
414
|
expected: "Array<string>",
|
|
463
|
-
value:
|
|
464
|
-
})) &&
|
|
465
|
-
path: _path + "
|
|
415
|
+
value: value
|
|
416
|
+
})) && value.map((elem, _index18) => "string" === typeof elem || _report(_exceptionable, {
|
|
417
|
+
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key) + "[" + _index18 + "]",
|
|
466
418
|
expected: "string",
|
|
467
419
|
value: elem
|
|
468
420
|
})).every(flag => flag) || _report(_exceptionable, {
|
|
469
|
-
path: _path +
|
|
421
|
+
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
470
422
|
expected: "Array<string>",
|
|
471
|
-
value:
|
|
472
|
-
})
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
423
|
+
value: value
|
|
424
|
+
});
|
|
425
|
+
}).every(flag => flag)].every(flag => flag); const _vo7 = (input, _path, _exceptionable = true) => [false === _exceptionable || Object.keys(input).map(key => {
|
|
426
|
+
const value = input[key];
|
|
427
|
+
if (undefined === value)
|
|
428
|
+
return true;
|
|
429
|
+
return ("object" === typeof value && null !== value || _report(_exceptionable, {
|
|
430
|
+
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
431
|
+
expected: "SavedGroupConfig",
|
|
432
|
+
value: value
|
|
433
|
+
})) && _vo8(value, _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key), true && _exceptionable) || _report(_exceptionable, {
|
|
434
|
+
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
435
|
+
expected: "SavedGroupConfig",
|
|
436
|
+
value: value
|
|
437
|
+
});
|
|
438
|
+
}).every(flag => flag)].every(flag => flag); const _vo8 = (input, _path, _exceptionable = true) => [(Array.isArray(input.particles) || _report(_exceptionable, {
|
|
439
|
+
path: _path + ".particles",
|
|
440
|
+
expected: "Array<string>",
|
|
441
|
+
value: input.particles
|
|
442
|
+
})) && input.particles.map((elem, _index19) => "string" === typeof elem || _report(_exceptionable, {
|
|
443
|
+
path: _path + ".particles[" + _index19 + "]",
|
|
444
|
+
expected: "string",
|
|
445
|
+
value: elem
|
|
446
|
+
})).every(flag => flag) || _report(_exceptionable, {
|
|
447
|
+
path: _path + ".particles",
|
|
448
|
+
expected: "Array<string>",
|
|
449
|
+
value: input.particles
|
|
450
|
+
}), (Array.isArray(input.tools) || _report(_exceptionable, {
|
|
451
|
+
path: _path + ".tools",
|
|
452
|
+
expected: "Array<SavedToolConfig>",
|
|
453
|
+
value: input.tools
|
|
454
|
+
})) && input.tools.map((elem, _index20) => ("object" === typeof elem && null !== elem && false === Array.isArray(elem) || _report(_exceptionable, {
|
|
455
|
+
path: _path + ".tools[" + _index20 + "]",
|
|
456
|
+
expected: "SavedToolConfig",
|
|
457
|
+
value: elem
|
|
458
|
+
})) && _vo3(elem, _path + ".tools[" + _index20 + "]", true && _exceptionable) || _report(_exceptionable, {
|
|
459
|
+
path: _path + ".tools[" + _index20 + "]",
|
|
460
|
+
expected: "SavedToolConfig",
|
|
461
|
+
value: elem
|
|
462
|
+
})).every(flag => flag) || _report(_exceptionable, {
|
|
463
|
+
path: _path + ".tools",
|
|
464
|
+
expected: "Array<SavedToolConfig>",
|
|
465
|
+
value: input.tools
|
|
466
|
+
})].every(flag => flag); const _vu0 = (input, _path, _exceptionable = true) => _vo6(input, _path, false && _exceptionable) || _vo5(input, _path, false && _exceptionable); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
|
|
467
|
+
if (false === __is(input)) {
|
|
468
|
+
errors = [];
|
|
469
|
+
_report = __typia_transform__validateReport._validateReport(errors);
|
|
470
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
|
|
471
|
+
path: _path + "",
|
|
472
|
+
expected: "SavedDttConfig",
|
|
473
|
+
value: input
|
|
474
|
+
})) && _vo0(input, _path + "", true) || _report(true, {
|
|
475
|
+
path: _path + "",
|
|
476
|
+
expected: "SavedDttConfig",
|
|
477
|
+
value: input
|
|
478
|
+
}))(input, "$input", true);
|
|
479
|
+
const success = 0 === errors.length;
|
|
480
|
+
return success ? {
|
|
481
|
+
success,
|
|
482
|
+
data: input
|
|
483
|
+
} : {
|
|
484
|
+
success,
|
|
485
|
+
errors,
|
|
513
486
|
data: input
|
|
514
487
|
};
|
|
515
|
-
}; })()(rawConfig);
|
|
516
|
-
if (!validationResult.success) {
|
|
517
|
-
console.error("Invalid Dtt config:", rawConfig);
|
|
518
|
-
console.error(validationResult.errors);
|
|
519
|
-
errors[file.name] = `Invalid Dtt config at: ${validationResult.errors.map((e) => e.path).join(", ")}`;
|
|
520
|
-
continue;
|
|
521
488
|
}
|
|
522
|
-
|
|
489
|
+
return {
|
|
490
|
+
success: true,
|
|
491
|
+
data: input
|
|
492
|
+
};
|
|
493
|
+
}; })()(rawConfig);
|
|
494
|
+
if (!validationResult.success) {
|
|
495
|
+
return `'${file.name}' does not have the expected structure`;
|
|
496
|
+
}
|
|
497
|
+
return validationResult.data;
|
|
498
|
+
}
|
|
499
|
+
export async function parseProductionFiles(files, metadata) {
|
|
500
|
+
const infoYamlFile = files.find((f) => f.name === "info.yaml");
|
|
501
|
+
const infoYamlResult = infoYamlFile ? await parseInfoYamlFile(infoYamlFile) : null;
|
|
502
|
+
if (typeof infoYamlResult === "string") {
|
|
503
|
+
// The info.yaml is invalid
|
|
504
|
+
return infoYamlResult;
|
|
505
|
+
}
|
|
506
|
+
const dttConfigFiles = files.filter((f) => f.name !== "info.yaml");
|
|
507
|
+
const dttConfigPromises = dttConfigFiles.map((f) => parseDttConfigFile(f));
|
|
508
|
+
const dttConfigResults = await Promise.all(dttConfigPromises);
|
|
509
|
+
const dttConfigErrors = dttConfigResults.filter((r) => typeof r === "string");
|
|
510
|
+
if (dttConfigErrors.length > 0) {
|
|
511
|
+
// One of the DTT config files is invalid
|
|
512
|
+
return dttConfigErrors.join("\n");
|
|
513
|
+
}
|
|
514
|
+
return processProductionFiles(metadata, dttConfigResults, infoYamlResult);
|
|
515
|
+
}
|
|
516
|
+
export function processProductionFiles(metadata, configs, infoYaml) {
|
|
517
|
+
const rows = [];
|
|
518
|
+
const emailsToInform = [];
|
|
519
|
+
for (const config of configs) {
|
|
523
520
|
const decay = Object.values(metadata.decays).find((d) => d.descriptors.template === config.descriptorTemplate);
|
|
524
521
|
if (!decay) {
|
|
525
|
-
|
|
526
|
-
console.error(msg);
|
|
527
|
-
errors[file.name] = msg;
|
|
528
|
-
continue;
|
|
522
|
+
return `[${config.name}] Unknown decay '${config.descriptorTemplate}'`;
|
|
529
523
|
}
|
|
530
524
|
if (!config.inputs) {
|
|
531
|
-
|
|
532
|
-
console.warn(msg);
|
|
533
|
-
warnings[file.name] = msg;
|
|
534
|
-
continue;
|
|
525
|
+
return `[${config.name}] No inputs defined`;
|
|
535
526
|
}
|
|
536
527
|
rows.push({
|
|
537
|
-
id:
|
|
528
|
+
id: rows.length,
|
|
538
529
|
decay,
|
|
539
530
|
lines: config.inputs.map((input) => parseInput(decay, input)),
|
|
540
531
|
paths: [],
|
|
@@ -542,8 +533,15 @@ export const parseProductionFiles = async (files, metadata) => {
|
|
|
542
533
|
dtt: Dtt.fromSavedConfig(config, metadata.tupleTools.tupleTools),
|
|
543
534
|
});
|
|
544
535
|
}
|
|
545
|
-
|
|
546
|
-
|
|
536
|
+
if (infoYaml) {
|
|
537
|
+
const email = infoYaml.defaults.inform[0];
|
|
538
|
+
if (email) {
|
|
539
|
+
emailsToInform.push(email);
|
|
540
|
+
}
|
|
541
|
+
addBkPathsToRows(infoYaml, rows);
|
|
542
|
+
}
|
|
543
|
+
return { rows, emails: emailsToInform };
|
|
544
|
+
}
|
|
547
545
|
/**
|
|
548
546
|
* Sanitizes a user-provided filename to prevent path traversal (Zip Slip)
|
|
549
547
|
* and unsafe filesystem characters.
|