@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
@@ -14,9 +14,7 @@ export class GeneratedSshUserListSshUsers extends ListBaseCommand {
14
14
  const pathParams = {
15
15
  projectId: this.flags["project-id"],
16
16
  };
17
- return await this.apiClient.sshsftpUser.sshUserListSshUsers({
18
- pathParameters: await this.mapParams(pathParams),
19
- });
17
+ return await this.apiClient.sshsftpUser.sshUserListSshUsers((await this.mapParams(pathParams)));
20
18
  }
21
19
  mapParams(input) {
22
20
  return input;
@@ -16,7 +16,7 @@ export class GeneratedUserGetApiToken extends GetBaseCommand {
16
16
  };
17
17
  async getData() {
18
18
  return await this.apiClient.user.getApiToken({
19
- pathParameters: await this.mapParams(this.args),
19
+ ...(await this.mapParams(this.args)),
20
20
  });
21
21
  }
22
22
  mapParams(input) {
@@ -15,7 +15,7 @@ export class GeneratedUserGetPersonalizedSettings extends GetBaseCommand {
15
15
  static args = {};
16
16
  async getData() {
17
17
  return await this.apiClient.user.getPersonalizedSettings({
18
- pathParameters: await this.mapParams(this.args),
18
+ ...(await this.mapParams(this.args)),
19
19
  });
20
20
  }
21
21
  mapParams(input) {
@@ -16,7 +16,7 @@ export class GeneratedUserGetSession extends GetBaseCommand {
16
16
  };
17
17
  async getData() {
18
18
  return await this.apiClient.user.getSession({
19
- pathParameters: await this.mapParams(this.args),
19
+ ...(await this.mapParams(this.args)),
20
20
  });
21
21
  }
22
22
  mapParams(input) {
@@ -16,7 +16,7 @@ export class GeneratedUserGetSshKey extends GetBaseCommand {
16
16
  };
17
17
  async getData() {
18
18
  return await this.apiClient.user.getSshKey({
19
- pathParameters: await this.mapParams(this.args),
19
+ ...(await this.mapParams(this.args)),
20
20
  });
21
21
  }
22
22
  mapParams(input) {
@@ -7,9 +7,7 @@ export class GeneratedUserListApiTokens extends ListBaseCommand {
7
7
  };
8
8
  async getData() {
9
9
  const pathParams = {};
10
- return await this.apiClient.user.listApiTokens({
11
- pathParameters: await this.mapParams(pathParams),
12
- });
10
+ return await this.apiClient.user.listApiTokens((await this.mapParams(pathParams)));
13
11
  }
14
12
  mapParams(input) {
15
13
  return input;
@@ -14,9 +14,7 @@ export class GeneratedUserListFeedback extends ListBaseCommand {
14
14
  const pathParams = {
15
15
  userId: this.flags["user-id"],
16
16
  };
17
- return await this.apiClient.user.listFeedback({
18
- pathParameters: await this.mapParams(pathParams),
19
- });
17
+ return await this.apiClient.user.listFeedback((await this.mapParams(pathParams)));
20
18
  }
21
19
  mapParams(input) {
22
20
  return input;
@@ -7,9 +7,7 @@ export class GeneratedUserListSessions extends ListBaseCommand {
7
7
  };
8
8
  async getData() {
9
9
  const pathParams = {};
10
- return await this.apiClient.user.listSessions({
11
- pathParameters: await this.mapParams(pathParams),
12
- });
10
+ return await this.apiClient.user.listSessions((await this.mapParams(pathParams)));
13
11
  }
14
12
  mapParams(input) {
15
13
  return input;
@@ -7,9 +7,7 @@ export class GeneratedUserListSshKeys extends ListBaseCommand {
7
7
  };
8
8
  async getData() {
9
9
  const pathParams = {};
10
- return await this.apiClient.user.listSshKeys({
11
- pathParameters: await this.mapParams(pathParams),
12
- });
10
+ return await this.apiClient.user.listSshKeys((await this.mapParams(pathParams)));
13
11
  }
14
12
  mapParams(input) {
15
13
  return input;
@@ -14,7 +14,7 @@ export declare class AppInstaller<TFlagName extends AvailableFlagName> {
14
14
  private static makeDescription;
15
15
  constructor(appId: string, appName: string, appSupportedFlags: readonly TFlagName[]);
16
16
  get flags(): RelevantFlagInput<readonly TFlagName[]>;
17
- exec(apiClient: MittwaldAPIV2Client, args: ArgOutput, flags: OutputFlags<RelevantFlagInput<(TFlagName | "version" | "wait")[]>>, config: Config): Promise<AppInstallationResult>;
17
+ exec(apiClient: MittwaldAPIV2Client, args: ArgOutput, flags: OutputFlags<RelevantFlagInput<(TFlagName | "wait")[]>>, config: Config): Promise<AppInstallationResult>;
18
18
  render(result: AppInstallationResult, flags: {
19
19
  quiet: boolean;
20
20
  }): React.ReactNode;
@@ -12,7 +12,7 @@ export class AppInstaller {
12
12
  appSupportedFlags;
13
13
  description;
14
14
  static makeDescription(appName) {
15
- return `Creates new ${appName} Installation.`;
15
+ return `Creates new ${appName} installation.`;
16
16
  }
17
17
  constructor(appId, appName, appSupportedFlags) {
18
18
  this.appId = appId;
@@ -27,7 +27,7 @@ export class AppInstaller {
27
27
  const process = makeProcessRenderer(flags, `Installing ${this.appName}`);
28
28
  const projectId = await withProjectId(apiClient, "flag", flags, args, config);
29
29
  await autofillFlags(apiClient, process, this.appSupportedFlags, flags, projectId, this.appName);
30
- const appVersion = await normalizeToAppVersionUuid(apiClient, flags.version, process, this.appId);
30
+ const appVersion = await normalizeToAppVersionUuid(apiClient, "version" in flags ? flags.version : "latest", process, this.appId);
31
31
  const [appInstallationId, eventId] = await triggerAppInstallation(apiClient, process, projectId, flags, appVersion);
32
32
  let successText;
33
33
  if (flags.wait) {
@@ -19,6 +19,7 @@ interface AvailableFlags {
19
19
  "shop-lang": OptionFlag<string | undefined>;
20
20
  "shop-currency": OptionFlag<string | undefined>;
21
21
  "install-mode": OptionFlag<string>;
22
+ "document-root": OptionFlag<string>;
22
23
  wait: BooleanFlag<boolean | undefined>;
23
24
  }
24
25
  export type RelevantFlags<TFlags extends readonly AvailableFlagName[]> = ProcessFlags & Pick<AvailableFlags, TFlags[number]>;
@@ -96,6 +96,12 @@ function buildFlagsWithDescription(appName) {
96
96
  options: ["composer", "symlink"],
97
97
  default: "composer",
98
98
  }),
99
+ "document-root": Flags.string({
100
+ required: true,
101
+ summary: `The document root from which your ${appName} will be served (relative to the installation path)`,
102
+ description: "This is the document root from which the files of your application will be served by the web server. This directory is specified relative to the installation path.",
103
+ default: "/",
104
+ }),
99
105
  wait: Flags.boolean({
100
106
  char: "w",
101
107
  description: `Wait for your ${appName} to be ready.`,
@@ -3,14 +3,14 @@ import { assertStatus } from "@mittwald/api-client-commons";
3
3
  import { useRenderContext } from "../../rendering/react/context.js";
4
4
  export function useApp(appId) {
5
5
  const { apiClient } = useRenderContext();
6
- const app = usePromise((id) => apiClient.app.getApp({ pathParameters: { appId: id } }), [appId]);
6
+ const app = usePromise((id) => apiClient.app.getApp({ appId: id }), [appId]);
7
7
  assertStatus(app, 200);
8
8
  return app.data;
9
9
  }
10
10
  export function useAppInstallation(appInstallationId) {
11
11
  const { apiClient } = useRenderContext();
12
12
  const appInstallation = usePromise((id) => apiClient.app.getAppinstallation({
13
- pathParameters: { appInstallationId: id },
13
+ appInstallationId: id,
14
14
  }), [appInstallationId]);
15
15
  assertStatus(appInstallation, 200);
16
16
  return appInstallation.data;
@@ -18,7 +18,8 @@ export function useAppInstallation(appInstallationId) {
18
18
  export function useAppVersion(appId, appVersionId) {
19
19
  const { apiClient } = useRenderContext();
20
20
  const appVersion = usePromise((appId, appVersionId) => apiClient.app.getAppversion({
21
- pathParameters: { appId, appVersionId },
21
+ appId,
22
+ appVersionId,
22
23
  }), [appId, appVersionId]);
23
24
  assertStatus(appVersion, 200);
24
25
  return appVersion.data;
@@ -26,7 +27,7 @@ export function useAppVersion(appId, appVersionId) {
26
27
  export function useSystemSoftware(systemSoftwareId) {
27
28
  const { apiClient } = useRenderContext();
28
29
  const systemSoftware = usePromise((id) => apiClient.app.getSystemsoftware({
29
- pathParameters: { systemSoftwareId: id },
30
+ systemSoftwareId: id,
30
31
  }), [systemSoftwareId]);
31
32
  assertStatus(systemSoftware, 200);
32
33
  return systemSoftware.data;
@@ -34,10 +35,8 @@ export function useSystemSoftware(systemSoftwareId) {
34
35
  export function useSystemSoftwareVersion(systemSoftwareId, systemSoftwareVersionId) {
35
36
  const { apiClient } = useRenderContext();
36
37
  const systemSoftwareVersion = usePromise((systemSoftwareId, systemSoftwareVersionId) => apiClient.app.getSystemsoftwareversion({
37
- pathParameters: {
38
- systemSoftwareId,
39
- systemSoftwareVersionId,
40
- },
38
+ systemSoftwareId,
39
+ systemSoftwareVersionId,
41
40
  }), [systemSoftwareId, systemSoftwareVersionId]);
42
41
  assertStatus(systemSoftwareVersion, 200);
43
42
  return systemSoftwareVersion.data;
@@ -2,7 +2,7 @@ import { assertStatus } from "@mittwald/api-client-commons";
2
2
  export async function triggerAppInstallation(apiClient, process, projectId, flags, appVersion) {
3
3
  const [appInstallationId, eventId] = await process.runStep("starting installation", async () => {
4
4
  const result = await apiClient.app.requestAppinstallation({
5
- pathParameters: { projectId },
5
+ projectId,
6
6
  data: {
7
7
  appVersionId: appVersion.id,
8
8
  description: flags["site-title"],
@@ -16,5 +16,28 @@ export async function triggerAppInstallation(apiClient, process, projectId, flag
16
16
  assertStatus(result, 201);
17
17
  return [result.data.id, result.headers["etag"]];
18
18
  });
19
+ await process.runStep("waiting for installation to be retrievable", async () => {
20
+ for (let attempts = 0; attempts < 10; attempts++) {
21
+ const result = await apiClient.app.getAppinstallation({
22
+ appInstallationId,
23
+ });
24
+ if (result.status === 200) {
25
+ return result.data;
26
+ }
27
+ await new Promise((resolve) => setTimeout(resolve, 100));
28
+ }
29
+ });
30
+ if ("document-root" in flags && flags["document-root"] !== "/") {
31
+ await process.runStep("setting document root", async () => {
32
+ const result = await apiClient.app.patchAppinstallation({
33
+ appInstallationId,
34
+ headers: { "if-event-reached": eventId },
35
+ data: {
36
+ customDocumentRoot: flags["document-root"],
37
+ },
38
+ });
39
+ assertStatus(result, 204);
40
+ });
41
+ }
19
42
  return [appInstallationId, eventId];
20
43
  }
@@ -34,7 +34,8 @@ export async function getAppVersionFromUuid(apiClient, appId, appVersionId) {
34
34
  throw new Error("Given UUID not valid.");
35
35
  }
36
36
  const appVersion = await apiClient.app.getAppversion({
37
- pathParameters: { appId: appId, appVersionId: appVersionId },
37
+ appId: appId,
38
+ appVersionId: appVersionId,
38
39
  });
39
40
  if (appVersion.data.externalVersion) {
40
41
  return appVersion.data.externalVersion;
@@ -21,9 +21,7 @@ export async function normalizeToAppVersionUuid(apiClient, version, process, app
21
21
  // Get latest available Internal App Version for App UUID
22
22
  export async function getLatestAvailableAppVersionForApp(apiClient, appId) {
23
23
  const versions = await apiClient.app.listAppversions({
24
- pathParameters: {
25
- appId,
26
- },
24
+ appId,
27
25
  });
28
26
  assertStatus(versions, 200);
29
27
  if (versions.data.length === 0) {
@@ -40,9 +38,7 @@ export async function getLatestAvailableAppVersionForApp(apiClient, appId) {
40
38
  // App Version UUID from App Version irellevant if internal or external
41
39
  export async function getAppVersionUuidFromAppVersion(apiClient, appId, appVersion) {
42
40
  const versions = await apiClient.app.listAppversions({
43
- pathParameters: {
44
- appId,
45
- },
41
+ appId,
46
42
  });
47
43
  if (!appVersion) {
48
44
  return getLatestAvailableAppVersionForApp(apiClient, appId);
@@ -5,7 +5,7 @@ export async function waitUntilAppIsInstalled(apiClient, process, appInstallatio
5
5
  const stepWaiting = process.addStep(_jsx(Text, { children: "waiting for app installation to be ready" }));
6
6
  await waitUntil(async () => {
7
7
  const installationResponse = await apiClient.app.getAppinstallation({
8
- pathParameters: { appInstallationId },
8
+ appInstallationId,
9
9
  // TODO: Remove once @mittwald/api-client supports this
10
10
  headers: { "if-event-reached": eventId }, // eslint-disable-line
11
11
  });
@@ -9,7 +9,7 @@ export async function getUser(apiClient, p) {
9
9
  export async function getProject(apiClient, p, database) {
10
10
  return await p.runStep("fetching project", async () => {
11
11
  const r = await apiClient.project.getProject({
12
- pathParameters: { id: database.projectId },
12
+ id: database.projectId,
13
13
  });
14
14
  assertStatus(r, 200);
15
15
  return r.data;
@@ -29,7 +29,7 @@ async function getPassword(p, flags) {
29
29
  async function getDatabase(apiClient, p, id) {
30
30
  return await p.runStep("fetching database", async () => {
31
31
  const r = await apiClient.database.getMysqlDatabase({
32
- pathParameters: { id },
32
+ id,
33
33
  });
34
34
  assertStatus(r, 200);
35
35
  return r.data;
@@ -38,7 +38,7 @@ async function getDatabase(apiClient, p, id) {
38
38
  async function getDatabaseUser(apiClient, p, databaseId) {
39
39
  return await p.runStep("fetching main user", async () => {
40
40
  const r = await apiClient.database.listMysqlUsers({
41
- pathParameters: { databaseId },
41
+ databaseId,
42
42
  });
43
43
  assertStatus(r, 200);
44
44
  const mainUser = r.data.find((u) => u.mainUser);
@@ -37,7 +37,7 @@ export async function withMySQLId(apiClient, flags, args, cfg) {
37
37
  }
38
38
  const projectId = await withProjectId(apiClient, "flag", flags, args, cfg);
39
39
  const databases = await apiClient.database.listMysqlDatabases({
40
- pathParameters: { projectId },
40
+ projectId,
41
41
  });
42
42
  assertStatus(databases, 200);
43
43
  const database = databases.data.find((db) => db.name === candidate);
@@ -14,7 +14,7 @@ export async function getConnectionDetails(apiClient, databaseId, p) {
14
14
  async function getDatabase(apiClient, p, id) {
15
15
  return await p.runStep("fetching database", async () => {
16
16
  const r = await apiClient.database.getRedisDatabase({
17
- pathParameters: { id },
17
+ id,
18
18
  });
19
19
  assertStatus(r, 200);
20
20
  return r.data;
@@ -24,7 +24,7 @@ export async function withRedisId(apiClient, flags, args, cfg) {
24
24
  }
25
25
  const projectId = await withProjectId(apiClient, "flag", flags, args, cfg);
26
26
  const databases = await apiClient.database.listRedisDatabases({
27
- pathParameters: { projectId },
27
+ projectId,
28
28
  });
29
29
  assertStatus(databases, 200);
30
30
  const database = databases.data.find((db) => db.name === candidate);
@@ -4,7 +4,7 @@ import { assertStatus } from "@mittwald/api-client-commons";
4
4
  export function useProject(projectId) {
5
5
  const { apiClient } = useRenderContext();
6
6
  const project = usePromise((id) => apiClient.project.getProject({
7
- pathParameters: { id },
7
+ id,
8
8
  }), [projectId]);
9
9
  assertStatus(project, 200);
10
10
  return project.data;
@@ -3,7 +3,7 @@ import { normalizeProjectIdToUuid } from "../../Helpers.js";
3
3
  export async function getDefaultIngressForProject(apiClient, projectId) {
4
4
  const projectUuid = await normalizeProjectIdToUuid(apiClient, projectId);
5
5
  const projectIngresses = await apiClient.domain.ingressListForProject({
6
- pathParameters: { projectId: projectUuid },
6
+ projectId: projectUuid,
7
7
  });
8
8
  assertStatus(projectIngresses, 200);
9
9
  const foundIngress = projectIngresses.data.find((item) => {
@@ -1,7 +1,7 @@
1
1
  import { assertStatus } from "@mittwald/api-client-commons";
2
2
  export async function getProjectShortIdFromUuid(apiClient, uuid) {
3
3
  const project = await apiClient.project.getProject({
4
- pathParameters: { id: uuid },
4
+ id: uuid,
5
5
  });
6
6
  assertStatus(project, 200);
7
7
  if (project.data.shortId) {
@@ -4,7 +4,7 @@ import { assertStatus } from "@mittwald/api-client-commons";
4
4
  export function useProjectBackup(projectBackupId) {
5
5
  const { apiClient } = useRenderContext();
6
6
  const projectBackup = usePromise((id) => apiClient.backup.getProjectBackup({
7
- pathParameters: { projectBackupId: id },
7
+ projectBackupId: id,
8
8
  }), [projectBackupId]);
9
9
  assertStatus(projectBackup, 200);
10
10
  return projectBackup.data;
@@ -12,7 +12,7 @@ export function useProjectBackup(projectBackupId) {
12
12
  export function useProjectBackupSchedule(projectBackupScheduleId) {
13
13
  const { apiClient } = useRenderContext();
14
14
  const projectBackupSchedule = usePromise((id) => apiClient.backup.getProjectBackupSchedule({
15
- pathParameters: { projectBackupScheduleId: id },
15
+ projectBackupScheduleId: id,
16
16
  }), [projectBackupScheduleId]);
17
17
  assertStatus(projectBackupSchedule, 200);
18
18
  return projectBackupSchedule.data;
@@ -1 +1 @@
1
- export declare const getTerminalWidth: () => number;
1
+ export declare const getTerminalWidth: () => number | undefined;
@@ -1,2 +1,2 @@
1
1
  import { stdout } from "@oclif/core";
2
- export const getTerminalWidth = () => stdout.isTTY ? stdout.getWindowSize()[0] : 80;
2
+ export const getTerminalWidth = () => stdout.isTTY ? stdout.getWindowSize()[0] : undefined;
@@ -6,6 +6,7 @@ import { ExtendedBaseCommand } from "../../ExtendedBaseCommand.js";
6
6
  import { JsonCollectionProvider } from "./json/JsonCollectionProvider.js";
7
7
  import { Flags } from "@oclif/core";
8
8
  import { Render } from "./components/Render.js";
9
+ import { useIncreaseInkStdoutColumns } from "./hooks/useIncreaseInkStdoutColumns.js";
9
10
  const renderFlags = {
10
11
  output: Flags.string({
11
12
  description: "The output format to use; use 'txt' for a human readable text representation, and 'json' for a machine-readable JSON representation.",
@@ -40,6 +41,9 @@ export class RenderBaseCommand extends ExtendedBaseCommand {
40
41
  render(_jsx(RenderContextProvider, { value: {
41
42
  apiClient: this.apiClient,
42
43
  renderAsJson: this.renderFlags.output === "json",
43
- }, children: _jsx(JsonCollectionProvider, { children: _jsx(Suspense, { children: _jsx(Render, { render: () => this.render() }) }) }) }));
44
+ }, children: _jsx(JsonCollectionProvider, { children: _jsx(Suspense, { children: _jsx(Render, { render: () => {
45
+ useIncreaseInkStdoutColumns();
46
+ return this.render();
47
+ } }) }) }) }));
44
48
  }
45
49
  }
@@ -4,8 +4,11 @@ import { Value } from "../Value.js";
4
4
  import { AppInstallationStatus } from "./AppInstallationStatus.js";
5
5
  import { SingleResult, SingleResultTable } from "../SingleResult.js";
6
6
  import { AppSystemSoftware } from "./AppSystemSoftware.js";
7
- import { Box } from "ink";
7
+ import { Box, Text } from "ink";
8
+ import { phpInstaller } from "../../../../commands/app/create/php.js";
9
+ import { nodeInstaller } from "../../../../commands/app/create/node.js";
8
10
  export const AppInstallationDetails = ({ app, appInstallation }) => {
11
+ const customInstallation = [phpInstaller.appId, nodeInstaller.appId].includes(app.id);
9
12
  const desiredAppVersion = useAppVersion(app.id, appInstallation.appVersion.desired);
10
13
  const currentAppVersion = appInstallation.appVersion.current
11
14
  ? useAppVersion(app.id, appInstallation.appVersion.current)
@@ -17,8 +20,9 @@ export const AppInstallationDetails = ({ app, appInstallation }) => {
17
20
  Name: _jsx(Value, { children: app.name }),
18
21
  } })),
19
22
  "Installation Path": _jsx(Value, { children: appInstallation.installationPath }),
23
+ "Document root (in installation path)": (_jsx(Value, { children: appInstallation.customDocumentRoot ?? "/" })),
20
24
  Description: _jsx(Value, { children: appInstallation.description }),
21
- Status: (_jsx(AppInstallationStatus, { appInstallation: appInstallation, desired: desiredAppVersion, current: currentAppVersion })),
25
+ Status: customInstallation ? (_jsx(Text, { children: "custom application" })) : (_jsx(AppInstallationStatus, { appInstallation: appInstallation, desired: desiredAppVersion, current: currentAppVersion })),
22
26
  };
23
27
  const title = (_jsxs(_Fragment, { children: ["APP INSTALLATION: ", _jsx(Value, { children: app.name }), " in", " ", _jsx(Value, { children: appInstallation.installationPath })] }));
24
28
  const sections = [
@@ -9,9 +9,7 @@ export const ConversationMeta = (props) => {
9
9
  const { apiClient, renderAsJson } = useRenderContext();
10
10
  const conversationResponse = usePromise(apiClient.conversation.getConversation, [
11
11
  {
12
- pathParameters: {
13
- conversationId: id,
14
- },
12
+ conversationId: id,
15
13
  },
16
14
  ], {
17
15
  loaderId: "getConversation",
@@ -12,5 +12,5 @@ export declare class Column {
12
12
  constructor(table: Table, name: string, optionsInput?: ColumnOptionsInput<any>);
13
13
  private updateProportionalWidth;
14
14
  onCellMeasured(dimension: Dimension): void;
15
- useWidth(): string;
15
+ useWidth(): string | number;
16
16
  }
@@ -1,3 +1,4 @@
1
+ import { stdout } from "@oclif/core";
1
2
  import { ObservableValue } from "../../../lib/observable-value/ObservableValue.js";
2
3
  import { ColumnOptions } from "./ColumnOptions.js";
3
4
  import { ColumnName } from "./ColumnName.js";
@@ -23,13 +24,15 @@ export class Column {
23
24
  }
24
25
  onCellMeasured(dimension) {
25
26
  const termWidth = getTerminalWidth();
26
- const boundary = Math.round(termWidth / 2);
27
+ const boundary = termWidth
28
+ ? Math.round(termWidth / 2)
29
+ : Number.MAX_SAFE_INTEGER;
27
30
  const boundedWidth = Math.min(dimension.width, boundary);
28
31
  if (this.maxCellWidth.value < boundedWidth) {
29
32
  this.maxCellWidth.updateValue(boundedWidth);
30
33
  }
31
34
  }
32
35
  useWidth() {
33
- return useWatchObservableValue(this.proportionalWidth);
36
+ return useWatchObservableValue(stdout.isTTY ? this.proportionalWidth : this.maxCellWidth);
34
37
  }
35
38
  }
@@ -25,7 +25,7 @@ export class ColumnOptions {
25
25
  return 36;
26
26
  }
27
27
  const termWidth = getTerminalWidth();
28
- const relativeMinWidth = Math.round(termWidth / 20);
28
+ const relativeMinWidth = termWidth ? Math.round(termWidth / 20) : 0;
29
29
  return Math.max(ColumnOptions.absoluteMinWidth, relativeMinWidth);
30
30
  }
31
31
  getIsVisible() {
@@ -0,0 +1 @@
1
+ export declare const useIncreaseInkStdoutColumns: () => void;
@@ -0,0 +1,9 @@
1
+ import { useStdout } from "ink";
2
+ // Increase Inks default column width for non-TTY of 80
3
+ export const useIncreaseInkStdoutColumns = () => {
4
+ const stdout = useStdout().stdout;
5
+ if (!stdout.isTTY) {
6
+ // Not using Number.MAX_SAFE_INTEGER here because Ink will fail otherwise
7
+ stdout.columns = 100000;
8
+ }
9
+ };
@@ -5,9 +5,7 @@ export const useMyUserProfile = () => {
5
5
  const { apiClient } = useRenderContext();
6
6
  const myUserId = usePromise(apiClient.user.getUser, [
7
7
  {
8
- pathParameters: {
9
- userId: "self",
10
- },
8
+ userId: "self",
11
9
  },
12
10
  ], {
13
11
  loaderId: "getOwnProfile",
@@ -1,10 +1,14 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Box } from "ink";
3
- import { useRef } from "react";
3
+ import { useLayoutEffect, useRef, useState, } from "react";
4
4
  import { createMeasureContext, measureContext } from "./context.js";
5
5
  import { MeasureRenderer } from "./MeasureRenderer.js";
6
6
  export const MeasureContextProvider = (props) => {
7
7
  const { children } = props;
8
8
  const context = useRef(createMeasureContext()).current;
9
- return (_jsx(measureContext.Provider, { value: context, children: _jsxs(Box, { flexDirection: "column", gap: 1, children: [_jsx(Box, { children: _jsx(MeasureRenderer, {}) }), _jsx(Box, { children: children })] }) }));
9
+ const [isMeasuring, setIsMeasuring] = useState(true);
10
+ useLayoutEffect(() => {
11
+ setIsMeasuring(false);
12
+ }, []);
13
+ return (_jsx(measureContext.Provider, { value: context, children: _jsxs(Box, { flexDirection: "column", gap: 1, children: [_jsx(Box, { children: _jsx(MeasureRenderer, {}) }), _jsx(Box, { height: isMeasuring ? 0 : undefined, overflow: isMeasuring ? "hidden" : undefined, children: children })] }) }));
10
14
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mittwald/cli",
3
- "version": "1.0.0-alpha.21",
3
+ "version": "1.0.0-alpha.24",
4
4
  "description": "Hand-crafted CLI for the mittwald API",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -44,13 +44,14 @@
44
44
  "bin"
45
45
  ],
46
46
  "dependencies": {
47
- "@mittwald/api-client": "^2.0.8",
48
- "@mittwald/api-client-commons": "^3.1.0",
49
- "@mittwald/react-use-promise": "^1.2.2",
47
+ "@mittwald/api-client": "^3.0.7",
48
+ "@mittwald/api-client-commons": "^4.1.0",
49
+ "@mittwald/react-use-promise": "^1.3.3",
50
50
  "@oclif/core": "^2.8.5",
51
51
  "@oclif/plugin-help": "^5.2.9",
52
52
  "@oclif/plugin-update": "^3.1.28",
53
53
  "@oclif/plugin-warn-if-update-available": "^2.0.45",
54
+ "axios": "^1.5.0",
54
55
  "chalk": "^5.3.0",
55
56
  "date-fns": "^2.30.0",
56
57
  "humanize-string": "^3.0.0",
@@ -68,9 +69,6 @@
68
69
  "semver": "^7.5.4",
69
70
  "tempfile": "^5.0.0"
70
71
  },
71
- "resolutions": {
72
- "@mittwald/api-client-commons": "^3.1.0"
73
- },
74
72
  "devDependencies": {
75
73
  "@types/chalk": "^2.2.0",
76
74
  "@types/copyfiles": "^2.4.1",
@@ -1,13 +0,0 @@
1
- import { ExecRenderBaseCommand } from "../../../rendering/react/ExecRenderBaseCommand.js";
2
- import { AppInstaller, } from "../../../lib/app/Installer.js";
3
- const installer = new AppInstaller("3e7f920b-a711-4d2f-9871-661e1b41a2f0", "Node.js Project", ["version", "site-title", "wait"]);
4
- export default class InstallNode extends ExecRenderBaseCommand {
5
- static description = installer.description;
6
- static flags = installer.flags;
7
- async exec() {
8
- return installer.exec(this.apiClient, this.args, this.flags, this.config);
9
- }
10
- render(result) {
11
- return installer.render(result, this.flags);
12
- }
13
- }
@@ -1,13 +0,0 @@
1
- import { ExecRenderBaseCommand } from "../../../rendering/react/ExecRenderBaseCommand.js";
2
- import { AppInstaller, } from "../../../lib/app/Installer.js";
3
- const installer = new AppInstaller("34220303-cb87-4592-8a95-2eb20a97b2ac", "PHP Project", ["version", "site-title", "wait"]);
4
- export default class InstallPhp extends ExecRenderBaseCommand {
5
- static description = installer.description;
6
- static flags = installer.flags;
7
- async exec() {
8
- return installer.exec(this.apiClient, this.args, this.flags, this.config);
9
- }
10
- render(result) {
11
- return installer.render(result, this.flags);
12
- }
13
- }
@@ -1,3 +0,0 @@
1
- import { GeneratedDomainGetToplevelDomain } from "../../../generated/domain/getToplevelDomain.js";
2
- export default class Get extends GeneratedDomainGetToplevelDomain {
3
- }
@@ -1,6 +0,0 @@
1
- /* eslint-disable */
2
- /* prettier-ignore */
3
- /* This file is auto-generated with acg (@mittwald/api-code-generator) */
4
- import { GeneratedDomainGetToplevelDomain } from "../../../generated/domain/getToplevelDomain.js";
5
- export default class Get extends GeneratedDomainGetToplevelDomain {
6
- }