@nxtedition/types 1.0.0 → 1.1.0

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.
@@ -0,0 +1,30 @@
1
+ import { type AssertionGuard as __AssertionGuard } from "typia";
2
+ import { tags } from 'typia';
3
+ export interface File {
4
+ id: string & tags.MinLength<1>;
5
+ deleted: boolean;
6
+ completed: boolean;
7
+ uploading: boolean;
8
+ zones: string[];
9
+ replicas: string[];
10
+ refs: Array<{
11
+ file?: string;
12
+ }>;
13
+ btime: number | null;
14
+ seekable: boolean;
15
+ resumable: boolean;
16
+ size: (number & tags.Minimum<0>) | null;
17
+ position: (number & tags.Minimum<0>) | null;
18
+ hash: (string & (tags.MaxLength<0> | tags.Pattern<"^[A-Fa-f0-9]{32}$">)) | null;
19
+ mimeType: string | null;
20
+ tags: string[];
21
+ error: Array<{
22
+ message: string;
23
+ }>;
24
+ }
25
+ export declare const isFile: (input: unknown) => input is File;
26
+ export declare const assertFile: (input: unknown) => File;
27
+ export declare const randomFile: () => File;
28
+ export declare const assertGuardFile: __AssertionGuard<File>;
29
+ export declare const stringifyFile: (input: File) => string;
30
+ export declare const assertStringifyFile: (input: unknown) => string;
@@ -0,0 +1,592 @@
1
+ import __typia from "typia";
2
+ export const isFile = input => {
3
+ const $io0 = input => "string" === typeof input.id && 1 <= input.id.length && "boolean" === typeof input.deleted && "boolean" === typeof input.completed && "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)) && (Array.isArray(input.refs) && input.refs.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $io1(elem))) && (null === input.btime || "number" === typeof input.btime) && "boolean" === typeof input.seekable && "boolean" === typeof input.resumable && (null === input.size || "number" === typeof input.size && 0 <= input.size) && (null === input.position || "number" === typeof input.position && 0 <= input.position) && (null === input.hash || "string" === typeof input.hash && (input.hash.length <= 0 || /^[A-Fa-f0-9]{32}$/.test(input.hash))) && (null === input.mimeType || "string" === typeof input.mimeType) && (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)));
4
+ const $io1 = input => undefined === input.file || "string" === typeof input.file;
5
+ const $io2 = input => "string" === typeof input.message;
6
+ return "object" === typeof input && null !== input && $io0(input);
7
+ };
8
+ export const assertFile = (input, errorFactory) => {
9
+ const __is = input => {
10
+ const $io0 = input => "string" === typeof input.id && 1 <= input.id.length && "boolean" === typeof input.deleted && "boolean" === typeof input.completed && "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)) && (Array.isArray(input.refs) && input.refs.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $io1(elem))) && (null === input.btime || "number" === typeof input.btime) && "boolean" === typeof input.seekable && "boolean" === typeof input.resumable && (null === input.size || "number" === typeof input.size && 0 <= input.size) && (null === input.position || "number" === typeof input.position && 0 <= input.position) && (null === input.hash || "string" === typeof input.hash && (input.hash.length <= 0 || /^[A-Fa-f0-9]{32}$/.test(input.hash))) && (null === input.mimeType || "string" === typeof input.mimeType) && (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)));
11
+ const $io1 = input => undefined === input.file || "string" === typeof input.file;
12
+ const $io2 = input => "string" === typeof input.message;
13
+ return "object" === typeof input && null !== input && $io0(input);
14
+ };
15
+ if (false === __is(input))
16
+ ((input, _path, _exceptionable = true) => {
17
+ const $guard = __typia.createAssert.guard;
18
+ const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.id && (1 <= input.id.length || $guard(_exceptionable, {
19
+ path: _path + ".id",
20
+ expected: "string & MinLength<1>",
21
+ value: input.id
22
+ }, errorFactory)) || $guard(_exceptionable, {
23
+ path: _path + ".id",
24
+ expected: "(string & MinLength<1>)",
25
+ value: input.id
26
+ }, errorFactory)) && ("boolean" === typeof input.deleted || $guard(_exceptionable, {
27
+ path: _path + ".deleted",
28
+ expected: "boolean",
29
+ value: input.deleted
30
+ }, errorFactory)) && ("boolean" === typeof input.completed || $guard(_exceptionable, {
31
+ path: _path + ".completed",
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 + "]",
44
+ expected: "string",
45
+ value: elem
46
+ }, errorFactory)) || $guard(_exceptionable, {
47
+ path: _path + ".zones",
48
+ expected: "Array<string>",
49
+ value: input.zones
50
+ }, errorFactory)) && ((Array.isArray(input.replicas) || $guard(_exceptionable, {
51
+ path: _path + ".replicas",
52
+ expected: "Array<string>",
53
+ value: input.replicas
54
+ }, errorFactory)) && input.replicas.every((elem, _index2) => "string" === typeof elem || $guard(_exceptionable, {
55
+ path: _path + ".replicas[" + _index2 + "]",
56
+ expected: "string",
57
+ value: elem
58
+ }, errorFactory)) || $guard(_exceptionable, {
59
+ path: _path + ".replicas",
60
+ expected: "Array<string>",
61
+ value: input.replicas
62
+ }, errorFactory)) && ((Array.isArray(input.refs) || $guard(_exceptionable, {
63
+ path: _path + ".refs",
64
+ expected: "Array<__type>",
65
+ value: input.refs
66
+ }, errorFactory)) && input.refs.every((elem, _index3) => ("object" === typeof elem && null !== elem && false === Array.isArray(elem) || $guard(_exceptionable, {
67
+ path: _path + ".refs[" + _index3 + "]",
68
+ expected: "__type",
69
+ value: elem
70
+ }, errorFactory)) && $ao1(elem, _path + ".refs[" + _index3 + "]", true && _exceptionable) || $guard(_exceptionable, {
71
+ path: _path + ".refs[" + _index3 + "]",
72
+ expected: "__type",
73
+ value: elem
74
+ }, errorFactory)) || $guard(_exceptionable, {
75
+ path: _path + ".refs",
76
+ expected: "Array<__type>",
77
+ value: input.refs
78
+ }, errorFactory)) && (null === input.btime || "number" === typeof input.btime || $guard(_exceptionable, {
79
+ path: _path + ".btime",
80
+ expected: "(null | number)",
81
+ value: input.btime
82
+ }, errorFactory)) && ("boolean" === typeof input.seekable || $guard(_exceptionable, {
83
+ path: _path + ".seekable",
84
+ expected: "boolean",
85
+ value: input.seekable
86
+ }, errorFactory)) && ("boolean" === typeof input.resumable || $guard(_exceptionable, {
87
+ path: _path + ".resumable",
88
+ expected: "boolean",
89
+ value: input.resumable
90
+ }, errorFactory)) && (null === input.size || "number" === typeof input.size && (0 <= input.size || $guard(_exceptionable, {
91
+ path: _path + ".size",
92
+ expected: "number & Minimum<0>",
93
+ value: input.size
94
+ }, errorFactory)) || $guard(_exceptionable, {
95
+ path: _path + ".size",
96
+ expected: "((number & Minimum<0>) | null)",
97
+ value: input.size
98
+ }, errorFactory)) && (null === input.position || "number" === typeof input.position && (0 <= input.position || $guard(_exceptionable, {
99
+ path: _path + ".position",
100
+ expected: "number & Minimum<0>",
101
+ value: input.position
102
+ }, errorFactory)) || $guard(_exceptionable, {
103
+ path: _path + ".position",
104
+ expected: "((number & Minimum<0>) | null)",
105
+ value: input.position
106
+ }, errorFactory)) && (null === input.hash || "string" === typeof input.hash && (input.hash.length <= 0 || /^[A-Fa-f0-9]{32}$/.test(input.hash) || $guard(_exceptionable, {
107
+ path: _path + ".hash",
108
+ expected: "(string & (MaxLength<0> | Pattern<\"^[A-Fa-f0-9]{32}$\">))",
109
+ value: input.hash
110
+ }, errorFactory)) || $guard(_exceptionable, {
111
+ path: _path + ".hash",
112
+ expected: "((string & (MaxLength<0> | Pattern<\"^[A-Fa-f0-9]{32}$\">)) | null)",
113
+ value: input.hash
114
+ }, errorFactory)) && (null === input.mimeType || "string" === typeof input.mimeType || $guard(_exceptionable, {
115
+ path: _path + ".mimeType",
116
+ expected: "(null | string)",
117
+ value: input.mimeType
118
+ }, errorFactory)) && ((Array.isArray(input.tags) || $guard(_exceptionable, {
119
+ path: _path + ".tags",
120
+ expected: "Array<string>",
121
+ value: input.tags
122
+ }, errorFactory)) && input.tags.every((elem, _index4) => "string" === typeof elem || $guard(_exceptionable, {
123
+ path: _path + ".tags[" + _index4 + "]",
124
+ expected: "string",
125
+ value: elem
126
+ }, errorFactory)) || $guard(_exceptionable, {
127
+ path: _path + ".tags",
128
+ expected: "Array<string>",
129
+ value: input.tags
130
+ }, errorFactory)) && ((Array.isArray(input.error) || $guard(_exceptionable, {
131
+ path: _path + ".error",
132
+ expected: "Array<__type>.o1",
133
+ value: input.error
134
+ }, errorFactory)) && input.error.every((elem, _index5) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
135
+ path: _path + ".error[" + _index5 + "]",
136
+ expected: "__type.o1",
137
+ value: elem
138
+ }, errorFactory)) && $ao2(elem, _path + ".error[" + _index5 + "]", true && _exceptionable) || $guard(_exceptionable, {
139
+ path: _path + ".error[" + _index5 + "]",
140
+ expected: "__type.o1",
141
+ value: elem
142
+ }, errorFactory)) || $guard(_exceptionable, {
143
+ path: _path + ".error",
144
+ expected: "Array<__type>.o1",
145
+ value: input.error
146
+ }, errorFactory));
147
+ const $ao1 = (input, _path, _exceptionable = true) => undefined === input.file || "string" === typeof input.file || $guard(_exceptionable, {
148
+ path: _path + ".file",
149
+ expected: "(string | undefined)",
150
+ value: input.file
151
+ }, errorFactory);
152
+ const $ao2 = (input, _path, _exceptionable = true) => "string" === typeof input.message || $guard(_exceptionable, {
153
+ path: _path + ".message",
154
+ expected: "string",
155
+ value: input.message
156
+ }, errorFactory);
157
+ return ("object" === typeof input && null !== input || $guard(true, {
158
+ path: _path + "",
159
+ expected: "File",
160
+ value: input
161
+ }, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
162
+ path: _path + "",
163
+ expected: "File",
164
+ value: input
165
+ }, errorFactory);
166
+ })(input, "$input", true);
167
+ return input;
168
+ };
169
+ export const randomFile = generator => {
170
+ const $generator = __typia.createRandom.generator;
171
+ const $pick = __typia.createRandom.pick;
172
+ const $ro0 = (_recursive = false, _depth = 0) => ({
173
+ id: (generator?.customs ?? $generator.customs)?.string?.([
174
+ {
175
+ name: "MinLength<1>",
176
+ kind: "minLength",
177
+ value: 1
178
+ }
179
+ ]) ?? (generator?.string ?? $generator.string)((generator?.integer ?? $generator.integer)(1, 25)),
180
+ deleted: (generator?.boolean ?? $generator.boolean)(),
181
+ completed: (generator?.boolean ?? $generator.boolean)(),
182
+ uploading: (generator?.boolean ?? $generator.boolean)(),
183
+ zones: (generator?.array ?? $generator.array)(() => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()),
184
+ replicas: (generator?.array ?? $generator.array)(() => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()),
185
+ refs: (generator?.array ?? $generator.array)(() => $ro1(_recursive, _recursive ? 1 + _depth : _depth)),
186
+ btime: $pick([
187
+ () => null,
188
+ () => (generator?.customs ?? $generator.customs)?.number?.([]) ?? (generator?.number ?? $generator.number)(0, 100)
189
+ ])(),
190
+ seekable: (generator?.boolean ?? $generator.boolean)(),
191
+ resumable: (generator?.boolean ?? $generator.boolean)(),
192
+ size: $pick([
193
+ () => null,
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
+ ])(),
233
+ 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))
235
+ });
236
+ const $ro1 = (_recursive = false, _depth = 0) => ({
237
+ file: $pick([
238
+ () => undefined,
239
+ () => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()
240
+ ])()
241
+ });
242
+ const $ro2 = (_recursive = false, _depth = 0) => ({
243
+ message: (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()
244
+ });
245
+ return $ro0();
246
+ };
247
+ export const assertGuardFile = (input, errorFactory) => {
248
+ const __is = input => {
249
+ const $io0 = input => "string" === typeof input.id && 1 <= input.id.length && "boolean" === typeof input.deleted && "boolean" === typeof input.completed && "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)) && (Array.isArray(input.refs) && input.refs.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $io1(elem))) && (null === input.btime || "number" === typeof input.btime) && "boolean" === typeof input.seekable && "boolean" === typeof input.resumable && (null === input.size || "number" === typeof input.size && 0 <= input.size) && (null === input.position || "number" === typeof input.position && 0 <= input.position) && (null === input.hash || "string" === typeof input.hash && (input.hash.length <= 0 || /^[A-Fa-f0-9]{32}$/.test(input.hash))) && (null === input.mimeType || "string" === typeof input.mimeType) && (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)));
250
+ const $io1 = input => undefined === input.file || "string" === typeof input.file;
251
+ const $io2 = input => "string" === typeof input.message;
252
+ return "object" === typeof input && null !== input && $io0(input);
253
+ };
254
+ if (false === __is(input))
255
+ ((input, _path, _exceptionable = true) => {
256
+ const $guard = __typia.createAssertGuard.guard;
257
+ const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.id && (1 <= input.id.length || $guard(_exceptionable, {
258
+ path: _path + ".id",
259
+ expected: "string & MinLength<1>",
260
+ value: input.id
261
+ }, errorFactory)) || $guard(_exceptionable, {
262
+ path: _path + ".id",
263
+ expected: "(string & MinLength<1>)",
264
+ value: input.id
265
+ }, errorFactory)) && ("boolean" === typeof input.deleted || $guard(_exceptionable, {
266
+ path: _path + ".deleted",
267
+ expected: "boolean",
268
+ value: input.deleted
269
+ }, errorFactory)) && ("boolean" === typeof input.completed || $guard(_exceptionable, {
270
+ path: _path + ".completed",
271
+ expected: "boolean",
272
+ value: input.completed
273
+ }, errorFactory)) && ("boolean" === typeof input.uploading || $guard(_exceptionable, {
274
+ path: _path + ".uploading",
275
+ expected: "boolean",
276
+ value: input.uploading
277
+ }, errorFactory)) && ((Array.isArray(input.zones) || $guard(_exceptionable, {
278
+ path: _path + ".zones",
279
+ expected: "Array<string>",
280
+ value: input.zones
281
+ }, errorFactory)) && input.zones.every((elem, _index1) => "string" === typeof elem || $guard(_exceptionable, {
282
+ path: _path + ".zones[" + _index1 + "]",
283
+ expected: "string",
284
+ value: elem
285
+ }, errorFactory)) || $guard(_exceptionable, {
286
+ path: _path + ".zones",
287
+ expected: "Array<string>",
288
+ value: input.zones
289
+ }, errorFactory)) && ((Array.isArray(input.replicas) || $guard(_exceptionable, {
290
+ path: _path + ".replicas",
291
+ expected: "Array<string>",
292
+ value: input.replicas
293
+ }, errorFactory)) && input.replicas.every((elem, _index2) => "string" === typeof elem || $guard(_exceptionable, {
294
+ path: _path + ".replicas[" + _index2 + "]",
295
+ expected: "string",
296
+ value: elem
297
+ }, errorFactory)) || $guard(_exceptionable, {
298
+ path: _path + ".replicas",
299
+ expected: "Array<string>",
300
+ value: input.replicas
301
+ }, errorFactory)) && ((Array.isArray(input.refs) || $guard(_exceptionable, {
302
+ path: _path + ".refs",
303
+ expected: "Array<__type>",
304
+ value: input.refs
305
+ }, errorFactory)) && input.refs.every((elem, _index3) => ("object" === typeof elem && null !== elem && false === Array.isArray(elem) || $guard(_exceptionable, {
306
+ path: _path + ".refs[" + _index3 + "]",
307
+ expected: "__type",
308
+ value: elem
309
+ }, errorFactory)) && $ao1(elem, _path + ".refs[" + _index3 + "]", true && _exceptionable) || $guard(_exceptionable, {
310
+ path: _path + ".refs[" + _index3 + "]",
311
+ expected: "__type",
312
+ value: elem
313
+ }, errorFactory)) || $guard(_exceptionable, {
314
+ path: _path + ".refs",
315
+ expected: "Array<__type>",
316
+ 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
+ }, errorFactory)) && ((Array.isArray(input.tags) || $guard(_exceptionable, {
358
+ path: _path + ".tags",
359
+ expected: "Array<string>",
360
+ value: input.tags
361
+ }, errorFactory)) && input.tags.every((elem, _index4) => "string" === typeof elem || $guard(_exceptionable, {
362
+ path: _path + ".tags[" + _index4 + "]",
363
+ expected: "string",
364
+ value: elem
365
+ }, errorFactory)) || $guard(_exceptionable, {
366
+ path: _path + ".tags",
367
+ expected: "Array<string>",
368
+ value: input.tags
369
+ }, errorFactory)) && ((Array.isArray(input.error) || $guard(_exceptionable, {
370
+ path: _path + ".error",
371
+ expected: "Array<__type>.o1",
372
+ value: input.error
373
+ }, errorFactory)) && input.error.every((elem, _index5) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
374
+ path: _path + ".error[" + _index5 + "]",
375
+ expected: "__type.o1",
376
+ value: elem
377
+ }, errorFactory)) && $ao2(elem, _path + ".error[" + _index5 + "]", true && _exceptionable) || $guard(_exceptionable, {
378
+ path: _path + ".error[" + _index5 + "]",
379
+ expected: "__type.o1",
380
+ value: elem
381
+ }, errorFactory)) || $guard(_exceptionable, {
382
+ path: _path + ".error",
383
+ expected: "Array<__type>.o1",
384
+ value: input.error
385
+ }, errorFactory));
386
+ const $ao1 = (input, _path, _exceptionable = true) => undefined === input.file || "string" === typeof input.file || $guard(_exceptionable, {
387
+ path: _path + ".file",
388
+ expected: "(string | undefined)",
389
+ value: input.file
390
+ }, errorFactory);
391
+ const $ao2 = (input, _path, _exceptionable = true) => "string" === typeof input.message || $guard(_exceptionable, {
392
+ path: _path + ".message",
393
+ expected: "string",
394
+ value: input.message
395
+ }, errorFactory);
396
+ return ("object" === typeof input && null !== input || $guard(true, {
397
+ path: _path + "",
398
+ expected: "File",
399
+ value: input
400
+ }, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
401
+ path: _path + "",
402
+ expected: "File",
403
+ value: input
404
+ }, errorFactory);
405
+ })(input, "$input", true);
406
+ };
407
+ export const stringifyFile = input => {
408
+ const $io1 = input => undefined === input.file || "string" === typeof input.file;
409
+ const $io2 = input => "string" === typeof input.message;
410
+ const $string = __typia.json.createStringify.string;
411
+ const $tail = __typia.json.createStringify.tail;
412
+ const $so0 = input => `{"id":${$string(input.id)},"deleted":${input.deleted},"completed":${input.completed},"uploading":${input.uploading},"zones":${`[${input.zones.map(elem => $string(elem)).join(",")}]`},"replicas":${`[${input.replicas.map(elem => $string(elem)).join(",")}]`},"refs":${`[${input.refs.map(elem => $so1(elem)).join(",")}]`},"btime":${null !== input.btime ? input.btime : "null"},"seekable":${input.seekable},"resumable":${input.resumable},"size":${null !== input.size ? input.size : "null"},"position":${null !== input.position ? input.position : "null"},"hash":${null !== input.hash ? $string(input.hash) : "null"},"mimeType":${null !== input.mimeType ? $string(input.mimeType) : "null"},"tags":${`[${input.tags.map(elem => $string(elem)).join(",")}]`},"error":${`[${input.error.map(elem => `{"message":${$string(elem.message)}}`).join(",")}]`}}`;
413
+ const $so1 = input => `{${$tail(`${undefined === input.file ? "" : `"file":${undefined !== input.file ? $string(input.file) : undefined}`}`)}}`;
414
+ return $so0(input);
415
+ };
416
+ export const assertStringifyFile = (input, errorFactory) => { const assert = (input, errorFactory) => {
417
+ const __is = input => {
418
+ const $io0 = input => "string" === typeof input.id && 1 <= input.id.length && "boolean" === typeof input.deleted && "boolean" === typeof input.completed && "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)) && (Array.isArray(input.refs) && input.refs.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $io1(elem))) && (null === input.btime || "number" === typeof input.btime && !Number.isNaN(input.btime)) && "boolean" === typeof input.seekable && "boolean" === typeof input.resumable && (null === input.size || "number" === typeof input.size && (!Number.isNaN(input.size) && 0 <= input.size)) && (null === input.position || "number" === typeof input.position && (!Number.isNaN(input.position) && 0 <= input.position)) && (null === input.hash || "string" === typeof input.hash && (input.hash.length <= 0 || /^[A-Fa-f0-9]{32}$/.test(input.hash))) && (null === input.mimeType || "string" === typeof input.mimeType) && (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)));
419
+ const $io1 = input => undefined === input.file || "string" === typeof input.file;
420
+ const $io2 = input => "string" === typeof input.message;
421
+ return "object" === typeof input && null !== input && $io0(input);
422
+ };
423
+ if (false === __is(input))
424
+ ((input, _path, _exceptionable = true) => {
425
+ const $guard = __typia.json.createAssertStringify.guard;
426
+ const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.id && (1 <= input.id.length || $guard(_exceptionable, {
427
+ path: _path + ".id",
428
+ expected: "string & MinLength<1>",
429
+ value: input.id
430
+ }, errorFactory)) || $guard(_exceptionable, {
431
+ path: _path + ".id",
432
+ expected: "(string & MinLength<1>)",
433
+ value: input.id
434
+ }, errorFactory)) && ("boolean" === typeof input.deleted || $guard(_exceptionable, {
435
+ path: _path + ".deleted",
436
+ expected: "boolean",
437
+ value: input.deleted
438
+ }, errorFactory)) && ("boolean" === typeof input.completed || $guard(_exceptionable, {
439
+ path: _path + ".completed",
440
+ expected: "boolean",
441
+ value: input.completed
442
+ }, errorFactory)) && ("boolean" === typeof input.uploading || $guard(_exceptionable, {
443
+ path: _path + ".uploading",
444
+ expected: "boolean",
445
+ value: input.uploading
446
+ }, errorFactory)) && ((Array.isArray(input.zones) || $guard(_exceptionable, {
447
+ path: _path + ".zones",
448
+ expected: "Array<string>",
449
+ value: input.zones
450
+ }, errorFactory)) && input.zones.every((elem, _index1) => "string" === typeof elem || $guard(_exceptionable, {
451
+ path: _path + ".zones[" + _index1 + "]",
452
+ expected: "string",
453
+ value: elem
454
+ }, errorFactory)) || $guard(_exceptionable, {
455
+ path: _path + ".zones",
456
+ expected: "Array<string>",
457
+ value: input.zones
458
+ }, errorFactory)) && ((Array.isArray(input.replicas) || $guard(_exceptionable, {
459
+ path: _path + ".replicas",
460
+ expected: "Array<string>",
461
+ value: input.replicas
462
+ }, errorFactory)) && input.replicas.every((elem, _index2) => "string" === typeof elem || $guard(_exceptionable, {
463
+ path: _path + ".replicas[" + _index2 + "]",
464
+ expected: "string",
465
+ value: elem
466
+ }, errorFactory)) || $guard(_exceptionable, {
467
+ path: _path + ".replicas",
468
+ expected: "Array<string>",
469
+ value: input.replicas
470
+ }, errorFactory)) && ((Array.isArray(input.refs) || $guard(_exceptionable, {
471
+ path: _path + ".refs",
472
+ expected: "Array<__type>",
473
+ value: input.refs
474
+ }, errorFactory)) && input.refs.every((elem, _index3) => ("object" === typeof elem && null !== elem && false === Array.isArray(elem) || $guard(_exceptionable, {
475
+ path: _path + ".refs[" + _index3 + "]",
476
+ expected: "__type",
477
+ value: elem
478
+ }, errorFactory)) && $ao1(elem, _path + ".refs[" + _index3 + "]", true && _exceptionable) || $guard(_exceptionable, {
479
+ path: _path + ".refs[" + _index3 + "]",
480
+ expected: "__type",
481
+ value: elem
482
+ }, errorFactory)) || $guard(_exceptionable, {
483
+ path: _path + ".refs",
484
+ expected: "Array<__type>",
485
+ 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
+ }, errorFactory)) && ((Array.isArray(input.tags) || $guard(_exceptionable, {
535
+ path: _path + ".tags",
536
+ expected: "Array<string>",
537
+ value: input.tags
538
+ }, errorFactory)) && input.tags.every((elem, _index4) => "string" === typeof elem || $guard(_exceptionable, {
539
+ path: _path + ".tags[" + _index4 + "]",
540
+ expected: "string",
541
+ value: elem
542
+ }, errorFactory)) || $guard(_exceptionable, {
543
+ path: _path + ".tags",
544
+ expected: "Array<string>",
545
+ value: input.tags
546
+ }, errorFactory)) && ((Array.isArray(input.error) || $guard(_exceptionable, {
547
+ path: _path + ".error",
548
+ expected: "Array<__type>.o1",
549
+ value: input.error
550
+ }, errorFactory)) && input.error.every((elem, _index5) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
551
+ path: _path + ".error[" + _index5 + "]",
552
+ expected: "__type.o1",
553
+ value: elem
554
+ }, errorFactory)) && $ao2(elem, _path + ".error[" + _index5 + "]", true && _exceptionable) || $guard(_exceptionable, {
555
+ path: _path + ".error[" + _index5 + "]",
556
+ expected: "__type.o1",
557
+ value: elem
558
+ }, errorFactory)) || $guard(_exceptionable, {
559
+ path: _path + ".error",
560
+ expected: "Array<__type>.o1",
561
+ value: input.error
562
+ }, errorFactory));
563
+ const $ao1 = (input, _path, _exceptionable = true) => undefined === input.file || "string" === typeof input.file || $guard(_exceptionable, {
564
+ path: _path + ".file",
565
+ expected: "(string | undefined)",
566
+ value: input.file
567
+ }, errorFactory);
568
+ const $ao2 = (input, _path, _exceptionable = true) => "string" === typeof input.message || $guard(_exceptionable, {
569
+ path: _path + ".message",
570
+ expected: "string",
571
+ value: input.message
572
+ }, errorFactory);
573
+ return ("object" === typeof input && null !== input || $guard(true, {
574
+ path: _path + "",
575
+ expected: "File",
576
+ value: input
577
+ }, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
578
+ path: _path + "",
579
+ expected: "File",
580
+ value: input
581
+ }, errorFactory);
582
+ })(input, "$input", true);
583
+ return input;
584
+ }; const stringify = input => {
585
+ const $io1 = input => undefined === input.file || "string" === typeof input.file;
586
+ const $io2 = input => "string" === typeof input.message;
587
+ const $string = __typia.json.createAssertStringify.string;
588
+ const $tail = __typia.json.createAssertStringify.tail;
589
+ const $so0 = input => `{"id":${$string(input.id)},"deleted":${input.deleted},"completed":${input.completed},"uploading":${input.uploading},"zones":${`[${input.zones.map(elem => $string(elem)).join(",")}]`},"replicas":${`[${input.replicas.map(elem => $string(elem)).join(",")}]`},"refs":${`[${input.refs.map(elem => $so1(elem)).join(",")}]`},"btime":${null !== input.btime ? input.btime : "null"},"seekable":${input.seekable},"resumable":${input.resumable},"size":${null !== input.size ? input.size : "null"},"position":${null !== input.position ? input.position : "null"},"hash":${null !== input.hash ? $string(input.hash) : "null"},"mimeType":${null !== input.mimeType ? $string(input.mimeType) : "null"},"tags":${`[${input.tags.map(elem => $string(elem)).join(",")}]`},"error":${`[${input.error.map(elem => `{"message":${$string(elem.message)}}`).join(",")}]`}}`;
590
+ const $so1 = input => `{${$tail(`${undefined === input.file ? "" : `"file":${undefined !== input.file ? $string(input.file) : undefined}`}`)}}`;
591
+ return $so0(input);
592
+ }; return stringify(assert(input, errorFactory)); };
@@ -1,5 +1,6 @@
1
1
  import { type AssertionGuard as __AssertionGuard } from "typia";
2
2
  export * from './block.js';
3
+ export * from './file.js';
3
4
  export * from './lock.js';
4
5
  export * from './settings.js';
5
6
  export interface Message {
@@ -1,5 +1,6 @@
1
1
  import __typia from "typia";
2
2
  export * from './block.js';
3
+ export * from './file.js';
3
4
  export * from './lock.js';
4
5
  export * from './settings.js';
5
6
  export const isMessage = input => {