@datatruck/cli 0.32.3 → 0.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/config.schema.json +377 -31
- package/lib/{Action → actions}/BackupAction.d.ts +13 -19
- package/lib/{Action → actions}/BackupAction.js +52 -91
- package/lib/{Action → actions}/ConfigAction.d.ts +4 -2
- package/lib/{Action → actions}/ConfigAction.js +16 -8
- package/lib/{Action → actions}/CopyAction.d.ts +20 -13
- package/lib/actions/CopyAction.js +296 -0
- package/lib/{Action → actions}/InitAction.d.ts +1 -1
- package/lib/{Action → actions}/InitAction.js +3 -3
- package/lib/{Action → actions}/PruneAction.d.ts +1 -2
- package/lib/{Action → actions}/PruneAction.js +2 -2
- package/lib/{Action → actions}/RestoreAction.d.ts +4 -13
- package/lib/{Action → actions}/RestoreAction.js +17 -17
- package/lib/{Action → actions}/SnapshotsAction.d.ts +2 -3
- package/lib/{Action → actions}/SnapshotsAction.js +3 -3
- package/lib/cli.d.ts +3 -3
- package/lib/cli.js +18 -17
- package/lib/commands/BackupCommand.d.ts +45 -0
- package/lib/{Command → commands}/BackupCommand.js +7 -6
- package/lib/{Command → commands}/CleanCacheCommand.d.ts +4 -2
- package/lib/{Command → commands}/CleanCacheCommand.js +6 -5
- package/lib/{Command → commands}/CommandAbstract.d.ts +10 -6
- package/lib/{Command → commands}/CommandAbstract.js +5 -3
- package/lib/commands/ConfigCommand.d.ts +22 -0
- package/lib/{Command → commands}/ConfigCommand.js +5 -5
- package/lib/commands/CopyCommand.d.ts +17 -0
- package/lib/{Command → commands}/CopyCommand.js +7 -6
- package/lib/commands/InitCommand.d.ts +19 -0
- package/lib/{Command → commands}/InitCommand.js +9 -9
- package/lib/{Command → commands}/PruneCommand.d.ts +7 -4
- package/lib/{Command → commands}/PruneCommand.js +11 -11
- package/lib/commands/RestoreCommand.d.ts +38 -0
- package/lib/{Command → commands}/RestoreCommand.js +7 -6
- package/lib/{Command → commands}/SnapshotsCommand.d.ts +8 -6
- package/lib/{Command → commands}/SnapshotsCommand.js +12 -12
- package/lib/{Command → commands}/StartServerCommand.d.ts +4 -2
- package/lib/{Command → commands}/StartServerCommand.js +5 -5
- package/lib/index.d.ts +20 -23
- package/lib/index.js +8 -8
- package/lib/{Repository → repositories}/DatatruckRepository.d.ts +6 -2
- package/lib/{Repository → repositories}/DatatruckRepository.js +13 -5
- package/lib/{Repository → repositories}/GitRepository.d.ts +6 -2
- package/lib/{Repository → repositories}/GitRepository.js +8 -3
- package/lib/{Repository → repositories}/RepositoryAbstract.d.ts +13 -9
- package/lib/{Repository → repositories}/ResticRepository.d.ts +6 -2
- package/lib/{Repository → repositories}/ResticRepository.js +17 -10
- package/lib/{Task → tasks}/MssqlTask.js +2 -2
- package/lib/{Task → tasks}/MysqlDumpTask.js +4 -4
- package/lib/{Task → tasks}/ScriptTask.d.ts +2 -2
- package/lib/{Task → tasks}/SqlDumpTaskAbstract.js +4 -4
- package/lib/{Task → tasks}/TaskAbstract.d.ts +4 -4
- package/lib/utils/DataFormat.js +3 -3
- package/lib/utils/Restic.d.ts +2 -2
- package/lib/utils/Restic.js +12 -10
- package/lib/utils/cli.d.ts +9 -3
- package/lib/utils/cli.js +17 -1
- package/lib/utils/cron.d.ts +11 -0
- package/lib/utils/cron.js +27 -0
- package/lib/utils/datatruck/client.d.ts +3 -1
- package/lib/utils/datatruck/client.js +1 -1
- package/lib/utils/datatruck/command.d.ts +29 -0
- package/lib/utils/datatruck/command.js +61 -0
- package/lib/{Config/RepositoryConfig.d.ts → utils/datatruck/config-repository-type.d.ts} +19 -8
- package/lib/{Config/TaskConfig.d.ts → utils/datatruck/config-task-type.d.ts} +6 -6
- package/lib/utils/datatruck/config-type.d.ts +51 -0
- package/lib/utils/datatruck/config.d.ts +19 -10
- package/lib/utils/datatruck/config.js +43 -7
- package/lib/utils/datatruck/cron-server.d.ts +27 -6
- package/lib/utils/datatruck/cron-server.js +38 -20
- package/lib/utils/datatruck/paths.d.ts +2 -2
- package/lib/utils/datatruck/report-list.d.ts +14 -0
- package/lib/utils/datatruck/report-list.js +57 -0
- package/lib/utils/datatruck/repository-server.js +3 -2
- package/lib/utils/datatruck/repository.d.ts +16 -0
- package/lib/utils/datatruck/repository.js +30 -0
- package/lib/utils/datatruck/snapshot.d.ts +2 -2
- package/lib/utils/datatruck/task.d.ts +3 -0
- package/lib/{Factory/TaskFactory.js → utils/datatruck/task.js} +8 -8
- package/lib/utils/date.js +6 -2
- package/lib/utils/fs.d.ts +3 -0
- package/lib/utils/fs.js +24 -4
- package/lib/utils/http.d.ts +3 -1
- package/lib/utils/http.js +6 -1
- package/lib/utils/list.d.ts +5 -5
- package/lib/utils/mysql.js +5 -5
- package/lib/utils/object.d.ts +13 -0
- package/lib/utils/object.js +32 -1
- package/lib/utils/process.js +4 -1
- package/lib/utils/string.d.ts +1 -0
- package/lib/utils/string.js +7 -3
- package/lib/utils/ts.d.ts +16 -0
- package/lib/utils/virtual-fs.d.ts +6 -2
- package/lib/utils/virtual-fs.js +4 -1
- package/lib/utils/watcher.d.ts +10 -0
- package/lib/utils/watcher.js +34 -0
- package/package.json +4 -4
- package/lib/Action/CopyAction.js +0 -164
- package/lib/Command/BackupCommand.d.ts +0 -19
- package/lib/Command/ConfigCommand.d.ts +0 -15
- package/lib/Command/CopyCommand.d.ts +0 -16
- package/lib/Command/InitCommand.d.ts +0 -13
- package/lib/Command/RestoreCommand.d.ts +0 -17
- package/lib/Config/Config.d.ts +0 -28
- package/lib/Config/PackageConfig.d.ts +0 -24
- package/lib/Config/PackageRepositoryConfig.d.ts +0 -15
- package/lib/Config/PrunePolicyConfig.d.ts +0 -2
- package/lib/Config/RepositoryConfig.js +0 -2
- package/lib/Config/TaskConfig.js +0 -2
- package/lib/Factory/CommandFactory.d.ts +0 -45
- package/lib/Factory/CommandFactory.js +0 -96
- package/lib/Factory/RepositoryFactory.d.ts +0 -3
- package/lib/Factory/RepositoryFactory.js +0 -23
- package/lib/Factory/TaskFactory.d.ts +0 -3
- /package/lib/{Action → actions}/CleanCacheAction.d.ts +0 -0
- /package/lib/{Action → actions}/CleanCacheAction.js +0 -0
- /package/lib/{Repository → repositories}/RepositoryAbstract.js +0 -0
- /package/lib/{Task → tasks}/GitTask.d.ts +0 -0
- /package/lib/{Task → tasks}/GitTask.js +0 -0
- /package/lib/{Task → tasks}/MariadbTask.d.ts +0 -0
- /package/lib/{Task → tasks}/MariadbTask.js +0 -0
- /package/lib/{Task → tasks}/MssqlTask.d.ts +0 -0
- /package/lib/{Task → tasks}/MysqlDumpTask.d.ts +0 -0
- /package/lib/{Task → tasks}/PostgresqlDumpTask.d.ts +0 -0
- /package/lib/{Task → tasks}/PostgresqlDumpTask.js +0 -0
- /package/lib/{Task → tasks}/ScriptTask.js +0 -0
- /package/lib/{Task → tasks}/SqlDumpTaskAbstract.d.ts +0 -0
- /package/lib/{Task → tasks}/TaskAbstract.js +0 -0
- /package/lib/{Config/Config.js → utils/datatruck/config-repository-type.js} +0 -0
- /package/lib/{Config/PackageConfig.js → utils/datatruck/config-task-type.js} +0 -0
- /package/lib/{Config/PackageRepositoryConfig.js → utils/datatruck/config-type.js} +0 -0
- /package/lib/{Error/AppError.d.ts → utils/datatruck/error.d.ts} +0 -0
- /package/lib/{Error/AppError.js → utils/datatruck/error.js} +0 -0
- /package/lib/{Config/PrunePolicyConfig.js → utils/ts.js} +0 -0
package/config.schema.json
CHANGED
|
@@ -4,6 +4,9 @@
|
|
|
4
4
|
"$schema": {
|
|
5
5
|
"type": "string"
|
|
6
6
|
},
|
|
7
|
+
"hostname": {
|
|
8
|
+
"type": "string"
|
|
9
|
+
},
|
|
7
10
|
"tempDir": {
|
|
8
11
|
"type": "string"
|
|
9
12
|
},
|
|
@@ -493,7 +496,7 @@
|
|
|
493
496
|
}
|
|
494
497
|
},
|
|
495
498
|
"prunePolicy": {
|
|
496
|
-
"$ref": "#/definitions/
|
|
499
|
+
"$ref": "#/definitions/DatatruckPolicyConfig"
|
|
497
500
|
},
|
|
498
501
|
"repositoryConfigs": {
|
|
499
502
|
"type": "array",
|
|
@@ -717,7 +720,7 @@
|
|
|
717
720
|
}
|
|
718
721
|
},
|
|
719
722
|
"prunePolicy": {
|
|
720
|
-
"$ref": "#/definitions/
|
|
723
|
+
"$ref": "#/definitions/DatatruckPolicyConfig"
|
|
721
724
|
}
|
|
722
725
|
},
|
|
723
726
|
"additionalProperties": false,
|
|
@@ -894,7 +897,7 @@
|
|
|
894
897
|
"RepositoryEnabledObject": {
|
|
895
898
|
"type": "object",
|
|
896
899
|
"properties": {
|
|
897
|
-
"
|
|
900
|
+
"backup": {
|
|
898
901
|
"type": "boolean"
|
|
899
902
|
},
|
|
900
903
|
"init": {
|
|
@@ -903,10 +906,10 @@
|
|
|
903
906
|
"prune": {
|
|
904
907
|
"type": "boolean"
|
|
905
908
|
},
|
|
906
|
-
"
|
|
909
|
+
"restore": {
|
|
907
910
|
"type": "boolean"
|
|
908
911
|
},
|
|
909
|
-
"
|
|
912
|
+
"snapshots": {
|
|
910
913
|
"type": "boolean"
|
|
911
914
|
},
|
|
912
915
|
"defaults": {
|
|
@@ -959,21 +962,21 @@
|
|
|
959
962
|
"path": {
|
|
960
963
|
"type": "string"
|
|
961
964
|
},
|
|
962
|
-
"
|
|
963
|
-
"enum": [
|
|
964
|
-
"http",
|
|
965
|
-
"https"
|
|
966
|
-
],
|
|
965
|
+
"username": {
|
|
967
966
|
"type": "string"
|
|
968
967
|
},
|
|
969
968
|
"host": {
|
|
970
969
|
"type": "string"
|
|
971
970
|
},
|
|
972
|
-
"username": {
|
|
973
|
-
"type": "string"
|
|
974
|
-
},
|
|
975
971
|
"port": {
|
|
976
972
|
"type": "number"
|
|
973
|
+
},
|
|
974
|
+
"protocol": {
|
|
975
|
+
"enum": [
|
|
976
|
+
"http",
|
|
977
|
+
"https"
|
|
978
|
+
],
|
|
979
|
+
"type": "string"
|
|
977
980
|
}
|
|
978
981
|
}
|
|
979
982
|
},
|
|
@@ -1188,7 +1191,7 @@
|
|
|
1188
1191
|
}
|
|
1189
1192
|
}
|
|
1190
1193
|
},
|
|
1191
|
-
"
|
|
1194
|
+
"DatatruckPolicyConfig": {
|
|
1192
1195
|
"type": "object",
|
|
1193
1196
|
"properties": {
|
|
1194
1197
|
"tags": {
|
|
@@ -1197,6 +1200,17 @@
|
|
|
1197
1200
|
"type": "string"
|
|
1198
1201
|
}
|
|
1199
1202
|
},
|
|
1203
|
+
"groupBy": {
|
|
1204
|
+
"type": "array",
|
|
1205
|
+
"items": {
|
|
1206
|
+
"enum": [
|
|
1207
|
+
"packageName",
|
|
1208
|
+
"repositoryName",
|
|
1209
|
+
"repositoryType"
|
|
1210
|
+
],
|
|
1211
|
+
"type": "string"
|
|
1212
|
+
}
|
|
1213
|
+
},
|
|
1200
1214
|
"keepDaily": {
|
|
1201
1215
|
"type": "number"
|
|
1202
1216
|
},
|
|
@@ -1217,17 +1231,6 @@
|
|
|
1217
1231
|
},
|
|
1218
1232
|
"keepYearly": {
|
|
1219
1233
|
"type": "number"
|
|
1220
|
-
},
|
|
1221
|
-
"groupBy": {
|
|
1222
|
-
"type": "array",
|
|
1223
|
-
"items": {
|
|
1224
|
-
"enum": [
|
|
1225
|
-
"packageName",
|
|
1226
|
-
"repositoryName",
|
|
1227
|
-
"repositoryType"
|
|
1228
|
-
],
|
|
1229
|
-
"type": "string"
|
|
1230
|
-
}
|
|
1231
1234
|
}
|
|
1232
1235
|
},
|
|
1233
1236
|
"additionalProperties": false
|
|
@@ -1392,10 +1395,101 @@
|
|
|
1392
1395
|
"CronAction": {
|
|
1393
1396
|
"anyOf": [
|
|
1394
1397
|
{
|
|
1398
|
+
"additionalProperties": false,
|
|
1395
1399
|
"type": "object",
|
|
1396
1400
|
"properties": {
|
|
1397
1401
|
"schedule": {
|
|
1398
|
-
"
|
|
1402
|
+
"anyOf": [
|
|
1403
|
+
{
|
|
1404
|
+
"type": "object",
|
|
1405
|
+
"properties": {
|
|
1406
|
+
"minute": {
|
|
1407
|
+
"anyOf": [
|
|
1408
|
+
{
|
|
1409
|
+
"type": "object",
|
|
1410
|
+
"properties": {
|
|
1411
|
+
"each": {
|
|
1412
|
+
"type": "number"
|
|
1413
|
+
}
|
|
1414
|
+
},
|
|
1415
|
+
"additionalProperties": false
|
|
1416
|
+
},
|
|
1417
|
+
{
|
|
1418
|
+
"type": "number"
|
|
1419
|
+
}
|
|
1420
|
+
]
|
|
1421
|
+
},
|
|
1422
|
+
"hour": {
|
|
1423
|
+
"anyOf": [
|
|
1424
|
+
{
|
|
1425
|
+
"type": "object",
|
|
1426
|
+
"properties": {
|
|
1427
|
+
"each": {
|
|
1428
|
+
"type": "number"
|
|
1429
|
+
}
|
|
1430
|
+
},
|
|
1431
|
+
"additionalProperties": false
|
|
1432
|
+
},
|
|
1433
|
+
{
|
|
1434
|
+
"type": "number"
|
|
1435
|
+
}
|
|
1436
|
+
]
|
|
1437
|
+
},
|
|
1438
|
+
"day": {
|
|
1439
|
+
"anyOf": [
|
|
1440
|
+
{
|
|
1441
|
+
"type": "object",
|
|
1442
|
+
"properties": {
|
|
1443
|
+
"each": {
|
|
1444
|
+
"type": "number"
|
|
1445
|
+
}
|
|
1446
|
+
},
|
|
1447
|
+
"additionalProperties": false
|
|
1448
|
+
},
|
|
1449
|
+
{
|
|
1450
|
+
"type": "number"
|
|
1451
|
+
}
|
|
1452
|
+
]
|
|
1453
|
+
},
|
|
1454
|
+
"month": {
|
|
1455
|
+
"anyOf": [
|
|
1456
|
+
{
|
|
1457
|
+
"type": "object",
|
|
1458
|
+
"properties": {
|
|
1459
|
+
"each": {
|
|
1460
|
+
"type": "number"
|
|
1461
|
+
}
|
|
1462
|
+
},
|
|
1463
|
+
"additionalProperties": false
|
|
1464
|
+
},
|
|
1465
|
+
{
|
|
1466
|
+
"type": "number"
|
|
1467
|
+
}
|
|
1468
|
+
]
|
|
1469
|
+
},
|
|
1470
|
+
"weekDay": {
|
|
1471
|
+
"anyOf": [
|
|
1472
|
+
{
|
|
1473
|
+
"type": "object",
|
|
1474
|
+
"properties": {
|
|
1475
|
+
"each": {
|
|
1476
|
+
"type": "number"
|
|
1477
|
+
}
|
|
1478
|
+
},
|
|
1479
|
+
"additionalProperties": false
|
|
1480
|
+
},
|
|
1481
|
+
{
|
|
1482
|
+
"type": "number"
|
|
1483
|
+
}
|
|
1484
|
+
]
|
|
1485
|
+
}
|
|
1486
|
+
},
|
|
1487
|
+
"additionalProperties": false
|
|
1488
|
+
},
|
|
1489
|
+
{
|
|
1490
|
+
"type": "string"
|
|
1491
|
+
}
|
|
1492
|
+
]
|
|
1399
1493
|
},
|
|
1400
1494
|
"name": {
|
|
1401
1495
|
"type": "string",
|
|
@@ -1431,14 +1525,104 @@
|
|
|
1431
1525
|
},
|
|
1432
1526
|
"additionalProperties": false
|
|
1433
1527
|
}
|
|
1434
|
-
}
|
|
1435
|
-
"additionalProperties": false
|
|
1528
|
+
}
|
|
1436
1529
|
},
|
|
1437
1530
|
{
|
|
1531
|
+
"additionalProperties": false,
|
|
1438
1532
|
"type": "object",
|
|
1439
1533
|
"properties": {
|
|
1440
1534
|
"schedule": {
|
|
1441
|
-
"
|
|
1535
|
+
"anyOf": [
|
|
1536
|
+
{
|
|
1537
|
+
"type": "object",
|
|
1538
|
+
"properties": {
|
|
1539
|
+
"minute": {
|
|
1540
|
+
"anyOf": [
|
|
1541
|
+
{
|
|
1542
|
+
"type": "object",
|
|
1543
|
+
"properties": {
|
|
1544
|
+
"each": {
|
|
1545
|
+
"type": "number"
|
|
1546
|
+
}
|
|
1547
|
+
},
|
|
1548
|
+
"additionalProperties": false
|
|
1549
|
+
},
|
|
1550
|
+
{
|
|
1551
|
+
"type": "number"
|
|
1552
|
+
}
|
|
1553
|
+
]
|
|
1554
|
+
},
|
|
1555
|
+
"hour": {
|
|
1556
|
+
"anyOf": [
|
|
1557
|
+
{
|
|
1558
|
+
"type": "object",
|
|
1559
|
+
"properties": {
|
|
1560
|
+
"each": {
|
|
1561
|
+
"type": "number"
|
|
1562
|
+
}
|
|
1563
|
+
},
|
|
1564
|
+
"additionalProperties": false
|
|
1565
|
+
},
|
|
1566
|
+
{
|
|
1567
|
+
"type": "number"
|
|
1568
|
+
}
|
|
1569
|
+
]
|
|
1570
|
+
},
|
|
1571
|
+
"day": {
|
|
1572
|
+
"anyOf": [
|
|
1573
|
+
{
|
|
1574
|
+
"type": "object",
|
|
1575
|
+
"properties": {
|
|
1576
|
+
"each": {
|
|
1577
|
+
"type": "number"
|
|
1578
|
+
}
|
|
1579
|
+
},
|
|
1580
|
+
"additionalProperties": false
|
|
1581
|
+
},
|
|
1582
|
+
{
|
|
1583
|
+
"type": "number"
|
|
1584
|
+
}
|
|
1585
|
+
]
|
|
1586
|
+
},
|
|
1587
|
+
"month": {
|
|
1588
|
+
"anyOf": [
|
|
1589
|
+
{
|
|
1590
|
+
"type": "object",
|
|
1591
|
+
"properties": {
|
|
1592
|
+
"each": {
|
|
1593
|
+
"type": "number"
|
|
1594
|
+
}
|
|
1595
|
+
},
|
|
1596
|
+
"additionalProperties": false
|
|
1597
|
+
},
|
|
1598
|
+
{
|
|
1599
|
+
"type": "number"
|
|
1600
|
+
}
|
|
1601
|
+
]
|
|
1602
|
+
},
|
|
1603
|
+
"weekDay": {
|
|
1604
|
+
"anyOf": [
|
|
1605
|
+
{
|
|
1606
|
+
"type": "object",
|
|
1607
|
+
"properties": {
|
|
1608
|
+
"each": {
|
|
1609
|
+
"type": "number"
|
|
1610
|
+
}
|
|
1611
|
+
},
|
|
1612
|
+
"additionalProperties": false
|
|
1613
|
+
},
|
|
1614
|
+
{
|
|
1615
|
+
"type": "number"
|
|
1616
|
+
}
|
|
1617
|
+
]
|
|
1618
|
+
}
|
|
1619
|
+
},
|
|
1620
|
+
"additionalProperties": false
|
|
1621
|
+
},
|
|
1622
|
+
{
|
|
1623
|
+
"type": "string"
|
|
1624
|
+
}
|
|
1625
|
+
]
|
|
1442
1626
|
},
|
|
1443
1627
|
"name": {
|
|
1444
1628
|
"type": "string",
|
|
@@ -1468,10 +1652,172 @@
|
|
|
1468
1652
|
},
|
|
1469
1653
|
"additionalProperties": false
|
|
1470
1654
|
}
|
|
1471
|
-
}
|
|
1472
|
-
|
|
1655
|
+
}
|
|
1656
|
+
},
|
|
1657
|
+
{
|
|
1658
|
+
"additionalProperties": false,
|
|
1659
|
+
"type": "object",
|
|
1660
|
+
"properties": {
|
|
1661
|
+
"schedule": {
|
|
1662
|
+
"anyOf": [
|
|
1663
|
+
{
|
|
1664
|
+
"type": "object",
|
|
1665
|
+
"properties": {
|
|
1666
|
+
"minute": {
|
|
1667
|
+
"anyOf": [
|
|
1668
|
+
{
|
|
1669
|
+
"type": "object",
|
|
1670
|
+
"properties": {
|
|
1671
|
+
"each": {
|
|
1672
|
+
"type": "number"
|
|
1673
|
+
}
|
|
1674
|
+
},
|
|
1675
|
+
"additionalProperties": false
|
|
1676
|
+
},
|
|
1677
|
+
{
|
|
1678
|
+
"type": "number"
|
|
1679
|
+
}
|
|
1680
|
+
]
|
|
1681
|
+
},
|
|
1682
|
+
"hour": {
|
|
1683
|
+
"anyOf": [
|
|
1684
|
+
{
|
|
1685
|
+
"type": "object",
|
|
1686
|
+
"properties": {
|
|
1687
|
+
"each": {
|
|
1688
|
+
"type": "number"
|
|
1689
|
+
}
|
|
1690
|
+
},
|
|
1691
|
+
"additionalProperties": false
|
|
1692
|
+
},
|
|
1693
|
+
{
|
|
1694
|
+
"type": "number"
|
|
1695
|
+
}
|
|
1696
|
+
]
|
|
1697
|
+
},
|
|
1698
|
+
"day": {
|
|
1699
|
+
"anyOf": [
|
|
1700
|
+
{
|
|
1701
|
+
"type": "object",
|
|
1702
|
+
"properties": {
|
|
1703
|
+
"each": {
|
|
1704
|
+
"type": "number"
|
|
1705
|
+
}
|
|
1706
|
+
},
|
|
1707
|
+
"additionalProperties": false
|
|
1708
|
+
},
|
|
1709
|
+
{
|
|
1710
|
+
"type": "number"
|
|
1711
|
+
}
|
|
1712
|
+
]
|
|
1713
|
+
},
|
|
1714
|
+
"month": {
|
|
1715
|
+
"anyOf": [
|
|
1716
|
+
{
|
|
1717
|
+
"type": "object",
|
|
1718
|
+
"properties": {
|
|
1719
|
+
"each": {
|
|
1720
|
+
"type": "number"
|
|
1721
|
+
}
|
|
1722
|
+
},
|
|
1723
|
+
"additionalProperties": false
|
|
1724
|
+
},
|
|
1725
|
+
{
|
|
1726
|
+
"type": "number"
|
|
1727
|
+
}
|
|
1728
|
+
]
|
|
1729
|
+
},
|
|
1730
|
+
"weekDay": {
|
|
1731
|
+
"anyOf": [
|
|
1732
|
+
{
|
|
1733
|
+
"type": "object",
|
|
1734
|
+
"properties": {
|
|
1735
|
+
"each": {
|
|
1736
|
+
"type": "number"
|
|
1737
|
+
}
|
|
1738
|
+
},
|
|
1739
|
+
"additionalProperties": false
|
|
1740
|
+
},
|
|
1741
|
+
{
|
|
1742
|
+
"type": "number"
|
|
1743
|
+
}
|
|
1744
|
+
]
|
|
1745
|
+
}
|
|
1746
|
+
},
|
|
1747
|
+
"additionalProperties": false
|
|
1748
|
+
},
|
|
1749
|
+
{
|
|
1750
|
+
"type": "string"
|
|
1751
|
+
}
|
|
1752
|
+
]
|
|
1753
|
+
},
|
|
1754
|
+
"name": {
|
|
1755
|
+
"type": "string",
|
|
1756
|
+
"const": "prune"
|
|
1757
|
+
},
|
|
1758
|
+
"options": {
|
|
1759
|
+
"$ref": "#/definitions/PruneCommandOptions"
|
|
1760
|
+
}
|
|
1761
|
+
}
|
|
1473
1762
|
}
|
|
1474
1763
|
]
|
|
1764
|
+
},
|
|
1765
|
+
"PruneCommandOptions": {
|
|
1766
|
+
"additionalProperties": false,
|
|
1767
|
+
"type": "object",
|
|
1768
|
+
"properties": {
|
|
1769
|
+
"keepLast": {
|
|
1770
|
+
"type": "number"
|
|
1771
|
+
},
|
|
1772
|
+
"keepMinutely": {
|
|
1773
|
+
"type": "number"
|
|
1774
|
+
},
|
|
1775
|
+
"keepHourly": {
|
|
1776
|
+
"type": "number"
|
|
1777
|
+
},
|
|
1778
|
+
"keepDaily": {
|
|
1779
|
+
"type": "number"
|
|
1780
|
+
},
|
|
1781
|
+
"keepWeekly": {
|
|
1782
|
+
"type": "number"
|
|
1783
|
+
},
|
|
1784
|
+
"keepMonthly": {
|
|
1785
|
+
"type": "number"
|
|
1786
|
+
},
|
|
1787
|
+
"keepYearly": {
|
|
1788
|
+
"type": "number"
|
|
1789
|
+
},
|
|
1790
|
+
"id": {
|
|
1791
|
+
"type": "string"
|
|
1792
|
+
},
|
|
1793
|
+
"longId": {
|
|
1794
|
+
"type": "boolean"
|
|
1795
|
+
},
|
|
1796
|
+
"package": {
|
|
1797
|
+
"type": "string"
|
|
1798
|
+
},
|
|
1799
|
+
"repository": {
|
|
1800
|
+
"type": "string"
|
|
1801
|
+
},
|
|
1802
|
+
"repositoryType": {
|
|
1803
|
+
"type": "string"
|
|
1804
|
+
},
|
|
1805
|
+
"tag": {
|
|
1806
|
+
"type": "string"
|
|
1807
|
+
},
|
|
1808
|
+
"groupBy": {
|
|
1809
|
+
"type": "string"
|
|
1810
|
+
},
|
|
1811
|
+
"dryRun": {
|
|
1812
|
+
"type": "boolean"
|
|
1813
|
+
},
|
|
1814
|
+
"showAll": {
|
|
1815
|
+
"type": "boolean"
|
|
1816
|
+
},
|
|
1817
|
+
"confirm": {
|
|
1818
|
+
"type": "boolean"
|
|
1819
|
+
}
|
|
1820
|
+
}
|
|
1475
1821
|
}
|
|
1476
1822
|
},
|
|
1477
1823
|
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { PackageConfig } from "../Config/PackageConfig";
|
|
3
|
-
import { RepositoryConfig } from "../Config/RepositoryConfig";
|
|
4
|
-
import { PreSnapshot } from "../Repository/RepositoryAbstract";
|
|
1
|
+
import { PreSnapshot } from "../repositories/RepositoryAbstract";
|
|
5
2
|
import { DataFormat } from "../utils/DataFormat";
|
|
3
|
+
import type { Config, PackageConfig, RepositoryConfig } from "../utils/datatruck/config-type";
|
|
4
|
+
import { ReportListTaskContext } from "../utils/datatruck/report-list";
|
|
6
5
|
import { Listr3TaskResultEnd } from "../utils/list";
|
|
7
6
|
import { Progress, ProgressMode } from "../utils/progress";
|
|
8
7
|
import { Streams } from "../utils/stream";
|
|
@@ -32,22 +31,21 @@ type Context = {
|
|
|
32
31
|
backup: {
|
|
33
32
|
packageName: string;
|
|
34
33
|
repositoryName: string;
|
|
34
|
+
bytes: number;
|
|
35
35
|
};
|
|
36
36
|
cleanup: {};
|
|
37
37
|
copy: {
|
|
38
38
|
packageName: string;
|
|
39
39
|
repositoryName: string;
|
|
40
40
|
mirrorRepositoryName: string;
|
|
41
|
+
bytes: number;
|
|
41
42
|
};
|
|
42
43
|
prune: {
|
|
43
44
|
packageName: string;
|
|
44
45
|
total: number;
|
|
45
46
|
pruned: number;
|
|
46
47
|
};
|
|
47
|
-
|
|
48
|
-
type: string;
|
|
49
|
-
};
|
|
50
|
-
};
|
|
48
|
+
} & ReportListTaskContext;
|
|
51
49
|
export declare class BackupAction<TRequired extends boolean = true> {
|
|
52
50
|
readonly config: Config;
|
|
53
51
|
readonly options: IfRequireKeys<TRequired, BackupActionOptions>;
|
|
@@ -64,26 +62,22 @@ export declare class BackupAction<TRequired extends boolean = true> {
|
|
|
64
62
|
snapshotPath: string | undefined;
|
|
65
63
|
pkg: PackageConfig;
|
|
66
64
|
onProgress: (data: Progress) => void;
|
|
67
|
-
}): Promise<
|
|
65
|
+
}): Promise<{
|
|
66
|
+
bytes: number;
|
|
67
|
+
}>;
|
|
68
68
|
protected copy(data: {
|
|
69
69
|
repositoryName: string;
|
|
70
70
|
mirrorRepositoryName: string;
|
|
71
71
|
snapshot: PreSnapshot;
|
|
72
72
|
pkg: PackageConfig;
|
|
73
73
|
onProgress: (data: Progress) => void;
|
|
74
|
-
}): Promise<
|
|
74
|
+
}): Promise<{
|
|
75
|
+
bytes: number;
|
|
76
|
+
}>;
|
|
75
77
|
dataFormat(result: Listr3TaskResultEnd<Context>[], options?: {
|
|
76
78
|
streams?: Streams;
|
|
77
79
|
verbose?: number;
|
|
78
80
|
}): DataFormat;
|
|
79
|
-
exec(): Promise<(
|
|
80
|
-
key: "summary";
|
|
81
|
-
keyIndex?: string | undefined;
|
|
82
|
-
data: {
|
|
83
|
-
errors: number;
|
|
84
|
-
};
|
|
85
|
-
elapsed: number;
|
|
86
|
-
error?: Error | undefined;
|
|
87
|
-
} | import("../utils/list").Listr3TaskResult<Context>)[]>;
|
|
81
|
+
exec(): Promise<(import("../utils/list").List3SummaryResult | import("../utils/list").Listr3TaskResult<Context>)[]>;
|
|
88
82
|
}
|
|
89
83
|
export {};
|