@datatruck/cli 0.36.8 → 0.38.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.
Files changed (74) hide show
  1. package/config.schema.json +168 -108
  2. package/lib/actions/BackupAction.d.ts +61 -20
  3. package/lib/actions/BackupAction.js +43 -17
  4. package/lib/actions/CleanCacheAction.d.ts +6 -7
  5. package/lib/actions/CleanCacheAction.js +2 -1
  6. package/lib/actions/ConfigAction.d.ts +3 -5
  7. package/lib/actions/ConfigAction.js +0 -1
  8. package/lib/actions/CopyAction.d.ts +43 -12
  9. package/lib/actions/CopyAction.js +31 -4
  10. package/lib/actions/ExportAction.d.ts +94 -0
  11. package/lib/actions/ExportAction.js +236 -0
  12. package/lib/actions/InitAction.d.ts +17 -7
  13. package/lib/actions/InitAction.js +9 -1
  14. package/lib/actions/PruneAction.d.ts +76 -17
  15. package/lib/actions/PruneAction.js +62 -2
  16. package/lib/actions/RestoreAction.d.ts +61 -22
  17. package/lib/actions/RestoreAction.js +46 -58
  18. package/lib/actions/SnapshotsAction.d.ts +80 -21
  19. package/lib/actions/SnapshotsAction.js +82 -1
  20. package/lib/cli.d.ts +0 -3
  21. package/lib/cli.js +31 -56
  22. package/lib/commands/BackupCommand.d.ts +121 -13
  23. package/lib/commands/BackupCommand.js +29 -54
  24. package/lib/commands/CleanCacheCommand.d.ts +10 -3
  25. package/lib/commands/CleanCacheCommand.js +14 -6
  26. package/lib/commands/CommandAbstract.d.ts +11 -10
  27. package/lib/commands/CommandAbstract.js +6 -9
  28. package/lib/commands/ConfigCommand.d.ts +72 -9
  29. package/lib/commands/ConfigCommand.js +36 -28
  30. package/lib/commands/CopyCommand.d.ts +103 -10
  31. package/lib/commands/CopyCommand.js +25 -44
  32. package/lib/commands/ExportCommand.d.ts +143 -0
  33. package/lib/commands/ExportCommand.js +50 -0
  34. package/lib/commands/InitCommand.d.ts +43 -7
  35. package/lib/commands/InitCommand.js +22 -19
  36. package/lib/commands/PruneCommand.d.ts +237 -17
  37. package/lib/commands/PruneCommand.js +27 -99
  38. package/lib/commands/RestoreCommand.d.ts +127 -13
  39. package/lib/commands/RestoreCommand.js +27 -53
  40. package/lib/commands/RunCommand.d.ts +29 -0
  41. package/lib/commands/RunCommand.js +44 -0
  42. package/lib/commands/SnapshotsCommand.d.ts +240 -23
  43. package/lib/commands/SnapshotsCommand.js +23 -101
  44. package/lib/commands/StartServerCommand.d.ts +10 -3
  45. package/lib/commands/StartServerCommand.js +23 -15
  46. package/lib/repositories/DatatruckRepository.js +1 -1
  47. package/lib/tasks/MssqlTask.js +1 -1
  48. package/lib/tasks/MysqlDumpTask.js +1 -1
  49. package/lib/tasks/SqlDumpTaskAbstract.js +2 -2
  50. package/lib/utils/cli.d.ts +1 -18
  51. package/lib/utils/cli.js +9 -49
  52. package/lib/utils/datatruck/command.d.ts +8 -5
  53. package/lib/utils/datatruck/command.js +8 -4
  54. package/lib/utils/datatruck/config-type.d.ts +4 -0
  55. package/lib/utils/datatruck/cron-server.d.ts +8 -39
  56. package/lib/utils/datatruck/cron-server.js +35 -57
  57. package/lib/utils/datatruck/job.d.ts +41 -0
  58. package/lib/utils/datatruck/job.js +82 -0
  59. package/lib/utils/datatruck/report-list.js +1 -1
  60. package/lib/utils/datatruck/repository.d.ts +1 -0
  61. package/lib/utils/datatruck/repository.js +8 -1
  62. package/lib/utils/list.d.ts +5 -0
  63. package/lib/utils/list.js +9 -0
  64. package/lib/utils/math.js +1 -1
  65. package/lib/utils/object.d.ts +5 -0
  66. package/lib/utils/object.js +10 -1
  67. package/lib/utils/options.d.ts +24 -0
  68. package/lib/utils/options.js +94 -0
  69. package/lib/utils/progress.js +1 -1
  70. package/lib/utils/restic.js +1 -1
  71. package/lib/utils/string.d.ts +2 -1
  72. package/lib/utils/string.js +5 -1
  73. package/lib/utils/watcher.js +1 -1
  74. package/package.json +4 -4
