@nxtedition/types 1.6.3 → 1.6.6
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/common/block.d.ts +2 -3
- package/dist/common/block.js +766 -84
- package/dist/common/error.d.ts +19 -0
- package/dist/common/error.js +404 -0
- package/dist/common/file.d.ts +6 -3
- package/dist/common/file.js +1628 -100
- package/dist/common/settings.d.ts +145 -1
- package/dist/common/settings.js +23 -16
- package/dist/domains/connection.d.ts +1 -16
- package/dist/domains/permission.d.ts +2 -26
- package/dist/domains/publish.d.ts +2 -170
- package/package.json +8 -7
package/dist/common/block.js
CHANGED
|
@@ -1,18 +1,33 @@
|
|
|
1
1
|
import __typia from "typia";
|
|
2
2
|
export const isBlock = input => {
|
|
3
|
-
const $io0 = input => "string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) && ("string" === typeof input.file && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.file)) && ("string" === typeof input.location && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.location)) && ("number" === typeof input.offset && (0 <= input.offset && (Math.floor(input.offset) === input.offset && 0 <= input.offset && input.offset <= 18446744073709552000))) && (null === input.size || "number" === typeof input.size && (0 <= input.size && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 18446744073709552000))) && (null === input.hash || "string" === typeof input.hash && /^([A-Fa-f0-9]{32})?$/.test(input.hash)) && (null === input.btime || "number" === typeof input.btime && (0 <= input.btime && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 18446744073709552000))) && (null === input.path || "string" === typeof input.path) && (null === input.error || Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io1(elem)));
|
|
4
|
-
const $io1 = input => "string" === typeof input.message;
|
|
3
|
+
const $io0 = input => "string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) && ("string" === typeof input.file && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.file)) && ("string" === typeof input.location && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.location)) && ("number" === typeof input.offset && (0 <= input.offset && (Math.floor(input.offset) === input.offset && 0 <= input.offset && input.offset <= 18446744073709552000))) && (null === input.size || "number" === typeof input.size && (0 <= input.size && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 18446744073709552000))) && (null === input.hash || "string" === typeof input.hash && /^([A-Fa-f0-9]{32})?$/.test(input.hash)) && (null === input.btime || "number" === typeof input.btime && (0 <= input.btime && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 18446744073709552000))) && (null === input.path || "string" === typeof input.path) && (undefined !== input.error && (null === input.error || (Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io1(elem)) || "object" === typeof input.error && null !== input.error && $io1(input.error))));
|
|
4
|
+
const $io1 = input => "string" === typeof input.message && (undefined === input.type || "string" === typeof input.type) && (undefined === input.code || "string" === typeof input.code) && (undefined === input.exitCode || "number" === typeof input.exitCode) && (undefined === input.signalCode || "number" === typeof input.signalCode) && (undefined === input.statusCode || "number" === typeof input.statusCode) && (undefined === input.headers || "object" === typeof input.headers && null !== input.headers && false === Array.isArray(input.headers) && $io2(input.headers)) && (undefined === input.data || "object" === typeof input.data && null !== input.data && false === Array.isArray(input.data) && $io3(input.data)) && (null === input.cause || undefined === input.cause || "object" === typeof input.cause && null !== input.cause && $io1(input.cause)) && (null === input.errors || undefined === input.errors || Array.isArray(input.errors) && input.errors.every(elem => "object" === typeof elem && null !== elem && $io1(elem)));
|
|
5
|
+
const $io2 = input => Object.keys(input).every(key => {
|
|
6
|
+
const value = input[key];
|
|
7
|
+
if (undefined === value)
|
|
8
|
+
return true;
|
|
9
|
+
return "string" === typeof value;
|
|
10
|
+
});
|
|
11
|
+
const $io3 = input => true;
|
|
5
12
|
return "object" === typeof input && null !== input && $io0(input);
|
|
6
13
|
};
|
|
7
14
|
export const assertBlock = (input, errorFactory) => {
|
|
8
15
|
const __is = input => {
|
|
9
|
-
const $io0 = input => "string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) && ("string" === typeof input.file && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.file)) && ("string" === typeof input.location && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.location)) && ("number" === typeof input.offset && (0 <= input.offset && (Math.floor(input.offset) === input.offset && 0 <= input.offset && input.offset <= 18446744073709552000))) && (null === input.size || "number" === typeof input.size && (0 <= input.size && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 18446744073709552000))) && (null === input.hash || "string" === typeof input.hash && /^([A-Fa-f0-9]{32})?$/.test(input.hash)) && (null === input.btime || "number" === typeof input.btime && (0 <= input.btime && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 18446744073709552000))) && (null === input.path || "string" === typeof input.path) && (null === input.error || Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io1(elem)));
|
|
10
|
-
const $io1 = input => "string" === typeof input.message;
|
|
16
|
+
const $io0 = input => "string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) && ("string" === typeof input.file && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.file)) && ("string" === typeof input.location && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.location)) && ("number" === typeof input.offset && (0 <= input.offset && (Math.floor(input.offset) === input.offset && 0 <= input.offset && input.offset <= 18446744073709552000))) && (null === input.size || "number" === typeof input.size && (0 <= input.size && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 18446744073709552000))) && (null === input.hash || "string" === typeof input.hash && /^([A-Fa-f0-9]{32})?$/.test(input.hash)) && (null === input.btime || "number" === typeof input.btime && (0 <= input.btime && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 18446744073709552000))) && (null === input.path || "string" === typeof input.path) && (undefined !== input.error && (null === input.error || (Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io1(elem)) || "object" === typeof input.error && null !== input.error && $io1(input.error))));
|
|
17
|
+
const $io1 = input => "string" === typeof input.message && (undefined === input.type || "string" === typeof input.type) && (undefined === input.code || "string" === typeof input.code) && (undefined === input.exitCode || "number" === typeof input.exitCode) && (undefined === input.signalCode || "number" === typeof input.signalCode) && (undefined === input.statusCode || "number" === typeof input.statusCode) && (undefined === input.headers || "object" === typeof input.headers && null !== input.headers && false === Array.isArray(input.headers) && $io2(input.headers)) && (undefined === input.data || "object" === typeof input.data && null !== input.data && false === Array.isArray(input.data) && $io3(input.data)) && (null === input.cause || undefined === input.cause || "object" === typeof input.cause && null !== input.cause && $io1(input.cause)) && (null === input.errors || undefined === input.errors || Array.isArray(input.errors) && input.errors.every(elem => "object" === typeof elem && null !== elem && $io1(elem)));
|
|
18
|
+
const $io2 = input => Object.keys(input).every(key => {
|
|
19
|
+
const value = input[key];
|
|
20
|
+
if (undefined === value)
|
|
21
|
+
return true;
|
|
22
|
+
return "string" === typeof value;
|
|
23
|
+
});
|
|
24
|
+
const $io3 = input => true;
|
|
11
25
|
return "object" === typeof input && null !== input && $io0(input);
|
|
12
26
|
};
|
|
13
27
|
if (false === __is(input))
|
|
14
28
|
((input, _path, _exceptionable = true) => {
|
|
15
29
|
const $guard = __typia.createAssert.guard;
|
|
30
|
+
const $join = __typia.createAssert.join;
|
|
16
31
|
const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.id && (/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) || $guard(_exceptionable, {
|
|
17
32
|
path: _path + ".id",
|
|
18
33
|
expected: "string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
|
|
@@ -85,28 +100,103 @@ export const assertBlock = (input, errorFactory) => {
|
|
|
85
100
|
path: _path + ".path",
|
|
86
101
|
expected: "(null | string)",
|
|
87
102
|
value: input.path
|
|
88
|
-
}, errorFactory)) && (
|
|
103
|
+
}, errorFactory)) && ((undefined !== input.error || $guard(_exceptionable, {
|
|
89
104
|
path: _path + ".error",
|
|
90
|
-
expected: "(Array<
|
|
105
|
+
expected: "(Array<NxtError> | NxtError | null)",
|
|
91
106
|
value: input.error
|
|
92
|
-
}, errorFactory)) && input.error.every((elem, _index1) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
|
|
107
|
+
}, errorFactory)) && (null === input.error || (Array.isArray(input.error) && input.error.every((elem, _index1) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
|
|
93
108
|
path: _path + ".error[" + _index1 + "]",
|
|
94
|
-
expected: "
|
|
109
|
+
expected: "NxtError",
|
|
95
110
|
value: elem
|
|
96
111
|
}, errorFactory)) && $ao1(elem, _path + ".error[" + _index1 + "]", true && _exceptionable) || $guard(_exceptionable, {
|
|
97
112
|
path: _path + ".error[" + _index1 + "]",
|
|
98
|
-
expected: "
|
|
113
|
+
expected: "NxtError",
|
|
99
114
|
value: elem
|
|
115
|
+
}, errorFactory)) || "object" === typeof input.error && null !== input.error && $ao1(input.error, _path + ".error", true && _exceptionable) || $guard(_exceptionable, {
|
|
116
|
+
path: _path + ".error",
|
|
117
|
+
expected: "(Array<NxtError> | NxtError | null)",
|
|
118
|
+
value: input.error
|
|
100
119
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
101
120
|
path: _path + ".error",
|
|
102
|
-
expected: "(Array<
|
|
121
|
+
expected: "(Array<NxtError> | NxtError | null)",
|
|
103
122
|
value: input.error
|
|
104
|
-
}, errorFactory));
|
|
105
|
-
const $ao1 = (input, _path, _exceptionable = true) => "string" === typeof input.message || $guard(_exceptionable, {
|
|
123
|
+
}, errorFactory)));
|
|
124
|
+
const $ao1 = (input, _path, _exceptionable = true) => ("string" === typeof input.message || $guard(_exceptionable, {
|
|
106
125
|
path: _path + ".message",
|
|
107
126
|
expected: "string",
|
|
108
127
|
value: input.message
|
|
109
|
-
}, errorFactory)
|
|
128
|
+
}, errorFactory)) && (undefined === input.type || "string" === typeof input.type || $guard(_exceptionable, {
|
|
129
|
+
path: _path + ".type",
|
|
130
|
+
expected: "(string | undefined)",
|
|
131
|
+
value: input.type
|
|
132
|
+
}, errorFactory)) && (undefined === input.code || "string" === typeof input.code || $guard(_exceptionable, {
|
|
133
|
+
path: _path + ".code",
|
|
134
|
+
expected: "(string | undefined)",
|
|
135
|
+
value: input.code
|
|
136
|
+
}, errorFactory)) && (undefined === input.exitCode || "number" === typeof input.exitCode || $guard(_exceptionable, {
|
|
137
|
+
path: _path + ".exitCode",
|
|
138
|
+
expected: "(number | undefined)",
|
|
139
|
+
value: input.exitCode
|
|
140
|
+
}, errorFactory)) && (undefined === input.signalCode || "number" === typeof input.signalCode || $guard(_exceptionable, {
|
|
141
|
+
path: _path + ".signalCode",
|
|
142
|
+
expected: "(number | undefined)",
|
|
143
|
+
value: input.signalCode
|
|
144
|
+
}, errorFactory)) && (undefined === input.statusCode || "number" === typeof input.statusCode || $guard(_exceptionable, {
|
|
145
|
+
path: _path + ".statusCode",
|
|
146
|
+
expected: "(number | undefined)",
|
|
147
|
+
value: input.statusCode
|
|
148
|
+
}, errorFactory)) && (undefined === input.headers || ("object" === typeof input.headers && null !== input.headers && false === Array.isArray(input.headers) || $guard(_exceptionable, {
|
|
149
|
+
path: _path + ".headers",
|
|
150
|
+
expected: "(Record<string, string> | undefined)",
|
|
151
|
+
value: input.headers
|
|
152
|
+
}, errorFactory)) && $ao2(input.headers, _path + ".headers", true && _exceptionable) || $guard(_exceptionable, {
|
|
153
|
+
path: _path + ".headers",
|
|
154
|
+
expected: "(Record<string, string> | undefined)",
|
|
155
|
+
value: input.headers
|
|
156
|
+
}, errorFactory)) && (undefined === input.data || ("object" === typeof input.data && null !== input.data && false === Array.isArray(input.data) || $guard(_exceptionable, {
|
|
157
|
+
path: _path + ".data",
|
|
158
|
+
expected: "(object | undefined)",
|
|
159
|
+
value: input.data
|
|
160
|
+
}, errorFactory)) && $ao3(input.data, _path + ".data", true && _exceptionable) || $guard(_exceptionable, {
|
|
161
|
+
path: _path + ".data",
|
|
162
|
+
expected: "(object | undefined)",
|
|
163
|
+
value: input.data
|
|
164
|
+
}, errorFactory)) && (null === input.cause || undefined === input.cause || ("object" === typeof input.cause && null !== input.cause || $guard(_exceptionable, {
|
|
165
|
+
path: _path + ".cause",
|
|
166
|
+
expected: "(NxtError | null | undefined)",
|
|
167
|
+
value: input.cause
|
|
168
|
+
}, errorFactory)) && $ao1(input.cause, _path + ".cause", true && _exceptionable) || $guard(_exceptionable, {
|
|
169
|
+
path: _path + ".cause",
|
|
170
|
+
expected: "(NxtError | null | undefined)",
|
|
171
|
+
value: input.cause
|
|
172
|
+
}, errorFactory)) && (null === input.errors || undefined === input.errors || (Array.isArray(input.errors) || $guard(_exceptionable, {
|
|
173
|
+
path: _path + ".errors",
|
|
174
|
+
expected: "(Array<NxtError> | null | undefined)",
|
|
175
|
+
value: input.errors
|
|
176
|
+
}, errorFactory)) && input.errors.every((elem, _index2) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
|
|
177
|
+
path: _path + ".errors[" + _index2 + "]",
|
|
178
|
+
expected: "NxtError",
|
|
179
|
+
value: elem
|
|
180
|
+
}, errorFactory)) && $ao1(elem, _path + ".errors[" + _index2 + "]", true && _exceptionable) || $guard(_exceptionable, {
|
|
181
|
+
path: _path + ".errors[" + _index2 + "]",
|
|
182
|
+
expected: "NxtError",
|
|
183
|
+
value: elem
|
|
184
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
185
|
+
path: _path + ".errors",
|
|
186
|
+
expected: "(Array<NxtError> | null | undefined)",
|
|
187
|
+
value: input.errors
|
|
188
|
+
}, errorFactory));
|
|
189
|
+
const $ao2 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
|
|
190
|
+
const value = input[key];
|
|
191
|
+
if (undefined === value)
|
|
192
|
+
return true;
|
|
193
|
+
return "string" === typeof value || $guard(_exceptionable, {
|
|
194
|
+
path: _path + $join(key),
|
|
195
|
+
expected: "string",
|
|
196
|
+
value: value
|
|
197
|
+
}, errorFactory);
|
|
198
|
+
});
|
|
199
|
+
const $ao3 = (input, _path, _exceptionable = true) => true;
|
|
110
200
|
return ("object" === typeof input && null !== input || $guard(true, {
|
|
111
201
|
path: _path + "",
|
|
112
202
|
expected: "Block",
|
|
@@ -202,23 +292,76 @@ export const randomBlock = generator => {
|
|
|
202
292
|
])(),
|
|
203
293
|
error: $pick([
|
|
204
294
|
() => null,
|
|
205
|
-
() => (generator?.array ?? $generator.array)(() => $ro1(_recursive, _recursive ? 1 + _depth : _depth))
|
|
295
|
+
() => (generator?.array ?? $generator.array)(() => $ro1(_recursive, _recursive ? 1 + _depth : _depth)),
|
|
296
|
+
() => $ro1(_recursive, _recursive ? 1 + _depth : _depth)
|
|
206
297
|
])()
|
|
207
298
|
});
|
|
208
|
-
const $ro1 = (_recursive =
|
|
209
|
-
message: (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()
|
|
299
|
+
const $ro1 = (_recursive = true, _depth = 0) => ({
|
|
300
|
+
message: (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)(),
|
|
301
|
+
type: $pick([
|
|
302
|
+
() => undefined,
|
|
303
|
+
() => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()
|
|
304
|
+
])(),
|
|
305
|
+
code: $pick([
|
|
306
|
+
() => undefined,
|
|
307
|
+
() => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()
|
|
308
|
+
])(),
|
|
309
|
+
exitCode: $pick([
|
|
310
|
+
() => undefined,
|
|
311
|
+
() => (generator?.customs ?? $generator.customs)?.number?.([]) ?? (generator?.number ?? $generator.number)(0, 100)
|
|
312
|
+
])(),
|
|
313
|
+
signalCode: $pick([
|
|
314
|
+
() => undefined,
|
|
315
|
+
() => (generator?.customs ?? $generator.customs)?.number?.([]) ?? (generator?.number ?? $generator.number)(0, 100)
|
|
316
|
+
])(),
|
|
317
|
+
statusCode: $pick([
|
|
318
|
+
() => undefined,
|
|
319
|
+
() => (generator?.customs ?? $generator.customs)?.number?.([]) ?? (generator?.number ?? $generator.number)(0, 100)
|
|
320
|
+
])(),
|
|
321
|
+
headers: $pick([
|
|
322
|
+
() => undefined,
|
|
323
|
+
() => $ro2(true, _recursive ? 1 + _depth : _depth)
|
|
324
|
+
])(),
|
|
325
|
+
data: $pick([
|
|
326
|
+
() => undefined,
|
|
327
|
+
() => $ro3(true, _recursive ? 1 + _depth : _depth)
|
|
328
|
+
])(),
|
|
329
|
+
cause: $pick([
|
|
330
|
+
() => undefined,
|
|
331
|
+
() => null,
|
|
332
|
+
() => $ro1(true, _recursive ? 1 + _depth : _depth)
|
|
333
|
+
])(),
|
|
334
|
+
errors: $pick([
|
|
335
|
+
() => undefined,
|
|
336
|
+
() => null,
|
|
337
|
+
() => _recursive && 5 < _depth ? [] : 5 >= _depth ? (generator?.array ?? $generator.array)(() => $ro1(true, _recursive ? 1 + _depth : _depth)) : []
|
|
338
|
+
])()
|
|
210
339
|
});
|
|
340
|
+
const $ro2 = (_recursive = false, _depth = 0) => {
|
|
341
|
+
const output = {};
|
|
342
|
+
(generator?.array ?? $generator.array)(() => output[(generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()] = (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)(), (generator?.integer ?? $generator.integer)(0, 3));
|
|
343
|
+
return output;
|
|
344
|
+
};
|
|
345
|
+
const $ro3 = (_recursive = false, _depth = 0) => {};
|
|
211
346
|
return $ro0();
|
|
212
347
|
};
|
|
213
348
|
export const assertGuardBlock = (input, errorFactory) => {
|
|
214
349
|
const __is = input => {
|
|
215
|
-
const $io0 = input => "string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) && ("string" === typeof input.file && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.file)) && ("string" === typeof input.location && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.location)) && ("number" === typeof input.offset && (0 <= input.offset && (Math.floor(input.offset) === input.offset && 0 <= input.offset && input.offset <= 18446744073709552000))) && (null === input.size || "number" === typeof input.size && (0 <= input.size && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 18446744073709552000))) && (null === input.hash || "string" === typeof input.hash && /^([A-Fa-f0-9]{32})?$/.test(input.hash)) && (null === input.btime || "number" === typeof input.btime && (0 <= input.btime && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 18446744073709552000))) && (null === input.path || "string" === typeof input.path) && (null === input.error || Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io1(elem)));
|
|
216
|
-
const $io1 = input => "string" === typeof input.message;
|
|
350
|
+
const $io0 = input => "string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) && ("string" === typeof input.file && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.file)) && ("string" === typeof input.location && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.location)) && ("number" === typeof input.offset && (0 <= input.offset && (Math.floor(input.offset) === input.offset && 0 <= input.offset && input.offset <= 18446744073709552000))) && (null === input.size || "number" === typeof input.size && (0 <= input.size && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 18446744073709552000))) && (null === input.hash || "string" === typeof input.hash && /^([A-Fa-f0-9]{32})?$/.test(input.hash)) && (null === input.btime || "number" === typeof input.btime && (0 <= input.btime && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 18446744073709552000))) && (null === input.path || "string" === typeof input.path) && (undefined !== input.error && (null === input.error || (Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io1(elem)) || "object" === typeof input.error && null !== input.error && $io1(input.error))));
|
|
351
|
+
const $io1 = input => "string" === typeof input.message && (undefined === input.type || "string" === typeof input.type) && (undefined === input.code || "string" === typeof input.code) && (undefined === input.exitCode || "number" === typeof input.exitCode) && (undefined === input.signalCode || "number" === typeof input.signalCode) && (undefined === input.statusCode || "number" === typeof input.statusCode) && (undefined === input.headers || "object" === typeof input.headers && null !== input.headers && false === Array.isArray(input.headers) && $io2(input.headers)) && (undefined === input.data || "object" === typeof input.data && null !== input.data && false === Array.isArray(input.data) && $io3(input.data)) && (null === input.cause || undefined === input.cause || "object" === typeof input.cause && null !== input.cause && $io1(input.cause)) && (null === input.errors || undefined === input.errors || Array.isArray(input.errors) && input.errors.every(elem => "object" === typeof elem && null !== elem && $io1(elem)));
|
|
352
|
+
const $io2 = input => Object.keys(input).every(key => {
|
|
353
|
+
const value = input[key];
|
|
354
|
+
if (undefined === value)
|
|
355
|
+
return true;
|
|
356
|
+
return "string" === typeof value;
|
|
357
|
+
});
|
|
358
|
+
const $io3 = input => true;
|
|
217
359
|
return "object" === typeof input && null !== input && $io0(input);
|
|
218
360
|
};
|
|
219
361
|
if (false === __is(input))
|
|
220
362
|
((input, _path, _exceptionable = true) => {
|
|
221
363
|
const $guard = __typia.createAssertGuard.guard;
|
|
364
|
+
const $join = __typia.createAssertGuard.join;
|
|
222
365
|
const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.id && (/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) || $guard(_exceptionable, {
|
|
223
366
|
path: _path + ".id",
|
|
224
367
|
expected: "string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
|
|
@@ -291,28 +434,103 @@ export const assertGuardBlock = (input, errorFactory) => {
|
|
|
291
434
|
path: _path + ".path",
|
|
292
435
|
expected: "(null | string)",
|
|
293
436
|
value: input.path
|
|
294
|
-
}, errorFactory)) && (
|
|
437
|
+
}, errorFactory)) && ((undefined !== input.error || $guard(_exceptionable, {
|
|
295
438
|
path: _path + ".error",
|
|
296
|
-
expected: "(Array<
|
|
439
|
+
expected: "(Array<NxtError> | NxtError | null)",
|
|
297
440
|
value: input.error
|
|
298
|
-
}, errorFactory)) && input.error.every((elem, _index1) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
|
|
441
|
+
}, errorFactory)) && (null === input.error || (Array.isArray(input.error) && input.error.every((elem, _index1) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
|
|
299
442
|
path: _path + ".error[" + _index1 + "]",
|
|
300
|
-
expected: "
|
|
443
|
+
expected: "NxtError",
|
|
301
444
|
value: elem
|
|
302
445
|
}, errorFactory)) && $ao1(elem, _path + ".error[" + _index1 + "]", true && _exceptionable) || $guard(_exceptionable, {
|
|
303
446
|
path: _path + ".error[" + _index1 + "]",
|
|
304
|
-
expected: "
|
|
447
|
+
expected: "NxtError",
|
|
305
448
|
value: elem
|
|
449
|
+
}, errorFactory)) || "object" === typeof input.error && null !== input.error && $ao1(input.error, _path + ".error", true && _exceptionable) || $guard(_exceptionable, {
|
|
450
|
+
path: _path + ".error",
|
|
451
|
+
expected: "(Array<NxtError> | NxtError | null)",
|
|
452
|
+
value: input.error
|
|
306
453
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
307
454
|
path: _path + ".error",
|
|
308
|
-
expected: "(Array<
|
|
455
|
+
expected: "(Array<NxtError> | NxtError | null)",
|
|
309
456
|
value: input.error
|
|
310
|
-
}, errorFactory));
|
|
311
|
-
const $ao1 = (input, _path, _exceptionable = true) => "string" === typeof input.message || $guard(_exceptionable, {
|
|
457
|
+
}, errorFactory)));
|
|
458
|
+
const $ao1 = (input, _path, _exceptionable = true) => ("string" === typeof input.message || $guard(_exceptionable, {
|
|
312
459
|
path: _path + ".message",
|
|
313
460
|
expected: "string",
|
|
314
461
|
value: input.message
|
|
315
|
-
}, errorFactory)
|
|
462
|
+
}, errorFactory)) && (undefined === input.type || "string" === typeof input.type || $guard(_exceptionable, {
|
|
463
|
+
path: _path + ".type",
|
|
464
|
+
expected: "(string | undefined)",
|
|
465
|
+
value: input.type
|
|
466
|
+
}, errorFactory)) && (undefined === input.code || "string" === typeof input.code || $guard(_exceptionable, {
|
|
467
|
+
path: _path + ".code",
|
|
468
|
+
expected: "(string | undefined)",
|
|
469
|
+
value: input.code
|
|
470
|
+
}, errorFactory)) && (undefined === input.exitCode || "number" === typeof input.exitCode || $guard(_exceptionable, {
|
|
471
|
+
path: _path + ".exitCode",
|
|
472
|
+
expected: "(number | undefined)",
|
|
473
|
+
value: input.exitCode
|
|
474
|
+
}, errorFactory)) && (undefined === input.signalCode || "number" === typeof input.signalCode || $guard(_exceptionable, {
|
|
475
|
+
path: _path + ".signalCode",
|
|
476
|
+
expected: "(number | undefined)",
|
|
477
|
+
value: input.signalCode
|
|
478
|
+
}, errorFactory)) && (undefined === input.statusCode || "number" === typeof input.statusCode || $guard(_exceptionable, {
|
|
479
|
+
path: _path + ".statusCode",
|
|
480
|
+
expected: "(number | undefined)",
|
|
481
|
+
value: input.statusCode
|
|
482
|
+
}, errorFactory)) && (undefined === input.headers || ("object" === typeof input.headers && null !== input.headers && false === Array.isArray(input.headers) || $guard(_exceptionable, {
|
|
483
|
+
path: _path + ".headers",
|
|
484
|
+
expected: "(Record<string, string> | undefined)",
|
|
485
|
+
value: input.headers
|
|
486
|
+
}, errorFactory)) && $ao2(input.headers, _path + ".headers", true && _exceptionable) || $guard(_exceptionable, {
|
|
487
|
+
path: _path + ".headers",
|
|
488
|
+
expected: "(Record<string, string> | undefined)",
|
|
489
|
+
value: input.headers
|
|
490
|
+
}, errorFactory)) && (undefined === input.data || ("object" === typeof input.data && null !== input.data && false === Array.isArray(input.data) || $guard(_exceptionable, {
|
|
491
|
+
path: _path + ".data",
|
|
492
|
+
expected: "(object | undefined)",
|
|
493
|
+
value: input.data
|
|
494
|
+
}, errorFactory)) && $ao3(input.data, _path + ".data", true && _exceptionable) || $guard(_exceptionable, {
|
|
495
|
+
path: _path + ".data",
|
|
496
|
+
expected: "(object | undefined)",
|
|
497
|
+
value: input.data
|
|
498
|
+
}, errorFactory)) && (null === input.cause || undefined === input.cause || ("object" === typeof input.cause && null !== input.cause || $guard(_exceptionable, {
|
|
499
|
+
path: _path + ".cause",
|
|
500
|
+
expected: "(NxtError | null | undefined)",
|
|
501
|
+
value: input.cause
|
|
502
|
+
}, errorFactory)) && $ao1(input.cause, _path + ".cause", true && _exceptionable) || $guard(_exceptionable, {
|
|
503
|
+
path: _path + ".cause",
|
|
504
|
+
expected: "(NxtError | null | undefined)",
|
|
505
|
+
value: input.cause
|
|
506
|
+
}, errorFactory)) && (null === input.errors || undefined === input.errors || (Array.isArray(input.errors) || $guard(_exceptionable, {
|
|
507
|
+
path: _path + ".errors",
|
|
508
|
+
expected: "(Array<NxtError> | null | undefined)",
|
|
509
|
+
value: input.errors
|
|
510
|
+
}, errorFactory)) && input.errors.every((elem, _index2) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
|
|
511
|
+
path: _path + ".errors[" + _index2 + "]",
|
|
512
|
+
expected: "NxtError",
|
|
513
|
+
value: elem
|
|
514
|
+
}, errorFactory)) && $ao1(elem, _path + ".errors[" + _index2 + "]", true && _exceptionable) || $guard(_exceptionable, {
|
|
515
|
+
path: _path + ".errors[" + _index2 + "]",
|
|
516
|
+
expected: "NxtError",
|
|
517
|
+
value: elem
|
|
518
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
519
|
+
path: _path + ".errors",
|
|
520
|
+
expected: "(Array<NxtError> | null | undefined)",
|
|
521
|
+
value: input.errors
|
|
522
|
+
}, errorFactory));
|
|
523
|
+
const $ao2 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
|
|
524
|
+
const value = input[key];
|
|
525
|
+
if (undefined === value)
|
|
526
|
+
return true;
|
|
527
|
+
return "string" === typeof value || $guard(_exceptionable, {
|
|
528
|
+
path: _path + $join(key),
|
|
529
|
+
expected: "string",
|
|
530
|
+
value: value
|
|
531
|
+
}, errorFactory);
|
|
532
|
+
});
|
|
533
|
+
const $ao3 = (input, _path, _exceptionable = true) => true;
|
|
316
534
|
return ("object" === typeof input && null !== input || $guard(true, {
|
|
317
535
|
path: _path + "",
|
|
318
536
|
expected: "Block",
|
|
@@ -325,20 +543,48 @@ export const assertGuardBlock = (input, errorFactory) => {
|
|
|
325
543
|
})(input, "$input", true);
|
|
326
544
|
};
|
|
327
545
|
export const stringifyBlock = input => {
|
|
328
|
-
const $io1 = input => "string" === typeof input.message;
|
|
546
|
+
const $io1 = input => "string" === typeof input.message && (undefined === input.type || "string" === typeof input.type) && (undefined === input.code || "string" === typeof input.code) && (undefined === input.exitCode || "number" === typeof input.exitCode) && (undefined === input.signalCode || "number" === typeof input.signalCode) && (undefined === input.statusCode || "number" === typeof input.statusCode) && (undefined === input.headers || "object" === typeof input.headers && null !== input.headers && false === Array.isArray(input.headers) && $io2(input.headers)) && (undefined === input.data || "object" === typeof input.data && null !== input.data && false === Array.isArray(input.data) && $io3(input.data)) && (null === input.cause || undefined === input.cause || "object" === typeof input.cause && null !== input.cause && $io1(input.cause)) && (null === input.errors || undefined === input.errors || Array.isArray(input.errors) && input.errors.every(elem => "object" === typeof elem && null !== elem && $io1(elem)));
|
|
547
|
+
const $io2 = input => Object.keys(input).every(key => {
|
|
548
|
+
const value = input[key];
|
|
549
|
+
if (undefined === value)
|
|
550
|
+
return true;
|
|
551
|
+
return "string" === typeof value;
|
|
552
|
+
});
|
|
553
|
+
const $io3 = input => true;
|
|
329
554
|
const $string = __typia.json.createStringify.string;
|
|
330
|
-
const $
|
|
555
|
+
const $throws = __typia.json.createStringify.throws;
|
|
556
|
+
const $so0 = input => `{"id":${$string(input.id)},"file":${$string(input.file)},"location":${$string(input.location)},"offset":${input.offset},"size":${null !== input.size ? input.size : "null"},"hash":${null !== input.hash ? $string(input.hash) : "null"},"btime":${null !== input.btime ? input.btime : "null"},"path":${null !== input.path ? $string(input.path) : "null"},"error":${null !== input.error ? (() => {
|
|
557
|
+
if (Array.isArray(input.error))
|
|
558
|
+
return `[${input.error.map(elem => $so1(elem)).join(",")}]`;
|
|
559
|
+
if ("object" === typeof input.error && null !== input.error)
|
|
560
|
+
return $so1(input.error);
|
|
561
|
+
$throws({
|
|
562
|
+
expected: "(Array<NxtError> | NxtError | null)",
|
|
563
|
+
value: input.error
|
|
564
|
+
});
|
|
565
|
+
})() : "null"}}`;
|
|
566
|
+
const $so1 = input => `{${undefined === input.type ? "" : `"type":${undefined !== input.type ? $string(input.type) : undefined},`}${undefined === input.code ? "" : `"code":${undefined !== input.code ? $string(input.code) : undefined},`}${undefined === input.exitCode ? "" : `"exitCode":${undefined !== input.exitCode ? input.exitCode : undefined},`}${undefined === input.signalCode ? "" : `"signalCode":${undefined !== input.signalCode ? input.signalCode : undefined},`}${undefined === input.statusCode ? "" : `"statusCode":${undefined !== input.statusCode ? input.statusCode : undefined},`}${undefined === input.headers ? "" : `"headers":${undefined !== input.headers ? $so2(input.headers) : undefined},`}${undefined === input.data ? "" : `"data":${undefined !== input.data ? "{}" : undefined},`}${undefined === input.cause ? "" : `"cause":${undefined !== input.cause ? null !== input.cause ? $so1(input.cause) : "null" : undefined},`}${undefined === input.errors ? "" : `"errors":${undefined !== input.errors ? null !== input.errors ? `[${input.errors.map(elem => $so1(elem)).join(",")}]` : "null" : undefined},`}"message":${$string(input.message)}}`;
|
|
567
|
+
const $so2 = input => `{${Object.entries(input).map(([key, value]) => { if (undefined === value)
|
|
568
|
+
return ""; return `${JSON.stringify(key)}:${$string(value)}`; }).filter(str => "" !== str).join(",")}}`;
|
|
331
569
|
return $so0(input);
|
|
332
570
|
};
|
|
333
571
|
export const assertStringifyBlock = (input, errorFactory) => { const assert = (input, errorFactory) => {
|
|
334
572
|
const __is = input => {
|
|
335
|
-
const $io0 = input => "string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) && ("string" === typeof input.file && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.file)) && ("string" === typeof input.location && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.location)) && ("number" === typeof input.offset && (0 <= input.offset && (Math.floor(input.offset) === input.offset && 0 <= input.offset && input.offset <= 18446744073709552000))) && (null === input.size || "number" === typeof input.size && (0 <= input.size && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 18446744073709552000))) && (null === input.hash || "string" === typeof input.hash && /^([A-Fa-f0-9]{32})?$/.test(input.hash)) && (null === input.btime || "number" === typeof input.btime && (0 <= input.btime && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 18446744073709552000))) && (null === input.path || "string" === typeof input.path) && (null === input.error || Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io1(elem)));
|
|
336
|
-
const $io1 = input => "string" === typeof input.message;
|
|
573
|
+
const $io0 = input => "string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) && ("string" === typeof input.file && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.file)) && ("string" === typeof input.location && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.location)) && ("number" === typeof input.offset && (0 <= input.offset && (Math.floor(input.offset) === input.offset && 0 <= input.offset && input.offset <= 18446744073709552000))) && (null === input.size || "number" === typeof input.size && (0 <= input.size && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 18446744073709552000))) && (null === input.hash || "string" === typeof input.hash && /^([A-Fa-f0-9]{32})?$/.test(input.hash)) && (null === input.btime || "number" === typeof input.btime && (0 <= input.btime && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 18446744073709552000))) && (null === input.path || "string" === typeof input.path) && (undefined !== input.error && (null === input.error || (Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io1(elem)) || "object" === typeof input.error && null !== input.error && $io1(input.error))));
|
|
574
|
+
const $io1 = input => "string" === typeof input.message && (undefined === input.type || "string" === typeof input.type) && (undefined === input.code || "string" === typeof input.code) && (undefined === input.exitCode || "number" === typeof input.exitCode && !Number.isNaN(input.exitCode)) && (undefined === input.signalCode || "number" === typeof input.signalCode && !Number.isNaN(input.signalCode)) && (undefined === input.statusCode || "number" === typeof input.statusCode && !Number.isNaN(input.statusCode)) && (undefined === input.headers || "object" === typeof input.headers && null !== input.headers && false === Array.isArray(input.headers) && $io2(input.headers)) && (undefined === input.data || "object" === typeof input.data && null !== input.data && false === Array.isArray(input.data) && $io3(input.data)) && (null === input.cause || undefined === input.cause || "object" === typeof input.cause && null !== input.cause && $io1(input.cause)) && (null === input.errors || undefined === input.errors || Array.isArray(input.errors) && input.errors.every(elem => "object" === typeof elem && null !== elem && $io1(elem)));
|
|
575
|
+
const $io2 = input => Object.keys(input).every(key => {
|
|
576
|
+
const value = input[key];
|
|
577
|
+
if (undefined === value)
|
|
578
|
+
return true;
|
|
579
|
+
return "string" === typeof value;
|
|
580
|
+
});
|
|
581
|
+
const $io3 = input => true;
|
|
337
582
|
return "object" === typeof input && null !== input && $io0(input);
|
|
338
583
|
};
|
|
339
584
|
if (false === __is(input))
|
|
340
585
|
((input, _path, _exceptionable = true) => {
|
|
341
586
|
const $guard = __typia.json.createAssertStringify.guard;
|
|
587
|
+
const $join = __typia.json.createAssertStringify.join;
|
|
342
588
|
const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.id && (/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) || $guard(_exceptionable, {
|
|
343
589
|
path: _path + ".id",
|
|
344
590
|
expected: "string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
|
|
@@ -411,28 +657,103 @@ export const assertStringifyBlock = (input, errorFactory) => { const assert = (i
|
|
|
411
657
|
path: _path + ".path",
|
|
412
658
|
expected: "(null | string)",
|
|
413
659
|
value: input.path
|
|
414
|
-
}, errorFactory)) && (
|
|
660
|
+
}, errorFactory)) && ((undefined !== input.error || $guard(_exceptionable, {
|
|
415
661
|
path: _path + ".error",
|
|
416
|
-
expected: "(Array<
|
|
662
|
+
expected: "(Array<NxtError> | NxtError | null)",
|
|
417
663
|
value: input.error
|
|
418
|
-
}, errorFactory)) && input.error.every((elem, _index1) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
|
|
664
|
+
}, errorFactory)) && (null === input.error || (Array.isArray(input.error) && input.error.every((elem, _index1) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
|
|
419
665
|
path: _path + ".error[" + _index1 + "]",
|
|
420
|
-
expected: "
|
|
666
|
+
expected: "NxtError",
|
|
421
667
|
value: elem
|
|
422
668
|
}, errorFactory)) && $ao1(elem, _path + ".error[" + _index1 + "]", true && _exceptionable) || $guard(_exceptionable, {
|
|
423
669
|
path: _path + ".error[" + _index1 + "]",
|
|
424
|
-
expected: "
|
|
670
|
+
expected: "NxtError",
|
|
425
671
|
value: elem
|
|
672
|
+
}, errorFactory)) || "object" === typeof input.error && null !== input.error && $ao1(input.error, _path + ".error", true && _exceptionable) || $guard(_exceptionable, {
|
|
673
|
+
path: _path + ".error",
|
|
674
|
+
expected: "(Array<NxtError> | NxtError | null)",
|
|
675
|
+
value: input.error
|
|
426
676
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
427
677
|
path: _path + ".error",
|
|
428
|
-
expected: "(Array<
|
|
678
|
+
expected: "(Array<NxtError> | NxtError | null)",
|
|
429
679
|
value: input.error
|
|
430
|
-
}, errorFactory));
|
|
431
|
-
const $ao1 = (input, _path, _exceptionable = true) => "string" === typeof input.message || $guard(_exceptionable, {
|
|
680
|
+
}, errorFactory)));
|
|
681
|
+
const $ao1 = (input, _path, _exceptionable = true) => ("string" === typeof input.message || $guard(_exceptionable, {
|
|
432
682
|
path: _path + ".message",
|
|
433
683
|
expected: "string",
|
|
434
684
|
value: input.message
|
|
435
|
-
}, errorFactory)
|
|
685
|
+
}, errorFactory)) && (undefined === input.type || "string" === typeof input.type || $guard(_exceptionable, {
|
|
686
|
+
path: _path + ".type",
|
|
687
|
+
expected: "(string | undefined)",
|
|
688
|
+
value: input.type
|
|
689
|
+
}, errorFactory)) && (undefined === input.code || "string" === typeof input.code || $guard(_exceptionable, {
|
|
690
|
+
path: _path + ".code",
|
|
691
|
+
expected: "(string | undefined)",
|
|
692
|
+
value: input.code
|
|
693
|
+
}, errorFactory)) && (undefined === input.exitCode || "number" === typeof input.exitCode && !Number.isNaN(input.exitCode) || $guard(_exceptionable, {
|
|
694
|
+
path: _path + ".exitCode",
|
|
695
|
+
expected: "(number | undefined)",
|
|
696
|
+
value: input.exitCode
|
|
697
|
+
}, errorFactory)) && (undefined === input.signalCode || "number" === typeof input.signalCode && !Number.isNaN(input.signalCode) || $guard(_exceptionable, {
|
|
698
|
+
path: _path + ".signalCode",
|
|
699
|
+
expected: "(number | undefined)",
|
|
700
|
+
value: input.signalCode
|
|
701
|
+
}, errorFactory)) && (undefined === input.statusCode || "number" === typeof input.statusCode && !Number.isNaN(input.statusCode) || $guard(_exceptionable, {
|
|
702
|
+
path: _path + ".statusCode",
|
|
703
|
+
expected: "(number | undefined)",
|
|
704
|
+
value: input.statusCode
|
|
705
|
+
}, errorFactory)) && (undefined === input.headers || ("object" === typeof input.headers && null !== input.headers && false === Array.isArray(input.headers) || $guard(_exceptionable, {
|
|
706
|
+
path: _path + ".headers",
|
|
707
|
+
expected: "(Record<string, string> | undefined)",
|
|
708
|
+
value: input.headers
|
|
709
|
+
}, errorFactory)) && $ao2(input.headers, _path + ".headers", true && _exceptionable) || $guard(_exceptionable, {
|
|
710
|
+
path: _path + ".headers",
|
|
711
|
+
expected: "(Record<string, string> | undefined)",
|
|
712
|
+
value: input.headers
|
|
713
|
+
}, errorFactory)) && (undefined === input.data || ("object" === typeof input.data && null !== input.data && false === Array.isArray(input.data) || $guard(_exceptionable, {
|
|
714
|
+
path: _path + ".data",
|
|
715
|
+
expected: "(object | undefined)",
|
|
716
|
+
value: input.data
|
|
717
|
+
}, errorFactory)) && $ao3(input.data, _path + ".data", true && _exceptionable) || $guard(_exceptionable, {
|
|
718
|
+
path: _path + ".data",
|
|
719
|
+
expected: "(object | undefined)",
|
|
720
|
+
value: input.data
|
|
721
|
+
}, errorFactory)) && (null === input.cause || undefined === input.cause || ("object" === typeof input.cause && null !== input.cause || $guard(_exceptionable, {
|
|
722
|
+
path: _path + ".cause",
|
|
723
|
+
expected: "(NxtError | null | undefined)",
|
|
724
|
+
value: input.cause
|
|
725
|
+
}, errorFactory)) && $ao1(input.cause, _path + ".cause", true && _exceptionable) || $guard(_exceptionable, {
|
|
726
|
+
path: _path + ".cause",
|
|
727
|
+
expected: "(NxtError | null | undefined)",
|
|
728
|
+
value: input.cause
|
|
729
|
+
}, errorFactory)) && (null === input.errors || undefined === input.errors || (Array.isArray(input.errors) || $guard(_exceptionable, {
|
|
730
|
+
path: _path + ".errors",
|
|
731
|
+
expected: "(Array<NxtError> | null | undefined)",
|
|
732
|
+
value: input.errors
|
|
733
|
+
}, errorFactory)) && input.errors.every((elem, _index2) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
|
|
734
|
+
path: _path + ".errors[" + _index2 + "]",
|
|
735
|
+
expected: "NxtError",
|
|
736
|
+
value: elem
|
|
737
|
+
}, errorFactory)) && $ao1(elem, _path + ".errors[" + _index2 + "]", true && _exceptionable) || $guard(_exceptionable, {
|
|
738
|
+
path: _path + ".errors[" + _index2 + "]",
|
|
739
|
+
expected: "NxtError",
|
|
740
|
+
value: elem
|
|
741
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
742
|
+
path: _path + ".errors",
|
|
743
|
+
expected: "(Array<NxtError> | null | undefined)",
|
|
744
|
+
value: input.errors
|
|
745
|
+
}, errorFactory));
|
|
746
|
+
const $ao2 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
|
|
747
|
+
const value = input[key];
|
|
748
|
+
if (undefined === value)
|
|
749
|
+
return true;
|
|
750
|
+
return "string" === typeof value || $guard(_exceptionable, {
|
|
751
|
+
path: _path + $join(key),
|
|
752
|
+
expected: "string",
|
|
753
|
+
value: value
|
|
754
|
+
}, errorFactory);
|
|
755
|
+
});
|
|
756
|
+
const $ao3 = (input, _path, _exceptionable = true) => true;
|
|
436
757
|
return ("object" === typeof input && null !== input || $guard(true, {
|
|
437
758
|
path: _path + "",
|
|
438
759
|
expected: "Block",
|
|
@@ -445,25 +766,60 @@ export const assertStringifyBlock = (input, errorFactory) => { const assert = (i
|
|
|
445
766
|
})(input, "$input", true);
|
|
446
767
|
return input;
|
|
447
768
|
}; const stringify = input => {
|
|
448
|
-
const $io1 = input => "string" === typeof input.message;
|
|
769
|
+
const $io1 = input => "string" === typeof input.message && (undefined === input.type || "string" === typeof input.type) && (undefined === input.code || "string" === typeof input.code) && (undefined === input.exitCode || "number" === typeof input.exitCode) && (undefined === input.signalCode || "number" === typeof input.signalCode) && (undefined === input.statusCode || "number" === typeof input.statusCode) && (undefined === input.headers || "object" === typeof input.headers && null !== input.headers && false === Array.isArray(input.headers) && $io2(input.headers)) && (undefined === input.data || "object" === typeof input.data && null !== input.data && false === Array.isArray(input.data) && $io3(input.data)) && (null === input.cause || undefined === input.cause || "object" === typeof input.cause && null !== input.cause && $io1(input.cause)) && (null === input.errors || undefined === input.errors || Array.isArray(input.errors) && input.errors.every(elem => "object" === typeof elem && null !== elem && $io1(elem)));
|
|
770
|
+
const $io2 = input => Object.keys(input).every(key => {
|
|
771
|
+
const value = input[key];
|
|
772
|
+
if (undefined === value)
|
|
773
|
+
return true;
|
|
774
|
+
return "string" === typeof value;
|
|
775
|
+
});
|
|
776
|
+
const $io3 = input => true;
|
|
449
777
|
const $string = __typia.json.createAssertStringify.string;
|
|
450
|
-
const $
|
|
778
|
+
const $throws = __typia.json.createAssertStringify.throws;
|
|
779
|
+
const $so0 = input => `{"id":${$string(input.id)},"file":${$string(input.file)},"location":${$string(input.location)},"offset":${input.offset},"size":${null !== input.size ? input.size : "null"},"hash":${null !== input.hash ? $string(input.hash) : "null"},"btime":${null !== input.btime ? input.btime : "null"},"path":${null !== input.path ? $string(input.path) : "null"},"error":${null !== input.error ? (() => {
|
|
780
|
+
if (Array.isArray(input.error))
|
|
781
|
+
return `[${input.error.map(elem => $so1(elem)).join(",")}]`;
|
|
782
|
+
if ("object" === typeof input.error && null !== input.error)
|
|
783
|
+
return $so1(input.error);
|
|
784
|
+
$throws({
|
|
785
|
+
expected: "(Array<NxtError> | NxtError | null)",
|
|
786
|
+
value: input.error
|
|
787
|
+
});
|
|
788
|
+
})() : "null"}}`;
|
|
789
|
+
const $so1 = input => `{${undefined === input.type ? "" : `"type":${undefined !== input.type ? $string(input.type) : undefined},`}${undefined === input.code ? "" : `"code":${undefined !== input.code ? $string(input.code) : undefined},`}${undefined === input.exitCode ? "" : `"exitCode":${undefined !== input.exitCode ? input.exitCode : undefined},`}${undefined === input.signalCode ? "" : `"signalCode":${undefined !== input.signalCode ? input.signalCode : undefined},`}${undefined === input.statusCode ? "" : `"statusCode":${undefined !== input.statusCode ? input.statusCode : undefined},`}${undefined === input.headers ? "" : `"headers":${undefined !== input.headers ? $so2(input.headers) : undefined},`}${undefined === input.data ? "" : `"data":${undefined !== input.data ? "{}" : undefined},`}${undefined === input.cause ? "" : `"cause":${undefined !== input.cause ? null !== input.cause ? $so1(input.cause) : "null" : undefined},`}${undefined === input.errors ? "" : `"errors":${undefined !== input.errors ? null !== input.errors ? `[${input.errors.map(elem => $so1(elem)).join(",")}]` : "null" : undefined},`}"message":${$string(input.message)}}`;
|
|
790
|
+
const $so2 = input => `{${Object.entries(input).map(([key, value]) => { if (undefined === value)
|
|
791
|
+
return ""; return `${JSON.stringify(key)}:${$string(value)}`; }).filter(str => "" !== str).join(",")}}`;
|
|
451
792
|
return $so0(input);
|
|
452
793
|
}; return stringify(assert(input, errorFactory)); };
|
|
453
794
|
export const isBlocks = input => {
|
|
454
|
-
const $io0 = input => "string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) && ("string" === typeof input.file && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.file)) && ("string" === typeof input.location && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.location)) && ("number" === typeof input.offset && (0 <= input.offset && (Math.floor(input.offset) === input.offset && 0 <= input.offset && input.offset <= 18446744073709552000))) && (null === input.size || "number" === typeof input.size && (0 <= input.size && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 18446744073709552000))) && (null === input.hash || "string" === typeof input.hash && /^([A-Fa-f0-9]{32})?$/.test(input.hash)) && (null === input.btime || "number" === typeof input.btime && (0 <= input.btime && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 18446744073709552000))) && (null === input.path || "string" === typeof input.path) && (null === input.error || Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io1(elem)));
|
|
455
|
-
const $io1 = input => "string" === typeof input.message;
|
|
795
|
+
const $io0 = input => "string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) && ("string" === typeof input.file && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.file)) && ("string" === typeof input.location && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.location)) && ("number" === typeof input.offset && (0 <= input.offset && (Math.floor(input.offset) === input.offset && 0 <= input.offset && input.offset <= 18446744073709552000))) && (null === input.size || "number" === typeof input.size && (0 <= input.size && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 18446744073709552000))) && (null === input.hash || "string" === typeof input.hash && /^([A-Fa-f0-9]{32})?$/.test(input.hash)) && (null === input.btime || "number" === typeof input.btime && (0 <= input.btime && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 18446744073709552000))) && (null === input.path || "string" === typeof input.path) && (undefined !== input.error && (null === input.error || (Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io1(elem)) || "object" === typeof input.error && null !== input.error && $io1(input.error))));
|
|
796
|
+
const $io1 = input => "string" === typeof input.message && (undefined === input.type || "string" === typeof input.type) && (undefined === input.code || "string" === typeof input.code) && (undefined === input.exitCode || "number" === typeof input.exitCode) && (undefined === input.signalCode || "number" === typeof input.signalCode) && (undefined === input.statusCode || "number" === typeof input.statusCode) && (undefined === input.headers || "object" === typeof input.headers && null !== input.headers && false === Array.isArray(input.headers) && $io2(input.headers)) && (undefined === input.data || "object" === typeof input.data && null !== input.data && false === Array.isArray(input.data) && $io3(input.data)) && (null === input.cause || undefined === input.cause || "object" === typeof input.cause && null !== input.cause && $io1(input.cause)) && (null === input.errors || undefined === input.errors || Array.isArray(input.errors) && input.errors.every(elem => "object" === typeof elem && null !== elem && $io1(elem)));
|
|
797
|
+
const $io2 = input => Object.keys(input).every(key => {
|
|
798
|
+
const value = input[key];
|
|
799
|
+
if (undefined === value)
|
|
800
|
+
return true;
|
|
801
|
+
return "string" === typeof value;
|
|
802
|
+
});
|
|
803
|
+
const $io3 = input => true;
|
|
456
804
|
return Array.isArray(input) && input.every(elem => "object" === typeof elem && null !== elem && $io0(elem));
|
|
457
805
|
};
|
|
458
806
|
export const assertBlocks = (input, errorFactory) => {
|
|
459
807
|
const __is = input => {
|
|
460
|
-
const $io0 = input => "string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) && ("string" === typeof input.file && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.file)) && ("string" === typeof input.location && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.location)) && ("number" === typeof input.offset && (0 <= input.offset && (Math.floor(input.offset) === input.offset && 0 <= input.offset && input.offset <= 18446744073709552000))) && (null === input.size || "number" === typeof input.size && (0 <= input.size && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 18446744073709552000))) && (null === input.hash || "string" === typeof input.hash && /^([A-Fa-f0-9]{32})?$/.test(input.hash)) && (null === input.btime || "number" === typeof input.btime && (0 <= input.btime && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 18446744073709552000))) && (null === input.path || "string" === typeof input.path) && (null === input.error || Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io1(elem)));
|
|
461
|
-
const $io1 = input => "string" === typeof input.message;
|
|
808
|
+
const $io0 = input => "string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) && ("string" === typeof input.file && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.file)) && ("string" === typeof input.location && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.location)) && ("number" === typeof input.offset && (0 <= input.offset && (Math.floor(input.offset) === input.offset && 0 <= input.offset && input.offset <= 18446744073709552000))) && (null === input.size || "number" === typeof input.size && (0 <= input.size && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 18446744073709552000))) && (null === input.hash || "string" === typeof input.hash && /^([A-Fa-f0-9]{32})?$/.test(input.hash)) && (null === input.btime || "number" === typeof input.btime && (0 <= input.btime && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 18446744073709552000))) && (null === input.path || "string" === typeof input.path) && (undefined !== input.error && (null === input.error || (Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io1(elem)) || "object" === typeof input.error && null !== input.error && $io1(input.error))));
|
|
809
|
+
const $io1 = input => "string" === typeof input.message && (undefined === input.type || "string" === typeof input.type) && (undefined === input.code || "string" === typeof input.code) && (undefined === input.exitCode || "number" === typeof input.exitCode) && (undefined === input.signalCode || "number" === typeof input.signalCode) && (undefined === input.statusCode || "number" === typeof input.statusCode) && (undefined === input.headers || "object" === typeof input.headers && null !== input.headers && false === Array.isArray(input.headers) && $io2(input.headers)) && (undefined === input.data || "object" === typeof input.data && null !== input.data && false === Array.isArray(input.data) && $io3(input.data)) && (null === input.cause || undefined === input.cause || "object" === typeof input.cause && null !== input.cause && $io1(input.cause)) && (null === input.errors || undefined === input.errors || Array.isArray(input.errors) && input.errors.every(elem => "object" === typeof elem && null !== elem && $io1(elem)));
|
|
810
|
+
const $io2 = input => Object.keys(input).every(key => {
|
|
811
|
+
const value = input[key];
|
|
812
|
+
if (undefined === value)
|
|
813
|
+
return true;
|
|
814
|
+
return "string" === typeof value;
|
|
815
|
+
});
|
|
816
|
+
const $io3 = input => true;
|
|
462
817
|
return Array.isArray(input) && input.every(elem => "object" === typeof elem && null !== elem && $io0(elem));
|
|
463
818
|
};
|
|
464
819
|
if (false === __is(input))
|
|
465
820
|
((input, _path, _exceptionable = true) => {
|
|
466
821
|
const $guard = __typia.createAssert.guard;
|
|
822
|
+
const $join = __typia.createAssert.join;
|
|
467
823
|
const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.id && (/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) || $guard(_exceptionable, {
|
|
468
824
|
path: _path + ".id",
|
|
469
825
|
expected: "string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
|
|
@@ -536,28 +892,103 @@ export const assertBlocks = (input, errorFactory) => {
|
|
|
536
892
|
path: _path + ".path",
|
|
537
893
|
expected: "(null | string)",
|
|
538
894
|
value: input.path
|
|
539
|
-
}, errorFactory)) && (
|
|
895
|
+
}, errorFactory)) && ((undefined !== input.error || $guard(_exceptionable, {
|
|
540
896
|
path: _path + ".error",
|
|
541
|
-
expected: "(Array<
|
|
897
|
+
expected: "(Array<NxtError> | NxtError | null)",
|
|
542
898
|
value: input.error
|
|
543
|
-
}, errorFactory)) && input.error.every((elem, _index2) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
|
|
899
|
+
}, errorFactory)) && (null === input.error || (Array.isArray(input.error) && input.error.every((elem, _index2) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
|
|
544
900
|
path: _path + ".error[" + _index2 + "]",
|
|
545
|
-
expected: "
|
|
901
|
+
expected: "NxtError",
|
|
546
902
|
value: elem
|
|
547
903
|
}, errorFactory)) && $ao1(elem, _path + ".error[" + _index2 + "]", true && _exceptionable) || $guard(_exceptionable, {
|
|
548
904
|
path: _path + ".error[" + _index2 + "]",
|
|
549
|
-
expected: "
|
|
905
|
+
expected: "NxtError",
|
|
550
906
|
value: elem
|
|
907
|
+
}, errorFactory)) || "object" === typeof input.error && null !== input.error && $ao1(input.error, _path + ".error", true && _exceptionable) || $guard(_exceptionable, {
|
|
908
|
+
path: _path + ".error",
|
|
909
|
+
expected: "(Array<NxtError> | NxtError | null)",
|
|
910
|
+
value: input.error
|
|
551
911
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
552
912
|
path: _path + ".error",
|
|
553
|
-
expected: "(Array<
|
|
913
|
+
expected: "(Array<NxtError> | NxtError | null)",
|
|
554
914
|
value: input.error
|
|
555
|
-
}, errorFactory));
|
|
556
|
-
const $ao1 = (input, _path, _exceptionable = true) => "string" === typeof input.message || $guard(_exceptionable, {
|
|
915
|
+
}, errorFactory)));
|
|
916
|
+
const $ao1 = (input, _path, _exceptionable = true) => ("string" === typeof input.message || $guard(_exceptionable, {
|
|
557
917
|
path: _path + ".message",
|
|
558
918
|
expected: "string",
|
|
559
919
|
value: input.message
|
|
560
|
-
}, errorFactory)
|
|
920
|
+
}, errorFactory)) && (undefined === input.type || "string" === typeof input.type || $guard(_exceptionable, {
|
|
921
|
+
path: _path + ".type",
|
|
922
|
+
expected: "(string | undefined)",
|
|
923
|
+
value: input.type
|
|
924
|
+
}, errorFactory)) && (undefined === input.code || "string" === typeof input.code || $guard(_exceptionable, {
|
|
925
|
+
path: _path + ".code",
|
|
926
|
+
expected: "(string | undefined)",
|
|
927
|
+
value: input.code
|
|
928
|
+
}, errorFactory)) && (undefined === input.exitCode || "number" === typeof input.exitCode || $guard(_exceptionable, {
|
|
929
|
+
path: _path + ".exitCode",
|
|
930
|
+
expected: "(number | undefined)",
|
|
931
|
+
value: input.exitCode
|
|
932
|
+
}, errorFactory)) && (undefined === input.signalCode || "number" === typeof input.signalCode || $guard(_exceptionable, {
|
|
933
|
+
path: _path + ".signalCode",
|
|
934
|
+
expected: "(number | undefined)",
|
|
935
|
+
value: input.signalCode
|
|
936
|
+
}, errorFactory)) && (undefined === input.statusCode || "number" === typeof input.statusCode || $guard(_exceptionable, {
|
|
937
|
+
path: _path + ".statusCode",
|
|
938
|
+
expected: "(number | undefined)",
|
|
939
|
+
value: input.statusCode
|
|
940
|
+
}, errorFactory)) && (undefined === input.headers || ("object" === typeof input.headers && null !== input.headers && false === Array.isArray(input.headers) || $guard(_exceptionable, {
|
|
941
|
+
path: _path + ".headers",
|
|
942
|
+
expected: "(Record<string, string> | undefined)",
|
|
943
|
+
value: input.headers
|
|
944
|
+
}, errorFactory)) && $ao2(input.headers, _path + ".headers", true && _exceptionable) || $guard(_exceptionable, {
|
|
945
|
+
path: _path + ".headers",
|
|
946
|
+
expected: "(Record<string, string> | undefined)",
|
|
947
|
+
value: input.headers
|
|
948
|
+
}, errorFactory)) && (undefined === input.data || ("object" === typeof input.data && null !== input.data && false === Array.isArray(input.data) || $guard(_exceptionable, {
|
|
949
|
+
path: _path + ".data",
|
|
950
|
+
expected: "(object | undefined)",
|
|
951
|
+
value: input.data
|
|
952
|
+
}, errorFactory)) && $ao3(input.data, _path + ".data", true && _exceptionable) || $guard(_exceptionable, {
|
|
953
|
+
path: _path + ".data",
|
|
954
|
+
expected: "(object | undefined)",
|
|
955
|
+
value: input.data
|
|
956
|
+
}, errorFactory)) && (null === input.cause || undefined === input.cause || ("object" === typeof input.cause && null !== input.cause || $guard(_exceptionable, {
|
|
957
|
+
path: _path + ".cause",
|
|
958
|
+
expected: "(NxtError | null | undefined)",
|
|
959
|
+
value: input.cause
|
|
960
|
+
}, errorFactory)) && $ao1(input.cause, _path + ".cause", true && _exceptionable) || $guard(_exceptionable, {
|
|
961
|
+
path: _path + ".cause",
|
|
962
|
+
expected: "(NxtError | null | undefined)",
|
|
963
|
+
value: input.cause
|
|
964
|
+
}, errorFactory)) && (null === input.errors || undefined === input.errors || (Array.isArray(input.errors) || $guard(_exceptionable, {
|
|
965
|
+
path: _path + ".errors",
|
|
966
|
+
expected: "(Array<NxtError> | null | undefined)",
|
|
967
|
+
value: input.errors
|
|
968
|
+
}, errorFactory)) && input.errors.every((elem, _index3) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
|
|
969
|
+
path: _path + ".errors[" + _index3 + "]",
|
|
970
|
+
expected: "NxtError",
|
|
971
|
+
value: elem
|
|
972
|
+
}, errorFactory)) && $ao1(elem, _path + ".errors[" + _index3 + "]", true && _exceptionable) || $guard(_exceptionable, {
|
|
973
|
+
path: _path + ".errors[" + _index3 + "]",
|
|
974
|
+
expected: "NxtError",
|
|
975
|
+
value: elem
|
|
976
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
977
|
+
path: _path + ".errors",
|
|
978
|
+
expected: "(Array<NxtError> | null | undefined)",
|
|
979
|
+
value: input.errors
|
|
980
|
+
}, errorFactory));
|
|
981
|
+
const $ao2 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
|
|
982
|
+
const value = input[key];
|
|
983
|
+
if (undefined === value)
|
|
984
|
+
return true;
|
|
985
|
+
return "string" === typeof value || $guard(_exceptionable, {
|
|
986
|
+
path: _path + $join(key),
|
|
987
|
+
expected: "string",
|
|
988
|
+
value: value
|
|
989
|
+
}, errorFactory);
|
|
990
|
+
});
|
|
991
|
+
const $ao3 = (input, _path, _exceptionable = true) => true;
|
|
561
992
|
return (Array.isArray(input) || $guard(true, {
|
|
562
993
|
path: _path + "",
|
|
563
994
|
expected: "Blocks",
|
|
@@ -661,23 +1092,76 @@ export const randomBlocks = generator => {
|
|
|
661
1092
|
])(),
|
|
662
1093
|
error: $pick([
|
|
663
1094
|
() => null,
|
|
664
|
-
() => (generator?.array ?? $generator.array)(() => $ro1(_recursive, _recursive ? 1 + _depth : _depth))
|
|
1095
|
+
() => (generator?.array ?? $generator.array)(() => $ro1(_recursive, _recursive ? 1 + _depth : _depth)),
|
|
1096
|
+
() => $ro1(_recursive, _recursive ? 1 + _depth : _depth)
|
|
665
1097
|
])()
|
|
666
1098
|
});
|
|
667
|
-
const $ro1 = (_recursive =
|
|
668
|
-
message: (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()
|
|
1099
|
+
const $ro1 = (_recursive = true, _depth = 0) => ({
|
|
1100
|
+
message: (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)(),
|
|
1101
|
+
type: $pick([
|
|
1102
|
+
() => undefined,
|
|
1103
|
+
() => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()
|
|
1104
|
+
])(),
|
|
1105
|
+
code: $pick([
|
|
1106
|
+
() => undefined,
|
|
1107
|
+
() => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()
|
|
1108
|
+
])(),
|
|
1109
|
+
exitCode: $pick([
|
|
1110
|
+
() => undefined,
|
|
1111
|
+
() => (generator?.customs ?? $generator.customs)?.number?.([]) ?? (generator?.number ?? $generator.number)(0, 100)
|
|
1112
|
+
])(),
|
|
1113
|
+
signalCode: $pick([
|
|
1114
|
+
() => undefined,
|
|
1115
|
+
() => (generator?.customs ?? $generator.customs)?.number?.([]) ?? (generator?.number ?? $generator.number)(0, 100)
|
|
1116
|
+
])(),
|
|
1117
|
+
statusCode: $pick([
|
|
1118
|
+
() => undefined,
|
|
1119
|
+
() => (generator?.customs ?? $generator.customs)?.number?.([]) ?? (generator?.number ?? $generator.number)(0, 100)
|
|
1120
|
+
])(),
|
|
1121
|
+
headers: $pick([
|
|
1122
|
+
() => undefined,
|
|
1123
|
+
() => $ro2(true, _recursive ? 1 + _depth : _depth)
|
|
1124
|
+
])(),
|
|
1125
|
+
data: $pick([
|
|
1126
|
+
() => undefined,
|
|
1127
|
+
() => $ro3(true, _recursive ? 1 + _depth : _depth)
|
|
1128
|
+
])(),
|
|
1129
|
+
cause: $pick([
|
|
1130
|
+
() => undefined,
|
|
1131
|
+
() => null,
|
|
1132
|
+
() => $ro1(true, _recursive ? 1 + _depth : _depth)
|
|
1133
|
+
])(),
|
|
1134
|
+
errors: $pick([
|
|
1135
|
+
() => undefined,
|
|
1136
|
+
() => null,
|
|
1137
|
+
() => _recursive && 5 < _depth ? [] : 5 >= _depth ? (generator?.array ?? $generator.array)(() => $ro1(true, _recursive ? 1 + _depth : _depth)) : []
|
|
1138
|
+
])()
|
|
669
1139
|
});
|
|
1140
|
+
const $ro2 = (_recursive = false, _depth = 0) => {
|
|
1141
|
+
const output = {};
|
|
1142
|
+
(generator?.array ?? $generator.array)(() => output[(generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()] = (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)(), (generator?.integer ?? $generator.integer)(0, 3));
|
|
1143
|
+
return output;
|
|
1144
|
+
};
|
|
1145
|
+
const $ro3 = (_recursive = false, _depth = 0) => {};
|
|
670
1146
|
return (generator?.array ?? $generator.array)(() => $ro0());
|
|
671
1147
|
};
|
|
672
1148
|
export const assertGuardBlocks = (input, errorFactory) => {
|
|
673
1149
|
const __is = input => {
|
|
674
|
-
const $io0 = input => "string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) && ("string" === typeof input.file && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.file)) && ("string" === typeof input.location && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.location)) && ("number" === typeof input.offset && (0 <= input.offset && (Math.floor(input.offset) === input.offset && 0 <= input.offset && input.offset <= 18446744073709552000))) && (null === input.size || "number" === typeof input.size && (0 <= input.size && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 18446744073709552000))) && (null === input.hash || "string" === typeof input.hash && /^([A-Fa-f0-9]{32})?$/.test(input.hash)) && (null === input.btime || "number" === typeof input.btime && (0 <= input.btime && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 18446744073709552000))) && (null === input.path || "string" === typeof input.path) && (null === input.error || Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io1(elem)));
|
|
675
|
-
const $io1 = input => "string" === typeof input.message;
|
|
1150
|
+
const $io0 = input => "string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) && ("string" === typeof input.file && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.file)) && ("string" === typeof input.location && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.location)) && ("number" === typeof input.offset && (0 <= input.offset && (Math.floor(input.offset) === input.offset && 0 <= input.offset && input.offset <= 18446744073709552000))) && (null === input.size || "number" === typeof input.size && (0 <= input.size && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 18446744073709552000))) && (null === input.hash || "string" === typeof input.hash && /^([A-Fa-f0-9]{32})?$/.test(input.hash)) && (null === input.btime || "number" === typeof input.btime && (0 <= input.btime && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 18446744073709552000))) && (null === input.path || "string" === typeof input.path) && (undefined !== input.error && (null === input.error || (Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io1(elem)) || "object" === typeof input.error && null !== input.error && $io1(input.error))));
|
|
1151
|
+
const $io1 = input => "string" === typeof input.message && (undefined === input.type || "string" === typeof input.type) && (undefined === input.code || "string" === typeof input.code) && (undefined === input.exitCode || "number" === typeof input.exitCode) && (undefined === input.signalCode || "number" === typeof input.signalCode) && (undefined === input.statusCode || "number" === typeof input.statusCode) && (undefined === input.headers || "object" === typeof input.headers && null !== input.headers && false === Array.isArray(input.headers) && $io2(input.headers)) && (undefined === input.data || "object" === typeof input.data && null !== input.data && false === Array.isArray(input.data) && $io3(input.data)) && (null === input.cause || undefined === input.cause || "object" === typeof input.cause && null !== input.cause && $io1(input.cause)) && (null === input.errors || undefined === input.errors || Array.isArray(input.errors) && input.errors.every(elem => "object" === typeof elem && null !== elem && $io1(elem)));
|
|
1152
|
+
const $io2 = input => Object.keys(input).every(key => {
|
|
1153
|
+
const value = input[key];
|
|
1154
|
+
if (undefined === value)
|
|
1155
|
+
return true;
|
|
1156
|
+
return "string" === typeof value;
|
|
1157
|
+
});
|
|
1158
|
+
const $io3 = input => true;
|
|
676
1159
|
return Array.isArray(input) && input.every(elem => "object" === typeof elem && null !== elem && $io0(elem));
|
|
677
1160
|
};
|
|
678
1161
|
if (false === __is(input))
|
|
679
1162
|
((input, _path, _exceptionable = true) => {
|
|
680
1163
|
const $guard = __typia.createAssertGuard.guard;
|
|
1164
|
+
const $join = __typia.createAssertGuard.join;
|
|
681
1165
|
const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.id && (/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) || $guard(_exceptionable, {
|
|
682
1166
|
path: _path + ".id",
|
|
683
1167
|
expected: "string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
|
|
@@ -750,28 +1234,103 @@ export const assertGuardBlocks = (input, errorFactory) => {
|
|
|
750
1234
|
path: _path + ".path",
|
|
751
1235
|
expected: "(null | string)",
|
|
752
1236
|
value: input.path
|
|
753
|
-
}, errorFactory)) && (
|
|
1237
|
+
}, errorFactory)) && ((undefined !== input.error || $guard(_exceptionable, {
|
|
754
1238
|
path: _path + ".error",
|
|
755
|
-
expected: "(Array<
|
|
1239
|
+
expected: "(Array<NxtError> | NxtError | null)",
|
|
756
1240
|
value: input.error
|
|
757
|
-
}, errorFactory)) && input.error.every((elem, _index2) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
|
|
1241
|
+
}, errorFactory)) && (null === input.error || (Array.isArray(input.error) && input.error.every((elem, _index2) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
|
|
758
1242
|
path: _path + ".error[" + _index2 + "]",
|
|
759
|
-
expected: "
|
|
1243
|
+
expected: "NxtError",
|
|
760
1244
|
value: elem
|
|
761
1245
|
}, errorFactory)) && $ao1(elem, _path + ".error[" + _index2 + "]", true && _exceptionable) || $guard(_exceptionable, {
|
|
762
1246
|
path: _path + ".error[" + _index2 + "]",
|
|
763
|
-
expected: "
|
|
1247
|
+
expected: "NxtError",
|
|
764
1248
|
value: elem
|
|
1249
|
+
}, errorFactory)) || "object" === typeof input.error && null !== input.error && $ao1(input.error, _path + ".error", true && _exceptionable) || $guard(_exceptionable, {
|
|
1250
|
+
path: _path + ".error",
|
|
1251
|
+
expected: "(Array<NxtError> | NxtError | null)",
|
|
1252
|
+
value: input.error
|
|
765
1253
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
766
1254
|
path: _path + ".error",
|
|
767
|
-
expected: "(Array<
|
|
1255
|
+
expected: "(Array<NxtError> | NxtError | null)",
|
|
768
1256
|
value: input.error
|
|
769
|
-
}, errorFactory));
|
|
770
|
-
const $ao1 = (input, _path, _exceptionable = true) => "string" === typeof input.message || $guard(_exceptionable, {
|
|
1257
|
+
}, errorFactory)));
|
|
1258
|
+
const $ao1 = (input, _path, _exceptionable = true) => ("string" === typeof input.message || $guard(_exceptionable, {
|
|
771
1259
|
path: _path + ".message",
|
|
772
1260
|
expected: "string",
|
|
773
1261
|
value: input.message
|
|
774
|
-
}, errorFactory)
|
|
1262
|
+
}, errorFactory)) && (undefined === input.type || "string" === typeof input.type || $guard(_exceptionable, {
|
|
1263
|
+
path: _path + ".type",
|
|
1264
|
+
expected: "(string | undefined)",
|
|
1265
|
+
value: input.type
|
|
1266
|
+
}, errorFactory)) && (undefined === input.code || "string" === typeof input.code || $guard(_exceptionable, {
|
|
1267
|
+
path: _path + ".code",
|
|
1268
|
+
expected: "(string | undefined)",
|
|
1269
|
+
value: input.code
|
|
1270
|
+
}, errorFactory)) && (undefined === input.exitCode || "number" === typeof input.exitCode || $guard(_exceptionable, {
|
|
1271
|
+
path: _path + ".exitCode",
|
|
1272
|
+
expected: "(number | undefined)",
|
|
1273
|
+
value: input.exitCode
|
|
1274
|
+
}, errorFactory)) && (undefined === input.signalCode || "number" === typeof input.signalCode || $guard(_exceptionable, {
|
|
1275
|
+
path: _path + ".signalCode",
|
|
1276
|
+
expected: "(number | undefined)",
|
|
1277
|
+
value: input.signalCode
|
|
1278
|
+
}, errorFactory)) && (undefined === input.statusCode || "number" === typeof input.statusCode || $guard(_exceptionable, {
|
|
1279
|
+
path: _path + ".statusCode",
|
|
1280
|
+
expected: "(number | undefined)",
|
|
1281
|
+
value: input.statusCode
|
|
1282
|
+
}, errorFactory)) && (undefined === input.headers || ("object" === typeof input.headers && null !== input.headers && false === Array.isArray(input.headers) || $guard(_exceptionable, {
|
|
1283
|
+
path: _path + ".headers",
|
|
1284
|
+
expected: "(Record<string, string> | undefined)",
|
|
1285
|
+
value: input.headers
|
|
1286
|
+
}, errorFactory)) && $ao2(input.headers, _path + ".headers", true && _exceptionable) || $guard(_exceptionable, {
|
|
1287
|
+
path: _path + ".headers",
|
|
1288
|
+
expected: "(Record<string, string> | undefined)",
|
|
1289
|
+
value: input.headers
|
|
1290
|
+
}, errorFactory)) && (undefined === input.data || ("object" === typeof input.data && null !== input.data && false === Array.isArray(input.data) || $guard(_exceptionable, {
|
|
1291
|
+
path: _path + ".data",
|
|
1292
|
+
expected: "(object | undefined)",
|
|
1293
|
+
value: input.data
|
|
1294
|
+
}, errorFactory)) && $ao3(input.data, _path + ".data", true && _exceptionable) || $guard(_exceptionable, {
|
|
1295
|
+
path: _path + ".data",
|
|
1296
|
+
expected: "(object | undefined)",
|
|
1297
|
+
value: input.data
|
|
1298
|
+
}, errorFactory)) && (null === input.cause || undefined === input.cause || ("object" === typeof input.cause && null !== input.cause || $guard(_exceptionable, {
|
|
1299
|
+
path: _path + ".cause",
|
|
1300
|
+
expected: "(NxtError | null | undefined)",
|
|
1301
|
+
value: input.cause
|
|
1302
|
+
}, errorFactory)) && $ao1(input.cause, _path + ".cause", true && _exceptionable) || $guard(_exceptionable, {
|
|
1303
|
+
path: _path + ".cause",
|
|
1304
|
+
expected: "(NxtError | null | undefined)",
|
|
1305
|
+
value: input.cause
|
|
1306
|
+
}, errorFactory)) && (null === input.errors || undefined === input.errors || (Array.isArray(input.errors) || $guard(_exceptionable, {
|
|
1307
|
+
path: _path + ".errors",
|
|
1308
|
+
expected: "(Array<NxtError> | null | undefined)",
|
|
1309
|
+
value: input.errors
|
|
1310
|
+
}, errorFactory)) && input.errors.every((elem, _index3) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
|
|
1311
|
+
path: _path + ".errors[" + _index3 + "]",
|
|
1312
|
+
expected: "NxtError",
|
|
1313
|
+
value: elem
|
|
1314
|
+
}, errorFactory)) && $ao1(elem, _path + ".errors[" + _index3 + "]", true && _exceptionable) || $guard(_exceptionable, {
|
|
1315
|
+
path: _path + ".errors[" + _index3 + "]",
|
|
1316
|
+
expected: "NxtError",
|
|
1317
|
+
value: elem
|
|
1318
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
1319
|
+
path: _path + ".errors",
|
|
1320
|
+
expected: "(Array<NxtError> | null | undefined)",
|
|
1321
|
+
value: input.errors
|
|
1322
|
+
}, errorFactory));
|
|
1323
|
+
const $ao2 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
|
|
1324
|
+
const value = input[key];
|
|
1325
|
+
if (undefined === value)
|
|
1326
|
+
return true;
|
|
1327
|
+
return "string" === typeof value || $guard(_exceptionable, {
|
|
1328
|
+
path: _path + $join(key),
|
|
1329
|
+
expected: "string",
|
|
1330
|
+
value: value
|
|
1331
|
+
}, errorFactory);
|
|
1332
|
+
});
|
|
1333
|
+
const $ao3 = (input, _path, _exceptionable = true) => true;
|
|
775
1334
|
return (Array.isArray(input) || $guard(true, {
|
|
776
1335
|
path: _path + "",
|
|
777
1336
|
expected: "Blocks",
|
|
@@ -792,20 +1351,48 @@ export const assertGuardBlocks = (input, errorFactory) => {
|
|
|
792
1351
|
})(input, "$input", true);
|
|
793
1352
|
};
|
|
794
1353
|
export const stringifyBlocks = input => {
|
|
795
|
-
const $io1 = input => "string" === typeof input.message;
|
|
1354
|
+
const $io1 = input => "string" === typeof input.message && (undefined === input.type || "string" === typeof input.type) && (undefined === input.code || "string" === typeof input.code) && (undefined === input.exitCode || "number" === typeof input.exitCode) && (undefined === input.signalCode || "number" === typeof input.signalCode) && (undefined === input.statusCode || "number" === typeof input.statusCode) && (undefined === input.headers || "object" === typeof input.headers && null !== input.headers && false === Array.isArray(input.headers) && $io2(input.headers)) && (undefined === input.data || "object" === typeof input.data && null !== input.data && false === Array.isArray(input.data) && $io3(input.data)) && (null === input.cause || undefined === input.cause || "object" === typeof input.cause && null !== input.cause && $io1(input.cause)) && (null === input.errors || undefined === input.errors || Array.isArray(input.errors) && input.errors.every(elem => "object" === typeof elem && null !== elem && $io1(elem)));
|
|
1355
|
+
const $io2 = input => Object.keys(input).every(key => {
|
|
1356
|
+
const value = input[key];
|
|
1357
|
+
if (undefined === value)
|
|
1358
|
+
return true;
|
|
1359
|
+
return "string" === typeof value;
|
|
1360
|
+
});
|
|
1361
|
+
const $io3 = input => true;
|
|
796
1362
|
const $string = __typia.json.createStringify.string;
|
|
797
|
-
const $
|
|
1363
|
+
const $throws = __typia.json.createStringify.throws;
|
|
1364
|
+
const $so0 = input => `{"id":${$string(input.id)},"file":${$string(input.file)},"location":${$string(input.location)},"offset":${input.offset},"size":${null !== input.size ? input.size : "null"},"hash":${null !== input.hash ? $string(input.hash) : "null"},"btime":${null !== input.btime ? input.btime : "null"},"path":${null !== input.path ? $string(input.path) : "null"},"error":${null !== input.error ? (() => {
|
|
1365
|
+
if (Array.isArray(input.error))
|
|
1366
|
+
return `[${input.error.map(elem => $so1(elem)).join(",")}]`;
|
|
1367
|
+
if ("object" === typeof input.error && null !== input.error)
|
|
1368
|
+
return $so1(input.error);
|
|
1369
|
+
$throws({
|
|
1370
|
+
expected: "(Array<NxtError> | NxtError | null)",
|
|
1371
|
+
value: input.error
|
|
1372
|
+
});
|
|
1373
|
+
})() : "null"}}`;
|
|
1374
|
+
const $so1 = input => `{${undefined === input.type ? "" : `"type":${undefined !== input.type ? $string(input.type) : undefined},`}${undefined === input.code ? "" : `"code":${undefined !== input.code ? $string(input.code) : undefined},`}${undefined === input.exitCode ? "" : `"exitCode":${undefined !== input.exitCode ? input.exitCode : undefined},`}${undefined === input.signalCode ? "" : `"signalCode":${undefined !== input.signalCode ? input.signalCode : undefined},`}${undefined === input.statusCode ? "" : `"statusCode":${undefined !== input.statusCode ? input.statusCode : undefined},`}${undefined === input.headers ? "" : `"headers":${undefined !== input.headers ? $so2(input.headers) : undefined},`}${undefined === input.data ? "" : `"data":${undefined !== input.data ? "{}" : undefined},`}${undefined === input.cause ? "" : `"cause":${undefined !== input.cause ? null !== input.cause ? $so1(input.cause) : "null" : undefined},`}${undefined === input.errors ? "" : `"errors":${undefined !== input.errors ? null !== input.errors ? `[${input.errors.map(elem => $so1(elem)).join(",")}]` : "null" : undefined},`}"message":${$string(input.message)}}`;
|
|
1375
|
+
const $so2 = input => `{${Object.entries(input).map(([key, value]) => { if (undefined === value)
|
|
1376
|
+
return ""; return `${JSON.stringify(key)}:${$string(value)}`; }).filter(str => "" !== str).join(",")}}`;
|
|
798
1377
|
return `[${input.map(elem => $so0(elem)).join(",")}]`;
|
|
799
1378
|
};
|
|
800
1379
|
export const assertStringifyBlocks = (input, errorFactory) => { const assert = (input, errorFactory) => {
|
|
801
1380
|
const __is = input => {
|
|
802
|
-
const $io0 = input => "string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) && ("string" === typeof input.file && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.file)) && ("string" === typeof input.location && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.location)) && ("number" === typeof input.offset && (0 <= input.offset && (Math.floor(input.offset) === input.offset && 0 <= input.offset && input.offset <= 18446744073709552000))) && (null === input.size || "number" === typeof input.size && (0 <= input.size && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 18446744073709552000))) && (null === input.hash || "string" === typeof input.hash && /^([A-Fa-f0-9]{32})?$/.test(input.hash)) && (null === input.btime || "number" === typeof input.btime && (0 <= input.btime && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 18446744073709552000))) && (null === input.path || "string" === typeof input.path) && (null === input.error || Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io1(elem)));
|
|
803
|
-
const $io1 = input => "string" === typeof input.message;
|
|
1381
|
+
const $io0 = input => "string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) && ("string" === typeof input.file && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.file)) && ("string" === typeof input.location && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.location)) && ("number" === typeof input.offset && (0 <= input.offset && (Math.floor(input.offset) === input.offset && 0 <= input.offset && input.offset <= 18446744073709552000))) && (null === input.size || "number" === typeof input.size && (0 <= input.size && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 18446744073709552000))) && (null === input.hash || "string" === typeof input.hash && /^([A-Fa-f0-9]{32})?$/.test(input.hash)) && (null === input.btime || "number" === typeof input.btime && (0 <= input.btime && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 18446744073709552000))) && (null === input.path || "string" === typeof input.path) && (undefined !== input.error && (null === input.error || (Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io1(elem)) || "object" === typeof input.error && null !== input.error && $io1(input.error))));
|
|
1382
|
+
const $io1 = input => "string" === typeof input.message && (undefined === input.type || "string" === typeof input.type) && (undefined === input.code || "string" === typeof input.code) && (undefined === input.exitCode || "number" === typeof input.exitCode && !Number.isNaN(input.exitCode)) && (undefined === input.signalCode || "number" === typeof input.signalCode && !Number.isNaN(input.signalCode)) && (undefined === input.statusCode || "number" === typeof input.statusCode && !Number.isNaN(input.statusCode)) && (undefined === input.headers || "object" === typeof input.headers && null !== input.headers && false === Array.isArray(input.headers) && $io2(input.headers)) && (undefined === input.data || "object" === typeof input.data && null !== input.data && false === Array.isArray(input.data) && $io3(input.data)) && (null === input.cause || undefined === input.cause || "object" === typeof input.cause && null !== input.cause && $io1(input.cause)) && (null === input.errors || undefined === input.errors || Array.isArray(input.errors) && input.errors.every(elem => "object" === typeof elem && null !== elem && $io1(elem)));
|
|
1383
|
+
const $io2 = input => Object.keys(input).every(key => {
|
|
1384
|
+
const value = input[key];
|
|
1385
|
+
if (undefined === value)
|
|
1386
|
+
return true;
|
|
1387
|
+
return "string" === typeof value;
|
|
1388
|
+
});
|
|
1389
|
+
const $io3 = input => true;
|
|
804
1390
|
return Array.isArray(input) && input.every(elem => "object" === typeof elem && null !== elem && $io0(elem));
|
|
805
1391
|
};
|
|
806
1392
|
if (false === __is(input))
|
|
807
1393
|
((input, _path, _exceptionable = true) => {
|
|
808
1394
|
const $guard = __typia.json.createAssertStringify.guard;
|
|
1395
|
+
const $join = __typia.json.createAssertStringify.join;
|
|
809
1396
|
const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.id && (/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) || $guard(_exceptionable, {
|
|
810
1397
|
path: _path + ".id",
|
|
811
1398
|
expected: "string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
|
|
@@ -878,28 +1465,103 @@ export const assertStringifyBlocks = (input, errorFactory) => { const assert = (
|
|
|
878
1465
|
path: _path + ".path",
|
|
879
1466
|
expected: "(null | string)",
|
|
880
1467
|
value: input.path
|
|
881
|
-
}, errorFactory)) && (
|
|
1468
|
+
}, errorFactory)) && ((undefined !== input.error || $guard(_exceptionable, {
|
|
882
1469
|
path: _path + ".error",
|
|
883
|
-
expected: "(Array<
|
|
1470
|
+
expected: "(Array<NxtError> | NxtError | null)",
|
|
884
1471
|
value: input.error
|
|
885
|
-
}, errorFactory)) && input.error.every((elem, _index2) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
|
|
1472
|
+
}, errorFactory)) && (null === input.error || (Array.isArray(input.error) && input.error.every((elem, _index2) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
|
|
886
1473
|
path: _path + ".error[" + _index2 + "]",
|
|
887
|
-
expected: "
|
|
1474
|
+
expected: "NxtError",
|
|
888
1475
|
value: elem
|
|
889
1476
|
}, errorFactory)) && $ao1(elem, _path + ".error[" + _index2 + "]", true && _exceptionable) || $guard(_exceptionable, {
|
|
890
1477
|
path: _path + ".error[" + _index2 + "]",
|
|
891
|
-
expected: "
|
|
1478
|
+
expected: "NxtError",
|
|
892
1479
|
value: elem
|
|
1480
|
+
}, errorFactory)) || "object" === typeof input.error && null !== input.error && $ao1(input.error, _path + ".error", true && _exceptionable) || $guard(_exceptionable, {
|
|
1481
|
+
path: _path + ".error",
|
|
1482
|
+
expected: "(Array<NxtError> | NxtError | null)",
|
|
1483
|
+
value: input.error
|
|
893
1484
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
894
1485
|
path: _path + ".error",
|
|
895
|
-
expected: "(Array<
|
|
1486
|
+
expected: "(Array<NxtError> | NxtError | null)",
|
|
896
1487
|
value: input.error
|
|
897
|
-
}, errorFactory));
|
|
898
|
-
const $ao1 = (input, _path, _exceptionable = true) => "string" === typeof input.message || $guard(_exceptionable, {
|
|
1488
|
+
}, errorFactory)));
|
|
1489
|
+
const $ao1 = (input, _path, _exceptionable = true) => ("string" === typeof input.message || $guard(_exceptionable, {
|
|
899
1490
|
path: _path + ".message",
|
|
900
1491
|
expected: "string",
|
|
901
1492
|
value: input.message
|
|
902
|
-
}, errorFactory)
|
|
1493
|
+
}, errorFactory)) && (undefined === input.type || "string" === typeof input.type || $guard(_exceptionable, {
|
|
1494
|
+
path: _path + ".type",
|
|
1495
|
+
expected: "(string | undefined)",
|
|
1496
|
+
value: input.type
|
|
1497
|
+
}, errorFactory)) && (undefined === input.code || "string" === typeof input.code || $guard(_exceptionable, {
|
|
1498
|
+
path: _path + ".code",
|
|
1499
|
+
expected: "(string | undefined)",
|
|
1500
|
+
value: input.code
|
|
1501
|
+
}, errorFactory)) && (undefined === input.exitCode || "number" === typeof input.exitCode && !Number.isNaN(input.exitCode) || $guard(_exceptionable, {
|
|
1502
|
+
path: _path + ".exitCode",
|
|
1503
|
+
expected: "(number | undefined)",
|
|
1504
|
+
value: input.exitCode
|
|
1505
|
+
}, errorFactory)) && (undefined === input.signalCode || "number" === typeof input.signalCode && !Number.isNaN(input.signalCode) || $guard(_exceptionable, {
|
|
1506
|
+
path: _path + ".signalCode",
|
|
1507
|
+
expected: "(number | undefined)",
|
|
1508
|
+
value: input.signalCode
|
|
1509
|
+
}, errorFactory)) && (undefined === input.statusCode || "number" === typeof input.statusCode && !Number.isNaN(input.statusCode) || $guard(_exceptionable, {
|
|
1510
|
+
path: _path + ".statusCode",
|
|
1511
|
+
expected: "(number | undefined)",
|
|
1512
|
+
value: input.statusCode
|
|
1513
|
+
}, errorFactory)) && (undefined === input.headers || ("object" === typeof input.headers && null !== input.headers && false === Array.isArray(input.headers) || $guard(_exceptionable, {
|
|
1514
|
+
path: _path + ".headers",
|
|
1515
|
+
expected: "(Record<string, string> | undefined)",
|
|
1516
|
+
value: input.headers
|
|
1517
|
+
}, errorFactory)) && $ao2(input.headers, _path + ".headers", true && _exceptionable) || $guard(_exceptionable, {
|
|
1518
|
+
path: _path + ".headers",
|
|
1519
|
+
expected: "(Record<string, string> | undefined)",
|
|
1520
|
+
value: input.headers
|
|
1521
|
+
}, errorFactory)) && (undefined === input.data || ("object" === typeof input.data && null !== input.data && false === Array.isArray(input.data) || $guard(_exceptionable, {
|
|
1522
|
+
path: _path + ".data",
|
|
1523
|
+
expected: "(object | undefined)",
|
|
1524
|
+
value: input.data
|
|
1525
|
+
}, errorFactory)) && $ao3(input.data, _path + ".data", true && _exceptionable) || $guard(_exceptionable, {
|
|
1526
|
+
path: _path + ".data",
|
|
1527
|
+
expected: "(object | undefined)",
|
|
1528
|
+
value: input.data
|
|
1529
|
+
}, errorFactory)) && (null === input.cause || undefined === input.cause || ("object" === typeof input.cause && null !== input.cause || $guard(_exceptionable, {
|
|
1530
|
+
path: _path + ".cause",
|
|
1531
|
+
expected: "(NxtError | null | undefined)",
|
|
1532
|
+
value: input.cause
|
|
1533
|
+
}, errorFactory)) && $ao1(input.cause, _path + ".cause", true && _exceptionable) || $guard(_exceptionable, {
|
|
1534
|
+
path: _path + ".cause",
|
|
1535
|
+
expected: "(NxtError | null | undefined)",
|
|
1536
|
+
value: input.cause
|
|
1537
|
+
}, errorFactory)) && (null === input.errors || undefined === input.errors || (Array.isArray(input.errors) || $guard(_exceptionable, {
|
|
1538
|
+
path: _path + ".errors",
|
|
1539
|
+
expected: "(Array<NxtError> | null | undefined)",
|
|
1540
|
+
value: input.errors
|
|
1541
|
+
}, errorFactory)) && input.errors.every((elem, _index3) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
|
|
1542
|
+
path: _path + ".errors[" + _index3 + "]",
|
|
1543
|
+
expected: "NxtError",
|
|
1544
|
+
value: elem
|
|
1545
|
+
}, errorFactory)) && $ao1(elem, _path + ".errors[" + _index3 + "]", true && _exceptionable) || $guard(_exceptionable, {
|
|
1546
|
+
path: _path + ".errors[" + _index3 + "]",
|
|
1547
|
+
expected: "NxtError",
|
|
1548
|
+
value: elem
|
|
1549
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
1550
|
+
path: _path + ".errors",
|
|
1551
|
+
expected: "(Array<NxtError> | null | undefined)",
|
|
1552
|
+
value: input.errors
|
|
1553
|
+
}, errorFactory));
|
|
1554
|
+
const $ao2 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
|
|
1555
|
+
const value = input[key];
|
|
1556
|
+
if (undefined === value)
|
|
1557
|
+
return true;
|
|
1558
|
+
return "string" === typeof value || $guard(_exceptionable, {
|
|
1559
|
+
path: _path + $join(key),
|
|
1560
|
+
expected: "string",
|
|
1561
|
+
value: value
|
|
1562
|
+
}, errorFactory);
|
|
1563
|
+
});
|
|
1564
|
+
const $ao3 = (input, _path, _exceptionable = true) => true;
|
|
903
1565
|
return (Array.isArray(input) || $guard(true, {
|
|
904
1566
|
path: _path + "",
|
|
905
1567
|
expected: "Blocks",
|
|
@@ -920,8 +1582,28 @@ export const assertStringifyBlocks = (input, errorFactory) => { const assert = (
|
|
|
920
1582
|
})(input, "$input", true);
|
|
921
1583
|
return input;
|
|
922
1584
|
}; const stringify = input => {
|
|
923
|
-
const $io1 = input => "string" === typeof input.message;
|
|
1585
|
+
const $io1 = input => "string" === typeof input.message && (undefined === input.type || "string" === typeof input.type) && (undefined === input.code || "string" === typeof input.code) && (undefined === input.exitCode || "number" === typeof input.exitCode) && (undefined === input.signalCode || "number" === typeof input.signalCode) && (undefined === input.statusCode || "number" === typeof input.statusCode) && (undefined === input.headers || "object" === typeof input.headers && null !== input.headers && false === Array.isArray(input.headers) && $io2(input.headers)) && (undefined === input.data || "object" === typeof input.data && null !== input.data && false === Array.isArray(input.data) && $io3(input.data)) && (null === input.cause || undefined === input.cause || "object" === typeof input.cause && null !== input.cause && $io1(input.cause)) && (null === input.errors || undefined === input.errors || Array.isArray(input.errors) && input.errors.every(elem => "object" === typeof elem && null !== elem && $io1(elem)));
|
|
1586
|
+
const $io2 = input => Object.keys(input).every(key => {
|
|
1587
|
+
const value = input[key];
|
|
1588
|
+
if (undefined === value)
|
|
1589
|
+
return true;
|
|
1590
|
+
return "string" === typeof value;
|
|
1591
|
+
});
|
|
1592
|
+
const $io3 = input => true;
|
|
924
1593
|
const $string = __typia.json.createAssertStringify.string;
|
|
925
|
-
const $
|
|
1594
|
+
const $throws = __typia.json.createAssertStringify.throws;
|
|
1595
|
+
const $so0 = input => `{"id":${$string(input.id)},"file":${$string(input.file)},"location":${$string(input.location)},"offset":${input.offset},"size":${null !== input.size ? input.size : "null"},"hash":${null !== input.hash ? $string(input.hash) : "null"},"btime":${null !== input.btime ? input.btime : "null"},"path":${null !== input.path ? $string(input.path) : "null"},"error":${null !== input.error ? (() => {
|
|
1596
|
+
if (Array.isArray(input.error))
|
|
1597
|
+
return `[${input.error.map(elem => $so1(elem)).join(",")}]`;
|
|
1598
|
+
if ("object" === typeof input.error && null !== input.error)
|
|
1599
|
+
return $so1(input.error);
|
|
1600
|
+
$throws({
|
|
1601
|
+
expected: "(Array<NxtError> | NxtError | null)",
|
|
1602
|
+
value: input.error
|
|
1603
|
+
});
|
|
1604
|
+
})() : "null"}}`;
|
|
1605
|
+
const $so1 = input => `{${undefined === input.type ? "" : `"type":${undefined !== input.type ? $string(input.type) : undefined},`}${undefined === input.code ? "" : `"code":${undefined !== input.code ? $string(input.code) : undefined},`}${undefined === input.exitCode ? "" : `"exitCode":${undefined !== input.exitCode ? input.exitCode : undefined},`}${undefined === input.signalCode ? "" : `"signalCode":${undefined !== input.signalCode ? input.signalCode : undefined},`}${undefined === input.statusCode ? "" : `"statusCode":${undefined !== input.statusCode ? input.statusCode : undefined},`}${undefined === input.headers ? "" : `"headers":${undefined !== input.headers ? $so2(input.headers) : undefined},`}${undefined === input.data ? "" : `"data":${undefined !== input.data ? "{}" : undefined},`}${undefined === input.cause ? "" : `"cause":${undefined !== input.cause ? null !== input.cause ? $so1(input.cause) : "null" : undefined},`}${undefined === input.errors ? "" : `"errors":${undefined !== input.errors ? null !== input.errors ? `[${input.errors.map(elem => $so1(elem)).join(",")}]` : "null" : undefined},`}"message":${$string(input.message)}}`;
|
|
1606
|
+
const $so2 = input => `{${Object.entries(input).map(([key, value]) => { if (undefined === value)
|
|
1607
|
+
return ""; return `${JSON.stringify(key)}:${$string(value)}`; }).filter(str => "" !== str).join(",")}}`;
|
|
926
1608
|
return `[${input.map(elem => $so0(elem)).join(",")}]`;
|
|
927
1609
|
}; return stringify(assert(input, errorFactory)); };
|