@datatruck/cli 0.40.1 → 0.40.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/actions/BackupAction.js +19 -12
- package/lib/actions/CopyAction.js +20 -12
- package/lib/actions/ExportAction.js +12 -5
- package/lib/actions/RestoreAction.js +12 -5
- package/lib/cli.js +2 -3
- package/lib/repositories/ResticRepository.d.ts +2 -2
- package/lib/tasks/MysqlDumpTask.js +12 -5
- package/lib/tasks/ScriptTask.js +2 -2
- package/lib/utils/async-process.d.ts +0 -5
- package/lib/utils/async.d.ts +0 -1
- package/lib/utils/async.js +1 -2
- package/lib/utils/bytes.js +2 -3
- package/lib/utils/cli.d.ts +0 -1
- package/lib/utils/cli.js +12 -12
- package/lib/utils/cron.js +1 -2
- package/lib/utils/crypto.js +2 -3
- package/lib/utils/datatruck/client.js +3 -3
- package/lib/utils/datatruck/command.js +3 -3
- package/lib/utils/datatruck/config.js +15 -15
- package/lib/utils/datatruck/cron-server.js +1 -2
- package/lib/utils/datatruck/job.js +4 -5
- package/lib/utils/datatruck/paths.js +2 -3
- package/lib/utils/datatruck/report-list.js +1 -2
- package/lib/utils/datatruck/repository-server.d.ts +0 -1
- package/lib/utils/datatruck/repository-server.js +2 -2
- package/lib/utils/datatruck/repository.js +4 -5
- package/lib/utils/datatruck/snapshot.js +1 -2
- package/lib/utils/datatruck/task.js +1 -2
- package/lib/utils/date.js +4 -5
- package/lib/utils/exit.js +4 -5
- package/lib/utils/fs.d.ts +0 -3
- package/lib/utils/fs.js +40 -40
- package/lib/utils/git.d.ts +1 -1
- package/lib/utils/http.d.ts +0 -1
- package/lib/utils/http.js +11 -11
- package/lib/utils/list.d.ts +2 -2
- package/lib/utils/list.js +36 -26
- package/lib/utils/logs.js +3 -3
- package/lib/utils/math.js +2 -2
- package/lib/utils/mongodb.js +2 -3
- package/lib/utils/mysql.d.ts +0 -1
- package/lib/utils/mysql.js +2 -3
- package/lib/utils/object.js +6 -6
- package/lib/utils/options.js +2 -3
- package/lib/utils/process.d.ts +0 -1
- package/lib/utils/process.js +3 -4
- package/lib/utils/progress.d.ts +0 -2
- package/lib/utils/progress.js +3 -3
- package/lib/utils/reportSteps.js +2 -3
- package/lib/utils/spawnSteps.js +2 -3
- package/lib/utils/stream.d.ts +0 -1
- package/lib/utils/stream.js +2 -3
- package/lib/utils/string.js +11 -12
- package/lib/utils/tar.js +6 -7
- package/lib/utils/temp.d.ts +0 -1
- package/lib/utils/temp.js +10 -10
- package/lib/utils/virtual-fs.js +2 -2
- package/lib/utils/watcher.js +1 -2
- package/package.json +14 -14
package/lib/utils/temp.js
CHANGED
|
@@ -3,7 +3,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.GargabeCollector = exports.
|
|
6
|
+
exports.GargabeCollector = exports.collectors = void 0;
|
|
7
|
+
exports.parentTmpDir = parentTmpDir;
|
|
8
|
+
exports.sessionTmpDir = sessionTmpDir;
|
|
9
|
+
exports.ensureFreeDiskTempSpace = ensureFreeDiskTempSpace;
|
|
10
|
+
exports.isTmpDir = isTmpDir;
|
|
11
|
+
exports.rmTmpDir = rmTmpDir;
|
|
12
|
+
exports.tmpDir = tmpDir;
|
|
13
|
+
exports.mkTmpDir = mkTmpDir;
|
|
14
|
+
exports.useTempDir = useTempDir;
|
|
15
|
+
exports.useTempFile = useTempFile;
|
|
7
16
|
const globalData_1 = __importDefault(require("../globalData"));
|
|
8
17
|
const fs_1 = require("./fs");
|
|
9
18
|
const crypto_1 = require("crypto");
|
|
@@ -14,21 +23,17 @@ Symbol.asyncDispose ??= Symbol("Symbol.asyncDispose");
|
|
|
14
23
|
function parentTmpDir() {
|
|
15
24
|
return (0, path_1.join)(globalData_1.default.tempDir, "datatruck-temp");
|
|
16
25
|
}
|
|
17
|
-
exports.parentTmpDir = parentTmpDir;
|
|
18
26
|
function sessionTmpDir() {
|
|
19
27
|
return (0, path_1.join)(parentTmpDir(), process.pid.toString());
|
|
20
28
|
}
|
|
21
|
-
exports.sessionTmpDir = sessionTmpDir;
|
|
22
29
|
async function ensureFreeDiskTempSpace(size) {
|
|
23
30
|
const path = sessionTmpDir();
|
|
24
31
|
await (0, fs_1.mkdirIfNotExists)(sessionTmpDir());
|
|
25
32
|
await (0, fs_1.ensureFreeDiskSpace)([path], size);
|
|
26
33
|
}
|
|
27
|
-
exports.ensureFreeDiskTempSpace = ensureFreeDiskTempSpace;
|
|
28
34
|
function isTmpDir(path) {
|
|
29
35
|
return path.startsWith(sessionTmpDir()) && path.includes("datatruck-temp");
|
|
30
36
|
}
|
|
31
|
-
exports.isTmpDir = isTmpDir;
|
|
32
37
|
async function rmTmpDir(input) {
|
|
33
38
|
if (typeof input === "string") {
|
|
34
39
|
if (!isTmpDir(input))
|
|
@@ -40,7 +45,6 @@ async function rmTmpDir(input) {
|
|
|
40
45
|
await rmTmpDir(path);
|
|
41
46
|
}
|
|
42
47
|
}
|
|
43
|
-
exports.rmTmpDir = rmTmpDir;
|
|
44
48
|
function tmpDir(...keys) {
|
|
45
49
|
const id = (0, crypto_1.randomUUID)().slice(0, 8);
|
|
46
50
|
const path = (0, path_1.join)(sessionTmpDir(), [...keys, id].map(encodeURIComponent).join("-"));
|
|
@@ -51,14 +55,12 @@ function tmpDir(...keys) {
|
|
|
51
55
|
}
|
|
52
56
|
return path;
|
|
53
57
|
}
|
|
54
|
-
exports.tmpDir = tmpDir;
|
|
55
58
|
exports.collectors = new Set();
|
|
56
59
|
async function mkTmpDir(...keys) {
|
|
57
60
|
const path = tmpDir(...keys);
|
|
58
61
|
await (0, promises_1.mkdir)(path, { recursive: true });
|
|
59
62
|
return path;
|
|
60
63
|
}
|
|
61
|
-
exports.mkTmpDir = mkTmpDir;
|
|
62
64
|
async function useTempDir(...keys) {
|
|
63
65
|
const path = await mkTmpDir(...keys);
|
|
64
66
|
return {
|
|
@@ -71,7 +73,6 @@ async function useTempDir(...keys) {
|
|
|
71
73
|
},
|
|
72
74
|
};
|
|
73
75
|
}
|
|
74
|
-
exports.useTempDir = useTempDir;
|
|
75
76
|
function useTempFile(path) {
|
|
76
77
|
return {
|
|
77
78
|
path,
|
|
@@ -83,7 +84,6 @@ function useTempFile(path) {
|
|
|
83
84
|
},
|
|
84
85
|
};
|
|
85
86
|
}
|
|
86
|
-
exports.useTempFile = useTempFile;
|
|
87
87
|
class GargabeCollector {
|
|
88
88
|
parent;
|
|
89
89
|
paths = new Set();
|
package/lib/utils/virtual-fs.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LocalFs = exports.AbstractFs =
|
|
3
|
+
exports.LocalFs = exports.AbstractFs = void 0;
|
|
4
|
+
exports.resolvePath = resolvePath;
|
|
4
5
|
const fs_1 = require("./fs");
|
|
5
6
|
const promises_1 = require("fs/promises");
|
|
6
7
|
const path_1 = require("path");
|
|
@@ -8,7 +9,6 @@ function resolvePath(path) {
|
|
|
8
9
|
const { pathname } = new URL(`file:///${path}`);
|
|
9
10
|
return pathname;
|
|
10
11
|
}
|
|
11
|
-
exports.resolvePath = resolvePath;
|
|
12
12
|
class AbstractFs {
|
|
13
13
|
options;
|
|
14
14
|
constructor(options) {
|
package/lib/utils/watcher.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createWatcher =
|
|
3
|
+
exports.createWatcher = createWatcher;
|
|
4
4
|
function createWatcher(options) {
|
|
5
5
|
let prev;
|
|
6
6
|
let interval;
|
|
@@ -31,4 +31,3 @@ function createWatcher(options) {
|
|
|
31
31
|
},
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
|
-
exports.createWatcher = createWatcher;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datatruck/cli",
|
|
3
|
-
"version": "0.40.
|
|
3
|
+
"version": "0.40.2",
|
|
4
4
|
"description": "Tool for creating and managing backups",
|
|
5
5
|
"homepage": "https://github.com/swordev/datatruck#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -27,26 +27,26 @@
|
|
|
27
27
|
],
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@supercharge/promise-pool": "^3.2.0",
|
|
30
|
-
"ajv": "^8.
|
|
31
|
-
"async": "^3.2.
|
|
30
|
+
"ajv": "^8.17.1",
|
|
31
|
+
"async": "^3.2.6",
|
|
32
32
|
"chalk": "^4.1.2",
|
|
33
|
-
"commander": "^12.
|
|
34
|
-
"croner": "^8.
|
|
35
|
-
"dayjs": "^1.11.
|
|
33
|
+
"commander": "^12.1.0",
|
|
34
|
+
"croner": "^8.1.1",
|
|
35
|
+
"dayjs": "^1.11.13",
|
|
36
36
|
"fast-folder-size": "^2.2.0",
|
|
37
37
|
"fast-glob": "^3.3.2",
|
|
38
|
-
"listr2": "^8.2.
|
|
39
|
-
"micromatch": "^4.0.
|
|
40
|
-
"mongodb": "^6.
|
|
41
|
-
"mysql2": "^3.
|
|
38
|
+
"listr2": "^8.2.4",
|
|
39
|
+
"micromatch": "^4.0.8",
|
|
40
|
+
"mongodb": "^6.9.0",
|
|
41
|
+
"mysql2": "^3.11.3",
|
|
42
42
|
"tty-table": "^4.2.3",
|
|
43
|
-
"undici": "^6.
|
|
44
|
-
"yaml": "^2.
|
|
43
|
+
"undici": "^6.19.8",
|
|
44
|
+
"yaml": "^2.5.1"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@types/async": "^3.2.24",
|
|
48
|
-
"@types/micromatch": "^4.0.
|
|
49
|
-
"mongodb-memory-server": "^
|
|
48
|
+
"@types/micromatch": "^4.0.9",
|
|
49
|
+
"mongodb-memory-server": "^10.0.1"
|
|
50
50
|
},
|
|
51
51
|
"optionalDependencies": {
|
|
52
52
|
"ts-node": "^10.9.2"
|