@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,8 +1,7 @@
1
1
  import { BaseCommand } from "../../../BaseCommand.js";
2
- export default class AppCreateWordpress extends BaseCommand<typeof AppCreateWordpress> {
2
+ export default class AppCreateWordpress extends BaseCommand {
3
3
  static description: string;
4
4
  static flags: {
5
- "project-id": import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
6
5
  version: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
7
6
  host: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
8
7
  "admin-user": import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
@@ -1,17 +1,13 @@
1
1
  import { Flags, ux } from "@oclif/core";
2
2
  import { BaseCommand } from "../../../BaseCommand.js";
3
3
  import { getAppUuidFromAppName } from "../../../lib/app/appHelpers.js";
4
- import { getLatestAvailableAppVersionForApp, getAppVersionUuidFromAppVersion, } from "../../../lib/app/appVersionHelpers.js";
4
+ import { getAppVersionUuidFromAppVersion, getLatestAvailableAppVersionForApp, } from "../../../lib/app/appVersionHelpers.js";
5
5
  import { assertStatus } from "@mittwald/api-client-commons";
6
- import { normalizeProjectIdToUuid } from "../../../Helpers.js";
6
+ import { projectFlags, withProjectId } from "../../../lib/project/flags.js";
7
7
  export default class AppCreateWordpress extends BaseCommand {
8
8
  static description = "Creates new WordPress Installation.";
9
9
  static flags = {
10
- "project-id": Flags.string({
11
- char: "p",
12
- required: true,
13
- description: "ID of the Project, in which the App will be created.",
14
- }),
10
+ ...projectFlags,
15
11
  version: Flags.string({
16
12
  required: false,
17
13
  description: "Version of the App to be created - Defaults to latest",
@@ -43,10 +39,10 @@ export default class AppCreateWordpress extends BaseCommand {
43
39
  };
44
40
  async run() {
45
41
  ux.action.start("requesting installation for WordPress");
46
- const { flags } = await this.parse(AppCreateWordpress);
42
+ const { flags, args } = await this.parse(AppCreateWordpress);
47
43
  const app = "WordPress";
48
44
  const appUuid = await getAppUuidFromAppName(this.apiClient, app);
49
- const projectId = await normalizeProjectIdToUuid(this.apiClient, flags["project-id"]);
45
+ const projectId = await withProjectId(this.apiClient, flags, args, this.config);
50
46
  let appVersion;
51
47
  if (flags.version) {
52
48
  appVersion = await getAppVersionUuidFromAppVersion(this.apiClient, appUuid, flags.version);
@@ -1,5 +1,5 @@
1
1
  import { BaseCommand } from "../../BaseCommand.js";
2
- export default class List extends BaseCommand<typeof List> {
2
+ export default class List extends BaseCommand {
3
3
  static description: string;
4
4
  static flags: {
5
5
  project: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
@@ -1,6 +1,6 @@
1
1
  import { BaseCommand } from "../../BaseCommand.js";
2
2
  import { MittwaldAPIV2Client } from "@mittwald/api-client";
3
- export default class AppVersions extends BaseCommand<typeof AppVersions> {
3
+ export default class AppVersions extends BaseCommand {
4
4
  static description: string;
5
5
  static args: {
6
6
  app: import("@oclif/core/lib/interfaces/parser.js").Arg<string | undefined, Record<string, unknown>>;
@@ -0,0 +1,10 @@
1
+ import { RenderBaseCommand } from "../../rendering/react/RenderBaseCommand.js";
2
+ import { ReactNode } from "react";
3
+ export declare class Get extends RenderBaseCommand<typeof Get> {
4
+ static summary: string;
5
+ static description: string;
6
+ static flags: {
7
+ [x: string]: import("@oclif/core/lib/interfaces/parser.js").CompletableFlag<any>;
8
+ };
9
+ protected render(): ReactNode;
10
+ }
@@ -0,0 +1,39 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { RenderBaseCommand } from "../../rendering/react/RenderBaseCommand.js";
3
+ import { Context } from "../../lib/context.js";
4
+ import { SingleResult } from "../../rendering/react/components/SingleResult.js";
5
+ import { Value } from "../../rendering/react/components/Value.js";
6
+ import { usePromise } from "@mittwald/react-use-promise";
7
+ import { Note } from "../../rendering/react/components/Note.js";
8
+ import { Box } from "ink";
9
+ import { Set } from "./set.js";
10
+ import { RenderJson } from "../../rendering/react/json/RenderJson.js";
11
+ import { useRenderContext } from "../../rendering/react/context.js";
12
+ const GetContext = ({ ctx }) => {
13
+ const rows = {};
14
+ const { renderAsJson } = useRenderContext();
15
+ const values = {};
16
+ for (const key of ["project-id", "server-id", "org-id"]) {
17
+ const value = usePromise(ctx.getContextValue.bind(ctx), [key]);
18
+ if (value) {
19
+ rows[`--${key}`] = _jsx(Value, { children: value });
20
+ values[key] = value;
21
+ }
22
+ else {
23
+ rows[`--${key}`] = _jsx(Value, { notSet: true });
24
+ }
25
+ }
26
+ if (renderAsJson) {
27
+ return _jsx(RenderJson, { name: "context", data: values });
28
+ }
29
+ return (_jsx(_Fragment, { children: _jsxs(Box, { flexDirection: "column", children: [_jsx(SingleResult, { title: "Current CLI context", rows: rows }), _jsxs(Note, { marginY: 1, children: ["Use the ", _jsx(Value, { children: "mw context set" }), " command to set one of the values listed above."] })] }) }));
30
+ };
31
+ export class Get extends RenderBaseCommand {
32
+ static summary = "Print an overview of currently set context parameters";
33
+ static description = Set.description;
34
+ static flags = { ...RenderBaseCommand.buildFlags() };
35
+ render() {
36
+ const ctx = new Context(this.config);
37
+ return _jsx(GetContext, { ctx: ctx });
38
+ }
39
+ }
@@ -0,0 +1,11 @@
1
+ import { BaseCommand } from "../../BaseCommand.js";
2
+ export declare class Set extends BaseCommand {
3
+ static summary: string;
4
+ static description: string;
5
+ static flags: {
6
+ "project-id": import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
7
+ "server-id": import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
8
+ "org-id": import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
9
+ };
10
+ run(): Promise<void>;
11
+ }
@@ -0,0 +1,37 @@
1
+ import { Flags } from "@oclif/core";
2
+ import { Context } from "../../lib/context.js";
3
+ import { BaseCommand } from "../../BaseCommand.js";
4
+ import { normalizeProjectIdToUuid, normalizeServerIdToUuid, } from "../../Helpers.js";
5
+ export class Set extends BaseCommand {
6
+ static summary = "Set context values for the current project, org or server";
7
+ static description = "The context allows you to persistently set values for common parameters, like --project-id or --server-id, so you don't have to specify them on every command.";
8
+ static flags = {
9
+ "project-id": Flags.string({
10
+ description: "ID or short ID of a project",
11
+ }),
12
+ "server-id": Flags.string({
13
+ description: "ID or short ID of a server",
14
+ }),
15
+ "org-id": Flags.string({
16
+ description: "ID or short ID of an organization",
17
+ }),
18
+ };
19
+ async run() {
20
+ const { flags } = await this.parse(Set);
21
+ const ctx = new Context(this.config);
22
+ if (flags["project-id"]) {
23
+ const projectId = await normalizeProjectIdToUuid(this.apiClient, flags["project-id"]);
24
+ await ctx.setProjectId(projectId);
25
+ this.log(`Set project ID to ${projectId}`);
26
+ }
27
+ if (flags["server-id"]) {
28
+ const serverId = await normalizeServerIdToUuid(this.apiClient, flags["server-id"]);
29
+ await ctx.setServerId(serverId);
30
+ this.log(`Set server ID to ${serverId}`);
31
+ }
32
+ if (flags["org-id"]) {
33
+ await ctx.setOrgId(flags["org-id"]);
34
+ this.log(`Set organization ID to ${flags["org-id"]}`);
35
+ }
36
+ }
37
+ }
@@ -1,5 +1,5 @@
1
1
  import { BaseCommand } from "../../BaseCommand.js";
2
- export default class Close extends BaseCommand<typeof Close> {
2
+ export default class Close extends BaseCommand {
3
3
  static description: string;
4
4
  static args: {
5
5
  id: import("@oclif/core/lib/interfaces/parser.js").Arg<string, Record<string, unknown>>;
@@ -1,5 +1,5 @@
1
1
  import { BaseCommand } from "../../BaseCommand.js";
2
- export default class Create extends BaseCommand<typeof Create> {
2
+ export default class Create extends BaseCommand {
3
3
  static description: string;
4
4
  static flags: {
5
5
  title: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
@@ -1,5 +1,5 @@
1
1
  import { GeneratedConversationListConversations, } from "../../generated/conversation/listConversations.js";
2
- import { formatDate } from "../../lib/viewhelpers/date.js";
2
+ import { formatRelativeDate } from "../../lib/viewhelpers/date.js";
3
3
  export default class List extends GeneratedConversationListConversations {
4
4
  mapData(data) {
5
5
  return data;
@@ -19,7 +19,7 @@ export default class List extends GeneratedConversationListConversations {
19
19
  title: {},
20
20
  created: {
21
21
  header: "Created",
22
- get: (row) => formatDate(new Date(`${row.createdAt}`)) +
22
+ get: (row) => formatRelativeDate(new Date(`${row.createdAt}`)) +
23
23
  " by " +
24
24
  (row.createdBy ? row.createdBy.clearName : "unknown"),
25
25
  },
@@ -1,5 +1,5 @@
1
1
  import { BaseCommand } from "../../BaseCommand.js";
2
- export default class Reply extends BaseCommand<typeof Reply> {
2
+ export default class Reply extends BaseCommand {
3
3
  static description: string;
4
4
  static args: {
5
5
  id: import("@oclif/core/lib/interfaces/parser.js").Arg<string, Record<string, unknown>>;
@@ -1,5 +1,5 @@
1
1
  import { BaseCommand } from "../../BaseCommand.js";
2
- export default class Show extends BaseCommand<typeof Show> {
2
+ export default class Show extends BaseCommand {
3
3
  static description: string;
4
4
  static args: {
5
5
  id: import("@oclif/core/lib/interfaces/parser.js").Arg<string, Record<string, unknown>>;
@@ -2,7 +2,7 @@ import { BaseCommand } from "../../BaseCommand.js";
2
2
  import { Args } from "@oclif/core";
3
3
  import { normalizeConversationIdToUuid } from "../../Helpers.js";
4
4
  import { assertStatus } from "@mittwald/api-client-commons";
5
- import { formatDate } from "../../lib/viewhelpers/date.js";
5
+ import { formatRelativeDate } from "../../lib/viewhelpers/date.js";
6
6
  import { marked } from "marked";
7
7
  import TerminalRenderer from "marked-terminal";
8
8
  import chalk from "chalk";
@@ -33,7 +33,7 @@ export default class Show extends BaseCommand {
33
33
  printKeyValues({
34
34
  Title: conv.title,
35
35
  ID: conv.shortId,
36
- Opened: `${formatDate(conv.createdAt)} by ${conv.createdBy ? conv.createdBy.clearName : "Unknown User"}`,
36
+ Opened: `${formatRelativeDate(conv.createdAt)} by ${conv.createdBy ? conv.createdBy.clearName : "Unknown User"}`,
37
37
  Status: conv.status,
38
38
  });
39
39
  console.log();
@@ -47,7 +47,7 @@ export default class Show extends BaseCommand {
47
47
  const metaColor = chalk.gray;
48
48
  for (const msg of messagesResponse.data) {
49
49
  if (msg.type === "MESSAGE") {
50
- console.log(chalk.whiteBright.underline(`${msg.createdBy?.clearName}, ${formatDate(msg.createdAt)}`));
50
+ console.log(chalk.whiteBright.underline(`${msg.createdBy?.clearName}, ${formatRelativeDate(msg.createdAt)}`));
51
51
  const rendered = marked(msg.messageContent ?? "")
52
52
  .trim()
53
53
  .split("\n")
@@ -59,16 +59,16 @@ export default class Show extends BaseCommand {
59
59
  else {
60
60
  switch (msg.messageContent) {
61
61
  case "CONVERSATION_CREATED":
62
- console.log(metaColor(`CREATED, ${formatDate(msg.createdAt)}`));
62
+ console.log(metaColor(`CREATED, ${formatRelativeDate(msg.createdAt)}`));
63
63
  break;
64
64
  case "STATUS_OPEN":
65
- console.log(metaColor(`REOPENED, ${formatDate(msg.createdAt)}`));
65
+ console.log(metaColor(`REOPENED, ${formatRelativeDate(msg.createdAt)}`));
66
66
  break;
67
67
  case "STATUS_CLOSED":
68
- console.log(metaColor(`CLOSED, ${formatDate(msg.createdAt)}`));
68
+ console.log(metaColor(`CLOSED, ${formatRelativeDate(msg.createdAt)}`));
69
69
  break;
70
70
  default:
71
- console.log(metaColor(`${msg.messageContent}, ${formatDate(msg.createdAt)}`));
71
+ console.log(metaColor(`${msg.messageContent}, ${formatRelativeDate(msg.createdAt)}`));
72
72
  break;
73
73
  }
74
74
  console.log();
@@ -6,13 +6,14 @@ import { RenderBaseCommand } from "../../rendering/react/RenderBaseCommand.js";
6
6
  import { useRenderContext } from "../../rendering/react/context.js";
7
7
  import { UsePromiseRenderSetup } from "../../rendering/setup/usePromiseSetup.js";
8
8
  import { Box } from "ink";
9
- import { ConversationMeta } from "../../rendering/react/components/ConversationMeta.js";
9
+ import { ConversationMeta } from "../../rendering/react/components/Conversation/ConversationMeta.js";
10
10
  import { Args } from "@oclif/core";
11
- import { ConversationMessage } from "../../rendering/react/components/ConversationMessage.js";
11
+ import { ConversationMessages } from "../../rendering/react/components/Conversation/ConversationMessages.js";
12
12
  const usePromiseSetup = new UsePromiseRenderSetup();
13
13
  export default class Show extends RenderBaseCommand {
14
14
  static flags = {
15
15
  ...usePromiseSetup.flags,
16
+ ...RenderBaseCommand.buildFlags(),
16
17
  };
17
18
  static args = {
18
19
  conversationId: Args.string({
@@ -22,6 +23,7 @@ export default class Show extends RenderBaseCommand {
22
23
  render() {
23
24
  const { apiClient } = useRenderContext();
24
25
  const { conversationId } = this.args;
26
+ const usePromiseOptions = usePromiseSetup.getSetup(this.flags);
25
27
  const response = usePromise(apiClient.conversation.listMessagesByConversation, [
26
28
  {
27
29
  pathParameters: {
@@ -30,8 +32,9 @@ export default class Show extends RenderBaseCommand {
30
32
  },
31
33
  ], {
32
34
  loaderId: "listMessagesByConversation",
35
+ ...usePromiseOptions,
33
36
  });
34
37
  assertStatus(response, 200);
35
- return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Suspense, { fallback: null, children: _jsx(ConversationMeta, { id: conversationId }) }), _jsx(Box, { flexDirection: "column", children: response.data.map((msg, index) => (_jsx(ConversationMessage, { message: msg }, index))) })] }));
38
+ return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Suspense, { fallback: null, children: _jsx(ConversationMeta, { id: conversationId }) }), _jsx(ConversationMessages, { messages: response.data })] }));
36
39
  }
37
40
  }
@@ -1,9 +1,17 @@
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
+ import { ListBaseCommand } from "../../ListBaseCommand.js";
3
4
  import { SuccessfulResponse } from "../../types.js";
4
- import { GeneratedDomainListDomains, Response } from "../../generated/domain/listDomains.js";
5
5
  type ResponseItem = Simplify<MittwaldAPIV2.Paths.V2ProjectsProjectIdDomains.Get.Responses.$200.Content.ApplicationJson[number]>;
6
- export default class List extends GeneratedDomainListDomains<ResponseItem> {
7
- protected mapData(data: SuccessfulResponse<Response, 200>["data"]): MittwaldAPIV2.Components.Schemas.DomainDomain[];
6
+ export type PathParams = MittwaldAPIV2.Paths.V2ProjectsProjectIdDomains.Get.Parameters.Path;
7
+ export type Response = Awaited<ReturnType<MittwaldAPIV2Client["domain"]["listDomains"]>>;
8
+ export declare class List extends ListBaseCommand<typeof List, ResponseItem, Response> {
9
+ static description: string;
10
+ static args: {};
11
+ static flags: {
12
+ [x: string]: import("@oclif/core/lib/interfaces/parser.js").CompletableFlag<any> | import("@oclif/core/lib/interfaces/parser.js").OptionFlag<unknown>;
13
+ };
14
+ getData(): Promise<Response>;
15
+ protected mapData(data: SuccessfulResponse<Response, 200>["data"]): ResponseItem[] | Promise<ResponseItem[]>;
8
16
  }
9
17
  export {};
@@ -1,5 +1,19 @@
1
- import { GeneratedDomainListDomains, } from "../../generated/domain/listDomains.js";
2
- export default class List extends GeneratedDomainListDomains {
1
+ import { ListBaseCommand } from "../../ListBaseCommand.js";
2
+ import { projectFlags, withProjectId } from "../../lib/project/flags.js";
3
+ export class List extends ListBaseCommand {
4
+ static description = "List Domains belonging to a Project.";
5
+ static args = {};
6
+ static flags = {
7
+ ...ListBaseCommand.baseFlags,
8
+ ...projectFlags,
9
+ };
10
+ async getData() {
11
+ const projectId = await withProjectId(this.apiClient, this.flags, this.args, this.config);
12
+ const pathParams = { projectId };
13
+ return await this.apiClient.domain.listDomains({
14
+ pathParameters: pathParams,
15
+ });
16
+ }
3
17
  mapData(data) {
4
18
  return data;
5
19
  }
@@ -8,11 +8,13 @@ export class List extends ListBaseCommand {
8
8
  "project-id": Flags.string({
9
9
  description: "Project ID to filter by; if omitted this will list virtual hosts in all projects you have access to.",
10
10
  required: false,
11
- })
11
+ }),
12
12
  };
13
13
  async getData() {
14
14
  if (this.flags["project-id"]) {
15
- return await this.apiClient.domain.ingressListForProject({ pathParameters: { projectId: this.flags["project-id"] } });
15
+ return await this.apiClient.domain.ingressListForProject({
16
+ pathParameters: { projectId: this.flags["project-id"] },
17
+ });
16
18
  }
17
19
  return await this.apiClient.domain.ingressListAccessible({});
18
20
  }
@@ -29,7 +31,8 @@ export class List extends ListBaseCommand {
29
31
  projectId: { header: "Project ID" },
30
32
  hostname: {},
31
33
  paths: {
32
- get: r => r.paths.map(p => {
34
+ get: (r) => r.paths
35
+ .map((p) => {
33
36
  if ("directory" in p.target) {
34
37
  return `${p.path} -> directory (${p.target.directory})`;
35
38
  }
@@ -37,13 +40,13 @@ export class List extends ListBaseCommand {
37
40
  return `${p.path} -> url (${p.target.url})`;
38
41
  }
39
42
  return `${p.path} -> app (${p.target.installationId})`;
40
- }).join("\n")
43
+ })
44
+ .join("\n"),
41
45
  },
42
46
  ips: {
43
47
  header: "IP addresses",
44
- get: r => r.ips.v4.join(", ")
45
- }
48
+ get: (r) => r.ips.v4.join(", "),
49
+ },
46
50
  };
47
51
  }
48
- ;
49
52
  }
@@ -0,0 +1,12 @@
1
+ import { ExecRenderBaseCommand } from "../../rendering/react/ExecRenderBaseCommand.js";
2
+ type ResetResult = {
3
+ deleted: boolean;
4
+ };
5
+ export default class Reset extends ExecRenderBaseCommand<typeof Reset, ResetResult> {
6
+ static description: string;
7
+ protected authenticationRequired: boolean;
8
+ protected exec(): Promise<ResetResult>;
9
+ protected render(): null;
10
+ private tokenFileExists;
11
+ }
12
+ export {};
@@ -0,0 +1,39 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import * as fs from "fs/promises";
3
+ import { ExecRenderBaseCommand } from "../../rendering/react/ExecRenderBaseCommand.js";
4
+ import { Box, Text } from "ink";
5
+ import { Note } from "../../rendering/react/components/Note.js";
6
+ import { FancyProcessRenderer } from "../../rendering/react/process_fancy.js";
7
+ import { Filename } from "../../rendering/react/components/Filename.js";
8
+ export default class Reset extends ExecRenderBaseCommand {
9
+ static description = "Reset your local authentication state";
10
+ authenticationRequired = false;
11
+ async exec() {
12
+ const process = new FancyProcessRenderer("Resetting authentication state");
13
+ process.start();
14
+ if (await this.tokenFileExists()) {
15
+ const step = process.addStep(_jsxs(Text, { children: ["Deleting token file ", _jsx(Filename, { filename: this.getTokenFilename() })] }));
16
+ await fs.rm(this.getTokenFilename(), { force: true });
17
+ step.complete();
18
+ process.complete(_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { children: "Authentication state successfully reset" }), _jsx(Note, { children: "Please keep in mind that this does not invalidate the token on the server. Invalidate your API token using the mStudio web interface, or using the 'mw user api-token revoke' command." })] }));
19
+ return { deleted: true };
20
+ }
21
+ process.complete(_jsx(Text, { children: "No token file found, nothing to do" }));
22
+ return { deleted: false };
23
+ }
24
+ render() {
25
+ return null;
26
+ }
27
+ async tokenFileExists() {
28
+ try {
29
+ await fs.access(this.getTokenFilename());
30
+ return true;
31
+ }
32
+ catch (err) {
33
+ if (err instanceof Error && "code" in err && err.code === "ENOENT") {
34
+ return false;
35
+ }
36
+ throw err;
37
+ }
38
+ }
39
+ }
@@ -1,5 +1,5 @@
1
1
  import { BaseCommand } from "../../BaseCommand.js";
2
- export default class Status extends BaseCommand<typeof Status> {
2
+ export default class Status extends BaseCommand {
3
3
  static description: string;
4
4
  run(): Promise<void>;
5
5
  }
@@ -1,9 +1,10 @@
1
1
  import { BaseCommand } from "../../BaseCommand.js";
2
- export default class Token extends BaseCommand<typeof Token> {
2
+ export default class Token extends BaseCommand {
3
3
  static description: string;
4
4
  static flags: {
5
5
  overwrite: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
6
6
  };
7
+ authenticationRequired: boolean;
7
8
  run(): Promise<void>;
8
9
  private tokenFileExists;
9
10
  }
@@ -9,6 +9,7 @@ export default class Token extends BaseCommand {
9
9
  description: "overwrite existing token file",
10
10
  }),
11
11
  };
12
+ authenticationRequired = false;
12
13
  async run() {
13
14
  const { flags } = await this.parse(Token);
14
15
  if ((await this.tokenFileExists()) && !flags.overwrite) {
@@ -1,12 +1,20 @@
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
+ addressId: string;
5
+ }> {
3
6
  static description: string;
4
7
  static flags: {
5
- projectId: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
6
8
  address: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
7
9
  "catch-all": import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
8
10
  "enable-spam-protection": import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
9
11
  quota: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<number, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
12
+ quiet: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
10
13
  };
11
- run(): Promise<void>;
14
+ protected exec(): Promise<{
15
+ addressId: string;
16
+ }>;
17
+ protected render(executionResult: {
18
+ addressId: string;
19
+ }): ReactNode;
12
20
  }
@@ -1,15 +1,16 @@
1
- import { BaseCommand } from "../../../BaseCommand.js";
2
- import { normalizeProjectIdToUuid } from "../../../Helpers.js";
3
- import { Flags, ux } from "@oclif/core";
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Flags } from "@oclif/core";
4
3
  import { assertStatus } from "@mittwald/api-client-commons";
5
- export default class Create extends BaseCommand {
4
+ import { projectFlags, withProjectId } from "../../../lib/project/flags.js";
5
+ import { ExecRenderBaseCommand } from "../../../rendering/react/ExecRenderBaseCommand.js";
6
+ import { makeProcessRenderer, processFlags, } from "../../../rendering/react/process_flags.js";
7
+ import { Text } from "ink";
8
+ import { Success } from "../../../rendering/react/components/Success.js";
9
+ export default class Create extends ExecRenderBaseCommand {
6
10
  static description = "Create a new mail address";
7
11
  static flags = {
8
- projectId: Flags.string({
9
- char: "p",
10
- description: "Project ID or short ID",
11
- required: true,
12
- }),
12
+ ...projectFlags,
13
+ ...processFlags,
13
14
  address: Flags.string({
14
15
  char: "a",
15
16
  description: "Mail address",
@@ -28,25 +29,33 @@ export default class Create extends BaseCommand {
28
29
  default: 1024,
29
30
  }),
30
31
  };
31
- async run() {
32
+ async exec() {
32
33
  const { flags } = await this.parse(Create);
33
- const projectId = await normalizeProjectIdToUuid(this.apiClient, flags.projectId);
34
- const password = await ux.prompt("Mailbox password", { type: "hide" });
35
- ux.action.start("creating mail address");
36
- const response = await this.apiClient.mail.mailaddressCreate({
37
- pathParameters: { projectId },
38
- data: {
39
- address: flags.address,
40
- isCatchAll: flags["catch-all"],
41
- mailbox: {
42
- password,
43
- quotaInBytes: flags.quota * 1024 * 1024,
44
- enableSpamProtection: flags["enable-spam-protection"],
34
+ const projectId = await withProjectId(this.apiClient, flags, {}, this.config);
35
+ const process = makeProcessRenderer(flags, "Creating a new mail address");
36
+ const password = await process.addInput(_jsx(Text, { children: "Mailbox password" }), true);
37
+ const response = await process.runStep("creating mail address", async () => {
38
+ const response = await this.apiClient.mail.mailaddressCreate({
39
+ pathParameters: { projectId },
40
+ data: {
41
+ address: flags.address,
42
+ isCatchAll: flags["catch-all"],
43
+ mailbox: {
44
+ password,
45
+ quotaInBytes: flags.quota * 1024 * 1024,
46
+ enableSpamProtection: flags["enable-spam-protection"],
47
+ },
45
48
  },
46
- },
49
+ });
50
+ assertStatus(response, 201);
51
+ return response;
47
52
  });
48
- assertStatus(response, 201);
49
- ux.action.stop();
50
- this.log(response.data.id);
53
+ process.complete(_jsx(Success, { children: "Your mail address was successfully created." }));
54
+ return { addressId: response.data.id };
55
+ }
56
+ render(executionResult) {
57
+ if (this.flags.quiet) {
58
+ return executionResult.addressId;
59
+ }
51
60
  }
52
61
  }
@@ -4,6 +4,7 @@ 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
10
  id: import("@oclif/core/lib/interfaces/parser.js").Arg<string, Record<string, unknown>>;
@@ -1,10 +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 { GeneratedMailMailaddressList, Response, PathParams } from "../../../generated/mail/mailaddressList.js";
5
4
  import { ListColumns } from "../../../Formatter.js";
5
+ import { ListBaseCommand } from "../../../ListBaseCommand.js";
6
6
  type ResponseItem = Simplify<MittwaldAPIV2.Paths.V2ProjectsProjectIdMailaddresses.Get.Responses.$200.Content.ApplicationJson[number]>;
7
- export default class List extends GeneratedMailMailaddressList<ResponseItem> {
7
+ export type PathParams = MittwaldAPIV2.Paths.V2ProjectsProjectIdMailaddresses.Get.Parameters.Path;
8
+ export type Response = Awaited<ReturnType<MittwaldAPIV2Client["mail"]["mailaddressList"]>>;
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>;
8
16
  protected mapData(data: SuccessfulResponse<Response, 200>["data"]): MittwaldAPIV2.Components.Schemas.MailMailAddress[];
9
17
  protected mapParams(input: PathParams): Promise<PathParams>;
10
18
  protected getColumns(data: ResponseItem[]): ListColumns<ResponseItem>;