@datatruck/cli 0.27.0 → 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.
Files changed (147) hide show
  1. package/Action/BackupAction.d.ts +69 -34
  2. package/Action/BackupAction.js +284 -244
  3. package/Action/CleanCacheAction.d.ts +8 -4
  4. package/Action/CleanCacheAction.js +8 -5
  5. package/Action/ConfigAction.d.ts +12 -5
  6. package/Action/ConfigAction.js +14 -18
  7. package/Action/CopyAction.d.ts +49 -0
  8. package/Action/CopyAction.js +144 -0
  9. package/Action/InitAction.d.ts +3 -3
  10. package/Action/InitAction.js +9 -9
  11. package/Action/PruneAction.d.ts +9 -9
  12. package/Action/PruneAction.js +39 -23
  13. package/Action/RestoreAction.d.ts +48 -23
  14. package/Action/RestoreAction.js +158 -195
  15. package/Action/SnapshotsAction.d.ts +8 -8
  16. package/Action/SnapshotsAction.js +8 -8
  17. package/CHANGELOG.md +495 -0
  18. package/Command/BackupCommand.d.ts +6 -4
  19. package/Command/BackupCommand.js +9 -26
  20. package/Command/CleanCacheCommand.d.ts +4 -4
  21. package/Command/CleanCacheCommand.js +26 -5
  22. package/Command/CommandAbstract.d.ts +10 -7
  23. package/Command/CommandAbstract.js +4 -1
  24. package/Command/ConfigCommand.d.ts +6 -9
  25. package/Command/ConfigCommand.js +13 -8
  26. package/Command/CopyCommand.d.ts +15 -0
  27. package/Command/CopyCommand.js +61 -0
  28. package/Command/InitCommand.d.ts +4 -4
  29. package/Command/InitCommand.js +11 -15
  30. package/Command/PruneCommand.d.ts +3 -3
  31. package/Command/PruneCommand.js +13 -12
  32. package/Command/RestoreCommand.js +9 -17
  33. package/Command/SnapshotsCommand.d.ts +4 -4
  34. package/Command/SnapshotsCommand.js +16 -15
  35. package/Command/StartServerCommand.d.ts +3 -3
  36. package/Config/Config.d.ts +9 -0
  37. package/Config/Config.js +17 -0
  38. package/Config/PrunePolicyConfig.d.ts +2 -2
  39. package/Factory/CommandFactory.d.ts +27 -34
  40. package/Factory/CommandFactory.js +27 -54
  41. package/Factory/RepositoryFactory.d.ts +1 -1
  42. package/Factory/RepositoryFactory.js +3 -3
  43. package/Factory/TaskFactory.d.ts +1 -1
  44. package/Factory/TaskFactory.js +3 -3
  45. package/Repository/DatatruckRepository.d.ts +9 -8
  46. package/Repository/DatatruckRepository.js +42 -25
  47. package/Repository/GitRepository.d.ts +9 -8
  48. package/Repository/GitRepository.js +22 -25
  49. package/Repository/RepositoryAbstract.d.ts +39 -37
  50. package/Repository/RepositoryAbstract.js +4 -5
  51. package/Repository/ResticRepository.d.ts +9 -8
  52. package/Repository/ResticRepository.js +30 -28
  53. package/Task/GitTask.d.ts +6 -7
  54. package/Task/GitTask.js +24 -30
  55. package/Task/MariadbTask.d.ts +4 -5
  56. package/Task/MariadbTask.js +26 -32
  57. package/Task/MssqlTask.d.ts +5 -3
  58. package/Task/MssqlTask.js +11 -12
  59. package/Task/MysqlDumpTask.d.ts +10 -3
  60. package/Task/MysqlDumpTask.js +107 -31
  61. package/Task/ScriptTask.d.ts +23 -18
  62. package/Task/ScriptTask.js +34 -24
  63. package/Task/SqlDumpTaskAbstract.d.ts +8 -3
  64. package/Task/SqlDumpTaskAbstract.js +31 -19
  65. package/Task/TaskAbstract.d.ts +24 -25
  66. package/Task/TaskAbstract.js +6 -10
  67. package/cli.js +13 -5
  68. package/config.schema.json +86 -1
  69. package/package.json +4 -5
  70. package/utils/DataFormat.d.ts +23 -12
  71. package/utils/DataFormat.js +36 -14
  72. package/utils/cli.d.ts +2 -9
  73. package/utils/cli.js +9 -52
  74. package/utils/datatruck/client.d.ts +2 -0
  75. package/utils/datatruck/client.js +3 -0
  76. package/utils/datatruck/config.d.ts +2 -0
  77. package/utils/datatruck/config.js +18 -3
  78. package/utils/datatruck/paths.d.ts +5 -9
  79. package/utils/datatruck/paths.js +2 -2
  80. package/utils/datatruck/snapshot.d.ts +2 -2
  81. package/utils/date.d.ts +7 -3
  82. package/utils/date.js +22 -14
  83. package/utils/fs.d.ts +16 -11
  84. package/utils/fs.js +81 -48
  85. package/utils/list.d.ts +64 -0
  86. package/utils/list.js +145 -0
  87. package/utils/mysql.d.ts +2 -0
  88. package/utils/mysql.js +21 -2
  89. package/utils/process.d.ts +1 -0
  90. package/utils/process.js +24 -31
  91. package/utils/progress.d.ts +33 -0
  92. package/utils/progress.js +113 -0
  93. package/utils/steps.d.ts +11 -0
  94. package/utils/steps.js +22 -10
  95. package/utils/stream.d.ts +7 -0
  96. package/utils/stream.js +10 -0
  97. package/utils/string.d.ts +0 -1
  98. package/utils/string.js +1 -13
  99. package/utils/tar.d.ts +10 -3
  100. package/utils/tar.js +70 -44
  101. package/utils/temp.d.ts +26 -0
  102. package/utils/temp.js +133 -0
  103. package/utils/virtual-fs.d.ts +6 -2
  104. package/utils/virtual-fs.js +6 -0
  105. package/Action/BackupSessionsAction.d.ts +0 -13
  106. package/Action/BackupSessionsAction.js +0 -18
  107. package/Action/RestoreSessionsAction.d.ts +0 -13
  108. package/Action/RestoreSessionsAction.js +0 -18
  109. package/Command/BackupSessionsCommand.d.ts +0 -12
  110. package/Command/BackupSessionsCommand.js +0 -92
  111. package/Command/RestoreSessionsCommand.d.ts +0 -12
  112. package/Command/RestoreSessionsCommand.js +0 -91
  113. package/Decorator/EntityDecorator.d.ts +0 -11
  114. package/Decorator/EntityDecorator.js +0 -17
  115. package/Entity/BackupSessionEntity.d.ts +0 -6
  116. package/Entity/BackupSessionEntity.js +0 -25
  117. package/Entity/BackupSessionRepositoryEntity.d.ts +0 -6
  118. package/Entity/BackupSessionRepositoryEntity.js +0 -25
  119. package/Entity/BackupSessionTaskEntity.d.ts +0 -5
  120. package/Entity/BackupSessionTaskEntity.js +0 -24
  121. package/Entity/CrudEntityAbstract.d.ts +0 -5
  122. package/Entity/CrudEntityAbstract.js +0 -9
  123. package/Entity/RestoreSessionEntity.d.ts +0 -5
  124. package/Entity/RestoreSessionEntity.js +0 -24
  125. package/Entity/RestoreSessionRepositoryEntity.d.ts +0 -6
  126. package/Entity/RestoreSessionRepositoryEntity.js +0 -25
  127. package/Entity/RestoreSessionTaskEntity.d.ts +0 -5
  128. package/Entity/RestoreSessionTaskEntity.js +0 -24
  129. package/Entity/StateEntityAbstract.d.ts +0 -9
  130. package/Entity/StateEntityAbstract.js +0 -12
  131. package/Factory/EntityFactory.d.ts +0 -6
  132. package/Factory/EntityFactory.js +0 -40
  133. package/SessionDriver/ConsoleSessionDriver.d.ts +0 -42
  134. package/SessionDriver/ConsoleSessionDriver.js +0 -208
  135. package/SessionDriver/SessionDriverAbstract.d.ts +0 -77
  136. package/SessionDriver/SessionDriverAbstract.js +0 -28
  137. package/SessionDriver/SqliteSessionDriver.d.ts +0 -20
  138. package/SessionDriver/SqliteSessionDriver.js +0 -173
  139. package/SessionManager/BackupSessionManager.d.ts +0 -45
  140. package/SessionManager/BackupSessionManager.js +0 -218
  141. package/SessionManager/RestoreSessionManager.d.ts +0 -47
  142. package/SessionManager/RestoreSessionManager.js +0 -218
  143. package/SessionManager/SessionManagerAbstract.d.ts +0 -18
  144. package/SessionManager/SessionManagerAbstract.js +0 -36
  145. package/migrations/001-initial.sql +0 -98
  146. package/utils/entity.d.ts +0 -4
  147. package/utils/entity.js +0 -10
