@nxtedition/types 23.0.21 → 23.0.23

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.
@@ -1202,3 +1202,1261 @@ export const assertStringifyFileRestrictionsRecord = (input, errorFactory) => {
1202
1202
  return ""; return `${JSON.stringify(key)}:${`{"asset":${$string(value.asset)},"date":${$string(value.date)},"user":${$string(value.user)},"text":${$string(value.text)},"start":${value.start},"end":${value.end}}`}`; }).filter(str => "" !== str).join(",")}}`;
1203
1203
  return $so0(input);
1204
1204
  }; return stringify(assert(input, errorFactory)); };
1205
+ export const isFileDomainStatsRecord = input => {
1206
+ 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)) && (Array.isArray(input.locations) && input.locations.every(elem => "string" === typeof elem)) && ("number" === typeof input.progress && (0 <= input.progress && input.progress <= 1)) && (Array.isArray(input.ranges) && input.ranges.every(elem => Array.isArray(elem) && (elem.length === 2 && ("number" === typeof elem[0] && 0 <= elem[0]) && ("number" === typeof elem[1] && 0 <= elem[1])))) && ("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.encoding && ("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))));
1207
+ 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);
1208
+ 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)));
1209
+ const $io3 = input => Object.keys(input).every(key => {
1210
+ const value = input[key];
1211
+ if (undefined === value)
1212
+ return true;
1213
+ return "string" === typeof value;
1214
+ });
1215
+ const $io4 = input => true;
1216
+ return "object" === typeof input && null !== input && $io0(input);
1217
+ };
1218
+ export const assertFileDomainStatsRecord = (input, errorFactory) => {
1219
+ const __is = input => {
1220
+ 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)) && (Array.isArray(input.locations) && input.locations.every(elem => "string" === typeof elem)) && ("number" === typeof input.progress && (0 <= input.progress && input.progress <= 1)) && (Array.isArray(input.ranges) && input.ranges.every(elem => Array.isArray(elem) && (elem.length === 2 && ("number" === typeof elem[0] && 0 <= elem[0]) && ("number" === typeof elem[1] && 0 <= elem[1])))) && ("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.encoding && ("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))));
1221
+ 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);
1222
+ 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)));
1223
+ const $io3 = input => Object.keys(input).every(key => {
1224
+ const value = input[key];
1225
+ if (undefined === value)
1226
+ return true;
1227
+ return "string" === typeof value;
1228
+ });
1229
+ const $io4 = input => true;
1230
+ return "object" === typeof input && null !== input && $io0(input);
1231
+ };
1232
+ if (false === __is(input))
1233
+ ((input, _path, _exceptionable = true) => {
1234
+ const $guard = __typia.createAssert.guard;
1235
+ const $join = __typia.createAssert.join;
1236
+ const $ao0 = (input, _path, _exceptionable = true) => (null === input.position || "number" === typeof input.position && (0 <= input.position || $guard(_exceptionable, {
1237
+ path: _path + ".position",
1238
+ expected: "number & Minimum<0>",
1239
+ value: input.position
1240
+ }, errorFactory)) && (Math.floor(input.position) === input.position && 0 <= input.position && input.position <= 18446744073709552000 || $guard(_exceptionable, {
1241
+ path: _path + ".position",
1242
+ expected: "number & Type<\"uint64\">",
1243
+ value: input.position
1244
+ }, errorFactory)) || $guard(_exceptionable, {
1245
+ path: _path + ".position",
1246
+ expected: "((number & Minimum<0> & Type<\"uint64\">) | null)",
1247
+ value: input.position
1248
+ }, errorFactory)) && ("boolean" === typeof input.uploading || $guard(_exceptionable, {
1249
+ path: _path + ".uploading",
1250
+ expected: "boolean",
1251
+ value: input.uploading
1252
+ }, errorFactory)) && ((Array.isArray(input.zones) || $guard(_exceptionable, {
1253
+ path: _path + ".zones",
1254
+ expected: "Array<string>",
1255
+ value: input.zones
1256
+ }, errorFactory)) && input.zones.every((elem, _index1) => "string" === typeof elem || $guard(_exceptionable, {
1257
+ path: _path + ".zones[" + _index1 + "]",
1258
+ expected: "string",
1259
+ value: elem
1260
+ }, errorFactory)) || $guard(_exceptionable, {
1261
+ path: _path + ".zones",
1262
+ expected: "Array<string>",
1263
+ value: input.zones
1264
+ }, errorFactory)) && ((Array.isArray(input.replicas) || $guard(_exceptionable, {
1265
+ path: _path + ".replicas",
1266
+ expected: "Array<string>",
1267
+ value: input.replicas
1268
+ }, errorFactory)) && input.replicas.every((elem, _index2) => "string" === typeof elem || $guard(_exceptionable, {
1269
+ path: _path + ".replicas[" + _index2 + "]",
1270
+ expected: "string",
1271
+ value: elem
1272
+ }, errorFactory)) || $guard(_exceptionable, {
1273
+ path: _path + ".replicas",
1274
+ expected: "Array<string>",
1275
+ value: input.replicas
1276
+ }, errorFactory)) && ((Array.isArray(input.locations) || $guard(_exceptionable, {
1277
+ path: _path + ".locations",
1278
+ expected: "Array<string>",
1279
+ value: input.locations
1280
+ }, errorFactory)) && input.locations.every((elem, _index3) => "string" === typeof elem || $guard(_exceptionable, {
1281
+ path: _path + ".locations[" + _index3 + "]",
1282
+ expected: "string",
1283
+ value: elem
1284
+ }, errorFactory)) || $guard(_exceptionable, {
1285
+ path: _path + ".locations",
1286
+ expected: "Array<string>",
1287
+ value: input.locations
1288
+ }, errorFactory)) && ("number" === typeof input.progress && (0 <= input.progress || $guard(_exceptionable, {
1289
+ path: _path + ".progress",
1290
+ expected: "number & Minimum<0>",
1291
+ value: input.progress
1292
+ }, errorFactory)) && (input.progress <= 1 || $guard(_exceptionable, {
1293
+ path: _path + ".progress",
1294
+ expected: "number & Maximum<1>",
1295
+ value: input.progress
1296
+ }, errorFactory)) || $guard(_exceptionable, {
1297
+ path: _path + ".progress",
1298
+ expected: "(number & Minimum<0> & Maximum<1>)",
1299
+ value: input.progress
1300
+ }, errorFactory)) && ((Array.isArray(input.ranges) || $guard(_exceptionable, {
1301
+ path: _path + ".ranges",
1302
+ expected: "Array<[start: number & Minimum<0>, end: number & Minimum<0>]>",
1303
+ value: input.ranges
1304
+ }, errorFactory)) && input.ranges.every((elem, _index4) => (Array.isArray(elem) || $guard(_exceptionable, {
1305
+ path: _path + ".ranges[" + _index4 + "]",
1306
+ expected: "[start: number & Minimum<0>, end: number & Minimum<0>]",
1307
+ value: elem
1308
+ }, errorFactory)) && ((elem.length === 2 || $guard(_exceptionable, {
1309
+ path: _path + ".ranges[" + _index4 + "]",
1310
+ expected: "[(number & Minimum<0>), (number & Minimum<0>)]",
1311
+ value: elem
1312
+ }, errorFactory)) && ("number" === typeof elem[0] && (0 <= elem[0] || $guard(_exceptionable, {
1313
+ path: _path + ".ranges[" + _index4 + "][0]",
1314
+ expected: "number & Minimum<0>",
1315
+ value: elem[0]
1316
+ }, errorFactory)) || $guard(_exceptionable, {
1317
+ path: _path + ".ranges[" + _index4 + "][0]",
1318
+ expected: "(number & Minimum<0>)",
1319
+ value: elem[0]
1320
+ }, errorFactory)) && ("number" === typeof elem[1] && (0 <= elem[1] || $guard(_exceptionable, {
1321
+ path: _path + ".ranges[" + _index4 + "][1]",
1322
+ expected: "number & Minimum<0>",
1323
+ value: elem[1]
1324
+ }, errorFactory)) || $guard(_exceptionable, {
1325
+ path: _path + ".ranges[" + _index4 + "][1]",
1326
+ expected: "(number & Minimum<0>)",
1327
+ value: elem[1]
1328
+ }, errorFactory))) || $guard(_exceptionable, {
1329
+ path: _path + ".ranges[" + _index4 + "]",
1330
+ expected: "[start: number & Minimum<0>, end: number & Minimum<0>]",
1331
+ value: elem
1332
+ }, errorFactory)) || $guard(_exceptionable, {
1333
+ path: _path + ".ranges",
1334
+ expected: "Array<[start: number & Minimum<0>, end: number & Minimum<0>]>",
1335
+ value: input.ranges
1336
+ }, errorFactory)) && ("string" === typeof input.id && (/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) || $guard(_exceptionable, {
1337
+ path: _path + ".id",
1338
+ expected: "string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
1339
+ value: input.id
1340
+ }, errorFactory)) || $guard(_exceptionable, {
1341
+ path: _path + ".id",
1342
+ expected: "(string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">)",
1343
+ value: input.id
1344
+ }, errorFactory)) && (null === input.size || "number" === typeof input.size && (0 <= input.size || $guard(_exceptionable, {
1345
+ path: _path + ".size",
1346
+ expected: "number & Minimum<0>",
1347
+ value: input.size
1348
+ }, errorFactory)) && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 18446744073709552000 || $guard(_exceptionable, {
1349
+ path: _path + ".size",
1350
+ expected: "number & Type<\"uint64\">",
1351
+ value: input.size
1352
+ }, errorFactory)) || $guard(_exceptionable, {
1353
+ path: _path + ".size",
1354
+ expected: "((number & Minimum<0> & Type<\"uint64\">) | null)",
1355
+ value: input.size
1356
+ }, errorFactory)) && ("boolean" === typeof input.seekable || $guard(_exceptionable, {
1357
+ path: _path + ".seekable",
1358
+ expected: "boolean",
1359
+ value: input.seekable
1360
+ }, errorFactory)) && ("boolean" === typeof input.deleted || $guard(_exceptionable, {
1361
+ path: _path + ".deleted",
1362
+ expected: "boolean",
1363
+ value: input.deleted
1364
+ }, errorFactory)) && ((Array.isArray(input.refs) || $guard(_exceptionable, {
1365
+ path: _path + ".refs",
1366
+ expected: "Array<__type>",
1367
+ value: input.refs
1368
+ }, errorFactory)) && input.refs.every((elem, _index5) => ("object" === typeof elem && null !== elem && false === Array.isArray(elem) || $guard(_exceptionable, {
1369
+ path: _path + ".refs[" + _index5 + "]",
1370
+ expected: "__type",
1371
+ value: elem
1372
+ }, errorFactory)) && $ao1(elem, _path + ".refs[" + _index5 + "]", true && _exceptionable) || $guard(_exceptionable, {
1373
+ path: _path + ".refs[" + _index5 + "]",
1374
+ expected: "__type",
1375
+ value: elem
1376
+ }, errorFactory)) || $guard(_exceptionable, {
1377
+ path: _path + ".refs",
1378
+ expected: "Array<__type>",
1379
+ value: input.refs
1380
+ }, errorFactory)) && ((Array.isArray(input.tags) || $guard(_exceptionable, {
1381
+ path: _path + ".tags",
1382
+ expected: "Array<string>",
1383
+ value: input.tags
1384
+ }, errorFactory)) && input.tags.every((elem, _index6) => "string" === typeof elem || $guard(_exceptionable, {
1385
+ path: _path + ".tags[" + _index6 + "]",
1386
+ expected: "string",
1387
+ value: elem
1388
+ }, errorFactory)) || $guard(_exceptionable, {
1389
+ path: _path + ".tags",
1390
+ expected: "Array<string>",
1391
+ value: input.tags
1392
+ }, errorFactory)) && ("string" === typeof input.resumable || $guard(_exceptionable, {
1393
+ path: _path + ".resumable",
1394
+ expected: "string",
1395
+ value: input.resumable
1396
+ }, errorFactory)) && ("string" === typeof input.mimeType || $guard(_exceptionable, {
1397
+ path: _path + ".mimeType",
1398
+ expected: "string",
1399
+ value: input.mimeType
1400
+ }, errorFactory)) && ("string" === typeof input.encoding || $guard(_exceptionable, {
1401
+ path: _path + ".encoding",
1402
+ expected: "string",
1403
+ value: input.encoding
1404
+ }, errorFactory)) && ("string" === typeof input.hash && (/^([A-Fa-f0-9]{32})?$/.test(input.hash) || $guard(_exceptionable, {
1405
+ path: _path + ".hash",
1406
+ expected: "string & Pattern<\"^([A-Fa-f0-9]{32})?$\">",
1407
+ value: input.hash
1408
+ }, errorFactory)) || $guard(_exceptionable, {
1409
+ path: _path + ".hash",
1410
+ expected: "(string & Pattern<\"^([A-Fa-f0-9]{32})?$\">)",
1411
+ value: input.hash
1412
+ }, errorFactory)) && ("number" === typeof input.btime && (0 <= input.btime || $guard(_exceptionable, {
1413
+ path: _path + ".btime",
1414
+ expected: "number & Minimum<0>",
1415
+ value: input.btime
1416
+ }, errorFactory)) && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 18446744073709552000 || $guard(_exceptionable, {
1417
+ path: _path + ".btime",
1418
+ expected: "number & Type<\"uint64\">",
1419
+ value: input.btime
1420
+ }, errorFactory)) || $guard(_exceptionable, {
1421
+ path: _path + ".btime",
1422
+ expected: "(number & Minimum<0> & Type<\"uint64\">)",
1423
+ value: input.btime
1424
+ }, errorFactory)) && ("boolean" === typeof input.completed || $guard(_exceptionable, {
1425
+ path: _path + ".completed",
1426
+ expected: "boolean",
1427
+ value: input.completed
1428
+ }, errorFactory)) && ((undefined !== input.error || $guard(_exceptionable, {
1429
+ path: _path + ".error",
1430
+ expected: "(Array<NxtError> | NxtError | null)",
1431
+ value: input.error
1432
+ }, errorFactory)) && (null === input.error || (Array.isArray(input.error) && input.error.every((elem, _index7) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
1433
+ path: _path + ".error[" + _index7 + "]",
1434
+ expected: "NxtError",
1435
+ value: elem
1436
+ }, errorFactory)) && $ao2(elem, _path + ".error[" + _index7 + "]", true && _exceptionable) || $guard(_exceptionable, {
1437
+ path: _path + ".error[" + _index7 + "]",
1438
+ expected: "NxtError",
1439
+ value: elem
1440
+ }, errorFactory)) || "object" === typeof input.error && null !== input.error && $ao2(input.error, _path + ".error", true && _exceptionable) || $guard(_exceptionable, {
1441
+ path: _path + ".error",
1442
+ expected: "(Array<NxtError> | NxtError | null)",
1443
+ value: input.error
1444
+ }, errorFactory)) || $guard(_exceptionable, {
1445
+ path: _path + ".error",
1446
+ expected: "(Array<NxtError> | NxtError | null)",
1447
+ value: input.error
1448
+ }, errorFactory)));
1449
+ const $ao1 = (input, _path, _exceptionable = true) => (undefined === input.file || "string" === typeof input.file || $guard(_exceptionable, {
1450
+ path: _path + ".file",
1451
+ expected: "(string | undefined)",
1452
+ value: input.file
1453
+ }, errorFactory)) && (undefined === input.offset || "number" === typeof input.offset || $guard(_exceptionable, {
1454
+ path: _path + ".offset",
1455
+ expected: "(number | undefined)",
1456
+ value: input.offset
1457
+ }, errorFactory)) && (undefined === input.start || "number" === typeof input.start || $guard(_exceptionable, {
1458
+ path: _path + ".start",
1459
+ expected: "(number | undefined)",
1460
+ value: input.start
1461
+ }, errorFactory)) && (undefined === input.end || "number" === typeof input.end || $guard(_exceptionable, {
1462
+ path: _path + ".end",
1463
+ expected: "(number | undefined)",
1464
+ value: input.end
1465
+ }, errorFactory));
1466
+ const $ao2 = (input, _path, _exceptionable = true) => ("string" === typeof input.message || $guard(_exceptionable, {
1467
+ path: _path + ".message",
1468
+ expected: "string",
1469
+ value: input.message
1470
+ }, errorFactory)) && (undefined === input.type || "string" === typeof input.type || $guard(_exceptionable, {
1471
+ path: _path + ".type",
1472
+ expected: "(string | undefined)",
1473
+ value: input.type
1474
+ }, errorFactory)) && (undefined === input.code || "string" === typeof input.code || $guard(_exceptionable, {
1475
+ path: _path + ".code",
1476
+ expected: "(string | undefined)",
1477
+ value: input.code
1478
+ }, errorFactory)) && (undefined === input.exitCode || "number" === typeof input.exitCode || $guard(_exceptionable, {
1479
+ path: _path + ".exitCode",
1480
+ expected: "(number | undefined)",
1481
+ value: input.exitCode
1482
+ }, errorFactory)) && (undefined === input.signalCode || "number" === typeof input.signalCode || $guard(_exceptionable, {
1483
+ path: _path + ".signalCode",
1484
+ expected: "(number | undefined)",
1485
+ value: input.signalCode
1486
+ }, errorFactory)) && (undefined === input.statusCode || "number" === typeof input.statusCode || $guard(_exceptionable, {
1487
+ path: _path + ".statusCode",
1488
+ expected: "(number | undefined)",
1489
+ value: input.statusCode
1490
+ }, errorFactory)) && (undefined === input.headers || ("object" === typeof input.headers && null !== input.headers && false === Array.isArray(input.headers) || $guard(_exceptionable, {
1491
+ path: _path + ".headers",
1492
+ expected: "(Record<string, string> | undefined)",
1493
+ value: input.headers
1494
+ }, errorFactory)) && $ao3(input.headers, _path + ".headers", true && _exceptionable) || $guard(_exceptionable, {
1495
+ path: _path + ".headers",
1496
+ expected: "(Record<string, string> | undefined)",
1497
+ value: input.headers
1498
+ }, errorFactory)) && (undefined === input.data || ("object" === typeof input.data && null !== input.data && false === Array.isArray(input.data) || $guard(_exceptionable, {
1499
+ path: _path + ".data",
1500
+ expected: "(object | undefined)",
1501
+ value: input.data
1502
+ }, errorFactory)) && $ao4(input.data, _path + ".data", true && _exceptionable) || $guard(_exceptionable, {
1503
+ path: _path + ".data",
1504
+ expected: "(object | undefined)",
1505
+ value: input.data
1506
+ }, errorFactory)) && (null === input.cause || undefined === input.cause || ("object" === typeof input.cause && null !== input.cause || $guard(_exceptionable, {
1507
+ path: _path + ".cause",
1508
+ expected: "(NxtError | null | undefined)",
1509
+ value: input.cause
1510
+ }, errorFactory)) && $ao2(input.cause, _path + ".cause", true && _exceptionable) || $guard(_exceptionable, {
1511
+ path: _path + ".cause",
1512
+ expected: "(NxtError | null | undefined)",
1513
+ value: input.cause
1514
+ }, errorFactory)) && (null === input.errors || undefined === input.errors || (Array.isArray(input.errors) || $guard(_exceptionable, {
1515
+ path: _path + ".errors",
1516
+ expected: "(Array<NxtError> | null | undefined)",
1517
+ value: input.errors
1518
+ }, errorFactory)) && input.errors.every((elem, _index8) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
1519
+ path: _path + ".errors[" + _index8 + "]",
1520
+ expected: "NxtError",
1521
+ value: elem
1522
+ }, errorFactory)) && $ao2(elem, _path + ".errors[" + _index8 + "]", true && _exceptionable) || $guard(_exceptionable, {
1523
+ path: _path + ".errors[" + _index8 + "]",
1524
+ expected: "NxtError",
1525
+ value: elem
1526
+ }, errorFactory)) || $guard(_exceptionable, {
1527
+ path: _path + ".errors",
1528
+ expected: "(Array<NxtError> | null | undefined)",
1529
+ value: input.errors
1530
+ }, errorFactory));
1531
+ const $ao3 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
1532
+ const value = input[key];
1533
+ if (undefined === value)
1534
+ return true;
1535
+ return "string" === typeof value || $guard(_exceptionable, {
1536
+ path: _path + $join(key),
1537
+ expected: "string",
1538
+ value: value
1539
+ }, errorFactory);
1540
+ });
1541
+ const $ao4 = (input, _path, _exceptionable = true) => true;
1542
+ return ("object" === typeof input && null !== input || $guard(true, {
1543
+ path: _path + "",
1544
+ expected: "FileStats",
1545
+ value: input
1546
+ }, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
1547
+ path: _path + "",
1548
+ expected: "FileStats",
1549
+ value: input
1550
+ }, errorFactory);
1551
+ })(input, "$input", true);
1552
+ return input;
1553
+ };
1554
+ export const randomFileDomainStatsRecord = generator => {
1555
+ const $generator = __typia.createRandom.generator;
1556
+ const $pick = __typia.createRandom.pick;
1557
+ const $ro0 = (_recursive = false, _depth = 0) => ({
1558
+ position: $pick([
1559
+ () => null,
1560
+ () => (generator?.customs ?? $generator.customs)?.number?.([
1561
+ {
1562
+ name: "Minimum<0>",
1563
+ kind: "minimum",
1564
+ value: 0
1565
+ },
1566
+ {
1567
+ name: "Type<\"uint64\">",
1568
+ kind: "type",
1569
+ value: "uint64"
1570
+ }
1571
+ ]) ?? (generator?.integer ?? $generator.integer)(0, 10)
1572
+ ])(),
1573
+ uploading: (generator?.boolean ?? $generator.boolean)(),
1574
+ zones: (generator?.array ?? $generator.array)(() => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()),
1575
+ replicas: (generator?.array ?? $generator.array)(() => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()),
1576
+ locations: (generator?.array ?? $generator.array)(() => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()),
1577
+ progress: (generator?.customs ?? $generator.customs)?.number?.([
1578
+ {
1579
+ name: "Minimum<0>",
1580
+ kind: "minimum",
1581
+ value: 0
1582
+ },
1583
+ {
1584
+ name: "Maximum<1>",
1585
+ kind: "maximum",
1586
+ value: 1
1587
+ }
1588
+ ]) ?? (generator?.number ?? $generator.number)(0, 1),
1589
+ ranges: (generator?.array ?? $generator.array)(() => [
1590
+ (generator?.customs ?? $generator.customs)?.number?.([
1591
+ {
1592
+ name: "Minimum<0>",
1593
+ kind: "minimum",
1594
+ value: 0
1595
+ }
1596
+ ]) ?? (generator?.number ?? $generator.number)(0, 10),
1597
+ (generator?.customs ?? $generator.customs)?.number?.([
1598
+ {
1599
+ name: "Minimum<0>",
1600
+ kind: "minimum",
1601
+ value: 0
1602
+ }
1603
+ ]) ?? (generator?.number ?? $generator.number)(0, 10)
1604
+ ]),
1605
+ id: (generator?.customs ?? $generator.customs)?.string?.([
1606
+ {
1607
+ name: "Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
1608
+ kind: "pattern",
1609
+ value: "^[0-9A-Za-z~][0-9A-Za-z~._: -]*$"
1610
+ }
1611
+ ]) ?? (generator?.pattern ?? $generator.pattern)(/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/),
1612
+ size: $pick([
1613
+ () => null,
1614
+ () => (generator?.customs ?? $generator.customs)?.number?.([
1615
+ {
1616
+ name: "Minimum<0>",
1617
+ kind: "minimum",
1618
+ value: 0
1619
+ },
1620
+ {
1621
+ name: "Type<\"uint64\">",
1622
+ kind: "type",
1623
+ value: "uint64"
1624
+ }
1625
+ ]) ?? (generator?.integer ?? $generator.integer)(0, 10)
1626
+ ])(),
1627
+ seekable: (generator?.boolean ?? $generator.boolean)(),
1628
+ deleted: (generator?.boolean ?? $generator.boolean)(),
1629
+ refs: (generator?.array ?? $generator.array)(() => $ro1(_recursive, _recursive ? 1 + _depth : _depth)),
1630
+ tags: (generator?.array ?? $generator.array)(() => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()),
1631
+ resumable: (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)(),
1632
+ mimeType: (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)(),
1633
+ encoding: (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)(),
1634
+ hash: (generator?.customs ?? $generator.customs)?.string?.([
1635
+ {
1636
+ name: "Pattern<\"^([A-Fa-f0-9]{32})?$\">",
1637
+ kind: "pattern",
1638
+ value: "^([A-Fa-f0-9]{32})?$"
1639
+ }
1640
+ ]) ?? (generator?.pattern ?? $generator.pattern)(/^([A-Fa-f0-9]{32})?$/),
1641
+ btime: (generator?.customs ?? $generator.customs)?.number?.([
1642
+ {
1643
+ name: "Minimum<0>",
1644
+ kind: "minimum",
1645
+ value: 0
1646
+ },
1647
+ {
1648
+ name: "Type<\"uint64\">",
1649
+ kind: "type",
1650
+ value: "uint64"
1651
+ }
1652
+ ]) ?? (generator?.integer ?? $generator.integer)(0, 10),
1653
+ completed: (generator?.boolean ?? $generator.boolean)(),
1654
+ error: $pick([
1655
+ () => null,
1656
+ () => (generator?.array ?? $generator.array)(() => $ro2(_recursive, _recursive ? 1 + _depth : _depth)),
1657
+ () => $ro2(_recursive, _recursive ? 1 + _depth : _depth)
1658
+ ])()
1659
+ });
1660
+ const $ro1 = (_recursive = false, _depth = 0) => ({
1661
+ file: $pick([
1662
+ () => undefined,
1663
+ () => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()
1664
+ ])(),
1665
+ offset: $pick([
1666
+ () => undefined,
1667
+ () => (generator?.customs ?? $generator.customs)?.number?.([]) ?? (generator?.number ?? $generator.number)(0, 100)
1668
+ ])(),
1669
+ start: $pick([
1670
+ () => undefined,
1671
+ () => (generator?.customs ?? $generator.customs)?.number?.([]) ?? (generator?.number ?? $generator.number)(0, 100)
1672
+ ])(),
1673
+ end: $pick([
1674
+ () => undefined,
1675
+ () => (generator?.customs ?? $generator.customs)?.number?.([]) ?? (generator?.number ?? $generator.number)(0, 100)
1676
+ ])()
1677
+ });
1678
+ const $ro2 = (_recursive = true, _depth = 0) => ({
1679
+ message: (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)(),
1680
+ type: $pick([
1681
+ () => undefined,
1682
+ () => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()
1683
+ ])(),
1684
+ code: $pick([
1685
+ () => undefined,
1686
+ () => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()
1687
+ ])(),
1688
+ exitCode: $pick([
1689
+ () => undefined,
1690
+ () => (generator?.customs ?? $generator.customs)?.number?.([]) ?? (generator?.number ?? $generator.number)(0, 100)
1691
+ ])(),
1692
+ signalCode: $pick([
1693
+ () => undefined,
1694
+ () => (generator?.customs ?? $generator.customs)?.number?.([]) ?? (generator?.number ?? $generator.number)(0, 100)
1695
+ ])(),
1696
+ statusCode: $pick([
1697
+ () => undefined,
1698
+ () => (generator?.customs ?? $generator.customs)?.number?.([]) ?? (generator?.number ?? $generator.number)(0, 100)
1699
+ ])(),
1700
+ headers: $pick([
1701
+ () => undefined,
1702
+ () => $ro3(true, _recursive ? 1 + _depth : _depth)
1703
+ ])(),
1704
+ data: $pick([
1705
+ () => undefined,
1706
+ () => $ro4(true, _recursive ? 1 + _depth : _depth)
1707
+ ])(),
1708
+ cause: $pick([
1709
+ () => undefined,
1710
+ () => null,
1711
+ () => $ro2(true, _recursive ? 1 + _depth : _depth)
1712
+ ])(),
1713
+ errors: $pick([
1714
+ () => undefined,
1715
+ () => null,
1716
+ () => _recursive && 5 < _depth ? [] : 5 >= _depth ? (generator?.array ?? $generator.array)(() => $ro2(true, _recursive ? 1 + _depth : _depth)) : []
1717
+ ])()
1718
+ });
1719
+ const $ro3 = (_recursive = false, _depth = 0) => {
1720
+ const output = {};
1721
+ (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));
1722
+ return output;
1723
+ };
1724
+ const $ro4 = (_recursive = false, _depth = 0) => {};
1725
+ return $ro0();
1726
+ };
1727
+ export const assertGuardFileDomainStatsRecord = (input, errorFactory) => {
1728
+ const __is = input => {
1729
+ 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)) && (Array.isArray(input.locations) && input.locations.every(elem => "string" === typeof elem)) && ("number" === typeof input.progress && (0 <= input.progress && input.progress <= 1)) && (Array.isArray(input.ranges) && input.ranges.every(elem => Array.isArray(elem) && (elem.length === 2 && ("number" === typeof elem[0] && 0 <= elem[0]) && ("number" === typeof elem[1] && 0 <= elem[1])))) && ("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.encoding && ("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))));
1730
+ 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);
1731
+ 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)));
1732
+ const $io3 = input => Object.keys(input).every(key => {
1733
+ const value = input[key];
1734
+ if (undefined === value)
1735
+ return true;
1736
+ return "string" === typeof value;
1737
+ });
1738
+ const $io4 = input => true;
1739
+ return "object" === typeof input && null !== input && $io0(input);
1740
+ };
1741
+ if (false === __is(input))
1742
+ ((input, _path, _exceptionable = true) => {
1743
+ const $guard = __typia.createAssertGuard.guard;
1744
+ const $join = __typia.createAssertGuard.join;
1745
+ const $ao0 = (input, _path, _exceptionable = true) => (null === input.position || "number" === typeof input.position && (0 <= input.position || $guard(_exceptionable, {
1746
+ path: _path + ".position",
1747
+ expected: "number & Minimum<0>",
1748
+ value: input.position
1749
+ }, errorFactory)) && (Math.floor(input.position) === input.position && 0 <= input.position && input.position <= 18446744073709552000 || $guard(_exceptionable, {
1750
+ path: _path + ".position",
1751
+ expected: "number & Type<\"uint64\">",
1752
+ value: input.position
1753
+ }, errorFactory)) || $guard(_exceptionable, {
1754
+ path: _path + ".position",
1755
+ expected: "((number & Minimum<0> & Type<\"uint64\">) | null)",
1756
+ value: input.position
1757
+ }, errorFactory)) && ("boolean" === typeof input.uploading || $guard(_exceptionable, {
1758
+ path: _path + ".uploading",
1759
+ expected: "boolean",
1760
+ value: input.uploading
1761
+ }, errorFactory)) && ((Array.isArray(input.zones) || $guard(_exceptionable, {
1762
+ path: _path + ".zones",
1763
+ expected: "Array<string>",
1764
+ value: input.zones
1765
+ }, errorFactory)) && input.zones.every((elem, _index1) => "string" === typeof elem || $guard(_exceptionable, {
1766
+ path: _path + ".zones[" + _index1 + "]",
1767
+ expected: "string",
1768
+ value: elem
1769
+ }, errorFactory)) || $guard(_exceptionable, {
1770
+ path: _path + ".zones",
1771
+ expected: "Array<string>",
1772
+ value: input.zones
1773
+ }, errorFactory)) && ((Array.isArray(input.replicas) || $guard(_exceptionable, {
1774
+ path: _path + ".replicas",
1775
+ expected: "Array<string>",
1776
+ value: input.replicas
1777
+ }, errorFactory)) && input.replicas.every((elem, _index2) => "string" === typeof elem || $guard(_exceptionable, {
1778
+ path: _path + ".replicas[" + _index2 + "]",
1779
+ expected: "string",
1780
+ value: elem
1781
+ }, errorFactory)) || $guard(_exceptionable, {
1782
+ path: _path + ".replicas",
1783
+ expected: "Array<string>",
1784
+ value: input.replicas
1785
+ }, errorFactory)) && ((Array.isArray(input.locations) || $guard(_exceptionable, {
1786
+ path: _path + ".locations",
1787
+ expected: "Array<string>",
1788
+ value: input.locations
1789
+ }, errorFactory)) && input.locations.every((elem, _index3) => "string" === typeof elem || $guard(_exceptionable, {
1790
+ path: _path + ".locations[" + _index3 + "]",
1791
+ expected: "string",
1792
+ value: elem
1793
+ }, errorFactory)) || $guard(_exceptionable, {
1794
+ path: _path + ".locations",
1795
+ expected: "Array<string>",
1796
+ value: input.locations
1797
+ }, errorFactory)) && ("number" === typeof input.progress && (0 <= input.progress || $guard(_exceptionable, {
1798
+ path: _path + ".progress",
1799
+ expected: "number & Minimum<0>",
1800
+ value: input.progress
1801
+ }, errorFactory)) && (input.progress <= 1 || $guard(_exceptionable, {
1802
+ path: _path + ".progress",
1803
+ expected: "number & Maximum<1>",
1804
+ value: input.progress
1805
+ }, errorFactory)) || $guard(_exceptionable, {
1806
+ path: _path + ".progress",
1807
+ expected: "(number & Minimum<0> & Maximum<1>)",
1808
+ value: input.progress
1809
+ }, errorFactory)) && ((Array.isArray(input.ranges) || $guard(_exceptionable, {
1810
+ path: _path + ".ranges",
1811
+ expected: "Array<[start: number & Minimum<0>, end: number & Minimum<0>]>",
1812
+ value: input.ranges
1813
+ }, errorFactory)) && input.ranges.every((elem, _index4) => (Array.isArray(elem) || $guard(_exceptionable, {
1814
+ path: _path + ".ranges[" + _index4 + "]",
1815
+ expected: "[start: number & Minimum<0>, end: number & Minimum<0>]",
1816
+ value: elem
1817
+ }, errorFactory)) && ((elem.length === 2 || $guard(_exceptionable, {
1818
+ path: _path + ".ranges[" + _index4 + "]",
1819
+ expected: "[(number & Minimum<0>), (number & Minimum<0>)]",
1820
+ value: elem
1821
+ }, errorFactory)) && ("number" === typeof elem[0] && (0 <= elem[0] || $guard(_exceptionable, {
1822
+ path: _path + ".ranges[" + _index4 + "][0]",
1823
+ expected: "number & Minimum<0>",
1824
+ value: elem[0]
1825
+ }, errorFactory)) || $guard(_exceptionable, {
1826
+ path: _path + ".ranges[" + _index4 + "][0]",
1827
+ expected: "(number & Minimum<0>)",
1828
+ value: elem[0]
1829
+ }, errorFactory)) && ("number" === typeof elem[1] && (0 <= elem[1] || $guard(_exceptionable, {
1830
+ path: _path + ".ranges[" + _index4 + "][1]",
1831
+ expected: "number & Minimum<0>",
1832
+ value: elem[1]
1833
+ }, errorFactory)) || $guard(_exceptionable, {
1834
+ path: _path + ".ranges[" + _index4 + "][1]",
1835
+ expected: "(number & Minimum<0>)",
1836
+ value: elem[1]
1837
+ }, errorFactory))) || $guard(_exceptionable, {
1838
+ path: _path + ".ranges[" + _index4 + "]",
1839
+ expected: "[start: number & Minimum<0>, end: number & Minimum<0>]",
1840
+ value: elem
1841
+ }, errorFactory)) || $guard(_exceptionable, {
1842
+ path: _path + ".ranges",
1843
+ expected: "Array<[start: number & Minimum<0>, end: number & Minimum<0>]>",
1844
+ value: input.ranges
1845
+ }, errorFactory)) && ("string" === typeof input.id && (/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) || $guard(_exceptionable, {
1846
+ path: _path + ".id",
1847
+ expected: "string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
1848
+ value: input.id
1849
+ }, errorFactory)) || $guard(_exceptionable, {
1850
+ path: _path + ".id",
1851
+ expected: "(string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">)",
1852
+ value: input.id
1853
+ }, errorFactory)) && (null === input.size || "number" === typeof input.size && (0 <= input.size || $guard(_exceptionable, {
1854
+ path: _path + ".size",
1855
+ expected: "number & Minimum<0>",
1856
+ value: input.size
1857
+ }, errorFactory)) && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 18446744073709552000 || $guard(_exceptionable, {
1858
+ path: _path + ".size",
1859
+ expected: "number & Type<\"uint64\">",
1860
+ value: input.size
1861
+ }, errorFactory)) || $guard(_exceptionable, {
1862
+ path: _path + ".size",
1863
+ expected: "((number & Minimum<0> & Type<\"uint64\">) | null)",
1864
+ value: input.size
1865
+ }, errorFactory)) && ("boolean" === typeof input.seekable || $guard(_exceptionable, {
1866
+ path: _path + ".seekable",
1867
+ expected: "boolean",
1868
+ value: input.seekable
1869
+ }, errorFactory)) && ("boolean" === typeof input.deleted || $guard(_exceptionable, {
1870
+ path: _path + ".deleted",
1871
+ expected: "boolean",
1872
+ value: input.deleted
1873
+ }, errorFactory)) && ((Array.isArray(input.refs) || $guard(_exceptionable, {
1874
+ path: _path + ".refs",
1875
+ expected: "Array<__type>",
1876
+ value: input.refs
1877
+ }, errorFactory)) && input.refs.every((elem, _index5) => ("object" === typeof elem && null !== elem && false === Array.isArray(elem) || $guard(_exceptionable, {
1878
+ path: _path + ".refs[" + _index5 + "]",
1879
+ expected: "__type",
1880
+ value: elem
1881
+ }, errorFactory)) && $ao1(elem, _path + ".refs[" + _index5 + "]", true && _exceptionable) || $guard(_exceptionable, {
1882
+ path: _path + ".refs[" + _index5 + "]",
1883
+ expected: "__type",
1884
+ value: elem
1885
+ }, errorFactory)) || $guard(_exceptionable, {
1886
+ path: _path + ".refs",
1887
+ expected: "Array<__type>",
1888
+ value: input.refs
1889
+ }, errorFactory)) && ((Array.isArray(input.tags) || $guard(_exceptionable, {
1890
+ path: _path + ".tags",
1891
+ expected: "Array<string>",
1892
+ value: input.tags
1893
+ }, errorFactory)) && input.tags.every((elem, _index6) => "string" === typeof elem || $guard(_exceptionable, {
1894
+ path: _path + ".tags[" + _index6 + "]",
1895
+ expected: "string",
1896
+ value: elem
1897
+ }, errorFactory)) || $guard(_exceptionable, {
1898
+ path: _path + ".tags",
1899
+ expected: "Array<string>",
1900
+ value: input.tags
1901
+ }, errorFactory)) && ("string" === typeof input.resumable || $guard(_exceptionable, {
1902
+ path: _path + ".resumable",
1903
+ expected: "string",
1904
+ value: input.resumable
1905
+ }, errorFactory)) && ("string" === typeof input.mimeType || $guard(_exceptionable, {
1906
+ path: _path + ".mimeType",
1907
+ expected: "string",
1908
+ value: input.mimeType
1909
+ }, errorFactory)) && ("string" === typeof input.encoding || $guard(_exceptionable, {
1910
+ path: _path + ".encoding",
1911
+ expected: "string",
1912
+ value: input.encoding
1913
+ }, errorFactory)) && ("string" === typeof input.hash && (/^([A-Fa-f0-9]{32})?$/.test(input.hash) || $guard(_exceptionable, {
1914
+ path: _path + ".hash",
1915
+ expected: "string & Pattern<\"^([A-Fa-f0-9]{32})?$\">",
1916
+ value: input.hash
1917
+ }, errorFactory)) || $guard(_exceptionable, {
1918
+ path: _path + ".hash",
1919
+ expected: "(string & Pattern<\"^([A-Fa-f0-9]{32})?$\">)",
1920
+ value: input.hash
1921
+ }, errorFactory)) && ("number" === typeof input.btime && (0 <= input.btime || $guard(_exceptionable, {
1922
+ path: _path + ".btime",
1923
+ expected: "number & Minimum<0>",
1924
+ value: input.btime
1925
+ }, errorFactory)) && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 18446744073709552000 || $guard(_exceptionable, {
1926
+ path: _path + ".btime",
1927
+ expected: "number & Type<\"uint64\">",
1928
+ value: input.btime
1929
+ }, errorFactory)) || $guard(_exceptionable, {
1930
+ path: _path + ".btime",
1931
+ expected: "(number & Minimum<0> & Type<\"uint64\">)",
1932
+ value: input.btime
1933
+ }, errorFactory)) && ("boolean" === typeof input.completed || $guard(_exceptionable, {
1934
+ path: _path + ".completed",
1935
+ expected: "boolean",
1936
+ value: input.completed
1937
+ }, errorFactory)) && ((undefined !== input.error || $guard(_exceptionable, {
1938
+ path: _path + ".error",
1939
+ expected: "(Array<NxtError> | NxtError | null)",
1940
+ value: input.error
1941
+ }, errorFactory)) && (null === input.error || (Array.isArray(input.error) && input.error.every((elem, _index7) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
1942
+ path: _path + ".error[" + _index7 + "]",
1943
+ expected: "NxtError",
1944
+ value: elem
1945
+ }, errorFactory)) && $ao2(elem, _path + ".error[" + _index7 + "]", true && _exceptionable) || $guard(_exceptionable, {
1946
+ path: _path + ".error[" + _index7 + "]",
1947
+ expected: "NxtError",
1948
+ value: elem
1949
+ }, errorFactory)) || "object" === typeof input.error && null !== input.error && $ao2(input.error, _path + ".error", true && _exceptionable) || $guard(_exceptionable, {
1950
+ path: _path + ".error",
1951
+ expected: "(Array<NxtError> | NxtError | null)",
1952
+ value: input.error
1953
+ }, errorFactory)) || $guard(_exceptionable, {
1954
+ path: _path + ".error",
1955
+ expected: "(Array<NxtError> | NxtError | null)",
1956
+ value: input.error
1957
+ }, errorFactory)));
1958
+ const $ao1 = (input, _path, _exceptionable = true) => (undefined === input.file || "string" === typeof input.file || $guard(_exceptionable, {
1959
+ path: _path + ".file",
1960
+ expected: "(string | undefined)",
1961
+ value: input.file
1962
+ }, errorFactory)) && (undefined === input.offset || "number" === typeof input.offset || $guard(_exceptionable, {
1963
+ path: _path + ".offset",
1964
+ expected: "(number | undefined)",
1965
+ value: input.offset
1966
+ }, errorFactory)) && (undefined === input.start || "number" === typeof input.start || $guard(_exceptionable, {
1967
+ path: _path + ".start",
1968
+ expected: "(number | undefined)",
1969
+ value: input.start
1970
+ }, errorFactory)) && (undefined === input.end || "number" === typeof input.end || $guard(_exceptionable, {
1971
+ path: _path + ".end",
1972
+ expected: "(number | undefined)",
1973
+ value: input.end
1974
+ }, errorFactory));
1975
+ const $ao2 = (input, _path, _exceptionable = true) => ("string" === typeof input.message || $guard(_exceptionable, {
1976
+ path: _path + ".message",
1977
+ expected: "string",
1978
+ value: input.message
1979
+ }, errorFactory)) && (undefined === input.type || "string" === typeof input.type || $guard(_exceptionable, {
1980
+ path: _path + ".type",
1981
+ expected: "(string | undefined)",
1982
+ value: input.type
1983
+ }, errorFactory)) && (undefined === input.code || "string" === typeof input.code || $guard(_exceptionable, {
1984
+ path: _path + ".code",
1985
+ expected: "(string | undefined)",
1986
+ value: input.code
1987
+ }, errorFactory)) && (undefined === input.exitCode || "number" === typeof input.exitCode || $guard(_exceptionable, {
1988
+ path: _path + ".exitCode",
1989
+ expected: "(number | undefined)",
1990
+ value: input.exitCode
1991
+ }, errorFactory)) && (undefined === input.signalCode || "number" === typeof input.signalCode || $guard(_exceptionable, {
1992
+ path: _path + ".signalCode",
1993
+ expected: "(number | undefined)",
1994
+ value: input.signalCode
1995
+ }, errorFactory)) && (undefined === input.statusCode || "number" === typeof input.statusCode || $guard(_exceptionable, {
1996
+ path: _path + ".statusCode",
1997
+ expected: "(number | undefined)",
1998
+ value: input.statusCode
1999
+ }, errorFactory)) && (undefined === input.headers || ("object" === typeof input.headers && null !== input.headers && false === Array.isArray(input.headers) || $guard(_exceptionable, {
2000
+ path: _path + ".headers",
2001
+ expected: "(Record<string, string> | undefined)",
2002
+ value: input.headers
2003
+ }, errorFactory)) && $ao3(input.headers, _path + ".headers", true && _exceptionable) || $guard(_exceptionable, {
2004
+ path: _path + ".headers",
2005
+ expected: "(Record<string, string> | undefined)",
2006
+ value: input.headers
2007
+ }, errorFactory)) && (undefined === input.data || ("object" === typeof input.data && null !== input.data && false === Array.isArray(input.data) || $guard(_exceptionable, {
2008
+ path: _path + ".data",
2009
+ expected: "(object | undefined)",
2010
+ value: input.data
2011
+ }, errorFactory)) && $ao4(input.data, _path + ".data", true && _exceptionable) || $guard(_exceptionable, {
2012
+ path: _path + ".data",
2013
+ expected: "(object | undefined)",
2014
+ value: input.data
2015
+ }, errorFactory)) && (null === input.cause || undefined === input.cause || ("object" === typeof input.cause && null !== input.cause || $guard(_exceptionable, {
2016
+ path: _path + ".cause",
2017
+ expected: "(NxtError | null | undefined)",
2018
+ value: input.cause
2019
+ }, errorFactory)) && $ao2(input.cause, _path + ".cause", true && _exceptionable) || $guard(_exceptionable, {
2020
+ path: _path + ".cause",
2021
+ expected: "(NxtError | null | undefined)",
2022
+ value: input.cause
2023
+ }, errorFactory)) && (null === input.errors || undefined === input.errors || (Array.isArray(input.errors) || $guard(_exceptionable, {
2024
+ path: _path + ".errors",
2025
+ expected: "(Array<NxtError> | null | undefined)",
2026
+ value: input.errors
2027
+ }, errorFactory)) && input.errors.every((elem, _index8) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
2028
+ path: _path + ".errors[" + _index8 + "]",
2029
+ expected: "NxtError",
2030
+ value: elem
2031
+ }, errorFactory)) && $ao2(elem, _path + ".errors[" + _index8 + "]", true && _exceptionable) || $guard(_exceptionable, {
2032
+ path: _path + ".errors[" + _index8 + "]",
2033
+ expected: "NxtError",
2034
+ value: elem
2035
+ }, errorFactory)) || $guard(_exceptionable, {
2036
+ path: _path + ".errors",
2037
+ expected: "(Array<NxtError> | null | undefined)",
2038
+ value: input.errors
2039
+ }, errorFactory));
2040
+ const $ao3 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
2041
+ const value = input[key];
2042
+ if (undefined === value)
2043
+ return true;
2044
+ return "string" === typeof value || $guard(_exceptionable, {
2045
+ path: _path + $join(key),
2046
+ expected: "string",
2047
+ value: value
2048
+ }, errorFactory);
2049
+ });
2050
+ const $ao4 = (input, _path, _exceptionable = true) => true;
2051
+ return ("object" === typeof input && null !== input || $guard(true, {
2052
+ path: _path + "",
2053
+ expected: "FileStats",
2054
+ value: input
2055
+ }, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
2056
+ path: _path + "",
2057
+ expected: "FileStats",
2058
+ value: input
2059
+ }, errorFactory);
2060
+ })(input, "$input", true);
2061
+ };
2062
+ export const stringifyFileDomainStatsRecord = input => {
2063
+ 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);
2064
+ 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)));
2065
+ const $io3 = input => Object.keys(input).every(key => {
2066
+ const value = input[key];
2067
+ if (undefined === value)
2068
+ return true;
2069
+ return "string" === typeof value;
2070
+ });
2071
+ const $io4 = input => true;
2072
+ const $string = __typia.json.createStringify.string;
2073
+ const $throws = __typia.json.createStringify.throws;
2074
+ const $tail = __typia.json.createStringify.tail;
2075
+ 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(",")}]`},"locations":${`[${input.locations.map(elem => $string(elem)).join(",")}]`},"progress":${input.progress},"ranges":${`[${input.ranges.map(elem => `[${elem[0]},${elem[1]}]`).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)},"encoding":${$string(input.encoding)},"hash":${$string(input.hash)},"btime":${input.btime},"completed":${input.completed},"error":${null !== input.error ? (() => {
2076
+ if (Array.isArray(input.error))
2077
+ return `[${input.error.map(elem => $so2(elem)).join(",")}]`;
2078
+ if ("object" === typeof input.error && null !== input.error)
2079
+ return $so2(input.error);
2080
+ $throws({
2081
+ expected: "(Array<NxtError> | NxtError | null)",
2082
+ value: input.error
2083
+ });
2084
+ })() : "null"}}`;
2085
+ 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}`}`)}}`;
2086
+ 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)}}`;
2087
+ const $so3 = input => `{${Object.entries(input).map(([key, value]) => { if (undefined === value)
2088
+ return ""; return `${JSON.stringify(key)}:${$string(value)}`; }).filter(str => "" !== str).join(",")}}`;
2089
+ return $so0(input);
2090
+ };
2091
+ export const assertStringifyFileDomainStatsRecord = (input, errorFactory) => { const assert = (input, errorFactory) => {
2092
+ const __is = input => {
2093
+ 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)) && (Array.isArray(input.locations) && input.locations.every(elem => "string" === typeof elem)) && ("number" === typeof input.progress && (0 <= input.progress && input.progress <= 1)) && (Array.isArray(input.ranges) && input.ranges.every(elem => Array.isArray(elem) && (elem.length === 2 && ("number" === typeof elem[0] && (!Number.isNaN(elem[0]) && 0 <= elem[0])) && ("number" === typeof elem[1] && (!Number.isNaN(elem[1]) && 0 <= elem[1]))))) && ("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.encoding && ("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))));
2094
+ 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));
2095
+ 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)));
2096
+ const $io3 = input => Object.keys(input).every(key => {
2097
+ const value = input[key];
2098
+ if (undefined === value)
2099
+ return true;
2100
+ return "string" === typeof value;
2101
+ });
2102
+ const $io4 = input => true;
2103
+ return "object" === typeof input && null !== input && $io0(input);
2104
+ };
2105
+ if (false === __is(input))
2106
+ ((input, _path, _exceptionable = true) => {
2107
+ const $guard = __typia.json.createAssertStringify.guard;
2108
+ const $join = __typia.json.createAssertStringify.join;
2109
+ const $ao0 = (input, _path, _exceptionable = true) => (null === input.position || "number" === typeof input.position && (0 <= input.position || $guard(_exceptionable, {
2110
+ path: _path + ".position",
2111
+ expected: "number & Minimum<0>",
2112
+ value: input.position
2113
+ }, errorFactory)) && (Math.floor(input.position) === input.position && 0 <= input.position && input.position <= 18446744073709552000 || $guard(_exceptionable, {
2114
+ path: _path + ".position",
2115
+ expected: "number & Type<\"uint64\">",
2116
+ value: input.position
2117
+ }, errorFactory)) || $guard(_exceptionable, {
2118
+ path: _path + ".position",
2119
+ expected: "((number & Minimum<0> & Type<\"uint64\">) | null)",
2120
+ value: input.position
2121
+ }, errorFactory)) && ("boolean" === typeof input.uploading || $guard(_exceptionable, {
2122
+ path: _path + ".uploading",
2123
+ expected: "boolean",
2124
+ value: input.uploading
2125
+ }, errorFactory)) && ((Array.isArray(input.zones) || $guard(_exceptionable, {
2126
+ path: _path + ".zones",
2127
+ expected: "Array<string>",
2128
+ value: input.zones
2129
+ }, errorFactory)) && input.zones.every((elem, _index1) => "string" === typeof elem || $guard(_exceptionable, {
2130
+ path: _path + ".zones[" + _index1 + "]",
2131
+ expected: "string",
2132
+ value: elem
2133
+ }, errorFactory)) || $guard(_exceptionable, {
2134
+ path: _path + ".zones",
2135
+ expected: "Array<string>",
2136
+ value: input.zones
2137
+ }, errorFactory)) && ((Array.isArray(input.replicas) || $guard(_exceptionable, {
2138
+ path: _path + ".replicas",
2139
+ expected: "Array<string>",
2140
+ value: input.replicas
2141
+ }, errorFactory)) && input.replicas.every((elem, _index2) => "string" === typeof elem || $guard(_exceptionable, {
2142
+ path: _path + ".replicas[" + _index2 + "]",
2143
+ expected: "string",
2144
+ value: elem
2145
+ }, errorFactory)) || $guard(_exceptionable, {
2146
+ path: _path + ".replicas",
2147
+ expected: "Array<string>",
2148
+ value: input.replicas
2149
+ }, errorFactory)) && ((Array.isArray(input.locations) || $guard(_exceptionable, {
2150
+ path: _path + ".locations",
2151
+ expected: "Array<string>",
2152
+ value: input.locations
2153
+ }, errorFactory)) && input.locations.every((elem, _index3) => "string" === typeof elem || $guard(_exceptionable, {
2154
+ path: _path + ".locations[" + _index3 + "]",
2155
+ expected: "string",
2156
+ value: elem
2157
+ }, errorFactory)) || $guard(_exceptionable, {
2158
+ path: _path + ".locations",
2159
+ expected: "Array<string>",
2160
+ value: input.locations
2161
+ }, errorFactory)) && ("number" === typeof input.progress && (0 <= input.progress || $guard(_exceptionable, {
2162
+ path: _path + ".progress",
2163
+ expected: "number & Minimum<0>",
2164
+ value: input.progress
2165
+ }, errorFactory)) && (input.progress <= 1 || $guard(_exceptionable, {
2166
+ path: _path + ".progress",
2167
+ expected: "number & Maximum<1>",
2168
+ value: input.progress
2169
+ }, errorFactory)) || $guard(_exceptionable, {
2170
+ path: _path + ".progress",
2171
+ expected: "(number & Minimum<0> & Maximum<1>)",
2172
+ value: input.progress
2173
+ }, errorFactory)) && ((Array.isArray(input.ranges) || $guard(_exceptionable, {
2174
+ path: _path + ".ranges",
2175
+ expected: "Array<[start: number & Minimum<0>, end: number & Minimum<0>]>",
2176
+ value: input.ranges
2177
+ }, errorFactory)) && input.ranges.every((elem, _index4) => (Array.isArray(elem) || $guard(_exceptionable, {
2178
+ path: _path + ".ranges[" + _index4 + "]",
2179
+ expected: "[start: number & Minimum<0>, end: number & Minimum<0>]",
2180
+ value: elem
2181
+ }, errorFactory)) && ((elem.length === 2 || $guard(_exceptionable, {
2182
+ path: _path + ".ranges[" + _index4 + "]",
2183
+ expected: "[(number & Minimum<0>), (number & Minimum<0>)]",
2184
+ value: elem
2185
+ }, errorFactory)) && ("number" === typeof elem[0] && (!Number.isNaN(elem[0]) || $guard(_exceptionable, {
2186
+ path: _path + ".ranges[" + _index4 + "][0]",
2187
+ expected: "number",
2188
+ value: elem[0]
2189
+ }, errorFactory)) && (0 <= elem[0] || $guard(_exceptionable, {
2190
+ path: _path + ".ranges[" + _index4 + "][0]",
2191
+ expected: "number & Minimum<0>",
2192
+ value: elem[0]
2193
+ }, errorFactory)) || $guard(_exceptionable, {
2194
+ path: _path + ".ranges[" + _index4 + "][0]",
2195
+ expected: "(number & Minimum<0>)",
2196
+ value: elem[0]
2197
+ }, errorFactory)) && ("number" === typeof elem[1] && (!Number.isNaN(elem[1]) || $guard(_exceptionable, {
2198
+ path: _path + ".ranges[" + _index4 + "][1]",
2199
+ expected: "number",
2200
+ value: elem[1]
2201
+ }, errorFactory)) && (0 <= elem[1] || $guard(_exceptionable, {
2202
+ path: _path + ".ranges[" + _index4 + "][1]",
2203
+ expected: "number & Minimum<0>",
2204
+ value: elem[1]
2205
+ }, errorFactory)) || $guard(_exceptionable, {
2206
+ path: _path + ".ranges[" + _index4 + "][1]",
2207
+ expected: "(number & Minimum<0>)",
2208
+ value: elem[1]
2209
+ }, errorFactory))) || $guard(_exceptionable, {
2210
+ path: _path + ".ranges[" + _index4 + "]",
2211
+ expected: "[start: number & Minimum<0>, end: number & Minimum<0>]",
2212
+ value: elem
2213
+ }, errorFactory)) || $guard(_exceptionable, {
2214
+ path: _path + ".ranges",
2215
+ expected: "Array<[start: number & Minimum<0>, end: number & Minimum<0>]>",
2216
+ value: input.ranges
2217
+ }, errorFactory)) && ("string" === typeof input.id && (/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) || $guard(_exceptionable, {
2218
+ path: _path + ".id",
2219
+ expected: "string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
2220
+ value: input.id
2221
+ }, errorFactory)) || $guard(_exceptionable, {
2222
+ path: _path + ".id",
2223
+ expected: "(string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">)",
2224
+ value: input.id
2225
+ }, errorFactory)) && (null === input.size || "number" === typeof input.size && (0 <= input.size || $guard(_exceptionable, {
2226
+ path: _path + ".size",
2227
+ expected: "number & Minimum<0>",
2228
+ value: input.size
2229
+ }, errorFactory)) && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 18446744073709552000 || $guard(_exceptionable, {
2230
+ path: _path + ".size",
2231
+ expected: "number & Type<\"uint64\">",
2232
+ value: input.size
2233
+ }, errorFactory)) || $guard(_exceptionable, {
2234
+ path: _path + ".size",
2235
+ expected: "((number & Minimum<0> & Type<\"uint64\">) | null)",
2236
+ value: input.size
2237
+ }, errorFactory)) && ("boolean" === typeof input.seekable || $guard(_exceptionable, {
2238
+ path: _path + ".seekable",
2239
+ expected: "boolean",
2240
+ value: input.seekable
2241
+ }, errorFactory)) && ("boolean" === typeof input.deleted || $guard(_exceptionable, {
2242
+ path: _path + ".deleted",
2243
+ expected: "boolean",
2244
+ value: input.deleted
2245
+ }, errorFactory)) && ((Array.isArray(input.refs) || $guard(_exceptionable, {
2246
+ path: _path + ".refs",
2247
+ expected: "Array<__type>",
2248
+ value: input.refs
2249
+ }, errorFactory)) && input.refs.every((elem, _index5) => ("object" === typeof elem && null !== elem && false === Array.isArray(elem) || $guard(_exceptionable, {
2250
+ path: _path + ".refs[" + _index5 + "]",
2251
+ expected: "__type",
2252
+ value: elem
2253
+ }, errorFactory)) && $ao1(elem, _path + ".refs[" + _index5 + "]", true && _exceptionable) || $guard(_exceptionable, {
2254
+ path: _path + ".refs[" + _index5 + "]",
2255
+ expected: "__type",
2256
+ value: elem
2257
+ }, errorFactory)) || $guard(_exceptionable, {
2258
+ path: _path + ".refs",
2259
+ expected: "Array<__type>",
2260
+ value: input.refs
2261
+ }, errorFactory)) && ((Array.isArray(input.tags) || $guard(_exceptionable, {
2262
+ path: _path + ".tags",
2263
+ expected: "Array<string>",
2264
+ value: input.tags
2265
+ }, errorFactory)) && input.tags.every((elem, _index6) => "string" === typeof elem || $guard(_exceptionable, {
2266
+ path: _path + ".tags[" + _index6 + "]",
2267
+ expected: "string",
2268
+ value: elem
2269
+ }, errorFactory)) || $guard(_exceptionable, {
2270
+ path: _path + ".tags",
2271
+ expected: "Array<string>",
2272
+ value: input.tags
2273
+ }, errorFactory)) && ("string" === typeof input.resumable || $guard(_exceptionable, {
2274
+ path: _path + ".resumable",
2275
+ expected: "string",
2276
+ value: input.resumable
2277
+ }, errorFactory)) && ("string" === typeof input.mimeType || $guard(_exceptionable, {
2278
+ path: _path + ".mimeType",
2279
+ expected: "string",
2280
+ value: input.mimeType
2281
+ }, errorFactory)) && ("string" === typeof input.encoding || $guard(_exceptionable, {
2282
+ path: _path + ".encoding",
2283
+ expected: "string",
2284
+ value: input.encoding
2285
+ }, errorFactory)) && ("string" === typeof input.hash && (/^([A-Fa-f0-9]{32})?$/.test(input.hash) || $guard(_exceptionable, {
2286
+ path: _path + ".hash",
2287
+ expected: "string & Pattern<\"^([A-Fa-f0-9]{32})?$\">",
2288
+ value: input.hash
2289
+ }, errorFactory)) || $guard(_exceptionable, {
2290
+ path: _path + ".hash",
2291
+ expected: "(string & Pattern<\"^([A-Fa-f0-9]{32})?$\">)",
2292
+ value: input.hash
2293
+ }, errorFactory)) && ("number" === typeof input.btime && (0 <= input.btime || $guard(_exceptionable, {
2294
+ path: _path + ".btime",
2295
+ expected: "number & Minimum<0>",
2296
+ value: input.btime
2297
+ }, errorFactory)) && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 18446744073709552000 || $guard(_exceptionable, {
2298
+ path: _path + ".btime",
2299
+ expected: "number & Type<\"uint64\">",
2300
+ value: input.btime
2301
+ }, errorFactory)) || $guard(_exceptionable, {
2302
+ path: _path + ".btime",
2303
+ expected: "(number & Minimum<0> & Type<\"uint64\">)",
2304
+ value: input.btime
2305
+ }, errorFactory)) && ("boolean" === typeof input.completed || $guard(_exceptionable, {
2306
+ path: _path + ".completed",
2307
+ expected: "boolean",
2308
+ value: input.completed
2309
+ }, errorFactory)) && ((undefined !== input.error || $guard(_exceptionable, {
2310
+ path: _path + ".error",
2311
+ expected: "(Array<NxtError> | NxtError | null)",
2312
+ value: input.error
2313
+ }, errorFactory)) && (null === input.error || (Array.isArray(input.error) && input.error.every((elem, _index7) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
2314
+ path: _path + ".error[" + _index7 + "]",
2315
+ expected: "NxtError",
2316
+ value: elem
2317
+ }, errorFactory)) && $ao2(elem, _path + ".error[" + _index7 + "]", true && _exceptionable) || $guard(_exceptionable, {
2318
+ path: _path + ".error[" + _index7 + "]",
2319
+ expected: "NxtError",
2320
+ value: elem
2321
+ }, errorFactory)) || "object" === typeof input.error && null !== input.error && $ao2(input.error, _path + ".error", true && _exceptionable) || $guard(_exceptionable, {
2322
+ path: _path + ".error",
2323
+ expected: "(Array<NxtError> | NxtError | null)",
2324
+ value: input.error
2325
+ }, errorFactory)) || $guard(_exceptionable, {
2326
+ path: _path + ".error",
2327
+ expected: "(Array<NxtError> | NxtError | null)",
2328
+ value: input.error
2329
+ }, errorFactory)));
2330
+ const $ao1 = (input, _path, _exceptionable = true) => (undefined === input.file || "string" === typeof input.file || $guard(_exceptionable, {
2331
+ path: _path + ".file",
2332
+ expected: "(string | undefined)",
2333
+ value: input.file
2334
+ }, errorFactory)) && (undefined === input.offset || "number" === typeof input.offset && !Number.isNaN(input.offset) || $guard(_exceptionable, {
2335
+ path: _path + ".offset",
2336
+ expected: "(number | undefined)",
2337
+ value: input.offset
2338
+ }, errorFactory)) && (undefined === input.start || "number" === typeof input.start && !Number.isNaN(input.start) || $guard(_exceptionable, {
2339
+ path: _path + ".start",
2340
+ expected: "(number | undefined)",
2341
+ value: input.start
2342
+ }, errorFactory)) && (undefined === input.end || "number" === typeof input.end && !Number.isNaN(input.end) || $guard(_exceptionable, {
2343
+ path: _path + ".end",
2344
+ expected: "(number | undefined)",
2345
+ value: input.end
2346
+ }, errorFactory));
2347
+ const $ao2 = (input, _path, _exceptionable = true) => ("string" === typeof input.message || $guard(_exceptionable, {
2348
+ path: _path + ".message",
2349
+ expected: "string",
2350
+ value: input.message
2351
+ }, errorFactory)) && (undefined === input.type || "string" === typeof input.type || $guard(_exceptionable, {
2352
+ path: _path + ".type",
2353
+ expected: "(string | undefined)",
2354
+ value: input.type
2355
+ }, errorFactory)) && (undefined === input.code || "string" === typeof input.code || $guard(_exceptionable, {
2356
+ path: _path + ".code",
2357
+ expected: "(string | undefined)",
2358
+ value: input.code
2359
+ }, errorFactory)) && (undefined === input.exitCode || "number" === typeof input.exitCode && !Number.isNaN(input.exitCode) || $guard(_exceptionable, {
2360
+ path: _path + ".exitCode",
2361
+ expected: "(number | undefined)",
2362
+ value: input.exitCode
2363
+ }, errorFactory)) && (undefined === input.signalCode || "number" === typeof input.signalCode && !Number.isNaN(input.signalCode) || $guard(_exceptionable, {
2364
+ path: _path + ".signalCode",
2365
+ expected: "(number | undefined)",
2366
+ value: input.signalCode
2367
+ }, errorFactory)) && (undefined === input.statusCode || "number" === typeof input.statusCode && !Number.isNaN(input.statusCode) || $guard(_exceptionable, {
2368
+ path: _path + ".statusCode",
2369
+ expected: "(number | undefined)",
2370
+ value: input.statusCode
2371
+ }, errorFactory)) && (undefined === input.headers || ("object" === typeof input.headers && null !== input.headers && false === Array.isArray(input.headers) || $guard(_exceptionable, {
2372
+ path: _path + ".headers",
2373
+ expected: "(Record<string, string> | undefined)",
2374
+ value: input.headers
2375
+ }, errorFactory)) && $ao3(input.headers, _path + ".headers", true && _exceptionable) || $guard(_exceptionable, {
2376
+ path: _path + ".headers",
2377
+ expected: "(Record<string, string> | undefined)",
2378
+ value: input.headers
2379
+ }, errorFactory)) && (undefined === input.data || ("object" === typeof input.data && null !== input.data && false === Array.isArray(input.data) || $guard(_exceptionable, {
2380
+ path: _path + ".data",
2381
+ expected: "(object | undefined)",
2382
+ value: input.data
2383
+ }, errorFactory)) && $ao4(input.data, _path + ".data", true && _exceptionable) || $guard(_exceptionable, {
2384
+ path: _path + ".data",
2385
+ expected: "(object | undefined)",
2386
+ value: input.data
2387
+ }, errorFactory)) && (null === input.cause || undefined === input.cause || ("object" === typeof input.cause && null !== input.cause || $guard(_exceptionable, {
2388
+ path: _path + ".cause",
2389
+ expected: "(NxtError | null | undefined)",
2390
+ value: input.cause
2391
+ }, errorFactory)) && $ao2(input.cause, _path + ".cause", true && _exceptionable) || $guard(_exceptionable, {
2392
+ path: _path + ".cause",
2393
+ expected: "(NxtError | null | undefined)",
2394
+ value: input.cause
2395
+ }, errorFactory)) && (null === input.errors || undefined === input.errors || (Array.isArray(input.errors) || $guard(_exceptionable, {
2396
+ path: _path + ".errors",
2397
+ expected: "(Array<NxtError> | null | undefined)",
2398
+ value: input.errors
2399
+ }, errorFactory)) && input.errors.every((elem, _index8) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
2400
+ path: _path + ".errors[" + _index8 + "]",
2401
+ expected: "NxtError",
2402
+ value: elem
2403
+ }, errorFactory)) && $ao2(elem, _path + ".errors[" + _index8 + "]", true && _exceptionable) || $guard(_exceptionable, {
2404
+ path: _path + ".errors[" + _index8 + "]",
2405
+ expected: "NxtError",
2406
+ value: elem
2407
+ }, errorFactory)) || $guard(_exceptionable, {
2408
+ path: _path + ".errors",
2409
+ expected: "(Array<NxtError> | null | undefined)",
2410
+ value: input.errors
2411
+ }, errorFactory));
2412
+ const $ao3 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
2413
+ const value = input[key];
2414
+ if (undefined === value)
2415
+ return true;
2416
+ return "string" === typeof value || $guard(_exceptionable, {
2417
+ path: _path + $join(key),
2418
+ expected: "string",
2419
+ value: value
2420
+ }, errorFactory);
2421
+ });
2422
+ const $ao4 = (input, _path, _exceptionable = true) => true;
2423
+ return ("object" === typeof input && null !== input || $guard(true, {
2424
+ path: _path + "",
2425
+ expected: "FileStats",
2426
+ value: input
2427
+ }, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
2428
+ path: _path + "",
2429
+ expected: "FileStats",
2430
+ value: input
2431
+ }, errorFactory);
2432
+ })(input, "$input", true);
2433
+ return input;
2434
+ }; const stringify = input => {
2435
+ 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);
2436
+ 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)));
2437
+ const $io3 = input => Object.keys(input).every(key => {
2438
+ const value = input[key];
2439
+ if (undefined === value)
2440
+ return true;
2441
+ return "string" === typeof value;
2442
+ });
2443
+ const $io4 = input => true;
2444
+ const $string = __typia.json.createAssertStringify.string;
2445
+ const $throws = __typia.json.createAssertStringify.throws;
2446
+ const $tail = __typia.json.createAssertStringify.tail;
2447
+ 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(",")}]`},"locations":${`[${input.locations.map(elem => $string(elem)).join(",")}]`},"progress":${input.progress},"ranges":${`[${input.ranges.map(elem => `[${elem[0]},${elem[1]}]`).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)},"encoding":${$string(input.encoding)},"hash":${$string(input.hash)},"btime":${input.btime},"completed":${input.completed},"error":${null !== input.error ? (() => {
2448
+ if (Array.isArray(input.error))
2449
+ return `[${input.error.map(elem => $so2(elem)).join(",")}]`;
2450
+ if ("object" === typeof input.error && null !== input.error)
2451
+ return $so2(input.error);
2452
+ $throws({
2453
+ expected: "(Array<NxtError> | NxtError | null)",
2454
+ value: input.error
2455
+ });
2456
+ })() : "null"}}`;
2457
+ 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}`}`)}}`;
2458
+ 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)}}`;
2459
+ const $so3 = input => `{${Object.entries(input).map(([key, value]) => { if (undefined === value)
2460
+ return ""; return `${JSON.stringify(key)}:${$string(value)}`; }).filter(str => "" !== str).join(",")}}`;
2461
+ return $so0(input);
2462
+ }; return stringify(assert(input, errorFactory)); };