@nxtedition/types 1.2.0 → 1.2.2
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 +17 -8
- package/dist/common/block.js +815 -431
- package/dist/common/file.d.ts +21 -12
- package/dist/common/file.js +788 -241
- package/package.json +2 -2
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 &&
|
|
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 <= 4294967295))) && "boolean" === typeof input.seekable && "boolean" === typeof input.deleted && "string" === typeof input.path && (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)) && (Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io2(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 <= 4294967295)));
|
|
4
4
|
const $io1 = input => undefined === input.file || "string" === typeof input.file;
|
|
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 &&
|
|
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 <= 4294967295))) && "boolean" === typeof input.seekable && "boolean" === typeof input.deleted && "string" === typeof input.path && (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)) && (Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io2(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 <= 4294967295)));
|
|
11
11
|
const $io1 = input => undefined === input.file || "string" === typeof input.file;
|
|
12
12
|
const $io2 = input => "string" === typeof input.message;
|
|
13
13
|
return "object" === typeof input && null !== input && $io0(input);
|
|
@@ -15,106 +15,593 @@ export const assertFile = (input, errorFactory) => {
|
|
|
15
15
|
if (false === __is(input))
|
|
16
16
|
((input, _path, _exceptionable = true) => {
|
|
17
17
|
const $guard = __typia.createAssert.guard;
|
|
18
|
-
const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.id && (
|
|
18
|
+
const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.id && (/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) || $guard(_exceptionable, {
|
|
19
19
|
path: _path + ".id",
|
|
20
|
-
expected: "string &
|
|
20
|
+
expected: "string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
|
|
21
21
|
value: input.id
|
|
22
22
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
23
23
|
path: _path + ".id",
|
|
24
|
-
expected: "(string &
|
|
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, {
|
|
27
|
+
path: _path + ".size",
|
|
28
|
+
expected: "number & Minimum<0>",
|
|
29
|
+
value: input.size
|
|
30
|
+
}, errorFactory)) && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 4294967295 || $guard(_exceptionable, {
|
|
31
|
+
path: _path + ".size",
|
|
32
|
+
expected: "number & Type<\"uint32\">",
|
|
33
|
+
value: input.size
|
|
34
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
35
|
+
path: _path + ".size",
|
|
36
|
+
expected: "(number & Minimum<0> & Type<\"uint32\">)",
|
|
37
|
+
value: input.size
|
|
38
|
+
}, errorFactory)) && ("boolean" === typeof input.seekable || $guard(_exceptionable, {
|
|
39
|
+
path: _path + ".seekable",
|
|
40
|
+
expected: "boolean",
|
|
41
|
+
value: input.seekable
|
|
26
42
|
}, errorFactory)) && ("boolean" === typeof input.deleted || $guard(_exceptionable, {
|
|
27
43
|
path: _path + ".deleted",
|
|
28
44
|
expected: "boolean",
|
|
29
45
|
value: input.deleted
|
|
30
|
-
}, errorFactory)) && ("
|
|
31
|
-
path: _path + ".
|
|
32
|
-
expected: "boolean",
|
|
33
|
-
value: input.completed
|
|
34
|
-
}, errorFactory)) && ("boolean" === typeof input.uploading || $guard(_exceptionable, {
|
|
35
|
-
path: _path + ".uploading",
|
|
36
|
-
expected: "boolean",
|
|
37
|
-
value: input.uploading
|
|
38
|
-
}, errorFactory)) && ((Array.isArray(input.zones) || $guard(_exceptionable, {
|
|
39
|
-
path: _path + ".zones",
|
|
40
|
-
expected: "Array<string>",
|
|
41
|
-
value: input.zones
|
|
42
|
-
}, errorFactory)) && input.zones.every((elem, _index1) => "string" === typeof elem || $guard(_exceptionable, {
|
|
43
|
-
path: _path + ".zones[" + _index1 + "]",
|
|
46
|
+
}, errorFactory)) && ("string" === typeof input.path || $guard(_exceptionable, {
|
|
47
|
+
path: _path + ".path",
|
|
44
48
|
expected: "string",
|
|
49
|
+
value: input.path
|
|
50
|
+
}, errorFactory)) && ((Array.isArray(input.refs) || $guard(_exceptionable, {
|
|
51
|
+
path: _path + ".refs",
|
|
52
|
+
expected: "Array<__type>",
|
|
53
|
+
value: input.refs
|
|
54
|
+
}, errorFactory)) && input.refs.every((elem, _index1) => ("object" === typeof elem && null !== elem && false === Array.isArray(elem) || $guard(_exceptionable, {
|
|
55
|
+
path: _path + ".refs[" + _index1 + "]",
|
|
56
|
+
expected: "__type",
|
|
57
|
+
value: elem
|
|
58
|
+
}, errorFactory)) && $ao1(elem, _path + ".refs[" + _index1 + "]", true && _exceptionable) || $guard(_exceptionable, {
|
|
59
|
+
path: _path + ".refs[" + _index1 + "]",
|
|
60
|
+
expected: "__type",
|
|
45
61
|
value: elem
|
|
46
62
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
47
|
-
path: _path + ".
|
|
48
|
-
expected: "Array<
|
|
49
|
-
value: input.
|
|
50
|
-
}, errorFactory)) && ((Array.isArray(input.
|
|
51
|
-
path: _path + ".
|
|
63
|
+
path: _path + ".refs",
|
|
64
|
+
expected: "Array<__type>",
|
|
65
|
+
value: input.refs
|
|
66
|
+
}, errorFactory)) && ((Array.isArray(input.tags) || $guard(_exceptionable, {
|
|
67
|
+
path: _path + ".tags",
|
|
52
68
|
expected: "Array<string>",
|
|
53
|
-
value: input.
|
|
54
|
-
}, errorFactory)) && input.
|
|
55
|
-
path: _path + ".
|
|
69
|
+
value: input.tags
|
|
70
|
+
}, errorFactory)) && input.tags.every((elem, _index2) => "string" === typeof elem || $guard(_exceptionable, {
|
|
71
|
+
path: _path + ".tags[" + _index2 + "]",
|
|
56
72
|
expected: "string",
|
|
57
73
|
value: elem
|
|
58
74
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
59
|
-
path: _path + ".
|
|
75
|
+
path: _path + ".tags",
|
|
60
76
|
expected: "Array<string>",
|
|
61
|
-
value: input.
|
|
77
|
+
value: input.tags
|
|
78
|
+
}, errorFactory)) && ((Array.isArray(input.error) || $guard(_exceptionable, {
|
|
79
|
+
path: _path + ".error",
|
|
80
|
+
expected: "Array<__type>.o1",
|
|
81
|
+
value: input.error
|
|
82
|
+
}, errorFactory)) && input.error.every((elem, _index3) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
|
|
83
|
+
path: _path + ".error[" + _index3 + "]",
|
|
84
|
+
expected: "__type.o1",
|
|
85
|
+
value: elem
|
|
86
|
+
}, errorFactory)) && $ao2(elem, _path + ".error[" + _index3 + "]", true && _exceptionable) || $guard(_exceptionable, {
|
|
87
|
+
path: _path + ".error[" + _index3 + "]",
|
|
88
|
+
expected: "__type.o1",
|
|
89
|
+
value: elem
|
|
90
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
91
|
+
path: _path + ".error",
|
|
92
|
+
expected: "Array<__type>.o1",
|
|
93
|
+
value: input.error
|
|
94
|
+
}, errorFactory)) && ("string" === typeof input.resumable || $guard(_exceptionable, {
|
|
95
|
+
path: _path + ".resumable",
|
|
96
|
+
expected: "string",
|
|
97
|
+
value: input.resumable
|
|
98
|
+
}, errorFactory)) && ("string" === typeof input.mimeType || $guard(_exceptionable, {
|
|
99
|
+
path: _path + ".mimeType",
|
|
100
|
+
expected: "string",
|
|
101
|
+
value: input.mimeType
|
|
102
|
+
}, errorFactory)) && ("string" === typeof input.hash && (/^([A-Fa-f0-9]{32})?$/.test(input.hash) || $guard(_exceptionable, {
|
|
103
|
+
path: _path + ".hash",
|
|
104
|
+
expected: "string & Pattern<\"^([A-Fa-f0-9]{32})?$\">",
|
|
105
|
+
value: input.hash
|
|
106
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
107
|
+
path: _path + ".hash",
|
|
108
|
+
expected: "(string & Pattern<\"^([A-Fa-f0-9]{32})?$\">)",
|
|
109
|
+
value: input.hash
|
|
110
|
+
}, errorFactory)) && ("number" === typeof input.btime && (0 <= input.btime || $guard(_exceptionable, {
|
|
111
|
+
path: _path + ".btime",
|
|
112
|
+
expected: "number & Minimum<0>",
|
|
113
|
+
value: input.btime
|
|
114
|
+
}, errorFactory)) && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 4294967295 || $guard(_exceptionable, {
|
|
115
|
+
path: _path + ".btime",
|
|
116
|
+
expected: "number & Type<\"uint32\">",
|
|
117
|
+
value: input.btime
|
|
118
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
119
|
+
path: _path + ".btime",
|
|
120
|
+
expected: "(number & Minimum<0> & Type<\"uint32\">)",
|
|
121
|
+
value: input.btime
|
|
122
|
+
}, errorFactory));
|
|
123
|
+
const $ao1 = (input, _path, _exceptionable = true) => undefined === input.file || "string" === typeof input.file || $guard(_exceptionable, {
|
|
124
|
+
path: _path + ".file",
|
|
125
|
+
expected: "(string | undefined)",
|
|
126
|
+
value: input.file
|
|
127
|
+
}, errorFactory);
|
|
128
|
+
const $ao2 = (input, _path, _exceptionable = true) => "string" === typeof input.message || $guard(_exceptionable, {
|
|
129
|
+
path: _path + ".message",
|
|
130
|
+
expected: "string",
|
|
131
|
+
value: input.message
|
|
132
|
+
}, errorFactory);
|
|
133
|
+
return ("object" === typeof input && null !== input || $guard(true, {
|
|
134
|
+
path: _path + "",
|
|
135
|
+
expected: "File",
|
|
136
|
+
value: input
|
|
137
|
+
}, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
|
|
138
|
+
path: _path + "",
|
|
139
|
+
expected: "File",
|
|
140
|
+
value: input
|
|
141
|
+
}, errorFactory);
|
|
142
|
+
})(input, "$input", true);
|
|
143
|
+
return input;
|
|
144
|
+
};
|
|
145
|
+
export const randomFile = generator => {
|
|
146
|
+
const $generator = __typia.createRandom.generator;
|
|
147
|
+
const $pick = __typia.createRandom.pick;
|
|
148
|
+
const $ro0 = (_recursive = false, _depth = 0) => ({
|
|
149
|
+
id: (generator?.customs ?? $generator.customs)?.string?.([
|
|
150
|
+
{
|
|
151
|
+
name: "Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
|
|
152
|
+
kind: "pattern",
|
|
153
|
+
value: "^[0-9A-Za-z~][0-9A-Za-z~._: -]*$"
|
|
154
|
+
}
|
|
155
|
+
]) ?? (generator?.pattern ?? $generator.pattern)(/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/),
|
|
156
|
+
size: (generator?.customs ?? $generator.customs)?.number?.([
|
|
157
|
+
{
|
|
158
|
+
name: "Minimum<0>",
|
|
159
|
+
kind: "minimum",
|
|
160
|
+
value: 0
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
name: "Type<\"uint32\">",
|
|
164
|
+
kind: "type",
|
|
165
|
+
value: "uint32"
|
|
166
|
+
}
|
|
167
|
+
]) ?? (generator?.integer ?? $generator.integer)(0, 10),
|
|
168
|
+
seekable: (generator?.boolean ?? $generator.boolean)(),
|
|
169
|
+
deleted: (generator?.boolean ?? $generator.boolean)(),
|
|
170
|
+
path: (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)(),
|
|
171
|
+
refs: (generator?.array ?? $generator.array)(() => $ro1(_recursive, _recursive ? 1 + _depth : _depth)),
|
|
172
|
+
tags: (generator?.array ?? $generator.array)(() => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()),
|
|
173
|
+
error: (generator?.array ?? $generator.array)(() => $ro2(_recursive, _recursive ? 1 + _depth : _depth)),
|
|
174
|
+
resumable: (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)(),
|
|
175
|
+
mimeType: (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)(),
|
|
176
|
+
hash: (generator?.customs ?? $generator.customs)?.string?.([
|
|
177
|
+
{
|
|
178
|
+
name: "Pattern<\"^([A-Fa-f0-9]{32})?$\">",
|
|
179
|
+
kind: "pattern",
|
|
180
|
+
value: "^([A-Fa-f0-9]{32})?$"
|
|
181
|
+
}
|
|
182
|
+
]) ?? (generator?.pattern ?? $generator.pattern)(/^([A-Fa-f0-9]{32})?$/),
|
|
183
|
+
btime: (generator?.customs ?? $generator.customs)?.number?.([
|
|
184
|
+
{
|
|
185
|
+
name: "Minimum<0>",
|
|
186
|
+
kind: "minimum",
|
|
187
|
+
value: 0
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
name: "Type<\"uint32\">",
|
|
191
|
+
kind: "type",
|
|
192
|
+
value: "uint32"
|
|
193
|
+
}
|
|
194
|
+
]) ?? (generator?.integer ?? $generator.integer)(0, 10)
|
|
195
|
+
});
|
|
196
|
+
const $ro1 = (_recursive = false, _depth = 0) => ({
|
|
197
|
+
file: $pick([
|
|
198
|
+
() => undefined,
|
|
199
|
+
() => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()
|
|
200
|
+
])()
|
|
201
|
+
});
|
|
202
|
+
const $ro2 = (_recursive = false, _depth = 0) => ({
|
|
203
|
+
message: (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()
|
|
204
|
+
});
|
|
205
|
+
return $ro0();
|
|
206
|
+
};
|
|
207
|
+
export const assertGuardFile = (input, errorFactory) => {
|
|
208
|
+
const __is = input => {
|
|
209
|
+
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 <= 4294967295))) && "boolean" === typeof input.seekable && "boolean" === typeof input.deleted && "string" === typeof input.path && (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)) && (Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io2(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 <= 4294967295)));
|
|
210
|
+
const $io1 = input => undefined === input.file || "string" === typeof input.file;
|
|
211
|
+
const $io2 = input => "string" === typeof input.message;
|
|
212
|
+
return "object" === typeof input && null !== input && $io0(input);
|
|
213
|
+
};
|
|
214
|
+
if (false === __is(input))
|
|
215
|
+
((input, _path, _exceptionable = true) => {
|
|
216
|
+
const $guard = __typia.createAssertGuard.guard;
|
|
217
|
+
const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.id && (/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) || $guard(_exceptionable, {
|
|
218
|
+
path: _path + ".id",
|
|
219
|
+
expected: "string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
|
|
220
|
+
value: input.id
|
|
221
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
222
|
+
path: _path + ".id",
|
|
223
|
+
expected: "(string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">)",
|
|
224
|
+
value: input.id
|
|
225
|
+
}, errorFactory)) && ("number" === typeof input.size && (0 <= input.size || $guard(_exceptionable, {
|
|
226
|
+
path: _path + ".size",
|
|
227
|
+
expected: "number & Minimum<0>",
|
|
228
|
+
value: input.size
|
|
229
|
+
}, errorFactory)) && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 4294967295 || $guard(_exceptionable, {
|
|
230
|
+
path: _path + ".size",
|
|
231
|
+
expected: "number & Type<\"uint32\">",
|
|
232
|
+
value: input.size
|
|
233
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
234
|
+
path: _path + ".size",
|
|
235
|
+
expected: "(number & Minimum<0> & Type<\"uint32\">)",
|
|
236
|
+
value: input.size
|
|
237
|
+
}, errorFactory)) && ("boolean" === typeof input.seekable || $guard(_exceptionable, {
|
|
238
|
+
path: _path + ".seekable",
|
|
239
|
+
expected: "boolean",
|
|
240
|
+
value: input.seekable
|
|
241
|
+
}, errorFactory)) && ("boolean" === typeof input.deleted || $guard(_exceptionable, {
|
|
242
|
+
path: _path + ".deleted",
|
|
243
|
+
expected: "boolean",
|
|
244
|
+
value: input.deleted
|
|
245
|
+
}, errorFactory)) && ("string" === typeof input.path || $guard(_exceptionable, {
|
|
246
|
+
path: _path + ".path",
|
|
247
|
+
expected: "string",
|
|
248
|
+
value: input.path
|
|
62
249
|
}, errorFactory)) && ((Array.isArray(input.refs) || $guard(_exceptionable, {
|
|
63
250
|
path: _path + ".refs",
|
|
64
251
|
expected: "Array<__type>",
|
|
65
252
|
value: input.refs
|
|
66
|
-
}, errorFactory)) && input.refs.every((elem,
|
|
67
|
-
path: _path + ".refs[" +
|
|
253
|
+
}, errorFactory)) && input.refs.every((elem, _index1) => ("object" === typeof elem && null !== elem && false === Array.isArray(elem) || $guard(_exceptionable, {
|
|
254
|
+
path: _path + ".refs[" + _index1 + "]",
|
|
68
255
|
expected: "__type",
|
|
69
256
|
value: elem
|
|
70
|
-
}, errorFactory)) && $ao1(elem, _path + ".refs[" +
|
|
71
|
-
path: _path + ".refs[" +
|
|
257
|
+
}, errorFactory)) && $ao1(elem, _path + ".refs[" + _index1 + "]", true && _exceptionable) || $guard(_exceptionable, {
|
|
258
|
+
path: _path + ".refs[" + _index1 + "]",
|
|
72
259
|
expected: "__type",
|
|
73
260
|
value: elem
|
|
74
261
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
75
262
|
path: _path + ".refs",
|
|
76
263
|
expected: "Array<__type>",
|
|
77
264
|
value: input.refs
|
|
78
|
-
}, errorFactory)) && (
|
|
265
|
+
}, errorFactory)) && ((Array.isArray(input.tags) || $guard(_exceptionable, {
|
|
266
|
+
path: _path + ".tags",
|
|
267
|
+
expected: "Array<string>",
|
|
268
|
+
value: input.tags
|
|
269
|
+
}, errorFactory)) && input.tags.every((elem, _index2) => "string" === typeof elem || $guard(_exceptionable, {
|
|
270
|
+
path: _path + ".tags[" + _index2 + "]",
|
|
271
|
+
expected: "string",
|
|
272
|
+
value: elem
|
|
273
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
274
|
+
path: _path + ".tags",
|
|
275
|
+
expected: "Array<string>",
|
|
276
|
+
value: input.tags
|
|
277
|
+
}, errorFactory)) && ((Array.isArray(input.error) || $guard(_exceptionable, {
|
|
278
|
+
path: _path + ".error",
|
|
279
|
+
expected: "Array<__type>.o1",
|
|
280
|
+
value: input.error
|
|
281
|
+
}, errorFactory)) && input.error.every((elem, _index3) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
|
|
282
|
+
path: _path + ".error[" + _index3 + "]",
|
|
283
|
+
expected: "__type.o1",
|
|
284
|
+
value: elem
|
|
285
|
+
}, errorFactory)) && $ao2(elem, _path + ".error[" + _index3 + "]", true && _exceptionable) || $guard(_exceptionable, {
|
|
286
|
+
path: _path + ".error[" + _index3 + "]",
|
|
287
|
+
expected: "__type.o1",
|
|
288
|
+
value: elem
|
|
289
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
290
|
+
path: _path + ".error",
|
|
291
|
+
expected: "Array<__type>.o1",
|
|
292
|
+
value: input.error
|
|
293
|
+
}, errorFactory)) && ("string" === typeof input.resumable || $guard(_exceptionable, {
|
|
294
|
+
path: _path + ".resumable",
|
|
295
|
+
expected: "string",
|
|
296
|
+
value: input.resumable
|
|
297
|
+
}, errorFactory)) && ("string" === typeof input.mimeType || $guard(_exceptionable, {
|
|
298
|
+
path: _path + ".mimeType",
|
|
299
|
+
expected: "string",
|
|
300
|
+
value: input.mimeType
|
|
301
|
+
}, errorFactory)) && ("string" === typeof input.hash && (/^([A-Fa-f0-9]{32})?$/.test(input.hash) || $guard(_exceptionable, {
|
|
302
|
+
path: _path + ".hash",
|
|
303
|
+
expected: "string & Pattern<\"^([A-Fa-f0-9]{32})?$\">",
|
|
304
|
+
value: input.hash
|
|
305
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
306
|
+
path: _path + ".hash",
|
|
307
|
+
expected: "(string & Pattern<\"^([A-Fa-f0-9]{32})?$\">)",
|
|
308
|
+
value: input.hash
|
|
309
|
+
}, errorFactory)) && ("number" === typeof input.btime && (0 <= input.btime || $guard(_exceptionable, {
|
|
310
|
+
path: _path + ".btime",
|
|
311
|
+
expected: "number & Minimum<0>",
|
|
312
|
+
value: input.btime
|
|
313
|
+
}, errorFactory)) && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 4294967295 || $guard(_exceptionable, {
|
|
79
314
|
path: _path + ".btime",
|
|
80
|
-
expected: "
|
|
315
|
+
expected: "number & Type<\"uint32\">",
|
|
81
316
|
value: input.btime
|
|
317
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
318
|
+
path: _path + ".btime",
|
|
319
|
+
expected: "(number & Minimum<0> & Type<\"uint32\">)",
|
|
320
|
+
value: input.btime
|
|
321
|
+
}, errorFactory));
|
|
322
|
+
const $ao1 = (input, _path, _exceptionable = true) => undefined === input.file || "string" === typeof input.file || $guard(_exceptionable, {
|
|
323
|
+
path: _path + ".file",
|
|
324
|
+
expected: "(string | undefined)",
|
|
325
|
+
value: input.file
|
|
326
|
+
}, errorFactory);
|
|
327
|
+
const $ao2 = (input, _path, _exceptionable = true) => "string" === typeof input.message || $guard(_exceptionable, {
|
|
328
|
+
path: _path + ".message",
|
|
329
|
+
expected: "string",
|
|
330
|
+
value: input.message
|
|
331
|
+
}, errorFactory);
|
|
332
|
+
return ("object" === typeof input && null !== input || $guard(true, {
|
|
333
|
+
path: _path + "",
|
|
334
|
+
expected: "File",
|
|
335
|
+
value: input
|
|
336
|
+
}, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
|
|
337
|
+
path: _path + "",
|
|
338
|
+
expected: "File",
|
|
339
|
+
value: input
|
|
340
|
+
}, errorFactory);
|
|
341
|
+
})(input, "$input", true);
|
|
342
|
+
};
|
|
343
|
+
export const stringifyFile = input => {
|
|
344
|
+
const $io1 = input => undefined === input.file || "string" === typeof input.file;
|
|
345
|
+
const $io2 = input => "string" === typeof input.message;
|
|
346
|
+
const $string = __typia.json.createStringify.string;
|
|
347
|
+
const $tail = __typia.json.createStringify.tail;
|
|
348
|
+
const $so0 = input => `{"id":${$string(input.id)},"size":${input.size},"seekable":${input.seekable},"deleted":${input.deleted},"path":${$string(input.path)},"refs":${`[${input.refs.map(elem => $so1(elem)).join(",")}]`},"tags":${`[${input.tags.map(elem => $string(elem)).join(",")}]`},"error":${`[${input.error.map(elem => `{"message":${$string(elem.message)}}`).join(",")}]`},"resumable":${$string(input.resumable)},"mimeType":${$string(input.mimeType)},"hash":${$string(input.hash)},"btime":${input.btime}}`;
|
|
349
|
+
const $so1 = input => `{${$tail(`${undefined === input.file ? "" : `"file":${undefined !== input.file ? $string(input.file) : undefined}`}`)}}`;
|
|
350
|
+
return $so0(input);
|
|
351
|
+
};
|
|
352
|
+
export const assertStringifyFile = (input, errorFactory) => { const assert = (input, errorFactory) => {
|
|
353
|
+
const __is = input => {
|
|
354
|
+
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 <= 4294967295))) && "boolean" === typeof input.seekable && "boolean" === typeof input.deleted && "string" === typeof input.path && (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)) && (Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io2(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 <= 4294967295)));
|
|
355
|
+
const $io1 = input => undefined === input.file || "string" === typeof input.file;
|
|
356
|
+
const $io2 = input => "string" === typeof input.message;
|
|
357
|
+
return "object" === typeof input && null !== input && $io0(input);
|
|
358
|
+
};
|
|
359
|
+
if (false === __is(input))
|
|
360
|
+
((input, _path, _exceptionable = true) => {
|
|
361
|
+
const $guard = __typia.json.createAssertStringify.guard;
|
|
362
|
+
const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.id && (/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) || $guard(_exceptionable, {
|
|
363
|
+
path: _path + ".id",
|
|
364
|
+
expected: "string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
|
|
365
|
+
value: input.id
|
|
366
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
367
|
+
path: _path + ".id",
|
|
368
|
+
expected: "(string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">)",
|
|
369
|
+
value: input.id
|
|
370
|
+
}, errorFactory)) && ("number" === typeof input.size && (0 <= input.size || $guard(_exceptionable, {
|
|
371
|
+
path: _path + ".size",
|
|
372
|
+
expected: "number & Minimum<0>",
|
|
373
|
+
value: input.size
|
|
374
|
+
}, errorFactory)) && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 4294967295 || $guard(_exceptionable, {
|
|
375
|
+
path: _path + ".size",
|
|
376
|
+
expected: "number & Type<\"uint32\">",
|
|
377
|
+
value: input.size
|
|
378
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
379
|
+
path: _path + ".size",
|
|
380
|
+
expected: "(number & Minimum<0> & Type<\"uint32\">)",
|
|
381
|
+
value: input.size
|
|
82
382
|
}, errorFactory)) && ("boolean" === typeof input.seekable || $guard(_exceptionable, {
|
|
83
383
|
path: _path + ".seekable",
|
|
84
384
|
expected: "boolean",
|
|
85
385
|
value: input.seekable
|
|
86
|
-
}, errorFactory)) && ("boolean" === typeof input.
|
|
87
|
-
path: _path + ".
|
|
386
|
+
}, errorFactory)) && ("boolean" === typeof input.deleted || $guard(_exceptionable, {
|
|
387
|
+
path: _path + ".deleted",
|
|
88
388
|
expected: "boolean",
|
|
389
|
+
value: input.deleted
|
|
390
|
+
}, errorFactory)) && ("string" === typeof input.path || $guard(_exceptionable, {
|
|
391
|
+
path: _path + ".path",
|
|
392
|
+
expected: "string",
|
|
393
|
+
value: input.path
|
|
394
|
+
}, errorFactory)) && ((Array.isArray(input.refs) || $guard(_exceptionable, {
|
|
395
|
+
path: _path + ".refs",
|
|
396
|
+
expected: "Array<__type>",
|
|
397
|
+
value: input.refs
|
|
398
|
+
}, errorFactory)) && input.refs.every((elem, _index1) => ("object" === typeof elem && null !== elem && false === Array.isArray(elem) || $guard(_exceptionable, {
|
|
399
|
+
path: _path + ".refs[" + _index1 + "]",
|
|
400
|
+
expected: "__type",
|
|
401
|
+
value: elem
|
|
402
|
+
}, errorFactory)) && $ao1(elem, _path + ".refs[" + _index1 + "]", true && _exceptionable) || $guard(_exceptionable, {
|
|
403
|
+
path: _path + ".refs[" + _index1 + "]",
|
|
404
|
+
expected: "__type",
|
|
405
|
+
value: elem
|
|
406
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
407
|
+
path: _path + ".refs",
|
|
408
|
+
expected: "Array<__type>",
|
|
409
|
+
value: input.refs
|
|
410
|
+
}, errorFactory)) && ((Array.isArray(input.tags) || $guard(_exceptionable, {
|
|
411
|
+
path: _path + ".tags",
|
|
412
|
+
expected: "Array<string>",
|
|
413
|
+
value: input.tags
|
|
414
|
+
}, errorFactory)) && input.tags.every((elem, _index2) => "string" === typeof elem || $guard(_exceptionable, {
|
|
415
|
+
path: _path + ".tags[" + _index2 + "]",
|
|
416
|
+
expected: "string",
|
|
417
|
+
value: elem
|
|
418
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
419
|
+
path: _path + ".tags",
|
|
420
|
+
expected: "Array<string>",
|
|
421
|
+
value: input.tags
|
|
422
|
+
}, errorFactory)) && ((Array.isArray(input.error) || $guard(_exceptionable, {
|
|
423
|
+
path: _path + ".error",
|
|
424
|
+
expected: "Array<__type>.o1",
|
|
425
|
+
value: input.error
|
|
426
|
+
}, errorFactory)) && input.error.every((elem, _index3) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
|
|
427
|
+
path: _path + ".error[" + _index3 + "]",
|
|
428
|
+
expected: "__type.o1",
|
|
429
|
+
value: elem
|
|
430
|
+
}, errorFactory)) && $ao2(elem, _path + ".error[" + _index3 + "]", true && _exceptionable) || $guard(_exceptionable, {
|
|
431
|
+
path: _path + ".error[" + _index3 + "]",
|
|
432
|
+
expected: "__type.o1",
|
|
433
|
+
value: elem
|
|
434
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
435
|
+
path: _path + ".error",
|
|
436
|
+
expected: "Array<__type>.o1",
|
|
437
|
+
value: input.error
|
|
438
|
+
}, errorFactory)) && ("string" === typeof input.resumable || $guard(_exceptionable, {
|
|
439
|
+
path: _path + ".resumable",
|
|
440
|
+
expected: "string",
|
|
89
441
|
value: input.resumable
|
|
90
|
-
}, errorFactory)) && (
|
|
91
|
-
path: _path + ".
|
|
442
|
+
}, errorFactory)) && ("string" === typeof input.mimeType || $guard(_exceptionable, {
|
|
443
|
+
path: _path + ".mimeType",
|
|
444
|
+
expected: "string",
|
|
445
|
+
value: input.mimeType
|
|
446
|
+
}, errorFactory)) && ("string" === typeof input.hash && (/^([A-Fa-f0-9]{32})?$/.test(input.hash) || $guard(_exceptionable, {
|
|
447
|
+
path: _path + ".hash",
|
|
448
|
+
expected: "string & Pattern<\"^([A-Fa-f0-9]{32})?$\">",
|
|
449
|
+
value: input.hash
|
|
450
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
451
|
+
path: _path + ".hash",
|
|
452
|
+
expected: "(string & Pattern<\"^([A-Fa-f0-9]{32})?$\">)",
|
|
453
|
+
value: input.hash
|
|
454
|
+
}, errorFactory)) && ("number" === typeof input.btime && (0 <= input.btime || $guard(_exceptionable, {
|
|
455
|
+
path: _path + ".btime",
|
|
92
456
|
expected: "number & Minimum<0>",
|
|
93
|
-
value: input.
|
|
457
|
+
value: input.btime
|
|
458
|
+
}, errorFactory)) && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 4294967295 || $guard(_exceptionable, {
|
|
459
|
+
path: _path + ".btime",
|
|
460
|
+
expected: "number & Type<\"uint32\">",
|
|
461
|
+
value: input.btime
|
|
94
462
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
95
|
-
path: _path + ".
|
|
96
|
-
expected: "(
|
|
97
|
-
value: input.
|
|
98
|
-
}, errorFactory))
|
|
463
|
+
path: _path + ".btime",
|
|
464
|
+
expected: "(number & Minimum<0> & Type<\"uint32\">)",
|
|
465
|
+
value: input.btime
|
|
466
|
+
}, errorFactory));
|
|
467
|
+
const $ao1 = (input, _path, _exceptionable = true) => undefined === input.file || "string" === typeof input.file || $guard(_exceptionable, {
|
|
468
|
+
path: _path + ".file",
|
|
469
|
+
expected: "(string | undefined)",
|
|
470
|
+
value: input.file
|
|
471
|
+
}, errorFactory);
|
|
472
|
+
const $ao2 = (input, _path, _exceptionable = true) => "string" === typeof input.message || $guard(_exceptionable, {
|
|
473
|
+
path: _path + ".message",
|
|
474
|
+
expected: "string",
|
|
475
|
+
value: input.message
|
|
476
|
+
}, errorFactory);
|
|
477
|
+
return ("object" === typeof input && null !== input || $guard(true, {
|
|
478
|
+
path: _path + "",
|
|
479
|
+
expected: "File",
|
|
480
|
+
value: input
|
|
481
|
+
}, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
|
|
482
|
+
path: _path + "",
|
|
483
|
+
expected: "File",
|
|
484
|
+
value: input
|
|
485
|
+
}, errorFactory);
|
|
486
|
+
})(input, "$input", true);
|
|
487
|
+
return input;
|
|
488
|
+
}; const stringify = input => {
|
|
489
|
+
const $io1 = input => undefined === input.file || "string" === typeof input.file;
|
|
490
|
+
const $io2 = input => "string" === typeof input.message;
|
|
491
|
+
const $string = __typia.json.createAssertStringify.string;
|
|
492
|
+
const $tail = __typia.json.createAssertStringify.tail;
|
|
493
|
+
const $so0 = input => `{"id":${$string(input.id)},"size":${input.size},"seekable":${input.seekable},"deleted":${input.deleted},"path":${$string(input.path)},"refs":${`[${input.refs.map(elem => $so1(elem)).join(",")}]`},"tags":${`[${input.tags.map(elem => $string(elem)).join(",")}]`},"error":${`[${input.error.map(elem => `{"message":${$string(elem.message)}}`).join(",")}]`},"resumable":${$string(input.resumable)},"mimeType":${$string(input.mimeType)},"hash":${$string(input.hash)},"btime":${input.btime}}`;
|
|
494
|
+
const $so1 = input => `{${$tail(`${undefined === input.file ? "" : `"file":${undefined !== input.file ? $string(input.file) : undefined}`}`)}}`;
|
|
495
|
+
return $so0(input);
|
|
496
|
+
}; return stringify(assert(input, errorFactory)); };
|
|
497
|
+
export const isFileStats = input => {
|
|
498
|
+
const $io0 = input => "number" === typeof input.position && (0 <= input.position && (Math.floor(input.position) === input.position && 0 <= input.position && input.position <= 4294967295)) && "boolean" === typeof input.uploading && "boolean" === typeof input.completed && (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)) && ("number" === typeof input.size && (0 <= input.size && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 4294967295))) && "boolean" === typeof input.seekable && "boolean" === typeof input.deleted && "string" === typeof input.path && (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)) && (Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io2(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 <= 4294967295)));
|
|
499
|
+
const $io1 = input => undefined === input.file || "string" === typeof input.file;
|
|
500
|
+
const $io2 = input => "string" === typeof input.message;
|
|
501
|
+
return "object" === typeof input && null !== input && $io0(input);
|
|
502
|
+
};
|
|
503
|
+
export const assertFileStats = (input, errorFactory) => {
|
|
504
|
+
const __is = input => {
|
|
505
|
+
const $io0 = input => "number" === typeof input.position && (0 <= input.position && (Math.floor(input.position) === input.position && 0 <= input.position && input.position <= 4294967295)) && "boolean" === typeof input.uploading && "boolean" === typeof input.completed && (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)) && ("number" === typeof input.size && (0 <= input.size && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 4294967295))) && "boolean" === typeof input.seekable && "boolean" === typeof input.deleted && "string" === typeof input.path && (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)) && (Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io2(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 <= 4294967295)));
|
|
506
|
+
const $io1 = input => undefined === input.file || "string" === typeof input.file;
|
|
507
|
+
const $io2 = input => "string" === typeof input.message;
|
|
508
|
+
return "object" === typeof input && null !== input && $io0(input);
|
|
509
|
+
};
|
|
510
|
+
if (false === __is(input))
|
|
511
|
+
((input, _path, _exceptionable = true) => {
|
|
512
|
+
const $guard = __typia.createAssert.guard;
|
|
513
|
+
const $ao0 = (input, _path, _exceptionable = true) => ("number" === typeof input.position && (0 <= input.position || $guard(_exceptionable, {
|
|
99
514
|
path: _path + ".position",
|
|
100
515
|
expected: "number & Minimum<0>",
|
|
101
516
|
value: input.position
|
|
517
|
+
}, errorFactory)) && (Math.floor(input.position) === input.position && 0 <= input.position && input.position <= 4294967295 || $guard(_exceptionable, {
|
|
518
|
+
path: _path + ".position",
|
|
519
|
+
expected: "number & Type<\"uint32\">",
|
|
520
|
+
value: input.position
|
|
102
521
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
103
522
|
path: _path + ".position",
|
|
104
|
-
expected: "(
|
|
523
|
+
expected: "(number & Minimum<0> & Type<\"uint32\">)",
|
|
105
524
|
value: input.position
|
|
106
|
-
}, errorFactory)) && (
|
|
107
|
-
path: _path + ".
|
|
108
|
-
expected: "
|
|
109
|
-
value: input.
|
|
525
|
+
}, errorFactory)) && ("boolean" === typeof input.uploading || $guard(_exceptionable, {
|
|
526
|
+
path: _path + ".uploading",
|
|
527
|
+
expected: "boolean",
|
|
528
|
+
value: input.uploading
|
|
529
|
+
}, errorFactory)) && ("boolean" === typeof input.completed || $guard(_exceptionable, {
|
|
530
|
+
path: _path + ".completed",
|
|
531
|
+
expected: "boolean",
|
|
532
|
+
value: input.completed
|
|
533
|
+
}, errorFactory)) && ((Array.isArray(input.zones) || $guard(_exceptionable, {
|
|
534
|
+
path: _path + ".zones",
|
|
535
|
+
expected: "Array<string>",
|
|
536
|
+
value: input.zones
|
|
537
|
+
}, errorFactory)) && input.zones.every((elem, _index1) => "string" === typeof elem || $guard(_exceptionable, {
|
|
538
|
+
path: _path + ".zones[" + _index1 + "]",
|
|
539
|
+
expected: "string",
|
|
540
|
+
value: elem
|
|
541
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
542
|
+
path: _path + ".zones",
|
|
543
|
+
expected: "Array<string>",
|
|
544
|
+
value: input.zones
|
|
545
|
+
}, errorFactory)) && ((Array.isArray(input.replicas) || $guard(_exceptionable, {
|
|
546
|
+
path: _path + ".replicas",
|
|
547
|
+
expected: "Array<string>",
|
|
548
|
+
value: input.replicas
|
|
549
|
+
}, errorFactory)) && input.replicas.every((elem, _index2) => "string" === typeof elem || $guard(_exceptionable, {
|
|
550
|
+
path: _path + ".replicas[" + _index2 + "]",
|
|
551
|
+
expected: "string",
|
|
552
|
+
value: elem
|
|
553
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
554
|
+
path: _path + ".replicas",
|
|
555
|
+
expected: "Array<string>",
|
|
556
|
+
value: input.replicas
|
|
557
|
+
}, errorFactory)) && ("string" === typeof input.id && (/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) || $guard(_exceptionable, {
|
|
558
|
+
path: _path + ".id",
|
|
559
|
+
expected: "string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
|
|
560
|
+
value: input.id
|
|
561
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
562
|
+
path: _path + ".id",
|
|
563
|
+
expected: "(string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">)",
|
|
564
|
+
value: input.id
|
|
565
|
+
}, errorFactory)) && ("number" === typeof input.size && (0 <= input.size || $guard(_exceptionable, {
|
|
566
|
+
path: _path + ".size",
|
|
567
|
+
expected: "number & Minimum<0>",
|
|
568
|
+
value: input.size
|
|
569
|
+
}, errorFactory)) && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 4294967295 || $guard(_exceptionable, {
|
|
570
|
+
path: _path + ".size",
|
|
571
|
+
expected: "number & Type<\"uint32\">",
|
|
572
|
+
value: input.size
|
|
573
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
574
|
+
path: _path + ".size",
|
|
575
|
+
expected: "(number & Minimum<0> & Type<\"uint32\">)",
|
|
576
|
+
value: input.size
|
|
577
|
+
}, errorFactory)) && ("boolean" === typeof input.seekable || $guard(_exceptionable, {
|
|
578
|
+
path: _path + ".seekable",
|
|
579
|
+
expected: "boolean",
|
|
580
|
+
value: input.seekable
|
|
581
|
+
}, errorFactory)) && ("boolean" === typeof input.deleted || $guard(_exceptionable, {
|
|
582
|
+
path: _path + ".deleted",
|
|
583
|
+
expected: "boolean",
|
|
584
|
+
value: input.deleted
|
|
585
|
+
}, errorFactory)) && ("string" === typeof input.path || $guard(_exceptionable, {
|
|
586
|
+
path: _path + ".path",
|
|
587
|
+
expected: "string",
|
|
588
|
+
value: input.path
|
|
589
|
+
}, errorFactory)) && ((Array.isArray(input.refs) || $guard(_exceptionable, {
|
|
590
|
+
path: _path + ".refs",
|
|
591
|
+
expected: "Array<__type>",
|
|
592
|
+
value: input.refs
|
|
593
|
+
}, errorFactory)) && input.refs.every((elem, _index3) => ("object" === typeof elem && null !== elem && false === Array.isArray(elem) || $guard(_exceptionable, {
|
|
594
|
+
path: _path + ".refs[" + _index3 + "]",
|
|
595
|
+
expected: "__type",
|
|
596
|
+
value: elem
|
|
597
|
+
}, errorFactory)) && $ao1(elem, _path + ".refs[" + _index3 + "]", true && _exceptionable) || $guard(_exceptionable, {
|
|
598
|
+
path: _path + ".refs[" + _index3 + "]",
|
|
599
|
+
expected: "__type",
|
|
600
|
+
value: elem
|
|
110
601
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
111
|
-
path: _path + ".
|
|
112
|
-
expected: "
|
|
113
|
-
value: input.
|
|
114
|
-
}, errorFactory)) && (null === input.mimeType || "string" === typeof input.mimeType || $guard(_exceptionable, {
|
|
115
|
-
path: _path + ".mimeType",
|
|
116
|
-
expected: "(null | string)",
|
|
117
|
-
value: input.mimeType
|
|
602
|
+
path: _path + ".refs",
|
|
603
|
+
expected: "Array<__type>",
|
|
604
|
+
value: input.refs
|
|
118
605
|
}, errorFactory)) && ((Array.isArray(input.tags) || $guard(_exceptionable, {
|
|
119
606
|
path: _path + ".tags",
|
|
120
607
|
expected: "Array<string>",
|
|
@@ -143,6 +630,34 @@ export const assertFile = (input, errorFactory) => {
|
|
|
143
630
|
path: _path + ".error",
|
|
144
631
|
expected: "Array<__type>.o1",
|
|
145
632
|
value: input.error
|
|
633
|
+
}, errorFactory)) && ("string" === typeof input.resumable || $guard(_exceptionable, {
|
|
634
|
+
path: _path + ".resumable",
|
|
635
|
+
expected: "string",
|
|
636
|
+
value: input.resumable
|
|
637
|
+
}, errorFactory)) && ("string" === typeof input.mimeType || $guard(_exceptionable, {
|
|
638
|
+
path: _path + ".mimeType",
|
|
639
|
+
expected: "string",
|
|
640
|
+
value: input.mimeType
|
|
641
|
+
}, errorFactory)) && ("string" === typeof input.hash && (/^([A-Fa-f0-9]{32})?$/.test(input.hash) || $guard(_exceptionable, {
|
|
642
|
+
path: _path + ".hash",
|
|
643
|
+
expected: "string & Pattern<\"^([A-Fa-f0-9]{32})?$\">",
|
|
644
|
+
value: input.hash
|
|
645
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
646
|
+
path: _path + ".hash",
|
|
647
|
+
expected: "(string & Pattern<\"^([A-Fa-f0-9]{32})?$\">)",
|
|
648
|
+
value: input.hash
|
|
649
|
+
}, errorFactory)) && ("number" === typeof input.btime && (0 <= input.btime || $guard(_exceptionable, {
|
|
650
|
+
path: _path + ".btime",
|
|
651
|
+
expected: "number & Minimum<0>",
|
|
652
|
+
value: input.btime
|
|
653
|
+
}, errorFactory)) && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 4294967295 || $guard(_exceptionable, {
|
|
654
|
+
path: _path + ".btime",
|
|
655
|
+
expected: "number & Type<\"uint32\">",
|
|
656
|
+
value: input.btime
|
|
657
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
658
|
+
path: _path + ".btime",
|
|
659
|
+
expected: "(number & Minimum<0> & Type<\"uint32\">)",
|
|
660
|
+
value: input.btime
|
|
146
661
|
}, errorFactory));
|
|
147
662
|
const $ao1 = (input, _path, _exceptionable = true) => undefined === input.file || "string" === typeof input.file || $guard(_exceptionable, {
|
|
148
663
|
path: _path + ".file",
|
|
@@ -156,82 +671,82 @@ export const assertFile = (input, errorFactory) => {
|
|
|
156
671
|
}, errorFactory);
|
|
157
672
|
return ("object" === typeof input && null !== input || $guard(true, {
|
|
158
673
|
path: _path + "",
|
|
159
|
-
expected: "
|
|
674
|
+
expected: "FileStats",
|
|
160
675
|
value: input
|
|
161
676
|
}, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
|
|
162
677
|
path: _path + "",
|
|
163
|
-
expected: "
|
|
678
|
+
expected: "FileStats",
|
|
164
679
|
value: input
|
|
165
680
|
}, errorFactory);
|
|
166
681
|
})(input, "$input", true);
|
|
167
682
|
return input;
|
|
168
683
|
};
|
|
169
|
-
export const
|
|
684
|
+
export const randomFileStats = generator => {
|
|
170
685
|
const $generator = __typia.createRandom.generator;
|
|
171
686
|
const $pick = __typia.createRandom.pick;
|
|
172
687
|
const $ro0 = (_recursive = false, _depth = 0) => ({
|
|
173
|
-
|
|
688
|
+
position: (generator?.customs ?? $generator.customs)?.number?.([
|
|
174
689
|
{
|
|
175
|
-
name: "
|
|
176
|
-
kind: "
|
|
177
|
-
value:
|
|
690
|
+
name: "Minimum<0>",
|
|
691
|
+
kind: "minimum",
|
|
692
|
+
value: 0
|
|
693
|
+
},
|
|
694
|
+
{
|
|
695
|
+
name: "Type<\"uint32\">",
|
|
696
|
+
kind: "type",
|
|
697
|
+
value: "uint32"
|
|
178
698
|
}
|
|
179
|
-
]) ?? (generator?.
|
|
180
|
-
deleted: (generator?.boolean ?? $generator.boolean)(),
|
|
181
|
-
completed: (generator?.boolean ?? $generator.boolean)(),
|
|
699
|
+
]) ?? (generator?.integer ?? $generator.integer)(0, 10),
|
|
182
700
|
uploading: (generator?.boolean ?? $generator.boolean)(),
|
|
701
|
+
completed: (generator?.boolean ?? $generator.boolean)(),
|
|
183
702
|
zones: (generator?.array ?? $generator.array)(() => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()),
|
|
184
703
|
replicas: (generator?.array ?? $generator.array)(() => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()),
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
704
|
+
id: (generator?.customs ?? $generator.customs)?.string?.([
|
|
705
|
+
{
|
|
706
|
+
name: "Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
|
|
707
|
+
kind: "pattern",
|
|
708
|
+
value: "^[0-9A-Za-z~][0-9A-Za-z~._: -]*$"
|
|
709
|
+
}
|
|
710
|
+
]) ?? (generator?.pattern ?? $generator.pattern)(/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/),
|
|
711
|
+
size: (generator?.customs ?? $generator.customs)?.number?.([
|
|
712
|
+
{
|
|
713
|
+
name: "Minimum<0>",
|
|
714
|
+
kind: "minimum",
|
|
715
|
+
value: 0
|
|
716
|
+
},
|
|
717
|
+
{
|
|
718
|
+
name: "Type<\"uint32\">",
|
|
719
|
+
kind: "type",
|
|
720
|
+
value: "uint32"
|
|
721
|
+
}
|
|
722
|
+
]) ?? (generator?.integer ?? $generator.integer)(0, 10),
|
|
190
723
|
seekable: (generator?.boolean ?? $generator.boolean)(),
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
() => (generator?.customs ?? $generator.customs)?.number?.([
|
|
195
|
-
{
|
|
196
|
-
name: "Minimum<0>",
|
|
197
|
-
kind: "minimum",
|
|
198
|
-
value: 0
|
|
199
|
-
}
|
|
200
|
-
]) ?? (generator?.number ?? $generator.number)(0, 10)
|
|
201
|
-
])(),
|
|
202
|
-
position: $pick([
|
|
203
|
-
() => null,
|
|
204
|
-
() => (generator?.customs ?? $generator.customs)?.number?.([
|
|
205
|
-
{
|
|
206
|
-
name: "Minimum<0>",
|
|
207
|
-
kind: "minimum",
|
|
208
|
-
value: 0
|
|
209
|
-
}
|
|
210
|
-
]) ?? (generator?.number ?? $generator.number)(0, 10)
|
|
211
|
-
])(),
|
|
212
|
-
hash: $pick([
|
|
213
|
-
() => null,
|
|
214
|
-
() => (generator?.customs ?? $generator.customs)?.string?.([
|
|
215
|
-
{
|
|
216
|
-
name: "MaxLength<0>",
|
|
217
|
-
kind: "maxLength",
|
|
218
|
-
value: 0
|
|
219
|
-
}
|
|
220
|
-
]) ?? (generator?.string ?? $generator.string)((generator?.integer ?? $generator.integer)(0, 0)),
|
|
221
|
-
() => (generator?.customs ?? $generator.customs)?.string?.([
|
|
222
|
-
{
|
|
223
|
-
name: "Pattern<\"^[A-Fa-f0-9]{32}$\">",
|
|
224
|
-
kind: "pattern",
|
|
225
|
-
value: "^[A-Fa-f0-9]{32}$"
|
|
226
|
-
}
|
|
227
|
-
]) ?? (generator?.pattern ?? $generator.pattern)(/^[A-Fa-f0-9]{32}$/)
|
|
228
|
-
])(),
|
|
229
|
-
mimeType: $pick([
|
|
230
|
-
() => null,
|
|
231
|
-
() => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()
|
|
232
|
-
])(),
|
|
724
|
+
deleted: (generator?.boolean ?? $generator.boolean)(),
|
|
725
|
+
path: (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)(),
|
|
726
|
+
refs: (generator?.array ?? $generator.array)(() => $ro1(_recursive, _recursive ? 1 + _depth : _depth)),
|
|
233
727
|
tags: (generator?.array ?? $generator.array)(() => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()),
|
|
234
|
-
error: (generator?.array ?? $generator.array)(() => $ro2(_recursive, _recursive ? 1 + _depth : _depth))
|
|
728
|
+
error: (generator?.array ?? $generator.array)(() => $ro2(_recursive, _recursive ? 1 + _depth : _depth)),
|
|
729
|
+
resumable: (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)(),
|
|
730
|
+
mimeType: (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)(),
|
|
731
|
+
hash: (generator?.customs ?? $generator.customs)?.string?.([
|
|
732
|
+
{
|
|
733
|
+
name: "Pattern<\"^([A-Fa-f0-9]{32})?$\">",
|
|
734
|
+
kind: "pattern",
|
|
735
|
+
value: "^([A-Fa-f0-9]{32})?$"
|
|
736
|
+
}
|
|
737
|
+
]) ?? (generator?.pattern ?? $generator.pattern)(/^([A-Fa-f0-9]{32})?$/),
|
|
738
|
+
btime: (generator?.customs ?? $generator.customs)?.number?.([
|
|
739
|
+
{
|
|
740
|
+
name: "Minimum<0>",
|
|
741
|
+
kind: "minimum",
|
|
742
|
+
value: 0
|
|
743
|
+
},
|
|
744
|
+
{
|
|
745
|
+
name: "Type<\"uint32\">",
|
|
746
|
+
kind: "type",
|
|
747
|
+
value: "uint32"
|
|
748
|
+
}
|
|
749
|
+
]) ?? (generator?.integer ?? $generator.integer)(0, 10)
|
|
235
750
|
});
|
|
236
751
|
const $ro1 = (_recursive = false, _depth = 0) => ({
|
|
237
752
|
file: $pick([
|
|
@@ -244,9 +759,9 @@ export const randomFile = generator => {
|
|
|
244
759
|
});
|
|
245
760
|
return $ro0();
|
|
246
761
|
};
|
|
247
|
-
export const
|
|
762
|
+
export const assertGuardFileStats = (input, errorFactory) => {
|
|
248
763
|
const __is = input => {
|
|
249
|
-
const $io0 = input => "
|
|
764
|
+
const $io0 = input => "number" === typeof input.position && (0 <= input.position && (Math.floor(input.position) === input.position && 0 <= input.position && input.position <= 4294967295)) && "boolean" === typeof input.uploading && "boolean" === typeof input.completed && (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)) && ("number" === typeof input.size && (0 <= input.size && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 4294967295))) && "boolean" === typeof input.seekable && "boolean" === typeof input.deleted && "string" === typeof input.path && (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)) && (Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io2(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 <= 4294967295)));
|
|
250
765
|
const $io1 = input => undefined === input.file || "string" === typeof input.file;
|
|
251
766
|
const $io2 = input => "string" === typeof input.message;
|
|
252
767
|
return "object" === typeof input && null !== input && $io0(input);
|
|
@@ -254,26 +769,26 @@ export const assertGuardFile = (input, errorFactory) => {
|
|
|
254
769
|
if (false === __is(input))
|
|
255
770
|
((input, _path, _exceptionable = true) => {
|
|
256
771
|
const $guard = __typia.createAssertGuard.guard;
|
|
257
|
-
const $ao0 = (input, _path, _exceptionable = true) => ("
|
|
258
|
-
path: _path + ".
|
|
259
|
-
expected: "
|
|
260
|
-
value: input.
|
|
772
|
+
const $ao0 = (input, _path, _exceptionable = true) => ("number" === typeof input.position && (0 <= input.position || $guard(_exceptionable, {
|
|
773
|
+
path: _path + ".position",
|
|
774
|
+
expected: "number & Minimum<0>",
|
|
775
|
+
value: input.position
|
|
776
|
+
}, errorFactory)) && (Math.floor(input.position) === input.position && 0 <= input.position && input.position <= 4294967295 || $guard(_exceptionable, {
|
|
777
|
+
path: _path + ".position",
|
|
778
|
+
expected: "number & Type<\"uint32\">",
|
|
779
|
+
value: input.position
|
|
261
780
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
262
|
-
path: _path + ".
|
|
263
|
-
expected: "(
|
|
264
|
-
value: input.
|
|
265
|
-
}, errorFactory)) && ("boolean" === typeof input.
|
|
266
|
-
path: _path + ".
|
|
781
|
+
path: _path + ".position",
|
|
782
|
+
expected: "(number & Minimum<0> & Type<\"uint32\">)",
|
|
783
|
+
value: input.position
|
|
784
|
+
}, errorFactory)) && ("boolean" === typeof input.uploading || $guard(_exceptionable, {
|
|
785
|
+
path: _path + ".uploading",
|
|
267
786
|
expected: "boolean",
|
|
268
|
-
value: input.
|
|
787
|
+
value: input.uploading
|
|
269
788
|
}, errorFactory)) && ("boolean" === typeof input.completed || $guard(_exceptionable, {
|
|
270
789
|
path: _path + ".completed",
|
|
271
790
|
expected: "boolean",
|
|
272
791
|
value: input.completed
|
|
273
|
-
}, errorFactory)) && ("boolean" === typeof input.uploading || $guard(_exceptionable, {
|
|
274
|
-
path: _path + ".uploading",
|
|
275
|
-
expected: "boolean",
|
|
276
|
-
value: input.uploading
|
|
277
792
|
}, errorFactory)) && ((Array.isArray(input.zones) || $guard(_exceptionable, {
|
|
278
793
|
path: _path + ".zones",
|
|
279
794
|
expected: "Array<string>",
|
|
@@ -298,6 +813,38 @@ export const assertGuardFile = (input, errorFactory) => {
|
|
|
298
813
|
path: _path + ".replicas",
|
|
299
814
|
expected: "Array<string>",
|
|
300
815
|
value: input.replicas
|
|
816
|
+
}, errorFactory)) && ("string" === typeof input.id && (/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) || $guard(_exceptionable, {
|
|
817
|
+
path: _path + ".id",
|
|
818
|
+
expected: "string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
|
|
819
|
+
value: input.id
|
|
820
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
821
|
+
path: _path + ".id",
|
|
822
|
+
expected: "(string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">)",
|
|
823
|
+
value: input.id
|
|
824
|
+
}, errorFactory)) && ("number" === typeof input.size && (0 <= input.size || $guard(_exceptionable, {
|
|
825
|
+
path: _path + ".size",
|
|
826
|
+
expected: "number & Minimum<0>",
|
|
827
|
+
value: input.size
|
|
828
|
+
}, errorFactory)) && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 4294967295 || $guard(_exceptionable, {
|
|
829
|
+
path: _path + ".size",
|
|
830
|
+
expected: "number & Type<\"uint32\">",
|
|
831
|
+
value: input.size
|
|
832
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
833
|
+
path: _path + ".size",
|
|
834
|
+
expected: "(number & Minimum<0> & Type<\"uint32\">)",
|
|
835
|
+
value: input.size
|
|
836
|
+
}, errorFactory)) && ("boolean" === typeof input.seekable || $guard(_exceptionable, {
|
|
837
|
+
path: _path + ".seekable",
|
|
838
|
+
expected: "boolean",
|
|
839
|
+
value: input.seekable
|
|
840
|
+
}, errorFactory)) && ("boolean" === typeof input.deleted || $guard(_exceptionable, {
|
|
841
|
+
path: _path + ".deleted",
|
|
842
|
+
expected: "boolean",
|
|
843
|
+
value: input.deleted
|
|
844
|
+
}, errorFactory)) && ("string" === typeof input.path || $guard(_exceptionable, {
|
|
845
|
+
path: _path + ".path",
|
|
846
|
+
expected: "string",
|
|
847
|
+
value: input.path
|
|
301
848
|
}, errorFactory)) && ((Array.isArray(input.refs) || $guard(_exceptionable, {
|
|
302
849
|
path: _path + ".refs",
|
|
303
850
|
expected: "Array<__type>",
|
|
@@ -314,46 +861,6 @@ export const assertGuardFile = (input, errorFactory) => {
|
|
|
314
861
|
path: _path + ".refs",
|
|
315
862
|
expected: "Array<__type>",
|
|
316
863
|
value: input.refs
|
|
317
|
-
}, errorFactory)) && (null === input.btime || "number" === typeof input.btime || $guard(_exceptionable, {
|
|
318
|
-
path: _path + ".btime",
|
|
319
|
-
expected: "(null | number)",
|
|
320
|
-
value: input.btime
|
|
321
|
-
}, errorFactory)) && ("boolean" === typeof input.seekable || $guard(_exceptionable, {
|
|
322
|
-
path: _path + ".seekable",
|
|
323
|
-
expected: "boolean",
|
|
324
|
-
value: input.seekable
|
|
325
|
-
}, errorFactory)) && ("boolean" === typeof input.resumable || $guard(_exceptionable, {
|
|
326
|
-
path: _path + ".resumable",
|
|
327
|
-
expected: "boolean",
|
|
328
|
-
value: input.resumable
|
|
329
|
-
}, errorFactory)) && (null === input.size || "number" === typeof input.size && (0 <= input.size || $guard(_exceptionable, {
|
|
330
|
-
path: _path + ".size",
|
|
331
|
-
expected: "number & Minimum<0>",
|
|
332
|
-
value: input.size
|
|
333
|
-
}, errorFactory)) || $guard(_exceptionable, {
|
|
334
|
-
path: _path + ".size",
|
|
335
|
-
expected: "((number & Minimum<0>) | null)",
|
|
336
|
-
value: input.size
|
|
337
|
-
}, errorFactory)) && (null === input.position || "number" === typeof input.position && (0 <= input.position || $guard(_exceptionable, {
|
|
338
|
-
path: _path + ".position",
|
|
339
|
-
expected: "number & Minimum<0>",
|
|
340
|
-
value: input.position
|
|
341
|
-
}, errorFactory)) || $guard(_exceptionable, {
|
|
342
|
-
path: _path + ".position",
|
|
343
|
-
expected: "((number & Minimum<0>) | null)",
|
|
344
|
-
value: input.position
|
|
345
|
-
}, errorFactory)) && (null === input.hash || "string" === typeof input.hash && (input.hash.length <= 0 || /^[A-Fa-f0-9]{32}$/.test(input.hash) || $guard(_exceptionable, {
|
|
346
|
-
path: _path + ".hash",
|
|
347
|
-
expected: "(string & (MaxLength<0> | Pattern<\"^[A-Fa-f0-9]{32}$\">))",
|
|
348
|
-
value: input.hash
|
|
349
|
-
}, errorFactory)) || $guard(_exceptionable, {
|
|
350
|
-
path: _path + ".hash",
|
|
351
|
-
expected: "((string & (MaxLength<0> | Pattern<\"^[A-Fa-f0-9]{32}$\">)) | null)",
|
|
352
|
-
value: input.hash
|
|
353
|
-
}, errorFactory)) && (null === input.mimeType || "string" === typeof input.mimeType || $guard(_exceptionable, {
|
|
354
|
-
path: _path + ".mimeType",
|
|
355
|
-
expected: "(null | string)",
|
|
356
|
-
value: input.mimeType
|
|
357
864
|
}, errorFactory)) && ((Array.isArray(input.tags) || $guard(_exceptionable, {
|
|
358
865
|
path: _path + ".tags",
|
|
359
866
|
expected: "Array<string>",
|
|
@@ -382,6 +889,34 @@ export const assertGuardFile = (input, errorFactory) => {
|
|
|
382
889
|
path: _path + ".error",
|
|
383
890
|
expected: "Array<__type>.o1",
|
|
384
891
|
value: input.error
|
|
892
|
+
}, errorFactory)) && ("string" === typeof input.resumable || $guard(_exceptionable, {
|
|
893
|
+
path: _path + ".resumable",
|
|
894
|
+
expected: "string",
|
|
895
|
+
value: input.resumable
|
|
896
|
+
}, errorFactory)) && ("string" === typeof input.mimeType || $guard(_exceptionable, {
|
|
897
|
+
path: _path + ".mimeType",
|
|
898
|
+
expected: "string",
|
|
899
|
+
value: input.mimeType
|
|
900
|
+
}, errorFactory)) && ("string" === typeof input.hash && (/^([A-Fa-f0-9]{32})?$/.test(input.hash) || $guard(_exceptionable, {
|
|
901
|
+
path: _path + ".hash",
|
|
902
|
+
expected: "string & Pattern<\"^([A-Fa-f0-9]{32})?$\">",
|
|
903
|
+
value: input.hash
|
|
904
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
905
|
+
path: _path + ".hash",
|
|
906
|
+
expected: "(string & Pattern<\"^([A-Fa-f0-9]{32})?$\">)",
|
|
907
|
+
value: input.hash
|
|
908
|
+
}, errorFactory)) && ("number" === typeof input.btime && (0 <= input.btime || $guard(_exceptionable, {
|
|
909
|
+
path: _path + ".btime",
|
|
910
|
+
expected: "number & Minimum<0>",
|
|
911
|
+
value: input.btime
|
|
912
|
+
}, errorFactory)) && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 4294967295 || $guard(_exceptionable, {
|
|
913
|
+
path: _path + ".btime",
|
|
914
|
+
expected: "number & Type<\"uint32\">",
|
|
915
|
+
value: input.btime
|
|
916
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
917
|
+
path: _path + ".btime",
|
|
918
|
+
expected: "(number & Minimum<0> & Type<\"uint32\">)",
|
|
919
|
+
value: input.btime
|
|
385
920
|
}, errorFactory));
|
|
386
921
|
const $ao1 = (input, _path, _exceptionable = true) => undefined === input.file || "string" === typeof input.file || $guard(_exceptionable, {
|
|
387
922
|
path: _path + ".file",
|
|
@@ -395,27 +930,27 @@ export const assertGuardFile = (input, errorFactory) => {
|
|
|
395
930
|
}, errorFactory);
|
|
396
931
|
return ("object" === typeof input && null !== input || $guard(true, {
|
|
397
932
|
path: _path + "",
|
|
398
|
-
expected: "
|
|
933
|
+
expected: "FileStats",
|
|
399
934
|
value: input
|
|
400
935
|
}, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
|
|
401
936
|
path: _path + "",
|
|
402
|
-
expected: "
|
|
937
|
+
expected: "FileStats",
|
|
403
938
|
value: input
|
|
404
939
|
}, errorFactory);
|
|
405
940
|
})(input, "$input", true);
|
|
406
941
|
};
|
|
407
|
-
export const
|
|
942
|
+
export const stringifyFileStats = input => {
|
|
408
943
|
const $io1 = input => undefined === input.file || "string" === typeof input.file;
|
|
409
944
|
const $io2 = input => "string" === typeof input.message;
|
|
410
945
|
const $string = __typia.json.createStringify.string;
|
|
411
946
|
const $tail = __typia.json.createStringify.tail;
|
|
412
|
-
const $so0 = input => `{"
|
|
947
|
+
const $so0 = input => `{"position":${input.position},"uploading":${input.uploading},"completed":${input.completed},"zones":${`[${input.zones.map(elem => $string(elem)).join(",")}]`},"replicas":${`[${input.replicas.map(elem => $string(elem)).join(",")}]`},"id":${$string(input.id)},"size":${input.size},"seekable":${input.seekable},"deleted":${input.deleted},"path":${$string(input.path)},"refs":${`[${input.refs.map(elem => $so1(elem)).join(",")}]`},"tags":${`[${input.tags.map(elem => $string(elem)).join(",")}]`},"error":${`[${input.error.map(elem => `{"message":${$string(elem.message)}}`).join(",")}]`},"resumable":${$string(input.resumable)},"mimeType":${$string(input.mimeType)},"hash":${$string(input.hash)},"btime":${input.btime}}`;
|
|
413
948
|
const $so1 = input => `{${$tail(`${undefined === input.file ? "" : `"file":${undefined !== input.file ? $string(input.file) : undefined}`}`)}}`;
|
|
414
949
|
return $so0(input);
|
|
415
950
|
};
|
|
416
|
-
export const
|
|
951
|
+
export const assertStringifyFileStats = (input, errorFactory) => { const assert = (input, errorFactory) => {
|
|
417
952
|
const __is = input => {
|
|
418
|
-
const $io0 = input => "
|
|
953
|
+
const $io0 = input => "number" === typeof input.position && (0 <= input.position && (Math.floor(input.position) === input.position && 0 <= input.position && input.position <= 4294967295)) && "boolean" === typeof input.uploading && "boolean" === typeof input.completed && (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)) && ("number" === typeof input.size && (0 <= input.size && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 4294967295))) && "boolean" === typeof input.seekable && "boolean" === typeof input.deleted && "string" === typeof input.path && (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)) && (Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io2(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 <= 4294967295)));
|
|
419
954
|
const $io1 = input => undefined === input.file || "string" === typeof input.file;
|
|
420
955
|
const $io2 = input => "string" === typeof input.message;
|
|
421
956
|
return "object" === typeof input && null !== input && $io0(input);
|
|
@@ -423,26 +958,26 @@ export const assertStringifyFile = (input, errorFactory) => { const assert = (in
|
|
|
423
958
|
if (false === __is(input))
|
|
424
959
|
((input, _path, _exceptionable = true) => {
|
|
425
960
|
const $guard = __typia.json.createAssertStringify.guard;
|
|
426
|
-
const $ao0 = (input, _path, _exceptionable = true) => ("
|
|
427
|
-
path: _path + ".
|
|
428
|
-
expected: "
|
|
429
|
-
value: input.
|
|
961
|
+
const $ao0 = (input, _path, _exceptionable = true) => ("number" === typeof input.position && (0 <= input.position || $guard(_exceptionable, {
|
|
962
|
+
path: _path + ".position",
|
|
963
|
+
expected: "number & Minimum<0>",
|
|
964
|
+
value: input.position
|
|
965
|
+
}, errorFactory)) && (Math.floor(input.position) === input.position && 0 <= input.position && input.position <= 4294967295 || $guard(_exceptionable, {
|
|
966
|
+
path: _path + ".position",
|
|
967
|
+
expected: "number & Type<\"uint32\">",
|
|
968
|
+
value: input.position
|
|
430
969
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
431
|
-
path: _path + ".
|
|
432
|
-
expected: "(
|
|
433
|
-
value: input.
|
|
434
|
-
}, errorFactory)) && ("boolean" === typeof input.
|
|
435
|
-
path: _path + ".
|
|
970
|
+
path: _path + ".position",
|
|
971
|
+
expected: "(number & Minimum<0> & Type<\"uint32\">)",
|
|
972
|
+
value: input.position
|
|
973
|
+
}, errorFactory)) && ("boolean" === typeof input.uploading || $guard(_exceptionable, {
|
|
974
|
+
path: _path + ".uploading",
|
|
436
975
|
expected: "boolean",
|
|
437
|
-
value: input.
|
|
976
|
+
value: input.uploading
|
|
438
977
|
}, errorFactory)) && ("boolean" === typeof input.completed || $guard(_exceptionable, {
|
|
439
978
|
path: _path + ".completed",
|
|
440
979
|
expected: "boolean",
|
|
441
980
|
value: input.completed
|
|
442
|
-
}, errorFactory)) && ("boolean" === typeof input.uploading || $guard(_exceptionable, {
|
|
443
|
-
path: _path + ".uploading",
|
|
444
|
-
expected: "boolean",
|
|
445
|
-
value: input.uploading
|
|
446
981
|
}, errorFactory)) && ((Array.isArray(input.zones) || $guard(_exceptionable, {
|
|
447
982
|
path: _path + ".zones",
|
|
448
983
|
expected: "Array<string>",
|
|
@@ -467,6 +1002,38 @@ export const assertStringifyFile = (input, errorFactory) => { const assert = (in
|
|
|
467
1002
|
path: _path + ".replicas",
|
|
468
1003
|
expected: "Array<string>",
|
|
469
1004
|
value: input.replicas
|
|
1005
|
+
}, errorFactory)) && ("string" === typeof input.id && (/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) || $guard(_exceptionable, {
|
|
1006
|
+
path: _path + ".id",
|
|
1007
|
+
expected: "string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
|
|
1008
|
+
value: input.id
|
|
1009
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
1010
|
+
path: _path + ".id",
|
|
1011
|
+
expected: "(string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">)",
|
|
1012
|
+
value: input.id
|
|
1013
|
+
}, errorFactory)) && ("number" === typeof input.size && (0 <= input.size || $guard(_exceptionable, {
|
|
1014
|
+
path: _path + ".size",
|
|
1015
|
+
expected: "number & Minimum<0>",
|
|
1016
|
+
value: input.size
|
|
1017
|
+
}, errorFactory)) && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 4294967295 || $guard(_exceptionable, {
|
|
1018
|
+
path: _path + ".size",
|
|
1019
|
+
expected: "number & Type<\"uint32\">",
|
|
1020
|
+
value: input.size
|
|
1021
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
1022
|
+
path: _path + ".size",
|
|
1023
|
+
expected: "(number & Minimum<0> & Type<\"uint32\">)",
|
|
1024
|
+
value: input.size
|
|
1025
|
+
}, errorFactory)) && ("boolean" === typeof input.seekable || $guard(_exceptionable, {
|
|
1026
|
+
path: _path + ".seekable",
|
|
1027
|
+
expected: "boolean",
|
|
1028
|
+
value: input.seekable
|
|
1029
|
+
}, errorFactory)) && ("boolean" === typeof input.deleted || $guard(_exceptionable, {
|
|
1030
|
+
path: _path + ".deleted",
|
|
1031
|
+
expected: "boolean",
|
|
1032
|
+
value: input.deleted
|
|
1033
|
+
}, errorFactory)) && ("string" === typeof input.path || $guard(_exceptionable, {
|
|
1034
|
+
path: _path + ".path",
|
|
1035
|
+
expected: "string",
|
|
1036
|
+
value: input.path
|
|
470
1037
|
}, errorFactory)) && ((Array.isArray(input.refs) || $guard(_exceptionable, {
|
|
471
1038
|
path: _path + ".refs",
|
|
472
1039
|
expected: "Array<__type>",
|
|
@@ -483,54 +1050,6 @@ export const assertStringifyFile = (input, errorFactory) => { const assert = (in
|
|
|
483
1050
|
path: _path + ".refs",
|
|
484
1051
|
expected: "Array<__type>",
|
|
485
1052
|
value: input.refs
|
|
486
|
-
}, errorFactory)) && (null === input.btime || "number" === typeof input.btime && !Number.isNaN(input.btime) || $guard(_exceptionable, {
|
|
487
|
-
path: _path + ".btime",
|
|
488
|
-
expected: "(null | number)",
|
|
489
|
-
value: input.btime
|
|
490
|
-
}, errorFactory)) && ("boolean" === typeof input.seekable || $guard(_exceptionable, {
|
|
491
|
-
path: _path + ".seekable",
|
|
492
|
-
expected: "boolean",
|
|
493
|
-
value: input.seekable
|
|
494
|
-
}, errorFactory)) && ("boolean" === typeof input.resumable || $guard(_exceptionable, {
|
|
495
|
-
path: _path + ".resumable",
|
|
496
|
-
expected: "boolean",
|
|
497
|
-
value: input.resumable
|
|
498
|
-
}, errorFactory)) && (null === input.size || "number" === typeof input.size && (!Number.isNaN(input.size) || $guard(_exceptionable, {
|
|
499
|
-
path: _path + ".size",
|
|
500
|
-
expected: "number",
|
|
501
|
-
value: input.size
|
|
502
|
-
}, errorFactory)) && (0 <= input.size || $guard(_exceptionable, {
|
|
503
|
-
path: _path + ".size",
|
|
504
|
-
expected: "number & Minimum<0>",
|
|
505
|
-
value: input.size
|
|
506
|
-
}, errorFactory)) || $guard(_exceptionable, {
|
|
507
|
-
path: _path + ".size",
|
|
508
|
-
expected: "((number & Minimum<0>) | null)",
|
|
509
|
-
value: input.size
|
|
510
|
-
}, errorFactory)) && (null === input.position || "number" === typeof input.position && (!Number.isNaN(input.position) || $guard(_exceptionable, {
|
|
511
|
-
path: _path + ".position",
|
|
512
|
-
expected: "number",
|
|
513
|
-
value: input.position
|
|
514
|
-
}, errorFactory)) && (0 <= input.position || $guard(_exceptionable, {
|
|
515
|
-
path: _path + ".position",
|
|
516
|
-
expected: "number & Minimum<0>",
|
|
517
|
-
value: input.position
|
|
518
|
-
}, errorFactory)) || $guard(_exceptionable, {
|
|
519
|
-
path: _path + ".position",
|
|
520
|
-
expected: "((number & Minimum<0>) | null)",
|
|
521
|
-
value: input.position
|
|
522
|
-
}, errorFactory)) && (null === input.hash || "string" === typeof input.hash && (input.hash.length <= 0 || /^[A-Fa-f0-9]{32}$/.test(input.hash) || $guard(_exceptionable, {
|
|
523
|
-
path: _path + ".hash",
|
|
524
|
-
expected: "(string & (MaxLength<0> | Pattern<\"^[A-Fa-f0-9]{32}$\">))",
|
|
525
|
-
value: input.hash
|
|
526
|
-
}, errorFactory)) || $guard(_exceptionable, {
|
|
527
|
-
path: _path + ".hash",
|
|
528
|
-
expected: "((string & (MaxLength<0> | Pattern<\"^[A-Fa-f0-9]{32}$\">)) | null)",
|
|
529
|
-
value: input.hash
|
|
530
|
-
}, errorFactory)) && (null === input.mimeType || "string" === typeof input.mimeType || $guard(_exceptionable, {
|
|
531
|
-
path: _path + ".mimeType",
|
|
532
|
-
expected: "(null | string)",
|
|
533
|
-
value: input.mimeType
|
|
534
1053
|
}, errorFactory)) && ((Array.isArray(input.tags) || $guard(_exceptionable, {
|
|
535
1054
|
path: _path + ".tags",
|
|
536
1055
|
expected: "Array<string>",
|
|
@@ -559,6 +1078,34 @@ export const assertStringifyFile = (input, errorFactory) => { const assert = (in
|
|
|
559
1078
|
path: _path + ".error",
|
|
560
1079
|
expected: "Array<__type>.o1",
|
|
561
1080
|
value: input.error
|
|
1081
|
+
}, errorFactory)) && ("string" === typeof input.resumable || $guard(_exceptionable, {
|
|
1082
|
+
path: _path + ".resumable",
|
|
1083
|
+
expected: "string",
|
|
1084
|
+
value: input.resumable
|
|
1085
|
+
}, errorFactory)) && ("string" === typeof input.mimeType || $guard(_exceptionable, {
|
|
1086
|
+
path: _path + ".mimeType",
|
|
1087
|
+
expected: "string",
|
|
1088
|
+
value: input.mimeType
|
|
1089
|
+
}, errorFactory)) && ("string" === typeof input.hash && (/^([A-Fa-f0-9]{32})?$/.test(input.hash) || $guard(_exceptionable, {
|
|
1090
|
+
path: _path + ".hash",
|
|
1091
|
+
expected: "string & Pattern<\"^([A-Fa-f0-9]{32})?$\">",
|
|
1092
|
+
value: input.hash
|
|
1093
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
1094
|
+
path: _path + ".hash",
|
|
1095
|
+
expected: "(string & Pattern<\"^([A-Fa-f0-9]{32})?$\">)",
|
|
1096
|
+
value: input.hash
|
|
1097
|
+
}, errorFactory)) && ("number" === typeof input.btime && (0 <= input.btime || $guard(_exceptionable, {
|
|
1098
|
+
path: _path + ".btime",
|
|
1099
|
+
expected: "number & Minimum<0>",
|
|
1100
|
+
value: input.btime
|
|
1101
|
+
}, errorFactory)) && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 4294967295 || $guard(_exceptionable, {
|
|
1102
|
+
path: _path + ".btime",
|
|
1103
|
+
expected: "number & Type<\"uint32\">",
|
|
1104
|
+
value: input.btime
|
|
1105
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
1106
|
+
path: _path + ".btime",
|
|
1107
|
+
expected: "(number & Minimum<0> & Type<\"uint32\">)",
|
|
1108
|
+
value: input.btime
|
|
562
1109
|
}, errorFactory));
|
|
563
1110
|
const $ao1 = (input, _path, _exceptionable = true) => undefined === input.file || "string" === typeof input.file || $guard(_exceptionable, {
|
|
564
1111
|
path: _path + ".file",
|
|
@@ -572,11 +1119,11 @@ export const assertStringifyFile = (input, errorFactory) => { const assert = (in
|
|
|
572
1119
|
}, errorFactory);
|
|
573
1120
|
return ("object" === typeof input && null !== input || $guard(true, {
|
|
574
1121
|
path: _path + "",
|
|
575
|
-
expected: "
|
|
1122
|
+
expected: "FileStats",
|
|
576
1123
|
value: input
|
|
577
1124
|
}, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
|
|
578
1125
|
path: _path + "",
|
|
579
|
-
expected: "
|
|
1126
|
+
expected: "FileStats",
|
|
580
1127
|
value: input
|
|
581
1128
|
}, errorFactory);
|
|
582
1129
|
})(input, "$input", true);
|
|
@@ -586,7 +1133,7 @@ export const assertStringifyFile = (input, errorFactory) => { const assert = (in
|
|
|
586
1133
|
const $io2 = input => "string" === typeof input.message;
|
|
587
1134
|
const $string = __typia.json.createAssertStringify.string;
|
|
588
1135
|
const $tail = __typia.json.createAssertStringify.tail;
|
|
589
|
-
const $so0 = input => `{"
|
|
1136
|
+
const $so0 = input => `{"position":${input.position},"uploading":${input.uploading},"completed":${input.completed},"zones":${`[${input.zones.map(elem => $string(elem)).join(",")}]`},"replicas":${`[${input.replicas.map(elem => $string(elem)).join(",")}]`},"id":${$string(input.id)},"size":${input.size},"seekable":${input.seekable},"deleted":${input.deleted},"path":${$string(input.path)},"refs":${`[${input.refs.map(elem => $so1(elem)).join(",")}]`},"tags":${`[${input.tags.map(elem => $string(elem)).join(",")}]`},"error":${`[${input.error.map(elem => `{"message":${$string(elem.message)}}`).join(",")}]`},"resumable":${$string(input.resumable)},"mimeType":${$string(input.mimeType)},"hash":${$string(input.hash)},"btime":${input.btime}}`;
|
|
590
1137
|
const $so1 = input => `{${$tail(`${undefined === input.file ? "" : `"file":${undefined !== input.file ? $string(input.file) : undefined}`}`)}}`;
|
|
591
1138
|
return $so0(input);
|
|
592
1139
|
}; return stringify(assert(input, errorFactory)); };
|