@@ -1,22 +1,242 @@
1
- import { SnapshotGroupByType } from "../actions/SnapshotsAction";
2
- import type { RepositoryConfig } from "../utils/datatruck/config-type";
3
- import { KeepObject } from "../utils/date";
4
- import { If } from "../utils/ts";
1
+ import { InferOptions } from "../utils/options";
5
2
  import { CommandAbstract } from "./CommandAbstract";
6
- export type PruneCommandOptions<TResolved = false> = KeepObject & {
7
- id?: If<TResolved, string[]>;
8
- longId?: boolean;
9
- package?: If<TResolved, string[]>;
10
- repository?: If<TResolved, string[]>;
11
- repositoryType?: If<TResolved, RepositoryConfig["type"][]>;
12
- tag?: If<TResolved, string[]>;
13
- groupBy?: If<TResolved, SnapshotGroupByType[]>;
14
- dryRun?: boolean;
15
- showAll?: boolean;
16
- confirm?: boolean;
3
+ export declare const pruneCommandOptions: {
4
+ longId: {
5
+ description: string;
6
+ value: "boolean";
7
+ };
8
+ confirm: {
9
+ description: string;
10
+ value: "boolean";
11
+ };
12
+ groupBy: {
13
+ description: string;
14
+ shortFlag: string;
15
+ defaults: string;
16
+ value: (v: string) => ("packageName" | "repositoryName" | "repositoryType")[];
17
+ };
18
+ dryRun: {
19
+ description: string;
20
+ value: "boolean";
21
+ };
22
+ showAll: {
23
+ description: string;
24
+ shortFlag: string;
25
+ };
26
+ keepMinutely: {
27
+ description: string;
28
+ value: "number";
29
+ };
30
+ keepDaily: {
31
+ description: string;
32
+ value: "number";
33
+ };
34
+ keepHourly: {
35
+ description: string;
36
+ value: "number";
37
+ };
38
+ keepLast: {
39
+ description: string;
40
+ value: "number";
41
+ };
42
+ keepMonthly: {
43
+ description: string;
44
+ value: "number";
45
+ };
46
+ keepWeekly: {
47
+ description: string;
48
+ value: "number";
49
+ };
50
+ keepYearly: {
51
+ description: string;
52
+ value: "number";
53
+ };
54
+ repositoryNames: {
55
+ description: string;
56
+ shortFlag: string;
57
+ value: "array";
58
+ };
59
+ repositoryTypes: {
60
+ description: string;
61
+ shortFlag: string;
62
+ value: "array";
63
+ };
64
+ packageNames: {
65
+ description: string;
66
+ shortFlag: string;
67
+ value: "array";
68
+ };
69
+ tags: {
70
+ description: string;
71
+ shortFlag: string;
72
+ value: "array";
73
+ };
74
+ ids: {
75
+ description: string;
76
+ shortFlag: string;
77
+ value: "array";
78
+ };
17
79
  };
18
- export declare class PruneCommand extends CommandAbstract<PruneCommandOptions<false>, PruneCommandOptions<true>> {
19
- optionsConfig(): import("../utils/cli").OptionsConfig<PruneCommandOptions<false>, PruneCommandOptions<true>>;
80
+ export type PruneCommandOptions = InferOptions<typeof pruneCommandOptions>;
81
+ export declare class PruneCommand extends CommandAbstract<typeof pruneCommandOptions> {
82
+ static config(): {
83
+ name: string;
84
+ alias: string;
85
+ options: {
86
+ longId: {
87
+ description: string;
88
+ value: "boolean";
89
+ };
90
+ confirm: {
91
+ description: string;
92
+ value: "boolean";
93
+ };
94
+ groupBy: {
95
+ description: string;
96
+ shortFlag: string;
97
+ defaults: string;
98
+ value: (v: string) => ("packageName" | "repositoryName" | "repositoryType")[];
99
+ };
100
+ dryRun: {
101
+ description: string;
102
+ value: "boolean";
103
+ };
104
+ showAll: {
105
+ description: string;
106
+ shortFlag: string;
107
+ };
108
+ keepMinutely: {
109
+ description: string;
110
+ value: "number";
111
+ };
112
+ keepDaily: {
113
+ description: string;
114
+ value: "number";
115
+ };
116
+ keepHourly: {
117
+ description: string;
118
+ value: "number";
119
+ };
120
+ keepLast: {
121
+ description: string;
122
+ value: "number";
123
+ };
124
+ keepMonthly: {
125
+ description: string;
126
+ value: "number";
127
+ };
128
+ keepWeekly: {
129
+ description: string;
130
+ value: "number";
131
+ };
132
+ keepYearly: {
133
+ description: string;
134
+ value: "number";
135
+ };
136
+ repositoryNames: {
137
+ description: string;
138
+ shortFlag: string;
139
+ value: "array";
140
+ };
141
+ repositoryTypes: {
142
+ description: string;
143
+ shortFlag: string;
144
+ value: "array";
145
+ };
146
+ packageNames: {
147
+ description: string;
148
+ shortFlag: string;
149
+ value: "array";
150
+ };
151
+ tags: {
152
+ description: string;
153
+ shortFlag: string;
154
+ value: "array";
155
+ };
156
+ ids: {
157
+ description: string;
158
+ shortFlag: string;
159
+ value: "array";
160
+ };
161
+ };
162
+ };
163
+ get optionsConfig(): {
164
+ longId: {
165
+ description: string;
166
+ value: "boolean";
167
+ };
168
+ confirm: {
169
+ description: string;
170
+ value: "boolean";
171
+ };
172
+ groupBy: {
173
+ description: string;
174
+ shortFlag: string;
175
+ defaults: string;
176
+ value: (v: string) => ("packageName" | "repositoryName" | "repositoryType")[];
177
+ };
178
+ dryRun: {
179
+ description: string;
180
+ value: "boolean";
181
+ };
182
+ showAll: {
183
+ description: string;
184
+ shortFlag: string;
185
+ };
186
+ keepMinutely: {
187
+ description: string;
188
+ value: "number";
189
+ };
190
+ keepDaily: {
191
+ description: string;
192
+ value: "number";
193
+ };
194
+ keepHourly: {
195
+ description: string;
196
+ value: "number";
197
+ };
198
+ keepLast: {
199
+ description: string;
200
+ value: "number";
201
+ };
202
+ keepMonthly: {
203
+ description: string;
204
+ value: "number";
205
+ };
206
+ keepWeekly: {
207
+ description: string;
208
+ value: "number";
209
+ };
210
+ keepYearly: {
211
+ description: string;
212
+ value: "number";
213
+ };
214
+ repositoryNames: {
215
+ description: string;
216
+ shortFlag: string;
217
+ value: "array";
218
+ };
219
+ repositoryTypes: {
220
+ description: string;
221
+ shortFlag: string;
222
+ value: "array";
223
+ };
224
+ packageNames: {
225
+ description: string;
226
+ shortFlag: string;
227
+ value: "array";
228
+ };
229
+ tags: {
230
+ description: string;
231
+ shortFlag: string;
232
+ value: "array";
233
+ };
234
+ ids: {
235
+ description: string;
236
+ shortFlag: string;
237
+ value: "array";
238
+ };
239
+ };
20
240
  exec(): Promise<{
21
241
  result: import("../actions/PruneAction").PruneResult;
22
242
  exitCode: number;
@@ -1,112 +1,41 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PruneCommand = void 0;
3
+ exports.PruneCommand = exports.pruneCommandOptions = void 0;
4
4
  const ConfigAction_1 = require("../actions/ConfigAction");
5
5
  const PruneAction_1 = require("../actions/PruneAction");
6
6
  const cli_1 = require("../utils/cli");
7
7
  const data_format_1 = require("../utils/data-format");
8
- const string_1 = require("../utils/string");
9
8
  const CommandAbstract_1 = require("./CommandAbstract");
9
+ exports.pruneCommandOptions = {
10
+ ...PruneAction_1.pruneActionOptions,
11
+ longId: {
12
+ description: "Show long snapshot id",
13
+ value: "boolean",
14
+ },
15
+ confirm: {
16
+ description: "Confirm action",
17
+ value: "boolean",
18
+ },
19
+ };
10
20
  class PruneCommand extends CommandAbstract_1.CommandAbstract {
11
- optionsConfig() {
12
- return this.castOptionsConfig({
13
- dryRun: {
14
- description: "",
15
- option: "--dry-run",
16
- parser: undefined,
17
- },
18
- groupBy: {
19
- description: "Group by values (packageName, repositoryName, repositoryType)",
20
- option: "-g,--group-by <values>",
21
- defaults: "packageName, repositoryName",
22
- parser: (v) => (0, string_1.parseStringList)(v, [
23
- "packageName",
24
- "repositoryName",
25
- "repositoryType",
26
- ]),
27
- },
28
- id: {
29
- description: "Filter by snapshot id",
30
- option: "-i,--id <snapshotId>",
31
- parser: string_1.parseStringList,
32
- },
33
- keepMinutely: {
34
- description: "Keep last N minutely snapshots",
35
- option: "--keepMinutely <number>",
36
- parser: Number,
37
- },
38
- keepDaily: {
39
- description: "Keep last N daily snapshots",
40
- option: "--keepDaily <number>",
41
- parser: Number,
42
- },
43
- keepHourly: {
44
- description: "Keep last N hourly snapshots",
45
- option: "--keepHourly <number>",
46
- parser: Number,
47
- },
48
- keepLast: {
49
- description: "Keep last N snapshots",
50
- option: "--keepLast <number>",
51
- parser: Number,
52
- },
53
- keepMonthly: {
54
- description: "Keep last N monthly snapshots",
55
- option: "--keepMonthly <number>",
56
- parser: Number,
57
- },
58
- keepWeekly: {
59
- description: "Keep last N weekly snapshots",
60
- option: "--keepWeekly <number>",
61
- parser: Number,
62
- },
63
- keepYearly: {
64
- description: "Keep last N yearly snapshots",
65
- option: "--keepYearly <number>",
66
- parser: Number,
67
- },
68
- longId: {
69
- description: "Show long snapshot id",
70
- option: "--longId",
71
- },
72
- package: {
73
- description: "Filter by package names",
74
- option: "-p,--package <values>",
75
- parser: string_1.parseStringList,
76
- },
77
- repository: {
78
- description: "Filter by repository names",
79
- option: "-r,--repository <values>",
80
- parser: string_1.parseStringList,
81
- },
82
- repositoryType: {
83
- description: "Filter by repository types",
84
- option: "-rt,--repository-type <values>",
85
- parser: (v) => (0, string_1.parseStringList)(v),
86
- },
87
- tag: {
88
- description: "Filter by tags",
89
- option: "-t,--tag <values>",
90
- parser: string_1.parseStringList,
91
- },
92
- showAll: {
93
- description: "Show all",
94
- option: "-a,--showAll",
95
- },
96
- confirm: {
97
- description: "Confirm action",
98
- option: "--confirm",
99
- },
100
- });
21
+ static config() {
22
+ return {
23
+ name: "prune",
24
+ alias: "p",
25
+ options: exports.pruneCommandOptions,
26
+ };
27
+ }
28
+ get optionsConfig() {
29
+ return exports.pruneCommandOptions;
101
30
  }
102
31
  async exec() {
103
32
  const verbose = this.globalOptions.verbose ?? 0;
104
33
  const config = await ConfigAction_1.ConfigAction.fromGlobalOptions(this.globalOptions);
105
34
  const prune = new PruneAction_1.PruneAction(config, {
106
- ids: this.options.id,
107
- packageNames: this.options.package,
108
- repositoryNames: this.options.repository,
109
- repositoryTypes: this.options.repositoryType,
35
+ ids: this.options.ids,
36
+ packageNames: this.options.packageNames,
37
+ repositoryNames: this.options.repositoryNames,
38
+ repositoryTypes: this.options.repositoryTypes,
110
39
  verbose: verbose > 0,
111
40
  dryRun: this.options.dryRun || !this.options.confirm,
112
41
  groupBy: this.options.groupBy,
@@ -117,9 +46,8 @@ class PruneCommand extends CommandAbstract_1.CommandAbstract {
117
46
  keepMonthly: this.options.keepMonthly,
118
47
  keepWeekly: this.options.keepWeekly,
119
48
  keepYearly: this.options.keepYearly,
120
- tags: this.options.tag,
121
- longId: this.options.longId,
122
- returnsAll: this.options.showAll,
49
+ tags: this.options.tags,
50
+ showAll: this.options.showAll,
123
51
  });
124
52
  const result = await prune.exec();
125
53
  const dataFormat = new data_format_1.DataFormat({
@@ -1,18 +1,131 @@
1
- import type { RepositoryConfig } from "../utils/datatruck/config-type";
2
- import { If } from "../utils/ts";
1
+ import { InferOptions } from "../utils/options";
3
2
  import { CommandAbstract } from "./CommandAbstract";
4
- export type RestoreCommandOptions<TResolved = false> = {
5
- id: string;
6
- package?: If<TResolved, string[]>;
7
- packageTask?: If<TResolved, string[]>;
8
- packageConfig?: boolean;
9
- repository?: If<TResolved, string[]>;
10
- repositoryType?: If<TResolved, RepositoryConfig["type"][]>;
11
- tag?: If<TResolved, string[]>;
12
- initial?: boolean;
3
+ export declare const restoreCommandOptions: {
4
+ initial: {
5
+ description: string;
6
+ value: "boolean";
7
+ };
8
+ repositoryNames: {
9
+ description: string;
10
+ shortFlag: string;
11
+ value: "array";
12
+ };
13
+ repositoryTypes: {
14
+ description: string;
15
+ shortFlag: string;
16
+ value: "array";
17
+ };
18
+ packageNames: {
19
+ description: string;
20
+ shortFlag: string;
21
+ value: "array";
22
+ };
23
+ packageTaskNames: {
24
+ description: string;
25
+ shortFlag: string;
26
+ value: "array";
27
+ };
28
+ tags: {
29
+ description: string;
30
+ shortFlag: string;
31
+ value: "array";
32
+ };
33
+ packageConfig: {
34
+ description: string;
35
+ shortFlag: string;
36
+ };
37
+ id: {
38
+ description: string;
39
+ shortFlag: string;
40
+ required: true;
41
+ };
13
42
  };
14
- export declare class RestoreCommand extends CommandAbstract<RestoreCommandOptions<false>, RestoreCommandOptions<true>> {
15
- optionsConfig(): import("../utils/cli").OptionsConfig<RestoreCommandOptions<false>, RestoreCommandOptions<true>>;
43
+ export type RestoreCommandOptions = InferOptions<typeof restoreCommandOptions>;
44
+ export declare class RestoreCommand extends CommandAbstract<typeof restoreCommandOptions> {
45
+ static config(): {
46
+ name: string;
47
+ alias: string;
48
+ options: {
49
+ initial: {
50
+ description: string;
51
+ value: "boolean";
52
+ };
53
+ repositoryNames: {
54
+ description: string;
55
+ shortFlag: string;
56
+ value: "array";
57
+ };
58
+ repositoryTypes: {
59
+ description: string;
60
+ shortFlag: string;
61
+ value: "array";
62
+ };
63
+ packageNames: {
64
+ description: string;
65
+ shortFlag: string;
66
+ value: "array";
67
+ };
68
+ packageTaskNames: {
69
+ description: string;
70
+ shortFlag: string;
71
+ value: "array";
72
+ };
73
+ tags: {
74
+ description: string;
75
+ shortFlag: string;
76
+ value: "array";
77
+ };
78
+ packageConfig: {
79
+ description: string;
80
+ shortFlag: string;
81
+ };
82
+ id: {
83
+ description: string;
84
+ shortFlag: string;
85
+ required: true;
86
+ };
87
+ };
88
+ };
89
+ get optionsConfig(): {
90
+ initial: {
91
+ description: string;
92
+ value: "boolean";
93
+ };
94
+ repositoryNames: {
95
+ description: string;
96
+ shortFlag: string;
97
+ value: "array";
98
+ };
99
+ repositoryTypes: {
100
+ description: string;
101
+ shortFlag: string;
102
+ value: "array";
103
+ };
104
+ packageNames: {
105
+ description: string;
106
+ shortFlag: string;
107
+ value: "array";
108
+ };
109
+ packageTaskNames: {
110
+ description: string;
111
+ shortFlag: string;
112
+ value: "array";
113
+ };
114
+ tags: {
115
+ description: string;
116
+ shortFlag: string;
117
+ value: "array";
118
+ };
119
+ packageConfig: {
120
+ description: string;
121
+ shortFlag: string;
122
+ };
123
+ id: {
124
+ description: string;
125
+ shortFlag: string;
126
+ required: true;
127
+ };
128
+ };
16
129
  exec(): Promise<{
17
130
  result: (import("../utils/list").List3SummaryResult | import("../utils/list").Listr3TaskResult<{
18
131
  snapshots: {
@@ -35,5 +148,6 @@ export declare class RestoreCommand extends CommandAbstract<RestoreCommandOption
35
148
  };
36
149
  }>)[];
37
150
  exitCode: number;
151
+ errors: Error[];
38
152
  }>;
39
153
  }
@@ -1,77 +1,51 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RestoreCommand = void 0;
3
+ exports.RestoreCommand = exports.restoreCommandOptions = void 0;
4
4
  const ConfigAction_1 = require("../actions/ConfigAction");
5
5
  const RestoreAction_1 = require("../actions/RestoreAction");
6
- const string_1 = require("../utils/string");
7
6
  const CommandAbstract_1 = require("./CommandAbstract");
7
+ exports.restoreCommandOptions = {
8
+ ...RestoreAction_1.restoreActionOptions,
9
+ };
8
10
  class RestoreCommand extends CommandAbstract_1.CommandAbstract {
9
- optionsConfig() {
10
- return this.castOptionsConfig({
11
- id: {
12
- description: "Filter by snapshot id",
13
- option: "-i,--id <id>",
14
- required: true,
15
- },
16
- package: {
17
- description: "Filter by package names",
18
- option: "-p,--package <values>",
19
- parser: string_1.parseStringList,
20
- },
21
- initial: {
22
- description: "Initial restoring (disables restore path)",
23
- option: "--initial",
24
- },
25
- packageTask: {
26
- description: "Filter by package task names",
27
- option: "-pt,--package-task <values>",
28
- parser: string_1.parseStringList,
29
- },
30
- packageConfig: {
31
- description: "Filter by package config",
32
- option: "-pc,--package-config",
33
- },
34
- repository: {
35
- description: "Filter by repository names",
36
- option: "-r,--repository <values>",
37
- parser: string_1.parseStringList,
38
- },
39
- repositoryType: {
40
- description: "Filter by repository types",
41
- option: "-rt,--repository-type <values>",
42
- parser: (v) => (0, string_1.parseStringList)(v),
43
- },
44
- tag: {
45
- description: "Filter by tags",
46
- option: "-t,--tag <values>",
47
- parser: string_1.parseStringList,
48
- },
49
- });
11
+ static config() {
12
+ return {
13
+ name: "restore",
14
+ alias: "r",
15
+ options: exports.restoreCommandOptions,
16
+ };
17
+ }
18
+ get optionsConfig() {
19
+ return exports.restoreCommandOptions;
50
20
  }
51
21
  async exec() {
52
22
  const verbose = this.globalOptions.verbose ?? 0;
53
23
  const config = await ConfigAction_1.ConfigAction.fromGlobalOptions(this.globalOptions);
54
24
  const restore = new RestoreAction_1.RestoreAction(config, {
55
- snapshotId: this.options.id,
56
- packageNames: this.options.package,
57
- packageTaskNames: this.options.packageTask,
25
+ id: this.options.id,
26
+ packageNames: this.options.packageNames,
27
+ packageTaskNames: this.options.packageTaskNames,
58
28
  packageConfig: this.options.packageConfig,
59
- repositoryNames: this.options.repository,
60
- repositoryTypes: this.options.repositoryType,
61
- tags: this.options.tag,
29
+ repositoryNames: this.options.repositoryNames,
30
+ repositoryTypes: this.options.repositoryTypes,
31
+ tags: this.options.tags,
62
32
  verbose: verbose > 0,
63
33
  initial: this.options.initial,
34
+ }, {
64
35
  tty: this.globalOptions.tty,
65
36
  progress: this.globalOptions.progress,
66
37
  streams: this.streams,
67
38
  });
68
- const result = await restore.exec();
39
+ const data = await restore.exec();
69
40
  if (this.globalOptions.outputFormat)
70
41
  restore
71
- .dataFormat(result, { streams: this.streams, verbose })
42
+ .dataFormat(data.result, {
43
+ verbose,
44
+ streams: this.streams,
45
+ errors: data.errors,
46
+ })
72
47
  .log(this.globalOptions.outputFormat);
73
- const exitCode = result.some((item) => item.error) ? 1 : 0;
74
- return { result, exitCode };
48
+ return data;
75
49
  }
76
50
  }
77
51
  exports.RestoreCommand = RestoreCommand;
@@ -0,0 +1,29 @@
1
+ import { InferOptions } from "../utils/options";
2
+ import { CommandAbstract } from "./CommandAbstract";
3
+ export declare const runCommandOptions: {
4
+ jobName: {
5
+ description: string;
6
+ flag: false;
7
+ };
8
+ };
9
+ export type RunCommandOptions = InferOptions<typeof runCommandOptions>;
10
+ export declare class RunCommand extends CommandAbstract<typeof runCommandOptions> {
11
+ static config(): {
12
+ name: string;
13
+ options: {
14
+ jobName: {
15
+ description: string;
16
+ flag: false;
17
+ };
18
+ };
19
+ };
20
+ get optionsConfig(): {
21
+ jobName: {
22
+ description: string;
23
+ flag: false;
24
+ };
25
+ };
26
+ exec(): Promise<{
27
+ exitCode: number;
28
+ }>;
29
+ }