@datatruck/cli 0.29.1 → 0.30.1
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/Action/BackupAction.d.ts +2 -4
- package/Action/BackupAction.js +3 -11
- package/Action/CopyAction.d.ts +2 -2
- package/Action/CopyAction.js +1 -2
- package/Action/RestoreAction.d.ts +2 -3
- package/Action/RestoreAction.js +1 -2
- package/CHANGELOG.md +22 -0
- package/Command/BackupCommand.js +0 -1
- package/Command/CleanCacheCommand.js +2 -5
- package/Command/CommandAbstract.d.ts +2 -2
- package/Command/CopyCommand.js +0 -1
- package/Command/RestoreCommand.js +0 -1
- package/Command/SnapshotsCommand.js +2 -5
- package/Config/Config.js +22 -0
- package/Repository/DatatruckRepository.js +43 -15
- package/cli.js +6 -8
- package/config.schema.json +34 -0
- package/package.json +1 -2
- package/utils/bytes.d.ts +2 -0
- package/utils/bytes.js +29 -0
- package/utils/datatruck/client.d.ts +6 -1
- package/utils/datatruck/client.js +6 -5
- package/utils/datatruck/server.d.ts +10 -0
- package/utils/datatruck/server.js +30 -11
- package/utils/exit.d.ts +6 -0
- package/utils/exit.js +56 -0
- package/utils/fs.d.ts +3 -0
- package/utils/fs.js +24 -6
- package/utils/http.d.ts +2 -0
- package/utils/http.js +21 -2
- package/utils/list.d.ts +2 -0
- package/utils/list.js +18 -3
- package/utils/process.d.ts +1 -3
- package/utils/process.js +39 -54
- package/utils/progress.d.ts +23 -11
- package/utils/progress.js +25 -17
- package/utils/tar.d.ts +2 -6
- package/utils/virtual-fs.d.ts +7 -1
- package/utils/virtual-fs.js +3 -0
package/utils/virtual-fs.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { DiskStats } from "./fs";
|
|
2
|
+
import { BasicProgress } from "./progress";
|
|
2
3
|
export declare function resolvePath(path: string): string;
|
|
3
4
|
export type FsOptions = {
|
|
4
5
|
backend: string;
|
|
@@ -10,6 +11,7 @@ export declare abstract class AbstractFs {
|
|
|
10
11
|
abstract isLocal(): boolean;
|
|
11
12
|
isRemote(): boolean;
|
|
12
13
|
abstract existsDir(path: string): Promise<boolean>;
|
|
14
|
+
abstract rename(source: string, target: string): Promise<void>;
|
|
13
15
|
abstract mkdir(path: string): Promise<void>;
|
|
14
16
|
abstract readFile(path: string): Promise<string>;
|
|
15
17
|
abstract rmAll(path: string): Promise<void>;
|
|
@@ -18,12 +20,16 @@ export declare abstract class AbstractFs {
|
|
|
18
20
|
abstract ensureEmptyDir(path: string): Promise<void>;
|
|
19
21
|
abstract writeFile(path: string, contents: string): Promise<void>;
|
|
20
22
|
abstract upload(source: string, target: string): Promise<void>;
|
|
21
|
-
abstract download(source: string, target: string
|
|
23
|
+
abstract download(source: string, target: string, options?: {
|
|
24
|
+
timeout?: number;
|
|
25
|
+
onProgress?: (progress: BasicProgress) => void;
|
|
26
|
+
}): Promise<void>;
|
|
22
27
|
abstract fetchDiskStats(source: string): Promise<DiskStats>;
|
|
23
28
|
}
|
|
24
29
|
export declare class LocalFs extends AbstractFs {
|
|
25
30
|
isLocal(): boolean;
|
|
26
31
|
existsDir(path: string): Promise<boolean>;
|
|
32
|
+
rename(source: string, target: string): Promise<void>;
|
|
27
33
|
mkdir(path: string): Promise<void>;
|
|
28
34
|
ensureEmptyDir(path: string): Promise<void>;
|
|
29
35
|
readFile(path: string): Promise<string>;
|
package/utils/virtual-fs.js
CHANGED
|
@@ -29,6 +29,9 @@ class LocalFs extends AbstractFs {
|
|
|
29
29
|
async existsDir(path) {
|
|
30
30
|
return (0, fs_1.existsDir)(this.resolvePath(path));
|
|
31
31
|
}
|
|
32
|
+
async rename(source, target) {
|
|
33
|
+
await (0, promises_1.rename)(this.resolvePath(source), this.resolvePath(target));
|
|
34
|
+
}
|
|
32
35
|
async mkdir(path) {
|
|
33
36
|
await (0, fs_1.mkdirIfNotExists)(this.resolvePath(path));
|
|
34
37
|
}
|