@mittwald/cli 1.0.0-alpha.8 → 1.0.0-alpha.9

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 (263) hide show
  1. package/README.md +129 -117
  2. package/dist/esm/BaseCommand.d.ts +1 -1
  3. package/dist/esm/DeleteBaseCommand.d.ts +6 -9
  4. package/dist/esm/DeleteBaseCommand.js +27 -21
  5. package/dist/esm/ExtendedBaseCommand.d.ts +1 -1
  6. package/dist/esm/Formatter.d.ts +5 -2
  7. package/dist/esm/Formatter.js +7 -2
  8. package/dist/esm/GetBaseCommand.d.ts +1 -1
  9. package/dist/esm/Helpers.d.ts +1 -0
  10. package/dist/esm/Helpers.js +7 -1
  11. package/dist/esm/ListBaseCommand.d.ts +1 -1
  12. package/dist/esm/ListBaseCommand.js +2 -2
  13. package/dist/esm/Printer.d.ts +6 -7
  14. package/dist/esm/Printer.js +3 -3
  15. package/dist/esm/Translator.d.ts +1 -0
  16. package/dist/esm/Translator.js +12 -1
  17. package/dist/esm/commands/app/delete.d.ts +1 -1
  18. package/dist/esm/commands/app/delete.js +1 -1
  19. package/dist/esm/commands/app/dependency/listSystemsoftwareversions.d.ts +1 -1
  20. package/dist/esm/commands/app/install/wordpress.d.ts +1 -2
  21. package/dist/esm/commands/app/install/wordpress.js +5 -9
  22. package/dist/esm/commands/app/list.d.ts +1 -1
  23. package/dist/esm/commands/app/versions.d.ts +1 -1
  24. package/dist/esm/commands/context/get.d.ts +10 -0
  25. package/dist/esm/commands/context/get.js +39 -0
  26. package/dist/esm/commands/context/set.d.ts +11 -0
  27. package/dist/esm/commands/context/set.js +37 -0
  28. package/dist/esm/commands/conversation/close.d.ts +1 -1
  29. package/dist/esm/commands/conversation/create.d.ts +1 -1
  30. package/dist/esm/commands/conversation/list.js +2 -2
  31. package/dist/esm/commands/conversation/reply.d.ts +1 -1
  32. package/dist/esm/commands/conversation/show.d.ts +1 -1
  33. package/dist/esm/commands/conversation/show.js +7 -7
  34. package/dist/esm/commands/conversation/show2.js +6 -3
  35. package/dist/esm/commands/domain/list.d.ts +12 -4
  36. package/dist/esm/commands/domain/list.js +16 -2
  37. package/dist/esm/commands/domain/virtualhost/list.js +10 -7
  38. package/dist/esm/commands/login/reset.d.ts +12 -0
  39. package/dist/esm/commands/login/reset.js +39 -0
  40. package/dist/esm/commands/login/status.d.ts +1 -1
  41. package/dist/esm/commands/login/token.d.ts +2 -1
  42. package/dist/esm/commands/login/token.js +1 -0
  43. package/dist/esm/commands/mail/address/create.d.ts +12 -4
  44. package/dist/esm/commands/mail/address/create.js +35 -26
  45. package/dist/esm/commands/mail/address/delete.d.ts +1 -0
  46. package/dist/esm/commands/mail/address/list.d.ts +11 -3
  47. package/dist/esm/commands/mail/address/list.js +23 -7
  48. package/dist/esm/commands/mail/deliverybox/list.d.ts +1 -1
  49. package/dist/esm/commands/mail/deliverybox/list.js +2 -2
  50. package/dist/esm/commands/org/list.js +1 -1
  51. package/dist/esm/commands/project/backup/list.d.ts +12 -5
  52. package/dist/esm/commands/project/backup/list.js +17 -9
  53. package/dist/esm/commands/project/create.d.ts +12 -4
  54. package/dist/esm/commands/project/create.js +32 -26
  55. package/dist/esm/commands/project/cronjob/execution/get.d.ts +15 -2
  56. package/dist/esm/commands/project/cronjob/execution/get.js +26 -5
  57. package/dist/esm/commands/project/cronjob/execution/list.d.ts +11 -4
  58. package/dist/esm/commands/project/cronjob/execution/list.js +27 -7
  59. package/dist/esm/commands/project/cronjob/execution/logs.d.ts +15 -0
  60. package/dist/esm/commands/project/cronjob/execution/logs.js +74 -0
  61. package/dist/esm/commands/project/cronjob/list.d.ts +12 -4
  62. package/dist/esm/commands/project/cronjob/list.js +24 -5
  63. package/dist/esm/commands/project/delete.d.ts +2 -1
  64. package/dist/esm/commands/project/delete.js +5 -11
  65. package/dist/esm/commands/project/filesystem/usage.d.ts +13 -3
  66. package/dist/esm/commands/project/filesystem/usage.js +51 -9
  67. package/dist/esm/commands/project/get.d.ts +13 -3
  68. package/dist/esm/commands/project/get.js +76 -9
  69. package/dist/esm/commands/project/invite/list-own.js +2 -2
  70. package/dist/esm/commands/project/invite/list.d.ts +1 -1
  71. package/dist/esm/commands/project/invite/list.js +2 -2
  72. package/dist/esm/commands/project/{list2.d.ts → list-react.d.ts} +3 -1
  73. package/dist/esm/commands/project/list-react.js +42 -0
  74. package/dist/esm/commands/project/membership/list-own.js +2 -2
  75. package/dist/esm/commands/project/membership/list.d.ts +1 -1
  76. package/dist/esm/commands/project/membership/list.js +2 -2
  77. package/dist/esm/commands/project/ssh.d.ts +2 -2
  78. package/dist/esm/commands/project/ssh.js +3 -8
  79. package/dist/esm/commands/project/update.d.ts +2 -2
  80. package/dist/esm/commands/project/update.js +6 -9
  81. package/dist/esm/commands/user/api-token/create.d.ts +9 -3
  82. package/dist/esm/commands/user/api-token/create.js +33 -15
  83. package/dist/esm/commands/user/api-token/list.js +4 -2
  84. package/dist/esm/commands/user/api-token/revoke.d.ts +8 -3
  85. package/dist/esm/commands/user/api-token/revoke.js +6 -6
  86. package/dist/esm/commands/user/session/list.js +4 -2
  87. package/dist/esm/commands/user/ssh-key/create.d.ts +6 -3
  88. package/dist/esm/commands/user/ssh-key/create.js +35 -18
  89. package/dist/esm/commands/user/ssh-key/delete.d.ts +5 -4
  90. package/dist/esm/commands/user/ssh-key/delete.js +7 -26
  91. package/dist/esm/lib/bytes.d.ts +1 -0
  92. package/dist/esm/lib/bytes.js +16 -0
  93. package/dist/esm/lib/context.d.ts +16 -0
  94. package/dist/esm/lib/context.js +42 -0
  95. package/dist/esm/lib/context_flags.d.ts +18 -0
  96. package/dist/esm/lib/context_flags.js +42 -0
  97. package/dist/esm/lib/project/flags.d.ts +5 -0
  98. package/dist/esm/lib/project/flags.js +3 -0
  99. package/dist/esm/lib/server/flags.d.ts +5 -0
  100. package/dist/esm/lib/server/flags.js +3 -0
  101. package/dist/esm/lib/viewhelpers/date.d.ts +2 -1
  102. package/dist/esm/lib/viewhelpers/date.js +9 -2
  103. package/dist/esm/lib/viewhelpers/removeLineBreaks.d.ts +1 -0
  104. package/dist/esm/lib/viewhelpers/removeLineBreaks.js +1 -0
  105. package/dist/esm/rendering/lib/getTerminalWidth.d.ts +1 -0
  106. package/dist/esm/rendering/lib/getTerminalWidth.js +2 -0
  107. package/dist/esm/rendering/react/ComponentPrinter.d.ts +7 -0
  108. package/dist/esm/rendering/react/ComponentPrinter.js +13 -0
  109. package/dist/esm/rendering/react/ExecRenderBaseCommand.d.ts +8 -0
  110. package/dist/esm/rendering/react/ExecRenderBaseCommand.js +15 -0
  111. package/dist/esm/rendering/react/RenderBaseCommand.d.ts +12 -0
  112. package/dist/esm/rendering/react/RenderBaseCommand.js +36 -4
  113. package/dist/esm/rendering/react/components/ByteFormat.d.ts +4 -0
  114. package/dist/esm/rendering/react/components/ByteFormat.js +12 -0
  115. package/dist/esm/rendering/react/components/{ConversationMessage.js → Conversation/ConversationMessage.js} +1 -1
  116. package/dist/esm/rendering/react/components/Conversation/ConversationMessages.d.ts +8 -0
  117. package/dist/esm/rendering/react/components/Conversation/ConversationMessages.js +13 -0
  118. package/dist/esm/rendering/react/components/{ConversationMeta.js → Conversation/ConversationMeta.js} +7 -3
  119. package/dist/esm/rendering/react/components/CreatedAt.d.ts +8 -0
  120. package/dist/esm/rendering/react/components/CreatedAt.js +10 -0
  121. package/dist/esm/rendering/react/components/Filename.d.ts +4 -0
  122. package/dist/esm/rendering/react/components/Filename.js +5 -0
  123. package/dist/esm/rendering/react/components/FormattedDate.d.ts +7 -0
  124. package/dist/esm/rendering/react/components/FormattedDate.js +18 -0
  125. package/dist/esm/rendering/react/components/Header.d.ts +2 -2
  126. package/dist/esm/rendering/react/components/IDAndShortID.d.ts +7 -0
  127. package/dist/esm/rendering/react/components/IDAndShortID.js +6 -0
  128. package/dist/esm/rendering/react/components/JSONView.d.ts +7 -0
  129. package/dist/esm/rendering/react/components/JSONView.js +3 -0
  130. package/dist/esm/rendering/react/components/ListItem.d.ts +3 -0
  131. package/dist/esm/rendering/react/components/ListItem.js +5 -0
  132. package/dist/esm/rendering/react/components/Note.d.ts +10 -0
  133. package/dist/esm/rendering/react/components/Note.js +8 -0
  134. package/dist/esm/rendering/react/components/ProjectEnabled.d.ts +6 -0
  135. package/dist/esm/rendering/react/components/ProjectEnabled.js +9 -0
  136. package/dist/esm/rendering/react/components/ProjectReadiness.d.ts +7 -0
  137. package/dist/esm/rendering/react/components/ProjectReadiness.js +16 -0
  138. package/dist/esm/rendering/react/components/ProjectStatus.d.ts +7 -0
  139. package/dist/esm/rendering/react/components/ProjectStatus.js +8 -0
  140. package/dist/esm/rendering/react/components/Render.d.ts +6 -0
  141. package/dist/esm/rendering/react/components/Render.js +5 -0
  142. package/dist/esm/rendering/react/components/SingleResult.d.ts +10 -0
  143. package/dist/esm/rendering/react/components/SingleResult.js +15 -0
  144. package/dist/esm/rendering/react/components/Success.d.ts +9 -0
  145. package/dist/esm/rendering/react/components/Success.js +6 -0
  146. package/dist/esm/rendering/react/components/Table/BodyCell.d.ts +7 -0
  147. package/dist/esm/rendering/react/components/Table/BodyCell.js +7 -0
  148. package/dist/esm/rendering/react/components/Table/BodyRow.d.ts +7 -0
  149. package/dist/esm/rendering/react/components/Table/BodyRow.js +7 -0
  150. package/dist/esm/rendering/react/components/Table/BodyRows.d.ts +7 -0
  151. package/dist/esm/rendering/react/components/Table/BodyRows.js +6 -0
  152. package/dist/esm/rendering/react/components/Table/CellData.d.ts +6 -0
  153. package/dist/esm/rendering/react/components/Table/CellData.js +32 -0
  154. package/dist/esm/rendering/react/components/Table/CellLayout.d.ts +8 -0
  155. package/dist/esm/rendering/react/components/Table/CellLayout.js +17 -0
  156. package/dist/esm/rendering/react/components/Table/HeaderCell.d.ts +7 -0
  157. package/dist/esm/rendering/react/components/Table/HeaderCell.js +7 -0
  158. package/dist/esm/rendering/react/components/Table/HeaderRow.d.ts +8 -0
  159. package/dist/esm/rendering/react/components/Table/HeaderRow.js +7 -0
  160. package/dist/esm/rendering/react/components/Table/RowLayout.d.ts +5 -0
  161. package/dist/esm/rendering/react/components/Table/RowLayout.js +3 -0
  162. package/dist/esm/rendering/react/components/Table/Table.d.ts +10 -0
  163. package/dist/esm/rendering/react/components/Table/Table.js +21 -0
  164. package/dist/esm/rendering/react/components/Table/context.d.ts +9 -0
  165. package/dist/esm/rendering/react/components/Table/context.js +7 -0
  166. package/dist/esm/rendering/react/components/Table/index.d.ts +1 -0
  167. package/dist/esm/rendering/react/components/Table/index.js +1 -0
  168. package/dist/esm/rendering/react/components/Table/model/Cell.d.ts +19 -0
  169. package/dist/esm/rendering/react/components/Table/model/Cell.js +24 -0
  170. package/dist/esm/rendering/react/components/Table/model/Column.d.ts +16 -0
  171. package/dist/esm/rendering/react/components/Table/model/Column.js +35 -0
  172. package/dist/esm/rendering/react/components/Table/model/ColumnName.d.ts +7 -0
  173. package/dist/esm/rendering/react/components/Table/model/ColumnName.js +17 -0
  174. package/dist/esm/rendering/react/components/Table/model/ColumnOptions.d.ts +25 -0
  175. package/dist/esm/rendering/react/components/Table/model/ColumnOptions.js +41 -0
  176. package/dist/esm/rendering/react/components/Table/model/Row.d.ts +14 -0
  177. package/dist/esm/rendering/react/components/Table/model/Row.js +37 -0
  178. package/dist/esm/rendering/react/components/Table/model/Table.d.ts +19 -0
  179. package/dist/esm/rendering/react/components/Table/model/Table.js +48 -0
  180. package/dist/esm/rendering/react/components/Table/model/index.d.ts +5 -0
  181. package/dist/esm/rendering/react/components/Table/model/index.js +5 -0
  182. package/dist/esm/rendering/react/components/Value.d.ts +5 -0
  183. package/dist/esm/rendering/react/components/Value.js +8 -0
  184. package/dist/esm/rendering/react/components/WithoutLineBreaks.d.ts +2 -0
  185. package/dist/esm/rendering/react/components/WithoutLineBreaks.js +7 -0
  186. package/dist/esm/rendering/react/context.d.ts +3 -2
  187. package/dist/esm/rendering/react/context.js +4 -1
  188. package/dist/esm/rendering/react/json/JsonCollectionProvider.d.ts +2 -0
  189. package/dist/esm/rendering/react/json/JsonCollectionProvider.js +10 -0
  190. package/dist/esm/rendering/react/json/JsonRenderer.d.ts +2 -0
  191. package/dist/esm/rendering/react/json/JsonRenderer.js +14 -0
  192. package/dist/esm/rendering/react/json/RenderJson.d.ts +7 -0
  193. package/dist/esm/rendering/react/json/RenderJson.js +19 -0
  194. package/dist/esm/rendering/react/json/context.d.ts +5 -0
  195. package/dist/esm/rendering/react/json/context.js +4 -0
  196. package/dist/esm/rendering/react/json/lib/unpackJsonData.d.ts +1 -0
  197. package/dist/esm/rendering/react/json/lib/unpackJsonData.js +5 -0
  198. package/dist/esm/rendering/react/lib/observable-value/ObservableValue.d.ts +10 -0
  199. package/dist/esm/rendering/react/lib/observable-value/ObservableValue.js +25 -0
  200. package/dist/esm/rendering/react/lib/observable-value/types.d.ts +2 -0
  201. package/dist/esm/rendering/react/lib/observable-value/types.js +1 -0
  202. package/dist/esm/rendering/react/lib/observable-value/useWatchObservableValue.d.ts +2 -0
  203. package/dist/esm/rendering/react/lib/observable-value/useWatchObservableValue.js +9 -0
  204. package/dist/esm/rendering/react/measure/MeasureChildren.d.ts +8 -0
  205. package/dist/esm/rendering/react/measure/MeasureChildren.js +19 -0
  206. package/dist/esm/rendering/react/measure/MeasureContextProvider.d.ts +2 -0
  207. package/dist/esm/rendering/react/measure/MeasureContextProvider.js +10 -0
  208. package/dist/esm/rendering/react/measure/MeasureRenderer.d.ts +2 -0
  209. package/dist/esm/rendering/react/measure/MeasureRenderer.js +22 -0
  210. package/dist/esm/rendering/react/measure/context.d.ts +18 -0
  211. package/dist/esm/rendering/react/measure/context.js +48 -0
  212. package/dist/esm/rendering/react/process.d.ts +42 -0
  213. package/dist/esm/rendering/react/process.js +24 -0
  214. package/dist/esm/rendering/react/process_fancy.d.ts +28 -0
  215. package/dist/esm/rendering/react/process_fancy.js +213 -0
  216. package/dist/esm/rendering/react/process_flags.d.ts +9 -0
  217. package/dist/esm/rendering/react/process_flags.js +15 -0
  218. package/dist/esm/rendering/react/process_quiet.d.ts +12 -0
  219. package/dist/esm/rendering/react/process_quiet.js +29 -0
  220. package/dist/esm/rendering/setup/FlagSupportedSetup.d.ts +2 -0
  221. package/dist/esm/rendering/setup/TableRenderSetup.d.ts +10 -12
  222. package/dist/esm/rendering/setup/TableRenderSetup.js +19 -6
  223. package/dist/esm/rendering/setup/usePromiseSetup.d.ts +4 -3
  224. package/package.json +52 -21
  225. package/.deps/client.tgz +0 -0
  226. package/.deps/commons.tgz +0 -0
  227. package/dist/esm/commands/project/filesystem/directories.d.ts +0 -3
  228. package/dist/esm/commands/project/filesystem/directories.js +0 -6
  229. package/dist/esm/commands/project/filesystem/file-content.d.ts +0 -3
  230. package/dist/esm/commands/project/filesystem/file-content.js +0 -6
  231. package/dist/esm/commands/project/filesystem/files.d.ts +0 -16
  232. package/dist/esm/commands/project/filesystem/files.js +0 -25
  233. package/dist/esm/commands/project/list1.d.ts +0 -7
  234. package/dist/esm/commands/project/list1.js +0 -18
  235. package/dist/esm/commands/project/list2.js +0 -26
  236. package/dist/esm/generated/cronjob/listCronjobs.d.ts +0 -13
  237. package/dist/esm/generated/cronjob/listCronjobs.js +0 -24
  238. package/dist/esm/generated/cronjob/listExecutions.d.ts +0 -13
  239. package/dist/esm/generated/cronjob/listExecutions.js +0 -24
  240. package/dist/esm/generated/domain/ingressListAccessible.d.ts +0 -13
  241. package/dist/esm/generated/domain/ingressListAccessible.js +0 -17
  242. package/dist/esm/generated/domain/ingressListForProject.d.ts +0 -13
  243. package/dist/esm/generated/domain/ingressListForProject.js +0 -24
  244. package/dist/esm/generated/domain/listDomains.d.ts +0 -13
  245. package/dist/esm/generated/domain/listDomains.js +0 -24
  246. package/dist/esm/generated/projectFileSystem/getDirectories.d.ts +0 -14
  247. package/dist/esm/generated/projectFileSystem/getDirectories.js +0 -24
  248. package/dist/esm/generated/projectFileSystem/getDiskUsage.d.ts +0 -14
  249. package/dist/esm/generated/projectFileSystem/getDiskUsage.js +0 -24
  250. package/dist/esm/generated/projectFileSystem/getFileContent.d.ts +0 -14
  251. package/dist/esm/generated/projectFileSystem/getFileContent.js +0 -24
  252. package/dist/esm/generated/projectFileSystem/getJwt.d.ts +0 -14
  253. package/dist/esm/generated/projectFileSystem/getJwt.js +0 -24
  254. package/dist/esm/generated/projectFileSystem/listFiles.d.ts +0 -13
  255. package/dist/esm/generated/projectFileSystem/listFiles.js +0 -24
  256. package/dist/esm/rendering/oclif/components/table.d.ts +0 -11
  257. package/dist/esm/rendering/oclif/components/table.js +0 -49
  258. package/dist/esm/rendering/react/components/Table.d.ts +0 -7
  259. package/dist/esm/rendering/react/components/Table.js +0 -4
  260. /package/dist/esm/rendering/react/components/{ConversationMessage.d.ts → Conversation/ConversationMessage.d.ts} +0 -0
  261. /package/dist/esm/rendering/react/components/{ConversationMeta.d.ts → Conversation/ConversationMeta.d.ts} +0 -0
  262. /package/dist/esm/rendering/react/components/{ConversationStatusUpdate.d.ts → Conversation/ConversationStatusUpdate.d.ts} +0 -0
  263. /package/dist/esm/rendering/react/components/{ConversationStatusUpdate.js → Conversation/ConversationStatusUpdate.js} +0 -0
