@nxtedition/types 1.6.2 → 1.6.4

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.
@@ -1,20 +1,35 @@
1
1
  import __typia from "typia";
2
2
  export const isFile = input => {
3
- const $io0 = input => "string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) && ("number" === typeof input.size && (0 <= input.size && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 18446744073709552000))) && "boolean" === typeof input.seekable && "boolean" === typeof input.deleted && (Array.isArray(input.refs) && input.refs.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $io1(elem))) && (Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem)) && "string" === typeof input.resumable && "string" === typeof input.mimeType && ("string" === typeof input.hash && /^([A-Fa-f0-9]{32})?$/.test(input.hash)) && ("number" === typeof input.btime && (0 <= input.btime && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 18446744073709552000))) && "boolean" === typeof input.completed && (null === input.error || Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io2(elem)));
3
+ const $io0 = input => "string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) && (null === input.size || "number" === typeof input.size && (0 <= input.size && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 18446744073709552000))) && "boolean" === typeof input.seekable && "boolean" === typeof input.deleted && (Array.isArray(input.refs) && input.refs.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $io1(elem))) && (Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem)) && "string" === typeof input.resumable && "string" === typeof input.mimeType && ("string" === typeof input.hash && /^([A-Fa-f0-9]{32})?$/.test(input.hash)) && ("number" === typeof input.btime && (0 <= input.btime && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 18446744073709552000))) && "boolean" === typeof input.completed && (undefined !== input.error && (null === input.error || (Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io2(elem)) || "object" === typeof input.error && null !== input.error && $io2(input.error))));
4
4
  const $io1 = input => (undefined === input.file || "string" === typeof input.file) && (undefined === input.offset || "number" === typeof input.offset) && (undefined === input.start || "number" === typeof input.start) && (undefined === input.end || "number" === typeof input.end);
5
- const $io2 = input => "string" === typeof input.message;
5
+ const $io2 = input => "string" === typeof input.message && (undefined === input.type || "string" === typeof input.type) && (undefined === input.code || "string" === typeof input.code) && (undefined === input.exitCode || "number" === typeof input.exitCode) && (undefined === input.signalCode || "number" === typeof input.signalCode) && (undefined === input.statusCode || "number" === typeof input.statusCode) && (undefined === input.headers || "object" === typeof input.headers && null !== input.headers && false === Array.isArray(input.headers) && $io3(input.headers)) && (undefined === input.data || "object" === typeof input.data && null !== input.data && false === Array.isArray(input.data) && $io4(input.data)) && (null === input.cause || undefined === input.cause || "object" === typeof input.cause && null !== input.cause && $io2(input.cause)) && (null === input.errors || undefined === input.errors || Array.isArray(input.errors) && input.errors.every(elem => "object" === typeof elem && null !== elem && $io2(elem)));
6
+ const $io3 = input => Object.keys(input).every(key => {
7
+ const value = input[key];
8
+ if (undefined === value)
9
+ return true;
10
+ return "string" === typeof value;
11
+ });
12
+ const $io4 = input => true;
6
13
  return "object" === typeof input && null !== input && $io0(input);
7
14
  };
8
15
  export const assertFile = (input, errorFactory) => {
9
16
  const __is = input => {
10
- const $io0 = input => "string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) && ("number" === typeof input.size && (0 <= input.size && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 18446744073709552000))) && "boolean" === typeof input.seekable && "boolean" === typeof input.deleted && (Array.isArray(input.refs) && input.refs.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $io1(elem))) && (Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem)) && "string" === typeof input.resumable && "string" === typeof input.mimeType && ("string" === typeof input.hash && /^([A-Fa-f0-9]{32})?$/.test(input.hash)) && ("number" === typeof input.btime && (0 <= input.btime && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 18446744073709552000))) && "boolean" === typeof input.completed && (null === input.error || Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io2(elem)));
17
+ const $io0 = input => "string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) && (null === input.size || "number" === typeof input.size && (0 <= input.size && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 18446744073709552000))) && "boolean" === typeof input.seekable && "boolean" === typeof input.deleted && (Array.isArray(input.refs) && input.refs.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $io1(elem))) && (Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem)) && "string" === typeof input.resumable && "string" === typeof input.mimeType && ("string" === typeof input.hash && /^([A-Fa-f0-9]{32})?$/.test(input.hash)) && ("number" === typeof input.btime && (0 <= input.btime && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 18446744073709552000))) && "boolean" === typeof input.completed && (undefined !== input.error && (null === input.error || (Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io2(elem)) || "object" === typeof input.error && null !== input.error && $io2(input.error))));
11
18
  const $io1 = input => (undefined === input.file || "string" === typeof input.file) && (undefined === input.offset || "number" === typeof input.offset) && (undefined === input.start || "number" === typeof input.start) && (undefined === input.end || "number" === typeof input.end);
12
- const $io2 = input => "string" === typeof input.message;
19
+ const $io2 = input => "string" === typeof input.message && (undefined === input.type || "string" === typeof input.type) && (undefined === input.code || "string" === typeof input.code) && (undefined === input.exitCode || "number" === typeof input.exitCode) && (undefined === input.signalCode || "number" === typeof input.signalCode) && (undefined === input.statusCode || "number" === typeof input.statusCode) && (undefined === input.headers || "object" === typeof input.headers && null !== input.headers && false === Array.isArray(input.headers) && $io3(input.headers)) && (undefined === input.data || "object" === typeof input.data && null !== input.data && false === Array.isArray(input.data) && $io4(input.data)) && (null === input.cause || undefined === input.cause || "object" === typeof input.cause && null !== input.cause && $io2(input.cause)) && (null === input.errors || undefined === input.errors || Array.isArray(input.errors) && input.errors.every(elem => "object" === typeof elem && null !== elem && $io2(elem)));
20
+ const $io3 = input => Object.keys(input).every(key => {
21
+ const value = input[key];
22
+ if (undefined === value)
23
+ return true;
24
+ return "string" === typeof value;
25
+ });
26
+ const $io4 = input => true;
13
27
  return "object" === typeof input && null !== input && $io0(input);
14
28
  };
15
29
  if (false === __is(input))
16
30
  ((input, _path, _exceptionable = true) => {
17
31
  const $guard = __typia.createAssert.guard;
32
+ const $join = __typia.createAssert.join;
18
33
  const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.id && (/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) || $guard(_exceptionable, {
19
34
  path: _path + ".id",
20
35
  expected: "string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
@@ -23,7 +38,7 @@ export const assertFile = (input, errorFactory) => {
23
38
  path: _path + ".id",
24
39
  expected: "(string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">)",
25
40
  value: input.id
26
- }, errorFactory)) && ("number" === typeof input.size && (0 <= input.size || $guard(_exceptionable, {
41
+ }, errorFactory)) && (null === input.size || "number" === typeof input.size && (0 <= input.size || $guard(_exceptionable, {
27
42
  path: _path + ".size",
28
43
  expected: "number & Minimum<0>",
29
44
  value: input.size
@@ -33,7 +48,7 @@ export const assertFile = (input, errorFactory) => {
33
48
  value: input.size
34
49
  }, errorFactory)) || $guard(_exceptionable, {
35
50
  path: _path + ".size",
36
- expected: "(number & Minimum<0> & Type<\"uint64\">)",
51
+ expected: "((number & Minimum<0> & Type<\"uint64\">) | null)",
37
52
  value: input.size
38
53
  }, errorFactory)) && ("boolean" === typeof input.seekable || $guard(_exceptionable, {
39
54
  path: _path + ".seekable",
@@ -103,23 +118,27 @@ export const assertFile = (input, errorFactory) => {
103
118
  path: _path + ".completed",
104
119
  expected: "boolean",
105
120
  value: input.completed
106
- }, errorFactory)) && (null === input.error || (Array.isArray(input.error) || $guard(_exceptionable, {
121
+ }, errorFactory)) && ((undefined !== input.error || $guard(_exceptionable, {
107
122
  path: _path + ".error",
108
- expected: "(Array<__type>.o1 | null)",
123
+ expected: "(Array<NxtError> | NxtError | null)",
109
124
  value: input.error
110
- }, errorFactory)) && input.error.every((elem, _index3) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
125
+ }, errorFactory)) && (null === input.error || (Array.isArray(input.error) && input.error.every((elem, _index3) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
111
126
  path: _path + ".error[" + _index3 + "]",
112
- expected: "__type.o1",
127
+ expected: "NxtError",
113
128
  value: elem
114
129
  }, errorFactory)) && $ao2(elem, _path + ".error[" + _index3 + "]", true && _exceptionable) || $guard(_exceptionable, {
115
130
  path: _path + ".error[" + _index3 + "]",
116
- expected: "__type.o1",
131
+ expected: "NxtError",
117
132
  value: elem
133
+ }, errorFactory)) || "object" === typeof input.error && null !== input.error && $ao2(input.error, _path + ".error", true && _exceptionable) || $guard(_exceptionable, {
134
+ path: _path + ".error",
135
+ expected: "(Array<NxtError> | NxtError | null)",
136
+ value: input.error
118
137
  }, errorFactory)) || $guard(_exceptionable, {
119
138
  path: _path + ".error",
120
- expected: "(Array<__type>.o1 | null)",
139
+ expected: "(Array<NxtError> | NxtError | null)",
121
140
  value: input.error
122
- }, errorFactory));
141
+ }, errorFactory)));
123
142
  const $ao1 = (input, _path, _exceptionable = true) => (undefined === input.file || "string" === typeof input.file || $guard(_exceptionable, {
124
143
  path: _path + ".file",
125
144
  expected: "(string | undefined)",
@@ -137,11 +156,82 @@ export const assertFile = (input, errorFactory) => {
137
156
  expected: "(number | undefined)",
138
157
  value: input.end
139
158
  }, errorFactory));
140
- const $ao2 = (input, _path, _exceptionable = true) => "string" === typeof input.message || $guard(_exceptionable, {
159
+ const $ao2 = (input, _path, _exceptionable = true) => ("string" === typeof input.message || $guard(_exceptionable, {
141
160
  path: _path + ".message",
142
161
  expected: "string",
143
162
  value: input.message
144
- }, errorFactory);
163
+ }, errorFactory)) && (undefined === input.type || "string" === typeof input.type || $guard(_exceptionable, {
164
+ path: _path + ".type",
165
+ expected: "(string | undefined)",
166
+ value: input.type
167
+ }, errorFactory)) && (undefined === input.code || "string" === typeof input.code || $guard(_exceptionable, {
168
+ path: _path + ".code",
169
+ expected: "(string | undefined)",
170
+ value: input.code
171
+ }, errorFactory)) && (undefined === input.exitCode || "number" === typeof input.exitCode || $guard(_exceptionable, {
172
+ path: _path + ".exitCode",
173
+ expected: "(number | undefined)",
174
+ value: input.exitCode
175
+ }, errorFactory)) && (undefined === input.signalCode || "number" === typeof input.signalCode || $guard(_exceptionable, {
176
+ path: _path + ".signalCode",
177
+ expected: "(number | undefined)",
178
+ value: input.signalCode
179
+ }, errorFactory)) && (undefined === input.statusCode || "number" === typeof input.statusCode || $guard(_exceptionable, {
180
+ path: _path + ".statusCode",
181
+ expected: "(number | undefined)",
182
+ value: input.statusCode
183
+ }, errorFactory)) && (undefined === input.headers || ("object" === typeof input.headers && null !== input.headers && false === Array.isArray(input.headers) || $guard(_exceptionable, {
184
+ path: _path + ".headers",
185
+ expected: "(Record<string, string> | undefined)",
186
+ value: input.headers
187
+ }, errorFactory)) && $ao3(input.headers, _path + ".headers", true && _exceptionable) || $guard(_exceptionable, {
188
+ path: _path + ".headers",
189
+ expected: "(Record<string, string> | undefined)",
190
+ value: input.headers
191
+ }, errorFactory)) && (undefined === input.data || ("object" === typeof input.data && null !== input.data && false === Array.isArray(input.data) || $guard(_exceptionable, {
192
+ path: _path + ".data",
193
+ expected: "(object | undefined)",
194
+ value: input.data
195
+ }, errorFactory)) && $ao4(input.data, _path + ".data", true && _exceptionable) || $guard(_exceptionable, {
196
+ path: _path + ".data",
197
+ expected: "(object | undefined)",
198
+ value: input.data
199
+ }, errorFactory)) && (null === input.cause || undefined === input.cause || ("object" === typeof input.cause && null !== input.cause || $guard(_exceptionable, {
200
+ path: _path + ".cause",
201
+ expected: "(NxtError | null | undefined)",
202
+ value: input.cause
203
+ }, errorFactory)) && $ao2(input.cause, _path + ".cause", true && _exceptionable) || $guard(_exceptionable, {
204
+ path: _path + ".cause",
205
+ expected: "(NxtError | null | undefined)",
206
+ value: input.cause
207
+ }, errorFactory)) && (null === input.errors || undefined === input.errors || (Array.isArray(input.errors) || $guard(_exceptionable, {
208
+ path: _path + ".errors",
209
+ expected: "(Array<NxtError> | null | undefined)",
210
+ value: input.errors
211
+ }, errorFactory)) && input.errors.every((elem, _index4) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
212
+ path: _path + ".errors[" + _index4 + "]",
213
+ expected: "NxtError",
214
+ value: elem
215
+ }, errorFactory)) && $ao2(elem, _path + ".errors[" + _index4 + "]", true && _exceptionable) || $guard(_exceptionable, {
216
+ path: _path + ".errors[" + _index4 + "]",
217
+ expected: "NxtError",
218
+ value: elem
219
+ }, errorFactory)) || $guard(_exceptionable, {
220
+ path: _path + ".errors",
221
+ expected: "(Array<NxtError> | null | undefined)",
222
+ value: input.errors
223
+ }, errorFactory));
224
+ const $ao3 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
225
+ const value = input[key];
226
+ if (undefined === value)
227
+ return true;
228
+ return "string" === typeof value || $guard(_exceptionable, {
229
+ path: _path + $join(key),
230
+ expected: "string",
231
+ value: value
232
+ }, errorFactory);
233
+ });
234
+ const $ao4 = (input, _path, _exceptionable = true) => true;
145
235
  return ("object" === typeof input && null !== input || $guard(true, {
146
236
  path: _path + "",
147
237
  expected: "File",
@@ -165,18 +255,21 @@ export const randomFile = generator => {
165
255
  value: "^[0-9A-Za-z~][0-9A-Za-z~._: -]*$"
166
256
  }
167
257
  ]) ?? (generator?.pattern ?? $generator.pattern)(/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/),
168
- size: (generator?.customs ?? $generator.customs)?.number?.([
169
- {
170
- name: "Minimum<0>",
171
- kind: "minimum",
172
- value: 0
173
- },
174
- {
175
- name: "Type<\"uint64\">",
176
- kind: "type",
177
- value: "uint64"
178
- }
179
- ]) ?? (generator?.integer ?? $generator.integer)(0, 10),
258
+ size: $pick([
259
+ () => null,
260
+ () => (generator?.customs ?? $generator.customs)?.number?.([
261
+ {
262
+ name: "Minimum<0>",
263
+ kind: "minimum",
264
+ value: 0
265
+ },
266
+ {
267
+ name: "Type<\"uint64\">",
268
+ kind: "type",
269
+ value: "uint64"
270
+ }
271
+ ]) ?? (generator?.integer ?? $generator.integer)(0, 10)
272
+ ])(),
180
273
  seekable: (generator?.boolean ?? $generator.boolean)(),
181
274
  deleted: (generator?.boolean ?? $generator.boolean)(),
182
275
  refs: (generator?.array ?? $generator.array)(() => $ro1(_recursive, _recursive ? 1 + _depth : _depth)),
@@ -205,7 +298,8 @@ export const randomFile = generator => {
205
298
  completed: (generator?.boolean ?? $generator.boolean)(),
206
299
  error: $pick([
207
300
  () => null,
208
- () => (generator?.array ?? $generator.array)(() => $ro2(_recursive, _recursive ? 1 + _depth : _depth))
301
+ () => (generator?.array ?? $generator.array)(() => $ro2(_recursive, _recursive ? 1 + _depth : _depth)),
302
+ () => $ro2(_recursive, _recursive ? 1 + _depth : _depth)
209
303
  ])()
210
304
  });