package/CHANGELOG.md ADDED
@@ -0,0 +1,495 @@
1
+ # @datatruck/cli
2
+
3
+ ## 0.28.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`b50b10b`](https://github.com/swordev/datatruck/commit/b50b10bb29a15db0b4dadd3de499b9cd6738d706) Thanks [@juanrgm](https://github.com/juanrgm)! - Replace cli interface and global refactoring
8
+
9
+ - [`89b0856`](https://github.com/swordev/datatruck/commit/89b0856b2a5bfc42458a9bcb271a04f2dce26098) Thanks [@juanrgm](https://github.com/juanrgm)! - Add telegram report config
10
+
11
+ - [`1745715`](https://github.com/swordev/datatruck/commit/17457154930f15865858e89b7f3932c617dfddf4) Thanks [@juanrgm](https://github.com/juanrgm)! - Enhance output table formatting
12
+
13
+ - [`8fa2fe0`](https://github.com/swordev/datatruck/commit/8fa2fe0a1213cf9614bb8c5bbe999d0d8e7130e8) Thanks [@juanrgm](https://github.com/juanrgm)! - Add copy command
14
+
15
+ - [`e3d54c3`](https://github.com/swordev/datatruck/commit/e3d54c34df8ba42e77040d183d993808c8a7cdbb) Thanks [@juanrgm](https://github.com/juanrgm)! - Add json/table format to all commands
16
+
17
+ - [`d59d435`](https://github.com/swordev/datatruck/commit/d59d435fc1a244da944ad0c36bf1dcf7735ba289) Thanks [@juanrgm](https://github.com/juanrgm)! - Add `compress` option to `mysql-dump` task
18
+
19
+ - [`802d6a5`](https://github.com/swordev/datatruck/commit/802d6a577f46bfccc1c1a5b8c4431976cd6d7820) Thanks [@juanrgm](https://github.com/juanrgm)! - Show backup summary
20
+
21
+ ### Patch Changes
22
+
23
+ - [`93e8e83`](https://github.com/swordev/datatruck/commit/93e8e830792f7d8957e89787c981e6a45ae4d02d) Thanks [@juanrgm](https://github.com/juanrgm)! - Add `minFreeDiskSpace` config
24
+
25
+ - [`1ad7fd9`](https://github.com/swordev/datatruck/commit/1ad7fd99f6e8f6d8128ea35e7c680cc3618d6ac4) Thanks [@juanrgm](https://github.com/juanrgm)! - Fix id filter in prune action
26
+
27
+ - [`5d1ece0`](https://github.com/swordev/datatruck/commit/5d1ece0760c317c71175250812e43fc866bcfc5a) Thanks [@juanrgm](https://github.com/juanrgm)! - Verify mysql dump files
28
+
29
+ - [`8c00e9c`](https://github.com/swordev/datatruck/commit/8c00e9c78a656807d09d147c9b1017c2a1b8d127) Thanks [@juanrgm](https://github.com/juanrgm)! - Fix bsdtar execution
30
+
31
+ ## 0.27.0
32
+
33
+ ### Minor Changes
34
+
35
+ - [`e6485ad`](https://github.com/swordev/datatruck/commit/e6485ad80258d3b1c30f3efb1a2549a5c2760878) Thanks [@juanrgm](https://github.com/juanrgm)! - Add datatruck server
36
+
37
+ ## 0.26.2
38
+
39
+ ### Patch Changes
40
+
41
+ - [`627adbd`](https://github.com/swordev/datatruck/commit/627adbd8114510371f451b674b007dc2093fee96) Thanks [@juanrgm](https://github.com/juanrgm)! - Fix `--no-restore-path` option
42
+
43
+ ## 0.26.1
44
+
45
+ ### Patch Changes
46
+
47
+ - [`2ca1421`](https://github.com/swordev/datatruck/commit/2ca142106ddca9e0ca53ef906f4412acd3a5bfae) Thanks [@juanrgm](https://github.com/juanrgm)! - Add meta property to the package config
48
+
49
+ ## 0.26.0
50
+
51
+ ### Minor Changes
52
+
53
+ - [`ff54d83`](https://github.com/swordev/datatruck/commit/ff54d835a4ea5c54c47c75e735549b1f49d66e5e) Thanks [@juanrgm](https://github.com/juanrgm)! - Add option to disable restore paths
54
+
55
+ ## 0.25.0
56
+
57
+ ### Minor Changes
58
+
59
+ - [`7a1adf0`](https://github.com/swordev/datatruck/commit/7a1adf0624d4306f40bfd1943105cbfaa64a566c) Thanks [@juanrgm](https://github.com/juanrgm)! - Add node steps to `include`/`exclude` package options
60
+
61
+ ## 0.24.0
62
+
63
+ ### Minor Changes
64
+
65
+ - [`f1615b2`](https://github.com/swordev/datatruck/commit/f1615b216cf635bd2c08d68bad818d50855f314b) Thanks [@juanrgm](https://github.com/juanrgm)! - Fix and enhance `script` task
66
+
67
+ ## 0.23.3
68
+
69
+ ### Patch Changes
70
+
71
+ - [`ea3cbc9`](https://github.com/swordev/datatruck/commit/ea3cbc98aee49151bd1b9422a2c7dadb29479751) Thanks [@juanrgm](https://github.com/juanrgm)! - Apply permissions to the root path in `datatruck` repository
72
+
73
+ ## 0.23.2
74
+
75
+ ### Patch Changes
76
+
77
+ - [`61d0221`](https://github.com/swordev/datatruck/commit/61d022187463ea16e9a34d0b995808b687414a61) Thanks [@juanrgm](https://github.com/juanrgm)! - Fix `mysql-dump` task
78
+
79
+ - [`3f80194`](https://github.com/swordev/datatruck/commit/3f8019448b3b529cb9b70e1e5bbe7ec99aec95a4) Thanks [@juanrgm](https://github.com/juanrgm)! - Fix folder permissions in `datatruck` repository
80
+
81
+ ## 0.23.1
82
+
83
+ ### Patch Changes
84
+
85
+ - [`899aa7a`](https://github.com/swordev/datatruck/commit/899aa7af5204b13010643a900279456e737a154d) Thanks [@juanrgm](https://github.com/juanrgm)! - Fix `mysql-dump` progress
86
+
87
+ ## 0.23.0
88
+
89
+ ### Minor Changes
90
+
91
+ - [`fa5d44d`](https://github.com/swordev/datatruck/commit/fa5d44dff24b26d976bed385bd20981fa767e089) Thanks [@juanrgm](https://github.com/juanrgm)! - Add concurrency config to `mysql-dump` task
92
+
93
+ ## 0.22.2
94
+
95
+ ### Patch Changes
96
+
97
+ - [`80eeded`](https://github.com/swordev/datatruck/commit/80eeded073aae970385e1efb04acc4ec222efa25) Thanks [@juanrgm](https://github.com/juanrgm)! - Fix cross-device link
98
+
99
+ ## 0.22.1
100
+
101
+ ### Patch Changes
102
+
103
+ - [`e21ad9f`](https://github.com/swordev/datatruck/commit/e21ad9f33bd6cd28cc4c47485643905dd92dcb57) Thanks [@juanrgm](https://github.com/juanrgm)! - Fix folder permissions in `mysql-dump` task
104
+
105
+ - [`5e5ebf5`](https://github.com/swordev/datatruck/commit/5e5ebf53b0cb87160e7887e2a6372617e19d38b1) Thanks [@juanrgm](https://github.com/juanrgm)! - Hide MySQL credentials
106
+
107
+ ## 0.22.0
108
+
109
+ ### Minor Changes
110
+
111
+ - [`d0649f1`](https://github.com/swordev/datatruck/commit/d0649f1f7d4a7d891bea19793cfcb24d752a0d5c) Thanks [@juanrgm](https://github.com/juanrgm)! - Add `csv` backup/restore format to `mysql-dump` task
112
+
113
+ ### Patch Changes
114
+
115
+ - [`2e76917`](https://github.com/swordev/datatruck/commit/2e7691753b0a74c1f0653960882d13fbcf7d0567) Thanks [@juanrgm](https://github.com/juanrgm)! - Improve import performance in the `mysql-dump` task
116
+
117
+ ## 0.21.1
118
+
119
+ ### Patch Changes
120
+
121
+ - [`0d863e8`](https://github.com/swordev/datatruck/commit/0d863e86d6deb30b79a45171f01d7cf4604250dd) Thanks [@juanrgm](https://github.com/juanrgm)! - Avoid listing tar twice
122
+
123
+ - [`5045457`](https://github.com/swordev/datatruck/commit/5045457f3cd9512b27d29049fc37ba418ed95e0a) Thanks [@juanrgm](https://github.com/juanrgm)! - Fix tar extracting
124
+
125
+ - [`8f0bd77`](https://github.com/swordev/datatruck/commit/8f0bd77267a92da7eee05adc3bb85dee0ba97391) Thanks [@juanrgm](https://github.com/juanrgm)! - Fix `sql-dump` tasks
126
+
127
+ ## 0.21.0
128
+
129
+ ### Minor Changes
130
+
131
+ - [`211c914`](https://github.com/swordev/datatruck/commit/211c914e42b97213e81163511778b84b1ae2e9af) Thanks [@juanrgm](https://github.com/juanrgm)! - Use multi core for tar
132
+
133
+ ## 0.20.0
134
+
135
+ ### Minor Changes
136
+
137
+ - [`13f9331`](https://github.com/swordev/datatruck/commit/13f933191f56f93e2eee0467e272998520b36195) Thanks [@juanrgm](https://github.com/juanrgm)! - Replace node-tar by tar
138
+
139
+ ## 0.19.0
140
+
141
+ ### Minor Changes
142
+
143
+ - [`452a878`](https://github.com/swordev/datatruck/commit/452a878b04bf6dcf4632423f1455648e9e196697) Thanks [@juanrgm](https://github.com/juanrgm)! - Replace 7zip by tar
144
+
145
+ ## 0.18.0
146
+
147
+ ### Minor Changes
148
+
149
+ - [`dba2162`](https://github.com/swordev/datatruck/commit/dba21624fa916e39824b9f998b58f9f9c3c2b1eb) Thanks [@juanrgm](https://github.com/juanrgm)! - Add `compress` and `parallel` options to MariaDB task config
150
+
151
+ ### Patch Changes
152
+
153
+ - [`0b783ee`](https://github.com/swordev/datatruck/commit/0b783ee4c8d112e516ba5923ebf5d792050d14cc) Thanks [@juanrgm](https://github.com/juanrgm)! - Update dependencies
154
+
155
+ - [`305dc49`](https://github.com/swordev/datatruck/commit/305dc49c3bc0ebc562cb478e705dfc6a9da6658f) Thanks [@juanrgm](https://github.com/juanrgm)! - Throw error if mkdir fails
156
+
157
+ ## 0.17.2
158
+
159
+ ### Patch Changes
160
+
161
+ - [`27b7260`](https://github.com/swordev/datatruck/commit/27b726075a0e81769b841c4ce4c8b508f55f0bde) Thanks [@juanrgm](https://github.com/juanrgm)! - Ignore uncompleted snapshots
162
+
163
+ ## 0.17.1
164
+
165
+ ### Patch Changes
166
+
167
+ - [`d6ff955`](https://github.com/swordev/datatruck/commit/d6ff955618527e8bad99f05a779c1f9e08fc863e) Thanks [@juanrgm](https://github.com/juanrgm)! - Wait for stdout pipe to close
168
+
169
+ - [`c3cb5b9`](https://github.com/swordev/datatruck/commit/c3cb5b9d25af164dbbd58d1d7623f56c55fc7dbb) Thanks [@juanrgm](https://github.com/juanrgm)! - Fix pretty-json format
170
+
171
+ ## 0.17.0
172
+
173
+ ### Minor Changes
174
+
175
+ - [`821096f`](https://github.com/swordev/datatruck/commit/821096f67cd3bcce310b8e42fc7ccda109b42672) Thanks [@juanrgm](https://github.com/juanrgm)! - Add grouping by id in `snapshots` command
176
+
177
+ ### Patch Changes
178
+
179
+ - [`5a5e9c6`](https://github.com/swordev/datatruck/commit/5a5e9c62f3b6afded36d949c3149d475da17751b) Thanks [@juanrgm](https://github.com/juanrgm)! - Update dependencies
180
+
181
+ - [`b9fbbc9`](https://github.com/swordev/datatruck/commit/b9fbbc98ca147ae9a88b214586ef722a9212116b) Thanks [@juanrgm](https://github.com/juanrgm)! - Fix filter by repository
182
+
183
+ ## 0.16.2
184
+
185
+ ### Patch Changes
186
+
187
+ - [`14865df`](https://github.com/swordev/datatruck/commit/14865df18b784d756aa1b4896f59ca6310eaeca4) Thanks [@juanrgm](https://github.com/juanrgm)! - Update dependencies
188
+
189
+ - [`d91e6f8`](https://github.com/swordev/datatruck/commit/d91e6f8a024b14a15f9b9b97d5adc9b21c821a76) Thanks [@juanrgm](https://github.com/juanrgm)! - Delete temporary directories
190
+
191
+ ## 0.16.1
192
+
193
+ ### Patch Changes
194
+
195
+ - [`62ce7c4`](https://github.com/swordev/datatruck/commit/62ce7c4d4ee6edc0375f3c1ad1e7bfe8912a2f3c) Thanks [@juanrgm](https://github.com/juanrgm)! - Fix unzip progress
196
+
197
+ * [`3fd4258`](https://github.com/swordev/datatruck/commit/3fd42588011353d744be2f964ab24cf0bdd690bf) Thanks [@juanrgm](https://github.com/juanrgm)! - Fix restore progress in datatruck repository
198
+
199
+ ## 0.16.0
200
+
201
+ ### Minor Changes
202
+
203
+ - [`e25867a`](https://github.com/swordev/datatruck/commit/e25867a49217e682c0fee7e1822a12daa583b168) Thanks [@juanrgm](https://github.com/juanrgm)! - New backup structure in datatruck repository
204
+
205
+ * [`b65f080`](https://github.com/swordev/datatruck/commit/b65f080d7eca5588bce533e988067bd432da3c50) Thanks [@juanrgm](https://github.com/juanrgm)! - Show all progress steps
206
+
207
+ - [`e603aee`](https://github.com/swordev/datatruck/commit/e603aee22febd7cc23056caeeb9f9304957199d6) Thanks [@juanrgm](https://github.com/juanrgm)! - Add progress stats in the `sql-dump` tasks
208
+
209
+ ### Patch Changes
210
+
211
+ - [`dae957b`](https://github.com/swordev/datatruck/commit/dae957b20f519d1bc0f6b046074ae2ad02a071dc) Thanks [@juanrgm](https://github.com/juanrgm)! - Show zip progress
212
+
213
+ * [`7ba3dd3`](https://github.com/swordev/datatruck/commit/7ba3dd3521fc10140adc178810cc2b6153f0f5df) Thanks [@juanrgm](https://github.com/juanrgm)! - Enable multithread in 7zip
214
+
215
+ - [`1024225`](https://github.com/swordev/datatruck/commit/102422501f629f50164db439e69a456725579cbe) Thanks [@juanrgm](https://github.com/juanrgm)! - Show full error stack when the error is not controlled
216
+
217
+ * [`09db164`](https://github.com/swordev/datatruck/commit/09db164db462077289b66931e82f162a92558720) Thanks [@juanrgm](https://github.com/juanrgm)! - Fix backup action in datatruck repository
218
+
219
+ - [`2b9b2bb`](https://github.com/swordev/datatruck/commit/2b9b2bbb407b0b84a4b7fe3cd8773d6326983e8a) Thanks [@juanrgm](https://github.com/juanrgm)! - Unify progress bars
220
+
221
+ ## 0.15.0
222
+
223
+ ### Minor Changes
224
+
225
+ - [`c73ceec`](https://github.com/swordev/datatruck/commit/c73ceec5ccb6a824fe6a6fceee56700705191fba) Thanks [@juanrgm](https://github.com/juanrgm)! - Detail the progress in all actions
226
+
227
+ ## 0.14.0
228
+
229
+ ### Minor Changes
230
+
231
+ - [`91fe442`](https://github.com/swordev/datatruck/commit/91fe44257fa58400d7ce6a4678747e034e94228a) Thanks [@juanrgm](https://github.com/juanrgm)! - Show progress and apply permissions in datatruck repository
232
+
233
+ ## 0.13.1
234
+
235
+ ### Patch Changes
236
+
237
+ - [`bfd61c7`](https://github.com/swordev/datatruck/commit/bfd61c7c5cdec7aea4f66193094786797231b1d6) Thanks [@juanrgm](https://github.com/juanrgm)! - Enhance 7zip performance
238
+
239
+ * [`a208200`](https://github.com/swordev/datatruck/commit/a20820044fe8dac007bbc70de840b27735c689ef) Thanks [@juanrgm](https://github.com/juanrgm)! - Skip not found file errors during backups
240
+
241
+ - [`442bd3d`](https://github.com/swordev/datatruck/commit/442bd3d7376e6c546cfcba69a80048e90e11a488) Thanks [@juanrgm](https://github.com/juanrgm)! - Deny additional properties in SQL dump task config
242
+
243
+ ## 0.13.0
244
+
245
+ ### Minor Changes
246
+
247
+ - [`64cbb10`](https://github.com/swordev/datatruck/commit/64cbb10ea2526612e9f1183c878f146dbe4cea13) Thanks [@juanrgm](https://github.com/juanrgm)! - Save and show snapshot size
248
+
249
+ * [`297d120`](https://github.com/swordev/datatruck/commit/297d1202c49a3a6b4a5eafc3871359c1af637d52) Thanks [@juanrgm](https://github.com/juanrgm)! - Add `progress` and `progress-interval` global options
250
+
251
+ - [`cb0ea35`](https://github.com/swordev/datatruck/commit/cb0ea35161ce8f67c40c6c77d1169d648ac0dfcd) Thanks [@juanrgm](https://github.com/juanrgm)! - Show restic restore progress
252
+
253
+ * [`357b995`](https://github.com/swordev/datatruck/commit/357b995c041f3167290a5ce9ae4f9a8d122f2a10) Thanks [@juanrgm](https://github.com/juanrgm)! - Rename local repository to datatruck
254
+
255
+ ### Patch Changes
256
+
257
+ - [`aca9634`](https://github.com/swordev/datatruck/commit/aca9634313d562065a3e09efde8adf31b9939f89) Thanks [@juanrgm](https://github.com/juanrgm)! - Use local cache in the restic repositories
258
+
259
+ * [`25f0cbb`](https://github.com/swordev/datatruck/commit/25f0cbb2754ca1b082a51e929c373f88825bc18d) Thanks [@juanrgm](https://github.com/juanrgm)! - Fix undefined progress of restic
260
+
261
+ ## 0.12.1
262
+
263
+ ### Patch Changes
264
+
265
+ - [`23bab2a`](https://github.com/swordev/datatruck/commit/23bab2ad73801398c799759cc275be2b17350545) Thanks [@juanrgm](https://github.com/juanrgm)! - Fix package config option
266
+
267
+ ## 0.12.0
268
+
269
+ ### Minor Changes
270
+
271
+ - [`0effb38`](https://github.com/swordev/datatruck/commit/0effb38d1cc0b50ba43cd2948c7ff98d2b17325d) Thanks [@juanrgm](https://github.com/juanrgm)! - Add package config filter
272
+
273
+ ### Patch Changes
274
+
275
+ - [`31446fb`](https://github.com/swordev/datatruck/commit/31446fb69273ac1619cdf2f8965f8b702da5882f) Thanks [@juanrgm](https://github.com/juanrgm)! - Throw controlled error when package config not found
276
+
277
+ ## 0.11.7
278
+
279
+ ### Patch Changes
280
+
281
+ - [`303dbf6`](https://github.com/swordev/datatruck/commit/303dbf63127c2bafd8a24c5733fa8b33d311f3ff) Thanks [@juanrgm](https://github.com/juanrgm)! - Allow non file password in restic repository url
282
+
283
+ ## 0.11.6
284
+
285
+ ### Patch Changes
286
+
287
+ - [`3a3c54d`](https://github.com/swordev/datatruck/commit/3a3c54db7075882604a3fc0fd8827271ab04ba29) Thanks [@juanrgm](https://github.com/juanrgm)! - Exlude files in restic repository
288
+
289
+ ## 0.11.5
290
+
291
+ ### Patch Changes
292
+
293
+ - [`cee6fee`](https://github.com/swordev/datatruck/commit/cee6fee924a8ae637a8f3bfece03890d6ad34ddf) Thanks [@juanrgm](https://github.com/juanrgm)! - Avoid scan all excluded files
294
+
295
+ ## 0.11.4
296
+
297
+ ### Patch Changes
298
+
299
+ - [`6328aec`](https://github.com/swordev/datatruck/commit/6328aece04027d76d2092bd916671d49c91cdc6d) Thanks [@juanrgm](https://github.com/juanrgm)! - Fix task name filter
300
+
301
+ ## 0.11.3
302
+
303
+ ### Patch Changes
304
+
305
+ - [`6aeac04`](https://github.com/swordev/datatruck/commit/6aeac04803c18a3f91d87f215857b250e1e7defd) Thanks [@juanrgm](https://github.com/juanrgm)! - Fix `packageTaskNames` filter
306
+
307
+ ## 0.11.2
308
+
309
+ ### Patch Changes
310
+
311
+ - [`9432df5`](https://github.com/swordev/datatruck/commit/9432df56f6c6444a59d98e79cf4b7db9f4d35854) Thanks [@juanrgm](https://github.com/juanrgm)! - Show zip progress
312
+
313
+ * [`c16daa2`](https://github.com/swordev/datatruck/commit/c16daa22d922bd610a161f37911fdb6f52666d38) Thanks [@juanrgm](https://github.com/juanrgm)! - Sort table names in the SQL dump tasks
314
+
315
+ ## 0.11.1
316
+
317
+ ### Patch Changes
318
+
319
+ - [`c65035c`](https://github.com/swordev/datatruck/commit/c65035cb6e9b8f5082f7b6d2ad59078ea1bd6abb) Thanks [@juanrgm](https://github.com/juanrgm)! - Fix WSL system patch
320
+
321
+ ## 0.11.0
322
+
323
+ ### Minor Changes
324
+
325
+ - [`8aa3c1a`](https://github.com/swordev/datatruck/commit/8aa3c1a1334870cc11b610b3b0a9bf10b0a97126) Thanks [@juanrgm](https://github.com/juanrgm)! - Add predefined output templates
326
+
327
+ ### Patch Changes
328
+
329
+ - [`763a724`](https://github.com/swordev/datatruck/commit/763a72473505232884e1b3871f2f4d1c55bb74d6) Thanks [@juanrgm](https://github.com/juanrgm)! - Fix file copy in WSL system
330
+
331
+ ## 0.10.0
332
+
333
+ ### Minor Changes
334
+
335
+ - [`bc9a0dd`](https://github.com/swordev/datatruck/commit/bc9a0ddf2bfb9353545c28d9cbd12e592328024e) Thanks [@juanrgm](https://github.com/juanrgm)! - Add `mirrorRepoNames` config option
336
+
337
+ ### Patch Changes
338
+
339
+ - [`795936c`](https://github.com/swordev/datatruck/commit/795936c1d2add7819ff5f40679313e1e594aeb7e) Thanks [@juanrgm](https://github.com/juanrgm)! - Show error stack trace if directory does not exist
340
+
341
+ * [`d0d77b6`](https://github.com/swordev/datatruck/commit/d0d77b6c3d4eb0461c176981b165e20b49826082) Thanks [@juanrgm](https://github.com/juanrgm)! - Update dependencies
342
+
343
+ ## 0.9.0
344
+
345
+ ### Minor Changes
346
+
347
+ - [`05de947`](https://github.com/swordev/datatruck/commit/05de947264727cddb79293eca6cb0b43382eab6b) Thanks [@juanrgm](https://github.com/juanrgm)! - Add `storedPrograms` config option in `mysql-dump` task
348
+
349
+ ### Patch Changes
350
+
351
+ - [`ef99bdf`](https://github.com/swordev/datatruck/commit/ef99bdf0301b5bbdf965c1fa1d00e78edce1c931) Thanks [@juanrgm](https://github.com/juanrgm)! - Update dependencies
352
+
353
+ ## 0.8.0
354
+
355
+ ### Minor Changes
356
+
357
+ - [`8c421ab`](https://github.com/swordev/datatruck/commit/8c421ab0adb6f2d5bc81e91fa387c5daa848f411) Thanks [@juanrgm](https://github.com/juanrgm)! - Add `--package-task` option to snapshot command
358
+
359
+ ## 0.7.0
360
+
361
+ ### Minor Changes
362
+
363
+ - [`3b8d6da`](https://github.com/swordev/datatruck/commit/3b8d6da01495799aceb848a63b35b8c46a7d1b0e) Thanks [@juanrgm](https://github.com/juanrgm)! - Add `--package-task` cli option
364
+
365
+ * [`69b34a0`](https://github.com/swordev/datatruck/commit/69b34a02b9cade48df2b071a92a8f79d5cfec23e) Thanks [@juanrgm](https://github.com/juanrgm)! - Allow restore multiple backups over the same database
366
+
367
+ - [`69caf26`](https://github.com/swordev/datatruck/commit/69caf26881272331bd4c8d7d345b3b85d33e33ac) Thanks [@juanrgm](https://github.com/juanrgm)! - Add cli short option to `--tag`
368
+
369
+ * [`377f0de`](https://github.com/swordev/datatruck/commit/377f0de345c9c8f45c772ac47e4ded81e91725d7) Thanks [@juanrgm](https://github.com/juanrgm)! - Rename cli short option to `-rt`
370
+
371
+ ### Patch Changes
372
+
373
+ - [`c03200a`](https://github.com/swordev/datatruck/commit/c03200a6347d1e9f9fdad86dcb22df30bbefcab4) Thanks [@juanrgm](https://github.com/juanrgm)! - Fix `sql-dump` tasks
374
+
375
+ * [`f56a4bc`](https://github.com/swordev/datatruck/commit/f56a4bcb429a674c13f32de73985cd67eb1acc23) Thanks [@juanrgm](https://github.com/juanrgm)! - Show full error message
376
+
377
+ - [`4324422`](https://github.com/swordev/datatruck/commit/4324422550474619811a8d455af55bc6e3b08aeb) Thanks [@juanrgm](https://github.com/juanrgm)! - Use connection port in `mysql-dump` task
378
+
379
+ ## 0.6.1
380
+
381
+ ### Patch Changes
382
+
383
+ - [`0ba6229`](https://github.com/swordev/datatruck/commit/0ba6229348c109a59783e72242ab7c0e61f25e36) Thanks [@juanrgm](https://github.com/juanrgm)! - Fix progress bar in restic repository
384
+
385
+ ## 0.6.0
386
+
387
+ ### Minor Changes
388
+
389
+ - [`0c6877d`](https://github.com/swordev/datatruck/commit/0c6877d189761e75dd434b0a8d72b71621d024de) Thanks [@juanrgm](https://github.com/juanrgm)! - Show more progress stats
390
+
391
+ * [`751e1f6`](https://github.com/swordev/datatruck/commit/751e1f6d6b33d3fa96eb40d998fdd140ce0e3875) Thanks [@juanrgm](https://github.com/juanrgm)! - Add `fileCopyConcurrency` option
392
+
393
+ - [`05487e6`](https://github.com/swordev/datatruck/commit/05487e6a33f875a3afb7ff0815b16da6f2a41301) Thanks [@juanrgm](https://github.com/juanrgm)! - Parse InnoDB error in `MariadbTask` to avoid infinite wait
394
+
395
+ ### Patch Changes
396
+
397
+ - [`b62a6f8`](https://github.com/swordev/datatruck/commit/b62a6f8a82409339afd65d4f96476eb57bbfb5a2) Thanks [@juanrgm](https://github.com/juanrgm)! - Resolve target/restore path in local repository
398
+
399
+ ## 0.5.0
400
+
401
+ ### Minor Changes
402
+
403
+ - [`5aeb2af`](https://github.com/swordev/datatruck/commit/5aeb2afb96692e00bdba501b58df9cc0e02dceaa) Thanks [@juanrgm](https://github.com/juanrgm)! - Add `enabled` option to repository config
404
+
405
+ * [`75de836`](https://github.com/swordev/datatruck/commit/75de8369356cf02ed3fd5c58b1f9bea66432cda8) Thanks [@juanrgm](https://github.com/juanrgm)! - Allow restic password without file
406
+
407
+ ## 0.4.0
408
+
409
+ ### Minor Changes
410
+
411
+ - [`eeb00a6`](https://github.com/swordev/datatruck/commit/eeb00a69d75c91da40711ae79475612b1d5193b6) Thanks [@juanrgm](https://github.com/juanrgm)! - Add `tempDir` config option
412
+
413
+ ## 0.3.2
414
+
415
+ ### Patch Changes
416
+
417
+ - [`8957c3b`](https://github.com/swordev/datatruck/commit/8957c3b5846606db8b825fef357445210f2a3ac3) Thanks [@juanrgm](https://github.com/juanrgm)! - Fix restic progress parser
418
+
419
+ * [`2989718`](https://github.com/swordev/datatruck/commit/29897185e3d6659359d51ab2212351005137f86c) Thanks [@juanrgm](https://github.com/juanrgm)! - Show closing reason
420
+
421
+ - [`b9e0843`](https://github.com/swordev/datatruck/commit/b9e0843c7970944cfd30a7d2a543f515adfa60e4) Thanks [@juanrgm](https://github.com/juanrgm)! - Show restic progress in megabytes
422
+
423
+ ## 0.3.1
424
+
425
+ ### Patch Changes
426
+
427
+ - [`c3bb4c6`](https://github.com/swordev/datatruck/commit/c3bb4c609887c5525cf35487ea237750addb6e75) Thanks [@juanrgm](https://github.com/juanrgm)! - Fix restic stdout parser
428
+
429
+ ## 0.3.0
430
+
431
+ ### Minor Changes
432
+
433
+ - [`d63fd25`](https://github.com/swordev/datatruck/commit/d63fd25ffa8d2e539d2125dfd6a3f55020086804) Thanks [@juanrgm](https://github.com/juanrgm)! - Add `snapshotDate` param
434
+
435
+ * [`486ef4a`](https://github.com/swordev/datatruck/commit/486ef4add27ae1dbfd166b16c257522f43537ecd) Thanks [@juanrgm](https://github.com/juanrgm)! - Resolve params in `include` and `exclude`
436
+
437
+ - [`617dae2`](https://github.com/swordev/datatruck/commit/617dae2c8ed90e6e65e8109f03cfad0e64bd7c02) Thanks [@juanrgm](https://github.com/juanrgm)! - Add `script` task
438
+
439
+ ### Patch Changes
440
+
441
+ - [`d1b3ea9`](https://github.com/swordev/datatruck/commit/d1b3ea9c9540d30898c00490963523a4fbc68193) Thanks [@juanrgm](https://github.com/juanrgm)! - Avoid use gitignore if is not necessary in restic repository
442
+
443
+ ## 0.2.0
444
+
445
+ ### Minor Changes
446
+
447
+ - [`120460c`](https://github.com/swordev/datatruck/commit/120460c8824cef4184e43f571a4cc0798b899b66) Thanks [@juanrgm](https://github.com/juanrgm)! - Enable `include` option in restic repository
448
+
449
+ ### Patch Changes
450
+
451
+ - [`e30ede3`](https://github.com/swordev/datatruck/commit/e30ede371bc7ab3fc1cd47758fdac7a28e8e2705) Thanks [@juanrgm](https://github.com/juanrgm)! - Resolve `RESTIC_PASSWORD_FILE` path
452
+
453
+ * [`8539d28`](https://github.com/swordev/datatruck/commit/8539d285b2c51d700aa811cd772d573fa0d613eb) Thanks [@juanrgm](https://github.com/juanrgm)! - Allow empty backup in restic repository
454
+
455
+ ## 0.1.0
456
+
457
+ ### Minor Changes
458
+
459
+ - [`88d46cd`](https://github.com/swordev/datatruck/commit/88d46cd56293df4c6fc21a9ad61d6236ac91f325) Thanks [@juanrgm](https://github.com/juanrgm)! - Add `custom` output format
460
+
461
+ ### Patch Changes
462
+
463
+ - [`24a1e5e`](https://github.com/swordev/datatruck/commit/24a1e5e86336e7a92556287e49548dc542f0e579) Thanks [@juanrgm](https://github.com/juanrgm)! - Update dependencies
464
+
465
+ ## 0.0.6
466
+
467
+ ### Patch Changes
468
+
469
+ - [`8de6e6c`](https://github.com/swordev/datatruck/commit/8de6e6ceddb59635cb4634d884e7690eeaf59bac) Thanks [@juanrgm](https://github.com/juanrgm)! - Publish migrations
470
+
471
+ ## 0.0.5
472
+
473
+ ### Patch Changes
474
+
475
+ - [`78cb0c1`](https://github.com/swordev/datatruck/commit/78cb0c17558543841cd7080dc4c672e6cbfd5634) Thanks [@juanrgm](https://github.com/juanrgm)! - Fix docker image
476
+
477
+ ## 0.0.4
478
+
479
+ ### Patch Changes
480
+
481
+ - [`d9e534b`](https://github.com/swordev/datatruck/commit/d9e534bd968acf9cd1c93f20e6152c004cb1f23b) Thanks [@juanrgm](https://github.com/juanrgm)! - Fix package file read
482
+
483
+ * [`b882c58`](https://github.com/swordev/datatruck/commit/b882c58183e9a75abc876645e18d7b67186dd662) Thanks [@juanrgm](https://github.com/juanrgm)! - Fix read of migrations
484
+
485
+ ## 0.0.3
486
+
487
+ ### Patch Changes
488
+
489
+ - [`051a7da`](https://github.com/swordev/datatruck/commit/051a7da225fcfea1c30a4fbfa8aea1b8f5538367) Thanks [@juanrgm](https://github.com/juanrgm)! - Fix dist files
490
+
491
+ ## 0.0.2
492
+
493
+ ### Patch Changes
494
+
495
+ - [`0911351`](https://github.com/swordev/datatruck/commit/09113517e1a77f2d2a1e19e4c3d9af7da1e28415) Thanks [@juanrgm](https://github.com/juanrgm)! - Publish docker image
@@ -1,7 +1,8 @@
1
+ import { BackupAction } from "../Action/BackupAction";
1
2
  import { RepositoryConfigType } from "../Config/RepositoryConfig";
2
- import { If } from "../utils/ts";
3
+ import { If, Unwrap } from "../utils/ts";
3
4
  import { CommandAbstract } from "./CommandAbstract";
4
- export type BackupCommandOptionsType<TResolved = false> = {
5
+ export type BackupCommandOptions<TResolved = false> = {
5
6
  package?: If<TResolved, string[]>;
6
7
  packageTask?: If<TResolved, string[]>;
7
8
  repository?: If<TResolved, string[]>;
@@ -10,7 +11,8 @@ export type BackupCommandOptionsType<TResolved = false> = {
10
11
  dryRun?: boolean;
11
12
  date?: string;
12
13
  };
13
- export declare class BackupCommand extends CommandAbstract<BackupCommandOptionsType<false>, BackupCommandOptionsType<true>> {
14
- onOptions(): import("../utils/cli").OptionsType<BackupCommandOptionsType<false>, BackupCommandOptionsType<true>>;
14
+ export type BackupCommandResult = Unwrap<BackupAction["exec"]>;
15
+ export declare class BackupCommand extends CommandAbstract<BackupCommandOptions<false>, BackupCommandOptions<true>> {
16
+ onOptions(): import("../utils/cli").OptionsType<BackupCommandOptions<false>, BackupCommandOptions<true>>;
15
17
  onExec(): Promise<0 | 1>;
16
18
  }
@@ -3,10 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.BackupCommand = void 0;
4
4
  const BackupAction_1 = require("../Action/BackupAction");
5
5
  const ConfigAction_1 = require("../Action/ConfigAction");
6
- const AppError_1 = require("../Error/AppError");
7
- const ConsoleSessionDriver_1 = require("../SessionDriver/ConsoleSessionDriver");
8
- const SqliteSessionDriver_1 = require("../SessionDriver/SqliteSessionDriver");
9
- const BackupSessionManager_1 = require("../SessionManager/BackupSessionManager");
10
6
  const string_1 = require("../utils/string");
11
7
  const CommandAbstract_1 = require("./CommandAbstract");
12
8
  class BackupCommand extends CommandAbstract_1.CommandAbstract {
@@ -59,30 +55,17 @@ class BackupCommand extends CommandAbstract_1.CommandAbstract {
59
55
  dryRun: this.options.dryRun,
60
56
  verbose: verbose > 0,
61
57
  date: this.options.date,
62
- });
63
- const sessionManager = new BackupSessionManager_1.BackupSessionManager({
64
- driver: new SqliteSessionDriver_1.SqliteSessionDriver({
65
- verbose: verbose > 1,
66
- }),
67
- altDrivers: [
68
- new ConsoleSessionDriver_1.ConsoleSessionDriver({
69
- verbose: verbose > 0,
70
- progress: this.globalOptions.progress,
71
- }),
72
- ],
73
- verbose: verbose > 1,
58
+ tty: this.globalOptions.tty,
59
+ progress: this.globalOptions.progress,
74
60
  progressInterval: this.globalOptions.progressInterval,
61
+ streams: this.streams,
75
62
  });
76
- const result = await backup.exec(sessionManager);
77
- if (result.errors.length) {
78
- return 1;
79
- }
80
- else if (!result.total) {
81
- throw new AppError_1.AppError("None package config found");
82
- }
83
- else {
84
- return 0;
85
- }
63
+ const result = await backup.exec();
64
+ if (this.globalOptions.outputFormat)
65
+ backup
66
+ .dataFormat(result, { streams: this.streams, verbose })
67
+ .log(this.globalOptions.outputFormat);
68
+ return result.some((item) => item.error) ? 1 : 0;
86
69
  }
87
70
  }
88
71
  exports.BackupCommand = BackupCommand;
@@ -1,6 +1,6 @@
1
1
  import { CommandAbstract } from "./CommandAbstract";
2
- export type CleanCacheCommandOptionsType<TResolved = false> = {};
3
- export declare class CleanCacheCommand extends CommandAbstract<CleanCacheCommandOptionsType<false>, CleanCacheCommandOptionsType<true>> {
4
- onOptions(): import("../utils/cli").OptionsType<CleanCacheCommandOptionsType<false>, CleanCacheCommandOptionsType<true>>;
5
- onExec(): Promise<number>;
2
+ export type CleanCacheCommandOptions<TResolved = false> = {};
3
+ export declare class CleanCacheCommand extends CommandAbstract<CleanCacheCommandOptions<false>, CleanCacheCommandOptions<true>> {
4
+ onOptions(): import("../utils/cli").OptionsType<CleanCacheCommandOptions<false>, CleanCacheCommandOptions<true>>;
5
+ onExec(): Promise<0 | 1>;
6
6
  }
@@ -1,20 +1,41 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.CleanCacheCommand = void 0;
4
7
  const CleanCacheAction_1 = require("../Action/CleanCacheAction");
5
- const fs_1 = require("../utils/fs");
8
+ const DataFormat_1 = require("../utils/DataFormat");
6
9
  const CommandAbstract_1 = require("./CommandAbstract");
10
+ const bytes_1 = __importDefault(require("bytes"));
7
11
  class CleanCacheCommand extends CommandAbstract_1.CommandAbstract {
8
12
  onOptions() {
9
13
  return this.returnsOptions({});
10
14
  }
11
15
  async onExec() {
12
- const action = new CleanCacheAction_1.CleanCacheAction({
16
+ const cleanCache = new CleanCacheAction_1.CleanCacheAction({
13
17
  verbose: !!this.globalOptions.verbose,
14
18
  });
15
- console.info(`Cleaning ${(0, fs_1.parentTmpDir)()}...`);
16
- await action.exec();
17
- return 0;
19
+ const result = await cleanCache.exec();
20
+ const dataFormat = new DataFormat_1.DataFormat({
21
+ streams: this.streams,
22
+ json: result,
23
+ table: {
24
+ headers: [
25
+ {
26
+ value: "Path",
27
+ },
28
+ {
29
+ value: "Freed disk space",
30
+ },
31
+ ],
32
+ rows: () => [[result.path, (0, bytes_1.default)(result.freedSize)]],
33
+ },
34
+ });
35
+ await cleanCache.exec();
36
+ if (this.globalOptions.outputFormat)
37
+ dataFormat.log(this.globalOptions.outputFormat);
38
+ return result.errors.length ? 1 : 0;
18
39
  }
19
40
  }
20
41
  exports.CleanCacheCommand = CleanCacheCommand;
@@ -1,21 +1,24 @@
1
1
  import { ConfigType } from "../Config/Config";
2
2
  import { FormatType } from "../utils/DataFormat";
3
3
  import { OptionsType } from "../utils/cli";
4
- import { SimilarObject } from "../utils/ts";
5
- export type GlobalOptionsType<TResolved = false> = {
4
+ import { Streams } from "../utils/stream";
5
+ import { If, SimilarObject } from "../utils/ts";
6
+ export type GlobalOptions<TResolved = false> = {
6
7
  config: string | ConfigType;
7
8
  outputFormat?: FormatType;
8
9
  verbose?: number;
9
- progress?: "auto" | "plain" | "tty";
10
+ tty?: If<TResolved, "auto" | boolean, "auto" | "true" | "false">;
11
+ progress?: If<TResolved, "auto" | boolean, "auto" | "true" | "false" | "interval">;
10
12
  progressInterval?: number;
11
13
  };
12
- export type CommandConstructorType<TUnresolvedOptions, TOptions extends SimilarObject<TUnresolvedOptions>> = {
13
- new (globalOptions: GlobalOptionsType<true>, options: TOptions): CommandAbstract<TUnresolvedOptions, TOptions>;
14
+ export type CommandConstructor<TUnresolvedOptions, TOptions extends SimilarObject<TUnresolvedOptions>> = {
15
+ new (globalOptions: GlobalOptions<true>, options: TOptions): CommandAbstract<TUnresolvedOptions, TOptions>;
14
16
  };
15
17
  export declare abstract class CommandAbstract<TUnresolvedOptions, TOptions extends SimilarObject<TUnresolvedOptions>> {
16
- readonly globalOptions: GlobalOptionsType<true>;
18
+ readonly globalOptions: GlobalOptions<true>;
17
19
  readonly options: TOptions;
18
- constructor(globalOptions: GlobalOptionsType<true>, options: TUnresolvedOptions);
20
+ readonly streams: Streams;
21
+ constructor(globalOptions: GlobalOptions<true>, options: TUnresolvedOptions, streams?: Partial<Streams>);
19
22
  abstract onOptions(): OptionsType<TUnresolvedOptions, TOptions>;
20
23
  protected returnsOptions(options: OptionsType<TUnresolvedOptions, TOptions>): OptionsType<TUnresolvedOptions, TOptions>;
21
24
  abstract onExec(): Promise<number>;