@datatruck/cli 0.37.0 → 0.38.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/config.schema.json +130 -74
- package/lib/actions/BackupAction.d.ts +55 -19
- package/lib/actions/BackupAction.js +31 -7
- package/lib/actions/CleanCacheAction.d.ts +6 -7
- package/lib/actions/CleanCacheAction.js +2 -1
- package/lib/actions/ConfigAction.d.ts +3 -5
- package/lib/actions/ConfigAction.js +0 -1
- package/lib/actions/CopyAction.d.ts +37 -11
- package/lib/actions/CopyAction.js +29 -2
- package/lib/actions/ExportAction.d.ts +94 -0
- package/lib/actions/ExportAction.js +236 -0
- package/lib/actions/InitAction.d.ts +17 -7
- package/lib/actions/InitAction.js +9 -1
- package/lib/actions/PruneAction.d.ts +76 -17
- package/lib/actions/PruneAction.js +62 -2
- package/lib/actions/RestoreAction.d.ts +55 -21
- package/lib/actions/RestoreAction.js +44 -56
- package/lib/actions/SnapshotsAction.d.ts +80 -21
- package/lib/actions/SnapshotsAction.js +82 -1
- package/lib/cli.d.ts +0 -3
- package/lib/cli.js +14 -93
- package/lib/commands/BackupCommand.d.ts +120 -13
- package/lib/commands/BackupCommand.js +22 -50
- package/lib/commands/CleanCacheCommand.d.ts +10 -3
- package/lib/commands/CleanCacheCommand.js +14 -6
- package/lib/commands/CommandAbstract.d.ts +10 -10
- package/lib/commands/CommandAbstract.js +6 -9
- package/lib/commands/ConfigCommand.d.ts +72 -9
- package/lib/commands/ConfigCommand.js +36 -28
- package/lib/commands/CopyCommand.d.ts +102 -10
- package/lib/commands/CopyCommand.js +18 -40
- package/lib/commands/ExportCommand.d.ts +143 -0
- package/lib/commands/ExportCommand.js +50 -0
- package/lib/commands/InitCommand.d.ts +42 -7
- package/lib/commands/InitCommand.js +15 -17
- package/lib/commands/PruneCommand.d.ts +237 -17
- package/lib/commands/PruneCommand.js +27 -99
- package/lib/commands/RestoreCommand.d.ts +126 -13
- package/lib/commands/RestoreCommand.js +20 -49
- package/lib/commands/RunCommand.d.ts +23 -4
- package/lib/commands/RunCommand.js +21 -12
- package/lib/commands/SnapshotsCommand.d.ts +240 -23
- package/lib/commands/SnapshotsCommand.js +23 -101
- package/lib/commands/StartServerCommand.d.ts +10 -3
- package/lib/commands/StartServerCommand.js +11 -3
- package/lib/repositories/DatatruckRepository.js +1 -1
- package/lib/repositories/GitRepository.js +5 -2
- package/lib/tasks/MssqlTask.js +1 -1
- package/lib/tasks/MysqlDumpTask.js +1 -1
- package/lib/tasks/SqlDumpTaskAbstract.js +2 -2
- package/lib/utils/cli.d.ts +0 -17
- package/lib/utils/cli.js +1 -47
- package/lib/utils/datatruck/command.d.ts +6 -5
- package/lib/utils/datatruck/command.js +9 -5
- package/lib/utils/datatruck/job.js +17 -12
- package/lib/utils/datatruck/repository.d.ts +1 -0
- package/lib/utils/datatruck/repository.js +8 -1
- package/lib/utils/git.d.ts +5 -1
- package/lib/utils/git.js +7 -3
- package/lib/utils/math.js +1 -1
- package/lib/utils/object.d.ts +5 -0
- package/lib/utils/object.js +10 -1
- package/lib/utils/options.d.ts +24 -0
- package/lib/utils/options.js +94 -0
- package/lib/utils/progress.js +1 -1
- package/lib/utils/restic.js +1 -1
- package/lib/utils/string.d.ts +2 -1
- package/lib/utils/string.js +5 -1
- package/lib/utils/watcher.js +1 -1
- package/package.json +4 -4
|
@@ -1,68 +1,40 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BackupCommand = void 0;
|
|
3
|
+
exports.BackupCommand = exports.backupCommandOptions = void 0;
|
|
4
4
|
const BackupAction_1 = require("../actions/BackupAction");
|
|
5
5
|
const ConfigAction_1 = require("../actions/ConfigAction");
|
|
6
|
-
const string_1 = require("../utils/string");
|
|
7
6
|
const CommandAbstract_1 = require("./CommandAbstract");
|
|
7
|
+
exports.backupCommandOptions = {
|
|
8
|
+
...BackupAction_1.backupActionOptions,
|
|
9
|
+
};
|
|
8
10
|
class BackupCommand extends CommandAbstract_1.CommandAbstract {
|
|
9
|
-
|
|
10
|
-
return
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
parser: string_1.parseStringList,
|
|
19
|
-
},
|
|
20
|
-
packageTask: {
|
|
21
|
-
description: "Filter by package task names",
|
|
22
|
-
option: "-pt,--package-task <values>",
|
|
23
|
-
parser: string_1.parseStringList,
|
|
24
|
-
},
|
|
25
|
-
repository: {
|
|
26
|
-
description: "Filter by repository names",
|
|
27
|
-
option: "-r,--repository <values>",
|
|
28
|
-
parser: string_1.parseStringList,
|
|
29
|
-
},
|
|
30
|
-
repositoryType: {
|
|
31
|
-
description: "Filter by repository types",
|
|
32
|
-
option: "-rt,--repository-type <values>",
|
|
33
|
-
parser: (v) => (0, string_1.parseStringList)(v),
|
|
34
|
-
},
|
|
35
|
-
tag: {
|
|
36
|
-
description: "Filter by tags",
|
|
37
|
-
option: "-t,--tag <values>",
|
|
38
|
-
parser: string_1.parseStringList,
|
|
39
|
-
},
|
|
40
|
-
date: {
|
|
41
|
-
description: "Date time (ISO)",
|
|
42
|
-
option: "--date <value>",
|
|
43
|
-
},
|
|
44
|
-
prune: {
|
|
45
|
-
description: "Prune backups",
|
|
46
|
-
option: "--prune",
|
|
47
|
-
},
|
|
48
|
-
});
|
|
11
|
+
static config() {
|
|
12
|
+
return {
|
|
13
|
+
name: "backup",
|
|
14
|
+
alias: "b",
|
|
15
|
+
options: exports.backupCommandOptions,
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
get optionsConfig() {
|
|
19
|
+
return exports.backupCommandOptions;
|
|
49
20
|
}
|
|
50
21
|
async exec() {
|
|
51
22
|
const verbose = this.globalOptions.verbose ?? 0;
|
|
52
23
|
const config = await ConfigAction_1.ConfigAction.fromGlobalOptions(this.globalOptions);
|
|
53
24
|
const backup = new BackupAction_1.BackupAction(config, {
|
|
54
|
-
packageNames: this.options.
|
|
55
|
-
packageTaskNames: this.options.
|
|
56
|
-
repositoryNames: this.options.
|
|
57
|
-
repositoryTypes: this.options.
|
|
58
|
-
tags: this.options.
|
|
25
|
+
packageNames: this.options.packageNames,
|
|
26
|
+
packageTaskNames: this.options.packageTaskNames,
|
|
27
|
+
repositoryNames: this.options.repositoryNames,
|
|
28
|
+
repositoryTypes: this.options.repositoryTypes,
|
|
29
|
+
tags: this.options.tags,
|
|
59
30
|
dryRun: this.options.dryRun,
|
|
60
|
-
verbose: verbose > 0,
|
|
61
31
|
date: this.options.date,
|
|
62
|
-
|
|
32
|
+
prune: this.options.prune,
|
|
33
|
+
verbose: verbose > 0,
|
|
34
|
+
}, {
|
|
63
35
|
progress: this.globalOptions.progress,
|
|
64
36
|
streams: this.streams,
|
|
65
|
-
|
|
37
|
+
tty: this.globalOptions.tty,
|
|
66
38
|
});
|
|
67
39
|
const data = await backup.exec();
|
|
68
40
|
if (this.globalOptions.outputFormat)
|
|
@@ -1,7 +1,14 @@
|
|
|
1
|
+
import { InferOptions } from "../utils/options";
|
|
1
2
|
import { CommandAbstract } from "./CommandAbstract";
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
|
|
3
|
+
export declare const cleanCacheCommandOptions: {};
|
|
4
|
+
export type CleanCacheCommandOptions = InferOptions<typeof cleanCacheCommandOptions>;
|
|
5
|
+
export declare class CleanCacheCommand extends CommandAbstract<typeof cleanCacheCommandOptions> {
|
|
6
|
+
static config(): {
|
|
7
|
+
name: string;
|
|
8
|
+
alias: string;
|
|
9
|
+
options: {};
|
|
10
|
+
};
|
|
11
|
+
get optionsConfig(): {};
|
|
5
12
|
exec(): Promise<{
|
|
6
13
|
exitCode: number;
|
|
7
14
|
}>;
|
|
@@ -1,18 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CleanCacheCommand = void 0;
|
|
3
|
+
exports.CleanCacheCommand = exports.cleanCacheCommandOptions = void 0;
|
|
4
4
|
const CleanCacheAction_1 = require("../actions/CleanCacheAction");
|
|
5
5
|
const bytes_1 = require("../utils/bytes");
|
|
6
6
|
const data_format_1 = require("../utils/data-format");
|
|
7
7
|
const CommandAbstract_1 = require("./CommandAbstract");
|
|
8
|
+
exports.cleanCacheCommandOptions = {
|
|
9
|
+
...CleanCacheAction_1.cleanCacheActionOptions,
|
|
10
|
+
};
|
|
8
11
|
class CleanCacheCommand extends CommandAbstract_1.CommandAbstract {
|
|
9
|
-
|
|
10
|
-
return
|
|
12
|
+
static config() {
|
|
13
|
+
return {
|
|
14
|
+
name: "cleanCache",
|
|
15
|
+
alias: "cc",
|
|
16
|
+
options: exports.cleanCacheCommandOptions,
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
get optionsConfig() {
|
|
20
|
+
return exports.cleanCacheCommandOptions;
|
|
11
21
|
}
|
|
12
22
|
async exec() {
|
|
13
|
-
const cleanCache = new CleanCacheAction_1.CleanCacheAction({
|
|
14
|
-
verbose: !!this.globalOptions.verbose,
|
|
15
|
-
});
|
|
23
|
+
const cleanCache = new CleanCacheAction_1.CleanCacheAction({});
|
|
16
24
|
const result = await cleanCache.exec();
|
|
17
25
|
const dataFormat = new data_format_1.DataFormat({
|
|
18
26
|
streams: this.streams,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { OptionsConfig } from "../utils/cli";
|
|
2
1
|
import { DataFormatType } from "../utils/data-format";
|
|
3
2
|
import type { Config } from "../utils/datatruck/config-type";
|
|
3
|
+
import { CommandConfig, InferOptions, OptionsConfig } from "../utils/options";
|
|
4
4
|
import { ProgressMode } from "../utils/progress";
|
|
5
5
|
import { StdStreams } from "../utils/stream";
|
|
6
|
-
import { If
|
|
6
|
+
import { If } from "../utils/ts";
|
|
7
7
|
export type GlobalOptions<TResolved = false> = {
|
|
8
8
|
config: string | Config;
|
|
9
9
|
outputFormat?: DataFormatType;
|
|
@@ -11,18 +11,18 @@ export type GlobalOptions<TResolved = false> = {
|
|
|
11
11
|
tty?: If<TResolved, "auto" | boolean, "auto" | "true" | "false">;
|
|
12
12
|
progress?: If<TResolved, ProgressMode, Exclude<ProgressMode, boolean> | "true" | "false">;
|
|
13
13
|
};
|
|
14
|
-
export type CommandConstructor<
|
|
15
|
-
new (globalOptions: GlobalOptions<true>, options:
|
|
14
|
+
export type CommandConstructor<T extends OptionsConfig = OptionsConfig> = {
|
|
15
|
+
new (globalOptions: GlobalOptions<true>, options: InferOptions<T>, streams?: Partial<StdStreams>, configPath?: string): CommandAbstract<T>;
|
|
16
|
+
config(): CommandConfig;
|
|
16
17
|
};
|
|
17
|
-
export declare abstract class CommandAbstract<
|
|
18
|
+
export declare abstract class CommandAbstract<T extends OptionsConfig = OptionsConfig> {
|
|
18
19
|
readonly globalOptions: GlobalOptions<true>;
|
|
19
|
-
readonly
|
|
20
|
+
readonly options: InferOptions<T>;
|
|
20
21
|
readonly configPath?: string | undefined;
|
|
21
|
-
readonly options: TOptions;
|
|
22
22
|
readonly streams: StdStreams;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
abstract optionsConfig: T;
|
|
24
|
+
static config(): CommandConfig;
|
|
25
|
+
constructor(globalOptions: GlobalOptions<true>, options: InferOptions<T>, streams?: Partial<StdStreams>, configPath?: string | undefined);
|
|
26
26
|
abstract exec(): Promise<{
|
|
27
27
|
exitCode: number;
|
|
28
28
|
result?: any;
|
|
@@ -1,23 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CommandAbstract = void 0;
|
|
4
|
-
const cli_1 = require("../utils/cli");
|
|
5
4
|
const stream_1 = require("../utils/stream");
|
|
6
5
|
class CommandAbstract {
|
|
7
6
|
globalOptions;
|
|
8
|
-
inputOptions;
|
|
9
|
-
configPath;
|
|
10
7
|
options;
|
|
8
|
+
configPath;
|
|
11
9
|
streams;
|
|
12
|
-
|
|
10
|
+
static config() {
|
|
11
|
+
throw new Error("Not implemented");
|
|
12
|
+
}
|
|
13
|
+
constructor(globalOptions, options, streams = {}, configPath) {
|
|
13
14
|
this.globalOptions = globalOptions;
|
|
14
|
-
this.
|
|
15
|
+
this.options = options;
|
|
15
16
|
this.configPath = configPath;
|
|
16
|
-
this.options = (0, cli_1.parseOptions)(inputOptions, this.optionsConfig());
|
|
17
17
|
this.streams = (0, stream_1.createStdStreams)(streams);
|
|
18
18
|
}
|
|
19
|
-
castOptionsConfig(options) {
|
|
20
|
-
return options;
|
|
21
|
-
}
|
|
22
19
|
}
|
|
23
20
|
exports.CommandAbstract = CommandAbstract;
|
|
@@ -1,14 +1,77 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { If } from "../utils/ts";
|
|
1
|
+
import { InferOptions } from "../utils/options";
|
|
3
2
|
import { CommandAbstract } from "./CommandAbstract";
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
export declare const configCommandOptions: {
|
|
4
|
+
packageNames: {
|
|
5
|
+
description: string;
|
|
6
|
+
shortFlag: string;
|
|
7
|
+
value: "array";
|
|
8
|
+
};
|
|
9
|
+
packageTaskNames: {
|
|
10
|
+
description: string;
|
|
11
|
+
shortFlag: string;
|
|
12
|
+
value: "array";
|
|
13
|
+
};
|
|
14
|
+
repositoryNames: {
|
|
15
|
+
description: string;
|
|
16
|
+
shortFlag: string;
|
|
17
|
+
value: "array";
|
|
18
|
+
};
|
|
19
|
+
repositoryTypes: {
|
|
20
|
+
description: string;
|
|
21
|
+
shortFlag: string;
|
|
22
|
+
value: (value: string | undefined, validValues?: ("git" | "restic" | "datatruck")[] | undefined, defaultsValues?: true | ("git" | "restic" | "datatruck")[] | undefined) => ("git" | "restic" | "datatruck")[];
|
|
23
|
+
};
|
|
9
24
|
};
|
|
10
|
-
export
|
|
11
|
-
|
|
25
|
+
export type ConfigCommandOptions = InferOptions<typeof configCommandOptions>;
|
|
26
|
+
export declare class ConfigCommand extends CommandAbstract<typeof configCommandOptions> {
|
|
27
|
+
static config(): {
|
|
28
|
+
name: string;
|
|
29
|
+
alias: string;
|
|
30
|
+
options: {
|
|
31
|
+
packageNames: {
|
|
32
|
+
description: string;
|
|
33
|
+
shortFlag: string;
|
|
34
|
+
value: "array";
|
|
35
|
+
};
|
|
36
|
+
packageTaskNames: {
|
|
37
|
+
description: string;
|
|
38
|
+
shortFlag: string;
|
|
39
|
+
value: "array";
|
|
40
|
+
};
|
|
41
|
+
repositoryNames: {
|
|
42
|
+
description: string;
|
|
43
|
+
shortFlag: string;
|
|
44
|
+
value: "array";
|
|
45
|
+
};
|
|
46
|
+
repositoryTypes: {
|
|
47
|
+
description: string;
|
|
48
|
+
shortFlag: string;
|
|
49
|
+
value: (value: string | undefined, validValues?: ("git" | "restic" | "datatruck")[] | undefined, defaultsValues?: true | ("git" | "restic" | "datatruck")[] | undefined) => ("git" | "restic" | "datatruck")[];
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
get optionsConfig(): {
|
|
54
|
+
packageNames: {
|
|
55
|
+
description: string;
|
|
56
|
+
shortFlag: string;
|
|
57
|
+
value: "array";
|
|
58
|
+
};
|
|
59
|
+
packageTaskNames: {
|
|
60
|
+
description: string;
|
|
61
|
+
shortFlag: string;
|
|
62
|
+
value: "array";
|
|
63
|
+
};
|
|
64
|
+
repositoryNames: {
|
|
65
|
+
description: string;
|
|
66
|
+
shortFlag: string;
|
|
67
|
+
value: "array";
|
|
68
|
+
};
|
|
69
|
+
repositoryTypes: {
|
|
70
|
+
description: string;
|
|
71
|
+
shortFlag: string;
|
|
72
|
+
value: (value: string | undefined, validValues?: ("git" | "restic" | "datatruck")[] | undefined, defaultsValues?: true | ("git" | "restic" | "datatruck")[] | undefined) => ("git" | "restic" | "datatruck")[];
|
|
73
|
+
};
|
|
74
|
+
};
|
|
12
75
|
exec(): Promise<{
|
|
13
76
|
result: {
|
|
14
77
|
path: string;
|
|
@@ -1,43 +1,51 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ConfigCommand = void 0;
|
|
3
|
+
exports.ConfigCommand = exports.configCommandOptions = void 0;
|
|
4
4
|
const ConfigAction_1 = require("../actions/ConfigAction");
|
|
5
5
|
const data_format_1 = require("../utils/data-format");
|
|
6
6
|
const config_1 = require("../utils/datatruck/config");
|
|
7
7
|
const string_1 = require("../utils/string");
|
|
8
8
|
const CommandAbstract_1 = require("./CommandAbstract");
|
|
9
|
+
exports.configCommandOptions = {
|
|
10
|
+
packageNames: {
|
|
11
|
+
description: "Filter by package names",
|
|
12
|
+
shortFlag: "p",
|
|
13
|
+
value: "array",
|
|
14
|
+
},
|
|
15
|
+
packageTaskNames: {
|
|
16
|
+
description: "Filter by package task names",
|
|
17
|
+
shortFlag: "pt",
|
|
18
|
+
value: "array",
|
|
19
|
+
},
|
|
20
|
+
repositoryNames: {
|
|
21
|
+
description: "Filter by repository names",
|
|
22
|
+
shortFlag: "r",
|
|
23
|
+
value: "array",
|
|
24
|
+
},
|
|
25
|
+
repositoryTypes: {
|
|
26
|
+
description: "Filter by repository types",
|
|
27
|
+
shortFlag: "rt",
|
|
28
|
+
value: (string_1.parseStringList),
|
|
29
|
+
},
|
|
30
|
+
};
|
|
9
31
|
class ConfigCommand extends CommandAbstract_1.CommandAbstract {
|
|
10
|
-
|
|
11
|
-
return
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
option: "-pt,--package-task <values>",
|
|
20
|
-
parser: string_1.parseStringList,
|
|
21
|
-
},
|
|
22
|
-
repository: {
|
|
23
|
-
description: "Filter by repository names",
|
|
24
|
-
option: "-r,--repository <values>",
|
|
25
|
-
parser: string_1.parseStringList,
|
|
26
|
-
},
|
|
27
|
-
repositoryType: {
|
|
28
|
-
description: "Filter by repository types",
|
|
29
|
-
option: "-rt,--repository-type <values>",
|
|
30
|
-
parser: (v) => (0, string_1.parseStringList)(v),
|
|
31
|
-
},
|
|
32
|
-
});
|
|
32
|
+
static config() {
|
|
33
|
+
return {
|
|
34
|
+
name: "config",
|
|
35
|
+
alias: "c",
|
|
36
|
+
options: exports.configCommandOptions,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
get optionsConfig() {
|
|
40
|
+
return exports.configCommandOptions;
|
|
33
41
|
}
|
|
34
42
|
async exec() {
|
|
35
43
|
const result = await ConfigAction_1.ConfigAction.fromGlobalOptionsWithPath(this.globalOptions);
|
|
36
44
|
const packages = (0, config_1.filterPackages)(result.data, {
|
|
37
|
-
packageNames: this.options.
|
|
38
|
-
packageTaskNames: this.options.
|
|
39
|
-
repositoryNames: this.options.
|
|
40
|
-
repositoryTypes: this.options.
|
|
45
|
+
packageNames: this.options.packageNames,
|
|
46
|
+
packageTaskNames: this.options.packageTaskNames,
|
|
47
|
+
repositoryNames: this.options.repositoryNames,
|
|
48
|
+
repositoryTypes: this.options.repositoryTypes,
|
|
41
49
|
});
|
|
42
50
|
const summaryConfig = packages.flatMap((pkg) => ({
|
|
43
51
|
packageName: pkg.name,
|
|
@@ -1,15 +1,107 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { InferOptions } from "../utils/options";
|
|
2
2
|
import { CommandAbstract } from "./CommandAbstract";
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
export declare const copyCommandOptions: {
|
|
4
|
+
repositoryNames2: {
|
|
5
|
+
description: string;
|
|
6
|
+
shortFlag: string;
|
|
7
|
+
value: "array";
|
|
8
|
+
};
|
|
9
|
+
packageNames: {
|
|
10
|
+
description: string;
|
|
11
|
+
shortFlag: string;
|
|
12
|
+
value: "array";
|
|
13
|
+
};
|
|
14
|
+
packageTaskNames: {
|
|
15
|
+
description: string;
|
|
16
|
+
shortFlag: string;
|
|
17
|
+
value: "array";
|
|
18
|
+
};
|
|
19
|
+
ids: {
|
|
20
|
+
description: string;
|
|
21
|
+
shortFlag: string;
|
|
22
|
+
value: "array";
|
|
23
|
+
};
|
|
24
|
+
last: {
|
|
25
|
+
description: string;
|
|
26
|
+
shortFlag: string;
|
|
27
|
+
value: "number";
|
|
28
|
+
};
|
|
29
|
+
repositoryName: {
|
|
30
|
+
description: string;
|
|
31
|
+
shortFlag: string;
|
|
32
|
+
required: true;
|
|
33
|
+
};
|
|
10
34
|
};
|
|
11
|
-
export
|
|
12
|
-
|
|
35
|
+
export type CopyCommandOptions = InferOptions<typeof copyCommandOptions>;
|
|
36
|
+
export declare class CopyCommand extends CommandAbstract<typeof copyCommandOptions> {
|
|
37
|
+
static config(): {
|
|
38
|
+
name: string;
|
|
39
|
+
alias: string;
|
|
40
|
+
options: {
|
|
41
|
+
repositoryNames2: {
|
|
42
|
+
description: string;
|
|
43
|
+
shortFlag: string;
|
|
44
|
+
value: "array";
|
|
45
|
+
};
|
|
46
|
+
packageNames: {
|
|
47
|
+
description: string;
|
|
48
|
+
shortFlag: string;
|
|
49
|
+
value: "array";
|
|
50
|
+
};
|
|
51
|
+
packageTaskNames: {
|
|
52
|
+
description: string;
|
|
53
|
+
shortFlag: string;
|
|
54
|
+
value: "array";
|
|
55
|
+
};
|
|
56
|
+
ids: {
|
|
57
|
+
description: string;
|
|
58
|
+
shortFlag: string;
|
|
59
|
+
value: "array";
|
|
60
|
+
};
|
|
61
|
+
last: {
|
|
62
|
+
description: string;
|
|
63
|
+
shortFlag: string;
|
|
64
|
+
value: "number";
|
|
65
|
+
};
|
|
66
|
+
repositoryName: {
|
|
67
|
+
description: string;
|
|
68
|
+
shortFlag: string;
|
|
69
|
+
required: true;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
get optionsConfig(): {
|
|
74
|
+
repositoryNames2: {
|
|
75
|
+
description: string;
|
|
76
|
+
shortFlag: string;
|
|
77
|
+
value: "array";
|
|
78
|
+
};
|
|
79
|
+
packageNames: {
|
|
80
|
+
description: string;
|
|
81
|
+
shortFlag: string;
|
|
82
|
+
value: "array";
|
|
83
|
+
};
|
|
84
|
+
packageTaskNames: {
|
|
85
|
+
description: string;
|
|
86
|
+
shortFlag: string;
|
|
87
|
+
value: "array";
|
|
88
|
+
};
|
|
89
|
+
ids: {
|
|
90
|
+
description: string;
|
|
91
|
+
shortFlag: string;
|
|
92
|
+
value: "array";
|
|
93
|
+
};
|
|
94
|
+
last: {
|
|
95
|
+
description: string;
|
|
96
|
+
shortFlag: string;
|
|
97
|
+
value: "number";
|
|
98
|
+
};
|
|
99
|
+
repositoryName: {
|
|
100
|
+
description: string;
|
|
101
|
+
shortFlag: string;
|
|
102
|
+
required: true;
|
|
103
|
+
};
|
|
104
|
+
};
|
|
13
105
|
exec(): Promise<{
|
|
14
106
|
result: (import("../utils/list").List3SummaryResult | import("../utils/list").Listr3TaskResult<import("../actions/CopyAction").Context>)[];
|
|
15
107
|
exitCode: number;
|
|
@@ -1,55 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CopyCommand = void 0;
|
|
3
|
+
exports.CopyCommand = exports.copyCommandOptions = void 0;
|
|
4
4
|
const ConfigAction_1 = require("../actions/ConfigAction");
|
|
5
5
|
const CopyAction_1 = require("../actions/CopyAction");
|
|
6
|
-
const string_1 = require("../utils/string");
|
|
7
6
|
const CommandAbstract_1 = require("./CommandAbstract");
|
|
7
|
+
exports.copyCommandOptions = {
|
|
8
|
+
...CopyAction_1.copyActionOptions,
|
|
9
|
+
};
|
|
8
10
|
class CopyCommand extends CommandAbstract_1.CommandAbstract {
|
|
9
|
-
|
|
10
|
-
return
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
description: "Last snapshots",
|
|
19
|
-
parser: Number,
|
|
20
|
-
},
|
|
21
|
-
package: {
|
|
22
|
-
option: "-p,--package <names>",
|
|
23
|
-
description: "Filter by package names",
|
|
24
|
-
parser: string_1.parseStringList,
|
|
25
|
-
},
|
|
26
|
-
packageTask: {
|
|
27
|
-
option: "-pt,--package-task <values>",
|
|
28
|
-
description: "Filter by task names",
|
|
29
|
-
parser: string_1.parseStringList,
|
|
30
|
-
},
|
|
31
|
-
repository: {
|
|
32
|
-
option: "-r,--repository <name>",
|
|
33
|
-
description: "Filter by repository name",
|
|
34
|
-
required: true,
|
|
35
|
-
},
|
|
36
|
-
repository2: {
|
|
37
|
-
option: "-r2,--repository2 <names>",
|
|
38
|
-
description: "Filter by repository names",
|
|
39
|
-
parser: string_1.parseStringList,
|
|
40
|
-
},
|
|
41
|
-
});
|
|
11
|
+
static config() {
|
|
12
|
+
return {
|
|
13
|
+
name: "copy",
|
|
14
|
+
alias: "cp",
|
|
15
|
+
options: exports.copyCommandOptions,
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
get optionsConfig() {
|
|
19
|
+
return exports.copyCommandOptions;
|
|
42
20
|
}
|
|
43
21
|
async exec() {
|
|
44
22
|
const verbose = this.globalOptions.verbose ?? 0;
|
|
45
23
|
const config = await ConfigAction_1.ConfigAction.fromGlobalOptions(this.globalOptions);
|
|
46
24
|
const copy = new CopyAction_1.CopyAction(config, {
|
|
47
|
-
ids: this.options.
|
|
25
|
+
ids: this.options.ids,
|
|
48
26
|
last: this.options.last,
|
|
49
|
-
packageNames: this.options.
|
|
50
|
-
packageTaskNames: this.options.
|
|
51
|
-
repositoryName: this.options.
|
|
52
|
-
repositoryNames2: this.options.
|
|
27
|
+
packageNames: this.options.packageNames,
|
|
28
|
+
packageTaskNames: this.options.packageTaskNames,
|
|
29
|
+
repositoryName: this.options.repositoryName,
|
|
30
|
+
repositoryNames2: this.options.repositoryNames2,
|
|
53
31
|
verbose: verbose > 0,
|
|
54
32
|
tty: this.globalOptions.tty,
|
|
55
33
|
progress: this.globalOptions.progress,
|