@datatruck/cli 0.26.2 → 0.28.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/Action/BackupAction.d.ts +69 -34
- package/Action/BackupAction.js +284 -244
- package/Action/CleanCacheAction.d.ts +8 -4
- package/Action/CleanCacheAction.js +8 -5
- package/Action/ConfigAction.d.ts +12 -5
- package/Action/ConfigAction.js +14 -18
- package/Action/CopyAction.d.ts +49 -0
- package/Action/CopyAction.js +144 -0
- package/Action/InitAction.d.ts +3 -3
- package/Action/InitAction.js +9 -9
- package/Action/PruneAction.d.ts +9 -9
- package/Action/PruneAction.js +39 -23
- package/Action/RestoreAction.d.ts +48 -23
- package/Action/RestoreAction.js +158 -195
- package/Action/SnapshotsAction.d.ts +8 -8
- package/Action/SnapshotsAction.js +8 -8
- package/CHANGELOG.md +495 -0
- package/Command/BackupCommand.d.ts +6 -4
- package/Command/BackupCommand.js +9 -26
- package/Command/CleanCacheCommand.d.ts +4 -4
- package/Command/CleanCacheCommand.js +26 -5
- package/Command/CommandAbstract.d.ts +10 -7
- package/Command/CommandAbstract.js +4 -1
- package/Command/ConfigCommand.d.ts +6 -9
- package/Command/ConfigCommand.js +13 -8
- package/Command/CopyCommand.d.ts +15 -0
- package/Command/CopyCommand.js +61 -0
- package/Command/InitCommand.d.ts +4 -4
- package/Command/InitCommand.js +11 -15
- package/Command/PruneCommand.d.ts +3 -3
- package/Command/PruneCommand.js +13 -12
- package/Command/RestoreCommand.js +9 -17
- package/Command/SnapshotsCommand.d.ts +4 -4
- package/Command/SnapshotsCommand.js +16 -15
- package/Command/StartServerCommand.d.ts +6 -0
- package/Command/StartServerCommand.js +24 -0
- package/Config/Config.d.ts +11 -0
- package/Config/Config.js +43 -0
- package/Config/PrunePolicyConfig.d.ts +2 -2
- package/Factory/CommandFactory.d.ts +29 -33
- package/Factory/CommandFactory.js +32 -53
- package/Factory/RepositoryFactory.d.ts +1 -1
- package/Factory/RepositoryFactory.js +3 -3
- package/Factory/TaskFactory.d.ts +1 -1
- package/Factory/TaskFactory.js +3 -3
- package/Repository/DatatruckRepository.d.ts +17 -16
- package/Repository/DatatruckRepository.js +131 -149
- package/Repository/GitRepository.d.ts +9 -8
- package/Repository/GitRepository.js +22 -25
- package/Repository/RepositoryAbstract.d.ts +39 -37
- package/Repository/RepositoryAbstract.js +4 -5
- package/Repository/ResticRepository.d.ts +9 -8
- package/Repository/ResticRepository.js +30 -28
- package/Task/GitTask.d.ts +6 -7
- package/Task/GitTask.js +24 -30
- package/Task/MariadbTask.d.ts +4 -5
- package/Task/MariadbTask.js +26 -32
- package/Task/MssqlTask.d.ts +5 -3
- package/Task/MssqlTask.js +11 -12
- package/Task/MysqlDumpTask.d.ts +10 -3
- package/Task/MysqlDumpTask.js +107 -31
- package/Task/ScriptTask.d.ts +23 -18
- package/Task/ScriptTask.js +34 -24
- package/Task/SqlDumpTaskAbstract.d.ts +8 -3
- package/Task/SqlDumpTaskAbstract.js +31 -19
- package/Task/TaskAbstract.d.ts +24 -25
- package/Task/TaskAbstract.js +6 -10
- package/cli.js +14 -5
- package/config.schema.json +124 -3
- package/package.json +4 -5
- package/utils/DataFormat.d.ts +23 -12
- package/utils/DataFormat.js +36 -14
- package/utils/cli.d.ts +2 -9
- package/utils/cli.js +9 -52
- package/utils/datatruck/client.d.ts +24 -0
- package/utils/datatruck/client.js +99 -0
- package/utils/datatruck/config.d.ts +8 -6
- package/utils/datatruck/config.js +18 -3
- package/utils/datatruck/paths.d.ts +5 -9
- package/utils/datatruck/paths.js +2 -2
- package/utils/datatruck/server.d.ts +21 -0
- package/utils/datatruck/server.js +96 -0
- package/utils/datatruck/snapshot.d.ts +2 -2
- package/utils/date.d.ts +7 -3
- package/utils/date.js +22 -14
- package/utils/fs.d.ts +27 -15
- package/utils/fs.js +110 -62
- package/utils/http.d.ts +21 -0
- package/utils/http.js +154 -0
- package/utils/list.d.ts +64 -0
- package/utils/list.js +145 -0
- package/utils/mysql.d.ts +2 -0
- package/utils/mysql.js +21 -2
- package/utils/process.d.ts +1 -0
- package/utils/process.js +24 -31
- package/utils/progress.d.ts +33 -0
- package/utils/progress.js +113 -0
- package/utils/steps.d.ts +11 -0
- package/utils/steps.js +22 -10
- package/utils/stream.d.ts +7 -0
- package/utils/stream.js +10 -0
- package/utils/string.d.ts +0 -1
- package/utils/string.js +1 -13
- package/utils/tar.d.ts +10 -3
- package/utils/tar.js +70 -44
- package/utils/temp.d.ts +26 -0
- package/utils/temp.js +133 -0
- package/utils/virtual-fs.d.ts +37 -0
- package/utils/virtual-fs.js +65 -0
- package/Action/BackupSessionsAction.d.ts +0 -13
- package/Action/BackupSessionsAction.js +0 -18
- package/Action/RestoreSessionsAction.d.ts +0 -13
- package/Action/RestoreSessionsAction.js +0 -18
- package/Command/BackupSessionsCommand.d.ts +0 -12
- package/Command/BackupSessionsCommand.js +0 -92
- package/Command/RestoreSessionsCommand.d.ts +0 -12
- package/Command/RestoreSessionsCommand.js +0 -91
- package/Decorator/EntityDecorator.d.ts +0 -11
- package/Decorator/EntityDecorator.js +0 -17
- package/Entity/BackupSessionEntity.d.ts +0 -6
- package/Entity/BackupSessionEntity.js +0 -25
- package/Entity/BackupSessionRepositoryEntity.d.ts +0 -6
- package/Entity/BackupSessionRepositoryEntity.js +0 -25
- package/Entity/BackupSessionTaskEntity.d.ts +0 -5
- package/Entity/BackupSessionTaskEntity.js +0 -24
- package/Entity/CrudEntityAbstract.d.ts +0 -5
- package/Entity/CrudEntityAbstract.js +0 -9
- package/Entity/RestoreSessionEntity.d.ts +0 -5
- package/Entity/RestoreSessionEntity.js +0 -24
- package/Entity/RestoreSessionRepositoryEntity.d.ts +0 -6
- package/Entity/RestoreSessionRepositoryEntity.js +0 -25
- package/Entity/RestoreSessionTaskEntity.d.ts +0 -5
- package/Entity/RestoreSessionTaskEntity.js +0 -24
- package/Entity/StateEntityAbstract.d.ts +0 -9
- package/Entity/StateEntityAbstract.js +0 -12
- package/Factory/EntityFactory.d.ts +0 -6
- package/Factory/EntityFactory.js +0 -40
- package/SessionDriver/ConsoleSessionDriver.d.ts +0 -42
- package/SessionDriver/ConsoleSessionDriver.js +0 -208
- package/SessionDriver/SessionDriverAbstract.d.ts +0 -77
- package/SessionDriver/SessionDriverAbstract.js +0 -28
- package/SessionDriver/SqliteSessionDriver.d.ts +0 -20
- package/SessionDriver/SqliteSessionDriver.js +0 -173
- package/SessionManager/BackupSessionManager.d.ts +0 -45
- package/SessionManager/BackupSessionManager.js +0 -218
- package/SessionManager/RestoreSessionManager.d.ts +0 -47
- package/SessionManager/RestoreSessionManager.js +0 -218
- package/SessionManager/SessionManagerAbstract.d.ts +0 -18
- package/SessionManager/SessionManagerAbstract.js +0 -36
- package/migrations/001-initial.sql +0 -98
- package/utils/entity.d.ts +0 -4
- package/utils/entity.js +0 -10
package/Action/BackupAction.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import type { ConfigType } from "../Config/Config";
|
|
2
2
|
import { PackageConfigType } from "../Config/PackageConfig";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
3
|
+
import { PreSnapshot } from "../Repository/RepositoryAbstract";
|
|
4
|
+
import { DataFormat } from "../utils/DataFormat";
|
|
5
|
+
import { Listr3TaskResultEnd } from "../utils/list";
|
|
6
|
+
import { Progress, ProgressManager } from "../utils/progress";
|
|
7
|
+
import { Streams } from "../utils/stream";
|
|
7
8
|
import { IfRequireKeys } from "../utils/ts";
|
|
8
|
-
export type
|
|
9
|
+
export type BackupActionOptions = {
|
|
9
10
|
repositoryNames?: string[];
|
|
10
11
|
repositoryTypes?: string[];
|
|
11
12
|
packageNames?: string[];
|
|
@@ -14,36 +15,70 @@ export type BackupActionOptionsType = {
|
|
|
14
15
|
dryRun?: boolean;
|
|
15
16
|
verbose?: boolean;
|
|
16
17
|
date?: string;
|
|
18
|
+
tty?: "auto" | boolean;
|
|
19
|
+
progress?: "auto" | "interval" | boolean;
|
|
20
|
+
progressInterval?: number;
|
|
21
|
+
streams?: Streams;
|
|
22
|
+
};
|
|
23
|
+
type Context = {
|
|
24
|
+
snapshot: {
|
|
25
|
+
id: string;
|
|
26
|
+
};
|
|
27
|
+
task: {
|
|
28
|
+
taskName: string;
|
|
29
|
+
packageName: string;
|
|
30
|
+
};
|
|
31
|
+
backup: {
|
|
32
|
+
packageName: string;
|
|
33
|
+
repositoryName: string;
|
|
34
|
+
};
|
|
35
|
+
cleanup: {};
|
|
36
|
+
copy: {
|
|
37
|
+
packageName: string;
|
|
38
|
+
repositoryName: string;
|
|
39
|
+
mirrorRepositoryName: string;
|
|
40
|
+
};
|
|
41
|
+
report: {
|
|
42
|
+
type: string;
|
|
43
|
+
};
|
|
17
44
|
};
|
|
18
45
|
export declare class BackupAction<TRequired extends boolean = true> {
|
|
19
46
|
readonly config: ConfigType;
|
|
20
|
-
readonly options: IfRequireKeys<TRequired,
|
|
21
|
-
protected
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
protected
|
|
25
|
-
protected
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
protected backup(
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
readonly options: IfRequireKeys<TRequired, BackupActionOptions>;
|
|
48
|
+
protected pm: ProgressManager;
|
|
49
|
+
constructor(config: ConfigType, options?: IfRequireKeys<TRequired, BackupActionOptions>);
|
|
50
|
+
protected prepareSnapshot(): PreSnapshot;
|
|
51
|
+
protected getPackages(snapshot: PreSnapshot): PackageConfigType[];
|
|
52
|
+
protected getRepositoryNames(repositoryNames: string[]): {
|
|
53
|
+
name: string;
|
|
54
|
+
mirrors: string[];
|
|
55
|
+
}[];
|
|
56
|
+
protected backup(data: {
|
|
57
|
+
repositoryName: string;
|
|
58
|
+
snapshot: PreSnapshot;
|
|
59
|
+
snapshotPath: string | undefined;
|
|
60
|
+
pkg: PackageConfigType;
|
|
61
|
+
onProgress: (data: Progress) => void;
|
|
62
|
+
}): Promise<void>;
|
|
63
|
+
protected copy(data: {
|
|
64
|
+
repositoryName: string;
|
|
65
|
+
mirrorRepositoryName: string;
|
|
66
|
+
snapshot: PreSnapshot;
|
|
67
|
+
pkg: PackageConfigType;
|
|
68
|
+
onProgress: (data: Progress) => void;
|
|
69
|
+
}): Promise<void>;
|
|
70
|
+
dataFormat(result: Listr3TaskResultEnd<Context>[], options?: {
|
|
71
|
+
streams?: Streams;
|
|
72
|
+
verbose?: number;
|
|
73
|
+
}): DataFormat;
|
|
74
|
+
exec(): Promise<({
|
|
75
|
+
key: "summary";
|
|
76
|
+
keyIndex?: string | undefined;
|
|
77
|
+
data: {
|
|
78
|
+
errors: number;
|
|
79
|
+
};
|
|
80
|
+
elapsed: number;
|
|
81
|
+
error?: Error | undefined;
|
|
82
|
+
} | import("../utils/list").Listr3TaskResult<Context>)[]>;
|
|
49
83
|
}
|
|
84
|
+
export {};
|