@@ -1,14 +1,30 @@
1
- import { GeneratedMailMailaddressList, } from "../../../generated/mail/mailaddressList.js";
2
- import { normalizeProjectIdToUuid } from "../../../Helpers.js";
3
- import { formatDate } from "../../../lib/viewhelpers/date.js";
1
+ import { formatRelativeDate } from "../../../lib/viewhelpers/date.js";
4
2
  import { formatBytes } from "../../../lib/viewhelpers/size.js";
5
- export default class List extends GeneratedMailMailaddressList {
3
+ import { ListBaseCommand } from "../../../ListBaseCommand.js";
4
+ import { projectFlags, withProjectId } from "../../../lib/project/flags.js";
5
+ export class List extends ListBaseCommand {
6
+ static description = "Get all mail addresses for a project ID";
7
+ static args = {};
8
+ static flags = {
9
+ ...ListBaseCommand.baseFlags,
10
+ ...projectFlags,
11
+ };
12
+ async getData() {
13
+ const pathParams = {
14
+ projectId: this.flags["project-id"],
15
+ };
16
+ return await this.apiClient.mail.mailaddressList({
17
+ pathParameters: await this.mapParams(pathParams),
18
+ });
19
+ }
6
20
  mapData(data) {
7
21
  return data;
8
22
  }
9
23
  async mapParams(input) {
10
- input.projectId = await normalizeProjectIdToUuid(this.apiClient, input.projectId);
11
- return super.mapParams(input);
24
+ return {
25
+ ...input,
26
+ projectId: await withProjectId(this.apiClient, this.flags, this.args, this.config),
27
+ };
12
28
  }
13
29
  getColumns(data) {
14
30
  const baseColumns = super.getColumns(data);
@@ -40,7 +56,7 @@ export default class List extends GeneratedMailMailaddressList {
40
56
  },
41
57
  updatedAt: {
42
58
  header: "Updated at",
43
- get: (r) => formatDate(r.updatedAt),
59
+ get: (r) => formatRelativeDate(r.updatedAt),
44
60
  },
45
61
  };
46
62
  }
@@ -1,7 +1,7 @@
1
1
  import { Simplify } from "@mittwald/api-client-commons";
2
2
  import { MittwaldAPIV2 } from "@mittwald/api-client";
3
3
  import { SuccessfulResponse } from "../../../types.js";
4
- import { GeneratedMailDeliveryboxList, Response, PathParams } from "../../../generated/mail/deliveryboxList.js";
4
+ import { GeneratedMailDeliveryboxList, PathParams, Response } from "../../../generated/mail/deliveryboxList.js";
5
5
  import { ListColumns } from "../../../Formatter.js";
6
6
  type ResponseItem = Simplify<MittwaldAPIV2.Paths.V2ProjectsProjectIdDeliveryboxes.Get.Responses.$200.Content.ApplicationJson[number]>;
7
7
  export default class List extends GeneratedMailDeliveryboxList<ResponseItem> {
@@ -1,6 +1,6 @@
1
1
  import { GeneratedMailDeliveryboxList, } from "../../../generated/mail/deliveryboxList.js";
2
2
  import { normalizeProjectIdToUuid } from "../../../Helpers.js";
3
- import { formatDate } from "../../../lib/viewhelpers/date.js";
3
+ import { formatRelativeDate } from "../../../lib/viewhelpers/date.js";
4
4
  export default class List extends GeneratedMailDeliveryboxList {
5
5
  mapData(data) {
6
6
  console.log(data);
@@ -18,7 +18,7 @@ export default class List extends GeneratedMailDeliveryboxList {
18
18
  description: {},
19
19
  updatedAt: {
20
20
  header: "Updated at",
21
- get: (r) => formatDate(r.updatedAt),
21
+ get: (r) => formatRelativeDate(r.updatedAt),
22
22
  },
23
23
  };
24
24
  }
@@ -19,7 +19,7 @@ export default class List extends GeneratedCustomerListCustomers {
19
19
  return `${r.owner.firstName} ${r.owner.lastName}, ${r.owner.company}`;
20
20
  }
21
21
  return `${r.owner.firstName} ${r.owner.lastName}`;
22
- }
22
+ },
23
23
  },
