@mittwald/cli 1.0.0-alpha.21 → 1.0.0-alpha.24

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 (162) hide show
  1. package/README.md +145 -163
  2. package/dist/esm/Translator.js +2 -1
  3. package/dist/esm/commands/app/copy.js +1 -1
  4. package/dist/esm/commands/app/{install → create}/node.d.ts +3 -2
  5. package/dist/esm/commands/app/create/node.js +13 -0
  6. package/dist/esm/commands/app/{install → create}/php.d.ts +3 -2
  7. package/dist/esm/commands/app/create/php.js +13 -0
  8. package/dist/esm/commands/app/dependency/update.js +2 -2
  9. package/dist/esm/commands/app/dependency/versions.js +1 -1
  10. package/dist/esm/commands/app/list.js +6 -1
  11. package/dist/esm/commands/app/ssh.d.ts +11 -0
  12. package/dist/esm/commands/app/ssh.js +46 -0
  13. package/dist/esm/commands/app/uninstall.js +1 -1
  14. package/dist/esm/commands/app/versions.js +1 -1
  15. package/dist/esm/commands/conversation/close.js +1 -1
  16. package/dist/esm/commands/conversation/create.js +1 -1
  17. package/dist/esm/commands/conversation/reply.js +1 -1
  18. package/dist/esm/commands/conversation/show.js +2 -2
  19. package/dist/esm/commands/conversation/show2.js +1 -3
  20. package/dist/esm/commands/database/mysql/charsets.js +1 -3
  21. package/dist/esm/commands/database/mysql/create.js +3 -3
  22. package/dist/esm/commands/database/mysql/delete.js +1 -1
  23. package/dist/esm/commands/database/mysql/get.js +1 -1
  24. package/dist/esm/commands/database/mysql/list.js +1 -1
  25. package/dist/esm/commands/database/mysql/phpmyadmin.js +2 -2
  26. package/dist/esm/commands/database/mysql/user/get.js +1 -1
  27. package/dist/esm/commands/database/mysql/user/list.js +1 -3
  28. package/dist/esm/commands/database/redis/create.js +2 -2
  29. package/dist/esm/commands/database/redis/get.js +1 -1
  30. package/dist/esm/commands/database/redis/list.js +1 -1
  31. package/dist/esm/commands/domain/list.js +1 -3
  32. package/dist/esm/commands/domain/ownership/list.js +1 -1
  33. package/dist/esm/commands/domain/virtualhost/create.js +2 -2
  34. package/dist/esm/commands/domain/virtualhost/delete.js +1 -1
  35. package/dist/esm/commands/domain/virtualhost/get.js +4 -4
  36. package/dist/esm/commands/domain/virtualhost/list.js +1 -1
  37. package/dist/esm/commands/mail/address/create.js +1 -1
  38. package/dist/esm/commands/mail/address/delete.js +1 -1
  39. package/dist/esm/commands/mail/address/list.js +1 -3
  40. package/dist/esm/commands/mail/deliverybox/list.d.ts +11 -4
  41. package/dist/esm/commands/mail/deliverybox/list.js +13 -8
  42. package/dist/esm/commands/org/delete.js +1 -1
  43. package/dist/esm/commands/org/get.js +2 -2
  44. package/dist/esm/commands/org/invite/list-own.js +1 -1
  45. package/dist/esm/commands/org/invite/list.js +1 -1
  46. package/dist/esm/commands/org/invite/revoke.js +2 -2
  47. package/dist/esm/commands/org/invite.js +1 -1
  48. package/dist/esm/commands/org/list.js +1 -3
  49. package/dist/esm/commands/org/membership/list-own.js +2 -4
  50. package/dist/esm/commands/org/membership/list.d.ts +1 -0
  51. package/dist/esm/commands/org/membership/list.js +2 -2
  52. package/dist/esm/commands/org/membership/revoke.js +3 -3
  53. package/dist/esm/commands/project/backup/create.js +2 -2
  54. package/dist/esm/commands/project/backup/delete.js +1 -1
  55. package/dist/esm/commands/project/backup/download.js +3 -3
  56. package/dist/esm/commands/project/backup/list.js +1 -1
  57. package/dist/esm/commands/project/backupschedule/list.js +1 -1
  58. package/dist/esm/commands/project/create.js +2 -2
  59. package/dist/esm/commands/project/cronjob/execution/get.js +1 -1
  60. package/dist/esm/commands/project/cronjob/execution/list.js +1 -3
  61. package/dist/esm/commands/project/cronjob/execution/logs.js +4 -3
  62. package/dist/esm/commands/project/cronjob/list.js +1 -3
  63. package/dist/esm/commands/project/delete.js +1 -1
  64. package/dist/esm/commands/project/filesystem/usage.js +2 -2
  65. package/dist/esm/commands/project/get.js +4 -4
  66. package/dist/esm/commands/project/membership/list.js +1 -1
  67. package/dist/esm/commands/project/ssh.js +1 -1
  68. package/dist/esm/commands/user/api-token/revoke.js +1 -1
  69. package/dist/esm/commands/user/get.d.ts +14 -2
  70. package/dist/esm/commands/user/get.js +19 -5
  71. package/dist/esm/commands/user/ssh-key/delete.js +1 -1
  72. package/dist/esm/generated/conversation/getCategory.js +1 -1
  73. package/dist/esm/generated/conversation/getConversation.js +1 -1
  74. package/dist/esm/generated/conversation/listCategories.js +1 -3
  75. package/dist/esm/generated/conversation/listConversations.js +1 -3
  76. package/dist/esm/generated/conversation/listMessagesByConversation.js +1 -3
  77. package/dist/esm/generated/cronjob/getCronjob.js +1 -1
  78. package/dist/esm/generated/cronjob/getExecution.js +1 -1
  79. package/dist/esm/generated/domain/dnsZoneGetSpecific.js +1 -1
  80. package/dist/esm/generated/domain/dnsZonesForProject.js +1 -1
  81. package/dist/esm/generated/domain/getDomain.js +1 -1
  82. package/dist/esm/generated/domain/getHandleFields.js +1 -1
  83. package/dist/esm/generated/domain/getSpecificDomainOwnership.js +1 -1
  84. package/dist/esm/generated/file/getFile.js +1 -1
  85. package/dist/esm/generated/file/getFileMeta.js +1 -1
  86. package/dist/esm/generated/file/getFileTokenRules.js +1 -1
  87. package/dist/esm/generated/file/getFileTypeRules.js +1 -1
  88. package/dist/esm/generated/mail/deliveryboxGetSpecific.js +1 -1
  89. package/dist/esm/generated/mail/mailaddressGetSpecific.js +1 -1
  90. package/dist/esm/generated/mail/mailaddressList.js +1 -3
  91. package/dist/esm/generated/mail/projectsettingGetSpecific.js +1 -1
  92. package/dist/esm/generated/notification/newsletterGetInfo.js +1 -1
  93. package/dist/esm/generated/notification/scountUnreadNotifications.js +1 -1
  94. package/dist/esm/generated/notification/slistNotifications.js +1 -3
  95. package/dist/esm/generated/project/getProject.js +1 -1
  96. package/dist/esm/generated/project/getProjectInvite.js +1 -1
  97. package/dist/esm/generated/project/getProjectMembership.js +1 -1
  98. package/dist/esm/generated/project/getSelfMembershipForProject.js +1 -1
  99. package/dist/esm/generated/project/getServer.js +1 -1
  100. package/dist/esm/generated/project/listInvitesForProject.js +1 -3
  101. package/dist/esm/generated/project/listMembershipsForProject.js +1 -3
  102. package/dist/esm/generated/project/listProjectInvites.js +1 -3
  103. package/dist/esm/generated/project/listProjectMemberships.js +1 -3
  104. package/dist/esm/generated/project/listProjects.js +1 -3
  105. package/dist/esm/generated/project/listServers.js +1 -3
  106. package/dist/esm/generated/sshsftpUser/sftpUserGetSftpUser.js +1 -1
  107. package/dist/esm/generated/sshsftpUser/sftpUserListSftpUsers.js +1 -3
  108. package/dist/esm/generated/sshsftpUser/sshUserGetSshUser.js +1 -1
  109. package/dist/esm/generated/sshsftpUser/sshUserListSshUsers.js +1 -3
  110. package/dist/esm/generated/user/getApiToken.js +1 -1
  111. package/dist/esm/generated/user/getPersonalizedSettings.js +1 -1
  112. package/dist/esm/generated/user/getSession.js +1 -1
  113. package/dist/esm/generated/user/getSshKey.js +1 -1
  114. package/dist/esm/generated/user/listApiTokens.js +1 -3
  115. package/dist/esm/generated/user/listFeedback.js +1 -3
  116. package/dist/esm/generated/user/listSessions.js +1 -3
  117. package/dist/esm/generated/user/listSshKeys.js +1 -3
  118. package/dist/esm/lib/app/Installer.d.ts +1 -1
  119. package/dist/esm/lib/app/Installer.js +2 -2
  120. package/dist/esm/lib/app/flags.d.ts +1 -0
  121. package/dist/esm/lib/app/flags.js +6 -0
  122. package/dist/esm/lib/app/hooks.js +7 -8
  123. package/dist/esm/lib/app/install.js +24 -1
  124. package/dist/esm/lib/app/uuid.js +2 -1
  125. package/dist/esm/lib/app/versions.js +2 -6
  126. package/dist/esm/lib/app/wait.js +1 -1
  127. package/dist/esm/lib/database/common.js +1 -1
  128. package/dist/esm/lib/database/mysql/connect.js +2 -2
  129. package/dist/esm/lib/database/mysql/flags.js +1 -1
  130. package/dist/esm/lib/database/redis/connect.js +1 -1
  131. package/dist/esm/lib/database/redis/flags.js +1 -1
  132. package/dist/esm/lib/project/hooks.js +1 -1
  133. package/dist/esm/lib/project/ingress.js +1 -1
  134. package/dist/esm/lib/project/shortId.js +1 -1
  135. package/dist/esm/lib/projectbackup/hooks.js +2 -2
  136. package/dist/esm/rendering/lib/getTerminalWidth.d.ts +1 -1
  137. package/dist/esm/rendering/lib/getTerminalWidth.js +1 -1
  138. package/dist/esm/rendering/react/RenderBaseCommand.js +5 -1
  139. package/dist/esm/rendering/react/components/AppInstallation/AppInstallationDetails.js +6 -2
  140. package/dist/esm/rendering/react/components/Conversation/ConversationMeta.js +1 -3
  141. package/dist/esm/rendering/react/components/Table/model/Column.d.ts +1 -1
  142. package/dist/esm/rendering/react/components/Table/model/Column.js +5 -2
  143. package/dist/esm/rendering/react/components/Table/model/ColumnOptions.js +1 -1
  144. package/dist/esm/rendering/react/hooks/useIncreaseInkStdoutColumns.d.ts +1 -0
  145. package/dist/esm/rendering/react/hooks/useIncreaseInkStdoutColumns.js +9 -0
  146. package/dist/esm/rendering/react/hooks/useMyUserProfile.js +1 -3
  147. package/dist/esm/rendering/react/measure/MeasureContextProvider.js +6 -2
  148. package/package.json +5 -7
  149. package/dist/esm/commands/app/install/node.js +0 -13
  150. package/dist/esm/commands/app/install/php.js +0 -13
  151. package/dist/esm/commands/domain/tld/get.d.ts +0 -3
  152. package/dist/esm/commands/domain/tld/get.js +0 -6
  153. package/dist/esm/commands/domain/tld/list.d.ts +0 -9
  154. package/dist/esm/commands/domain/tld/list.js +0 -6
  155. package/dist/esm/generated/domain/getToplevelDomain.d.ts +0 -16
  156. package/dist/esm/generated/domain/getToplevelDomain.js +0 -25
  157. package/dist/esm/generated/domain/listToplevelDomains.d.ts +0 -13
  158. package/dist/esm/generated/domain/listToplevelDomains.js +0 -17
  159. package/dist/esm/generated/mail/deliveryboxList.d.ts +0 -13
  160. package/dist/esm/generated/mail/deliveryboxList.js +0 -24
  161. package/dist/esm/generated/user/getUser.d.ts +0 -14
  162. package/dist/esm/generated/user/getUser.js +0 -16
