@nxtedition/types 1.6.1 → 1.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/common/block.d.ts +4 -13
- package/dist/common/block.js +148 -611
- package/dist/common/file.d.ts +6 -6
- package/dist/common/file.js +207 -185
- package/package.json +1 -1
package/dist/common/file.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import __typia from "typia";
|
|
2
2
|
export const isFile = input => {
|
|
3
|
-
const $io0 = input => "string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) && ("number" === typeof input.size && (0 <= input.size && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 18446744073709552000))) && "boolean" === typeof input.seekable && "boolean" === typeof input.deleted && (Array.isArray(input.refs) && input.refs.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $io1(elem))) && (Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem)) &&
|
|
3
|
+
const $io0 = input => "string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) && (null === input.size || "number" === typeof input.size && (0 <= input.size && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 18446744073709552000))) && "boolean" === typeof input.seekable && "boolean" === typeof input.deleted && (Array.isArray(input.refs) && input.refs.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $io1(elem))) && (Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem)) && "string" === typeof input.resumable && "string" === typeof input.mimeType && ("string" === typeof input.hash && /^([A-Fa-f0-9]{32})?$/.test(input.hash)) && ("number" === typeof input.btime && (0 <= input.btime && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 18446744073709552000))) && "boolean" === typeof input.completed && (null === input.error || Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io2(elem)));
|
|
4
4
|
const $io1 = input => (undefined === input.file || "string" === typeof input.file) && (undefined === input.offset || "number" === typeof input.offset) && (undefined === input.start || "number" === typeof input.start) && (undefined === input.end || "number" === typeof input.end);
|
|
5
5
|
const $io2 = input => "string" === typeof input.message;
|
|
6
6
|
return "object" === typeof input && null !== input && $io0(input);
|
|
7
7
|
};
|
|
8
8
|
export const assertFile = (input, errorFactory) => {
|
|
9
9
|
const __is = input => {
|
|
10
|
-
const $io0 = input => "string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) && ("number" === typeof input.size && (0 <= input.size && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 18446744073709552000))) && "boolean" === typeof input.seekable && "boolean" === typeof input.deleted && (Array.isArray(input.refs) && input.refs.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $io1(elem))) && (Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem)) &&
|
|
10
|
+
const $io0 = input => "string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) && (null === input.size || "number" === typeof input.size && (0 <= input.size && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 18446744073709552000))) && "boolean" === typeof input.seekable && "boolean" === typeof input.deleted && (Array.isArray(input.refs) && input.refs.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $io1(elem))) && (Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem)) && "string" === typeof input.resumable && "string" === typeof input.mimeType && ("string" === typeof input.hash && /^([A-Fa-f0-9]{32})?$/.test(input.hash)) && ("number" === typeof input.btime && (0 <= input.btime && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 18446744073709552000))) && "boolean" === typeof input.completed && (null === input.error || Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io2(elem)));
|
|
11
11
|
const $io1 = input => (undefined === input.file || "string" === typeof input.file) && (undefined === input.offset || "number" === typeof input.offset) && (undefined === input.start || "number" === typeof input.start) && (undefined === input.end || "number" === typeof input.end);
|
|
12
12
|
const $io2 = input => "string" === typeof input.message;
|
|
13
13
|
return "object" === typeof input && null !== input && $io0(input);
|
|
@@ -23,7 +23,7 @@ export const assertFile = (input, errorFactory) => {
|
|
|
23
23
|
path: _path + ".id",
|
|
24
24
|
expected: "(string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">)",
|
|
25
25
|
value: input.id
|
|
26
|
-
}, errorFactory)) && ("number" === typeof input.size && (0 <= input.size || $guard(_exceptionable, {
|
|
26
|
+
}, errorFactory)) && (null === input.size || "number" === typeof input.size && (0 <= input.size || $guard(_exceptionable, {
|
|
27
27
|
path: _path + ".size",
|
|
28
28
|
expected: "number & Minimum<0>",
|
|
29
29
|
value: input.size
|
|
@@ -33,7 +33,7 @@ export const assertFile = (input, errorFactory) => {
|
|
|
33
33
|
value: input.size
|
|
34
34
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
35
35
|
path: _path + ".size",
|
|
36
|
-
expected: "(number & Minimum<0> & Type<\"uint64\">)",
|
|
36
|
+
expected: "((number & Minimum<0> & Type<\"uint64\">) | null)",
|
|
37
37
|
value: input.size
|
|
38
38
|
}, errorFactory)) && ("boolean" === typeof input.seekable || $guard(_exceptionable, {
|
|
39
39
|
path: _path + ".seekable",
|
|
@@ -71,22 +71,6 @@ export const assertFile = (input, errorFactory) => {
|
|
|
71
71
|
path: _path + ".tags",
|
|
72
72
|
expected: "Array<string>",
|
|
73
73
|
value: input.tags
|
|
74
|
-
}, errorFactory)) && (null === input.error || (Array.isArray(input.error) || $guard(_exceptionable, {
|
|
75
|
-
path: _path + ".error",
|
|
76
|
-
expected: "(Array<__type>.o1 | null)",
|
|
77
|
-
value: input.error
|
|
78
|
-
}, errorFactory)) && input.error.every((elem, _index3) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
|
|
79
|
-
path: _path + ".error[" + _index3 + "]",
|
|
80
|
-
expected: "__type.o1",
|
|
81
|
-
value: elem
|
|
82
|
-
}, errorFactory)) && $ao2(elem, _path + ".error[" + _index3 + "]", true && _exceptionable) || $guard(_exceptionable, {
|
|
83
|
-
path: _path + ".error[" + _index3 + "]",
|
|
84
|
-
expected: "__type.o1",
|
|
85
|
-
value: elem
|
|
86
|
-
}, errorFactory)) || $guard(_exceptionable, {
|
|
87
|
-
path: _path + ".error",
|
|
88
|
-
expected: "(Array<__type>.o1 | null)",
|
|
89
|
-
value: input.error
|
|
90
74
|
}, errorFactory)) && ("string" === typeof input.resumable || $guard(_exceptionable, {
|
|
91
75
|
path: _path + ".resumable",
|
|
92
76
|
expected: "string",
|
|
@@ -115,6 +99,26 @@ export const assertFile = (input, errorFactory) => {
|
|
|
115
99
|
path: _path + ".btime",
|
|
116
100
|
expected: "(number & Minimum<0> & Type<\"uint64\">)",
|
|
117
101
|
value: input.btime
|
|
102
|
+
}, errorFactory)) && ("boolean" === typeof input.completed || $guard(_exceptionable, {
|
|
103
|
+
path: _path + ".completed",
|
|
104
|
+
expected: "boolean",
|
|
105
|
+
value: input.completed
|
|
106
|
+
}, errorFactory)) && (null === input.error || (Array.isArray(input.error) || $guard(_exceptionable, {
|
|
107
|
+
path: _path + ".error",
|
|
108
|
+
expected: "(Array<__type>.o1 | null)",
|
|
109
|
+
value: input.error
|
|
110
|
+
}, errorFactory)) && input.error.every((elem, _index3) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
|
|
111
|
+
path: _path + ".error[" + _index3 + "]",
|
|
112
|
+
expected: "__type.o1",
|
|
113
|
+
value: elem
|
|
114
|
+
}, errorFactory)) && $ao2(elem, _path + ".error[" + _index3 + "]", true && _exceptionable) || $guard(_exceptionable, {
|
|
115
|
+
path: _path + ".error[" + _index3 + "]",
|
|
116
|
+
expected: "__type.o1",
|
|
117
|
+
value: elem
|
|
118
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
119
|
+
path: _path + ".error",
|
|
120
|
+
expected: "(Array<__type>.o1 | null)",
|
|
121
|
+
value: input.error
|
|
118
122
|
}, errorFactory));
|
|
119
123
|
const $ao1 = (input, _path, _exceptionable = true) => (undefined === input.file || "string" === typeof input.file || $guard(_exceptionable, {
|
|
120
124
|
path: _path + ".file",
|
|
@@ -161,26 +165,25 @@ export const randomFile = generator => {
|
|
|
161
165
|
value: "^[0-9A-Za-z~][0-9A-Za-z~._: -]*$"
|
|
162
166
|
}
|
|
163
167
|
]) ?? (generator?.pattern ?? $generator.pattern)(/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/),
|
|
164
|
-
size:
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
168
|
+
size: $pick([
|
|
169
|
+
() => null,
|
|
170
|
+
() => (generator?.customs ?? $generator.customs)?.number?.([
|
|
171
|
+
{
|
|
172
|
+
name: "Minimum<0>",
|
|
173
|
+
kind: "minimum",
|
|
174
|
+
value: 0
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
name: "Type<\"uint64\">",
|
|
178
|
+
kind: "type",
|
|
179
|
+
value: "uint64"
|
|
180
|
+
}
|
|
181
|
+
]) ?? (generator?.integer ?? $generator.integer)(0, 10)
|
|
182
|
+
])(),
|
|
176
183
|
seekable: (generator?.boolean ?? $generator.boolean)(),
|
|
177
184
|
deleted: (generator?.boolean ?? $generator.boolean)(),
|
|
178
185
|
refs: (generator?.array ?? $generator.array)(() => $ro1(_recursive, _recursive ? 1 + _depth : _depth)),
|
|
179
186
|
tags: (generator?.array ?? $generator.array)(() => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()),
|
|
180
|
-
error: $pick([
|
|
181
|
-
() => null,
|
|
182
|
-
() => (generator?.array ?? $generator.array)(() => $ro2(_recursive, _recursive ? 1 + _depth : _depth))
|
|
183
|
-
])(),
|
|
184
187
|
resumable: (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)(),
|
|
185
188
|
mimeType: (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)(),
|
|
186
189
|
hash: (generator?.customs ?? $generator.customs)?.string?.([
|
|
@@ -201,7 +204,12 @@ export const randomFile = generator => {
|
|
|
201
204
|
kind: "type",
|
|
202
205
|
value: "uint64"
|
|
203
206
|
}
|
|
204
|
-
]) ?? (generator?.integer ?? $generator.integer)(0, 10)
|
|
207
|
+
]) ?? (generator?.integer ?? $generator.integer)(0, 10),
|
|
208
|
+
completed: (generator?.boolean ?? $generator.boolean)(),
|
|
209
|
+
error: $pick([
|
|
210
|
+
() => null,
|
|
211
|
+
() => (generator?.array ?? $generator.array)(() => $ro2(_recursive, _recursive ? 1 + _depth : _depth))
|
|
212
|
+
])()
|
|
205
213
|
});
|
|
206
214
|
const $ro1 = (_recursive = false, _depth = 0) => ({
|
|
207
215
|
file: $pick([
|
|
@@ -228,7 +236,7 @@ export const randomFile = generator => {
|
|
|
228
236
|
};
|
|
229
237
|
export const assertGuardFile = (input, errorFactory) => {
|
|
230
238
|
const __is = input => {
|
|
231
|
-
const $io0 = input => "string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) && ("number" === typeof input.size && (0 <= input.size && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 18446744073709552000))) && "boolean" === typeof input.seekable && "boolean" === typeof input.deleted && (Array.isArray(input.refs) && input.refs.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $io1(elem))) && (Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem)) &&
|
|
239
|
+
const $io0 = input => "string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) && (null === input.size || "number" === typeof input.size && (0 <= input.size && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 18446744073709552000))) && "boolean" === typeof input.seekable && "boolean" === typeof input.deleted && (Array.isArray(input.refs) && input.refs.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $io1(elem))) && (Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem)) && "string" === typeof input.resumable && "string" === typeof input.mimeType && ("string" === typeof input.hash && /^([A-Fa-f0-9]{32})?$/.test(input.hash)) && ("number" === typeof input.btime && (0 <= input.btime && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 18446744073709552000))) && "boolean" === typeof input.completed && (null === input.error || Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io2(elem)));
|
|
232
240
|
const $io1 = input => (undefined === input.file || "string" === typeof input.file) && (undefined === input.offset || "number" === typeof input.offset) && (undefined === input.start || "number" === typeof input.start) && (undefined === input.end || "number" === typeof input.end);
|
|
233
241
|
const $io2 = input => "string" === typeof input.message;
|
|
234
242
|
return "object" === typeof input && null !== input && $io0(input);
|
|
@@ -244,7 +252,7 @@ export const assertGuardFile = (input, errorFactory) => {
|
|
|
244
252
|
path: _path + ".id",
|
|
245
253
|
expected: "(string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">)",
|
|
246
254
|
value: input.id
|
|
247
|
-
}, errorFactory)) && ("number" === typeof input.size && (0 <= input.size || $guard(_exceptionable, {
|
|
255
|
+
}, errorFactory)) && (null === input.size || "number" === typeof input.size && (0 <= input.size || $guard(_exceptionable, {
|
|
248
256
|
path: _path + ".size",
|
|
249
257
|
expected: "number & Minimum<0>",
|
|
250
258
|
value: input.size
|
|
@@ -254,7 +262,7 @@ export const assertGuardFile = (input, errorFactory) => {
|
|
|
254
262
|
value: input.size
|
|
255
263
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
256
264
|
path: _path + ".size",
|
|
257
|
-
expected: "(number & Minimum<0> & Type<\"uint64\">)",
|
|
265
|
+
expected: "((number & Minimum<0> & Type<\"uint64\">) | null)",
|
|
258
266
|
value: input.size
|
|
259
267
|
}, errorFactory)) && ("boolean" === typeof input.seekable || $guard(_exceptionable, {
|
|
260
268
|
path: _path + ".seekable",
|
|
@@ -292,22 +300,6 @@ export const assertGuardFile = (input, errorFactory) => {
|
|
|
292
300
|
path: _path + ".tags",
|
|
293
301
|
expected: "Array<string>",
|
|
294
302
|
value: input.tags
|
|
295
|
-
}, errorFactory)) && (null === input.error || (Array.isArray(input.error) || $guard(_exceptionable, {
|
|
296
|
-
path: _path + ".error",
|
|
297
|
-
expected: "(Array<__type>.o1 | null)",
|
|
298
|
-
value: input.error
|
|
299
|
-
}, errorFactory)) && input.error.every((elem, _index3) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
|
|
300
|
-
path: _path + ".error[" + _index3 + "]",
|
|
301
|
-
expected: "__type.o1",
|
|
302
|
-
value: elem
|
|
303
|
-
}, errorFactory)) && $ao2(elem, _path + ".error[" + _index3 + "]", true && _exceptionable) || $guard(_exceptionable, {
|
|
304
|
-
path: _path + ".error[" + _index3 + "]",
|
|
305
|
-
expected: "__type.o1",
|
|
306
|
-
value: elem
|
|
307
|
-
}, errorFactory)) || $guard(_exceptionable, {
|
|
308
|
-
path: _path + ".error",
|
|
309
|
-
expected: "(Array<__type>.o1 | null)",
|
|
310
|
-
value: input.error
|
|
311
303
|
}, errorFactory)) && ("string" === typeof input.resumable || $guard(_exceptionable, {
|
|
312
304
|
path: _path + ".resumable",
|
|
313
305
|
expected: "string",
|
|
@@ -336,6 +328,26 @@ export const assertGuardFile = (input, errorFactory) => {
|
|
|
336
328
|
path: _path + ".btime",
|
|
337
329
|
expected: "(number & Minimum<0> & Type<\"uint64\">)",
|
|
338
330
|
value: input.btime
|
|
331
|
+
}, errorFactory)) && ("boolean" === typeof input.completed || $guard(_exceptionable, {
|
|
332
|
+
path: _path + ".completed",
|
|
333
|
+
expected: "boolean",
|
|
334
|
+
value: input.completed
|
|
335
|
+
}, errorFactory)) && (null === input.error || (Array.isArray(input.error) || $guard(_exceptionable, {
|
|
336
|
+
path: _path + ".error",
|
|
337
|
+
expected: "(Array<__type>.o1 | null)",
|
|
338
|
+
value: input.error
|
|
339
|
+
}, errorFactory)) && input.error.every((elem, _index3) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
|
|
340
|
+
path: _path + ".error[" + _index3 + "]",
|
|
341
|
+
expected: "__type.o1",
|
|
342
|
+
value: elem
|
|
343
|
+
}, errorFactory)) && $ao2(elem, _path + ".error[" + _index3 + "]", true && _exceptionable) || $guard(_exceptionable, {
|
|
344
|
+
path: _path + ".error[" + _index3 + "]",
|
|
345
|
+
expected: "__type.o1",
|
|
346
|
+
value: elem
|
|
347
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
348
|
+
path: _path + ".error",
|
|
349
|
+
expected: "(Array<__type>.o1 | null)",
|
|
350
|
+
value: input.error
|
|
339
351
|
}, errorFactory));
|
|
340
352
|
const $ao1 = (input, _path, _exceptionable = true) => (undefined === input.file || "string" === typeof input.file || $guard(_exceptionable, {
|
|
341
353
|
path: _path + ".file",
|
|
@@ -375,13 +387,13 @@ export const stringifyFile = input => {
|
|
|
375
387
|
const $io2 = input => "string" === typeof input.message;
|
|
376
388
|
const $string = __typia.json.createStringify.string;
|
|
377
389
|
const $tail = __typia.json.createStringify.tail;
|
|
378
|
-
const $so0 = input => `{"id":${$string(input.id)},"size":${input.size},"seekable":${input.seekable},"deleted":${input.deleted},"refs":${`[${input.refs.map(elem => $so1(elem)).join(",")}]`},"tags":${`[${input.tags.map(elem => $string(elem)).join(",")}]`},"error":${null !== input.error ? `[${input.error.map(elem => `{"message":${$string(elem.message)}}`).join(",")}]` : "null"}
|
|
390
|
+
const $so0 = input => `{"id":${$string(input.id)},"size":${null !== input.size ? input.size : "null"},"seekable":${input.seekable},"deleted":${input.deleted},"refs":${`[${input.refs.map(elem => $so1(elem)).join(",")}]`},"tags":${`[${input.tags.map(elem => $string(elem)).join(",")}]`},"resumable":${$string(input.resumable)},"mimeType":${$string(input.mimeType)},"hash":${$string(input.hash)},"btime":${input.btime},"completed":${input.completed},"error":${null !== input.error ? `[${input.error.map(elem => `{"message":${$string(elem.message)}}`).join(",")}]` : "null"}}`;
|
|
379
391
|
const $so1 = input => `{${$tail(`${undefined === input.file ? "" : `"file":${undefined !== input.file ? $string(input.file) : undefined},`}${undefined === input.offset ? "" : `"offset":${undefined !== input.offset ? input.offset : undefined},`}${undefined === input.start ? "" : `"start":${undefined !== input.start ? input.start : undefined},`}${undefined === input.end ? "" : `"end":${undefined !== input.end ? input.end : undefined}`}`)}}`;
|
|
380
392
|
return $so0(input);
|
|
381
393
|
};
|
|
382
394
|
export const assertStringifyFile = (input, errorFactory) => { const assert = (input, errorFactory) => {
|
|
383
395
|
const __is = input => {
|
|
384
|
-
const $io0 = input => "string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) && ("number" === typeof input.size && (0 <= input.size && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 18446744073709552000))) && "boolean" === typeof input.seekable && "boolean" === typeof input.deleted && (Array.isArray(input.refs) && input.refs.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $io1(elem))) && (Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem)) &&
|
|
396
|
+
const $io0 = input => "string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) && (null === input.size || "number" === typeof input.size && (0 <= input.size && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 18446744073709552000))) && "boolean" === typeof input.seekable && "boolean" === typeof input.deleted && (Array.isArray(input.refs) && input.refs.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $io1(elem))) && (Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem)) && "string" === typeof input.resumable && "string" === typeof input.mimeType && ("string" === typeof input.hash && /^([A-Fa-f0-9]{32})?$/.test(input.hash)) && ("number" === typeof input.btime && (0 <= input.btime && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 18446744073709552000))) && "boolean" === typeof input.completed && (null === input.error || Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io2(elem)));
|
|
385
397
|
const $io1 = input => (undefined === input.file || "string" === typeof input.file) && (undefined === input.offset || "number" === typeof input.offset && !Number.isNaN(input.offset)) && (undefined === input.start || "number" === typeof input.start && !Number.isNaN(input.start)) && (undefined === input.end || "number" === typeof input.end && !Number.isNaN(input.end));
|
|
386
398
|
const $io2 = input => "string" === typeof input.message;
|
|
387
399
|
return "object" === typeof input && null !== input && $io0(input);
|
|
@@ -397,7 +409,7 @@ export const assertStringifyFile = (input, errorFactory) => { const assert = (in
|
|
|
397
409
|
path: _path + ".id",
|
|
398
410
|
expected: "(string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">)",
|
|
399
411
|
value: input.id
|
|
400
|
-
}, errorFactory)) && ("number" === typeof input.size && (0 <= input.size || $guard(_exceptionable, {
|
|
412
|
+
}, errorFactory)) && (null === input.size || "number" === typeof input.size && (0 <= input.size || $guard(_exceptionable, {
|
|
401
413
|
path: _path + ".size",
|
|
402
414
|
expected: "number & Minimum<0>",
|
|
403
415
|
value: input.size
|
|
@@ -407,7 +419,7 @@ export const assertStringifyFile = (input, errorFactory) => { const assert = (in
|
|
|
407
419
|
value: input.size
|
|
408
420
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
409
421
|
path: _path + ".size",
|
|
410
|
-
expected: "(number & Minimum<0> & Type<\"uint64\">)",
|
|
422
|
+
expected: "((number & Minimum<0> & Type<\"uint64\">) | null)",
|
|
411
423
|
value: input.size
|
|
412
424
|
}, errorFactory)) && ("boolean" === typeof input.seekable || $guard(_exceptionable, {
|
|
413
425
|
path: _path + ".seekable",
|
|
@@ -445,22 +457,6 @@ export const assertStringifyFile = (input, errorFactory) => { const assert = (in
|
|
|
445
457
|
path: _path + ".tags",
|
|
446
458
|
expected: "Array<string>",
|
|
447
459
|
value: input.tags
|
|
448
|
-
}, errorFactory)) && (null === input.error || (Array.isArray(input.error) || $guard(_exceptionable, {
|
|
449
|
-
path: _path + ".error",
|
|
450
|
-
expected: "(Array<__type>.o1 | null)",
|
|
451
|
-
value: input.error
|
|
452
|
-
}, errorFactory)) && input.error.every((elem, _index3) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
|
|
453
|
-
path: _path + ".error[" + _index3 + "]",
|
|
454
|
-
expected: "__type.o1",
|
|
455
|
-
value: elem
|
|
456
|
-
}, errorFactory)) && $ao2(elem, _path + ".error[" + _index3 + "]", true && _exceptionable) || $guard(_exceptionable, {
|
|
457
|
-
path: _path + ".error[" + _index3 + "]",
|
|
458
|
-
expected: "__type.o1",
|
|
459
|
-
value: elem
|
|
460
|
-
}, errorFactory)) || $guard(_exceptionable, {
|
|
461
|
-
path: _path + ".error",
|
|
462
|
-
expected: "(Array<__type>.o1 | null)",
|
|
463
|
-
value: input.error
|
|
464
460
|
}, errorFactory)) && ("string" === typeof input.resumable || $guard(_exceptionable, {
|
|
465
461
|
path: _path + ".resumable",
|
|
466
462
|
expected: "string",
|
|
@@ -489,6 +485,26 @@ export const assertStringifyFile = (input, errorFactory) => { const assert = (in
|
|
|
489
485
|
path: _path + ".btime",
|
|
490
486
|
expected: "(number & Minimum<0> & Type<\"uint64\">)",
|
|
491
487
|
value: input.btime
|
|
488
|
+
}, errorFactory)) && ("boolean" === typeof input.completed || $guard(_exceptionable, {
|
|
489
|
+
path: _path + ".completed",
|
|
490
|
+
expected: "boolean",
|
|
491
|
+
value: input.completed
|
|
492
|
+
}, errorFactory)) && (null === input.error || (Array.isArray(input.error) || $guard(_exceptionable, {
|
|
493
|
+
path: _path + ".error",
|
|
494
|
+
expected: "(Array<__type>.o1 | null)",
|
|
495
|
+
value: input.error
|
|
496
|
+
}, errorFactory)) && input.error.every((elem, _index3) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
|
|
497
|
+
path: _path + ".error[" + _index3 + "]",
|
|
498
|
+
expected: "__type.o1",
|
|
499
|
+
value: elem
|
|
500
|
+
}, errorFactory)) && $ao2(elem, _path + ".error[" + _index3 + "]", true && _exceptionable) || $guard(_exceptionable, {
|
|
501
|
+
path: _path + ".error[" + _index3 + "]",
|
|
502
|
+
expected: "__type.o1",
|
|
503
|
+
value: elem
|
|
504
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
505
|
+
path: _path + ".error",
|
|
506
|
+
expected: "(Array<__type>.o1 | null)",
|
|
507
|
+
value: input.error
|
|
492
508
|
}, errorFactory));
|
|
493
509
|
const $ao1 = (input, _path, _exceptionable = true) => (undefined === input.file || "string" === typeof input.file || $guard(_exceptionable, {
|
|
494
510
|
path: _path + ".file",
|
|
@@ -528,19 +544,19 @@ export const assertStringifyFile = (input, errorFactory) => { const assert = (in
|
|
|
528
544
|
const $io2 = input => "string" === typeof input.message;
|
|
529
545
|
const $string = __typia.json.createAssertStringify.string;
|
|
530
546
|
const $tail = __typia.json.createAssertStringify.tail;
|
|
531
|
-
const $so0 = input => `{"id":${$string(input.id)},"size":${input.size},"seekable":${input.seekable},"deleted":${input.deleted},"refs":${`[${input.refs.map(elem => $so1(elem)).join(",")}]`},"tags":${`[${input.tags.map(elem => $string(elem)).join(",")}]`},"error":${null !== input.error ? `[${input.error.map(elem => `{"message":${$string(elem.message)}}`).join(",")}]` : "null"}
|
|
547
|
+
const $so0 = input => `{"id":${$string(input.id)},"size":${null !== input.size ? input.size : "null"},"seekable":${input.seekable},"deleted":${input.deleted},"refs":${`[${input.refs.map(elem => $so1(elem)).join(",")}]`},"tags":${`[${input.tags.map(elem => $string(elem)).join(",")}]`},"resumable":${$string(input.resumable)},"mimeType":${$string(input.mimeType)},"hash":${$string(input.hash)},"btime":${input.btime},"completed":${input.completed},"error":${null !== input.error ? `[${input.error.map(elem => `{"message":${$string(elem.message)}}`).join(",")}]` : "null"}}`;
|
|
532
548
|
const $so1 = input => `{${$tail(`${undefined === input.file ? "" : `"file":${undefined !== input.file ? $string(input.file) : undefined},`}${undefined === input.offset ? "" : `"offset":${undefined !== input.offset ? input.offset : undefined},`}${undefined === input.start ? "" : `"start":${undefined !== input.start ? input.start : undefined},`}${undefined === input.end ? "" : `"end":${undefined !== input.end ? input.end : undefined}`}`)}}`;
|
|
533
549
|
return $so0(input);
|
|
534
550
|
}; return stringify(assert(input, errorFactory)); };
|
|
535
551
|
export const isFileStats = input => {
|
|
536
|
-
const $io0 = input => "number" === typeof input.position && (0 <= input.position && (Math.floor(input.position) === input.position && 0 <= input.position && input.position <= 18446744073709552000)) && "boolean" === typeof input.uploading &&
|
|
552
|
+
const $io0 = input => (null === input.position || "number" === typeof input.position && (0 <= input.position && (Math.floor(input.position) === input.position && 0 <= input.position && input.position <= 18446744073709552000))) && "boolean" === typeof input.uploading && (Array.isArray(input.zones) && input.zones.every(elem => "string" === typeof elem)) && (Array.isArray(input.replicas) && input.replicas.every(elem => "string" === typeof elem)) && ("string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id)) && (null === input.size || "number" === typeof input.size && (0 <= input.size && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 18446744073709552000))) && "boolean" === typeof input.seekable && "boolean" === typeof input.deleted && (Array.isArray(input.refs) && input.refs.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $io1(elem))) && (Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem)) && "string" === typeof input.resumable && "string" === typeof input.mimeType && ("string" === typeof input.hash && /^([A-Fa-f0-9]{32})?$/.test(input.hash)) && ("number" === typeof input.btime && (0 <= input.btime && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 18446744073709552000))) && "boolean" === typeof input.completed && (null === input.error || Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io2(elem)));
|
|
537
553
|
const $io1 = input => (undefined === input.file || "string" === typeof input.file) && (undefined === input.offset || "number" === typeof input.offset) && (undefined === input.start || "number" === typeof input.start) && (undefined === input.end || "number" === typeof input.end);
|
|
538
554
|
const $io2 = input => "string" === typeof input.message;
|
|
539
555
|
return "object" === typeof input && null !== input && $io0(input);
|
|
540
556
|
};
|
|
541
557
|
export const assertFileStats = (input, errorFactory) => {
|
|
542
558
|
const __is = input => {
|
|
543
|
-
const $io0 = input => "number" === typeof input.position && (0 <= input.position && (Math.floor(input.position) === input.position && 0 <= input.position && input.position <= 18446744073709552000)) && "boolean" === typeof input.uploading &&
|
|
559
|
+
const $io0 = input => (null === input.position || "number" === typeof input.position && (0 <= input.position && (Math.floor(input.position) === input.position && 0 <= input.position && input.position <= 18446744073709552000))) && "boolean" === typeof input.uploading && (Array.isArray(input.zones) && input.zones.every(elem => "string" === typeof elem)) && (Array.isArray(input.replicas) && input.replicas.every(elem => "string" === typeof elem)) && ("string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id)) && (null === input.size || "number" === typeof input.size && (0 <= input.size && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 18446744073709552000))) && "boolean" === typeof input.seekable && "boolean" === typeof input.deleted && (Array.isArray(input.refs) && input.refs.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $io1(elem))) && (Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem)) && "string" === typeof input.resumable && "string" === typeof input.mimeType && ("string" === typeof input.hash && /^([A-Fa-f0-9]{32})?$/.test(input.hash)) && ("number" === typeof input.btime && (0 <= input.btime && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 18446744073709552000))) && "boolean" === typeof input.completed && (null === input.error || Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io2(elem)));
|
|
544
560
|
const $io1 = input => (undefined === input.file || "string" === typeof input.file) && (undefined === input.offset || "number" === typeof input.offset) && (undefined === input.start || "number" === typeof input.start) && (undefined === input.end || "number" === typeof input.end);
|
|
545
561
|
const $io2 = input => "string" === typeof input.message;
|
|
546
562
|
return "object" === typeof input && null !== input && $io0(input);
|
|
@@ -548,7 +564,7 @@ export const assertFileStats = (input, errorFactory) => {
|
|
|
548
564
|
if (false === __is(input))
|
|
549
565
|
((input, _path, _exceptionable = true) => {
|
|
550
566
|
const $guard = __typia.createAssert.guard;
|
|
551
|
-
const $ao0 = (input, _path, _exceptionable = true) => ("number" === typeof input.position && (0 <= input.position || $guard(_exceptionable, {
|
|
567
|
+
const $ao0 = (input, _path, _exceptionable = true) => (null === input.position || "number" === typeof input.position && (0 <= input.position || $guard(_exceptionable, {
|
|
552
568
|
path: _path + ".position",
|
|
553
569
|
expected: "number & Minimum<0>",
|
|
554
570
|
value: input.position
|
|
@@ -558,16 +574,12 @@ export const assertFileStats = (input, errorFactory) => {
|
|
|
558
574
|
value: input.position
|
|
559
575
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
560
576
|
path: _path + ".position",
|
|
561
|
-
expected: "(number & Minimum<0> & Type<\"uint64\">)",
|
|
577
|
+
expected: "((number & Minimum<0> & Type<\"uint64\">) | null)",
|
|
562
578
|
value: input.position
|
|
563
579
|
}, errorFactory)) && ("boolean" === typeof input.uploading || $guard(_exceptionable, {
|
|
564
580
|
path: _path + ".uploading",
|
|
565
581
|
expected: "boolean",
|
|
566
582
|
value: input.uploading
|
|
567
|
-
}, errorFactory)) && ("boolean" === typeof input.completed || $guard(_exceptionable, {
|
|
568
|
-
path: _path + ".completed",
|
|
569
|
-
expected: "boolean",
|
|
570
|
-
value: input.completed
|
|
571
583
|
}, errorFactory)) && ((Array.isArray(input.zones) || $guard(_exceptionable, {
|
|
572
584
|
path: _path + ".zones",
|
|
573
585
|
expected: "Array<string>",
|
|
@@ -600,7 +612,7 @@ export const assertFileStats = (input, errorFactory) => {
|
|
|
600
612
|
path: _path + ".id",
|
|
601
613
|
expected: "(string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">)",
|
|
602
614
|
value: input.id
|
|
603
|
-
}, errorFactory)) && ("number" === typeof input.size && (0 <= input.size || $guard(_exceptionable, {
|
|
615
|
+
}, errorFactory)) && (null === input.size || "number" === typeof input.size && (0 <= input.size || $guard(_exceptionable, {
|
|
604
616
|
path: _path + ".size",
|
|
605
617
|
expected: "number & Minimum<0>",
|
|
606
618
|
value: input.size
|
|
@@ -610,7 +622,7 @@ export const assertFileStats = (input, errorFactory) => {
|
|
|
610
622
|
value: input.size
|
|
611
623
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
612
624
|
path: _path + ".size",
|
|
613
|
-
expected: "(number & Minimum<0> & Type<\"uint64\">)",
|
|
625
|
+
expected: "((number & Minimum<0> & Type<\"uint64\">) | null)",
|
|
614
626
|
value: input.size
|
|
615
627
|
}, errorFactory)) && ("boolean" === typeof input.seekable || $guard(_exceptionable, {
|
|
616
628
|
path: _path + ".seekable",
|
|
@@ -648,22 +660,6 @@ export const assertFileStats = (input, errorFactory) => {
|
|
|
648
660
|
path: _path + ".tags",
|
|
649
661
|
expected: "Array<string>",
|
|
650
662
|
value: input.tags
|
|
651
|
-
}, errorFactory)) && (null === input.error || (Array.isArray(input.error) || $guard(_exceptionable, {
|
|
652
|
-
path: _path + ".error",
|
|
653
|
-
expected: "(Array<__type>.o1 | null)",
|
|
654
|
-
value: input.error
|
|
655
|
-
}, errorFactory)) && input.error.every((elem, _index5) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
|
|
656
|
-
path: _path + ".error[" + _index5 + "]",
|
|
657
|
-
expected: "__type.o1",
|
|
658
|
-
value: elem
|
|
659
|
-
}, errorFactory)) && $ao2(elem, _path + ".error[" + _index5 + "]", true && _exceptionable) || $guard(_exceptionable, {
|
|
660
|
-
path: _path + ".error[" + _index5 + "]",
|
|
661
|
-
expected: "__type.o1",
|
|
662
|
-
value: elem
|
|
663
|
-
}, errorFactory)) || $guard(_exceptionable, {
|
|
664
|
-
path: _path + ".error",
|
|
665
|
-
expected: "(Array<__type>.o1 | null)",
|
|
666
|
-
value: input.error
|
|
667
663
|
}, errorFactory)) && ("string" === typeof input.resumable || $guard(_exceptionable, {
|
|
668
664
|
path: _path + ".resumable",
|
|
669
665
|
expected: "string",
|
|
@@ -692,6 +688,26 @@ export const assertFileStats = (input, errorFactory) => {
|
|
|
692
688
|
path: _path + ".btime",
|
|
693
689
|
expected: "(number & Minimum<0> & Type<\"uint64\">)",
|
|
694
690
|
value: input.btime
|
|
691
|
+
}, errorFactory)) && ("boolean" === typeof input.completed || $guard(_exceptionable, {
|
|
692
|
+
path: _path + ".completed",
|
|
693
|
+
expected: "boolean",
|
|
694
|
+
value: input.completed
|
|
695
|
+
}, errorFactory)) && (null === input.error || (Array.isArray(input.error) || $guard(_exceptionable, {
|
|
696
|
+
path: _path + ".error",
|
|
697
|
+
expected: "(Array<__type>.o1 | null)",
|
|
698
|
+
value: input.error
|
|
699
|
+
}, errorFactory)) && input.error.every((elem, _index5) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
|
|
700
|
+
path: _path + ".error[" + _index5 + "]",
|
|
701
|
+
expected: "__type.o1",
|
|
702
|
+
value: elem
|
|
703
|
+
}, errorFactory)) && $ao2(elem, _path + ".error[" + _index5 + "]", true && _exceptionable) || $guard(_exceptionable, {
|
|
704
|
+
path: _path + ".error[" + _index5 + "]",
|
|
705
|
+
expected: "__type.o1",
|
|
706
|
+
value: elem
|
|
707
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
708
|
+
path: _path + ".error",
|
|
709
|
+
expected: "(Array<__type>.o1 | null)",
|
|
710
|
+
value: input.error
|
|
695
711
|
}, errorFactory));
|
|
696
712
|
const $ao1 = (input, _path, _exceptionable = true) => (undefined === input.file || "string" === typeof input.file || $guard(_exceptionable, {
|
|
697
713
|
path: _path + ".file",
|
|
@@ -731,20 +747,22 @@ export const randomFileStats = generator => {
|
|
|
731
747
|
const $generator = __typia.createRandom.generator;
|
|
732
748
|
const $pick = __typia.createRandom.pick;
|
|
733
749
|
const $ro0 = (_recursive = false, _depth = 0) => ({
|
|
734
|
-
position:
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
750
|
+
position: $pick([
|
|
751
|
+
() => null,
|
|
752
|
+
() => (generator?.customs ?? $generator.customs)?.number?.([
|
|
753
|
+
{
|
|
754
|
+
name: "Minimum<0>",
|
|
755
|
+
kind: "minimum",
|
|
756
|
+
value: 0
|
|
757
|
+
},
|
|
758
|
+
{
|
|
759
|
+
name: "Type<\"uint64\">",
|
|
760
|
+
kind: "type",
|
|
761
|
+
value: "uint64"
|
|
762
|
+
}
|
|
763
|
+
]) ?? (generator?.integer ?? $generator.integer)(0, 10)
|
|
764
|
+
])(),
|
|
746
765
|
uploading: (generator?.boolean ?? $generator.boolean)(),
|
|
747
|
-
completed: (generator?.boolean ?? $generator.boolean)(),
|
|
748
766
|
zones: (generator?.array ?? $generator.array)(() => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()),
|
|
749
767
|
replicas: (generator?.array ?? $generator.array)(() => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()),
|
|
750
768
|
id: (generator?.customs ?? $generator.customs)?.string?.([
|
|
@@ -754,26 +772,25 @@ export const randomFileStats = generator => {
|
|
|
754
772
|
value: "^[0-9A-Za-z~][0-9A-Za-z~._: -]*$"
|
|
755
773
|
}
|
|
756
774
|
]) ?? (generator?.pattern ?? $generator.pattern)(/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/),
|
|
757
|
-
size:
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
775
|
+
size: $pick([
|
|
776
|
+
() => null,
|
|
777
|
+
() => (generator?.customs ?? $generator.customs)?.number?.([
|
|
778
|
+
{
|
|
779
|
+
name: "Minimum<0>",
|
|
780
|
+
kind: "minimum",
|
|
781
|
+
value: 0
|
|
782
|
+
},
|
|
783
|
+
{
|
|
784
|
+
name: "Type<\"uint64\">",
|
|
785
|
+
kind: "type",
|
|
786
|
+
value: "uint64"
|
|
787
|
+
}
|
|
788
|
+
]) ?? (generator?.integer ?? $generator.integer)(0, 10)
|
|
789
|
+
])(),
|
|
769
790
|
seekable: (generator?.boolean ?? $generator.boolean)(),
|
|
770
791
|
deleted: (generator?.boolean ?? $generator.boolean)(),
|
|
771
792
|
refs: (generator?.array ?? $generator.array)(() => $ro1(_recursive, _recursive ? 1 + _depth : _depth)),
|
|
772
793
|
tags: (generator?.array ?? $generator.array)(() => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()),
|
|
773
|
-
error: $pick([
|
|
774
|
-
() => null,
|
|
775
|
-
() => (generator?.array ?? $generator.array)(() => $ro2(_recursive, _recursive ? 1 + _depth : _depth))
|
|
776
|
-
])(),
|
|
777
794
|
resumable: (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)(),
|
|
778
795
|
mimeType: (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)(),
|
|
779
796
|
hash: (generator?.customs ?? $generator.customs)?.string?.([
|
|
@@ -794,7 +811,12 @@ export const randomFileStats = generator => {
|
|
|
794
811
|
kind: "type",
|
|
795
812
|
value: "uint64"
|
|
796
813
|
}
|
|
797
|
-
]) ?? (generator?.integer ?? $generator.integer)(0, 10)
|
|
814
|
+
]) ?? (generator?.integer ?? $generator.integer)(0, 10),
|
|
815
|
+
completed: (generator?.boolean ?? $generator.boolean)(),
|
|
816
|
+
error: $pick([
|
|
817
|
+
() => null,
|
|
818
|
+
() => (generator?.array ?? $generator.array)(() => $ro2(_recursive, _recursive ? 1 + _depth : _depth))
|
|
819
|
+
])()
|
|
798
820
|
});
|
|
799
821
|
const $ro1 = (_recursive = false, _depth = 0) => ({
|
|
800
822
|
file: $pick([
|
|
@@ -821,7 +843,7 @@ export const randomFileStats = generator => {
|
|
|
821
843
|
};
|
|
822
844
|
export const assertGuardFileStats = (input, errorFactory) => {
|
|
823
845
|
const __is = input => {
|
|
824
|
-
const $io0 = input => "number" === typeof input.position && (0 <= input.position && (Math.floor(input.position) === input.position && 0 <= input.position && input.position <= 18446744073709552000)) && "boolean" === typeof input.uploading &&
|
|
846
|
+
const $io0 = input => (null === input.position || "number" === typeof input.position && (0 <= input.position && (Math.floor(input.position) === input.position && 0 <= input.position && input.position <= 18446744073709552000))) && "boolean" === typeof input.uploading && (Array.isArray(input.zones) && input.zones.every(elem => "string" === typeof elem)) && (Array.isArray(input.replicas) && input.replicas.every(elem => "string" === typeof elem)) && ("string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id)) && (null === input.size || "number" === typeof input.size && (0 <= input.size && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 18446744073709552000))) && "boolean" === typeof input.seekable && "boolean" === typeof input.deleted && (Array.isArray(input.refs) && input.refs.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $io1(elem))) && (Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem)) && "string" === typeof input.resumable && "string" === typeof input.mimeType && ("string" === typeof input.hash && /^([A-Fa-f0-9]{32})?$/.test(input.hash)) && ("number" === typeof input.btime && (0 <= input.btime && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 18446744073709552000))) && "boolean" === typeof input.completed && (null === input.error || Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io2(elem)));
|
|
825
847
|
const $io1 = input => (undefined === input.file || "string" === typeof input.file) && (undefined === input.offset || "number" === typeof input.offset) && (undefined === input.start || "number" === typeof input.start) && (undefined === input.end || "number" === typeof input.end);
|
|
826
848
|
const $io2 = input => "string" === typeof input.message;
|
|
827
849
|
return "object" === typeof input && null !== input && $io0(input);
|
|
@@ -829,7 +851,7 @@ export const assertGuardFileStats = (input, errorFactory) => {
|
|
|
829
851
|
if (false === __is(input))
|
|
830
852
|
((input, _path, _exceptionable = true) => {
|
|
831
853
|
const $guard = __typia.createAssertGuard.guard;
|
|
832
|
-
const $ao0 = (input, _path, _exceptionable = true) => ("number" === typeof input.position && (0 <= input.position || $guard(_exceptionable, {
|
|
854
|
+
const $ao0 = (input, _path, _exceptionable = true) => (null === input.position || "number" === typeof input.position && (0 <= input.position || $guard(_exceptionable, {
|
|
833
855
|
path: _path + ".position",
|
|
834
856
|
expected: "number & Minimum<0>",
|
|
835
857
|
value: input.position
|
|
@@ -839,16 +861,12 @@ export const assertGuardFileStats = (input, errorFactory) => {
|
|
|
839
861
|
value: input.position
|
|
840
862
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
841
863
|
path: _path + ".position",
|
|
842
|
-
expected: "(number & Minimum<0> & Type<\"uint64\">)",
|
|
864
|
+
expected: "((number & Minimum<0> & Type<\"uint64\">) | null)",
|
|
843
865
|
value: input.position
|
|
844
866
|
}, errorFactory)) && ("boolean" === typeof input.uploading || $guard(_exceptionable, {
|
|
845
867
|
path: _path + ".uploading",
|
|
846
868
|
expected: "boolean",
|
|
847
869
|
value: input.uploading
|
|
848
|
-
}, errorFactory)) && ("boolean" === typeof input.completed || $guard(_exceptionable, {
|
|
849
|
-
path: _path + ".completed",
|
|
850
|
-
expected: "boolean",
|
|
851
|
-
value: input.completed
|
|
852
870
|
}, errorFactory)) && ((Array.isArray(input.zones) || $guard(_exceptionable, {
|
|
853
871
|
path: _path + ".zones",
|
|
854
872
|
expected: "Array<string>",
|
|
@@ -881,7 +899,7 @@ export const assertGuardFileStats = (input, errorFactory) => {
|
|
|
881
899
|
path: _path + ".id",
|
|
882
900
|
expected: "(string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">)",
|
|
883
901
|
value: input.id
|
|
884
|
-
}, errorFactory)) && ("number" === typeof input.size && (0 <= input.size || $guard(_exceptionable, {
|
|
902
|
+
}, errorFactory)) && (null === input.size || "number" === typeof input.size && (0 <= input.size || $guard(_exceptionable, {
|
|
885
903
|
path: _path + ".size",
|
|
886
904
|
expected: "number & Minimum<0>",
|
|
887
905
|
value: input.size
|
|
@@ -891,7 +909,7 @@ export const assertGuardFileStats = (input, errorFactory) => {
|
|
|
891
909
|
value: input.size
|
|
892
910
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
893
911
|
path: _path + ".size",
|
|
894
|
-
expected: "(number & Minimum<0> & Type<\"uint64\">)",
|
|
912
|
+
expected: "((number & Minimum<0> & Type<\"uint64\">) | null)",
|
|
895
913
|
value: input.size
|
|
896
914
|
}, errorFactory)) && ("boolean" === typeof input.seekable || $guard(_exceptionable, {
|
|
897
915
|
path: _path + ".seekable",
|
|
@@ -929,22 +947,6 @@ export const assertGuardFileStats = (input, errorFactory) => {
|
|
|
929
947
|
path: _path + ".tags",
|
|
930
948
|
expected: "Array<string>",
|
|
931
949
|
value: input.tags
|
|
932
|
-
}, errorFactory)) && (null === input.error || (Array.isArray(input.error) || $guard(_exceptionable, {
|
|
933
|
-
path: _path + ".error",
|
|
934
|
-
expected: "(Array<__type>.o1 | null)",
|
|
935
|
-
value: input.error
|
|
936
|
-
}, errorFactory)) && input.error.every((elem, _index5) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
|
|
937
|
-
path: _path + ".error[" + _index5 + "]",
|
|
938
|
-
expected: "__type.o1",
|
|
939
|
-
value: elem
|
|
940
|
-
}, errorFactory)) && $ao2(elem, _path + ".error[" + _index5 + "]", true && _exceptionable) || $guard(_exceptionable, {
|
|
941
|
-
path: _path + ".error[" + _index5 + "]",
|
|
942
|
-
expected: "__type.o1",
|
|
943
|
-
value: elem
|
|
944
|
-
}, errorFactory)) || $guard(_exceptionable, {
|
|
945
|
-
path: _path + ".error",
|
|
946
|
-
expected: "(Array<__type>.o1 | null)",
|
|
947
|
-
value: input.error
|
|
948
950
|
}, errorFactory)) && ("string" === typeof input.resumable || $guard(_exceptionable, {
|
|
949
951
|
path: _path + ".resumable",
|
|
950
952
|
expected: "string",
|
|
@@ -973,6 +975,26 @@ export const assertGuardFileStats = (input, errorFactory) => {
|
|
|
973
975
|
path: _path + ".btime",
|
|
974
976
|
expected: "(number & Minimum<0> & Type<\"uint64\">)",
|
|
975
977
|
value: input.btime
|
|
978
|
+
}, errorFactory)) && ("boolean" === typeof input.completed || $guard(_exceptionable, {
|
|
979
|
+
path: _path + ".completed",
|
|
980
|
+
expected: "boolean",
|
|
981
|
+
value: input.completed
|
|
982
|
+
}, errorFactory)) && (null === input.error || (Array.isArray(input.error) || $guard(_exceptionable, {
|
|
983
|
+
path: _path + ".error",
|
|
984
|
+
expected: "(Array<__type>.o1 | null)",
|
|
985
|
+
value: input.error
|
|
986
|
+
}, errorFactory)) && input.error.every((elem, _index5) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
|
|
987
|
+
path: _path + ".error[" + _index5 + "]",
|
|
988
|
+
expected: "__type.o1",
|
|
989
|
+
value: elem
|
|
990
|
+
}, errorFactory)) && $ao2(elem, _path + ".error[" + _index5 + "]", true && _exceptionable) || $guard(_exceptionable, {
|
|
991
|
+
path: _path + ".error[" + _index5 + "]",
|
|
992
|
+
expected: "__type.o1",
|
|
993
|
+
value: elem
|
|
994
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
995
|
+
path: _path + ".error",
|
|
996
|
+
expected: "(Array<__type>.o1 | null)",
|
|
997
|
+
value: input.error
|
|
976
998
|
}, errorFactory));
|
|
977
999
|
const $ao1 = (input, _path, _exceptionable = true) => (undefined === input.file || "string" === typeof input.file || $guard(_exceptionable, {
|
|
978
1000
|
path: _path + ".file",
|
|
@@ -1012,13 +1034,13 @@ export const stringifyFileStats = input => {
|
|
|
1012
1034
|
const $io2 = input => "string" === typeof input.message;
|
|
1013
1035
|
const $string = __typia.json.createStringify.string;
|
|
1014
1036
|
const $tail = __typia.json.createStringify.tail;
|
|
1015
|
-
const $so0 = input => `{"position":${input.position},"uploading":${input.uploading},"
|
|
1037
|
+
const $so0 = input => `{"position":${null !== input.position ? input.position : "null"},"uploading":${input.uploading},"zones":${`[${input.zones.map(elem => $string(elem)).join(",")}]`},"replicas":${`[${input.replicas.map(elem => $string(elem)).join(",")}]`},"id":${$string(input.id)},"size":${null !== input.size ? input.size : "null"},"seekable":${input.seekable},"deleted":${input.deleted},"refs":${`[${input.refs.map(elem => $so1(elem)).join(",")}]`},"tags":${`[${input.tags.map(elem => $string(elem)).join(",")}]`},"resumable":${$string(input.resumable)},"mimeType":${$string(input.mimeType)},"hash":${$string(input.hash)},"btime":${input.btime},"completed":${input.completed},"error":${null !== input.error ? `[${input.error.map(elem => `{"message":${$string(elem.message)}}`).join(",")}]` : "null"}}`;
|
|
1016
1038
|
const $so1 = input => `{${$tail(`${undefined === input.file ? "" : `"file":${undefined !== input.file ? $string(input.file) : undefined},`}${undefined === input.offset ? "" : `"offset":${undefined !== input.offset ? input.offset : undefined},`}${undefined === input.start ? "" : `"start":${undefined !== input.start ? input.start : undefined},`}${undefined === input.end ? "" : `"end":${undefined !== input.end ? input.end : undefined}`}`)}}`;
|
|
1017
1039
|
return $so0(input);
|
|
1018
1040
|
};
|
|
1019
1041
|
export const assertStringifyFileStats = (input, errorFactory) => { const assert = (input, errorFactory) => {
|
|
1020
1042
|
const __is = input => {
|
|
1021
|
-
const $io0 = input => "number" === typeof input.position && (0 <= input.position && (Math.floor(input.position) === input.position && 0 <= input.position && input.position <= 18446744073709552000)) && "boolean" === typeof input.uploading &&
|
|
1043
|
+
const $io0 = input => (null === input.position || "number" === typeof input.position && (0 <= input.position && (Math.floor(input.position) === input.position && 0 <= input.position && input.position <= 18446744073709552000))) && "boolean" === typeof input.uploading && (Array.isArray(input.zones) && input.zones.every(elem => "string" === typeof elem)) && (Array.isArray(input.replicas) && input.replicas.every(elem => "string" === typeof elem)) && ("string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id)) && (null === input.size || "number" === typeof input.size && (0 <= input.size && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 18446744073709552000))) && "boolean" === typeof input.seekable && "boolean" === typeof input.deleted && (Array.isArray(input.refs) && input.refs.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $io1(elem))) && (Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem)) && "string" === typeof input.resumable && "string" === typeof input.mimeType && ("string" === typeof input.hash && /^([A-Fa-f0-9]{32})?$/.test(input.hash)) && ("number" === typeof input.btime && (0 <= input.btime && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 18446744073709552000))) && "boolean" === typeof input.completed && (null === input.error || Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io2(elem)));
|
|
1022
1044
|
const $io1 = input => (undefined === input.file || "string" === typeof input.file) && (undefined === input.offset || "number" === typeof input.offset && !Number.isNaN(input.offset)) && (undefined === input.start || "number" === typeof input.start && !Number.isNaN(input.start)) && (undefined === input.end || "number" === typeof input.end && !Number.isNaN(input.end));
|
|
1023
1045
|
const $io2 = input => "string" === typeof input.message;
|
|
1024
1046
|
return "object" === typeof input && null !== input && $io0(input);
|
|
@@ -1026,7 +1048,7 @@ export const assertStringifyFileStats = (input, errorFactory) => { const assert
|
|
|
1026
1048
|
if (false === __is(input))
|
|
1027
1049
|
((input, _path, _exceptionable = true) => {
|
|
1028
1050
|
const $guard = __typia.json.createAssertStringify.guard;
|
|
1029
|
-
const $ao0 = (input, _path, _exceptionable = true) => ("number" === typeof input.position && (0 <= input.position || $guard(_exceptionable, {
|
|
1051
|
+
const $ao0 = (input, _path, _exceptionable = true) => (null === input.position || "number" === typeof input.position && (0 <= input.position || $guard(_exceptionable, {
|
|
1030
1052
|
path: _path + ".position",
|
|
1031
1053
|
expected: "number & Minimum<0>",
|
|
1032
1054
|
value: input.position
|
|
@@ -1036,16 +1058,12 @@ export const assertStringifyFileStats = (input, errorFactory) => { const assert
|
|
|
1036
1058
|
value: input.position
|
|
1037
1059
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
1038
1060
|
path: _path + ".position",
|
|
1039
|
-
expected: "(number & Minimum<0> & Type<\"uint64\">)",
|
|
1061
|
+
expected: "((number & Minimum<0> & Type<\"uint64\">) | null)",
|
|
1040
1062
|
value: input.position
|
|
1041
1063
|
}, errorFactory)) && ("boolean" === typeof input.uploading || $guard(_exceptionable, {
|
|
1042
1064
|
path: _path + ".uploading",
|
|
1043
1065
|
expected: "boolean",
|
|
1044
1066
|
value: input.uploading
|
|
1045
|
-
}, errorFactory)) && ("boolean" === typeof input.completed || $guard(_exceptionable, {
|
|
1046
|
-
path: _path + ".completed",
|
|
1047
|
-
expected: "boolean",
|
|
1048
|
-
value: input.completed
|
|
1049
1067
|
}, errorFactory)) && ((Array.isArray(input.zones) || $guard(_exceptionable, {
|
|
1050
1068
|
path: _path + ".zones",
|
|
1051
1069
|
expected: "Array<string>",
|
|
@@ -1078,7 +1096,7 @@ export const assertStringifyFileStats = (input, errorFactory) => { const assert
|
|
|
1078
1096
|
path: _path + ".id",
|
|
1079
1097
|
expected: "(string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">)",
|
|
1080
1098
|
value: input.id
|
|
1081
|
-
}, errorFactory)) && ("number" === typeof input.size && (0 <= input.size || $guard(_exceptionable, {
|
|
1099
|
+
}, errorFactory)) && (null === input.size || "number" === typeof input.size && (0 <= input.size || $guard(_exceptionable, {
|
|
1082
1100
|
path: _path + ".size",
|
|
1083
1101
|
expected: "number & Minimum<0>",
|
|
1084
1102
|
value: input.size
|
|
@@ -1088,7 +1106,7 @@ export const assertStringifyFileStats = (input, errorFactory) => { const assert
|
|
|
1088
1106
|
value: input.size
|
|
1089
1107
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
1090
1108
|
path: _path + ".size",
|
|
1091
|
-
expected: "(number & Minimum<0> & Type<\"uint64\">)",
|
|
1109
|
+
expected: "((number & Minimum<0> & Type<\"uint64\">) | null)",
|
|
1092
1110
|
value: input.size
|
|
1093
1111
|
}, errorFactory)) && ("boolean" === typeof input.seekable || $guard(_exceptionable, {
|
|
1094
1112
|
path: _path + ".seekable",
|
|
@@ -1126,22 +1144,6 @@ export const assertStringifyFileStats = (input, errorFactory) => { const assert
|
|
|
1126
1144
|
path: _path + ".tags",
|
|
1127
1145
|
expected: "Array<string>",
|
|
1128
1146
|
value: input.tags
|
|
1129
|
-
}, errorFactory)) && (null === input.error || (Array.isArray(input.error) || $guard(_exceptionable, {
|
|
1130
|
-
path: _path + ".error",
|
|
1131
|
-
expected: "(Array<__type>.o1 | null)",
|
|
1132
|
-
value: input.error
|
|
1133
|
-
}, errorFactory)) && input.error.every((elem, _index5) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
|
|
1134
|
-
path: _path + ".error[" + _index5 + "]",
|
|
1135
|
-
expected: "__type.o1",
|
|
1136
|
-
value: elem
|
|
1137
|
-
}, errorFactory)) && $ao2(elem, _path + ".error[" + _index5 + "]", true && _exceptionable) || $guard(_exceptionable, {
|
|
1138
|
-
path: _path + ".error[" + _index5 + "]",
|
|
1139
|
-
expected: "__type.o1",
|
|
1140
|
-
value: elem
|
|
1141
|
-
}, errorFactory)) || $guard(_exceptionable, {
|
|
1142
|
-
path: _path + ".error",
|
|
1143
|
-
expected: "(Array<__type>.o1 | null)",
|
|
1144
|
-
value: input.error
|
|
1145
1147
|
}, errorFactory)) && ("string" === typeof input.resumable || $guard(_exceptionable, {
|
|
1146
1148
|
path: _path + ".resumable",
|
|
1147
1149
|
expected: "string",
|
|
@@ -1170,6 +1172,26 @@ export const assertStringifyFileStats = (input, errorFactory) => { const assert
|
|
|
1170
1172
|
path: _path + ".btime",
|
|
1171
1173
|
expected: "(number & Minimum<0> & Type<\"uint64\">)",
|
|
1172
1174
|
value: input.btime
|
|
1175
|
+
}, errorFactory)) && ("boolean" === typeof input.completed || $guard(_exceptionable, {
|
|
1176
|
+
path: _path + ".completed",
|
|
1177
|
+
expected: "boolean",
|
|
1178
|
+
value: input.completed
|
|
1179
|
+
}, errorFactory)) && (null === input.error || (Array.isArray(input.error) || $guard(_exceptionable, {
|
|
1180
|
+
path: _path + ".error",
|
|
1181
|
+
expected: "(Array<__type>.o1 | null)",
|
|
1182
|
+
value: input.error
|
|
1183
|
+
}, errorFactory)) && input.error.every((elem, _index5) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
|
|
1184
|
+
path: _path + ".error[" + _index5 + "]",
|
|
1185
|
+
expected: "__type.o1",
|
|
1186
|
+
value: elem
|
|
1187
|
+
}, errorFactory)) && $ao2(elem, _path + ".error[" + _index5 + "]", true && _exceptionable) || $guard(_exceptionable, {
|
|
1188
|
+
path: _path + ".error[" + _index5 + "]",
|
|
1189
|
+
expected: "__type.o1",
|
|
1190
|
+
value: elem
|
|
1191
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
1192
|
+
path: _path + ".error",
|
|
1193
|
+
expected: "(Array<__type>.o1 | null)",
|
|
1194
|
+
value: input.error
|
|
1173
1195
|
}, errorFactory));
|
|
1174
1196
|
const $ao1 = (input, _path, _exceptionable = true) => (undefined === input.file || "string" === typeof input.file || $guard(_exceptionable, {
|
|
1175
1197
|
path: _path + ".file",
|
|
@@ -1209,7 +1231,7 @@ export const assertStringifyFileStats = (input, errorFactory) => { const assert
|
|
|
1209
1231
|
const $io2 = input => "string" === typeof input.message;
|
|
1210
1232
|
const $string = __typia.json.createAssertStringify.string;
|
|
1211
1233
|
const $tail = __typia.json.createAssertStringify.tail;
|
|
1212
|
-
const $so0 = input => `{"position":${input.position},"uploading":${input.uploading},"
|
|
1234
|
+
const $so0 = input => `{"position":${null !== input.position ? input.position : "null"},"uploading":${input.uploading},"zones":${`[${input.zones.map(elem => $string(elem)).join(",")}]`},"replicas":${`[${input.replicas.map(elem => $string(elem)).join(",")}]`},"id":${$string(input.id)},"size":${null !== input.size ? input.size : "null"},"seekable":${input.seekable},"deleted":${input.deleted},"refs":${`[${input.refs.map(elem => $so1(elem)).join(",")}]`},"tags":${`[${input.tags.map(elem => $string(elem)).join(",")}]`},"resumable":${$string(input.resumable)},"mimeType":${$string(input.mimeType)},"hash":${$string(input.hash)},"btime":${input.btime},"completed":${input.completed},"error":${null !== input.error ? `[${input.error.map(elem => `{"message":${$string(elem.message)}}`).join(",")}]` : "null"}}`;
|
|
1213
1235
|
const $so1 = input => `{${$tail(`${undefined === input.file ? "" : `"file":${undefined !== input.file ? $string(input.file) : undefined},`}${undefined === input.offset ? "" : `"offset":${undefined !== input.offset ? input.offset : undefined},`}${undefined === input.start ? "" : `"start":${undefined !== input.start ? input.start : undefined},`}${undefined === input.end ? "" : `"end":${undefined !== input.end ? input.end : undefined}`}`)}}`;
|
|
1214
1236
|
return $so0(input);
|
|
1215
1237
|
}; return stringify(assert(input, errorFactory)); };
|