211
305
  const $ro1 = (_recursive = false, _depth = 0) => ({
@@ -226,21 +320,73 @@ export const randomFile = generator => {
226
320
  () => (generator?.customs ?? $generator.customs)?.number?.([]) ?? (generator?.number ?? $generator.number)(0, 100)
227
321
  ])()
228
322
  });
229
- const $ro2 = (_recursive = false, _depth = 0) => ({
230
- message: (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()
323
+ const $ro2 = (_recursive = true, _depth = 0) => ({
324
+ message: (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)(),
325
+ type: $pick([
326
+ () => undefined,
327
+ () => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()
328
+ ])(),
329
+ code: $pick([
330
+ () => undefined,
331
+ () => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()
332
+ ])(),
333
+ exitCode: $pick([
334
+ () => undefined,
335
+ () => (generator?.customs ?? $generator.customs)?.number?.([]) ?? (generator?.number ?? $generator.number)(0, 100)
336
+ ])(),
337
+ signalCode: $pick([
338
+ () => undefined,
339
+ () => (generator?.customs ?? $generator.customs)?.number?.([]) ?? (generator?.number ?? $generator.number)(0, 100)
340
+ ])(),
341
+ statusCode: $pick([
342
+ () => undefined,
343
+ () => (generator?.customs ?? $generator.customs)?.number?.([]) ?? (generator?.number ?? $generator.number)(0, 100)
344
+ ])(),
345
+ headers: $pick([
346
+ () => undefined,
347
+ () => $ro3(true, _recursive ? 1 + _depth : _depth)
348
+ ])(),
349
+ data: $pick([
350
+ () => undefined,
351
+ () => $ro4(true, _recursive ? 1 + _depth : _depth)
352
+ ])(),
353
+ cause: $pick([
354
+ () => undefined,
355
+ () => null,
356
+ () => $ro2(true, _recursive ? 1 + _depth : _depth)
357
+ ])(),
358
+ errors: $pick([
359
+ () => undefined,
360
+ () => null,
361
+ () => _recursive && 5 < _depth ? [] : 5 >= _depth ? (generator?.array ?? $generator.array)(() => $ro2(true, _recursive ? 1 + _depth : _depth)) : []
362
+ ])()
231
363
  });
364
+ const $ro3 = (_recursive = false, _depth = 0) => {
365
+ const output = {};
366
+ (generator?.array ?? $generator.array)(() => output[(generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()] = (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)(), (generator?.integer ?? $generator.integer)(0, 3));
367
+ return output;
368
+ };
369
+ const $ro4 = (_recursive = false, _depth = 0) => {};
232
370
  return $ro0();
233
371
  };
234
372
  export const assertGuardFile = (input, errorFactory) => {
235
373
  const __is = input => {
236
- const $io0 = input => "string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) && ("number" === typeof input.size && (0 <= input.size && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 18446744073709552000))) && "boolean" === typeof input.seekable && "boolean" === typeof input.deleted && (Array.isArray(input.refs) && input.refs.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $io1(elem))) && (Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem)) && "string" === typeof input.resumable && "string" === typeof input.mimeType && ("string" === typeof input.hash && /^([A-Fa-f0-9]{32})?$/.test(input.hash)) && ("number" === typeof input.btime && (0 <= input.btime && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 18446744073709552000))) && "boolean" === typeof input.completed && (null === input.error || Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io2(elem)));
374
+ const $io0 = input => "string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) && (null === input.size || "number" === typeof input.size && (0 <= input.size && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 18446744073709552000))) && "boolean" === typeof input.seekable && "boolean" === typeof input.deleted && (Array.isArray(input.refs) && input.refs.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $io1(elem))) && (Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem)) && "string" === typeof input.resumable && "string" === typeof input.mimeType && ("string" === typeof input.hash && /^([A-Fa-f0-9]{32})?$/.test(input.hash)) && ("number" === typeof input.btime && (0 <= input.btime && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 18446744073709552000))) && "boolean" === typeof input.completed && (undefined !== input.error && (null === input.error || (Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io2(elem)) || "object" === typeof input.error && null !== input.error && $io2(input.error))));
237
375
  const $io1 = input => (undefined === input.file || "string" === typeof input.file) && (undefined === input.offset || "number" === typeof input.offset) && (undefined === input.start || "number" === typeof input.start) && (undefined === input.end || "number" === typeof input.end);
238
- const $io2 = input => "string" === typeof input.message;
376
+ const $io2 = input => "string" === typeof input.message && (undefined === input.type || "string" === typeof input.type) && (undefined === input.code || "string" === typeof input.code) && (undefined === input.exitCode || "number" === typeof input.exitCode) && (undefined === input.signalCode || "number" === typeof input.signalCode) && (undefined === input.statusCode || "number" === typeof input.statusCode) && (undefined === input.headers || "object" === typeof input.headers && null !== input.headers && false === Array.isArray(input.headers) && $io3(input.headers)) && (undefined === input.data || "object" === typeof input.data && null !== input.data && false === Array.isArray(input.data) && $io4(input.data)) && (null === input.cause || undefined === input.cause || "object" === typeof input.cause && null !== input.cause && $io2(input.cause)) && (null === input.errors || undefined === input.errors || Array.isArray(input.errors) && input.errors.every(elem => "object" === typeof elem && null !== elem && $io2(elem)));
377
+ const $io3 = input => Object.keys(input).every(key => {
378
+ const value = input[key];
379
+ if (undefined === value)
380
+ return true;
381
+ return "string" === typeof value;
382
+ });
383
+ const $io4 = input => true;
239
384
  return "object" === typeof input && null !== input && $io0(input);
240
385
  };
241
386
  if (false === __is(input))
242
387
  ((input, _path, _exceptionable = true) => {
243
388
  const $guard = __typia.createAssertGuard.guard;
389
+ const $join = __typia.createAssertGuard.join;
244
390
  const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.id && (/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) || $guard(_exceptionable, {
245
391
  path: _path + ".id",
246
392
  expected: "string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
@@ -249,7 +395,7 @@ export const assertGuardFile = (input, errorFactory) => {
249
395
  path: _path + ".id",
250
396
  expected: "(string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">)",
251
397
  value: input.id
252
- }, errorFactory)) && ("number" === typeof input.size && (0 <= input.size || $guard(_exceptionable, {
398
+ }, errorFactory)) && (null === input.size || "number" === typeof input.size && (0 <= input.size || $guard(_exceptionable, {
253
399
  path: _path + ".size",
254
400
  expected: "number & Minimum<0>",
255
401
  value: input.size
@@ -259,7 +405,7 @@ export const assertGuardFile = (input, errorFactory) => {
259
405
  value: input.size
260
406
  }, errorFactory)) || $guard(_exceptionable, {
261
407
  path: _path + ".size",
262
- expected: "(number & Minimum<0> & Type<\"uint64\">)",
408
+ expected: "((number & Minimum<0> & Type<\"uint64\">) | null)",
263
409
  value: input.size
264
410
  }, errorFactory)) && ("boolean" === typeof input.seekable || $guard(_exceptionable, {
265
411
  path: _path + ".seekable",
@@ -329,23 +475,27 @@ export const assertGuardFile = (input, errorFactory) => {
329
475
  path: _path + ".completed",
330
476
  expected: "boolean",
331
477
  value: input.completed
332
- }, errorFactory)) && (null === input.error || (Array.isArray(input.error) || $guard(_exceptionable, {
478
+ }, errorFactory)) && ((undefined !== input.error || $guard(_exceptionable, {
333
479
  path: _path + ".error",
334
- expected: "(Array<__type>.o1 | null)",
480
+ expected: "(Array<NxtError> | NxtError | null)",
335
481
  value: input.error
336
- }, errorFactory)) && input.error.every((elem, _index3) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
482
+ }, errorFactory)) && (null === input.error || (Array.isArray(input.error) && input.error.every((elem, _index3) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
337
483
  path: _path + ".error[" + _index3 + "]",
338
- expected: "__type.o1",
484
+ expected: "NxtError",
339
485
  value: elem
340
486
  }, errorFactory)) && $ao2(elem, _path + ".error[" + _index3 + "]", true && _exceptionable) || $guard(_exceptionable, {
341
487
  path: _path + ".error[" + _index3 + "]",
342
- expected: "__type.o1",
488
+ expected: "NxtError",
343
489
  value: elem
490
+ }, errorFactory)) || "object" === typeof input.error && null !== input.error && $ao2(input.error, _path + ".error", true && _exceptionable) || $guard(_exceptionable, {
491
+ path: _path + ".error",
492
+ expected: "(Array<NxtError> | NxtError | null)",
493
+ value: input.error
344
494
  }, errorFactory)) || $guard(_exceptionable, {
345
495
  path: _path + ".error",
346
- expected: "(Array<__type>.o1 | null)",
496
+ expected: "(Array<NxtError> | NxtError | null)",
347
497
  value: input.error
348
- }, errorFactory));
498
+ }, errorFactory)));
349
499
  const $ao1 = (input, _path, _exceptionable = true) => (undefined === input.file || "string" === typeof input.file || $guard(_exceptionable, {
350
500
  path: _path + ".file",
351
501
  expected: "(string | undefined)",
@@ -363,11 +513,82 @@ export const assertGuardFile = (input, errorFactory) => {
363
513
  expected: "(number | undefined)",
364
514
  value: input.end
365
515
  }, errorFactory));
366
- const $ao2 = (input, _path, _exceptionable = true) => "string" === typeof input.message || $guard(_exceptionable, {
516
+ const $ao2 = (input, _path, _exceptionable = true) => ("string" === typeof input.message || $guard(_exceptionable, {
367
517
  path: _path + ".message",
368
518
  expected: "string",
369
519
  value: input.message
370
- }, errorFactory);
520
+ }, errorFactory)) && (undefined === input.type || "string" === typeof input.type || $guard(_exceptionable, {
521
+ path: _path + ".type",
522
+ expected: "(string | undefined)",
523
+ value: input.type
524
+ }, errorFactory)) && (undefined === input.code || "string" === typeof input.code || $guard(_exceptionable, {
525
+ path: _path + ".code",
526
+ expected: "(string | undefined)",
527
+ value: input.code
528
+ }, errorFactory)) && (undefined === input.exitCode || "number" === typeof input.exitCode || $guard(_exceptionable, {
529
+ path: _path + ".exitCode",
530
+ expected: "(number | undefined)",
531
+ value: input.exitCode
532
+ }, errorFactory)) && (undefined === input.signalCode || "number" === typeof input.signalCode || $guard(_exceptionable, {
533
+ path: _path + ".signalCode",
534
+ expected: "(number | undefined)",
535
+ value: input.signalCode
536
+ }, errorFactory)) && (undefined === input.statusCode || "number" === typeof input.statusCode || $guard(_exceptionable, {
537
+ path: _path + ".statusCode",
538
+ expected: "(number | undefined)",
539
+ value: input.statusCode
540
+ }, errorFactory)) && (undefined === input.headers || ("object" === typeof input.headers && null !== input.headers && false === Array.isArray(input.headers) || $guard(_exceptionable, {
541
+ path: _path + ".headers",
542
+ expected: "(Record<string, string> | undefined)",
543
+ value: input.headers
544
+ }, errorFactory)) && $ao3(input.headers, _path + ".headers", true && _exceptionable) || $guard(_exceptionable, {
545
+ path: _path + ".headers",
546
+ expected: "(Record<string, string> | undefined)",
547
+ value: input.headers
548
+ }, errorFactory)) && (undefined === input.data || ("object" === typeof input.data && null !== input.data && false === Array.isArray(input.data) || $guard(_exceptionable, {
549
+ path: _path + ".data",
550
+ expected: "(object | undefined)",
551
+ value: input.data
552
+ }, errorFactory)) && $ao4(input.data, _path + ".data", true && _exceptionable) || $guard(_exceptionable, {
553
+ path: _path + ".data",
554
+ expected: "(object | undefined)",
555
+ value: input.data
556
+ }, errorFactory)) && (null === input.cause || undefined === input.cause || ("object" === typeof input.cause && null !== input.cause || $guard(_exceptionable, {
557
+ path: _path + ".cause",
558
+ expected: "(NxtError | null | undefined)",
559
+ value: input.cause
560
+ }, errorFactory)) && $ao2(input.cause, _path + ".cause", true && _exceptionable) || $guard(_exceptionable, {
561
+ path: _path + ".cause",
562
+ expected: "(NxtError | null | undefined)",
563
+ value: input.cause
564
+ }, errorFactory)) && (null === input.errors || undefined === input.errors || (Array.isArray(input.errors) || $guard(_exceptionable, {
565
+ path: _path + ".errors",
566
+ expected: "(Array<NxtError> | null | undefined)",
567
+ value: input.errors
568
+ }, errorFactory)) && input.errors.every((elem, _index4) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
569
+ path: _path + ".errors[" + _index4 + "]",
570
+ expected: "NxtError",
571
+ value: elem
572
+ }, errorFactory)) && $ao2(elem, _path + ".errors[" + _index4 + "]", true && _exceptionable) || $guard(_exceptionable, {
573
+ path: _path + ".errors[" + _index4 + "]",
574
+ expected: "NxtError",
575
+ value: elem
576
+ }, errorFactory)) || $guard(_exceptionable, {
577
+ path: _path + ".errors",
578
+ expected: "(Array<NxtError> | null | undefined)",
579
+ value: input.errors
580
+ }, errorFactory));
581
+ const $ao3 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
582
+ const value = input[key];
583
+ if (undefined === value)
584
+ return true;
585
+ return "string" === typeof value || $guard(_exceptionable, {
586
+ path: _path + $join(key),
587
+ expected: "string",
588
+ value: value
589
+ }, errorFactory);
590
+ });
591
+ const $ao4 = (input, _path, _exceptionable = true) => true;
371
592
  return ("object" === typeof input && null !== input || $guard(true, {
372
593
  path: _path + "",
373
594
  expected: "File",
@@ -381,23 +602,51 @@ export const assertGuardFile = (input, errorFactory) => {
381
602
  };
382
603
  export const stringifyFile = input => {
383
604
  const $io1 = input => (undefined === input.file || "string" === typeof input.file) && (undefined === input.offset || "number" === typeof input.offset) && (undefined === input.start || "number" === typeof input.start) && (undefined === input.end || "number" === typeof input.end);
384
- const $io2 = input => "string" === typeof input.message;
605
+ const $io2 = input => "string" === typeof input.message && (undefined === input.type || "string" === typeof input.type) && (undefined === input.code || "string" === typeof input.code) && (undefined === input.exitCode || "number" === typeof input.exitCode) && (undefined === input.signalCode || "number" === typeof input.signalCode) && (undefined === input.statusCode || "number" === typeof input.statusCode) && (undefined === input.headers || "object" === typeof input.headers && null !== input.headers && false === Array.isArray(input.headers) && $io3(input.headers)) && (undefined === input.data || "object" === typeof input.data && null !== input.data && false === Array.isArray(input.data) && $io4(input.data)) && (null === input.cause || undefined === input.cause || "object" === typeof input.cause && null !== input.cause && $io2(input.cause)) && (null === input.errors || undefined === input.errors || Array.isArray(input.errors) && input.errors.every(elem => "object" === typeof elem && null !== elem && $io2(elem)));
606
+ const $io3 = input => Object.keys(input).every(key => {
607
+ const value = input[key];
608
+ if (undefined === value)
609
+ return true;
610
+ return "string" === typeof value;
611
+ });
612
+ const $io4 = input => true;
385
613
  const $string = __typia.json.createStringify.string;
614
+ const $throws = __typia.json.createStringify.throws;
386
615
  const $tail = __typia.json.createStringify.tail;
387
- const $so0 = input => `{"id":${$string(input.id)},"size":${input.size},"seekable":${input.seekable},"deleted":${input.deleted},"refs":${`[${input.refs.map(elem => $so1(elem)).join(",")}]`},"tags":${`[${input.tags.map(elem => $string(elem)).join(",")}]`},"resumable":${$string(input.resumable)},"mimeType":${$string(input.mimeType)},"hash":${$string(input.hash)},"btime":${input.btime},"completed":${input.completed},"error":${null !== input.error ? `[${input.error.map(elem => `{"message":${$string(elem.message)}}`).join(",")}]` : "null"}}`;
616
+ const $so0 = input => `{"id":${$string(input.id)},"size":${null !== input.size ? input.size : "null"},"seekable":${input.seekable},"deleted":${input.deleted},"refs":${`[${input.refs.map(elem => $so1(elem)).join(",")}]`},"tags":${`[${input.tags.map(elem => $string(elem)).join(",")}]`},"resumable":${$string(input.resumable)},"mimeType":${$string(input.mimeType)},"hash":${$string(input.hash)},"btime":${input.btime},"completed":${input.completed},"error":${null !== input.error ? (() => {
617
+ if (Array.isArray(input.error))
618
+ return `[${input.error.map(elem => $so2(elem)).join(",")}]`;
619
+ if ("object" === typeof input.error && null !== input.error)
620
+ return $so2(input.error);
621
+ $throws({
622
+ expected: "(Array<NxtError> | NxtError | null)",
623
+ value: input.error
624
+ });
625
+ })() : "null"}}`;
388
626
  const $so1 = input => `{${$tail(`${undefined === input.file ? "" : `"file":${undefined !== input.file ? $string(input.file) : undefined},`}${undefined === input.offset ? "" : `"offset":${undefined !== input.offset ? input.offset : undefined},`}${undefined === input.start ? "" : `"start":${undefined !== input.start ? input.start : undefined},`}${undefined === input.end ? "" : `"end":${undefined !== input.end ? input.end : undefined}`}`)}}`;
627
+ const $so2 = input => `{${undefined === input.type ? "" : `"type":${undefined !== input.type ? $string(input.type) : undefined},`}${undefined === input.code ? "" : `"code":${undefined !== input.code ? $string(input.code) : undefined},`}${undefined === input.exitCode ? "" : `"exitCode":${undefined !== input.exitCode ? input.exitCode : undefined},`}${undefined === input.signalCode ? "" : `"signalCode":${undefined !== input.signalCode ? input.signalCode : undefined},`}${undefined === input.statusCode ? "" : `"statusCode":${undefined !== input.statusCode ? input.statusCode : undefined},`}${undefined === input.headers ? "" : `"headers":${undefined !== input.headers ? $so3(input.headers) : undefined},`}${undefined === input.data ? "" : `"data":${undefined !== input.data ? "{}" : undefined},`}${undefined === input.cause ? "" : `"cause":${undefined !== input.cause ? null !== input.cause ? $so2(input.cause) : "null" : undefined},`}${undefined === input.errors ? "" : `"errors":${undefined !== input.errors ? null !== input.errors ? `[${input.errors.map(elem => $so2(elem)).join(",")}]` : "null" : undefined},`}"message":${$string(input.message)}}`;
628
+ const $so3 = input => `{${Object.entries(input).map(([key, value]) => { if (undefined === value)
629
+ return ""; return `${JSON.stringify(key)}:${$string(value)}`; }).filter(str => "" !== str).join(",")}}`;
389
630
  return $so0(input);
390
631
  };
391
632
  export const assertStringifyFile = (input, errorFactory) => { const assert = (input, errorFactory) => {
392
633
  const __is = input => {
393
- const $io0 = input => "string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) && ("number" === typeof input.size && (0 <= input.size && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 18446744073709552000))) && "boolean" === typeof input.seekable && "boolean" === typeof input.deleted && (Array.isArray(input.refs) && input.refs.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $io1(elem))) && (Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem)) && "string" === typeof input.resumable && "string" === typeof input.mimeType && ("string" === typeof input.hash && /^([A-Fa-f0-9]{32})?$/.test(input.hash)) && ("number" === typeof input.btime && (0 <= input.btime && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 18446744073709552000))) && "boolean" === typeof input.completed && (null === input.error || Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io2(elem)));
634
+ const $io0 = input => "string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) && (null === input.size || "number" === typeof input.size && (0 <= input.size && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 18446744073709552000))) && "boolean" === typeof input.seekable && "boolean" === typeof input.deleted && (Array.isArray(input.refs) && input.refs.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $io1(elem))) && (Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem)) && "string" === typeof input.resumable && "string" === typeof input.mimeType && ("string" === typeof input.hash && /^([A-Fa-f0-9]{32})?$/.test(input.hash)) && ("number" === typeof input.btime && (0 <= input.btime && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 18446744073709552000))) && "boolean" === typeof input.completed && (undefined !== input.error && (null === input.error || (Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io2(elem)) || "object" === typeof input.error && null !== input.error && $io2(input.error))));
394
635
  const $io1 = input => (undefined === input.file || "string" === typeof input.file) && (undefined === input.offset || "number" === typeof input.offset && !Number.isNaN(input.offset)) && (undefined === input.start || "number" === typeof input.start && !Number.isNaN(input.start)) && (undefined === input.end || "number" === typeof input.end && !Number.isNaN(input.end));
395
- const $io2 = input => "string" === typeof input.message;
636
+ const $io2 = input => "string" === typeof input.message && (undefined === input.type || "string" === typeof input.type) && (undefined === input.code || "string" === typeof input.code) && (undefined === input.exitCode || "number" === typeof input.exitCode && !Number.isNaN(input.exitCode)) && (undefined === input.signalCode || "number" === typeof input.signalCode && !Number.isNaN(input.signalCode)) && (undefined === input.statusCode || "number" === typeof input.statusCode && !Number.isNaN(input.statusCode)) && (undefined === input.headers || "object" === typeof input.headers && null !== input.headers && false === Array.isArray(input.headers) && $io3(input.headers)) && (undefined === input.data || "object" === typeof input.data && null !== input.data && false === Array.isArray(input.data) && $io4(input.data)) && (null === input.cause || undefined === input.cause || "object" === typeof input.cause && null !== input.cause && $io2(input.cause)) && (null === input.errors || undefined === input.errors || Array.isArray(input.errors) && input.errors.every(elem => "object" === typeof elem && null !== elem && $io2(elem)));
637
+ const $io3 = input => Object.keys(input).every(key => {
638
+ const value = input[key];
639
+ if (undefined === value)
640
+ return true;
641
+ return "string" === typeof value;
642
+ });
643
+ const $io4 = input => true;
396
644
  return "object" === typeof input && null !== input && $io0(input);
397
645
  };
398
646
  if (false === __is(input))
399
647
  ((input, _path, _exceptionable = true) => {
400
648
  const $guard = __typia.json.createAssertStringify.guard;
649
+ const $join = __typia.json.createAssertStringify.join;
401
650
  const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.id && (/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) || $guard(_exceptionable, {
402
651
  path: _path + ".id",
403
652
  expected: "string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
@@ -406,7 +655,7 @@ export const assertStringifyFile = (input, errorFactory) => { const assert = (in
406
655
  path: _path + ".id",
407
656
  expected: "(string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">)",
408
657
  value: input.id
409
- }, errorFactory)) && ("number" === typeof input.size && (0 <= input.size || $guard(_exceptionable, {
658
+ }, errorFactory)) && (null === input.size || "number" === typeof input.size && (0 <= input.size || $guard(_exceptionable, {
410
659
  path: _path + ".size",
411
660
  expected: "number & Minimum<0>",
412
661
  value: input.size
@@ -416,7 +665,7 @@ export const assertStringifyFile = (input, errorFactory) => { const assert = (in
416
665
  value: input.size
417
666
  }, errorFactory)) || $guard(_exceptionable, {
418
667
  path: _path + ".size",
419
- expected: "(number & Minimum<0> & Type<\"uint64\">)",
668
+ expected: "((number & Minimum<0> & Type<\"uint64\">) | null)",
420
669
  value: input.size
421
670
  }, errorFactory)) && ("boolean" === typeof input.seekable || $guard(_exceptionable, {
422
671
  path: _path + ".seekable",
@@ -486,23 +735,27 @@ export const assertStringifyFile = (input, errorFactory) => { const assert = (in
486
735
  path: _path + ".completed",
487
736
  expected: "boolean",
488
737
  value: input.completed
489
- }, errorFactory)) && (null === input.error || (Array.isArray(input.error) || $guard(_exceptionable, {
738
+ }, errorFactory)) && ((undefined !== input.error || $guard(_exceptionable, {
490
739
  path: _path + ".error",
491
- expected: "(Array<__type>.o1 | null)",
740
+ expected: "(Array<NxtError> | NxtError | null)",
492
741
  value: input.error
493
- }, errorFactory)) && input.error.every((elem, _index3) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
742
+ }, errorFactory)) && (null === input.error || (Array.isArray(input.error) && input.error.every((elem, _index3) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
494
743
  path: _path + ".error[" + _index3 + "]",
495
- expected: "__type.o1",
744
+ expected: "NxtError",
496
745
  value: elem
497
746
  }, errorFactory)) && $ao2(elem, _path + ".error[" + _index3 + "]", true && _exceptionable) || $guard(_exceptionable, {
498
747
  path: _path + ".error[" + _index3 + "]",
499
- expected: "__type.o1",
748
+ expected: "NxtError",
500
749
  value: elem
750
+ }, errorFactory)) || "object" === typeof input.error && null !== input.error && $ao2(input.error, _path + ".error", true && _exceptionable) || $guard(_exceptionable, {
751
+ path: _path + ".error",
752
+ expected: "(Array<NxtError> | NxtError | null)",
753
+ value: input.error
501
754
  }, errorFactory)) || $guard(_exceptionable, {
502
755
  path: _path + ".error",
503
- expected: "(Array<__type>.o1 | null)",
756
+ expected: "(Array<NxtError> | NxtError | null)",
504
757
  value: input.error
505
- }, errorFactory));
758
+ }, errorFactory)));
506
759
  const $ao1 = (input, _path, _exceptionable = true) => (undefined === input.file || "string" === typeof input.file || $guard(_exceptionable, {
507
760
  path: _path + ".file",
508
761
  expected: "(string | undefined)",
@@ -520,11 +773,82 @@ export const assertStringifyFile = (input, errorFactory) => { const assert = (in
520
773
  expected: "(number | undefined)",
521
774
  value: input.end
522
775
  }, errorFactory));
523
- const $ao2 = (input, _path, _exceptionable = true) => "string" === typeof input.message || $guard(_exceptionable, {
776
+ const $ao2 = (input, _path, _exceptionable = true) => ("string" === typeof input.message || $guard(_exceptionable, {
524
777
  path: _path + ".message",
525
778
  expected: "string",
526
779
  value: input.message
527
- }, errorFactory);
780
+ }, errorFactory)) && (undefined === input.type || "string" === typeof input.type || $guard(_exceptionable, {
781
+ path: _path + ".type",
782
+ expected: "(string | undefined)",
783
+ value: input.type
784
+ }, errorFactory)) && (undefined === input.code || "string" === typeof input.code || $guard(_exceptionable, {
785
+ path: _path + ".code",
786
+ expected: "(string | undefined)",
787
+ value: input.code
788
+ }, errorFactory)) && (undefined === input.exitCode || "number" === typeof input.exitCode && !Number.isNaN(input.exitCode) || $guard(_exceptionable, {
789
+ path: _path + ".exitCode",
790
+ expected: "(number | undefined)",
791
+ value: input.exitCode
792
+ }, errorFactory)) && (undefined === input.signalCode || "number" === typeof input.signalCode && !Number.isNaN(input.signalCode) || $guard(_exceptionable, {
793
+ path: _path + ".signalCode",
794
+ expected: "(number | undefined)",
795
+ value: input.signalCode
796
+ }, errorFactory)) && (undefined === input.statusCode || "number" === typeof input.statusCode && !Number.isNaN(input.statusCode) || $guard(_exceptionable, {
797
+ path: _path + ".statusCode",
798
+ expected: "(number | undefined)",
799
+ value: input.statusCode
800
+ }, errorFactory)) && (undefined === input.headers || ("object" === typeof input.headers && null !== input.headers && false === Array.isArray(input.headers) || $guard(_exceptionable, {
801
+ path: _path + ".headers",
802
+ expected: "(Record<string, string> | undefined)",
803
+ value: input.headers
804
+ }, errorFactory)) && $ao3(input.headers, _path + ".headers", true && _exceptionable) || $guard(_exceptionable, {
805
+ path: _path + ".headers",
806
+ expected: "(Record<string, string> | undefined)",
807
+ value: input.headers
808
+ }, errorFactory)) && (undefined === input.data || ("object" === typeof input.data && null !== input.data && false === Array.isArray(input.data) || $guard(_exceptionable, {
809
+ path: _path + ".data",
810
+ expected: "(object | undefined)",
811
+ value: input.data
812
+ }, errorFactory)) && $ao4(input.data, _path + ".data", true && _exceptionable) || $guard(_exceptionable, {
813
+ path: _path + ".data",
814
+ expected: "(object | undefined)",
815
+ value: input.data
816
+ }, errorFactory)) && (null === input.cause || undefined === input.cause || ("object" === typeof input.cause && null !== input.cause || $guard(_exceptionable, {
817
+ path: _path + ".cause",
818
+ expected: "(NxtError | null | undefined)",
819
+ value: input.cause
820
+ }, errorFactory)) && $ao2(input.cause, _path + ".cause", true && _exceptionable) || $guard(_exceptionable, {
821
+ path: _path + ".cause",
822
+ expected: "(NxtError | null | undefined)",
823
+ value: input.cause
824
+ }, errorFactory)) && (null === input.errors || undefined === input.errors || (Array.isArray(input.errors) || $guard(_exceptionable, {
825
+ path: _path + ".errors",
826
+ expected: "(Array<NxtError> | null | undefined)",
827
+ value: input.errors
828
+ }, errorFactory)) && input.errors.every((elem, _index4) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
829
+ path: _path + ".errors[" + _index4 + "]",
830
+ expected: "NxtError",
831
+ value: elem
832
+ }, errorFactory)) && $ao2(elem, _path + ".errors[" + _index4 + "]", true && _exceptionable) || $guard(_exceptionable, {
833
+ path: _path + ".errors[" + _index4 + "]",
834
+ expected: "NxtError",
835
+ value: elem
836
+ }, errorFactory)) || $guard(_exceptionable, {
837
+ path: _path + ".errors",
838
+ expected: "(Array<NxtError> | null | undefined)",
839
+ value: input.errors
840
+ }, errorFactory));
841
+ const $ao3 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
842
+ const value = input[key];
843
+ if (undefined === value)
844
+ return true;
845
+ return "string" === typeof value || $guard(_exceptionable, {
846
+ path: _path + $join(key),
847
+ expected: "string",
848
+ value: value
849
+ }, errorFactory);
850
+ });
851
+ const $ao4 = (input, _path, _exceptionable = true) => true;
528
852
  return ("object" === typeof input && null !== input || $guard(true, {
529
853
  path: _path + "",
530
854
  expected: "File",
@@ -538,29 +862,64 @@ export const assertStringifyFile = (input, errorFactory) => { const assert = (in
538
862
  return input;
539
863
  }; const stringify = input => {
540
864
  const $io1 = input => (undefined === input.file || "string" === typeof input.file) && (undefined === input.offset || "number" === typeof input.offset) && (undefined === input.start || "number" === typeof input.start) && (undefined === input.end || "number" === typeof input.end);
541
- const $io2 = input => "string" === typeof input.message;
865
+ const $io2 = input => "string" === typeof input.message && (undefined === input.type || "string" === typeof input.type) && (undefined === input.code || "string" === typeof input.code) && (undefined === input.exitCode || "number" === typeof input.exitCode) && (undefined === input.signalCode || "number" === typeof input.signalCode) && (undefined === input.statusCode || "number" === typeof input.statusCode) && (undefined === input.headers || "object" === typeof input.headers && null !== input.headers && false === Array.isArray(input.headers) && $io3(input.headers)) && (undefined === input.data || "object" === typeof input.data && null !== input.data && false === Array.isArray(input.data) && $io4(input.data)) && (null === input.cause || undefined === input.cause || "object" === typeof input.cause && null !== input.cause && $io2(input.cause)) && (null === input.errors || undefined === input.errors || Array.isArray(input.errors) && input.errors.every(elem => "object" === typeof elem && null !== elem && $io2(elem)));
866
+ const $io3 = input => Object.keys(input).every(key => {
867
+ const value = input[key];
868
+ if (undefined === value)
869
+ return true;
870
+ return "string" === typeof value;
871
+ });
872
+ const $io4 = input => true;
542
873
  const $string = __typia.json.createAssertStringify.string;
874
+ const $throws = __typia.json.createAssertStringify.throws;
543
875
  const $tail = __typia.json.createAssertStringify.tail;
544
- const $so0 = input => `{"id":${$string(input.id)},"size":${input.size},"seekable":${input.seekable},"deleted":${input.deleted},"refs":${`[${input.refs.map(elem => $so1(elem)).join(",")}]`},"tags":${`[${input.tags.map(elem => $string(elem)).join(",")}]`},"resumable":${$string(input.resumable)},"mimeType":${$string(input.mimeType)},"hash":${$string(input.hash)},"btime":${input.btime},"completed":${input.completed},"error":${null !== input.error ? `[${input.error.map(elem => `{"message":${$string(elem.message)}}`).join(",")}]` : "null"}}`;
876
+ const $so0 = input => `{"id":${$string(input.id)},"size":${null !== input.size ? input.size : "null"},"seekable":${input.seekable},"deleted":${input.deleted},"refs":${`[${input.refs.map(elem => $so1(elem)).join(",")}]`},"tags":${`[${input.tags.map(elem => $string(elem)).join(",")}]`},"resumable":${$string(input.resumable)},"mimeType":${$string(input.mimeType)},"hash":${$string(input.hash)},"btime":${input.btime},"completed":${input.completed},"error":${null !== input.error ? (() => {
877
+ if (Array.isArray(input.error))
878
+ return `[${input.error.map(elem => $so2(elem)).join(",")}]`;
879
+ if ("object" === typeof input.error && null !== input.error)
880
+ return $so2(input.error);
881
+ $throws({
882
+ expected: "(Array<NxtError> | NxtError | null)",
883
+ value: input.error
884
+ });
885
+ })() : "null"}}`;
545
886
  const $so1 = input => `{${$tail(`${undefined === input.file ? "" : `"file":${undefined !== input.file ? $string(input.file) : undefined},`}${undefined === input.offset ? "" : `"offset":${undefined !== input.offset ? input.offset : undefined},`}${undefined === input.start ? "" : `"start":${undefined !== input.start ? input.start : undefined},`}${undefined === input.end ? "" : `"end":${undefined !== input.end ? input.end : undefined}`}`)}}`;
887
+ const $so2 = input => `{${undefined === input.type ? "" : `"type":${undefined !== input.type ? $string(input.type) : undefined},`}${undefined === input.code ? "" : `"code":${undefined !== input.code ? $string(input.code) : undefined},`}${undefined === input.exitCode ? "" : `"exitCode":${undefined !== input.exitCode ? input.exitCode : undefined},`}${undefined === input.signalCode ? "" : `"signalCode":${undefined !== input.signalCode ? input.signalCode : undefined},`}${undefined === input.statusCode ? "" : `"statusCode":${undefined !== input.statusCode ? input.statusCode : undefined},`}${undefined === input.headers ? "" : `"headers":${undefined !== input.headers ? $so3(input.headers) : undefined},`}${undefined === input.data ? "" : `"data":${undefined !== input.data ? "{}" : undefined},`}${undefined === input.cause ? "" : `"cause":${undefined !== input.cause ? null !== input.cause ? $so2(input.cause) : "null" : undefined},`}${undefined === input.errors ? "" : `"errors":${undefined !== input.errors ? null !== input.errors ? `[${input.errors.map(elem => $so2(elem)).join(",")}]` : "null" : undefined},`}"message":${$string(input.message)}}`;
888
+ const $so3 = input => `{${Object.entries(input).map(([key, value]) => { if (undefined === value)
889
+ return ""; return `${JSON.stringify(key)}:${$string(value)}`; }).filter(str => "" !== str).join(",")}}`;
546
890
  return $so0(input);
547
891
  }; return stringify(assert(input, errorFactory)); };
548
892
  export const isFileStats = input => {
549
- const $io0 = input => (null === input.position || "number" === typeof input.position && (0 <= input.position && (Math.floor(input.position) === input.position && 0 <= input.position && input.position <= 18446744073709552000))) && "boolean" === typeof input.uploading && (Array.isArray(input.zones) && input.zones.every(elem => "string" === typeof elem)) && (Array.isArray(input.replicas) && input.replicas.every(elem => "string" === typeof elem)) && ("string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id)) && ("number" === typeof input.size && (0 <= input.size && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 18446744073709552000))) && "boolean" === typeof input.seekable && "boolean" === typeof input.deleted && (Array.isArray(input.refs) && input.refs.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $io1(elem))) && (Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem)) && "string" === typeof input.resumable && "string" === typeof input.mimeType && ("string" === typeof input.hash && /^([A-Fa-f0-9]{32})?$/.test(input.hash)) && ("number" === typeof input.btime && (0 <= input.btime && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 18446744073709552000))) && "boolean" === typeof input.completed && (null === input.error || Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io2(elem)));
893
+ const $io0 = input => (null === input.position || "number" === typeof input.position && (0 <= input.position && (Math.floor(input.position) === input.position && 0 <= input.position && input.position <= 18446744073709552000))) && "boolean" === typeof input.uploading && (Array.isArray(input.zones) && input.zones.every(elem => "string" === typeof elem)) && (Array.isArray(input.replicas) && input.replicas.every(elem => "string" === typeof elem)) && ("string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id)) && (null === input.size || "number" === typeof input.size && (0 <= input.size && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 18446744073709552000))) && "boolean" === typeof input.seekable && "boolean" === typeof input.deleted && (Array.isArray(input.refs) && input.refs.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $io1(elem))) && (Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem)) && "string" === typeof input.resumable && "string" === typeof input.mimeType && ("string" === typeof input.hash && /^([A-Fa-f0-9]{32})?$/.test(input.hash)) && ("number" === typeof input.btime && (0 <= input.btime && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 18446744073709552000))) && "boolean" === typeof input.completed && (undefined !== input.error && (null === input.error || (Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io2(elem)) || "object" === typeof input.error && null !== input.error && $io2(input.error))));
550
894
  const $io1 = input => (undefined === input.file || "string" === typeof input.file) && (undefined === input.offset || "number" === typeof input.offset) && (undefined === input.start || "number" === typeof input.start) && (undefined === input.end || "number" === typeof input.end);
551
- const $io2 = input => "string" === typeof input.message;
895
+ const $io2 = input => "string" === typeof input.message && (undefined === input.type || "string" === typeof input.type) && (undefined === input.code || "string" === typeof input.code) && (undefined === input.exitCode || "number" === typeof input.exitCode) && (undefined === input.signalCode || "number" === typeof input.signalCode) && (undefined === input.statusCode || "number" === typeof input.statusCode) && (undefined === input.headers || "object" === typeof input.headers && null !== input.headers && false === Array.isArray(input.headers) && $io3(input.headers)) && (undefined === input.data || "object" === typeof input.data && null !== input.data && false === Array.isArray(input.data) && $io4(input.data)) && (null === input.cause || undefined === input.cause || "object" === typeof input.cause && null !== input.cause && $io2(input.cause)) && (null === input.errors || undefined === input.errors || Array.isArray(input.errors) && input.errors.every(elem => "object" === typeof elem && null !== elem && $io2(elem)));
896
+ const $io3 = input => Object.keys(input).every(key => {
897
+ const value = input[key];
898
+ if (undefined === value)
899
+ return true;
900
+ return "string" === typeof value;
901
+ });
902
+ const $io4 = input => true;
552
903
  return "object" === typeof input && null !== input && $io0(input);
553
904
  };
554
905
  export const assertFileStats = (input, errorFactory) => {
555
906
  const __is = input => {
556
- const $io0 = input => (null === input.position || "number" === typeof input.position && (0 <= input.position && (Math.floor(input.position) === input.position && 0 <= input.position && input.position <= 18446744073709552000))) && "boolean" === typeof input.uploading && (Array.isArray(input.zones) && input.zones.every(elem => "string" === typeof elem)) && (Array.isArray(input.replicas) && input.replicas.every(elem => "string" === typeof elem)) && ("string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id)) && ("number" === typeof input.size && (0 <= input.size && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 18446744073709552000))) && "boolean" === typeof input.seekable && "boolean" === typeof input.deleted && (Array.isArray(input.refs) && input.refs.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $io1(elem))) && (Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem)) && "string" === typeof input.resumable && "string" === typeof input.mimeType && ("string" === typeof input.hash && /^([A-Fa-f0-9]{32})?$/.test(input.hash)) && ("number" === typeof input.btime && (0 <= input.btime && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 18446744073709552000))) && "boolean" === typeof input.completed && (null === input.error || Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io2(elem)));
907
+ const $io0 = input => (null === input.position || "number" === typeof input.position && (0 <= input.position && (Math.floor(input.position) === input.position && 0 <= input.position && input.position <= 18446744073709552000))) && "boolean" === typeof input.uploading && (Array.isArray(input.zones) && input.zones.every(elem => "string" === typeof elem)) && (Array.isArray(input.replicas) && input.replicas.every(elem => "string" === typeof elem)) && ("string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id)) && (null === input.size || "number" === typeof input.size && (0 <= input.size && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 18446744073709552000))) && "boolean" === typeof input.seekable && "boolean" === typeof input.deleted && (Array.isArray(input.refs) && input.refs.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $io1(elem))) && (Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem)) && "string" === typeof input.resumable && "string" === typeof input.mimeType && ("string" === typeof input.hash && /^([A-Fa-f0-9]{32})?$/.test(input.hash)) && ("number" === typeof input.btime && (0 <= input.btime && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 18446744073709552000))) && "boolean" === typeof input.completed && (undefined !== input.error && (null === input.error || (Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io2(elem)) || "object" === typeof input.error && null !== input.error && $io2(input.error))));
557
908
  const $io1 = input => (undefined === input.file || "string" === typeof input.file) && (undefined === input.offset || "number" === typeof input.offset) && (undefined === input.start || "number" === typeof input.start) && (undefined === input.end || "number" === typeof input.end);
558
- const $io2 = input => "string" === typeof input.message;
909
+ const $io2 = input => "string" === typeof input.message && (undefined === input.type || "string" === typeof input.type) && (undefined === input.code || "string" === typeof input.code) && (undefined === input.exitCode || "number" === typeof input.exitCode) && (undefined === input.signalCode || "number" === typeof input.signalCode) && (undefined === input.statusCode || "number" === typeof input.statusCode) && (undefined === input.headers || "object" === typeof input.headers && null !== input.headers && false === Array.isArray(input.headers) && $io3(input.headers)) && (undefined === input.data || "object" === typeof input.data && null !== input.data && false === Array.isArray(input.data) && $io4(input.data)) && (null === input.cause || undefined === input.cause || "object" === typeof input.cause && null !== input.cause && $io2(input.cause)) && (null === input.errors || undefined === input.errors || Array.isArray(input.errors) && input.errors.every(elem => "object" === typeof elem && null !== elem && $io2(elem)));
910
+ const $io3 = input => Object.keys(input).every(key => {
911
+ const value = input[key];
912
+ if (undefined === value)
913
+ return true;
914
+ return "string" === typeof value;
915
+ });
916
+ const $io4 = input => true;
559
917
  return "object" === typeof input && null !== input && $io0(input);
560
918
  };
561
919
  if (false === __is(input))
562
920
  ((input, _path, _exceptionable = true) => {
563
921
  const $guard = __typia.createAssert.guard;
922
+ const $join = __typia.createAssert.join;
564
923
  const $ao0 = (input, _path, _exceptionable = true) => (null === input.position || "number" === typeof input.position && (0 <= input.position || $guard(_exceptionable, {
565
924
  path: _path + ".position",
566
925
  expected: "number & Minimum<0>",
@@ -609,7 +968,7 @@ export const assertFileStats = (input, errorFactory) => {
609
968
  path: _path + ".id",
610
969
  expected: "(string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">)",
611
970
  value: input.id
612
- }, errorFactory)) && ("number" === typeof input.size && (0 <= input.size || $guard(_exceptionable, {
971
+ }, errorFactory)) && (null === input.size || "number" === typeof input.size && (0 <= input.size || $guard(_exceptionable, {
613
972
  path: _path + ".size",
614
973
  expected: "number & Minimum<0>",
615
974
  value: input.size
@@ -619,7 +978,7 @@ export const assertFileStats = (input, errorFactory) => {
619
978
  value: input.size
620
979
  }, errorFactory)) || $guard(_exceptionable, {
621
980
  path: _path + ".size",
622
- expected: "(number & Minimum<0> & Type<\"uint64\">)",
981
+ expected: "((number & Minimum<0> & Type<\"uint64\">) | null)",
623
982
  value: input.size
624
983
  }, errorFactory)) && ("boolean" === typeof input.seekable || $guard(_exceptionable, {
625
984
  path: _path + ".seekable",
@@ -689,23 +1048,27 @@ export const assertFileStats = (input, errorFactory) => {
689
1048
  path: _path + ".completed",
690
1049
  expected: "boolean",
691
1050
  value: input.completed
692
- }, errorFactory)) && (null === input.error || (Array.isArray(input.error) || $guard(_exceptionable, {
1051
+ }, errorFactory)) && ((undefined !== input.error || $guard(_exceptionable, {
693
1052
  path: _path + ".error",
694
- expected: "(Array<__type>.o1 | null)",
1053
+ expected: "(Array<NxtError> | NxtError | null)",
695
1054
  value: input.error
696
- }, errorFactory)) && input.error.every((elem, _index5) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
1055
+ }, errorFactory)) && (null === input.error || (Array.isArray(input.error) && input.error.every((elem, _index5) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
697
1056
  path: _path + ".error[" + _index5 + "]",
698
- expected: "__type.o1",
1057
+ expected: "NxtError",
699
1058
  value: elem
700
1059
  }, errorFactory)) && $ao2(elem, _path + ".error[" + _index5 + "]", true && _exceptionable) || $guard(_exceptionable, {
701
1060
  path: _path + ".error[" + _index5 + "]",
702
- expected: "__type.o1",
1061
+ expected: "NxtError",
703
1062
  value: elem
1063
+ }, errorFactory)) || "object" === typeof input.error && null !== input.error && $ao2(input.error, _path + ".error", true && _exceptionable) || $guard(_exceptionable, {
1064
+ path: _path + ".error",
1065
+ expected: "(Array<NxtError> | NxtError | null)",
1066
+ value: input.error
704
1067
  }, errorFactory)) || $guard(_exceptionable, {
705
1068
  path: _path + ".error",
706
- expected: "(Array<__type>.o1 | null)",
1069
+ expected: "(Array<NxtError> | NxtError | null)",
707
1070
  value: input.error
708
- }, errorFactory));
1071
+ }, errorFactory)));
709
1072
  const $ao1 = (input, _path, _exceptionable = true) => (undefined === input.file || "string" === typeof input.file || $guard(_exceptionable, {
710
1073
  path: _path + ".file",
711
1074
  expected: "(string | undefined)",
@@ -723,11 +1086,82 @@ export const assertFileStats = (input, errorFactory) => {
723
1086
  expected: "(number | undefined)",
724
1087
  value: input.end
725
1088
  }, errorFactory));
726
- const $ao2 = (input, _path, _exceptionable = true) => "string" === typeof input.message || $guard(_exceptionable, {
1089
+ const $ao2 = (input, _path, _exceptionable = true) => ("string" === typeof input.message || $guard(_exceptionable, {
727
1090
  path: _path + ".message",
728
1091
  expected: "string",
729
1092
  value: input.message
730
- }, errorFactory);
1093
+ }, errorFactory)) && (undefined === input.type || "string" === typeof input.type || $guard(_exceptionable, {
1094
+ path: _path + ".type",
1095
+ expected: "(string | undefined)",
1096
+ value: input.type
1097
+ }, errorFactory)) && (undefined === input.code || "string" === typeof input.code || $guard(_exceptionable, {
1098
+ path: _path + ".code",
1099
+ expected: "(string | undefined)",
1100
+ value: input.code
1101
+ }, errorFactory)) && (undefined === input.exitCode || "number" === typeof input.exitCode || $guard(_exceptionable, {
1102
+ path: _path + ".exitCode",
1103
+ expected: "(number | undefined)",
1104
+ value: input.exitCode
1105
+ }, errorFactory)) && (undefined === input.signalCode || "number" === typeof input.signalCode || $guard(_exceptionable, {
1106
+ path: _path + ".signalCode",
1107
+ expected: "(number | undefined)",
1108
+ value: input.signalCode
1109
+ }, errorFactory)) && (undefined === input.statusCode || "number" === typeof input.statusCode || $guard(_exceptionable, {
1110
+ path: _path + ".statusCode",
1111
+ expected: "(number | undefined)",
1112
+ value: input.statusCode
1113
+ }, errorFactory)) && (undefined === input.headers || ("object" === typeof input.headers && null !== input.headers && false === Array.isArray(input.headers) || $guard(_exceptionable, {
1114
+ path: _path + ".headers",
1115
+ expected: "(Record<string, string> | undefined)",
1116
+ value: input.headers
1117
+ }, errorFactory)) && $ao3(input.headers, _path + ".headers", true && _exceptionable) || $guard(_exceptionable, {
1118
+ path: _path + ".headers",
1119
+ expected: "(Record<string, string> | undefined)",
1120
+ value: input.headers
1121
+ }, errorFactory)) && (undefined === input.data || ("object" === typeof input.data && null !== input.data && false === Array.isArray(input.data) || $guard(_exceptionable, {
1122
+ path: _path + ".data",
1123
+ expected: "(object | undefined)",
1124
+ value: input.data
1125
+ }, errorFactory)) && $ao4(input.data, _path + ".data", true && _exceptionable) || $guard(_exceptionable, {
1126
+ path: _path + ".data",
1127
+ expected: "(object | undefined)",
1128
+ value: input.data
1129
+ }, errorFactory)) && (null === input.cause || undefined === input.cause || ("object" === typeof input.cause && null !== input.cause || $guard(_exceptionable, {
1130
+ path: _path + ".cause",
1131
+ expected: "(NxtError | null | undefined)",
1132
+ value: input.cause
1133
+ }, errorFactory)) && $ao2(input.cause, _path + ".cause", true && _exceptionable) || $guard(_exceptionable, {
1134
+ path: _path + ".cause",
1135
+ expected: "(NxtError | null | undefined)",
1136
+ value: input.cause
1137
+ }, errorFactory)) && (null === input.errors || undefined === input.errors || (Array.isArray(input.errors) || $guard(_exceptionable, {
1138
+ path: _path + ".errors",
1139
+ expected: "(Array<NxtError> | null | undefined)",
1140
+ value: input.errors
1141
+ }, errorFactory)) && input.errors.every((elem, _index6) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
1142
+ path: _path + ".errors[" + _index6 + "]",
1143
+ expected: "NxtError",
1144
+ value: elem
1145
+ }, errorFactory)) && $ao2(elem, _path + ".errors[" + _index6 + "]", true && _exceptionable) || $guard(_exceptionable, {
1146
+ path: _path + ".errors[" + _index6 + "]",
1147
+ expected: "NxtError",
1148
+ value: elem
1149
+ }, errorFactory)) || $guard(_exceptionable, {
1150
+ path: _path + ".errors",
1151
+ expected: "(Array<NxtError> | null | undefined)",
1152
+ value: input.errors
1153
+ }, errorFactory));
1154
+ const $ao3 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
1155
+ const value = input[key];
1156
+ if (undefined === value)
1157
+ return true;
1158
+ return "string" === typeof value || $guard(_exceptionable, {
1159
+ path: _path + $join(key),
1160
+ expected: "string",
1161
+ value: value
1162
+ }, errorFactory);
1163
+ });
1164
+ const $ao4 = (input, _path, _exceptionable = true) => true;
731
1165
  return ("object" === typeof input && null !== input || $guard(true, {
732
1166
  path: _path + "",
733
1167
  expected: "FileStats",
@@ -769,18 +1203,21 @@ export const randomFileStats = generator => {
769
1203
  value: "^[0-9A-Za-z~][0-9A-Za-z~._: -]*$"
770
1204
  }
771
1205
  ]) ?? (generator?.pattern ?? $generator.pattern)(/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/),
772
- size: (generator?.customs ?? $generator.customs)?.number?.([
773
- {
774
- name: "Minimum<0>",
775
- kind: "minimum",
776
- value: 0
777
- },
778
- {
779
- name: "Type<\"uint64\">",
780
- kind: "type",
781
- value: "uint64"
782
- }
783
- ]) ?? (generator?.integer ?? $generator.integer)(0, 10),
1206
+ size: $pick([
1207
+ () => null,
1208
+ () => (generator?.customs ?? $generator.customs)?.number?.([
1209
+ {
1210
+ name: "Minimum<0>",
1211
+ kind: "minimum",
1212
+ value: 0
1213
+ },
1214
+ {
1215
+ name: "Type<\"uint64\">",
1216
+ kind: "type",
1217
+ value: "uint64"
1218
+ }
1219
+ ]) ?? (generator?.integer ?? $generator.integer)(0, 10)
1220
+ ])(),
784
1221
  seekable: (generator?.boolean ?? $generator.boolean)(),
785
1222
  deleted: (generator?.boolean ?? $generator.boolean)(),
786
1223
  refs: (generator?.array ?? $generator.array)(() => $ro1(_recursive, _recursive ? 1 + _depth : _depth)),
@@ -809,7 +1246,8 @@ export const randomFileStats = generator => {
809
1246
  completed: (generator?.boolean ?? $generator.boolean)(),
810
1247
  error: $pick([
811
1248
  () => null,
812
- () => (generator?.array ?? $generator.array)(() => $ro2(_recursive, _recursive ? 1 + _depth : _depth))
1249
+ () => (generator?.array ?? $generator.array)(() => $ro2(_recursive, _recursive ? 1 + _depth : _depth)),
1250
+ () => $ro2(_recursive, _recursive ? 1 + _depth : _depth)
813
1251
  ])()
814
1252
  });
815
1253
  const $ro1 = (_recursive = false, _depth = 0) => ({
@@ -830,21 +1268,73 @@ export const randomFileStats = generator => {
830
1268
  () => (generator?.customs ?? $generator.customs)?.number?.([]) ?? (generator?.number ?? $generator.number)(0, 100)
831
1269
  ])()
832
1270
  });
833
- const $ro2 = (_recursive = false, _depth = 0) => ({
834
- message: (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()
1271
+ const $ro2 = (_recursive = true, _depth = 0) => ({
1272
+ message: (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)(),
1273
+ type: $pick([
1274
+ () => undefined,
1275
+ () => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()
1276
+ ])(),
1277
+ code: $pick([
1278
+ () => undefined,
1279
+ () => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()
1280
+ ])(),
1281
+ exitCode: $pick([
1282
+ () => undefined,
1283
+ () => (generator?.customs ?? $generator.customs)?.number?.([]) ?? (generator?.number ?? $generator.number)(0, 100)
1284
+ ])(),
1285
+ signalCode: $pick([
1286
+ () => undefined,
1287
+ () => (generator?.customs ?? $generator.customs)?.number?.([]) ?? (generator?.number ?? $generator.number)(0, 100)
1288
+ ])(),
1289
+ statusCode: $pick([
1290
+ () => undefined,
1291
+ () => (generator?.customs ?? $generator.customs)?.number?.([]) ?? (generator?.number ?? $generator.number)(0, 100)
1292
+ ])(),
1293
+ headers: $pick([
1294
+ () => undefined,
1295
+ () => $ro3(true, _recursive ? 1 + _depth : _depth)
1296
+ ])(),
1297
+ data: $pick([
1298
+ () => undefined,
1299
+ () => $ro4(true, _recursive ? 1 + _depth : _depth)
1300
+ ])(),
1301
+ cause: $pick([
1302
+ () => undefined,
1303
+ () => null,
1304
+ () => $ro2(true, _recursive ? 1 + _depth : _depth)
1305
+ ])(),
1306
+ errors: $pick([
1307
+ () => undefined,
1308
+ () => null,
1309
+ () => _recursive && 5 < _depth ? [] : 5 >= _depth ? (generator?.array ?? $generator.array)(() => $ro2(true, _recursive ? 1 + _depth : _depth)) : []
1310
+ ])()
835
1311
  });
1312
+ const $ro3 = (_recursive = false, _depth = 0) => {
1313
+ const output = {};
1314
+ (generator?.array ?? $generator.array)(() => output[(generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()] = (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)(), (generator?.integer ?? $generator.integer)(0, 3));
1315
+ return output;
1316
+ };
1317
+ const $ro4 = (_recursive = false, _depth = 0) => {};
836
1318
  return $ro0();
837
1319
  };
838
1320
  export const assertGuardFileStats = (input, errorFactory) => {
839
1321
  const __is = input => {
840
- const $io0 = input => (null === input.position || "number" === typeof input.position && (0 <= input.position && (Math.floor(input.position) === input.position && 0 <= input.position && input.position <= 18446744073709552000))) && "boolean" === typeof input.uploading && (Array.isArray(input.zones) && input.zones.every(elem => "string" === typeof elem)) && (Array.isArray(input.replicas) && input.replicas.every(elem => "string" === typeof elem)) && ("string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id)) && ("number" === typeof input.size && (0 <= input.size && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 18446744073709552000))) && "boolean" === typeof input.seekable && "boolean" === typeof input.deleted && (Array.isArray(input.refs) && input.refs.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $io1(elem))) && (Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem)) && "string" === typeof input.resumable && "string" === typeof input.mimeType && ("string" === typeof input.hash && /^([A-Fa-f0-9]{32})?$/.test(input.hash)) && ("number" === typeof input.btime && (0 <= input.btime && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 18446744073709552000))) && "boolean" === typeof input.completed && (null === input.error || Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io2(elem)));
1322
+ const $io0 = input => (null === input.position || "number" === typeof input.position && (0 <= input.position && (Math.floor(input.position) === input.position && 0 <= input.position && input.position <= 18446744073709552000))) && "boolean" === typeof input.uploading && (Array.isArray(input.zones) && input.zones.every(elem => "string" === typeof elem)) && (Array.isArray(input.replicas) && input.replicas.every(elem => "string" === typeof elem)) && ("string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id)) && (null === input.size || "number" === typeof input.size && (0 <= input.size && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 18446744073709552000))) && "boolean" === typeof input.seekable && "boolean" === typeof input.deleted && (Array.isArray(input.refs) && input.refs.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $io1(elem))) && (Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem)) && "string" === typeof input.resumable && "string" === typeof input.mimeType && ("string" === typeof input.hash && /^([A-Fa-f0-9]{32})?$/.test(input.hash)) && ("number" === typeof input.btime && (0 <= input.btime && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 18446744073709552000))) && "boolean" === typeof input.completed && (undefined !== input.error && (null === input.error || (Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io2(elem)) || "object" === typeof input.error && null !== input.error && $io2(input.error))));
841
1323
  const $io1 = input => (undefined === input.file || "string" === typeof input.file) && (undefined === input.offset || "number" === typeof input.offset) && (undefined === input.start || "number" === typeof input.start) && (undefined === input.end || "number" === typeof input.end);
842
- const $io2 = input => "string" === typeof input.message;
1324
+ const $io2 = input => "string" === typeof input.message && (undefined === input.type || "string" === typeof input.type) && (undefined === input.code || "string" === typeof input.code) && (undefined === input.exitCode || "number" === typeof input.exitCode) && (undefined === input.signalCode || "number" === typeof input.signalCode) && (undefined === input.statusCode || "number" === typeof input.statusCode) && (undefined === input.headers || "object" === typeof input.headers && null !== input.headers && false === Array.isArray(input.headers) && $io3(input.headers)) && (undefined === input.data || "object" === typeof input.data && null !== input.data && false === Array.isArray(input.data) && $io4(input.data)) && (null === input.cause || undefined === input.cause || "object" === typeof input.cause && null !== input.cause && $io2(input.cause)) && (null === input.errors || undefined === input.errors || Array.isArray(input.errors) && input.errors.every(elem => "object" === typeof elem && null !== elem && $io2(elem)));
1325
+ const $io3 = input => Object.keys(input).every(key => {
1326
+ const value = input[key];
1327
+ if (undefined === value)
1328
+ return true;
1329
+ return "string" === typeof value;
1330
+ });
1331
+ const $io4 = input => true;
843
1332
  return "object" === typeof input && null !== input && $io0(input);
844
1333
  };
845
1334
  if (false === __is(input))
846
1335
  ((input, _path, _exceptionable = true) => {
847
1336
  const $guard = __typia.createAssertGuard.guard;
1337
+ const $join = __typia.createAssertGuard.join;
848
1338
  const $ao0 = (input, _path, _exceptionable = true) => (null === input.position || "number" === typeof input.position && (0 <= input.position || $guard(_exceptionable, {
849
1339
  path: _path + ".position",
850
1340
  expected: "number & Minimum<0>",
@@ -893,7 +1383,7 @@ export const assertGuardFileStats = (input, errorFactory) => {
893
1383
  path: _path + ".id",
894
1384
  expected: "(string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">)",
895
1385
  value: input.id
896
- }, errorFactory)) && ("number" === typeof input.size && (0 <= input.size || $guard(_exceptionable, {
1386
+ }, errorFactory)) && (null === input.size || "number" === typeof input.size && (0 <= input.size || $guard(_exceptionable, {
897
1387
  path: _path + ".size",
898
1388
  expected: "number & Minimum<0>",
899
1389
  value: input.size
@@ -903,7 +1393,7 @@ export const assertGuardFileStats = (input, errorFactory) => {
903
1393
  value: input.size
904
1394
  }, errorFactory)) || $guard(_exceptionable, {
905
1395
  path: _path + ".size",
906
- expected: "(number & Minimum<0> & Type<\"uint64\">)",
1396
+ expected: "((number & Minimum<0> & Type<\"uint64\">) | null)",
907
1397
  value: input.size
908
1398
  }, errorFactory)) && ("boolean" === typeof input.seekable || $guard(_exceptionable, {
909
1399
  path: _path + ".seekable",
@@ -973,23 +1463,27 @@ export const assertGuardFileStats = (input, errorFactory) => {
973
1463
  path: _path + ".completed",
974
1464
  expected: "boolean",
975
1465
  value: input.completed
976
- }, errorFactory)) && (null === input.error || (Array.isArray(input.error) || $guard(_exceptionable, {
1466
+ }, errorFactory)) && ((undefined !== input.error || $guard(_exceptionable, {
977
1467
  path: _path + ".error",
978
- expected: "(Array<__type>.o1 | null)",
1468
+ expected: "(Array<NxtError> | NxtError | null)",
979
1469
  value: input.error
980
- }, errorFactory)) && input.error.every((elem, _index5) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
1470
+ }, errorFactory)) && (null === input.error || (Array.isArray(input.error) && input.error.every((elem, _index5) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
981
1471
  path: _path + ".error[" + _index5 + "]",
982
- expected: "__type.o1",
1472
+ expected: "NxtError",
983
1473
  value: elem
984
1474
  }, errorFactory)) && $ao2(elem, _path + ".error[" + _index5 + "]", true && _exceptionable) || $guard(_exceptionable, {
985
1475
  path: _path + ".error[" + _index5 + "]",
986
- expected: "__type.o1",
1476
+ expected: "NxtError",
987
1477
  value: elem
1478
+ }, errorFactory)) || "object" === typeof input.error && null !== input.error && $ao2(input.error, _path + ".error", true && _exceptionable) || $guard(_exceptionable, {
1479
+ path: _path + ".error",
1480
+ expected: "(Array<NxtError> | NxtError | null)",
1481
+ value: input.error
988
1482
  }, errorFactory)) || $guard(_exceptionable, {
989
1483
  path: _path + ".error",
990
- expected: "(Array<__type>.o1 | null)",
1484
+ expected: "(Array<NxtError> | NxtError | null)",
991
1485
  value: input.error
992
- }, errorFactory));
1486
+ }, errorFactory)));
993
1487
  const $ao1 = (input, _path, _exceptionable = true) => (undefined === input.file || "string" === typeof input.file || $guard(_exceptionable, {
994
1488
  path: _path + ".file",
995
1489
  expected: "(string | undefined)",
@@ -1007,11 +1501,82 @@ export const assertGuardFileStats = (input, errorFactory) => {
1007
1501
  expected: "(number | undefined)",
1008
1502
  value: input.end
1009
1503
  }, errorFactory));
1010
- const $ao2 = (input, _path, _exceptionable = true) => "string" === typeof input.message || $guard(_exceptionable, {
1504
+ const $ao2 = (input, _path, _exceptionable = true) => ("string" === typeof input.message || $guard(_exceptionable, {
1011
1505
  path: _path + ".message",
1012
1506
  expected: "string",
1013
1507
  value: input.message
1014
- }, errorFactory);
1508
+ }, errorFactory)) && (undefined === input.type || "string" === typeof input.type || $guard(_exceptionable, {
1509
+ path: _path + ".type",
1510
+ expected: "(string | undefined)",
1511
+ value: input.type
1512
+ }, errorFactory)) && (undefined === input.code || "string" === typeof input.code || $guard(_exceptionable, {
1513
+ path: _path + ".code",
1514
+ expected: "(string | undefined)",
1515
+ value: input.code
1516
+ }, errorFactory)) && (undefined === input.exitCode || "number" === typeof input.exitCode || $guard(_exceptionable, {
1517
+ path: _path + ".exitCode",
1518
+ expected: "(number | undefined)",
1519
+ value: input.exitCode
1520
+ }, errorFactory)) && (undefined === input.signalCode || "number" === typeof input.signalCode || $guard(_exceptionable, {
1521
+ path: _path + ".signalCode",
1522
+ expected: "(number | undefined)",
1523
+ value: input.signalCode
1524
+ }, errorFactory)) && (undefined === input.statusCode || "number" === typeof input.statusCode || $guard(_exceptionable, {
1525
+ path: _path + ".statusCode",
1526
+ expected: "(number | undefined)",
1527
+ value: input.statusCode
1528
+ }, errorFactory)) && (undefined === input.headers || ("object" === typeof input.headers && null !== input.headers && false === Array.isArray(input.headers) || $guard(_exceptionable, {
1529
+ path: _path + ".headers",
1530
+ expected: "(Record<string, string> | undefined)",
1531
+ value: input.headers
1532
+ }, errorFactory)) && $ao3(input.headers, _path + ".headers", true && _exceptionable) || $guard(_exceptionable, {
1533
+ path: _path + ".headers",
1534
+ expected: "(Record<string, string> | undefined)",
1535
+ value: input.headers
1536
+ }, errorFactory)) && (undefined === input.data || ("object" === typeof input.data && null !== input.data && false === Array.isArray(input.data) || $guard(_exceptionable, {
1537
+ path: _path + ".data",
1538
+ expected: "(object | undefined)",
1539
+ value: input.data
1540
+ }, errorFactory)) && $ao4(input.data, _path + ".data", true && _exceptionable) || $guard(_exceptionable, {
1541
+ path: _path + ".data",
1542
+ expected: "(object | undefined)",
1543
+ value: input.data
1544
+ }, errorFactory)) && (null === input.cause || undefined === input.cause || ("object" === typeof input.cause && null !== input.cause || $guard(_exceptionable, {
1545
+ path: _path + ".cause",
1546
+ expected: "(NxtError | null | undefined)",
1547
+ value: input.cause
1548
+ }, errorFactory)) && $ao2(input.cause, _path + ".cause", true && _exceptionable) || $guard(_exceptionable, {
1549
+ path: _path + ".cause",
1550
+ expected: "(NxtError | null | undefined)",
1551
+ value: input.cause
1552
+ }, errorFactory)) && (null === input.errors || undefined === input.errors || (Array.isArray(input.errors) || $guard(_exceptionable, {
1553
+ path: _path + ".errors",
1554
+ expected: "(Array<NxtError> | null | undefined)",
1555
+ value: input.errors
1556
+ }, errorFactory)) && input.errors.every((elem, _index6) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
1557
+ path: _path + ".errors[" + _index6 + "]",
1558
+ expected: "NxtError",
1559
+ value: elem
1560
+ }, errorFactory)) && $ao2(elem, _path + ".errors[" + _index6 + "]", true && _exceptionable) || $guard(_exceptionable, {
1561
+ path: _path + ".errors[" + _index6 + "]",
1562
+ expected: "NxtError",
1563
+ value: elem
1564
+ }, errorFactory)) || $guard(_exceptionable, {
1565
+ path: _path + ".errors",
1566
+ expected: "(Array<NxtError> | null | undefined)",
1567
+ value: input.errors
1568
+ }, errorFactory));
1569
+ const $ao3 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
1570
+ const value = input[key];
1571
+ if (undefined === value)
1572
+ return true;
1573
+ return "string" === typeof value || $guard(_exceptionable, {
1574
+ path: _path + $join(key),
1575
+ expected: "string",
1576
+ value: value
1577
+ }, errorFactory);
1578
+ });
1579
+ const $ao4 = (input, _path, _exceptionable = true) => true;
1015
1580
  return ("object" === typeof input && null !== input || $guard(true, {
1016
1581
  path: _path + "",
1017
1582
  expected: "FileStats",
@@ -1025,23 +1590,51 @@ export const assertGuardFileStats = (input, errorFactory) => {
1025
1590
  };
1026
1591
  export const stringifyFileStats = input => {
1027
1592
  const $io1 = input => (undefined === input.file || "string" === typeof input.file) && (undefined === input.offset || "number" === typeof input.offset) && (undefined === input.start || "number" === typeof input.start) && (undefined === input.end || "number" === typeof input.end);
1028
- const $io2 = input => "string" === typeof input.message;
1593
+ const $io2 = input => "string" === typeof input.message && (undefined === input.type || "string" === typeof input.type) && (undefined === input.code || "string" === typeof input.code) && (undefined === input.exitCode || "number" === typeof input.exitCode) && (undefined === input.signalCode || "number" === typeof input.signalCode) && (undefined === input.statusCode || "number" === typeof input.statusCode) && (undefined === input.headers || "object" === typeof input.headers && null !== input.headers && false === Array.isArray(input.headers) && $io3(input.headers)) && (undefined === input.data || "object" === typeof input.data && null !== input.data && false === Array.isArray(input.data) && $io4(input.data)) && (null === input.cause || undefined === input.cause || "object" === typeof input.cause && null !== input.cause && $io2(input.cause)) && (null === input.errors || undefined === input.errors || Array.isArray(input.errors) && input.errors.every(elem => "object" === typeof elem && null !== elem && $io2(elem)));
1594
+ const $io3 = input => Object.keys(input).every(key => {
1595
+ const value = input[key];
1596
+ if (undefined === value)
1597
+ return true;
1598
+ return "string" === typeof value;
1599
+ });
1600
+ const $io4 = input => true;
1029
1601
  const $string = __typia.json.createStringify.string;
1602
+ const $throws = __typia.json.createStringify.throws;
1030
1603
  const $tail = __typia.json.createStringify.tail;
1031
- const $so0 = input => `{"position":${null !== input.position ? input.position : "null"},"uploading":${input.uploading},"zones":${`[${input.zones.map(elem => $string(elem)).join(",")}]`},"replicas":${`[${input.replicas.map(elem => $string(elem)).join(",")}]`},"id":${$string(input.id)},"size":${input.size},"seekable":${input.seekable},"deleted":${input.deleted},"refs":${`[${input.refs.map(elem => $so1(elem)).join(",")}]`},"tags":${`[${input.tags.map(elem => $string(elem)).join(",")}]`},"resumable":${$string(input.resumable)},"mimeType":${$string(input.mimeType)},"hash":${$string(input.hash)},"btime":${input.btime},"completed":${input.completed},"error":${null !== input.error ? `[${input.error.map(elem => `{"message":${$string(elem.message)}}`).join(",")}]` : "null"}}`;
1604
+ const $so0 = input => `{"position":${null !== input.position ? input.position : "null"},"uploading":${input.uploading},"zones":${`[${input.zones.map(elem => $string(elem)).join(",")}]`},"replicas":${`[${input.replicas.map(elem => $string(elem)).join(",")}]`},"id":${$string(input.id)},"size":${null !== input.size ? input.size : "null"},"seekable":${input.seekable},"deleted":${input.deleted},"refs":${`[${input.refs.map(elem => $so1(elem)).join(",")}]`},"tags":${`[${input.tags.map(elem => $string(elem)).join(",")}]`},"resumable":${$string(input.resumable)},"mimeType":${$string(input.mimeType)},"hash":${$string(input.hash)},"btime":${input.btime},"completed":${input.completed},"error":${null !== input.error ? (() => {
1605
+ if (Array.isArray(input.error))
1606
+ return `[${input.error.map(elem => $so2(elem)).join(",")}]`;
1607
+ if ("object" === typeof input.error && null !== input.error)
1608
+ return $so2(input.error);
1609
+ $throws({
1610
+ expected: "(Array<NxtError> | NxtError | null)",
1611
+ value: input.error
1612
+ });
1613
+ })() : "null"}}`;
1032
1614
  const $so1 = input => `{${$tail(`${undefined === input.file ? "" : `"file":${undefined !== input.file ? $string(input.file) : undefined},`}${undefined === input.offset ? "" : `"offset":${undefined !== input.offset ? input.offset : undefined},`}${undefined === input.start ? "" : `"start":${undefined !== input.start ? input.start : undefined},`}${undefined === input.end ? "" : `"end":${undefined !== input.end ? input.end : undefined}`}`)}}`;
1615
+ const $so2 = input => `{${undefined === input.type ? "" : `"type":${undefined !== input.type ? $string(input.type) : undefined},`}${undefined === input.code ? "" : `"code":${undefined !== input.code ? $string(input.code) : undefined},`}${undefined === input.exitCode ? "" : `"exitCode":${undefined !== input.exitCode ? input.exitCode : undefined},`}${undefined === input.signalCode ? "" : `"signalCode":${undefined !== input.signalCode ? input.signalCode : undefined},`}${undefined === input.statusCode ? "" : `"statusCode":${undefined !== input.statusCode ? input.statusCode : undefined},`}${undefined === input.headers ? "" : `"headers":${undefined !== input.headers ? $so3(input.headers) : undefined},`}${undefined === input.data ? "" : `"data":${undefined !== input.data ? "{}" : undefined},`}${undefined === input.cause ? "" : `"cause":${undefined !== input.cause ? null !== input.cause ? $so2(input.cause) : "null" : undefined},`}${undefined === input.errors ? "" : `"errors":${undefined !== input.errors ? null !== input.errors ? `[${input.errors.map(elem => $so2(elem)).join(",")}]` : "null" : undefined},`}"message":${$string(input.message)}}`;
1616
+ const $so3 = input => `{${Object.entries(input).map(([key, value]) => { if (undefined === value)
1617
+ return ""; return `${JSON.stringify(key)}:${$string(value)}`; }).filter(str => "" !== str).join(",")}}`;
1033
1618
  return $so0(input);
1034
1619
  };
1035
1620
  export const assertStringifyFileStats = (input, errorFactory) => { const assert = (input, errorFactory) => {
1036
1621
  const __is = input => {
1037
- const $io0 = input => (null === input.position || "number" === typeof input.position && (0 <= input.position && (Math.floor(input.position) === input.position && 0 <= input.position && input.position <= 18446744073709552000))) && "boolean" === typeof input.uploading && (Array.isArray(input.zones) && input.zones.every(elem => "string" === typeof elem)) && (Array.isArray(input.replicas) && input.replicas.every(elem => "string" === typeof elem)) && ("string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id)) && ("number" === typeof input.size && (0 <= input.size && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 18446744073709552000))) && "boolean" === typeof input.seekable && "boolean" === typeof input.deleted && (Array.isArray(input.refs) && input.refs.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $io1(elem))) && (Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem)) && "string" === typeof input.resumable && "string" === typeof input.mimeType && ("string" === typeof input.hash && /^([A-Fa-f0-9]{32})?$/.test(input.hash)) && ("number" === typeof input.btime && (0 <= input.btime && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 18446744073709552000))) && "boolean" === typeof input.completed && (null === input.error || Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io2(elem)));
1622
+ const $io0 = input => (null === input.position || "number" === typeof input.position && (0 <= input.position && (Math.floor(input.position) === input.position && 0 <= input.position && input.position <= 18446744073709552000))) && "boolean" === typeof input.uploading && (Array.isArray(input.zones) && input.zones.every(elem => "string" === typeof elem)) && (Array.isArray(input.replicas) && input.replicas.every(elem => "string" === typeof elem)) && ("string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id)) && (null === input.size || "number" === typeof input.size && (0 <= input.size && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 18446744073709552000))) && "boolean" === typeof input.seekable && "boolean" === typeof input.deleted && (Array.isArray(input.refs) && input.refs.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $io1(elem))) && (Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem)) && "string" === typeof input.resumable && "string" === typeof input.mimeType && ("string" === typeof input.hash && /^([A-Fa-f0-9]{32})?$/.test(input.hash)) && ("number" === typeof input.btime && (0 <= input.btime && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 18446744073709552000))) && "boolean" === typeof input.completed && (undefined !== input.error && (null === input.error || (Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io2(elem)) || "object" === typeof input.error && null !== input.error && $io2(input.error))));
1038
1623
  const $io1 = input => (undefined === input.file || "string" === typeof input.file) && (undefined === input.offset || "number" === typeof input.offset && !Number.isNaN(input.offset)) && (undefined === input.start || "number" === typeof input.start && !Number.isNaN(input.start)) && (undefined === input.end || "number" === typeof input.end && !Number.isNaN(input.end));
1039
- const $io2 = input => "string" === typeof input.message;
1624
+ const $io2 = input => "string" === typeof input.message && (undefined === input.type || "string" === typeof input.type) && (undefined === input.code || "string" === typeof input.code) && (undefined === input.exitCode || "number" === typeof input.exitCode && !Number.isNaN(input.exitCode)) && (undefined === input.signalCode || "number" === typeof input.signalCode && !Number.isNaN(input.signalCode)) && (undefined === input.statusCode || "number" === typeof input.statusCode && !Number.isNaN(input.statusCode)) && (undefined === input.headers || "object" === typeof input.headers && null !== input.headers && false === Array.isArray(input.headers) && $io3(input.headers)) && (undefined === input.data || "object" === typeof input.data && null !== input.data && false === Array.isArray(input.data) && $io4(input.data)) && (null === input.cause || undefined === input.cause || "object" === typeof input.cause && null !== input.cause && $io2(input.cause)) && (null === input.errors || undefined === input.errors || Array.isArray(input.errors) && input.errors.every(elem => "object" === typeof elem && null !== elem && $io2(elem)));
1625
+ const $io3 = input => Object.keys(input).every(key => {
1626
+ const value = input[key];
1627
+ if (undefined === value)
1628
+ return true;
1629
+ return "string" === typeof value;
1630
+ });
1631
+ const $io4 = input => true;
1040
1632
  return "object" === typeof input && null !== input && $io0(input);
1041
1633
  };
1042
1634
  if (false === __is(input))
1043
1635
  ((input, _path, _exceptionable = true) => {
1044
1636
  const $guard = __typia.json.createAssertStringify.guard;
1637
+ const $join = __typia.json.createAssertStringify.join;
1045
1638
  const $ao0 = (input, _path, _exceptionable = true) => (null === input.position || "number" === typeof input.position && (0 <= input.position || $guard(_exceptionable, {
1046
1639
  path: _path + ".position",
1047
1640
  expected: "number & Minimum<0>",
@@ -1090,7 +1683,7 @@ export const assertStringifyFileStats = (input, errorFactory) => { const assert
1090
1683
  path: _path + ".id",
1091
1684
  expected: "(string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">)",
1092
1685
  value: input.id
1093
- }, errorFactory)) && ("number" === typeof input.size && (0 <= input.size || $guard(_exceptionable, {
1686
+ }, errorFactory)) && (null === input.size || "number" === typeof input.size && (0 <= input.size || $guard(_exceptionable, {
1094
1687
  path: _path + ".size",
1095
1688
  expected: "number & Minimum<0>",
1096
1689
  value: input.size
@@ -1100,7 +1693,7 @@ export const assertStringifyFileStats = (input, errorFactory) => { const assert
1100
1693
  value: input.size
1101
1694
  }, errorFactory)) || $guard(_exceptionable, {
1102
1695
  path: _path + ".size",
1103
- expected: "(number & Minimum<0> & Type<\"uint64\">)",
1696
+ expected: "((number & Minimum<0> & Type<\"uint64\">) | null)",
1104
1697
  value: input.size
1105
1698
  }, errorFactory)) && ("boolean" === typeof input.seekable || $guard(_exceptionable, {
1106
1699
  path: _path + ".seekable",
@@ -1170,23 +1763,27 @@ export const assertStringifyFileStats = (input, errorFactory) => { const assert
1170
1763
  path: _path + ".completed",
1171
1764
  expected: "boolean",
1172
1765
  value: input.completed
1173
- }, errorFactory)) && (null === input.error || (Array.isArray(input.error) || $guard(_exceptionable, {
1766
+ }, errorFactory)) && ((undefined !== input.error || $guard(_exceptionable, {
1174
1767
  path: _path + ".error",
1175
- expected: "(Array<__type>.o1 | null)",
1768
+ expected: "(Array<NxtError> | NxtError | null)",
1176
1769
  value: input.error
1177
- }, errorFactory)) && input.error.every((elem, _index5) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
1770
+ }, errorFactory)) && (null === input.error || (Array.isArray(input.error) && input.error.every((elem, _index5) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
1178
1771
  path: _path + ".error[" + _index5 + "]",
1179
- expected: "__type.o1",
1772
+ expected: "NxtError",
1180
1773
  value: elem
1181
1774
  }, errorFactory)) && $ao2(elem, _path + ".error[" + _index5 + "]", true && _exceptionable) || $guard(_exceptionable, {
1182
1775
  path: _path + ".error[" + _index5 + "]",
1183
- expected: "__type.o1",
1776
+ expected: "NxtError",
1184
1777
  value: elem
1778
+ }, errorFactory)) || "object" === typeof input.error && null !== input.error && $ao2(input.error, _path + ".error", true && _exceptionable) || $guard(_exceptionable, {
1779
+ path: _path + ".error",
1780
+ expected: "(Array<NxtError> | NxtError | null)",
1781
+ value: input.error
1185
1782
  }, errorFactory)) || $guard(_exceptionable, {
1186
1783
  path: _path + ".error",
1187
- expected: "(Array<__type>.o1 | null)",
1784
+ expected: "(Array<NxtError> | NxtError | null)",
1188
1785
  value: input.error
1189
- }, errorFactory));
1786
+ }, errorFactory)));
1190
1787
  const $ao1 = (input, _path, _exceptionable = true) => (undefined === input.file || "string" === typeof input.file || $guard(_exceptionable, {
1191
1788
  path: _path + ".file",
1192
1789
  expected: "(string | undefined)",
@@ -1204,11 +1801,82 @@ export const assertStringifyFileStats = (input, errorFactory) => { const assert
1204
1801
  expected: "(number | undefined)",
1205
1802
  value: input.end
1206
1803
  }, errorFactory));
1207
- const $ao2 = (input, _path, _exceptionable = true) => "string" === typeof input.message || $guard(_exceptionable, {
1804
+ const $ao2 = (input, _path, _exceptionable = true) => ("string" === typeof input.message || $guard(_exceptionable, {
1208
1805
  path: _path + ".message",
1209
1806
  expected: "string",
1210
1807
  value: input.message
1211
- }, errorFactory);
1808
+ }, errorFactory)) && (undefined === input.type || "string" === typeof input.type || $guard(_exceptionable, {
1809
+ path: _path + ".type",
1810
+ expected: "(string | undefined)",
1811
+ value: input.type
1812
+ }, errorFactory)) && (undefined === input.code || "string" === typeof input.code || $guard(_exceptionable, {
1813
+ path: _path + ".code",
1814
+ expected: "(string | undefined)",
1815
+ value: input.code
1816
+ }, errorFactory)) && (undefined === input.exitCode || "number" === typeof input.exitCode && !Number.isNaN(input.exitCode) || $guard(_exceptionable, {
1817
+ path: _path + ".exitCode",
1818
+ expected: "(number | undefined)",
1819
+ value: input.exitCode
1820
+ }, errorFactory)) && (undefined === input.signalCode || "number" === typeof input.signalCode && !Number.isNaN(input.signalCode) || $guard(_exceptionable, {
1821
+ path: _path + ".signalCode",
1822
+ expected: "(number | undefined)",
1823
+ value: input.signalCode
1824
+ }, errorFactory)) && (undefined === input.statusCode || "number" === typeof input.statusCode && !Number.isNaN(input.statusCode) || $guard(_exceptionable, {
1825
+ path: _path + ".statusCode",
1826
+ expected: "(number | undefined)",
1827
+ value: input.statusCode
1828
+ }, errorFactory)) && (undefined === input.headers || ("object" === typeof input.headers && null !== input.headers && false === Array.isArray(input.headers) || $guard(_exceptionable, {
1829
+ path: _path + ".headers",
1830
+ expected: "(Record<string, string> | undefined)",
1831
+ value: input.headers
1832
+ }, errorFactory)) && $ao3(input.headers, _path + ".headers", true && _exceptionable) || $guard(_exceptionable, {
1833
+ path: _path + ".headers",
1834
+ expected: "(Record<string, string> | undefined)",
1835
+ value: input.headers
1836
+ }, errorFactory)) && (undefined === input.data || ("object" === typeof input.data && null !== input.data && false === Array.isArray(input.data) || $guard(_exceptionable, {
1837
+ path: _path + ".data",
1838
+ expected: "(object | undefined)",
1839
+ value: input.data
1840
+ }, errorFactory)) && $ao4(input.data, _path + ".data", true && _exceptionable) || $guard(_exceptionable, {
1841
+ path: _path + ".data",
1842
+ expected: "(object | undefined)",
1843
+ value: input.data
1844
+ }, errorFactory)) && (null === input.cause || undefined === input.cause || ("object" === typeof input.cause && null !== input.cause || $guard(_exceptionable, {
1845
+ path: _path + ".cause",
1846
+ expected: "(NxtError | null | undefined)",
1847
+ value: input.cause
1848
+ }, errorFactory)) && $ao2(input.cause, _path + ".cause", true && _exceptionable) || $guard(_exceptionable, {
1849
+ path: _path + ".cause",
1850
+ expected: "(NxtError | null | undefined)",
1851
+ value: input.cause
1852
+ }, errorFactory)) && (null === input.errors || undefined === input.errors || (Array.isArray(input.errors) || $guard(_exceptionable, {
1853
+ path: _path + ".errors",
1854
+ expected: "(Array<NxtError> | null | undefined)",
1855
+ value: input.errors
1856
+ }, errorFactory)) && input.errors.every((elem, _index6) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
1857
+ path: _path + ".errors[" + _index6 + "]",
1858
+ expected: "NxtError",
1859
+ value: elem
1860
+ }, errorFactory)) && $ao2(elem, _path + ".errors[" + _index6 + "]", true && _exceptionable) || $guard(_exceptionable, {
1861
+ path: _path + ".errors[" + _index6 + "]",
1862
+ expected: "NxtError",
1863
+ value: elem
1864
+ }, errorFactory)) || $guard(_exceptionable, {
1865
+ path: _path + ".errors",
1866
+ expected: "(Array<NxtError> | null | undefined)",
1867
+ value: input.errors
1868
+ }, errorFactory));
1869
+ const $ao3 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
1870
+ const value = input[key];
1871
+ if (undefined === value)
1872
+ return true;
1873
+ return "string" === typeof value || $guard(_exceptionable, {
1874
+ path: _path + $join(key),
1875
+ expected: "string",
1876
+ value: value
1877
+ }, errorFactory);
1878
+ });
1879
+ const $ao4 = (input, _path, _exceptionable = true) => true;
1212
1880
  return ("object" === typeof input && null !== input || $guard(true, {
1213
1881
  path: _path + "",
1214
1882
  expected: "FileStats",
@@ -1222,10 +1890,30 @@ export const assertStringifyFileStats = (input, errorFactory) => { const assert
1222
1890
  return input;
1223
1891
  }; const stringify = input => {
1224
1892
  const $io1 = input => (undefined === input.file || "string" === typeof input.file) && (undefined === input.offset || "number" === typeof input.offset) && (undefined === input.start || "number" === typeof input.start) && (undefined === input.end || "number" === typeof input.end);
1225
- const $io2 = input => "string" === typeof input.message;
1893
+ const $io2 = input => "string" === typeof input.message && (undefined === input.type || "string" === typeof input.type) && (undefined === input.code || "string" === typeof input.code) && (undefined === input.exitCode || "number" === typeof input.exitCode) && (undefined === input.signalCode || "number" === typeof input.signalCode) && (undefined === input.statusCode || "number" === typeof input.statusCode) && (undefined === input.headers || "object" === typeof input.headers && null !== input.headers && false === Array.isArray(input.headers) && $io3(input.headers)) && (undefined === input.data || "object" === typeof input.data && null !== input.data && false === Array.isArray(input.data) && $io4(input.data)) && (null === input.cause || undefined === input.cause || "object" === typeof input.cause && null !== input.cause && $io2(input.cause)) && (null === input.errors || undefined === input.errors || Array.isArray(input.errors) && input.errors.every(elem => "object" === typeof elem && null !== elem && $io2(elem)));
1894
+ const $io3 = input => Object.keys(input).every(key => {
1895
+ const value = input[key];
1896
+ if (undefined === value)
1897
+ return true;
1898
+ return "string" === typeof value;
1899
+ });
1900
+ const $io4 = input => true;
1226
1901
  const $string = __typia.json.createAssertStringify.string;
1902
+ const $throws = __typia.json.createAssertStringify.throws;
1227
1903
  const $tail = __typia.json.createAssertStringify.tail;
1228
- const $so0 = input => `{"position":${null !== input.position ? input.position : "null"},"uploading":${input.uploading},"zones":${`[${input.zones.map(elem => $string(elem)).join(",")}]`},"replicas":${`[${input.replicas.map(elem => $string(elem)).join(",")}]`},"id":${$string(input.id)},"size":${input.size},"seekable":${input.seekable},"deleted":${input.deleted},"refs":${`[${input.refs.map(elem => $so1(elem)).join(",")}]`},"tags":${`[${input.tags.map(elem => $string(elem)).join(",")}]`},"resumable":${$string(input.resumable)},"mimeType":${$string(input.mimeType)},"hash":${$string(input.hash)},"btime":${input.btime},"completed":${input.completed},"error":${null !== input.error ? `[${input.error.map(elem => `{"message":${$string(elem.message)}}`).join(",")}]` : "null"}}`;
1904
+ const $so0 = input => `{"position":${null !== input.position ? input.position : "null"},"uploading":${input.uploading},"zones":${`[${input.zones.map(elem => $string(elem)).join(",")}]`},"replicas":${`[${input.replicas.map(elem => $string(elem)).join(",")}]`},"id":${$string(input.id)},"size":${null !== input.size ? input.size : "null"},"seekable":${input.seekable},"deleted":${input.deleted},"refs":${`[${input.refs.map(elem => $so1(elem)).join(",")}]`},"tags":${`[${input.tags.map(elem => $string(elem)).join(",")}]`},"resumable":${$string(input.resumable)},"mimeType":${$string(input.mimeType)},"hash":${$string(input.hash)},"btime":${input.btime},"completed":${input.completed},"error":${null !== input.error ? (() => {
1905
+ if (Array.isArray(input.error))
1906
+ return `[${input.error.map(elem => $so2(elem)).join(",")}]`;
1907
+ if ("object" === typeof input.error && null !== input.error)
1908
+ return $so2(input.error);
1909
+ $throws({
1910
+ expected: "(Array<NxtError> | NxtError | null)",
1911
+ value: input.error
1912
+ });
1913
+ })() : "null"}}`;
1229
1914
  const $so1 = input => `{${$tail(`${undefined === input.file ? "" : `"file":${undefined !== input.file ? $string(input.file) : undefined},`}${undefined === input.offset ? "" : `"offset":${undefined !== input.offset ? input.offset : undefined},`}${undefined === input.start ? "" : `"start":${undefined !== input.start ? input.start : undefined},`}${undefined === input.end ? "" : `"end":${undefined !== input.end ? input.end : undefined}`}`)}}`;
1915
+ const $so2 = input => `{${undefined === input.type ? "" : `"type":${undefined !== input.type ? $string(input.type) : undefined},`}${undefined === input.code ? "" : `"code":${undefined !== input.code ? $string(input.code) : undefined},`}${undefined === input.exitCode ? "" : `"exitCode":${undefined !== input.exitCode ? input.exitCode : undefined},`}${undefined === input.signalCode ? "" : `"signalCode":${undefined !== input.signalCode ? input.signalCode : undefined},`}${undefined === input.statusCode ? "" : `"statusCode":${undefined !== input.statusCode ? input.statusCode : undefined},`}${undefined === input.headers ? "" : `"headers":${undefined !== input.headers ? $so3(input.headers) : undefined},`}${undefined === input.data ? "" : `"data":${undefined !== input.data ? "{}" : undefined},`}${undefined === input.cause ? "" : `"cause":${undefined !== input.cause ? null !== input.cause ? $so2(input.cause) : "null" : undefined},`}${undefined === input.errors ? "" : `"errors":${undefined !== input.errors ? null !== input.errors ? `[${input.errors.map(elem => $so2(elem)).join(",")}]` : "null" : undefined},`}"message":${$string(input.message)}}`;
1916
+ const $so3 = input => `{${Object.entries(input).map(([key, value]) => { if (undefined === value)
1917
+ return ""; return `${JSON.stringify(key)}:${$string(value)}`; }).filter(str => "" !== str).join(",")}}`;
1230
1918
  return $so0(input);
1231
1919
  }; return stringify(assert(input, errorFactory)); };