@mittwald/cli 1.0.0-alpha.21 → 1.0.0-alpha.22
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.
- package/README.md +111 -149
- package/dist/esm/Translator.js +2 -1
- package/dist/esm/commands/app/copy.js +1 -1
- package/dist/esm/commands/app/{install → create}/node.d.ts +3 -2
- package/dist/esm/commands/app/create/node.js +13 -0
- package/dist/esm/commands/app/{install → create}/php.d.ts +3 -2
- package/dist/esm/commands/app/create/php.js +13 -0
- package/dist/esm/commands/app/dependency/update.js +2 -2
- package/dist/esm/commands/app/dependency/versions.js +1 -1
- package/dist/esm/commands/app/list.js +6 -1
- package/dist/esm/commands/app/ssh.d.ts +11 -0
- package/dist/esm/commands/app/ssh.js +46 -0
- package/dist/esm/commands/app/uninstall.js +1 -1
- package/dist/esm/commands/app/versions.js +1 -1
- package/dist/esm/commands/conversation/close.js +1 -1
- package/dist/esm/commands/conversation/create.js +1 -1
- package/dist/esm/commands/conversation/reply.js +1 -1
- package/dist/esm/commands/conversation/show.js +2 -2
- package/dist/esm/commands/conversation/show2.js +1 -3
- package/dist/esm/commands/database/mysql/charsets.js +1 -3
- package/dist/esm/commands/database/mysql/create.js +3 -3
- package/dist/esm/commands/database/mysql/delete.js +1 -1
- package/dist/esm/commands/database/mysql/get.js +1 -1
- package/dist/esm/commands/database/mysql/list.js +1 -1
- package/dist/esm/commands/database/mysql/phpmyadmin.js +2 -2
- package/dist/esm/commands/database/mysql/user/get.js +1 -1
- package/dist/esm/commands/database/mysql/user/list.js +1 -3
- package/dist/esm/commands/database/redis/create.js +2 -2
- package/dist/esm/commands/database/redis/get.js +1 -1
- package/dist/esm/commands/database/redis/list.js +1 -1
- package/dist/esm/commands/domain/list.js +1 -3
- package/dist/esm/commands/domain/ownership/list.js +1 -1
- package/dist/esm/commands/domain/virtualhost/create.js +2 -2
- package/dist/esm/commands/domain/virtualhost/delete.js +1 -1
- package/dist/esm/commands/domain/virtualhost/get.js +4 -4
- package/dist/esm/commands/domain/virtualhost/list.js +1 -1
- package/dist/esm/commands/mail/address/create.js +1 -1
- package/dist/esm/commands/mail/address/delete.js +1 -1
- package/dist/esm/commands/mail/address/list.js +1 -3
- package/dist/esm/commands/org/delete.js +1 -1
- package/dist/esm/commands/org/get.js +2 -2
- package/dist/esm/commands/org/invite/list-own.js +1 -1
- package/dist/esm/commands/org/invite/list.js +1 -1
- package/dist/esm/commands/org/invite/revoke.js +2 -2
- package/dist/esm/commands/org/invite.js +1 -1
- package/dist/esm/commands/org/list.js +1 -3
- package/dist/esm/commands/org/membership/list-own.js +2 -4
- package/dist/esm/commands/org/membership/list.d.ts +1 -0
- package/dist/esm/commands/org/membership/list.js +2 -2
- package/dist/esm/commands/org/membership/revoke.js +3 -3
- package/dist/esm/commands/project/backup/create.js +2 -2
- package/dist/esm/commands/project/backup/delete.js +1 -1
- package/dist/esm/commands/project/backup/download.js +3 -3
- package/dist/esm/commands/project/backup/list.js +1 -1
- package/dist/esm/commands/project/backupschedule/list.js +1 -1
- package/dist/esm/commands/project/create.js +2 -2
- package/dist/esm/commands/project/cronjob/execution/get.js +1 -1
- package/dist/esm/commands/project/cronjob/execution/list.js +1 -3
- package/dist/esm/commands/project/cronjob/execution/logs.js +4 -3
- package/dist/esm/commands/project/cronjob/list.js +1 -3
- package/dist/esm/commands/project/delete.js +1 -1
- package/dist/esm/commands/project/filesystem/usage.js +2 -2
- package/dist/esm/commands/project/get.js +4 -4
- package/dist/esm/commands/project/membership/list.js +1 -1
- package/dist/esm/commands/project/ssh.js +1 -1
- package/dist/esm/commands/user/api-token/revoke.js +1 -1
- package/dist/esm/commands/user/ssh-key/delete.js +1 -1
- package/dist/esm/generated/conversation/getCategory.js +1 -1
- package/dist/esm/generated/conversation/getConversation.js +1 -1
- package/dist/esm/generated/conversation/listCategories.js +1 -3
- package/dist/esm/generated/conversation/listConversations.js +1 -3
- package/dist/esm/generated/conversation/listMessagesByConversation.js +1 -3
- package/dist/esm/generated/cronjob/getCronjob.js +1 -1
- package/dist/esm/generated/cronjob/getExecution.js +1 -1
- package/dist/esm/generated/domain/dnsZoneGetSpecific.js +1 -1
- package/dist/esm/generated/domain/dnsZonesForProject.js +1 -1
- package/dist/esm/generated/domain/getDomain.js +1 -1
- package/dist/esm/generated/domain/getHandleFields.js +1 -1
- package/dist/esm/generated/domain/getSpecificDomainOwnership.js +1 -1
- package/dist/esm/generated/file/getFile.js +1 -1
- package/dist/esm/generated/file/getFileMeta.js +1 -1
- package/dist/esm/generated/file/getFileTokenRules.js +1 -1
- package/dist/esm/generated/file/getFileTypeRules.js +1 -1
- package/dist/esm/generated/mail/deliveryboxGetSpecific.js +1 -1
- package/dist/esm/generated/mail/deliveryboxList.js +1 -3
- package/dist/esm/generated/mail/mailaddressGetSpecific.js +1 -1
- package/dist/esm/generated/mail/mailaddressList.js +1 -3
- package/dist/esm/generated/mail/projectsettingGetSpecific.js +1 -1
- package/dist/esm/generated/notification/newsletterGetInfo.js +1 -1
- package/dist/esm/generated/notification/scountUnreadNotifications.js +1 -1
- package/dist/esm/generated/notification/slistNotifications.js +1 -3
- package/dist/esm/generated/project/getProject.js +1 -1
- package/dist/esm/generated/project/getProjectInvite.js +1 -1
- package/dist/esm/generated/project/getProjectMembership.js +1 -1
- package/dist/esm/generated/project/getSelfMembershipForProject.js +1 -1
- package/dist/esm/generated/project/getServer.js +1 -1
- package/dist/esm/generated/project/listInvitesForProject.js +1 -3
- package/dist/esm/generated/project/listMembershipsForProject.js +1 -3
- package/dist/esm/generated/project/listProjectInvites.js +1 -3
- package/dist/esm/generated/project/listProjectMemberships.js +1 -3
- package/dist/esm/generated/project/listProjects.js +1 -3
- package/dist/esm/generated/project/listServers.js +1 -3
- package/dist/esm/generated/sshsftpUser/sftpUserGetSftpUser.js +1 -1
- package/dist/esm/generated/sshsftpUser/sftpUserListSftpUsers.js +1 -3
- package/dist/esm/generated/sshsftpUser/sshUserGetSshUser.js +1 -1
- package/dist/esm/generated/sshsftpUser/sshUserListSshUsers.js +1 -3
- package/dist/esm/generated/user/getApiToken.js +1 -1
- package/dist/esm/generated/user/getPersonalizedSettings.js +1 -1
- package/dist/esm/generated/user/getSession.js +1 -1
- package/dist/esm/generated/user/getSshKey.js +1 -1
- package/dist/esm/generated/user/getUser.js +1 -1
- package/dist/esm/generated/user/listApiTokens.js +1 -3
- package/dist/esm/generated/user/listFeedback.js +1 -3
- package/dist/esm/generated/user/listSessions.js +1 -3
- package/dist/esm/generated/user/listSshKeys.js +1 -3
- package/dist/esm/lib/app/Installer.d.ts +1 -1
- package/dist/esm/lib/app/Installer.js +2 -2
- package/dist/esm/lib/app/hooks.js +7 -8
- package/dist/esm/lib/app/install.js +1 -1
- package/dist/esm/lib/app/uuid.js +2 -1
- package/dist/esm/lib/app/versions.js +2 -6
- package/dist/esm/lib/app/wait.js +1 -1
- package/dist/esm/lib/database/common.js +1 -1
- package/dist/esm/lib/database/mysql/connect.js +2 -2
- package/dist/esm/lib/database/mysql/flags.js +1 -1
- package/dist/esm/lib/database/redis/connect.js +1 -1
- package/dist/esm/lib/database/redis/flags.js +1 -1
- package/dist/esm/lib/project/hooks.js +1 -1
- package/dist/esm/lib/project/ingress.js +1 -1
- package/dist/esm/lib/project/shortId.js +1 -1
- package/dist/esm/lib/projectbackup/hooks.js +2 -2
- package/dist/esm/rendering/lib/getTerminalWidth.d.ts +1 -1
- package/dist/esm/rendering/lib/getTerminalWidth.js +1 -1
- package/dist/esm/rendering/react/RenderBaseCommand.js +5 -1
- package/dist/esm/rendering/react/components/AppInstallation/AppInstallationDetails.js +5 -2
- package/dist/esm/rendering/react/components/Conversation/ConversationMeta.js +1 -3
- package/dist/esm/rendering/react/components/Table/model/Column.d.ts +1 -1
- package/dist/esm/rendering/react/components/Table/model/Column.js +5 -2
- package/dist/esm/rendering/react/components/Table/model/ColumnOptions.js +1 -1
- package/dist/esm/rendering/react/hooks/useIncreaseInkStdoutColumns.d.ts +1 -0
- package/dist/esm/rendering/react/hooks/useIncreaseInkStdoutColumns.js +9 -0
- package/dist/esm/rendering/react/hooks/useMyUserProfile.js +1 -3
- package/dist/esm/rendering/react/measure/MeasureContextProvider.js +6 -2
- package/package.json +5 -7
- package/dist/esm/commands/app/install/node.js +0 -13
- package/dist/esm/commands/app/install/php.js +0 -13
- package/dist/esm/commands/domain/tld/get.d.ts +0 -3
- package/dist/esm/commands/domain/tld/get.js +0 -6
- package/dist/esm/commands/domain/tld/list.d.ts +0 -9
- package/dist/esm/commands/domain/tld/list.js +0 -6
- package/dist/esm/generated/domain/getToplevelDomain.d.ts +0 -16
- package/dist/esm/generated/domain/getToplevelDomain.js +0 -25
- package/dist/esm/generated/domain/listToplevelDomains.d.ts +0 -13
- package/dist/esm/generated/domain/listToplevelDomains.js +0 -17
|
@@ -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({
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
38
|
-
|
|
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
|
-
|
|
5
|
+
projectId,
|
|
6
6
|
data: {
|
|
7
7
|
appVersionId: appVersion.id,
|
|
8
8
|
description: flags["site-title"],
|
package/dist/esm/lib/app/uuid.js
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
44
|
-
appId,
|
|
45
|
-
},
|
|
41
|
+
appId,
|
|
46
42
|
});
|
|
47
43
|
if (!appVersion) {
|
|
48
44
|
return getLatestAvailableAppVersionForApp(apiClient, appId);
|
package/dist/esm/lib/app/wait.js
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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] :
|
|
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: () =>
|
|
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)
|
|
@@ -18,7 +21,7 @@ export const AppInstallationDetails = ({ app, appInstallation }) => {
|
|
|
18
21
|
} })),
|
|
19
22
|
"Installation Path": _jsx(Value, { children: appInstallation.installationPath }),
|
|
20
23
|
Description: _jsx(Value, { children: appInstallation.description }),
|
|
21
|
-
Status: (_jsx(AppInstallationStatus, { appInstallation: appInstallation, desired: desiredAppVersion, current: currentAppVersion })),
|
|
24
|
+
Status: customInstallation ? (_jsx(Text, { children: "custom application" })) : (_jsx(AppInstallationStatus, { appInstallation: appInstallation, desired: desiredAppVersion, current: currentAppVersion })),
|
|
22
25
|
};
|
|
23
26
|
const title = (_jsxs(_Fragment, { children: ["APP INSTALLATION: ", _jsx(Value, { children: app.name }), " in", " ", _jsx(Value, { children: appInstallation.installationPath })] }));
|
|
24
27
|
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
|
-
|
|
13
|
-
conversationId: id,
|
|
14
|
-
},
|
|
12
|
+
conversationId: id,
|
|
15
13
|
},
|
|
16
14
|
], {
|
|
17
15
|
loaderId: "getConversation",
|
|
@@ -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 =
|
|
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
|
+
};
|
|
@@ -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
|
-
|
|
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.
|
|
3
|
+
"version": "1.0.0-alpha.22",
|
|
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": "^
|
|
48
|
-
"@mittwald/api-client-commons": "^
|
|
49
|
-
"@mittwald/react-use-promise": "^1.
|
|
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,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
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Simplify } from "@mittwald/api-client-commons";
|
|
2
|
-
import { MittwaldAPIV2 } from "@mittwald/api-client";
|
|
3
|
-
import { SuccessfulResponse } from "../../../types.js";
|
|
4
|
-
import { GeneratedDomainListToplevelDomains, Response } from "../../../generated/domain/listToplevelDomains.js";
|
|
5
|
-
type ResponseItem = Simplify<MittwaldAPIV2.Paths.V2ToplevelDomains.Get.Responses.$200.Content.ApplicationJson[number]>;
|
|
6
|
-
export default class List extends GeneratedDomainListToplevelDomains<ResponseItem> {
|
|
7
|
-
protected mapData(data: SuccessfulResponse<Response, 200>["data"]): MittwaldAPIV2.Components.Schemas.DomainTopLevel[];
|
|
8
|
-
}
|
|
9
|
-
export {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { MittwaldAPIV2, MittwaldAPIV2Client } from "@mittwald/api-client";
|
|
2
|
-
import { GetBaseCommand } from "../../GetBaseCommand.js";
|
|
3
|
-
export type PathParams = MittwaldAPIV2.Paths.V2ToplevelDomainsTld.Get.Parameters.Path;
|
|
4
|
-
type APIResponse = Awaited<ReturnType<MittwaldAPIV2Client["domain"]["getToplevelDomain"]>>;
|
|
5
|
-
export declare abstract class GeneratedDomainGetToplevelDomain extends GetBaseCommand<typeof GeneratedDomainGetToplevelDomain, APIResponse> {
|
|
6
|
-
static description: string;
|
|
7
|
-
static flags: {
|
|
8
|
-
[x: string]: import("@oclif/core/lib/interfaces/parser.js").CompletableFlag<any>;
|
|
9
|
-
};
|
|
10
|
-
static args: {
|
|
11
|
-
tld: import("@oclif/core/lib/interfaces/parser.js").Arg<string, Record<string, unknown>>;
|
|
12
|
-
};
|
|
13
|
-
protected getData(): Promise<APIResponse>;
|
|
14
|
-
protected mapParams(input: PathParams): Promise<PathParams> | PathParams;
|
|
15
|
-
}
|
|
16
|
-
export {};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
/* prettier-ignore */
|
|
3
|
-
/* This file is auto-generated with acg (@mittwald/api-code-generator) */
|
|
4
|
-
import { Args } from "@oclif/core";
|
|
5
|
-
import { GetBaseCommand } from "../../GetBaseCommand.js";
|
|
6
|
-
export class GeneratedDomainGetToplevelDomain extends GetBaseCommand {
|
|
7
|
-
static description = "Get a toplevel domain.";
|
|
8
|
-
static flags = {
|
|
9
|
-
...GetBaseCommand.baseFlags,
|
|
10
|
-
};
|
|
11
|
-
static args = {
|
|
12
|
-
tld: Args.string({
|
|
13
|
-
description: "undefined",
|
|
14
|
-
required: true,
|
|
15
|
-
}),
|
|
16
|
-
};
|
|
17
|
-
async getData() {
|
|
18
|
-
return await this.apiClient.domain.getToplevelDomain({
|
|
19
|
-
pathParameters: await this.mapParams(this.args),
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
mapParams(input) {
|
|
23
|
-
return input;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { MittwaldAPIV2, MittwaldAPIV2Client } from "@mittwald/api-client";
|
|
2
|
-
import { ListBaseCommand } from "../../ListBaseCommand.js";
|
|
3
|
-
export type PathParams = MittwaldAPIV2.Paths.V2ToplevelDomains.Get.Parameters.Path;
|
|
4
|
-
export type Response = Awaited<ReturnType<MittwaldAPIV2Client["domain"]["listToplevelDomains"]>>;
|
|
5
|
-
export declare abstract class GeneratedDomainListToplevelDomains<TItem extends Record<string, unknown>> extends ListBaseCommand<typeof GeneratedDomainListToplevelDomains, TItem, Response> {
|
|
6
|
-
static description: string;
|
|
7
|
-
static args: {};
|
|
8
|
-
static flags: {
|
|
9
|
-
[x: string]: import("@oclif/core/lib/interfaces/parser.js").CompletableFlag<any>;
|
|
10
|
-
};
|
|
11
|
-
getData(): Promise<Response>;
|
|
12
|
-
protected mapParams(input: PathParams): Promise<PathParams> | PathParams;
|
|
13
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { ListBaseCommand } from "../../ListBaseCommand.js";
|
|
2
|
-
export class GeneratedDomainListToplevelDomains extends ListBaseCommand {
|
|
3
|
-
static description = "List all supported toplevel domains.";
|
|
4
|
-
static args = {};
|
|
5
|
-
static flags = {
|
|
6
|
-
...ListBaseCommand.baseFlags,
|
|
7
|
-
};
|
|
8
|
-
async getData() {
|
|
9
|
-
const pathParams = {};
|
|
10
|
-
return await this.apiClient.domain.listToplevelDomains({
|
|
11
|
-
pathParameters: await this.mapParams(pathParams),
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
mapParams(input) {
|
|
15
|
-
return input;
|
|
16
|
-
}
|
|
17
|
-
}
|