@datatruck/cli 0.36.7 → 0.37.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 (37) hide show
  1. package/config.schema.json +87 -79
  2. package/lib/actions/BackupAction.d.ts +6 -1
  3. package/lib/actions/BackupAction.js +12 -10
  4. package/lib/actions/CopyAction.d.ts +6 -1
  5. package/lib/actions/CopyAction.js +2 -2
  6. package/lib/actions/RestoreAction.d.ts +6 -1
  7. package/lib/actions/RestoreAction.js +2 -2
  8. package/lib/cli.js +75 -21
  9. package/lib/commands/BackupCommand.d.ts +1 -0
  10. package/lib/commands/BackupCommand.js +7 -4
  11. package/lib/commands/CommandAbstract.d.ts +1 -0
  12. package/lib/commands/CopyCommand.d.ts +1 -0
  13. package/lib/commands/CopyCommand.js +7 -4
  14. package/lib/commands/InitCommand.d.ts +1 -0
  15. package/lib/commands/InitCommand.js +7 -2
  16. package/lib/commands/RestoreCommand.d.ts +1 -0
  17. package/lib/commands/RestoreCommand.js +7 -4
  18. package/lib/commands/RunCommand.d.ts +10 -0
  19. package/lib/commands/RunCommand.js +35 -0
  20. package/lib/commands/StartServerCommand.js +12 -12
  21. package/lib/utils/cli.d.ts +2 -2
  22. package/lib/utils/cli.js +34 -28
  23. package/lib/utils/datatruck/command.d.ts +3 -1
  24. package/lib/utils/datatruck/command.js +2 -0
  25. package/lib/utils/datatruck/config-type.d.ts +4 -0
  26. package/lib/utils/datatruck/cron-server.d.ts +8 -39
  27. package/lib/utils/datatruck/cron-server.js +35 -57
  28. package/lib/utils/datatruck/job.d.ts +41 -0
  29. package/lib/utils/datatruck/job.js +77 -0
  30. package/lib/utils/datatruck/report-list.js +1 -1
  31. package/lib/utils/datatruck/repository-server.d.ts +4 -0
  32. package/lib/utils/datatruck/repository-server.js +4 -1
  33. package/lib/utils/http.d.ts +1 -0
  34. package/lib/utils/http.js +4 -2
  35. package/lib/utils/list.d.ts +5 -0
  36. package/lib/utils/list.js +9 -0
  37. package/package.json +1 -1
package/lib/utils/list.js CHANGED
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Listr3 = exports.List3Logger = void 0;
4
4
  const date_1 = require("./date");
5
+ const error_1 = require("./error");
5
6
  const exit_1 = require("./exit");
6
7
  const stream_1 = require("./stream");
7
8
  const listr2_1 = require("listr2");
@@ -135,6 +136,14 @@ class Listr3 extends listr2_1.Listr {
135
136
  task.state$ = listr2_1.ListrTaskState.FAILED;
136
137
  this["renderer"].end(new Error("Interrupted."));
137
138
  }
139
+ async execAndParse(verbose) {
140
+ const result = await this.exec();
141
+ const exitCode = result.some((item) => item.error) ? 1 : 0;
142
+ const errors = result
143
+ .filter((item) => item.error && (verbose || !(item.error instanceof error_1.AppError)))
144
+ .map(({ error }) => error);
145
+ return { result, exitCode, errors };
146
+ }
138
147
  async exec() {
139
148
  const dispose = (0, exit_1.onExit)(() => {
140
149
  this.$options.progressManager?.dispose();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datatruck/cli",
3
- "version": "0.36.7",
3
+ "version": "0.37.0",
4
4
  "description": "Tool for creating and managing backups",
5
5
  "homepage": "https://github.com/swordev/datatruck#readme",
6
6
  "bugs": {