@@ -13,7 +13,7 @@ export default class Uninstall extends DeleteBaseCommand {
13
13
  async deleteResource() {
14
14
  const appInstallationId = this.args["installation-id"];
15
15
  const response = await this.apiClient.app.uninstallAppinstallation({
16
- pathParameters: { appInstallationId },
16
+ appInstallationId,
17
17
  });
18
18
  assertStatus(response, 204);
19
19
  }
@@ -43,7 +43,7 @@ export default class AppVersions extends BaseCommand {
43
43
  }
44
44
  async outputVersionsForAppUuid(apiClient, appUuid) {
45
45
  const versions = await apiClient.app.listAppversions({
46
- pathParameters: { appId: appUuid },
46
+ appId: appUuid,
47
47
  });
48
48
  assertStatus(versions, 200);
49
49
  for (const version of versions.data) {
@@ -15,7 +15,7 @@ export default class Close extends BaseCommand {
15
15
  const conversationId = await normalizeConversationIdToUuid(this.apiClient, args.id);
16
16
  ux.action.start(`closing conversation ${conversationId}`);
17
17
  const response = await this.apiClient.conversation.setConversationStatus({
18
- pathParameters: { conversationId },
18
+ conversationId,
19
19
  data: { status: "closed" },
20
20
  });
21
21
  assertStatus(response, 200);
@@ -41,7 +41,7 @@ export default class Create extends BaseCommand {
41
41
  const conversationId = conversationResponse.data.conversationId;
42
42
  ux.action.start(`saving message for ${conversationId}`);
43
43
  const response = await this.apiClient.conversation.createMessage({
44
- pathParameters: { conversationId },
44
+ conversationId,
45
45
  data: { messageContent },
46
46
  });
47
47
  assertStatus(response, 201);
@@ -21,7 +21,7 @@ export default class Reply extends BaseCommand {
21
21
  const messageContent = await retrieveMessage(flags);
22
22
  ux.action.start(`replying to ${conversationId}`);
23
23
  const response = await this.apiClient.conversation.createMessage({
24
- pathParameters: { conversationId },
24
+ conversationId,
25
25
  data: { messageContent },
26
26
  });
27
27
  assertStatus(response, 201);
@@ -20,10 +20,10 @@ export default class Show extends BaseCommand {
20
20
  const conversationId = await normalizeConversationIdToUuid(this.apiClient, args.id);
21
21
  const [conversationResponse, messagesResponse] = await Promise.all([
22
22
  this.apiClient.conversation.getConversation({
23
- pathParameters: { conversationId },
23
+ conversationId,
24
24
  }),
25
25
  this.apiClient.conversation.listMessagesByConversation({
26
- pathParameters: { conversationId },
26
+ conversationId,
27
27
  }),
28
28
  ]);
29
29
  assertStatus(conversationResponse, 200);
@@ -26,9 +26,7 @@ export default class Show extends RenderBaseCommand {
26
26
  const usePromiseOptions = usePromiseSetup.getSetup(this.flags);
27
27
  const response = usePromise(apiClient.conversation.listMessagesByConversation, [
28
28
  {
29
- pathParameters: {
30
- conversationId,
31
- },
29
+ conversationId,
32
30
  },
33
31
  ], {
34
32
  loaderId: "listMessagesByConversation",
@@ -7,9 +7,7 @@ export class Charsets extends ListBaseCommand {
7
7
  };
8
8
  async getData() {
9
9
  const pathParams = {};
10
- return await this.apiClient.database.listMysqlCharsets({
11
- pathParameters: await this.mapParams(pathParams),
12
- });
10
+ return await this.apiClient.database.listMysqlCharsets((await this.mapParams(pathParams)));
13
11
  }
14
12
  mapParams(input) {
15
13
  return input;
@@ -51,7 +51,7 @@ export class Create extends ExecRenderBaseCommand {
51
51
  const password = await this.getPassword(p);
52
52
  const db = await p.runStep("creating MySQL database", async () => {
53
53
  const r = await this.apiClient.database.createMysqlDatabase({
54
- pathParameters: { projectId },
54
+ projectId,
55
55
  data: {
56
56
  database: {
57
57
  projectId,
@@ -74,14 +74,14 @@ export class Create extends ExecRenderBaseCommand {
74
74
  });
75
75
  const database = await p.runStep("fetching database", async () => {
76
76
  const r = await this.apiClient.database.getMysqlDatabase({
77
- pathParameters: { id: db.id },
77
+ id: db.id,
78
78
  });
79
79
  assertStatus(r, 200);
80
80
  return r.data;
81
81
  });
82
82
  const user = await p.runStep("fetching user", async () => {
83
83
  const r = await this.apiClient.database.getMysqlUser({
84
- pathParameters: { id: db.userId },
84
+ id: db.userId,
85
85
  });
86
86
  assertStatus(r, 200);
87
87
  return r.data;
@@ -10,7 +10,7 @@ export default class Delete extends DeleteBaseCommand {
10
10
  async deleteResource() {
11
11
  const id = await withMySQLId(this.apiClient, this.flags, this.args, this.config);
12
12
  const response = await this.apiClient.database.deleteMysqlDatabase({
13
- pathParameters: { id },
13
+ id,
14
14
  });
15
15
  assertStatus(response, 200);
16
16
  }
@@ -9,7 +9,7 @@ export class Get extends GetBaseCommand {
9
9
  async getData() {
10
10
  const id = await withMySQLId(this.apiClient, this.flags, this.args, this.config);
11
11
  return await this.apiClient.database.getMysqlDatabase({
12
- pathParameters: { id },
12
+ id,
13
13
  });
14
14
  }
15
15
  }
@@ -11,7 +11,7 @@ export class List extends ListBaseCommand {
11
11
  async getData() {
12
12
  const projectId = await withProjectId(this.apiClient, List, this.flags, this.args, this.config);
13
13
  return await this.apiClient.database.listMysqlDatabases({
14
- pathParameters: { projectId },
14
+ projectId,
15
15
  });
16
16
  }
17
17
  mapData(data) {
@@ -9,7 +9,7 @@ export class PhpMyAdmin extends BaseCommand {
9
9
  const { flags, args } = await this.parse(PhpMyAdmin);
10
10
  const databaseId = await withMySQLId(this.apiClient, flags, args, this.config);
11
11
  const users = await this.apiClient.database.listMysqlUsers({
12
- pathParameters: { databaseId },
12
+ databaseId,
13
13
  });
14
14
  assertStatus(users, 200);
15
15
  const mainUser = users.data.find((u) => u.mainUser);
@@ -17,7 +17,7 @@ export class PhpMyAdmin extends BaseCommand {
17
17
  throw new Error("no main user found.");
18
18
  }
19
19
  const pma = await this.apiClient.database.getMysqlUserPhpMyAdminUrl({
20
- pathParameters: { id: mainUser.id },
20
+ id: mainUser.id,
21
21
  });
22
22
  assertStatus(pma, 200);
23
23
  await open(pma.data.url);
@@ -13,7 +13,7 @@ export default class Get extends GetBaseCommand {
13
13
  };
14
14
  async getData() {
15
15
  return await this.apiClient.database.getMysqlUser({
16
- pathParameters: { id: this.args.id },
16
+ id: this.args.id,
17
17
  });
18
18
  }
19
19
  }
@@ -14,9 +14,7 @@ export class List extends ListBaseCommand {
14
14
  const pathParams = {
15
15
  databaseId: this.flags["database-id"],
16
16
  };
17
- return await this.apiClient.database.listMysqlUsers({
18
- pathParameters: pathParams,
19
- });
17
+ return await this.apiClient.database.listMysqlUsers(pathParams);
20
18
  }
21
19
  mapData(data) {
22
20
  return data;
@@ -51,7 +51,7 @@ export class Create extends ExecRenderBaseCommand {
51
51
  const { description, version, "max-memory": maxMemory, "max-memory-policy": maxMemoryPolicy, persistent, } = this.flags;
52
52
  const db = await p.runStep("creating Redis database", async () => {
53
53
  const r = await this.apiClient.database.createRedisDatabase({
54
- pathParameters: { projectId },
54
+ projectId,
55
55
  data: {
56
56
  description,
57
57
  version,
@@ -67,7 +67,7 @@ export class Create extends ExecRenderBaseCommand {
67
67
  });
68
68
  const database = await p.runStep("fetching database", async () => {
69
69
  const r = await this.apiClient.database.getRedisDatabase({
70
- pathParameters: { id: db.id },
70
+ id: db.id,
71
71
  });
72
72
  assertStatus(r, 200);
73
73
  return r.data;
@@ -13,7 +13,7 @@ export class Get extends GetBaseCommand {
13
13
  };
14
14
  async getData() {
15
15
  return await this.apiClient.database.getRedisDatabase({
16
- pathParameters: await this.mapParams(this.args),
16
+ ...(await this.mapParams(this.args)),
17
17
  });
18
18
  }
19
19
  mapParams(input) {
@@ -10,7 +10,7 @@ export class List extends ListBaseCommand {
10
10
  async getData() {
11
11
  const projectId = await withProjectId(this.apiClient, List, this.flags, this.args, this.config);
12
12
  return await this.apiClient.database.listRedisDatabases({
13
- pathParameters: { projectId },
13
+ projectId,
14
14
  });
15
15
  }
16
16
  mapData(data) {
@@ -10,9 +10,7 @@ export class List extends ListBaseCommand {
10
10
  async getData() {
11
11
  const projectId = await withProjectId(this.apiClient, List, this.flags, this.args, this.config);
12
12
  const pathParams = { projectId };
13
- return await this.apiClient.domain.listDomains({
14
- pathParameters: pathParams,
15
- });
13
+ return await this.apiClient.domain.listDomains(pathParams);
16
14
  }
17
15
  mapData(data) {
18
16
  return data;
@@ -12,7 +12,7 @@ export class List extends ListBaseCommand {
12
12
  projectId: await withProjectId(this.apiClient, List, this.flags, this.args, this.config),
13
13
  };
14
14
  return await this.apiClient.domain.listDomainOwnerships({
15
- pathParameters,
15
+ ...pathParameters,
16
16
  });
17
17
  }
18
18
  mapData(data) {
@@ -80,13 +80,13 @@ export default class Create extends ExecRenderBaseCommand {
80
80
  const [ingress, ownership] = await process.runStep("waiting for ingress to be ready", async () => {
81
81
  return await waitUntil(async () => {
82
82
  const response = await this.apiClient.domain.ingressGetSpecific({
83
- pathParameters: { ingressId },
83
+ ingressId,
84
84
  });
85
85
  if (response.status !== 200) {
86
86
  return null;
87
87
  }
88
88
  const ownershipResponse = await this.apiClient.domain.listDomainOwnerships({
89
- pathParameters: { projectId },
89
+ projectId,
90
90
  });
91
91
  if (ownershipResponse.status === 200) {
92
92
  const ownership = ownershipResponse.data.find((o) => o.domain === hostname);
@@ -14,7 +14,7 @@ export default class Delete extends DeleteBaseCommand {
14
14
  async deleteResource() {
15
15
  const ingressId = this.args["virtual-host-id"];
16
16
  const response = await this.apiClient.domain.ingressDelete({
17
- pathParameters: { ingressId },
17
+ ingressId,
18
18
  });
19
19
  assertStatus(response, 204);
20
20
  }
@@ -25,10 +25,10 @@ const IngressPath = ({ path }) => {
25
25
  if ("installationId" in path.target) {
26
26
  const { apiClient } = useRenderContext();
27
27
  const installation = usePromise((id) => apiClient.app.getAppinstallation({
28
- pathParameters: { appInstallationId: id },
28
+ appInstallationId: id,
29
29
  }), [path.target.installationId]);
30
30
  assertStatus(installation, 200);
31
- const app = usePromise((id) => apiClient.app.getApp({ pathParameters: { appId: id } }), [installation.data.appId]);
31
+ const app = usePromise((id) => apiClient.app.getApp({ appId: id }), [installation.data.appId]);
32
32
  assertStatus(app, 200);
33
33
  return (_jsxs(Text, { children: ["->", " App: ", _jsx(Value, { children: app.data.name }), ", installed at", " ", _jsx(Value, { children: installation.data.installationPath })] }));
34
34
  }
@@ -42,7 +42,7 @@ const IngressPaths = ({ ingress }) => {
42
42
  };
43
43
  const GetIngress = ({ ingress }) => {
44
44
  const { apiClient } = useRenderContext();
45
- const ownerships = usePromise((projectId) => apiClient.domain.listDomainOwnerships({ pathParameters: { projectId } }), [ingress.projectId]);
45
+ const ownerships = usePromise((projectId) => apiClient.domain.listDomainOwnerships({ projectId }), [ingress.projectId]);
46
46
  assertStatus(ownerships, 200);
47
47
  const ownership = ownerships.data.find((o) => o.domain === ingress.hostname);
48
48
  const rows = {
@@ -75,7 +75,7 @@ export class Get extends RenderBaseCommand {
75
75
  render() {
76
76
  const ingressId = this.args["ingress-id"];
77
77
  const ingressResponse = usePromise((id) => this.apiClient.domain.ingressGetSpecific({
78
- pathParameters: { ingressId: id },
78
+ ingressId: id,
79
79
  }), [ingressId]);
80
80
  assertStatus(ingressResponse, 200);
81
81
  if (this.flags.output === "json") {
@@ -18,7 +18,7 @@ export class List extends ListBaseCommand {
18
18
  }
19
19
  const projectId = await withProjectId(this.apiClient, List, this.flags, this.args, this.config);
20
20
  return await this.apiClient.domain.ingressListForProject({
21
- pathParameters: { projectId },
21
+ projectId,
22
22
  });
23
23
  }
24
24
  mapParams(input) {
@@ -72,7 +72,7 @@ export default class Create extends ExecRenderBaseCommand {
72
72
  const [password, passwordGenerated] = await this.getPassword(process);
73
73
  const response = await process.runStep("creating mail address", async () => {
74
74
  const response = await this.apiClient.mail.mailaddressCreate({
75
- pathParameters: { projectId },
75
+ projectId,
76
76
  data: {
77
77
  address: flags.address,
78
78
  isCatchAll: flags["catch-all"],
@@ -15,7 +15,7 @@ export default class Delete extends DeleteBaseCommand {
15
15
  };
16
16
  async deleteResource() {
17
17
  const response = await this.apiClient.mail.mailaddressDelete({
18
- pathParameters: { id: this.args.id },
18
+ id: this.args.id,
19
19
  });
20
20
  assertStatus(response, 200);
21
21
  }
@@ -13,9 +13,7 @@ export class List extends ListBaseCommand {
13
13
  const pathParams = {
14
14
  projectId: this.flags["project-id"],
15
15
  };
16
- return await this.apiClient.mail.mailaddressList({
17
- pathParameters: await this.mapParams(pathParams),
18
- });
16
+ return await this.apiClient.mail.mailaddressList((await this.mapParams(pathParams)));
19
17
  }
20
18
  mapData(data) {
21
19
  return data;
@@ -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 { GeneratedMailDeliveryboxList, PathParams, Response } from "../../../generated/mail/deliveryboxList.js";
5
4
  import { ListColumns } from "../../../Formatter.js";
5
+ import { ListBaseCommand } from "../../../ListBaseCommand.js";
6
6
  type ResponseItem = Simplify<MittwaldAPIV2.Paths.V2ProjectsProjectIdDeliveryboxes.Get.Responses.$200.Content.ApplicationJson[number]>;
7
- export default class List extends GeneratedMailDeliveryboxList<ResponseItem> {
7
+ export type PathParams = MittwaldAPIV2.Paths.V2ProjectsProjectIdDeliveryboxes.Get.Parameters.Path;
8
+ export type Response = Awaited<ReturnType<MittwaldAPIV2Client["mail"]["deliveryboxList"]>>;
9
+ export declare class List extends ListBaseCommand<typeof List, ResponseItem, Response> {
10
+ static description: string;
11
+ static args: {};
12
+ static flags: {
13
+ "project-id": import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string>;
14
+ };
15
+ getData(): Promise<Response>;
8
16
  protected mapData(data: SuccessfulResponse<Response, 200>["data"]): MittwaldAPIV2.Components.Schemas.MailDeliverybox[];
9
- protected mapParams(input: PathParams): Promise<PathParams>;
10
17
  protected getColumns(data: ResponseItem[]): ListColumns<ResponseItem>;
11
18
  }
12
19
  export {};
@@ -1,15 +1,20 @@
1
- import { GeneratedMailDeliveryboxList, } from "../../../generated/mail/deliveryboxList.js";
2
- import { normalizeProjectIdToUuid } from "../../../Helpers.js";
3
1
  import { formatRelativeDate } from "../../../lib/viewhelpers/date.js";
4
- export default class List extends GeneratedMailDeliveryboxList {
2
+ import { ListBaseCommand } from "../../../ListBaseCommand.js";
3
+ import { projectFlags, withProjectId } from "../../../lib/project/flags.js";
4
+ export class List extends ListBaseCommand {
5
+ static description = "Get all deliveryboxes by project ID";
6
+ static args = {};
7
+ static flags = {
8
+ ...projectFlags,
9
+ ...ListBaseCommand.baseFlags,
10
+ };
11
+ async getData() {
12
+ const projectId = await withProjectId(this.apiClient, List, this.flags, this.args, this.config);
13
+ return await this.apiClient.mail.deliveryboxList({ projectId });
14
+ }
5
15
  mapData(data) {
6
- console.log(data);
7
16
  return data;
8
17
  }
9
- async mapParams(input) {
10
- input.projectId = await normalizeProjectIdToUuid(this.apiClient, input.projectId);
11
- return super.mapParams(input);
12
- }
13
18
  getColumns(data) {
14
19
  const baseColumns = super.getColumns(data);
15
20
  return {
@@ -9,7 +9,7 @@ export default class Delete extends DeleteBaseCommand {
9
9
  async deleteResource() {
10
10
  const customerId = await withOrgId(this.apiClient, Delete, {}, this.args, this.config);
11
11
  const response = await this.apiClient.customer.deleteCustomer({
12
- pathParameters: { customerId },
12
+ customerId,
13
13
  });
14
14
  assertStatus(response, 200);
15
15
  }
@@ -20,7 +20,7 @@ const GetOrganization = ({ response }) => {
20
20
  };
21
21
  const { apiClient } = useRenderContext();
22
22
  const competency = usePromise((id) => apiClient.customer.isCustomerLegallyCompetent({
23
- pathParameters: { customerId: id },
23
+ customerId: id,
24
24
  }), [response.customerId]);
25
25
  assertStatus(competency, 200);
26
26
  const sections = [
@@ -41,7 +41,7 @@ export class Get extends RenderBaseCommand {
41
41
  render() {
42
42
  const customerId = usePromise(() => withOrgId(this.apiClient, Get, this.flags, this.args, this.config), []);
43
43
  const customerResponse = usePromise((id) => this.apiClient.customer.getCustomer({
44
- pathParameters: { customerId: id },
44
+ customerId: id,
45
45
  }), [customerId]);
46
46
  assertStatus(customerResponse, 200);
47
47
  if (this.flags.output === "json") {
@@ -15,7 +15,7 @@ export class List extends ListBaseCommand {
15
15
  return Promise.all(data.map(async (item) => {
16
16
  const { customerId } = item;
17
17
  const org = await this.apiClient.customer.getCustomer({
18
- pathParameters: { customerId },
18
+ customerId,
19
19
  });
20
20
  if (org.status === 200) {
21
21
  return { ...item, org: org.data };
@@ -11,7 +11,7 @@ export class List extends ListBaseCommand {
11
11
  async getData() {
12
12
  const customerId = await withOrgId(this.apiClient, List, this.flags, this.args, this.config);
13
13
  return await this.apiClient.customer.listInvitesForCustomer({
14
- pathParameters: { customerId },
14
+ customerId,
15
15
  });
16
16
  }
17
17
  mapData(data) {
@@ -19,14 +19,14 @@ export class Revoke extends ExecRenderBaseCommand {
19
19
  const process = makeProcessRenderer(this.flags, "Revoking invite");
20
20
  const invite = await process.runStep("Fetching invite", async () => {
21
21
  const response = await this.apiClient.customer.getCustomerInvite({
22
- pathParameters: { inviteId },
22
+ inviteId,
23
23
  });
24
24
  assertStatus(response, 200);
25
25
  return response.data;
26
26
  });
27
27
  await process.runStep("Revoking invite", async () => {
28
28
  const response = await this.apiClient.customer.deleteCustomerInvite({
29
- pathParameters: { inviteId },
29
+ inviteId,
30
30
  });
31
31
  assertStatus(response, 204);
32
32
  });
@@ -30,7 +30,7 @@ export class Invite extends ExecRenderBaseCommand {
30
30
  const customerId = await withOrgId(this.apiClient, Invite, this.flags, this.args, this.config);
31
31
  const invite = await process.runStep("Creating invite", async () => {
32
32
  const result = await this.apiClient.customer.createCustomerInvite({
33
- pathParameters: { customerId },
33
+ customerId,
34
34
  data: {
35
35
  mailAddress: this.flags.email,
36
36
  role: this.flags.role,
@@ -7,9 +7,7 @@ export class List extends ListBaseCommand {
7
7
  };
8
8
  async getData() {
9
9
  const pathParams = {};
10
- return await this.apiClient.customer.listCustomers({
11
- pathParameters: await this.mapParams(pathParams),
12
- });
10
+ return await this.apiClient.customer.listCustomers((await this.mapParams(pathParams)));
13
11
  }
14
12
  mapParams(input) {
15
13
  return input;
@@ -8,9 +8,7 @@ export class ListOwn extends ListBaseCommand {
8
8
  };
9
9
  async getData() {
10
10
  const pathParams = {};
11
- return await this.apiClient.customer.listCustomerMemberships({
12
- pathParameters: await this.mapParams(pathParams),
13
- });
11
+ return await this.apiClient.customer.listCustomerMemberships((await this.mapParams(pathParams)));
14
12
  }
15
13
  mapParams(input) {
16
14
  return input;
@@ -19,7 +17,7 @@ export class ListOwn extends ListBaseCommand {
19
17
  return Promise.all(data.map(async (item) => {
20
18
  const { customerId } = item;
21
19
  const org = await this.apiClient.customer.getCustomer({
22
- pathParameters: { customerId },
20
+ customerId,
23
21
  });
24
22
  if (org.status === 200) {
25
23
  return { ...item, org: org.data };
@@ -22,6 +22,7 @@ export declare class List extends ListBaseCommand<typeof List, ResponseItem, Res
22
22
  email?: string | undefined;
23
23
  person: MittwaldAPIV2.Components.Schemas.CommonsPerson;
24
24
  phoneNumber?: string | undefined;
25
+ registeredAt?: string | undefined;
25
26
  userId: string;
26
27
  };
27
28
  customerId: string;
@@ -11,14 +11,14 @@ export class List extends ListBaseCommand {
11
11
  async getData() {
12
12
  const customerId = await withOrgId(this.apiClient, List, this.flags, this.args, this.config);
13
13
  return await this.apiClient.customer.listMembershipsForCustomer({
14
- pathParameters: { customerId },
14
+ customerId,
15
15
  });
16
16
  }
17
17
  mapData(data) {
18
18
  return Promise.all(data.map(async (item) => {
19
19
  const { userId } = item;
20
20
  const user = await this.apiClient.user.getUser({
21
- pathParameters: { userId },
21
+ userId,
22
22
  });
23
23
  if (user.status === 200) {
24
24
  return { ...item, user: user.data };
@@ -19,18 +19,18 @@ export class Revoke extends ExecRenderBaseCommand {
19
19
  const process = makeProcessRenderer(this.flags, "Revoking organization membership");
20
20
  const user = await process.runStep("Fetching existing member", async () => {
21
21
  const memberResponse = await this.apiClient.customer.getCustomerMembership({
22
- pathParameters: { membershipId },
22
+ membershipId,
23
23
  });
24
24
  assertStatus(memberResponse, 200);
25
25
  const userResponse = await this.apiClient.user.getUser({
26
- pathParameters: { userId: memberResponse.data.userId },
26
+ userId: memberResponse.data.userId,
27
27
  });
28
28
  assertStatus(userResponse, 200);
29
29
  return userResponse.data;
30
30
  });
31
31
  await process.runStep("Revoking membership", async () => {
32
32
  const response = await this.apiClient.customer.deleteCustomerMembership({
33
- pathParameters: { membershipId },
33
+ membershipId,
34
34
  });
35
35
  assertStatus(response, 204);
36
36
  });
@@ -26,7 +26,7 @@ export class Create extends ExecRenderBaseCommand {
26
26
  const expirationTime = expirationDateFromFlags(this.flags);
27
27
  const backup = await p.runStep("creating backup", async () => {
28
28
  const r = await this.apiClient.backup.createProjectBackup({
29
- pathParameters: { projectId },
29
+ projectId,
30
30
  data: {
31
31
  description,
32
32
  expirationTime: expirationTime.toJSON(),
@@ -39,7 +39,7 @@ export class Create extends ExecRenderBaseCommand {
39
39
  const stepWaiting = p.addStep(_jsx(Text, { children: "waiting for backup to be complete" }));
40
40
  await waitUntil(async () => {
41
41
  const backupResponse = await this.apiClient.backup.getProjectBackup({
42
- pathParameters: { projectBackupId: backup.id },
42
+ projectBackupId: backup.id,
43
43
  });
44
44
  if (backupResponse.status === 200 &&
45
45
  backupResponse.data.status === "Completed") {
@@ -14,7 +14,7 @@ export class Delete extends DeleteBaseCommand {
14
14
  async deleteResource() {
15
15
  const projectBackupId = this.args["backup-id"];
16
16
  const response = await this.apiClient.backup.deleteProjectBackup({
17
- pathParameters: { projectBackupId },
17
+ projectBackupId,
18
18
  });
19
19
  assertStatus(response, 204);
20
20
  }
@@ -74,7 +74,7 @@ export class Download extends ExecRenderBaseCommand {
74
74
  const password = await this.getPassword(p);
75
75
  const backup = await p.runStep("fetching backup", async () => {
76
76
  const r = await this.apiClient.backup.getProjectBackup({
77
- pathParameters: { projectBackupId },
77
+ projectBackupId,
78
78
  });
79
79
  assertStatus(r, 200);
80
80
  return r.data;
@@ -85,7 +85,7 @@ export class Download extends ExecRenderBaseCommand {
85
85
  else {
86
86
  await p.runStep("preparing backup download", async () => {
87
87
  const r = await this.apiClient.backup.createProjectBackupExport({
88
- pathParameters: { projectBackupId },
88
+ projectBackupId,
89
89
  data: {
90
90
  format: format,
91
91
  password,
@@ -97,7 +97,7 @@ export class Download extends ExecRenderBaseCommand {
97
97
  const backupExport = await p.runStep("waiting for backup download to be ready", () => {
98
98
  return waitUntil(async () => {
99
99
  const r = await this.apiClient.backup.getProjectBackup({
100
- pathParameters: { projectBackupId },
100
+ projectBackupId,
101
101
  });
102
102
  assertStatus(r, 200);
103
103
  if (r.data.export?.phase === "Completed") {
@@ -14,7 +14,7 @@ export class List extends ListBaseCommand {
14
14
  async getData() {
15
15
  const projectId = await withProjectId(this.apiClient, List, this.flags, {}, this.config);
16
16
  return await this.apiClient.backup.listProjectBackups({
17
- pathParameters: { projectId },
17
+ projectId,
18
18
  });
19
19
  }
20
20
  getColumns(data) {