24
24
  memberCount: { header: "Members" },
25
25
  projectCount: { header: "Projects" },
@@ -1,12 +1,19 @@
1
1
  import { Simplify } from "@mittwald/api-client-commons";
2
- import { MittwaldAPIV2 } from "@mittwald/api-client";
2
+ import { MittwaldAPIV2, MittwaldAPIV2Client } from "@mittwald/api-client";
3
3
  import { SuccessfulResponse } from "../../../types.js";
4
- import { GeneratedBackupListProjectBackups, Response, PathParams } from "../../../generated/backup/listProjectBackups.js";
4
+ import { ListBaseCommand } from "../../../ListBaseCommand.js";
5
5
  import { ListColumns } from "../../../Formatter.js";
6
6
  type ResponseItem = Simplify<MittwaldAPIV2.Paths.V2ProjectsProjectIdBackups.Get.Responses.$200.Content.ApplicationJson[number]>;
7
- export default class List extends GeneratedBackupListProjectBackups<ResponseItem> {
8
- protected mapData(data: SuccessfulResponse<Response, 200>["data"]): MittwaldAPIV2.Components.Schemas.BackupProjectBackup[];
9
- protected mapParams(input: PathParams): Promise<PathParams>;
7
+ export type PathParams = MittwaldAPIV2.Paths.V2ProjectsProjectIdBackups.Get.Parameters.Path;
8
+ export type Response = Awaited<ReturnType<MittwaldAPIV2Client["backup"]["listProjectBackups"]>>;
9
+ export declare class List extends ListBaseCommand<typeof List, ResponseItem, Response> {
10
+ static description: string;
11
+ static args: {};
12
+ static flags: {
13
+ [x: string]: import("@oclif/core/lib/interfaces/parser.js").CompletableFlag<any> | import("@oclif/core/lib/interfaces/parser.js").OptionFlag<unknown>;
14
+ };
15
+ protected mapData(data: SuccessfulResponse<Response, 200>["data"]): ResponseItem[] | Promise<ResponseItem[]>;
16
+ getData(): Promise<Response>;
10
17
  protected getColumns(data: ResponseItem[]): ListColumns<ResponseItem>;
11
18
  }
12
19
  export {};
@@ -1,13 +1,21 @@
1
- import { GeneratedBackupListProjectBackups, } from "../../../generated/backup/listProjectBackups.js";
2
- import { normalizeProjectIdToUuid } from "../../../Helpers.js";
3
- import { formatDate } from "../../../lib/viewhelpers/date.js";
4
- export default class List extends GeneratedBackupListProjectBackups {
1
+ import { ListBaseCommand } from "../../../ListBaseCommand.js";
2
+ import { projectFlags, withProjectId } from "../../../lib/project/flags.js";
3
+ import { formatRelativeDate } from "../../../lib/viewhelpers/date.js";
4
+ export class List extends ListBaseCommand {
5
+ static description = "List Backups for a given Project.";
6
+ static args = {};
7
+ static flags = {
8
+ ...ListBaseCommand.baseFlags,
9
+ ...projectFlags,
10
+ };
5
11
  mapData(data) {
6
12
  return data;
7
13
  }
8
- async mapParams(input) {
9
- input.projectId = await normalizeProjectIdToUuid(this.apiClient, input.projectId);
10
- return super.mapParams(input);
14
+ async getData() {
15
+ const projectId = await withProjectId(this.apiClient, this.flags, {}, this.config);
16
+ return await this.apiClient.backup.listProjectBackups({
17
+ pathParameters: { projectId },
18
+ });
11
19
  }
12
20
  getColumns(data) {
13
21
  const baseColumns = super.getColumns(data);
@@ -15,9 +23,9 @@ export default class List extends GeneratedBackupListProjectBackups {
15
23
  id: baseColumns.id,
16
24
  status: {},
17
25
  createdAt: baseColumns.createdAt,
18
- expiresAt: {
26
+ expiresIn: {
19
27
  header: "Expires in",
20
- get: (r) => r.expiresAt ? formatDate(new Date(`${r.expiresAt}`)) : "never",
28
+ get: (r) => formatRelativeDate(r.expiresAt),
21
29
  },
22
30
  };
23
31
  }
@@ -1,10 +1,18 @@
1
- import { BaseCommand } from "../../BaseCommand.js";
2
- export default class Create extends BaseCommand<typeof Create> {
1
+ import { ExecRenderBaseCommand } from "../../rendering/react/ExecRenderBaseCommand.js";
2
+ import { ReactNode } from "react";
3
+ export default class Create extends ExecRenderBaseCommand<typeof Create, {
4
+ projectId: string;
5
+ }> {
3
6
  static description: string;
4
7
  static flags: {
5
- "server-id": import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
6
8
  description: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
7
9
  wait: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
10
+ quiet: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
8
11
  };
9
- run(): Promise<void>;
12
+ protected exec(): Promise<{
13
+ projectId: string;
14
+ }>;
15
+ protected render({ projectId }: {
16
+ projectId: string;
17
+ }): ReactNode;
10
18
  }
@@ -1,15 +1,17 @@
1
- import { Flags, ux } from "@oclif/core";
2
- import { BaseCommand } from "../../BaseCommand.js";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Flags } from "@oclif/core";
3
3
  import { assertStatus } from "@mittwald/api-client-commons";
4
- import { notify } from "../../lib/notify.js";
5
- export default class Create extends BaseCommand {
4
+ import { serverFlags, withServerId } from "../../lib/server/flags.js";
5
+ import { ExecRenderBaseCommand } from "../../rendering/react/ExecRenderBaseCommand.js";
6
+ import { Text } from "ink";
7
+ import { Success } from "../../rendering/react/components/Success.js";
8
+ import { Value } from "../../rendering/react/components/Value.js";
9
+ import { makeProcessRenderer, processFlags, } from "../../rendering/react/process_flags.js";
10
+ export default class Create extends ExecRenderBaseCommand {
6
11
  static description = "Get the details of a project";
7
12
  static flags = {
8
- "server-id": Flags.string({
9
- char: "s",
10
- required: true,
11
- description: "ID of the Server, in which the project is to be created.",
12
- }),
13
+ ...serverFlags,
14
+ ...processFlags,
13
15
  description: Flags.string({
14
16
  char: "d",
15
17
  required: true,
@@ -20,40 +22,44 @@ export default class Create extends BaseCommand {
20
22
  description: "Wait for the project to be ready.",
21
23
  }),
22
24
  };
23
- async run() {
25
+ async exec() {
24
26
  const { flags } = await this.parse(Create);
25
- const { description, "server-id": serverId } = flags;
26
- ux.action.start("creating project");
27
+ const { description } = flags;
28
+ const process = makeProcessRenderer(flags, "Creating project");
29
+ const serverId = await withServerId(this.apiClient, flags, {}, this.config);
30
+ const stepCreating = process.addStep(_jsx(Text, { children: "creating a new project" }));
27
31
  const result = await this.apiClient.project.createProject({
28
32
  pathParameters: { serverId },
29
- data: {
30
- description,
31
- },
33
+ data: { description },
32
34
  });
33
35
  assertStatus(result, 201);
34
36
  const eventId = result.headers["etag"];
35
- ux.action.stop("created");
36
- this.log(result.data.id);
37
+ stepCreating.complete();
38
+ process.addInfo(_jsxs(Text, { children: ["project ID: ", _jsx(Value, { children: result.data.id })] }));
37
39
  if (flags.wait) {
38
- ux.action.start("waiting for project to be ready");
40
+ const stepWaiting = process.addStep(_jsx(Text, { children: "waiting for project to be ready" }));
39
41
  let waited = 0;
40
42
  while (waited < 120) {
41
43
  const projectResponse = await this.apiClient.project.getProject({
42
44
  pathParameters: { id: result.data.id },
43
- headers: { "if-event-reached": eventId },
45
+ // TODO: Remove once @mittwald/api-client supports this
46
+ headers: { "if-event-reached": eventId }, // eslint-disable-line
44
47
  });
45
- assertStatus(projectResponse, 200);
46
- if (projectResponse.data.readiness === "ready") {
47
- notify({
48
- title: "Project is ready",
49
- message: `The project "${description}" is ready`,
50
- });
51
- ux.action.stop("ready");
48
+ if (projectResponse.status === 200 &&
49
+ projectResponse.data.readiness === "ready") {
50
+ stepWaiting.complete();
52
51
  break;
53
52
  }
54
53
  await new Promise((resolve) => setTimeout(resolve, 1000));
55
54
  waited++;
56
55
  }
57
56
  }
57
+ process.complete(_jsx(Success, { children: "Your new project was successfully created! \uD83D\uDE80" }));
58
+ return { projectId: result.data.id };
59
+ }
60
+ render({ projectId }) {
61
+ if (this.flags.quiet) {
62
+ return projectId;
63
+ }
58
64
  }
59
65
  }
@@ -1,3 +1,16 @@
1
- import { GeneratedCronjobGetExecution } from "../../../../generated/cronjob/getExecution.js";
2
- export default class Get extends GeneratedCronjobGetExecution {
1
+ import { MittwaldAPIV2, MittwaldAPIV2Client } from "@mittwald/api-client";
2
+ import { GetBaseCommand } from "../../../../GetBaseCommand.js";
3
+ export type PathParams = MittwaldAPIV2.Paths.V2CronjobsCronjobIdExecutionsExecutionId.Get.Parameters.Path;
4
+ type APIResponse = Awaited<ReturnType<MittwaldAPIV2Client["cronjob"]["getExecution"]>>;
5
+ export declare class Get extends GetBaseCommand<typeof Get, APIResponse> {
6
+ static description: string;
7
+ static flags: {
8
+ [x: string]: import("@oclif/core/lib/interfaces/parser.js").CompletableFlag<any>;
9
+ };
10
+ static args: {
11
+ "cronjob-id": import("@oclif/core/lib/interfaces/parser.js").Arg<string, Record<string, unknown>>;
12
+ "execution-id": import("@oclif/core/lib/interfaces/parser.js").Arg<string, Record<string, unknown>>;
13
+ };
14
+ protected getData(): Promise<APIResponse>;
3
15
  }
16
+ export {};
@@ -1,6 +1,27 @@
1
- /* eslint-disable */
2
- /* prettier-ignore */
3
- /* This file is auto-generated with acg (@mittwald/api-code-generator) */
4
- import { GeneratedCronjobGetExecution } from "../../../../generated/cronjob/getExecution.js";
5
- export default class Get extends GeneratedCronjobGetExecution {
1
+ import { GetBaseCommand } from "../../../../GetBaseCommand.js";
2
+ import { Args } from "@oclif/core";
3
+ export class Get extends GetBaseCommand {
4
+ static description = "Get a CronjobExecution.";
5
+ static flags = {
6
+ ...GetBaseCommand.baseFlags,
7
+ };
8
+ static args = {
9
+ "cronjob-id": Args.string({
10
+ description: "ID of the cronjob the execution belongs to",
11
+ required: true,
12
+ }),
13
+ "execution-id": Args.string({
14
+ description: "ID of the cronjob execution to be retrieved.",
15
+ required: true,
16
+ }),
17
+ };
18
+ async getData() {
19
+ const pathParameters = {
20
+ executionId: this.args["execution-id"],
21
+ cronjobId: this.args["cronjob-id"],
22
+ };
23
+ return await this.apiClient.cronjob.getExecution({
24
+ pathParameters,
25
+ });
26
+ }
6
27
  }
@@ -1,11 +1,18 @@
1
1
  import { Simplify } from "@mittwald/api-client-commons";
2
- import { MittwaldAPIV2 } from "@mittwald/api-client";
2
+ import { MittwaldAPIV2, MittwaldAPIV2Client } from "@mittwald/api-client";
3
3
  import { SuccessfulResponse } from "../../../../types.js";
4
- import { GeneratedCronjobListExecutions, Response } from "../../../../generated/cronjob/listExecutions.js";
5
4
  import { ListColumns } from "../../../../Formatter.js";
5
+ import { ListBaseCommand } from "../../../../ListBaseCommand.js";
6
6
  type ResponseItem = Simplify<MittwaldAPIV2.Paths.V2CronjobsCronjobIdExecutions.Get.Responses.$200.Content.ApplicationJson[number]>;
7
- export default class List extends GeneratedCronjobListExecutions<ResponseItem> {
7
+ export type Response = Awaited<ReturnType<MittwaldAPIV2Client["cronjob"]["listExecutions"]>>;
8
+ export declare class List extends ListBaseCommand<typeof List, ResponseItem, Response> {
9
+ static description: string;
10
+ static args: {};
11
+ static flags: {
12
+ "cronjob-id": import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
13
+ };
14
+ getData(): Promise<Response>;
8
15
  protected mapData(data: SuccessfulResponse<Response, 200>["data"]): MittwaldAPIV2.Components.Schemas.CronjobCronjobExecution[];
9
- protected getColumns(data: ResponseItem[]): ListColumns<ResponseItem>;
16
+ protected getColumns(): ListColumns<ResponseItem>;
10
17
  }
11
18
  export {};
@@ -1,21 +1,41 @@
1
- import { GeneratedCronjobListExecutions, } from "../../../../generated/cronjob/listExecutions.js";
2
- import { formatDate } from "../../../../lib/viewhelpers/date.js";
3
- export default class List extends GeneratedCronjobListExecutions {
1
+ import { ListBaseCommand } from "../../../../ListBaseCommand.js";
2
+ import { Flags } from "@oclif/core";
3
+ import { formatRelativeDate } from "../../../../lib/viewhelpers/date.js";
4
+ export class List extends ListBaseCommand {
5
+ static description = "List CronjobExecutions belonging to a Cronjob.";
6
+ static args = {};
7
+ static flags = {
8
+ ...ListBaseCommand.baseFlags,
9
+ "cronjob-id": Flags.string({
10
+ description: "ID of the Cronjob for which to list CronjobExecutions for.",
11
+ required: true,
12
+ }),
13
+ };
14
+ async getData() {
15
+ const pathParams = {
16
+ cronjobId: this.flags["cronjob-id"],
17
+ };
18
+ return await this.apiClient.cronjob.listExecutions({
19
+ pathParameters: pathParams,
20
+ });
21
+ }
4
22
  mapData(data) {
5
23
  return data;
6
24
  }
7
- getColumns(data) {
25
+ getColumns() {
8
26
  return {
9
27
  id: {},
10
28
  status: {},
11
29
  duration: {
12
- get: r => r.durationInMilliseconds ? Math.round(r.durationInMilliseconds / 1000) + "s" : "",
30
+ get: (r) => r.durationInMilliseconds
31
+ ? Math.round(r.durationInMilliseconds / 1000) + "s"
32
+ : "",
13
33
  },
14
34
  started: {
15
- get: r => formatDate(r.executionStart),
35
+ get: (r) => formatRelativeDate(r.executionStart),
16
36
  },
17
37
  ended: {
18
- get: r => formatDate(r.executionEnd),
38
+ get: (r) => formatRelativeDate(r.executionEnd),
19
39
  },
20
40
  };
21
41
  }
@@ -0,0 +1,15 @@
1
+ import { MittwaldAPIV2 } from "@mittwald/api-client";
2
+ import { BaseCommand } from "../../../../BaseCommand.js";
3
+ export type PathParams = MittwaldAPIV2.Paths.V2CronjobsCronjobIdExecutionsExecutionId.Get.Parameters.Path;
4
+ export declare class Logs extends BaseCommand {
5
+ static summary: string;
6
+ static description: string;
7
+ static flags: {
8
+ "no-pager": import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
9
+ };
10
+ static args: {
11
+ "cronjob-id": import("@oclif/core/lib/interfaces/parser.js").Arg<string, Record<string, unknown>>;
12
+ "execution-id": import("@oclif/core/lib/interfaces/parser.js").Arg<string, Record<string, unknown>>;
13
+ };
14
+ run(): Promise<void>;
15
+ }
@@ -0,0 +1,74 @@
1
+ import { GetBaseCommand } from "../../../../GetBaseCommand.js";
2
+ import { Args, Flags } from "@oclif/core";
3
+ import { BaseCommand } from "../../../../BaseCommand.js";
4
+ import { assertStatus } from "@mittwald/api-client-commons";
5
+ import * as cp from "child_process";
6
+ import * as fs from "fs";
7
+ import tempfile from "tempfile";
8
+ export class Logs extends BaseCommand {
9
+ static summary = "Get the log output of a cronjob execution.";
10
+ static description = "This command prints the log output of a cronjob execution. " +
11
+ "" +
12
+ 'When this command is run in a terminal, the output is piped through a pager. The pager is determined by your PAGER environment variable, with defaulting to "less". You can disable this behavior with the --no-pager flag.';
13
+ static flags = {
14
+ ...GetBaseCommand.baseFlags,
15
+ "no-pager": Flags.boolean({
16
+ description: "Disable pager for output.",
17
+ }),
18
+ };
19
+ static args = {
20
+ "cronjob-id": Args.string({
21
+ description: "ID of the cronjob the execution belongs to",
22
+ required: true,
23
+ }),
24
+ "execution-id": Args.string({
25
+ description: "ID of the cronjob execution to be retrieved.",
26
+ required: true,
27
+ }),
28
+ };
29
+ async run() {
30
+ const { flags, args } = await this.parse(Logs);
31
+ const cronjobId = args["cronjob-id"];
32
+ const executionId = args["execution-id"];
33
+ const usePager = process.stdin.isTTY && !flags["no-pager"];
34
+ const cronJob = await this.apiClient.cronjob.getCronjob({
35
+ pathParameters: { cronjobId },
36
+ });
37
+ const execution = await this.apiClient.cronjob.getExecution({
38
+ pathParameters: { cronjobId, executionId },
39
+ });
40
+ assertStatus(cronJob, 200);
41
+ assertStatus(execution, 200);
42
+ const projectId = cronJob.data.projectId;
43
+ if (!projectId) {
44
+ throw new Error("Cronjob has no project ID");
45
+ }
46
+ // TODO: Replace this with a call to the actual "getFileContent" method,
47
+ // once we support passing the required query parameters.
48
+ const response = await this.apiClient.axios.get(`/v2/projects/${projectId}/filesystem/files/raw`, {
49
+ params: {
50
+ file: execution.data.logPath,
51
+ inline: "true",
52
+ },
53
+ });
54
+ // await this.apiClient.projectFileSystem.getFileContent({
55
+ // pathParameters: { projectId },
56
+ // queryParameters: { file: execution.data.logPath, inline: true },
57
+ // });
58
+ if (usePager) {
59
+ const t = tempfile();
60
+ try {
61
+ fs.writeFileSync(t, response.data);
62
+ cp.spawnSync(process.env.PAGER || "less", [t], {
63
+ stdio: "inherit",
64
+ });
65
+ }
66
+ finally {
67
+ fs.unlinkSync(t);
68
+ }
69
+ }
70
+ else {
71
+ this.log(response.data);
72
+ }
73
+ }
74
+ }
@@ -1,11 +1,19 @@
1
1
  import { Simplify } from "@mittwald/api-client-commons";
2
- import { MittwaldAPIV2 } from "@mittwald/api-client";
2
+ import { MittwaldAPIV2, MittwaldAPIV2Client } from "@mittwald/api-client";
3
3
  import { SuccessfulResponse } from "../../../types.js";
4
- import { GeneratedCronjobListCronjobs, Response } from "../../../generated/cronjob/listCronjobs.js";
5
4
  import { ListColumns } from "../../../Formatter.js";
5
+ import { ListBaseCommand } from "../../../ListBaseCommand.js";
6
6
  type ResponseItem = Simplify<MittwaldAPIV2.Paths.V2ProjectsProjectIdCronjobs.Get.Responses.$200.Content.ApplicationJson[number]>;
7
- export default class List extends GeneratedCronjobListCronjobs<ResponseItem> {
8
- protected mapData(data: SuccessfulResponse<Response, 200>["data"]): MittwaldAPIV2.Components.Schemas.CronjobCronjob[];
7
+ export type PathParams = MittwaldAPIV2.Paths.V2ProjectsProjectIdCronjobs.Get.Parameters.Path;
8
+ export type Response = Awaited<ReturnType<MittwaldAPIV2Client["cronjob"]["listCronjobs"]>>;
9
+ export declare class List extends ListBaseCommand<typeof List, ResponseItem, Response> {
10
+ static description: string;
11
+ static args: {};
12
+ static flags: {
13
+ [x: string]: import("@oclif/core/lib/interfaces/parser.js").CompletableFlag<any> | import("@oclif/core/lib/interfaces/parser.js").OptionFlag<unknown>;
14
+ };
15
+ getData(): Promise<Response>;
16
+ protected mapData(data: SuccessfulResponse<Response, 200>["data"]): ResponseItem[] | Promise<ResponseItem[]>;
9
17
  protected getColumns(data: ResponseItem[]): ListColumns<ResponseItem>;
10
18
  }
11
19
  export {};
@@ -1,6 +1,21 @@
1
- import { GeneratedCronjobListCronjobs, } from "../../../generated/cronjob/listCronjobs.js";
2
- import { formatDate } from "../../../lib/viewhelpers/date.js";
3
- export default class List extends GeneratedCronjobListCronjobs {
1
+ import { formatRelativeDate } from "../../../lib/viewhelpers/date.js";
2
+ import { ListBaseCommand } from "../../../ListBaseCommand.js";
3
+ import { projectFlags, withProjectId } from "../../../lib/project/flags.js";
4
+ export class List extends ListBaseCommand {
5
+ static description = "List Cronjobs belonging to a Project.";
6
+ static args = {};
7
+ static flags = {
8
+ ...ListBaseCommand.baseFlags,
9
+ ...projectFlags,
10
+ };
11
+ async getData() {
12
+ const pathParams = {
13
+ projectId: await withProjectId(this.apiClient, this.flags, this.args, this.config),
14
+ };
15
+ return await this.apiClient.cronjob.listCronjobs({
16
+ pathParameters: pathParams,
17
+ });
18
+ }
4
19
  mapData(data) {
5
20
  return data;
6
21
  }
@@ -17,8 +32,12 @@ export default class List extends GeneratedCronjobListCronjobs {
17
32
  if (!r.latestExecution) {
18
33
  return "-";
19
34
  }
20
- return r.latestExecution.status + ", " + formatDate(r.latestExecution.start); // API specs are broken
21
- }
35
+ return (r.latestExecution.status +
36
+ ", " +
37
+ // API specs are broken
38
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
39
+ formatRelativeDate(r.latestExecution.start));
40
+ },
22
41
  },
23
42
  createdAt: baseColumns.createdAt,
24
43
  };
@@ -4,9 +4,10 @@ export default class Delete extends DeleteBaseCommand<typeof Delete> {
4
4
  static resourceName: string;
5
5
  static flags: {
6
6
  force: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
7
+ quiet: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
7
8
  };
8
9
  static args: {
9
- id: import("@oclif/core/lib/interfaces/parser.js").Arg<string, Record<string, unknown>>;
10
+ [x: string]: import("@oclif/core/lib/interfaces/parser.js").Arg<unknown>;
10
11
  };
11
12
  protected deleteResource(): Promise<void>;
12
13
  protected mapResourceId(id: string): Promise<string>;
@@ -1,22 +1,16 @@
1
- import { Args } from "@oclif/core";
2
1
  import { assertStatus } from "@mittwald/api-client-commons";
3
2
  import { normalizeProjectIdToUuid } from "../../Helpers.js";
4
3
  import { DeleteBaseCommand } from "../../DeleteBaseCommand.js";
4
+ import { projectArgs, withProjectId } from "../../lib/project/flags.js";
5
5
  export default class Delete extends DeleteBaseCommand {
6
6
  static description = "Delete a project";
7
7
  static resourceName = "project";
8
- static flags = {
9
- ...DeleteBaseCommand.baseFlags,
10
- };
11
- static args = {
12
- id: Args.string({
13
- required: true,
14
- description: "ID of the Project to be deleted.",
15
- }),
16
- };
8
+ static flags = { ...DeleteBaseCommand.baseFlags };
9
+ static args = { ...projectArgs };
17
10
  async deleteResource() {
11
+ const projectId = await withProjectId(this.apiClient, {}, this.args, this.config);
18
12
  const response = await this.apiClient.project.deleteProject({
19
- pathParameters: { projectId: this.args.id },
13
+ pathParameters: { projectId },
20
14
  });
21
15
  assertStatus(response, 200);
22
16
  }
@@ -1,4 +1,14 @@
1
- import { GeneratedProjectFileSystemGetDiskUsage, PathParams } from "../../../generated/projectFileSystem/getDiskUsage.js";
2
- export default class Get extends GeneratedProjectFileSystemGetDiskUsage {
3
- protected mapParams(input: PathParams): Promise<PathParams>;
1
+ import { MittwaldAPIV2 } from "@mittwald/api-client";
2
+ import { RenderBaseCommand } from "../../../rendering/react/RenderBaseCommand.js";
3
+ import { ReactNode } from "react";
4
+ export type PathParams = MittwaldAPIV2.Paths.V2ProjectsProjectIdFilesystemUsagesDisk.Get.Parameters.Path;
5
+ export declare class Usage extends RenderBaseCommand<typeof Usage> {
6
+ static description: string;
7
+ static flags: {
8
+ human: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
9
+ };
10
+ static args: {
11
+ [x: string]: import("@oclif/core/lib/interfaces/parser.js").Arg<unknown>;
12
+ };
13
+ protected render(): ReactNode;
4
14
  }